diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-01-26 18:26:44 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-06-02 11:33:53 +0400 |
commit | 4d43a603c71d0eb92534bc82b72933f329d8a64c (patch) | |
tree | 4f3e84aa4a23374078d04797438b0389cd9460f1 /hw | |
parent | c90e9392efa6579e714fe9aa2993e7d89e3792dc (diff) |
char: move CharBackend handling in char-fe unit
Move all the frontend struct and methods to a seperate unit. This avoids
accidentally mixing backend and frontend calls, and helps with readabilty.
Make qemu_chr_replay() a macro shared by both char and char-fe.
Export qemu_chr_write(), and use a macro for qemu_chr_write_all()
(nb: yes, CharBackend is for char frontend :)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'hw')
32 files changed, 32 insertions, 26 deletions
diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index 9eabbaeea5..91f573338c 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -30,7 +30,7 @@ #include "hw/arm/omap.h" #include "sysemu/sysemu.h" #include "qemu/timer.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "hw/block/flash.h" #include "hw/arm/soc_dma.h" #include "hw/sysbus.h" diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 0d43cc707c..629e6c64e6 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -17,7 +17,7 @@ #include "hw/char/serial.h" #include "hw/i2c/i2c.h" #include "hw/ssi/ssi.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "qemu/cutils.h" diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c index 967caea749..7683edc9e5 100644 --- a/hw/arm/strongarm.c +++ b/hw/arm/strongarm.c @@ -34,6 +34,7 @@ #include "strongarm.h" #include "qemu/error-report.h" #include "hw/arm/arm.h" +#include "chardev/char-fe.h" #include "chardev/char-serial.h" #include "sysemu/sysemu.h" #include "hw/ssi/ssi.h" diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c index 4bfc185376..4a2c124104 100644 --- a/hw/char/cadence_uart.c +++ b/hw/char/cadence_uart.c @@ -23,6 +23,7 @@ #include "qemu/osdep.h" #include "hw/sysbus.h" +#include "chardev/char-fe.h" #include "chardev/char-serial.h" #include "qemu/timer.h" #include "qemu/log.h" diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c index 77d91c8558..762e3d8ada 100644 --- a/hw/char/debugcon.c +++ b/hw/char/debugcon.c @@ -27,7 +27,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "hw/hw.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "hw/isa/isa.h" #include "hw/i386/pc.h" diff --git a/hw/char/digic-uart.c b/hw/char/digic-uart.c index 4f1dec7f1d..34306e11ff 100644 --- a/hw/char/digic-uart.c +++ b/hw/char/digic-uart.c @@ -29,7 +29,7 @@ #include "qemu/osdep.h" #include "hw/hw.h" #include "hw/sysbus.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "qemu/log.h" #include "hw/char/digic-uart.h" diff --git a/hw/char/escc.c b/hw/char/escc.c index 81d792cb47..3f787632c7 100644 --- a/hw/char/escc.c +++ b/hw/char/escc.c @@ -26,6 +26,7 @@ #include "hw/hw.h" #include "hw/sysbus.h" #include "hw/char/escc.h" +#include "chardev/char-fe.h" #include "chardev/char-serial.h" #include "ui/console.h" #include "ui/input.h" diff --git a/hw/char/etraxfs_ser.c b/hw/char/etraxfs_ser.c index 33e3e16397..c1fba9f50f 100644 --- a/hw/char/etraxfs_ser.c +++ b/hw/char/etraxfs_ser.c @@ -24,7 +24,7 @@ #include "qemu/osdep.h" #include "hw/sysbus.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "qemu/log.h" #define D(x) diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c index d93125645a..b51d44a321 100644 --- a/hw/char/exynos4210_uart.c +++ b/hw/char/exynos4210_uart.c @@ -23,6 +23,7 @@ #include "hw/sysbus.h" #include "qemu/error-report.h" #include "sysemu/sysemu.h" +#include "chardev/char-fe.h" #include "chardev/char-serial.h" #include "hw/arm/exynos4210.h" diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c index 39d1133c61..32d98edf49 100644 --- a/hw/char/grlib_apbuart.c +++ b/hw/char/grlib_apbuart.c @@ -24,7 +24,7 @@ #include "qemu/osdep.h" #include "hw/sysbus.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "trace.h" diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c index b8a3c92c9e..337a3e566a 100644 --- a/hw/char/ipoctal232.c +++ b/hw/char/ipoctal232.c @@ -11,7 +11,7 @@ #include "qemu/osdep.h" #include "hw/ipack/ipack.h" #include "qemu/bitops.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" /* #define DEBUG_IPOCTAL */ diff --git a/hw/char/lm32_juart.c b/hw/char/lm32_juart.c index 6b0633e518..3948dcd332 100644 --- a/hw/char/lm32_juart.c +++ b/hw/char/lm32_juart.c @@ -21,7 +21,7 @@ #include "hw/hw.h" #include "hw/sysbus.h" #include "trace.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "hw/char/lm32_juart.h" diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c index a7610c28ce..cff8c38f90 100644 --- a/hw/char/lm32_uart.c +++ b/hw/char/lm32_uart.c @@ -26,7 +26,7 @@ #include "hw/hw.h" #include "hw/sysbus.h" #include "trace.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "qemu/error-report.h" enum { diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c index b639b53c83..fe12ad5ccb 100644 --- a/hw/char/mcf_uart.c +++ b/hw/char/mcf_uart.c @@ -9,7 +9,7 @@ #include "hw/hw.h" #include "hw/sysbus.h" #include "hw/m68k/mcf.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "exec/address-spaces.h" #include "qapi/error.h" diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c index 5ef847c5eb..e19d0f6520 100644 --- a/hw/char/milkymist-uart.c +++ b/hw/char/milkymist-uart.c @@ -25,7 +25,7 @@ #include "hw/hw.h" #include "hw/sysbus.h" #include "trace.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "qemu/error-report.h" enum { diff --git a/hw/char/parallel.c b/hw/char/parallel.c index 1d6c6e9f33..75a1a2f55e 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -26,6 +26,7 @@ #include "qapi/error.h" #include "hw/hw.h" #include "chardev/char-parallel.h" +#include "chardev/char-fe.h" #include "hw/isa/isa.h" #include "hw/i386/pc.h" #include "sysemu/sysemu.h" diff --git a/hw/char/pl011.c b/hw/char/pl011.c index 1757035bb3..33802f00c8 100644 --- a/hw/char/pl011.c +++ b/hw/char/pl011.c @@ -9,7 +9,7 @@ #include "qemu/osdep.h" #include "hw/sysbus.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "qemu/log.h" #include "trace.h" diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c index 755d514188..1b15046690 100644 --- a/hw/char/sclpconsole-lm.c +++ b/hw/char/sclpconsole-lm.c @@ -17,7 +17,7 @@ #include "hw/qdev.h" #include "qemu/thread.h" #include "qemu/error-report.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "hw/s390x/sclp.h" #include "hw/s390x/event-facility.h" diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c index 0fd3cb4887..4a107a268d 100644 --- a/hw/char/sclpconsole.c +++ b/hw/char/sclpconsole.c @@ -19,7 +19,7 @@ #include "hw/s390x/sclp.h" #include "hw/s390x/event-facility.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" typedef struct ASCIIConsoleData { EventBufferHeader ebh; diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c index 80c7696d8d..ca9816d045 100644 --- a/hw/char/sh_serial.c +++ b/hw/char/sh_serial.c @@ -27,7 +27,7 @@ #include "qemu/osdep.h" #include "hw/hw.h" #include "hw/sh4/sh.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "exec/address-spaces.h" #include "qapi/error.h" diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c index 2317e45404..8f02f3a612 100644 --- a/hw/char/spapr_vty.c +++ b/hw/char/spapr_vty.c @@ -4,7 +4,7 @@ #include "qemu-common.h" #include "cpu.h" #include "hw/qdev.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "hw/ppc/spapr.h" #include "hw/ppc/spapr_vio.h" diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c index c043104185..7b10a04f18 100644 --- a/hw/char/terminal3270.c +++ b/hw/char/terminal3270.c @@ -13,7 +13,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "hw/s390x/3270-ccw.h" /* Enough spaces for different window sizes. */ diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c index 8418db6a07..0cb1668c8a 100644 --- a/hw/char/virtio-console.c +++ b/hw/char/virtio-console.c @@ -11,7 +11,7 @@ */ #include "qemu/osdep.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "qemu/error-report.h" #include "trace.h" #include "hw/virtio/virtio-serial.h" diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c index 1cdbe59f8a..cb849c2e3e 100644 --- a/hw/char/xen_console.c +++ b/hw/char/xen_console.c @@ -25,7 +25,7 @@ #include "qapi/error.h" #include "hw/hw.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "hw/xen/xen_backend.h" #include "qapi/error.h" diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c index bcebdae3da..71ed2fc1be 100644 --- a/hw/char/xilinx_uartlite.c +++ b/hw/char/xilinx_uartlite.c @@ -24,7 +24,7 @@ #include "qemu/osdep.h" #include "hw/sysbus.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #define DUART(x) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index 4da0c6a24e..a549d39030 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -20,7 +20,7 @@ #include "hw/block/block.h" #include "net/hub.h" #include "qapi/visitor.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "sysemu/iothread.h" static void get_pointer(Object *obj, Visitor *v, Property *prop, diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c index 35285383fd..329b03e17f 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@ -30,7 +30,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/timer.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "sysemu/sysemu.h" #include "hw/ipmi/ipmi.h" diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index cd064dcf8c..6367d041f0 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -29,7 +29,7 @@ #include "qemu/error-report.h" #include "qemu/event_notifier.h" #include "qom/object_interfaces.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "sysemu/hostmem.h" #include "sysemu/qtest.h" #include "qapi/visitor.h" diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index c2096b25ab..fed3683a50 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -9,7 +9,7 @@ */ #include "qemu/osdep.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "qemu/error-report.h" #include "qemu/sockets.h" #include "ccid.h" diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index 8baf040b5f..bfbf7cdce7 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -16,6 +16,7 @@ #include "hw/usb.h" #include "hw/usb/desc.h" #include "chardev/char-serial.h" +#include "chardev/char-fe.h" //#define DEBUG_Serial diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index c862c1adea..d2b3a84a03 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -33,7 +33,7 @@ #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "qemu/iov.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include <usbredirparser.h> #include <usbredirfilter.h> diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 44c9d8c954..0aa446eb91 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -13,7 +13,7 @@ #include "hw/virtio/vhost.h" #include "hw/virtio/vhost-backend.h" #include "hw/virtio/virtio-net.h" -#include "chardev/char.h" +#include "chardev/char-fe.h" #include "sysemu/kvm.h" #include "qemu/error-report.h" #include "qemu/sockets.h" |