From e21cde013dfcc1caea7c797f3b076d417056a09b Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 25 May 2010 13:58:45 +0100 Subject: [PATCH] [PATCH 05/12] reorganize devLib.h Group functions by bus type with general functions at the top add macro to exclude deprecated api --- src/libCom/osi/devLib.h | 166 +++++++++++++++++++++++++--------------- 1 file changed, 103 insertions(+), 63 deletions(-) diff --git a/src/libCom/osi/devLib.h b/src/libCom/osi/devLib.h index d0f444fc3..d37d20deb 100644 --- a/src/libCom/osi/devLib.h +++ b/src/libCom/osi/devLib.h @@ -61,6 +61,12 @@ extern const char *epicsAddressTypeName[]; extern "C" { #endif +/* + * General API + * + * This section applies to all bus types + */ + epicsShareFunc long devAddressMap(void); /* print an address map */ /* @@ -128,6 +134,12 @@ epicsShareFunc long devAllocAddress( unsigned alignment, /*n ls bits zero in addr*/ volatile void **pLocalAddress); +/* + * VME API + * + * Functions in this section apply only to the VME bus type + */ + /* * connect ISR to a VME interrupt vector */ @@ -136,28 +148,6 @@ epicsShareFunc long devConnectInterruptVME( void (*pFunction)(void *), void *parameter); -/* - * connect ISR to an ISA interrupt level - * (not implemented) - * (API should be reviewed) - */ -epicsShareFunc long devConnectInterruptISA( - unsigned interruptLevel, - void (*pFunction)(void *), - void *parameter); - -/* - * connect ISR to a PCI interrupt - * (not implemented) - * (API should be reviewed) - */ -epicsShareFunc long devConnectInterruptPCI( - unsigned bus, - unsigned device, - unsigned function, - void (*pFunction)(void *), - void *parameter); - /* * disconnect ISR from a VME interrupt vector * @@ -169,6 +159,47 @@ epicsShareFunc long devDisconnectInterruptVME( unsigned vectorNumber, void (*pFunction)(void *)); +/* + * determine if a VME interrupt vector is in use + * + * returns boolean + */ +epicsShareFunc int devInterruptInUseVME (unsigned vectorNumber); + +/* + * enable VME interrupt level + */ +epicsShareFunc long devEnableInterruptLevelVME (unsigned level); + +/* + * disable VME interrupt level + */ +epicsShareFunc long devDisableInterruptLevelVME (unsigned level); + +/* + * Routines to allocate and free memory in the A24 memory region. + * + */ +epicsShareFunc void *devLibA24Malloc(size_t); +epicsShareFunc void *devLibA24Calloc(size_t); +epicsShareFunc void devLibA24Free(void *pBlock); + +/* + * ISA API + * + * Functions in this section apply only to the ISA bus type + */ + +/* + * connect ISR to an ISA interrupt level + * (not implemented) + * (API should be reviewed) + */ +epicsShareFunc long devConnectInterruptISA( + unsigned interruptLevel, + void (*pFunction)(void *), + void *parameter); + /* * disconnect ISR from an ISA interrupt level * (not implemented) @@ -182,6 +213,43 @@ epicsShareFunc long devDisconnectInterruptISA( unsigned interruptLevel, void (*pFunction)(void *)); +/* + * determine if an ISA interrupt level is in use + * (not implemented) + * + * returns boolean + */ +epicsShareFunc int devInterruptLevelInUseISA (unsigned interruptLevel); + +/* + * enable ISA interrupt level + */ +epicsShareFunc long devEnableInterruptLevelISA (unsigned level); + +/* + * disable ISA interrupt level + */ +epicsShareFunc long devDisableInterruptLevelISA (unsigned level); + + +/* + * PCI API + * + * Functions in this section apply only to the ISA bus type + */ + +/* + * connect ISR to a PCI interrupt + * (not implemented) + * (API should be reviewed) + */ +epicsShareFunc long devConnectInterruptPCI( + unsigned bus, + unsigned device, + unsigned function, + void (*pFunction)(void *), + void *parameter); + /* * disconnect ISR from a PCI interrupt * (not implemented) @@ -197,21 +265,6 @@ epicsShareFunc long devDisconnectInterruptPCI( unsigned function, void (*pFunction)(void *)); -/* - * determine if a VME interrupt vector is in use - * - * returns boolean - */ -epicsShareFunc int devInterruptInUseVME (unsigned vectorNumber); - -/* - * determine if an ISA interrupt level is in use - * (not implemented) - * - * returns boolean - */ -epicsShareFunc int devInterruptLevelInUseISA (unsigned interruptLevel); - /* * determine if a PCI interrupt is in use * (not implemented) @@ -221,17 +274,6 @@ epicsShareFunc int devInterruptLevelInUseISA (unsigned interruptLevel); epicsShareFunc int devInterruptInUsePCI (unsigned bus, unsigned device, unsigned function); -typedef enum {intVME, intVXI, intISA} epicsInterruptType; - -/* - * enable VME interrupt level - */ -epicsShareFunc long devEnableInterruptLevelVME (unsigned level); - -/* - * enable ISA interrupt level - */ -epicsShareFunc long devEnableInterruptLevelISA (unsigned level); /* * not implemented - API needs to be reviewed @@ -239,29 +281,16 @@ epicsShareFunc long devEnableInterruptLevelISA (unsigned level); epicsShareFunc long devEnableInterruptLevelPCI (unsigned level, unsigned bus, unsigned device, unsigned function); -/* - * disable VME interrupt level - */ -epicsShareFunc long devDisableInterruptLevelVME (unsigned level); - -/* - * disable ISA interrupt level - */ -epicsShareFunc long devDisableInterruptLevelISA (unsigned level); - /* * not implemented - API needs to be reviewed */ epicsShareFunc long devDisableInterruptLevelPCI (unsigned level, unsigned bus, unsigned device, unsigned function); + /* - * Routines to allocate and free memory in the A24 memory region. - * + * Support macros */ -epicsShareFunc void *devLibA24Malloc(size_t); -epicsShareFunc void *devLibA24Calloc(size_t); -epicsShareFunc void devLibA24Free(void *pBlock); /* * Normalize a digital value and convert it to type TYPE @@ -336,6 +365,15 @@ epicsShareFunc void devLibA24Free(void *pBlock); #define S_dev_badCRCSR (M_devLib| 35) /*Invalid VME CR/CSR address*/ #define S_dev_vxWorksIntEnFail S_dev_intEnFail + +/* + * Deprecated interface + */ + +#ifndef NO_DEVLIB_OLD_INTERFACE + +typedef enum {intVME, intVXI, intISA} epicsInterruptType; + /* * NOTE: this routine has been deprecated. It exists * for backwards compatibility purposes only. @@ -394,6 +432,8 @@ epicsShareFunc long devDisableInterruptLevel ( */ epicsShareFunc long locationProbe (epicsAddressType addrType, char *pLocation); +#endif /* NO_DEVLIB_OLD_INTERFACE */ + /* * Some vxWorks convenience routines */