aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/include/asm/pgtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/include/asm/pgtable.h')
-rw-r--r--arch/parisc/include/asm/pgtable.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h
index 15207b9362bf..0a183756d6ec 100644
--- a/arch/parisc/include/asm/pgtable.h
+++ b/arch/parisc/include/asm/pgtable.h
@@ -68,13 +68,11 @@ extern void purge_tlb_entries(struct mm_struct *, unsigned long);
68#define KERNEL_INITIAL_ORDER 24 /* 0 to 1<<24 = 16MB */ 68#define KERNEL_INITIAL_ORDER 24 /* 0 to 1<<24 = 16MB */
69#define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER) 69#define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER)
70 70
71#if defined(CONFIG_64BIT) && defined(CONFIG_PARISC_PAGE_SIZE_4KB) 71#if CONFIG_PGTABLE_LEVELS == 3
72#define PT_NLEVELS 3
73#define PGD_ORDER 1 /* Number of pages per pgd */ 72#define PGD_ORDER 1 /* Number of pages per pgd */
74#define PMD_ORDER 1 /* Number of pages per pmd */ 73#define PMD_ORDER 1 /* Number of pages per pmd */
75#define PGD_ALLOC_ORDER 2 /* first pgd contains pmd */ 74#define PGD_ALLOC_ORDER 2 /* first pgd contains pmd */
76#else 75#else
77#define PT_NLEVELS 2
78#define PGD_ORDER 1 /* Number of pages per pgd */ 76#define PGD_ORDER 1 /* Number of pages per pgd */
79#define PGD_ALLOC_ORDER PGD_ORDER 77#define PGD_ALLOC_ORDER PGD_ORDER
80#endif 78#endif
@@ -93,7 +91,7 @@ extern void purge_tlb_entries(struct mm_struct *, unsigned long);
93#define PMD_SHIFT (PLD_SHIFT + BITS_PER_PTE) 91#define PMD_SHIFT (PLD_SHIFT + BITS_PER_PTE)
94#define PMD_SIZE (1UL << PMD_SHIFT) 92#define PMD_SIZE (1UL << PMD_SHIFT)
95#define PMD_MASK (~(PMD_SIZE-1)) 93#define PMD_MASK (~(PMD_SIZE-1))
96#if PT_NLEVELS == 3 94#if CONFIG_PGTABLE_LEVELS == 3
97#define BITS_PER_PMD (PAGE_SHIFT + PMD_ORDER - BITS_PER_PMD_ENTRY) 95#define BITS_PER_PMD (PAGE_SHIFT + PMD_ORDER - BITS_PER_PMD_ENTRY)
98#else 96#else
99#define __PAGETABLE_PMD_FOLDED 97#define __PAGETABLE_PMD_FOLDED
@@ -277,7 +275,7 @@ extern unsigned long *empty_zero_page;
277#define pgd_flag(x) (pgd_val(x) & PxD_FLAG_MASK) 275#define pgd_flag(x) (pgd_val(x) & PxD_FLAG_MASK)
278#define pgd_address(x) ((unsigned long)(pgd_val(x) &~ PxD_FLAG_MASK) << PxD_VALUE_SHIFT) 276#define pgd_address(x) ((unsigned long)(pgd_val(x) &~ PxD_FLAG_MASK) << PxD_VALUE_SHIFT)
279 277
280#if PT_NLEVELS == 3 278#if CONFIG_PGTABLE_LEVELS == 3
281/* The first entry of the permanent pmd is not there if it contains 279/* The first entry of the permanent pmd is not there if it contains
282 * the gateway marker */ 280 * the gateway marker */
283#define pmd_none(x) (!pmd_val(x) || pmd_flag(x) == PxD_FLAG_ATTACHED) 281#define pmd_none(x) (!pmd_val(x) || pmd_flag(x) == PxD_FLAG_ATTACHED)
@@ -287,7 +285,7 @@ extern unsigned long *empty_zero_page;
287#define pmd_bad(x) (!(pmd_flag(x) & PxD_FLAG_VALID)) 285#define pmd_bad(x) (!(pmd_flag(x) & PxD_FLAG_VALID))
288#define pmd_present(x) (pmd_flag(x) & PxD_FLAG_PRESENT) 286#define pmd_present(x) (pmd_flag(x) & PxD_FLAG_PRESENT)
289static inline void pmd_clear(pmd_t *pmd) { 287static inline void pmd_clear(pmd_t *pmd) {
290#if PT_NLEVELS == 3 288#if CONFIG_PGTABLE_LEVELS == 3
291 if (pmd_flag(*pmd) & PxD_FLAG_ATTACHED) 289 if (pmd_flag(*pmd) & PxD_FLAG_ATTACHED)
292 /* This is the entry pointing to the permanent pmd 290 /* This is the entry pointing to the permanent pmd
293 * attached to the pgd; cannot clear it */ 291 * attached to the pgd; cannot clear it */
@@ -299,7 +297,7 @@ static inline void pmd_clear(pmd_t *pmd) {
299 297
300 298
301 299
302#if PT_NLEVELS == 3 300#if CONFIG_PGTABLE_LEVELS == 3
303#define pgd_page_vaddr(pgd) ((unsigned long) __va(pgd_address(pgd))) 301#define pgd_page_vaddr(pgd) ((unsigned long) __va(pgd_address(pgd)))
304#define pgd_page(pgd) virt_to_page((void *)pgd_page_vaddr(pgd)) 302#define pgd_page(pgd) virt_to_page((void *)pgd_page_vaddr(pgd))
305 303
@@ -309,7 +307,7 @@ static inline void pmd_clear(pmd_t *pmd) {
309#define pgd_bad(x) (!(pgd_flag(x) & PxD_FLAG_VALID)) 307#define pgd_bad(x) (!(pgd_flag(x) & PxD_FLAG_VALID))
310#define pgd_present(x) (pgd_flag(x) & PxD_FLAG_PRESENT) 308#define pgd_present(x) (pgd_flag(x) & PxD_FLAG_PRESENT)
311static inline void pgd_clear(pgd_t *pgd) { 309static inline void pgd_clear(pgd_t *pgd) {
312#if PT_NLEVELS == 3 310#if CONFIG_PGTABLE_LEVELS == 3
313 if(pgd_flag(*pgd) & PxD_FLAG_ATTACHED) 311 if(pgd_flag(*pgd) & PxD_FLAG_ATTACHED)
314 /* This is the permanent pmd attached to the pgd; cannot 312 /* This is the permanent pmd attached to the pgd; cannot
315 * free it */ 313 * free it */
@@ -393,7 +391,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
393 391
394/* Find an entry in the second-level page table.. */ 392/* Find an entry in the second-level page table.. */
395 393
396#if PT_NLEVELS == 3 394#if CONFIG_PGTABLE_LEVELS == 3
397#define pmd_offset(dir,address) \ 395#define pmd_offset(dir,address) \
398((pmd_t *) pgd_page_vaddr(*(dir)) + (((address)>>PMD_SHIFT) & (PTRS_PER_PMD-1))) 396((pmd_t *) pgd_page_vaddr(*(dir)) + (((address)>>PMD_SHIFT) & (PTRS_PER_PMD-1)))
399#else 397#else