summaryrefslogtreecommitdiffstats
path: root/target/m68k/helper.c
diff options
context:
space:
mode:
authorLaurent Vivier2019-12-20 18:24:15 +0100
committerLaurent Vivier2020-01-07 14:21:18 +0100
commit18b6102e51bb317d25ee61b49b7b56702b79560c (patch)
tree75d457c50c6af36a4be9c61680cb9e076b01fbb3 /target/m68k/helper.c
parentq800: implement mac rom reset function for BIOS-less mode (diff)
downloadqemu-18b6102e51bb317d25ee61b49b7b56702b79560c.tar.gz
qemu-18b6102e51bb317d25ee61b49b7b56702b79560c.tar.xz
qemu-18b6102e51bb317d25ee61b49b7b56702b79560c.zip
target/m68k: only change valid bits in CACR
This is used by netBSD (and MacOS ROM) to detect the MMU type Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Thomas Huth <huth@tuxfamily.org> Message-Id: <20191220172415.35838-1-laurent@vivier.eu> [lv: add a comment before m680x0_cpu_common()] Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'target/m68k/helper.c')
-rw-r--r--target/m68k/helper.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/target/m68k/helper.c b/target/m68k/helper.c
index ae766a6cb0..baf7729af0 100644
--- a/target/m68k/helper.c
+++ b/target/m68k/helper.c
@@ -203,9 +203,17 @@ void HELPER(m68k_movec_to)(CPUM68KState *env, uint32_t reg, uint32_t val)
case M68K_CR_VBR:
env->vbr = val;
return;
- /* MC680[234]0 */
+ /* MC680[2346]0 */
case M68K_CR_CACR:
- env->cacr = val;
+ if (m68k_feature(env, M68K_FEATURE_M68020)) {
+ env->cacr = val & 0x0000000f;
+ } else if (m68k_feature(env, M68K_FEATURE_M68030)) {
+ env->cacr = val & 0x00003f1f;
+ } else if (m68k_feature(env, M68K_FEATURE_M68040)) {
+ env->cacr = val & 0x80008000;
+ } else if (m68k_feature(env, M68K_FEATURE_M68060)) {
+ env->cacr = val & 0xf8e0e000;
+ }
m68k_switch_sp(env);
return;
/* MC680[34]0 */