Skip to content

use configSTACK_DEPTH_TYPE consequently (updated for 11.0.x) #942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 59 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
0b626b8
use configSTACK_DEPTH_TYPE consequently
feilipu May 29, 2021
848a70c
update default to uint32_t
feilipu Jun 2, 2021
51934b6
Merge branch 'main' into consequent_configSTACK_DEPTH_TYPE
feilipu Jun 2, 2021
cde8062
Merge branch 'main' into consequent_configSTACK_DEPTH_TYPE
feilipu Jun 11, 2021
5157761
Merge branch 'main' into consequent_configSTACK_DEPTH_TYPE
feilipu Jun 19, 2021
4dceecd
Merge branch 'main' into consequent_configSTACK_DEPTH_TYPE
feilipu Jun 23, 2021
be27225
Update FreeRTOS.h
feilipu Jun 23, 2021
779d915
Update portable.h
feilipu Jun 23, 2021
4a74dfe
Merge branch 'main' into consequent_configSTACK_DEPTH_TYPE
feilipu Jun 25, 2021
158730b
Merge branch 'main' into consequent_configSTACK_DEPTH_TYPE
feilipu Jun 30, 2021
9867312
Merge branch 'main' into consequent_configSTACK_DEPTH_TYPE
feilipu Jun 30, 2021
f3ca628
configSTACK_DEPTH_TYPE - unify stack variable naming
feilipu Jul 1, 2021
6b8489d
update lexicon.txt
feilipu Jul 1, 2021
f7fff74
update typo lexicon.txt
feilipu Jul 1, 2021
f1e095d
Merge branch 'main' into consequent_configSTACK_DEPTH_TYPE
feilipu Jul 21, 2021
c188eac
Merge branch 'main' into consequent_configSTACK_DEPTH_TYPE
feilipu Aug 14, 2021
27c0794
Merge branch 'main' into consequent_configSTACK_DEPTH_TYPE
feilipu Sep 8, 2021
92052c3
Update task.h
feilipu Sep 8, 2021
37d1177
Update timers.h
feilipu Sep 8, 2021
bd7810e
Merge branch 'main' into consequent_configSTACK_DEPTH_TYPE
feilipu Sep 21, 2021
08f3a3e
10.4.6 - 7 August snapshot
feilipu Aug 7, 2022
970f5a0
Merge pull request #2 from FreeRTOS/main
feilipu Sep 17, 2022
4f8d991
adapt to 10.5.0
feilipu Sep 17, 2022
e39fc16
Merge branch 'FreeRTOS:main' into main
feilipu Jan 1, 2024
4115ec8
resolve conflicts
feilipu Jan 1, 2024
a7cf0ed
fix merge typo
feilipu Jan 1, 2024
b0dbc35
fix stack type
feilipu Jan 1, 2024
d7ae2b3
fix timer stack type
feilipu Jan 1, 2024
65b4a90
fix timer stack more
feilipu Jan 1, 2024
3902dfa
fix affinity set stack
feilipu Jan 1, 2024
54b792c
adjust ports to use configSTACK_DEPTH_TYPE
feilipu Jan 1, 2024
edce7fd
fix vTaskListTasks
feilipu Jan 1, 2024
4e7b84b
set default stack depth type in portable.h
feilipu Jan 1, 2024
ebe8582
fix History.txt
feilipu Jan 1, 2024
f301dac
update affinityset
feilipu Jan 1, 2024
9a5b20a
resolve reviewer comments
feilipu Jan 2, 2024
3e94e30
fix prvTaskCheckFreeStackSpace for variable stack size type
feilipu Jan 2, 2024
f071ef1
restore CoRoutine defines
feilipu Jan 2, 2024
85960e5
remove obsolete stack ttype casts
feilipu Jan 2, 2024
345ff92
fix (attempt) for format portable.h
feilipu Jan 3, 2024
1b8b685
Merge branch 'main' into main
kar-rahul-aws Jan 5, 2024
7ccc2f8
Formatting fixes
Skptak Jan 5, 2024
ce04a97
prvTaskCheckFreeStackSpace make variable naming compliant
feilipu Jan 8, 2024
515753d
Merge branch 'main' into main
feilipu Jan 8, 2024
fe1b12c
Merge branch 'main' into main
feilipu Jan 8, 2024
a5c2779
Merge branch 'main' into main
kar-rahul-aws Jan 9, 2024
ee5725b
Merge branch 'main' into main
feilipu Jan 11, 2024
45f3611
Merge branch 'main' into main
Skptak Jan 18, 2024
f3ff2be
Merge branch 'main' into main
feilipu Jan 18, 2024
b834528
Update portable/GCC/ARM_CM33/non_secure/port.c
feilipu Jan 19, 2024
f810a37
Update portable/GCC/ARM_CM23/non_secure/port.c
feilipu Jan 19, 2024
e4d1b38
Apply suggestions from code review
feilipu Jan 19, 2024
8f16862
Correct uxStackDepth in port.c
feilipu Jan 20, 2024
595e1ab
Update ARM CM3 MPU port.c
feilipu Jan 20, 2024
374a27b
Merge pull request #4 from FreeRTOS/main
feilipu Jan 23, 2024
548bac2
Merge branch 'main' into main
Skptak Jan 23, 2024
ae885c9
Merge branch 'main' into main
aggarg Jan 25, 2024
f187faa
Code review suggestions
aggarg Jan 25, 2024
418ce5b
Merge branch 'main' into main
kar-rahul-aws Jan 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
10.4.6 - 7 August snapshot
  • Loading branch information
feilipu committed Aug 7, 2022
commit 08f3a3ebb60bd2cd0837cf2dc1d101611c71cfc3
41 changes: 37 additions & 4 deletions History.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,43 @@
Changes between FreeRTOS V10.4.5 and TBD
Changes between FreeRTOS V10.4.6 and TBD

Documentation and download available at https://www.FreeRTOS.org/

+ Changed uxAutoReload parameter in timer functions to xAutoReload. The
type is now BaseType_t. This matches the type of pdTRUE and pdFALSE.
The new function xTimerGetAutoReload() provides the auto-reload state as
a BaseType_t. The legacy function uxTimerGetAutoReload is retained with the
original UBaseType_t return value.
+ Introduce the configUSE_MINI_LIST_ITEM configuration option. When this
option is set to 1, ListItem_t and MiniLitItem_t remain separate types.
However, when configUSE_MINI_LIST_ITEM == 0, MiniLitItem_t and ListItem_t
are both typedefs of the same struct xLIST_ITEM. This addresses some issues
observed when strict-aliasing and link time optimization are enabled.
To maintain backwards compatibility, configUSE_MINI_LIST_ITEM defaults to 1.
+ Add the ability to override send and receive completed callbacks for each
instance of a stream buffer or message buffer. The feature can be controlled
by setting the configuration option configUSE_SB_COMPLETED_CALLBACK in
FreeRTOSConfig.h. When the option is set to 1, APIs
xStreamBufferCreateWithCallback() or xStreamBufferCreateStaticWithCallback()
(and likewise APIs from message buffer) can be used to create a stream buffer
or message buffer instance with application provided callback overrides. When
the option is set to 0, then the default callbacks as defined by
sbSEND_COMPLETED() and sbRECEIVE_COMPLETED() macros are invoked. To maintain
backwards compatibility, configUSE_SB_COMPLETED_CALLBACK defaults to 0. The
functionaility is currently not supported for MPU enabled ports.

Changes between FreeRTOS V10.4.5 and FreeRTOS V10.4.6 released November 12 2021

+ Extend use of the configSTACK_DEPTH_TYPE which enables developers to define
the type used to hold stack counter variables. Defaults to uint16_t
for backward compatibility. #define configSTACK_DEPTH_TYPE to a type
(for example, uint16_t) in FreeRTOSConfig.h to override the default.

Documentation and download available at https://www.FreeRTOS.org/
+ ARMv7-M and ARMv8-M MPU ports – prevent non-kernel code from calling the
internal functions xPortRaisePrivilege and vPortResetPrivilege by changing
them to macros.
+ Introduce a new config configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS which
enables developers to prevent critical sections from unprivileged tasks.
It defaults to 1 for backward compatibility. Application should set it to
0 to disable critical sections from unprivileged tasks.

Changes between FreeRTOS V10.4.4 and FreeRTOS V10.4.5 released September 10 2021

Expand All @@ -24,7 +56,7 @@ Changes between FreeRTOS V10.4.4 and FreeRTOS V10.4.5 released September 10 2021
configIDLE_SHOULD_YIELD is set to 0.
+ ARMv8-M secure-side port: Tasks that call secure functions from the
non-secure side of an ARMv8-M MCU (ARM Cortex-M23 and Cortex-M33) have two
contexts one on the non-secure side and one on the secure-side. Previous
contexts - one on the non-secure side and one on the secure-side. Previous
versions of the FreeRTOS ARMv8-M secure-side ports allocated the structures
that reference secure-side contexts at run time. Now the structures are
allocated statically at compile time. The change necessitates the
Expand Down Expand Up @@ -2903,3 +2935,4 @@ Changes between V1.00 and V1.01



==== BASE ====
12 changes: 6 additions & 6 deletions include/FreeRTOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,12 @@
#endif

/* Sanity check the configuration. */
#if ( configUSE_TICKLESS_IDLE != 0 )
#if ( INCLUDE_vTaskSuspend != 1 )
#error INCLUDE_vTaskSuspend must be set to 1 if configUSE_TICKLESS_IDLE is not set to 0
#endif /* INCLUDE_vTaskSuspend */
#endif /* configUSE_TICKLESS_IDLE */

#if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )
#error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.
#endif
Expand Down Expand Up @@ -1058,12 +1064,6 @@
#define configENABLE_FPU 1
#endif

/* Set configENABLE_MVE to 1 to enable MVE support and 0 to disable it. This is
* currently used in ARMv8M ports. */
#ifndef configENABLE_MVE
#define configENABLE_MVE 0
#endif

/* Set configENABLE_TRUSTZONE to 1 enable TrustZone support and 0 to disable it.
* This is currently used in ARMv8M ports. */
#ifndef configENABLE_TRUSTZONE
Expand Down
4 changes: 4 additions & 0 deletions include/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ typedef struct xTASK_STATUS
UBaseType_t uxBasePriority; /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */
configRUN_TIME_COUNTER_TYPE ulRunTimeCounter; /* The total run time allocated to the task so far, as defined by the run time stats clock. See https://www.FreeRTOS.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */
StackType_t * pxStackBase; /* Points to the lowest address of the task's stack area. */
#if ( ( portSTACK_GROWTH > 0 ) && ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
StackType_t * pxTopOfStack; /* Points to the top address of the task's stack area. */
StackType_t * pxEndOfStack; /* Points to the end address of the task's stack area. */
#endif
configSTACK_DEPTH_TYPE uxStackHighWaterMark; /* The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */
} TaskStatus_t;

Expand Down
2 changes: 1 addition & 1 deletion include/timers.h
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ BaseType_t xTimerGenericCommand( TimerHandle_t xTimer,
* configSUPPORT_STATIC_ALLOCATION is set. For more information see this URI: https://www.FreeRTOS.org/a00110.html#configSUPPORT_STATIC_ALLOCATION
*
* @param ppxTimerTaskTCBBuffer A handle to a statically allocated TCB buffer
* @param ppxTimerTaskStackBuffer A handle to a statically allocated Stack buffer for thie idle task
* @param ppxTimerTaskStackBuffer A handle to a statically allocated Stack buffer for the idle task
* @param puxTimerTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
*/
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
Expand Down
184 changes: 161 additions & 23 deletions portable/Common/mpu_wrappers.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
BaseType_t MPU_xTaskCreate( TaskFunction_t pvTaskCode,
const char * const pcName,
uint16_t usStackDepth,
configSTACK_DEPTH_TYPE uxStackDepth,
void * pvParameters,
UBaseType_t uxPriority,
TaskHandle_t * pxCreatedTask ) /* FREERTOS_SYSTEM_CALL */
{
BaseType_t xReturn, xRunningPrivileged;

xPortRaisePrivilege( xRunningPrivileged );
xReturn = xTaskCreate( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask );
xReturn = xTaskCreate( pvTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, pxCreatedTask );
vPortResetPrivilege( xRunningPrivileged );

return xReturn;
Expand All @@ -72,7 +72,7 @@
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode,
const char * const pcName,
const uint32_t ulStackDepth,
configSTACK_DEPTH_TYPE uxStackDepth,
void * const pvParameters,
UBaseType_t uxPriority,
StackType_t * const puxStackBuffer,
Expand All @@ -82,26 +82,170 @@
BaseType_t xRunningPrivileged;

xPortRaisePrivilege( xRunningPrivileged );
xReturn = xTaskCreateStatic( pxTaskCode, pcName, ulStackDepth, pvParameters, uxPriority, puxStackBuffer, pxTaskBuffer );
xReturn = xTaskCreateStatic( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, puxStackBuffer, pxTaskBuffer );
vPortResetPrivilege( xRunningPrivileged );

return xReturn;
}
#endif /* configSUPPORT_STATIC_ALLOCATION */
/*-----------------------------------------------------------*/

#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
BaseType_t MPU_xTaskCreate( TaskFunction_t pvTaskCode,
const char * const pcName,
configSTACK_DEPTH_TYPE uxStackDepth,
void * pvParameters,
UBaseType_t uxPriority,
TaskHandle_t * pxCreatedTask ) /* FREERTOS_SYSTEM_CALL */
#if ( INCLUDE_vTaskDelete == 1 )
void MPU_vTaskDelete( TaskHandle_t pxTaskToDelete ) /* FREERTOS_SYSTEM_CALL */
{
BaseType_t xRunningPrivileged;

xPortRaisePrivilege( xRunningPrivileged );
vTaskDelete( pxTaskToDelete );
vPortResetPrivilege( xRunningPrivileged );
}
#endif
/*-----------------------------------------------------------*/

#if ( INCLUDE_xTaskDelayUntil == 1 )
BaseType_t MPU_xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
TickType_t xTimeIncrement ) /* FREERTOS_SYSTEM_CALL */
{
BaseType_t xRunningPrivileged, xReturn;

xPortRaisePrivilege( xRunningPrivileged );
xReturn = xTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement );
vPortResetPrivilege( xRunningPrivileged );

return xReturn;
}
#endif /* if ( INCLUDE_xTaskDelayUntil == 1 ) */
/*-----------------------------------------------------------*/

#if ( INCLUDE_xTaskAbortDelay == 1 )
BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ) /* FREERTOS_SYSTEM_CALL */
{
BaseType_t xReturn, xRunningPrivileged;

xPortRaisePrivilege( xRunningPrivileged );
xReturn = xTaskAbortDelay( xTask );
vPortResetPrivilege( xRunningPrivileged );

return xReturn;
}
#endif /* if ( INCLUDE_xTaskAbortDelay == 1 ) */
/*-----------------------------------------------------------*/

#if ( INCLUDE_vTaskDelay == 1 )
void MPU_vTaskDelay( TickType_t xTicksToDelay ) /* FREERTOS_SYSTEM_CALL */
{
BaseType_t xRunningPrivileged;

xPortRaisePrivilege( xRunningPrivileged );
vTaskDelay( xTicksToDelay );
vPortResetPrivilege( xRunningPrivileged );
}
#endif
/*-----------------------------------------------------------*/

#if ( INCLUDE_uxTaskPriorityGet == 1 )
UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t pxTask ) /* FREERTOS_SYSTEM_CALL */
{
UBaseType_t uxReturn;
BaseType_t xRunningPrivileged;

xPortRaisePrivilege( xRunningPrivileged );
uxReturn = uxTaskPriorityGet( pxTask );
vPortResetPrivilege( xRunningPrivileged );

return uxReturn;
}
#endif /* if ( INCLUDE_uxTaskPriorityGet == 1 ) */
/*-----------------------------------------------------------*/

#if ( INCLUDE_vTaskPrioritySet == 1 )
void MPU_vTaskPrioritySet( TaskHandle_t pxTask,
UBaseType_t uxNewPriority ) /* FREERTOS_SYSTEM_CALL */
{
BaseType_t xRunningPrivileged;

xPortRaisePrivilege( xRunningPrivileged );
vTaskPrioritySet( pxTask, uxNewPriority );
vPortResetPrivilege( xRunningPrivileged );
}
#endif /* if ( INCLUDE_vTaskPrioritySet == 1 ) */
/*-----------------------------------------------------------*/

#if ( INCLUDE_eTaskGetState == 1 )
eTaskState MPU_eTaskGetState( TaskHandle_t pxTask ) /* FREERTOS_SYSTEM_CALL */
{
eTaskState eReturn;
BaseType_t xRunningPrivileged;

xPortRaisePrivilege( xRunningPrivileged );
eReturn = eTaskGetState( pxTask );
vPortResetPrivilege( xRunningPrivileged );

return eReturn;
}
#endif /* if ( INCLUDE_eTaskGetState == 1 ) */
/*-----------------------------------------------------------*/

#if ( configUSE_TRACE_FACILITY == 1 )
void MPU_vTaskGetInfo( TaskHandle_t xTask,
TaskStatus_t * pxTaskStatus,
BaseType_t xGetFreeStackSpace,
eTaskState eState ) /* FREERTOS_SYSTEM_CALL */
{
BaseType_t xRunningPrivileged;

xPortRaisePrivilege( xRunningPrivileged );
vTaskGetInfo( xTask, pxTaskStatus, xGetFreeStackSpace, eState );
vPortResetPrivilege( xRunningPrivileged );
}
#endif /* if ( configUSE_TRACE_FACILITY == 1 ) */
/*-----------------------------------------------------------*/

#if ( INCLUDE_xTaskGetIdleTaskHandle == 1 )
TaskHandle_t MPU_xTaskGetIdleTaskHandle( void ) /* FREERTOS_SYSTEM_CALL */
{
TaskHandle_t xReturn;
BaseType_t xRunningPrivileged;

xPortRaisePrivilege( xRunningPrivileged );
xReturn = xTaskGetIdleTaskHandle();
vPortResetPrivilege( xRunningPrivileged );

return xReturn;
}
#endif /* if ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) */
/*-----------------------------------------------------------*/

#if ( INCLUDE_vTaskSuspend == 1 )
void MPU_vTaskSuspend( TaskHandle_t pxTaskToSuspend ) /* FREERTOS_SYSTEM_CALL */
{
BaseType_t xRunningPrivileged;

xPortRaisePrivilege( xRunningPrivileged );
vTaskSuspend( pxTaskToSuspend );
vPortResetPrivilege( xRunningPrivileged );
}
#endif
/*-----------------------------------------------------------*/

#if ( INCLUDE_vTaskSuspend == 1 )
void MPU_vTaskResume( TaskHandle_t pxTaskToResume ) /* FREERTOS_SYSTEM_CALL */
{
BaseType_t xRunningPrivileged;

xPortRaisePrivilege( xRunningPrivileged );
vTaskResume( pxTaskToResume );
vPortResetPrivilege( xRunningPrivileged );
}
#endif
/*-----------------------------------------------------------*/

void MPU_vTaskSuspendAll( void ) /* FREERTOS_SYSTEM_CALL */
{
BaseType_t xReturn;
BaseType_t xRunningPrivileged = xPortRaisePrivilege();
BaseType_t xRunningPrivileged;

xReturn = xTaskCreate( pvTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, pxCreatedTask );
xPortRaisePrivilege( xRunningPrivileged );
vTaskSuspendAll();
vPortResetPrivilege( xRunningPrivileged );
}
/*-----------------------------------------------------------*/
Expand All @@ -118,19 +262,13 @@
}
/*-----------------------------------------------------------*/

#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode,
const char * const pcName,
const configSTACK_DEPTH_TYPE uxStackDepth,
void * const pvParameters,
UBaseType_t uxPriority,
StackType_t * const puxStackBuffer,
StaticTask_t * const pxTaskBuffer ) /* FREERTOS_SYSTEM_CALL */
TickType_t MPU_xTaskGetTickCount( void ) /* FREERTOS_SYSTEM_CALL */
{
TickType_t xReturn;
BaseType_t xRunningPrivileged;

xReturn = xTaskCreateStatic( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, puxStackBuffer, pxTaskBuffer );
xPortRaisePrivilege( xRunningPrivileged );
xReturn = xTaskGetTickCount();
vPortResetPrivilege( xRunningPrivileged );

return xReturn;
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.