Skip to content

Commit

Permalink
x86: introduce initmem_init for 64 bit
Browse files Browse the repository at this point in the history
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Jul 8, 2008
1 parent 17b4cce commit 1f75d7e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,22 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, unsigned lon
}

#ifndef CONFIG_NUMA
void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn)
{
unsigned long bootmap_size, bootmap;

bootmap_size = bootmem_bootmap_pages(end_pfn)<<PAGE_SHIFT;
bootmap = find_e820_area(0, end_pfn<<PAGE_SHIFT, bootmap_size,
PAGE_SIZE);
if (bootmap == -1L)
panic("Cannot find bootmem map of size %ld\n", bootmap_size);
bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, end_pfn);
e820_register_active_regions(0, start_pfn, end_pfn);
free_bootmem_with_active_regions(0, end_pfn);
early_res_to_bootmem(0, end_pfn<<PAGE_SHIFT);
reserve_bootmem(bootmap, bootmap_size, BOOTMEM_DEFAULT);
}

void __init paging_init(void)
{
unsigned long max_zone_pfns[MAX_NR_ZONES];
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/mm/numa_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ static int __init numa_emulation(unsigned long start_pfn, unsigned long last_pfn
}
#endif /* CONFIG_NUMA_EMU */

void __init numa_initmem_init(unsigned long start_pfn, unsigned long last_pfn)
void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn)
{
int i;

Expand Down
1 change: 0 additions & 1 deletion include/asm-x86/numa_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ extern int hotadd_percent;

extern s16 apicid_to_node[MAX_LOCAL_APIC];

extern void numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn);
extern unsigned long numa_free_all_bootmem(void);
extern void setup_node_bootmem(int nodeid, unsigned long start,
unsigned long end);
Expand Down
1 change: 1 addition & 0 deletions include/asm-x86/page_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ typedef struct { pteval_t pte; } pte_t;
extern unsigned long init_memory_mapping(unsigned long start,
unsigned long end);

extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn);
#endif /* !__ASSEMBLY__ */

#ifdef CONFIG_FLATMEM
Expand Down

0 comments on commit 1f75d7e

Please sign in to comment.