Commit graph

67 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
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
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
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 a2c8db1089
Move uxCoreAffinityMask after xMPUSettings (#372)
Allows for much easier assembly access to the field.
2021-07-29 23:58:47 -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 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 ddf9007606 Added a rough pico support. Remove rtos_prints from task.c 2021-03-16 16:06:23 -07:00
Joseph Julicher 989bc332b2
Feature: SMP (#278)
* 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>
2021-03-15 17:29:08 -07:00
alfred gedeon 4b5d1e4395
Comment: fix code comment for xTaskAbortDelay (#272) 2021-03-05 09:13:03 -08:00
gomonovych 4fde4a8d0a
Add description for vTaskList (#206)
Describe each column which vTaskList print:
task name, task status, task priority, task stack unused watermark lewel, task number

Co-authored-by: David Chalco <59750547+dachalco@users.noreply.github.com>
2021-03-01 18:10:00 -07:00
Gaurav-Aggarwal-AWS 2a604f4a28
Support allocating stack from separate heap (#267)
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>
2021-02-23 18:36:27 -08:00
nazar01 6b4a3d0a6e
Typos (#248)
* Fix typos in FreeRTOS.h

* Fix typos in task.h

* Fix typos in tasks.c
2021-01-29 12:05:04 -08:00
Cobus van Eeden ec62f69dab [AUTO][RELEASE]: Bump file header version to "10.4.3" 2020-12-14 10:13:39 -08:00
David Chalco 337bca615e [AUTO][RELEASE]: Bump file header version to "10.4.2" 2020-11-10 14:42:58 -08:00
Gaurav-Aggarwal-AWS db62e30bce
Fix missed yield in xTaskResumeFromISR (#207)
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>
2020-10-22 17:09:35 -07:00
RichardBarry 5fb26de019
Recently vTaskDelayUntil() was updated to xTaskDelayUntil() because the function now returns a value. The PR didn't make the same change in the MPU port, or update the constants required to include the xTaskDelayUntil() function in the build. (#199)
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.
2020-10-11 14:04:49 -07:00
Spacefish 3260e228c3
vTaskDelayUntil improvement (#77)
* vTaskDelayUntil improvement

* suggestions implemented

* xTaskDelayUntil #define added

* doc small fix

* small formatting stuff

* more small formatting stuff

* Update lexicon.txt

Co-authored-by: Carl Lundin <53273776+lundinc2@users.noreply.github.com>
Co-authored-by: Carl Lundin <lundinc@amazon.com>
2020-10-08 17:46:47 -07:00
David Chalco b1307dbea8
OpenOCD Support: Re-introduce uxTopUsedPriority (#188)
* re-introduce uxTopUsedPriority. Prevent removal by optimization

* Make uxTopUsedPriority volatile to avoid optimizer + code comment

Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
2020-10-01 12:40:21 -07:00
alfred gedeon d428209d01
Fix some broken/redirected URL (#172)
* 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 *
2020-09-21 15:49:55 -07:00
David Chalco 3604527e3b
Update version number to 10.4.1 (#173) 2020-09-17 15:25:15 -07:00
David Chalco 5dfab0306b
Update version number to 10.4.0 (#153) 2020-09-10 19:49:34 -07:00
RichardBarry 700c1cf9c6
Fix compiler warning in config assert() on 64 bit architecture (#158)
* 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.
2020-09-06 22:08:00 -07:00
alfred gedeon a038146915
Style: Make freertos.org = FreeRTOS.org and add https (#134)
* 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>
2020-08-21 11:30:39 -07:00
alfred gedeon 0b0a2060c0
Style: Change FreeRTOS websites in comments (#131)
* 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>
2020-08-20 14:59:28 -07:00
Joseph Julicher 1865857eae
Moving the function prototypes to headers (#128)
* Removing StackMacros.h

* Moving 4 Function Prototypes out of the C files into the headers

* Revert "Removing StackMacros.h"

This reverts commit cdd8307817.
2020-08-18 11:29:00 -07:00
alfred gedeon 9a1ebfec31
Style: Uncrustify kernel file - remove tab == 4 spaces (#123)
* Style: uncrystify kernel files and remove tabs

* Style: uncrystify kernel files and remove tabs

Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
2020-08-17 16:16:11 -07:00
alfred gedeon 8c77117c32
Style: Remove tabs and tab == 4 spaces (#120)
* Style: Remove tabls and tab == 4 spaces

* Style: remove xx accidentally left

* Style: revert uncrustify for untested portable directories

* Style: revert more uncrustify files

* Style: Revert more uncrustified files

* Style: Revert some uncrutified files

* Style: change more files

* Style: remove t tab == 4 spaces

* Style: remove tabs = spaces

* Style: revert changed files

* Style: redo the stuyles

* Style: add uncrustify disable parsing for asm

Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
2020-08-17 14:50:56 -07:00