--- /dev/null
+#include "kvm/kvm.h"
+
+#include <stdio.h>
+
+static void kvm__emulate_io_out(struct kvm *self, uint16_t port, void *data, int size, uint32_t count)
+{
+ fprintf(stderr, "%s port=%x, size=%d, count=%" PRIu32 "\n", __func__, port, size, count);
+}
+
+static void kvm__emulate_io_in(struct kvm *self, uint16_t port, void *data, int size, uint32_t count)
+{
+ fprintf(stderr, "%s port=%x, size=%d, count=%" PRIu32 "\n", __func__, port, size, count);
+}
+
+void kvm__emulate_io(struct kvm *self, uint16_t port, void *data, int direction, int size, uint32_t count)
+{
+ if (direction == KVM_EXIT_IO_IN)
+ kvm__emulate_io_in(self, port, data, size, count);
+ else
+ kvm__emulate_io_out(self, port, data, size, count);
+}
die_perror("KVM_RUN failed");
}
-static void kvm__emulate_io_out(struct kvm *self, uint16_t port, void *data, int size, uint32_t count)
-{
- fprintf(stderr, "%s port=%x, size=%d, count=%" PRIu32 "\n", __func__, port, size, count);
-}
-
-static void kvm__emulate_io_in(struct kvm *self, uint16_t port, void *data, int size, uint32_t count)
-{
- fprintf(stderr, "%s port=%x, size=%d, count=%" PRIu32 "\n", __func__, port, size, count);
-}
-
-void kvm__emulate_io(struct kvm *self, uint16_t port, void *data, int direction, int size, uint32_t count)
-{
- if (direction == KVM_EXIT_IO_IN)
- kvm__emulate_io_in(self, port, data, size, count);
- else
- kvm__emulate_io_out(self, port, data, size, count);
-}
-
static void print_segment(const char *name, struct kvm_segment *seg)
{
printf(" %s %04" PRIx16 " %016" PRIx64 " %08" PRIx32 " %02" PRIx8 " %x %x %x %x %x %x %x\n",