diff --git a/src/libvxWorks/Makefile.Vx b/src/libvxWorks/Makefile.Vx index 91d040718..5e3f7ce94 100644 --- a/src/libvxWorks/Makefile.Vx +++ b/src/libvxWorks/Makefile.Vx @@ -1,7 +1,10 @@ TOP = ../../.. include $(TOP)/config/CONFIG_BASE -SRCS.c = ../iocLogClient.c ../veclist.c +SRCS.c = ../iocLogClient.c ../veclist.c \ + ../epicsDynLink.c + +INC += epicsDynLink.h # # Tornado supplies this @@ -11,7 +14,7 @@ SRCS.c += ../ldpp.c endif LIBOBJS = veclist.o iocLogClient.o \ - symFindByNameEPICS.o symFindByNameAndTypeEPICS.o + epicsDynLink.o # # Tornado supplies this diff --git a/src/libvxWorks/epicsDynLink.h b/src/libvxWorks/epicsDynLink.h new file mode 100644 index 000000000..77ed6b40b --- /dev/null +++ b/src/libvxWorks/epicsDynLink.h @@ -0,0 +1,33 @@ + +/* + * These routines will eventually need to be made OS independent + * (currently this is vxWorks specific) + */ + +#ifndef epicsDynLinkh +#define epicsDynLinkh + +#ifdef symFindByName +#undef symFindByName +#endif + +#include "vxWorks.h" +#include "symLib.h" +#include "sysSymTbl.h" + +STATUS symFindByNameEPICS( + SYMTAB_ID symTblId, + char *name, + char **pvalue, + SYM_TYPE *pType); + +STATUS symFindByNameAndTypeEPICS( + SYMTAB_ID symTblId, + char *name, + char **pvalue, + SYM_TYPE *pType, + SYM_TYPE sType, + SYM_TYPE mask); + +#endif /* ifdef epicsDynLinkh */ + diff --git a/src/libvxWorks/symFindByNameEPICS.c b/src/libvxWorks/epicsdynlink.c similarity index 68% rename from src/libvxWorks/symFindByNameEPICS.c rename to src/libvxWorks/epicsdynlink.c index 7dc3b38f0..af7f12aa2 100644 --- a/src/libvxWorks/symFindByNameEPICS.c +++ b/src/libvxWorks/epicsdynlink.c @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id $ * * Comments from original version: * On the MIPS processor, all symbols do not have the prepended underscore. @@ -14,13 +14,8 @@ * 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" + +#include "epicsDynLink.h" STATUS symFindByNameEPICS( SYMTAB_ID symTblId, char *name, @@ -36,3 +31,23 @@ STATUS symFindByNameEPICS( SYMTAB_ID symTblId, return status; } + +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; +} \ No newline at end of file diff --git a/src/libvxWorks/symFindByNameAndTypeEPICS.c b/src/libvxWorks/symFindByNameAndTypeEPICS.c deleted file mode 100644 index 74cf09026..000000000 --- a/src/libvxWorks/symFindByNameAndTypeEPICS.c +++ /dev/null @@ -1,35 +0,0 @@ -/* $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/vxWorks/libvxWorks/epicsDynLink.h b/src/vxWorks/libvxWorks/epicsDynLink.h new file mode 100644 index 000000000..77ed6b40b --- /dev/null +++ b/src/vxWorks/libvxWorks/epicsDynLink.h @@ -0,0 +1,33 @@ + +/* + * These routines will eventually need to be made OS independent + * (currently this is vxWorks specific) + */ + +#ifndef epicsDynLinkh +#define epicsDynLinkh + +#ifdef symFindByName +#undef symFindByName +#endif + +#include "vxWorks.h" +#include "symLib.h" +#include "sysSymTbl.h" + +STATUS symFindByNameEPICS( + SYMTAB_ID symTblId, + char *name, + char **pvalue, + SYM_TYPE *pType); + +STATUS symFindByNameAndTypeEPICS( + SYMTAB_ID symTblId, + char *name, + char **pvalue, + SYM_TYPE *pType, + SYM_TYPE sType, + SYM_TYPE mask); + +#endif /* ifdef epicsDynLinkh */ +