From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUK1K-0006XN-H9 for qemu-devel@nongnu.org; Fri, 12 Feb 2016 15:08:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aUK1H-0003ZO-9W for qemu-devel@nongnu.org; Fri, 12 Feb 2016 15:08:50 -0500 Received: from mail.uni-paderborn.de ([131.234.142.9]:38488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUK1H-0003Xm-2K for qemu-devel@nongnu.org; Fri, 12 Feb 2016 15:08:47 -0500 References: <1455206520-6465-1-git-send-email-kbastian@mail.uni-paderborn.de> <1455206520-6465-2-git-send-email-kbastian@mail.uni-paderborn.de> <56BD45D4.7000408@twiddle.net> <56BDBE2D.6020209@mail.uni-paderborn.de> <56BE2A89.6050905@twiddle.net> From: Bastian Koppelmann Message-ID: <56BE3BC3.2020209@mail.uni-paderborn.de> Date: Fri, 12 Feb 2016 21:08:35 +0100 MIME-Version: 1.0 In-Reply-To: <56BE2A89.6050905@twiddle.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/5] target-tricore: Add trap handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org On 02/12/2016 07:55 PM, Richard Henderson wrote: > On 02/12/2016 10:12 PM, Bastian Koppelmann wrote: >> On 02/12/2016 03:39 AM, Richard Henderson wrote: >> >> What do you mean by "pre-interrupt state"? The register context is saved >> by generate_trap() calls. > > Because do_interrupt is normally for handling asynchronous interrupts. > Stuff that isn't related at all to the instruction stream. Which > therefore could not have saved anything at all. > Ah, I see. This makes a lot of sense now. I didn't know that do_interrupt() is only for asynchronous interrupts. > It does get (ab)used on some targets for synchronous events, because the > method by which kernel entry is made is the same and the author wanted > to share code. > > But if you have no external hardware devices, no timer interrupt or > anything, let's not start by passing synchronous events through this > function. It sounds like the code here in do_interrupt more properly > belongs at the end of generate_trap. > > Err.. the generate_trap in op_helper I mean. It's confusing that you > have two (static) functions of the same name in different files. Fair enough. I guess it makes sense to always use the helper for generate_trap, since a helper call is necessary anyways. > > I do wonder if these two functions ought to share more code. For > instance, op_helper.c places TIN into a_15, whereas translate.c places > TIN into d_15. Woops... good catch :). Thanks for the review. Cheers, Bastian