From: richardbarry Date: Sun, 7 Apr 2013 19:43:52 +0000 (+0000) Subject: Add barrier instructions to GCC CM3/4 code. X-Git-Tag: V7.4.1~22 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c6a9a6c604393f1f624a5468f5a9bbae59e680d7;p=freertos Add barrier instructions to GCC CM3/4 code. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1853 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c b/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c index 4d43873ef..f4090d74a 100644 --- a/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c +++ b/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c @@ -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. */ @@ -259,6 +259,11 @@ void vPortYieldFromISR( void ) { /* Set a PendSV to request a context switch. */ portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; + + /* Barriers are normally not required but do ensure the code is completely + within the specified behaviour for the architecture. */ + __asm volatile( "dsb" ); + __asm volatile( "isb" ); } /*-----------------------------------------------------------*/ @@ -266,6 +271,8 @@ void vPortEnterCritical( void ) { portDISABLE_INTERRUPTS(); uxCriticalNesting++; + __asm volatile( "dsb" ); + __asm volatile( "isb" ); } /*-----------------------------------------------------------*/ @@ -438,6 +445,8 @@ void xPortSysTickHandler( void ) if( xModifiableIdleTime > 0 ) { __asm volatile( "wfi" ); + __asm volatile( "dsb" ); + __asm volatile( "isb" ); } configPOST_SLEEP_PROCESSING( xExpectedIdleTime );