aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-01-30 07:33:15 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:15 -0500
commit773221f46f82dc2f277dacc331d9d2ef2c690cb6 (patch)
treeb58e6752156f35004a0f274da57263c35732f81d /include
parent5b8dd1e95b5f2b7b80cfc7e6bb709603aef8bbc1 (diff)
x86/paravirt: common implementation for pte value ops
Remove duplicate __pte/pte_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')
-rw-r--r--include/asm-x86/paravirt.h48
1 files changed, 27 insertions, 21 deletions
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index c38cf1ac4e48..b7342efab834 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -920,15 +920,37 @@ static inline void pte_update_defer(struct mm_struct *mm, unsigned long addr,
920 PVOP_VCALL3(pv_mmu_ops.pte_update_defer, mm, addr, ptep); 920 PVOP_VCALL3(pv_mmu_ops.pte_update_defer, mm, addr, ptep);
921} 921}
922 922
923#ifdef CONFIG_X86_PAE 923static inline pte_t __pte(pteval_t val)
924static inline pte_t __pte(unsigned long long val)
925{ 924{
926 unsigned long long ret = PVOP_CALL2(unsigned long long, 925 pteval_t ret;
927 pv_mmu_ops.make_pte, 926
928 val, val >> 32); 927 if (sizeof(pteval_t) > sizeof(long))
928 ret = PVOP_CALL2(pteval_t,
929 pv_mmu_ops.make_pte,
930 val, (u64)val >> 32);
931 else
932 ret = PVOP_CALL1(pteval_t,
933 pv_mmu_ops.make_pte,
934 val);
935
929 return (pte_t) { .pte = ret }; 936 return (pte_t) { .pte = ret };
930} 937}
931 938
939static inline pteval_t pte_val(pte_t pte)
940{
941 pteval_t ret;
942
943 if (sizeof(pteval_t) > sizeof(long))
944 ret = PVOP_CALL2(pteval_t, pv_mmu_ops.pte_val,
945 pte.pte, (u64)pte.pte >> 32);
946 else
947 ret = PVOP_CALL1(pteval_t, pv_mmu_ops.pte_val,
948 pte.pte);
949
950 return ret;
951}
952
953#ifdef CONFIG_X86_PAE
932static inline pmd_t __pmd(unsigned long long val) 954static inline pmd_t __pmd(unsigned long long val)
933{ 955{
934 return (pmd_t) { PVOP_CALL2(unsigned long long, pv_mmu_ops.make_pmd, 956 return (pmd_t) { PVOP_CALL2(unsigned long long, pv_mmu_ops.make_pmd,
@@ -941,12 +963,6 @@ static inline pgd_t __pgd(unsigned long long val)
941 val, val >> 32) }; 963 val, val >> 32) };
942} 964}
943 965
944static inline unsigned long long pte_val(pte_t x)
945{
946 return PVOP_CALL2(unsigned long long, pv_mmu_ops.pte_val,
947 x.pte_low, x.pte_high);
948}
949
950static inline unsigned long long pmd_val(pmd_t x) 966static inline unsigned long long pmd_val(pmd_t x)
951{ 967{
952 return PVOP_CALL2(unsigned long long, pv_mmu_ops.pmd_val, 968 return PVOP_CALL2(unsigned long long, pv_mmu_ops.pmd_val,
@@ -1008,21 +1024,11 @@ static inline void pmd_clear(pmd_t *pmdp)
1008 1024
1009#else /* !CONFIG_X86_PAE */ 1025#else /* !CONFIG_X86_PAE */
1010 1026
1011static inline pte_t __pte(unsigned long val)
1012{
1013 return (pte_t) { PVOP_CALL1(unsigned long, pv_mmu_ops.make_pte, val) };
1014}
1015
1016static inline pgd_t __pgd(unsigned long val) 1027static inline pgd_t __pgd(unsigned long val)
1017{ 1028{
1018 return (pgd_t) { PVOP_CALL1(unsigned long, pv_mmu_ops.make_pgd, val) }; 1029 return (pgd_t) { PVOP_CALL1(unsigned long, pv_mmu_ops.make_pgd, val) };
1019} 1030}
1020 1031
1021static inline unsigned long pte_val(pte_t x)
1022{
1023 return PVOP_CALL1(unsigned long, pv_mmu_ops.pte_val, x.pte_low);
1024}
1025
1026static inline unsigned long pgd_val(pgd_t x) 1032static inline unsigned long pgd_val(pgd_t x)
1027{ 1033{
1028 return PVOP_CALL1(unsigned long, pv_mmu_ops.pgd_val, x.pgd); 1034 return PVOP_CALL1(unsigned long, pv_mmu_ops.pgd_val, x.pgd);