Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[linux/fpc-iii.git] / arch / mips / mm / pgtable-64.c
blob44b5e97fff65f75286fdd15f33c2bcf40841082a
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) 1999, 2000 by Silicon Graphics
7 * Copyright (C) 2003 by Ralf Baechle
8 */
9 #include <linux/init.h>
10 #include <linux/mm.h>
11 #include <asm/pgtable.h>
13 void pgd_init(unsigned long page)
15 unsigned long *p, *end;
17 p = (unsigned long *) page;
18 end = p + PTRS_PER_PGD;
20 while (p < end) {
21 p[0] = (unsigned long) invalid_pmd_table;
22 p[1] = (unsigned long) invalid_pmd_table;
23 p[2] = (unsigned long) invalid_pmd_table;
24 p[3] = (unsigned long) invalid_pmd_table;
25 p[4] = (unsigned long) invalid_pmd_table;
26 p[5] = (unsigned long) invalid_pmd_table;
27 p[6] = (unsigned long) invalid_pmd_table;
28 p[7] = (unsigned long) invalid_pmd_table;
29 p += 8;
33 void pmd_init(unsigned long addr, unsigned long pagetable)
35 unsigned long *p, *end;
37 p = (unsigned long *) addr;
38 end = p + PTRS_PER_PMD;
40 while (p < end) {
41 p[0] = (unsigned long)pagetable;
42 p[1] = (unsigned long)pagetable;
43 p[2] = (unsigned long)pagetable;
44 p[3] = (unsigned long)pagetable;
45 p[4] = (unsigned long)pagetable;
46 p[5] = (unsigned long)pagetable;
47 p[6] = (unsigned long)pagetable;
48 p[7] = (unsigned long)pagetable;
49 p += 8;
53 void __init pagetable_init(void)
55 /* Initialize the entire pgd. */
56 pgd_init((unsigned long)swapper_pg_dir);
57 pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table);