qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 26/31] target-ppc/helper.c: LOG_MMU_STATE macro


From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH 26/31] target-ppc/helper.c: LOG_MMU_STATE macro
Date: Fri, 12 Dec 2008 13:09:05 -0200

Create a LOG_MMU_STATE macro and use it instead of #ifdef DEBUG_MMU.

Signed-off-by: Eduardo Habkost <address@hidden>
---
 target-ppc/helper.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/target-ppc/helper.c b/target-ppc/helper.c
index 0eaad86..b96b406 100644
--- a/target-ppc/helper.c
+++ b/target-ppc/helper.c
@@ -43,8 +43,13 @@
      if (loglevel)                       \
        fprintf(logfile, ## __VA_ARGS__); \
    } while (0)
+#  define LOG_MMU_STATE(env) do {                     \
+        if (loglevel)                                 \
+            cpu_dump_state(env, logfile, fprintf, 0); \
+   } while (0)
 #else
 #  define LOG_MMU(...) do { } while (0)
+#  define LOG_MMU_STATE(...) do { } while (0)
 #endif
 
 
@@ -1423,10 +1428,7 @@ int cpu_ppc_handle_mmu_fault (CPUState *env, 
target_ulong address, int rw,
                                 ctx.raddr & TARGET_PAGE_MASK, ctx.prot,
                                 mmu_idx, is_softmmu);
     } else if (ret < 0) {
-#if defined (DEBUG_MMU)
-        if (loglevel != 0)
-            cpu_dump_state(env, logfile, fprintf, 0);
-#endif
+        LOG_MMU_STATE(env);
         if (access_type == ACCESS_CODE) {
             switch (ret) {
             case -1:
-- 
1.5.5.GIT





reply via email to

[Prev in Thread] Current Thread [Next in Thread]