2024-07-21 15:46:26 +00:00
|
|
|
// This file contains KVM wrappers for Rust side. The reason we need these wrappers is because the
|
|
|
|
// KVM ioctls is not available in the libc binding.
|
|
|
|
#include "core.h"
|
2024-03-16 10:23:34 +00:00
|
|
|
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
|
|
|
#include <errno.h>
|
2024-03-16 15:59:19 +00:00
|
|
|
#include <stddef.h>
|
2024-03-24 09:31:52 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
2024-03-16 10:23:34 +00:00
|
|
|
|
2024-09-24 19:08:04 +00:00
|
|
|
#ifdef __x86_64__
|
2024-07-27 14:17:32 +00:00
|
|
|
extern "C" int kvm_set_sregs(int vcpu, const kvm_sregs *regs)
|
|
|
|
{
|
|
|
|
return ioctl(vcpu, KVM_SET_SREGS, regs);
|
|
|
|
}
|
2024-08-17 18:16:48 +00:00
|
|
|
|
|
|
|
extern "C" int kvm_translate(int vcpu, kvm_translation *arg) {
|
|
|
|
return ioctl(vcpu, KVM_TRANSLATE, arg);
|
|
|
|
}
|
2024-09-24 19:08:04 +00:00
|
|
|
#endif
|