]> git.sur5r.net Git - freertos/commitdiff
Revert critical section handling back to the original method.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 15 Feb 2008 13:33:44 +0000 (13:33 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 15 Feb 2008 13:33:44 +0000 (13:33 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@190 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/portable/Softune/MB91460/portmacro.h
Source/portable/Softune/MB96340/port.c
Source/portable/Softune/MB96340/portmacro.h

index 941471fffc959bb709cf2ef640c8aa4c76143ee6..6bff7a5cfa7ba49e8594138c6b24ff9ca7f4e42a 100644 (file)
 /*-----------------------------------------------------------*/        \r
 \r
 /* Critical section management. */\r
+#if configKERNEL_INTERRUPT_PRIORITY != 30\r
+       #error configKERNEL_INTERRUPT_PRIORITY (set in FreeRTOSConfig.h) must match the ILM value set in the following line - 30 (1Eh) being the default.\r
+#endif\r
+#define portDISABLE_INTERRUPTS() __asm(" STILM #1Eh ")\r
+#define portENABLE_INTERRUPTS() __asm(" MOVL ILM, #1Fh ")\r
+\r
 #define portENTER_CRITICAL()   \\r
        __asm(" ST PS,@-R15 ");         \\r
        __asm(" ANDCCR #0xef ");        \\r
@@ -86,9 +92,6 @@
 #define portEXIT_CRITICAL()            \\r
        __asm(" LD @R15+,PS ");         \\r
 \r
-#define portDISABLE_INTERRUPTS() __DI();\r
-#define portENABLE_INTERRUPTS() __EI();\r
-\r
 /*-----------------------------------------------------------*/\r
 \r
 /* Architecture specifics. */\r
index ef6798e8806b77fe270d045d05973642e749bf73..2b67f4e5e988baa1b12ae6e6d3d32c9a61f508ec 100644 (file)
@@ -73,10 +73,6 @@ static void prvSetupRLT0Interrupt( void );
 typedef void tskTCB;\r
 extern volatile tskTCB * volatile pxCurrentTCB;\r
 \r
-/* Constants required to handle critical sections. */\r
-#define portNO_CRITICAL_NESTING                ( ( unsigned portBASE_TYPE ) 0 )\r
-volatile unsigned portBASE_TYPE uxCriticalNesting = 9999UL;\r
-\r
 /*-----------------------------------------------------------*/\r
 \r
 /* \r
@@ -116,11 +112,6 @@ volatile unsigned portBASE_TYPE uxCriticalNesting = 9999UL;
                                __asm(" AND  CCR,#H'DF ");                                                      \\r
                                __asm(" PUSHW  A ");                                                                    \\r
                                __asm(" PUSHW (RW0,RW1,RW2,RW3,RW4,RW5,RW6,RW7) ");             \\r
-                                                                                                                                               \\r
-                               /* Save the critical nesting count to the stack. */             \\r
-                               __asm(" MOVW RW0, _uxCriticalNesting ");                                \\r
-                               __asm(" PUSHW (RW0) ");                                                                 \\r
-                                                                                                                                               \\r
                                __asm(" MOVW A, _pxCurrentTCB ");                                               \\r
                                __asm(" MOVW A, SP ");                                                                  \\r
                                __asm(" SWAPW ");                                                                               \\r
@@ -143,13 +134,6 @@ volatile unsigned portBASE_TYPE uxCriticalNesting = 9999UL;
                                __asm(" MOVW A, @A ");                                                                  \\r
                                __asm(" AND  CCR,#H'DF ");                                                      \\r
                                __asm(" MOVW SP, A ");                                                                  \\r
-                                                                                                                                               \\r
-                               /* Load the saved uxCriticalNesting value into RW0. */  \\r
-                               __asm(" POPW (RW0) ");                                                                  \\r
-                                                                                                                                               \\r
-                               /* Save the loaded value into the uxCriticalNesting variable. */ \\r
-                               __asm(" MOVW _uxCriticalNesting, RW0 ");                                \\r
-                                                                                                                                               \\r
                                __asm(" POPW (RW0,RW1,RW2,RW3,RW4,RW5,RW6,RW7) ");              \\r
                                __asm(" POPW  A ");                                                                             \\r
                                __asm(" OR   CCR,#H'20 ");                                                              \\r
@@ -203,11 +187,6 @@ volatile unsigned portBASE_TYPE uxCriticalNesting = 9999UL;
                                __asm(" AND  CCR,#H'DF ");                                                      \\r
                                __asm(" PUSHW  A ");                                                                    \\r
                                __asm(" PUSHW (RW0,RW1,RW2,RW3,RW4,RW5,RW6,RW7) ");             \\r
-                                                                                                                                               \\r
-                               /* Save the critical nesting count to the stack. */             \\r
-                               __asm(" MOVW RW0, _uxCriticalNesting ");                                \\r
-                               __asm(" PUSHW (RW0) ");                                                                 \\r
-                                                                                                                                               \\r
                                __asm(" MOVL A, _pxCurrentTCB ");                                               \\r
                                __asm(" MOVL RL2, A ");                                                                 \\r
                                __asm(" MOVW A, SP ");                                                                  \\r
@@ -224,13 +203,6 @@ volatile unsigned portBASE_TYPE uxCriticalNesting = 9999UL;
                                __asm(" MOVW SP, A ");                                                                  \\r
                                __asm(" MOV A, @RL2+2 ");                                                               \\r
                                __asm(" MOV USB, A ");                                                                  \\r
-                                                                                                                                               \\r
-                               /* Load the saved uxCriticalNesting value into RW0. */  \\r
-                               __asm(" POPW (RW0) ");                                                                  \\r
-                                                                                                                                               \\r
-                               /* Save the loaded value into the uxCriticalNesting variable. */ \\r
-                               __asm(" MOVW _uxCriticalNesting, RW0 ");                                \\r
-                                                                                                                                               \\r
                                __asm(" POPW (RW0,RW1,RW2,RW3,RW4,RW5,RW6,RW7) ");              \\r
                                __asm(" POPW  A ");                                                                             \\r
                                __asm(" OR   CCR,#H'20 ");                                                              \\r
@@ -398,11 +370,6 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE
        *pxTopOfStack = ( portSTACK_TYPE ) 0x1111;      /* RW1 */\r
        pxTopOfStack--;\r
        *pxTopOfStack = ( portSTACK_TYPE ) 0x8888;      /* RW0 */\r
-       pxTopOfStack--;\r
-\r
-       /* The task starts with its uxCriticalNesting variable set to 0, interrupts\r
-       being enabled. */\r
-       *pxTopOfStack = portNO_CRITICAL_NESTING;\r
                \r
        return pxTopOfStack;\r
 }\r
@@ -554,28 +521,3 @@ __nosavereg __interrupt void vPortYieldDelayed( void )
 }      \r
 /*-----------------------------------------------------------*/\r
 \r
-void vPortEnterCritical( void )\r
-{\r
-       /* Disable interrupts */\r
-       portDISABLE_INTERRUPTS();\r
-\r
-       /* Now interrupts are disabled uxCriticalNesting can be accessed\r
-        directly.  Increment uxCriticalNesting to keep a count of how many times\r
-        portENTER_CRITICAL() has been called. */\r
-       uxCriticalNesting++;\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-void vPortExitCritical( void )\r
-{\r
-       if( uxCriticalNesting > portNO_CRITICAL_NESTING )\r
-       {\r
-               uxCriticalNesting--;\r
-               if( uxCriticalNesting == portNO_CRITICAL_NESTING )\r
-               {\r
-                       /* Enable all interrupt/exception. */\r
-                       portENABLE_INTERRUPTS();\r
-               }\r
-       }\r
-}\r
-/*-----------------------------------------------------------*/\r
index 86af6841502c205d9044987581cc6439a08666c6..112bf380f1a281acb7ff8af802b6b012fd28ff4b 100644 (file)
@@ -87,10 +87,20 @@ FreeRTOSConfig.h to set the configMEMMODEL value. */
 /*-----------------------------------------------------------*/        \r
 \r
 /* Critical section handling. */\r
-#define portDISABLE_INTERRUPTS()       __DI();\r
-#define portENABLE_INTERRUPTS()                __EI();\r
-#define portENTER_CRITICAL()           vPortEnterCritical()\r
-#define portEXIT_CRITICAL()                    vPortExitCritical()\r
+#if configKERNEL_INTERRUPT_PRIORITY != 6\r
+       #error configKERNEL_INTERRUPT_PRIORITY (set in FreeRTOSConfig.h) must match the ILM value set in the following line - #06H being the default.\r
+#endif\r
+#define portENABLE_INTERRUPTS()                __asm(" MOV ILM, #06h ")\r
+#define portDISABLE_INTERRUPTS()       __asm(" MOV ILM, #07h ")\r
+\r
+#define portENTER_CRITICAL()                                                           \\r
+               {       __asm(" PUSHW PS ");                                                    \\r
+                       portDISABLE_INTERRUPTS();                                               \\r
+               }\r
+\r
+#define portEXIT_CRITICAL()                                                                    \\r
+               {       __asm(" POPW PS ");                                                             \\r
+               }\r
 \r
 /*-----------------------------------------------------------*/\r
 \r