Update yield code in RX200/Renesas compiler port.

This commit is contained in:
Richard Barry 2013-04-17 08:55:16 +00:00
parent 352949af42
commit 2b41be4cb9

View File

@ -118,10 +118,22 @@ portSTACK_TYPE and portBASE_TYPE. */
#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) #define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )
#define portNOP() nop() #define portNOP() nop()
/* The location of the software interrupt register. Software interrupts use #pragma inline_asm vPortYield
vector 27. */ static void vPortYield( void )
#define portITU_SWINTR ( ( unsigned char * ) 0x000872E0 ) {
#define portYIELD() *portITU_SWINTR = 0x01; nop(); nop(); nop(); nop(); nop() /* Save clobbered register - may not actually be necessary if inline asm
functions are considered to use the same rules as function calls by the
compiler. */
PUSH.L R5
/* Set ITU SWINTR. */
MOV.L #553696, R5
MOV.B #1, [R5]
/* Read back to ensure the value is taken before proceeding. */
MOV.L [R5], R5
/* Restore clobbered register to its previous value. */
POP R5
}
#define portYIELD() vPortYield()
#define portYIELD_FROM_ISR( x ) if( x != pdFALSE ) portYIELD() #define portYIELD_FROM_ISR( x ) if( x != pdFALSE ) portYIELD()
/* /*
@ -137,12 +149,12 @@ vector 27. */
/* The critical nesting functions defined within tasks.c. */ /* The critical nesting functions defined within tasks.c. */
extern void vTaskEnterCritical( void ); extern void vTaskEnterCritical( void );
extern void vTaskExitCritical( void ); extern void vTaskExitCritical( void );
#define portENTER_CRITICAL() vTaskEnterCritical(); #define portENTER_CRITICAL() vTaskEnterCritical()
#define portEXIT_CRITICAL() vTaskExitCritical(); #define portEXIT_CRITICAL() vTaskExitCritical()
/* As this port allows interrupt nesting... */ /* As this port allows interrupt nesting... */
#define portSET_INTERRUPT_MASK_FROM_ISR() get_ipl(); set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY ) #define portSET_INTERRUPT_MASK_FROM_ISR() get_ipl(); set_ipl( ( long ) configMAX_SYSCALL_INTERRUPT_PRIORITY )
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) set_ipl( uxSavedInterruptStatus ) #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) set_ipl( ( long ) uxSavedInterruptStatus )
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -150,6 +162,9 @@ extern void vTaskExitCritical( void );
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters ) #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
/* This macro is not appropriate for this port so is defined away. */
#define portALIGNMENT_ASSERT_pxCurrentTCB( x )
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif