devLib2  2.11
devLibVME.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * EPICS BASE is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
9 
10 /*
11  * Compatibility overlay for devLib
12  *
13  * Provide updated interface (VME CSR).
14  * This is a stripped down version of devLib.h having
15  * only the interface functions which use the epicsAddressType
16  * enum (externally or internally).
17  *
18  */
19 
20 #ifndef INCdevLibVMEh
21 #define INCdevLibVMEh 1
22 
23 #include "dbDefs.h"
24 #include "osdVME.h"
25 #include "errMdef.h"
26 #include "shareLib.h"
27 #include "devLib.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /*
34  * Earlier versions of EPICS may not implement CR/CSR addressing
35  * in base devLib. Make sure that we have a definition for atVMECSR
36  * and that atLast indicates the end of the devLib2 address tables.
37  */
38 
39 #define atVMECSR ((epicsAddressType)4)
40 #define atLast ((epicsAddressType)5)
41 
42 /*
43  * pointer to an array of strings for each of
44  * the VME address types
45  */
46 epicsShareExtern const char *epicsAddressTypeName2[];
47 #define epicsAddressTypeName epicsAddressTypeName2
48 
49 /*
50  * General API
51  *
52  * This section applies to all bus types
53  */
54 
55 epicsShareFunc long devAddressMap2(void); /* print an address map */
56 #define devAddressMap devAddressMap2
57 
58 /*
59  * devBusToLocalAddr()
60  *
61  * OSI routine to translate bus addresses their local CPU address mapping
62  */
63 epicsShareFunc long devBusToLocalAddr2 (
64  epicsAddressType addrType,
65  size_t busAddr,
66  volatile void **ppLocalAddr);
67 #define devBusToLocalAddr devBusToLocalAddr2
68 
69 epicsShareFunc long devRegisterAddress2(
70  const char *pOwnerName,
71  epicsAddressType addrType,
72  size_t logicalBaseAddress,
73  size_t size, /* bytes */
74  volatile void **pPhysicalAddress);
75 #define devRegisterAddress devRegisterAddress2
76 
77 epicsShareFunc long devUnregisterAddress2(
78  epicsAddressType addrType,
79  size_t logicalBaseAddress,
80  const char *pOwnerName);
81 #define devUnregisterAddress devUnregisterAddress2
82 
83 /*
84  * allocate and register an unoccupied address block
85  */
86 epicsShareFunc long devAllocAddress2(
87  const char *pOwnerName,
88  epicsAddressType addrType,
89  size_t size,
90  unsigned alignment, /*n ls bits zero in addr*/
91  volatile void **pLocalAddress);
92 #define devAllocAddress devAllocAddress2
93 
94 extern devLibVirtualOS *pdevLibVME2;
95 epicsShareFunc void devReplaceVirtualOS(void);
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif /* INCdevLibVMEh.h*/
epicsShareFunc void devReplaceVirtualOS(void)
Definition: devlib_compat.c:87
epicsShareFunc long devRegisterAddress2(const char *pOwnerName, epicsAddressType addrType, size_t logicalBaseAddress, size_t size, volatile void **pPhysicalAddress)
Definition: devLibVME.c:198
devLibVirtualOS * pdevLibVME2
epicsShareFunc long devAddressMap2(void)
Definition: devLibVME.c:702
epicsShareFunc long devBusToLocalAddr2(epicsAddressType addrType, size_t busAddr, volatile void **ppLocalAddr)
Definition: devLibVME.c:147
epicsShareFunc long devAllocAddress2(const char *pOwnerName, epicsAddressType addrType, size_t size, unsigned alignment, volatile void **pLocalAddress)
Definition: devLibVME.c:569
epicsShareFunc long devUnregisterAddress2(epicsAddressType addrType, size_t logicalBaseAddress, const char *pOwnerName)
Definition: devLibVME.c:432
epicsShareExtern const char * epicsAddressTypeName2[]
Definition: devLibVME.h:46