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
6 * Copyright (C) 1999, 2000 by Silicon Graphics
7 * Copyright (C) 2003 by Ralf Baechle
9 #include <linux/init.h>
11 #include <asm/fixmap.h>
12 #include <asm/pgtable.h>
13 #include <asm/pgalloc.h>
15 void pgd_init(unsigned long page
)
17 unsigned long *p
, *end
;
20 #ifdef __PAGETABLE_PMD_FOLDED
21 entry
= (unsigned long)invalid_pte_table
;
23 entry
= (unsigned long)invalid_pmd_table
;
26 p
= (unsigned long *) page
;
27 end
= p
+ PTRS_PER_PGD
;
42 #ifndef __PAGETABLE_PMD_FOLDED
43 void pmd_init(unsigned long addr
, unsigned long pagetable
)
45 unsigned long *p
, *end
;
47 p
= (unsigned long *) addr
;
48 end
= p
+ PTRS_PER_PMD
;
64 void __init
pagetable_init(void)
69 /* Initialize the entire pgd. */
70 pgd_init((unsigned long)swapper_pg_dir
);
71 #ifndef __PAGETABLE_PMD_FOLDED
72 pmd_init((unsigned long)invalid_pmd_table
, (unsigned long)invalid_pte_table
);
74 pgd_base
= swapper_pg_dir
;
78 vaddr
= __fix_to_virt(__end_of_fixed_addresses
- 1) & PMD_MASK
;
79 fixrange_init(vaddr
, 0, pgd_base
);