win-pvdrivers

changeset 396:7259dad4e96c

fixes for mingw optimized build, random other little stuff.
author Andy Grover <andy.grover@oracle.com>
date Thu Jul 17 09:34:37 2008 -0700 (2008-07-17)
parents f001a0f08c17
children a8f674f67fd6
files common/include/xen_windows.h xennet/makefile.mingw xennet/xennet.c xennet/xennet_common.c
line diff
     1.1 --- a/common/include/xen_windows.h	Thu Jul 17 09:25:19 2008 -0700
     1.2 +++ b/common/include/xen_windows.h	Thu Jul 17 09:34:37 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/xennet/makefile.mingw	Thu Jul 17 09:25:19 2008 -0700
     2.2 +++ b/xennet/makefile.mingw	Thu Jul 17 09:34:37 2008 -0700
     2.3 @@ -1,6 +1,6 @@
     2.4  W32API_PATH=/home/agrover/temp/w32api-3.11
     2.5  
     2.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
     2.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
     2.8  
     2.9  xennet.sys: xennet.c xennet_oid.c xennet_tx.c xennet_rx.c xennet_common.c ../mingw/mingw_extras.c
    2.10  	i586-mingw32msvc-gcc $(CFLAGS) -o $@ -shared -Wl,--entry,_DriverEntry@8 -nostartfiles -nostdlib $^ -lntoskrnl -lhal -lndis
     3.1 --- a/xennet/xennet.c	Thu Jul 17 09:25:19 2008 -0700
     3.2 +++ b/xennet/xennet.c	Thu Jul 17 09:34:37 2008 -0700
     3.3 @@ -277,7 +277,7 @@ XenNet_Init(
     3.4    NDIS_STATUS status;
     3.5    BOOLEAN medium_found = FALSE;
     3.6    struct xennet_info *xi = NULL;
     3.7 -  ULONG nrl_length;
     3.8 +  UINT nrl_length;
     3.9    PNDIS_RESOURCE_LIST nrl;
    3.10    PCM_PARTIAL_RESOURCE_DESCRIPTOR prd;
    3.11    KIRQL irq_level = 0;
     4.1 --- a/xennet/xennet_common.c	Thu Jul 17 09:25:19 2008 -0700
     4.2 +++ b/xennet/xennet_common.c	Thu Jul 17 09:34:37 2008 -0700
     4.3 @@ -125,11 +125,11 @@ XenNet_GetData(
     4.4    PNDIS_BUFFER mdl = pi->mdls[pi->curr_mdl];
     4.5    PUCHAR buffer = (PUCHAR)MmGetMdlVirtualAddress(mdl) + pi->curr_mdl_offset;
     4.6  
     4.7 -//  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
     4.8 +  //FUNCTION_ENTER();
     4.9  
    4.10    *length = (USHORT)min(req_length, MmGetMdlByteCount(mdl) - pi->curr_mdl_offset);
    4.11  
    4.12 -//  KdPrint((__DRIVER_NAME "     req_length = %d, length = %d\n", req_length, *length));
    4.13 +  //FUNCTION_MSG(("req_length = %d, length = %d\n", req_length, *length));
    4.14  
    4.15    pi->curr_mdl_offset = pi->curr_mdl_offset + *length;
    4.16    if (pi->curr_mdl_offset == MmGetMdlByteCount(mdl))
    4.17 @@ -138,7 +138,7 @@ XenNet_GetData(
    4.18      pi->curr_mdl_offset = 0;
    4.19    }
    4.20  
    4.21 -//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    4.22 +  //FUNCTION_EXIT();
    4.23  
    4.24    return buffer;
    4.25  }
    4.26 @@ -162,11 +162,10 @@ XenFreelist_Timer(
    4.27  
    4.28    if (fl->xi->device_state->resume_state != RESUME_STATE_RUNNING && !fl->grants_resumed)
    4.29      return;
    4.30 -    
    4.31 +
    4.32    KeAcquireSpinLockAtDpcLevel(fl->lock);
    4.33  
    4.34 -  //KdPrint((__DRIVER_NAME " --- timer - page_free_lowest = %d\n", fl->page_free_lowest));
    4.35 -//  KdPrint((__DRIVER_NAME " --- rx_outstanding = %d, rx_id_free = %d\n", xi->rx_outstanding, xi->rx_id_free));
    4.36 +  //FUNCTION_MSG((" --- timer - page_free_lowest = %d\n", fl->page_free_lowest));
    4.37  
    4.38    if (fl->page_free_lowest > fl->page_free_target) // lots of potential for tuning here
    4.39    {
    4.40 @@ -177,14 +176,12 @@ XenFreelist_Timer(
    4.41          *(grant_ref_t *)(((UCHAR *)mdl) + MmSizeOfMdl(0, PAGE_SIZE)), 0);
    4.42        FreePages(mdl);
    4.43      }
    4.44 -    //KdPrint((__DRIVER_NAME " --- timer - freed %d pages\n", i));
    4.45 +    //FUNCTION_MSG((__DRIVER_NAME " --- timer - freed %d pages\n", i));
    4.46    }
    4.47  
    4.48    fl->page_free_lowest = fl->page_free;
    4.49  
    4.50    KeReleaseSpinLockFromDpcLevel(fl->lock);
    4.51 -
    4.52 -  return;
    4.53  }
    4.54  
    4.55  VOID