分类: LINUX
2009-11-06 20:36:55
struct e820map { __u32 nr_map; struct e820entry map[E820_X_MAX]; /* 一般情况下E820_X_MAX的值为128 */ }; struct e820entry { __u64 addr; __u64 size; __u32 type; }__attribute__((packed)); |
find_early_table_space() kernel_physical_mapping_init() early_ioremap_page_table_range_init() load_cr3() reserve_early() |
bdata->node_bootmem_map = phys_to_virt(PFN_PHYS(mapstart)); bdata->node_min_pfn = 0; bdata->node_low_pfn = max_low_pfn; |
pagetable_init(); kmap_init(); sparse_init(); zone_sizes_init(); |
void __init free_area_init_nodes(unsigned long *max_zone_pfn) { for_each_online_node(nid) { free_area_init_node(nid, NULL, find_min_pfn_for_node(nid), NULL); } } |
void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone, unsigned long start_pfn, enum memmap_context context) { struct page *page; unsigned long end_pfn = start_pfn + size; unsigned long pfn; struct zone *z; ... z = &ZONE_DATA(nid)->node_zones[zone]; for (pfn = start_pfn; pfn < end_pfn; pfn++) { if (context == MEMMAP_EARLY) { ... } page = pfn_to_page(pfn); set_page_links(page, zone, nid, pfn); mminit_verify_page_links(page, zone, nid, pfn); init_page_count(page); reset_page_mapcount(page); SetPageReserved(page); ... INIT_LIST_HEAD(&page->lru); } } |