From b6914f48e25cbe72feab94b9afafcf2ad035eb9d Mon Sep 17 00:00:00 2001 From: rtel Date: Sat, 14 Dec 2013 13:16:05 +0000 Subject: [PATCH] Update the ucQueueNumber member of the queue structure (used with FreeRTOS+Trace to be an unsigned portBASE_TYPE instead of an unsigned char. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2132 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../Source/FreeRTOS-Plus-Trace/Include/trcKernelPort.h | 2 +- .../Source/FreeRTOS-Plus-Trace/trcKernelPort.c | 4 ++-- FreeRTOS/Demo/WIN32-MSVC/main_full.c | 10 +++++----- FreeRTOS/Source/include/queue.h | 4 ++-- FreeRTOS/Source/portable/MSVC-MingW/portmacro.h | 2 ++ FreeRTOS/Source/queue.c | 10 +++++----- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcKernelPort.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcKernelPort.h index a775883b2..211878a5d 100644 --- a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcKernelPort.h +++ b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcKernelPort.h @@ -358,7 +358,7 @@ void* prvTraceGetCurrentTaskHandle(void); #define TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject) TRACE_GET_CLASS_TRACE_CLASS(CLASS, prvTraceGetObjectType(pxObject)) #define TRACE_GET_OBJECT_NUMBER(CLASS, pxObject) (prvTraceGetObjectNumber(pxObject)) -#define TRACE_SET_OBJECT_NUMBER(CLASS, pxObject) pxObject->ucQueueNumber = xTraceGetObjectHandle(TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject)); +#define TRACE_SET_OBJECT_NUMBER(CLASS, pxObject) pxObject->uxQueueNumber = xTraceGetObjectHandle(TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject)); #define TRACE_GET_CLASS_EVENT_CODE(SERVICE, RESULT, CLASS, kernelClass) (uint8_t)(EVENTGROUP_##SERVICE##_##RESULT + TRACE_GET_CLASS_TRACE_CLASS(CLASS, kernelClass)) #define TRACE_GET_OBJECT_EVENT_CODE(SERVICE, RESULT, CLASS, pxObject) (uint8_t)(EVENTGROUP_##SERVICE##_##RESULT + TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject)) diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcKernelPort.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcKernelPort.c index 610b3b39c..91b6a8156 100644 --- a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcKernelPort.c +++ b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcKernelPort.c @@ -52,11 +52,11 @@ traceObjectClass TraceObjectClassTable[5] = { }; extern unsigned char ucQueueGetQueueType(void*); -extern unsigned char ucQueueGetQueueNumber(void*); +extern unsigned portBASE_TYPE uxQueueGetQueueNumber(void*); objectHandleType prvTraceGetObjectNumber(void* handle) { - return ucQueueGetQueueNumber(handle); + return uxQueueGetQueueNumber(handle); } unsigned char prvTraceGetObjectType(void* handle) diff --git a/FreeRTOS/Demo/WIN32-MSVC/main_full.c b/FreeRTOS/Demo/WIN32-MSVC/main_full.c index 62600fee4..11ac892ae 100644 --- a/FreeRTOS/Demo/WIN32-MSVC/main_full.c +++ b/FreeRTOS/Demo/WIN32-MSVC/main_full.c @@ -338,13 +338,13 @@ const unsigned long ulMSToSleep = 5; void vFullDemoIdleFunction( void ) { const unsigned long ulMSToSleep = 15; -const unsigned char ucConstQueueNumber = 0xaaU; +const unsigned portBASE_TYPE uxConstQueueNumber = 0xaaU; void *pvAllocated; /* These three functions are only meant for use by trace code, and not for direct use from application code, hence their prototypes are not in queue.h. */ -extern void vQueueSetQueueNumber( xQueueHandle pxQueue, unsigned char ucQueueNumber ); -extern unsigned char ucQueueGetQueueNumber( xQueueHandle pxQueue ); +extern void vQueueSetQueueNumber( xQueueHandle pxQueue, unsigned portBASE_TYPE uxQueueNumber ); +extern unsigned portBASE_TYPE uxQueueGetQueueNumber( xQueueHandle pxQueue ); extern unsigned char ucQueueGetQueueType( xQueueHandle pxQueue ); extern void vTaskSetTaskNumber( xTaskHandle xTask, unsigned portBASE_TYPE uxHandle ); extern unsigned portBASE_TYPE uxTaskGetTaskNumber( xTaskHandle xTask ); @@ -366,12 +366,12 @@ extern unsigned portBASE_TYPE uxTaskGetTaskNumber( xTaskHandle xTask ); /* Before deleting the semaphore, test the function used to set its number. This would normally only be done from trace software, rather than application code. */ - vQueueSetQueueNumber( xMutexToDelete, ucConstQueueNumber ); + vQueueSetQueueNumber( xMutexToDelete, uxConstQueueNumber ); /* Before deleting the semaphore, test the functions used to get its type and number. Again, these would normally only be done from trace software, rather than application code. */ - configASSERT( ucQueueGetQueueNumber( xMutexToDelete ) == ucConstQueueNumber ); + configASSERT( uxQueueGetQueueNumber( xMutexToDelete ) == uxConstQueueNumber ); configASSERT( ucQueueGetQueueType( xMutexToDelete ) == queueQUEUE_TYPE_MUTEX ); vSemaphoreDelete( xMutexToDelete ); xMutexToDelete = NULL; diff --git a/FreeRTOS/Source/include/queue.h b/FreeRTOS/Source/include/queue.h index c67d315dd..6b20211ef 100644 --- a/FreeRTOS/Source/include/queue.h +++ b/FreeRTOS/Source/include/queue.h @@ -1674,8 +1674,8 @@ xQueueSetMemberHandle xQueueSelectFromSetFromISR( xQueueSetHandle xQueueSet ) PR /* Not public API functions. */ void vQueueWaitForMessageRestricted( xQueueHandle xQueue, portTickType xTicksToWait ) PRIVILEGED_FUNCTION; portBASE_TYPE xQueueGenericReset( xQueueHandle xQueue, portBASE_TYPE xNewQueue ) PRIVILEGED_FUNCTION; -void vQueueSetQueueNumber( xQueueHandle xQueue, unsigned char ucQueueNumber ) PRIVILEGED_FUNCTION; -unsigned char ucQueueGetQueueNumber( xQueueHandle xQueue ) PRIVILEGED_FUNCTION; +void vQueueSetQueueNumber( xQueueHandle xQueue, unsigned portBASE_TYPE uxQueueNumber ) PRIVILEGED_FUNCTION; +unsigned portBASE_TYPE uxQueueGetQueueNumber( xQueueHandle xQueue ) PRIVILEGED_FUNCTION; unsigned char ucQueueGetQueueType( xQueueHandle xQueue ) PRIVILEGED_FUNCTION; diff --git a/FreeRTOS/Source/portable/MSVC-MingW/portmacro.h b/FreeRTOS/Source/portable/MSVC-MingW/portmacro.h index 03a9bc981..d8dd2f57a 100644 --- a/FreeRTOS/Source/portable/MSVC-MingW/portmacro.h +++ b/FreeRTOS/Source/portable/MSVC-MingW/portmacro.h @@ -95,8 +95,10 @@ #define portYIELD() vPortGenerateSimulatedInterrupt( portINTERRUPT_YIELD ) +void vPortCloseRunningThread( void *pvTaskToDelete, volatile portBASE_TYPE *pxPendYield ); void vPortDeleteThread( void *pvThreadToDelete ); #define portCLEAN_UP_TCB( pxTCB ) vPortDeleteThread( pxTCB ) +#define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxPendYield ) vPortCloseRunningThread( ( pvTaskToDelete ), ( pxPendYield ) ) #define portDISABLE_INTERRUPTS() #define portENABLE_INTERRUPTS() diff --git a/FreeRTOS/Source/queue.c b/FreeRTOS/Source/queue.c index 43ceaca92..83a5b919b 100644 --- a/FreeRTOS/Source/queue.c +++ b/FreeRTOS/Source/queue.c @@ -146,7 +146,7 @@ typedef struct QueueDefinition volatile signed portBASE_TYPE xTxLock; /*< Stores the number of items transmitted to the queue (added to the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */ #if ( configUSE_TRACE_FACILITY == 1 ) - unsigned char ucQueueNumber; + unsigned portBASE_TYPE uxQueueNumber; unsigned char ucQueueType; #endif @@ -1398,9 +1398,9 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue; #if ( configUSE_TRACE_FACILITY == 1 ) - unsigned char ucQueueGetQueueNumber( xQueueHandle xQueue ) + unsigned portBASE_TYPE uxQueueGetQueueNumber( xQueueHandle xQueue ) { - return ( ( xQUEUE * ) xQueue )->ucQueueNumber; + return ( ( xQUEUE * ) xQueue )->uxQueueNumber; } #endif /* configUSE_TRACE_FACILITY */ @@ -1408,9 +1408,9 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue; #if ( configUSE_TRACE_FACILITY == 1 ) - void vQueueSetQueueNumber( xQueueHandle xQueue, unsigned char ucQueueNumber ) + void vQueueSetQueueNumber( xQueueHandle xQueue, unsigned portBASE_TYPE uxQueueNumber ) { - ( ( xQUEUE * ) xQueue )->ucQueueNumber = ucQueueNumber; + ( ( xQUEUE * ) xQueue )->uxQueueNumber = uxQueueNumber; } #endif /* configUSE_TRACE_FACILITY */ -- 2.39.5