Lines Matching refs:ret
33 static inline int CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_UP_REF() argument
35 *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1; in CRYPTO_UP_REF()
49 static inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_DOWN_REF() argument
51 *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1; in CRYPTO_DOWN_REF()
52 if (*ret == 0) in CRYPTO_DOWN_REF()
57 static inline int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_GET_REF() argument
59 *ret = atomic_load_explicit(&refcnt->val, memory_order_relaxed); in CRYPTO_GET_REF()
71 static __inline__ int CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_UP_REF() argument
73 *ret = __atomic_fetch_add(&refcnt->val, 1, __ATOMIC_RELAXED) + 1; in CRYPTO_UP_REF()
77 static __inline__ int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_DOWN_REF() argument
79 *ret = __atomic_fetch_sub(&refcnt->val, 1, __ATOMIC_RELAXED) - 1; in CRYPTO_DOWN_REF()
80 if (*ret == 0) in CRYPTO_DOWN_REF()
85 static __inline__ int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_GET_REF() argument
87 *ret = __atomic_load_n(&refcnt->val, __ATOMIC_RELAXED); in CRYPTO_GET_REF()
98 static __inline int CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_UP_REF() argument
100 *ret = _InterlockedExchangeAdd((void *)&refcnt->val, 1) + 1; in CRYPTO_UP_REF()
104 static __inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_DOWN_REF() argument
106 *ret = _InterlockedExchangeAdd((void *)&refcnt->val, -1) - 1; in CRYPTO_DOWN_REF()
110 static __inline int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_GET_REF() argument
112 *ret = _InterlockedOr((void *)&refcnt->val, 0); in CRYPTO_GET_REF()
130 static __inline int CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_UP_REF() argument
132 *ret = _InterlockedExchangeAdd_nf(&refcnt->val, 1) + 1; in CRYPTO_UP_REF()
136 static __inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_DOWN_REF() argument
138 *ret = _InterlockedExchangeAdd_nf(&refcnt->val, -1) - 1; in CRYPTO_DOWN_REF()
139 if (*ret == 0) in CRYPTO_DOWN_REF()
144 static __inline int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_GET_REF() argument
146 *ret = _InterlockedOr_nf((void *)&refcnt->val, 0); in CRYPTO_GET_REF()
163 static __inline int CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_UP_REF() argument
165 *ret = _InterlockedExchangeAdd(&refcnt->val, 1) + 1; in CRYPTO_UP_REF()
169 static __inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_DOWN_REF() argument
171 *ret = _InterlockedExchangeAdd(&refcnt->val, -1) - 1; in CRYPTO_DOWN_REF()
175 static __inline int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt, int *ret) in CRYPTO_GET_REF() argument
177 *ret = _InterlockedExchangeAdd(&refcnt->val, 0); in CRYPTO_GET_REF()
203 int *ret) in CRYPTO_UP_REF() argument
205 return CRYPTO_atomic_add(&refcnt->val, 1, ret, refcnt->lock); in CRYPTO_UP_REF()
209 int *ret) in CRYPTO_DOWN_REF() argument
211 return CRYPTO_atomic_add(&refcnt->val, -1, ret, refcnt->lock); in CRYPTO_DOWN_REF()
215 int *ret) in CRYPTO_GET_REF() argument
217 return CRYPTO_atomic_load_int(&refcnt->val, ret, refcnt->lock); in CRYPTO_GET_REF()
241 int *ret) in CRYPTO_UP_REF() argument
244 *ret = refcnt->val; in CRYPTO_UP_REF()
249 int *ret) in CRYPTO_DOWN_REF() argument
252 *ret = refcnt->val; in CRYPTO_DOWN_REF()
257 int *ret) in CRYPTO_GET_REF() argument
259 *ret = refcnt->val; in CRYPTO_GET_REF()