arch: Initialize idle thread stack information

and remove the special handling in the stack dump

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia1ef9a427bd4c7f6cee9838d0445f29cfaca3998
This commit is contained in:
Xiang Xiao
2020-07-05 13:37:48 +08:00
committed by David Sidrane
parent 5fec6191c3
commit bf7399a982
91 changed files with 747 additions and 828 deletions
+2 -10
View File
@@ -160,16 +160,8 @@ static void up_dumpstate(void)
/* Get the limits on the user stack memory */
if (rtcb->pid == 0) /* Check for CPU0 IDLE thread */
{
ustackbase = g_idle_topstack - 4;
ustacksize = CONFIG_IDLETHREAD_STACKSIZE;
}
else
{
ustackbase = (uint32_t)rtcb->adj_stack_ptr;
ustacksize = (uint32_t)rtcb->adj_stack_size;
}
ustackbase = (uint32_t)rtcb->adj_stack_ptr;
ustacksize = (uint32_t)rtcb->adj_stack_size;
/* Get the limits on the interrupt stack memory */
+8 -12
View File
@@ -48,18 +48,6 @@
#include "up_internal.h"
#include "up_arch.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -81,6 +69,14 @@ void up_initial_state(struct tcb_s *tcb)
{
struct xcptcontext *xcp = &tcb->xcp;
/* Initialize the idle thread stack */
if (tcb->pid == 0)
{
up_use_stack(tcb, (void *)(g_idle_topstack -
CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
}
/* Initialize the initial exception register context structure */
memset(xcp, 0, sizeof(struct xcptcontext));
+11 -8
View File
@@ -50,14 +50,6 @@
#include "up_internal.h"
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -114,6 +106,17 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
tcb->stack_alloc_ptr = stack;
/* If stack debug is enabled, then fill the stack with a recognizable value
* that we can use later to test for high water marks.
*/
#ifdef CONFIG_STACK_COLORATION
if (tcb->pid != 0)
{
memset(tcb->stack_alloc_ptr, 0xaa, stack_size);
}
#endif
/* The i486 uses a push-down stack: the stack grows toward loweraddresses
* in memory. The stack pointer register, points to the lowest, valid work
* address (the "top" of the stack). Items on the stack are referenced as