diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-09-12 14:06:49 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-09-12 14:06:49 +0100 |
commit | 73c5211ba93c9d636a9c0a89e1d9037b6ef1418d (patch) | |
tree | 86156f62793c0c0548079d8ded7eb0cb08bcb95a /target-arm/internals.h | |
parent | 9ee98ce81089a123dd0c37f782d726bb14c67bf6 (diff) |
target-arm: Move extended_addresses_enabled() to internals.h
Move the utility function extended_addresses_enabled() into
internals.h; we're going to need to call it from op_helper.c.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target-arm/internals.h')
-rw-r--r-- | target-arm/internals.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/target-arm/internals.h b/target-arm/internals.h index 22f382c0c6..1d788b0e94 100644 --- a/target-arm/internals.h +++ b/target-arm/internals.h @@ -142,6 +142,17 @@ static inline void update_spsel(CPUARMState *env, uint32_t imm) aarch64_restore_sp(env, cur_el); } +/* Return true if extended addresses are enabled. + * This is always the case if our translation regime is 64 bit, + * but depends on TTBCR.EAE for 32 bit. + */ +static inline bool extended_addresses_enabled(CPUARMState *env) +{ + return arm_el_is_aa64(env, 1) + || ((arm_feature(env, ARM_FEATURE_LPAE) + && (env->cp15.c2_control & TTBCR_EAE))); +} + /* Valid Syndrome Register EC field values */ enum arm_exception_class { EC_UNCATEGORIZED = 0x00, |