diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-01-16 09:04:02 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-01-16 09:04:02 -0700 |
commit | 61102796612a867d85ee4b3c5a660e1f4b1c2766 (patch) | |
tree | 2fc38a5f1ca7303e7e48972b2758ee95e19a45bb /src | |
parent | b93edf5b9eb6f392d40585e26df1663fccc0c09d (diff) |
Update barriers for x86/x86-64
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'src')
-rw-r--r-- | src/barrier.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/barrier.h b/src/barrier.h index 2076c1c..ef00f67 100644 --- a/src/barrier.h +++ b/src/barrier.h @@ -1,12 +1,9 @@ #ifndef LIBURING_BARRIER_H #define LIBURING_BARRIER_H -#if defined(__x86_64) -#define read_barrier() __asm__ __volatile__("lfence":::"memory") -#define write_barrier() __asm__ __volatile__("sfence":::"memory") -#elif defined(__i386__) -#define read_barrier() __asm__ __volatile__("": : :"memory") -#define write_barrier() __asm__ __volatile__("": : :"memory") +#if defined(__x86_64) || defined(__i386__) +#define read_barrier() __asm__ __volatile__("":::"memory") +#define write_barrier() __asm__ __volatile__("":::"memory") #else /* * Add arch appropriate definitions. Be safe and use full barriers for |