diff --git a/src/libvxWorks/Makefile.Vx b/src/libvxWorks/Makefile.Vx index bbb1f159f..91d040718 100644 --- a/src/libvxWorks/Makefile.Vx +++ b/src/libvxWorks/Makefile.Vx @@ -10,7 +10,8 @@ ifeq ($(strip $(TORNADO)),NO) SRCS.c += ../ldpp.c endif -LIBOBJS = veclist.o iocLogClient.o +LIBOBJS = veclist.o iocLogClient.o \ + symFindByNameEPICS.o symFindByNameAndTypeEPICS.o # # Tornado supplies this @@ -19,9 +20,6 @@ ifeq ($(strip $(TORNADO)),NO) LIBOBJS += ldpp.o endif -LIBOBJS_mips = symFindByNameMips.o - - LIBNAME = vxComLib # diff --git a/src/libvxWorks/symFindByNameAndTypeEPICS.c b/src/libvxWorks/symFindByNameAndTypeEPICS.c new file mode 100644 index 000000000..74cf09026 --- /dev/null +++ b/src/libvxWorks/symFindByNameAndTypeEPICS.c @@ -0,0 +1,35 @@ +/* $Id$ + * + * On various RISC processors (at least MIPS and PPC), symbols do not have + * the prepended underscore. Here we redefine symFindByNameAndType so that, + * if the name lookup fails and if the first character of the name is "_", + * the lookup is repeated starting at the second character of the name string. + * + * 01a,03jun98,wfl created (from symFindByNameEPICS.c). + */ + +#ifdef symFindByNameAndType +#undef symFindByNameAndType +#endif + +#include "vxWorks.h" +#include "symLib.h" + +STATUS symFindByNameAndTypeEPICS( SYMTAB_ID symTblId, + char *name, + char **pvalue, + SYM_TYPE *pType, + SYM_TYPE sType, + SYM_TYPE mask ) +{ + STATUS status; + + status = symFindByNameAndType( symTblId, name, pvalue, + pType, sType, mask ); + + if ( status == ERROR && name[0] == '_' ) + status = symFindByNameAndType( symTblId, (name+1), pvalue, + pType, sType, mask ); + + return status; +} diff --git a/src/libvxWorks/symFindByNameEPICS.c b/src/libvxWorks/symFindByNameEPICS.c new file mode 100644 index 000000000..7dc3b38f0 --- /dev/null +++ b/src/libvxWorks/symFindByNameEPICS.c @@ -0,0 +1,38 @@ +/* $Id$ + * + * Comments from original version: + * On the MIPS processor, all symbols do not have the prepended underscore. + * Here we redefine symFindByName to look at the second character of the + * name string. + * + * On various RISC processors (at least MIPS and PPC), symbols do not have + * the prepended underscore. Here we redefine symFindByName so that, if the + * name lookup fails and if the first character of the name is "_", the + * lookup is repeated starting at the second character of the name string. + * + * 01a,08apr97,bdg created. + * 02a,03apr97,npr changed from mips.h into symFindByNameMips.c + * 03a,03jun98,wfl changed Mips -> EPICS and avoid architecture knowledge + */ + +#ifdef symFindByName +#undef symFindByName +#endif + +#include "vxWorks.h" +#include "symLib.h" + +STATUS symFindByNameEPICS( SYMTAB_ID symTblId, + char *name, + char **pvalue, + SYM_TYPE *pType ) +{ + STATUS status; + + status = symFindByName( symTblId, name, pvalue, pType ); + + if ( status == ERROR && name[0] == '_' ) + status = symFindByName( symTblId, (name+1), pvalue, pType ); + + return status; +} diff --git a/src/libvxWorks/symFindByNameMips.c b/src/libvxWorks/symFindByNameMips.c deleted file mode 100644 index cbbcd8eef..000000000 --- a/src/libvxWorks/symFindByNameMips.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This file is included in to change the VxWorks function symFindByName(). - * On the MIPS processor, all symbols do not have the prepended underscore. - * Here we redefine symFindByName to look at the second character of the - * name string. - * - * 01a,08apr97,bdg created. - * 02a,03apr97,npr changed from mips.h into symFindByNameMips.c - */ - -#ifdef symFindByName -#undef symFindByName -#endif - -#include "vxWorks.h" -#include "symLib.h" - -STATUS symFindByNameMips( SYMTAB_ID symTblId, - char *name, - char **pvalue, - SYM_TYPE *pType ) -{ - return symFindByName(symTblId, (name+1), pvalue, pType ); -}