atomic: update documentation
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 21 Sep 2017 12:44:08 +0000 (14:44 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 21 Sep 2017 12:47:42 +0000 (14:47 +0200)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
docs/devel/atomics.txt

index 3ef5d85b1be2100bcc8c7d5af2e0bf8b236d018e..048e5f23cbdecad4450ded819534b7580cf1a010 100644 (file)
@@ -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: