From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDkSP-0005lL-KF for qemu-devel@nongnu.org; Fri, 30 Mar 2012 18:38:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDkSN-00023K-Te for qemu-devel@nongnu.org; Fri, 30 Mar 2012 18:38:09 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38136 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDkSN-00021X-KB for qemu-devel@nongnu.org; Fri, 30 Mar 2012 18:38:07 -0400 Message-ID: <4F7627BA.4010308@suse.de> Date: Fri, 30 Mar 2012 23:38:02 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1333103170-13529-1-git-send-email-afaerber@suse.de> <1333103170-13529-5-git-send-email-afaerber@suse.de> <20120330161530.GD22887@illuin> In-Reply-To: <20120330161530.GD22887@illuin> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 4/5] target-unicore32: QOM'ify CPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: qemu-devel@nongnu.org Am 30.03.2012 18:15, schrieb Michael Roth: > On Fri, Mar 30, 2012 at 12:26:09PM +0200, Andreas F=E4rber wrote: >> +static void unicore_ii_cpu_initfn(Object *obj) >> +{ >> + UniCore32CPU *cpu =3D UNICORE32_CPU(obj); >> + CPUUniCore32State *env =3D &cpu->env; >> + >> + env->cp0.c0_cpuid =3D 0x40010863; >=20 > Any reason not to use UC32_CPUID_UCV2 here, and UC32_CPUID_ANY below? >=20 >> +} >> + >> +static void uc32_any_cpu_initfn(Object *obj) >> +{ >> + UniCore32CPU *cpu =3D UNICORE32_CPU(obj); >> + CPUUniCore32State *env =3D &cpu->env; >> + >> + env->cp0.c0_cpuid =3D 0xffffffff; >> +} Yes. Like for target-arm, the idea is to deprecate the use of CPUID-dependent common code. For unicore32 we are in the lucky position of being able to do that right away: commit f8eb3e1d3f4e04b79513655f68fa23a43a31c74c Author: Andreas F=E4rber Date: Fri Mar 30 23:19:20 2012 +0200 target-unicore32: Drop UC32_CPUID macros Any code that depends on a particular CPU type can now go through callbacks on the QOM UniCore32CPUClass. Signed-off-by: Andreas F=E4rber diff --git a/target-unicore32/cpu.h b/target-unicore32/cpu.h index 81c14ff..50d5695 100644 --- a/target-unicore32/cpu.h +++ b/target-unicore32/cpu.h @@ -120,10 +120,6 @@ void cpu_asr_write(CPUUniCore32State *env1, target_ulong val, target_ulong mask) #define UC32_HWCAP_CMOV 4 /* 1 << 2 */ #define UC32_HWCAP_UCF64 8 /* 1 << 3 */ -#define UC32_CPUID(env) (env->cp0.c0_cpuid) -#define UC32_CPUID_UCV2 0x40010863 -#define UC32_CPUID_ANY 0xffffffff - #define cpu_init uc32_cpu_init #define cpu_exec uc32_cpu_exec #define cpu_signal_handler uc32_cpu_signal_handler But that can be done as follow-up IMO (just like adding reset support). Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg