From 27ca5c83418edc58ef392994f8ae5dc96210c082 Mon Sep 17 00:00:00 2001 From: Richard Barry Date: Thu, 25 Apr 2019 19:49:50 +0000 Subject: [PATCH] Added portMEMORY_BARRIER() implemented as __asm volatile( "" ::: "memory" ) into ARM Cortex-M33 ports to assist with link time optimisation. --- FreeRTOS/Source/portable/ARMv8M/non_secure/portmacro.h | 2 ++ FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/portmacro.h | 2 ++ .../Source/portable/GCC/ARM_CM33_NTZ/non_secure/portmacro.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/FreeRTOS/Source/portable/ARMv8M/non_secure/portmacro.h b/FreeRTOS/Source/portable/ARMv8M/non_secure/portmacro.h index 4dede1716..3ab4ff700 100644 --- a/FreeRTOS/Source/portable/ARMv8M/non_secure/portmacro.h +++ b/FreeRTOS/Source/portable/ARMv8M/non_secure/portmacro.h @@ -289,6 +289,8 @@ typedef struct MPU_SETTINGS #endif /* configENABLE_MPU */ /*-----------------------------------------------------------*/ +#define portMEMORY_BARRIER() __asm volatile( "" ::: "memory" ) + #ifdef __cplusplus } #endif diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/portmacro.h b/FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/portmacro.h index 4dede1716..3ab4ff700 100644 --- a/FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/portmacro.h +++ b/FreeRTOS/Source/portable/GCC/ARM_CM33/non_secure/portmacro.h @@ -289,6 +289,8 @@ typedef struct MPU_SETTINGS #endif /* configENABLE_MPU */ /*-----------------------------------------------------------*/ +#define portMEMORY_BARRIER() __asm volatile( "" ::: "memory" ) + #ifdef __cplusplus } #endif diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM33_NTZ/non_secure/portmacro.h b/FreeRTOS/Source/portable/GCC/ARM_CM33_NTZ/non_secure/portmacro.h index 4dede1716..3ab4ff700 100644 --- a/FreeRTOS/Source/portable/GCC/ARM_CM33_NTZ/non_secure/portmacro.h +++ b/FreeRTOS/Source/portable/GCC/ARM_CM33_NTZ/non_secure/portmacro.h @@ -289,6 +289,8 @@ typedef struct MPU_SETTINGS #endif /* configENABLE_MPU */ /*-----------------------------------------------------------*/ +#define portMEMORY_BARRIER() __asm volatile( "" ::: "memory" ) + #ifdef __cplusplus } #endif