diff options
Diffstat (limited to 'arch/x86/include/asm/pgtable_64.h')
| -rw-r--r-- | arch/x86/include/asm/pgtable_64.h | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h index 076052cd62be..975f709e09ae 100644 --- a/arch/x86/include/asm/pgtable_64.h +++ b/arch/x86/include/asm/pgtable_64.h | |||
| @@ -59,6 +59,16 @@ static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte) | |||
| 59 | native_set_pte(ptep, pte); | 59 | native_set_pte(ptep, pte); |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd) | ||
| 63 | { | ||
| 64 | *pmdp = pmd; | ||
| 65 | } | ||
| 66 | |||
| 67 | static inline void native_pmd_clear(pmd_t *pmd) | ||
| 68 | { | ||
| 69 | native_set_pmd(pmd, native_make_pmd(0)); | ||
| 70 | } | ||
| 71 | |||
| 62 | static inline pte_t native_ptep_get_and_clear(pte_t *xp) | 72 | static inline pte_t native_ptep_get_and_clear(pte_t *xp) |
| 63 | { | 73 | { |
| 64 | #ifdef CONFIG_SMP | 74 | #ifdef CONFIG_SMP |
| @@ -72,14 +82,17 @@ static inline pte_t native_ptep_get_and_clear(pte_t *xp) | |||
| 72 | #endif | 82 | #endif |
| 73 | } | 83 | } |
| 74 | 84 | ||
| 75 | static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd) | 85 | static inline pmd_t native_pmdp_get_and_clear(pmd_t *xp) |
| 76 | { | ||
| 77 | *pmdp = pmd; | ||
| 78 | } | ||
| 79 | |||
| 80 | static inline void native_pmd_clear(pmd_t *pmd) | ||
| 81 | { | 86 | { |
| 82 | native_set_pmd(pmd, native_make_pmd(0)); | 87 | #ifdef CONFIG_SMP |
| 88 | return native_make_pmd(xchg(&xp->pmd, 0)); | ||
| 89 | #else | ||
| 90 | /* native_local_pmdp_get_and_clear, | ||
| 91 | but duplicated because of cyclic dependency */ | ||
| 92 | pmd_t ret = *xp; | ||
| 93 | native_pmd_clear(xp); | ||
| 94 | return ret; | ||
| 95 | #endif | ||
| 83 | } | 96 | } |
| 84 | 97 | ||
| 85 | static inline void native_set_pud(pud_t *pudp, pud_t pud) | 98 | static inline void native_set_pud(pud_t *pudp, pud_t pud) |
| @@ -102,6 +115,8 @@ static inline void native_pgd_clear(pgd_t *pgd) | |||
| 102 | native_set_pgd(pgd, native_make_pgd(0)); | 115 | native_set_pgd(pgd, native_make_pgd(0)); |
| 103 | } | 116 | } |
| 104 | 117 | ||
| 118 | extern void sync_global_pgds(unsigned long start, unsigned long end); | ||
| 119 | |||
| 105 | /* | 120 | /* |
| 106 | * Conversion functions: convert a page and protection to a page entry, | 121 | * Conversion functions: convert a page and protection to a page entry, |
| 107 | * and a page entry and page directory to the page they refer to. | 122 | * and a page entry and page directory to the page they refer to. |
| @@ -125,9 +140,7 @@ static inline int pgd_large(pgd_t pgd) { return 0; } | |||
| 125 | 140 | ||
| 126 | /* x86-64 always has all page tables mapped. */ | 141 | /* x86-64 always has all page tables mapped. */ |
| 127 | #define pte_offset_map(dir, address) pte_offset_kernel((dir), (address)) | 142 | #define pte_offset_map(dir, address) pte_offset_kernel((dir), (address)) |
| 128 | #define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address)) | ||
| 129 | #define pte_unmap(pte) ((void)(pte))/* NOP */ | 143 | #define pte_unmap(pte) ((void)(pte))/* NOP */ |
| 130 | #define pte_unmap_nested(pte) ((void)(pte)) /* NOP */ | ||
| 131 | 144 | ||
| 132 | #define update_mmu_cache(vma, address, ptep) do { } while (0) | 145 | #define update_mmu_cache(vma, address, ptep) do { } while (0) |
| 133 | 146 | ||
| @@ -168,6 +181,7 @@ extern void cleanup_highmap(void); | |||
| 168 | #define kc_offset_to_vaddr(o) ((o) | ~__VIRTUAL_MASK) | 181 | #define kc_offset_to_vaddr(o) ((o) | ~__VIRTUAL_MASK) |
| 169 | 182 | ||
| 170 | #define __HAVE_ARCH_PTE_SAME | 183 | #define __HAVE_ARCH_PTE_SAME |
| 184 | |||
| 171 | #endif /* !__ASSEMBLY__ */ | 185 | #endif /* !__ASSEMBLY__ */ |
| 172 | 186 | ||
| 173 | #endif /* _ASM_X86_PGTABLE_64_H */ | 187 | #endif /* _ASM_X86_PGTABLE_64_H */ |
