summaryrefslogtreecommitdiff
path: root/src/arch/arm/insts/static_inst.hh
diff options
context:
space:
mode:
authorGiacomo Travaglini <giacomo.travaglini@arm.com>2017-12-01 16:25:55 +0000
committerGiacomo Travaglini <giacomo.travaglini@arm.com>2017-12-21 13:25:24 +0000
commit7df83c94da53f8d04367cb472be8f7f947f94234 (patch)
tree0ca945b489931f3503ea122622d053fee353baf7 /src/arch/arm/insts/static_inst.hh
parent0049df179f3b5f57218b91e98390c1aacaa27c2e (diff)
downloadgem5-7df83c94da53f8d04367cb472be8f7f947f94234.tar.xz
arch-arm: Fixed WFE/WFI trapping behaviour
This patch fixes the WFx trapping behaviour by introducing the arm arm v8 pseudocode functions: checkForWFxTrap32 and checkForWFxTrap64 Change-Id: I3db0d78b5c4ad46860e6d199c2f2fc7b41842840 Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/6622 Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/arch/arm/insts/static_inst.hh')
-rw-r--r--src/arch/arm/insts/static_inst.hh28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/arch/arm/insts/static_inst.hh b/src/arch/arm/insts/static_inst.hh
index 7ca1a84b6..9aed77c21 100644
--- a/src/arch/arm/insts/static_inst.hh
+++ b/src/arch/arm/insts/static_inst.hh
@@ -364,6 +364,11 @@ class ArmStaticInst : public StaticInst
mnemonic, true);
}
+ // Utility function used by checkForWFxTrap32 and checkForWFxTrap64
+ // Returns true if processor has to trap a WFI/WFE instruction.
+ bool isWFxTrapping(ThreadContext *tc,
+ ExceptionLevel targetEL, bool isWfe) const;
+
/**
* Trap an access to Advanced SIMD or FP registers due to access
* control bits.
@@ -406,6 +411,29 @@ class ArmStaticInst : public StaticInst
bool fpexc_check, bool advsimd) const;
/**
+ * Check if WFE/WFI instruction execution in aarch32 should be trapped.
+ *
+ * See aarch32/exceptions/traps/AArch32.checkForWFxTrap in the
+ * ARM ARM psueodcode library.
+ */
+ Fault checkForWFxTrap32(ThreadContext *tc,
+ ExceptionLevel tgtEl, bool isWfe) const;
+
+ /**
+ * Check if WFE/WFI instruction execution in aarch64 should be trapped.
+ *
+ * See aarch64/exceptions/traps/AArch64.checkForWFxTrap in the
+ * ARM ARM psueodcode library.
+ */
+ Fault checkForWFxTrap64(ThreadContext *tc,
+ ExceptionLevel tgtEl, bool isWfe) const;
+
+ /**
+ * WFE/WFI trapping helper function.
+ */
+ Fault trapWFx(ThreadContext *tc, CPSR cpsr, SCR scr, bool isWfe) const;
+
+ /**
* Get the new PSTATE from a SPSR register in preparation for an
* exception return.
*