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