diff --git a/src/RTEMS/base/Makefile b/src/RTEMS/base/Makefile index 8ece8ef9d..6f3067621 100644 --- a/src/RTEMS/base/Makefile +++ b/src/RTEMS/base/Makefile @@ -5,6 +5,7 @@ SRCS += rtems_init.c SRCS += rtems_config.c SRCS += rtems_netconfig.c SRCS += rtems_util.c +SRCS += rtems_dummyreg.c LIBRARY_RTEMS = rtemsCom LIBRARY_SRCS = $(SRCS) $(BUILD_ARCHS) diff --git a/src/RTEMS/base/rtems_dummyreg.c b/src/RTEMS/base/rtems_dummyreg.c new file mode 100644 index 000000000..5b2ecf18d --- /dev/null +++ b/src/RTEMS/base/rtems_dummyreg.c @@ -0,0 +1,11 @@ +/* + * Provide a dummy version of iocshRegister to be used with test applications. + */ + +#include + +void +iocshRegister(const iocshFuncDef *piocshFuncDef, iocshCallFunc func) +{ + printf ("No iocsh -- %s not registered\n", piocshFuncDef->name); +} diff --git a/src/RTEMS/base/rtems_init.c b/src/RTEMS/base/rtems_init.c index ff6dea1a8..e46c56f56 100644 --- a/src/RTEMS/base/rtems_init.c +++ b/src/RTEMS/base/rtems_init.c @@ -145,21 +145,13 @@ static void stackCheckCallFunc(const iocshArgBuf *args) Stack_check_Dump_usage (); } +/* + * Register RTEMS-specific commands + */ static void iocshRegisterRTEMS (void) { - /* - * By using a weak reference this code will work with full IOC applications - * (where iocshRegister is present) and also with test applications - * (where iocshRegister is not present). - */ - extern void iocshRegister(const iocshFuncDef *piocshFuncDef, - iocshCallFunc func) __attribute__((weak)) ; - void (*rtemsEpicsIocshRegisterFunc)(const iocshFuncDef *piocshFuncDef, - iocshCallFunc func) = iocshRegister; - if (!rtemsEpicsIocshRegisterFunc) - return; - (*rtemsEpicsIocshRegisterFunc)(&netStatFuncDef, netStatCallFunc); - (*rtemsEpicsIocshRegisterFunc)(&stackCheckFuncDef, stackCheckCallFunc); + iocshRegister(&netStatFuncDef, netStatCallFunc); + iocshRegister(&stackCheckFuncDef, stackCheckCallFunc); } /*