aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2014-10-03 19:46:34 -0400
committerMax Filippov <jcmvbkbc@gmail.com>2014-10-21 05:28:57 -0400
commit566fb58ed422537715023d1f19b705247a640b11 (patch)
tree9051c7de2de61b18e0cceb1f63a81e094b5d6f1a
parent2eabc1800d1ef7a850672aedcc266a831572af63 (diff)
xtensa: nommu: reserve memory below PLATFORM_DEFAULT_MEM_START
Memory accounting code can't handle pages below PLATFORM_DEFAULT_MEM_START. Reserve those pages if they exist. When PLATFORM_DEFAULT_MEM_START is zero reserve one page at address 0 to make sure that successfull memory allocations don't return NULL. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
-rw-r--r--arch/xtensa/mm/init.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c
index 77ed20209ca5..5a084fa5b608 100644
--- a/arch/xtensa/mm/init.c
+++ b/arch/xtensa/mm/init.c
@@ -239,6 +239,17 @@ void __init bootmem_init(void)
239 unsigned long bootmap_start, bootmap_size; 239 unsigned long bootmap_start, bootmap_size;
240 int i; 240 int i;
241 241
242 /* Reserve all memory below PLATFORM_DEFAULT_MEM_START, as memory
243 * accounting doesn't work for pages below that address.
244 *
245 * If PLATFORM_DEFAULT_MEM_START is zero reserve page at address 0:
246 * successfull allocations should never return NULL.
247 */
248 if (PLATFORM_DEFAULT_MEM_START)
249 mem_reserve(0, PLATFORM_DEFAULT_MEM_START, 0);
250 else
251 mem_reserve(0, 1, 0);
252
242 sysmem_dump(); 253 sysmem_dump();
243 max_low_pfn = max_pfn = 0; 254 max_low_pfn = max_pfn = 0;
244 min_low_pfn = ~0; 255 min_low_pfn = ~0;