@@ -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;
}