aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/include
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill@shutemov.name>2015-02-10 17:10:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 17:30:32 -0500
commit1eeda0abf4425c91e7ce3ca32f1908c3a51bf84e (patch)
tree80f47045595f8698f42df5252cab9acc7eea9bd3 /arch/m68k/include
parent406b16e26d0996516c8d1641008a7d326bf282d6 (diff)
m68k: 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: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68k/include')
-rw-r--r--arch/m68k/include/asm/mcf_pgtable.h23
-rw-r--r--arch/m68k/include/asm/motorola_pgtable.h15
-rw-r--r--arch/m68k/include/asm/pgtable_no.h2
-rw-r--r--arch/m68k/include/asm/sun3_pgtable.h15
4 files changed, 2 insertions, 53 deletions
diff --git a/arch/m68k/include/asm/mcf_pgtable.h b/arch/m68k/include/asm/mcf_pgtable.h
index 3c793682e5d9..2500ce04fcc4 100644
--- a/arch/m68k/include/asm/mcf_pgtable.h
+++ b/arch/m68k/include/asm/mcf_pgtable.h
@@ -35,7 +35,6 @@
35 * hitting hardware. 35 * hitting hardware.
36 */ 36 */
37#define CF_PAGE_DIRTY 0x00000001 37#define CF_PAGE_DIRTY 0x00000001
38#define CF_PAGE_FILE 0x00000200
39#define CF_PAGE_ACCESSED 0x00001000 38#define CF_PAGE_ACCESSED 0x00001000
40 39
41#define _PAGE_CACHE040 0x020 /* 68040 cache mode, cachable, copyback */ 40#define _PAGE_CACHE040 0x020 /* 68040 cache mode, cachable, copyback */
@@ -243,11 +242,6 @@ static inline int pte_young(pte_t pte)
243 return pte_val(pte) & CF_PAGE_ACCESSED; 242 return pte_val(pte) & CF_PAGE_ACCESSED;
244} 243}
245 244
246static inline int pte_file(pte_t pte)
247{
248 return pte_val(pte) & CF_PAGE_FILE;
249}
250
251static inline int pte_special(pte_t pte) 245static inline int pte_special(pte_t pte)
252{ 246{
253 return 0; 247 return 0;
@@ -391,26 +385,13 @@ static inline void cache_page(void *vaddr)
391 *ptep = pte_mkcache(*ptep); 385 *ptep = pte_mkcache(*ptep);
392} 386}
393 387
394#define PTE_FILE_MAX_BITS 21
395#define PTE_FILE_SHIFT 11
396
397static inline unsigned long pte_to_pgoff(pte_t pte)
398{
399 return pte_val(pte) >> PTE_FILE_SHIFT;
400}
401
402static inline pte_t pgoff_to_pte(unsigned pgoff)
403{
404 return __pte((pgoff << PTE_FILE_SHIFT) + CF_PAGE_FILE);
405}
406
407/* 388/*
408 * Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e)) 389 * Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e))
409 */ 390 */
410#define __swp_type(x) ((x).val & 0xFF) 391#define __swp_type(x) ((x).val & 0xFF)
411#define __swp_offset(x) ((x).val >> PTE_FILE_SHIFT) 392#define __swp_offset(x) ((x).val >> 11)
412#define __swp_entry(typ, off) ((swp_entry_t) { (typ) | \ 393#define __swp_entry(typ, off) ((swp_entry_t) { (typ) | \
413 (off << PTE_FILE_SHIFT) }) 394 (off << 11) })
414#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 395#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
415#define __swp_entry_to_pte(x) (__pte((x).val)) 396#define __swp_entry_to_pte(x) (__pte((x).val))
416 397
diff --git a/arch/m68k/include/asm/motorola_pgtable.h b/arch/m68k/include/asm/motorola_pgtable.h
index e0fdd4d08075..0085aab80e5a 100644
--- a/arch/m68k/include/asm/motorola_pgtable.h
+++ b/arch/m68k/include/asm/motorola_pgtable.h
@@ -28,7 +28,6 @@
28#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_NOCACHE) 28#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_NOCACHE)
29 29
30#define _PAGE_PROTNONE 0x004 30#define _PAGE_PROTNONE 0x004
31#define _PAGE_FILE 0x008 /* pagecache or swap? */
32 31
33#ifndef __ASSEMBLY__ 32#ifndef __ASSEMBLY__
34 33
@@ -168,7 +167,6 @@ static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp)
168static inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_RONLY); } 167static inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_RONLY); }
169static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } 168static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
170static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 169static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
171static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
172static inline int pte_special(pte_t pte) { return 0; } 170static inline int pte_special(pte_t pte) { return 0; }
173 171
174static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_RONLY; return pte; } 172static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_RONLY; return pte; }
@@ -266,19 +264,6 @@ static inline void cache_page(void *vaddr)
266 } 264 }
267} 265}
268 266
269#define PTE_FILE_MAX_BITS 28
270
271static inline unsigned long pte_to_pgoff(pte_t pte)
272{
273 return pte.pte >> 4;
274}
275
276static inline pte_t pgoff_to_pte(unsigned off)
277{
278 pte_t pte = { (off << 4) + _PAGE_FILE };
279 return pte;
280}
281
282/* Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e)) */ 267/* Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e)) */
283#define __swp_type(x) (((x).val >> 4) & 0xff) 268#define __swp_type(x) (((x).val >> 4) & 0xff)
284#define __swp_offset(x) ((x).val >> 12) 269#define __swp_offset(x) ((x).val >> 12)
diff --git a/arch/m68k/include/asm/pgtable_no.h b/arch/m68k/include/asm/pgtable_no.h
index 11859b86b1f9..ac7d87a02335 100644
--- a/arch/m68k/include/asm/pgtable_no.h
+++ b/arch/m68k/include/asm/pgtable_no.h
@@ -37,8 +37,6 @@ extern void paging_init(void);
37#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 37#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
38#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 38#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
39 39
40static inline int pte_file(pte_t pte) { return 0; }
41
42/* 40/*
43 * ZERO_PAGE is a global shared page that is always zero: used 41 * ZERO_PAGE is a global shared page that is always zero: used
44 * for zero-mapped memory areas etc.. 42 * for zero-mapped memory areas etc..
diff --git a/arch/m68k/include/asm/sun3_pgtable.h b/arch/m68k/include/asm/sun3_pgtable.h
index f55aa04161e8..48657f9fdece 100644
--- a/arch/m68k/include/asm/sun3_pgtable.h
+++ b/arch/m68k/include/asm/sun3_pgtable.h
@@ -38,8 +38,6 @@
38#define _PAGE_PRESENT (SUN3_PAGE_VALID) 38#define _PAGE_PRESENT (SUN3_PAGE_VALID)
39#define _PAGE_ACCESSED (SUN3_PAGE_ACCESSED) 39#define _PAGE_ACCESSED (SUN3_PAGE_ACCESSED)
40 40
41#define PTE_FILE_MAX_BITS 28
42
43/* Compound page protection values. */ 41/* Compound page protection values. */
44//todo: work out which ones *should* have SUN3_PAGE_NOCACHE and fix... 42//todo: work out which ones *should* have SUN3_PAGE_NOCACHE and fix...
45// is it just PAGE_KERNEL and PAGE_SHARED? 43// is it just PAGE_KERNEL and PAGE_SHARED?
@@ -168,7 +166,6 @@ static inline void pgd_clear (pgd_t *pgdp) {}
168static inline int pte_write(pte_t pte) { return pte_val(pte) & SUN3_PAGE_WRITEABLE; } 166static inline int pte_write(pte_t pte) { return pte_val(pte) & SUN3_PAGE_WRITEABLE; }
169static inline int pte_dirty(pte_t pte) { return pte_val(pte) & SUN3_PAGE_MODIFIED; } 167static inline int pte_dirty(pte_t pte) { return pte_val(pte) & SUN3_PAGE_MODIFIED; }
170static inline int pte_young(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; } 168static inline int pte_young(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; }
171static inline int pte_file(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; }
172static inline int pte_special(pte_t pte) { return 0; } 169static inline int pte_special(pte_t pte) { return 0; }
173 170
174static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_WRITEABLE; return pte; } 171static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_WRITEABLE; return pte; }
@@ -202,18 +199,6 @@ static inline pmd_t *pmd_offset (pgd_t *pgd, unsigned long address)
202 return (pmd_t *) pgd; 199 return (pmd_t *) pgd;
203} 200}
204 201
205static inline unsigned long pte_to_pgoff(pte_t pte)
206{
207 return pte.pte & SUN3_PAGE_PGNUM_MASK;
208}
209
210static inline pte_t pgoff_to_pte(unsigned off)
211{
212 pte_t pte = { off + SUN3_PAGE_ACCESSED };
213 return pte;
214}
215
216
217/* Find an entry in the third-level pagetable. */ 202/* Find an entry in the third-level pagetable. */
218#define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE-1)) 203#define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE-1))
219#define pte_offset_kernel(pmd, address) ((pte_t *) __pmd_page(*pmd) + pte_index(address)) 204#define pte_offset_kernel(pmd, address) ((pte_t *) __pmd_page(*pmd) + pte_index(address))