tools/include: Update atomic definitions
authorKarolina Drobnik <karolinadrobnik@gmail.com>
Wed, 2 Feb 2022 11:03:03 +0000 (12:03 +0100)
committerMike Rapoport <rppt@linux.ibm.com>
Sun, 20 Feb 2022 06:44:37 +0000 (08:44 +0200)
Add atomic_long_set function to atomic.h and atomic_long_t type to
types.h so they can be used in testing.

Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
Signed-off-by: Mike Rapoport <rppt@kernel.org>
Link: https://lore.kernel.org/r/082fde69debc36bfc56cdb413d847dcd6b1e36dd.1643796665.git.karolinadrobnik@gmail.com
tools/include/linux/atomic.h
tools/include/linux/types.h

index 00a6c4ca562b93d44bc98cc292a5b0c88ca0c981..01907b33537e04c5e860dd2cd61a61dfab6ea8f1 100644 (file)
@@ -4,6 +4,8 @@
 
 #include <asm/atomic.h>
 
+void atomic_long_set(atomic_long_t *v, long i);
+
 /* atomic_cmpxchg_relaxed */
 #ifndef atomic_cmpxchg_relaxed
 #define  atomic_cmpxchg_relaxed                atomic_cmpxchg
index 35cedaf191e8a6fadbcd356e2ea6dd2c7ccaaba5..5908e58c35981fb13b870d5fe798a097ffb44cbd 100644 (file)
@@ -74,6 +74,10 @@ typedef struct {
        int counter;
 } atomic_t;
 
+typedef struct {
+       long counter;
+} atomic_long_t;
+
 #ifndef __aligned_u64
 # define __aligned_u64 __u64 __attribute__((aligned(8)))
 #endif