mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-16 06:31:51 -06:00
target-arm: Make arm_current_el() return sensible values for M profile
Although M profile doesn't have the same concept of exception level as A profile, it does have a notion of privileged versus not, which we currently track in the privmode TB flag. Support returning this information if arm_current_el() is called on an M profile core, so that we can identify the correct MMU index to use (and put the MMU index in the TB flags) without having to special-case M profile. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Greg Bellows <greg.bellows@linaro.org>
This commit is contained in:
parent
8f3ae2ae2d
commit
6d54ed3c93
1 changed files with 4 additions and 0 deletions
|
@ -1218,6 +1218,10 @@ static inline bool cptype_valid(int cptype)
|
||||||
*/
|
*/
|
||||||
static inline int arm_current_el(CPUARMState *env)
|
static inline int arm_current_el(CPUARMState *env)
|
||||||
{
|
{
|
||||||
|
if (arm_feature(env, ARM_FEATURE_M)) {
|
||||||
|
return !((env->v7m.exception == 0) && (env->v7m.control & 1));
|
||||||
|
}
|
||||||
|
|
||||||
if (is_a64(env)) {
|
if (is_a64(env)) {
|
||||||
return extract32(env->pstate, 2, 2);
|
return extract32(env->pstate, 2, 2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue