aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/include/asm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 19:45:56 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 19:45:56 -0500
commit992de5a8eca7cbd3215e3eb2c439b2c11582a58b (patch)
tree863988f84c1dd57a02fa337ecbce49263a3b9511 /arch/m68k/include/asm
parentb2718bffb4088faf13092db30c1ebf088ddee52e (diff)
parentd5b3cf7139b8770af4ed8bb36a1ab9d290ac39e9 (diff)
Merge branch 'akpm' (patches from Andrew)
Merge misc updates from Andrew Morton: "Bite-sized chunks this time, to avoid the MTA ratelimiting woes. - fs/notify updates - ocfs2 - some of MM" That laconic "some MM" is mainly the removal of remap_file_pages(), which is a big simplification of the VM, and which gets rid of a *lot* of random cruft and special cases because we no longer support the non-linear mappings that it used. From a user interface perspective, nothing has changed, because the remap_file_pages() syscall still exists, it's just done by emulating the old behavior by creating a lot of individual small mappings instead of one non-linear one. The emulation is slower than the old "native" non-linear mappings, but nobody really uses or cares about remap_file_pages(), and simplifying the VM is a big advantage. * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (78 commits) memcg: zap memcg_slab_caches and memcg_slab_mutex memcg: zap memcg_name argument of memcg_create_kmem_cache memcg: zap __memcg_{charge,uncharge}_slab mm/page_alloc.c: place zone_id check before VM_BUG_ON_PAGE check mm: hugetlb: fix type of hugetlb_treat_as_movable variable mm, hugetlb: remove unnecessary lower bound on sysctl handlers"? mm: memory: merge shared-writable dirtying branches in do_wp_page() mm: memory: remove ->vm_file check on shared writable vmas xtensa: drop _PAGE_FILE and pte_file()-related helpers x86: drop _PAGE_FILE and pte_file()-related helpers unicore32: drop pte_file()-related helpers um: drop _PAGE_FILE and pte_file()-related helpers tile: drop pte_file()-related helpers sparc: drop pte_file()-related helpers sh: drop _PAGE_FILE and pte_file()-related helpers score: drop _PAGE_FILE and pte_file()-related helpers s390: drop pte_file()-related helpers parisc: drop _PAGE_FILE and pte_file()-related helpers openrisc: drop _PAGE_FILE and pte_file()-related helpers nios2: drop _PAGE_FILE and pte_file()-related helpers ...
Diffstat (limited to 'arch/m68k/include/asm')
-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))