From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 702DBC433F5 for ; Sun, 12 Sep 2021 08:03:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 138DC60F92 for ; Sun, 12 Sep 2021 08:03:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 138DC60F92 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ilande.co.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:37896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPKSy-0002fz-1D for qemu-devel@archiver.kernel.org; Sun, 12 Sep 2021 04:03:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPKFr-0003Wr-MB for qemu-devel@nongnu.org; Sun, 12 Sep 2021 03:50:26 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:35078 helo=mail.default.ilande.bv.iomart.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPKFn-0002te-EY for qemu-devel@nongnu.org; Sun, 12 Sep 2021 03:50:23 -0400 Received: from host109-153-76-56.range109-153.btcentralplus.com ([109.153.76.56] helo=kentang.home) by mail.default.ilande.bv.iomart.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mPKFW-00034U-Nu; Sun, 12 Sep 2021 08:50:06 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, laurent@vivier.eu Date: Sun, 12 Sep 2021 08:49:10 +0100 Message-Id: <20210912074914.22048-17-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210912074914.22048-1-mark.cave-ayland@ilande.co.uk> References: <20210912074914.22048-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 109.153.76.56 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 16/20] nubus-bridge: embed the NubusBus object directly within nubus-bridge X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.bv.iomart.io) Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.bv.iomart.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Since nubus-bridge is a container for NubusBus then it should be embedded directly within the bridge device using qbus_create_inplace(). Signed-off-by: Mark Cave-Ayland --- hw/m68k/q800.c | 2 +- hw/nubus/mac-nubus-bridge.c | 7 ++++--- hw/nubus/nubus-bridge.c | 3 ++- include/hw/nubus/nubus.h | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index 46befe0898..e34df1a829 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -397,7 +397,7 @@ static void q800_init(MachineState *machine) sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, NUBUS_SLOT_BASE + 9 * NUBUS_SLOT_SIZE); - nubus = NUBUS_BRIDGE(dev)->bus; + nubus = &NUBUS_BRIDGE(dev)->bus; /* framebuffer in nubus slot #9 */ diff --git a/hw/nubus/mac-nubus-bridge.c b/hw/nubus/mac-nubus-bridge.c index c16cfc4ab3..c23d5d508d 100644 --- a/hw/nubus/mac-nubus-bridge.c +++ b/hw/nubus/mac-nubus-bridge.c @@ -18,18 +18,19 @@ static void mac_nubus_bridge_init(Object *obj) MacNubusBridge *s = MAC_NUBUS_BRIDGE(obj); NubusBridge *nb = NUBUS_BRIDGE(obj); SysBusDevice *sbd = SYS_BUS_DEVICE(obj); + NubusBus *bus = &nb->bus; /* Macintosh only has slots 0x9 to 0xe available */ - nb->bus->slot_available_mask = 0x7e00; + bus->slot_available_mask = 0x7e00; /* Aliases for slots 0x9 to 0xe */ memory_region_init_alias(&s->super_slot_alias, obj, "super-slot-alias", - &nb->bus->nubus_mr, + &bus->nubus_mr, 9 * NUBUS_SUPER_SLOT_SIZE, 6 * NUBUS_SUPER_SLOT_SIZE); memory_region_init_alias(&s->slot_alias, obj, "slot-alias", - &nb->bus->nubus_mr, + &bus->nubus_mr, NUBUS_SLOT_BASE + 9 * NUBUS_SLOT_SIZE, 6 * NUBUS_SLOT_SIZE); diff --git a/hw/nubus/nubus-bridge.c b/hw/nubus/nubus-bridge.c index 3b68d4435c..1adda7f5a6 100644 --- a/hw/nubus/nubus-bridge.c +++ b/hw/nubus/nubus-bridge.c @@ -16,8 +16,9 @@ static void nubus_bridge_init(Object *obj) { NubusBridge *s = NUBUS_BRIDGE(obj); + NubusBus *bus = &s->bus; - s->bus = NUBUS_BUS(qbus_create(TYPE_NUBUS_BUS, DEVICE(s), NULL)); + qbus_create_inplace(bus, sizeof(s->bus), TYPE_NUBUS_BUS, DEVICE(s), NULL); } static void nubus_bridge_class_init(ObjectClass *klass, void *data) diff --git a/include/hw/nubus/nubus.h b/include/hw/nubus/nubus.h index b62c7e1077..503ebf0c1c 100644 --- a/include/hw/nubus/nubus.h +++ b/include/hw/nubus/nubus.h @@ -61,7 +61,7 @@ struct NubusDevice { struct NubusBridge { SysBusDevice parent_obj; - NubusBus *bus; + NubusBus bus; }; #endif -- 2.20.1