Received: from eggs.gnu.org ([2001:4830:134:3::10]:36096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4Hc0-000499-9i for qemu-devel@nongnu.org; Wed, 02 Dec 2015 19:19:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4Hby-0001wf-IK for qemu-devel@nongnu.org; Wed, 02 Dec 2015 19:19:04 -0500 From: Michael Davidsaver Date: Wed, 2 Dec 2015 19:18:31 -0500 Message-Id: <1449101933-24928-5-git-send-email-mdavidsaver@gmail.com> In-Reply-To: <1449101933-24928-1-git-send-email-mdavidsaver@gmail.com> References: <1449101933-24928-1-git-send-email-mdavidsaver@gmail.com> Subject: [Qemu-devel] [PATCH v2 04/26] armv7m: additional cpu state for exception handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , qemu-arm@nongnu.org, Michael Davidsaver Track priorities and highest active and pending exception. Also the highest pending exception for faster exception handler entry. The pending exception information will be re-calculated on load, so no additional vmstate tracking is needed. --- target-arm/cpu.c | 2 ++ target-arm/cpu.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/target-arm/cpu.c b/target-arm/cpu.c index 728854f..5348028 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -173,6 +173,8 @@ static void arm_cpu_reset(CPUState *s) uint32_t initial_pc; /* Loaded from 0x4 */ uint8_t *rom; + env->v7m.exception_prio = env->v7m.pending_prio = 0x100; + env->daif &= ~PSTATE_I; rom = rom_ptr(0); if (rom) { diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 815fef8..c193fbb 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -398,6 +398,9 @@ typedef struct CPUARMState { uint32_t control; int current_sp; int exception; + int exception_prio; + unsigned pending; + int pending_prio; } v7m; /* Information associated with an exception about to be taken: -- 2.1.4