From patchwork Thu Nov 1 13:04:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [04/29] rtc: qidl_declare RTCState Date: Thu, 01 Nov 2012 03:04:06 -0000 From: Michael Roth X-Patchwork-Id: 196226 Message-Id: <1351775071-7644-5-git-send-email-mdroth@linux.vnet.ibm.com> To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@us.ibm.com, quintela@redhat.com, blauwirbel@gmail.com, pbonzini@redhat.com Signed-off-by: Michael Roth --- hw/mc146818rtc.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c index 98839f2..8983d26 100644 --- a/hw/mc146818rtc.c +++ b/hw/mc146818rtc.c @@ -25,6 +25,7 @@ #include "qemu-timer.h" #include "sysemu.h" #include "mc146818rtc.h" +#include "qidl.h" #ifdef TARGET_I386 #include "apic.h" @@ -56,12 +57,14 @@ #define RTC_CLOCK_RATE 32768 #define UIP_HOLD_LENGTH (8 * NSEC_PER_SEC / 32768) -typedef struct RTCState { +typedef struct RTCState RTCState; + +QIDL_DECLARE(RTCState) { ISADevice dev; MemoryRegion io; uint8_t cmos_data[128]; uint8_t cmos_index; - int32_t base_year; + int32_t q_property("base_year", 1980) base_year; uint64_t base_rtc; uint64_t last_update; int64_t offset; @@ -77,11 +80,13 @@ typedef struct RTCState { uint16_t irq_reinject_on_ack_count; uint32_t irq_coalesced; uint32_t period; - QEMUTimer *coalesced_timer; + bool has_coalesced_timer; + QEMUTimer q_optional *coalesced_timer; Notifier clock_reset_notifier; - LostTickPolicy lost_tick_policy; + LostTickPolicy q_property("lost_tick_policy", LOST_TICK_DISCARD) \ + lost_tick_policy; Notifier suspend_notifier; -} RTCState; +}; static void rtc_set_time(RTCState *s); static void rtc_update_time(RTCState *s);