summary refs log tree commit diff stats
path: root/hw/intc/loongson_ipi.c
diff options
context:
space:
mode:
authorBibo Mao <maobibo@loongson.cn>2025-01-07 11:08:15 +0800
committerBibo Mao <maobibo@loongson.cn>2025-01-15 14:27:02 +0800
commitce78dacf7e9b22dcc121dca17b1a3bcd93751680 (patch)
tree03f5db5cdb5eeb27bc0a3683161a338834c5e7e9 /hw/intc/loongson_ipi.c
parent5b82177addba2487c3c0e1b1974c0076a5a36342 (diff)
downloadfocaccia-qemu-ce78dacf7e9b22dcc121dca17b1a3bcd93751680.tar.gz
focaccia-qemu-ce78dacf7e9b22dcc121dca17b1a3bcd93751680.zip
hw/intc/loongson_ipi: Remove property num_cpu from loongson_ipi_common
With mips64 loongson ipi, num_cpu property is used. With loongarch
ipi, num_cpu can be acquired from possible_cpu_arch_ids.

Here remove property num_cpu from loongson_ipi_common, and put it into
loongson and loongarch ipi separately.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Diffstat (limited to 'hw/intc/loongson_ipi.c')
-rw-r--r--hw/intc/loongson_ipi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c
index 1ed39b90ea..29e92d48fd 100644
--- a/hw/intc/loongson_ipi.c
+++ b/hw/intc/loongson_ipi.c
@@ -7,6 +7,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/intc/loongson_ipi.h"
+#include "hw/qdev-properties.h"
 #include "qapi/error.h"
 #include "target/mips/cpu.h"
 
@@ -75,6 +76,10 @@ static void loongson_ipi_unrealize(DeviceState *dev)
     k->parent_unrealize(dev);
 }
 
+static const Property loongson_ipi_properties[] = {
+    DEFINE_PROP_UINT32("num-cpu", LoongsonIPICommonState, num_cpu, 1),
+};
+
 static void loongson_ipi_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
@@ -85,6 +90,7 @@ static void loongson_ipi_class_init(ObjectClass *klass, void *data)
                                     &lic->parent_realize);
     device_class_set_parent_unrealize(dc, loongson_ipi_unrealize,
                                       &lic->parent_unrealize);
+    device_class_set_props(dc, loongson_ipi_properties);
     licc->get_iocsr_as = get_iocsr_as;
     licc->cpu_by_arch_id = cpu_by_arch_id;
 }