mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23: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
|
@ -82,7 +82,6 @@ static void pc_init1(MachineState *machine,
|
|||
ISABus *isa_bus;
|
||||
PCII440FXState *i440fx_state;
|
||||
int piix3_devfn = -1;
|
||||
qemu_irq *i8259;
|
||||
qemu_irq smi_irq;
|
||||
GSIState *gsi_state;
|
||||
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
|
||||
|
@ -209,18 +208,8 @@ static void pc_init1(MachineState *machine,
|
|||
}
|
||||
isa_bus_irqs(isa_bus, x86ms->gsi);
|
||||
|
||||
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());
|
||||
}
|
||||
pc_i8259_create(isa_bus, gsi_state->i8259_irq);
|
||||
|
||||
for (i = 0; i < ISA_NUM_IRQS; i++) {
|
||||
gsi_state->i8259_irq[i] = i8259[i];
|
||||
}
|
||||
g_free(i8259);
|
||||
if (pcmc->pci_enabled) {
|
||||
ioapic_init_gsi(gsi_state, "i440fx");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue