mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 04:43:54 -06:00
hw/intc/loongarch_extioi: Use cpu plug notification
Use hotplug_handler_plug() to nofity extioi object when cold-plug cpu is created, so that extioi can set and configure irq routing to new cpu. Signed-off-by: Bibo Mao <maobibo@loongson.cn>
This commit is contained in:
parent
8e63a7a7c2
commit
087a23a87c
1 changed files with 2 additions and 10 deletions
|
@ -312,7 +312,7 @@ static void virt_devices_init(DeviceState *pch_pic,
|
|||
|
||||
static void virt_cpu_irq_init(LoongArchVirtMachineState *lvms)
|
||||
{
|
||||
int num, pin;
|
||||
int num;
|
||||
MachineState *ms = MACHINE(lvms);
|
||||
MachineClass *mc = MACHINE_GET_CLASS(ms);
|
||||
const CPUArchIdList *possible_cpus;
|
||||
|
@ -328,15 +328,7 @@ static void virt_cpu_irq_init(LoongArchVirtMachineState *lvms)
|
|||
}
|
||||
|
||||
hotplug_handler_plug(HOTPLUG_HANDLER(lvms->ipi), DEVICE(cs), &err);
|
||||
|
||||
/*
|
||||
* connect ext irq to the cpu irq
|
||||
* cpu_pin[9:2] <= intc_pin[7:0]
|
||||
*/
|
||||
for (pin = 0; pin < LS3A_INTC_IP; pin++) {
|
||||
qdev_connect_gpio_out(lvms->extioi, (num * LS3A_INTC_IP + pin),
|
||||
qdev_get_gpio_in(DEVICE(cs), pin + 2));
|
||||
}
|
||||
hotplug_handler_plug(HOTPLUG_HANDLER(lvms->extioi), DEVICE(cs), &err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue