From 71f174d00dcd678fa9da5acea8e1454f2417810c Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 2 Apr 2016 16:47:14 +0000 Subject: Fixed stack limit conditions in RT4. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9224 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/chschd.h | 10 +++++++--- os/rt/include/chthreads.h | 11 +++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'os/rt/include') diff --git a/os/rt/include/chschd.h b/os/rt/include/chschd.h index aa49adcff..a00b2fa5a 100644 --- a/os/rt/include/chschd.h +++ b/os/rt/include/chschd.h @@ -169,11 +169,15 @@ struct ch_thread { */ const char *name; #endif +#if (CH_DBG_ENABLE_STACK_CHECK == TRUE) || (CH_CFG_USE_DYNAMIC == TRUE) || \ + defined(__DOXYGEN__) /** - * @brief Thread stack boundary. - * @note This pointer matches with the working area base address. + * @brief Working area base address. + * @note This pointer is used for stack overflow checks and for + * dynamic threading. */ - stkalign_t *stklimit; + stkalign_t *wabase; +#endif /** * @brief Current thread state. */ diff --git a/os/rt/include/chthreads.h b/os/rt/include/chthreads.h index 47d7c2672..1b29260ed 100644 --- a/os/rt/include/chthreads.h +++ b/os/rt/include/chthreads.h @@ -307,18 +307,21 @@ static inline systime_t chThdGetTicksX(thread_t *tp) { } #endif +#if (CH_DBG_ENABLE_STACK_CHECK == TRUE) || (CH_CFG_USE_DYNAMIC == TRUE) || \ + defined(__DOXYGEN__) /** - * @brief Returns the stack limit of the specified thread. + * @brief Returns the working area base of the specified thread. * * @param[in] tp pointer to the thread - * @return The stack limit pointer. + * @return The working area base pointer. * * @xclass */ -static inline stkalign_t *chthdGetStackLimitX(thread_t *tp) { +static inline stkalign_t *chThdGetWorkingAreaX(thread_t *tp) { - return tp->stklimit; + return tp->wabase; } +#endif /* CH_DBG_ENABLE_STACK_CHECK == TRUE */ /** * @brief Verifies if the specified thread is in the @p CH_STATE_FINAL state. -- cgit v1.2.3