win-pvdrivers

changeset 397:a8f674f67fd6

Automated merge with ssh://win-pvdrivers@xenbits.xensource.com/win-pvdrivers.hg
author Andy Grover <andy.grover@oracle.com>
date Thu Jul 17 09:34:42 2008 -0700 (2008-07-17)
parents 099b6e3f3909 7259dad4e96c
children e7292fd9e55a
files
line diff
     1.1 --- a/common/include/xen_windows.h	Thu Jul 17 21:10:09 2008 +1000
     1.2 +++ b/common/include/xen_windows.h	Thu Jul 17 09:34:42 2008 -0700
     1.3 @@ -64,7 +64,7 @@ typedef unsigned long xenbus_transaction
     1.4  #define FUNCTION_ENTER()      KdPrint((__DRIVER_NAME " --> %s\n", __FUNCTION__))
     1.5  #define FUNCTION_EXIT()       KdPrint((__DRIVER_NAME " <-- %s\n", __FUNCTION__))
     1.6  #define FUNCTION_ERROR_EXIT() KdPrint((__DRIVER_NAME " <-- %s (error path)\n", __FUNCTION__))
     1.7 -#define FUNCTION_CALLED()     KdPrint((__DRIVER_NAME " %s called\n", __FUNCTION__))
     1.8 +#define FUNCTION_CALLED()     KdPrint((__DRIVER_NAME " %s called (line %d)\n", __FUNCTION__, __LINE__))
     1.9  #ifdef __MINGW32__
    1.10  #define FUNCTION_MSG(_x) _FUNCTION_MSG _x
    1.11  #define _FUNCTION_MSG(format, args...) KdPrint((__DRIVER_NAME " %s called: " format, __FUNCTION__, ##args))
     2.1 --- a/doc/BUILDING_mingw.txt	Thu Jul 17 21:10:09 2008 +1000
     2.2 +++ b/doc/BUILDING_mingw.txt	Thu Jul 17 09:34:42 2008 -0700
     2.3 @@ -4,7 +4,7 @@ reasons to using the Microsoft WDK/DDK.
     2.4  These instructions are for building the driver on a Linux Ubuntu system, using
     2.5  the mingw32msvc cross-compiler.
     2.6  
     2.7 -1. sudo apt-get install mingw mingw-binutils mingw-runtime
     2.8 +1. sudo apt-get install mingw32 mingw32-binutils mingw32-runtime
     2.9  
    2.10  2. mingw-runtime headers need to be modified. Download the latest w32api-src.tar.gz
    2.11     package from mingw.sf.net.
    2.12 @@ -17,7 +17,7 @@ 4. Use Mercurial and type:
    2.13  5. Apply the patch "w32api.diff" in the mingw directory to the untarred w32api
    2.14     source: "cd w32api-<version>;patch -p1 < ~/hg/win-pvdrivers.hg/mingw/w32api.diff"
    2.15  
    2.16 -6. Type: "./configure i586-mingw32-msvc;make"
    2.17 +6. Type: "./configure i586-mingw32msvc;make"
    2.18  
    2.19  7. Change to the win-pvdrivers.hg/xenpci dir.
    2.20  
     3.1 --- a/xennet/makefile.mingw	Thu Jul 17 21:10:09 2008 +1000
     3.2 +++ b/xennet/makefile.mingw	Thu Jul 17 09:34:42 2008 -0700
     3.3 @@ -1,6 +1,6 @@
     3.4  W32API_PATH=/home/agrover/temp/w32api-3.11
     3.5  
     3.6 -CFLAGS = -g -Wall -L$(W32API_PATH)/lib/ddk -I$(W32API_PATH)/include/ddk -I../common/include -I../common/include/public -Wno-multichar -Wno-unknown-pragmas -DDBG
     3.7 +CFLAGS = -O2 -Wall -L$(W32API_PATH)/lib/ddk -I$(W32API_PATH)/include/ddk -I../common/include -I../common/include/public -Wno-multichar -Wno-unknown-pragmas -DDBG
     3.8  
     3.9  xennet.sys: xennet.c xennet_oid.c xennet_tx.c xennet_rx.c xennet_common.c ../mingw/mingw_extras.c
    3.10  	i586-mingw32msvc-gcc $(CFLAGS) -o $@ -shared -Wl,--entry,_DriverEntry@8 -nostartfiles -nostdlib $^ -lntoskrnl -lhal -lndis
     4.1 --- a/xennet/xennet.c	Thu Jul 17 21:10:09 2008 +1000
     4.2 +++ b/xennet/xennet.c	Thu Jul 17 09:34:42 2008 -0700
     4.3 @@ -277,7 +277,7 @@ XenNet_Init(
     4.4    NDIS_STATUS status;
     4.5    BOOLEAN medium_found = FALSE;
     4.6    struct xennet_info *xi = NULL;
     4.7 -  ULONG nrl_length;
     4.8 +  UINT nrl_length;
     4.9    PNDIS_RESOURCE_LIST nrl;
    4.10    PCM_PARTIAL_RESOURCE_DESCRIPTOR prd;
    4.11    KIRQL irq_level = 0;
     5.1 --- a/xennet/xennet_common.c	Thu Jul 17 21:10:09 2008 +1000
     5.2 +++ b/xennet/xennet_common.c	Thu Jul 17 09:34:42 2008 -0700
     5.3 @@ -125,11 +125,11 @@ XenNet_GetData(
     5.4    PNDIS_BUFFER mdl = pi->mdls[pi->curr_mdl];
     5.5    PUCHAR buffer = (PUCHAR)MmGetMdlVirtualAddress(mdl) + pi->curr_mdl_offset;
     5.6  
     5.7 -//  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
     5.8 +  //FUNCTION_ENTER();
     5.9  
    5.10    *length = (USHORT)min(req_length, MmGetMdlByteCount(mdl) - pi->curr_mdl_offset);
    5.11  
    5.12 -//  KdPrint((__DRIVER_NAME "     req_length = %d, length = %d\n", req_length, *length));
    5.13 +  //FUNCTION_MSG(("req_length = %d, length = %d\n", req_length, *length));
    5.14  
    5.15    pi->curr_mdl_offset = pi->curr_mdl_offset + *length;
    5.16    if (pi->curr_mdl_offset == MmGetMdlByteCount(mdl))
    5.17 @@ -138,7 +138,7 @@ XenNet_GetData(
    5.18      pi->curr_mdl_offset = 0;
    5.19    }
    5.20  
    5.21 -//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    5.22 +  //FUNCTION_EXIT();
    5.23  
    5.24    return buffer;
    5.25  }
    5.26 @@ -162,11 +162,10 @@ XenFreelist_Timer(
    5.27  
    5.28    if (fl->xi->device_state->resume_state != RESUME_STATE_RUNNING && !fl->grants_resumed)
    5.29      return;
    5.30 -    
    5.31 +
    5.32    KeAcquireSpinLockAtDpcLevel(fl->lock);
    5.33  
    5.34 -  //KdPrint((__DRIVER_NAME " --- timer - page_free_lowest = %d\n", fl->page_free_lowest));
    5.35 -//  KdPrint((__DRIVER_NAME " --- rx_outstanding = %d, rx_id_free = %d\n", xi->rx_outstanding, xi->rx_id_free));
    5.36 +  //FUNCTION_MSG((" --- timer - page_free_lowest = %d\n", fl->page_free_lowest));
    5.37  
    5.38    if (fl->page_free_lowest > fl->page_free_target) // lots of potential for tuning here
    5.39    {
    5.40 @@ -177,14 +176,12 @@ XenFreelist_Timer(
    5.41          *(grant_ref_t *)(((UCHAR *)mdl) + MmSizeOfMdl(0, PAGE_SIZE)), 0);
    5.42        FreePages(mdl);
    5.43      }
    5.44 -    //KdPrint((__DRIVER_NAME " --- timer - freed %d pages\n", i));
    5.45 +    //FUNCTION_MSG((__DRIVER_NAME " --- timer - freed %d pages\n", i));
    5.46    }
    5.47  
    5.48    fl->page_free_lowest = fl->page_free;
    5.49  
    5.50    KeReleaseSpinLockFromDpcLevel(fl->lock);
    5.51 -
    5.52 -  return;
    5.53  }
    5.54  
    5.55  VOID