diff options
-rw-r--r-- | arch/arm/include/asm/pgtable-2level.h | 41 | ||||
-rw-r--r-- | arch/arm/include/asm/pgtable.h | 38 |
2 files changed, 41 insertions, 38 deletions
diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/include/asm/pgtable-2level.h index 470457e1cfc5..2317a71c8f8e 100644 --- a/arch/arm/include/asm/pgtable-2level.h +++ b/arch/arm/include/asm/pgtable-2level.h | |||
@@ -140,4 +140,45 @@ | |||
140 | #define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 0x0b) << 2) /* 1011 */ | 140 | #define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 0x0b) << 2) /* 1011 */ |
141 | #define L_PTE_MT_MASK (_AT(pteval_t, 0x0f) << 2) | 141 | #define L_PTE_MT_MASK (_AT(pteval_t, 0x0f) << 2) |
142 | 142 | ||
143 | #ifndef __ASSEMBLY__ | ||
144 | |||
145 | /* | ||
146 | * The "pud_xxx()" functions here are trivial when the pmd is folded into | ||
147 | * the pud: the pud entry is never bad, always exists, and can't be set or | ||
148 | * cleared. | ||
149 | */ | ||
150 | #define pud_none(pud) (0) | ||
151 | #define pud_bad(pud) (0) | ||
152 | #define pud_present(pud) (1) | ||
153 | #define pud_clear(pudp) do { } while (0) | ||
154 | #define set_pud(pud,pudp) do { } while (0) | ||
155 | |||
156 | static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr) | ||
157 | { | ||
158 | return (pmd_t *)pud; | ||
159 | } | ||
160 | |||
161 | #define pmd_bad(pmd) (pmd_val(pmd) & 2) | ||
162 | |||
163 | #define copy_pmd(pmdpd,pmdps) \ | ||
164 | do { \ | ||
165 | pmdpd[0] = pmdps[0]; \ | ||
166 | pmdpd[1] = pmdps[1]; \ | ||
167 | flush_pmd_entry(pmdpd); \ | ||
168 | } while (0) | ||
169 | |||
170 | #define pmd_clear(pmdp) \ | ||
171 | do { \ | ||
172 | pmdp[0] = __pmd(0); \ | ||
173 | pmdp[1] = __pmd(0); \ | ||
174 | clean_pmd_entry(pmdp); \ | ||
175 | } while (0) | ||
176 | |||
177 | /* we don't need complex calculations here as the pmd is folded into the pgd */ | ||
178 | #define pmd_addr_end(addr,end) (end) | ||
179 | |||
180 | #define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext) | ||
181 | |||
182 | #endif /* __ASSEMBLY__ */ | ||
183 | |||
143 | #endif /* _ASM_PGTABLE_2LEVEL_H */ | 184 | #endif /* _ASM_PGTABLE_2LEVEL_H */ |
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index e14826e7efd9..977245b0875f 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h | |||
@@ -164,41 +164,8 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | |||
164 | /* to find an entry in a kernel page-table-directory */ | 164 | /* to find an entry in a kernel page-table-directory */ |
165 | #define pgd_offset_k(addr) pgd_offset(&init_mm, addr) | 165 | #define pgd_offset_k(addr) pgd_offset(&init_mm, addr) |
166 | 166 | ||
167 | /* | ||
168 | * The "pud_xxx()" functions here are trivial when the pmd is folded into | ||
169 | * the pud: the pud entry is never bad, always exists, and can't be set or | ||
170 | * cleared. | ||
171 | */ | ||
172 | #define pud_none(pud) (0) | ||
173 | #define pud_bad(pud) (0) | ||
174 | #define pud_present(pud) (1) | ||
175 | #define pud_clear(pudp) do { } while (0) | ||
176 | #define set_pud(pud,pudp) do { } while (0) | ||
177 | |||
178 | |||
179 | /* Find an entry in the second-level page table.. */ | ||
180 | static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr) | ||
181 | { | ||
182 | return (pmd_t *)pud; | ||
183 | } | ||
184 | |||
185 | #define pmd_none(pmd) (!pmd_val(pmd)) | 167 | #define pmd_none(pmd) (!pmd_val(pmd)) |
186 | #define pmd_present(pmd) (pmd_val(pmd)) | 168 | #define pmd_present(pmd) (pmd_val(pmd)) |
187 | #define pmd_bad(pmd) (pmd_val(pmd) & 2) | ||
188 | |||
189 | #define copy_pmd(pmdpd,pmdps) \ | ||
190 | do { \ | ||
191 | pmdpd[0] = pmdps[0]; \ | ||
192 | pmdpd[1] = pmdps[1]; \ | ||
193 | flush_pmd_entry(pmdpd); \ | ||
194 | } while (0) | ||
195 | |||
196 | #define pmd_clear(pmdp) \ | ||
197 | do { \ | ||
198 | pmdp[0] = __pmd(0); \ | ||
199 | pmdp[1] = __pmd(0); \ | ||
200 | clean_pmd_entry(pmdp); \ | ||
201 | } while (0) | ||
202 | 169 | ||
203 | static inline pte_t *pmd_page_vaddr(pmd_t pmd) | 170 | static inline pte_t *pmd_page_vaddr(pmd_t pmd) |
204 | { | 171 | { |
@@ -207,10 +174,6 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd) | |||
207 | 174 | ||
208 | #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK)) | 175 | #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK)) |
209 | 176 | ||
210 | /* we don't need complex calculations here as the pmd is folded into the pgd */ | ||
211 | #define pmd_addr_end(addr,end) (end) | ||
212 | |||
213 | |||
214 | #ifndef CONFIG_HIGHPTE | 177 | #ifndef CONFIG_HIGHPTE |
215 | #define __pte_map(pmd) pmd_page_vaddr(*(pmd)) | 178 | #define __pte_map(pmd) pmd_page_vaddr(*(pmd)) |
216 | #define __pte_unmap(pte) do { } while (0) | 179 | #define __pte_unmap(pte) do { } while (0) |
@@ -232,7 +195,6 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd) | |||
232 | #define pte_page(pte) pfn_to_page(pte_pfn(pte)) | 195 | #define pte_page(pte) pfn_to_page(pte_pfn(pte)) |
233 | #define mk_pte(page,prot) pfn_pte(page_to_pfn(page), prot) | 196 | #define mk_pte(page,prot) pfn_pte(page_to_pfn(page), prot) |
234 | 197 | ||
235 | #define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext) | ||
236 | #define pte_clear(mm,addr,ptep) set_pte_ext(ptep, __pte(0), 0) | 198 | #define pte_clear(mm,addr,ptep) set_pte_ext(ptep, __pte(0), 0) |
237 | 199 | ||
238 | #if __LINUX_ARM_ARCH__ < 6 | 200 | #if __LINUX_ARM_ARCH__ < 6 |