2 * QEMU MC146818 RTC emulation
4 * Copyright (c) 2003-2004 Fabrice Bellard
6 * SPDX-License-Identifier: MIT
9 #ifndef HW_RTC_MC146818RTC_H
10 #define HW_RTC_MC146818RTC_H
12 #include "qapi/qapi-types-machine.h"
13 #include "qemu/queue.h"
14 #include "qemu/timer.h"
15 #include "hw/isa/isa.h"
16 #include "qom/object.h"
18 #define TYPE_MC146818_RTC "mc146818rtc"
19 OBJECT_DECLARE_SIMPLE_TYPE(RTCState
, MC146818_RTC
)
25 MemoryRegion coalesced_io
;
26 uint8_t cmos_data
[128];
35 QEMUTimer
*periodic_timer
;
36 int64_t next_periodic_time
;
37 /* update-ended timer */
38 QEMUTimer
*update_timer
;
39 uint64_t next_alarm_time
;
40 uint16_t irq_reinject_on_ack_count
;
41 uint32_t irq_coalesced
;
43 QEMUTimer
*coalesced_timer
;
44 Notifier clock_reset_notifier
;
45 LostTickPolicy lost_tick_policy
;
46 Notifier suspend_notifier
;
47 QLIST_ENTRY(RTCState
) link
;
51 #define RTC_ISA_BASE 0x70
53 ISADevice
*mc146818_rtc_init(ISABus
*bus
, int base_year
,
54 qemu_irq intercept_irq
);
55 void rtc_set_memory(ISADevice
*dev
, int addr
, int val
);
56 int rtc_get_memory(ISADevice
*dev
, int addr
);
58 #endif /* MC146818RTC_H */