From 1a2e19d5d6161df4c7b385bc03ed761e0e27e825 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 13 Sep 2013 11:24:38 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6299 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/chthreads.h | 11 +++++++++++ os/rt/ports/ARMCMx/compilers/GCC/chtypes.h | 5 +++++ 2 files changed, 16 insertions(+) (limited to 'os/rt') diff --git a/os/rt/include/chthreads.h b/os/rt/include/chthreads.h index 6da6b6518..1dcad9b48 100644 --- a/os/rt/include/chthreads.h +++ b/os/rt/include/chthreads.h @@ -147,6 +147,17 @@ typedef msg_t (*tfunc_t)(void *); stkalign_t s[THD_WORKING_AREA_SIZE(n) / sizeof(stkalign_t)] /** @} */ +/** + * @name Threads abstraction macros + */ +/** + * @brief Thread declaration macro. + * @note Thread declarations should be performed using this macro because + * the port layer could define optimizations for thread functions. + */ +#define THD_FUNCTION(tname, arg) PORT_THD_FUNCTION(tname, arg) +/** @} */ + /** * @name Macro Functions * @{ diff --git a/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h b/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h index 1cf45c99b..61052a46d 100644 --- a/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h +++ b/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h @@ -79,6 +79,11 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ */ #define NOINLINE __attribute__((noinline)) +/** + * @brief Optimized thread function declaration macro. + */ +#define PORT_THD_FUNCTION(tname, arg) msg_t tname(void *arg) + #endif /* _CHTYPES_H_ */ /** @} */ -- cgit v1.2.3