From patchwork Tue Oct 10 09:28:56 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: 731448 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1641992wrw; Tue, 10 Oct 2023 02:34:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9UqDCDPI/K556yIP/VPnzv58Vmg4M55jN656Axervr9z0I7dGPdKwqf/I1KDtahidzDOY X-Received: by 2002:a05:620a:2584:b0:774:1012:8220 with SMTP id x4-20020a05620a258400b0077410128220mr22012241qko.23.1696930452776; Tue, 10 Oct 2023 02:34:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696930452; cv=none; d=google.com; s=arc-20160816; b=g1DEezYeWo12jMAZgv6ettNQ26kEH/Wz0Dv4/qzLH10uQZ9iZ5e9nfsRZ3O7yNSkMw LKyUiRgALt4GActidMhj56I5ngZBdSFozkWBGmamDm1wpRr/cqFH/r9nDqC3RA5v68P5 C37B+FJxiR/9jUl0DBD6ylemr6R8+BV4D36rK7bWNl4MCkCrw63dDcOxr9lvir/rBqjS PJCoZyK6a4AO56+rr4gQThTanEQLu7a9mBXth+xcCU9ecxLmlCxCzEcQUnYkMCeUiW89 PAS8oz6u5oVuYpnHZrXqtI7AD5Jti49ZhJ3v0fr0iZf7J0Q4g58S+fRbVIiZmROppyiT AW6w== 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=g9ac00GoAEt719cFFz9dDP5blE56OLyiS+6SiHpN8FY=; fh=iupQBrmerAoZOw8v6swRnyYBx+6KhbF7AbBF1Jawaz4=; b=fRiyEEMflqj+k6Pr6yrxd77K5zYnRJIpUUZLlHsem0jOCargcnPR3wlGbYE9Nb+a/J JF3YNnFHo3hsG+EiVLwi76U6xRzLxwZn0U0CGvFmIdqXFnYfAE05Fj4ly0b6U9j8l48s S+/mMJ9CUfj23tAyy85lCIxYzF9OilSc6WOwI3PLY6wxYmHkd301LYgcIRphNUbeWUaR XbuVny2QE1Y7dvh5e/p08aIKeH1+Mvmwplou6vFVmEH24A9ttXMXhzQxltdDppt+/Opg d6pze2QcArH2+gNZBAcf6wUkjKv5slCP45drVmc95E7oRXRDfIy+3XIZgo/KIU7+vcR3 fgAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VeZUhIXa; 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 tn24-20020a05620a3c1800b00775a1063051si7243816qkn.501.2023.10.10.02.34.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2023 02:34:12 -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=VeZUhIXa; 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 1qq95p-0004ma-Ll; Tue, 10 Oct 2023 05:31:57 -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 1qq950-0001T9-Fo for qemu-devel@nongnu.org; Tue, 10 Oct 2023 05:31:12 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qq94x-0008Im-Jx for qemu-devel@nongnu.org; Tue, 10 Oct 2023 05:31:06 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-9ae2cc4d17eso972571766b.1 for ; Tue, 10 Oct 2023 02:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696930261; x=1697535061; 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=g9ac00GoAEt719cFFz9dDP5blE56OLyiS+6SiHpN8FY=; b=VeZUhIXa7yITGBMlRC2CGpsswo4w8gObX6ZDxgI6G1p1kmiDdIKZjdtoo/7OaUgjMr ZocoIgpgOw9JKxGVtVPx5JNYgx9Jb7hdwG+vzk4Jp8OwjhBl0jgBSfUTtRULfaS8a579 u7o20Zz+Lc6+M5ydNQcvRHKDyxAasRHivRBUs+m6DkGavdzW9ND7XRS949kitVILuao2 74/vtNsBUcoEL0lQnSQG6A9J/MQ3Aq2aR83qex8YQMsLlJgmgErTLYMOb64bdFuIyvmW sFOBi6ag5SmdRwh7ELHg9cf2448lN8gKJNzKKuCP623bK9YbJLe219Uy2nh1CF/jWMJy f2JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696930261; x=1697535061; 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=g9ac00GoAEt719cFFz9dDP5blE56OLyiS+6SiHpN8FY=; b=UFpyAr4IJncKdjEUxJQaL87pACqdUJT6HHEe48VQw7+RGjxx4+Wy38G/TcX6eqOMuV cwSHNLp6wkJndfHBP30MRwvSvOmXZVBG8guGFXvdDBgGFtTzB87JbxSnGnksOSbMO2Ey LKUodp/DfISemmsJDKllrg4I7yRPK8FGrnw3Cr/uJz7UsmNJ+UwsfpIohe0++EX/6LkL dA5QwgFdmchu4h5li+hcDSr7sWxmtdlZch7OPiNPWG1n3GPCDBe6/7NcKeVUSqdtCN/c LjemIJOANCNFZRubcZlm791DKxL9wyombvgwcBgnosCa2ZD3ivU409M+ZlA6d5ZYvKqt f1pg== X-Gm-Message-State: AOJu0YxAWb5v05evffDSBpG9U0m47otDMatfPIm6ZRLM+x13uaSNAS52 YbBojKtaNn714v5AOypLbi9aLoSSkJ/3X04weoy8rg== X-Received: by 2002:a17:906:74db:b0:9ad:e0e0:d6ab with SMTP id z27-20020a17090674db00b009ade0e0d6abmr17089848ejl.12.1696930261008; Tue, 10 Oct 2023 02:31:01 -0700 (PDT) Received: from m1x-phil.lan (aif79-h01-176-172-113-148.dsl.sta.abo.bbox.fr. [176.172.113.148]) by smtp.gmail.com with ESMTPSA id n12-20020a170906378c00b0099d45ed589csm8100822ejc.125.2023.10.10.02.30.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 10 Oct 2023 02:31:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Hildenbrand , "Michael S. Tsirkin" , Song Gao , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Laurent Vivier , Bastian Koppelmann , qemu-arm@nongnu.org, Jiaxun Yang , Ilya Leoshkevich , Yoshinori Sato , Paolo Bonzini , Weiwei Li , Nicholas Piggin , qemu-riscv@nongnu.org, "Edgar E. Iglesias" , Bin Meng , Yanan Wang , Palmer Dabbelt , Alistair Francis , Aleksandar Rikalo , Daniel Henrique Barboza , Marek Vasut , Peter Maydell , qemu-ppc@nongnu.org, Michael Rolnik , Max Filippov , Mark Cave-Ayland , Laurent Vivier , Stafford Horne , Thomas Huth , Chris Wulff , Sergio Lopez , Xiaojuan Yang , Richard Henderson , Liu Zhiwei , Artyom Tarasenko , Daniel Henrique Barboza , Eduardo Habkost , Brian Cain , Marcel Apfelbaum , Aurelien Jarno , qemu-s390x@nongnu.org Subject: [PATCH 14/18] target/sparc: Declare CPU QOM types using DEFINE_TYPES() macro Date: Tue, 10 Oct 2023 11:28:56 +0200 Message-ID: <20231010092901.99189-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231010092901.99189-1-philmd@linaro.org> References: <20231010092901.99189-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review. In few commits we are going to add more types, so replace the type_register_static() to ease further reviews. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Mark Cave-Ayland --- target/sparc/cpu.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 8ba96ae225..1e66413e94 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -924,17 +924,21 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops = &sparc_tcg_ops; } -static const TypeInfo sparc_cpu_type_info = { - .name = TYPE_SPARC_CPU, - .parent = TYPE_CPU, - .instance_size = sizeof(SPARCCPU), - .instance_align = __alignof(SPARCCPU), - .instance_init = sparc_cpu_initfn, - .abstract = true, - .class_size = sizeof(SPARCCPUClass), - .class_init = sparc_cpu_class_init, +static const TypeInfo sparc_cpu_types[] = { + { + .name = TYPE_SPARC_CPU, + .parent = TYPE_CPU, + .instance_size = sizeof(SPARCCPU), + .instance_align = __alignof(SPARCCPU), + .instance_init = sparc_cpu_initfn, + .abstract = true, + .class_size = sizeof(SPARCCPUClass), + .class_init = sparc_cpu_class_init, + } }; +DEFINE_TYPES(sparc_cpu_types) + static void sparc_cpu_cpudef_class_init(ObjectClass *oc, void *data) { SPARCCPUClass *scc = SPARC_CPU_CLASS(oc); @@ -959,7 +963,6 @@ static void sparc_cpu_register_types(void) { int i; - type_register_static(&sparc_cpu_type_info); for (i = 0; i < ARRAY_SIZE(sparc_defs); i++) { sparc_register_cpudef_type(&sparc_defs[i]); }