From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPWr2-0005hm-3w for qemu-devel@nongnu.org; Mon, 17 Mar 2014 08:41:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPWqu-0001Bd-5B for qemu-devel@nongnu.org; Mon, 17 Mar 2014 08:41:20 -0400 Received: from mail-lb0-f175.google.com ([209.85.217.175]:59590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPWqt-0001BR-Tv for qemu-devel@nongnu.org; Mon, 17 Mar 2014 08:41:12 -0400 Received: by mail-lb0-f175.google.com with SMTP id w7so3605934lbi.34 for ; Mon, 17 Mar 2014 05:41:10 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1394134385-1727-1-git-send-email-peter.maydell@linaro.org> <1394134385-1727-6-git-send-email-peter.maydell@linaro.org> From: Peter Maydell Date: Mon, 17 Mar 2014 12:40:50 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v4 05/21] target-arm: Add support for generating exceptions with syndrome information List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Rob Herring , Patch Tracking , Michael Matz , Claudio Fontana , Alexander Graf , "qemu-devel@nongnu.org Developers" , Laurent Desnogues , Dirk Mueller , Will Newton , =?UTF-8?B?QWxleCBCZW5uw6ll?= , "kvmarm@lists.cs.columbia.edu" , Christoffer Dall , Richard Henderson On 17 March 2014 03:19, Peter Crosthwaite wrote: > On Fri, Mar 7, 2014 at 5:32 AM, Peter Maydell wrote: >> -static void gen_exception(int excp) >> +static void gen_exception_internal(int excp) >> { >> - TCGv_i32 tmp = tcg_temp_new_i32(); >> - tcg_gen_movi_i32(tmp, excp); >> - gen_helper_exception(cpu_env, tmp); >> - tcg_temp_free_i32(tmp); >> + TCGv_i32 tcg_excp = tcg_const_i32(excp); >> + >> + assert(excp_is_internal(excp)); >> + gen_helper_exception_internal(cpu_env, tcg_excp); >> + tcg_temp_free_i32(tcg_excp); >> +} >> + > > AFAICT this is identical to gen_exception_internal in translate-a64.c. > Can they be de-static'd and prototyped in internals.h? This is true, but it would break the current situation we have where translate.c and translate-a64.c are entirely independent and you never have to worry about breaking one if you make changes to the other, which is why I didn't do it. Maybe that's not very important, but it didn't seem worth going against for the sake of a couple of helpers just a few lines long. (If we do make them common then translate.h would be the right place for the prototypes.) thanks -- PMM