From patchwork Tue Jul 7 18:25:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Zuepke X-Patchwork-Id: 492520 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 81DDD1402BF for ; Wed, 8 Jul 2015 04:27:24 +1000 (AEST) Received: from localhost ([::1]:59891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCXaU-0002l3-4D for incoming@patchwork.ozlabs.org; Tue, 07 Jul 2015 14:27:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCXZs-0001eK-Pb for qemu-devel@nongnu.org; Tue, 07 Jul 2015 14:26:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCXZq-0005Io-6R for qemu-devel@nongnu.org; Tue, 07 Jul 2015 14:26:44 -0400 Received: from mxout-1k.itc.hs-rm.de ([195.72.102.133]:38955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCXZp-0005HS-P5 for qemu-devel@nongnu.org; Tue, 07 Jul 2015 14:26:42 -0400 Received: from EXCHANGE-3K.hds.local (exchange-3k.itc.hs-rm.de [10.10.62.124]) by mxout-1k.itc.hs-rm.de (8.14.4/8.14.4) with ESMTP id t67IQdQF004348; Tue, 7 Jul 2015 20:26:40 +0200 (envelope-from Alexander.Zuepke@hs-rm.de) Received: from bc243-2.local.cs.hs-rm.de (10.151.2.1) by EXCHANGE-3K.hds.local (10.10.62.124) with Microsoft SMTP Server (TLS) id 14.3.224.2; Tue, 7 Jul 2015 20:26:36 +0200 From: Alex Zuepke To: Date: Tue, 7 Jul 2015 20:25:51 +0200 X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1436293553-15575-1-git-send-email-alexander.zuepke@hs-rm.de> References: <1436293553-15575-1-git-send-email-alexander.zuepke@hs-rm.de> MIME-Version: 1.0 X-Originating-IP: [10.151.2.1] Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 195.72.102.133 Cc: peter.maydell@linaro.org, Alex Zuepke Subject: [Qemu-devel] [PATCH 4/6] ARM: Cortex-M3/M4: on exception, set basic bits in exhandling registers 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: Alex Zuepke --- target-arm/helper.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 812204f..555bc5f 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -4541,6 +4541,7 @@ void arm_v7m_cpu_do_interrupt(CPUState *cs) one we're raising. */ switch (cs->exception_index) { case EXCP_UDEF: + env->v7m.cfsr |= CFSR_UNDEFINSTR; armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE); return; case EXCP_SWI: @@ -4549,9 +4550,9 @@ void arm_v7m_cpu_do_interrupt(CPUState *cs) return; case EXCP_PREFETCH_ABORT: case EXCP_DATA_ABORT: - /* TODO: if we implemented the MPU registers, this is where we - * should set the MMFAR, etc from exception.fsr and exception.vaddress. - */ + env->v7m.mmfar = env->exception.vaddress; + env->v7m.cfsr |= CFSR_MMARVALID; + /* TODO: further decoding of exception.fsr */ armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_MEM); return; case EXCP_BKPT: