win-pvdrivers

changeset 16:53fdfc9f5d56

rename deviceData variables to xpdd (aka xen pci device data)
author Andy Grover <andy@groveronline.com>
date Thu Nov 29 10:59:16 2007 -0800 (2007-11-29)
parents 7f0f866dced6
children ce8bd97c4136
files xenpci/evtchn.c xenpci/gnttbl.c xenpci/xenpci.c
line diff
     1.1 --- a/xenpci/evtchn.c	Wed Nov 28 16:49:26 2007 -0800
     1.2 +++ b/xenpci/evtchn.c	Thu Nov 29 10:59:16 2007 -0800
     1.3 @@ -29,8 +29,8 @@ EvtChn_Interrupt(WDFINTERRUPT Interrupt,
     1.4    unsigned long evt_bit;
     1.5    unsigned long port;
     1.6    ev_action_t *ev_action;
     1.7 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(WdfInterruptGetDevice(Interrupt));
     1.8 -  shared_info_t *shared_info_area = deviceData->shared_info_area;
     1.9 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(WdfInterruptGetDevice(Interrupt));
    1.10 +  shared_info_t *shared_info_area = xpdd->shared_info_area;
    1.11  
    1.12    UNREFERENCED_PARAMETER(Interrupt);
    1.13    UNREFERENCED_PARAMETER(MessageID);
    1.14 @@ -50,7 +50,7 @@ EvtChn_Interrupt(WDFINTERRUPT Interrupt,
    1.15      while (_BitScanForward(&evt_bit, shared_info_area->evtchn_pending[evt_word] & ~shared_info_area->evtchn_mask[evt_word]))
    1.16      {
    1.17        port = (evt_word << 5) + evt_bit;
    1.18 -      ev_action = &deviceData->ev_actions[port];
    1.19 +      ev_action = &xpdd->ev_actions[port];
    1.20        if (ev_action->ServiceRoutine == NULL)
    1.21        {
    1.22          KdPrint((__DRIVER_NAME "     Unhandled Event!!!\n"));
    1.23 @@ -75,18 +75,18 @@ NTSTATUS
    1.24  EvtChn_Bind(PVOID Context, evtchn_port_t Port, PKSERVICE_ROUTINE ServiceRoutine, PVOID ServiceContext)
    1.25  {
    1.26    WDFDEVICE Device = Context;
    1.27 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
    1.28 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
    1.29  
    1.30    KdPrint((__DRIVER_NAME " --> EvtChn_Bind\n"));
    1.31  
    1.32 -  if(deviceData->ev_actions[Port].ServiceRoutine != NULL)
    1.33 +  if(xpdd->ev_actions[Port].ServiceRoutine != NULL)
    1.34    {
    1.35      KdPrint((__DRIVER_NAME " Handler for port %d already registered, replacing\n", Port));
    1.36    }
    1.37  
    1.38 -  deviceData->ev_actions[Port].ServiceContext = ServiceContext;
    1.39 +  xpdd->ev_actions[Port].ServiceContext = ServiceContext;
    1.40    KeMemoryBarrier();
    1.41 -  deviceData->ev_actions[Port].ServiceRoutine = ServiceRoutine;
    1.42 +  xpdd->ev_actions[Port].ServiceRoutine = ServiceRoutine;
    1.43  
    1.44    EvtChn_Unmask(Device, Port);
    1.45  
    1.46 @@ -99,11 +99,11 @@ NTSTATUS
    1.47  EvtChn_Unbind(PVOID Context, evtchn_port_t Port)
    1.48  {
    1.49    WDFDEVICE Device = Context;
    1.50 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
    1.51 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
    1.52  
    1.53    EvtChn_Mask(Context, Port);
    1.54 -  deviceData->ev_actions[Port].ServiceContext = NULL;
    1.55 -  deviceData->ev_actions[Port].ServiceRoutine = NULL;
    1.56 +  xpdd->ev_actions[Port].ServiceContext = NULL;
    1.57 +  xpdd->ev_actions[Port].ServiceRoutine = NULL;
    1.58  
    1.59    //KdPrint((__DRIVER_NAME " <-- EvtChn_UnBind\n"));
    1.60  
    1.61 @@ -114,11 +114,11 @@ NTSTATUS
    1.62  EvtChn_Mask(PVOID Context, evtchn_port_t Port)
    1.63  {
    1.64    WDFDEVICE Device = Context;
    1.65 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
    1.66 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
    1.67    //KdPrint((__DRIVER_NAME " --> EvtChn_Mask\n"));
    1.68  
    1.69    _interlockedbittestandset(
    1.70 -    (volatile LONG *)&deviceData->shared_info_area->evtchn_mask[0], Port);
    1.71 +    (volatile LONG *)&xpdd->shared_info_area->evtchn_mask[0], Port);
    1.72  
    1.73    //KdPrint((__DRIVER_NAME " <-- EvtChn_Mask\n"));
    1.74  
    1.75 @@ -129,11 +129,11 @@ NTSTATUS
    1.76  EvtChn_Unmask(PVOID Context, evtchn_port_t Port)
    1.77  {
    1.78    WDFDEVICE Device = Context;
    1.79 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
    1.80 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
    1.81    //KdPrint((__DRIVER_NAME " --> EvtChn_Unmask\n"));
    1.82  
    1.83    _interlockedbittestandreset(
    1.84 -    (volatile LONG *)&deviceData->shared_info_area->evtchn_mask[0], Port);
    1.85 +    (volatile LONG *)&xpdd->shared_info_area->evtchn_mask[0], Port);
    1.86    // should we kick off pending interrupts here too???
    1.87  
    1.88    //KdPrint((__DRIVER_NAME " <-- EvtChn_Unmask\n"));
    1.89 @@ -218,23 +218,23 @@ EvtChn_GetXenStoreRingAddr(WDFDEVICE Dev
    1.90  NTSTATUS
    1.91  EvtChn_Init(WDFDEVICE Device)
    1.92  {
    1.93 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
    1.94 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
    1.95    int i;
    1.96  
    1.97    for (i = 0; i < NR_EVENTS; i++)
    1.98    {
    1.99      EvtChn_Mask(Device, i);
   1.100 -    deviceData->ev_actions[i].ServiceRoutine = NULL;
   1.101 -    deviceData->ev_actions[i].ServiceContext = NULL;
   1.102 -    deviceData->ev_actions[i].Count = 0;
   1.103 +    xpdd->ev_actions[i].ServiceRoutine = NULL;
   1.104 +    xpdd->ev_actions[i].ServiceContext = NULL;
   1.105 +    xpdd->ev_actions[i].Count = 0;
   1.106    }
   1.107  
   1.108    for (i = 0; i < 8; i++)
   1.109    {
   1.110 -    deviceData->shared_info_area->evtchn_pending[i] = 0;
   1.111 +    xpdd->shared_info_area->evtchn_pending[i] = 0;
   1.112    }
   1.113 -  deviceData->shared_info_area->vcpu_info[0].evtchn_upcall_pending = 0;
   1.114 -  deviceData->shared_info_area->vcpu_info[0].evtchn_pending_sel = 0;
   1.115 +  xpdd->shared_info_area->vcpu_info[0].evtchn_upcall_pending = 0;
   1.116 +  xpdd->shared_info_area->vcpu_info[0].evtchn_pending_sel = 0;
   1.117  
   1.118    return STATUS_SUCCESS;
   1.119  }
     2.1 --- a/xenpci/gnttbl.c	Wed Nov 28 16:49:26 2007 -0800
     2.2 +++ b/xenpci/gnttbl.c	Thu Nov 29 10:59:16 2007 -0800
     2.3 @@ -23,19 +23,19 @@ Foundation, Inc., 51 Franklin Street, Fi
     2.4  static void
     2.5  put_free_entry(WDFDEVICE Device, grant_ref_t ref)
     2.6  {
     2.7 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
     2.8 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
     2.9  
    2.10 -  deviceData->gnttab_list[ref] = deviceData->gnttab_list[0];
    2.11 -  deviceData->gnttab_list[0]  = ref;
    2.12 +  xpdd->gnttab_list[ref] = xpdd->gnttab_list[0];
    2.13 +  xpdd->gnttab_list[0]  = ref;
    2.14  }
    2.15  
    2.16  static grant_ref_t
    2.17  get_free_entry(WDFDEVICE Device)
    2.18  {
    2.19 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
    2.20 -  unsigned int ref = deviceData->gnttab_list[0];
    2.21 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
    2.22 +  unsigned int ref = xpdd->gnttab_list[0];
    2.23  
    2.24 -  deviceData->gnttab_list[0] = deviceData->gnttab_list[ref];
    2.25 +  xpdd->gnttab_list[0] = xpdd->gnttab_list[ref];
    2.26    return ref;
    2.27  }
    2.28  
    2.29 @@ -51,7 +51,7 @@ typedef struct grant_entry grant_entry_t
    2.30  static int 
    2.31  GntTab_Map(WDFDEVICE Device, unsigned int start_idx, unsigned int end_idx)
    2.32  {
    2.33 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
    2.34 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
    2.35    struct xen_add_to_physmap xatp;
    2.36    unsigned int i = end_idx;
    2.37  
    2.38 @@ -63,7 +63,7 @@ GntTab_Map(WDFDEVICE Device, unsigned in
    2.39      xatp.domid = DOMID_SELF;
    2.40      xatp.idx = i;
    2.41      xatp.space = XENMAPSPACE_grant_table;
    2.42 -    xatp.gpfn = (xen_pfn_t)(deviceData->gnttab_table_physical.QuadPart >> PAGE_SHIFT) + i;
    2.43 +    xatp.gpfn = (xen_pfn_t)(xpdd->gnttab_table_physical.QuadPart >> PAGE_SHIFT) + i;
    2.44      if (HYPERVISOR_memory_op(Device, XENMEM_add_to_physmap, &xatp))
    2.45      {
    2.46        KdPrint((__DRIVER_NAME "     ***ERROR MAPPING FRAME***\n"));
    2.47 @@ -76,7 +76,7 @@ GntTab_Map(WDFDEVICE Device, unsigned in
    2.48  VOID
    2.49  GntTbl_Init(WDFDEVICE Device)
    2.50  {
    2.51 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
    2.52 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
    2.53    int i;
    2.54  
    2.55    //KdPrint((__DRIVER_NAME " --> GntTbl_Init\n"));
    2.56 @@ -84,11 +84,11 @@ GntTbl_Init(WDFDEVICE Device)
    2.57    for (i = NR_RESERVED_ENTRIES; i < NR_GRANT_ENTRIES; i++)
    2.58      put_free_entry(Device, i);
    2.59  
    2.60 -  deviceData->gnttab_table_physical = XenPCI_AllocMMIO(Device,
    2.61 +  xpdd->gnttab_table_physical = XenPCI_AllocMMIO(Device,
    2.62      PAGE_SIZE * NR_GRANT_FRAMES);
    2.63 -  deviceData->gnttab_table = MmMapIoSpace(deviceData->gnttab_table_physical,
    2.64 +  xpdd->gnttab_table = MmMapIoSpace(xpdd->gnttab_table_physical,
    2.65      PAGE_SIZE * NR_GRANT_FRAMES, MmNonCached);
    2.66 -  if (!deviceData->gnttab_table)
    2.67 +  if (!xpdd->gnttab_table)
    2.68    {
    2.69      KdPrint((__DRIVER_NAME "     Error Mapping Grant Table Shared Memory\n"));
    2.70      return;
    2.71 @@ -105,19 +105,19 @@ GntTbl_GrantAccess(
    2.72    unsigned long frame,
    2.73    int readonly)
    2.74  {
    2.75 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
    2.76 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
    2.77    grant_ref_t ref;
    2.78  
    2.79    //KdPrint((__DRIVER_NAME " --> GntTbl_GrantAccess\n"));
    2.80  
    2.81    /* TODO: locking? */
    2.82    ref = get_free_entry(Device);
    2.83 -  deviceData->gnttab_table[ref].frame = frame;
    2.84 -  deviceData->gnttab_table[ref].domid = domid;
    2.85 +  xpdd->gnttab_table[ref].frame = frame;
    2.86 +  xpdd->gnttab_table[ref].domid = domid;
    2.87    //_WriteBarrier();
    2.88    KeMemoryBarrier();
    2.89    readonly *= GTF_readonly;
    2.90 -  deviceData->gnttab_table[ref].flags = GTF_permit_access | (uint16_t)readonly;
    2.91 +  xpdd->gnttab_table[ref].flags = GTF_permit_access | (uint16_t)readonly;
    2.92  
    2.93    //KdPrint((__DRIVER_NAME " <-- GntTbl_GrantAccess (ref = %d)\n", ref));
    2.94  
    2.95 @@ -129,12 +129,12 @@ GntTbl_EndAccess(
    2.96    WDFDEVICE Device,
    2.97    grant_ref_t ref)
    2.98  {
    2.99 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
   2.100 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
   2.101    unsigned short flags, nflags;
   2.102  
   2.103    //KdPrint((__DRIVER_NAME " --> GntTbl_EndAccess\n"));
   2.104  
   2.105 -  nflags = deviceData->gnttab_table[ref].flags;
   2.106 +  nflags = xpdd->gnttab_table[ref].flags;
   2.107    do {
   2.108      if ((flags = nflags) & (GTF_reading|GTF_writing))
   2.109      {
   2.110 @@ -142,7 +142,7 @@ GntTbl_EndAccess(
   2.111        return FALSE;
   2.112      }
   2.113    } while ((nflags = InterlockedCompareExchange16(
   2.114 -    (volatile SHORT *)&deviceData->gnttab_table[ref].flags, flags, 0)) != flags);
   2.115 +    (volatile SHORT *)&xpdd->gnttab_table[ref].flags, flags, 0)) != flags);
   2.116  
   2.117    put_free_entry(Device, ref);
   2.118    //KdPrint((__DRIVER_NAME " <-- GntTbl_EndAccess\n"));
     3.1 --- a/xenpci/xenpci.c	Wed Nov 28 16:49:26 2007 -0800
     3.2 +++ b/xenpci/xenpci.c	Thu Nov 29 10:59:16 2007 -0800
     3.3 @@ -188,7 +188,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
     3.4  static NTSTATUS
     3.5  get_hypercall_stubs(WDFDEVICE Device)
     3.6  {
     3.7 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
     3.8 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
     3.9    DWORD32 cpuid_output[4];
    3.10    char xensig[13];
    3.11    ULONG i;
    3.12 @@ -207,15 +207,15 @@ get_hypercall_stubs(WDFDEVICE Device)
    3.13    msr = cpuid_output[1];
    3.14    //KdPrint((__DRIVER_NAME " Hypercall area is %u pages.\n", pages));
    3.15  
    3.16 -  deviceData->hypercall_stubs = ExAllocatePoolWithTag(NonPagedPool, pages * PAGE_SIZE, XENPCI_POOL_TAG);
    3.17 +  xpdd->hypercall_stubs = ExAllocatePoolWithTag(NonPagedPool, pages * PAGE_SIZE, XENPCI_POOL_TAG);
    3.18    //KdPrint((__DRIVER_NAME " Hypercall area at %08x\n", hypercall_stubs));
    3.19  
    3.20 -  if (!deviceData->hypercall_stubs)
    3.21 +  if (!xpdd->hypercall_stubs)
    3.22      return 1;
    3.23    for (i = 0; i < pages; i++) {
    3.24      ULONG pfn;
    3.25      //pfn = vmalloc_to_pfn((char *)hypercall_stubs + i * PAGE_SIZE);
    3.26 -    pfn = (ULONG)(MmGetPhysicalAddress(deviceData->hypercall_stubs + i * PAGE_SIZE).QuadPart >> PAGE_SHIFT);
    3.27 +    pfn = (ULONG)(MmGetPhysicalAddress(xpdd->hypercall_stubs + i * PAGE_SIZE).QuadPart >> PAGE_SHIFT);
    3.28      //KdPrint((__DRIVER_NAME " pfn = %08X\n", pfn));
    3.29      __writemsr(msr, ((ULONGLONG)pfn << PAGE_SHIFT) + i);
    3.30    }
    3.31 @@ -225,13 +225,13 @@ get_hypercall_stubs(WDFDEVICE Device)
    3.32  PHYSICAL_ADDRESS
    3.33  XenPCI_AllocMMIO(WDFDEVICE Device, ULONG len)
    3.34  {
    3.35 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
    3.36 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
    3.37  
    3.38    PHYSICAL_ADDRESS addr;
    3.39  
    3.40 -  addr = deviceData->platform_mmio_addr;
    3.41 -  addr.QuadPart += deviceData->platform_mmio_alloc;
    3.42 -  deviceData->platform_mmio_alloc += len;
    3.43 +  addr = xpdd->platform_mmio_addr;
    3.44 +  addr.QuadPart += xpdd->platform_mmio_alloc;
    3.45 +  xpdd->platform_mmio_alloc += len;
    3.46  
    3.47    return addr;
    3.48  }
    3.49 @@ -239,7 +239,7 @@ XenPCI_AllocMMIO(WDFDEVICE Device, ULONG
    3.50  static int
    3.51  init_xen_info(WDFDEVICE Device)
    3.52  {
    3.53 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
    3.54 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
    3.55    struct xen_add_to_physmap xatp;
    3.56    int ret;
    3.57    PHYSICAL_ADDRESS shared_info_area_unmapped;
    3.58 @@ -255,7 +255,7 @@ init_xen_info(WDFDEVICE Device)
    3.59    ret = HYPERVISOR_memory_op(Device, XENMEM_add_to_physmap, &xatp);
    3.60    //KdPrint((__DRIVER_NAME " ret = %d\n", ret));
    3.61  
    3.62 -  deviceData->shared_info_area = MmMapIoSpace(shared_info_area_unmapped,
    3.63 +  xpdd->shared_info_area = MmMapIoSpace(shared_info_area_unmapped,
    3.64      PAGE_SIZE, MmNonCached);
    3.65  
    3.66    return 0;
    3.67 @@ -291,7 +291,7 @@ XenPCI_AddDevice(
    3.68    PNP_BUS_INFORMATION busInfo;
    3.69    BUS_INTERFACE_STANDARD BusInterface;
    3.70    WDFDEVICE Device;
    3.71 -  PXENPCI_DEVICE_DATA deviceData;
    3.72 +  PXENPCI_DEVICE_DATA xpdd;
    3.73  
    3.74    UNREFERENCED_PARAMETER(Driver);
    3.75  
    3.76 @@ -334,8 +334,8 @@ XenPCI_AddDevice(
    3.77      KdPrint((__DRIVER_NAME " WdfDeviceCreate failed with status 0x%08x\n", status));
    3.78      return status;
    3.79    }
    3.80 -  deviceData = GetDeviceData(Device);
    3.81 -  deviceData->Device = Device;
    3.82 +  xpdd = GetDeviceData(Device);
    3.83 +  xpdd->Device = Device;
    3.84  
    3.85    WdfDeviceSetSpecialFileSupport(Device, WdfSpecialFilePaging, TRUE);
    3.86    WdfDeviceSetSpecialFileSupport(Device, WdfSpecialFileHibernation, TRUE);
    3.87 @@ -356,7 +356,7 @@ XenPCI_AddDevice(
    3.88    WDF_INTERRUPT_CONFIG_INIT(&interruptConfig, EvtChn_Interrupt, NULL);
    3.89    interruptConfig.EvtInterruptEnable = XenPCI_InterruptEnable;
    3.90    interruptConfig.EvtInterruptDisable = XenPCI_InterruptDisable;
    3.91 -  status = WdfInterruptCreate(Device, &interruptConfig, WDF_NO_OBJECT_ATTRIBUTES, &deviceData->XenInterrupt);
    3.92 +  status = WdfInterruptCreate(Device, &interruptConfig, WDF_NO_OBJECT_ATTRIBUTES, &xpdd->XenInterrupt);
    3.93    if (!NT_SUCCESS (status))
    3.94    {
    3.95      KdPrint((__DRIVER_NAME "WdfInterruptCreate failed 0x%08x\n", status));
    3.96 @@ -376,12 +376,10 @@ XenPCI_PrepareHardware(
    3.97    NTSTATUS status = STATUS_SUCCESS;
    3.98    PCM_PARTIAL_RESOURCE_DESCRIPTOR descriptor;
    3.99    ULONG i;
   3.100 -  PXENPCI_DEVICE_DATA deviceData;
   3.101 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
   3.102  
   3.103    KdPrint((__DRIVER_NAME " --> EvtDevicePrepareHardware\n"));
   3.104  
   3.105 -  deviceData = GetDeviceData(Device);
   3.106 -
   3.107    for (i = 0; i < WdfCmResourceListGetCount(ResourceList); i++)
   3.108    {
   3.109      descriptor = WdfCmResourceListGetDescriptor(ResourceList, i);
   3.110 @@ -390,7 +388,7 @@ XenPCI_PrepareHardware(
   3.111      switch (descriptor->Type)
   3.112      {
   3.113      case CmResourceTypeInterrupt:
   3.114 -      deviceData->irqNumber = descriptor->u.Interrupt.Vector;
   3.115 +      xpdd->irqNumber = descriptor->u.Interrupt.Vector;
   3.116        break;
   3.117      }
   3.118    }
   3.119 @@ -409,14 +407,14 @@ XenPCI_PrepareHardware(
   3.120      switch (descriptor->Type) {
   3.121      case CmResourceTypePort:
   3.122        //KdPrint((__DRIVER_NAME "     I/O mapped CSR: (%x) Length: (%d)\n", descriptor->u.Port.Start.LowPart, descriptor->u.Port.Length));
   3.123 -//      deviceData->IoBaseAddress = ULongToPtr(descriptor->u.Port.Start.LowPart);
   3.124 -//      deviceData->IoRange = descriptor->u.Port.Length;
   3.125 +//      xpdd->IoBaseAddress = ULongToPtr(descriptor->u.Port.Start.LowPart);
   3.126 +//      xpdd->IoRange = descriptor->u.Port.Length;
   3.127        break;
   3.128      case CmResourceTypeMemory:
   3.129        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));
   3.130 -      deviceData->platform_mmio_addr = descriptor->u.Memory.Start; //(ULONG)MmMapIoSpace(descriptor->u.Memory.Start, descriptor->u.Memory.Length, MmNonCached);
   3.131 -      deviceData->platform_mmio_len = descriptor->u.Memory.Length;
   3.132 -      deviceData->platform_mmio_alloc = 0;
   3.133 +      xpdd->platform_mmio_addr = descriptor->u.Memory.Start; //(ULONG)MmMapIoSpace(descriptor->u.Memory.Start, descriptor->u.Memory.Length, MmNonCached);
   3.134 +      xpdd->platform_mmio_len = descriptor->u.Memory.Length;
   3.135 +      xpdd->platform_mmio_alloc = 0;
   3.136        break;
   3.137      case CmResourceTypeInterrupt:
   3.138        //KdPrint((__DRIVER_NAME "     Interrupt level: 0x%0x, Vector: 0x%0x\n", descriptor->u.Interrupt.Level, descriptor->u.Interrupt.Vector));
   3.139 @@ -438,13 +436,13 @@ XenPCI_PrepareHardware(
   3.140  
   3.141    EvtChn_Init(Device);
   3.142  
   3.143 -  set_callback_irq(Device, deviceData->irqNumber);
   3.144 +  set_callback_irq(Device, xpdd->irqNumber);
   3.145  
   3.146    XenBus_Init(Device);
   3.147  
   3.148    //KdPrint((__DRIVER_NAME " upcall_pending = %d\n", shared_info_area->vcpu_info[0].evtchn_upcall_pending));
   3.149  
   3.150 -  deviceData->shared_info_area->vcpu_info[0].evtchn_upcall_mask = 0;
   3.151 +  xpdd->shared_info_area->vcpu_info[0].evtchn_upcall_mask = 0;
   3.152  
   3.153    //xen_reboot_init();
   3.154  
   3.155 @@ -568,12 +566,12 @@ XenPCI_IoDefault(
   3.156  static NTSTATUS
   3.157  XenPCI_InterruptEnable(WDFINTERRUPT Interrupt, WDFDEVICE AssociatedDevice)
   3.158  {
   3.159 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(AssociatedDevice);
   3.160 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(AssociatedDevice);
   3.161    UNREFERENCED_PARAMETER(Interrupt);
   3.162  
   3.163    KdPrint((__DRIVER_NAME " --> EvtInterruptEnable\n"));
   3.164  
   3.165 -  deviceData->shared_info_area->vcpu_info[0].evtchn_upcall_mask = 0;
   3.166 +  xpdd->shared_info_area->vcpu_info[0].evtchn_upcall_mask = 0;
   3.167  
   3.168    KdPrint((__DRIVER_NAME " <-- EvtInterruptEnable\n"));
   3.169  
   3.170 @@ -583,12 +581,12 @@ XenPCI_InterruptEnable(WDFINTERRUPT Inte
   3.171  static NTSTATUS
   3.172  XenPCI_InterruptDisable(WDFINTERRUPT Interrupt, WDFDEVICE AssociatedDevice)
   3.173  {
   3.174 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(AssociatedDevice);
   3.175 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(AssociatedDevice);
   3.176    UNREFERENCED_PARAMETER(Interrupt);
   3.177  
   3.178    //KdPrint((__DRIVER_NAME " --> EvtInterruptDisable\n"));
   3.179  
   3.180 -  deviceData->shared_info_area->vcpu_info[0].evtchn_upcall_mask = 1;
   3.181 +  xpdd->shared_info_area->vcpu_info[0].evtchn_upcall_mask = 1;
   3.182    // should we kick off any pending interrupts here?
   3.183  
   3.184    //KdPrint((__DRIVER_NAME " <-- EvtInterruptDisable\n"));
   3.185 @@ -997,7 +995,7 @@ XenPCI_DeviceResourceRequirementsQuery(W
   3.186    NTSTATUS  status;
   3.187    WDFIORESLIST resourceList;
   3.188    IO_RESOURCE_DESCRIPTOR descriptor;
   3.189 -  PXENPCI_DEVICE_DATA deviceData = GetDeviceData(Device);
   3.190 +  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
   3.191  
   3.192    //KdPrint((__DRIVER_NAME " --> DeviceResourceRequirementsQuery\n"));
   3.193  
   3.194 @@ -1031,9 +1029,9 @@ XenPCI_DeviceResourceRequirementsQuery(W
   3.195    descriptor.u.Memory.Length = PAGE_SIZE;
   3.196    descriptor.u.Memory.Alignment = PAGE_SIZE;
   3.197    descriptor.u.Memory.MinimumAddress.QuadPart
   3.198 -    = deviceData->platform_mmio_addr.QuadPart + PAGE_SIZE;
   3.199 +    = xpdd->platform_mmio_addr.QuadPart + PAGE_SIZE;
   3.200    descriptor.u.Memory.MaximumAddress.QuadPart
   3.201 -    = deviceData->platform_mmio_addr.QuadPart + deviceData->platform_mmio_len - 1;
   3.202 +    = xpdd->platform_mmio_addr.QuadPart + xpdd->platform_mmio_len - 1;
   3.203  
   3.204    //KdPrint((__DRIVER_NAME "     MinimumAddress = %08x, MaximumAddress = %08X\n", descriptor.u.Memory.MinimumAddress.LowPart, descriptor.u.Memory.MaximumAddress.LowPart));
   3.205