Skip to content

Commit 8b7956b

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

File tree

3 files changed

+44
-34
lines changed

3 files changed

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

0 commit comments

Comments
 (0)