mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-01 08:54:14 -04:00
Linting and MISRA checking
This commit is contained in:
parent
e83b93f5fc
commit
7d1292ced2
11 changed files with 251 additions and 210 deletions
|
@ -177,7 +177,7 @@ typedef struct xLIST
|
|||
* \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
|
||||
* \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
|
||||
|
@ -195,7 +195,7 @@ typedef struct xLIST
|
|||
* \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE
|
||||
* \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
|
||||
|
@ -223,7 +223,7 @@ typedef struct xLIST
|
|||
* \page listLIST_IS_EMPTY listLIST_IS_EMPTY
|
||||
* \ingroup LinkedList
|
||||
*/
|
||||
#define listLIST_IS_EMPTY( pxList ) ( ( pxList )->uxNumberOfItems == ( unsigned portBASE_TYPE ) 0 )
|
||||
#define listLIST_IS_EMPTY( pxList ) ( ( portBASE_TYPE ) ( ( pxList )->uxNumberOfItems == ( unsigned portBASE_TYPE ) 0 ) )
|
||||
|
||||
/*
|
||||
* Access macro to return the number of items in the list.
|
||||
|
@ -249,17 +249,17 @@ typedef struct xLIST
|
|||
* \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY
|
||||
* \ingroup LinkedList
|
||||
*/
|
||||
#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
|
||||
{ \
|
||||
xList * const pxConstList = ( pxList ); \
|
||||
/* 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. */ \
|
||||
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
|
||||
if( ( pxConstList )->pxIndex == ( xListItem * ) &( ( pxConstList )->xListEnd ) ) \
|
||||
{ \
|
||||
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
|
||||
} \
|
||||
( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \
|
||||
#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
|
||||
{ \
|
||||
xList * const pxConstList = ( pxList ); \
|
||||
/* 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. */ \
|
||||
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
|
||||
if( ( void * ) ( pxConstList )->pxIndex == ( void * ) &( ( pxConstList )->xListEnd ) ) \
|
||||
{ \
|
||||
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
|
||||
} \
|
||||
( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \
|
||||
}
|
||||
|
||||
|
||||
|
@ -291,7 +291,7 @@ xList * const pxConstList = ( pxList ); \
|
|||
* @return pdTRUE is the list item is in the list, otherwise pdFALSE.
|
||||
* pointer against
|
||||
*/
|
||||
#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( pxListItem )->pvContainer == ( void * ) ( pxList ) )
|
||||
#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( portBASE_TYPE ) ( ( pxListItem )->pvContainer == ( void * ) ( pxList ) ) )
|
||||
|
||||
/*
|
||||
* Return the list a list item is contained within (referenced from).
|
||||
|
|
|
@ -56,19 +56,19 @@
|
|||
***************************************************************************
|
||||
|
||||
|
||||
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
|
||||
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
|
||||
license and Real Time Engineers Ltd. contact details.
|
||||
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool, and our new
|
||||
fully thread aware and reentrant UDP/IP stack.
|
||||
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
|
||||
Integrity Systems, who sell the code with commercial support,
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
|
||||
Integrity Systems, who sell the code with commercial support,
|
||||
indemnification and middleware, under the OpenRTOS brand.
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
mission critical applications that require provable dependability.
|
||||
*/
|
||||
|
||||
|
@ -136,9 +136,9 @@
|
|||
#endif
|
||||
|
||||
#ifdef IAR_MSP430
|
||||
#include "..\..\Source\portable\IAR\MSP430\portmacro.h"
|
||||
#include "..\..\Source\portable\IAR\MSP430\portmacro.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef GCC_MSP430
|
||||
#include "../../Source/portable/GCC/MSP430F449/portmacro.h"
|
||||
#endif
|
||||
|
@ -174,7 +174,7 @@
|
|||
#ifdef STR75X_IAR
|
||||
#include "..\..\Source\portable\IAR\STR75x\portmacro.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef STR75X_GCC
|
||||
#include "..\..\Source\portable\GCC\STR75x\portmacro.h"
|
||||
#endif
|
||||
|
@ -182,7 +182,7 @@
|
|||
#ifdef STR91X_IAR
|
||||
#include "..\..\Source\portable\IAR\STR91x\portmacro.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef GCC_H8S
|
||||
#include "../../Source/portable/GCC/H8S2329/portmacro.h"
|
||||
#endif
|
||||
|
@ -210,10 +210,10 @@
|
|||
#ifdef IAR_ARMCM3_LM
|
||||
#include "../../Source/portable/IAR/ARM_CM3/portmacro.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HCS12_CODE_WARRIOR
|
||||
#include "../../Source/portable/CodeWarrior/HCS12/portmacro.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MICROBLAZE_GCC
|
||||
#include "../../Source/portable/GCC/MicroBlaze/portmacro.h"
|
||||
|
@ -313,11 +313,11 @@
|
|||
#ifdef __IAR_78K0R_Kx3__
|
||||
#include "../../Source/portable/IAR/78K0R/portmacro.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __IAR_78K0R_Kx3L__
|
||||
#include "../../Source/portable/IAR/78K0R/portmacro.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Catch all to ensure portmacro.h is included in the build. Newer demos
|
||||
have the path as part of the project options, rather than as relative from
|
||||
the project location. If portENTER_CRITICAL() has not been defined then
|
||||
|
@ -325,9 +325,9 @@ portmacro.h has not yet been included - as every portmacro.h provides a
|
|||
portENTER_CRITICAL() definition. Check the demo application for your demo
|
||||
to find the path to the correct portmacro.h file. */
|
||||
#ifndef portENTER_CRITICAL
|
||||
#include "portmacro.h"
|
||||
#include "portmacro.h"
|
||||
#endif
|
||||
|
||||
|
||||
#if portBYTE_ALIGNMENT == 8
|
||||
#define portBYTE_ALIGNMENT_MASK ( 0x0007 )
|
||||
#endif
|
||||
|
@ -367,7 +367,7 @@ extern "C" {
|
|||
#if( portUSING_MPU_WRAPPERS == 1 )
|
||||
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters, portBASE_TYPE xRunPrivileged ) PRIVILEGED_FUNCTION;
|
||||
#else
|
||||
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters );
|
||||
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -398,7 +398,7 @@ void vPortEndScheduler( void ) PRIVILEGED_FUNCTION;
|
|||
* Fills the xMPUSettings structure with the memory region information
|
||||
* contained in xRegions.
|
||||
*/
|
||||
#if( portUSING_MPU_WRAPPERS == 1 )
|
||||
#if( portUSING_MPU_WRAPPERS == 1 )
|
||||
struct xMEMORY_REGION;
|
||||
void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, portSTACK_TYPE *pxBottomOfStack, unsigned short usStackDepth ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
|
|
@ -78,13 +78,13 @@
|
|||
/* Defines the prototype to which task functions must conform. */
|
||||
typedef void (*pdTASK_CODE)( void * );
|
||||
|
||||
#define pdTRUE ( 1 )
|
||||
#define pdFALSE ( 0 )
|
||||
#define pdFALSE ( ( portBASE_TYPE ) 0 )
|
||||
#define pdTRUE ( ( portBASE_TYPE ) 1 )
|
||||
|
||||
#define pdPASS ( 1 )
|
||||
#define pdFAIL ( 0 )
|
||||
#define errQUEUE_EMPTY ( 0 )
|
||||
#define errQUEUE_FULL ( 0 )
|
||||
#define pdPASS ( pdTRUE )
|
||||
#define pdFAIL ( pdFALSE )
|
||||
#define errQUEUE_EMPTY ( ( portBASE_TYPE ) 0 )
|
||||
#define errQUEUE_FULL ( ( portBASE_TYPE ) 0 )
|
||||
|
||||
/* Error definitions. */
|
||||
#define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 )
|
||||
|
|
|
@ -85,8 +85,6 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
|
||||
#include "mpu_wrappers.h"
|
||||
|
||||
/**
|
||||
* Type by which queues are referenced. For example, a call to xQueueCreate()
|
||||
* returns an xQueueHandle variable that can then be used as a parameter to
|
||||
|
@ -109,17 +107,17 @@ typedef void * xQueueSetHandle;
|
|||
typedef void * xQueueSetMemberHandle;
|
||||
|
||||
/* For internal use only. */
|
||||
#define queueSEND_TO_BACK ( 0 )
|
||||
#define queueSEND_TO_FRONT ( 1 )
|
||||
#define queueOVERWRITE ( 2 )
|
||||
#define queueSEND_TO_BACK ( ( portBASE_TYPE ) 0 )
|
||||
#define queueSEND_TO_FRONT ( ( portBASE_TYPE ) 1 )
|
||||
#define queueOVERWRITE ( ( portBASE_TYPE ) 2 )
|
||||
|
||||
/* For internal use only. These definitions *must* match those in queue.c. */
|
||||
#define queueQUEUE_TYPE_BASE ( 0U )
|
||||
#define queueQUEUE_TYPE_SET ( 0U )
|
||||
#define queueQUEUE_TYPE_MUTEX ( 1U )
|
||||
#define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( 2U )
|
||||
#define queueQUEUE_TYPE_BINARY_SEMAPHORE ( 3U )
|
||||
#define queueQUEUE_TYPE_RECURSIVE_MUTEX ( 4U )
|
||||
#define queueQUEUE_TYPE_BASE ( ( unsigned char ) 0U )
|
||||
#define queueQUEUE_TYPE_SET ( ( unsigned char ) 0U )
|
||||
#define queueQUEUE_TYPE_MUTEX ( ( unsigned char ) 1U )
|
||||
#define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( ( unsigned char ) 2U )
|
||||
#define queueQUEUE_TYPE_BINARY_SEMAPHORE ( ( unsigned char ) 3U )
|
||||
#define queueQUEUE_TYPE_RECURSIVE_MUTEX ( ( unsigned char ) 4U )
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
|
@ -724,7 +722,7 @@ signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const
|
|||
* \defgroup xQueuePeekFromISR xQueuePeekFromISR
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue, void * const pvBuffer ) PRIVILEGED_FUNCTION;
|
||||
signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue, const void * const pvBuffer ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
|
@ -916,7 +914,7 @@ signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue, void * const pvBuff
|
|||
* \defgroup xQueueReceive xQueueReceive
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeek ) PRIVILEGED_FUNCTION;
|
||||
signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, const void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeek ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
|
@ -1405,7 +1403,7 @@ signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle xQueue, const void *
|
|||
* \defgroup xQueueReceiveFromISR xQueueReceiveFromISR
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||
signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, const void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/*
|
||||
* Utilities to query queues that are safe to use from an ISR. These utilities
|
||||
|
@ -1495,7 +1493,7 @@ portBASE_TYPE xQueueGiveMutexRecursive( xQueueHandle pxMutex ) PRIVILEGED_FUNCTI
|
|||
* @param pcName The name to be associated with the handle. This is the
|
||||
* name that the kernel aware debugger will display.
|
||||
*/
|
||||
#if configQUEUE_REGISTRY_SIZE > 0U
|
||||
#if configQUEUE_REGISTRY_SIZE > 0
|
||||
void vQueueAddToRegistry( xQueueHandle xQueue, signed char *pcName ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
|
@ -1509,7 +1507,7 @@ portBASE_TYPE xQueueGiveMutexRecursive( xQueueHandle pxMutex ) PRIVILEGED_FUNCTI
|
|||
*
|
||||
* @param xQueue The handle of the queue being removed from the registry.
|
||||
*/
|
||||
#if configQUEUE_REGISTRY_SIZE > 0U
|
||||
#if configQUEUE_REGISTRY_SIZE > 0
|
||||
void vQueueUnregisterQueue( xQueueHandle xQueue ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -73,8 +73,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef TASK_H
|
||||
#define TASK_H
|
||||
#ifndef INC_TASK_H
|
||||
#define INC_TASK_H
|
||||
|
||||
#ifndef INC_FREERTOS_H
|
||||
#error "include FreeRTOS.h must appear in source files before include task.h"
|
||||
|
@ -236,9 +236,9 @@ typedef enum
|
|||
#define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS()
|
||||
|
||||
/* Definitions returned by xTaskGetSchedulerState(). */
|
||||
#define taskSCHEDULER_NOT_STARTED 0
|
||||
#define taskSCHEDULER_RUNNING 1
|
||||
#define taskSCHEDULER_SUSPENDED 2
|
||||
#define taskSCHEDULER_NOT_STARTED ( ( portBASE_TYPE ) 0 )
|
||||
#define taskSCHEDULER_RUNNING ( ( portBASE_TYPE ) 1 )
|
||||
#define taskSCHEDULER_SUSPENDED ( ( portBASE_TYPE ) 2 )
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* TASK CREATION API
|
||||
|
@ -1016,7 +1016,7 @@ signed portBASE_TYPE xTaskResumeAll( void ) PRIVILEGED_FUNCTION;
|
|||
|
||||
/**
|
||||
* task. h
|
||||
* <pre>signed portBASE_TYPE xTaskIsTaskSuspended( xTaskHandle xTask );</pre>
|
||||
* <pre>signed portBASE_TYPE xTaskIsTaskSuspended( const xTaskHandle xTask );</pre>
|
||||
*
|
||||
* Utility task that simply returns pdTRUE if the task referenced by xTask is
|
||||
* currently in the Suspended state, or pdFALSE if the task referenced by xTask
|
||||
|
@ -1394,7 +1394,7 @@ portBASE_TYPE xTaskIncrementTick( void ) PRIVILEGED_FUNCTION;
|
|||
* portTICK_RATE_MS can be used to convert kernel ticks into a real time
|
||||
* period.
|
||||
*/
|
||||
void vTaskPlaceOnEventList( const xList * const pxEventList, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||
void vTaskPlaceOnEventList( xList * const pxEventList, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/*
|
||||
* THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
|
||||
|
@ -1409,7 +1409,7 @@ void vTaskPlaceOnEventList( const xList * const pxEventList, portTickType xTicks
|
|||
* @return pdTRUE if the task being removed has a higher priority than the task
|
||||
* making the call, otherwise pdFALSE.
|
||||
*/
|
||||
void vTaskPlaceOnEventListRestricted( const xList * const pxEventList, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||
void vTaskPlaceOnEventListRestricted( xList * const pxEventList, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/*
|
||||
* THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
|
||||
|
@ -1470,13 +1470,13 @@ portBASE_TYPE xTaskGetSchedulerState( void ) PRIVILEGED_FUNCTION;
|
|||
* Raises the priority of the mutex holder to that of the calling task should
|
||||
* the mutex holder have a priority less than the calling task.
|
||||
*/
|
||||
void vTaskPriorityInherit( xTaskHandle * const pxMutexHolder ) PRIVILEGED_FUNCTION;
|
||||
void vTaskPriorityInherit( xTaskHandle const pxMutexHolder ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/*
|
||||
* Set the priority of a task back to its proper priority in the case that it
|
||||
* inherited a higher priority while it was holding a semaphore.
|
||||
*/
|
||||
void vTaskPriorityDisinherit( xTaskHandle * const pxMutexHolder ) PRIVILEGED_FUNCTION;
|
||||
void vTaskPriorityDisinherit( xTaskHandle const pxMutexHolder ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/*
|
||||
* Generic version of the task creation function which is in turn called by the
|
||||
|
@ -1522,7 +1522,7 @@ eSleepModeStatus eTaskConfirmSleepModeStatus( void );
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* TASK_H */
|
||||
#endif /* INC_TASK_H */
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -80,9 +80,10 @@
|
|||
#error "include FreeRTOS.h must appear in source files before include timers.h"
|
||||
#endif
|
||||
|
||||
#include "portable.h"
|
||||
#include "list.h"
|
||||
/*lint -e537 This headers are only multiply included if the application code
|
||||
happens to also be including task.h. */
|
||||
#include "task.h"
|
||||
/*lint +e956 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -91,10 +92,10 @@ extern "C" {
|
|||
/* IDs for commands that can be sent/received on the timer queue. These are to
|
||||
be used solely through the macros that make up the public software timer API,
|
||||
as defined below. */
|
||||
#define tmrCOMMAND_START 0
|
||||
#define tmrCOMMAND_STOP 1
|
||||
#define tmrCOMMAND_CHANGE_PERIOD 2
|
||||
#define tmrCOMMAND_DELETE 3
|
||||
#define tmrCOMMAND_START ( ( portBASE_TYPE ) 0 )
|
||||
#define tmrCOMMAND_STOP ( ( portBASE_TYPE ) 1 )
|
||||
#define tmrCOMMAND_CHANGE_PERIOD ( ( portBASE_TYPE ) 2 )
|
||||
#define tmrCOMMAND_DELETE ( ( portBASE_TYPE ) 3 )
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* MACROS AND DEFINITIONS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue