Statistics
| Branch: | Revision:

root / main-loop.h @ 31a32289

History | View | Annotate | Download (11.6 kB)

1 44a9b356 Paolo Bonzini
/*
2 44a9b356 Paolo Bonzini
 * QEMU System Emulator
3 44a9b356 Paolo Bonzini
 *
4 44a9b356 Paolo Bonzini
 * Copyright (c) 2003-2008 Fabrice Bellard
5 44a9b356 Paolo Bonzini
 *
6 44a9b356 Paolo Bonzini
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 44a9b356 Paolo Bonzini
 * of this software and associated documentation files (the "Software"), to deal
8 44a9b356 Paolo Bonzini
 * in the Software without restriction, including without limitation the rights
9 44a9b356 Paolo Bonzini
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 44a9b356 Paolo Bonzini
 * copies of the Software, and to permit persons to whom the Software is
11 44a9b356 Paolo Bonzini
 * furnished to do so, subject to the following conditions:
12 44a9b356 Paolo Bonzini
 *
13 44a9b356 Paolo Bonzini
 * The above copyright notice and this permission notice shall be included in
14 44a9b356 Paolo Bonzini
 * all copies or substantial portions of the Software.
15 44a9b356 Paolo Bonzini
 *
16 44a9b356 Paolo Bonzini
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 44a9b356 Paolo Bonzini
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 44a9b356 Paolo Bonzini
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 44a9b356 Paolo Bonzini
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 44a9b356 Paolo Bonzini
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 44a9b356 Paolo Bonzini
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 44a9b356 Paolo Bonzini
 * THE SOFTWARE.
23 44a9b356 Paolo Bonzini
 */
24 44a9b356 Paolo Bonzini
25 44a9b356 Paolo Bonzini
#ifndef QEMU_MAIN_LOOP_H
26 44a9b356 Paolo Bonzini
#define QEMU_MAIN_LOOP_H 1
27 44a9b356 Paolo Bonzini
28 f627aab1 Paolo Bonzini
#include "qemu-aio.h"
29 f627aab1 Paolo Bonzini
30 44a9b356 Paolo Bonzini
#define SIG_IPI SIGUSR1
31 44a9b356 Paolo Bonzini
32 44a9b356 Paolo Bonzini
/**
33 44a9b356 Paolo Bonzini
 * qemu_init_main_loop: Set up the process so that it can run the main loop.
34 44a9b356 Paolo Bonzini
 *
35 44a9b356 Paolo Bonzini
 * This includes setting up signal handlers.  It should be called before
36 44a9b356 Paolo Bonzini
 * any other threads are created.  In addition, threads other than the
37 44a9b356 Paolo Bonzini
 * main one should block signals that are trapped by the main loop.
38 44a9b356 Paolo Bonzini
 * For simplicity, you can consider these signals to be safe: SIGUSR1,
39 44a9b356 Paolo Bonzini
 * SIGUSR2, thread signals (SIGFPE, SIGILL, SIGSEGV, SIGBUS) and real-time
40 44a9b356 Paolo Bonzini
 * signals if available.  Remember that Windows in practice does not have
41 44a9b356 Paolo Bonzini
 * signals, though.
42 d34e8f6e Michael Roth
 *
43 d34e8f6e Michael Roth
 * In the case of QEMU tools, this will also start/initialize timers.
44 44a9b356 Paolo Bonzini
 */
45 44a9b356 Paolo Bonzini
int qemu_init_main_loop(void);
46 44a9b356 Paolo Bonzini
47 44a9b356 Paolo Bonzini
/**
48 44a9b356 Paolo Bonzini
 * main_loop_wait: Run one iteration of the main loop.
49 44a9b356 Paolo Bonzini
 *
50 44a9b356 Paolo Bonzini
 * If @nonblocking is true, poll for events, otherwise suspend until
51 44a9b356 Paolo Bonzini
 * one actually occurs.  The main loop usually consists of a loop that
52 44a9b356 Paolo Bonzini
 * repeatedly calls main_loop_wait(false).
53 44a9b356 Paolo Bonzini
 *
54 44a9b356 Paolo Bonzini
 * Main loop services include file descriptor callbacks, bottom halves
55 44a9b356 Paolo Bonzini
 * and timers (defined in qemu-timer.h).  Bottom halves are similar to timers
56 44a9b356 Paolo Bonzini
 * that execute immediately, but have a lower overhead and scheduling them
57 44a9b356 Paolo Bonzini
 * is wait-free, thread-safe and signal-safe.
58 44a9b356 Paolo Bonzini
 *
59 44a9b356 Paolo Bonzini
 * It is sometimes useful to put a whole program in a coroutine.  In this
60 44a9b356 Paolo Bonzini
 * case, the coroutine actually should be started from within the main loop,
61 44a9b356 Paolo Bonzini
 * so that the main loop can run whenever the coroutine yields.  To do this,
62 44a9b356 Paolo Bonzini
 * you can use a bottom half to enter the coroutine as soon as the main loop
63 44a9b356 Paolo Bonzini
 * starts:
64 44a9b356 Paolo Bonzini
 *
65 44a9b356 Paolo Bonzini
 *     void enter_co_bh(void *opaque) {
66 44a9b356 Paolo Bonzini
 *         QEMUCoroutine *co = opaque;
67 44a9b356 Paolo Bonzini
 *         qemu_coroutine_enter(co, NULL);
68 44a9b356 Paolo Bonzini
 *     }
69 44a9b356 Paolo Bonzini
 *
70 44a9b356 Paolo Bonzini
 *     ...
71 44a9b356 Paolo Bonzini
 *     QEMUCoroutine *co = qemu_coroutine_create(coroutine_entry);
72 44a9b356 Paolo Bonzini
 *     QEMUBH *start_bh = qemu_bh_new(enter_co_bh, co);
73 44a9b356 Paolo Bonzini
 *     qemu_bh_schedule(start_bh);
74 44a9b356 Paolo Bonzini
 *     while (...) {
75 44a9b356 Paolo Bonzini
 *         main_loop_wait(false);
76 44a9b356 Paolo Bonzini
 *     }
77 44a9b356 Paolo Bonzini
 *
78 44a9b356 Paolo Bonzini
 * (In the future we may provide a wrapper for this).
79 44a9b356 Paolo Bonzini
 *
80 44a9b356 Paolo Bonzini
 * @nonblocking: Whether the caller should block until an event occurs.
81 44a9b356 Paolo Bonzini
 */
82 44a9b356 Paolo Bonzini
int main_loop_wait(int nonblocking);
83 44a9b356 Paolo Bonzini
84 44a9b356 Paolo Bonzini
/**
85 44a9b356 Paolo Bonzini
 * qemu_notify_event: Force processing of pending events.
86 44a9b356 Paolo Bonzini
 *
87 44a9b356 Paolo Bonzini
 * Similar to signaling a condition variable, qemu_notify_event forces
88 44a9b356 Paolo Bonzini
 * main_loop_wait to look at pending events and exit.  The caller of
89 44a9b356 Paolo Bonzini
 * main_loop_wait will usually call it again very soon, so qemu_notify_event
90 44a9b356 Paolo Bonzini
 * also has the side effect of recalculating the sets of file descriptors
91 44a9b356 Paolo Bonzini
 * that the main loop waits for.
92 44a9b356 Paolo Bonzini
 *
93 44a9b356 Paolo Bonzini
 * Calling qemu_notify_event is rarely necessary, because main loop
94 44a9b356 Paolo Bonzini
 * services (bottom halves and timers) call it themselves.  One notable
95 44a9b356 Paolo Bonzini
 * exception occurs when using qemu_set_fd_handler2 (see below).
96 44a9b356 Paolo Bonzini
 */
97 44a9b356 Paolo Bonzini
void qemu_notify_event(void);
98 44a9b356 Paolo Bonzini
99 44a9b356 Paolo Bonzini
#ifdef _WIN32
100 44a9b356 Paolo Bonzini
/* return TRUE if no sleep should be done afterwards */
101 44a9b356 Paolo Bonzini
typedef int PollingFunc(void *opaque);
102 44a9b356 Paolo Bonzini
103 44a9b356 Paolo Bonzini
/**
104 44a9b356 Paolo Bonzini
 * qemu_add_polling_cb: Register a Windows-specific polling callback
105 44a9b356 Paolo Bonzini
 *
106 44a9b356 Paolo Bonzini
 * Currently, under Windows some events are polled rather than waited for.
107 44a9b356 Paolo Bonzini
 * Polling callbacks do not ensure that @func is called timely, because
108 44a9b356 Paolo Bonzini
 * the main loop might wait for an arbitrarily long time.  If possible,
109 44a9b356 Paolo Bonzini
 * you should instead create a separate thread that does a blocking poll
110 44a9b356 Paolo Bonzini
 * and set a Win32 event object.  The event can then be passed to
111 44a9b356 Paolo Bonzini
 * qemu_add_wait_object.
112 44a9b356 Paolo Bonzini
 *
113 44a9b356 Paolo Bonzini
 * Polling callbacks really have nothing Windows specific in them, but
114 07f35073 Dong Xu Wang
 * as they are a hack and are currently not necessary under POSIX systems,
115 44a9b356 Paolo Bonzini
 * they are only available when QEMU is running under Windows.
116 44a9b356 Paolo Bonzini
 *
117 44a9b356 Paolo Bonzini
 * @func: The function that does the polling, and returns 1 to force
118 44a9b356 Paolo Bonzini
 * immediate completion of main_loop_wait.
119 44a9b356 Paolo Bonzini
 * @opaque: A pointer-size value that is passed to @func.
120 44a9b356 Paolo Bonzini
 */
121 44a9b356 Paolo Bonzini
int qemu_add_polling_cb(PollingFunc *func, void *opaque);
122 44a9b356 Paolo Bonzini
123 44a9b356 Paolo Bonzini
/**
124 44a9b356 Paolo Bonzini
 * qemu_del_polling_cb: Unregister a Windows-specific polling callback
125 44a9b356 Paolo Bonzini
 *
126 44a9b356 Paolo Bonzini
 * This function removes a callback that was registered with
127 44a9b356 Paolo Bonzini
 * qemu_add_polling_cb.
128 44a9b356 Paolo Bonzini
 *
129 44a9b356 Paolo Bonzini
 * @func: The function that was passed to qemu_add_polling_cb.
130 44a9b356 Paolo Bonzini
 * @opaque: A pointer-size value that was passed to qemu_add_polling_cb.
131 44a9b356 Paolo Bonzini
 */
132 44a9b356 Paolo Bonzini
void qemu_del_polling_cb(PollingFunc *func, void *opaque);
133 44a9b356 Paolo Bonzini
134 44a9b356 Paolo Bonzini
/* Wait objects handling */
135 44a9b356 Paolo Bonzini
typedef void WaitObjectFunc(void *opaque);
136 44a9b356 Paolo Bonzini
137 44a9b356 Paolo Bonzini
/**
138 44a9b356 Paolo Bonzini
 * qemu_add_wait_object: Register a callback for a Windows handle
139 44a9b356 Paolo Bonzini
 *
140 44a9b356 Paolo Bonzini
 * Under Windows, the iohandler mechanism can only be used with sockets.
141 44a9b356 Paolo Bonzini
 * QEMU must use the WaitForMultipleObjects API to wait on other handles.
142 44a9b356 Paolo Bonzini
 * This function registers a #HANDLE with QEMU, so that it will be included
143 44a9b356 Paolo Bonzini
 * in the main loop's calls to WaitForMultipleObjects.  When the handle
144 44a9b356 Paolo Bonzini
 * is in a signaled state, QEMU will call @func.
145 44a9b356 Paolo Bonzini
 *
146 44a9b356 Paolo Bonzini
 * @handle: The Windows handle to be observed.
147 44a9b356 Paolo Bonzini
 * @func: A function to be called when @handle is in a signaled state.
148 44a9b356 Paolo Bonzini
 * @opaque: A pointer-size value that is passed to @func.
149 44a9b356 Paolo Bonzini
 */
150 44a9b356 Paolo Bonzini
int qemu_add_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);
151 44a9b356 Paolo Bonzini
152 44a9b356 Paolo Bonzini
/**
153 44a9b356 Paolo Bonzini
 * qemu_del_wait_object: Unregister a callback for a Windows handle
154 44a9b356 Paolo Bonzini
 *
155 44a9b356 Paolo Bonzini
 * This function removes a callback that was registered with
156 44a9b356 Paolo Bonzini
 * qemu_add_wait_object.
157 44a9b356 Paolo Bonzini
 *
158 44a9b356 Paolo Bonzini
 * @func: The function that was passed to qemu_add_wait_object.
159 44a9b356 Paolo Bonzini
 * @opaque: A pointer-size value that was passed to qemu_add_wait_object.
160 44a9b356 Paolo Bonzini
 */
161 44a9b356 Paolo Bonzini
void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);
162 44a9b356 Paolo Bonzini
#endif
163 44a9b356 Paolo Bonzini
164 44a9b356 Paolo Bonzini
/* async I/O support */
165 44a9b356 Paolo Bonzini
166 44a9b356 Paolo Bonzini
typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size);
167 44a9b356 Paolo Bonzini
typedef int IOCanReadHandler(void *opaque);
168 44a9b356 Paolo Bonzini
169 44a9b356 Paolo Bonzini
/**
170 44a9b356 Paolo Bonzini
 * qemu_set_fd_handler2: Register a file descriptor with the main loop
171 44a9b356 Paolo Bonzini
 *
172 44a9b356 Paolo Bonzini
 * This function tells the main loop to wake up whenever one of the
173 44a9b356 Paolo Bonzini
 * following conditions is true:
174 44a9b356 Paolo Bonzini
 *
175 44a9b356 Paolo Bonzini
 * 1) if @fd_write is not %NULL, when the file descriptor is writable;
176 44a9b356 Paolo Bonzini
 *
177 44a9b356 Paolo Bonzini
 * 2) if @fd_read is not %NULL, when the file descriptor is readable.
178 44a9b356 Paolo Bonzini
 *
179 44a9b356 Paolo Bonzini
 * @fd_read_poll can be used to disable the @fd_read callback temporarily.
180 44a9b356 Paolo Bonzini
 * This is useful to avoid calling qemu_set_fd_handler2 every time the
181 44a9b356 Paolo Bonzini
 * client becomes interested in reading (or dually, stops being interested).
182 44a9b356 Paolo Bonzini
 * A typical example is when @fd is a listening socket and you want to bound
183 44a9b356 Paolo Bonzini
 * the number of active clients.  Remember to call qemu_notify_event whenever
184 44a9b356 Paolo Bonzini
 * the condition may change from %false to %true.
185 44a9b356 Paolo Bonzini
 *
186 44a9b356 Paolo Bonzini
 * The callbacks that are set up by qemu_set_fd_handler2 are level-triggered.
187 44a9b356 Paolo Bonzini
 * If @fd_read does not read from @fd, or @fd_write does not write to @fd
188 44a9b356 Paolo Bonzini
 * until its buffers are full, they will be called again on the next
189 44a9b356 Paolo Bonzini
 * iteration.
190 44a9b356 Paolo Bonzini
 *
191 44a9b356 Paolo Bonzini
 * @fd: The file descriptor to be observed.  Under Windows it must be
192 44a9b356 Paolo Bonzini
 * a #SOCKET.
193 44a9b356 Paolo Bonzini
 *
194 44a9b356 Paolo Bonzini
 * @fd_read_poll: A function that returns 1 if the @fd_read callback
195 44a9b356 Paolo Bonzini
 * should be fired.  If the function returns 0, the main loop will not
196 44a9b356 Paolo Bonzini
 * end its iteration even if @fd becomes readable.
197 44a9b356 Paolo Bonzini
 *
198 44a9b356 Paolo Bonzini
 * @fd_read: A level-triggered callback that is fired if @fd is readable
199 44a9b356 Paolo Bonzini
 * at the beginning of a main loop iteration, or if it becomes readable
200 44a9b356 Paolo Bonzini
 * during one.
201 44a9b356 Paolo Bonzini
 *
202 44a9b356 Paolo Bonzini
 * @fd_write: A level-triggered callback that is fired when @fd is writable
203 44a9b356 Paolo Bonzini
 * at the beginning of a main loop iteration, or if it becomes writable
204 44a9b356 Paolo Bonzini
 * during one.
205 44a9b356 Paolo Bonzini
 *
206 44a9b356 Paolo Bonzini
 * @opaque: A pointer-sized value that is passed to @fd_read_poll,
207 44a9b356 Paolo Bonzini
 * @fd_read and @fd_write.
208 44a9b356 Paolo Bonzini
 */
209 44a9b356 Paolo Bonzini
int qemu_set_fd_handler2(int fd,
210 44a9b356 Paolo Bonzini
                         IOCanReadHandler *fd_read_poll,
211 44a9b356 Paolo Bonzini
                         IOHandler *fd_read,
212 44a9b356 Paolo Bonzini
                         IOHandler *fd_write,
213 44a9b356 Paolo Bonzini
                         void *opaque);
214 44a9b356 Paolo Bonzini
215 44a9b356 Paolo Bonzini
/**
216 44a9b356 Paolo Bonzini
 * qemu_set_fd_handler: Register a file descriptor with the main loop
217 44a9b356 Paolo Bonzini
 *
218 44a9b356 Paolo Bonzini
 * This function tells the main loop to wake up whenever one of the
219 44a9b356 Paolo Bonzini
 * following conditions is true:
220 44a9b356 Paolo Bonzini
 *
221 44a9b356 Paolo Bonzini
 * 1) if @fd_write is not %NULL, when the file descriptor is writable;
222 44a9b356 Paolo Bonzini
 *
223 44a9b356 Paolo Bonzini
 * 2) if @fd_read is not %NULL, when the file descriptor is readable.
224 44a9b356 Paolo Bonzini
 *
225 44a9b356 Paolo Bonzini
 * The callbacks that are set up by qemu_set_fd_handler are level-triggered.
226 44a9b356 Paolo Bonzini
 * If @fd_read does not read from @fd, or @fd_write does not write to @fd
227 44a9b356 Paolo Bonzini
 * until its buffers are full, they will be called again on the next
228 44a9b356 Paolo Bonzini
 * iteration.
229 44a9b356 Paolo Bonzini
 *
230 44a9b356 Paolo Bonzini
 * @fd: The file descriptor to be observed.  Under Windows it must be
231 44a9b356 Paolo Bonzini
 * a #SOCKET.
232 44a9b356 Paolo Bonzini
 *
233 44a9b356 Paolo Bonzini
 * @fd_read: A level-triggered callback that is fired if @fd is readable
234 44a9b356 Paolo Bonzini
 * at the beginning of a main loop iteration, or if it becomes readable
235 44a9b356 Paolo Bonzini
 * during one.
236 44a9b356 Paolo Bonzini
 *
237 44a9b356 Paolo Bonzini
 * @fd_write: A level-triggered callback that is fired when @fd is writable
238 44a9b356 Paolo Bonzini
 * at the beginning of a main loop iteration, or if it becomes writable
239 44a9b356 Paolo Bonzini
 * during one.
240 44a9b356 Paolo Bonzini
 *
241 44a9b356 Paolo Bonzini
 * @opaque: A pointer-sized value that is passed to @fd_read and @fd_write.
242 44a9b356 Paolo Bonzini
 */
243 44a9b356 Paolo Bonzini
int qemu_set_fd_handler(int fd,
244 44a9b356 Paolo Bonzini
                        IOHandler *fd_read,
245 44a9b356 Paolo Bonzini
                        IOHandler *fd_write,
246 44a9b356 Paolo Bonzini
                        void *opaque);
247 44a9b356 Paolo Bonzini
248 44a9b356 Paolo Bonzini
#ifdef CONFIG_POSIX
249 44a9b356 Paolo Bonzini
/**
250 44a9b356 Paolo Bonzini
 * qemu_add_child_watch: Register a child process for reaping.
251 44a9b356 Paolo Bonzini
 *
252 44a9b356 Paolo Bonzini
 * Under POSIX systems, a parent process must read the exit status of
253 44a9b356 Paolo Bonzini
 * its child processes using waitpid, or the operating system will not
254 44a9b356 Paolo Bonzini
 * free some of the resources attached to that process.
255 44a9b356 Paolo Bonzini
 *
256 44a9b356 Paolo Bonzini
 * This function directs the QEMU main loop to observe a child process
257 44a9b356 Paolo Bonzini
 * and call waitpid as soon as it exits; the watch is then removed
258 44a9b356 Paolo Bonzini
 * automatically.  It is useful whenever QEMU forks a child process
259 44a9b356 Paolo Bonzini
 * but will find out about its termination by other means such as a
260 44a9b356 Paolo Bonzini
 * "broken pipe".
261 44a9b356 Paolo Bonzini
 *
262 44a9b356 Paolo Bonzini
 * @pid: The pid that QEMU should observe.
263 44a9b356 Paolo Bonzini
 */
264 44a9b356 Paolo Bonzini
int qemu_add_child_watch(pid_t pid);
265 44a9b356 Paolo Bonzini
#endif
266 44a9b356 Paolo Bonzini
267 d3b12f5d Paolo Bonzini
/**
268 d3b12f5d Paolo Bonzini
 * qemu_mutex_lock_iothread: Lock the main loop mutex.
269 d3b12f5d Paolo Bonzini
 *
270 d3b12f5d Paolo Bonzini
 * This function locks the main loop mutex.  The mutex is taken by
271 d3b12f5d Paolo Bonzini
 * qemu_init_main_loop and always taken except while waiting on
272 d3b12f5d Paolo Bonzini
 * external events (such as with select).  The mutex should be taken
273 d3b12f5d Paolo Bonzini
 * by threads other than the main loop thread when calling
274 d3b12f5d Paolo Bonzini
 * qemu_bh_new(), qemu_set_fd_handler() and basically all other
275 d3b12f5d Paolo Bonzini
 * functions documented in this file.
276 cbcfa041 Paolo Bonzini
 *
277 cbcfa041 Paolo Bonzini
 * NOTE: tools currently are single-threaded and qemu_mutex_lock_iothread
278 cbcfa041 Paolo Bonzini
 * is a no-op there.
279 d3b12f5d Paolo Bonzini
 */
280 d3b12f5d Paolo Bonzini
void qemu_mutex_lock_iothread(void);
281 d3b12f5d Paolo Bonzini
282 d3b12f5d Paolo Bonzini
/**
283 d3b12f5d Paolo Bonzini
 * qemu_mutex_unlock_iothread: Unlock the main loop mutex.
284 d3b12f5d Paolo Bonzini
 *
285 d3b12f5d Paolo Bonzini
 * This function unlocks the main loop mutex.  The mutex is taken by
286 d3b12f5d Paolo Bonzini
 * qemu_init_main_loop and always taken except while waiting on
287 d3b12f5d Paolo Bonzini
 * external events (such as with select).  The mutex should be unlocked
288 d3b12f5d Paolo Bonzini
 * as soon as possible by threads other than the main loop thread,
289 d3b12f5d Paolo Bonzini
 * because it prevents the main loop from processing callbacks,
290 d3b12f5d Paolo Bonzini
 * including timers and bottom halves.
291 cbcfa041 Paolo Bonzini
 *
292 cbcfa041 Paolo Bonzini
 * NOTE: tools currently are single-threaded and qemu_mutex_unlock_iothread
293 cbcfa041 Paolo Bonzini
 * is a no-op there.
294 d3b12f5d Paolo Bonzini
 */
295 d3b12f5d Paolo Bonzini
void qemu_mutex_unlock_iothread(void);
296 d3b12f5d Paolo Bonzini
297 44a9b356 Paolo Bonzini
/* internal interfaces */
298 44a9b356 Paolo Bonzini
299 d3385eb4 Paolo Bonzini
void qemu_fd_register(int fd);
300 44a9b356 Paolo Bonzini
void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set *writefds, fd_set *xfds);
301 44a9b356 Paolo Bonzini
void qemu_iohandler_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds, int rc);
302 44a9b356 Paolo Bonzini
303 f627aab1 Paolo Bonzini
QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque);
304 44a9b356 Paolo Bonzini
void qemu_bh_schedule_idle(QEMUBH *bh);
305 44a9b356 Paolo Bonzini
306 44a9b356 Paolo Bonzini
#endif