#include <stddef.h>
#include <stdlib.h>
#include <libvhcall.h>
#include <stdio.h>
int main() {
int ret=1;
int64_t symid;
vhcall_handle handle;
uint64_t retval = -1;
uint64_t data = 0xdeadbeefbaadcafe;
if (handle == (vhcall_handle)-1) {
perror("vhcall_install");
goto ret;
}
if (symid == -1 ) {
perror("vhcall_find");
goto ret2;
}
if (!ca) {
perror("vhcall_args_alloc");
goto ret2;
}
printf("[VE] addr:%p, data:%lx\n", &data, data);
if (ret) {
perror("vhcall_args_set_veoshandle");
goto ret3;
}
if (ret) {
perror("vhcall_args_set_u64");
goto ret3;
}
if (ret) {
perror("vhcall_invoke_with_args");
goto ret3;
}
if (retval) {
printf("VH function returns unexpected value(%ld)\n", retval);
goto ret3;
}
printf("[VE] addr:%p, data:%lx\n", &data, data);
ret = 0;
ret3:
ret2:
perror("vhcall_uninstall");
ret:
return ret;
}