diff options
Diffstat (limited to 'include/asm-i386/pgtable-2level.h')
-rw-r--r-- | include/asm-i386/pgtable-2level.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h index 38c3fcc0676d..043a2bcfa86a 100644 --- a/include/asm-i386/pgtable-2level.h +++ b/include/asm-i386/pgtable-2level.h | |||
@@ -11,10 +11,23 @@ | |||
11 | * within a page table are directly modified. Thus, the following | 11 | * within a page table are directly modified. Thus, the following |
12 | * hook is made available. | 12 | * hook is made available. |
13 | */ | 13 | */ |
14 | static inline void native_set_pte(pte_t *ptep , pte_t pte) | ||
15 | { | ||
16 | *ptep = pte; | ||
17 | } | ||
18 | static inline void native_set_pte_at(struct mm_struct *mm, unsigned long addr, | ||
19 | pte_t *ptep , pte_t pte) | ||
20 | { | ||
21 | native_set_pte(ptep, pte); | ||
22 | } | ||
23 | static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd) | ||
24 | { | ||
25 | *pmdp = pmd; | ||
26 | } | ||
14 | #ifndef CONFIG_PARAVIRT | 27 | #ifndef CONFIG_PARAVIRT |
15 | #define set_pte(pteptr, pteval) (*(pteptr) = pteval) | 28 | #define set_pte(pteptr, pteval) native_set_pte(pteptr, pteval) |
16 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) | 29 | #define set_pte_at(mm,addr,ptep,pteval) native_set_pte_at(mm, addr, ptep, pteval) |
17 | #define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) | 30 | #define set_pmd(pmdptr, pmdval) native_set_pmd(pmdptr, pmdval) |
18 | #endif | 31 | #endif |
19 | 32 | ||
20 | #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval) | 33 | #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval) |
@@ -23,11 +36,14 @@ | |||
23 | #define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) | 36 | #define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) |
24 | #define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) | 37 | #define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) |
25 | 38 | ||
26 | #define raw_ptep_get_and_clear(xp) __pte(xchg(&(xp)->pte_low, 0)) | 39 | static inline pte_t native_ptep_get_and_clear(pte_t *xp) |
40 | { | ||
41 | return __pte(xchg(&xp->pte_low, 0)); | ||
42 | } | ||
27 | 43 | ||
28 | #define pte_page(x) pfn_to_page(pte_pfn(x)) | 44 | #define pte_page(x) pfn_to_page(pte_pfn(x)) |
29 | #define pte_none(x) (!(x).pte_low) | 45 | #define pte_none(x) (!(x).pte_low) |
30 | #define pte_pfn(x) ((unsigned long)(((x).pte_low >> PAGE_SHIFT))) | 46 | #define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) |
31 | #define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) | 47 | #define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) |
32 | #define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) | 48 | #define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) |
33 | 49 | ||