diff options
author | Andreas Färber <afaerber@suse.de> | 2012-10-31 02:41:11 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-12-19 01:01:36 +0100 |
commit | c92458538f501eda585b4b774c50644aed391a8a (patch) | |
tree | f808d560f27889dbb807be4598056f55425ad18d /target-alpha/sys_helper.c | |
parent | ad6011775a324d7c3e2a8bd824e03c5e576dda48 (diff) |
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 'target-alpha/sys_helper.c')
-rw-r--r-- | target-alpha/sys_helper.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/target-alpha/sys_helper.c b/target-alpha/sys_helper.c index 40ca49c883..d4f14efd86 100644 --- a/target-alpha/sys_helper.c +++ b/target-alpha/sys_helper.c @@ -77,11 +77,13 @@ uint64_t helper_get_time(void) void helper_set_alarm(CPUAlphaState *env, uint64_t expire) { + AlphaCPU *cpu = alpha_env_get_cpu(env); + if (expire) { env->alarm_expire = expire; - qemu_mod_timer(env->alarm_timer, expire); + qemu_mod_timer(cpu->alarm_timer, expire); } else { - qemu_del_timer(env->alarm_timer); + qemu_del_timer(cpu->alarm_timer); } } #endif /* CONFIG_USER_ONLY */ |