1
0
mirror of https://github.com/open-simh/simh.git synced 2026-01-13 15:27:46 +00:00

PDP10, PDP18B, VAX: Better cosheduling behavior

This commit is contained in:
Bob Supnik 2017-03-20 07:33:04 -07:00 committed by Mark Pizzolato
parent 3165a1b3ab
commit dcc5e098d0
3 changed files with 13 additions and 18 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}