win-pvdrivers

changeset 360:cb12e8b450a8

More x64 warnings fixed - x64 wasn't being detected properly in evtchn.c
author James Harper <james.harper@bendigoit.com.au>
date Fri Jul 04 21:57:25 2008 +1000 (2008-07-04)
parents 8c419cbee528
children c50047d5950a
files xenhide/xenhide.c xennet/xennet.c xenpci/evtchn.c xenpci/xenpci_pdo.c
line diff
     1.1 --- a/xenhide/xenhide.c	Fri Jul 04 21:27:07 2008 +1000
     1.2 +++ b/xenhide/xenhide.c	Fri Jul 04 21:57:25 2008 +1000
     1.3 @@ -226,7 +226,7 @@ XenHide_AddDevice(
     1.4    USHORT hide_type;
     1.5    PXENHIDE_HIDE_LIST_ENTRY list_entry;
     1.6  
     1.7 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
     1.8 +  //KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
     1.9  
    1.10    
    1.11    length = 512;
    1.12 @@ -268,11 +268,11 @@ XenHide_AddDevice(
    1.13  
    1.14    if (hide_type == XENHIDE_TYPE_NONE)
    1.15    {
    1.16 -    KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ " (filter not required for %S)\n", device_description));
    1.17 +    //KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ " (filter not required for %S)\n", device_description));
    1.18      return STATUS_SUCCESS;
    1.19    }
    1.20  
    1.21 -  KdPrint((__DRIVER_NAME "     Installing Filter for %S\n", device_description));
    1.22 +  //KdPrint((__DRIVER_NAME "     Installing Filter for %S\n", device_description));
    1.23  
    1.24    if (gplpv && hide_type == XENHIDE_TYPE_DEVICE)
    1.25    {
    1.26 @@ -316,7 +316,7 @@ XenHide_AddDevice(
    1.27  
    1.28    deviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
    1.29  
    1.30 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    1.31 +  //KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    1.32  
    1.33    return STATUS_SUCCESS;
    1.34  }
    1.35 @@ -397,16 +397,16 @@ XenHide_Pnp(PDEVICE_OBJECT device_object
    1.36  
    1.37    switch (stack->MinorFunction) {
    1.38    case IRP_MN_START_DEVICE:
    1.39 -    KdPrint((__DRIVER_NAME "     IRP_MN_START_DEVICE\n"));
    1.40 +    //KdPrint((__DRIVER_NAME "     IRP_MN_START_DEVICE\n"));
    1.41      if (xhdd->hide_type == XENHIDE_TYPE_DEVICE)
    1.42      {
    1.43 -      KdPrint((__DRIVER_NAME "     hide_type == XENHIDE_TYPE_DEVICE\n"));
    1.44 +      //KdPrint((__DRIVER_NAME "     hide_type == XENHIDE_TYPE_DEVICE\n"));
    1.45        status = irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
    1.46        IoCompleteRequest(irp, IO_NO_INCREMENT);
    1.47      }
    1.48      else
    1.49      {
    1.50 -      KdPrint((__DRIVER_NAME "     hide_type != XENHIDE_TYPE_DEVICE\n"));
    1.51 +      //KdPrint((__DRIVER_NAME "     hide_type != XENHIDE_TYPE_DEVICE\n"));
    1.52        IoSkipCurrentIrpStackLocation(irp);
    1.53        status = IoCallDriver(xhdd->lower_do, irp);
    1.54      }
    1.55 @@ -414,7 +414,7 @@ XenHide_Pnp(PDEVICE_OBJECT device_object
    1.56    case IRP_MN_QUERY_DEVICE_RELATIONS:
    1.57      if (xhdd->hide_type == XENHIDE_TYPE_PCI_BUS && stack->Parameters.QueryDeviceRelations.Type == BusRelations)
    1.58      {
    1.59 -      KdPrint((__DRIVER_NAME "     IRP_MN_QUERY_DEVICE_RELATIONS - BusRelations\n"));
    1.60 +      //KdPrint((__DRIVER_NAME "     IRP_MN_QUERY_DEVICE_RELATIONS - BusRelations\n"));
    1.61        IoMarkIrpPending(irp);
    1.62        status = XenHide_SendAndWaitForIrp(device_object, irp);
    1.63        relations = (PDEVICE_RELATIONS)irp->IoStatus.Information;
    1.64 @@ -428,7 +428,7 @@ XenHide_Pnp(PDEVICE_OBJECT device_object
    1.65          {
    1.66            if (relations->Objects[i] == list_entry->pdo)
    1.67            {
    1.68 -            KdPrint((__DRIVER_NAME "     Hiding %p\n", relations->Objects[i]));
    1.69 +            //KdPrint((__DRIVER_NAME "     Hiding %p\n", relations->Objects[i]));
    1.70              break;
    1.71            }
    1.72            list_entry = (PXENHIDE_HIDE_LIST_ENTRY)list_entry->entry.Flink;
     2.1 --- a/xennet/xennet.c	Fri Jul 04 21:27:07 2008 +1000
     2.2 +++ b/xennet/xennet.c	Fri Jul 04 21:57:25 2008 +1000
     2.3 @@ -22,32 +22,6 @@ Foundation, Inc., 51 Franklin Street, Fi
     2.4  #include <io/xenbus.h>
     2.5  #include "xennet.h"
     2.6  
     2.7 -LARGE_INTEGER ProfTime_TxBufferGC;
     2.8 -LARGE_INTEGER ProfTime_RxBufferAlloc;
     2.9 -LARGE_INTEGER ProfTime_ReturnPacket;
    2.10 -LARGE_INTEGER ProfTime_RxBufferCheck;
    2.11 -LARGE_INTEGER ProfTime_Linearize;
    2.12 -LARGE_INTEGER ProfTime_SendPackets;
    2.13 -LARGE_INTEGER ProfTime_SendQueuedPackets;
    2.14 -LARGE_INTEGER ProfTime_RxBufferCheckTopHalf;
    2.15 -LARGE_INTEGER ProfTime_RxBufferCheckBotHalf;
    2.16 -
    2.17 -int ProfCount_TxBufferGC;
    2.18 -int ProfCount_RxBufferAlloc;
    2.19 -int ProfCount_ReturnPacket;
    2.20 -int ProfCount_RxBufferCheck;
    2.21 -int ProfCount_Linearize;
    2.22 -int ProfCount_SendPackets;
    2.23 -int ProfCount_PacketsPerSendPackets;
    2.24 -int ProfCount_SendQueuedPackets;
    2.25 -
    2.26 -int ProfCount_TxPacketsTotal;
    2.27 -int ProfCount_TxPacketsCsumOffload;
    2.28 -int ProfCount_TxPacketsLargeOffload;
    2.29 -int ProfCount_RxPacketsTotal;
    2.30 -int ProfCount_RxPacketsCsumOffload;
    2.31 -int ProfCount_CallsToIndicateReceive;
    2.32 -
    2.33  /* This function copied from linux's lib/vsprintf.c, see it for attribution */
    2.34  static unsigned long
    2.35  simple_strtoul(const char *cp,char **endp,unsigned int base)
    2.36 @@ -604,32 +578,6 @@ DriverEntry(
    2.37    NDIS_HANDLE ndis_wrapper_handle;
    2.38    NDIS_MINIPORT_CHARACTERISTICS mini_chars;
    2.39  
    2.40 -  ProfTime_TxBufferGC.QuadPart = 0;
    2.41 -  ProfTime_RxBufferAlloc.QuadPart = 0;
    2.42 -  ProfTime_ReturnPacket.QuadPart = 0;
    2.43 -  ProfTime_RxBufferCheck.QuadPart = 0;
    2.44 -  ProfTime_RxBufferCheckTopHalf.QuadPart = 0;
    2.45 -  ProfTime_RxBufferCheckBotHalf.QuadPart = 0;
    2.46 -  ProfTime_Linearize.QuadPart = 0;
    2.47 -  ProfTime_SendPackets.QuadPart = 0;
    2.48 -  ProfTime_SendQueuedPackets.QuadPart = 0;
    2.49 -
    2.50 -  ProfCount_TxBufferGC = 0;
    2.51 -  ProfCount_RxBufferAlloc = 0;
    2.52 -  ProfCount_ReturnPacket = 0;
    2.53 -  ProfCount_RxBufferCheck = 0;
    2.54 -  ProfCount_Linearize = 0;
    2.55 -  ProfCount_SendPackets = 0;
    2.56 -  ProfCount_PacketsPerSendPackets = 0;
    2.57 -  ProfCount_SendQueuedPackets = 0;
    2.58 -
    2.59 -  ProfCount_TxPacketsTotal = 0;
    2.60 -  ProfCount_TxPacketsCsumOffload = 0;
    2.61 -  ProfCount_TxPacketsLargeOffload = 0;
    2.62 -  ProfCount_RxPacketsTotal = 0;
    2.63 -  ProfCount_RxPacketsCsumOffload = 0;
    2.64 -  ProfCount_CallsToIndicateReceive = 0;
    2.65 -
    2.66    RtlZeroMemory(&mini_chars, sizeof(mini_chars));
    2.67  
    2.68    NdisMInitializeWrapper(&ndis_wrapper_handle, DriverObject, RegistryPath, NULL);
     3.1 --- a/xenpci/evtchn.c	Fri Jul 04 21:27:07 2008 +1000
     3.2 +++ b/xenpci/evtchn.c	Fri Jul 04 21:57:25 2008 +1000
     3.3 @@ -73,15 +73,11 @@ static inline int test_and_clear_bit(int
     3.4    #define synch_clear_bit(p1, p2) test_and_clear_bit(p1, p2)
     3.5    #define synch_set_bit(p1, p2) test_and_set_bit(p1, p2)
     3.6    #define bit_scan_forward(p1, p2) BitScanForward(p1, p2)
     3.7 -
     3.8 -#elif defined(_WIN32)
     3.9 +#elif defined(_X86_)
    3.10    #define xchg(p1, p2) _InterlockedExchange(p1, p2)
    3.11    #define synch_clear_bit(p1, p2) _interlockedbittestandreset(p2, p1)
    3.12    #define synch_set_bit(p1, p2) _interlockedbittestandset(p2, p1)
    3.13    #define bit_scan_forward(p1, p2) _BitScanForward(p1, p2)
    3.14 -
    3.15 -
    3.16 -
    3.17  #else
    3.18    #define xchg(p1, p2) _InterlockedExchange64(p1, p2)
    3.19    #define synch_clear_bit(p1, p2) _interlockedbittestandreset64(p2, p1)
     4.1 --- a/xenpci/xenpci_pdo.c	Fri Jul 04 21:27:07 2008 +1000
     4.2 +++ b/xenpci/xenpci_pdo.c	Fri Jul 04 21:57:25 2008 +1000
     4.3 @@ -106,6 +106,8 @@ XenPci_BackEndStateHandler(char *Path, P
     4.4    err = XenBus_Read(xpdd, XBT_NIL, Path, &value);
     4.5    if (err)
     4.6    {
     4.7 +    if (xpdd->suspending)
     4.8 +      return;
     4.9      KdPrint(("Failed to read %s, assuming closed\n", path, err));
    4.10      new_backend_state = XenbusStateClosed;
    4.11      XenPci_FreeMem(err);