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>
This commit is contained in:
Marc-André Lureau 2017-01-26 18:26:44 +04:00
parent c90e9392ef
commit 4d43a603c7
56 changed files with 664 additions and 623 deletions

View file

@ -9,7 +9,7 @@
#define BCM2835_AUX_H
#include "hw/sysbus.h"
#include "chardev/char.h"
#include "chardev/char-fe.h"
#define TYPE_BCM2835_AUX "bcm2835-aux"
#define BCM2835_AUX(obj) OBJECT_CHECK(BCM2835AuxState, (obj), TYPE_BCM2835_AUX)

View file

@ -19,7 +19,7 @@
#ifndef CADENCE_UART_H
#include "hw/sysbus.h"
#include "chardev/char.h"
#include "chardev/char-fe.h"
#include "qemu/timer.h"
#define CADENCE_UART_RX_FIFO_SIZE 16

View file

@ -19,7 +19,7 @@
#define HW_CHAR_DIGIC_UART_H
#include "hw/sysbus.h"
#include "chardev/char.h"
#include "chardev/char-fe.h"
#define TYPE_DIGIC_UART "digic-uart"
#define DIGIC_UART(obj) \

View file

@ -19,7 +19,7 @@
#define IMX_SERIAL_H
#include "hw/sysbus.h"
#include "chardev/char.h"
#include "chardev/char-fe.h"
#define TYPE_IMX_SERIAL "imx.serial"
#define IMX_SERIAL(obj) OBJECT_CHECK(IMXSerialState, (obj), TYPE_IMX_SERIAL)

View file

@ -28,7 +28,7 @@
#include "hw/hw.h"
#include "sysemu/sysemu.h"
#include "chardev/char.h"
#include "chardev/char-fe.h"
#include "exec/memory.h"
#include "qemu/fifo8.h"
#include "chardev/char.h"

View file

@ -26,7 +26,7 @@
#define HW_STM32F2XX_USART_H
#include "hw/sysbus.h"
#include "chardev/char.h"
#include "chardev/char-fe.h"
#include "hw/hw.h"
#define USART_SR 0x00