diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2022-10-24 15:18:38 +1000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2022-10-27 10:27:23 +0100 |
commit | edc05dd43ade287e735f1d8c972562dbdd12a378 (patch) | |
tree | e9e043c8312f360794ed5d4df6d2ef120ea24988 /target/arm/internals.h | |
parent | 7719419deb07a431455dfb0178480ef4be2d3e2c (diff) |
target/arm: Introduce regime_is_stage2
Reduce the amount of typing required for this check.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20221024051851.3074715-2-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <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 1926f3679c..2c4768dd05 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -673,6 +673,11 @@ static inline bool regime_is_pan(CPUARMState *env, ARMMMUIdx mmu_idx) } } +static inline bool regime_is_stage2(ARMMMUIdx mmu_idx) +{ + return mmu_idx == ARMMMUIdx_Stage2 || mmu_idx == ARMMMUIdx_Stage2_S; +} + /* Return the exception level which controls this address translation regime */ static inline uint32_t regime_el(CPUARMState *env, ARMMMUIdx mmu_idx) { |