From 741185f1d06852555898cb4b38b908e14ea875a8 Mon Sep 17 00:00:00 2001 From: Shubham Kulkarni <57181281+shubhamkulkarni97@users.noreply.github.com> Date: Fri, 17 Sep 2021 02:46:22 +0530 Subject: [PATCH] Xtensa_ESP32: Add definition for portMEMORY_BARRIER (#395) This fixes crash observed in Amazon FreeRTOS when optimisations are enabled --- portable/ThirdParty/GCC/Xtensa_ESP32/include/portmacro.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/portable/ThirdParty/GCC/Xtensa_ESP32/include/portmacro.h b/portable/ThirdParty/GCC/Xtensa_ESP32/include/portmacro.h index 32a7959af..080e7c6f9 100644 --- a/portable/ThirdParty/GCC/Xtensa_ESP32/include/portmacro.h +++ b/portable/ThirdParty/GCC/Xtensa_ESP32/include/portmacro.h @@ -554,6 +554,10 @@ #define configASSERT( x ) if( !( x ) ) { porttracePrint( -1 ); printf( "\nAssertion failed in %s:%d\n", __FILE__, __LINE__ ); exit( -1 ); } #endif +/* Barriers */ + #define portMEMORY_BARRIER() __asm volatile ( "" ::: "memory" ) + + #endif // __ASSEMBLER__ /* *INDENT-OFF* */