[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V2 2/7] hpet: Save/restore cached RTC IRQ level
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH V2 2/7] hpet: Save/restore cached RTC IRQ level |
Date: |
Thu, 19 Jan 2012 00:08:57 +0100 |
From: Jan Kiszka <address@hidden>
In legacy mode, the HPET suppresses the RTC interrupt delivery via IRQ
8 but keeps track of the RTC output level and applies it when legacy
mode is turned off again. This value has to be preserved across save/
restore as it cannot be reconstructed otherwise.
Signed-off-by: Jan Kiszka <address@hidden>
---
hw/hpet.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/hw/hpet.c b/hw/hpet.c
index 5312df7..1b64e6a 100644
--- a/hw/hpet.c
+++ b/hw/hpet.c
@@ -240,6 +240,24 @@ static int hpet_post_load(void *opaque, int version_id)
return 0;
}
+static bool hpet_rtc_irq_level_needed(void *opaque)
+{
+ HPETState *s = opaque;
+
+ return s->rtc_irq_level != 0;
+}
+
+static const VMStateDescription vmstate_hpet_rtc_irq_level = {
+ .name = "hpet/rtc_irq_level",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .minimum_version_id_old = 1,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT8(rtc_irq_level, HPETState),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static const VMStateDescription vmstate_hpet_timer = {
.name = "hpet_timer",
.version_id = 1,
@@ -273,6 +291,14 @@ static const VMStateDescription vmstate_hpet = {
VMSTATE_STRUCT_VARRAY_UINT8(timer, HPETState, num_timers, 0,
vmstate_hpet_timer, HPETTimer),
VMSTATE_END_OF_LIST()
+ },
+ .subsections = (VMStateSubsection[]) {
+ {
+ .vmsd = &vmstate_hpet_rtc_irq_level,
+ .needed = hpet_rtc_irq_level_needed,
+ }, {
+ /* empty */
+ }
}
};
--
1.7.3.4
- [Qemu-devel] [PATCH V2 0/7] pit, hpet, pcspk: fixes & preparation for KVM, Jan Kiszka, 2012/01/18
- [Qemu-devel] [PATCH V2 6/7] pcspk: Convert to qdev, Jan Kiszka, 2012/01/18
- [Qemu-devel] [PATCH V2 1/7] i8254: Do not raise IRQ level on reset, Jan Kiszka, 2012/01/18
- [Qemu-devel] [PATCH V2 3/7] i8254: Factor out interface header, Jan Kiszka, 2012/01/18
- [Qemu-devel] [PATCH V2 2/7] hpet: Save/restore cached RTC IRQ level,
Jan Kiszka <=
- [Qemu-devel] [PATCH V2 4/7] i8254: Pass irq output object on initialization, Jan Kiszka, 2012/01/18
- [Qemu-devel] [PATCH V2 5/7] i8254: Rework & fix interaction with HPET in legacy mode, Jan Kiszka, 2012/01/18
- [Qemu-devel] [PATCH V2 7/7] i8254: Factor out pit_get_channel_info, Jan Kiszka, 2012/01/18