@@ -72,12 +72,17 @@ static inline uint8_t msi_cap_sizeof(uint16_t flags)
//#define MSI_DEBUG
-#ifdef MSI_DEBUG
-# define MSI_DPRINTF(fmt, ...) \
- fprintf(stderr, "%s:%d " fmt, __func__, __LINE__, ## __VA_ARGS__)
-#else
-# define MSI_DPRINTF(fmt, ...) do { } while (0)
-#endif
+#ifndef MSI_DEBUG
+#define MSI_DEBUG 0
+#endif
+
+#define MSI_DPRINTF(fmt,
...) \
+ do
{ \
+ if (MSI_DEBUG)
{ \
+ fprintf(stderr, "%s:%d " fmt, __func__, __LINE__, ##
__VA_ARGS__); \
+
} \
+ } while (0)
+
#define MSI_DEV_PRINTF(dev, fmt, ...) \
MSI_DPRINTF("%s:%x " fmt, (dev)->name, (dev)->devfn, ## __VA_ARGS__)
@@ -43,11 +43,17 @@
#include "qemu/cutils.h"
//#define DEBUG_PCI
-#ifdef DEBUG_PCI
-# define PCI_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
-#else
-# define PCI_DPRINTF(format, ...) do { } while (0)
-#endif
+//
+#ifndef DEBUG_PCI
+#define DEBUG_PCI 0
+#endif
+
+#define PCI_DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_PCI) { \
+ fprintf(stderr, "pci: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
static void pcibus_dev_print(Monitor *mon, DeviceState *dev, int indent);
static char *pcibus_get_dev_path(DeviceState *dev);
@@ -27,12 +27,16 @@
/* debug PCI */
//#define DEBUG_PCI
-#ifdef DEBUG_PCI
-#define PCI_DPRINTF(fmt, ...) \
-do { printf("pci_host_data: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define PCI_DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_PCI
+#define DEBUG_PCI 0
+#endif
+
+#define PCI_DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_PCI) { \
+ fprintf(stderr, "pci_host_data: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
/*
* PCI address
@@ -30,12 +30,18 @@
#include "qemu/range.h"
//#define DEBUG_PCIE
-#ifdef DEBUG_PCIE
-# define PCIE_DPRINTF(fmt, ...) \
- fprintf(stderr, "%s:%d " fmt, __func__, __LINE__, ## __VA_ARGS__)
-#else
-# define PCIE_DPRINTF(fmt, ...) do {} while (0)
-#endif
+
+#ifndef DEBUG_PCIE
+#define DEBUG_PCIE 0
+#endif
+
+#define PCIE_DPRINTF(fmt,
...) \
+ do
{ \
+ if (DEBUG_PCIE)
{ \
+ fprintf(stderr, "%s:%d " fmt, __func__, __LINE__, ##
__VA_ARGS__); \
+
} \
+ } while (0)
+
#define PCIE_DEV_PRINTF(dev, fmt, ...) \
PCIE_DPRINTF("%s:%x "fmt, (dev)->name, (dev)->devfn, ## __VA_ARGS__)
@@ -32,12 +32,18 @@
#include "qapi/error.h"
//#define DEBUG_PCIE
-#ifdef DEBUG_PCIE
-# define PCIE_DPRINTF(fmt, ...) \
- fprintf(stderr, "%s:%d " fmt, __func__, __LINE__, ## __VA_ARGS__)
-#else
-# define PCIE_DPRINTF(fmt, ...) do {} while (0)
-#endif
+
+#ifndef DEBUG_PCIE
+#define DEBUG_PCIE 0
+#endif
+
+#define PCIE_DPRINTF(fmt,
...) \
+ do
{ \
+ if (DEBUG_PCIE)
{ \
+ fprintf(stderr, "%s:%d " fmt, __func__, __LINE__, ##
__VA_ARGS__) \
+
} \