diff options
Diffstat (limited to 'include/asm-sparc/atomic.h')
-rw-r--r-- | include/asm-sparc/atomic.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/asm-sparc/atomic.h b/include/asm-sparc/atomic.h index 52bdd1a895fa..62bec7ad271c 100644 --- a/include/asm-sparc/atomic.h +++ b/include/asm-sparc/atomic.h | |||
@@ -20,6 +20,7 @@ typedef struct { volatile int counter; } atomic_t; | |||
20 | 20 | ||
21 | extern int __atomic_add_return(int, atomic_t *); | 21 | extern int __atomic_add_return(int, atomic_t *); |
22 | extern int atomic_cmpxchg(atomic_t *, int, int); | 22 | extern int atomic_cmpxchg(atomic_t *, int, int); |
23 | extern int atomic_add_unless(atomic_t *, int, int); | ||
23 | extern void atomic_set(atomic_t *, int); | 24 | extern void atomic_set(atomic_t *, int); |
24 | 25 | ||
25 | #define atomic_read(v) ((v)->counter) | 26 | #define atomic_read(v) ((v)->counter) |
@@ -49,6 +50,8 @@ extern void atomic_set(atomic_t *, int); | |||
49 | #define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) | 50 | #define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) |
50 | #define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0) | 51 | #define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0) |
51 | 52 | ||
53 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | ||
54 | |||
52 | /* This is the old 24-bit implementation. It's still used internally | 55 | /* This is the old 24-bit implementation. It's still used internally |
53 | * by some sparc-specific code, notably the semaphore implementation. | 56 | * by some sparc-specific code, notably the semaphore implementation. |
54 | */ | 57 | */ |