7
7
8
8
#include "qemu/osdep.h"
9
9
#include "hw/boards.h"
10
+ #include "qapi/error.h"
10
11
#include "hw/intc/loongarch_ipi.h"
11
12
#include "target/loongarch/cpu.h"
12
13
@@ -49,10 +50,26 @@ static CPUState *loongarch_cpu_by_arch_id(int64_t arch_id)
49
50
return NULL ;
50
51
}
51
52
53
+ static void loongarch_ipi_realize (DeviceState * dev , Error * * errp )
54
+ {
55
+ LoongarchIPIClass * lic = LOONGARCH_IPI_GET_CLASS (dev );
56
+ Error * local_err = NULL ;
57
+
58
+ lic -> parent_realize (dev , & local_err );
59
+ if (local_err ) {
60
+ error_propagate (errp , local_err );
61
+ return ;
62
+ }
63
+ }
64
+
52
65
static void loongarch_ipi_class_init (ObjectClass * klass , void * data )
53
66
{
54
67
LoongsonIPICommonClass * licc = LOONGSON_IPI_COMMON_CLASS (klass );
68
+ LoongarchIPIClass * lic = LOONGARCH_IPI_CLASS (klass );
69
+ DeviceClass * dc = DEVICE_CLASS (klass );
55
70
71
+ device_class_set_parent_realize (dc , loongarch_ipi_realize ,
72
+ & lic -> parent_realize );
56
73
licc -> get_iocsr_as = get_iocsr_as ;
57
74
licc -> cpu_by_arch_id = loongarch_cpu_by_arch_id ;
58
75
}
@@ -61,6 +78,8 @@ static const TypeInfo loongarch_ipi_types[] = {
61
78
{
62
79
.name = TYPE_LOONGARCH_IPI ,
63
80
.parent = TYPE_LOONGSON_IPI_COMMON ,
81
+ .instance_size = sizeof (LoongarchIPIState ),
82
+ .class_size = sizeof (LoongarchIPIClass ),
64
83
.class_init = loongarch_ipi_class_init ,
65
84
}
66
85
};
0 commit comments