aboutsummaryrefslogtreecommitdiff
path: root/target/openrisc/sys_helper.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-09-05 09:33:01 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-09-05 09:33:01 +0100
commit500efcfcf0fe2e0dae1d25637a13435ce7b6e421 (patch)
tree3a79d3ae876bc02eea9bd1dbb4e4029fbd4b10d8 /target/openrisc/sys_helper.c
parenta8b5ad8e1faef0d1bb3e550530328e8ec76fe87c (diff)
parent9e3bab08d3e3f5808cc35a59af1912bfb6fe96fd (diff)
downloadqemu-500efcfcf0fe2e0dae1d25637a13435ce7b6e421.zip
qemu-500efcfcf0fe2e0dae1d25637a13435ce7b6e421.tar.gz
qemu-500efcfcf0fe2e0dae1d25637a13435ce7b6e421.tar.bz2
Merge remote-tracking branch 'remotes/rth/tags/pull-or1k-20190904' into staging
Updates for arch v1.3. # gpg: Signature made Wed 04 Sep 2019 21:30:41 BST # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * remotes/rth/tags/pull-or1k-20190904: target/openrisc: Update cpu "any" to v1.3 target/openrisc: Implement l.adrp target/openrisc: Implement move to/from FPCSR target/openrisc: Implement unordered fp comparisons target/openrisc: Add support for ORFPX64A32 target/openrisc: Check CPUCFG_OF32S for float insns target/openrisc: Fix lf.ftoi.s target/openrisc: Add VR2 and AVR special processor registers target/openrisc: Move VR, UPR, DMMCFGR, IMMCFGR to cpu init target/openrisc: Make VR and PPC read-only target/openrisc: Cache R0 in DisasContext target/openrisc: Replace cpu register array with a function target/openrisc: Add DisasContext parameter to check_r0_write Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/openrisc/sys_helper.c')
-rw-r--r--target/openrisc/sys_helper.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/target/openrisc/sys_helper.c b/target/openrisc/sys_helper.c
index 1053409..d9fe6c5 100644
--- a/target/openrisc/sys_helper.c
+++ b/target/openrisc/sys_helper.c
@@ -37,12 +37,10 @@ void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong spr, target_ulong rb)
CPUState *cs = env_cpu(env);
target_ulong mr;
int idx;
+#endif
switch (spr) {
- case TO_SPR(0, 0): /* VR */
- env->vr = rb;
- break;
-
+#ifndef CONFIG_USER_ONLY
case TO_SPR(0, 11): /* EVBAR */
env->evbar = rb;
break;
@@ -62,10 +60,6 @@ void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong spr, target_ulong rb)
cpu_set_sr(env, rb);
break;
- case TO_SPR(0, 18): /* PPC */
- env->ppc = rb;
- break;
-
case TO_SPR(0, 32): /* EPCR */
env->epcr = rb;
break;
@@ -187,10 +181,12 @@ void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong spr, target_ulong rb)
}
cpu_openrisc_timer_update(cpu);
break;
- default:
+#endif
+
+ case TO_SPR(0, 20): /* FPCSR */
+ cpu_set_fpcsr(env, rb);
break;
}
-#endif
}
target_ulong HELPER(mfspr)(CPUOpenRISCState *env, target_ulong rd,
@@ -201,23 +197,31 @@ target_ulong HELPER(mfspr)(CPUOpenRISCState *env, target_ulong rd,
OpenRISCCPU *cpu = env_archcpu(env);
CPUState *cs = env_cpu(env);
int idx;
+#endif
switch (spr) {
+#ifndef CONFIG_USER_ONLY
case TO_SPR(0, 0): /* VR */
- return env->vr & SPR_VR;
+ return env->vr;
case TO_SPR(0, 1): /* UPR */
- return env->upr; /* TT, DM, IM, UP present */
+ return env->upr;
case TO_SPR(0, 2): /* CPUCFGR */
return env->cpucfgr;
case TO_SPR(0, 3): /* DMMUCFGR */
- return env->dmmucfgr; /* 1Way, 64 entries */
+ return env->dmmucfgr;
case TO_SPR(0, 4): /* IMMUCFGR */
return env->immucfgr;
+ case TO_SPR(0, 9): /* VR2 */
+ return env->vr2;
+
+ case TO_SPR(0, 10): /* AVR */
+ return env->avr;
+
case TO_SPR(0, 11): /* EVBAR */
return env->evbar;
@@ -305,11 +309,11 @@ target_ulong HELPER(mfspr)(CPUOpenRISCState *env, target_ulong rd,
case TO_SPR(10, 1): /* TTCR */
cpu_openrisc_count_update(cpu);
return cpu_openrisc_count_get(cpu);
+#endif
- default:
- break;
+ case TO_SPR(0, 20): /* FPCSR */
+ return env->fpcsr;
}
-#endif
/* for rd is passed in, if rd unchanged, just keep it back. */
return rd;