]> git.sur5r.net Git - freertos/commitdiff
Removed the manual context switch from the C file, this is now in an asm file instead...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 16 Jul 2008 09:12:54 +0000 (09:12 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 16 Jul 2008 09:12:54 +0000 (09:12 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@406 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/portable/MPLAB/PIC24_dsPIC/port.c

index 1aa4d5d7d9f65924f04cbc750d5f8b42c4ed8b85..e31cc9af493c4b45b54cd8ad2682e7827b786778 100644 (file)
@@ -103,29 +103,6 @@ unsigned portBASE_TYPE uxCriticalNesting = 0xef;
                                                "POP.D  W0                                              \n"                                                                                                                             \\r
                                                "POP    SR                                                " );\r
 \r
-\r
-       #define portSAVE_CONTEXT()                                                                                                                                                                                      \\r
-               asm volatile(   "PUSH   SR                                              \n"     /* Save the SR used by the task.... */                                          \\r
-                                               "PUSH   W0                                              \n"     /* ....then disable interrupts. */                                                      \\r
-                                               "MOV    #32, W0                         \n"                                                                                                                             \\r
-                                               "MOV    W0, SR                                  \n"                                                                                                                             \\r
-                                               "PUSH   W1                                              \n"     /* Save registers to the stack. */                                                      \\r
-                                               "PUSH.D W2                                              \n"                                                                                                                             \\r
-                                               "PUSH.D W4                                              \n"                                                                                                                             \\r
-                                               "PUSH.D W6                                              \n"                                                                                                                             \\r
-                                               "PUSH.D W8                                              \n"                                                                                                                             \\r
-                                               "PUSH.D W10                                             \n"                                                                                                                             \\r
-                                               "PUSH.D W12                                             \n"                                                                                                                             \\r
-                                               "PUSH   W14                                             \n"                                                                                                                             \\r
-                                               "PUSH   RCOUNT                                  \n"                                                                                                                             \\r
-                                               "PUSH   TBLPAG                                  \n"                                                                                                                             \\r
-                                               "PUSH   CORCON                                  \n"                                                                                                                             \\r
-                                               "PUSH   PSVPAG                                  \n"                                                                                                                             \\r
-                                               "MOV    _uxCriticalNesting, W0  \n"     /* Save the critical nesting counter for the task. */           \\r
-                                               "PUSH   W0                                              \n"                                                                                                                             \\r
-                                               "MOV    _pxCurrentTCB, W0               \n"     /* Save the new top of stack into the TCB. */                           \\r
-                                               "MOV    W15, [W0]                                 ");\r
-\r
 #endif /* MPLAB_PIC24_PORT */\r
 \r
 #ifdef MPLAB_DSPIC_PORT\r
@@ -160,40 +137,6 @@ unsigned portBASE_TYPE uxCriticalNesting = 0xef;
                                                "POP.D  W0                                              \n"                                                                                                                             \\r
                                                "POP    SR                                                " );\r
 \r
-\r
-       #define portSAVE_CONTEXT()                                                                                                                                                                                      \\r
-               asm volatile(   "PUSH   SR                                              \n"     /* Save the SR used by the task.... */                                          \\r
-                                               "PUSH   W0                                              \n"     /* ....then disable interrupts. */                                                      \\r
-                                               "MOV    #32, W0                         \n"                                                                                                                             \\r
-                                               "MOV    W0, SR                                  \n"                                                                                                                             \\r
-                                               "PUSH   W1                                              \n"     /* Save registers to the stack. */                                                      \\r
-                                               "PUSH.D W2                                              \n"                                                                                                                             \\r
-                                               "PUSH.D W4                                              \n"                                                                                                                             \\r
-                                               "PUSH.D W6                                              \n"                                                                                                                             \\r
-                                               "PUSH.D W8                                              \n"                                                                                                                             \\r
-                                               "PUSH.D W10                                             \n"                                                                                                                             \\r
-                                               "PUSH.D W12                                             \n"                                                                                                                             \\r
-                                               "PUSH   W14                                             \n"                                                                                                                             \\r
-                                               "PUSH   RCOUNT                                  \n"                                                                                                                             \\r
-                                               "PUSH   TBLPAG                                  \n"                                                                                                                             \\r
-                                               "PUSH   ACCAL                                   \n"                                                                                                                             \\r
-                                               "PUSH   ACCAH                                   \n"                                                                                                                             \\r
-                                               "PUSH   ACCAU                                   \n"                                                                                                                             \\r
-                                               "PUSH   ACCBL                                   \n"                                                                                                                             \\r
-                                               "PUSH   ACCBH                                   \n"                                                                                                                             \\r
-                                               "PUSH   ACCBU                                   \n"                                                                                                                             \\r
-                                               "PUSH   DCOUNT                                  \n"                                                                                                                             \\r
-                                               "PUSH   DOSTARTL                                \n"                                                                                                                             \\r
-                                               "PUSH   DOSTARTH                                \n"                                                                                                                             \\r
-                                               "PUSH   DOENDL                                  \n"                                                                                                                             \\r
-                                               "PUSH   DOENDH                                  \n"                                                                                                                             \\r
-                                               "PUSH   CORCON                                  \n"                                                                                                                             \\r
-                                               "PUSH   PSVPAG                                  \n"                                                                                                                             \\r
-                                               "MOV    _uxCriticalNesting, W0  \n"     /* Save the critical nesting counter for the task. */           \\r
-                                               "PUSH   W0                                              \n"                                                                                                                             \\r
-                                               "MOV    _pxCurrentTCB, W0               \n"     /* Save the new top of stack into the TCB. */                           \\r
-                                               "MOV    W15, [W0]                                 " );\r
-\r
 #endif /* MPLAB_DSPIC_PORT */\r
 \r
 /*\r
@@ -308,19 +251,6 @@ void vPortEndScheduler( void )
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-/*\r
- * Manual context switch.  This is similar to the tick context switch,\r
- * but does not increment the tick count.  It must be identical to the\r
- * tick context switch in how it stores the stack of a task.\r
- */\r
-void vPortYield( void )\r
-{\r
-       portSAVE_CONTEXT();\r
-       vTaskSwitchContext();\r
-       portRESTORE_CONTEXT();\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
 /*\r
  * Setup a timer for a regular tick.\r
  */\r
@@ -371,11 +301,11 @@ void vPortExitCritical( void )
 \r
 void __attribute__((__interrupt__, auto_psv)) _T1Interrupt( void )\r
 {\r
-       vTaskIncrementTick();\r
-\r
        /* Clear the timer interrupt. */\r
        IFS0bits.T1IF = 0;\r
 \r
+       vTaskIncrementTick();\r
+\r
        #if configUSE_PREEMPTION == 1\r
                portYIELD();\r
        #endif\r