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