From 2daa41ecb3ba9254bb01940dc80d6430aaef3d00 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 6 Dec 2013 10:54:56 -0800 Subject: [PATCH] PDP11: Fixed bug in CSM (John Dundas) John Dundas said: Bob and all, I ran across what I believe to be a bug in the CSM code: case 070: /* CSM */ if (CPUT (HAS_CSM) && (MMR3 & MMR3_CSM) || (cm != MD_KER)) { According to the Architecture Handbook, CSM may be executed only if the MMR3 bit is set AND the mode is not Kernel. Changing the code to: case 070: /* CSM */ if (CPUT (HAS_CSM) && (MMR3 & MMR3_CSM) && (cm != MD_KER)) { also has the effect of making the ZKDKB0 diagnostic much happier. Thanks, John -- John A. Dundas III --- PDP11/pdp11_cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PDP11/pdp11_cpu.c b/PDP11/pdp11_cpu.c index 51299de7..b0e6ae4e 100644 --- a/PDP11/pdp11_cpu.c +++ b/PDP11/pdp11_cpu.c @@ -25,6 +25,7 @@ cpu PDP-11 CPU + 05-Dec-13 RMS Fixed bug in CSM (John Dundas) 23-Oct-13 RMS Fixed PS behavior on initialization and boot 10-Apr-13 RMS MMR1 does not track PC changes (Johnny Billquist) 29-Apr-12 RMS Fixed compiler warning (Mark Pizzolato) @@ -1298,7 +1299,7 @@ while (reason == 0) { break; case 070: /* CSM */ - if ((CPUT (HAS_CSM) && (MMR3 & MMR3_CSM)) || (cm != MD_KER)) { + if (CPUT (HAS_CSM) && (MMR3 & MMR3_CSM) && (cm != MD_KER)) { dst = dstreg? R[dstspec]: ReadW (GeteaW (dstspec)); PSW = get_PSW () & ~PSW_CC; /* PSW, cc = 0 */ STACKFILE[cm] = SP;