Skip to content

Commit

Permalink
PDP11, all VAX: better manage VH input FIFO empty transition status (…
Browse files Browse the repository at this point in the history
…Ed Marr)
  • Loading branch information
markpizz committed Aug 16, 2018
1 parent 664a2d5 commit c833c93
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions PDP11/pdp11_vh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand 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);
Expand Down

0 comments on commit c833c93

Please sign in to comment.