Fix compiler_memory_barrier
Especially on armhf, clobbering "cc" does matter for preventing the
compiler from holding information derived from information in memory
across the barrier.
Change-Id: I468c5a3596af237f1424ba72cb0262cf7cdf5553
diff --git a/aos/util/compiler_memory_barrier.h b/aos/util/compiler_memory_barrier.h
index 33da511..6be3c59 100644
--- a/aos/util/compiler_memory_barrier.h
+++ b/aos/util/compiler_memory_barrier.h
@@ -5,7 +5,7 @@
// 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");
+ __asm__ __volatile__("" ::: "memory", "cc");
}
#endif // AOS_UTIL_COMPILER_MEMORY_BARRIER_H_