From patchwork Thu Sep 22 15:30:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 115958 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 47CC0B6F85 for ; Fri, 23 Sep 2011 01:32:15 +1000 (EST) Received: from localhost ([::1]:56487 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6lG0-0005Ld-El for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2011 11:32:12 -0400 Received: from eggs.gnu.org ([140.186.70.92]:40213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6lFf-0004gk-FA for qemu-devel@nongnu.org; Thu, 22 Sep 2011 11:32:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6lFb-0006Th-86 for qemu-devel@nongnu.org; Thu, 22 Sep 2011 11:31:51 -0400 Received: from mail-ww0-f53.google.com ([74.125.82.53]:54880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6lFb-0006RZ-29 for qemu-devel@nongnu.org; Thu, 22 Sep 2011 11:31:47 -0400 Received: by mail-ww0-f53.google.com with SMTP id 14so2052898wwg.10 for ; Thu, 22 Sep 2011 08:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=ZO8n/j74dicanaaSxjOEmDQn7u1SrUZupZBS2sdhILw=; b=jf/6to+F+XyqIXl7dgj9VBhTaN+GwSJqARnSMOtJ/M9AXa9xDxmZqy8+YDiZ9haUvd RVoiOIGekA7HPqw+z65FQK1YHJ9LTVhlxIW7X7nX3o83Djooev3mrcbJtTMyLxLdO3wn 6kX3UGXc29Owg25BZSGkzKHOCduf2kCLBAJaY= Received: by 10.227.137.82 with SMTP id v18mr2361498wbt.7.1316705506595; Thu, 22 Sep 2011 08:31:46 -0700 (PDT) Received: from localhost.localdomain (c-71-227-161-214.hsd1.wa.comcast.net. [71.227.161.214]) by mx.google.com with ESMTPS id fa3sm12030729wbb.3.2011.09.22.08.31.44 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Sep 2011 08:31:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 22 Sep 2011 08:30:48 -0700 Message-Id: <1316705449-17187-6-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.6.2 In-Reply-To: <1316705449-17187-1-git-send-email-rth@twiddle.net> References: <1316705449-17187-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.53 Subject: [Qemu-devel] [PATCH 5/6] target-alpha: Implement HALT IPR. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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 38be234..db5b9e7 100644 --- a/target-alpha/op_helper.c +++ b/target-alpha/op_helper.c @@ -22,6 +22,7 @@ #include "host-utils.h" #include "softfloat.h" #include "helper.h" +#include "sysemu.h" #include "qemu-timer.h" #define FP_STATUS (env->fp_status) @@ -1218,6 +1219,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 c1ef465..0acbd68 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. */