[CRIU] [PATCH 2/2] arm, aarm64: Add atomic_dec_return()

Kirill Tkhai ktkhai at virtuozzo.com
Tue Nov 1 09:35:23 PDT 2016


Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 include/common/arch/aarch64/asm/atomic.h |    1 +
 include/common/arch/arm/asm/atomic.h     |    1 +
 2 files changed, 2 insertions(+)

diff --git a/include/common/arch/aarch64/asm/atomic.h b/include/common/arch/aarch64/asm/atomic.h
index 0e1c04f..11785c3 100644
--- a/include/common/arch/aarch64/asm/atomic.h
+++ b/include/common/arch/aarch64/asm/atomic.h
@@ -70,6 +70,7 @@ static inline int atomic_dec(atomic_t *v) { return atomic_sub_return(1, v) + 1;
 
 /* true if the result is 0, or false for all other cases. */
 #define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0)
+#define atomic_dec_return(v)  (atomic_sub_return(1, v))
 
 #define atomic_inc_return(v)	(atomic_add_return(1, v))
 
diff --git a/include/common/arch/arm/asm/atomic.h b/include/common/arch/arm/asm/atomic.h
index 95a8b70..96100eb 100644
--- a/include/common/arch/arm/asm/atomic.h
+++ b/include/common/arch/arm/asm/atomic.h
@@ -125,6 +125,7 @@ static inline int atomic_dec(atomic_t *v) { return atomic_sub_return(1, v) + 1;
 
 /* true if the result is 0, or false for all other cases. */
 #define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0)
+#define atomic_dec_return(v)  (atomic_sub_return(1, v))
 
 #define atomic_inc_return(v)	(atomic_add_return(1, v))
 



More information about the CRIU mailing list