win-pvdrivers

changeset 306:f3c839dbc58f wdm

merged... i think
author James Harper <james.harper@bendigoit.com.au>
date Wed Jun 11 20:24:06 2008 +1000 (2008-06-11)
parents af768b0bca2c 5a7bfc1827a7
children e4411b37b9a9 9b19ded5956f
files
line diff
     1.1 --- a/xenhide/xenhide.c	Tue Jun 10 20:15:37 2008 -0700
     1.2 +++ b/xenhide/xenhide.c	Wed Jun 11 20:24:06 2008 +1000
     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	Tue Jun 10 20:15:37 2008 -0700
     2.2 +++ b/xennet/xennet_common.c	Wed Jun 11 20:24:06 2008 +1000
     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->vectors.GntTbl_GrantAccess(
    2.14        fl->xi->vectors.context, 0,
    2.15 -      (ULONG)*MmGetMdlPfnArray(mdl), FALSE, 0);
    2.16 +      (uint32_t)pfn, FALSE, 0);
    2.17    }
    2.18    else
    2.19    {
     3.1 --- a/xenpci/evtchn.c	Tue Jun 10 20:15:37 2008 -0700
     3.2 +++ b/xenpci/evtchn.c	Wed Jun 11 20:24:06 2008 +1000
     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)
     4.1 --- a/xenpci/gnttbl.c	Tue Jun 10 20:15:37 2008 -0700
     4.2 +++ b/xenpci/gnttbl.c	Wed Jun 11 20:24:06 2008 +1000
     4.3 @@ -74,7 +74,7 @@ grant_ref_t
     4.4  GntTbl_GrantAccess(
     4.5    PVOID Context,
     4.6    domid_t domid,
     4.7 -  uint32_t frame,
     4.8 +  uint32_t frame, // xen api limits pfn to 32bit, so no guests over 8TB
     4.9    int readonly,
    4.10    grant_ref_t ref)
    4.11  {
     5.1 --- a/xenpci/xenpci.h	Tue Jun 10 20:15:37 2008 -0700
     5.2 +++ b/xenpci/xenpci.h	Wed Jun 11 20:24:06 2008 +1000
     5.3 @@ -248,29 +248,52 @@ typedef struct
     5.4    PXENPCI_PDO_DEVICE_DATA context;
     5.5  } XEN_CHILD, *PXEN_CHILD;
     5.6  
     5.7 +#define SWINT(x) case x: __asm { int x } break;
     5.8 +
     5.9  #if defined(_X86_)
    5.10  static __inline VOID
    5.11  sw_interrupt(UCHAR intno)
    5.12  {
    5.13    //KdPrint((__DRIVER_NAME "     Calling interrupt %02X\n", intno));
    5.14 -  if (intno >= 0x10)
    5.15 +  switch (intno)
    5.16    {
    5.17 -#ifdef __GNUC__
    5.18 -    /* TODO this gcc asm is wrong, need to use gcc asm extended template :( */
    5.19 -    __asm__("int $intno");
    5.20 -#elif defined (_MSC_VER)
    5.21 -    /* James, would this work? */
    5.22 -    __asm {int intno}
    5.23 -#else
    5.24 -  #error unknown compiler, what inline asm format to use?
    5.25 -#endif
    5.26 -  }
    5.27 -  else
    5.28 -  {
    5.29 +  SWINT(0x10) SWINT(0x11) SWINT(0x12) SWINT(0x13) SWINT(0x14) SWINT(0x15) SWINT(0x16) SWINT(0x17)
    5.30 +  SWINT(0x18) SWINT(0x19) SWINT(0x1A) SWINT(0x1B) SWINT(0x1C) SWINT(0x1D) SWINT(0x1E) SWINT(0x1F)
    5.31 +  SWINT(0x20) SWINT(0x21) SWINT(0x22) SWINT(0x23) SWINT(0x24) SWINT(0x25) SWINT(0x26) SWINT(0x27)
    5.32 +  SWINT(0x28) SWINT(0x29) SWINT(0x2A) SWINT(0x2B) SWINT(0x2C) SWINT(0x2D) SWINT(0x2E) SWINT(0x2F)
    5.33 +  SWINT(0x30) SWINT(0x31) SWINT(0x32) SWINT(0x33) SWINT(0x34) SWINT(0x35) SWINT(0x36) SWINT(0x37)
    5.34 +  SWINT(0x38) SWINT(0x39) SWINT(0x3A) SWINT(0x3B) SWINT(0x3C) SWINT(0x3D) SWINT(0x3E) SWINT(0x3F)
    5.35 +  SWINT(0x40) SWINT(0x41) SWINT(0x42) SWINT(0x43) SWINT(0x44) SWINT(0x45) SWINT(0x46) SWINT(0x47)
    5.36 +  SWINT(0x48) SWINT(0x49) SWINT(0x4A) SWINT(0x4B) SWINT(0x4C) SWINT(0x4D) SWINT(0x4E) SWINT(0x4F)
    5.37 +  SWINT(0x50) SWINT(0x51) SWINT(0x52) SWINT(0x53) SWINT(0x54) SWINT(0x55) SWINT(0x56) SWINT(0x57)
    5.38 +  SWINT(0x58) SWINT(0x59) SWINT(0x5A) SWINT(0x5B) SWINT(0x5C) SWINT(0x5D) SWINT(0x5E) SWINT(0x5F)
    5.39 +  SWINT(0x60) SWINT(0x61) SWINT(0x62) SWINT(0x63) SWINT(0x64) SWINT(0x65) SWINT(0x66) SWINT(0x67)
    5.40 +  SWINT(0x68) SWINT(0x69) SWINT(0x6A) SWINT(0x6B) SWINT(0x6C) SWINT(0x6D) SWINT(0x6E) SWINT(0x6F)
    5.41 +  SWINT(0x70) SWINT(0x71) SWINT(0x72) SWINT(0x73) SWINT(0x74) SWINT(0x75) SWINT(0x76) SWINT(0x77)
    5.42 +  SWINT(0x78) SWINT(0x79) SWINT(0x7A) SWINT(0x7B) SWINT(0x7C) SWINT(0x7D) SWINT(0x7E) SWINT(0x7F)
    5.43 +  SWINT(0x80) SWINT(0x81) SWINT(0x82) SWINT(0x83) SWINT(0x84) SWINT(0x85) SWINT(0x86) SWINT(0x87)
    5.44 +  SWINT(0x88) SWINT(0x89) SWINT(0x8A) SWINT(0x8B) SWINT(0x8C) SWINT(0x8D) SWINT(0x8E) SWINT(0x8F)
    5.45 +  SWINT(0x90) SWINT(0x91) SWINT(0x92) SWINT(0x93) SWINT(0x94) SWINT(0x95) SWINT(0x96) SWINT(0x97)
    5.46 +  SWINT(0x98) SWINT(0x99) SWINT(0x9A) SWINT(0x9B) SWINT(0x9C) SWINT(0x9D) SWINT(0x9E) SWINT(0x9F)
    5.47 +  SWINT(0xA0) SWINT(0xA1) SWINT(0xA2) SWINT(0xA3) SWINT(0xA4) SWINT(0xA5) SWINT(0xA6) SWINT(0xA7)
    5.48 +  SWINT(0xA8) SWINT(0xA9) SWINT(0xAA) SWINT(0xAB) SWINT(0xAC) SWINT(0xAD) SWINT(0xAE) SWINT(0xAF)
    5.49 +  SWINT(0xB0) SWINT(0xB1) SWINT(0xB2) SWINT(0xB3) SWINT(0xB4) SWINT(0xB5) SWINT(0xB6) SWINT(0xB7)
    5.50 +  SWINT(0xB8) SWINT(0xB9) SWINT(0xBA) SWINT(0xBB) SWINT(0xBC) SWINT(0xBD) SWINT(0xBE) SWINT(0xBF)
    5.51 +  SWINT(0xC0) SWINT(0xC1) SWINT(0xC2) SWINT(0xC3) SWINT(0xC4) SWINT(0xC5) SWINT(0xC6) SWINT(0xC7)
    5.52 +  SWINT(0xC8) SWINT(0xC9) SWINT(0xCA) SWINT(0xCB) SWINT(0xCC) SWINT(0xCD) SWINT(0xCE) SWINT(0xCF)
    5.53 +  SWINT(0xD0) SWINT(0xD1) SWINT(0xD2) SWINT(0xD3) SWINT(0xD4) SWINT(0xD5) SWINT(0xD6) SWINT(0xD7)
    5.54 +  SWINT(0xD8) SWINT(0xD9) SWINT(0xDA) SWINT(0xDB) SWINT(0xDC) SWINT(0xDD) SWINT(0xDE) SWINT(0xDF)
    5.55 +  SWINT(0xE0) SWINT(0xE1) SWINT(0xE2) SWINT(0xE3) SWINT(0xE4) SWINT(0xE5) SWINT(0xE6) SWINT(0xE7)
    5.56 +  SWINT(0xE8) SWINT(0xE9) SWINT(0xEA) SWINT(0xEB) SWINT(0xEC) SWINT(0xED) SWINT(0xEE) SWINT(0xEF)
    5.57 +  SWINT(0xF0) SWINT(0xF1) SWINT(0xF2) SWINT(0xF3) SWINT(0xF4) SWINT(0xF5) SWINT(0xF6) SWINT(0xF7)
    5.58 +  SWINT(0xF8) SWINT(0xF9) SWINT(0xFA) SWINT(0xFB) SWINT(0xFC) SWINT(0xFD) SWINT(0xFE) SWINT(0xFF)
    5.59 +
    5.60 +  default:
    5.61      KdPrint((__DRIVER_NAME "     interrupt %02X not set up. Blame James.\n", intno));
    5.62      KeBugCheckEx(('X' << 16)|('E' << 8)|('N'), 0x00000002, (ULONG)intno, 0x00000000, 0x00000000);
    5.63 +    break;
    5.64    }
    5.65 -}    
    5.66 +}
    5.67  #else
    5.68  VOID _sw_interrupt(UCHAR);
    5.69