aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill@shutemov.name>2015-02-10 17:10:50 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 17:30:32 -0500
commitb32da82e28ce90bff4e371fc15d2816fa3175bb0 (patch)
treee42f7c31226d908a4ad130effe9e41b79746d979
parent937fa39fb22fea1c1d8ca9e5f31c452b91ac7239 (diff)
mips: drop _PAGE_FILE and pte_file()-related helpers
We've replaced remap_file_pages(2) implementation with emulation. Nobody creates non-linear mapping anymore. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/mips/include/asm/pgtable-32.h36
-rw-r--r--arch/mips/include/asm/pgtable-64.h9
-rw-r--r--arch/mips/include/asm/pgtable-bits.h9
-rw-r--r--arch/mips/include/asm/pgtable.h2
4 files changed, 0 insertions, 56 deletions
diff --git a/arch/mips/include/asm/pgtable-32.h b/arch/mips/include/asm/pgtable-32.h
index 68984b612f9d..16aa9f23e17b 100644
--- a/arch/mips/include/asm/pgtable-32.h
+++ b/arch/mips/include/asm/pgtable-32.h
@@ -161,22 +161,6 @@ pfn_pte(unsigned long pfn, pgprot_t prot)
161#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 161#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
162#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 162#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
163 163
164/*
165 * Encode and decode a nonlinear file mapping entry
166 */
167#define pte_to_pgoff(_pte) ((((_pte).pte >> 1 ) & 0x07) | \
168 (((_pte).pte >> 2 ) & 0x38) | \
169 (((_pte).pte >> 10) << 6 ))
170
171#define pgoff_to_pte(off) ((pte_t) { (((off) & 0x07) << 1 ) | \
172 (((off) & 0x38) << 2 ) | \
173 (((off) >> 6 ) << 10) | \
174 _PAGE_FILE })
175
176/*
177 * Bits 0, 4, 8, and 9 are taken, split up 28 bits of offset into this range:
178 */
179#define PTE_FILE_MAX_BITS 28
180#else 164#else
181 165
182#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) 166#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
@@ -188,13 +172,6 @@ pfn_pte(unsigned long pfn, pgprot_t prot)
188#define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_high }) 172#define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_high })
189#define __swp_entry_to_pte(x) ((pte_t) { 0, (x).val }) 173#define __swp_entry_to_pte(x) ((pte_t) { 0, (x).val })
190 174
191/*
192 * Bits 0 and 1 of pte_high are taken, use the rest for the page offset...
193 */
194#define pte_to_pgoff(_pte) ((_pte).pte_high >> 2)
195#define pgoff_to_pte(off) ((pte_t) { _PAGE_FILE, (off) << 2 })
196
197#define PTE_FILE_MAX_BITS 30
198#else 175#else
199/* 176/*
200 * Constraints: 177 * Constraints:
@@ -209,19 +186,6 @@ pfn_pte(unsigned long pfn, pgprot_t prot)
209#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 186#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
210#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 187#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
211 188
212/*
213 * Encode and decode a nonlinear file mapping entry
214 */
215#define pte_to_pgoff(_pte) ((((_pte).pte >> 1) & 0x7) | \
216 (((_pte).pte >> 2) & 0x8) | \
217 (((_pte).pte >> 8) << 4))
218
219#define pgoff_to_pte(off) ((pte_t) { (((off) & 0x7) << 1) | \
220 (((off) & 0x8) << 2) | \
221 (((off) >> 4) << 8) | \
222 _PAGE_FILE })
223
224#define PTE_FILE_MAX_BITS 28
225#endif /* defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) */ 189#endif /* defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) */
226 190
227#endif /* defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) */ 191#endif /* defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) */
diff --git a/arch/mips/include/asm/pgtable-64.h b/arch/mips/include/asm/pgtable-64.h
index e1c49a96807d..1659bb91ae21 100644
--- a/arch/mips/include/asm/pgtable-64.h
+++ b/arch/mips/include/asm/pgtable-64.h
@@ -291,13 +291,4 @@ static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
291#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 291#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
292#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 292#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
293 293
294/*
295 * Bits 0, 4, 6, and 7 are taken. Let's leave bits 1, 2, 3, and 5 alone to
296 * make things easier, and only use the upper 56 bits for the page offset...
297 */
298#define PTE_FILE_MAX_BITS 56
299
300#define pte_to_pgoff(_pte) ((_pte).pte >> 8)
301#define pgoff_to_pte(off) ((pte_t) { ((off) << 8) | _PAGE_FILE })
302
303#endif /* _ASM_PGTABLE_64_H */ 294#endif /* _ASM_PGTABLE_64_H */
diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h
index ca11f14f40a3..fc807aa5ec8d 100644
--- a/arch/mips/include/asm/pgtable-bits.h
+++ b/arch/mips/include/asm/pgtable-bits.h
@@ -48,8 +48,6 @@
48 48
49/* 49/*
50 * The following bits are implemented in software 50 * The following bits are implemented in software
51 *
52 * _PAGE_FILE semantics: set:pagecache unset:swap
53 */ 51 */
54#define _PAGE_PRESENT_SHIFT (_CACHE_SHIFT + 3) 52#define _PAGE_PRESENT_SHIFT (_CACHE_SHIFT + 3)
55#define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT) 53#define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT)
@@ -64,7 +62,6 @@
64 62
65#define _PAGE_SILENT_READ _PAGE_VALID 63#define _PAGE_SILENT_READ _PAGE_VALID
66#define _PAGE_SILENT_WRITE _PAGE_DIRTY 64#define _PAGE_SILENT_WRITE _PAGE_DIRTY
67#define _PAGE_FILE _PAGE_MODIFIED
68 65
69#define _PFN_SHIFT (PAGE_SHIFT - 12 + _CACHE_SHIFT + 3) 66#define _PFN_SHIFT (PAGE_SHIFT - 12 + _CACHE_SHIFT + 3)
70 67
@@ -72,8 +69,6 @@
72 69
73/* 70/*
74 * The following are implemented by software 71 * The following are implemented by software
75 *
76 * _PAGE_FILE semantics: set:pagecache unset:swap
77 */ 72 */
78#define _PAGE_PRESENT_SHIFT 0 73#define _PAGE_PRESENT_SHIFT 0
79#define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT) 74#define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT)
@@ -85,8 +80,6 @@
85#define _PAGE_ACCESSED (1 << _PAGE_ACCESSED_SHIFT) 80#define _PAGE_ACCESSED (1 << _PAGE_ACCESSED_SHIFT)
86#define _PAGE_MODIFIED_SHIFT 4 81#define _PAGE_MODIFIED_SHIFT 4
87#define _PAGE_MODIFIED (1 << _PAGE_MODIFIED_SHIFT) 82#define _PAGE_MODIFIED (1 << _PAGE_MODIFIED_SHIFT)
88#define _PAGE_FILE_SHIFT 4
89#define _PAGE_FILE (1 << _PAGE_FILE_SHIFT)
90 83
91/* 84/*
92 * And these are the hardware TLB bits 85 * And these are the hardware TLB bits
@@ -116,7 +109,6 @@
116 * The following bits are implemented in software 109 * The following bits are implemented in software
117 * 110 *
118 * _PAGE_READ / _PAGE_READ_SHIFT should be unused if cpu_has_rixi. 111 * _PAGE_READ / _PAGE_READ_SHIFT should be unused if cpu_has_rixi.
119 * _PAGE_FILE semantics: set:pagecache unset:swap
120 */ 112 */
121#define _PAGE_PRESENT_SHIFT (0) 113#define _PAGE_PRESENT_SHIFT (0)
122#define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT) 114#define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT)
@@ -128,7 +120,6 @@
128#define _PAGE_ACCESSED (1 << _PAGE_ACCESSED_SHIFT) 120#define _PAGE_ACCESSED (1 << _PAGE_ACCESSED_SHIFT)
129#define _PAGE_MODIFIED_SHIFT (_PAGE_ACCESSED_SHIFT + 1) 121#define _PAGE_MODIFIED_SHIFT (_PAGE_ACCESSED_SHIFT + 1)
130#define _PAGE_MODIFIED (1 << _PAGE_MODIFIED_SHIFT) 122#define _PAGE_MODIFIED (1 << _PAGE_MODIFIED_SHIFT)
131#define _PAGE_FILE (_PAGE_MODIFIED)
132 123
133#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT 124#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
134/* huge tlb page */ 125/* huge tlb page */
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
index 62a6ba383d4f..583ff4215479 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -231,7 +231,6 @@ extern pgd_t swapper_pg_dir[];
231static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; } 231static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; }
232static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; } 232static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; }
233static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; } 233static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; }
234static inline int pte_file(pte_t pte) { return pte.pte_low & _PAGE_FILE; }
235 234
236static inline pte_t pte_wrprotect(pte_t pte) 235static inline pte_t pte_wrprotect(pte_t pte)
237{ 236{
@@ -287,7 +286,6 @@ static inline pte_t pte_mkyoung(pte_t pte)
287static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } 286static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; }
288static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; } 287static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; }
289static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 288static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
290static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
291 289
292static inline pte_t pte_wrprotect(pte_t pte) 290static inline pte_t pte_wrprotect(pte_t pte)
293{ 291{