From 9fd8d44b069214fe9043cd38e0777bad2c33c911 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 2 Apr 2016 06:24:34 +0000 Subject: Moved thread macros in chthreads.h. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9200 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/chschd.h | 53 ----------------------------------------------- os/rt/include/chthreads.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/os/rt/include/chschd.h b/os/rt/include/chschd.h index 4f94f406b..aa49adcff 100644 --- a/os/rt/include/chschd.h +++ b/os/rt/include/chschd.h @@ -106,59 +106,6 @@ flag. */ /** @} */ -/** - * @name Working Areas - */ -/** - * @brief Calculates the total Working Area size. - * - * @param[in] n the stack size to be assigned to the thread - * @return The total used memory in bytes. - * - * @api - */ -#define THD_WORKING_AREA_SIZE(n) \ - MEM_ALIGN_NEXT(sizeof(thread_t) + PORT_WA_SIZE(n), PORT_STACK_ALIGN) - -/** - * @brief Static working area allocation. - * @details This macro is used to allocate a static thread working area - * aligned as both position and size. - * - * @param[in] s the name to be assigned to the stack array - * @param[in] n the stack size to be assigned to the thread - * - * @api - */ -#define THD_WORKING_AREA(s, n) PORT_WORKING_AREA(s, n) - -/** - * @brief Base of a working area casted to the correct type. - * - * @param[in] s name of the working area - */ -#define THD_WORKING_AREA_BASE(s) ((stkalign_t *)(s)) - -/** - * @brief End of a working area casted to the correct type. - * - * @param[in] s name of the working area - */ -#define THD_WORKING_AREA_END(s) (THD_WORKING_AREA_BASE(s) + \ - (sizeof (s) / 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) -/** @} */ - /*===========================================================================*/ /* Module pre-compile time settings. */ /*===========================================================================*/ diff --git a/os/rt/include/chthreads.h b/os/rt/include/chthreads.h index a6342ce66..47d7c2672 100644 --- a/os/rt/include/chthreads.h +++ b/os/rt/include/chthreads.h @@ -120,6 +120,59 @@ typedef struct { threads_queue_t name = _THREADS_QUEUE_DATA(name) /** @} */ +/** + * @name Working Areas + */ +/** + * @brief Calculates the total Working Area size. + * + * @param[in] n the stack size to be assigned to the thread + * @return The total used memory in bytes. + * + * @api + */ +#define THD_WORKING_AREA_SIZE(n) \ + MEM_ALIGN_NEXT(sizeof(thread_t) + PORT_WA_SIZE(n), PORT_STACK_ALIGN) + +/** + * @brief Static working area allocation. + * @details This macro is used to allocate a static thread working area + * aligned as both position and size. + * + * @param[in] s the name to be assigned to the stack array + * @param[in] n the stack size to be assigned to the thread + * + * @api + */ +#define THD_WORKING_AREA(s, n) PORT_WORKING_AREA(s, n) + +/** + * @brief Base of a working area casted to the correct type. + * + * @param[in] s name of the working area + */ +#define THD_WORKING_AREA_BASE(s) ((stkalign_t *)(s)) + +/** + * @brief End of a working area casted to the correct type. + * + * @param[in] s name of the working area + */ +#define THD_WORKING_AREA_END(s) (THD_WORKING_AREA_BASE(s) + \ + (sizeof (s) / 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 * @{ -- cgit v1.2.3