aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/setup.c
diff options
context:
space:
mode:
authorStuart Menefy <stuart.menefy@st.com>2008-09-05 16:29:40 +0900
committerPaul Mundt <lethal@linux-sh.org>2008-09-08 10:35:05 +0900
commitf040ddaf4cfd28f25ea9d6a42d3c734d5c3f6798 (patch)
tree8cb1eaf4eb57b49a345c9d6ae5ff82518632b3dd /arch/sh/kernel/setup.c
parentsh: Fix uImage load address in 32-bit mode. (diff)
downloadlinux-dev-f040ddaf4cfd28f25ea9d6a42d3c734d5c3f6798.tar.xz
linux-dev-f040ddaf4cfd28f25ea9d6a42d3c734d5c3f6798.zip
sh: Fix an unusual memory initialisation error.
This fixes a problems with the set up of Linux memory: - When reserving memory at boot time, the code previously reserved the bottom page of memory, and then from one page up to the end of the bootmap. This had the desired effect, but was strictly speaking wrong, as the one page was actually whatever CONFIG_ZERO_PAGE_OFFSET had been set to. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/setup.c')
-rw-r--r--arch/sh/kernel/setup.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index fc7171a9c804..fc098c8af052 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -233,15 +233,17 @@ void __init setup_bootmem_allocator(unsigned long free_pfn)
* case of us accidentally initializing the bootmem allocator with
* an invalid RAM area.
*/
- reserve_bootmem(__MEMORY_START+PAGE_SIZE,
- (PFN_PHYS(free_pfn)+bootmap_size+PAGE_SIZE-1)-__MEMORY_START,
- BOOTMEM_DEFAULT);
+ reserve_bootmem(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET,
+ (PFN_PHYS(free_pfn) + bootmap_size + PAGE_SIZE - 1) -
+ (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET),
+ BOOTMEM_DEFAULT);
/*
* reserve physical page 0 - it's a special BIOS page on many boxes,
* enabling clean reboots, SMP operation, laptop functions.
*/
- reserve_bootmem(__MEMORY_START, PAGE_SIZE, BOOTMEM_DEFAULT);
+ reserve_bootmem(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET,
+ BOOTMEM_DEFAULT);
sparse_memory_present_with_active_regions(0);