diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-01-30 07:33:15 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:33:15 -0500 |
commit | ef38503e034f82ad16a75a9dfea40ed7adaf00a8 (patch) | |
tree | 361f496de632691fd6880a5607993c8e3f504bd7 /include/asm-x86/paravirt.h | |
parent | 773221f46f82dc2f277dacc331d9d2ef2c690cb6 (diff) |
x86/paravirt: common implementation for pgd value ops
Remove duplicate __pgd/pgd_val functions.
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/paravirt.h')
-rw-r--r-- | include/asm-x86/paravirt.h | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h index b7342efab834..eac25b5323a2 100644 --- a/include/asm-x86/paravirt.h +++ b/include/asm-x86/paravirt.h | |||
@@ -950,16 +950,38 @@ static inline pteval_t pte_val(pte_t pte) | |||
950 | return ret; | 950 | return ret; |
951 | } | 951 | } |
952 | 952 | ||
953 | #ifdef CONFIG_X86_PAE | 953 | static inline pgd_t __pgd(pgdval_t val) |
954 | static inline pmd_t __pmd(unsigned long long val) | ||
955 | { | 954 | { |
956 | return (pmd_t) { PVOP_CALL2(unsigned long long, pv_mmu_ops.make_pmd, | 955 | pgdval_t ret; |
957 | val, val >> 32) }; | 956 | |
957 | if (sizeof(pgdval_t) > sizeof(long)) | ||
958 | ret = PVOP_CALL2(pgdval_t, pv_mmu_ops.make_pgd, | ||
959 | val, (u64)val >> 32); | ||
960 | else | ||
961 | ret = PVOP_CALL1(pgdval_t, pv_mmu_ops.make_pgd, | ||
962 | val); | ||
963 | |||
964 | return (pgd_t) { ret }; | ||
965 | } | ||
966 | |||
967 | static inline pgdval_t pgd_val(pgd_t pgd) | ||
968 | { | ||
969 | pgdval_t ret; | ||
970 | |||
971 | if (sizeof(pgdval_t) > sizeof(long)) | ||
972 | ret = PVOP_CALL2(pgdval_t, pv_mmu_ops.pgd_val, | ||
973 | pgd.pgd, (u64)pgd.pgd >> 32); | ||
974 | else | ||
975 | ret = PVOP_CALL1(pgdval_t, pv_mmu_ops.pgd_val, | ||
976 | pgd.pgd); | ||
977 | |||
978 | return ret; | ||
958 | } | 979 | } |
959 | 980 | ||
960 | static inline pgd_t __pgd(unsigned long long val) | 981 | #ifdef CONFIG_X86_PAE |
982 | static inline pmd_t __pmd(unsigned long long val) | ||
961 | { | 983 | { |
962 | return (pgd_t) { PVOP_CALL2(unsigned long long, pv_mmu_ops.make_pgd, | 984 | return (pmd_t) { PVOP_CALL2(unsigned long long, pv_mmu_ops.make_pmd, |
963 | val, val >> 32) }; | 985 | val, val >> 32) }; |
964 | } | 986 | } |
965 | 987 | ||
@@ -969,12 +991,6 @@ static inline unsigned long long pmd_val(pmd_t x) | |||
969 | x.pmd, x.pmd >> 32); | 991 | x.pmd, x.pmd >> 32); |
970 | } | 992 | } |
971 | 993 | ||
972 | static inline unsigned long long pgd_val(pgd_t x) | ||
973 | { | ||
974 | return PVOP_CALL2(unsigned long long, pv_mmu_ops.pgd_val, | ||
975 | x.pgd, x.pgd >> 32); | ||
976 | } | ||
977 | |||
978 | static inline void set_pte(pte_t *ptep, pte_t pteval) | 994 | static inline void set_pte(pte_t *ptep, pte_t pteval) |
979 | { | 995 | { |
980 | PVOP_VCALL3(pv_mmu_ops.set_pte, ptep, pteval.pte_low, pteval.pte_high); | 996 | PVOP_VCALL3(pv_mmu_ops.set_pte, ptep, pteval.pte_low, pteval.pte_high); |
@@ -1024,16 +1040,6 @@ static inline void pmd_clear(pmd_t *pmdp) | |||
1024 | 1040 | ||
1025 | #else /* !CONFIG_X86_PAE */ | 1041 | #else /* !CONFIG_X86_PAE */ |
1026 | 1042 | ||
1027 | static inline pgd_t __pgd(unsigned long val) | ||
1028 | { | ||
1029 | return (pgd_t) { PVOP_CALL1(unsigned long, pv_mmu_ops.make_pgd, val) }; | ||
1030 | } | ||
1031 | |||
1032 | static inline unsigned long pgd_val(pgd_t x) | ||
1033 | { | ||
1034 | return PVOP_CALL1(unsigned long, pv_mmu_ops.pgd_val, x.pgd); | ||
1035 | } | ||
1036 | |||
1037 | static inline void set_pte(pte_t *ptep, pte_t pteval) | 1043 | static inline void set_pte(pte_t *ptep, pte_t pteval) |
1038 | { | 1044 | { |
1039 | PVOP_VCALL2(pv_mmu_ops.set_pte, ptep, pteval.pte_low); | 1045 | PVOP_VCALL2(pv_mmu_ops.set_pte, ptep, pteval.pte_low); |