1 /* 2 * event notifier support 3 * 4 * Copyright Red Hat, Inc. 2010 5 * 6 * Authors: 7 * Michael S. Tsirkin <mst@redhat.com> 8 * 9 * This work is licensed under the terms of the GNU GPL, version 2 or later. 10 * See the COPYING file in the top-level directory. 11 */ 12 13 #ifndef QEMU_EVENT_NOTIFIER_H 14 #define QEMU_EVENT_NOTIFIER_H 15 16 17 #ifdef _WIN32 18 #include <windows.h> 19 #endif 20 21 struct EventNotifier { 22 #ifdef _WIN32 23 HANDLE event; 24 #else 25 int rfd; 26 int wfd; 27 #endif 28 }; 29 30 typedef void EventNotifierHandler(EventNotifier *); 31 32 int event_notifier_init(EventNotifier *, int active); 33 void event_notifier_cleanup(EventNotifier *); 34 int event_notifier_set(EventNotifier *); 35 int event_notifier_test_and_clear(EventNotifier *); 36 37 #ifdef CONFIG_POSIX 38 void event_notifier_init_fd(EventNotifier *, int fd); 39 int event_notifier_get_fd(const EventNotifier *); 40 #else 41 HANDLE event_notifier_get_handle(EventNotifier *); 42 #endif 43 44 #endif 45