Commit Graph

38 Commits (d43680169b14ae049a1ef5ab19e97768ac31cf7a)

Author SHA1 Message Date
Darian 9488ba22d8
Add functions to get the buffers of statically created objects (#641)
Added various ...GetStaticBuffer() functions to get the buffers of statically
created objects.
---------
Co-authored-by: Paul Bartell <pbartell@amazon.com>
Co-authored-by: Nikhil Kamath <110539926+amazonKamath@users.noreply.github.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
2 years ago
phelter 8cd5451ad5
Feature/fixing clang gnu compiler warnings (#620)
* Adding in ability to support a library for freertos_config and a custom freertos_kernel_port (#558)

* Using single name definition for libraries everywhere. (#558)

* Supporting backwards compatibility with FREERTOS_CONFIG_FILE_DIRECTORY (#571)

* Removing compiler warnings for GNU and Clang. (#571)

* Added in documentation on how to consume from a main project. Added default PORT selection for native POSIX and MINGW platforms.

* Only adding freertos_config if it exists. Removing auto generation of it from a FREERTOS_CONFIG_FILE_DIRECTORY.

* Fixing clang and gnu compiler warnings.

* Adding in project information and how to compile for GNU/clang

* Fixing compiler issue with unused variable - no need to declare variable.

* Adding in compile warnings for linux builds that kernel is okay with using.

* Fixing more extra-semi-stmt clang warnings.

* Moving definition of hooks into header files if features are enabled.

* Fixing formatting with uncrustify.

* Fixing merge conflicts with main merge.

* Fixing compiler errors due to merge issues and formatting.

* Fixing Line feeds.

* Adding 'portNORETURN' into portmacros.h. Other Updates based on PR request

* Further clean-up of clang and clang-tidy issues.

* Removing compiler specific pragmas from common c files.

* Fixing missing lexicon entry and uncrustify formatting changes.

* Resolving merge issue multiple defnitions of proto for prvIdleTask

* Fixing formatting issues that are not covered by uncrustify. Use clang-tidy instead if you want this level of control.

* More uncrustify formatting issues.

* Fixing extra bracket in #if statement.

---------

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2 years ago
Paul Bartell 01820d3ed9 Normalize line endings and whitespace in source files 2 years ago
Paul Bartell d98625239b Remove coroutines from FreeRTOS-Kernel. 2 years ago
Niklas Gürtler 4e2bf2c639
Removed the 'configASSERT( xInheritanceOccurred == pdFALSE )' assertion from xQueueSemaphoreTake as the reasoning behind it is wrong; it can trigger on wrongly on highly-contested semaphores on multicore systems. See https://forums.freertos.org/t/15967 (#576)
Co-authored-by: Niklas Gürtler <niklas.guertler@tacterion.com>
2 years ago
Paul Bartell dca4f80a6b
Add configUSE_MINI_LIST_ITEM configuration option to enable the MiniListItem_t type. (#433)
* Add configUSE_MINI_LIST_ITEM configuration option to enable the MiniListItem_t type.

When configUSE_MINI_LIST_ITEM == 0:
	MiniListItem_t and ListItem_t are both typedefs of struct xLIST_ITEM.

When configUSE_MINI_LIST_ITEM == 1 (the default in projdefs.h):
	MiniListItem_t is a typedef of struct xMINI_LIST_ITEM, which contains 3 fewer fields than a struct xLIST_ITEM.
	This configuration saves approximately sizeof(TickType_t) + 2 * sizeof( void * ) bytes of ram, however it also violates strict aliasing rules which some compilers depend on for optimization.

configUSE_MINI_LIST_ITEM defaults to 1 when not defined.

* Add pp_indent_brace option to uncrustify config

Improves compliance with the FreeRTOS code style guide:
https://www.freertos.org/FreeRTOS-Coding-Standard-and-Style-Guide.html
3 years ago
Gaurav-Aggarwal-AWS becbb89181
Add a cap to the queue locks (#435)
Add a cap to the queue locks

cRxLock and cTxLock members of the queue data structure count the
number items received and sent to the queue while the queue was locked.
These are later used to unblock tasks waiting on the queue when the
queue is unlocked. The data type of these members is int8_t and this can
trigger overflow check assert if an ISR continuously reads/writes to the
queue in a loop as reported in this issue: https://github.com/FreeRTOS/FreeRTOS-Kernel/issues/419. 

Note due to the length of the operation is it not recommended to write to
the queue that many times from an ISR - stream buffers are a better option,
or alternatively, defer the operation to a task by just having the ISR send a
direct to task notification to unblock the task.

This PR caps the values of the cRxLock and cTxLock to the number of tasks in
the system because we cannot unblocks more tasks than there are in the system. 
Note that the same assert could still be triggered is the application creates more
than 127 tasks.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
3 years ago
RichardBarry e13f990385
Fix keil compilation error (#418)
* Fix compilation error when using the Keil tools with the Keil compiler.
3 years ago
RichardBarry b97bb48e06
Indent contents of a taskENTER_CRITICAL/taskEXIT_CRITICAL block. (#348)
* Indent contents of a taskENTER_CRITICAL/taskEXIT_CRITICAL block.
Move a few configASSERT() statements out of a path where they would always be triggered to prevent "condition is always true" compiler warnings.

* Replace configASSERT() positions due to unintended semantic change from the version where asserts were at the top of the file.

Co-authored-by: RichardBarry <richardbarry.c@gmail.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
4 years ago
alfred gedeon ce81bcb33f
Run uncrustify with github workflows (#369)
* uncrustify with github workflows

* Fix find expression

* Add uncrustify configuration file

* Uncrustify some files

* uncrustify some more files

* uncrustify more files

* Fix whitespace at end of lines

Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
4 years ago
Paul Bartell eec42331b4 Normalize files with mixed line endings (introduced in commit 3a413d1) 4 years ago
Paul Bartell 3a413d1022 Add SPDX-License-Identifier: MIT to MIT licensed files. 4 years ago
Paul Bartell adfc53368f Update copyright year from 2020 to 2021 4 years ago
Paul Bartell 08dc6f64ee Change kernel revision in each file header from V10.4.3 to <DEVELOPMENT BRANCH> 4 years ago
Dan Good 8e2f723996
queue.c: Change some asserts into conditionals and improve overflow checks (#328) 4 years ago
Paul Bartell 71f5af4e0f
Fix regression in vQueueAddToRegistry. (#315) 4 years ago
Paul Bartell 46f7feba81
Replace configASSERT( pcQueueName ) in vQueueAddToRegistry with a NULL pointer check. (#313)
* Replace configASSERT( pcQueueName ) in vQueueAddToRegistry with a NULL pointer check.

Fixes FreeRTOS/FreeRTOS-Kernel#311

* Make NULL checks consistent.
4 years ago
Paul Bartell a22b438e60
Overwrite existing QueueRegistry entries when a handle is added multiple times. (#306)
Overwrite an existing entry for a given xQueue handle when vQueueAddToRegistry is called with an xQueue handle of a queue that is already in the QueueRegistry.
4 years ago
Paul Bartell 18d4ba9c07
Add some assertions and coverage exceptions to queue.c (#273)
* 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
4 years ago
Cobus van Eeden ec62f69dab [AUTO][RELEASE]: Bump file header version to "10.4.3" 4 years ago
Cobus van Eeden 47338393f1
add assert for addition overflow on queue creation (#225) 4 years ago
David Chalco 337bca615e [AUTO][RELEASE]: Bump file header version to "10.4.2" 4 years ago
David Chalco 3604527e3b
Update version number to 10.4.1 (#173) 4 years ago
David Chalco 5dfab0306b
Update version number to 10.4.0 (#153) 4 years ago
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>
5 years ago
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>
5 years ago
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>
5 years ago
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>
5 years ago
Alfred Gedeon 587a83d647 Style: uncrustify kernel files 5 years ago
Alfred Gedeon 2c530ba5c3 Style: uncrustify 5 years ago
Alfred Gedeon 718178c68a Style: uncrusitfy 5 years ago
Alfred Gedeon a5dbc2b1de Style: uncrustify kernel files 5 years ago
David Chalco 4a61f9ff7e
Improvement to O.F. protections (#75)
* Added protection for xQueueGenericCreate

* prevent eventual invalid state change from int8 overflow

* Append period at end of comment. To be consistent with file.

* check operand, not destination

* parantheses -- to not show assumptive precendence

* Per request, less dependence on stdint by defining and checking against queueINT8_MAX instead
5 years ago
cykro82 6199b72fbf
Renamed trace point in prvNotifyQueueSetContainer() so it isn't a d… (#47)
* * Renamed trace point in prvNotifyQueueSetContainer() so it isn't a duplicate of the trace point in xQueueGenericSend()

* * Fixed backwards compatibility.

Co-authored-by: Erik Tamlin <erik.tamlin@percepio.com>
5 years ago
RichardBarry f2081af030
Feature/multiple direct to task notifications (#63)
Description
Before this change each task had a single direct to task notification value and state as described here: https://www.FreeRTOS.org/RTOS-task-notifications.html. After this change each task has an array of task notifications, so more than one task notification value and state per task. The new FreeRTOSConfig.h compile time constant configTASK_NOTIFICATION_ARRAY_ENTRIES sets the number of indexes in the array.

Each notification within the array operates independently - a task can only block on one notification within the array at a time and will not be unblocked by a notification sent to any other array index.

Task notifications were introduced as a light weight method for peripheral drivers to pass data and events to tasks without the need for an intermediary object such as a semaphore - for example, to unblock a task from an ISR when the operation of a peripheral completed. That use case only requires a single notification value. Their popularity and resultant expanded use cases have since made the single value a limitation - especially as FreeRTOS stream and message buffers themselves use the notification mechanism. This change resolves that limitation. Stream and message buffers still use the task notification at array index 0, but now application writers can avoid any conflict that might have with their own use of task notifications by using notifications at array indexes other than 0.

The pre-existing task notification API functions work in a backward compatible way by always using the task notification at array index 0. For each such function there is now an equivalent that is postfixed "Indexed" and takes an additional parameter to specify which index within the array it should operate upon. For example, xTaskNotify() is the original that only operates on array index 0. xTaskNotifyIndexed() is the new function that can operate on any array index.

Test Steps
The update is tested using the Win32 demo (PR to be created in the FreeRTOS/FreeRTOS github repo), which has been updated to build and run a new test file FreeRTOS/Demo/Common/Minimal/TaskNotifyArray.c. The tests in that file are in addition to, not a replacement for those in FreeRTOS/Demo/Common/Minimal/TaskNotify.c.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
5 years ago
AniruddhaKanhere c246922ea1
Small typo on L1287 (#14)
Added a missing ')'
5 years ago
Yuhui.Zheng 88e32327e9
version bump to v10.3.1 (#16)
* Verion bump from 10.3.0 to 10.3.1.
* version bump in task.h
* change history for 10.3.1.
5 years ago
Yuhui Zheng 210b1ffcc8 Re-sync with upstream and stripping away none kernel related. 5 years ago