mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
hw/intc/loongson_ipi: Remove 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 num_cpu setting from loongson_ipi_common, and this piece of code is put into loongson and loongarch ipi separately. Signed-off-by: Bibo Mao <maobibo@loongson.cn> Reviewed-by: Bibo Mao <maobibo@loongson.cn>
This commit is contained in:
parent
59c54c1ceb
commit
5b82177add
3 changed files with 26 additions and 15 deletions
|
@ -52,14 +52,27 @@ static CPUState *loongarch_cpu_by_arch_id(int64_t arch_id)
|
|||
|
||||
static void loongarch_ipi_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
LoongsonIPICommonState *lics = LOONGSON_IPI_COMMON(dev);
|
||||
LoongarchIPIClass *lic = LOONGARCH_IPI_GET_CLASS(dev);
|
||||
Error *local_err = NULL;
|
||||
int i;
|
||||
|
||||
lic->parent_realize(dev, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lics->num_cpu == 0) {
|
||||
error_setg(errp, "num-cpu must be at least 1");
|
||||
return;
|
||||
}
|
||||
|
||||
lics->cpu = g_new0(IPICore, lics->num_cpu);
|
||||
for (i = 0; i < lics->num_cpu; i++) {
|
||||
lics->cpu[i].ipi = lics;
|
||||
qdev_init_gpio_out(dev, &lics->cpu[i].irq, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void loongarch_ipi_class_init(ObjectClass *klass, void *data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue