From 7e5a7921fe28a4a657f421e7137e718a552c761b Mon Sep 17 00:00:00 2001 From: Alexey Lapshin Date: Thu, 23 Jun 2022 01:22:20 +0400 Subject: [PATCH] freertos: fix inlining for xtensa port --- .../portable/riscv/include/freertos/portmacro.h | 6 +++--- .../portable/xtensa/include/freertos/portmacro.h | 8 ++++---- components/idf_test/include/idf_performance.h | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h b/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h index 3eb52136ff..7d1a35f751 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h +++ b/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h @@ -274,7 +274,7 @@ void vPortYieldOtherCore(BaseType_t coreid); * @return true Core can yield * @return false Core cannot yield */ -static inline bool xPortCanYield(void); +FORCE_INLINE_ATTR bool xPortCanYield(void); // ------------------- Hook Functions ---------------------- @@ -315,7 +315,7 @@ void vPortSetStackWatchpoint(void *pxStackStart); * @note [refactor-todo] IDF should call a FreeRTOS like macro instead of port function directly * @return BaseType_t Core ID */ -static inline BaseType_t IRAM_ATTR xPortGetCoreID(void) +FORCE_INLINE_ATTR BaseType_t xPortGetCoreID(void) { return (BaseType_t) cpu_hal_get_core_id(); } @@ -452,7 +452,7 @@ static inline void uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t comp // ---------------------- Yielding ------------------------- -static inline bool IRAM_ATTR xPortCanYield(void) +FORCE_INLINE_ATTR bool xPortCanYield(void) { uint32_t threshold = REG_READ(INTERRUPT_CORE0_CPU_INT_THRESH_REG); /* when enter critical code, FreeRTOS will mask threshold to RVHAL_EXCM_LEVEL diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h index 0b3e7c0a37..75ce78d2ed 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h @@ -364,7 +364,7 @@ void vPortYieldOtherCore(BaseType_t coreid); * @return true Core can yield * @return false Core cannot yield */ -static inline bool xPortCanYield(void); +FORCE_INLINE_ATTR bool xPortCanYield(void); // ------------------- Hook Functions ---------------------- @@ -403,7 +403,7 @@ void vPortSetStackWatchpoint( void *pxStackStart ); * @note [refactor-todo] IDF should call a FreeRTOS like macro instead of port function directly * @return BaseType_t Core ID */ -static inline BaseType_t xPortGetCoreID(void); +FORCE_INLINE_ATTR BaseType_t xPortGetCoreID(void); /** * @brief Wrapper for atomic compare-and-set instruction @@ -637,7 +637,7 @@ static inline void __attribute__((always_inline)) vPortExitCriticalSafe(portMUX_ // ---------------------- Yielding ------------------------- -static inline bool IRAM_ATTR xPortCanYield(void) +FORCE_INLINE_ATTR bool xPortCanYield(void) { uint32_t ps_reg = 0; @@ -656,7 +656,7 @@ static inline bool IRAM_ATTR xPortCanYield(void) // ----------------------- System -------------------------- -static inline BaseType_t IRAM_ATTR xPortGetCoreID(void) +FORCE_INLINE_ATTR BaseType_t xPortGetCoreID(void) { return (BaseType_t) cpu_hal_get_core_id(); } diff --git a/components/idf_test/include/idf_performance.h b/components/idf_test/include/idf_performance.h index 3e8532e4a7..86f08dee68 100644 --- a/components/idf_test/include/idf_performance.h +++ b/components/idf_test/include/idf_performance.h @@ -10,7 +10,7 @@ */ #ifndef IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP -#define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP 300 // TODO: IDF-5178 +#define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP 215 #endif #ifndef IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP_PSRAM #define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP_PSRAM 300 @@ -26,7 +26,7 @@ microbenchmark currently runs slower with PSRAM enabled. */ #if !CONFIG_FREERTOS_SMP // IDF-5224 #ifndef IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME -#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME 25000 // TODO: IDF-5179 +#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME 20000 #endif #ifndef IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME_PSRAM #define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME_PSRAM 25000 @@ -42,13 +42,13 @@ // throughput performance by iperf #ifndef IDF_PERFORMANCE_MIN_TCP_RX_THROUGHPUT -#define IDF_PERFORMANCE_MIN_TCP_RX_THROUGHPUT 40 // TODO: IDF-5221 +#define IDF_PERFORMANCE_MIN_TCP_RX_THROUGHPUT 45 #endif #ifndef IDF_PERFORMANCE_MIN_TCP_TX_THROUGHPUT #define IDF_PERFORMANCE_MIN_TCP_TX_THROUGHPUT 40 #endif #ifndef IDF_PERFORMANCE_MIN_UDP_RX_THROUGHPUT -#define IDF_PERFORMANCE_MIN_UDP_RX_THROUGHPUT 60 // TODO: IDF-5221 +#define IDF_PERFORMANCE_MIN_UDP_RX_THROUGHPUT 64 #endif #ifndef IDF_PERFORMANCE_MIN_UDP_TX_THROUGHPUT #define IDF_PERFORMANCE_MIN_UDP_TX_THROUGHPUT 50