1
0
mirror of https://github.com/simh/simh.git synced 2026-01-27 04:22:24 +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

@@ -99,10 +99,10 @@ UNIT ctc_unit = {
};
MTAB ctc_mod[] = {
{ UNIT_WLK, 0, "write enabled", "WRITEENABLED",
NULL, NULL, NULL, "Write enabled tape drive" },
{ UNIT_WLK, UNIT_WLK, "write locked", "LOCKED",
NULL, NULL, NULL, "Write lock tape drive" },
{ MTAB_XTD|MTAB_VUN, 0, "write enabled", "WRITEENABLED",
&set_writelock, &show_writelock, NULL, "Write enable tape drive" },
{ MTAB_XTD|MTAB_VUN, 1, NULL, "LOCKED",
&set_writelock, NULL, NULL, "Write enable tape drive" },
{ MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, "RQUEUE=n", NULL,
NULL, &ctc_show_rqueue, NULL, "Display Request Queue for card n" },
{ MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, "CQUEUE=n", NULL,
@@ -365,7 +365,7 @@ static void ctc_cmd(uint8 cid,
break;
}
if (ctc_unit.flags & UNIT_WLK) {
if (ctc_unit.flags & UNIT_WPRT) {
cqe->opcode = CTC_RDONLY;
break;
}
@@ -489,7 +489,7 @@ static void ctc_cmd(uint8 cid,
break;
}
if (ctc_unit.flags & UNIT_WLK) {
if (ctc_unit.flags & UNIT_WPRT) {
cqe->opcode = CTC_RDONLY;
break;
}

View File

@@ -54,9 +54,6 @@
#include "sim_defs.h"
#include "3b2_io.h"
#define UNIT_V_WLK (DKUF_V_UF + 0) /* Write-locked tape */
#define UNIT_WLK (1 << UNIT_V_WLK)
#define CTC_ID 0x0005
#define CTC_IPL 12
#define CTC_VERSION 1