@@ -20,19 +20,27 @@
#include "hw/scsi/scsi.h"
#include "sysemu/dma.h"
-//#define DEBUG_LSI
+//#define DEBUG_LSI 1
//#define DEBUG_LSI_REG
-#ifdef DEBUG_LSI
+#ifndef DEBUG_LSI
+#define DEBUG_LSI 0
+#endif
+
#define DPRINTF(fmt, ...) \
-do { printf("lsi_scsi: " fmt , ## __VA_ARGS__); } while (0)
-#define BADF(fmt, ...) \
-do { fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
+ do { \
+ if(DEBUG_LSI) { \
+ printf("lsi_scsi: " fmt , ## __VA_ARGS__); \
+ } \
+ } while (0)
+
#define BADF(fmt, ...) \
-do { fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__);} while (0)
-#endif
+ do { \
+ fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__); \
+ if(DEBUG_LSI) { \
+ exit(1); \
+ } \
+ } while (0)
#define LSI_MAX_DEVS 7
@@ -18,15 +18,19 @@
#ifdef __linux__
-//#define DEBUG_SCSI
+//#define DEBUG_SCSI 1
-#ifdef DEBUG_SCSI
-#define DPRINTF(fmt, ...) \
-do { printf("scsi-generic: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
+#ifndef DEBUG_SCSI
+#define DEBUG_SCSI 0
#endif
+#define DPRINTF(fmt, ...) \
+ do { \
+ if(DEBUG_SCSI) { \
+ printf("scsi-generic: " fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
#define BADF(fmt, ...) \
do { fprintf(stderr, "scsi-generic: " fmt , ## __VA_ARGS__); } while (0)
@@ -42,16 +42,19 @@
#include <libfdt.h>
-/*#define DEBUG_VSCSI*/
+/*#define DEBUG_VSCSI 1*/
-#ifdef DEBUG_VSCSI
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
+#ifndef DEBUG_VSCSI
+#define DEBUG_VSCSI 0
#endif
+#define DPRINTF(fmt, ...) \
+ do { \
+ if(DEBUG_VSCSI) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
/*
* Virtual SCSI device
*/