1 #ifndef _ASM_X86_PGTABLE_3LEVEL_H
2 #define _ASM_X86_PGTABLE_3LEVEL_H
11 #define pte_ERROR(e) \
12 pr_err("%s:%d: bad pte %p(%08lx%08lx)\n", \
13 __FILE__, __LINE__, &(e), (e).pte_high, (e).pte_low)
14 #define pmd_ERROR(e) \
15 pr_err("%s:%d: bad pmd %p(%016Lx)\n", \
16 __FILE__, __LINE__, &(e), pmd_val(e))
17 #define pgd_ERROR(e) \
18 pr_err("%s:%d: bad pgd %p(%016Lx)\n", \
19 __FILE__, __LINE__, &(e), pgd_val(e))
34 #define pmd_read_atomic pmd_read_atomic
85 return (
pmd_t) { ret };
88 static inline void native_set_pte_atomic(
pte_t *ptep,
pte_t pte)
90 set_64bit((
unsigned long long *)(ptep), native_pte_val(pte));
95 set_64bit((
unsigned long long *)(pmdp), native_pmd_val(pmd));
98 static inline void native_set_pud(
pud_t *pudp,
pud_t pud)
100 set_64bit((
unsigned long long *)(pudp), native_pud_val(pud));
108 static inline void native_pte_clear(
struct mm_struct *mm,
unsigned long addr,
116 static inline void native_pmd_clear(
pmd_t *pmd)
153 #define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)
166 union split_pmd
res, *orig = (
union split_pmd *)pmdp;
169 res.pmd_low =
xchg(&orig->pmd_low, 0);
170 res.pmd_high = orig->pmd_high;
176 #define native_pmdp_get_and_clear(xp) native_local_pmdp_get_and_clear(xp)
183 #define pte_to_pgoff(pte) ((pte).pte_high)
184 #define pgoff_to_pte(off) \
185 ((pte_t) { { .pte_low = _PAGE_FILE, .pte_high = (off) } })
186 #define PTE_FILE_MAX_BITS 32
189 #define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > 5)
190 #define __swp_type(x) (((x).val) & 0x1f)
191 #define __swp_offset(x) ((x).val >> 5)
192 #define __swp_entry(type, offset) ((swp_entry_t){(type) | (offset) << 5})
193 #define __pte_to_swp_entry(pte) ((swp_entry_t){ (pte).pte_high })
194 #define __swp_entry_to_pte(x) ((pte_t){ { .pte_high = (x).val } })