aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-05-01 15:36:54 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-05-01 15:36:54 +0000
commit2f6efd6acbbf307787f54db637f250cb9c98dac6 (patch)
treefb79c4ca9e3cf7ace3bdce4e0d3478f10ec41284
parent823df31be7e5b1a72a5f58d4f1106168e8afbae0 (diff)
downloadopenssl-2f6efd6acbbf307787f54db637f250cb9c98dac6.tar.gz
Some changes to support VxWorks in the validted module.
-rwxr-xr-xConfigure2
-rwxr-xr-xconfig6
-rw-r--r--fips/fips_canister.c2
-rw-r--r--fips/rand/fips_rand.c19
4 files changed, 27 insertions, 2 deletions
diff --git a/Configure b/Configure
index ffb901898e..b429f78c39 100755
--- a/Configure
+++ b/Configure
@@ -591,6 +591,8 @@ my %table=(
"OS2-EMX", "gcc::::::::",
##### VxWorks for various targets
+"vxworks-ppc60x","ccppc:-D_REENTRANT -mrtp -mhard-float -mstrict-align -fno-implicit-fp -DPPC32_fp60x -O2 -fstrength-reduce -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip:::VXWORKS:-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common:::::",
+"vxworks-ppcgen","ccppc:-D_REENTRANT -mrtp -msoft-float -mstrict-align -O1 -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip:::VXWORKS:-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon:::::",
"vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::",
"vxworks-ppc750","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG):::VXWORKS:-r:::::",
"vxworks-ppc750-debug","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g:::VXWORKS:-r:::::",
diff --git a/config b/config
index 74cda563e8..2827a458c0 100755
--- a/config
+++ b/config
@@ -370,6 +370,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
NONSTOP_KERNEL*)
echo "nsr-tandem-nsk"; exit 0;
;;
+
+ vxworks*)
+ echo "${MACHINE}-whatever-vxworks"; exit 0;
+ ;;
esac
#
@@ -583,6 +587,8 @@ case "$GUESSOS" in
OUT="linux-ppc"
;;
ppc-*-linux2) OUT="linux-ppc" ;;
+ ppc60x-*-vxworks*) OUT="vxworks-ppc60x" ;;
+ ppcgen-*-vxworks*) OUT="vxworks-ppcgen" ;;
ia64-*-linux?) OUT="linux-ia64" ;;
sparc64-*-linux2)
echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI"
diff --git a/fips/fips_canister.c b/fips/fips_canister.c
index ea7ac764b0..0f6c63d22d 100644
--- a/fips/fips_canister.c
+++ b/fips/fips_canister.c
@@ -177,6 +177,8 @@ const void *FIPS_ref_point()
# else
return (void *)FIPS_ref_point;
# endif
+#elif defined(__vxworks)
+ return (void *)FIPS_ref_point;
/*
* In case you wonder why there is no #ifdef __linux. All Linux targets
* are GCC-based and therefore are covered by instruction_pointer above
diff --git a/fips/rand/fips_rand.c b/fips/rand/fips_rand.c
index 2cbe16bfd5..f8de94291d 100644
--- a/fips/rand/fips_rand.c
+++ b/fips/rand/fips_rand.c
@@ -66,8 +66,11 @@
#include <openssl/aes.h>
#include <openssl/err.h>
#include <openssl/fips_rand.h>
-#ifndef OPENSSL_SYS_WIN32
-#include <sys/time.h>
+#if !(defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS))
+# include <sys/time.h>
+#endif
+#if defined(OPENSSL_SYS_VXWORKS)
+# include <time.h>
#endif
#include <assert.h>
#ifndef OPENSSL_SYS_WIN32
@@ -225,6 +228,8 @@ void FIPS_get_timevec(unsigned char *buf, unsigned long *pctr)
{
#ifdef OPENSSL_SYS_WIN32
FILETIME ft;
+#elif defined(OPENSSL_SYS_VXWORKS)
+ struct timespec ts;
#else
struct timeval tv;
#endif
@@ -243,6 +248,16 @@ void FIPS_get_timevec(unsigned char *buf, unsigned long *pctr)
buf[5] = (unsigned char) ((ft.dwLowDateTime >> 8) & 0xff);
buf[6] = (unsigned char) ((ft.dwLowDateTime >> 16) & 0xff);
buf[7] = (unsigned char) ((ft.dwLowDateTime >> 24) & 0xff);
+#elif defined(OPENSSL_SYS_VXWORKS)
+ clock_gettime(CLOCK_REALTIME, &ts);
+ buf[0] = (unsigned char) (ts.tv_sec & 0xff);
+ buf[1] = (unsigned char) ((ts.tv_sec >> 8) & 0xff);
+ buf[2] = (unsigned char) ((ts.tv_sec >> 16) & 0xff);
+ buf[3] = (unsigned char) ((ts.tv_sec >> 24) & 0xff);
+ buf[4] = (unsigned char) (ts.tv_nsec & 0xff);
+ buf[5] = (unsigned char) ((ts.tv_nsec >> 8) & 0xff);
+ buf[6] = (unsigned char) ((ts.tv_nsec >> 16) & 0xff);
+ buf[7] = (unsigned char) ((ts.tv_nsec >> 24) & 0xff);
#else
gettimeofday(&tv,NULL);
buf[0] = (unsigned char) (tv.tv_sec & 0xff);