Commit 202b864a authored by Chen Liqin's avatar Chen Liqin

score: fixed pfn_valid define.

Signed-off-by: default avatarCui Bixiong <bixiong@sunnorth.com.cn>
Signed-off-by: default avatarChen Liqin <liqin.chen@sunplusct.com>

	modified:   arch/score/include/asm/page.h
	modified:   arch/score/kernel/setup.c
	modified:   arch/score/mm/init.c
parent 11ab3f3d
...@@ -74,7 +74,7 @@ extern unsigned long max_pfn; ...@@ -74,7 +74,7 @@ extern unsigned long max_pfn;
#define page_to_bus(page) (page_to_phys(page)) #define page_to_bus(page) (page_to_phys(page))
#define phys_to_page(paddr) (pfn_to_page(phys_to_pfn(paddr))) #define phys_to_page(paddr) (pfn_to_page(phys_to_pfn(paddr)))
#define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) < max_mapnr) #define pfn_valid(pfn) (((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn))
#define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) #define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT)
......
...@@ -49,6 +49,7 @@ static void __init bootmem_init(void) ...@@ -49,6 +49,7 @@ static void __init bootmem_init(void)
min_low_pfn = PFN_UP(MEMORY_START); min_low_pfn = PFN_UP(MEMORY_START);
max_low_pfn = PFN_UP(MEMORY_START + MEMORY_SIZE); max_low_pfn = PFN_UP(MEMORY_START + MEMORY_SIZE);
max_mapnr = max_low_pfn - min_low_pfn;
/* Initialize the boot-time allocator with low memory only. */ /* Initialize the boot-time allocator with low memory only. */
bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn,
......
...@@ -83,7 +83,6 @@ void __init mem_init(void) ...@@ -83,7 +83,6 @@ void __init mem_init(void)
unsigned long codesize, reservedpages, datasize, initsize; unsigned long codesize, reservedpages, datasize, initsize;
unsigned long tmp, ram = 0; unsigned long tmp, ram = 0;
max_mapnr = max_low_pfn;
high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
totalram_pages += free_all_bootmem(); totalram_pages += free_all_bootmem();
totalram_pages -= setup_zero_page(); /* Setup zeroed pages. */ totalram_pages -= setup_zero_page(); /* Setup zeroed pages. */
...@@ -101,10 +100,6 @@ void __init mem_init(void) ...@@ -101,10 +100,6 @@ void __init mem_init(void)
datasize = (unsigned long) &_edata - (unsigned long) &_etext; datasize = (unsigned long) &_edata - (unsigned long) &_etext;
initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT);
kclist_add(&kcore_vmalloc, (void *) VMALLOC_START,
VMALLOC_END - VMALLOC_START);
printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "
"%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n", "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n",
(unsigned long) nr_free_pages() << (PAGE_SHIFT-10), (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment