From patchwork Mon May 9 21:34:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 94891 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 51BD5B6F17 for ; Tue, 10 May 2011 07:48:21 +1000 (EST) Received: from localhost ([::1]:57551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJYJN-0000s8-HB for incoming@patchwork.ozlabs.org; Mon, 09 May 2011 17:48:17 -0400 Received: from eggs.gnu.org ([140.186.70.92]:38664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJY6z-00044M-Df for qemu-devel@nongnu.org; Mon, 09 May 2011 17:35:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJY6v-0006Ok-Iz for qemu-devel@nongnu.org; Mon, 09 May 2011 17:35:28 -0400 Received: from mail-iw0-f173.google.com ([209.85.214.173]:38418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJY6v-0006Af-FK for qemu-devel@nongnu.org; Mon, 09 May 2011 17:35:25 -0400 Received: by mail-iw0-f173.google.com with SMTP id 42so5560360iwl.4 for ; Mon, 09 May 2011 14:35:25 -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=r7k7zuLoo05GCvbrKTWSj7uktBAk5tCELnECTZy+eTI=; b=UJS1WyGs8W1GzDGbkPQTsHF3peaddQsxoUx2BgNRVqU31PvCBB1t6z/kBmC9USbmuR qMaGKK2evXsW+0srS7wj/9He3jHTMlnpZpddkjiul5GxUJQ25p1ALsP8ew7vgF+P+zbA haQuI6dUp7NFr+Vh1P6F1aAOseFYpsLco0imY= 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=gSBjG6Gnh0v3JIV7G+lTdLKodFHHZBuzIiqv72TYW/qDEpxMbVG83ahpXxg+v8krN9 8mu2PaUP7oTmz8bGfjRicMocsGAEpEbIVx+M/xTuNTYI3aGoBjuApNBDku8wS6jO20pQ q5z+98W/DdEDc8PZywLahJ6KareCXC/hYo3Ys= Received: by 10.42.161.201 with SMTP id u9mr392815icx.192.1304976925245; Mon, 09 May 2011 14:35:25 -0700 (PDT) Received: from localhost.localdomain (are.twiddle.net [75.101.38.216]) by mx.google.com with ESMTPS id ui7sm2549819icb.14.2011.05.09.14.35.24 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 May 2011 14:35:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 9 May 2011 14:34:45 -0700 Message-Id: <1304976889-29675-32-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1304976889-29675-1-git-send-email-rth@twiddle.net> References: <1304976889-29675-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.173 Subject: [Qemu-devel] [PATCH 31/35] 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 7b976be..9edcd74 100644 --- a/target-alpha/translate.c +++ b/target-alpha/translate.c @@ -1649,6 +1649,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. */