aboutsummaryrefslogtreecommitdiff
path: root/hw/i8254.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-02-01 20:31:37 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-02-17 09:58:22 -0600
commit61b7b67df2ed10ff5ab0dcc649080bca782fdc5e (patch)
treea51bdd4ec52cccf3f347073f9a6b1252ea45047e /hw/i8254.c
parent7dfbfc7927c1f7ab9f6910768ed6d966645b5866 (diff)
downloadqemu-61b7b67df2ed10ff5ab0dcc649080bca782fdc5e.zip
qemu-61b7b67df2ed10ff5ab0dcc649080bca782fdc5e.tar.gz
qemu-61b7b67df2ed10ff5ab0dcc649080bca782fdc5e.tar.bz2
i8254: Do not raise IRQ level on reset
Avoid changing the IRQ level to high on reset as it may trigger spurious events. Instead, open-code the effects of pit_load_count(0) in the reset handler. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/i8254.c')
-rw-r--r--hw/i8254.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/i8254.c b/hw/i8254.c
index 481fc7b..d55b221 100644
--- a/hw/i8254.c
+++ b/hw/i8254.c
@@ -481,7 +481,13 @@ static void pit_reset(DeviceState *dev)
s = &pit->channels[i];
s->mode = 3;
s->gate = (i != 2);
- pit_load_count(s, 0);
+ s->count_load_time = qemu_get_clock_ns(vm_clock);
+ s->count = 0x10000;
+ if (i == 0) {
+ s->next_transition_time =
+ pit_get_next_transition_time(s, s->count_load_time);
+ qemu_mod_timer(s->irq_timer, s->next_transition_time);
+ }
}
}