mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 09:07:46 -04:00
preemptive version bump
This commit is contained in:
parent
d7fd5a1195
commit
e5184da222
25 changed files with 19203 additions and 19203 deletions
722
croutine.c
722
croutine.c
|
@ -1,361 +1,361 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
* the Software without restriction, including without limitation the rights to
|
* the Software without restriction, including without limitation the rights to
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
* subject to the following conditions:
|
* subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
* copies or substantial portions of the Software.
|
* copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* https://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* https://github.com/FreeRTOS
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "FreeRTOS.h"
|
#include "FreeRTOS.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
#include "croutine.h"
|
#include "croutine.h"
|
||||||
|
|
||||||
/* Remove the whole file is co-routines are not being used. */
|
/* Remove the whole file is co-routines are not being used. */
|
||||||
#if ( configUSE_CO_ROUTINES != 0 )
|
#if ( configUSE_CO_ROUTINES != 0 )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some kernel aware debuggers require data to be viewed to be global, rather
|
* Some kernel aware debuggers require data to be viewed to be global, rather
|
||||||
* than file scope.
|
* than file scope.
|
||||||
*/
|
*/
|
||||||
#ifdef portREMOVE_STATIC_QUALIFIER
|
#ifdef portREMOVE_STATIC_QUALIFIER
|
||||||
#define static
|
#define static
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Lists for ready and blocked co-routines. --------------------*/
|
/* Lists for ready and blocked co-routines. --------------------*/
|
||||||
static List_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /*< Prioritised ready co-routines. */
|
static List_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /*< Prioritised ready co-routines. */
|
||||||
static List_t xDelayedCoRoutineList1; /*< Delayed co-routines. */
|
static List_t xDelayedCoRoutineList1; /*< Delayed co-routines. */
|
||||||
static List_t xDelayedCoRoutineList2; /*< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */
|
static List_t xDelayedCoRoutineList2; /*< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */
|
||||||
static List_t * pxDelayedCoRoutineList = NULL; /*< Points to the delayed co-routine list currently being used. */
|
static List_t * pxDelayedCoRoutineList = NULL; /*< Points to the delayed co-routine list currently being used. */
|
||||||
static List_t * pxOverflowDelayedCoRoutineList = NULL; /*< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */
|
static List_t * pxOverflowDelayedCoRoutineList = NULL; /*< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */
|
||||||
static List_t xPendingReadyCoRoutineList; /*< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */
|
static List_t xPendingReadyCoRoutineList; /*< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */
|
||||||
|
|
||||||
/* Other file private variables. --------------------------------*/
|
/* Other file private variables. --------------------------------*/
|
||||||
CRCB_t * pxCurrentCoRoutine = NULL;
|
CRCB_t * pxCurrentCoRoutine = NULL;
|
||||||
static UBaseType_t uxTopCoRoutineReadyPriority = 0;
|
static UBaseType_t uxTopCoRoutineReadyPriority = 0;
|
||||||
static TickType_t xCoRoutineTickCount = 0, xLastTickCount = 0, xPassedTicks = 0;
|
static TickType_t xCoRoutineTickCount = 0, xLastTickCount = 0, xPassedTicks = 0;
|
||||||
|
|
||||||
/* The initial state of the co-routine when it is created. */
|
/* The initial state of the co-routine when it is created. */
|
||||||
#define corINITIAL_STATE ( 0 )
|
#define corINITIAL_STATE ( 0 )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Place the co-routine represented by pxCRCB into the appropriate ready queue
|
* Place the co-routine represented by pxCRCB into the appropriate ready queue
|
||||||
* for the priority. It is inserted at the end of the list.
|
* for the priority. It is inserted at the end of the list.
|
||||||
*
|
*
|
||||||
* This macro accesses the co-routine ready lists and therefore must not be
|
* This macro accesses the co-routine ready lists and therefore must not be
|
||||||
* used from within an ISR.
|
* used from within an ISR.
|
||||||
*/
|
*/
|
||||||
#define prvAddCoRoutineToReadyQueue( pxCRCB ) \
|
#define prvAddCoRoutineToReadyQueue( pxCRCB ) \
|
||||||
{ \
|
{ \
|
||||||
if( pxCRCB->uxPriority > uxTopCoRoutineReadyPriority ) \
|
if( pxCRCB->uxPriority > uxTopCoRoutineReadyPriority ) \
|
||||||
{ \
|
{ \
|
||||||
uxTopCoRoutineReadyPriority = pxCRCB->uxPriority; \
|
uxTopCoRoutineReadyPriority = pxCRCB->uxPriority; \
|
||||||
} \
|
} \
|
||||||
vListInsertEnd( ( List_t * ) &( pxReadyCoRoutineLists[ pxCRCB->uxPriority ] ), &( pxCRCB->xGenericListItem ) ); \
|
vListInsertEnd( ( List_t * ) &( pxReadyCoRoutineLists[ pxCRCB->uxPriority ] ), &( pxCRCB->xGenericListItem ) ); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Utility to ready all the lists used by the scheduler. This is called
|
* Utility to ready all the lists used by the scheduler. This is called
|
||||||
* automatically upon the creation of the first co-routine.
|
* automatically upon the creation of the first co-routine.
|
||||||
*/
|
*/
|
||||||
static void prvInitialiseCoRoutineLists( void );
|
static void prvInitialiseCoRoutineLists( void );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Co-routines that are readied by an interrupt cannot be placed directly into
|
* Co-routines that are readied by an interrupt cannot be placed directly into
|
||||||
* the ready lists (there is no mutual exclusion). Instead they are placed in
|
* the ready lists (there is no mutual exclusion). Instead they are placed in
|
||||||
* in the pending ready list in order that they can later be moved to the ready
|
* in the pending ready list in order that they can later be moved to the ready
|
||||||
* list by the co-routine scheduler.
|
* list by the co-routine scheduler.
|
||||||
*/
|
*/
|
||||||
static void prvCheckPendingReadyList( void );
|
static void prvCheckPendingReadyList( void );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Macro that looks at the list of co-routines that are currently delayed to
|
* Macro that looks at the list of co-routines that are currently delayed to
|
||||||
* see if any require waking.
|
* see if any require waking.
|
||||||
*
|
*
|
||||||
* Co-routines are stored in the queue in the order of their wake time -
|
* Co-routines are stored in the queue in the order of their wake time -
|
||||||
* meaning once one co-routine has been found whose timer has not expired
|
* meaning once one co-routine has been found whose timer has not expired
|
||||||
* we need not look any further down the list.
|
* we need not look any further down the list.
|
||||||
*/
|
*/
|
||||||
static void prvCheckDelayedList( void );
|
static void prvCheckDelayedList( void );
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode,
|
BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode,
|
||||||
UBaseType_t uxPriority,
|
UBaseType_t uxPriority,
|
||||||
UBaseType_t uxIndex )
|
UBaseType_t uxIndex )
|
||||||
{
|
{
|
||||||
BaseType_t xReturn;
|
BaseType_t xReturn;
|
||||||
CRCB_t * pxCoRoutine;
|
CRCB_t * pxCoRoutine;
|
||||||
|
|
||||||
/* Allocate the memory that will store the co-routine control block. */
|
/* Allocate the memory that will store the co-routine control block. */
|
||||||
pxCoRoutine = ( CRCB_t * ) pvPortMalloc( sizeof( CRCB_t ) );
|
pxCoRoutine = ( CRCB_t * ) pvPortMalloc( sizeof( CRCB_t ) );
|
||||||
|
|
||||||
if( pxCoRoutine )
|
if( pxCoRoutine )
|
||||||
{
|
{
|
||||||
/* If pxCurrentCoRoutine is NULL then this is the first co-routine to
|
/* If pxCurrentCoRoutine is NULL then this is the first co-routine to
|
||||||
* be created and the co-routine data structures need initialising. */
|
* be created and the co-routine data structures need initialising. */
|
||||||
if( pxCurrentCoRoutine == NULL )
|
if( pxCurrentCoRoutine == NULL )
|
||||||
{
|
{
|
||||||
pxCurrentCoRoutine = pxCoRoutine;
|
pxCurrentCoRoutine = pxCoRoutine;
|
||||||
prvInitialiseCoRoutineLists();
|
prvInitialiseCoRoutineLists();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check the priority is within limits. */
|
/* Check the priority is within limits. */
|
||||||
if( uxPriority >= configMAX_CO_ROUTINE_PRIORITIES )
|
if( uxPriority >= configMAX_CO_ROUTINE_PRIORITIES )
|
||||||
{
|
{
|
||||||
uxPriority = configMAX_CO_ROUTINE_PRIORITIES - 1;
|
uxPriority = configMAX_CO_ROUTINE_PRIORITIES - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fill out the co-routine control block from the function parameters. */
|
/* Fill out the co-routine control block from the function parameters. */
|
||||||
pxCoRoutine->uxState = corINITIAL_STATE;
|
pxCoRoutine->uxState = corINITIAL_STATE;
|
||||||
pxCoRoutine->uxPriority = uxPriority;
|
pxCoRoutine->uxPriority = uxPriority;
|
||||||
pxCoRoutine->uxIndex = uxIndex;
|
pxCoRoutine->uxIndex = uxIndex;
|
||||||
pxCoRoutine->pxCoRoutineFunction = pxCoRoutineCode;
|
pxCoRoutine->pxCoRoutineFunction = pxCoRoutineCode;
|
||||||
|
|
||||||
/* Initialise all the other co-routine control block parameters. */
|
/* Initialise all the other co-routine control block parameters. */
|
||||||
vListInitialiseItem( &( pxCoRoutine->xGenericListItem ) );
|
vListInitialiseItem( &( pxCoRoutine->xGenericListItem ) );
|
||||||
vListInitialiseItem( &( pxCoRoutine->xEventListItem ) );
|
vListInitialiseItem( &( pxCoRoutine->xEventListItem ) );
|
||||||
|
|
||||||
/* Set the co-routine control block as a link back from the ListItem_t.
|
/* Set the co-routine control block as a link back from the ListItem_t.
|
||||||
* This is so we can get back to the containing CRCB from a generic item
|
* This is so we can get back to the containing CRCB from a generic item
|
||||||
* in a list. */
|
* in a list. */
|
||||||
listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xGenericListItem ), pxCoRoutine );
|
listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xGenericListItem ), pxCoRoutine );
|
||||||
listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xEventListItem ), pxCoRoutine );
|
listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xEventListItem ), pxCoRoutine );
|
||||||
|
|
||||||
/* Event lists are always in priority order. */
|
/* Event lists are always in priority order. */
|
||||||
listSET_LIST_ITEM_VALUE( &( pxCoRoutine->xEventListItem ), ( ( TickType_t ) configMAX_CO_ROUTINE_PRIORITIES - ( TickType_t ) uxPriority ) );
|
listSET_LIST_ITEM_VALUE( &( pxCoRoutine->xEventListItem ), ( ( TickType_t ) configMAX_CO_ROUTINE_PRIORITIES - ( TickType_t ) uxPriority ) );
|
||||||
|
|
||||||
/* Now the co-routine has been initialised it can be added to the ready
|
/* Now the co-routine has been initialised it can be added to the ready
|
||||||
* list at the correct priority. */
|
* list at the correct priority. */
|
||||||
prvAddCoRoutineToReadyQueue( pxCoRoutine );
|
prvAddCoRoutineToReadyQueue( pxCoRoutine );
|
||||||
|
|
||||||
xReturn = pdPASS;
|
xReturn = pdPASS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
|
xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vCoRoutineAddToDelayedList( TickType_t xTicksToDelay,
|
void vCoRoutineAddToDelayedList( TickType_t xTicksToDelay,
|
||||||
List_t * pxEventList )
|
List_t * pxEventList )
|
||||||
{
|
{
|
||||||
TickType_t xTimeToWake;
|
TickType_t xTimeToWake;
|
||||||
|
|
||||||
/* Calculate the time to wake - this may overflow but this is
|
/* Calculate the time to wake - this may overflow but this is
|
||||||
* not a problem. */
|
* not a problem. */
|
||||||
xTimeToWake = xCoRoutineTickCount + xTicksToDelay;
|
xTimeToWake = xCoRoutineTickCount + xTicksToDelay;
|
||||||
|
|
||||||
/* We must remove ourselves from the ready list before adding
|
/* We must remove ourselves from the ready list before adding
|
||||||
* ourselves to the blocked list as the same list item is used for
|
* ourselves to the blocked list as the same list item is used for
|
||||||
* both lists. */
|
* both lists. */
|
||||||
( void ) uxListRemove( ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
|
( void ) uxListRemove( ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
|
||||||
|
|
||||||
/* The list item will be inserted in wake time order. */
|
/* The list item will be inserted in wake time order. */
|
||||||
listSET_LIST_ITEM_VALUE( &( pxCurrentCoRoutine->xGenericListItem ), xTimeToWake );
|
listSET_LIST_ITEM_VALUE( &( pxCurrentCoRoutine->xGenericListItem ), xTimeToWake );
|
||||||
|
|
||||||
if( xTimeToWake < xCoRoutineTickCount )
|
if( xTimeToWake < xCoRoutineTickCount )
|
||||||
{
|
{
|
||||||
/* Wake time has overflowed. Place this item in the
|
/* Wake time has overflowed. Place this item in the
|
||||||
* overflow list. */
|
* overflow list. */
|
||||||
vListInsert( ( List_t * ) pxOverflowDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
|
vListInsert( ( List_t * ) pxOverflowDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* The wake time has not overflowed, so we can use the
|
/* The wake time has not overflowed, so we can use the
|
||||||
* current block list. */
|
* current block list. */
|
||||||
vListInsert( ( List_t * ) pxDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
|
vListInsert( ( List_t * ) pxDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pxEventList )
|
if( pxEventList )
|
||||||
{
|
{
|
||||||
/* Also add the co-routine to an event list. If this is done then the
|
/* Also add the co-routine to an event list. If this is done then the
|
||||||
* function must be called with interrupts disabled. */
|
* function must be called with interrupts disabled. */
|
||||||
vListInsert( pxEventList, &( pxCurrentCoRoutine->xEventListItem ) );
|
vListInsert( pxEventList, &( pxCurrentCoRoutine->xEventListItem ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
static void prvCheckPendingReadyList( void )
|
static void prvCheckPendingReadyList( void )
|
||||||
{
|
{
|
||||||
/* Are there any co-routines waiting to get moved to the ready list? These
|
/* Are there any co-routines waiting to get moved to the ready list? These
|
||||||
* are co-routines that have been readied by an ISR. The ISR cannot access
|
* are co-routines that have been readied by an ISR. The ISR cannot access
|
||||||
* the ready lists itself. */
|
* the ready lists itself. */
|
||||||
while( listLIST_IS_EMPTY( &xPendingReadyCoRoutineList ) == pdFALSE )
|
while( listLIST_IS_EMPTY( &xPendingReadyCoRoutineList ) == pdFALSE )
|
||||||
{
|
{
|
||||||
CRCB_t * pxUnblockedCRCB;
|
CRCB_t * pxUnblockedCRCB;
|
||||||
|
|
||||||
/* The pending ready list can be accessed by an ISR. */
|
/* The pending ready list can be accessed by an ISR. */
|
||||||
portDISABLE_INTERRUPTS();
|
portDISABLE_INTERRUPTS();
|
||||||
{
|
{
|
||||||
pxUnblockedCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyCoRoutineList ) );
|
pxUnblockedCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyCoRoutineList ) );
|
||||||
( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );
|
( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );
|
||||||
}
|
}
|
||||||
portENABLE_INTERRUPTS();
|
portENABLE_INTERRUPTS();
|
||||||
|
|
||||||
( void ) uxListRemove( &( pxUnblockedCRCB->xGenericListItem ) );
|
( void ) uxListRemove( &( pxUnblockedCRCB->xGenericListItem ) );
|
||||||
prvAddCoRoutineToReadyQueue( pxUnblockedCRCB );
|
prvAddCoRoutineToReadyQueue( pxUnblockedCRCB );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
static void prvCheckDelayedList( void )
|
static void prvCheckDelayedList( void )
|
||||||
{
|
{
|
||||||
CRCB_t * pxCRCB;
|
CRCB_t * pxCRCB;
|
||||||
|
|
||||||
xPassedTicks = xTaskGetTickCount() - xLastTickCount;
|
xPassedTicks = xTaskGetTickCount() - xLastTickCount;
|
||||||
|
|
||||||
while( xPassedTicks )
|
while( xPassedTicks )
|
||||||
{
|
{
|
||||||
xCoRoutineTickCount++;
|
xCoRoutineTickCount++;
|
||||||
xPassedTicks--;
|
xPassedTicks--;
|
||||||
|
|
||||||
/* If the tick count has overflowed we need to swap the ready lists. */
|
/* If the tick count has overflowed we need to swap the ready lists. */
|
||||||
if( xCoRoutineTickCount == 0 )
|
if( xCoRoutineTickCount == 0 )
|
||||||
{
|
{
|
||||||
List_t * pxTemp;
|
List_t * pxTemp;
|
||||||
|
|
||||||
/* Tick count has overflowed so we need to swap the delay lists. If there are
|
/* Tick count has overflowed so we need to swap the delay lists. If there are
|
||||||
* any items in pxDelayedCoRoutineList here then there is an error! */
|
* any items in pxDelayedCoRoutineList here then there is an error! */
|
||||||
pxTemp = pxDelayedCoRoutineList;
|
pxTemp = pxDelayedCoRoutineList;
|
||||||
pxDelayedCoRoutineList = pxOverflowDelayedCoRoutineList;
|
pxDelayedCoRoutineList = pxOverflowDelayedCoRoutineList;
|
||||||
pxOverflowDelayedCoRoutineList = pxTemp;
|
pxOverflowDelayedCoRoutineList = pxTemp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See if this tick has made a timeout expire. */
|
/* See if this tick has made a timeout expire. */
|
||||||
while( listLIST_IS_EMPTY( pxDelayedCoRoutineList ) == pdFALSE )
|
while( listLIST_IS_EMPTY( pxDelayedCoRoutineList ) == pdFALSE )
|
||||||
{
|
{
|
||||||
pxCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedCoRoutineList );
|
pxCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedCoRoutineList );
|
||||||
|
|
||||||
if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) )
|
if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) )
|
||||||
{
|
{
|
||||||
/* Timeout not yet expired. */
|
/* Timeout not yet expired. */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
portDISABLE_INTERRUPTS();
|
portDISABLE_INTERRUPTS();
|
||||||
{
|
{
|
||||||
/* The event could have occurred just before this critical
|
/* The event could have occurred just before this critical
|
||||||
* section. If this is the case then the generic list item will
|
* section. If this is the case then the generic list item will
|
||||||
* have been moved to the pending ready list and the following
|
* have been moved to the pending ready list and the following
|
||||||
* line is still valid. Also the pvContainer parameter will have
|
* line is still valid. Also the pvContainer parameter will have
|
||||||
* been set to NULL so the following lines are also valid. */
|
* been set to NULL so the following lines are also valid. */
|
||||||
( void ) uxListRemove( &( pxCRCB->xGenericListItem ) );
|
( void ) uxListRemove( &( pxCRCB->xGenericListItem ) );
|
||||||
|
|
||||||
/* Is the co-routine waiting on an event also? */
|
/* Is the co-routine waiting on an event also? */
|
||||||
if( pxCRCB->xEventListItem.pxContainer )
|
if( pxCRCB->xEventListItem.pxContainer )
|
||||||
{
|
{
|
||||||
( void ) uxListRemove( &( pxCRCB->xEventListItem ) );
|
( void ) uxListRemove( &( pxCRCB->xEventListItem ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
portENABLE_INTERRUPTS();
|
portENABLE_INTERRUPTS();
|
||||||
|
|
||||||
prvAddCoRoutineToReadyQueue( pxCRCB );
|
prvAddCoRoutineToReadyQueue( pxCRCB );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xLastTickCount = xCoRoutineTickCount;
|
xLastTickCount = xCoRoutineTickCount;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vCoRoutineSchedule( void )
|
void vCoRoutineSchedule( void )
|
||||||
{
|
{
|
||||||
/* Only run a co-routine after prvInitialiseCoRoutineLists() has been
|
/* Only run a co-routine after prvInitialiseCoRoutineLists() has been
|
||||||
* called. prvInitialiseCoRoutineLists() is called automatically when a
|
* called. prvInitialiseCoRoutineLists() is called automatically when a
|
||||||
* co-routine is created. */
|
* co-routine is created. */
|
||||||
if( pxDelayedCoRoutineList != NULL )
|
if( pxDelayedCoRoutineList != NULL )
|
||||||
{
|
{
|
||||||
/* See if any co-routines readied by events need moving to the ready lists. */
|
/* See if any co-routines readied by events need moving to the ready lists. */
|
||||||
prvCheckPendingReadyList();
|
prvCheckPendingReadyList();
|
||||||
|
|
||||||
/* See if any delayed co-routines have timed out. */
|
/* See if any delayed co-routines have timed out. */
|
||||||
prvCheckDelayedList();
|
prvCheckDelayedList();
|
||||||
|
|
||||||
/* Find the highest priority queue that contains ready co-routines. */
|
/* Find the highest priority queue that contains ready co-routines. */
|
||||||
while( listLIST_IS_EMPTY( &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) ) )
|
while( listLIST_IS_EMPTY( &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) ) )
|
||||||
{
|
{
|
||||||
if( uxTopCoRoutineReadyPriority == 0 )
|
if( uxTopCoRoutineReadyPriority == 0 )
|
||||||
{
|
{
|
||||||
/* No more co-routines to check. */
|
/* No more co-routines to check. */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
--uxTopCoRoutineReadyPriority;
|
--uxTopCoRoutineReadyPriority;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* listGET_OWNER_OF_NEXT_ENTRY walks through the list, so the co-routines
|
/* listGET_OWNER_OF_NEXT_ENTRY walks through the list, so the co-routines
|
||||||
* of the same priority get an equal share of the processor time. */
|
* of the same priority get an equal share of the processor time. */
|
||||||
listGET_OWNER_OF_NEXT_ENTRY( pxCurrentCoRoutine, &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) );
|
listGET_OWNER_OF_NEXT_ENTRY( pxCurrentCoRoutine, &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) );
|
||||||
|
|
||||||
/* Call the co-routine. */
|
/* Call the co-routine. */
|
||||||
( pxCurrentCoRoutine->pxCoRoutineFunction )( pxCurrentCoRoutine, pxCurrentCoRoutine->uxIndex );
|
( pxCurrentCoRoutine->pxCoRoutineFunction )( pxCurrentCoRoutine, pxCurrentCoRoutine->uxIndex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
static void prvInitialiseCoRoutineLists( void )
|
static void prvInitialiseCoRoutineLists( void )
|
||||||
{
|
{
|
||||||
UBaseType_t uxPriority;
|
UBaseType_t uxPriority;
|
||||||
|
|
||||||
for( uxPriority = 0; uxPriority < configMAX_CO_ROUTINE_PRIORITIES; uxPriority++ )
|
for( uxPriority = 0; uxPriority < configMAX_CO_ROUTINE_PRIORITIES; uxPriority++ )
|
||||||
{
|
{
|
||||||
vListInitialise( ( List_t * ) &( pxReadyCoRoutineLists[ uxPriority ] ) );
|
vListInitialise( ( List_t * ) &( pxReadyCoRoutineLists[ uxPriority ] ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
vListInitialise( ( List_t * ) &xDelayedCoRoutineList1 );
|
vListInitialise( ( List_t * ) &xDelayedCoRoutineList1 );
|
||||||
vListInitialise( ( List_t * ) &xDelayedCoRoutineList2 );
|
vListInitialise( ( List_t * ) &xDelayedCoRoutineList2 );
|
||||||
vListInitialise( ( List_t * ) &xPendingReadyCoRoutineList );
|
vListInitialise( ( List_t * ) &xPendingReadyCoRoutineList );
|
||||||
|
|
||||||
/* Start with pxDelayedCoRoutineList using list1 and the
|
/* Start with pxDelayedCoRoutineList using list1 and the
|
||||||
* pxOverflowDelayedCoRoutineList using list2. */
|
* pxOverflowDelayedCoRoutineList using list2. */
|
||||||
pxDelayedCoRoutineList = &xDelayedCoRoutineList1;
|
pxDelayedCoRoutineList = &xDelayedCoRoutineList1;
|
||||||
pxOverflowDelayedCoRoutineList = &xDelayedCoRoutineList2;
|
pxOverflowDelayedCoRoutineList = &xDelayedCoRoutineList2;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
BaseType_t xCoRoutineRemoveFromEventList( const List_t * pxEventList )
|
BaseType_t xCoRoutineRemoveFromEventList( const List_t * pxEventList )
|
||||||
{
|
{
|
||||||
CRCB_t * pxUnblockedCRCB;
|
CRCB_t * pxUnblockedCRCB;
|
||||||
BaseType_t xReturn;
|
BaseType_t xReturn;
|
||||||
|
|
||||||
/* This function is called from within an interrupt. It can only access
|
/* This function is called from within an interrupt. It can only access
|
||||||
* event lists and the pending ready list. This function assumes that a
|
* event lists and the pending ready list. This function assumes that a
|
||||||
* check has already been made to ensure pxEventList is not empty. */
|
* check has already been made to ensure pxEventList is not empty. */
|
||||||
pxUnblockedCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList );
|
pxUnblockedCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList );
|
||||||
( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );
|
( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );
|
||||||
vListInsertEnd( ( List_t * ) &( xPendingReadyCoRoutineList ), &( pxUnblockedCRCB->xEventListItem ) );
|
vListInsertEnd( ( List_t * ) &( xPendingReadyCoRoutineList ), &( pxUnblockedCRCB->xEventListItem ) );
|
||||||
|
|
||||||
if( pxUnblockedCRCB->uxPriority >= pxCurrentCoRoutine->uxPriority )
|
if( pxUnblockedCRCB->uxPriority >= pxCurrentCoRoutine->uxPriority )
|
||||||
{
|
{
|
||||||
xReturn = pdTRUE;
|
xReturn = pdTRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xReturn = pdFALSE;
|
xReturn = pdFALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* configUSE_CO_ROUTINES == 0 */
|
#endif /* configUSE_CO_ROUTINES == 0 */
|
||||||
|
|
1542
event_groups.c
1542
event_groups.c
File diff suppressed because it is too large
Load diff
2650
include/FreeRTOS.h
2650
include/FreeRTOS.h
File diff suppressed because it is too large
Load diff
|
@ -1,32 +1,32 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
* the Software without restriction, including without limitation the rights to
|
* the Software without restriction, including without limitation the rights to
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
* subject to the following conditions:
|
* subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
* copies or substantial portions of the Software.
|
* copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* https://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* https://github.com/FreeRTOS
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef _MSC_VER /* Visual Studio doesn't support #warning. */
|
#ifndef _MSC_VER /* Visual Studio doesn't support #warning. */
|
||||||
#warning The name of this file has changed to stack_macros.h. Please update your code accordingly. This source file (which has the original name) will be removed in future released.
|
#warning The name of this file has changed to stack_macros.h. Please update your code accordingly. This source file (which has the original name) will be removed in future released.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "stack_macros.h"
|
#include "stack_macros.h"
|
||||||
|
|
834
include/atomic.h
834
include/atomic.h
|
@ -1,417 +1,417 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
* the Software without restriction, including without limitation the rights to
|
* the Software without restriction, including without limitation the rights to
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
* subject to the following conditions:
|
* subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
* copies or substantial portions of the Software.
|
* copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* https://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* https://github.com/FreeRTOS
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file atomic.h
|
* @file atomic.h
|
||||||
* @brief FreeRTOS atomic operation support.
|
* @brief FreeRTOS atomic operation support.
|
||||||
*
|
*
|
||||||
* This file implements atomic functions by disabling interrupts globally.
|
* This file implements atomic functions by disabling interrupts globally.
|
||||||
* Implementations with architecture specific atomic instructions can be
|
* Implementations with architecture specific atomic instructions can be
|
||||||
* provided under each compiler directory.
|
* provided under each compiler directory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef ATOMIC_H
|
#ifndef ATOMIC_H
|
||||||
#define ATOMIC_H
|
#define ATOMIC_H
|
||||||
|
|
||||||
#ifndef INC_FREERTOS_H
|
#ifndef INC_FREERTOS_H
|
||||||
#error "include FreeRTOS.h must appear in source files before include atomic.h"
|
#error "include FreeRTOS.h must appear in source files before include atomic.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Standard includes. */
|
/* Standard includes. */
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Port specific definitions -- entering/exiting critical section.
|
* Port specific definitions -- entering/exiting critical section.
|
||||||
* Refer template -- ./lib/FreeRTOS/portable/Compiler/Arch/portmacro.h
|
* Refer template -- ./lib/FreeRTOS/portable/Compiler/Arch/portmacro.h
|
||||||
*
|
*
|
||||||
* Every call to ATOMIC_EXIT_CRITICAL() must be closely paired with
|
* Every call to ATOMIC_EXIT_CRITICAL() must be closely paired with
|
||||||
* ATOMIC_ENTER_CRITICAL().
|
* ATOMIC_ENTER_CRITICAL().
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#if defined( portSET_INTERRUPT_MASK_FROM_ISR )
|
#if defined( portSET_INTERRUPT_MASK_FROM_ISR )
|
||||||
|
|
||||||
/* Nested interrupt scheme is supported in this port. */
|
/* Nested interrupt scheme is supported in this port. */
|
||||||
#define ATOMIC_ENTER_CRITICAL() \
|
#define ATOMIC_ENTER_CRITICAL() \
|
||||||
UBaseType_t uxCriticalSectionType = portSET_INTERRUPT_MASK_FROM_ISR()
|
UBaseType_t uxCriticalSectionType = portSET_INTERRUPT_MASK_FROM_ISR()
|
||||||
|
|
||||||
#define ATOMIC_EXIT_CRITICAL() \
|
#define ATOMIC_EXIT_CRITICAL() \
|
||||||
portCLEAR_INTERRUPT_MASK_FROM_ISR( uxCriticalSectionType )
|
portCLEAR_INTERRUPT_MASK_FROM_ISR( uxCriticalSectionType )
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* Nested interrupt scheme is NOT supported in this port. */
|
/* Nested interrupt scheme is NOT supported in this port. */
|
||||||
#define ATOMIC_ENTER_CRITICAL() portENTER_CRITICAL()
|
#define ATOMIC_ENTER_CRITICAL() portENTER_CRITICAL()
|
||||||
#define ATOMIC_EXIT_CRITICAL() portEXIT_CRITICAL()
|
#define ATOMIC_EXIT_CRITICAL() portEXIT_CRITICAL()
|
||||||
|
|
||||||
#endif /* portSET_INTERRUPT_MASK_FROM_ISR() */
|
#endif /* portSET_INTERRUPT_MASK_FROM_ISR() */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Port specific definition -- "always inline".
|
* Port specific definition -- "always inline".
|
||||||
* Inline is compiler specific, and may not always get inlined depending on your
|
* Inline is compiler specific, and may not always get inlined depending on your
|
||||||
* optimization level. Also, inline is considered as performance optimization
|
* optimization level. Also, inline is considered as performance optimization
|
||||||
* for atomic. Thus, if portFORCE_INLINE is not provided by portmacro.h,
|
* for atomic. Thus, if portFORCE_INLINE is not provided by portmacro.h,
|
||||||
* instead of resulting error, simply define it away.
|
* instead of resulting error, simply define it away.
|
||||||
*/
|
*/
|
||||||
#ifndef portFORCE_INLINE
|
#ifndef portFORCE_INLINE
|
||||||
#define portFORCE_INLINE
|
#define portFORCE_INLINE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ATOMIC_COMPARE_AND_SWAP_SUCCESS 0x1U /**< Compare and swap succeeded, swapped. */
|
#define ATOMIC_COMPARE_AND_SWAP_SUCCESS 0x1U /**< Compare and swap succeeded, swapped. */
|
||||||
#define ATOMIC_COMPARE_AND_SWAP_FAILURE 0x0U /**< Compare and swap failed, did not swap. */
|
#define ATOMIC_COMPARE_AND_SWAP_FAILURE 0x0U /**< Compare and swap failed, did not swap. */
|
||||||
|
|
||||||
/*----------------------------- Swap && CAS ------------------------------*/
|
/*----------------------------- Swap && CAS ------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Atomic compare-and-swap
|
* Atomic compare-and-swap
|
||||||
*
|
*
|
||||||
* @brief Performs an atomic compare-and-swap operation on the specified values.
|
* @brief Performs an atomic compare-and-swap operation on the specified values.
|
||||||
*
|
*
|
||||||
* @param[in, out] pulDestination Pointer to memory location from where value is
|
* @param[in, out] pulDestination Pointer to memory location from where value is
|
||||||
* to be loaded and checked.
|
* to be loaded and checked.
|
||||||
* @param[in] ulExchange If condition meets, write this value to memory.
|
* @param[in] ulExchange If condition meets, write this value to memory.
|
||||||
* @param[in] ulComparand Swap condition.
|
* @param[in] ulComparand Swap condition.
|
||||||
*
|
*
|
||||||
* @return Unsigned integer of value 1 or 0. 1 for swapped, 0 for not swapped.
|
* @return Unsigned integer of value 1 or 0. 1 for swapped, 0 for not swapped.
|
||||||
*
|
*
|
||||||
* @note This function only swaps *pulDestination with ulExchange, if previous
|
* @note This function only swaps *pulDestination with ulExchange, if previous
|
||||||
* *pulDestination value equals ulComparand.
|
* *pulDestination value equals ulComparand.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_CompareAndSwap_u32( uint32_t volatile * pulDestination,
|
static portFORCE_INLINE uint32_t Atomic_CompareAndSwap_u32( uint32_t volatile * pulDestination,
|
||||||
uint32_t ulExchange,
|
uint32_t ulExchange,
|
||||||
uint32_t ulComparand )
|
uint32_t ulComparand )
|
||||||
{
|
{
|
||||||
uint32_t ulReturnValue;
|
uint32_t ulReturnValue;
|
||||||
|
|
||||||
ATOMIC_ENTER_CRITICAL();
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
if( *pulDestination == ulComparand )
|
if( *pulDestination == ulComparand )
|
||||||
{
|
{
|
||||||
*pulDestination = ulExchange;
|
*pulDestination = ulExchange;
|
||||||
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_SUCCESS;
|
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_SUCCESS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_FAILURE;
|
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ATOMIC_EXIT_CRITICAL();
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
return ulReturnValue;
|
return ulReturnValue;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Atomic swap (pointers)
|
* Atomic swap (pointers)
|
||||||
*
|
*
|
||||||
* @brief Atomically sets the address pointed to by *ppvDestination to the value
|
* @brief Atomically sets the address pointed to by *ppvDestination to the value
|
||||||
* of *pvExchange.
|
* of *pvExchange.
|
||||||
*
|
*
|
||||||
* @param[in, out] ppvDestination Pointer to memory location from where a pointer
|
* @param[in, out] ppvDestination Pointer to memory location from where a pointer
|
||||||
* value is to be loaded and written back to.
|
* value is to be loaded and written back to.
|
||||||
* @param[in] pvExchange Pointer value to be written to *ppvDestination.
|
* @param[in] pvExchange Pointer value to be written to *ppvDestination.
|
||||||
*
|
*
|
||||||
* @return The initial value of *ppvDestination.
|
* @return The initial value of *ppvDestination.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE void * Atomic_SwapPointers_p32( void * volatile * ppvDestination,
|
static portFORCE_INLINE void * Atomic_SwapPointers_p32( void * volatile * ppvDestination,
|
||||||
void * pvExchange )
|
void * pvExchange )
|
||||||
{
|
{
|
||||||
void * pReturnValue;
|
void * pReturnValue;
|
||||||
|
|
||||||
ATOMIC_ENTER_CRITICAL();
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
pReturnValue = *ppvDestination;
|
pReturnValue = *ppvDestination;
|
||||||
*ppvDestination = pvExchange;
|
*ppvDestination = pvExchange;
|
||||||
}
|
}
|
||||||
ATOMIC_EXIT_CRITICAL();
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
return pReturnValue;
|
return pReturnValue;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Atomic compare-and-swap (pointers)
|
* Atomic compare-and-swap (pointers)
|
||||||
*
|
*
|
||||||
* @brief Performs an atomic compare-and-swap operation on the specified pointer
|
* @brief Performs an atomic compare-and-swap operation on the specified pointer
|
||||||
* values.
|
* values.
|
||||||
*
|
*
|
||||||
* @param[in, out] ppvDestination Pointer to memory location from where a pointer
|
* @param[in, out] ppvDestination Pointer to memory location from where a pointer
|
||||||
* value is to be loaded and checked.
|
* value is to be loaded and checked.
|
||||||
* @param[in] pvExchange If condition meets, write this value to memory.
|
* @param[in] pvExchange If condition meets, write this value to memory.
|
||||||
* @param[in] pvComparand Swap condition.
|
* @param[in] pvComparand Swap condition.
|
||||||
*
|
*
|
||||||
* @return Unsigned integer of value 1 or 0. 1 for swapped, 0 for not swapped.
|
* @return Unsigned integer of value 1 or 0. 1 for swapped, 0 for not swapped.
|
||||||
*
|
*
|
||||||
* @note This function only swaps *ppvDestination with pvExchange, if previous
|
* @note This function only swaps *ppvDestination with pvExchange, if previous
|
||||||
* *ppvDestination value equals pvComparand.
|
* *ppvDestination value equals pvComparand.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_CompareAndSwapPointers_p32( void * volatile * ppvDestination,
|
static portFORCE_INLINE uint32_t Atomic_CompareAndSwapPointers_p32( void * volatile * ppvDestination,
|
||||||
void * pvExchange,
|
void * pvExchange,
|
||||||
void * pvComparand )
|
void * pvComparand )
|
||||||
{
|
{
|
||||||
uint32_t ulReturnValue = ATOMIC_COMPARE_AND_SWAP_FAILURE;
|
uint32_t ulReturnValue = ATOMIC_COMPARE_AND_SWAP_FAILURE;
|
||||||
|
|
||||||
ATOMIC_ENTER_CRITICAL();
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
if( *ppvDestination == pvComparand )
|
if( *ppvDestination == pvComparand )
|
||||||
{
|
{
|
||||||
*ppvDestination = pvExchange;
|
*ppvDestination = pvExchange;
|
||||||
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_SUCCESS;
|
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ATOMIC_EXIT_CRITICAL();
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
return ulReturnValue;
|
return ulReturnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------- Arithmetic ------------------------------*/
|
/*----------------------------- Arithmetic ------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Atomic add
|
* Atomic add
|
||||||
*
|
*
|
||||||
* @brief Atomically adds count to the value of the specified pointer points to.
|
* @brief Atomically adds count to the value of the specified pointer points to.
|
||||||
*
|
*
|
||||||
* @param[in,out] pulAddend Pointer to memory location from where value is to be
|
* @param[in,out] pulAddend Pointer to memory location from where value is to be
|
||||||
* loaded and written back to.
|
* loaded and written back to.
|
||||||
* @param[in] ulCount Value to be added to *pulAddend.
|
* @param[in] ulCount Value to be added to *pulAddend.
|
||||||
*
|
*
|
||||||
* @return previous *pulAddend value.
|
* @return previous *pulAddend value.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_Add_u32( uint32_t volatile * pulAddend,
|
static portFORCE_INLINE uint32_t Atomic_Add_u32( uint32_t volatile * pulAddend,
|
||||||
uint32_t ulCount )
|
uint32_t ulCount )
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
ATOMIC_ENTER_CRITICAL();
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
ulCurrent = *pulAddend;
|
ulCurrent = *pulAddend;
|
||||||
*pulAddend += ulCount;
|
*pulAddend += ulCount;
|
||||||
}
|
}
|
||||||
ATOMIC_EXIT_CRITICAL();
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
return ulCurrent;
|
return ulCurrent;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Atomic subtract
|
* Atomic subtract
|
||||||
*
|
*
|
||||||
* @brief Atomically subtracts count from the value of the specified pointer
|
* @brief Atomically subtracts count from the value of the specified pointer
|
||||||
* pointers to.
|
* pointers to.
|
||||||
*
|
*
|
||||||
* @param[in,out] pulAddend Pointer to memory location from where value is to be
|
* @param[in,out] pulAddend Pointer to memory location from where value is to be
|
||||||
* loaded and written back to.
|
* loaded and written back to.
|
||||||
* @param[in] ulCount Value to be subtract from *pulAddend.
|
* @param[in] ulCount Value to be subtract from *pulAddend.
|
||||||
*
|
*
|
||||||
* @return previous *pulAddend value.
|
* @return previous *pulAddend value.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_Subtract_u32( uint32_t volatile * pulAddend,
|
static portFORCE_INLINE uint32_t Atomic_Subtract_u32( uint32_t volatile * pulAddend,
|
||||||
uint32_t ulCount )
|
uint32_t ulCount )
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
ATOMIC_ENTER_CRITICAL();
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
ulCurrent = *pulAddend;
|
ulCurrent = *pulAddend;
|
||||||
*pulAddend -= ulCount;
|
*pulAddend -= ulCount;
|
||||||
}
|
}
|
||||||
ATOMIC_EXIT_CRITICAL();
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
return ulCurrent;
|
return ulCurrent;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Atomic increment
|
* Atomic increment
|
||||||
*
|
*
|
||||||
* @brief Atomically increments the value of the specified pointer points to.
|
* @brief Atomically increments the value of the specified pointer points to.
|
||||||
*
|
*
|
||||||
* @param[in,out] pulAddend Pointer to memory location from where value is to be
|
* @param[in,out] pulAddend Pointer to memory location from where value is to be
|
||||||
* loaded and written back to.
|
* loaded and written back to.
|
||||||
*
|
*
|
||||||
* @return *pulAddend value before increment.
|
* @return *pulAddend value before increment.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_Increment_u32( uint32_t volatile * pulAddend )
|
static portFORCE_INLINE uint32_t Atomic_Increment_u32( uint32_t volatile * pulAddend )
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
ATOMIC_ENTER_CRITICAL();
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
ulCurrent = *pulAddend;
|
ulCurrent = *pulAddend;
|
||||||
*pulAddend += 1;
|
*pulAddend += 1;
|
||||||
}
|
}
|
||||||
ATOMIC_EXIT_CRITICAL();
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
return ulCurrent;
|
return ulCurrent;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Atomic decrement
|
* Atomic decrement
|
||||||
*
|
*
|
||||||
* @brief Atomically decrements the value of the specified pointer points to
|
* @brief Atomically decrements the value of the specified pointer points to
|
||||||
*
|
*
|
||||||
* @param[in,out] pulAddend Pointer to memory location from where value is to be
|
* @param[in,out] pulAddend Pointer to memory location from where value is to be
|
||||||
* loaded and written back to.
|
* loaded and written back to.
|
||||||
*
|
*
|
||||||
* @return *pulAddend value before decrement.
|
* @return *pulAddend value before decrement.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_Decrement_u32( uint32_t volatile * pulAddend )
|
static portFORCE_INLINE uint32_t Atomic_Decrement_u32( uint32_t volatile * pulAddend )
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
ATOMIC_ENTER_CRITICAL();
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
ulCurrent = *pulAddend;
|
ulCurrent = *pulAddend;
|
||||||
*pulAddend -= 1;
|
*pulAddend -= 1;
|
||||||
}
|
}
|
||||||
ATOMIC_EXIT_CRITICAL();
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
return ulCurrent;
|
return ulCurrent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------- Bitwise Logical ------------------------------*/
|
/*----------------------------- Bitwise Logical ------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Atomic OR
|
* Atomic OR
|
||||||
*
|
*
|
||||||
* @brief Performs an atomic OR operation on the specified values.
|
* @brief Performs an atomic OR operation on the specified values.
|
||||||
*
|
*
|
||||||
* @param [in, out] pulDestination Pointer to memory location from where value is
|
* @param [in, out] pulDestination Pointer to memory location from where value is
|
||||||
* to be loaded and written back to.
|
* to be loaded and written back to.
|
||||||
* @param [in] ulValue Value to be ORed with *pulDestination.
|
* @param [in] ulValue Value to be ORed with *pulDestination.
|
||||||
*
|
*
|
||||||
* @return The original value of *pulDestination.
|
* @return The original value of *pulDestination.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_OR_u32( uint32_t volatile * pulDestination,
|
static portFORCE_INLINE uint32_t Atomic_OR_u32( uint32_t volatile * pulDestination,
|
||||||
uint32_t ulValue )
|
uint32_t ulValue )
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
ATOMIC_ENTER_CRITICAL();
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
ulCurrent = *pulDestination;
|
ulCurrent = *pulDestination;
|
||||||
*pulDestination |= ulValue;
|
*pulDestination |= ulValue;
|
||||||
}
|
}
|
||||||
ATOMIC_EXIT_CRITICAL();
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
return ulCurrent;
|
return ulCurrent;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Atomic AND
|
* Atomic AND
|
||||||
*
|
*
|
||||||
* @brief Performs an atomic AND operation on the specified values.
|
* @brief Performs an atomic AND operation on the specified values.
|
||||||
*
|
*
|
||||||
* @param [in, out] pulDestination Pointer to memory location from where value is
|
* @param [in, out] pulDestination Pointer to memory location from where value is
|
||||||
* to be loaded and written back to.
|
* to be loaded and written back to.
|
||||||
* @param [in] ulValue Value to be ANDed with *pulDestination.
|
* @param [in] ulValue Value to be ANDed with *pulDestination.
|
||||||
*
|
*
|
||||||
* @return The original value of *pulDestination.
|
* @return The original value of *pulDestination.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_AND_u32( uint32_t volatile * pulDestination,
|
static portFORCE_INLINE uint32_t Atomic_AND_u32( uint32_t volatile * pulDestination,
|
||||||
uint32_t ulValue )
|
uint32_t ulValue )
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
ATOMIC_ENTER_CRITICAL();
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
ulCurrent = *pulDestination;
|
ulCurrent = *pulDestination;
|
||||||
*pulDestination &= ulValue;
|
*pulDestination &= ulValue;
|
||||||
}
|
}
|
||||||
ATOMIC_EXIT_CRITICAL();
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
return ulCurrent;
|
return ulCurrent;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Atomic NAND
|
* Atomic NAND
|
||||||
*
|
*
|
||||||
* @brief Performs an atomic NAND operation on the specified values.
|
* @brief Performs an atomic NAND operation on the specified values.
|
||||||
*
|
*
|
||||||
* @param [in, out] pulDestination Pointer to memory location from where value is
|
* @param [in, out] pulDestination Pointer to memory location from where value is
|
||||||
* to be loaded and written back to.
|
* to be loaded and written back to.
|
||||||
* @param [in] ulValue Value to be NANDed with *pulDestination.
|
* @param [in] ulValue Value to be NANDed with *pulDestination.
|
||||||
*
|
*
|
||||||
* @return The original value of *pulDestination.
|
* @return The original value of *pulDestination.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_NAND_u32( uint32_t volatile * pulDestination,
|
static portFORCE_INLINE uint32_t Atomic_NAND_u32( uint32_t volatile * pulDestination,
|
||||||
uint32_t ulValue )
|
uint32_t ulValue )
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
ATOMIC_ENTER_CRITICAL();
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
ulCurrent = *pulDestination;
|
ulCurrent = *pulDestination;
|
||||||
*pulDestination = ~( ulCurrent & ulValue );
|
*pulDestination = ~( ulCurrent & ulValue );
|
||||||
}
|
}
|
||||||
ATOMIC_EXIT_CRITICAL();
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
return ulCurrent;
|
return ulCurrent;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Atomic XOR
|
* Atomic XOR
|
||||||
*
|
*
|
||||||
* @brief Performs an atomic XOR operation on the specified values.
|
* @brief Performs an atomic XOR operation on the specified values.
|
||||||
*
|
*
|
||||||
* @param [in, out] pulDestination Pointer to memory location from where value is
|
* @param [in, out] pulDestination Pointer to memory location from where value is
|
||||||
* to be loaded and written back to.
|
* to be loaded and written back to.
|
||||||
* @param [in] ulValue Value to be XORed with *pulDestination.
|
* @param [in] ulValue Value to be XORed with *pulDestination.
|
||||||
*
|
*
|
||||||
* @return The original value of *pulDestination.
|
* @return The original value of *pulDestination.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_XOR_u32( uint32_t volatile * pulDestination,
|
static portFORCE_INLINE uint32_t Atomic_XOR_u32( uint32_t volatile * pulDestination,
|
||||||
uint32_t ulValue )
|
uint32_t ulValue )
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
ATOMIC_ENTER_CRITICAL();
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
ulCurrent = *pulDestination;
|
ulCurrent = *pulDestination;
|
||||||
*pulDestination ^= ulValue;
|
*pulDestination ^= ulValue;
|
||||||
}
|
}
|
||||||
ATOMIC_EXIT_CRITICAL();
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
return ulCurrent;
|
return ulCurrent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* ATOMIC_H */
|
#endif /* ATOMIC_H */
|
||||||
|
|
1502
include/croutine.h
1502
include/croutine.h
File diff suppressed because it is too large
Load diff
|
@ -1,279 +1,279 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
* the Software without restriction, including without limitation the rights to
|
* the Software without restriction, including without limitation the rights to
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
* subject to the following conditions:
|
* subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
* copies or substantial portions of the Software.
|
* copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* https://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* https://github.com/FreeRTOS
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef DEPRECATED_DEFINITIONS_H
|
#ifndef DEPRECATED_DEFINITIONS_H
|
||||||
#define DEPRECATED_DEFINITIONS_H
|
#define DEPRECATED_DEFINITIONS_H
|
||||||
|
|
||||||
|
|
||||||
/* Each FreeRTOS port has a unique portmacro.h header file. Originally a
|
/* Each FreeRTOS port has a unique portmacro.h header file. Originally a
|
||||||
* pre-processor definition was used to ensure the pre-processor found the correct
|
* pre-processor definition was used to ensure the pre-processor found the correct
|
||||||
* portmacro.h file for the port being used. That scheme was deprecated in favour
|
* portmacro.h file for the port being used. That scheme was deprecated in favour
|
||||||
* of setting the compiler's include path such that it found the correct
|
* of setting the compiler's include path such that it found the correct
|
||||||
* portmacro.h file - removing the need for the constant and allowing the
|
* portmacro.h file - removing the need for the constant and allowing the
|
||||||
* portmacro.h file to be located anywhere in relation to the port being used. The
|
* portmacro.h file to be located anywhere in relation to the port being used. The
|
||||||
* definitions below remain in the code for backward compatibility only. New
|
* definitions below remain in the code for backward compatibility only. New
|
||||||
* projects should not use them. */
|
* projects should not use them. */
|
||||||
|
|
||||||
#ifdef OPEN_WATCOM_INDUSTRIAL_PC_PORT
|
#ifdef OPEN_WATCOM_INDUSTRIAL_PC_PORT
|
||||||
#include "..\..\Source\portable\owatcom\16bitdos\pc\portmacro.h"
|
#include "..\..\Source\portable\owatcom\16bitdos\pc\portmacro.h"
|
||||||
typedef void ( __interrupt __far * pxISR )();
|
typedef void ( __interrupt __far * pxISR )();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OPEN_WATCOM_FLASH_LITE_186_PORT
|
#ifdef OPEN_WATCOM_FLASH_LITE_186_PORT
|
||||||
#include "..\..\Source\portable\owatcom\16bitdos\flsh186\portmacro.h"
|
#include "..\..\Source\portable\owatcom\16bitdos\flsh186\portmacro.h"
|
||||||
typedef void ( __interrupt __far * pxISR )();
|
typedef void ( __interrupt __far * pxISR )();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GCC_MEGA_AVR
|
#ifdef GCC_MEGA_AVR
|
||||||
#include "../portable/GCC/ATMega323/portmacro.h"
|
#include "../portable/GCC/ATMega323/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IAR_MEGA_AVR
|
#ifdef IAR_MEGA_AVR
|
||||||
#include "../portable/IAR/ATMega323/portmacro.h"
|
#include "../portable/IAR/ATMega323/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MPLAB_PIC24_PORT
|
#ifdef MPLAB_PIC24_PORT
|
||||||
#include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h"
|
#include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MPLAB_DSPIC_PORT
|
#ifdef MPLAB_DSPIC_PORT
|
||||||
#include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h"
|
#include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MPLAB_PIC18F_PORT
|
#ifdef MPLAB_PIC18F_PORT
|
||||||
#include "../../Source/portable/MPLAB/PIC18F/portmacro.h"
|
#include "../../Source/portable/MPLAB/PIC18F/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MPLAB_PIC32MX_PORT
|
#ifdef MPLAB_PIC32MX_PORT
|
||||||
#include "../../Source/portable/MPLAB/PIC32MX/portmacro.h"
|
#include "../../Source/portable/MPLAB/PIC32MX/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _FEDPICC
|
#ifdef _FEDPICC
|
||||||
#include "libFreeRTOS/Include/portmacro.h"
|
#include "libFreeRTOS/Include/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SDCC_CYGNAL
|
#ifdef SDCC_CYGNAL
|
||||||
#include "../../Source/portable/SDCC/Cygnal/portmacro.h"
|
#include "../../Source/portable/SDCC/Cygnal/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GCC_ARM7
|
#ifdef GCC_ARM7
|
||||||
#include "../../Source/portable/GCC/ARM7_LPC2000/portmacro.h"
|
#include "../../Source/portable/GCC/ARM7_LPC2000/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GCC_ARM7_ECLIPSE
|
#ifdef GCC_ARM7_ECLIPSE
|
||||||
#include "portmacro.h"
|
#include "portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ROWLEY_LPC23xx
|
#ifdef ROWLEY_LPC23xx
|
||||||
#include "../../Source/portable/GCC/ARM7_LPC23xx/portmacro.h"
|
#include "../../Source/portable/GCC/ARM7_LPC23xx/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IAR_MSP430
|
#ifdef IAR_MSP430
|
||||||
#include "..\..\Source\portable\IAR\MSP430\portmacro.h"
|
#include "..\..\Source\portable\IAR\MSP430\portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GCC_MSP430
|
#ifdef GCC_MSP430
|
||||||
#include "../../Source/portable/GCC/MSP430F449/portmacro.h"
|
#include "../../Source/portable/GCC/MSP430F449/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ROWLEY_MSP430
|
#ifdef ROWLEY_MSP430
|
||||||
#include "../../Source/portable/Rowley/MSP430F449/portmacro.h"
|
#include "../../Source/portable/Rowley/MSP430F449/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ARM7_LPC21xx_KEIL_RVDS
|
#ifdef ARM7_LPC21xx_KEIL_RVDS
|
||||||
#include "..\..\Source\portable\RVDS\ARM7_LPC21xx\portmacro.h"
|
#include "..\..\Source\portable\RVDS\ARM7_LPC21xx\portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SAM7_GCC
|
#ifdef SAM7_GCC
|
||||||
#include "../../Source/portable/GCC/ARM7_AT91SAM7S/portmacro.h"
|
#include "../../Source/portable/GCC/ARM7_AT91SAM7S/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SAM7_IAR
|
#ifdef SAM7_IAR
|
||||||
#include "..\..\Source\portable\IAR\AtmelSAM7S64\portmacro.h"
|
#include "..\..\Source\portable\IAR\AtmelSAM7S64\portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SAM9XE_IAR
|
#ifdef SAM9XE_IAR
|
||||||
#include "..\..\Source\portable\IAR\AtmelSAM9XE\portmacro.h"
|
#include "..\..\Source\portable\IAR\AtmelSAM9XE\portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LPC2000_IAR
|
#ifdef LPC2000_IAR
|
||||||
#include "..\..\Source\portable\IAR\LPC2000\portmacro.h"
|
#include "..\..\Source\portable\IAR\LPC2000\portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STR71X_IAR
|
#ifdef STR71X_IAR
|
||||||
#include "..\..\Source\portable\IAR\STR71x\portmacro.h"
|
#include "..\..\Source\portable\IAR\STR71x\portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STR75X_IAR
|
#ifdef STR75X_IAR
|
||||||
#include "..\..\Source\portable\IAR\STR75x\portmacro.h"
|
#include "..\..\Source\portable\IAR\STR75x\portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STR75X_GCC
|
#ifdef STR75X_GCC
|
||||||
#include "..\..\Source\portable\GCC\STR75x\portmacro.h"
|
#include "..\..\Source\portable\GCC\STR75x\portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STR91X_IAR
|
#ifdef STR91X_IAR
|
||||||
#include "..\..\Source\portable\IAR\STR91x\portmacro.h"
|
#include "..\..\Source\portable\IAR\STR91x\portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GCC_H8S
|
#ifdef GCC_H8S
|
||||||
#include "../../Source/portable/GCC/H8S2329/portmacro.h"
|
#include "../../Source/portable/GCC/H8S2329/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GCC_AT91FR40008
|
#ifdef GCC_AT91FR40008
|
||||||
#include "../../Source/portable/GCC/ARM7_AT91FR40008/portmacro.h"
|
#include "../../Source/portable/GCC/ARM7_AT91FR40008/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RVDS_ARMCM3_LM3S102
|
#ifdef RVDS_ARMCM3_LM3S102
|
||||||
#include "../../Source/portable/RVDS/ARM_CM3/portmacro.h"
|
#include "../../Source/portable/RVDS/ARM_CM3/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GCC_ARMCM3_LM3S102
|
#ifdef GCC_ARMCM3_LM3S102
|
||||||
#include "../../Source/portable/GCC/ARM_CM3/portmacro.h"
|
#include "../../Source/portable/GCC/ARM_CM3/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GCC_ARMCM3
|
#ifdef GCC_ARMCM3
|
||||||
#include "../../Source/portable/GCC/ARM_CM3/portmacro.h"
|
#include "../../Source/portable/GCC/ARM_CM3/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IAR_ARM_CM3
|
#ifdef IAR_ARM_CM3
|
||||||
#include "../../Source/portable/IAR/ARM_CM3/portmacro.h"
|
#include "../../Source/portable/IAR/ARM_CM3/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IAR_ARMCM3_LM
|
#ifdef IAR_ARMCM3_LM
|
||||||
#include "../../Source/portable/IAR/ARM_CM3/portmacro.h"
|
#include "../../Source/portable/IAR/ARM_CM3/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HCS12_CODE_WARRIOR
|
#ifdef HCS12_CODE_WARRIOR
|
||||||
#include "../../Source/portable/CodeWarrior/HCS12/portmacro.h"
|
#include "../../Source/portable/CodeWarrior/HCS12/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MICROBLAZE_GCC
|
#ifdef MICROBLAZE_GCC
|
||||||
#include "../../Source/portable/GCC/MicroBlaze/portmacro.h"
|
#include "../../Source/portable/GCC/MicroBlaze/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef TERN_EE
|
#ifdef TERN_EE
|
||||||
#include "..\..\Source\portable\Paradigm\Tern_EE\small\portmacro.h"
|
#include "..\..\Source\portable\Paradigm\Tern_EE\small\portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GCC_HCS12
|
#ifdef GCC_HCS12
|
||||||
#include "../../Source/portable/GCC/HCS12/portmacro.h"
|
#include "../../Source/portable/GCC/HCS12/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GCC_MCF5235
|
#ifdef GCC_MCF5235
|
||||||
#include "../../Source/portable/GCC/MCF5235/portmacro.h"
|
#include "../../Source/portable/GCC/MCF5235/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef COLDFIRE_V2_GCC
|
#ifdef COLDFIRE_V2_GCC
|
||||||
#include "../../../Source/portable/GCC/ColdFire_V2/portmacro.h"
|
#include "../../../Source/portable/GCC/ColdFire_V2/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef COLDFIRE_V2_CODEWARRIOR
|
#ifdef COLDFIRE_V2_CODEWARRIOR
|
||||||
#include "../../Source/portable/CodeWarrior/ColdFire_V2/portmacro.h"
|
#include "../../Source/portable/CodeWarrior/ColdFire_V2/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GCC_PPC405
|
#ifdef GCC_PPC405
|
||||||
#include "../../Source/portable/GCC/PPC405_Xilinx/portmacro.h"
|
#include "../../Source/portable/GCC/PPC405_Xilinx/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GCC_PPC440
|
#ifdef GCC_PPC440
|
||||||
#include "../../Source/portable/GCC/PPC440_Xilinx/portmacro.h"
|
#include "../../Source/portable/GCC/PPC440_Xilinx/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _16FX_SOFTUNE
|
#ifdef _16FX_SOFTUNE
|
||||||
#include "..\..\Source\portable\Softune\MB96340\portmacro.h"
|
#include "..\..\Source\portable\Softune\MB96340\portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BCC_INDUSTRIAL_PC_PORT
|
#ifdef BCC_INDUSTRIAL_PC_PORT
|
||||||
|
|
||||||
/* A short file name has to be used in place of the normal
|
/* A short file name has to be used in place of the normal
|
||||||
* FreeRTOSConfig.h when using the Borland compiler. */
|
* FreeRTOSConfig.h when using the Borland compiler. */
|
||||||
#include "frconfig.h"
|
#include "frconfig.h"
|
||||||
#include "..\portable\BCC\16BitDOS\PC\prtmacro.h"
|
#include "..\portable\BCC\16BitDOS\PC\prtmacro.h"
|
||||||
typedef void ( __interrupt __far * pxISR )();
|
typedef void ( __interrupt __far * pxISR )();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BCC_FLASH_LITE_186_PORT
|
#ifdef BCC_FLASH_LITE_186_PORT
|
||||||
|
|
||||||
/* A short file name has to be used in place of the normal
|
/* A short file name has to be used in place of the normal
|
||||||
* FreeRTOSConfig.h when using the Borland compiler. */
|
* FreeRTOSConfig.h when using the Borland compiler. */
|
||||||
#include "frconfig.h"
|
#include "frconfig.h"
|
||||||
#include "..\portable\BCC\16BitDOS\flsh186\prtmacro.h"
|
#include "..\portable\BCC\16BitDOS\flsh186\prtmacro.h"
|
||||||
typedef void ( __interrupt __far * pxISR )();
|
typedef void ( __interrupt __far * pxISR )();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#ifdef __AVR32_AVR32A__
|
#ifdef __AVR32_AVR32A__
|
||||||
#include "portmacro.h"
|
#include "portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __ICCAVR32__
|
#ifdef __ICCAVR32__
|
||||||
#ifdef __CORE__
|
#ifdef __CORE__
|
||||||
#if __CORE__ == __AVR32A__
|
#if __CORE__ == __AVR32A__
|
||||||
#include "portmacro.h"
|
#include "portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __91467D
|
#ifdef __91467D
|
||||||
#include "portmacro.h"
|
#include "portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __96340
|
#ifdef __96340
|
||||||
#include "portmacro.h"
|
#include "portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef __IAR_V850ES_Fx3__
|
#ifdef __IAR_V850ES_Fx3__
|
||||||
#include "../../Source/portable/IAR/V850ES/portmacro.h"
|
#include "../../Source/portable/IAR/V850ES/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __IAR_V850ES_Jx3__
|
#ifdef __IAR_V850ES_Jx3__
|
||||||
#include "../../Source/portable/IAR/V850ES/portmacro.h"
|
#include "../../Source/portable/IAR/V850ES/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __IAR_V850ES_Jx3_L__
|
#ifdef __IAR_V850ES_Jx3_L__
|
||||||
#include "../../Source/portable/IAR/V850ES/portmacro.h"
|
#include "../../Source/portable/IAR/V850ES/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __IAR_V850ES_Jx2__
|
#ifdef __IAR_V850ES_Jx2__
|
||||||
#include "../../Source/portable/IAR/V850ES/portmacro.h"
|
#include "../../Source/portable/IAR/V850ES/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __IAR_V850ES_Hx2__
|
#ifdef __IAR_V850ES_Hx2__
|
||||||
#include "../../Source/portable/IAR/V850ES/portmacro.h"
|
#include "../../Source/portable/IAR/V850ES/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __IAR_78K0R_Kx3__
|
#ifdef __IAR_78K0R_Kx3__
|
||||||
#include "../../Source/portable/IAR/78K0R/portmacro.h"
|
#include "../../Source/portable/IAR/78K0R/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __IAR_78K0R_Kx3L__
|
#ifdef __IAR_78K0R_Kx3L__
|
||||||
#include "../../Source/portable/IAR/78K0R/portmacro.h"
|
#include "../../Source/portable/IAR/78K0R/portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* DEPRECATED_DEFINITIONS_H */
|
#endif /* DEPRECATED_DEFINITIONS_H */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
|
834
include/list.h
834
include/list.h
|
@ -1,417 +1,417 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
* the Software without restriction, including without limitation the rights to
|
* the Software without restriction, including without limitation the rights to
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
* subject to the following conditions:
|
* subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
* copies or substantial portions of the Software.
|
* copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* https://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* https://github.com/FreeRTOS
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the list implementation used by the scheduler. While it is tailored
|
* This is the list implementation used by the scheduler. While it is tailored
|
||||||
* heavily for the schedulers needs, it is also available for use by
|
* heavily for the schedulers needs, it is also available for use by
|
||||||
* application code.
|
* application code.
|
||||||
*
|
*
|
||||||
* list_ts can only store pointers to list_item_ts. Each ListItem_t contains a
|
* list_ts can only store pointers to list_item_ts. Each ListItem_t contains a
|
||||||
* numeric value (xItemValue). Most of the time the lists are sorted in
|
* numeric value (xItemValue). Most of the time the lists are sorted in
|
||||||
* descending item value order.
|
* descending item value order.
|
||||||
*
|
*
|
||||||
* Lists are created already containing one list item. The value of this
|
* Lists are created already containing one list item. The value of this
|
||||||
* item is the maximum possible that can be stored, it is therefore always at
|
* item is the maximum possible that can be stored, it is therefore always at
|
||||||
* the end of the list and acts as a marker. The list member pxHead always
|
* the end of the list and acts as a marker. The list member pxHead always
|
||||||
* points to this marker - even though it is at the tail of the list. This
|
* points to this marker - even though it is at the tail of the list. This
|
||||||
* is because the tail contains a wrap back pointer to the true head of
|
* is because the tail contains a wrap back pointer to the true head of
|
||||||
* the list.
|
* the list.
|
||||||
*
|
*
|
||||||
* In addition to it's value, each list item contains a pointer to the next
|
* In addition to it's value, each list item contains a pointer to the next
|
||||||
* item in the list (pxNext), a pointer to the list it is in (pxContainer)
|
* item in the list (pxNext), a pointer to the list it is in (pxContainer)
|
||||||
* and a pointer to back to the object that contains it. These later two
|
* and a pointer to back to the object that contains it. These later two
|
||||||
* pointers are included for efficiency of list manipulation. There is
|
* pointers are included for efficiency of list manipulation. There is
|
||||||
* effectively a two way link between the object containing the list item and
|
* effectively a two way link between the object containing the list item and
|
||||||
* the list item itself.
|
* the list item itself.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* \page ListIntroduction List Implementation
|
* \page ListIntroduction List Implementation
|
||||||
* \ingroup FreeRTOSIntro
|
* \ingroup FreeRTOSIntro
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef LIST_H
|
#ifndef LIST_H
|
||||||
#define LIST_H
|
#define LIST_H
|
||||||
|
|
||||||
#ifndef INC_FREERTOS_H
|
#ifndef INC_FREERTOS_H
|
||||||
#error "FreeRTOS.h must be included before list.h"
|
#error "FreeRTOS.h must be included before list.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The list structure members are modified from within interrupts, and therefore
|
* The list structure members are modified from within interrupts, and therefore
|
||||||
* by rights should be declared volatile. However, they are only modified in a
|
* by rights should be declared volatile. However, they are only modified in a
|
||||||
* functionally atomic way (within critical sections of with the scheduler
|
* functionally atomic way (within critical sections of with the scheduler
|
||||||
* suspended) and are either passed by reference into a function or indexed via
|
* suspended) and are either passed by reference into a function or indexed via
|
||||||
* a volatile variable. Therefore, in all use cases tested so far, the volatile
|
* a volatile variable. Therefore, in all use cases tested so far, the volatile
|
||||||
* qualifier can be omitted in order to provide a moderate performance
|
* qualifier can be omitted in order to provide a moderate performance
|
||||||
* improvement without adversely affecting functional behaviour. The assembly
|
* improvement without adversely affecting functional behaviour. The assembly
|
||||||
* instructions generated by the IAR, ARM and GCC compilers when the respective
|
* instructions generated by the IAR, ARM and GCC compilers when the respective
|
||||||
* compiler's options were set for maximum optimisation has been inspected and
|
* compiler's options were set for maximum optimisation has been inspected and
|
||||||
* deemed to be as intended. That said, as compiler technology advances, and
|
* deemed to be as intended. That said, as compiler technology advances, and
|
||||||
* especially if aggressive cross module optimisation is used (a use case that
|
* especially if aggressive cross module optimisation is used (a use case that
|
||||||
* has not been exercised to any great extend) then it is feasible that the
|
* has not been exercised to any great extend) then it is feasible that the
|
||||||
* volatile qualifier will be needed for correct optimisation. It is expected
|
* volatile qualifier will be needed for correct optimisation. It is expected
|
||||||
* that a compiler removing essential code because, without the volatile
|
* that a compiler removing essential code because, without the volatile
|
||||||
* qualifier on the list structure members and with aggressive cross module
|
* qualifier on the list structure members and with aggressive cross module
|
||||||
* optimisation, the compiler deemed the code unnecessary will result in
|
* optimisation, the compiler deemed the code unnecessary will result in
|
||||||
* complete and obvious failure of the scheduler. If this is ever experienced
|
* complete and obvious failure of the scheduler. If this is ever experienced
|
||||||
* then the volatile qualifier can be inserted in the relevant places within the
|
* then the volatile qualifier can be inserted in the relevant places within the
|
||||||
* list structures by simply defining configLIST_VOLATILE to volatile in
|
* list structures by simply defining configLIST_VOLATILE to volatile in
|
||||||
* FreeRTOSConfig.h (as per the example at the bottom of this comment block).
|
* FreeRTOSConfig.h (as per the example at the bottom of this comment block).
|
||||||
* If configLIST_VOLATILE is not defined then the preprocessor directives below
|
* If configLIST_VOLATILE is not defined then the preprocessor directives below
|
||||||
* will simply #define configLIST_VOLATILE away completely.
|
* will simply #define configLIST_VOLATILE away completely.
|
||||||
*
|
*
|
||||||
* To use volatile list structure members then add the following line to
|
* To use volatile list structure members then add the following line to
|
||||||
* FreeRTOSConfig.h (without the quotes):
|
* FreeRTOSConfig.h (without the quotes):
|
||||||
* "#define configLIST_VOLATILE volatile"
|
* "#define configLIST_VOLATILE volatile"
|
||||||
*/
|
*/
|
||||||
#ifndef configLIST_VOLATILE
|
#ifndef configLIST_VOLATILE
|
||||||
#define configLIST_VOLATILE
|
#define configLIST_VOLATILE
|
||||||
#endif /* configSUPPORT_CROSS_MODULE_OPTIMISATION */
|
#endif /* configSUPPORT_CROSS_MODULE_OPTIMISATION */
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/* Macros that can be used to place known values within the list structures,
|
/* Macros that can be used to place known values within the list structures,
|
||||||
* then check that the known values do not get corrupted during the execution of
|
* then check that the known values do not get corrupted during the execution of
|
||||||
* the application. These may catch the list data structures being overwritten in
|
* the application. These may catch the list data structures being overwritten in
|
||||||
* memory. They will not catch data errors caused by incorrect configuration or
|
* memory. They will not catch data errors caused by incorrect configuration or
|
||||||
* use of FreeRTOS.*/
|
* use of FreeRTOS.*/
|
||||||
#if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 )
|
#if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 )
|
||||||
/* Define the macros to do nothing. */
|
/* Define the macros to do nothing. */
|
||||||
#define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE
|
#define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE
|
||||||
#define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE
|
#define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE
|
||||||
#define listFIRST_LIST_INTEGRITY_CHECK_VALUE
|
#define listFIRST_LIST_INTEGRITY_CHECK_VALUE
|
||||||
#define listSECOND_LIST_INTEGRITY_CHECK_VALUE
|
#define listSECOND_LIST_INTEGRITY_CHECK_VALUE
|
||||||
#define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem )
|
#define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem )
|
||||||
#define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem )
|
#define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem )
|
||||||
#define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList )
|
#define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList )
|
||||||
#define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList )
|
#define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList )
|
||||||
#define listTEST_LIST_ITEM_INTEGRITY( pxItem )
|
#define listTEST_LIST_ITEM_INTEGRITY( pxItem )
|
||||||
#define listTEST_LIST_INTEGRITY( pxList )
|
#define listTEST_LIST_INTEGRITY( pxList )
|
||||||
#else /* if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 ) */
|
#else /* if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 ) */
|
||||||
/* Define macros that add new members into the list structures. */
|
/* Define macros that add new members into the list structures. */
|
||||||
#define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue1;
|
#define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue1;
|
||||||
#define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue2;
|
#define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue2;
|
||||||
#define listFIRST_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue1;
|
#define listFIRST_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue1;
|
||||||
#define listSECOND_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue2;
|
#define listSECOND_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue2;
|
||||||
|
|
||||||
/* Define macros that set the new structure members to known values. */
|
/* Define macros that set the new structure members to known values. */
|
||||||
#define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
|
#define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
|
||||||
#define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue2 = pdINTEGRITY_CHECK_VALUE
|
#define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue2 = pdINTEGRITY_CHECK_VALUE
|
||||||
#define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ) ( pxList )->xListIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
|
#define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ) ( pxList )->xListIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
|
||||||
#define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ) ( pxList )->xListIntegrityValue2 = pdINTEGRITY_CHECK_VALUE
|
#define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ) ( pxList )->xListIntegrityValue2 = pdINTEGRITY_CHECK_VALUE
|
||||||
|
|
||||||
/* Define macros that will assert if one of the structure members does not
|
/* Define macros that will assert if one of the structure members does not
|
||||||
* contain its expected value. */
|
* contain its expected value. */
|
||||||
#define listTEST_LIST_ITEM_INTEGRITY( pxItem ) configASSERT( ( ( pxItem )->xListItemIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxItem )->xListItemIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
|
#define listTEST_LIST_ITEM_INTEGRITY( pxItem ) configASSERT( ( ( pxItem )->xListItemIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxItem )->xListItemIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
|
||||||
#define listTEST_LIST_INTEGRITY( pxList ) configASSERT( ( ( pxList )->xListIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxList )->xListIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
|
#define listTEST_LIST_INTEGRITY( pxList ) configASSERT( ( ( pxList )->xListIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxList )->xListIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
|
||||||
#endif /* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES */
|
#endif /* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Definition of the only type of object that a list can contain.
|
* Definition of the only type of object that a list can contain.
|
||||||
*/
|
*/
|
||||||
struct xLIST;
|
struct xLIST;
|
||||||
struct xLIST_ITEM
|
struct xLIST_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_VOLATILE TickType_t xItemValue; /*< The value being listed. In most cases this is used to sort the list in descending order. */
|
configLIST_VOLATILE TickType_t xItemValue; /*< The value being listed. In most cases this is used to sort the list in descending order. */
|
||||||
struct xLIST_ITEM * configLIST_VOLATILE pxNext; /*< Pointer to the next ListItem_t in the list. */
|
struct xLIST_ITEM * configLIST_VOLATILE pxNext; /*< Pointer to the next ListItem_t in the list. */
|
||||||
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; /*< Pointer to the previous ListItem_t in the list. */
|
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; /*< 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. */
|
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. */
|
||||||
struct xLIST * configLIST_VOLATILE pxContainer; /*< Pointer to the list in which this list item is placed (if any). */
|
struct xLIST * configLIST_VOLATILE pxContainer; /*< 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. */
|
listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||||
};
|
};
|
||||||
typedef struct xLIST_ITEM ListItem_t; /* For some reason lint wants this as two separate definitions. */
|
typedef struct xLIST_ITEM ListItem_t; /* For some reason lint wants this as two separate definitions. */
|
||||||
|
|
||||||
struct xMINI_LIST_ITEM
|
struct xMINI_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_VOLATILE TickType_t xItemValue;
|
configLIST_VOLATILE TickType_t xItemValue;
|
||||||
struct xLIST_ITEM * configLIST_VOLATILE pxNext;
|
struct xLIST_ITEM * configLIST_VOLATILE pxNext;
|
||||||
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious;
|
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious;
|
||||||
};
|
};
|
||||||
typedef struct xMINI_LIST_ITEM MiniListItem_t;
|
typedef struct xMINI_LIST_ITEM MiniListItem_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Definition of the type of queue used by the scheduler.
|
* Definition of the type of queue used by the scheduler.
|
||||||
*/
|
*/
|
||||||
typedef struct xLIST
|
typedef struct xLIST
|
||||||
{
|
{
|
||||||
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. */
|
||||||
volatile UBaseType_t uxNumberOfItems;
|
volatile UBaseType_t uxNumberOfItems;
|
||||||
ListItem_t * configLIST_VOLATILE pxIndex; /*< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
|
ListItem_t * configLIST_VOLATILE pxIndex; /*< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
|
||||||
MiniListItem_t xListEnd; /*< 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. */
|
MiniListItem_t xListEnd; /*< 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. */
|
listSECOND_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||||
} List_t;
|
} List_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access macro to set the owner of a list item. The owner of a list item
|
* Access macro to set the owner of a list item. The owner of a list item
|
||||||
* is the object (usually a TCB) that contains the list item.
|
* is the object (usually a TCB) that contains the list item.
|
||||||
*
|
*
|
||||||
* \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
|
* \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner ) ( ( pxListItem )->pvOwner = ( void * ) ( pxOwner ) )
|
#define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner ) ( ( pxListItem )->pvOwner = ( void * ) ( pxOwner ) )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access macro to get the owner of a list item. The owner of a list item
|
* Access macro to get the owner of a list item. The owner of a list item
|
||||||
* is the object (usually a TCB) that contains the list item.
|
* is the object (usually a TCB) that contains the list item.
|
||||||
*
|
*
|
||||||
* \page listGET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
|
* \page listGET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_LIST_ITEM_OWNER( pxListItem ) ( ( pxListItem )->pvOwner )
|
#define listGET_LIST_ITEM_OWNER( pxListItem ) ( ( pxListItem )->pvOwner )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access macro to set the value of the list item. In most cases the value is
|
* Access macro to set the value of the list item. In most cases the value is
|
||||||
* used to sort the list in descending order.
|
* used to sort the list in descending order.
|
||||||
*
|
*
|
||||||
* \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE
|
* \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listSET_LIST_ITEM_VALUE( pxListItem, xValue ) ( ( pxListItem )->xItemValue = ( xValue ) )
|
#define listSET_LIST_ITEM_VALUE( pxListItem, xValue ) ( ( pxListItem )->xItemValue = ( xValue ) )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access macro to retrieve the value of the list item. The value can
|
* Access macro to retrieve the value of the list item. The value can
|
||||||
* represent anything - for example the priority of a task, or the time at
|
* represent anything - for example the priority of a task, or the time at
|
||||||
* which a task should be unblocked.
|
* which a task should be unblocked.
|
||||||
*
|
*
|
||||||
* \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
|
* \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_LIST_ITEM_VALUE( pxListItem ) ( ( pxListItem )->xItemValue )
|
#define listGET_LIST_ITEM_VALUE( pxListItem ) ( ( pxListItem )->xItemValue )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access macro to retrieve the value of the list item at the head of a given
|
* Access macro to retrieve the value of the list item at the head of a given
|
||||||
* list.
|
* list.
|
||||||
*
|
*
|
||||||
* \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
|
* \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext->xItemValue )
|
#define listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext->xItemValue )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the list item at the head of the list.
|
* Return the list item at the head of the list.
|
||||||
*
|
*
|
||||||
* \page listGET_HEAD_ENTRY listGET_HEAD_ENTRY
|
* \page listGET_HEAD_ENTRY listGET_HEAD_ENTRY
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext )
|
#define listGET_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the next list item.
|
* Return the next list item.
|
||||||
*
|
*
|
||||||
* \page listGET_NEXT listGET_NEXT
|
* \page listGET_NEXT listGET_NEXT
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_NEXT( pxListItem ) ( ( pxListItem )->pxNext )
|
#define listGET_NEXT( pxListItem ) ( ( pxListItem )->pxNext )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the list item that marks the end of the list
|
* Return the list item that marks the end of the list
|
||||||
*
|
*
|
||||||
* \page listGET_END_MARKER listGET_END_MARKER
|
* \page listGET_END_MARKER listGET_END_MARKER
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_END_MARKER( pxList ) ( ( ListItem_t const * ) ( &( ( pxList )->xListEnd ) ) )
|
#define listGET_END_MARKER( pxList ) ( ( ListItem_t const * ) ( &( ( pxList )->xListEnd ) ) )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access macro to determine if a list contains any items. The macro will
|
* Access macro to determine if a list contains any items. The macro will
|
||||||
* only have the value true if the list is empty.
|
* only have the value true if the list is empty.
|
||||||
*
|
*
|
||||||
* \page listLIST_IS_EMPTY listLIST_IS_EMPTY
|
* \page listLIST_IS_EMPTY listLIST_IS_EMPTY
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listLIST_IS_EMPTY( pxList ) ( ( ( pxList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ? pdTRUE : pdFALSE )
|
#define listLIST_IS_EMPTY( pxList ) ( ( ( pxList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ? pdTRUE : pdFALSE )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access macro to return the number of items in the list.
|
* Access macro to return the number of items in the list.
|
||||||
*/
|
*/
|
||||||
#define listCURRENT_LIST_LENGTH( pxList ) ( ( pxList )->uxNumberOfItems )
|
#define listCURRENT_LIST_LENGTH( pxList ) ( ( pxList )->uxNumberOfItems )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access function to obtain the owner of the next entry in a list.
|
* Access function to obtain the owner of the next entry in a list.
|
||||||
*
|
*
|
||||||
* The list member pxIndex is used to walk through a list. Calling
|
* The list member pxIndex is used to walk through a list. Calling
|
||||||
* listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list
|
* listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list
|
||||||
* and returns that entry's pxOwner parameter. Using multiple calls to this
|
* and returns that entry's pxOwner parameter. Using multiple calls to this
|
||||||
* function it is therefore possible to move through every item contained in
|
* function it is therefore possible to move through every item contained in
|
||||||
* a list.
|
* a list.
|
||||||
*
|
*
|
||||||
* The pxOwner parameter of a list item is a pointer to the object that owns
|
* The pxOwner parameter of a list item is a pointer to the object that owns
|
||||||
* the list item. In the scheduler this is normally a task control block.
|
* the list item. In the scheduler this is normally a task control block.
|
||||||
* The pxOwner parameter effectively creates a two way link between the list
|
* The pxOwner parameter effectively creates a two way link between the list
|
||||||
* item and its owner.
|
* item and its owner.
|
||||||
*
|
*
|
||||||
* @param pxTCB pxTCB is set to the address of the owner of the next list item.
|
* @param pxTCB pxTCB is set to the address of the owner of the next list item.
|
||||||
* @param pxList The list from which the next item owner is to be returned.
|
* @param pxList The list from which the next item owner is to be returned.
|
||||||
*
|
*
|
||||||
* \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY
|
* \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
|
#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
|
||||||
{ \
|
{ \
|
||||||
List_t * const pxConstList = ( pxList ); \
|
List_t * const pxConstList = ( pxList ); \
|
||||||
/* Increment the index to the next item and return the item, ensuring */ \
|
/* Increment the index to the next item and return the item, ensuring */ \
|
||||||
/* we don't return the marker used at the end of the list. */ \
|
/* we don't return the marker used at the end of the list. */ \
|
||||||
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
|
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
|
||||||
if( ( void * ) ( pxConstList )->pxIndex == ( void * ) &( ( pxConstList )->xListEnd ) ) \
|
if( ( void * ) ( pxConstList )->pxIndex == ( void * ) &( ( pxConstList )->xListEnd ) ) \
|
||||||
{ \
|
{ \
|
||||||
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
|
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
|
||||||
} \
|
} \
|
||||||
( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \
|
( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access function to obtain the owner of the first entry in a list. Lists
|
* Access function to obtain the owner of the first entry in a list. Lists
|
||||||
* are normally sorted in ascending item value order.
|
* are normally sorted in ascending item value order.
|
||||||
*
|
*
|
||||||
* This function returns the pxOwner member of the first item in the list.
|
* This function returns the pxOwner member of the first item in the list.
|
||||||
* The pxOwner parameter of a list item is a pointer to the object that owns
|
* The pxOwner parameter of a list item is a pointer to the object that owns
|
||||||
* the list item. In the scheduler this is normally a task control block.
|
* the list item. In the scheduler this is normally a task control block.
|
||||||
* The pxOwner parameter effectively creates a two way link between the list
|
* The pxOwner parameter effectively creates a two way link between the list
|
||||||
* item and its owner.
|
* item and its owner.
|
||||||
*
|
*
|
||||||
* @param pxList The list from which the owner of the head item is to be
|
* @param pxList The list from which the owner of the head item is to be
|
||||||
* returned.
|
* returned.
|
||||||
*
|
*
|
||||||
* \page listGET_OWNER_OF_HEAD_ENTRY listGET_OWNER_OF_HEAD_ENTRY
|
* \page listGET_OWNER_OF_HEAD_ENTRY listGET_OWNER_OF_HEAD_ENTRY
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_OWNER_OF_HEAD_ENTRY( pxList ) ( ( &( ( pxList )->xListEnd ) )->pxNext->pvOwner )
|
#define listGET_OWNER_OF_HEAD_ENTRY( pxList ) ( ( &( ( pxList )->xListEnd ) )->pxNext->pvOwner )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check to see if a list item is within a list. The list item maintains a
|
* Check to see if a list item is within a list. The list item maintains a
|
||||||
* "container" pointer that points to the list it is in. All this macro does
|
* "container" pointer that points to the list it is in. All this macro does
|
||||||
* is check to see if the container and the list match.
|
* is check to see if the container and the list match.
|
||||||
*
|
*
|
||||||
* @param pxList The list we want to know if the list item is within.
|
* @param pxList The list we want to know if the list item is within.
|
||||||
* @param pxListItem The list item we want to know if is in the list.
|
* @param pxListItem The list item we want to know if is in the list.
|
||||||
* @return pdTRUE if the list item is in the list, otherwise pdFALSE.
|
* @return pdTRUE if the list item is in the list, otherwise pdFALSE.
|
||||||
*/
|
*/
|
||||||
#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( ( pxListItem )->pxContainer == ( pxList ) ) ? ( pdTRUE ) : ( pdFALSE ) )
|
#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( ( pxListItem )->pxContainer == ( pxList ) ) ? ( pdTRUE ) : ( pdFALSE ) )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the list a list item is contained within (referenced from).
|
* Return the list a list item is contained within (referenced from).
|
||||||
*
|
*
|
||||||
* @param pxListItem The list item being queried.
|
* @param pxListItem The list item being queried.
|
||||||
* @return A pointer to the List_t object that references the pxListItem
|
* @return A pointer to the List_t object that references the pxListItem
|
||||||
*/
|
*/
|
||||||
#define listLIST_ITEM_CONTAINER( pxListItem ) ( ( pxListItem )->pxContainer )
|
#define listLIST_ITEM_CONTAINER( pxListItem ) ( ( pxListItem )->pxContainer )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This provides a crude means of knowing if a list has been initialised, as
|
* This provides a crude means of knowing if a list has been initialised, as
|
||||||
* pxList->xListEnd.xItemValue is set to portMAX_DELAY by the vListInitialise()
|
* pxList->xListEnd.xItemValue is set to portMAX_DELAY by the vListInitialise()
|
||||||
* function.
|
* function.
|
||||||
*/
|
*/
|
||||||
#define listLIST_IS_INITIALISED( pxList ) ( ( pxList )->xListEnd.xItemValue == portMAX_DELAY )
|
#define listLIST_IS_INITIALISED( pxList ) ( ( pxList )->xListEnd.xItemValue == portMAX_DELAY )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Must be called before a list is used! This initialises all the members
|
* Must be called before a list is used! This initialises all the members
|
||||||
* of the list structure and inserts the xListEnd item into the list as a
|
* of the list structure and inserts the xListEnd item into the list as a
|
||||||
* marker to the back of the list.
|
* marker to the back of the list.
|
||||||
*
|
*
|
||||||
* @param pxList Pointer to the list being initialised.
|
* @param pxList Pointer to the list being initialised.
|
||||||
*
|
*
|
||||||
* \page vListInitialise vListInitialise
|
* \page vListInitialise vListInitialise
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
void vListInitialise( List_t * const pxList ) PRIVILEGED_FUNCTION;
|
void vListInitialise( List_t * const pxList ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Must be called before a list item is used. This sets the list container to
|
* Must be called before a list item is used. This sets the list container to
|
||||||
* null so the item does not think that it is already contained in a list.
|
* null so the item does not think that it is already contained in a list.
|
||||||
*
|
*
|
||||||
* @param pxItem Pointer to the list item being initialised.
|
* @param pxItem Pointer to the list item being initialised.
|
||||||
*
|
*
|
||||||
* \page vListInitialiseItem vListInitialiseItem
|
* \page vListInitialiseItem vListInitialiseItem
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
void vListInitialiseItem( ListItem_t * const pxItem ) PRIVILEGED_FUNCTION;
|
void vListInitialiseItem( ListItem_t * const pxItem ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Insert a list item into a list. The item will be inserted into the list in
|
* Insert a list item into a list. The item will be inserted into the list in
|
||||||
* a position determined by its item value (descending item value order).
|
* a position determined by its item value (descending item value order).
|
||||||
*
|
*
|
||||||
* @param pxList The list into which the item is to be inserted.
|
* @param pxList The list into which the item is to be inserted.
|
||||||
*
|
*
|
||||||
* @param pxNewListItem The item that is to be placed in the list.
|
* @param pxNewListItem The item that is to be placed in the list.
|
||||||
*
|
*
|
||||||
* \page vListInsert vListInsert
|
* \page vListInsert vListInsert
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
void vListInsert( List_t * const pxList,
|
void vListInsert( List_t * const pxList,
|
||||||
ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
|
ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Insert a list item into a list. The item will be inserted in a position
|
* Insert a list item into a list. The item will be inserted in a position
|
||||||
* such that it will be the last item within the list returned by multiple
|
* such that it will be the last item within the list returned by multiple
|
||||||
* calls to listGET_OWNER_OF_NEXT_ENTRY.
|
* calls to listGET_OWNER_OF_NEXT_ENTRY.
|
||||||
*
|
*
|
||||||
* The list member pxIndex is used to walk through a list. Calling
|
* The list member pxIndex is used to walk through a list. Calling
|
||||||
* listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list.
|
* listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list.
|
||||||
* Placing an item in a list using vListInsertEnd effectively places the item
|
* Placing an item in a list using vListInsertEnd effectively places the item
|
||||||
* in the list position pointed to by pxIndex. This means that every other
|
* in the list position pointed to by pxIndex. This means that every other
|
||||||
* item within the list will be returned by listGET_OWNER_OF_NEXT_ENTRY before
|
* item within the list will be returned by listGET_OWNER_OF_NEXT_ENTRY before
|
||||||
* the pxIndex parameter again points to the item being inserted.
|
* the pxIndex parameter again points to the item being inserted.
|
||||||
*
|
*
|
||||||
* @param pxList The list into which the item is to be inserted.
|
* @param pxList The list into which the item is to be inserted.
|
||||||
*
|
*
|
||||||
* @param pxNewListItem The list item to be inserted into the list.
|
* @param pxNewListItem The list item to be inserted into the list.
|
||||||
*
|
*
|
||||||
* \page vListInsertEnd vListInsertEnd
|
* \page vListInsertEnd vListInsertEnd
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
void vListInsertEnd( List_t * const pxList,
|
void vListInsertEnd( List_t * const pxList,
|
||||||
ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
|
ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Remove an item from a list. The list item has a pointer to the list that
|
* Remove an item from a list. The list item has a pointer to the list that
|
||||||
* it is in, so only the list item need be passed into the function.
|
* it is in, so only the list item need be passed into the function.
|
||||||
*
|
*
|
||||||
* @param uxListRemove The item to be removed. The item will remove itself from
|
* @param uxListRemove The item to be removed. The item will remove itself from
|
||||||
* the list pointed to by it's pxContainer parameter.
|
* the list pointed to by it's pxContainer parameter.
|
||||||
*
|
*
|
||||||
* @return The number of items that remain in the list after the list item has
|
* @return The number of items that remain in the list after the list item has
|
||||||
* been removed.
|
* been removed.
|
||||||
*
|
*
|
||||||
* \page uxListRemove uxListRemove
|
* \page uxListRemove uxListRemove
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* ifndef LIST_H */
|
#endif /* ifndef LIST_H */
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,263 +1,263 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
* the Software without restriction, including without limitation the rights to
|
* the Software without restriction, including without limitation the rights to
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
* subject to the following conditions:
|
* subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
* copies or substantial portions of the Software.
|
* copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* https://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* https://github.com/FreeRTOS
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When the MPU is used the standard (non MPU) API functions are mapped to
|
* When the MPU is used the standard (non MPU) API functions are mapped to
|
||||||
* equivalents that start "MPU_", the prototypes for which are defined in this
|
* equivalents that start "MPU_", the prototypes for which are defined in this
|
||||||
* header files. This will cause the application code to call the MPU_ version
|
* header files. This will cause the application code to call the MPU_ version
|
||||||
* which wraps the non-MPU version with privilege promoting then demoting code,
|
* which wraps the non-MPU version with privilege promoting then demoting code,
|
||||||
* so the kernel code always runs will full privileges.
|
* so the kernel code always runs will full privileges.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef MPU_PROTOTYPES_H
|
#ifndef MPU_PROTOTYPES_H
|
||||||
#define MPU_PROTOTYPES_H
|
#define MPU_PROTOTYPES_H
|
||||||
|
|
||||||
/* MPU versions of tasks.h API functions. */
|
/* MPU versions of tasks.h API functions. */
|
||||||
BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode,
|
BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode,
|
||||||
const char * const pcName,
|
const char * const pcName,
|
||||||
const uint16_t usStackDepth,
|
const uint16_t usStackDepth,
|
||||||
void * const pvParameters,
|
void * const pvParameters,
|
||||||
UBaseType_t uxPriority,
|
UBaseType_t uxPriority,
|
||||||
TaskHandle_t * const pxCreatedTask ) FREERTOS_SYSTEM_CALL;
|
TaskHandle_t * const pxCreatedTask ) FREERTOS_SYSTEM_CALL;
|
||||||
TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode,
|
TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode,
|
||||||
const char * const pcName,
|
const char * const pcName,
|
||||||
const uint32_t ulStackDepth,
|
const uint32_t ulStackDepth,
|
||||||
void * const pvParameters,
|
void * const pvParameters,
|
||||||
UBaseType_t uxPriority,
|
UBaseType_t uxPriority,
|
||||||
StackType_t * const puxStackBuffer,
|
StackType_t * const puxStackBuffer,
|
||||||
StaticTask_t * const pxTaskBuffer ) FREERTOS_SYSTEM_CALL;
|
StaticTask_t * const pxTaskBuffer ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition,
|
BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition,
|
||||||
TaskHandle_t * pxCreatedTask ) FREERTOS_SYSTEM_CALL;
|
TaskHandle_t * pxCreatedTask ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition,
|
BaseType_t MPU_xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition,
|
||||||
TaskHandle_t * pxCreatedTask ) FREERTOS_SYSTEM_CALL;
|
TaskHandle_t * pxCreatedTask ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskAllocateMPURegions( TaskHandle_t xTask,
|
void MPU_vTaskAllocateMPURegions( TaskHandle_t xTask,
|
||||||
const MemoryRegion_t * const pxRegions ) FREERTOS_SYSTEM_CALL;
|
const MemoryRegion_t * const pxRegions ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) FREERTOS_SYSTEM_CALL;
|
void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskDelay( const TickType_t xTicksToDelay ) FREERTOS_SYSTEM_CALL;
|
void MPU_vTaskDelay( const TickType_t xTicksToDelay ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
|
void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
|
||||||
const TickType_t xTimeIncrement ) FREERTOS_SYSTEM_CALL;
|
const TickType_t xTimeIncrement ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||||
UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||||
eTaskState MPU_eTaskGetState( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
eTaskState MPU_eTaskGetState( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskGetInfo( TaskHandle_t xTask,
|
void MPU_vTaskGetInfo( TaskHandle_t xTask,
|
||||||
TaskStatus_t * pxTaskStatus,
|
TaskStatus_t * pxTaskStatus,
|
||||||
BaseType_t xGetFreeStackSpace,
|
BaseType_t xGetFreeStackSpace,
|
||||||
eTaskState eState ) FREERTOS_SYSTEM_CALL;
|
eTaskState eState ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskPrioritySet( TaskHandle_t xTask,
|
void MPU_vTaskPrioritySet( TaskHandle_t xTask,
|
||||||
UBaseType_t uxNewPriority ) FREERTOS_SYSTEM_CALL;
|
UBaseType_t uxNewPriority ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend ) FREERTOS_SYSTEM_CALL;
|
void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskResume( TaskHandle_t xTaskToResume ) FREERTOS_SYSTEM_CALL;
|
void MPU_vTaskResume( TaskHandle_t xTaskToResume ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskStartScheduler( void ) FREERTOS_SYSTEM_CALL;
|
void MPU_vTaskStartScheduler( void ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskSuspendAll( void ) FREERTOS_SYSTEM_CALL;
|
void MPU_vTaskSuspendAll( void ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTaskResumeAll( void ) FREERTOS_SYSTEM_CALL;
|
BaseType_t MPU_xTaskResumeAll( void ) FREERTOS_SYSTEM_CALL;
|
||||||
TickType_t MPU_xTaskGetTickCount( void ) FREERTOS_SYSTEM_CALL;
|
TickType_t MPU_xTaskGetTickCount( void ) FREERTOS_SYSTEM_CALL;
|
||||||
UBaseType_t MPU_uxTaskGetNumberOfTasks( void ) FREERTOS_SYSTEM_CALL;
|
UBaseType_t MPU_uxTaskGetNumberOfTasks( void ) FREERTOS_SYSTEM_CALL;
|
||||||
char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery ) FREERTOS_SYSTEM_CALL;
|
char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery ) FREERTOS_SYSTEM_CALL;
|
||||||
TaskHandle_t MPU_xTaskGetHandle( const char * pcNameToQuery ) FREERTOS_SYSTEM_CALL;
|
TaskHandle_t MPU_xTaskGetHandle( const char * pcNameToQuery ) FREERTOS_SYSTEM_CALL;
|
||||||
UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||||
configSTACK_DEPTH_TYPE MPU_uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
configSTACK_DEPTH_TYPE MPU_uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask,
|
void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask,
|
||||||
TaskHookFunction_t pxHookFunction ) FREERTOS_SYSTEM_CALL;
|
TaskHookFunction_t pxHookFunction ) FREERTOS_SYSTEM_CALL;
|
||||||
TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet,
|
void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet,
|
||||||
BaseType_t xIndex,
|
BaseType_t xIndex,
|
||||||
void * pvValue ) FREERTOS_SYSTEM_CALL;
|
void * pvValue ) FREERTOS_SYSTEM_CALL;
|
||||||
void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery,
|
void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery,
|
||||||
BaseType_t xIndex ) FREERTOS_SYSTEM_CALL;
|
BaseType_t xIndex ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask,
|
BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask,
|
||||||
void * pvParameter ) FREERTOS_SYSTEM_CALL;
|
void * pvParameter ) FREERTOS_SYSTEM_CALL;
|
||||||
TaskHandle_t MPU_xTaskGetIdleTaskHandle( void ) FREERTOS_SYSTEM_CALL;
|
TaskHandle_t MPU_xTaskGetIdleTaskHandle( void ) FREERTOS_SYSTEM_CALL;
|
||||||
UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
|
UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
|
||||||
const UBaseType_t uxArraySize,
|
const UBaseType_t uxArraySize,
|
||||||
uint32_t * const pulTotalRunTime ) FREERTOS_SYSTEM_CALL;
|
uint32_t * const pulTotalRunTime ) FREERTOS_SYSTEM_CALL;
|
||||||
uint32_t MPU_ulTaskGetIdleRunTimeCounter( void ) FREERTOS_SYSTEM_CALL;
|
uint32_t MPU_ulTaskGetIdleRunTimeCounter( void ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskList( char * pcWriteBuffer ) FREERTOS_SYSTEM_CALL;
|
void MPU_vTaskList( char * pcWriteBuffer ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskGetRunTimeStats( char * pcWriteBuffer ) FREERTOS_SYSTEM_CALL;
|
void MPU_vTaskGetRunTimeStats( char * pcWriteBuffer ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify,
|
BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify,
|
||||||
UBaseType_t uxIndexToNotify,
|
UBaseType_t uxIndexToNotify,
|
||||||
uint32_t ulValue,
|
uint32_t ulValue,
|
||||||
eNotifyAction eAction,
|
eNotifyAction eAction,
|
||||||
uint32_t * pulPreviousNotificationValue ) FREERTOS_SYSTEM_CALL;
|
uint32_t * pulPreviousNotificationValue ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTaskGenericNotifyWait( UBaseType_t uxIndexToWaitOn,
|
BaseType_t MPU_xTaskGenericNotifyWait( UBaseType_t uxIndexToWaitOn,
|
||||||
uint32_t ulBitsToClearOnEntry,
|
uint32_t ulBitsToClearOnEntry,
|
||||||
uint32_t ulBitsToClearOnExit,
|
uint32_t ulBitsToClearOnExit,
|
||||||
uint32_t * pulNotificationValue,
|
uint32_t * pulNotificationValue,
|
||||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||||
uint32_t MPU_ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
|
uint32_t MPU_ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
|
||||||
BaseType_t xClearCountOnExit,
|
BaseType_t xClearCountOnExit,
|
||||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTaskGenericNotifyStateClear( TaskHandle_t xTask,
|
BaseType_t MPU_xTaskGenericNotifyStateClear( TaskHandle_t xTask,
|
||||||
UBaseType_t uxIndexToClear ) FREERTOS_SYSTEM_CALL;
|
UBaseType_t uxIndexToClear ) FREERTOS_SYSTEM_CALL;
|
||||||
uint32_t MPU_ulTaskGenericNotifyValueClear( TaskHandle_t xTask,
|
uint32_t MPU_ulTaskGenericNotifyValueClear( TaskHandle_t xTask,
|
||||||
UBaseType_t uxIndexToClear,
|
UBaseType_t uxIndexToClear,
|
||||||
uint32_t ulBitsToClear ) FREERTOS_SYSTEM_CALL;
|
uint32_t ulBitsToClear ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTaskIncrementTick( void ) FREERTOS_SYSTEM_CALL;
|
BaseType_t MPU_xTaskIncrementTick( void ) FREERTOS_SYSTEM_CALL;
|
||||||
TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) FREERTOS_SYSTEM_CALL;
|
TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) FREERTOS_SYSTEM_CALL;
|
void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
|
BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
|
||||||
TickType_t * const pxTicksToWait ) FREERTOS_SYSTEM_CALL;
|
TickType_t * const pxTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTaskMissedYield( void ) FREERTOS_SYSTEM_CALL;
|
void MPU_vTaskMissedYield( void ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTaskGetSchedulerState( void ) FREERTOS_SYSTEM_CALL;
|
BaseType_t MPU_xTaskGetSchedulerState( void ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) FREERTOS_SYSTEM_CALL;
|
BaseType_t MPU_xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) FREERTOS_SYSTEM_CALL;
|
||||||
|
|
||||||
/* MPU versions of queue.h API functions. */
|
/* MPU versions of queue.h API functions. */
|
||||||
BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue,
|
BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue,
|
||||||
const void * const pvItemToQueue,
|
const void * const pvItemToQueue,
|
||||||
TickType_t xTicksToWait,
|
TickType_t xTicksToWait,
|
||||||
const BaseType_t xCopyPosition ) FREERTOS_SYSTEM_CALL;
|
const BaseType_t xCopyPosition ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xQueueReceive( QueueHandle_t xQueue,
|
BaseType_t MPU_xQueueReceive( QueueHandle_t xQueue,
|
||||||
void * const pvBuffer,
|
void * const pvBuffer,
|
||||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xQueuePeek( QueueHandle_t xQueue,
|
BaseType_t MPU_xQueuePeek( QueueHandle_t xQueue,
|
||||||
void * const pvBuffer,
|
void * const pvBuffer,
|
||||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue,
|
BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue,
|
||||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||||
UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
||||||
UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vQueueDelete( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
void MPU_vQueueDelete( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
||||||
QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
|
QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
|
||||||
QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType,
|
QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType,
|
||||||
StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL;
|
StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL;
|
||||||
QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
|
QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
|
||||||
const UBaseType_t uxInitialCount ) FREERTOS_SYSTEM_CALL;
|
const UBaseType_t uxInitialCount ) FREERTOS_SYSTEM_CALL;
|
||||||
QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
|
QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
|
||||||
const UBaseType_t uxInitialCount,
|
const UBaseType_t uxInitialCount,
|
||||||
StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL;
|
StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL;
|
||||||
TaskHandle_t MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ) FREERTOS_SYSTEM_CALL;
|
TaskHandle_t MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex,
|
BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex,
|
||||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) FREERTOS_SYSTEM_CALL;
|
BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vQueueAddToRegistry( QueueHandle_t xQueue,
|
void MPU_vQueueAddToRegistry( QueueHandle_t xQueue,
|
||||||
const char * pcName ) FREERTOS_SYSTEM_CALL;
|
const char * pcName ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
||||||
const char * MPU_pcQueueGetName( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
const char * MPU_pcQueueGetName( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
||||||
QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength,
|
QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength,
|
||||||
const UBaseType_t uxItemSize,
|
const UBaseType_t uxItemSize,
|
||||||
const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
|
const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
|
||||||
QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength,
|
QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength,
|
||||||
const UBaseType_t uxItemSize,
|
const UBaseType_t uxItemSize,
|
||||||
uint8_t * pucQueueStorage,
|
uint8_t * pucQueueStorage,
|
||||||
StaticQueue_t * pxStaticQueue,
|
StaticQueue_t * pxStaticQueue,
|
||||||
const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
|
const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
|
||||||
QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength ) FREERTOS_SYSTEM_CALL;
|
QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
||||||
QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL;
|
QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
||||||
QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL;
|
QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL;
|
||||||
QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
|
QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
|
||||||
const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue,
|
BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue,
|
||||||
BaseType_t xNewQueue ) FREERTOS_SYSTEM_CALL;
|
BaseType_t xNewQueue ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vQueueSetQueueNumber( QueueHandle_t xQueue,
|
void MPU_vQueueSetQueueNumber( QueueHandle_t xQueue,
|
||||||
UBaseType_t uxQueueNumber ) FREERTOS_SYSTEM_CALL;
|
UBaseType_t uxQueueNumber ) FREERTOS_SYSTEM_CALL;
|
||||||
UBaseType_t MPU_uxQueueGetQueueNumber( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
UBaseType_t MPU_uxQueueGetQueueNumber( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
||||||
uint8_t MPU_ucQueueGetQueueType( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
uint8_t MPU_ucQueueGetQueueType( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
||||||
|
|
||||||
/* MPU versions of timers.h API functions. */
|
/* MPU versions of timers.h API functions. */
|
||||||
TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName,
|
TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName,
|
||||||
const TickType_t xTimerPeriodInTicks,
|
const TickType_t xTimerPeriodInTicks,
|
||||||
const UBaseType_t uxAutoReload,
|
const UBaseType_t uxAutoReload,
|
||||||
void * const pvTimerID,
|
void * const pvTimerID,
|
||||||
TimerCallbackFunction_t pxCallbackFunction ) FREERTOS_SYSTEM_CALL;
|
TimerCallbackFunction_t pxCallbackFunction ) FREERTOS_SYSTEM_CALL;
|
||||||
TimerHandle_t MPU_xTimerCreateStatic( const char * const pcTimerName,
|
TimerHandle_t MPU_xTimerCreateStatic( const char * const pcTimerName,
|
||||||
const TickType_t xTimerPeriodInTicks,
|
const TickType_t xTimerPeriodInTicks,
|
||||||
const UBaseType_t uxAutoReload,
|
const UBaseType_t uxAutoReload,
|
||||||
void * const pvTimerID,
|
void * const pvTimerID,
|
||||||
TimerCallbackFunction_t pxCallbackFunction,
|
TimerCallbackFunction_t pxCallbackFunction,
|
||||||
StaticTimer_t * pxTimerBuffer ) FREERTOS_SYSTEM_CALL;
|
StaticTimer_t * pxTimerBuffer ) FREERTOS_SYSTEM_CALL;
|
||||||
void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTimerSetTimerID( TimerHandle_t xTimer,
|
void MPU_vTimerSetTimerID( TimerHandle_t xTimer,
|
||||||
void * pvNewID ) FREERTOS_SYSTEM_CALL;
|
void * pvNewID ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||||
TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) FREERTOS_SYSTEM_CALL;
|
TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
|
BaseType_t MPU_xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
|
||||||
void * pvParameter1,
|
void * pvParameter1,
|
||||||
uint32_t ulParameter2,
|
uint32_t ulParameter2,
|
||||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||||
const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vTimerSetReloadMode( TimerHandle_t xTimer,
|
void MPU_vTimerSetReloadMode( TimerHandle_t xTimer,
|
||||||
const UBaseType_t uxAutoReload ) FREERTOS_SYSTEM_CALL;
|
const UBaseType_t uxAutoReload ) FREERTOS_SYSTEM_CALL;
|
||||||
UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||||
TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||||
TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTimerCreateTimerTask( void ) FREERTOS_SYSTEM_CALL;
|
BaseType_t MPU_xTimerCreateTimerTask( void ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
|
BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
|
||||||
const BaseType_t xCommandID,
|
const BaseType_t xCommandID,
|
||||||
const TickType_t xOptionalValue,
|
const TickType_t xOptionalValue,
|
||||||
BaseType_t * const pxHigherPriorityTaskWoken,
|
BaseType_t * const pxHigherPriorityTaskWoken,
|
||||||
const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||||
|
|
||||||
/* MPU versions of event_group.h API functions. */
|
/* MPU versions of event_group.h API functions. */
|
||||||
EventGroupHandle_t MPU_xEventGroupCreate( void ) FREERTOS_SYSTEM_CALL;
|
EventGroupHandle_t MPU_xEventGroupCreate( void ) FREERTOS_SYSTEM_CALL;
|
||||||
EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) FREERTOS_SYSTEM_CALL;
|
EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) FREERTOS_SYSTEM_CALL;
|
||||||
EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
|
EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
|
||||||
const EventBits_t uxBitsToWaitFor,
|
const EventBits_t uxBitsToWaitFor,
|
||||||
const BaseType_t xClearOnExit,
|
const BaseType_t xClearOnExit,
|
||||||
const BaseType_t xWaitForAllBits,
|
const BaseType_t xWaitForAllBits,
|
||||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||||
EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
||||||
const EventBits_t uxBitsToClear ) FREERTOS_SYSTEM_CALL;
|
const EventBits_t uxBitsToClear ) FREERTOS_SYSTEM_CALL;
|
||||||
EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
||||||
const EventBits_t uxBitsToSet ) FREERTOS_SYSTEM_CALL;
|
const EventBits_t uxBitsToSet ) FREERTOS_SYSTEM_CALL;
|
||||||
EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup,
|
EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup,
|
||||||
const EventBits_t uxBitsToSet,
|
const EventBits_t uxBitsToSet,
|
||||||
const EventBits_t uxBitsToWaitFor,
|
const EventBits_t uxBitsToWaitFor,
|
||||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ) FREERTOS_SYSTEM_CALL;
|
void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ) FREERTOS_SYSTEM_CALL;
|
||||||
UBaseType_t MPU_uxEventGroupGetNumber( void * xEventGroup ) FREERTOS_SYSTEM_CALL;
|
UBaseType_t MPU_uxEventGroupGetNumber( void * xEventGroup ) FREERTOS_SYSTEM_CALL;
|
||||||
|
|
||||||
/* MPU versions of message/stream_buffer.h API functions. */
|
/* MPU versions of message/stream_buffer.h API functions. */
|
||||||
size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
|
size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
|
||||||
const void * pvTxData,
|
const void * pvTxData,
|
||||||
size_t xDataLengthBytes,
|
size_t xDataLengthBytes,
|
||||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||||
size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
|
size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
|
||||||
void * pvRxData,
|
void * pvRxData,
|
||||||
size_t xBufferLengthBytes,
|
size_t xBufferLengthBytes,
|
||||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||||
size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||||
void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||||
size_t MPU_xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
size_t MPU_xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||||
size_t MPU_xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
size_t MPU_xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||||
BaseType_t MPU_xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
|
BaseType_t MPU_xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
|
||||||
size_t xTriggerLevel ) FREERTOS_SYSTEM_CALL;
|
size_t xTriggerLevel ) FREERTOS_SYSTEM_CALL;
|
||||||
StreamBufferHandle_t MPU_xStreamBufferGenericCreate( size_t xBufferSizeBytes,
|
StreamBufferHandle_t MPU_xStreamBufferGenericCreate( size_t xBufferSizeBytes,
|
||||||
size_t xTriggerLevelBytes,
|
size_t xTriggerLevelBytes,
|
||||||
BaseType_t xIsMessageBuffer ) FREERTOS_SYSTEM_CALL;
|
BaseType_t xIsMessageBuffer ) FREERTOS_SYSTEM_CALL;
|
||||||
StreamBufferHandle_t MPU_xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
|
StreamBufferHandle_t MPU_xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
|
||||||
size_t xTriggerLevelBytes,
|
size_t xTriggerLevelBytes,
|
||||||
BaseType_t xIsMessageBuffer,
|
BaseType_t xIsMessageBuffer,
|
||||||
uint8_t * const pucStreamBufferStorageArea,
|
uint8_t * const pucStreamBufferStorageArea,
|
||||||
StaticStreamBuffer_t * const pxStaticStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
StaticStreamBuffer_t * const pxStaticStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* MPU_PROTOTYPES_H */
|
#endif /* MPU_PROTOTYPES_H */
|
||||||
|
|
|
@ -1,187 +1,187 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
* the Software without restriction, including without limitation the rights to
|
* the Software without restriction, including without limitation the rights to
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
* subject to the following conditions:
|
* subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
* copies or substantial portions of the Software.
|
* copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* https://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* https://github.com/FreeRTOS
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MPU_WRAPPERS_H
|
#ifndef MPU_WRAPPERS_H
|
||||||
#define MPU_WRAPPERS_H
|
#define MPU_WRAPPERS_H
|
||||||
|
|
||||||
/* This file redefines API functions to be called through a wrapper macro, but
|
/* This file redefines API functions to be called through a wrapper macro, but
|
||||||
* only for ports that are using the MPU. */
|
* only for ports that are using the MPU. */
|
||||||
#ifdef portUSING_MPU_WRAPPERS
|
#ifdef portUSING_MPU_WRAPPERS
|
||||||
|
|
||||||
/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE will be defined when this file is
|
/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE will be defined when this file is
|
||||||
* included from queue.c or task.c to prevent it from having an effect within
|
* included from queue.c or task.c to prevent it from having an effect within
|
||||||
* those files. */
|
* those files. */
|
||||||
#ifndef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
#ifndef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Map standard (non MPU) API functions to equivalents that start
|
* Map standard (non MPU) API functions to equivalents that start
|
||||||
* "MPU_". This will cause the application code to call the MPU_
|
* "MPU_". This will cause the application code to call the MPU_
|
||||||
* version, which wraps the non-MPU version with privilege promoting
|
* version, which wraps the non-MPU version with privilege promoting
|
||||||
* then demoting code, so the kernel code always runs will full
|
* then demoting code, so the kernel code always runs will full
|
||||||
* privileges.
|
* privileges.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Map standard tasks.h API functions to the MPU equivalents. */
|
/* Map standard tasks.h API functions to the MPU equivalents. */
|
||||||
#define xTaskCreate MPU_xTaskCreate
|
#define xTaskCreate MPU_xTaskCreate
|
||||||
#define xTaskCreateStatic MPU_xTaskCreateStatic
|
#define xTaskCreateStatic MPU_xTaskCreateStatic
|
||||||
#define xTaskCreateRestricted MPU_xTaskCreateRestricted
|
#define xTaskCreateRestricted MPU_xTaskCreateRestricted
|
||||||
#define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions
|
#define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions
|
||||||
#define vTaskDelete MPU_vTaskDelete
|
#define vTaskDelete MPU_vTaskDelete
|
||||||
#define vTaskDelay MPU_vTaskDelay
|
#define vTaskDelay MPU_vTaskDelay
|
||||||
#define vTaskDelayUntil MPU_vTaskDelayUntil
|
#define vTaskDelayUntil MPU_vTaskDelayUntil
|
||||||
#define xTaskAbortDelay MPU_xTaskAbortDelay
|
#define xTaskAbortDelay MPU_xTaskAbortDelay
|
||||||
#define uxTaskPriorityGet MPU_uxTaskPriorityGet
|
#define uxTaskPriorityGet MPU_uxTaskPriorityGet
|
||||||
#define eTaskGetState MPU_eTaskGetState
|
#define eTaskGetState MPU_eTaskGetState
|
||||||
#define vTaskGetInfo MPU_vTaskGetInfo
|
#define vTaskGetInfo MPU_vTaskGetInfo
|
||||||
#define vTaskPrioritySet MPU_vTaskPrioritySet
|
#define vTaskPrioritySet MPU_vTaskPrioritySet
|
||||||
#define vTaskSuspend MPU_vTaskSuspend
|
#define vTaskSuspend MPU_vTaskSuspend
|
||||||
#define vTaskResume MPU_vTaskResume
|
#define vTaskResume MPU_vTaskResume
|
||||||
#define vTaskSuspendAll MPU_vTaskSuspendAll
|
#define vTaskSuspendAll MPU_vTaskSuspendAll
|
||||||
#define xTaskResumeAll MPU_xTaskResumeAll
|
#define xTaskResumeAll MPU_xTaskResumeAll
|
||||||
#define xTaskGetTickCount MPU_xTaskGetTickCount
|
#define xTaskGetTickCount MPU_xTaskGetTickCount
|
||||||
#define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks
|
#define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks
|
||||||
#define pcTaskGetName MPU_pcTaskGetName
|
#define pcTaskGetName MPU_pcTaskGetName
|
||||||
#define xTaskGetHandle MPU_xTaskGetHandle
|
#define xTaskGetHandle MPU_xTaskGetHandle
|
||||||
#define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark
|
#define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark
|
||||||
#define uxTaskGetStackHighWaterMark2 MPU_uxTaskGetStackHighWaterMark2
|
#define uxTaskGetStackHighWaterMark2 MPU_uxTaskGetStackHighWaterMark2
|
||||||
#define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag
|
#define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag
|
||||||
#define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag
|
#define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag
|
||||||
#define vTaskSetThreadLocalStoragePointer MPU_vTaskSetThreadLocalStoragePointer
|
#define vTaskSetThreadLocalStoragePointer MPU_vTaskSetThreadLocalStoragePointer
|
||||||
#define pvTaskGetThreadLocalStoragePointer MPU_pvTaskGetThreadLocalStoragePointer
|
#define pvTaskGetThreadLocalStoragePointer MPU_pvTaskGetThreadLocalStoragePointer
|
||||||
#define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook
|
#define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook
|
||||||
#define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle
|
#define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle
|
||||||
#define uxTaskGetSystemState MPU_uxTaskGetSystemState
|
#define uxTaskGetSystemState MPU_uxTaskGetSystemState
|
||||||
#define vTaskList MPU_vTaskList
|
#define vTaskList MPU_vTaskList
|
||||||
#define vTaskGetRunTimeStats MPU_vTaskGetRunTimeStats
|
#define vTaskGetRunTimeStats MPU_vTaskGetRunTimeStats
|
||||||
#define ulTaskGetIdleRunTimeCounter MPU_ulTaskGetIdleRunTimeCounter
|
#define ulTaskGetIdleRunTimeCounter MPU_ulTaskGetIdleRunTimeCounter
|
||||||
#define xTaskGenericNotify MPU_xTaskGenericNotify
|
#define xTaskGenericNotify MPU_xTaskGenericNotify
|
||||||
#define xTaskGenericNotifyWait MPU_xTaskGenericNotifyWait
|
#define xTaskGenericNotifyWait MPU_xTaskGenericNotifyWait
|
||||||
#define ulTaskGenericNotifyTake MPU_ulTaskGenericNotifyTake
|
#define ulTaskGenericNotifyTake MPU_ulTaskGenericNotifyTake
|
||||||
#define xTaskGenericNotifyStateClear MPU_xTaskGenericNotifyStateClear
|
#define xTaskGenericNotifyStateClear MPU_xTaskGenericNotifyStateClear
|
||||||
#define ulTaskGenericNotifyValueClear MPU_ulTaskGenericNotifyValueClear
|
#define ulTaskGenericNotifyValueClear MPU_ulTaskGenericNotifyValueClear
|
||||||
#define xTaskCatchUpTicks MPU_xTaskCatchUpTicks
|
#define xTaskCatchUpTicks MPU_xTaskCatchUpTicks
|
||||||
|
|
||||||
#define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle
|
#define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle
|
||||||
#define vTaskSetTimeOutState MPU_vTaskSetTimeOutState
|
#define vTaskSetTimeOutState MPU_vTaskSetTimeOutState
|
||||||
#define xTaskCheckForTimeOut MPU_xTaskCheckForTimeOut
|
#define xTaskCheckForTimeOut MPU_xTaskCheckForTimeOut
|
||||||
#define xTaskGetSchedulerState MPU_xTaskGetSchedulerState
|
#define xTaskGetSchedulerState MPU_xTaskGetSchedulerState
|
||||||
|
|
||||||
/* Map standard queue.h API functions to the MPU equivalents. */
|
/* Map standard queue.h API functions to the MPU equivalents. */
|
||||||
#define xQueueGenericSend MPU_xQueueGenericSend
|
#define xQueueGenericSend MPU_xQueueGenericSend
|
||||||
#define xQueueReceive MPU_xQueueReceive
|
#define xQueueReceive MPU_xQueueReceive
|
||||||
#define xQueuePeek MPU_xQueuePeek
|
#define xQueuePeek MPU_xQueuePeek
|
||||||
#define xQueueSemaphoreTake MPU_xQueueSemaphoreTake
|
#define xQueueSemaphoreTake MPU_xQueueSemaphoreTake
|
||||||
#define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting
|
#define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting
|
||||||
#define uxQueueSpacesAvailable MPU_uxQueueSpacesAvailable
|
#define uxQueueSpacesAvailable MPU_uxQueueSpacesAvailable
|
||||||
#define vQueueDelete MPU_vQueueDelete
|
#define vQueueDelete MPU_vQueueDelete
|
||||||
#define xQueueCreateMutex MPU_xQueueCreateMutex
|
#define xQueueCreateMutex MPU_xQueueCreateMutex
|
||||||
#define xQueueCreateMutexStatic MPU_xQueueCreateMutexStatic
|
#define xQueueCreateMutexStatic MPU_xQueueCreateMutexStatic
|
||||||
#define xQueueCreateCountingSemaphore MPU_xQueueCreateCountingSemaphore
|
#define xQueueCreateCountingSemaphore MPU_xQueueCreateCountingSemaphore
|
||||||
#define xQueueCreateCountingSemaphoreStatic MPU_xQueueCreateCountingSemaphoreStatic
|
#define xQueueCreateCountingSemaphoreStatic MPU_xQueueCreateCountingSemaphoreStatic
|
||||||
#define xQueueGetMutexHolder MPU_xQueueGetMutexHolder
|
#define xQueueGetMutexHolder MPU_xQueueGetMutexHolder
|
||||||
#define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive
|
#define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive
|
||||||
#define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive
|
#define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive
|
||||||
#define xQueueGenericCreate MPU_xQueueGenericCreate
|
#define xQueueGenericCreate MPU_xQueueGenericCreate
|
||||||
#define xQueueGenericCreateStatic MPU_xQueueGenericCreateStatic
|
#define xQueueGenericCreateStatic MPU_xQueueGenericCreateStatic
|
||||||
#define xQueueCreateSet MPU_xQueueCreateSet
|
#define xQueueCreateSet MPU_xQueueCreateSet
|
||||||
#define xQueueAddToSet MPU_xQueueAddToSet
|
#define xQueueAddToSet MPU_xQueueAddToSet
|
||||||
#define xQueueRemoveFromSet MPU_xQueueRemoveFromSet
|
#define xQueueRemoveFromSet MPU_xQueueRemoveFromSet
|
||||||
#define xQueueSelectFromSet MPU_xQueueSelectFromSet
|
#define xQueueSelectFromSet MPU_xQueueSelectFromSet
|
||||||
#define xQueueGenericReset MPU_xQueueGenericReset
|
#define xQueueGenericReset MPU_xQueueGenericReset
|
||||||
|
|
||||||
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
||||||
#define vQueueAddToRegistry MPU_vQueueAddToRegistry
|
#define vQueueAddToRegistry MPU_vQueueAddToRegistry
|
||||||
#define vQueueUnregisterQueue MPU_vQueueUnregisterQueue
|
#define vQueueUnregisterQueue MPU_vQueueUnregisterQueue
|
||||||
#define pcQueueGetName MPU_pcQueueGetName
|
#define pcQueueGetName MPU_pcQueueGetName
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Map standard timer.h API functions to the MPU equivalents. */
|
/* Map standard timer.h API functions to the MPU equivalents. */
|
||||||
#define xTimerCreate MPU_xTimerCreate
|
#define xTimerCreate MPU_xTimerCreate
|
||||||
#define xTimerCreateStatic MPU_xTimerCreateStatic
|
#define xTimerCreateStatic MPU_xTimerCreateStatic
|
||||||
#define pvTimerGetTimerID MPU_pvTimerGetTimerID
|
#define pvTimerGetTimerID MPU_pvTimerGetTimerID
|
||||||
#define vTimerSetTimerID MPU_vTimerSetTimerID
|
#define vTimerSetTimerID MPU_vTimerSetTimerID
|
||||||
#define xTimerIsTimerActive MPU_xTimerIsTimerActive
|
#define xTimerIsTimerActive MPU_xTimerIsTimerActive
|
||||||
#define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
|
#define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
|
||||||
#define xTimerPendFunctionCall MPU_xTimerPendFunctionCall
|
#define xTimerPendFunctionCall MPU_xTimerPendFunctionCall
|
||||||
#define pcTimerGetName MPU_pcTimerGetName
|
#define pcTimerGetName MPU_pcTimerGetName
|
||||||
#define vTimerSetReloadMode MPU_vTimerSetReloadMode
|
#define vTimerSetReloadMode MPU_vTimerSetReloadMode
|
||||||
#define uxTimerGetReloadMode MPU_uxTimerGetReloadMode
|
#define uxTimerGetReloadMode MPU_uxTimerGetReloadMode
|
||||||
#define xTimerGetPeriod MPU_xTimerGetPeriod
|
#define xTimerGetPeriod MPU_xTimerGetPeriod
|
||||||
#define xTimerGetExpiryTime MPU_xTimerGetExpiryTime
|
#define xTimerGetExpiryTime MPU_xTimerGetExpiryTime
|
||||||
#define xTimerGenericCommand MPU_xTimerGenericCommand
|
#define xTimerGenericCommand MPU_xTimerGenericCommand
|
||||||
|
|
||||||
/* Map standard event_group.h API functions to the MPU equivalents. */
|
/* Map standard event_group.h API functions to the MPU equivalents. */
|
||||||
#define xEventGroupCreate MPU_xEventGroupCreate
|
#define xEventGroupCreate MPU_xEventGroupCreate
|
||||||
#define xEventGroupCreateStatic MPU_xEventGroupCreateStatic
|
#define xEventGroupCreateStatic MPU_xEventGroupCreateStatic
|
||||||
#define xEventGroupWaitBits MPU_xEventGroupWaitBits
|
#define xEventGroupWaitBits MPU_xEventGroupWaitBits
|
||||||
#define xEventGroupClearBits MPU_xEventGroupClearBits
|
#define xEventGroupClearBits MPU_xEventGroupClearBits
|
||||||
#define xEventGroupSetBits MPU_xEventGroupSetBits
|
#define xEventGroupSetBits MPU_xEventGroupSetBits
|
||||||
#define xEventGroupSync MPU_xEventGroupSync
|
#define xEventGroupSync MPU_xEventGroupSync
|
||||||
#define vEventGroupDelete MPU_vEventGroupDelete
|
#define vEventGroupDelete MPU_vEventGroupDelete
|
||||||
|
|
||||||
/* Map standard message/stream_buffer.h API functions to the MPU
|
/* Map standard message/stream_buffer.h API functions to the MPU
|
||||||
* equivalents. */
|
* equivalents. */
|
||||||
#define xStreamBufferSend MPU_xStreamBufferSend
|
#define xStreamBufferSend MPU_xStreamBufferSend
|
||||||
#define xStreamBufferReceive MPU_xStreamBufferReceive
|
#define xStreamBufferReceive MPU_xStreamBufferReceive
|
||||||
#define xStreamBufferNextMessageLengthBytes MPU_xStreamBufferNextMessageLengthBytes
|
#define xStreamBufferNextMessageLengthBytes MPU_xStreamBufferNextMessageLengthBytes
|
||||||
#define vStreamBufferDelete MPU_vStreamBufferDelete
|
#define vStreamBufferDelete MPU_vStreamBufferDelete
|
||||||
#define xStreamBufferIsFull MPU_xStreamBufferIsFull
|
#define xStreamBufferIsFull MPU_xStreamBufferIsFull
|
||||||
#define xStreamBufferIsEmpty MPU_xStreamBufferIsEmpty
|
#define xStreamBufferIsEmpty MPU_xStreamBufferIsEmpty
|
||||||
#define xStreamBufferReset MPU_xStreamBufferReset
|
#define xStreamBufferReset MPU_xStreamBufferReset
|
||||||
#define xStreamBufferSpacesAvailable MPU_xStreamBufferSpacesAvailable
|
#define xStreamBufferSpacesAvailable MPU_xStreamBufferSpacesAvailable
|
||||||
#define xStreamBufferBytesAvailable MPU_xStreamBufferBytesAvailable
|
#define xStreamBufferBytesAvailable MPU_xStreamBufferBytesAvailable
|
||||||
#define xStreamBufferSetTriggerLevel MPU_xStreamBufferSetTriggerLevel
|
#define xStreamBufferSetTriggerLevel MPU_xStreamBufferSetTriggerLevel
|
||||||
#define xStreamBufferGenericCreate MPU_xStreamBufferGenericCreate
|
#define xStreamBufferGenericCreate MPU_xStreamBufferGenericCreate
|
||||||
#define xStreamBufferGenericCreateStatic MPU_xStreamBufferGenericCreateStatic
|
#define xStreamBufferGenericCreateStatic MPU_xStreamBufferGenericCreateStatic
|
||||||
|
|
||||||
|
|
||||||
/* Remove the privileged function macro, but keep the PRIVILEGED_DATA
|
/* Remove the privileged function macro, but keep the PRIVILEGED_DATA
|
||||||
* macro so applications can place data in privileged access sections
|
* macro so applications can place data in privileged access sections
|
||||||
* (useful when using statically allocated objects). */
|
* (useful when using statically allocated objects). */
|
||||||
#define PRIVILEGED_FUNCTION
|
#define PRIVILEGED_FUNCTION
|
||||||
#define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) )
|
#define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) )
|
||||||
#define FREERTOS_SYSTEM_CALL
|
#define FREERTOS_SYSTEM_CALL
|
||||||
|
|
||||||
#else /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
|
#else /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
|
||||||
|
|
||||||
/* Ensure API functions go in the privileged execution section. */
|
/* Ensure API functions go in the privileged execution section. */
|
||||||
#define PRIVILEGED_FUNCTION __attribute__( ( section( "privileged_functions" ) ) )
|
#define PRIVILEGED_FUNCTION __attribute__( ( section( "privileged_functions" ) ) )
|
||||||
#define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) )
|
#define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) )
|
||||||
#define FREERTOS_SYSTEM_CALL __attribute__( ( section( "freertos_system_calls" ) ) )
|
#define FREERTOS_SYSTEM_CALL __attribute__( ( section( "freertos_system_calls" ) ) )
|
||||||
|
|
||||||
#endif /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
|
#endif /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
|
||||||
|
|
||||||
#else /* portUSING_MPU_WRAPPERS */
|
#else /* portUSING_MPU_WRAPPERS */
|
||||||
|
|
||||||
#define PRIVILEGED_FUNCTION
|
#define PRIVILEGED_FUNCTION
|
||||||
#define PRIVILEGED_DATA
|
#define PRIVILEGED_DATA
|
||||||
#define FREERTOS_SYSTEM_CALL
|
#define FREERTOS_SYSTEM_CALL
|
||||||
#define portUSING_MPU_WRAPPERS 0
|
#define portUSING_MPU_WRAPPERS 0
|
||||||
|
|
||||||
#endif /* portUSING_MPU_WRAPPERS */
|
#endif /* portUSING_MPU_WRAPPERS */
|
||||||
|
|
||||||
|
|
||||||
#endif /* MPU_WRAPPERS_H */
|
#endif /* MPU_WRAPPERS_H */
|
||||||
|
|
|
@ -1,216 +1,216 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
* the Software without restriction, including without limitation the rights to
|
* the Software without restriction, including without limitation the rights to
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
* subject to the following conditions:
|
* subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
* copies or substantial portions of the Software.
|
* copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* https://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* https://github.com/FreeRTOS
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
* Portable layer API. Each function must be defined for each port.
|
* Portable layer API. Each function must be defined for each port.
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef PORTABLE_H
|
#ifndef PORTABLE_H
|
||||||
#define PORTABLE_H
|
#define PORTABLE_H
|
||||||
|
|
||||||
/* Each FreeRTOS port has a unique portmacro.h header file. Originally a
|
/* Each FreeRTOS port has a unique portmacro.h header file. Originally a
|
||||||
* pre-processor definition was used to ensure the pre-processor found the correct
|
* pre-processor definition was used to ensure the pre-processor found the correct
|
||||||
* portmacro.h file for the port being used. That scheme was deprecated in favour
|
* portmacro.h file for the port being used. That scheme was deprecated in favour
|
||||||
* of setting the compiler's include path such that it found the correct
|
* of setting the compiler's include path such that it found the correct
|
||||||
* portmacro.h file - removing the need for the constant and allowing the
|
* portmacro.h file - removing the need for the constant and allowing the
|
||||||
* portmacro.h file to be located anywhere in relation to the port being used.
|
* portmacro.h file to be located anywhere in relation to the port being used.
|
||||||
* Purely for reasons of backward compatibility the old method is still valid, but
|
* Purely for reasons of backward compatibility the old method is still valid, but
|
||||||
* to make it clear that new projects should not use it, support for the port
|
* to make it clear that new projects should not use it, support for the port
|
||||||
* specific constants has been moved into the deprecated_definitions.h header
|
* specific constants has been moved into the deprecated_definitions.h header
|
||||||
* file. */
|
* file. */
|
||||||
#include "deprecated_definitions.h"
|
#include "deprecated_definitions.h"
|
||||||
|
|
||||||
/* If portENTER_CRITICAL is not defined then including deprecated_definitions.h
|
/* If portENTER_CRITICAL is not defined then including deprecated_definitions.h
|
||||||
* did not result in a portmacro.h header file being included - and it should be
|
* did not result in a portmacro.h header file being included - and it should be
|
||||||
* included here. In this case the path to the correct portmacro.h header file
|
* included here. In this case the path to the correct portmacro.h header file
|
||||||
* must be set in the compiler's include path. */
|
* must be set in the compiler's include path. */
|
||||||
#ifndef portENTER_CRITICAL
|
#ifndef portENTER_CRITICAL
|
||||||
#include "portmacro.h"
|
#include "portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if portBYTE_ALIGNMENT == 32
|
#if portBYTE_ALIGNMENT == 32
|
||||||
#define portBYTE_ALIGNMENT_MASK ( 0x001f )
|
#define portBYTE_ALIGNMENT_MASK ( 0x001f )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if portBYTE_ALIGNMENT == 16
|
#if portBYTE_ALIGNMENT == 16
|
||||||
#define portBYTE_ALIGNMENT_MASK ( 0x000f )
|
#define portBYTE_ALIGNMENT_MASK ( 0x000f )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if portBYTE_ALIGNMENT == 8
|
#if portBYTE_ALIGNMENT == 8
|
||||||
#define portBYTE_ALIGNMENT_MASK ( 0x0007 )
|
#define portBYTE_ALIGNMENT_MASK ( 0x0007 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if portBYTE_ALIGNMENT == 4
|
#if portBYTE_ALIGNMENT == 4
|
||||||
#define portBYTE_ALIGNMENT_MASK ( 0x0003 )
|
#define portBYTE_ALIGNMENT_MASK ( 0x0003 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if portBYTE_ALIGNMENT == 2
|
#if portBYTE_ALIGNMENT == 2
|
||||||
#define portBYTE_ALIGNMENT_MASK ( 0x0001 )
|
#define portBYTE_ALIGNMENT_MASK ( 0x0001 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if portBYTE_ALIGNMENT == 1
|
#if portBYTE_ALIGNMENT == 1
|
||||||
#define portBYTE_ALIGNMENT_MASK ( 0x0000 )
|
#define portBYTE_ALIGNMENT_MASK ( 0x0000 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef portBYTE_ALIGNMENT_MASK
|
#ifndef portBYTE_ALIGNMENT_MASK
|
||||||
#error "Invalid portBYTE_ALIGNMENT definition"
|
#error "Invalid portBYTE_ALIGNMENT definition"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef portNUM_CONFIGURABLE_REGIONS
|
#ifndef portNUM_CONFIGURABLE_REGIONS
|
||||||
#define portNUM_CONFIGURABLE_REGIONS 1
|
#define portNUM_CONFIGURABLE_REGIONS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef portHAS_STACK_OVERFLOW_CHECKING
|
#ifndef portHAS_STACK_OVERFLOW_CHECKING
|
||||||
#define portHAS_STACK_OVERFLOW_CHECKING 0
|
#define portHAS_STACK_OVERFLOW_CHECKING 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef portARCH_NAME
|
#ifndef portARCH_NAME
|
||||||
#define portARCH_NAME NULL
|
#define portARCH_NAME NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#include "mpu_wrappers.h"
|
#include "mpu_wrappers.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setup the stack of a new task so it is ready to be placed under the
|
* Setup the stack of a new task so it is ready to be placed under the
|
||||||
* scheduler control. The registers have to be placed on the stack in
|
* scheduler control. The registers have to be placed on the stack in
|
||||||
* the order that the port expects to find them.
|
* the order that the port expects to find them.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#if ( portUSING_MPU_WRAPPERS == 1 )
|
#if ( portUSING_MPU_WRAPPERS == 1 )
|
||||||
#if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
|
#if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
StackType_t * pxEndOfStack,
|
StackType_t * pxEndOfStack,
|
||||||
TaskFunction_t pxCode,
|
TaskFunction_t pxCode,
|
||||||
void * pvParameters,
|
void * pvParameters,
|
||||||
BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
|
BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
|
||||||
#else
|
#else
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
TaskFunction_t pxCode,
|
TaskFunction_t pxCode,
|
||||||
void * pvParameters,
|
void * pvParameters,
|
||||||
BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
|
BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
#else /* if ( portUSING_MPU_WRAPPERS == 1 ) */
|
#else /* if ( portUSING_MPU_WRAPPERS == 1 ) */
|
||||||
#if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
|
#if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
StackType_t * pxEndOfStack,
|
StackType_t * pxEndOfStack,
|
||||||
TaskFunction_t pxCode,
|
TaskFunction_t pxCode,
|
||||||
void * pvParameters ) PRIVILEGED_FUNCTION;
|
void * pvParameters ) PRIVILEGED_FUNCTION;
|
||||||
#else
|
#else
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
TaskFunction_t pxCode,
|
TaskFunction_t pxCode,
|
||||||
void * pvParameters ) PRIVILEGED_FUNCTION;
|
void * pvParameters ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
#endif /* if ( portUSING_MPU_WRAPPERS == 1 ) */
|
#endif /* if ( portUSING_MPU_WRAPPERS == 1 ) */
|
||||||
|
|
||||||
/* Used by heap_5.c to define the start address and size of each memory region
|
/* Used by heap_5.c to define the start address and size of each memory region
|
||||||
* that together comprise the total FreeRTOS heap space. */
|
* that together comprise the total FreeRTOS heap space. */
|
||||||
typedef struct HeapRegion
|
typedef struct HeapRegion
|
||||||
{
|
{
|
||||||
uint8_t * pucStartAddress;
|
uint8_t * pucStartAddress;
|
||||||
size_t xSizeInBytes;
|
size_t xSizeInBytes;
|
||||||
} HeapRegion_t;
|
} HeapRegion_t;
|
||||||
|
|
||||||
/* Used to pass information about the heap out of vPortGetHeapStats(). */
|
/* Used to pass information about the heap out of vPortGetHeapStats(). */
|
||||||
typedef struct xHeapStats
|
typedef struct xHeapStats
|
||||||
{
|
{
|
||||||
size_t xAvailableHeapSpaceInBytes; /* The total heap size currently available - this is the sum of all the free blocks, not the largest block that can be allocated. */
|
size_t xAvailableHeapSpaceInBytes; /* The total heap size currently available - this is the sum of all the free blocks, not the largest block that can be allocated. */
|
||||||
size_t xSizeOfLargestFreeBlockInBytes; /* The maximum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
|
size_t xSizeOfLargestFreeBlockInBytes; /* The maximum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
|
||||||
size_t xSizeOfSmallestFreeBlockInBytes; /* The minimum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
|
size_t xSizeOfSmallestFreeBlockInBytes; /* The minimum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
|
||||||
size_t xNumberOfFreeBlocks; /* The number of free memory blocks within the heap at the time vPortGetHeapStats() is called. */
|
size_t xNumberOfFreeBlocks; /* The number of free memory blocks within the heap at the time vPortGetHeapStats() is called. */
|
||||||
size_t xMinimumEverFreeBytesRemaining; /* The minimum amount of total free memory (sum of all free blocks) there has been in the heap since the system booted. */
|
size_t xMinimumEverFreeBytesRemaining; /* The minimum amount of total free memory (sum of all free blocks) there has been in the heap since the system booted. */
|
||||||
size_t xNumberOfSuccessfulAllocations; /* The number of calls to pvPortMalloc() that have returned a valid memory block. */
|
size_t xNumberOfSuccessfulAllocations; /* The number of calls to pvPortMalloc() that have returned a valid memory block. */
|
||||||
size_t xNumberOfSuccessfulFrees; /* The number of calls to vPortFree() that has successfully freed a block of memory. */
|
size_t xNumberOfSuccessfulFrees; /* The number of calls to vPortFree() that has successfully freed a block of memory. */
|
||||||
} HeapStats_t;
|
} HeapStats_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Used to define multiple heap regions for use by heap_5.c. This function
|
* Used to define multiple heap regions for use by heap_5.c. This function
|
||||||
* must be called before any calls to pvPortMalloc() - not creating a task,
|
* must be called before any calls to pvPortMalloc() - not creating a task,
|
||||||
* queue, semaphore, mutex, software timer, event group, etc. will result in
|
* queue, semaphore, mutex, software timer, event group, etc. will result in
|
||||||
* pvPortMalloc being called.
|
* pvPortMalloc being called.
|
||||||
*
|
*
|
||||||
* pxHeapRegions passes in an array of HeapRegion_t structures - each of which
|
* pxHeapRegions passes in an array of HeapRegion_t structures - each of which
|
||||||
* defines a region of memory that can be used as the heap. The array is
|
* defines a region of memory that can be used as the heap. The array is
|
||||||
* terminated by a HeapRegions_t structure that has a size of 0. The region
|
* terminated by a HeapRegions_t structure that has a size of 0. The region
|
||||||
* with the lowest start address must appear first in the array.
|
* with the lowest start address must appear first in the array.
|
||||||
*/
|
*/
|
||||||
void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) PRIVILEGED_FUNCTION;
|
void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns a HeapStats_t structure filled with information about the current
|
* Returns a HeapStats_t structure filled with information about the current
|
||||||
* heap state.
|
* heap state.
|
||||||
*/
|
*/
|
||||||
void vPortGetHeapStats( HeapStats_t * pxHeapStats );
|
void vPortGetHeapStats( HeapStats_t * pxHeapStats );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Map to the memory management routines required for the port.
|
* Map to the memory management routines required for the port.
|
||||||
*/
|
*/
|
||||||
void * pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
|
void * pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
|
||||||
void vPortFree( void * pv ) PRIVILEGED_FUNCTION;
|
void vPortFree( void * pv ) PRIVILEGED_FUNCTION;
|
||||||
void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
|
void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
|
||||||
size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
|
size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
|
||||||
size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
|
size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setup the hardware ready for the scheduler to take control. This generally
|
* Setup the hardware ready for the scheduler to take control. This generally
|
||||||
* sets up a tick interrupt and sets timers for the correct tick frequency.
|
* sets up a tick interrupt and sets timers for the correct tick frequency.
|
||||||
*/
|
*/
|
||||||
BaseType_t xPortStartScheduler( void ) PRIVILEGED_FUNCTION;
|
BaseType_t xPortStartScheduler( void ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Undo any hardware/ISR setup that was performed by xPortStartScheduler() so
|
* Undo any hardware/ISR setup that was performed by xPortStartScheduler() so
|
||||||
* the hardware is left in its original condition after the scheduler stops
|
* the hardware is left in its original condition after the scheduler stops
|
||||||
* executing.
|
* executing.
|
||||||
*/
|
*/
|
||||||
void vPortEndScheduler( void ) PRIVILEGED_FUNCTION;
|
void vPortEndScheduler( void ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The structures and methods of manipulating the MPU are contained within the
|
* The structures and methods of manipulating the MPU are contained within the
|
||||||
* port layer.
|
* port layer.
|
||||||
*
|
*
|
||||||
* Fills the xMPUSettings structure with the memory region information
|
* Fills the xMPUSettings structure with the memory region information
|
||||||
* contained in xRegions.
|
* contained in xRegions.
|
||||||
*/
|
*/
|
||||||
#if ( portUSING_MPU_WRAPPERS == 1 )
|
#if ( portUSING_MPU_WRAPPERS == 1 )
|
||||||
struct xMEMORY_REGION;
|
struct xMEMORY_REGION;
|
||||||
void vPortStoreTaskMPUSettings( xMPU_SETTINGS * xMPUSettings,
|
void vPortStoreTaskMPUSettings( xMPU_SETTINGS * xMPUSettings,
|
||||||
const struct xMEMORY_REGION * const xRegions,
|
const struct xMEMORY_REGION * const xRegions,
|
||||||
StackType_t * pxBottomOfStack,
|
StackType_t * pxBottomOfStack,
|
||||||
uint32_t ulStackDepth ) PRIVILEGED_FUNCTION;
|
uint32_t ulStackDepth ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* PORTABLE_H */
|
#endif /* PORTABLE_H */
|
||||||
|
|
|
@ -1,120 +1,120 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
* the Software without restriction, including without limitation the rights to
|
* the Software without restriction, including without limitation the rights to
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
* subject to the following conditions:
|
* subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
* copies or substantial portions of the Software.
|
* copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* https://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* https://github.com/FreeRTOS
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PROJDEFS_H
|
#ifndef PROJDEFS_H
|
||||||
#define PROJDEFS_H
|
#define PROJDEFS_H
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Defines the prototype to which task functions must conform. Defined in this
|
* Defines the prototype to which task functions must conform. Defined in this
|
||||||
* file to ensure the type is known before portable.h is included.
|
* file to ensure the type is known before portable.h is included.
|
||||||
*/
|
*/
|
||||||
typedef void (* TaskFunction_t)( void * );
|
typedef void (* TaskFunction_t)( void * );
|
||||||
|
|
||||||
/* Converts a time in milliseconds to a time in ticks. This macro can be
|
/* Converts a time in milliseconds to a time in ticks. This macro can be
|
||||||
* overridden by a macro of the same name defined in FreeRTOSConfig.h in case the
|
* overridden by a macro of the same name defined in FreeRTOSConfig.h in case the
|
||||||
* definition here is not suitable for your application. */
|
* definition here is not suitable for your application. */
|
||||||
#ifndef pdMS_TO_TICKS
|
#ifndef pdMS_TO_TICKS
|
||||||
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) )
|
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define pdFALSE ( ( BaseType_t ) 0 )
|
#define pdFALSE ( ( BaseType_t ) 0 )
|
||||||
#define pdTRUE ( ( BaseType_t ) 1 )
|
#define pdTRUE ( ( BaseType_t ) 1 )
|
||||||
|
|
||||||
#define pdPASS ( pdTRUE )
|
#define pdPASS ( pdTRUE )
|
||||||
#define pdFAIL ( pdFALSE )
|
#define pdFAIL ( pdFALSE )
|
||||||
#define errQUEUE_EMPTY ( ( BaseType_t ) 0 )
|
#define errQUEUE_EMPTY ( ( BaseType_t ) 0 )
|
||||||
#define errQUEUE_FULL ( ( BaseType_t ) 0 )
|
#define errQUEUE_FULL ( ( BaseType_t ) 0 )
|
||||||
|
|
||||||
/* FreeRTOS error definitions. */
|
/* FreeRTOS error definitions. */
|
||||||
#define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 )
|
#define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 )
|
||||||
#define errQUEUE_BLOCKED ( -4 )
|
#define errQUEUE_BLOCKED ( -4 )
|
||||||
#define errQUEUE_YIELD ( -5 )
|
#define errQUEUE_YIELD ( -5 )
|
||||||
|
|
||||||
/* Macros used for basic data corruption checks. */
|
/* Macros used for basic data corruption checks. */
|
||||||
#ifndef configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES
|
#ifndef configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES
|
||||||
#define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0
|
#define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ( configUSE_16_BIT_TICKS == 1 )
|
#if ( configUSE_16_BIT_TICKS == 1 )
|
||||||
#define pdINTEGRITY_CHECK_VALUE 0x5a5a
|
#define pdINTEGRITY_CHECK_VALUE 0x5a5a
|
||||||
#else
|
#else
|
||||||
#define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL
|
#define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The following errno values are used by FreeRTOS+ components, not FreeRTOS
|
/* The following errno values are used by FreeRTOS+ components, not FreeRTOS
|
||||||
* itself. */
|
* itself. */
|
||||||
#define pdFREERTOS_ERRNO_NONE 0 /* No errors */
|
#define pdFREERTOS_ERRNO_NONE 0 /* No errors */
|
||||||
#define pdFREERTOS_ERRNO_ENOENT 2 /* No such file or directory */
|
#define pdFREERTOS_ERRNO_ENOENT 2 /* No such file or directory */
|
||||||
#define pdFREERTOS_ERRNO_EINTR 4 /* Interrupted system call */
|
#define pdFREERTOS_ERRNO_EINTR 4 /* Interrupted system call */
|
||||||
#define pdFREERTOS_ERRNO_EIO 5 /* I/O error */
|
#define pdFREERTOS_ERRNO_EIO 5 /* I/O error */
|
||||||
#define pdFREERTOS_ERRNO_ENXIO 6 /* No such device or address */
|
#define pdFREERTOS_ERRNO_ENXIO 6 /* No such device or address */
|
||||||
#define pdFREERTOS_ERRNO_EBADF 9 /* Bad file number */
|
#define pdFREERTOS_ERRNO_EBADF 9 /* Bad file number */
|
||||||
#define pdFREERTOS_ERRNO_EAGAIN 11 /* No more processes */
|
#define pdFREERTOS_ERRNO_EAGAIN 11 /* No more processes */
|
||||||
#define pdFREERTOS_ERRNO_EWOULDBLOCK 11 /* Operation would block */
|
#define pdFREERTOS_ERRNO_EWOULDBLOCK 11 /* Operation would block */
|
||||||
#define pdFREERTOS_ERRNO_ENOMEM 12 /* Not enough memory */
|
#define pdFREERTOS_ERRNO_ENOMEM 12 /* Not enough memory */
|
||||||
#define pdFREERTOS_ERRNO_EACCES 13 /* Permission denied */
|
#define pdFREERTOS_ERRNO_EACCES 13 /* Permission denied */
|
||||||
#define pdFREERTOS_ERRNO_EFAULT 14 /* Bad address */
|
#define pdFREERTOS_ERRNO_EFAULT 14 /* Bad address */
|
||||||
#define pdFREERTOS_ERRNO_EBUSY 16 /* Mount device busy */
|
#define pdFREERTOS_ERRNO_EBUSY 16 /* Mount device busy */
|
||||||
#define pdFREERTOS_ERRNO_EEXIST 17 /* File exists */
|
#define pdFREERTOS_ERRNO_EEXIST 17 /* File exists */
|
||||||
#define pdFREERTOS_ERRNO_EXDEV 18 /* Cross-device link */
|
#define pdFREERTOS_ERRNO_EXDEV 18 /* Cross-device link */
|
||||||
#define pdFREERTOS_ERRNO_ENODEV 19 /* No such device */
|
#define pdFREERTOS_ERRNO_ENODEV 19 /* No such device */
|
||||||
#define pdFREERTOS_ERRNO_ENOTDIR 20 /* Not a directory */
|
#define pdFREERTOS_ERRNO_ENOTDIR 20 /* Not a directory */
|
||||||
#define pdFREERTOS_ERRNO_EISDIR 21 /* Is a directory */
|
#define pdFREERTOS_ERRNO_EISDIR 21 /* Is a directory */
|
||||||
#define pdFREERTOS_ERRNO_EINVAL 22 /* Invalid argument */
|
#define pdFREERTOS_ERRNO_EINVAL 22 /* Invalid argument */
|
||||||
#define pdFREERTOS_ERRNO_ENOSPC 28 /* No space left on device */
|
#define pdFREERTOS_ERRNO_ENOSPC 28 /* No space left on device */
|
||||||
#define pdFREERTOS_ERRNO_ESPIPE 29 /* Illegal seek */
|
#define pdFREERTOS_ERRNO_ESPIPE 29 /* Illegal seek */
|
||||||
#define pdFREERTOS_ERRNO_EROFS 30 /* Read only file system */
|
#define pdFREERTOS_ERRNO_EROFS 30 /* Read only file system */
|
||||||
#define pdFREERTOS_ERRNO_EUNATCH 42 /* Protocol driver not attached */
|
#define pdFREERTOS_ERRNO_EUNATCH 42 /* Protocol driver not attached */
|
||||||
#define pdFREERTOS_ERRNO_EBADE 50 /* Invalid exchange */
|
#define pdFREERTOS_ERRNO_EBADE 50 /* Invalid exchange */
|
||||||
#define pdFREERTOS_ERRNO_EFTYPE 79 /* Inappropriate file type or format */
|
#define pdFREERTOS_ERRNO_EFTYPE 79 /* Inappropriate file type or format */
|
||||||
#define pdFREERTOS_ERRNO_ENMFILE 89 /* No more files */
|
#define pdFREERTOS_ERRNO_ENMFILE 89 /* No more files */
|
||||||
#define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */
|
#define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */
|
||||||
#define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */
|
#define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */
|
||||||
#define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
|
#define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
|
||||||
#define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */
|
#define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */
|
||||||
#define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */
|
#define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */
|
||||||
#define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */
|
#define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */
|
||||||
#define pdFREERTOS_ERRNO_ETIMEDOUT 116 /* Connection timed out */
|
#define pdFREERTOS_ERRNO_ETIMEDOUT 116 /* Connection timed out */
|
||||||
#define pdFREERTOS_ERRNO_EINPROGRESS 119 /* Connection already in progress */
|
#define pdFREERTOS_ERRNO_EINPROGRESS 119 /* Connection already in progress */
|
||||||
#define pdFREERTOS_ERRNO_EALREADY 120 /* Socket already connected */
|
#define pdFREERTOS_ERRNO_EALREADY 120 /* Socket already connected */
|
||||||
#define pdFREERTOS_ERRNO_EADDRNOTAVAIL 125 /* Address not available */
|
#define pdFREERTOS_ERRNO_EADDRNOTAVAIL 125 /* Address not available */
|
||||||
#define pdFREERTOS_ERRNO_EISCONN 127 /* Socket is already connected */
|
#define pdFREERTOS_ERRNO_EISCONN 127 /* Socket is already connected */
|
||||||
#define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */
|
#define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */
|
||||||
#define pdFREERTOS_ERRNO_ENOMEDIUM 135 /* No medium inserted */
|
#define pdFREERTOS_ERRNO_ENOMEDIUM 135 /* No medium inserted */
|
||||||
#define pdFREERTOS_ERRNO_EILSEQ 138 /* An invalid UTF-16 sequence was encountered. */
|
#define pdFREERTOS_ERRNO_EILSEQ 138 /* An invalid UTF-16 sequence was encountered. */
|
||||||
#define pdFREERTOS_ERRNO_ECANCELED 140 /* Operation canceled. */
|
#define pdFREERTOS_ERRNO_ECANCELED 140 /* Operation canceled. */
|
||||||
|
|
||||||
/* The following endian values are used by FreeRTOS+ components, not FreeRTOS
|
/* The following endian values are used by FreeRTOS+ components, not FreeRTOS
|
||||||
* itself. */
|
* itself. */
|
||||||
#define pdFREERTOS_LITTLE_ENDIAN 0
|
#define pdFREERTOS_LITTLE_ENDIAN 0
|
||||||
#define pdFREERTOS_BIG_ENDIAN 1
|
#define pdFREERTOS_BIG_ENDIAN 1
|
||||||
|
|
||||||
/* Re-defining endian values for generic naming. */
|
/* Re-defining endian values for generic naming. */
|
||||||
#define pdLITTLE_ENDIAN pdFREERTOS_LITTLE_ENDIAN
|
#define pdLITTLE_ENDIAN pdFREERTOS_LITTLE_ENDIAN
|
||||||
#define pdBIG_ENDIAN pdFREERTOS_BIG_ENDIAN
|
#define pdBIG_ENDIAN pdFREERTOS_BIG_ENDIAN
|
||||||
|
|
||||||
|
|
||||||
#endif /* PROJDEFS_H */
|
#endif /* PROJDEFS_H */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
|
2346
include/semphr.h
2346
include/semphr.h
File diff suppressed because it is too large
Load diff
|
@ -1,127 +1,127 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
* the Software without restriction, including without limitation the rights to
|
* the Software without restriction, including without limitation the rights to
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
* subject to the following conditions:
|
* subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
* copies or substantial portions of the Software.
|
* copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* https://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* https://github.com/FreeRTOS
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STACK_MACROS_H
|
#ifndef STACK_MACROS_H
|
||||||
#define STACK_MACROS_H
|
#define STACK_MACROS_H
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Call the stack overflow hook function if the stack of the task being swapped
|
* Call the stack overflow hook function if the stack of the task being swapped
|
||||||
* out is currently overflowed, or looks like it might have overflowed in the
|
* out is currently overflowed, or looks like it might have overflowed in the
|
||||||
* past.
|
* past.
|
||||||
*
|
*
|
||||||
* Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check
|
* Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check
|
||||||
* the current stack state only - comparing the current top of stack value to
|
* the current stack state only - comparing the current top of stack value to
|
||||||
* the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1
|
* the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1
|
||||||
* will also cause the last few stack bytes to be checked to ensure the value
|
* will also cause the last few stack bytes to be checked to ensure the value
|
||||||
* to which the bytes were set when the task was created have not been
|
* to which the bytes were set when the task was created have not been
|
||||||
* overwritten. Note this second test does not guarantee that an overflowed
|
* overwritten. Note this second test does not guarantee that an overflowed
|
||||||
* stack will always be recognised.
|
* stack will always be recognised.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) )
|
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) )
|
||||||
|
|
||||||
/* Only the current stack state is to be checked. */
|
/* Only the current stack state is to be checked. */
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
||||||
{ \
|
{ \
|
||||||
/* Is the currently saved stack pointer within the stack limit? */ \
|
/* Is the currently saved stack pointer within the stack limit? */ \
|
||||||
if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \
|
if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \
|
||||||
{ \
|
{ \
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
|
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) )
|
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) )
|
||||||
|
|
||||||
/* Only the current stack state is to be checked. */
|
/* Only the current stack state is to be checked. */
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
||||||
{ \
|
{ \
|
||||||
\
|
\
|
||||||
/* Is the currently saved stack pointer within the stack limit? */ \
|
/* Is the currently saved stack pointer within the stack limit? */ \
|
||||||
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \
|
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \
|
||||||
{ \
|
{ \
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
|
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) )
|
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) )
|
||||||
|
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
||||||
{ \
|
{ \
|
||||||
const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
|
const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
|
||||||
const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \
|
const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \
|
||||||
\
|
\
|
||||||
if( ( pulStack[ 0 ] != ulCheckValue ) || \
|
if( ( pulStack[ 0 ] != ulCheckValue ) || \
|
||||||
( pulStack[ 1 ] != ulCheckValue ) || \
|
( pulStack[ 1 ] != ulCheckValue ) || \
|
||||||
( pulStack[ 2 ] != ulCheckValue ) || \
|
( pulStack[ 2 ] != ulCheckValue ) || \
|
||||||
( pulStack[ 3 ] != ulCheckValue ) ) \
|
( pulStack[ 3 ] != ulCheckValue ) ) \
|
||||||
{ \
|
{ \
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
|
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) )
|
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) )
|
||||||
|
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
||||||
{ \
|
{ \
|
||||||
int8_t * pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \
|
int8_t * pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \
|
||||||
static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
||||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
||||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
||||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
||||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \
|
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \
|
||||||
\
|
\
|
||||||
\
|
\
|
||||||
pcEndOfStack -= sizeof( ucExpectedStackBytes ); \
|
pcEndOfStack -= sizeof( ucExpectedStackBytes ); \
|
||||||
\
|
\
|
||||||
/* Has the extremity of the task stack ever been written over? */ \
|
/* Has the extremity of the task stack ever been written over? */ \
|
||||||
if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \
|
if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \
|
||||||
{ \
|
{ \
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
|
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Remove stack overflow macro if not being used. */
|
/* Remove stack overflow macro if not being used. */
|
||||||
#ifndef taskCHECK_FOR_STACK_OVERFLOW
|
#ifndef taskCHECK_FOR_STACK_OVERFLOW
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW()
|
#define taskCHECK_FOR_STACK_OVERFLOW()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* STACK_MACROS_H */
|
#endif /* STACK_MACROS_H */
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
|
420
list.c
420
list.c
|
@ -1,210 +1,210 @@
|
||||||
/*
|
/*
|
||||||
* FreeRTOS Kernel V10.3.1
|
* FreeRTOS Kernel V10.3.2
|
||||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
* the Software without restriction, including without limitation the rights to
|
* the Software without restriction, including without limitation the rights to
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
* subject to the following conditions:
|
* subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
* copies or substantial portions of the Software.
|
* copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* https://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* https://github.com/FreeRTOS
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
|
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
|
||||||
* all the API functions to use the MPU wrappers. That should only be done when
|
* all the API functions to use the MPU wrappers. That should only be done when
|
||||||
* task.h is included from an application file. */
|
* task.h is included from an application file. */
|
||||||
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
||||||
|
|
||||||
#include "FreeRTOS.h"
|
#include "FreeRTOS.h"
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
|
|
||||||
/* Lint e9021, e961 and e750 are suppressed as a MISRA exception justified
|
/* Lint e9021, e961 and e750 are suppressed as a MISRA exception justified
|
||||||
* because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be
|
* because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be
|
||||||
* defined for the header files above, but not in this file, in order to
|
* defined for the header files above, but not in this file, in order to
|
||||||
* generate the correct privileged Vs unprivileged linkage and placement. */
|
* generate the correct privileged Vs unprivileged linkage and placement. */
|
||||||
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */
|
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
* PUBLIC LIST API documented in list.h
|
* PUBLIC LIST API documented in list.h
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
void vListInitialise( List_t * const pxList )
|
void vListInitialise( List_t * const pxList )
|
||||||
{
|
{
|
||||||
/* The list structure contains a list item which is used to mark the
|
/* The list structure contains a list item which is used to mark the
|
||||||
* end of the list. To initialise the list the list end is inserted
|
* end of the list. To initialise the list the list end is inserted
|
||||||
* as the only list entry. */
|
* as the only list entry. */
|
||||||
pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
|
pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
|
||||||
|
|
||||||
/* The list end value is the highest possible value in the list to
|
/* The list end value is the highest possible value in the list to
|
||||||
* ensure it remains at the end of the list. */
|
* ensure it remains at the end of the list. */
|
||||||
pxList->xListEnd.xItemValue = portMAX_DELAY;
|
pxList->xListEnd.xItemValue = portMAX_DELAY;
|
||||||
|
|
||||||
/* The list end next and previous pointers point to itself so we know
|
/* The list end next and previous pointers point to itself so we know
|
||||||
* when the list is empty. */
|
* when the list is empty. */
|
||||||
pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
|
pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
|
||||||
pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
|
pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
|
||||||
|
|
||||||
pxList->uxNumberOfItems = ( UBaseType_t ) 0U;
|
pxList->uxNumberOfItems = ( UBaseType_t ) 0U;
|
||||||
|
|
||||||
/* Write known values into the list if
|
/* Write known values into the list if
|
||||||
* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||||
listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList );
|
listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList );
|
||||||
listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList );
|
listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vListInitialiseItem( ListItem_t * const pxItem )
|
void vListInitialiseItem( ListItem_t * const pxItem )
|
||||||
{
|
{
|
||||||
/* Make sure the list item is not recorded as being on a list. */
|
/* Make sure the list item is not recorded as being on a list. */
|
||||||
pxItem->pxContainer = NULL;
|
pxItem->pxContainer = NULL;
|
||||||
|
|
||||||
/* Write known values into the list item if
|
/* Write known values into the list item if
|
||||||
* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||||
listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
|
listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
|
||||||
listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
|
listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vListInsertEnd( List_t * const pxList,
|
void vListInsertEnd( List_t * const pxList,
|
||||||
ListItem_t * const pxNewListItem )
|
ListItem_t * const pxNewListItem )
|
||||||
{
|
{
|
||||||
ListItem_t * const pxIndex = pxList->pxIndex;
|
ListItem_t * const pxIndex = pxList->pxIndex;
|
||||||
|
|
||||||
/* Only effective when configASSERT() is also defined, these tests may catch
|
/* Only effective when configASSERT() is also defined, these tests may catch
|
||||||
* the list data structures being overwritten in memory. They will not catch
|
* the list data structures being overwritten in memory. They will not catch
|
||||||
* data errors caused by incorrect configuration or use of FreeRTOS. */
|
* data errors caused by incorrect configuration or use of FreeRTOS. */
|
||||||
listTEST_LIST_INTEGRITY( pxList );
|
listTEST_LIST_INTEGRITY( pxList );
|
||||||
listTEST_LIST_ITEM_INTEGRITY( pxNewListItem );
|
listTEST_LIST_ITEM_INTEGRITY( pxNewListItem );
|
||||||
|
|
||||||
/* Insert a new list item into pxList, but rather than sort the list,
|
/* Insert a new list item into pxList, but rather than sort the list,
|
||||||
* makes the new list item the last item to be removed by a call to
|
* makes the new list item the last item to be removed by a call to
|
||||||
* listGET_OWNER_OF_NEXT_ENTRY(). */
|
* listGET_OWNER_OF_NEXT_ENTRY(). */
|
||||||
pxNewListItem->pxNext = pxIndex;
|
pxNewListItem->pxNext = pxIndex;
|
||||||
pxNewListItem->pxPrevious = pxIndex->pxPrevious;
|
pxNewListItem->pxPrevious = pxIndex->pxPrevious;
|
||||||
|
|
||||||
/* Only used during decision coverage testing. */
|
/* Only used during decision coverage testing. */
|
||||||
mtCOVERAGE_TEST_DELAY();
|
mtCOVERAGE_TEST_DELAY();
|
||||||
|
|
||||||
pxIndex->pxPrevious->pxNext = pxNewListItem;
|
pxIndex->pxPrevious->pxNext = pxNewListItem;
|
||||||
pxIndex->pxPrevious = pxNewListItem;
|
pxIndex->pxPrevious = pxNewListItem;
|
||||||
|
|
||||||
/* Remember which list the item is in. */
|
/* Remember which list the item is in. */
|
||||||
pxNewListItem->pxContainer = pxList;
|
pxNewListItem->pxContainer = pxList;
|
||||||
|
|
||||||
( pxList->uxNumberOfItems )++;
|
( pxList->uxNumberOfItems )++;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vListInsert( List_t * const pxList,
|
void vListInsert( List_t * const pxList,
|
||||||
ListItem_t * const pxNewListItem )
|
ListItem_t * const pxNewListItem )
|
||||||
{
|
{
|
||||||
ListItem_t * pxIterator;
|
ListItem_t * pxIterator;
|
||||||
const TickType_t xValueOfInsertion = pxNewListItem->xItemValue;
|
const TickType_t xValueOfInsertion = pxNewListItem->xItemValue;
|
||||||
|
|
||||||
/* Only effective when configASSERT() is also defined, these tests may catch
|
/* Only effective when configASSERT() is also defined, these tests may catch
|
||||||
* the list data structures being overwritten in memory. They will not catch
|
* the list data structures being overwritten in memory. They will not catch
|
||||||
* data errors caused by incorrect configuration or use of FreeRTOS. */
|
* data errors caused by incorrect configuration or use of FreeRTOS. */
|
||||||
listTEST_LIST_INTEGRITY( pxList );
|
listTEST_LIST_INTEGRITY( pxList );
|
||||||
listTEST_LIST_ITEM_INTEGRITY( pxNewListItem );
|
listTEST_LIST_ITEM_INTEGRITY( pxNewListItem );
|
||||||
|
|
||||||
/* Insert the new list item into the list, sorted in xItemValue order.
|
/* Insert the new list item into the list, sorted in xItemValue order.
|
||||||
*
|
*
|
||||||
* If the list already contains a list item with the same item value then the
|
* If the list already contains a list item with the same item value then the
|
||||||
* new list item should be placed after it. This ensures that TCBs which are
|
* new list item should be placed after it. This ensures that TCBs which are
|
||||||
* stored in ready lists (all of which have the same xItemValue value) get a
|
* stored in ready lists (all of which have the same xItemValue value) get a
|
||||||
* share of the CPU. However, if the xItemValue is the same as the back marker
|
* share of the CPU. However, if the xItemValue is the same as the back marker
|
||||||
* the iteration loop below will not end. Therefore the value is checked
|
* the iteration loop below will not end. Therefore the value is checked
|
||||||
* first, and the algorithm slightly modified if necessary. */
|
* first, and the algorithm slightly modified if necessary. */
|
||||||
if( xValueOfInsertion == portMAX_DELAY )
|
if( xValueOfInsertion == portMAX_DELAY )
|
||||||
{
|
{
|
||||||
pxIterator = pxList->xListEnd.pxPrevious;
|
pxIterator = pxList->xListEnd.pxPrevious;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* *** NOTE ***********************************************************
|
/* *** NOTE ***********************************************************
|
||||||
* If you find your application is crashing here then likely causes are
|
* If you find your application is crashing here then likely causes are
|
||||||
* listed below. In addition see https://www.FreeRTOS.org/FAQHelp.html for
|
* listed below. In addition see https://www.FreeRTOS.org/FAQHelp.html for
|
||||||
* more tips, and ensure configASSERT() is defined!
|
* more tips, and ensure configASSERT() is defined!
|
||||||
* https://www.FreeRTOS.org/a00110.html#configASSERT
|
* https://www.FreeRTOS.org/a00110.html#configASSERT
|
||||||
*
|
*
|
||||||
* 1) Stack overflow -
|
* 1) Stack overflow -
|
||||||
* see https://www.FreeRTOS.org/Stacks-and-stack-overflow-checking.html
|
* see https://www.FreeRTOS.org/Stacks-and-stack-overflow-checking.html
|
||||||
* 2) Incorrect interrupt priority assignment, especially on Cortex-M
|
* 2) Incorrect interrupt priority assignment, especially on Cortex-M
|
||||||
* parts where numerically high priority values denote low actual
|
* parts where numerically high priority values denote low actual
|
||||||
* interrupt priorities, which can seem counter intuitive. See
|
* interrupt priorities, which can seem counter intuitive. See
|
||||||
* https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html and the definition
|
* https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html and the definition
|
||||||
* of configMAX_SYSCALL_INTERRUPT_PRIORITY on
|
* of configMAX_SYSCALL_INTERRUPT_PRIORITY on
|
||||||
* https://www.FreeRTOS.org/a00110.html
|
* https://www.FreeRTOS.org/a00110.html
|
||||||
* 3) Calling an API function from within a critical section or when
|
* 3) Calling an API function from within a critical section or when
|
||||||
* the scheduler is suspended, or calling an API function that does
|
* the scheduler is suspended, or calling an API function that does
|
||||||
* not end in "FromISR" from an interrupt.
|
* not end in "FromISR" from an interrupt.
|
||||||
* 4) Using a queue or semaphore before it has been initialised or
|
* 4) Using a queue or semaphore before it has been initialised or
|
||||||
* before the scheduler has been started (are interrupts firing
|
* before the scheduler has been started (are interrupts firing
|
||||||
* before vTaskStartScheduler() has been called?).
|
* before vTaskStartScheduler() has been called?).
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. *//*lint !e440 The iterator moves to a different value, not xValueOfInsertion. */
|
for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. *//*lint !e440 The iterator moves to a different value, not xValueOfInsertion. */
|
||||||
{
|
{
|
||||||
/* There is nothing to do here, just iterating to the wanted
|
/* There is nothing to do here, just iterating to the wanted
|
||||||
* insertion position. */
|
* insertion position. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pxNewListItem->pxNext = pxIterator->pxNext;
|
pxNewListItem->pxNext = pxIterator->pxNext;
|
||||||
pxNewListItem->pxNext->pxPrevious = pxNewListItem;
|
pxNewListItem->pxNext->pxPrevious = pxNewListItem;
|
||||||
pxNewListItem->pxPrevious = pxIterator;
|
pxNewListItem->pxPrevious = pxIterator;
|
||||||
pxIterator->pxNext = pxNewListItem;
|
pxIterator->pxNext = pxNewListItem;
|
||||||
|
|
||||||
/* Remember which list the item is in. This allows fast removal of the
|
/* Remember which list the item is in. This allows fast removal of the
|
||||||
* item later. */
|
* item later. */
|
||||||
pxNewListItem->pxContainer = pxList;
|
pxNewListItem->pxContainer = pxList;
|
||||||
|
|
||||||
( pxList->uxNumberOfItems )++;
|
( pxList->uxNumberOfItems )++;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
|
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
|
||||||
{
|
{
|
||||||
/* The list item knows which list it is in. Obtain the list from the list
|
/* The list item knows which list it is in. Obtain the list from the list
|
||||||
* item. */
|
* item. */
|
||||||
List_t * const pxList = pxItemToRemove->pxContainer;
|
List_t * const pxList = pxItemToRemove->pxContainer;
|
||||||
|
|
||||||
pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
|
pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
|
||||||
pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;
|
pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;
|
||||||
|
|
||||||
/* Only used during decision coverage testing. */
|
/* Only used during decision coverage testing. */
|
||||||
mtCOVERAGE_TEST_DELAY();
|
mtCOVERAGE_TEST_DELAY();
|
||||||
|
|
||||||
/* Make sure the index is left pointing to a valid item. */
|
/* Make sure the index is left pointing to a valid item. */
|
||||||
if( pxList->pxIndex == pxItemToRemove )
|
if( pxList->pxIndex == pxItemToRemove )
|
||||||
{
|
{
|
||||||
pxList->pxIndex = pxItemToRemove->pxPrevious;
|
pxList->pxIndex = pxItemToRemove->pxPrevious;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
pxItemToRemove->pxContainer = NULL;
|
pxItemToRemove->pxContainer = NULL;
|
||||||
( pxList->uxNumberOfItems )--;
|
( pxList->uxNumberOfItems )--;
|
||||||
|
|
||||||
return pxList->uxNumberOfItems;
|
return pxList->uxNumberOfItems;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
2652
stream_buffer.c
2652
stream_buffer.c
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue