]>
Commit | Line | Data |
---|---|---|
6b620ca3 PB |
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 | ||
2292b339 MT |
13 | #ifndef QEMU_EVENT_NOTIFIER_H |
14 | #define QEMU_EVENT_NOTIFIER_H | |
15 | ||
2292b339 | 16 | |
fc97a652 PB |
17 | #ifdef _WIN32 |
18 | #include <windows.h> | |
19 | #endif | |
20 | ||
2292b339 | 21 | struct EventNotifier { |
fc97a652 PB |
22 | #ifdef _WIN32 |
23 | HANDLE event; | |
24 | #else | |
d0cc2fbf PB |
25 | int rfd; |
26 | int wfd; | |
e34e47eb | 27 | bool initialized; |
fc97a652 | 28 | #endif |
2292b339 MT |
29 | }; |
30 | ||
6bf819f0 PB |
31 | typedef void EventNotifierHandler(EventNotifier *); |
32 | ||
2292b339 MT |
33 | int event_notifier_init(EventNotifier *, int active); |
34 | void event_notifier_cleanup(EventNotifier *); | |
2ec10b95 | 35 | int event_notifier_set(EventNotifier *); |
2292b339 | 36 | int event_notifier_test_and_clear(EventNotifier *); |
2292b339 | 37 | |
fc97a652 PB |
38 | #ifdef CONFIG_POSIX |
39 | void event_notifier_init_fd(EventNotifier *, int fd); | |
12f0b68c | 40 | int event_notifier_get_fd(const EventNotifier *); |
3bcf0fb3 | 41 | int event_notifier_get_wfd(const EventNotifier *); |
fc97a652 PB |
42 | #else |
43 | HANDLE event_notifier_get_handle(EventNotifier *); | |
44 | #endif | |
45 | ||
2292b339 | 46 | #endif |