diff options
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/pgtable_32.h | 24 | ||||
-rw-r--r-- | arch/sparc/include/asm/pgtable_64.h | 40 | ||||
-rw-r--r-- | arch/sparc/include/asm/pgtsrmmu.h | 14 |
3 files changed, 5 insertions, 73 deletions
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h index b9b91ae19fe1..b2f7dc46a7d1 100644 --- a/arch/sparc/include/asm/pgtable_32.h +++ b/arch/sparc/include/asm/pgtable_32.h | |||
@@ -221,14 +221,6 @@ static inline int pte_young(pte_t pte) | |||
221 | return pte_val(pte) & SRMMU_REF; | 221 | return pte_val(pte) & SRMMU_REF; |
222 | } | 222 | } |
223 | 223 | ||
224 | /* | ||
225 | * The following only work if pte_present() is not true. | ||
226 | */ | ||
227 | static inline int pte_file(pte_t pte) | ||
228 | { | ||
229 | return pte_val(pte) & SRMMU_FILE; | ||
230 | } | ||
231 | |||
232 | static inline int pte_special(pte_t pte) | 224 | static inline int pte_special(pte_t pte) |
233 | { | 225 | { |
234 | return 0; | 226 | return 0; |
@@ -375,22 +367,6 @@ static inline swp_entry_t __swp_entry(unsigned long type, unsigned long offset) | |||
375 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) | 367 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) |
376 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) | 368 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) |
377 | 369 | ||
378 | /* file-offset-in-pte helpers */ | ||
379 | static inline unsigned long pte_to_pgoff(pte_t pte) | ||
380 | { | ||
381 | return pte_val(pte) >> SRMMU_PTE_FILE_SHIFT; | ||
382 | } | ||
383 | |||
384 | static inline pte_t pgoff_to_pte(unsigned long pgoff) | ||
385 | { | ||
386 | return __pte((pgoff << SRMMU_PTE_FILE_SHIFT) | SRMMU_FILE); | ||
387 | } | ||
388 | |||
389 | /* | ||
390 | * This is made a constant because mm/fremap.c required a constant. | ||
391 | */ | ||
392 | #define PTE_FILE_MAX_BITS 24 | ||
393 | |||
394 | static inline unsigned long | 370 | static inline unsigned long |
395 | __get_phys (unsigned long addr) | 371 | __get_phys (unsigned long addr) |
396 | { | 372 | { |
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h index 1ff9e7864168..2ac7873ad6fd 100644 --- a/arch/sparc/include/asm/pgtable_64.h +++ b/arch/sparc/include/asm/pgtable_64.h | |||
@@ -137,7 +137,6 @@ bool kern_addr_valid(unsigned long addr); | |||
137 | #define _PAGE_SOFT_4U _AC(0x0000000000001F80,UL) /* Software bits: */ | 137 | #define _PAGE_SOFT_4U _AC(0x0000000000001F80,UL) /* Software bits: */ |
138 | #define _PAGE_EXEC_4U _AC(0x0000000000001000,UL) /* Executable SW bit */ | 138 | #define _PAGE_EXEC_4U _AC(0x0000000000001000,UL) /* Executable SW bit */ |
139 | #define _PAGE_MODIFIED_4U _AC(0x0000000000000800,UL) /* Modified (dirty) */ | 139 | #define _PAGE_MODIFIED_4U _AC(0x0000000000000800,UL) /* Modified (dirty) */ |
140 | #define _PAGE_FILE_4U _AC(0x0000000000000800,UL) /* Pagecache page */ | ||
141 | #define _PAGE_ACCESSED_4U _AC(0x0000000000000400,UL) /* Accessed (ref'd) */ | 140 | #define _PAGE_ACCESSED_4U _AC(0x0000000000000400,UL) /* Accessed (ref'd) */ |
142 | #define _PAGE_READ_4U _AC(0x0000000000000200,UL) /* Readable SW Bit */ | 141 | #define _PAGE_READ_4U _AC(0x0000000000000200,UL) /* Readable SW Bit */ |
143 | #define _PAGE_WRITE_4U _AC(0x0000000000000100,UL) /* Writable SW Bit */ | 142 | #define _PAGE_WRITE_4U _AC(0x0000000000000100,UL) /* Writable SW Bit */ |
@@ -167,7 +166,6 @@ bool kern_addr_valid(unsigned long addr); | |||
167 | #define _PAGE_EXEC_4V _AC(0x0000000000000080,UL) /* Executable Page */ | 166 | #define _PAGE_EXEC_4V _AC(0x0000000000000080,UL) /* Executable Page */ |
168 | #define _PAGE_W_4V _AC(0x0000000000000040,UL) /* Writable */ | 167 | #define _PAGE_W_4V _AC(0x0000000000000040,UL) /* Writable */ |
169 | #define _PAGE_SOFT_4V _AC(0x0000000000000030,UL) /* Software bits */ | 168 | #define _PAGE_SOFT_4V _AC(0x0000000000000030,UL) /* Software bits */ |
170 | #define _PAGE_FILE_4V _AC(0x0000000000000020,UL) /* Pagecache page */ | ||
171 | #define _PAGE_PRESENT_4V _AC(0x0000000000000010,UL) /* Present */ | 169 | #define _PAGE_PRESENT_4V _AC(0x0000000000000010,UL) /* Present */ |
172 | #define _PAGE_RESV_4V _AC(0x0000000000000008,UL) /* Reserved */ | 170 | #define _PAGE_RESV_4V _AC(0x0000000000000008,UL) /* Reserved */ |
173 | #define _PAGE_SZ16GB_4V _AC(0x0000000000000007,UL) /* 16GB Page */ | 171 | #define _PAGE_SZ16GB_4V _AC(0x0000000000000007,UL) /* 16GB Page */ |
@@ -332,22 +330,6 @@ static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) | |||
332 | } | 330 | } |
333 | #endif | 331 | #endif |
334 | 332 | ||
335 | static inline pte_t pgoff_to_pte(unsigned long off) | ||
336 | { | ||
337 | off <<= PAGE_SHIFT; | ||
338 | |||
339 | __asm__ __volatile__( | ||
340 | "\n661: or %0, %2, %0\n" | ||
341 | " .section .sun4v_1insn_patch, \"ax\"\n" | ||
342 | " .word 661b\n" | ||
343 | " or %0, %3, %0\n" | ||
344 | " .previous\n" | ||
345 | : "=r" (off) | ||
346 | : "0" (off), "i" (_PAGE_FILE_4U), "i" (_PAGE_FILE_4V)); | ||
347 | |||
348 | return __pte(off); | ||
349 | } | ||
350 | |||
351 | static inline pgprot_t pgprot_noncached(pgprot_t prot) | 333 | static inline pgprot_t pgprot_noncached(pgprot_t prot) |
352 | { | 334 | { |
353 | unsigned long val = pgprot_val(prot); | 335 | unsigned long val = pgprot_val(prot); |
@@ -609,22 +591,6 @@ static inline unsigned long pte_exec(pte_t pte) | |||
609 | return (pte_val(pte) & mask); | 591 | return (pte_val(pte) & mask); |
610 | } | 592 | } |
611 | 593 | ||
612 | static inline unsigned long pte_file(pte_t pte) | ||
613 | { | ||
614 | unsigned long val = pte_val(pte); | ||
615 | |||
616 | __asm__ __volatile__( | ||
617 | "\n661: and %0, %2, %0\n" | ||
618 | " .section .sun4v_1insn_patch, \"ax\"\n" | ||
619 | " .word 661b\n" | ||
620 | " and %0, %3, %0\n" | ||
621 | " .previous\n" | ||
622 | : "=r" (val) | ||
623 | : "0" (val), "i" (_PAGE_FILE_4U), "i" (_PAGE_FILE_4V)); | ||
624 | |||
625 | return val; | ||
626 | } | ||
627 | |||
628 | static inline unsigned long pte_present(pte_t pte) | 594 | static inline unsigned long pte_present(pte_t pte) |
629 | { | 595 | { |
630 | unsigned long val = pte_val(pte); | 596 | unsigned long val = pte_val(pte); |
@@ -971,12 +937,6 @@ pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp); | |||
971 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) | 937 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) |
972 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) | 938 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) |
973 | 939 | ||
974 | /* File offset in PTE support. */ | ||
975 | unsigned long pte_file(pte_t); | ||
976 | #define pte_to_pgoff(pte) (pte_val(pte) >> PAGE_SHIFT) | ||
977 | pte_t pgoff_to_pte(unsigned long); | ||
978 | #define PTE_FILE_MAX_BITS (64UL - PAGE_SHIFT - 1UL) | ||
979 | |||
980 | int page_in_phys_avail(unsigned long paddr); | 940 | int page_in_phys_avail(unsigned long paddr); |
981 | 941 | ||
982 | /* | 942 | /* |
diff --git a/arch/sparc/include/asm/pgtsrmmu.h b/arch/sparc/include/asm/pgtsrmmu.h index 79da17866fa8..ae51a111a8c7 100644 --- a/arch/sparc/include/asm/pgtsrmmu.h +++ b/arch/sparc/include/asm/pgtsrmmu.h | |||
@@ -80,10 +80,6 @@ | |||
80 | #define SRMMU_PRIV 0x1c | 80 | #define SRMMU_PRIV 0x1c |
81 | #define SRMMU_PRIV_RDONLY 0x18 | 81 | #define SRMMU_PRIV_RDONLY 0x18 |
82 | 82 | ||
83 | #define SRMMU_FILE 0x40 /* Implemented in software */ | ||
84 | |||
85 | #define SRMMU_PTE_FILE_SHIFT 8 /* == 32-PTE_FILE_MAX_BITS */ | ||
86 | |||
87 | #define SRMMU_CHG_MASK (0xffffff00 | SRMMU_REF | SRMMU_DIRTY) | 83 | #define SRMMU_CHG_MASK (0xffffff00 | SRMMU_REF | SRMMU_DIRTY) |
88 | 84 | ||
89 | /* SRMMU swap entry encoding | 85 | /* SRMMU swap entry encoding |
@@ -94,13 +90,13 @@ | |||
94 | * oooooooooooooooooootttttRRRRRRRR | 90 | * oooooooooooooooooootttttRRRRRRRR |
95 | * fedcba9876543210fedcba9876543210 | 91 | * fedcba9876543210fedcba9876543210 |
96 | * | 92 | * |
97 | * The bottom 8 bits are reserved for protection and status bits, especially | 93 | * The bottom 7 bits are reserved for protection and status bits, especially |
98 | * FILE and PRESENT. | 94 | * PRESENT. |
99 | */ | 95 | */ |
100 | #define SRMMU_SWP_TYPE_MASK 0x1f | 96 | #define SRMMU_SWP_TYPE_MASK 0x1f |
101 | #define SRMMU_SWP_TYPE_SHIFT SRMMU_PTE_FILE_SHIFT | 97 | #define SRMMU_SWP_TYPE_SHIFT 7 |
102 | #define SRMMU_SWP_OFF_MASK 0x7ffff | 98 | #define SRMMU_SWP_OFF_MASK 0xfffff |
103 | #define SRMMU_SWP_OFF_SHIFT (SRMMU_PTE_FILE_SHIFT + 5) | 99 | #define SRMMU_SWP_OFF_SHIFT (SRMMU_SWP_TYPE_SHIFT + 5) |
104 | 100 | ||
105 | /* Some day I will implement true fine grained access bits for | 101 | /* Some day I will implement true fine grained access bits for |
106 | * user pages because the SRMMU gives us the capabilities to | 102 | * user pages because the SRMMU gives us the capabilities to |