refactor(freertos/idf): Move IDF FreeRTOS API additions to header files
Closes IDF-7201, IDF-3873, and IDF-7907
See merge request espressif/esp-idf!25615
This commit moves/merges the IDF FreeRTOS "PinnedToCore" task creation
functions from tasks.c/task.h to idf_additions.h/freertos_task_c_additions.h.
Also updated FreeRTOS Mock component to provide mocks for "idf_additions.h"
headers for our mock tests.
A weak xTimerCreateTimerTask() was added to tasks.c as a workaround in ESP-IDF
in order to prevent timers.c from being linked when unused.
This commit moves that workaround to `freertos_tasks_c_additions.h`
The following application hook protoypes are defined in task.h from FreeRTOS
V10.4.0 onwwards and no longer need to be declared in tasks.c, thus have been
removed:
- vApplicationStackOverflowHook()
- vApplicationTickHook()
- vApplicationGetIdleTaskMemory()
This function moves ulTaskNotifyTake()/xTaskNotifyWait() from IDF FreeRTOS
`tasks.c` to `freertos_compatibility.c`. These functions were kept for
pre-compiled library compatibilty. Move them reduces the kernel source code
difference when compared to upstream FreeRTOS.
This commit combines various task utility API additions in IDF FreeRTOS and with
their Amazon SMP FreeRTOS addition counterparts. The folloiwng functions have
been moved to freertos_tasks_c_additions.h and idf_additions.h as these API
are considered public:
- xTaskGetCurrentTaskHandleForCPU()
- xTaskGetIdleTaskHandleForCPU()
- xTaskGetAffinity()
- pxTaskGetStackStart()
Also fixed in missing #if macros when vTaskCoreAffinityGet() is called in
Amazon SMP FreerTOS tests.
This commit moves xTaskIncrementTickOtherCores() to freertos_tasks_c_additions.h
and freertos_idf_additions_priv.h (as API is private). This reduces the code
differences cmpared to upstream FreeRTOS.
- The following IDF API additions are moved to freertos_tasks_c_additions.h
(implementation) and freertos_idf_additions_priv.h (declaration) as APIs are
private. This reduces the source code difference from upstream.
- prvENTER_CRITICAL_OR_SUSPEND_ALL()
- prvEXIT_CRITICAL_OR_RESUME_ALL()
- prvENTER_CRITICAL_OR_MASK_ISR()
- prvEXIT_CRITICAL_OR_UNMASK_ISR()
- vTaskTakeKernelLock()
- vTaskReleaseKernelLock()
- Rename vTask[Take/Release]KernelLock() to prv[Take/Release]KernelLock() to
indicate that the this API is private.
- Move vTaskStartSchedulerOtherCores()
- implementation to freertos_tasks_c_additions.h
- declaration to freertos_idf_additions_priv.h as API is private
- Rename vTaskStartSchedulerOtherCores() -> prvStartSchedulerOtherCores() to
indicate that the function is private.
This commit adds an implicit inclusion of `idf_additions.h` to `FreeRTOS.h` in
preparation for moving some IDf specific API to `idf_additions.h`.
This implict inclusion allows existing code to be continue using these
relocated APIs without any changes in header inclusions.
Also removed "#pragma once" directive from "freertos_tasks_c_additions.h" since
that header is included as a source file.