mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-02-15 08:59:30 -07:00
target/arm/ptw: extract arm_cpu_get_phys_page
Allow to call that function easily several times in next commit. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-id: 20250414153027.1486719-4-pierrick.bouvier@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
b6af88fafa
commit
63201878f1
1 changed files with 14 additions and 10 deletions
|
|
@ -3630,23 +3630,17 @@ bool get_phys_addr(CPUARMState *env, vaddr address,
|
|||
memop, result, fi);
|
||||
}
|
||||
|
||||
hwaddr arm_cpu_get_phys_page_attrs_debug(CPUState *cs, vaddr addr,
|
||||
MemTxAttrs *attrs)
|
||||
static hwaddr arm_cpu_get_phys_page(CPUARMState *env, vaddr addr,
|
||||
MemTxAttrs *attrs, ARMMMUIdx mmu_idx)
|
||||
{
|
||||
ARMCPU *cpu = ARM_CPU(cs);
|
||||
CPUARMState *env = &cpu->env;
|
||||
ARMMMUIdx mmu_idx = arm_mmu_idx(env);
|
||||
ARMSecuritySpace ss = arm_mmu_idx_to_security_space(env, mmu_idx);
|
||||
S1Translate ptw = {
|
||||
.in_mmu_idx = mmu_idx,
|
||||
.in_space = ss,
|
||||
.in_space = arm_mmu_idx_to_security_space(env, mmu_idx),
|
||||
.in_debug = true,
|
||||
};
|
||||
GetPhysAddrResult res = {};
|
||||
ARMMMUFaultInfo fi = {};
|
||||
bool ret;
|
||||
|
||||
ret = get_phys_addr_gpc(env, &ptw, addr, MMU_DATA_LOAD, 0, &res, &fi);
|
||||
bool ret = get_phys_addr_gpc(env, &ptw, addr, MMU_DATA_LOAD, 0, &res, &fi);
|
||||
*attrs = res.f.attrs;
|
||||
|
||||
if (ret) {
|
||||
|
|
@ -3654,3 +3648,13 @@ hwaddr arm_cpu_get_phys_page_attrs_debug(CPUState *cs, vaddr addr,
|
|||
}
|
||||
return res.f.phys_addr;
|
||||
}
|
||||
|
||||
hwaddr arm_cpu_get_phys_page_attrs_debug(CPUState *cs, vaddr addr,
|
||||
MemTxAttrs *attrs)
|
||||
{
|
||||
ARMCPU *cpu = ARM_CPU(cs);
|
||||
CPUARMState *env = &cpu->env;
|
||||
ARMMMUIdx mmu_idx = arm_mmu_idx(env);
|
||||
|
||||
return arm_cpu_get_phys_page(env, addr, attrs, mmu_idx);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue