mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-22 17:02:25 +00:00
Merge branch 'refactor/riscv_interrupt' into 'master'
refactor(riscv): Refactor crosscore interrupts and core interrupt code Closes IDF-5720, DOC-5177, and IDF-7899 See merge request espressif/esp-idf!27845
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include "riscv/rv_utils.h"
|
||||
#include "riscv/interrupt.h"
|
||||
#include "esp_private/crosscore_int.h"
|
||||
#include "hal/crosscore_int_ll.h"
|
||||
#include "esp_attr.h"
|
||||
#include "esp_system.h"
|
||||
#include "esp_intr_alloc.h"
|
||||
@@ -144,7 +145,7 @@ BaseType_t xPortStartScheduler(void)
|
||||
/* Setup the hardware to generate the tick. */
|
||||
vPortSetupTimer();
|
||||
|
||||
esprv_intc_int_set_threshold(RVHAL_INTR_ENABLE_THRESH); /* set global interrupt masking level */
|
||||
esprv_int_set_threshold(RVHAL_INTR_ENABLE_THRESH); /* set global interrupt masking level */
|
||||
rv_utils_intr_global_enable();
|
||||
|
||||
vPortYield();
|
||||
@@ -626,13 +627,6 @@ void vPortExitCritical(void)
|
||||
void vPortYield(void)
|
||||
{
|
||||
BaseType_t coreID = xPortGetCoreID();
|
||||
int system_cpu_int_reg;
|
||||
|
||||
#if !CONFIG_IDF_TARGET_ESP32P4
|
||||
system_cpu_int_reg = SYSTEM_CPU_INTR_FROM_CPU_0_REG;
|
||||
#else
|
||||
system_cpu_int_reg = HP_SYSTEM_CPU_INT_FROM_CPU_0_REG;
|
||||
#endif /* !CONFIG_IDF_TARGET_ESP32P4 */
|
||||
|
||||
if (port_uxInterruptNesting[coreID]) {
|
||||
vPortYieldFromISR();
|
||||
@@ -648,7 +642,7 @@ void vPortYield(void)
|
||||
for an instant yield, and if that happens then the WFI would be
|
||||
waiting for the next interrupt to occur...)
|
||||
*/
|
||||
while (port_xSchedulerRunning[coreID] && port_uxCriticalNesting[coreID] == 0 && REG_READ(system_cpu_int_reg + 4 * coreID) != 0) {}
|
||||
while (port_xSchedulerRunning[coreID] && port_uxCriticalNesting[coreID] == 0 && crosscore_int_ll_get_state(coreID) != 0) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user