X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-i386%2Fmach-xen%2Fasm%2Fhypercall.h;fp=include%2Fasm-i386%2Fmach-xen%2Fasm%2Fhypercall.h;h=2e6d1fa59693039abbd58e2cbb68344752fa0b47;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hp=7de10137f1e6bb973d67f9c3d856da7079b45684;hpb=4e76c8a9fa413ccc09d3f7f664183dcce3555d57;p=linux-2.6.git diff --git a/include/asm-i386/mach-xen/asm/hypercall.h b/include/asm-i386/mach-xen/asm/hypercall.h index 7de10137f..2e6d1fa59 100644 --- a/include/asm-i386/mach-xen/asm/hypercall.h +++ b/include/asm-i386/mach-xen/asm/hypercall.h @@ -42,11 +42,21 @@ #define __STR(x) #x #define STR(x) __STR(x) +#ifdef CONFIG_XEN +#define HYPERCALL_STR(name) \ + "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)" +#else +#define HYPERCALL_STR(name) \ + "mov hypercall_stubs,%%eax; " \ + "add $("STR(__HYPERVISOR_##name)" * 32),%%eax; " \ + "call *%%eax" +#endif + #define _hypercall0(type, name) \ ({ \ long __res; \ asm volatile ( \ - "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\ + HYPERCALL_STR(name) \ : "=a" (__res) \ : \ : "memory" ); \ @@ -57,7 +67,7 @@ ({ \ long __res, __ign1; \ asm volatile ( \ - "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\ + HYPERCALL_STR(name) \ : "=a" (__res), "=b" (__ign1) \ : "1" ((long)(a1)) \ : "memory" ); \ @@ -68,7 +78,7 @@ ({ \ long __res, __ign1, __ign2; \ asm volatile ( \ - "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\ + HYPERCALL_STR(name) \ : "=a" (__res), "=b" (__ign1), "=c" (__ign2) \ : "1" ((long)(a1)), "2" ((long)(a2)) \ : "memory" ); \ @@ -79,7 +89,7 @@ ({ \ long __res, __ign1, __ign2, __ign3; \ asm volatile ( \ - "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\ + HYPERCALL_STR(name) \ : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \ "=d" (__ign3) \ : "1" ((long)(a1)), "2" ((long)(a2)), \ @@ -92,7 +102,7 @@ ({ \ long __res, __ign1, __ign2, __ign3, __ign4; \ asm volatile ( \ - "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\ + HYPERCALL_STR(name) \ : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \ "=d" (__ign3), "=S" (__ign4) \ : "1" ((long)(a1)), "2" ((long)(a2)), \ @@ -105,7 +115,7 @@ ({ \ long __res, __ign1, __ign2, __ign3, __ign4, __ign5; \ asm volatile ( \ - "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\ + HYPERCALL_STR(name) \ : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \ "=d" (__ign3), "=S" (__ign4), "=D" (__ign5) \ : "1" ((long)(a1)), "2" ((long)(a2)), \ @@ -354,6 +364,13 @@ HYPERVISOR_nmi_op( return _hypercall2(int, nmi_op, op, arg); } +static inline unsigned long +HYPERVISOR_hvm_op( + int op, void *arg) +{ + return _hypercall2(unsigned long, hvm_op, op, arg); +} + static inline int HYPERVISOR_callback_op( int cmd, void *arg)