/* * paging_init() sets up the page tables */ void __init paging_init(void) { unsigned long max_zone_pfns[MAX_NR_ZONES]; int nid; /* We don't need to map the kernel through the TLB, as * it is permanatly mapped using P1. So clear the * entire pgd. */ memset(swapper_pg_dir, 0, sizeof(swapper_pg_dir)); /* Set an initial value for the MMU.TTB so we don't have to * check for a null value. */ set_TTB(swapper_pg_dir); /* Populate the relevant portions of swapper_pg_dir so that * we can use the fixmap entries without calling kmalloc. * pte's will be filled in by __set_fixmap(). */ page_table_range_init(FIXADDR_START, FIXADDR_TOP, swapper_pg_dir); memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); for_each_online_node(nid) { pg_data_t *pgdat = NODE_DATA(nid); unsigned long low, start_pfn; start_pfn = pgdat->bdata->node_min_pfn; low = pgdat->bdata->node_low_pfn; if (max_zone_pfns[ZONE_NORMAL] < low) max_zone_pfns[ZONE_NORMAL] = low; printk("Node %u: start_pfn = 0x%lx, low = 0x%lx\n", nid, start_pfn, low); } free_area_init_nodes(max_zone_pfns); #ifdef CONFIG_SUPERH32 /* Set up the uncached fixmap */ set_fixmap_nocache(FIX_UNCACHED, __pa(&__uncached_start)); #ifdef CONFIG_29BIT /* * Handle trivial transitions between cached and uncached * segments, making use of the 1:1 mapping relationship in * 512MB lowmem. */ cached_to_uncached = P2SEG - P1SEG; #endif #endif }
/* * paging_init() sets up the page tables */ void __init paging_init(void) { unsigned long max_zone_pfns[MAX_NR_ZONES]; unsigned long vaddr; int nid; /* We don't need to map the kernel through the TLB, as * it is permanatly mapped using P1. So clear the * entire pgd. */ memset(swapper_pg_dir, 0, sizeof(swapper_pg_dir)); /* Set an initial value for the MMU.TTB so we don't have to * check for a null value. */ set_TTB(swapper_pg_dir); /* * Populate the relevant portions of swapper_pg_dir so that * we can use the fixmap entries without calling kmalloc. * pte's will be filled in by __set_fixmap(). */ vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; page_table_range_init(vaddr, 0, swapper_pg_dir); kmap_coherent_init(); memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); for_each_online_node(nid) { pg_data_t *pgdat = NODE_DATA(nid); unsigned long low, start_pfn; start_pfn = pgdat->bdata->node_min_pfn; low = pgdat->bdata->node_low_pfn; if (max_zone_pfns[ZONE_NORMAL] < low) max_zone_pfns[ZONE_NORMAL] = low; printk("Node %u: start_pfn = 0x%lx, low = 0x%lx\n", nid, start_pfn, low); } free_area_init_nodes(max_zone_pfns); /* Set up the uncached fixmap */ set_fixmap_nocache(FIX_UNCACHED, __pa(&__uncached_start)); }