mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
serial: start making SerialMM a sysbus device
Memory mapped serial device is in fact a sysbus device. The following patches will make use of sysbus facilities for resource and registration. In particular, "serial-mm: use sysbus facilities" will move internal serial realization to serial_mm_realize callback to follow qdev best practices. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
b9975000a0
commit
490a9d9b36
5 changed files with 73 additions and 25 deletions
|
@ -57,7 +57,6 @@ typedef struct SerialState {
|
|||
qemu_irq irq;
|
||||
CharBackend chr;
|
||||
int last_break_enable;
|
||||
int it_shift;
|
||||
uint32_t baudbase;
|
||||
uint32_t tsr_retry;
|
||||
guint watch_tag;
|
||||
|
@ -80,6 +79,14 @@ typedef struct SerialState {
|
|||
MemoryRegion io;
|
||||
} SerialState;
|
||||
|
||||
typedef struct SerialMM {
|
||||
SysBusDevice parent;
|
||||
|
||||
SerialState serial;
|
||||
|
||||
int it_shift;
|
||||
} SerialMM;
|
||||
|
||||
extern const VMStateDescription vmstate_serial;
|
||||
extern const MemoryRegionOps serial_io_ops;
|
||||
|
||||
|
@ -88,12 +95,15 @@ void serial_set_frequency(SerialState *s, uint32_t frequency);
|
|||
#define TYPE_SERIAL "serial"
|
||||
#define SERIAL(s) OBJECT_CHECK(SerialState, (s), TYPE_SERIAL)
|
||||
|
||||
#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);
|
||||
SerialState *serial_mm_init(MemoryRegion *address_space,
|
||||
hwaddr base, int it_shift,
|
||||
qemu_irq irq, int baudbase,
|
||||
Chardev *chr, enum device_endian end);
|
||||
SerialMM *serial_mm_init(MemoryRegion *address_space,
|
||||
hwaddr base, int it_shift,
|
||||
qemu_irq irq, int baudbase,
|
||||
Chardev *chr, enum device_endian end);
|
||||
|
||||
/* serial-isa.c */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue