diff options
Diffstat (limited to 'include/asm-i386/pgtable-3level.h')
| -rw-r--r-- | include/asm-i386/pgtable-3level.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h index 36a5aa63cbbf..dccb1b3337ad 100644 --- a/include/asm-i386/pgtable-3level.h +++ b/include/asm-i386/pgtable-3level.h | |||
| @@ -85,6 +85,26 @@ static inline void pud_clear (pud_t * pud) { } | |||
| 85 | #define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \ | 85 | #define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \ |
| 86 | pmd_index(address)) | 86 | pmd_index(address)) |
| 87 | 87 | ||
| 88 | /* | ||
| 89 | * For PTEs and PDEs, we must clear the P-bit first when clearing a page table | ||
| 90 | * entry, so clear the bottom half first and enforce ordering with a compiler | ||
| 91 | * barrier. | ||
| 92 | */ | ||
| 93 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | ||
| 94 | { | ||
| 95 | ptep->pte_low = 0; | ||
| 96 | smp_wmb(); | ||
| 97 | ptep->pte_high = 0; | ||
| 98 | } | ||
| 99 | |||
| 100 | static inline void pmd_clear(pmd_t *pmd) | ||
| 101 | { | ||
| 102 | u32 *tmp = (u32 *)pmd; | ||
| 103 | *tmp = 0; | ||
| 104 | smp_wmb(); | ||
| 105 | *(tmp + 1) = 0; | ||
| 106 | } | ||
| 107 | |||
| 88 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | 108 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) |
| 89 | { | 109 | { |
| 90 | pte_t res; | 110 | pte_t res; |
