diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-10-24 07:50:18 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-10-24 07:51:36 +0100 |
commit | 64b91e3f890a8c221b65c6820a5ee39107ee40f5 (patch) | |
tree | 289b3023def6a132a591230c9227ec094466a638 /target/arm/internals.h | |
parent | eadb2febf05452bd8062c4c7823d7d789142500c (diff) |
target/arm: New utility function to extract EC from syndrome
Create and use a utility function to extract the EC field
from a syndrome, rather than open-coding the shift.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20181012144235.19646-9-peter.maydell@linaro.org
Diffstat (limited to 'target/arm/internals.h')
-rw-r--r-- | target/arm/internals.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/target/arm/internals.h b/target/arm/internals.h index 6b204fad51..bf7bd1fbfe 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -278,6 +278,11 @@ enum arm_exception_class { #define ARM_EL_IL (1 << ARM_EL_IL_SHIFT) #define ARM_EL_ISV (1 << ARM_EL_ISV_SHIFT) +static inline uint32_t syn_get_ec(uint32_t syn) +{ + return syn >> ARM_EL_EC_SHIFT; +} + /* Utility functions for constructing various kinds of syndrome value. * Note that in general we follow the AArch64 syndrome values; in a * few cases the value in HSR for exceptions taken to AArch32 Hyp |