diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2011-11-22 12:30:28 -0500 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2011-12-08 05:30:37 -0500 |
commit | e0c0313bd720977a7ed01dc48f0762a3ddec607f (patch) | |
tree | cf5a5ee6593d4b2207550296a05bbdab0001b329 /arch/arm/include/asm/pgtable.h | |
parent | a32618d28dbe6e9bf8ec508ccbc3561a7d7d32f0 (diff) |
ARM: LPAE: Move page table maintenance macros to pgtable-2level.h
The page table maintenance macros need to be duplicated between the
classic and the LPAE MMU so this patch moves those that are not common
to the pgtable-2level.h file.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm/include/asm/pgtable.h')
-rw-r--r-- | arch/arm/include/asm/pgtable.h | 38 |
1 files changed, 0 insertions, 38 deletions
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 |