Fix to properly report device attention when a manual detach operation is performed (from Bob Supnik)

This commit is contained in:
Mark Pizzolato 2012-12-08 14:30:00 -08:00
parent ac8bd2521b
commit cb659d6c83
2 changed files with 6 additions and 1 deletions

View file

@ -1155,6 +1155,7 @@ return SCPE_OK;
t_stat rp_detach (UNIT *uptr)
{
int32 drv;
extern int32 sim_is_running;
if (!(uptr->flags & UNIT_ATT)) /* attached? */
return SCPE_OK;
@ -1167,7 +1168,8 @@ if (sim_is_active (uptr)) { /* unit active? */
if (uptr->FUNC >= FNC_WCHK) /* data transfer? */
rpcs1 = rpcs1 | CS1_DONE | CS1_TRE; /* set done, err */
}
update_rpcs (CS1_SC, drv); /* request intr */
if (!sim_is_running) /* from console? */
update_rpcs (CS1_SC, drv); /* request intr */
return detach_unit (uptr);
}

View file

@ -1390,11 +1390,14 @@ t_stat rp_detach (UNIT *uptr)
{
int32 drv;
DEVICE *dptr = find_dev_from_unit (uptr);
extern int32 sim_is_running;
if (!(uptr->flags & UNIT_ATT)) /* attached? */
return SCPE_OK;
drv = (int32) (uptr - dptr->units); /* get drv number */
rpds[drv] = rpds[drv] & ~(DS_MOL | DS_RDY | DS_WRL | DS_VV | DS_OFM);
if (!sim_is_running) /* from console? */
rp_update_ds (DS_ATA, drv); /* request intr */
return sim_disk_detach (uptr);
}