From 2aa19f1a14c3d4fd320500bb1b2ac0a9548968b1 Mon Sep 17 00:00:00 2001
From: Richard Barry <ribarry@amazon.com>
Date: Tue, 31 Dec 2013 16:45:49 +0000
Subject: [PATCH] Add xEventGroupClearBitsFromISR() and
 xEventGroupGetBitsFromISR() functions. Move some types defines out of generic
 kernel headers into feature specific headers. Convert the function prototype
 dypedefs to the new _t naming.

---
 FreeRTOS/Source/event_groups.c                | 31 +++++++-
 FreeRTOS/Source/include/FreeRTOS.h            | 27 ++++---
 FreeRTOS/Source/include/event_groups.h        | 71 +++++++++++++++----
 FreeRTOS/Source/include/portable.h            |  4 +-
 FreeRTOS/Source/include/projdefs.h            | 11 ++-
 FreeRTOS/Source/include/queue.h               | 20 +++---
 FreeRTOS/Source/include/task.h                | 20 ++++--
 FreeRTOS/Source/include/timers.h              | 43 ++++++-----
 .../portable/BCC/16BitDOS/common/portcomn.c   |  2 +-
 .../Source/portable/CCS/ARM_Cortex-R4/port.c  |  2 +-
 FreeRTOS/Source/portable/CCS/MSP430X/port.c   |  2 +-
 .../portable/CodeWarrior/ColdFire_V1/port.c   |  2 +-
 .../portable/CodeWarrior/ColdFire_V2/port.c   |  2 +-
 .../Source/portable/CodeWarrior/HCS12/port.c  |  2 +-
 .../portable/GCC/ARM7_AT91FR40008/port.c      |  2 +-
 .../Source/portable/GCC/ARM7_AT91SAM7S/port.c |  2 +-
 .../Source/portable/GCC/ARM7_LPC2000/port.c   |  2 +-
 .../Source/portable/GCC/ARM7_LPC23xx/port.c   |  2 +-
 FreeRTOS/Source/portable/GCC/ARM_CM0/port.c   |  2 +-
 FreeRTOS/Source/portable/GCC/ARM_CM3/port.c   |  2 +-
 .../Source/portable/GCC/ARM_CM3_MPU/port.c    | 30 ++++----
 FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c  |  2 +-
 FreeRTOS/Source/portable/GCC/ATMega323/port.c |  2 +-
 FreeRTOS/Source/portable/GCC/AVR32_UC3/port.c |  2 +-
 .../Source/portable/GCC/CORTUS_APS3/port.c    |  2 +-
 .../Source/portable/GCC/ColdFire_V2/port.c    |  2 +-
 FreeRTOS/Source/portable/GCC/H8S2329/port.c   |  2 +-
 FreeRTOS/Source/portable/GCC/HCS12/port.c     |  2 +-
 FreeRTOS/Source/portable/GCC/MCF5235/port.c   |  2 +-
 .../Source/portable/GCC/MSP430F449/port.c     |  2 +-
 .../Source/portable/GCC/MicroBlaze/port.c     |  2 +-
 .../Source/portable/GCC/MicroBlazeV8/port.c   |  2 +-
 FreeRTOS/Source/portable/GCC/NiosII/port.c    |  2 +-
 .../Source/portable/GCC/PPC405_Xilinx/port.c  |  2 +-
 .../Source/portable/GCC/PPC440_Xilinx/port.c  |  2 +-
 FreeRTOS/Source/portable/GCC/RX100/port.c     |  2 +-
 FreeRTOS/Source/portable/GCC/RX600/port.c     |  2 +-
 FreeRTOS/Source/portable/GCC/STR75x/port.c    |  2 +-
 .../Source/portable/GCC/TriCore_1782/port.c   |  2 +-
 FreeRTOS/Source/portable/IAR/78K0R/port.c     |  2 +-
 FreeRTOS/Source/portable/IAR/ARM_CA9/port.c   |  2 +-
 FreeRTOS/Source/portable/IAR/ARM_CM0/port.c   |  2 +-
 FreeRTOS/Source/portable/IAR/ARM_CM3/port.c   |  2 +-
 FreeRTOS/Source/portable/IAR/ARM_CM4F/port.c  |  2 +-
 FreeRTOS/Source/portable/IAR/ATMega323/port.c |  2 +-
 FreeRTOS/Source/portable/IAR/AVR32_UC3/port.c |  2 +-
 .../Source/portable/IAR/AtmelSAM7S64/port.c   |  2 +-
 .../Source/portable/IAR/AtmelSAM9XE/port.c    |  2 +-
 FreeRTOS/Source/portable/IAR/LPC2000/port.c   |  2 +-
 FreeRTOS/Source/portable/IAR/MSP430/port.c    |  2 +-
 FreeRTOS/Source/portable/IAR/MSP430X/port.c   |  2 +-
 FreeRTOS/Source/portable/IAR/RL78/port.c      |  2 +-
 FreeRTOS/Source/portable/IAR/RX100/port.c     |  2 +-
 FreeRTOS/Source/portable/IAR/RX600/port.c     |  2 +-
 FreeRTOS/Source/portable/IAR/STR71x/port.c    |  2 +-
 FreeRTOS/Source/portable/IAR/STR75x/port.c    |  2 +-
 FreeRTOS/Source/portable/IAR/STR91x/port.c    |  2 +-
 FreeRTOS/Source/portable/IAR/V850ES/port.c    |  2 +-
 FreeRTOS/Source/portable/MPLAB/PIC18F/port.c  |  2 +-
 .../Source/portable/MPLAB/PIC24_dsPIC/port.c  |  2 +-
 FreeRTOS/Source/portable/MPLAB/PIC32MX/port.c |  2 +-
 FreeRTOS/Source/portable/MPLAB/PIC32MZ/port.c |  2 +-
 FreeRTOS/Source/portable/MSVC-MingW/port.c    |  2 +-
 .../Paradigm/Tern_EE/large_untested/port.c    |  2 +-
 .../portable/Paradigm/Tern_EE/small/port.c    |  2 +-
 .../Source/portable/RVDS/ARM7_LPC21xx/port.c  |  2 +-
 FreeRTOS/Source/portable/RVDS/ARM_CA9/port.c  |  2 +-
 FreeRTOS/Source/portable/RVDS/ARM_CM0/port.c  |  2 +-
 FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c  |  2 +-
 FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c |  2 +-
 FreeRTOS/Source/portable/Renesas/RX100/port.c |  2 +-
 FreeRTOS/Source/portable/Renesas/RX200/port.c |  2 +-
 FreeRTOS/Source/portable/Renesas/RX600/port.c |  2 +-
 .../Source/portable/Renesas/SH2A_FPU/port.c   |  2 +-
 .../Source/portable/Rowley/MSP430F449/port.c  |  2 +-
 FreeRTOS/Source/portable/SDCC/Cygnal/port.c   |  2 +-
 .../Source/portable/Softune/MB91460/port.c    |  2 +-
 .../Source/portable/Softune/MB96340/port.c    |  2 +-
 .../Source/portable/Tasking/ARM_CM4F/port.c   |  2 +-
 FreeRTOS/Source/portable/WizC/PIC18/port.c    |  2 +-
 .../oWatcom/16BitDOS/common/portcomn.c        |  2 +-
 FreeRTOS/Source/queue.c                       | 12 ++--
 FreeRTOS/Source/tasks.c                       | 10 +--
 FreeRTOS/Source/timers.c                      | 40 +++++------
 84 files changed, 273 insertions(+), 190 deletions(-)

diff --git a/FreeRTOS/Source/event_groups.c b/FreeRTOS/Source/event_groups.c
index c5017caf06..b192976aca 100644
--- a/FreeRTOS/Source/event_groups.c
+++ b/FreeRTOS/Source/event_groups.c
@@ -87,8 +87,8 @@ privileged Vs unprivileged linkage and placement. */
 	#error configUSE_TIMERS must be set to 1 to make the xEventGroupSetBitFromISR() function available.
 #endif
 
-#if ( INCLUDE_xEventGroupSetBitFromISR == 1 ) && ( INCLUDE_xTimerPendCallbackFromISR == 0 )
-	#error INCLUDE_xTimerPendCallbackFromISR must also be set to one to make the xEventGroupSetBitFromISR() function available.
+#if ( INCLUDE_xEventGroupSetBitFromISR == 1 ) && ( INCLUDE_xTimerPendFunctionCallFromISR == 0 )
+	#error INCLUDE_xTimerPendFunctionCallFromISR must also be set to one to make the xEventGroupSetBitFromISR() function available.
 #endif
 
 /* The following bit fields convey control information in a task's event list
@@ -424,6 +424,33 @@ EventBits_t uxReturn;
 }
 /*-----------------------------------------------------------*/
 
+EventBits_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear )
+{
+UBaseType_t uxSavedInterruptStatus;
+EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup;
+EventBits_t uxReturn;
+
+	/* Check the user is not attempting to clear the bits used by the kernel
+	itself. */
+	configASSERT( ( uxBitsToClear & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
+
+	uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
+	{
+		traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear );
+
+		/* The value returned is the event group value prior to the bits being
+		cleared. */
+		uxReturn = pxEventBits->uxEventBits;
+
+		/* Clear the bits. */
+		pxEventBits->uxEventBits &= ~uxBitsToClear;
+	}
+	portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+
+	return uxReturn;
+}
+/*-----------------------------------------------------------*/
+
 EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet )
 {
 ListItem_t *pxListItem, *pxNext;
diff --git a/FreeRTOS/Source/include/FreeRTOS.h b/FreeRTOS/Source/include/FreeRTOS.h
index 651bc3f457..59dca021f4 100644
--- a/FreeRTOS/Source/include/FreeRTOS.h
+++ b/FreeRTOS/Source/include/FreeRTOS.h
@@ -88,16 +88,6 @@ is included as it is used by the port layer. */
 /* Definitions specific to the port being used. */
 #include "portable.h"
 
-
-/* Defines the prototype to which the application task hook function must
-conform. */
-typedef BaseType_t (*pdTASK_HOOK_CODE)( void * );
-
-/* The type that holds event bits always matches TickType_t - therefore the
-number of bits it holds is set by configUSE_16_BIT_TICKS (16 bits if set to 1,
-32 bits if set to 0. */
-typedef TickType_t EventBits_t;
-
 /*
  * Check all the required application specific macros have been defined.
  * These macros are application specific and (as downloaded) are defined
@@ -246,8 +236,8 @@ typedef TickType_t EventBits_t;
 	#define INCLUDE_xEventGroupSetBitFromISR 0
 #endif
 
-#ifndef INCLUDE_xTimerPendCallbackFromISR
-	#define INCLUDE_xTimerPendCallbackFromISR 0
+#ifndef INCLUDE_xTimerPendFunctionCallFromISR
+	#define INCLUDE_xTimerPendFunctionCallFromISR 0
 #endif
 
 #ifndef configASSERT
@@ -584,6 +574,10 @@ typedef TickType_t EventBits_t;
 	#define traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear )
 #endif
 
+#ifndef traceEVENT_GROUP_CLEAR_BITS_FROM_ISR
+	#define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear )
+#endif
+
 #ifndef traceEVENT_GROUP_SET_BITS
 	#define traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet )
 #endif
@@ -701,16 +695,21 @@ typedef TickType_t EventBits_t;
 #define xQueueHandle QueueHandle_t
 #define xSemaphoreHandle SemaphoreHandle_t
 #define xQueueSetHandle QueueSetHandle_t
-#define xQueueSetMemberHandle QueueSetMember_t
+#define xQueueSetMemberHandle QueueSetMemberHandle_t
 #define xTimeoutType TimeOut_t
 #define xMemoryRegion MemoryRegion_t
 #define xTaskParameters TaskParameters_t
 #define xTaskStatusType	TaskStatus_t
 #define xTimerHandle TimerHandle_t
 #define xCoRoutineHandle CoRoutineHandle_t
+#define pdTASK_HOOK_CODE TaskHookFunction_t
+
+/* Backward compatibility within the scheduler code only - these definitions
+are not really required but are included for completeness. */
+#define trmTIMER_CALLBACK TimerCallbackFunction_t
+#define pdTASK_CODE TaskFunction_t
 #define xListItem ListItem_t
 #define xList List_t
-#define xTimeOutType TimeOut_t
 
 #endif /* INC_FREERTOS_H */
 
diff --git a/FreeRTOS/Source/include/event_groups.h b/FreeRTOS/Source/include/event_groups.h
index 6ede831abc..7233cefdf2 100644
--- a/FreeRTOS/Source/include/event_groups.h
+++ b/FreeRTOS/Source/include/event_groups.h
@@ -117,6 +117,16 @@ extern "C" {
  */
 typedef void * EventGroupHandle_t;
 
+/* 
+ * The type that holds event bits always matches TickType_t - therefore the
+ * number of bits it holds is set by configUSE_16_BIT_TICKS (16 bits if set to 1,
+ * 32 bits if set to 0. 
+ *
+ * \defgroup EventBits_t EventBits_t
+ * \ingroup EventGroup
+ */
+typedef TickType_t EventBits_t;
+
 /**
  * event_groups.h
  *<pre>
@@ -312,6 +322,20 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits
  */
 EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
 
+/**
+ * event_groups.h
+ *<pre>
+	EventBits_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear );
+ </pre>
+ *
+ * A version of xEventGroupClearBits() that can be called from an interrupt
+ * service routine.  See the xEventGroupClearBits() documentation.
+ *
+ * \defgroup xEventGroupClearBitsFromISR xEventGroupClearBitsFromISR
+ * \ingroup EventGroup
+ */
+EventBits_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
+
 /**
  * event_groups.h
  *<pre>
@@ -389,7 +413,7 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_
 /**
  * event_groups.h
  *<pre>
-	EventBits_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken );
+	BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken );
  </pre>
  *
  * A version of xEventGroupSetBits() that can be called from an interrupt.
@@ -418,9 +442,9 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_
  * *pxHigherPriorityTaskWoken must be initialised to pdFALSE.  See the
  * example code below.
  *
- * @return If the callback request was registered successfully then pdPASS is
- * returned, otherwise pdFALSE is returned.  pdFALSE will be returned if the
- * timer service queue was full.
+ * @return If the request to execute the function was posted successfully then 
+ * pdPASS is returned, otherwise pdFALSE is returned.  pdFALSE will be returned 
+ * if the timer service queue was full.
  *
  * Example usage:
    <pre>
@@ -433,28 +457,32 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_
 
    void anInterruptHandler( void )
    {
-   BaseType_t xHigherPriorityTaskWoken;
+   BaseType_t xHigherPriorityTaskWoken, xResult;
 
 		// xHigherPriorityTaskWoken must be initialised to pdFALSE.
 		xHigherPriorityTaskWoken = pdFALSE;
 
 		// Set bit 0 and bit 4 in xEventGroup.
-		uxBits = xEventGroupSetBitsFromISR(
+		xResult = xEventGroupSetBitsFromISR(
 							xEventGroup,	// The event group being updated.
 							BIT_0 | BIT_4   // The bits being set.
 							&xHigherPriorityTaskWoken );
 
-		// If xHigherPriorityTaskWoken is now set to pdTRUE then a context
-		// switch should be requested.  The macro used is port specific and will
-		// be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() - refer to
-		// the documentation page for the port being used.
-		portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
-   }
+		// Was the message posted successfully?
+		if( xResult == pdPASS )
+		{
+			// If xHigherPriorityTaskWoken is now set to pdTRUE then a context
+			// switch should be requested.  The macro used is port specific and 
+			// will be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() - 
+			// refer to the documentation page for the port being used.
+			portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
+		}
+  }
    </pre>
  * \defgroup xEventGroupSetBitsFromISR xEventGroupSetBitsFromISR
  * \ingroup EventGroup
  */
-#define xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken ) xTimerPendCallbackFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken )
+#define xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken ) xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken )
 
 /**
  * event_groups.h
@@ -601,6 +629,23 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t u
  */
 #define xEventGroupGetBits( xEventGroup ) xEventGroupClearBits( xEventGroup, 0 )
 
+/**
+ * event_groups.h
+ *<pre>
+	EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup );
+ </pre>
+ *
+ * A version of xEventGroupGetBits() that can be called from an ISR.
+ *
+ * @param xEventGroup The event group being queried.
+ *
+ * @return The event group bits at the time xEventGroupGetBitsFromISR() was called.
+ *
+ * \defgroup xEventGroupGetBitsFromISR xEventGroupGetBitsFromISR
+ * \ingroup EventGroup
+ */
+#define xEventGroupGetBitsFromISR( xEventGroup ) xEventGroupClearBitsFromISR( xEventGroup, 0 )
+
 /**
  * event_groups.h
  *<pre>
diff --git a/FreeRTOS/Source/include/portable.h b/FreeRTOS/Source/include/portable.h
index b28ecfdfe2..4bcc0b8223 100644
--- a/FreeRTOS/Source/include/portable.h
+++ b/FreeRTOS/Source/include/portable.h
@@ -358,9 +358,9 @@ extern "C" {
  *
  */
 #if( portUSING_MPU_WRAPPERS == 1 )
-	StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters, BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
+	StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters, BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
 #else
-	StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters ) PRIVILEGED_FUNCTION;
+	StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) PRIVILEGED_FUNCTION;
 #endif
 
 /*
diff --git a/FreeRTOS/Source/include/projdefs.h b/FreeRTOS/Source/include/projdefs.h
index 2d22596951..8f984fafe7 100644
--- a/FreeRTOS/Source/include/projdefs.h
+++ b/FreeRTOS/Source/include/projdefs.h
@@ -66,12 +66,11 @@
 #ifndef PROJDEFS_H
 #define PROJDEFS_H
 
-/* Defines the prototype to which task functions must conform. */
-typedef void (*pdTASK_CODE)( void * );
-
-/* Defines the prototype to which callback functions called from the RTOS/timer
-daemon task must conform. */
-typedef void (*pdAPPLICATION_CALLBACK_CODE)( void *, uint32_t );
+/* 
+ * Defines the prototype to which task functions must conform.  Defined in this
+ * file to ensure the type is known before portable.h is included.
+ */
+typedef void (*TaskFunction_t)( void * );
 
 #define pdFALSE			( ( BaseType_t ) 0 )
 #define pdTRUE			( ( BaseType_t ) 1 )
diff --git a/FreeRTOS/Source/include/queue.h b/FreeRTOS/Source/include/queue.h
index 1d86d2e168..087db7ffb0 100644
--- a/FreeRTOS/Source/include/queue.h
+++ b/FreeRTOS/Source/include/queue.h
@@ -92,10 +92,10 @@ typedef void * QueueSetHandle_t;
 
 /**
  * Queue sets can contain both queues and semaphores, so the
- * QueueSetMember_t is defined as a type to be used where a parameter or
+ * QueueSetMemberHandle_t is defined as a type to be used where a parameter or
  * return value can be either an QueueHandle_t or an SemaphoreHandle_t.
  */
-typedef void * QueueSetMember_t;
+typedef void * QueueSetMemberHandle_t;
 
 /* For internal use only. */
 #define	queueSEND_TO_BACK		( ( BaseType_t ) 0 )
@@ -1599,7 +1599,7 @@ QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILE
  * a call to xQueueSelectFromSet() has first returned a handle to that set member.
  *
  * @param xQueueOrSemaphore The handle of the queue or semaphore being added to
- * the queue set (cast to an QueueSetMember_t type).
+ * the queue set (cast to an QueueSetMemberHandle_t type).
  *
  * @param xQueueSet The handle of the queue set to which the queue or semaphore
  * is being added.
@@ -1609,7 +1609,7 @@ QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILE
  * queue set because it is already a member of a different queue set then pdFAIL
  * is returned.
  */
-BaseType_t xQueueAddToSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
+BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
 
 /*
  * Removes a queue or semaphore from a queue set.  A queue or semaphore can only
@@ -1619,7 +1619,7 @@ BaseType_t xQueueAddToSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t
  * function.
  *
  * @param xQueueOrSemaphore The handle of the queue or semaphore being removed
- * from the queue set (cast to an QueueSetMember_t type).
+ * from the queue set (cast to an QueueSetMemberHandle_t type).
  *
  * @param xQueueSet The handle of the queue set in which the queue or semaphore
  * is included.
@@ -1628,7 +1628,7 @@ BaseType_t xQueueAddToSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t
  * then pdPASS is returned.  If the queue was not in the queue set, or the
  * queue (or semaphore) was not empty, then pdFAIL is returned.
  */
-BaseType_t xQueueRemoveFromSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
+BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
 
 /*
  * xQueueSelectFromSet() selects from the members of a queue set a queue or
@@ -1659,17 +1659,17 @@ BaseType_t xQueueRemoveFromSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHand
  * operation.
  *
  * @return xQueueSelectFromSet() will return the handle of a queue (cast to
- * a QueueSetMember_t type) contained in the queue set that contains data,
- * or the handle of a semaphore (cast to a QueueSetMember_t type) contained
+ * a QueueSetMemberHandle_t type) contained in the queue set that contains data,
+ * or the handle of a semaphore (cast to a QueueSetMemberHandle_t type) contained
  * in the queue set that is available, or NULL if no such queue or semaphore
  * exists before before the specified block time expires.
  */
-QueueSetMember_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet, const TickType_t xBlockTimeTicks ) PRIVILEGED_FUNCTION;
+QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet, const TickType_t xBlockTimeTicks ) PRIVILEGED_FUNCTION;
 
 /*
  * A version of xQueueSelectFromSet() that can be used from an ISR.
  */
-QueueSetMember_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
+QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
 
 /* Not public API functions. */
 void vQueueWaitForMessageRestricted( QueueHandle_t xQueue, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
diff --git a/FreeRTOS/Source/include/task.h b/FreeRTOS/Source/include/task.h
index 849ed35d81..2c0effe286 100644
--- a/FreeRTOS/Source/include/task.h
+++ b/FreeRTOS/Source/include/task.h
@@ -95,6 +95,12 @@ extern "C" {
  */
 typedef void * TaskHandle_t;
 
+/* 
+ * Defines the prototype to which the application task hook function must
+ * conform. 
+ */
+typedef BaseType_t (*TaskHookFunction_t)( void * );
+
 /* Task states returned by eTaskGetState. */
 typedef enum
 {
@@ -129,7 +135,7 @@ typedef struct xMEMORY_REGION
  */
 typedef struct xTASK_PARAMETERS
 {
-	pdTASK_CODE pvTaskCode;
+	TaskFunction_t pvTaskCode;
 	const char * const pcName;	/*lint !e971 Unqualified char types are allowed for strings and single characters only. */
 	uint16_t usStackDepth;
 	void *pvParameters;
@@ -242,7 +248,7 @@ is used in assert() statements. */
  * task. h
  *<pre>
  BaseType_t xTaskCreate(
-							  pdTASK_CODE pvTaskCode,
+							  TaskFunction_t pvTaskCode,
 							  const char * const pcName,
 							  uint16_t usStackDepth,
 							  void *pvParameters,
@@ -1111,7 +1117,7 @@ char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; /*lint
 UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
 
 /* When using trace macros it is sometimes necessary to include task.h before
-FreeRTOS.h.  When this is done pdTASK_HOOK_CODE will not yet have been defined,
+FreeRTOS.h.  When this is done TaskHookFunction_t will not yet have been defined,
 so the following two prototypes will cause a compilation error.  This can be
 fixed by simply guarding against the inclusion of these two prototypes unless
 they are explicitly required by the configUSE_APPLICATION_TASK_TAG configuration
@@ -1120,13 +1126,13 @@ constant. */
 	#if configUSE_APPLICATION_TASK_TAG == 1
 		/**
 		 * task.h
-		 * <pre>void vTaskSetApplicationTaskTag( TaskHandle_t xTask, pdTASK_HOOK_CODE pxHookFunction );</pre>
+		 * <pre>void vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction );</pre>
 		 *
 		 * Sets pxHookFunction to be the task hook function used by the task xTask.
 		 * Passing xTask as NULL has the effect of setting the calling tasks hook
 		 * function.
 		 */
-		void vTaskSetApplicationTaskTag( TaskHandle_t xTask, pdTASK_HOOK_CODE pxHookFunction ) PRIVILEGED_FUNCTION;
+		void vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction ) PRIVILEGED_FUNCTION;
 
 		/**
 		 * task.h
@@ -1134,7 +1140,7 @@ constant. */
 		 *
 		 * Returns the pxHookFunction value assigned to the task xTask.
 		 */
-		pdTASK_HOOK_CODE xTaskGetApplicationTaskTag( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+		TaskHookFunction_t xTaskGetApplicationTaskTag( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
 	#endif /* configUSE_APPLICATION_TASK_TAG ==1 */
 #endif /* ifdef configUSE_APPLICATION_TASK_TAG */
 
@@ -1515,7 +1521,7 @@ void vTaskPriorityDisinherit( TaskHandle_t const pxMutexHolder ) PRIVILEGED_FUNC
  * Generic version of the task creation function which is in turn called by the
  * xTaskCreate() and xTaskCreateRestricted() macros.
  */
-BaseType_t xTaskGenericCreate( pdTASK_CODE pxTaskCode, const char * const pcName, const uint16_t usStackDepth, void * const pvParameters, UBaseType_t uxPriority, TaskHandle_t * const pxCreatedTask, StackType_t * const puxStackBuffer, const MemoryRegion_t * const xRegions ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+BaseType_t xTaskGenericCreate( TaskFunction_t pxTaskCode, const char * const pcName, const uint16_t usStackDepth, void * const pvParameters, UBaseType_t uxPriority, TaskHandle_t * const pxCreatedTask, StackType_t * const puxStackBuffer, const MemoryRegion_t * const xRegions ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
 
 /*
  * Get the uxTCBNumber assigned to the task referenced by the xTask parameter.
diff --git a/FreeRTOS/Source/include/timers.h b/FreeRTOS/Source/include/timers.h
index 3029330d95..99de22748d 100644
--- a/FreeRTOS/Source/include/timers.h
+++ b/FreeRTOS/Source/include/timers.h
@@ -101,15 +101,23 @@ as defined below. */
  */
 typedef void * TimerHandle_t;
 
-/* Define the prototype to which timer callback functions must conform. */
-typedef void (*tmrTIMER_CALLBACK)( TimerHandle_t xTimer );
+/* 
+ * Defines the prototype to which timer callback functions must conform. 
+ */
+typedef void (*TimerCallbackFunction_t)( TimerHandle_t xTimer );
+
+/* 
+ * Defines the prototype to which functions used with the 
+ * xTimerPendFunctionCallFromISR() function must conform.
+ */
+typedef void (*PendedFunction_t)( void *, uint32_t );
 
 /**
  * TimerHandle_t xTimerCreate( 	const char * const pcTimerName,
  * 								TickType_t xTimerPeriodInTicks,
  * 								UBaseType_t uxAutoReload,
  * 								void * pvTimerID,
- * 								tmrTIMER_CALLBACK pxCallbackFunction );
+ * 								TimerCallbackFunction_t pxCallbackFunction );
  *
  * Creates a new software timer instance.  This allocates the storage required
  * by the new timer, initialises the new timers internal state, and returns a
@@ -143,7 +151,7 @@ typedef void (*tmrTIMER_CALLBACK)( TimerHandle_t xTimer );
  * timer.
  *
  * @param pxCallbackFunction The function to call when the timer expires.
- * Callback functions must have the prototype defined by tmrTIMER_CALLBACK,
+ * Callback functions must have the prototype defined by TimerCallbackFunction_t,
  * which is	"void vCallbackFunction( TimerHandle_t xTimer );".
  *
  * @return If the timer is successfully created then a handle to the newly
@@ -233,7 +241,7 @@ typedef void (*tmrTIMER_CALLBACK)( TimerHandle_t xTimer );
  * }
  * @endverbatim
  */
-TimerHandle_t xTimerCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, tmrTIMER_CALLBACK pxCallbackFunction ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+TimerHandle_t xTimerCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
 
 /**
  * void *pvTimerGetTimerID( TimerHandle_t xTimer );
@@ -951,30 +959,29 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
 
 
 /**
- * BaseType_t xTimerPendCallbackFromISR( pdAPPLICATION_CALLBACK_CODE pvCallbackFunction,
+ * BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend,
  *                                          void *pvParameter1,
  *                                          uint32_t ulParameter2,
  *                                          BaseType_t *pxHigherPriorityTaskWoken );
  *
  *
- * Can be used by interrupt service routines to request that a function (the
- * callback function) is executed from a task context.
+ * Used from application interrupt service routines to defer the execution of a
+ * function to the RTOS daemon task (the timer service task, hence this function 
+ * is implemented in timers.c and is prefixed with 'Timer').
  *
  * Ideally an interrupt service routine (ISR) is kept as short as possible, but
  * sometimes an ISR either has a lot of processing to do, or needs to perform
- * processing that is not deterministic.  In these cases the processing can be
- * deferred to be performed in a task - allowing the ISR to exit.  The timer
- * daemon service/daemon task is already responsible for executing software
- * timer callback functions, so is also used to executed callback functions that
- * are pended from interrupts.
+ * processing that is not deterministic.  In these cases 
+ * xTimerPendFunctionCallFromISR() can be used to defer processing of a function 
+ * to the RTOS daemon task.
  *
  * A mechanism is provided that allows the interrupt to return directly to the
  * task that will subsequently execute the pended callback function.  This
  * allows the callback function to execute contiguously in time with the
  * interrupt - just as if the callback had executed in the interrupt itself.
  *
- * @param pvCallbackFunction The function to execute from the timer service/
- * daemon task.  The function must conform to the pdAPPLICATION_CALLBACK_CODE
+ * @param xFunctionToPend The function to execute from the timer service/
+ * daemon task.  The function must conform to the PendedFunction_t
  * prototype.
  *
  * @param pvParameter1 The value of the callback function's first parameter.
@@ -990,7 +997,7 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
  * configTIMER_TASK_PRIORITY in FreeRTOSConfig.h) is higher than the priority of
  * the currently running task (the task the interrupt interrupted) then
  * *pxHigherPriorityTaskWoken will be set to pdTRUE within
- * xTimerPendCallbackFromISR(), indicating that a context switch should be
+ * xTimerPendFunctionCallFromISR(), indicating that a context switch should be
  * requested before the interrupt exits.  For that reason
  * *pxHigherPriorityTaskWoken must be initialised to pdFALSE.  See the
  * example code below.
@@ -1028,7 +1035,7 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
  *		// service is passed in the second parameter.  The first parameter is
  *		// not used in this case.
  *		xHigherPriorityTaskWoken = pdFALSE;
- *		xTimerPendCallbackFromISR( vProcessInterface, NULL, ( uint32_t ) xInterfaceToService, &xHigherPriorityTaskWoken );
+ *		xTimerPendFunctionCallFromISR( vProcessInterface, NULL, ( uint32_t ) xInterfaceToService, &xHigherPriorityTaskWoken );
  *
  *		// If xHigherPriorityTaskWoken is now set to pdTRUE then a context
  *		// switch should be requested.  The macro used is port specific and will
@@ -1039,7 +1046,7 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
  *	}
  * @endverbatim
  */
-BaseType_t xTimerPendCallbackFromISR( pdAPPLICATION_CALLBACK_CODE pvCallbackFunction, void *pvParameter1, uint32_t ulParameter2, BaseType_t *pxHigherPriorityTaskWoken );
+BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, BaseType_t *pxHigherPriorityTaskWoken );
 
 /*
  * Functions beyond this part are not part of the public API and are intended
diff --git a/FreeRTOS/Source/portable/BCC/16BitDOS/common/portcomn.c b/FreeRTOS/Source/portable/BCC/16BitDOS/common/portcomn.c
index ded7c32bc3..12ec88969c 100644
--- a/FreeRTOS/Source/portable/BCC/16BitDOS/common/portcomn.c
+++ b/FreeRTOS/Source/portable/BCC/16BitDOS/common/portcomn.c
@@ -83,7 +83,7 @@ Changes from V2.6.1
 /*-----------------------------------------------------------*/
 
 /* See header file for description. */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t DS_Reg = 0;
 
diff --git a/FreeRTOS/Source/portable/CCS/ARM_Cortex-R4/port.c b/FreeRTOS/Source/portable/CCS/ARM_Cortex-R4/port.c
index 93481c32ae..f7fe26648f 100644
--- a/FreeRTOS/Source/portable/CCS/ARM_Cortex-R4/port.c
+++ b/FreeRTOS/Source/portable/CCS/ARM_Cortex-R4/port.c
@@ -115,7 +115,7 @@ uint32_t ulTaskHasFPUContext = 0;
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t *pxOriginalTOS;
 
diff --git a/FreeRTOS/Source/portable/CCS/MSP430X/port.c b/FreeRTOS/Source/portable/CCS/MSP430X/port.c
index 69d81325cc..1e90ee9eed 100644
--- a/FreeRTOS/Source/portable/CCS/MSP430X/port.c
+++ b/FreeRTOS/Source/portable/CCS/MSP430X/port.c
@@ -107,7 +107,7 @@ void vPortSetupTimerInterrupt( void );
  *
  * See the header file portable.h.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 uint16_t *pusTopOfStack;
 uint32_t *pulTopOfStack, ulTemp;
diff --git a/FreeRTOS/Source/portable/CodeWarrior/ColdFire_V1/port.c b/FreeRTOS/Source/portable/CodeWarrior/ColdFire_V1/port.c
index f4f1d29070..abd3dc75a5 100644
--- a/FreeRTOS/Source/portable/CodeWarrior/ColdFire_V1/port.c
+++ b/FreeRTOS/Source/portable/CodeWarrior/ColdFire_V1/port.c
@@ -88,7 +88,7 @@ static uint32_t ulCriticalNesting = 0x9999UL;
 
 /*-----------------------------------------------------------*/
 
-StackType_t *pxPortInitialiseStack( StackType_t * pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t * pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 
 uint32_t ulOriginalA5;
diff --git a/FreeRTOS/Source/portable/CodeWarrior/ColdFire_V2/port.c b/FreeRTOS/Source/portable/CodeWarrior/ColdFire_V2/port.c
index 0874951da7..d2d543215f 100644
--- a/FreeRTOS/Source/portable/CodeWarrior/ColdFire_V2/port.c
+++ b/FreeRTOS/Source/portable/CodeWarrior/ColdFire_V2/port.c
@@ -95,7 +95,7 @@ static uint32_t ulCriticalNesting = 0x9999UL;
 
 /*-----------------------------------------------------------*/
 
-StackType_t *pxPortInitialiseStack( StackType_t * pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t * pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	*pxTopOfStack = ( StackType_t ) pvParameters;
 	pxTopOfStack--;
diff --git a/FreeRTOS/Source/portable/CodeWarrior/HCS12/port.c b/FreeRTOS/Source/portable/CodeWarrior/HCS12/port.c
index 0b00b3f572..24cb86dda4 100644
--- a/FreeRTOS/Source/portable/CodeWarrior/HCS12/port.c
+++ b/FreeRTOS/Source/portable/CodeWarrior/HCS12/port.c
@@ -110,7 +110,7 @@ volatile UBaseType_t uxCriticalNesting = 0xff;
 /* 
  * See header file for description. 
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* 
 		Place a few bytes of known values on the bottom of the stack.
diff --git a/FreeRTOS/Source/portable/GCC/ARM7_AT91FR40008/port.c b/FreeRTOS/Source/portable/GCC/ARM7_AT91FR40008/port.c
index 508e66bd24..127b97dfc7 100644
--- a/FreeRTOS/Source/portable/GCC/ARM7_AT91FR40008/port.c
+++ b/FreeRTOS/Source/portable/GCC/ARM7_AT91FR40008/port.c
@@ -111,7 +111,7 @@ extern void vPortISRStartFirstTask( void );
  *
  * See header file for description. 
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t *pxOriginalTOS;
 
diff --git a/FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/port.c b/FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/port.c
index 818444ea25..7f35bf6646 100644
--- a/FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/port.c
+++ b/FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/port.c
@@ -120,7 +120,7 @@ extern void vPortISRStartFirstTask( void );
  *
  * See header file for description. 
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t *pxOriginalTOS;
 
diff --git a/FreeRTOS/Source/portable/GCC/ARM7_LPC2000/port.c b/FreeRTOS/Source/portable/GCC/ARM7_LPC2000/port.c
index ec43a2cef4..8be8803f94 100644
--- a/FreeRTOS/Source/portable/GCC/ARM7_LPC2000/port.c
+++ b/FreeRTOS/Source/portable/GCC/ARM7_LPC2000/port.c
@@ -116,7 +116,7 @@ extern void vPortISRStartFirstTask( void );
  *
  * See header file for description. 
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t *pxOriginalTOS;
 
diff --git a/FreeRTOS/Source/portable/GCC/ARM7_LPC23xx/port.c b/FreeRTOS/Source/portable/GCC/ARM7_LPC23xx/port.c
index 54c72d71ae..c0ac727a11 100644
--- a/FreeRTOS/Source/portable/GCC/ARM7_LPC23xx/port.c
+++ b/FreeRTOS/Source/portable/GCC/ARM7_LPC23xx/port.c
@@ -116,7 +116,7 @@ extern void vPortISRStartFirstTask( void );
  *
  * See header file for description. 
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t *pxOriginalTOS;
 
diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM0/port.c b/FreeRTOS/Source/portable/GCC/ARM_CM0/port.c
index e7c8e68f7f..020700eefc 100644
--- a/FreeRTOS/Source/portable/GCC/ARM_CM0/port.c
+++ b/FreeRTOS/Source/portable/GCC/ARM_CM0/port.c
@@ -127,7 +127,7 @@ static void prvTaskExitError( void );
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Simulate the stack frame as it would be created by a context switch
 	interrupt. */
diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c b/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c
index 6ea767cbfc..9644ac4a7c 100644
--- a/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c
+++ b/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c
@@ -202,7 +202,7 @@ static void prvTaskExitError( void );
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Simulate the stack frame as it would be created by a context switch
 	interrupt. */
diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/port.c b/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/port.c
index c18f8e9aa1..00550ff980 100644
--- a/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/port.c
+++ b/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/port.c
@@ -170,7 +170,7 @@ static void prvSVCHandler( uint32_t *pulRegisters ) __attribute__(( noinline ))
 /*
  * Prototypes for all the MPU wrappers.
  */
-BaseType_t MPU_xTaskGenericCreate( pdTASK_CODE pvTaskCode, const char * const pcName, uint16_t usStackDepth, void *pvParameters, UBaseType_t uxPriority, TaskHandle_t *pxCreatedTask, StackType_t *puxStackBuffer, const MemoryRegion_t * const xRegions );
+BaseType_t MPU_xTaskGenericCreate( TaskFunction_t pvTaskCode, const char * const pcName, uint16_t usStackDepth, void *pvParameters, UBaseType_t uxPriority, TaskHandle_t *pxCreatedTask, StackType_t *puxStackBuffer, const MemoryRegion_t * const xRegions );
 void MPU_vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const xRegions );
 void MPU_vTaskDelete( TaskHandle_t pxTaskToDelete );
 void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, TickType_t xTimeIncrement );
@@ -187,8 +187,8 @@ TickType_t MPU_xTaskGetTickCount( void );
 UBaseType_t MPU_uxTaskGetNumberOfTasks( void );
 void MPU_vTaskList( char *pcWriteBuffer );
 void MPU_vTaskGetRunTimeStats( char *pcWriteBuffer );
-void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask, pdTASK_HOOK_CODE pxTagValue );
-pdTASK_HOOK_CODE MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask );
+void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxTagValue );
+TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask );
 BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter );
 UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask );
 TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void );
@@ -213,9 +213,9 @@ void MPU_vPortFree( void *pv );
 void MPU_vPortInitialiseBlocks( void );
 size_t MPU_xPortGetFreeHeapSize( void );
 QueueSetHandle_t MPU_xQueueCreateSet( UBaseType_t uxEventQueueLength );
-QueueSetMember_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet, TickType_t xBlockTimeTicks );
-BaseType_t MPU_xQueueAddToSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet );
-BaseType_t MPU_xQueueRemoveFromSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet );
+QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet, TickType_t xBlockTimeTicks );
+BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet );
+BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet );
 BaseType_t MPU_xQueuePeekFromISR( QueueHandle_t xQueue, void * const pvBuffer );
 
 /*-----------------------------------------------------------*/
@@ -223,7 +223,7 @@ BaseType_t MPU_xQueuePeekFromISR( QueueHandle_t xQueue, void * const pvBuffer );
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters, BaseType_t xRunPrivileged )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters, BaseType_t xRunPrivileged )
 {
 	/* Simulate the stack frame as it would be created by a context switch
 	interrupt. */
@@ -673,7 +673,7 @@ uint32_t ul;
 }
 /*-----------------------------------------------------------*/
 
-BaseType_t MPU_xTaskGenericCreate( pdTASK_CODE pvTaskCode, const char * const pcName, uint16_t usStackDepth, void *pvParameters, UBaseType_t uxPriority, TaskHandle_t *pxCreatedTask, StackType_t *puxStackBuffer, const MemoryRegion_t * const xRegions )
+BaseType_t MPU_xTaskGenericCreate( TaskFunction_t pvTaskCode, const char * const pcName, uint16_t usStackDepth, void *pvParameters, UBaseType_t uxPriority, TaskHandle_t *pxCreatedTask, StackType_t *puxStackBuffer, const MemoryRegion_t * const xRegions )
 {
 BaseType_t xReturn;
 BaseType_t xRunningPrivileged = prvRaisePrivilege();
@@ -876,7 +876,7 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
 /*-----------------------------------------------------------*/
 
 #if ( configUSE_APPLICATION_TASK_TAG == 1 )
-	void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask, pdTASK_HOOK_CODE pxTagValue )
+	void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxTagValue )
 	{
     BaseType_t xRunningPrivileged = prvRaisePrivilege();
 
@@ -887,9 +887,9 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
 /*-----------------------------------------------------------*/
 
 #if ( configUSE_APPLICATION_TASK_TAG == 1 )
-	pdTASK_HOOK_CODE MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask )
+	TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask )
 	{
-	pdTASK_HOOK_CODE xReturn;
+	TaskHookFunction_t xReturn;
     BaseType_t xRunningPrivileged = prvRaisePrivilege();
 
 		xReturn = xTaskGetApplicationTaskTag( xTask );
@@ -1096,9 +1096,9 @@ BaseType_t xReturn;
 /*-----------------------------------------------------------*/
 
 #if ( configUSE_QUEUE_SETS == 1 )
-	QueueSetMember_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet, TickType_t xBlockTimeTicks )
+	QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet, TickType_t xBlockTimeTicks )
 	{
-	QueueSetMember_t xReturn;
+	QueueSetMemberHandle_t xReturn;
 	BaseType_t xRunningPrivileged = prvRaisePrivilege();
 
 		xReturn = xQueueSelectFromSet( xQueueSet, xBlockTimeTicks );
@@ -1109,7 +1109,7 @@ BaseType_t xReturn;
 /*-----------------------------------------------------------*/
 
 #if ( configUSE_QUEUE_SETS == 1 )
-	BaseType_t MPU_xQueueAddToSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )
+	BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )
 	{
 	BaseType_t xReturn;
 	BaseType_t xRunningPrivileged = prvRaisePrivilege();
@@ -1122,7 +1122,7 @@ BaseType_t xReturn;
 /*-----------------------------------------------------------*/
 
 #if ( configUSE_QUEUE_SETS == 1 )
-	BaseType_t MPU_xQueueRemoveFromSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )
+	BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )
 	{
 	BaseType_t xReturn;
 	BaseType_t xRunningPrivileged = prvRaisePrivilege();
diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c b/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c
index fff011dcf8..b222f45bab 100644
--- a/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c
+++ b/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c
@@ -209,7 +209,7 @@ static void prvTaskExitError( void );
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Simulate the stack frame as it would be created by a context switch
 	interrupt. */
diff --git a/FreeRTOS/Source/portable/GCC/ATMega323/port.c b/FreeRTOS/Source/portable/GCC/ATMega323/port.c
index 3a8a272116..3aba2133db 100644
--- a/FreeRTOS/Source/portable/GCC/ATMega323/port.c
+++ b/FreeRTOS/Source/portable/GCC/ATMega323/port.c
@@ -220,7 +220,7 @@ static void prvSetupTimerInterrupt( void );
 /* 
  * See header file for description. 
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 uint16_t usAddress;
 
diff --git a/FreeRTOS/Source/portable/GCC/AVR32_UC3/port.c b/FreeRTOS/Source/portable/GCC/AVR32_UC3/port.c
index 1c4a1339f6..225d8015cd 100644
--- a/FreeRTOS/Source/portable/GCC/AVR32_UC3/port.c
+++ b/FreeRTOS/Source/portable/GCC/AVR32_UC3/port.c
@@ -298,7 +298,7 @@ __attribute__((__noinline__)) void vPortExitCritical( void )
  *
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Setup the initial stack of the task.  The stack is set exactly as
 	expected by the portRESTORE_CONTEXT() macro. */
diff --git a/FreeRTOS/Source/portable/GCC/CORTUS_APS3/port.c b/FreeRTOS/Source/portable/GCC/CORTUS_APS3/port.c
index c37435c34a..b5869ca4cd 100644
--- a/FreeRTOS/Source/portable/GCC/CORTUS_APS3/port.c
+++ b/FreeRTOS/Source/portable/GCC/CORTUS_APS3/port.c
@@ -86,7 +86,7 @@
 static void prvSetupTimerInterrupt( void );
 /*-----------------------------------------------------------*/
 
-StackType_t *pxPortInitialiseStack( StackType_t * pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t * pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Make space on the stack for the context - this leaves a couple of spaces
 	empty.  */
diff --git a/FreeRTOS/Source/portable/GCC/ColdFire_V2/port.c b/FreeRTOS/Source/portable/GCC/ColdFire_V2/port.c
index 0646f10b79..0ee7a7d3bc 100644
--- a/FreeRTOS/Source/portable/GCC/ColdFire_V2/port.c
+++ b/FreeRTOS/Source/portable/GCC/ColdFire_V2/port.c
@@ -78,7 +78,7 @@ static uint32_t ulCriticalNesting = 0x9999UL;
 
 /*-----------------------------------------------------------*/
 
-StackType_t *pxPortInitialiseStack( StackType_t * pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t * pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	*pxTopOfStack = ( StackType_t ) pvParameters;
 	pxTopOfStack--;
diff --git a/FreeRTOS/Source/portable/GCC/H8S2329/port.c b/FreeRTOS/Source/portable/GCC/H8S2329/port.c
index 5dec2fdb55..b33e2b9173 100644
--- a/FreeRTOS/Source/portable/GCC/H8S2329/port.c
+++ b/FreeRTOS/Source/portable/GCC/H8S2329/port.c
@@ -101,7 +101,7 @@ void vPortYield( void ) __attribute__ ( ( saveall, interrupt_handler ) );
 /* 
  * See header file for description. 
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 uint32_t ulValue;
 
diff --git a/FreeRTOS/Source/portable/GCC/HCS12/port.c b/FreeRTOS/Source/portable/GCC/HCS12/port.c
index 5f9752ae42..12a5b6dcb4 100644
--- a/FreeRTOS/Source/portable/GCC/HCS12/port.c
+++ b/FreeRTOS/Source/portable/GCC/HCS12/port.c
@@ -111,7 +111,7 @@ volatile UBaseType_t uxCriticalNesting = 0x80;  // un-initialized
 /* 
  * See header file for description. 
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 
 
diff --git a/FreeRTOS/Source/portable/GCC/MCF5235/port.c b/FreeRTOS/Source/portable/GCC/MCF5235/port.c
index cb3d2c1d81..092ea51de6 100644
--- a/FreeRTOS/Source/portable/GCC/MCF5235/port.c
+++ b/FreeRTOS/Source/portable/GCC/MCF5235/port.c
@@ -102,7 +102,7 @@ static void prvPortPreemptiveTick ( void );
 /* ------------------------ Start implementation -------------------------- */
 
 StackType_t *
-pxPortInitialiseStack( StackType_t * pxTopOfStack, pdTASK_CODE pxCode,
+pxPortInitialiseStack( StackType_t * pxTopOfStack, TaskFunction_t pxCode,
                        void *pvParameters )
 {
     /* Place the parameter on the stack in the expected location. */
diff --git a/FreeRTOS/Source/portable/GCC/MSP430F449/port.c b/FreeRTOS/Source/portable/GCC/MSP430F449/port.c
index c67277f671..27676ecab0 100644
--- a/FreeRTOS/Source/portable/GCC/MSP430F449/port.c
+++ b/FreeRTOS/Source/portable/GCC/MSP430F449/port.c
@@ -178,7 +178,7 @@ static void prvSetupTimerInterrupt( void );
  * 
  * See the header file portable.h.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* 
 		Place a few bytes of known values on the bottom of the stack. 
diff --git a/FreeRTOS/Source/portable/GCC/MicroBlaze/port.c b/FreeRTOS/Source/portable/GCC/MicroBlaze/port.c
index b4726ee95d..7b4f45ef4d 100644
--- a/FreeRTOS/Source/portable/GCC/MicroBlaze/port.c
+++ b/FreeRTOS/Source/portable/GCC/MicroBlaze/port.c
@@ -119,7 +119,7 @@ static void prvSetupTimerInterrupt( void );
  * 
  * See the header file portable.h.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 extern void *_SDA2_BASE_, *_SDA_BASE_;
 const uint32_t ulR2 = ( uint32_t ) &_SDA2_BASE_;
diff --git a/FreeRTOS/Source/portable/GCC/MicroBlazeV8/port.c b/FreeRTOS/Source/portable/GCC/MicroBlazeV8/port.c
index f6cb4f3eef..274bdbff01 100644
--- a/FreeRTOS/Source/portable/GCC/MicroBlazeV8/port.c
+++ b/FreeRTOS/Source/portable/GCC/MicroBlazeV8/port.c
@@ -139,7 +139,7 @@ static XIntc xInterruptControllerInstance;
  *
  * See the portable.h header file.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 extern void *_SDA2_BASE_, *_SDA_BASE_;
 const uint32_t ulR2 = ( uint32_t ) &_SDA2_BASE_;
diff --git a/FreeRTOS/Source/portable/GCC/NiosII/port.c b/FreeRTOS/Source/portable/GCC/NiosII/port.c
index 506a62a714..bf1cdaa9a5 100644
--- a/FreeRTOS/Source/portable/GCC/NiosII/port.c
+++ b/FreeRTOS/Source/portable/GCC/NiosII/port.c
@@ -106,7 +106,7 @@ static void prvReadGp( uint32_t *ulValue )
 /* 
  * See header file for description. 
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {    
 StackType_t *pxFramePointer = pxTopOfStack - 1;
 StackType_t xGlobalPointer;
diff --git a/FreeRTOS/Source/portable/GCC/PPC405_Xilinx/port.c b/FreeRTOS/Source/portable/GCC/PPC405_Xilinx/port.c
index 7537f5181f..5fbb365fb2 100644
--- a/FreeRTOS/Source/portable/GCC/PPC405_Xilinx/port.c
+++ b/FreeRTOS/Source/portable/GCC/PPC405_Xilinx/port.c
@@ -134,7 +134,7 @@ static XIntc xInterruptController;
  * 
  * See the header file portable.h.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Place a known value at the bottom of the stack for debugging. */
 	*pxTopOfStack = 0xDEADBEEF;
diff --git a/FreeRTOS/Source/portable/GCC/PPC440_Xilinx/port.c b/FreeRTOS/Source/portable/GCC/PPC440_Xilinx/port.c
index 0f72e12771..3b40a723ab 100644
--- a/FreeRTOS/Source/portable/GCC/PPC440_Xilinx/port.c
+++ b/FreeRTOS/Source/portable/GCC/PPC440_Xilinx/port.c
@@ -134,7 +134,7 @@ static XIntc xInterruptController;
  *
  * See the header file portable.h.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Place a known value at the bottom of the stack for debugging. */
 	*pxTopOfStack = 0xDEADBEEF;
diff --git a/FreeRTOS/Source/portable/GCC/RX100/port.c b/FreeRTOS/Source/portable/GCC/RX100/port.c
index 57f70fd532..f96bf965cd 100644
--- a/FreeRTOS/Source/portable/GCC/RX100/port.c
+++ b/FreeRTOS/Source/portable/GCC/RX100/port.c
@@ -192,7 +192,7 @@ static const uint32_t ulMatchValueForOneTick = ( ( configPERIPHERAL_CLOCK_HZ / p
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Offset to end up on 8 byte boundary. */
 	pxTopOfStack--;
diff --git a/FreeRTOS/Source/portable/GCC/RX600/port.c b/FreeRTOS/Source/portable/GCC/RX600/port.c
index 7c9cdf66d3..d91f01ed24 100644
--- a/FreeRTOS/Source/portable/GCC/RX600/port.c
+++ b/FreeRTOS/Source/portable/GCC/RX600/port.c
@@ -121,7 +121,7 @@ extern void *pxCurrentTCB;
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* R0 is not included as it is the stack pointer. */
 
diff --git a/FreeRTOS/Source/portable/GCC/STR75x/port.c b/FreeRTOS/Source/portable/GCC/STR75x/port.c
index ebcc99e6af..44e0de8400 100644
--- a/FreeRTOS/Source/portable/GCC/STR75x/port.c
+++ b/FreeRTOS/Source/portable/GCC/STR75x/port.c
@@ -101,7 +101,7 @@ static void prvSetupTimerInterrupt( void );
  *
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t *pxOriginalTOS;
 
diff --git a/FreeRTOS/Source/portable/GCC/TriCore_1782/port.c b/FreeRTOS/Source/portable/GCC/TriCore_1782/port.c
index 73abb4e737..903f2a68f8 100644
--- a/FreeRTOS/Source/portable/GCC/TriCore_1782/port.c
+++ b/FreeRTOS/Source/portable/GCC/TriCore_1782/port.c
@@ -133,7 +133,7 @@ static const uint32_t ulCompareMatchValue = ( configPERIPHERAL_CLOCK_HZ / config
 
 /*-----------------------------------------------------------*/
 
-StackType_t *pxPortInitialiseStack( StackType_t * pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t * pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 uint32_t *pulUpperCSA = NULL;
 uint32_t *pulLowerCSA = NULL;
diff --git a/FreeRTOS/Source/portable/IAR/78K0R/port.c b/FreeRTOS/Source/portable/IAR/78K0R/port.c
index ea951ff2af..ee934ac3e7 100644
--- a/FreeRTOS/Source/portable/IAR/78K0R/port.c
+++ b/FreeRTOS/Source/portable/IAR/78K0R/port.c
@@ -119,7 +119,7 @@ static void prvSetupTimerInterrupt( void );
  *
  * See the header file portable.h.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 uint32_t *pulLocal;
 
diff --git a/FreeRTOS/Source/portable/IAR/ARM_CA9/port.c b/FreeRTOS/Source/portable/IAR/ARM_CA9/port.c
index a83b07bd41..f33dc4ae9e 100644
--- a/FreeRTOS/Source/portable/IAR/ARM_CA9/port.c
+++ b/FreeRTOS/Source/portable/IAR/ARM_CA9/port.c
@@ -189,7 +189,7 @@ uint32_t ulPortInterruptNesting = 0UL;
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Setup the initial stack of the task.  The stack is set exactly as
 	expected by the portRESTORE_CONTEXT() macro.
diff --git a/FreeRTOS/Source/portable/IAR/ARM_CM0/port.c b/FreeRTOS/Source/portable/IAR/ARM_CM0/port.c
index 9db99de7c6..2771e852a2 100644
--- a/FreeRTOS/Source/portable/IAR/ARM_CM0/port.c
+++ b/FreeRTOS/Source/portable/IAR/ARM_CM0/port.c
@@ -124,7 +124,7 @@ static void prvTaskExitError( void );
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Simulate the stack frame as it would be created by a context switch
 	interrupt. */
diff --git a/FreeRTOS/Source/portable/IAR/ARM_CM3/port.c b/FreeRTOS/Source/portable/IAR/ARM_CM3/port.c
index fb66670e69..f250501199 100644
--- a/FreeRTOS/Source/portable/IAR/ARM_CM3/port.c
+++ b/FreeRTOS/Source/portable/IAR/ARM_CM3/port.c
@@ -198,7 +198,7 @@ static void prvTaskExitError( void );
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Simulate the stack frame as it would be created by a context switch
 	interrupt. */
diff --git a/FreeRTOS/Source/portable/IAR/ARM_CM4F/port.c b/FreeRTOS/Source/portable/IAR/ARM_CM4F/port.c
index 6fcb6a9f51..1767a16d0d 100644
--- a/FreeRTOS/Source/portable/IAR/ARM_CM4F/port.c
+++ b/FreeRTOS/Source/portable/IAR/ARM_CM4F/port.c
@@ -206,7 +206,7 @@ static void prvTaskExitError( void );
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Simulate the stack frame as it would be created by a context switch
 	interrupt. */
diff --git a/FreeRTOS/Source/portable/IAR/ATMega323/port.c b/FreeRTOS/Source/portable/IAR/ATMega323/port.c
index 920caa27f8..1235c5f71d 100644
--- a/FreeRTOS/Source/portable/IAR/ATMega323/port.c
+++ b/FreeRTOS/Source/portable/IAR/ATMega323/port.c
@@ -108,7 +108,7 @@ extern void vPortStart( void );
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 uint16_t usAddress;
 StackType_t *pxTopOfHardwareStack;
diff --git a/FreeRTOS/Source/portable/IAR/AVR32_UC3/port.c b/FreeRTOS/Source/portable/IAR/AVR32_UC3/port.c
index 94fdaa0d7d..4ad0f5b387 100644
--- a/FreeRTOS/Source/portable/IAR/AVR32_UC3/port.c
+++ b/FreeRTOS/Source/portable/IAR/AVR32_UC3/port.c
@@ -267,7 +267,7 @@ void vPortExitCritical( void )
  *
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Setup the initial stack of the task.  The stack is set exactly as
 	expected by the portRESTORE_CONTEXT() macro. */
diff --git a/FreeRTOS/Source/portable/IAR/AtmelSAM7S64/port.c b/FreeRTOS/Source/portable/IAR/AtmelSAM7S64/port.c
index 3109ad90b4..e4e1d68fec 100644
--- a/FreeRTOS/Source/portable/IAR/AtmelSAM7S64/port.c
+++ b/FreeRTOS/Source/portable/IAR/AtmelSAM7S64/port.c
@@ -109,7 +109,7 @@ uint32_t ulCriticalNesting = ( uint32_t ) 9999;
  *
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t *pxOriginalTOS;
 
diff --git a/FreeRTOS/Source/portable/IAR/AtmelSAM9XE/port.c b/FreeRTOS/Source/portable/IAR/AtmelSAM9XE/port.c
index 35960f6eac..ca6f09c7e2 100644
--- a/FreeRTOS/Source/portable/IAR/AtmelSAM9XE/port.c
+++ b/FreeRTOS/Source/portable/IAR/AtmelSAM9XE/port.c
@@ -124,7 +124,7 @@ uint32_t ulCriticalNesting = ( uint32_t ) 9999;
  *
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t *pxOriginalTOS;
 
diff --git a/FreeRTOS/Source/portable/IAR/LPC2000/port.c b/FreeRTOS/Source/portable/IAR/LPC2000/port.c
index d47d72ab23..47f00f3ad5 100644
--- a/FreeRTOS/Source/portable/IAR/LPC2000/port.c
+++ b/FreeRTOS/Source/portable/IAR/LPC2000/port.c
@@ -133,7 +133,7 @@ uint32_t ulCriticalNesting = ( uint32_t ) 9999;
  *
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t *pxOriginalTOS;
 
diff --git a/FreeRTOS/Source/portable/IAR/MSP430/port.c b/FreeRTOS/Source/portable/IAR/MSP430/port.c
index e864e262a2..17ea070708 100644
--- a/FreeRTOS/Source/portable/IAR/MSP430/port.c
+++ b/FreeRTOS/Source/portable/IAR/MSP430/port.c
@@ -107,7 +107,7 @@ void vPortSetupTimerInterrupt( void );
  *
  * See the header file portable.h.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/*
 		Place a few bytes of known values on the bottom of the stack.
diff --git a/FreeRTOS/Source/portable/IAR/MSP430X/port.c b/FreeRTOS/Source/portable/IAR/MSP430X/port.c
index f3b8708264..0013db72d2 100644
--- a/FreeRTOS/Source/portable/IAR/MSP430X/port.c
+++ b/FreeRTOS/Source/portable/IAR/MSP430X/port.c
@@ -107,7 +107,7 @@ void vPortSetupTimerInterrupt( void );
  *
  * See the header file portable.h.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 uint16_t *pusTopOfStack;
 uint32_t *pulTopOfStack;
diff --git a/FreeRTOS/Source/portable/IAR/RL78/port.c b/FreeRTOS/Source/portable/IAR/RL78/port.c
index e31f1b57a2..8bc4eb7a95 100644
--- a/FreeRTOS/Source/portable/IAR/RL78/port.c
+++ b/FreeRTOS/Source/portable/IAR/RL78/port.c
@@ -128,7 +128,7 @@ extern void vPortStartFirstTask( void );
  *
  * See the header file portable.h.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 uint32_t *pulLocal;
 
diff --git a/FreeRTOS/Source/portable/IAR/RX100/port.c b/FreeRTOS/Source/portable/IAR/RX100/port.c
index 40895072d6..10bfe15715 100644
--- a/FreeRTOS/Source/portable/IAR/RX100/port.c
+++ b/FreeRTOS/Source/portable/IAR/RX100/port.c
@@ -180,7 +180,7 @@ static const uint32_t ulMatchValueForOneTick = ( ( configPERIPHERAL_CLOCK_HZ / p
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Offset to end up on 8 byte boundary. */
 	pxTopOfStack--;
diff --git a/FreeRTOS/Source/portable/IAR/RX600/port.c b/FreeRTOS/Source/portable/IAR/RX600/port.c
index 444716ec33..2eb672034b 100644
--- a/FreeRTOS/Source/portable/IAR/RX600/port.c
+++ b/FreeRTOS/Source/portable/IAR/RX600/port.c
@@ -107,7 +107,7 @@ extern void *pxCurrentTCB;
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* R0 is not included as it is the stack pointer. */
 
diff --git a/FreeRTOS/Source/portable/IAR/STR71x/port.c b/FreeRTOS/Source/portable/IAR/STR71x/port.c
index 446d916115..9907db7f6f 100644
--- a/FreeRTOS/Source/portable/IAR/STR71x/port.c
+++ b/FreeRTOS/Source/portable/IAR/STR71x/port.c
@@ -113,7 +113,7 @@ void vPortPreemptiveTick( void );
  *
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t *pxOriginalTOS;
 
diff --git a/FreeRTOS/Source/portable/IAR/STR75x/port.c b/FreeRTOS/Source/portable/IAR/STR75x/port.c
index 2d7db2bb11..fa7b06dba7 100644
--- a/FreeRTOS/Source/portable/IAR/STR75x/port.c
+++ b/FreeRTOS/Source/portable/IAR/STR75x/port.c
@@ -108,7 +108,7 @@ __arm void vPortPreemptiveTick( void );
  *
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t *pxOriginalTOS;
 
diff --git a/FreeRTOS/Source/portable/IAR/STR91x/port.c b/FreeRTOS/Source/portable/IAR/STR91x/port.c
index 019fe9e209..8dafbcc3c9 100644
--- a/FreeRTOS/Source/portable/IAR/STR91x/port.c
+++ b/FreeRTOS/Source/portable/IAR/STR91x/port.c
@@ -153,7 +153,7 @@ static void prvDefaultHandler( void );
  *
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	StackType_t *pxOriginalTOS;
 
diff --git a/FreeRTOS/Source/portable/IAR/V850ES/port.c b/FreeRTOS/Source/portable/IAR/V850ES/port.c
index edf7bf116a..efa55ec55b 100644
--- a/FreeRTOS/Source/portable/IAR/V850ES/port.c
+++ b/FreeRTOS/Source/portable/IAR/V850ES/port.c
@@ -90,7 +90,7 @@ volatile StackType_t usCriticalNesting = portINITIAL_CRITICAL_NESTING;
 static void prvSetupTimerInterrupt( void );
 
 /*-----------------------------------------------------------*/
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	*pxTopOfStack = ( StackType_t ) pxCode;          /* Task function start address */
 	pxTopOfStack--;
diff --git a/FreeRTOS/Source/portable/MPLAB/PIC18F/port.c b/FreeRTOS/Source/portable/MPLAB/PIC18F/port.c
index 089bfa67bc..74d15c5ca4 100644
--- a/FreeRTOS/Source/portable/MPLAB/PIC18F/port.c
+++ b/FreeRTOS/Source/portable/MPLAB/PIC18F/port.c
@@ -380,7 +380,7 @@ static void prvLowInterrupt( void );
 /* 
  * See header file for description. 
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 uint32_t ulAddress;
 uint8_t ucBlock;
diff --git a/FreeRTOS/Source/portable/MPLAB/PIC24_dsPIC/port.c b/FreeRTOS/Source/portable/MPLAB/PIC24_dsPIC/port.c
index 7cca24a3ac..b9b585c760 100644
--- a/FreeRTOS/Source/portable/MPLAB/PIC24_dsPIC/port.c
+++ b/FreeRTOS/Source/portable/MPLAB/PIC24_dsPIC/port.c
@@ -194,7 +194,7 @@ void vApplicationSetupTickTimerInterrupt( void );
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 uint16_t usCode;
 UBaseType_t i;
diff --git a/FreeRTOS/Source/portable/MPLAB/PIC32MX/port.c b/FreeRTOS/Source/portable/MPLAB/PIC32MX/port.c
index b988edd841..ac1a1fa0e8 100644
--- a/FreeRTOS/Source/portable/MPLAB/PIC32MX/port.c
+++ b/FreeRTOS/Source/portable/MPLAB/PIC32MX/port.c
@@ -195,7 +195,7 @@ const StackType_t * const xISRStackTop = &( xISRStack[ configISR_STACK_SIZE - 7
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Ensure byte alignment is maintained when leaving this function. */
 	pxTopOfStack--;
diff --git a/FreeRTOS/Source/portable/MPLAB/PIC32MZ/port.c b/FreeRTOS/Source/portable/MPLAB/PIC32MZ/port.c
index dcef42d91c..ab4203aa41 100644
--- a/FreeRTOS/Source/portable/MPLAB/PIC32MZ/port.c
+++ b/FreeRTOS/Source/portable/MPLAB/PIC32MZ/port.c
@@ -201,7 +201,7 @@ const StackType_t * const xISRStackTop = &( xISRStack[ configISR_STACK_SIZE - 7
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Ensure byte alignment is maintained when leaving this function. */
 	pxTopOfStack--;
diff --git a/FreeRTOS/Source/portable/MSVC-MingW/port.c b/FreeRTOS/Source/portable/MSVC-MingW/port.c
index 603d771b13..f937796eb4 100644
--- a/FreeRTOS/Source/portable/MSVC-MingW/port.c
+++ b/FreeRTOS/Source/portable/MSVC-MingW/port.c
@@ -237,7 +237,7 @@ TIMECAPS xTimeCaps;
 }
 /*-----------------------------------------------------------*/
 
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 xThreadState *pxThreadState = NULL;
 int8_t *pcTopOfStack = ( int8_t * ) pxTopOfStack;
diff --git a/FreeRTOS/Source/portable/Paradigm/Tern_EE/large_untested/port.c b/FreeRTOS/Source/portable/Paradigm/Tern_EE/large_untested/port.c
index 570745f570..bfdb9f2212 100644
--- a/FreeRTOS/Source/portable/Paradigm/Tern_EE/large_untested/port.c
+++ b/FreeRTOS/Source/portable/Paradigm/Tern_EE/large_untested/port.c
@@ -113,7 +113,7 @@ static void __interrupt __far prvDummyISR( void );
 
 /*-----------------------------------------------------------*/
 /* See header file for description. */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t DS_Reg = 0;
 
diff --git a/FreeRTOS/Source/portable/Paradigm/Tern_EE/small/port.c b/FreeRTOS/Source/portable/Paradigm/Tern_EE/small/port.c
index 7ed2dd1b84..6919cb5c4d 100644
--- a/FreeRTOS/Source/portable/Paradigm/Tern_EE/small/port.c
+++ b/FreeRTOS/Source/portable/Paradigm/Tern_EE/small/port.c
@@ -110,7 +110,7 @@ static void __interrupt __far prvYieldProcessor( void );
 
 /*-----------------------------------------------------------*/
 /* See header file for description. */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t DS_Reg = 0;
 
diff --git a/FreeRTOS/Source/portable/RVDS/ARM7_LPC21xx/port.c b/FreeRTOS/Source/portable/RVDS/ARM7_LPC21xx/port.c
index a9d6e005c7..f6e41907a1 100644
--- a/FreeRTOS/Source/portable/RVDS/ARM7_LPC21xx/port.c
+++ b/FreeRTOS/Source/portable/RVDS/ARM7_LPC21xx/port.c
@@ -119,7 +119,7 @@ extern __asm void vPortStartFirstTask( void );
 /* 
  * See header file for description. 
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t *pxOriginalTOS;
 
diff --git a/FreeRTOS/Source/portable/RVDS/ARM_CA9/port.c b/FreeRTOS/Source/portable/RVDS/ARM_CA9/port.c
index 745e84051e..4f635a4445 100644
--- a/FreeRTOS/Source/portable/RVDS/ARM_CA9/port.c
+++ b/FreeRTOS/Source/portable/RVDS/ARM_CA9/port.c
@@ -228,7 +228,7 @@ uint32_t ulPortInterruptNesting = 0UL;
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Setup the initial stack of the task.  The stack is set exactly as
 	expected by the portRESTORE_CONTEXT() macro.
diff --git a/FreeRTOS/Source/portable/RVDS/ARM_CM0/port.c b/FreeRTOS/Source/portable/RVDS/ARM_CM0/port.c
index da750ae980..5bd928f297 100644
--- a/FreeRTOS/Source/portable/RVDS/ARM_CM0/port.c
+++ b/FreeRTOS/Source/portable/RVDS/ARM_CM0/port.c
@@ -121,7 +121,7 @@ static void prvTaskExitError( void );
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Simulate the stack frame as it would be created by a context switch
 	interrupt. */
diff --git a/FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c b/FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c
index e54b7673fd..4216659dbc 100644
--- a/FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c
+++ b/FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c
@@ -206,7 +206,7 @@ static void prvTaskExitError( void );
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Simulate the stack frame as it would be created by a context switch
 	interrupt. */
diff --git a/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c b/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c
index e2bdaad7f0..f46b8a58df 100644
--- a/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c
+++ b/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c
@@ -216,7 +216,7 @@ static void prvTaskExitError( void );
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Simulate the stack frame as it would be created by a context switch
 	interrupt. */
diff --git a/FreeRTOS/Source/portable/Renesas/RX100/port.c b/FreeRTOS/Source/portable/Renesas/RX100/port.c
index 7b82e48d3b..2492cc27ad 100644
--- a/FreeRTOS/Source/portable/Renesas/RX100/port.c
+++ b/FreeRTOS/Source/portable/Renesas/RX100/port.c
@@ -199,7 +199,7 @@ static const uint32_t ulMatchValueForOneTick = ( ( configPERIPHERAL_CLOCK_HZ / p
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Offset to end up on 8 byte boundary. */
 	pxTopOfStack--;
diff --git a/FreeRTOS/Source/portable/Renesas/RX200/port.c b/FreeRTOS/Source/portable/Renesas/RX200/port.c
index 638b59d9d9..95c4b28c10 100644
--- a/FreeRTOS/Source/portable/Renesas/RX200/port.c
+++ b/FreeRTOS/Source/portable/Renesas/RX200/port.c
@@ -126,7 +126,7 @@ extern void vTaskSwitchContext( void );
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Offset to end up on 8 byte boundary. */
 	pxTopOfStack--;
diff --git a/FreeRTOS/Source/portable/Renesas/RX600/port.c b/FreeRTOS/Source/portable/Renesas/RX600/port.c
index 9ec2931ed8..9a5a9abd88 100644
--- a/FreeRTOS/Source/portable/Renesas/RX600/port.c
+++ b/FreeRTOS/Source/portable/Renesas/RX600/port.c
@@ -127,7 +127,7 @@ extern void vTaskSwitchContext( void );
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* R0 is not included as it is the stack pointer. */
 
diff --git a/FreeRTOS/Source/portable/Renesas/SH2A_FPU/port.c b/FreeRTOS/Source/portable/Renesas/SH2A_FPU/port.c
index 1fd30d300a..6e66f2730a 100644
--- a/FreeRTOS/Source/portable/Renesas/SH2A_FPU/port.c
+++ b/FreeRTOS/Source/portable/Renesas/SH2A_FPU/port.c
@@ -109,7 +109,7 @@ extern uint32_t ulPortGetGBR( void );
 /* 
  * See header file for description. 
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Mark the end of the stack - used for debugging only and can be removed. */
 	*pxTopOfStack = 0x11111111UL;
diff --git a/FreeRTOS/Source/portable/Rowley/MSP430F449/port.c b/FreeRTOS/Source/portable/Rowley/MSP430F449/port.c
index 5ab8c4c6a5..6cb08b85c5 100644
--- a/FreeRTOS/Source/portable/Rowley/MSP430F449/port.c
+++ b/FreeRTOS/Source/portable/Rowley/MSP430F449/port.c
@@ -107,7 +107,7 @@ void prvSetupTimerInterrupt( void );
  * 
  * See the header file portable.h.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* 
 		Place a few bytes of known values on the bottom of the stack. 
diff --git a/FreeRTOS/Source/portable/SDCC/Cygnal/port.c b/FreeRTOS/Source/portable/SDCC/Cygnal/port.c
index 6de6385786..3550a5f38c 100644
--- a/FreeRTOS/Source/portable/SDCC/Cygnal/port.c
+++ b/FreeRTOS/Source/portable/SDCC/Cygnal/port.c
@@ -250,7 +250,7 @@ static void prvSetupTimerInterrupt( void );
 /* 
  * See header file for description. 
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 uint32_t ulAddress;
 StackType_t *pxStartOfStack;
diff --git a/FreeRTOS/Source/portable/Softune/MB91460/port.c b/FreeRTOS/Source/portable/Softune/MB91460/port.c
index 0e9d47a21a..14f4799a8b 100644
--- a/FreeRTOS/Source/portable/Softune/MB91460/port.c
+++ b/FreeRTOS/Source/portable/Softune/MB91460/port.c
@@ -143,7 +143,7 @@ static void prvSetupTimerInterrupt( void );
  * 
  * See the header file portable.h.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Place a few bytes of known values on the bottom of the stack. 
 	This is just useful for debugging. */
diff --git a/FreeRTOS/Source/portable/Softune/MB96340/port.c b/FreeRTOS/Source/portable/Softune/MB96340/port.c
index 1fb04a680e..5d781fa6b1 100644
--- a/FreeRTOS/Source/portable/Softune/MB96340/port.c
+++ b/FreeRTOS/Source/portable/Softune/MB96340/port.c
@@ -298,7 +298,7 @@ _xGet_DTB_PCB_bank:
  * 
  * See the header file portable.h.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Place a few bytes of known values on the bottom of the stack. 
 	This is just useful for debugging. */
diff --git a/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c b/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c
index 3cc163bfaf..e44116d528 100644
--- a/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c
+++ b/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c
@@ -136,7 +136,7 @@ const uint32_t ulMaxSyscallInterruptPriorityConst = configMAX_SYSCALL_INTERRUPT_
 /*
  * See header file for description.
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 	/* Simulate the stack frame as it would be created by a context switch
 	interrupt. */
diff --git a/FreeRTOS/Source/portable/WizC/PIC18/port.c b/FreeRTOS/Source/portable/WizC/PIC18/port.c
index 1a26a58935..2e91ac91e9 100644
--- a/FreeRTOS/Source/portable/WizC/PIC18/port.c
+++ b/FreeRTOS/Source/portable/WizC/PIC18/port.c
@@ -143,7 +143,7 @@ register uint8_t ucCriticalNesting = 0x7F;
  * Initialise the stack of a new task.
  * See portSAVE_CONTEXT macro for description. 
  */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 uint8_t ucScratch;
 	/*
diff --git a/FreeRTOS/Source/portable/oWatcom/16BitDOS/common/portcomn.c b/FreeRTOS/Source/portable/oWatcom/16BitDOS/common/portcomn.c
index 29d90048ac..260f532864 100644
--- a/FreeRTOS/Source/portable/oWatcom/16BitDOS/common/portcomn.c
+++ b/FreeRTOS/Source/portable/oWatcom/16BitDOS/common/portcomn.c
@@ -88,7 +88,7 @@ Changes from V2.6.1:
 /*-----------------------------------------------------------*/
 
 /* See header file for description. */
-StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 {
 StackType_t DS_Reg = 0, *pxOriginalSP;
 
diff --git a/FreeRTOS/Source/queue.c b/FreeRTOS/Source/queue.c
index eafbd0efee..8a9b1cfdf2 100644
--- a/FreeRTOS/Source/queue.c
+++ b/FreeRTOS/Source/queue.c
@@ -2247,7 +2247,7 @@ BaseType_t xReturn;
 
 #if ( configUSE_QUEUE_SETS == 1 )
 
-	BaseType_t xQueueAddToSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )
+	BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )
 	{
 	BaseType_t xReturn;
 
@@ -2280,7 +2280,7 @@ BaseType_t xReturn;
 
 #if ( configUSE_QUEUE_SETS == 1 )
 
-	BaseType_t xQueueRemoveFromSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )
+	BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )
 	{
 	BaseType_t xReturn;
 	Queue_t * const pxQueueOrSemaphore = ( Queue_t * ) xQueueOrSemaphore;
@@ -2316,9 +2316,9 @@ BaseType_t xReturn;
 
 #if ( configUSE_QUEUE_SETS == 1 )
 
-	QueueSetMember_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet, TickType_t const xBlockTimeTicks )
+	QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet, TickType_t const xBlockTimeTicks )
 	{
-	QueueSetMember_t xReturn = NULL;
+	QueueSetMemberHandle_t xReturn = NULL;
 
 		( void ) xQueueGenericReceive( ( QueueHandle_t ) xQueueSet, &xReturn, xBlockTimeTicks, pdFALSE ); /*lint !e961 Casting from one typedef to another is not redundant. */
 		return xReturn;
@@ -2329,9 +2329,9 @@ BaseType_t xReturn;
 
 #if ( configUSE_QUEUE_SETS == 1 )
 
-	QueueSetMember_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet )
+	QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet )
 	{
-	QueueSetMember_t xReturn = NULL;
+	QueueSetMemberHandle_t xReturn = NULL;
 
 		( void ) xQueueReceiveFromISR( ( QueueHandle_t ) xQueueSet, &xReturn, NULL ); /*lint !e961 Casting from one typedef to another is not redundant. */
 		return xReturn;
diff --git a/FreeRTOS/Source/tasks.c b/FreeRTOS/Source/tasks.c
index f89adc564b..f123ec7598 100644
--- a/FreeRTOS/Source/tasks.c
+++ b/FreeRTOS/Source/tasks.c
@@ -149,7 +149,7 @@ typedef struct tskTaskControlBlock
 	#endif
 
 	#if ( configUSE_APPLICATION_TASK_TAG == 1 )
-		pdTASK_HOOK_CODE pxTaskTag;
+		TaskHookFunction_t pxTaskTag;
 	#endif
 
 	#if ( configGENERATE_RUN_TIME_STATS == 1 )
@@ -492,7 +492,7 @@ static void prvResetNextTaskUnblockTime( void );
 
 /*-----------------------------------------------------------*/
 
-BaseType_t xTaskGenericCreate( pdTASK_CODE pxTaskCode, const char * const pcName, const uint16_t usStackDepth, void * const pvParameters, UBaseType_t uxPriority, TaskHandle_t * const pxCreatedTask, StackType_t * const puxStackBuffer, const MemoryRegion_t * const xRegions ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+BaseType_t xTaskGenericCreate( TaskFunction_t pxTaskCode, const char * const pcName, const uint16_t usStackDepth, void * const pvParameters, UBaseType_t uxPriority, TaskHandle_t * const pxCreatedTask, StackType_t * const puxStackBuffer, const MemoryRegion_t * const xRegions ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
 {
 BaseType_t xReturn;
 TCB_t * pxNewTCB;
@@ -1990,7 +1990,7 @@ BaseType_t xSwitchRequired = pdFALSE;
 
 #if ( configUSE_APPLICATION_TASK_TAG == 1 )
 
-	void vTaskSetApplicationTaskTag( TaskHandle_t xTask, pdTASK_HOOK_CODE pxHookFunction )
+	void vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction )
 	{
 	TCB_t *xTCB;
 
@@ -2017,10 +2017,10 @@ BaseType_t xSwitchRequired = pdFALSE;
 
 #if ( configUSE_APPLICATION_TASK_TAG == 1 )
 
-	pdTASK_HOOK_CODE xTaskGetApplicationTaskTag( TaskHandle_t xTask )
+	TaskHookFunction_t xTaskGetApplicationTaskTag( TaskHandle_t xTask )
 	{
 	TCB_t *xTCB;
-	pdTASK_HOOK_CODE xReturn;
+	TaskHookFunction_t xReturn;
 
 		/* If xTask is NULL then we are setting our own task hook. */
 		if( xTask == NULL )
diff --git a/FreeRTOS/Source/timers.c b/FreeRTOS/Source/timers.c
index f0a9914e23..8d40e6a488 100644
--- a/FreeRTOS/Source/timers.c
+++ b/FreeRTOS/Source/timers.c
@@ -76,8 +76,8 @@ task.h is included from an application file. */
 #include "queue.h"
 #include "timers.h"
 
-#if ( INCLUDE_xTimerPendCallbackFromISR == 1 ) && ( configUSE_TIMERS == 0 )
-	#error configUSE_TIMERS must be set to 1 to make the INCLUDE_xTimerPendCallbackFromISR() function available.
+#if ( INCLUDE_xTimerPendFunctionCallFromISR == 1 ) && ( configUSE_TIMERS == 0 )
+	#error configUSE_TIMERS must be set to 1 to make the INCLUDE_xTimerPendFunctionCallFromISR() function available.
 #endif
 
 /* Lint e961 and e750 are suppressed as a MISRA exception justified because the
@@ -99,12 +99,12 @@ configUSE_TIMERS is set to 1 in FreeRTOSConfig.h. */
 /* The definition of the timers themselves. */
 typedef struct tmrTimerControl
 {
-	const char			*pcTimerName;		/*<< Text name.  This is not used by the kernel, it is included simply to make debugging easier. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
-	ListItem_t			xTimerListItem;		/*<< Standard linked list item as used by all kernel features for event management. */
-	TickType_t			xTimerPeriodInTicks;/*<< How quickly and often the timer expires. */
-	UBaseType_t			uxAutoReload;		/*<< Set to pdTRUE if the timer should be automatically restarted once expired.  Set to pdFALSE if the timer is, in effect, a one-shot timer. */
-	void 				*pvTimerID;			/*<< An ID to identify the timer.  This allows the timer to be identified when the same callback is used for multiple timers. */
-	tmrTIMER_CALLBACK	pxCallbackFunction;	/*<< The function that will be called when the timer expires. */
+	const char				*pcTimerName;		/*<< Text name.  This is not used by the kernel, it is included simply to make debugging easier. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+	ListItem_t				xTimerListItem;		/*<< Standard linked list item as used by all kernel features for event management. */
+	TickType_t				xTimerPeriodInTicks;/*<< How quickly and often the timer expires. */
+	UBaseType_t				uxAutoReload;		/*<< Set to pdTRUE if the timer should be automatically restarted once expired.  Set to pdFALSE if the timer is, in effect, a one-shot timer. */
+	void 					*pvTimerID;			/*<< An ID to identify the timer.  This allows the timer to be identified when the same callback is used for multiple timers. */
+	TimerCallbackFunction_t	pxCallbackFunction;	/*<< The function that will be called when the timer expires. */
 } Timer_t;
 
 /* The definition of messages that can be sent and received on the timer queue.
@@ -121,9 +121,9 @@ typedef struct tmrTimerParameters
 
 typedef struct tmrCallbackParameters
 {
-	pdAPPLICATION_CALLBACK_CODE	pxCallbackFunction; /* << The callback function to execute. */
-	void *pvParameter1;								/* << The value that will be used as the callback functions first parameter. */
-	uint32_t ulParameter2;							/* << The value that will be used as the callback functions second parameter. */
+	PendedFunction_t	pxCallbackFunction;	/* << The callback function to execute. */
+	void *pvParameter1;						/* << The value that will be used as the callback functions first parameter. */
+	uint32_t ulParameter2;					/* << The value that will be used as the callback functions second parameter. */
 } CallbackParameters_t;
 
 /* The structure that contains the two message types, along with an identifier
@@ -137,9 +137,9 @@ typedef struct tmrTimerQueueMessage
 
 		/* Don't include xCallbackParameters if it is not going to be used as
 		it makes the structure (and therefore the timer queue) larger. */
-		#if ( INCLUDE_xTimerPendCallbackFromISR == 1 )
+		#if ( INCLUDE_xTimerPendFunctionCallFromISR == 1 )
 			CallbackParameters_t xCallbackParameters;
-		#endif /* INCLUDE_xTimerPendCallbackFromISR */
+		#endif /* INCLUDE_xTimerPendFunctionCallFromISR */
 	} u;
 } DaemonTaskMessage_t;
 
@@ -261,7 +261,7 @@ BaseType_t xReturn = pdFAIL;
 }
 /*-----------------------------------------------------------*/
 
-TimerHandle_t xTimerCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, tmrTIMER_CALLBACK pxCallbackFunction ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+TimerHandle_t xTimerCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
 {
 Timer_t *pxNewTimer;
 
@@ -572,7 +572,7 @@ TickType_t xTimeNow;
 
 	while( xQueueReceive( xTimerQueue, &xMessage, tmrNO_DELAY ) != pdFAIL ) /*lint !e603 xMessage does not have to be initialised as it is passed out, not in, and it is not used unless xQueueReceive() returns pdTRUE. */
 	{
-		#if ( INCLUDE_xTimerPendCallbackFromISR == 1 )
+		#if ( INCLUDE_xTimerPendFunctionCallFromISR == 1 )
 		{
 			if( xMessage.xMessageID == tmrCOMMAND_EXECUTE_CALLBACK )
 			{
@@ -590,7 +590,7 @@ TickType_t xTimeNow;
 				mtCOVERAGE_TEST_MARKER();
 			}
 		}
-		#endif /* INCLUDE_xTimerPendCallbackFromISR */
+		#endif /* INCLUDE_xTimerPendFunctionCallFromISR */
 
 		if( xMessage.xMessageID != tmrCOMMAND_EXECUTE_CALLBACK )
 		{
@@ -803,9 +803,9 @@ Timer_t * const pxTimer = ( Timer_t * ) xTimer;
 }
 /*-----------------------------------------------------------*/
 
-#if( INCLUDE_xTimerPendCallbackFromISR == 1 )
+#if( INCLUDE_xTimerPendFunctionCallFromISR == 1 )
 
-	BaseType_t xTimerPendCallbackFromISR( pdAPPLICATION_CALLBACK_CODE pvCallbackFunction, void *pvParameter1, uint32_t ulParameter2, BaseType_t *pxHigherPriorityTaskWoken )
+	BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, BaseType_t *pxHigherPriorityTaskWoken )
 	{
 	DaemonTaskMessage_t xMessage;
 	BaseType_t xReturn;
@@ -813,7 +813,7 @@ Timer_t * const pxTimer = ( Timer_t * ) xTimer;
 		/* Complete the message with the function parameters and post it to the
 		daemon task. */
 		xMessage.xMessageID = tmrCOMMAND_EXECUTE_CALLBACK;
-		xMessage.u.xCallbackParameters.pxCallbackFunction = pvCallbackFunction;
+		xMessage.u.xCallbackParameters.pxCallbackFunction = xFunctionToPend;
 		xMessage.u.xCallbackParameters.pvParameter1 = pvParameter1;
 		xMessage.u.xCallbackParameters.ulParameter2 = ulParameter2;
 
@@ -822,7 +822,7 @@ Timer_t * const pxTimer = ( Timer_t * ) xTimer;
 		return xReturn;
 	}
 
-#endif /* INCLUDE_xTimerPendCallbackFromISR */
+#endif /* INCLUDE_xTimerPendFunctionCallFromISR */
 /*-----------------------------------------------------------*/
 
 /* This entire source file will be skipped if the application is not configured