From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 03/14] isa: add isa_register_ioport()
Date: Sun, 25 Sep 2011 15:50:38 +0300 [thread overview]
Message-ID: <1316955049-21516-4-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1316955049-21516-1-git-send-email-avi@redhat.com>
From: Richard Henderson <rth@twiddle.net>
To replace isa_init_ioport and isa_init_ioport_range
as the ISA devices are converted to the memory api.
[avi: use memory_region_size()]
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
---
hw/isa-bus.c | 10 ++++++++++
hw/isa.h | 5 ++++-
2 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index d067505..6c15a31 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -108,6 +108,16 @@ void isa_init_ioport(ISADevice *dev, uint16_t ioport)
isa_init_ioport_range(dev, ioport, 1);
}
+void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start)
+{
+ memory_region_add_subregion(isabus->address_space_io, start, io);
+ if (dev != NULL) {
+ assert(dev->nio < ARRAY_SIZE(dev->io));
+ dev->io[dev->nio++] = io;
+ isa_init_ioport_range(dev, start, memory_region_size(io));
+ }
+}
+
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 390e2d4..432d17a 100644
--- a/hw/isa.h
+++ b/hw/isa.h
@@ -13,10 +13,12 @@ typedef struct ISADeviceInfo ISADeviceInfo;
struct ISADevice {
DeviceState qdev;
+ MemoryRegion *io[32];
uint32_t isairq[2];
- int nirqs;
uint16_t ioports[32];
+ int nirqs;
int nioports;
+ int nio;
};
typedef int (*isa_qdev_initfn)(ISADevice *dev);
@@ -29,6 +31,7 @@ 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);
--
1.7.6.3
next prev parent reply other threads:[~2011-09-25 12:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-25 12:50 [Qemu-devel] [PULL 00/14] Memory API conversion batch 9: ISA Avi Kivity
2011-09-25 12:50 ` [Qemu-devel] [PATCH 01/14] pci: add pci_address_space_io() Avi Kivity
2011-09-25 12:50 ` [Qemu-devel] [PATCH 02/14] isa: Pass i/o address space to isa_bus_new Avi Kivity
2011-09-25 12:50 ` Avi Kivity [this message]
2011-09-25 12:50 ` [Qemu-devel] [PATCH 04/14] pc: Re-order pc_init1 to initialize the ISA bus before ISA devices Avi Kivity
2011-09-25 12:50 ` [Qemu-devel] [PATCH 05/14] cs4231a: Convert to MemoryRegion Avi Kivity
2011-09-25 12:50 ` [Qemu-devel] [PATCH 06/14] i8254: " Avi Kivity
2011-09-25 12:50 ` [Qemu-devel] [PATCH 07/14] mips_malta: move i8259 initialization after piix4 initialization Avi Kivity
2011-09-25 12:50 ` [Qemu-devel] [PATCH 08/14] mips_jazz: initialize i8259 after the ISA bus Avi Kivity
2011-09-25 12:50 ` [Qemu-devel] [PATCH 09/14] mips_r4k: " Avi Kivity
2011-09-25 12:50 ` [Qemu-devel] [PATCH 10/14] ppc_prep: " Avi Kivity
2011-09-25 12:50 ` [Qemu-devel] [PATCH 11/14] i8259: Convert to MemoryRegion Avi Kivity
2011-09-25 12:50 ` [Qemu-devel] [PATCH 12/14] pckbd: " Avi Kivity
2011-09-25 12:50 ` [Qemu-devel] [PATCH 13/14] serial: Convert serial_isa_initfn " Avi Kivity
2011-09-25 12:50 ` [Qemu-devel] [PATCH 14/14] fdc: Convert isabus_fdc_init1 " Avi Kivity
2011-09-26 13:29 ` [Qemu-devel] [PULL 00/14] Memory API conversion batch 9: ISA Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1316955049-21516-4-git-send-email-avi@redhat.com \
--to=avi@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).