From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDkrw-0003Do-OA for qemu-devel@nongnu.org; Fri, 30 Mar 2012 19:04:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDkrv-0003nz-0C for qemu-devel@nongnu.org; Fri, 30 Mar 2012 19:04:32 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:53468) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDkru-0003nL-PH for qemu-devel@nongnu.org; Fri, 30 Mar 2012 19:04:30 -0400 Received: by obbwd20 with SMTP id wd20so1764665obb.4 for ; Fri, 30 Mar 2012 16:04:28 -0700 (PDT) Sender: fluxion Date: Fri, 30 Mar 2012 18:04:23 -0500 From: Michael Roth Message-ID: <20120330230423.GB5699@illuin> References: <1333103170-13529-1-git-send-email-afaerber@suse.de> <1333103170-13529-5-git-send-email-afaerber@suse.de> <20120330161530.GD22887@illuin> <4F7627BA.4010308@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4F7627BA.4010308@suse.de> 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: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: qemu-devel@nongnu.org On Fri, Mar 30, 2012 at 11:38:02PM +0200, Andreas Färber wrote: > Am 30.03.2012 18:15, schrieb Michael Roth: > > On Fri, Mar 30, 2012 at 12:26:09PM +0200, Andreas Färber wrote: > >> +static void unicore_ii_cpu_initfn(Object *obj) > >> +{ > >> + UniCore32CPU *cpu = UNICORE32_CPU(obj); > >> + CPUUniCore32State *env = &cpu->env; > >> + > >> + env->cp0.c0_cpuid = 0x40010863; > > > > Any reason not to use UC32_CPUID_UCV2 here, and UC32_CPUID_ANY below? > > > >> +} > >> + > >> +static void uc32_any_cpu_initfn(Object *obj) > >> +{ > >> + UniCore32CPU *cpu = UNICORE32_CPU(obj); > >> + CPUUniCore32State *env = &cpu->env; > >> + > >> + env->cp0.c0_cpuid = 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ärber > 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ärber > > 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). Ahh, gotcha, thanks (and agreed) > > Andreas > > -- > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg >