projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b9ca93b
)
tools/virtio: add barrier for aarch64
author
Peng Fan
<peng.fan@nxp.com>
Wed, 9 Dec 2020 08:42:05 +0000
(16:42 +0800)
committer
Michael S. Tsirkin
<mst@redhat.com>
Fri, 18 Dec 2020 21:14:30 +0000
(16:14 -0500)
Add barrier for aarch64 for cross compiling, and most are from Linux Kernel.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link:
https://lore.kernel.org/r/20201209084205.24062-4-peng.fan@oss.nxp.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
tools/virtio/asm/barrier.h
patch
|
blob
|
history
diff --git
a/tools/virtio/asm/barrier.h
b/tools/virtio/asm/barrier.h
index
04d563f
..
468435e
100644
(file)
--- a/
tools/virtio/asm/barrier.h
+++ b/
tools/virtio/asm/barrier.h
@@
-16,6
+16,16
@@
# define mb() abort()
# define dma_rmb() abort()
# define dma_wmb() abort()
# 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
#else
#error Please fill in barrier macros
#endif