@@ -12,18 +12,22 @@
#include "hw/ssi/ssi.h"
#include "qemu/log.h"
-//#define DEBUG_PL022 1
-
-#ifdef DEBUG_PL022
-#define DPRINTF(fmt, ...) \
-do { printf("pl022: " fmt , ## __VA_ARGS__); } while (0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__); exit(1);}
while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__);} while (0)
-#endif
+#ifndef DEBUG_PL022
+#define DEBUG_PL022 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_PL022) { \
+ fprintf(stderr, "pl022: " fmt , ## __VA_ARGS__); \
+ } \
+} while (0);
+
+#define BADF(fmt, ...) do { \
+ fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__); \
+ if (DEBUG_PL022) { \
+ exit(1); \
+ } \
+} while (0);
#define PL022_CR1_LBM 0x01