diff --git a/src/libCom/Makefile b/src/libCom/Makefile index 3d251f35c..01e517080 100644 --- a/src/libCom/Makefile +++ b/src/libCom/Makefile @@ -192,6 +192,7 @@ INC += epicsStdioRedirect.h INC += epicsGetopt.h INC += devLib.h +INC += devLibImpl.h INC += osdVME.h SRCS += epicsThread.cpp diff --git a/src/libCom/osi/devLib.c b/src/libCom/osi/devLib.c index 6a8aa68e6..f56c63968 100644 --- a/src/libCom/osi/devLib.c +++ b/src/libCom/osi/devLib.c @@ -29,7 +29,10 @@ static const char sccsID[] = "@(#) $Id$"; #include "epicsMutex.h" #include "errlog.h" #include "ellLib.h" + +#define NO_DEVLIB_COMPAT #include "devLib.h" +#include "devLibImpl.h" static ELLLIST addrAlloc[atLast]; static ELLLIST addrFree[atLast]; diff --git a/src/libCom/osi/devLib.h b/src/libCom/osi/devLib.h index 2cd2471e8..d0f444fc3 100644 --- a/src/libCom/osi/devLib.h +++ b/src/libCom/osi/devLib.h @@ -46,6 +46,21 @@ typedef enum { */ extern const char *epicsAddressTypeName[]; +#ifdef __cplusplus +} +#endif + +/* + * To retain compatibility include everything by default + */ +#ifndef NO_DEVLIB_COMPAT +# include "devLibImpl.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + epicsShareFunc long devAddressMap(void); /* print an address map */ /* @@ -280,64 +295,6 @@ epicsShareFunc void devLibA24Free(void *pBlock); */ #define devPtrAlignTest(PTR) (!(devCreateAlignmentMask(*PTR)&(long)(PTR))) -/* - * virtual OS layer for devLib.c - */ -typedef struct devLibVirtualOS { - /* - * maps logical address to physical address, but does not detect - * two device drivers that are using the same address range - */ - long (*pDevMapAddr) (epicsAddressType addrType, unsigned options, - size_t logicalAddress, size_t size, volatile void **ppPhysicalAddress); - - /* - * a bus error safe "wordSize" read at the specified address which returns - * unsuccessful status if the device isnt present - */ - long (*pDevReadProbe) (unsigned wordSize, volatile const void *ptr, void *pValueRead); - - /* - * a bus error safe "wordSize" write at the specified address which returns - * unsuccessful status if the device isnt present - */ - long (*pDevWriteProbe) (unsigned wordSize, volatile void *ptr, const void *pValueWritten); - - /* - * connect ISR to a VME interrupt vector - * (required for backwards compatibility) - */ - long (*pDevConnectInterruptVME) (unsigned vectorNumber, - void (*pFunction)(void *), void *parameter); - - /* - * disconnect ISR from a VME interrupt vector - * (required for backwards compatibility) - */ - long (*pDevDisconnectInterruptVME) (unsigned vectorNumber, - void (*pFunction)(void *)); - - /* - * enable VME interrupt level - */ - long (*pDevEnableInterruptLevelVME) (unsigned level); - - /* - * disable VME interrupt level - */ - long (*pDevDisableInterruptLevelVME) (unsigned level); - /* malloc/free A24 address space */ - 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; - /* * error codes (and messages) associated with devLib.c */ diff --git a/src/libCom/osi/devLibVMEImpl.h b/src/libCom/osi/devLibVMEImpl.h new file mode 100644 index 000000000..775bc3b42 --- /dev/null +++ b/src/libCom/osi/devLibVMEImpl.h @@ -0,0 +1,97 @@ +/*************************************************************************\ +* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne +* National Laboratory. +* Copyright (c) 2002 The Regents of the University of California, as +* Operator of Los Alamos National Laboratory. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ +/* devLibImpl.h */ +/* */ + +/* + * Original Author: Marty Kraimer + * Author: Jeff Hill + * Date: 03-10-93 + */ + +#ifndef INCdevLibImplh +#define INCdevLibImplh 1 + +#include "dbDefs.h" +#include "shareLib.h" +#include "devLib.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * virtual OS layer for devLib.c + * + * The global virtual OS table pdevLibVirtualOS controls + * the behaviour of the functions defined in devLib.h. + * All of which call into the functions found in this table + * to perform system specific tasks. + */ +typedef struct devLibVirtualOS { + /* + * maps logical address to physical address, but does not detect + * two device drivers that are using the same address range + */ + long (*pDevMapAddr) (epicsAddressType addrType, unsigned options, + size_t logicalAddress, size_t size, volatile void **ppPhysicalAddress); + + /* + * a bus error safe "wordSize" read at the specified address which returns + * unsuccessful status if the device isnt present + */ + long (*pDevReadProbe) (unsigned wordSize, volatile const void *ptr, void *pValueRead); + + /* + * a bus error safe "wordSize" write at the specified address which returns + * unsuccessful status if the device isnt present + */ + long (*pDevWriteProbe) (unsigned wordSize, volatile void *ptr, const void *pValueWritten); + + /* + * connect ISR to a VME interrupt vector + * (required for backwards compatibility) + */ + long (*pDevConnectInterruptVME) (unsigned vectorNumber, + void (*pFunction)(void *), void *parameter); + + /* + * disconnect ISR from a VME interrupt vector + * (required for backwards compatibility) + */ + long (*pDevDisconnectInterruptVME) (unsigned vectorNumber, + void (*pFunction)(void *)); + + /* + * enable VME interrupt level + */ + long (*pDevEnableInterruptLevelVME) (unsigned level); + + /* + * disable VME interrupt level + */ + long (*pDevDisableInterruptLevelVME) (unsigned level); + /* malloc/free A24 address space */ + 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; + +#ifdef __cplusplus +} +#endif + +#endif /* INCdevLibImplh */