From c414dc219ed78641887874c97992589a0366bd79 Mon Sep 17 00:00:00 2001 From: Shubham Kulkarni Date: Thu, 16 Sep 2021 14:29:22 +0530 Subject: [PATCH] Xtensa_ESP32: Add definition for portMEMORY_BARRIER 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 32a7959af8..080e7c6f9d 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* */