summaryrefslogtreecommitdiff
path: root/components/drivers/include
diff options
context:
space:
mode:
authorShell <[email protected]>2024-02-23 17:49:15 +0800
committerGitHub <[email protected]>2024-02-23 17:49:15 +0800
commit71560bafb5735220696ca24a42ba4a668b55949b (patch)
tree236df5973a1fd5b6f0cc9f6c6b6a2d71fd069203 /components/drivers/include
parent6fe69d7431ed54fcea863ed68d7c4f9746e771b0 (diff)
🎯 Sync smart & scheduler codes (#8537)
Signed-off-by: Shell <[email protected]> Co-authored-by: xqyjlj <[email protected]>
Diffstat (limited to 'components/drivers/include')
-rw-r--r--components/drivers/include/ipc/completion.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/components/drivers/include/ipc/completion.h b/components/drivers/include/ipc/completion.h
index b8d765027e..efa2b7840d 100644
--- a/components/drivers/include/ipc/completion.h
+++ b/components/drivers/include/ipc/completion.h
@@ -13,18 +13,22 @@
#include <rtconfig.h>
/**
- * Completion
+ * Completion - A tiny IPC implementation for resource-constrained scenarios
+ *
+ * It's an IPC using one CPU word with the encoding:
+ *
+ * BIT | MAX-1 ----------------- 1 | 0 |
+ * CONTENT | suspended_thread & ~1 | completed flag |
*/
struct rt_completion
{
- rt_uint32_t flag;
-
- /* suspended list */
- rt_list_t suspended_list;
- struct rt_spinlock spinlock;
+ /* suspended thread, and completed flag */
+ rt_base_t susp_thread_n_flag;
};
+#define RT_COMPLETION_INIT(comp) {0}
+
void rt_completion_init(struct rt_completion *completion);
rt_err_t rt_completion_wait(struct rt_completion *completion,
rt_int32_t timeout);