win-pvdrivers

changeset 394:099b6e3f3909

Changed a few memory allocations from PagedPool to NonPagedPool as they may get used in the restore path when xenvbd isn't connected
author James Harper <james.harper@bendigoit.com.au>
date Thu Jul 17 21:10:09 2008 +1000 (2008-07-17)
parents b8380915c051
children a8f674f67fd6 fdb7f8853695
files xenpci/xenpci.h xenpci/xenpci_pdo.c
line diff
     1.1 --- a/xenpci/xenpci.h	Tue Jul 15 20:37:30 2008 -0700
     1.2 +++ b/xenpci/xenpci.h	Thu Jul 17 21:10:09 2008 +1000
     1.3 @@ -161,7 +161,7 @@ static __inline void REVERT_PNP_STATE(PX
     1.4  #define SUSPEND_STATE_NONE      0 /* no suspend in progress */
     1.5  #define SUSPEND_STATE_SCHEDULED 1 /* suspend scheduled */
     1.6  #define SUSPEND_STATE_HIGH_IRQL 2 /* all processors are at high IRQL and spinning */
     1.7 -#define SUSPEND_STATE_RESUMING  3
     1.8 +#define SUSPEND_STATE_RESUMING  3 /* we are the other side of the suspend and things are starting to get back to normal */
     1.9  
    1.10  typedef struct {  
    1.11    XENPCI_COMMON common;
     2.1 --- a/xenpci/xenpci_pdo.c	Tue Jul 15 20:37:30 2008 -0700
     2.2 +++ b/xenpci/xenpci_pdo.c	Thu Jul 17 21:10:09 2008 +1000
     2.3 @@ -89,6 +89,10 @@ XenPci_Power_Pdo(PDEVICE_OBJECT device_o
     2.4    return status;
     2.5  }
     2.6  
     2.7 +/*
     2.8 +Called at PASSIVE_LEVEL(?)
     2.9 +Called during restore
    2.10 +*/
    2.11  static VOID
    2.12  XenPci_BackEndStateHandler(char *Path, PVOID Context)
    2.13  {
    2.14 @@ -196,6 +200,10 @@ struct dummy_sring {
    2.15      uint8_t  pad[48];
    2.16  };
    2.17  
    2.18 +/*
    2.19 +Called at PASSIVE_LEVEL
    2.20 +Called during restore
    2.21 +*/
    2.22  static NTSTATUS
    2.23  XenPci_ChangeFrontendState(PXENPCI_PDO_DEVICE_DATA xppdd, ULONG frontend_state_set, ULONG backend_state_response, ULONG maximum_wait_ms)
    2.24  {
    2.25 @@ -608,7 +616,7 @@ XenPci_XenConfigDevice(PVOID context)
    2.26    PUCHAR src, dst;
    2.27    PXENPCI_PDO_DEVICE_DATA xppdd = context;  
    2.28  
    2.29 -  src = ExAllocatePoolWithTag(PagedPool, xppdd->config_page_length, XENPCI_POOL_TAG);
    2.30 +  src = ExAllocatePoolWithTag(NonPagedPool, xppdd->config_page_length, XENPCI_POOL_TAG);
    2.31    dst = MmMapIoSpace(xppdd->config_page_phys, xppdd->config_page_length, MmNonCached);
    2.32    memcpy(src, dst, xppdd->config_page_length);
    2.33    
    2.34 @@ -692,7 +700,7 @@ XenPci_Resume(PDEVICE_OBJECT device_obje
    2.35        // reset things - feed the 'requested resources' back in
    2.36        ADD_XEN_INIT_REQ(&xppdd->requested_resources_ptr, XEN_INIT_TYPE_END, NULL, NULL);
    2.37        src = xppdd->requested_resources_start;
    2.38 -      xppdd->requested_resources_ptr = xppdd->requested_resources_start = ExAllocatePoolWithTag(PagedPool, PAGE_SIZE, XENPCI_POOL_TAG);;
    2.39 +      xppdd->requested_resources_ptr = xppdd->requested_resources_start = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, XENPCI_POOL_TAG);;
    2.40        xppdd->assigned_resources_ptr = xppdd->assigned_resources_start;
    2.41        
    2.42        dst = MmMapIoSpace(xppdd->config_page_phys, xppdd->config_page_length, MmNonCached);
    2.43 @@ -751,8 +759,8 @@ XenPci_Pnp_StartDevice(PDEVICE_OBJECT de
    2.44        KdPrint((__DRIVER_NAME "     Start = %08x, Length = %d\n", prd->u.Memory.Start.LowPart, prd->u.Memory.Length));
    2.45        xppdd->config_page_phys = prd->u.Memory.Start;
    2.46        xppdd->config_page_length = prd->u.Memory.Length;
    2.47 -      xppdd->requested_resources_start = xppdd->requested_resources_ptr = ExAllocatePoolWithTag(PagedPool, PAGE_SIZE, XENPCI_POOL_TAG);
    2.48 -      xppdd->assigned_resources_start = xppdd->assigned_resources_ptr = ExAllocatePoolWithTag(PagedPool, PAGE_SIZE, XENPCI_POOL_TAG);
    2.49 +      xppdd->requested_resources_start = xppdd->requested_resources_ptr = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, XENPCI_POOL_TAG);
    2.50 +      xppdd->assigned_resources_start = xppdd->assigned_resources_ptr = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, XENPCI_POOL_TAG);
    2.51        
    2.52        status = XenPci_XenConfigDevice(xppdd);
    2.53  
    2.54 @@ -820,7 +828,7 @@ XenPci_QueryResourceRequirements(PDEVICE
    2.55    length = FIELD_OFFSET(IO_RESOURCE_REQUIREMENTS_LIST, List) +
    2.56      FIELD_OFFSET(IO_RESOURCE_LIST, Descriptors) +
    2.57      sizeof(IO_RESOURCE_DESCRIPTOR) * ARRAY_SIZE(available_interrupts);
    2.58 -  irrl = ExAllocatePoolWithTag(PagedPool,
    2.59 +  irrl = ExAllocatePoolWithTag(NonPagedPool,
    2.60      length,
    2.61      XENPCI_POOL_TAG);
    2.62