Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion arch/xtensa/src/esp32/esp32_spiram.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@

static bool spiram_inited = false;

#ifdef CONFIG_SMP
static int pause_cpu_handler(FAR void *cookie);
static struct smp_call_data_s g_call_data =
SMP_CALL_INITIALIZER(pause_cpu_handler, NULL);
#endif

/****************************************************************************
* Private Functions
****************************************************************************/
Expand Down Expand Up @@ -205,7 +211,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);
}

Expand Down
8 changes: 7 additions & 1 deletion arch/xtensa/src/esp32s3/esp32s3_spiram.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ static uint32_t page0_mapped;
static uint32_t page0_page = INVALID_PHY_PAGE;
#endif

#ifdef CONFIG_SMP
static int pause_cpu_handler(FAR void *cookie);
static struct smp_call_data_s g_call_data =
SMP_CALL_INITIALIZER(pause_cpu_handler, NULL);
#endif

/****************************************************************************
* ROM Function Prototypes
****************************************************************************/
Expand Down Expand Up @@ -340,7 +346,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);
}

Expand Down