From: Andy Polyakov Date: Mon, 11 May 2015 09:56:30 +0000 (+0200) Subject: Additional vxWorks target. X-Git-Tag: OpenSSL-fips-2_0_10~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=50e2a0ea4615124aa159e8f43317dedcf0cfcaa2;p=oweals%2Fopenssl.git Additional vxWorks target. Reviewed-by: Dr. Stephen Henson --- diff --git a/Configure b/Configure index 1959f98c67..f51f721428 100755 --- a/Configure +++ b/Configure @@ -605,6 +605,7 @@ my %table=( ##### 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-ppcgen-kernel","ccppc:-D_REENTRANT -msoft-float -mstrict-align -O1 -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/h -I\$(WIND_BASE)/target/h/wrn/coreip:::VXWORKS::::::", "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 db5fc82bcb..07e2317392 100755 --- a/config +++ b/config @@ -383,6 +383,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in echo "nsr-tandem-nsk"; exit 0; ;; + vxworks:kernel*) + echo "${MACHINE}-kernel-vxworks"; exit 0; + ;; + vxworks*) echo "${MACHINE}-whatever-vxworks"; exit 0; ;; @@ -613,6 +617,7 @@ case "$GUESSOS" in ;; ppc-*-linux2) OUT="linux-ppc" ;; ppc60x-*-vxworks*) OUT="vxworks-ppc60x" ;; + ppcgen-kernel-vxworks*) OUT="vxworks-ppcgen-kernel" ;; ppcgen-*-vxworks*) OUT="vxworks-ppcgen" ;; pentium-*-vxworks*) OUT="vxworks-pentium" ;; simlinux-*-vxworks*) OUT="vxworks-simlinux" ;; diff --git a/test/fips_algvs.c b/test/fips_algvs.c index d47fb27dcc..170295f0b3 100644 --- a/test/fips_algvs.c +++ b/test/fips_algvs.c @@ -70,6 +70,67 @@ int main(int argc, char **argv) } #else +#if defined(__vxworks) + +#include +#include + +int fips_algvs_main(int argc, char **argv); +#define main fips_algvs_main + +static int fips_algvs_argv(char *a0) +{ + char *argv[32] = { "fips_algvs" }; + int argc = 1; + int main_ret; + + if (a0) { + char *scan = a0, *arg = a0; + + while (*scan) { + if (*scan++ == ' ') { + scan[-1] = '\0'; + argv[argc++] = arg; + if (argc == (sizeof(argv)/sizeof(argv[0])-1)) + break; + + while (*scan == ' ') scan++; + arg = scan; + } + } + if (*scan == '\0') argv[argc++] = arg; + } + + argv[argc] = NULL; + + main_ret = fips_algvs_main(argc, argv); + + if (a0) free(a0); + + return main_ret; +} + +int fips_algvs(int a0) +{ + return taskSpawn("fips_algvs", 100, (VX_FP_TASK | VX_SPE_TASK), 100000, + (FUNCPTR)fips_algvs_argv, + a0 ? strdup(a0) : 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); +} + +static FILE *fips_fopen(const char *path, const char *mode) +{ + char fips_path [256]; + + if (path[0] != '/' && strlen(path) < (sizeof(fips_path)-8)) { + strcpy(fips_path,"/fips0/"); + strcat(fips_path,path); + return fopen(fips_path,mode); + } + return fopen(path,mode); +} +#define fopen fips_fopen +#endif + #define FIPS_ALGVS extern int fips_aesavs_main(int argc, char **argv);