diff options
author | Franck Bui-Huu <fbuihuu@gmail.com> | 2006-12-06 10:48:28 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-12-11 20:46:24 -0500 |
commit | cbb8fc07974073543fdc61da23713ab49ddd3ced (patch) | |
tree | b7f2bf310dd2ae832c6b158d56f9124a18b0bc52 /arch/mips | |
parent | b228f4c54df37b53c6f364aa7f3efa4280bcc4f0 (diff) |
[MIPS] paging_init(): use highend_pfn/highstart_pfn
This patch makes paging_init() use highend_pfn/highstart_pfn globals.
It removes the need of 'high' local which was needed only by HIGHMEM config.
More important perhaps, it fixes a bug when HIGHMEM is set but there's
actually no physical highmem (highend_pfn = 0)
Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/mm/init.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 9e29ba9205f0..ea2d15370bb7 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
@@ -316,7 +316,7 @@ static int __init page_is_ram(unsigned long pagenr) | |||
316 | void __init paging_init(void) | 316 | void __init paging_init(void) |
317 | { | 317 | { |
318 | unsigned long zones_size[MAX_NR_ZONES] = { 0, }; | 318 | unsigned long zones_size[MAX_NR_ZONES] = { 0, }; |
319 | unsigned long max_dma, high, low; | 319 | unsigned long max_dma, low; |
320 | #ifndef CONFIG_FLATMEM | 320 | #ifndef CONFIG_FLATMEM |
321 | unsigned long zholes_size[MAX_NR_ZONES] = { 0, }; | 321 | unsigned long zholes_size[MAX_NR_ZONES] = { 0, }; |
322 | unsigned long i, j, pfn; | 322 | unsigned long i, j, pfn; |
@@ -331,7 +331,6 @@ void __init paging_init(void) | |||
331 | 331 | ||
332 | max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; | 332 | max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; |
333 | low = max_low_pfn; | 333 | low = max_low_pfn; |
334 | high = highend_pfn; | ||
335 | 334 | ||
336 | #ifdef CONFIG_ISA | 335 | #ifdef CONFIG_ISA |
337 | if (low < max_dma) | 336 | if (low < max_dma) |
@@ -344,13 +343,13 @@ void __init paging_init(void) | |||
344 | zones_size[ZONE_DMA] = low; | 343 | zones_size[ZONE_DMA] = low; |
345 | #endif | 344 | #endif |
346 | #ifdef CONFIG_HIGHMEM | 345 | #ifdef CONFIG_HIGHMEM |
347 | if (cpu_has_dc_aliases) { | 346 | zones_size[ZONE_HIGHMEM] = highend_pfn - highstart_pfn; |
348 | printk(KERN_WARNING "This processor doesn't support highmem."); | 347 | |
349 | if (high - low) | 348 | if (cpu_has_dc_aliases && zones_size[ZONE_HIGHMEM]) { |
350 | printk(" %ldk highmem ignored", high - low); | 349 | printk(KERN_WARNING "This processor doesn't support highmem." |
351 | printk("\n"); | 350 | " %ldk highmem ignored\n", zones_size[ZONE_HIGHMEM]); |
352 | } else | 351 | zones_size[ZONE_HIGHMEM] = 0; |
353 | zones_size[ZONE_HIGHMEM] = high - low; | 352 | } |
354 | #endif | 353 | #endif |
355 | 354 | ||
356 | #ifdef CONFIG_FLATMEM | 355 | #ifdef CONFIG_FLATMEM |