Compare commits

..

6 commits

Author SHA1 Message Date
sean
103e595b54
Merge d1605b581b into 32e581636f 2025-07-25 16:15:39 -03:00
Gaurav-Aggarwal-AWS
32e581636f
Delete thread key on process exit (#1297)
Previously, the shared thread key was deleted in xPortStartScheduler
after scheduler was ended. This created a race condition where
prvThreadKeyDestructor (responsible for freeing thread-specific heap
memory) would not be called if xPortStartScheduler deleted the key
before the last task deletion, as destructors are not invoked after key
deletion (see https://github.com/walac/glibc/blob/master/nptl/pthread_create.c#L145-L150).

Move thread key deletion to process exit to ensure all thread-specific
memory is properly freed.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2025-07-24 11:07:27 +05:30
Gaurav-Aggarwal-AWS
684b34ca8d
Define security extension configs before portable.h (#1294)
Define configENABLE_PAC and configENABLE_BTI before including portable.h
to prevent "used before definition" warnings when these macros are not
set in FreeRTOSConfig.h.

Fixes: https://github.com/FreeRTOS/FreeRTOS-Kernel/issues/1293

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2025-07-14 16:20:18 +05:30
Aniruddha Kanhere
f5e6151b14
Update artifact path in the backup action (#1292)
* Add artifact backup action

* Fix artifact path
2025-07-09 09:53:13 -07:00
Florian La Roche
48a4939c9f
Fix compiler warning (#1291)
- In list.h fix a typo in comments.
- In portable/ThirdParty/GCC/Posix/port.c fix compiler warning about
  "gcc -Wwrite-strings".

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2025-07-09 11:16:00 +05:30
Aniruddha Kanhere
e3a362b1d1
Add artifact backup action (#1290) 2025-07-07 18:15:46 +05:30
4 changed files with 24 additions and 14 deletions

View file

@ -18,6 +18,8 @@ on:
jobs:
release-packager:
permissions:
id-token: write
name: Release Packager
runs-on: ubuntu-latest
steps:
@ -117,6 +119,14 @@ jobs:
./tools/.github/scripts/release.py "$REPO_OWNER" --kernel-repo-path=local_kernel --kernel-commit="$COMMIT_SHA_2" --new-kernel-version="$VERSION_NUMBER" --new-kernel-main-br-version="$MAIN_BR_VERSION_NUMBER"
exit $?
- name: Backup Release Asset
uses: FreeRTOS/CI-CD-Github-Actions/artifact-backup@main
with:
# This is dependent on the release script putting this zip file
# in this exact location.
artifact_path: ./FreeRTOS-KernelV${{ github.event.inputs.version_number }}.zip
release_tag: ${{ github.event.inputs.version_number }}
- name: Cleanup
env:
VERSION_NUMBER: ${{ github.event.inputs.version_number }}

View file

@ -101,6 +101,16 @@
#define configASSERT_DEFINED 1
#endif
/* Set configENABLE_PAC and/or configENABLE_BTI to 1 to enable PAC and/or BTI
* support and 0 to disable them. These are currently used in ARMv8.1-M ports. */
#ifndef configENABLE_PAC
#define configENABLE_PAC 0
#endif
#ifndef configENABLE_BTI
#define configENABLE_BTI 0
#endif
/* Basic FreeRTOS definitions. */
#include "projdefs.h"
@ -3040,16 +3050,6 @@
#define configCONTROL_INFINITE_LOOP()
#endif
/* Set configENABLE_PAC and/or configENABLE_BTI to 1 to enable PAC and/or BTI
* support and 0 to disable them. These are currently used in ARMv8.1-M ports. */
#ifndef configENABLE_PAC
#define configENABLE_PAC 0
#endif
#ifndef configENABLE_BTI
#define configENABLE_BTI 0
#endif
/* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using
* dynamically allocated RAM, in which case when any task is deleted it is known
* that both the task's stack and TCB need to be freed. Sometimes the

View file

@ -44,7 +44,7 @@
*
* In addition to it's value, each list item contains a pointer to the next
* item in the list (pxNext), a pointer to the list it is in (pxContainer)
* and a pointer to back to the object that contains it. These later two
* and a pointer back to the object that contains it. These later two
* pointers are included for efficiency of list manipulation. There is
* effectively a two way link between the object containing the list item and
* the list item itself.

View file

@ -140,6 +140,8 @@ static void prvThreadKeyDestructor( void * pvData )
static void prvInitThreadKey( void )
{
pthread_key_create( &xThreadKey, prvThreadKeyDestructor );
/* Destroy xThreadKey when the process exits. */
atexit( prvDestroyThreadKey );
}
/*-----------------------------------------------------------*/
@ -193,7 +195,7 @@ void prvFatalError( const char * pcCall,
}
/*-----------------------------------------------------------*/
static void prvPortSetCurrentThreadName( char * pxThreadName )
static void prvPortSetCurrentThreadName( const char * pxThreadName )
{
#ifdef __APPLE__
pthread_setname_np( pxThreadName );
@ -315,8 +317,6 @@ BaseType_t xPortStartScheduler( void )
/* Restore original signal mask. */
( void ) pthread_sigmask( SIG_SETMASK, &xSchedulerOriginalSignalMask, NULL );
prvDestroyThreadKey();
return 0;
}
/*-----------------------------------------------------------*/