Lines Matching refs:val
835 int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) in CRYPTO_THREAD_set_local() argument
837 if (pthread_setspecific(*key, val) != 0) in CRYPTO_THREAD_set_local()
861 int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock) in CRYPTO_atomic_add() argument
864 if (__atomic_is_lock_free(sizeof(*val), val)) { in CRYPTO_atomic_add()
865 *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL); in CRYPTO_atomic_add()
871 *ret = atomic_add_int_nv((volatile unsigned int *)val, amount); in CRYPTO_atomic_add()
878 *val += amount; in CRYPTO_atomic_add()
879 *ret = *val; in CRYPTO_atomic_add()
887 int CRYPTO_atomic_add64(uint64_t *val, uint64_t op, uint64_t *ret, in CRYPTO_atomic_add64() argument
891 if (__atomic_is_lock_free(sizeof(*val), val)) { in CRYPTO_atomic_add64()
892 *ret = __atomic_add_fetch(val, op, __ATOMIC_ACQ_REL); in CRYPTO_atomic_add64()
898 *ret = atomic_add_64_nv(val, op); in CRYPTO_atomic_add64()
904 *val += op; in CRYPTO_atomic_add64()
905 *ret = *val; in CRYPTO_atomic_add64()
913 int CRYPTO_atomic_and(uint64_t *val, uint64_t op, uint64_t *ret, in CRYPTO_atomic_and() argument
917 if (__atomic_is_lock_free(sizeof(*val), val)) { in CRYPTO_atomic_and()
918 *ret = __atomic_and_fetch(val, op, __ATOMIC_ACQ_REL); in CRYPTO_atomic_and()
924 *ret = atomic_and_64_nv(val, op); in CRYPTO_atomic_and()
930 *val &= op; in CRYPTO_atomic_and()
931 *ret = *val; in CRYPTO_atomic_and()
939 int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret, in CRYPTO_atomic_or() argument
943 if (__atomic_is_lock_free(sizeof(*val), val)) { in CRYPTO_atomic_or()
944 *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL); in CRYPTO_atomic_or()
950 *ret = atomic_or_64_nv(val, op); in CRYPTO_atomic_or()
956 *val |= op; in CRYPTO_atomic_or()
957 *ret = *val; in CRYPTO_atomic_or()
965 int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock) in CRYPTO_atomic_load() argument
968 if (__atomic_is_lock_free(sizeof(*val), val)) { in CRYPTO_atomic_load()
969 __atomic_load(val, ret, __ATOMIC_ACQUIRE); in CRYPTO_atomic_load()
975 *ret = atomic_or_64_nv(val, 0); in CRYPTO_atomic_load()
981 *ret = *val; in CRYPTO_atomic_load()
988 int CRYPTO_atomic_store(uint64_t *dst, uint64_t val, CRYPTO_RWLOCK *lock) in CRYPTO_atomic_store() argument
992 __atomic_store(dst, &val, __ATOMIC_RELEASE); in CRYPTO_atomic_store()
998 atomic_swap_64(dst, val); in CRYPTO_atomic_store()
1004 *dst = val; in CRYPTO_atomic_store()
1011 int CRYPTO_atomic_load_int(int *val, int *ret, CRYPTO_RWLOCK *lock) in CRYPTO_atomic_load_int() argument
1014 if (__atomic_is_lock_free(sizeof(*val), val)) { in CRYPTO_atomic_load_int()
1015 __atomic_load(val, ret, __ATOMIC_ACQUIRE); in CRYPTO_atomic_load_int()
1021 *ret = (int)atomic_or_uint_nv((unsigned int *)val, 0); in CRYPTO_atomic_load_int()
1027 *ret = *val; in CRYPTO_atomic_load_int()