1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_MICROBLAZE_ATOMIC_H
3 #define _ASM_MICROBLAZE_ATOMIC_H
5 #include <asm/cmpxchg.h>
6 #include <asm-generic/atomic.h>
7 #include <asm-generic/atomic64.h>
10 * Atomically test *v and decrement if it is greater than 0.
11 * The function returns the old value of *v minus 1.
13 static inline int atomic_dec_if_positive(atomic_t *v)
18 local_irq_save(flags);
22 local_irq_restore(flags);
26 #define atomic_dec_if_positive atomic_dec_if_positive
28 #endif /* _ASM_MICROBLAZE_ATOMIC_H */