summaryrefslogtreecommitdiff
path: root/src/arch/arm/system.cc
diff options
context:
space:
mode:
authorGiacomo Travaglini <giacomo.travaglini@arm.com>2017-11-27 18:10:17 +0000
committerGiacomo Travaglini <giacomo.travaglini@arm.com>2017-11-28 12:00:30 +0000
commit7c1405402c7c53f17e554f584b7e801f1f755034 (patch)
treeb02ec6bb1050454b5c13a838ee3cdf944c538c13 /src/arch/arm/system.cc
parente7bff655aa48da0fd1e7656bc10b66473f34aa2a (diff)
downloadgem5-7c1405402c7c53f17e554f584b7e801f1f755034.tar.xz
arch-arm: Add haveEL pseudocode function
This patch introduces the ARM pseudocode haveEL function into gem5. Change-Id: I0d96070959e8e13773eb7fa9964894ec0ff2cac2 Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/6162 Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/arch/arm/system.cc')
-rw-r--r--src/arch/arm/system.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/arch/arm/system.cc b/src/arch/arm/system.cc
index 1fe706079..097a87b2b 100644
--- a/src/arch/arm/system.cc
+++ b/src/arch/arm/system.cc
@@ -225,6 +225,23 @@ ArmSystem::highestEL(ThreadContext *tc)
return FullSystem? getArmSystem(tc)->highestEL() : EL1;
}
+bool
+ArmSystem::haveEL(ThreadContext *tc, ExceptionLevel el)
+{
+ switch (el) {
+ case EL0:
+ case EL1:
+ return true;
+ case EL2:
+ return haveVirtualization(tc);
+ case EL3:
+ return haveSecurity(tc);
+ default:
+ warn("Unimplemented Exception Level\n");
+ return false;
+ }
+}
+
Addr
ArmSystem::resetAddr64(ThreadContext *tc)
{