From 65f81aff823d21328ddba6e87af446b6bbc66e70 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Sun, 4 Oct 2009 18:34:36 +0000 Subject: [PATCH] Remove unnecessary use of portLONG, portCHAR and portSHORT. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@898 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Source/include/StackMacros.h | 14 +-- Source/include/croutine.h | 14 +-- Source/include/queue.h | 68 ++++++------- Source/include/semphr.h | 6 +- Source/include/task.h | 34 +++---- Source/portable/GCC/ARM_CM3_MPU/port.c | 62 ++++++------ Source/queue.c | 20 ++-- Source/tasks.c | 126 ++++++++++++------------- 8 files changed, 172 insertions(+), 172 deletions(-) diff --git a/Source/include/StackMacros.h b/Source/include/StackMacros.h index a139e61c1..01f0f22f0 100644 --- a/Source/include/StackMacros.h +++ b/Source/include/StackMacros.h @@ -87,7 +87,7 @@ /* Only the current stack state is to be checked. */ #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? */ \ if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \ @@ -104,7 +104,7 @@ /* Only the current stack state is to be checked. */ #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? */ \ if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \ @@ -120,8 +120,8 @@ #define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \ { \ - extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed portCHAR *pcTaskName ); \ - static const unsigned portCHAR ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ + extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName ); \ + 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, \ @@ -142,9 +142,9 @@ #define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \ { \ - extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed portCHAR *pcTaskName ); \ - portCHAR *pcEndOfStack = ( portCHAR * ) pxCurrentTCB->pxEndOfStack; \ - static const unsigned portCHAR ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ + extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName ); \ + char *pcEndOfStack = ( char * ) pxCurrentTCB->pxEndOfStack; \ + 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, \ diff --git a/Source/include/croutine.h b/Source/include/croutine.h index 07c988434..57cf05f70 100644 --- a/Source/include/croutine.h +++ b/Source/include/croutine.h @@ -76,7 +76,7 @@ typedef struct corCoRoutineControlBlock 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 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. */ /** @@ -208,7 +208,7 @@ void vCoRoutineSchedule( void ); 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. - static portLONG ulAVariable; + static long ulAVariable; // Must start every co-routine with a call to crSTART(); crSTART( xHandle ); @@ -239,7 +239,7 @@ void vCoRoutineSchedule( void ); 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. - static portLONG ulAVariable; + static long ulAVariable; // Must start every co-routine with a call to crSTART(); crSTART( xHandle ); @@ -553,7 +553,7 @@ void vCoRoutineSchedule( void ); // A co-routine that blocks on a queue waiting for characters to be received. static void vReceivingCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex ) { - portCHAR cRxedChar; + char cRxedChar; portBASE_TYPE xResult; // All co-routines must start with a call to crSTART(). @@ -580,7 +580,7 @@ void vCoRoutineSchedule( void ); // a co-routine. void vUART_ISR( void ) { - portCHAR cRxedChar; + char cRxedChar; portBASE_TYPE xCRWokenByPost = pdFALSE; // 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 // be declared static. - static portCHAR cCharToTx = 'a'; + static char cCharToTx = 'a'; portBASE_TYPE xResult; // 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. void vUART_ISR( void ) { - portCHAR cCharToTx; + char cCharToTx; portBASE_TYPE xCRWokenByPost = pdFALSE; while( UART_TX_REG_EMPTY() ) diff --git a/Source/include/queue.h b/Source/include/queue.h index 8c176547b..e42f8a58d 100644 --- a/Source/include/queue.h +++ b/Source/include/queue.h @@ -98,8 +98,8 @@ typedef void * xQueueHandle;
  struct AMessage
  {
-	portCHAR ucMessageID;
-	portCHAR ucData[ 20 ];
+	char ucMessageID;
+	char ucData[ 20 ];
  };
 
  void vATask( void *pvParameters )
@@ -107,7 +107,7 @@ typedef void * xQueueHandle;
  xQueueHandle xQueue1, xQueue2;
 
 	// 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 )
 	{
 		// Queue was not created and must not be used.
@@ -165,11 +165,11 @@ xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBA
    
  struct AMessage
  {
-	portCHAR ucMessageID;
-	portCHAR ucData[ 20 ];
+	char ucMessageID;
+	char ucData[ 20 ];
  } xMessage;
 
- unsigned portLONG ulVar = 10UL;
+ unsigned long ulVar = 10UL;
 
  void vATask( void *pvParameters )
  {
@@ -177,7 +177,7 @@ xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBA
  struct AMessage *pxMessage;
 
 	// 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.
 	// 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
    
  struct AMessage
  {
-	portCHAR ucMessageID;
-	portCHAR ucData[ 20 ];
+	char ucMessageID;
+	char ucData[ 20 ];
  } xMessage;
 
- unsigned portLONG ulVar = 10UL;
+ unsigned long ulVar = 10UL;
 
  void vATask( void *pvParameters )
  {
@@ -259,7 +259,7 @@ xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBA
  struct AMessage *pxMessage;
 
 	// 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.
 	// 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
    
  struct AMessage
  {
-	portCHAR ucMessageID;
-	portCHAR ucData[ 20 ];
+	char ucMessageID;
+	char ucData[ 20 ];
  } xMessage;
 
- unsigned portLONG ulVar = 10UL;
+ unsigned long ulVar = 10UL;
 
  void vATask( void *pvParameters )
  {
@@ -343,7 +343,7 @@ xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBA
  struct AMessage *pxMessage;
 
 	// 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.
 	// 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
    
  struct AMessage
  {
-	portCHAR ucMessageID;
-	portCHAR ucData[ 20 ];
+	char ucMessageID;
+	char ucData[ 20 ];
  } xMessage;
 
- unsigned portLONG ulVar = 10UL;
+ unsigned long ulVar = 10UL;
 
  void vATask( void *pvParameters )
  {
@@ -431,7 +431,7 @@ xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBA
  struct AMessage *pxMessage;
 
 	// 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.
 	// 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
    
  struct AMessage
  {
-	portCHAR ucMessageID;
-	portCHAR ucData[ 20 ];
+	char ucMessageID;
+	char ucData[ 20 ];
  } xMessage;
 
  xQueueHandle xQueue;
@@ -599,8 +599,8 @@ signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const
    
  struct AMessage
  {
-	portCHAR ucMessageID;
-	portCHAR ucData[ 20 ];
+	char ucMessageID;
+	char ucData[ 20 ];
  } xMessage;
 
  xQueueHandle xQueue;
@@ -698,8 +698,8 @@ signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const
    
  struct AMessage
  {
-	portCHAR ucMessageID;
-	portCHAR ucData[ 20 ];
+	char ucMessageID;
+	char ucData[ 20 ];
  } xMessage;
 
  xQueueHandle xQueue;
@@ -820,7 +820,7 @@ void vQueueDelete( xQueueHandle xQueue );
    
  void vBufferISR( void )
  {
- portCHAR cIn;
+ char cIn;
  portBASE_TYPE xHigherPrioritTaskWoken;
 
 	// We have not woken a task at the start of the ISR.
@@ -891,7 +891,7 @@ void vQueueDelete( xQueueHandle xQueue );
    
  void vBufferISR( void )
  {
- portCHAR cIn;
+ char cIn;
  portBASE_TYPE xHigherPriorityTaskWoken;
 
 	// We have not woken a task at the start of the ISR.
@@ -964,7 +964,7 @@ void vQueueDelete( xQueueHandle xQueue );
    
  void vBufferISR( void )
  {
- portCHAR cIn;
+ char cIn;
  portBASE_TYPE xHigherPriorityTaskWoken;
 
 	// We have not woken a task at the start of the ISR.
@@ -1042,7 +1042,7 @@ void vQueueDelete( xQueueHandle xQueue );
    
  void vBufferISR( void )
  {
- portCHAR cIn;
+ char cIn;
  portBASE_TYPE xHigherPriorityTaskWokenByPost;
 
 	// 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.
  void vAFunction( void *pvParameters )
  {
- portCHAR cValueToPost;
+ char cValueToPost;
  const portTickType xBlockTime = ( portTickType )0xff;
 
 	// Create a queue capable of containing 10 characters.
-	xQueue = xQueueCreate( 10, sizeof( portCHAR ) );
+	xQueue = xQueueCreate( 10, sizeof( char ) );
 	if( xQueue == 0 )
 	{
 		// Failed to create the queue.
@@ -1138,7 +1138,7 @@ signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void
  void vISR_Routine( void )
  {
  portBASE_TYPE xTaskWokenByReceive = pdFALSE;
- portCHAR cRxedChar;
+ char cRxedChar;
 
 	while( xQueueReceiveFromISR( xQueue, ( void * ) &cRxedChar, &xTaskWokenByReceive) )
 	{
@@ -1151,7 +1151,7 @@ signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void
 		// task will be woken.
 	}
 
-	if( cTaskWokenByPost != ( portCHAR ) pdFALSE;
+	if( cTaskWokenByPost != ( char ) pdFALSE;
 	{
 		taskYIELD ();
 	}
@@ -1241,7 +1241,7 @@ portBASE_TYPE xQueueGiveMutexRecursive( xQueueHandle xMutex );
  * name that the kernel aware debugger will display.
  */
 #if configQUEUE_REGISTRY_SIZE > 0
-	void vQueueAddToRegistry( xQueueHandle xQueue, signed portCHAR *pcName );
+	void vQueueAddToRegistry( xQueueHandle xQueue, signed char *pcName );
 #endif
 
 
diff --git a/Source/include/semphr.h b/Source/include/semphr.h
index 22d3009e8..fa1d3100b 100644
--- a/Source/include/semphr.h
+++ b/Source/include/semphr.h
@@ -56,8 +56,8 @@
 
 typedef xQueueHandle xSemaphoreHandle;
 
-#define semBINARY_SEMAPHORE_QUEUE_LENGTH	( ( unsigned portCHAR ) 1 )
-#define semSEMAPHORE_QUEUE_ITEM_LENGTH		( ( unsigned portCHAR ) 0 )
+#define semBINARY_SEMAPHORE_QUEUE_LENGTH	( ( unsigned char ) 1 )
+#define semSEMAPHORE_QUEUE_ITEM_LENGTH		( ( unsigned char ) 0 )
 #define semGIVE_BLOCK_TIME					( ( portTickType ) 0 )
 
 
@@ -502,7 +502,7 @@ typedef xQueueHandle xSemaphoreHandle;
  // Timer ISR
  void vTimerISR( void * pvParameters )
  {
- static unsigned portCHAR ucLocalTickCount = 0;
+ static unsigned char ucLocalTickCount = 0;
  static portBASE_TYPE xHigherPriorityTaskWoken;
 
     // A timer tick has occurred.
diff --git a/Source/include/task.h b/Source/include/task.h
index 9eff36f99..2b5258568 100644
--- a/Source/include/task.h
+++ b/Source/include/task.h
@@ -95,8 +95,8 @@ typedef struct xTIME_OUT
 typedef struct xMEMORY_REGION
 {
 	void *pvBaseAddress;
-	unsigned portLONG ulLengthInBytes;
-	unsigned portLONG ulParameters;
+	unsigned long ulLengthInBytes;
+	unsigned long ulParameters;
 } xMemoryRegion;
 
 /*
@@ -105,8 +105,8 @@ typedef struct xMEMORY_REGION
 typedef struct xTASK_PARAMTERS
 {
 	pdTASK_CODE pvTaskCode;
-	const signed portCHAR * const pcName;
-	unsigned portSHORT usStackDepth;
+	const signed char * const pcName;
+	unsigned short usStackDepth;
 	void *pvParameters;
 	unsigned portBASE_TYPE uxPriority;
 	portSTACK_TYPE *puxStackBuffer;
@@ -192,8 +192,8 @@ typedef struct xTASK_PARAMTERS
  *
  portBASE_TYPE xTaskCreate(
 							  pdTASK_CODE pvTaskCode,
-							  const portCHAR * const pcName,
-							  unsigned portSHORT usStackDepth,
+							  const char * const pcName,
+							  unsigned short usStackDepth,
 							  void *pvParameters,
 							  unsigned portBASE_TYPE uxPriority,
 							  xTaskHandle *pvCreatedTask
@@ -894,7 +894,7 @@ void vTaskSuspendAll( void ) PRIVILEGED_FUNCTION;
 
 /**
  * task. h
- * 
portCHAR xTaskResumeAll( void );
+ *
char xTaskResumeAll( void );
* * Resumes real time kernel activity following a call to vTaskSuspendAll (). * After a call to vTaskSuspendAll () the kernel will take control of which @@ -972,7 +972,7 @@ portTickType xTaskGetTickCount( void ) PRIVILEGED_FUNCTION; /** * task. h - *
unsigned portSHORT uxTaskGetNumberOfTasks( void );
+ *
unsigned short uxTaskGetNumberOfTasks( void );
* * @return The number of tasks that the real time kernel is currently managing. * This includes all ready, blocked and suspended tasks. A task that @@ -986,7 +986,7 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void ) PRIVILEGED_FUNCTION; /** * task. h - *
void vTaskList( portCHAR *pcWriteBuffer );
+ *
void vTaskList( char *pcWriteBuffer );
* * configUSE_TRACE_FACILITY must be defined as 1 for this function to be * available. See the configuration section for more information. @@ -1008,11 +1008,11 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void ) PRIVILEGED_FUNCTION; * \page vTaskList vTaskList * \ingroup TaskUtils */ -void vTaskList( signed portCHAR *pcWriteBuffer ) PRIVILEGED_FUNCTION; +void vTaskList( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION; /** * task. h - *
void vTaskGetRunTimeStats( portCHAR *pcWriteBuffer );
+ *
void vTaskGetRunTimeStats( char *pcWriteBuffer );
* * configGENERATE_RUN_TIME_STATS must be defined as 1 for this function * to be available. The application must also then provide definitions @@ -1040,11 +1040,11 @@ void vTaskList( signed portCHAR *pcWriteBuffer ) PRIVILEGED_FUNCTION; * \page vTaskGetRunTimeStats vTaskGetRunTimeStats * \ingroup TaskUtils */ -void vTaskGetRunTimeStats( signed portCHAR *pcWriteBuffer ) PRIVILEGED_FUNCTION; +void vTaskGetRunTimeStats( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION; /** * task. h - *
void vTaskStartTrace( portCHAR * pcBuffer, unsigned portBASE_TYPE uxBufferSize );
+ *
void vTaskStartTrace( char * pcBuffer, unsigned portBASE_TYPE uxBufferSize );
* * Starts a real time kernel activity trace. The trace logs the identity of * which task is running when. @@ -1061,11 +1061,11 @@ void vTaskGetRunTimeStats( signed portCHAR *pcWriteBuffer ) PRIVILEGED_FUNCTION; * \page vTaskStartTrace vTaskStartTrace * \ingroup TaskUtils */ -void vTaskStartTrace( signed portCHAR * pcBuffer, unsigned portLONG ulBufferSize ) PRIVILEGED_FUNCTION; +void vTaskStartTrace( signed char * pcBuffer, unsigned long ulBufferSize ) PRIVILEGED_FUNCTION; /** * task. h - *
unsigned portLONG ulTaskEndTrace( void );
+ *
unsigned long ulTaskEndTrace( void );
* * Stops a kernel activity trace. See vTaskStartTrace (). * @@ -1074,7 +1074,7 @@ void vTaskStartTrace( signed portCHAR * pcBuffer, unsigned portLONG ulBufferSize * \page usTaskEndTrace usTaskEndTrace * \ingroup TaskUtils */ -unsigned portLONG ulTaskEndTrace( void ) PRIVILEGED_FUNCTION; +unsigned long ulTaskEndTrace( void ) PRIVILEGED_FUNCTION; /** * 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 * 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 } diff --git a/Source/portable/GCC/ARM_CM3_MPU/port.c b/Source/portable/GCC/ARM_CM3_MPU/port.c index 48fa7d858..f335e9c9f 100644 --- a/Source/portable/GCC/ARM_CM3_MPU/port.c +++ b/Source/portable/GCC/ARM_CM3_MPU/port.c @@ -62,18 +62,18 @@ task.h is included from an application file. */ #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /* Constants required to access and manipulate the NVIC. */ -#define portNVIC_SYSTICK_CTRL ( ( volatile unsigned portLONG * ) 0xe000e010 ) -#define portNVIC_SYSTICK_LOAD ( ( volatile unsigned portLONG * ) 0xe000e014 ) -#define portNVIC_SYSPRI2 ( ( volatile unsigned portLONG * ) 0xe000ed20 ) -#define portNVIC_SYSPRI1 ( ( volatile unsigned portLONG * ) 0xe000ed1c ) -#define portNVIC_SYS_CTRL_STATE ( ( volatile unsigned portLONG * ) 0xe000ed24 ) +#define portNVIC_SYSTICK_CTRL ( ( volatile unsigned long * ) 0xe000e010 ) +#define portNVIC_SYSTICK_LOAD ( ( volatile unsigned long * ) 0xe000e014 ) +#define portNVIC_SYSPRI2 ( ( volatile unsigned long * ) 0xe000ed20 ) +#define portNVIC_SYSPRI1 ( ( volatile unsigned long * ) 0xe000ed1c ) +#define portNVIC_SYS_CTRL_STATE ( ( volatile unsigned long * ) 0xe000ed24 ) #define portNVIC_MEM_FAULT_ENABLE ( 1UL << 16UL ) /* Constants required to access and manipulate the MPU. */ -#define portMPU_TYPE ( ( volatile unsigned portLONG * ) 0xe000ed90 ) -#define portMPU_REGION_BASE_ADDRESS ( ( volatile unsigned portLONG * ) 0xe000ed9C ) -#define portMPU_REGION_ATTRIBUTE ( ( volatile unsigned portLONG * ) 0xe000edA0 ) -#define portMPU_CTRL ( ( volatile unsigned portLONG * ) 0xe000ed94 ) +#define portMPU_TYPE ( ( volatile unsigned long * ) 0xe000ed90 ) +#define portMPU_REGION_BASE_ADDRESS ( ( volatile unsigned long * ) 0xe000ed9C ) +#define portMPU_REGION_ATTRIBUTE ( ( volatile unsigned long * ) 0xe000edA0 ) +#define portMPU_CTRL ( ( volatile unsigned long * ) 0xe000ed94 ) #define portEXPECTED_MPU_TYPE_VALUE ( 8UL << 8UL ) /* 8 regions, unified. */ #define portMPU_ENABLE ( 0x01UL ) #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_INT ( 0x00000002UL ) #define portNVIC_SYSTICK_ENABLE ( 0x00000001UL ) -#define portNVIC_PENDSV_PRI ( ( ( unsigned portLONG ) configKERNEL_INTERRUPT_PRIORITY ) << 16UL ) -#define portNVIC_SYSTICK_PRI ( ( ( unsigned portLONG ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL ) -#define portNVIC_SVC_PRI ( ( ( unsigned portLONG ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL ) +#define portNVIC_PENDSV_PRI ( ( ( unsigned long ) configKERNEL_INTERRUPT_PRIORITY ) << 16UL ) +#define portNVIC_SYSTICK_PRI ( ( ( unsigned long ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL ) +#define portNVIC_SVC_PRI ( ( ( unsigned long ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL ) #define portNVIC_TEMP_SVC_PRI ( 0x01UL << 24UL ) /* 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. */ -static void prvSetupTimerInterrupt( void ); +static void prvSetupTimerInterrupt( void ) PRIVILEGED_FUNCTION; /* * 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 * into. The region size is returned as the value that should be programmed * 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 * if so raises the privilege level and returns false - otherwise does nothing * other than return true. */ -portBASE_TYPE prvRaisePrivilege( void ) __attribute__(( naked )); +static portBASE_TYPE prvRaisePrivilege( void ) __attribute__(( naked )); /* * Standard FreeRTOS exception handlers. */ -void xPortPendSVHandler( void ) __attribute__ (( naked )); -void xPortSysTickHandler( void ) __attribute__ ((optimize("3"))); -void vPortSVCHandler( void ) __attribute__ (( naked )); +void xPortPendSVHandler( void ) __attribute__ (( naked )) PRIVILEGED_FUNCTION; +void xPortSysTickHandler( void ) __attribute__ ((optimize("3"))) PRIVILEGED_FUNCTION; +void vPortSVCHandler( void ) __attribute__ (( naked )) PRIVILEGED_FUNCTION; /* * 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 * 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 ) { -unsigned portLONG ulDummy; +unsigned long ulDummy; /* If using preemption, also force a context switch. */ #if configUSE_PREEMPTION == 1 @@ -480,7 +480,7 @@ unsigned long ulRegionSize, ulReturnValue = 4; } /*-----------------------------------------------------------*/ -portBASE_TYPE prvRaisePrivilege( void ) +static portBASE_TYPE prvRaisePrivilege( void ) { __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_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; 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(); @@ -759,7 +759,7 @@ portBASE_TYPE xRunningPrivileged = prvRaisePrivilege(); /*-----------------------------------------------------------*/ #if ( configGENERATE_RUN_TIME_STATS == 1 ) - void MPU_vTaskGetRunTimeStats( signed portCHAR *pcWriteBuffer ) + void MPU_vTaskGetRunTimeStats( signed char *pcWriteBuffer ) { portBASE_TYPE xRunningPrivileged = prvRaisePrivilege(); @@ -770,7 +770,7 @@ portBASE_TYPE xRunningPrivileged = prvRaisePrivilege(); /*-----------------------------------------------------------*/ #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(); @@ -781,9 +781,9 @@ portBASE_TYPE xRunningPrivileged = prvRaisePrivilege(); /*-----------------------------------------------------------*/ #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(); ulReturn = ulTaskEndTrace(); @@ -992,7 +992,7 @@ signed portBASE_TYPE xReturn; /*-----------------------------------------------------------*/ #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(); diff --git a/Source/queue.c b/Source/queue.c index f2fe31747..3bc2adef3 100644 --- a/Source/queue.c +++ b/Source/queue.c @@ -91,11 +91,11 @@ zero. */ */ typedef struct QueueDefinition { - signed portCHAR *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 *pcHead; /*< Points to the beginning of the queue storage area. */ + 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 portCHAR *pcReadFrom; /*< Points to the last place that a queued item was read from. */ + signed char *pcWriteTo; /*< Points to the free next place in the storage area. */ + 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 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. */ typedef struct QUEUE_REGISTRY_ITEM { - signed portCHAR *pcQueueName; + signed char *pcQueueName; xQueueHandle xHandle; } xQueueRegistryItem; @@ -173,7 +173,7 @@ unsigned portBASE_TYPE uxQueueMessagesWaitingFromISR( const xQueueHandle pxQueue /* Removes a queue from the registry by simply setting the pcQueueName member to NULL. */ 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 /* @@ -253,7 +253,7 @@ size_t xQueueSizeInBytes; longer than asked for to make wrap checking easier/faster. */ xQueueSizeInBytes = ( size_t ) ( uxQueueLength * uxItemSize ) + ( size_t ) 1; - pxNewQueue->pcHead = ( signed portCHAR * ) pvPortMalloc( xQueueSizeInBytes ); + pxNewQueue->pcHead = ( signed char * ) pvPortMalloc( xQueueSizeInBytes ); if( pxNewQueue->pcHead != NULL ) { /* Initialise the queue members as described above where the @@ -638,7 +638,7 @@ xTimeOutType xTimeOut; { signed portBASE_TYPE xEntryTimeSet = pdFALSE; xTimeOutType xTimeOut; - signed portCHAR *pcOriginalReadPosition; + signed char *pcOriginalReadPosition; for( ;; ) { @@ -815,7 +815,7 @@ signed portBASE_TYPE xQueueGenericReceive( xQueueHandle pxQueue, void * const pv { signed portBASE_TYPE xEntryTimeSet = pdFALSE; xTimeOutType xTimeOut; -signed portCHAR *pcOriginalReadPosition; +signed char *pcOriginalReadPosition; /* This function relaxes the coding standard somewhat to allow return statements within the function itself. This is done in the interest @@ -1414,7 +1414,7 @@ signed portBASE_TYPE xReturn; #if configQUEUE_REGISTRY_SIZE > 0 - void vQueueAddToRegistry( xQueueHandle xQueue, signed portCHAR *pcQueueName ) + void vQueueAddToRegistry( xQueueHandle xQueue, signed char *pcQueueName ) { unsigned portBASE_TYPE ux; diff --git a/Source/tasks.c b/Source/tasks.c index 306e60fa4..1005895cf 100644 --- a/Source/tasks.c +++ b/Source/tasks.c @@ -84,7 +84,7 @@ typedef struct tskTaskControlBlock 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. */ 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 ) 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 #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 } tskTCB; @@ -160,9 +160,9 @@ PRIVILEGED_DATA static unsigned portBASE_TYPE uxTaskNumber = ( unsigned po #if ( configGENERATE_RUN_TIME_STATS == 1 ) - PRIVILEGED_DATA static portCHAR pcStatsString[ 50 ] ; - PRIVILEGED_DATA static unsigned portLONG 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; + PRIVILEGED_DATA static char pcStatsString[ 50 ] ; + 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 char *pcWriteBuffer, xList *pxList, unsigned long ulTotalRunTime ) PRIVILEGED_FUNCTION; #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. */ -#define tskBLOCKED_CHAR ( ( signed portCHAR ) 'B' ) -#define tskREADY_CHAR ( ( signed portCHAR ) 'R' ) -#define tskDELETED_CHAR ( ( signed portCHAR ) 'D' ) -#define tskSUSPENDED_CHAR ( ( signed portCHAR ) 'S' ) +#define tskBLOCKED_CHAR ( ( signed char ) 'B' ) +#define tskREADY_CHAR ( ( signed char ) 'R' ) +#define tskDELETED_CHAR ( ( signed char ) 'D' ) +#define tskSUSPENDED_CHAR ( ( signed char ) 'S' ) /* * Macros and private variables used by the trace facility. */ #if ( configUSE_TRACE_FACILITY == 1 ) - #define tskSIZE_OF_EACH_TRACE_LINE ( ( unsigned portLONG ) ( sizeof( unsigned portLONG ) + sizeof( unsigned portLONG ) ) ) - PRIVILEGED_DATA static volatile signed portCHAR * volatile pcTraceBuffer; - PRIVILEGED_DATA static signed portCHAR *pcTraceBufferStart; - PRIVILEGED_DATA static signed portCHAR *pcTraceBufferEnd; + #define tskSIZE_OF_EACH_TRACE_LINE ( ( unsigned long ) ( sizeof( unsigned long ) + sizeof( unsigned long ) ) ) + PRIVILEGED_DATA static volatile signed char * volatile pcTraceBuffer; + PRIVILEGED_DATA static signed char *pcTraceBufferStart; + PRIVILEGED_DATA static signed char *pcTraceBufferEnd; PRIVILEGED_DATA static signed portBASE_TYPE xTracing = pdFALSE; static unsigned portBASE_TYPE uxPreviousTask = 255; - PRIVILEGED_DATA static portCHAR pcStatusString[ 50 ]; + PRIVILEGED_DATA static char pcStatusString[ 50 ]; #endif @@ -216,10 +216,10 @@ PRIVILEGED_DATA static unsigned portBASE_TYPE uxTaskNumber = ( unsigned po if( ( pcTraceBuffer + tskSIZE_OF_EACH_TRACE_LINE ) < pcTraceBufferEnd ) \ { \ uxPreviousTask = pxCurrentTCB->uxTCBNumber; \ - *( unsigned portLONG * ) pcTraceBuffer = ( unsigned portLONG ) xTickCount; \ - pcTraceBuffer += sizeof( unsigned portLONG ); \ - *( unsigned portLONG * ) pcTraceBuffer = ( unsigned portLONG ) uxPreviousTask; \ - pcTraceBuffer += sizeof( unsigned portLONG ); \ + *( unsigned long * ) pcTraceBuffer = ( unsigned long ) xTickCount; \ + pcTraceBuffer += sizeof( unsigned long ); \ + *( unsigned long * ) pcTraceBuffer = ( unsigned long ) uxPreviousTask; \ + pcTraceBuffer += sizeof( unsigned long ); \ } \ else \ { \ @@ -297,7 +297,7 @@ register tskTCB *pxTCB; \ * Utility to ready a TCB for a given task. Mainly just copies the parameters * 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 @@ -342,7 +342,7 @@ static void prvCheckTasksWaitingTermination( void ) PRIVILEGED_FUNCTION; * Allocates memory from the heap for a TCB and associated stack. Checks the * 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 @@ -355,7 +355,7 @@ static tskTCB *prvAllocateTCBAndStack( unsigned portSHORT usStackDepth, portSTAC */ #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 @@ -366,7 +366,7 @@ static tskTCB *prvAllocateTCBAndStack( unsigned portSHORT usStackDepth, portSTAC */ #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 @@ -379,7 +379,7 @@ static tskTCB *prvAllocateTCBAndStack( unsigned portSHORT usStackDepth, portSTAC * 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; tskTCB * pxNewTCB; @@ -411,7 +411,7 @@ portBASE_TYPE xRunPrivileged; #if( portSTACK_GROWTH < 0 ) { 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 { @@ -1017,7 +1017,7 @@ void vTaskStartScheduler( void ) portBASE_TYPE xReturn; /* 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 ) { @@ -1180,7 +1180,7 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void ) #if ( configUSE_TRACE_FACILITY == 1 ) - void vTaskList( signed portCHAR *pcWriteBuffer ) + void vTaskList( signed char *pcWriteBuffer ) { 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 report the task name, state and stack high water mark. */ - pcWriteBuffer[ 0 ] = ( signed portCHAR ) 0x00; - strcat( ( portCHAR * ) pcWriteBuffer, ( const portCHAR * ) "\r\n" ); + pcWriteBuffer[ 0 ] = ( signed char ) 0x00; + strcat( ( char * ) pcWriteBuffer, ( const char * ) "\r\n" ); uxQueue = uxTopUsedPriority + 1; @@ -1205,7 +1205,7 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void ) { prvListTaskWithinSingleList( pcWriteBuffer, ( xList * ) &( pxReadyTasksLists[ uxQueue ] ), tskREADY_CHAR ); } - }while( uxQueue > ( unsigned portSHORT ) tskIDLE_PRIORITY ); + }while( uxQueue > ( unsigned short ) tskIDLE_PRIORITY ); if( !listLIST_IS_EMPTY( pxDelayedTaskList ) ) { @@ -1243,10 +1243,10 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void ) #if ( configGENERATE_RUN_TIME_STATS == 1 ) - void vTaskGetRunTimeStats( signed portCHAR *pcWriteBuffer ) + void vTaskGetRunTimeStats( signed char *pcWriteBuffer ) { 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. 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 buffer. */ - pcWriteBuffer[ 0 ] = ( signed portCHAR ) 0x00; - strcat( ( portCHAR * ) pcWriteBuffer, ( const portCHAR * ) "\r\n" ); + pcWriteBuffer[ 0 ] = ( signed char ) 0x00; + strcat( ( char * ) pcWriteBuffer, ( const char * ) "\r\n" ); uxQueue = uxTopUsedPriority + 1; @@ -1270,7 +1270,7 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void ) { prvGenerateRunTimeStatsForTasksInList( pcWriteBuffer, ( xList * ) &( pxReadyTasksLists[ uxQueue ] ), ulTotalRunTime ); } - }while( uxQueue > ( unsigned portSHORT ) tskIDLE_PRIORITY ); + }while( uxQueue > ( unsigned short ) tskIDLE_PRIORITY ); if( !listLIST_IS_EMPTY( pxDelayedTaskList ) ) { @@ -1308,11 +1308,11 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void ) #if ( configUSE_TRACE_FACILITY == 1 ) - void vTaskStartTrace( signed portCHAR * pcBuffer, unsigned portLONG ulBufferSize ) + void vTaskStartTrace( signed char * pcBuffer, unsigned long ulBufferSize ) { portENTER_CRITICAL(); { - pcTraceBuffer = ( signed portCHAR * )pcBuffer; + pcTraceBuffer = ( signed char * )pcBuffer; pcTraceBufferStart = pcBuffer; pcTraceBufferEnd = pcBuffer + ( ulBufferSize - tskSIZE_OF_EACH_TRACE_LINE ); xTracing = pdTRUE; @@ -1325,15 +1325,15 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void ) #if ( configUSE_TRACE_FACILITY == 1 ) - unsigned portLONG ulTaskEndTrace( void ) + unsigned long ulTaskEndTrace( void ) { - unsigned portLONG ulBufferLength; + unsigned long ulBufferLength; portENTER_CRITICAL(); xTracing = pdFALSE; portEXIT_CRITICAL(); - ulBufferLength = ( unsigned portLONG ) ( pcTraceBuffer - pcTraceBufferStart ); + ulBufferLength = ( unsigned long ) ( pcTraceBuffer - pcTraceBufferStart ); return ulBufferLength; } @@ -1408,10 +1408,10 @@ void vTaskIncrementTick( void ) void vTaskCleanUpResources( void ) { - unsigned portSHORT usQueue; + unsigned short usQueue; 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. */ do @@ -1425,7 +1425,7 @@ void vTaskIncrementTick( void ) prvDeleteTCB( ( tskTCB * ) pxTCB ); } - }while( usQueue > ( unsigned portSHORT ) tskIDLE_PRIORITY ); + }while( usQueue > ( unsigned short ) tskIDLE_PRIORITY ); /* Remove any TCB's from the delayed queue. */ while( !listLIST_IS_EMPTY( &xDelayedTaskList1 ) ) @@ -1558,7 +1558,7 @@ void vTaskSwitchContext( void ) #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 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. */ #if configMAX_TASK_NAME_LEN > 1 { /* 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 - 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 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; @@ -2023,19 +2023,19 @@ tskTCB *pxNewTCB; #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; - unsigned portSHORT usStackRemaining; + unsigned short usStackRemaining; /* Write the details of all the TCB's in pxList into the buffer. */ listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList ); do { listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList ); - usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned portCHAR * ) 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 ); - strcat( ( portCHAR * ) pcWriteBuffer, ( portCHAR * ) pcStatusString ); + usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxStack ); + 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( ( char * ) pcWriteBuffer, ( char * ) pcStatusString ); } while( pxNextTCB != pxFirstTCB ); } @@ -2045,10 +2045,10 @@ tskTCB *pxNewTCB; #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; - unsigned portLONG ulStatsAsPercentage; + unsigned long ulStatsAsPercentage; /* Write the run time stats of all the TCB's in pxList into the buffer. */ listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList ); @@ -2064,7 +2064,7 @@ tskTCB *pxNewTCB; if( pxNextTCB->ulRunTimeCounter == 0 ) { /* 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 { @@ -2074,17 +2074,17 @@ tskTCB *pxNewTCB; 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 { /* If the percentage is zero here then the task has 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 ); @@ -2095,9 +2095,9 @@ tskTCB *pxNewTCB; #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 ) { @@ -2118,18 +2118,18 @@ tskTCB *pxNewTCB; unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask ) { tskTCB *pxTCB; - unsigned portCHAR *pcEndOfStack; + unsigned char *pcEndOfStack; unsigned portBASE_TYPE uxReturn; pxTCB = prvGetTCBFromHandle( xTask ); #if portSTACK_GROWTH < 0 { - pcEndOfStack = ( unsigned portCHAR * ) pxTCB->pxStack; + pcEndOfStack = ( unsigned char * ) pxTCB->pxStack; } #else { - pcEndOfStack = ( unsigned portCHAR * ) pxTCB->pxEndOfStack; + pcEndOfStack = ( unsigned char * ) pxTCB->pxEndOfStack; } #endif -- 2.39.5