forked from espressif/esp-idf
Merge branch 'feature/freertos_tidy_up_linker_script' into 'master'
FreeRTOS: Update function placements rules and tidy up linker fragment files Closes IDF-6195 See merge request espressif/esp-idf!21394
This commit is contained in:
@@ -60,7 +60,7 @@ else()
|
||||
"esp_additions/private_include") # For include "freertos_tasks_c_additions.h"
|
||||
|
||||
if(CONFIG_FREERTOS_SMP)
|
||||
set(ldfragments linker_smp.lf)
|
||||
set(ldfragments linker_smp.lf linker_common.lf)
|
||||
list(APPEND include_dirs "${kernel_dir}/portable/${arch}/include/freertos") # Xtensa headers via #include "xx.h"
|
||||
else()
|
||||
list(APPEND srcs
|
||||
@@ -69,7 +69,7 @@ else()
|
||||
|
||||
list(APPEND private_include_dirs "${kernel_dir}/portable/priv_include") # For port_systick.h on normal FreeRTOS
|
||||
|
||||
set(ldfragments linker.lf)
|
||||
set(ldfragments linker.lf linker_common.lf)
|
||||
endif()
|
||||
|
||||
list(APPEND private_requirements soc esp_pm)
|
||||
|
@@ -1,9 +1,10 @@
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Since at least FreeRTOS V7.5.3 uxTopUsedPriority is no longer
|
||||
* present in the kernel, so it has to be supplied by other means for
|
||||
* OpenOCD's threads awareness.
|
||||
@@ -15,7 +16,6 @@
|
||||
*/
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "esp_attr.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
@@ -25,5 +25,5 @@
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FREERTOS_DEBUG_OCDAWARE
|
||||
const int USED DRAM_ATTR uxTopUsedPriority = configMAX_PRIORITIES - 1; //will be removed
|
||||
const int USED uxTopUsedPriority = configMAX_PRIORITIES - 1; //will be removed
|
||||
#endif
|
||||
|
@@ -219,7 +219,7 @@ This file gets pulled into assembly sources. Therefore, some includes need to be
|
||||
#define INCLUDE_xSemaphoreGetMutexHolder 1
|
||||
#define INCLUDE_xTaskGetHandle 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark2 0
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark2 1
|
||||
#define INCLUDE_eTaskGetState 1
|
||||
#define INCLUDE_xTaskResumeFromISR 1
|
||||
#define INCLUDE_xTimerPendFunctionCall 1
|
||||
|
@@ -1,138 +1,251 @@
|
||||
# ----------------------------------------------------------------------------------------------------------------------
|
||||
# Linker fragment file for IDF FreeRTOS (i.e., CONFIG_FREERTOS_SMP=n)
|
||||
[mapping:freertos]
|
||||
# Flash function placements are listed per source file, in the order that they appear in the source file.
|
||||
#
|
||||
# Placement Rules:
|
||||
# - Default: Place all functions in internal RAM.
|
||||
# - CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH:
|
||||
# - Place functions in flash if they are never called from an ISR context (directly or indirectly).
|
||||
# - Some functions that are called often (such as critical sections) are placed in internal RAM for speed.
|
||||
# ----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[mapping:freertos_idf]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
* (noflash_text)
|
||||
if FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH = y:
|
||||
# vTaskGetSnapshot is omitted on purpose: as it is used to by the Task Watchdog (TWDT) interrupt
|
||||
# handler, we want to always keep it in IRAM
|
||||
tasks: pxTaskGetNext (default)
|
||||
tasks: uxTaskGetSnapshotAll (default)
|
||||
tasks: pxGetNextTaskList (default)
|
||||
* (noflash_text) # Default all FreeRTOS functions to IRAM
|
||||
if FREERTOS_PLACE_FUNCTIONS_INTO_FLASH = y:
|
||||
port: pxPortInitialiseStack (default)
|
||||
port: xPortStartScheduler (default)
|
||||
if IDF_TARGET_ESP32 = y || IDF_TARGET_ESP32S3 = y :
|
||||
port: vPortCleanUpCoprocArea (default)
|
||||
tasks: prvTaskCheckFreeStackSpace (default)
|
||||
tasks: prvInitialiseNewTask (default)
|
||||
tasks: prvInitialiseTaskLists (default)
|
||||
tasks: prvDeleteTCB (default)
|
||||
tasks: prvCheckTasksWaitingTermination (default)
|
||||
tasks: prvIdleTask (default)
|
||||
tasks: prvAddNewTaskToReadyList (default)
|
||||
tasks: xTaskCreatePinnedToCore (default)
|
||||
tasks: xTaskCreateStaticPinnedToCore (default)
|
||||
tasks: vTaskResume (default)
|
||||
tasks: vTaskStartScheduler (default)
|
||||
tasks: vTaskSuspendAll (default)
|
||||
tasks: uxTaskGetNumberOfTasks (default)
|
||||
tasks: xTaskGetIdleTaskHandle (default)
|
||||
tasks: vTaskRemoveFromUnorderedEventList (default)
|
||||
tasks: uxTaskPriorityGet (default)
|
||||
tasks: vTaskPrioritySet (default)
|
||||
tasks: prvTaskPriorityRaise (default)
|
||||
tasks: prvTaskPriorityRestore (default)
|
||||
tasks: vTaskSetThreadLocalStoragePointerAndDelCallback (default)
|
||||
tasks: pvTaskGetThreadLocalStoragePointer (default)
|
||||
tasks: xTaskGetCurrentTaskHandleForCPU (default)
|
||||
tasks: vTaskDelete (default)
|
||||
tasks: vTaskDelayUntil (default)
|
||||
tasks: xTaskDelayUntil (default)
|
||||
tasks: vTaskDelay (default)
|
||||
tasks: vTaskSuspend (default)
|
||||
tasks: xTaskResumeAll (default)
|
||||
tasks: uxTaskResetEventItemValue (default)
|
||||
tasks: ulTaskNotifyTake (default)
|
||||
tasks: ulTaskGenericNotifyTake (default)
|
||||
tasks: xTaskNotifyWait (default)
|
||||
tasks: xTaskGenericNotifyWait (default)
|
||||
tasks: xTaskGenericNotify (default)
|
||||
tasks: eTaskGetState (default)
|
||||
tasks: pxTaskGetStackStart (default)
|
||||
tasks: uxTaskGetStackHighWaterMark (default)
|
||||
tasks: vTaskEndScheduler (default)
|
||||
tasks: vTaskMissedYield (default)
|
||||
tasks: vTaskSetThreadLocalStoragePointer (default)
|
||||
tasks: xTaskGetAffinity (default)
|
||||
tasks: xTaskGetIdleTaskHandleForCPU (default)
|
||||
if FREERTOS_USE_TRACE_FACILITY = y:
|
||||
tasks: uxTaskGetSystemState (default)
|
||||
tasks: uxTaskGetTaskNumber (default)
|
||||
tasks: vTaskSetTaskNumber (default)
|
||||
if FREERTOS_USE_STATS_FORMATTING_FUNCTIONS = y:
|
||||
tasks: vTaskList (default)
|
||||
if FREERTOS_GENERATE_RUN_TIME_STATS = y:
|
||||
tasks: vTaskGetRunTimeStats (default)
|
||||
timers: prvInsertTimerInActiveList (default)
|
||||
timers: prvCheckForValidListAndQueue (default)
|
||||
timers: prvInitialiseNewTimer (default)
|
||||
timers: prvTimerTask (default)
|
||||
timers: prvSwitchTimerLists (default)
|
||||
timers: prvSampleTimeNow (default)
|
||||
timers: prvProcessExpiredTimer (default)
|
||||
timers: prvProcessTimerOrBlockTask (default)
|
||||
timers: prvProcessReceivedCommands (default)
|
||||
timers: xTimerCreateTimerTask (default)
|
||||
timers: xTimerCreate (default)
|
||||
timers: xTimerCreateStatic (default)
|
||||
timers: xTimerGenericCommand (default)
|
||||
timers: xTimerGetPeriod (default)
|
||||
timers: xTimerGetExpiryTime (default)
|
||||
timers: xTimerIsTimerActive (default)
|
||||
timers: pvTimerGetTimerID (default)
|
||||
timers: vTimerSetTimerID (default)
|
||||
timers: prvGetNextExpireTime (default)
|
||||
if FREERTOS_USE_TRACE_FACILITY = y:
|
||||
timers: uxTimerGetTimerNumber (default)
|
||||
timers: vTimerSetTimerNumber (default)
|
||||
event_groups: prvTestWaitCondition (default)
|
||||
event_groups: xEventGroupCreate (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# event_groups.c
|
||||
# - Exclude all ...FromISR() functions and their dependents
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
event_groups:xEventGroupCreateStatic (default)
|
||||
event_groups:xEventGroupCreate (default)
|
||||
event_groups:xEventGroupSync (default)
|
||||
event_groups:xEventGroupWaitBits (default)
|
||||
event_groups:xEventGroupClearBits (default)
|
||||
event_groups:xEventGroupSetBits (default)
|
||||
event_groups: xEventGroupSync (default)
|
||||
event_groups:vEventGroupDelete (default)
|
||||
event_groups:vEventGroupSetBitsCallback (default)
|
||||
event_groups:vEventGroupClearBitsCallback (default)
|
||||
event_groups:prvTestWaitCondition (default)
|
||||
if FREERTOS_USE_TRACE_FACILITY = y:
|
||||
event_groups: uxEventGroupGetNumber (default)
|
||||
event_groups: vEventGroupSetNumber (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# list.c
|
||||
# - List/List Item initialization functions are never called from ISR
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
list:vListInitialise (default)
|
||||
list:vListInitialiseItem (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# queue.c
|
||||
# - Keep all ...FromISR() functions (and their prv... calls) in internal RAM
|
||||
# - All other functions can be moved to flash
|
||||
# - Queue lock related functions are only used in single core builds
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
queue:xQueueGenericReset (default)
|
||||
queue:xQueueGenericCreateStatic (default)
|
||||
queue:xQueueGenericCreate (default)
|
||||
queue:prvInitialiseNewQueue (default)
|
||||
queue:prvInitialiseMutex (default)
|
||||
queue:xQueueCreateMutex (default)
|
||||
queue:xQueueCreateMutexStatic (default)
|
||||
queue:xQueueGetMutexHolder (default)
|
||||
queue:xQueueGiveMutexRecursive (default)
|
||||
queue:xQueueTakeMutexRecursive (default)
|
||||
queue:xQueueCreateCountingSemaphoreStatic (default)
|
||||
queue:xQueueCreateCountingSemaphore (default)
|
||||
queue:xQueueGenericSend (default)
|
||||
queue:xQueueReceive (default)
|
||||
queue:xQueueSemaphoreTake (default)
|
||||
queue:xQueuePeek (default)
|
||||
queue:uxQueueMessagesWaiting (default)
|
||||
queue:uxQueueSpacesAvailable (default)
|
||||
queue:vQueueDelete (default)
|
||||
if FREERTOS_USE_TRACE_FACILITY = y:
|
||||
queue:uxQueueGetQueueNumber (default)
|
||||
queue:vQueueSetQueueNumber (default)
|
||||
queue:ucQueueGetQueueType (default)
|
||||
queue:prvGetDisinheritPriorityAfterTimeout (default)
|
||||
if FREERTOS_UNICORE = y:
|
||||
queue:prvUnlockQueue (default)
|
||||
queue:prvIsQueueEmpty (default)
|
||||
queue:prvIsQueueFull (default)
|
||||
queue: prvInitialiseNewQueue (default)
|
||||
queue: prvInitialiseMutex (default)
|
||||
queue: uxQueueSpacesAvailable (default)
|
||||
queue: xQueueGenericReset (default)
|
||||
queue: xQueueGenericCreate (default)
|
||||
queue: xQueueGetMutexHolder (default)
|
||||
queue: xQueueCreateCountingSemaphore (default)
|
||||
queue: xQueueGenericSend (default)
|
||||
queue: xQueueCreateMutex (default)
|
||||
queue: xQueueGiveMutexRecursive (default)
|
||||
queue: xQueueTakeMutexRecursive (default)
|
||||
queue: uxQueueMessagesWaiting (default)
|
||||
queue: vQueueDelete (default)
|
||||
if FREERTOS_QUEUE_REGISTRY_SIZE > 0:
|
||||
queue:vQueueAddToRegistry (default)
|
||||
queue:pcQueueGetName (default)
|
||||
queue:vQueueUnregisterQueue (default)
|
||||
queue:vQueueWaitForMessageRestricted (default)
|
||||
queue:xQueueCreateSet (default)
|
||||
queue:xQueueAddToSet (default)
|
||||
queue:xQueueRemoveFromSet (default)
|
||||
queue:xQueueSelectFromSet (default)
|
||||
queue: xQueueGenericCreateStatic (default)
|
||||
queue: xQueueCreateMutexStatic (default)
|
||||
queue: xQueueCreateCountingSemaphoreStatic (default)
|
||||
if FREERTOS_QUEUE_REGISTRY_SIZE > 0:
|
||||
queue: pcQueueGetName (default)
|
||||
queue: vQueueAddToRegistry (default)
|
||||
queue: vQueueUnregisterQueue (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# stream_buffer.c
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
stream_buffer:xStreamBufferGenericCreate (default)
|
||||
stream_buffer:xStreamBufferGenericCreateStatic (default)
|
||||
stream_buffer:vStreamBufferDelete (default)
|
||||
stream_buffer:xStreamBufferReset (default)
|
||||
stream_buffer:xStreamBufferSetTriggerLevel (default)
|
||||
stream_buffer:xStreamBufferBytesAvailable (default)
|
||||
stream_buffer:xStreamBufferSend (default)
|
||||
stream_buffer:xStreamBufferReceive (default)
|
||||
stream_buffer:xStreamBufferNextMessageLengthBytes (default)
|
||||
stream_buffer:xStreamBufferIsEmpty (default)
|
||||
stream_buffer:xStreamBufferIsFull (default)
|
||||
stream_buffer:prvWriteBytesToBuffer (default)
|
||||
stream_buffer:prvReadBytesFromBuffer (default)
|
||||
stream_buffer:prvInitialiseNewStreamBuffer (default)
|
||||
if FREERTOS_USE_TRACE_FACILITY = y:
|
||||
queue: uxQueueGetQueueNumber (default)
|
||||
queue: vQueueSetQueueNumber (default)
|
||||
queue: ucQueueGetQueueType (default)
|
||||
# app_startup.c
|
||||
app_startup: esp_startup_start_app (default)
|
||||
if CONFIG_FREERTOS_UNICORE = n:
|
||||
app_startup: esp_startup_start_app_other_cores (default)
|
||||
app_startup: other_cpu_startup_idle_hook_cb (default)
|
||||
app_startup: main_task (default)
|
||||
# port_common.c Functions
|
||||
port_common:vApplicationGetIdleTaskMemory (default)
|
||||
port_common:vApplicationGetTimerTaskMemory (default)
|
||||
stream_buffer:uxStreamBufferGetStreamBufferNumber (default)
|
||||
stream_buffer:vStreamBufferSetStreamBufferNumber (default)
|
||||
stream_buffer:ucStreamBufferGetStreamBufferType (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# tasks.c
|
||||
# - Tickless idle functions (i.e., step tick) are left in internal RAM for speed
|
||||
# - The following functions are called when the cache is disabled, thus they are excluded from the list below
|
||||
# (i.e., called after "spi_flash_disable_interrupts_caches_and_other_cpu()" is called).
|
||||
# - "xTaskGetSchedulerState"
|
||||
# - "xTaskGetTickCount"
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
tasks:xTaskCreateStaticPinnedToCore (default)
|
||||
tasks:xTaskCreatePinnedToCore (default)
|
||||
tasks:prvInitialiseNewTask (default)
|
||||
tasks:prvAddNewTaskToReadyList (default)
|
||||
tasks:vTaskDelete (default)
|
||||
tasks:vTaskDelayUntil (default)
|
||||
tasks:xTaskDelayUntil (default)
|
||||
tasks:vTaskDelay (default)
|
||||
tasks:eTaskGetState (default)
|
||||
tasks:uxTaskPriorityGet (default)
|
||||
tasks:vTaskPrioritySet (default)
|
||||
tasks:vTaskSuspend (default)
|
||||
tasks:vTaskResume (default)
|
||||
tasks:vTaskStartScheduler (default)
|
||||
tasks:vTaskEndScheduler (default)
|
||||
tasks:vTaskSuspendAll (default)
|
||||
if CONFIG_FREERTOS_USE_TICKLESS_IDLE = y:
|
||||
tasks:prvGetExpectedIdleTime (default)
|
||||
tasks:xTaskResumeAll (default)
|
||||
tasks:uxTaskGetNumberOfTasks (default)
|
||||
tasks:pcTaskGetName (default)
|
||||
tasks:prvSearchForNameWithinSingleList (default)
|
||||
tasks:xTaskGetHandle (default)
|
||||
tasks:xTaskGetIdleTaskHandle (default)
|
||||
tasks:xTaskGetIdleTaskHandleForCPU (default)
|
||||
tasks:xTaskAbortDelay (default)
|
||||
# IDF-6410 Application tags not supported yet
|
||||
#tasks:vTaskSetApplicationTaskTag (default)
|
||||
#tasks:xTaskGetApplicationTaskTag (default)
|
||||
#tasks:xTaskCallApplicationTaskHook (default)
|
||||
tasks:vTaskPlaceOnEventList (default)
|
||||
tasks:vTaskPlaceOnUnorderedEventList (default)
|
||||
tasks:vTaskPlaceOnEventListRestricted (default)
|
||||
if FREERTOS_UNICORE = n:
|
||||
tasks:vTaskTakeKernelLock (default)
|
||||
tasks:vTaskReleaseKernelLock (default)
|
||||
tasks:vTaskRemoveFromUnorderedEventList (default)
|
||||
tasks:vTaskSetTimeOutState (default)
|
||||
tasks:vTaskInternalSetTimeOutState (default)
|
||||
tasks:xTaskCheckForTimeOut (default)
|
||||
tasks:vTaskMissedYield (default)
|
||||
tasks:prvIdleTask (default)
|
||||
if FREERTOS_TLSP_DELETION_CALLBACKS = y:
|
||||
tasks:vTaskSetThreadLocalStoragePointerAndDelCallback (default)
|
||||
tasks:prvDeleteTLS (default)
|
||||
if FREERTOS_THREAD_LOCAL_STORAGE_POINTERS != 0:
|
||||
tasks:vTaskSetThreadLocalStoragePointer (default)
|
||||
tasks:pvTaskGetThreadLocalStoragePointer (default)
|
||||
tasks:prvInitialiseTaskLists (default)
|
||||
tasks:prvCheckTasksWaitingTermination (default)
|
||||
tasks:xTaskGetAffinity (default)
|
||||
tasks:prvTaskCheckFreeStackSpace (default)
|
||||
tasks:uxTaskGetStackHighWaterMark2 (default)
|
||||
tasks:uxTaskGetStackHighWaterMark (default)
|
||||
tasks:pxTaskGetStackStart (default)
|
||||
tasks:prvDeleteTCB (default)
|
||||
tasks:xTaskGetCurrentTaskHandle (default)
|
||||
tasks:xTaskGetCurrentTaskHandleForCPU (default)
|
||||
tasks:xTaskPriorityInherit (default)
|
||||
tasks:xTaskPriorityDisinherit (default)
|
||||
tasks:vTaskPriorityDisinheritAfterTimeout (default)
|
||||
if FREERTOS_USE_TRACE_FACILITY = y && FREERTOS_USE_STATS_FORMATTING_FUNCTIONS = y:
|
||||
tasks:prvWriteNameToBuffer (default)
|
||||
tasks:vTaskList (default)
|
||||
if FREERTOS_GENERATE_RUN_TIME_STATS = y && FREERTOS_USE_STATS_FORMATTING_FUNCTIONS = y:
|
||||
tasks:vTaskGetRunTimeStats (default)
|
||||
tasks:uxTaskResetEventItemValue (default)
|
||||
tasks:pvTaskIncrementMutexHeldCount (default)
|
||||
tasks:ulTaskNotifyTake (default)
|
||||
tasks:ulTaskGenericNotifyTake (default)
|
||||
tasks:xTaskNotifyWait (default)
|
||||
tasks:xTaskGenericNotifyWait (default)
|
||||
tasks:xTaskGenericNotify (default)
|
||||
tasks:xTaskGenericNotifyStateClear (default)
|
||||
tasks:ulTaskGenericNotifyValueClear (default)
|
||||
if FREERTOS_GENERATE_RUN_TIME_STATS = y:
|
||||
tasks:ulTaskGetIdleRunTimeCounter (default)
|
||||
tasks:prvAddCurrentTaskToDelayedList (default)
|
||||
if FREERTOS_USE_TRACE_FACILITY = y:
|
||||
tasks:uxTaskGetSystemState (default)
|
||||
tasks:uxTaskGetTaskNumber (default)
|
||||
tasks:vTaskSetTaskNumber (default)
|
||||
tasks:vTaskGetInfo (default)
|
||||
tasks:prvListTasksWithinSingleList (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# timers.c
|
||||
# - xTimerGenericCommand() is used for ISR calls as well. Thus leave it (and its dependents) in internal RAM
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
timers:xTimerCreateTimerTask (default)
|
||||
timers:xTimerCreate (default)
|
||||
timers:xTimerCreateStatic (default)
|
||||
timers:prvInitialiseNewTimer (default)
|
||||
timers:xTimerGenericCommand (default)
|
||||
timers:xTimerGetTimerDaemonTaskHandle (default)
|
||||
timers:xTimerGetPeriod (default)
|
||||
timers:vTimerSetReloadMode (default)
|
||||
timers:uxTimerGetReloadMode (default)
|
||||
timers:xTimerGetExpiryTime (default)
|
||||
timers:pcTimerGetName (default)
|
||||
timers:prvProcessExpiredTimer (default)
|
||||
timers:prvTimerTask (default)
|
||||
timers:prvProcessTimerOrBlockTask (default)
|
||||
timers:prvGetNextExpireTime (default)
|
||||
timers:prvSampleTimeNow (default)
|
||||
timers:prvInsertTimerInActiveList (default)
|
||||
timers:prvProcessReceivedCommands (default)
|
||||
timers:prvSwitchTimerLists (default)
|
||||
timers:prvCheckForValidListAndQueue (default)
|
||||
timers:xTimerIsTimerActive (default)
|
||||
timers:pvTimerGetTimerID (default)
|
||||
timers:vTimerSetTimerID (default)
|
||||
timers:xTimerPendFunctionCall (default)
|
||||
if FREERTOS_USE_TRACE_FACILITY = y:
|
||||
timers:uxTimerGetTimerNumber (default)
|
||||
timers:vTimerSetTimerNumber (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# portable/xtensa/port.c
|
||||
# - Most functions are called from an ISR context, except for scheduler/task init/deinit functions
|
||||
# - MPU/Coproc currently only exists on ESP32/S3
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
if IDF_TARGET_ARCH_XTENSA = y:
|
||||
port:xPortStartScheduler (default)
|
||||
port:vPortEndScheduler (default)
|
||||
if FREERTOS_TASK_FUNCTION_WRAPPER = y:
|
||||
port:vPortTaskWrapper (default)
|
||||
port:pxPortInitialiseStack (default)
|
||||
if IDF_TARGET_ESP32 = y || IDF_TARGET_ESP32S3 = y :
|
||||
port:vPortCleanUpCoprocArea (default)
|
||||
port:xPortGetTickRateHz (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# portable/riscv/port.c
|
||||
# - Most functions are called from an ISR context, except for scheduler/task init/deinit functions
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
if IDF_TARGET_ARCH_RISCV = y:
|
||||
port:xPortStartScheduler (default)
|
||||
port:vPortEndScheduler (default)
|
||||
if FREERTOS_TASK_FUNCTION_WRAPPER = y:
|
||||
port:vPortTaskWrapper (default)
|
||||
port:pxPortInitialiseStack (default)
|
||||
port:xPortGetTickRateHz (default)
|
||||
|
62
components/freertos/linker_common.lf
Normal file
62
components/freertos/linker_common.lf
Normal file
@@ -0,0 +1,62 @@
|
||||
# Linker fragment file for common FreeRTOS files (i.e., both "port_common.c" and "esp_additions/..."
|
||||
# Flash function placements are listed per source file, in the order that they appear in the source file.
|
||||
|
||||
[mapping:freertos_common]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
# esp_additions/private_include/freertos_tasks_c_additions.h
|
||||
# Placement Rules (Task Snapshot):
|
||||
# - Default: Place all functions in internal RAM.
|
||||
# - CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH: Place functions in flash
|
||||
# - vTaskGetSnapshot is omitted on purpose as it is used to by the Task Watchdog (TWDT) interrupt handler, we want
|
||||
# to always keep it in IRAM
|
||||
# Placement Rules (FreeRTOS API Additions):
|
||||
# - Default: Place all functions in internal RAM.
|
||||
# - CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH: Place functions in flash if they are never called from an ISR
|
||||
# context (directly or indirectly).
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
# Task Snapshot
|
||||
if FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH = y:
|
||||
tasks:pxGetNextTaskList (default)
|
||||
tasks:pxTaskGetNext (default)
|
||||
tasks:uxTaskGetSnapshotAll (default)
|
||||
# FreeRTOS API Additions
|
||||
if FREERTOS_PLACE_FUNCTIONS_INTO_FLASH = y:
|
||||
if FREERTOS_SMP = y:
|
||||
tasks:xTaskCreatePinnedToCore (default)
|
||||
tasks:xTaskCreateStaticPinnedToCore (default)
|
||||
tasks:xTaskGetCurrentTaskHandleForCPU (default)
|
||||
tasks:xTaskGetIdleTaskHandleForCPU (default)
|
||||
tasks:xTaskGetAffinity (default)
|
||||
if FREERTOS_TLSP_DELETION_CALLBACKS = y:
|
||||
tasks:vTaskSetThreadLocalStoragePointerAndDelCallback (default)
|
||||
tasks:prvTaskPriorityRaise (default)
|
||||
tasks:prvTaskPriorityRestore (default)
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
# app_startup.c
|
||||
# Placement Rules: Functions always in flash as they are never called from an ISR
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
app_startup (default) # Place functions (but not Data and BSS) to flash
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
# FreeRTOS-openocd.c
|
||||
# Placement Rules: All functions/data in internal RAM as they are called/used by OpenOCD
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
FreeRTOS-openocd (noflash)
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
# port_common.c
|
||||
# Placement Rules:
|
||||
# - Default: Place all functions in internal RAM.
|
||||
# - CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH: Place functions in flash if they are never called from an ISR
|
||||
# context (directly or indirectly).
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
port_common (noflash_text) # Default all functions to internal RAM
|
||||
if FREERTOS_PLACE_FUNCTIONS_INTO_FLASH = y:
|
||||
if FREERTOS_SMP = n:
|
||||
port_common:xPortCheckValidTCBMem (default)
|
||||
port_common:xPortcheckValidStackMem (default)
|
||||
port_common:vApplicationGetIdleTaskMemory (default)
|
||||
port_common:vApplicationGetTimerTaskMemory (default)
|
@@ -1,12 +1,23 @@
|
||||
# ----------------------------------------------------------------------------------------------------------------------
|
||||
# Linker fragment file for SMP FreeRTOS (i.e., CONFIG_FREERTOS_SMP=y)
|
||||
[mapping:freertos]
|
||||
# Flash function placements are listed per source file, in the order that they appear in the source file.
|
||||
#
|
||||
# Placement Rules:
|
||||
# - Default: Place all functions in internal RAM.
|
||||
# - CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH:
|
||||
# - Place functions in flash if they are never called from an ISR context (directly or indirectly).
|
||||
# - Some functions that are called often (such as critical sections) are placed in internal RAM for speed.
|
||||
# ----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[mapping:freertos_smp]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
# Default all FreeRTOS functions to IRAM
|
||||
* (noflash_text)
|
||||
# Todo: Check if flash placements are missing or can be further optimized IDF-5259
|
||||
* (noflash_text) # Default all FreeRTOS functions to IRAM
|
||||
if FREERTOS_PLACE_FUNCTIONS_INTO_FLASH = y:
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# event_groups.c
|
||||
# - Exclude all ...FromISR() functions and their dependents
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
event_groups:xEventGroupCreateStatic (default)
|
||||
event_groups:xEventGroupCreate (default)
|
||||
event_groups:xEventGroupSync (default)
|
||||
@@ -20,8 +31,17 @@ entries:
|
||||
if FREERTOS_USE_TRACE_FACILITY = y:
|
||||
event_groups: uxEventGroupGetNumber (default)
|
||||
event_groups: vEventGroupSetNumber (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# list.c
|
||||
# - List/List Item initialization functions are never called from ISR
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
list:vListInitialise (default)
|
||||
list:vListInitialiseItem (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# queue.c
|
||||
# - Keep all ...FromISR() functions (and their prv... calls) in internal RAM
|
||||
# - All other functions can be moved to flash
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
queue:xQueueGenericReset (default)
|
||||
queue:xQueueGenericCreateStatic (default)
|
||||
queue:xQueueGenericCreate (default)
|
||||
@@ -58,8 +78,34 @@ entries:
|
||||
queue:xQueueAddToSet (default)
|
||||
queue:xQueueRemoveFromSet (default)
|
||||
queue:xQueueSelectFromSet (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# stream_buffer.c
|
||||
# tasks.c: Vanilla
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
stream_buffer:xStreamBufferGenericCreate (default)
|
||||
stream_buffer:xStreamBufferGenericCreateStatic (default)
|
||||
stream_buffer:vStreamBufferDelete (default)
|
||||
stream_buffer:xStreamBufferReset (default)
|
||||
stream_buffer:xStreamBufferSetTriggerLevel (default)
|
||||
stream_buffer:xStreamBufferBytesAvailable (default)
|
||||
stream_buffer:xStreamBufferSend (default)
|
||||
stream_buffer:xStreamBufferReceive (default)
|
||||
stream_buffer:xStreamBufferNextMessageLengthBytes (default)
|
||||
stream_buffer:xStreamBufferIsEmpty (default)
|
||||
stream_buffer:xStreamBufferIsFull (default)
|
||||
stream_buffer:prvWriteBytesToBuffer (default)
|
||||
stream_buffer:prvReadBytesFromBuffer (default)
|
||||
stream_buffer:prvInitialiseNewStreamBuffer (default)
|
||||
if FREERTOS_USE_TRACE_FACILITY = y:
|
||||
stream_buffer:uxStreamBufferGetStreamBufferNumber (default)
|
||||
stream_buffer:vStreamBufferSetStreamBufferNumber (default)
|
||||
stream_buffer:ucStreamBufferGetStreamBufferType (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# tasks.c
|
||||
# - The following functions are called when the cache is disabled, thus they are excluded from the list below
|
||||
# (i.e., called after "spi_flash_disable_interrupts_caches_and_other_cpu()" is called).
|
||||
# - "xTaskGetSchedulerState"
|
||||
# - "xTaskGetTickCount"
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
tasks:xTaskCreateStatic (default)
|
||||
tasks:xTaskCreate (default)
|
||||
if FREERTOS_UNICORE = n:
|
||||
@@ -76,8 +122,6 @@ entries:
|
||||
tasks:eTaskGetState (default)
|
||||
tasks:uxTaskPriorityGet (default)
|
||||
tasks:vTaskPrioritySet (default)
|
||||
tasks: prvTaskPriorityRaise (default)
|
||||
tasks: prvTaskPriorityRestore (default)
|
||||
tasks:vTaskSuspend (default)
|
||||
tasks:vTaskResume (default)
|
||||
tasks:prvCreateIdleTasks (default)
|
||||
@@ -112,6 +156,7 @@ entries:
|
||||
tasks:pvTaskGetThreadLocalStoragePointer (default)
|
||||
tasks:prvInitialiseTaskLists (default)
|
||||
tasks:prvCheckTasksWaitingTermination (default)
|
||||
tasks:uxTaskGetStackHighWaterMark2 (default)
|
||||
tasks:uxTaskGetStackHighWaterMark (default)
|
||||
tasks:prvDeleteTCB (default)
|
||||
if FREERTOS_USE_STATS_FORMATTING_FUNCTIONS = y:
|
||||
@@ -127,30 +172,10 @@ entries:
|
||||
tasks:xTaskGenericNotify (default)
|
||||
tasks:xTaskGenericNotifyStateClear (default)
|
||||
tasks:ulTaskGenericNotifyValueClear (default)
|
||||
# tasks.c: Additions
|
||||
if FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH = y:
|
||||
tasks: non_ready_task_lists (default)
|
||||
tasks: pxGetNextTaskList (default)
|
||||
tasks: pxTaskGetNext (default)
|
||||
tasks: vTaskGetSnapshot (default)
|
||||
tasks: uxTaskGetSnapshotAll (default)
|
||||
tasks: xTaskCreatePinnedToCore (default)
|
||||
tasks: xTaskCreateStaticPinnedToCore (default)
|
||||
tasks: xTaskGetCurrentTaskHandleForCPU (default)
|
||||
tasks: xTaskGetIdleTaskHandleForCPU (default)
|
||||
tasks: xTaskGetAffinity (default)
|
||||
if FREERTOS_TLSP_DELETION_CALLBACKS = y:
|
||||
tasks: vTaskSetThreadLocalStoragePointerAndDelCallback (default)
|
||||
# port
|
||||
port: pxPortInitialiseStack (default)
|
||||
port: xPortStartScheduler (default)
|
||||
# app_startup.c
|
||||
app_startup: esp_startup_start_app (default)
|
||||
if CONFIG_FREERTOS_UNICORE = n:
|
||||
app_startup: esp_startup_start_app_other_cores (default)
|
||||
app_startup: other_cpu_startup_idle_hook_cb (default)
|
||||
app_startup: main_task (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# timers.c
|
||||
# - Only timer function called from ISR is xTimerGenericCommandFromISR() and its dependents
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
timers:xTimerCreateTimerTask (default)
|
||||
timers:xTimerCreate (default)
|
||||
timers:xTimerCreateStatic (default)
|
||||
@@ -178,3 +203,41 @@ entries:
|
||||
if FREERTOS_USE_TRACE_FACILITY = y:
|
||||
timers:uxTimerGetTimerNumber (default)
|
||||
timers:vTimerSetTimerNumber (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# portable/xtensa/port.c
|
||||
# - Most functions are called from an ISR context, except for scheduler/task init/deinit functions
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
if IDF_TARGET_ARCH_XTENSA = y:
|
||||
port:vPortSetupTimer (default)
|
||||
port:xPortStartScheduler (default)
|
||||
port:vPortEndScheduler (default)
|
||||
port:pvPortMalloc (default)
|
||||
port:vPortFree (default)
|
||||
port:vPortInitialiseBlocks (default)
|
||||
port:xPortGetFreeHeapSize (default)
|
||||
if FREERTOS_TASK_FUNCTION_WRAPPER = y:
|
||||
port:vPortTaskWrapper (default)
|
||||
port:pxPortInitialiseStack (default)
|
||||
if FREERTOS_UNICORE = n:
|
||||
port:vPortCleanUpCoprocArea (default)
|
||||
if FREERTOS_TLSP_DELETION_CALLBACKS = y:
|
||||
port:vPortTLSPointersDelCb (default)
|
||||
port:vPortCleanUpTCB (default)
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
# portable/riscv/port.c
|
||||
# - Most functions are called from an ISR context, except for scheduler/task init/deinit functions
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
if IDF_TARGET_ARCH_RISCV = y:
|
||||
port:vPortSetupTimer (default)
|
||||
port:xPortStartScheduler (default)
|
||||
port:vPortEndScheduler (default)
|
||||
port:pvPortMalloc (default)
|
||||
port:vPortFree (default)
|
||||
port:vPortInitialiseBlocks (default)
|
||||
port:xPortGetFreeHeapSize (default)
|
||||
if FREERTOS_TASK_FUNCTION_WRAPPER = y:
|
||||
port:vPortTaskWrapper (default)
|
||||
port:pxPortInitialiseStack (default)
|
||||
if FREERTOS_TLSP_DELETION_CALLBACKS = y:
|
||||
port:vPortTLSPointersDelCb (default)
|
||||
port:vPortCleanUpTCB (default)
|
||||
|
Reference in New Issue
Block a user