Add some routines to make porting from vxWorks a little easier.

I'm a little leery about my quick hack for rebootHookAdd() since the
argument to the 'hooked' function is different.
This commit is contained in:
W. Eric Norum
2004-11-11 22:06:52 +00:00
parent 3449a7157a
commit 98641bcfd2
2 changed files with 27 additions and 1 deletions

View File

@@ -29,6 +29,7 @@
#define INCdevLibh 1
#include <dbDefs.h>
#include <osdVME.h>
#ifdef __cplusplus
extern "C" {
@@ -423,6 +424,11 @@ long devDisableInterruptLevel (epicsInterruptType intType, unsigned level);
*/
long locationProbe (epicsAddressType addrType, char *pLocation);
/*
* Some vxWorks convenience routines
*/
void bcopyLongs(char *source, char *destination, int nlongs);
#ifdef __cplusplus
}
#endif

View File

@@ -14,8 +14,10 @@
*
*/
#include <epicsStdio.h>
#include <epicsExit.h>
#if defined(__PPC__) && defined(mpc750)
#if defined(__PPC__) /* && defined(mpc750) */
#include <rtems.h>
#include <bsp.h>
@@ -322,3 +324,21 @@ void unsolicitedHandlerEPICS(int vectorNumber)
}
#endif /* defined(__PPC__) && defined(mpc750) */
/*
* Some vxWorks convenience routines
*/
void
bcopyLongs(char *source, char *destination, int nlongs)
{
const long *s = (long *)source;
long *d = (long *)destination;
while(nlongs--)
*d++ = *s++;
}
void
rebootHookAdd(void (*funptr)())
{
epicsAtExit(funptr,NULL);
}