• Home
  • Raw
  • Download

Lines Matching refs:i

20 #define ATOMIC_INIT(i)  { (i) }  argument
23 #define atomic_set(v, i) WRITE_ONCE(((v)->counter), (i)) argument
26 static inline int __atomic_##op##_return(int i, atomic_t *v) \
38 : "m" (v->counter), #asm_con (i) \
45 static inline int __atomic_fetch_##op(int i, atomic_t *v) \
58 : "m" (v->counter), #asm_con (i) \
71 static inline void atomic_##op(int i, atomic_t *v) \ in ATOMIC_OP_RETURN()
73 (void)__atomic_##op##_return(i, v); \ in ATOMIC_OP_RETURN()
76 static inline int atomic_fetch_##op(int i, atomic_t *v) \
78 return __atomic_fetch_##op(i, v); \
100 #define IS_21BIT_CONST(i) \ argument
101 (__builtin_constant_p(i) && ((i) >= -1048575) && ((i) <= 1048576))
110 static inline int atomic_add_return(int i, atomic_t *v)
112 if (IS_21BIT_CONST(i))
113 return __atomic_sub_return(-i, v);
115 return __atomic_add_return(i, v);
118 static inline int atomic_fetch_add(int i, atomic_t *v) in atomic_fetch_add() argument
120 if (IS_21BIT_CONST(i)) in atomic_fetch_add()
121 return __atomic_fetch_sub(-i, v); in atomic_fetch_add()
123 return __atomic_fetch_add(i, v); in atomic_fetch_add()
133 static inline int atomic_sub_return(int i, atomic_t *v) in atomic_sub_return() argument
135 if (IS_21BIT_CONST(i)) in atomic_sub_return()
136 return __atomic_sub_return(i, v); in atomic_sub_return()
138 return __atomic_add_return(-i, v); in atomic_sub_return()
141 static inline int atomic_fetch_sub(int i, atomic_t *v) in atomic_fetch_sub() argument
143 if (IS_21BIT_CONST(i)) in atomic_fetch_sub()
144 return __atomic_fetch_sub(i, v); in atomic_fetch_sub()
146 return __atomic_fetch_add(-i, v); in atomic_fetch_sub()
205 static inline int atomic_sub_if_positive(int i, atomic_t *v) in atomic_sub_if_positive() argument
219 : "m"(v->counter), "ir"(i) in atomic_sub_if_positive()
228 #define atomic_sub(i, v) (void)atomic_sub_return(i, v) argument
229 #define atomic_add(i, v) (void)atomic_add_return(i, v) argument
236 #define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0) argument
239 #define atomic_add_negative(i, v) (atomic_add_return(i, v) < 0) argument