Skip to content

Commit

Permalink
arm64: we need to initialize the percpu register storing the current …
Browse files Browse the repository at this point in the history
…task more earlier.

A call stack looks like the following:
sched_idletask
syslog_write
nx_vsyslog
syslog
getreg64
gic_validate_redist_version
arm64_gic_init
arm64_gic_secondary_init
arm64_boot_secondary_c_routine

Signed-off-by: hujun5 <hujun5@xiaomi.com>
  • Loading branch information
hujun260 committed Oct 10, 2024
1 parent 6a83100 commit 9588d9f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions arch/arm64/src/common/arm64_cpustart.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ static void arm64_smp_init_top(void)
{
struct tcb_s *tcb = current_task(this_cpu());

/* Init idle task to percpu reg */

up_update_task(tcb);

#ifndef CONFIG_SUPPRESS_INTERRUPTS
/* And finally, enable interrupts */

Expand Down Expand Up @@ -226,6 +222,12 @@ int up_cpu_start(int cpu)

void arm64_boot_secondary_c_routine(void)
{
struct tcb_s *tcb = current_task(this_cpu());

/* Init idle task to percpu reg */

up_update_task(tcb);

#ifdef CONFIG_ARCH_HAVE_MPU
arm64_mpu_init(false);
#endif
Expand Down

0 comments on commit 9588d9f

Please sign in to comment.