From 6ea099af9e180a7d3a54bdb132dc349254bf67d8 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Wed, 17 Apr 2013 08:46:10 +0000 Subject: [PATCH] Update yield code in RX600/IAR compiler port. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1868 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../Source/portable/IAR/RX600/portmacro.h | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/FreeRTOS/Source/portable/IAR/RX600/portmacro.h b/FreeRTOS/Source/portable/IAR/RX600/portmacro.h index 2f0fecdc6..1ba21281f 100644 --- a/FreeRTOS/Source/portable/IAR/RX600/portmacro.h +++ b/FreeRTOS/Source/portable/IAR/RX600/portmacro.h @@ -56,19 +56,19 @@ *************************************************************************** - http://www.FreeRTOS.org - Documentation, books, training, latest versions, + http://www.FreeRTOS.org - Documentation, books, training, latest versions, license and Real Time Engineers Ltd. contact details. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, and our new fully thread aware and reentrant UDP/IP stack. - http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High - Integrity Systems, who sell the code with commercial support, + http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High + Integrity Systems, who sell the code with commercial support, indemnification and middleware, under the OpenRTOS brand. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. */ @@ -114,13 +114,23 @@ portSTACK_TYPE and portBASE_TYPE. */ /* Hardware specifics. */ #define portBYTE_ALIGNMENT 8 /* Could make four, according to manual. */ #define portSTACK_GROWTH -1 -#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) +#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) #define portNOP() __no_operation() -/* The location of the software interrupt register. Software interrupts use -vector 27. */ -#define portITU_SWINTR ( ( unsigned char * ) 0x000872E0 ) -#define portYIELD() *portITU_SWINTR = ( unsigned char ) 0x01; portNOP(); portNOP(); portNOP(); portNOP(); portNOP() +/* Yield equivalent to "*portITU_SWINTR = 0x01; ( void ) *portITU_SWINTR;" +where portITU_SWINTR is the location of the software interrupt register +(0x000872E0). Don't rely on the assembler to select a register, so instead +save and restore clobbered registers manually. */ +#define portYIELD() \ + __asm volatile \ + ( \ + "PUSH.L R10 \n" \ + "MOV.L #0x872E0, R10 \n" \ + "MOV.B #0x1, [R10] \n" \ + "MOV.L [R10], R10 \n" \ + "POP R10 \n" \ + ) + #define portYIELD_FROM_ISR( x ) if( ( x ) != pdFALSE ) portYIELD() /* -- 2.39.5