NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
PciTypes.h
1 #ifndef __PCI_TYPES_H
2 #define __PCI_TYPES_H
3 
4 /*******************************************************************************
5  * Copyright (c) PLX Technology, Inc.
6  *
7  * PLX Technology Inc. licenses this source file under the GNU Lesser General Public
8  * License (LGPL) version 2. This source file may be modified or redistributed
9  * under the terms of the LGPL and without express permission from PLX Technology.
10  *
11  * PLX Technology, Inc. provides this software AS IS, WITHOUT ANY WARRANTY,
12  * EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF
13  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. PLX makes no guarantee
14  * or representations regarding the use of, or the results of the use of,
15  * the software and documentation in terms of correctness, accuracy,
16  * reliability, currentness, or otherwise; and you rely on the software,
17  * documentation and results solely at your own risk.
18  *
19  * IN NO EVENT SHALL PLX BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS,
20  * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES
21  * OF ANY KIND.
22  *
23  ******************************************************************************/
24 
25 /******************************************************************************
26  *
27  * File Name:
28  *
29  * PciTypes.h
30  *
31  * Description:
32  *
33  * This file defines the basic types
34  *
35  * Revision:
36  *
37  * 02-01-12 : PLX SDK v7.00
38  *
39  ******************************************************************************/
40 
41 
42 #if defined(PLX_WDM_DRIVER)
43  #include <wdm.h> // WDM Driver types
44 #endif
45 
46 #if defined(PLX_NT_DRIVER)
47  #include <ntddk.h> // NT Kernel Mode Driver (ie PLX Service)
48 #endif
49 
50 #if defined(PLX_MSWINDOWS)
51  #if !defined(PLX_DRIVER)
52  #include <wtypes.h> // Windows application level types
53  #endif
54 #endif
55 
56 // Must be placed before <linux/types.h> to prevent compile errors
57 #if defined(PLX_LINUX) && !defined(PLX_LINUX_DRIVER)
58  #include <memory.h> // To automatically add mem*() set of functions
59 #endif
60 
61 #if defined(PLX_LINUX) || defined(PLX_LINUX_DRIVER)
62  #include <linux/types.h> // Linux types
63 #endif
64 
65 #if defined(PLX_LINUX)
66  #include <limits.h> // For MAX_SCHEDULE_TIMEOUT in Linux applications
67 #endif
68 
69 
70 #ifdef __cplusplus
71 extern "C" {
72 #endif
73 
74 
75 
76 /*******************************************
77  * Linux Application Level Definitions
78  ******************************************/
79 #if defined(PLX_LINUX)
80  typedef __s8 S8;
81  typedef __u8 U8;
82  typedef __s16 S16;
83  typedef __u16 U16;
84  typedef __s32 S32;
85  typedef __u32 U32;
86  typedef __s64 S64;
87  typedef __u64 U64;
88  #define PLX_SIZE_64 8
89  typedef signed long PLX_INT_PTR; // For 32/64-bit code compatability
90  typedef unsigned long PLX_UINT_PTR;
91 
92  typedef int HANDLE;
93  typedef int PLX_DRIVER_HANDLE; // Linux-specific driver handle
94 
95  #define INVALID_HANDLE_VALUE (HANDLE)-1
96 
97  #if !defined(MAX_SCHEDULE_TIMEOUT)
98  #define MAX_SCHEDULE_TIMEOUT LONG_MAX
99  #endif
100 #endif
101 
102 
103 
104 /*******************************************
105  * Linux Kernel Level Definitions
106  ******************************************/
107 #if defined(PLX_LINUX_DRIVER)
108  typedef s8 S8;
109  typedef u8 U8;
110  typedef s16 S16;
111  typedef u16 U16;
112  typedef s32 S32;
113  typedef u32 U32;
114  typedef s64 S64;
115  typedef u64 U64;
116  #define PLX_SIZE_64 8
117  typedef signed long PLX_INT_PTR; // For 32/64-bit code compatability
118  typedef unsigned long PLX_UINT_PTR;
119 
120  typedef int PLX_DRIVER_HANDLE; // Linux-specific driver handle
121 #endif
122 
123 
124 
125 /*******************************************
126  * Windows Type Definitions
127  ******************************************/
128 #if defined(PLX_MSWINDOWS)
129  typedef signed char S8;
130  typedef unsigned char U8;
131  typedef signed short S16;
132  typedef unsigned short U16;
133  typedef signed long S32;
134  typedef unsigned long U32;
135  typedef signed _int64 S64;
136  typedef unsigned _int64 U64;
137  typedef INT_PTR PLX_INT_PTR; // For 32/64-bit code compatability
138  typedef UINT_PTR PLX_UINT_PTR;
139 
140  typedef HANDLE PLX_DRIVER_HANDLE; // Windows-specific driver handle
141  #define PLX_SIZE_64 8
142 
143  #if defined(_DEBUG)
144  #define PLX_DEBUG
145  #endif
146 #endif
147 
148 
149 
150 /*******************************************
151  * Windows WDM Driver Compatability
152  ******************************************/
153 #if defined(PLX_WDM_DRIVER)
154  // RtlIsNtDdiVersionAvailable supported in Windows Vista & higher
155  #if (WINVER < 0x600)
156  #define RtlIsNtDdiVersionAvailable(ver) IoIsWdmVersionAvailable( (U8)(ver >> 24), (U8)(ver >> 16) )
157 
158  // Windows versions taken from SdkDdkVer.h
159  #define NTDDI_WIN2K 0x01100000 // WDM=1.10 Winver=5.00
160  #define NTDDI_WINXP 0x01200000 // WDM=1.20 Winver=5.01
161  #define NTDDI_WS03 0x01300000 // WDM=1.30 Winver=5.02
162  #endif
163 
164  #if (WINVER < 0x601)
165  #define NTDDI_WIN6 0x06000000
166  #define NTDDI_WIN6SP1 0x06000100
167  #define NTDDI_VISTA NTDDI_WIN6
168  #define NTDDI_WS08 NTDDI_WIN6SP1
169  #define NTDDI_WIN7 0x06010000
170  #endif
171 
172  #if (WINVER < 0x602)
173  #define NTDDI_WIN8 0x06020000
174  #endif
175 
176  #if (WINVER < 0x601)
177  typedef
178  NTSTATUS
179  DRIVER_INITIALIZE(
180  struct _DRIVER_OBJECT *DriverObject,
181  PUNICODE_STRING RegistryPath
182  );
183 
184  typedef
185  VOID
186  DRIVER_UNLOAD(
187  struct _DRIVER_OBJECT *DriverObject
188  );
189 
190  typedef
191  NTSTATUS
192  DRIVER_ADD_DEVICE(
193  struct _DRIVER_OBJECT *DriverObject,
194  struct _DEVICE_OBJECT *PhysicalDeviceObject
195  );
196 
197  typedef
198  NTSTATUS
199  DRIVER_DISPATCH(
200  struct _DEVICE_OBJECT *DeviceObject,
201  struct _IRP *Irp
202  );
203 
204  typedef
205  VOID
206  DRIVER_CANCEL(
207  struct _DEVICE_OBJECT *DeviceObject,
208  struct _IRP *Irp
209  );
210 
211  typedef
212  BOOLEAN
213  KSERVICE_ROUTINE(
214  struct _KINTERRUPT *Interrupt,
215  PVOID ServiceContext
216  );
217 
218  typedef
219  VOID
220  KDEFERRED_ROUTINE(
221  struct _KDPC *Dpc,
222  PVOID DeferredContext,
223  PVOID SystemArgument1,
224  PVOID SystemArgument2
225  );
226 
227  typedef
228  BOOLEAN
229  KSYNCHRONIZE_ROUTINE (
230  PVOID SynchronizeContext
231  );
232 
233  typedef
234  NTSTATUS
235  IO_COMPLETION_ROUTINE (
236  PDEVICE_OBJECT DeviceObject,
237  PIRP Irp,
238  PVOID Context
239  );
240 
241  typedef
242  VOID
243  IO_WORKITEM_ROUTINE (
244  PDEVICE_OBJECT DeviceObject,
245  PVOID Context
246  );
247 
248  typedef
249  VOID
250  REQUEST_POWER_COMPLETE (
251  PDEVICE_OBJECT DeviceObject,
252  UCHAR MinorFunction,
253  POWER_STATE PowerState,
254  PVOID Context,
255  PIO_STATUS_BLOCK IoStatus
256  );
257 
258  #endif
259 #endif
260 
261 
262 
263 /*******************************************
264  * DOS Type Definitions
265  ******************************************/
266 #if defined(PLX_DOS)
267  typedef signed char S8;
268  typedef unsigned char U8;
269  typedef signed short S16;
270  typedef unsigned short U16;
271  typedef signed long S32;
272  typedef unsigned long U32;
273  typedef signed long long S64;
274  typedef unsigned long long U64;
275  typedef S32 PLX_INT_PTR; // For 32/64-bit code compatability
276  typedef U32 PLX_UINT_PTR;
277 
278  typedef unsigned long HANDLE;
279  typedef HANDLE PLX_DRIVER_HANDLE;
280  #define INVALID_HANDLE_VALUE 0
281  #define PLX_SIZE_64 8
282 
283  #if !defined(_far)
284  #define _far
285  #endif
286 #endif
287 
288 
289 
290 /*******************************************
291  * Volatile Basic Type Definitions
292  ******************************************/
293 typedef volatile S8 VS8;
294 typedef volatile U8 VU8;
295 typedef volatile S16 VS16;
296 typedef volatile U16 VU16;
297 typedef volatile S32 VS32;
298 typedef volatile U32 VU32;
299 typedef volatile S64 VS64;
300 typedef volatile U64 VU64;
301 
302 
303 
304 
305 #ifdef __cplusplus
306 }
307 #endif
308 
309 #endif