diff options
author | Chen Liqin <liqin.chen@sunplusct.com> | 2009-11-18 00:28:13 -0500 |
---|---|---|
committer | Chen Liqin <liqin.chen@sunplusct.com> | 2009-12-17 05:28:31 -0500 |
commit | 202b864ad5aa34989609a3073acbe7a04795b265 (patch) | |
tree | bfe99f7623102802726f1265e0032673435f04fd /arch | |
parent | 11ab3f3d3c2474d3ed6912443de74c3972bd6f23 (diff) |
score: fixed pfn_valid define.
Signed-off-by: Cui Bixiong <bixiong@sunnorth.com.cn>
Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com>
modified: arch/score/include/asm/page.h
modified: arch/score/kernel/setup.c
modified: arch/score/mm/init.c
Diffstat (limited to 'arch')
-rw-r--r-- | arch/score/include/asm/page.h | 2 | ||||
-rw-r--r-- | arch/score/kernel/setup.c | 1 | ||||
-rw-r--r-- | arch/score/mm/init.c | 5 |
3 files changed, 2 insertions, 6 deletions
diff --git a/arch/score/include/asm/page.h b/arch/score/include/asm/page.h index d92a5a2d36d4..1e9ade8e77e6 100644 --- a/arch/score/include/asm/page.h +++ b/arch/score/include/asm/page.h | |||
@@ -74,7 +74,7 @@ extern unsigned long max_pfn; | |||
74 | #define page_to_bus(page) (page_to_phys(page)) | 74 | #define page_to_bus(page) (page_to_phys(page)) |
75 | #define phys_to_page(paddr) (pfn_to_page(phys_to_pfn(paddr))) | 75 | #define phys_to_page(paddr) (pfn_to_page(phys_to_pfn(paddr))) |
76 | 76 | ||
77 | #define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) < max_mapnr) | 77 | #define pfn_valid(pfn) (((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn)) |
78 | 78 | ||
79 | #define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) | 79 | #define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) |
80 | 80 | ||
diff --git a/arch/score/kernel/setup.c b/arch/score/kernel/setup.c index 6a2503c75c4e..6f898c057878 100644 --- a/arch/score/kernel/setup.c +++ b/arch/score/kernel/setup.c | |||
@@ -49,6 +49,7 @@ static void __init bootmem_init(void) | |||
49 | 49 | ||
50 | min_low_pfn = PFN_UP(MEMORY_START); | 50 | min_low_pfn = PFN_UP(MEMORY_START); |
51 | max_low_pfn = PFN_UP(MEMORY_START + MEMORY_SIZE); | 51 | max_low_pfn = PFN_UP(MEMORY_START + MEMORY_SIZE); |
52 | max_mapnr = max_low_pfn - min_low_pfn; | ||
52 | 53 | ||
53 | /* Initialize the boot-time allocator with low memory only. */ | 54 | /* Initialize the boot-time allocator with low memory only. */ |
54 | bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, | 55 | bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, |
diff --git a/arch/score/mm/init.c b/arch/score/mm/init.c index 4e3dcd0c4716..8c15b2c85d5a 100644 --- a/arch/score/mm/init.c +++ b/arch/score/mm/init.c | |||
@@ -83,7 +83,6 @@ void __init mem_init(void) | |||
83 | unsigned long codesize, reservedpages, datasize, initsize; | 83 | unsigned long codesize, reservedpages, datasize, initsize; |
84 | unsigned long tmp, ram = 0; | 84 | unsigned long tmp, ram = 0; |
85 | 85 | ||
86 | max_mapnr = max_low_pfn; | ||
87 | high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); | 86 | high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); |
88 | totalram_pages += free_all_bootmem(); | 87 | totalram_pages += free_all_bootmem(); |
89 | totalram_pages -= setup_zero_page(); /* Setup zeroed pages. */ | 88 | totalram_pages -= setup_zero_page(); /* Setup zeroed pages. */ |
@@ -101,10 +100,6 @@ void __init mem_init(void) | |||
101 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; | 100 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; |
102 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; | 101 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; |
103 | 102 | ||
104 | kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT); | ||
105 | kclist_add(&kcore_vmalloc, (void *) VMALLOC_START, | ||
106 | VMALLOC_END - VMALLOC_START); | ||
107 | |||
108 | printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " | 103 | printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " |
109 | "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n", | 104 | "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n", |
110 | (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), | 105 | (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), |