summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRandall S. Becker <rsbecker@nexbridge.com>2020-09-06 16:37:47 -0500
committerRichard Levitte <levitte@openssl.org>2020-09-12 20:32:11 +0200
commit08073700cc50bcd0df5c0ee68c100e300a320d03 (patch)
tree33e0641543cc32390ba73c49901183de01fdb9db /include
parentf0c62c53286b3a79cc059354a6d3425b35bb1d50 (diff)
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 <rsbecker@nexbridge.com> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12800)
Diffstat (limited to 'include')
-rw-r--r--include/internal/cryptlib.h4
-rw-r--r--include/internal/sockets.h11
-rw-r--r--include/openssl/crypto.h8
-rw-r--r--include/openssl/e_os2.h15
4 files changed, 37 insertions, 1 deletions
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 <cextdecs.h(PROCESS_DELAY_)>
+ /* 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 <floss.h(floss_read, floss_write)>
+# 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 <pthread.h>
+# if defined(__TANDEM) && defined(_SPT_MODEL_)
+# define SPT_THREAD_SIGNAL 1
+# define SPT_THREAD_AWARE 1
+# include <spthread.h>
+# else
+# include <pthread.h>
+# 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 <strings.h>
+# endif
+# define OPENSSL_USE_BUILD_DATE
+# if defined(OPENSSL_THREADS) && defined(_SPT_MODEL_)
+# define SPT_THREAD_SIGNAL 1
+# define SPT_THREAD_AWARE 1
+# include <spthread.h>
+# elif defined(OPENSSL_THREADS) && defined(_PUT_MODEL_)
+# include <pthread.h>
+# endif
+# endif
+
/**
* That's it for OS-specific stuff
*****************************************************************************/