win-pvdrivers

changeset 634:743b1f6470d8

fix config page overflow after multiple hibernations
author James Harper <james.harper@bendigoit.com.au>
date Wed Aug 19 16:50:33 2009 +1000 (2009-08-19)
parents 9269b3e0d776
children ca22d5c09eed
files xenpci/xenpci_pdo.c
line diff
     1.1 --- a/xenpci/xenpci_pdo.c	Wed Aug 19 16:49:33 2009 +1000
     1.2 +++ b/xenpci/xenpci_pdo.c	Wed Aug 19 16:50:33 2009 +1000
     1.3 @@ -2100,7 +2100,7 @@ XenPciPdo_EvtDeviceWdmIrpPreprocess_STAR
     1.4          xppdd->config_page_phys = prd->u.Memory.Start;
     1.5          xppdd->config_page_length = prd->u.Memory.Length;
     1.6          xppdd->requested_resources_start = xppdd->requested_resources_ptr = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, XENPCI_POOL_TAG);
     1.7 -        xppdd->assigned_resources_start = xppdd->assigned_resources_ptr = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, XENPCI_POOL_TAG);
     1.8 +        //xppdd->assigned_resources_start = xppdd->assigned_resources_ptr = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, XENPCI_POOL_TAG);
     1.9          
    1.10  #if 0
    1.11          status = XenPci_XenConfigDevice(device);
    1.12 @@ -2218,7 +2218,7 @@ XenPciPdo_EvtDeviceD0Entry(WDFDEVICE dev
    1.13      KdPrint((__DRIVER_NAME "     Unknown WdfPowerDevice state %d\n", previous_state));
    1.14      break;  
    1.15    }
    1.16 -  
    1.17 +
    1.18    if (previous_state == WdfPowerDevicePrepareForHibernation
    1.19        || (previous_state == WdfPowerDeviceD3 && xppdd->hiber_usage_kludge))
    1.20    {
    1.21 @@ -2228,6 +2228,12 @@ XenPciPdo_EvtDeviceD0Entry(WDFDEVICE dev
    1.22    {
    1.23    }
    1.24  
    1.25 +  if (previous_state == WdfPowerDevicePrepareForHibernation || previous_state == WdfPowerDeviceD3 || previous_state == WdfPowerDeviceD3Final)
    1.26 +  {
    1.27 +    xppdd->requested_resources_ptr = xppdd->requested_resources_start;
    1.28 +    xppdd->assigned_resources_start = xppdd->assigned_resources_ptr = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, XENPCI_POOL_TAG);
    1.29 +  }
    1.30 +
    1.31    XenConfig_InitConfigPage(device);
    1.32  
    1.33    status = XenPci_GetBackendAndAddWatch(device);