hw/timer: Add value matching support to aspeed_timer
[qemu/ar7.git] / include / qemu / event_notifier.h
blobe326990db405d752c68d77a5afd1bd65b544a2c7
1 /*
2 * event notifier support
4 * Copyright Red Hat, Inc. 2010
6 * Authors:
7 * Michael S. Tsirkin <mst@redhat.com>
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.
13 #ifndef QEMU_EVENT_NOTIFIER_H
14 #define QEMU_EVENT_NOTIFIER_H
16 #include "qemu-common.h"
18 #ifdef _WIN32
19 #include <windows.h>
20 #endif
22 struct EventNotifier {
23 #ifdef _WIN32
24 HANDLE event;
25 #else
26 int rfd;
27 int wfd;
28 #endif
31 typedef void EventNotifierHandler(EventNotifier *);
33 int event_notifier_init(EventNotifier *, int active);
34 void event_notifier_cleanup(EventNotifier *);
35 int event_notifier_set(EventNotifier *);
36 int event_notifier_test_and_clear(EventNotifier *);
37 int event_notifier_set_handler(EventNotifier *,
38 bool is_external,
39 EventNotifierHandler *);
41 #ifdef CONFIG_POSIX
42 void event_notifier_init_fd(EventNotifier *, int fd);
43 int event_notifier_get_fd(const EventNotifier *);
44 #else
45 HANDLE event_notifier_get_handle(EventNotifier *);
46 #endif
48 #endif