aboutsummaryrefslogtreecommitdiffhomepage
path: root/sysdeps
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2021-12-11 22:00:06 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2021-12-11 22:00:06 +0100
commit748c675afbfa0fd717bd84c7a7301d75efabd945 (patch)
tree6f97acfa9068b8dd4bdba0cf1d6e4ce1573fdefb /sysdeps
parent7e19b13aa9e92e411491c2a745a693dcda500926 (diff)
downloadmini-kvm-rs-748c675afbfa0fd717bd84c7a7301d75efabd945.tar.gz
mini-kvm-rs-748c675afbfa0fd717bd84c7a7301d75efabd945.zip
kvm: add structs + constants for guest debugging
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/kvm.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sysdeps/kvm.c b/sysdeps/kvm.c
index f7ff1a4..2be08a9 100644
--- a/sysdeps/kvm.c
+++ b/sysdeps/kvm.c
@@ -47,6 +47,20 @@ int main() {
// param: struct kvm_sregs
// ret : 0 success, -1 error
printf("pub(crate) const KVM_SET_SREGS : u64 = 0x%lx;\n", KVM_SET_SREGS);
+ // param: struct kvm_debugregs
+ // ret : 0 success, -1 error
+ printf("pub(crate) const KVM_GET_DEBUGREGS : u64 = 0x%lx;\n", KVM_GET_DEBUGREGS);
+ // param: struct kvm_debugregs
+ // ret : 0 success, -1 error
+ printf("pub(crate) const KVM_SET_DEBUGREGS : u64 = 0x%lx;\n", KVM_SET_DEBUGREGS);
+ // param: struct kvm_guest_debug
+ // ret : 0 success, -1 error
+ printf("pub(crate) const KVM_SET_GUEST_DEBUG : u64 = 0x%lx;\n", KVM_SET_GUEST_DEBUG);
+
+ /* struct kvm_guest_debug constants */
+
+ printf("pub(crate) const KVM_GUESTDBG_ENABLE : u32 = 0x%x;\n", KVM_GUESTDBG_ENABLE);
+ printf("pub(crate) const KVM_GUESTDBG_SINGLESTEP : u32 = 0x%x;\n", KVM_GUESTDBG_SINGLESTEP);
/* struct kvm_run constants */
@@ -55,6 +69,7 @@ int main() {
printf("pub(crate) const KVM_EXIT_IO_IN : u64 = 0x%x;\n", KVM_EXIT_IO_IN);
printf("pub(crate) const KVM_EXIT_IO_OUT : u64 = 0x%x;\n", KVM_EXIT_IO_OUT);
printf("pub(crate) const KVM_EXIT_MMIO : u64 = 0x%x;\n", KVM_EXIT_MMIO);
+ printf("pub(crate) const KVM_EXIT_DEBUG : u64 = 0x%x;\n", KVM_EXIT_DEBUG);
/* Capabilities */
@@ -99,7 +114,14 @@ int main() {
printf("#[cfg(test)] const TEST_KVM_RUN_ALIGN : usize = %ld;\n", alignof(struct kvm_run));
printf("#[cfg(test)] const TEST_KVM_RUN_IO_SIZE : usize = %ld;\n", sizeof(((struct kvm_run*)0)->io));
printf("#[cfg(test)] const TEST_KVM_RUN_MMIO_SIZE : usize = %ld;\n", sizeof(((struct kvm_run*)0)->mmio));
+ printf("#[cfg(test)] const TEST_KVM_RUN_DEBUG_SIZE : usize = %ld;\n", sizeof(((struct kvm_run*)0)->debug));
printf("#[cfg(test)] const TEST_KVM_RUN_UNION_S_SIZE : usize = %ld;\n", sizeof(((struct kvm_run*)0)->s));
+ printf("#[cfg(test)] const TEST_KVM_DEBUGREGS_SIZE: usize = %ld;\n", sizeof(struct kvm_debugregs));
+ printf("#[cfg(test)] const TEST_KVM_DEBUGREGS_ALIGN: usize = %ld;\n", alignof(struct kvm_debugregs));
+ printf("#[cfg(test)] const TEST_KVM_GUEST_DEBUG_SIZE: usize = %ld;\n", sizeof(struct kvm_guest_debug));
+ printf("#[cfg(test)] const TEST_KVM_GUEST_DEBUG_ALIGN: usize = %ld;\n", alignof(struct kvm_guest_debug));
+ printf("#[cfg(test)] const TEST_KVM_GUEST_DEBUG_ARCH_SIZE: usize = %ld;\n", sizeof(struct kvm_guest_debug_arch));
+ printf("#[cfg(test)] const TEST_KVM_GUEST_DEBUG_ARCH_ALIGN: usize = %ld;\n", alignof(struct kvm_guest_debug_arch));
return 0;
}