Revision 86c86157

b/hw/fdc.c
1871 1871
    }
1872 1872
}
1873 1873

  
1874
fdctrl_t *fdctrl_init_isa(int isairq, int dma_chann,
1875
                          uint32_t io_base,
1876
                          BlockDriverState **fds)
1874
fdctrl_t *fdctrl_init_isa(BlockDriverState **fds)
1877 1875
{
1878 1876
    fdctrl_t *fdctrl;
1879 1877
    ISADevice *dev;
1878
    int isairq = 6;
1879
    int dma_chann = 2;
1880 1880

  
1881
    dev = isa_create_simple("isa-fdc", io_base, 0, isairq, -1);
1881
    dev = isa_create_simple("isa-fdc", isairq, -1);
1882 1882
    fdctrl = &(DO_UPCAST(fdctrl_isabus_t, busdev, dev)->state);
1883 1883

  
1884 1884
    fdctrl->dma_chann = dma_chann;
......
1968 1968
{
1969 1969
    fdctrl_isabus_t *isa = DO_UPCAST(fdctrl_isabus_t, busdev, dev);
1970 1970
    fdctrl_t *fdctrl = &isa->state;
1971
    int iobase = 0x3f0;
1971 1972

  
1972
    register_ioport_read(isa->busdev.iobase[0] + 0x01, 5, 1,
1973
    register_ioport_read(iobase + 0x01, 5, 1,
1973 1974
                         &fdctrl_read_port, fdctrl);
1974
    register_ioport_read(isa->busdev.iobase[0] + 0x07, 1, 1,
1975
    register_ioport_read(iobase + 0x07, 1, 1,
1975 1976
                         &fdctrl_read_port, fdctrl);
1976
    register_ioport_write(isa->busdev.iobase[0] + 0x01, 5, 1,
1977
    register_ioport_write(iobase + 0x01, 5, 1,
1977 1978
                          &fdctrl_write_port, fdctrl);
1978
    register_ioport_write(isa->busdev.iobase[0] + 0x07, 1, 1,
1979
    register_ioport_write(iobase + 0x07, 1, 1,
1979 1980
                          &fdctrl_write_port, fdctrl);
1980 1981
    isa_init_irq(&isa->busdev, &fdctrl->irq);
1981 1982

  
b/hw/fdc.h
3 3

  
4 4
typedef struct fdctrl_t fdctrl_t;
5 5

  
6
fdctrl_t *fdctrl_init_isa(int isairq, int dma_chann,
7
                          uint32_t io_base,
8
                          BlockDriverState **fds);
6
fdctrl_t *fdctrl_init_isa(BlockDriverState **fds);
9 7
fdctrl_t *fdctrl_init_sysbus(qemu_irq irq, int dma_chann,
10 8
                             target_phys_addr_t mmio_base,
11 9
                             BlockDriverState **fds);
b/hw/isa-bus.c
35 35
    .name      = "ISA",
36 36
    .size      = sizeof(ISABus),
37 37
    .print_dev = isabus_dev_print,
38
    .props     = (Property[]) {
39
        DEFINE_PROP_HEX32("iobase",  ISADevice, iobase[0], -1),
40
        DEFINE_PROP_HEX32("iobase2", ISADevice, iobase[1], -1),
41
        DEFINE_PROP_END_OF_LIST(),
42
    }
43 38
};
44 39

  
45 40
ISABus *isa_bus_new(DeviceState *dev)
......
122 117
    qdev_register(&info->qdev);
123 118
}
124 119

  
125
ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2,
126
                             uint32_t irq, uint32 irq2)
120
ISADevice *isa_create_simple(const char *name, uint32_t irq, uint32 irq2)
127 121
{
128 122
    DeviceState *dev;
129 123
    ISADevice *isa;
......
134 128
    }
135 129
    dev = qdev_create(&isabus->qbus, name);
136 130
    isa = DO_UPCAST(ISADevice, qdev, dev);
137
    isa->iobase[0] = iobase;
138
    isa->iobase[1] = iobase2;
139 131
    qdev_init(dev);
140 132
    if (irq != -1) {
141 133
        isa_connect_irq(isa, 0, irq);
b/hw/isa.h
12 12

  
13 13
struct ISADevice {
14 14
    DeviceState qdev;
15
    uint32_t iobase[2];
16 15
    uint32_t isairq[2];
17 16
    qemu_irq *irqs[2];
18 17
    int nirqs;
......
30 29
qemu_irq isa_reserve_irq(int isairq);
31 30
void isa_init_irq(ISADevice *dev, qemu_irq *p);
32 31
void isa_qdev_register(ISADeviceInfo *info);
33
ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2,
34
                             uint32_t irq, uint32_t irq2);
32
ISADevice *isa_create_simple(const char *name, uint32_t irq, uint32_t irq2);
35 33

  
36 34
extern target_phys_addr_t isa_mem_base;
37 35

  
b/hw/mips_malta.c
921 921
    DMA_init(0);
922 922

  
923 923
    /* Super I/O */
924
    isa_dev = isa_create_simple("i8042", 0x60, 0x64, 1, 12);
924
    isa_dev = isa_create_simple("i8042", 1, 12);
925 925
 
926 926
    rtc_state = rtc_init(0x70, isa_reserve_irq(8), 2000);
927 927
    serial_init(0x3f8, isa_reserve_irq(4), 115200, serial_hds[0]);
......
932 932
        dinfo = drive_get(IF_FLOPPY, 0, i);
933 933
        fd[i] = dinfo ? dinfo->bdrv : NULL;
934 934
    }
935
    floppy_controller = fdctrl_init_isa(6, 2, 0x3f0, fd);
935
    floppy_controller = fdctrl_init_isa(fd);
936 936

  
937 937
    /* Sound card */
938 938
#ifdef HAS_AUDIO
b/hw/pc.c
1373 1373
        }
1374 1374
    }
1375 1375

  
1376
    isa_dev = isa_create_simple("i8042", 0x60, 0x64, 1, 12);
1376
    isa_dev = isa_create_simple("i8042", 1, 12);
1377 1377
    DMA_init(0);
1378 1378
#ifdef HAS_AUDIO
1379 1379
    audio_init(pci_enabled ? pci_bus : NULL, isa_irq);
......
1383 1383
        dinfo = drive_get(IF_FLOPPY, 0, i);
1384 1384
        fd[i] = dinfo ? dinfo->bdrv : NULL;
1385 1385
    }
1386
    floppy_controller = fdctrl_init_isa(6, 2, 0x3f0, fd);
1386
    floppy_controller = fdctrl_init_isa(fd);
1387 1387

  
1388 1388
    cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device, hd);
1389 1389

  
b/hw/pckbd.c
455 455

  
456 456
    kbd_reset(s);
457 457
    register_savevm("pckbd", 0, 3, kbd_save, kbd_load, s);
458
    register_ioport_read(dev->iobase[0], 1, 1, kbd_read_data, s);
459
    register_ioport_write(dev->iobase[0], 1, 1, kbd_write_data, s);
460
    register_ioport_read(dev->iobase[1], 1, 1, kbd_read_status, s);
461
    register_ioport_write(dev->iobase[1], 1, 1, kbd_write_command, s);
458
    register_ioport_read(0x60, 1, 1, kbd_read_data, s);
459
    register_ioport_write(0x60, 1, 1, kbd_write_data, s);
460
    register_ioport_read(0x64, 1, 1, kbd_read_status, s);
461
    register_ioport_write(0x64, 1, 1, kbd_write_command, s);
462 462

  
463 463
    s->kbd = ps2_kbd_init(kbd_update_kbd_irq, s);
464 464
    s->mouse = ps2_mouse_init(kbd_update_aux_irq, s);
b/hw/ppc_prep.c
719 719
        dinfo = drive_get(IF_FLOPPY, 0, i);
720 720
        fd[i] = dinfo ? dinfo->bdrv : NULL;
721 721
    }
722
    fdctrl_init_isa(6, 2, 0x3f0, fd);
722
    fdctrl_init_isa(fd);
723 723

  
724 724
    /* Register speaker port */
725 725
    register_ioport_read(0x61, 1, 1, speaker_ioport_read, NULL);
b/hw/sun4u.c
617 617

  
618 618
    pci_cmd646_ide_init(pci_bus, hd, 1);
619 619

  
620
    isa_create_simple("i8042", 0x60, 0x64, 1, 12);
620
    isa_create_simple("i8042", 1, 12);
621 621
    for(i = 0; i < MAX_FD; i++) {
622 622
        dinfo = drive_get(IF_FLOPPY, 0, i);
623 623
        fd[i] = dinfo ? dinfo->bdrv : NULL;
624 624
    }
625
    fdctrl_init_isa(6, 2, 0x3f0, fd);
625
    fdctrl_init_isa(fd);
626 626
    /* FIXME: wire up interrupts.  */
627 627
    nvram = m48t59_init(NULL/*8*/, 0, 0x0074, NVRAM_SIZE, 59);
628 628

  

Also available in: Unified diff