From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWeRJ-0007Hn-Gw for qemu-devel@nongnu.org; Tue, 01 Sep 2015 01:49:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWeRE-0003GA-HR for qemu-devel@nongnu.org; Tue, 01 Sep 2015 01:49:01 -0400 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:35149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWeRE-0003Fv-6Y for qemu-devel@nongnu.org; Tue, 01 Sep 2015 01:48:56 -0400 Received: by pacdd16 with SMTP id dd16so164382711pac.2 for ; Mon, 31 Aug 2015 22:48:55 -0700 (PDT) Sender: Richard Henderson References: <1440433079-14458-1-git-send-email-rth@twiddle.net> <1440433079-14458-30-git-send-email-rth@twiddle.net> From: Richard Henderson Message-ID: <55E53C44.2070402@twiddle.net> Date: Mon, 31 Aug 2015 22:48:52 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v14 29/33] target-tilegx: Handle mtspr, mfspr List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "walt@tilera.com" , Chris Metcalf , QEMU Developers , Chen Gang On 08/30/2015 08:18 AM, Peter Maydell wrote: >> +static const TileSPR *find_spr(unsigned spr) >> +{ >> + /* Allow the compiler to construct the binary search tree. */ > > This feels a bit overly clever to me but if we only have > three registers anyway it doesn't matter much. I was just forward looking to system mode. There's a *lot* of sprs defined in spr_def_64.h. >> + D(SIM_CONTROL, >> + offsetof(CPUTLGState, spregs[TILEGX_SPR_CRITICAL_SEC]), 0, 0) >> + D(INTERRUPT_CRITICAL_SECTION, >> + offsetof(CPUTLGState, spregs[TILEGX_SPR_SIM_CONTROL]), 0, 0) > > Aren't the offsets on these two backwards ? Fixed, thanks. r~