kqemu_cpu_interrupt support for win32 (Filip Navara)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1566 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
bellard 2005-09-03 17:55:47 +00:00
parent ca0d1734b4
commit a332e112b7
3 changed files with 21 additions and 5 deletions

View File

@ -611,6 +611,7 @@ int kqemu_cpu_exec(CPUState *env);
void kqemu_flush_page(CPUState *env, target_ulong addr); void kqemu_flush_page(CPUState *env, target_ulong addr);
void kqemu_flush(CPUState *env, int global); void kqemu_flush(CPUState *env, int global);
void kqemu_set_notdirty(CPUState *env, ram_addr_t ram_addr); 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) static inline int kqemu_is_ok(CPUState *env)
{ {

22
kqemu.c
View File

@ -596,11 +596,14 @@ int kqemu_cpu_exec(CPUState *env)
} }
#ifdef _WIN32 #ifdef _WIN32
DeviceIoControl(kqemu_fd, KQEMU_EXEC, if (DeviceIoControl(kqemu_fd, KQEMU_EXEC,
kenv, sizeof(struct kqemu_cpu_state), kenv, sizeof(struct kqemu_cpu_state),
kenv, sizeof(struct kqemu_cpu_state), kenv, sizeof(struct kqemu_cpu_state),
&temp, NULL); &temp, NULL)) {
ret = kenv->retval; ret = kenv->retval;
} else {
ret = -1;
}
#else #else
#if KQEMU_VERSION >= 0x010100 #if KQEMU_VERSION >= 0x010100
ioctl(kqemu_fd, KQEMU_EXEC, kenv); ioctl(kqemu_fd, KQEMU_EXEC, kenv);
@ -737,4 +740,13 @@ int kqemu_cpu_exec(CPUState *env)
return 0; 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 #endif

3
vl.c
View File

@ -875,6 +875,9 @@ static void host_alarm_handler(int host_signum)
qemu_get_clock(rt_clock))) { qemu_get_clock(rt_clock))) {
/* stop the cpu because a timer occured */ /* stop the cpu because a timer occured */
cpu_interrupt(global_env, CPU_INTERRUPT_EXIT); cpu_interrupt(global_env, CPU_INTERRUPT_EXIT);
#ifdef USE_KQEMU
kqemu_cpu_interrupt(global_env);
#endif
} }
} }