kopia lustrzana https://github.com/espressif/esp-idf
dport access: Fix nested calls to DPORT_STALL_OTHER_CPU_START()
rodzic
08287852ab
commit
dc8c33892e
|
@ -79,11 +79,12 @@ void IRAM_ATTR esp_dport_access_stall_other_cpu_start(void)
|
|||
#ifdef DPORT_ACCESS_BENCHMARK
|
||||
ccount_start[cpu_id] = XTHAL_GET_CCOUNT();
|
||||
#endif
|
||||
BaseType_t intLvl=portENTER_CRITICAL_NESTED();
|
||||
oldInterruptLevel[cpu_id]=intLvl;
|
||||
BaseType_t intLvl = portENTER_CRITICAL_NESTED();
|
||||
|
||||
if (dport_access_ref[cpu_id] == 0) {
|
||||
portENTER_CRITICAL_ISR(&g_dport_mux);
|
||||
portENTER_CRITICAL_ISR(&g_dport_mux);
|
||||
|
||||
oldInterruptLevel[cpu_id]=intLvl;
|
||||
|
||||
dport_access_start[cpu_id] = 0;
|
||||
dport_access_end[cpu_id] = 0;
|
||||
|
@ -100,6 +101,11 @@ void IRAM_ATTR esp_dport_access_stall_other_cpu_start(void)
|
|||
}
|
||||
|
||||
dport_access_ref[cpu_id]++;
|
||||
|
||||
if (dport_access_ref[cpu_id] > 1) {
|
||||
/* Interrupts are already disabled by the parent, we're nested here. */
|
||||
portEXIT_CRITICAL_NESTED(intLvl);
|
||||
}
|
||||
#endif /* CONFIG_FREERTOS_UNICORE */
|
||||
}
|
||||
|
||||
|
@ -124,9 +130,9 @@ void IRAM_ATTR esp_dport_access_stall_other_cpu_end(void)
|
|||
dport_access_end[cpu_id] = 1;
|
||||
|
||||
portEXIT_CRITICAL_ISR(&g_dport_mux);
|
||||
|
||||
portEXIT_CRITICAL_NESTED(oldInterruptLevel[cpu_id]);
|
||||
}
|
||||
|
||||
portEXIT_CRITICAL_NESTED(oldInterruptLevel[cpu_id]);
|
||||
|
||||
#ifdef DPORT_ACCESS_BENCHMARK
|
||||
ccount_end[cpu_id] = XTHAL_GET_CCOUNT();
|
||||
|
|
Ładowanie…
Reference in New Issue