[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v2 02/10] isa: Allow to un-assign I/O ports
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [RFC v2 02/10] isa: Allow to un-assign I/O ports |
Date: |
Tue, 7 Jun 2011 17:02:50 +0200 |
Signed-off-by: Andreas Färber <address@hidden>
---
hw/isa-bus.c | 14 ++++++++++++++
hw/isa.h | 1 +
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index 6f296bd..68fd3db 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -105,6 +105,20 @@ void isa_init_ioport(ISADevice *dev, uint16_t ioport)
isa_init_ioport_range(dev, ioport, 1);
}
+void isa_discard_ioport_range(ISADevice *dev, uint16_t start, uint16_t length)
+{
+ int i, j;
+ for (i = 0; i < dev->nioports; i++) {
+ if (dev->ioports[i] == start) {
+ for (j = 0; j < dev->nioports - i; j++) {
+ dev->ioports[i + j] = dev->ioports[i + length + j];
+ }
+ dev->nioports -= length;
+ break;
+ }
+ }
+}
+
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 0e944b9..a524a56 100644
--- a/hw/isa.h
+++ b/hw/isa.h
@@ -32,6 +32,7 @@ qemu_irq isa_get_irq(int isairq);
void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq);
void isa_init_ioport(ISADevice *dev, uint16_t ioport);
void isa_init_ioport_range(ISADevice *dev, uint16_t start, uint16_t length);
+void isa_discard_ioport_range(ISADevice *dev, uint16_t start, uint16_t length);
void isa_qdev_register(ISADeviceInfo *info);
ISADevice *isa_create(const char *name);
ISADevice *isa_try_create(const char *name);
--
1.7.5.3
- [Qemu-devel] [RFC 06/10] serial: Allow to reconfigure ISA IRQ, (continued)
- [Qemu-devel] [RFC 06/10] serial: Allow to reconfigure ISA IRQ, Andreas Färber, 2011/06/06
- [Qemu-devel] [PATCH v2 07/10] fdc: Parametrize ISA base, IRQ and DMA, Andreas Färber, 2011/06/06
- [Qemu-devel] [RFC 08/10] fdc: Allow to reconfigure ISA I/O base, Andreas Färber, 2011/06/06
- [Qemu-devel] [RFC 09/10] ide: Allow to reconfigure ISA I/O base, Andreas Färber, 2011/06/06
- [Qemu-devel] [RFC 10/10] prep: Add pc87312 Super I/O emulation, Andreas Färber, 2011/06/06
- Re: [Qemu-devel] [RFC 05/10] serial: Allow to reconfigure ISA I/O base, Richard Henderson, 2011/06/06
- Re: [Qemu-devel] [RFC 05/10] serial: Allow to reconfigure ISA I/O base, Andreas Färber, 2011/06/06
Re: [Qemu-devel] [RFC 00/10] ISA reconfigurability, Gerd Hoffmann, 2011/06/07
- [Qemu-devel] [RFC v2 00/10] ISA reconfigurability v2, Andreas Färber, 2011/06/07
- [Qemu-devel] [RFC v2 01/10] isa: Provide set_state callback, Andreas Färber, 2011/06/07
- [Qemu-devel] [RFC v2 02/10] isa: Allow to un-assign I/O ports,
Andreas Färber <=
- [Qemu-devel] [RFC v2 03/10] isa: Allow to un-associate an IRQ, Andreas Färber, 2011/06/07
- [Qemu-devel] [RFC v2 04/10] parallel: Implement ISA set_state callback, Andreas Färber, 2011/06/07
- [Qemu-devel] [RFC v2 05/10] serial: Implement ISA set_state() callback, Andreas Färber, 2011/06/07
- [Qemu-devel] [PATCH v2 06/10] fdc: Parametrize ISA base, IRQ and DMA, Andreas Färber, 2011/06/07
- [Qemu-devel] [RFC v2 07/10] fdc: Implement ISA set_state() callback, Andreas Färber, 2011/06/07
- [Qemu-devel] [RFC v2 08/10] ide: Allow to discard I/O ports, Andreas Färber, 2011/06/07
- [Qemu-devel] [RFC v2 09/10] ide: Implement ISA set_state() callback, Andreas Färber, 2011/06/07
- [Qemu-devel] [RFC v2 10/10] prep: Add pc87312 Super I/O emulation, Andreas Färber, 2011/06/07
Re: [Qemu-devel] [RFC v2 00/10] ISA reconfigurability v2, Gerd Hoffmann, 2011/06/07
Re: [Qemu-devel] [RFC v2 00/10] ISA reconfigurability v2, Andreas Färber, 2011/06/07