diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-01-30 07:32:58 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:58 -0500 |
commit | 4891645e764d2e181b834509a689fcd12e890c10 (patch) | |
tree | f347227c2d5a5b112bca8fe76b149ccc5157ef84 /include/asm-x86/pgtable-2level.h | |
parent | 8405b122ad0dd75354b3bfed4de9a96514fd40cb (diff) |
x86: unify paravirt pagetable accessors
Put all the defines for mapping pagetable operations to their native
versions (for the non-paravirt case) into one place. Make the
corresponding changes to paravirt.h.
The tricky part here is that when a pagetable entry can't be updated
atomically (ie, 32-bit PAE), we need special handlers for pte_clear,
set_pte_atomic and set_pte_present. However, the other two modes
don't need special handling for these, and can use a common
set_pte(_at) path.
[ mingo@elte.hu: fixes ]
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/pgtable-2level.h')
-rw-r--r-- | include/asm-x86/pgtable-2level.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/include/asm-x86/pgtable-2level.h b/include/asm-x86/pgtable-2level.h index 65cdc8f9e3b3..ce486bdbbbb7 100644 --- a/include/asm-x86/pgtable-2level.h +++ b/include/asm-x86/pgtable-2level.h | |||
@@ -15,29 +15,31 @@ static inline void native_set_pte(pte_t *ptep , pte_t pte) | |||
15 | { | 15 | { |
16 | *ptep = pte; | 16 | *ptep = pte; |
17 | } | 17 | } |
18 | static inline void native_set_pte_at(struct mm_struct *mm, unsigned long addr, | 18 | |
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) | 19 | static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd) |
24 | { | 20 | { |
25 | *pmdp = pmd; | 21 | *pmdp = pmd; |
26 | } | 22 | } |
27 | #ifndef CONFIG_PARAVIRT | ||
28 | #define set_pte(pteptr, pteval) native_set_pte(pteptr, pteval) | ||
29 | #define set_pte_at(mm,addr,ptep,pteval) native_set_pte_at(mm, addr, ptep, pteval) | ||
30 | #define set_pmd(pmdptr, pmdval) native_set_pmd(pmdptr, pmdval) | ||
31 | #endif | ||
32 | 23 | ||
33 | #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval) | 24 | static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte) |
34 | #define set_pte_present(mm,addr,ptep,pteval) set_pte_at(mm,addr,ptep,pteval) | 25 | { |
26 | native_set_pte(ptep, pte); | ||
27 | } | ||
28 | |||
29 | static inline void native_set_pte_present(struct mm_struct *mm, unsigned long addr, | ||
30 | pte_t *ptep, pte_t pte) | ||
31 | { | ||
32 | native_set_pte(ptep, pte); | ||
33 | } | ||
35 | 34 | ||
36 | #define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) | 35 | static inline void native_pmd_clear(pmd_t *pmdp) |
36 | { | ||
37 | native_set_pmd(pmdp, __pmd(0)); | ||
38 | } | ||
37 | 39 | ||
38 | static inline void native_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *xp) | 40 | static inline void native_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *xp) |
39 | { | 41 | { |
40 | *xp = __pte(0); | 42 | *xp = native_make_pte(0); |
41 | } | 43 | } |
42 | 44 | ||
43 | #ifdef CONFIG_SMP | 45 | #ifdef CONFIG_SMP |