mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-25 10:49:12 +00:00
arm: Add has-mpu property
For processors that support MPUs, add a property to de-feature it. This is similar to the implementation of the EL3 feature. The processor definition in init sets ARM_FEATURE_MPU if it can support an MPU. post_init exposes the property, defaulting to true. If cleared by the instantiator, ARM_FEATURE_MPU is then removed at realize time. This is to support R profile processors that may or may-not have an MPU configured. Backports commit 8f325f568fbd0158cd413e7d637573ba90b3eaab from qemu
This commit is contained in:
parent
6f843a5484
commit
0299851aa0
2 changed files with 7 additions and 0 deletions
|
@ -102,6 +102,9 @@ typedef struct ARMCPU {
|
|||
/* CPU has security extension */
|
||||
bool has_el3;
|
||||
|
||||
/* CPU has memory protection unit */
|
||||
bool has_mpu;
|
||||
|
||||
/* PSCI conduit used to invoke PSCI methods
|
||||
* 0 - disabled, 1 - smc, 2 - hvc
|
||||
*/
|
||||
|
|
|
@ -485,6 +485,10 @@ static int arm_cpu_realizefn(struct uc_struct *uc, DeviceState *dev, Error **err
|
|||
cpu->id_aa64pfr0 &= ~0xf000;
|
||||
}
|
||||
|
||||
if (!cpu->has_mpu) {
|
||||
unset_feature(env, ARM_FEATURE_MPU);
|
||||
}
|
||||
|
||||
if (arm_feature(env, ARM_FEATURE_EL3)) {
|
||||
set_feature(env, ARM_FEATURE_VBAR);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue