From c833c933ed7c362d214875d02cb32e8b3ab3d62e Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Thu, 16 Aug 2018 15:30:39 -0700 Subject: [PATCH] PDP11, all VAX: better manage VH input FIFO empty transition status (Ed Marr) --- PDP11/pdp11_vh.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PDP11/pdp11_vh.c b/PDP11/pdp11_vh.c index 060c3c5b..a4541150 100644 --- a/PDP11/pdp11_vh.c +++ b/PDP11/pdp11_vh.c @@ -779,10 +779,9 @@ static int32 fifo_get ( int32 vh ) { int32 data, i; - if (rbuf_idx[vh] == 0) { - vh_csr[vh] &= ~CSR_RX_DATA_AVAIL; + if (rbuf_idx[vh] == 0) return (0); - } + /* pick off the first character, mark valid */ data = vh_rbuf[vh][0] | RBUF_DATA_VALID; /* move the remainder up */ @@ -815,6 +814,10 @@ static int32 fifo_get ( int32 vh ) } } } + + if (rbuf_idx[vh] == 0) /* FIFO just became empty? */ + vh_csr[vh] &= ~CSR_RX_DATA_AVAIL; /* clear CSR bit ti indicate this */ + /* Reschedule the next poll preceisely so that the programmed input speed is observed. */ sim_clock_coschedule_abs (vh_poll_unit, tmxr_poll);