win-pvdrivers

changeset 440:51fae6b70049

Fixed a few additional bug check related issues
author James Harper <james.harper@bendigoit.com.au>
date Wed Nov 05 16:00:05 2008 +1100 (2008-11-05)
parents 9971dbcc8c2b
children bead0798cd6b
files xenvbd/xenvbd.c
line diff
     1.1 --- a/xenvbd/xenvbd.c	Wed Nov 05 14:52:46 2008 +1100
     1.2 +++ b/xenvbd/xenvbd.c	Wed Nov 05 16:00:05 2008 +1100
     1.3 @@ -151,7 +151,7 @@ XenVbd_InitFromConfig(PXENVBD_DEVICE_DAT
     1.4        {
     1.5          xvdd->sring = (blkif_sring_t *)value;
     1.6          FRONT_RING_INIT(&xvdd->ring, xvdd->sring, PAGE_SIZE);
     1.7 -        /* this bit is for when we have to take over an existing ring on a bug check */
     1.8 +        /* this bit is for when we have to take over an existing ring on a crash dump */
     1.9          xvdd->ring.req_prod_pvt = xvdd->sring->req_prod;
    1.10          xvdd->ring.rsp_cons = xvdd->ring.req_prod_pvt;
    1.11        }
    1.12 @@ -803,8 +803,16 @@ XenVbd_HwScsiInterrupt(PVOID DeviceExten
    1.13      return FALSE;
    1.14    }
    1.15  
    1.16 -  if (!(stat_interrupts_for_me & 0xFFFF))
    1.17 +  if (dump_mode)
    1.18 +  {
    1.19 +    KdPrint((__DRIVER_NAME "     dump_mode interrupt\n"));
    1.20 +    KdPrint((__DRIVER_NAME "     req_prod_pvt = %d\n", xvdd->ring.req_prod_pvt));
    1.21 +    KdPrint((__DRIVER_NAME "     rsp_prod = %d\n", xvdd->ring.sring->rsp_prod));
    1.22 +    KdPrint((__DRIVER_NAME "     rsp_cons = %d\n", xvdd->ring.rsp_cons));
    1.23 +  }
    1.24 +  else if (!(stat_interrupts_for_me & 0xFFFF))
    1.25      XenVbd_DumpStats();
    1.26 +    
    1.27    while (more_to_do)
    1.28    {
    1.29      rp = xvdd->ring.sring->rsp_prod;
    1.30 @@ -1328,24 +1336,28 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
    1.31    KdPrint((__DRIVER_NAME " --> "__FUNCTION__ "\n"));
    1.32    KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
    1.33  
    1.34 -  conf_info = IoGetConfigurationInformation();
    1.35 -  if (conf_info == NULL)
    1.36 +  /* RegistryPath == NULL when we are invoked as a crash dump driver */
    1.37 +  if (!RegistryPath)
    1.38    {
    1.39 -    KdPrint((__DRIVER_NAME "     conf_info == NULL\n"));
    1.40 +    dump_mode = TRUE;
    1.41    }
    1.42    else
    1.43    {
    1.44 -    KdPrint((__DRIVER_NAME "     conf_info->DiskCount = %d\n", conf_info->DiskCount));
    1.45 +    conf_info = IoGetConfigurationInformation();
    1.46 +    if (conf_info == NULL)
    1.47 +    {
    1.48 +      KdPrint((__DRIVER_NAME "     conf_info == NULL\n"));
    1.49 +    }
    1.50 +    else
    1.51 +    {
    1.52 +      KdPrint((__DRIVER_NAME "     conf_info->DiskCount = %d\n", conf_info->DiskCount));
    1.53 +    }
    1.54 +    if (conf_info != NULL && conf_info->DiskCount && RegistryPath)
    1.55 +    {
    1.56 +      global_inactive = TRUE;
    1.57 +      KdPrint((__DRIVER_NAME "     Not loaded at boot time so setting inactive\n"));
    1.58 +    }
    1.59    }
    1.60 -  /* RegistryPath == NULL when we are invoked as a crash dump driver */
    1.61 -  if (!RegistryPath)
    1.62 -    dump_mode = TRUE;
    1.63 -  if (conf_info != NULL && conf_info->DiskCount && RegistryPath)
    1.64 -  {
    1.65 -    global_inactive = TRUE;
    1.66 -    KdPrint((__DRIVER_NAME "     Not loaded at boot time so setting inactive\n"));
    1.67 -  }
    1.68 -  
    1.69    RtlZeroMemory(&HwInitializationData, sizeof(HW_INITIALIZATION_DATA));
    1.70  
    1.71    HwInitializationData.HwInitializationDataSize = sizeof(HW_INITIALIZATION_DATA);