diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-10-23 18:37:33 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2020-01-07 17:24:29 +0400 |
commit | 10315a70896fb82000cc4b2a1198b70c775c7a59 (patch) | |
tree | d09dca9e94c0c9465f7cf2cc714b6827eec358ca /include | |
parent | 9bc7176c8c30760d2dc0e5b560a6c14f5f9aa08d (diff) |
serial: make SerialIO a sysbus device
Make serial IO a proper sysbus device, similar to serial MM.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/char/serial.h | 13 |
1 files changed, 11 insertions, 2 deletions
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, |