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: Michael Walle
Subject: Re: [Qemu-devel] [PATCH 11/17] lm32: system control model
Date: Fri, 11 Feb 2011 23:35:10 +0100
User-agent: KMail/1.13.5 (Linux/2.6.32-5-686-bigmem; KDE/4.4.5; i686; ; )

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?

-- 
Michael



reply via email to

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