aboutsummaryrefslogtreecommitdiff
path: root/include/hw/char
diff options
context:
space:
mode:
Diffstat (limited to 'include/hw/char')
-rw-r--r--include/hw/char/avr_usart.h4
-rw-r--r--include/hw/char/bcm2835_aux.h3
-rw-r--r--include/hw/char/cadence_uart.h4
-rw-r--r--include/hw/char/cmsdk-apb-uart.h4
-rw-r--r--include/hw/char/digic-uart.h4
-rw-r--r--include/hw/char/escc.h3
-rw-r--r--include/hw/char/ibex_uart.h4
-rw-r--r--include/hw/char/imx_serial.h3
-rw-r--r--include/hw/char/nrf51_uart.h3
-rw-r--r--include/hw/char/pl011.h3
-rw-r--r--include/hw/char/renesas_sci.h3
-rw-r--r--include/hw/char/serial.h9
-rw-r--r--include/hw/char/stm32f2xx_usart.h4
13 files changed, 30 insertions, 21 deletions
diff --git a/include/hw/char/avr_usart.h b/include/hw/char/avr_usart.h
index 67ad345edd..5202f152b0 100644
--- a/include/hw/char/avr_usart.h
+++ b/include/hw/char/avr_usart.h
@@ -59,8 +59,8 @@
#define TYPE_AVR_USART "avr-usart"
typedef struct AVRUsartState AVRUsartState;
-#define AVR_USART(obj) \
- OBJECT_CHECK(AVRUsartState, (obj), TYPE_AVR_USART)
+DECLARE_INSTANCE_CHECKER(AVRUsartState, AVR_USART,
+ TYPE_AVR_USART)
struct AVRUsartState {
/* <private> */
diff --git a/include/hw/char/bcm2835_aux.h b/include/hw/char/bcm2835_aux.h
index 2647becc52..a08795c47f 100644
--- a/include/hw/char/bcm2835_aux.h
+++ b/include/hw/char/bcm2835_aux.h
@@ -15,7 +15,8 @@
#define TYPE_BCM2835_AUX "bcm2835-aux"
typedef struct BCM2835AuxState BCM2835AuxState;
-#define BCM2835_AUX(obj) OBJECT_CHECK(BCM2835AuxState, (obj), TYPE_BCM2835_AUX)
+DECLARE_INSTANCE_CHECKER(BCM2835AuxState, BCM2835_AUX,
+ TYPE_BCM2835_AUX)
#define BCM2835_AUX_RX_FIFO_LEN 8
diff --git a/include/hw/char/cadence_uart.h b/include/hw/char/cadence_uart.h
index 3d02d6ef1a..1734f53541 100644
--- a/include/hw/char/cadence_uart.h
+++ b/include/hw/char/cadence_uart.h
@@ -33,8 +33,8 @@
#define TYPE_CADENCE_UART "cadence_uart"
typedef struct CadenceUARTState CadenceUARTState;
-#define CADENCE_UART(obj) OBJECT_CHECK(CadenceUARTState, (obj), \
- TYPE_CADENCE_UART)
+DECLARE_INSTANCE_CHECKER(CadenceUARTState, CADENCE_UART,
+ TYPE_CADENCE_UART)
struct CadenceUARTState {
/*< private >*/
diff --git a/include/hw/char/cmsdk-apb-uart.h b/include/hw/char/cmsdk-apb-uart.h
index 32c0df9df3..2c3869aa16 100644
--- a/include/hw/char/cmsdk-apb-uart.h
+++ b/include/hw/char/cmsdk-apb-uart.h
@@ -19,8 +19,8 @@
#define TYPE_CMSDK_APB_UART "cmsdk-apb-uart"
typedef struct CMSDKAPBUART CMSDKAPBUART;
-#define CMSDK_APB_UART(obj) OBJECT_CHECK(CMSDKAPBUART, (obj), \
- TYPE_CMSDK_APB_UART)
+DECLARE_INSTANCE_CHECKER(CMSDKAPBUART, CMSDK_APB_UART,
+ TYPE_CMSDK_APB_UART)
struct CMSDKAPBUART {
/*< private >*/
diff --git a/include/hw/char/digic-uart.h b/include/hw/char/digic-uart.h
index 7c6ec2a5c5..01d406833d 100644
--- a/include/hw/char/digic-uart.h
+++ b/include/hw/char/digic-uart.h
@@ -24,8 +24,8 @@
#define TYPE_DIGIC_UART "digic-uart"
typedef struct DigicUartState DigicUartState;
-#define DIGIC_UART(obj) \
- OBJECT_CHECK(DigicUartState, (obj), TYPE_DIGIC_UART)
+DECLARE_INSTANCE_CHECKER(DigicUartState, DIGIC_UART,
+ TYPE_DIGIC_UART)
enum {
R_TX = 0x00,
diff --git a/include/hw/char/escc.h b/include/hw/char/escc.h
index 5de2a39e77..5eaec507da 100644
--- a/include/hw/char/escc.h
+++ b/include/hw/char/escc.h
@@ -12,7 +12,8 @@
#define ESCC_SIZE 4
typedef struct ESCCState ESCCState;
-#define ESCC(obj) OBJECT_CHECK(ESCCState, (obj), TYPE_ESCC)
+DECLARE_INSTANCE_CHECKER(ESCCState, ESCC,
+ TYPE_ESCC)
typedef enum {
escc_chn_a, escc_chn_b,
diff --git a/include/hw/char/ibex_uart.h b/include/hw/char/ibex_uart.h
index ec9fcde8f0..36eb75fc4c 100644
--- a/include/hw/char/ibex_uart.h
+++ b/include/hw/char/ibex_uart.h
@@ -71,8 +71,8 @@ REG32(TIMEOUT_CTRL, 0x2c)
#define TYPE_IBEX_UART "ibex-uart"
typedef struct IbexUartState IbexUartState;
-#define IBEX_UART(obj) \
- OBJECT_CHECK(IbexUartState, (obj), TYPE_IBEX_UART)
+DECLARE_INSTANCE_CHECKER(IbexUartState, IBEX_UART,
+ TYPE_IBEX_UART)
struct IbexUartState {
/* <private> */
diff --git a/include/hw/char/imx_serial.h b/include/hw/char/imx_serial.h
index bfaf8ec695..200f1ec33a 100644
--- a/include/hw/char/imx_serial.h
+++ b/include/hw/char/imx_serial.h
@@ -24,7 +24,8 @@
#define TYPE_IMX_SERIAL "imx.serial"
typedef struct IMXSerialState IMXSerialState;
-#define IMX_SERIAL(obj) OBJECT_CHECK(IMXSerialState, (obj), TYPE_IMX_SERIAL)
+DECLARE_INSTANCE_CHECKER(IMXSerialState, IMX_SERIAL,
+ TYPE_IMX_SERIAL)
#define URXD_CHARRDY (1<<15) /* character read is valid */
#define URXD_ERR (1<<14) /* Character has error */
diff --git a/include/hw/char/nrf51_uart.h b/include/hw/char/nrf51_uart.h
index 20560ba6dc..0cf3c4e328 100644
--- a/include/hw/char/nrf51_uart.h
+++ b/include/hw/char/nrf51_uart.h
@@ -21,7 +21,8 @@
#define TYPE_NRF51_UART "nrf51_soc.uart"
typedef struct NRF51UARTState NRF51UARTState;
-#define NRF51_UART(obj) OBJECT_CHECK(NRF51UARTState, (obj), TYPE_NRF51_UART)
+DECLARE_INSTANCE_CHECKER(NRF51UARTState, NRF51_UART,
+ TYPE_NRF51_UART)
REG32(UART_STARTRX, 0x000)
REG32(UART_STOPRX, 0x004)
diff --git a/include/hw/char/pl011.h b/include/hw/char/pl011.h
index ddbd8ad45b..80de4ecde6 100644
--- a/include/hw/char/pl011.h
+++ b/include/hw/char/pl011.h
@@ -23,7 +23,8 @@
#define TYPE_PL011 "pl011"
typedef struct PL011State PL011State;
-#define PL011(obj) OBJECT_CHECK(PL011State, (obj), TYPE_PL011)
+DECLARE_INSTANCE_CHECKER(PL011State, PL011,
+ TYPE_PL011)
/* This shares the same struct (and cast macro) as the base pl011 device */
#define TYPE_PL011_LUMINARY "pl011_luminary"
diff --git a/include/hw/char/renesas_sci.h b/include/hw/char/renesas_sci.h
index 5a5ebfd28c..a4764e3eee 100644
--- a/include/hw/char/renesas_sci.h
+++ b/include/hw/char/renesas_sci.h
@@ -15,7 +15,8 @@
#define TYPE_RENESAS_SCI "renesas-sci"
typedef struct RSCIState RSCIState;
-#define RSCI(obj) OBJECT_CHECK(RSCIState, (obj), TYPE_RENESAS_SCI)
+DECLARE_INSTANCE_CHECKER(RSCIState, RSCI,
+ TYPE_RENESAS_SCI)
enum {
ERI = 0,
diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h
index dbeef43676..264f529a7f 100644
--- a/include/hw/char/serial.h
+++ b/include/hw/char/serial.h
@@ -104,13 +104,16 @@ extern const MemoryRegionOps serial_io_ops;
void serial_set_frequency(SerialState *s, uint32_t frequency);
#define TYPE_SERIAL "serial"
-#define SERIAL(s) OBJECT_CHECK(SerialState, (s), TYPE_SERIAL)
+DECLARE_INSTANCE_CHECKER(SerialState, SERIAL,
+ TYPE_SERIAL)
#define TYPE_SERIAL_MM "serial-mm"
-#define SERIAL_MM(s) OBJECT_CHECK(SerialMM, (s), TYPE_SERIAL_MM)
+DECLARE_INSTANCE_CHECKER(SerialMM, SERIAL_MM,
+ TYPE_SERIAL_MM)
#define TYPE_SERIAL_IO "serial-io"
-#define SERIAL_IO(s) OBJECT_CHECK(SerialIO, (s), TYPE_SERIAL_IO)
+DECLARE_INSTANCE_CHECKER(SerialIO, SERIAL_IO,
+ TYPE_SERIAL_IO)
SerialMM *serial_mm_init(MemoryRegion *address_space,
hwaddr base, int regshift,
diff --git a/include/hw/char/stm32f2xx_usart.h b/include/hw/char/stm32f2xx_usart.h
index c44faca751..1670c076d4 100644
--- a/include/hw/char/stm32f2xx_usart.h
+++ b/include/hw/char/stm32f2xx_usart.h
@@ -55,8 +55,8 @@
#define TYPE_STM32F2XX_USART "stm32f2xx-usart"
typedef struct STM32F2XXUsartState STM32F2XXUsartState;
-#define STM32F2XX_USART(obj) \
- OBJECT_CHECK(STM32F2XXUsartState, (obj), TYPE_STM32F2XX_USART)
+DECLARE_INSTANCE_CHECKER(STM32F2XXUsartState, STM32F2XX_USART,
+ TYPE_STM32F2XX_USART)
struct STM32F2XXUsartState {
/* <private> */