@@ -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 */