From patchwork Fri Oct 20 15:06:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 736254 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp354249wrl; Fri, 20 Oct 2023 08:08:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBMZkiPMhzr1h0TdF1rNJ9KdNgAfeqoY8BzzXpygVF3PDVHqVr3jtMuycPAzEeXzYsX0zO X-Received: by 2002:a05:620a:24cb:b0:777:2aeb:7dfa with SMTP id m11-20020a05620a24cb00b007772aeb7dfamr1923798qkn.38.1697814510530; Fri, 20 Oct 2023 08:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697814510; cv=none; d=google.com; s=arc-20160816; b=pBOLvtSHlLRCmiqqCvOO7p0aZNnzjwTsZfAgzSvEqyPfhLcjtphNepVxdudzSuxcRx 5ZhTDmj0HB+Dhsgvk+X8Hz5I+DA1dL9KQFovCYExjVSuwfxJvO1TCtQdWvhNBlFRoIKr E4nMlEiov1FxCehcWKzONVhn464JI558N6pRQghASnfv5VwZR661GcTLiWHtJD5Xt6Eo jlbawllbEs5ydUdPHoqmkCyJIv3LBvnO/p4jxP9HMTD0yEWaYTEMygl5uAOy0hb9n/HI y4xC4uRSWVklHD2wW0TnbH/795/Rm1u+CoJNcY+p/tPIre98i3I2Y0pEcBL2oXlugmGe Nl/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5z5NktVu9Z3pjJNFKKbdLfwCXi08dnJZpEWAcQaa1vg=; fh=6K1MWX6u3jkCueyV8jYuo9x2BPi9GJqFYEKyGoRKT0U=; b=PjgnbEQ2dGSWR3H3awI3vzqzbvThhjsqQdQB5g9Ek4r9hv8SjFfB69RxVbfMnZIWXL KLoB1T1/YFzbsA2QlP8HDssK+xqvu1udP4t5HkJDNxXqcLWsSKcdMbMEv5Kz7lYQUzZO 5wSNXuSeK/Ukey+2n6XZUlxWbBJxAOsSce8BpRlXzKo32LtrUAzzD3rqHbjgrnR+KWkk MYj/mgxZkWr3nFvdDp+Fsl24KlYsmBZjI5ztBUVcw6SNG8pgSYHT8JGBYHf73PMzty29 li/9+1AhbTCt5e5+e8krjzJYN/nJWED9jV1ANbpFMwA80FGhKGlB3qi4ulnlrkJMgmJO CEjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r1YIj93W; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u8-20020a05620a430800b007788ccf40f3si1489430qko.510.2023.10.20.08.08.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 08:08:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r1YIj93W; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtr5X-0005so-96; Fri, 20 Oct 2023 11:06:59 -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 1qtr5W-0005j1-5e for qemu-devel@nongnu.org; Fri, 20 Oct 2023 11:06:58 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtr5Q-0001Ma-AW for qemu-devel@nongnu.org; Fri, 20 Oct 2023 11:06:57 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9c75ceea588so142262666b.3 for ; Fri, 20 Oct 2023 08:06:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697814410; x=1698419210; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5z5NktVu9Z3pjJNFKKbdLfwCXi08dnJZpEWAcQaa1vg=; b=r1YIj93WUSMi2ovpYgFOf6NZfLwK7fczygGvAZ/3OKiTXzoQBid4lN0RWd0gfPzoFA UGO3ipZmYImqH0trxXAfQ/gtutuqk3eaWtWi8+g0eUujAAX40N/mlYL+W8ibzXsoc6cN 0rrqRuLkUp6J31LZnXkEJPUXydHX3iU0zbc1cYEL6ixwGytJp7IaMZYb0KE4r5T3flQJ AaOlaQDMFZEaqEvCYaVWMF/5lXFvzj+StR7pb4hBMfXhE4y87WrElvgqjGH4dz9ZgcuV OVnkF+ZPpr6iiZ2rTGxZ8JB35fJj/f3yRdeCezywaNqC8IxhpZV1cu3bSr8Kfs/G7Zuf qqyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697814410; x=1698419210; 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=5z5NktVu9Z3pjJNFKKbdLfwCXi08dnJZpEWAcQaa1vg=; b=dm5nrPpKGZ3sAdXlvn/vXxsdrXGhf6Dqcir3nuRNiTe0NSyouiw2aJkvdklEgTCqh7 kdQ0Nhv04clts5WWnjlM4atJdaS5wgwnkz1pFAzdRW09i7wkDqcMvdKBfTPNl0Axmh11 cknO6TpdxfgTX25iuQNJ2k1QRTW9BP8blHp+cfLlJpeyslGgAUen/9KoC/df+/IT9inB Qrhp9ewVM6ObnmzC3Vxm6aItCjUSXbUEiuukROoVJRnDFhRuvmTdG5irL6rlaLMTNcWB 6PJBfs3336AVhG5Xg90jf+85pTG0jD7BNDcUkFubVQEIXyW/vuyyrK2zkDJfo67NeZYK BSgA== X-Gm-Message-State: AOJu0YyY71HUVsXqhbA9nwKEtGPp4rtRJ9/iRHeN8TJYgWCGQC0GEgzL 2H7riAZdP/0tAD19sSgZdd4CXEj7vbddHbbbJtg= X-Received: by 2002:a17:907:3d94:b0:9ba:fe6:225 with SMTP id he20-20020a1709073d9400b009ba0fe60225mr1518327ejc.55.1697814410576; Fri, 20 Oct 2023 08:06:50 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id d11-20020a170906040b00b0099bd046170fsm1672198eja.104.2023.10.20.08.06.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 08:06:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Laurent Vivier , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/6] hw/m68k/mcf_intc: Expose MMIO region via SysBus API Date: Fri, 20 Oct 2023 17:06:23 +0200 Message-ID: <20231020150627.56893-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020150627.56893-1-philmd@linaro.org> References: <20231020150627.56893-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Tested-by: Thomas Huth Reviewed-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 = MCF_INTC(obj); memory_region_init_io(&s->iomem, obj, &mcf_intc_ops, s, "mcf", 0x100); + sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->iomem); } static void mcf_intc_class_init(ObjectClass *oc, void *data) @@ -211,7 +212,8 @@ qemu_irq *mcf_intc_init(MemoryRegion *sysmem, s = MCF_INTC(dev); s->cpu = cpu; - memory_region_add_subregion(sysmem, base, &s->iomem); + memory_region_add_subregion(sysmem, base, + sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0)); return qemu_allocate_irqs(mcf_intc_set_irq, s, 64); }