aboutsummaryrefslogtreecommitdiffstats
path: root/hw/hpet_emul.h
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-02-01 20:31:41 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-02-17 09:58:22 -0600
commitce967e2f33861b0e17753f97fa4527b5943c94b6 (patch)
tree3f5c160e2b43162aa2dfda85eeb4813f20ebade4 /hw/hpet_emul.h
parent319ba9f52737fc79de5c2c6abd059933398b72d5 (diff)
i8254: Rework & fix interaction with HPET in legacy mode
When the HPET enters legacy mode, the IRQ output of the PIT is suppressed and replaced by the HPET timer 0. But the current code to emulate this was broken in many ways. It reset the PIT state after re-enabling, it worked against a stale static PIT structure, and it did not properly saved/restored the IRQ output mask in the PIT vmstate. This patch solves the PIT IRQ control in a different way. On x86, it both redirects the PIT IRQ to the HPET, just like the RTC. But it also keeps the control line from the HPET to the PIT. This allows to disable the PIT QEMU timer when it is not needed. The PIT's view on the control line state is now saved in the same format that qemu-kvm is already using. Note that, in contrast to the suppressed RTC IRQ line, we do not need to save/restore the PIT line state in the HPET. As we trigger a PIT IRQ update via the control line, the line state is reconstructed on mode switch. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/hpet_emul.h')
-rw-r--r--hw/hpet_emul.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/hpet_emul.h b/hw/hpet_emul.h
index 612870253..757f79fdd 100644
--- a/hw/hpet_emul.h
+++ b/hw/hpet_emul.h
@@ -22,6 +22,9 @@
#define HPET_NUM_IRQ_ROUTES 32
+#define HPET_LEGACY_PIT_INT 0
+#define HPET_LEGACY_RTC_INT 1
+
#define HPET_CFG_ENABLE 0x001
#define HPET_CFG_LEGACY 0x002