win-pvdrivers

changeset 521:2b7f8973a41b

implemented interrupt synchronisation to support EVT_ACTION_TYPE_NORMAL
author James Harper <james.harper@bendigoit.com.au>
date Thu Dec 25 23:36:19 2008 +1100 (2008-12-25)
parents 7b330220b871
children fe846ad6de4d
files common/include/xen_public.h xennet/xennet_rx.c xenpci/xenpci_pdo.c
line diff
     1.1 --- a/common/include/xen_public.h	Thu Dec 25 17:53:04 2008 +1100
     1.2 +++ b/common/include/xen_public.h	Thu Dec 25 23:36:19 2008 +1100
     1.3 @@ -62,6 +62,9 @@ typedef evtchn_port_t
     1.4  typedef BOOLEAN
     1.5  (*PXEN_EVTCHN_ACK_EVENT)(PVOID context, evtchn_port_t port);
     1.6  
     1.7 +typedef BOOLEAN
     1.8 +(*PXEN_EVTCHN_SYNC)(PVOID Context, PKSYNCHRONIZE_ROUTINE sync_routine, PVOID sync_context);
     1.9 +
    1.10  typedef grant_ref_t
    1.11  (*PXEN_GNTTBL_GRANTACCESS)(PVOID Context, domid_t domid, uint32_t frame, int readonly, grant_ref_t ref);
    1.12  
    1.13 @@ -132,6 +135,7 @@ typedef struct {
    1.14    PXEN_EVTCHN_UNMASK EvtChn_Unmask;
    1.15    PXEN_EVTCHN_NOTIFY EvtChn_Notify;
    1.16    PXEN_EVTCHN_ACK_EVENT EvtChn_AckEvent;
    1.17 +  PXEN_EVTCHN_SYNC EvtChn_Sync;
    1.18  
    1.19    PXEN_GNTTBL_GETREF GntTbl_GetRef;
    1.20    PXEN_GNTTBL_PUTREF GntTbl_PutRef;
     2.1 --- a/xennet/xennet_rx.c	Thu Dec 25 17:53:04 2008 +1100
     2.2 +++ b/xennet/xennet_rx.c	Thu Dec 25 23:36:19 2008 +1100
     2.3 @@ -529,8 +529,9 @@ XenNet_RxTimerDpc(PKDPC dpc, PVOID conte
     2.4    
     2.5    sc.xi = xi;
     2.6    sc.is_timer = TRUE;
     2.7 -#pragma warning(suppress:4054) /* no way around this... */
     2.8 -  NdisMSynchronizeWithInterrupt(&xi->interrupt, (PVOID)XenNet_RxQueueDpcSynchronized, &sc);
     2.9 +  xi->vectors.EvtChn_Sync(xi->vectors.context, XenNet_RxQueueDpcSynchronized, &sc);
    2.10 +//#pragma warning(suppress:4054) /* no way around this... */
    2.11 +//  NdisMSynchronizeWithInterrupt(&xi->interrupt, (PVOID)XenNet_RxQueueDpcSynchronized, &sc);
    2.12  }
    2.13  
    2.14  // Called at DISPATCH_LEVEL
    2.15 @@ -717,8 +718,9 @@ XenNet_RxBufferCheck(PKDPC dpc, PVOID co
    2.16      sync_context_t sc;
    2.17      sc.xi = xi;
    2.18      sc.is_timer = FALSE;
    2.19 -#pragma warning(suppress:4054) /* no way around this... */
    2.20 -    NdisMSynchronizeWithInterrupt(&xi->interrupt, (PVOID)XenNet_RxQueueDpcSynchronized, &sc);
    2.21 +    xi->vectors.EvtChn_Sync(xi->vectors.context, XenNet_RxQueueDpcSynchronized, &sc);
    2.22 +//#pragma warning(suppress:4054) /* no way around this... */
    2.23 +//    NdisMSynchronizeWithInterrupt(&xi->interrupt, (PVOID)XenNet_RxQueueDpcSynchronized, &sc);
    2.24    }
    2.25    else if (xi->config_rx_interrupt_moderation)
    2.26    {
     3.1 --- a/xenpci/xenpci_pdo.c	Thu Dec 25 17:53:04 2008 +1100
     3.2 +++ b/xenpci/xenpci_pdo.c	Thu Dec 25 23:36:19 2008 +1100
     3.3 @@ -360,6 +360,15 @@ XenPci_EvtChn_AckEvent(PVOID context, ev
     3.4    return EvtChn_AckEvent(xpdd, port);
     3.5  }
     3.6  
     3.7 +static BOOLEAN
     3.8 +XenPci_EvtChn_Sync(PVOID context, PKSYNCHRONIZE_ROUTINE sync_routine, PVOID sync_context)
     3.9 +{
    3.10 +  PXENPCI_PDO_DEVICE_DATA xppdd = context;
    3.11 +  PXENPCI_DEVICE_DATA xpdd = xppdd->bus_fdo->DeviceExtension;
    3.12 +  
    3.13 +  return KeSynchronizeExecution(xpdd->interrupt, sync_routine, sync_context);
    3.14 +}
    3.15 +
    3.16  static grant_ref_t
    3.17  XenPci_GntTbl_GrantAccess(PVOID Context, domid_t domid, uint32_t frame, int readonly, grant_ref_t ref)
    3.18  {
    3.19 @@ -576,6 +585,7 @@ XenPci_XenConfigDeviceSpecifyBuffers(PVO
    3.20    vectors.EvtChn_Unmask = XenPci_EvtChn_Unmask;
    3.21    vectors.EvtChn_Notify = XenPci_EvtChn_Notify;
    3.22    vectors.EvtChn_AckEvent = XenPci_EvtChn_AckEvent;
    3.23 +  vectors.EvtChn_Sync = XenPci_EvtChn_Sync;
    3.24    vectors.GntTbl_GetRef = XenPci_GntTbl_GetRef;
    3.25    vectors.GntTbl_PutRef = XenPci_GntTbl_PutRef;
    3.26    vectors.GntTbl_GrantAccess = XenPci_GntTbl_GrantAccess;