aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/asm-x86/pgtable-2level.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/include/asm-x86/pgtable-2level.h b/include/asm-x86/pgtable-2level.h
index 701404fab308..46bc52c0eae1 100644
--- a/include/asm-x86/pgtable-2level.h
+++ b/include/asm-x86/pgtable-2level.h
@@ -26,7 +26,8 @@ static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte)
26 native_set_pte(ptep, pte); 26 native_set_pte(ptep, pte);
27} 27}
28 28
29static inline void native_set_pte_present(struct mm_struct *mm, unsigned long addr, 29static inline void native_set_pte_present(struct mm_struct *mm,
30 unsigned long addr,
30 pte_t *ptep, pte_t pte) 31 pte_t *ptep, pte_t pte)
31{ 32{
32 native_set_pte(ptep, pte); 33 native_set_pte(ptep, pte);
@@ -37,7 +38,8 @@ static inline void native_pmd_clear(pmd_t *pmdp)
37 native_set_pmd(pmdp, __pmd(0)); 38 native_set_pmd(pmdp, __pmd(0));
38} 39}
39 40
40static inline void native_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *xp) 41static inline void native_pte_clear(struct mm_struct *mm,
42 unsigned long addr, pte_t *xp)
41{ 43{
42 *xp = native_make_pte(0); 44 *xp = native_make_pte(0);
43} 45}
@@ -61,16 +63,18 @@ static inline pte_t native_ptep_get_and_clear(pte_t *xp)
61 */ 63 */
62#define PTE_FILE_MAX_BITS 29 64#define PTE_FILE_MAX_BITS 29
63 65
64#define pte_to_pgoff(pte) \ 66#define pte_to_pgoff(pte) \
65 ((((pte).pte_low >> 1) & 0x1f ) + (((pte).pte_low >> 8) << 5 )) 67 ((((pte).pte_low >> 1) & 0x1f) + (((pte).pte_low >> 8) << 5))
66 68
67#define pgoff_to_pte(off) \ 69#define pgoff_to_pte(off) \
68 ((pte_t) { .pte_low = (((off) & 0x1f) << 1) + (((off) >> 5) << 8) + _PAGE_FILE }) 70 ((pte_t) { .pte_low = (((off) & 0x1f) << 1) + \
71 (((off) >> 5) << 8) + _PAGE_FILE })
69 72
70/* Encode and de-code a swap entry */ 73/* Encode and de-code a swap entry */
71#define __swp_type(x) (((x).val >> 1) & 0x1f) 74#define __swp_type(x) (((x).val >> 1) & 0x1f)
72#define __swp_offset(x) ((x).val >> 8) 75#define __swp_offset(x) ((x).val >> 8)
73#define __swp_entry(type, offset) ((swp_entry_t) { ((type) << 1) | ((offset) << 8) }) 76#define __swp_entry(type, offset) \
77 ((swp_entry_t) { ((type) << 1) | ((offset) << 8) })
74#define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_low }) 78#define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_low })
75#define __swp_entry_to_pte(x) ((pte_t) { .pte = (x).val }) 79#define __swp_entry_to_pte(x) ((pte_t) { .pte = (x).val })
76 80