[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/39] mc146818rtc: move structure to header file
From: |
Paolo Bonzini |
Subject: |
[PULL 31/39] mc146818rtc: move structure to header file |
Date: |
Thu, 24 Oct 2019 16:03:47 +0200 |
From: Hervé Poussineau <address@hidden>
We are now able to embed a timer in another object.
Acked-by: Michael S. Tsirkin <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Signed-off-by: Hervé Poussineau <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Aleksandar Markovic <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/timer/mc146818rtc.c | 30 ------------------------------
include/hw/timer/mc146818rtc.h | 33 +++++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 30 deletions(-)
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index c979db0..09edb93 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -71,36 +71,6 @@
#define RTC_CLOCK_RATE 32768
#define UIP_HOLD_LENGTH (8 * NANOSECONDS_PER_SECOND / 32768)
-#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;
- LostTickPolicy lost_tick_policy;
- Notifier suspend_notifier;
- QLIST_ENTRY(RTCState) link;
-} RTCState;
-
static void rtc_set_time(RTCState *s);
static void rtc_update_time(RTCState *s);
static void rtc_set_cmos(RTCState *s, const struct tm *tm);
diff --git a/include/hw/timer/mc146818rtc.h b/include/hw/timer/mc146818rtc.h
index fe6ed63..0f1c886 100644
--- a/include/hw/timer/mc146818rtc.h
+++ b/include/hw/timer/mc146818rtc.h
@@ -1,10 +1,43 @@
#ifndef MC146818RTC_H
#define MC146818RTC_H
+#include "qapi/qapi-types-misc.h"
+#include "qemu/queue.h"
+#include "qemu/timer.h"
#include "hw/isa/isa.h"
#include "hw/timer/mc146818rtc_regs.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;
ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
qemu_irq intercept_irq);
--
1.8.3.1
- [PULL 22/39] checkpatch: suggest qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE), (continued)
- [PULL 22/39] checkpatch: suggest qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE), Paolo Bonzini, 2019/10/24
- [PULL 14/39] hw/i386: split PCMachineState deriving X86MachineState from it, Paolo Bonzini, 2019/10/24
- [PULL 26/39] target/i386: Add support for save/load IA32_UMWAIT_CONTROL MSR, Paolo Bonzini, 2019/10/24
- [PULL 30/39] hw/i386/pc: Remove kvm_i386.h include, Paolo Bonzini, 2019/10/24
- [PULL 32/39] mc146818rtc: Move RTC_ISA_IRQ definition, Paolo Bonzini, 2019/10/24
- [PULL 25/39] x86/cpu: Add support for UMONITOR/UMWAIT/TPAUSE, Paolo Bonzini, 2019/10/24
- [PULL 29/39] hw/i386/pc: Extract pc_i8259_create(), Paolo Bonzini, 2019/10/24
- [PULL 33/39] mc146818rtc: Include mc146818rtc_regs.h directly in mc146818rtc.c, Paolo Bonzini, 2019/10/24
- [PULL 13/39] hw/i386/pc: move shared x86 functions to x86.c and export them, Paolo Bonzini, 2019/10/24
- [PULL 27/39] hw/i386/pc: Extract pc_gsi_create(), Paolo Bonzini, 2019/10/24
- [PULL 31/39] mc146818rtc: move structure to header file,
Paolo Bonzini <=
- [PULL 35/39] audio: fix missing break, Paolo Bonzini, 2019/10/24
- [PULL 38/39] target/i386: introduce cpu_set_fpus, Paolo Bonzini, 2019/10/24
- [PULL 37/39] target/i386: move FERR handling to target/i386, Paolo Bonzini, 2019/10/24
- [PULL 34/39] mc146818rtc: always register rtc to rtc list, Paolo Bonzini, 2019/10/24
- [PULL 39/39] i386: implement IGNNE, Paolo Bonzini, 2019/10/24
- [PULL 36/39] core: replace getpagesize() with qemu_real_host_page_size, Paolo Bonzini, 2019/10/24
- Re: [PULL 00/39] Misc (mostly x86) patches for 2019-10-24, no-reply, 2019/10/25
- Re: [PULL 00/39] Misc (mostly x86) patches for 2019-10-24, Peter Maydell, 2019/10/25