mirror of https://github.com/xemu-project/xemu.git
serial: Replace register_ioport_*
Replace all register_ioport_*() with a MemoryRegion. This permits to use the new Memory stuff like listeners. For more flexibility, the IO address space is passed as an argument. Signed-off-by: Julien Grall <julien.grall@citrix.com> Acked-by: Avi Kivity <avi@redhat.com> [AF: Rebased onto serial split] Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
c75e6d8e35
commit
568fd159e4
|
@ -217,7 +217,8 @@ mips_mipssim_init(QEMUMachineInitArgs *args)
|
||||||
/* A single 16450 sits at offset 0x3f8. It is attached to
|
/* A single 16450 sits at offset 0x3f8. It is attached to
|
||||||
MIPS CPU INT2, which is interrupt 4. */
|
MIPS CPU INT2, which is interrupt 4. */
|
||||||
if (serial_hds[0])
|
if (serial_hds[0])
|
||||||
serial_init(0x3f8, env->irq[4], 115200, serial_hds[0]);
|
serial_init(0x3f8, env->irq[4], 115200, serial_hds[0],
|
||||||
|
get_system_io());
|
||||||
|
|
||||||
if (nd_table[0].used)
|
if (nd_table[0].used)
|
||||||
/* MIPSnet uses the MIPS CPU INT0, which is interrupt 2. */
|
/* MIPSnet uses the MIPS CPU INT0, which is interrupt 2. */
|
||||||
|
|
|
@ -718,7 +718,7 @@ const MemoryRegionOps serial_io_ops = {
|
||||||
};
|
};
|
||||||
|
|
||||||
SerialState *serial_init(int base, qemu_irq irq, int baudbase,
|
SerialState *serial_init(int base, qemu_irq irq, int baudbase,
|
||||||
CharDriverState *chr)
|
CharDriverState *chr, MemoryRegion *system_io)
|
||||||
{
|
{
|
||||||
SerialState *s;
|
SerialState *s;
|
||||||
|
|
||||||
|
@ -732,7 +732,7 @@ SerialState *serial_init(int base, qemu_irq irq, int baudbase,
|
||||||
vmstate_register(NULL, base, &vmstate_serial, s);
|
vmstate_register(NULL, base, &vmstate_serial, s);
|
||||||
|
|
||||||
memory_region_init_io(&s->io, &serial_io_ops, s, "serial", 8);
|
memory_region_init_io(&s->io, &serial_io_ops, s, "serial", 8);
|
||||||
memory_region_add_subregion(get_system_io(), base, &s->io);
|
memory_region_add_subregion(system_io, base, &s->io);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ void serial_set_frequency(SerialState *s, uint32_t frequency);
|
||||||
|
|
||||||
/* legacy pre qom */
|
/* legacy pre qom */
|
||||||
SerialState *serial_init(int base, qemu_irq irq, int baudbase,
|
SerialState *serial_init(int base, qemu_irq irq, int baudbase,
|
||||||
CharDriverState *chr);
|
CharDriverState *chr, MemoryRegion *system_io);
|
||||||
SerialState *serial_mm_init(MemoryRegion *address_space,
|
SerialState *serial_mm_init(MemoryRegion *address_space,
|
||||||
hwaddr base, int it_shift,
|
hwaddr base, int it_shift,
|
||||||
qemu_irq irq, int baudbase,
|
qemu_irq irq, int baudbase,
|
||||||
|
|
Loading…
Reference in New Issue