From: "Andreas Färber" <afaerber@suse.de>
To: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 4/5] target-unicore32: QOM'ify CPU
Date: Fri, 30 Mar 2012 23:38:02 +0200 [thread overview]
Message-ID: <4F7627BA.4010308@suse.de> (raw)
In-Reply-To: <20120330161530.GD22887@illuin>
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 <afaerber@suse.de>
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 <afaerber@suse.de>
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
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-03-30 22:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-30 10:26 [Qemu-devel] [PULL] QOM CPUState for unicore32 Andreas Färber
2012-03-30 10:26 ` [Qemu-devel] [PATCH v3 1/5] MAINTAINERS: Add entry for UniCore32 Andreas Färber
2012-03-30 10:26 ` [Qemu-devel] [PATCH v3 2/5] target-unicore32: Relicense to GPLv2+ Andreas Färber
2012-03-30 10:26 ` [Qemu-devel] [PATCH v3 3/5] target-unicore32: License future contributions under GPLv2+ Andreas Färber
2012-03-30 10:26 ` [Qemu-devel] [PATCH v3 4/5] target-unicore32: QOM'ify CPU Andreas Färber
2012-03-30 16:15 ` Michael Roth
2012-03-30 21:38 ` Andreas Färber [this message]
2012-03-30 23:04 ` Michael Roth
2012-03-30 10:26 ` [Qemu-devel] [PATCH v3 5/5] target-unicore32: Move CPU-dependent init into initfn Andreas Färber
2012-03-31 13:03 ` [Qemu-devel] [PULL] QOM CPUState for unicore32 Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F7627BA.4010308@suse.de \
--to=afaerber@suse.de \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).