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

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.comSigned-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent b9ca93bc
...@@ -16,6 +16,16 @@ ...@@ -16,6 +16,16 @@
# define mb() abort() # define mb() abort()
# define dma_rmb() abort() # define dma_rmb() abort()
# define dma_wmb() 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 #else
#error Please fill in barrier macros #error Please fill in barrier macros
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment