PDP11, VAX: Fix RQ and TQ Get Unit Status to properly report no more units

As reported in #592
This commit is contained in:
Mark Pizzolato 2018-06-24 03:21:22 -07:00
parent 4f61cd3a11
commit 8c0439feaa
2 changed files with 12 additions and 4 deletions

View file

@ -813,6 +813,7 @@ typedef struct {
struct uq_ring cq; /* cmd ring */
struct uq_ring rq; /* rsp ring */
struct rqpkt pak[RQ_NPKTS]; /* packet queue */
uint16 max_plug; /* highest unit plug number */
} MSC;
/* debugging bitmaps */
@ -1798,7 +1799,7 @@ UNIT *uptr;
sim_debug (DBG_TRC, rq_devmap[cp->cnum], "rq_gus\n");
if (cp->pak[pkt].d[CMD_MOD] & MD_NXU) { /* next unit? */
if (lu == 65535) { /* end of range? */
if (lu > cp->max_plug) { /* beyond last unit plug? */
lu = 0; /* reset to 0 */
cp->pak[pkt].d[RSP_UN] = lu;
}
@ -3006,6 +3007,9 @@ for (i = 0; i < (RQ_NUMDR + 2); i++) { /* init units */
if (uptr->rqxb == NULL)
return SCPE_MEM;
}
for (i=cp->max_plug=0; i<RQ_NUMDR; i++)
if (dptr->units[i].unit_plug > cp->max_plug)
cp->max_plug = (uint16)dptr->units[i].unit_plug;
return auto_config (0, 0); /* run autoconfig */
}

View file

@ -256,8 +256,9 @@ uint32 tq_pip = 0; /* poll in progress */
struct uq_ring tq_cq = { 0 }; /* cmd ring */
struct uq_ring tq_rq = { 0 }; /* rsp ring */
struct tqpkt tq_pkt[TQ_NPKTS]; /* packet queue */
uint16 tq_freq = 0; /* free list */
uint16 tq_rspq = 0; /* resp list */
uint16 tq_freq = 0; /* free list */
uint16 tq_rspq = 0; /* resp list */
uint16 tq_max_plug; /* highest unit plug number */
uint32 tq_pbsy = 0; /* #busy pkts */
uint32 tq_credits = 0; /* credits */
uint32 tq_hat = 0; /* host timer */
@ -1019,7 +1020,7 @@ UNIT *uptr;
sim_debug(DBG_TRC, &tq_dev, "tq_gus\n");
if (tq_pkt[pkt].d[CMD_MOD] & MD_NXU) { /* next unit? */
if (lu == 65535) { /* end of range? */
if (lu > tq_max_plug) { /* beyond last unit plug? */
lu = 0; /* reset to 0 */
tq_pkt[pkt].d[RSP_UN] = (uint16)lu;
}
@ -2068,6 +2069,9 @@ int32 i, j;
UNIT *uptr;
static t_bool plugs_inited = FALSE;
for (i=tq_max_plug=0; i<TQ_NUMDR; i++)
if (dptr->units[i].unit_plug > tq_max_plug)
tq_max_plug = (uint16)dptr->units[i].unit_plug;
if (!plugs_inited ) {
uint32 d;
char uname[16];