This commit fixes a potential issue of illegal memory access when
accessing the various task lists in FreeRTOS while fetching tasks using
the xTaskGetNext() function.
This commit updates the dependency for
CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER to be dependent explicitly on
CONFIG_ESP_SYSTEM_PANIC_GDBSTUB or CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME
instead of CONFIG_ESP_GDBSTUB_ENABLED which caused FreeRTOS Task
Function Wrappers to be enabled even if the esp_gdbstub component was
part of the build.
This commit deprecates the "freertos/xtensa_context.h" and "xtensa/xtensa_context.h"
include paths. Users should use "xtensa_context.h" instead.
- Replace legacy include paths
- Removed some unnecessary includes of "xtensa_api.h"
- Add warning to compatibility header
This commit deprecates the "freertos/xtensa_api.h" and "xtensa/xtensa_api.h"
include paths. Users should use "xtensa_api.h" instead.
- Replace legacy include paths
- Removed some unnecessary includes of "xtensa_api.h"
- Replaced some calls with "esp_cpu_..." equivalents
- Add warning to compatibility header
IDF FreeRTOS v10.5.1 no longer accepts out of range xCoreID arguments in
"PinnedToCore" task creation functions when building for single-core. This
commit fixes those violations through ESP-IDF.
This commit does the following:
- removes the xCoreID member from the TCB when building for single-core
- xCoreID is no longer hard set to 0 when calling "PinnedToCore" task creation
functions in single-core
- Tidy up or add missing xCoreID asserts for functions that take xCoreID as an
argument:
- Functions that set/query a variable of a particular core will call
taskVALID_CORE_ID() to ensure ) 0 <= xCoreID < configNUMBER_OF_CORES
- Task creation functions that accept xCoreID also call taskVALID_CORE_ID()
but also allow tskNO_AFFINITY.
- Fix TaskStatus_t
- Remove xCoreID from TaskStatus_t if configTASKLIST_INCLUDE_COREID is not
defined.
- Set xCoreID to 0 when calling vTaskGetInfo() in single-core builds
This commit refactors the following macros so that calling them no longer
requires referencing pxTCB->xCoreID.
- taskIS_YIELD_REQUIRED()
- taskIS_YIELD_REQUIRED_USING_PRIORITY()
- taskIS_AFFINITY_COMPATIBLE()
This commit adds a taskVALID_CORE_ID() macro, similar to the one offered in
Amazon SMP FreeRTOS.
- Various functions have been updated to use that macro
- Removed some unecessary static asserts of CONFIG_FREERTOS_NO_AFFINITY and
added casting.
- Uncrustify changes
It was noticed that when high level compiler optimizations are enabled,
the compiler optimizes some list manupulation code. This commit enables
the configLIST_VOLATILE for list elements to prevent the compiler from
optimizing out essential kernel code.
This commit refactors some of the thread safety convenience macros by removing
some repeated definitions and keeping them all in "freertos_idf_additions_priv.h"
* The function was based on an outdated IDF/FreeRTOS
combination which didn't always require zero-ing
the TCB. This has been changed in the current
IDF/FreeRTOS combination, leading to crashes.
Unconditionally zero-ing the TCB fixes this problem.
This commit mainly targets the ESP32-P4. It adds supports for coprocessors on
RISC-V based targets. The coprocessor save area, describing the used coprocessors
is stored at the end of the stack of each task (highest address) whereas each
coprocessor save area is allocated at the beginning of the task (lowest address).
The context of each coprocessor is saved lazily, by the task that want to use it.
This commit does the following:
- Update doxygen comments in FreeRTOS headers to remove unsupported doxygen
labels and internal functions
- Fixed existing doxygen warnings in FreeRTOS headers
This commit temporarily disables a bugfixed introduced by FreeRTOS v10.5.1 that
ensures timed out tasks will only preempt if their priority is higher than the
currently running task.
This bugfix has been temporarily reversed due to some compatibility issues with
some IDF tests.
This commit adds a workaround for a compiler optimization issue in FreeRTOS
v10.5.1 in xTaskResumeAll() where pxTCB is only read once, even if in a loop.
A follow up ticket has been added to properly resolve this issue.
This commit optimizes the following utility functions to achieve higher
overall system performance:
xTaskGetCurrentTaskHandle():
- Made into stand alone function instead of wrapper call to "ForCore" variant
- Replaced critical sections with disabling interrupts. Lack of lock contention
improves performance.
xTaskGetCurrentTaskHandleForCore():
- Removed unecessary critical sections
xTaskGetSchedulerState():
- Replaced critical sections with disabling interrupts. Lack of lock contention
improves performance.
Previously the linux port of FreeRTOS set configMAX_PRIORITIES to 7. However,
multiple linux POSIX simulator examples will call API that create tasks with
priortiies >= 7.
This commit fixes the configMAX_PRIORITIES and unifies all ports to have 25
priorities.
Various convenience macros in tasks.c will simply leave macro arguments unused
when built for single-core. This leads to an 'unused variable' warning.
This commit updates those macrso so that the unused arguments have a
'(void)' statement.
Following the upgrade to FreeRTOS kernel v10.5.1, this commit updates the
version numbers, licenses, and SBOM files of FreeRTOS files to reflect v10.5.1.
Note:
- Updated licenses as v10.5.1 now uses SPDX format
- Removed CVE-2021-43997 as it was fixed post v10.4.5
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 removes the v10.4.3 kernel files in prepartion for upgrading to
v10.5.1.
- Portable files still remain
- Added as a separate commit to preserve commit history
* Added prvTaskCreateDynamicAffinitySetWithCaps
and prvTaskCreateDynamicPinnedToCoreWithCaps
which allocate the task's stack in PSRAM instead of
internal RAM. These functions are only available if
PSRAM is enabled.
This commit fixes an issue where xPortCanYield() function may not be
able to detect an ISR context when HW interrupt nesting is active on
a CLIC interrupt controller such as on esp32p4.
This commit adds `pvTaskGetCurrentTCBForCore()` to get a void pointer to the
current TCB of a particular core. This removes the need to `extern `pxCurrentTCB`
in esp_gdbstub.
This commit deprecates the `#include "freertos/task_snapshot.h" include path:
- Adds compatibility header with compile time warning
- Removes hints related to `task_snapshot.h`
- Adds entry to migration guide
Task snapshot API were never intended to be called from user code. This commit
makes task snapshot a private API thus moves `#include "freertos/task_snapshot.h"`
to `#include "esp_private/freertos_debug.h"`.
Task snapshot related Kconfig options have also been hidden.
Note: Added 'freertos_common' mapping to ldgen mapping execptions lists due to
inlining of 'freertos_debug.h' functions.
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