Commit Graph

3449 Commits (2a014ce0b3647de41a41bc84754f86c73cef33ba)
 

Author SHA1 Message Date
Robert Berger 15e0364968
xQueueSendToFromFromISR --> xQueueSendToFrontFromISR (#795)
Co-authored-by: Robert Berger <Robert.Berger@ReliableEmbeddedSystems.com>
Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com>
1 year ago
Robert Berger c59ce22c8f
Fix xQueueSendToFront code comment (#796)
Co-authored-by: Robert Berger <Robert.Berger@ReliableEmbeddedSystems.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com>
1 year ago
kar-rahul-aws c6ec8295e8
Remove CORTEX_M3_MPS2_QEMU_GCC Demo from kernel demos yaml file (#798) 1 year ago
Mehdi 7cd201c290
Add default implementations of vApplicationGetIdleTaskMemory and vApplicationGetTimerTaskMemory (#790)
This PR introduces configKERNEL_PROVIDED_STATIC_MEMORY option
which the application can set to 1 to use the default implementations
of vApplicationGetIdleTaskMemory and vApplicationGetTimerTaskMemory
functions.

If the application enables static allocation (i.e. sets
configUSE_STATIC_ALLOCATION to 1) and does not provide the above 2
functions, it will result in linker error. The application has two options:

1. Set configKERNEL_PROVIDED_STATIC_MEMORY to 1 to use the default
    implementations of these functions.
2. Provide implementations of these 2 functions.

Note that default definitions are only available for non-MPU ports. The
reason is that the stack alignment requirements vary for different
architectures.
1 year ago
Gaurav-Aggarwal-AWS c3ece08119
Fix prototype in mpu_prototypes.h (#797)
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
1 year ago
Soren Ptak 596292f874
Add the formatting bot action to FreeRTOS-Kernel (#787) 1 year ago
kar-rahul-aws 170a291d4d
Add Access Control List to MPU ports (#765)
This PR adds Access Control to kernel objects on a per task basis to MPU
ports. The following needs to be defined in the `FreeRTOSConfig.h` to
enable this feature:

```c
#define configUSE_MPU_WRAPPERS_V1 0
#define configENABLE_ACCESS_CONTROL_LIST 1
```

This PR adds the following new APIs:

```c
void vGrantAccessToTask( TaskHandle_t xTask,
                         TaskHandle_t xTaskToGrantAccess );
void vRevokeAccessToTask( TaskHandle_t xTask,
                          TaskHandle_t xTaskToRevokeAccess );

void vGrantAccessToSemaphore( TaskHandle_t xTask,
                              SemaphoreHandle_t xSemaphoreToGrantAccess );
void vRevokeAccessToSemaphore( TaskHandle_t xTask,
                               SemaphoreHandle_t xSemaphoreToRevokeAccess );

void vGrantAccessToQueue( TaskHandle_t xTask,
                          QueueHandle_t xQueueToGrantAccess );
void vRevokeAccessToQueue( TaskHandle_t xTask,
                           QueueHandle_t xQueueToRevokeAccess );

void vGrantAccessToQueueSet( TaskHandle_t xTask,
                             QueueSetHandle_t xQueueSetToGrantAccess );
void vRevokeAccessToQueueSet( TaskHandle_t xTask,
                              QueueSetHandle_t xQueueSetToRevokeAccess );

void vGrantAccessToEventGroup( TaskHandle_t xTask,
                               EventGroupHandle_t xEventGroupToGrantAccess );
void vRevokeAccessToEventGroup( TaskHandle_t xTask,
                                EventGroupHandle_t xEventGroupToRevokeAccess );

void vGrantAccessToStreamBuffer( TaskHandle_t xTask,
                                 StreamBufferHandle_t xStreamBufferToGrantAccess );
void vRevokeAccessToStreamBuffer( TaskHandle_t xTask,
                                  StreamBufferHandle_t xStreamBufferToRevokeAccess );

void vGrantAccessToMessageBuffer( TaskHandle_t xTask,
                                  MessageBufferHandle_t xMessageBufferToGrantAccess );
void vRevokeAccessToMessageBuffer( TaskHandle_t xTask,
                                   MessageBufferHandle_t xMessageBufferToRevokeAccess );

void vGrantAccessToTimer( TaskHandle_t xTask,
                          TimerHandle_t xTimerToGrantAccess );
void vRevokeAccessToTimer( TaskHandle_t xTask,
                           TimerHandle_t xTimerToRevokeAccess );
```

An unprivileged task by default has access to itself only and no other
kernel object. The application writer needs to explicitly grant an
unprivileged task access to all the kernel objects it needs. The best
place to do that is before starting the scheduler when all the kernel
objects are created. 

For example, let's say an unprivileged tasks needs access to a queue and
an event group, the application writer needs to do the following:

```c
vGrantAccessToQueue( xUnprivilegedTaskHandle, xQueue );
vGrantAccessToEventGroup( xUnprivilegedTaskHandle, xEventGroup );
```

The application writer MUST revoke all the accesses before deleting a
task. Failing to do so will result in undefined behavior. In the above
example, the application writer needs to make the following 2 calls
before deleting the task:

```c
vRevokeAccessToQueue( xUnprivilegedTaskHandle, xQueue );
vRevokeAccessToEventGroup( xUnprivilegedTaskHandle, xEventGroup );

```
1 year ago
chinglee-iot 7db0e87af1
Update taskYIELD_IF_USING_PREEMPTION macro (#769)
* Add taskYIELD_TASK_CORE_IF_USING_PREEMPTION and taskYIELD_ANY_CORE_IF_USING_PREEMPTION to align task yield behavior for single core and SMP.
---------

Co-authored-by: Soren Ptak <ptaksoren@gmail.com>
1 year ago
kar-rahul-aws 26c48dec46
Fix xStreamBufferCreateStatic() API for buffer size 1 (#793) 1 year ago
Boris van der Meer 2f94b181a2
Add Trace Hook Macros and function that returns the start of the stack. (#659)
* Add Trace Hook Macros and function that returns the start of the stack.

* Remove obsolete functions.

---------

Co-authored-by: kar-rahul-aws <118818625+kar-rahul-aws@users.noreply.github.com>
Co-authored-by: Rahul Kar <karahulx@amazon.com>
Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com>
1 year ago
chinglee-iot f13ad7789b
Add macro taskTASK_IS_RUNNING_OR_SCHEDULED_TO_YIELD (#780)
* Add macro taskTASK_IS_RUNNING_OR_SCHEDULED_TO_YIELD macro to align single core and SMP
* Update for explicit precedence in vTaskDelete
* Update comment when deleting a running task
1 year ago
chinglee-iot f7565c2d5e
Add configUSE_CORE_AFFINITY bits check (#776)
* Add core affinity bits check
* Add taskBITS_PER_BYTES
1 year ago
chinglee-iot c93d3865f7
Update task running state type and related macros (#770)
* Remove unnecessary type TaskRunning_t
* Rename taskTASK_YIELD to taskTASK_SCHEDULED_TO_YIELD
---------
Co-authored-by: Soren Ptak <ptaksoren@gmail.com>
1 year ago
chinglee-iot 53229b1537
Assert if prvCheckForRunStateChange is called in ISR (#779)
* Assert if prvCheckForRunStateChange is called in ISR
1 year ago
chinglee-iot 288d143357
Update taskSELECT_HIGHEST_PRIORITY_TASK macro for SMP (#777)
* Move the configUSE_PORT_OPTIMISED_TASK_SELECTION check to FreeRTOS.h
* SMP also use taskSELECT_HIGHEST_PRIORITY_TASK macro
---------

Co-authored-by: Soren Ptak <ptaksoren@gmail.com>
1 year ago
Soren Ptak 5fb9b50da8
CI-CD Updates (#768)
* Use new version of CI-CD Actions
* Use cSpell spell check, and use ubuntu-20.04 for formatting check
* Format and spell check all files in the portable directory
* Remove the https:// from #errors and #warnings as uncrustify attempts to change it to /*
* Use checkout@v3 instead of checkout@v2 on all jobs
---------
1 year ago
Gaurav-Aggarwal-AWS d6bccb1f4c
Fix heap address calculation issue (#781)
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
1 year ago
kar-rahul-aws 231278eded
Fix cast alignment warning in heap_4.c and heap_5.c (#771)
* Fix cast alignment warning
---------

Co-authored-by: Soren Ptak <ptaksoren@gmail.com>
Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com>
1 year ago
chinglee-iot 1aaa318f1c
Update INFINITE_LOOP control (#775)
* Use for loop instead of while loop for INFINITE_LOOP control
1 year ago
chinglee-iot 80a390cbbb
Update block validate macro in heap_5 (#774)
* Update block validate macro in heap_5, and update for readability
* Don't validate block pointer when configENABLE_HEAP_PROTECTOR is not set to 1
1 year ago
Jordan Williams af2904b01c
Fix typo in the include directory for the the GCC_ARM_CM55_TFM port (#764)
Should be CM55 not CM85.
1 year ago
oliverlavery 0d9649ca45
Heap protect (#747)
Setting configENABLE_HEAP_PROTECTOR to 1 obfuscates heap
block pointers by XORing them with an application supplied
canary value. This obfuscation helps to catch heap corruption
should a heap buffer overflow occur.

This PR also adds heap bounds checking to heap_4 and heap_5.

This PR also adds some additional integer underflow checks.
1 year ago
Gaurav-Aggarwal-AWS b9f488a713
Fix remarks emitted by IAR compiler (#763)
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2 years ago
Moral-Hao 7372519cba
Use the bigger priority whenever possible. (#760)
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2 years ago
kar-rahul-aws cdd3678c29
Add runtime parameter checks (#761)
* Add runtime parameter checks

This commit adds runtime checks for function parameters to mpu_wrappers_v2 file. The same checks are performed
in the API implementation using asserts.

Signed-off-by: kar-rahul-aws <karahulx@amazon.com>
2 years ago
kar-rahul-aws cd87a39736
Update version number in manifest.yml (#755)
* Add automation to update version number in manifest.yml

* Make updater file executable
2 years ago
Chien Wong b1a85116bd
Add missing stack alignment adjustment if stack grows upwards (#751)
Signed-off-by: Chien Wong <m@xv97.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2 years ago
Moral-Hao bd720c316a
Bring the heap_4 improvements to secure_heap (#749)
This includes improvements like addition overflow checks,
readability improvements.
2 years ago
Moral-Hao bcd6dbd772
Move size calculation out of critical section (#748)
The size calculation in pvPortMalloc uses only parameters and read
only constants and therefore, can be moved out of critical section
to make the critical section as small as possible.
2 years ago
kar-rahul-aws 6f3586516a
fix MPU wrapper for vTaskDelete for calling task deletion (#745) 2 years ago
bebebib-rs b5f670f826
Fix pxTopOfStack calculation in configINIT_TLS_BLOCK for picolib (#739)
The pxTopOfStack calculation in configINIT_TLS_BLOCK for picolib needs
to decrement pxTopOfStack in order to meet the expectation of
 pxPortInitialiseStack function.
2 years ago
kar-rahul-aws 05d93e0990
Fix API for NULL task parameter (#741)
* Fix API for NULL task parameter

* Fix uncrustify

---------

Co-authored-by: Ching-Hsin Lee <chinglee@amazon.com>
2 years ago
Leonardo de Araujo 4689d8ff86
fix: typos in README.md (#744)
Co-authored-by: ActoryOu <jay2002824@gmail.com>
2 years ago
Moral-Hao ee0a82be1b
Fix bug of heap_2 introduced by pr738. (#743)
* Fix bug of heap_2 introduced by pr738.
* Fix formatting check

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

---------

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: moral-hao <405197809@qq.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
2 years ago
kar-rahul-aws 02be485e04
Update MPU wrapper for pcTaskGetName API (#737)
* Update MPU wrapper for pcTaskGetName

* Fix Formatting

* Fix mpu wrappers V1

---------

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2 years ago
Moral-Hao a5bf4d9a7f
Improve the speed of split memory. (#738)
Co-authored-by: moral-hao <405197809@qq.com>
Co-authored-by: Nikhil Kamath <110539926+amazonKamath@users.noreply.github.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2 years ago
ActoryOu dd1b87dae9
Fix RP2040 compile warning (#736)
* Fix Pico compile warning -- port layer

* Warning resolved for volatile discard task.c (#5)

---------

Co-authored-by: Pranjal Chanda <40349163+pranjalchanda08@users.noreply.github.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2 years ago
Nikhil Kamath 20300df3c3
PR Process for Open Source Contribution (#717)
* Initial Version Pull Request Workflow

* Updated Contributing.md

* Improved contributing.md

* added pr process image and some edits based on peer feedback

* fixed links to image

* Fixed truncation

* Updated reviewer description

* Review feedback

---------

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2 years ago
Gaurav-Aggarwal-AWS 85d2cba801
Fix warning introduced in PR 730 (#735)
The change addresses the following warning:

```
tasks.c:5549:40: warning: assignment discards 'volatile' qualifier from
pointer target type [-Wdiscarded-qualifiers]
 5549 |             pxTaskStatus->pxTopOfStack = pxTCB->pxTopOfStack;
      |
```

Also add the "Build Posix_GCC Demo for Coverage Test" in the PR checks
as coverage test target treats warnings as errors and therefore, will
catch such warnings in PR checks.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2 years ago
kar-rahul-aws b51a37314c
Update MPU wrapper for xTimerGenericCommand API (#734)
* Update xTimerGenericCommand API as per SMP branch

Signed-off-by: kar-rahul-aws <karahulx@amazon.com>

* Fix formatting

* Code review changes

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

* Fix Formatting

---------

Signed-off-by: kar-rahul-aws <karahulx@amazon.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
2 years ago
Gaurav-Aggarwal-AWS 0066c28cb2
Update submodule pointer for contributed Ports (#733)
Update submodule pointer for partners supported and community supported
ports.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2 years ago
Ju1He1 225bace85c
Enable MSVC Port to leave the prvProcessSimulatedInterrupts loop when scheduler is stopped (#728)
* allow to leave loop

* add missing brace

* 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>
2 years ago
ActoryOu 8d80cf697a
Fix Pico compile warning (#732)
* Fix Pico compile warning

* Add type cast for portGET_CORE_ID

---------

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2 years ago
vinceburns da2428fbb1
Feature: Add top/end of stack to task info report whenever it is available. (#729) (#730)
pxTopOfStack is always available and pxEndOfStack is available whenever you have:
(portSTACK_GROWTH > 0) or ( configRECORD_STACK_HIGH_ADDRESS == 1)

Include it in the info report whenever it is available to the tcb.

Co-authored-by: Vince Burns <vburns@sensata.com>
2 years ago
Zim Kalinowski 785250de45
Align some Linux and RL78 port types with other ports (#727) 2 years ago
kar-rahul-aws 3786856b72
Remove stdint.h in stream buffer file (#725)
* Remove stdint.h in stream buffer file

Signed-off-by: kar-rahul-aws <karahulx@amazon.com>
2 years ago
chinglee-iot 95c638b39b
Update GNU ARM Toolchain demo workflow (#726)
* Update GNU ARM Toolchain demo workflow
---------

Co-authored-by: Paul Bartell <paul.bartell@gmail.com>
2 years ago
Nuno Guterres Nogueira 1544768719
Updated README.md for cross-compilation (#723)
* Update README.md
2 years ago
Jeff Tenney b13e2698bb
Work around SysTick bug for QEMU ARMv8-M (#724)
* Set SysTick CLKSOURCE bit before enabling SysTick

* Use portNVIC_SYSTICK_CLK_BIT_CONFIG

The workaround now uses portNVIC_SYSTICK_CLK_BIT_CONFIG instead of
portNVIC_SYSTICK_CLK_BIT, which saves us from having to explain in the
comments why it's OK to temporarily set the CLKSOURCE bit even if the
user's FreeRTOS configuration clears the CLKSOURCE bit.

Using portNVIC_SYSTICK_CLK_BIT_CONFIG here still correctly prevents the
firmware from triggering the QEMU bug.
2 years ago
kar-rahul-aws d02ab775f3
Fix warning issue for warning in arithmetic conversion for UBaseType_t (#720)
* Fix warning issue for warnign in arithmnetic conversion for UBaseType_t

* Fix warning in streamBuffer

* Add cast to queue.c file changes

* Minor fix to cast

* Fix formatting

* Revert minor fix to cast

---------

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