Added a "waend" field to the thread structure in RT for debug convenience.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15817 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2022-10-10 07:14:34 +00:00
parent d62102117e
commit 7c9082836b
5 changed files with 13 additions and 9 deletions

View File

@ -199,6 +199,11 @@ struct ch_thread {
* dynamic threading.
*/
stkalign_t *wabase;
/**
* @brief Working area end address.
* @note It is the 1st address after the working area.
*/
stkalign_t *waend;
#endif
/**
* @brief Current thread state.

View File

@ -154,6 +154,7 @@ void chInstanceObjectInit(os_instance_t *oip,
#if (CH_DBG_ENABLE_STACK_CHECK == TRUE) || (CH_CFG_USE_DYNAMIC == TRUE)
oip->rlist.current->wabase = oicp->mainthread_base;
oip->rlist.current->waend = oicp->mainthread_end;
#endif
/* Setting up the caller as current thread.*/

View File

@ -57,7 +57,7 @@ static CH_SYS_CORE0_MEMORY THD_WORKING_AREA(ch_c0_idle_thread_wa,
PORT_IDLE_THREAD_STACK_SIZE);
#endif
#if CH_DBG_ENABLE_STACK_CHECK == TRUE
#if (CH_DBG_ENABLE_STACK_CHECK == TRUE) || (CH_CFG_USE_DYNAMIC == TRUE)
extern stkalign_t __main_thread_stack_base__, __main_thread_stack_end__;
#endif
@ -66,12 +66,9 @@ extern stkalign_t __main_thread_stack_base__, __main_thread_stack_end__;
*/
const os_instance_config_t ch_core0_cfg = {
.name = "c0",
#if CH_DBG_ENABLE_STACK_CHECK == TRUE
#if (CH_DBG_ENABLE_STACK_CHECK == TRUE) || (CH_CFG_USE_DYNAMIC == TRUE)
.mainthread_base = &__main_thread_stack_base__,
.mainthread_end = &__main_thread_stack_end__,
#elif CH_CFG_USE_DYNAMIC == TRUE
.mainthread_base = NULL,
.mainthread_end = NULL,
#endif
#if CH_CFG_NO_IDLE_THREAD == FALSE
.idlethread_base = THD_WORKING_AREA_BASE(ch_c0_idle_thread_wa),
@ -102,12 +99,9 @@ extern stkalign_t __c1_main_thread_stack_base__, __c1_main_thread_stack_end__;
*/
const os_instance_config_t ch_core1_cfg = {
.name = "c1",
#if CH_DBG_ENABLE_STACK_CHECK == TRUE
#if (CH_DBG_ENABLE_STACK_CHECK == TRUE) || (CH_CFG_USE_DYNAMIC == TRUE)
.mainthread_base = &__c1_main_thread_stack_base__,
.mainthread_end = &__c1_main_thread_stack_end__,
#elif CH_CFG_USE_DYNAMIC == TRUE
.mainthread_base = NULL,
.mainthread_end = NULL,
#endif
#if CH_CFG_NO_IDLE_THREAD == FALSE
.idlethread_base = THD_WORKING_AREA_BASE(ch_c1_idle_thread_wa),

View File

@ -190,6 +190,7 @@ thread_t *chThdCreateSuspendedI(const thread_descriptor_t *tdp) {
#if (CH_DBG_ENABLE_STACK_CHECK == TRUE) || (CH_CFG_USE_DYNAMIC == TRUE)
/* Stack boundary.*/
tp->wabase = tdp->wbase;
tp->waend = tdp->wend;
#endif
/* Setting up the port-dependent part of the working area.*/
@ -359,6 +360,7 @@ thread_t *chThdCreateStatic(void *wsp, size_t size,
#if (CH_DBG_ENABLE_STACK_CHECK == TRUE) || (CH_CFG_USE_DYNAMIC == TRUE)
/* Stack boundary.*/
tp->wabase = (stkalign_t *)wsp;
tp->waend = (stkalign_t *)wsp + (size / sizeof (stkalign_t));
#endif
/* Setting up the port-dependent part of the working area.*/

View File

@ -74,6 +74,8 @@
*****************************************************************************
*** Next ***
- NEW: Added a "waend" field to the thread structure in RT for debug
convenience.
- NEW: Removed obsolete sandbox code from ARMv7-M port. Now ARMv7-M-ALT is
the official port for use with sandboxes.
- NEW: Reworked HAL MAC driver, now with callback support.