From dcc5e098d0f4f3485534a7a8658832a143e86957 Mon Sep 17 00:00:00 2001 From: Bob Supnik Date: Mon, 20 Mar 2017 07:33:04 -0700 Subject: [PATCH] PDP10, PDP18B, VAX: Better cosheduling behavior --- PDP10/pdp10_fe.c | 10 ++++------ PDP18B/pdp18b_stddev.c | 14 ++++++-------- VAX/vax_stddev.c | 7 +++---- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/PDP10/pdp10_fe.c b/PDP10/pdp10_fe.c index 4ae17f46..4fe267a4 100644 --- a/PDP10/pdp10_fe.c +++ b/PDP10/pdp10_fe.c @@ -68,7 +68,7 @@ extern DIB *dib_tab[]; #define kaf_unit fe_unit[2] UNIT fe_unit[] = { - { UDATA (&fei_svc, UNIT_IDLE, 0), 0 }, + { UDATA (&fei_svc, UNIT_IDLE, 0), KBD_POLL_WAIT }, { UDATA (&feo_svc, 0, 0), SERIAL_OUT_WAIT }, { UDATA (&kaf_svc, 0, 0), (1*1000*1000) } }; @@ -173,8 +173,7 @@ if (M[FE_CTYOUT] & FE_CVALID) { /* char to print? */ sim_activate (&feo_unit, feo_unit.wait); /* sched completion */ } else if ((M[FE_CTYIN] & FE_CVALID) == 0) { /* input char taken? */ - sim_cancel (&fei_unit); /* sched immediate */ - sim_activate (&fei_unit, 0); /* keyboard poll */ + sim_activate_abs (&fei_unit, 0); /* sched immed kbd poll */ } return; } @@ -196,8 +195,7 @@ t_stat fei_svc (UNIT *uptr) { int32 temp; -sim_activate (uptr, KBD_WAIT (uptr->wait, clk_cosched (tmxr_poll))); - /* continue poll */ +sim_activate (uptr, clk_cosched (tmxr_poll)); /* continue poll */ if ((temp = sim_poll_kbd ()) < SCPE_KFLAG) /* no char or error? */ return temp; if (temp & SCPE_BREAK) /* ignore break */ @@ -304,7 +302,7 @@ M[FE_KEEPA] = INT64_C(0003740000000); /* PARITY STOP, CRM, DP P kaf_unit.u3 = 0; kaf_unit.u4 = 0; apr_flg = apr_flg & ~(APRF_ITC | APRF_CON); -sim_activate (&fei_unit, KBD_WAIT (fei_unit.wait, tmxr_poll)); +sim_activate (&fei_unit, tmxr_poll); sim_activate_after (&kaf_unit, kaf_unit.wait); return SCPE_OK; } diff --git a/PDP18B/pdp18b_stddev.c b/PDP18B/pdp18b_stddev.c index bd5001a4..f73c2c57 100644 --- a/PDP18B/pdp18b_stddev.c +++ b/PDP18B/pdp18b_stddev.c @@ -319,7 +319,7 @@ DEVICE ptp_dev = { DIB tti_dib = { DEV_TTI, 1, &tti_iors, { &tti } }; -UNIT tti_unit = { UDATA (&tti_svc, UNIT_IDLE+TT_MODE_KSR+TTUF_HDX, 0), 0 }; +UNIT tti_unit = { UDATA (&tti_svc, UNIT_IDLE+TT_MODE_KSR+TTUF_HDX, 0), KBD_POLL_WAIT }; REG tti_reg[] = { { ORDATA (BUF, tti_unit.buf, TTI_WIDTH) }, @@ -332,7 +332,7 @@ REG tti_reg[] = { { FLDATA (FDPX, tti_fdpx, 0) }, #endif { DRDATA (POS, tti_unit.pos, T_ADDR_W), PV_LEFT }, - { DRDATA (TIME, tti_unit.wait, 24), PV_LEFT }, + { DRDATA (TIME, tti_unit.wait, 24), PV_LEFT+REG_NZ }, { NULL } }; @@ -667,7 +667,7 @@ ptr_err = 0; /* attach clrs error */ ptr_unit.flags = ptr_unit.flags & ~(UNIT_RASCII|UNIT_KASCII); if (sim_switches & SWMASK ('A')) ptr_unit.flags = ptr_unit.flags | UNIT_RASCII; -if (sim_switches & SWMASK ('K')) +else if (sim_switches & SWMASK ('K')) ptr_unit.flags = ptr_unit.flags | UNIT_KASCII; return SCPE_OK; } @@ -1027,8 +1027,7 @@ t_stat tti_svc (UNIT *uptr) #if defined (KSR28) /* Baudot... */ int32 in, c, out; -sim_activate (uptr, KBD_WAIT (uptr->wait, clk_cosched (tmxr_poll))); - /* continue poll */ +sim_activate (uptr, clk_cosched (tmxr_poll)); /* continue poll */ if (tti_2nd) { /* char waiting? */ uptr->buf = tti_2nd; /* return char */ tti_2nd = 0; /* not waiting */ @@ -1063,8 +1062,7 @@ else { #else /* ASCII... */ int32 c, out; -sim_activate (uptr, KBD_WAIT (uptr->wait, clk_cosched (tmxr_poll))); - /* continue poll */ +sim_activate (uptr, clk_cosched (tmxr_poll)); /* continue poll */ if ((c = sim_poll_kbd ()) < SCPE_KFLAG) /* no char or error? */ return c; out = c & 0177; /* mask echo to 7b */ @@ -1110,7 +1108,7 @@ if (!sim_is_running) { /* RESET (not CAF)? */ tty_shift = 0; /* clear state */ tti_fdpx = 0; /* clear dpx mode */ } -sim_activate (&tti_unit, KBD_WAIT (tti_unit.wait, tmxr_poll)); +sim_activate (&tti_unit, tmxr_poll); return SCPE_OK; } diff --git a/VAX/vax_stddev.c b/VAX/vax_stddev.c index ec9f831e..1ce326e7 100644 --- a/VAX/vax_stddev.c +++ b/VAX/vax_stddev.c @@ -102,7 +102,7 @@ REG tti_reg[] = { { FLDATA (DONE, tti_csr, CSR_V_DONE) }, { FLDATA (IE, tti_csr, CSR_V_IE) }, { DRDATA (POS, tti_unit.pos, T_ADDR_W), PV_LEFT }, - { DRDATA (TIME, tti_unit.wait, 24), PV_LEFT }, + { DRDATA (TIME, tti_unit.wait, 24), PV_LEFT + REG_NZ }, { NULL } }; @@ -294,8 +294,7 @@ t_stat tti_svc (UNIT *uptr) { int32 c; -sim_activate (uptr, KBD_WAIT (uptr->wait, clk_cosched (tmr_poll))); - /* continue poll */ +sim_activate (uptr, clk_cosched (tmr_poll)); /* continue poll */ if ((c = sim_poll_kbd ()) < SCPE_KFLAG) /* no char or error? */ return c; if (c & SCPE_BREAK) { /* break? */ @@ -316,7 +315,7 @@ t_stat tti_reset (DEVICE *dptr) tti_unit.buf = 0; tti_csr = 0; CLR_INT (TTI); -sim_activate (&tti_unit, KBD_WAIT (tti_unit.wait, tmr_poll)); +sim_activate (&tti_unit, tmr_poll); return SCPE_OK; }