win-pvdrivers

view xenpci/xenpci.h @ 551:a88fe72e3597

Tidied up gnttbl code. Better detection of crash dumps. Better behaviour when qemu hiding doesn't work.
author James Harper <james.harper@bendigoit.com.au>
date Sat Mar 28 10:07:53 2009 +1100 (2009-03-28)
parents e75bb8d68370
children d56ecda9e61f
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 //XENPCI_COMMON common;
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[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;
175 /* xenbus related */
176 XENBUS_WATCH_ENTRY XenBus_WatchEntries[MAX_WATCH_ENTRIES];
177 FAST_MUTEX xb_watch_mutex;
178 FAST_MUTEX xb_request_mutex;
179 KEVENT xb_request_complete_event;
180 struct xsd_sockmsg *xb_reply;
182 WDFCHILDLIST child_list;
184 int suspend_state;
186 UNICODE_STRING legacy_interface_name;
187 UNICODE_STRING interface_name;
188 BOOLEAN interface_open;
190 BOOLEAN removable;
192 BOOLEAN hibernated;
194 WDFQUEUE io_queue;
196 WDFCOLLECTION veto_devices;
197 #if 0
198 KSPIN_LOCK mmio_freelist_lock;
199 PPFN_NUMBER mmio_freelist_base;
200 ULONG mmio_freelist_free;
201 #endif
203 } XENPCI_DEVICE_DATA, *PXENPCI_DEVICE_DATA;
205 WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(XENPCI_DEVICE_DATA, GetXpdd)
207 typedef struct {
208 // XENPCI_COMMON common;
209 WDFDEVICE wdf_device;
210 WDFDEVICE wdf_device_bus_fdo;
211 //PDEVICE_OBJECT bus_pdo;
212 //PDEVICE_OBJECT bus_fdo;
213 BOOLEAN reported_missing;
214 char path[128];
215 char device[128];
216 ULONG index;
217 ULONG irq_number;
218 ULONG irq_vector;
219 KIRQL irq_level;
220 char backend_path[128];
221 //PVOID xenbus_request;
222 KEVENT backend_state_event;
223 ULONG backend_state;
224 ULONG frontend_state;
225 PMDL config_page_mdl;
226 PHYSICAL_ADDRESS config_page_phys;
227 ULONG config_page_length;
228 PUCHAR requested_resources_start;
229 PUCHAR requested_resources_ptr;
230 PUCHAR assigned_resources_start;
231 PUCHAR assigned_resources_ptr;
232 XENPCI_DEVICE_STATE device_state;
233 BOOLEAN restart_on_resume;
235 BOOLEAN hiber_usage_kludge;
237 } XENPCI_PDO_DEVICE_DATA, *PXENPCI_PDO_DEVICE_DATA;
239 WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(XENPCI_PDO_DEVICE_DATA, GetXppdd)
241 typedef struct {
242 WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER header;
243 CHAR path[128];
244 CHAR device[128];
245 ULONG index;
246 } XENPCI_PDO_IDENTIFICATION_DESCRIPTION, *PXENPCI_PDO_IDENTIFICATION_DESCRIPTION;
248 #if 0
249 kd> dt _ADAPTER_OBJECT 81e96b08 -v
250 hal!_ADAPTER_OBJECT
251 struct _ADAPTER_OBJECT, 26 elements, 0x64 bytes
252 +0x000 DmaHeader : struct _DMA_ADAPTER, 3 elements, 0x8 bytes
253 +0x008 MasterAdapter : (null)
254 +0x00c MapRegistersPerChannel : 0x80001
255 +0x010 AdapterBaseVa : (null)
256 +0x014 MapRegisterBase : (null)
257 +0x018 NumberOfMapRegisters : 0
258 +0x01c CommittedMapRegisters : 0
259 +0x020 CurrentWcb : (null)
260 +0x024 ChannelWaitQueue : struct _KDEVICE_QUEUE, 5 elements, 0x14 bytes
261 +0x038 RegisterWaitQueue : (null)
262 +0x03c AdapterQueue : struct _LIST_ENTRY, 2 elements, 0x8 bytes
263 [ 0x0 - 0x0 ]
264 +0x044 SpinLock : 0
265 +0x048 MapRegisters : (null)
266 +0x04c PagePort : (null)
267 +0x050 ChannelNumber : 0xff ''
268 +0x051 AdapterNumber : 0 ''
269 +0x052 DmaPortAddress : 0
270 +0x054 AdapterMode : 0 ''
271 +0x055 NeedsMapRegisters : 0 ''
272 +0x056 MasterDevice : 0x1 ''
273 +0x057 Width16Bits : 0 ''
274 +0x058 ScatterGather : 0x1 ''
275 +0x059 IgnoreCount : 0 ''
276 +0x05a Dma32BitAddresses : 0x1 ''
277 +0x05b Dma64BitAddresses : 0 ''
278 +0x05c AdapterList : struct _LIST_ENTRY, 2 elements, 0x8 bytes
279 [ 0x806e1250 - 0x81f1b474 ]
280 #endif
282 /* need to confirm that this is the same for AMD64 too */
283 typedef struct {
284 DMA_ADAPTER DmaHeader;
285 PVOID MasterAdapter;
286 ULONG MapRegistersPerChannel;
287 PVOID AdapterBaseVa;
288 PVOID MapRegisterBase;
289 ULONG NumberOfMapRegisters;
290 ULONG CommittedMapRegisters;
291 PVOID CurrentWcb;
292 KDEVICE_QUEUE ChannelWaitQueue;
293 PKDEVICE_QUEUE RegisterWaitQueue;
294 LIST_ENTRY AdapterQueue;
295 KSPIN_LOCK SpinLock;
296 PVOID MapRegisters;
297 PVOID PagePort;
298 UCHAR ChannelNumber;
299 UCHAR AdapterNumber;
300 USHORT DmaPortAddress;
301 UCHAR AdapterMode;
302 BOOLEAN NeedsMapRegisters;
303 BOOLEAN MasterDevice;
304 UCHAR Width16Bits;
305 BOOLEAN ScatterGather;
306 BOOLEAN IgnoreCount;
307 BOOLEAN Dma32BitAddresses;
308 BOOLEAN Dma64BitAddresses;
309 #if (NTDDI_VERSION >= NTDDI_WS03)
310 BOOLEAN LegacyAdapter;
311 #endif
312 LIST_ENTRY AdapterList;
313 } X_ADAPTER_OBJECT;
315 typedef struct {
316 X_ADAPTER_OBJECT adapter_object;
317 PXENPCI_PDO_DEVICE_DATA xppdd;
318 dma_driver_extension_t *dma_extension;
319 PDRIVER_OBJECT dma_extension_driver; /* to deference it */
320 } xen_dma_adapter_t;
322 #define XEN_INTERFACE_VERSION 1
324 #define DEVICE_INTERFACE_TYPE_LEGACY 0
325 #define DEVICE_INTERFACE_TYPE_XENBUS 1
327 typedef struct {
328 ULONG type; /* must be the first member */
329 KSPIN_LOCK lock;
330 ULONG len;
331 union {
332 struct xsd_sockmsg msg;
333 UCHAR buffer[PAGE_SIZE];
334 } u;
335 LIST_ENTRY read_list_head;
336 LIST_ENTRY watch_list_head;
337 WDFQUEUE io_queue;
339 //PIRP pending_read_irp;
340 } XENPCI_DEVICE_INTERFACE_DATA, *PXENPCI_DEVICE_INTERFACE_DATA;
342 WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(XENPCI_DEVICE_INTERFACE_DATA, GetXpdid)
344 EVT_WDF_DEVICE_FILE_CREATE XenPci_EvtDeviceFileCreate;
345 EVT_WDF_FILE_CLOSE XenPci_EvtFileClose;
346 EVT_WDF_FILE_CLEANUP XenPci_EvtFileCleanup;
347 EVT_WDF_IO_QUEUE_IO_READ XenPci_EvtIoRead;
348 EVT_WDF_IO_QUEUE_IO_WRITE XenPci_EvtIoWrite;
350 #include "hypercall.h"
352 #define XBT_NIL ((xenbus_transaction_t)0)
354 NTSTATUS
355 hvm_get_stubs(PXENPCI_DEVICE_DATA xpdd);
356 NTSTATUS
357 hvm_free_stubs(PXENPCI_DEVICE_DATA xpdd);
359 EVT_WDF_DEVICE_PREPARE_HARDWARE XenPci_EvtDevicePrepareHardware;
360 EVT_WDF_DEVICE_RELEASE_HARDWARE XenPci_EvtDeviceReleaseHardware;
361 EVT_WDF_DEVICE_D0_ENTRY XenPci_EvtDeviceD0Entry;
362 EVT_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED XenPci_EvtDeviceD0EntryPostInterruptsEnabled;
363 EVT_WDF_DEVICE_D0_EXIT XenPci_EvtDeviceD0Exit;
364 EVT_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED XenPci_EvtDeviceD0ExitPreInterruptsDisabled;
365 EVT_WDF_DEVICE_QUERY_REMOVE XenPci_EvtDeviceQueryRemove;
367 NTSTATUS
368 XenPci_EvtChildListCreateDevice(WDFCHILDLIST child_list, PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER description_header, PWDFDEVICE_INIT child_init);
369 VOID
370 XenPci_EvtChildListScanForChildren(WDFCHILDLIST child_list);
372 VOID
373 XenPci_HideQemuDevices();
374 extern ULONG qemu_filtered_by_qemu;
376 #if 0
377 NTSTATUS
378 XenPci_Power_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
379 NTSTATUS
380 XenPci_Dummy_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
381 NTSTATUS
382 XenPci_Pnp_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
383 NTSTATUS
384 XenPci_Irp_Create_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
385 NTSTATUS
386 XenPci_Irp_Close_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
387 NTSTATUS
388 XenPci_Irp_Read_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
389 NTSTATUS
390 XenPci_Irp_Write_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
391 NTSTATUS
392 XenPci_Irp_Cleanup_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
393 NTSTATUS
394 XenPci_SystemControl_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
396 NTSTATUS
397 XenPci_Irp_Create_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
398 NTSTATUS
399 XenPci_Irp_Close_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
400 NTSTATUS
401 XenPci_Irp_Read_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
402 NTSTATUS
403 XenPci_Irp_Write_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
404 NTSTATUS
405 XenPci_Irp_Cleanup_XenBus(PDEVICE_OBJECT device_object, PIRP irp);
407 NTSTATUS
408 XenPci_Power_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
409 //NTSTATUS
410 //XenPci_Dummy_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
411 NTSTATUS
412 XenPci_Pnp_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
413 NTSTATUS
414 XenPci_Irp_Create_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
415 NTSTATUS
416 XenPci_Irp_Close_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
417 NTSTATUS
418 XenPci_Irp_Read_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
419 NTSTATUS
420 XenPci_Irp_Write_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
421 NTSTATUS
422 XenPci_Irp_Cleanup_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
423 NTSTATUS
424 XenPci_SystemControl_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
425 #endif
427 NTSTATUS
428 XenPci_Pdo_Suspend(WDFDEVICE device);
429 NTSTATUS
430 XenPci_Pdo_Resume(WDFDEVICE device);
432 VOID
433 XenPci_DumpPdoConfig(PDEVICE_OBJECT device_object);
435 typedef VOID
436 (*PXENPCI_HIGHSYNC_FUNCTION)(PVOID context);
438 VOID
439 XenPci_HighSync(PXENPCI_HIGHSYNC_FUNCTION function0, PXENPCI_HIGHSYNC_FUNCTION functionN, PVOID context);
441 VOID
442 XenPci_PatchKernel(PXENPCI_DEVICE_DATA xpdd, PVOID base, ULONG length);
444 struct xsd_sockmsg *
445 XenBus_Raw(PXENPCI_DEVICE_DATA xpdd, struct xsd_sockmsg *msg);
446 char *
447 XenBus_Read(PVOID Context, xenbus_transaction_t xbt, char *path, char **value);
448 char *
449 XenBus_Write(PVOID Context, xenbus_transaction_t xbt, char *path, char *value);
450 char *
451 XenBus_Printf(PVOID Context, xenbus_transaction_t xbt, char *path, char *fmt, ...);
452 char *
453 XenBus_StartTransaction(PVOID Context, xenbus_transaction_t *xbt);
454 char *
455 XenBus_EndTransaction(PVOID Context, xenbus_transaction_t t, int abort, int *retry);
456 char *
457 XenBus_List(PVOID Context, xenbus_transaction_t xbt, char *prefix, char ***contents);
458 char *
459 XenBus_AddWatch(PVOID Context, xenbus_transaction_t xbt, char *Path, PXENBUS_WATCH_CALLBACK ServiceRoutine, PVOID ServiceContext);
460 char *
461 XenBus_RemWatch(PVOID Context, xenbus_transaction_t xbt, char *Path, PXENBUS_WATCH_CALLBACK ServiceRoutine, PVOID ServiceContext);
462 //VOID
463 //XenBus_ThreadProc(PVOID StartContext);
464 NTSTATUS
465 XenBus_Init(PXENPCI_DEVICE_DATA xpdd);
466 NTSTATUS
467 XenBus_Close(PXENPCI_DEVICE_DATA xpdd);
468 NTSTATUS
469 XenBus_Start(PXENPCI_DEVICE_DATA xpdd);
470 NTSTATUS
471 XenBus_Stop(PXENPCI_DEVICE_DATA xpdd);
472 NTSTATUS
473 XenBus_Suspend(PXENPCI_DEVICE_DATA xpdd);
474 NTSTATUS
475 XenBus_Resume(PXENPCI_DEVICE_DATA xpdd);
476 NTSTATUS
477 XenBus_StopThreads(PXENPCI_DEVICE_DATA xpdd);
479 PHYSICAL_ADDRESS
480 XenPci_AllocMMIO(PXENPCI_DEVICE_DATA xpdd, ULONG len);
482 EVT_WDF_INTERRUPT_ISR EvtChn_EvtInterruptIsr;
483 EVT_WDF_INTERRUPT_ENABLE EvtChn_EvtInterruptEnable;
484 EVT_WDF_INTERRUPT_DISABLE EvtChn_EvtInterruptDisable;
486 NTSTATUS
487 EvtChn_Init(PXENPCI_DEVICE_DATA xpdd);
488 NTSTATUS
489 EvtChn_Suspend(PXENPCI_DEVICE_DATA xpdd);
490 NTSTATUS
491 EvtChn_Resume(PXENPCI_DEVICE_DATA xpdd);
493 NTSTATUS
494 EvtChn_Mask(PVOID Context, evtchn_port_t Port);
495 NTSTATUS
496 EvtChn_Unmask(PVOID Context, evtchn_port_t Port);
497 NTSTATUS
498 EvtChn_Bind(PVOID Context, evtchn_port_t Port, PXEN_EVTCHN_SERVICE_ROUTINE ServiceRoutine, PVOID ServiceContext);
499 NTSTATUS
500 EvtChn_BindDpc(PVOID Context, evtchn_port_t Port, PXEN_EVTCHN_SERVICE_ROUTINE ServiceRoutine, PVOID ServiceContext);
501 NTSTATUS
502 EvtChn_BindIrq(PVOID Context, evtchn_port_t Port, ULONG vector, PCHAR description);
503 evtchn_port_t
504 EvtChn_AllocIpi(PVOID context, ULONG vcpu);
505 NTSTATUS
506 EvtChn_Unbind(PVOID Context, evtchn_port_t Port);
507 NTSTATUS
508 EvtChn_Notify(PVOID Context, evtchn_port_t Port);
509 VOID
510 EvtChn_Close(PVOID Context, evtchn_port_t Port);
511 evtchn_port_t
512 EvtChn_AllocUnbound(PVOID Context, domid_t Domain);
513 BOOLEAN
514 EvtChn_AckEvent(PVOID context, evtchn_port_t port);
516 VOID
517 GntTbl_Init(PXENPCI_DEVICE_DATA xpdd);
518 VOID
519 GntTbl_Suspend(PXENPCI_DEVICE_DATA xpdd);
520 VOID
521 GntTbl_Resume(PXENPCI_DEVICE_DATA xpdd);
522 grant_ref_t
523 GntTbl_GrantAccess(PVOID Context, domid_t domid, uint32_t, int readonly, grant_ref_t ref);
524 BOOLEAN
525 GntTbl_EndAccess(PVOID Context, grant_ref_t ref, BOOLEAN keepref);
526 VOID
527 GntTbl_PutRef(PVOID Context, grant_ref_t ref);
528 grant_ref_t
529 GntTbl_GetRef(PVOID Context);
530 #if 0
531 int
532 GntTbl_Map(PVOID Context, unsigned int start_idx, unsigned int end_idx);
533 #endif
535 #endif