]> begriffs open source - freertos/log
freertos
10 months agoRP2040: update FreeRTOS_Kernel_import.cmake to match the newer version in Community...
Graham Sanderson [Mon, 10 Feb 2025 05:32:36 +0000 (23:32 -0600)]
RP2040: update FreeRTOS_Kernel_import.cmake to match the newer version in Community-Supported-Ports (#1243)

- The newer version looks in Community-Supported-Ports too

Co-authored-by: graham sanderson <graham.sanderson@raspeberryi.com>
10 months agoFix GCC/Posix port compilation on FreeBSD (#1239) (#1240)
Jakub Tymejczyk [Fri, 7 Feb 2025 01:21:34 +0000 (02:21 +0100)]
Fix GCC/Posix port compilation on FreeBSD (#1239) (#1240)

On FreeBSD pthread_once_t is a struct and cast is required.
Otherwise there's compilation error:
../../mocks/freertos/port.c:261:23: error: expected expression
    hSigSetupThread = PTHREAD_ONCE_INIT;
                      ^
PTHREAD_ONCE_INIT is defined as: { PTHREAD_NEEDS_INIT, NULL } on FreeBSD

Co-authored-by: Jakub Tymejczyk <jakub.tymejczyk@enigma.com.pl>
10 months agoCall key creation before checking if a thread is FreeRTOS (#1238)
Rahul Kar [Thu, 6 Feb 2025 09:11:19 +0000 (14:41 +0530)]
Call key creation before checking if a thread is FreeRTOS (#1238)

10 months agoReinstate "Fix inaccurate ticks in windows port" (#1198)
Ben Nicholls [Tue, 4 Feb 2025 05:33:44 +0000 (16:33 +1100)]
Reinstate "Fix inaccurate ticks in windows port" (#1198)

Reinstates PR https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/142 that was reverted in https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/143

Co-authored-by: Ben Nicholls <benn@smartbadge.com.au>
11 months agoMark mutex as robust to prevent deadlocks (#1233)
Gaurav-Aggarwal-AWS [Wed, 29 Jan 2025 01:57:30 +0000 (07:27 +0530)]
Mark mutex as robust to prevent deadlocks (#1233)

Mark mutex as robust to prevent deadlocks

Prevent application hangs that occur when a thread dies while holding a
mutex, particularly during vTaskEndScheduler or exit calls. This is
achieved by setting the PTHREAD_MUTEX_ROBUST attribute on the mutex.

Fixes:
- GitHub issue: FreeRTOS/FreeRTOS-Kernel#1217
- Forum thread: freertos.org/t/22287

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
11 months agofix: SA violation fixes and simplification for idle task length restrictions (#1227)
Kody Stribrny [Tue, 28 Jan 2025 17:13:17 +0000 (09:13 -0800)]
fix: SA violation fixes and simplification for idle task length restrictions (#1227)

fix: SA violation fixes and simplification for idle task length restrictions

This change:
* Removes the dependency on strings.h for the prvCreateIdleTask function
* Resolves several static analysis violations reported by tools like Parasoft

Builds off of - https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/1203

11 months agoUpdate Community-Supported-Ports submod to fix RP2350 port - FreeRTOS-Kernel#1220...
Cavin McKinley [Sat, 25 Jan 2025 09:38:49 +0000 (03:38 -0600)]
Update Community-Supported-Ports submod to fix RP2350 port - FreeRTOS-Kernel#1220 (#1232)

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
11 months agoFix the context array size for MPU ports (#1230)
Gaurav-Aggarwal-AWS [Sat, 25 Jan 2025 08:04:03 +0000 (13:34 +0530)]
Fix the context array size for MPU ports (#1230)

Fix the context array size for MPU ports

Ensure the saved context location falls within the reserved context area
rather than overlapping with the next MPU_SETTINGS structure member.

This never caused a problem because actual read/write operations
start from one word before the saved context location.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
11 months agoPOSIX Simulator: Handle `pthread`s not created by FreeRTOS differently (#1223)
John Boiles [Sat, 25 Jan 2025 00:56:59 +0000 (16:56 -0800)]
POSIX Simulator: Handle `pthread`s not created by FreeRTOS differently (#1223)

11 months agoportable: aarch64_sre: Add support for vApplicationFPUSafeIRQHandler
Marouen Ghodhbane [Fri, 11 Oct 2024 13:36:42 +0000 (15:36 +0200)]
portable: aarch64_sre: Add support for vApplicationFPUSafeIRQHandler

The application writer needs to name their IRQ handler as:
1. vApplicationIRQHandler if the IRQ handler does not use FPU registers.
2. vApplicationFPUSafeIRQHandler is the IRQ handler uses FPU registers.

When the application uses vApplicationFPUSafeIRQHandler, a default
implementation of vApplicationIRQHandler is used which stores FPU
registers and then calls vApplicationFPUSafeIRQHandler.

Note that recent versions of GCC may use FP/SIMD registers to optimize 16-bytes
copy and especially when using va_start()/va_arg() functions (e.g printing some thing
in IRQ handlers may trigger usage of FPU registers)

This implementation is heavily inspired by both the ARM_CA9 port and the ARM_CRx_No_GIC
port done in [1]

[1] https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/1113

Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
11 months agoportable: aarch64_sre: add the configuration and status registers to the fpu saved...
Marouen Ghodhbane [Wed, 9 Oct 2024 16:34:55 +0000 (18:34 +0200)]
portable: aarch64_sre: add the configuration and status registers to the fpu saved context

FPSR and FPCR are two 64-bits registers where only the lower 32 bits are defined.
Save them when doing context switch with FPU context saving enabled.

Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
11 months agoportable: aarch64_sre: add configUSE_TASK_FPU_SUPPORT support
Marouen Ghodhbane [Wed, 9 Oct 2024 15:31:45 +0000 (17:31 +0200)]
portable: aarch64_sre: add configUSE_TASK_FPU_SUPPORT support

This is a direct backport of upstream commit [1] for aarch64 (legacy operation port)
done under [2]
The same code can be applied on the aarch SRE port to be able to enable FPU context
saving on all tasks context switch to mitigate GCC optimization to use SIMD registers
for copy.

[1] "55eceb22: Add configUSE_TASK_FPU_SUPPORT to AARCH64 port (#1048)"
[2] https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/1048

Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
11 months agoAdd xQueueCreateSetStatic method for static allocation of Queue Sets (#1228)
kzorer [Wed, 22 Jan 2025 09:23:35 +0000 (12:23 +0300)]
Add xQueueCreateSetStatic method for static allocation of Queue Sets (#1228)

Add xQueueCreateSetStatic method for static allocation of Queue Sets

This commit introduces the xQueueCreateSetStatic function, which allows for the static allocation of Queue Sets in FreeRTOS when both configUSE_QUEUE_SETS and configSUPPORT_STATIC_ALLOCATION are enabled.

11 months agoUpdate stream and message buffer documentation (#1226)
Gaurav-Aggarwal-AWS [Tue, 21 Jan 2025 09:47:10 +0000 (15:17 +0530)]
Update stream and message buffer documentation (#1226)

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
11 months agoPOSIX Simulator: Remove unused __APPLE__ mach_vm.h include (#1225)
John Boiles [Tue, 21 Jan 2025 08:50:16 +0000 (00:50 -0800)]
POSIX Simulator: Remove unused __APPLE__ mach_vm.h include (#1225)

Remove unused __APPLE__ mach_vm.h include

11 months agoARMv8.1-M: Add task dedicated PAC key support (#1195)
Ahmed Ismail [Tue, 14 Jan 2025 05:20:52 +0000 (05:20 +0000)]
ARMv8.1-M: Add task dedicated PAC key support (#1195)

armv8.1-m: Add task dedicated PAC key

To harden the security, each task is assigned a dedicated PAC key, so that attackers needs to guess the all the tasks' PAC keys right to exploit the system using Return Oriented Programming.

The kernel is now updated to support the following:
* A PAC key set with a random number generated and is saved in the task's context when a task is created.
* As part of scheduling, the task's PAC key is stored/restored to/from the task's context when a task is unscheduled/scheduled from/to run.

stack-overflow-check: Introduce portGET_CURRENT_TOP_OF_STACK macro

When MPU wrapper v2 is used, the task's context is stored in TCB and `pxTopOfStack`` member of TCB points to the context location in TCB. We, therefore, need to read PSP to find the task's current top of stack.

Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
11 months agoFix function parameter shadowing global variable. (#1221)
creiter64 [Mon, 13 Jan 2025 22:48:10 +0000 (23:48 +0100)]
Fix function parameter shadowing global variable. (#1221)

The function vApplicationFPUSafeIRQHandler gets the value of ICCIAR as
parameter, but a constant containing the address of ICCIAR was also
defined. Fix the name of the constant to align it with what it actually
holds.

11 months agoUpdate community supported ports submodulees (#1218)
iotah [Mon, 6 Jan 2025 05:35:53 +0000 (13:35 +0800)]
Update community supported ports submodulees (#1218)

Signed-off-by: Hua Zheng <hua.zheng@embeddedboys.com>
Co-authored-by: Hua Zheng <hua.zheng@embeddedboys.com>
12 months agoAdd a stack pointer bounds check when configCHECK_FOR_STACK_OVERFLOW is set to 2...
Ren Mingrui [Mon, 30 Dec 2024 09:11:52 +0000 (17:11 +0800)]
Add a stack pointer bounds check when configCHECK_FOR_STACK_OVERFLOW is set to 2. (#1216)

Add a stack pointer bounds check when configCHECK_FOR_STACK_OVERFLOW is set to 2.

12 months agoPass core ID to port lock macros (#1212)
Felix van Oost [Mon, 30 Dec 2024 08:58:49 +0000 (03:58 -0500)]
Pass core ID to port lock macros (#1212)

Pass core ID to task/ISR lock functions

12 months agoAdd an example of human readable table generated by vTaskListTasks() to tash.h (...
wwhheerree [Tue, 24 Dec 2024 11:11:44 +0000 (19:11 +0800)]
Add an example of human readable table generated by vTaskListTasks() to tash.h (#1215)

* Add an example of human readable table generated by vTaskListTasks() to task.h

12 months agofix(freertos): Limit idle task name length copy operation and ensure null-termination...
Sudeep Mohanty [Fri, 20 Dec 2024 07:43:04 +0000 (13:13 +0530)]
fix(freertos): Limit idle task name length copy operation and ensure null-termination of the idle task name string (#1203)

* fix(freertos): Limit idle task name copy operation and ensure null termination

This commit:
- Limits the idle task name length copy operation to prevent
  Out-of-bounds memory access warnings from static code analyzers.
- Fixes a bug where in the idle task name could be non null-terminated
  string for SMP configuration.

Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
12 months agoRemove unused config parameters (#1211)
Gaurav-Aggarwal-AWS [Thu, 19 Dec 2024 18:38:52 +0000 (00:08 +0530)]
Remove unused config parameters (#1211)

These were reported here - https://github.com/FreeRTOS/FreeRTOS-Kernel/issues/1210.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
12 months agoPass core ID to critical nesting count macros (#1206)
Felix van Oost [Thu, 19 Dec 2024 08:50:43 +0000 (03:50 -0500)]
Pass core ID to critical nesting count macros (#1206)

* Pass core ID to CRITICAL_NESTING_COUNT macros

* Match existing data type for xCoreID

* Get core ID when interrupts are disabled

* Implement get core ID with interrupt disabled

* Get core ID inline within vTaskSuspendAll() to resolve compiler warning

* Fix formatting check

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
---------

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Ching-Hsin,Lee <chinglee@amazon.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
12 months agoRefine VFP context for Coretex-A9 (#1209)
Saiiijchan [Tue, 17 Dec 2024 11:55:20 +0000 (19:55 +0800)]
Refine VFP context for Coretex-A9 (#1209)

s0–s15 (d0–d7, q0–q3) and d16–d31 (q8–q15) are caller save
register

Signed-off-by: wangfei_chen <wangfei_chen@realsil.com.cn>
Co-authored-by: wangfei_chen <wangfei_chen@realsil.com.cn>
12 months agoRegression Bug Fix: Fix Incorrect Return of MSVC-MingW portYIELD_FROM_ISR (#1207)
wwhheerree [Mon, 16 Dec 2024 13:18:54 +0000 (21:18 +0800)]
Regression Bug Fix: Fix Incorrect Return of MSVC-MingW portYIELD_FROM_ISR (#1207)

There is a regression issue introduced in
    https://github.com/FreeRTOS/FreeRTOS-Kernel/commit/cfc268814a94a4deb8ddc8322b63ccae270a8669.
    This PR was intended to update MIT licensed header from v9 to v10.
    But it accidentally changed "portYIELD_FROM_ISR( x )" in MSVC-MingW/portmacro.h.
    It caused "portYIELD_FROM_ISR( x )" does not return correct value to "prvProcessSimulatedInterrupts".

12 months agoAdd macro guard configUSE_MPU_WRAPPERS_V1 to remove definition missing warning. ...
Rahul Kar [Mon, 16 Dec 2024 12:56:43 +0000 (18:26 +0530)]
Add macro guard configUSE_MPU_WRAPPERS_V1 to remove definition missing warning. (#1208)

Add macro guard to removed definition missing warning

12 months agoUpdate manifest to use 'V' (#1201)
Kody Stribrny [Mon, 2 Dec 2024 19:29:36 +0000 (11:29 -0800)]
Update manifest to use 'V' (#1201)

Release tags use a capitalized V.
Our manifest tag is used by our SBOM
script to generate the URL and so
this needs to be capitalized to generate
a valid URL.

13 months agoFix CMake build for RP2040 (#1197)
yh-sb [Mon, 25 Nov 2024 05:24:41 +0000 (07:24 +0200)]
Fix CMake build for RP2040 (#1197)

Add public dependency to hardware_sync because portable\ThirdParty\GCC\RP2040\include\portmacro.h exposes include "hardware/sync.h" to FreeRTOS.h which is PUBLIC.

Add private dependency to pico_multicore because of usage prvFIFOInterruptHandler() and sio_hw in portable/ThirdParty/GCC/RP2040/port.c.

13 months agoRemoving the old -RV32 directory name from parts of the documentation (#1196)
Ryan [Wed, 20 Nov 2024 06:38:15 +0000 (01:38 -0500)]
Removing the old -RV32 directory name from parts of the documentation (#1196)

13 months agoUpdate partner supported and community supported ports submodulees (#1194)
Tony Josi [Thu, 14 Nov 2024 05:39:55 +0000 (11:09 +0530)]
Update partner supported and community supported ports submodulees (#1194)

13 months agoarmv8.1-m: Remove portHAS_PACBTI_FEATURE macro (#1192)
Ahmed Ismail [Thu, 14 Nov 2024 04:31:06 +0000 (04:31 +0000)]
armv8.1-m: Remove portHAS_PACBTI_FEATURE macro (#1192)

The PACBTI is an optional hardware security feature,
the current implementation assumes that every SoC that
has Armv8.1-M architecture extension, has the PACBTI
hardware feature, which does not have to be the case.
Hence, the `portHAS_PACBTI_FEATURE` is removed
and the implementation is modified to rely on
`configENABLE_PAC` and `configENABLE_BTI` macros
that can either be set using CMake or FreeRTOSConfig.h
header file.

Enabling PAC and/or BTI on a port variant that
doesn't have the PACBTI hardware feature would be
caught by a `configASSERT` statement.

Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
Co-authored-by: Tony Josi <tonyjosi@amazon.com>
13 months agoRP2040 Updates: (#1193)
Graham Sanderson [Thu, 14 Nov 2024 04:17:50 +0000 (22:17 -0600)]
RP2040 Updates: (#1193)

* Standardize on configNUMBER_OF_CORES != 1 to select SMP functionality
* Fix SDK pico_sync interoperability (configSUPPORT_PICO_SYNC_INTEROP == 1)

Co-authored-by: graham sanderson <graham.sanderson@raspeberryi.com>
13 months agoAdd xPortResetHeapMinimumEverFreeHeapSize to heap5 (#1191)
Gaurav-Aggarwal-AWS [Wed, 13 Nov 2024 08:01:41 +0000 (13:31 +0530)]
Add xPortResetHeapMinimumEverFreeHeapSize to heap5 (#1191)

The same was added to heap 4 in this PR - https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/1189.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
13 months agoDon't suspend scheduler if task already notified (#1190)
Jeff Tenney [Tue, 12 Nov 2024 11:05:33 +0000 (04:05 -0700)]
Don't suspend scheduler if task already notified (#1190)

* Don't suspend scheduler if task already notified

13 months agoHeap: add new API to reset xMinimumEverFreeBytesRemaining. (#1189)
Tomas Galbicka [Tue, 12 Nov 2024 04:28:38 +0000 (05:28 +0100)]
Heap: add new API to reset xMinimumEverFreeBytesRemaining. (#1189)

This commit adds new API functionality to reset xMinimumEverFreeBytesRemaining.
This functionality provides ability to get heap statistics during a particular period of time.

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
13 months agoEnhancements and Bug Fixes for F1Kx Port (#1169)
Trong Nguyen [Tue, 5 Nov 2024 08:09:50 +0000 (15:09 +0700)]
Enhancements and Bug Fixes for F1Kx Port (#1169)

Fix FPU stack order issue and Improve FPU checking flow
Fix Interrupt depth comparison logic
Fix parameter mismatch in portmacro.h file
Add comment to explain assembly code

13 months agoFix SMP debugging issue on rp2040 (#1174)
Vishwanath Martur [Mon, 4 Nov 2024 16:21:51 +0000 (21:51 +0530)]
Fix SMP debugging issue on rp2040 (#1174)

* Fix SMP debugging issue on rp2040

Related to #1172

Add `multicore_reset_core1` before `multicore_launch_core1` in `xPortStartScheduler` function to fix debugging issue on rp2040 with SMP enabled.

* Modify `portable/ThirdParty/GCC/RP2040/port.c` to include a call to `multicore_reset_core1` before `multicore_launch_core1` within the `#if portRUNNING_ON_BOTH_CORES` block.

* Recover comments back

---------

Co-authored-by: ActoryOu <jay2002824@gmail.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
13 months agoFix RISC-V configMTIMECMP_BASE_ADDRESS (64-bit) stored in 32-bit int (#1176)
Vishwanath Martur [Mon, 4 Nov 2024 12:32:35 +0000 (18:02 +0530)]
Fix RISC-V configMTIMECMP_BASE_ADDRESS (64-bit) stored in 32-bit int (#1176)

Related to #189

Update `configMTIMECMP_BASE_ADDRESS` to be stored in a 64-bit integer.

* Change the type of `ullMachineTimerCompareRegisterBase` to `uint64_t` in `portable/GCC/RISC-V/port.c`.
* Change the type of `ullMachineTimerCompareRegisterBase` to `uint64_t` in `portable/IAR/RISC-V/port.c`.
* Update the initialization of `ullMachineTimerCompareRegisterBase` to use `configMTIMECMP_BASE_ADDRESS` in both files.

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
13 months agoMove configASSERT default definition above before including portable.h. (#1185)
ActoryOu [Mon, 4 Nov 2024 11:05:52 +0000 (19:05 +0800)]
Move configASSERT default definition above before including portable.h. (#1185)

Move configASSERT default definition above before including portable.h.

13 months agoFollow GitHub recommendation to update release.yml (#1178)
ActoryOu [Mon, 4 Nov 2024 09:23:28 +0000 (17:23 +0800)]
Follow GitHub recommendation to update release.yml (#1178)

GitHub recommends to store user inputs in environments variables
and then use them in scripts. This PR updates the code as per the
GitHub recommendation.

Details here - https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#understanding-the-risk-of-script-injections.

13 months agoAdd assert check for NULL TCB handle (#1177)
Rahul Kar [Sat, 2 Nov 2024 02:43:53 +0000 (08:13 +0530)]
Add assert check for NULL TCB handle (#1177)

Co-authored-by: ActoryOu <jay2002824@gmail.com>
14 months agoFix variable name mismatch, mpu_wrappers type mismatch. (#1181)
Kody Stribrny [Fri, 1 Nov 2024 17:56:18 +0000 (10:56 -0700)]
Fix variable name mismatch, mpu_wrappers type mismatch. (#1181)

Fix variable name mismatch introduced by #1166.
Fix MPU v2 wrappers incorrectly using UBaseType_t instead
of BaseType.

14 months agoFix spelling typos (#1168)
ActoryOu [Fri, 1 Nov 2024 17:09:49 +0000 (01:09 +0800)]
Fix spelling typos (#1168)

* Fix spelling

---------

Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
14 months agoFix AutoReload variable name (#1166)
Kody Stribrny [Thu, 31 Oct 2024 16:03:25 +0000 (09:03 -0700)]
Fix AutoReload variable name (#1166)

Removes the 'u' prefix as the variable is no longer unsigned.

14 months agofreertos-config: Fix library definitions scope (#1164)
Ahmed Ismail [Fri, 25 Oct 2024 22:33:33 +0000 (23:33 +0100)]
freertos-config: Fix library definitions scope (#1164)

Since `freertos_config` is an interface library,
`INTERFACE` scope shall be used to define compile
definitions.

Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
14 months agoPOSIX Port: Remove pthread_attr_setstacksize call (#1161)
Paul Hollinsky [Thu, 24 Oct 2024 06:42:27 +0000 (23:42 -0700)]
POSIX Port: Remove pthread_attr_setstacksize call (#1161)

We have removed the use of pthread_attr_setstack and as a result,
the task stack is no longer used as the corresponding pthread's stack.
There is no use of calling pthread_attr_setstacksize as the default is
always good enough and we don't need to handle OS specific cases.

This PR simplifies the code by removing the call to pthread_attr_setstacksize.

Signed-off-by: Paul Hollinsky <paulhollinsky@gmail.com>
14 months agoArmv8.1-m: Add pacbti support (#1147)
Ahmed Ismail [Thu, 24 Oct 2024 06:25:16 +0000 (07:25 +0100)]
Armv8.1-m: Add pacbti support (#1147)

* copyright-checker: Add FreeRTOS Arm collab copyright

FreeRTOS Arm collab files shall have both Amazon's
and Arm's copyright headers. Hence, the copyright
checker is modified to check for both copyrights.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
* armv8-m: Add support for IAR with TFM FREERTOS PORT

As the case for ARMClang, and GCC toolchains, IAR
with TFM FreeRTOS Port support is added.

Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
* armv8-m: Do not overwrite Control register value

The current ARMv8-M FreeRTOS-Kernel Port code
implementation is modified in a way that allows
the CONTROL register's value to be retained
rather than being overwritten.

This is needed for adding PACBTI support as
the special-purpose CONTROL register `PAC_EN`,
`UPAC_EN`, `BTI_EN`, and `UBTI_EN` PACBTI
enablement bits should be configured before calling
`vRestoreContextOfFirstTask()` function which currently
overwrite the value inside the CONTROL register.

Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
* armv8.1-m: Add PACBTI support to kernel non-secure implementation

In this commit, Pointer Authentication, and Branch Target
Identification Extension (PACBTI) support is added for
Non-Secure and Non-TrustZone variants of Cortex-M85
FreeRTOS-Kernel Port.

The PACBTI support is added for Arm Compiler For
Embedded, and IAR toolchains only. The support in
the kernel is not yet enabled for GNU toolchain
due to known issues.

Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
* Fix CI check

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
---------

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
Co-authored-by: Ahmed Ismail <ahmism01@e133373.arm.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
14 months agoUpdate .github/CODEOWNERS (#1162)
Tony Josi [Tue, 22 Oct 2024 12:46:46 +0000 (18:16 +0530)]
Update .github/CODEOWNERS (#1162)

14 months agoFix incorrect error checking of prvCreateIdleTasks (#1158)
kakkoko [Wed, 16 Oct 2024 09:36:20 +0000 (18:36 +0900)]
Fix incorrect error checking of prvCreateIdleTasks (#1158)

In environments that do not support static allocation
(configSUPPORT_STATIC_ALLOCATION == 0), at prvCreateIdleTasks(), call
xCreateTask() and compare its return value to pdFAIL to check whether
xCreateTask() failed. However, xCreateTask() returns
errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY as the error value, so the
result of this comparison is always false.

This commit fixes this problem by changing the return value comparison
to pdPASS instead of pdFAIL.

14 months agoXtensa support updated and moved to Partner-Supported submodules (#1156)
Ian Thompson [Tue, 15 Oct 2024 16:02:11 +0000 (09:02 -0700)]
Xtensa support updated and moved to Partner-Supported submodules (#1156)

* Xtensa support moved to Partner-Supported ports

Removing legacy Xtensa port; leave README with pointer to latest code

* Updated submodule ThirdParty/FreeRTOS-Kernel-Partner-Supported-Ports

14 months ago[Fixed the Issue] Fixed the Issue#1102 of RL78 of the Context switch issue. https...
K.Kashi [Tue, 15 Oct 2024 05:39:45 +0000 (14:39 +0900)]
[Fixed the Issue] Fixed the Issue#1102 of RL78 of the Context switch issue. https://github.com/FreeRTOS/FreeRTOS-Kernel/issues/1102 (#1157)

14 months agorefactor: change methods ENTER|EXIT critical (#1140)
Guilherme Giácomo Simões [Mon, 7 Oct 2024 05:07:50 +0000 (02:07 -0300)]
refactor: change methods ENTER|EXIT critical (#1140)

refactor: change methods ENTER|EXIT critical

The read and write of BaseType_t are atomic for a number of ports
and therefore, do not require taskENTER_CRITICAL/taskEXIT_CRITICAL.
This PR introduces portBASE_TYPE_ENTER_CRITICAL and
portBASE_TYPE_EXIT_CRITICAL which default to  taskENTER_CRITICAL
and taskEXIT_CRITICAL. The APIs that read/write BaseType_t are updated
to use these new macros.

The next change would to be to define portBASE_TYPE_ENTER_CRITICAL and
portBASE_TYPE_EXIT_CRITICAL to nothing for ports where BaseType_t
read and write are atomic.

Signed-off-by: guilherme giacomo simoes <trintaeoitogc@gmail.com>
15 months agoUpdate MPU prototypes (#1150)
Gaurav-Aggarwal-AWS [Mon, 30 Sep 2024 06:11:52 +0000 (11:41 +0530)]
Update MPU prototypes (#1150)

Add missing MPU prototypes

This commit address the following issues with MPU prototypes:
1. Fix the decorator according to which MPU wrapper is used.
2. Add the missing prototypes for v1.
3. Add the corresponding mapping to mpu_wrappers.h.
4. Update MPU v1 wrappers for vTaskList and vTaskGetRunTimeStats.

This was reported here - https://forums.freertos.org/t/cortex-m55-and-16-region-mpu-support/21470/5.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
15 months agoChange the cast from UBaseType_t to size_t (#1153)
Gaurav-Aggarwal-AWS [Mon, 30 Sep 2024 05:50:04 +0000 (11:20 +0530)]
Change the cast from UBaseType_t to size_t (#1153)

This was causing problem for 8-bit ports.

This was reported here - https://github.com/FreeRTOS/FreeRTOS-Kernel/issues/1151

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
15 months agoRemove error for 16 MPU resgion from IAR ports (#1149)
Gaurav-Aggarwal-AWS [Mon, 23 Sep 2024 05:09:29 +0000 (10:39 +0530)]
Remove error for 16 MPU resgion from IAR ports (#1149)

Support for 16 MPU regions was added to Cortex-M33, M35P, M55 and M85
ports was added but the compile time error check was not removed. This
results in compilation error when 16 MPU regions are used. This PR
removes the not needed compile time error check.

It was reported here - https://forums.freertos.org/t/cortex-m55-and-16-region-mpu-support/21470.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
15 months agomodernize ARM assembler syntax (#1148)
Florian La Roche [Fri, 20 Sep 2024 17:19:09 +0000 (19:19 +0200)]
modernize ARM assembler syntax (#1148)

modernize ARM assembler syntax

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
15 months agoRefine heap_5 heap protector (#1146)
Saiiijchan [Thu, 19 Sep 2024 05:06:52 +0000 (13:06 +0800)]
Refine heap_5 heap protector (#1146)

Add configVALIDATE_HEAP_BLOCK_POINTER on heap_5

heap_5 is used for multiple separated memory spaces. In the
previous implementation, it only verifies the highest and
lowest addresses. A pointer may not be within heap regions,
but is still located between the highest and lowest addressed.

Add maco configVALIDATE_HEAP_BLOCK_POINTER to provide
customized heap block pointers detection based on the settings
of heap regions.

Signed-off-by: wangfei_chen <wangfei_chen@realsil.com.cn>
15 months agoEvent Groups: snapshot xEventGroupSetBits returning value while in vTaskSuspendAll...
あく [Wed, 11 Sep 2024 17:37:08 +0000 (18:37 +0100)]
Event Groups: snapshot xEventGroupSetBits returning value while in vTaskSuspendAll (#1143)

Event Groups: snapshot xEventGroupSetBits returning value while in
vTaskSuspendAll. Fixes uxEventBits dereference after event group
deleted by higher priority thread.

15 months agoTask: fix compiler warning for architectures that does not define portARMV8M_MINOR_VE...
あく [Wed, 11 Sep 2024 13:56:16 +0000 (14:56 +0100)]
Task: fix compiler warning for architectures that does not define portARMV8M_MINOR_VERSION (#1144)

15 months agoUpdate upload-artifact GH action's version (#1145)
Gaurav-Aggarwal-AWS [Wed, 11 Sep 2024 06:06:58 +0000 (11:36 +0530)]
Update upload-artifact GH action's version (#1145)

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
15 months agoAdd configuration include to secure_heap.c (#1141)
Oliver Mueller [Tue, 10 Sep 2024 05:46:40 +0000 (07:46 +0200)]
Add configuration include to secure_heap.c (#1141)

Add configuration include to secure_heap.c

Enables actually changing the size of the secure heal

15 months agoFix IA32 compilation with common IRQ entry disabled (#1137)
Ryzee119 [Mon, 9 Sep 2024 07:24:38 +0000 (16:54 +0930)]
Fix IA32 compilation with common IRQ entry disabled (#1137)

15 months agoUpdate config macro for xTaskGetCurrentTaskHandle (#1136)
Rahul Kar [Wed, 4 Sep 2024 09:31:42 +0000 (09:31 +0000)]
Update config macro for xTaskGetCurrentTaskHandle (#1136)

15 months agoUpdate comment in the example for declaration of xTimerReset (#1133)
Rahul Kar [Mon, 2 Sep 2024 15:46:23 +0000 (15:46 +0000)]
Update comment in the example for declaration of xTimerReset (#1133)

* Update comment in the example for declaration of xTimerReset

* Fix formatting

16 months agoPend a yield in portPRE_TASK_DELETE_HOOK (#1132)
Gaurav-Aggarwal-AWS [Thu, 29 Aug 2024 15:51:35 +0000 (21:21 +0530)]
Pend a yield in portPRE_TASK_DELETE_HOOK (#1132)

When a task deletes itself, it calls portPRE_TASK_DELETE_HOOK which
translates to vPortCloseRunningThread on the Windows port.
vPortCloseRunningThread never returns and as a result,
taskYIELD_WITHIN_API in vTaskDelete does not get called. As a result,
the next task is not scheduled when configUSE_PREEMPTION is set to 0.

This change records that a yield is pending so that the next tick
interrupt switches out the task that was deleted.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
16 months agoGCC: ARM_CM0: Fix L6286E error on Keil MDK (#1131)
Tomas Galbicka [Thu, 29 Aug 2024 08:36:33 +0000 (10:36 +0200)]
GCC: ARM_CM0: Fix L6286E error on Keil MDK (#1131)

Change the .b instruction to .bx with higher range to solve error
reported by MDK descibed bellow.

Fix:
Error: L6286E: Relocation #REL:0 in portasm.o(.text.SVC_Handler) with respect to vPortSVCHandler_C. Value(0x1a04) out of range(-0x800 - 0x7fe) for (R_ARM_THM_JUMP11)

Compiler: Keil MDK ARMClang 6.22.0

https://developer.arm.com/documentation/ka002847/latest/
https://developer.arm.com/documentation/dui0496/m/Linker-Errors-and-Warnings/List-of-the-armlink-error-and-warning-messages

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
16 months agoUpdate CMakeLists.txt to proper name for the ports (#1129)
Rahul Kar [Thu, 22 Aug 2024 04:33:58 +0000 (04:33 +0000)]
Update CMakeLists.txt to proper name for the ports (#1129)

16 months agoRemove access check from ISR function (#1127)
Rahul Kar [Wed, 21 Aug 2024 09:54:46 +0000 (09:54 +0000)]
Remove access check from ISR function (#1127)

16 months agoAdd heap protector to allocted heap blocks (#1125)
Saiiijchan [Tue, 20 Aug 2024 13:04:43 +0000 (21:04 +0800)]
Add heap protector to allocted heap blocks (#1125)

When validate those allocated heap block structure, the canary is not used.
Do xor with canary when allocating a new block.

Signed-off-by: wangfei_chen <wangfei_chen@realsil.com.cn>
Co-authored-by: wangfei_chen <wangfei_chen@realsil.com.cn>
16 months agoYield for task when core affinity of a ready task is changed (#1123)
chinglee-iot [Tue, 20 Aug 2024 04:34:01 +0000 (12:34 +0800)]
Yield for task when core affinity of a ready task is changed (#1123)

* The SMP scheduler should re-select a core to yield when the core
  affinity of a ready task is changed.

16 months agoRemove hardware dependence in portmacros.h (#1112)
mayl [Mon, 19 Aug 2024 06:01:30 +0000 (02:01 -0400)]
Remove hardware dependence in portmacros.h (#1112)

* Remove hardware dependence in portmacros.h

The IAR MSP430X port `#include "msp430.h"` which pulls all the hardware
register definitions into anything which `#include "FreeRTOS.h"`.  This
removes that hardware dependency "leak" by removing the header file
and re-defining the `portDISABLE_INTERRUPTS()` and
`portENABLE_INTERRUPTS()` macros in terms of `__asm`.

* Code review suggestions

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
---------

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
16 months agoFix compilation issue of IA32_flat port (#1122)
Rahul Kar [Mon, 19 Aug 2024 05:37:24 +0000 (05:37 +0000)]
Fix compilation issue of IA32_flat port (#1122)

* Fix compilation issue of IAR32 port

* Add new line at EOF

* Fix header check

---------

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
16 months agoOptimize xTaskIncrementTick for configNUMBER_OF_CORES > 1 (#1118)
Chen YM [Mon, 19 Aug 2024 05:04:33 +0000 (13:04 +0800)]
Optimize xTaskIncrementTick for configNUMBER_OF_CORES > 1 (#1118)

The original implementation only initializes the first
variable. After executing xTaskIncrementTick, the schedule
might not behave as expected.

When configUSE_PREEMPTION == 1 & configUSE_TIME_SLICING == 1,
replace setting xYieldRequiredForCore[ xCoreID ] with setting
xYieldPendings[ xCoreID ].

And when configUSE_PREEMPTION == 1, simplify the check
condition to only check xYieldPendings[ xCoreID ].

Signed-off-by: cymzier <cymb103u@cs.ccu.edu.tw>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
16 months agoModify the name of a private function to reflect what it actually does (#1119)
xuelix [Wed, 14 Aug 2024 18:08:32 +0000 (11:08 -0700)]
Modify the name of a private function to reflect what it actually does (#1119)

16 months agoUpdated the return values for functions in queue.c based on the actua… (#1117)
xuelix [Mon, 12 Aug 2024 22:47:30 +0000 (15:47 -0700)]
Updated the return values for functions in queue.c based on the actua… (#1117)

* Updated the return values for functions in queue.c based on the actual code.

16 months agoAdd portMEMORY_BARRIER defination to fix over-optimization in xTaskResumeAll. (#1116)
superroc [Mon, 12 Aug 2024 11:36:47 +0000 (19:36 +0800)]
Add portMEMORY_BARRIER defination to fix over-optimization in xTaskResumeAll. (#1116)

Co-authored-by: owen <owen@freqchip.com>
16 months agoAdd CC-RH port for Renesas F1Kx devices (#1100)
Trong Nguyen [Fri, 9 Aug 2024 05:51:21 +0000 (12:51 +0700)]
Add CC-RH port for Renesas F1Kx devices (#1100)

Add CC-RH port for Renesas F1Kx devices

16 months agoAdd support for vApplicationFPUSafeIRQHandler (#1113)
Rahul Kar [Thu, 8 Aug 2024 15:37:11 +0000 (21:07 +0530)]
Add support for vApplicationFPUSafeIRQHandler (#1113)

This PR adds support for vApplicationFPUSafeIRQHandler. The application
writer needs to name their IRQ handler as:
1. vApplicationIRQHandler if the IRQ handler does not use FPU registers.
2. vApplicationFPUSafeIRQHandler is the IRQ handler uses FPU registers.

When the application uses vApplicationFPUSafeIRQHandler, a default
implementation of vApplicationIRQHandler is used which stores FPU
registers and then calls vApplicationFPUSafeIRQHandler.

16 months agoReset xNextTaskUnblockTime in task notify FromISR APIs (#1111)
Gaurav-Aggarwal-AWS [Tue, 6 Aug 2024 05:19:48 +0000 (10:49 +0530)]
Reset xNextTaskUnblockTime in task notify FromISR APIs (#1111)

* Reset xNextTaskUnblockTime in task notify FromISR APIs

If a task is blocked waiting for a notification then
xNextTaskUnblockTime might be set to the blocked task's timeout time. If
the task is unblocked for a reason other than a timeout
xNextTaskUnblockTime is normally left unchanged, because it will
automatically get reset to a new value when the tick count equals
xNextTaskUnblockTime. However if tickless idle is used it is important
to enter sleep mode at the earliest possible time - so reset
xNextTaskUnblockTime here to ensure it is updated at the earliest
possible time.

This was reported here -
https://forums.freertos.org/t/the-vtaskgenericnotifygivefromisr-function-need-call-prvresetnexttaskunblocktime/21090

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
16 months agoOnly check for stream buffer dependencies, if configUSE_STREAM_BUFFERS==1. (#1109)
Daniel Otte [Mon, 5 Aug 2024 10:41:33 +0000 (12:41 +0200)]
Only check for stream buffer dependencies, if configUSE_STREAM_BUFFERS==1. (#1109)

Signed-off-by: Daniel Otte <d.otte@wut.de>
16 months agoUpdate broken links in readme and comments (#1110)
Rahul Kar [Mon, 5 Aug 2024 10:30:47 +0000 (16:00 +0530)]
Update broken links in readme and comments (#1110)

Update broken links in readme and comments

17 months agoDefine vApplicationGetTimerTaskMemory only when configUSE_TIMERS is set (#1104)
Björn Schäpers [Fri, 26 Jul 2024 06:48:35 +0000 (08:48 +0200)]
Define vApplicationGetTimerTaskMemory only when configUSE_TIMERS is set (#1104)

Otherwise it is very reasonable that config_TIMER_TASK_STACK_DEPTH is
undefined.

17 months agoFix POSIX port to respect configUSE_TIME_SLICING (#1103)
Gaurav-Aggarwal-AWS [Fri, 26 Jul 2024 05:12:33 +0000 (10:42 +0530)]
Fix POSIX port to respect configUSE_TIME_SLICING (#1103)

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
17 months agoUpdate ARM_CRx_No_GIC port (#1101)
Rahul Kar [Mon, 22 Jul 2024 15:35:17 +0000 (21:05 +0530)]
Update ARM_CRx_No_GIC port (#1101)

This PR makes the following improvements to the ARM_CRx_No_GIC port-

1. Remove inline assembly and move all the assembly code to the portASM.S
    file.

2. Add support for configUSE_TASK_FPU_SUPPORT -
   - When configUSE_TASK_FPU_SUPPORT is defined to 1, tasks are created
      without floating point context. Tasks that want to use floating point, need
      to call portTASK_USES_FLOATING_POINT(). This is the current behavior.
   - When configUSE_TASK_FPU_SUPPORT is defined to 2, each task is created
      with a floating point context.
  If left undefined, configUSE_TASK_FPU_SUPPORT defaults to 1 for backward compatibility.

3. The application writer can now implement vApplicationSVCHandler to handle the
    SVC calls raised within the application. SVC 0 is used for the yield kernel operation
    and the application can use all the SVC calls other than 0.

Signed-off-by: kar-rahul-aws <karahulx@amazon.com>
18 months agoUpdate LTS 202406 information (#1099)
chinglee-iot [Mon, 1 Jul 2024 09:02:00 +0000 (17:02 +0800)]
Update LTS 202406 information (#1099)

18 months agoFix gcc warning in posix port (#1098)
Florian La Roche [Sat, 29 Jun 2024 15:20:45 +0000 (17:20 +0200)]
Fix gcc warning in posix port (#1098)

Fix warning from "gcc -Wsign-compare" in the file
portable/ThirdParty/GCC/Posix/port.c since PTHREAD_STACK_MIN
is used from system headers.

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
18 months agofix typo gab -> gap and adjust indentation level (#1097)
Florian La Roche [Sat, 29 Jun 2024 06:07:15 +0000 (08:07 +0200)]
fix typo gab -> gap and adjust indentation level (#1097)

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
18 months agoUpdate XMOS xcore.ai port to be compatible with v11.x (#1096)
Angel Cascarino [Thu, 27 Jun 2024 22:49:53 +0000 (23:49 +0100)]
Update XMOS xcore.ai port to be compatible with v11.x (#1096)

* Fix kexcept function

* Create dummy pxCurrentTCBs for xcore.ai port

* Additional commentary

* Add a layer of indirection to cope with singlecore

* Clarify use of _DoException

18 months agoUpdate README.md (#1094)
Eric Dawe [Mon, 24 Jun 2024 11:40:51 +0000 (12:40 +0100)]
Update README.md (#1094)

Fix spelling of the word 'the' ('thw') in line 29

18 months agoFreeRTOS MPU: Add Privileged eXecute Never MPU attribute support (#1092)
Ahmed Ismail [Wed, 19 Jun 2024 15:12:50 +0000 (16:12 +0100)]
FreeRTOS MPU: Add Privileged eXecute Never MPU attribute support (#1092)

FreeRTOS MPU: Add privileged execute never MPU attribute

A new MPU region attribute Privileged eXecute Never (PXN)
is introduced in Armv8.1-M architecture, where if an MPU
region has PXN attribute set and the processor attempts
to execute the code inside with privileged level,
the Memory Management Fault exception would be triggered,
with IACCVIOL bit in MemManage Fault State Register set
to 1. The PXN feature allows privileged software to ensure
specific application tasks (threads) to execute in
unprivileged level only.

Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
18 months agoRemove run state assertion in prvCheckForRunStateChange (#1093)
chinglee-iot [Wed, 19 Jun 2024 10:29:04 +0000 (18:29 +0800)]
Remove run state assertion in prvCheckForRunStateChange (#1093)

In `prvCheckForRunStateChange()`, enabling interrupts should cause this core to immediately service the pending interrupt and yield. Upon the next scheduling of the task, the assertion `configASSERT(pxThisTCB->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD);` may not be true, as other cores could have requested a yield for this task before it evaluates its run state within the assertion. To address this, the task re-evaluates its run state in critical section within a loop until it is eligible for execution, which is the current implementation. Consequently, this assertion should be removed to ensure correct behavior.

18 months agoFix traceMALLOC() allocated bytes (#1089)
耀眼的大神 [Thu, 13 Jun 2024 05:25:54 +0000 (13:25 +0800)]
Fix traceMALLOC() allocated bytes (#1089)

* Fix traceMALLOC() memory count is inaccurate. (#1078)

Modify xWantedSize to the size of a free block when not split blocks.

Ensure that the sizes within traceMALLOC() and traceFREE() macros are equal.

* Create a new variable xAllocatedBlockSize for traceMALLOC()

---------

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
18 months agoUpdate link in third_party_tools.md (#1090)
Gaurav-Aggarwal-AWS [Wed, 12 Jun 2024 08:13:43 +0000 (13:43 +0530)]
Update link in third_party_tools.md (#1090)

Update the link to the getting started guide for Code Sonar.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com>
18 months ago- Changed macro __VFP_FP__ to __ARM_FP for ports GCC/ARM_CM7, GCC/ARM_CM4_MPU, and...
haydenridd [Tue, 11 Jun 2024 05:00:08 +0000 (22:00 -0700)]
- Changed macro __VFP_FP__ to __ARM_FP for ports GCC/ARM_CM7, GCC/ARM_CM4_MPU, and GCC/ARM_CM4F to accurately reflect if floating point hardware support is enabled (#1088)

Co-authored-by: Hayden Riddiford <hayden@terrakaffe.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
18 months agoAdd traceSTARTING_SCHEDULER tracing hook. (#1082)
Philipp Schilk [Mon, 10 Jun 2024 17:44:10 +0000 (19:44 +0200)]
Add traceSTARTING_SCHEDULER tracing hook. (#1082)

* Add traceSTARTING_SCHEDULER tracing hook.

Discussed here: https://forums.freertos.org/t/tracing-improvements/20097

This hook enables tracers to run code on startup after all RTOS
resources are created and to detect that the scheduler is starting without
relying on traceENTER/traceEXIT macros.

It also provides tracers access to the task handle of all IDLE tasks,
allowing them to be identified unambiguously and without relying on
INCLUDE_xTaskGetIdleTaskHandle.

18 months agoFix compilation warning about undelcared pthread_setname_np (#1079)
maxiao [Mon, 10 Jun 2024 10:32:04 +0000 (18:32 +0800)]
Fix compilation warning about undelcared pthread_setname_np (#1079)

Use _GNU_SOURCE macro instead of __USE_GNU and define it before
including portmacro.h. The reason is that portmacro.h includes limits.h
which in-turn includes features.h - this results in __USE_GNU getting
incorrectly undefined.

18 months agoevent_create(): check malloc() return value to be non-NULL (#1084)
Florian La Roche [Fri, 7 Jun 2024 08:17:13 +0000 (10:17 +0200)]
event_create(): check malloc() return value to be non-NULL (#1084)

* event_create(): check malloc() to be non-NULL

Check malloc() to return non-NULL before writing data
in the function event_create().

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
* Code review suggestion

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
---------

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
18 months agoAdd a list of third party tools (#1080)
Gaurav-Aggarwal-AWS [Fri, 7 Jun 2024 06:20:56 +0000 (11:50 +0530)]
Add a list of third party tools (#1080)

* Add a list of third party tools

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
18 months agoGive queue set queues a unique type number. (#1083)
Philipp Schilk [Thu, 6 Jun 2024 15:36:09 +0000 (17:36 +0200)]
Give queue set queues a unique type number. (#1083)

Discussed here: https://forums.freertos.org/t/tracing-improvements/20097

Changes the value of queueQUEUE_TYPE_SET to a unique value (5) to allow
tracers to differentiate between normal queues and queue sets.

Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>