]> git.sur5r.net Git - freertos/commitdiff
Remove the trace lines from the Win32 port.c.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sat, 20 Nov 2010 14:20:09 +0000 (14:20 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sat, 20 Nov 2010 14:20:09 +0000 (14:20 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1147 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/portable/MSVC-MingW/port.c

index 3acbfd40bbd01c6bd762cabc14f0ab0a0dcd9f34..35f3c95c930cb784df6704ceeaafd088ecb2dfda 100644 (file)
 #include "task.h"\r
 #include <stdio.h>\r
 \r
-//FILE *pfTraceFile = NULL;\r
-//#define vPortTrace( x ) if( pfTraceFile == NULL ) pfTraceFile = fopen( "c:/temp/trace.txt", "w" ); if( pfTraceFile != NULL ) fprintf( pfTraceFile, x )\r
-#define vPortTrace( x ) ( void ) x\r
-\r
 #define portMAX_INTERRUPTS                             ( ( unsigned long ) sizeof( unsigned long ) * 8UL ) /* The number of bits in an unsigned long. */\r
 #define portNO_CRITICAL_NESTING                ( ( unsigned long ) 0 )\r
 \r
@@ -137,8 +133,6 @@ static DWORD WINAPI prvSimulatedPeripheralTimer( LPVOID lpParameter )
 \r
        for(;;)\r
        {\r
-               vPortTrace( "prvSimulatedPeripheralTimer: Tick acked, re-Sleeping()\r\n" );\r
-\r
                /* Wait until the timer expires and we can access the pseudo interrupt \r
                variables.  *NOTE* this is not a 'real time' way of generating tick \r
                events as the next wake time should be relative to the previous wake \r
@@ -147,9 +141,7 @@ static DWORD WINAPI prvSimulatedPeripheralTimer( LPVOID lpParameter )
                environment. */\r
                Sleep( portTICK_RATE_MS );\r
 \r
-               vPortTrace( "prvSimulatedPeripheralTimer: Sleep expired, waiting interrupt event mutex\r\n" );\r
                WaitForSingleObject( pvInterruptEventMutex, INFINITE );\r
-               vPortTrace( "prvSimulatedPeripheralTimer: Got interrupt event mutex\r\n" );\r
 \r
                /* A thread will hold the interrupt event mutex while in a critical\r
                section, so ulCriticalSection should be zero for this tick event to be\r
@@ -165,14 +157,12 @@ static DWORD WINAPI prvSimulatedPeripheralTimer( LPVOID lpParameter )
 \r
                /* The interrupt is now pending - notify the simulated interrupt \r
                handler thread. */\r
-               vPortTrace( "prvSimulatedPeripheralTimer: Setting interrupt event to signal tick\r\n" );\r
                SetEvent( pvInterruptEvent );\r
 \r
                /* Give back the mutex so the pseudo interrupt handler unblocks \r
                and can access the interrupt handler variables.  This high priority\r
                task will then loop back round after waiting for the lower priority \r
                pseudo interrupt handler thread to acknowledge the tick. */\r
-               vPortTrace( "prvSimulatedPeripheralTimer: Releasing interrupt event mutex so tick can be processed\r\n" );\r
                SignalObjectAndWait( pvInterruptEventMutex, pvTickAcknowledgeEvent, INFINITE, FALSE );\r
        }\r
 }\r
@@ -253,8 +243,6 @@ xThreadState *pxThreadState;
                pxThreadState = ( xThreadState * ) *( ( unsigned long * ) pxCurrentTCB );\r
                ulCriticalNesting = portNO_CRITICAL_NESTING;\r
 \r
-               vPortTrace( "Created system threads, starting task" );\r
-\r
                /* Bump up the priority of the thread that is going to run, in the\r
                hope that this will asist in getting the Windows thread scheduler to\r
                behave as an embedded engineer might expect. */\r
@@ -278,9 +266,6 @@ long lSwitchRequired;
 xThreadState *pxThreadState;\r
 void *pvObjectList[ 2 ];\r
 unsigned long i;\r
-//char cTraceBuffer[ 256 ];\r
-\r
-       vPortTrace( "Entering prvProcessPseudoInterrupts\r\n" );\r
 \r
        /* Going to block on the mutex that ensured exclusive access to the pseudo \r
        interrupt objects, and the event that signals that a pseudo interrupt\r
@@ -290,9 +275,7 @@ unsigned long i;
 \r
        for(;;)\r
        {\r
-               vPortTrace( "prvProcessPseudoInterrupts: Waiting for next interrupt event\r\n" );\r
                WaitForMultipleObjects( sizeof( pvObjectList ) / sizeof( void * ), pvObjectList, TRUE, INFINITE );\r
-               vPortTrace( "prvProcessPseudoInterrupts: Got interrupt event and mutex\r\n" );\r
 \r
                /* A thread will hold the interrupt event mutex while in a critical\r
                section, so this pseudo interrupt handler should only run when\r
@@ -318,7 +301,6 @@ unsigned long i;
                                {\r
                                        case portINTERRUPT_YIELD:\r
 \r
-                                               vPortTrace( "prvProcessPseudoInterrupts: Processing Yield\r\n" );\r
                                                lSwitchRequired = pdTRUE;\r
 \r
                                                /* Clear the interrupt pending bit. */\r
@@ -327,19 +309,7 @@ unsigned long i;
 \r
                                        case portINTERRUPT_TICK:\r
                                        \r
-                                               /* Tick interrupts should only be processed if the \r
-                                               critical nesting count is zero.  The critical nesting \r
-                                               count represents the interrupt mask on real target \r
-                                               hardware.  The thread that genereates ticks will not\r
-                                               actually ask for the tick to be processed unless the\r
-                                               critical nesting count is zero anyway, but it is \r
-                                               possible that a tick is pending when a yield is \r
-                                               performed (depending on if the simulation/emulation is\r
-                                               set up to process yields while within a critical \r
-                                               section. */\r
-                                               vPortTrace( "prvProcessPseudoInterrupts: Processing tick event\r\n" );\r
                                                /* Process the tick itself. */\r
-                                               vPortTrace( "prvProcessPseudoInterrupts: Incrementing tick\r\n" );\r
                                                vTaskIncrementTick();\r
                                                #if( configUSE_PREEMPTION != 0 )\r
                                                {\r
@@ -352,8 +322,6 @@ unsigned long i;
                                                        \r
                                                /* Clear the interrupt pending bit. */\r
                                                ulPendingInterrupts &= ~( 1UL << portINTERRUPT_TICK );\r
-\r
-                                               vPortTrace( "prvProcessPseudoInterrupts: Acking tick\r\n" );\r
                                                SetEvent( pvTickAcknowledgeEvent );\r
                                                break;\r
 \r
@@ -387,7 +355,7 @@ unsigned long i;
 \r
                        /* Select the next task to run. */\r
                        vTaskSwitchContext();\r
-                       \r
+\r
                        /* If the task selected to enter the running state is not the task\r
                        that is already in the running state. */\r
                        if( pvOldCurrentTCB != pxCurrentTCB )\r
@@ -411,9 +379,6 @@ unsigned long i;
                                \r
 \r
 \r
-                               //sprintf( cTraceBuffer, "Event processor: suspending %s, resuming %s\r\n", ((xTCB*)pvOldCurrentTCB)->pcTaskName, ((xTCB*)pxCurrentTCB)->pcTaskName );\r
-                               //vPortTrace( cTraceBuffer );\r
-\r
                                /* Obtain the state of the task now selected to enter the \r
                                Running state. */\r
                                pxThreadState = ( xThreadState * ) ( *( unsigned long *) pxCurrentTCB );\r
@@ -434,7 +399,6 @@ unsigned long i;
                if( pxThreadState->lWaitingInterruptAck == pdTRUE )\r
                {\r
                        pxThreadState->lWaitingInterruptAck = pdFALSE;\r
-                       vPortTrace( "prvProcessPseudoInterrupts: Acking interrupt even though a yield has not been performed.\r\n" );\r
                        SetEvent( pvInterruptAcknowledgeEvent );\r
                }\r
 \r
@@ -468,7 +432,6 @@ xThreadState *pxThreadState;
                        pxThreadState = ( xThreadState * ) *( ( unsigned long * ) pxCurrentTCB );\r
                        pxThreadState->lWaitingInterruptAck = pdTRUE;\r
 \r
-                       vPortTrace( "vPortGeneratePseudoInterrupt: Got interrupt mutex, about to signal interrupt event\r\n" );\r
                        SetEvent( pvInterruptEvent );\r
 \r
                        /* The interrupt ack event should not be signaled yet - if it is then there\r
@@ -480,7 +443,6 @@ xThreadState *pxThreadState;
                        }\r
 \r
                        SignalObjectAndWait( pvInterruptEventMutex, pvInterruptAcknowledgeEvent, INFINITE, FALSE );\r
-                       vPortTrace( "vPortGeneratePseudoInterrupt: Interrupt event mutex released, going to wait for interrupt ack\r\n" );\r
                }\r
                else\r
                {\r
@@ -555,7 +517,6 @@ long lMutexNeedsReleasing;
                                on function exit. */\r
                                lMutexNeedsReleasing = pdFALSE;\r
                                SignalObjectAndWait( pvInterruptEventMutex, pvInterruptAcknowledgeEvent, INFINITE, FALSE );\r
-                               vPortTrace( "vPortExitCritical: Interrupt acknowledged, leaving critical section code\r\n" );\r
                        }\r
                }\r
                else\r
@@ -571,3 +532,4 @@ long lMutexNeedsReleasing;
                ReleaseMutex( pvInterruptEventMutex );\r
        }\r
 }\r
+\r