diff options
author | Fabien Chouteau <chouteau@adacore.com> | 2011-11-03 16:10:04 +0100 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2011-11-19 11:22:57 +0000 |
commit | 96d922a654f4b5a806af43d6dc6fa7c1becbbac6 (patch) | |
tree | 93da28bba54254011b814dbb611b232e4bb7be2a /target-sparc/int32_helper.c | |
parent | 9643c25f8d67646857159d6fc021b07e7a659192 (diff) |
Improve "ta 0" shutdown
This patch replace the previous implementation with this simplified and
more complete version (no shutdown when psret == 1).
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-sparc/int32_helper.c')
-rw-r--r-- | target-sparc/int32_helper.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/target-sparc/int32_helper.c b/target-sparc/int32_helper.c index 3a749bf5df..ac9d01ecba 100644 --- a/target-sparc/int32_helper.c +++ b/target-sparc/int32_helper.c @@ -19,6 +19,7 @@ #include "cpu.h" #include "trace.h" +#include "sysemu.h" //#define DEBUG_PCALL @@ -100,8 +101,13 @@ void do_interrupt(CPUState *env) #endif #if !defined(CONFIG_USER_ONLY) if (env->psret == 0) { - cpu_abort(env, "Trap 0x%02x while interrupts disabled, Error state", - env->exception_index); + if (env->exception_index == 0x80 && + env->def->features & CPU_FEATURE_TA0_SHUTDOWN) { + qemu_system_shutdown_request(); + } else { + cpu_abort(env, "Trap 0x%02x while interrupts disabled, Error state", + env->exception_index); + } return; } #endif |