X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-x86_64%2Fmach-xen%2Fasm%2Fhypercall.h;h=14fb01d3d27e02b5bf35d90374094257bf2e46fd;hb=9469da84ff1f08fd99962704fefafac9d844adc5;hp=1bcc7901eaaccc7562ee166d3ae5459eff45efc1;hpb=c98d03330787f1dc06830afdd53eed75228d76b6;p=linux-2.6.git diff --git a/include/asm-x86_64/mach-xen/asm/hypercall.h b/include/asm-x86_64/mach-xen/asm/hypercall.h index 1bcc7901e..14fb01d3d 100644 --- a/include/asm-x86_64/mach-xen/asm/hypercall.h +++ b/include/asm-x86_64/mach-xen/asm/hypercall.h @@ -46,11 +46,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,%%rax; " \ + "add $("STR(__HYPERVISOR_##name)" * 32),%%rax; " \ + "call *%%rax" +#endif + #define _hypercall0(type, name) \ ({ \ long __res; \ asm volatile ( \ - "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\ + HYPERCALL_STR(name) \ : "=a" (__res) \ : \ : "memory" ); \ @@ -61,7 +71,7 @@ ({ \ long __res, __ign1; \ asm volatile ( \ - "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\ + HYPERCALL_STR(name) \ : "=a" (__res), "=D" (__ign1) \ : "1" ((long)(a1)) \ : "memory" ); \ @@ -72,7 +82,7 @@ ({ \ long __res, __ign1, __ign2; \ asm volatile ( \ - "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\ + HYPERCALL_STR(name) \ : "=a" (__res), "=D" (__ign1), "=S" (__ign2) \ : "1" ((long)(a1)), "2" ((long)(a2)) \ : "memory" ); \ @@ -83,7 +93,7 @@ ({ \ long __res, __ign1, __ign2, __ign3; \ asm volatile ( \ - "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\ + HYPERCALL_STR(name) \ : "=a" (__res), "=D" (__ign1), "=S" (__ign2), \ "=d" (__ign3) \ : "1" ((long)(a1)), "2" ((long)(a2)), \ @@ -97,7 +107,7 @@ long __res, __ign1, __ign2, __ign3; \ asm volatile ( \ "movq %7,%%r10; " \ - "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\ + HYPERCALL_STR(name) \ : "=a" (__res), "=D" (__ign1), "=S" (__ign2), \ "=d" (__ign3) \ : "1" ((long)(a1)), "2" ((long)(a2)), \ @@ -111,7 +121,7 @@ long __res, __ign1, __ign2, __ign3; \ asm volatile ( \ "movq %7,%%r10; movq %8,%%r8; " \ - "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"\ + HYPERCALL_STR(name) \ : "=a" (__res), "=D" (__ign1), "=S" (__ign2), \ "=d" (__ign3) \ : "1" ((long)(a1)), "2" ((long)(a2)), \ @@ -355,6 +365,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)