arch-arm: Overload currEL helper with CPSR argument
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 16 Aug 2019 13:25:20 +0000 (14:25 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 20 Aug 2019 14:23:19 +0000 (14:23 +0000)
Change-Id: I1edabc61637ecb9d30bca34b5dbcf1de12b35fe0
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20250
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/utility.hh

index ded5aa36cad18614a2866df299e839246651ce38..3a1506114c40ee8decb82628ece9ea9d0dde9480 100644 (file)
@@ -156,6 +156,12 @@ currEL(ThreadContext *tc)
     return opModeToEL(currOpMode(tc));
 }
 
+inline ExceptionLevel
+currEL(CPSR cpsr)
+{
+    return opModeToEL((OperatingMode) (uint8_t)cpsr.mode);
+}
+
 /**
  * This function checks whether selected EL provided as an argument
  * is using the AArch32 ISA. This information might be unavailable