Add the configuration target VxWorks.
This commit is contained in:
@@ -490,6 +490,9 @@ my %table=(
|
|||||||
##### Sony NEWS-OS 4.x
|
##### Sony NEWS-OS 4.x
|
||||||
"newsos4-gcc","gcc:-O -DB_ENDIAN -DNEWS4::(unknown):-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::",
|
"newsos4-gcc","gcc:-O -DB_ENDIAN -DNEWS4::(unknown):-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::",
|
||||||
|
|
||||||
|
##### VxWorks for various targets
|
||||||
|
"vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DVXWORKS -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::-r:::::",
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
my @WinTargets=qw(VC-NT VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS BC-32
|
my @WinTargets=qw(VC-NT VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS BC-32
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
# else
|
# else
|
||||||
# include <unixlib.h>
|
# include <unixlib.h>
|
||||||
# endif
|
# endif
|
||||||
# else
|
# elif !defined(VXWORKS)
|
||||||
# include <sys/file.h>
|
# include <sys/file.h>
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
#include "wintext.h"
|
#include "wintext.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) || defined (_DARWIN)
|
#if !defined(MSDOS) && !defined(VXWORKS) && (!defined(VMS) || defined(__DECC)) || defined (_DARWIN)
|
||||||
#define TIMES
|
#define TIMES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
#undef TIMES
|
#undef TIMES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TIMES
|
#if !defined(TIMES) && !defined(VXWORKS)
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -139,6 +139,8 @@
|
|||||||
#undef BUFSIZZ
|
#undef BUFSIZZ
|
||||||
#define BUFSIZZ 1024*10
|
#define BUFSIZZ 1024*10
|
||||||
|
|
||||||
|
#undef min
|
||||||
|
#undef max
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||||
|
|
||||||
@@ -368,6 +370,22 @@ static double tm_Time_F(int s)
|
|||||||
ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ;
|
ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ;
|
||||||
return((ret == 0.0)?1e-6:ret);
|
return((ret == 0.0)?1e-6:ret);
|
||||||
}
|
}
|
||||||
|
#elif defined(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() */
|
#else /* !times() */
|
||||||
static struct timeb tstart,tend;
|
static struct timeb tstart,tend;
|
||||||
long i;
|
long i;
|
||||||
|
|||||||
27
apps/speed.c
27
apps/speed.c
@@ -84,10 +84,10 @@
|
|||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(_DARWIN)
|
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(_DARWIN)
|
||||||
# define USE_TOD
|
# define USE_TOD
|
||||||
#elif !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
|
#elif !defined(MSDOS) && !defined(VXWORKS) && (!defined(VMS) || defined(__DECC))
|
||||||
# define TIMES
|
# define TIMES
|
||||||
#endif
|
#endif
|
||||||
#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(MPE) && !defined(__NetBSD__) && !defined(_DARWIN)
|
#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(MPE) && !defined(__NetBSD__) && !defined(_DARWIN) && !defined(VXWORKS)
|
||||||
# define TIMEB
|
# define TIMEB
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD)
|
#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD) && !defined(VXWORKS)
|
||||||
#error "It seems neither struct tms nor struct timeb is supported in this platform!"
|
#error "It seems neither struct tms nor struct timeb is supported in this platform!"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ static double Time_F(int s, int usertime)
|
|||||||
|
|
||||||
#ifdef USE_TOD
|
#ifdef USE_TOD
|
||||||
if(usertime)
|
if(usertime)
|
||||||
{
|
{
|
||||||
static struct rusage tstart,tend;
|
static struct rusage tstart,tend;
|
||||||
|
|
||||||
if (s == START)
|
if (s == START)
|
||||||
@@ -284,7 +284,23 @@ static double Time_F(int s, int usertime)
|
|||||||
# if defined(TIMES) && defined(TIMEB)
|
# if defined(TIMES) && defined(TIMEB)
|
||||||
else
|
else
|
||||||
# endif
|
# endif
|
||||||
# ifdef TIMEB
|
# ifdef 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;
|
static struct timeb tstart,tend;
|
||||||
long i;
|
long i;
|
||||||
@@ -303,6 +319,7 @@ static double Time_F(int s, int usertime)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,13 @@
|
|||||||
#include <openssl/crypto.h>
|
#include <openssl/crypto.h>
|
||||||
|
|
||||||
#include "openssl/e_os.h"
|
#include "openssl/e_os.h"
|
||||||
#ifndef SSIZE_MAX
|
|
||||||
|
/* VxWorks defines SSiZE_MAX with an empty value causing compile errors */
|
||||||
|
#if defined(VXWORKS)
|
||||||
|
# undef SSIZE_MAX
|
||||||
# define SSIZE_MAX INT_MAX
|
# define SSIZE_MAX INT_MAX
|
||||||
|
#elif !defined(SSIZE_MAX)
|
||||||
|
# define SSIZE_MAX _INT_MAX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int bio_new(BIO *bio);
|
static int bio_new(BIO *bio);
|
||||||
@@ -255,7 +260,7 @@ static ssize_t bio_nread(BIO *bio, char **buf, size_t num_)
|
|||||||
ssize_t num, available;
|
ssize_t num, available;
|
||||||
|
|
||||||
if (num_ > SSIZE_MAX)
|
if (num_ > SSIZE_MAX)
|
||||||
num = SSIZE_MAX;
|
num = SSIZE_MAX;
|
||||||
else
|
else
|
||||||
num = (ssize_t)num_;
|
num = (ssize_t)num_;
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
# include <starlet.h>
|
# include <starlet.h>
|
||||||
#elif defined(__ultrix)
|
#elif defined(__ultrix)
|
||||||
# include <sys/syslog.h>
|
# include <sys/syslog.h>
|
||||||
#elif !defined(MSDOS) /* Unix */
|
#elif !defined(MSDOS) && !defined(VXWORKS) /* Unix */
|
||||||
# include <syslog.h>
|
# include <syslog.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32)
|
#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32) && !defined(VXWORKS)
|
||||||
#include <openssl/opensslconf.h>
|
#include <openssl/opensslconf.h>
|
||||||
#ifdef OPENSSL_UNISTD
|
#ifdef OPENSSL_UNISTD
|
||||||
# include OPENSSL_UNISTD
|
# include OPENSSL_UNISTD
|
||||||
@@ -133,6 +133,12 @@
|
|||||||
#define SGTTY
|
#define SGTTY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(VXWORKS)
|
||||||
|
#undef TERMIOS
|
||||||
|
#undef TERMIO
|
||||||
|
#undef SGTTY
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef TERMIOS
|
#ifdef TERMIOS
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#define TTY_STRUCT struct termios
|
#define TTY_STRUCT struct termios
|
||||||
@@ -240,7 +246,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
|
|||||||
long status;
|
long status;
|
||||||
unsigned short channel = 0;
|
unsigned short channel = 0;
|
||||||
#else
|
#else
|
||||||
#ifndef MSDOS
|
#if !defined(MSDOS) && !defined(VXWORKS)
|
||||||
TTY_STRUCT tty_orig,tty_new;
|
TTY_STRUCT tty_orig,tty_new;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -268,7 +274,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
|
|||||||
#ifdef MSDOS
|
#ifdef MSDOS
|
||||||
if ((tty=fopen("con","r")) == NULL)
|
if ((tty=fopen("con","r")) == NULL)
|
||||||
tty=stdin;
|
tty=stdin;
|
||||||
#elif defined(MAC_OS_pre_X)
|
#elif defined(MAC_OS_pre_X) || defined(VXWORKS)
|
||||||
tty=stdin;
|
tty=stdin;
|
||||||
#else
|
#else
|
||||||
#ifndef MPE
|
#ifndef MPE
|
||||||
|
|||||||
@@ -75,7 +75,11 @@ int RAND_egd_bytes(const char *path,int bytes)
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#ifndef NO_SYS_UN_H
|
#ifndef NO_SYS_UN_H
|
||||||
#include <sys/un.h>
|
# ifdef VXWORKS
|
||||||
|
# include <streams/un.h>
|
||||||
|
# else
|
||||||
|
# include <sys/un.h>
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
struct sockaddr_un {
|
struct sockaddr_un {
|
||||||
short sun_family; /* AF_UNIX */
|
short sun_family; /* AF_UNIX */
|
||||||
|
|||||||
@@ -101,9 +101,14 @@ typedef struct rsa_meth_st
|
|||||||
* compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER
|
* compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER
|
||||||
* option is set in 'flags'.
|
* option is set in 'flags'.
|
||||||
*/
|
*/
|
||||||
int (*rsa_sign)(int type, unsigned char *m, unsigned int m_len,
|
|
||||||
|
/* changed m_len to m_length to avoid a conflict with a #define in
|
||||||
|
vxworks for m_len for the mbuf code. This only shows up in apps
|
||||||
|
that have USE_SOCKETS defined */
|
||||||
|
|
||||||
|
int (*rsa_sign)(int type, unsigned char *m, unsigned int m_length,
|
||||||
unsigned char *sigret, unsigned int *siglen, RSA *rsa);
|
unsigned char *sigret, unsigned int *siglen, RSA *rsa);
|
||||||
int (*rsa_verify)(int dtype, unsigned char *m, unsigned int m_len,
|
int (*rsa_verify)(int dtype, unsigned char *m, unsigned int m_length,
|
||||||
unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
|
unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
|
||||||
|
|
||||||
} RSA_METHOD;
|
} RSA_METHOD;
|
||||||
@@ -226,16 +231,16 @@ RSA *d2i_Netscape_RSA_2(RSA **a, unsigned char **pp, long length, int (*cb)());
|
|||||||
|
|
||||||
/* The following 2 functions sign and verify a X509_SIG ASN1 object
|
/* The following 2 functions sign and verify a X509_SIG ASN1 object
|
||||||
* inside PKCS#1 padded RSA encryption */
|
* inside PKCS#1 padded RSA encryption */
|
||||||
int RSA_sign(int type, unsigned char *m, unsigned int m_len,
|
int RSA_sign(int type, unsigned char *m, unsigned int m_length,
|
||||||
unsigned char *sigret, unsigned int *siglen, RSA *rsa);
|
unsigned char *sigret, unsigned int *siglen, RSA *rsa);
|
||||||
int RSA_verify(int type, unsigned char *m, unsigned int m_len,
|
int RSA_verify(int type, unsigned char *m, unsigned int m_length,
|
||||||
unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
|
unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
|
||||||
|
|
||||||
/* The following 2 function sign and verify a ASN1_OCTET_STRING
|
/* The following 2 function sign and verify a ASN1_OCTET_STRING
|
||||||
* object inside PKCS#1 padded RSA encryption */
|
* object inside PKCS#1 padded RSA encryption */
|
||||||
int RSA_sign_ASN1_OCTET_STRING(int type, unsigned char *m, unsigned int m_len,
|
int RSA_sign_ASN1_OCTET_STRING(int type, unsigned char *m, unsigned int m_length,
|
||||||
unsigned char *sigret, unsigned int *siglen, RSA *rsa);
|
unsigned char *sigret, unsigned int *siglen, RSA *rsa);
|
||||||
int RSA_verify_ASN1_OCTET_STRING(int type, unsigned char *m, unsigned int m_len,
|
int RSA_verify_ASN1_OCTET_STRING(int type, unsigned char *m, unsigned int m_length,
|
||||||
unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
|
unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
|
||||||
|
|
||||||
int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
|
int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
|
||||||
|
|||||||
@@ -67,9 +67,11 @@
|
|||||||
|
|
||||||
#ifndef MSDOS
|
#ifndef MSDOS
|
||||||
# ifndef WIN32
|
# ifndef WIN32
|
||||||
|
# ifndef VXWORKS
|
||||||
# if !defined(VMS) || defined(__DECC)
|
# if !defined(VMS) || defined(__DECC)
|
||||||
# define TIMES
|
# define TIMES
|
||||||
# endif
|
# endif
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -95,7 +97,7 @@
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TIMES
|
#if !defined(TIMES) && !defined(VXWORKS)
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -125,7 +127,11 @@ typedef struct ms_tm
|
|||||||
HANDLE thread_id;
|
HANDLE thread_id;
|
||||||
FILETIME ms_win32;
|
FILETIME ms_win32;
|
||||||
# else
|
# else
|
||||||
|
# ifdef VXWORKS
|
||||||
|
unsigned long ticks;
|
||||||
|
# else
|
||||||
struct timeb ms_timeb;
|
struct timeb ms_timeb;
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
} MS_TM;
|
} MS_TM;
|
||||||
@@ -163,7 +169,11 @@ void ms_time_get(char *a)
|
|||||||
# ifdef WIN32
|
# ifdef WIN32
|
||||||
GetThreadTimes(tm->thread_id,&tmpa,&tmpb,&tmpc,&(tm->ms_win32));
|
GetThreadTimes(tm->thread_id,&tmpa,&tmpb,&tmpc,&(tm->ms_win32));
|
||||||
# else
|
# else
|
||||||
|
# ifdef VXWORKS
|
||||||
|
tm->ticks = tickGet();
|
||||||
|
# else
|
||||||
ftime(&tm->ms_timeb);
|
ftime(&tm->ms_timeb);
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -193,10 +203,14 @@ double ms_time_diff(char *ap, char *bp)
|
|||||||
ret=((double)(lb-la))/1e7;
|
ret=((double)(lb-la))/1e7;
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
|
# ifdef VXWORKS
|
||||||
|
ret = (double)(b->ticks - a->ticks) / (double)sysClkRateGet();
|
||||||
|
# else
|
||||||
ret= (double)(b->ms_timeb.time-a->ms_timeb.time)+
|
ret= (double)(b->ms_timeb.time-a->ms_timeb.time)+
|
||||||
(((double)b->ms_timeb.millitm)-
|
(((double)b->ms_timeb.millitm)-
|
||||||
((double)a->ms_timeb.millitm))/1000.0;
|
((double)a->ms_timeb.millitm))/1000.0;
|
||||||
# endif
|
# endif
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
return((ret < 0.0000001)?0.0000001:ret);
|
return((ret < 0.0000001)?0.0000001:ret);
|
||||||
}
|
}
|
||||||
@@ -214,6 +228,9 @@ int ms_time_cmp(char *ap, char *bp)
|
|||||||
d =(b->ms_win32.dwHighDateTime&0x000fffff)*10+b->ms_win32.dwLowDateTime/1e7;
|
d =(b->ms_win32.dwHighDateTime&0x000fffff)*10+b->ms_win32.dwLowDateTime/1e7;
|
||||||
d-=(a->ms_win32.dwHighDateTime&0x000fffff)*10+a->ms_win32.dwLowDateTime/1e7;
|
d-=(a->ms_win32.dwHighDateTime&0x000fffff)*10+a->ms_win32.dwLowDateTime/1e7;
|
||||||
# else
|
# else
|
||||||
|
# ifdef VXWORKS
|
||||||
|
d = (b->ticks - a->ticks);
|
||||||
|
# else
|
||||||
d= (double)(b->ms_timeb.time-a->ms_timeb.time)+
|
d= (double)(b->ms_timeb.time-a->ms_timeb.time)+
|
||||||
(((double)b->ms_timeb.millitm)-(double)a->ms_timeb.millitm)/1000.0;
|
(((double)b->ms_timeb.millitm)-(double)a->ms_timeb.millitm)/1000.0;
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
10
e_os.h
10
e_os.h
@@ -82,6 +82,12 @@ extern "C" {
|
|||||||
#define DEVRANDOM "/dev/urandom"
|
#define DEVRANDOM "/dev/urandom"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(VXWORKS)
|
||||||
|
# define NO_SYS_PARAM_H
|
||||||
|
# define NO_CHMOD
|
||||||
|
# define NO_SYSLOG
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__MWERKS__) && defined(macintosh)
|
#if defined(__MWERKS__) && defined(macintosh)
|
||||||
# if macintosh==1
|
# if macintosh==1
|
||||||
# ifndef MAC_OS_GUSI_SOURCE
|
# ifndef MAC_OS_GUSI_SOURCE
|
||||||
@@ -348,7 +354,9 @@ extern HINSTANCE _hInstance;
|
|||||||
# ifndef NO_SYS_PARAM_H
|
# ifndef NO_SYS_PARAM_H
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
# endif
|
# endif
|
||||||
# ifndef MPE
|
# ifdef VXWORKS
|
||||||
|
# include <time.h>
|
||||||
|
# elif !defined(MPE)
|
||||||
# include <sys/time.h> /* Needed under linux for FD_XXX */
|
# include <sys/time.h> /* Needed under linux for FD_XXX */
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user