win-pvdrivers

annotate common/include/xen_public.h @ 497:312a41f82b8f

Updated to support the proposed patches to qemu from Steven Smith on ~20081216
author James Harper <james.harper@bendigoit.com.au>
date Fri Dec 19 22:08:17 2008 +1100 (2008-12-19)
parents a6e3f76419c3
children cb0b2da68686
rev   line source
james@75 1 /*
james@75 2 PV Drivers for Windows Xen HVM Domains
james@75 3 Copyright (C) 2007 James Harper
james@75 4
james@75 5 This program is free software; you can redistribute it and/or
james@75 6 modify it under the terms of the GNU General Public License
james@75 7 as published by the Free Software Foundation; either version 2
james@75 8 of the License, or (at your option) any later version.
james@75 9
james@75 10 This program is distributed in the hope that it will be useful,
james@75 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
james@75 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
james@75 13 GNU General Public License for more details.
james@75 14
james@75 15 You should have received a copy of the GNU General Public License
james@75 16 along with this program; if not, write to the Free Software
james@75 17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
james@75 18 */
james@75 19
james@0 20 #if !defined(_XEN_PUBLIC_H_)
james@0 21 #define _XEN_PUBLIC_H_
james@0 22
james@310 23 #include <grant_table.h>
james@310 24 #include <event_channel.h>
james@269 25 #include <xen_guids.h>
james@0 26 //{5C568AC5-9DDF-4FA5-A94A-39D67077819C}
james@159 27 DEFINE_GUID(GUID_XEN_IFACE, 0x5C568AC5, 0x9DDF, 0x4FA5, 0xA9, 0x4A, 0x39, 0xD6, 0x70, 0x77, 0x81, 0x9C);
james@159 28
james@415 29 #define INVALID_GRANT_REF 0xFFFFFFFF
james@415 30
james@0 31 typedef PHYSICAL_ADDRESS
andy@88 32 (*PXEN_ALLOCMMIO)(PVOID Context, ULONG Length);
james@0 33
andy@88 34 typedef void
james@77 35 (*PXEN_FREEMEM)(PVOID Ptr);
james@77 36
james@75 37 typedef NTSTATUS
james@75 38 (*PXEN_EVTCHN_BIND)(PVOID Context, evtchn_port_t Port, PKSERVICE_ROUTINE ServiceRoutine, PVOID ServiceContext);
james@0 39
james@75 40 typedef NTSTATUS
james@75 41 (*PXEN_EVTCHN_UNBIND)(PVOID Context, evtchn_port_t Port);
james@75 42
james@75 43 typedef NTSTATUS
james@75 44 (*PXEN_EVTCHN_MASK)(PVOID Context, evtchn_port_t Port);
james@75 45
james@75 46 typedef NTSTATUS
james@75 47 (*PXEN_EVTCHN_UNMASK)(PVOID Context, evtchn_port_t Port);
james@75 48
james@75 49 typedef NTSTATUS
james@75 50 (*PXEN_EVTCHN_NOTIFY)(PVOID Context, evtchn_port_t Port);
james@75 51
james@75 52 typedef evtchn_port_t
james@75 53 (*PXEN_EVTCHN_ALLOCUNBOUND)(PVOID Context, domid_t Domain);
james@75 54
james@416 55 typedef BOOLEAN
james@416 56 (*PXEN_EVTCHN_ACK_EVENT)(PVOID context, evtchn_port_t port);
james@416 57
james@75 58 typedef grant_ref_t
james@258 59 (*PXEN_GNTTBL_GRANTACCESS)(PVOID Context, domid_t domid, uint32_t frame, int readonly, grant_ref_t ref);
james@206 60
james@75 61 typedef BOOLEAN
james@258 62 (*PXEN_GNTTBL_ENDACCESS)(PVOID Context, grant_ref_t ref, BOOLEAN keepref);
james@206 63
james@206 64 typedef VOID
james@258 65 (*PXEN_GNTTBL_PUTREF)(PVOID Context, grant_ref_t ref);
james@206 66
james@206 67 typedef grant_ref_t
james@258 68 (*PXEN_GNTTBL_GETREF)(PVOID Context);
james@206 69
james@75 70
james@75 71 typedef VOID
james@75 72 (*PXENBUS_WATCH_CALLBACK)(char *Path, PVOID ServiceContext);
james@75 73
james@75 74 typedef char *
james@75 75 (*PXEN_XENBUS_READ)(PVOID Context, xenbus_transaction_t xbt, const char *path, char **value);
james@75 76
james@75 77 typedef char *
james@75 78 (*PXEN_XENBUS_WRITE)(PVOID Context, xenbus_transaction_t xbt, const char *path, const char *value);
james@75 79
james@75 80 typedef char *
james@75 81 (*PXEN_XENBUS_PRINTF)(PVOID Context, xenbus_transaction_t xbt, const char *path, const char *fmt, ...);
james@75 82
james@75 83 typedef char *
james@75 84 (*PXEN_XENBUS_STARTTRANSACTION)(PVOID Context, xenbus_transaction_t *xbt);
james@75 85
james@75 86 typedef char *
james@75 87 (*PXEN_XENBUS_ENDTRANSACTION)(PVOID Context, xenbus_transaction_t t, int abort, int *retry);
james@75 88
james@75 89 typedef char *
james@75 90 (*PXEN_XENBUS_LIST)(PVOID Context, xenbus_transaction_t xbt, const char *prefix, char ***contents);
james@75 91
james@75 92 typedef char *
james@75 93 (*PXEN_XENBUS_ADDWATCH)(PVOID Context, xenbus_transaction_t xbt, const char *Path, PXENBUS_WATCH_CALLBACK ServiceRoutine, PVOID ServiceContext);
james@75 94
james@75 95 typedef char *
james@75 96 (*PXEN_XENBUS_REMWATCH)(PVOID Context, xenbus_transaction_t xbt, const char *Path, PXENBUS_WATCH_CALLBACK ServiceRoutine, PVOID ServiceContext);
james@75 97
james@274 98 typedef NTSTATUS
james@314 99 (*PXEN_XENPCI_XEN_CONFIG_DEVICE)(PVOID Context);
james@75 100
james@314 101 typedef NTSTATUS
james@314 102 (*PXEN_XENPCI_XEN_SHUTDOWN_DEVICE)(PVOID Context);
james@267 103
james@474 104 #ifndef XENPCI_POOL_TAG
james@474 105 #define XENPCI_POOL_TAG (ULONG) 'XenP'
james@474 106 #endif
james@474 107
james@474 108 static __inline VOID
james@474 109 XenPci_FreeMem(PVOID Ptr)
james@474 110 {
james@474 111 ExFreePoolWithTag(Ptr, XENPCI_POOL_TAG);
james@474 112 }
james@474 113
james@267 114 #define XEN_DATA_MAGIC 0x12345678
james@75 115
james@0 116 typedef struct {
james@267 117 ULONG magic;
james@267 118 USHORT length;
james@0 119
james@267 120 PVOID context;
james@267 121 PXEN_EVTCHN_BIND EvtChn_Bind;
james@267 122 PXEN_EVTCHN_BIND EvtChn_BindDpc;
james@267 123 PXEN_EVTCHN_UNBIND EvtChn_Unbind;
james@267 124 PXEN_EVTCHN_MASK EvtChn_Mask;
james@267 125 PXEN_EVTCHN_UNMASK EvtChn_Unmask;
james@267 126 PXEN_EVTCHN_NOTIFY EvtChn_Notify;
james@416 127 PXEN_EVTCHN_ACK_EVENT EvtChn_AckEvent;
james@416 128
james@267 129 PXEN_GNTTBL_GETREF GntTbl_GetRef;
james@267 130 PXEN_GNTTBL_PUTREF GntTbl_PutRef;
james@267 131 PXEN_GNTTBL_GRANTACCESS GntTbl_GrantAccess;
james@267 132 PXEN_GNTTBL_ENDACCESS GntTbl_EndAccess;
james@465 133
james@314 134 PXEN_XENPCI_XEN_CONFIG_DEVICE XenPci_XenConfigDevice;
james@314 135 PXEN_XENPCI_XEN_SHUTDOWN_DEVICE XenPci_XenShutdownDevice;
james@465 136
james@474 137 CHAR path[128];
james@474 138 CHAR backend_path[128];
james@474 139
james@483 140 evtchn_port_t pdo_event_channel;
james@483 141
james@474 142 PXEN_XENBUS_READ XenBus_Read;
james@474 143 PXEN_XENBUS_WRITE XenBus_Write;
james@474 144 PXEN_XENBUS_PRINTF XenBus_Printf;
james@474 145 PXEN_XENBUS_STARTTRANSACTION XenBus_StartTransaction;
james@474 146 PXEN_XENBUS_ENDTRANSACTION XenBus_EndTransaction;
james@474 147 PXEN_XENBUS_LIST XenBus_List;
james@474 148 PXEN_XENBUS_ADDWATCH XenBus_AddWatch;
james@474 149 PXEN_XENBUS_REMWATCH XenBus_RemWatch;
james@474 150
james@267 151 } XENPCI_VECTORS, *PXENPCI_VECTORS;
james@267 152
james@342 153 #define RESUME_STATE_RUNNING 0
james@401 154 #define RESUME_STATE_SUSPENDING 1
james@401 155 #define RESUME_STATE_BACKEND_RESUME 2
james@401 156 #define RESUME_STATE_FRONTEND_RESUME 3
james@342 157
james@342 158 typedef struct {
james@342 159 ULONG magic;
james@342 160 USHORT length;
james@342 161
james@342 162 ULONG resume_state;
james@401 163 ULONG resume_state_ack;
james@342 164 } XENPCI_DEVICE_STATE, *PXENPCI_DEVICE_STATE;
james@267 165
james@490 166 #define XEN_INIT_DRIVER_EXTENSION_MAGIC ((ULONG)'XCFG')
james@490 167
james@497 168 #define XEN_INIT_TYPE_END 0
james@497 169 #define XEN_INIT_TYPE_WRITE_STRING 1
james@497 170 #define XEN_INIT_TYPE_RING 2
james@497 171 #define XEN_INIT_TYPE_EVENT_CHANNEL 3
james@497 172 #define XEN_INIT_TYPE_EVENT_CHANNEL_IRQ 4
james@497 173 #define XEN_INIT_TYPE_READ_STRING_FRONT 5
james@497 174 #define XEN_INIT_TYPE_READ_STRING_BACK 6
james@497 175 #define XEN_INIT_TYPE_VECTORS 7
james@497 176 #define XEN_INIT_TYPE_GRANT_ENTRIES 8
james@497 177 //#define XEN_INIT_TYPE_COPY_PTR 9
james@497 178 #define XEN_INIT_TYPE_RUN 10
james@497 179 #define XEN_INIT_TYPE_STATE_PTR 11
james@497 180 #define XEN_INIT_TYPE_ACTIVE 12
james@497 181 #define XEN_INIT_TYPE_QEMU_PROTOCOL_VERSION 13
james@267 182
james@267 183 static __inline VOID
james@267 184 __ADD_XEN_INIT_UCHAR(PUCHAR *ptr, UCHAR val)
james@267 185 {
james@342 186 // KdPrint((__DRIVER_NAME " ADD_XEN_INIT_UCHAR *ptr = %p, val = %d\n", *ptr, val));
james@267 187 *(PUCHAR)(*ptr) = val;
james@267 188 *ptr += sizeof(UCHAR);
james@267 189 }
james@267 190
james@267 191 static __inline VOID
james@267 192 __ADD_XEN_INIT_USHORT(PUCHAR *ptr, USHORT val)
james@267 193 {
james@342 194 // KdPrint((__DRIVER_NAME " ADD_XEN_INIT_USHORT *ptr = %p, val = %d\n", *ptr, val));
james@267 195 *(PUSHORT)(*ptr) = val;
james@267 196 *ptr += sizeof(USHORT);
james@267 197 }
james@267 198
james@267 199 static __inline VOID
james@267 200 __ADD_XEN_INIT_ULONG(PUCHAR *ptr, ULONG val)
james@267 201 {
james@342 202 // KdPrint((__DRIVER_NAME " ADD_XEN_INIT_ULONG *ptr = %p, val = %d\n", *ptr, val));
james@267 203 *(PULONG)(*ptr) = val;
james@267 204 *ptr += sizeof(ULONG);
james@267 205 }
james@267 206
james@267 207 static __inline VOID
james@267 208 __ADD_XEN_INIT_PTR(PUCHAR *ptr, PVOID val)
james@267 209 {
james@342 210 // KdPrint((__DRIVER_NAME " ADD_XEN_INIT_PTR *ptr = %p, val = %p\n", *ptr, val));
james@267 211 *(PVOID *)(*ptr) = val;
james@267 212 *ptr += sizeof(PVOID);
james@267 213 }
james@267 214
james@267 215 static __inline VOID
james@267 216 __ADD_XEN_INIT_STRING(PUCHAR *ptr, PCHAR val)
james@267 217 {
james@342 218 // KdPrint((__DRIVER_NAME " ADD_XEN_INIT_STRING *ptr = %p, val = %s\n", *ptr, val));
james@314 219 RtlStringCbCopyA((PCHAR)*ptr, PAGE_SIZE - (PtrToUlong(*ptr) & (PAGE_SIZE - 1)), val);
james@267 220 *ptr += strlen(val) + 1;
james@267 221 }
james@267 222
james@267 223 static __inline UCHAR
james@267 224 __GET_XEN_INIT_UCHAR(PUCHAR *ptr)
james@267 225 {
james@267 226 UCHAR retval;
james@267 227 retval = **ptr;
james@342 228 // KdPrint((__DRIVER_NAME " GET_XEN_INIT_UCHAR *ptr = %p, retval = %d\n", *ptr, retval));
james@267 229 *ptr += sizeof(UCHAR);
james@267 230 return retval;
james@267 231 }
james@267 232
james@267 233 static __inline USHORT
james@267 234 __GET_XEN_INIT_USHORT(PUCHAR *ptr)
james@267 235 {
james@267 236 USHORT retval;
james@267 237 retval = *(PUSHORT)*ptr;
james@342 238 // KdPrint((__DRIVER_NAME " GET_XEN_INIT_USHORT *ptr = %p, retval = %d\n", *ptr, retval));
james@267 239 *ptr += sizeof(USHORT);
james@267 240 return retval;
james@267 241 }
james@267 242
james@267 243 static __inline ULONG
james@267 244 __GET_XEN_INIT_ULONG(PUCHAR *ptr)
james@267 245 {
james@267 246 ULONG retval;
james@267 247 retval = *(PLONG)*ptr;
james@342 248 // KdPrint((__DRIVER_NAME " GET_XEN_INIT_ULONG *ptr = %p, retval = %d\n", *ptr, retval));
james@267 249 *ptr += sizeof(ULONG);
james@267 250 return retval;
james@267 251 }
james@267 252
james@267 253 static __inline PCHAR
james@267 254 __GET_XEN_INIT_STRING(PUCHAR *ptr)
james@267 255 {
james@267 256 PCHAR retval;
james@267 257 retval = (PCHAR)*ptr;
james@342 258 // KdPrint((__DRIVER_NAME " GET_XEN_INIT_STRING *ptr = %p, retval = %s\n", *ptr, retval));
james@267 259 *ptr += strlen((PCHAR)*ptr) + 1;
james@267 260 return retval;
james@267 261 }
james@267 262
james@267 263 static __inline PVOID
james@267 264 __GET_XEN_INIT_PTR(PUCHAR *ptr)
james@267 265 {
james@267 266 PVOID retval;
james@267 267 retval = *(PVOID *)(*ptr);
james@342 268 // KdPrint((__DRIVER_NAME " GET_XEN_INIT_PTR *ptr = %p, retval = %p\n", *ptr, retval));
james@267 269 *ptr += sizeof(PVOID);
james@267 270 return retval;
james@267 271 }
james@267 272
james@267 273 static __inline VOID
james@267 274 ADD_XEN_INIT_REQ(PUCHAR *ptr, UCHAR type, PVOID p1, PVOID p2)
james@267 275 {
james@267 276 __ADD_XEN_INIT_UCHAR(ptr, type);
james@267 277 switch (type)
james@267 278 {
james@267 279 case XEN_INIT_TYPE_END:
james@267 280 case XEN_INIT_TYPE_VECTORS:
james@314 281 case XEN_INIT_TYPE_RUN:
james@342 282 case XEN_INIT_TYPE_STATE_PTR:
james@495 283 case XEN_INIT_TYPE_ACTIVE:
james@497 284 case XEN_INIT_TYPE_QEMU_PROTOCOL_VERSION:
james@267 285 break;
james@267 286 case XEN_INIT_TYPE_WRITE_STRING:
steve@472 287 __ADD_XEN_INIT_STRING(ptr, (PCHAR) p1);
steve@472 288 __ADD_XEN_INIT_STRING(ptr, (PCHAR) p2);
james@267 289 break;
james@267 290 case XEN_INIT_TYPE_RING:
james@267 291 case XEN_INIT_TYPE_EVENT_CHANNEL:
james@267 292 case XEN_INIT_TYPE_EVENT_CHANNEL_IRQ:
james@267 293 case XEN_INIT_TYPE_READ_STRING_FRONT:
james@267 294 case XEN_INIT_TYPE_READ_STRING_BACK:
steve@472 295 __ADD_XEN_INIT_STRING(ptr, (PCHAR) p1);
james@267 296 break;
james@267 297 case XEN_INIT_TYPE_GRANT_ENTRIES:
james@310 298 __ADD_XEN_INIT_ULONG(ptr, PtrToUlong(p2));
james@267 299 break;
james@314 300 // case XEN_INIT_TYPE_COPY_PTR:
james@314 301 // __ADD_XEN_INIT_STRING(ptr, p1);
james@314 302 // __ADD_XEN_INIT_PTR(ptr, p2);
james@465 303 // break;
james@267 304 }
james@267 305 }
james@267 306
james@267 307 static __inline UCHAR
james@267 308 GET_XEN_INIT_REQ(PUCHAR *ptr, PVOID *p1, PVOID *p2)
james@267 309 {
james@267 310 UCHAR retval;
james@267 311
james@267 312 retval = __GET_XEN_INIT_UCHAR(ptr);
james@267 313 switch (retval)
james@267 314 {
james@267 315 case XEN_INIT_TYPE_END:
james@267 316 case XEN_INIT_TYPE_VECTORS:
james@314 317 case XEN_INIT_TYPE_RUN:
james@342 318 case XEN_INIT_TYPE_STATE_PTR:
james@495 319 case XEN_INIT_TYPE_ACTIVE:
james@497 320 case XEN_INIT_TYPE_QEMU_PROTOCOL_VERSION:
james@267 321 *p1 = NULL;
james@267 322 *p2 = NULL;
james@267 323 break;
james@267 324 case XEN_INIT_TYPE_WRITE_STRING:
james@267 325 *p1 = __GET_XEN_INIT_STRING(ptr);
james@267 326 *p2 = __GET_XEN_INIT_STRING(ptr);
james@267 327 break;
james@267 328 case XEN_INIT_TYPE_RING:
james@267 329 case XEN_INIT_TYPE_EVENT_CHANNEL:
james@267 330 case XEN_INIT_TYPE_EVENT_CHANNEL_IRQ:
james@267 331 case XEN_INIT_TYPE_READ_STRING_FRONT:
james@267 332 case XEN_INIT_TYPE_READ_STRING_BACK:
james@267 333 *p1 = __GET_XEN_INIT_STRING(ptr);
james@267 334 *p2 = NULL;
james@267 335 break;
james@267 336 case XEN_INIT_TYPE_GRANT_ENTRIES:
james@310 337 *p2 = UlongToPtr(__GET_XEN_INIT_ULONG(ptr));
james@267 338 break;
james@314 339 // case XEN_INIT_TYPE_COPY_PTR:
james@314 340 // *p1 = __GET_XEN_INIT_STRING(ptr);
james@314 341 // *p2 = __GET_XEN_INIT_PTR(ptr);
james@465 342 // break;
james@267 343 }
james@267 344 return retval;
james@267 345 }
james@267 346
james@267 347 static __inline VOID
james@267 348 ADD_XEN_INIT_RSP(PUCHAR *ptr, UCHAR type, PVOID p1, PVOID p2)
james@267 349 {
james@267 350 __ADD_XEN_INIT_UCHAR(ptr, type);
james@267 351 switch (type)
james@267 352 {
james@267 353 case XEN_INIT_TYPE_END:
james@267 354 case XEN_INIT_TYPE_WRITE_STRING: /* this shouldn't happen */
james@314 355 case XEN_INIT_TYPE_RUN:
james@495 356 case XEN_INIT_TYPE_ACTIVE:
james@267 357 break;
james@267 358 case XEN_INIT_TYPE_RING:
steve@472 359 __ADD_XEN_INIT_STRING(ptr, (PCHAR) p1);
james@267 360 __ADD_XEN_INIT_PTR(ptr, p2);
james@267 361 break;
james@267 362 case XEN_INIT_TYPE_EVENT_CHANNEL:
james@267 363 case XEN_INIT_TYPE_EVENT_CHANNEL_IRQ:
steve@472 364 __ADD_XEN_INIT_STRING(ptr, (PCHAR) p1);
james@267 365 __ADD_XEN_INIT_ULONG(ptr, PtrToUlong(p2));
james@267 366 break;
james@267 367 case XEN_INIT_TYPE_READ_STRING_FRONT:
james@267 368 case XEN_INIT_TYPE_READ_STRING_BACK:
steve@472 369 __ADD_XEN_INIT_STRING(ptr, (PCHAR) p1);
steve@472 370 __ADD_XEN_INIT_STRING(ptr, (PCHAR) p2);
james@267 371 break;
james@267 372 case XEN_INIT_TYPE_VECTORS:
james@267 373 //__ADD_XEN_INIT_ULONG(ptr, PtrToUlong(p1));
james@267 374 memcpy(*ptr, p2, sizeof(XENPCI_VECTORS));
james@267 375 *ptr += sizeof(XENPCI_VECTORS);
james@267 376 break;
james@267 377 case XEN_INIT_TYPE_GRANT_ENTRIES:
james@267 378 __ADD_XEN_INIT_ULONG(ptr, PtrToUlong(p1));
james@267 379 memcpy(*ptr, p2, PtrToUlong(p1) * sizeof(grant_entry_t));
james@267 380 *ptr += PtrToUlong(p1) * sizeof(grant_entry_t);
james@267 381 break;
james@342 382 case XEN_INIT_TYPE_STATE_PTR:
james@342 383 __ADD_XEN_INIT_PTR(ptr, p2);
james@342 384 break;
james@497 385 case XEN_INIT_TYPE_QEMU_PROTOCOL_VERSION:
james@497 386 __ADD_XEN_INIT_ULONG(ptr, PtrToUlong(p2));
james@497 387 break;
james@314 388 // case XEN_INIT_TYPE_COPY_PTR:
james@314 389 // __ADD_XEN_INIT_STRING(ptr, p1);
james@314 390 // __ADD_XEN_INIT_PTR(ptr, p2);
james@314 391 // break;
james@267 392 }
james@267 393 }
james@267 394
james@267 395 static __inline UCHAR
james@267 396 GET_XEN_INIT_RSP(PUCHAR *ptr, PVOID *p1, PVOID *p2)
james@267 397 {
james@267 398 UCHAR retval;
james@267 399
james@267 400 retval = __GET_XEN_INIT_UCHAR(ptr);
james@267 401 switch (retval)
james@267 402 {
james@267 403 case XEN_INIT_TYPE_END:
james@314 404 case XEN_INIT_TYPE_RUN:
james@495 405 case XEN_INIT_TYPE_ACTIVE:
james@267 406 *p1 = NULL;
james@267 407 *p2 = NULL;
james@267 408 break;
james@267 409 case XEN_INIT_TYPE_WRITE_STRING:
james@267 410 // this shouldn't happen - no response here
james@267 411 break;
james@267 412 case XEN_INIT_TYPE_RING:
james@267 413 *p1 = __GET_XEN_INIT_STRING(ptr);
james@267 414 *p2 = __GET_XEN_INIT_PTR(ptr);
james@267 415 break;
james@267 416 case XEN_INIT_TYPE_EVENT_CHANNEL:
james@267 417 case XEN_INIT_TYPE_EVENT_CHANNEL_IRQ:
james@267 418 *p1 = __GET_XEN_INIT_STRING(ptr);
james@267 419 *p2 = UlongToPtr(__GET_XEN_INIT_ULONG(ptr));
james@267 420 break;
james@267 421 case XEN_INIT_TYPE_READ_STRING_FRONT:
james@267 422 *p1 = __GET_XEN_INIT_STRING(ptr);
james@267 423 *p2 = __GET_XEN_INIT_STRING(ptr);
james@267 424 break;
james@267 425 case XEN_INIT_TYPE_READ_STRING_BACK:
james@267 426 *p1 = __GET_XEN_INIT_STRING(ptr);
james@267 427 *p2 = __GET_XEN_INIT_STRING(ptr);
james@267 428 break;
james@267 429 case XEN_INIT_TYPE_VECTORS:
james@267 430 *p1 = NULL;
james@267 431 *p2 = *ptr;
james@267 432 *ptr += ((PXENPCI_VECTORS)*p2)->length;
james@267 433 break;
james@267 434 case XEN_INIT_TYPE_GRANT_ENTRIES:
james@267 435 *p1 = UlongToPtr(__GET_XEN_INIT_ULONG(ptr));
james@267 436 *p2 = *ptr;
james@310 437 *ptr += PtrToUlong(*p1) * sizeof(grant_ref_t);
james@267 438 break;
james@342 439 case XEN_INIT_TYPE_STATE_PTR:
james@342 440 *p2 = __GET_XEN_INIT_PTR(ptr);
james@342 441 break;
james@497 442 case XEN_INIT_TYPE_QEMU_PROTOCOL_VERSION:
james@497 443 *p2 = UlongToPtr(__GET_XEN_INIT_ULONG(ptr));
james@497 444 break;
james@314 445 // case XEN_INIT_TYPE_COPY_PTR:
james@314 446 // *p1 = __GET_XEN_INIT_STRING(ptr);
james@314 447 // *p2 = __GET_XEN_INIT_PTR(ptr);
james@267 448 }
james@267 449 return retval;
james@267 450 }
james@0 451
james@75 452 #endif