mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
feat(freertos): Add beta support for FreeRTOS v10.5.1 kernel
This commit adds beta support for the FreeRTOS v10.5.1 kernel which can be enabled by enabling the CONFIG_FREERTOS_USE_KERNEL_10_5_1 option. The following changes have been made: - Updated freertos/CMakeLists.txt to build v10.5.1 kernel with v10.4.3. ports - Updated existing Xtensa and RISC-V ports to work with V10.5.1 - Modifications to other ESP-IDF components to work with v10.5.1 - Added some ESP-IDF specific tracing changes to v10.5.1 kernel - Make CONFIG_FREERTOS_USE_KERNEL_10_5_1 a public option Note: The beta release is missing some minor fixes, performance improvements, and features. Using this beta release for production is not recommended. Closes https://github.com/espressif/esp-idf/issues/7137
This commit is contained in:
parent
49af70506a
commit
b09462eae8
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -85,8 +85,15 @@ void esp_gdbstub_int(__attribute__((unused)) void *frame)
|
||||
/* Pointer to saved frame is in pxCurrentTCB
|
||||
* See rtos_int_enter function
|
||||
*/
|
||||
extern void *pxCurrentTCB;
|
||||
dummy_tcb_t *tcb = pxCurrentTCB;
|
||||
/* Todo: Provide IDF interface for getting pxCurrentTCB (IDF-8182) */
|
||||
int core_id = esp_cpu_get_core_id();
|
||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||
extern void **pxCurrentTCBs;
|
||||
dummy_tcb_t *tcb = pxCurrentTCBs[core_id];
|
||||
#else
|
||||
extern void **pxCurrentTCB;
|
||||
dummy_tcb_t *tcb = pxCurrentTCB[core_id];
|
||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||
gdbstub_handle_uart_int((esp_gdbstub_frame_t *)tcb->top_of_stack);
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ if(CONFIG_FREERTOS_SMP)
|
||||
set(kernel_impl "FreeRTOS-Kernel-SMP")
|
||||
else()
|
||||
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
||||
message(FATAL_ERROR "FreeRTOS v10.5.1 is not buildable yet. Still under development")
|
||||
set(kernel_impl "FreeRTOS-Kernel-V10.5.1")
|
||||
else()
|
||||
set(kernel_impl "FreeRTOS-Kernel")
|
||||
endif()
|
||||
@ -71,30 +71,54 @@ list(APPEND srcs
|
||||
"${kernel_impl}/queue.c"
|
||||
"${kernel_impl}/tasks.c"
|
||||
"${kernel_impl}/timers.c"
|
||||
"${kernel_impl}/croutine.c"
|
||||
"${kernel_impl}/event_groups.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
|
||||
list(APPEND srcs
|
||||
"${kernel_impl}/portable/${arch}/port.c")
|
||||
|
||||
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
|
||||
"${kernel_impl}/portable/${arch}/port_idf.c")
|
||||
endif()
|
||||
"FreeRTOS-Kernel/portable/${arch}/port.c")
|
||||
else()
|
||||
list(APPEND srcs
|
||||
"${kernel_impl}/portable/${arch}/portasm.S")
|
||||
"${kernel_impl}/portable/${arch}/port.c")
|
||||
endif()
|
||||
|
||||
if(arch STREQUAL "linux")
|
||||
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
||||
list(APPEND srcs
|
||||
"FreeRTOS-Kernel/portable/${arch}/utils/wait_for_event.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()
|
||||
else()
|
||||
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
||||
list(APPEND srcs
|
||||
"FreeRTOS-Kernel/portable/${arch}/portasm.S")
|
||||
else()
|
||||
list(APPEND srcs
|
||||
"${kernel_impl}/portable/${arch}/portasm.S")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(arch STREQUAL "xtensa")
|
||||
list(APPEND srcs
|
||||
"${kernel_impl}/portable/${arch}/xtensa_init.c"
|
||||
"${kernel_impl}/portable/${arch}/xtensa_overlay_os_hook.c")
|
||||
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
||||
list(APPEND srcs
|
||||
"FreeRTOS-Kernel/portable/${arch}/xtensa_init.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()
|
||||
|
||||
# Add ESP-additions source files
|
||||
@ -127,9 +151,15 @@ list(APPEND include_dirs
|
||||
"${kernel_impl}/include") # FreeRTOS headers via `#include "freertos/xxx.h"`
|
||||
|
||||
# Add port public include directories
|
||||
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"`
|
||||
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
||||
list(APPEND include_dirs
|
||||
"FreeRTOS-Kernel/portable/${arch}/include" # For port headers via `#include "freertos/...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
|
||||
list(APPEND include_dirs
|
||||
@ -151,8 +181,13 @@ list(APPEND private_include_dirs
|
||||
|
||||
# Add port private include directories
|
||||
if(arch STREQUAL "linux")
|
||||
list(APPEND private_include_dirs
|
||||
"${kernel_impl}/portable/${arch}/") # Linux port `#include "utils/wait_for_event.h"`
|
||||
if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
|
||||
list(APPEND private_include_dirs
|
||||
"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()
|
||||
|
||||
# Add ESP-additions private include directories
|
||||
|
@ -1474,6 +1474,46 @@ typedef StaticStreamBuffer_t StaticMessageBuffer_t;
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/* *INDENT-ON* */
|
||||
|
||||
/*
|
||||
* Default values for trace macros added by ESP-IDF and are not part of Vanilla FreeRTOS
|
||||
*/
|
||||
|
||||
#ifndef traceISR_EXIT_TO_SCHEDULER
|
||||
#define traceISR_EXIT_TO_SCHEDULER()
|
||||
#endif
|
||||
|
||||
#ifndef traceISR_EXIT
|
||||
#define traceISR_EXIT()
|
||||
#endif
|
||||
|
||||
#ifndef traceISR_ENTER
|
||||
#define traceISR_ENTER( _n_ )
|
||||
#endif
|
||||
|
||||
#ifndef traceQUEUE_SEMAPHORE_RECEIVE
|
||||
#define traceQUEUE_SEMAPHORE_RECEIVE( pxQueue )
|
||||
#endif
|
||||
|
||||
#ifndef traceQUEUE_GIVE_FROM_ISR
|
||||
#define traceQUEUE_GIVE_FROM_ISR( pxQueue )
|
||||
#endif
|
||||
|
||||
#ifndef traceQUEUE_GIVE_FROM_ISR_FAILED
|
||||
#define traceQUEUE_GIVE_FROM_ISR_FAILED( pxQueue )
|
||||
#endif
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* *INDENT-ON* */
|
||||
|
||||
/*
|
||||
* Include ESP-IDF API additions implicitly for compatibility reasons.
|
||||
*
|
||||
|
@ -46,6 +46,15 @@ typedef void (* TaskFunction_t)( void * );
|
||||
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000U ) )
|
||||
#endif
|
||||
|
||||
/* Converts a time in ticks to milliseconds. This macro can be
|
||||
* overridden by a macro of the same name defined in FreeRTOSConfig.h in case the
|
||||
* definition here is not suitable for your application.
|
||||
*
|
||||
* Todo: Upstream this macro (IDF-8181) */
|
||||
#ifndef pdTICKS_TO_MS
|
||||
#define pdTICKS_TO_MS( xTicks ) ( ( TickType_t ) ( ( uint64_t ) ( xTicks ) * 1000 / configTICK_RATE_HZ ) )
|
||||
#endif
|
||||
|
||||
#define pdFALSE ( ( BaseType_t ) 0 )
|
||||
#define pdTRUE ( ( BaseType_t ) 1 )
|
||||
|
||||
|
@ -1448,7 +1448,8 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
|
||||
const int8_t cTxLock = queueUNLOCKED;
|
||||
#endif /* queueUSE_LOCKS == 1 */
|
||||
|
||||
traceQUEUE_SEND_FROM_ISR( pxQueue );
|
||||
/* Todo: Reconcile tracing differences (IDF-8183) */
|
||||
traceQUEUE_GIVE_FROM_ISR( pxQueue );
|
||||
|
||||
/* A task can only have an inherited priority if it is a mutex
|
||||
* holder - and if there is a mutex holder then the mutex cannot be
|
||||
@ -1557,7 +1558,8 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
|
||||
}
|
||||
else
|
||||
{
|
||||
traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue );
|
||||
/* Todo: Reconcile tracing differences (IDF-8183) */
|
||||
traceQUEUE_GIVE_FROM_ISR_FAILED( pxQueue );
|
||||
xReturn = errQUEUE_FULL;
|
||||
}
|
||||
}
|
||||
@ -1782,7 +1784,8 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
|
||||
* must be the highest priority task wanting to access the queue. */
|
||||
if( uxSemaphoreCount > ( UBaseType_t ) 0 )
|
||||
{
|
||||
traceQUEUE_RECEIVE( pxQueue );
|
||||
/* Todo: Reconcile tracing differences (IDF-8183) */
|
||||
traceQUEUE_SEMAPHORE_RECEIVE( pxQueue );
|
||||
|
||||
/* Semaphores are queues with a data size of zero and where the
|
||||
* messages waiting is the semaphore's count. Reduce the count. */
|
||||
|
@ -4197,6 +4197,10 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
|
||||
}
|
||||
#endif /* configUSE_IDLE_HOOK */
|
||||
|
||||
/* Call the esp-idf idle hook system. Todo IDF-8180 */
|
||||
extern void esp_vApplicationIdleHook( void );
|
||||
esp_vApplicationIdleHook();
|
||||
|
||||
/* This conditional compilation should use inequality to 0, not equality
|
||||
* to 1. This is to ensure portSUPPRESS_TICKS_AND_SLEEP() is called when
|
||||
* user defined low power mode implementations require
|
||||
|
@ -444,6 +444,11 @@ void vPortTCBPreDeleteHook( void *pxTCB );
|
||||
* - Maps to forward declared functions
|
||||
* ------------------------------------------------------------------------------------------------------------------ */
|
||||
|
||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||
#define portGET_CORE_ID() xPortGetCoreID()
|
||||
#define portYIELD_CORE( x ) vPortYieldOtherCore( x )
|
||||
#endif
|
||||
|
||||
// --------------------- Interrupts ------------------------
|
||||
|
||||
#define portDISABLE_INTERRUPTS() portSET_INTERRUPT_MASK_FROM_ISR()
|
||||
|
@ -8,6 +8,13 @@
|
||||
#include "freertos/FreeRTOSConfig.h"
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||
#define pxCurrentTCB pxCurrentTCBs
|
||||
.extern pxCurrentTCBs
|
||||
#else
|
||||
.extern pxCurrentTCB
|
||||
#endif
|
||||
|
||||
#if CONFIG_ESP_SYSTEM_HW_STACK_GUARD
|
||||
#include "esp_private/hw_stack_guard.h"
|
||||
#endif
|
||||
|
@ -427,6 +427,11 @@ void vPortTCBPreDeleteHook( void *pxTCB );
|
||||
* - Maps to forward declared functions
|
||||
* ------------------------------------------------------------------------------------------------------------------ */
|
||||
|
||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||
#define portGET_CORE_ID() xPortGetCoreID()
|
||||
#define portYIELD_CORE( x ) vPortYieldOtherCore( x )
|
||||
#endif
|
||||
|
||||
// --------------------- Interrupts ------------------------
|
||||
|
||||
/**
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2016-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2015-2019 Cadence Design Systems, Inc.
|
||||
@ -33,7 +33,13 @@
|
||||
|
||||
#define TOPOFSTACK_OFFS 0x00 /* StackType_t *pxTopOfStack */
|
||||
|
||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||
#define pxCurrentTCB pxCurrentTCBs
|
||||
.extern pxCurrentTCBs
|
||||
#else
|
||||
.extern pxCurrentTCB
|
||||
#endif
|
||||
|
||||
#if XCHAL_CP_NUM > 0
|
||||
/* Offsets used to get a task's coprocessor save area (CPSA) from its TCB */
|
||||
.extern offset_pxEndOfStack
|
||||
|
@ -4,11 +4,12 @@ menu "FreeRTOS"
|
||||
# Upstream FreeRTOS configurations go here
|
||||
|
||||
config FREERTOS_USE_KERNEL_10_5_1
|
||||
bool "Use v10.5.1 Kernel (EXPERIMENTAL)"
|
||||
depends on IDF_EXPERIMENTAL_FEATURES
|
||||
bool "Use v10.5.1 Kernel (BETA)"
|
||||
default n
|
||||
help
|
||||
Hidden option for development/testing purposes to enable building with the v10.5.1 kernel
|
||||
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
|
||||
bool "Run the Amazon SMP FreeRTOS kernel instead (FEATURE UNDER DEVELOPMENT)"
|
||||
|
@ -199,6 +199,7 @@
|
||||
#define INCLUDE_xTaskResumeFromISR 1
|
||||
#define INCLUDE_xTimerPendFunctionCall 1
|
||||
#define INCLUDE_xTaskGetSchedulerState 1
|
||||
#define INCLUDE_xTaskGetCurrentTaskHandle 1
|
||||
|
||||
/* -------------------- Trace Macros ----------------------- */
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
||||
|
||||
/* -------------------- API Includes ----------------------- */
|
||||
|
||||
#define INCLUDE_xTaskGetCurrentTaskHandle 0 /* not defined in POSIX simulator */
|
||||
/* Todo: Reconcile INCLUDE_option differences (IDF-8186) */
|
||||
#define INCLUDE_vTaskDelayUntil 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark2 0
|
||||
|
||||
|
@ -28,20 +28,31 @@
|
||||
/* ---------------- Amazon SMP FreeRTOS -------------------- */
|
||||
|
||||
#if CONFIG_FREERTOS_SMP
|
||||
#define configUSE_CORE_AFFINITY 1
|
||||
#define configUSE_CORE_AFFINITY 1
|
||||
|
||||
/* This is always enabled to call IDF style idle hooks, by can be "--Wl,--wrap"
|
||||
* if users enable CONFIG_FREERTOS_USE_MINIMAL_IDLE_HOOK. */
|
||||
#define configUSE_MINIMAL_IDLE_HOOK 1
|
||||
#define configUSE_MINIMAL_IDLE_HOOK 1
|
||||
|
||||
/* IDF Newlib supports dynamic reentrancy. We provide our own __getreent()
|
||||
* function. */
|
||||
#define configNEWLIB_REENTRANT_IS_DYNAMIC 1
|
||||
/* IDF Newlib supports dynamic reentrancy. We provide our own __getreent()
|
||||
* function. */
|
||||
#define configNEWLIB_REENTRANT_IS_DYNAMIC 1
|
||||
#endif
|
||||
|
||||
/* ----------------------- 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.
|
||||
* - 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
|
||||
* pointer. All newlib functions calls __getreent. */
|
||||
#define configINIT_TLS_BLOCK( xTLSBlock ) esp_reent_init( &( xTLSBlock ) )
|
||||
#define configSET_TLS_BLOCK( 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
|
||||
|
||||
@ -61,9 +72,9 @@
|
||||
|
||||
/* -------------------- API Includes ----------------------- */
|
||||
|
||||
#define INCLUDE_xTaskDelayUntil 1
|
||||
#define INCLUDE_xTaskGetCurrentTaskHandle 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark2 1
|
||||
/* Todo: Reconcile INCLUDE_option differences (IDF-8186) */
|
||||
#define INCLUDE_xTaskDelayUntil 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark2 1
|
||||
|
||||
/* ------------------------------------------------ ESP-IDF Additions --------------------------------------------------
|
||||
*
|
||||
|
@ -55,20 +55,31 @@
|
||||
/* ---------------- Amazon SMP FreeRTOS -------------------- */
|
||||
|
||||
#if CONFIG_FREERTOS_SMP
|
||||
#define configUSE_CORE_AFFINITY 1
|
||||
#define configUSE_CORE_AFFINITY 1
|
||||
|
||||
/* This is always enabled to call IDF style idle hooks, by can be "--Wl,--wrap"
|
||||
* if users enable CONFIG_FREERTOS_USE_MINIMAL_IDLE_HOOK. */
|
||||
#define configUSE_MINIMAL_IDLE_HOOK 1
|
||||
#define configUSE_MINIMAL_IDLE_HOOK 1
|
||||
|
||||
/* IDF Newlib supports dynamic reentrancy. We provide our own __getreent()
|
||||
* function. */
|
||||
#define configNEWLIB_REENTRANT_IS_DYNAMIC 1
|
||||
/* IDF Newlib supports dynamic reentrancy. We provide our own __getreent()
|
||||
* function. */
|
||||
#define configNEWLIB_REENTRANT_IS_DYNAMIC 1
|
||||
#endif
|
||||
|
||||
/* ----------------------- 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.
|
||||
* - 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
|
||||
* pointer. All newlib functions calls __getreent. */
|
||||
#define configINIT_TLS_BLOCK( xTLSBlock ) esp_reent_init( &( xTLSBlock ) )
|
||||
#define configSET_TLS_BLOCK( 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
|
||||
|
||||
@ -88,9 +99,9 @@
|
||||
|
||||
/* -------------------- API Includes ----------------------- */
|
||||
|
||||
#define INCLUDE_xTaskDelayUntil 1
|
||||
#define INCLUDE_xTaskGetCurrentTaskHandle 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark2 1
|
||||
/* Todo: Reconcile INCLUDE_option differences (IDF-8186) */
|
||||
#define INCLUDE_xTaskDelayUntil 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark2 1
|
||||
|
||||
/* ------------------------------------------------ ESP-IDF Additions --------------------------------------------------
|
||||
*
|
||||
|
@ -20,6 +20,11 @@
|
||||
* additional API.
|
||||
*/
|
||||
|
||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||
#define pxCurrentTCB pxCurrentTCBs
|
||||
#else
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------- Static Asserts ------------------------------------------------- */
|
||||
|
||||
/*
|
||||
@ -222,10 +227,23 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
||||
|
||||
if( pxNewTCB != NULL )
|
||||
{
|
||||
/* 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. */
|
||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||
{
|
||||
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
|
||||
|
||||
/* 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 * ) 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 )
|
||||
{
|
||||
@ -239,8 +257,17 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
||||
{
|
||||
StackType_t * pxStack;
|
||||
|
||||
/* 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. */
|
||||
#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. */
|
||||
}
|
||||
#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 )
|
||||
{
|
||||
@ -249,6 +276,12 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
||||
|
||||
if( pxNewTCB != NULL )
|
||||
{
|
||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||
{
|
||||
memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
|
||||
}
|
||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||
|
||||
/* Store the stack location in the TCB. */
|
||||
pxNewTCB->pxStack = pxStack;
|
||||
}
|
||||
@ -256,7 +289,15 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
||||
{
|
||||
/* The stack cannot be used as the TCB was not created. Free
|
||||
* it again. */
|
||||
vPortFree( pxStack );
|
||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||
{
|
||||
vPortFreeStack( pxStack );
|
||||
}
|
||||
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||
{
|
||||
vPortFree( pxStack );
|
||||
}
|
||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -356,6 +397,13 @@ _Static_assert( offsetof( StaticTask_t, pxDummy8 ) == offsetof( TCB_t, pxEndOfSt
|
||||
/* The memory used for the task's TCB and stack are passed into this
|
||||
* 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. */
|
||||
|
||||
#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;
|
||||
|
||||
#if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
|
||||
@ -892,7 +940,15 @@ uint8_t * pxTaskGetStackStart( TaskHandle_t xTask )
|
||||
else
|
||||
{
|
||||
/* We have a task; return its reentrant struct. */
|
||||
ret = &pxCurTask->xNewLib_reent;
|
||||
#if CONFIG_FREERTOS_USE_KERNEL_10_5_1
|
||||
{
|
||||
ret = &pxCurTask->xTLSBlock;
|
||||
}
|
||||
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||
{
|
||||
ret = &pxCurTask->xNewLib_reent;
|
||||
}
|
||||
#endif /* CONFIG_FREERTOS_USE_KERNEL_10_5_1 */
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -208,6 +208,17 @@ TaskHandle_t xTaskGetCurrentTaskHandleForCPU( BaseType_t xCoreID )
|
||||
*/
|
||||
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercentForCore( BaseType_t xCoreID );
|
||||
|
||||
#else /* CONFIG_FREERTOS_USE_KERNEL_10_5_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 */
|
||||
|
||||
/**
|
||||
|
@ -12,6 +12,7 @@ components/freertos/FreeRTOS-Kernel/include/freertos/
|
||||
components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/
|
||||
components/freertos/FreeRTOS-Kernel-SMP/include/freertos/
|
||||
components/freertos/FreeRTOS-Kernel-SMP/portable/xtensa/include/freertos/
|
||||
components/freertos/FreeRTOS-Kernel-V10.5.1/include/freertos/
|
||||
|
||||
|
||||
components/log/include/esp_log_internal.h
|
||||
|
Loading…
x
Reference in New Issue
Block a user