win-pvdrivers

changeset 324:39e1a87d9189

get rid of unneeded (?) stuff that gcc complains about
Add DDKAPI to dispatch routines. These resolve to __stdcall on MinGW, which apparently it needs.
author Andy Grover <andy.grover@oracle.com>
date Thu Jun 19 15:22:00 2008 -0700 (2008-06-19)
parents c9b0dee6dfdd
children 06046da855ed
files xenpci/xenpci.c xenpci/xenpci.h
line diff
     1.1 --- a/xenpci/xenpci.c	Thu Jun 19 15:20:24 2008 -0700
     1.2 +++ b/xenpci/xenpci.c	Thu Jun 19 15:22:00 2008 -0700
     1.3 @@ -24,15 +24,17 @@ Foundation, Inc., 51 Franklin Street, Fi
     1.4  #define SHUTDOWN_PATH "control/shutdown"
     1.5  #define BALLOON_PATH "memory/target"
     1.6  
     1.7 -DRIVER_INITIALIZE DriverEntry;
     1.8 -
     1.9  #ifdef ALLOC_PRAGMA
    1.10  #pragma alloc_text (INIT, DriverEntry)
    1.11  #endif
    1.12  
    1.13  #pragma warning(disable : 4200) // zero-sized array
    1.14  
    1.15 -static NTSTATUS
    1.16 +#ifndef __MINGW32__
    1.17 +#define DDKAPI
    1.18 +#endif
    1.19 +
    1.20 +static DDKAPI NTSTATUS
    1.21  XenPci_Pnp(PDEVICE_OBJECT device_object, PIRP irp)
    1.22  {
    1.23    NTSTATUS status;
    1.24 @@ -46,7 +48,7 @@ XenPci_Pnp(PDEVICE_OBJECT device_object,
    1.25    return status;
    1.26  }
    1.27  
    1.28 -static NTSTATUS
    1.29 +static DDKAPI NTSTATUS
    1.30  XenPci_Power(PDEVICE_OBJECT device_object, PIRP irp)
    1.31  {
    1.32    NTSTATUS status;
    1.33 @@ -60,7 +62,7 @@ XenPci_Power(PDEVICE_OBJECT device_objec
    1.34    return status;
    1.35  }
    1.36  
    1.37 -static NTSTATUS
    1.38 +static DDKAPI NTSTATUS
    1.39  XenPci_Irp_Create(PDEVICE_OBJECT device_object, PIRP irp)
    1.40  {
    1.41    NTSTATUS status;
    1.42 @@ -74,7 +76,7 @@ XenPci_Irp_Create(PDEVICE_OBJECT device_
    1.43    return status;
    1.44  }
    1.45  
    1.46 -static NTSTATUS
    1.47 +static DDKAPI NTSTATUS
    1.48  XenPci_Irp_Close(PDEVICE_OBJECT device_object, PIRP irp)
    1.49  {
    1.50    NTSTATUS status;
    1.51 @@ -88,7 +90,7 @@ XenPci_Irp_Close(PDEVICE_OBJECT device_o
    1.52    return status;
    1.53  }
    1.54  
    1.55 -static NTSTATUS
    1.56 +static DDKAPI NTSTATUS
    1.57  XenPci_Irp_Read(PDEVICE_OBJECT device_object, PIRP irp)
    1.58  {
    1.59    NTSTATUS status;
    1.60 @@ -102,7 +104,7 @@ XenPci_Irp_Read(PDEVICE_OBJECT device_ob
    1.61    return status;
    1.62  }
    1.63  
    1.64 -static NTSTATUS
    1.65 +static DDKAPI NTSTATUS
    1.66  XenPci_Irp_Cleanup(PDEVICE_OBJECT device_object, PIRP irp)
    1.67  {
    1.68    NTSTATUS status;
    1.69 @@ -116,7 +118,7 @@ XenPci_Irp_Cleanup(PDEVICE_OBJECT device
    1.70    return status;
    1.71  }
    1.72  
    1.73 -static NTSTATUS
    1.74 +static DDKAPI NTSTATUS
    1.75  XenPci_AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT PhysicalDeviceObject)
    1.76  {
    1.77    NTSTATUS status;
    1.78 @@ -215,4 +217,4 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
    1.79    KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    1.80  
    1.81    return status;
    1.82 -}
    1.83 \ No newline at end of file
    1.84 +}
     2.1 --- a/xenpci/xenpci.h	Thu Jun 19 15:20:24 2008 -0700
     2.2 +++ b/xenpci/xenpci.h	Thu Jun 19 15:22:00 2008 -0700
     2.3 @@ -247,7 +247,11 @@ typedef struct
     2.4    PXENPCI_PDO_DEVICE_DATA context;
     2.5  } XEN_CHILD, *PXEN_CHILD;
     2.6  
     2.7 +#ifdef __GNUC__
     2.8 +#define SWINT(x) case x: asm ("int x"); break;
     2.9 +#else
    2.10  #define SWINT(x) case x: __asm { int x } break;
    2.11 +#endif
    2.12  
    2.13  #if defined(_X86_)
    2.14  static __inline VOID
    2.15 @@ -306,9 +310,6 @@ sw_interrupt(UCHAR intno)
    2.16    
    2.17  #include "hypercall.h"
    2.18  
    2.19 -typedef unsigned long xenbus_transaction_t;
    2.20 -typedef uint32_t XENSTORE_RING_IDX;
    2.21 -
    2.22  #define XBT_NIL ((xenbus_transaction_t)0)
    2.23  
    2.24  static __inline VOID