From 4ccb1ea710dcdcf179726448596b96c8e44f743a Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Fri, 16 Aug 2019 14:25:20 +0100 Subject: arch-arm: Overload currEL helper with CPSR argument Change-Id: I1edabc61637ecb9d30bca34b5dbcf1de12b35fe0 Signed-off-by: Giacomo Travaglini Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20250 Maintainer: Andreas Sandberg Tested-by: kokoro --- src/arch/arm/utility.hh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/arch/arm') diff --git a/src/arch/arm/utility.hh b/src/arch/arm/utility.hh index ded5aa36c..3a1506114 100644 --- a/src/arch/arm/utility.hh +++ b/src/arch/arm/utility.hh @@ -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 -- cgit v1.2.3