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

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

index 90ad448026655e484a07a03122ac7be200f69f9b..5dd5398cb278e9058927155c2e3b9add49b4ffbb 100644 (file)
@@ -51,10 +51,6 @@ any details of its type. */
 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 portLONG ulCriticalNesting = 9999UL;\r
-\r
 /*-----------------------------------------------------------*/\r
  \r
 #pragma asm\r
@@ -65,10 +61,6 @@ volatile unsigned portLONG ulCriticalNesting = 9999UL;
         STM1 (R14,R13,R12,R11,R10,R9,R8)                       ;Store R14-R8\r
         ST MDH, @-R15                                                          ;Store MDH\r
         ST MDL, @-R15                                                          ;Store MDL\r
-\r
-        LDI #_ulCriticalNesting, R0                            ;Get the address of the critical nesting counter\r
-        LD @R0, R0                                                                     ;Get the value of the critical nesting counter\r
-        ST R0, @-R15                                                           ;Store the critical nesting value to the user stack.\r
         \r
         ANDCCR #0xDF                                                           ;Switch back to system stack\r
         LD @R15+,R0                                                            ;Store PC to R0 \r
@@ -104,10 +96,6 @@ volatile unsigned portLONG ulCriticalNesting = 9999UL;
 \r
         ORCCR #0x20                                                            ;Switch back to retrieve the remaining context\r
 \r
-        LDI #_ulCriticalNesting, R0                            ;Get the address of the critical nesting counter\r
-        LD @R15+, R1                                                           ;Get the saved critical nesting value\r
-        ST R1, @R0                                                                     ;Save the critical nesting value into the ulCriticalNesting variable\r
-\r
         LD @R15+, MDL                                                          ;Restore MDL\r
         LD @R15+, MDH                                                          ;Restore MDH\r
         LDM1 (R14,R13,R12,R11,R10,R9,R8)                       ;Restore R14-R8\r
@@ -192,11 +180,6 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE
        *pxTopOfStack = ( portSTACK_TYPE ) 0x22220000;  /* MDL */\r
        pxTopOfStack--;\r
 \r
-       /* The task starts with its ulCriticalNesting variable set to 0, \r
-       interrupts being enabled. */\r
-       *pxTopOfStack = portNO_CRITICAL_NESTING;\r
-       pxTopOfStack--;\r
-\r
        /* The start of the task code. */\r
        *pxTopOfStack = ( portSTACK_TYPE ) pxCode;      /* PC */\r
        pxTopOfStack--;\r
@@ -351,32 +334,3 @@ const unsigned portSHORT usReloadValue = ( unsigned portSHORT ) ( ( ( configPER_
 #pragma endasm\r
 /*-----------------------------------------------------------*/\r
 \r
-void vPortEnterCritical( void )\r
-{\r
-       /* Disable interrupts upto level 30. */\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 (0x1e) being the default.\r
-       #endif\r
-\r
-       __asm(" STILM #1Eh ");\r
\r
-\r
-       /* Now interrupts are disabled ulCriticalNesting can be accessed\r
-       directly. Increment ulCriticalNesting to keep a count of how many times\r
-       portENTER_CRITICAL() has been called. */\r
-       ulCriticalNesting++;\r
-}\r
-/*-----------------------------------------------------------*/ \r
-\r
-void vPortExitCritical( void )\r
-{\r
-       if( ulCriticalNesting > portNO_CRITICAL_NESTING )\r
-       {\r
-               ulCriticalNesting--;\r
-               if( ulCriticalNesting == portNO_CRITICAL_NESTING )\r
-               {\r
-                       /* Enable all interrupts */\r
-                       __asm(" STILM #1Fh ");\r
-               }\r
-       }\r
-}\r
index 03a965f6e7eab1fbf926397c0a183416d819a237..941471fffc959bb709cf2ef640c8aa4c76143ee6 100644 (file)
 /*-----------------------------------------------------------*/        \r
 \r
 /* Critical section management. */\r
-void vPortEnterCritical( void );\r
-void vPortExitCritical( void );\r
-#define portENTER_CRITICAL() vPortEnterCritical()\r
-#define portEXIT_CRITICAL() vPortExitCritical()\r
+#define portENTER_CRITICAL()   \\r
+       __asm(" ST PS,@-R15 ");         \\r
+       __asm(" ANDCCR #0xef ");        \\r
+\r
+\r
+#define portEXIT_CRITICAL()            \\r
+       __asm(" LD @R15+,PS ");         \\r
+\r
 #define portDISABLE_INTERRUPTS() __DI();\r
 #define portENABLE_INTERRUPTS() __EI();\r
 \r