win-pvdrivers

diff xenvbd/xenvbd.c @ 74:06b4321b7068

Created a common AllocagePages routine in xen_windows.h
Updated xennet and xenvbd to use it.
Updated xennet's method of getting the virtual address from the Mdl
author James Harper <james.harper@bendigoit.com.au>
date Thu Dec 20 21:37:20 2007 +1100 (2007-12-20)
parents f74723639713
children b7863ede7a37
line diff
     1.1 --- a/xenvbd/xenvbd.c	Thu Dec 20 13:07:44 2007 +1100
     1.2 +++ b/xenvbd/xenvbd.c	Thu Dec 20 21:37:20 2007 +1100
     1.3 @@ -87,45 +87,6 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
     1.4    return Status;
     1.5  }
     1.6  
     1.7 -static PMDL
     1.8 -AllocatePages(int Pages)
     1.9 -{
    1.10 -  PMDL Mdl;
    1.11 -  PVOID Buf;
    1.12 -
    1.13 -  //KdPrint((__DRIVER_NAME " --- AllocatePages IRQL = %d\n", KeGetCurrentIrql()));
    1.14 -  Buf = ExAllocatePoolWithTag(NonPagedPool, Pages * PAGE_SIZE, XENVBD_POOL_TAG);
    1.15 -  if (Buf == NULL)
    1.16 -  {
    1.17 -    KdPrint((__DRIVER_NAME "     AllocatePages Failed at ExAllocatePoolWithTag\n"));
    1.18 -  }
    1.19 -  Mdl = IoAllocateMdl(Buf, Pages * PAGE_SIZE, FALSE, FALSE, NULL);
    1.20 -  if (Mdl == NULL)
    1.21 -  {
    1.22 -    KdPrint((__DRIVER_NAME "     AllocatePages Failed at IoAllocateMdl\n"));
    1.23 -  }
    1.24 -  MmBuildMdlForNonPagedPool(Mdl);
    1.25 -  
    1.26 -  return Mdl;
    1.27 -}
    1.28 -
    1.29 -static PMDL
    1.30 -AllocatePage()
    1.31 -{
    1.32 -  return AllocatePages(1);
    1.33 -}
    1.34 -
    1.35 -static VOID
    1.36 -FreePages(PMDL Mdl)
    1.37 -{
    1.38 -  PVOID Buf = MmGetMdlVirtualAddress(Mdl);
    1.39 -  //KdPrint((__DRIVER_NAME " --- FreePages IRQL = %d\n", KeGetCurrentIrql()));
    1.40 -  //KdPrint((__DRIVER_NAME "     FreePages Failed at IoAllocateMdl\n"));
    1.41 -  //KdPrint((__DRIVER_NAME "     FreePages Buf = %08x\n", Buf));
    1.42 -  IoFreeMdl(Mdl);
    1.43 -  ExFreePoolWithTag(Buf, XENVBD_POOL_TAG);
    1.44 -}
    1.45 -
    1.46  static ULONG
    1.47  XenVbd_HwScsiFindAdapter(PVOID DeviceExtension, PVOID HwContext, PVOID BusInformation, PCHAR ArgumentString, PPORT_CONFIGURATION_INFORMATION ConfigInfo, PBOOLEAN Again)
    1.48  {