From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LB9ew-0007nQ-4D for qemu-devel@nongnu.org; Fri, 12 Dec 2008 10:10:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LB9eq-0007eO-3D for qemu-devel@nongnu.org; Fri, 12 Dec 2008 10:10:25 -0500 Received: from [199.232.76.173] (port=50394 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LB9eo-0007e6-VB for qemu-devel@nongnu.org; Fri, 12 Dec 2008 10:10:23 -0500 Received: from mx2.redhat.com ([66.187.237.31]:33022) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LB9en-0001f7-SK for qemu-devel@nongnu.org; Fri, 12 Dec 2008 10:10:22 -0500 From: Eduardo Habkost Date: Fri, 12 Dec 2008 13:09:07 -0200 Message-Id: <1229094550-2022-29-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 28/31] target-ppc/translate.c: LOG_DISAS 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_DISAS macro and use it instead of #ifdef PPC_DEBUG_DISAS. Signed-off-by: Eduardo Habkost --- target-ppc/translate.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 848cdf0..a5a3752 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -43,6 +43,14 @@ //#define DO_PPC_STATISTICS //#define OPTIMIZE_FPRF_UPDATE +#ifdef PPC_DEBUG_DISAS +# define LOG_DISAS(...) do { \ + if (loglevel & CPU_LOG_TB_IN_ASM) \ + fprintf(logfile, ## __VA_ARGS__); \ + } while (0) +#else +# define LOG_DISAS(...) do { } while (0) +#endif /*****************************************************************************/ /* Code translation helpers */ @@ -7784,13 +7792,9 @@ static always_inline void gen_intermediate_code_internal (CPUState *env, gen_opc_icount[lj] = num_insns; } } -#if defined PPC_DEBUG_DISAS - if (loglevel & CPU_LOG_TB_IN_ASM) { - fprintf(logfile, "----------------\n"); - fprintf(logfile, "nip=" ADDRX " super=%d ir=%d\n", - ctx.nip, ctx.mem_idx, (int)msr_ir); - } -#endif + LOG_DISAS("----------------\n"); + LOG_DISAS("nip=" ADDRX " super=%d ir=%d\n", + ctx.nip, ctx.mem_idx, (int)msr_ir); if (num_insns + 1 == max_insns && (tb->cflags & CF_LAST_IO)) gen_io_start(); if (unlikely(ctx.le_mode)) { @@ -7798,13 +7802,9 @@ static always_inline void gen_intermediate_code_internal (CPUState *env, } else { ctx.opcode = ldl_code(ctx.nip); } -#if defined PPC_DEBUG_DISAS - if (loglevel & CPU_LOG_TB_IN_ASM) { - fprintf(logfile, "translate opcode %08x (%02x %02x %02x) (%s)\n", + LOG_DISAS("translate opcode %08x (%02x %02x %02x) (%s)\n", ctx.opcode, opc1(ctx.opcode), opc2(ctx.opcode), opc3(ctx.opcode), little_endian ? "little" : "big"); - } -#endif ctx.nip += 4; table = env->opcodes; num_insns++; -- 1.5.5.GIT