mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
change(freertos/idf): Make v10.5.1 the default kernel
This commit makes v10.5.1 the default FreeRTOS kernel in ESP-IDF by removing the CONFIG_FREERTOS_USE_KERNEL_10_5_1 option and v10.4.3 specific code blocks.
This commit is contained in:
parent
2025a77dd6
commit
16ccb31d33
1
Kconfig
1
Kconfig
@ -590,4 +590,3 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
|||||||
- CONFIG_ESPTOOLPY_FLASHFREQ_120M
|
- CONFIG_ESPTOOLPY_FLASHFREQ_120M
|
||||||
- CONFIG_SPIRAM_SPEED_120M
|
- CONFIG_SPIRAM_SPEED_120M
|
||||||
- CONFIG_SPI_FLASH_QUAD_32BIT_ADDR_ENABLE
|
- CONFIG_SPI_FLASH_QUAD_32BIT_ADDR_ENABLE
|
||||||
- CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
|
||||||
|
@ -31,11 +31,7 @@ idf_build_get_property(target IDF_TARGET)
|
|||||||
if(CONFIG_FREERTOS_SMP)
|
if(CONFIG_FREERTOS_SMP)
|
||||||
set(kernel_impl "FreeRTOS-Kernel-SMP")
|
set(kernel_impl "FreeRTOS-Kernel-SMP")
|
||||||
else()
|
else()
|
||||||
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
set(kernel_impl "FreeRTOS-Kernel")
|
||||||
set(kernel_impl "FreeRTOS-Kernel-V10.5.1")
|
|
||||||
else()
|
|
||||||
set(kernel_impl "FreeRTOS-Kernel")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
|
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
|
||||||
@ -73,52 +69,27 @@ list(APPEND srcs
|
|||||||
"${kernel_impl}/timers.c"
|
"${kernel_impl}/timers.c"
|
||||||
"${kernel_impl}/event_groups.c"
|
"${kernel_impl}/event_groups.c"
|
||||||
"${kernel_impl}/stream_buffer.c")
|
"${kernel_impl}/stream_buffer.c")
|
||||||
if(NOT CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
|
||||||
list(APPEND srcs "${kernel_impl}/croutine.c")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Add port source files
|
# Add port source files
|
||||||
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
list(APPEND srcs
|
||||||
list(APPEND srcs
|
"${kernel_impl}/portable/${arch}/port.c")
|
||||||
"FreeRTOS-Kernel/portable/${arch}/port.c")
|
|
||||||
else()
|
|
||||||
list(APPEND srcs
|
|
||||||
"${kernel_impl}/portable/${arch}/port.c")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(arch STREQUAL "linux")
|
if(arch STREQUAL "linux")
|
||||||
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
list(APPEND srcs
|
||||||
|
"${kernel_impl}/portable/${arch}/utils/wait_for_event.c")
|
||||||
|
if(kernel_impl STREQUAL "FreeRTOS-Kernel")
|
||||||
list(APPEND srcs
|
list(APPEND srcs
|
||||||
"FreeRTOS-Kernel/portable/${arch}/utils/wait_for_event.c"
|
"${kernel_impl}/portable/${arch}/port_idf.c")
|
||||||
"FreeRTOS-Kernel/portable/${arch}/port_idf.c")
|
|
||||||
else()
|
|
||||||
list(APPEND srcs
|
|
||||||
"${kernel_impl}/portable/${arch}/utils/wait_for_event.c")
|
|
||||||
if(kernel_impl STREQUAL "FreeRTOS-Kernel")
|
|
||||||
list(APPEND srcs
|
|
||||||
"${kernel_impl}/portable/${arch}/port_idf.c")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
list(APPEND srcs
|
||||||
list(APPEND srcs
|
"${kernel_impl}/portable/${arch}/portasm.S")
|
||||||
"FreeRTOS-Kernel/portable/${arch}/portasm.S")
|
|
||||||
else()
|
|
||||||
list(APPEND srcs
|
|
||||||
"${kernel_impl}/portable/${arch}/portasm.S")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(arch STREQUAL "xtensa")
|
if(arch STREQUAL "xtensa")
|
||||||
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
list(APPEND srcs
|
||||||
list(APPEND srcs
|
"${kernel_impl}/portable/${arch}/xtensa_init.c"
|
||||||
"FreeRTOS-Kernel/portable/${arch}/xtensa_init.c"
|
"${kernel_impl}/portable/${arch}/xtensa_overlay_os_hook.c")
|
||||||
"FreeRTOS-Kernel/portable/${arch}/xtensa_overlay_os_hook.c")
|
|
||||||
else()
|
|
||||||
list(APPEND srcs
|
|
||||||
"${kernel_impl}/portable/${arch}/xtensa_init.c"
|
|
||||||
"${kernel_impl}/portable/${arch}/xtensa_overlay_os_hook.c")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add ESP-additions source files
|
# Add ESP-additions source files
|
||||||
@ -151,15 +122,9 @@ list(APPEND include_dirs
|
|||||||
"${kernel_impl}/include") # FreeRTOS headers via `#include "freertos/xxx.h"`
|
"${kernel_impl}/include") # FreeRTOS headers via `#include "freertos/xxx.h"`
|
||||||
|
|
||||||
# Add port public include directories
|
# Add port public include directories
|
||||||
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
list(APPEND include_dirs
|
||||||
list(APPEND include_dirs
|
"${kernel_impl}/portable/${arch}/include" # For port headers via `#include "freertos/...h"`
|
||||||
"FreeRTOS-Kernel/portable/${arch}/include" # For port headers via `#include "freertos/...h"`
|
"${kernel_impl}/portable/${arch}/include/freertos") # For port headers via `#include "...h"`
|
||||||
"FreeRTOS-Kernel/portable/${arch}/include/freertos") # For port headers via `#include "...h"`
|
|
||||||
else()
|
|
||||||
list(APPEND include_dirs
|
|
||||||
"${kernel_impl}/portable/${arch}/include" # For port headers via `#include "freertos/...h"`
|
|
||||||
"${kernel_impl}/portable/${arch}/include/freertos") # For port headers via `#include "...h"`
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Add ESP-additions public include directories
|
# Add ESP-additions public include directories
|
||||||
list(APPEND include_dirs
|
list(APPEND include_dirs
|
||||||
@ -181,13 +146,8 @@ list(APPEND private_include_dirs
|
|||||||
|
|
||||||
# Add port private include directories
|
# Add port private include directories
|
||||||
if(arch STREQUAL "linux")
|
if(arch STREQUAL "linux")
|
||||||
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
list(APPEND private_include_dirs
|
||||||
list(APPEND private_include_dirs
|
"${kernel_impl}/portable/${arch}/") # Linux port `#include "utils/wait_for_event.h"`
|
||||||
"FreeRTOS-Kernel/portable/${arch}/") # Linux port `#include "utils/wait_for_event.h"`
|
|
||||||
else()
|
|
||||||
list(APPEND private_include_dirs
|
|
||||||
"${kernel_impl}/portable/${arch}/") # Linux port `#include "utils/wait_for_event.h"`
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add ESP-additions private include directories
|
# Add ESP-additions private include directories
|
||||||
|
@ -444,10 +444,13 @@ void vPortTCBPreDeleteHook( void *pxTCB );
|
|||||||
* - Maps to forward declared functions
|
* - Maps to forward declared functions
|
||||||
* ------------------------------------------------------------------------------------------------------------------ */
|
* ------------------------------------------------------------------------------------------------------------------ */
|
||||||
|
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
// ----------------------- System --------------------------
|
||||||
#define portGET_CORE_ID() xPortGetCoreID()
|
|
||||||
#define portYIELD_CORE( x ) vPortYieldOtherCore( x )
|
#if ( configNUMBER_OF_CORES > 1 )
|
||||||
#endif
|
#define portGET_CORE_ID() xPortGetCoreID()
|
||||||
|
#else /* configNUMBER_OF_CORES > 1 */
|
||||||
|
#define portGET_CORE_ID() ((BaseType_t) 0);
|
||||||
|
#endif /* configNUMBER_OF_CORES > 1 */
|
||||||
|
|
||||||
// --------------------- Interrupts ------------------------
|
// --------------------- Interrupts ------------------------
|
||||||
|
|
||||||
@ -560,6 +563,10 @@ void vPortTCBPreDeleteHook( void *pxTCB );
|
|||||||
*/
|
*/
|
||||||
#define portYIELD_WITHIN_API() portYIELD()
|
#define portYIELD_WITHIN_API() portYIELD()
|
||||||
|
|
||||||
|
#if ( configNUMBER_OF_CORES > 1 )
|
||||||
|
#define portYIELD_CORE( xCoreID ) vPortYieldOtherCore( xCoreID )
|
||||||
|
#endif /* configNUMBER_OF_CORES > 1 */
|
||||||
|
|
||||||
// ------------------- Hook Functions ----------------------
|
// ------------------- Hook Functions ----------------------
|
||||||
|
|
||||||
#define portSUPPRESS_TICKS_AND_SLEEP(idleTime) vApplicationSleep(idleTime)
|
#define portSUPPRESS_TICKS_AND_SLEEP(idleTime) vApplicationSleep(idleTime)
|
||||||
|
@ -8,12 +8,7 @@
|
|||||||
#include "freertos/FreeRTOSConfig.h"
|
#include "freertos/FreeRTOSConfig.h"
|
||||||
#include "soc/soc_caps.h"
|
#include "soc/soc_caps.h"
|
||||||
|
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
|
||||||
#define pxCurrentTCB pxCurrentTCBs
|
|
||||||
.extern pxCurrentTCBs
|
.extern pxCurrentTCBs
|
||||||
#else
|
|
||||||
.extern pxCurrentTCB
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CONFIG_ESP_SYSTEM_HW_STACK_GUARD
|
#if CONFIG_ESP_SYSTEM_HW_STACK_GUARD
|
||||||
#include "esp_private/hw_stack_guard.h"
|
#include "esp_private/hw_stack_guard.h"
|
||||||
@ -22,7 +17,7 @@
|
|||||||
.global port_uxInterruptNesting
|
.global port_uxInterruptNesting
|
||||||
.global port_xSchedulerRunning
|
.global port_xSchedulerRunning
|
||||||
.global xIsrStackTop
|
.global xIsrStackTop
|
||||||
.global pxCurrentTCB
|
.global pxCurrentTCBs
|
||||||
.global vTaskSwitchContext
|
.global vTaskSwitchContext
|
||||||
.global xPortSwitchFlag
|
.global xPortSwitchFlag
|
||||||
#if CONFIG_ESP_SYSTEM_HW_STACK_GUARD
|
#if CONFIG_ESP_SYSTEM_HW_STACK_GUARD
|
||||||
@ -38,7 +33,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This function makes the RTOS aware about an ISR entering. It takes the
|
* This function makes the RTOS aware about an ISR entering. It takes the
|
||||||
* current task stack pointer and places it into the pxCurrentTCB.
|
* current task stack pointer and places it into the pxCurrentTCBs.
|
||||||
* It then loads the ISR stack into sp.
|
* It then loads the ISR stack into sp.
|
||||||
* TODO: ISR nesting code improvements ?
|
* TODO: ISR nesting code improvements ?
|
||||||
* In the routines below, let's use a0-a5 registers to let the compiler generate
|
* In the routines below, let's use a0-a5 registers to let the compiler generate
|
||||||
@ -75,18 +70,18 @@ rtos_int_enter:
|
|||||||
ESP_HW_STACK_GUARD_MONITOR_STOP_CUR_CORE a0 a1
|
ESP_HW_STACK_GUARD_MONITOR_STOP_CUR_CORE a0 a1
|
||||||
#endif /* CONFIG_ESP_SYSTEM_HW_STACK_GUARD */
|
#endif /* CONFIG_ESP_SYSTEM_HW_STACK_GUARD */
|
||||||
|
|
||||||
/* Save the current sp in pxCurrentTCB[coreID] and load the ISR stack on to sp */
|
/* Save the current sp in pxCurrentTCBs[coreID] and load the ISR stack on to sp */
|
||||||
#if ( configNUM_CORES > 1 )
|
#if ( configNUM_CORES > 1 )
|
||||||
la a0, pxCurrentTCB /* a0 = &pxCurrentTCB */
|
la a0, pxCurrentTCBs /* a0 = &pxCurrentTCBs */
|
||||||
add a0, a0, a5 /* a0 = &pxCurrentTCB[coreID] // a5 already contains coreID * 4 */
|
add a0, a0, a5 /* a0 = &pxCurrentTCBs[coreID] // a5 already contains coreID * 4 */
|
||||||
lw a0, (a0) /* a0 = pxCurrentTCB[coreID] */
|
lw a0, (a0) /* a0 = pxCurrentTCBs[coreID] */
|
||||||
sw sp, 0(a0) /* pxCurrentTCB[coreID] = sp */
|
sw sp, 0(a0) /* pxCurrentTCBs[coreID] = sp */
|
||||||
la a0, xIsrStackTop /* a0 = &xIsrStackTop */
|
la a0, xIsrStackTop /* a0 = &xIsrStackTop */
|
||||||
add a0, a0, a5 /* a0 = &xIsrStackTop[coreID] // a5 already contains coreID * 4 */
|
add a0, a0, a5 /* a0 = &xIsrStackTop[coreID] // a5 already contains coreID * 4 */
|
||||||
lw sp, (a0) /* sp = xIsrStackTop[coreID] */
|
lw sp, (a0) /* sp = xIsrStackTop[coreID] */
|
||||||
#else
|
#else
|
||||||
lw a0, pxCurrentTCB /* a0 = pxCurrentTCB */
|
lw a0, pxCurrentTCBs /* a0 = pxCurrentTCBs */
|
||||||
sw sp, 0(a0) /* pxCurrentTCB[0] = sp */
|
sw sp, 0(a0) /* pxCurrentTCBs[0] = sp */
|
||||||
lw sp, xIsrStackTop /* sp = xIsrStackTop */
|
lw sp, xIsrStackTop /* sp = xIsrStackTop */
|
||||||
#endif /* ( configNUM_CORES > 1 ) */
|
#endif /* ( configNUM_CORES > 1 ) */
|
||||||
|
|
||||||
@ -180,20 +175,20 @@ no_switch:
|
|||||||
/* Recover the stack of next task and prepare to exit */
|
/* Recover the stack of next task and prepare to exit */
|
||||||
csrr a1, mhartid
|
csrr a1, mhartid
|
||||||
slli a1, a1, 2
|
slli a1, a1, 2
|
||||||
la a0, pxCurrentTCB /* a0 = &pxCurrentTCB */
|
la a0, pxCurrentTCBs /* a0 = &pxCurrentTCBs */
|
||||||
add a0, a0, a1 /* a0 = &pxCurrentTCB[coreID] */
|
add a0, a0, a1 /* a0 = &pxCurrentTCBs[coreID] */
|
||||||
lw a0, 0(a0) /* a0 = pxCurrentTCB[coreID] */
|
lw a0, 0(a0) /* a0 = pxCurrentTCBs[coreID] */
|
||||||
lw sp, 0(a0) /* sp = previous sp */
|
lw sp, 0(a0) /* sp = previous sp */
|
||||||
#else
|
#else
|
||||||
/* Recover the stack of next task */
|
/* Recover the stack of next task */
|
||||||
lw a0, pxCurrentTCB
|
lw a0, pxCurrentTCBs
|
||||||
lw sp, 0(a0)
|
lw sp, 0(a0)
|
||||||
#endif /* ( configNUM_CORES > 1 ) */
|
#endif /* ( configNUM_CORES > 1 ) */
|
||||||
|
|
||||||
|
|
||||||
#if CONFIG_ESP_SYSTEM_HW_STACK_GUARD
|
#if CONFIG_ESP_SYSTEM_HW_STACK_GUARD
|
||||||
/* esp_hw_stack_guard_set_bounds(pxCurrentTCB[0]->pxStack,
|
/* esp_hw_stack_guard_set_bounds(pxCurrentTCBs[0]->pxStack,
|
||||||
* pxCurrentTCB[0]->pxEndOfStack);
|
* pxCurrentTCBs[0]->pxEndOfStack);
|
||||||
*/
|
*/
|
||||||
lw a1, PORT_OFFSET_PX_END_OF_STACK(a0)
|
lw a1, PORT_OFFSET_PX_END_OF_STACK(a0)
|
||||||
lw a0, PORT_OFFSET_PX_STACK(a0)
|
lw a0, PORT_OFFSET_PX_STACK(a0)
|
||||||
|
@ -427,10 +427,13 @@ void vPortTCBPreDeleteHook( void *pxTCB );
|
|||||||
* - Maps to forward declared functions
|
* - Maps to forward declared functions
|
||||||
* ------------------------------------------------------------------------------------------------------------------ */
|
* ------------------------------------------------------------------------------------------------------------------ */
|
||||||
|
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
// ----------------------- System --------------------------
|
||||||
#define portGET_CORE_ID() xPortGetCoreID()
|
|
||||||
#define portYIELD_CORE( x ) vPortYieldOtherCore( x )
|
#if ( configNUMBER_OF_CORES > 1 )
|
||||||
#endif
|
#define portGET_CORE_ID() xPortGetCoreID()
|
||||||
|
#else /* configNUMBER_OF_CORES > 1 */
|
||||||
|
#define portGET_CORE_ID() ((BaseType_t) 0);
|
||||||
|
#endif /* configNUMBER_OF_CORES > 1 */
|
||||||
|
|
||||||
// --------------------- Interrupts ------------------------
|
// --------------------- Interrupts ------------------------
|
||||||
|
|
||||||
@ -523,6 +526,10 @@ extern void _frxt_setup_switch( void ); //Defined in portasm.S
|
|||||||
*/
|
*/
|
||||||
#define portYIELD_WITHIN_API() esp_crosscore_int_send_yield(xPortGetCoreID())
|
#define portYIELD_WITHIN_API() esp_crosscore_int_send_yield(xPortGetCoreID())
|
||||||
|
|
||||||
|
#if ( configNUMBER_OF_CORES > 1 )
|
||||||
|
#define portYIELD_CORE( xCoreID ) vPortYieldOtherCore( xCoreID )
|
||||||
|
#endif /* configNUMBER_OF_CORES > 1 */
|
||||||
|
|
||||||
// ------------------- Hook Functions ----------------------
|
// ------------------- Hook Functions ----------------------
|
||||||
|
|
||||||
#define portSUPPRESS_TICKS_AND_SLEEP(idleTime) vApplicationSleep(idleTime)
|
#define portSUPPRESS_TICKS_AND_SLEEP(idleTime) vApplicationSleep(idleTime)
|
||||||
|
@ -33,12 +33,7 @@
|
|||||||
|
|
||||||
#define TOPOFSTACK_OFFS 0x00 /* StackType_t *pxTopOfStack */
|
#define TOPOFSTACK_OFFS 0x00 /* StackType_t *pxTopOfStack */
|
||||||
|
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
|
||||||
#define pxCurrentTCB pxCurrentTCBs
|
|
||||||
.extern pxCurrentTCBs
|
.extern pxCurrentTCBs
|
||||||
#else
|
|
||||||
.extern pxCurrentTCB
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if XCHAL_CP_NUM > 0
|
#if XCHAL_CP_NUM > 0
|
||||||
/* Offsets used to get a task's coprocessor save area (CPSA) from its TCB */
|
/* Offsets used to get a task's coprocessor save area (CPSA) from its TCB */
|
||||||
@ -154,11 +149,11 @@ _frxt_int_enter:
|
|||||||
s32i a2, a3, 0 /* save nesting count */
|
s32i a2, a3, 0 /* save nesting count */
|
||||||
bnei a2, 1, .Lnested /* !=0 before incr, so nested */
|
bnei a2, 1, .Lnested /* !=0 before incr, so nested */
|
||||||
|
|
||||||
movi a2, pxCurrentTCB
|
movi a2, pxCurrentTCBs
|
||||||
addx4 a2, a4, a2
|
addx4 a2, a4, a2
|
||||||
l32i a2, a2, 0 /* a2 = current TCB */
|
l32i a2, a2, 0 /* a2 = current TCB */
|
||||||
beqz a2, 1f
|
beqz a2, 1f
|
||||||
s32i a1, a2, TOPOFSTACK_OFFS /* pxCurrentTCB->pxTopOfStack = SP */
|
s32i a1, a2, TOPOFSTACK_OFFS /* pxCurrentTCBs->pxTopOfStack = SP */
|
||||||
movi a1, port_IntStack+configISR_STACK_SIZE /* a1 = top of intr stack for CPU 0 */
|
movi a1, port_IntStack+configISR_STACK_SIZE /* a1 = top of intr stack for CPU 0 */
|
||||||
movi a2, configISR_STACK_SIZE /* add configISR_STACK_SIZE * cpu_num to arrive at top of stack for cpu_num */
|
movi a2, configISR_STACK_SIZE /* add configISR_STACK_SIZE * cpu_num to arrive at top of stack for cpu_num */
|
||||||
mull a2, a4, a2
|
mull a2, a4, a2
|
||||||
@ -221,11 +216,11 @@ _frxt_int_exit:
|
|||||||
rsync /* ensure CPENABLE was modified */
|
rsync /* ensure CPENABLE was modified */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
movi a2, pxCurrentTCB
|
movi a2, pxCurrentTCBs
|
||||||
addx4 a2, a4, a2
|
addx4 a2, a4, a2
|
||||||
l32i a2, a2, 0 /* a2 = current TCB */
|
l32i a2, a2, 0 /* a2 = current TCB */
|
||||||
beqz a2, 1f /* no task ? go to dispatcher */
|
beqz a2, 1f /* no task ? go to dispatcher */
|
||||||
l32i a1, a2, TOPOFSTACK_OFFS /* SP = pxCurrentTCB->pxTopOfStack */
|
l32i a1, a2, TOPOFSTACK_OFFS /* SP = pxCurrentTCBs->pxTopOfStack */
|
||||||
|
|
||||||
movi a2, port_switch_flag /* address of switch flag */
|
movi a2, port_switch_flag /* address of switch flag */
|
||||||
addx4 a2, a4, a2 /* point to flag for this cpu */
|
addx4 a2, a4, a2 /* point to flag for this cpu */
|
||||||
@ -433,7 +428,7 @@ _frxt_tick_timer_init:
|
|||||||
* If restoring a task that was preempted, restores all state including the task's CPENABLE.
|
* If restoring a task that was preempted, restores all state including the task's CPENABLE.
|
||||||
*
|
*
|
||||||
* Entry:
|
* Entry:
|
||||||
* pxCurrentTCB points to the TCB of the task to suspend,
|
* pxCurrentTCBs points to the TCB of the task to suspend,
|
||||||
* Because it is tail-called without a true function entrypoint, it needs no 'entry' instruction.
|
* Because it is tail-called without a true function entrypoint, it needs no 'entry' instruction.
|
||||||
*
|
*
|
||||||
* Exit:
|
* Exit:
|
||||||
@ -449,12 +444,12 @@ _frxt_dispatch:
|
|||||||
|
|
||||||
#ifdef __XTENSA_CALL0_ABI__
|
#ifdef __XTENSA_CALL0_ABI__
|
||||||
call0 vTaskSwitchContext // Get next TCB to resume
|
call0 vTaskSwitchContext // Get next TCB to resume
|
||||||
movi a2, pxCurrentTCB
|
movi a2, pxCurrentTCBs
|
||||||
getcoreid a3
|
getcoreid a3
|
||||||
addx4 a2, a3, a2
|
addx4 a2, a3, a2
|
||||||
#else
|
#else
|
||||||
call4 vTaskSwitchContext // Get next TCB to resume
|
call4 vTaskSwitchContext // Get next TCB to resume
|
||||||
movi a2, pxCurrentTCB
|
movi a2, pxCurrentTCBs
|
||||||
getcoreid a3
|
getcoreid a3
|
||||||
addx4 a2, a3, a2
|
addx4 a2, a3, a2
|
||||||
#endif
|
#endif
|
||||||
@ -498,7 +493,7 @@ _frxt_dispatch:
|
|||||||
|
|
||||||
#if XCHAL_CP_NUM > 0
|
#if XCHAL_CP_NUM > 0
|
||||||
/* Restore CPENABLE from task's co-processor save area. */
|
/* Restore CPENABLE from task's co-processor save area. */
|
||||||
movi a2, pxCurrentTCB /* cp_state = */
|
movi a2, pxCurrentTCBs /* cp_state = */
|
||||||
getcoreid a3
|
getcoreid a3
|
||||||
addx4 a2, a3, a2
|
addx4 a2, a3, a2
|
||||||
l32i a2, a2, 0
|
l32i a2, a2, 0
|
||||||
@ -539,7 +534,7 @@ _frxt_dispatch:
|
|||||||
* then tail-calls the dispatcher _frxt_dispatch() to perform the actual context switch
|
* then tail-calls the dispatcher _frxt_dispatch() to perform the actual context switch
|
||||||
*
|
*
|
||||||
* At Entry:
|
* At Entry:
|
||||||
* pxCurrentTCB points to the TCB of the task to suspend
|
* pxCurrentTCBs points to the TCB of the task to suspend
|
||||||
* Callable from C (obeys ABI conventions on entry).
|
* Callable from C (obeys ABI conventions on entry).
|
||||||
*
|
*
|
||||||
* Does not return to caller.
|
* Does not return to caller.
|
||||||
@ -591,13 +586,13 @@ vPortYield:
|
|||||||
call0 _xt_coproc_savecs
|
call0 _xt_coproc_savecs
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
movi a2, pxCurrentTCB
|
movi a2, pxCurrentTCBs
|
||||||
getcoreid a3
|
getcoreid a3
|
||||||
addx4 a2, a3, a2
|
addx4 a2, a3, a2
|
||||||
l32i a2, a2, 0 /* a2 = pxCurrentTCB */
|
l32i a2, a2, 0 /* a2 = pxCurrentTCBs */
|
||||||
movi a3, 0
|
movi a3, 0
|
||||||
s32i a3, sp, XT_SOL_EXIT /* 0 to flag as solicited frame */
|
s32i a3, sp, XT_SOL_EXIT /* 0 to flag as solicited frame */
|
||||||
s32i sp, a2, TOPOFSTACK_OFFS /* pxCurrentTCB->pxTopOfStack = SP */
|
s32i sp, a2, TOPOFSTACK_OFFS /* pxCurrentTCBs->pxTopOfStack = SP */
|
||||||
|
|
||||||
#if XCHAL_CP_NUM > 0
|
#if XCHAL_CP_NUM > 0
|
||||||
/* Clear CPENABLE, also in task's co-processor state save area. */
|
/* Clear CPENABLE, also in task's co-processor state save area. */
|
||||||
@ -623,8 +618,8 @@ vPortYield:
|
|||||||
* _frxt_dispatch() to perform the actual context switch.
|
* _frxt_dispatch() to perform the actual context switch.
|
||||||
*
|
*
|
||||||
* At Entry:
|
* At Entry:
|
||||||
* Interrupted task context has been saved in an interrupt stack frame at pxCurrentTCB->pxTopOfStack.
|
* Interrupted task context has been saved in an interrupt stack frame at pxCurrentTCBs->pxTopOfStack.
|
||||||
* pxCurrentTCB points to the TCB of the task to suspend,
|
* pxCurrentTCBs points to the TCB of the task to suspend,
|
||||||
* Callable from C (obeys ABI conventions on entry).
|
* Callable from C (obeys ABI conventions on entry).
|
||||||
*
|
*
|
||||||
* At Exit:
|
* At Exit:
|
||||||
@ -642,7 +637,7 @@ vPortYieldFromInt:
|
|||||||
|
|
||||||
#if XCHAL_CP_NUM > 0
|
#if XCHAL_CP_NUM > 0
|
||||||
/* Save CPENABLE in task's co-processor save area, and clear CPENABLE. */
|
/* Save CPENABLE in task's co-processor save area, and clear CPENABLE. */
|
||||||
movi a2, pxCurrentTCB /* cp_state = */
|
movi a2, pxCurrentTCBs /* cp_state = */
|
||||||
getcoreid a3
|
getcoreid a3
|
||||||
addx4 a2, a3, a2
|
addx4 a2, a3, a2
|
||||||
l32i a2, a2, 0
|
l32i a2, a2, 0
|
||||||
@ -696,9 +691,9 @@ _frxt_task_coproc_state:
|
|||||||
l32i a15, a15, 0
|
l32i a15, a15, 0
|
||||||
bnez a15, 1f
|
bnez a15, 1f
|
||||||
|
|
||||||
movi a15, pxCurrentTCB
|
movi a15, pxCurrentTCBs
|
||||||
addx4 a15, a3, a15
|
addx4 a15, a3, a15
|
||||||
l32i a15, a15, 0 /* && pxCurrentTCB != 0) { */
|
l32i a15, a15, 0 /* && pxCurrentTCBs != 0) { */
|
||||||
|
|
||||||
beqz a15, 2f
|
beqz a15, 2f
|
||||||
get_cpsa_from_tcb a15, a3 /* After this, pointer to CP save area is in a15, a3 is destroyed */
|
get_cpsa_from_tcb a15, a3 /* After this, pointer to CP save area is in a15, a3 is destroyed */
|
||||||
@ -743,9 +738,9 @@ _frxt_coproc_exc_hook:
|
|||||||
bnez a3, 1f /* We are in an interrupt. Return*/
|
bnez a3, 1f /* We are in an interrupt. Return*/
|
||||||
/* CP operations are incompatible with unpinned tasks. Thus we pin the task
|
/* CP operations are incompatible with unpinned tasks. Thus we pin the task
|
||||||
to the current running core. */
|
to the current running core. */
|
||||||
movi a3, pxCurrentTCB
|
movi a3, pxCurrentTCBs
|
||||||
addx4 a3, a2, a3
|
addx4 a3, a2, a3
|
||||||
l32i a3, a3, 0 /* a3 = pxCurrentTCB[xCurCoreID] */
|
l32i a3, a3, 0 /* a3 = pxCurrentTCBs[xCurCoreID] */
|
||||||
movi a4, offset_xCoreID
|
movi a4, offset_xCoreID
|
||||||
l32i a4, a4, 0 /* a4 = offset_xCoreID */
|
l32i a4, a4, 0 /* a4 = offset_xCoreID */
|
||||||
add a3, a3, a4 /* a3 = &TCB.xCoreID */
|
add a3, a3, a4 /* a3 = &TCB.xCoreID */
|
||||||
|
@ -3,17 +3,9 @@ menu "FreeRTOS"
|
|||||||
menu "Kernel"
|
menu "Kernel"
|
||||||
# Upstream FreeRTOS configurations go here
|
# Upstream FreeRTOS configurations go here
|
||||||
|
|
||||||
config FREERTOS_USE_KERNEL_10_5_1
|
|
||||||
bool "Use v10.5.1 Kernel (BETA)"
|
|
||||||
default n
|
|
||||||
help
|
|
||||||
This option enables building for FreeRTOS v10.5.1 kernel.
|
|
||||||
|
|
||||||
Note: The v10.5.1 kernel is still in BETA, thus is not production ready.
|
|
||||||
|
|
||||||
config FREERTOS_SMP
|
config FREERTOS_SMP
|
||||||
bool "Run the Amazon SMP FreeRTOS kernel instead (FEATURE UNDER DEVELOPMENT)"
|
bool "Run the Amazon SMP FreeRTOS kernel instead (FEATURE UNDER DEVELOPMENT)"
|
||||||
depends on !FREERTOS_USE_KERNEL_10_5_1 && !IDF_TARGET_ESP32P4 #TODO: IDF-8113: Enable P4 support on AMZ SMP
|
depends on !IDF_TARGET_ESP32P4 #TODO: IDF-8113: Enable P4 support on AMZ SMP
|
||||||
default "n"
|
default "n"
|
||||||
help
|
help
|
||||||
Amazon has released an SMP version of the FreeRTOS Kernel which can be found via the following link:
|
Amazon has released an SMP version of the FreeRTOS Kernel which can be found via the following link:
|
||||||
|
@ -248,6 +248,8 @@
|
|||||||
#else
|
#else
|
||||||
#define configNUM_CORES 2
|
#define configNUM_CORES 2
|
||||||
#endif /* CONFIG_FREERTOS_UNICORE */
|
#endif /* CONFIG_FREERTOS_UNICORE */
|
||||||
|
/* For compatibility */
|
||||||
|
#define configNUMBER_OF_CORES configNUM_CORES
|
||||||
#define configRUN_MULTIPLE_PRIORITIES 1
|
#define configRUN_MULTIPLE_PRIORITIES 1
|
||||||
#define configUSE_TASK_PREEMPTION_DISABLE 1
|
#define configUSE_TASK_PREEMPTION_DISABLE 1
|
||||||
#endif /* CONFIG_FREERTOS_SMP */
|
#endif /* CONFIG_FREERTOS_SMP */
|
||||||
|
@ -42,17 +42,14 @@
|
|||||||
/* ----------------------- System -------------------------- */
|
/* ----------------------- System -------------------------- */
|
||||||
|
|
||||||
#define configUSE_NEWLIB_REENTRANT 1
|
#define configUSE_NEWLIB_REENTRANT 1
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
|
||||||
|
|
||||||
/* - FreeRTOS provides default for configTLS_BLOCK_TYPE.
|
/* - FreeRTOS provides default for configTLS_BLOCK_TYPE.
|
||||||
* - We simply provide our own INIT and DEINIT functions
|
* - We simply provide our own INIT and DEINIT functions
|
||||||
* - We set "SET" to a blank macro since there is no need to set the reentrancy
|
* - We set "SET" to a blank macro since there is no need to set the reentrancy
|
||||||
* pointer. All newlib functions calls __getreent. */
|
* pointer. All newlib functions calls __getreent. */
|
||||||
#define configINIT_TLS_BLOCK( xTLSBlock ) esp_reent_init( &( xTLSBlock ) )
|
#define configINIT_TLS_BLOCK( xTLSBlock ) esp_reent_init( &( xTLSBlock ) )
|
||||||
#define configSET_TLS_BLOCK( xTLSBlock )
|
#define configSET_TLS_BLOCK( xTLSBlock )
|
||||||
#define configDEINIT_TLS_BLOCK( xTLSBlock ) _reclaim_reent( &( xTLSBlock ) )
|
#define configDEINIT_TLS_BLOCK( xTLSBlock ) _reclaim_reent( &( xTLSBlock ) )
|
||||||
|
|
||||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
|
|
||||||
#define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 1
|
#define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 1
|
||||||
|
|
||||||
|
@ -69,17 +69,14 @@
|
|||||||
/* ----------------------- System -------------------------- */
|
/* ----------------------- System -------------------------- */
|
||||||
|
|
||||||
#define configUSE_NEWLIB_REENTRANT 1
|
#define configUSE_NEWLIB_REENTRANT 1
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
|
||||||
|
|
||||||
/* - FreeRTOS provides default for configTLS_BLOCK_TYPE.
|
/* - FreeRTOS provides default for configTLS_BLOCK_TYPE.
|
||||||
* - We simply provide our own INIT and DEINIT functions
|
* - We simply provide our own INIT and DEINIT functions
|
||||||
* - We set "SET" to a blank macro since there is no need to set the reentrancy
|
* - We set "SET" to a blank macro since there is no need to set the reentrancy
|
||||||
* pointer. All newlib functions calls __getreent. */
|
* pointer. All newlib functions calls __getreent. */
|
||||||
#define configINIT_TLS_BLOCK( xTLSBlock ) esp_reent_init( &( xTLSBlock ) )
|
#define configINIT_TLS_BLOCK( xTLSBlock ) esp_reent_init( &( xTLSBlock ) )
|
||||||
#define configSET_TLS_BLOCK( xTLSBlock )
|
#define configSET_TLS_BLOCK( xTLSBlock )
|
||||||
#define configDEINIT_TLS_BLOCK( xTLSBlock ) _reclaim_reent( &( xTLSBlock ) )
|
#define configDEINIT_TLS_BLOCK( xTLSBlock ) _reclaim_reent( &( xTLSBlock ) )
|
||||||
|
|
||||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
|
|
||||||
#define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 1
|
#define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 1
|
||||||
|
|
||||||
|
@ -20,11 +20,6 @@
|
|||||||
* additional API.
|
* additional API.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
|
||||||
#define pxCurrentTCB pxCurrentTCBs
|
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ------------------------------------------------- Static Asserts ------------------------------------------------- */
|
/* ------------------------------------------------- Static Asserts ------------------------------------------------- */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -87,7 +82,7 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
|||||||
{
|
{
|
||||||
/* Minor optimization. This function can never switch cores mid
|
/* Minor optimization. This function can never switch cores mid
|
||||||
* execution */
|
* execution */
|
||||||
BaseType_t xCoreID = xPortGetCoreID();
|
BaseType_t xCoreID = portGET_CORE_ID();
|
||||||
BaseType_t xSwitchRequired = pdFALSE;
|
BaseType_t xSwitchRequired = pdFALSE;
|
||||||
|
|
||||||
/* This function should never be called by Core 0. */
|
/* This function should never be called by Core 0. */
|
||||||
@ -110,7 +105,7 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
|||||||
{
|
{
|
||||||
/* Check if core 0 calling xTaskIncrementTick() has
|
/* Check if core 0 calling xTaskIncrementTick() has
|
||||||
* unblocked a task that can be run. */
|
* unblocked a task that can be run. */
|
||||||
if( uxTopReadyPriority > pxCurrentTCB[ xCoreID ]->uxPriority )
|
if( uxTopReadyPriority > pxCurrentTCBs[ xCoreID ]->uxPriority )
|
||||||
{
|
{
|
||||||
xSwitchRequired = pdTRUE;
|
xSwitchRequired = pdTRUE;
|
||||||
}
|
}
|
||||||
@ -126,7 +121,7 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
|||||||
* writer has not explicitly turned time slicing off. */
|
* writer has not explicitly turned time slicing off. */
|
||||||
#if ( ( configUSE_PREEMPTION == 1 ) && ( configUSE_TIME_SLICING == 1 ) )
|
#if ( ( configUSE_PREEMPTION == 1 ) && ( configUSE_TIME_SLICING == 1 ) )
|
||||||
{
|
{
|
||||||
if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ pxCurrentTCB[ xCoreID ]->uxPriority ] ) ) > ( UBaseType_t ) 1 )
|
if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ pxCurrentTCBs[ xCoreID ]->uxPriority ] ) ) > ( UBaseType_t ) 1 )
|
||||||
{
|
{
|
||||||
xSwitchRequired = pdTRUE;
|
xSwitchRequired = pdTRUE;
|
||||||
}
|
}
|
||||||
@ -227,23 +222,12 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
|||||||
|
|
||||||
if( pxNewTCB != NULL )
|
if( pxNewTCB != NULL )
|
||||||
{
|
{
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
|
||||||
{
|
|
||||||
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
|
|
||||||
|
|
||||||
/* Allocate space for the stack used by the task being created.
|
/* Allocate space for the stack used by the task being created.
|
||||||
* The base of the stack memory stored in the TCB so the task can
|
* The base of the stack memory stored in the TCB so the task can
|
||||||
* be deleted later if required. */
|
* be deleted later if required. */
|
||||||
pxNewTCB->pxStack = ( StackType_t * ) pvPortMallocStack( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
pxNewTCB->pxStack = ( StackType_t * ) pvPortMallocStack( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
||||||
}
|
|
||||||
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
{
|
|
||||||
/* Allocate space for the stack used by the task being created.
|
|
||||||
* The base of the stack memory stored in the TCB so the task can
|
|
||||||
* be deleted later if required. */
|
|
||||||
pxNewTCB->pxStack = ( StackType_t * ) pvPortMalloc( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
|
|
||||||
if( pxNewTCB->pxStack == NULL )
|
if( pxNewTCB->pxStack == NULL )
|
||||||
{
|
{
|
||||||
@ -257,17 +241,8 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
|||||||
{
|
{
|
||||||
StackType_t * pxStack;
|
StackType_t * pxStack;
|
||||||
|
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
/* Allocate space for the stack used by the task being created. */
|
||||||
{
|
pxStack = pvPortMallocStack( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation is the stack. */
|
||||||
/* Allocate space for the stack used by the task being created. */
|
|
||||||
pxStack = pvPortMallocStack( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation is the stack. */
|
|
||||||
}
|
|
||||||
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
{
|
|
||||||
/* Allocate space for the stack used by the task being created. */
|
|
||||||
pxStack = pvPortMalloc( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation is the stack. */
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
|
|
||||||
if( pxStack != NULL )
|
if( pxStack != NULL )
|
||||||
{
|
{
|
||||||
@ -276,11 +251,7 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
|||||||
|
|
||||||
if( pxNewTCB != NULL )
|
if( pxNewTCB != NULL )
|
||||||
{
|
{
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
|
||||||
{
|
|
||||||
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
|
|
||||||
/* Store the stack location in the TCB. */
|
/* Store the stack location in the TCB. */
|
||||||
pxNewTCB->pxStack = pxStack;
|
pxNewTCB->pxStack = pxStack;
|
||||||
@ -289,15 +260,7 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
|||||||
{
|
{
|
||||||
/* The stack cannot be used as the TCB was not created. Free
|
/* The stack cannot be used as the TCB was not created. Free
|
||||||
* it again. */
|
* it again. */
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
vPortFreeStack( pxStack );
|
||||||
{
|
|
||||||
vPortFreeStack( pxStack );
|
|
||||||
}
|
|
||||||
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
{
|
|
||||||
vPortFree( pxStack );
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -397,13 +360,7 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
|||||||
/* The memory used for the task's TCB and stack are passed into this
|
/* The memory used for the task's TCB and stack are passed into this
|
||||||
* function - use them. */
|
* function - use them. */
|
||||||
pxNewTCB = ( TCB_t * ) pxTaskBuffer; /*lint !e740 !e9087 Unusual cast is ok as the structures are designed to have the same alignment, and the size is checked by an assert. */
|
pxNewTCB = ( TCB_t * ) pxTaskBuffer; /*lint !e740 !e9087 Unusual cast is ok as the structures are designed to have the same alignment, and the size is checked by an assert. */
|
||||||
|
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
|
||||||
{
|
|
||||||
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
|
|
||||||
pxNewTCB->pxStack = ( StackType_t * ) puxStackBuffer;
|
pxNewTCB->pxStack = ( StackType_t * ) puxStackBuffer;
|
||||||
|
|
||||||
#if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
|
#if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
|
||||||
@ -500,21 +457,11 @@ BaseType_t xTaskGetCoreID( TaskHandle_t xTask )
|
|||||||
|
|
||||||
TaskHandle_t xTaskGetIdleTaskHandleForCore( BaseType_t xCoreID )
|
TaskHandle_t xTaskGetIdleTaskHandleForCore( BaseType_t xCoreID )
|
||||||
{
|
{
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
/* If xTaskGetIdleTaskHandle() is called before the scheduler has been
|
||||||
{
|
* started, then xIdleTaskHandle will be NULL. */
|
||||||
/* If xTaskGetIdleTaskHandle() is called before the scheduler has been
|
configASSERT( ( xCoreID < configNUMBER_OF_CORES ) && ( xCoreID != tskNO_AFFINITY ) );
|
||||||
* started, then xIdleTaskHandle will be NULL. */
|
configASSERT( ( xIdleTaskHandle[ xCoreID ] != NULL ) );
|
||||||
configASSERT( ( xCoreID < configNUMBER_OF_CORES ) && ( xCoreID != tskNO_AFFINITY ) );
|
return xIdleTaskHandle[ xCoreID ];
|
||||||
configASSERT( ( xIdleTaskHandle[ xCoreID ] != NULL ) );
|
|
||||||
return xIdleTaskHandle[ xCoreID ];
|
|
||||||
}
|
|
||||||
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
{
|
|
||||||
configASSERT( xCoreID >= 0 && xCoreID < configNUM_CORES );
|
|
||||||
configASSERT( ( xIdleTaskHandle[ xCoreID ] != NULL ) );
|
|
||||||
return ( TaskHandle_t ) xIdleTaskHandle[ xCoreID ];
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* INCLUDE_xTaskGetIdleTaskHandle */
|
#endif /* INCLUDE_xTaskGetIdleTaskHandle */
|
||||||
@ -526,7 +473,11 @@ BaseType_t xTaskGetCoreID( TaskHandle_t xTask )
|
|||||||
{
|
{
|
||||||
TaskHandle_t xReturn;
|
TaskHandle_t xReturn;
|
||||||
|
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
#if ( CONFIG_FREERTOS_SMP )
|
||||||
|
{
|
||||||
|
xReturn = xTaskGetCurrentTaskHandleCPU( ( UBaseType_t ) xCoreID );
|
||||||
|
}
|
||||||
|
#else /* CONFIG_FREERTOS_SMP */
|
||||||
{
|
{
|
||||||
configASSERT( xCoreID < configNUMBER_OF_CORES );
|
configASSERT( xCoreID < configNUMBER_OF_CORES );
|
||||||
configASSERT( xCoreID != tskNO_AFFINITY );
|
configASSERT( xCoreID != tskNO_AFFINITY );
|
||||||
@ -542,26 +493,7 @@ BaseType_t xTaskGetCoreID( TaskHandle_t xTask )
|
|||||||
/* Release the previously taken kernel lock. */
|
/* Release the previously taken kernel lock. */
|
||||||
taskEXIT_CRITICAL_SMP_ONLY( &xKernelLock );
|
taskEXIT_CRITICAL_SMP_ONLY( &xKernelLock );
|
||||||
}
|
}
|
||||||
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
#endif /* CONFIG_FREERTOS_SMP */
|
||||||
{
|
|
||||||
#if CONFIG_FREERTOS_SMP
|
|
||||||
{
|
|
||||||
xReturn = xTaskGetCurrentTaskHandleCPU( xCoreID );
|
|
||||||
}
|
|
||||||
#else /* CONFIG_FREERTOS_SMP */
|
|
||||||
{
|
|
||||||
if( xCoreID < configNUM_CORES )
|
|
||||||
{
|
|
||||||
xReturn = pxCurrentTCB[ xCoreID ];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
xReturn = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_FREERTOS_SMP */
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
@ -569,7 +501,7 @@ BaseType_t xTaskGetCoreID( TaskHandle_t xTask )
|
|||||||
#endif /* ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) ) */
|
#endif /* ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) ) */
|
||||||
/*----------------------------------------------------------*/
|
/*----------------------------------------------------------*/
|
||||||
|
|
||||||
#if ( CONFIG_FREERTOS_USE_KERNEL_10_5_1 && ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) )
|
#if ( !CONFIG_FREERTOS_SMP && ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) )
|
||||||
|
|
||||||
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimeCounterForCore( BaseType_t xCoreID )
|
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimeCounterForCore( BaseType_t xCoreID )
|
||||||
{
|
{
|
||||||
@ -590,10 +522,10 @@ BaseType_t xTaskGetCoreID( TaskHandle_t xTask )
|
|||||||
return ulRunTimeCounter;
|
return ulRunTimeCounter;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* ( CONFIG_FREERTOS_USE_KERNEL_10_5_1 && ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) ) */
|
#endif /* ( !CONFIG_FREERTOS_SMP && ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) ) */
|
||||||
/*----------------------------------------------------------*/
|
/*----------------------------------------------------------*/
|
||||||
|
|
||||||
#if ( CONFIG_FREERTOS_USE_KERNEL_10_5_1 && ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) )
|
#if ( !CONFIG_FREERTOS_SMP && ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) )
|
||||||
|
|
||||||
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercentForCore( BaseType_t xCoreID )
|
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercentForCore( BaseType_t xCoreID )
|
||||||
{
|
{
|
||||||
@ -627,7 +559,7 @@ BaseType_t xTaskGetCoreID( TaskHandle_t xTask )
|
|||||||
return ulReturn;
|
return ulReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* ( CONFIG_FREERTOS_USE_KERNEL_10_5_1 && ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) ) */
|
#endif /* ( !CONFIG_FREERTOS_SMP && ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) ) */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
uint8_t * pxTaskGetStackStart( TaskHandle_t xTask )
|
uint8_t * pxTaskGetStackStart( TaskHandle_t xTask )
|
||||||
@ -940,15 +872,15 @@ uint8_t * pxTaskGetStackStart( TaskHandle_t xTask )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* We have a task; return its reentrant struct. */
|
/* We have a task; return its reentrant struct. */
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
#if ( CONFIG_FREERTOS_SMP )
|
||||||
{
|
|
||||||
ret = &pxCurTask->xTLSBlock;
|
|
||||||
}
|
|
||||||
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
{
|
{
|
||||||
ret = &pxCurTask->xNewLib_reent;
|
ret = &pxCurTask->xNewLib_reent;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
#else /* CONFIG_FREERTOS_SMP */
|
||||||
|
{
|
||||||
|
ret = &pxCurTask->xTLSBlock;
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_FREERTOS_SMP */
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -1188,16 +1120,12 @@ void * pvTaskGetCurrentTCBForCore( BaseType_t xCoreID )
|
|||||||
void * pvRet;
|
void * pvRet;
|
||||||
|
|
||||||
configASSERT( ( xCoreID >= 0 ) && ( xCoreID < configNUM_CORES ) );
|
configASSERT( ( xCoreID >= 0 ) && ( xCoreID < configNUM_CORES ) );
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
#if CONFIG_FREERTOS_SMP
|
||||||
|
/* SMP FreeRTOS defines pxCurrentTCB as a macro function call */
|
||||||
|
pvRet = ( void * ) pxCurrentTCB;
|
||||||
|
#else /* CONFIG_FREERTOS_SMP */
|
||||||
pvRet = ( void * ) pxCurrentTCBs[ xCoreID ];
|
pvRet = ( void * ) pxCurrentTCBs[ xCoreID ];
|
||||||
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
#endif /* CONFIG_FREERTOS_SMP */
|
||||||
#if CONFIG_FREERTOS_SMP
|
|
||||||
/* SMP FreeRTOS defines pxCurrentTCB as a macro function call */
|
|
||||||
pvRet = pxCurrentTCB;
|
|
||||||
#else /* CONFIG_FREERTOS_SMP */
|
|
||||||
pvRet = ( void * ) pxCurrentTCB[ xCoreID ];
|
|
||||||
#endif /* CONFIG_FREERTOS_SMP */
|
|
||||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
return pvRet;
|
return pvRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ TaskHandle_t xTaskGetCurrentTaskHandleForCPU( BaseType_t xCoreID )
|
|||||||
}
|
}
|
||||||
/** @endcond */
|
/** @endcond */
|
||||||
|
|
||||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
#if ( !CONFIG_FREERTOS_SMP && ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the total execution of a particular core's idle task
|
* @brief Get the total execution of a particular core's idle task
|
||||||
@ -208,18 +208,7 @@ TaskHandle_t xTaskGetCurrentTaskHandleForCPU( BaseType_t xCoreID )
|
|||||||
*/
|
*/
|
||||||
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercentForCore( BaseType_t xCoreID );
|
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercentForCore( BaseType_t xCoreID );
|
||||||
|
|
||||||
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
#endif /* ( !CONFIG_FREERTOS_SMP && ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) ) */
|
||||||
|
|
||||||
/* CMock Workaround: CMock currently doesn't preprocess files, thus functions
|
|
||||||
* guarded by ifdef still get mocked. We provide a dummy define here so that
|
|
||||||
* functions using configRUN_TIME_COUNTER_TYPE can still be mocked.
|
|
||||||
*
|
|
||||||
* Todo: Will be removed when V10.5.1 becomes the default kernel. */
|
|
||||||
#ifndef configRUN_TIME_COUNTER_TYPE
|
|
||||||
#define configRUN_TIME_COUNTER_TYPE unsigned int
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the start of the stack associated with xTask.
|
* Returns the start of the stack associated with xTask.
|
||||||
|
@ -171,8 +171,7 @@ entries:
|
|||||||
tasks:ulTaskGenericNotifyValueClear (default)
|
tasks:ulTaskGenericNotifyValueClear (default)
|
||||||
if FREERTOS_GENERATE_RUN_TIME_STATS = y:
|
if FREERTOS_GENERATE_RUN_TIME_STATS = y:
|
||||||
tasks:ulTaskGetIdleRunTimeCounter (default)
|
tasks:ulTaskGetIdleRunTimeCounter (default)
|
||||||
if FREERTOS_USE_KERNEL_10_5_1 = y:
|
tasks:ulTaskGetIdleRunTimePercent (default)
|
||||||
tasks:ulTaskGetIdleRunTimePercent (default)
|
|
||||||
tasks:prvAddCurrentTaskToDelayedList (default)
|
tasks:prvAddCurrentTaskToDelayedList (default)
|
||||||
if FREERTOS_USE_TRACE_FACILITY = y:
|
if FREERTOS_USE_TRACE_FACILITY = y:
|
||||||
tasks:uxTaskGetSystemState (default)
|
tasks:uxTaskGetSystemState (default)
|
||||||
@ -195,8 +194,7 @@ entries:
|
|||||||
timers:uxTimerGetReloadMode (default)
|
timers:uxTimerGetReloadMode (default)
|
||||||
timers:xTimerGetExpiryTime (default)
|
timers:xTimerGetExpiryTime (default)
|
||||||
timers:pcTimerGetName (default)
|
timers:pcTimerGetName (default)
|
||||||
if FREERTOS_USE_KERNEL_10_5_1 = y:
|
timers:prvReloadTimer (default)
|
||||||
timers:prvReloadTimer (default)
|
|
||||||
timers:prvProcessExpiredTimer (default)
|
timers:prvProcessExpiredTimer (default)
|
||||||
timers:prvTimerTask (default)
|
timers:prvTimerTask (default)
|
||||||
timers:prvProcessTimerOrBlockTask (default)
|
timers:prvProcessTimerOrBlockTask (default)
|
||||||
|
@ -28,7 +28,7 @@ entries:
|
|||||||
tasks:xTaskGetCoreID (default)
|
tasks:xTaskGetCoreID (default)
|
||||||
tasks:xTaskGetIdleTaskHandleForCore (default)
|
tasks:xTaskGetIdleTaskHandleForCore (default)
|
||||||
tasks:xTaskGetCurrentTaskHandleForCore (default)
|
tasks:xTaskGetCurrentTaskHandleForCore (default)
|
||||||
if FREERTOS_USE_KERNEL_10_5_1 = y && FREERTOS_GENERATE_RUN_TIME_STATS = y:
|
if FREERTOS_SMP = n && FREERTOS_GENERATE_RUN_TIME_STATS = y:
|
||||||
tasks:ulTaskGetIdleRunTimeCounterForCore (default)
|
tasks:ulTaskGetIdleRunTimeCounterForCore (default)
|
||||||
tasks:ulTaskGetIdleRunTimePercentForCore (default)
|
tasks:ulTaskGetIdleRunTimePercentForCore (default)
|
||||||
tasks:pxTaskGetStackStart (default)
|
tasks:pxTaskGetStackStart (default)
|
||||||
|
Loading…
Reference in New Issue
Block a user