Commit Graph

12 Commits

Author SHA1 Message Date
Darian Leung
0cf1fd3a5a freertos: Add multi-core OS startup race condition workaround
FreeRTOS uses a single "xSchedulerRunning" variable to tack whether the
scheduler has started, and this variable is set to "pdTRUE" by core 0
via calling vTaskStartScheduler().

However, with SMP FreeRTOS, there is a race condition where core 0 has
already started the scheduler and another core has not called xPortStartScheduler()
yet and calls some FreeRTOS API. Thus the resultant FreeRTOS API can
cause errors as it thinks the scheduler has started.

This commit adds a temporary workaround (by having each core maintain their
own "xSchedulerRunning" variable.
2022-06-30 20:24:53 +08:00
Sudeep Mohanty
e3e2ac979a freertos-smp: update FreeRTOS SMP kernel
This commit updates the FreeRTOS SMP kernel to commit id 2eff03708
from the upstream smp branch, which is the latest as on date.
2022-06-23 11:56:20 +00:00
Sudeep Mohanty
7726f343e8 freertos-smp: Update prvYieldCore() to fix compile warning
prvYieldCore() leads to an array-out-of-bounds error when compiled with
-Os optimization and configNUM_CORES = 1. This commit avoids this
compile warning by compiling out the part of code which is unnecessary
when configNUM_CORES is 1.
2022-06-17 09:11:02 +02:00
Darian Leung
d8eb55d83b freertos: Add newlib dynamic reentrancy support
SMP FreeRTOS adds support for dynamic reentrancy in the following commit:
34b8e24d7c

This commit does the following:

- Pulls in the upstream changes
- Move __getreent() to "freertos_tasks_c_additions.h"
- Add the required configNEWLIB_REENTRANT_IS_DYNAMIC to SMP FreeRTOS port
2022-06-02 15:42:02 +08:00
Sudeep Mohanty
283f569a03 freertos-smp: refactor thread local storage pointers deletion callbacks
This commit updates how the TLS pointers deletion callbacks are called
during task deletion in the FreeRTOS SMP kernel. The callbacks are now
routed through the portCLEAN_UP_TCB() macro. This commit also adds a
new kconfig option CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS to control
the enablement of the TLSP deletion callbacks.
2022-05-06 09:25:25 +05:30
Darian Leung
efdedaf726 freertos: Move IDF API additions to seperate files
This commit moves the IDF API additions from task.h/task.c to seperate header/source files.

- Declarations moved to "idf_additions.h"
- Definitions moved to "freertos_task_c_additions.h"

The API descriptions have also been updated.
2022-04-27 20:31:39 +08:00
Darian Leung
8c92d0b2af freertos: Disable portUSING_MPU_WRAPPERS in FreeRTOS SMP Xtensa port
This commit disables portUSING_MPU_WRAPPERS for the FreeRTOS SMP xtensa port.
This was previously enabled due to the need to keep a CPSA (coprocessor save
area pointer) in the TCB. The CPSA pointer is now calculated at run time.
2022-04-19 13:35:30 +08:00
Darian Leung
63d15957d2 freertos: Fix SMP build warning in xTaskCreateStaticPinnedToCore 2022-03-22 23:51:43 +08:00
Darian Leung
199df492b7 freertos: Update task creation pinned to core functions
This commit updates the "xTaskCreate...PinnedToCore()" functions to
call the "xTaskCreate...AffinitySet()" equivalent functions.
2022-03-21 11:37:21 +08:00
Darian Leung
6a38499172 freertos: Add task creation with affinity functions to FreeRTOS SMP
This commit syncs adds task creation with affinity functions to
FreeRTOS SMP by syncing with upstrea commit
a97741a08d
2022-03-21 11:09:24 +08:00
Darian Leung
9da5d7c40a freertos: Add changes to FreeRTOS SMP sources
This commit adds the necessary changes to the FreeRTOS SMP source and
and header files so that it can be compatible with ESP-IDF.
2022-03-08 14:59:18 +08:00
Darian Leung
2d1afaf35b freertos: Add FreeRTOS SMP upstream files
This commit copies over the sources files from
https://github.com/FreeRTOS/FreeRTOS-Kernel/tree/smp based on the
commit 4832377117b4198db43009f2b548497d9cdbf8da

The FreeRTOS SMP sources are added to components/freertos/FreeRTOS-Kernel-SMP

Notes:
- This commit WILL NOT compile correctly. It simply copies over sources files
- copyright_ignore.txt entries added so that we can avoid using SPDX headers
- Portable files are not added yet
2022-03-08 14:58:57 +08:00