aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-09-03 17:55:47 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-09-03 17:55:47 +0000
commita332e112b73d641ca603066e46bb5b05d6c054fc (patch)
tree28e05df975d98a2e75af8bc4796ee38aa9d3751c
parentca0d1734b44a67ca0077c3f5714d901f7489559d (diff)
kqemu_cpu_interrupt support for win32 (Filip Navara)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1566 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--exec-all.h1
-rw-r--r--kqemu.c22
-rw-r--r--vl.c3
3 files changed, 21 insertions, 5 deletions
diff --git a/exec-all.h b/exec-all.h
index 33780660fe..045648c062 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -611,6 +611,7 @@ int kqemu_cpu_exec(CPUState *env);
void kqemu_flush_page(CPUState *env, target_ulong addr);
void kqemu_flush(CPUState *env, int global);
void kqemu_set_notdirty(CPUState *env, ram_addr_t ram_addr);
+void kqemu_cpu_interrupt(CPUState *env);
static inline int kqemu_is_ok(CPUState *env)
{
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
diff --git a/vl.c b/vl.c
index 9819916a11..ea46bdc9c1 100644
--- a/vl.c
+++ b/vl.c
@@ -875,6 +875,9 @@ static void host_alarm_handler(int host_signum)
qemu_get_clock(rt_clock))) {
/* stop the cpu because a timer occured */
cpu_interrupt(global_env, CPU_INTERRUPT_EXIT);
+#ifdef USE_KQEMU
+ kqemu_cpu_interrupt(global_env);
+#endif
}
}