atomic: fix position of volatile qualifier
What needs to be volatile is not the pointer, but the pointed-to value! Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
c95f3901b4
commit
2cbcfb281a
|
@ -122,11 +122,11 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef atomic_read
|
#ifndef atomic_read
|
||||||
#define atomic_read(ptr) (*(__typeof__(*ptr) *volatile) (ptr))
|
#define atomic_read(ptr) (*(__typeof__(*ptr) volatile*) (ptr))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef atomic_set
|
#ifndef atomic_set
|
||||||
#define atomic_set(ptr, i) ((*(__typeof__(*ptr) *volatile) (ptr)) = (i))
|
#define atomic_set(ptr, i) ((*(__typeof__(*ptr) volatile*) (ptr)) = (i))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* These have the same semantics as Java volatile variables.
|
/* These have the same semantics as Java volatile variables.
|
||||||
|
|
Loading…
Reference in a new issue