diff options
Diffstat (limited to 'arch/sh/mm/init.c')
-rw-r--r-- | arch/sh/mm/init.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 58a93fb3d965..939ca0f356f6 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <linux/memblock.h> | 19 | #include <linux/memblock.h> |
20 | #include <linux/dma-mapping.h> | 20 | #include <linux/dma-mapping.h> |
21 | #include <linux/export.h> | ||
21 | #include <asm/mmu_context.h> | 22 | #include <asm/mmu_context.h> |
22 | #include <asm/mmzone.h> | 23 | #include <asm/mmzone.h> |
23 | #include <asm/kexec.h> | 24 | #include <asm/kexec.h> |
@@ -287,6 +288,8 @@ static void __init do_init_bootmem(void) | |||
287 | static void __init early_reserve_mem(void) | 288 | static void __init early_reserve_mem(void) |
288 | { | 289 | { |
289 | unsigned long start_pfn; | 290 | unsigned long start_pfn; |
291 | u32 zero_base = (u32)__MEMORY_START + (u32)PHYSICAL_OFFSET; | ||
292 | u32 start = zero_base + (u32)CONFIG_ZERO_PAGE_OFFSET; | ||
290 | 293 | ||
291 | /* | 294 | /* |
292 | * Partially used pages are not usable - thus | 295 | * Partially used pages are not usable - thus |
@@ -300,15 +303,13 @@ static void __init early_reserve_mem(void) | |||
300 | * this catches the (definitely buggy) case of us accidentally | 303 | * this catches the (definitely buggy) case of us accidentally |
301 | * initializing the bootmem allocator with an invalid RAM area. | 304 | * initializing the bootmem allocator with an invalid RAM area. |
302 | */ | 305 | */ |
303 | memblock_reserve(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET, | 306 | memblock_reserve(start, (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) - start); |
304 | (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) - | ||
305 | (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET)); | ||
306 | 307 | ||
307 | /* | 308 | /* |
308 | * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET. | 309 | * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET. |
309 | */ | 310 | */ |
310 | if (CONFIG_ZERO_PAGE_OFFSET != 0) | 311 | if (CONFIG_ZERO_PAGE_OFFSET != 0) |
311 | memblock_reserve(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET); | 312 | memblock_reserve(zero_base, CONFIG_ZERO_PAGE_OFFSET); |
312 | 313 | ||
313 | /* | 314 | /* |
314 | * Handle additional early reservations | 315 | * Handle additional early reservations |