@@ -25,8 +25,6 @@
#ifndef BLOCK_AIO_TASK_H
#define BLOCK_AIO_TASK_H
-#include "qemu/coroutine.h"
-
typedef struct AioTaskPool AioTaskPool;
typedef struct AioTask AioTask;
typedef int coroutine_fn (*AioTaskFunc)(AioTask *task);
@@ -27,7 +27,6 @@
#include "block/aio.h"
#include "block/aio-wait.h"
#include "qemu/iov.h"
-#include "qemu/coroutine.h"
#include "block/accounting.h"
#include "qemu/hbitmap.h"
#include "qemu/transactions.h"
@@ -23,8 +23,6 @@
#include "qemu/osdep.h"
#include "qemu/clang-tsa.h"
-#include "qemu/coroutine.h"
-
/**
* Graph Lock API
* This API provides a rwlock used to protect block layer
@@ -15,7 +15,6 @@
#define HMP_H
#include "qemu/readline.h"
-#include "qemu/coroutine.h"
#include "qapi/qapi-types-common.h"
bool hmp_handle_error(Monitor *mon, Error *err);
@@ -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;
@@ -157,6 +157,22 @@ extern "C" {
#include "qemu/typedefs.h"
+/**
+ * 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:
+ *
+ * static void coroutine_fn foo(void) {
+ * ....
+ * }
+ */
+#define coroutine_fn
+
/*
* For mingw, as of v6.0.0, the function implementing the assert macro is
* not marked as noreturn, so the compiler cannot delete code following an