blob: 33da511a385a890f23c9b7c077151d0926ff8591 [file] [log] [blame]
#ifndef AOS_UTIL_COMPILER_MEMORY_BARRIER_H_
#define AOS_UTIL_COMPILER_MEMORY_BARRIER_H_
// Prevents the compiler from reordering memory operations around this.
// Using this function makes it clearer what you're doing and easier to be
// portable.
static inline void aos_compiler_memory_barrier(void) {
__asm__ __volatile__("" ::: "memory");
}
#endif // AOS_UTIL_COMPILER_MEMORY_BARRIER_H_