kvm: testsuite: add hypercall test
[kvm-userspace.git] / user / test / x86 / hypercall.c
blob1a51b6daaba0aeac9720b54126e99beaa390a768
1 #include "printf.h"
3 #define KVM_HYPERCALL ".byte 0x0f,0x01,0xc1"
5 static inline long kvm_hypercall0(unsigned int nr)
7 long ret;
8 asm volatile(KVM_HYPERCALL
9 : "=a"(ret)
10 : "a"(nr));
11 return ret;
14 int main(int ac, char **av)
16 kvm_hypercall0(-1u);
17 printf("Hypercall: OK\n");
18 return 0;