mirror of
https://github.com/apache/nuttx.git
synced 2026-05-24 07:46:16 +08:00
arm64: remove busy wait flag
Replace CONFIG_ARM64_SMP_BUSY_WAIT_FLAG_ADDR with global variable g_smp_busy_wait_flag for SMP CPU synchronization. This improves flexibility over fixed memory addresses and aligns with standard kernel variable patterns for multi-core startup. Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -217,17 +217,6 @@ config ARM64_TBI
|
||||
bool "Top Byte Ignore support"
|
||||
default n
|
||||
|
||||
config ARM64_SMP_BUSY_WAIT
|
||||
bool "Busy wait when SMP boot"
|
||||
default n
|
||||
depends on SMP
|
||||
---help---
|
||||
Enables busy wait when SMP boot
|
||||
|
||||
config ARM64_SMP_BUSY_WAIT_FLAG_ADDR
|
||||
hex "Busy wait flag address"
|
||||
depends on ARM64_SMP_BUSY_WAIT
|
||||
|
||||
config ARCH_HAVE_EL3
|
||||
bool
|
||||
default n
|
||||
|
||||
@@ -76,6 +76,8 @@ uint64_t *const g_cpu_int_stacktop[CONFIG_SMP_NCPUS] =
|
||||
#endif /* CONFIG_SMP_NCPUS > 1 */
|
||||
};
|
||||
|
||||
uint32_t g_smp_busy_wait_flag;
|
||||
|
||||
#ifdef CONFIG_ARM64_DECODEFIQ
|
||||
uint64_t *const g_cpu_int_fiq_stacktop[CONFIG_SMP_NCPUS] =
|
||||
{
|
||||
@@ -198,8 +200,8 @@ int up_cpu_start(int cpu)
|
||||
sched_note_cpu_start(this_task(), cpu);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARM64_SMP_BUSY_WAIT
|
||||
uint32_t *address = (uint32_t *)CONFIG_ARM64_SMP_BUSY_WAIT_FLAG_ADDR;
|
||||
#ifdef CONFIG_SMP
|
||||
uint32_t *address = &g_smp_busy_wait_flag;
|
||||
*address = 1;
|
||||
up_flush_dcache((uintptr_t)address, (uintptr_t)address + sizeof(address));
|
||||
#endif
|
||||
|
||||
@@ -143,13 +143,11 @@ real_start:
|
||||
|
||||
/* Wait until cpu0 notify */
|
||||
|
||||
#ifdef CONFIG_ARM64_SMP_BUSY_WAIT
|
||||
ldr x2, =CONFIG_ARM64_SMP_BUSY_WAIT_FLAG_ADDR
|
||||
ldr x2, =g_smp_busy_wait_flag
|
||||
1:
|
||||
ldr x3, [x2, #0]
|
||||
cmp x3, #0
|
||||
ldr w3, [x2, #0]
|
||||
cmp w3, #0
|
||||
beq 1b
|
||||
#endif
|
||||
|
||||
/* we can now load our stack pointer value and move on */
|
||||
|
||||
|
||||
@@ -14,8 +14,6 @@ CONFIG_ARCH_CHIP_FVP_ARMV8R=y
|
||||
CONFIG_ARCH_CHIP_FVP_R82=y
|
||||
CONFIG_ARCH_EARLY_PRINT=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=4096
|
||||
CONFIG_ARM64_SMP_BUSY_WAIT=y
|
||||
CONFIG_ARM64_SMP_BUSY_WAIT_FLAG_ADDR=0x4000000
|
||||
CONFIG_ARM64_STRING_FUNCTION=y
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DEBUG_ASSERTIONS=y
|
||||
|
||||
@@ -18,8 +18,6 @@ CONFIG_ARCH_INTERRUPTSTACK=4096
|
||||
CONFIG_ARCH_KERNEL_STACK=y
|
||||
CONFIG_ARCH_KERNEL_STACKSIZE=8192
|
||||
CONFIG_ARCH_USE_MPU=y
|
||||
CONFIG_ARM64_SMP_BUSY_WAIT=y
|
||||
CONFIG_ARM64_SMP_BUSY_WAIT_FLAG_ADDR=0x400000
|
||||
CONFIG_ARM64_STRING_FUNCTION=y
|
||||
CONFIG_BUILD_PROTECTED=y
|
||||
CONFIG_BUILTIN=y
|
||||
|
||||
@@ -59,9 +59,6 @@ SECTIONS
|
||||
|
||||
.bss : { /* BSS */
|
||||
_sbss = . ;
|
||||
#if defined(CONFIG_SMP) && defined(CONFIG_ARM64_SMP_BUSY_WAIT)
|
||||
. = . + 0x4; /* Busy Wait Flag */
|
||||
#endif
|
||||
*(.bss*)
|
||||
. = ALIGN(4096);
|
||||
_ebss = .;
|
||||
|
||||
Reference in New Issue
Block a user