summaryrefslogtreecommitdiffstats
path: root/include/hw/rtc
diff options
context:
space:
mode:
authorPaolo Bonzini2019-10-26 15:36:22 +0200
committerPaolo Bonzini2019-10-26 15:38:02 +0200
commit673652a785efb5f7da342b49c80a1abf033c82a7 (patch)
tree2f277cce43b50e85cca36d7354ba2dd7ffd14d41 /include/hw/rtc
parentMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ... (diff)
parentmc146818rtc: always register rtc to rtc list (diff)
downloadqemu-673652a785efb5f7da342b49c80a1abf033c82a7.tar.gz
qemu-673652a785efb5f7da342b49c80a1abf033c82a7.tar.xz
qemu-673652a785efb5f7da342b49c80a1abf033c82a7.zip
Merge commit 'df84f17' into HEAD
This merge fixes a semantic conflict with the trivial tree. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/hw/rtc')
-rw-r--r--include/hw/rtc/mc146818rtc.h35
-rw-r--r--include/hw/rtc/mc146818rtc_regs.h2
2 files changed, 35 insertions, 2 deletions
diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h
index 7fa59d4279..10c93a096a 100644
--- a/include/hw/rtc/mc146818rtc.h
+++ b/include/hw/rtc/mc146818rtc.h
@@ -9,9 +9,44 @@
#ifndef HW_RTC_MC146818RTC_H
#define HW_RTC_MC146818RTC_H
+#include "qapi/qapi-types-misc.h"
+#include "qemu/queue.h"
+#include "qemu/timer.h"
#include "hw/isa/isa.h"
#define TYPE_MC146818_RTC "mc146818rtc"
+#define MC146818_RTC(obj) OBJECT_CHECK(RTCState, (obj), TYPE_MC146818_RTC)
+
+typedef struct RTCState {
+ ISADevice parent_obj;
+
+ MemoryRegion io;
+ MemoryRegion coalesced_io;
+ uint8_t cmos_data[128];
+ uint8_t cmos_index;
+ int32_t base_year;
+ uint64_t base_rtc;
+ uint64_t last_update;
+ int64_t offset;
+ qemu_irq irq;
+ int it_shift;
+ /* periodic timer */
+ QEMUTimer *periodic_timer;
+ int64_t next_periodic_time;
+ /* update-ended timer */
+ QEMUTimer *update_timer;
+ uint64_t next_alarm_time;
+ uint16_t irq_reinject_on_ack_count;
+ uint32_t irq_coalesced;
+ uint32_t period;
+ QEMUTimer *coalesced_timer;
+ Notifier clock_reset_notifier;
+ LostTickPolicy lost_tick_policy;
+ Notifier suspend_notifier;
+ QLIST_ENTRY(RTCState) link;
+} RTCState;
+
+#define RTC_ISA_IRQ 8
ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
qemu_irq intercept_irq);
diff --git a/include/hw/rtc/mc146818rtc_regs.h b/include/hw/rtc/mc146818rtc_regs.h
index dd6c09e2fc..12197e0553 100644
--- a/include/hw/rtc/mc146818rtc_regs.h
+++ b/include/hw/rtc/mc146818rtc_regs.h
@@ -28,8 +28,6 @@
#include "qemu/timer.h"
#include "qemu/host-utils.h"
-#define RTC_ISA_IRQ 8
-
#define RTC_SECONDS 0
#define RTC_SECONDS_ALARM 1
#define RTC_MINUTES 2