提交 2cbcfb28 编写于 作者: P Paolo Bonzini

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: NPaolo Bonzini <pbonzini@redhat.com>
上级 c95f3901
...@@ -122,11 +122,11 @@ ...@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册