VAX: Avoid potential VAX simulator hangs when code may poll for console input without being interrupted

This commit is contained in:
Mark Pizzolato 2013-11-07 08:02:00 -08:00
parent 5bce9da97c
commit 304ad39a2b
7 changed files with 42 additions and 27 deletions

View file

@ -235,10 +235,12 @@ int32 rxdb_rd (void)
{ {
int32 t = tti_unit.buf; /* char + error */ int32 t = tti_unit.buf; /* char + error */
tti_csr = tti_csr & ~CSR_DONE; /* clr done */ if (tti_csr & CSR_DONE) { /* Input pending ? */
tti_unit.buf = tti_unit.buf & 0377; /* clr errors */ tti_csr = tti_csr & ~CSR_DONE; /* clr done */
CLR_INT (TTI); tti_unit.buf = tti_unit.buf & 0377; /* clr errors */
sim_activate_abs (&tti_unit, tti_unit.wait); /* check soon for more input */ CLR_INT (TTI);
sim_activate_abs (&tti_unit, tti_unit.wait); /* check soon for more input */
}
return t; return t;
} }

View file

@ -211,10 +211,12 @@ int32 rxdb_rd (void)
{ {
int32 t = tti_unit.buf; /* char + error */ int32 t = tti_unit.buf; /* char + error */
tti_csr = tti_csr & ~CSR_DONE; /* clr done */ if (tti_csr & CSR_DONE) { /* Input pending ? */
tti_unit.buf = tti_unit.buf & 0377; /* clr errors */ tti_csr = tti_csr & ~CSR_DONE; /* clr done */
CLR_INT (TTI); tti_unit.buf = tti_unit.buf & 0377; /* clr errors */
sim_activate_abs (&tti_unit, tti_unit.wait); /* check soon for more input */ CLR_INT (TTI);
sim_activate_abs (&tti_unit, tti_unit.wait); /* check soon for more input */
}
return t; return t;
} }

View file

@ -626,10 +626,12 @@ int32 rxdb_rd (void)
{ {
int32 t = tti_buf; /* char + error */ int32 t = tti_buf; /* char + error */
tti_csr = tti_csr & ~CSR_DONE; /* clr done */ if (tti_csr & CSR_DONE) { /* Input pending ? */
tti_buf = tti_buf & BMASK; /* clr errors */ tti_csr = tti_csr & ~CSR_DONE; /* clr done */
tti_int = 0; tti_buf = tti_buf & BMASK; /* clr errors */
sim_activate_abs (&tti_unit, tti_unit.wait); /* check soon for more input */ tti_int = 0;
sim_activate_abs (&tti_unit, tti_unit.wait); /* check soon for more input */
}
return t; return t;
} }

View file

@ -619,10 +619,12 @@ int32 rxdb_rd (void)
{ {
int32 t = tti_buf; /* char + error */ int32 t = tti_buf; /* char + error */
tti_csr = tti_csr & ~CSR_DONE; /* clr done */ if (tti_csr & CSR_DONE) { /* Input pending ? */
tti_buf = tti_buf & BMASK; /* clr errors */ tti_csr = tti_csr & ~CSR_DONE; /* clr done */
tti_int = 0; tti_buf = tti_buf & BMASK; /* clr errors */
sim_activate_abs (&tti_unit, tti_unit.wait); /* check soon for more input */ tti_int = 0;
sim_activate_abs (&tti_unit, tti_unit.wait); /* check soon for more input */
}
return t; return t;
} }

View file

@ -440,10 +440,12 @@ int32 rxdb_rd (void)
{ {
int32 t = tti_buf; /* char + error */ int32 t = tti_buf; /* char + error */
tti_csr = tti_csr & ~CSR_DONE; /* clr done */ if (tti_csr & CSR_DONE) { /* Input pending ? */
tti_buf = tti_buf & BMASK; /* clr errors */ tti_csr = tti_csr & ~CSR_DONE; /* clr done */
tti_int = 0; tti_buf = tti_buf & BMASK; /* clr errors */
sim_activate_abs (&tti_unit, tti_unit.wait); /* check soon for more input */ tti_int = 0;
sim_activate_abs (&tti_unit, tti_unit.wait); /* check soon for more input */
}
return t; return t;
} }

View file

@ -453,9 +453,12 @@ return;
int32 rxdb_rd (void) int32 rxdb_rd (void)
{ {
int32 t = tti_buf; int32 t = tti_buf;
t = t | ((ID_M_LC | ID_M_EMM | ID_M_CT) << RXDB_V_LC); /* char + DTR for hard-wired lines */
tti_csr = tti_csr & ~CSR_DONE; /* clr done */ if (tti_csr & CSR_DONE) { /* Input pending ? */
tti_int = 0; t = t | ((ID_M_LC | ID_M_EMM | ID_M_CT) << RXDB_V_LC);/* char + DTR for hard-wired lines */
tti_csr = tti_csr & ~CSR_DONE; /* clr done */
tti_int = 0;
}
return t; return t;
} }

View file

@ -274,10 +274,12 @@ int32 rxdb_rd (void)
{ {
int32 t = tti_unit.buf; /* char + error */ int32 t = tti_unit.buf; /* char + error */
tti_csr = tti_csr & ~CSR_DONE; /* clr done */ if (tti_csr & CSR_DONE) { /* Input pending ? */
tti_unit.buf = tti_unit.buf & 0377; /* clr errors */ tti_csr = tti_csr & ~CSR_DONE; /* clr done */
CLR_INT (TTI); tti_unit.buf = tti_unit.buf & 0377; /* clr errors */
sim_activate_abs (&tti_unit, tti_unit.wait); /* check soon for more input */ CLR_INT (TTI);
sim_activate_abs (&tti_unit, tti_unit.wait); /* check soon for more input */
}
return t; return t;
} }