mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
char: use qemu_chr_fe* functions with CharBackend argument
This also switches from qemu_chr_add_handlers() to qemu_chr_fe_set_handlers(). Note that qemu_chr_fe_set_handlers() now takes the focus when fe_open (qemu_chr_add_handlers() did take the focus) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-16-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
fbf3cc3a67
commit
5345fdb446
47 changed files with 437 additions and 409 deletions
|
@ -110,11 +110,11 @@ static void sh_serial_write(void *opaque, hwaddr offs,
|
|||
}
|
||||
return;
|
||||
case 0x0c: /* FTDR / TDR */
|
||||
if (s->chr.chr) {
|
||||
if (qemu_chr_fe_get_driver(&s->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.chr, &ch, 1);
|
||||
qemu_chr_fe_write_all(&s->chr, &ch, 1);
|
||||
}
|
||||
s->dr = val;
|
||||
s->flags &= ~SH_SERIAL_FLAG_TDE;
|
||||
|
@ -399,8 +399,9 @@ void sh_serial_init(MemoryRegion *sysmem,
|
|||
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);
|
||||
qemu_chr_fe_set_handlers(&s->chr, sh_serial_can_receive1,
|
||||
sh_serial_receive1,
|
||||
sh_serial_event, s, NULL);
|
||||
}
|
||||
|
||||
s->eri = eri_source;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue