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()
* Bugfix for race condition on RP2040 in vPortEnableInterrupts()
RP2040 SMP port: Since spin_unlock() re-enables interrupts, pxYieldSpinLock has to be updated first to avoid a possible race condition.
* Bugfix for invalid sanity checks on RP2040
RP2040 SMP port: Testing pxYieldSpinLock for NULL does not work reliable in these places, because another/new lock might already be set when configASSERT() is executed.
The kernel code that runs within RTOS ISRs requires that DP and CP not
be changed from their initial values. If a task changes them and is
interrupted while they are changed, then they must be restored for the
ISR. This commit implements this.
This relies on a corresponding change to the xcore lib_rtos_support.
* 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
* adding the kernel SMP documentation
Co-authored-by: Michael Bruno <mikeb@xmos.com>
* 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 tick interrupt priority must be configured to ensure that it cannot
interrupt a critical section. This change updates the comment to help
the application writer while debugging.
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
* Add an LCOV_BRANCH exception for the check that sizeof( StaticQueue_t ) == sizeof( Queue_t )
* Add LCOV_BRANCH coverage exception for a configASSERT on pxQueueSetContainer with a condition that is unreachable.
* Add configASSERTs to alert when invalid parameters are passed into Queue Registry related functions.
* Assert that the semaphore handle passed into xQueueGetMutexHolder is not NULL.
* Correct some typos in queue.c
* Update lexicon.txt