From 86c861578453b544fa67ad50d28c4460bee068c5 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 10 Sep 2009 11:43:26 +0200 Subject: qdev: drop iobase properties from isa bus Lot of ISA devices work at fixed addresses, so having iobase as bus property doesn't make much sense. Devices which can have different iobases will get a device property. Also simply hard-code stuff which can't be configured anyway. Signed-off-by: Gerd Hoffmann --- hw/fdc.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'hw/fdc.c') diff --git a/hw/fdc.c b/hw/fdc.c index db57710ce7..d761e62ad7 100644 --- a/hw/fdc.c +++ b/hw/fdc.c @@ -1871,14 +1871,14 @@ static void fdctrl_connect_drives(fdctrl_t *fdctrl, BlockDriverState **fds) } } -fdctrl_t *fdctrl_init_isa(int isairq, int dma_chann, - uint32_t io_base, - BlockDriverState **fds) +fdctrl_t *fdctrl_init_isa(BlockDriverState **fds) { fdctrl_t *fdctrl; ISADevice *dev; + int isairq = 6; + int dma_chann = 2; - dev = isa_create_simple("isa-fdc", io_base, 0, isairq, -1); + dev = isa_create_simple("isa-fdc", isairq, -1); fdctrl = &(DO_UPCAST(fdctrl_isabus_t, busdev, dev)->state); fdctrl->dma_chann = dma_chann; @@ -1968,14 +1968,15 @@ static int isabus_fdc_init1(ISADevice *dev) { fdctrl_isabus_t *isa = DO_UPCAST(fdctrl_isabus_t, busdev, dev); fdctrl_t *fdctrl = &isa->state; + int iobase = 0x3f0; - register_ioport_read(isa->busdev.iobase[0] + 0x01, 5, 1, + register_ioport_read(iobase + 0x01, 5, 1, &fdctrl_read_port, fdctrl); - register_ioport_read(isa->busdev.iobase[0] + 0x07, 1, 1, + register_ioport_read(iobase + 0x07, 1, 1, &fdctrl_read_port, fdctrl); - register_ioport_write(isa->busdev.iobase[0] + 0x01, 5, 1, + register_ioport_write(iobase + 0x01, 5, 1, &fdctrl_write_port, fdctrl); - register_ioport_write(isa->busdev.iobase[0] + 0x07, 1, 1, + register_ioport_write(iobase + 0x07, 1, 1, &fdctrl_write_port, fdctrl); isa_init_irq(&isa->busdev, &fdctrl->irq); -- cgit v1.2.3