win-pvdrivers

changeset 135:307dd7532ca1

xennet: use OS-provided 64/32bit macros for int-to-ptr casts
author Andy Grover <andy.grover@oracle.com>
date Fri Jan 18 11:16:30 2008 -0800 (2008-01-18)
parents f3f156c524ee
children 351dfc4aa660
files xennet/xennet.c
line diff
     1.1 --- a/xennet/xennet.c	Fri Jan 18 23:50:25 2008 +1100
     1.2 +++ b/xennet/xennet.c	Fri Jan 18 11:16:30 2008 -0800
     1.3 @@ -41,14 +41,6 @@ Foundation, Inc., 51 Franklin Street, Fi
     1.4  #define NET_TX_RING_SIZE __NET_RING_SIZE(netif_tx, PAGE_SIZE)
     1.5  #define NET_RX_RING_SIZE __NET_RING_SIZE(netif_rx, PAGE_SIZE)
     1.6  
     1.7 -#if defined(_X86_)
     1.8 - #define INT_TO_PTR(x) ((PVOID)(LONG)(x))
     1.9 -#else
    1.10 - #if defined(_AMD64_)
    1.11 -  #define INT_TO_PTR(x) ((PVOID)(LONGLONG)(x))
    1.12 - #endif
    1.13 -#endif
    1.14 -
    1.15  #pragma warning(disable: 4127) // conditional expression is constant
    1.16  
    1.17  struct xennet_info
    1.18 @@ -172,7 +164,7 @@ static void
    1.19  add_id_to_freelist(struct xennet_info *xi, unsigned short id)
    1.20  {
    1.21    xi->tx_pkts[id] = xi->tx_pkts[0];
    1.22 -  xi->tx_pkts[0]  = INT_TO_PTR(id);
    1.23 +  xi->tx_pkts[0]  = IntToPtr(id);
    1.24    xi->tx_pkt_ids_used--;
    1.25  }
    1.26  
    1.27 @@ -822,7 +814,7 @@ BufferPoolAlloc++;
    1.28  
    1.29    /* Initialize tx_pkts as a free chain containing every entry. */
    1.30    for (i = 0; i < NET_TX_RING_SIZE+1; i++) {
    1.31 -    xi->tx_pkts[i] = INT_TO_PTR(i + 1);
    1.32 +    xi->tx_pkts[i] = IntToPtr(i + 1);
    1.33      xi->grant_tx_ref[i] = GRANT_INVALID_REF;
    1.34    }
    1.35