|
@@ -1722,56 +1722,6 @@ void qemu_system_powerdown_request(void)
|
|
qemu_notify_event();
|
|
qemu_notify_event();
|
|
}
|
|
}
|
|
|
|
|
|
-#ifdef _WIN32
|
|
|
|
-static void host_main_loop_wait(int *timeout)
|
|
|
|
-{
|
|
|
|
- int ret, ret2, i;
|
|
|
|
- PollingEntry *pe;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /* XXX: need to suppress polling by better using win32 events */
|
|
|
|
- ret = 0;
|
|
|
|
- for(pe = first_polling_entry; pe != NULL; pe = pe->next) {
|
|
|
|
- ret |= pe->func(pe->opaque);
|
|
|
|
- }
|
|
|
|
- if (ret == 0) {
|
|
|
|
- int err;
|
|
|
|
- WaitObjects *w = &wait_objects;
|
|
|
|
-
|
|
|
|
- ret = WaitForMultipleObjects(w->num, w->events, FALSE, *timeout);
|
|
|
|
- if (WAIT_OBJECT_0 + 0 <= ret && ret <= WAIT_OBJECT_0 + w->num - 1) {
|
|
|
|
- if (w->func[ret - WAIT_OBJECT_0])
|
|
|
|
- w->func[ret - WAIT_OBJECT_0](w->opaque[ret - WAIT_OBJECT_0]);
|
|
|
|
-
|
|
|
|
- /* Check for additional signaled events */
|
|
|
|
- for(i = (ret - WAIT_OBJECT_0 + 1); i < w->num; i++) {
|
|
|
|
-
|
|
|
|
- /* Check if event is signaled */
|
|
|
|
- ret2 = WaitForSingleObject(w->events[i], 0);
|
|
|
|
- if(ret2 == WAIT_OBJECT_0) {
|
|
|
|
- if (w->func[i])
|
|
|
|
- w->func[i](w->opaque[i]);
|
|
|
|
- } else if (ret2 == WAIT_TIMEOUT) {
|
|
|
|
- } else {
|
|
|
|
- err = GetLastError();
|
|
|
|
- fprintf(stderr, "WaitForSingleObject error %d %d\n", i, err);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } else if (ret == WAIT_TIMEOUT) {
|
|
|
|
- } else {
|
|
|
|
- err = GetLastError();
|
|
|
|
- fprintf(stderr, "WaitForMultipleObjects error %d %d\n", ret, err);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- *timeout = 0;
|
|
|
|
-}
|
|
|
|
-#else
|
|
|
|
-static void host_main_loop_wait(int *timeout)
|
|
|
|
-{
|
|
|
|
-}
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
void main_loop_wait(int nonblocking)
|
|
void main_loop_wait(int nonblocking)
|
|
{
|
|
{
|
|
IOHandlerRecord *ioh;
|
|
IOHandlerRecord *ioh;
|
|
@@ -1787,7 +1737,7 @@ void main_loop_wait(int nonblocking)
|
|
qemu_bh_update_timeout(&timeout);
|
|
qemu_bh_update_timeout(&timeout);
|
|
}
|
|
}
|
|
|
|
|
|
- host_main_loop_wait(&timeout);
|
|
|
|
|
|
+ os_host_main_loop_wait(&timeout);
|
|
|
|
|
|
/* poll any events */
|
|
/* poll any events */
|
|
/* XXX: separate device handlers from system ones */
|
|
/* XXX: separate device handlers from system ones */
|