]> git.sur5r.net Git - freertos/commitdiff
Re-jig some of the new functions to correctly assign them public or private linkage...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 22 Oct 2012 16:40:45 +0000 (16:40 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 22 Oct 2012 16:40:45 +0000 (16:40 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1799 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

16 files changed:
FreeRTOS/Source/include/FreeRTOS.h
FreeRTOS/Source/include/task.h
FreeRTOS/Source/portable/CCS/ARM_Cortex-R4/portASM.asm
FreeRTOS/Source/portable/GCC/ARM_CM3/port.c
FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h
FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c
FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h
FreeRTOS/Source/portable/IAR/ARM_CM3/port.c
FreeRTOS/Source/portable/IAR/ARM_CM3/portmacro.h
FreeRTOS/Source/portable/IAR/ARM_CM4F/port.c
FreeRTOS/Source/portable/IAR/ARM_CM4F/portmacro.h
FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c
FreeRTOS/Source/portable/RVDS/ARM_CM3/portmacro.h
FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c
FreeRTOS/Source/portable/RVDS/ARM_CM4F/portmacro.h
FreeRTOS/Source/tasks.c

index 7be6110f49a1ce86056669c67042c3ae7a052652..c9eda0fd735e75be4ff3b29cfa834443309ead07 100644 (file)
@@ -534,12 +534,12 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * );
        #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )\r
 #endif\r
 \r
-#ifndef portPRE_SLEEP_PROCESSING\r
-       #define portPRE_SLEEP_PROCESSING()\r
+#ifndef configPRE_SLEEP_PROCESSING\r
+       #define configPRE_SLEEP_PROCESSING()\r
 #endif\r
 \r
-#ifndef portPOST_SLEEP_PROCESSING\r
-       #define portPOST_SLEEP_PROCESSING()\r
+#ifndef configPOST_SLEEP_PROCESSING\r
+       #define configPOST_SLEEP_PROCESSING()\r
 #endif\r
 \r
 #endif /* INC_FREERTOS_H */\r
index 1afc16cea5858958c0a522e3bfef4cca9b9e23f8..b6a7818a88443ec09a3bbfa9d9354e088bd9cba4 100644 (file)
@@ -1320,12 +1320,6 @@ unsigned portBASE_TYPE uxTaskGetTaskNumber( xTaskHandle xTask );
  */\r
 void vTaskSetTaskNumber( xTaskHandle xTask, unsigned portBASE_TYPE uxHandle );\r
 \r
-/*\r
- * Return the amount of time, in ticks, that will pass before the kernel will\r
- * next move a task from the Blocked state to the Running state.\r
- */\r
-portTickType xTaskGetExpectedIdleTime( void );\r
-\r
 /*\r
  * If tickless mode is being used, or a low power mode is implemented, then\r
  * the tick interrupt will not execute during idle periods.  When this is the\r
@@ -1335,13 +1329,6 @@ portTickType xTaskGetExpectedIdleTime( void );
  */\r
 void vTaskStepTick( portTickType xTicksToJump );\r
 \r
-/*\r
- * Returns the number of tick interrupts that have occurred while the scheduler \r
- * has been suspended.  The count pending ticks is reset if xResetOnExit is set\r
- * to pdTRUE.\r
- */\r
-unsigned portBASE_TYPE uxTaskPendingTicksGet( portBASE_TYPE xResetOnExit );\r
-\r
 #ifdef __cplusplus\r
 }\r
 #endif\r
index b3d4a6c78ca176e43bac9656a62baa2d3cc5a0b3..989e5dbb3c535bca85fdf8ed83a9efbb562c1df7 100644 (file)
@@ -146,7 +146,7 @@ portRESTORE_CONTEXT .macro
 \r
                ; Get the SPSR from the stack.\r
                LDMFD   LR!, {R0}\r
-               MSR             SPSR_CF, R0\r
+               MSR             SPSR_CSXF, R0\r
 \r
                ; Restore all system mode registers for the task.\r
                LDMFD   LR, {R0-R14}^\r
index 0a88a9c7263ef64ccb9e83a96ad2e8795633762a..4401094894c2e9ad64ed916d7178f55e487c7363 100644 (file)
@@ -403,9 +403,9 @@ void xPortSysTickHandler( void )
                        portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
 \r
                        /* Sleep until something happens. */\r
-                       portPRE_SLEEP_PROCESSING();\r
+                       configPRE_SLEEP_PROCESSING();\r
                        __asm volatile( "wfi" );\r
-                       portPOST_SLEEP_PROCESSING();\r
+                       configPOST_SLEEP_PROCESSING();\r
 \r
                        /* Stop SysTick.  Again, the time the SysTick is stopped for is\r
                        accounted for as best it can be, but using the tickless mode will\r
index d9c3b42c55720710ebe37d893bdd3aa268515870..e6f0989f71627c0389617cd4338c0c77f55a598a 100644 (file)
@@ -136,8 +136,10 @@ not necessary for to use this port.  They are defined so the common demo files
 /*-----------------------------------------------------------*/\r
 \r
 /* Tickless idle/low power functionality. */\r
-extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
-#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#ifndef portSUPPRESS_TICKS_AND_SLEEP\r
+       extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
+       #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#endif\r
 /*-----------------------------------------------------------*/\r
 \r
 /* Architecture specific optimisations. */\r
index 51781e7bf5747c23cf55e4c2a6a1cb980d7fbbc2..41da9a79e83b733a4993973a7539323110723fea 100644 (file)
@@ -438,9 +438,9 @@ void xPortSysTickHandler( void )
                        portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
 \r
                        /* Sleep until something happens. */\r
-                       portPRE_SLEEP_PROCESSING();\r
+                       configPRE_SLEEP_PROCESSING();\r
                        __asm volatile( "wfi" );\r
-                       portPOST_SLEEP_PROCESSING();\r
+                       configPOST_SLEEP_PROCESSING();\r
 \r
                        /* Stop SysTick.  Again, the time the SysTick is stopped for is\r
                        accounted for as best it can be, but using the tickless mode will\r
index b35ae8517f2bd4e9697163a74561de8a762f7b8f..d74c9bb2c5a0a64e7d492739f41773ff83677735 100644 (file)
@@ -143,8 +143,10 @@ not necessary for to use this port.  They are defined so the common demo files
 /*-----------------------------------------------------------*/\r
 \r
 /* Tickless idle/low power functionality. */\r
-extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
-#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#ifndef portSUPPRESS_TICKS_AND_SLEEP\r
+       extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
+       #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#endif\r
 /*-----------------------------------------------------------*/\r
 \r
 /* Architecture specific optimisations. */\r
index bfdbeb3f74dbcff31af1c19a93d733a0abe010a4..2601d50350453ccef6efb6e4c3852c5f034621e0 100644 (file)
@@ -300,9 +300,9 @@ void xPortSysTickHandler( void )
                        portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
 \r
                        /* Sleep until something happens. */\r
-                       portPRE_SLEEP_PROCESSING();\r
+                       configPRE_SLEEP_PROCESSING();\r
                        __WFI();\r
-                       portPOST_SLEEP_PROCESSING();\r
+                       configPOST_SLEEP_PROCESSING();\r
 \r
                        /* Stop SysTick.  Again, the time the SysTick is stopped for is\r
                        accounted for as best it can be, but using the tickless mode will\r
index ce9e9639ea66d8e52f79bb1e9417720187f7b1d3..8116bac8d6fc8ada103abd95173e3d41e9deb539 100644 (file)
@@ -148,9 +148,11 @@ extern void vPortClearInterruptMask( unsigned long ulNewMask );
 #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x)   vPortClearInterruptMask( x )\r
 /*-----------------------------------------------------------*/\r
 \r
-/* Tickless/low power functionality. */\r
-extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
-#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+/* Tickless idle/low power functionality. */\r
+#ifndef portSUPPRESS_TICKS_AND_SLEEP\r
+       extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
+       #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#endif\r
 /*-----------------------------------------------------------*/\r
 \r
 /* Task function macros as described on the FreeRTOS.org WEB site.  These are\r
index 61c08cb6802d004681f32cef70ce04f20d743665..3ee8eb34986a07f2859fdc53fd5fb6137dec8db0 100644 (file)
@@ -325,9 +325,9 @@ void xPortSysTickHandler( void )
                        portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
 \r
                        /* Sleep until something happens. */\r
-                       portPRE_SLEEP_PROCESSING();\r
+                       configPRE_SLEEP_PROCESSING();\r
                        __WFI();\r
-                       portPOST_SLEEP_PROCESSING();\r
+                       configPOST_SLEEP_PROCESSING();\r
 \r
                        /* Stop SysTick.  Again, the time the SysTick is stopped for is\r
                        accounted for as best it can be, but using the tickless mode will\r
index 935de5d7dbbb0c848ec1d7fa9b88a53ad07071b1..676660690a9e52870a37856192e36f30ba137f78 100644 (file)
@@ -153,9 +153,11 @@ portALIGNMENT_ASSERT_pxCurrentTCB() will trigger false positive asserts. */
 #define portALIGNMENT_ASSERT_pxCurrentTCB ( void )\r
 /*-----------------------------------------------------------*/\r
 \r
-/* Tickless/low power functionality. */\r
-extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
-#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+/* Tickless idle/low power functionality. */\r
+#ifndef portSUPPRESS_TICKS_AND_SLEEP\r
+       extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
+       #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#endif\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
index 2bdcd8f9d24faf0cee31328ddf5f3042dc880e00..5c3a5534ecfa10a96d53d963c66cd3369246a863 100644 (file)
@@ -368,9 +368,9 @@ void xPortSysTickHandler( void )
                        portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
 \r
                        /* Sleep until something happens. */\r
-                       portPRE_SLEEP_PROCESSING();\r
+                       configPRE_SLEEP_PROCESSING();\r
                        __wfi();\r
-                       portPOST_SLEEP_PROCESSING();\r
+                       configPOST_SLEEP_PROCESSING();\r
 \r
                        /* Stop SysTick.  Again, the time the SysTick is stopped for is\r
                        accounted for as best it can be, but using the tickless mode will\r
index 08bbe69a0f026c318211b4cb765dd475a4d3e6b1..c64420c7f66e1ca52b195723e5d63a98065a263e 100644 (file)
@@ -129,9 +129,11 @@ extern void vPortExitCritical( void );
 #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x)   vPortClearInterruptMask(x)\r
 /*-----------------------------------------------------------*/\r
 \r
-/* Tickless/low power optimisations. */\r
-extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
-#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+/* Tickless idle/low power functionality. */\r
+#ifndef portSUPPRESS_TICKS_AND_SLEEP\r
+       extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
+       #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#endif\r
 /*-----------------------------------------------------------*/\r
 \r
 /* Port specific optimisations. */\r
index 7ccd107b5d2e4fe015217c65beb6fca337d84215..02818c5e2178a7939f0b2568cfd0376940ea7203 100644 (file)
@@ -431,9 +431,9 @@ void xPortSysTickHandler( void )
                        portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
 \r
                        /* Sleep until something happens. */\r
-                       portPRE_SLEEP_PROCESSING();\r
+                       configPRE_SLEEP_PROCESSING();\r
                        __wfi();\r
-                       portPOST_SLEEP_PROCESSING();\r
+                       configPOST_SLEEP_PROCESSING();\r
 \r
                        /* Stop SysTick.  Again, the time the SysTick is stopped for is\r
                        accounted for as best it can be, but using the tickless mode will\r
index cc39f85d5e1c0f64f942029ac2aa5f1cfc3663f6..0e8d56d515fd15d7fc630f6c662a4bf5f6c91a06 100644 (file)
@@ -135,9 +135,11 @@ portALIGNMENT_ASSERT_pxCurrentTCB() will trigger false positive asserts. */
 #define portALIGNMENT_ASSERT_pxCurrentTCB ( void )\r
 /*-----------------------------------------------------------*/\r
 \r
-/* Tickless/low power optimisations. */\r
-extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
-#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+/* Tickless idle/low power functionality. */\r
+#ifndef portSUPPRESS_TICKS_AND_SLEEP\r
+       extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
+       #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#endif\r
 /*-----------------------------------------------------------*/\r
 \r
 /* Port specific optimisations. */\r
index ac1ca9c2893f76274941b831463cb3bb59a4bd6f..ef6208fc969c5b065527aa09da66e4e241dfd07c 100644 (file)
@@ -460,6 +460,15 @@ static tskTCB *prvAllocateTCBAndStack( unsigned short usStackDepth, portSTACK_TY
 \r
 #endif\r
 \r
+/*\r
+ * Return the amount of time, in ticks, that will pass before the kernel will\r
+ * next move a task from the Blocked state to the Running state.\r
+ */\r
+#if ( configUSE_TICKLESS_IDLE == 1 )\r
+\r
+       static portTickType prvGetExpectedIdleTime( void ) PRIVILEGED_FUNCTION;\r
+\r
+#endif\r
 \r
 /*lint +e956 */\r
 \r
@@ -1305,7 +1314,7 @@ void vTaskSuspendAll( void )
 }\r
 /*----------------------------------------------------------*/\r
 \r
-portTickType xTaskGetExpectedIdleTime( void )\r
+portTickType prvGetExpectedIdleTime( void )\r
 {\r
 portTickType xReturn;\r
 \r
@@ -1618,11 +1627,15 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
 #endif\r
 /*----------------------------------------------------------*/\r
 \r
-void vTaskStepTick( portTickType xTicksToJump )\r
-{\r
-       configASSERT( xTicksToJump <= xNextTaskUnblockTime );\r
-       xTickCount += xTicksToJump;\r
-}\r
+#if ( configUSE_TICKLESS_IDLE == 1 )\r
+\r
+       void vTaskStepTick( portTickType xTicksToJump )\r
+       {\r
+               configASSERT( xTicksToJump <= xNextTaskUnblockTime );\r
+               xTickCount += xTicksToJump;\r
+       }\r
+\r
+#endif\r
 \r
 /*-----------------------------------------------------------\r
  * SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES\r
@@ -1917,6 +1930,8 @@ portTickType xTimeToWake;
                /* Calculate the time at which the task should be woken if the event does\r
                not occur.  This may overflow but this doesn't matter. */\r
                xTimeToWake = xTickCount + xTicksToWait;\r
+               \r
+               traceTASK_DELAY_UNTIL();\r
                prvAddCurrentTaskToDelayedList( xTimeToWake );\r
        }\r
 \r
@@ -2150,7 +2165,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
                                test of the expected idle time is performed without the\r
                                scheduler suspended.  The result here is not necessarily\r
                                valid. */\r
-                               xExpectedIdleTime = xTaskGetExpectedIdleTime();\r
+                               xExpectedIdleTime = prvGetExpectedIdleTime();\r
 \r
                                if( xExpectedIdleTime >= xMinimumExpectedIdleTime )\r
                                {\r
@@ -2160,7 +2175,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
                                                time can be sampled again, and this time its value can\r
                                                be used. */\r
                                                configASSERT( xNextTaskUnblockTime >= xTickCount );\r
-                                               xExpectedIdleTime = xTaskGetExpectedIdleTime();\r
+                                               xExpectedIdleTime = prvGetExpectedIdleTime();\r
 \r
                                                if( xExpectedIdleTime >= xMinimumExpectedIdleTime )\r
                                                {\r
@@ -2723,25 +2738,6 @@ tskTCB *pxNewTCB;
 #endif\r
 /*-----------------------------------------------------------*/\r
 \r
-#if ( configUSE_TICKLESS_IDLE == 1 )\r
-\r
-       unsigned portBASE_TYPE uxTaskPendingTicksGet( portBASE_TYPE xResetOnExit )\r
-       {\r
-       unsigned portBASE_TYPE uxReturn;\r
-\r
-               uxReturn = uxMissedTicks;\r
-\r
-               if( xResetOnExit == pdTRUE )\r
-               {\r
-                       uxMissedTicks = 0;\r
-               }\r
-\r
-               return uxReturn;\r
-       }\r
-\r
-#endif\r
-/*-----------------------------------------------------------*/\r
-\r
 \r
 \r
 \r