commit | c2541a817511e8f8d4ec6c1e9806efb7f4bc9569 | [log] [tgz] |
---|---|---|
author | Giacomo Travaglini <giacomo.travaglini@arm.com> | Fri Oct 21 16:21:41 2022 +0100 |
committer | Giacomo Travaglini <giacomo.travaglini@arm.com> | Thu Oct 27 15:33:18 2022 +0000 |
tree | d1fade7e10718d6ed0e59fd7ee643c510b54a8a0 | |
parent | 506bd9d9e7fff46af15f8b5ae68e0cc077ba8fcd [diff] |
arch-arm: Use ThreadContext in ArmISA::currEL implementation This is partly reverting a previous patch [1] which was moving most functionalities within the ISA class. This evidently does not work well with thread context implementations which are bypassed by the ISA objects as noted by [2] [1]: https://gem5-review.googlesource.com/c/public/gem5/+/53624 [2]: https://gem5-review.googlesource.com/c/public/gem5/+/64653 Change-Id: I0c91c76f690542219ffbbf53359531d9dea9e86d Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64914 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Yu-hsin Wang <yuhsingw@google.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
diff --git a/src/arch/arm/utility.cc b/src/arch/arm/utility.cc index f5d37fe..d7185f2 100644 --- a/src/arch/arm/utility.cc +++ b/src/arch/arm/utility.cc
@@ -123,8 +123,8 @@ ExceptionLevel currEL(const ThreadContext *tc) { - return static_cast<ArmISA::ISA *>( - const_cast<ThreadContext *>(tc)->getIsaPtr())->currEL(); + CPSR cpsr = tc->readMiscRegNoEffect(MISCREG_CPSR); + return opModeToEL((OperatingMode)(uint8_t)cpsr.mode); } bool