aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-10-31 02:41:11 +0100
committerAndreas Färber <afaerber@suse.de>2012-12-19 01:01:36 +0100
commitc92458538f501eda585b4b774c50644aed391a8a (patch)
treef808d560f27889dbb807be4598056f55425ad18d /hw
parentad6011775a324d7c3e2a8bd824e03c5e576dda48 (diff)
downloadqemu-c92458538f501eda585b4b774c50644aed391a8a.zip
qemu-c92458538f501eda585b4b774c50644aed391a8a.tar.gz
qemu-c92458538f501eda585b4b774c50644aed391a8a.tar.bz2
target-alpha: Avoid leaking the alarm timer over reset
Move the timer from CPUAlphaState to AlphaCPU to avoid the pointer being zero'ed once we implement reset. Would cause a segfault in sys_helper.c:helper_set_alarm(). This also simplifies timer initialization in Typhoon. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'hw')
-rw-r--r--hw/alpha_typhoon.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/alpha_typhoon.c b/hw/alpha_typhoon.c
index 4cc810f..40b3a47 100644
--- a/hw/alpha_typhoon.c
+++ b/hw/alpha_typhoon.c
@@ -724,8 +724,7 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus,
AlphaCPU *cpu = cpus[i];
s->cchip.cpu[i] = cpu;
if (cpu != NULL) {
- CPUAlphaState *env = &cpu->env;
- env->alarm_timer = qemu_new_timer_ns(rtc_clock,
+ cpu->alarm_timer = qemu_new_timer_ns(rtc_clock,
typhoon_alarm_timer,
(void *)((uintptr_t)s + i));
}