aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/pgtable-64.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-mips/pgtable-64.h')
-rw-r--r--include/asm-mips/pgtable-64.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h
index e3db93212eab..d05fb6f38aa7 100644
--- a/include/asm-mips/pgtable-64.h
+++ b/include/asm-mips/pgtable-64.h
@@ -93,8 +93,12 @@
93#define PTRS_PER_PMD ((PAGE_SIZE << PMD_ORDER) / sizeof(pmd_t)) 93#define PTRS_PER_PMD ((PAGE_SIZE << PMD_ORDER) / sizeof(pmd_t))
94#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t)) 94#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))
95 95
96#if PGDIR_SIZE >= TASK_SIZE
97#define USER_PTRS_PER_PGD (1)
98#else
96#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 99#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
97#define FIRST_USER_ADDRESS 0 100#endif
101#define FIRST_USER_ADDRESS 0UL
98 102
99#define VMALLOC_START MAP_BASE 103#define VMALLOC_START MAP_BASE
100#define VMALLOC_END \ 104#define VMALLOC_END \
@@ -178,24 +182,26 @@ static inline void pud_clear(pud_t *pudp)
178/* to find an entry in a page-table-directory */ 182/* to find an entry in a page-table-directory */
179#define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr)) 183#define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr))
180 184
181static inline unsigned long pud_page(pud_t pud) 185static inline unsigned long pud_page_vaddr(pud_t pud)
182{ 186{
183 return pud_val(pud); 187 return pud_val(pud);
184} 188}
189#define pud_phys(pud) (pud_val(pud) - PAGE_OFFSET)
190#define pud_page(pud) (pfn_to_page(pud_phys(pud) >> PAGE_SHIFT))
185 191
186/* Find an entry in the second-level page table.. */ 192/* Find an entry in the second-level page table.. */
187static inline pmd_t *pmd_offset(pud_t * pud, unsigned long address) 193static inline pmd_t *pmd_offset(pud_t * pud, unsigned long address)
188{ 194{
189 return (pmd_t *) pud_page(*pud) + pmd_index(address); 195 return (pmd_t *) pud_page_vaddr(*pud) + pmd_index(address);
190} 196}
191 197
192/* Find an entry in the third-level page table.. */ 198/* Find an entry in the third-level page table.. */
193#define __pte_offset(address) \ 199#define __pte_offset(address) \
194 (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) 200 (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
195#define pte_offset(dir, address) \ 201#define pte_offset(dir, address) \
196 ((pte_t *) (pmd_page_kernel(*dir)) + __pte_offset(address)) 202 ((pte_t *) (pmd_page_vaddr(*dir)) + __pte_offset(address))
197#define pte_offset_kernel(dir, address) \ 203#define pte_offset_kernel(dir, address) \
198 ((pte_t *) pmd_page_kernel(*(dir)) + __pte_offset(address)) 204 ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
199#define pte_offset_map(dir, address) \ 205#define pte_offset_map(dir, address) \
200 ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address)) 206 ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
201#define pte_offset_map_nested(dir, address) \ 207#define pte_offset_map_nested(dir, address) \