From 03007c2b424bb36bac963b22a6c2b0ceeb723832 Mon Sep 17 00:00:00 2001 From: Wolfvak Date: Sat, 15 Aug 2020 20:30:27 -0300 Subject: [PATCH] fix shared memory optimization problem --- common/shmem.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/shmem.h b/common/shmem.h index e377e2f..0370a5c 100755 --- a/common/shmem.h +++ b/common/shmem.h @@ -40,6 +40,10 @@ extern SystemSHMEM *shmemGlobalBase; static inline SystemSHMEM *ARM_GetSHMEM(void) { + // shared memory contents are extremely likely to change + // insert a compiler barrier to force the compiler not to assume + // memory values will remain constant in between calls to getSHMEM + asm_v("":::"memory", "cc"); return shmemGlobalBase; }