]> Git Repo - qemu.git/blobdiff - hw/isa-bus.c
scsi-disk: support DVD profile in GET CONFIGURATION
[qemu.git] / hw / isa-bus.c
index e9c171210d28c36ede09f5b949d1c7d87f1853d5..7c2c2619d013206a94a462ad71ec92ccd935a9a3 100644 (file)
@@ -83,24 +83,32 @@ void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq)
     dev->nirqs++;
 }
 
-void isa_init_ioport_range(ISADevice *dev, uint16_t start, uint16_t length)
+static inline void isa_init_ioport(ISADevice *dev, uint16_t ioport)
 {
-    if (dev->ioport_id == 0 || start < dev->ioport_id) {
-        dev->ioport_id = start;
+    if (dev && (dev->ioport_id == 0 || ioport < dev->ioport_id)) {
+        dev->ioport_id = ioport;
     }
 }
 
-void isa_init_ioport(ISADevice *dev, uint16_t ioport)
+void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start)
 {
-    isa_init_ioport_range(dev, ioport, 1);
+    memory_region_add_subregion(isabus->address_space_io, start, io);
+    isa_init_ioport(dev, start);
 }
 
-void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start)
+void isa_register_portio_list(ISADevice *dev, uint16_t start,
+                              const MemoryRegionPortio *pio_start,
+                              void *opaque, const char *name)
 {
-    memory_region_add_subregion(isabus->address_space_io, start, io);
-    if (dev != NULL) {
-        isa_init_ioport(dev, start);
-    }
+    PortioList *piolist = g_new(PortioList, 1);
+
+    /* START is how we should treat DEV, regardless of the actual
+       contents of the portio array.  This is how the old code
+       actually handled e.g. the FDC device.  */
+    isa_init_ioport(dev, start);
+
+    portio_list_init(piolist, pio_start, opaque, name);
+    portio_list_add(piolist, isabus->address_space_io, start);
 }
 
 static int isa_qdev_init(DeviceState *qdev, DeviceInfo *base)
This page took 0.021893 seconds and 4 git commands to generate.