aboutsummaryrefslogtreecommitdiff
path: root/include/hw/timer
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-08-31 17:07:33 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-09 09:27:09 -0400
commit8110fa1d94f2997badc2af39231a1d279c5bb1ee (patch)
tree6bff28c7907dfb0cbb367ca113f4d02ea03f3a51 /include/hw/timer
parentdb1015e92e04835c9eb50c29625fe566d1202dbd (diff)
downloadqemu-8110fa1d94f2997badc2af39231a1d279c5bb1ee.zip
qemu-8110fa1d94f2997badc2af39231a1d279c5bb1ee.tar.gz
qemu-8110fa1d94f2997badc2af39231a1d279c5bb1ee.tar.bz2
Use DECLARE_*CHECKER* macros
Generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]') Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-12-ehabkost@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-13-ehabkost@redhat.com> Message-Id: <20200831210740.126168-14-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/hw/timer')
-rw-r--r--include/hw/timer/a9gtimer.h3
-rw-r--r--include/hw/timer/allwinner-a10-pit.h3
-rw-r--r--include/hw/timer/arm_mptimer.h4
-rw-r--r--include/hw/timer/armv7m_systick.h3
-rw-r--r--include/hw/timer/aspeed_timer.h8
-rw-r--r--include/hw/timer/avr_timer16.h4
-rw-r--r--include/hw/timer/bcm2835_systmr.h4
-rw-r--r--include/hw/timer/cmsdk-apb-dualtimer.h4
-rw-r--r--include/hw/timer/cmsdk-apb-timer.h4
-rw-r--r--include/hw/timer/digic-timer.h3
-rw-r--r--include/hw/timer/i8254.h8
-rw-r--r--include/hw/timer/imx_epit.h3
-rw-r--r--include/hw/timer/imx_gpt.h3
-rw-r--r--include/hw/timer/mss-timer.h4
-rw-r--r--include/hw/timer/nrf51_timer.h3
-rw-r--r--include/hw/timer/renesas_cmt.h3
-rw-r--r--include/hw/timer/renesas_tmr.h3
-rw-r--r--include/hw/timer/stm32f2xx_timer.h4
18 files changed, 36 insertions, 35 deletions
diff --git a/include/hw/timer/a9gtimer.h b/include/hw/timer/a9gtimer.h
index 88811c6..f6fcc4b 100644
--- a/include/hw/timer/a9gtimer.h
+++ b/include/hw/timer/a9gtimer.h
@@ -30,7 +30,8 @@
#define TYPE_A9_GTIMER "arm.cortex-a9-global-timer"
typedef struct A9GTimerState A9GTimerState;
-#define A9_GTIMER(obj) OBJECT_CHECK(A9GTimerState, (obj), TYPE_A9_GTIMER)
+DECLARE_INSTANCE_CHECKER(A9GTimerState, A9_GTIMER,
+ TYPE_A9_GTIMER)
#define R_COUNTER_LO 0x00
#define R_COUNTER_HI 0x04
diff --git a/include/hw/timer/allwinner-a10-pit.h b/include/hw/timer/allwinner-a10-pit.h
index fa060c6..9638e3c 100644
--- a/include/hw/timer/allwinner-a10-pit.h
+++ b/include/hw/timer/allwinner-a10-pit.h
@@ -7,7 +7,8 @@
#define TYPE_AW_A10_PIT "allwinner-A10-timer"
typedef struct AwA10PITState AwA10PITState;
-#define AW_A10_PIT(obj) OBJECT_CHECK(AwA10PITState, (obj), TYPE_AW_A10_PIT)
+DECLARE_INSTANCE_CHECKER(AwA10PITState, AW_A10_PIT,
+ TYPE_AW_A10_PIT)
#define AW_A10_PIT_TIMER_NR 6
#define AW_A10_PIT_TIMER_IRQ 0x1
diff --git a/include/hw/timer/arm_mptimer.h b/include/hw/timer/arm_mptimer.h
index 643a256..47d5e51 100644
--- a/include/hw/timer/arm_mptimer.h
+++ b/include/hw/timer/arm_mptimer.h
@@ -37,8 +37,8 @@ typedef struct {
#define TYPE_ARM_MPTIMER "arm_mptimer"
typedef struct ARMMPTimerState ARMMPTimerState;
-#define ARM_MPTIMER(obj) \
- OBJECT_CHECK(ARMMPTimerState, (obj), TYPE_ARM_MPTIMER)
+DECLARE_INSTANCE_CHECKER(ARMMPTimerState, ARM_MPTIMER,
+ TYPE_ARM_MPTIMER)
struct ARMMPTimerState {
/*< private >*/
diff --git a/include/hw/timer/armv7m_systick.h b/include/hw/timer/armv7m_systick.h
index 33df057..b605688 100644
--- a/include/hw/timer/armv7m_systick.h
+++ b/include/hw/timer/armv7m_systick.h
@@ -18,7 +18,8 @@
#define TYPE_SYSTICK "armv7m_systick"
typedef struct SysTickState SysTickState;
-#define SYSTICK(obj) OBJECT_CHECK(SysTickState, (obj), TYPE_SYSTICK)
+DECLARE_INSTANCE_CHECKER(SysTickState, SYSTICK,
+ TYPE_SYSTICK)
struct SysTickState {
/*< private >*/
diff --git a/include/hw/timer/aspeed_timer.h b/include/hw/timer/aspeed_timer.h
index c890aaa..4c76f95 100644
--- a/include/hw/timer/aspeed_timer.h
+++ b/include/hw/timer/aspeed_timer.h
@@ -29,8 +29,8 @@
#define TYPE_ASPEED_TIMER "aspeed.timer"
typedef struct AspeedTimerClass AspeedTimerClass;
typedef struct AspeedTimerCtrlState AspeedTimerCtrlState;
-#define ASPEED_TIMER(obj) \
- OBJECT_CHECK(AspeedTimerCtrlState, (obj), TYPE_ASPEED_TIMER)
+DECLARE_OBJ_CHECKERS(AspeedTimerCtrlState, AspeedTimerClass,
+ ASPEED_TIMER, TYPE_ASPEED_TIMER)
#define TYPE_ASPEED_2400_TIMER TYPE_ASPEED_TIMER "-ast2400"
#define TYPE_ASPEED_2500_TIMER TYPE_ASPEED_TIMER "-ast2500"
#define TYPE_ASPEED_2600_TIMER TYPE_ASPEED_TIMER "-ast2600"
@@ -69,10 +69,6 @@ struct AspeedTimerCtrlState {
AspeedSCUState *scu;
};
-#define ASPEED_TIMER_CLASS(klass) \
- OBJECT_CLASS_CHECK(AspeedTimerClass, (klass), TYPE_ASPEED_TIMER)
-#define ASPEED_TIMER_GET_CLASS(obj) \
- OBJECT_GET_CLASS(AspeedTimerClass, (obj), TYPE_ASPEED_TIMER)
struct AspeedTimerClass {
SysBusDeviceClass parent_class;
diff --git a/include/hw/timer/avr_timer16.h b/include/hw/timer/avr_timer16.h
index 9efe75c..d454bb3 100644
--- a/include/hw/timer/avr_timer16.h
+++ b/include/hw/timer/avr_timer16.h
@@ -43,8 +43,8 @@ enum NextInterrupt {
#define TYPE_AVR_TIMER16 "avr-timer16"
typedef struct AVRTimer16State AVRTimer16State;
-#define AVR_TIMER16(obj) \
- OBJECT_CHECK(AVRTimer16State, (obj), TYPE_AVR_TIMER16)
+DECLARE_INSTANCE_CHECKER(AVRTimer16State, AVR_TIMER16,
+ TYPE_AVR_TIMER16)
struct AVRTimer16State {
/* <private> */
diff --git a/include/hw/timer/bcm2835_systmr.h b/include/hw/timer/bcm2835_systmr.h
index 796f62c..64166bd 100644
--- a/include/hw/timer/bcm2835_systmr.h
+++ b/include/hw/timer/bcm2835_systmr.h
@@ -15,8 +15,8 @@
#define TYPE_BCM2835_SYSTIMER "bcm2835-sys-timer"
typedef struct BCM2835SystemTimerState BCM2835SystemTimerState;
-#define BCM2835_SYSTIMER(obj) \
- OBJECT_CHECK(BCM2835SystemTimerState, (obj), TYPE_BCM2835_SYSTIMER)
+DECLARE_INSTANCE_CHECKER(BCM2835SystemTimerState, BCM2835_SYSTIMER,
+ TYPE_BCM2835_SYSTIMER)
struct BCM2835SystemTimerState {
/*< private >*/
diff --git a/include/hw/timer/cmsdk-apb-dualtimer.h b/include/hw/timer/cmsdk-apb-dualtimer.h
index 8a1137a..7a5b9df 100644
--- a/include/hw/timer/cmsdk-apb-dualtimer.h
+++ b/include/hw/timer/cmsdk-apb-dualtimer.h
@@ -32,8 +32,8 @@
#define TYPE_CMSDK_APB_DUALTIMER "cmsdk-apb-dualtimer"
typedef struct CMSDKAPBDualTimer CMSDKAPBDualTimer;
-#define CMSDK_APB_DUALTIMER(obj) OBJECT_CHECK(CMSDKAPBDualTimer, (obj), \
- TYPE_CMSDK_APB_DUALTIMER)
+DECLARE_INSTANCE_CHECKER(CMSDKAPBDualTimer, CMSDK_APB_DUALTIMER,
+ TYPE_CMSDK_APB_DUALTIMER)
/* One of the two identical timer modules in the dual-timer module */
diff --git a/include/hw/timer/cmsdk-apb-timer.h b/include/hw/timer/cmsdk-apb-timer.h
index a7ca523..0912bc0 100644
--- a/include/hw/timer/cmsdk-apb-timer.h
+++ b/include/hw/timer/cmsdk-apb-timer.h
@@ -19,8 +19,8 @@
#define TYPE_CMSDK_APB_TIMER "cmsdk-apb-timer"
typedef struct CMSDKAPBTIMER CMSDKAPBTIMER;
-#define CMSDK_APB_TIMER(obj) OBJECT_CHECK(CMSDKAPBTIMER, (obj), \
- TYPE_CMSDK_APB_TIMER)
+DECLARE_INSTANCE_CHECKER(CMSDKAPBTIMER, CMSDK_APB_TIMER,
+ TYPE_CMSDK_APB_TIMER)
struct CMSDKAPBTIMER {
/*< private >*/
diff --git a/include/hw/timer/digic-timer.h b/include/hw/timer/digic-timer.h
index 543bf8c..84a0ef4 100644
--- a/include/hw/timer/digic-timer.h
+++ b/include/hw/timer/digic-timer.h
@@ -24,7 +24,8 @@
#define TYPE_DIGIC_TIMER "digic-timer"
typedef struct DigicTimerState DigicTimerState;
-#define DIGIC_TIMER(obj) OBJECT_CHECK(DigicTimerState, (obj), TYPE_DIGIC_TIMER)
+DECLARE_INSTANCE_CHECKER(DigicTimerState, DIGIC_TIMER,
+ TYPE_DIGIC_TIMER)
#define DIGIC_TIMER_CONTROL 0x00
#define DIGIC_TIMER_CONTROL_RST 0x80000000
diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h
index 6adbc31..1a522a2 100644
--- a/include/hw/timer/i8254.h
+++ b/include/hw/timer/i8254.h
@@ -42,12 +42,8 @@ typedef struct PITChannelInfo {
#define TYPE_PIT_COMMON "pit-common"
typedef struct PITCommonState PITCommonState;
typedef struct PITCommonClass PITCommonClass;
-#define PIT_COMMON(obj) \
- OBJECT_CHECK(PITCommonState, (obj), TYPE_PIT_COMMON)
-#define PIT_COMMON_CLASS(klass) \
- OBJECT_CLASS_CHECK(PITCommonClass, (klass), TYPE_PIT_COMMON)
-#define PIT_COMMON_GET_CLASS(obj) \
- OBJECT_GET_CLASS(PITCommonClass, (obj), TYPE_PIT_COMMON)
+DECLARE_OBJ_CHECKERS(PITCommonState, PITCommonClass,
+ PIT_COMMON, TYPE_PIT_COMMON)
#define TYPE_I8254 "isa-pit"
#define TYPE_KVM_I8254 "kvm-pit"
diff --git a/include/hw/timer/imx_epit.h b/include/hw/timer/imx_epit.h
index 1ca110c..39bcf81 100644
--- a/include/hw/timer/imx_epit.h
+++ b/include/hw/timer/imx_epit.h
@@ -57,7 +57,8 @@
#define TYPE_IMX_EPIT "imx.epit"
typedef struct IMXEPITState IMXEPITState;
-#define IMX_EPIT(obj) OBJECT_CHECK(IMXEPITState, (obj), TYPE_IMX_EPIT)
+DECLARE_INSTANCE_CHECKER(IMXEPITState, IMX_EPIT,
+ TYPE_IMX_EPIT)
struct IMXEPITState {
/*< private >*/
diff --git a/include/hw/timer/imx_gpt.h b/include/hw/timer/imx_gpt.h
index b96633d..ff5c8a3 100644
--- a/include/hw/timer/imx_gpt.h
+++ b/include/hw/timer/imx_gpt.h
@@ -83,7 +83,8 @@
#define TYPE_IMX_GPT TYPE_IMX25_GPT
typedef struct IMXGPTState IMXGPTState;
-#define IMX_GPT(obj) OBJECT_CHECK(IMXGPTState, (obj), TYPE_IMX_GPT)
+DECLARE_INSTANCE_CHECKER(IMXGPTState, IMX_GPT,
+ TYPE_IMX_GPT)
struct IMXGPTState {
/*< private >*/
diff --git a/include/hw/timer/mss-timer.h b/include/hw/timer/mss-timer.h
index 011c5f1..d207bae 100644
--- a/include/hw/timer/mss-timer.h
+++ b/include/hw/timer/mss-timer.h
@@ -31,8 +31,8 @@
#define TYPE_MSS_TIMER "mss-timer"
typedef struct MSSTimerState MSSTimerState;
-#define MSS_TIMER(obj) OBJECT_CHECK(MSSTimerState, \
- (obj), TYPE_MSS_TIMER)
+DECLARE_INSTANCE_CHECKER(MSSTimerState, MSS_TIMER,
+ TYPE_MSS_TIMER)
/*
* There are two 32-bit down counting timers.
diff --git a/include/hw/timer/nrf51_timer.h b/include/hw/timer/nrf51_timer.h
index b4eb29b..4261a03 100644
--- a/include/hw/timer/nrf51_timer.h
+++ b/include/hw/timer/nrf51_timer.h
@@ -18,7 +18,8 @@
#include "qom/object.h"
#define TYPE_NRF51_TIMER "nrf51_soc.timer"
typedef struct NRF51TimerState NRF51TimerState;
-#define NRF51_TIMER(obj) OBJECT_CHECK(NRF51TimerState, (obj), TYPE_NRF51_TIMER)
+DECLARE_INSTANCE_CHECKER(NRF51TimerState, NRF51_TIMER,
+ TYPE_NRF51_TIMER)
#define NRF51_TIMER_REG_COUNT 4
diff --git a/include/hw/timer/renesas_cmt.h b/include/hw/timer/renesas_cmt.h
index 313f9e1..1c0b65c 100644
--- a/include/hw/timer/renesas_cmt.h
+++ b/include/hw/timer/renesas_cmt.h
@@ -15,7 +15,8 @@
#define TYPE_RENESAS_CMT "renesas-cmt"
typedef struct RCMTState RCMTState;
-#define RCMT(obj) OBJECT_CHECK(RCMTState, (obj), TYPE_RENESAS_CMT)
+DECLARE_INSTANCE_CHECKER(RCMTState, RCMT,
+ TYPE_RENESAS_CMT)
enum {
CMT_CH = 2,
diff --git a/include/hw/timer/renesas_tmr.h b/include/hw/timer/renesas_tmr.h
index e2abcb1..caf7eec 100644
--- a/include/hw/timer/renesas_tmr.h
+++ b/include/hw/timer/renesas_tmr.h
@@ -15,7 +15,8 @@
#define TYPE_RENESAS_TMR "renesas-tmr"
typedef struct RTMRState RTMRState;
-#define RTMR(obj) OBJECT_CHECK(RTMRState, (obj), TYPE_RENESAS_TMR)
+DECLARE_INSTANCE_CHECKER(RTMRState, RTMR,
+ TYPE_RENESAS_TMR)
enum timer_event {
cmia = 0,
diff --git a/include/hw/timer/stm32f2xx_timer.h b/include/hw/timer/stm32f2xx_timer.h
index 9eb9201..90f40f1 100644
--- a/include/hw/timer/stm32f2xx_timer.h
+++ b/include/hw/timer/stm32f2xx_timer.h
@@ -63,8 +63,8 @@
#define TYPE_STM32F2XX_TIMER "stm32f2xx-timer"
typedef struct STM32F2XXTimerState STM32F2XXTimerState;
-#define STM32F2XXTIMER(obj) OBJECT_CHECK(STM32F2XXTimerState, \
- (obj), TYPE_STM32F2XX_TIMER)
+DECLARE_INSTANCE_CHECKER(STM32F2XXTimerState, STM32F2XXTIMER,
+ TYPE_STM32F2XX_TIMER)
struct STM32F2XXTimerState {
/* <private> */