Received: from [140.186.70.92] (port=42846 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Po1a6-0001Jl-Ty for qemu-devel@nongnu.org; Fri, 11 Feb 2011 17:35:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Po1a5-0005PB-Jf for qemu-devel@nongnu.org; Fri, 11 Feb 2011 17:35:14 -0500 Received: from mail.serverraum.org ([78.47.150.89]:37865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Po1a5-0005Of-D9 for qemu-devel@nongnu.org; Fri, 11 Feb 2011 17:35:13 -0500 From: Michael Walle Subject: Re: [Qemu-devel] [PATCH 11/17] lm32: system control model Date: Fri, 11 Feb 2011 23:35:10 +0100 References: <1297379530-23487-1-git-send-email-michael@walle.cc> <1297379530-23487-12-git-send-email-michael@walle.cc> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201102112335.10845.michael@walle.cc> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: "Edgar E. Iglesias" , Richard Henderson , qemu-devel@nongnu.org, Alexander Graf 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