aboutsummaryrefslogtreecommitdiff
path: root/target/hppa/mem_helper.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2017-11-05 10:50:47 +0100
committerRichard Henderson <richard.henderson@linaro.org>2018-01-30 10:22:26 -0800
commit2dfcca9ffc0131f0d740dea27ebff04be01f871b (patch)
treedfc6338124c4b82740202f8aaf010ab1c60efd15 /target/hppa/mem_helper.c
parentd0a851cc508b355a4d63e905e4f69a466f0d7f89 (diff)
target/hppa: Implement LPA
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/hppa/mem_helper.c')
-rw-r--r--target/hppa/mem_helper.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c
index 995b1937f6..ecd964d779 100644
--- a/target/hppa/mem_helper.c
+++ b/target/hppa/mem_helper.c
@@ -314,4 +314,25 @@ void HELPER(ptlbe)(CPUHPPAState *env)
memset(env->tlb, 0, sizeof(env->tlb));
tlb_flush_by_mmuidx(src, 0xf);
}
+
+target_ureg HELPER(lpa)(CPUHPPAState *env, target_ulong addr)
+{
+ hwaddr phys;
+ int prot, excp;
+
+ excp = hppa_get_physical_address(env, addr, MMU_KERNEL_IDX, 0,
+ &phys, &prot);
+ if (excp >= 0) {
+ if (env->psw & PSW_Q) {
+ /* ??? Needs tweaking for hppa64. */
+ env->cr[CR_IOR] = addr;
+ env->cr[CR_ISR] = addr >> 32;
+ }
+ if (excp == EXCP_DTLB_MISS) {
+ excp = EXCP_NA_DTLB_MISS;
+ }
+ hppa_dynamic_excp(env, excp, GETPC());
+ }
+ return phys;
+}
#endif /* CONFIG_USER_ONLY */