From patchwork Thu Dec 20 02:14:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?6Zmz6Z+L5Lu7?= X-Patchwork-Id: 207600 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 062EF2C00A7 for ; Thu, 20 Dec 2012 13:14:55 +1100 (EST) Received: from localhost ([::1]:33371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlVeu-0005el-K4 for incoming@patchwork.ozlabs.org; Wed, 19 Dec 2012 21:14:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlVej-0005eT-MV for qemu-devel@nongnu.org; Wed, 19 Dec 2012 21:14:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TlVed-0007v4-9P for qemu-devel@nongnu.org; Wed, 19 Dec 2012 21:14:41 -0500 Received: from csmailer.cs.nctu.edu.tw ([140.113.235.130]:14338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlVeb-0007ub-CF for qemu-devel@nongnu.org; Wed, 19 Dec 2012 21:14:35 -0500 Received: from csmailer.cs.nctu.edu.tw (localhost [127.0.0.1]) by csmailer.cs.nctu.edu.tw (Postfix) with ESMTP id B20E44D3; Thu, 20 Dec 2012 10:14:24 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cs.nctu.edu.tw; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to:content-transfer-encoding; s=rsa1024; bh=+qgUqC5qJgKTWUCgdJlTVRtu8Q0=; b=cmrQbR8o24KrzC3TkB4Ff5zK/Ajw vAfoiphxiNr9hstwIPTxZXn91gB5+cA3pPC5XCGROYJXk8JysCA+wXmejsEYB+iQ fn+SZrqCRvT2WuZwpOYaE2Ub5FVPd5z1+82CETcvRaJg8vaoDf3R6c6qpwy7Aiwb cbvwK4S/GxDceF8= Received: from alumni.cs.nctu.edu.tw (alumni.cs.nctu.edu.tw [140.113.235.116]) by csmailer.cs.nctu.edu.tw (Postfix) with ESMTP id 840B84D2; Thu, 20 Dec 2012 10:14:24 +0800 (CST) Received: (from chenwj@localhost) by alumni.cs.nctu.edu.tw (8.14.5/8.14.5/Submit) id qBK2EKMu012162; Thu, 20 Dec 2012 10:14:20 +0800 (CST) (envelope-from chenwj) Date: Thu, 20 Dec 2012 10:14:20 +0800 From: =?utf-8?B?6Zmz6Z+L5Lu7IChXZWktUmVuIENoZW4p?= To: li guang Message-ID: <20121220021420.GA11565@cs.nctu.edu.tw> References: <20121210161555.GA44699@cs.nctu.edu.tw> <20121220012318.GA10284@cs.nctu.edu.tw> <1355968783.19189.7.camel@liguang.fnst.cn.fujitsu.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1355968783.19189.7.camel@liguang.fnst.cn.fujitsu.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 140.113.235.130 Cc: Aurelien Jarno , qemu-devel@nongnu.org, =?utf-8?B?6Zmz6Z+L5Lu7IChXZWktUmVuIENoZW4p?= , "Johnson, Eric" Subject: Re: [Qemu-devel] [PATCH] target-mips: Use EXCP_SC rather than a magic number X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Hi Li, > > > Signed-off-by: Chen Wei-Ren > > > --- > > > target-mips/op_helper.c | 6 +++--- > > > 1 files changed, 3 insertions(+), 3 deletions(-) > > > > > > diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c > > > index f45d494..98a445c 100644 > > > --- a/target-mips/op_helper.c > > > +++ b/target-mips/op_helper.c > > > @@ -39,10 +39,10 @@ static inline void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env, > > > uintptr_t pc) > > > { > > > TranslationBlock *tb; > > > -#if 1 > > > - if (exception < 0x100) > > > + if (exception < EXCP_SC) { > > > qemu_log("%s: %d %d\n", __func__, exception, error_code); > > > -#endif > > > + } > > > + > > seems original '#if 1, #endif' statement > is for temporary debug only, > so maybe can be concealed out entirely. > for log purpose, every exception code > will log when 'do_interrupt' for MIPS > if log is enabled. Thanks for your feedback. You mean the code snippet below? --- target-mips/helper.c void do_interrupt (CPUMIPSState *env) { ... if (qemu_log_enabled() && env->exception_index != EXCP_EXT_INTERRUPT) { if (env->exception_index < 0 || env->exception_index > EXCP_LAST) name = "unknown"; else name = excp_names[env->exception_index]; qemu_log("%s enter: PC " TARGET_FMT_lx " EPC " TARGET_FMT_lx " %s exception\n", __func__, env->active_tc.PC, env->CP0_EPC, name); } ... } Maybe we can do this way? --- --- Aurelien, Johnson, thoughts? :) Regards, chenwj diff --git a/target-mips/cpu.h b/target-mips/cpu.h index 31602ac..507a213 100644 --- a/target-mips/cpu.h +++ b/target-mips/cpu.h @@ -616,9 +616,9 @@ enum { EXCP_DSPDIS, EXCP_LAST = EXCP_DSPDIS, + /* Dummy exception for conditional stores. */ + EXCP_SC = EXCP_LAST, }; -/* Dummy exception for conditional stores. */ -#define EXCP_SC 0x100 /* * This is an interrnally generated WAKE request line.