win-pvdrivers

annotate xenpci/xenpci.h @ 342:eabe51317e3a

Suspend works for xenvbd, not for xennet though (eg after a resume you won't have a working network
author James Harper <james.harper@bendigoit.com.au>
date Thu Jun 26 16:55:43 2008 +1000 (2008-06-26)
parents 744c19115142
children b827e78992a3
rev   line source
james@0 1 /*
james@0 2 PV Drivers for Windows Xen HVM Domains
james@0 3 Copyright (C) 2007 James Harper
james@0 4
james@0 5 This program is free software; you can redistribute it and/or
james@0 6 modify it under the terms of the GNU General Public License
james@0 7 as published by the Free Software Foundation; either version 2
james@0 8 of the License, or (at your option) any later version.
james@0 9
james@0 10 This program is distributed in the hope that it will be useful,
james@0 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
james@0 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
james@0 13 GNU General Public License for more details.
james@0 14
james@0 15 You should have received a copy of the GNU General Public License
james@0 16 along with this program; if not, write to the Free Software
james@0 17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
james@0 18 */
james@0 19
james@0 20 #if !defined(_XENPCI_H_)
james@0 21 #define _XENPCI_H_
james@0 22
james@0 23 #define __attribute__(arg) /* empty */
james@0 24 #define EISCONN 127
james@0 25
james@0 26 #include <ntddk.h>
andy@338 27
andy@338 28 #ifdef __MINGW32__
andy@328 29 #define KeMemoryBarrier() asm("mfence;")
andy@340 30 /* mingw-runtime 3.13 is buggy */
andy@340 31 #undef KeGetCurrentProcessorNumber
andy@340 32 #define KeGetCurrentProcessorNumber() \
andy@340 33 ((ULONG)KeGetCurrentKPCR()->Number)
andy@328 34 #else
andy@338 35 #define DDKAPI
james@0 36 #include <wdm.h>
james@258 37 //#include <wdf.h>
james@0 38 #include <initguid.h>
james@0 39 #include <wdmguid.h>
james@0 40 #include <errno.h>
james@0 41 #define NTSTRSAFE_LIB
james@0 42 #include <ntstrsafe.h>
andy@302 43 #endif
james@0 44
james@74 45 #define __DRIVER_NAME "XenPCI"
james@74 46
james@0 47 #include <xen_windows.h>
james@0 48 #include <memory.h>
james@0 49 #include <grant_table.h>
james@0 50 #include <event_channel.h>
james@0 51 #include <hvm/params.h>
james@0 52 #include <hvm/hvm_op.h>
james@198 53 #include <sched.h>
james@267 54 #include <io/xenbus.h>
james@0 55
andy@15 56 #include <xen_public.h>
andy@15 57
james@0 58 //{C828ABE9-14CA-4445-BAA6-82C2376C6518}
james@0 59 DEFINE_GUID( GUID_XENPCI_DEVCLASS, 0xC828ABE9, 0x14CA, 0x4445, 0xBA, 0xA6, 0x82, 0xC2, 0x37, 0x6C, 0x65, 0x18);
james@0 60
james@0 61 #define XENPCI_POOL_TAG (ULONG) 'XenP'
james@0 62
james@0 63 #define NR_RESERVED_ENTRIES 8
james@0 64 #define NR_GRANT_FRAMES 4
james@0 65 #define NR_GRANT_ENTRIES (NR_GRANT_FRAMES * PAGE_SIZE / sizeof(grant_entry_t))
james@0 66
james@0 67 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
james@0 68
james@267 69 #define EVT_ACTION_TYPE_EMPTY 0
james@267 70 #define EVT_ACTION_TYPE_NORMAL 1
james@267 71 #define EVT_ACTION_TYPE_DPC 2
james@267 72 #define EVT_ACTION_TYPE_IRQ 3
james@267 73
andy@13 74 typedef struct _ev_action_t {
andy@13 75 PKSERVICE_ROUTINE ServiceRoutine;
andy@13 76 PVOID ServiceContext;
james@267 77 ULONG type; /* EVT_ACTION_TYPE_* */
james@258 78 KDPC Dpc;
james@267 79 ULONG vector;
andy@13 80 ULONG Count;
james@341 81 PVOID xpdd;
andy@13 82 } ev_action_t;
james@0 83
andy@15 84 typedef struct _XENBUS_WATCH_RING
andy@15 85 {
andy@15 86 char Path[128];
andy@15 87 char Token[10];
andy@15 88 } XENBUS_WATCH_RING;
james@0 89
andy@15 90 typedef struct _XENBUS_REQ_INFO
andy@15 91 {
andy@15 92 int In_Use:1;
andy@15 93 KEVENT WaitEvent;
andy@15 94 void *Reply;
andy@15 95 } XENBUS_REQ_INFO;
james@0 96
andy@15 97 typedef struct _XENBUS_WATCH_ENTRY {
andy@15 98 char Path[128];
andy@15 99 PXENBUS_WATCH_CALLBACK ServiceRoutine;
andy@15 100 PVOID ServiceContext;
andy@15 101 int Count;
andy@15 102 int Active;
james@138 103 int RemovePending;
james@128 104 int Running;
james@128 105 KEVENT CompleteEvent;
andy@15 106 } XENBUS_WATCH_ENTRY, *PXENBUS_WATCH_ENTRY;
james@0 107
andy@13 108 #define NR_EVENTS 1024
andy@15 109 #define WATCH_RING_SIZE 128
andy@15 110 #define NR_XB_REQS 32
andy@15 111 #define MAX_WATCH_ENTRIES 128
james@0 112
james@259 113 #define CHILD_STATE_EMPTY 0
james@259 114 #define CHILD_STATE_DELETED 1
james@259 115 #define CHILD_STATE_ADDED 2
james@259 116
james@259 117 // TODO: tidy up & organize this struct
james@258 118
james@274 119 typedef enum {
james@274 120 Unknown = 0,
james@274 121 NotStarted,
james@274 122 Started,
james@274 123 StopPending,
james@274 124 Stopped,
james@274 125 RemovePending,
james@274 126 SurpriseRemovePending,
james@274 127 Removed
james@274 128 } DEVICE_PNP_STATE;
james@274 129
james@258 130 typedef struct
james@258 131 {
james@258 132 PDEVICE_OBJECT fdo;
james@258 133 PDEVICE_OBJECT pdo;
james@258 134 PDEVICE_OBJECT lower_do;
james@274 135
james@284 136 DEVICE_PNP_STATE current_pnp_state;
james@284 137 DEVICE_PNP_STATE previous_pnp_state;
james@274 138 DEVICE_POWER_STATE device_power_state;
james@284 139 SYSTEM_POWER_STATE system_power_state;
james@284 140
james@284 141 ULONG device_usage_paging;
james@284 142 ULONG device_usage_dump;
james@284 143 ULONG device_usage_hibernation;
james@259 144 } XENPCI_COMMON, *PXENPCI_COMMON;
james@259 145
andy@302 146 static __inline void INIT_PNP_STATE(PXENPCI_COMMON common)
james@284 147 {
james@284 148 common->current_pnp_state = NotStarted;
james@284 149 common->previous_pnp_state = NotStarted;
james@284 150 }
james@284 151
andy@302 152 static __inline void SET_PNP_STATE(PXENPCI_COMMON common, DEVICE_PNP_STATE state)
james@284 153 {
james@284 154 common->previous_pnp_state = common->current_pnp_state;
james@284 155 common->current_pnp_state = state;
james@284 156 }
james@284 157
andy@302 158 static __inline void REVERT_PNP_STATE(PXENPCI_COMMON common)
james@284 159 {
james@284 160 common->current_pnp_state = common->previous_pnp_state;
james@284 161 }
james@284 162
james@272 163 #define SHUTDOWN_RING_SIZE 128
james@272 164
james@259 165 typedef struct {
james@259 166 XENPCI_COMMON common;
james@259 167
andy@38 168 BOOLEAN XenBus_ShuttingDown;
james@0 169
james@258 170 PKINTERRUPT interrupt;
james@258 171 ULONG irq_number;
james@258 172 ULONG irq_vector;
james@258 173 KIRQL irq_level;
james@258 174 KAFFINITY irq_affinity;
james@0 175
james@341 176 PHYSICAL_ADDRESS shared_info_area_unmapped;
andy@13 177 shared_info_t *shared_info_area;
james@0 178
andy@13 179 PHYSICAL_ADDRESS platform_mmio_addr;
andy@13 180 ULONG platform_mmio_orig_len;
andy@13 181 ULONG platform_mmio_len;
andy@13 182 ULONG platform_mmio_alloc;
james@267 183 USHORT platform_mmio_flags;
andy@13 184
andy@13 185 char *hypercall_stubs;
andy@13 186
andy@13 187 evtchn_port_t xen_store_evtchn;
andy@13 188
andy@13 189 grant_entry_t *gnttab_table;
andy@13 190 PHYSICAL_ADDRESS gnttab_table_physical;
andy@13 191 grant_ref_t gnttab_list[NR_GRANT_ENTRIES];
andy@13 192
andy@13 193 ev_action_t ev_actions[NR_EVENTS];
james@258 194 // unsigned long bound_ports[NR_EVENTS/(8*sizeof(unsigned long))];
james@0 195
andy@15 196 HANDLE XenBus_ReadThreadHandle;
andy@15 197 KEVENT XenBus_ReadThreadEvent;
andy@15 198 HANDLE XenBus_WatchThreadHandle;
andy@15 199 KEVENT XenBus_WatchThreadEvent;
andy@15 200
andy@15 201 XENBUS_WATCH_RING XenBus_WatchRing[WATCH_RING_SIZE];
andy@15 202 int XenBus_WatchRingReadIndex;
andy@15 203 int XenBus_WatchRingWriteIndex;
andy@15 204
andy@15 205 struct xenstore_domain_interface *xen_store_interface;
andy@15 206
andy@15 207 XENBUS_REQ_INFO req_info[NR_XB_REQS];
andy@15 208 int nr_live_reqs;
andy@15 209 XENBUS_WATCH_ENTRY XenBus_WatchEntries[MAX_WATCH_ENTRIES];
james@0 210
james@128 211 KSPIN_LOCK WatchLock;
james@176 212 KSPIN_LOCK grant_lock;
james@191 213
andy@302 214 //KGUARDED_MUTEX WatchHandlerMutex;
james@198 215
james@259 216 LIST_ENTRY child_list;
james@258 217
james@198 218 int suspending;
james@271 219
james@271 220 UNICODE_STRING interface_name;
james@272 221 BOOLEAN interface_open;
james@272 222
james@272 223 KSPIN_LOCK shutdown_ring_lock;
james@272 224 CHAR shutdown_ring[SHUTDOWN_RING_SIZE];
james@272 225 ULONG shutdown_prod;
james@272 226 ULONG shutdown_cons;
james@272 227 ULONG shutdown_start; /* the start of the most recent message on the ring */
james@272 228 PIRP shutdown_irp;
james@0 229 } XENPCI_DEVICE_DATA, *PXENPCI_DEVICE_DATA;
james@0 230
james@259 231 typedef struct {
james@259 232 XENPCI_COMMON common;
james@291 233 PDEVICE_OBJECT bus_pdo;
james@261 234 PDEVICE_OBJECT bus_fdo;
james@312 235 BOOLEAN eject_requested;
james@312 236 BOOLEAN reported_missing;
james@259 237 char path[128];
james@267 238 char device[128];
james@259 239 ULONG index;
james@267 240 ULONG irq_vector;
james@267 241 KIRQL irq_level;
james@267 242 char backend_path[128];
james@314 243 //PVOID xenbus_request;
james@267 244 KEVENT backend_state_event;
james@267 245 ULONG backend_state;
james@314 246 PHYSICAL_ADDRESS config_page_phys;
james@314 247 ULONG config_page_length;
james@342 248 PUCHAR requested_resources_start;
james@342 249 PUCHAR requested_resources_ptr;
james@314 250 PUCHAR assigned_resources_start;
james@314 251 PUCHAR assigned_resources_ptr;
james@342 252 XENPCI_DEVICE_STATE device_state;
james@259 253 } XENPCI_PDO_DEVICE_DATA, *PXENPCI_PDO_DEVICE_DATA;
james@0 254
james@259 255 typedef struct
james@259 256 {
james@259 257 LIST_ENTRY entry;
james@259 258 int state;
james@259 259 PXENPCI_PDO_DEVICE_DATA context;
james@259 260 } XEN_CHILD, *PXEN_CHILD;
james@267 261
andy@324 262 #ifdef __GNUC__
andy@338 263 #define SWINT(x) if (intno == x) { asm ("int $"#x";"); return;}
andy@324 264 #else
andy@338 265 #define SWINT(x) if (intno == x) { __asm { int x } return; }
andy@324 266 #endif
andy@304 267
james@274 268 #if defined(_X86_)
james@267 269 static __inline VOID
james@267 270 sw_interrupt(UCHAR intno)
james@267 271 {
james@269 272 //KdPrint((__DRIVER_NAME " Calling interrupt %02X\n", intno));
andy@304 273 SWINT(0x10) SWINT(0x11) SWINT(0x12) SWINT(0x13) SWINT(0x14) SWINT(0x15) SWINT(0x16) SWINT(0x17)
andy@304 274 SWINT(0x18) SWINT(0x19) SWINT(0x1A) SWINT(0x1B) SWINT(0x1C) SWINT(0x1D) SWINT(0x1E) SWINT(0x1F)
andy@304 275 SWINT(0x20) SWINT(0x21) SWINT(0x22) SWINT(0x23) SWINT(0x24) SWINT(0x25) SWINT(0x26) SWINT(0x27)
andy@304 276 SWINT(0x28) SWINT(0x29) SWINT(0x2A) SWINT(0x2B) SWINT(0x2C) SWINT(0x2D) SWINT(0x2E) SWINT(0x2F)
andy@304 277 SWINT(0x30) SWINT(0x31) SWINT(0x32) SWINT(0x33) SWINT(0x34) SWINT(0x35) SWINT(0x36) SWINT(0x37)
andy@304 278 SWINT(0x38) SWINT(0x39) SWINT(0x3A) SWINT(0x3B) SWINT(0x3C) SWINT(0x3D) SWINT(0x3E) SWINT(0x3F)
andy@304 279 SWINT(0x40) SWINT(0x41) SWINT(0x42) SWINT(0x43) SWINT(0x44) SWINT(0x45) SWINT(0x46) SWINT(0x47)
andy@304 280 SWINT(0x48) SWINT(0x49) SWINT(0x4A) SWINT(0x4B) SWINT(0x4C) SWINT(0x4D) SWINT(0x4E) SWINT(0x4F)
andy@304 281 SWINT(0x50) SWINT(0x51) SWINT(0x52) SWINT(0x53) SWINT(0x54) SWINT(0x55) SWINT(0x56) SWINT(0x57)
andy@304 282 SWINT(0x58) SWINT(0x59) SWINT(0x5A) SWINT(0x5B) SWINT(0x5C) SWINT(0x5D) SWINT(0x5E) SWINT(0x5F)
andy@304 283 SWINT(0x60) SWINT(0x61) SWINT(0x62) SWINT(0x63) SWINT(0x64) SWINT(0x65) SWINT(0x66) SWINT(0x67)
andy@304 284 SWINT(0x68) SWINT(0x69) SWINT(0x6A) SWINT(0x6B) SWINT(0x6C) SWINT(0x6D) SWINT(0x6E) SWINT(0x6F)
andy@304 285 SWINT(0x70) SWINT(0x71) SWINT(0x72) SWINT(0x73) SWINT(0x74) SWINT(0x75) SWINT(0x76) SWINT(0x77)
andy@304 286 SWINT(0x78) SWINT(0x79) SWINT(0x7A) SWINT(0x7B) SWINT(0x7C) SWINT(0x7D) SWINT(0x7E) SWINT(0x7F)
andy@304 287 SWINT(0x80) SWINT(0x81) SWINT(0x82) SWINT(0x83) SWINT(0x84) SWINT(0x85) SWINT(0x86) SWINT(0x87)
andy@304 288 SWINT(0x88) SWINT(0x89) SWINT(0x8A) SWINT(0x8B) SWINT(0x8C) SWINT(0x8D) SWINT(0x8E) SWINT(0x8F)
andy@304 289 SWINT(0x90) SWINT(0x91) SWINT(0x92) SWINT(0x93) SWINT(0x94) SWINT(0x95) SWINT(0x96) SWINT(0x97)
andy@304 290 SWINT(0x98) SWINT(0x99) SWINT(0x9A) SWINT(0x9B) SWINT(0x9C) SWINT(0x9D) SWINT(0x9E) SWINT(0x9F)
andy@304 291 SWINT(0xA0) SWINT(0xA1) SWINT(0xA2) SWINT(0xA3) SWINT(0xA4) SWINT(0xA5) SWINT(0xA6) SWINT(0xA7)
andy@304 292 SWINT(0xA8) SWINT(0xA9) SWINT(0xAA) SWINT(0xAB) SWINT(0xAC) SWINT(0xAD) SWINT(0xAE) SWINT(0xAF)
andy@304 293 SWINT(0xB0) SWINT(0xB1) SWINT(0xB2) SWINT(0xB3) SWINT(0xB4) SWINT(0xB5) SWINT(0xB6) SWINT(0xB7)
andy@304 294 SWINT(0xB8) SWINT(0xB9) SWINT(0xBA) SWINT(0xBB) SWINT(0xBC) SWINT(0xBD) SWINT(0xBE) SWINT(0xBF)
andy@304 295 SWINT(0xC0) SWINT(0xC1) SWINT(0xC2) SWINT(0xC3) SWINT(0xC4) SWINT(0xC5) SWINT(0xC6) SWINT(0xC7)
andy@304 296 SWINT(0xC8) SWINT(0xC9) SWINT(0xCA) SWINT(0xCB) SWINT(0xCC) SWINT(0xCD) SWINT(0xCE) SWINT(0xCF)
andy@304 297 SWINT(0xD0) SWINT(0xD1) SWINT(0xD2) SWINT(0xD3) SWINT(0xD4) SWINT(0xD5) SWINT(0xD6) SWINT(0xD7)
andy@304 298 SWINT(0xD8) SWINT(0xD9) SWINT(0xDA) SWINT(0xDB) SWINT(0xDC) SWINT(0xDD) SWINT(0xDE) SWINT(0xDF)
andy@304 299 SWINT(0xE0) SWINT(0xE1) SWINT(0xE2) SWINT(0xE3) SWINT(0xE4) SWINT(0xE5) SWINT(0xE6) SWINT(0xE7)
andy@304 300 SWINT(0xE8) SWINT(0xE9) SWINT(0xEA) SWINT(0xEB) SWINT(0xEC) SWINT(0xED) SWINT(0xEE) SWINT(0xEF)
andy@304 301 SWINT(0xF0) SWINT(0xF1) SWINT(0xF2) SWINT(0xF3) SWINT(0xF4) SWINT(0xF5) SWINT(0xF6) SWINT(0xF7)
andy@304 302 SWINT(0xF8) SWINT(0xF9) SWINT(0xFA) SWINT(0xFB) SWINT(0xFC) SWINT(0xFD) SWINT(0xFE) SWINT(0xFF)
andy@304 303
andy@338 304 /* not found */
andy@338 305 KdPrint((__DRIVER_NAME " interrupt %02X not set up. Blame James.\n", intno));
andy@338 306 KeBugCheckEx(('X' << 16)|('E' << 8)|('N'), 0x00000002, (ULONG)intno, 0x00000000, 0x00000000);
andy@304 307 }
james@274 308 #else
james@274 309 VOID _sw_interrupt(UCHAR);
james@274 310
james@274 311 static __inline VOID
james@274 312 sw_interrupt(UCHAR intno)
james@274 313 {
james@274 314 _sw_interrupt(intno);
james@274 315 }
james@274 316 #endif
james@274 317
james@259 318
james@258 319 #include "hypercall.h"
james@124 320
james@0 321 #define XBT_NIL ((xenbus_transaction_t)0)
james@0 322
james@267 323 static __inline VOID
james@267 324 XenPci_FreeMem(PVOID Ptr)
james@267 325 {
james@267 326 ExFreePoolWithTag(Ptr, XENPCI_POOL_TAG);
james@267 327 }
james@267 328
james@259 329 NTSTATUS
andy@332 330 hvm_get_stubs(PXENPCI_DEVICE_DATA xpdd);
andy@332 331 NTSTATUS
andy@332 332 hvm_free_stubs(PXENPCI_DEVICE_DATA xpdd);
andy@332 333
andy@332 334 NTSTATUS
james@259 335 XenPci_Power_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
james@259 336 NTSTATUS
james@259 337 XenPci_Dummy_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
james@259 338 NTSTATUS
james@259 339 XenPci_Pnp_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
james@272 340 NTSTATUS
james@272 341 XenPci_Irp_Create_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
james@272 342 NTSTATUS
james@272 343 XenPci_Irp_Close_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
james@272 344 NTSTATUS
james@272 345 XenPci_Irp_Read_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
james@272 346 NTSTATUS
james@272 347 XenPci_Irp_Cleanup_Fdo(PDEVICE_OBJECT device_object, PIRP irp);
james@259 348
james@259 349 NTSTATUS
james@259 350 XenPci_Power_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
james@272 351 //NTSTATUS
james@272 352 //XenPci_Dummy_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
james@259 353 NTSTATUS
james@259 354 XenPci_Pnp_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
james@272 355 NTSTATUS
james@272 356 XenPci_Irp_Create_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
james@272 357 NTSTATUS
james@272 358 XenPci_Irp_Close_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
james@272 359 NTSTATUS
james@272 360 XenPci_Irp_Read_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
james@272 361 NTSTATUS
james@272 362 XenPci_Irp_Cleanup_Pdo(PDEVICE_OBJECT device_object, PIRP irp);
james@259 363
james@342 364 NTSTATUS
james@342 365 XenPci_Resume(PDEVICE_OBJECT device_object);
james@259 366
james@0 367 char *
andy@13 368 XenBus_Read(PVOID Context, xenbus_transaction_t xbt, const char *path, char **value);
james@0 369 char *
andy@13 370 XenBus_Write(PVOID Context, xenbus_transaction_t xbt, const char *path, const char *value);
james@0 371 char *
andy@13 372 XenBus_Printf(PVOID Context, xenbus_transaction_t xbt, const char *path, const char *fmt, ...);
james@0 373 char *
andy@13 374 XenBus_StartTransaction(PVOID Context, xenbus_transaction_t *xbt);
james@0 375 char *
andy@13 376 XenBus_EndTransaction(PVOID Context, xenbus_transaction_t t, int abort, int *retry);
andy@13 377 char *
andy@13 378 XenBus_List(PVOID Context, xenbus_transaction_t xbt, const char *prefix, char ***contents);
james@0 379 char *
andy@13 380 XenBus_AddWatch(PVOID Context, xenbus_transaction_t xbt, const char *Path, PXENBUS_WATCH_CALLBACK ServiceRoutine, PVOID ServiceContext);
james@0 381 char *
andy@13 382 XenBus_RemWatch(PVOID Context, xenbus_transaction_t xbt, const char *Path, PXENBUS_WATCH_CALLBACK ServiceRoutine, PVOID ServiceContext);
james@279 383 //VOID
james@279 384 //XenBus_ThreadProc(PVOID StartContext);
james@258 385 NTSTATUS
james@258 386 XenBus_Init(PXENPCI_DEVICE_DATA xpdd);
james@258 387 NTSTATUS
james@258 388 XenBus_Close(PXENPCI_DEVICE_DATA xpdd);
james@258 389 NTSTATUS
james@258 390 XenBus_Start(PXENPCI_DEVICE_DATA xpdd);
james@258 391 NTSTATUS
james@258 392 XenBus_Stop(PXENPCI_DEVICE_DATA xpdd);
james@279 393 VOID
james@279 394 XenBus_Resume(PXENPCI_DEVICE_DATA xpdd);
james@0 395
james@0 396 PHYSICAL_ADDRESS
james@258 397 XenPci_AllocMMIO(PXENPCI_DEVICE_DATA xpdd, ULONG len);
james@0 398
andy@15 399 NTSTATUS
james@258 400 EvtChn_Init(PXENPCI_DEVICE_DATA xpdd);
james@342 401 VOID
james@342 402 EvtChn_Resume(PXENPCI_DEVICE_DATA xpdd);
james@258 403 NTSTATUS
james@258 404 EvtChn_Shutdown(PXENPCI_DEVICE_DATA xpdd);
james@258 405
james@0 406 NTSTATUS
andy@13 407 EvtChn_Mask(PVOID Context, evtchn_port_t Port);
james@0 408 NTSTATUS
andy@13 409 EvtChn_Unmask(PVOID Context, evtchn_port_t Port);
james@0 410 NTSTATUS
andy@13 411 EvtChn_Bind(PVOID Context, evtchn_port_t Port, PKSERVICE_ROUTINE ServiceRoutine, PVOID ServiceContext);
james@0 412 NTSTATUS
james@73 413 EvtChn_BindDpc(PVOID Context, evtchn_port_t Port, PKSERVICE_ROUTINE ServiceRoutine, PVOID ServiceContext);
james@73 414 NTSTATUS
james@267 415 EvtChn_BindIrq(PVOID Context, evtchn_port_t Port, ULONG vector);
james@267 416 NTSTATUS
andy@13 417 EvtChn_Unbind(PVOID Context, evtchn_port_t Port);
andy@13 418 NTSTATUS
andy@13 419 EvtChn_Notify(PVOID Context, evtchn_port_t Port);
james@0 420 evtchn_port_t
andy@13 421 EvtChn_AllocUnbound(PVOID Context, domid_t Domain);
james@0 422
andy@15 423 VOID
james@258 424 GntTbl_Init(PXENPCI_DEVICE_DATA xpdd);
james@258 425
james@0 426 grant_ref_t
james@258 427 GntTbl_GrantAccess(PVOID Context, domid_t domid, uint32_t, int readonly, grant_ref_t ref);
james@0 428 BOOLEAN
james@258 429 GntTbl_EndAccess(PVOID Context, grant_ref_t ref, BOOLEAN keepref);
james@206 430 VOID
james@258 431 GntTbl_PutRef(PVOID Context, grant_ref_t ref);
james@206 432 grant_ref_t
james@258 433 GntTbl_GetRef(PVOID Context);
james@279 434 int
james@279 435 GntTbl_Map(PVOID Context, unsigned int start_idx, unsigned int end_idx);
james@0 436 #endif