From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtnKP-0004IK-RY for qemu-devel@nongnu.org; Mon, 01 Jul 2013 19:16:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtnKO-0005BM-O5 for qemu-devel@nongnu.org; Mon, 01 Jul 2013 19:16:13 -0400 Message-ID: <51D20DB5.3070406@suse.de> Date: Tue, 02 Jul 2013 01:16:05 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1372438702-20491-1-git-send-email-pbonzini@redhat.com> <1372438702-20491-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1372438702-20491-2-git-send-email-pbonzini@redhat.com> Content-Type: multipart/mixed; boundary="------------070609030108010209050801" Subject: Re: [Qemu-devel] [PATCH v2 01/11] memory: add owner argument to initialization functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: jan.kiszka@siemens.com, Alexander Graf , qemu-ppc , qemu-devel@nongnu.org, peter.maydell@linaro.org This is a multi-part message in MIME format. --------------070609030108010209050801 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Am 28.06.2013 18:58, schrieb Paolo Bonzini: > Signed-off-by: Paolo Bonzini Since the ppc-next merge, something like the attached is necessary for iommu-for-anythony branch to apply to master. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg --------------070609030108010209050801 Content-Type: text/x-patch; name="owner.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="owner.diff" diff --cc hw/intc/openpic.c index a26c641,5777ece..0000000 --- a/hw/intc/openpic.c +++ b/hw/intc/openpic.c @@@ -1527,17 -1526,9 +1527,17 @@@ static void map_list(OpenPICState *opp } } -static int openpic_init(SysBusDevice *dev) +static void openpic_init(Object *obj) { - OpenPICState *opp = FROM_SYSBUS(typeof (*opp), dev); + OpenPICState *opp = OPENPIC(obj); + - memory_region_init(&opp->mem, "openpic", 0x40000); ++ memory_region_init(&opp->mem, NULL, "openpic", 0x40000); +} + +static void openpic_realize(DeviceState *dev, Error **errp) +{ + SysBusDevice *d = SYS_BUS_DEVICE(dev); + OpenPICState *opp = OPENPIC(dev); int i, j; int list_count = 0; static const MemReg list_le[] = { diff --cc hw/ppc/mac_newworld.c index 3badfa3,28d0f7e..0000000 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@@ -289,13 -279,10 +289,13 @@@ static void ppc_core99_init(QEMUMachine /* Register 8 MB of ISA IO space */ isa_mmio_init(0xf2000000, 0x00800000); - /* UniN init */ - memory_region_init_io(unin_memory, NULL, &unin_ops, NULL, "unin", 0x1000); + /* UniN init: XXX should be a real device */ - memory_region_init_io(unin_memory, &unin_ops, token, "unin", 0x1000); ++ memory_region_init_io(unin_memory, NULL, &unin_ops, token, "unin", 0x1000); memory_region_add_subregion(get_system_memory(), 0xf8000000, unin_memory); - memory_region_init_io(unin2_memory, &unin_ops, token, "unin", 0x1000); ++ memory_region_init_io(unin2_memory, NULL, &unin_ops, token, "unin", 0x1000); + memory_region_add_subregion(get_system_memory(), 0xf3000000, unin2_memory); + openpic_irqs = g_malloc0(smp_cpus * sizeof(qemu_irq *)); openpic_irqs[0] = g_malloc0(smp_cpus * sizeof(qemu_irq) * OPENPIC_OUTPUT_NB); diff --cc hw/ppc/mpc8544_guts.c index d41f615,9d34fd5..0000000 --- a/hw/ppc/mpc8544_guts.c +++ b/hw/ppc/mpc8544_guts.c @@@ -114,14 -108,24 +114,14 @@@ static const MemoryRegionOps mpc8544_gu }, }; -static int mpc8544_guts_initfn(SysBusDevice *dev) +static void mpc8544_guts_initfn(Object *obj) { - GutsState *s; - - s = FROM_SYSBUS(GutsState, SYS_BUS_DEVICE(dev)); + SysBusDevice *d = SYS_BUS_DEVICE(obj); + GutsState *s = MPC8544_GUTS(obj); - memory_region_init_io(&s->iomem, &mpc8544_guts_ops, s, + memory_region_init_io(&s->iomem, NULL, &mpc8544_guts_ops, s, - "mpc6544.guts", MPC8544_GUTS_MMIO_SIZE); - sysbus_init_mmio(dev, &s->iomem); - - return 0; -} - -static void mpc8544_guts_class_init(ObjectClass *klass, void *data) -{ - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - - k->init = mpc8544_guts_initfn; + "mpc8544.guts", MPC8544_GUTS_MMIO_SIZE); + sysbus_init_mmio(d, &s->iomem); } static const TypeInfo mpc8544_guts_info = { diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index 787a4c7..5930ccd 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -104,11 +104,11 @@ static void macio_escc_legacy_setup(MacIOState *macio_state) 0xF0, 0xE0, }; - memory_region_init(escc_legacy, "escc-legacy", 256); + memory_region_init(escc_legacy, NULL, "escc-legacy", 256); for (i = 0; i < ARRAY_SIZE(maps); i += 2) { MemoryRegion *port = g_new(MemoryRegion, 1); - memory_region_init_alias(port, "escc-legacy-port", macio_state->escc_mem, - maps[i+1], 0x2); + memory_region_init_alias(port, NULL, "escc-legacy-port", + macio_state->escc_mem, maps[i + 1], 0x2); memory_region_add_subregion(escc_legacy, maps[i], port); } --------------070609030108010209050801--