diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2010-06-02 12:57:59 -0500 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2010-06-02 12:57:59 -0500 |
commit | 9ef82c0bc437a962398857dcb365a8493a9ac5c7 (patch) | |
tree | 72a8bb547981a08249aac1f3af9d36641220d9c3 /src/arch/arm/faults.cc | |
parent | 1c0d9806e5475e07fd62e56938bde77f52496cfb (diff) | |
download | gem5-9ef82c0bc437a962398857dcb365a8493a9ac5c7.tar.xz |
ARM: Track the current ISA mode using the PC.
Diffstat (limited to 'src/arch/arm/faults.cc')
-rw-r--r-- | src/arch/arm/faults.cc | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/arch/arm/faults.cc b/src/arch/arm/faults.cc index b7dd2d503..2f939ea8c 100644 --- a/src/arch/arm/faults.cc +++ b/src/arch/arm/faults.cc @@ -1,4 +1,16 @@ /* + * Copyright (c) 2010 ARM Limited + * All rights reserved + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * * Copyright (c) 2003-2005 The Regents of The University of Michigan * Copyright (c) 2007-2008 The Florida State University * All rights reserved. @@ -95,8 +107,7 @@ ArmFaultBase::invoke(ThreadContext *tc) cpsr.it1 = cpsr.it2 = 0; cpsr.j = 0; - if (sctlr.te) - cpsr.t = 1; + cpsr.t = sctlr.te; cpsr.a = cpsr.a | abortDisable(); cpsr.f = cpsr.f | fiqDisable(); cpsr.i = 1; @@ -122,12 +133,14 @@ ArmFaultBase::invoke(ThreadContext *tc) break; default: panic("unknown Mode\n"); - } - - DPRINTF(Faults, "Invoking Fault: %s cpsr: %#x PC: %#x lr: %#x\n", name(), cpsr, - tc->readPC(), tc->readIntReg(INTREG_LR)); - tc->setPC(getVector(tc)); - tc->setNextPC(getVector(tc) + cpsr.t ? 2 : 4 ); + } + + Addr pc = tc->readPC(); + DPRINTF(Faults, "Invoking Fault: %s cpsr: %#x PC: %#x lr: %#x\n", + name(), cpsr, pc, tc->readIntReg(INTREG_LR)); + Addr newPc = getVector(tc) | (sctlr.te ? (ULL(1) << PcTBitShift) : 0); + tc->setPC(newPc); + tc->setNextPC(newPc + cpsr.t ? 2 : 4 ); } #endif // FULL_SYSTEM |