[Qemu-devel] [PATCH] atomic: update documentation

Paolo Bonzini posted 1 patch 8 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170921162746.11761-1-pbonzini@redhat.com
Test checkpatch passed
Test docker passed
Test s390x passed
docs/devel/atomics.txt | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
[Qemu-devel] [PATCH] atomic: update documentation
Posted by Paolo Bonzini 8 years, 1 month ago
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/devel/atomics.txt | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/docs/devel/atomics.txt b/docs/devel/atomics.txt
index 3ef5d85b1b..048e5f23cb 100644
--- a/docs/devel/atomics.txt
+++ b/docs/devel/atomics.txt
@@ -63,11 +63,22 @@ operations:
     typeof(*ptr) atomic_fetch_sub(ptr, val)
     typeof(*ptr) atomic_fetch_and(ptr, val)
     typeof(*ptr) atomic_fetch_or(ptr, val)
+    typeof(*ptr) atomic_fetch_xor(ptr, val)
     typeof(*ptr) atomic_xchg(ptr, val)
     typeof(*ptr) atomic_cmpxchg(ptr, old, new)
 
 all of which return the old value of *ptr.  These operations are
-polymorphic; they operate on any type that is as wide as an int.
+polymorphic; they operate on any type that is as wide as a pointer.
+
+Similar operations return the new value of *ptr:
+
+    typeof(*ptr) atomic_inc_fetch(ptr)
+    typeof(*ptr) atomic_dec_fetch(ptr)
+    typeof(*ptr) atomic_add_fetch(ptr, val)
+    typeof(*ptr) atomic_sub_fetch(ptr, val)
+    typeof(*ptr) atomic_and_fetch(ptr, val)
+    typeof(*ptr) atomic_or_fetch(ptr, val)
+    typeof(*ptr) atomic_xor_fetch(ptr, val)
 
 Sequentially consistent loads and stores can be done using:
 
-- 
2.13.5


Re: [Qemu-devel] [PATCH] atomic: update documentation
Posted by Alex Bennée 8 years, 1 month ago
Paolo Bonzini <pbonzini@redhat.com> writes:

> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  docs/devel/atomics.txt | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/docs/devel/atomics.txt b/docs/devel/atomics.txt
> index 3ef5d85b1b..048e5f23cb 100644
> --- a/docs/devel/atomics.txt
> +++ b/docs/devel/atomics.txt
> @@ -63,11 +63,22 @@ operations:
>      typeof(*ptr) atomic_fetch_sub(ptr, val)
>      typeof(*ptr) atomic_fetch_and(ptr, val)
>      typeof(*ptr) atomic_fetch_or(ptr, val)
> +    typeof(*ptr) atomic_fetch_xor(ptr, val)
>      typeof(*ptr) atomic_xchg(ptr, val)
>      typeof(*ptr) atomic_cmpxchg(ptr, old, new)
>
>  all of which return the old value of *ptr.  These operations are
> -polymorphic; they operate on any type that is as wide as an int.
> +polymorphic; they operate on any type that is as wide as a pointer.
> +
> +Similar operations return the new value of *ptr:
> +
> +    typeof(*ptr) atomic_inc_fetch(ptr)
> +    typeof(*ptr) atomic_dec_fetch(ptr)
> +    typeof(*ptr) atomic_add_fetch(ptr, val)
> +    typeof(*ptr) atomic_sub_fetch(ptr, val)
> +    typeof(*ptr) atomic_and_fetch(ptr, val)
> +    typeof(*ptr) atomic_or_fetch(ptr, val)
> +    typeof(*ptr) atomic_xor_fetch(ptr, val)
>
>  Sequentially consistent loads and stores can be done using:


--
Alex Bennée