mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-24 15:38:18 +00:00
target/arm: Add cfgend parameter for ARM CPU selection.
Add a new "cfgend" property which selects whether the CPU resets into big-endian mode or not. This setting affects whether we reset with SCTLR_B (ARMv6 and earlier) or SCTLR_EE (ARMv7 and later) set. Backports commit 3a062d5730266b2386eeda68b1a1c6e96451db31 from qemu
This commit is contained in:
parent
4324d1e97e
commit
1aedb26670
2 changed files with 15 additions and 0 deletions
|
@ -527,6 +527,14 @@ static int arm_cpu_realizefn(struct uc_struct *uc, DeviceState *dev, Error **err
|
|||
cpu->reset_sctlr |= (1 << 13);
|
||||
}
|
||||
|
||||
if (cpu->cfgend) {
|
||||
if (arm_feature(&cpu->env, ARM_FEATURE_V7)) {
|
||||
cpu->reset_sctlr |= SCTLR_EE;
|
||||
} else {
|
||||
cpu->reset_sctlr |= SCTLR_B;
|
||||
}
|
||||
}
|
||||
|
||||
if (!cpu->has_el3) {
|
||||
/* If the has_el3 CPU property is disabled then we need to disable the
|
||||
* feature.
|
||||
|
|
|
@ -672,6 +672,13 @@ typedef struct ARMCPU {
|
|||
uint32_t dcz_blocksize;
|
||||
uint64_t rvbar;
|
||||
|
||||
/* Whether the cfgend input is high (i.e. this CPU should reset into
|
||||
* big-endian mode). This setting isn't used directly: instead it modifies
|
||||
* the reset_sctlr value to have SCTLR_B or SCTLR_EE set, depending on the
|
||||
* architecture version.
|
||||
*/
|
||||
bool cfgend;
|
||||
|
||||
ARMELChangeHook *el_change_hook;
|
||||
void *el_change_hook_opaque;
|
||||
} ARMCPU;
|
||||
|
|
Loading…
Reference in a new issue