[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/24] isa: Add isa_register_portio_list()
From: |
Avi Kivity |
Subject: |
[Qemu-devel] [PATCH 12/24] isa: Add isa_register_portio_list() |
Date: |
Mon, 10 Oct 2011 16:59:41 +0200 |
Signed-off-by: Richard Henderson <address@hidden>
Signed-off-by: Avi Kivity <address@hidden>
---
hw/isa-bus.c | 17 +++++++++++++++++
hw/isa.h | 31 ++++++++++++++++++++++++++++++-
2 files changed, 47 insertions(+), 1 deletions(-)
diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index e9c1712..5d8ff84 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -103,6 +103,23 @@ 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)
+{
+ 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. */
+ if (dev) {
+ 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)
{
ISADevice *dev = DO_UPCAST(ISADevice, qdev, qdev);
diff --git a/hw/isa.h b/hw/isa.h
index c5c2618..177ef95 100644
--- a/hw/isa.h
+++ b/hw/isa.h
@@ -28,7 +28,6 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion
*address_space_io);
void isa_bus_irqs(qemu_irq *irqs);
qemu_irq isa_get_irq(int isairq);
void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq);
-void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start);
void isa_init_ioport(ISADevice *dev, uint16_t ioport);
void isa_init_ioport_range(ISADevice *dev, uint16_t start, uint16_t length);
void isa_qdev_register(ISADeviceInfo *info);
@@ -37,6 +36,36 @@ ISADevice *isa_create(const char *name);
ISADevice *isa_try_create(const char *name);
ISADevice *isa_create_simple(const char *name);
+/**
+ * isa_register_ioport: Install an I/O port region on the ISA bus.
+ *
+ * Register an I/O port region via memory_region_add_subregion
+ * inside the ISA I/O address space.
+ *
+ * @dev: the ISADevice against which these are registered; may be NULL.
+ * @io: the #MemoryRegion being registered.
+ * @start: the base I/O port.
+ */
+void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start);
+
+/**
+ * isa_register_portio_list: Initialize a set of ISA io ports
+ *
+ * Several ISA devices have many dis-joint I/O ports. Worse, these I/O
+ * ports can be interleaved with I/O ports from other devices. This
+ * function makes it easy to create multiple MemoryRegions for a single
+ * device and use the legacy portio routines.
+ *
+ * @dev: the ISADevice against which these are registered; may be NULL.
+ * @start: the base I/O port against which the portio->offset is applied.
+ * @portio: the ports, sorted by offset.
+ * @opaque: passed into the old_portio callbacks.
+ * @name: passed into memory_region_init_io.
+ */
+void isa_register_portio_list(ISADevice *dev, uint16_t start,
+ const MemoryRegionPortio *portio,
+ void *opaque, const char *name);
+
extern target_phys_addr_t isa_mem_base;
void isa_mmio_setup(MemoryRegion *mr, target_phys_addr_t size);
--
1.7.6.3
- [Qemu-devel] [PULL 00/24] Memory API, batch 11, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 02/24] palm: convert to memory API, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 08/24] ppc_newworld: convert to memory API, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 22/24] vmport: Convert to isa_register_ioport, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 05/24] ppc405_boards: convert to memory API, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 13/24] fdc: Convert to isa_register_portio_list, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 16/24] rtc: Convert to isa_register_ioport, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 10/24] Introduce PortioList, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 12/24] isa: Add isa_register_portio_list(),
Avi Kivity <=
- [Qemu-devel] [PATCH 09/24] isa: Tidy support code for isabus_get_fw_dev_path, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 17/24] ne2000: Convert to isa_register_ioport, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 11/24] memory: Fix old portio word accesses, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 04/24] petalogix_s2adsp1800: convert to memory API, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 03/24] petalogix_ml605: convert to memory API, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 19/24] sb16: Convert to isa_register_portio_list, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 14/24] gus: Convert to isa_register_portio_list, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 06/24] hw/arm11mpcore: Clean up to avoid using sysbus_mmio_init_cb2, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 24/24] isa: Remove isa_init_ioport_range and isa_init_ioport, Avi Kivity, 2011/10/10
- [Qemu-devel] [PATCH 18/24] parallel: Convert to isa_register_portio_list, Avi Kivity, 2011/10/10