From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNOUI-0001RX-Fc for qemu-devel@nongnu.org; Mon, 16 Feb 2015 11:25:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNOUC-0004E5-Vi for qemu-devel@nongnu.org; Mon, 16 Feb 2015 11:25:34 -0500 Received: from mail-qg0-x232.google.com ([2607:f8b0:400d:c04::232]:55307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNOUC-0004Du-Ro for qemu-devel@nongnu.org; Mon, 16 Feb 2015 11:25:28 -0500 Received: by mail-qg0-f50.google.com with SMTP id e89so24027990qgf.9 for ; Mon, 16 Feb 2015 08:25:27 -0800 (PST) Sender: Richard Henderson Message-ID: <54E219F3.5090307@twiddle.net> Date: Mon, 16 Feb 2015 08:25:23 -0800 From: Richard Henderson MIME-Version: 1.0 References: <54E1F540.5070900@sunrus.com.cn> <54E1F56E.803@sunrus.com.cn> In-Reply-To: <54E1F56E.803@sunrus.com.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/6 v2] target-tilegx: Firstly add to qemu with minimized features List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chen Gang S , Peter Maydell , Chris Metcalf , Riku Voipio , "walt@tilera.com" Cc: qemu-devel On 02/16/2015 05:49 AM, Chen Gang S wrote: > +#define TILEGX_R_PC 55 /* LR register, pc pointer */ No, register 55 is the link register, not the PC. I.e. it is only special in that it receives the return address from the JAL instructions. > +typedef struct CPUTLState { > + uint64_t regs[56]; > + CPU_COMMON > +} CPUTLState; Which means you need another entry here for the PC. > +static inline void cpu_get_tb_cpu_state(CPUTLState *env, target_ulong *pc, > + target_ulong *cs_base, int *flags) > +{ > + *pc = env->regs[TILEGX_R_PC]; And you should not reference the link register here. r~