diff options
Diffstat (limited to 'arch/parisc/include/asm/pgtable.h')
-rw-r--r-- | arch/parisc/include/asm/pgtable.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h index f93c4a4e6580..d8534f95915a 100644 --- a/arch/parisc/include/asm/pgtable.h +++ b/arch/parisc/include/asm/pgtable.h | |||
@@ -83,7 +83,11 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr) | |||
83 | printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, (unsigned long)pgd_val(e)) | 83 | printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, (unsigned long)pgd_val(e)) |
84 | 84 | ||
85 | /* This is the size of the initially mapped kernel memory */ | 85 | /* This is the size of the initially mapped kernel memory */ |
86 | #define KERNEL_INITIAL_ORDER 24 /* 0 to 1<<24 = 16MB */ | 86 | #ifdef CONFIG_64BIT |
87 | #define KERNEL_INITIAL_ORDER 25 /* 1<<25 = 32MB */ | ||
88 | #else | ||
89 | #define KERNEL_INITIAL_ORDER 24 /* 1<<24 = 16MB */ | ||
90 | #endif | ||
87 | #define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER) | 91 | #define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER) |
88 | 92 | ||
89 | #if CONFIG_PGTABLE_LEVELS == 3 | 93 | #if CONFIG_PGTABLE_LEVELS == 3 |
@@ -167,7 +171,7 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr) | |||
167 | #define _PAGE_NO_CACHE_BIT 24 /* (0x080) Uncached Page (U bit) */ | 171 | #define _PAGE_NO_CACHE_BIT 24 /* (0x080) Uncached Page (U bit) */ |
168 | #define _PAGE_ACCESSED_BIT 23 /* (0x100) Software: Page Accessed */ | 172 | #define _PAGE_ACCESSED_BIT 23 /* (0x100) Software: Page Accessed */ |
169 | #define _PAGE_PRESENT_BIT 22 /* (0x200) Software: translation valid */ | 173 | #define _PAGE_PRESENT_BIT 22 /* (0x200) Software: translation valid */ |
170 | /* bit 21 was formerly the FLUSH bit but is now unused */ | 174 | #define _PAGE_HPAGE_BIT 21 /* (0x400) Software: Huge Page */ |
171 | #define _PAGE_USER_BIT 20 /* (0x800) Software: User accessible page */ | 175 | #define _PAGE_USER_BIT 20 /* (0x800) Software: User accessible page */ |
172 | 176 | ||
173 | /* N.B. The bits are defined in terms of a 32 bit word above, so the */ | 177 | /* N.B. The bits are defined in terms of a 32 bit word above, so the */ |
@@ -194,6 +198,7 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr) | |||
194 | #define _PAGE_NO_CACHE (1 << xlate_pabit(_PAGE_NO_CACHE_BIT)) | 198 | #define _PAGE_NO_CACHE (1 << xlate_pabit(_PAGE_NO_CACHE_BIT)) |
195 | #define _PAGE_ACCESSED (1 << xlate_pabit(_PAGE_ACCESSED_BIT)) | 199 | #define _PAGE_ACCESSED (1 << xlate_pabit(_PAGE_ACCESSED_BIT)) |
196 | #define _PAGE_PRESENT (1 << xlate_pabit(_PAGE_PRESENT_BIT)) | 200 | #define _PAGE_PRESENT (1 << xlate_pabit(_PAGE_PRESENT_BIT)) |
201 | #define _PAGE_HUGE (1 << xlate_pabit(_PAGE_HPAGE_BIT)) | ||
197 | #define _PAGE_USER (1 << xlate_pabit(_PAGE_USER_BIT)) | 202 | #define _PAGE_USER (1 << xlate_pabit(_PAGE_USER_BIT)) |
198 | 203 | ||
199 | #define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | _PAGE_DIRTY | _PAGE_ACCESSED) | 204 | #define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | _PAGE_DIRTY | _PAGE_ACCESSED) |
@@ -217,7 +222,7 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr) | |||
217 | #define PxD_FLAG_VALID (1 << xlate_pabit(_PxD_VALID_BIT)) | 222 | #define PxD_FLAG_VALID (1 << xlate_pabit(_PxD_VALID_BIT)) |
218 | #define PxD_FLAG_MASK (0xf) | 223 | #define PxD_FLAG_MASK (0xf) |
219 | #define PxD_FLAG_SHIFT (4) | 224 | #define PxD_FLAG_SHIFT (4) |
220 | #define PxD_VALUE_SHIFT (8) /* (PAGE_SHIFT-PxD_FLAG_SHIFT) */ | 225 | #define PxD_VALUE_SHIFT (PFN_PTE_SHIFT-PxD_FLAG_SHIFT) |
221 | 226 | ||
222 | #ifndef __ASSEMBLY__ | 227 | #ifndef __ASSEMBLY__ |
223 | 228 | ||
@@ -363,6 +368,18 @@ static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_WRITE; return | |||
363 | static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | 368 | static inline pte_t pte_mkspecial(pte_t pte) { return pte; } |
364 | 369 | ||
365 | /* | 370 | /* |
371 | * Huge pte definitions. | ||
372 | */ | ||
373 | #ifdef CONFIG_HUGETLB_PAGE | ||
374 | #define pte_huge(pte) (pte_val(pte) & _PAGE_HUGE) | ||
375 | #define pte_mkhuge(pte) (__pte(pte_val(pte) | _PAGE_HUGE)) | ||
376 | #else | ||
377 | #define pte_huge(pte) (0) | ||
378 | #define pte_mkhuge(pte) (pte) | ||
379 | #endif | ||
380 | |||
381 | |||
382 | /* | ||
366 | * Conversion functions: convert a page and protection to a page entry, | 383 | * Conversion functions: convert a page and protection to a page entry, |
367 | * and a page entry and page directory to the page they refer to. | 384 | * and a page entry and page directory to the page they refer to. |
368 | */ | 385 | */ |
@@ -410,8 +427,9 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
410 | /* Find an entry in the second-level page table.. */ | 427 | /* Find an entry in the second-level page table.. */ |
411 | 428 | ||
412 | #if CONFIG_PGTABLE_LEVELS == 3 | 429 | #if CONFIG_PGTABLE_LEVELS == 3 |
430 | #define pmd_index(addr) (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)) | ||
413 | #define pmd_offset(dir,address) \ | 431 | #define pmd_offset(dir,address) \ |
414 | ((pmd_t *) pgd_page_vaddr(*(dir)) + (((address)>>PMD_SHIFT) & (PTRS_PER_PMD-1))) | 432 | ((pmd_t *) pgd_page_vaddr(*(dir)) + pmd_index(address)) |
415 | #else | 433 | #else |
416 | #define pmd_offset(dir,addr) ((pmd_t *) dir) | 434 | #define pmd_offset(dir,addr) ((pmd_t *) dir) |
417 | #endif | 435 | #endif |