qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 03/10] hw/arm/realview: Introduce abstract RealviewMachineClass
Date: Wed, 24 May 2023 16:58:59 +0200	[thread overview]
Message-ID: <20230524145906.33156-4-philmd@linaro.org> (raw)
In-Reply-To: <20230524145906.33156-1-philmd@linaro.org>

Introduce the abstract QOM TYPE_REALVIEW_MACHINE to
handle fields common to all Realview machines.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 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,
     }
 };
 
-- 
2.38.1



  parent reply	other threads:[~2023-05-24 15:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24 14:58 [PATCH 00/10] hw/arm/realview: Introduce abstract RealviewMachineClass Philippe Mathieu-Daudé
2023-05-24 14:58 ` [PATCH 01/10] hw/arm/realview: Simplify using 'break' statement Philippe Mathieu-Daudé
2023-05-24 19:00   ` Richard Henderson
2023-05-25 12:43     ` Peter Maydell
2023-05-24 14:58 ` [PATCH 02/10] hw/arm/realview: Declare QOM types using DEFINE_TYPES() macro Philippe Mathieu-Daudé
2023-05-24 19:01   ` Richard Henderson
2023-05-24 14:58 ` Philippe Mathieu-Daudé [this message]
2023-05-24 19:04   ` [PATCH 03/10] hw/arm/realview: Introduce abstract RealviewMachineClass Richard Henderson
2023-05-24 14:59 ` [PATCH 04/10] hw/arm/realview: Factor realview_common_class_init() out Philippe Mathieu-Daudé
2023-05-24 19:05   ` Richard Henderson
2023-05-24 14:59 ` [PATCH 05/10] hw/arm/realview: Move 'board_id' to RealviewMachineClass Philippe Mathieu-Daudé
2023-05-24 19:06   ` Richard Henderson
2023-05-24 14:59 ` [PATCH 06/10] hw/arm/realview: Move 'is_pb' " Philippe Mathieu-Daudé
2023-05-24 19:06   ` Richard Henderson
2023-05-24 14:59 ` [PATCH 07/10] hw/arm/realview: Move 'mpcore_periphbase' " Philippe Mathieu-Daudé
2023-05-24 19:10   ` Richard Henderson
2023-05-24 14:59 ` [PATCH 08/10] hw/arm/realview: Move 'loader_start' " Philippe Mathieu-Daudé
2023-05-24 19:10   ` Richard Henderson
2023-05-24 14:59 ` [PATCH 09/10] hw/arm/realview: Use generic realview_common_machine_init() Philippe Mathieu-Daudé
2023-05-24 19:12   ` Richard Henderson
2023-05-24 14:59 ` [PATCH 10/10] hw/arm/realview: Set MachineClass::default_nic in machine_class_init() Philippe Mathieu-Daudé
2023-05-24 19:13   ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230524145906.33156-4-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).