summaryrefslogtreecommitdiff
path: root/src/arch/arm/insts/static_inst.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2016-06-02 13:41:26 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2016-06-02 13:41:26 +0100
commit660fbd543f7c84dec81cd17bdb4ff08f954aec77 (patch)
treea03fb18c83b32031b5331767e3067a026d641775 /src/arch/arm/insts/static_inst.hh
parentf48ad5b29d6f291b4f3679ff5fb7b5beae10d6fa (diff)
downloadgem5-660fbd543f7c84dec81cd17bdb4ff08f954aec77.tar.xz
arm: Rewrite ERET to behave according to the ARMv8 ARM
The ERET instruction doesn't set PSTATE correctly in some cases (particularly when returning to aarch32 code). Among other things, this breaks EL0 thumb code when using a 64-bit kernel. This changeset updates the ERET implementation to match the ARM ARM. Change-Id: I408e7c69a23cce437859313dfe84e68744b07c98 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Nathanael Premillieu <nathanael.premillieu@arm.com>
Diffstat (limited to 'src/arch/arm/insts/static_inst.hh')
-rw-r--r--src/arch/arm/insts/static_inst.hh9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/arch/arm/insts/static_inst.hh b/src/arch/arm/insts/static_inst.hh
index 9ca64d1fe..55d16f69d 100644
--- a/src/arch/arm/insts/static_inst.hh
+++ b/src/arch/arm/insts/static_inst.hh
@@ -404,6 +404,15 @@ class ArmStaticInst : public StaticInst
NSACR nsacr, FPEXC fpexc,
bool fpexc_check, bool advsimd) const;
+ /**
+ * Get the new PSTATE from a SPSR register in preparation for an
+ * exception return.
+ *
+ * See shared/functions/system/SetPSTATEFromPSR in the ARM ARM
+ * psueodcode library.
+ */
+ CPSR getPSTATEFromPSR(ThreadContext *tc, CPSR cpsr, CPSR spsr) const;
+
public:
virtual void
annotateFault(ArmFault *fault) {}