1
0
mirror of https://github.com/simh/simh.git synced 2026-02-14 11:55:51 +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

@@ -73,11 +73,8 @@
#include "h316_defs.h"
#include <math.h>
#define UNIT_V_WLK (UNIT_V_UF + 0) /* write locked */
#define UNIT_WLK (1 << UNIT_V_WLK)
#define FNC u3 /* saved function */
#define CYL u4 /* actual cylinder */
#define UNIT_WPRT (UNIT_WLK | UNIT_RO) /* write prot */
#define DP_TRKLEN 2048 /* track length, words */
#define DP_NUMDRV 8 /* max # drives */
#define DP_NUMTYP 3 /* # controller types */
@@ -328,8 +325,10 @@ REG dp_reg[] = {
};
MTAB dp_mod[] = {
{ UNIT_WLK, 0, "write enabled", "WRITEENABLED", NULL },
{ UNIT_WLK, UNIT_WLK, "write locked", "LOCKED", NULL },
{ MTAB_XTD|MTAB_VUN, 0, "write enabled", "WRITEENABLED",
&set_writelock, &show_writelock, NULL, "Write enable drive" },
{ MTAB_XTD|MTAB_VUN, 1, NULL, "LOCKED",
&set_writelock, NULL, NULL, "Write enable drive" },
{ MTAB_XTD | MTAB_VDV, TYPE_4623, NULL, "4623",
&dp_settype, NULL, NULL },
{ MTAB_XTD | MTAB_VDV, TYPE_4651, NULL, "4651",

View File

@@ -155,8 +155,10 @@ REG mt_reg[] = {
};
MTAB mt_mod[] = {
{ MTUF_WLK, 0, "write enabled", "WRITEENABLED", NULL },
{ MTUF_WLK, MTUF_WLK, "write locked", "LOCKED", NULL },
{ MTAB_XTD|MTAB_VUN, 0, "write enabled", "WRITEENABLED",
&set_writelock, &show_writelock, NULL, "Write ring in place" },
{ MTAB_XTD|MTAB_VUN, 1, NULL, "LOCKED",
&set_writelock, NULL, NULL, "no Write ring in place" },
{ MTAB_XTD|MTAB_VUN, 0, "FORMAT", "FORMAT",
&sim_tape_set_fmt, &sim_tape_show_fmt, NULL },
{ MTAB_XTD|MTAB_VUN, 0, "CAPACITY", "CAPACITY",