diff options
author | Richard Levitte <levitte@openssl.org> | 2002-02-14 15:37:38 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2002-02-14 15:37:38 +0000 |
commit | 3e83e686ba2e21a2d7d991446bc6fedde5ff58c0 (patch) | |
tree | d8330c1735352c6b85a98a49ef79c97dbd096290 /apps | |
parent | 8f06b003736c957c6e693d3b5dd1393f91a530cd (diff) |
Add the configuration target VxWorks.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/ca.c | 2 | ||||
-rw-r--r-- | apps/s_time.c | 22 | ||||
-rw-r--r-- | apps/speed.c | 24 |
3 files changed, 41 insertions, 7 deletions
@@ -90,7 +90,7 @@ # else # include <unixlib.h> # endif -# else +# elif !defined(OPENSSL_SYS_VXWORKS) # include <sys/file.h> # endif #endif diff --git a/apps/s_time.c b/apps/s_time.c index 9ce114dcb6..2fb853d071 100644 --- a/apps/s_time.c +++ b/apps/s_time.c @@ -85,7 +85,7 @@ #include OPENSSL_UNISTD #endif -#if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) && !defined(OPENSSL_SYS_MACOSX) +#if !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) && !defined(OPENSSL_SYS_MACOSX) #define TIMES #endif @@ -105,7 +105,7 @@ #undef TIMES #endif -#ifndef TIMES +#if !defined(TIMES) && !defined(OPENSSL_SYS_VXWORKS) #include <sys/timeb.h> #endif @@ -150,6 +150,8 @@ #undef BUFSIZZ #define BUFSIZZ 1024*10 +#undef min +#undef max #define min(a,b) (((a) < (b)) ? (a) : (b)) #define max(a,b) (((a) > (b)) ? (a) : (b)) @@ -379,6 +381,22 @@ static double tm_Time_F(int s) ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ; return((ret == 0.0)?1e-6:ret); } +#elif defined(OPENSSL_SYS_VXWORKS) + { + static unsigned long tick_start, tick_end; + + if( s == START ) + { + tick_start = tickGet(); + return 0; + } + else + { + tick_end = tickGet(); + ret = (double)(tick_end - tick_start) / (double)sysClkRateGet(); + return((ret == 0.0)?1e-6:ret); + } + } #else /* !times() */ static struct timeb tstart,tend; long i; diff --git a/apps/speed.c b/apps/speed.c index 1d62c8b87a..5e53668025 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -89,10 +89,10 @@ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(OPENSSL_SYS_MACOSX) # define USE_TOD -#elif !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) +#elif !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) # define TIMES #endif -#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(OPENSSL_SYS_MPE) && !defined(__NetBSD__) /* FIXME */ +#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(OPENSSL_SYS_MPE) && !defined(__NetBSD__) && !defined(OPENSSL_SYS_VXWORKS) /* FIXME */ # define TIMEB #endif @@ -120,7 +120,7 @@ #include <sys/timeb.h> #endif -#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD) +#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD) && !defined(OPENSSL_SYS_VXWORKS) #error "It seems neither struct tms nor struct timeb is supported in this platform!" #endif @@ -326,7 +326,23 @@ static double Time_F(int s) # if defined(TIMES) && defined(TIMEB) else # endif -# ifdef TIMEB +# ifdef OPENSSL_SYS_VXWORKS + { + static unsigned long tick_start, tick_end; + + if( s == START ) + { + tick_start = tickGet(); + return 0; + } + else + { + tick_end = tickGet(); + ret = (double)(tick_end - tick_start) / (double)sysClkRateGet(); + return((ret < 0.001)?0.001:ret); + } + } +# elif defined(TIMEB) { static struct timeb tstart,tend; long i; |