[PATCH 02/12] add devInterruptInUseVME to function table

Add test for interrupt handler function to the virtual os table.
Adds a stub implementation to devLib.c
Renames OS implementations functions for RTEMS and vxWorks to avoid symbol name conflicts
This commit is contained in:
Michael Davidsaver
2010-05-25 13:58:43 +01:00
committed by Michael Davidsaver
parent 62d035c310
commit acb905fcfc
4 changed files with 27 additions and 4 deletions

View File

@@ -941,6 +941,20 @@ void (*pFunction)(void *) )
return (*pdevLibVirtualOS->pDevDisconnectInterruptVME) (vectorNumber, pFunction);
}
int devInterruptInUseVME (unsigned level)
{
long status;
if (!devLibInitFlag) {
status = devLibInit();
if (status) {
return status;
}
}
return (*pdevLibVirtualOS->pDevInterruptInUseVME) (level);
}
long devEnableInterruptLevelVME (unsigned level)
{
long status;

View File

@@ -330,6 +330,11 @@ typedef struct devLibVirtualOS {
void *(*pDevA24Malloc)(size_t nbytes);
void (*pDevA24Free)(void *pBlock);
long (*pDevInit)(void);
/*
* test if VME interrupt has an ISR connected
*/
int (*pDevInterruptInUseVME) (unsigned vectorNumber);
}devLibVirtualOS;
epicsShareExtern devLibVirtualOS *pdevLibVirtualOS;

View File

@@ -101,6 +101,8 @@ static long rtmsDevEnableInterruptLevelVME (unsigned level);
static long rtmsDevDisableInterruptLevelVME (unsigned level);
static int rtemsDevInterruptInUseVME (unsigned vectorNumber);
/* RTEMS specific init */
/*devA24Malloc and devA24Free are not implemented*/
@@ -115,7 +117,7 @@ static devLibVirtualOS rtemsVirtualOS = {
rtmsDevMapAddr, rtmsDevReadProbe, rtmsDevWriteProbe,
rtmsDevConnectInterruptVME, rtmsDevDisconnectInterruptVME,
rtmsDevEnableInterruptLevelVME, rtmsDevDisableInterruptLevelVME,
devA24Malloc,devA24Free,rtmsDevInit
devA24Malloc,devA24Free,rtmsDevInit,rtemsDevInterruptInUseVME
};
devLibVirtualOS *pdevLibVirtualOS = &rtemsVirtualOS;
@@ -296,7 +298,7 @@ static myISR *isrFetch(unsigned vectorNumber, void **parg)
/*
* determine if a VME interrupt vector is in use
*/
int devInterruptInUseVME (unsigned vectorNumber)
static int rtemsDevInterruptInUseVME (unsigned vectorNumber)
{
int i;
myISR *psub;

View File

@@ -128,6 +128,8 @@ static long vxDevEnableInterruptLevelVME (unsigned level);
static long vxDevDisableInterruptLevelVME (unsigned level);
static int vxDevInterruptInUseVME (unsigned vectorNumber);
/*
* used by dynamic bind in devLib.c
*/
@@ -135,7 +137,7 @@ static devLibVirtualOS vxVirtualOS = {
vxDevMapAddr, vxDevReadProbe, vxDevWriteProbe,
vxDevConnectInterruptVME, vxDevDisconnectInterruptVME,
vxDevEnableInterruptLevelVME, vxDevDisableInterruptLevelVME,
devA24Malloc,devA24Free,devInit
devA24Malloc,devA24Free,devInit,vxDevInterruptInUseVME
};
devLibVirtualOS *pdevLibVirtualOS = &vxVirtualOS;
@@ -373,7 +375,7 @@ static myISR *isrFetch(unsigned vectorNumber)
/*
* determine if a VME interrupt vector is in use
*/
int devInterruptInUseVME (unsigned vectorNumber)
static int vxDevInterruptInUseVME (unsigned vectorNumber)
{
#if CPU_FAMILY == PPC
return FALSE;