Commit 1a5514cb authored by Peng Fan's avatar Peng Fan Committed by Michael S. Tsirkin
Browse files

tools/virtio: add barrier for aarch64



Add barrier for aarch64 for cross compiling, and  most are from Linux Kernel.

Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20201209084205.24062-4-peng.fan@oss.nxp.com


Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent b9ca93bc
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -16,6 +16,16 @@
# define mb() abort()
# define dma_rmb() abort()
# define dma_wmb() abort()
#elif defined(__aarch64__)
#define dmb(opt) asm volatile("dmb " #opt : : : "memory")
#define virt_mb() __sync_synchronize()
#define virt_rmb() dmb(ishld)
#define virt_wmb() dmb(ishst)
#define virt_store_mb(var, value)  do { WRITE_ONCE(var, value); dmb(ish); } while (0)
/* Weak barriers should be used. If not - it's a bug */
# define mb() abort()
# define dma_rmb() abort()
# define dma_wmb() abort()
#else
#error Please fill in barrier macros
#endif