When configNUM_CORES is 1, prvYieldCore() generates an array subscript
outofbound error (-Warray-bounds) when compiled with GCC with space
optimization enabled (-Os).
This commit updates the code flow in prvYieldCore() to compile out
the part where yield is needed on the other core which is unnecessary
for single-core targets.
Previously, newlib's _impure_ptr was updated on every context switch
to point to the current task's _reent structure.
However, this behavior is no longer valid on multi-core systems due
to the fact that multiple cores can switch contexts at the same time,
thus leading to the corruption of the _impure_ptr.
However, Newlib can be compiled with __DYNAMIC_REENT__ enabled which
will cause newlib functions to call __getreent() instead in order to
obtain the required reent struct.
This commit adds dynamic reentrancy support to FreeRTOS:
- Added a configNEWLIB_REENTRANT_IS_DYNAMIC to enable dynamic reentrancy support
- _impure_ptr is no longer updated with reentrancy is dynamic
- Port must provide their own __getreent() that returns the current task's reent struct
This commit adds the functions listed below. These functions allow
tasks to be created with their core affinity already set.
- xTaskCreateAffinitySet()
- xTaskCreateStaticAffinitySet()
- xTaskCreateRestrictedAffinitySet()
- xTaskCreateRestrictedStaticAffinitySet()
* Add XMOS XCore ports
Some minor modifications are also made to the kernel to support the
XCore compiler's automatic stack size calculation.
* Update kernel to support SMP
The XMOS XCore ports are also updated to support SMP.
* Fix compiler warnings in xcore ports
The port set and clear interrupt mask from ISR macros were removed from
the ports so that the default macros found in FreeRTOS.h are used
instead. The default macros do not result in warnings when they are
used.
* Remove inline function from timers.h
Inline function converted to macro. This should now build when
optimizations are off and inlining is disabled.
* Fix compiler warnings in xcore ports and tasks.c
* fixed documentation for ulTaskNotifyTake() and ulTaskNotifyTakeIndexed()
* spelling fixes for tasks.c
Co-authored-by: Michael Bruno <mikeb@xmos.com>
The change adds support for allocating task stacks from separate heap.
When configSTACK_ALLOCATION_FROM_SEPARATE_HEAP is defined as 1 in
FreeRTOSConfig.h, task stacks are allocated and freed using
pvPortMallocStack and vPortFreeStack functions. This allows the
application writer to provide a separate allocator for task stacks.
When configSTACK_ALLOCATION_FROM_SEPARATE_HEAP is defined as 0, task
stacks are allocated and freed using FreeRTOS heap functions
pvPortMalloc and vPortFree.
For backward compatibility, configSTACK_ALLOCATION_FROM_SEPARATE_HEAP
defaults to 0.
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
If a higher priority task than the currently running task was resumed
using xTaskResumeFromISR and the user chose to ignore the return value
of xTaskResumeFromISR to initiate a context switch using
portYIELD_FROM_ISR, we were not doing the context switch on the next run
of the scheduler. This change fixes this by marking a yield as pending
to ensure that the context switch is performed on the next run of the
scheduler.
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
This PR:
Changes the INCLUDE_vTaskDelayUntil compile time constant to INCLUDE_xTaskDelayUntil.
Updates FreeRTOS.h to ensure backward compatibility for projects that already have INCLUDE_vTaskDelayUntil defined.
Updates the MPU prototypes, wrapper and implementation to use the updated xTaskDelayUntil() function.
Tests to be checked into the FreeRTOS/FreeRTOS repository after this PR.
* Style: fix some broken/redirect links
* Fix: atmel url
* Fix microchip typo
* Fix url links
* Fix shortcut link
* Comment: fix line wrapping
* Style: fix line wrapping to 80 chars
* Add now microchip beside Atmel
* Fix link in History
* Add Now Microchip before Atmel link
* Comment: add *
* Replace the following code that was used to force an assert:
configASSERT( pxTCB->ulNotifiedValue[ uxIndexToNotify ] == ~0UL );
with:
configASSERT( xTickCount == ( TickType_t ) 0 );
Because the former generates a warning on 64-bit architectures.
* Style: make freertos.org = FreeRTOS.org also add https
* Style: Fix freertos into FreeRTOS
* Style: Fix freertos into FreeRTOS
Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
* Style: Change FreeRTOS websites in comments
* Style: Change freertos to FreeRTOS in comments
* Style: Remove broken link
Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
* Removing StackMacros.h
* Moving 4 Function Prototypes out of the C files into the headers
* Revert "Removing StackMacros.h"
This reverts commit cdd8307817.
ulTaskGenericNotifyValueClear() returned the notification value of the
currently running task, not the target task. Now it returns the
notification value of the target task.
Some users expected xTaskCheckForTimeOut() to clear the 'last wake time'
value each time a timeout occurred, whereas it only did that in one path.
It now clears the last wake time in all paths that return that a timeout
occurred.
Some of the privileged symbols were not being placed in their respective
sections. This commit addresses those and places them in
privileged_functions or privileged_data section.
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>