From patchwork Thu Apr 28 20:51:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 93322 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 E1C4AB6FBD for ; Fri, 29 Apr 2011 07:00:20 +1000 (EST) Received: from localhost ([::1]:36458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFYJu-0004Jr-Bz for incoming@patchwork.ozlabs.org; Thu, 28 Apr 2011 17:00:18 -0400 Received: from eggs.gnu.org ([140.186.70.92]:48101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFYBt-0005rZ-4x for qemu-devel@nongnu.org; Thu, 28 Apr 2011 16:52:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFYBs-0005i9-A8 for qemu-devel@nongnu.org; Thu, 28 Apr 2011 16:52:01 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:64385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFYBs-0005Zh-39 for qemu-devel@nongnu.org; Thu, 28 Apr 2011 16:52:00 -0400 Received: by mail-pv0-f173.google.com with SMTP id 3so2495040pvg.4 for ; Thu, 28 Apr 2011 13:51:59 -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=ae8U/UeNc7cPyuSNk+00rBtn4imNQGJ4Fac3cQGLkCD+raee3YbMfM2FOxgn4CZIjU TlpvKe7/ip+JyNWvij2lTUUKJ4z7O8grPW6Nry2uXZypBM4oINxeqWKT5uOTidL4alSL u2kx3KYFduJO1nf6rz3V6EnCaLSj1KqfP88nY= 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=Yjzjmx1F1ZhpzjKGOERYxu3tzE+yzT9p7VmBaNQB3Z5COCF3F2MecRCHbDA8sONvVb 5njsMzvQD3qY+Q8Wazlz1zo3TqR2wBDaEAmdjEKMYihjaItPX03DWHiTBC5ChaQLYaiJ 7UpLrujckefJD+qfTsG8nkkuc2H29nQwNwEnM= Received: by 10.142.204.1 with SMTP id b1mr1311550wfg.194.1304023919541; Thu, 28 Apr 2011 13:51:59 -0700 (PDT) Received: from localhost.localdomain (are.twiddle.net [75.101.38.216]) by mx.google.com with ESMTPS id z10sm2266797wfj.12.2011.04.28.13.51.58 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Apr 2011 13:51:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 28 Apr 2011 13:51:14 -0700 Message-Id: <1304023875-25040-33-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1304023875-25040-1-git-send-email-rth@twiddle.net> References: <1304023875-25040-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.83.173 Subject: [Qemu-devel] [PATCH 32/33] 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. */