diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2008-04-15 15:52:22 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-04-16 17:46:13 -0400 |
commit | d7917ba7051e3fd12ebe2d5a09b29fb3a2b38190 (patch) | |
tree | 339d273aee5eb2cb83e226945f0319b51f4bdf3c /arch/powerpc/mm/init_32.c | |
parent | 99c62dd773797b68f3b1ca6bb3274725d1852fa2 (diff) |
[POWERPC] Introduce lowmem_end_addr to distinguish from total_lowmem
total_lowmem represents the amount of low memory, not the physical
address that low memory ends at. If the start of memory is at 0 it
happens that total_lowmem can be used as both the size and the address
that lowmem ends at (or more specifically one byte beyond the end).
To make the code a bit more clear and deal with the case when the start of
memory isn't at physical 0, we introduce lowmem_end_addr that represents
one byte beyond the last physical address in the lowmem region.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/mm/init_32.c')
-rw-r--r-- | arch/powerpc/mm/init_32.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c index 1d7e5b8ade6a..ba61d088d2a2 100644 --- a/arch/powerpc/mm/init_32.c +++ b/arch/powerpc/mm/init_32.c | |||
@@ -146,6 +146,7 @@ void __init MMU_init(void) | |||
146 | } | 146 | } |
147 | 147 | ||
148 | total_lowmem = total_memory = lmb_end_of_DRAM() - memstart_addr; | 148 | total_lowmem = total_memory = lmb_end_of_DRAM() - memstart_addr; |
149 | lowmem_end_addr = memstart_addr + total_lowmem; | ||
149 | 150 | ||
150 | #ifdef CONFIG_FSL_BOOKE | 151 | #ifdef CONFIG_FSL_BOOKE |
151 | /* Freescale Book-E parts expect lowmem to be mapped by fixed TLB | 152 | /* Freescale Book-E parts expect lowmem to be mapped by fixed TLB |
@@ -156,9 +157,10 @@ void __init MMU_init(void) | |||
156 | 157 | ||
157 | if (total_lowmem > __max_low_memory) { | 158 | if (total_lowmem > __max_low_memory) { |
158 | total_lowmem = __max_low_memory; | 159 | total_lowmem = __max_low_memory; |
160 | lowmem_end_addr = memstart_addr + total_lowmem; | ||
159 | #ifndef CONFIG_HIGHMEM | 161 | #ifndef CONFIG_HIGHMEM |
160 | total_memory = total_lowmem; | 162 | total_memory = total_lowmem; |
161 | lmb_enforce_memory_limit(total_lowmem); | 163 | lmb_enforce_memory_limit(lowmem_end_addr); |
162 | lmb_analyze(); | 164 | lmb_analyze(); |
163 | #endif /* CONFIG_HIGHMEM */ | 165 | #endif /* CONFIG_HIGHMEM */ |
164 | } | 166 | } |