diff options
| author | Markus Armbruster <armbru@redhat.com> | 2022-12-21 14:14:32 +0100 |
|---|---|---|
| committer | Markus Armbruster <armbru@redhat.com> | 2023-01-19 10:18:28 +0100 |
| commit | af7f8eb591b45e9a950f2622b96640ff1f2a6794 (patch) | |
| tree | c566e4c62e0defa8ad2263d421edf7f81a4cf7ee /include/qemu/coroutine.h | |
| parent | 23792478103f444e34621de0ac3b19ef648ae752 (diff) | |
| download | focaccia-qemu-af7f8eb591b45e9a950f2622b96640ff1f2a6794.tar.gz focaccia-qemu-af7f8eb591b45e9a950f2622b96640ff1f2a6794.zip | |
coroutine: Move coroutine_fn to qemu/osdep.h, trim includes
block/block-hmp-cmds.h and qemu/co-shared-resource.h use coroutine_fn without including qemu/coroutine.h. They compile only if it's already included from elsewhere. I could fix that, but pulling in qemu/coroutine.h and everything it includes just for a macro that expands into nothing feels silly. Instead, move the macro to qemu/osdep.h. Inclusions of qemu/coroutine.h just for coroutine_fn become superfluous. Drop them. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20221221131435.3851212-3-armbru@redhat.com>
Diffstat (limited to 'include/qemu/coroutine.h')
| -rw-r--r-- | include/qemu/coroutine.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h index 89650a2d7f..2496a4f4ef 100644 --- a/include/qemu/coroutine.h +++ b/include/qemu/coroutine.h @@ -26,23 +26,19 @@ * waiting for events to complete. * * These functions are re-entrant and may be used outside the global mutex. - */ - -/** - * Mark a function that executes in coroutine context * - * Functions that execute in coroutine context cannot be called directly from - * normal functions. In the future it would be nice to enable compiler or - * static checker support for catching such errors. This annotation might make - * it possible and in the meantime it serves as documentation. - * - * For example: + * Functions that execute in coroutine context cannot be called + * directly from normal functions. Use @coroutine_fn to mark such + * functions. For example: * * static void coroutine_fn foo(void) { * .... * } + * + * In the future it would be nice to have the compiler or a static + * checker catch misuse of such functions. This annotation might make + * it possible and in the meantime it serves as documentation. */ -#define coroutine_fn typedef struct Coroutine Coroutine; |