mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
hw/i386/pc: Extract pc_i8259_create()
The i8259 creation code is common to all PC machines, extract the common code. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20191018135910.24286-5-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
b00c6f18a6
commit
4501d317b5
4 changed files with 22 additions and 25 deletions
19
hw/i386/pc.c
19
hw/i386/pc.c
|
@ -1474,6 +1474,25 @@ void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus)
|
|||
rom_reset_order_override();
|
||||
}
|
||||
|
||||
void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs)
|
||||
{
|
||||
qemu_irq *i8259;
|
||||
|
||||
if (kvm_pic_in_kernel()) {
|
||||
i8259 = kvm_i8259_init(isa_bus);
|
||||
} else if (xen_enabled()) {
|
||||
i8259 = xen_interrupt_controller_init();
|
||||
} else {
|
||||
i8259 = i8259_init(isa_bus, pc_allocate_cpu_irq());
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < ISA_NUM_IRQS; i++) {
|
||||
i8259_irqs[i] = i8259[i];
|
||||
}
|
||||
|
||||
g_free(i8259);
|
||||
}
|
||||
|
||||
void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name)
|
||||
{
|
||||
DeviceState *dev;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue