@@ -39,13 +39,16 @@
#include "qom/qom-qobject.h"
#include "qapi/qmp/qint.h"
-//#define DEBUG
-#ifdef DEBUG
-# define ACPI_PCIHP_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
-#else
-# define ACPI_PCIHP_DPRINTF(format, ...) do { } while (0)
-#endif
+#ifndef DEBUG
+#define DEBUG 0
+#endif
+
+#define ACPI_PCIHP_DPRINTF(fmt, ...) do { \
+ if (DEBUG) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
#define ACPI_PCIHP_ADDR 0xae00
#define ACPI_PCIHP_SIZE 0x0014
@@ -42,13 +42,15 @@
#include "hw/xen/xen.h"
#include "qom/cpu.h"
-//#define DEBUG
-
-#ifdef DEBUG
-# define PIIX4_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
-#else
-# define PIIX4_DPRINTF(format, ...) do { } while (0)
-#endif
+#ifndef DEBUG
+#define DEBUG 0
+#endif
+
+#define PIIX4_DPRINTF(fmt, ...) do { \
+ if (DEBUG) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
#define GPE_BASE 0xafe0
#define GPE_LEN 4
@@ -59,11 +59,16 @@
- Enhance UART with modem signals
*/
-#ifdef DEBUG
-# define DPRINTF(format, ...) printf(format , ## __VA_ARGS__)
-#else
-# define DPRINTF(format, ...) do { } while (0)
-#endif
+#ifndef DEBUG
+#define DEBUG 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
static struct {
hwaddr io_base;
@@ -1022,7 +1027,7 @@ static void
strongarm_uart_update_parameters(StrongARMUARTState *s)
s->char_transmit_time = (NANOSECONDS_PER_SECOND / speed) * frame_size;
qemu_chr_fe_ioctl(&s->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp);
- DPRINTF(stderr, "%s speed=%d parity=%c data=%d stop=%d\n",
s->chr->label,
+ DPRINTF("%s speed=%d parity=%c data=%d stop=%d\n", s->chr.chr->label,
speed, parity, data_bits, stop_bits);
}
@@ -27,12 +27,16 @@
#include "exec/address-spaces.h"
#include "sysemu/qtest.h"
-#ifdef DEBUG_Z2
-#define DPRINTF(fmt, ...) \
- printf(fmt, ## __VA_ARGS__)
-#else
-#define DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_Z2
+#define DEBUG_Z2 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_Z2) { \
+ fprintf(stderr, "z2: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
static const struct keymap map[0x100] = {
[0 ... 0xff] = { -1, -1 },
@@ -26,13 +26,17 @@
#define LM4549_DUMP_DAC_INPUT 1
#endif
-#ifdef LM4549_DEBUG
-#define DPRINTF(fmt, ...) \
-do { printf("lm4549: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
+#ifndef LM4549_DEBUG
+#define LM4549_DEBUG 0
#endif
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (LM4549_DEBUG) { \
+ fprintf(stderr, "lm4549: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
#if defined(LM4549_DUMP_DAC_INPUT)
static FILE *fp_dac_input;
#endif
@@ -159,7 +163,7 @@ uint32_t lm4549_read(lm4549_state *s, hwaddr offset)
assert(offset < 128);
value = regfile[offset];
- DPRINTF("read [0x%02x] = 0x%04x\n", offset, value);
+ DPRINTF("read [0x%02x] = 0x%04x\n", (int) offset, value);
return value;
}
@@ -170,7 +174,7 @@ void lm4549_write(lm4549_state *s,
uint16_t *regfile = s->regfile;
assert(offset < 128);
- DPRINTF("write [0x%02x] = 0x%04x\n", offset, value);
+ DPRINTF("write [0x%02x] = 0x%04x\n", (int) offset, value);
switch (offset) {
case LM4549_Reset:
@@ -55,15 +55,15 @@ do { \
exit(1); \
} while(0)
-/* #define PFLASH_DEBUG */
-#ifdef PFLASH_DEBUG
-#define DPRINTF(fmt, ...) \
-do { \
- fprintf(stderr, "PFLASH: " fmt , ## __VA_ARGS__); \
-} while (0)
-#else
-#define DPRINTF(fmt, ...) do { } while (0)
-#endif
+#ifndef PFLASH_DEBUG
+#define PFLASH_DEBUG 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (PFLASH_DEBUG) { \
+ fprintf(stderr, "PFLASH: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
#define CFI_PFLASH01(obj) OBJECT_CHECK(pflash_t, (obj), TYPE_CFI_PFLASH01)
@@ -46,14 +46,17 @@
#include "hw/sysbus.h"
//#define PFLASH_DEBUG
-#ifdef PFLASH_DEBUG
-#define DPRINTF(fmt, ...) \
-do { \
- fprintf(stderr, "PFLASH: " fmt , ## __VA_ARGS__); \
-} while (0)
-#else
-#define DPRINTF(fmt, ...) do { } while (0)
-#endif
+
+#ifndef PFLASH_DEBUG
+#define PFLASH_DEBUG 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (PFLASH_DEBUG) { \
+ fprintf(stderr, "PFLASH: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
+
#define PFLASH_LAZY_ROMD_THRESHOLD 42
@@ -13,14 +13,16 @@
#include "qemu/bitops.h"
#include "sysemu/char.h"
-/* #define DEBUG_IPOCTAL */
-#ifdef DEBUG_IPOCTAL
-#define DPRINTF2(fmt, ...) \
- do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF2(fmt, ...) do { } while (0)
-#endif
+#ifndef DEBUG_IPOCTAL
+#define DEBUG_IPOCTAL 0
+#endif
+
+#define DPRINTF2(fmt, ...) do { \
+ if (DEBUG_IPOCTAL) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
#define DPRINTF(fmt, ...) DPRINTF2("IP-Octal: " fmt, ## __VA_ARGS__)
@@ -504,11 +506,11 @@ static void hostdev_event(void *opaque, int event)
SCC2698Channel *ch = opaque;
switch (event) {
case CHR_EVENT_OPENED:
- DPRINTF("Device %s opened\n", ch->dev->label);
+ DPRINTF("Device %s opened\n", ch->dev.chr->label);
break;
case CHR_EVENT_BREAK: {
uint8_t zero = 0;
- DPRINTF("Device %s received break\n", ch->dev->label);
+ DPRINTF("Device %s received break\n", ch->dev.chr->label);
if (!(ch->sr & SR_BREAK)) {
IPOctalState *dev = ch->ipoctal;
@@ -528,7 +530,7 @@ static void hostdev_event(void *opaque, int event)
}
break;
default:
- DPRINTF("Device %s received event %d\n", ch->dev->label, event);
+ DPRINTF("Device %s received event %d\n", ch->dev.chr->label,
event);
}
}
@@ -546,7 +548,7 @@ static void ipoctal_realize(DeviceState *dev, Error
**errp)
qemu_chr_fe_set_handlers(&ch->dev, hostdev_can_receive,
hostdev_receive, hostdev_event,
ch, NULL, true);
- DPRINTF("Redirecting channel %u to %s\n", i, ch->dev->label);
+ DPRINTF("Redirecting channel %u to %s\n", i,
ch->dev.chr->label);
} else {
DPRINTF("Could not redirect channel %u, no chardev set\n", i);
}
@@ -97,13 +97,15 @@
#define MAX_XMIT_RETRY 4
-#ifdef DEBUG_SERIAL
-#define DPRINTF(fmt, ...) \
-do { fprintf(stderr, "serial: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
-do {} while (0)
-#endif
+#ifndef DEBUG_SERIAL
+#define DEBUG_SERIAL 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_SERIAL) { \
+ fprintf(stderr, "serial: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
static void serial_receive1(void *opaque, const uint8_t *buf, int size);
static void serial_xmit(SerialState *s);
@@ -16,12 +16,15 @@
//#define DEBUG_EMPTY_SLOT
-#ifdef DEBUG_EMPTY_SLOT
-#define DPRINTF(fmt, ...) \
- do { printf("empty_slot: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
-#endif
+#ifndef DEBUG_EMPTY_SLOT
+#define DEBUG_EMPTY_SLOT 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_EMPTY_SLOT) { \
+ fprintf(stderr, "empty_slot: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
#define TYPE_EMPTY_SLOT "empty_slot"
#define EMPTY_SLOT(obj) OBJECT_CHECK(EmptySlot, (obj), TYPE_EMPTY_SLOT)
@@ -52,11 +52,16 @@
//#define DEBUG_SM501
//#define DEBUG_BITBLT
-#ifdef DEBUG_SM501
-#define SM501_DPRINTF(fmt, ...) printf(fmt, ## __VA_ARGS__)
-#else
-#define SM501_DPRINTF(fmt, ...) do {} while(0)
-#endif
+#ifndef DEBUG_SM501
+#define DEBUG_SM501 0
+#endif
+
+#define SM501_DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_SM501) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
#define MMIO_BASE_OFFSET 0x3e00000
@@ -14,18 +14,22 @@
#include "hw/i2c/i2c.h"
#include "ui/console.h"
-//#define DEBUG_SSD0303 1
+#ifndef DEBUG_SSD0303
+#define DEBUG_SSD0303 0
+#endif
-#ifdef DEBUG_SSD0303
-#define DPRINTF(fmt, ...) \
-do { printf("ssd0303: " fmt , ## __VA_ARGS__); } while (0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "ssd0303: error: " fmt , ## __VA_ARGS__); exit(1);}
while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "ssd0303: error: " fmt , ## __VA_ARGS__);} while (0)
-#endif
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_SSD0303) { \
+ fprintf(stderr, "ssd0303: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
+
+#define BADF(fmt, ...) do { \
+ fprintf(stderr, "ssd0303: error: " fmt , ## __VA_ARGS__); \
+ if (DEBUG_SSD0303) { \
+ exit(1); \
+ } \
+} while (0);
/* Scaling factor for pixels. */
#define MAGNIFY 4
@@ -14,20 +14,22 @@
#include "hw/ssi/ssi.h"
#include "ui/console.h"
-//#define DEBUG_SSD0323 1
+#ifndef DEBUG_SSD0323
+#define DEBUG_SSD0323 0
+#endif
-#ifdef DEBUG_SSD0323
-#define DPRINTF(fmt, ...) \
-do { printf("ssd0323: " fmt , ## __VA_ARGS__); } while (0)
-#define BADF(fmt, ...) \
-do { \
- fprintf(stderr, "ssd0323: error: " fmt , ## __VA_ARGS__); abort(); \
-} while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "ssd0323: error: " fmt , ## __VA_ARGS__);} while (0)
-#endif
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_SSD0323) { \
+ fprintf(stderr, "ssd0323: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
+
+#define BADF(fmt, ...) do { \
+ fprintf(stderr, "ssd0323: error: " fmt , ## __VA_ARGS__); \
+ if (DEBUG_SSD0323) { \
+ abort(); \
+ } \
+} while (0);
/* Scaling factor for pixels. */
#define MAGNIFY 4
@@ -30,13 +30,17 @@
//#define DEBUG_I82374
-#ifdef DEBUG_I82374
-#define DPRINTF(fmt, ...) \
-do { fprintf(stderr, "i82374: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
-do {} while (0)
-#endif
+#ifndef DEBUG_I82374
+#define DEBUG_I82374 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_I82374) { \
+ fprintf(stderr, "i82374: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
#define BADF(fmt, ...) \
do { fprintf(stderr, "i82374 ERROR: " fmt , ## __VA_ARGS__); } while (0)
@@ -42,9 +42,9 @@ static uint64_t puv3_dma_read(void *opaque, hwaddr offset,
ret = s->reg_CFG[PUV3_DMA_CH(offset)];
break;
default:
- DPRINTF("Bad offset 0x%x\n", offset);
+ DPRINTF("Bad offset 0x%lx\n", offset);
}
- DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);
+ DPRINTF("offset 0x%lx, value 0x%x\n", offset, ret);
return ret;
}
@@ -61,9 +61,9 @@ static void puv3_dma_write(void *opaque, hwaddr offset,
s->reg_CFG[PUV3_DMA_CH(offset)] = value;
break;
default:
- DPRINTF("Bad offset 0x%x\n", offset);
+ DPRINTF("Bad offset 0x%lx\n", offset);
}
- DPRINTF("offset 0x%x, value 0x%x\n", offset, value);
+ DPRINTF("offset 0x%lx, value 0x%lx\n", offset, value);
}
static const MemoryRegionOps puv3_dma_ops = {
@@ -12,18 +12,22 @@
#include "hw/sysbus.h"
#include "qemu/log.h"
-//#define DEBUG_PL061 1
-
-#ifdef DEBUG_PL061
-#define DPRINTF(fmt, ...) \
-do { printf("pl061: " fmt , ## __VA_ARGS__); } while (0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "pl061: error: " fmt , ## __VA_ARGS__); exit(1);}
while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "pl061: error: " fmt , ## __VA_ARGS__);} while (0)
-#endif
+#ifndef DEBUG_PL061
+#define DEBUG_PL061 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_PL061) { \
+ fprintf(stderr, "pl061: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
+
+#define BADF(fmt, ...) do { \
+ fprintf(stderr, "pl061: error: " fmt , ## __VA_ARGS__); \
+ if (DEBUG_PL061) { \
+ exit(1); \
+ } \
+} while (0);
static const uint8_t pl061_id[12] =
{ 0x00, 0x00, 0x00, 0x00, 0x61, 0x10, 0x04, 0x00, 0x0d, 0xf0, 0x05, 0xb1
};
@@ -46,9 +46,9 @@ static uint64_t puv3_gpio_read(void *opaque, hwaddr
offset,
ret = s->reg_GPIR;
break;
default:
- DPRINTF("Bad offset 0x%x\n", offset);
+ DPRINTF("Bad offset 0x%lx\n", offset);
}
- DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);
+ DPRINTF("offset 0x%lx, value 0x%x\n", offset, ret);
return ret;
}
@@ -58,7 +58,7 @@ static void puv3_gpio_write(void *opaque, hwaddr offset,
{
PUV3GPIOState *s = opaque;
- DPRINTF("offset 0x%x, value 0x%x\n", offset, value);
+ DPRINTF("offset 0x%lx, value 0x%lx\n", offset, value);
switch (offset) {
case 0x04:
s->reg_GPDR = value;
@@ -85,7 +85,7 @@ static void puv3_gpio_write(void *opaque, hwaddr offset,
s->reg_GPIR = value;
break;
default:
- DPRINTF("Bad offset 0x%x\n", offset);
+ DPRINTF("Bad offset 0x%lx\n", offset);
}
}
@@ -16,12 +16,16 @@
//#define DEBUG_BITBANG_I2C
-#ifdef DEBUG_BITBANG_I2C
-#define DPRINTF(fmt, ...) \
-do { printf("bitbang_i2c: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#endif
+#ifndef DEBUG_BITBANG_I2C
+#define DEBUG_BITBANG_I2C 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_BITBANG_I2C) { \
+ fprintf(stderr, "bitbang_i2c: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
typedef enum bitbang_i2c_state {
STOPPED = 0,
@@ -47,11 +47,16 @@
//#define DEBUG
-#ifdef DEBUG
-# define SMBUS_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
-#else
-# define SMBUS_DPRINTF(format, ...) do { } while (0)
-#endif
+#ifndef DEBUG
+#define DEBUG 0
+#endif
+
+#define SMBUS_DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
static void smb_transaction(PMSMBus *s)
@@ -16,16 +16,24 @@
//#define DEBUG_SMBUS 1
-#ifdef DEBUG_SMBUS
-#define DPRINTF(fmt, ...) \
-do { printf("smbus(%02x): " fmt , dev->i2c.address, ## __VA_ARGS__); }
while (0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__); exit(1);}
while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__);} while (0)
-#endif
+#ifndef DEBUG_SMBUS
+#define DEBUG_SMBUS 0
+#endif
+
+#define DPRINTF(fmt, ...)
\
+ do {
\
+ if (DEBUG_SMBUS) {
\
+ fprintf(stderr, "smbus(%02x): " fmt , dev->i2c.address, ##
__VA_ARGS__); \
+ }
\
+ } while (0)
+
+#define BADF(fmt, ...) \
+ do { \
+ fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__); \
+ if (DEBUG_SMBUS) { \
+ exit(1); \
+ } \
+ } while (0)
enum {
SMBUS_IDLE,
@@ -75,12 +75,17 @@
#define ACPI_BUILD_TABLE_SIZE 0x20000
/* #define DEBUG_ACPI_BUILD */
-#ifdef DEBUG_ACPI_BUILD
-#define ACPI_BUILD_DPRINTF(fmt, ...) \
- do {printf("ACPI_BUILD: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define ACPI_BUILD_DPRINTF(fmt, ...)
-#endif
+
+#ifndef DEBUG_ACPI_BUILD
+#define DEBUG_ACPI_BUILD 0
+#endif
+
+#define ACPI_BUILD_DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_ACPI_BUILD) { \
+ fprintf(stderr, "ACPI_BUILD: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
/* Default IOAPIC ID */
#define ACPI_BUILD_IOAPIC_ID 0x0
@@ -37,8 +37,10 @@
#include "kvm_i386.h"
#include "trace.h"
-/*#define DEBUG_INTEL_IOMMU*/
-#ifdef DEBUG_INTEL_IOMMU
+#ifndef DEBUG_INTEL_IOMMU
+#define DEBUG_INTEL_IOMMU 0
+#endif
+
enum {
DEBUG_GENERAL, DEBUG_CSR, DEBUG_INV, DEBUG_MMU, DEBUG_FLOG,
DEBUG_CACHE, DEBUG_IR,
@@ -46,14 +48,12 @@ enum {
#define VTD_DBGBIT(x) (1 << DEBUG_##x)
static int vtd_dbgflags = VTD_DBGBIT(GENERAL) | VTD_DBGBIT(CSR);
-#define VTD_DPRINTF(what, fmt, ...) do { \
- if (vtd_dbgflags & VTD_DBGBIT(what)) { \
- fprintf(stderr, "(vtd)%s: " fmt "\n", __func__, \
- ## __VA_ARGS__); } \
+#define VTD_DPRINTF(what, fmt, ...)
\
+ do {
\
+ if (DEBUG_INTEL_IOMMU && vtd_dbgflags & VTD_DBGBIT(what)) {
\
+ fprintf(stderr, "(vtd)%s: " fmt "\n", __func__, ##
__VA_ARGS__); \
+ }
\
} while (0)
-#else
-#define VTD_DPRINTF(what, fmt, ...) do {} while (0)
-#endif
static void vtd_define_quad(IntelIOMMUState *s, hwaddr addr, uint64_t val,
uint64_t wmask, uint64_t w1cmask)
@@ -73,12 +73,16 @@
/* debug PC/ISA interrupts */
//#define DEBUG_IRQ
-#ifdef DEBUG_IRQ
-#define DPRINTF(fmt, ...) \
- do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_IRQ
+#define DEBUG_IRQ 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_IRQ) { \
+ fprintf(stderr, "CPUIRQ: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
#define FW_CFG_ACPI_TABLES (FW_CFG_ARCH_LOCAL + 0)
#define FW_CFG_SMBIOS_ENTRIES (FW_CFG_ARCH_LOCAL + 1)
@@ -41,13 +41,16 @@
//#define DEBUG_PLATFORM
-#ifdef DEBUG_PLATFORM
-#define DPRINTF(fmt, ...) do { \
- fprintf(stderr, "xen_platform: " fmt, ## __VA_ARGS__); \
-} while (0)
-#else
-#define DPRINTF(fmt, ...) do { } while (0)
-#endif
+#ifndef DEBUG_PLATFORM
+#define DEBUG_PLATFORM 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_PLATFORM) { \
+ fprintf(stderr, "xen_platform: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
#define PFFLAG_ROM_LOCK 1 /* Sets whether ROM memory area is RW or RO */
@@ -31,13 +31,16 @@
/* debug ADB */
//#define DEBUG_ADB
-
-#ifdef DEBUG_ADB
-#define ADB_DPRINTF(fmt, ...) \
-do { printf("ADB: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define ADB_DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_ADB
+#define DEBUG_ADB 0
+#endif
+
+#define ADB_DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_ADB) { \
+ fprintf(stderr, "ADB: " fmt , ## __VA_ARGS__); \
+ } \
+ } while (0)
/* ADB commands */
#define ADB_BUSRESET 0x00
@@ -30,12 +30,17 @@
/* debug PC keyboard */
//#define DEBUG_KBD
-#ifdef DEBUG_KBD
-#define DPRINTF(fmt, ...) \
- do { printf("KBD: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...)
-#endif
+
+#ifndef DEBUG_KBD
+#define DEBUG_KBD 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_KBD) { \
+ fprintf(stderr, "KDB: " fmt , ## __VA_ARGS__); \
+ } \
+ } while (0)
/* Keyboard Controller Commands */
#define KBD_CCMD_READ_MODE 0x20 /* Read mode bits */
@@ -46,11 +46,16 @@
#define VMMOUSE_VERSION 0x3442554a
-#ifdef DEBUG_VMMOUSE
-#define DPRINTF(fmt, ...) printf(fmt, ## __VA_ARGS__)
-#else
-#define DPRINTF(fmt, ...) do { } while (0)
-#endif
+#ifndef DEBUG_VMMOUSE
+#define DEBUG_VMMOUSE 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_VMMOUSE) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
#define TYPE_VMMOUSE "vmmouse"
#define VMMOUSE(obj) OBJECT_CHECK(VMMouseState, (obj), TYPE_VMMOUSE)
@@ -30,13 +30,15 @@
#include "vgic_common.h"
#include "migration/migration.h"
-#ifdef DEBUG_GICV3_KVM
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, "kvm_gicv3: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
-#endif
+#ifndef DEBUG_GICV3_KVM
+#define DEBUG_GICV3_KVM 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_GICV3_KVM) { \
+ fprintf(stderr, "kvm_gicv3: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
#define TYPE_KVM_ARM_GICV3 "kvm-arm-gicv3"
#define KVM_ARM_GICV3(obj) \
@@ -32,15 +32,15 @@
#include "hw/arm/exynos4210.h"
-//#define DEBUG_COMBINER
-
-#ifdef DEBUG_COMBINER
-#define DPRINTF(fmt, ...) \
- do { fprintf(stdout, "COMBINER: [%s:%d] " fmt, __func__ ,
__LINE__, \
- ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
-#endif
+#ifndef DEBUG_COMBINER
+#define DEBUG_COMBINER 0
+#endif
+
+#define DPRINTF(fmt, ...) do {
\
+ if (DEBUG_COMBINER) {
\
+ fprintf(stdout, "COMBINER: [%s:%d] " fmt, __func__ , __LINE__, ##
__VA_ARGS__); \
+ }
\
+} while (0);
#define IIC_NGRP 64 /* Internal Interrupt Combiner
Groups number */
@@ -29,12 +29,15 @@
/* debug PIC */
//#define DEBUG_PIC
-#ifdef DEBUG_PIC
-#define PIC_DPRINTF(fmt, ...) \
- do { printf("PIC: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define PIC_DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_PIC
+#define DEBUG_PIC 0
+#endif
+
+#define PIC_DPRINTF(fmt, ...) do { \
+ if (DEBUG_PIC) { \
+ fprintf(stderr, "PIC: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
typedef struct HeathrowPIC {
uint32_t events;
@@ -72,7 +75,7 @@ static void pic_write(void *opaque, hwaddr addr,
unsigned int n;
n = ((addr & 0xfff) - 0x10) >> 4;
- PIC_DPRINTF("writel: " TARGET_FMT_plx " %u: %08x\n", addr, n, value);
+ PIC_DPRINTF("writel: " TARGET_FMT_plx " %u: %08x\n", addr, n, (int)
value);
if (n >= 2)
return;
pic = &s->pics[n];
@@ -32,14 +32,16 @@
#include "hw/intc/intc.h"
/* debug PIC */
-//#define DEBUG_PIC
-#ifdef DEBUG_PIC
-#define DPRINTF(fmt, ...) \
- do { printf("pic: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_PIC
+#define DEBUG_PIC 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_PIC) { \
+ fprintf(stderr, "pic: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
//#define DEBUG_IRQ_LATENCY
//#define DEBUG_IRQ_COUNT
@@ -35,14 +35,16 @@
#include "hw/i386/x86-iommu.h"
#include "trace.h"
-//#define DEBUG_IOAPIC
-#ifdef DEBUG_IOAPIC
-#define DPRINTF(fmt, ...) \
- do { printf("ioapic: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_IOAPIC
+#define DEBUG_IOAPIC 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_IOAPIC) { \
+ fprintf(stderr, "ioapic: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
#define APIC_DELIVERY_MODE_SHIFT 8
#define APIC_POLARITY_SHIFT 14
@@ -67,7 +67,7 @@ static uint64_t puv3_intc_read(void *opaque, hwaddr
offset,
default:
DPRINTF("Bad offset %x\n", (int)offset);
}
- DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);
+ DPRINTF("offset 0x%lx, value 0x%x\n", offset, ret);
return ret;
}
@@ -76,7 +76,7 @@ static void puv3_intc_write(void *opaque, hwaddr offset,
{
PUV3INTCState *s = opaque;
- DPRINTF("offset 0x%x, value 0x%x\n", offset, value);
+ DPRINTF("offset 0x%lx, value 0x%lx\n", offset, value);
switch (offset) {
case 0x00: /* INTC_ICLR */
case 0x14: /* INTC_ICCR */
@@ -15,12 +15,16 @@
/* #define DEBUG_TPCI */
-#ifdef DEBUG_TPCI
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, "TPCI200: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do { } while (0)
-#endif
+#ifndef DEBUG_TPCI
+#define DEBUG_TPCI 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_TPCI) { \
+ fprintf(stderr, "TPCI200: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
#define N_MODULES 4
@@ -25,13 +25,15 @@
#include "hw/hw.h"
#include "hw/pci/pci.h"
-//#define DEBUG
+#ifndef DEBUG
+#define DEBUG 0
+#endif
-#ifdef DEBUG
-# define APM_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
-#else
-# define APM_DPRINTF(format, ...) do { } while (0)
-#endif
+#define APM_DPRINTF(fmt, ...) do { \
+ if (DEBUG) { \
+ fprintf(stderr, fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
/* fixed I/O location */
#define APM_CNT_IOPORT 0xb2
@@ -27,13 +27,15 @@
#include "qemu/timer.h"
#include "exec/address-spaces.h"
-//#define DEBUG_VT82C686B
+#ifndef DEBUG_VT82C686B
+#define DEBUG_VT82C686B 0
+#endif
-#ifdef DEBUG_VT82C686B
-#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__,
##__VA_ARGS__)
-#else
-#define DPRINTF(fmt, ...)
-#endif
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_VT82C686B) { \
+ fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__); \
+ } \
+} while (0);
typedef struct SuperIOConfig
{
@@ -57,7 +59,7 @@ static void superio_ioport_writeb(void *opaque, hwaddr
addr, uint64_t data,
{
SuperIOConfig *superio_conf = opaque;
- DPRINTF("superio_ioport_writeb address 0x%x val 0x%x\n", addr, data);
+ DPRINTF("superio_ioport_writeb address 0x%lx val 0x%lx\n", addr,
data);
if (addr == 0x3f0) {
superio_conf->index = data & 0xff;
} else {
@@ -101,7 +103,7 @@ static uint64_t superio_ioport_readb(void *opaque,
hwaddr addr, unsigned size)
{
SuperIOConfig *superio_conf = opaque;
- DPRINTF("superio_ioport_readb address 0x%x\n", addr);
+ DPRINTF("superio_ioport_readb address 0x%lx\n", addr);
return (superio_conf->config[superio_conf->index]);
}
@@ -30,13 +30,16 @@
#include "hw/i386/pc.h"
#include "exec/address-spaces.h"
-//#define DEBUG
-#ifdef DEBUG
-#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__,
##__VA_ARGS__)
-#else
-#define DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG
+#define DEBUG 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG) { \
+ fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__); \
+ } \
+} while (0);
#define GT_REGS (0x1000 >> 2)
@@ -39,12 +39,15 @@
/* debug CUDA packets */
//#define DEBUG_CUDA_PACKET
-#ifdef DEBUG_CUDA
-#define CUDA_DPRINTF(fmt, ...) \
- do { printf("CUDA: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define CUDA_DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_CUDA
+#define DEBUG_CUDA 0
+#endif
+
+#define CUDA_DPRINTF(fmt, ...) do { \
+ if (DEBUG_CUDA) { \
+ fprintf(stderr, "CUDA: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
/* Bits in B data register: all active low */
#define TREQ 0x08 /* Transfer request (input) */
@@ -72,9 +72,9 @@ static uint64_t puv3_pm_read(void *opaque, hwaddr offset,
ret = 0x7;
break;
default:
- DPRINTF("Bad offset 0x%x\n", offset);
+ DPRINTF("Bad offset 0x%lx\n", offset);
}
- DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);
+ DPRINTF("offset 0x%lx, value 0x%x\n", offset, ret);
return ret;
}
@@ -104,9 +104,9 @@ static void puv3_pm_write(void *opaque, hwaddr offset,
case 0x38:
break;
default:
- DPRINTF("Bad offset 0x%x\n", offset);
+ DPRINTF("Bad offset 0x%lx\n", offset);
}
- DPRINTF("offset 0x%x, value 0x%x\n", offset, value);
+ DPRINTF("offset 0x%lx, value 0x%lx\n", offset, value);
}
static const MemoryRegionOps puv3_pm_ops = {
@@ -25,13 +25,13 @@
#include "qemu/timer.h"
#include <zlib.h>
-//#define DEBUG_SONIC
+#ifndef DEBUG_SONIC
+#define DEBUG_SONIC 0
+#endif
#define SONIC_PROM_SIZE 0x1000
#ifdef DEBUG_SONIC
-#define DPRINTF(fmt, ...) \
-do { printf("sonic: " fmt , ## __VA_ARGS__); } while (0)
static const char* reg_names[] = {
"CR", "DCR", "RCR", "TCR", "IMR", "ISR", "UTDA", "CTDA",
"TPS", "TFC", "TSA0", "TSA1", "TFS", "URDA", "CRDA", "CRBA0",
@@ -41,10 +41,15 @@ static const char* reg_names[] = {
"SR", "WT0", "WT1", "RSC", "CRCT", "FAET", "MPT", "MDT",
"0x30", "0x31", "0x32", "0x33", "0x34", "0x35", "0x36", "0x37",
"0x38", "0x39", "0x3a", "0x3b", "0x3c", "0x3d", "0x3e", "DCR2" };
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
#endif
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_SONIC) { \
+ fprintf(stderr, "sonic: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
#define SONIC_ERROR(fmt, ...) \
do { printf("sonic ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while
(0)
@@ -22,17 +22,25 @@
//#define DEBUG_LAN9118
+#ifndef DEBUG_LAN9118
+#define DEBUG_LAN9118 0
+#endif
+
#ifdef DEBUG_LAN9118
-#define DPRINTF(fmt, ...) \
-do { printf("lan9118: " fmt , ## __VA_ARGS__); } while (0)
#define BADF(fmt, ...) \
do { hw_error("lan9118: error: " fmt , ## __VA_ARGS__);} while (0)
#else
-#define DPRINTF(fmt, ...) do {} while(0)
#define BADF(fmt, ...) \
do { fprintf(stderr, "lan9118: error: " fmt , ## __VA_ARGS__);} while (0)
#endif
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_LAN9118) { \
+ fprintf(stderr, "lan9118: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
#define CSR_ID_REV 0x50
#define CSR_IRQ_CFG 0x54
#define CSR_INT_STS 0x58
@@ -1033,7 +1041,7 @@ static void lan9118_writel(void *opaque, hwaddr
offset,
s->int_sts |= val & SW_INT;
break;
case CSR_FIFO_INT:
- DPRINTF("FIFO INT levels %08x\n", val);
+ DPRINTF("FIFO INT levels %08x\n", (int)val);
s->fifo_int = val;
break;
case CSR_RX_CFG:
@@ -1114,9 +1122,9 @@ static void lan9118_writel(void *opaque, hwaddr
offset,
if (val & 0x80000000) {
if (val & 0x40000000) {
s->mac_data = do_mac_read(s, val & 0xf);
- DPRINTF("MAC read %d = 0x%08x\n", val & 0xf, s->mac_data);
+ DPRINTF("MAC read %lx = 0x%08x\n", val & 0xf, s->mac_data);
} else {
- DPRINTF("MAC write %d = 0x%08x\n", val & 0xf, s->mac_data);
+ DPRINTF("MAC write %lx = 0x%08x\n", val & 0xf,
s->mac_data);
do_mac_write(s, val & 0xf, s->mac_data);
}
}
@@ -18,12 +18,16 @@
//#define DEBUG_FEC 1
-#ifdef DEBUG_FEC
-#define DPRINTF(fmt, ...) \
-do { printf("mcf_fec: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#endif
+#ifndef DEBUG_FEC
+#define DEBUG_FEC 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_FEC) { \
+ fprintf(stderr, "mcf_fec: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
#define FEC_MAX_DESC 1024
#define FEC_MAX_FRAME_SIZE 2032
@@ -557,7 +561,7 @@ static ssize_t mcf_fec_receive(NetClientState *nc,
const uint8_t *buf, size_t si
unsigned int buf_len;
size_t retsize;
- DPRINTF("do_rx len %d\n", size);
+ DPRINTF("do_rx len %lx\n", size);
if (!s->rx_enabled) {
return -1;
}
@@ -13,16 +13,24 @@
//#define DEBUG_STELLARIS_ENET 1
-#ifdef DEBUG_STELLARIS_ENET
-#define DPRINTF(fmt, ...) \
-do { printf("stellaris_enet: " fmt , ## __VA_ARGS__); } while (0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "stellaris_enet: error: " fmt , ## __VA_ARGS__);
exit(1);} while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "stellaris_enet: error: " fmt , ## __VA_ARGS__);}
while (0)
-#endif
+#ifndef DEBUG_STELLARIS_ENET
+#define DEBUG_STELLARIS_ENET 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_STELLARIS_ENET) { \
+ fprintf(stderr, "stellaris_enet: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
+#define BADF(fmt, ...) \
+ do { \
+ fprintf(stderr, "stellaris_enet: error: " fmt , ## __VA_ARGS__); \
+ if (DEBUG_STELLARIS_ENET) { \
+ exit(1); \
+ } \
+ } while (0)
#define SE_INT_RX 0x01
#define SE_INT_TXER 0x02
@@ -32,12 +32,16 @@
/* debug NVR */
//#define DEBUG_NVR
-#ifdef DEBUG_NVR
-#define NVR_DPRINTF(fmt, ...) \
- do { printf("NVR: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define NVR_DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_NVR
+#define DEBUG_NVR 0
+#endif
+
+#define NVR_DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_NVR) { \
+ fprintf(stderr, "NVR: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
#define DEF_SYSTEM_SIZE 0xc10
@@ -32,14 +32,16 @@
#include "hw/pci/pci_bus.h"
/* debug DEC */
-//#define DEBUG_DEC
-
-#ifdef DEBUG_DEC
-#define DEC_DPRINTF(fmt, ...) \
- do { printf("DEC: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DEC_DPRINTF(fmt, ...)
-#endif
+
+#ifndef DEBUG_DEC
+#define DEBUG_DEC 0
+#endif
+
+#define DEC_DPRINTF(fmt, ...) do { \
+ if (DEBUG_DEC) { \
+ fprintf(stderr, "DEC: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
#define DEC_21154(obj) OBJECT_CHECK(DECState, (obj), TYPE_DEC_21154)
@@ -41,12 +41,16 @@
/* debug APB */
//#define DEBUG_APB
-#ifdef DEBUG_APB
-#define APB_DPRINTF(fmt, ...) \
-do { printf("APB: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define APB_DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_APB
+#define DEBUG_APB 0
+#endif
+
+#define APB_DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_APB) { \
+ fprintf(stderr, "APB: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
/* debug IOMMU */
//#define DEBUG_IOMMU
@@ -49,11 +49,16 @@
//#define DEBUG_BONITO
-#ifdef DEBUG_BONITO
-#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__,
##__VA_ARGS__)
-#else
-#define DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_BONITO
+#define DEBUG_BONITO 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_BONITO) { \
+ fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__); \
+ } \
+ } while (0)
/* from linux soure code. include/asm-mips/mips-boards/bonito64.h*/
#define BONITO_BOOT_BASE 0x1fc00000
@@ -236,7 +241,7 @@ static void bonito_writel(void *opaque, hwaddr addr,
saddr = addr >> 2;
- DPRINTF("bonito_writel "TARGET_FMT_plx" val %x saddr %x\n", addr, val,
saddr);
+ DPRINTF("bonito_writel "TARGET_FMT_plx" val %lx saddr %x\n", addr,
val, saddr);
switch (saddr) {
case BONITO_BONPONCFG:
case BONITO_IODEVCFG:
@@ -323,7 +328,7 @@ static void bonito_pciconf_writel(void *opaque, hwaddr
addr,
PCIBonitoState *s = opaque;
PCIDevice *d = PCI_DEVICE(s);
- DPRINTF("bonito_pciconf_writel "TARGET_FMT_plx" val %x\n", addr, val);
+ DPRINTF("bonito_pciconf_writel "TARGET_FMT_plx" val %lx\n", addr, val);
d->config_write(d, addr, val, 4);
}
@@ -31,12 +31,16 @@
/* debug Grackle */
//#define DEBUG_GRACKLE
-#ifdef DEBUG_GRACKLE
-#define GRACKLE_DPRINTF(fmt, ...) \
- do { printf("GRACKLE: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define GRACKLE_DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_GRACKLE
+#define DEBUG_GRACKLE 0
+#endif
+
+#define GRACKLE_DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_GRACKLE) { \
+ fprintf(stderr, "GRACKLE: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
#define GRACKLE_PCI_HOST_BRIDGE(obj) \
OBJECT_CHECK(GrackleState, (obj), TYPE_GRACKLE_PCI_HOST_BRIDGE)
@@ -30,12 +30,16 @@
/* debug UniNorth */
//#define DEBUG_UNIN
-#ifdef DEBUG_UNIN
-#define UNIN_DPRINTF(fmt, ...) \
- do { printf("UNIN: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define UNIN_DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_UNIN
+#define DEBUG_UNIN 0
+#endif
+
+#define UNIN_DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_UNIN) { \
+ fprintf(stderr, "UNIN: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
static const int unin_irq_line[] = { 0x1b, 0x1c, 0x1d, 0x1e };
@@ -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__) \
+ }
\
+ } while (0)
+
#define PCIE_DEV_PRINTF(dev, fmt, ...) \
PCIE_DPRINTF("%s:%x "fmt, (dev)->name, (dev)->devfn, ## __VA_ARGS__)
@@ -24,13 +24,17 @@
#include "qemu/error-report.h"
/* #define DEBUG_S390PCI_BUS */
-#ifdef DEBUG_S390PCI_BUS
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, "S390pci-bus: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
-#endif
+
+#ifndef DEBUG_S390PCI_BUS
+#define DEBUG_S390PCI_BUS 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_S390PCI_BUS) { \
+ fprintf(stderr, "S390pci-bus: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
S390pciState *s390_get_phb(void)
{
@@ -21,13 +21,17 @@
#include "sysemu/hw_accel.h"
/* #define DEBUG_S390PCI_INST */
-#ifdef DEBUG_S390PCI_INST
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, "s390pci-inst: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
-#endif
+
+#ifndef DEBUG_S390PCI_INST
+#define DEBUG_S390PCI_INST 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_S390PCI_INST) { \
+ fprintf(stderr, "s390pci-inst: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
static void s390_set_status_code(CPUS390XState *env,
uint8_t r, uint64_t status_code)
@@ -24,16 +24,22 @@
//#define DEBUG_LSI
//#define DEBUG_LSI_REG
-#ifdef DEBUG_LSI
-#define DPRINTF(fmt, ...) \
-do { printf("lsi_scsi: " fmt , ## __VA_ARGS__); } while (0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__); exit(1);}
while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__);} while (0)
-#endif
+#ifndef DEBUG_LSI
+#define DEBUG_LSI 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_LSI) { \
+ fprintf(stderr, "lsi_scsi: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
+
+#define BADF(fmt, ...) do { \
+ fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__); \
+ if (DEBUG_LSI) { \
+ exit(1); \
+ } \
+} while (0);
static const char *names[] = {
"SCNTL0", "SCNTL1", "SCNTL2", "SCNTL3", "SCID", "SXFER", "SDID",
"GPREG",
@@ -19,14 +19,17 @@
* the host adapter emulator.
*/
-//#define DEBUG_SCSI
-#ifdef DEBUG_SCSI
-#define DPRINTF(fmt, ...) \
-do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#endif
+#ifndef DEBUG_SCSI
+#define DEBUG_SCSI 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_SCSI) { \
+ fprintf(stderr, "scsi-disk: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
+
#include "qemu/osdep.h"
#include "qapi/error.h"
@@ -21,14 +21,15 @@
#ifdef __linux__
-//#define DEBUG_SCSI
-
-#ifdef DEBUG_SCSI
-#define DPRINTF(fmt, ...) \
-do { printf("scsi-generic: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#endif
+#ifndef DEBUG_SCSI
+#define DEBUG_SCSI 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_SCSI) { \
+ fprintf(stderr, "scsi-generic: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
#define BADF(fmt, ...) \
do { fprintf(stderr, "scsi-generic: " fmt , ## __VA_ARGS__); } while (0)
@@ -16,14 +16,18 @@
#include "qapi/error.h"
//#define DEBUG_PL181 1
-
-#ifdef DEBUG_PL181
-#define DPRINTF(fmt, ...) \
-do { printf("pl181: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
+//
+#ifndef DEBUG_PL181
+#define DEBUG_PL181 0
#endif
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_PL181) { \
+ fprintf(stderr, "pl181: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
#define PL181_FIFO_LEN 16
#define TYPE_PL181 "pl181"
@@ -43,13 +43,17 @@
//#define DEBUG_SD 1
-#ifdef DEBUG_SD
-#define DPRINTF(fmt, ...) \
-do { fprintf(stderr, "SD: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
+#ifndef DEBUG_SD
+#define DEBUG_SD 0
#endif
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_SD) { \
+ fprintf(stderr, "SD: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
#define ACMD41_ENQUIRY_MASK 0x00ffffff
#define OCR_POWER_UP 0x80000000
#define OCR_POWER_DELAY_NS 500000 /* 0.5ms */
@@ -18,18 +18,25 @@
#include "qapi/error.h"
//#define DEBUG_SSI_SD 1
-
-#ifdef DEBUG_SSI_SD
-#define DPRINTF(fmt, ...) \
-do { printf("ssi_sd: " fmt , ## __VA_ARGS__); } while (0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "ssi_sd: error: " fmt , ## __VA_ARGS__); exit(1);}
while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "ssi_sd: error: " fmt , ## __VA_ARGS__);} while (0)
+#ifndef DEBUG_SSI_SD
+#define DEBUG_SSI_SD 0
#endif
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_SSI_SD) { \
+ fprintf(stderr, "ssi_sd: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
+#define BADF(fmt, ...) \
+ do { \
+ fprintf(stderr, "ssi_sd: error: " fmt, ## __VA_ARGS__); \
+ if (DEBUG_SSI_SD) { \
+ exit(1); \
+ } \
+ } while (0)
+
typedef enum {
SSI_SD_CMD = 0,
SSI_SD_CMDARG,
@@ -29,23 +29,25 @@
#include "hw/sparc/sparc64.h"
#include "qemu/timer.h"
-
-//#define DEBUG_IRQ
-//#define DEBUG_TIMER
-
-#ifdef DEBUG_IRQ
-#define CPUIRQ_DPRINTF(fmt, ...) \
- do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define CPUIRQ_DPRINTF(fmt, ...)
-#endif
-
-#ifdef DEBUG_TIMER
-#define TIMER_DPRINTF(fmt, ...) \
- do { printf("TIMER: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define TIMER_DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_IRQ
+#define DEBUG_IRQ 0
+#endif
+
+#ifndef DEBUG_TIMER
+#define DEBUG_TIMER 0
+#endif
+
+#define CPUIRQ_DPRINTF(fmt, ...) do { \
+ if (DEBUG_IRQ) { \
+ fprintf(stderr, "CPUIRQ: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
+
+#define TIMER_DPRINTF(fmt, ...) do { \
+ if (DEBUG_TIMER) { \
+ fprintf(stderr, "TIMER: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
#define TICK_MAX 0x7fffffffffffffffULL
@@ -46,14 +46,16 @@
#include "elf.h"
#include "qemu/cutils.h"
-//#define DEBUG_EBUS
-#ifdef DEBUG_EBUS
-#define EBUS_DPRINTF(fmt, ...) \
- do { printf("EBUS: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define EBUS_DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_EBUS
+#define DEBUG_EBUS 0
+#endif
+
+#define EBUS_DPRINTF(fmt, ...) do { \
+ if (DEBUG_EBUS) { \
+ fprintf(stderr, "EBUS: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
#define KERNEL_LOAD_ADDR 0x00404000
#define CMDLINE_ADDR 0x003ff000
@@ -12,18 +12,22 @@
#include "hw/ssi/ssi.h"
#include "qemu/log.h"
-//#define DEBUG_PL022 1
-
-#ifdef DEBUG_PL022
-#define DPRINTF(fmt, ...) \
-do { printf("pl022: " fmt , ## __VA_ARGS__); } while (0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__); exit(1);}
while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__);} while (0)
-#endif
+#ifndef DEBUG_PL022
+#define DEBUG_PL022 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_PL022) { \
+ fprintf(stderr, "pl022: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
+
+#define BADF(fmt, ...) do { \
+ fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__); \
+ if (DEBUG_PL022) { \
+ exit(1); \
+ } \
+} while (0);
#define PL022_CR1_LBM 0x01
#define PL022_CR1_SSE 0x02
@@ -61,15 +61,16 @@
#include "hw/arm/exynos4210.h"
-//#define DEBUG_MCT
-#ifdef DEBUG_MCT
-#define DPRINTF(fmt, ...) \
- do { fprintf(stdout, "MCT: [%24s:%5d] " fmt, __func__, __LINE__, \
- ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
-#endif
+#ifndef DEBUG_MCT
+#define DEBUG_MCT 0
+#endif
+
+#define DPRINTF(fmt, ...) do {
\
+ if (DEBUG_MCT) {
\
+ fprintf(stdout, "MCT: [%24s:%5d] " fmt, __func__, __LINE__, ##
__VA_ARGS__); \
+ }
\
+} while (0);
#define MCT_CFG 0x000
#define G_CNT_L 0x100
@@ -366,7 +367,7 @@ static void
exynos4210_mct_update_freq(Exynos4210MCTState *s);
static void exynos4210_gfrc_set_count(Exynos4210MCTGT *s, uint64_t count)
{
s->count = count;
- DPRINTF("global timer frc set count 0x%llx\n", count);
+ DPRINTF("global timer frc set count 0x%lx\n", count);
ptimer_set_count(s->ptimer_frc, count);
}
@@ -463,7 +464,7 @@ static int32_t exynos4210_gcomp_find(Exynos4210MCTState
*s)
res = min_comp_i;
}
- DPRINTF("found comparator %d: comp 0x%llx distance 0x%llx, gfrc
0x%llx\n",
+ DPRINTF("found comparator %d: comp 0x%lx distance 0x%lx, gfrc 0x%lx\n",
res,
s->g_timer.reg.comp[res],
distance_min,
@@ -902,7 +903,7 @@ static void exynos4210_ltick_event(void *opaque)
if (s->reg.int_enb & L_INT_INTENB_ICNTEIE) {
#ifdef DEBUG_MCT
time2[s->id] = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
- DPRINTF("local timer[%d] IRQ: %llx\n", s->id,
+ DPRINTF("local timer[%d] IRQ: %lx\n", s->id,
time2[s->id] - time1[s->id]);
time1[s->id] = time2[s->id];
#endif
@@ -1006,7 +1007,7 @@ static uint64_t exynos4210_mct_read(void *opaque,
hwaddr offset,
shift = 8 * (offset & 0x4);
count = exynos4210_gfrc_get_count(&s->g_timer);
value = UINT32_MAX & (count >> shift);
- DPRINTF("read FRC=0x%llx\n", count);
+ DPRINTF("read FRC=0x%lx\n", count);
break;
case G_CNT_WSTAT:
@@ -1128,14 +1129,14 @@ static void exynos4210_mct_write(void *opaque,
hwaddr offset,
case G_CNT_U:
if (offset == G_CNT_L) {
- DPRINTF("global timer write to reg.cntl %llx\n", value);
+ DPRINTF("global timer write to reg.cntl %lx\n", value);
new_frc = (s->g_timer.reg.cnt & (uint64_t)UINT32_MAX << 32) +
value;
s->g_timer.reg.cnt_wstat |= G_CNT_WSTAT_L;
}
if (offset == G_CNT_U) {
- DPRINTF("global timer write to reg.cntu %llx\n", value);
+ DPRINTF("global timer write to reg.cntu %lx\n", value);
new_frc = (s->g_timer.reg.cnt & UINT32_MAX) +
((uint64_t)value << 32);
@@ -1159,7 +1160,7 @@ static void exynos4210_mct_write(void *opaque, hwaddr
offset,
(((uint64_t)UINT32_MAX << 32) >> shift)) +
(value << shift);
- DPRINTF("comparator %d write 0x%llx val << %d\n", index, value, shift);
+ DPRINTF("comparator %d write 0x%lx val << %d\n", index, value, shift);
if (offset&0x4) {
s->g_timer.reg.wstat |= G_WSTAT_COMP_U(index);
@@ -1175,7 +1176,7 @@ static void exynos4210_mct_write(void *opaque, hwaddr
offset,
s->g_timer.reg.tcon = value;
s->g_timer.reg.wstat |= G_WSTAT_TCON_WRITE;
- DPRINTF("global timer write to reg.g_tcon %llx\n", value);
+ DPRINTF("global timer write to reg.g_tcon %lx\n", value);
/* Start FRC if transition from disabled to enabled */
if ((value & G_TCON_TIMER_ENABLE) > (old_val &
@@ -1222,7 +1223,7 @@ static void exynos4210_mct_write(void *opaque, hwaddr
offset,
}
}
- DPRINTF("global timer INT enable %llx\n", value);
+ DPRINTF("global timer INT enable %lx\n", value);
s->g_timer.reg.int_enb = value;
break;
@@ -1309,7 +1310,7 @@ static void exynos4210_mct_write(void *opaque, hwaddr
offset,
if (tcntb_max[lt_i] < value) {
tcntb_max[lt_i] = value;
}
- DPRINTF("local timer[%d] TCNTB write %llx; max=%x, min=%x\n",
+ DPRINTF("local timer[%d] TCNTB write %lx; max=%x, min=%x\n",
lt_i, value, tcntb_max[lt_i], tcntb_min[lt_i]);
#endif
break;
@@ -1352,7 +1353,7 @@ static void exynos4210_mct_write(void *opaque, hwaddr
offset,
if (icntb_max[lt_i] < value) {
icntb_max[lt_i] = value;
}
-DPRINTF("local timer[%d] ICNTB write %llx; max=%x, min=%x\n\n",
+DPRINTF("local timer[%d] ICNTB write %lx; max=%x, min=%x\n\n",
lt_i, value, icntb_max[lt_i], icntb_min[lt_i]);
#endif
break;
@@ -1362,7 +1363,7 @@ break;
lt_i = GET_L_TIMER_IDX(offset);
index = GET_L_TIMER_CNT_REG_IDX(offset, lt_i);
- DPRINTF("local timer[%d] FRCNTB write %llx\n", lt_i, value);
+ DPRINTF("local timer[%d] FRCNTB write %lx\n", lt_i, value);
s->l_timer[lt_i].reg.wstat |= L_WSTAT_FRCCNTB_WRITE;
s->l_timer[lt_i].reg.cnt[L_REG_CNT_FRCCNTB] = value;
@@ -1379,7 +1380,7 @@ break;
case L0_INT_CSTAT: case L1_INT_CSTAT:
lt_i = GET_L_TIMER_IDX(offset);
- DPRINTF("local timer[%d] CSTAT write %llx\n", lt_i, value);
+ DPRINTF("local timer[%d] CSTAT write %lx\n", lt_i, value);
s->l_timer[lt_i].reg.int_cstat &= ~value;
if (!s->l_timer[lt_i].reg.int_cstat) {
@@ -29,15 +29,15 @@
#include "hw/arm/exynos4210.h"
-//#define DEBUG_PWM
-
-#ifdef DEBUG_PWM
-#define DPRINTF(fmt, ...) \
- do { fprintf(stdout, "PWM: [%24s:%5d] " fmt, __func__, __LINE__, \
- ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
-#endif
+#ifndef DEBUG_PWM
+#define DEBUG_PWM 0
+#endif
+
+#define DPRINTF(fmt, ...) do {
\
+ if (DEBUG_PWM) {
\
+ fprintf(stdout, "PWM: [%24s:%5d] " fmt, __func__, __LINE__, ##
__VA_ARGS__); \
+ }
\
+} while (0);
#define EXYNOS4210_PWM_TIMERS_NUM 5
#define EXYNOS4210_PWM_REG_MEM_SIZE 0x50
@@ -39,13 +39,11 @@
#define DEBUG_RTC 0
-#if DEBUG_RTC
-#define DPRINTF(fmt, ...) \
- do { fprintf(stdout, "RTC: [%24s:%5d] " fmt, __func__, __LINE__, \
- ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
-#endif
+#define DPRINTF(fmt, ...) do {
\
+ if (DEBUG_RTC) {
\
+ fprintf(stdout, "RTC: [%24s:%5d] " fmt, __func__, __LINE__, ##
__VA_ARGS__); \
+ }
\
+} while (0);
#define EXYNOS4210_RTC_REG_MEM_SIZE 0x0100
@@ -36,12 +36,16 @@
#include "hw/timer/mc146818rtc.h"
#include "hw/timer/i8254.h"
-//#define HPET_DEBUG
-#ifdef HPET_DEBUG
-#define DPRINTF printf
-#else
-#define DPRINTF(...)
-#endif
+
+#ifndef HPET_DEBUG
+#define HPET_DEBUG 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (HPET_DEBUG) { \
+ fprintf(stderr, fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
#define HPET_MSI_SUPPORT 0
@@ -387,7 +391,7 @@ static void hpet_del_timer(HPETTimer *t)
update_irq(t, 0);
}
-#ifdef HPET_DEBUG
+#if HPET_DEBUG
static uint32_t hpet_ram_readb(void *opaque, hwaddr addr)
{
printf("qemu: hpet_read b at %" PRIx64 "\n", addr);
@@ -480,7 +484,7 @@ static void hpet_ram_write(void *opaque, hwaddr addr,
HPETState *s = opaque;
uint64_t old_val, new_val, val, index;
- DPRINTF("qemu: Enter hpet_ram_writel at %" PRIx64 " = %#x\n", addr,
value);
+ DPRINTF("qemu: Enter hpet_ram_writel at %" PRIx64 " = %#lx\n", addr,
value);
index = addr;
old_val = hpet_ram_read(opaque, addr, 4);
new_val = value;
@@ -622,7 +626,7 @@ static void hpet_ram_write(void *opaque, hwaddr addr,
}
s->hpet_counter =
(s->hpet_counter & 0xffffffff00000000ULL) | value;
- DPRINTF("qemu: HPET counter written. ctr = %#x -> %" PRIx64
"\n",
+ DPRINTF("qemu: HPET counter written. ctr = %#lx -> %" PRIx64
"\n",
value, s->hpet_counter);
break;
case HPET_COUNTER + 4:
@@ -631,7 +635,7 @@ static void hpet_ram_write(void *opaque, hwaddr addr,
}
s->hpet_counter =
(s->hpet_counter & 0xffffffffULL) | (((uint64_t)value) <<
32);
- DPRINTF("qemu: HPET counter + 4 written. ctr = %#x -> %"
PRIx64 "\n",
+ DPRINTF("qemu: HPET counter + 4 written. ctr = %#lx -> %"
PRIx64 "\n",
value, s->hpet_counter);
break;
default:
@@ -37,20 +37,25 @@
#include "hw/i386/apic.h"
#endif
-//#define DEBUG_CMOS
-//#define DEBUG_COALESCED
-
-#ifdef DEBUG_CMOS
-# define CMOS_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
-#else
-# define CMOS_DPRINTF(format, ...) do { } while (0)
-#endif
-
-#ifdef DEBUG_COALESCED
-# define DPRINTF_C(format, ...) printf(format, ## __VA_ARGS__)
-#else
-# define DPRINTF_C(format, ...) do { } while (0)
-#endif
+#ifndef DEBUG_CMOS
+#define DEBUG_CMOS 0
+#endif
+
+#ifndef DEBUG_COALESCED
+#define DEBUG_COALESCED 0
+#endif
+
+#define CMOS_DPRINTF(fmt, ...) do { \
+ if (DEBUG_CMOS) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
+
+#define DPRINTF_C(fmt, ...) do { \
+ if (DEBUG_COALESCED) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
#define SEC_PER_MIN 60
#define MIN_PER_HOUR 60
@@ -18,14 +18,15 @@
#include "qemu/cutils.h"
#include "qemu/log.h"
-//#define DEBUG_PL031
-
-#ifdef DEBUG_PL031
-#define DPRINTF(fmt, ...) \
-do { printf("pl031: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#endif
+#ifndef DEBUG_PL031
+#define DEBUG_PL031 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_PL031) { \
+ fprintf(stderr, "pl031: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
#define RTC_DR 0x00 /* Data read register */
#define RTC_MR 0x04 /* Match register */
@@ -53,7 +53,7 @@ static uint64_t puv3_ost_read(void *opaque, hwaddr offset,
default:
DPRINTF("Bad offset %x\n", (int)offset);
}
- DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);
+ DPRINTF("offset 0x%lx, value 0x%x\n", offset, ret);
return ret;
}
@@ -62,7 +62,7 @@ static void puv3_ost_write(void *opaque, hwaddr offset,
{
PUV3OSTState *s = opaque;
- DPRINTF("offset 0x%x, value 0x%x\n", offset, value);
+ DPRINTF("offset 0x%lx, value 0x%lx\n", offset, value);
switch (offset) {
case 0x00: /* Match Register 0 */
s->reg_OSMR0 = value;
@@ -15,14 +15,16 @@
#include "qemu/timer.h"
#include "hw/timer/sun4v-rtc.h"
-//#define DEBUG_SUN4V_RTC
-
-#ifdef DEBUG_SUN4V_RTC
-#define DPRINTF(fmt, ...) \
- do { printf("sun4v_rtc: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
-#endif
+
+#ifndef DEBUG_SUN4V_RTC
+#define DEBUG_SUN4V_RTC 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_SUN4V_RTC) { \
+ fprintf(stderr, "sun4v_rtc: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
#define TYPE_SUN4V_RTC "sun4v_rtc"
#define SUN4V_RTC(obj) OBJECT_CHECK(Sun4vRtc, (obj), TYPE_SUN4V_RTC)
@@ -17,14 +17,15 @@
#include "hw/usb/desc.h"
#include "sysemu/char.h"
-//#define DEBUG_Serial
-
-#ifdef DEBUG_Serial
-#define DPRINTF(fmt, ...) \
-do { printf("usb-serial: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#endif
+#ifndef DEBUG_Serial
+#define DEBUG_Serial 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_Serial) { \
+ fprintf(stderr, "usb-serial: " fmt,## __VA_ARGS__); \
+ } \
+} while (0);
#define RECV_BUF 384
@@ -24,14 +24,15 @@
#include "qapi/visitor.h"
#include "qemu/cutils.h"
-//#define DEBUG_MSD
-
-#ifdef DEBUG_MSD
-#define DPRINTF(fmt, ...) \
-do { printf("usb-msd: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#endif
+#ifndef DEBUG_MSD
+#define DEBUG_MSD 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_MSD) { \
+ fprintf(stderr, "usb-msd: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
/* USB requests. */
#define MassStorageReset 0xff
@@ -30,11 +30,11 @@
#define EHCI_DEBUG 0
#endif
-#if EHCI_DEBUG
-#define DPRINTF printf
-#else
-#define DPRINTF(...)
-#endif
+#define DPRINTF(fmt, ...) do { \
+ if (EHCI_DEBUG) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
#define MMIO_SIZE 0x1000
#define CAPA_SIZE 0x10
@@ -32,11 +32,16 @@
//#define DEBUG_XHCI
//#define DEBUG_DATA
-#ifdef DEBUG_XHCI
-#define DPRINTF(...) fprintf(stderr, __VA_ARGS__)
-#else
-#define DPRINTF(...) do {} while (0)
-#endif
+#ifndef DEBUG_XHCI
+#define DEBUG_XHCI 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_XHCI) { \
+ fprintf(stderr, fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
+
#define FIXME(_msg) do { fprintf(stderr, "FIXME %s:%d %s\n", \
__func__, __LINE__, _msg); abort(); }
while (0)
@@ -1806,7 +1811,7 @@ static int xhci_setup_packet(XHCITransfer *xfer)
ep = xhci_epid_to_usbep(xfer->epctx);
if (!ep) {
DPRINTF("xhci: slot %d has no device\n",
- xfer->slotid);
+ xfer->epctx->slotid);
return -1;
}
}
@@ -1980,7 +1985,7 @@ static int xhci_submit(XHCIState *xhci, XHCITransfer
*xfer, XHCIEPContext *epctx
{
uint64_t mfindex;
- DPRINTF("xhci_submit(slotid=%d,epid=%d)\n", xfer->slotid, xfer->epid);
+ DPRINTF("xhci_submit(slotid=%d,epid=%d)\n", xfer->epctx->slotid,
xfer->epctx->epid);
xfer->in_xfer = epctx->type>>2;
@@ -31,15 +31,20 @@
#include "hw/virtio/virtio.h"
#include "exec/address-spaces.h"
+
/* #define DEBUG_VIRTIO_BUS */
-#ifdef DEBUG_VIRTIO_BUS
-#define DPRINTF(fmt, ...) \
-do { printf("virtio_bus: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do { } while (0)
+#ifndef DEBUG_VIRTIO_BUS
+#define DEBUG_VIRTIO_BUS 0
#endif
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_VIRTIO_BUS) { \
+ fprintf(stderr, "virtio_bus: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
/* A VirtIODevice is being plugged */
void virtio_bus_device_plugged(VirtIODevice *vdev, Error **errp)
{
@@ -30,13 +30,16 @@
/* #define DEBUG_VIRTIO_MMIO */
-#ifdef DEBUG_VIRTIO_MMIO
-
-#define DPRINTF(fmt, ...) \
-do { printf("virtio_mmio: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
-#endif
+#ifndef DEBUG_VIRTIO_MMIO
+#define DEBUG_VIRTIO_MMIO 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_VIRTIO_MMIO) { \
+ fprintf(stderr, "virtio_mmio: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
/* QOM macros */
/* virtio-mmio-bus */
@@ -41,10 +41,15 @@
#define PUV3_IRQS_OST0 (26)
/* All puv3_*.c use DPRINTF for debug. */
-#ifdef DEBUG_PUV3
-#define DPRINTF(fmt, ...) printf("%s: " fmt , __func__, ## __VA_ARGS__)
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
-#endif
+
+#ifndef DEBUG_PUV3
+#define DEBUG_PUV3 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_PUV3) { \
+ fprintf(stderr, "%s: " fmt, __func__, ## __VA_ARGS__); \
+ } \
+} while (0);
#endif /* QEMU_HW_PUV3_H */
@@ -33,14 +33,15 @@
#define ERR_PREFIX "vfio error: %s: "
#define WARN_PREFIX "vfio warning: %s: "
-/*#define DEBUG_VFIO*/
-#ifdef DEBUG_VFIO
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, "vfio: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
-#endif
+#ifndef DEBUG_VFIO
+#define DEBUG_VFIO 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_VFIO) { \
+ fprintf(stderr, "vfio: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
enum {
VFIO_DEVICE_TYPE_PCI = 0,
@@ -50,16 +50,16 @@
*/
#define PAGE_SIZE getpagesize()
-//#define DEBUG_KVM
-
-#ifdef DEBUG_KVM
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
+#ifndef DEBUG_KVM
+#define DEBUG_KVM 0
#endif
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_KVM) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
+
#define KVM_MSI_HASHTAB_SIZE 256
struct KVMParkedVcpu {
@@ -42,13 +42,15 @@
//#define DEBUG_BLK_MIGRATION
-#ifdef DEBUG_BLK_MIGRATION
-#define DPRINTF(fmt, ...) \
- do { printf("blk_migration: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
-#endif
+#ifndef DEBUG_BLK_MIGRATION
+#define DEBUG_BLK_MIGRATION 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_BLK_MIGRATION) { \
+ fprintf(stderr, "blk_migration: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
typedef struct BlkMigDevState {
/* Written during setup phase. Can be read without a lock. */
@@ -18,13 +18,16 @@
#include "qemu/host-utils.h"
#include "migration/page_cache.h"
-#ifdef DEBUG_CACHE
-#define DPRINTF(fmt, ...) \
- do { fprintf(stdout, "cache: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
-#endif
+
+#ifndef DEBUG_CACHE
+#define DEBUG_CACHE 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_CACHE) { \
+ fprintf(stderr, "cache: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
/* the page in cache will not be replaced in two cycles */
#define CACHED_PAGE_LIFETIME 2
@@ -47,15 +47,15 @@
#include "exec/memattrs.h"
#include "trace.h"
-//#define DEBUG_KVM
-
-#ifdef DEBUG_KVM
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
-#endif
+#ifndef DEBUG_KVM
+#define DEBUG_KVM 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_KVM) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
#define MSR_KVM_WALL_CLOCK 0x11
#define MSR_KVM_SYSTEM_TIME 0x12
@@ -50,15 +50,15 @@
#include "hw/ppc/spapr_cpu_core.h"
#endif
-//#define DEBUG_KVM
-
-#ifdef DEBUG_KVM
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
-#endif
+#ifndef DEBUG_KVM
+#define DEBUG_KVM 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_KVM) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
#define PROC_DEVTREE_CPU "/proc/device-tree/cpus/"
@@ -47,15 +47,15 @@
#include "exec/memattrs.h"
#include "hw/s390x/s390-virtio-ccw.h"
-/* #define DEBUG_KVM */
-
-#ifdef DEBUG_KVM
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
-#endif
+#ifndef DEBUG_KVM
+#define DEBUG_KVM 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_KVM) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
#define kvm_vm_check_mem_attr(s, attr) \
kvm_vm_check_attr(s, KVM_S390_VM_MEM_CTRL, attr)
@@ -25,38 +25,49 @@
#include "exec/cpu_ldst.h"
#include "asi.h"
-//#define DEBUG_MMU
-//#define DEBUG_MXCC
//#define DEBUG_UNALIGNED
//#define DEBUG_UNASSIGNED
-//#define DEBUG_ASI
-//#define DEBUG_CACHE_CONTROL
-#ifdef DEBUG_MMU
-#define DPRINTF_MMU(fmt, ...) \
- do { printf("MMU: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF_MMU(fmt, ...) do {} while (0)
-#endif
+#ifndef DEBUG_MMU
+#define DEBUG_MMU 0
+#endif
-#ifdef DEBUG_MXCC
-#define DPRINTF_MXCC(fmt, ...) \
- do { printf("MXCC: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF_MXCC(fmt, ...) do {} while (0)
-#endif
+#ifndef DEBUG_MXCC
+#define DEBUG_MXCC 0
+#endif
-#ifdef DEBUG_ASI
-#define DPRINTF_ASI(fmt, ...) \
- do { printf("ASI: " fmt , ## __VA_ARGS__); } while (0)
-#endif
+#ifndef DEBUG_ASI
+#define DEBUG_ASI 0
+#endif
-#ifdef DEBUG_CACHE_CONTROL
-#define DPRINTF_CACHE_CONTROL(fmt, ...) \
- do { printf("CACHE_CONTROL: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF_CACHE_CONTROL(fmt, ...) do {} while (0)
-#endif
+#ifndef DEBUG_CACHE_CONTROL
+#define DEBUG_CACHE_CONTROL 0
+#endif
+
+
+#define DPRINTF_MMU(fmt, ...) do { \
+ if (DEBUG_MMU) { \
+ fprintf(stderr, "MMU: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
+
+#define DPRINTF_MXCC(fmt, ...) do { \
+ if (DEBUG_MXCC) { \
+ fprintf(stderr, "MXCC: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
+
+#define DPRINTF_ASI(fmt, ...) do { \
+ if (DEBUG_ASI) { \
+ fprintf(stderr, "ASI: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
+
+#define DPRINTF_CACHE_CONTROL(fmt, ...) do { \
+ if (DEBUG_CACHE_CONTROL) { \
+ fprintf(stderr, "CACHE_CONTROL: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
#ifdef TARGET_SPARC64
#ifndef TARGET_ABI32
@@ -1631,7 +1642,7 @@ void helper_st_asi(CPUSPARCState *env, target_ulong
addr, target_ulong val,
if (oldreg != env->immu.mmuregs[reg]) {
DPRINTF_MMU("immu change reg[%d]: 0x%016" PRIx64 " ->
0x%016"
- PRIx64 "\n", reg, oldreg, env->immuregs[reg]);
+ PRIx64 "\n", reg, oldreg,
env->immu.mmuregs[reg]);
}
#ifdef DEBUG_MMU
dump_mmu(stdout, fprintf, env);
@@ -1715,7 +1726,7 @@ void helper_st_asi(CPUSPARCState *env, target_ulong
addr, target_ulong val,
if (oldreg != env->dmmu.mmuregs[reg]) {
DPRINTF_MMU("dmmu change reg[%d]: 0x%016" PRIx64 " ->
0x%016"
- PRIx64 "\n", reg, oldreg, env->dmmuregs[reg]);
+ PRIx64 "\n", reg, oldreg,
env->dmmu.mmuregs[reg]);
}
#ifdef DEBUG_MMU
dump_mmu(stdout, fprintf, env);
@@ -19,13 +19,15 @@
#include "ui/console.h"
#endif
-#undef DEBUG_UC32
-
-#ifdef DEBUG_UC32
-#define DPRINTF(fmt, ...) printf("%s: " fmt , __func__, ## __VA_ARGS__)
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
-#endif
+#ifndef DEBUG_UC32
+#define DEBUG_UC32 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_UC32) { \
+ fprintf(stderr, "%s: " fmt, __func__, ## __VA_ARGS__); \
+ } \
+} while (0);
UniCore32CPU *uc32_cpu_init(const char *cpu_model)
{
@@ -16,13 +16,15 @@
#include "cpu.h"
#include "exec/exec-all.h"
-#undef DEBUG_UC32
+#ifndef DEBUG_UC32
+#define DEBUG_UC32 0
+#endif
-#ifdef DEBUG_UC32
-#define DPRINTF(fmt, ...) printf("%s: " fmt , __func__, ## __VA_ARGS__)
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
-#endif
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_UC32) { \
+ fprintf(stderr, "%s: " fmt, __func__, ## __VA_ARGS__); \
+ } \
+} while (0);
#define SUPERPAGE_SIZE (1 << 22)
#define UC32_PAGETABLE_READ (1 << 8)
@@ -15,15 +15,15 @@
#include "sysemu/accel.h"
#include "migration/migration.h"
-//#define DEBUG_XEN
-
-#ifdef DEBUG_XEN
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, "xen: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
-#endif
+#ifndef DEBUG_XEN
+#define DEBUG_XEN 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_XEN) { \
+ fprintf(stderr, "xen: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
static int store_dev_info(int domid, Chardev *cs, const char *string)
{
@@ -29,15 +29,15 @@
#include <xen/hvm/params.h>
#include <xen/hvm/e820.h>
-//#define DEBUG_XEN_HVM
-
-#ifdef DEBUG_XEN_HVM
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, "xen: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
-#endif
+#ifndef DEBUG_XEN_HVM
+#define DEBUG_XEN_HVM 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_XEN_HVM) { \
+ fprintf(stderr, "xen: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
static MemoryRegion ram_memory, ram_640k, ram_lo, ram_hi;
static MemoryRegion *framebuffer;
@@ -22,15 +22,15 @@
#include "trace-root.h"
-//#define MAPCACHE_DEBUG
-
-#ifdef MAPCACHE_DEBUG
-# define DPRINTF(fmt, ...) do { \
- fprintf(stderr, "xen_mapcache: " fmt, ## __VA_ARGS__); \
-} while (0)
-#else
-# define DPRINTF(fmt, ...) do { } while (0)
-#endif
+#ifndef MAPCACHE_DEBUG
+#define MAPCACHE_DEBUG 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (MAPCACHE_DEBUG) { \
+ fprintf(stderr, "xen_mapcache: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
#if HOST_LONG_BITS == 32
# define MCACHE_BUCKET_SHIFT 16