From patchwork Wed May 24 14:58:59 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: 685362 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp297919wrt; Wed, 24 May 2023 08:00:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6d78vv0TNzATkfU9R1qjAwafO8BaC9j++vPc8Q43VEuIQX4xv5lqL+c4G6wgrRBz86aPL3 X-Received: by 2002:ac8:5fd6:0:b0:3f6:be32:63e8 with SMTP id k22-20020ac85fd6000000b003f6be3263e8mr6351699qta.55.1684940451668; Wed, 24 May 2023 08:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684940451; cv=none; d=google.com; s=arc-20160816; b=NFElb0JGGmIZP25IqpJ4IY+qRWIOH7N+SBq1uIvP0d15y8hr7u3io2TTTNWvQ9oI6p R6FBGh7zBgqWHDRh3OWdPu/KbH9HoHP61d2uu3uAqE19eCV9UHnhTmpUZhOvYQYLp5p7 iZ9Yq8PrKNWtgN1yfu0D0Hc8fqgCOdld/IW3BGvIHPktQJTBgkDB5SvnoOu3SjSctHux CkpEUit7UsT8vpUMg7MdIaSsuX9UVhCVscSJAPAM4rvwRaJH7AFAGzhwHgqkc6IRaLx6 nIqbr6Pr6UqAXwA7/295OYhOQGDyqvHGuZfIEBdLsNi5CcEoTNFdK5q8XCbRbV0d2qt6 z2Yg== 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=50SL7zbNGl/fD7oTGtJ8qBrDyfPUgCnUWKs/hQwlad4=; b=ko7UaSNXcJpEwotP0mOZzBg+Aukamr/0cH1Ug527rb86Q1ELHmrDCHhjnTmuQJ+7lD WmgbLGjysvbvMKBeQuSW0onbh4vnKEoWteuHOpYFfY24tz2fpVA8vH7H5o+nVmUYmsPW Jox2oCn978e0Q/oqLTK4pk/qDGEq98JBrqh8RJAUbt6NemeQDtwV5rBwe0b5LJlPD0c/ A4Y+F9U00DIxQHF8i+cukgP0TykuovIn0S0YLdVmrR/YW5HgpJjYURxSS5is1okbL9uR 5S/zbo2klIS9leBUwEo+cHM5aVyd12tddEY7rwNsLJ+9tGSnCIAOskDz/lzD1cEiyB4Q b70Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NP0MhVp9; 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 g1-20020ac87d01000000b003f541337f13si6581748qtb.689.2023.05.24.08.00.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 08:00:51 -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=NP0MhVp9; 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 1q1pxs-0006Uz-PN; Wed, 24 May 2023 10:59:48 -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 1q1pxc-0006Hf-Eo for qemu-devel@nongnu.org; Wed, 24 May 2023 10:59:32 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1pxZ-0006N3-O5 for qemu-devel@nongnu.org; Wed, 24 May 2023 10:59:32 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-30aa1eb95a0so936528f8f.1 for ; Wed, 24 May 2023 07:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684940365; x=1687532365; 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=50SL7zbNGl/fD7oTGtJ8qBrDyfPUgCnUWKs/hQwlad4=; b=NP0MhVp96M6zkPmX0TGWKygB31Bd/ybIuSWwGmRVrkhPSHTg9+mpoiBof0mDbwlaYq T+HDIO+jixPETamR3yEt8XXovaZ+PtGlOqF5BBf1eiqdadY2V2+Ebc+y2R/Hal1Zua// HXyq86MTGAPh+dIXlcg+oFB+0Gl8knr0ysZencIGWOThoBWv8Rjg7td8k9U5xTK8mLKR 9VWGibobVKNpJuxJk+QQLl0sY2z7cxanCXEin3+ojkcZwl0iMoYBoaG9l1ewfx96lf7n 1nGdLmpEyuZfA4Edy1o1/JReOhR64hY6qmNDx3dPvKZVmpam0DUuyx4A8bb9rTtXuxtc xCYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684940365; x=1687532365; 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=50SL7zbNGl/fD7oTGtJ8qBrDyfPUgCnUWKs/hQwlad4=; b=PliLg8icqs9ct7LDyTptB2U2WgYVjmTt7svRlx0QQv2DoG5wiEhMXtGscPyYNRKpa1 Lq38qFRSl8WCSDS+noxuHoGSUEtKFjHNBTw8pequoj08Fd/tReBHs/KR5UEe+hSd2ubb o4oYPrvOktY439Sx+gMhJj9CXiRsSF4Nsgb1oDWEw+DiqicWuHq2OEVTLXdvIL6wurzq TO3CHVM+qSl15e8/4JbFqC1GxGHwn1c7D3FwPL1c7iuRJpZat0aWC0hOSqRgKCx0QIct qqPAcaRXB81SCvRuS0LdPv3lOnLKMaKEo/LWZMrxpQ6aFtZoRAinhUsvd/+qrUp8VIwq Tn8w== X-Gm-Message-State: AC+VfDwbfmTcFzt1HTjRNVO5qEaz8Ep8xlLLm8GYMqLB/um4qhhuvPg+ gBPROPVUD3a5yxf+dMAnd2k+c1qzpC3mraQ/GmUhgA== X-Received: by 2002:a5d:5002:0:b0:2f6:bf04:c8cc with SMTP id e2-20020a5d5002000000b002f6bf04c8ccmr27678wrt.55.1684940365713; Wed, 24 May 2023 07:59:25 -0700 (PDT) Received: from localhost.localdomain (fac34-h02-176-184-31-193.dsl.sta.abo.bbox.fr. [176.184.31.193]) by smtp.gmail.com with ESMTPSA id n1-20020a5d4001000000b003062ad45243sm14826928wrp.14.2023.05.24.07.59.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 May 2023 07:59:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 03/10] hw/arm/realview: Introduce abstract RealviewMachineClass Date: Wed, 24 May 2023 16:58:59 +0200 Message-Id: <20230524145906.33156-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230524145906.33156-1-philmd@linaro.org> References: <20230524145906.33156-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Introduce the abstract QOM TYPE_REALVIEW_MACHINE to handle fields common to all Realview machines. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/realview.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/hw/arm/realview.c b/hw/arm/realview.c index 07a80d0de3..f0a8a93b08 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -30,6 +30,15 @@ #include "hw/i2c/arm_sbcon_i2c.h" #include "hw/sd/sd.h" +struct RealviewMachineClass { + MachineClass parent_obj; +}; +typedef struct RealviewMachineClass RealviewMachineClass; + +#define TYPE_REALVIEW_MACHINE MACHINE_TYPE_NAME("realview-common") +DECLARE_CLASS_CHECKERS(RealviewMachineClass, + REALVIEW_MACHINE, TYPE_REALVIEW_MACHINE) + #define SMP_BOOT_ADDR 0xe0000000 #define SMP_BOOTREG_ADDR 0x10000030 @@ -448,20 +457,25 @@ static void realview_pbx_a9_class_init(ObjectClass *oc, void *data) static const TypeInfo realview_machine_types[] = { { .name = MACHINE_TYPE_NAME("realview-eb"), - .parent = TYPE_MACHINE, + .parent = TYPE_REALVIEW_MACHINE, .class_init = realview_eb_class_init, }, { .name = MACHINE_TYPE_NAME("realview-eb-mpcore"), - .parent = TYPE_MACHINE, + .parent = TYPE_REALVIEW_MACHINE, .class_init = realview_eb_mpcore_class_init, }, { .name = MACHINE_TYPE_NAME("realview-pb-a8"), - .parent = TYPE_MACHINE, + .parent = TYPE_REALVIEW_MACHINE, .class_init = realview_pb_a8_class_init, }, { .name = MACHINE_TYPE_NAME("realview-pbx-a9"), - .parent = TYPE_MACHINE, + .parent = TYPE_REALVIEW_MACHINE, .class_init = realview_pbx_a9_class_init, + }, { + .name = TYPE_REALVIEW_MACHINE, + .parent = TYPE_MACHINE, + .class_size = sizeof(RealviewMachineClass), + .abstract = true, } };