Skip to content

Commit e01c772

Browse files
committed
feat: Split PCI OSD declarations into devLibPCIOSD.h
1 parent b277eef commit e01c772

File tree

3 files changed

+54
-34
lines changed

3 files changed

+54
-34
lines changed

pciApp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ DBD += epicspci.dbd
2020

2121
INC += devLibPCI.h
2222
INC += devLibPCIImpl.h
23+
INC += devLibPCIOSD.h
2324

2425
epicspci_SRCS += devLibPCI.c
2526
epicspci_SRCS += devLibPCIStrings.c
@@ -37,4 +38,3 @@ epicspci_LIBS += Com
3738
include $(TOP)/configure/RULES
3839
#----------------------------------------
3940
# ADD RULES AFTER THIS LINE
40-

pciApp/os/Linux/devLibPCIOSD.c

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
#include <errlog.h>
2323
#include <epicsString.h>
2424
#include <epicsThread.h>
25-
#include <epicsMutex.h>
25+
//#include <epicsMutex.h>
2626
#include <epicsEvent.h>
2727
#include <epicsInterrupt.h>
2828
#include <compilerDependencies.h>
2929

30-
31-
#include "devLibPCIImpl.h"
30+
//#include "devLibPCIImpl.h"
31+
#include "devLibPCIOSD.h"
3232

3333
/**@file devLibPCIOSD.c
3434
* @brief Userspace PCI access in Linux
@@ -82,36 +82,6 @@
8282
*
8383
* Access after init is guarded by devLock
8484
*/
85-
struct osdPCIDevice {
86-
epicsPCIDevice dev; /* "public" data */
87-
88-
/* result of mmap(), add offset before passing to user */
89-
volatile void *base[PCIBARCOUNT];
90-
/* offset from start of page to start of BAR */
91-
epicsUInt32 offset[PCIBARCOUNT];
92-
/* BAR length (w/o offset) */
93-
epicsUInt32 len[PCIBARCOUNT];
94-
volatile void *erom;
95-
epicsUInt32 eromlen;
96-
97-
epicsUInt32 displayBAR[PCIBARCOUNT]; /* Raw PCI address */
98-
epicsUInt32 displayErom;
99-
100-
int fd; /* /dev/uio# */
101-
int cfd; /* config-space descriptor */
102-
int rfd[PCIBARCOUNT];
103-
int cmode; /* config-space mode */
104-
105-
epicsMutexId devLock; /* guard access to isrs list */
106-
107-
//Optional callback invoked on PCI device hot-swap.
108-
void (*onHotSwapHook)(struct osdPCIDevice* dev);
109-
110-
ELLNODE node;
111-
112-
ELLLIST isrs; /* contains struct osdISR */
113-
};
114-
typedef struct osdPCIDevice osdPCIDevice;
11585

11686
#define dev2osd(dev) CONTAINER(dev, osdPCIDevice, dev)
11787

pciApp/os/Linux/devLibPCIOSD.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
2+
#ifndef DEVLIBPCIOSD_H_INC
3+
#define DEVLIBPCIOSD_H_INC
4+
5+
#include <epicsMutex.h>
6+
7+
#include "devLibPCIImpl.h"
8+
9+
#ifdef __cplusplus
10+
extern "C"
11+
{
12+
#endif
13+
14+
struct osdPCIDevice
15+
{
16+
epicsPCIDevice dev; /* "public" data */
17+
18+
/* result of mmap(), add offset before passing to user */
19+
volatile void* base[PCIBARCOUNT];
20+
/* offset from start of page to start of BAR */
21+
epicsUInt32 offset[PCIBARCOUNT];
22+
/* BAR length (w/o offset) */
23+
epicsUInt32 len[PCIBARCOUNT];
24+
volatile void* erom;
25+
epicsUInt32 eromlen;
26+
27+
epicsUInt32 displayBAR[PCIBARCOUNT]; /* Raw PCI address */
28+
epicsUInt32 displayErom;
29+
30+
int fd; /* /dev/uio# */
31+
int cfd; /* config-space descriptor */
32+
int rfd[PCIBARCOUNT];
33+
int cmode; /* config-space mode */
34+
35+
epicsMutexId devLock; /* guard access to isrs list */
36+
37+
/* Optional callback invoked on PCI device hot-swap.*/
38+
void (*onHotSwapHook)(struct osdPCIDevice* dev);
39+
40+
ELLNODE node;
41+
42+
ELLLIST isrs; /* contains struct osdISR */
43+
};
44+
typedef struct osdPCIDevice osdPCIDevice;
45+
46+
#ifdef __cplusplus
47+
}
48+
#endif
49+
50+
#endif /* DEVLIBPCIOSD_H_INC */

0 commit comments

Comments
 (0)