From c68ea7043f2ed4c631d1e3a4f35afe247d5ca063 Mon Sep 17 00:00:00 2001 From: bellard Date: Mon, 21 Nov 2005 23:33:12 +0000 Subject: cpu_single_env usage fix git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1644 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-sparc/op_helper.c | 4 ++-- target-sparc/translate.c | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'target-sparc') diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c index eaf5cb6..030b2f7 100644 --- a/target-sparc/op_helper.c +++ b/target-sparc/op_helper.c @@ -942,7 +942,7 @@ void do_interrupt(int intno) #endif #if !defined(CONFIG_USER_ONLY) if (env->tl == MAXTL) { - cpu_abort(cpu_single_env, "Trap 0x%04x while trap level is MAXTL, Error state", env->exception_index); + cpu_abort(env, "Trap 0x%04x while trap level is MAXTL, Error state", env->exception_index); return; } #endif @@ -996,7 +996,7 @@ void do_interrupt(int intno) #endif #if !defined(CONFIG_USER_ONLY) if (env->psret == 0) { - cpu_abort(cpu_single_env, "Trap 0x%02x while interrupts disabled, Error state", env->exception_index); + cpu_abort(env, "Trap 0x%02x while interrupts disabled, Error state", env->exception_index); return; } #endif diff --git a/target-sparc/translate.c b/target-sparc/translate.c index 6340e15..8a8620f 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -2672,11 +2672,10 @@ CPUSPARCState *cpu_sparc_init(void) { CPUSPARCState *env; - cpu_exec_init(); - - if (!(env = malloc(sizeof(CPUSPARCState)))) - return (NULL); - cpu_single_env = env; + env = qemu_mallocz(sizeof(CPUSPARCState)); + if (!env) + return NULL; + cpu_exec_init(env); cpu_reset(env); return (env); } -- cgit v1.1