forked from espressif/esp-idf
freertos-smp: Fix build test errors for esp32c3
This commit fixes build test failures for esp32c3.
This commit is contained in:
@@ -259,15 +259,6 @@ Default values for trace macros added by ESP-IDF and are not part of Vanilla Fre
|
|||||||
#define configTASKLIST_INCLUDE_COREID 1
|
#define configTASKLIST_INCLUDE_COREID 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __ASSEMBLER__
|
|
||||||
#if CONFIG_APPTRACE_SV_ENABLE
|
|
||||||
extern uint32_t port_switch_flag[];
|
|
||||||
#define os_task_switch_is_pended(_cpu_) (port_switch_flag[_cpu_])
|
|
||||||
#else
|
|
||||||
#define os_task_switch_is_pended(_cpu_) (false)
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ---------------------- Features -------------------------
|
// ---------------------- Features -------------------------
|
||||||
|
|
||||||
/* These currently aren't required, but could be useful additions in the future */
|
/* These currently aren't required, but could be useful additions in the future */
|
||||||
|
@@ -238,6 +238,9 @@ static inline BaseType_t xPortInIsrContext(void)
|
|||||||
return xPortCheckIfInISR();
|
return xPortCheckIfInISR();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Added for backward compatibility with IDF
|
||||||
|
#define xPortInterruptedFromISRContext() xPortInIsrContext()
|
||||||
|
|
||||||
// ---------------------- Spinlocks ------------------------
|
// ---------------------- Spinlocks ------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -279,21 +282,25 @@ static inline void uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t comp
|
|||||||
/*
|
/*
|
||||||
IDF style critical sections which are orthogonal to FreeRTOS critical sections. However, on single core, the IDF style
|
IDF style critical sections which are orthogonal to FreeRTOS critical sections. However, on single core, the IDF style
|
||||||
critical sections simply disable interrupts, thus we discard the lock and timeout arguments.
|
critical sections simply disable interrupts, thus we discard the lock and timeout arguments.
|
||||||
|
|
||||||
|
Note: The IDF Style critical sections are named differently to their counterparts present in the xtensa port as few IDF
|
||||||
|
examples such as esp_zigbee_gateway, when compiled for RISC-V targets, have a reference to vPortEnterCritical()
|
||||||
|
and vPortExitCritical() from precompiled libraries (.a) thereby failing linking.
|
||||||
*/
|
*/
|
||||||
void vPortEnterCriticalIDF(void);
|
void vPortEnterCritical(void);
|
||||||
void vPortExitCriticalIDF(void);
|
void vPortExitCritical(void);
|
||||||
|
|
||||||
//IDF task critical sections
|
//IDF task critical sections
|
||||||
#define portTRY_ENTER_CRITICAL(lock, timeout) {((void) lock; (void) timeout; vPortEnterCriticalIDF(); pdPASS;)}
|
#define portTRY_ENTER_CRITICAL(lock, timeout) {((void) lock; (void) timeout; vPortEnterCritical(); pdPASS;)}
|
||||||
#define portENTER_CRITICAL_IDF(lock) ({(void) lock; vPortEnterCriticalIDF();})
|
#define portENTER_CRITICAL_IDF(lock) ({(void) lock; vPortEnterCritical();})
|
||||||
#define portEXIT_CRITICAL_IDF(lock) ({(void) lock; vPortExitCriticalIDF();})
|
#define portEXIT_CRITICAL_IDF(lock) ({(void) lock; vPortExitCritical();})
|
||||||
//IDF ISR critical sections
|
//IDF ISR critical sections
|
||||||
#define portTRY_ENTER_CRITICAL_ISR(lock, timeout) {((void) lock; (void) timeout; vPortEnterCriticalIDF(); pdPASS;)}
|
#define portTRY_ENTER_CRITICAL_ISR(lock, timeout) {((void) lock; (void) timeout; vPortEnterCritical(); pdPASS;)}
|
||||||
#define portENTER_CRITICAL_ISR(lock) ({(void) lock; vPortEnterCriticalIDF();})
|
#define portENTER_CRITICAL_ISR(lock) ({(void) lock; vPortEnterCritical();})
|
||||||
#define portEXIT_CRITICAL_ISR(lock) ({(void) lock; vPortExitCriticalIDF();})
|
#define portEXIT_CRITICAL_ISR(lock) ({(void) lock; vPortExitCritical();})
|
||||||
//IDF safe critical sections (they're the same)
|
//IDF safe critical sections (they're the same)
|
||||||
#define portENTER_CRITICAL_SAFE(lock) ({(void) lock; vPortEnterCriticalIDF();})
|
#define portENTER_CRITICAL_SAFE(lock) ({(void) lock; vPortEnterCritical();})
|
||||||
#define portEXIT_CRITICAL_SAFE(lock) ({(void) lock; vPortExitCriticalIDF();})
|
#define portEXIT_CRITICAL_SAFE(lock) ({(void) lock; vPortExitCritical();})
|
||||||
|
|
||||||
// ---------------------- Yielding -------------------------
|
// ---------------------- Yielding -------------------------
|
||||||
|
|
||||||
@@ -307,6 +314,9 @@ static inline bool IRAM_ATTR xPortCanYield(void)
|
|||||||
return (threshold <= 1);
|
return (threshold <= 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Added for backward compatibility with IDF
|
||||||
|
#define portYIELD_WITHIN_API() vTaskYieldWithinAPI()
|
||||||
|
|
||||||
// ----------------------- System --------------------------
|
// ----------------------- System --------------------------
|
||||||
|
|
||||||
void vPortSetStackWatchpoint(void *pxStackStart);
|
void vPortSetStackWatchpoint(void *pxStackStart);
|
||||||
@@ -329,7 +339,7 @@ void vPortSetStackWatchpoint(void *pxStackStart);
|
|||||||
// --------------------- App-Trace -------------------------
|
// --------------------- App-Trace -------------------------
|
||||||
|
|
||||||
#if CONFIG_APPTRACE_SV_ENABLE
|
#if CONFIG_APPTRACE_SV_ENABLE
|
||||||
extern int xPortSwitchFlag;
|
extern volatile BaseType_t xPortSwitchFlag;
|
||||||
#define os_task_switch_is_pended(_cpu_) (xPortSwitchFlag)
|
#define os_task_switch_is_pended(_cpu_) (xPortSwitchFlag)
|
||||||
#else
|
#else
|
||||||
#define os_task_switch_is_pended(_cpu_) (false)
|
#define os_task_switch_is_pended(_cpu_) (false)
|
||||||
|
@@ -38,6 +38,9 @@
|
|||||||
#include "esp_private/pm_trace.h"
|
#include "esp_private/pm_trace.h"
|
||||||
#endif //CONFIG_PM_TRACE
|
#endif //CONFIG_PM_TRACE
|
||||||
|
|
||||||
|
#ifdef CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME
|
||||||
|
#include "esp_gdbstub.h"
|
||||||
|
#endif // CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME
|
||||||
|
|
||||||
/* ---------------------------------------------------- Variables ------------------------------------------------------
|
/* ---------------------------------------------------- Variables ------------------------------------------------------
|
||||||
*
|
*
|
||||||
@@ -63,7 +66,7 @@ static UBaseType_t port_uxCriticalOldInterruptStateIDF = 0;
|
|||||||
|
|
||||||
// ------------------ Critical Sections --------------------
|
// ------------------ Critical Sections --------------------
|
||||||
|
|
||||||
void vPortEnterCriticalIDF(void)
|
void vPortEnterCritical(void)
|
||||||
{
|
{
|
||||||
// Save current interrupt threshold and disable interrupts
|
// Save current interrupt threshold and disable interrupts
|
||||||
UBaseType_t old_thresh = ulPortSetInterruptMask();
|
UBaseType_t old_thresh = ulPortSetInterruptMask();
|
||||||
@@ -75,7 +78,7 @@ void vPortEnterCriticalIDF(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void vPortExitCriticalIDF(void)
|
void vPortExitCritical(void)
|
||||||
{
|
{
|
||||||
if (port_uxCriticalNestingIDF > 0) {
|
if (port_uxCriticalNestingIDF > 0) {
|
||||||
port_uxCriticalNestingIDF--;
|
port_uxCriticalNestingIDF--;
|
||||||
|
Reference in New Issue
Block a user