From nobody Wed Nov 27 17:41:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697807113; cv=none; d=zohomail.com; s=zohoarc; b=KUe/vXFnr5kqsSoPBKHt+JE+t3djkRaDKXCtQ/cJjNfSPctZzk+QL26dvy2+vJWSchkYPHrOocOzo+a4riDMdHh+mlEisBGMZpReSfTf88eRPmKBm4d0s9q28+B078bUHo8mstqA1owi+Z7kkX9F/VwlHFAzTMN4/XDds7L9pL4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697807113; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RG5zLlWN/LC4pJbPVJoFLnGQz4i0tpH2bVvTXsYTeOI=; b=FfPyi15W6vQti3rtrlS9fshilU1P5XQ8Yl+CkeB6dbQNXsKYbPPnniyL+E4d62dnWXPquZZTOvucDorc9vKyguo6Ewt+d+Hhak6y3ZFGscJAOPmHBcxF73qwiSeMs9ECszHmxSpfdIe7rtL0xtd0Djy3HEGl7oESruGWzoG9Eo8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697807113794751.1736682575704; Fri, 20 Oct 2023 06:05:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtpAy-0001cy-3G; Fri, 20 Oct 2023 09:04:28 -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 1qtpAr-0000xf-4X for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:22 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtpAn-0005N4-VO for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:20 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9c603e2354fso173640766b.1 for ; Fri, 20 Oct 2023 06:04:17 -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 x20-20020a170906149400b0098884f86e41sm1459879ejc.123.2023.10.20.06.04.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 06:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697807056; x=1698411856; 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=RG5zLlWN/LC4pJbPVJoFLnGQz4i0tpH2bVvTXsYTeOI=; b=LEz5uXfath7rEbO83c35/Oj3IIKvsGh54n6x23rKD0IQlgkDCWUhS9vFYWejXNP3VX n1japTovWUJOzG6NYZBkiAeZKUbPZfTx2wZRZace+8d1Vd2PdcXYrLzc9eHaDwWtLvCR hNxmM/gTdd7xQmO48Xl7TdXZzieECl4nFZgh8qekpYRY3jBUhbmzkwjm3NeRcxQ4czq+ rbMHqABjjAqkMJOADXfKGxrzjB5gpwAgv+h7Th1LBxogLmDxxqKUd2u6AupRCyNzaL1g l3kaULXyjAT+Vf8EAZoIkLDqYFIDe5Oto42GzjOiByFo1zvEFl8rpvppGA1xQQqZMSlq wF0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697807056; x=1698411856; 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=RG5zLlWN/LC4pJbPVJoFLnGQz4i0tpH2bVvTXsYTeOI=; b=IGlsMtEN7GK+QMqi1qalh6clZtEPH/SfaFET/DHL6MhMU+o/vJ3hS/TC9Bfbyristp qCrhPfo8AzmSXV4Ivg+p3crJ5/m6noE+tf92JNvthvH2hufcZ4E792IAcNy9nTxQkslz 7JOkWYMSddkr9yZXcIUYqNxRdlNiOo7APWWOSL8HujPmelOe1nE12cIFLSAvchezQeEI yDWzUTMxWffW3kCuPg5Pk6VSbz2b4n7D6We8z7wn8zK/8VhhT6X0Z8SoC5zhsgOI0q9M c5y54UVqJhOmG0B1iLEMCag2iBVeU4pzJRg9OnfVQQ5kAfAHhWcL1muRgl8D9stBm075 Lw8A== X-Gm-Message-State: AOJu0YzVRF1CLGdwP41uy0vFaxULFpSfoW+FMLBnwJss/KLaScFtP2A7 /5z6BT4PS6MEQv+yvZ2kFmTKoKfMi8Sp0jQ3ejM= X-Google-Smtp-Source: AGHT+IFSyYr+QXqXHLdL+AzrN4GyBpfjG6T0Vk4sBiz6q53mPfqZZlbwtP1N+QytK2ENt5c73/lvpQ== X-Received: by 2002:a17:907:3daa:b0:9bd:81c3:2a85 with SMTP id he42-20020a1709073daa00b009bd81c32a85mr4700129ejc.32.1697807055916; Fri, 20 Oct 2023 06:04:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 7/9] hw/intc/pxa2xx: Pass CPU reference using QOM link property Date: Fri, 20 Oct 2023 15:03:28 +0200 Message-ID: <20231020130331.50048-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020130331.50048-1-philmd@linaro.org> References: <20231020130331.50048-1-philmd@linaro.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=2a00:1450:4864:20::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.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=unavailable 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-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697807114909100017 QOM objects shouldn't access each other internals fields except using the QOM API. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- hw/arm/pxa2xx_pic.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c index 2eb869a605..7e180635c2 100644 --- a/hw/arm/pxa2xx_pic.c +++ b/hw/arm/pxa2xx_pic.c @@ -15,6 +15,7 @@ #include "cpu.h" #include "hw/arm/pxa.h" #include "hw/sysbus.h" +#include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qom/object.h" #include "target/arm/cpregs.h" @@ -288,7 +289,8 @@ DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu) DeviceState *dev =3D qdev_new(TYPE_PXA2XX_PIC); PXA2xxPICState *s =3D PXA2XX_PIC(dev); =20 - s->cpu =3D cpu; + object_property_set_link(OBJECT(dev), "arm-cpu", + OBJECT(cpu), &error_abort); =20 sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 @@ -321,11 +323,18 @@ static const VMStateDescription vmstate_pxa2xx_pic_re= gs =3D { }, }; =20 +static Property pxa2xx_pic_properties[] =3D { + DEFINE_PROP_LINK("arm-cpu", PXA2xxPICState, cpu, + TYPE_ARM_CPU, ARMCPU *), + DEFINE_PROP_END_OF_LIST(), +}; + static void pxa2xx_pic_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 + device_class_set_props(dc, pxa2xx_pic_properties); dc->desc =3D "PXA2xx PIC"; dc->vmsd =3D &vmstate_pxa2xx_pic_regs; rc->phases.hold =3D pxa2xx_pic_reset_hold; --=20 2.41.0