diff options
author | Thiemo Seufer <ths@networkno.de> | 2005-04-01 09:07:13 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2005-10-29 14:31:00 -0400 |
commit | 1b3a6e975cbe81c5abc55e4c1b9f5b5250c5f20e (patch) | |
tree | 541db3912172f82d30244cf215b1a1b91d8c6f7f /include/asm-mips/pgtable-64.h | |
parent | 7c2740f1c1a7ff2767a92042f39edad7fad95c92 (diff) |
Fix 64bit SMP TLB handler and stack frame handling, optimize 32bit SMP
TLB handlers a bit, match definitions in pgtable-{32,64}.h better.
Signed-off-by: Thiemo Seufer <ths@networkno.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips/pgtable-64.h')
-rw-r--r-- | include/asm-mips/pgtable-64.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h index 35007250ac2b..3e0a522c0f0e 100644 --- a/include/asm-mips/pgtable-64.h +++ b/include/asm-mips/pgtable-64.h | |||
@@ -114,7 +114,7 @@ extern pmd_t invalid_pmd_table[PTRS_PER_PMD]; | |||
114 | extern pmd_t empty_bad_pmd_table[PTRS_PER_PMD]; | 114 | extern pmd_t empty_bad_pmd_table[PTRS_PER_PMD]; |
115 | 115 | ||
116 | /* | 116 | /* |
117 | * Empty pmd entries point to the invalid_pte_table. | 117 | * Empty pgd/pmd entries point to the invalid_pte_table. |
118 | */ | 118 | */ |
119 | static inline int pmd_none(pmd_t pmd) | 119 | static inline int pmd_none(pmd_t pmd) |
120 | { | 120 | { |
@@ -156,7 +156,8 @@ static inline void pud_clear(pud_t *pudp) | |||
156 | pud_val(*pudp) = ((unsigned long) invalid_pmd_table); | 156 | pud_val(*pudp) = ((unsigned long) invalid_pmd_table); |
157 | } | 157 | } |
158 | 158 | ||
159 | #define pte_page(x) pfn_to_page((unsigned long)((pte_val(x) >> PAGE_SHIFT))) | 159 | #define pte_page(x) pfn_to_page(pte_pfn(x)) |
160 | |||
160 | #ifdef CONFIG_CPU_VR41XX | 161 | #ifdef CONFIG_CPU_VR41XX |
161 | #define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2))) | 162 | #define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2))) |
162 | #define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot)) | 163 | #define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot)) |
@@ -167,12 +168,14 @@ static inline void pud_clear(pud_t *pudp) | |||
167 | 168 | ||
168 | #define __pgd_offset(address) pgd_index(address) | 169 | #define __pgd_offset(address) pgd_index(address) |
169 | #define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) | 170 | #define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) |
171 | #define __pmd_offset(address) pmd_index(address) | ||
170 | #define page_pte(page) page_pte_prot(page, __pgprot(0)) | 172 | #define page_pte(page) page_pte_prot(page, __pgprot(0)) |
171 | 173 | ||
172 | /* to find an entry in a kernel page-table-directory */ | 174 | /* to find an entry in a kernel page-table-directory */ |
173 | #define pgd_offset_k(address) pgd_offset(&init_mm, 0) | 175 | #define pgd_offset_k(address) pgd_offset(&init_mm, 0) |
174 | 176 | ||
175 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) | 177 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) |
178 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) | ||
176 | 179 | ||
177 | /* to find an entry in a page-table-directory */ | 180 | /* to find an entry in a page-table-directory */ |
178 | #define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr)) | 181 | #define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr)) |
@@ -185,8 +188,7 @@ static inline unsigned long pud_page(pud_t pud) | |||
185 | /* Find an entry in the second-level page table.. */ | 188 | /* Find an entry in the second-level page table.. */ |
186 | static inline pmd_t *pmd_offset(pud_t * pud, unsigned long address) | 189 | static inline pmd_t *pmd_offset(pud_t * pud, unsigned long address) |
187 | { | 190 | { |
188 | return (pmd_t *) pud_page(*pud) + | 191 | return (pmd_t *) pud_page(*pud) + pmd_index(address); |
189 | ((address >> PMD_SHIFT) & (PTRS_PER_PMD - 1)); | ||
190 | } | 192 | } |
191 | 193 | ||
192 | /* Find an entry in the third-level page table.. */ | 194 | /* Find an entry in the third-level page table.. */ |