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
|
||||
|
||||
#ifndef atomic_read
|
||||
#define atomic_read(ptr) (*(__typeof__(*ptr) *volatile) (ptr))
|
||||
#define atomic_read(ptr) (*(__typeof__(*ptr) volatile*) (ptr))
|
||||
#endif
|
||||
|
||||
#ifndef atomic_set
|
||||
#define atomic_set(ptr, i) ((*(__typeof__(*ptr) *volatile) (ptr)) = (i))
|
||||
#define atomic_set(ptr, i) ((*(__typeof__(*ptr) volatile*) (ptr)) = (i))
|
||||
#endif
|
||||
|
||||
/* These have the same semantics as Java volatile variables.
|
||||
|
Loading…
Reference in New Issue
Block a user