win-pvdrivers

changeset 265:8fef16f8fc08

fix warnings on x64 build. Xen apparently limits PFNs to 32 bits, so make this limitation stand out a little more
author Andy Grover <andy.grover@oracle.com>
date Mon May 05 13:24:03 2008 -0700 (2008-05-05)
parents 91d40c6c314f
children 416c3eb54528
files xenhide/xenhide.c xennet/xennet_common.c xennet/xennet_rx.c xennet/xennet_tx.c xenpci/evtchn.c xenpci/gnttbl.c
line diff
     1.1 --- a/xenhide/xenhide.c	Fri May 02 17:28:27 2008 -0700
     1.2 +++ b/xenhide/xenhide.c	Mon May 05 13:24:03 2008 -0700
     1.3 @@ -51,7 +51,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
     1.4    ULONG BufLen = 200;
     1.5    PKEY_VALUE_PARTIAL_INFORMATION KeyPartialValue;
     1.6    int State = 0;
     1.7 -  int StartPos = 0;
     1.8 +  size_t StartPos = 0;
     1.9    WCHAR *SystemStartOptions;
    1.10    size_t SystemStartOptionsLen;
    1.11    size_t i;
     2.1 --- a/xennet/xennet_common.c	Fri May 02 17:28:27 2008 -0700
     2.2 +++ b/xennet/xennet_common.c	Mon May 05 13:24:03 2008 -0700
     2.3 @@ -200,13 +200,15 @@ PMDL
     2.4  XenFreelist_GetPage(freelist_t *fl)
     2.5  {
     2.6    PMDL mdl;
     2.7 +  PFN_NUMBER pfn;
     2.8  
     2.9    if (fl->page_free == 0)
    2.10    {
    2.11      mdl = AllocatePagesExtra(1, sizeof(grant_ref_t));
    2.12 +    pfn = *MmGetMdlPfnArray(mdl);
    2.13      *(grant_ref_t *)(((UCHAR *)mdl) + MmSizeOfMdl(0, PAGE_SIZE)) = fl->xi->XenInterface.GntTbl_GrantAccess(
    2.14        fl->xi->XenInterface.InterfaceHeader.Context, 0,
    2.15 -      *MmGetMdlPfnArray(mdl), FALSE, 0);
    2.16 +      (uint32_t)pfn, FALSE, 0);
    2.17    }
    2.18    else
    2.19    {
     3.1 --- a/xennet/xennet_rx.c	Fri May 02 17:28:27 2008 -0700
     3.2 +++ b/xennet/xennet_rx.c	Mon May 05 13:24:03 2008 -0700
     3.3 @@ -565,16 +565,18 @@ BOOLEAN
     3.4  XenNet_RxInit(xennet_info_t *xi)
     3.5  {
     3.6    int i;
     3.7 +  PFN_NUMBER pfn;
     3.8  
     3.9    KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    3.10  
    3.11    xi->rx_mdl = AllocatePage();
    3.12 +  pfn = *MmGetMdlPfnArray(xi->rx_mdl);
    3.13    xi->rx_pgs = MmGetMdlVirtualAddress(xi->rx_mdl);
    3.14    SHARED_RING_INIT(xi->rx_pgs);
    3.15    FRONT_RING_INIT(&xi->rx, xi->rx_pgs, PAGE_SIZE);
    3.16    xi->rx_ring_ref = xi->XenInterface.GntTbl_GrantAccess(
    3.17      xi->XenInterface.InterfaceHeader.Context, 0,
    3.18 -    *MmGetMdlPfnArray(xi->rx_mdl), FALSE, 0);
    3.19 +    (uint32_t)pfn, FALSE, 0);
    3.20    xi->rx_id_free = NET_RX_RING_SIZE;
    3.21  
    3.22    for (i = 0; i < NET_RX_RING_SIZE; i++)
     4.1 --- a/xennet/xennet_tx.c	Fri May 02 17:28:27 2008 -0700
     4.2 +++ b/xennet/xennet_tx.c	Mon May 05 13:24:03 2008 -0700
     4.3 @@ -454,16 +454,18 @@ BOOLEAN
     4.4  XenNet_TxInit(xennet_info_t *xi)
     4.5  {
     4.6    USHORT i;
     4.7 +  PFN_NUMBER pfn;
     4.8  
     4.9    KeInitializeSpinLock(&xi->tx_lock);
    4.10  
    4.11    xi->tx_mdl = AllocatePage();
    4.12 +  pfn = *MmGetMdlPfnArray(xi->tx_mdl);
    4.13    xi->tx_pgs = MmGetMdlVirtualAddress(xi->tx_mdl);
    4.14    SHARED_RING_INIT(xi->tx_pgs);
    4.15    FRONT_RING_INIT(&xi->tx, xi->tx_pgs, PAGE_SIZE);
    4.16    xi->tx_ring_ref = xi->XenInterface.GntTbl_GrantAccess(
    4.17      xi->XenInterface.InterfaceHeader.Context, 0,
    4.18 -    *MmGetMdlPfnArray(xi->tx_mdl), FALSE, 0);
    4.19 +    (uint32_t)pfn, FALSE, 0);
    4.20    xi->tx_id_free = 0;
    4.21    xi->tx_no_id_used = 0;
    4.22    for (i = 0; i < NET_TX_RING_SIZE; i++)
     5.1 --- a/xenpci/evtchn.c	Fri May 02 17:28:27 2008 -0700
     5.2 +++ b/xenpci/evtchn.c	Mon May 05 13:24:03 2008 -0700
     5.3 @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fi
     5.4  
     5.5  #include "xenpci.h"
     5.6  
     5.7 -#if defined(_WIN32)
     5.8 +#if defined(_X86_)
     5.9    #define xchg(p1, p2) _InterlockedExchange(p1, p2)
    5.10    #define synch_clear_bit(p1, p2) _interlockedbittestandreset(p2, p1)
    5.11    #define synch_set_bit(p1, p2) _interlockedbittestandset(p2, p1)
     6.1 --- a/xenpci/gnttbl.c	Fri May 02 17:28:27 2008 -0700
     6.2 +++ b/xenpci/gnttbl.c	Mon May 05 13:24:03 2008 -0700
     6.3 @@ -103,7 +103,7 @@ grant_ref_t
     6.4  GntTbl_GrantAccess(
     6.5    WDFDEVICE Device,
     6.6    domid_t domid,
     6.7 -  uint32_t frame,
     6.8 +  uint32_t frame, // xen api limits pfn to 32bit, so no guests over 8TB
     6.9    int readonly,
    6.10    grant_ref_t ref)
    6.11  {