mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
target/arm: Use GetPhysAddrResult in get_phys_addr_pmsav5
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220822152741.1617527-7-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
51d98ce2cb
commit
b7b9b579cf
1 changed files with 12 additions and 12 deletions
|
@ -1351,7 +1351,7 @@ do_fault:
|
||||||
|
|
||||||
static bool get_phys_addr_pmsav5(CPUARMState *env, uint32_t address,
|
static bool get_phys_addr_pmsav5(CPUARMState *env, uint32_t address,
|
||||||
MMUAccessType access_type, ARMMMUIdx mmu_idx,
|
MMUAccessType access_type, ARMMMUIdx mmu_idx,
|
||||||
hwaddr *phys_ptr, int *prot,
|
GetPhysAddrResult *result,
|
||||||
ARMMMUFaultInfo *fi)
|
ARMMMUFaultInfo *fi)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
@ -1361,12 +1361,12 @@ static bool get_phys_addr_pmsav5(CPUARMState *env, uint32_t address,
|
||||||
|
|
||||||
if (regime_translation_disabled(env, mmu_idx)) {
|
if (regime_translation_disabled(env, mmu_idx)) {
|
||||||
/* MPU disabled. */
|
/* MPU disabled. */
|
||||||
*phys_ptr = address;
|
result->phys = address;
|
||||||
*prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
|
result->prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
*phys_ptr = address;
|
result->phys = address;
|
||||||
for (n = 7; n >= 0; n--) {
|
for (n = 7; n >= 0; n--) {
|
||||||
base = env->cp15.c6_region[n];
|
base = env->cp15.c6_region[n];
|
||||||
if ((base & 1) == 0) {
|
if ((base & 1) == 0) {
|
||||||
|
@ -1402,16 +1402,16 @@ static bool get_phys_addr_pmsav5(CPUARMState *env, uint32_t address,
|
||||||
fi->level = 1;
|
fi->level = 1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
*prot = PAGE_READ | PAGE_WRITE;
|
result->prot = PAGE_READ | PAGE_WRITE;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
*prot = PAGE_READ;
|
result->prot = PAGE_READ;
|
||||||
if (!is_user) {
|
if (!is_user) {
|
||||||
*prot |= PAGE_WRITE;
|
result->prot |= PAGE_WRITE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
*prot = PAGE_READ | PAGE_WRITE;
|
result->prot = PAGE_READ | PAGE_WRITE;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
if (is_user) {
|
if (is_user) {
|
||||||
|
@ -1419,10 +1419,10 @@ static bool get_phys_addr_pmsav5(CPUARMState *env, uint32_t address,
|
||||||
fi->level = 1;
|
fi->level = 1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
*prot = PAGE_READ;
|
result->prot = PAGE_READ;
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
*prot = PAGE_READ;
|
result->prot = PAGE_READ;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* Bad permission. */
|
/* Bad permission. */
|
||||||
|
@ -1430,7 +1430,7 @@ static bool get_phys_addr_pmsav5(CPUARMState *env, uint32_t address,
|
||||||
fi->level = 1;
|
fi->level = 1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
*prot |= PAGE_EXEC;
|
result->prot |= PAGE_EXEC;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2427,7 +2427,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong address,
|
||||||
} 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,
|
||||||
&result->phys, &result->prot, fi);
|
result, fi);
|
||||||
}
|
}
|
||||||
qemu_log_mask(CPU_LOG_MMU, "PMSA MPU lookup for %s at 0x%08" PRIx32
|
qemu_log_mask(CPU_LOG_MMU, "PMSA MPU lookup for %s at 0x%08" PRIx32
|
||||||
" mmu_idx %u -> %s (prot %c%c%c)\n",
|
" mmu_idx %u -> %s (prot %c%c%c)\n",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue