gicv2:g_gic_init_done need to be protect

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5 2024-01-30 21:09:34 +08:00 committed by Xiang Xiao
parent cd88cb1e48
commit c16fd8c911

View File

@ -30,6 +30,7 @@
#include <errno.h> #include <errno.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/spinlock.h>
#include <arch/irq.h> #include <arch/irq.h>
#include "arm_internal.h" #include "arm_internal.h"
@ -68,7 +69,11 @@ static volatile cpu_set_t g_gic_init_done;
#if defined(CONFIG_SMP) && CONFIG_SMP_NCPUS > 1 #if defined(CONFIG_SMP) && CONFIG_SMP_NCPUS > 1
static void arm_gic_init_done(void) static void arm_gic_init_done(void)
{ {
irqstate_t flags;
flags = spin_lock_irqsave(NULL);
CPU_SET(up_cpu_index(), &g_gic_init_done); CPU_SET(up_cpu_index(), &g_gic_init_done);
spin_unlock_irqrestore(NULL, flags);
} }
static void arm_gic_wait_done(cpu_set_t cpuset) static void arm_gic_wait_done(cpu_set_t cpuset)