From patchwork Fri Oct 9 13:28:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Davidsaver X-Patchwork-Id: 528481 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:4830:134:3::10]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 60513140E41 for ; Sat, 10 Oct 2015 12:38:25 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=I9xWSC3n; dkim-atps=neutral Received: from lists.gnu.org ([208.118.235.17]:41513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zkb2h-0007CC-TA for incoming@patchwork.ozlabs.org; Fri, 09 Oct 2015 13:01:16 -0400 Received: from localhost ([::1]:40129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zkb2h-00027G-9E for incoming@patchwork.ozlabs.org; Fri, 09 Oct 2015 13:01:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkXjM-0003zy-Cm for qemu-devel@nongnu.org; Fri, 09 Oct 2015 09:29:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkXjJ-00057E-7N for qemu-devel@nongnu.org; Fri, 09 Oct 2015 09:29:04 -0400 Received: from mail-qg0-x236.google.com ([2607:f8b0:400d:c04::236]:34015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkXjJ-00057A-3s for qemu-devel@nongnu.org; Fri, 09 Oct 2015 09:29:01 -0400 Received: by qgez77 with SMTP id z77so68575411qge.1 for ; Fri, 09 Oct 2015 06:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ltfH3dQG6ALhBwMId70S+RJmtrlwrZe72z0fIkCPTAo=; b=I9xWSC3niBtL6LHnvAMs3VLhx6RspJE5dzh8m1w4OIA2mI2SQQORXNvO0vVnugZkAS KRq7pBGe9HG2JoZF8LgTRdgBbDgSAw4F5IO9t/j/IUESnsvaP9bfVGv1oqD6uvuzGnQv cVoBfgNSi0EQQrUGneZrdcZcFjrWOdI4mF7Fi27edy5dkppb6MHu5pmPKPcH5S+bwz5h A2L8itWtCHZBGySvQDgBT6dHO5JmAhIpB+UuS3Tj5Wg9evPPDf/aTE5PEp4lQ7WH/XaD OgLukcH1hDQjT+4Uqs0RSW0S45b4caB2HOvSoqKY0erfOFqnO6TPttf9p8chttSs2myL U45w== X-Received: by 10.140.151.76 with SMTP id 73mr15887605qhx.61.1444397340931; Fri, 09 Oct 2015 06:29:00 -0700 (PDT) Received: from desktop.local (ool-182df582.dyn.optonline.net. [24.45.245.130]) by smtp.gmail.com with ESMTPSA id z10sm623034qhd.15.2015.10.09.06.28.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Oct 2015 06:28:47 -0700 (PDT) From: Michael Davidsaver To: qemu-devel@nongnu.org Date: Fri, 9 Oct 2015 09:28:29 -0400 Message-Id: <49239b8f661f21f4e947fdb9d0e93c02feb2972f.1444396783.git.mdavidsaver@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c04::236 Cc: Peter Crosthwaite , Michael Davidsaver Subject: [Qemu-devel] [PATCH 1/3] armv7-m: exit on external reset request 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 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x Implement the SYSRESETREQ bit of the AIRCR register for armv7-m (ie. cortex-m3). --- hw/intc/armv7m_nvic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c index 3ec8408..a671d84 100644 --- a/hw/intc/armv7m_nvic.c +++ b/hw/intc/armv7m_nvic.c @@ -15,6 +15,7 @@ #include "hw/arm/arm.h" #include "exec/address-spaces.h" #include "gic_internal.h" +#include "sysemu/sysemu.h" typedef struct { GICState gic; @@ -348,10 +349,13 @@ static void nvic_writel(nvic_state *s, uint32_t offset, uint32_t value) break; case 0xd0c: /* Application Interrupt/Reset Control. */ if ((value >> 16) == 0x05fa) { + if (value & 4) { + qemu_system_reset_request(); + } if (value & 2) { qemu_log_mask(LOG_UNIMP, "VECTCLRACTIVE unimplemented\n"); } - if (value & 5) { + if (value & 1) { qemu_log_mask(LOG_UNIMP, "AIRCR system reset unimplemented\n"); } if (value & 0x700) {