From 08073700cc50bcd0df5c0ee68c100e300a320d03 Mon Sep 17 00:00:00 2001 From: "Randall S. Becker" Date: Sun, 6 Sep 2020 16:37:47 -0500 Subject: NonStop port updates for 3.0.0. HPE NonStop Port Changes for 3.0.0 Includes unthreaded, PUT, and SPT for OSS. The port changes include wrapping where necessary for FLOSS and appropriate configuration changes to support that. Two tests are excluded as being inappropriate for the platform. The changes are: * Added /usr/local/include to nonstop-nsx_spt_floss to load floss.h * Added SPT Floss variant for NonStop * Wrapped FLOSS definitions in OPENSSL_TANDEM_FLOSS to allow selective enablement. * SPT build configuration for NonStop * Skip tests not relevant for NonStop * PUT configuration changes required for NonStop platforms * Configurations/50-nonstop.conf: updates for TNS/X platform. * FLOSS instrumentation for HPE NonStop TNS/X and TNS/E platforms. * Configurations/50-nonstop.conf: modifications for non-PUT TNS/E platform b * Fix use of DELAY in ssltestlib.c for HPNS. * Fixed commit merge issues and added floss to http_server.c CLA: Permission is granted by the author to the OpenSSL team to use these modifications. Fixes #5087. Signed-off-by: Randall S. Becker Reviewed-by: Shane Lontis Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/12800) --- include/internal/cryptlib.h | 4 ++++ include/internal/sockets.h | 11 +++++++++++ include/openssl/crypto.h | 8 +++++++- include/openssl/e_os2.h | 15 +++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/internal/cryptlib.h b/include/internal/cryptlib.h index 1df0c5df34..a01b1f15d5 100644 --- a/include/internal/cryptlib.h +++ b/include/internal/cryptlib.h @@ -215,6 +215,10 @@ static ossl_inline void ossl_sleep(unsigned long millis) ts.tv_sec = (long int) (millis / 1000); ts.tv_nsec = (long int) (millis % 1000) * 1000000ul; nanosleep(&ts, NULL); +# elif defined(__TANDEM) && !defined(_REENTRANT) +# include + /* HPNS does not support usleep for non threaded apps */ + PROCESS_DELAY_(millis * 1000); # else usleep(millis * 1000); # endif diff --git a/include/internal/sockets.h b/include/internal/sockets.h index 6d17363d9b..e3a6bd459b 100644 --- a/include/internal/sockets.h +++ b/include/internal/sockets.h @@ -145,6 +145,17 @@ struct servent *PASCAL getservbyname(const char *, const char *); # define closesocket(s) close(s) # define readsocket(s,b,n) read((s),(b),(n)) # define writesocket(s,b,n) write((s),(char *)(b),(n)) +# elif defined(OPENSSL_SYSNAME_TANDEM) +# if defined(OPENSSL_TANDEM_FLOSS) +# include +# define readsocket(s,b,n) floss_read((s),(b),(n)) +# define writesocket(s,b,n) floss_write((s),(b),(n)) +# else +# define readsocket(s,b,n) read((s),(b),(n)) +# define writesocket(s,b,n) write((s),(b),(n)) +# endif +# define ioctlsocket(a,b,c) ioctl(a,b,c) +# define closesocket(s) close(s) # else # define ioctlsocket(a,b,c) ioctl(a,b,c) # define closesocket(s) close(s) diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h index abd3a68cd4..a7c2863b54 100644 --- a/include/openssl/crypto.h +++ b/include/openssl/crypto.h @@ -464,7 +464,13 @@ typedef LONG CRYPTO_ONCE; # define CRYPTO_ONCE_STATIC_INIT 0 # endif # else -# include +# if defined(__TANDEM) && defined(_SPT_MODEL_) +# define SPT_THREAD_SIGNAL 1 +# define SPT_THREAD_AWARE 1 +# include +# else +# include +# endif typedef pthread_once_t CRYPTO_ONCE; typedef pthread_key_t CRYPTO_THREAD_LOCAL; typedef pthread_t CRYPTO_THREAD_ID; diff --git a/include/openssl/e_os2.h b/include/openssl/e_os2.h index 7b51939e3d..13420d9928 100644 --- a/include/openssl/e_os2.h +++ b/include/openssl/e_os2.h @@ -138,6 +138,21 @@ extern "C" { # endif # endif +/* ---------------------------- HP NonStop -------------------------------- */ +# ifdef __TANDEM +# ifdef _STRING +# include +# endif +# define OPENSSL_USE_BUILD_DATE +# if defined(OPENSSL_THREADS) && defined(_SPT_MODEL_) +# define SPT_THREAD_SIGNAL 1 +# define SPT_THREAD_AWARE 1 +# include +# elif defined(OPENSSL_THREADS) && defined(_PUT_MODEL_) +# include +# endif +# endif + /** * That's it for OS-specific stuff *****************************************************************************/ -- cgit v1.2.3