forked from cory/tildefriends
OpenSSL 3.1.3 built for android.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4508 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
deps/openssl/android
arm64-v8a
usr
local
include
crypto
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes_platform.haria.hasn1.hasn1_dsa.hasn1err.hasync.hasyncerr.hbioerr.hbn.hbn_conf.hbn_conf.h.inbn_dh.hbn_srp.hbnerr.hbuffererr.hchacha.hcmll_platform.hcmperr.hcmserr.hcomperr.hconferr.hcontext.hcrmferr.hcryptlib.hcryptoerr.hcterr.hctype.hdecoder.hdecodererr.hdes_platform.hdh.hdherr.hdsa.hdsaerr.hdso_conf.hdso_conf.h.inec.hecerr.hecx.hencoder.hencodererr.hengine.hengineerr.herr.hess.hesserr.hevp.hevperr.hhttperr.hlhash.hmd32_common.hmodes.hobjects.hobjectserr.hocsperr.hpem.hpemerr.hpkcs12err.hpkcs7.hpkcs7err.hpoly1305.hppc_arch.hpunycode.hrand.hrand_pool.hranderr.hriscv_arch.defriscv_arch.hrsa.hrsaerr.hsecurity_bits.hsha.hsiphash.hsiv.hsm2.hsm2err.hsm4.hsm4_platform.hsparc_arch.hsparse_array.hstore.hstoreerr.htserr.htypes.huierr.hx509.hx509err.hx509v3err.h
internal
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Hasn1.hbio.hcomp.hconf.hconstant_time.hcore.hcryptlib.hdane.hdeprecated.hder.hdso.hdsoerr.he_os.hendian.herr.hffc.hktls.hnamemap.hnelem.hnumbers.ho_dir.ho_str.hpacket.hparam_build_set.hpassphrase.hproperty.hpropertyerr.hprovider.hrefcount.hsha3.hsizes.hsm3.hsockets.hsslconf.hsymhacks.hthread_once.htlsgroups.htsan_assist.hunicode.h
openssl
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes.hasn1.hasn1.h.inasn1_mac.hasn1err.hasn1t.hasn1t.h.inasync.hasyncerr.hbio.hbio.h.inbioerr.hblowfish.hbn.hbnerr.hbuffer.hbuffererr.hcamellia.hcast.hcmac.hcmp.hcmp.h.incmp_util.hcmperr.hcms.hcms.h.incmserr.hcomp.hcomperr.hconf.hconf.h.inconf_api.hconferr.hconfiguration.hconfiguration.h.inconftypes.hcore.hcore_dispatch.hcore_names.hcore_object.hcrmf.hcrmf.h.incrmferr.hcrypto.hcrypto.h.incryptoerr.hcryptoerr_legacy.hct.hct.h.incterr.hdecoder.hdecodererr.hdes.hdh.hdherr.hdsa.hdsaerr.hdtls1.he_os2.hebcdic.hec.hecdh.hecdsa.hecerr.hencoder.hencodererr.hengine.hengineerr.herr.herr.h.iness.hess.h.inesserr.hevp.hevperr.hfips_names.hfipskey.hfipskey.h.inhmac.hhttp.hhttperr.hidea.hkdf.hkdferr.hlhash.hlhash.h.inmacros.hmd2.hmd4.hmd5.hmdc2.hmodes.hobj_mac.hobjects.hobjectserr.hocsp.hocsp.h.inocsperr.hopensslconf.hopensslconf.h.inopensslv.hopensslv.h.inossl_typ.hparam_build.hparams.hpem.hpem2.hpemerr.hpkcs12.hpkcs12.h.inpkcs12err.hpkcs7.hpkcs7.h.inpkcs7err.hprov_ssl.hproverr.hprovider.hrand.hrand_drbg.hranderr.hrc2.hrc4.hrc5.hripemd.hrsa.hrsaerr.hsafestack.hsafestack.h.inseed.hself_test.hsha.hsrp.hsrp.h.insrtp.hssl.hssl.h.inssl2.hssl3.hsslerr.hsslerr_legacy.hstack.hstore.hstoreerr.hsymhacks.htls1.htrace.hts.htserr.htxt_db.htypes.hui.hui.h.inuierr.hwhrlpool.hx509.hx509.h.inx509_vfy.hx509_vfy.h.inx509err.hx509v3.hx509v3.h.inx509v3err.h
lib
armeabi-v7a
usr
local
include
crypto
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes_platform.haria.hasn1.hasn1_dsa.hasn1err.hasync.hasyncerr.hbioerr.hbn.hbn_conf.hbn_conf.h.inbn_dh.hbn_srp.hbnerr.hbuffererr.hchacha.hcmll_platform.hcmperr.hcmserr.hcomperr.hconferr.hcontext.hcrmferr.hcryptlib.hcryptoerr.hcterr.hctype.hdecoder.hdecodererr.hdes_platform.hdh.hdherr.hdsa.hdsaerr.hdso_conf.hdso_conf.h.inec.hecerr.hecx.hencoder.hencodererr.hengine.hengineerr.herr.hess.hesserr.hevp.hevperr.hhttperr.hlhash.hmd32_common.hmodes.hobjects.hobjectserr.hocsperr.hpem.hpemerr.hpkcs12err.hpkcs7.hpkcs7err.hpoly1305.hppc_arch.hpunycode.hrand.hrand_pool.hranderr.hriscv_arch.defriscv_arch.hrsa.hrsaerr.hsecurity_bits.hsha.hsiphash.hsiv.hsm2.hsm2err.hsm4.hsm4_platform.hsparc_arch.hsparse_array.hstore.hstoreerr.htserr.htypes.huierr.hx509.hx509err.hx509v3err.h
internal
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Hasn1.hbio.hcomp.hconf.hconstant_time.hcore.hcryptlib.hdane.hdeprecated.hder.hdso.hdsoerr.he_os.hendian.herr.hffc.hktls.hnamemap.hnelem.hnumbers.ho_dir.ho_str.hpacket.hparam_build_set.hpassphrase.hproperty.hpropertyerr.hprovider.hrefcount.hsha3.hsizes.hsm3.hsockets.hsslconf.hsymhacks.hthread_once.htlsgroups.htsan_assist.hunicode.h
openssl
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes.hasn1.hasn1.h.inasn1_mac.hasn1err.hasn1t.hasn1t.h.inasync.hasyncerr.hbio.hbio.h.inbioerr.hblowfish.hbn.hbnerr.hbuffer.hbuffererr.hcamellia.hcast.hcmac.hcmp.hcmp.h.incmp_util.hcmperr.hcms.hcms.h.incmserr.hcomp.hcomperr.hconf.hconf.h.inconf_api.hconferr.hconfiguration.hconfiguration.h.inconftypes.hcore.hcore_dispatch.hcore_names.hcore_object.hcrmf.hcrmf.h.incrmferr.hcrypto.hcrypto.h.incryptoerr.hcryptoerr_legacy.hct.hct.h.incterr.hdecoder.hdecodererr.hdes.hdh.hdherr.hdsa.hdsaerr.hdtls1.he_os2.hebcdic.hec.hecdh.hecdsa.hecerr.hencoder.hencodererr.hengine.hengineerr.herr.herr.h.iness.hess.h.inesserr.hevp.hevperr.hfips_names.hfipskey.hfipskey.h.inhmac.hhttp.hhttperr.hidea.hkdf.hkdferr.hlhash.hlhash.h.inmacros.hmd2.hmd4.hmd5.hmdc2.hmodes.hobj_mac.hobjects.hobjectserr.hocsp.hocsp.h.inocsperr.hopensslconf.hopensslconf.h.inopensslv.hopensslv.h.inossl_typ.hparam_build.hparams.hpem.hpem2.hpemerr.hpkcs12.hpkcs12.h.inpkcs12err.hpkcs7.hpkcs7.h.inpkcs7err.hprov_ssl.hproverr.hprovider.hrand.hrand_drbg.hranderr.hrc2.hrc4.hrc5.hripemd.hrsa.hrsaerr.hsafestack.hsafestack.h.inseed.hself_test.hsha.hsrp.hsrp.h.insrtp.hssl.hssl.h.inssl2.hssl3.hsslerr.hsslerr_legacy.hstack.hstore.hstoreerr.hsymhacks.htls1.htrace.hts.htserr.htxt_db.htypes.hui.hui.h.inuierr.hwhrlpool.hx509.hx509.h.inx509_vfy.hx509_vfy.h.inx509err.hx509v3.hx509v3.h.inx509v3err.h
x86
usr
local
include
crypto
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes_platform.haria.hasn1.hasn1_dsa.hasn1err.hasync.hasyncerr.hbioerr.hbn.hbn_conf.hbn_conf.h.inbn_dh.hbn_srp.hbnerr.hbuffererr.hchacha.hcmll_platform.hcmperr.hcmserr.hcomperr.hconferr.hcontext.hcrmferr.hcryptlib.hcryptoerr.hcterr.hctype.hdecoder.hdecodererr.hdes_platform.hdh.hdherr.hdsa.hdsaerr.hdso_conf.hdso_conf.h.inec.hecerr.hecx.hencoder.hencodererr.hengine.hengineerr.herr.hess.hesserr.hevp.hevperr.hhttperr.hlhash.hmd32_common.hmodes.hobjects.hobjectserr.hocsperr.hpem.hpemerr.hpkcs12err.hpkcs7.hpkcs7err.hpoly1305.hppc_arch.hpunycode.hrand.hrand_pool.hranderr.hriscv_arch.defriscv_arch.hrsa.hrsaerr.hsecurity_bits.hsha.hsiphash.hsiv.hsm2.hsm2err.hsm4.hsm4_platform.hsparc_arch.hsparse_array.hstore.hstoreerr.htserr.htypes.huierr.hx509.hx509err.hx509v3err.h
internal
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Hasn1.hbio.hcomp.hconf.hconstant_time.hcore.hcryptlib.hdane.hdeprecated.hder.hdso.hdsoerr.he_os.hendian.herr.hffc.hktls.hnamemap.hnelem.hnumbers.ho_dir.ho_str.hpacket.hparam_build_set.hpassphrase.hproperty.hpropertyerr.hprovider.hrefcount.hsha3.hsizes.hsm3.hsockets.hsslconf.hsymhacks.hthread_once.htlsgroups.htsan_assist.hunicode.h
openssl
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes.hasn1.hasn1.h.inasn1_mac.hasn1err.hasn1t.hasn1t.h.inasync.hasyncerr.hbio.hbio.h.inbioerr.hblowfish.hbn.hbnerr.hbuffer.hbuffererr.hcamellia.hcast.hcmac.hcmp.hcmp.h.incmp_util.hcmperr.hcms.hcms.h.incmserr.hcomp.hcomperr.hconf.hconf.h.inconf_api.hconferr.hconfiguration.hconfiguration.h.inconftypes.hcore.hcore_dispatch.hcore_names.hcore_object.hcrmf.hcrmf.h.incrmferr.hcrypto.hcrypto.h.incryptoerr.hcryptoerr_legacy.hct.hct.h.incterr.hdecoder.hdecodererr.hdes.hdh.hdherr.hdsa.hdsaerr.hdtls1.he_os2.hebcdic.hec.hecdh.hecdsa.hecerr.hencoder.hencodererr.hengine.hengineerr.herr.herr.h.iness.hess.h.inesserr.hevp.hevperr.hfips_names.hfipskey.hfipskey.h.inhmac.hhttp.hhttperr.hidea.hkdf.hkdferr.hlhash.hlhash.h.inmacros.hmd2.hmd4.hmd5.hmdc2.hmodes.hobj_mac.hobjects.hobjectserr.hocsp.hocsp.h.inocsperr.hopensslconf.hopensslconf.h.inopensslv.hopensslv.h.inossl_typ.hparam_build.hparams.hpem.hpem2.hpemerr.hpkcs12.hpkcs12.h.inpkcs12err.hpkcs7.hpkcs7.h.inpkcs7err.hprov_ssl.hproverr.hprovider.hrand.hrand_drbg.hranderr.hrc2.hrc4.hrc5.hripemd.hrsa.hrsaerr.hsafestack.hsafestack.h.inseed.hself_test.hsha.hsrp.hsrp.h.insrtp.hssl.hssl.h.inssl2.hssl3.hsslerr.hsslerr_legacy.hstack.hstore.hstoreerr.hsymhacks.htls1.htrace.hts.htserr.htxt_db.htypes.hui.hui.h.inuierr.hwhrlpool.hx509.hx509.h.inx509_vfy.hx509_vfy.h.inx509err.hx509v3.hx509v3.h.inx509v3err.h
x86_64
usr
local
include
crypto
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes_platform.haria.hasn1.hasn1_dsa.hasn1err.hasync.hasyncerr.hbioerr.hbn.hbn_conf.hbn_conf.h.inbn_dh.hbn_srp.hbnerr.hbuffererr.hchacha.hcmll_platform.hcmperr.hcmserr.hcomperr.hconferr.hcontext.hcrmferr.hcryptlib.hcryptoerr.hcterr.hctype.hdecoder.hdecodererr.hdes_platform.hdh.hdherr.hdsa.hdsaerr.hdso_conf.hdso_conf.h.inec.hecerr.hecx.hencoder.hencodererr.hengine.hengineerr.herr.hess.hesserr.hevp.hevperr.hhttperr.hlhash.hmd32_common.hmodes.hobjects.hobjectserr.hocsperr.hpem.hpemerr.hpkcs12err.hpkcs7.hpkcs7err.hpoly1305.hppc_arch.hpunycode.hrand.hrand_pool.hranderr.hriscv_arch.defriscv_arch.hrsa.hrsaerr.hsecurity_bits.hsha.hsiphash.hsiv.hsm2.hsm2err.hsm4.hsm4_platform.hsparc_arch.hsparse_array.hstore.hstoreerr.htserr.htypes.huierr.hx509.hx509err.hx509v3err.h
internal
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Hasn1.hbio.hcomp.hconf.hconstant_time.hcore.hcryptlib.hdane.hdeprecated.hder.hdso.hdsoerr.he_os.hendian.herr.hffc.hktls.hnamemap.hnelem.hnumbers.ho_dir.ho_str.hpacket.hparam_build_set.hpassphrase.hproperty.hpropertyerr.hprovider.hrefcount.hsha3.hsizes.hsm3.hsockets.hsslconf.hsymhacks.hthread_once.htlsgroups.htsan_assist.hunicode.h
openssl
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes.hasn1.hasn1.h.inasn1_mac.hasn1err.hasn1t.hasn1t.h.inasync.hasyncerr.hbio.hbio.h.inbioerr.hblowfish.hbn.hbnerr.hbuffer.hbuffererr.hcamellia.hcast.hcmac.hcmp.hcmp.h.incmp_util.hcmperr.hcms.hcms.h.incmserr.hcomp.hcomperr.hconf.hconf.h.inconf_api.hconferr.hconfiguration.hconfiguration.h.inconftypes.hcore.hcore_dispatch.hcore_names.hcore_object.hcrmf.hcrmf.h.incrmferr.hcrypto.hcrypto.h.incryptoerr.hcryptoerr_legacy.hct.hct.h.incterr.hdecoder.hdecodererr.hdes.hdh.hdherr.hdsa.hdsaerr.hdtls1.he_os2.hebcdic.hec.hecdh.hecdsa.hecerr.hencoder.hencodererr.hengine.hengineerr.herr.herr.h.iness.hess.h.inesserr.hevp.hevperr.hfips_names.hfipskey.hfipskey.h.inhmac.hhttp.hhttperr.hidea.hkdf.hkdferr.hlhash.hlhash.h.inmacros.hmd2.hmd4.hmd5.hmdc2.hmodes.hobj_mac.hobjects.hobjectserr.hocsp.hocsp.h.inocsperr.hopensslconf.hopensslconf.h.inopensslv.hopensslv.h.inossl_typ.hparam_build.hparams.hpem.hpem2.hpemerr.hpkcs12.hpkcs12.h.inpkcs12err.hpkcs7.hpkcs7.h.inpkcs7err.hprov_ssl.hproverr.hprovider.hrand.hrand_drbg.hranderr.hrc2.hrc4.hrc5.hripemd.hrsa.hrsaerr.hsafestack.hsafestack.h.inseed.hself_test.hsha.hsrp.hsrp.h.insrtp.hssl.hssl.h.inssl2.hssl3.hsslerr.hsslerr_legacy.hstack.hstore.hstoreerr.hsymhacks.htls1.htrace.hts.htserr.htxt_db.htypes.hui.hui.h.inuierr.hwhrlpool.hx509.hx509.h.inx509_vfy.hx509_vfy.h.inx509err.hx509v3.hx509v3.h.inx509v3err.h
lib
tools
@ -1,35 +1,34 @@
|
||||
/*
|
||||
* Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
#ifndef OSSL_INTERNAL_REFCOUNT_H
|
||||
# define OSSL_INTERNAL_REFCOUNT_H
|
||||
# pragma once
|
||||
|
||||
/* Used to checking reference counts, most while doing perl5 stuff :-) */
|
||||
# if defined(OPENSSL_NO_STDIO)
|
||||
# if defined(REF_PRINT)
|
||||
# error "REF_PRINT requires stdio"
|
||||
# include <openssl/e_os2.h>
|
||||
# include <openssl/trace.h>
|
||||
|
||||
# if defined(OPENSSL_THREADS) && !defined(OPENSSL_DEV_NO_ATOMICS)
|
||||
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
|
||||
&& !defined(__STDC_NO_ATOMICS__)
|
||||
# include <stdatomic.h>
|
||||
# define HAVE_C11_ATOMICS
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
|
||||
&& !defined(__STDC_NO_ATOMICS__)
|
||||
# include <stdatomic.h>
|
||||
# define HAVE_C11_ATOMICS
|
||||
# endif
|
||||
# if defined(HAVE_C11_ATOMICS) && defined(ATOMIC_INT_LOCK_FREE) \
|
||||
&& ATOMIC_INT_LOCK_FREE > 0
|
||||
|
||||
# if defined(HAVE_C11_ATOMICS) && defined(ATOMIC_INT_LOCK_FREE) \
|
||||
&& ATOMIC_INT_LOCK_FREE > 0
|
||||
|
||||
# define HAVE_ATOMICS 1
|
||||
# define HAVE_ATOMICS 1
|
||||
|
||||
typedef _Atomic int CRYPTO_REF_COUNT;
|
||||
|
||||
static inline int CRYPTO_UP_REF(_Atomic int *val, int *ret, void *lock)
|
||||
static inline int CRYPTO_UP_REF(_Atomic int *val, int *ret,
|
||||
ossl_unused void *lock)
|
||||
{
|
||||
*ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1;
|
||||
return 1;
|
||||
@ -45,7 +44,8 @@ static inline int CRYPTO_UP_REF(_Atomic int *val, int *ret, void *lock)
|
||||
* to mutable members doesn't have to be serialized anymore, which would
|
||||
* otherwise imply an acquire fence. Hence conditional acquire fence...
|
||||
*/
|
||||
static inline int CRYPTO_DOWN_REF(_Atomic int *val, int *ret, void *lock)
|
||||
static inline int CRYPTO_DOWN_REF(_Atomic int *val, int *ret,
|
||||
ossl_unused void *lock)
|
||||
{
|
||||
*ret = atomic_fetch_sub_explicit(val, 1, memory_order_relaxed) - 1;
|
||||
if (*ret == 0)
|
||||
@ -53,78 +53,108 @@ static inline int CRYPTO_DOWN_REF(_Atomic int *val, int *ret, void *lock)
|
||||
return 1;
|
||||
}
|
||||
|
||||
# elif defined(__GNUC__) && defined(__ATOMIC_RELAXED) && __GCC_ATOMIC_INT_LOCK_FREE > 0
|
||||
# elif defined(__GNUC__) && defined(__ATOMIC_RELAXED) && __GCC_ATOMIC_INT_LOCK_FREE > 0
|
||||
|
||||
# define HAVE_ATOMICS 1
|
||||
# define HAVE_ATOMICS 1
|
||||
|
||||
typedef int CRYPTO_REF_COUNT;
|
||||
|
||||
static __inline__ int CRYPTO_UP_REF(int *val, int *ret, void *lock)
|
||||
static __inline__ int CRYPTO_UP_REF(int *val, int *ret, ossl_unused void *lock)
|
||||
{
|
||||
*ret = __atomic_fetch_add(val, 1, __ATOMIC_RELAXED) + 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static __inline__ int CRYPTO_DOWN_REF(int *val, int *ret, void *lock)
|
||||
static __inline__ int CRYPTO_DOWN_REF(int *val, int *ret,
|
||||
ossl_unused void *lock)
|
||||
{
|
||||
*ret = __atomic_fetch_sub(val, 1, __ATOMIC_RELAXED) - 1;
|
||||
if (*ret == 0)
|
||||
__atomic_thread_fence(__ATOMIC_ACQUIRE);
|
||||
return 1;
|
||||
}
|
||||
# elif defined(__ICL) && defined(_WIN32)
|
||||
# define HAVE_ATOMICS 1
|
||||
typedef volatile int CRYPTO_REF_COUNT;
|
||||
|
||||
# elif defined(_MSC_VER) && _MSC_VER>=1200
|
||||
static __inline int CRYPTO_UP_REF(volatile int *val, int *ret,
|
||||
ossl_unused void *lock)
|
||||
{
|
||||
*ret = _InterlockedExchangeAdd((void *)val, 1) + 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
# define HAVE_ATOMICS 1
|
||||
static __inline int CRYPTO_DOWN_REF(volatile int *val, int *ret,
|
||||
ossl_unused void *lock)
|
||||
{
|
||||
*ret = _InterlockedExchangeAdd((void *)val, -1) - 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
# elif defined(_MSC_VER) && _MSC_VER>=1200
|
||||
|
||||
# define HAVE_ATOMICS 1
|
||||
|
||||
typedef volatile int CRYPTO_REF_COUNT;
|
||||
|
||||
# if (defined(_M_ARM) && _M_ARM>=7 && !defined(_WIN32_WCE)) || defined(_M_ARM64)
|
||||
# include <intrin.h>
|
||||
# if defined(_M_ARM64) && !defined(_ARM_BARRIER_ISH)
|
||||
# define _ARM_BARRIER_ISH _ARM64_BARRIER_ISH
|
||||
# endif
|
||||
# if (defined(_M_ARM) && _M_ARM>=7 && !defined(_WIN32_WCE)) || defined(_M_ARM64)
|
||||
# include <intrin.h>
|
||||
# if defined(_M_ARM64) && !defined(_ARM_BARRIER_ISH)
|
||||
# define _ARM_BARRIER_ISH _ARM64_BARRIER_ISH
|
||||
# endif
|
||||
|
||||
static __inline int CRYPTO_UP_REF(volatile int *val, int *ret, void *lock)
|
||||
static __inline int CRYPTO_UP_REF(volatile int *val, int *ret,
|
||||
ossl_unused void *lock)
|
||||
{
|
||||
*ret = _InterlockedExchangeAdd_nf(val, 1) + 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static __inline int CRYPTO_DOWN_REF(volatile int *val, int *ret, void *lock)
|
||||
static __inline int CRYPTO_DOWN_REF(volatile int *val, int *ret,
|
||||
ossl_unused void *lock)
|
||||
{
|
||||
*ret = _InterlockedExchangeAdd_nf(val, -1) - 1;
|
||||
if (*ret == 0)
|
||||
__dmb(_ARM_BARRIER_ISH);
|
||||
return 1;
|
||||
}
|
||||
# else
|
||||
# if !defined(_WIN32_WCE)
|
||||
# pragma intrinsic(_InterlockedExchangeAdd)
|
||||
# else
|
||||
# if _WIN32_WCE >= 0x600
|
||||
extern long __cdecl _InterlockedExchangeAdd(long volatile*, long);
|
||||
# if !defined(_WIN32_WCE)
|
||||
# pragma intrinsic(_InterlockedExchangeAdd)
|
||||
# else
|
||||
/* under Windows CE we still have old-style Interlocked* functions */
|
||||
extern long __cdecl InterlockedExchangeAdd(long volatile*, long);
|
||||
# define _InterlockedExchangeAdd InterlockedExchangeAdd
|
||||
# if _WIN32_WCE >= 0x600
|
||||
extern long __cdecl _InterlockedExchangeAdd(long volatile*, long);
|
||||
# else
|
||||
/* under Windows CE we still have old-style Interlocked* functions */
|
||||
extern long __cdecl InterlockedExchangeAdd(long volatile*, long);
|
||||
# define _InterlockedExchangeAdd InterlockedExchangeAdd
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
static __inline int CRYPTO_UP_REF(volatile int *val, int *ret, void *lock)
|
||||
static __inline int CRYPTO_UP_REF(volatile int *val, int *ret,
|
||||
ossl_unused void *lock)
|
||||
{
|
||||
*ret = _InterlockedExchangeAdd(val, 1) + 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static __inline int CRYPTO_DOWN_REF(volatile int *val, int *ret, void *lock)
|
||||
static __inline int CRYPTO_DOWN_REF(volatile int *val, int *ret,
|
||||
ossl_unused void *lock)
|
||||
{
|
||||
*ret = _InterlockedExchangeAdd(val, -1) - 1;
|
||||
return 1;
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# else
|
||||
# endif
|
||||
# endif /* !OPENSSL_DEV_NO_ATOMICS */
|
||||
|
||||
/*
|
||||
* All the refcounting implementations above define HAVE_ATOMICS, so if it's
|
||||
* still undefined here (such as when OPENSSL_DEV_NO_ATOMICS is defined), it
|
||||
* means we need to implement a fallback. This fallback uses locks.
|
||||
*/
|
||||
# ifndef HAVE_ATOMICS
|
||||
|
||||
typedef int CRYPTO_REF_COUNT;
|
||||
|
||||
@ -140,11 +170,9 @@ typedef int CRYPTO_REF_COUNT;
|
||||
# define REF_ASSERT_ISNT(i)
|
||||
# endif
|
||||
|
||||
# ifdef REF_PRINT
|
||||
# define REF_PRINT_COUNT(a, b) \
|
||||
fprintf(stderr, "%p:%4d:%s\n", b, b->references, a)
|
||||
# else
|
||||
# define REF_PRINT_COUNT(a, b)
|
||||
# endif
|
||||
# define REF_PRINT_EX(text, count, object) \
|
||||
OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
|
||||
# define REF_PRINT_COUNT(text, object) \
|
||||
REF_PRINT_EX(text, object->references, (void *)object)
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user