From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qkhi1-00038o-Gk for qemu-devel@nongnu.org; Sat, 23 Jul 2011 15:17:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qkhhz-0004td-4K for qemu-devel@nongnu.org; Sat, 23 Jul 2011 15:17:57 -0400 Received: from mail-vx0-f173.google.com ([209.85.220.173]:38384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qkhhy-0004sI-QP for qemu-devel@nongnu.org; Sat, 23 Jul 2011 15:17:55 -0400 Received: by mail-vx0-f173.google.com with SMTP id 29so2635034vxi.4 for ; Sat, 23 Jul 2011 12:17:54 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Sat, 23 Jul 2011 12:17:38 -0700 Message-Id: <1311448659-17424-7-git-send-email-rth@twiddle.net> In-Reply-To: <1311448659-17424-1-git-send-email-rth@twiddle.net> References: <1311448659-17424-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 6/7] target-alpha: Implement HALT IPR. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Richard Henderson --- target-alpha/helper.h | 1 + target-alpha/op_helper.c | 10 ++++++++++ target-alpha/translate.c | 5 +++++ 3 files changed, 16 insertions(+), 0 deletions(-) diff --git a/target-alpha/helper.h b/target-alpha/helper.h index 2dec57e..c352c24 100644 --- a/target-alpha/helper.h +++ b/target-alpha/helper.h @@ -113,6 +113,7 @@ DEF_HELPER_2(stq_c_phys, i64, i64, i64) DEF_HELPER_FLAGS_0(tbia, TCG_CALL_CONST, void) DEF_HELPER_FLAGS_1(tbis, TCG_CALL_CONST, void, i64) +DEF_HELPER_1(halt, void, i64); #endif #include "def-helper.h" diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c index 8f39154..ad85e4c 100644 --- a/target-alpha/op_helper.c +++ b/target-alpha/op_helper.c @@ -21,6 +21,7 @@ #include "host-utils.h" #include "softfloat.h" #include "helper.h" +#include "sysemu.h" #include "qemu-timer.h" /*****************************************************************************/ @@ -1215,6 +1216,15 @@ void helper_tbis(uint64_t p) { tlb_flush_page(env, p); } + +void helper_halt(uint64_t restart) +{ + if (restart) { + qemu_system_reset_request(); + } else { + qemu_system_shutdown_request(); + } +} #endif /*****************************************************************************/ diff --git a/target-alpha/translate.c b/target-alpha/translate.c index fddaff8..b1609e3 100644 --- a/target-alpha/translate.c +++ b/target-alpha/translate.c @@ -1645,6 +1645,11 @@ static ExitStatus gen_mtpr(DisasContext *ctx, int rb, int regno) tcg_gen_st32_i64(tmp, cpu_env, offsetof(CPUState, halted)); return gen_excp(ctx, EXCP_HLT, 0); + case 252: + /* HALT */ + gen_helper_halt(tmp); + return EXIT_PC_STALE; + default: /* The basic registers are data only, and unknown registers are read-zero, write-ignore. */ -- 1.7.4.4