ppc/pnv: Add a pca9554 I2C device to powernv10-rainier
[qemu/ar7.git] / hw / 9pfs / coth.c
blob598f46add9936c83ea3594e601329a634313576f
1 /*
2 * 9p backend
4 * Copyright IBM, Corp. 2010
6 * Authors:
7 * Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
8 * Venkateswararao Jujjuri(JV) <jvrao@linux.vnet.ibm.com>
10 * This work is licensed under the terms of the GNU GPL, version 2. See
11 * the COPYING file in the top-level directory.
16 * Not so fast! You might want to read the 9p developer docs first:
17 * https://wiki.qemu.org/Documentation/9p
20 #include "qemu/osdep.h"
21 #include "block/thread-pool.h"
22 #include "qemu/coroutine.h"
23 #include "qemu/main-loop.h"
24 #include "coth.h"
26 /* Called from QEMU I/O thread. */
27 static void coroutine_enter_cb(void *opaque, int ret)
29 Coroutine *co = opaque;
30 qemu_coroutine_enter(co);
33 /* Called from worker thread. */
34 static int coroutine_enter_func(void *arg)
36 Coroutine *co = arg;
37 qemu_coroutine_enter(co);
38 return 0;
41 void co_run_in_worker_bh(void *opaque)
43 Coroutine *co = opaque;
44 thread_pool_submit_aio(coroutine_enter_func, co, coroutine_enter_cb, co);