@@ -25,38 +25,49 @@
#include "exec/cpu_ldst.h"
#include "asi.h"
-//#define DEBUG_MMU
-//#define DEBUG_MXCC
//#define DEBUG_UNALIGNED
//#define DEBUG_UNASSIGNED
-//#define DEBUG_ASI
-//#define DEBUG_CACHE_CONTROL
-#ifdef DEBUG_MMU
-#define DPRINTF_MMU(fmt, ...) \
- do { printf("MMU: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF_MMU(fmt, ...) do {} while (0)
-#endif
+#ifndef DEBUG_MMU
+#define DEBUG_MMU 0
+#endif
-#ifdef DEBUG_MXCC
-#define DPRINTF_MXCC(fmt, ...) \
- do { printf("MXCC: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF_MXCC(fmt, ...) do {} while (0)
-#endif
+#ifndef DEBUG_MXCC
+#define DEBUG_MXCC 0
+#endif
-#ifdef DEBUG_ASI
-#define DPRINTF_ASI(fmt, ...) \
- do { printf("ASI: " fmt , ## __VA_ARGS__); } while (0)
-#endif
+#ifndef DEBUG_ASI
+#define DEBUG_ASI 0
+#endif
-#ifdef DEBUG_CACHE_CONTROL
-#define DPRINTF_CACHE_CONTROL(fmt, ...) \
- do { printf("CACHE_CONTROL: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF_CACHE_CONTROL(fmt, ...) do {} while (0)
-#endif
+#ifndef DEBUG_CACHE_CONTROL
+#define DEBUG_CACHE_CONTROL 0
+#endif
+
+
+#define DPRINTF_MMU(fmt, ...) do { \
+ if (DEBUG_MMU) { \
+ fprintf(stderr, "MMU: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
+
+#define DPRINTF_MXCC(fmt, ...) do { \
+ if (DEBUG_MXCC) { \
+ fprintf(stderr, "MXCC: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
+
+#define DPRINTF_ASI(fmt, ...) do { \
+ if (DEBUG_ASI) { \
+ fprintf(stderr, "ASI: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
+
+#define DPRINTF_CACHE_CONTROL(fmt, ...) do { \
+ if (DEBUG_CACHE_CONTROL) { \
+ fprintf(stderr, "CACHE_CONTROL: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
#ifdef TARGET_SPARC64
#ifndef TARGET_ABI32
@@ -1631,7 +1642,7 @@ void helper_st_asi(CPUSPARCState *env, target_ulong
addr, target_ulong val,
if (oldreg != env->immu.mmuregs[reg]) {
DPRINTF_MMU("immu change reg[%d]: 0x%016" PRIx64 " ->
0x%016"
- PRIx64 "\n", reg, oldreg, env->immuregs[reg]);
+ PRIx64 "\n", reg, oldreg,
env->immu.mmuregs[reg]);