From: Giacomo Travaglini Date: Fri, 16 Aug 2019 13:25:20 +0000 (+0100) Subject: arch-arm: Overload currEL helper with CPSR argument X-Git-Tag: v19.0.0.0~649 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4ccb1ea710dcdcf179726448596b96c8e44f743a;p=gem5.git 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 --- 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