From f527a81dcf35e0f111f2c892ab69873b932c43a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Leksell?= Date: Tue, 9 Nov 2021 09:15:37 +0100 Subject: [PATCH] Tracing: Tracing/Kernel dependency issue fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added forward declarations of types declared throughout kernel.h at the start of kernel.h. With this change it is possible to include tracing/tracing.h early in kernel.h and use the tracing functionality in kernel.h functions without compile errors which would result if tracing/tracing.h was included at the end of kernel.h (type dependencies). Signed-off-by: Torbjörn Leksell --- include/kernel.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/kernel.h b/include/kernel.h index c7e370ae301..01acc85635c 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -76,6 +76,22 @@ struct k_mem_domain; struct k_mem_partition; struct k_futex; struct k_event; +struct k_condvar; +struct k_mbox_msg; +struct k_work; +struct k_work_q; +struct k_work_user; +struct k_work_sync; +struct k_work_delayable; +struct k_work_queue_config; + +typedef void (*k_thread_user_cb_t)(const struct k_thread *thread, + void *user_data); +typedef void (*k_timer_expiry_t)(struct k_timer *timer); +typedef void (*k_timer_stop_t)(struct k_timer *timer); +typedef uintptr_t stack_data_t; +typedef void (*k_work_handler_t)(struct k_work *work); +typedef void (*k_work_user_handler_t)(struct k_work_user *work); enum execution_context_types { K_ISR = 0, @@ -87,6 +103,8 @@ enum execution_context_types { struct k_work_poll; typedef int (*_poller_cb_t)(struct k_poll_event *event, uint32_t state); +#include + /** * @addtogroup thread_apis * @{ @@ -5892,7 +5910,6 @@ int k_thread_runtime_stats_all_get(k_thread_runtime_stats_t *stats); } #endif -#include #include #endif /* !_ASMLANGUAGE */