win-pvdrivers

changeset 153:f9e747698949

Masked cpu with (MAX_VIRT_CPUS - 1). xenpci now loads and enumerates children. Graceful shutdown now works.
author James Harper <james.harper@bendigoit.com.au>
date Thu Jan 24 10:25:18 2008 +1100 (2008-01-24)
parents 2efec00dd95f
children f799098694b5
files xenpci/evtchn.c xenpci/sources xenpci/xenbus.c
line diff
     1.1 --- a/xenpci/evtchn.c	Wed Jan 23 23:07:47 2008 +1100
     1.2 +++ b/xenpci/evtchn.c	Thu Jan 24 10:25:18 2008 +1100
     1.3 @@ -43,7 +43,7 @@ EvtChn_DpcBounce(WDFDPC Dpc)
     1.4  BOOLEAN
     1.5  EvtChn_Interrupt(WDFINTERRUPT Interrupt, ULONG MessageID)
     1.6  {
     1.7 -  int cpu = KeGetCurrentProcessorNumber();
     1.8 +  int cpu = KeGetCurrentProcessorNumber() & (MAX_VIRT_CPUS - 1);
     1.9    vcpu_info_t *vcpu_info;
    1.10    PXENPCI_DEVICE_DATA xpdd = GetDeviceData(WdfInterruptGetDevice(Interrupt));
    1.11    shared_info_t *shared_info_area = xpdd->shared_info_area;
     2.1 --- a/xenpci/sources	Wed Jan 23 23:07:47 2008 +1100
     2.2 +++ b/xenpci/sources	Thu Jan 24 10:25:18 2008 +1100
     2.3 @@ -1,7 +1,7 @@
     2.4  TARGETNAME=XENPCI
     2.5  TARGETTYPE=DRIVER
     2.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     2.7 -VERSION=0.6.0.15
     2.8 +VERSION=0.6.0.16
     2.9  KMDF_VERSION=1
    2.10  MSC_WARNING_LEVEL=/W4
    2.11  INF_NAME=xenpci
     3.1 --- a/xenpci/xenbus.c	Wed Jan 23 23:07:47 2008 +1100
     3.2 +++ b/xenpci/xenbus.c	Thu Jan 24 10:25:18 2008 +1100
     3.3 @@ -319,8 +319,6 @@ XenBus_Init(WDFDEVICE Device)
     3.4    KeInitializeEvent(&xpdd->XenBus_WatchThreadEvent, SynchronizationEvent, FALSE);
     3.5    xpdd->XenBus_ShuttingDown = FALSE;
     3.6  
     3.7 -  //InitializeObjectAttributes(&oa, NULL, OBJ_KERNEL_HANDLE, NULL, NULL);
     3.8 -  //Status = PsCreateSystemThread(&XenBus_ReadThreadHandle, THREAD_ALL_ACCESS, &oa, NULL, NULL, XenBus_ReadThreadProc, NULL);
     3.9    Status = PsCreateSystemThread(&xpdd->XenBus_ReadThreadHandle, THREAD_ALL_ACCESS, NULL, NULL, NULL, XenBus_ReadThreadProc, Device);
    3.10    if (!NT_SUCCESS(Status))
    3.11    {
    3.12 @@ -328,8 +326,6 @@ XenBus_Init(WDFDEVICE Device)
    3.13      return STATUS_UNSUCCESSFUL;
    3.14    }
    3.15  
    3.16 -  //InitializeObjectAttributes(&oa, NULL, OBJ_KERNEL_HANDLE, NULL, NULL);
    3.17 -  //Status = PsCreateSystemThread(&XenBus_WatchThreadHandle, THREAD_ALL_ACCESS, &oa, NULL, NULL, XenBus_WatchThreadProc, NULL);
    3.18    Status = PsCreateSystemThread(&xpdd->XenBus_WatchThreadHandle, THREAD_ALL_ACCESS, NULL, NULL, NULL, XenBus_WatchThreadProc, Device);
    3.19    if (!NT_SUCCESS(Status))
    3.20    {
    3.21 @@ -594,7 +590,7 @@ XenBus_AddWatch(
    3.22    PXENBUS_WATCH_ENTRY w_entry;
    3.23    KIRQL OldIrql;
    3.24  
    3.25 -//  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    3.26 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    3.27  
    3.28    ASSERT(strlen(Path) < ARRAY_SIZE(w_entry->Path));
    3.29  
    3.30 @@ -640,7 +636,7 @@ XenBus_AddWatch(
    3.31      return msg;
    3.32    }
    3.33  
    3.34 -//  KdPrint((__DRIVER_NAME " <-- XenBus_AddWatch\n"));
    3.35 +  KdPrint((__DRIVER_NAME " <-- XenBus_AddWatch\n"));
    3.36  
    3.37    return NULL;
    3.38  }