win-pvdrivers

changeset 149:c3f70f8c913e

Automated merge with ssh://win-pvdrivers@xenbits.xensource.com/win-pvdrivers.hg
author Andy Grover <andy.grover@oracle.com>
date Wed Jan 23 11:58:26 2008 -0800 (2008-01-23)
parents 4c4b14a2d516 2efec00dd95f
children 9b7b4295fb35
files
line diff
     1.1 --- a/common/include/public/arch-ia64.h	Wed Jan 23 11:58:03 2008 -0800
     1.2 +++ b/common/include/public/arch-ia64.h	Wed Jan 23 11:58:26 2008 -0800
     1.3 @@ -48,14 +48,14 @@
     1.4  /* Guest handles for primitive C types. */
     1.5  __DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
     1.6  __DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
     1.7 -__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
     1.8 -__DEFINE_XEN_GUEST_HANDLE(u64,   unsigned long);
     1.9 +__DEFINE_XEN_GUEST_HANDLE(ulong, xen_ulong_t);
    1.10 +__DEFINE_XEN_GUEST_HANDLE(u64,   xen_ulong_t);
    1.11  DEFINE_XEN_GUEST_HANDLE(char);
    1.12  DEFINE_XEN_GUEST_HANDLE(int);
    1.13  DEFINE_XEN_GUEST_HANDLE(long);
    1.14  DEFINE_XEN_GUEST_HANDLE(void);
    1.15  
    1.16 -typedef unsigned long xen_pfn_t;
    1.17 +typedef xen_ulong_t xen_pfn_t;
    1.18  DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
    1.19  #define PRI_xen_pfn "lx"
    1.20  #endif
    1.21 @@ -71,7 +71,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
    1.22  
    1.23  #ifndef __ASSEMBLY__
    1.24  
    1.25 -typedef unsigned long xen_ulong_t;
    1.26 +typedef xen_ulong_t xen_ulong_t;
    1.27  
    1.28  #define INVALID_MFN       (~0UL)
    1.29  
    1.30 @@ -115,74 +115,74 @@ typedef unsigned long xen_ulong_t;
    1.31  
    1.32  #define NVRAM_VALID_SIG 0x4650494e45584948 		// "HIXENIPF"
    1.33  struct nvram_save_addr {
    1.34 -    unsigned long addr;
    1.35 -    unsigned long signature;
    1.36 +    xen_ulong_t addr;
    1.37 +    xen_ulong_t signature;
    1.38  };
    1.39  
    1.40  struct pt_fpreg {
    1.41      union {
    1.42 -        unsigned long bits[2];
    1.43 +        xen_ulong_t bits[2];
    1.44          long double __dummy;    /* force 16-byte alignment */
    1.45      } u;
    1.46  };
    1.47  
    1.48  struct cpu_user_regs {
    1.49      /* The following registers are saved by SAVE_MIN: */
    1.50 -    unsigned long b6;  /* scratch */
    1.51 -    unsigned long b7;  /* scratch */
    1.52 -
    1.53 -    unsigned long ar_csd; /* used by cmp8xchg16 (scratch) */
    1.54 -    unsigned long ar_ssd; /* reserved for future use (scratch) */
    1.55 -
    1.56 -    unsigned long r8;  /* scratch (return value register 0) */
    1.57 -    unsigned long r9;  /* scratch (return value register 1) */
    1.58 -    unsigned long r10; /* scratch (return value register 2) */
    1.59 -    unsigned long r11; /* scratch (return value register 3) */
    1.60 -
    1.61 -    unsigned long cr_ipsr; /* interrupted task's psr */
    1.62 -    unsigned long cr_iip;  /* interrupted task's instruction pointer */
    1.63 -    unsigned long cr_ifs;  /* interrupted task's function state */
    1.64 +    xen_ulong_t b6;  /* scratch */
    1.65 +    xen_ulong_t b7;  /* scratch */
    1.66  
    1.67 -    unsigned long ar_unat; /* interrupted task's NaT register (preserved) */
    1.68 -    unsigned long ar_pfs;  /* prev function state  */
    1.69 -    unsigned long ar_rsc;  /* RSE configuration */
    1.70 -    /* The following two are valid only if cr_ipsr.cpl > 0: */
    1.71 -    unsigned long ar_rnat;  /* RSE NaT */
    1.72 -    unsigned long ar_bspstore; /* RSE bspstore */
    1.73 +    xen_ulong_t ar_csd; /* used by cmp8xchg16 (scratch) */
    1.74 +    xen_ulong_t ar_ssd; /* reserved for future use (scratch) */
    1.75  
    1.76 -    unsigned long pr;  /* 64 predicate registers (1 bit each) */
    1.77 -    unsigned long b0;  /* return pointer (bp) */
    1.78 -    unsigned long loadrs;  /* size of dirty partition << 16 */
    1.79 +    xen_ulong_t r8;  /* scratch (return value register 0) */
    1.80 +    xen_ulong_t r9;  /* scratch (return value register 1) */
    1.81 +    xen_ulong_t r10; /* scratch (return value register 2) */
    1.82 +    xen_ulong_t r11; /* scratch (return value register 3) */
    1.83  
    1.84 -    unsigned long r1;  /* the gp pointer */
    1.85 -    unsigned long r12; /* interrupted task's memory stack pointer */
    1.86 -    unsigned long r13; /* thread pointer */
    1.87 +    xen_ulong_t cr_ipsr; /* interrupted task's psr */
    1.88 +    xen_ulong_t cr_iip;  /* interrupted task's instruction pointer */
    1.89 +    xen_ulong_t cr_ifs;  /* interrupted task's function state */
    1.90  
    1.91 -    unsigned long ar_fpsr;  /* floating point status (preserved) */
    1.92 -    unsigned long r15;  /* scratch */
    1.93 +    xen_ulong_t ar_unat; /* interrupted task's NaT register (preserved) */
    1.94 +    xen_ulong_t ar_pfs;  /* prev function state  */
    1.95 +    xen_ulong_t ar_rsc;  /* RSE configuration */
    1.96 +    /* The following two are valid only if cr_ipsr.cpl > 0: */
    1.97 +    xen_ulong_t ar_rnat;  /* RSE NaT */
    1.98 +    xen_ulong_t ar_bspstore; /* RSE bspstore */
    1.99 +
   1.100 +    xen_ulong_t pr;  /* 64 predicate registers (1 bit each) */
   1.101 +    xen_ulong_t b0;  /* return pointer (bp) */
   1.102 +    xen_ulong_t loadrs;  /* size of dirty partition << 16 */
   1.103 +
   1.104 +    xen_ulong_t r1;  /* the gp pointer */
   1.105 +    xen_ulong_t r12; /* interrupted task's memory stack pointer */
   1.106 +    xen_ulong_t r13; /* thread pointer */
   1.107 +
   1.108 +    xen_ulong_t ar_fpsr;  /* floating point status (preserved) */
   1.109 +    xen_ulong_t r15;  /* scratch */
   1.110  
   1.111   /* The remaining registers are NOT saved for system calls.  */
   1.112  
   1.113 -    unsigned long r14;  /* scratch */
   1.114 -    unsigned long r2;  /* scratch */
   1.115 -    unsigned long r3;  /* scratch */
   1.116 -    unsigned long r16;  /* scratch */
   1.117 -    unsigned long r17;  /* scratch */
   1.118 -    unsigned long r18;  /* scratch */
   1.119 -    unsigned long r19;  /* scratch */
   1.120 -    unsigned long r20;  /* scratch */
   1.121 -    unsigned long r21;  /* scratch */
   1.122 -    unsigned long r22;  /* scratch */
   1.123 -    unsigned long r23;  /* scratch */
   1.124 -    unsigned long r24;  /* scratch */
   1.125 -    unsigned long r25;  /* scratch */
   1.126 -    unsigned long r26;  /* scratch */
   1.127 -    unsigned long r27;  /* scratch */
   1.128 -    unsigned long r28;  /* scratch */
   1.129 -    unsigned long r29;  /* scratch */
   1.130 -    unsigned long r30;  /* scratch */
   1.131 -    unsigned long r31;  /* scratch */
   1.132 -    unsigned long ar_ccv;  /* compare/exchange value (scratch) */
   1.133 +    xen_ulong_t r14;  /* scratch */
   1.134 +    xen_ulong_t r2;  /* scratch */
   1.135 +    xen_ulong_t r3;  /* scratch */
   1.136 +    xen_ulong_t r16;  /* scratch */
   1.137 +    xen_ulong_t r17;  /* scratch */
   1.138 +    xen_ulong_t r18;  /* scratch */
   1.139 +    xen_ulong_t r19;  /* scratch */
   1.140 +    xen_ulong_t r20;  /* scratch */
   1.141 +    xen_ulong_t r21;  /* scratch */
   1.142 +    xen_ulong_t r22;  /* scratch */
   1.143 +    xen_ulong_t r23;  /* scratch */
   1.144 +    xen_ulong_t r24;  /* scratch */
   1.145 +    xen_ulong_t r25;  /* scratch */
   1.146 +    xen_ulong_t r26;  /* scratch */
   1.147 +    xen_ulong_t r27;  /* scratch */
   1.148 +    xen_ulong_t r28;  /* scratch */
   1.149 +    xen_ulong_t r29;  /* scratch */
   1.150 +    xen_ulong_t r30;  /* scratch */
   1.151 +    xen_ulong_t r31;  /* scratch */
   1.152 +    xen_ulong_t ar_ccv;  /* compare/exchange value (scratch) */
   1.153  
   1.154      /*
   1.155       * Floating point registers that the kernel considers scratch:
   1.156 @@ -193,18 +193,18 @@ struct cpu_user_regs {
   1.157      struct pt_fpreg f9;  /* scratch */
   1.158      struct pt_fpreg f10;  /* scratch */
   1.159      struct pt_fpreg f11;  /* scratch */
   1.160 -    unsigned long r4;  /* preserved */
   1.161 -    unsigned long r5;  /* preserved */
   1.162 -    unsigned long r6;  /* preserved */
   1.163 -    unsigned long r7;  /* preserved */
   1.164 -    unsigned long eml_unat;    /* used for emulating instruction */
   1.165 -    unsigned long pad0;     /* alignment pad */
   1.166 +    xen_ulong_t r4;  /* preserved */
   1.167 +    xen_ulong_t r5;  /* preserved */
   1.168 +    xen_ulong_t r6;  /* preserved */
   1.169 +    xen_ulong_t r7;  /* preserved */
   1.170 +    xen_ulong_t eml_unat;    /* used for emulating instruction */
   1.171 +    xen_ulong_t pad0;     /* alignment pad */
   1.172  
   1.173  };
   1.174  typedef struct cpu_user_regs cpu_user_regs_t;
   1.175  
   1.176  union vac {
   1.177 -    unsigned long value;
   1.178 +    xen_ulong_t value;
   1.179      struct {
   1.180          int a_int:1;
   1.181          int a_from_int_cr:1;
   1.182 @@ -219,7 +219,7 @@ union vac {
   1.183  typedef union vac vac_t;
   1.184  
   1.185  union vdc {
   1.186 -    unsigned long value;
   1.187 +    xen_ulong_t value;
   1.188      struct {
   1.189          int d_vmsw:1;
   1.190          int d_extint:1;
   1.191 @@ -235,64 +235,64 @@ typedef union vdc vdc_t;
   1.192  struct mapped_regs {
   1.193      union vac   vac;
   1.194      union vdc   vdc;
   1.195 -    unsigned long  virt_env_vaddr;
   1.196 -    unsigned long  reserved1[29];
   1.197 -    unsigned long  vhpi;
   1.198 -    unsigned long  reserved2[95];
   1.199 +    xen_ulong_t  virt_env_vaddr;
   1.200 +    xen_ulong_t  reserved1[29];
   1.201 +    xen_ulong_t  vhpi;
   1.202 +    xen_ulong_t  reserved2[95];
   1.203      union {
   1.204 -        unsigned long  vgr[16];
   1.205 -        unsigned long bank1_regs[16]; // bank1 regs (r16-r31) when bank0 active
   1.206 +        xen_ulong_t  vgr[16];
   1.207 +        xen_ulong_t bank1_regs[16]; // bank1 regs (r16-r31) when bank0 active
   1.208      };
   1.209      union {
   1.210 -        unsigned long  vbgr[16];
   1.211 -        unsigned long bank0_regs[16]; // bank0 regs (r16-r31) when bank1 active
   1.212 +        xen_ulong_t  vbgr[16];
   1.213 +        xen_ulong_t bank0_regs[16]; // bank0 regs (r16-r31) when bank1 active
   1.214      };
   1.215 -    unsigned long  vnat;
   1.216 -    unsigned long  vbnat;
   1.217 -    unsigned long  vcpuid[5];
   1.218 -    unsigned long  reserved3[11];
   1.219 -    unsigned long  vpsr;
   1.220 -    unsigned long  vpr;
   1.221 -    unsigned long  reserved4[76];
   1.222 +    xen_ulong_t  vnat;
   1.223 +    xen_ulong_t  vbnat;
   1.224 +    xen_ulong_t  vcpuid[5];
   1.225 +    xen_ulong_t  reserved3[11];
   1.226 +    xen_ulong_t  vpsr;
   1.227 +    xen_ulong_t  vpr;
   1.228 +    xen_ulong_t  reserved4[76];
   1.229      union {
   1.230 -        unsigned long  vcr[128];
   1.231 +        xen_ulong_t  vcr[128];
   1.232          struct {
   1.233 -            unsigned long dcr;  // CR0
   1.234 -            unsigned long itm;
   1.235 -            unsigned long iva;
   1.236 -            unsigned long rsv1[5];
   1.237 -            unsigned long pta;  // CR8
   1.238 -            unsigned long rsv2[7];
   1.239 -            unsigned long ipsr;  // CR16
   1.240 -            unsigned long isr;
   1.241 -            unsigned long rsv3;
   1.242 -            unsigned long iip;
   1.243 -            unsigned long ifa;
   1.244 -            unsigned long itir;
   1.245 -            unsigned long iipa;
   1.246 -            unsigned long ifs;
   1.247 -            unsigned long iim;  // CR24
   1.248 -            unsigned long iha;
   1.249 -            unsigned long rsv4[38];
   1.250 -            unsigned long lid;  // CR64
   1.251 -            unsigned long ivr;
   1.252 -            unsigned long tpr;
   1.253 -            unsigned long eoi;
   1.254 -            unsigned long irr[4];
   1.255 -            unsigned long itv;  // CR72
   1.256 -            unsigned long pmv;
   1.257 -            unsigned long cmcv;
   1.258 -            unsigned long rsv5[5];
   1.259 -            unsigned long lrr0;  // CR80
   1.260 -            unsigned long lrr1;
   1.261 -            unsigned long rsv6[46];
   1.262 +            xen_ulong_t dcr;  // CR0
   1.263 +            xen_ulong_t itm;
   1.264 +            xen_ulong_t iva;
   1.265 +            xen_ulong_t rsv1[5];
   1.266 +            xen_ulong_t pta;  // CR8
   1.267 +            xen_ulong_t rsv2[7];
   1.268 +            xen_ulong_t ipsr;  // CR16
   1.269 +            xen_ulong_t isr;
   1.270 +            xen_ulong_t rsv3;
   1.271 +            xen_ulong_t iip;
   1.272 +            xen_ulong_t ifa;
   1.273 +            xen_ulong_t itir;
   1.274 +            xen_ulong_t iipa;
   1.275 +            xen_ulong_t ifs;
   1.276 +            xen_ulong_t iim;  // CR24
   1.277 +            xen_ulong_t iha;
   1.278 +            xen_ulong_t rsv4[38];
   1.279 +            xen_ulong_t lid;  // CR64
   1.280 +            xen_ulong_t ivr;
   1.281 +            xen_ulong_t tpr;
   1.282 +            xen_ulong_t eoi;
   1.283 +            xen_ulong_t irr[4];
   1.284 +            xen_ulong_t itv;  // CR72
   1.285 +            xen_ulong_t pmv;
   1.286 +            xen_ulong_t cmcv;
   1.287 +            xen_ulong_t rsv5[5];
   1.288 +            xen_ulong_t lrr0;  // CR80
   1.289 +            xen_ulong_t lrr1;
   1.290 +            xen_ulong_t rsv6[46];
   1.291          };
   1.292      };
   1.293      union {
   1.294 -        unsigned long  reserved5[128];
   1.295 +        xen_ulong_t  reserved5[128];
   1.296          struct {
   1.297 -            unsigned long precover_ifs;
   1.298 -            unsigned long unat;  // not sure if this is needed until NaT arch is done
   1.299 +            xen_ulong_t precover_ifs;
   1.300 +            xen_ulong_t unat;  // not sure if this is needed until NaT arch is done
   1.301              int interrupt_collection_enabled; // virtual psr.ic
   1.302              /* virtual interrupt deliverable flag is evtchn_upcall_mask in
   1.303               * shared info area now. interrupt_mask_addr is the address
   1.304 @@ -304,13 +304,13 @@ struct mapped_regs {
   1.305              unsigned char vpsr_dfh;
   1.306              unsigned char hpsr_dfh;
   1.307              unsigned char hpsr_mfh;
   1.308 -            unsigned long reserved5_1[4];
   1.309 +            xen_ulong_t reserved5_1[4];
   1.310              int metaphysical_mode; // 1 = use metaphys mapping, 0 = use virtual
   1.311              int banknum; // 0 or 1, which virtual register bank is active
   1.312 -            unsigned long rrs[8]; // region registers
   1.313 -            unsigned long krs[8]; // kernel registers
   1.314 -            unsigned long pkrs[8]; // protection key registers
   1.315 -            unsigned long tmp[8]; // temp registers (e.g. for hyperprivops)
   1.316 +            xen_ulong_t rrs[8]; // region registers
   1.317 +            xen_ulong_t krs[8]; // kernel registers
   1.318 +            xen_ulong_t pkrs[8]; // protection key registers
   1.319 +            xen_ulong_t tmp[8]; // temp registers (e.g. for hyperprivops)
   1.320          };
   1.321      };
   1.322  };
   1.323 @@ -318,9 +318,9 @@ typedef struct mapped_regs mapped_regs_t
   1.324  
   1.325  struct vpd {
   1.326      struct mapped_regs vpd_low;
   1.327 -    unsigned long  reserved6[3456];
   1.328 -    unsigned long  vmm_avail[128];
   1.329 -    unsigned long  reserved7[4096];
   1.330 +    xen_ulong_t  reserved6[3456];
   1.331 +    xen_ulong_t  vmm_avail[128];
   1.332 +    xen_ulong_t  reserved7[4096];
   1.333  };
   1.334  typedef struct vpd vpd_t;
   1.335  
   1.336 @@ -330,7 +330,7 @@ typedef struct arch_vcpu_info arch_vcpu_
   1.337  
   1.338  struct arch_shared_info {
   1.339      /* PFN of the start_info page.  */
   1.340 -    unsigned long start_info_pfn;
   1.341 +    xen_ulong_t start_info_pfn;
   1.342  
   1.343      /* Interrupt vector for event channel.  */
   1.344      int evtchn_vector;
   1.345 @@ -339,30 +339,30 @@ struct arch_shared_info {
   1.346  };
   1.347  typedef struct arch_shared_info arch_shared_info_t;
   1.348  
   1.349 -typedef unsigned long xen_callback_t;
   1.350 +typedef xen_ulong_t xen_callback_t;
   1.351  
   1.352  struct ia64_tr_entry {
   1.353 -    unsigned long pte;
   1.354 -    unsigned long itir;
   1.355 -    unsigned long vadr;
   1.356 -    unsigned long rid;
   1.357 +    xen_ulong_t pte;
   1.358 +    xen_ulong_t itir;
   1.359 +    xen_ulong_t vadr;
   1.360 +    xen_ulong_t rid;
   1.361  };
   1.362  
   1.363  struct vcpu_extra_regs {
   1.364      struct ia64_tr_entry itrs[8];
   1.365      struct ia64_tr_entry dtrs[8];
   1.366 -    unsigned long iva;
   1.367 -    unsigned long dcr;
   1.368 -    unsigned long event_callback_ip;
   1.369 +    xen_ulong_t iva;
   1.370 +    xen_ulong_t dcr;
   1.371 +    xen_ulong_t event_callback_ip;
   1.372  };
   1.373  
   1.374  struct vcpu_guest_context {
   1.375  #define VGCF_EXTRA_REGS (1<<1)	/* Get/Set extra regs.  */
   1.376 -    unsigned long flags;       /* VGCF_* flags */
   1.377 +    xen_ulong_t flags;       /* VGCF_* flags */
   1.378  
   1.379      struct cpu_user_regs user_regs;
   1.380      struct vcpu_extra_regs extra_regs;
   1.381 -    unsigned long privregs_pfn;
   1.382 +    xen_ulong_t privregs_pfn;
   1.383  };
   1.384  typedef struct vcpu_guest_context vcpu_guest_context_t;
   1.385  DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
   1.386 @@ -420,11 +420,11 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_conte
   1.387  /* This structure has the same layout of struct ia64_boot_param, defined in
   1.388     <asm/system.h>.  It is redefined here to ease use.  */
   1.389  struct xen_ia64_boot_param {
   1.390 -	unsigned long command_line;	/* physical address of cmd line args */
   1.391 -	unsigned long efi_systab;	/* physical address of EFI system table */
   1.392 -	unsigned long efi_memmap;	/* physical address of EFI memory map */
   1.393 -	unsigned long efi_memmap_size;	/* size of EFI memory map */
   1.394 -	unsigned long efi_memdesc_size;	/* size of an EFI memory map descriptor */
   1.395 +	xen_ulong_t command_line;	/* physical address of cmd line args */
   1.396 +	xen_ulong_t efi_systab;	/* physical address of EFI system table */
   1.397 +	xen_ulong_t efi_memmap;	/* physical address of EFI memory map */
   1.398 +	xen_ulong_t efi_memmap_size;	/* size of EFI memory map */
   1.399 +	xen_ulong_t efi_memdesc_size;	/* size of an EFI memory map descriptor */
   1.400  	unsigned int  efi_memdesc_version;	/* memory descriptor version */
   1.401  	struct {
   1.402  		unsigned short num_cols;	/* number of columns on console.  */
   1.403 @@ -432,11 +432,11 @@ struct xen_ia64_boot_param {
   1.404  		unsigned short orig_x;	/* cursor's x position */
   1.405  		unsigned short orig_y;	/* cursor's y position */
   1.406  	} console_info;
   1.407 -	unsigned long fpswa;		/* physical address of the fpswa interface */
   1.408 -	unsigned long initrd_start;
   1.409 -	unsigned long initrd_size;
   1.410 -	unsigned long domain_start;	/* va where the boot time domain begins */
   1.411 -	unsigned long domain_size;	/* how big is the boot domain */
   1.412 +	xen_ulong_t fpswa;		/* physical address of the fpswa interface */
   1.413 +	xen_ulong_t initrd_start;
   1.414 +	xen_ulong_t initrd_size;
   1.415 +	xen_ulong_t domain_start;	/* va where the boot time domain begins */
   1.416 +	xen_ulong_t domain_size;	/* how big is the boot domain */
   1.417  };
   1.418  
   1.419  #endif /* !__ASSEMBLY__ */
   1.420 @@ -487,9 +487,9 @@ struct xen_ia64_boot_param {
   1.421  #define XENCOMM_INLINE_FLAG 0x8000000000000000UL
   1.422  
   1.423  #define XENCOMM_IS_INLINE(addr) \
   1.424 -  (((unsigned long)(addr) & XENCOMM_INLINE_MASK) == XENCOMM_INLINE_FLAG)
   1.425 +  (((xen_ulong_t)(addr) & XENCOMM_INLINE_MASK) == XENCOMM_INLINE_FLAG)
   1.426  #define XENCOMM_INLINE_ADDR(addr) \
   1.427 -  ((unsigned long)(addr) & ~XENCOMM_INLINE_MASK)
   1.428 +  ((xen_ulong_t)(addr) & ~XENCOMM_INLINE_MASK)
   1.429  
   1.430  /* xen perfmon */
   1.431  #ifdef XEN
     2.1 --- a/common/include/public/arch-powerpc.h	Wed Jan 23 11:58:03 2008 -0800
     2.2 +++ b/common/include/public/arch-powerpc.h	Wed Jan 23 11:58:26 2008 -0800
     2.3 @@ -48,13 +48,13 @@
     2.4  /* Guest handles for primitive C types. */
     2.5  __DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
     2.6  __DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
     2.7 -__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
     2.8 +__DEFINE_XEN_GUEST_HANDLE(ulong, xen_ulong_t);
     2.9  DEFINE_XEN_GUEST_HANDLE(char);
    2.10  DEFINE_XEN_GUEST_HANDLE(int);
    2.11  DEFINE_XEN_GUEST_HANDLE(long);
    2.12  DEFINE_XEN_GUEST_HANDLE(void);
    2.13  
    2.14 -typedef unsigned long long xen_pfn_t;
    2.15 +typedef xen_ulong_t long xen_pfn_t;
    2.16  DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
    2.17  #define PRI_xen_pfn "llx"
    2.18  #endif
     3.1 --- a/common/include/public/arch-x86/xen-x86_32.h	Wed Jan 23 11:58:03 2008 -0800
     3.2 +++ b/common/include/public/arch-x86/xen-x86_32.h	Wed Jan 23 11:58:26 2008 -0800
     3.3 @@ -102,7 +102,7 @@
     3.4  #define MACH2PHYS_VIRT_END    mk_unsigned_long(__MACH2PHYS_VIRT_END)
     3.5  #define MACH2PHYS_NR_ENTRIES  ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>2)
     3.6  #ifndef machine_to_phys_mapping
     3.7 -#define machine_to_phys_mapping ((unsigned long *)MACH2PHYS_VIRT_START)
     3.8 +#define machine_to_phys_mapping ((xen_ulong_t *)MACH2PHYS_VIRT_START)
     3.9  #endif
    3.10  
    3.11  /* 32-/64-bit invariability for control interfaces (domctl/sysctl). */
    3.12 @@ -158,14 +158,14 @@ DEFINE_XEN_GUEST_HANDLE(cpu_user_regs_t)
    3.13  #define xen_cr3_to_pfn(cr3) (((unsigned)(cr3) >> 12) | ((unsigned)(cr3) << 20))
    3.14  
    3.15  struct arch_vcpu_info {
    3.16 -    unsigned long cr2;
    3.17 -    unsigned long pad[5]; /* sizeof(vcpu_info_t) == 64 */
    3.18 +    xen_ulong_t cr2;
    3.19 +    xen_ulong_t pad[5]; /* sizeof(vcpu_info_t) == 64 */
    3.20  };
    3.21  typedef struct arch_vcpu_info arch_vcpu_info_t;
    3.22  
    3.23  struct xen_callback {
    3.24 -    unsigned long cs;
    3.25 -    unsigned long eip;
    3.26 +    xen_ulong_t cs;
    3.27 +    xen_ulong_t eip;
    3.28  };
    3.29  typedef struct xen_callback xen_callback_t;
    3.30  
     4.1 --- a/common/include/public/arch-x86/xen-x86_64.h	Wed Jan 23 11:58:03 2008 -0800
     4.2 +++ b/common/include/public/arch-x86/xen-x86_64.h	Wed Jan 23 11:58:26 2008 -0800
     4.3 @@ -94,13 +94,13 @@
     4.4  #define MACH2PHYS_VIRT_END    mk_unsigned_long(__MACH2PHYS_VIRT_END)
     4.5  #define MACH2PHYS_NR_ENTRIES  ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>3)
     4.6  #ifndef machine_to_phys_mapping
     4.7 -#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
     4.8 +#define machine_to_phys_mapping ((xen_ulong_t *)HYPERVISOR_VIRT_START)
     4.9  #endif
    4.10  
    4.11  #ifndef __ASSEMBLY__
    4.12  
    4.13  /*
    4.14 - * int HYPERVISOR_set_segment_base(unsigned int which, unsigned long base)
    4.15 + * int HYPERVISOR_set_segment_base(unsigned int which, xen_ulong_t base)
    4.16   *  @which == SEGBASE_*  ;  @base == 64-bit base address
    4.17   * Returns 0 on success.
    4.18   */
    4.19 @@ -185,16 +185,16 @@ DEFINE_XEN_GUEST_HANDLE(cpu_user_regs_t)
    4.20  
    4.21  #undef __DECL_REG
    4.22  
    4.23 -#define xen_pfn_to_cr3(pfn) ((unsigned long)(pfn) << 12)
    4.24 -#define xen_cr3_to_pfn(cr3) ((unsigned long)(cr3) >> 12)
    4.25 +#define xen_pfn_to_cr3(pfn) ((xen_ulong_t)(pfn) << 12)
    4.26 +#define xen_cr3_to_pfn(cr3) ((xen_ulong_t)(cr3) >> 12)
    4.27  
    4.28  struct arch_vcpu_info {
    4.29 -    unsigned long cr2;
    4.30 -    unsigned long pad; /* sizeof(vcpu_info_t) == 64 */
    4.31 +    xen_ulong_t cr2;
    4.32 +    xen_ulong_t pad; /* sizeof(vcpu_info_t) == 64 */
    4.33  };
    4.34  typedef struct arch_vcpu_info arch_vcpu_info_t;
    4.35  
    4.36 -typedef unsigned long xen_callback_t;
    4.37 +typedef xen_ulong_t xen_callback_t;
    4.38  
    4.39  #endif /* !__ASSEMBLY__ */
    4.40  
     5.1 --- a/common/include/public/arch-x86/xen.h	Wed Jan 23 11:58:03 2008 -0800
     5.2 +++ b/common/include/public/arch-x86/xen.h	Wed Jan 23 11:58:26 2008 -0800
     5.3 @@ -1,205 +1,212 @@
     5.4 -/******************************************************************************
     5.5 - * arch-x86/xen.h
     5.6 - * 
     5.7 - * Guest OS interface to x86 Xen.
     5.8 - * 
     5.9 - * Permission is hereby granted, free of charge, to any person obtaining a copy
    5.10 - * of this software and associated documentation files (the "Software"), to
    5.11 - * deal in the Software without restriction, including without limitation the
    5.12 - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
    5.13 - * sell copies of the Software, and to permit persons to whom the Software is
    5.14 - * furnished to do so, subject to the following conditions:
    5.15 - *
    5.16 - * The above copyright notice and this permission notice shall be included in
    5.17 - * all copies or substantial portions of the Software.
    5.18 - *
    5.19 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    5.20 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    5.21 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    5.22 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    5.23 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    5.24 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    5.25 - * DEALINGS IN THE SOFTWARE.
    5.26 - *
    5.27 - * Copyright (c) 2004-2006, K A Fraser
    5.28 - */
    5.29 -
    5.30 -#ifndef __XEN_PUBLIC_ARCH_X86_XEN_H__
    5.31 -#define __XEN_PUBLIC_ARCH_X86_XEN_H__
    5.32 -
    5.33 -/* Structural guest handles introduced in 0x00030201. */
    5.34 -#if __XEN_INTERFACE_VERSION__ >= 0x00030201
    5.35 -#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
    5.36 -    typedef struct { type *p; } __guest_handle_ ## name
    5.37 -#else
    5.38 -#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
    5.39 -    typedef type * __guest_handle_ ## name
    5.40 -#endif
    5.41 -
    5.42 -#define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
    5.43 -#define __XEN_GUEST_HANDLE(name)        __guest_handle_ ## name
    5.44 -#define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
    5.45 -#define set_xen_guest_handle(hnd, val)  do { (hnd).p = val; } while (0)
    5.46 -#ifdef __XEN_TOOLS__
    5.47 -#define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
    5.48 -#endif
    5.49 -
    5.50 -#if defined(__i386__)
    5.51 -#include "xen-x86_32.h"
    5.52 -#elif defined(__x86_64__)
    5.53 -#include "xen-x86_64.h"
    5.54 -#endif
    5.55 -
    5.56 -#ifndef __ASSEMBLY__
    5.57 -/* Guest handles for primitive C types. */
    5.58 -__DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
    5.59 -__DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
    5.60 -__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
    5.61 -DEFINE_XEN_GUEST_HANDLE(char);
    5.62 -DEFINE_XEN_GUEST_HANDLE(int);
    5.63 -DEFINE_XEN_GUEST_HANDLE(long);
    5.64 -DEFINE_XEN_GUEST_HANDLE(void);
    5.65 -
    5.66 -typedef unsigned long xen_pfn_t;
    5.67 -DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
    5.68 -#define PRI_xen_pfn "lx"
    5.69 -#endif
    5.70 -
    5.71 -/*
    5.72 - * SEGMENT DESCRIPTOR TABLES
    5.73 - */
    5.74 -/*
    5.75 - * A number of GDT entries are reserved by Xen. These are not situated at the
    5.76 - * start of the GDT because some stupid OSes export hard-coded selector values
    5.77 - * in their ABI. These hard-coded values are always near the start of the GDT,
    5.78 - * so Xen places itself out of the way, at the far end of the GDT.
    5.79 - */
    5.80 -#define FIRST_RESERVED_GDT_PAGE  14
    5.81 -#define FIRST_RESERVED_GDT_BYTE  (FIRST_RESERVED_GDT_PAGE * 4096)
    5.82 -#define FIRST_RESERVED_GDT_ENTRY (FIRST_RESERVED_GDT_BYTE / 8)
    5.83 -
    5.84 -/* Maximum number of virtual CPUs in multi-processor guests. */
    5.85 -#define MAX_VIRT_CPUS 32
    5.86 -
    5.87 -#ifndef __ASSEMBLY__
    5.88 -
    5.89 -typedef unsigned long xen_ulong_t;
    5.90 -
    5.91 -/*
    5.92 - * Send an array of these to HYPERVISOR_set_trap_table().
    5.93 - * The privilege level specifies which modes may enter a trap via a software
    5.94 - * interrupt. On x86/64, since rings 1 and 2 are unavailable, we allocate
    5.95 - * privilege levels as follows:
    5.96 - *  Level == 0: Noone may enter
    5.97 - *  Level == 1: Kernel may enter
    5.98 - *  Level == 2: Kernel may enter
    5.99 - *  Level == 3: Everyone may enter
   5.100 - */
   5.101 -#define TI_GET_DPL(_ti)      ((_ti)->flags & 3)
   5.102 -#define TI_GET_IF(_ti)       ((_ti)->flags & 4)
   5.103 -#define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
   5.104 -#define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
   5.105 -struct trap_info {
   5.106 -    uint8_t       vector;  /* exception vector                              */
   5.107 -    uint8_t       flags;   /* 0-3: privilege level; 4: clear event enable?  */
   5.108 -    uint16_t      cs;      /* code selector                                 */
   5.109 -    unsigned long address; /* code offset                                   */
   5.110 -};
   5.111 -typedef struct trap_info trap_info_t;
   5.112 -DEFINE_XEN_GUEST_HANDLE(trap_info_t);
   5.113 -
   5.114 -typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */
   5.115 -
   5.116 -/*
   5.117 - * The following is all CPU context. Note that the fpu_ctxt block is filled 
   5.118 - * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
   5.119 - */
   5.120 -struct vcpu_guest_context {
   5.121 -    /* FPU registers come first so they can be aligned for FXSAVE/FXRSTOR. */
   5.122 -    struct { char x[512]; } fpu_ctxt;       /* User-level FPU registers     */
   5.123 -#define VGCF_I387_VALID                (1<<0)
   5.124 -#define VGCF_IN_KERNEL                 (1<<2)
   5.125 -#define _VGCF_i387_valid               0
   5.126 -#define VGCF_i387_valid                (1<<_VGCF_i387_valid)
   5.127 -#define _VGCF_in_kernel                2
   5.128 -#define VGCF_in_kernel                 (1<<_VGCF_in_kernel)
   5.129 -#define _VGCF_failsafe_disables_events 3
   5.130 -#define VGCF_failsafe_disables_events  (1<<_VGCF_failsafe_disables_events)
   5.131 -#define _VGCF_syscall_disables_events  4
   5.132 -#define VGCF_syscall_disables_events   (1<<_VGCF_syscall_disables_events)
   5.133 -#define _VGCF_online                   5
   5.134 -#define VGCF_online                    (1<<_VGCF_online)
   5.135 -    unsigned long flags;                    /* VGCF_* flags                 */
   5.136 -    struct cpu_user_regs user_regs;         /* User-level CPU registers     */
   5.137 -    struct trap_info trap_ctxt[256];        /* Virtual IDT                  */
   5.138 -    unsigned long ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
   5.139 -    unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
   5.140 -    unsigned long kernel_ss, kernel_sp;     /* Virtual TSS (only SS1/SP1)   */
   5.141 -    /* NB. User pagetable on x86/64 is placed in ctrlreg[1]. */
   5.142 -    unsigned long ctrlreg[8];               /* CR0-CR7 (control registers)  */
   5.143 -    unsigned long debugreg[8];              /* DB0-DB7 (debug registers)    */
   5.144 -#ifdef __i386__
   5.145 -    unsigned long event_callback_cs;        /* CS:EIP of event callback     */
   5.146 -    unsigned long event_callback_eip;
   5.147 -    unsigned long failsafe_callback_cs;     /* CS:EIP of failsafe callback  */
   5.148 -    unsigned long failsafe_callback_eip;
   5.149 -#else
   5.150 -    unsigned long event_callback_eip;
   5.151 -    unsigned long failsafe_callback_eip;
   5.152 -#ifdef __XEN__
   5.153 -    union {
   5.154 -        unsigned long syscall_callback_eip;
   5.155 -        struct {
   5.156 -            unsigned int event_callback_cs;    /* compat CS of event cb     */
   5.157 -            unsigned int failsafe_callback_cs; /* compat CS of failsafe cb  */
   5.158 -        };
   5.159 -    };
   5.160 -#else
   5.161 -    unsigned long syscall_callback_eip;
   5.162 -#endif
   5.163 -#endif
   5.164 -    unsigned long vm_assist;                /* VMASST_TYPE_* bitmap */
   5.165 -#ifdef __x86_64__
   5.166 -    /* Segment base addresses. */
   5.167 -    uint64_t      fs_base;
   5.168 -    uint64_t      gs_base_kernel;
   5.169 -    uint64_t      gs_base_user;
   5.170 -#endif
   5.171 -};
   5.172 -typedef struct vcpu_guest_context vcpu_guest_context_t;
   5.173 -DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
   5.174 -
   5.175 -struct arch_shared_info {
   5.176 -    unsigned long max_pfn;                  /* max pfn that appears in table */
   5.177 -    /* Frame containing list of mfns containing list of mfns containing p2m. */
   5.178 -    xen_pfn_t     pfn_to_mfn_frame_list_list;
   5.179 -    unsigned long nmi_reason;
   5.180 -    uint64_t pad[32];
   5.181 -};
   5.182 -typedef struct arch_shared_info arch_shared_info_t;
   5.183 -
   5.184 -#endif /* !__ASSEMBLY__ */
   5.185 -
   5.186 -/*
   5.187 - * Prefix forces emulation of some non-trapping instructions.
   5.188 - * Currently only CPUID.
   5.189 - */
   5.190 -#ifdef __ASSEMBLY__
   5.191 -#define XEN_EMULATE_PREFIX .byte 0x0f,0x0b,0x78,0x65,0x6e ;
   5.192 -#define XEN_CPUID          XEN_EMULATE_PREFIX cpuid
   5.193 -#else
   5.194 -#define XEN_EMULATE_PREFIX ".byte 0x0f,0x0b,0x78,0x65,0x6e ; "
   5.195 -#define XEN_CPUID          XEN_EMULATE_PREFIX "cpuid"
   5.196 -#endif
   5.197 -
   5.198 -#endif /* __XEN_PUBLIC_ARCH_X86_XEN_H__ */
   5.199 -
   5.200 -/*
   5.201 - * Local variables:
   5.202 - * mode: C
   5.203 - * c-set-style: "BSD"
   5.204 - * c-basic-offset: 4
   5.205 - * tab-width: 4
   5.206 - * indent-tabs-mode: nil
   5.207 - * End:
   5.208 - */
   5.209 +/******************************************************************************
   5.210 + * arch-x86/xen.h
   5.211 + * 
   5.212 + * Guest OS interface to x86 Xen.
   5.213 + * 
   5.214 + * Permission is hereby granted, free of charge, to any person obtaining a copy
   5.215 + * of this software and associated documentation files (the "Software"), to
   5.216 + * deal in the Software without restriction, including without limitation the
   5.217 + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   5.218 + * sell copies of the Software, and to permit persons to whom the Software is
   5.219 + * furnished to do so, subject to the following conditions:
   5.220 + *
   5.221 + * The above copyright notice and this permission notice shall be included in
   5.222 + * all copies or substantial portions of the Software.
   5.223 + *
   5.224 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   5.225 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   5.226 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   5.227 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   5.228 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   5.229 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
   5.230 + * DEALINGS IN THE SOFTWARE.
   5.231 + *
   5.232 + * Copyright (c) 2004-2006, K A Fraser
   5.233 + */
   5.234 +
   5.235 +#ifndef __XEN_PUBLIC_ARCH_X86_XEN_H__
   5.236 +#define __XEN_PUBLIC_ARCH_X86_XEN_H__
   5.237 +
   5.238 +/* Structural guest handles introduced in 0x00030201. */
   5.239 +#if __XEN_INTERFACE_VERSION__ >= 0x00030201
   5.240 +#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
   5.241 +    typedef struct { type *p; } __guest_handle_ ## name
   5.242 +#else
   5.243 +#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
   5.244 +    typedef type * __guest_handle_ ## name
   5.245 +#endif
   5.246 +
   5.247 +#define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
   5.248 +#define __XEN_GUEST_HANDLE(name)        __guest_handle_ ## name
   5.249 +#define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
   5.250 +#define set_xen_guest_handle(hnd, val)  do { (hnd).p = val; } while (0)
   5.251 +#ifdef __XEN_TOOLS__
   5.252 +#define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
   5.253 +#endif
   5.254 +
   5.255 +#if defined(_AMD64_)
   5.256 +/* Under windows _AMD64_, sizeof(long) != sizeof(void *) */
   5.257 +typedef long xen_long_t;
   5.258 +typedef unsigned long long xen_ulong_t;
   5.259 +#else
   5.260 +typedef long xen_long_t;
   5.261 +typedef unsigned long long xen_ulong_t;
   5.262 +#endif
   5.263 +
   5.264 +#if defined(__i386__)
   5.265 +#include "xen-x86_32.h"
   5.266 +#elif defined(__x86_64__)
   5.267 +#include "xen-x86_64.h"
   5.268 +#endif
   5.269 +
   5.270 +#ifndef __ASSEMBLY__
   5.271 +/* Guest handles for primitive C types. */
   5.272 +__DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
   5.273 +__DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
   5.274 +__DEFINE_XEN_GUEST_HANDLE(ulong, xen_ulong_t);
   5.275 +DEFINE_XEN_GUEST_HANDLE(char);
   5.276 +DEFINE_XEN_GUEST_HANDLE(int);
   5.277 +DEFINE_XEN_GUEST_HANDLE(long);
   5.278 +DEFINE_XEN_GUEST_HANDLE(void);
   5.279 +
   5.280 +typedef xen_ulong_t xen_pfn_t;
   5.281 +DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
   5.282 +#define PRI_xen_pfn "lx"
   5.283 +#endif
   5.284 +
   5.285 +/*
   5.286 + * SEGMENT DESCRIPTOR TABLES
   5.287 + */
   5.288 +/*
   5.289 + * A number of GDT entries are reserved by Xen. These are not situated at the
   5.290 + * start of the GDT because some stupid OSes export hard-coded selector values
   5.291 + * in their ABI. These hard-coded values are always near the start of the GDT,
   5.292 + * so Xen places itself out of the way, at the far end of the GDT.
   5.293 + */
   5.294 +#define FIRST_RESERVED_GDT_PAGE  14
   5.295 +#define FIRST_RESERVED_GDT_BYTE  (FIRST_RESERVED_GDT_PAGE * 4096)
   5.296 +#define FIRST_RESERVED_GDT_ENTRY (FIRST_RESERVED_GDT_BYTE / 8)
   5.297 +
   5.298 +/* Maximum number of virtual CPUs in multi-processor guests. */
   5.299 +#define MAX_VIRT_CPUS 32
   5.300 +
   5.301 +#ifndef __ASSEMBLY__
   5.302 +
   5.303 +/*
   5.304 + * Send an array of these to HYPERVISOR_set_trap_table().
   5.305 + * The privilege level specifies which modes may enter a trap via a software
   5.306 + * interrupt. On x86/64, since rings 1 and 2 are unavailable, we allocate
   5.307 + * privilege levels as follows:
   5.308 + *  Level == 0: Noone may enter
   5.309 + *  Level == 1: Kernel may enter
   5.310 + *  Level == 2: Kernel may enter
   5.311 + *  Level == 3: Everyone may enter
   5.312 + */
   5.313 +#define TI_GET_DPL(_ti)      ((_ti)->flags & 3)
   5.314 +#define TI_GET_IF(_ti)       ((_ti)->flags & 4)
   5.315 +#define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
   5.316 +#define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
   5.317 +struct trap_info {
   5.318 +    uint8_t       vector;  /* exception vector                              */
   5.319 +    uint8_t       flags;   /* 0-3: privilege level; 4: clear event enable?  */
   5.320 +    uint16_t      cs;      /* code selector                                 */
   5.321 +    xen_ulong_t address; /* code offset                                   */
   5.322 +};
   5.323 +typedef struct trap_info trap_info_t;
   5.324 +DEFINE_XEN_GUEST_HANDLE(trap_info_t);
   5.325 +
   5.326 +typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */
   5.327 +
   5.328 +/*
   5.329 + * The following is all CPU context. Note that the fpu_ctxt block is filled 
   5.330 + * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
   5.331 + */
   5.332 +struct vcpu_guest_context {
   5.333 +    /* FPU registers come first so they can be aligned for FXSAVE/FXRSTOR. */
   5.334 +    struct { char x[512]; } fpu_ctxt;       /* User-level FPU registers     */
   5.335 +#define VGCF_I387_VALID                (1<<0)
   5.336 +#define VGCF_IN_KERNEL                 (1<<2)
   5.337 +#define _VGCF_i387_valid               0
   5.338 +#define VGCF_i387_valid                (1<<_VGCF_i387_valid)
   5.339 +#define _VGCF_in_kernel                2
   5.340 +#define VGCF_in_kernel                 (1<<_VGCF_in_kernel)
   5.341 +#define _VGCF_failsafe_disables_events 3
   5.342 +#define VGCF_failsafe_disables_events  (1<<_VGCF_failsafe_disables_events)
   5.343 +#define _VGCF_syscall_disables_events  4
   5.344 +#define VGCF_syscall_disables_events   (1<<_VGCF_syscall_disables_events)
   5.345 +#define _VGCF_online                   5
   5.346 +#define VGCF_online                    (1<<_VGCF_online)
   5.347 +    xen_ulong_t flags;                    /* VGCF_* flags                 */
   5.348 +    struct cpu_user_regs user_regs;         /* User-level CPU registers     */
   5.349 +    struct trap_info trap_ctxt[256];        /* Virtual IDT                  */
   5.350 +    xen_ulong_t ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
   5.351 +    xen_ulong_t gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
   5.352 +    xen_ulong_t kernel_ss, kernel_sp;     /* Virtual TSS (only SS1/SP1)   */
   5.353 +    /* NB. User pagetable on x86/64 is placed in ctrlreg[1]. */
   5.354 +    xen_ulong_t ctrlreg[8];               /* CR0-CR7 (control registers)  */
   5.355 +    xen_ulong_t debugreg[8];              /* DB0-DB7 (debug registers)    */
   5.356 +#ifdef __i386__
   5.357 +    xen_ulong_t event_callback_cs;        /* CS:EIP of event callback     */
   5.358 +    xen_ulong_t event_callback_eip;
   5.359 +    xen_ulong_t failsafe_callback_cs;     /* CS:EIP of failsafe callback  */
   5.360 +    xen_ulong_t failsafe_callback_eip;
   5.361 +#else
   5.362 +    xen_ulong_t event_callback_eip;
   5.363 +    xen_ulong_t failsafe_callback_eip;
   5.364 +#ifdef __XEN__
   5.365 +    union {
   5.366 +        xen_ulong_t syscall_callback_eip;
   5.367 +        struct {
   5.368 +            unsigned int event_callback_cs;    /* compat CS of event cb     */
   5.369 +            unsigned int failsafe_callback_cs; /* compat CS of failsafe cb  */
   5.370 +        };
   5.371 +    };
   5.372 +#else
   5.373 +    xen_ulong_t syscall_callback_eip;
   5.374 +#endif
   5.375 +#endif
   5.376 +    xen_ulong_t vm_assist;                /* VMASST_TYPE_* bitmap */
   5.377 +#ifdef __x86_64__
   5.378 +    /* Segment base addresses. */
   5.379 +    uint64_t      fs_base;
   5.380 +    uint64_t      gs_base_kernel;
   5.381 +    uint64_t      gs_base_user;
   5.382 +#endif
   5.383 +};
   5.384 +typedef struct vcpu_guest_context vcpu_guest_context_t;
   5.385 +DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
   5.386 +
   5.387 +struct arch_shared_info {
   5.388 +    xen_ulong_t max_pfn;                  /* max pfn that appears in table */
   5.389 +    /* Frame containing list of mfns containing list of mfns containing p2m. */
   5.390 +    xen_pfn_t     pfn_to_mfn_frame_list_list;
   5.391 +    xen_ulong_t nmi_reason;
   5.392 +    uint64_t pad[32];
   5.393 +};
   5.394 +typedef struct arch_shared_info arch_shared_info_t;
   5.395 +
   5.396 +#endif /* !__ASSEMBLY__ */
   5.397 +
   5.398 +/*
   5.399 + * Prefix forces emulation of some non-trapping instructions.
   5.400 + * Currently only CPUID.
   5.401 + */
   5.402 +#ifdef __ASSEMBLY__
   5.403 +#define XEN_EMULATE_PREFIX .byte 0x0f,0x0b,0x78,0x65,0x6e ;
   5.404 +#define XEN_CPUID          XEN_EMULATE_PREFIX cpuid
   5.405 +#else
   5.406 +#define XEN_EMULATE_PREFIX ".byte 0x0f,0x0b,0x78,0x65,0x6e ; "
   5.407 +#define XEN_CPUID          XEN_EMULATE_PREFIX "cpuid"
   5.408 +#endif
   5.409 +
   5.410 +#endif /* __XEN_PUBLIC_ARCH_X86_XEN_H__ */
   5.411 +
   5.412 +/*
   5.413 + * Local variables:
   5.414 + * mode: C
   5.415 + * c-set-style: "BSD"
   5.416 + * c-basic-offset: 4
   5.417 + * tab-width: 4
   5.418 + * indent-tabs-mode: nil
   5.419 + * End:
   5.420 + */
   5.421 \ No newline at end of file
     6.1 --- a/common/include/public/io/fbif.h	Wed Jan 23 11:58:03 2008 -0800
     6.2 +++ b/common/include/public/io/fbif.h	Wed Jan 23 11:58:26 2008 -0800
     6.3 @@ -109,10 +109,10 @@ struct xenfb_page
     6.4       * Each directory page holds PAGE_SIZE / sizeof(*pd)
     6.5       * framebuffer pages, and can thus map up to PAGE_SIZE *
     6.6       * PAGE_SIZE / sizeof(*pd) bytes.  With PAGE_SIZE == 4096 and
     6.7 -     * sizeof(unsigned long) == 4, that's 4 Megs.  Two directory
     6.8 +     * sizeof(xen_ulong_t) == 4, that's 4 Megs.  Two directory
     6.9       * pages should be enough for a while.
    6.10       */
    6.11 -    unsigned long pd[2];
    6.12 +    xen_ulong_t pd[2];
    6.13  };
    6.14  
    6.15  /*
     7.1 --- a/common/include/public/io/tpmif.h	Wed Jan 23 11:58:03 2008 -0800
     7.2 +++ b/common/include/public/io/tpmif.h	Wed Jan 23 11:58:26 2008 -0800
     7.3 @@ -37,7 +37,7 @@
     7.4  #include "../grant_table.h"
     7.5  
     7.6  struct tpmif_tx_request {
     7.7 -    unsigned long addr;   /* Machine address of packet.   */
     7.8 +    xen_ulong_t addr;   /* Machine address of packet.   */
     7.9      grant_ref_t ref;      /* grant table access reference */
    7.10      uint16_t unused;
    7.11      uint16_t size;        /* Packet size in bytes.        */
     8.1 --- a/common/include/public/kexec.h	Wed Jan 23 11:58:03 2008 -0800
     8.2 +++ b/common/include/public/kexec.h	Wed Jan 23 11:58:26 2008 -0800
     8.3 @@ -77,10 +77,10 @@
     8.4   
     8.5  typedef struct xen_kexec_image {
     8.6  #if defined(__i386__) || defined(__x86_64__)
     8.7 -    unsigned long page_list[KEXEC_XEN_NO_PAGES];
     8.8 +    xen_ulong_t page_list[KEXEC_XEN_NO_PAGES];
     8.9  #endif
    8.10 -    unsigned long indirection_page;
    8.11 -    unsigned long start_address;
    8.12 +    xen_ulong_t indirection_page;
    8.13 +    xen_ulong_t start_address;
    8.14  } xen_kexec_image_t;
    8.15  
    8.16  /*
    8.17 @@ -120,8 +120,8 @@ typedef struct xen_kexec_load {
    8.18  typedef struct xen_kexec_range {
    8.19      int range;
    8.20      int nr;
    8.21 -    unsigned long size;
    8.22 -    unsigned long start;
    8.23 +    xen_ulong_t size;
    8.24 +    xen_ulong_t start;
    8.25  } xen_kexec_range_t;
    8.26  
    8.27  #endif /* _XEN_PUBLIC_KEXEC_H */
     9.1 --- a/common/include/public/libelf.h	Wed Jan 23 11:58:03 2008 -0800
     9.2 +++ b/common/include/public/libelf.h	Wed Jan 23 11:58:26 2008 -0800
     9.3 @@ -162,7 +162,7 @@ void elf_set_logfile(struct elf_binary *
     9.4  void elf_parse_binary(struct elf_binary *elf);
     9.5  void elf_load_binary(struct elf_binary *elf);
     9.6  
     9.7 -void *elf_get_ptr(struct elf_binary *elf, unsigned long addr);
     9.8 +void *elf_get_ptr(struct elf_binary *elf, xen_ulong_t addr);
     9.9  uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
    9.10  
    9.11  /* ------------------------------------------------------------------------ */
    10.1 --- a/common/include/public/nmi.h	Wed Jan 23 11:58:03 2008 -0800
    10.2 +++ b/common/include/public/nmi.h	Wed Jan 23 11:58:26 2008 -0800
    10.3 @@ -53,8 +53,8 @@
    10.4   */
    10.5  #define XENNMI_register_callback   0
    10.6  struct xennmi_callback {
    10.7 -    unsigned long handler_address;
    10.8 -    unsigned long pad;
    10.9 +    xen_ulong_t handler_address;
   10.10 +    xen_ulong_t pad;
   10.11  };
   10.12  typedef struct xennmi_callback xennmi_callback_t;
   10.13  DEFINE_XEN_GUEST_HANDLE(xennmi_callback_t);
    11.1 --- a/common/include/public/physdev.h	Wed Jan 23 11:58:03 2008 -0800
    11.2 +++ b/common/include/public/physdev.h	Wed Jan 23 11:58:26 2008 -0800
    11.3 @@ -95,7 +95,7 @@ DEFINE_XEN_GUEST_HANDLE(physdev_set_iobi
    11.4  #define PHYSDEVOP_apic_write             9
    11.5  struct physdev_apic {
    11.6      /* IN */
    11.7 -    unsigned long apic_physbase;
    11.8 +    xen_ulong_t apic_physbase;
    11.9      uint32_t reg;
   11.10      /* IN or OUT */
   11.11      uint32_t value;
    12.1 --- a/common/include/public/sched.h	Wed Jan 23 11:58:03 2008 -0800
    12.2 +++ b/common/include/public/sched.h	Wed Jan 23 11:58:26 2008 -0800
    12.3 @@ -37,7 +37,7 @@
    12.4   * 
    12.5   * Versions of Xen prior to 3.0.2 provided only the following legacy version
    12.6   * of this hypercall, supporting only the commands yield, block and shutdown:
    12.7 - *  long sched_op(int cmd, unsigned long arg)
    12.8 + *  long sched_op(int cmd, xen_ulong_t arg)
    12.9   * @cmd == SCHEDOP_??? (scheduler operation).
   12.10   * @arg == 0               (SCHEDOP_yield and SCHEDOP_block)
   12.11   *      == SHUTDOWN_* code (SCHEDOP_shutdown)
    13.1 --- a/common/include/public/trace.h	Wed Jan 23 11:58:03 2008 -0800
    13.2 +++ b/common/include/public/trace.h	Wed Jan 23 11:58:26 2008 -0800
    13.3 @@ -94,7 +94,7 @@
    13.4  struct t_rec {
    13.5      uint64_t cycles;          /* cycle counter timestamp */
    13.6      uint32_t event;           /* event ID                */
    13.7 -    unsigned long data[5];    /* event data items        */
    13.8 +    xen_ulong_t data[5];    /* event data items        */
    13.9  };
   13.10  
   13.11  /*
    14.1 --- a/common/include/public/version.h	Wed Jan 23 11:58:03 2008 -0800
    14.2 +++ b/common/include/public/version.h	Wed Jan 23 11:58:26 2008 -0800
    14.3 @@ -58,7 +58,7 @@ typedef char xen_changeset_info_t[64];
    14.4  
    14.5  #define XENVER_platform_parameters 5
    14.6  struct xen_platform_parameters {
    14.7 -    unsigned long virt_start;
    14.8 +    xen_ulong_t virt_start;
    14.9  };
   14.10  typedef struct xen_platform_parameters xen_platform_parameters_t;
   14.11  
    15.1 --- a/common/include/public/xen.h	Wed Jan 23 11:58:03 2008 -0800
    15.2 +++ b/common/include/public/xen.h	Wed Jan 23 11:58:26 2008 -0800
    15.3 @@ -239,7 +239,7 @@ struct mmuext_op {
    15.4          /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */
    15.5          xen_pfn_t     mfn;
    15.6          /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
    15.7 -        unsigned long linear_addr;
    15.8 +        xen_ulong_t linear_addr;
    15.9      } arg1;
   15.10      union {
   15.11          /* SET_LDT */
   15.12 @@ -338,8 +338,8 @@ DEFINE_XEN_GUEST_HANDLE(mmu_update_t);
   15.13   * NB. The fields are natural register size for this architecture.
   15.14   */
   15.15  struct multicall_entry {
   15.16 -    unsigned long op, result;
   15.17 -    unsigned long args[6];
   15.18 +    xen_ulong_t op, result;
   15.19 +    xen_ulong_t args[6];
   15.20  };
   15.21  typedef struct multicall_entry multicall_entry_t;
   15.22  DEFINE_XEN_GUEST_HANDLE(multicall_entry_t);
   15.23 @@ -348,7 +348,7 @@ DEFINE_XEN_GUEST_HANDLE(multicall_entry_
   15.24   * Event channel endpoints per domain:
   15.25   *  1024 if a long is 32 bits; 4096 if a long is 64 bits.
   15.26   */
   15.27 -#define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64)
   15.28 +#define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
   15.29  
   15.30  struct vcpu_time_info {
   15.31      /*
   15.32 @@ -405,7 +405,7 @@ struct vcpu_info {
   15.33       */
   15.34      uint8_t evtchn_upcall_pending;
   15.35      uint8_t evtchn_upcall_mask;
   15.36 -    unsigned long evtchn_pending_sel;
   15.37 +    xen_ulong_t evtchn_pending_sel;
   15.38      struct arch_vcpu_info arch;
   15.39      struct vcpu_time_info time;
   15.40  }; /* 64 bytes (x86) */
   15.41 @@ -455,8 +455,8 @@ struct shared_info {
   15.42       * per-vcpu selector word to be set. Each bit in the selector covers a
   15.43       * 'C long' in the PENDING bitfield array.
   15.44       */
   15.45 -    unsigned long evtchn_pending[sizeof(unsigned long) * 8];
   15.46 -    unsigned long evtchn_mask[sizeof(unsigned long) * 8];
   15.47 +    xen_ulong_t evtchn_pending[sizeof(xen_ulong_t) * 8];
   15.48 +    xen_ulong_t evtchn_mask[sizeof(xen_ulong_t) * 8];
   15.49  
   15.50      /*
   15.51       * Wallclock time: updated only by control software. Guests should base
   15.52 @@ -500,8 +500,8 @@ typedef struct shared_info shared_info_t
   15.53  struct start_info {
   15.54      /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.    */
   15.55      char magic[32];             /* "xen-<version>-<platform>".            */
   15.56 -    unsigned long nr_pages;     /* Total pages allocated to this domain.  */
   15.57 -    unsigned long shared_info;  /* MACHINE address of shared info struct. */
   15.58 +    xen_ulong_t nr_pages;     /* Total pages allocated to this domain.  */
   15.59 +    xen_ulong_t shared_info;  /* MACHINE address of shared info struct. */
   15.60      uint32_t flags;             /* SIF_xxx flags.                         */
   15.61      xen_pfn_t store_mfn;        /* MACHINE page number of shared page.    */
   15.62      uint32_t store_evtchn;      /* Event channel for store communication. */
   15.63 @@ -516,11 +516,11 @@ struct start_info {
   15.64          } dom0;
   15.65      } console;
   15.66      /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).     */
   15.67 -    unsigned long pt_base;      /* VIRTUAL address of page directory.     */
   15.68 -    unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames.       */
   15.69 -    unsigned long mfn_list;     /* VIRTUAL address of page-frame list.    */
   15.70 -    unsigned long mod_start;    /* VIRTUAL address of pre-loaded module.  */
   15.71 -    unsigned long mod_len;      /* Size (bytes) of pre-loaded module.     */
   15.72 +    xen_ulong_t pt_base;      /* VIRTUAL address of page directory.     */
   15.73 +    xen_ulong_t nr_pt_frames; /* Number of bootstrap p.t. frames.       */
   15.74 +    xen_ulong_t mfn_list;     /* VIRTUAL address of page-frame list.    */
   15.75 +    xen_ulong_t mod_start;    /* VIRTUAL address of pre-loaded module.  */
   15.76 +    xen_ulong_t mod_len;      /* Size (bytes) of pre-loaded module.     */
   15.77      int8_t cmd_line[MAX_GUEST_CMDLINE];
   15.78  };
   15.79  typedef struct start_info start_info_t;
   15.80 @@ -573,7 +573,7 @@ typedef struct dom0_vga_console_info {
   15.81  
   15.82  typedef uint8_t xen_domain_handle_t[16];
   15.83  
   15.84 -/* Turn a plain number into a C unsigned long constant. */
   15.85 +/* Turn a plain number into a C xen_ulong_t constant. */
   15.86  #define __mk_unsigned_long(x) x ## UL
   15.87  #define mk_unsigned_long(x) __mk_unsigned_long(x)
   15.88  
    16.1 --- a/common/include/xen_public.h	Wed Jan 23 11:58:03 2008 -0800
    16.2 +++ b/common/include/xen_public.h	Wed Jan 23 11:58:26 2008 -0800
    16.3 @@ -20,10 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fi
    16.4  #if !defined(_XEN_PUBLIC_H_)
    16.5  #define _XEN_PUBLIC_H_
    16.6  
    16.7 -//#include <evtchn_public.h>
    16.8 -//#include <xenbus_public.h>
    16.9 -//#include <gnttbl_public.h>
   16.10 -
   16.11  DEFINE_GUID( GUID_XEN_IFACE, 0x5C568AC5, 0x9DDF, 0x4FA5, 0xA9, 0x4A, 0x39, 0xD6, 0x70, 0x77, 0x81, 0x9C);
   16.12  //{5C568AC5-9DDF-4FA5-A94A-39D67077819C}
   16.13  
   16.14 @@ -52,7 +48,7 @@ typedef evtchn_port_t
   16.15  (*PXEN_EVTCHN_ALLOCUNBOUND)(PVOID Context, domid_t Domain);
   16.16  
   16.17  typedef grant_ref_t
   16.18 -(*PXEN_GNTTBL_GRANTACCESS)(WDFDEVICE Device, domid_t domid, unsigned long frame, int readonly);
   16.19 +(*PXEN_GNTTBL_GRANTACCESS)(WDFDEVICE Device, domid_t domid, uint32_t frame, int readonly);
   16.20  typedef BOOLEAN
   16.21  (*PXEN_GNTTBL_ENDACCESS)(WDFDEVICE Device, grant_ref_t ref);
   16.22  
    17.1 --- a/common/include/xen_windows.h	Wed Jan 23 11:58:03 2008 -0800
    17.2 +++ b/common/include/xen_windows.h	Wed Jan 23 11:58:26 2008 -0800
    17.3 @@ -25,7 +25,7 @@ typedef UINT16 uint16_t;
    17.4  typedef INT32 int32_t;
    17.5  typedef UINT32 uint32_t;
    17.6  typedef UINT64 uint64_t;
    17.7 -typedef unsigned long pgentry_t;
    17.8 +//typedef unsigned long pgentry_t;
    17.9  
   17.10  #include <xen.h>
   17.11  
    18.1 --- a/xenpci/amd64/hypercall.asm	Wed Jan 23 11:58:03 2008 -0800
    18.2 +++ b/xenpci/amd64/hypercall.asm	Wed Jan 23 11:58:26 2008 -0800
    18.3 @@ -31,4 +31,4 @@
    18.4      pop rdi
    18.5      ret
    18.6  _hypercall2 endp
    18.7 -END
    18.8 \ No newline at end of file
    18.9 +END
    19.1 --- a/xenpci/evtchn.c	Wed Jan 23 11:58:03 2008 -0800
    19.2 +++ b/xenpci/evtchn.c	Wed Jan 23 11:58:26 2008 -0800
    19.3 @@ -19,6 +19,18 @@ Foundation, Inc., 51 Franklin Street, Fi
    19.4  
    19.5  #include "xenpci.h"
    19.6  
    19.7 +#if defined(__X86__)
    19.8 +  #define xchg(p1, p2) _InterlockedExchange(p1, p2)
    19.9 +  #define synch_clear_bit(p1, p2) _interlockedbittestandreset(p2, p1)
   19.10 +  #define synch_set_bit(p1, p2) _interlockedbittestandset(p2, p1)
   19.11 +  #define bit_scan_forward(p1, p2) _BitScanForward(p1, p2)
   19.12 +#else
   19.13 +  #define xchg(p1, p2) _InterlockedExchange64(p1, p2)
   19.14 +  #define synch_clear_bit(p1, p2) _interlockedbittestandreset64(p2, p1)
   19.15 +  #define synch_set_bit(p1, p2) _interlockedbittestandset64(p2, p1)
   19.16 +  #define bit_scan_forward(p1, p2) _BitScanForward64(p1, p2)
   19.17 +#endif
   19.18 +
   19.19  static VOID
   19.20  EvtChn_DpcBounce(WDFDPC Dpc)
   19.21  {
   19.22 @@ -35,12 +47,13 @@ EvtChn_Interrupt(WDFINTERRUPT Interrupt,
   19.23    vcpu_info_t *vcpu_info;
   19.24    PXENPCI_DEVICE_DATA xpdd = GetDeviceData(WdfInterruptGetDevice(Interrupt));
   19.25    shared_info_t *shared_info_area = xpdd->shared_info_area;
   19.26 -  unsigned long evt_words, evt_word;
   19.27 +  xen_ulong_t evt_words;
   19.28 +  unsigned long evt_word;
   19.29    unsigned long evt_bit;
   19.30 -  unsigned long port;
   19.31 +  unsigned int port;
   19.32    ev_action_t *ev_action;
   19.33  
   19.34 -//  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ " (cpu = %d)\n", cpu));
   19.35 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ " (cpu = %d)\n", cpu));
   19.36  
   19.37    UNREFERENCED_PARAMETER(MessageID);
   19.38  
   19.39 @@ -48,12 +61,12 @@ EvtChn_Interrupt(WDFINTERRUPT Interrupt,
   19.40  
   19.41    vcpu_info->evtchn_upcall_pending = 0;
   19.42  
   19.43 -  evt_words = _InterlockedExchange((volatile LONG *)&vcpu_info->evtchn_pending_sel, 0);
   19.44 +  evt_words = xchg((volatile xen_ulong_t *)&vcpu_info->evtchn_pending_sel, 0);
   19.45    
   19.46 -  while (_BitScanForward(&evt_word, evt_words))
   19.47 +  while (bit_scan_forward(&evt_word, evt_words))
   19.48    {
   19.49      evt_words &= ~(1 << evt_word);
   19.50 -    while (_BitScanForward(&evt_bit, shared_info_area->evtchn_pending[evt_word] & ~shared_info_area->evtchn_mask[evt_word]))
   19.51 +    while (bit_scan_forward(&evt_bit, shared_info_area->evtchn_pending[evt_word] & ~shared_info_area->evtchn_mask[evt_word]))
   19.52      {
   19.53        port = (evt_word << 5) + evt_bit;
   19.54        ev_action = &xpdd->ev_actions[port];
   19.55 @@ -65,7 +78,7 @@ EvtChn_Interrupt(WDFINTERRUPT Interrupt,
   19.56        {
   19.57          if (ev_action->DpcFlag)
   19.58          {
   19.59 -//          KdPrint((__DRIVER_NAME " --- Scheduling Dpc\n"));
   19.60 +          KdPrint((__DRIVER_NAME " --- Scheduling Dpc\n"));
   19.61            WdfDpcEnqueue(ev_action->Dpc);
   19.62          }
   19.63          else
   19.64 @@ -73,11 +86,11 @@ EvtChn_Interrupt(WDFINTERRUPT Interrupt,
   19.65            ev_action->ServiceRoutine(NULL, ev_action->ServiceContext);
   19.66          }
   19.67        }
   19.68 -      _interlockedbittestandreset((volatile LONG *)&shared_info_area->evtchn_pending[0], port);
   19.69 +      synch_clear_bit(port, (volatile xen_ulong_t *)&shared_info_area->evtchn_pending[evt_word]);
   19.70      }
   19.71    }
   19.72  
   19.73 -//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   19.74 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   19.75  
   19.76    return FALSE; // This needs to be FALSE so it can fall through to the scsiport ISR.
   19.77  }
   19.78 @@ -171,8 +184,8 @@ EvtChn_Mask(PVOID Context, evtchn_port_t
   19.79    PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
   19.80    //KdPrint((__DRIVER_NAME " --> EvtChn_Mask\n"));
   19.81  
   19.82 -  _interlockedbittestandset(
   19.83 -    (volatile LONG *)&xpdd->shared_info_area->evtchn_mask[0], Port);
   19.84 +  synch_set_bit(Port,
   19.85 +    (volatile xen_ulong_t *)&xpdd->shared_info_area->evtchn_mask[0]);
   19.86  
   19.87    //KdPrint((__DRIVER_NAME " <-- EvtChn_Mask\n"));
   19.88  
   19.89 @@ -186,8 +199,8 @@ EvtChn_Unmask(PVOID Context, evtchn_port
   19.90    PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
   19.91    //KdPrint((__DRIVER_NAME " --> EvtChn_Unmask\n"));
   19.92  
   19.93 -  _interlockedbittestandreset(
   19.94 -    (volatile LONG *)&xpdd->shared_info_area->evtchn_mask[0], Port);
   19.95 +  synch_clear_bit(Port,
   19.96 +    (volatile xen_ulong_t *)&xpdd->shared_info_area->evtchn_mask[0]);
   19.97    // should we kick off pending interrupts here too???
   19.98  
   19.99    //KdPrint((__DRIVER_NAME " <-- EvtChn_Unmask\n"));
  19.100 @@ -232,11 +245,11 @@ EvtChn_GetXenStorePort(WDFDEVICE Device)
  19.101  {
  19.102    evtchn_port_t Port;  
  19.103  
  19.104 -  //KdPrint((__DRIVER_NAME " --> EvtChn_GetStorePort\n"));
  19.105 +  KdPrint((__DRIVER_NAME " --> EvtChn_GetStorePort\n"));
  19.106  
  19.107    Port = (evtchn_port_t)hvm_get_parameter(Device, HVM_PARAM_STORE_EVTCHN);
  19.108  
  19.109 -  //KdPrint((__DRIVER_NAME " <-- EvtChn_GetStorePort\n"));
  19.110 +  KdPrint((__DRIVER_NAME " <-- EvtChn_GetStorePort\n"));
  19.111  
  19.112    return Port;
  19.113  }
  19.114 @@ -247,22 +260,20 @@ EvtChn_GetXenStoreRingAddr(WDFDEVICE Dev
  19.115    PHYSICAL_ADDRESS pa_xen_store_interface;
  19.116    PVOID xen_store_interface;
  19.117  
  19.118 -  ULONG xen_store_mfn;
  19.119 +  xen_ulong_t xen_store_mfn;
  19.120  
  19.121 -  //KdPrint((__DRIVER_NAME " --> EvtChn_GetRingAddr\n"));
  19.122 +  KdPrint((__DRIVER_NAME " --> EvtChn_GetRingAddr\n"));
  19.123  
  19.124 -  xen_store_mfn = (ULONG)hvm_get_parameter(Device, HVM_PARAM_STORE_PFN);
  19.125 +  xen_store_mfn = hvm_get_parameter(Device, HVM_PARAM_STORE_PFN);
  19.126  
  19.127    pa_xen_store_interface.QuadPart = xen_store_mfn << PAGE_SHIFT;
  19.128    xen_store_interface = MmMapIoSpace(pa_xen_store_interface, PAGE_SIZE, MmNonCached);
  19.129  
  19.130 -  //KdPrint((__DRIVER_NAME " xen_store_mfn = %08x\n", xen_store_mfn));
  19.131 +  KdPrint((__DRIVER_NAME " xen_store_mfn = %08x\n", xen_store_mfn));
  19.132    //KdPrint((__DRIVER_NAME " xen_store_evtchn = %08x\n", xen_store_evtchn));
  19.133 -  //KdPrint((__DRIVER_NAME " xen_store_interface = %08x\n", xen_store_interface));
  19.134 +  KdPrint((__DRIVER_NAME " xen_store_interface = %08x\n", xen_store_interface));
  19.135  
  19.136 -  //KeInitializeEvent(&xenbus_waitevent, NotificationEvent, FALSE);
  19.137 -
  19.138 -  //KdPrint((__DRIVER_NAME " <-- EvtChn_GetRingAddr\n"));
  19.139 +  KdPrint((__DRIVER_NAME " <-- EvtChn_GetRingAddr\n"));
  19.140  
  19.141    return xen_store_interface;
  19.142  }
    20.1 --- a/xenpci/gnttbl.c	Wed Jan 23 11:58:03 2008 -0800
    20.2 +++ b/xenpci/gnttbl.c	Wed Jan 23 11:58:26 2008 -0800
    20.3 @@ -101,7 +101,7 @@ grant_ref_t
    20.4  GntTbl_GrantAccess(
    20.5    WDFDEVICE Device,
    20.6    domid_t domid,
    20.7 -  unsigned long frame,
    20.8 +  uint32_t frame,
    20.9    int readonly)
   20.10  {
   20.11    PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
    21.1 --- a/xenpci/hypercall_amd64.h	Wed Jan 23 11:58:03 2008 -0800
    21.2 +++ b/xenpci/hypercall_amd64.h	Wed Jan 23 11:58:26 2008 -0800
    21.3 @@ -43,6 +43,9 @@ HYPERVISOR_memory_op(WDFDEVICE Device, i
    21.4  static __inline int
    21.5  HYPERVISOR_xen_version(WDFDEVICE Device, int cmd, void *arg)
    21.6  {
    21.7 +  PCHAR xen_version_func = GetDeviceData(Device)->hypercall_stubs;
    21.8 +  xen_version_func += __HYPERVISOR_xen_version * 32;
    21.9 +  return _hypercall2(xen_version_func, cmd, arg);
   21.10  /*
   21.11    char *hypercall_stubs = GetDeviceData(Device)->hypercall_stubs;
   21.12    long __res;
   21.13 @@ -56,12 +59,12 @@ HYPERVISOR_xen_version(WDFDEVICE Device,
   21.14    }
   21.15    return __res;
   21.16  */
   21.17 -  return -1;
   21.18  }
   21.19  
   21.20  static __inline int
   21.21  HYPERVISOR_grant_table_op(WDFDEVICE Device, int cmd, void *uop, unsigned int count)
   21.22  {
   21.23 +  ASSERTMSG("grant_table_op not yet supported under AMD64", FALSE);
   21.24  /*
   21.25    char *hypercall_stubs = GetDeviceData(Device)->hypercall_stubs;
   21.26    long __res;
   21.27 @@ -82,6 +85,7 @@ HYPERVISOR_grant_table_op(WDFDEVICE Devi
   21.28  static __inline int
   21.29  HYPERVISOR_mmu_update(WDFDEVICE Device, mmu_update_t *req, int count, int *success_count, domid_t domid)
   21.30  {
   21.31 +  ASSERTMSG("mmu_update not yet supported under AMD64", FALSE);
   21.32  /*
   21.33    char *hypercall_stubs = GetDeviceData(Device)->hypercall_stubs;
   21.34    long __res;
   21.35 @@ -104,6 +108,7 @@ HYPERVISOR_mmu_update(WDFDEVICE Device, 
   21.36  static __inline int
   21.37  HYPERVISOR_console_io(WDFDEVICE Device, int cmd, int count, char *string)
   21.38  {
   21.39 +  ASSERTMSG("console_io not yet supported under AMD64", FALSE);
   21.40  /*
   21.41    char *hypercall_stubs = GetDeviceData(Device)->hypercall_stubs;
   21.42    long __res;
   21.43 @@ -125,7 +130,7 @@ static __inline int
   21.44  HYPERVISOR_hvm_op(WDFDEVICE Device, int op, struct xen_hvm_param *arg)
   21.45  {
   21.46    PCHAR hvm_op_func = GetDeviceData(Device)->hypercall_stubs;
   21.47 -  hvm_op_func += __HYPERVISOR_memory_op * 32;
   21.48 +  hvm_op_func += __HYPERVISOR_hvm_op * 32;
   21.49    return _hypercall2(hvm_op_func, op, arg);
   21.50  /*
   21.51    char *hypercall_stubs = GetDeviceData(Device)->hypercall_stubs;
   21.52 @@ -145,6 +150,9 @@ HYPERVISOR_hvm_op(WDFDEVICE Device, int 
   21.53  static __inline int
   21.54  HYPERVISOR_event_channel_op(WDFDEVICE Device, int cmd, void *op)
   21.55  {
   21.56 +  PCHAR event_channel_op_func = GetDeviceData(Device)->hypercall_stubs;
   21.57 +  event_channel_op_func += __HYPERVISOR_event_channel_op * 32;
   21.58 +  return _hypercall2(event_channel_op_func, cmd, op);
   21.59  /*
   21.60    char *hypercall_stubs = GetDeviceData(Device)->hypercall_stubs;
   21.61    long __res;
   21.62 @@ -158,7 +166,6 @@ HYPERVISOR_event_channel_op(WDFDEVICE De
   21.63    }
   21.64    return __res;
   21.65  */
   21.66 -  return -1;
   21.67  }
   21.68  
   21.69  static __inline ULONGLONG
   21.70 @@ -170,9 +177,9 @@ hvm_get_parameter(WDFDEVICE Device, int 
   21.71    KdPrint((__DRIVER_NAME " --> hvm_get_parameter\n"));
   21.72    a.domid = DOMID_SELF;
   21.73    a.index = hvm_param;
   21.74 -  //a.value = via;
   21.75    retval = HYPERVISOR_hvm_op(Device, HVMOP_get_param, &a);
   21.76    KdPrint((__DRIVER_NAME " hvm_get_parameter retval = %d\n", retval));
   21.77 +  KdPrint((__DRIVER_NAME " hvm_get_parameter value = %ld\n", a.value));
   21.78    KdPrint((__DRIVER_NAME " <-- hvm_get_parameter\n"));
   21.79    return a.value;
   21.80  }
    22.1 --- a/xenpci/sources	Wed Jan 23 11:58:03 2008 -0800
    22.2 +++ b/xenpci/sources	Wed Jan 23 11:58:26 2008 -0800
    22.3 @@ -1,7 +1,7 @@
    22.4  TARGETNAME=XENPCI
    22.5  TARGETTYPE=DRIVER
    22.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
    22.7 -VERSION=0.6.0.0
    22.8 +VERSION=0.6.0.15
    22.9  KMDF_VERSION=1
   22.10  MSC_WARNING_LEVEL=/W4
   22.11  INF_NAME=xenpci
    23.1 --- a/xenpci/xenbus.c	Wed Jan 23 11:58:03 2008 -0800
    23.2 +++ b/xenpci/xenbus.c	Wed Jan 23 11:58:26 2008 -0800
    23.3 @@ -143,8 +143,8 @@ static void xb_write(
    23.4  //  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    23.5  
    23.6    for (r = 0; r < nr_reqs; r++)
    23.7 -    len += req[r].len;
    23.8 -  m.len = len;
    23.9 +    len += (size_t)req[r].len;
   23.10 +  m.len = (ULONG)len;
   23.11    len += sizeof(m);
   23.12  
   23.13    cur_req = &header_req;
   23.14 @@ -175,7 +175,7 @@ static void xb_write(
   23.15    {
   23.16      this_chunk = min(cur_req->len - req_off,XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod));
   23.17      memcpy((char *)xpdd->xen_store_interface->req + MASK_XENSTORE_IDX(prod), (char *)cur_req->data + req_off, this_chunk);
   23.18 -    prod += this_chunk;
   23.19 +    prod += (XENSTORE_RING_IDX)this_chunk;
   23.20      req_off += this_chunk;
   23.21      total_off += this_chunk;
   23.22      if (req_off == cur_req->len)
   23.23 @@ -198,7 +198,7 @@ static void xb_write(
   23.24    //_WriteBarrier();
   23.25    KeMemoryBarrier();
   23.26  
   23.27 -  xpdd->xen_store_interface->req_prod += len;
   23.28 +  xpdd->xen_store_interface->req_prod += (XENSTORE_RING_IDX)len;
   23.29  
   23.30    //KdPrint((__DRIVER_NAME " prod = %08x\n", xen_store_interface->req_prod));
   23.31  
   23.32 @@ -242,7 +242,7 @@ XenBus_Read(
   23.33    char **value)
   23.34  {
   23.35    WDFDEVICE Device = Context;
   23.36 -  struct write_req req[] = { {path, strlen(path) + 1} };
   23.37 +  struct write_req req[] = { {path, (ULONG)strlen(path) + 1} };
   23.38    struct xsd_sockmsg *rep;
   23.39    char *res;
   23.40    char *msg;
   23.41 @@ -275,8 +275,8 @@ XenBus_Write(
   23.42  {
   23.43    WDFDEVICE Device = Context;
   23.44    struct write_req req[] = {
   23.45 -    {path, strlen(path) + 1},
   23.46 -    {value, strlen(value) + 1},
   23.47 +    {path, (ULONG)strlen(path) + 1},
   23.48 +    {value, (ULONG)strlen(value) + 1},
   23.49    };
   23.50    struct xsd_sockmsg *rep;
   23.51    char *msg;
   23.52 @@ -413,7 +413,7 @@ XenBus_List(
   23.53  {
   23.54    WDFDEVICE Device = Context;
   23.55    struct xsd_sockmsg *reply, *repmsg;
   23.56 -  struct write_req req[] = { { pre, strlen(pre)+1 } };
   23.57 +  struct write_req req[] = { { pre, (ULONG)strlen(pre)+1 } };
   23.58    ULONG nr_elems, x, i;
   23.59    char **res;
   23.60    char *msg;
   23.61 @@ -437,7 +437,7 @@ XenBus_List(
   23.62      XENPCI_POOL_TAG);
   23.63    for (x = i = 0; i < nr_elems; i++)
   23.64    {
   23.65 -    int l = strlen((char *)reply + x);
   23.66 +    int l = (int)strlen((char *)reply + x);
   23.67      res[i] = ExAllocatePoolWithTag(NonPagedPool, l + 1, XENPCI_POOL_TAG);
   23.68      memcpy(res[i], (char *)reply + x, l + 1);
   23.69      x += l + 1;
   23.70 @@ -623,11 +623,11 @@ XenBus_AddWatch(
   23.71    KeReleaseSpinLock(&xpdd->WatchLock, OldIrql);
   23.72  
   23.73    req[0].data = Path;
   23.74 -  req[0].len = strlen(Path) + 1;
   23.75 +  req[0].len = (ULONG)strlen(Path) + 1;
   23.76  
   23.77    RtlStringCbPrintfA(Token, ARRAY_SIZE(Token), "%d", i);
   23.78    req[1].data = Token;
   23.79 -  req[1].len = strlen(Token) + 1;
   23.80 +  req[1].len = (ULONG)strlen(Token) + 1;
   23.81  
   23.82    rep = xenbus_msg_reply(Device, XS_WATCH, xbt, req, ARRAY_SIZE(req));
   23.83  
   23.84 @@ -703,11 +703,11 @@ XenBus_RemWatch(
   23.85    KeReleaseSpinLock(&xpdd->WatchLock, OldIrql);
   23.86  
   23.87    req[0].data = Path;
   23.88 -  req[0].len = strlen(Path) + 1;
   23.89 +  req[0].len = (ULONG)strlen(Path) + 1;
   23.90  
   23.91    RtlStringCbPrintfA(Token, ARRAY_SIZE(Token), "%d", i);
   23.92    req[1].data = Token;
   23.93 -  req[1].len = strlen(Token) + 1;
   23.94 +  req[1].len = (ULONG)strlen(Token) + 1;
   23.95  
   23.96    rep = xenbus_msg_reply(Device, XS_UNWATCH, xbt, req, ARRAY_SIZE(req));
   23.97  
    24.1 --- a/xenpci/xenpci.c	Wed Jan 23 11:58:03 2008 -0800
    24.2 +++ b/xenpci/xenpci.c	Wed Jan 23 11:58:26 2008 -0800
    24.3 @@ -145,7 +145,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
    24.4      case 0:
    24.5        if (SystemStartOptions[i] == L'G')
    24.6        {
    24.7 -        StartPos = i;
    24.8 +        StartPos = (int)i;
    24.9          State = 2;
   24.10        } else if (SystemStartOptions[i] != L' ')
   24.11        {
   24.12 @@ -240,15 +240,14 @@ get_hypercall_stubs(WDFDEVICE Device)
   24.13    //KdPrint((__DRIVER_NAME " Hypercall area is %u pages.\n", pages));
   24.14  
   24.15    xpdd->hypercall_stubs = ExAllocatePoolWithTag(NonPagedPool, pages * PAGE_SIZE, XENPCI_POOL_TAG);
   24.16 -  //KdPrint((__DRIVER_NAME " Hypercall area at %08x\n", hypercall_stubs));
   24.17 +  KdPrint((__DRIVER_NAME " Hypercall area at %p\n", xpdd->hypercall_stubs));
   24.18  
   24.19    if (!xpdd->hypercall_stubs)
   24.20      return 1;
   24.21    for (i = 0; i < pages; i++) {
   24.22      ULONGLONG pfn;
   24.23 -    //pfn = vmalloc_to_pfn((char *)hypercall_stubs + i * PAGE_SIZE);
   24.24      pfn = (MmGetPhysicalAddress(xpdd->hypercall_stubs + i * PAGE_SIZE).QuadPart >> PAGE_SHIFT);
   24.25 -    KdPrint((__DRIVER_NAME " pfn = %10lX\n", pfn));
   24.26 +    KdPrint((__DRIVER_NAME " pfn = %16lX\n", pfn));
   24.27      __writemsr(msr, (pfn << PAGE_SHIFT) + i);
   24.28    }
   24.29    return STATUS_SUCCESS;
   24.30 @@ -294,18 +293,18 @@ init_xen_info(WDFDEVICE Device)
   24.31    PHYSICAL_ADDRESS shared_info_area_unmapped;
   24.32  
   24.33    shared_info_area_unmapped = XenPCI_AllocMMIO(Device, PAGE_SIZE);
   24.34 +  KdPrint((__DRIVER_NAME " shared_info_area_unmapped.QuadPart = %lx\n", shared_info_area_unmapped.QuadPart));
   24.35    xatp.domid = DOMID_SELF;
   24.36    xatp.idx = 0;
   24.37    xatp.space = XENMAPSPACE_shared_info;
   24.38    xatp.gpfn = (xen_pfn_t)(shared_info_area_unmapped.QuadPart >> PAGE_SHIFT);
   24.39 +  KdPrint((__DRIVER_NAME " gpfn = %d\n", xatp.gpfn));
   24.40    ret = HYPERVISOR_memory_op(Device, XENMEM_add_to_physmap, &xatp);
   24.41    KdPrint((__DRIVER_NAME " hypervisor memory op ret = %d\n", ret));
   24.42 -
   24.43    xpdd->shared_info_area = MmMapIoSpace(shared_info_area_unmapped,
   24.44 -    PAGE_SIZE, MmNonCached);
   24.45 -
   24.46 +    PAGE_SIZE, MmCached);
   24.47    return 0;
   24.48 -}
   24.49 +} 
   24.50  
   24.51  static int
   24.52  set_callback_irq(WDFDEVICE Device, ULONGLONG irq)
   24.53 @@ -514,7 +513,7 @@ XenPCI_PrepareHardware(
   24.54        break;
   24.55      case CmResourceTypeMemory:
   24.56        KdPrint((__DRIVER_NAME "     Memory mapped CSR:(%x:%x) Length:(%d)\n", descriptor->u.Memory.Start.LowPart, descriptor->u.Memory.Start.HighPart, descriptor->u.Memory.Length));
   24.57 -      xpdd->platform_mmio_addr = descriptor->u.Memory.Start; //(ULONG)MmMapIoSpace(descriptor->u.Memory.Start, descriptor->u.Memory.Length, MmNonCached);
   24.58 +      xpdd->platform_mmio_addr = descriptor->u.Memory.Start;
   24.59        xpdd->platform_mmio_len = descriptor->u.Memory.Length;
   24.60        xpdd->platform_mmio_alloc = 0;
   24.61        break;
   24.62 @@ -534,7 +533,8 @@ XenPCI_PrepareHardware(
   24.63  
   24.64    get_hypercall_stubs(Device);
   24.65  
   24.66 -  init_xen_info(Device);
   24.67 +  if (init_xen_info(Device))
   24.68 +    return STATUS_ACCESS_DENIED;
   24.69  
   24.70    GntTbl_Init(Device);
   24.71  
   24.72 @@ -684,8 +684,8 @@ static VOID
   24.73  XenPCI_IoRead(WDFQUEUE Queue, WDFREQUEST Request, size_t Length)
   24.74  {
   24.75    PSHUTDOWN_MSG_ENTRY Entry;
   24.76 -  ULONG Remaining;
   24.77 -  ULONG CopyLen;
   24.78 +  size_t Remaining;
   24.79 +  size_t CopyLen;
   24.80    PCHAR Buffer;
   24.81    size_t BufLen;
   24.82    KIRQL OldIrql;
   24.83 @@ -721,7 +721,7 @@ XenPCI_IoRead(WDFQUEUE Queue, WDFREQUEST
   24.84    else
   24.85    {    
   24.86      KdPrint((__DRIVER_NAME "     More to do...\n"));
   24.87 -    Entry->Ptr += CopyLen;
   24.88 +    Entry->Ptr += (ULONG)CopyLen;
   24.89      InsertHeadList(&ShutdownMsgList, &Entry->ListEntry);
   24.90    }
   24.91  
    25.1 --- a/xenpci/xenpci.h	Wed Jan 23 11:58:03 2008 -0800
    25.2 +++ b/xenpci/xenpci.h	Wed Jan 23 11:58:26 2008 -0800
    25.3 @@ -66,8 +66,6 @@ typedef struct _ev_action_t {
    25.4  
    25.5  typedef struct {
    25.6    ev_action_t *Action;
    25.7 -//  shared_info_t *shared_info_area;
    25.8 -//  ULONG port;
    25.9  } EVTCHN_DEVICE_DATA, *PEVTCHN_DEVICE_DATA;
   25.10  WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(EVTCHN_DEVICE_DATA, GetEvtChnDeviceData);
   25.11  
   25.12 @@ -218,7 +216,7 @@ EvtChn_GetXenStoreRingAddr(WDFDEVICE Dev
   25.13  VOID
   25.14  GntTbl_Init(WDFDEVICE Device);
   25.15  grant_ref_t
   25.16 -GntTbl_GrantAccess(WDFDEVICE Device, domid_t domid, unsigned long frame, int readonly);
   25.17 +GntTbl_GrantAccess(WDFDEVICE Device, domid_t domid, uint32_t, int readonly);
   25.18  BOOLEAN
   25.19  GntTbl_EndAccess(WDFDEVICE Device, grant_ref_t ref);
   25.20