summary refs log tree commit diff stats
path: root/hw/intc/loongson_ipi.c
diff options
context:
space:
mode:
authorBibo Mao <maobibo@loongson.cn>2024-07-23 11:25:53 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-08-06 10:22:52 +0200
commit7e555781e4b681becf79ad4f89cfb66a43f8a9d0 (patch)
treedc3763085615596a72b4f052d3e693e3276d2c02 /hw/intc/loongson_ipi.c
parent530e6daf74bf506ee8133a490722b5f24aa54744 (diff)
downloadfocaccia-qemu-7e555781e4b681becf79ad4f89cfb66a43f8a9d0.tar.gz
focaccia-qemu-7e555781e4b681becf79ad4f89cfb66a43f8a9d0.zip
hw/intc/loongson_ipi: Add TYPE_LOONGSON_IPI_COMMON stub
Introduce LOONGSON_IPI_COMMON stubs, QDev parent of LOONGSON_IPI.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
[PMD: Extracted from bigger commit, added commit description]
Co-Developed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Tested-by: Bibo Mao <maobibo@loongson.cn>
Acked-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Tested-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Message-Id: <20240805180622.21001-4-philmd@linaro.org>
Diffstat (limited to 'hw/intc/loongson_ipi.c')
-rw-r--r--hw/intc/loongson_ipi.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c
index 8aab7e48e8..7d15c28e94 100644
--- a/hw/intc/loongson_ipi.c
+++ b/hw/intc/loongson_ipi.c
@@ -374,9 +374,12 @@ static Property ipi_properties[] = {
 static void loongson_ipi_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
+    LoongsonIPIClass *lic = LOONGSON_IPI_CLASS(klass);
 
-    dc->realize = loongson_ipi_realize;
-    dc->unrealize = loongson_ipi_unrealize;
+    device_class_set_parent_realize(dc, loongson_ipi_realize,
+                                    &lic->parent_realize);
+    device_class_set_parent_unrealize(dc, loongson_ipi_unrealize,
+                                      &lic->parent_unrealize);
     device_class_set_props(dc, ipi_properties);
     dc->vmsd = &vmstate_loongson_ipi;
 }
@@ -384,8 +387,9 @@ static void loongson_ipi_class_init(ObjectClass *klass, void *data)
 static const TypeInfo loongson_ipi_types[] = {
     {
         .name               = TYPE_LOONGSON_IPI,
-        .parent             = TYPE_SYS_BUS_DEVICE,
+        .parent             = TYPE_LOONGSON_IPI_COMMON,
         .instance_size      = sizeof(LoongsonIPIState),
+        .class_size         = sizeof(LoongsonIPIClass),
         .class_init         = loongson_ipi_class_init,
     }
 };