From patchwork Tue Jan 3 18:16:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 638762 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp1394586pvb; Tue, 3 Jan 2023 10:28:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXuM5vau1F00xJaVmKvA7WiEhSQw69V9nLfKSe7p91dMTAmZS2m3zcVXz4LMffd62/QxBRPe X-Received: by 2002:ac8:43cd:0:b0:3a8:16a9:b343 with SMTP id w13-20020ac843cd000000b003a816a9b343mr52990681qtn.48.1672770520246; Tue, 03 Jan 2023 10:28:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672770520; cv=none; d=google.com; s=arc-20160816; b=VDjv1UHmp7SV9eaKHeWmBbFI+XtDWdfXtiio8RL5jFa7o4BAqlf/rH1DkaQ1MZA8iB QsF74M6FEWrNFlzssRiWNLk4FRfRr4qqX7H8xTSRPeilhChem0EgkgrLgAEYNFUgvtMp wWUjqXt+mQav8peon9N8dqDgHNZTP+3H5RcWiiQBW8Y/Cf4i0rQerHSk19AdqTsgXG9+ YmjcBi15pIt5Pes1KAs5V8xMjhYJr9HPfeFeW+/Bh2vnwbnEi+2IaNEjXEswFSo3Rg2I BilLF46Ou1nsxUFO5/N9zu3ZlvLcZ8+zhGamaQjwkycqvP7OnGh2irCw3o9nEWnc+rXO z4ng== 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=E2/QSQpKB1Wxz1OwWrj4zfmK4ONtqzkfez0TTluzjsI=; b=yT46ZIf5682w45iDnBJjSpe+rQAZ+iFwLFV4eVS6TCjxFLpxvrfZ/PGAQdJ1U1d9SX A5iQeH0y6EAOb6rtQxysVBGaN7QJf3wB5q0O6beEIvFwnOdtxO0wh08WWMZvESKj/3/b lecMFruXDNdOHPeI/Vqte6A0ELbhGtq2qbJG0xmbRrc9mTM+rwuv+J4BSEoc4aA3gdzq Ag0i2SQGB32UunytJUYwLktcQjKP9ngEZ1I7physkYWHj9ReW02reMYZcf2wK4taZnnm GDhu4v17EeQK5+leLH+1USBelVBE+lL35eAcXP2RpfxL6vKqaq0cpqZyMSGyBF1w9/xi +uUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UQgK1skC; 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 x62-20020a379541000000b006f9faedd088si15372456qkd.384.2023.01.03.10.28.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Jan 2023 10:28:40 -0800 (PST) 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=UQgK1skC; 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 1pClrj-0000Vj-MH; Tue, 03 Jan 2023 13:18:23 -0500 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 1pClrc-0000Aw-53 for qemu-devel@nongnu.org; Tue, 03 Jan 2023 13:18:16 -0500 Received: from mail-vs1-xe30.google.com ([2607:f8b0:4864:20::e30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pClra-0005Gi-D0 for qemu-devel@nongnu.org; Tue, 03 Jan 2023 13:18:15 -0500 Received: by mail-vs1-xe30.google.com with SMTP id i188so32588136vsi.8 for ; Tue, 03 Jan 2023 10:18:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=E2/QSQpKB1Wxz1OwWrj4zfmK4ONtqzkfez0TTluzjsI=; b=UQgK1skC3e4rFb4PCxuSHjLP8wiDvcqTC38RJMIDB9R/01AcJPJw7DfBdVqpCbsvD/ lywseIev8sJ1KXqKBkSoSp549UTWXDL/02YH6nzg64/MfhsBDYXthdzMovclf9o/OCdQ BpDCCG1ekKhSXAtZDZs8g9V2kgwA+B+G4iivVsEVQWrW0Xl7FWuzFbZuEWzLqePtMbOy qV5oD3tDy6FX+ZtPFqRHaXBss0Q+NzWwVZBHxhar6PTRbM9ECubwEL5wZ13mYWTHlyTv w9VBMIolcngD1ltRyu2j5dJIE59KoIglX9b3yxgV12uVmSfRxJQo7+eJAzeEbglC/jwM fJjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=E2/QSQpKB1Wxz1OwWrj4zfmK4ONtqzkfez0TTluzjsI=; b=kWc/ZG/zbA0BACJd1A6mKxc2QlyXjbBInwaLkP8ng3h+L7fczMSvPjcgiHYsMRVz+D lK5khw0Zx9DkL7D6YHyNw8nDYVtGmxtLAzHjaRghdv+6iA6MGumGzIo9yTj5RDVFpt7s ISuwSTvMoxPcTkFWBz5pOfBmNx/3EEfXlQsc96vn2091zZxfeLmdpBNBDMC0T2JFi2sJ eziKOPJCaijgT9x59dQ8cQXzV19gUVBRv/qCN9xdTBJsIjXZd5UVbZmZWg4blHpwrdnI Ol2i6wSELkiWEn+rPoX/6wwI9k43kyKb8O+CGZAA9+6HMrrkUU17RFXvCsf4BmDR3lEG M2og== X-Gm-Message-State: AFqh2kqf5W3V74PZH7lmMtuQy5D8VVbz17LL6VZqcQeWBJ3xCOBlKfPx Ta+l0KE15H5vY6RszNN0sbBTS8yKoq9Zy7dcg4A= X-Received: by 2002:a05:6102:3e18:b0:3c5:ec9a:9348 with SMTP id j24-20020a0561023e1800b003c5ec9a9348mr18321561vsv.20.1672769893723; Tue, 03 Jan 2023 10:18:13 -0800 (PST) Received: from stoup.. ([2607:fb90:8060:51a2:184b:6e49:c396:be2]) by smtp.gmail.com with ESMTPSA id v2-20020a05620a440200b006fed2788751sm23042354qkp.76.2023.01.03.10.18.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 10:18:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, berrange@redhat.com, eduardo@habkost.net, armbru@redhat.com, ajones@ventanamicro.com, alex.bennee@linaro.org Subject: [RFC PATCH 28/40] target/arm: Split out xscale*_class_init Date: Tue, 3 Jan 2023 10:16:34 -0800 Message-Id: <20230103181646.55711-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230103181646.55711-1-richard.henderson@linaro.org> References: <20230103181646.55711-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::e30; envelope-from=richard.henderson@linaro.org; helo=mail-vs1-xe30.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 Use two intermediate functions to share code between the 13 variants of pxa*_class_init. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/cpu_tcg.c | 81 +++++++++++++------------------------------- 1 file changed, 23 insertions(+), 58 deletions(-) diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c index c6d50f326e..a3b6940040 100644 --- a/target/arm/cpu_tcg.c +++ b/target/arm/cpu_tcg.c @@ -857,120 +857,85 @@ static void sa1110_class_init(ARMCPUClass *acc) acc->midr = 0x6901B119; } -static void pxa250_class_init(ARMCPUClass *acc) +static void xscale_class_init(ARMCPUClass *acc) { acc->dtb_compatible = "marvell,xscale"; set_class_feature(acc, ARM_FEATURE_V5); set_class_feature(acc, ARM_FEATURE_XSCALE); - acc->midr = 0x69052100; acc->ctr = 0xd172172; acc->reset_sctlr = 0x00000078; } +static void pxa250_class_init(ARMCPUClass *acc) +{ + xscale_class_init(acc); + acc->midr = 0x69052100; +} + static void pxa255_class_init(ARMCPUClass *acc) { - acc->dtb_compatible = "marvell,xscale"; - set_class_feature(acc, ARM_FEATURE_V5); - set_class_feature(acc, ARM_FEATURE_XSCALE); + xscale_class_init(acc); acc->midr = 0x69052d00; - acc->ctr = 0xd172172; - acc->reset_sctlr = 0x00000078; } static void pxa260_class_init(ARMCPUClass *acc) { - acc->dtb_compatible = "marvell,xscale"; - set_class_feature(acc, ARM_FEATURE_V5); - set_class_feature(acc, ARM_FEATURE_XSCALE); + xscale_class_init(acc); acc->midr = 0x69052903; - acc->ctr = 0xd172172; - acc->reset_sctlr = 0x00000078; } static void pxa261_class_init(ARMCPUClass *acc) { - acc->dtb_compatible = "marvell,xscale"; - set_class_feature(acc, ARM_FEATURE_V5); - set_class_feature(acc, ARM_FEATURE_XSCALE); + xscale_class_init(acc); acc->midr = 0x69052d05; - acc->ctr = 0xd172172; - acc->reset_sctlr = 0x00000078; } static void pxa262_class_init(ARMCPUClass *acc) { - acc->dtb_compatible = "marvell,xscale"; - set_class_feature(acc, ARM_FEATURE_V5); - set_class_feature(acc, ARM_FEATURE_XSCALE); + xscale_class_init(acc); acc->midr = 0x69052d06; - acc->ctr = 0xd172172; - acc->reset_sctlr = 0x00000078; +} + +static void xscale_iwmmxt_class_init(ARMCPUClass *acc) +{ + xscale_class_init(acc); + set_class_feature(acc, ARM_FEATURE_IWMMXT); } static void pxa270a0_class_init(ARMCPUClass *acc) { - acc->dtb_compatible = "marvell,xscale"; - set_class_feature(acc, ARM_FEATURE_V5); - set_class_feature(acc, ARM_FEATURE_XSCALE); - set_class_feature(acc, ARM_FEATURE_IWMMXT); + xscale_iwmmxt_class_init(acc); acc->midr = 0x69054110; - acc->ctr = 0xd172172; - acc->reset_sctlr = 0x00000078; } static void pxa270a1_class_init(ARMCPUClass *acc) { - acc->dtb_compatible = "marvell,xscale"; - set_class_feature(acc, ARM_FEATURE_V5); - set_class_feature(acc, ARM_FEATURE_XSCALE); - set_class_feature(acc, ARM_FEATURE_IWMMXT); + xscale_iwmmxt_class_init(acc); acc->midr = 0x69054111; - acc->ctr = 0xd172172; - acc->reset_sctlr = 0x00000078; } static void pxa270b0_class_init(ARMCPUClass *acc) { - acc->dtb_compatible = "marvell,xscale"; - set_class_feature(acc, ARM_FEATURE_V5); - set_class_feature(acc, ARM_FEATURE_XSCALE); - set_class_feature(acc, ARM_FEATURE_IWMMXT); + xscale_iwmmxt_class_init(acc); acc->midr = 0x69054112; - acc->ctr = 0xd172172; - acc->reset_sctlr = 0x00000078; } static void pxa270b1_class_init(ARMCPUClass *acc) { - acc->dtb_compatible = "marvell,xscale"; - set_class_feature(acc, ARM_FEATURE_V5); - set_class_feature(acc, ARM_FEATURE_XSCALE); - set_class_feature(acc, ARM_FEATURE_IWMMXT); + xscale_iwmmxt_class_init(acc); acc->midr = 0x69054113; - acc->ctr = 0xd172172; - acc->reset_sctlr = 0x00000078; } static void pxa270c0_class_init(ARMCPUClass *acc) { - acc->dtb_compatible = "marvell,xscale"; - set_class_feature(acc, ARM_FEATURE_V5); - set_class_feature(acc, ARM_FEATURE_XSCALE); - set_class_feature(acc, ARM_FEATURE_IWMMXT); + xscale_iwmmxt_class_init(acc); acc->midr = 0x69054114; - acc->ctr = 0xd172172; - acc->reset_sctlr = 0x00000078; } static void pxa270c5_class_init(ARMCPUClass *acc) { - acc->dtb_compatible = "marvell,xscale"; - set_class_feature(acc, ARM_FEATURE_V5); - set_class_feature(acc, ARM_FEATURE_XSCALE); - set_class_feature(acc, ARM_FEATURE_IWMMXT); + xscale_iwmmxt_class_init(acc); acc->midr = 0x69054117; - acc->ctr = 0xd172172; - acc->reset_sctlr = 0x00000078; } #ifdef CONFIG_TCG