From patchwork Tue Dec 12 16:29:08 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: 753092 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp2010441wrs; Tue, 12 Dec 2023 08:31:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlT/0PMg0cfgfQzAoo2lSUsU8ijoyPacAIMSa6ta+L/XK0mmT2lpD+foHyVuMkitpnt507 X-Received: by 2002:a05:620a:2910:b0:77f:964:1797 with SMTP id m16-20020a05620a291000b0077f09641797mr7474738qkp.132.1702398698110; Tue, 12 Dec 2023 08:31:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702398698; cv=none; d=google.com; s=arc-20160816; b=GrYVmWt7LLgiuky8FRBZxd3MNvhLwwZIHJCvRESGni+2tzSLfEXmLHguhhGWlQQSUF V8WftmqF514IiAFIKIWF950Fk0SpYguL/fAOrQ8yuC/qhNvnr3NDDglUqiHTQyaSr3ie /QaO3y5APawlHKxWGC+dZzYgrO8JkPOddVGtkP+V+Y7zvfBtWEJTE6893bxeyFOFFxY3 D9kkUmEwonfbzSbpU3W1k2vBiqig6cyfNJdL0XVn5873Q/pbMiwZGFciIOXRJnURZgRS ZAl+sZZGiyECi/QYmdo/EQ9EN9vpadfWU05tzIaY8isy0tfuhoTMJzAPcIekKMd8HIQN HvjQ== 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=hjt6Wlk39I28ykvvxAfjim08zez2NFi+ssDQvlNXSBg=; fh=CkupYgn1Qmdh7jizui9HJgGegpqbRR5NXz1VyjRE1Hs=; b=xSwwJ5cJV9cvmsoqYnDvldJ3ckmCVSzL2uQZqmqelNCNJUV4WHXvCK7IqrWHH80mLv +0HdTiSmez+cLD9J4xoIXAdjbmRALdMNAeLtt5r81H6EfQ6WIQUgOkRTv0hEQMehhG9D EQq2oxmIezyISIl920NH/QvjbVFnnVAifhGPUwmcZ6U9lyXwh0GO3GnAIt2fCStwoW3S lpY5pFD+l4814zk5OzQTQIud/8SqBccFtTVoP7ewNXgPiy5npoVfl61cnRRijjw4otv1 NTLQmfbiMofuTbmHGyLZlMNM/XTB5o1cjh9TCXQBcFTSReE/6QU0by1UG6F0HC60SXU5 eKVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HZhUe0aA; 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 c4-20020a37e104000000b0077d9591c7f6si794940qkm.107.2023.12.12.08.31.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 08:31:38 -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=HZhUe0aA; 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 1rD5en-0001dG-MF; Tue, 12 Dec 2023 11:30:53 -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 1rD5eg-0001Jm-4x for qemu-devel@nongnu.org; Tue, 12 Dec 2023 11:30:47 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rD5ed-0007P3-65 for qemu-devel@nongnu.org; Tue, 12 Dec 2023 11:30:45 -0500 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a1f653e3c3dso609298566b.2 for ; Tue, 12 Dec 2023 08:30:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702398640; x=1703003440; 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=hjt6Wlk39I28ykvvxAfjim08zez2NFi+ssDQvlNXSBg=; b=HZhUe0aA5zKXofYritihmc156kAvslduCKYM090IfTH1s/RNXRnS1qqfzqJEC/enXY 2fxVypcFCSRT9nf5uUU2OKjU0B/WaC5iKAgh3UWEpfYwiBBUEE8U/4kRHjCVUd8vtkrD n0kwTPYMLP9fbCw33pll19CXHlMnFbywUKrwP7K4u6YRlHEE0Yk3EAk38bxPNPNE93YA 4wfZNEH0ccGQ+zIYEAIQ7M2n0+V+XvcdNhy47PZlzPyL8VqMWV26JLDEEmSV/VaWv3Lt lWwVusj6XVzofxx3DVpfBrT1bEeS2/iPYCU45+9aXMtHzRVggqzrAVB2ZAJTmU0Xzfvg j8Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702398640; x=1703003440; 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=hjt6Wlk39I28ykvvxAfjim08zez2NFi+ssDQvlNXSBg=; b=lgKo+ahT8cJfu1qFEAOiaLFTTj13GiS9TZjQ5e4DXisGlUbLxvoO1GgzK1NxyF4eWq dmqSE0q0kYO6xgNzvvz1Fj+/AOazFU4fypPuCTl64Tp1HoXwB2rXvWEqQT2e6eyJLrD6 R7O01LVFxNDEmpyHqny3vlcxluI0SHWyHWzT/dPehnb2B8Cf4ZVXhjoML27uu+pP8PeU E+3bhVoMkGFuZHZx1zCWYW+49qdpXM6NLAcGogiGmiSB9UrnnQJCivWJMYU8EOc1kaLp vRGFvn9TtuYx9Jmbn87DLQFLW+sF0f0/i7xGCsrLmVKLBdfss5nEC2rrYlAY8kOpXsFD zjBQ== X-Gm-Message-State: AOJu0YxRXai8RyHYNJuy0WrBVwqL4dKvGdrSTG8Jho+3t1X8GrZ8JKbl ca5fxlZchX1gReJogZwfx4bVJA1T4ijlpGI5hNA= X-Received: by 2002:a17:906:225b:b0:a00:152a:1efa with SMTP id 27-20020a170906225b00b00a00152a1efamr1843142ejr.3.1702398639820; Tue, 12 Dec 2023 08:30:39 -0800 (PST) Received: from m1x-phil.lan ([176.176.175.193]) by smtp.gmail.com with ESMTPSA id rr17-20020a170907899100b00a1d457954d6sm6462970ejc.75.2023.12.12.08.30.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 12 Dec 2023 08:30:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Tyrone Ting , =?utf-8?q?Alex_Benn=C3=A9e?= , Manos Pitsidianakis , Eduardo Habkost , Joel Stanley , Alistair Francis , Anton Johansson , Andrey Smirnov , Peter Maydell , Hao Wu , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jean-Christophe Dubois , Igor Mitsyanko , "Edgar E. Iglesias" , Andrew Jeffery , Rob Herring , qemu-arm@nongnu.org, Mark Cave-Ayland , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 08/33] hw/cpu/arm: Declare CPU QOM types using DEFINE_TYPES() macro Date: Tue, 12 Dec 2023 17:29:08 +0100 Message-ID: <20231212162935.42910-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231212162935.42910-1-philmd@linaro.org> References: <20231212162935.42910-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.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 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. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater --- hw/cpu/a15mpcore.c | 21 +++++++++------------ hw/cpu/a9mpcore.c | 21 +++++++++------------ hw/cpu/arm11mpcore.c | 21 +++++++++------------ hw/cpu/realview_mpcore.c | 21 +++++++++------------ 4 files changed, 36 insertions(+), 48 deletions(-) diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c index a40f142128..c2ee985fb4 100644 --- a/hw/cpu/a15mpcore.c +++ b/hw/cpu/a15mpcore.c @@ -164,17 +164,14 @@ static void a15mp_priv_class_init(ObjectClass *klass, void *data) /* We currently have no saveable state */ } -static const TypeInfo a15mp_priv_info = { - .name = TYPE_A15MPCORE_PRIV, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(A15MPPrivState), - .instance_init = a15mp_priv_initfn, - .class_init = a15mp_priv_class_init, +static const TypeInfo a15mp_types[] = { + { + .name = TYPE_A15MPCORE_PRIV, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(A15MPPrivState), + .instance_init = a15mp_priv_initfn, + .class_init = a15mp_priv_class_init, + }, }; -static void a15mp_register_types(void) -{ - type_register_static(&a15mp_priv_info); -} - -type_init(a15mp_register_types) +DEFINE_TYPES(a15mp_types) diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c index d03f57e579..6b5ce01246 100644 --- a/hw/cpu/a9mpcore.c +++ b/hw/cpu/a9mpcore.c @@ -178,17 +178,14 @@ static void a9mp_priv_class_init(ObjectClass *klass, void *data) device_class_set_props(dc, a9mp_priv_properties); } -static const TypeInfo a9mp_priv_info = { - .name = TYPE_A9MPCORE_PRIV, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(A9MPPrivState), - .instance_init = a9mp_priv_initfn, - .class_init = a9mp_priv_class_init, +static const TypeInfo a9mp_types[] = { + { + .name = TYPE_A9MPCORE_PRIV, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(A9MPPrivState), + .instance_init = a9mp_priv_initfn, + .class_init = a9mp_priv_class_init, + }, }; -static void a9mp_register_types(void) -{ - type_register_static(&a9mp_priv_info); -} - -type_init(a9mp_register_types) +DEFINE_TYPES(a9mp_types) diff --git a/hw/cpu/arm11mpcore.c b/hw/cpu/arm11mpcore.c index 89c4e35143..74f44434de 100644 --- a/hw/cpu/arm11mpcore.c +++ b/hw/cpu/arm11mpcore.c @@ -153,17 +153,14 @@ static void mpcore_priv_class_init(ObjectClass *klass, void *data) device_class_set_props(dc, mpcore_priv_properties); } -static const TypeInfo mpcore_priv_info = { - .name = TYPE_ARM11MPCORE_PRIV, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(ARM11MPCorePriveState), - .instance_init = mpcore_priv_initfn, - .class_init = mpcore_priv_class_init, +static const TypeInfo arm11mp_types[] = { + { + .name = TYPE_ARM11MPCORE_PRIV, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(ARM11MPCorePriveState), + .instance_init = mpcore_priv_initfn, + .class_init = mpcore_priv_class_init, + }, }; -static void arm11mpcore_register_types(void) -{ - type_register_static(&mpcore_priv_info); -} - -type_init(arm11mpcore_register_types) +DEFINE_TYPES(arm11mp_types) diff --git a/hw/cpu/realview_mpcore.c b/hw/cpu/realview_mpcore.c index 7480b38d1a..b140888618 100644 --- a/hw/cpu/realview_mpcore.c +++ b/hw/cpu/realview_mpcore.c @@ -114,17 +114,14 @@ static void mpcore_rirq_class_init(ObjectClass *klass, void *data) dc->realize = realview_mpcore_realize; } -static const TypeInfo mpcore_rirq_info = { - .name = TYPE_REALVIEW_MPCORE_RIRQ, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(mpcore_rirq_state), - .instance_init = mpcore_rirq_init, - .class_init = mpcore_rirq_class_init, +static const TypeInfo realview_mpcore_types[] = { + { + .name = TYPE_REALVIEW_MPCORE_RIRQ, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(mpcore_rirq_state), + .instance_init = mpcore_rirq_init, + .class_init = mpcore_rirq_class_init, + }, }; -static void realview_mpcore_register_types(void) -{ - type_register_static(&mpcore_rirq_info); -} - -type_init(realview_mpcore_register_types) +DEFINE_TYPES(realview_mpcore_types)