From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrl53-0002Xj-Sb for qemu-devel@nongnu.org; Mon, 11 May 2015 06:37:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yrl50-00083y-E9 for qemu-devel@nongnu.org; Mon, 11 May 2015 06:37:01 -0400 Received: from cantor2.suse.de ([195.135.220.15]:37312 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrl50-00083i-8h for qemu-devel@nongnu.org; Mon, 11 May 2015 06:36:58 -0400 Message-ID: <5550863F.6080009@suse.de> Date: Mon, 11 May 2015 12:36:47 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <6920fa40d097d15d0cfcaf63c26b6325ee5edc46.1431322749.git.crosthwaite.peter@gmail.com> <55508206.5040206@suse.de> <55508368.3010300@redhat.com> In-Reply-To: <55508368.3010300@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH 02/34] tcg+qom: QOMify core CPU defintions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Peter Crosthwaite , sorenb@xilinx.com, edgari@xilinx.com, rth@twiddle.net Am 11.05.2015 um 12:24 schrieb Paolo Bonzini: > On 11/05/2015 12:18, Andreas F=E4rber wrote: >>>> + int (*cpu_mmu_index)(CPUState *cpu); >>>> + void (*cpu_get_tb_cpu_state)(CPUState *cpu, >>>> + void *pc, /* target_long * */ >>>> + void *cs_base, /* target_long */ >>>> + int *flags); >>>> + void (*gen_intermediate_code)(void *env, struct TranslationBloc= k *tb); >>>> + void (*gen_intermediate_code_pc)(void *env, struct TranslationB= lock *tb); >>>> + void (*restore_state_to_opc)(void *env, struct TranslationBlock= *tb, >>>> + int pc_pos); >>>> + void (*tlb_fill)(CPUState *cs, uint64_t addr, int is_write, int= mmu_idx, >>>> + uintptr_t retaddr); >>>> } CPUClass; >>>> =20 >>>> #ifdef HOST_WORDS_BIGENDIAN >> [snip] >> >> Paolo had objected to this when I tried it. The counter-suggestion was >> something about reworking how the cputlb code is built per target - >> please check the archives. >=20 > Right. My point was that these functions are not polymorphic. Each > call to these should know exactly which function to call. >=20 > cputlb.c, cpu-exec.c and parts of translate-all.c should be the moral > equivalent of C++ templates. I wouldn't mind switching to C++, but if > we want to make them polymorphic we should do it at compile time throug= h > multiple compilation and/or inclusion from target-*. I think we got more concrete than that, possibly on IRC only? I believe #include'ing cputlb.c from some target-* file was one of your proposed solutions? And splitting some of the inline functions that I was getting rid of into some new (or existing?) file? Andreas --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB 21284 (AG N=FCrnberg)