From 9d5f87bf6750da92f89a0a31c034989a898be453 Mon Sep 17 00:00:00 2001 From: Koen Zandberg Date: Mon, 18 Jan 2021 17:07:09 +0100 Subject: [PATCH] core/thread: Allow for inline thread_yield_higher Similar to irq.h, this allows for inline the often trivial thread_yield_higher function --- core/include/thread.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/core/include/thread.h b/core/include/thread.h index 16d4e6a36f..5b1ba1fdc4 100644 --- a/core/include/thread.h +++ b/core/include/thread.h @@ -129,10 +129,24 @@ #include "thread_flags.h" #endif +#include "thread_arch.h" + #ifdef __cplusplus extern "C" { #endif +/** + * @brief Macro definition to inline some of the platform specific + * implementations + * + * Should be enabled when advantageous by CPU's in their thread_arch.h header + */ +#ifdef THREAD_API_INLINED +#define THREAD_MAYBE_INLINE static inline __attribute__((always_inline)) +#else +#define THREAD_MAYBE_INLINE +#endif /* THREAD_API_INLINED */ + #if defined(DEVELHELP) && !defined(CONFIG_THREAD_NAMES) /** * @brief This global macro enable storage of thread names to help developers. @@ -431,7 +445,7 @@ void thread_yield(void); * * @see thread_yield() */ -void thread_yield_higher(void); +THREAD_MAYBE_INLINE void thread_yield_higher(void); /** * @brief Puts the current thread into zombie state.