1
2 #if defined(__i386__) || defined(__x86_64__)
3 #define barrier() asm volatile("" ::: "memory")
4 #define virt_mb() __sync_synchronize()
5 #define virt_rmb() barrier()
6 #define virt_wmb() barrier()
7
8 #define virt_store_mb(var, value) do { \
9 typeof(var) virt_store_mb_value = (value); \
10 __atomic_exchange(&(var), &virt_store_mb_value, &virt_store_mb_value, \
11 __ATOMIC_SEQ_CST); \
12 barrier(); \
13 } while (0);
14
15 # define mb() abort()
16 # define dma_rmb() abort()
17 # define dma_wmb() abort()
18 #else
19 #error Please fill in barrier macros
20 #endif
21