diff options
Diffstat (limited to 'tools/virtio/linux/compiler.h')
-rw-r--r-- | tools/virtio/linux/compiler.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/virtio/linux/compiler.h b/tools/virtio/linux/compiler.h new file mode 100644 index 000000000..2c51bccb9 --- /dev/null +++ b/tools/virtio/linux/compiler.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef LINUX_COMPILER_H +#define LINUX_COMPILER_H + +#define WRITE_ONCE(var, val) \ + (*((volatile typeof(val) *)(&(var))) = (val)) + +#define READ_ONCE(var) (*((volatile typeof(var) *)(&(var)))) + +#define __aligned(x) __attribute((__aligned__(x))) +#endif |