This source file includes following definitions.
- atomic_dec_if_positive
1
2 #ifndef _ASM_MICROBLAZE_ATOMIC_H
3 #define _ASM_MICROBLAZE_ATOMIC_H
4
5 #include <asm/cmpxchg.h>
6 #include <asm-generic/atomic.h>
7 #include <asm-generic/atomic64.h>
8
9
10
11
12
13 static inline int atomic_dec_if_positive(atomic_t *v)
14 {
15 unsigned long flags;
16 int res;
17
18 local_irq_save(flags);
19 res = v->counter - 1;
20 if (res >= 0)
21 v->counter = res;
22 local_irq_restore(flags);
23
24 return res;
25 }
26 #define atomic_dec_if_positive atomic_dec_if_positive
27
28 #endif