aboutsummaryrefslogtreecommitdiff
path: root/kqemu.c
diff options
context:
space:
mode:
Diffstat (limited to 'kqemu.c')
-rw-r--r--kqemu.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/kqemu.c b/kqemu.c
index 94792c09f9..70cfe2879c 100644
--- a/kqemu.c
+++ b/kqemu.c
@@ -596,11 +596,14 @@ int kqemu_cpu_exec(CPUState *env)
}
#ifdef _WIN32
- DeviceIoControl(kqemu_fd, KQEMU_EXEC,
- kenv, sizeof(struct kqemu_cpu_state),
- kenv, sizeof(struct kqemu_cpu_state),
- &temp, NULL);
- ret = kenv->retval;
+ if (DeviceIoControl(kqemu_fd, KQEMU_EXEC,
+ kenv, sizeof(struct kqemu_cpu_state),
+ kenv, sizeof(struct kqemu_cpu_state),
+ &temp, NULL)) {
+ ret = kenv->retval;
+ } else {
+ ret = -1;
+ }
#else
#if KQEMU_VERSION >= 0x010100
ioctl(kqemu_fd, KQEMU_EXEC, kenv);
@@ -737,4 +740,13 @@ int kqemu_cpu_exec(CPUState *env)
return 0;
}
+void kqemu_cpu_interrupt(CPUState *env)
+{
+#if defined(_WIN32) && KQEMU_VERSION >= 0x010101
+ /* cancelling the I/O request causes KQEMU to finish executing the
+ current block and successfully returning. */
+ CancelIo(kqemu_fd);
+#endif
+}
+
#endif