win-pvdrivers

changeset 154:f799098694b5

Merge with head
author James Harper <james.harper@bendigoit.com.au>
date Thu Jan 24 10:29:29 2008 +1100 (2008-01-24)
parents f9e747698949 e5d11fe17633
children 06ff6f324c80
files xenpci/evtchn.c
line diff
     1.1 --- a/common/include/public/arch-x86/xen.h	Thu Jan 24 10:25:18 2008 +1100
     1.2 +++ b/common/include/public/arch-x86/xen.h	Thu Jan 24 10:29:29 2008 +1100
     1.3 @@ -46,11 +46,11 @@
     1.4  
     1.5  #if defined(_AMD64_)
     1.6  /* Under windows _AMD64_, sizeof(long) != sizeof(void *) */
     1.7 -typedef long xen_long_t;
     1.8 +typedef long long xen_long_t;
     1.9  typedef unsigned long long xen_ulong_t;
    1.10  #else
    1.11  typedef long xen_long_t;
    1.12 -typedef unsigned long long xen_ulong_t;
    1.13 +typedef unsigned long xen_ulong_t;
    1.14  #endif
    1.15  
    1.16  #if defined(__i386__)
     2.1 --- a/xennet/xennet.c	Thu Jan 24 10:25:18 2008 +1100
     2.2 +++ b/xennet/xennet.c	Thu Jan 24 10:29:29 2008 +1100
     2.3 @@ -423,8 +423,8 @@ XenNet_ReturnPacket(
     2.4    struct xennet_info *xi = MiniportAdapterContext;
     2.5    PNDIS_BUFFER buffer;
     2.6  //  PNDIS_BUFFER next_buffer;
     2.7 -  PVOID buff_va;
     2.8 -  UINT buff_len;
     2.9 +  // PVOID buff_va;
    2.10 +  // UINT buff_len;
    2.11    UINT tot_buff_len;
    2.12    buffer_entry_t *buffer_entry;
    2.13  
    2.14 @@ -1167,9 +1167,13 @@ XenNet_QueryInformation(
    2.15        }
    2.16  
    2.17        ntoh = (PNDIS_TASK_OFFLOAD_HEADER)InformationBuffer;
    2.18 -      ASSERT(ntoh->Version == NDIS_TASK_OFFLOAD_VERSION);
    2.19 -      ASSERT(ntoh->Size == sizeof(*ntoh));
    2.20 -      ASSERT(ntoh->EncapsulationFormat.Encapsulation == IEEE_802_3_Encapsulation);
    2.21 +      if (ntoh->Version != NDIS_TASK_OFFLOAD_VERSION
    2.22 +        || ntoh->Size != sizeof(*ntoh)
    2.23 +        || ntoh->EncapsulationFormat.Encapsulation != IEEE_802_3_Encapsulation)
    2.24 +      {
    2.25 +        status = NDIS_STATUS_NOT_SUPPORTED;
    2.26 +        break;
    2.27 +      }
    2.28        ntoh->OffsetFirstTask = ntoh->Size;
    2.29  
    2.30        /* fill in first nto */
     3.1 --- a/xenpci/evtchn.c	Thu Jan 24 10:25:18 2008 +1100
     3.2 +++ b/xenpci/evtchn.c	Thu Jan 24 10:29:29 2008 +1100
     3.3 @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fi
     3.4  
     3.5  #include "xenpci.h"
     3.6  
     3.7 -#if defined(__X86__)
     3.8 +#if defined(_WIN32)
     3.9    #define xchg(p1, p2) _InterlockedExchange(p1, p2)
    3.10    #define synch_clear_bit(p1, p2) _interlockedbittestandreset(p2, p1)
    3.11    #define synch_set_bit(p1, p2) _interlockedbittestandset(p2, p1)
    3.12 @@ -61,7 +61,7 @@ EvtChn_Interrupt(WDFINTERRUPT Interrupt,
    3.13  
    3.14    vcpu_info->evtchn_upcall_pending = 0;
    3.15  
    3.16 -  evt_words = xchg((volatile xen_ulong_t *)&vcpu_info->evtchn_pending_sel, 0);
    3.17 +  evt_words = xchg((volatile xen_long_t *)&vcpu_info->evtchn_pending_sel, 0);
    3.18    
    3.19    while (bit_scan_forward(&evt_word, evt_words))
    3.20    {
    3.21 @@ -86,7 +86,7 @@ EvtChn_Interrupt(WDFINTERRUPT Interrupt,
    3.22            ev_action->ServiceRoutine(NULL, ev_action->ServiceContext);
    3.23          }
    3.24        }
    3.25 -      synch_clear_bit(port, (volatile xen_ulong_t *)&shared_info_area->evtchn_pending[evt_word]);
    3.26 +      synch_clear_bit(port, (volatile xen_long_t *)&shared_info_area->evtchn_pending[evt_word]);
    3.27      }
    3.28    }
    3.29  
    3.30 @@ -185,7 +185,7 @@ EvtChn_Mask(PVOID Context, evtchn_port_t
    3.31    //KdPrint((__DRIVER_NAME " --> EvtChn_Mask\n"));
    3.32  
    3.33    synch_set_bit(Port,
    3.34 -    (volatile xen_ulong_t *)&xpdd->shared_info_area->evtchn_mask[0]);
    3.35 +    (volatile xen_long_t *)&xpdd->shared_info_area->evtchn_mask[0]);
    3.36  
    3.37    //KdPrint((__DRIVER_NAME " <-- EvtChn_Mask\n"));
    3.38  
    3.39 @@ -200,7 +200,7 @@ EvtChn_Unmask(PVOID Context, evtchn_port
    3.40    //KdPrint((__DRIVER_NAME " --> EvtChn_Unmask\n"));
    3.41  
    3.42    synch_clear_bit(Port,
    3.43 -    (volatile xen_ulong_t *)&xpdd->shared_info_area->evtchn_mask[0]);
    3.44 +    (volatile xen_long_t *)&xpdd->shared_info_area->evtchn_mask[0]);
    3.45    // should we kick off pending interrupts here too???
    3.46  
    3.47    //KdPrint((__DRIVER_NAME " <-- EvtChn_Unmask\n"));
    3.48 @@ -264,7 +264,7 @@ EvtChn_GetXenStoreRingAddr(WDFDEVICE Dev
    3.49  
    3.50    KdPrint((__DRIVER_NAME " --> EvtChn_GetRingAddr\n"));
    3.51  
    3.52 -  xen_store_mfn = hvm_get_parameter(Device, HVM_PARAM_STORE_PFN);
    3.53 +  xen_store_mfn = (xen_ulong_t)hvm_get_parameter(Device, HVM_PARAM_STORE_PFN);
    3.54  
    3.55    pa_xen_store_interface.QuadPart = xen_store_mfn << PAGE_SHIFT;
    3.56    xen_store_interface = MmMapIoSpace(pa_xen_store_interface, PAGE_SIZE, MmNonCached);