[PATCH] acpiphp: fix acpi_path_name
[linux/fpc-iii.git] / arch / mips / mm / pgtable-32.c
blob4a3c4919e31489143c6a5b6c25e4334184ac89fd
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
6 * Copyright (C) 2003 by Ralf Baechle
7 */
8 #include <linux/config.h>
9 #include <linux/init.h>
10 #include <linux/mm.h>
11 #include <linux/bootmem.h>
12 #include <linux/highmem.h>
13 #include <asm/fixmap.h>
14 #include <asm/pgtable.h>
16 void pgd_init(unsigned long page)
18 unsigned long *p = (unsigned long *) page;
19 int i;
21 for (i = 0; i < USER_PTRS_PER_PGD; i+=8) {
22 p[i + 0] = (unsigned long) invalid_pte_table;
23 p[i + 1] = (unsigned long) invalid_pte_table;
24 p[i + 2] = (unsigned long) invalid_pte_table;
25 p[i + 3] = (unsigned long) invalid_pte_table;
26 p[i + 4] = (unsigned long) invalid_pte_table;
27 p[i + 5] = (unsigned long) invalid_pte_table;
28 p[i + 6] = (unsigned long) invalid_pte_table;
29 p[i + 7] = (unsigned long) invalid_pte_table;
33 void __init pagetable_init(void)
35 #ifdef CONFIG_HIGHMEM
36 unsigned long vaddr;
37 pgd_t *pgd, *pgd_base;
38 pud_t *pud;
39 pmd_t *pmd;
40 pte_t *pte;
41 #endif
43 /* Initialize the entire pgd. */
44 pgd_init((unsigned long)swapper_pg_dir);
45 pgd_init((unsigned long)swapper_pg_dir
46 + sizeof(pgd_t) * USER_PTRS_PER_PGD);
48 #ifdef CONFIG_HIGHMEM
49 pgd_base = swapper_pg_dir;
52 * Fixed mappings:
54 vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
55 fixrange_init(vaddr, 0, pgd_base);
58 * Permanent kmaps:
60 vaddr = PKMAP_BASE;
61 fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base);
63 pgd = swapper_pg_dir + __pgd_offset(vaddr);
64 pud = pud_offset(pgd, vaddr);
65 pmd = pmd_offset(pud, vaddr);
66 pte = pte_offset_kernel(pmd, vaddr);
67 pkmap_page_table = pte;
68 #endif