mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-24 22:15:07 +00:00
target/arm: Convert get_phys_addr_pmsav7() to not return FSC values
Make get_phys_addr_pmsav7() return a fault type in the ARMMMUFaultInfo structure, which we convert to the FSC at the callsite. Backports commit 9375ad15338b24e06109071ac3a85df48a2cc2e6 from qemu
This commit is contained in:
parent
79b2c4b1e7
commit
3eb4a2ea84
|
@ -8307,7 +8307,8 @@ static inline bool m_is_system_region(CPUARMState *env, uint32_t address)
|
||||||
|
|
||||||
static bool get_phys_addr_pmsav7(CPUARMState *env, uint32_t address,
|
static bool get_phys_addr_pmsav7(CPUARMState *env, uint32_t address,
|
||||||
MMUAccessType access_type, ARMMMUIdx mmu_idx,
|
MMUAccessType access_type, ARMMMUIdx mmu_idx,
|
||||||
hwaddr *phys_ptr, int *prot, uint32_t *fsr)
|
hwaddr *phys_ptr, int *prot,
|
||||||
|
ARMMMUFaultInfo *fi)
|
||||||
{
|
{
|
||||||
ARMCPU *cpu = arm_env_get_cpu(env);
|
ARMCPU *cpu = arm_env_get_cpu(env);
|
||||||
int n;
|
int n;
|
||||||
|
@ -8402,7 +8403,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, uint32_t address,
|
||||||
if (n == -1) { /* no hits */
|
if (n == -1) { /* no hits */
|
||||||
if (!pmsav7_use_background_region(cpu, mmu_idx, is_user)) {
|
if (!pmsav7_use_background_region(cpu, mmu_idx, is_user)) {
|
||||||
/* background fault */
|
/* background fault */
|
||||||
*fsr = 0;
|
fi->type = ARMFault_Background;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
get_phys_addr_pmsav7_default(env, mmu_idx, address, prot);
|
get_phys_addr_pmsav7_default(env, mmu_idx, address, prot);
|
||||||
|
@ -8460,7 +8461,8 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, uint32_t address,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*fsr = 0x00d; /* Permission fault */
|
fi->type = ARMFault_Permission;
|
||||||
|
fi->level = 1;
|
||||||
return !(*prot & (1 << access_type));
|
return !(*prot & (1 << access_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9004,7 +9006,8 @@ static bool get_phys_addr(CPUARMState *env, target_ulong address,
|
||||||
} else if (arm_feature(env, ARM_FEATURE_V7)) {
|
} else if (arm_feature(env, ARM_FEATURE_V7)) {
|
||||||
/* PMSAv7 */
|
/* PMSAv7 */
|
||||||
ret = get_phys_addr_pmsav7(env, address, access_type, mmu_idx,
|
ret = get_phys_addr_pmsav7(env, address, access_type, mmu_idx,
|
||||||
phys_ptr, prot, fsr);
|
phys_ptr, prot, fi);
|
||||||
|
*fsr = arm_fi_to_sfsc(fi);
|
||||||
} else {
|
} else {
|
||||||
/* Pre-v7 MPU */
|
/* Pre-v7 MPU */
|
||||||
ret = get_phys_addr_pmsav5(env, address, access_type, mmu_idx,
|
ret = get_phys_addr_pmsav5(env, address, access_type, mmu_idx,
|
||||||
|
|
Loading…
Reference in a new issue