aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-09-13 11:24:38 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-09-13 11:24:38 +0000
commit1a2e19d5d6161df4c7b385bc03ed761e0e27e825 (patch)
treedee4b5a33495ffd6f8a8bea55632b32d0ca78edf /os
parenta86b48c578db236dddea8f141db7607741d48e57 (diff)
downloadChibiOS-1a2e19d5d6161df4c7b385bc03ed761e0e27e825.tar.gz
ChibiOS-1a2e19d5d6161df4c7b385bc03ed761e0e27e825.tar.bz2
ChibiOS-1a2e19d5d6161df4c7b385bc03ed761e0e27e825.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6299 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/nil/ports/ARMCMx/compilers/GCC/niltypes.h2
-rw-r--r--os/rt/include/chthreads.h11
-rw-r--r--os/rt/ports/ARMCMx/compilers/GCC/chtypes.h5
3 files changed, 17 insertions, 1 deletions
diff --git a/os/nil/ports/ARMCMx/compilers/GCC/niltypes.h b/os/nil/ports/ARMCMx/compilers/GCC/niltypes.h
index 8aa7bf7a6..8b206cb1d 100644
--- a/os/nil/ports/ARMCMx/compilers/GCC/niltypes.h
+++ b/os/nil/ports/ARMCMx/compilers/GCC/niltypes.h
@@ -72,7 +72,7 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */
#define NOINLINE __attribute__((noinline))
/**
- * @brief Thread function declaration macro optimized for GCC.
+ * @brief Optimized thread function declaration macro.
*/
#define PORT_THD_FUNCTION(tname, arg) \
__attribute__((noreturn)) void tname(void *arg)
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
@@ -148,6 +148,17 @@ typedef msg_t (*tfunc_t)(void *);
/** @} */
/**
+ * @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_ */
/** @} */