1
0
mirror of https://github.com/simh/simh.git synced 2026-02-09 17:52:36 +00:00

ALL: Standardize writelock behavior adding global UNIT_WLK & UNIT_WPRT

Historically this functionality was reimplemented within each
DEVICE simulator often with slightly different implementations
and inconsistencies.  Solving this globally within SCP required
changes in many places, but should henceforth be reasonably
managed.

As discussed in #1034
This commit is contained in:
Mark Pizzolato
2021-04-19 10:58:51 -07:00
parent 587b81bed4
commit a015e44c10
81 changed files with 413 additions and 467 deletions

View File

@@ -1578,6 +1578,9 @@ bus->dev[id] = uptr;
void scsi_set_unit (SCSI_BUS *bus, UNIT *uptr, SCSI_DEV *dev)
{
uptr->up7 = (void *)dev;
if (dev->devtype == SCSI_CDROM)
set_writelock (uptr, 1, NULL, NULL);
}
/* Reset a unit */
@@ -1677,14 +1680,18 @@ switch (dev->devtype) {
t_stat scsi_set_wlk (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{
return SCPE_OK;
SCSI_DEV *dev = (SCSI_DEV *)uptr->up7;
if ((dev->devtype == SCSI_CDROM) && (val == 0))
return sim_messagef (SCPE_ARG, "%s: Can't write enable CDROM device\n", sim_uname (uptr));
return set_writelock (uptr, val, cptr, desc);
}
/* Show write lock status */
t_stat scsi_show_wlk (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{
return SCPE_OK;
return show_writelock (st, uptr, val, desc);
}
/* Attach device */