win-pvdrivers

changeset 1012:9e076343bb8e

Change GuardedMutex to FastMutex to be compatible with older OS
author James Harper <james.harper@bendigoit.com.au>
date Mon Feb 11 17:28:26 2013 +1100 (2013-02-11)
parents c21a4feb4a27
children 43e76afb2398
files xenpci/xenpci.c xenpci/xenpci.h xenpci/xenpci_fdo.c
line diff
     1.1 --- a/xenpci/xenpci.c	Mon Feb 11 17:27:48 2013 +1100
     1.2 +++ b/xenpci/xenpci.c	Mon Feb 11 17:28:26 2013 +1100
     1.3 @@ -148,7 +148,7 @@ XenPci_EvtDeviceAdd_XenPci(WDFDRIVER dri
     1.4    xpdd->wdf_device = device;
     1.5    xpdd->child_list = WdfFdoGetDefaultChildList(device);
     1.6  
     1.7 -  KeInitializeGuardedMutex(&xpdd->suspend_mutex);
     1.8 +  ExInitializeFastMutex(&xpdd->suspend_mutex);
     1.9    WdfCollectionCreate(WDF_NO_OBJECT_ATTRIBUTES, &veto_devices);
    1.10    status = WdfDriverOpenParametersRegistryKey(driver, KEY_QUERY_VALUE, WDF_NO_OBJECT_ATTRIBUTES, &param_key);
    1.11    if (NT_SUCCESS(status))
     2.1 --- a/xenpci/xenpci.h	Mon Feb 11 17:27:48 2013 +1100
     2.2 +++ b/xenpci/xenpci.h	Mon Feb 11 17:28:26 2013 +1100
     2.3 @@ -204,7 +204,7 @@ typedef struct {
     2.4    
     2.5    WDFCHILDLIST child_list;
     2.6    
     2.7 -  KGUARDED_MUTEX suspend_mutex;
     2.8 +  FAST_MUTEX suspend_mutex;
     2.9    
    2.10    ULONG suspend_evtchn;
    2.11    int suspend_state;
     3.1 --- a/xenpci/xenpci_fdo.c	Mon Feb 11 17:27:48 2013 +1100
     3.2 +++ b/xenpci/xenpci_fdo.c	Mon Feb 11 17:28:26 2013 +1100
     3.3 @@ -540,7 +540,7 @@ XenPci_SuspendResume(WDFWORKITEM workite
     3.4    FUNCTION_ENTER();
     3.5  
     3.6    if (xpdd->suspend_state == SUSPEND_STATE_NONE) {
     3.7 -    KeAcquireGuardedMutex(&xpdd->suspend_mutex);
     3.8 +    ExAcquireFastMutex(&xpdd->suspend_mutex);
     3.9      xpdd->suspend_state = SUSPEND_STATE_SCHEDULED;
    3.10      KeMemoryBarrier();
    3.11      
    3.12 @@ -569,7 +569,7 @@ XenPci_SuspendResume(WDFWORKITEM workite
    3.13      WdfChildListEndIteration(child_list, &child_iterator);
    3.14  
    3.15      xpdd->suspend_state = SUSPEND_STATE_NONE;
    3.16 -    KeReleaseGuardedMutex(&xpdd->suspend_mutex);
    3.17 +    ExReleaseFastMutex(&xpdd->suspend_mutex);
    3.18    }
    3.19    FUNCTION_EXIT();
    3.20  }