win-pvdrivers

view xenpci/xenpci.h @ 622:f905eb3f0545

Shut down threads properly on hibernate.
Added some debug to try and find where the hang happens when the verifier is enabled
Added the suspend event channel to allow triggering a suspend much earlier
author James Harper <james.harper@bendigoit.com.au>
date Wed Aug 05 19:09:55 2009 +1000 (2009-08-05)
parents cf954aa0a8b1
children 0b55299418ce
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 _XENBUS_WATCH_ENTRY {
93 char Path[128];
94 PXENBUS_WATCH_CALLBACK ServiceRoutine;
95 PVOID ServiceContext;
96 int Count;
97 int Active;
98 //int RemovePending;
99 //int Running;
100 //KEVENT CompleteEvent;
101 } XENBUS_WATCH_ENTRY, *PXENBUS_WATCH_ENTRY;
103 #define NR_EVENTS 1024
104 #define WATCH_RING_SIZE 128
105 #define NR_XB_REQS 32
106 #define MAX_WATCH_ENTRIES 128
108 #define CHILD_STATE_EMPTY 0
109 #define CHILD_STATE_DELETED 1
110 #define CHILD_STATE_ADDED 2
112 #define SUSPEND_STATE_NONE 0 /* no suspend in progress */
113 #define SUSPEND_STATE_SCHEDULED 1 /* suspend scheduled */
114 #define SUSPEND_STATE_HIGH_IRQL 2 /* all processors are at high IRQL and spinning */
115 #define SUSPEND_STATE_RESUMING 3 /* we are the other side of the suspend and things are starting to get back to normal */
117 typedef struct {
118 WDFDEVICE wdf_device;
120 BOOLEAN XenBus_ShuttingDown;
122 BOOLEAN tpr_patched;
124 WDFINTERRUPT interrupt;
125 ULONG irq_number;
126 ULONG irq_vector;
127 KIRQL irq_level;
128 KINTERRUPT_MODE irq_mode;
129 KAFFINITY irq_affinity;
131 PHYSICAL_ADDRESS shared_info_area_unmapped;
132 shared_info_t *shared_info_area;
133 xen_ulong_t evtchn_pending_pvt[MAX_VIRT_CPUS][sizeof(xen_ulong_t) * 8];
134 xen_ulong_t evtchn_pending_suspend[sizeof(xen_ulong_t) * 8];
135 evtchn_port_t pdo_event_channel;
136 KEVENT pdo_suspend_event;
137 BOOLEAN interrupts_masked;
139 PHYSICAL_ADDRESS platform_mmio_addr;
140 ULONG platform_mmio_orig_len;
141 ULONG platform_mmio_len;
142 ULONG platform_mmio_alloc;
143 USHORT platform_mmio_flags;
145 ULONG platform_ioport_addr;
146 ULONG platform_ioport_len;
148 char *hypercall_stubs;
150 evtchn_port_t xen_store_evtchn;
152 /* grant related */
153 grant_entry_t *gnttab_table;
154 grant_entry_t *gnttab_table_copy;
155 PHYSICAL_ADDRESS gnttab_table_physical;
156 grant_ref_t *gnttab_list;
157 int gnttab_list_free;
158 KSPIN_LOCK grant_lock;
159 ULONG grant_frames;
161 ev_action_t ev_actions[NR_EVENTS];
162 // unsigned long bound_ports[NR_EVENTS/(8*sizeof(unsigned long))];
164 PKTHREAD XenBus_ReadThread;
165 KEVENT XenBus_ReadThreadEvent;
166 PKTHREAD XenBus_WatchThread;
167 KEVENT XenBus_WatchThreadEvent;
169 XENBUS_WATCH_RING XenBus_WatchRing[WATCH_RING_SIZE];
170 int XenBus_WatchRingReadIndex;
171 int XenBus_WatchRingWriteIndex;
173 struct xenstore_domain_interface *xen_store_interface;
176 #define BALLOON_UNITS (1024 * 1024) /* 1MB */
177 PKTHREAD balloon_thread;
178 KEVENT balloon_event;
179 BOOLEAN balloon_shutdown;
180 ULONG initial_memory;
181 ULONG current_memory;
182 ULONG target_memory;
184 /* xenbus related */
185 XENBUS_WATCH_ENTRY XenBus_WatchEntries[MAX_WATCH_ENTRIES];
186 FAST_MUTEX xb_watch_mutex;
187 FAST_MUTEX xb_request_mutex;
188 KEVENT xb_request_complete_event;
189 struct xsd_sockmsg *xb_reply;
191 WDFCHILDLIST child_list;
193 KSPIN_LOCK suspend_lock;
194 evtchn_port_t suspend_evtchn;
195 int suspend_state;
197 UNICODE_STRING legacy_interface_name;
198 UNICODE_STRING interface_name;
199 BOOLEAN interface_open;
201 BOOLEAN removable;
203 BOOLEAN hibernated;
205 WDFQUEUE io_queue;
207 WDFCOLLECTION veto_devices;
208 #if 0
209 KSPIN_LOCK mmio_freelist_lock;
210 PPFN_NUMBER mmio_freelist_base;
211 ULONG mmio_freelist_free;
212 #endif
214 } XENPCI_DEVICE_DATA, *PXENPCI_DEVICE_DATA;
216 WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(XENPCI_DEVICE_DATA, GetXpdd)
218 typedef struct {
219 WDFDEVICE wdf_device;
220 WDFDEVICE wdf_device_bus_fdo;
221 BOOLEAN reported_missing;
222 char path[128];
223 char device[128];
224 ULONG index;
225 ULONG irq_number;
226 ULONG irq_vector;
227 KIRQL irq_level;
228 char backend_path[128];
229 //PVOID xenbus_request;
230 KEVENT backend_state_event;
231 ULONG backend_state;
232 ULONG frontend_state;
233 PMDL config_page_mdl;
234 PHYSICAL_ADDRESS config_page_phys;
235 ULONG config_page_length;
236 PUCHAR requested_resources_start;
237 PUCHAR requested_resources_ptr;
238 PUCHAR assigned_resources_start;
239 PUCHAR assigned_resources_ptr;
240 XENPCI_DEVICE_STATE device_state;
241 BOOLEAN restart_on_resume;
243 BOOLEAN hiber_usage_kludge;
245 } XENPCI_PDO_DEVICE_DATA, *PXENPCI_PDO_DEVICE_DATA;
247 WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(XENPCI_PDO_DEVICE_DATA, GetXppdd)
249 typedef struct {
250 WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER header;
251 CHAR path[128];
252 CHAR device[128];
253 ULONG index;
254 } XENPCI_PDO_IDENTIFICATION_DESCRIPTION, *PXENPCI_PDO_IDENTIFICATION_DESCRIPTION;
256 #if 0
257 kd> dt _ADAPTER_OBJECT 81e96b08 -v
258 hal!_ADAPTER_OBJECT
259 struct _ADAPTER_OBJECT, 26 elements, 0x64 bytes
260 +0x000 DmaHeader : struct _DMA_ADAPTER, 3 elements, 0x8 bytes
261 +0x008 MasterAdapter : (null)
262 +0x00c MapRegistersPerChannel : 0x80001
263 +0x010 AdapterBaseVa : (null)
264 +0x014 MapRegisterBase : (null)
265 +0x018 NumberOfMapRegisters : 0
266 +0x01c CommittedMapRegisters : 0
267 +0x020 CurrentWcb : (null)
268 +0x024 ChannelWaitQueue : struct _KDEVICE_QUEUE, 5 elements, 0x14 bytes
269 +0x038 RegisterWaitQueue : (null)
270 +0x03c AdapterQueue : struct _LIST_ENTRY, 2 elements, 0x8 bytes
271 [ 0x0 - 0x0 ]
272 +0x044 SpinLock : 0
273 +0x048 MapRegisters : (null)
274 +0x04c PagePort : (null)
275 +0x050 ChannelNumber : 0xff ''
276 +0x051 AdapterNumber : 0 ''
277 +0x052 DmaPortAddress : 0
278 +0x054 AdapterMode : 0 ''
279 +0x055 NeedsMapRegisters : 0 ''
280 +0x056 MasterDevice : 0x1 ''
281 +0x057 Width16Bits : 0 ''
282 +0x058 ScatterGather : 0x1 ''
283 +0x059 IgnoreCount : 0 ''
284 +0x05a Dma32BitAddresses : 0x1 ''
285 +0x05b Dma64BitAddresses : 0 ''
286 +0x05c AdapterList : struct _LIST_ENTRY, 2 elements, 0x8 bytes
287 [ 0x806e1250 - 0x81f1b474 ]
288 #endif
290 /* need to confirm that this is the same for AMD64 too */
291 typedef struct {
292 DMA_ADAPTER DmaHeader;
293 PVOID MasterAdapter;
294 ULONG MapRegistersPerChannel;
295 PVOID AdapterBaseVa;
296 PVOID MapRegisterBase;
297 ULONG NumberOfMapRegisters;
298 ULONG CommittedMapRegisters;
299 PVOID CurrentWcb;
300 KDEVICE_QUEUE ChannelWaitQueue;
301 PKDEVICE_QUEUE RegisterWaitQueue;
302 LIST_ENTRY AdapterQueue;
303 KSPIN_LOCK SpinLock;
304 PVOID MapRegisters;
305 PVOID PagePort;
306 UCHAR ChannelNumber;
307 UCHAR AdapterNumber;
308 USHORT DmaPortAddress;
309 UCHAR AdapterMode;
310 BOOLEAN NeedsMapRegisters;
311 BOOLEAN MasterDevice;
312 UCHAR Width16Bits;
313 BOOLEAN ScatterGather;
314 BOOLEAN IgnoreCount;
315 BOOLEAN Dma32BitAddresses;
316 BOOLEAN Dma64BitAddresses;
317 #if (NTDDI_VERSION >= NTDDI_WS03)
318 BOOLEAN LegacyAdapter;
319 #endif
320 LIST_ENTRY AdapterList;
321 } X_ADAPTER_OBJECT;
323 typedef struct {
324 X_ADAPTER_OBJECT adapter_object;
325 PXENPCI_PDO_DEVICE_DATA xppdd;
326 dma_driver_extension_t *dma_extension;
327 PDRIVER_OBJECT dma_extension_driver; /* to deference it */
328 } xen_dma_adapter_t;
330 #define XEN_INTERFACE_VERSION 1
332 #define DEVICE_INTERFACE_TYPE_LEGACY 0
333 #define DEVICE_INTERFACE_TYPE_XENBUS 1
335 typedef struct {
336 ULONG type; /* must be the first member */
337 KSPIN_LOCK lock;
338 ULONG len;
339 union {
340 struct xsd_sockmsg msg;
341 UCHAR buffer[PAGE_SIZE];
342 } u;
343 LIST_ENTRY read_list_head;
344 LIST_ENTRY watch_list_head;
345 WDFQUEUE io_queue;
347 //PIRP pending_read_irp;
348 } XENPCI_DEVICE_INTERFACE_DATA, *PXENPCI_DEVICE_INTERFACE_DATA;
350 WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(XENPCI_DEVICE_INTERFACE_DATA, GetXpdid)
352 EVT_WDF_DEVICE_FILE_CREATE XenPci_EvtDeviceFileCreate;
353 EVT_WDF_FILE_CLOSE XenPci_EvtFileClose;
354 EVT_WDF_FILE_CLEANUP XenPci_EvtFileCleanup;
355 EVT_WDF_IO_QUEUE_IO_READ XenPci_EvtIoRead;
356 EVT_WDF_IO_QUEUE_IO_WRITE XenPci_EvtIoWrite;
358 #include "hypercall.h"
360 #define XBT_NIL ((xenbus_transaction_t)0)
362 NTSTATUS
363 hvm_get_stubs(PXENPCI_DEVICE_DATA xpdd);
364 NTSTATUS
365 hvm_free_stubs(PXENPCI_DEVICE_DATA xpdd);
367 EVT_WDF_DEVICE_PREPARE_HARDWARE XenPci_EvtDevicePrepareHardware;
368 EVT_WDF_DEVICE_RELEASE_HARDWARE XenPci_EvtDeviceReleaseHardware;
369 EVT_WDF_DEVICE_D0_ENTRY XenPci_EvtDeviceD0Entry;
370 EVT_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED XenPci_EvtDeviceD0EntryPostInterruptsEnabled;
371 EVT_WDF_DEVICE_D0_EXIT XenPci_EvtDeviceD0Exit;
372 EVT_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED XenPci_EvtDeviceD0ExitPreInterruptsDisabled;
373 EVT_WDF_DEVICE_QUERY_REMOVE XenPci_EvtDeviceQueryRemove;
375 NTSTATUS
376 XenPci_EvtChildListCreateDevice(WDFCHILDLIST child_list, PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER description_header, PWDFDEVICE_INIT child_init);
377 VOID
378 XenPci_EvtChildListScanForChildren(WDFCHILDLIST child_list);
380 VOID
381 XenPci_HideQemuDevices();
382 extern ULONG qemu_filtered_by_qemu;
384 #if 0
385 NTSTATUS
386 XenPci_Power_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
387 NTSTATUS
388 XenPci_Dummy_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
389 NTSTATUS
390 XenPci_Pnp_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
391 NTSTATUS
392 XenPci_Irp_Create_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
393 NTSTATUS
394 XenPci_Irp_Close_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
395 NTSTATUS
396 XenPci_Irp_Read_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
397 NTSTATUS
398 XenPci_Irp_Write_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
399 NTSTATUS
400 XenPci_Irp_Cleanup_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
401 NTSTATUS
402 XenPci_SystemControl_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
404 NTSTATUS
405 XenPci_Irp_Create_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
406 NTSTATUS
407 XenPci_Irp_Close_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
408 NTSTATUS
409 XenPci_Irp_Read_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
410 NTSTATUS
411 XenPci_Irp_Write_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
412 NTSTATUS
413 XenPci_Irp_Cleanup_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
415 NTSTATUS
416 XenPci_Power_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
417 //NTSTATUS
418 //XenPci_Dummy_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
419 NTSTATUS
420 XenPci_Pnp_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
421 NTSTATUS
422 XenPci_Irp_Create_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
423 NTSTATUS
424 XenPci_Irp_Close_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
425 NTSTATUS
426 XenPci_Irp_Read_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
427 NTSTATUS
428 XenPci_Irp_Write_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
429 NTSTATUS
430 XenPci_Irp_Cleanup_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
431 NTSTATUS
432 XenPci_SystemControl_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
433 #endif
435 NTSTATUS
436 XenPci_Pdo_Suspend(WDFDEVICE device);
437 NTSTATUS
438 XenPci_Pdo_Resume(WDFDEVICE device);
440 VOID
441 XenPci_DumpPdoConfig(PDEVICE_OBJECT device_object);
443 typedef VOID
444 (*PXENPCI_HIGHSYNC_FUNCTION)(PVOID context);
446 VOID
447 XenPci_HighSync(PXENPCI_HIGHSYNC_FUNCTION function0, PXENPCI_HIGHSYNC_FUNCTION functionN, PVOID context);
449 VOID
450 XenPci_PatchKernel(PXENPCI_DEVICE_DATA xpdd, PVOID base, ULONG length);
452 struct xsd_sockmsg *
453 XenBus_Raw(PXENPCI_DEVICE_DATA xpdd, struct xsd_sockmsg *msg);
454 char *
455 XenBus_Read(PVOID Context, xenbus_transaction_t xbt, char *path, char **value);
456 char *
457 XenBus_Write(PVOID Context, xenbus_transaction_t xbt, char *path, char *value);
458 char *
459 XenBus_Printf(PVOID Context, xenbus_transaction_t xbt, char *path, char *fmt, ...);
460 char *
461 XenBus_StartTransaction(PVOID Context, xenbus_transaction_t *xbt);
462 char *
463 XenBus_EndTransaction(PVOID Context, xenbus_transaction_t t, int abort, int *retry);
464 char *
465 XenBus_List(PVOID Context, xenbus_transaction_t xbt, char *prefix, char ***contents);
466 char *
467 XenBus_AddWatch(PVOID Context, xenbus_transaction_t xbt, char *Path, PXENBUS_WATCH_CALLBACK ServiceRoutine, PVOID ServiceContext);
468 char *
469 XenBus_RemWatch(PVOID Context, xenbus_transaction_t xbt, char *Path, PXENBUS_WATCH_CALLBACK ServiceRoutine, PVOID ServiceContext);
470 //VOID
471 //XenBus_ThreadProc(PVOID StartContext);
472 NTSTATUS
473 XenBus_Init(PXENPCI_DEVICE_DATA xpdd);
474 NTSTATUS
475 XenBus_Halt(PXENPCI_DEVICE_DATA xpdd);
476 NTSTATUS
477 XenBus_Suspend(PXENPCI_DEVICE_DATA xpdd);
478 NTSTATUS
479 XenBus_Resume(PXENPCI_DEVICE_DATA xpdd);
481 PHYSICAL_ADDRESS
482 XenPci_AllocMMIO(PXENPCI_DEVICE_DATA xpdd, ULONG len);
484 EVT_WDF_INTERRUPT_ISR EvtChn_EvtInterruptIsr;
485 EVT_WDF_INTERRUPT_ENABLE EvtChn_EvtInterruptEnable;
486 EVT_WDF_INTERRUPT_DISABLE EvtChn_EvtInterruptDisable;
488 NTSTATUS
489 EvtChn_Init(PXENPCI_DEVICE_DATA xpdd);
490 NTSTATUS
491 EvtChn_Suspend(PXENPCI_DEVICE_DATA xpdd);
492 NTSTATUS
493 EvtChn_Resume(PXENPCI_DEVICE_DATA xpdd);
495 NTSTATUS
496 EvtChn_Mask(PVOID Context, evtchn_port_t Port);
497 NTSTATUS
498 EvtChn_Unmask(PVOID Context, evtchn_port_t Port);
499 NTSTATUS
500 EvtChn_Bind(PVOID Context, evtchn_port_t Port, PXEN_EVTCHN_SERVICE_ROUTINE ServiceRoutine, PVOID ServiceContext);
501 NTSTATUS
502 EvtChn_BindDpc(PVOID Context, evtchn_port_t Port, PXEN_EVTCHN_SERVICE_ROUTINE ServiceRoutine, PVOID ServiceContext);
503 NTSTATUS
504 EvtChn_BindIrq(PVOID Context, evtchn_port_t Port, ULONG vector, PCHAR description);
505 evtchn_port_t
506 EvtChn_AllocIpi(PVOID context, ULONG vcpu);
507 NTSTATUS
508 EvtChn_Unbind(PVOID Context, evtchn_port_t Port);
509 NTSTATUS
510 EvtChn_Notify(PVOID Context, evtchn_port_t Port);
511 VOID
512 EvtChn_Close(PVOID Context, evtchn_port_t Port);
513 evtchn_port_t
514 EvtChn_AllocUnbound(PVOID Context, domid_t Domain);
515 BOOLEAN
516 EvtChn_AckEvent(PVOID context, evtchn_port_t port, BOOLEAN *last_interrupt);
518 VOID
519 GntTbl_Init(PXENPCI_DEVICE_DATA xpdd);
520 VOID
521 GntTbl_Suspend(PXENPCI_DEVICE_DATA xpdd);
522 VOID
523 GntTbl_Resume(PXENPCI_DEVICE_DATA xpdd);
524 grant_ref_t
525 GntTbl_GrantAccess(PVOID Context, domid_t domid, uint32_t, int readonly, grant_ref_t ref);
526 BOOLEAN
527 GntTbl_EndAccess(PVOID Context, grant_ref_t ref, BOOLEAN keepref);
528 VOID
529 GntTbl_PutRef(PVOID Context, grant_ref_t ref);
530 grant_ref_t
531 GntTbl_GetRef(PVOID Context);
532 #if 0
533 int
534 GntTbl_Map(PVOID Context, unsigned int start_idx, unsigned int end_idx);
535 #endif
537 #endif