* 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>
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE/*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
configLIST_VOLATILETickType_txItemValue;/*< The value being listed. In most cases this is used to sort the list in ascending order. */
structxLIST_ITEM*configLIST_VOLATILEpxNext;/*< Pointer to the next ListItem_t in the list. */
structxLIST_ITEM*configLIST_VOLATILEpxPrevious;/*< Pointer to the previous ListItem_t in the list. */
void*pvOwner;/*< Pointer to the object (normally a TCB) that contains the list item. There is therefore a two way link between the object containing the list item and the list item itself. */
structxLIST*configLIST_VOLATILEpxContainer;/*< Pointer to the list in which this list item is placed (if any). */
listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE/*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE/**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
configLIST_VOLATILETickType_txItemValue;/**< The value being listed. In most cases this is used to sort the list in ascending order. */
structxLIST_ITEM*configLIST_VOLATILEpxNext;/**< Pointer to the next ListItem_t in the list. */
structxLIST_ITEM*configLIST_VOLATILEpxPrevious;/**< Pointer to the previous ListItem_t in the list. */
void*pvOwner;/**< Pointer to the object (normally a TCB) that contains the list item. There is therefore a two way link between the object containing the list item and the list item itself. */
structxLIST*configLIST_VOLATILEpxContainer;/**< Pointer to the list in which this list item is placed (if any). */
listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE/**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
};
typedefstructxLIST_ITEMListItem_t;/* For some reason lint wants this as two separate definitions. */
#if ( configUSE_MINI_LIST_ITEM == 1 )
structxMINI_LIST_ITEM
{
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE/*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE/**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
configLIST_VOLATILETickType_txItemValue;
structxLIST_ITEM*configLIST_VOLATILEpxNext;
structxLIST_ITEM*configLIST_VOLATILEpxPrevious;
@ -171,11 +171,11 @@ typedef struct xLIST_ITEM ListItem_t; /* For some reason lint
*/
typedefstructxLIST
{
listFIRST_LIST_INTEGRITY_CHECK_VALUE/*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
listFIRST_LIST_INTEGRITY_CHECK_VALUE/**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
volatileUBaseType_tuxNumberOfItems;
ListItem_t*configLIST_VOLATILEpxIndex;/*< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
MiniListItem_txListEnd;/*< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */
listSECOND_LIST_INTEGRITY_CHECK_VALUE/*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
ListItem_t*configLIST_VOLATILEpxIndex;/**< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
MiniListItem_txListEnd;/**< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */
listSECOND_LIST_INTEGRITY_CHECK_VALUE/**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
int8_t*pcTail;/*< Points to the byte at the end of the queue storage area. Once more byte is allocated than necessary to store the queue items, this is used as a marker. */
int8_t*pcReadFrom;/*< Points to the last place that a queued item was read from when the structure is used as a queue. */
int8_t*pcTail;/**< Points to the byte at the end of the queue storage area. Once more byte is allocated than necessary to store the queue items, this is used as a marker. */
int8_t*pcReadFrom;/**< Points to the last place that a queued item was read from when the structure is used as a queue. */
}QueuePointers_t;
typedefstructSemaphoreData
{
TaskHandle_txMutexHolder;/*< The handle of the task that holds the mutex. */
UBaseType_tuxRecursiveCallCount;/*< Maintains a count of the number of times a recursive mutex has been recursively 'taken' when the structure is used as a mutex. */
TaskHandle_txMutexHolder;/**< The handle of the task that holds the mutex. */
UBaseType_tuxRecursiveCallCount;/**< Maintains a count of the number of times a recursive mutex has been recursively 'taken' when the structure is used as a mutex. */
}SemaphoreData_t;
/* Semaphores do not actually store or copy data, so have an item size of
@ -95,27 +95,27 @@ typedef struct SemaphoreData
*/
typedefstructQueueDefinition/* The old naming convention is used to prevent breaking kernel aware debuggers. */
{
int8_t*pcHead;/*< Points to the beginning of the queue storage area. */
int8_t*pcWriteTo;/*< Points to the free next place in the storage area. */
int8_t*pcHead;/**< Points to the beginning of the queue storage area. */
int8_t*pcWriteTo;/**< Points to the free next place in the storage area. */
union
{
QueuePointers_txQueue;/*< Data required exclusively when this structure is used as a queue. */
SemaphoreData_txSemaphore;/*< Data required exclusively when this structure is used as a semaphore. */
QueuePointers_txQueue;/**< Data required exclusively when this structure is used as a queue. */
SemaphoreData_txSemaphore;/**< Data required exclusively when this structure is used as a semaphore. */
}u;
List_txTasksWaitingToSend;/*< List of tasks that are blocked waiting to post onto this queue. Stored in priority order. */
List_txTasksWaitingToReceive;/*< List of tasks that are blocked waiting to read from this queue. Stored in priority order. */
List_txTasksWaitingToSend;/**< List of tasks that are blocked waiting to post onto this queue. Stored in priority order. */
List_txTasksWaitingToReceive;/**< List of tasks that are blocked waiting to read from this queue. Stored in priority order. */
volatileUBaseType_tuxMessagesWaiting;/*< The number of items currently in the queue. */
UBaseType_tuxLength;/*< The length of the queue defined as the number of items it will hold, not the number of bytes. */
UBaseType_tuxItemSize;/*< The size of each items that the queue will hold. */
volatileUBaseType_tuxMessagesWaiting;/**< The number of items currently in the queue. */
UBaseType_tuxLength;/**< The length of the queue defined as the number of items it will hold, not the number of bytes. */
UBaseType_tuxItemSize;/**< The size of each items that the queue will hold. */
volatileint8_tcRxLock;/*< Stores the number of items received from the queue (removed from the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */
volatileint8_tcTxLock;/*< Stores the number of items transmitted to the queue (added to the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */
volatileint8_tcRxLock;/**< Stores the number of items received from the queue (removed from the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */
volatileint8_tcTxLock;/**< Stores the number of items transmitted to the queue (added to the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */
uint8_tucStaticallyAllocated;/*< Set to pdTRUE if the memory used by the queue was statically allocated to ensure no attempt is made to free the memory. */
uint8_tucStaticallyAllocated;/**< Set to pdTRUE if the memory used by the queue was statically allocated to ensure no attempt is made to free the memory. */
typedefstructtskTaskControlBlock/* The old naming convention is used to prevent breaking kernel aware debuggers. */
{
volatileStackType_t*pxTopOfStack;/*< Points to the location of the last item placed on the tasks stack. THIS MUST BE THE FIRST MEMBER OF THE TCB STRUCT. */
volatileStackType_t*pxTopOfStack;/**< Points to the location of the last item placed on the tasks stack. THIS MUST BE THE FIRST MEMBER OF THE TCB STRUCT. */
#if ( portUSING_MPU_WRAPPERS == 1 )
xMPU_SETTINGSxMPUSettings;/*< The MPU settings are defined as part of the port layer. THIS MUST BE THE SECOND MEMBER OF THE TCB STRUCT. */
xMPU_SETTINGSxMPUSettings;/**< The MPU settings are defined as part of the port layer. THIS MUST BE THE SECOND MEMBER OF THE TCB STRUCT. */
#endif
ListItem_txStateListItem;/*< The list that the state list item of a task is reference from denotes the state of that task (Ready, Blocked, Suspended ). */
ListItem_txEventListItem;/*< Used to reference a task from an event list. */
UBaseType_tuxPriority;/*< The priority of the task. 0 is the lowest priority. */
StackType_t*pxStack;/*< Points to the start of the stack. */
charpcTaskName[configMAX_TASK_NAME_LEN];/*< Descriptive name given to the task when created. Facilitates debugging only. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
ListItem_txStateListItem;/**< The list that the state list item of a task is reference from denotes the state of that task (Ready, Blocked, Suspended ). */
ListItem_txEventListItem;/**< Used to reference a task from an event list. */
UBaseType_tuxPriority;/**< The priority of the task. 0 is the lowest priority. */
StackType_t*pxStack;/**< Points to the start of the stack. */
charpcTaskName[configMAX_TASK_NAME_LEN];/**< Descriptive name given to the task when created. Facilitates debugging only. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
StackType_t*pxEndOfStack;/*< Points to the highest valid address for the stack. */
StackType_t*pxEndOfStack;/**< Points to the highest valid address for the stack. */
#endif
#if ( portCRITICAL_NESTING_IN_TCB == 1 )
UBaseType_tuxCriticalNesting;/*< Holds the critical section nesting depth for ports that do not maintain their own count in the port layer. */
UBaseType_tuxCriticalNesting;/**< Holds the critical section nesting depth for ports that do not maintain their own count in the port layer. */
#endif
#if ( configUSE_TRACE_FACILITY == 1 )
UBaseType_tuxTCBNumber;/*< Stores a number that increments each time a TCB is created. It allows debuggers to determine when a task has been deleted and then recreated. */
UBaseType_tuxTaskNumber;/*< Stores a number specifically for use by third party trace code. */
UBaseType_tuxTCBNumber;/**< Stores a number that increments each time a TCB is created. It allows debuggers to determine when a task has been deleted and then recreated. */
UBaseType_tuxTaskNumber;/**< Stores a number specifically for use by third party trace code. */
#endif
#if ( configUSE_MUTEXES == 1 )
UBaseType_tuxBasePriority;/*< The priority last assigned to the task - used by the priority inheritance mechanism. */
UBaseType_tuxBasePriority;/**< The priority last assigned to the task - used by the priority inheritance mechanism. */
UBaseType_tuxMutexesHeld;
#endif
@ -295,11 +297,11 @@ typedef struct tskTaskControlBlock /* The old naming convention is used to
#endif
#if ( configGENERATE_RUN_TIME_STATS == 1 )
configRUN_TIME_COUNTER_TYPEulRunTimeCounter;/*< Stores the amount of time the task has spent in the Running state. */
configRUN_TIME_COUNTER_TYPEulRunTimeCounter;/**< Stores the amount of time the task has spent in the Running state. */
PRIVILEGED_DATAstaticList_txDelayedTaskList2;/*< Delayed tasks (two lists are used - one for delays that have overflowed the current tick count. */
PRIVILEGED_DATAstaticList_t*volatilepxDelayedTaskList;/*< Points to the delayed task list currently being used. */
PRIVILEGED_DATAstaticList_t*volatilepxOverflowDelayedTaskList;/*< Points to the delayed task list currently being used to hold tasks that have overflowed the current tick count. */
PRIVILEGED_DATAstaticList_txPendingReadyList;/*< Tasks that have been readied while the scheduler was suspended. They will be moved to the ready list when the scheduler is resumed. */
PRIVILEGED_DATAstaticList_txDelayedTaskList2;/**< Delayed tasks (two lists are used - one for delays that have overflowed the current tick count. */
PRIVILEGED_DATAstaticList_t*volatilepxDelayedTaskList;/**< Points to the delayed task list currently being used. */
PRIVILEGED_DATAstaticList_t*volatilepxOverflowDelayedTaskList;/**< Points to the delayed task list currently being used to hold tasks that have overflowed the current tick count. */
PRIVILEGED_DATAstaticList_txPendingReadyList;/**< Tasks that have been readied while the scheduler was suspended. They will be moved to the ready list when the scheduler is resumed. */
#if ( INCLUDE_vTaskDelete == 1 )
PRIVILEGED_DATAstaticList_txTasksWaitingTermination;/*< Tasks that have been deleted - but their memory not yet freed. */
PRIVILEGED_DATAstaticList_txTasksWaitingTermination;/**< Tasks that have been deleted - but their memory not yet freed. */
PRIVILEGED_DATAstaticvolatileTickType_txNextTaskUnblockTime=(TickType_t)0U;/* Initialised to portMAX_DELAY before the scheduler starts. */
PRIVILEGED_DATAstaticTaskHandle_txIdleTaskHandle=NULL;/*< Holds the handle of the idle task. The idle task is created automatically when the scheduler is started. */
PRIVILEGED_DATAstaticTaskHandle_txIdleTaskHandle=NULL;/**< Holds the handle of the idle task. The idle task is created automatically when the scheduler is started. */
/* Improve support for OpenOCD. The kernel tracks Ready tasks via priority lists.
PRIVILEGED_DATAstaticconfigRUN_TIME_COUNTER_TYPEulTaskSwitchedInTime=0UL;/*< Holds the value of a timer/counter the last time a task was switched in. */
PRIVILEGED_DATAstaticvolatileconfigRUN_TIME_COUNTER_TYPEulTotalRunTime=0UL;/*< Holds the total amount of execution time as defined by the run time counter clock. */
PRIVILEGED_DATAstaticconfigRUN_TIME_COUNTER_TYPEulTaskSwitchedInTime=0UL;/**< Holds the value of a timer/counter the last time a task was switched in. */
PRIVILEGED_DATAstaticvolatileconfigRUN_TIME_COUNTER_TYPEulTotalRunTime=0UL;/**< Holds the total amount of execution time as defined by the run time counter clock. */
typedefstructtmrTimerControl/* The old naming convention is used to prevent breaking kernel aware debuggers. */
{
constchar*pcTimerName;/*<< Text name. This is not used by the kernel, it is included simply to make debugging easier. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
ListItem_txTimerListItem;/*<< Standard linked list item as used by all kernel features for event management. */
TickType_txTimerPeriodInTicks;/*<< How quickly and often the timer expires. */
void*pvTimerID;/*<< An ID to identify the timer. This allows the timer to be identified when the same callback is used for multiple timers. */
TimerCallbackFunction_tpxCallbackFunction;/*<< The function that will be called when the timer expires. */
constchar*pcTimerName;/**< Text name. This is not used by the kernel, it is included simply to make debugging easier. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
ListItem_txTimerListItem;/**< Standard linked list item as used by all kernel features for event management. */
TickType_txTimerPeriodInTicks;/**< How quickly and often the timer expires. */
void*pvTimerID;/**< An ID to identify the timer. This allows the timer to be identified when the same callback is used for multiple timers. */
TimerCallbackFunction_tpxCallbackFunction;/**< The function that will be called when the timer expires. */
#if ( configUSE_TRACE_FACILITY == 1 )
UBaseType_tuxTimerNumber;/*<< An ID assigned by trace tools such as FreeRTOS+Trace */
UBaseType_tuxTimerNumber;/**< An ID assigned by trace tools such as FreeRTOS+Trace */
#endif
uint8_tucStatus;/*<< Holds bits to say if the timer was statically allocated or not, and if it is active or not. */
uint8_tucStatus;/**< Holds bits to say if the timer was statically allocated or not, and if it is active or not. */
}xTIMER;
/* The old xTIMER name is maintained above then typedefed to the new Timer_t
@ -96,8 +96,8 @@
*andxCallbackParametersTyperespectively.*/
typedefstructtmrTimerParameters
{
TickType_txMessageValue;/*<< An optional value used by a subset of commands, for example, when changing the period of a timer. */
Timer_t*pxTimer;/*<< The timer to which the command will be applied. */
TickType_txMessageValue;/**< An optional value used by a subset of commands, for example, when changing the period of a timer. */
Timer_t*pxTimer;/**< The timer to which the command will be applied. */
}TimerParameter_t;
@ -112,7 +112,7 @@
*thatisusedtodeterminewhichmessagetypeisvalid.*/
typedefstructtmrTimerQueueMessage
{
BaseType_txMessageID;/*<< The command being sent to the timer service task. */
BaseType_txMessageID;/**< The command being sent to the timer service task. */