diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2016-01-20 14:12:58 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-01-26 03:18:29 -0500 |
commit | a7c490333df3cff5086ddf19a0837529304fa097 (patch) | |
tree | 4ea3f4646f10a41d6fe06de3b77eb3a1b6d6a229 /tools/virtio/linux/compiler.h | |
parent | 2989be09a8a9d62a785137586ad941f916e08f83 (diff) |
tools/virtio: use virt_xxx barriers
Fix build after API changes.
Reported-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tools/virtio/linux/compiler.h')
-rw-r--r-- | tools/virtio/linux/compiler.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/virtio/linux/compiler.h b/tools/virtio/linux/compiler.h new file mode 100644 index 000000000000..845960e1cbf2 --- /dev/null +++ b/tools/virtio/linux/compiler.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef LINUX_COMPILER_H | ||
2 | #define LINUX_COMPILER_H | ||
3 | |||
4 | #define WRITE_ONCE(var, val) \ | ||
5 | (*((volatile typeof(val) *)(&(var))) = (val)) | ||
6 | |||
7 | #define READ_ONCE(var) (*((volatile typeof(val) *)(&(var)))) | ||
8 | |||
9 | #endif | ||