diff options
Diffstat (limited to 'arch/mips/mm/init.c')
-rw-r--r-- | arch/mips/mm/init.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 77cbccaff955..5e1967f14255 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
@@ -83,7 +83,7 @@ pte_t *kmap_pte; | |||
83 | pgprot_t kmap_prot; | 83 | pgprot_t kmap_prot; |
84 | 84 | ||
85 | #define kmap_get_fixmap_pte(vaddr) \ | 85 | #define kmap_get_fixmap_pte(vaddr) \ |
86 | pte_offset_kernel(pmd_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)) | 86 | pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), (vaddr)) |
87 | 87 | ||
88 | static void __init kmap_init(void) | 88 | static void __init kmap_init(void) |
89 | { | 89 | { |
@@ -101,26 +101,32 @@ void __init fixrange_init(unsigned long start, unsigned long end, | |||
101 | pgd_t *pgd_base) | 101 | pgd_t *pgd_base) |
102 | { | 102 | { |
103 | pgd_t *pgd; | 103 | pgd_t *pgd; |
104 | pud_t *pud; | ||
104 | pmd_t *pmd; | 105 | pmd_t *pmd; |
105 | pte_t *pte; | 106 | pte_t *pte; |
106 | int i, j; | 107 | int i, j, k; |
107 | unsigned long vaddr; | 108 | unsigned long vaddr; |
108 | 109 | ||
109 | vaddr = start; | 110 | vaddr = start; |
110 | i = __pgd_offset(vaddr); | 111 | i = __pgd_offset(vaddr); |
111 | j = __pmd_offset(vaddr); | 112 | j = __pud_offset(vaddr); |
113 | k = __pmd_offset(vaddr); | ||
112 | pgd = pgd_base + i; | 114 | pgd = pgd_base + i; |
113 | 115 | ||
114 | for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) { | 116 | for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) { |
115 | pmd = (pmd_t *)pgd; | 117 | pud = (pud_t *)pgd; |
116 | for (; (j < PTRS_PER_PMD) && (vaddr != end); pmd++, j++) { | 118 | for ( ; (j < PTRS_PER_PUD) && (vaddr != end); pud++, j++) { |
117 | if (pmd_none(*pmd)) { | 119 | pmd = (pmd_t *)pud; |
118 | pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); | 120 | for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) { |
119 | set_pmd(pmd, __pmd(pte)); | 121 | if (pmd_none(*pmd)) { |
120 | if (pte != pte_offset_kernel(pmd, 0)) | 122 | pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); |
121 | BUG(); | 123 | set_pmd(pmd, __pmd(pte)); |
124 | if (pte != pte_offset_kernel(pmd, 0)) | ||
125 | BUG(); | ||
126 | } | ||
127 | vaddr += PMD_SIZE; | ||
122 | } | 128 | } |
123 | vaddr += PMD_SIZE; | 129 | k = 0; |
124 | } | 130 | } |
125 | j = 0; | 131 | j = 0; |
126 | } | 132 | } |