mirror of
https://github.com/apache/nuttx.git
synced 2026-10-06 13:55:15 +00:00
arch/risc-v/src/common/riscv_initialstate.c: Fix stack pointer in coloration
The logical CPU index should be retrieved with this_cpu(); the riscv_mhartid() returns the actual hart id of the SoC. For mpfs target for example, NuttX can run on a single HART, for example on mhartid 2, but there is still just one logical CPU for the NuttX. Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
parent
6d72a8d676
commit
06b3416384
1 changed files with 1 additions and 1 deletions
|
|
@ -97,7 +97,7 @@ void up_initial_state(struct tcb_s *tcb)
|
|||
|
||||
if (tcb->pid == IDLE_PROCESS_ID)
|
||||
{
|
||||
tcb->stack_alloc_ptr = (void *)g_cpux_idlestack(riscv_mhartid());
|
||||
tcb->stack_alloc_ptr = (void *)g_cpux_idlestack(this_cpu());
|
||||
tcb->stack_base_ptr = tcb->stack_alloc_ptr;
|
||||
tcb->adj_stack_size = SMP_STACK_SIZE;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue