Commit graph

2955 commits

Author SHA1 Message Date
Hardy Griech 570ade4001
performance counting: ulTaskSwitchedInTime and ulTotalRunTime must be (#618)
arrays, index is core number
2023-02-02 15:40:27 -07:00
chinglee-iot 0f9e6e5b52
Remove prvSelectHighestPriorityTask call in vTaskSuspend (#610)
* Remove prvSelectHighestPriorityTask call in vTaskSuspend

* Every core starts with an idle task in SMP implementation and
  taskTASK_IS_RUNNING only return ture when the task is idle task before
  scheduler started. So prvSelectHighestPriorityTask won't be called in
  vTaskSuspend before scheduler started.
* Update prvSelectHighestPriorityTask to ensure that this function is
  called only when scheduler started.

* Fix kernel checker error
2023-01-24 13:55:36 +05:30
Sudeep Mohanty 8128208bde
Add support for retrieving a task's uxCoreAffinityMask with the vTaskGetInfo() API (#574)
* Add support for retrieving a task's uxCoreAffinityMask with the vTaskGetInfo() API

This commit adds support for retrieving the task's core affinity mask
when SMP is used for more than 1 cores and configUSE_CORE_AFFINITY is
enabled.

Signed-off-by: Sudeep Mohanty <sudp.mohanty@gmail.com>

* Apply suggestions from code review

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>

Signed-off-by: Sudeep Mohanty <sudp.mohanty@gmail.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2022-10-12 22:02:19 +05:30
Graham Sanderson 13f034eb74
RP2040: Fix compiler warning and comment (#509)
Co-authored-by: graham sanderson <graham.sanderson@raspeberryi.com>
2022-06-24 17:23:51 +05:30
Gaurav-Aggarwal-AWS b3918c7f38
Remove ThirdParty from core checker in smp branch (#512)
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2022-06-24 17:22:15 +05:30
graham sanderson b87dfa3e97 RP2040: Allow FreeRTOS to be added to the parent CMake project post initialization of the Pico SDK 2022-06-23 11:32:40 -07:00
Sudeep Mohanty 2eff037080
Update prvYieldCore() compile warning for single core targets (#505)
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.
2022-06-22 10:03:44 +05:30
Graham Sanderson 45dd83a8e3
Fix RP2040 assertion due to yield spin lock info being wrongly shared between multiple cores (#501)
Co-authored-by: graham sanderson <graham.sanderson@raspeberryi.com>
2022-06-09 10:59:35 -07:00
Darian 34b8e24d7c
Add support for newlib dynamic reentrancy (#496)
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
2022-05-31 16:11:02 -07:00
Darian a97741a08d
Add task creation with affinity functions (#470)
This commit adds the functions listed below. These functions allow
tasks to be created with their core affinity already set.

- xTaskCreateAffinitySet()
- xTaskCreateStaticAffinitySet()
- xTaskCreateRestrictedAffinitySet()
- xTaskCreateRestrictedStaticAffinitySet()
2022-03-18 10:16:21 -07:00
Darian 4446c8f0ea
Fix pxPreviousTCB compile warning (#464)
When compiling with configNUM_CORES == 1 and configUSE_CORE_AFFINITY == 1,
pxPreviousTCB will generate a "set but unused" warning.
2022-03-06 14:21:39 -08:00
Timo Sandmann 4832377117
smp branch: bugfix for race condition on RP2040 (#431)
* 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.
2021-12-28 12:30:03 -08:00
Graham Sanderson 7d11089624
Rp2040 fixes smp (#425)
* RP2040: malloc needs to be thread safe for FreeRTOS whether both cores are used or not

* RP2040: CMake file had broken left over test code
2021-12-17 15:06:35 -08:00
Gaurav-Aggarwal-AWS 2b0fdf2a71
Add SMP in the License Header (#402)
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2021-10-13 18:38:24 -07:00
Gaurav-Aggarwal-AWS 970b678a0b
SMP version (#401)
* Update version number for SMP

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2021-10-13 18:23:03 -07:00
Gaurav-Aggarwal-AWS 7ce8266bc5
Update SMP docs (#400)
This commit adds the docs for newly added SMP APIs.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2021-10-10 23:16:16 -07:00
N3xed fa6982c99a
Update xSTATIC_TCB layout in line with tskTCB (#375) 2021-08-09 15:14:10 -07:00
N3xed a2c8db1089
Move uxCoreAffinityMask after xMPUSettings (#372)
Allows for much easier assembly access to the field.
2021-07-29 23:58:47 -07:00
Graham Sanderson 35b95d2a4d
Rp2040 smp (#342)
* Add RP2040 support (#341)

* Add RP2040 support

* remove spurious tab/spaces comments

* add .cmake to ignored kernel checks

* Apply suggestions from code review

Co-authored-by: Paul Bartell <paul.bartell@gmail.com>

* license and end of file newline fixes

* Rename LICENSE.TXT to LICENSE.md

Co-authored-by: Paul Bartell <paul.bartell@gmail.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>

* RP2040 updates for SMP

* whitepsace fix

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>

* whitespace fix

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>

Co-authored-by: Paul Bartell <paul.bartell@gmail.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2021-07-06 10:53:49 -07:00
Michael Bruno a7092d400c
Fix XCore DP/CP register corruption bug (#352)
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.
2021-06-28 08:44:24 -07:00
Michael Bruno a9754a8fdd
Change XCC to xClang for XCore ports (#332) 2021-05-21 14:59:03 -07:00
Joseph Julicher 3231d08be4
fixed CI repo branch (#330) 2021-05-19 17:01:54 -07:00
Joseph Julicher b515641e0a
adding a minimal idle hook to the SMP port (#329)
* adjusting the kernel checks repo

* Added a minimal idle hook for all idle tasks
2021-05-19 16:19:57 -07:00
Joseph Julicher 0c1381311b
Merge branch 'smp' into smp 2021-05-19 10:10:36 -07:00
Joseph Julicher d58750f5f9 Updated from upstream 2021-05-19 10:02:49 -07:00
Joseph Julicher e71e702110 Static allocation and lightweight idle tasks (#323)
* added multiple idle tasks

* Added multiple IDLE tasks to non-static allocation

* Adjustments to tasks from PR review
2021-05-19 09:40:43 -07:00
Joseph Julicher bc42e04850 Uncrustified tasks.c 2021-05-19 09:29:09 -07:00
Joseph Julicher 74f816ab40 Adjustments to tasks from PR review 2021-05-19 09:24:46 -07:00
Joseph Julicher a65f379860 added multiple idle tasks 2021-05-19 09:21:09 -07:00
Joseph Julicher f916ccf506 Static allocation and lightweight idle tasks (#323)
* added multiple idle tasks

* Added multiple IDLE tasks to non-static allocation

* Adjustments to tasks from PR review
2021-05-19 09:15:19 -07:00
Joseph Julicher f5625177f5 removed extra parameter in TCB structure 2021-05-19 09:03:59 -07:00
Joseph Julicher 61fa224694 missed taskYield in minimalIDLE task 2021-05-19 08:54:22 -07:00
Joseph Julicher 106e15ea6b Uncrustified tasks.c 2021-05-19 08:38:58 -07:00
Joseph Julicher 87279a3dc7 Fixed static allocation internal array 2021-05-18 19:49:02 -07:00
Joseph Julicher 6369b03bd1 fixed additional bit mask test errors 2021-05-18 15:17:50 -07:00
Joseph Julicher 56d94df0a8 Fixed bit mask compare bug 2021-05-18 15:07:26 -07:00
Joseph Julicher d59bfca4f9 converted exclusion to affinity 2021-05-13 17:20:41 -07:00
Joseph Julicher ec943bcc1a
Static allocation and lightweight idle tasks (#323)
* added multiple idle tasks

* Added multiple IDLE tasks to non-static allocation

* Adjustments to tasks from PR review
2021-05-13 15:42:57 -07:00
Joseph Julicher b9a17479a0 Adjustments to tasks from PR review 2021-05-12 17:01:59 -07:00
Joseph Julicher ad317efd62 Added multiple IDLE tasks to non-static allocation 2021-05-12 12:13:44 -07:00
Joseph Julicher 80457ca165 added multiple idle tasks 2021-05-12 12:03:08 -07:00
Joseph Julicher 83595e81b5 Removed Xtensa port from XCC folder 2021-03-22 10:11:29 -07:00
Joseph Julicher 0732461e70 moved XMOS ports to thirdparty 2021-03-22 10:06:22 -07:00
Joseph Julicher 20576e8095 ignoring build artifacts 2021-03-17 08:30:07 -07:00
Joseph Julicher b2f3e834d6 fixed line endings for stream_buffer 2021-03-17 08:24:54 -07:00
Joseph Julicher 9404cb60c0 Merge github.com:FreeRTOS/FreeRTOS-Kernel into HEAD 2021-03-17 08:22:55 -07:00
Paul Bartell 95433d0284
Run CMock unit tests on each pull request with a github action. (#279)
Run CMock unit tests on each pull request with a github action.
Include coverage information reported by codecov.io
2021-03-16 18:31:37 -07:00
Joseph Julicher 94d6ad4e18 Added a cmakelists to memmang to facilitate a cmake build 2021-03-16 16:18:17 -07:00
Joseph Julicher ddf9007606 Added a rough pico support. Remove rtos_prints from task.c 2021-03-16 16:06:23 -07:00
Joseph Julicher 8ab776cc5e
SMP Documentation (#280)
* 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>
2021-03-16 13:57:22 -07:00