From nobody Wed Nov 27 14:37:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698919712225662.1858333296988; Thu, 2 Nov 2023 03:08:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyUaM-0001ns-4h; Thu, 02 Nov 2023 06:05:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyUaK-0001n7-RY for qemu-devel@nongnu.org; Thu, 02 Nov 2023 06:05:56 -0400 Received: from mail-ej1-f43.google.com ([209.85.218.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyUaJ-0003G6-CB for qemu-devel@nongnu.org; Thu, 02 Nov 2023 06:05:56 -0400 Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-9d274222b5dso113710966b.3 for ; Thu, 02 Nov 2023 03:05:55 -0700 (PDT) Received: from localhost.localdomain (ip-109-42-115-39.web.vodafone.de. [109.42.115.39]) by smtp.gmail.com with ESMTPSA id o21-20020a170906359500b009b97d9ae329sm927236ejb.198.2023.11.02.03.05.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 03:05:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698919554; x=1699524354; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HHTnDGBwSfNOPSScc4QpqW/YOvwGN4xwgsL/sR4G1s0=; b=GTOU9+B5K6gI8OOjDpK21RGIySp6dHrry34g2BLZzrWvywghh1st0hLYabTRhbQ4zl ro7QTh3war/dLA0PyLfmQRJ+no2QJkIteC21y0yDmEFOcstofxvpQVA92bI+UsZh/BYm K1Fl9vOPBK5fmiFlm7CM3wIeQlhjJuzLno5KnP/EaSUmFX6ZOimjelitBCGUzeRbGGnf QkpOWvoKTstEuAsDp5OtitX11nDFTUCq0uG5BfW3VaMjm8qG5PBPFfkNWUAAas0r8cpl baR+EWZieHpBFohMDStzdFGmy6sEPJqVoERw/9ebtR9KfnyyIpByHoqZsq5xzBDXZNzw FwoQ== X-Gm-Message-State: AOJu0YwLJH3PFXH0M3n3ASOfBi0FLWz32qBRgyVt8tiHQpZ2PEjq2cbM ee4Bi/brWpfziUxwhNf4IKw2Fz0liBo= X-Google-Smtp-Source: AGHT+IGzckBwBGe862aCd5akMk2Xj7rAjutFjmZD55tzzq3NmkQ8wBkJ+0GhH9MrlOiC4+C4hFLYGA== X-Received: by 2002:a17:907:3601:b0:9c6:c987:4434 with SMTP id bk1-20020a170907360100b009c6c9874434mr3536547ejc.45.1698919553890; Thu, 02 Nov 2023 03:05:53 -0700 (PDT) From: Thomas Huth To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 03/10] hw/m68k/mcf_intc: Expose MMIO region via SysBus API Date: Thu, 2 Nov 2023 11:05:36 +0100 Message-ID: <20231102100543.4875-4-huth@tuxfamily.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102100543.4875-1-huth@tuxfamily.org> References: <20231102100543.4875-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=209.85.218.43; envelope-from=th.huth@gmail.com; helo=mail-ej1-f43.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1698919712943100008 From: Philippe Mathieu-Daud=C3=A9 QOM objects shouldn't access each other internals fields except using the QOM API. Here the caller of mcf_intc_init() access the MMIO region from the MCF_INTC state. Avoid that by exposing that region via sysbus_init_mmio(), then get it with sysbus_mmio_get_region(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Tested-by: Thomas Huth Reviewed-by: Thomas Huth Message-ID: <20231024083010.12453-4-philmd@linaro.org> Signed-off-by: Thomas Huth --- hw/m68k/mcf_intc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/m68k/mcf_intc.c b/hw/m68k/mcf_intc.c index 4cd30188c0..1f74ea0e14 100644 --- a/hw/m68k/mcf_intc.c +++ b/hw/m68k/mcf_intc.c @@ -173,6 +173,7 @@ static void mcf_intc_instance_init(Object *obj) mcf_intc_state *s =3D MCF_INTC(obj); =20 memory_region_init_io(&s->iomem, obj, &mcf_intc_ops, s, "mcf", 0x100); + sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->iomem); } =20 static void mcf_intc_class_init(ObjectClass *oc, void *data) @@ -211,7 +212,8 @@ qemu_irq *mcf_intc_init(MemoryRegion *sysmem, s =3D MCF_INTC(dev); s->cpu =3D cpu; =20 - memory_region_add_subregion(sysmem, base, &s->iomem); + memory_region_add_subregion(sysmem, base, + sysbus_mmio_get_region(SYS_BUS_DEVICE(dev)= , 0)); =20 return qemu_allocate_irqs(mcf_intc_set_irq, s, 64); } --=20 2.41.0