devLib2  2.11
devlib_compat.c
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2010 Brookhaven Science Associates, as Operator of
3 * Brookhaven National Laboratory.
4 * devLib2 is distributed subject to a Software License Agreement found
5 * in file LICENSE that is included with this distribution.
6 \*************************************************************************/
7 /*
8  * Author: Michael Davidsaver <mdavidsaver@gmail.com>
9  */
10 
11 #include <stdlib.h>
12 
13 #include <epicsVersion.h>
14 #include <devLib.h>
15 
16 #include "devlibversion.h"
17 
18 #define epicsExportSharedSymbols
19 #include <shareLib.h>
20 
21 #if defined(__rtems__)
22 # if !defined(__PPC__) && !defined(__mcf528x__)
23 # define NEED_IFACE
24 # define NEED_PIMPL
25 # endif
26 #elif defined(vxWorks)
27 /* nothing needed */
28 #else
29 # define NEED_IFACE
30 #endif
31 
32 #ifdef NEED_IFACE
33 
34 #if EPICS_VERSION_INT<VERSION_INT(3,14,12,0)
35 /*
36  * Most devlib function go through an indirection table with a null
37  * implimentation provided for systems which doen't impliment some
38  * functionality. However, the functions below don't use this table.
39  *
40  * For most functions we can use the deprecated API, but before 3.14.12
41  * no wrapper for devInterruptInUseVME() was provided so can't implement
42  * that one
43  */
44 
45 long devEnableInterruptLevelVME (unsigned vectorNumber)
46 {
47  return devEnableInterruptLevel(intVME, vectorNumber);
48 }
49 
50 long devConnectInterruptVME (
51  unsigned vectorNumber,
52  void (*pFunction)(void *),
53  void *parameter)
54 {
55  return devConnectInterrupt(intVME,vectorNumber, pFunction, parameter);
56 }
57 
58 long devDisconnectInterruptVME (
59  unsigned vectorNumber,
60  void (*pFunction)(void *))
61 {
62  return devDisconnectInterrupt(intVME, vectorNumber, pFunction);
63 }
64 
65 int devInterruptInUseVME (unsigned vectorNumber)
66 {
67  return -1; /* Not implemented in Base <= 3.14.11 */
68 }
69 #endif /* EPICS < 3.14.12 */
70 
71 
72 #endif /* NEED_IFACE */
73 
74 #ifdef NEED_PIMPL
75 
76 #if EPICS_VERSION_INT<VERSION_INT(3,14,12,0)
77 devLibVirtualOS *pdevLibVirtualOS = NULL;
78 #else
79 devLibVME *pdevLibVirtualOS = NULL;
80 #endif
81 
82 #endif /* NEED_PIMPL */
83 
84 #if EPICS_VERSION_INT>=VERSION_INT(3,14,10,0)
85 #include <epicsExport.h>
86 
88 {
89  /* not needed after 3.14.9 */
90 }
91 
93 #endif
long devEnableInterruptLevel(epicsInterruptType intType, unsigned level)
Definition: devlib_dummy.c:76
epicsExportRegistrar(devReplaceVirtualOS)
devLibVirtualOS * pdevLibVirtualOS
Definition: devlib_dummy.c:86
void devReplaceVirtualOS(void)
Definition: devlib_compat.c:87
long devConnectInterrupt(epicsInterruptType intType, unsigned vectorNumber, void(*pFunction)(void *), void *parameter)
Definition: devlib_dummy.c:65
long devDisconnectInterrupt(epicsInterruptType intType, unsigned vectorNumber, void(*pFunction)(void *))
Definition: devlib_dummy.c:71