Move isa_connect_irq calls into isa_create_simple
Now with isa-bus maintaining the isa irqs we can move the isa_connect_irq() calls into isa_create_simple(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
3a38d437ca
commit
e8935eefe5
3
hw/fdc.c
3
hw/fdc.c
@ -1878,9 +1878,8 @@ fdctrl_t *fdctrl_init_isa(int isairq, int dma_chann,
|
||||
fdctrl_t *fdctrl;
|
||||
ISADevice *dev;
|
||||
|
||||
dev = isa_create_simple("isa-fdc", io_base, 0);
|
||||
dev = isa_create_simple("isa-fdc", io_base, 0, isairq, -1);
|
||||
fdctrl = &(DO_UPCAST(fdctrl_isabus_t, busdev, dev)->state);
|
||||
isa_connect_irq(dev, 0, isairq);
|
||||
|
||||
fdctrl->dma_chann = dma_chann;
|
||||
DMA_register_channel(dma_chann, &fdctrl_transfer_handler, fdctrl);
|
||||
|
@ -121,7 +121,8 @@ void isa_qdev_register(ISADeviceInfo *info)
|
||||
qdev_register(&info->qdev);
|
||||
}
|
||||
|
||||
ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2)
|
||||
ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2,
|
||||
uint32_t irq, uint32 irq2)
|
||||
{
|
||||
DeviceState *dev;
|
||||
ISADevice *isa;
|
||||
@ -135,6 +136,10 @@ ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2
|
||||
isa->iobase[0] = iobase;
|
||||
isa->iobase[1] = iobase2;
|
||||
qdev_init(dev);
|
||||
if (-1 != irq)
|
||||
isa_connect_irq(isa, 0, irq);
|
||||
if (-1 != irq2)
|
||||
isa_connect_irq(isa, 1, irq2);
|
||||
return isa;
|
||||
}
|
||||
|
||||
|
3
hw/isa.h
3
hw/isa.h
@ -30,7 +30,8 @@ void isa_connect_irq(ISADevice *dev, int devirq, int isairq);
|
||||
qemu_irq isa_reserve_irq(int isairq);
|
||||
void isa_init_irq(ISADevice *dev, qemu_irq *p);
|
||||
void isa_qdev_register(ISADeviceInfo *info);
|
||||
ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2);
|
||||
ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2,
|
||||
uint32_t irq, uint32_t irq2);
|
||||
|
||||
extern target_phys_addr_t isa_mem_base;
|
||||
|
||||
|
4
hw/pc.c
4
hw/pc.c
@ -1376,9 +1376,7 @@ static void pc_init1(ram_addr_t ram_size,
|
||||
}
|
||||
}
|
||||
|
||||
isa_dev = isa_create_simple("i8042", 0x60, 0x64);
|
||||
isa_connect_irq(isa_dev, 0, 1);
|
||||
isa_connect_irq(isa_dev, 1, 12);
|
||||
isa_dev = isa_create_simple("i8042", 0x60, 0x64, 1, 12);
|
||||
DMA_init(0);
|
||||
#ifdef HAS_AUDIO
|
||||
audio_init(pci_enabled ? pci_bus : NULL, isa_irq);
|
||||
|
Loading…
Reference in New Issue
Block a user