win-pvdrivers

changeset 398:e7292fd9e55a

Fixup xenpci for mingw build with DBG enabled.

add FUNCTION_EXIT_STATUS macro
run unix2dos to fix line endings
update mingw makefiles
use FUNCTION_* macros in xenpci
author Andy Grover <andy.grover@oracle.com>
date Thu Jul 17 10:33:40 2008 -0700 (2008-07-17)
parents a8f674f67fd6
children c61ee22db820
files common/include/xen_windows.h xenpci/evtchn.c xenpci/gnttbl.c xenpci/hypercall.h xenpci/hypercall_x86_mingw.h xenpci/makefile.mingw xenpci/xenbus.c xenpci/xenpci.c xenpci/xenpci_fdo.c xenpci/xenpci_pdo.c
line diff
     1.1 --- a/common/include/xen_windows.h	Thu Jul 17 09:34:42 2008 -0700
     1.2 +++ b/common/include/xen_windows.h	Thu Jul 17 10:33:40 2008 -0700
     1.3 @@ -61,10 +61,11 @@ typedef unsigned long xenbus_transaction
     1.4  #define wmb() KeMemoryBarrier()
     1.5  #define mb() KeMemoryBarrier()
     1.6  
     1.7 -#define FUNCTION_ENTER()      KdPrint((__DRIVER_NAME " --> %s\n", __FUNCTION__))
     1.8 -#define FUNCTION_EXIT()       KdPrint((__DRIVER_NAME " <-- %s\n", __FUNCTION__))
     1.9 -#define FUNCTION_ERROR_EXIT() KdPrint((__DRIVER_NAME " <-- %s (error path)\n", __FUNCTION__))
    1.10 -#define FUNCTION_CALLED()     KdPrint((__DRIVER_NAME " %s called (line %d)\n", __FUNCTION__, __LINE__))
    1.11 +#define FUNCTION_ENTER()       KdPrint((__DRIVER_NAME " --> %s\n", __FUNCTION__))
    1.12 +#define FUNCTION_EXIT()        KdPrint((__DRIVER_NAME " <-- %s\n", __FUNCTION__))
    1.13 +#define FUNCTION_EXIT_STATUS(_status) KdPrint((__DRIVER_NAME " <-- %s, status = %08x\n", __FUNCTION__, _status))
    1.14 +#define FUNCTION_ERROR_EXIT()  KdPrint((__DRIVER_NAME " <-- %s (error path)\n", __FUNCTION__))
    1.15 +#define FUNCTION_CALLED()      KdPrint((__DRIVER_NAME " %s called (line %d)\n", __FUNCTION__, __LINE__))
    1.16  #ifdef __MINGW32__
    1.17  #define FUNCTION_MSG(_x) _FUNCTION_MSG _x
    1.18  #define _FUNCTION_MSG(format, args...) KdPrint((__DRIVER_NAME " %s called: " format, __FUNCTION__, ##args))
     2.1 --- a/xenpci/evtchn.c	Thu Jul 17 09:34:42 2008 -0700
     2.2 +++ b/xenpci/evtchn.c	Thu Jul 17 10:33:40 2008 -0700
     2.3 @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fi
     2.4  
     2.5  #if defined(__MINGW32__)
     2.6    #define xchg(p1, p2) InterlockedExchange((xen_long_t * volatile)p1, p2)
     2.7 -  /* rest implemented in mingw_extras.c */
     2.8 +  /* rest implemented in mingw_extras.c */
     2.9  #elif defined(_X86_)
    2.10    #define xchg(p1, p2) _InterlockedExchange(p1, p2)
    2.11    #define synch_clear_bit(p1, p2) _interlockedbittestandreset(p2, p1)
    2.12 @@ -116,7 +116,7 @@ EvtChn_Bind(PVOID Context, evtchn_port_t
    2.13  {
    2.14    PXENPCI_DEVICE_DATA xpdd = Context;
    2.15  
    2.16 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    2.17 +  FUNCTION_ENTER();
    2.18    
    2.19    if (xpdd->ev_actions[Port].type != EVT_ACTION_TYPE_EMPTY)
    2.20    {
    2.21 @@ -133,7 +133,7 @@ EvtChn_Bind(PVOID Context, evtchn_port_t
    2.22  
    2.23    EvtChn_Unmask(Context, Port);
    2.24  
    2.25 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    2.26 +  FUNCTION_EXIT();
    2.27  
    2.28    return STATUS_SUCCESS;
    2.29  }
    2.30 @@ -143,7 +143,7 @@ EvtChn_BindDpc(PVOID Context, evtchn_por
    2.31  {
    2.32    PXENPCI_DEVICE_DATA xpdd = Context;
    2.33  
    2.34 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    2.35 +  FUNCTION_ENTER();
    2.36  
    2.37    if (xpdd->ev_actions[Port].type != EVT_ACTION_TYPE_EMPTY)
    2.38    {
    2.39 @@ -161,7 +161,7 @@ EvtChn_BindDpc(PVOID Context, evtchn_por
    2.40  
    2.41    EvtChn_Unmask(Context, Port);
    2.42  
    2.43 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    2.44 +  FUNCTION_EXIT();
    2.45  
    2.46    return STATUS_SUCCESS;
    2.47  }
    2.48 @@ -171,7 +171,7 @@ EvtChn_BindIrq(PVOID Context, evtchn_por
    2.49  {
    2.50    PXENPCI_DEVICE_DATA xpdd = Context;
    2.51  
    2.52 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    2.53 +  FUNCTION_ENTER();
    2.54  
    2.55    if (xpdd->ev_actions[Port].type != EVT_ACTION_TYPE_EMPTY)
    2.56    {
    2.57 @@ -188,7 +188,7 @@ EvtChn_BindIrq(PVOID Context, evtchn_por
    2.58  
    2.59    EvtChn_Unmask(Context, Port);
    2.60  
    2.61 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    2.62 +  FUNCTION_EXIT();
    2.63  
    2.64    return STATUS_SUCCESS;
    2.65  }
    2.66 @@ -256,7 +256,7 @@ EvtChn_Init(PXENPCI_DEVICE_DATA xpdd)
    2.67  {
    2.68    int i;
    2.69  
    2.70 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    2.71 +  FUNCTION_ENTER();
    2.72  
    2.73    for (i = 0; i < NR_EVENTS; i++)
    2.74    {
    2.75 @@ -284,7 +284,7 @@ EvtChn_Init(PXENPCI_DEVICE_DATA xpdd)
    2.76      xpdd->shared_info_area->vcpu_info[i].evtchn_upcall_mask = 0;
    2.77    }
    2.78    
    2.79 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    2.80 +  FUNCTION_EXIT();
    2.81    
    2.82    return STATUS_SUCCESS;
    2.83  }
     3.1 --- a/xenpci/gnttbl.c	Thu Jul 17 09:34:42 2008 -0700
     3.2 +++ b/xenpci/gnttbl.c	Thu Jul 17 10:33:40 2008 -0700
     3.3 @@ -130,7 +130,7 @@ static inline short InterlockedCompareEx
     3.4      : "r"(exch), "m"(*(dest)), "0"(comp)
     3.5      : "memory");
     3.6  
     3.7 -  KdPrint((__FUNC__ " Check that I work as expected!\n"));
     3.8 +  FUNCTION_MSG(("Check that I work as expected!\n"));
     3.9  
    3.10    return prev;
    3.11  }
     4.1 --- a/xenpci/hypercall.h	Thu Jul 17 09:34:42 2008 -0700
     4.2 +++ b/xenpci/hypercall.h	Thu Jul 17 10:33:40 2008 -0700
     4.3 @@ -35,13 +35,13 @@ hvm_get_parameter(PXENPCI_DEVICE_DATA xp
     4.4    struct xen_hvm_param a;
     4.5    int retval;
     4.6  
     4.7 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
     4.8 +  FUNCTION_ENTER();
     4.9    a.domid = DOMID_SELF;
    4.10    a.index = hvm_param;
    4.11    //a.value = via;
    4.12    retval = HYPERVISOR_hvm_op(xpdd, HVMOP_get_param, &a);
    4.13    KdPrint((__DRIVER_NAME " HYPERVISOR_hvm_op retval = %d\n", retval));
    4.14 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    4.15 +  FUNCTION_EXIT();
    4.16    return a.value;
    4.17  }
    4.18  
    4.19 @@ -51,14 +51,14 @@ hvm_set_parameter(PXENPCI_DEVICE_DATA xp
    4.20    struct xen_hvm_param a;
    4.21    int retval;
    4.22  
    4.23 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    4.24 +  FUNCTION_ENTER();
    4.25    a.domid = DOMID_SELF;
    4.26    a.index = hvm_param;
    4.27    a.value = value;
    4.28    //a.value = via;
    4.29    retval = HYPERVISOR_hvm_op(xpdd, HVMOP_set_param, &a);
    4.30    KdPrint((__DRIVER_NAME " HYPERVISOR_hvm_op retval = %d\n", retval));
    4.31 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    4.32 +  FUNCTION_EXIT();
    4.33    return retval;
    4.34  }
    4.35  
    4.36 @@ -68,10 +68,10 @@ hvm_shutdown(PXENPCI_DEVICE_DATA xpdd, u
    4.37    struct sched_shutdown ss;
    4.38    int retval;
    4.39  
    4.40 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    4.41 +  FUNCTION_ENTER();
    4.42    ss.reason = reason;
    4.43    retval = HYPERVISOR_sched_op(xpdd, SCHEDOP_shutdown, &ss);
    4.44 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    4.45 +  FUNCTION_EXIT();
    4.46    return retval;
    4.47  }
    4.48  
     5.1 --- a/xenpci/hypercall_x86_mingw.h	Thu Jul 17 09:34:42 2008 -0700
     5.2 +++ b/xenpci/hypercall_x86_mingw.h	Thu Jul 17 10:33:40 2008 -0700
     5.3 @@ -35,22 +35,22 @@
     5.4      : "memory" );                                               \
     5.5    (type)__res;                                                  \
     5.6  })
     5.7 -
     5.8 -#define _hypercall3(type, name, a1, a2, a3)			                \
     5.9 -({								                                              \
    5.10 -	long __res, __ign1, __ign2, __ign3;			                      \
    5.11 -	asm volatile (						                                    \
    5.12 +
    5.13 +#define _hypercall3(type, name, a1, a2, a3)			                \
    5.14 +({								                                              \
    5.15 +	long __res, __ign1, __ign2, __ign3;			                      \
    5.16 +	asm volatile (						                                    \
    5.17  	  "mov %4,%%eax; "                                            \
    5.18  	  "add $("STR(__HYPERVISOR_##name)" * 32),%%eax; "            \
    5.19    	"call *%%eax"                                               \
    5.20 -		: "=a" (__res), "=b" (__ign1), "=c" (__ign2), 	            \
    5.21 -		"=d" (__ign3)					                                      \
    5.22 -		: "1" ((long)(a1)), "2" ((long)(a2)),		                    \
    5.23 -		"3" ((long)(a3)), "r" (xpdd->hypercall_stubs)		            \
    5.24 -		: "memory" );					                                      \
    5.25 -	(type)__res;						                                      \
    5.26 -})
    5.27 -
    5.28 +		: "=a" (__res), "=b" (__ign1), "=c" (__ign2), 	            \
    5.29 +		"=d" (__ign3)					                                      \
    5.30 +		: "1" ((long)(a1)), "2" ((long)(a2)),		                    \
    5.31 +		"3" ((long)(a3)), "r" (xpdd->hypercall_stubs)		            \
    5.32 +		: "memory" );					                                      \
    5.33 +	(type)__res;						                                      \
    5.34 +})
    5.35 +
    5.36  
    5.37  static __inline void __cpuid(uint32_t output[4], uint32_t op)
    5.38  {
    5.39 @@ -96,13 +96,13 @@ HYPERVISOR_event_channel_op(PXENPCI_DEVI
    5.40  {
    5.41  	return _hypercall2(int, event_channel_op, cmd, arg);
    5.42  }
    5.43 -
    5.44 static inline int
    5.45 -HYPERVISOR_grant_table_op(
    5.46 -  PXENPCI_DEVICE_DATA xpdd,
    5.47 -  unsigned int cmd,
    5.48 -  void *uop,
    5.49 -  unsigned int count)
    5.50 -{
    5.51 -	return _hypercall3(int, grant_table_op, cmd, uop, count);
    5.52 -}
    5.53 -
    5.54 +
    5.55 static inline int
    5.56 +HYPERVISOR_grant_table_op(
    5.57 +  PXENPCI_DEVICE_DATA xpdd,
    5.58 +  unsigned int cmd,
    5.59 +  void *uop,
    5.60 +  unsigned int count)
    5.61 +{
    5.62 +	return _hypercall3(int, grant_table_op, cmd, uop, count);
    5.63 +}
    5.64 +
     6.1 --- a/xenpci/makefile.mingw	Thu Jul 17 09:34:42 2008 -0700
     6.2 +++ b/xenpci/makefile.mingw	Thu Jul 17 10:33:40 2008 -0700
     6.3 @@ -1,12 +1,8 @@
     6.4  W32API_PATH=/home/agrover/temp/w32api-3.11
     6.5  
     6.6 -CFLAGS = -Wall -L$(W32API_PATH)/lib/ddk -I$(W32API_PATH)/include/ddk -I../common/include -I../common/include/public -Wno-multichar -Wno-unknown-pragmas
     6.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
     6.8  
     6.9  xenpci.sys: xenpci.c xenbus.c evtchn.c gnttbl.c xenpci_fdo.c xenpci_pdo.c memory.c ../mingw/mingw_extras.c
    6.10 -	i586-mingw32msvc-gcc $(CFLAGS) -o $@ -s -shared -Wl,--entry,_load@8 -nostdlib $^ -lntoskrnl -lhal
    6.11 +	i586-mingw32msvc-gcc $(CFLAGS) -o $@ -shared -Wl,--entry,_DriverEntry@8 -nostartfiles -nostdlib $^ -lntoskrnl -lhal
    6.12  
    6.13 -test.exe: test.c kexec.h
    6.14 -	i586-mingw32msvc-gcc $(CFLAGS) -o $@ -s $^ -lkernel32
    6.15  
    6.16 -all: xenpci.sys
    6.17 -
     7.1 --- a/xenpci/xenbus.c	Thu Jul 17 09:34:42 2008 -0700
     7.2 +++ b/xenpci/xenbus.c	Thu Jul 17 10:33:40 2008 -0700
     7.3 @@ -604,7 +604,7 @@ XenBus_Resume(PXENPCI_DEVICE_DATA xpdd)
     7.4    NTSTATUS status;
     7.5    int i;
     7.6  
     7.7 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
     7.8 +  FUNCTION_ENTER();
     7.9  
    7.10    status = XenBus_Connect(xpdd);
    7.11    if (!NT_SUCCESS(status))
    7.12 @@ -620,7 +620,7 @@ XenBus_Resume(PXENPCI_DEVICE_DATA xpdd)
    7.13        XenBus_SendAddWatch(xpdd, XBT_NIL, xpdd->XenBus_WatchEntries[i].Path, i);
    7.14      }
    7.15    }
    7.16 -  KdPrint((__DRIVER_NAME " <-- XenBus_AddWatch\n"));
    7.17 +  FUNCTION_EXIT();
    7.18    
    7.19    return STATUS_SUCCESS;
    7.20  }
     8.1 --- a/xenpci/xenpci.c	Thu Jul 17 09:34:42 2008 -0700
     8.2 +++ b/xenpci/xenpci.c	Thu Jul 17 10:33:40 2008 -0700
     8.3 @@ -128,7 +128,7 @@ XenPci_AddDevice(PDRIVER_OBJECT DriverOb
     8.4    PXENPCI_DEVICE_DATA xpdd;
     8.5    //PWSTR InterfaceList;
     8.6  
     8.7 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
     8.8 +  FUNCTION_ENTER();
     8.9  
    8.10    status = IoCreateDevice(DriverObject,
    8.11      sizeof(XENPCI_DEVICE_DATA),
    8.12 @@ -185,18 +185,18 @@ XenPci_AddDevice(PDRIVER_OBJECT DriverOb
    8.13    
    8.14    fdo->Flags &= ~DO_DEVICE_INITIALIZING;
    8.15  
    8.16 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
    8.17 +  FUNCTION_EXIT();
    8.18    return status;
    8.19  }
    8.20  
    8.21 -NTSTATUS
    8.22 +NTSTATUS DDKAPI
    8.23  DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
    8.24  {
    8.25    NTSTATUS status = STATUS_SUCCESS;
    8.26  
    8.27    UNREFERENCED_PARAMETER(RegistryPath);
    8.28  
    8.29 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    8.30 +  FUNCTION_ENTER();
    8.31  
    8.32    //InitializeListHead(&ShutdownMsgList);
    8.33    //KeInitializeSpinLock(&ShutdownMsgLock);
    8.34 @@ -212,7 +212,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
    8.35    DriverObject->MajorFunction[IRP_MJ_WRITE] = NULL; //XenPci_Dummy;
    8.36    DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = NULL; //XenPci_Dummy;
    8.37  
    8.38 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    8.39 +  FUNCTION_EXIT();
    8.40  
    8.41    return status;
    8.42  }
     9.1 --- a/xenpci/xenpci_fdo.c	Thu Jul 17 09:34:42 2008 -0700
     9.2 +++ b/xenpci/xenpci_fdo.c	Thu Jul 17 10:33:40 2008 -0700
     9.3 @@ -52,7 +52,7 @@ XenPci_Power_Fdo(PDEVICE_OBJECT device_o
     9.4  
     9.5    UNREFERENCED_PARAMETER(device_object);
     9.6    
     9.7 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
     9.8 +  FUNCTION_ENTER();
     9.9  
    9.10    stack = IoGetCurrentIrpStackLocation(irp);
    9.11    power_type = stack->Parameters.Power.Type;
    9.12 @@ -86,7 +86,7 @@ XenPci_Power_Fdo(PDEVICE_OBJECT device_o
    9.13    IoSkipCurrentIrpStackLocation(irp);
    9.14    status =  PoCallDriver (xpdd->common.lower_do, irp);
    9.15    
    9.16 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    9.17 +  FUNCTION_EXIT();
    9.18  
    9.19    return status;
    9.20  }
    9.21 @@ -98,14 +98,14 @@ XenPci_Dummy_Fdo(PDEVICE_OBJECT device_o
    9.22    PIO_STACK_LOCATION stack;
    9.23    PXENPCI_DEVICE_DATA xpdd;
    9.24  
    9.25 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    9.26 +  FUNCTION_ENTER();
    9.27  
    9.28    xpdd = (PXENPCI_DEVICE_DATA)device_object->DeviceExtension;
    9.29    stack = IoGetCurrentIrpStackLocation(irp);
    9.30    IoSkipCurrentIrpStackLocation(irp);
    9.31    status = IoCallDriver(xpdd->common.lower_do, irp);
    9.32  
    9.33 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    9.34 +  FUNCTION_EXIT();
    9.35  
    9.36    return status;
    9.37  }
    9.38 @@ -135,7 +135,7 @@ XenPci_Init(PXENPCI_DEVICE_DATA xpdd)
    9.39    struct xen_add_to_physmap xatp;
    9.40    int ret;
    9.41  
    9.42 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    9.43 +  FUNCTION_ENTER();
    9.44  
    9.45    hvm_get_stubs(xpdd);
    9.46  
    9.47 @@ -156,7 +156,7 @@ XenPci_Init(PXENPCI_DEVICE_DATA xpdd)
    9.48    ret = HYPERVISOR_memory_op(xpdd, XENMEM_add_to_physmap, &xatp);
    9.49    KdPrint((__DRIVER_NAME " hypervisor memory op ret = %d\n", ret));
    9.50  
    9.51 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    9.52 +  FUNCTION_EXIT();
    9.53  
    9.54    return STATUS_SUCCESS;
    9.55  }
    9.56 @@ -168,14 +168,14 @@ XenPci_Pnp_IoCompletion(PDEVICE_OBJECT d
    9.57  
    9.58    UNREFERENCED_PARAMETER(device_object);
    9.59  
    9.60 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    9.61 +  FUNCTION_ENTER();
    9.62  
    9.63    if (irp->PendingReturned)
    9.64    {
    9.65      KeSetEvent(event, IO_NO_INCREMENT, FALSE);
    9.66    }
    9.67  
    9.68 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
    9.69 +  FUNCTION_EXIT();
    9.70  
    9.71    return STATUS_MORE_PROCESSING_REQUIRED;
    9.72  }
    9.73 @@ -201,7 +201,7 @@ XenPci_SendAndWaitForIrp(PDEVICE_OBJECT 
    9.74  
    9.75    UNREFERENCED_PARAMETER(device_object);
    9.76  
    9.77 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    9.78 +  FUNCTION_ENTER();
    9.79  
    9.80    KeInitializeEvent(&event, NotificationEvent, FALSE);
    9.81  
    9.82 @@ -218,7 +218,7 @@ XenPci_SendAndWaitForIrp(PDEVICE_OBJECT 
    9.83      status = irp->IoStatus.Status;
    9.84    }
    9.85  
    9.86 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
    9.87 +  FUNCTION_EXIT();
    9.88  
    9.89    return status;
    9.90  }
    9.91 @@ -232,7 +232,7 @@ XenPci_ProcessShutdownIrp(PXENPCI_DEVICE
    9.92    KIRQL old_irql;
    9.93    ULONG length;
    9.94  
    9.95 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    9.96 +  FUNCTION_ENTER();
    9.97  
    9.98    KeAcquireSpinLock(&xpdd->shutdown_ring_lock, &old_irql);
    9.99    if (xpdd->shutdown_irp)
   9.100 @@ -276,7 +276,7 @@ XenPci_ProcessShutdownIrp(PXENPCI_DEVICE
   9.101      status = STATUS_SUCCESS;
   9.102    }  
   9.103  
   9.104 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.105 +  FUNCTION_EXIT();
   9.106  
   9.107    return status;
   9.108  }
   9.109 @@ -287,7 +287,7 @@ XenBus_ShutdownIoCancel(PDEVICE_OBJECT d
   9.110    PXENPCI_DEVICE_DATA xpdd;
   9.111    KIRQL old_irql;
   9.112  
   9.113 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.114 +  FUNCTION_ENTER();
   9.115  
   9.116    xpdd = (PXENPCI_DEVICE_DATA)device_object->DeviceExtension;
   9.117    IoReleaseCancelSpinLock(irp->CancelIrql);
   9.118 @@ -302,7 +302,7 @@ XenBus_ShutdownIoCancel(PDEVICE_OBJECT d
   9.119    KeReleaseSpinLock(&xpdd->shutdown_ring_lock, old_irql);
   9.120    IoCompleteRequest(irp, IO_NO_INCREMENT);
   9.121  
   9.122 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.123 +  FUNCTION_EXIT();
   9.124  }
   9.125  
   9.126  struct {
   9.127 @@ -320,7 +320,7 @@ XenPci_CompleteResume(PDEVICE_OBJECT dev
   9.128    PXEN_CHILD child;
   9.129  
   9.130    UNREFERENCED_PARAMETER(context);
   9.131 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.132 +  FUNCTION_ENTER();
   9.133  
   9.134    xpdd = (PXENPCI_DEVICE_DATA)device_object->DeviceExtension;
   9.135  
   9.136 @@ -346,7 +346,7 @@ XenPci_CompleteResume(PDEVICE_OBJECT dev
   9.137  
   9.138    xpdd->suspend_state = SUSPEND_STATE_NONE;
   9.139  
   9.140 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   9.141 +  FUNCTION_EXIT();
   9.142  }
   9.143  
   9.144  /* Called at DISPATCH_LEVEL */
   9.145 @@ -369,7 +369,8 @@ XenPci_Suspend(
   9.146    UNREFERENCED_PARAMETER(Dpc);
   9.147    UNREFERENCED_PARAMETER(SystemArgument2);
   9.148  
   9.149 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ " (CPU = %d)\n", KeGetCurrentProcessorNumber()));
   9.150 +  FUNCTION_ENTER();
   9.151 +  FUNCTION_MSG(("(CPU = %d)\n", KeGetCurrentProcessorNumber()));
   9.152  
   9.153    if (KeGetCurrentProcessorNumber() != 0)
   9.154    {
   9.155 @@ -386,9 +387,10 @@ XenPci_Suspend(
   9.156      KeMemoryBarrier();
   9.157      InterlockedDecrement(&suspend_info->nr_spinning);    
   9.158      KdPrint((__DRIVER_NAME "     ...done spinning\n"));
   9.159 -    KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ " (cpu = %d)\n", KeGetCurrentProcessorNumber()));
   9.160 +    FUNCTION_MSG(("(CPU = %d)\n", KeGetCurrentProcessorNumber()));
   9.161      KeLowerIrql(old_irql);
   9.162      KeSetEvent(&suspend_info->stopped_spinning_event, IO_NO_INCREMENT, FALSE);
   9.163 +    FUNCTION_EXIT();
   9.164      return;
   9.165    }
   9.166    ActiveProcessorCount = (ULONG)KeNumberProcessors;
   9.167 @@ -433,11 +435,11 @@ XenPci_Suspend(
   9.168  	work_item = IoAllocateWorkItem(xpdd->common.fdo);
   9.169  	IoQueueWorkItem(work_item, XenPci_CompleteResume, DelayedWorkQueue, suspend_info);
   9.170    
   9.171 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   9.172 +  FUNCTION_EXIT();
   9.173  }
   9.174  
   9.175  /* Called at PASSIVE_LEVEL */
   9.176 -static VOID
   9.177 +static VOID DDKAPI
   9.178  XenPci_BeginSuspend(PDEVICE_OBJECT device_object, PVOID context)
   9.179  {
   9.180    //KAFFINITY ActiveProcessorMask = 0; // this is for Vista+
   9.181 @@ -449,7 +451,7 @@ XenPci_BeginSuspend(PDEVICE_OBJECT devic
   9.182    KIRQL OldIrql;
   9.183  
   9.184    UNREFERENCED_PARAMETER(context);
   9.185 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.186 +  FUNCTION_ENTER();
   9.187  
   9.188    if (xpdd->suspend_state == SUSPEND_STATE_NONE)
   9.189    {
   9.190 @@ -479,7 +481,7 @@ XenPci_BeginSuspend(PDEVICE_OBJECT devic
   9.191      }
   9.192      KeLowerIrql(OldIrql);
   9.193    }
   9.194 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   9.195 +  FUNCTION_EXIT();
   9.196  }
   9.197  
   9.198  static void
   9.199 @@ -493,7 +495,7 @@ XenPci_ShutdownHandler(char *path, PVOID
   9.200  
   9.201    UNREFERENCED_PARAMETER(path);
   9.202  
   9.203 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.204 +  FUNCTION_ENTER();
   9.205  
   9.206    res = XenBus_Read(xpdd, XBT_NIL, SHUTDOWN_PATH, &value);
   9.207    if (res)
   9.208 @@ -533,7 +535,7 @@ XenPci_ShutdownHandler(char *path, PVOID
   9.209  
   9.210    //XenPci_FreeMem(value);
   9.211  
   9.212 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   9.213 +  FUNCTION_EXIT();
   9.214  }
   9.215  
   9.216  static VOID
   9.217 @@ -546,7 +548,7 @@ XenPci_SysrqHandler(char *path, PVOID co
   9.218  
   9.219    UNREFERENCED_PARAMETER(path);
   9.220  
   9.221 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.222 +  FUNCTION_ENTER();
   9.223  
   9.224    XenBus_Read(xpdd, XBT_NIL, SYSRQ_PATH, &value);
   9.225  
   9.226 @@ -583,7 +585,7 @@ XenPci_SysrqHandler(char *path, PVOID co
   9.227      break;
   9.228    }
   9.229  
   9.230 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   9.231 +  FUNCTION_EXIT();
   9.232  }
   9.233  
   9.234  static VOID
   9.235 @@ -680,7 +682,7 @@ XenPci_Pnp_StartDevice(PDEVICE_OBJECT de
   9.236  
   9.237    UNREFERENCED_PARAMETER(device_object);
   9.238  
   9.239 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.240 +  FUNCTION_ENTER();
   9.241  
   9.242    stack = IoGetCurrentIrpStackLocation(irp);
   9.243  
   9.244 @@ -738,7 +740,7 @@ XenPci_Pnp_StartDevice(PDEVICE_OBJECT de
   9.245  
   9.246    XenPci_QueueWorkItem(device_object, XenPci_Pnp_StartDeviceCallback, irp);
   9.247  
   9.248 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.249 +  FUNCTION_EXIT();
   9.250    
   9.251    return STATUS_PENDING;
   9.252  }
   9.253 @@ -751,12 +753,12 @@ XenPci_Pnp_StopDevice(PDEVICE_OBJECT dev
   9.254    UNREFERENCED_PARAMETER(device_object);
   9.255    UNREFERENCED_PARAMETER(context);
   9.256  
   9.257 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.258 +  FUNCTION_ENTER();
   9.259  
   9.260    irp->IoStatus.Status = status;
   9.261    IoCompleteRequest(irp, IO_NO_INCREMENT);
   9.262  
   9.263 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.264 +  FUNCTION_EXIT();
   9.265  
   9.266    return irp->IoStatus.Status;
   9.267  }
   9.268 @@ -769,7 +771,7 @@ XenPci_Pnp_QueryStopRemoveDevice(PDEVICE
   9.269  
   9.270    UNREFERENCED_PARAMETER(device_object);
   9.271  
   9.272 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.273 +  FUNCTION_ENTER();
   9.274  
   9.275    if (xpdd->common.device_usage_paging
   9.276      || xpdd->common.device_usage_dump
   9.277 @@ -785,7 +787,7 @@ XenPci_Pnp_QueryStopRemoveDevice(PDEVICE
   9.278      status = IoCallDriver(xpdd->common.lower_do, irp);
   9.279    }
   9.280    
   9.281 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.282 +  FUNCTION_EXIT();
   9.283  
   9.284    return status;
   9.285  }
   9.286 @@ -798,14 +800,14 @@ XenPci_Pnp_RemoveDevice(PDEVICE_OBJECT d
   9.287  
   9.288    UNREFERENCED_PARAMETER(device_object);
   9.289  
   9.290 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.291 +  FUNCTION_ENTER();
   9.292  
   9.293    irp->IoStatus.Status = STATUS_SUCCESS;
   9.294    IoSkipCurrentIrpStackLocation(irp);
   9.295    status = IoCallDriver(xpdd->common.lower_do, irp);
   9.296    IoDetachDevice(xpdd->common.lower_do);
   9.297  
   9.298 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.299 +  FUNCTION_EXIT();
   9.300  
   9.301    return status;
   9.302  }
   9.303 @@ -828,7 +830,7 @@ XenPci_Pnp_QueryBusRelationsCallback(PDE
   9.304    CHAR path[128];
   9.305    PDEVICE_OBJECT pdo;
   9.306    
   9.307 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.308 +  FUNCTION_ENTER();
   9.309  
   9.310    msg = XenBus_List(xpdd, XBT_NIL, "device", &devices);
   9.311    if (!msg)
   9.312 @@ -949,7 +951,7 @@ XenPci_Pnp_QueryBusRelationsCallback(PDE
   9.313  
   9.314    IoCompleteRequest (irp, IO_NO_INCREMENT);
   9.315  
   9.316 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.317 +  FUNCTION_EXIT();
   9.318  }
   9.319  
   9.320  static NTSTATUS
   9.321 @@ -959,7 +961,7 @@ XenPci_Pnp_QueryBusRelations(PDEVICE_OBJ
   9.322  
   9.323    UNREFERENCED_PARAMETER(device_object);
   9.324  
   9.325 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.326 +  FUNCTION_ENTER();
   9.327  
   9.328    IoMarkIrpPending(irp);
   9.329  
   9.330 @@ -967,7 +969,7 @@ XenPci_Pnp_QueryBusRelations(PDEVICE_OBJ
   9.331  
   9.332    XenPci_QueueWorkItem(device_object, XenPci_Pnp_QueryBusRelationsCallback, irp);
   9.333  
   9.334 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.335 +  FUNCTION_EXIT();
   9.336  
   9.337    return STATUS_PENDING;
   9.338  }
   9.339 @@ -983,8 +985,9 @@ XenPci_Pnp_FilterResourceRequirementsCal
   9.340    ULONG ird;
   9.341  
   9.342    UNREFERENCED_PARAMETER(device_object);
   9.343 -  
   9.344 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ " (status = %08X)\n", irp->IoStatus.Status));
   9.345 +
   9.346 +  FUNCTION_ENTER();
   9.347 +  FUNCTION_MSG(("IoStatus.status = %08X\n", irp->IoStatus.Status));
   9.348    
   9.349    irrl = (PIO_RESOURCE_REQUIREMENTS_LIST)irp->IoStatus.Information;
   9.350    for (irl = 0; irl < irrl->AlternativeLists; irl++)
   9.351 @@ -1000,9 +1003,7 @@ XenPci_Pnp_FilterResourceRequirementsCal
   9.352    irp->IoStatus.Status = status;
   9.353    IoCompleteRequest (irp, IO_NO_INCREMENT);
   9.354    
   9.355 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.356 -
   9.357 -  return;
   9.358 +  FUNCTION_EXIT();
   9.359  }
   9.360  
   9.361  static NTSTATUS
   9.362 @@ -1012,7 +1013,7 @@ XenPci_Pnp_FilterResourceRequirements(PD
   9.363  
   9.364    UNREFERENCED_PARAMETER(device_object);
   9.365  
   9.366 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.367 +  FUNCTION_ENTER();
   9.368  
   9.369    IoMarkIrpPending(irp);
   9.370  
   9.371 @@ -1020,7 +1021,7 @@ XenPci_Pnp_FilterResourceRequirements(PD
   9.372  
   9.373    XenPci_QueueWorkItem(device_object, XenPci_Pnp_FilterResourceRequirementsCallback, irp);
   9.374  
   9.375 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.376 +  FUNCTION_EXIT();
   9.377  
   9.378    return STATUS_PENDING;
   9.379  }
   9.380 @@ -1034,7 +1035,7 @@ XenPci_Pnp_DeviceUsageNotification(PDEVI
   9.381    
   9.382    UNREFERENCED_PARAMETER(context);
   9.383  
   9.384 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__"\n"));
   9.385 +  FUNCTION_ENTER();
   9.386  
   9.387    xpdd = (PXENPCI_DEVICE_DATA)device_object->DeviceExtension;
   9.388    stack = IoGetCurrentIrpStackLocation(irp);
   9.389 @@ -1078,7 +1079,7 @@ XenPci_Pnp_DeviceUsageNotification(PDEVI
   9.390    }
   9.391    IoCompleteRequest(irp, IO_NO_INCREMENT);
   9.392  
   9.393 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.394 +  FUNCTION_EXIT();
   9.395    
   9.396    return status;
   9.397  }
   9.398 @@ -1242,14 +1243,14 @@ XenPci_Irp_Create_Fdo(PDEVICE_OBJECT dev
   9.399    PXENPCI_DEVICE_DATA xpdd;
   9.400    NTSTATUS status;
   9.401  
   9.402 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.403 +  FUNCTION_ENTER();
   9.404  
   9.405    xpdd = (PXENPCI_DEVICE_DATA)device_object->DeviceExtension;
   9.406    status = STATUS_SUCCESS;    
   9.407    irp->IoStatus.Status = status;
   9.408    IoCompleteRequest(irp, IO_NO_INCREMENT);
   9.409  
   9.410 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.411 +  FUNCTION_EXIT();
   9.412  
   9.413    return status;
   9.414  }
   9.415 @@ -1260,7 +1261,7 @@ XenPci_Irp_Close_Fdo(PDEVICE_OBJECT devi
   9.416    PXENPCI_DEVICE_DATA xpdd;
   9.417    NTSTATUS status;
   9.418  
   9.419 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.420 +  FUNCTION_ENTER();
   9.421  
   9.422    // wait until pending irp's 
   9.423    xpdd = (PXENPCI_DEVICE_DATA)device_object->DeviceExtension;
   9.424 @@ -1268,7 +1269,7 @@ XenPci_Irp_Close_Fdo(PDEVICE_OBJECT devi
   9.425    irp->IoStatus.Status = status;
   9.426    IoCompleteRequest(irp, IO_NO_INCREMENT);
   9.427  
   9.428 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.429 +  FUNCTION_EXIT();
   9.430  
   9.431    return status;
   9.432  }
   9.433 @@ -1281,7 +1282,7 @@ XenPci_Irp_Read_Fdo(PDEVICE_OBJECT devic
   9.434    PIO_STACK_LOCATION stack;
   9.435    KIRQL old_irql;
   9.436  
   9.437 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.438 +  FUNCTION_ENTER();
   9.439  
   9.440    xpdd = (PXENPCI_DEVICE_DATA)device_object->DeviceExtension;
   9.441    stack = IoGetCurrentIrpStackLocation(irp);
   9.442 @@ -1303,7 +1304,8 @@ XenPci_Irp_Read_Fdo(PDEVICE_OBJECT devic
   9.443      KeReleaseSpinLock(&xpdd->shutdown_ring_lock, old_irql);
   9.444      status = XenPci_ProcessShutdownIrp(xpdd);
   9.445    }
   9.446 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.447 +
   9.448 +  FUNCTION_EXIT();
   9.449  
   9.450    return status;
   9.451  }
   9.452 @@ -1316,13 +1318,13 @@ XenPci_Irp_Cleanup_Fdo(PDEVICE_OBJECT de
   9.453  
   9.454    UNREFERENCED_PARAMETER(device_object);
   9.455  
   9.456 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   9.457 +  FUNCTION_ENTER();
   9.458    
   9.459    status = STATUS_SUCCESS;
   9.460    irp->IoStatus.Status = status;
   9.461    IoCompleteRequest(irp, IO_NO_INCREMENT);
   9.462    
   9.463 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   9.464 +  FUNCTION_EXIT();
   9.465  
   9.466    return status;
   9.467  }
    10.1 --- a/xenpci/xenpci_pdo.c	Thu Jul 17 09:34:42 2008 -0700
    10.2 +++ b/xenpci/xenpci_pdo.c	Thu Jul 17 10:33:40 2008 -0700
    10.3 @@ -372,7 +372,7 @@ XenPci_XenShutdownDevice(PVOID Context)
    10.4    PVOID setting;
    10.5    PVOID value;
    10.6  
    10.7 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    10.8 +  FUNCTION_ENTER();
    10.9  
   10.10    if (xppdd->backend_state == XenbusStateConnected)
   10.11    {
   10.12 @@ -415,7 +415,7 @@ XenPci_XenShutdownDevice(PVOID Context)
   10.13      xppdd->assigned_resources_start = NULL;
   10.14    }
   10.15  
   10.16 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   10.17 +  FUNCTION_EXIT();
   10.18  
   10.19    return STATUS_SUCCESS;
   10.20  }
   10.21 @@ -444,7 +444,7 @@ XenPci_XenConfigDeviceSpecifyBuffers(PVO
   10.22    grant_ref_t gref;
   10.23    BOOLEAN done_xenbus_init = FALSE;
   10.24   
   10.25 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   10.26 +  FUNCTION_ENTER();
   10.27  
   10.28    in_ptr = src;
   10.29    out_ptr = dst;
   10.30 @@ -604,7 +604,7 @@ XenPci_XenConfigDeviceSpecifyBuffers(PVO
   10.31    ADD_XEN_INIT_RSP(&out_ptr, XEN_INIT_TYPE_END, NULL, NULL);
   10.32    
   10.33  error:
   10.34 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ " (%08x\n", status));
   10.35 +  FUNCTION_EXIT_STATUS(status);
   10.36  
   10.37    return status;
   10.38  }
   10.39 @@ -680,12 +680,14 @@ XenPci_Resume(PDEVICE_OBJECT device_obje
   10.40    ULONG old_backend_state;
   10.41    PUCHAR src, dst;
   10.42  
   10.43 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   10.44 +  FUNCTION_ENTER();
   10.45  
   10.46    old_backend_state = xppdd->backend_state;
   10.47    status = XenPci_GetBackendAndAddWatch(device_object);
   10.48 -  if (!NT_SUCCESS(status))
   10.49 +  if (!NT_SUCCESS(status)) {
   10.50 +    FUNCTION_ERROR_EXIT();
   10.51      return status;
   10.52 +  }
   10.53    
   10.54    if (xppdd->common.current_pnp_state == Started && old_backend_state == XenbusStateConnected)
   10.55    {
   10.56 @@ -693,6 +695,7 @@ XenPci_Resume(PDEVICE_OBJECT device_obje
   10.57      if (XenPci_ChangeFrontendState(xppdd, XenbusStateInitialising, XenbusStateInitWait, 30000) != STATUS_SUCCESS)
   10.58      {
   10.59        // this is probably an unrecoverable situation...
   10.60 +      FUNCTION_ERROR_EXIT();
   10.61        return STATUS_UNSUCCESSFUL;
   10.62      }
   10.63      if (xppdd->assigned_resources_ptr)
   10.64 @@ -713,9 +716,13 @@ XenPci_Resume(PDEVICE_OBJECT device_obje
   10.65      if (XenPci_ChangeFrontendState(xppdd, XenbusStateConnected, XenbusStateConnected, 30000) != STATUS_SUCCESS)
   10.66      {
   10.67        // this is definitely an unrecoverable situation...
   10.68 +      FUNCTION_ERROR_EXIT();
   10.69        return STATUS_UNSUCCESSFUL;
   10.70      }
   10.71    }
   10.72 +
   10.73 +  FUNCTION_EXIT();
   10.74 +
   10.75    return STATUS_SUCCESS;
   10.76  } 
   10.77  
   10.78 @@ -731,15 +738,17 @@ XenPci_Pnp_StartDevice(PDEVICE_OBJECT de
   10.79    ULONG i;
   10.80    char path[128];
   10.81   
   10.82 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   10.83 +  FUNCTION_ENTER();
   10.84  
   10.85    DUMP_CURRENT_PNP_STATE(xppdd);
   10.86    
   10.87    stack = IoGetCurrentIrpStackLocation(irp);
   10.88  
   10.89    status = XenPci_GetBackendAndAddWatch(device_object);
   10.90 -  if (!NT_SUCCESS(status))
   10.91 +  if (!NT_SUCCESS(status)) {
   10.92 +    FUNCTION_ERROR_EXIT();
   10.93      return status;
   10.94 +  }
   10.95  
   10.96    prl = &stack->Parameters.StartDevice.AllocatedResourcesTranslated->List[0].PartialResourceList;
   10.97    for (i = 0; i < prl->Count; i++)
   10.98 @@ -763,18 +772,18 @@ XenPci_Pnp_StartDevice(PDEVICE_OBJECT de
   10.99        xppdd->assigned_resources_start = xppdd->assigned_resources_ptr = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, XENPCI_POOL_TAG);
  10.100        
  10.101        status = XenPci_XenConfigDevice(xppdd);
  10.102 -
  10.103        if (!NT_SUCCESS(status))
  10.104        {
  10.105          RtlStringCbPrintfA(path, ARRAY_SIZE(path), "%s/state", xppdd->backend_path);
  10.106          XenBus_RemWatch(xpdd, XBT_NIL, path, XenPci_BackEndStateHandler, xppdd);
  10.107 +        FUNCTION_ERROR_EXIT();
  10.108          return status;
  10.109        }
  10.110      }
  10.111    }
  10.112    SET_PNP_STATE(&xppdd->common, Started);
  10.113    
  10.114 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
  10.115 +  FUNCTION_EXIT();
  10.116  
  10.117    return STATUS_SUCCESS;
  10.118  }
  10.119 @@ -789,7 +798,7 @@ XenPci_Pnp_RemoveDevice(PDEVICE_OBJECT d
  10.120  
  10.121    UNREFERENCED_PARAMETER(irp);
  10.122  
  10.123 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
  10.124 +  FUNCTION_ENTER();
  10.125  
  10.126    DUMP_CURRENT_PNP_STATE(xppdd);
  10.127  
  10.128 @@ -807,7 +816,7 @@ XenPci_Pnp_RemoveDevice(PDEVICE_OBJECT d
  10.129      IoDeleteDevice(xppdd->common.pdo);
  10.130    }
  10.131    
  10.132 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ " (status = %08x)\n", status));
  10.133 +  FUNCTION_EXIT_STATUS(status);
  10.134  
  10.135    return status;
  10.136  }
  10.137 @@ -1184,12 +1193,12 @@ XenPci_Irp_Create_Pdo(PDEVICE_OBJECT dev
  10.138  
  10.139    UNREFERENCED_PARAMETER(device_object);
  10.140  
  10.141 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
  10.142 +  FUNCTION_ENTER();
  10.143  
  10.144    status = irp->IoStatus.Status;
  10.145    IoCompleteRequest(irp, IO_NO_INCREMENT);
  10.146  
  10.147 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
  10.148 +  FUNCTION_EXIT();
  10.149  
  10.150    return status;
  10.151  }
  10.152 @@ -1201,12 +1210,12 @@ XenPci_Irp_Close_Pdo(PDEVICE_OBJECT devi
  10.153  
  10.154    UNREFERENCED_PARAMETER(device_object);
  10.155  
  10.156 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
  10.157 +  FUNCTION_ENTER();
  10.158  
  10.159    status = irp->IoStatus.Status;
  10.160    IoCompleteRequest(irp, IO_NO_INCREMENT);
  10.161  
  10.162 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
  10.163 +  FUNCTION_EXIT();
  10.164  
  10.165    return status;
  10.166  }
  10.167 @@ -1218,12 +1227,12 @@ XenPci_Irp_Read_Pdo(PDEVICE_OBJECT devic
  10.168  
  10.169    UNREFERENCED_PARAMETER(device_object);
  10.170  
  10.171 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
  10.172 +  FUNCTION_ENTER();
  10.173  
  10.174    status = irp->IoStatus.Status;
  10.175    IoCompleteRequest(irp, IO_NO_INCREMENT);
  10.176  
  10.177 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
  10.178 +  FUNCTION_EXIT();
  10.179  
  10.180    return status;
  10.181  }
  10.182 @@ -1235,12 +1244,12 @@ XenPci_Irp_Cleanup_Pdo(PDEVICE_OBJECT de
  10.183  
  10.184    UNREFERENCED_PARAMETER(device_object);
  10.185  
  10.186 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
  10.187 +  FUNCTION_ENTER();
  10.188    
  10.189    status = irp->IoStatus.Status;
  10.190    IoCompleteRequest(irp, IO_NO_INCREMENT);
  10.191    
  10.192 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
  10.193 +  FUNCTION_EXIT();
  10.194  
  10.195    return status;
  10.196  }