Skip to contentSkip to conversation

atomic: update documentation

PATCH In review Paolo Bonzini 2 participants 2 messages Sep 21, 2017 – Sep 22, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atomic: update documentation

---
 docs/devel/atomics.txt | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
docs/devel/atomics.txt +12 -1
index 3ef5d85b1b..048e5f23cb 100644
@@ -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:
 
Signature · 1 line
2.13.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Paolo Bonzini
Quoted 21 lines
---
 docs/devel/atomics.txt | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
docs/devel/atomics.txt +4 -1
index 3ef5d85b1b..048e5f23cb 100644
@@ -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:

docs/devel/atomics.txt operations: · line 83

Quoted 10 lines
docs/devel/atomics.txt +8 -0
+
+    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