Remove unnecessary use of portLONG, portCHAR and portSHORT.

pull/4/head
Richard Barry 16 years ago
parent 804d114420
commit 26f0258688

@ -87,7 +87,7 @@
/* Only the current stack state is to be checked. */ /* Only the current stack state is to be checked. */
#define taskFIRST_CHECK_FOR_STACK_OVERFLOW() \ #define taskFIRST_CHECK_FOR_STACK_OVERFLOW() \
{ \ { \
extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed portCHAR *pcTaskName ); \ extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName ); \
\ \
/* 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 ) \
@ -104,7 +104,7 @@
/* Only the current stack state is to be checked. */ /* Only the current stack state is to be checked. */
#define taskFIRST_CHECK_FOR_STACK_OVERFLOW() \ #define taskFIRST_CHECK_FOR_STACK_OVERFLOW() \
{ \ { \
extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed portCHAR *pcTaskName ); \ extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName ); \
\ \
/* 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 ) \
@ -120,8 +120,8 @@
#define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \ #define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \
{ \ { \
extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed portCHAR *pcTaskName ); \ extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName ); \
static const unsigned portCHAR ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ static const unsigned char 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, \
@ -142,9 +142,9 @@
#define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \ #define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \
{ \ { \
extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed portCHAR *pcTaskName ); \ extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName ); \
portCHAR *pcEndOfStack = ( portCHAR * ) pxCurrentTCB->pxEndOfStack; \ char *pcEndOfStack = ( char * ) pxCurrentTCB->pxEndOfStack; \
static const unsigned portCHAR ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ static const unsigned char 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, \

@ -76,7 +76,7 @@ typedef struct corCoRoutineControlBlock
xListItem xEventListItem; /*< List item used to place the CRCB in event lists. */ xListItem xEventListItem; /*< List item used to place the CRCB in event lists. */
unsigned portBASE_TYPE uxPriority; /*< The priority of the co-routine in relation to other co-routines. */ unsigned portBASE_TYPE uxPriority; /*< The priority of the co-routine in relation to other co-routines. */
unsigned portBASE_TYPE uxIndex; /*< Used to distinguish between co-routines when multiple co-routines use the same co-routine function. */ unsigned portBASE_TYPE uxIndex; /*< Used to distinguish between co-routines when multiple co-routines use the same co-routine function. */
unsigned portSHORT uxState; /*< Used internally by the co-routine implementation. */ unsigned short uxState; /*< Used internally by the co-routine implementation. */
} corCRCB; /* Co-routine control block. Note must be identical in size down to uxPriority with tskTCB. */ } corCRCB; /* Co-routine control block. Note must be identical in size down to uxPriority with tskTCB. */
/** /**
@ -208,7 +208,7 @@ void vCoRoutineSchedule( void );
void vACoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex ) void vACoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
{ {
// Variables in co-routines must be declared static if they must maintain value across a blocking call. // Variables in co-routines must be declared static if they must maintain value across a blocking call.
static portLONG ulAVariable; static long ulAVariable;
// Must start every co-routine with a call to crSTART(); // Must start every co-routine with a call to crSTART();
crSTART( xHandle ); crSTART( xHandle );
@ -239,7 +239,7 @@ void vCoRoutineSchedule( void );
void vACoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex ) void vACoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
{ {
// Variables in co-routines must be declared static if they must maintain value across a blocking call. // Variables in co-routines must be declared static if they must maintain value across a blocking call.
static portLONG ulAVariable; static long ulAVariable;
// Must start every co-routine with a call to crSTART(); // Must start every co-routine with a call to crSTART();
crSTART( xHandle ); crSTART( xHandle );
@ -553,7 +553,7 @@ void vCoRoutineSchedule( void );
// A co-routine that blocks on a queue waiting for characters to be received. // A co-routine that blocks on a queue waiting for characters to be received.
static void vReceivingCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex ) static void vReceivingCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
{ {
portCHAR cRxedChar; char cRxedChar;
portBASE_TYPE xResult; portBASE_TYPE xResult;
// All co-routines must start with a call to crSTART(). // All co-routines must start with a call to crSTART().
@ -580,7 +580,7 @@ void vCoRoutineSchedule( void );
// a co-routine. // a co-routine.
void vUART_ISR( void ) void vUART_ISR( void )
{ {
portCHAR cRxedChar; char cRxedChar;
portBASE_TYPE xCRWokenByPost = pdFALSE; portBASE_TYPE xCRWokenByPost = pdFALSE;
// We loop around reading characters until there are none left in the UART. // We loop around reading characters until there are none left in the UART.
@ -653,7 +653,7 @@ void vCoRoutineSchedule( void );
{ {
// cChar holds its value while this co-routine is blocked and must therefore // cChar holds its value while this co-routine is blocked and must therefore
// be declared static. // be declared static.
static portCHAR cCharToTx = 'a'; static char cCharToTx = 'a';
portBASE_TYPE xResult; portBASE_TYPE xResult;
// All co-routines must start with a call to crSTART(). // All co-routines must start with a call to crSTART().
@ -696,7 +696,7 @@ void vCoRoutineSchedule( void );
// An ISR that uses a queue to receive characters to send on a UART. // An ISR that uses a queue to receive characters to send on a UART.
void vUART_ISR( void ) void vUART_ISR( void )
{ {
portCHAR cCharToTx; char cCharToTx;
portBASE_TYPE xCRWokenByPost = pdFALSE; portBASE_TYPE xCRWokenByPost = pdFALSE;
while( UART_TX_REG_EMPTY() ) while( UART_TX_REG_EMPTY() )

@ -98,8 +98,8 @@ typedef void * xQueueHandle;
<pre> <pre>
struct AMessage struct AMessage
{ {
portCHAR ucMessageID; char ucMessageID;
portCHAR ucData[ 20 ]; char ucData[ 20 ];
}; };
void vATask( void *pvParameters ) void vATask( void *pvParameters )
@ -107,7 +107,7 @@ typedef void * xQueueHandle;
xQueueHandle xQueue1, xQueue2; xQueueHandle xQueue1, xQueue2;
// Create a queue capable of containing 10 unsigned long values. // Create a queue capable of containing 10 unsigned long values.
xQueue1 = xQueueCreate( 10, sizeof( unsigned portLONG ) ); xQueue1 = xQueueCreate( 10, sizeof( unsigned long ) );
if( xQueue1 == 0 ) if( xQueue1 == 0 )
{ {
// Queue was not created and must not be used. // Queue was not created and must not be used.
@ -165,11 +165,11 @@ xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBA
<pre> <pre>
struct AMessage struct AMessage
{ {
portCHAR ucMessageID; char ucMessageID;
portCHAR ucData[ 20 ]; char ucData[ 20 ];
} xMessage; } xMessage;
unsigned portLONG ulVar = 10UL; unsigned long ulVar = 10UL;
void vATask( void *pvParameters ) void vATask( void *pvParameters )
{ {
@ -177,7 +177,7 @@ xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBA
struct AMessage *pxMessage; struct AMessage *pxMessage;
// Create a queue capable of containing 10 unsigned long values. // Create a queue capable of containing 10 unsigned long values.
xQueue1 = xQueueCreate( 10, sizeof( unsigned portLONG ) ); xQueue1 = xQueueCreate( 10, sizeof( unsigned long ) );
// Create a queue capable of containing 10 pointers to AMessage structures. // Create a queue capable of containing 10 pointers to AMessage structures.
// These should be passed by pointer as they contain a lot of data. // These should be passed by pointer as they contain a lot of data.
@ -247,11 +247,11 @@ xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBA
<pre> <pre>
struct AMessage struct AMessage
{ {
portCHAR ucMessageID; char ucMessageID;
portCHAR ucData[ 20 ]; char ucData[ 20 ];
} xMessage; } xMessage;
unsigned portLONG ulVar = 10UL; unsigned long ulVar = 10UL;
void vATask( void *pvParameters ) void vATask( void *pvParameters )
{ {
@ -259,7 +259,7 @@ xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBA
struct AMessage *pxMessage; struct AMessage *pxMessage;
// Create a queue capable of containing 10 unsigned long values. // Create a queue capable of containing 10 unsigned long values.
xQueue1 = xQueueCreate( 10, sizeof( unsigned portLONG ) ); xQueue1 = xQueueCreate( 10, sizeof( unsigned long ) );
// Create a queue capable of containing 10 pointers to AMessage structures. // Create a queue capable of containing 10 pointers to AMessage structures.
// These should be passed by pointer as they contain a lot of data. // These should be passed by pointer as they contain a lot of data.
@ -331,11 +331,11 @@ xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBA
<pre> <pre>
struct AMessage struct AMessage
{ {
portCHAR ucMessageID; char ucMessageID;
portCHAR ucData[ 20 ]; char ucData[ 20 ];
} xMessage; } xMessage;
unsigned portLONG ulVar = 10UL; unsigned long ulVar = 10UL;
void vATask( void *pvParameters ) void vATask( void *pvParameters )
{ {
@ -343,7 +343,7 @@ xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBA
struct AMessage *pxMessage; struct AMessage *pxMessage;
// Create a queue capable of containing 10 unsigned long values. // Create a queue capable of containing 10 unsigned long values.
xQueue1 = xQueueCreate( 10, sizeof( unsigned portLONG ) ); xQueue1 = xQueueCreate( 10, sizeof( unsigned long ) );
// Create a queue capable of containing 10 pointers to AMessage structures. // Create a queue capable of containing 10 pointers to AMessage structures.
// These should be passed by pointer as they contain a lot of data. // These should be passed by pointer as they contain a lot of data.
@ -419,11 +419,11 @@ xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBA
<pre> <pre>
struct AMessage struct AMessage
{ {
portCHAR ucMessageID; char ucMessageID;
portCHAR ucData[ 20 ]; char ucData[ 20 ];
} xMessage; } xMessage;
unsigned portLONG ulVar = 10UL; unsigned long ulVar = 10UL;
void vATask( void *pvParameters ) void vATask( void *pvParameters )
{ {
@ -431,7 +431,7 @@ xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBA
struct AMessage *pxMessage; struct AMessage *pxMessage;
// Create a queue capable of containing 10 unsigned long values. // Create a queue capable of containing 10 unsigned long values.
xQueue1 = xQueueCreate( 10, sizeof( unsigned portLONG ) ); xQueue1 = xQueueCreate( 10, sizeof( unsigned long ) );
// Create a queue capable of containing 10 pointers to AMessage structures. // Create a queue capable of containing 10 pointers to AMessage structures.
// These should be passed by pointer as they contain a lot of data. // These should be passed by pointer as they contain a lot of data.
@ -506,8 +506,8 @@ signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const
<pre> <pre>
struct AMessage struct AMessage
{ {
portCHAR ucMessageID; char ucMessageID;
portCHAR ucData[ 20 ]; char ucData[ 20 ];
} xMessage; } xMessage;
xQueueHandle xQueue; xQueueHandle xQueue;
@ -599,8 +599,8 @@ signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const
<pre> <pre>
struct AMessage struct AMessage
{ {
portCHAR ucMessageID; char ucMessageID;
portCHAR ucData[ 20 ]; char ucData[ 20 ];
} xMessage; } xMessage;
xQueueHandle xQueue; xQueueHandle xQueue;
@ -698,8 +698,8 @@ signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const
<pre> <pre>
struct AMessage struct AMessage
{ {
portCHAR ucMessageID; char ucMessageID;
portCHAR ucData[ 20 ]; char ucData[ 20 ];
} xMessage; } xMessage;
xQueueHandle xQueue; xQueueHandle xQueue;
@ -820,7 +820,7 @@ void vQueueDelete( xQueueHandle xQueue );
<pre> <pre>
void vBufferISR( void ) void vBufferISR( void )
{ {
portCHAR cIn; char cIn;
portBASE_TYPE xHigherPrioritTaskWoken; portBASE_TYPE xHigherPrioritTaskWoken;
// We have not woken a task at the start of the ISR. // We have not woken a task at the start of the ISR.
@ -891,7 +891,7 @@ void vQueueDelete( xQueueHandle xQueue );
<pre> <pre>
void vBufferISR( void ) void vBufferISR( void )
{ {
portCHAR cIn; char cIn;
portBASE_TYPE xHigherPriorityTaskWoken; portBASE_TYPE xHigherPriorityTaskWoken;
// We have not woken a task at the start of the ISR. // We have not woken a task at the start of the ISR.
@ -964,7 +964,7 @@ void vQueueDelete( xQueueHandle xQueue );
<pre> <pre>
void vBufferISR( void ) void vBufferISR( void )
{ {
portCHAR cIn; char cIn;
portBASE_TYPE xHigherPriorityTaskWoken; portBASE_TYPE xHigherPriorityTaskWoken;
// We have not woken a task at the start of the ISR. // We have not woken a task at the start of the ISR.
@ -1042,7 +1042,7 @@ void vQueueDelete( xQueueHandle xQueue );
<pre> <pre>
void vBufferISR( void ) void vBufferISR( void )
{ {
portCHAR cIn; char cIn;
portBASE_TYPE xHigherPriorityTaskWokenByPost; portBASE_TYPE xHigherPriorityTaskWokenByPost;
// We have not woken a task at the start of the ISR. // We have not woken a task at the start of the ISR.
@ -1108,11 +1108,11 @@ signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void
// Function to create a queue and post some values. // Function to create a queue and post some values.
void vAFunction( void *pvParameters ) void vAFunction( void *pvParameters )
{ {
portCHAR cValueToPost; char cValueToPost;
const portTickType xBlockTime = ( portTickType )0xff; const portTickType xBlockTime = ( portTickType )0xff;
// Create a queue capable of containing 10 characters. // Create a queue capable of containing 10 characters.
xQueue = xQueueCreate( 10, sizeof( portCHAR ) ); xQueue = xQueueCreate( 10, sizeof( char ) );
if( xQueue == 0 ) if( xQueue == 0 )
{ {
// Failed to create the queue. // Failed to create the queue.
@ -1138,7 +1138,7 @@ signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void
void vISR_Routine( void ) void vISR_Routine( void )
{ {
portBASE_TYPE xTaskWokenByReceive = pdFALSE; portBASE_TYPE xTaskWokenByReceive = pdFALSE;
portCHAR cRxedChar; char cRxedChar;
while( xQueueReceiveFromISR( xQueue, ( void * ) &cRxedChar, &xTaskWokenByReceive) ) while( xQueueReceiveFromISR( xQueue, ( void * ) &cRxedChar, &xTaskWokenByReceive) )
{ {
@ -1151,7 +1151,7 @@ signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void
// task will be woken. // task will be woken.
} }
if( cTaskWokenByPost != ( portCHAR ) pdFALSE; if( cTaskWokenByPost != ( char ) pdFALSE;
{ {
taskYIELD (); taskYIELD ();
} }
@ -1241,7 +1241,7 @@ portBASE_TYPE xQueueGiveMutexRecursive( xQueueHandle xMutex );
* name that the kernel aware debugger will display. * name that the kernel aware debugger will display.
*/ */
#if configQUEUE_REGISTRY_SIZE > 0 #if configQUEUE_REGISTRY_SIZE > 0
void vQueueAddToRegistry( xQueueHandle xQueue, signed portCHAR *pcName ); void vQueueAddToRegistry( xQueueHandle xQueue, signed char *pcName );
#endif #endif

@ -56,8 +56,8 @@
typedef xQueueHandle xSemaphoreHandle; typedef xQueueHandle xSemaphoreHandle;
#define semBINARY_SEMAPHORE_QUEUE_LENGTH ( ( unsigned portCHAR ) 1 ) #define semBINARY_SEMAPHORE_QUEUE_LENGTH ( ( unsigned char ) 1 )
#define semSEMAPHORE_QUEUE_ITEM_LENGTH ( ( unsigned portCHAR ) 0 ) #define semSEMAPHORE_QUEUE_ITEM_LENGTH ( ( unsigned char ) 0 )
#define semGIVE_BLOCK_TIME ( ( portTickType ) 0 ) #define semGIVE_BLOCK_TIME ( ( portTickType ) 0 )
@ -502,7 +502,7 @@ typedef xQueueHandle xSemaphoreHandle;
// Timer ISR // Timer ISR
void vTimerISR( void * pvParameters ) void vTimerISR( void * pvParameters )
{ {
static unsigned portCHAR ucLocalTickCount = 0; static unsigned char ucLocalTickCount = 0;
static portBASE_TYPE xHigherPriorityTaskWoken; static portBASE_TYPE xHigherPriorityTaskWoken;
// A timer tick has occurred. // A timer tick has occurred.

@ -95,8 +95,8 @@ typedef struct xTIME_OUT
typedef struct xMEMORY_REGION typedef struct xMEMORY_REGION
{ {
void *pvBaseAddress; void *pvBaseAddress;
unsigned portLONG ulLengthInBytes; unsigned long ulLengthInBytes;
unsigned portLONG ulParameters; unsigned long ulParameters;
} xMemoryRegion; } xMemoryRegion;
/* /*
@ -105,8 +105,8 @@ typedef struct xMEMORY_REGION
typedef struct xTASK_PARAMTERS typedef struct xTASK_PARAMTERS
{ {
pdTASK_CODE pvTaskCode; pdTASK_CODE pvTaskCode;
const signed portCHAR * const pcName; const signed char * const pcName;
unsigned portSHORT usStackDepth; unsigned short usStackDepth;
void *pvParameters; void *pvParameters;
unsigned portBASE_TYPE uxPriority; unsigned portBASE_TYPE uxPriority;
portSTACK_TYPE *puxStackBuffer; portSTACK_TYPE *puxStackBuffer;
@ -192,8 +192,8 @@ typedef struct xTASK_PARAMTERS
*<pre> *<pre>
portBASE_TYPE xTaskCreate( portBASE_TYPE xTaskCreate(
pdTASK_CODE pvTaskCode, pdTASK_CODE pvTaskCode,
const portCHAR * const pcName, const char * const pcName,
unsigned portSHORT usStackDepth, unsigned short usStackDepth,
void *pvParameters, void *pvParameters,
unsigned portBASE_TYPE uxPriority, unsigned portBASE_TYPE uxPriority,
xTaskHandle *pvCreatedTask xTaskHandle *pvCreatedTask
@ -894,7 +894,7 @@ void vTaskSuspendAll( void ) PRIVILEGED_FUNCTION;
/** /**
* task. h * task. h
* <pre>portCHAR xTaskResumeAll( void );</pre> * <pre>char xTaskResumeAll( void );</pre>
* *
* Resumes real time kernel activity following a call to vTaskSuspendAll (). * Resumes real time kernel activity following a call to vTaskSuspendAll ().
* After a call to vTaskSuspendAll () the kernel will take control of which * After a call to vTaskSuspendAll () the kernel will take control of which
@ -972,7 +972,7 @@ portTickType xTaskGetTickCount( void ) PRIVILEGED_FUNCTION;
/** /**
* task. h * task. h
* <PRE>unsigned portSHORT uxTaskGetNumberOfTasks( void );</PRE> * <PRE>unsigned short uxTaskGetNumberOfTasks( void );</PRE>
* *
* @return The number of tasks that the real time kernel is currently managing. * @return The number of tasks that the real time kernel is currently managing.
* This includes all ready, blocked and suspended tasks. A task that * This includes all ready, blocked and suspended tasks. A task that
@ -986,7 +986,7 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void ) PRIVILEGED_FUNCTION;
/** /**
* task. h * task. h
* <PRE>void vTaskList( portCHAR *pcWriteBuffer );</PRE> * <PRE>void vTaskList( char *pcWriteBuffer );</PRE>
* *
* configUSE_TRACE_FACILITY must be defined as 1 for this function to be * configUSE_TRACE_FACILITY must be defined as 1 for this function to be
* available. See the configuration section for more information. * available. See the configuration section for more information.
@ -1008,11 +1008,11 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void ) PRIVILEGED_FUNCTION;
* \page vTaskList vTaskList * \page vTaskList vTaskList
* \ingroup TaskUtils * \ingroup TaskUtils
*/ */
void vTaskList( signed portCHAR *pcWriteBuffer ) PRIVILEGED_FUNCTION; void vTaskList( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION;
/** /**
* task. h * task. h
* <PRE>void vTaskGetRunTimeStats( portCHAR *pcWriteBuffer );</PRE> * <PRE>void vTaskGetRunTimeStats( char *pcWriteBuffer );</PRE>
* *
* configGENERATE_RUN_TIME_STATS must be defined as 1 for this function * configGENERATE_RUN_TIME_STATS must be defined as 1 for this function
* to be available. The application must also then provide definitions * to be available. The application must also then provide definitions
@ -1040,11 +1040,11 @@ void vTaskList( signed portCHAR *pcWriteBuffer ) PRIVILEGED_FUNCTION;
* \page vTaskGetRunTimeStats vTaskGetRunTimeStats * \page vTaskGetRunTimeStats vTaskGetRunTimeStats
* \ingroup TaskUtils * \ingroup TaskUtils
*/ */
void vTaskGetRunTimeStats( signed portCHAR *pcWriteBuffer ) PRIVILEGED_FUNCTION; void vTaskGetRunTimeStats( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION;
/** /**
* task. h * task. h
* <PRE>void vTaskStartTrace( portCHAR * pcBuffer, unsigned portBASE_TYPE uxBufferSize );</PRE> * <PRE>void vTaskStartTrace( char * pcBuffer, unsigned portBASE_TYPE uxBufferSize );</PRE>
* *
* Starts a real time kernel activity trace. The trace logs the identity of * Starts a real time kernel activity trace. The trace logs the identity of
* which task is running when. * which task is running when.
@ -1061,11 +1061,11 @@ void vTaskGetRunTimeStats( signed portCHAR *pcWriteBuffer ) PRIVILEGED_FUNCTION;
* \page vTaskStartTrace vTaskStartTrace * \page vTaskStartTrace vTaskStartTrace
* \ingroup TaskUtils * \ingroup TaskUtils
*/ */
void vTaskStartTrace( signed portCHAR * pcBuffer, unsigned portLONG ulBufferSize ) PRIVILEGED_FUNCTION; void vTaskStartTrace( signed char * pcBuffer, unsigned long ulBufferSize ) PRIVILEGED_FUNCTION;
/** /**
* task. h * task. h
* <PRE>unsigned portLONG ulTaskEndTrace( void );</PRE> * <PRE>unsigned long ulTaskEndTrace( void );</PRE>
* *
* Stops a kernel activity trace. See vTaskStartTrace (). * Stops a kernel activity trace. See vTaskStartTrace ().
* *
@ -1074,7 +1074,7 @@ void vTaskStartTrace( signed portCHAR * pcBuffer, unsigned portLONG ulBufferSize
* \page usTaskEndTrace usTaskEndTrace * \page usTaskEndTrace usTaskEndTrace
* \ingroup TaskUtils * \ingroup TaskUtils
*/ */
unsigned portLONG ulTaskEndTrace( void ) PRIVILEGED_FUNCTION; unsigned long ulTaskEndTrace( void ) PRIVILEGED_FUNCTION;
/** /**
* task.h * task.h
@ -1250,7 +1250,7 @@ void vTaskPriorityDisinherit( xTaskHandle * const pxMutexHolder ) PRIVILEGED_FUN
* Generic version of the task creation function which is in turn called by the * Generic version of the task creation function which is in turn called by the
* xTaskCreate() and xTaskCreateProtected() macros. * xTaskCreate() and xTaskCreateProtected() macros.
*/ */
signed portBASE_TYPE xTaskGenericCreate( pdTASK_CODE pvTaskCode, const signed portCHAR * const pcName, unsigned portSHORT usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions ) PRIVILEGED_FUNCTION; signed portBASE_TYPE xTaskGenericCreate( pdTASK_CODE pvTaskCode, const signed char * const pcName, unsigned short usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions ) PRIVILEGED_FUNCTION;
#ifdef __cplusplus #ifdef __cplusplus
} }

@ -62,18 +62,18 @@ task.h is included from an application file. */
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/* Constants required to access and manipulate the NVIC. */ /* Constants required to access and manipulate the NVIC. */
#define portNVIC_SYSTICK_CTRL ( ( volatile unsigned portLONG * ) 0xe000e010 ) #define portNVIC_SYSTICK_CTRL ( ( volatile unsigned long * ) 0xe000e010 )
#define portNVIC_SYSTICK_LOAD ( ( volatile unsigned portLONG * ) 0xe000e014 ) #define portNVIC_SYSTICK_LOAD ( ( volatile unsigned long * ) 0xe000e014 )
#define portNVIC_SYSPRI2 ( ( volatile unsigned portLONG * ) 0xe000ed20 ) #define portNVIC_SYSPRI2 ( ( volatile unsigned long * ) 0xe000ed20 )
#define portNVIC_SYSPRI1 ( ( volatile unsigned portLONG * ) 0xe000ed1c ) #define portNVIC_SYSPRI1 ( ( volatile unsigned long * ) 0xe000ed1c )
#define portNVIC_SYS_CTRL_STATE ( ( volatile unsigned portLONG * ) 0xe000ed24 ) #define portNVIC_SYS_CTRL_STATE ( ( volatile unsigned long * ) 0xe000ed24 )
#define portNVIC_MEM_FAULT_ENABLE ( 1UL << 16UL ) #define portNVIC_MEM_FAULT_ENABLE ( 1UL << 16UL )
/* Constants required to access and manipulate the MPU. */ /* Constants required to access and manipulate the MPU. */
#define portMPU_TYPE ( ( volatile unsigned portLONG * ) 0xe000ed90 ) #define portMPU_TYPE ( ( volatile unsigned long * ) 0xe000ed90 )
#define portMPU_REGION_BASE_ADDRESS ( ( volatile unsigned portLONG * ) 0xe000ed9C ) #define portMPU_REGION_BASE_ADDRESS ( ( volatile unsigned long * ) 0xe000ed9C )
#define portMPU_REGION_ATTRIBUTE ( ( volatile unsigned portLONG * ) 0xe000edA0 ) #define portMPU_REGION_ATTRIBUTE ( ( volatile unsigned long * ) 0xe000edA0 )
#define portMPU_CTRL ( ( volatile unsigned portLONG * ) 0xe000ed94 ) #define portMPU_CTRL ( ( volatile unsigned long * ) 0xe000ed94 )
#define portEXPECTED_MPU_TYPE_VALUE ( 8UL << 8UL ) /* 8 regions, unified. */ #define portEXPECTED_MPU_TYPE_VALUE ( 8UL << 8UL ) /* 8 regions, unified. */
#define portMPU_ENABLE ( 0x01UL ) #define portMPU_ENABLE ( 0x01UL )
#define portMPU_BACKGROUND_ENABLE ( 1UL << 2UL ) #define portMPU_BACKGROUND_ENABLE ( 1UL << 2UL )
@ -87,9 +87,9 @@ task.h is included from an application file. */
#define portNVIC_SYSTICK_CLK ( 0x00000004UL ) #define portNVIC_SYSTICK_CLK ( 0x00000004UL )
#define portNVIC_SYSTICK_INT ( 0x00000002UL ) #define portNVIC_SYSTICK_INT ( 0x00000002UL )
#define portNVIC_SYSTICK_ENABLE ( 0x00000001UL ) #define portNVIC_SYSTICK_ENABLE ( 0x00000001UL )
#define portNVIC_PENDSV_PRI ( ( ( unsigned portLONG ) configKERNEL_INTERRUPT_PRIORITY ) << 16UL ) #define portNVIC_PENDSV_PRI ( ( ( unsigned long ) configKERNEL_INTERRUPT_PRIORITY ) << 16UL )
#define portNVIC_SYSTICK_PRI ( ( ( unsigned portLONG ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL ) #define portNVIC_SYSTICK_PRI ( ( ( unsigned long ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL )
#define portNVIC_SVC_PRI ( ( ( unsigned portLONG ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL ) #define portNVIC_SVC_PRI ( ( ( unsigned long ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL )
#define portNVIC_TEMP_SVC_PRI ( 0x01UL << 24UL ) #define portNVIC_TEMP_SVC_PRI ( 0x01UL << 24UL )
/* Constants required to set up the initial stack. */ /* Constants required to set up the initial stack. */
@ -111,44 +111,44 @@ static unsigned portBASE_TYPE uxCriticalNesting = 0xaaaaaaaa;
/* /*
* Setup the timer to generate the tick interrupts. * Setup the timer to generate the tick interrupts.
*/ */
static void prvSetupTimerInterrupt( void ); static void prvSetupTimerInterrupt( void ) PRIVILEGED_FUNCTION;
/* /*
* Configure a number of standard MPU regions that are used by all tasks. * Configure a number of standard MPU regions that are used by all tasks.
*/ */
static void prvSetupMPU( void ); static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
/* /*
* Return the smallest MPU region size that a given number of bytes will fit * Return the smallest MPU region size that a given number of bytes will fit
* into. The region size is returned as the value that should be programmed * into. The region size is returned as the value that should be programmed
* into the region attribute register for that region. * into the region attribute register for that region.
*/ */
static unsigned long prvGetMPURegionSizeSetting( unsigned long ulActualSizeInBytes ); static unsigned long prvGetMPURegionSizeSetting( unsigned long ulActualSizeInBytes ) PRIVILEGED_FUNCTION;
/* /*
* Checks to see if being called from the context of an unprivileged task, and * Checks to see if being called from the context of an unprivileged task, and
* if so raises the privilege level and returns false - otherwise does nothing * if so raises the privilege level and returns false - otherwise does nothing
* other than return true. * other than return true.
*/ */
portBASE_TYPE prvRaisePrivilege( void ) __attribute__(( naked )); static portBASE_TYPE prvRaisePrivilege( void ) __attribute__(( naked ));
/* /*
* Standard FreeRTOS exception handlers. * Standard FreeRTOS exception handlers.
*/ */
void xPortPendSVHandler( void ) __attribute__ (( naked )); void xPortPendSVHandler( void ) __attribute__ (( naked )) PRIVILEGED_FUNCTION;
void xPortSysTickHandler( void ) __attribute__ ((optimize("3"))); void xPortSysTickHandler( void ) __attribute__ ((optimize("3"))) PRIVILEGED_FUNCTION;
void vPortSVCHandler( void ) __attribute__ (( naked )); void vPortSVCHandler( void ) __attribute__ (( naked )) PRIVILEGED_FUNCTION;
/* /*
* Starts the scheduler by restoring the context of the first task to run. * Starts the scheduler by restoring the context of the first task to run.
*/ */
static void prvRestoreContextOfFirstTask( void ) __attribute__(( naked )); static void prvRestoreContextOfFirstTask( void ) __attribute__(( naked )) PRIVILEGED_FUNCTION;
/* /*
* C portion of the SVC handler. The SVC handler is split between an asm entry * C portion of the SVC handler. The SVC handler is split between an asm entry
* and a C wrapper for simplicity of coding and maintenance. * and a C wrapper for simplicity of coding and maintenance.
*/ */
static void prvSVCHandler( unsigned long *pulRegisters ) __attribute__ ((optimize("3"))); static void prvSVCHandler( unsigned long *pulRegisters ) __attribute__ ((optimize("3"))) PRIVILEGED_FUNCTION;
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -366,7 +366,7 @@ void xPortPendSVHandler( void )
void xPortSysTickHandler( void ) void xPortSysTickHandler( void )
{ {
unsigned portLONG ulDummy; unsigned long ulDummy;
/* If using preemption, also force a context switch. */ /* If using preemption, also force a context switch. */
#if configUSE_PREEMPTION == 1 #if configUSE_PREEMPTION == 1
@ -480,7 +480,7 @@ unsigned long ulRegionSize, ulReturnValue = 4;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
portBASE_TYPE prvRaisePrivilege( void ) static portBASE_TYPE prvRaisePrivilege( void )
{ {
__asm volatile __asm volatile
( (
@ -498,7 +498,7 @@ portBASE_TYPE prvRaisePrivilege( void )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, portSTACK_TYPE *pxBottomOfStack, unsigned portSHORT usStackDepth ) void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, portSTACK_TYPE *pxBottomOfStack, unsigned short usStackDepth )
{ {
extern unsigned long __SRAM_segment_start__[]; extern unsigned long __SRAM_segment_start__[];
extern unsigned long __SRAM_segment_end__[]; extern unsigned long __SRAM_segment_end__[];
@ -594,7 +594,7 @@ unsigned long ul;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
signed portBASE_TYPE MPU_xTaskGenericCreate( pdTASK_CODE pvTaskCode, const signed portCHAR * const pcName, unsigned portSHORT usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions ) signed portBASE_TYPE MPU_xTaskGenericCreate( pdTASK_CODE pvTaskCode, const signed char * const pcName, unsigned short usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions )
{ {
signed portBASE_TYPE xReturn; signed portBASE_TYPE xReturn;
portBASE_TYPE xRunningPrivileged = prvRaisePrivilege(); portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();
@ -748,7 +748,7 @@ portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void MPU_vTaskList( signed portCHAR *pcWriteBuffer ) void MPU_vTaskList( signed char *pcWriteBuffer )
{ {
portBASE_TYPE xRunningPrivileged = prvRaisePrivilege(); portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();
@ -759,7 +759,7 @@ portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if ( configGENERATE_RUN_TIME_STATS == 1 ) #if ( configGENERATE_RUN_TIME_STATS == 1 )
void MPU_vTaskGetRunTimeStats( signed portCHAR *pcWriteBuffer ) void MPU_vTaskGetRunTimeStats( signed char *pcWriteBuffer )
{ {
portBASE_TYPE xRunningPrivileged = prvRaisePrivilege(); portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();
@ -770,7 +770,7 @@ portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if ( configUSE_TRACE_FACILITY == 1 ) #if ( configUSE_TRACE_FACILITY == 1 )
void MPU_vTaskStartTrace( signed portCHAR * pcBuffer, unsigned portLONG ulBufferSize ) void MPU_vTaskStartTrace( signed char * pcBuffer, unsigned long ulBufferSize )
{ {
portBASE_TYPE xRunningPrivileged = prvRaisePrivilege(); portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();
@ -781,9 +781,9 @@ portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if ( configUSE_TRACE_FACILITY == 1 ) #if ( configUSE_TRACE_FACILITY == 1 )
unsigned portLONG MPU_ulTaskEndTrace( void ) unsigned long MPU_ulTaskEndTrace( void )
{ {
unsigned portLONG ulReturn; unsigned long ulReturn;
portBASE_TYPE xRunningPrivileged = prvRaisePrivilege(); portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();
ulReturn = ulTaskEndTrace(); ulReturn = ulTaskEndTrace();
@ -992,7 +992,7 @@ signed portBASE_TYPE xReturn;
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if configQUEUE_REGISTRY_SIZE > 0 #if configQUEUE_REGISTRY_SIZE > 0
void MPU_vQueueAddToRegistry( xQueueHandle xQueue, signed portCHAR *pcName ) void MPU_vQueueAddToRegistry( xQueueHandle xQueue, signed char *pcName )
{ {
portBASE_TYPE xRunningPrivileged = prvRaisePrivilege(); portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();

@ -91,11 +91,11 @@ zero. */
*/ */
typedef struct QueueDefinition typedef struct QueueDefinition
{ {
signed portCHAR *pcHead; /*< Points to the beginning of the queue storage area. */ signed char *pcHead; /*< Points to the beginning of the queue storage area. */
signed portCHAR *pcTail; /*< Points to the byte at the end of the queue storage area. Once more byte is allocated than necessary to store the queue items, this is used as a marker. */ signed char *pcTail; /*< Points to the byte at the end of the queue storage area. Once more byte is allocated than necessary to store the queue items, this is used as a marker. */
signed portCHAR *pcWriteTo; /*< Points to the free next place in the storage area. */ signed char *pcWriteTo; /*< Points to the free next place in the storage area. */
signed portCHAR *pcReadFrom; /*< Points to the last place that a queued item was read from. */ signed char *pcReadFrom; /*< Points to the last place that a queued item was read from. */
xList xTasksWaitingToSend; /*< List of tasks that are blocked waiting to post onto this queue. Stored in priority order. */ xList xTasksWaitingToSend; /*< List of tasks that are blocked waiting to post onto this queue. Stored in priority order. */
xList xTasksWaitingToReceive; /*< List of tasks that are blocked waiting to read from this queue. Stored in priority order. */ xList xTasksWaitingToReceive; /*< List of tasks that are blocked waiting to read from this queue. Stored in priority order. */
@ -161,7 +161,7 @@ unsigned portBASE_TYPE uxQueueMessagesWaitingFromISR( const xQueueHandle pxQueue
more user friendly. */ more user friendly. */
typedef struct QUEUE_REGISTRY_ITEM typedef struct QUEUE_REGISTRY_ITEM
{ {
signed portCHAR *pcQueueName; signed char *pcQueueName;
xQueueHandle xHandle; xQueueHandle xHandle;
} xQueueRegistryItem; } xQueueRegistryItem;
@ -173,7 +173,7 @@ unsigned portBASE_TYPE uxQueueMessagesWaitingFromISR( const xQueueHandle pxQueue
/* Removes a queue from the registry by simply setting the pcQueueName /* Removes a queue from the registry by simply setting the pcQueueName
member to NULL. */ member to NULL. */
static void vQueueUnregisterQueue( xQueueHandle xQueue ) PRIVILEGED_FUNCTION; static void vQueueUnregisterQueue( xQueueHandle xQueue ) PRIVILEGED_FUNCTION;
void vQueueAddToRegistry( xQueueHandle xQueue, signed portCHAR *pcQueueName ) PRIVILEGED_FUNCTION; void vQueueAddToRegistry( xQueueHandle xQueue, signed char *pcQueueName ) PRIVILEGED_FUNCTION;
#endif #endif
/* /*
@ -253,7 +253,7 @@ size_t xQueueSizeInBytes;
longer than asked for to make wrap checking easier/faster. */ longer than asked for to make wrap checking easier/faster. */
xQueueSizeInBytes = ( size_t ) ( uxQueueLength * uxItemSize ) + ( size_t ) 1; xQueueSizeInBytes = ( size_t ) ( uxQueueLength * uxItemSize ) + ( size_t ) 1;
pxNewQueue->pcHead = ( signed portCHAR * ) pvPortMalloc( xQueueSizeInBytes ); pxNewQueue->pcHead = ( signed char * ) pvPortMalloc( xQueueSizeInBytes );
if( pxNewQueue->pcHead != NULL ) if( pxNewQueue->pcHead != NULL )
{ {
/* Initialise the queue members as described above where the /* Initialise the queue members as described above where the
@ -638,7 +638,7 @@ xTimeOutType xTimeOut;
{ {
signed portBASE_TYPE xEntryTimeSet = pdFALSE; signed portBASE_TYPE xEntryTimeSet = pdFALSE;
xTimeOutType xTimeOut; xTimeOutType xTimeOut;
signed portCHAR *pcOriginalReadPosition; signed char *pcOriginalReadPosition;
for( ;; ) for( ;; )
{ {
@ -815,7 +815,7 @@ signed portBASE_TYPE xQueueGenericReceive( xQueueHandle pxQueue, void * const pv
{ {
signed portBASE_TYPE xEntryTimeSet = pdFALSE; signed portBASE_TYPE xEntryTimeSet = pdFALSE;
xTimeOutType xTimeOut; xTimeOutType xTimeOut;
signed portCHAR *pcOriginalReadPosition; signed char *pcOriginalReadPosition;
/* This function relaxes the coding standard somewhat to allow return /* This function relaxes the coding standard somewhat to allow return
statements within the function itself. This is done in the interest statements within the function itself. This is done in the interest
@ -1414,7 +1414,7 @@ signed portBASE_TYPE xReturn;
#if configQUEUE_REGISTRY_SIZE > 0 #if configQUEUE_REGISTRY_SIZE > 0
void vQueueAddToRegistry( xQueueHandle xQueue, signed portCHAR *pcQueueName ) void vQueueAddToRegistry( xQueueHandle xQueue, signed char *pcQueueName )
{ {
unsigned portBASE_TYPE ux; unsigned portBASE_TYPE ux;

@ -84,7 +84,7 @@ typedef struct tskTaskControlBlock
xListItem xEventListItem; /*< List item used to place the TCB in event lists. */ xListItem xEventListItem; /*< List item used to place the TCB in event lists. */
unsigned portBASE_TYPE uxPriority; /*< The priority of the task where 0 is the lowest priority. */ unsigned portBASE_TYPE uxPriority; /*< The priority of the task where 0 is the lowest priority. */
portSTACK_TYPE *pxStack; /*< Points to the start of the stack. */ portSTACK_TYPE *pxStack; /*< Points to the start of the stack. */
signed portCHAR pcTaskName[ configMAX_TASK_NAME_LEN ];/*< Descriptive name given to the task when created. Facilitates debugging only. */ signed char pcTaskName[ configMAX_TASK_NAME_LEN ];/*< Descriptive name given to the task when created. Facilitates debugging only. */
#if ( portSTACK_GROWTH > 0 ) #if ( portSTACK_GROWTH > 0 )
portSTACK_TYPE *pxEndOfStack; /*< Used for stack overflow checking on architectures where the stack grows up from low memory. */ portSTACK_TYPE *pxEndOfStack; /*< Used for stack overflow checking on architectures where the stack grows up from low memory. */
@ -107,7 +107,7 @@ typedef struct tskTaskControlBlock
#endif #endif
#if ( configGENERATE_RUN_TIME_STATS == 1 ) #if ( configGENERATE_RUN_TIME_STATS == 1 )
unsigned portLONG ulRunTimeCounter; /*< Used for calculating how much CPU time each task is utilising. */ unsigned long ulRunTimeCounter; /*< Used for calculating how much CPU time each task is utilising. */
#endif #endif
} tskTCB; } tskTCB;
@ -160,9 +160,9 @@ PRIVILEGED_DATA static unsigned portBASE_TYPE uxTaskNumber = ( unsigned po
#if ( configGENERATE_RUN_TIME_STATS == 1 ) #if ( configGENERATE_RUN_TIME_STATS == 1 )
PRIVILEGED_DATA static portCHAR pcStatsString[ 50 ] ; PRIVILEGED_DATA static char pcStatsString[ 50 ] ;
PRIVILEGED_DATA static unsigned portLONG ulTaskSwitchedInTime = 0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */ PRIVILEGED_DATA static unsigned long ulTaskSwitchedInTime = 0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */
static void prvGenerateRunTimeStatsForTasksInList( const signed portCHAR *pcWriteBuffer, xList *pxList, unsigned portLONG ulTotalRunTime ) PRIVILEGED_FUNCTION; static void prvGenerateRunTimeStatsForTasksInList( const signed char *pcWriteBuffer, xList *pxList, unsigned long ulTotalRunTime ) PRIVILEGED_FUNCTION;
#endif #endif
@ -177,23 +177,23 @@ PRIVILEGED_DATA static unsigned portBASE_TYPE uxTaskNumber = ( unsigned po
/* /*
* Macros used by vListTask to indicate which state a task is in. * Macros used by vListTask to indicate which state a task is in.
*/ */
#define tskBLOCKED_CHAR ( ( signed portCHAR ) 'B' ) #define tskBLOCKED_CHAR ( ( signed char ) 'B' )
#define tskREADY_CHAR ( ( signed portCHAR ) 'R' ) #define tskREADY_CHAR ( ( signed char ) 'R' )
#define tskDELETED_CHAR ( ( signed portCHAR ) 'D' ) #define tskDELETED_CHAR ( ( signed char ) 'D' )
#define tskSUSPENDED_CHAR ( ( signed portCHAR ) 'S' ) #define tskSUSPENDED_CHAR ( ( signed char ) 'S' )
/* /*
* Macros and private variables used by the trace facility. * Macros and private variables used by the trace facility.
*/ */
#if ( configUSE_TRACE_FACILITY == 1 ) #if ( configUSE_TRACE_FACILITY == 1 )
#define tskSIZE_OF_EACH_TRACE_LINE ( ( unsigned portLONG ) ( sizeof( unsigned portLONG ) + sizeof( unsigned portLONG ) ) ) #define tskSIZE_OF_EACH_TRACE_LINE ( ( unsigned long ) ( sizeof( unsigned long ) + sizeof( unsigned long ) ) )
PRIVILEGED_DATA static volatile signed portCHAR * volatile pcTraceBuffer; PRIVILEGED_DATA static volatile signed char * volatile pcTraceBuffer;
PRIVILEGED_DATA static signed portCHAR *pcTraceBufferStart; PRIVILEGED_DATA static signed char *pcTraceBufferStart;
PRIVILEGED_DATA static signed portCHAR *pcTraceBufferEnd; PRIVILEGED_DATA static signed char *pcTraceBufferEnd;
PRIVILEGED_DATA static signed portBASE_TYPE xTracing = pdFALSE; PRIVILEGED_DATA static signed portBASE_TYPE xTracing = pdFALSE;
static unsigned portBASE_TYPE uxPreviousTask = 255; static unsigned portBASE_TYPE uxPreviousTask = 255;
PRIVILEGED_DATA static portCHAR pcStatusString[ 50 ]; PRIVILEGED_DATA static char pcStatusString[ 50 ];
#endif #endif
@ -216,10 +216,10 @@ PRIVILEGED_DATA static unsigned portBASE_TYPE uxTaskNumber = ( unsigned po
if( ( pcTraceBuffer + tskSIZE_OF_EACH_TRACE_LINE ) < pcTraceBufferEnd ) \ if( ( pcTraceBuffer + tskSIZE_OF_EACH_TRACE_LINE ) < pcTraceBufferEnd ) \
{ \ { \
uxPreviousTask = pxCurrentTCB->uxTCBNumber; \ uxPreviousTask = pxCurrentTCB->uxTCBNumber; \
*( unsigned portLONG * ) pcTraceBuffer = ( unsigned portLONG ) xTickCount; \ *( unsigned long * ) pcTraceBuffer = ( unsigned long ) xTickCount; \
pcTraceBuffer += sizeof( unsigned portLONG ); \ pcTraceBuffer += sizeof( unsigned long ); \
*( unsigned portLONG * ) pcTraceBuffer = ( unsigned portLONG ) uxPreviousTask; \ *( unsigned long * ) pcTraceBuffer = ( unsigned long ) uxPreviousTask; \
pcTraceBuffer += sizeof( unsigned portLONG ); \ pcTraceBuffer += sizeof( unsigned long ); \
} \ } \
else \ else \
{ \ { \
@ -297,7 +297,7 @@ register tskTCB *pxTCB; \
* Utility to ready a TCB for a given task. Mainly just copies the parameters * Utility to ready a TCB for a given task. Mainly just copies the parameters
* into the TCB structure. * into the TCB structure.
*/ */
static void prvInitialiseTCBVariables( tskTCB *pxTCB, const signed portCHAR * const pcName, unsigned portBASE_TYPE uxPriority, const xMemoryRegion * const xRegions, unsigned portSHORT usStackDepth ) PRIVILEGED_FUNCTION; static void prvInitialiseTCBVariables( tskTCB *pxTCB, const signed char * const pcName, unsigned portBASE_TYPE uxPriority, const xMemoryRegion * const xRegions, unsigned short usStackDepth ) PRIVILEGED_FUNCTION;
/* /*
* 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
@ -342,7 +342,7 @@ static void prvCheckTasksWaitingTermination( void ) PRIVILEGED_FUNCTION;
* Allocates memory from the heap for a TCB and associated stack. Checks the * Allocates memory from the heap for a TCB and associated stack. Checks the
* allocation was successful. * allocation was successful.
*/ */
static tskTCB *prvAllocateTCBAndStack( unsigned portSHORT usStackDepth, portSTACK_TYPE *puxStackBuffer ) PRIVILEGED_FUNCTION; static tskTCB *prvAllocateTCBAndStack( unsigned short usStackDepth, portSTACK_TYPE *puxStackBuffer ) PRIVILEGED_FUNCTION;
/* /*
* Called from vTaskList. vListTasks details all the tasks currently under * Called from vTaskList. vListTasks details all the tasks currently under
@ -355,7 +355,7 @@ static tskTCB *prvAllocateTCBAndStack( unsigned portSHORT usStackDepth, portSTAC
*/ */
#if ( configUSE_TRACE_FACILITY == 1 ) #if ( configUSE_TRACE_FACILITY == 1 )
static void prvListTaskWithinSingleList( const signed portCHAR *pcWriteBuffer, xList *pxList, signed portCHAR cStatus ) PRIVILEGED_FUNCTION; static void prvListTaskWithinSingleList( const signed char *pcWriteBuffer, xList *pxList, signed char cStatus ) PRIVILEGED_FUNCTION;
#endif #endif
@ -366,7 +366,7 @@ static tskTCB *prvAllocateTCBAndStack( unsigned portSHORT usStackDepth, portSTAC
*/ */
#if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) ) #if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) )
static unsigned portSHORT usTaskCheckFreeStackSpace( const unsigned portCHAR * pucStackByte ) PRIVILEGED_FUNCTION; static unsigned short usTaskCheckFreeStackSpace( const unsigned char * pucStackByte ) PRIVILEGED_FUNCTION;
#endif #endif
@ -379,7 +379,7 @@ static tskTCB *prvAllocateTCBAndStack( unsigned portSHORT usStackDepth, portSTAC
* TASK CREATION API documented in task.h * TASK CREATION API documented in task.h
*----------------------------------------------------------*/ *----------------------------------------------------------*/
signed portBASE_TYPE xTaskGenericCreate( pdTASK_CODE pxTaskCode, const signed portCHAR * const pcName, unsigned portSHORT usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions ) signed portBASE_TYPE xTaskGenericCreate( pdTASK_CODE pxTaskCode, const signed char * const pcName, unsigned short usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions )
{ {
signed portBASE_TYPE xReturn; signed portBASE_TYPE xReturn;
tskTCB * pxNewTCB; tskTCB * pxNewTCB;
@ -411,7 +411,7 @@ portBASE_TYPE xRunPrivileged;
#if( portSTACK_GROWTH < 0 ) #if( portSTACK_GROWTH < 0 )
{ {
pxTopOfStack = pxNewTCB->pxStack + ( usStackDepth - 1 ); pxTopOfStack = pxNewTCB->pxStack + ( usStackDepth - 1 );
pxTopOfStack = ( portSTACK_TYPE * ) ( ( ( unsigned portLONG ) pxTopOfStack ) & ( ( unsigned portLONG ) ~portBYTE_ALIGNMENT_MASK ) ); pxTopOfStack = ( portSTACK_TYPE * ) ( ( ( unsigned long ) pxTopOfStack ) & ( ( unsigned long ) ~portBYTE_ALIGNMENT_MASK ) );
} }
#else #else
{ {
@ -1017,7 +1017,7 @@ void vTaskStartScheduler( void )
portBASE_TYPE xReturn; portBASE_TYPE xReturn;
/* Add the idle task at the lowest priority. */ /* Add the idle task at the lowest priority. */
xReturn = xTaskCreate( prvIdleTask, ( signed portCHAR * ) "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), ( xTaskHandle * ) NULL ); xReturn = xTaskCreate( prvIdleTask, ( signed char * ) "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), ( xTaskHandle * ) NULL );
if( xReturn == pdPASS ) if( xReturn == pdPASS )
{ {
@ -1180,7 +1180,7 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
#if ( configUSE_TRACE_FACILITY == 1 ) #if ( configUSE_TRACE_FACILITY == 1 )
void vTaskList( signed portCHAR *pcWriteBuffer ) void vTaskList( signed char *pcWriteBuffer )
{ {
unsigned portBASE_TYPE uxQueue; unsigned portBASE_TYPE uxQueue;
@ -1192,8 +1192,8 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
/* Run through all the lists that could potentially contain a TCB and /* Run through all the lists that could potentially contain a TCB and
report the task name, state and stack high water mark. */ report the task name, state and stack high water mark. */
pcWriteBuffer[ 0 ] = ( signed portCHAR ) 0x00; pcWriteBuffer[ 0 ] = ( signed char ) 0x00;
strcat( ( portCHAR * ) pcWriteBuffer, ( const portCHAR * ) "\r\n" ); strcat( ( char * ) pcWriteBuffer, ( const char * ) "\r\n" );
uxQueue = uxTopUsedPriority + 1; uxQueue = uxTopUsedPriority + 1;
@ -1205,7 +1205,7 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
{ {
prvListTaskWithinSingleList( pcWriteBuffer, ( xList * ) &( pxReadyTasksLists[ uxQueue ] ), tskREADY_CHAR ); prvListTaskWithinSingleList( pcWriteBuffer, ( xList * ) &( pxReadyTasksLists[ uxQueue ] ), tskREADY_CHAR );
} }
}while( uxQueue > ( unsigned portSHORT ) tskIDLE_PRIORITY ); }while( uxQueue > ( unsigned short ) tskIDLE_PRIORITY );
if( !listLIST_IS_EMPTY( pxDelayedTaskList ) ) if( !listLIST_IS_EMPTY( pxDelayedTaskList ) )
{ {
@ -1243,10 +1243,10 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
#if ( configGENERATE_RUN_TIME_STATS == 1 ) #if ( configGENERATE_RUN_TIME_STATS == 1 )
void vTaskGetRunTimeStats( signed portCHAR *pcWriteBuffer ) void vTaskGetRunTimeStats( signed char *pcWriteBuffer )
{ {
unsigned portBASE_TYPE uxQueue; unsigned portBASE_TYPE uxQueue;
unsigned portLONG ulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE(); unsigned long ulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE();
/* This is a VERY costly function that should be used for debug only. /* This is a VERY costly function that should be used for debug only.
It leaves interrupts disabled for a LONG time. */ It leaves interrupts disabled for a LONG time. */
@ -1257,8 +1257,8 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
generating a table of run timer percentages in the provided generating a table of run timer percentages in the provided
buffer. */ buffer. */
pcWriteBuffer[ 0 ] = ( signed portCHAR ) 0x00; pcWriteBuffer[ 0 ] = ( signed char ) 0x00;
strcat( ( portCHAR * ) pcWriteBuffer, ( const portCHAR * ) "\r\n" ); strcat( ( char * ) pcWriteBuffer, ( const char * ) "\r\n" );
uxQueue = uxTopUsedPriority + 1; uxQueue = uxTopUsedPriority + 1;
@ -1270,7 +1270,7 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
{ {
prvGenerateRunTimeStatsForTasksInList( pcWriteBuffer, ( xList * ) &( pxReadyTasksLists[ uxQueue ] ), ulTotalRunTime ); prvGenerateRunTimeStatsForTasksInList( pcWriteBuffer, ( xList * ) &( pxReadyTasksLists[ uxQueue ] ), ulTotalRunTime );
} }
}while( uxQueue > ( unsigned portSHORT ) tskIDLE_PRIORITY ); }while( uxQueue > ( unsigned short ) tskIDLE_PRIORITY );
if( !listLIST_IS_EMPTY( pxDelayedTaskList ) ) if( !listLIST_IS_EMPTY( pxDelayedTaskList ) )
{ {
@ -1308,11 +1308,11 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
#if ( configUSE_TRACE_FACILITY == 1 ) #if ( configUSE_TRACE_FACILITY == 1 )
void vTaskStartTrace( signed portCHAR * pcBuffer, unsigned portLONG ulBufferSize ) void vTaskStartTrace( signed char * pcBuffer, unsigned long ulBufferSize )
{ {
portENTER_CRITICAL(); portENTER_CRITICAL();
{ {
pcTraceBuffer = ( signed portCHAR * )pcBuffer; pcTraceBuffer = ( signed char * )pcBuffer;
pcTraceBufferStart = pcBuffer; pcTraceBufferStart = pcBuffer;
pcTraceBufferEnd = pcBuffer + ( ulBufferSize - tskSIZE_OF_EACH_TRACE_LINE ); pcTraceBufferEnd = pcBuffer + ( ulBufferSize - tskSIZE_OF_EACH_TRACE_LINE );
xTracing = pdTRUE; xTracing = pdTRUE;
@ -1325,15 +1325,15 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
#if ( configUSE_TRACE_FACILITY == 1 ) #if ( configUSE_TRACE_FACILITY == 1 )
unsigned portLONG ulTaskEndTrace( void ) unsigned long ulTaskEndTrace( void )
{ {
unsigned portLONG ulBufferLength; unsigned long ulBufferLength;
portENTER_CRITICAL(); portENTER_CRITICAL();
xTracing = pdFALSE; xTracing = pdFALSE;
portEXIT_CRITICAL(); portEXIT_CRITICAL();
ulBufferLength = ( unsigned portLONG ) ( pcTraceBuffer - pcTraceBufferStart ); ulBufferLength = ( unsigned long ) ( pcTraceBuffer - pcTraceBufferStart );
return ulBufferLength; return ulBufferLength;
} }
@ -1408,10 +1408,10 @@ void vTaskIncrementTick( void )
void vTaskCleanUpResources( void ) void vTaskCleanUpResources( void )
{ {
unsigned portSHORT usQueue; unsigned short usQueue;
volatile tskTCB *pxTCB; volatile tskTCB *pxTCB;
usQueue = ( unsigned portSHORT ) uxTopUsedPriority + ( unsigned portSHORT ) 1; usQueue = ( unsigned short ) uxTopUsedPriority + ( unsigned short ) 1;
/* Remove any TCB's from the ready queues. */ /* Remove any TCB's from the ready queues. */
do do
@ -1425,7 +1425,7 @@ void vTaskIncrementTick( void )
prvDeleteTCB( ( tskTCB * ) pxTCB ); prvDeleteTCB( ( tskTCB * ) pxTCB );
} }
}while( usQueue > ( unsigned portSHORT ) tskIDLE_PRIORITY ); }while( usQueue > ( unsigned short ) tskIDLE_PRIORITY );
/* Remove any TCB's from the delayed queue. */ /* Remove any TCB's from the delayed queue. */
while( !listLIST_IS_EMPTY( &xDelayedTaskList1 ) ) while( !listLIST_IS_EMPTY( &xDelayedTaskList1 ) )
@ -1558,7 +1558,7 @@ void vTaskSwitchContext( void )
#if ( configGENERATE_RUN_TIME_STATS == 1 ) #if ( configGENERATE_RUN_TIME_STATS == 1 )
{ {
unsigned portLONG ulTempCounter = portGET_RUN_TIME_COUNTER_VALUE(); unsigned long ulTempCounter = portGET_RUN_TIME_COUNTER_VALUE();
/* Add the amount of time the task has been running to the accumulated /* Add the amount of time the task has been running to the accumulated
time so far. The time the task started running was stored in time so far. The time the task started running was stored in
@ -1836,16 +1836,16 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
static void prvInitialiseTCBVariables( tskTCB *pxTCB, const signed portCHAR * const pcName, unsigned portBASE_TYPE uxPriority, const xMemoryRegion * const xRegions, unsigned portSHORT usStackDepth ) static void prvInitialiseTCBVariables( tskTCB *pxTCB, const signed char * const pcName, unsigned portBASE_TYPE uxPriority, const xMemoryRegion * const xRegions, unsigned short usStackDepth )
{ {
/* Store the function name in the TCB. */ /* Store the function name in the TCB. */
#if configMAX_TASK_NAME_LEN > 1 #if configMAX_TASK_NAME_LEN > 1
{ {
/* Don't bring strncpy into the build unnecessarily. */ /* Don't bring strncpy into the build unnecessarily. */
strncpy( ( char * ) pxTCB->pcTaskName, ( const char * ) pcName, ( unsigned portSHORT ) configMAX_TASK_NAME_LEN ); strncpy( ( char * ) pxTCB->pcTaskName, ( const char * ) pcName, ( unsigned short ) configMAX_TASK_NAME_LEN );
} }
#endif #endif
pxTCB->pcTaskName[ ( unsigned portSHORT ) configMAX_TASK_NAME_LEN - ( unsigned portSHORT ) 1 ] = '\0'; pxTCB->pcTaskName[ ( unsigned short ) configMAX_TASK_NAME_LEN - ( unsigned short ) 1 ] = '\0';
/* This is used as an array index so must ensure it's not too large. First /* This is used as an array index so must ensure it's not too large. First
remove the privilege bit if one is present. */ remove the privilege bit if one is present. */
@ -1989,7 +1989,7 @@ static void prvCheckTasksWaitingTermination( void )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static tskTCB *prvAllocateTCBAndStack( unsigned portSHORT usStackDepth, portSTACK_TYPE *puxStackBuffer ) static tskTCB *prvAllocateTCBAndStack( unsigned short usStackDepth, portSTACK_TYPE *puxStackBuffer )
{ {
tskTCB *pxNewTCB; tskTCB *pxNewTCB;
@ -2023,19 +2023,19 @@ tskTCB *pxNewTCB;
#if ( configUSE_TRACE_FACILITY == 1 ) #if ( configUSE_TRACE_FACILITY == 1 )
static void prvListTaskWithinSingleList( const signed portCHAR *pcWriteBuffer, xList *pxList, signed portCHAR cStatus ) static void prvListTaskWithinSingleList( const signed char *pcWriteBuffer, xList *pxList, signed char cStatus )
{ {
volatile tskTCB *pxNextTCB, *pxFirstTCB; volatile tskTCB *pxNextTCB, *pxFirstTCB;
unsigned portSHORT usStackRemaining; unsigned short usStackRemaining;
/* Write the details of all the TCB's in pxList into the buffer. */ /* Write the details of all the TCB's in pxList into the buffer. */
listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList ); listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList );
do do
{ {
listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList ); listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList );
usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned portCHAR * ) pxNextTCB->pxStack ); usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxStack );
sprintf( pcStatusString, ( portCHAR * ) "%s\t\t%c\t%u\t%u\t%u\r\n", pxNextTCB->pcTaskName, cStatus, ( unsigned int ) pxNextTCB->uxPriority, usStackRemaining, ( unsigned int ) pxNextTCB->uxTCBNumber ); sprintf( pcStatusString, ( char * ) "%s\t\t%c\t%u\t%u\t%u\r\n", pxNextTCB->pcTaskName, cStatus, ( unsigned int ) pxNextTCB->uxPriority, usStackRemaining, ( unsigned int ) pxNextTCB->uxTCBNumber );
strcat( ( portCHAR * ) pcWriteBuffer, ( portCHAR * ) pcStatusString ); strcat( ( char * ) pcWriteBuffer, ( char * ) pcStatusString );
} while( pxNextTCB != pxFirstTCB ); } while( pxNextTCB != pxFirstTCB );
} }
@ -2045,10 +2045,10 @@ tskTCB *pxNewTCB;
#if ( configGENERATE_RUN_TIME_STATS == 1 ) #if ( configGENERATE_RUN_TIME_STATS == 1 )
static void prvGenerateRunTimeStatsForTasksInList( const signed portCHAR *pcWriteBuffer, xList *pxList, unsigned portLONG ulTotalRunTime ) static void prvGenerateRunTimeStatsForTasksInList( const signed char *pcWriteBuffer, xList *pxList, unsigned long ulTotalRunTime )
{ {
volatile tskTCB *pxNextTCB, *pxFirstTCB; volatile tskTCB *pxNextTCB, *pxFirstTCB;
unsigned portLONG ulStatsAsPercentage; unsigned long ulStatsAsPercentage;
/* Write the run time stats of all the TCB's in pxList into the buffer. */ /* Write the run time stats of all the TCB's in pxList into the buffer. */
listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList ); listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList );
@ -2064,7 +2064,7 @@ tskTCB *pxNewTCB;
if( pxNextTCB->ulRunTimeCounter == 0 ) if( pxNextTCB->ulRunTimeCounter == 0 )
{ {
/* The task has used no CPU time at all. */ /* The task has used no CPU time at all. */
sprintf( pcStatsString, ( portCHAR * ) "%s\t\t0\t\t0%%\r\n", pxNextTCB->pcTaskName ); sprintf( pcStatsString, ( char * ) "%s\t\t0\t\t0%%\r\n", pxNextTCB->pcTaskName );
} }
else else
{ {
@ -2074,17 +2074,17 @@ tskTCB *pxNewTCB;
if( ulStatsAsPercentage > 0UL ) if( ulStatsAsPercentage > 0UL )
{ {
sprintf( pcStatsString, ( portCHAR * ) "%s\t\t%u\t\t%u%%\r\n", pxNextTCB->pcTaskName, ( unsigned int ) pxNextTCB->ulRunTimeCounter, ( unsigned int ) ulStatsAsPercentage ); sprintf( pcStatsString, ( char * ) "%s\t\t%u\t\t%u%%\r\n", pxNextTCB->pcTaskName, ( unsigned int ) pxNextTCB->ulRunTimeCounter, ( unsigned int ) ulStatsAsPercentage );
} }
else else
{ {
/* If the percentage is zero here then the task has /* If the percentage is zero here then the task has
consumed less than 1% of the total run time. */ consumed less than 1% of the total run time. */
sprintf( pcStatsString, ( portCHAR * ) "%s\t\t%u\t\t<1%%\r\n", pxNextTCB->pcTaskName, ( unsigned int ) pxNextTCB->ulRunTimeCounter ); sprintf( pcStatsString, ( char * ) "%s\t\t%u\t\t<1%%\r\n", pxNextTCB->pcTaskName, ( unsigned int ) pxNextTCB->ulRunTimeCounter );
} }
} }
strcat( ( portCHAR * ) pcWriteBuffer, ( portCHAR * ) pcStatsString ); strcat( ( char * ) pcWriteBuffer, ( char * ) pcStatsString );
} }
} while( pxNextTCB != pxFirstTCB ); } while( pxNextTCB != pxFirstTCB );
@ -2095,9 +2095,9 @@ tskTCB *pxNewTCB;
#if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) ) #if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) )
static unsigned portSHORT usTaskCheckFreeStackSpace( const unsigned portCHAR * pucStackByte ) static unsigned short usTaskCheckFreeStackSpace( const unsigned char * pucStackByte )
{ {
register unsigned portSHORT usCount = 0; register unsigned short usCount = 0;
while( *pucStackByte == tskSTACK_FILL_BYTE ) while( *pucStackByte == tskSTACK_FILL_BYTE )
{ {
@ -2118,18 +2118,18 @@ tskTCB *pxNewTCB;
unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask ) unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask )
{ {
tskTCB *pxTCB; tskTCB *pxTCB;
unsigned portCHAR *pcEndOfStack; unsigned char *pcEndOfStack;
unsigned portBASE_TYPE uxReturn; unsigned portBASE_TYPE uxReturn;
pxTCB = prvGetTCBFromHandle( xTask ); pxTCB = prvGetTCBFromHandle( xTask );
#if portSTACK_GROWTH < 0 #if portSTACK_GROWTH < 0
{ {
pcEndOfStack = ( unsigned portCHAR * ) pxTCB->pxStack; pcEndOfStack = ( unsigned char * ) pxTCB->pxStack;
} }
#else #else
{ {
pcEndOfStack = ( unsigned portCHAR * ) pxTCB->pxEndOfStack; pcEndOfStack = ( unsigned char * ) pxTCB->pxEndOfStack;
} }
#endif #endif

Loading…
Cancel
Save