#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) \r
#define portNOP() __asm volatile( "NOP" )\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 = 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