From: richardbarry Date: Fri, 13 Aug 2010 17:49:15 +0000 (+0000) Subject: Continue work on RX600 port - work in progress. Added the SET/CLEAR from ISR macros. X-Git-Tag: V6.1.0~90 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4648cf7bfc24495673a90a785d183674879b67c7;p=freertos Continue work on RX600 port - work in progress. Added the SET/CLEAR from ISR macros. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1045 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Source/portable/Renesas/RX600/port.c b/Source/portable/Renesas/RX600/port.c index e41221f61..8e3cc871d 100644 --- a/Source/portable/Renesas/RX600/port.c +++ b/Source/portable/Renesas/RX600/port.c @@ -96,8 +96,6 @@ static void prvStartFirstTask( void ); extern void *pxCurrentTCB; -unsigned char ucIPLToRestore = 0; - /*-----------------------------------------------------------*/ /* @@ -200,29 +198,6 @@ void vTickISR( void ) } /*-----------------------------------------------------------*/ -void vPortSetInterruptMask( void ) -{ -unsigned char ucPreviousIPL; - - /* Store the current IPL to ensure it is restored correctly later if it is - not currently 0. This is a stack variable, so there should not be a race - condition even if there is an interrupt or context switch before the new - IPL value gets set. */ - ucPreviousIPL = get_ipl(); - - /* Set the mask up to the max syscall priority. */ - set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY ); - - /* Now the mask is set there will not be a context switch, so the previous - and current IPL values can be compared. This ensures against the IPL being - set back to zero too early when critical sections nest. */ - if( ucPreviousIPL < configMAX_SYSCALL_INTERRUPT_PRIORITY ) - { - ucIPLToRestore = ucPreviousIPL; - } -} -/*-----------------------------------------------------------*/ - #pragma inline_asm prvStartFirstTask static void prvStartFirstTask( void ) { diff --git a/Source/portable/Renesas/RX600/portmacro.h b/Source/portable/Renesas/RX600/portmacro.h index 3cc3b6d26..612219ac2 100644 --- a/Source/portable/Renesas/RX600/portmacro.h +++ b/Source/portable/Renesas/RX600/portmacro.h @@ -109,9 +109,11 @@ extern void vTaskSwitchContext( void ); * These macros should be called directly, but through the taskENTER_CRITICAL() * and taskEXIT_CRITICAL() macros. */ -extern unsigned char ucIPLToRestore; -#define portENABLE_INTERRUPTS() set_ipl( ucIPLToRestore ) -#define portDISABLE_INTERRUPTS() vPortSetInterruptMask() +#define portENABLE_INTERRUPTS() set_ipl( 0 ) +#define portDISABLE_INTERRUPTS() set_ipl( configKERNEL_INTERRUPT_PRIORITY ) + +#define portSET_INTERRUPT_MASK_FROM_ISR() get_ipl(); set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY ) +#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) set_ipl( uxSavedInterruptStatus ) /* Critical nesting counts are stored in the TCB. */ #define portCRITICAL_NESTING_IN_TCB ( 1 )