win-pvdrivers

view xenpci/xenpci.h @ 685:c13ccf5a629b

Fixed a bug in the dma routines which was causing memory corruption. In some cases when Windows gave an MDL that was longer than the buffer to be dma'd, the end of the buffer would be overwritten. The only time I am aware of this occuring is on one particular map in Call Of Duty 4.

Split out the dma routines from xenpci_pdo.c into xenpci_dma.c
author James Harper <james.harper@bendigoit.com.au>
date Wed Oct 14 14:46:39 2009 +1100 (2009-10-14)
parents 4baaaaa23235
children 1fe30f6966eb
line source
1 /*
2 PV Drivers for Windows Xen HVM Domains
3 Copyright (C) 2007 James Harper
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
20 #if !defined(_XENPCI_H_)
21 #define _XENPCI_H_
23 #define __attribute__(arg) /* empty */
24 #define EISCONN 127
26 #include <ntifs.h>
27 #include <ntddk.h>
29 #define DDKAPI
30 //#include <wdm.h>
31 #include <wdf.h>
32 #include <initguid.h>
33 #include <wdmguid.h>
34 #include <errno.h>
35 #define NTSTRSAFE_LIB
36 #include <ntstrsafe.h>
38 #define __DRIVER_NAME "XenPCI"
40 #include <xen_windows.h>
41 #include <memory.h>
42 #include <grant_table.h>
43 #include <event_channel.h>
44 #include <hvm/params.h>
45 #include <hvm/hvm_op.h>
46 #include <sched.h>
47 #include <io/xenbus.h>
48 #include <io/xs_wire.h>
50 #include <xen_public.h>
52 //{C828ABE9-14CA-4445-BAA6-82C2376C6518}
53 DEFINE_GUID( GUID_XENPCI_DEVCLASS, 0xC828ABE9, 0x14CA, 0x4445, 0xBA, 0xA6, 0x82, 0xC2, 0x37, 0x6C, 0x65, 0x18);
55 #define XENPCI_POOL_TAG (ULONG) 'XenP'
57 #define NR_RESERVED_ENTRIES 8
58 #define NR_GRANT_FRAMES 32
59 #define NR_GRANT_ENTRIES (NR_GRANT_FRAMES * PAGE_SIZE / sizeof(grant_entry_t))
61 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
63 #define EVT_ACTION_TYPE_EMPTY 0
64 #define EVT_ACTION_TYPE_NORMAL 1
65 #define EVT_ACTION_TYPE_DPC 2
66 #define EVT_ACTION_TYPE_IRQ 3
67 #define EVT_ACTION_TYPE_SUSPEND 4
69 #define XEN_PV_PRODUCT_NUMBER 0x0002
70 #define XEN_PV_PRODUCT_BUILD 0x00000001
72 extern ULONG qemu_filtered;
73 extern ULONG qemu_protocol_version;
75 typedef struct _ev_action_t {
76 PXEN_EVTCHN_SERVICE_ROUTINE ServiceRoutine;
77 PVOID ServiceContext;
78 CHAR description[128];
79 ULONG type; /* EVT_ACTION_TYPE_* */
80 KDPC Dpc;
81 ULONG vector;
82 ULONG count;
83 PVOID xpdd;
84 } ev_action_t;
86 typedef struct _XENBUS_WATCH_RING
87 {
88 char Path[128];
89 char Token[10];
90 } XENBUS_WATCH_RING;
92 typedef struct xsd_sockmsg xsd_sockmsg_t;
94 typedef struct _XENBUS_WATCH_ENTRY {
95 char Path[128];
96 PXENBUS_WATCH_CALLBACK ServiceRoutine;
97 PVOID ServiceContext;
98 int Count;
99 int Active;
100 } XENBUS_WATCH_ENTRY, *PXENBUS_WATCH_ENTRY;
102 #define NR_EVENTS 1024
103 #define WATCH_RING_SIZE 128
104 #define NR_XB_REQS 32
105 #define MAX_WATCH_ENTRIES 128
107 #define CHILD_STATE_EMPTY 0
108 #define CHILD_STATE_DELETED 1
109 #define CHILD_STATE_ADDED 2
111 #define SUSPEND_STATE_NONE 0 /* no suspend in progress */
112 #define SUSPEND_STATE_SCHEDULED 1 /* suspend scheduled */
113 #define SUSPEND_STATE_HIGH_IRQL 2 /* all processors are at high IRQL and spinning */
114 #define SUSPEND_STATE_RESUMING 3 /* we are the other side of the suspend and things are starting to get back to normal */
116 typedef struct {
117 WDFDEVICE wdf_device;
119 BOOLEAN tpr_patched;
121 WDFINTERRUPT interrupt;
122 ULONG irq_number;
123 ULONG irq_vector;
124 KIRQL irq_level;
125 KINTERRUPT_MODE irq_mode;
126 KAFFINITY irq_affinity;
128 PHYSICAL_ADDRESS shared_info_area_unmapped;
129 shared_info_t *shared_info_area;
130 xen_ulong_t evtchn_pending_pvt[MAX_VIRT_CPUS][sizeof(xen_ulong_t) * 8];
131 xen_ulong_t evtchn_pending_suspend[sizeof(xen_ulong_t) * 8];
132 evtchn_port_t pdo_event_channel;
133 KEVENT pdo_suspend_event;
134 BOOLEAN interrupts_masked;
136 PHYSICAL_ADDRESS platform_mmio_addr;
137 ULONG platform_mmio_orig_len;
138 ULONG platform_mmio_len;
139 ULONG platform_mmio_alloc;
140 USHORT platform_mmio_flags;
142 ULONG platform_ioport_addr;
143 ULONG platform_ioport_len;
145 char *hypercall_stubs;
147 evtchn_port_t xen_store_evtchn;
149 /* grant related */
150 grant_entry_t *gnttab_table;
151 grant_entry_t *gnttab_table_copy;
152 PHYSICAL_ADDRESS gnttab_table_physical;
153 grant_ref_t *gnttab_list;
154 int gnttab_list_free;
155 KSPIN_LOCK grant_lock;
156 ULONG grant_frames;
158 ev_action_t ev_actions[NR_EVENTS];
159 // unsigned long bound_ports[NR_EVENTS/(8*sizeof(unsigned long))];
161 BOOLEAN xb_state;
163 struct xenstore_domain_interface *xen_store_interface;
165 #define BALLOON_UNITS (1024 * 1024) /* 1MB */
166 PKTHREAD balloon_thread;
167 KEVENT balloon_event;
168 BOOLEAN balloon_shutdown;
169 ULONG initial_memory;
170 ULONG current_memory;
171 ULONG target_memory;
173 /* xenbus related */
174 XENBUS_WATCH_ENTRY XenBus_WatchEntries[MAX_WATCH_ENTRIES];
175 KSPIN_LOCK xb_ring_spinlock;
176 FAST_MUTEX xb_watch_mutex;
177 FAST_MUTEX xb_request_mutex;
178 KEVENT xb_request_complete_event;
179 struct xsd_sockmsg *xb_reply;
180 struct xsd_sockmsg *xb_msg;
181 ULONG xb_msg_offset;
183 WDFCHILDLIST child_list;
185 KSPIN_LOCK suspend_lock;
186 evtchn_port_t suspend_evtchn;
187 int suspend_state;
189 UNICODE_STRING legacy_interface_name;
190 UNICODE_STRING interface_name;
191 BOOLEAN interface_open;
193 BOOLEAN removable;
195 BOOLEAN hibernated;
197 WDFQUEUE io_queue;
199 //WDFCOLLECTION veto_devices;
200 LIST_ENTRY veto_list;
201 #if 0
202 KSPIN_LOCK mmio_freelist_lock;
203 PPFN_NUMBER mmio_freelist_base;
204 ULONG mmio_freelist_free;
205 #endif
207 } XENPCI_DEVICE_DATA, *PXENPCI_DEVICE_DATA;
209 WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(XENPCI_DEVICE_DATA, GetXpdd)
211 typedef struct {
212 WDFDEVICE wdf_device;
213 WDFDEVICE wdf_device_bus_fdo;
214 BOOLEAN reported_missing;
215 char path[128];
216 char device[128];
217 ULONG index;
218 ULONG irq_number;
219 ULONG irq_vector;
220 KIRQL irq_level;
221 char backend_path[128];
222 //PVOID xenbus_request;
223 KEVENT backend_state_event;
224 ULONG backend_state;
225 FAST_MUTEX backend_state_mutex;
226 ULONG frontend_state;
227 PMDL config_page_mdl;
228 PHYSICAL_ADDRESS config_page_phys;
229 ULONG config_page_length;
230 PUCHAR requested_resources_start;
231 PUCHAR requested_resources_ptr;
232 PUCHAR assigned_resources_start;
233 PUCHAR assigned_resources_ptr;
234 XENPCI_DEVICE_STATE device_state;
235 BOOLEAN restart_on_resume;
237 BOOLEAN hiber_usage_kludge;
239 } XENPCI_PDO_DEVICE_DATA, *PXENPCI_PDO_DEVICE_DATA;
241 WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(XENPCI_PDO_DEVICE_DATA, GetXppdd)
243 typedef struct {
244 WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER header;
245 CHAR path[128];
246 CHAR device[128];
247 ULONG index;
248 } XENPCI_PDO_IDENTIFICATION_DESCRIPTION, *PXENPCI_PDO_IDENTIFICATION_DESCRIPTION;
250 #if 0
251 kd> dt _ADAPTER_OBJECT 81e96b08 -v
252 hal!_ADAPTER_OBJECT
253 struct _ADAPTER_OBJECT, 26 elements, 0x64 bytes
254 +0x000 DmaHeader : struct _DMA_ADAPTER, 3 elements, 0x8 bytes
255 +0x008 MasterAdapter : (null)
256 +0x00c MapRegistersPerChannel : 0x80001
257 +0x010 AdapterBaseVa : (null)
258 +0x014 MapRegisterBase : (null)
259 +0x018 NumberOfMapRegisters : 0
260 +0x01c CommittedMapRegisters : 0
261 +0x020 CurrentWcb : (null)
262 +0x024 ChannelWaitQueue : struct _KDEVICE_QUEUE, 5 elements, 0x14 bytes
263 +0x038 RegisterWaitQueue : (null)
264 +0x03c AdapterQueue : struct _LIST_ENTRY, 2 elements, 0x8 bytes
265 [ 0x0 - 0x0 ]
266 +0x044 SpinLock : 0
267 +0x048 MapRegisters : (null)
268 +0x04c PagePort : (null)
269 +0x050 ChannelNumber : 0xff ''
270 +0x051 AdapterNumber : 0 ''
271 +0x052 DmaPortAddress : 0
272 +0x054 AdapterMode : 0 ''
273 +0x055 NeedsMapRegisters : 0 ''
274 +0x056 MasterDevice : 0x1 ''
275 +0x057 Width16Bits : 0 ''
276 +0x058 ScatterGather : 0x1 ''
277 +0x059 IgnoreCount : 0 ''
278 +0x05a Dma32BitAddresses : 0x1 ''
279 +0x05b Dma64BitAddresses : 0 ''
280 +0x05c AdapterList : struct _LIST_ENTRY, 2 elements, 0x8 bytes
281 [ 0x806e1250 - 0x81f1b474 ]
282 #endif
284 /* need to confirm that this is the same for AMD64 too */
285 typedef struct {
286 DMA_ADAPTER DmaHeader;
287 PVOID MasterAdapter;
288 ULONG MapRegistersPerChannel;
289 PVOID AdapterBaseVa;
290 PVOID MapRegisterBase;
291 ULONG NumberOfMapRegisters;
292 ULONG CommittedMapRegisters;
293 PVOID CurrentWcb;
294 KDEVICE_QUEUE ChannelWaitQueue;
295 PKDEVICE_QUEUE RegisterWaitQueue;
296 LIST_ENTRY AdapterQueue;
297 KSPIN_LOCK SpinLock;
298 PVOID MapRegisters;
299 PVOID PagePort;
300 UCHAR ChannelNumber;
301 UCHAR AdapterNumber;
302 USHORT DmaPortAddress;
303 UCHAR AdapterMode;
304 BOOLEAN NeedsMapRegisters;
305 BOOLEAN MasterDevice;
306 UCHAR Width16Bits;
307 BOOLEAN ScatterGather;
308 BOOLEAN IgnoreCount;
309 BOOLEAN Dma32BitAddresses;
310 BOOLEAN Dma64BitAddresses;
311 #if (NTDDI_VERSION >= NTDDI_WS03)
312 BOOLEAN LegacyAdapter;
313 #endif
314 LIST_ENTRY AdapterList;
315 } X_ADAPTER_OBJECT;
317 typedef struct {
318 X_ADAPTER_OBJECT adapter_object;
319 PXENPCI_PDO_DEVICE_DATA xppdd;
320 dma_driver_extension_t *dma_extension;
321 PDRIVER_OBJECT dma_extension_driver; /* to deference it */
322 } xen_dma_adapter_t;
324 #define XEN_INTERFACE_VERSION 1
326 //#define DEVICE_INTERFACE_TYPE_LEGACY 0
327 #define DEVICE_INTERFACE_TYPE_XENBUS 1
328 #define DEVICE_INTERFACE_TYPE_EVTCHN 2
329 #define DEVICE_INTERFACE_TYPE_GNTDEV 3
331 typedef struct {
332 ULONG len;
333 WDFQUEUE io_queue;
334 union {
335 struct xsd_sockmsg msg;
336 UCHAR buffer[PAGE_SIZE];
337 } u;
338 LIST_ENTRY read_list_head;
339 LIST_ENTRY watch_list_head;
340 } XENBUS_INTERFACE_DATA, *PXENBUS_INTERFACE_DATA;
342 typedef struct {
343 ULONG dummy; /* fill this in with whatever is required */
344 } EVTCHN_INTERFACE_DATA, *PEVTCHN_INTERFACE_DATA;
346 typedef struct {
347 ULONG dummy; /* fill this in with whatever is required */
348 } GNTDEV_INTERFACE_DATA, *PGNTDEV_INTERFACE_DATA;
350 typedef struct {
351 ULONG type;
352 KSPIN_LOCK lock;
353 WDFQUEUE io_queue;
354 EVT_WDF_FILE_CLEANUP *EvtFileCleanup;
355 EVT_WDF_FILE_CLOSE *EvtFileClose;
356 union {
357 XENBUS_INTERFACE_DATA xenbus;
358 EVTCHN_INTERFACE_DATA evtchn;
359 GNTDEV_INTERFACE_DATA gntdev;
360 };
361 } XENPCI_DEVICE_INTERFACE_DATA, *PXENPCI_DEVICE_INTERFACE_DATA;
363 WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(XENPCI_DEVICE_INTERFACE_DATA, GetXpdid)
365 NTSTATUS
366 XenBus_DeviceFileInit(WDFDEVICE device, PWDF_IO_QUEUE_CONFIG queue_config, WDFFILEOBJECT file_object);
368 EVT_WDF_DEVICE_FILE_CREATE XenPci_EvtDeviceFileCreate;
369 EVT_WDF_FILE_CLOSE XenPci_EvtFileClose;
370 EVT_WDF_FILE_CLEANUP XenPci_EvtFileCleanup;
371 EVT_WDF_IO_QUEUE_IO_DEFAULT XenPci_EvtIoDefault;
373 #include "hypercall.h"
375 #define XBT_NIL ((xenbus_transaction_t)0)
377 NTSTATUS
378 hvm_get_stubs(PXENPCI_DEVICE_DATA xpdd);
379 NTSTATUS
380 hvm_free_stubs(PXENPCI_DEVICE_DATA xpdd);
382 EVT_WDF_DEVICE_PREPARE_HARDWARE XenPci_EvtDevicePrepareHardware;
383 EVT_WDF_DEVICE_RELEASE_HARDWARE XenPci_EvtDeviceReleaseHardware;
384 EVT_WDF_DEVICE_D0_ENTRY XenPci_EvtDeviceD0Entry;
385 EVT_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED XenPci_EvtDeviceD0EntryPostInterruptsEnabled;
386 EVT_WDF_DEVICE_D0_EXIT XenPci_EvtDeviceD0Exit;
387 EVT_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED XenPci_EvtDeviceD0ExitPreInterruptsDisabled;
388 EVT_WDF_DEVICE_QUERY_REMOVE XenPci_EvtDeviceQueryRemove;
390 NTSTATUS
391 XenPci_EvtChildListCreateDevice(WDFCHILDLIST child_list, PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER description_header, PWDFDEVICE_INIT child_init);
392 VOID
393 XenPci_EvtChildListScanForChildren(WDFCHILDLIST child_list);
395 VOID
396 XenPci_HideQemuDevices();
397 extern ULONG qemu_filtered_by_qemu;
399 #if 0
400 NTSTATUS
401 XenPci_Power_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
402 NTSTATUS
403 XenPci_Dummy_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
404 NTSTATUS
405 XenPci_Pnp_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
406 NTSTATUS
407 XenPci_Irp_Create_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
408 NTSTATUS
409 XenPci_Irp_Close_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
410 NTSTATUS
411 XenPci_Irp_Read_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
412 NTSTATUS
413 XenPci_Irp_Write_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
414 NTSTATUS
415 XenPci_Irp_Cleanup_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
416 NTSTATUS
417 XenPci_SystemControl_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
419 NTSTATUS
420 XenPci_Irp_Create_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
421 NTSTATUS
422 XenPci_Irp_Close_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
423 NTSTATUS
424 XenPci_Irp_Read_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
425 NTSTATUS
426 XenPci_Irp_Write_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
427 NTSTATUS
428 XenPci_Irp_Cleanup_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
430 NTSTATUS
431 XenPci_Power_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
432 //NTSTATUS
433 //XenPci_Dummy_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
434 NTSTATUS
435 XenPci_Pnp_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
436 NTSTATUS
437 XenPci_Irp_Create_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
438 NTSTATUS
439 XenPci_Irp_Close_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
440 NTSTATUS
441 XenPci_Irp_Read_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
442 NTSTATUS
443 XenPci_Irp_Write_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
444 NTSTATUS
445 XenPci_Irp_Cleanup_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
446 NTSTATUS
447 XenPci_SystemControl_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
448 #endif
450 NTSTATUS
451 XenPci_Pdo_Suspend(WDFDEVICE device);
452 NTSTATUS
453 XenPci_Pdo_Resume(WDFDEVICE device);
455 VOID
456 XenPci_DumpPdoConfig(PDEVICE_OBJECT device_object);
458 typedef VOID
459 (*PXENPCI_HIGHSYNC_FUNCTION)(PVOID context);
461 VOID
462 XenPci_HighSync(PXENPCI_HIGHSYNC_FUNCTION function0, PXENPCI_HIGHSYNC_FUNCTION functionN, PVOID context);
464 VOID
465 XenPci_PatchKernel(PXENPCI_DEVICE_DATA xpdd, PVOID base, ULONG length);
467 struct xsd_sockmsg *
468 XenBus_Raw(PXENPCI_DEVICE_DATA xpdd, struct xsd_sockmsg *msg);
469 char *
470 XenBus_Read(PVOID Context, xenbus_transaction_t xbt, char *path, char **value);
471 char *
472 XenBus_Write(PVOID Context, xenbus_transaction_t xbt, char *path, char *value);
473 char *
474 XenBus_Printf(PVOID Context, xenbus_transaction_t xbt, char *path, char *fmt, ...);
475 char *
476 XenBus_StartTransaction(PVOID Context, xenbus_transaction_t *xbt);
477 char *
478 XenBus_EndTransaction(PVOID Context, xenbus_transaction_t t, int abort, int *retry);
479 char *
480 XenBus_List(PVOID Context, xenbus_transaction_t xbt, char *prefix, char ***contents);
481 char *
482 XenBus_AddWatch(PVOID Context, xenbus_transaction_t xbt, char *Path, PXENBUS_WATCH_CALLBACK ServiceRoutine, PVOID ServiceContext);
483 char *
484 XenBus_RemWatch(PVOID Context, xenbus_transaction_t xbt, char *Path, PXENBUS_WATCH_CALLBACK ServiceRoutine, PVOID ServiceContext);
485 //VOID
486 //XenBus_ThreadProc(PVOID StartContext);
487 NTSTATUS
488 XenBus_Init(PXENPCI_DEVICE_DATA xpdd);
489 NTSTATUS
490 XenBus_Halt(PXENPCI_DEVICE_DATA xpdd);
491 NTSTATUS
492 XenBus_Suspend(PXENPCI_DEVICE_DATA xpdd);
493 NTSTATUS
494 XenBus_Resume(PXENPCI_DEVICE_DATA xpdd);
496 PHYSICAL_ADDRESS
497 XenPci_AllocMMIO(PXENPCI_DEVICE_DATA xpdd, ULONG len);
499 EVT_WDF_INTERRUPT_ISR EvtChn_EvtInterruptIsr;
500 EVT_WDF_INTERRUPT_ENABLE EvtChn_EvtInterruptEnable;
501 EVT_WDF_INTERRUPT_DISABLE EvtChn_EvtInterruptDisable;
503 NTSTATUS
504 EvtChn_Init(PXENPCI_DEVICE_DATA xpdd);
505 NTSTATUS
506 EvtChn_Suspend(PXENPCI_DEVICE_DATA xpdd);
507 NTSTATUS
508 EvtChn_Resume(PXENPCI_DEVICE_DATA xpdd);
510 NTSTATUS
511 EvtChn_Mask(PVOID Context, evtchn_port_t Port);
512 NTSTATUS
513 EvtChn_Unmask(PVOID Context, evtchn_port_t Port);
514 NTSTATUS
515 EvtChn_Bind(PVOID Context, evtchn_port_t Port, PXEN_EVTCHN_SERVICE_ROUTINE ServiceRoutine, PVOID ServiceContext);
516 NTSTATUS
517 EvtChn_BindDpc(PVOID Context, evtchn_port_t Port, PXEN_EVTCHN_SERVICE_ROUTINE ServiceRoutine, PVOID ServiceContext);
518 NTSTATUS
519 EvtChn_BindIrq(PVOID Context, evtchn_port_t Port, ULONG vector, PCHAR description);
520 evtchn_port_t
521 EvtChn_AllocIpi(PVOID context, ULONG vcpu);
522 NTSTATUS
523 EvtChn_Unbind(PVOID Context, evtchn_port_t Port);
524 NTSTATUS
525 EvtChn_Notify(PVOID Context, evtchn_port_t Port);
526 VOID
527 EvtChn_Close(PVOID Context, evtchn_port_t Port);
528 evtchn_port_t
529 EvtChn_AllocUnbound(PVOID Context, domid_t Domain);
530 BOOLEAN
531 EvtChn_AckEvent(PVOID context, evtchn_port_t port, BOOLEAN *last_interrupt);
533 VOID
534 GntTbl_Init(PXENPCI_DEVICE_DATA xpdd);
535 VOID
536 GntTbl_Suspend(PXENPCI_DEVICE_DATA xpdd);
537 VOID
538 GntTbl_Resume(PXENPCI_DEVICE_DATA xpdd);
539 grant_ref_t
540 GntTbl_GrantAccess(PVOID Context, domid_t domid, uint32_t, int readonly, grant_ref_t ref);
541 BOOLEAN
542 GntTbl_EndAccess(PVOID Context, grant_ref_t ref, BOOLEAN keepref);
543 VOID
544 GntTbl_PutRef(PVOID Context, grant_ref_t ref);
545 grant_ref_t
546 GntTbl_GetRef(PVOID Context);
548 BOOLEAN
549 XenPci_BIS_TranslateBusAddress(PVOID context, PHYSICAL_ADDRESS bus_address, ULONG length, PULONG address_space, PPHYSICAL_ADDRESS translated_address);
550 PDMA_ADAPTER
551 XenPci_BIS_GetDmaAdapter(PVOID context, PDEVICE_DESCRIPTION device_description, PULONG number_of_map_registers);
552 ULONG
553 XenPci_BIS_SetBusData(PVOID context, ULONG data_type, PVOID buffer, ULONG offset, ULONG length);
554 ULONG
555 XenPci_BIS_GetBusData(PVOID context, ULONG data_type, PVOID buffer, ULONG offset, ULONG length);
557 #endif