From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LBA4f-0007aT-72 for qemu-devel@nongnu.org; Fri, 12 Dec 2008 10:37:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LBA4b-0007XD-Ej for qemu-devel@nongnu.org; Fri, 12 Dec 2008 10:37:02 -0500 Received: from [199.232.76.173] (port=38078 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBA4b-0007Wo-77 for qemu-devel@nongnu.org; Fri, 12 Dec 2008 10:37:01 -0500 Received: from mx2.redhat.com ([66.187.237.31]:58618) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LBA4a-00055f-Pz for qemu-devel@nongnu.org; Fri, 12 Dec 2008 10:37:01 -0500 From: Eduardo Habkost Date: Fri, 12 Dec 2008 13:09:05 -0200 Message-Id: <1229094550-2022-27-git-send-email-ehabkost@redhat.com> In-Reply-To: <1229094550-2022-1-git-send-email-ehabkost@redhat.com> References: <1229094550-2022-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 26/31] target-ppc/helper.c: LOG_MMU_STATE macro Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Eduardo Habkost Create a LOG_MMU_STATE macro and use it instead of #ifdef DEBUG_MMU. Signed-off-by: Eduardo Habkost --- 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