提交 cbb8fc07 编写于 作者: F Franck Bui-Huu 提交者: Ralf Baechle

[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: NFranck Bui-Huu <fbuihuu@gmail.com>
Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 b228f4c5
...@@ -316,7 +316,7 @@ static int __init page_is_ram(unsigned long pagenr) ...@@ -316,7 +316,7 @@ static int __init page_is_ram(unsigned long pagenr)
void __init paging_init(void) void __init paging_init(void)
{ {
unsigned long zones_size[MAX_NR_ZONES] = { 0, }; unsigned long zones_size[MAX_NR_ZONES] = { 0, };
unsigned long max_dma, high, low; unsigned long max_dma, low;
#ifndef CONFIG_FLATMEM #ifndef CONFIG_FLATMEM
unsigned long zholes_size[MAX_NR_ZONES] = { 0, }; unsigned long zholes_size[MAX_NR_ZONES] = { 0, };
unsigned long i, j, pfn; unsigned long i, j, pfn;
...@@ -331,7 +331,6 @@ void __init paging_init(void) ...@@ -331,7 +331,6 @@ void __init paging_init(void)
max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
low = max_low_pfn; low = max_low_pfn;
high = highend_pfn;
#ifdef CONFIG_ISA #ifdef CONFIG_ISA
if (low < max_dma) if (low < max_dma)
...@@ -344,13 +343,13 @@ void __init paging_init(void) ...@@ -344,13 +343,13 @@ void __init paging_init(void)
zones_size[ZONE_DMA] = low; zones_size[ZONE_DMA] = low;
#endif #endif
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
if (cpu_has_dc_aliases) { zones_size[ZONE_HIGHMEM] = highend_pfn - highstart_pfn;
printk(KERN_WARNING "This processor doesn't support highmem.");
if (high - low) if (cpu_has_dc_aliases && zones_size[ZONE_HIGHMEM]) {
printk(" %ldk highmem ignored", high - low); printk(KERN_WARNING "This processor doesn't support highmem."
printk("\n"); " %ldk highmem ignored\n", zones_size[ZONE_HIGHMEM]);
} else zones_size[ZONE_HIGHMEM] = 0;
zones_size[ZONE_HIGHMEM] = high - low; }
#endif #endif
#ifdef CONFIG_FLATMEM #ifdef CONFIG_FLATMEM
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册