1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-01-14 23:54:34 +00:00

KA10: Fixed coverity bugs with UBA, fixed 1Proceed on KS10 ITS

This commit is contained in:
Richard Cornwell 2022-01-09 00:14:22 -05:00
parent 41eacc25ac
commit 004a39865a
2 changed files with 49 additions and 18 deletions

View File

@ -343,6 +343,7 @@ uba_clr_irq(DIB *idev)
int pi;
int i;
int j;
int lvl;
int high = 0;
if (ubm < 0)
@ -363,10 +364,10 @@ uba_clr_irq(DIB *idev)
/* If device is pending on this level save */
if (dibp->uba_ctl == idev->uba_ctl &&
dibp->uba_irq_pend != 0) {
pi = 0;
for (j = 0200; j != 0; j>>=2, pi++) {
lvl = 0;
for (j = 0200; j != 0; j>>=2) {
/* At least one, no need to continue */
if ((dibp->uba_irq_pend & (0200 >> pi)) != 0) {
if ((dibp->uba_irq_pend & (0200 >> j)) != 0) {
set_interrupt(dibp->uba_ctl<<2, pi);
return;
}

View File

@ -4405,20 +4405,26 @@ fetch:
AB = (t_addr)fe_xct;
fe_xct = 0;
}
#if KS_ITS
if (QITS && pi_cycle == 0 && (FLAGS & ADRFLT) != 0) {
one_p_arm = 1;
FLAGS &= ~ADRFLT;
}
#endif
if (Mem_read(pi_cycle | uuo_cycle, 1, 1, 0)) {
#endif
if (Mem_read(pi_cycle | uuo_cycle, 1, 1, 0)) {
#if KA | PDP6
pi_rq = check_irq_level();
if (pi_rq)
goto st_pi;
pi_rq = check_irq_level();
if (pi_rq)
goto st_pi;
#endif
#if KL
/* Handling for PUBLIC violation */
if (((fault_data >> 30) & 037) == 021)
PC = (PC + 1) & RMASK;
/* Handling for PUBLIC violation */
if (((fault_data >> 30) & 037) == 021)
PC = (PC + 1) & RMASK;
#endif
goto last;
}
goto last;
}
no_fetch:
IR = (MB >> 27) & 0777;
@ -4435,13 +4441,9 @@ no_fetch:
/* Handle page fault and traps */
if (page_enable && trap_flag == 0 && (FLAGS & (TRP1|TRP2))) {
if (FLAGS & ADRFLT) {
#if KL_ITS
#if KL_ITS
if (QITS && (FLAGS & (TRP1|TRP2|ADRFLT)) == (TRP1|TRP2|ADRFLT))
one_p_arm = 1;
#endif
#if KS_ITS
if (QITS)
one_p_arm = 1;
#endif
FLAGS &= ~ADRFLT;
} else {
@ -6436,7 +6438,7 @@ ldb_ptr:
f_load_pc = 0;
f_inst_fetch = 0;
f_pc_inh = 1;
#if KL_ITS | KS_ITS
#if KL_ITS
if (QITS && one_p_arm) {
FLAGS |= ADRFLT;
one_p_arm = 0;
@ -11940,6 +11942,7 @@ fprintf(stderr, "PIH = %03o\n\r", PIH);
}
#endif
#if KI | KL | KS
if (!f_pc_inh && (trap_flag == 0) && !pi_cycle) {
FLAGS &= ~ADRFLT;
@ -11950,6 +11953,7 @@ fprintf(stderr, "PIH = %03o\n\r", PIH);
}
#if ITS
/* Handle 1 proceed for KA ITS */
if (QITS && one_p_arm && (FLAGS & BYTI) == 0) {
fault_data |= 02000;
mem_prot = 1;
@ -11958,6 +11962,32 @@ fprintf(stderr, "PIH = %03o\n\r", PIH);
}
#endif
#if KS_ITS
/* Handle 1 proceed for KS ITS */
if (QITS && one_p_arm && (FLAGS & BYTI) == 0) {
modify = 0;
extend = 0;
one_p_arm = 0;
AB = ub_ptr + 0432;
/* Save flags */
MB = (((uint64)(FLAGS) << 23) & LMASK) | (PC & RMASK);
Mem_write_nopage();
/* Read in new PC and flags */
AB ++;
f = 0;
if (FLAGS & USER)
f = 1;
Mem_read_nopage();
FLAGS = (MB >> 23) & 017777;
/* If transistioning from user to executive adjust flags */
if ((FLAGS & USER) == 0 && f) {
FLAGS |= USERIO;
}
PC = MB & RMASK;
}
#endif
/* Dismiss an interrupt */
if (pi_cycle) {
#if KI | KL | KS