1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-01-21 02:07:41 +00:00

KI10: Cleanup handling of User to Executive switching.

This commit is contained in:
Richard Cornwell 2016-07-26 23:15:03 -04:00
parent 60c73af808
commit 2abd65700d
2 changed files with 34 additions and 21 deletions

View File

@ -882,8 +882,10 @@ t_stat dev_apr(uint32 dev, uint64 *data) {
nxm_flag = 0;
if (res & 020000)
mem_prot = 0;
if (res & 0200000)
if (res & 0200000) {
reset_all(1);
clk_flg = ov_irq = fov_irq = nxm_flag = mem_prot = push_ovf = 0;
}
if (res & 0400000)
push_ovf = 0;
check_apr_irq();
@ -997,7 +999,7 @@ int page_lookup(int addr, int flag, int *loc, int wr, int cur_context) {
uf = 0;
else if (!uf && !cur_context && ((((xct_flag & 2) != 0 && wr != 0)) ||
((xct_flag & 1) != 0 && (wr == 0 || modify))))
uf = 1;
uf = (FLAGS & USERIO) != 0;
if (uf) {
base = ub_ptr;
@ -1531,6 +1533,12 @@ unasign:
AB |= 4;
Mem_read_nopage();
FLAGS = (MB >> 23) & 017777;
/* If transistioning from user to executive adjust flags */
if ((FLAGS & USER) != 0 && (AB & 4) != 0) {
FLAGS |= USERIO;
if (AB & 2)
FLAGS |= OVR;
}
PC = MB & RMASK;
f_pc_inh = 1;
trap_flag = 0;
@ -1560,7 +1568,7 @@ unasign:
}
#endif
AB = 040;
Mem_write(uuo_cycle, 0);
Mem_write(uuo_cycle, 1);
AB += 1;
f_load_pc = 0;
f_pc_inh = 1;

View File

@ -168,27 +168,32 @@ extern DEBTAB crd_debug[];
#define LRZ(x) (((x) >> 18) & RMASK)
#define NODIV 000001
#define FLTUND 000002
#define NODIV 000001 /* 000040 */
#define FLTUND 000002 /* 000100 */
#if KI|KL
#define TRP1 000004
#define TRP2 000010
#define ADRFLT 000020
//#define PUBLIC 000000
#define PUBLIC 000040
#define TRP1 000004 /* 000200 */
#define TRP2 000010 /* 000400 */
#define ADRFLT 000020 /* 001000 */
#define PUBLIC 000040 /* 002000 */
#else
#define TRP1 000000
#define TRP2 000000
#define ADRFLT 000000
#define PUBLIC 000000
#define TRP1 000000
#define TRP2 000000
#define ADRFLT 000000
#define PUBLIC 000000
#endif
#define USERIO 000100
#define USER 000200
#define BYTI 000400
#define FLTOVR 001000
#define CRY1 002000
#define CRY0 004000
#define OVR 010000
#define USERIO 000100 /* 004000 */
#define USER 000200 /* 010000 */
#define BYTI 000400 /* 020000 */
#ifdef PDP6
#define FLTOVR 000000
#define PCHNG 001000 /* 040000 */
#else
#define FLTOVR 001000 /* 040000 */
#define PCHNG 000000
#endif
#define CRY1 002000 /* 100000 */
#define CRY0 004000 /* 200000 */
#define OVR 010000 /* 400000 */
#define DATAI 00
#define DATAO 01