repo.or.cz
/
kvm-userspace.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
kvm: testsuite: add hypercall test
[kvm-userspace.git]
/
user
/
test
/
x86
/
hypercall.c
blob
1a51b6daaba0aeac9720b54126e99beaa390a768
1
#include
"printf.h"
2
3
#define KVM_HYPERCALL
".byte 0x0f,0x01,0xc1"
4
5
static
inline
long
kvm_hypercall0
(
unsigned int
nr
)
6
{
7
long
ret
;
8
asm
volatile
(
KVM_HYPERCALL
9
:
"=a"
(
ret
)
10
:
"a"
(
nr
));
11
return
ret
;
12
}
13
14
int
main
(
int
ac
,
char
**
av
)
15
{
16
kvm_hypercall0
(-
1u
);
17
printf
(
"Hypercall: OK
\n
"
);
18
return
0
;
19
}