arch/arm: set the SP to stack top
fix the stack imbalance Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
bfe29c8d1f
commit
19119a9c43
@ -82,10 +82,9 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Initialize the context registers to stack top */
|
||||
|
||||
xcp->regs = (FAR void *)STACK_ALIGN_DOWN(
|
||||
(uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
xcp->regs = (FAR void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
/* Initialize the xcp registers */
|
||||
|
||||
@ -93,7 +92,8 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Save the initial stack pointer */
|
||||
|
||||
xcp->regs[REG_SP] = (uint32_t)xcp->regs;
|
||||
xcp->regs[REG_SP] = (uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size;
|
||||
|
||||
/* Save the task entry point */
|
||||
|
||||
|
@ -83,10 +83,9 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Initialize the context registers to stack top */
|
||||
|
||||
xcp->regs = (FAR void *)STACK_ALIGN_DOWN(
|
||||
(uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
xcp->regs = (FAR void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
/* Initialize the xcp registers */
|
||||
|
||||
@ -94,7 +93,8 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Save the initial stack pointer */
|
||||
|
||||
xcp->regs[REG_SP] = (uint32_t)xcp->regs;
|
||||
xcp->regs[REG_SP] = (uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size;
|
||||
|
||||
/* Save the task entry point (stripping off the thumb bit) */
|
||||
|
||||
|
@ -82,10 +82,9 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Initialize the context registers to stack top */
|
||||
|
||||
xcp->regs = (FAR void *)STACK_ALIGN_DOWN(
|
||||
(uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
xcp->regs = (FAR void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
/* Initialize the xcp registers */
|
||||
|
||||
@ -93,7 +92,8 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Save the initial stack pointer */
|
||||
|
||||
xcp->regs[REG_SP] = (uint32_t)xcp->regs;
|
||||
xcp->regs[REG_SP] = (uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size;
|
||||
|
||||
/* Save the task entry point */
|
||||
|
||||
|
@ -84,10 +84,9 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Initialize the context registers to stack top */
|
||||
|
||||
xcp->regs = (FAR void *)STACK_ALIGN_DOWN(
|
||||
(uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
xcp->regs = (FAR void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
/* Initialize the xcp registers */
|
||||
|
||||
@ -95,7 +94,8 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Save the initial stack pointer */
|
||||
|
||||
xcp->regs[REG_SP] = (uint32_t)xcp->regs;
|
||||
xcp->regs[REG_SP] = (uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size;
|
||||
|
||||
#ifdef CONFIG_ARMV7M_STACKCHECK
|
||||
/* Set the stack limit value */
|
||||
|
@ -82,10 +82,9 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Initialize the context registers to stack top */
|
||||
|
||||
xcp->regs = (FAR void *)STACK_ALIGN_DOWN(
|
||||
(uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
xcp->regs = (FAR void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
/* Initialize the xcp registers */
|
||||
|
||||
@ -93,7 +92,8 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Save the initial stack pointer */
|
||||
|
||||
xcp->regs[REG_SP] = (uint32_t)xcp->regs;
|
||||
xcp->regs[REG_SP] = (uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size;
|
||||
|
||||
/* Save the task entry point */
|
||||
|
||||
|
@ -84,10 +84,9 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Initialize the context registers to stack top */
|
||||
|
||||
xcp->regs = (FAR void *)STACK_ALIGN_DOWN(
|
||||
(uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
xcp->regs = (FAR void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
/* Initialize the xcp registers */
|
||||
|
||||
@ -95,7 +94,8 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Save the initial stack pointer */
|
||||
|
||||
xcp->regs[REG_SP] = (uint32_t)xcp->regs;
|
||||
xcp->regs[REG_SP] = (uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size;
|
||||
|
||||
#ifdef CONFIG_ARMV8M_STACKCHECK
|
||||
/* Set the stack limit value */
|
||||
|
Loading…
Reference in New Issue
Block a user