aboutsummaryrefslogtreecommitdiff
path: root/hw/char/sh_serial.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-10-22 12:52:52 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2016-10-24 15:27:20 +0200
commit32a6ebecd2ffe82ffade5edf9e054e20cb48f281 (patch)
treeb1e82e3f6eb4a28c65098015dd8114e190a064bf /hw/char/sh_serial.c
parentbecdfa00cfa2995e859ccefa4b7d72a72eb96581 (diff)
downloadqemu-32a6ebecd2ffe82ffade5edf9e054e20cb48f281.zip
qemu-32a6ebecd2ffe82ffade5edf9e054e20cb48f281.tar.gz
qemu-32a6ebecd2ffe82ffade5edf9e054e20cb48f281.tar.bz2
char: remaining switch to CharBackend in frontend
Similar to previous change, for the remaining CharDriverState front ends users. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-13-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/char/sh_serial.c')
-rw-r--r--hw/char/sh_serial.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c
index 97ce562..c8b91bb 100644
--- a/hw/char/sh_serial.c
+++ b/hw/char/sh_serial.c
@@ -29,6 +29,7 @@
#include "hw/sh4/sh.h"
#include "sysemu/char.h"
#include "exec/address-spaces.h"
+#include "qapi/error.h"
//#define DEBUG_SERIAL
@@ -62,7 +63,7 @@ typedef struct {
int flags;
int rtrg;
- CharDriverState *chr;
+ CharBackend chr;
qemu_irq eri;
qemu_irq rxi;
@@ -109,11 +110,11 @@ static void sh_serial_write(void *opaque, hwaddr offs,
}
return;
case 0x0c: /* FTDR / TDR */
- if (s->chr) {
+ if (s->chr.chr) {
ch = val;
/* XXX this blocks entire thread. Rewrite to use
* qemu_chr_fe_write and background I/O callbacks */
- qemu_chr_fe_write_all(s->chr, &ch, 1);
+ qemu_chr_fe_write_all(s->chr.chr, &ch, 1);
}
s->dr = val;
s->flags &= ~SH_SERIAL_FLAG_TDE;
@@ -395,10 +396,9 @@ void sh_serial_init(MemoryRegion *sysmem,
0, 0x28);
memory_region_add_subregion(sysmem, A7ADDR(base), &s->iomem_a7);
- s->chr = chr;
-
if (chr) {
qemu_chr_fe_claim_no_fail(chr);
+ qemu_chr_fe_init(&s->chr, chr, &error_abort);
qemu_chr_add_handlers(chr, sh_serial_can_receive1, sh_serial_receive1,
sh_serial_event, s);
}