From 62d035c3109cca06496119a4faefb3f1b8daa087 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 25 May 2010 13:58:42 +0100 Subject: [PATCH] [PATCH 01/12] add jumping VME interrupt routines to independent implementation Adds implementations which use the virtual os table to invoke the OS specific call. rename conflicting functions --- src/libCom/osi/devLib.c | 62 +++++++++++++++++++++++++++ src/libCom/osi/os/RTEMS/devLibOSD.c | 26 ++++++++--- src/libCom/osi/os/vxWorks/devLibOSD.c | 28 +++++++++--- 3 files changed, 103 insertions(+), 13 deletions(-) diff --git a/src/libCom/osi/devLib.c b/src/libCom/osi/devLib.c index 8e03f86d9..6e2f44bbd 100644 --- a/src/libCom/osi/devLib.c +++ b/src/libCom/osi/devLib.c @@ -907,6 +907,68 @@ long devNoResponseProbe (epicsAddressType addrType, return SUCCESS; } +long devConnectInterruptVME( +unsigned vectorNumber, +void (*pFunction)(void *), +void *parameter ) +{ + long status; + + if (!devLibInitFlag) { + status = devLibInit(); + if (status) { + return status; + } + } + + return (*pdevLibVirtualOS->pDevConnectInterruptVME) (vectorNumber, + pFunction, parameter); +} + +long devDisconnectInterruptVME( +unsigned vectorNumber, +void (*pFunction)(void *) ) +{ + long status; + + if (!devLibInitFlag) { + status = devLibInit(); + if (status) { + return status; + } + } + + return (*pdevLibVirtualOS->pDevDisconnectInterruptVME) (vectorNumber, pFunction); +} + +long devEnableInterruptLevelVME (unsigned level) +{ + long status; + + if (!devLibInitFlag) { + status = devLibInit(); + if (status) { + return status; + } + } + + return (*pdevLibVirtualOS->pDevEnableInterruptLevelVME) (level); +} + +long devDisableInterruptLevelVME (unsigned level) +{ + long status; + + if (!devLibInitFlag) { + status = devLibInit(); + if (status) { + return status; + } + } + + return (*pdevLibVirtualOS->pDevDisableInterruptLevelVME) (level); +} + /* * devConnectInterrupt () * diff --git a/src/libCom/osi/os/RTEMS/devLibOSD.c b/src/libCom/osi/os/RTEMS/devLibOSD.c index 633736d24..5f8ceb9ad 100644 --- a/src/libCom/osi/os/RTEMS/devLibOSD.c +++ b/src/libCom/osi/os/RTEMS/devLibOSD.c @@ -87,6 +87,20 @@ long rtmsDevReadProbe (unsigned wordSize, volatile const void *ptr, void *pValue */ long rtmsDevWriteProbe (unsigned wordSize, volatile void *ptr, const void *pValue); +static long rtmsDevConnectInterruptVME ( + unsigned vectorNumber, + void (*pFunction)(), + void *parameter); + +static long rtmsDevDisconnectInterruptVME ( + unsigned vectorNumber, + void (*pFunction)() +); + +static long rtmsDevEnableInterruptLevelVME (unsigned level); + +static long rtmsDevDisableInterruptLevelVME (unsigned level); + /* RTEMS specific init */ /*devA24Malloc and devA24Free are not implemented*/ @@ -99,8 +113,8 @@ static long rtmsDevInit(void); */ static devLibVirtualOS rtemsVirtualOS = { rtmsDevMapAddr, rtmsDevReadProbe, rtmsDevWriteProbe, - devConnectInterruptVME, devDisconnectInterruptVME, - devEnableInterruptLevelVME, devDisableInterruptLevelVME, + rtmsDevConnectInterruptVME, rtmsDevDisconnectInterruptVME, + rtmsDevEnableInterruptLevelVME, rtmsDevDisableInterruptLevelVME, devA24Malloc,devA24Free,rtmsDevInit }; devLibVirtualOS *pdevLibVirtualOS = &rtemsVirtualOS; @@ -119,7 +133,7 @@ rtmsDevInit(void) * * wrapper to minimize driver dependency on OS */ -long devConnectInterruptVME ( +static long rtmsDevConnectInterruptVME ( unsigned vectorNumber, void (*pFunction)(), void *parameter) @@ -152,7 +166,7 @@ long devConnectInterruptVME ( * an interrupt handler that was installed by another driver * */ -long devDisconnectInterruptVME ( +static long rtmsDevDisconnectInterruptVME ( unsigned vectorNumber, void (*pFunction)() ) @@ -188,7 +202,7 @@ long devDisconnectInterruptVME ( /* * enable VME interrupt level */ -long devEnableInterruptLevelVME (unsigned level) +static long rtmsDevEnableInterruptLevelVME (unsigned level) { return BSP_enableVME_int_lvl(level); } @@ -196,7 +210,7 @@ long devEnableInterruptLevelVME (unsigned level) /* * disable VME interrupt level */ -long devDisableInterruptLevelVME (unsigned level) +static long rtmsDevDisableInterruptLevelVME (unsigned level) { return BSP_disableVME_int_lvl(level); } diff --git a/src/libCom/osi/os/vxWorks/devLibOSD.c b/src/libCom/osi/os/vxWorks/devLibOSD.c index 871045fb6..28a32c660 100644 --- a/src/libCom/osi/os/vxWorks/devLibOSD.c +++ b/src/libCom/osi/os/vxWorks/devLibOSD.c @@ -114,13 +114,27 @@ static void *devA24Malloc(size_t size); static void devA24Free(void *pBlock); static long devInit(void) { return 0;} +static long vxDevConnectInterruptVME ( + unsigned vectorNumber, + void (*pFunction)(), + void *parameter); + +static long vxDevDisconnectInterruptVME ( + unsigned vectorNumber, + void (*pFunction)() +); + +static long vxDevEnableInterruptLevelVME (unsigned level); + +static long vxDevDisableInterruptLevelVME (unsigned level); + /* * used by dynamic bind in devLib.c */ static devLibVirtualOS vxVirtualOS = { vxDevMapAddr, vxDevReadProbe, vxDevWriteProbe, - devConnectInterruptVME, devDisconnectInterruptVME, - devEnableInterruptLevelVME, devDisableInterruptLevelVME, + vxDevConnectInterruptVME, vxDevDisconnectInterruptVME, + vxDevEnableInterruptLevelVME, vxDevDisableInterruptLevelVME, devA24Malloc,devA24Free,devInit }; devLibVirtualOS *pdevLibVirtualOS = &vxVirtualOS; @@ -130,7 +144,7 @@ devLibVirtualOS *pdevLibVirtualOS = &vxVirtualOS; * * wrapper to minimize driver dependency on vxWorks */ -long devConnectInterruptVME ( +static long vxDevConnectInterruptVME ( unsigned vectorNumber, void (*pFunction)(), void *parameter) @@ -154,7 +168,7 @@ long devConnectInterruptVME ( /* * - * devDisconnectInterruptVME() + * vxDevDisconnectInterruptVME() * * wrapper to minimize driver dependency on vxWorks * @@ -163,7 +177,7 @@ long devConnectInterruptVME ( * an interrupt handler that was installed by another driver * */ -long devDisconnectInterruptVME ( +static long vxDevDisconnectInterruptVME ( unsigned vectorNumber, void (*pFunction)() ) @@ -198,7 +212,7 @@ long devDisconnectInterruptVME ( /* * enable VME interrupt level */ -long devEnableInterruptLevelVME (unsigned level) +static long vxDevEnableInterruptLevelVME (unsigned level) { # if CPU_FAMILY != I80X86 int s; @@ -250,7 +264,7 @@ long devDisableInterruptLevelISA (unsigned level) /* * disable VME interrupt level */ -long devDisableInterruptLevelVME (unsigned level) +static long vxDevDisableInterruptLevelVME (unsigned level) { # if CPU_FAMILY != I80X86 int s;