From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNUOh-00028w-1f for qemu-devel@nongnu.org; Mon, 16 Feb 2015 17:44:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNUOd-0005OB-Rw for qemu-devel@nongnu.org; Mon, 16 Feb 2015 17:44:10 -0500 Received: from out1134-226.mail.aliyun.com ([42.120.134.226]:10876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNUOd-0005NQ-Gt for qemu-devel@nongnu.org; Mon, 16 Feb 2015 17:44:07 -0500 Message-ID: <54E27485.9010908@sunrus.com.cn> Date: Tue, 17 Feb 2015 06:51:49 +0800 From: Chen Gang S MIME-Version: 1.0 References: <54E1F540.5070900@sunrus.com.cn> <54E1F56E.803@sunrus.com.cn> <54E219F3.5090307@twiddle.net> In-Reply-To: <54E219F3.5090307@twiddle.net> 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: Richard Henderson , Peter Maydell , Chris Metcalf , Riku Voipio , "walt@tilera.com" Cc: qemu-devel On 2/17/15 00:25, Richard Henderson wrote: > 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. > > OK, thanks. What you said sound reasonable to me. I shall send patch v3 if no any additiona reply for patch v2 within 3 days (2015-02-20). And excuse me, I still want to know, is there a real world register as a PC register for tile (e.g. just like 'rip' for x86_64) which can be used by software programer? (is it in SPR?) Thanks. -- Chen Gang Open, share, and attitude like air, water, and life which God blessed