mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-11 10:15:36 +00:00
target/arm: Make MPU_CTRL register banked for v8M
Make the MPU_CTRL register banked if v8M security extensions are enabled. Backports commit ecf5e8eae8b0b5fa41f00b53d67747b42fd1b8b9 from qemu
This commit is contained in:
parent
683830d5ac
commit
f88f4b5e31
|
@ -434,7 +434,7 @@ typedef struct CPUARMState {
|
|||
uint32_t dfsr; /* Debug Fault Status Register */
|
||||
uint32_t mmfar; /* MemManage Fault Address */
|
||||
uint32_t bfar; /* BusFault Address */
|
||||
unsigned mpu_ctrl; /* MPU_CTRL */
|
||||
unsigned mpu_ctrl[2]; /* MPU_CTRL */
|
||||
int exception;
|
||||
uint32_t primask[2];
|
||||
uint32_t faultmask[2];
|
||||
|
|
|
@ -6365,7 +6365,7 @@ static inline bool regime_translation_disabled(CPUARMState *env,
|
|||
ARMMMUIdx mmu_idx)
|
||||
{
|
||||
if (arm_feature(env, ARM_FEATURE_M)) {
|
||||
switch (env->v7m.mpu_ctrl &
|
||||
switch (env->v7m.mpu_ctrl[regime_is_secure(env, mmu_idx)] &
|
||||
(R_V7M_MPU_CTRL_ENABLE_MASK | R_V7M_MPU_CTRL_HFNMIENA_MASK)) {
|
||||
case R_V7M_MPU_CTRL_ENABLE_MASK:
|
||||
/* Enabled, but not for HardFault and NMI */
|
||||
|
@ -7521,7 +7521,8 @@ static bool pmsav7_use_background_region(ARMCPU *cpu,
|
|||
}
|
||||
|
||||
if (arm_feature(env, ARM_FEATURE_M)) {
|
||||
return env->v7m.mpu_ctrl & R_V7M_MPU_CTRL_PRIVDEFENA_MASK;
|
||||
return env->v7m.mpu_ctrl[regime_is_secure(env, mmu_idx)]
|
||||
& R_V7M_MPU_CTRL_PRIVDEFENA_MASK;
|
||||
} else {
|
||||
return regime_sctlr(env, mmu_idx) & SCTLR_BR;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue