|
|
9bac43 |
From be36671765f098deb41e032b40253967cbd50452 Mon Sep 17 00:00:00 2001
|
|
|
9bac43 |
From: David Gibson <dgibson@redhat.com>
|
|
|
9bac43 |
Date: Thu, 16 Nov 2017 03:07:12 +0100
|
|
|
9bac43 |
Subject: [PATCH 08/30] atomic: update documentation
|
|
|
9bac43 |
|
|
|
9bac43 |
RH-Author: David Gibson <dgibson@redhat.com>
|
|
|
9bac43 |
Message-id: <20171116030732.8560-3-dgibson@redhat.com>
|
|
|
9bac43 |
Patchwork-id: 77692
|
|
|
9bac43 |
O-Subject: [PATCH 02/22] atomic: update documentation
|
|
|
9bac43 |
Bugzilla: 1481593
|
|
|
9bac43 |
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
|
|
9bac43 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9bac43 |
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
|
|
|
9bac43 |
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
|
|
|
9bac43 |
|
|
|
9bac43 |
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9bac43 |
|
|
|
9bac43 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9bac43 |
(cherry picked from commit db81b9953761cac71906728fb3dfefce661ab903)
|
|
|
9bac43 |
|
|
|
9bac43 |
Signed-off-by: David Gibson <dgibson@redhat.com>
|
|
|
9bac43 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9bac43 |
---
|
|
|
9bac43 |
docs/devel/atomics.txt | 13 ++++++++++++-
|
|
|
9bac43 |
1 file changed, 12 insertions(+), 1 deletion(-)
|
|
|
9bac43 |
|
|
|
9bac43 |
diff --git a/docs/devel/atomics.txt b/docs/devel/atomics.txt
|
|
|
9bac43 |
index 3ef5d85..048e5f2 100644
|
|
|
9bac43 |
--- a/docs/devel/atomics.txt
|
|
|
9bac43 |
+++ b/docs/devel/atomics.txt
|
|
|
9bac43 |
@@ -63,11 +63,22 @@ operations:
|
|
|
9bac43 |
typeof(*ptr) atomic_fetch_sub(ptr, val)
|
|
|
9bac43 |
typeof(*ptr) atomic_fetch_and(ptr, val)
|
|
|
9bac43 |
typeof(*ptr) atomic_fetch_or(ptr, val)
|
|
|
9bac43 |
+ typeof(*ptr) atomic_fetch_xor(ptr, val)
|
|
|
9bac43 |
typeof(*ptr) atomic_xchg(ptr, val)
|
|
|
9bac43 |
typeof(*ptr) atomic_cmpxchg(ptr, old, new)
|
|
|
9bac43 |
|
|
|
9bac43 |
all of which return the old value of *ptr. These operations are
|
|
|
9bac43 |
-polymorphic; they operate on any type that is as wide as an int.
|
|
|
9bac43 |
+polymorphic; they operate on any type that is as wide as a pointer.
|
|
|
9bac43 |
+
|
|
|
9bac43 |
+Similar operations return the new value of *ptr:
|
|
|
9bac43 |
+
|
|
|
9bac43 |
+ typeof(*ptr) atomic_inc_fetch(ptr)
|
|
|
9bac43 |
+ typeof(*ptr) atomic_dec_fetch(ptr)
|
|
|
9bac43 |
+ typeof(*ptr) atomic_add_fetch(ptr, val)
|
|
|
9bac43 |
+ typeof(*ptr) atomic_sub_fetch(ptr, val)
|
|
|
9bac43 |
+ typeof(*ptr) atomic_and_fetch(ptr, val)
|
|
|
9bac43 |
+ typeof(*ptr) atomic_or_fetch(ptr, val)
|
|
|
9bac43 |
+ typeof(*ptr) atomic_xor_fetch(ptr, val)
|
|
|
9bac43 |
|
|
|
9bac43 |
Sequentially consistent loads and stores can be done using:
|
|
|
9bac43 |
|
|
|
9bac43 |
--
|
|
|
9bac43 |
1.8.3.1
|
|
|
9bac43 |
|