From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDJ2-0005so-Qk for qemu-devel@nongnu.org; Thu, 08 Oct 2015 11:40:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkDJ1-0005Ye-GW for qemu-devel@nongnu.org; Thu, 08 Oct 2015 11:40:32 -0400 Received: from mail-qg0-x229.google.com ([2607:f8b0:400d:c04::229]:35863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDJ1-0005YU-C6 for qemu-devel@nongnu.org; Thu, 08 Oct 2015 11:40:31 -0400 Received: by qgx61 with SMTP id 61so45200443qgx.3 for ; Thu, 08 Oct 2015 08:40:31 -0700 (PDT) From: Michael Davidsaver Date: Thu, 8 Oct 2015 11:40:01 -0400 Message-Id: <1b09df0b1659aefda410242d9976db61eb099b32.1444318183.git.mdavidsaver@gmail.com> In-Reply-To: References: Subject: [Qemu-devel] [PATCH] armv7-m: exit on external reset request List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Michael Davidsaver Signed-off-by: Michael Davidsaver --- 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) { -- 2.1.4