diff options
Diffstat (limited to 'arch/mips/mm/pgtable-32.c')
-rw-r--r-- | arch/mips/mm/pgtable-32.c | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/arch/mips/mm/pgtable-32.c b/arch/mips/mm/pgtable-32.c index 4f07f81e8500..4a3c4919e314 100644 --- a/arch/mips/mm/pgtable-32.c +++ b/arch/mips/mm/pgtable-32.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/mm.h> | 10 | #include <linux/mm.h> |
11 | #include <linux/bootmem.h> | 11 | #include <linux/bootmem.h> |
12 | #include <linux/highmem.h> | 12 | #include <linux/highmem.h> |
13 | #include <asm/fixmap.h> | ||
13 | #include <asm/pgtable.h> | 14 | #include <asm/pgtable.h> |
14 | 15 | ||
15 | void pgd_init(unsigned long page) | 16 | void pgd_init(unsigned long page) |
@@ -29,42 +30,12 @@ void pgd_init(unsigned long page) | |||
29 | } | 30 | } |
30 | } | 31 | } |
31 | 32 | ||
32 | #ifdef CONFIG_HIGHMEM | ||
33 | static void __init fixrange_init (unsigned long start, unsigned long end, | ||
34 | pgd_t *pgd_base) | ||
35 | { | ||
36 | pgd_t *pgd; | ||
37 | pmd_t *pmd; | ||
38 | pte_t *pte; | ||
39 | int i, j; | ||
40 | unsigned long vaddr; | ||
41 | |||
42 | vaddr = start; | ||
43 | i = __pgd_offset(vaddr); | ||
44 | j = __pmd_offset(vaddr); | ||
45 | pgd = pgd_base + i; | ||
46 | |||
47 | for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) { | ||
48 | pmd = (pmd_t *)pgd; | ||
49 | for (; (j < PTRS_PER_PMD) && (vaddr != end); pmd++, j++) { | ||
50 | if (pmd_none(*pmd)) { | ||
51 | pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); | ||
52 | set_pmd(pmd, __pmd((unsigned long)pte)); | ||
53 | if (pte != pte_offset_kernel(pmd, 0)) | ||
54 | BUG(); | ||
55 | } | ||
56 | vaddr += PMD_SIZE; | ||
57 | } | ||
58 | j = 0; | ||
59 | } | ||
60 | } | ||
61 | #endif | ||
62 | |||
63 | void __init pagetable_init(void) | 33 | void __init pagetable_init(void) |
64 | { | 34 | { |
65 | #ifdef CONFIG_HIGHMEM | 35 | #ifdef CONFIG_HIGHMEM |
66 | unsigned long vaddr; | 36 | unsigned long vaddr; |
67 | pgd_t *pgd, *pgd_base; | 37 | pgd_t *pgd, *pgd_base; |
38 | pud_t *pud; | ||
68 | pmd_t *pmd; | 39 | pmd_t *pmd; |
69 | pte_t *pte; | 40 | pte_t *pte; |
70 | #endif | 41 | #endif |
@@ -90,7 +61,8 @@ void __init pagetable_init(void) | |||
90 | fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base); | 61 | fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base); |
91 | 62 | ||
92 | pgd = swapper_pg_dir + __pgd_offset(vaddr); | 63 | pgd = swapper_pg_dir + __pgd_offset(vaddr); |
93 | pmd = pmd_offset(pgd, vaddr); | 64 | pud = pud_offset(pgd, vaddr); |
65 | pmd = pmd_offset(pud, vaddr); | ||
94 | pte = pte_offset_kernel(pmd, vaddr); | 66 | pte = pte_offset_kernel(pmd, vaddr); |
95 | pkmap_page_table = pte; | 67 | pkmap_page_table = pte; |
96 | #endif | 68 | #endif |