]> git.sur5r.net Git - freertos/commitdiff
Update yield code in RX600/IAR compiler port.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 17 Apr 2013 08:46:10 +0000 (08:46 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 17 Apr 2013 08:46:10 +0000 (08:46 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1868 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Source/portable/IAR/RX600/portmacro.h

index 2f0fecdc6aa9029d3a9d2fb4699a85329cdd828b..1ba21281f7dbb5926977d8518525f4ff3ee0d08d 100644 (file)
     ***************************************************************************\r
 \r
 \r
-    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
     license and Real Time Engineers Ltd. contact details.\r
 \r
     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
     including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
     fully thread aware and reentrant UDP/IP stack.\r
 \r
-    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
-    Integrity Systems, who sell the code with commercial support, \r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
+    Integrity Systems, who sell the code with commercial support,\r
     indemnification and middleware, under the OpenRTOS brand.\r
-    \r
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
-    engineered and independently SIL3 certified version for use in safety and \r
+\r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+    engineered and independently SIL3 certified version for use in safety and\r
     mission critical applications that require provable dependability.\r
 */\r
 \r
@@ -114,13 +114,23 @@ portSTACK_TYPE and portBASE_TYPE. */
 /* Hardware specifics. */\r
 #define portBYTE_ALIGNMENT                     8       /* Could make four, according to manual. */\r
 #define portSTACK_GROWTH                       -1\r
-#define portTICK_RATE_MS                       ( ( portTickType ) 1000 / configTICK_RATE_HZ )          \r
+#define portTICK_RATE_MS                       ( ( portTickType ) 1000 / configTICK_RATE_HZ )\r
 #define portNOP()                                      __no_operation()\r
 \r
-/* The location of the software interrupt register.  Software interrupts use\r
-vector 27. */\r
-#define portITU_SWINTR                 ( ( unsigned char * ) 0x000872E0 )\r
-#define portYIELD()                            *portITU_SWINTR = ( unsigned char ) 0x01; portNOP(); portNOP(); portNOP(); portNOP(); portNOP()\r
+/* Yield equivalent to "*portITU_SWINTR = 0x01; ( void ) *portITU_SWINTR;"\r
+where portITU_SWINTR is the location of the software interrupt register\r
+(0x000872E0).  Don't rely on the assembler to select a register, so instead\r
+save and restore clobbered registers manually. */\r
+#define portYIELD()                                                    \\r
+       __asm volatile                                                  \\r
+       (                                                                               \\r
+               "PUSH.L R10                                     \n"             \\r
+               "MOV.L  #0x872E0, R10           \n"             \\r
+               "MOV.B  #0x1, [R10]                     \n"             \\r
+               "MOV.L  [R10], R10                      \n"             \\r
+               "POP    R10                                     \n"             \\r
+       )\r
+\r
 #define portYIELD_FROM_ISR( x )        if( ( x ) != pdFALSE ) portYIELD()\r
 \r
 /*\r