[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC][PATCH 05/15] prep: replace register_ioport*
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [RFC][PATCH 05/15] prep: replace register_ioport* |
Date: |
Mon, 6 May 2013 16:26:08 +0200 |
Convert over to memory regions to obsolete register_ioport*.
Signed-off-by: Jan Kiszka <address@hidden>
---
hw/ppc/prep.c | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 59c7da3..671dc26 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -429,6 +429,16 @@ static void ppc_prep_reset(void *opaque)
cpu_reset(CPU(cpu));
}
+static const MemoryRegionPortio prep_portio_list[] = {
+ /* System control ports */
+ { 0x0092, 1, 1, .read = PREP_io_800_readb, .write = PREP_io_800_writeb, },
+ { 0x0800, 0x52, 1,
+ .read = PREP_io_800_readb, .write = PREP_io_800_writeb, },
+ /* Special port to get debug messages from Open-Firmware */
+ { 0x0F00, 4, 1, .write = PPC_debug_write, },
+ PORTIO_END_OF_LIST(),
+};
+
/* PowerPC PREP hardware initialisation */
static void ppc_prep_init(QEMUMachineInitArgs *args)
{
@@ -445,6 +455,7 @@ static void ppc_prep_init(QEMUMachineInitArgs *args)
nvram_t nvram;
M48t59State *m48t59;
MemoryRegion *PPC_io_memory = g_new(MemoryRegion, 1);
+ PortioList *port_list = g_new(PortioList, 1);
#if 0
MemoryRegion *xcsr = g_new(MemoryRegion, 1);
#endif
@@ -624,11 +635,10 @@ static void ppc_prep_init(QEMUMachineInitArgs *args)
isa_create_simple(isa_bus, "i8042");
sysctrl->reset_irq = first_cpu->irq_inputs[PPC6xx_INPUT_HRESET];
- /* System control ports */
- register_ioport_read(0x0092, 0x01, 1, &PREP_io_800_readb, sysctrl);
- register_ioport_write(0x0092, 0x01, 1, &PREP_io_800_writeb, sysctrl);
- register_ioport_read(0x0800, 0x52, 1, &PREP_io_800_readb, sysctrl);
- register_ioport_write(0x0800, 0x52, 1, &PREP_io_800_writeb, sysctrl);
+
+ portio_list_init(port_list, prep_portio_list, sysctrl, "prep");
+ portio_list_add(port_list, get_system_io(), 0x0);
+
/* PowerPC control and status register group */
#if 0
memory_region_init_io(xcsr, &PPC_XCSR_ops, NULL, "ppc-xcsr", 0x1000);
@@ -655,9 +665,6 @@ static void ppc_prep_init(QEMUMachineInitArgs *args)
/* XXX: need an option to load a NVRAM image */
0,
graphic_width, graphic_height, graphic_depth);
-
- /* Special port to get debug messages from Open-Firmware */
- register_ioport_write(0x0F00, 4, 1, &PPC_debug_write, NULL);
}
static QEMUMachine prep_machine = {
--
1.7.3.4
- Re: [Qemu-devel] [RFC][PATCH 11/15] memory: Allow unaligned address_space_rw, (continued)
- [Qemu-devel] [RFC][PATCH 07/15] Privatize register_ioport_read/write, Jan Kiszka, 2013/05/06
- [Qemu-devel] [RFC][PATCH 01/15] adlib: replace register_ioport*, Jan Kiszka, 2013/05/06
- [Qemu-devel] [RFC][PATCH 04/15] i82374: replace register_ioport*, Jan Kiszka, 2013/05/06
- [Qemu-devel] [RFC][PATCH 15/15] ioport: Move IOPortRead/WriteFunc typedefs to memory.h, Jan Kiszka, 2013/05/06
- [Qemu-devel] [RFC][PATCH 13/15] ioport: Switch dispatching to memory core layer, Jan Kiszka, 2013/05/06
- [Qemu-devel] [RFC][PATCH 05/15] prep: replace register_ioport*,
Jan Kiszka <=
- Re: [Qemu-devel] [RFC][PATCH 00/15] Refactor portio dispatching, Andreas Färber, 2013/05/06
- [Qemu-devel] [RFC][PATCH 12/15] vmware-vga: Accept unaligned I/O accesses, Jan Kiszka, 2013/05/06