***************************************************************************\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
/* 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