VMS knows POSIX threads too!

include/internal/thread_arch.h didn't indicate this, now it does.

This also removes ossl_crypto_mem_barrier(), because we isn't used
anywhere, and doesn't build with compilers that don't support the GNU
extension __asm__.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/20440)
This commit is contained in:
Richard Levitte 2023-03-06 08:55:34 +01:00
parent 52ce351a67
commit ac21c1780a
2 changed files with 2 additions and 36 deletions

View File

@ -193,40 +193,4 @@ void ossl_crypto_condvar_free(CRYPTO_CONDVAR **cv)
*cv_p = NULL;
}
void ossl_crypto_mem_barrier(void)
{
# if defined(__clang__) || defined(__GNUC__)
__sync_synchronize();
# elif !defined(OPENSSL_NO_ASM)
# if defined(__alpha__) /* Alpha */
__asm__ volatile("mb" : : : "memory");
# elif defined(__amd64__) || defined(__i386__) || defined(__i486__) \
|| defined(__i586__) || defined(__i686__) || defined(__i386) /* x86 */
__asm__ volatile("mfence" : : : "memory");
# elif defined(__arm__) || defined(__aarch64__) /* ARMv7, ARMv8 */
__asm__ volatile("dmb ish" : : : "memory");
# elif defined(__hppa__) /* PARISC */
__asm__ volatile("" : : : "memory");
# elif defined(__mips__) /* MIPS */
__asm__ volatile("sync" : : : "memory");
# elif defined(__powerpc__) || defined(__powerpc64__) /* power, ppc64, ppc64le */
__asm__ volatile("sync" : : : "memory");
# elif defined(__sparc__)
__asm__ volatile("ba,pt %%xcc, 1f\n\t" \
" membar #Sync\n" \
"1:\n" \
: : : "memory");
# elif defined(__s390__) || defined(__s390x__) /* z */
__asm__ volatile("bcr 15,0" : : : "memory");
# elif defined(__riscv) || defined(__riscv__) /* riscv */
__asm__ volatile("fence iorw,iorw" : : : "memory");
# else /* others, compiler only */
__asm__ volatile("" : : : "memory");
# endif
# else
/* compiler only barrier */
__asm__ volatile("" : : : "memory");
# endif
}
#endif

View File

@ -18,6 +18,8 @@
# if defined(OPENSSL_THREADS) && defined(OPENSSL_SYS_UNIX)
# define OPENSSL_THREADS_POSIX
# elif defined(OPENSSL_THREADS) && defined(OPENSSL_SYS_VMS)
# define OPENSSL_THREADS_POSIX
# elif defined(OPENSSL_THREADS) && defined(OPENSSL_SYS_WINDOWS) && \
defined(_WIN32_WINNT)
# if _WIN32_WINNT >= 0x0600