win-pvdrivers

changeset 880:e315b8490131

Make xenpci an export driver to remove some of the cumbersome function table stuff.
Cleanups
author James Harper <james.harper@bendigoit.com.au>
date Tue Mar 15 12:22:19 2011 +1100 (2011-03-15)
parents 16f6219acf13
children 730447ed7524
files xenpci/evtchn.c xenpci/sources xenpci/xenpci.h xenpci/xenpci_dbgprint.c xenpci/xenpci_fdo.c xenpci/xenpci_highsync.c xenpci/xenpci_pdo.c
line diff
     1.1 --- a/xenpci/evtchn.c	Tue Mar 15 12:19:03 2011 +1100
     1.2 +++ b/xenpci/evtchn.c	Tue Mar 15 12:22:19 2011 +1100
     1.3 @@ -39,7 +39,7 @@ static KDEFERRED_ROUTINE EvtChn_DpcBounc
     1.4  #define BITS_PER_LONG (sizeof(xen_ulong_t) * 8)
     1.5  #define BITS_PER_LONG_SHIFT (5 + (sizeof(xen_ulong_t) >> 3))
     1.6  
     1.7 -static DDKAPI VOID
     1.8 +static VOID
     1.9  EvtChn_DpcBounce(PRKDPC Dpc, PVOID Context, PVOID SystemArgument1, PVOID SystemArgument2)
    1.10  {
    1.11    ev_action_t *action = Context;
     2.1 --- a/xenpci/sources	Tue Mar 15 12:19:03 2011 +1100
     2.2 +++ b/xenpci/sources	Tue Mar 15 12:22:19 2011 +1100
     2.3 @@ -1,7 +1,7 @@
     2.4  !INCLUDE ..\common.inc
     2.5  TARGETNAME=xenpci
     2.6  INF_NAME=xenpci
     2.7 -TARGETTYPE=DRIVER
     2.8 +TARGETTYPE=EXPORT_DRIVER
     2.9  KMDF_VERSION_MAJOR=1
    2.10  NTTARGETFILES=$(NTTARGETFILES) $(OBJ_PATH)\$(O)\$(INF_NAME).inf
    2.11  TARGETLIBS=$(TARGETLIBS) $(DDK_LIB_PATH)\wdmsec.lib $(DDK_LIB_PATH)\Rtlver.lib \
     3.1 --- a/xenpci/xenpci.h	Tue Mar 15 12:19:03 2011 +1100
     3.2 +++ b/xenpci/xenpci.h	Tue Mar 15 12:22:19 2011 +1100
     3.3 @@ -23,10 +23,12 @@ Foundation, Inc., 51 Franklin Street, Fi
     3.4  #define __attribute__(arg) /* empty */
     3.5  #define EISCONN 127
     3.6  
     3.7 -#include <ntifs.h>
     3.8 -//#include <ntddk.h>
     3.9 +#include <ntddk.h>
    3.10  
    3.11 -#define DDKAPI
    3.12 +/* including ntifs.h (only needed for this function) causes PREFast to trip up on lots of bogus errors */
    3.13 +PDEVICE_OBJECT IoGetLowerDeviceObject(IN PDEVICE_OBJECT DeviceObject); 
    3.14 +//#include <ntifs.h>
    3.15 +
    3.16  //#include <wdm.h>
    3.17  #include <wdf.h>
    3.18  #include <initguid.h>
     4.1 --- a/xenpci/xenpci_dbgprint.c	Tue Mar 15 12:19:03 2011 +1100
     4.2 +++ b/xenpci/xenpci_dbgprint.c	Tue Mar 15 12:22:19 2011 +1100
     4.3 @@ -82,7 +82,7 @@ static void XenDbgPrint(PCHAR string, UL
     4.4      if (current_time.QuadPart / j)
     4.5        break;
     4.6    for (; j >= 1; j /= 10)
     4.7 -    WRITE_PORT_UCHAR(XEN_IOPORT_LOG, '0' + ((current_time.QuadPart / j) % 10));
     4.8 +    WRITE_PORT_UCHAR(XEN_IOPORT_LOG, '0' + (UCHAR)((current_time.QuadPart / j) % 10));
     4.9    WRITE_PORT_UCHAR(XEN_IOPORT_LOG, ':');
    4.10    WRITE_PORT_UCHAR(XEN_IOPORT_LOG, ' ');
    4.11        
     5.1 --- a/xenpci/xenpci_fdo.c	Tue Mar 15 12:19:03 2011 +1100
     5.2 +++ b/xenpci/xenpci_fdo.c	Tue Mar 15 12:22:19 2011 +1100
     5.3 @@ -530,7 +530,7 @@ XenPci_ConnectSuspendEvt(PXENPCI_DEVICE_
     5.4  }
     5.5  
     5.6  /* Called at PASSIVE_LEVEL */
     5.7 -static VOID DDKAPI
     5.8 +static VOID
     5.9  XenPci_SuspendResume(WDFWORKITEM workitem)
    5.10  {
    5.11    NTSTATUS status;
     6.1 --- a/xenpci/xenpci_highsync.c	Tue Mar 15 12:19:03 2011 +1100
     6.2 +++ b/xenpci/xenpci_highsync.c	Tue Mar 15 12:22:19 2011 +1100
     6.3 @@ -43,7 +43,7 @@ struct {
     6.4    PVOID                 context;
     6.5  } typedef highsync_info_t;
     6.6  
     6.7 -static DDKAPI VOID
     6.8 +static VOID
     6.9  XenPci_HighSyncCallFunction0(
    6.10    PRKDPC Dpc,
    6.11    PVOID Context,
     7.1 --- a/xenpci/xenpci_pdo.c	Tue Mar 15 12:19:03 2011 +1100
     7.2 +++ b/xenpci/xenpci_pdo.c	Tue Mar 15 12:22:19 2011 +1100
     7.3 @@ -1607,4 +1607,4 @@ XenPci_Pdo_Resume(WDFDEVICE device)
     7.4    FUNCTION_EXIT();
     7.5  
     7.6    return STATUS_SUCCESS;
     7.7 -} 
     7.8 +}