@@ -47,14 +47,19 @@
#include "sysemu/sysemu.h"
#include "exec/address-spaces.h"
-//#define DEBUG_BONITO
+//#define DEBUG_BONITO 1
-#ifdef DEBUG_BONITO
-#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__)
-#else
-#define DPRINTF(fmt, ...)
+#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
#define BONITO_BOOT_SIZE 0x00100000
@@ -21,12 +21,19 @@
#include "qemu/bswap.h"
#include "hw/pci-host/ppce500.h"
-#ifdef DEBUG_PCI
-#define pci_debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
-#else
-#define pci_debug(fmt, ...)
+//#define DEBUG_PCI 1
+
+#ifndef DEBUG_PCI
+#define DEBUG_PCI 0
#endif
+#define pci_debug(fmt, ...) \
+ do { \
+ if(DEBUG_PCI) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+ } while(0)
+
#define PCIE500_CFGADDR 0x0
#define PCIE500_CFGDATA 0x4
#define PCIE500_REG_BASE 0xC00