Commit a332e112b73d641ca603066e46bb5b05d6c054fc

Authored by bellard
1 parent ca0d1734

kqemu_cpu_interrupt support for win32 (Filip Navara)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1566 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 3 changed files with 21 additions and 5 deletions
exec-all.h
@@ -611,6 +611,7 @@ int kqemu_cpu_exec(CPUState *env); @@ -611,6 +611,7 @@ int kqemu_cpu_exec(CPUState *env);
611 void kqemu_flush_page(CPUState *env, target_ulong addr); 611 void kqemu_flush_page(CPUState *env, target_ulong addr);
612 void kqemu_flush(CPUState *env, int global); 612 void kqemu_flush(CPUState *env, int global);
613 void kqemu_set_notdirty(CPUState *env, ram_addr_t ram_addr); 613 void kqemu_set_notdirty(CPUState *env, ram_addr_t ram_addr);
  614 +void kqemu_cpu_interrupt(CPUState *env);
614 615
615 static inline int kqemu_is_ok(CPUState *env) 616 static inline int kqemu_is_ok(CPUState *env)
616 { 617 {
@@ -596,11 +596,14 @@ int kqemu_cpu_exec(CPUState *env) @@ -596,11 +596,14 @@ int kqemu_cpu_exec(CPUState *env)
596 } 596 }
597 597
598 #ifdef _WIN32 598 #ifdef _WIN32
599 - DeviceIoControl(kqemu_fd, KQEMU_EXEC,  
600 - kenv, sizeof(struct kqemu_cpu_state),  
601 - kenv, sizeof(struct kqemu_cpu_state),  
602 - &temp, NULL);  
603 - ret = kenv->retval; 599 + if (DeviceIoControl(kqemu_fd, KQEMU_EXEC,
  600 + kenv, sizeof(struct kqemu_cpu_state),
  601 + kenv, sizeof(struct kqemu_cpu_state),
  602 + &temp, NULL)) {
  603 + ret = kenv->retval;
  604 + } else {
  605 + ret = -1;
  606 + }
604 #else 607 #else
605 #if KQEMU_VERSION >= 0x010100 608 #if KQEMU_VERSION >= 0x010100
606 ioctl(kqemu_fd, KQEMU_EXEC, kenv); 609 ioctl(kqemu_fd, KQEMU_EXEC, kenv);
@@ -737,4 +740,13 @@ int kqemu_cpu_exec(CPUState *env) @@ -737,4 +740,13 @@ int kqemu_cpu_exec(CPUState *env)
737 return 0; 740 return 0;
738 } 741 }
739 742
  743 +void kqemu_cpu_interrupt(CPUState *env)
  744 +{
  745 +#if defined(_WIN32) && KQEMU_VERSION >= 0x010101
  746 + /* cancelling the I/O request causes KQEMU to finish executing the
  747 + current block and successfully returning. */
  748 + CancelIo(kqemu_fd);
  749 +#endif
  750 +}
  751 +
740 #endif 752 #endif
@@ -875,6 +875,9 @@ static void host_alarm_handler(int host_signum) @@ -875,6 +875,9 @@ static void host_alarm_handler(int host_signum)
875 qemu_get_clock(rt_clock))) { 875 qemu_get_clock(rt_clock))) {
876 /* stop the cpu because a timer occured */ 876 /* stop the cpu because a timer occured */
877 cpu_interrupt(global_env, CPU_INTERRUPT_EXIT); 877 cpu_interrupt(global_env, CPU_INTERRUPT_EXIT);
  878 +#ifdef USE_KQEMU
  879 + kqemu_cpu_interrupt(global_env);
  880 +#endif
878 } 881 }
879 } 882 }
880 883