[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1 6/6] arm: a9mpcore: Coreify the SCU
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH v1 6/6] arm: a9mpcore: Coreify the SCU |
Date: |
Mon, 18 Feb 2013 21:19:39 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2 |
Am 18.02.2013 19:49, schrieb Peter Maydell:
> On 8 February 2013 04:03, Peter Crosthwaite
> <address@hidden> wrote:
>> Split the SCU in a9mpcore out into its own object definition. mpcore is now
>> just a container for the mpcore components.
>
> Good idea.
>
>> --- a/hw/a9mpcore.c
>> +++ b/hw/a9mpcore.c
>> @@ -14,107 +14,12 @@
>>
>> typedef struct A9MPPrivState {
>> SysBusDevice busdev;
>> - uint32_t scu_control;
>> - uint32_t scu_status;
>> uint32_t num_cpu;
>> - MemoryRegion scu_iomem;
>> MemoryRegion container;
>> DeviceState *gic;
>> uint32_t num_irq;
>> } A9MPPrivState;
>
> You need to add a DeviceState* for the scu.
No, not a DeviceState*, an A9SCUState. With object_initialize() and
qdev_set_parent_bus(NULL) instead of qdev_create() to be exact and some
child<A9SCUState> property for ownership transfer. 2/7 and commit
message say why.
>> diff --git a/hw/a9scu.c b/hw/a9scu.c
>> new file mode 100644
>> index 0000000..0a3d411
>> --- /dev/null
>> +++ b/hw/a9scu.c
[...]
>> +static void a9_scu_class_init(ObjectClass *klass, void *data)
>> +{
>> + DeviceClass *dc = DEVICE_CLASS(klass);
>> + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
>> +
>> + k->init = a9_scu_init;
>
> This should have an instance_init and/or realize method,
> not a SysBusDeviceClass::init (see comments on PL330 patch).
>
>> + dc->props = a9_scu_properties;
>> + dc->vmsd = &vmstate_a9_scu;
>> + dc->reset = a9_scu_reset;
>> +}
>> +
>> +static TypeInfo a9_scu_info = {
static const
Regards,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg