From 4d5c882b5732adb5b4e5cfa3d0d1783d9555d539 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Tue, 6 Oct 2009 08:48:34 +0000 Subject: [PATCH] Add clobber lists to inline asm code. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@911 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Source/portable/GCC/ARM_CM3_MPU/port.c | 8 +++++--- Source/portable/GCC/ARM_CM3_MPU/portmacro.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/portable/GCC/ARM_CM3_MPU/port.c b/Source/portable/GCC/ARM_CM3_MPU/port.c index 155eb2708..f689728ce 100644 --- a/Source/portable/GCC/ARM_CM3_MPU/port.c +++ b/Source/portable/GCC/ARM_CM3_MPU/port.c @@ -81,8 +81,8 @@ task.h is included from an application file. */ #define portPRIVILEGED_EXECUTION_START_ADDRESS ( 0UL ) #define portMPU_REGION_VALID ( 0x10UL ) #define portMPU_REGION_ENABLE ( 0x01UL ) -#define portPERIPHERALS_START_ADDRESS 0x40000000UL -#define portPERIPHERALS_END_ADDRESS 0x5FFFFFFFUL +#define portPERIPHERALS_START_ADDRESS 0x40000000UL +#define portPERIPHERALS_END_ADDRESS 0x5FFFFFFFUL /* Constants required to access and manipulate the SysTick. */ #define portNVIC_SYSTICK_CLK ( 0x00000004UL ) @@ -149,7 +149,7 @@ static void prvRestoreContextOfFirstTask( void ) __attribute__(( naked )) PRIVIL * C portion of the SVC handler. The SVC handler is split between an asm entry * and a C wrapper for simplicity of coding and maintenance. */ -static void prvSVCHandler( unsigned long *pulRegisters ) __attribute__ ((optimize("3"))) PRIVILEGED_FUNCTION; +static void prvSVCHandler( unsigned long *pulRegisters ) __attribute__(( noinline )) PRIVILEGED_FUNCTION; /*-----------------------------------------------------------*/ @@ -196,6 +196,7 @@ void vPortSVCHandler( void ) " mrs r0, psp \n" #endif " b prvSVCHandler \n" + :::"r0" ); /* This will never get executed, but is required to prevent prvSVCHandler @@ -225,6 +226,7 @@ unsigned char ucSVCNumber; " mrs r1, control \n" /* Obtain current control value. */ " bic r1, #1 \n" /* Set privilege bit. */ " msr control, r1 \n" /* Write back new control value. */ + :::"r1" ); break; diff --git a/Source/portable/GCC/ARM_CM3_MPU/portmacro.h b/Source/portable/GCC/ARM_CM3_MPU/portmacro.h index 02c1adbd3..8aa2a5fe2 100644 --- a/Source/portable/GCC/ARM_CM3_MPU/portmacro.h +++ b/Source/portable/GCC/ARM_CM3_MPU/portmacro.h @@ -103,7 +103,7 @@ extern "C" { #define portNUM_CONFIGURABLE_REGIONS ( ( portLAST_CONFIGURABLE_REGION - portFIRST_CONFIGURABLE_REGION ) + 1 ) #define portTOTAL_NUM_REGIONS ( portNUM_CONFIGURABLE_REGIONS + 1 ) /* Plus one to make space for the stack region. */ -#define portSWITCH_TO_USER_MODE() __asm volatile ( " mrs r0, control \n orr r0, #1 \n msr control, r0 " ) +#define portSWITCH_TO_USER_MODE() __asm volatile ( " mrs r0, control \n orr r0, #1 \n msr control, r0 " :::"r0" ) typedef struct MPU_REGION_REGISTERS { -- 2.39.5