From 656dde9f60282c1ce693051c722a8ba9d432094d Mon Sep 17 00:00:00 2001 From: lazymio Date: Sat, 16 Apr 2022 23:37:52 +0200 Subject: [PATCH] Fix MSVC build --- qemu/include/qemu/atomic.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/qemu/include/qemu/atomic.h b/qemu/include/qemu/atomic.h index fe709cef..3eb72dbe 100644 --- a/qemu/include/qemu/atomic.h +++ b/qemu/include/qemu/atomic.h @@ -199,13 +199,12 @@ /* These will only be atomic if the processor does the fetch or store * in a single issue memory operation */ -#define atomic_read__nocheck(p) (*(__typeof__(*(p)) volatile*) (p)) -#define atomic_set__nocheck(p, i) ((*(__typeof__(*(p)) volatile*) (p)) = (i)) -#define atomic_read(ptr) atomic_read__nocheck(ptr) -#define atomic_set(ptr, i) atomic_set__nocheck(ptr,i) +#define atomic_read(ptr) *(ptr) +#define atomic_set(ptr, i) *(ptr) = (i) /** + * * atomic_rcu_read - reads a RCU-protected pointer to a local variable * into a RCU read-side critical section. The pointer can later be safely * dereferenced within the critical section. @@ -224,9 +223,7 @@ * Should match atomic_rcu_set(), atomic_xchg(), atomic_cmpxchg(). */ #define atomic_rcu_read(ptr) ({ \ - typeof(*ptr) _val = atomic_read(ptr); \ - smp_read_barrier_depends(); \ - _val; \ + atomic_read(ptr); \ }) /** @@ -241,7 +238,6 @@ * Should match atomic_rcu_read(). */ #define atomic_rcu_set(ptr, i) do { \ - smp_wmb(); \ atomic_set(ptr, i); \ } while (0)