diff --git a/arch/xtensa/src/esp32/esp32_spiram.c b/arch/xtensa/src/esp32/esp32_spiram.c index 8310dbf991786..665695cd87951 100644 --- a/arch/xtensa/src/esp32/esp32_spiram.c +++ b/arch/xtensa/src/esp32/esp32_spiram.c @@ -74,6 +74,11 @@ static bool spiram_inited = false; +#ifdef CONFIG_SMP +static struct smp_call_data_s g_call_data = +SMP_CALL_INITIALIZER(pause_cpu_handler, NULL); +#endif + /**************************************************************************** * Private Functions ****************************************************************************/ @@ -205,7 +210,7 @@ unsigned int IRAM_ATTR cache_sram_mmu_set(int cpu_no, int pid, cpu_to_stop = this_cpu() == 1 ? 0 : 1; g_cpu_wait = true; g_cpu_pause = false; - nxsched_smp_call_single(cpu_to_stop, pause_cpu_handler, NULL, false); + nxsched_smp_call_single_async(cpu_to_stop, &g_call_data); while (!g_cpu_pause); } diff --git a/arch/xtensa/src/esp32s3/esp32s3_spiram.c b/arch/xtensa/src/esp32s3/esp32s3_spiram.c index 44b72a027bd47..7367bfd7cc57c 100644 --- a/arch/xtensa/src/esp32s3/esp32s3_spiram.c +++ b/arch/xtensa/src/esp32s3/esp32s3_spiram.c @@ -117,6 +117,11 @@ static uint32_t page0_mapped; static uint32_t page0_page = INVALID_PHY_PAGE; #endif +#ifdef CONFIG_SMP +static struct smp_call_data_s g_call_data = +SMP_CALL_INITIALIZER(pause_cpu_handler, NULL); +#endif + /**************************************************************************** * ROM Function Prototypes ****************************************************************************/ @@ -340,7 +345,7 @@ int IRAM_ATTR cache_dbus_mmu_map(int vaddr, int paddr, int num) { g_cpu_wait = true; g_cpu_pause = false; - nxsched_smp_call_single(other_cpu, pause_cpu_handler, NULL, false); + nxsched_smp_call_single_async(other_cpu, &g_call_data); while (!g_cpu_pause); }