diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-mips/pgtable-32.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h index 4d6bc45df594..a5ce3f17a989 100644 --- a/include/asm-mips/pgtable-32.h +++ b/include/asm-mips/pgtable-32.h | |||
@@ -191,10 +191,17 @@ pfn_pte(unsigned long pfn, pgprot_t prot) | |||
191 | #else | 191 | #else |
192 | 192 | ||
193 | /* Swap entries must have VALID and GLOBAL bits cleared. */ | 193 | /* Swap entries must have VALID and GLOBAL bits cleared. */ |
194 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
195 | #define __swp_type(x) (((x).val >> 2) & 0x1f) | ||
196 | #define __swp_offset(x) ((x).val >> 7) | ||
197 | #define __swp_entry(type,offset) \ | ||
198 | ((swp_entry_t) { ((type) << 2) | ((offset) << 7) }) | ||
199 | #else | ||
194 | #define __swp_type(x) (((x).val >> 8) & 0x1f) | 200 | #define __swp_type(x) (((x).val >> 8) & 0x1f) |
195 | #define __swp_offset(x) ((x).val >> 13) | 201 | #define __swp_offset(x) ((x).val >> 13) |
196 | #define __swp_entry(type,offset) \ | 202 | #define __swp_entry(type,offset) \ |
197 | ((swp_entry_t) { ((type) << 8) | ((offset) << 13) }) | 203 | ((swp_entry_t) { ((type) << 8) | ((offset) << 13) }) |
204 | #endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */ | ||
198 | 205 | ||
199 | /* | 206 | /* |
200 | * Bits 0, 1, 2, 7 and 8 are taken, split up the 27 bits of offset | 207 | * Bits 0, 1, 2, 7 and 8 are taken, split up the 27 bits of offset |
@@ -218,7 +225,12 @@ pfn_pte(unsigned long pfn, pgprot_t prot) | |||
218 | 225 | ||
219 | #endif | 226 | #endif |
220 | 227 | ||
228 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
229 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_high }) | ||
230 | #define __swp_entry_to_pte(x) ((pte_t) { 0, (x).val }) | ||
231 | #else | ||
221 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) | 232 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) |
222 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) | 233 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) |
234 | #endif | ||
223 | 235 | ||
224 | #endif /* _ASM_PGTABLE_32_H */ | 236 | #endif /* _ASM_PGTABLE_32_H */ |