blob: ef00f6722ba9a7cffd9c7e15ce27061bde8b5055 [file] [log] [blame]
Jens Axboe21b4aa52019-03-06 09:03:50 -07001#ifndef LIBURING_BARRIER_H
2#define LIBURING_BARRIER_H
3
4#if defined(__x86_64) || defined(__i386__)
5#define read_barrier() __asm__ __volatile__("":::"memory")
6#define write_barrier() __asm__ __volatile__("":::"memory")
7#else
8/*
9 * Add arch appropriate definitions. Be safe and use full barriers for
10 * archs we don't have support for.
11 */
12#define read_barrier() __sync_synchronize()
13#define write_barrier() __sync_synchronize()
14#endif
15
16#endif