[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC 4/7] qom: Introduce CPU class
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH RFC 4/7] qom: Introduce CPU class |
Date: |
Mon, 30 Jan 2012 12:58:44 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0 |
Am 30.01.2012 03:14, schrieb Anthony Liguori:
> On 01/29/2012 07:25 AM, Andreas Färber wrote:
>> +static TypeInfo cpu_type_info = {
>> + .name = TYPE_CPU,
>> + .parent = TYPE_OBJECT,
>> + .instance_size = sizeof(CPU),
>
>
> Probably want to do CPUState or something of that nature so that you can
> use CPU() as a dynamic_cast macro.
Yeah, I stumbled upon that but didn't need it so far. CPUState is
already taken by the old concept.
In an earlier version I had used CPUCore (CPU_CORE()) but then I thought
that doesn't sound right for HyperThreading (CPU -> cores -> threads).
Since QEMU so far uses the term "CPU" for all of those I went with that.
Any better suggestions?
> BTW, if the class_size == parent.class_size you don't need to define or
> specific the class.
I'm sorry? You mean we don't need CPUClass yet because it doesn't add
anything to ObjectClass yet? I was planning on having a reset function
defined there, to be called in place of current aliased cpu_reset(). For
that to work I am emptying cpu_arm_reset() step by step (cf. 9/7) until
it can defer to:
(*CPU_GET_CLASS(ENV_GET_OBJECT(env))->reset)(ENV_GET_OBJECT(env));
I've been thinking along the lines of: if something doesn't change at
runtime then it goes into a class.
Or did you mean something else?
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- [Qemu-devel] [PATCH RFC 0/7] Introduce QOM CPU and use for target-arm, Andreas Färber, 2012/01/29
- [Qemu-devel] [PATCH RFC 2/7] qom: Register QOM infrastructure early, Andreas Färber, 2012/01/29
- [Qemu-devel] [PATCH RFC 3/7] qom: Add QOM support to user emulators, Andreas Färber, 2012/01/29
- [Qemu-devel] [PATCH RFC 5/7] cpu: Introduce cpu_class_foreach(), Andreas Färber, 2012/01/29
- [Qemu-devel] [PATCH 1/7][RESEND] qom: Introduce object_class_is_abstract(), Andreas Färber, 2012/01/29
- [Qemu-devel] [PATCH RFC 4/7] qom: Introduce CPU class, Andreas Färber, 2012/01/29
- [Qemu-devel] [PATCH RFC 6/7] target-arm: Introduce QOM CPU and use for it CPUID lookup, Andreas Färber, 2012/01/29
- [Qemu-devel] [PATCH RFC 7/7] target-arm: Embed CPUARMState in QOM ARMCPU, Andreas Färber, 2012/01/29
- [Qemu-devel] [PATCH RFC 8/7] target-arm: Use IoC for CPU init, Andreas Färber, 2012/01/29