qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 04/29] rtc: qidl_declare RTCState


From: Michael Roth
Subject: [Qemu-devel] [PATCH 04/29] rtc: qidl_declare RTCState
Date: Thu, 1 Nov 2012 08:04:06 -0500

Signed-off-by: Michael Roth <address@hidden>
---
 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);
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]