From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQiId-0000Qx-TX for qemu-devel@nongnu.org; Thu, 29 Jun 2017 18:52:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQiIZ-0003Lx-7k for qemu-devel@nongnu.org; Thu, 29 Jun 2017 18:52:35 -0400 Date: Thu, 29 Jun 2017 18:52:25 -0400 From: "Emilio G. Cota" Message-ID: <20170629225225.GA13979@flamenco> References: <149865219962.17063.10630533069463266646.stgit@frigg.lan> <149865244195.17063.11938084353514091141.stgit@frigg.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <149865244195.17063.11938084353514091141.stgit@frigg.lan> Subject: Re: [Qemu-devel] [PATCH v11 01/29] Pass generic CPUState to gen_intermediate_code() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Llu=EDs?= Vilanova Cc: qemu-devel@nongnu.org, Alex =?iso-8859-1?Q?Benn=E9e?= , Richard Henderson , Peter Crosthwaite , Paolo Bonzini , Peter Maydell , "Edgar E. Iglesias" , Eduardo Habkost , Michael Walle , Laurent Vivier , Aurelien Jarno , Yongbok Kim , Anthony Green , Chris Wulff , Marek Vasut , Stafford Horne , David Gibson , Alexander Graf , Mark Cave-Ayland , Artyom Tarasenko , Bastian Koppelmann , Guan Xuetao , Max Filippov , "open list:ARM" , "open list:PowerPC" On Wed, Jun 28, 2017 at 15:20:42 +0300, Lluís Vilanova wrote: > Needed to implement a target-agnostic gen_intermediate_code() in the > future. > > Signed-off-by: Lluís Vilanova > Reviewed-by: David Gibson > Reviewed-by: Richard Henderson > --- (snip) > -void gen_intermediate_code(CPUAlphaState *env, struct TranslationBlock *tb) > +void gen_intermediate_code(CPUState *cpu, struct TranslationBlock *tb) > { > - AlphaCPU *cpu = alpha_env_get_cpu(env); > - CPUState *cs = CPU(cpu); > + CPUAlphaState *env = cpu->env_ptr; I'd keep the original variable names, i.e. cs for CPUState in this case, just like you did for a64: > -void gen_intermediate_code_a64(ARMCPU *cpu, TranslationBlock *tb) > +void gen_intermediate_code_a64(CPUState *cs, TranslationBlock *tb) > { > - CPUState *cs = CPU(cpu); > - CPUARMState *env = &cpu->env; > + CPUARMState *env = cs->env_ptr; > + ARMCPU *cpu = arm_env_get_cpu(env); This will keep the diff size to a minimum. E.