提交 1eeda0ab 编写于 作者: K Kirill A. Shutemov 提交者: Linus Torvalds

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: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 406b16e2
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
* hitting hardware. * hitting hardware.
*/ */
#define CF_PAGE_DIRTY 0x00000001 #define CF_PAGE_DIRTY 0x00000001
#define CF_PAGE_FILE 0x00000200
#define CF_PAGE_ACCESSED 0x00001000 #define CF_PAGE_ACCESSED 0x00001000
#define _PAGE_CACHE040 0x020 /* 68040 cache mode, cachable, copyback */ #define _PAGE_CACHE040 0x020 /* 68040 cache mode, cachable, copyback */
...@@ -243,11 +242,6 @@ static inline int pte_young(pte_t pte) ...@@ -243,11 +242,6 @@ static inline int pte_young(pte_t pte)
return pte_val(pte) & CF_PAGE_ACCESSED; return pte_val(pte) & CF_PAGE_ACCESSED;
} }
static inline int pte_file(pte_t pte)
{
return pte_val(pte) & CF_PAGE_FILE;
}
static inline int pte_special(pte_t pte) static inline int pte_special(pte_t pte)
{ {
return 0; return 0;
...@@ -391,26 +385,13 @@ static inline void cache_page(void *vaddr) ...@@ -391,26 +385,13 @@ static inline void cache_page(void *vaddr)
*ptep = pte_mkcache(*ptep); *ptep = pte_mkcache(*ptep);
} }
#define PTE_FILE_MAX_BITS 21
#define PTE_FILE_SHIFT 11
static inline unsigned long pte_to_pgoff(pte_t pte)
{
return pte_val(pte) >> PTE_FILE_SHIFT;
}
static inline pte_t pgoff_to_pte(unsigned pgoff)
{
return __pte((pgoff << PTE_FILE_SHIFT) + CF_PAGE_FILE);
}
/* /*
* Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e)) * Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e))
*/ */
#define __swp_type(x) ((x).val & 0xFF) #define __swp_type(x) ((x).val & 0xFF)
#define __swp_offset(x) ((x).val >> PTE_FILE_SHIFT) #define __swp_offset(x) ((x).val >> 11)
#define __swp_entry(typ, off) ((swp_entry_t) { (typ) | \ #define __swp_entry(typ, off) ((swp_entry_t) { (typ) | \
(off << PTE_FILE_SHIFT) }) (off << 11) })
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
#define __swp_entry_to_pte(x) (__pte((x).val)) #define __swp_entry_to_pte(x) (__pte((x).val))
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_NOCACHE) #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_NOCACHE)
#define _PAGE_PROTNONE 0x004 #define _PAGE_PROTNONE 0x004
#define _PAGE_FILE 0x008 /* pagecache or swap? */
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
...@@ -168,7 +167,6 @@ static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp) ...@@ -168,7 +167,6 @@ static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp)
static inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_RONLY); } static inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_RONLY); }
static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
static inline int pte_special(pte_t pte) { return 0; } static inline int pte_special(pte_t pte) { return 0; }
static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_RONLY; return pte; } static 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,19 +264,6 @@ static inline void cache_page(void *vaddr)
} }
} }
#define PTE_FILE_MAX_BITS 28
static inline unsigned long pte_to_pgoff(pte_t pte)
{
return pte.pte >> 4;
}
static inline pte_t pgoff_to_pte(unsigned off)
{
pte_t pte = { (off << 4) + _PAGE_FILE };
return pte;
}
/* Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e)) */ /* Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e)) */
#define __swp_type(x) (((x).val >> 4) & 0xff) #define __swp_type(x) (((x).val >> 4) & 0xff)
#define __swp_offset(x) ((x).val >> 12) #define __swp_offset(x) ((x).val >> 12)
......
...@@ -37,8 +37,6 @@ extern void paging_init(void); ...@@ -37,8 +37,6 @@ extern void paging_init(void);
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) #define __swp_entry_to_pte(x) ((pte_t) { (x).val })
static inline int pte_file(pte_t pte) { return 0; }
/* /*
* ZERO_PAGE is a global shared page that is always zero: used * ZERO_PAGE is a global shared page that is always zero: used
* for zero-mapped memory areas etc.. * for zero-mapped memory areas etc..
......
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
#define _PAGE_PRESENT (SUN3_PAGE_VALID) #define _PAGE_PRESENT (SUN3_PAGE_VALID)
#define _PAGE_ACCESSED (SUN3_PAGE_ACCESSED) #define _PAGE_ACCESSED (SUN3_PAGE_ACCESSED)
#define PTE_FILE_MAX_BITS 28
/* Compound page protection values. */ /* Compound page protection values. */
//todo: work out which ones *should* have SUN3_PAGE_NOCACHE and fix... //todo: work out which ones *should* have SUN3_PAGE_NOCACHE and fix...
// is it just PAGE_KERNEL and PAGE_SHARED? // is it just PAGE_KERNEL and PAGE_SHARED?
...@@ -168,7 +166,6 @@ static inline void pgd_clear (pgd_t *pgdp) {} ...@@ -168,7 +166,6 @@ static inline void pgd_clear (pgd_t *pgdp) {}
static inline int pte_write(pte_t pte) { return pte_val(pte) & SUN3_PAGE_WRITEABLE; } static inline int pte_write(pte_t pte) { return pte_val(pte) & SUN3_PAGE_WRITEABLE; }
static inline int pte_dirty(pte_t pte) { return pte_val(pte) & SUN3_PAGE_MODIFIED; } static inline int pte_dirty(pte_t pte) { return pte_val(pte) & SUN3_PAGE_MODIFIED; }
static inline int pte_young(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; } static inline int pte_young(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; }
static inline int pte_file(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; }
static inline int pte_special(pte_t pte) { return 0; } static inline int pte_special(pte_t pte) { return 0; }
static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_WRITEABLE; return pte; } static 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,18 +199,6 @@ static inline pmd_t *pmd_offset (pgd_t *pgd, unsigned long address)
return (pmd_t *) pgd; return (pmd_t *) pgd;
} }
static inline unsigned long pte_to_pgoff(pte_t pte)
{
return pte.pte & SUN3_PAGE_PGNUM_MASK;
}
static inline pte_t pgoff_to_pte(unsigned off)
{
pte_t pte = { off + SUN3_PAGE_ACCESSED };
return pte;
}
/* Find an entry in the third-level pagetable. */ /* Find an entry in the third-level pagetable. */
#define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE-1)) #define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE-1))
#define pte_offset_kernel(pmd, address) ((pte_t *) __pmd_page(*pmd) + pte_index(address)) #define pte_offset_kernel(pmd, address) ((pte_t *) __pmd_page(*pmd) + pte_index(address))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册