aboutsummaryrefslogtreecommitdiff
path: root/hw/char
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-09-11 19:26:51 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-09-11 19:26:51 +0100
commitf4ef8c9cc10b3bee829b9775879d4ff9f77c2442 (patch)
tree8245341c3ebfe98b9673bf7a8cb818b6d494c76f /hw/char
parent2499453eb1cbb68a45d7562a180afd7659007fd4 (diff)
parentb84bf23c88699098973de3bdec316c796f1b3794 (diff)
downloadqemu-f4ef8c9cc10b3bee829b9775879d4ff9f77c2442.zip
qemu-f4ef8c9cc10b3bee829b9775879d4ff9f77c2442.tar.gz
qemu-f4ef8c9cc10b3bee829b9775879d4ff9f77c2442.tar.bz2
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging
QOM boilerplate cleanup Documentation build fix: * memory: Remove kernel-doc comment marker (Eduardo Habkost) QOM cleanups: * Rename QOM macros for consistency between TYPE_* and type checking constants (Eduardo Habkost) QOM new macros: * OBJECT_DECLARE_* and OBJECT_DEFINE_* macros (Daniel P. Berrangé) * DECLARE_*_CHECKER macros (Eduardo Habkost) Automated QOM boilerplate changes: * Automated changes to use DECLARE_*_CHECKER (Eduardo Habkost * Automated changes to use OBJECT_DECLARE* (Eduardo Habkost) # gpg: Signature made Thu 10 Sep 2020 19:17:49 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: (33 commits) virtio-vga: Use typedef name for instance_size vhost-user-vga: Use typedef name for instance_size xilinx_axienet: Use typedef name for instance_size lpc_ich9: Use typedef name for instance_size omap_intc: Use typedef name for instance_size xilinx_axidma: Use typedef name for instance_size tusb6010: Rename TUSB to TUSB6010 pc87312: Rename TYPE_PC87312_SUPERIO to TYPE_PC87312 vfio: Rename PCI_VFIO to VFIO_PCI usb: Rename USB_SERIAL_DEV to USB_SERIAL sabre: Rename SABRE_DEVICE to SABRE rs6000_mc: Rename RS6000MC_DEVICE to RS6000MC filter-rewriter: Rename FILTER_COLO_REWRITER to FILTER_REWRITER esp: Rename ESP_STATE to ESP ahci: Rename ICH_AHCI to ICH9_AHCI vmgenid: Rename VMGENID_DEVICE to TYPE_VMGENID vfio: Rename VFIO_AP_DEVICE_TYPE to TYPE_VFIO_AP_DEVICE dev-smartcard-reader: Rename CCID_DEV_NAME to TYPE_USB_CCID_DEV ap-device: Rename AP_DEVICE_TYPE to TYPE_AP_DEVICE gpex: Fix type checking function name ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/char')
-rw-r--r--hw/char/debugcon.c10
-rw-r--r--hw/char/etraxfs_ser.c10
-rw-r--r--hw/char/exynos4210_uart.c10
-rw-r--r--hw/char/grlib_apbuart.c10
-rw-r--r--hw/char/ipoctal232.c5
-rw-r--r--hw/char/lm32_juart.c6
-rw-r--r--hw/char/lm32_uart.c6
-rw-r--r--hw/char/mcf_uart.c9
-rw-r--r--hw/char/milkymist-uart.c7
-rw-r--r--hw/char/parallel.c10
-rw-r--r--hw/char/sclpconsole-lm.c10
-rw-r--r--hw/char/sclpconsole.c10
-rw-r--r--hw/char/serial-isa.c9
-rw-r--r--hw/char/serial-pci.c9
-rw-r--r--hw/char/spapr_vty.c10
-rw-r--r--hw/char/terminal3270.c10
-rw-r--r--hw/char/virtio-console.c10
-rw-r--r--hw/char/xilinx_uartlite.c10
18 files changed, 99 insertions, 62 deletions
diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c
index c8d938e..daaaca0 100644
--- a/hw/char/debugcon.c
+++ b/hw/char/debugcon.c
@@ -30,10 +30,12 @@
#include "chardev/char-fe.h"
#include "hw/isa/isa.h"
#include "hw/qdev-properties.h"
+#include "qom/object.h"
#define TYPE_ISA_DEBUGCON_DEVICE "isa-debugcon"
-#define ISA_DEBUGCON_DEVICE(obj) \
- OBJECT_CHECK(ISADebugconState, (obj), TYPE_ISA_DEBUGCON_DEVICE)
+typedef struct ISADebugconState ISADebugconState;
+DECLARE_INSTANCE_CHECKER(ISADebugconState, ISA_DEBUGCON_DEVICE,
+ TYPE_ISA_DEBUGCON_DEVICE)
//#define DEBUG_DEBUGCON
@@ -43,12 +45,12 @@ typedef struct DebugconState {
uint32_t readback;
} DebugconState;
-typedef struct ISADebugconState {
+struct ISADebugconState {
ISADevice parent_obj;
uint32_t iobase;
DebugconState state;
-} ISADebugconState;
+};
static void debugcon_ioport_write(void *opaque, hwaddr addr, uint64_t val,
unsigned width)
diff --git a/hw/char/etraxfs_ser.c b/hw/char/etraxfs_ser.c
index 947bdb6..d9fba2a 100644
--- a/hw/char/etraxfs_ser.c
+++ b/hw/char/etraxfs_ser.c
@@ -29,6 +29,7 @@
#include "chardev/char-fe.h"
#include "qemu/log.h"
#include "qemu/module.h"
+#include "qom/object.h"
#define D(x)
@@ -49,10 +50,11 @@
#define STAT_TR_RDY 24
#define TYPE_ETRAX_FS_SERIAL "etraxfs,serial"
-#define ETRAX_SERIAL(obj) \
- OBJECT_CHECK(ETRAXSerial, (obj), TYPE_ETRAX_FS_SERIAL)
+typedef struct ETRAXSerial ETRAXSerial;
+DECLARE_INSTANCE_CHECKER(ETRAXSerial, ETRAX_SERIAL,
+ TYPE_ETRAX_FS_SERIAL)
-typedef struct ETRAXSerial {
+struct ETRAXSerial {
SysBusDevice parent_obj;
MemoryRegion mmio;
@@ -67,7 +69,7 @@ typedef struct ETRAXSerial {
/* Control registers. */
uint32_t regs[R_MAX];
-} ETRAXSerial;
+};
static void ser_update_irq(ETRAXSerial *s)
{
diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c
index 9c8ab3a..b8ea34e 100644
--- a/hw/char/exynos4210_uart.c
+++ b/hw/char/exynos4210_uart.c
@@ -34,6 +34,7 @@
#include "hw/qdev-properties.h"
#include "trace.h"
+#include "qom/object.h"
/*
* Offsets for UART registers relative to SFR base address
@@ -138,10 +139,11 @@ typedef struct {
} Exynos4210UartFIFO;
#define TYPE_EXYNOS4210_UART "exynos4210.uart"
-#define EXYNOS4210_UART(obj) \
- OBJECT_CHECK(Exynos4210UartState, (obj), TYPE_EXYNOS4210_UART)
+typedef struct Exynos4210UartState Exynos4210UartState;
+DECLARE_INSTANCE_CHECKER(Exynos4210UartState, EXYNOS4210_UART,
+ TYPE_EXYNOS4210_UART)
-typedef struct Exynos4210UartState {
+struct Exynos4210UartState {
SysBusDevice parent_obj;
MemoryRegion iomem;
@@ -159,7 +161,7 @@ typedef struct Exynos4210UartState {
uint32_t channel;
-} Exynos4210UartState;
+};
/* Used only for tracing */
diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c
index 16d0fea..6fd88d8 100644
--- a/hw/char/grlib_apbuart.c
+++ b/hw/char/grlib_apbuart.c
@@ -31,6 +31,7 @@
#include "chardev/char-fe.h"
#include "trace.h"
+#include "qom/object.h"
#define UART_REG_SIZE 20 /* Size of memory mapped registers */
@@ -72,10 +73,11 @@
#define FIFO_LENGTH 1024
-#define GRLIB_APB_UART(obj) \
- OBJECT_CHECK(UART, (obj), TYPE_GRLIB_APB_UART)
+typedef struct UART UART;
+DECLARE_INSTANCE_CHECKER(UART, GRLIB_APB_UART,
+ TYPE_GRLIB_APB_UART)
-typedef struct UART {
+struct UART {
SysBusDevice parent_obj;
MemoryRegion iomem;
@@ -91,7 +93,7 @@ typedef struct UART {
char buffer[FIFO_LENGTH];
int len;
int current;
-} UART;
+};
static int uart_data_to_read(UART *uart)
{
diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c
index d7c497b..2c987df 100644
--- a/hw/char/ipoctal232.c
+++ b/hw/char/ipoctal232.c
@@ -16,6 +16,7 @@
#include "qemu/bitops.h"
#include "qemu/module.h"
#include "chardev/char-fe.h"
+#include "qom/object.h"
/* #define DEBUG_IPOCTAL */
@@ -122,8 +123,8 @@ struct IPOctalState {
#define TYPE_IPOCTAL "ipoctal232"
-#define IPOCTAL(obj) \
- OBJECT_CHECK(IPOctalState, (obj), TYPE_IPOCTAL)
+DECLARE_INSTANCE_CHECKER(IPOctalState, IPOCTAL,
+ TYPE_IPOCTAL)
static const VMStateDescription vmstate_scc2698_channel = {
.name = "scc2698_channel",
diff --git a/hw/char/lm32_juart.c b/hw/char/lm32_juart.c
index 3f34861..5723f2e 100644
--- a/hw/char/lm32_juart.c
+++ b/hw/char/lm32_juart.c
@@ -26,6 +26,7 @@
#include "hw/char/lm32_juart.h"
#include "hw/qdev-properties.h"
+#include "qom/object.h"
enum {
LM32_JUART_MIN_SAVE_VERSION = 0,
@@ -41,7 +42,9 @@ enum {
JRX_FULL = (1<<8),
};
-#define LM32_JUART(obj) OBJECT_CHECK(LM32JuartState, (obj), TYPE_LM32_JUART)
+typedef struct LM32JuartState LM32JuartState;
+DECLARE_INSTANCE_CHECKER(LM32JuartState, LM32_JUART,
+ TYPE_LM32_JUART)
struct LM32JuartState {
SysBusDevice parent_obj;
@@ -51,7 +54,6 @@ struct LM32JuartState {
uint32_t jtx;
uint32_t jrx;
};
-typedef struct LM32JuartState LM32JuartState;
uint32_t lm32_juart_get_jtx(DeviceState *d)
{
diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c
index b0b1092..624bc83 100644
--- a/hw/char/lm32_uart.c
+++ b/hw/char/lm32_uart.c
@@ -31,6 +31,7 @@
#include "chardev/char-fe.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
+#include "qom/object.h"
enum {
R_RXTX = 0,
@@ -94,7 +95,9 @@ enum {
};
#define TYPE_LM32_UART "lm32-uart"
-#define LM32_UART(obj) OBJECT_CHECK(LM32UartState, (obj), TYPE_LM32_UART)
+typedef struct LM32UartState LM32UartState;
+DECLARE_INSTANCE_CHECKER(LM32UartState, LM32_UART,
+ TYPE_LM32_UART)
struct LM32UartState {
SysBusDevice parent_obj;
@@ -105,7 +108,6 @@ struct LM32UartState {
uint32_t regs[R_MAX];
};
-typedef struct LM32UartState LM32UartState;
static void uart_update_irq(LM32UartState *s)
{
diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c
index 8d1b7f2..f6baa3c 100644
--- a/hw/char/mcf_uart.c
+++ b/hw/char/mcf_uart.c
@@ -14,8 +14,9 @@
#include "hw/m68k/mcf.h"
#include "hw/qdev-properties.h"
#include "chardev/char-fe.h"
+#include "qom/object.h"
-typedef struct {
+struct mcf_uart_state {
SysBusDevice parent_obj;
MemoryRegion iomem;
@@ -33,10 +34,12 @@ typedef struct {
int rx_enabled;
qemu_irq irq;
CharBackend chr;
-} mcf_uart_state;
+};
+typedef struct mcf_uart_state mcf_uart_state;
#define TYPE_MCF_UART "mcf-uart"
-#define MCF_UART(obj) OBJECT_CHECK(mcf_uart_state, (obj), TYPE_MCF_UART)
+DECLARE_INSTANCE_CHECKER(mcf_uart_state, MCF_UART,
+ TYPE_MCF_UART)
/* UART Status Register bits. */
#define MCF_UART_RxRDY 0x01
diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c
index 1439efb..41204a0 100644
--- a/hw/char/milkymist-uart.c
+++ b/hw/char/milkymist-uart.c
@@ -30,6 +30,7 @@
#include "chardev/char-fe.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
+#include "qom/object.h"
enum {
R_RXTX = 0,
@@ -57,8 +58,9 @@ enum {
};
#define TYPE_MILKYMIST_UART "milkymist-uart"
-#define MILKYMIST_UART(obj) \
- OBJECT_CHECK(MilkymistUartState, (obj), TYPE_MILKYMIST_UART)
+typedef struct MilkymistUartState MilkymistUartState;
+DECLARE_INSTANCE_CHECKER(MilkymistUartState, MILKYMIST_UART,
+ TYPE_MILKYMIST_UART)
struct MilkymistUartState {
SysBusDevice parent_obj;
@@ -69,7 +71,6 @@ struct MilkymistUartState {
uint32_t regs[R_MAX];
};
-typedef struct MilkymistUartState MilkymistUartState;
static void uart_update_irq(MilkymistUartState *s)
{
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index c0f34bf..ddb14f3 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -37,6 +37,7 @@
#include "sysemu/reset.h"
#include "sysemu/sysemu.h"
#include "trace.h"
+#include "qom/object.h"
//#define DEBUG_PARALLEL
@@ -92,17 +93,18 @@ typedef struct ParallelState {
} ParallelState;
#define TYPE_ISA_PARALLEL "isa-parallel"
-#define ISA_PARALLEL(obj) \
- OBJECT_CHECK(ISAParallelState, (obj), TYPE_ISA_PARALLEL)
+typedef struct ISAParallelState ISAParallelState;
+DECLARE_INSTANCE_CHECKER(ISAParallelState, ISA_PARALLEL,
+ TYPE_ISA_PARALLEL)
-typedef struct ISAParallelState {
+struct ISAParallelState {
ISADevice parent_obj;
uint32_t index;
uint32_t iobase;
uint32_t isairq;
ParallelState state;
-} ISAParallelState;
+};
static void parallel_update_irq(ParallelState *s)
{
diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c
index 5848b4e..81f6d0e 100644
--- a/hw/char/sclpconsole-lm.c
+++ b/hw/char/sclpconsole-lm.c
@@ -24,6 +24,7 @@
#include "hw/s390x/event-facility.h"
#include "hw/qdev-properties.h"
#include "hw/s390x/ebcdic.h"
+#include "qom/object.h"
#define SIZE_BUFFER 4096
#define NEWLINE "\n"
@@ -37,18 +38,19 @@ typedef struct OprtnsCommand {
/* max size for line-mode data in 4K SCCB page */
#define SIZE_CONSOLE_BUFFER (SCCB_DATA_LEN - sizeof(OprtnsCommand))
-typedef struct SCLPConsoleLM {
+struct SCLPConsoleLM {
SCLPEvent event;
CharBackend chr;
bool echo; /* immediate echo of input if true */
uint32_t write_errors; /* errors writing to char layer */
uint32_t length; /* length of byte stream in buffer */
uint8_t buf[SIZE_CONSOLE_BUFFER];
-} SCLPConsoleLM;
+};
+typedef struct SCLPConsoleLM SCLPConsoleLM;
#define TYPE_SCLPLM_CONSOLE "sclplmconsole"
-#define SCLPLM_CONSOLE(obj) \
- OBJECT_CHECK(SCLPConsoleLM, (obj), TYPE_SCLPLM_CONSOLE)
+DECLARE_INSTANCE_CHECKER(SCLPConsoleLM, SCLPLM_CONSOLE,
+ TYPE_SCLPLM_CONSOLE)
/*
* Character layer call-back functions
diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c
index d6f7da0..aa72ab4 100644
--- a/hw/char/sclpconsole.c
+++ b/hw/char/sclpconsole.c
@@ -22,6 +22,7 @@
#include "hw/qdev-properties.h"
#include "hw/s390x/event-facility.h"
#include "chardev/char-fe.h"
+#include "qom/object.h"
typedef struct ASCIIConsoleData {
EventBufferHeader ebh;
@@ -31,7 +32,7 @@ typedef struct ASCIIConsoleData {
/* max size for ASCII data in 4K SCCB page */
#define SIZE_BUFFER_VT220 4080
-typedef struct SCLPConsole {
+struct SCLPConsole {
SCLPEvent event;
CharBackend chr;
uint8_t iov[SIZE_BUFFER_VT220];
@@ -40,11 +41,12 @@ typedef struct SCLPConsole {
uint32_t iov_data_len; /* length of byte stream in buffer */
uint32_t iov_sclp_rest; /* length of byte stream not read via SCLP */
bool notify; /* qemu_notify_event() req'd if true */
-} SCLPConsole;
+};
+typedef struct SCLPConsole SCLPConsole;
#define TYPE_SCLP_CONSOLE "sclpconsole"
-#define SCLP_CONSOLE(obj) \
- OBJECT_CHECK(SCLPConsole, (obj), TYPE_SCLP_CONSOLE)
+DECLARE_INSTANCE_CHECKER(SCLPConsole, SCLP_CONSOLE,
+ TYPE_SCLP_CONSOLE)
/* character layer call-back functions */
diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c
index b4c6594..d4aad81 100644
--- a/hw/char/serial-isa.c
+++ b/hw/char/serial-isa.c
@@ -32,17 +32,20 @@
#include "hw/isa/isa.h"
#include "hw/qdev-properties.h"
#include "migration/vmstate.h"
+#include "qom/object.h"
-#define ISA_SERIAL(obj) OBJECT_CHECK(ISASerialState, (obj), TYPE_ISA_SERIAL)
+typedef struct ISASerialState ISASerialState;
+DECLARE_INSTANCE_CHECKER(ISASerialState, ISA_SERIAL,
+ TYPE_ISA_SERIAL)
-typedef struct ISASerialState {
+struct ISASerialState {
ISADevice parent_obj;
uint32_t index;
uint32_t iobase;
uint32_t isairq;
SerialState state;
-} ISASerialState;
+};
static const int isa_serial_io[MAX_ISA_SERIAL_PORTS] = {
0x3f8, 0x2f8, 0x3e8, 0x2e8
diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
index cd56924..f689481 100644
--- a/hw/char/serial-pci.c
+++ b/hw/char/serial-pci.c
@@ -33,15 +33,18 @@
#include "hw/pci/pci.h"
#include "hw/qdev-properties.h"
#include "migration/vmstate.h"
+#include "qom/object.h"
-typedef struct PCISerialState {
+struct PCISerialState {
PCIDevice dev;
SerialState state;
uint8_t prog_if;
-} PCISerialState;
+};
+typedef struct PCISerialState PCISerialState;
#define TYPE_PCI_SERIAL "pci-serial"
-#define PCI_SERIAL(s) OBJECT_CHECK(PCISerialState, (s), TYPE_PCI_SERIAL)
+DECLARE_INSTANCE_CHECKER(PCISerialState, PCI_SERIAL,
+ TYPE_PCI_SERIAL)
static void serial_pci_realize(PCIDevice *dev, Error **errp)
{
diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c
index 464a523..dd6dd2d 100644
--- a/hw/char/spapr_vty.c
+++ b/hw/char/spapr_vty.c
@@ -8,19 +8,21 @@
#include "hw/ppc/spapr.h"
#include "hw/ppc/spapr_vio.h"
#include "hw/qdev-properties.h"
+#include "qom/object.h"
#define VTERM_BUFSIZE 16
-typedef struct SpaprVioVty {
+struct SpaprVioVty {
SpaprVioDevice sdev;
CharBackend chardev;
uint32_t in, out;
uint8_t buf[VTERM_BUFSIZE];
-} SpaprVioVty;
+};
+typedef struct SpaprVioVty SpaprVioVty;
#define TYPE_VIO_SPAPR_VTY_DEVICE "spapr-vty"
-#define VIO_SPAPR_VTY_DEVICE(obj) \
- OBJECT_CHECK(SpaprVioVty, (obj), TYPE_VIO_SPAPR_VTY_DEVICE)
+DECLARE_INSTANCE_CHECKER(SpaprVioVty, VIO_SPAPR_VTY_DEVICE,
+ TYPE_VIO_SPAPR_VTY_DEVICE)
static int vty_can_receive(void *opaque)
{
diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c
index 2c47ebf..d77981b 100644
--- a/hw/char/terminal3270.c
+++ b/hw/char/terminal3270.c
@@ -17,6 +17,7 @@
#include "chardev/char-fe.h"
#include "hw/qdev-properties.h"
#include "hw/s390x/3270-ccw.h"
+#include "qom/object.h"
/* Enough spaces for different window sizes. */
#define INPUT_BUFFER_SIZE 1000
@@ -26,7 +27,7 @@
*/
#define OUTPUT_BUFFER_SIZE 2051
-typedef struct Terminal3270 {
+struct Terminal3270 {
EmulatedCcw3270Device cdev;
CharBackend chr;
uint8_t inv[INPUT_BUFFER_SIZE];
@@ -34,11 +35,12 @@ typedef struct Terminal3270 {
int in_len;
bool handshake_done;
guint timer_tag;
-} Terminal3270;
+};
+typedef struct Terminal3270 Terminal3270;
#define TYPE_TERMINAL_3270 "x-terminal3270"
-#define TERMINAL_3270(obj) \
- OBJECT_CHECK(Terminal3270, (obj), TYPE_TERMINAL_3270)
+DECLARE_INSTANCE_CHECKER(Terminal3270, TERMINAL_3270,
+ TYPE_TERMINAL_3270)
static int terminal_can_read(void *opaque)
{
diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c
index 4f46753..bc752cf 100644
--- a/hw/char/virtio-console.c
+++ b/hw/char/virtio-console.c
@@ -19,17 +19,19 @@
#include "hw/virtio/virtio-serial.h"
#include "qapi/error.h"
#include "qapi/qapi-events-char.h"
+#include "qom/object.h"
#define TYPE_VIRTIO_CONSOLE_SERIAL_PORT "virtserialport"
-#define VIRTIO_CONSOLE(obj) \
- OBJECT_CHECK(VirtConsole, (obj), TYPE_VIRTIO_CONSOLE_SERIAL_PORT)
+typedef struct VirtConsole VirtConsole;
+DECLARE_INSTANCE_CHECKER(VirtConsole, VIRTIO_CONSOLE,
+ TYPE_VIRTIO_CONSOLE_SERIAL_PORT)
-typedef struct VirtConsole {
+struct VirtConsole {
VirtIOSerialPort parent_obj;
CharBackend chr;
guint watch;
-} VirtConsole;
+};
/*
* Callback function that's called from chardevs when backend becomes
diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c
index ae4ccd0..8e9f9cd 100644
--- a/hw/char/xilinx_uartlite.c
+++ b/hw/char/xilinx_uartlite.c
@@ -29,6 +29,7 @@
#include "hw/sysbus.h"
#include "qemu/module.h"
#include "chardev/char-fe.h"
+#include "qom/object.h"
#define DUART(x)
@@ -52,10 +53,11 @@
#define CONTROL_IE 0x10
#define TYPE_XILINX_UARTLITE "xlnx.xps-uartlite"
-#define XILINX_UARTLITE(obj) \
- OBJECT_CHECK(XilinxUARTLite, (obj), TYPE_XILINX_UARTLITE)
+typedef struct XilinxUARTLite XilinxUARTLite;
+DECLARE_INSTANCE_CHECKER(XilinxUARTLite, XILINX_UARTLITE,
+ TYPE_XILINX_UARTLITE)
-typedef struct XilinxUARTLite {
+struct XilinxUARTLite {
SysBusDevice parent_obj;
MemoryRegion mmio;
@@ -67,7 +69,7 @@ typedef struct XilinxUARTLite {
unsigned int rx_fifo_len;
uint32_t regs[R_MAX];
-} XilinxUARTLite;
+};
static void uart_update_irq(XilinxUARTLite *s)
{