Commit Graph

3565 Commits (main)
 

Author SHA1 Message Date
Gaurav-Aggarwal-AWS de7c014e92
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>
4 months ago
Gaurav-Aggarwal-AWS c0bfbb9692
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>
4 months ago
Florian La Roche 9788e7e46a
modernize ARM assembler syntax (#1148)
modernize ARM assembler syntax

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
4 months ago
Saiiijchan 61440fc664
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>
4 months ago
あく d3052f1f50
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.
5 months ago
あく d806240dfe
Task: fix compiler warning for architectures that does not define portARMV8M_MINOR_VERSION (#1144) 5 months ago
Gaurav-Aggarwal-AWS 40031cfc4c
Update upload-artifact GH action's version (#1145)
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
5 months ago
Oliver Mueller 310ace5dd0
Add configuration include to secure_heap.c (#1141)
Add configuration include to secure_heap.c

Enables actually changing the size of the secure heal
5 months ago
Ryzee119 93e8199078
Fix IA32 compilation with common IRQ entry disabled (#1137) 5 months ago
Rahul Kar a045081f73
Update config macro for xTaskGetCurrentTaskHandle (#1136) 5 months ago
Rahul Kar 4a3c9204ff
Update comment in the example for declaration of xTimerReset (#1133)
* Update comment in the example for declaration of xTimerReset

* Fix formatting
5 months ago
Gaurav-Aggarwal-AWS 6dab25ae4e
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>
5 months ago
Tomas Galbicka e6d8308fde
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>
5 months ago
Rahul Kar 23cfd114d3
Update CMakeLists.txt to proper name for the ports (#1129) 5 months ago
Rahul Kar 0b904a553a
Remove access check from ISR function (#1127) 5 months ago
Saiiijchan 18a168bcd2
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>
5 months ago
chinglee-iot e43553af1e
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.
5 months ago
mayl 2faa8bc154
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>
6 months ago
Rahul Kar 49e88310be
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>
6 months ago
Chen YM 294569e495
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>
6 months ago
xuelix a936c10e2c
Modify the name of a private function to reflect what it actually does (#1119) 6 months ago
xuelix 40dbccf142
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.
6 months ago
superroc 190906aeaf
Add portMEMORY_BARRIER defination to fix over-optimization in xTaskResumeAll. (#1116)
Co-authored-by: owen <owen@freqchip.com>
6 months ago
Trong Nguyen da3c35aa48
Add CC-RH port for Renesas F1Kx devices (#1100)
Add CC-RH port for Renesas F1Kx devices
6 months ago
Rahul Kar c963d24001
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.
6 months ago
Gaurav-Aggarwal-AWS 53c7e7c46f
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>
6 months ago
Daniel Otte d750173b76
Only check for stream buffer dependencies, if configUSE_STREAM_BUFFERS==1. (#1109)
Signed-off-by: Daniel Otte <d.otte@wut.de>
6 months ago
Rahul Kar 3d935e86d9
Update broken links in readme and comments (#1110)
Update broken links in readme and comments
6 months ago
Björn Schäpers fffed5e809
Define vApplicationGetTimerTaskMemory only when configUSE_TIMERS is set (#1104)
Otherwise it is very reasonable that config_TIMER_TASK_STACK_DEPTH is
undefined.
6 months ago
Gaurav-Aggarwal-AWS d844312131
Fix POSIX port to respect configUSE_TIME_SLICING (#1103)
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
6 months ago
Rahul Kar 5588ae68c8
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>
6 months ago
chinglee-iot 0452603a94
Update LTS 202406 information (#1099) 7 months ago
Florian La Roche f4f2e1596b
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>
7 months ago
Florian La Roche 646881e7f9
fix typo gab -> gap and adjust indentation level (#1097)
Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
7 months ago
Angel Cascarino 17dfd0f808
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
7 months ago
Eric Dawe 9e838293c2
Update README.md (#1094)
Fix spelling of the word 'the' ('thw') in line 29
7 months ago
Ahmed Ismail 31419bfcee
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>
8 months ago
chinglee-iot 0c79e74eaa
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.
8 months ago
耀眼的大神 76eb443821
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>
8 months ago
Gaurav-Aggarwal-AWS 663eaad1b2
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>
8 months ago
haydenridd 28b6a141ea
- 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>
8 months ago
Philipp Schilk e64d1e06b3
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.
8 months ago
maxiao bee9037c46
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.
8 months ago
Florian La Roche c431b358c8
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>
8 months ago
Gaurav-Aggarwal-AWS 11174fb860
Add a list of third party tools (#1080)
* Add a list of third party tools

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
8 months ago
Philipp Schilk 5a0898288d
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>
8 months ago
Philipp Schilk 69e1b7c64a
Clarify documentation of xTaskNumber in TaskStatus_t. (#1081)
Discussed here: https://forums.freertos.org/t/tracing-improvements/20097

Adds a note to the (confusingly named) xTaskNumber member of TaskStatus_t
explaining that the value is different to the TaskNumber that can be
accessed using the vTaskSetTaskNumber and vTaskGetTaskNumber functions.

The value returned is actually the value of uxTCBNumber in the TCB.
8 months ago
Ethan Slattery 65e6297b68 Add missing Extern "C" to MSVC portmacro.h 8 months ago
wdfk-prog 9f22177c02
Readability enhancements in heap_1.c (#1074)
* Remove  that Heap_1.c unnecessary judgment and code logic

* Remove useless alignment calculations and increase heap usage size

* Revert "Remove useless alignment calculations and increase heap usage size"

This reverts commit 7832a4bc11.

* Readability improvements

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

---------

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: huangly <huangly@milesight.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
8 months ago
Rahul Kar ef22228bda
Change UBaseType_t to BaseType_t for a boolean variable (#1072) 8 months ago