qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 11/17] lm32: system control model


From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH 11/17] lm32: system control model
Date: Sat, 12 Feb 2011 09:54:38 +0200

On Sat, Feb 12, 2011 at 12:35 AM, Michael Walle <address@hidden> wrote:
> Am Freitag 11 Februar 2011, 22:03:40 schrieb Blue Swirl:
>> > +static int lm32_sys_init(SysBusDevice *dev)
>> > +{
>> > +    LM32SysState *s = FROM_SYSBUS(typeof(*s), dev);
>> > +    int sys_regs;
>> > +
>> > +    sys_regs = cpu_register_io_memory(sys_read_fn, sys_write_fn, s,
>> > +            DEVICE_NATIVE_ENDIAN);
>> > +    sysbus_init_mmio(dev, R_MAX * 4, sys_regs);
>> > +    sysbus_mmio_map(dev, 0, s->base);
>>
>> Devices should not map themselves or care what is their address.
>> Please remove base field and qdev property and move the mapping to
>> board level.
>
> I added this because the device isn't created in the board initialization.
> Instead it can be added with -device, if needed. Who does the mapping in this
> case?

Since SysBus does not map the devices like PCI, there would be nothing
to map the device. Maybe self-mapping isn't so incorrect in this case.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]