From patchwork Fri Jun 24 19:23:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 101895 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 71A4FB6F7A for ; Sat, 25 Jun 2011 06:44:32 +1000 (EST) Received: from localhost ([::1]:44718 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QaDEq-0003Kh-Pm for incoming@patchwork.ozlabs.org; Fri, 24 Jun 2011 16:44:28 -0400 Received: from eggs.gnu.org ([140.186.70.92]:52436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QaBzM-0007rn-Fe for qemu-devel@nongnu.org; Fri, 24 Jun 2011 15:24:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QaBzK-0000rM-Ex for qemu-devel@nongnu.org; Fri, 24 Jun 2011 15:24:24 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:61113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QaBzK-0000pt-2C for qemu-devel@nongnu.org; Fri, 24 Jun 2011 15:24:22 -0400 Received: by mail-wy0-f173.google.com with SMTP id 28so2380750wyf.4 for ; Fri, 24 Jun 2011 12:24:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:subject:date:message-id:x-mailer :in-reply-to:references; bh=OVvE0nk2m5qt2PsK1DMKs5QJJcNyyZm3IwG6yKM1JAM=; b=vga7dnW3Vg+fx7iYrBOkbuAQY9LgXz1jdICdXm6awCjnX5py+UcTaFGz6uQ+tRPCBQ apKSJNKnp2uvpIGHMe8uhS+BXy1zhcjANADQpVNmFA1vaD7QUcsnYs/gy/vFfqXkIymu AZj6/ryfI8YL/0IBuQDbhYQQ96dKHp8HtVJ6s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; b=xHJLKFgPNBTNlivoqzG1YZLOguVW6PhKXy9t76JJEjin2EtPqn7nnR78riUy62ilua sfMvchl1E3aRTmkCcBexZX1Nyadpn9EDuvPLTWLhthrhTlXb0O6t7is0EHB3PoM9Wt9I WFH4ySmu2Qk6D/0nzpg5hSNUOFVmmybCRBd9Y= Received: by 10.227.170.141 with SMTP id d13mr2234399wbz.13.1308943461748; Fri, 24 Jun 2011 12:24:21 -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 ex2sm2224860wbb.14.2011.06.24.12.24.19 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Jun 2011 12:24:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 24 Jun 2011 12:23:53 -0700 Message-Id: <1308943435-24993-7-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1308943435-24993-1-git-send-email-rth@twiddle.net> References: <1308943435-24993-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.173 Subject: [Qemu-devel] [PATCH 6/8] 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 d332719..80656f5 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 e13ac30..1a66322 100644 --- a/target-alpha/translate.c +++ b/target-alpha/translate.c @@ -1646,6 +1646,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. */