#include <assert.h>
#include <limits.h>
+#include <stdlib.h>
#include <stdio.h>
static uint8_t ioport_to_uint8(void *data)
.io_out = cmos_ram_rtc_io_out,
};
+static bool debug_io_out(struct kvm *self, uint16_t port, void *data, int size, uint32_t count)
+{
+ exit(EXIT_SUCCESS);
+}
+
+static struct ioport_operations debug_ops = {
+ .io_out = debug_io_out,
+};
+
static bool dummy_io_in(struct kvm *self, uint16_t port, void *data, int size, uint32_t count)
{
return true;
[0x00A0] = &dummy_read_write_ioport_ops,
[0x00A1] = &dummy_read_write_ioport_ops,
+ /* PORT 00E0-00EF are 'motherboard specific' so we use them for our
+ internal debugging purposes. */
+ [0x00E0] = &debug_ops,
+
/* PORT 00ED - DUMMY PORT FOR DELAY??? */
[0x00ED] = &dummy_write_only_ioport_ops,
#include <string.h>
#include <stdio.h>
-unsigned int dbgtest_mode;
-
static void usage(char *argv[])
{
- fprintf(stderr, " usage: %s [--dbgtest] [--single-step] [--kernel=]<kernel-image>\n",
+ fprintf(stderr, " usage: %s [--single-step] [--kernel=]<kernel-image>\n",
argv[0]);
exit(1);
}
} else if (option_matches(argv[i], "--params=")) {
kernel_cmdline = &argv[i][9];
continue;
- } else if (option_matches(argv[i], "--dbgtest")) {
- dbgtest_mode = 1;
- continue;
} else if (option_matches(argv[i], "--single-step")) {
single_step = true;
continue;
exit_kvm:
- if (dbgtest_mode) {
- if (kvm->kvm_run->exit_reason == KVM_EXIT_IO &&
- kvm->kvm_run->io.port == 0xe0)
- fprintf(stderr, "KVM: this is an expected IO error\n");
- goto out;
- }
-
fprintf(stderr, "KVM exit reason: %" PRIu32 " (\"%s\")\n",
kvm->kvm_run->exit_reason, kvm_exit_reasons[kvm->kvm_run->exit_reason]);
if (kvm->kvm_run->exit_reason == KVM_EXIT_UNKNOWN)