From 24ade42a37849f8ad05b9ced2a0c967ae5f79d1f Mon Sep 17 00:00:00 2001 From: Cristian Cristea Date: Tue, 27 Sep 2022 00:43:30 +0300 Subject: [PATCH] Added better pointer declaration readability (#567) * Add better pointer declaration readability I revised the declaration of single-line pointers by splitting it into multiple lines. Now, every pointer is declared (and initialized accordingly) on its own line. This refactoring should enhance readability and decrease the probability of error when a new pointer is added/removed or a current one has its initialization value modified. Signed-off-by: Cristian Cristea * Remove unnecessary whitespace characters and lines It removes whitespace characters at the end of lines (empty or othwerwise) and clear lines at the end of the file (only one remains). It is an automatic operation done by git. Signed-off-by: Cristian Cristea Signed-off-by: Cristian Cristea --- event_groups.c | 3 ++- portable/ARMv8M/secure/heap/secure_heap.c | 7 +++++-- portable/GCC/ARM_CM23/secure/secure_heap.c | 7 +++++-- portable/GCC/ARM_CM33/secure/secure_heap.c | 7 +++++-- portable/GCC/ARM_CM55/secure/secure_heap.c | 7 +++++-- portable/GCC/ARM_CM85/secure/secure_heap.c | 7 +++++-- portable/GCC/MicroBlaze/port.c | 8 ++------ portable/GCC/MicroBlazeV8/port.c | 9 ++++----- portable/GCC/MicroBlazeV9/port.c | 5 ++--- portable/IAR/ARM_CM23/secure/secure_heap.c | 7 +++++-- portable/IAR/ARM_CM33/secure/secure_heap.c | 7 +++++-- portable/IAR/ARM_CM55/secure/secure_heap.c | 7 +++++-- portable/IAR/ARM_CM85/secure/secure_heap.c | 7 +++++-- portable/MemMang/heap_2.c | 4 +++- portable/MemMang/heap_4.c | 7 +++++-- portable/MemMang/heap_5.c | 10 +++++++--- portable/ThirdParty/GCC/Xtensa_ESP32/port.c | 3 ++- portable/ThirdParty/XCC/Xtensa/port.c | 3 ++- portable/oWatcom/16BitDOS/common/portcomn.c | 21 ++++++++++----------- tasks.c | 11 ++++++++--- 20 files changed, 92 insertions(+), 55 deletions(-) diff --git a/event_groups.c b/event_groups.c index 27390e679..24c7b3781 100644 --- a/event_groups.c +++ b/event_groups.c @@ -533,7 +533,8 @@ EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup ) EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet ) { - ListItem_t * pxListItem, * pxNext; + ListItem_t * pxListItem; + ListItem_t * pxNext; ListItem_t const * pxListEnd; List_t const * pxList; EventBits_t uxBitsToClear = 0, uxBitsWaitedFor, uxControlBits; diff --git a/portable/ARMv8M/secure/heap/secure_heap.c b/portable/ARMv8M/secure/heap/secure_heap.c index b3a737818..741b46371 100644 --- a/portable/ARMv8M/secure/heap/secure_heap.c +++ b/portable/ARMv8M/secure/heap/secure_heap.c @@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s /** * @brief Create a couple of list links to mark the start and end of the list. */ -static BlockLink_t xStart, * pxEnd = NULL; +static BlockLink_t xStart; +static BlockLink_t * pxEnd = NULL; /** * @brief Keeps track of the number of free bytes remaining, but says nothing @@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) void * pvPortMalloc( size_t xWantedSize ) { - BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink; + BlockLink_t * pxBlock; + BlockLink_t * pxPreviousBlock; + BlockLink_t * pxNewBlockLink; void * pvReturn = NULL; /* If this is the first call to malloc then the heap will require diff --git a/portable/GCC/ARM_CM23/secure/secure_heap.c b/portable/GCC/ARM_CM23/secure/secure_heap.c index b3a737818..741b46371 100644 --- a/portable/GCC/ARM_CM23/secure/secure_heap.c +++ b/portable/GCC/ARM_CM23/secure/secure_heap.c @@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s /** * @brief Create a couple of list links to mark the start and end of the list. */ -static BlockLink_t xStart, * pxEnd = NULL; +static BlockLink_t xStart; +static BlockLink_t * pxEnd = NULL; /** * @brief Keeps track of the number of free bytes remaining, but says nothing @@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) void * pvPortMalloc( size_t xWantedSize ) { - BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink; + BlockLink_t * pxBlock; + BlockLink_t * pxPreviousBlock; + BlockLink_t * pxNewBlockLink; void * pvReturn = NULL; /* If this is the first call to malloc then the heap will require diff --git a/portable/GCC/ARM_CM33/secure/secure_heap.c b/portable/GCC/ARM_CM33/secure/secure_heap.c index b3a737818..741b46371 100644 --- a/portable/GCC/ARM_CM33/secure/secure_heap.c +++ b/portable/GCC/ARM_CM33/secure/secure_heap.c @@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s /** * @brief Create a couple of list links to mark the start and end of the list. */ -static BlockLink_t xStart, * pxEnd = NULL; +static BlockLink_t xStart; +static BlockLink_t * pxEnd = NULL; /** * @brief Keeps track of the number of free bytes remaining, but says nothing @@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) void * pvPortMalloc( size_t xWantedSize ) { - BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink; + BlockLink_t * pxBlock; + BlockLink_t * pxPreviousBlock; + BlockLink_t * pxNewBlockLink; void * pvReturn = NULL; /* If this is the first call to malloc then the heap will require diff --git a/portable/GCC/ARM_CM55/secure/secure_heap.c b/portable/GCC/ARM_CM55/secure/secure_heap.c index c633e2d05..157fdbf0e 100644 --- a/portable/GCC/ARM_CM55/secure/secure_heap.c +++ b/portable/GCC/ARM_CM55/secure/secure_heap.c @@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s /** * @brief Create a couple of list links to mark the start and end of the list. */ -static BlockLink_t xStart, * pxEnd = NULL; +static BlockLink_t xStart; +static BlockLink_t * pxEnd = NULL; /** * @brief Keeps track of the number of free bytes remaining, but says nothing @@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) void * pvPortMalloc( size_t xWantedSize ) { - BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink; + BlockLink_t * pxBlock; + BlockLink_t * pxPreviousBlock; + BlockLink_t * pxNewBlockLink; void * pvReturn = NULL; /* If this is the first call to malloc then the heap will require diff --git a/portable/GCC/ARM_CM85/secure/secure_heap.c b/portable/GCC/ARM_CM85/secure/secure_heap.c index b3a737818..741b46371 100644 --- a/portable/GCC/ARM_CM85/secure/secure_heap.c +++ b/portable/GCC/ARM_CM85/secure/secure_heap.c @@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s /** * @brief Create a couple of list links to mark the start and end of the list. */ -static BlockLink_t xStart, * pxEnd = NULL; +static BlockLink_t xStart; +static BlockLink_t * pxEnd = NULL; /** * @brief Keeps track of the number of free bytes remaining, but says nothing @@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) void * pvPortMalloc( size_t xWantedSize ) { - BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink; + BlockLink_t * pxBlock; + BlockLink_t * pxPreviousBlock; + BlockLink_t * pxNewBlockLink; void * pvReturn = NULL; /* If this is the first call to malloc then the heap will require diff --git a/portable/GCC/MicroBlaze/port.c b/portable/GCC/MicroBlaze/port.c index 48d661b8d..b1df8fbe1 100644 --- a/portable/GCC/MicroBlaze/port.c +++ b/portable/GCC/MicroBlaze/port.c @@ -88,7 +88,8 @@ static void prvSetupTimerInterrupt( void ); */ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) { -extern void *_SDA2_BASE_, *_SDA_BASE_; +extern void * _SDA2_BASE_; +extern void * _SDA_BASE_; const uint32_t ulR2 = ( uint32_t ) &_SDA2_BASE_; const uint32_t ulR13 = ( uint32_t ) &_SDA_BASE_; @@ -327,8 +328,3 @@ uint32_t ulCSR; XTmrCtr_mSetControlStatusReg( XPAR_OPB_TIMER_1_BASEADDR, portCOUNTER_0, ulCSR ); } /*-----------------------------------------------------------*/ - - - - - diff --git a/portable/GCC/MicroBlazeV8/port.c b/portable/GCC/MicroBlazeV8/port.c index 381702fb0..720c14447 100644 --- a/portable/GCC/MicroBlazeV8/port.c +++ b/portable/GCC/MicroBlazeV8/port.c @@ -48,7 +48,7 @@ the scheduler being commenced interrupts should not be enabled, so the critical nesting variable is initialised to a non-zero value. */ #define portINITIAL_NESTING_VALUE ( 0xff ) -/* The bit within the MSR register that enabled/disables interrupts and +/* The bit within the MSR register that enabled/disables interrupts and exceptions respectively. */ #define portMSR_IE ( 0x02U ) #define portMSR_EE ( 0x100U ) @@ -106,7 +106,8 @@ static XIntc xInterruptControllerInstance; */ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) { -extern void *_SDA2_BASE_, *_SDA_BASE_; +extern void * _SDA2_BASE_; +extern void * _SDA_BASE_; const uint32_t ulR2 = ( uint32_t ) &_SDA2_BASE_; const uint32_t ulR13 = ( uint32_t ) &_SDA_BASE_; @@ -130,7 +131,7 @@ const uint32_t ulR13 = ( uint32_t ) &_SDA_BASE_; disabled. Each task will enable interrupts automatically when it enters the running state for the first time. */ *pxTopOfStack = mfmsr() & ~portMSR_IE; - + #if( MICROBLAZE_EXCEPTIONS_ENABLED == 1 ) { /* Ensure exceptions are enabled for the task. */ @@ -449,5 +450,3 @@ int32_t lStatus; return lStatus; } /*-----------------------------------------------------------*/ - - diff --git a/portable/GCC/MicroBlazeV9/port.c b/portable/GCC/MicroBlazeV9/port.c index 7c605e003..4f54f9986 100644 --- a/portable/GCC/MicroBlazeV9/port.c +++ b/portable/GCC/MicroBlazeV9/port.c @@ -111,7 +111,8 @@ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, StackType_t *pxEn StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) #endif { -extern void *_SDA2_BASE_, *_SDA_BASE_; +extern void * _SDA2_BASE_; +extern void * _SDA_BASE_; const uint32_t ulR2 = ( uint32_t ) &_SDA2_BASE_; const uint32_t ulR13 = ( uint32_t ) &_SDA_BASE_; extern void _start1( void ); @@ -487,5 +488,3 @@ int32_t lStatus; return lStatus; } /*-----------------------------------------------------------*/ - - diff --git a/portable/IAR/ARM_CM23/secure/secure_heap.c b/portable/IAR/ARM_CM23/secure/secure_heap.c index b3a737818..741b46371 100644 --- a/portable/IAR/ARM_CM23/secure/secure_heap.c +++ b/portable/IAR/ARM_CM23/secure/secure_heap.c @@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s /** * @brief Create a couple of list links to mark the start and end of the list. */ -static BlockLink_t xStart, * pxEnd = NULL; +static BlockLink_t xStart; +static BlockLink_t * pxEnd = NULL; /** * @brief Keeps track of the number of free bytes remaining, but says nothing @@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) void * pvPortMalloc( size_t xWantedSize ) { - BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink; + BlockLink_t * pxBlock; + BlockLink_t * pxPreviousBlock; + BlockLink_t * pxNewBlockLink; void * pvReturn = NULL; /* If this is the first call to malloc then the heap will require diff --git a/portable/IAR/ARM_CM33/secure/secure_heap.c b/portable/IAR/ARM_CM33/secure/secure_heap.c index b3a737818..741b46371 100644 --- a/portable/IAR/ARM_CM33/secure/secure_heap.c +++ b/portable/IAR/ARM_CM33/secure/secure_heap.c @@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s /** * @brief Create a couple of list links to mark the start and end of the list. */ -static BlockLink_t xStart, * pxEnd = NULL; +static BlockLink_t xStart; +static BlockLink_t * pxEnd = NULL; /** * @brief Keeps track of the number of free bytes remaining, but says nothing @@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) void * pvPortMalloc( size_t xWantedSize ) { - BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink; + BlockLink_t * pxBlock; + BlockLink_t * pxPreviousBlock; + BlockLink_t * pxNewBlockLink; void * pvReturn = NULL; /* If this is the first call to malloc then the heap will require diff --git a/portable/IAR/ARM_CM55/secure/secure_heap.c b/portable/IAR/ARM_CM55/secure/secure_heap.c index c633e2d05..157fdbf0e 100644 --- a/portable/IAR/ARM_CM55/secure/secure_heap.c +++ b/portable/IAR/ARM_CM55/secure/secure_heap.c @@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s /** * @brief Create a couple of list links to mark the start and end of the list. */ -static BlockLink_t xStart, * pxEnd = NULL; +static BlockLink_t xStart; +static BlockLink_t * pxEnd = NULL; /** * @brief Keeps track of the number of free bytes remaining, but says nothing @@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) void * pvPortMalloc( size_t xWantedSize ) { - BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink; + BlockLink_t * pxBlock; + BlockLink_t * pxPreviousBlock; + BlockLink_t * pxNewBlockLink; void * pvReturn = NULL; /* If this is the first call to malloc then the heap will require diff --git a/portable/IAR/ARM_CM85/secure/secure_heap.c b/portable/IAR/ARM_CM85/secure/secure_heap.c index b3a737818..741b46371 100644 --- a/portable/IAR/ARM_CM85/secure/secure_heap.c +++ b/portable/IAR/ARM_CM85/secure/secure_heap.c @@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s /** * @brief Create a couple of list links to mark the start and end of the list. */ -static BlockLink_t xStart, * pxEnd = NULL; +static BlockLink_t xStart; +static BlockLink_t * pxEnd = NULL; /** * @brief Keeps track of the number of free bytes remaining, but says nothing @@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) void * pvPortMalloc( size_t xWantedSize ) { - BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink; + BlockLink_t * pxBlock; + BlockLink_t * pxPreviousBlock; + BlockLink_t * pxNewBlockLink; void * pvReturn = NULL; /* If this is the first call to malloc then the heap will require diff --git a/portable/MemMang/heap_2.c b/portable/MemMang/heap_2.c index a22163eac..124fe86d8 100644 --- a/portable/MemMang/heap_2.c +++ b/portable/MemMang/heap_2.c @@ -152,7 +152,9 @@ static void prvHeapInit( void ) PRIVILEGED_FUNCTION; void * pvPortMalloc( size_t xWantedSize ) { - BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink; + BlockLink_t * pxBlock; + BlockLink_t * pxPreviousBlock; + BlockLink_t * pxNewBlockLink; PRIVILEGED_DATA static BaseType_t xHeapHasBeenInitialised = pdFALSE; void * pvReturn = NULL; size_t xAdditionalRequiredSize; diff --git a/portable/MemMang/heap_4.c b/portable/MemMang/heap_4.c index f61162a64..2a594a690 100644 --- a/portable/MemMang/heap_4.c +++ b/portable/MemMang/heap_4.c @@ -123,7 +123,8 @@ static void prvHeapInit( void ) PRIVILEGED_FUNCTION; static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( portBYTE_ALIGNMENT - 1 ) ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK ); /* Create a couple of list links to mark the start and end of the list. */ -PRIVILEGED_DATA static BlockLink_t xStart, * pxEnd = NULL; +PRIVILEGED_DATA static BlockLink_t xStart; +PRIVILEGED_DATA static BlockLink_t * pxEnd = NULL; /* Keeps track of the number of calls to allocate and free memory as well as the * number of free bytes remaining, but says nothing about fragmentation. */ @@ -136,7 +137,9 @@ PRIVILEGED_DATA static size_t xNumberOfSuccessfulFrees = 0; void * pvPortMalloc( size_t xWantedSize ) { - BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink; + BlockLink_t * pxBlock; + BlockLink_t * pxPreviousBlock; + BlockLink_t * pxNewBlockLink; void * pvReturn = NULL; size_t xAdditionalRequiredSize; diff --git a/portable/MemMang/heap_5.c b/portable/MemMang/heap_5.c index c5d29d908..38953c5f2 100644 --- a/portable/MemMang/heap_5.c +++ b/portable/MemMang/heap_5.c @@ -141,7 +141,8 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ); static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( portBYTE_ALIGNMENT - 1 ) ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK ); /* Create a couple of list links to mark the start and end of the list. */ -static BlockLink_t xStart, * pxEnd = NULL; +static BlockLink_t xStart; +static BlockLink_t * pxEnd = NULL; /* Keeps track of the number of calls to allocate and free memory as well as the * number of free bytes remaining, but says nothing about fragmentation. */ @@ -154,7 +155,9 @@ static size_t xNumberOfSuccessfulFrees = 0; void * pvPortMalloc( size_t xWantedSize ) { - BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink; + BlockLink_t * pxBlock; + BlockLink_t * pxPreviousBlock; + BlockLink_t * pxNewBlockLink; void * pvReturn = NULL; size_t xAdditionalRequiredSize; @@ -441,7 +444,8 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) { - BlockLink_t * pxFirstFreeBlockInRegion = NULL, * pxPreviousFreeBlock; + BlockLink_t * pxFirstFreeBlockInRegion = NULL; + BlockLink_t * pxPreviousFreeBlock; portPOINTER_SIZE_TYPE xAlignedHeap; size_t xTotalRegionSize, xTotalHeapSize = 0; BaseType_t xDefinedRegions = 0; diff --git a/portable/ThirdParty/GCC/Xtensa_ESP32/port.c b/portable/ThirdParty/GCC/Xtensa_ESP32/port.c index 2e3831cbf..767559150 100644 --- a/portable/ThirdParty/GCC/Xtensa_ESP32/port.c +++ b/portable/ThirdParty/GCC/Xtensa_ESP32/port.c @@ -140,7 +140,8 @@ void _xt_user_exit( void ); #endif /* *INDENT-ON* */ { - StackType_t * sp, * tp; + StackType_t * sp; + StackType_t * tp; XtExcFrame * frame; #if XCHAL_CP_NUM > 0 diff --git a/portable/ThirdParty/XCC/Xtensa/port.c b/portable/ThirdParty/XCC/Xtensa/port.c index 5a6addecb..6320ca2c9 100644 --- a/portable/ThirdParty/XCC/Xtensa/port.c +++ b/portable/ThirdParty/XCC/Xtensa/port.c @@ -67,7 +67,8 @@ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t px StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) #endif { - StackType_t * sp, * tp; + StackType_t * sp; + StackType_t * tp; XtExcFrame * frame; #if XCHAL_CP_NUM > 0 diff --git a/portable/oWatcom/16BitDOS/common/portcomn.c b/portable/oWatcom/16BitDOS/common/portcomn.c index 38e6c0e0f..62fad759c 100644 --- a/portable/oWatcom/16BitDOS/common/portcomn.c +++ b/portable/oWatcom/16BitDOS/common/portcomn.c @@ -28,8 +28,8 @@ /* Changes from V1.00: - - + pxPortInitialiseStack() now initialises the stack of new tasks to the + + + pxPortInitialiseStack() now initialises the stack of new tasks to the same format used by the compiler. This allows the compiler generated interrupt mechanism to be used for context switches. @@ -43,7 +43,7 @@ Changes from V2.6.1: + usPortCheckFreeStackSpace() has been moved to tasks.c. */ - + #include #include "FreeRTOS.h" @@ -53,9 +53,10 @@ Changes from V2.6.1: /* See header file for description. */ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) { -StackType_t DS_Reg = 0, *pxOriginalSP; +StackType_t DS_Reg = 0; +StackType_t * pxOriginalSP; - /* Place a few bytes of known values on the bottom of the stack. + /* Place a few bytes of known values on the bottom of the stack. This is just useful for debugging. */ *pxTopOfStack = 0x1111; @@ -74,9 +75,9 @@ StackType_t DS_Reg = 0, *pxOriginalSP; /* We are going to start the scheduler using a return from interrupt instruction to load the program counter, so first there would be the - status register and interrupt return address. We make this the start + status register and interrupt return address. We make this the start of the task. */ - *pxTopOfStack = portINITIAL_SW; + *pxTopOfStack = portINITIAL_SW; pxTopOfStack--; *pxTopOfStack = FP_SEG( pxCode ); pxTopOfStack--; @@ -86,11 +87,11 @@ StackType_t DS_Reg = 0, *pxOriginalSP; /* We are going to setup the stack for the new task to look like the stack frame was setup by a compiler generated ISR. We need to know the address of the existing stack top to place in the SP register within - the stack frame. pxOriginalSP holds SP before (simulated) pusha was + the stack frame. pxOriginalSP holds SP before (simulated) pusha was called. */ pxOriginalSP = pxTopOfStack; - /* The remaining registers would be pushed on the stack by our context + /* The remaining registers would be pushed on the stack by our context switch function. These are loaded with values simply to make debugging easier. */ *pxTopOfStack = FP_OFF( pvParameters ); /* AX */ @@ -138,5 +139,3 @@ StackType_t DS_Reg = 0, *pxOriginalSP; return pxTopOfStack; } /*-----------------------------------------------------------*/ - - diff --git a/tasks.c b/tasks.c index e4c3deaac..c7192e537 100644 --- a/tasks.c +++ b/tasks.c @@ -1346,7 +1346,9 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) eTaskState eTaskGetState( TaskHandle_t xTask ) { eTaskState eReturn; - List_t const * pxStateList, * pxDelayedList, * pxOverflowedDelayedList; + List_t const * pxStateList; + List_t const * pxDelayedList; + List_t const * pxOverflowedDelayedList; const TCB_t * const pxTCB = xTask; configASSERT( pxTCB ); @@ -2352,7 +2354,9 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char static TCB_t * prvSearchForNameWithinSingleList( List_t * pxList, const char pcNameToQuery[] ) { - TCB_t * pxNextTCB, * pxFirstTCB, * pxReturn = NULL; + TCB_t * pxNextTCB; + TCB_t * pxFirstTCB; + TCB_t * pxReturn = NULL; UBaseType_t x; char cNextChar; BaseType_t xBreakLoop; @@ -3815,7 +3819,8 @@ static void prvCheckTasksWaitingTermination( void ) List_t * pxList, eTaskState eState ) { - configLIST_VOLATILE TCB_t * pxNextTCB, * pxFirstTCB; + configLIST_VOLATILE TCB_t * pxNextTCB; + configLIST_VOLATILE TCB_t * pxFirstTCB; UBaseType_t uxTask = 0; if( listCURRENT_LIST_LENGTH( pxList ) > ( UBaseType_t ) 0 )