From 10315a70896fb82000cc4b2a1198b70c775c7a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 23 Oct 2019 18:37:33 +0200 Subject: serial: make SerialIO a sysbus device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make serial IO a proper sysbus device, similar to serial MM. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- include/hw/char/serial.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h index d586924937..d356ba838c 100644 --- a/include/hw/char/serial.h +++ b/include/hw/char/serial.h @@ -88,6 +88,12 @@ typedef struct SerialMM { uint8_t endianness; } SerialMM; +typedef struct SerialIO { + SysBusDevice parent; + + SerialState serial; +} SerialIO; + extern const VMStateDescription vmstate_serial; extern const MemoryRegionOps serial_io_ops; @@ -99,8 +105,11 @@ void serial_set_frequency(SerialState *s, uint32_t frequency); #define TYPE_SERIAL_MM "serial-mm" #define SERIAL_MM(s) OBJECT_CHECK(SerialMM, (s), TYPE_SERIAL_MM) -SerialState *serial_init(int base, qemu_irq irq, int baudbase, - Chardev *chr, MemoryRegion *system_io); +#define TYPE_SERIAL_IO "serial-io" +#define SERIAL_IO(s) OBJECT_CHECK(SerialIO, (s), TYPE_SERIAL_IO) + +SerialIO *serial_init(int base, qemu_irq irq, int baudbase, + Chardev *chr, MemoryRegion *system_io); SerialMM *serial_mm_init(MemoryRegion *address_space, hwaddr base, int regshift, qemu_irq irq, int baudbase, -- cgit v1.2.3