Hello, I think what you want are intrinsics similar to the following macroes right?
#define PUBLISH_WRITES_TO_VAR(X) __asm__ __volatile__("":: "m"((X)))
#define OBSERVE_WRITES_TO_VAR(X) __asm__ __volatile__("": "=m"((X)))
Thank you,
Steven Stewart-Gallus