aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2015-02-10 17:10:31 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 17:30:32 -0500
commitca5bfa7b390017f053d7581bc701518b87bc3d43 (patch)
tree77d7751bfeb23515870c57ffc2ef08e1e56163ed
parent103f3d9a26df944f4c29de190d72dfbf913c71af (diff)
frv: drop _PAGE_FILE and pte_file()-related helpers
We've replaced remap_file_pages(2) implementation with emulation. Nobody creates non-linear mapping anymore. This patch also increase number of bits availble for swap offset. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/frv/include/asm/pgtable.h27
1 files changed, 5 insertions, 22 deletions
diff --git a/arch/frv/include/asm/pgtable.h b/arch/frv/include/asm/pgtable.h
index eb0110acd19b..c49699d5902d 100644
--- a/arch/frv/include/asm/pgtable.h
+++ b/arch/frv/include/asm/pgtable.h
@@ -62,10 +62,6 @@ typedef pte_t *pte_addr_t;
62#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 62#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
63#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 63#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
64 64
65#ifndef __ASSEMBLY__
66static inline int pte_file(pte_t pte) { return 0; }
67#endif
68
69#define ZERO_PAGE(vaddr) ({ BUG(); NULL; }) 65#define ZERO_PAGE(vaddr) ({ BUG(); NULL; })
70 66
71#define swapper_pg_dir ((pgd_t *) NULL) 67#define swapper_pg_dir ((pgd_t *) NULL)
@@ -298,7 +294,6 @@ static inline pmd_t *pmd_offset(pud_t *dir, unsigned long address)
298 294
299#define _PAGE_RESERVED_MASK (xAMPRx_RESERVED8 | xAMPRx_RESERVED13) 295#define _PAGE_RESERVED_MASK (xAMPRx_RESERVED8 | xAMPRx_RESERVED13)
300 296
301#define _PAGE_FILE 0x002 /* set:pagecache unset:swap */
302#define _PAGE_PROTNONE 0x000 /* If not present */ 297#define _PAGE_PROTNONE 0x000 /* If not present */
303 298
304#define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) 299#define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
@@ -463,27 +458,15 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
463 * Handle swap and file entries 458 * Handle swap and file entries
464 * - the PTE is encoded in the following format: 459 * - the PTE is encoded in the following format:
465 * bit 0: Must be 0 (!_PAGE_PRESENT) 460 * bit 0: Must be 0 (!_PAGE_PRESENT)
466 * bit 1: Type: 0 for swap, 1 for file (_PAGE_FILE) 461 * bits 1-6: Swap type
467 * bits 2-7: Swap type 462 * bits 7-31: Swap offset
468 * bits 8-31: Swap offset
469 * bits 2-31: File pgoff
470 */ 463 */
471#define __swp_type(x) (((x).val >> 2) & 0x1f) 464#define __swp_type(x) (((x).val >> 1) & 0x1f)
472#define __swp_offset(x) ((x).val >> 8) 465#define __swp_offset(x) ((x).val >> 7)
473#define __swp_entry(type, offset) ((swp_entry_t) { ((type) << 2) | ((offset) << 8) }) 466#define __swp_entry(type, offset) ((swp_entry_t) { ((type) << 1) | ((offset) << 7) })
474#define __pte_to_swp_entry(_pte) ((swp_entry_t) { (_pte).pte }) 467#define __pte_to_swp_entry(_pte) ((swp_entry_t) { (_pte).pte })
475#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 468#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
476 469
477static inline int pte_file(pte_t pte)
478{
479 return pte.pte & _PAGE_FILE;
480}
481
482#define PTE_FILE_MAX_BITS 29
483
484#define pte_to_pgoff(PTE) ((PTE).pte >> 2)
485#define pgoff_to_pte(off) __pte((off) << 2 | _PAGE_FILE)
486
487/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ 470/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
488#define PageSkip(page) (0) 471#define PageSkip(page) (0)
489#define kern_addr_valid(addr) (1) 472#define kern_addr_valid(addr) (1)