Modified: trunk/arch/blackfin/kernel/process.c (9141 => 9142)
--- trunk/arch/blackfin/kernel/process.c 2010-09-15 06:14:52 UTC (rev 9141)
+++ trunk/arch/blackfin/kernel/process.c 2010-09-16 08:37:37 UTC (rev 9142)
@@ -454,8 +454,22 @@
if (0)
#endif
{
- if (in_mem(addr, size, memory_start, memory_end))
- return 1;
+ /* When init section is released to kernel memory management system,
+ * it may be merged into the same buddy block if it is adjacent to
+ * generic allocable memory region. In this case, an address range
+ * may across the border.
+ */
+ if (__init_end == memory_start)
+ if (in_mem(addr, size, (unsigned long)__init_begin, (unsigned long)memory_end))
+ return 1;
+ else {
+ if (in_mem(addr, size, memory_start, memory_end))
+ return 1;
+
+ if (in_mem(addr, size, (unsigned long)__init_begin, (unsigned long)__init_end))
+ return 1;
+ }
+
if (in_mem(addr, size, memory_mtd_end, physical_mem_end))
return 1;
# ifndef CONFIG_ROMFS_ON_MTD
@@ -465,13 +479,23 @@
if (in_mem(addr, size, memory_mtd_start, memory_mtd_end))
return 1;
} else {
- if (in_mem(addr, size, memory_start, physical_mem_end))
- return 1;
+ /* When init section is released to kernel memory management system,
+ * it may be merged into the same buddy block if it is adjacent to
+ * generic allocable memory region. In this case, an address range
+ * may across the border.
+ */
+ if (__init_end == memory_start)
+ if (in_mem(addr, size, (unsigned long)__init_begin, (unsigned long)physical_mem_end))
+ return 1;
+ else {
+ if (in_mem(addr, size, memory_start, physical_mem_end))
+ return 1;
+
+ if (in_mem(addr, size, (unsigned long)__init_begin, (unsigned long)__init_end))
+ return 1;
+ }
}
- if (in_mem(addr, size, (unsigned long)__init_begin, (unsigned long)__init_end))
- return 1;
-
if (in_mem_const(addr, size, L1_CODE_START, L1_CODE_LENGTH))
return 1;
if (in_mem_const_off(addr, size, _etext_l1 - _stext_l1, L1_CODE_START, L1_CODE_LENGTH))