diff options
author | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2018-06-07 17:17:16 +0100 |
---|---|---|
committer | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2018-06-22 10:52:55 +0000 |
commit | fc278fffb78512ff3d62a906804d6b285edd00c7 (patch) | |
tree | 5c8f488763041f6774ebada7609b86d6a3a865bd /src/arch/arm/utility.hh | |
parent | 3ed0c3c0bef2eefddcf2033e6ab9d22cf45c486d (diff) | |
download | gem5-fc278fffb78512ff3d62a906804d6b285edd00c7.tar.xz |
arch-arm: BadMode checking if corresponding EL is implemented
The old utility function called badMode was only checking if the mode
passed as an argument was a recognized mode. It was not checking if the
corresponding mode/EL was implemented. That function has been renamed to
unknownMode and a new badMode has been introduced. This is used by the
cpsrWriteByInstruction function. In this way any try to change the
execution mode won't succeed if the mode hasn't been implemented.
Change-Id: Ibfe385c5465b904acc0d2eb9647710891d72c9df
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/11196
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/arch/arm/utility.hh')
-rw-r--r-- | src/arch/arm/utility.hh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/arch/arm/utility.hh b/src/arch/arm/utility.hh index 796ded771..9d0131b49 100644 --- a/src/arch/arm/utility.hh +++ b/src/arch/arm/utility.hh @@ -181,6 +181,26 @@ bool ELIs64(ThreadContext *tc, ExceptionLevel el); bool isBigEndian64(ThreadContext *tc); +/** + * badMode is checking if the execution mode provided as an argument is + * valid and implemented for AArch32 + * + * @param tc ThreadContext + * @param mode OperatingMode to check + * @return false if mode is valid and implemented, true otherwise + */ +bool badMode32(ThreadContext *tc, OperatingMode mode); + +/** + * badMode is checking if the execution mode provided as an argument is + * valid and implemented. + * + * @param tc ThreadContext + * @param mode OperatingMode to check + * @return false if mode is valid and implemented, true otherwise + */ +bool badMode(ThreadContext *tc, OperatingMode mode); + static inline uint8_t itState(CPSR psr) { |