mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 05:42:05 +08: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:
committed by
Xiang Xiao
parent
6d72a8d676
commit
06b3416384
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user