Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99r-bb - devprm.x24
There are no other files named devprm.x24 in the archive.
UNIVERSAL DEVPRM - DEVICE PARAMETERS FOR TOPS-10	V052
SUBTTL	D. MASTROVITO /DPM	02-AUGUST-89

	SEARCH	F,S
	SALL			;CLEAN LISTINGS
	.DIRECT	FLBLST		;CLEANER LISTINGS

;THIS FILE CONTAINS DEVICE PARAMETER DEFINITIONS AND DATA STRUCTURES.

;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED
;  OR COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1986,1988.
;ALL RIGHTS RESERVED.

.CPYRT<1986,1988>,.


	XP	VDEVPR,052	;DEVPRM VERSION NUMBER
SUBTTL	DEVICE CODE DEFINITIONS


	FSTICD==:540		;FIRST INTERNAL CHANNEL DEVICE CODE
	LSTICD==:574		;LAST INTERNAL CHANNEL DEVICE CODE



;IN THE IDEAL WORLD IT WOULD BE POSSIBLE TO INSTALL THE NIA20  OR  CI20
;IN  EITHER  OF  THE  MODIFIED  INTERNAL CHANNEL BACKPLANE SLOTS IN THE
;KL-10.  UNFORTUNATELY, THERE IS NO EASY WAY TO TELL THE TWO  TYPES  OF
;DEVICES   APART.    THOSE  WHO  ARE  FOOLISH  ENOUGH  TO  BELIEVE  THE
;DOCUMENTATION MIGHT DISAGREE, BUT THE  ENGINEERS  NEVER  STRAPPED  THE
;NIA20   AND   CI20  TO  RETURN  DIFFERENT  PORT  TYPE  FIELDS  AS  THE
;DOCUMENTATION LEADS ONE TO BELIEVE.  FOR THIS REASON, THE SOFTWARE  IN
;TOPS-10  HAS  BEEN  WRITTEN  TO  ASSUME  THE  NIA20 CAN ONLY APPEAR AS
;INTERNAL CHANNEL NUMBER 5, AND THE CI20 CAN ONLY  APPEAR  AS  INTERNAL
;CHANNEL NUMBER 7.
SUBTTL	RH20 CHANNEL DEFINITIONS -- CONI


	CI.DBP==:1B18		;DATA BUS PARITY ERROR
	CI.EXC==:1B19		;EXCEPTION
	CI.LWC==:1B20		;LONG WORD COUNT
	CI.SWC==:1B21		;SHORT WORD COUNT
	CI.CER==:1B22		;CHANNEL ERROR
	CI.DRE==:1B23		;DRIVE RESPONSE ERROR
	CI.RAE==:1B24		;REGISTER ACCESS ERROR
	CI.RDY==:1B25		;CHANNEL READY
	CI.OVR==:1B26		;DATA OVERRUN
	CI.MBE==:1B27		;MASSBUS ENABLE
	CI.ATN==:1B28		;ATTENTION
	CI.SCR==:1B29		;SCR FULL
	CI.AIE==:1B30		;ATTENTION INTERRUPT ENABLE
	CI.BSY==:1B31		;PCR FULL (BUSY)
	CI.DON==:1B32		;COMMAND DONE
	CI.PIA==:7B35		;PI ASSIGNMENT
SUBTTL	RH20 CHANNEL DEFINITIONS -- CONO


	CO.RAE==:1B24		;CLEAR REGISTER ACCESS ERROR
	CO.MBI==:1B25		;MASSBUS INIT
	CO.TEC==:1B26		;TRANSFER ERROR CLEAR
	CO.MBE==:1B27		;MASSBUS ENABLE
	CO.RCP==:1B28		;RESET COMMAND LIST POINTER
	CO.SCR==:1B29		;DELETE SCR
	CO.AIE==:1B30		;ATTENTION INTERRUPT ENABLE
	CO.STP==:1B31		;STOP TRANSFER
	CO.CCD==:1B32		;CLEAR COMMAND DONE
	CO.PIA==:7B35		;PI ASSIGNMENT
SUBTTL	RH20 CHANNEL DEFINITIONS -- DATAI REGISTER


;FIELDS COMMON TO ALL DATAI OPERATIONS

	   DI.REG==:77B5	   ;REGISTER SELECT FIELD
	   DI.LDR==:1B6		   ;LOAD REGISTER
	   DI.DRV==:7B17	   ;DRIVE SELECT FIELD


;REGISTER AND REGISTER SPECIFIC BIT DEFINITIONS.  NOTE THAT BIT
;DEFINITIONS FOR .DIPBA AND .DIPTC ARE THE SAME AS THOSE FOR
;.DISBA AND .DISTC RESPECTIVELY.

	.DISBA==:70B5		;SECONDARY BLOCK ADDRESS REGISTER
	   DI.BAD==:177777B35	   ;BLOCK ADDRESS/FRAME COUNT

	.DISTC==:71B5		;SECONDARY TRANSFER CONTROL REGISTER
	   DI.RCP==:1B7		   ;RESET COMMAND LIST POINTER
	   DI.SCS==:1B10	   ;STORE CHANNEL STATUS
	   DI.DTE==:1B19	   ;DISABLE TRANSFER ERROR STOP
	   DI.CNT==:1777B29	   ;NEGATIVE BLOCK COUNT
	   DI.FNC==:77B35	   ;MASSBUS FUNCTION CODE

	.DIPBA==:72B5		;PRIMARY BLOCK ADDRESS REGISTER

	.DIPTC==:73B5		;PRIMARY TRANSFER CONTROLER REGISTER

	.DIIVI==:74B5		;INTERRUPT VECTOR INDEX REGISTER
	   DI.IVI==:777B35	   ;INTERRUPT VECTOR ADDRESS


;BITS APPLICABLE ONLY TO EXTERNAL REGISTERS

	   DI.CPE==:1B8	 	   ;CONTROL BUS PARITY ERROR
	   DI.TRA==:1B10	   ;TRANSFER RECEIVED
	   DI.CPA==:1B19	   ;CONTROL BUS PARITY BIT
	   DI.ERD==:177777B35	   ;EXTERNAL REGISTER DATA
SUBTTL	RH20 CHANNEL DEFINITIONS -- DATAO REGISTER


;FIELDS COMMON TO ALL DATAO OPERATIONS

	   DO.REG==:77B5	   ;REGISTER SELECT FIELD
	   DO.LDR==:1B6		   ;LOAD REGISTER
	   DO.DRE==:1B9		   ;DISABLE REGISTER ACCESS ERROR
	   DO.DRV==:7B17	   ;DRIVE SELECT FIELD


;REGISTER AND REGISTER SPECIFIC BIT DEFINITIONS.  NOTE THAT THE BIT
;DEFINITIONS FOR .DOPBA AND .DOPTC ARE THE SAME AS THOSE FOR
;.DOSBA AND .DOSTC RESPECTIVELY.

	.DOSBA==:70B5		;SECONDARY BLOCK ADDRESS REGISTER
	   DO.BAD==:177777B35	   ;BLOCK ADDRESS/FRAME COUNT

	.DOSTC==:71B5		;SECONDARY TRANSFER CONTROL REGISTER
	   DO.RCP==:1B7		   ;RESET COMMAND LIST POINTER
	   DO.SCS==:1B10	   ;STORE CHANNEL STATUS
	   DO.DTE==:1B19	   ;DISABLE TRANSFER ERROR STOP
	   DO.CNT==:1777B29	   ;NEGATIVE BLOCK COUNT
	   DO.FNC==:77B35	   ;MASSBUS FUNCTION CODE

	.DOPBA==:72B5		;PRIMARY BLOCK ADDRESS REGISTER

	.DOPTC==:73B5		;PRIMARY TRANSFER CONTROLER REGISTER

	.DOIVI==:74B5		;INTERRUPT VECTOR INDEX REGISTER
	   DO.IVI==:777B35	   ;INTERRUPT VECTOR ADDRESS


;BITS APPLICABLE ONLY TO EXTERNAL REGISTERS

	   DO.CEP==:1B18	   ;CONTROL BUS EVEN PARITY
	   DO.ERD==:177777B35	   ;EXTERNAL REGISTER DATA
SUBTTL	RH20 CHANNEL DEFINITIONS -- EXTERNAL REGISTERS


;THE FOLLOWING EXTERNAL REGISTER DEFINITIONS ARE THE ONES MOST
;COMMONLY USED.  IT IS NOT INTENDED TO BE AN EXHAUSTIVE LIST OF
;EXTERNAL REGISTERS.

	.DICTR==:0B5		;CONTROL REGISTER
	.DISTR==:1B5		;STATUS REGISTER
	.DIERR==:2B5		;ERROR REGISTER
	.DIMTR==:3B5		;MAINTENANCE REGISTER
	.DIASR==:4B5		;ATTENTION SUMMARY REGISTER
	.DIDAR==:5B5		;DESIRED ADDRESS REGISTER
	.DIDTR==:6B5		;DRIVE TYPE REGISTER
	.DILAR==:7B5		;LOOK AHEAD REGISTER
	.DISNR==:10B5		;SERIAL NUMBER REGISTER
	.DIOFS==:11B5		;OFFSET REGISTER
	.DIDCR==:12B5		;DESIRED CYLINDER REGISTER
	.DICCR==:13B5		;CURRENT CYLINDER ADDRESS REGISTER
	.DIER2==:14B5		;SECOND ERROR REGISTER
	.DIER3==:15B5		;THIRD ERROR REGISTER
	.DIEPR==:16B5		;ECC POSITION REGISTER
	.DIEBR==:17B5		;ECC BURST (PATTERN) REGISTER
SUBTTL	IPA CHANNEL DEFINITIONS -- CONI

	CI.PPT==:1B0		;PORT PRESENT
	CI.CPE==:1B6		;CRAM PARITY ERROR
	CI.MER==:1B7		;MBUS ERROR
	CI.IDL==:1B11		;IDLE
	CI.DCP==:1B12		;DISABLE COMPLETE
	CI.ECP==:1B13		;ENABLE COMPLETE
	CI.TYP==:7B17		;PORT TYPE
	   .CIKNI==:1		   ;NIA20 (KLNI)
	   .CIKLP==:2		   ;CI20 (KLIPA)
	CI.EPE==:1B24		;EBUS PARITY ERROR
	CI.FQE==:1B25		;FREE QUEUE ERROR
	CI.DPE==:1B26		;DATA PATH ERROR
	CI.RQA==:1B28		;RESPONSE QUEUE AVAILABLE
	CI.ENA==:1B31		;ENABLED
	CI.MRN==:1B32		;MICRO-PROCESSOR RUNNING
	CI.PIA==:7B35		;PRIORITY INTERRUPT ASSIGNMENT
SUBTTL	IPA CHANNEL DEFINITIONS -- CONO


	CO.CPT==:1B18		;CLEAR PORT
	CO.DTE==:1B19		;DIAGNOSTIC_TEST_EBUS
	CO.LAR==:1B21		;SELECT LATCHED ADDRESS REGISTER
	CO.EPE==:1B24		;CLEAR EBUS PARITY ERROR
	CO.FQE==:1B25		;CLEAR FREE QUEUE ERROR
	CO.CQA==:1B27		;SET COMMAND QUEUE AVAILABLE
	CO.RQA==:1B28		;CLEAR RESPONSE QUEUE AVAILABLE
	CO.DIS==:1B30		;DISABLE
	CO.ENA==:1B31		;ENABLE
	CO.MRN==:1B32		;MICRO-PROCESSOR RUN
	CO.PIA==:7B35		;PRIORITY INTERRUPT ASSIGNMENT
SUBTTL	IPA CHANNEL DEFINITIONS -- DATAI/DATAO REGISTER


;DATAO REGISTER AND REGISTER SPECIFIC BIT DEFINITIONS.

	.DOLRA==:40B5		;LOAD RAM ADDRESS REGISTER
	   DO.RAR==:7777B12	   ;RAM ADDRESS REGISTER CONTENTS
	   DO.LHW==:1B13	   ;SELECT LEFT HALF CRAM MICRO-WORD

;COMMON TO DATAI/DATAO

	   DT.LAR==:7777B12	   ;LATCHED ADDRESS REGISTER CONTENTS
	   DT.CRM==:7777777777B35  ;CRAM HALF-WORD CONTENTS
SUBTTL	IPA CHANNEL DEFINITIONS -- MICROCODE


;CRAM ADDRESS DEFINITIONS

	MAXCRA==:7777		;MAXIMUM CRAM ADDRESS
	MAXDRA==:1777		;MAXIMUM DRAM ADDRESS
	PPEFST==:7750		;ADDRESS OF FIRST PLANNED CRAM PARITY ERROR
	PPELST==:7777		;ADDRESS OF LAST PLANNED CRAM PARITY ERROR
	CRMSIZ==:MAXCRA+1	;SIZE OF CRAM
	DRMSIZ==:MAXDRA+1	;SIZE OF DRAM
SUBTTL	CHANNEL LOGOUT AREA DEFINITIONS


	.CSICW==:0		;INITIAL CONTROL WORD
	   CC.OPC==:7B2		   ;OPCODE
	      .CCHLT==:0	      ;HALT
	      .CCJMP==:2	      ;JUMP
	      .CCFDT==:4	      ;FORWARD DATA TRANSFER (DO NOT HALT)
	      .CCRDT==:5	      ;REVERSE DATA TRANSFER (DO NOT HALT)
	      .CCFTH==:6	      ;FORWARD DATA TRANSFER (HALT)
	      .CCRTH==:7	      ;REVERSE DATA TRANSFER (HALT)
	   CC.XFR==:4B2		   ;DATA TRANSFER IF SET
	   CC.HLT==:2B2		   ;HALT BIT FOR DATA TRANSFERS
	   CC.REV==:1B2		   ;REVERSE BIT FOR DATA TRANSFERS
	   CC.WDC==:3777B13	   ;WORD COUNT
	   CC.ADR==:17777777B35	   ;ADDRESS

	.CSCLP==:1		;STATUS/COMMAND LIST POINTER
	   CS.MPE==:1B1		   ;MEMORY PARITY ERROR
	   CS.NAE==:1B2		   ;NOT ADDRESS PARITY ERROR
	   CS.NW0==:1B3		   ;NOT WORD COUNT = 0
	   CS.NXM==:1B4		   ;NXM
	   CS.LTE==:1B9		   ;LAST TRANSFER ERROR
	   CS.RHE==:1B10	   ;RH20 ERROR
	   CS.LWC==:1B11	   ;LONG WORD COUNT
	   CS.SWC==:1B12	   ;SHORT WORD COUNT
	   CS.OVR==:1B13	   ;OVERRUN
	   CS.CLP==:17777777B35	   ;CURRENT COMMAND LIST POINTER

	.CSDBA==:2		;CURRENT CCW
	   CS.COP==:7B2		   ;CURRENT CCW OPCODE
	   CS.CWC==:3777B13	   ;CURRENT CCW WORD COUNT
	   CS.DBA==:17777777B35	   ;CURRENT DATA BUFFER ADDRESS

	.CSIVI==:3		;INTERRUPT VECTOR INSTRUCTION
SUBTTL	RH11 CHANNEL DEFINITIONS -- REGISTER OFFSETS


	.DOCR==:00		;CONTROL REGISTER
	.DOWC==:02		;WORD COUNT REGISTER
	.DOBA==:04		;BUS ADDRESS REGISTER
	.DODA==:06		;DESIRED ADDRESS (TRACK/SECTOR/FRAME)
	.DOCS2==:10		;STATUS REGISTER
	.DOSR==:12		;DRIVE STATUS REGISTER
	.DOER==:14		;ERROR REGISTER 1
	.DOAS==:16		;ATTENTION SUMMARY
	.DOLA==:20		;LOOK-AHEAD (SECTOR COUNTER/CHECK CHARACTER)
	.DODB==:22		;DATA BUFFER
	.DOMR==:24		;MAINTENANCE REGISTER 1
	.DODT==:26		;DRIVE TYPE
	.DOSN==:30		;SERIAL NUMBER
	.DOUC==:32		;UNIT CONTROL (HEAD OFFSET/TAPE FORMAT)
	.DODC==:34		;DESIRED CYLINDER
	.DOCC==:36		;CURRENT CYLINDER
	.DOER2==:40		;ERROR REGISTER 2
	.DOER3==:42		;ERROR REGISTER 3
	.DOEC1==:44		;ECC REGISTER 1
	.DOEC2==:46		;ECC REGISTER 2
SUBTTL	RH11 CHANNEL DEFINITIONS -- STATUS REGISTER


	CS.DLT==:1B20		;DATA LATE (OVERRUN)
	CS.WCE==:1B21		;WRITE CHECK ERROR
	CS.UPE==:1B22		;UNIBUS PARITY ERROR
	CS.NXD==:1B23		;NON-EXISTANT DRIVE
	CS.NEX==:1B24		;NON-EXISTANT MEMORY
	CS.PGE==:1B25		;PROGRAM ERROR
	CS.MXF==:1B26		;MISSED TRANSFER
	CS.DPE==:1B27		;DATA BUS PARITY ERROR
	CS.OR==: 1B28		;OUTPUT READY
	CS.IR==: 1B29		;INPUT READY
	CS.CLR==:1B30		;CONTROLLER CLEAR
	CS.PAT==:1B31		;PARITY TEST
	CS.BAI==:1B32		;UNIBUS ADDRESS INCREMENT INHIBIT
	CS.UNI==:7B35		;UNIT SELECT
SUBTTL	RH11 CHANNEL DEFINITIONS -- CONTROL REGISTER


	CR.SC==: 1B20		;SPECIAL CONDITION (ALL ERRORS)
	CR.TRE==:1B21		;TRANSFER ERROR
	CR.CPE==:1B22		;MASSBUS CONTROL BUS PARITY ERROR
	CR.DVA==:1B24		;DRIVE AVAILABLE
	CR.PSL==:1B25		;PORT SELECT
	CR.A17==:1B26		;ADDRESS 17
	CR.A16==:1B27		;ADDRESS 16
	CR.RDY==:1B28		;READY
	CR.IE==: 1B29		;INTERRUPT ENABLED
	CR.FNC==:37B34		;FUNCTION CODE
	CR.GO==: 1B35		;GO
SUBTTL	RH11 CHANNEL DEFINITIONS -- DRIVE STATUS REGISTER


	DS.ATA==:1B20		;ATTENTION ACTIVE
	DS.ERR==:1B21		;COMPOSITE ERROR
	DS.PIP==:1B22		;POSITION IN PROGRESS
	DS.MOL==:1B23		;MEDIUM ON LINE
	DS.WRL==:1B24		;WRITE LOCK
	DS.DPR==:1B27		;DRIVE PRESENT
	DS.DRY==:1B28		;DRIVE READY
SUBTTL	RH11 CHANNEL DEFINITIONS -- ERROR REGISTER 1


	ER.DCK==:1B20		;DATA CHECK
	ER.UNS==:1B21		;UNSAFE
	ER.OPI==:1B22		;OPERATION INCOMPLETE
	ER.DTE==:1B23		;DRIVE TIMING ERROR
	ER.WCF==:1B30		;WRITE CLOCK FAIL
	ER.FMT==:1B31		;FORMAT ERROR
	ER.PAR==:1B32		;CONTROL BUS PARITY
	ER.RMR==:1B33		;REGISTER MODIFICATION REFUSED
	ER.ILR==:1B34		;ILLEGAL REGISTER
	ER.ILF==:1B35		;ILLEGAL FUNCTION
SUBTTL	MASBUS DEVICE CODES


;CODES DEFINED BY THE HARDWARE
	TY.RS4==:002		;RS04
	TY.RS5==:003		;RS05
	TY.DR1==:004		;DTR01/DR01
	TY.T2L==:010		;LOWEST TM02
	TY.T77==:014		;TU77 (TM03 HAS 40 BIT ON FOR TU77)
	TY.T2H==:017		;HIGHEST TM02
	TY.RP4==:020		;RP04
	TY.RP5==:021		;RP05
	TY.RP6==:022		;RP06
	TY.RM3==:024		;RM03
	TY.RM2==:025		;RM02
	TY.RM8==:026		;RM80
	TY.RM5==:027		;RM05
	TY.RP7==:042		;RP07
	TY.T3L==:050		;LOWEST TM03
	TY.T3H==:057		;HIGHEST TM03
	TY.DXA==:060		;DX20A/TU7X TAPES
	TY.DXB==:061		;DX20B/RP20 DISKS
	TY.T78==:101		;TM78

;FIELDS IN DRIVE TYPE REGISTER
	TR.NBA==100000		;NOT BLOCK ADDRESSED
	TR.TAP==40000		;TAPE DRIVE
	TR.MOH==20000		;MOVING HEAD DEVICE
	TR.DRQ==4000		;DRIVE REQUEST REQUIRED (DUAL-PORT HARDWARE)
	TR.TYP==777		;DRIVE TYPE
SUBTTL	DRIVER INTERFACE -- CHARACTERISTICS


;WORD DRVCNF
;
;NOTE:
;THIS WORD CANNOT BE EXPANDED TO INCLUDE ANY DATA EXCEPT ONE-BIT QUANTITIES.
;THE DEVICE TYPE BYTE MUST RESIDE IN THIS WORD.  IT IS FORMATTED IN THIS WAY
;TO ALLOW AUTCON TO CHOOSE A DEVICE TYPE AND MASK OF CHARACTERISTICS, AND
;USE A SINGLE WORD FOR FAST DEVICE DISPATCH TABLE SELECTION.

	DR.DVT==:77B5		;DEVICE TYPE
	DR.SFT==:1B25		;SOFTWARE DEVICE
	DR.DDN==:1B26		;DECIMAL DEVICE NUMBERS IN DDB NAMES
	DR.NET==:1B27		;ENCODE ANF-10 STATION NUMBERS IN DDB NAME
	DR.MCD==:1B28		;MULTI-CPU DEVICE (USE LH OF .CPSAV)
	DR.NMC==:1B29		;DEVICE NAME INCLUDES CPU NUMBER
	DR.XAD==:1B30		;EXTENDED ADDRESSING DRIVER
	DR.GCC==:1B31		;GLOBAL CPU COUNTERS
	DR.DPU==:1B32		;DO DUAL PORTED KDB/UDB LINK FIXUPS
	DR.UCK==:1B33		;UNCACHE KDB
	DR.UCU==:1B34		;UNCACHE UDB
	DR.UCD==:1B35		;UNCACHE DDB


;WORD DRVCF2

	DR.KTY==:37B4		;KONTROLLER TYPE
	DR.LIM==:7B7		;MAXIMUM DEVICES IN SYSTEM
	DR.DMX==:777B16		;MAXIMUM DRIVES ON KONTROLLER
	DR.HDN==:777B25		;HIGHEST DRIVE NUMBER ON KONTROLLER
	DR.SCK==:37B30		;KDB/UDB SECTION NUMBER
	DR.SCD==:37B35		;DDB SECTION NUMBER


;MACRO TO GENERATE DRIVER CHARACTERISTICS WORD
DEFINE	DRVCHR	(PFX,DVT,LIM,KTY,DMX,HDN,SCK,SCD,FLG),<
	XLIST
	Z1==<Z2==0>			;;INITIALIZE MASKS
	Z1==Z1!<INSVL.(.TY'DVT',DR.DVT)> ;;DEVICE TYPE
	Z1==Z1!<FLG>			;;FLAGS

	Z2==Z2!<INSVL.('KTY,DR.KTY)>	;;KONTROLLER TYPE
	Z2==Z2!<INSVL.(LIM,DR.LIM)>	;;MAXIMUM DEVICES IN SYSTEM
	Z2==Z2!<INSVL.(DMX,DR.DMX)>	;;MAXIMUM NUMBER OF DRIVES
	Z2==Z2!<INSVL.(HDN,DR.HDN)>	;;HIGHEST DRIVE NUMBER ON KONT
	Z2==Z2!<INSVL.(SCK,DR.SCK)>	;;SECTION FOR KDB/UDB
	Z2==Z2!<INSVL.(SCD,DR.SCD)>	;;SECTION FOR DDB
	LIST
	PFX'CNF==Z1
	PFX'CN2==Z2
	PFX'NAM==<SIXBIT /DVT/>		;;GENERIC DEVICE NAME
	PFX'DMW==<HDN+43/44>		;;WORDS NEEDED TO REPRESENT ALL
					;; ALL DRIVES IN A BIT MASK
	PURGE	Z1,	Z2		;;CLEAN UP SYMBOL TABLE
> ;END DEFINE DRVCHR
SUBTTL	DRIVER INTERFACE -- DISPATCH TABLE


	 .ORG	0

DRVLNK::!BLOCK	1		;LINK TO NEXT DISPATCH

DRVNAM::!BLOCK	1		;GENERIC DEVICE NAME

DRVKDB::!BLOCK	1		;PROTOTYPE KDB ADDRESS
DRVKLN::!BLOCK	1		;PROTOTYPE KDB LENGTH

DRVUDB::!BLOCK	1		;PROTOTYPE UDB ADDRESS
DRVULN::!BLOCK	1		;PROTOTYPE UDB LENGTH

DRVDDB::!BLOCK	1		;PROTOTYPE DDB ADDRESS
DRVDDL::!BLOCK	1		;PROTOTYPE DDB LENGTH

DRVULP::!BLOCK	1		;PROTOTYPE UCODE LOADER BLOCK ADDRESS
DRVULO::!BLOCK	1		;PROTOTYPE UCODE LOADER OFFSET IN KDB

DRVICD::!BLOCK	1		;PROTOTYPE INTERRUPT CODE ADDRESS
DRVICL::!BLOCK	1		;PROTOTYPE INTERRUPT CODE LENGTH

DRVCNF::!BLOCK	1		;CHARACTERISTICS (MOSTLY BITS)

DRVCF2::!BLOCK	1		;MORE CHARACTERISTICS (BYTES)

DRVPIC::!BLOCK	1		;PI CHANNEL

DRVINT::!BLOCK	1		;INTERRUPT SERVICE

DRVDIA::!BLOCK	1		;DIAG. UUO DISPATCH

DRVADF::!			;STARTING ADDRESS FOR SECTION ONE FIXUP

DRVMDT::!BLOCK	1		;MONGEN'ED DEVICE TABLE

DRVCKT::!BLOCK	1		;COMPATIBLE KONTROLLER TABLE

DRVINI::!BLOCK	1		;INITIALIZATION

DRVCFG::!BLOCK	1		;AUTOCONFIGURE

DRVLEN::!			;LENGTH OF DISPATCH
	 .ORG
SUBTTL	DRIVER INTERFACE -- DISPATCH TABLE GENERATION


DEFINE	DRVDSP	(PFX,CHN,DDB,DDL,DIA),<
	XWD	0,0		;;RESERVE SPACE FOR LINK WORD
	 .LINK	.LKDRV,.-1	;;LINK INTO DRIVER DISPATCH CHAIN
	XLIST
	EXP	PFX'NAM		;;GENERIC DEVICE NAME
	EXP	PFX'KDB,PFX'KLN	;;PROTOTYPE KDB ADDRESS AND LENGTH
	EXP	PFX'UDB,PFX'ULN	;;PROTOTYPE UDB ADDRESS AND LENGTH
	EXP	DDB,DDL		;;PROTOTYPE DDB ADDRESS AND LENGTH
	EXP	PFX'ULP,PFX'ULB	;;PROTOTYPE UCODE BLOCK AND KDB OFFSET
	EXP	PFX'ICD,PFX'ICL	;;PROTOTYPE INTERRUPT CODE AND LENGTH
	EXP	PFX'CNF		;;CHARACTERISTICS
	EXP	PFX'CN2		;;MORE CHARACTERISTICS
	EXP	CHN		;;PI CHANNEL
	EXP	PFX'INT		;;INTERRUPT SERVICE
	EXP	DIA		;;DIAG. UUO DISPATCH
	EXP	PFX'MDT##	;;MONGEN'ED DEVICE TABLE
	EXP	PFX'CKT		;;COMPATIBLE KONTROLLER TABLE
	EXP	0		;;INITIALIZATION
	EXP	PFX'CFG		;;AUTOCONFIGURE
	LIST
;;DRVLEN==:DRVLEN			;;DETECT MULTIPLY DEFINED GLOBALS

> ;END DEFINE DRVDSP
SUBTTL	DRIVER INTERFACE -- MONGEN'ED DEVICE TABLE


;MONGEN'ED DEVICE TABLE DEFINITIONS
;
;THE MONGEN'ED DEVICE TABLE (MDT) IS USED TO SPECIFY NON-STANDARD DEVICE
;CONDITIONS OR PARAMETERS THAT CANNOT BE DETERMINED DYNAMICALLY BY QUERYING
;THE DEVICE. STORAGE IS RESERVED FOR THE FOLLOWING QUANTITIES:
;
;	CPU	CPU NUMBER
;	DVC	KL10 = DEVICE CODE
;	IVI	KS10 = INTERRUPT VECTOR INDEX
;	UNI	MASSBUS UNIT
;	DRV	PHYSICAL DRIVE NUMBER
;	FLG	MISCELLANEOUS FLAGS
;	DAT	DEVICE DEPENDENT DATA
;
;THESE QUANTITIES ARE SPECIFIED THROUGH THE USE OF THE MD???? MACROS
;WHERE ???? IS THE PROCESSOR TYPE (I.E. KL10).  THE MACROS ARE
;EXPANDED IN COMDEV INTO TABLES FOR EACH DRIVER WHICH IS LOADED IN
;THE MONITOR.  ON THE KL10, THE TABLES CONSIST OF TWO-WORD PAIRS; THE
;FIRST WORD SPECIFYING THE DEVICE IN QUESTION, AND THE SECOND
;CONTAINING DEVICE DEPENDENT INFORMATION.  ON THE KS10, THE TABLES
;OF THREE-WORD TRIPLETS; THE FIRST WORD SPECIFYING THE DEVICE IN
;QUESTION, THE SECOND SPECIFYING THE UNIBUS ADDRESS OF THE DEVICE,
;AND THE THIRD CONTAINING DEVICE DEPENDENT INFORMATION.

	MD.CPU==:7B2		;CPU NUMBER
IFN FTKL10,<MD.DVC==:177B9>	;<DEVICE CODE>/4
IFN FTKS10,<MD.IVI==:177B9>	;<INTERRUPT VECTOR INDEX>/4
	MD.UNI==:7B12		;MASSBUS UNIT NUMBER
	MD.DRV==:377B20		;DRIVE NUMBER
	MD.KON==:1B21		;KONTROLLER DEFINITION
	MD.ALL==:1B22		;ALL UNITS ON KONTROLLER
IFN FTKS10,<MD.UAD==:777777B35>	;UNIBUS ADDRESS (SECOND WORD OF MDT)

DEFINE	MDKL10	(CPU,DVC,UNI,DRV,FLG,DAT),<
IFN FTKL10,<
	ZZ==<ZZZ==0>			;;INITIALIZE MASK AND FLAGS

	ZZ==ZZ!<INSVL.(CPU,MD.CPU)>	;;CPU NUMBER
	ZZ==ZZ!<INSVL.(<DVC/4>,MD.DVC)>	;;<DEVICE CODE>/4
	ZZ==ZZ!<INSVL.(UNI,MD.UNI)>	;;MASBUS UNIT NUMBER
	ZZ==ZZ!<FLG>			;;INCLUDE FLAGS

	EXP	<ZZ>,<DAT>		;;STORE RESULTS
>; END IFN FTKL10
> ;END DEFINE MDKL10

DEFINE	MDKS10	(CPU,IVI,UAD,UNI,DRV,FLG,DAT),<
IFN FTKS10,<
	ZZ==<ZZZ==0>			;;INITIALIZE MASK AND FLAGS

	ZZ==ZZ!<INSVL.(CPU,MD.CPU)>	;;CPU NUMBER
	ZZ==ZZ!<INSVL.(<IVI/4>,MD.IVI)>	;;<INTERRUPT VECTOR INDEX>/4
	ZZ==ZZ!<INSVL.(UNI,MD.UNI)>	;;MASBUS UNIT NUMBER
	ZZ==ZZ!<FLG>			;;INCLUDE FLAGS

	ZZZ==UAD			;;UNIBUS ADDRESS

	EXP	<ZZ>,<ZZZ>,<DAT>	;;STORE RESULTS
>; END IFN FTKS10
>; END DEFINE MDKS10
;MACRO TO RESERVE STORAGE IN THE MONGEN'ED DEVICE TABLE FOR PER-CPU
;COUNTERS TO CONTROL THE ASSIGNMENT OF CONTROLLER OR DEVICE NAMES.

DEFINE	MDCPUN	(C1,C2,C3,C4,C5,C6),<
	BYTE	(5) C1,C2,C3,C4,C5,C6,00
	BYTE	(5) 00,00,00,00,00,00,00
> ;END DEFINE MDCPUN
;MACRO TO RESERVE MONGEN'ED DEVICE TABLE SLOTS FOR THOSE DEVICES WHICH
;MAY BE DYNAMICALLY CONFIGURED AS A RESULT OF A NON-AUTOCONFIGURE ACTION
;OF SOME MONITOR SERVICE ROUTINE.  FOR EXAMPLE, CONSOLE FRONT END DEVICE
;INFORMATION IS PASSED TO THE MONITOR DURING SYSTEM INITIALIZATION.  THIS
;DATA IS PATCHED INTO THE MONGEN'ED DEVICE TABLE FOR PRINTERS AND CARD
;READERS, AND IS USED BY THE APPROPRIATE DEVICE DRIVERS WHEN CALLED BY
;AUTCON.

DEFINE	MDPATD	(NUM),<
	REPEAT	<NUM>*3,<EXP	-1,0>
> ;END DEFINE MDPATD


;MACRO TO TERMINATE THE MONGEN'ED DEVICE TABLE
DEFINE	MDTERM,<EXP	0>
DEFINE	KDBBEG	(PFX,SIZ),<
	...BAS==.
	...END==...BAS+'SIZ
	...SIZ=='SIZ
IFN FTKL10,<
	SETWRD	(KDBCNI,<CONI	000,T1>)
	SETWRD	(KDBCNO,<CONO	000,(T1)>)
	SETWRD	(KDBDTI,<DATAI	000,T2>)
	SETWRD	(KDBDTO,<DATAO	000,T2>)
	SETWRD	(KDBBKI,<BLKI	000,T2>)
	SETWRD	(KDBBKO,<BLKO	000,T2>)
>; END IFN FTKL10
> ;END DEFINE KDBBEG

DEFINE	KDBEND,<
	.ORG	...END
	PURGE	...BAS,	...END,	...SIZ
>

DEFINE	SETWRD	(OFS,VAL),<
	.ORG	...BAS+'OFS
	VAL
>
DEFINE	UDBBEG	(PFX,SIZ),<
	...BAS==.
	...END==...BAS+'SIZ
	...SIZ=='SIZ
> ;END DEFINE UDBBEG

DEFINE	UDBEND,<
	.ORG	...END
	PURGE	...BAS,	...END,	...SIZ
>
DEFINE	DDBBEG	(PFX,SIZ),<
	...BAS==.
	...END==...BAS+'SIZ
	...SIZ=='SIZ
> ;END DEFINE DDBBEG

DEFINE	DDBEND,<
	.ORG	...END
	PURGE	...BAS,	...END,	...SIZ
>
DEFINE	EQUATE	(TYP,VAL,SYM),<
	XLIST
	IRP	SYM,<
		IFIDN <TYP><GLOBAL>,<SYM==:VAL>
		IFIDN <TYP><LOCAL>,< SYM==VAL>
	> ;;END IRP SYM
	LIST
> ;END DEFINE EQUATE

DEFINE	WID	(MASK),<<^L<-<<MASK>_<^L<MASK>>>-1>>>
DEFINE	POS	(MASK),<<^L<<MASK>&<-<MASK>>>>>
DEFINE	POINTR	(LOC,MASK),<<POINT WID(MASK),LOC,POS(MASK)>>
DEFINE	INSVL.	(VALUE,MASK),<<<<VALUE>B<POS(<MASK>)>>&<MASK>>>
SUBTTL	CHANNEL DATA BLOCK (CHN)


	.ORG	0

CHNBSY::!BLOCK	1	;CHANNEL IDLE/BUSY WORD
			;=1 = IDLE
			; 0 = BUSY
			;+N = BUSY
			;THIS MUST BE WORD ZERO OF THE CHANNEL DATA BLOCK
			;SO AOSG @KDBCHN(W) WILL TEST AND SET BUSY IN ONE
			;INSTRUCTION

CHNSYS::!BLOCK	1	;ADDRESS OF NEXT CHANNEL IN SYSTEM

CHNLUE::!BLOCK	1	;ADDRESS OF LAST UDB WITH SOFT OR HARD ERROR

CHNICW::!BLOCK	1	;INITIAL CONTROL WORD ON LAST SORT OR HARD ERROR
			;(CONTENTS OF EVEN LOW CORE WORD)

CHNFCW::!BLOCK	1	;FINAL CONTROL WORD ON LAST SOFT OR HARD ERROR
			;(WHAT CHANNEL STORES IN OLD LOW CORE WORD)
			;LH = PRESENT CONTENTS OF CONTROL WORD ADDRESS COUNTER
			;RH = PRESENT CONTENTS OF DATA ADDRESS COUNTER
			;BECAUSE EACH DEVICE HANDLES ERROR TERMINATION
			;DIFFERENTLY ON THE CHANNEL, THE SOFTWARE STORES 3
			;CONTROL WORDS AND 3 DATA WORDS 'AROUND' THE PROBLEM
			;AREA AS INDICATED BY THE LH AND RH OF WHAT CHANNEL
			;STORES IN .CHFCW.  NO ATTEMPT IS MADE BY THE MONITOR
			;TO DETERMINE WHICH OF THE 3 WORDS IS REALLY THE LAST
			;CONTROL OR DATA WORD.  THAT MUST BE DONE BY THE
			;INVESTIGATING PERSONNEL.

CHNCW2::!BLOCK	1	;COMMAND WORD -2 ON LAST HARD OR SOFT ERROR

CHNCW1::!BLOCK	1	;COMMAND WORD -1 ON LAST HARD OR SOFT ERROR

CHNCW0::!BLOCK	1	;COMMAND WORD ON LAST HARD OR SOFT ERROR

CHNDW2::!BLOCK	1	;DATA WORD -2 ON LAST HARD OR SOFT ERROR

CHNDW1::!BLOCK	1	;DATA WORD -1 ON LAST HARD OR SOFT ERROR

CHNDW0::!BLOCK	1	;DATA WORD ON LAST HARD OR SOFT ERROR
CHNMPE::!BLOCK	1	;NUMBER OF MEMORY PARITIES

CHNDPE::!BLOCK	1	;NUMBER OF DATA PARITIES (FROM DEVICE)

CHNNXM::!BLOCK	1	;NUMBER OF NXMS OR DATA LATES (OVER RUN)

CHNCSR::!		;LH = BITS TO REQUEST CPU TO SWEEP CORE ON BEHALF OF
			;     CHANNEL.  STORED IN .CPAEF BY CHN MPE ROUTINE
CHNLDE::!BLOCK	1	; RH=LAST DEVICE DATA BLOCK ADR

CHNETW::!BLOCK	1	;EXPECTED TERMINATION CONTROL WORD OF LAST ERROR

CHNECT::!BLOCK	1	;ERROR COUNT SO FAR ON CURRENT DATA TRANSFER SET TO
			;-1 = UNIT IS RECALIBRATING
			; 0 = INCREMENTED AND TESTED BY FILSER (TO DSKTRY)
			;     NOT LOOKED AT BY INTERRUPT ROUTINE

CHNRCT::!BLOCK	1	;RECALIBRATE ERROR COUNT ON CURRENT DATA TRANSFER
			;START AT 0 AND GOES TO RCLTRY.  INCREMENTED EVERY
			;TIME CHNECT COUNTS UP TO DSKTRY
			;TOTAL TRIES = DSKTRY * RCLTRY

CHNQUE::!BLOCK	1	;LH = ADDRESS OF FIRST (LONGEST WAITING) DDB
			;     WAITING TO DO A DATA TRANSFER (TW QUEUE)
			;RH = JOB NUMBER FOR DDB WHOSE ADDRESS IS IN LH
			;BOTH HALVES = 0 IF NO FILES WAITING TO TRANSFER,
			;SO A FAST TEST FOR EMPTY TRANSFER WAIT QUEUE
			;NOTE - A FILE IN T STATES IS NOT IN TW QUEUE

CHNTYP::!BLOCK	1	;CHANNEL TYPE AND FLAGS
			   ;LH BITS (DEFINED AS 18-BIT QUANTITIES)
   CP.DX1==:200000	   ;DX10
   CP.RH2==:100000	   ;RH20
   CP.R11==:40000	   ;RH11
   CP.LP2==:20000	   ;UNIBUS/LP20
   CP.CD2==:10000	   ;UNIBUS/CD20
   CP.KLP==:4000	   ;KLIPA
   CP.KNI==:2000	   ;KLNI
			   ;BITS 12-14 FOR CUSTOMER USE
   CP.SAX==:40		   ;SA10
   CP.SWF==:1		   ;CACHE SWEEP MUST BE DONE BEFORE INTERRUPT EXIT
CHNIFP::!BLOCK	1	;INITIAL FAIRNESS COUNT FOR POSITIONING UNITS
			;ON THIS CHANNEL AFTER A DATA TRANSFER INTERRUPT.
			;USED TO SET CHNCFP WHEN IT COUNTS TO ZERO.  AN
			;INITIAL VALUE OF 1 (OR 0) REDUCES THE SYSTEM
			;POSITION ON A FIRST COME, FIRST SERVE BASIS
			;(RATHER THAN THE NEAREST POSITION) ALL THE TIME

CHNCFP::!BLOCK	1	;CURRENT FAIRNESS COUNT FOR POSITIONING UNITS ON
			;THIS CHANNEL AFTER A DATA TRANSFER INTERRUPT
			;DECREMENTED BY 1 EACH DATA TRANSFER INTERRUPT
			;ON THIS CHANNEL.  I.E. NUMBER OF DATA TRANSFER
			;INTERRUPTS LEFT BEFORE A POSITIONING REQUEST IS
			;SELECTED ON THE BASIS OF LONGEST WAITING FILE
			;("FAIR") RATHER THAN NEAREST (INCLUDING "ON
			;CYLINDER") ("FAST")
CHNIFT::!BLOCK	1	;INITIAL FAIRNESS COUNT FOR DATA TRANSFERS ON THIS
			;CHANNEL.  USED TO SET CHNCFT WHEN IT COUNTS TO 0

CHBSCN::!BLOCK	1	;SOFTWARE CHANNEL NUMBER - WORD ADDRESS
   CHSSCN==:^D9		   ;BYTE SIZE
   CHNSCN==:^D8		   ;BYTE POINTER POSITION

CHNCFT::!BLOCK	1	;CURRENT FAIRNESS COUNT FOR DATA TRANSFERS ON THIS
			;CHANNEL.  DECREMENTED BY 1 FOR EACH DATA TRANSFER
			;INTERRUPT.  WHEN REACHES 0, A DATA TRANSFER IS
			;SELECTED ON THE BASIS OF THE LONGEST WAITING FILE
			;WHICH IS IN POSITION ("FAIR") RATHER THAN THE
			;SHORTEST LATENCY ("FAST").

CHNIFS::!BLOCK	1	;INITIAL FAIRNESS COUNT FOR SWAPPING ON THIS CHANNEL

CHNCFS::!BLOCK	1	;CURRENT FAIRNESS COUNT FOR SWAPPING ON THIS CHANNEL.
			;DECREMENTED BY 1 EACH TIME A SWAP OR PAGE OPERATION IS
			;STARTED.  A FILE OPERATION IS STARTED IF THIS COUNT IS
			;;NEGATIVE AND FILE I/O IS PENDING
CHNNUM::!BLOCK	1	;LH = -1 ON ERRORS, ELSE 0
			;RH = NUMBER OF 128 WORD BLOCKS BEING TRANSFERRED
			;     ON THIS CHANNEL ON THE CURRENT TRANSFER.  SETUP
			;     AT SAME TIME AS CHANNEL COMMAND LIST.  NOT
			;     CLEARED AT END OF TRANSFER SO GOOD FOR LOOKING
			;     AT IN LIGHTS.

CHNQUL::!BLOCK	1	;LENGTH OF TRANSFER WAIT QUEUE

CHNTCW::!BLOCK	1	;EXPECTED TERMINATION CONTROL WORD.  USED TO CHECK FOR
			;ABNORMAL CHANNEL TERMINATION WITHOUT ERROR INDICATIONS
			;FROM CONTROLLER

CHNCUA::!BLOCK	1	;CURRENT UNIT ACTIVE ON CHANNEL
IFN FTKS10,<
CHNUBA::!BLOCK	1	;UNIBUS ADAPTER STATUS REGISTER ADDRESS
			;LH = UNIBUS ADAPTER NUMBER
			;RH = UNIBUS STATUS WORD ADDRESS

CHNIMR::!BLOCK	1	;ADDRESS OF INITIAL MAPPING REGISTER FOR THIS DEVICE

CHNMRC::!BLOCK	1	;NUMBER OF MAPPING REGISTERS AVAILABLE TO THIS DEVICE

CHNIEA::!BLOCK	1	;INITIAL ELEVEN STYLE ADDRESS FOR CURRENT TRANSFER

CHNBTC::!BLOCK	1	;ELEVEN STYLE BYTE COUNT FOR CURRENT TRANSFER
CHNNXF::!BLOCK	1	;NO TRANSFER FLAG
			;-1 = NO TRANSFER
			; 0 = NORMAL TRANSFER
			;NO TRANSFER REQUESTS COME DOWN FROM FILSER WHEN IT
			;WANTS TO READ A BLOCK BUT DO NO DATA TRANSFER ANYWHERE
			;TO VERIFY THAT A PARTICULAR BLOCK IN FACT HAS ERRORS

CHNDBF::!BLOCK	1	;DUMMY 1-WORD BUFFER FOR BUS ADDRESS INHIBIT USAGE
			;FOR EXAMPLE: READ A SECTOR, BUT TRANSFER NO DATA

CHNRRV::!BLOCK	1	;READ REVERSE FLAG
			;-1 = READ REVERSE
			; 0 = READ NORMAL

>;END IFN FTKS10
CHNDVC::!BLOCK	1	;AUTOCONFIGURATION CPU/DEVICE WORD
			;FORMAT: <CPU>B2 + <DEVICE CODE>/4
CHBCPU==:CHNDVC		;OWNING CPU NUMBER
   CHSCPU==^D3		   ;BYTE SIZE
   CHNCPU==^D2		   ;BYTE POINTER POSITION

CHNTBP::!BLOCK	1	;AOBJN POINTER TO KONTROLLERS ON THIS CHANNEL

CHNKTB::!BLOCK	<LENKTB==:20> ;STORAGE FOR KDB ADDRESSES

CHNLEN::!		;LENGTH OF CHANNEL DATA BLOCK

	.ORG
SUBTTL	I/O REQUEST BLOCK (IRB) -- OFFSETS COMMON TO ALL CONTROLLERS


	 .ORG	0

IRBLNK::!BLOCK	1		;FORWARD LINK TO NEXT IORB

IRBACC::!BLOCK	1		;ACTIVE (CURRENT) CHANNEL COMMAND

IRBCCW::!BLOCK	<MXPORT==:4>	;ADDRESSES OF CHANNEL COMMANDS

IRBIVA::!BLOCK	1		;ADDRESS OF INTERRUPT ROUTINE

IRBDDB::!BLOCK	1		;ADDRESS OF DDB BEING SERVICED

IRBSIZ::!			;LENGTH OF COMMON IORB

	 .ORG
SUBTTL	KONTROLLER DATA BLOCK (KDB) -- OFFSETS COMMON TO ALL CONTROLLERS


	 .ORG	0

KDBNAM::!BLOCK	1		;SIXBIT NAME OF CONTROLLER

KDBNXT::!BLOCK	1		;LINK TO NEXT CONTROLLER IN SYSTEM

KDBCAM::!BLOCK	1		;CPU ACCESSIBILITY MASK

KDBCHN::!BLOCK	1		;CHANNEL DATA BLOCK ADDRESS

KDBIUN::!BLOCK	1		;INITIAL POINTER TO UNITS
KDBFUN::!BLOCK	1		;FINAL POINTER TO UNITS
KDBCUN::!BLOCK	1		;CURRENT POINTER TO UNITS

KDBIUM::!BLOCK	1		;OFFSET TO IGNORE MASK
KDBNUM::!BLOCK	1		;OFFSET TO NEW UNIT MASK

KDBICP::!BLOCK	1		;ADDRESS OF INITIAL CHANNEL PROGRAM

KDBDSP::!BLOCK	1		;ADDRESS OF CONTROLLER DISPATCH TABLE

KDBSER::!BLOCK	2		;KONTROLLER SERIAL NUMBER

KDBSTS::!BLOCK	1		;STATUS WORD
   KD.MPD==:1B0			   ;MULTI-PORTED DEVICE
   KD.APC==:1B1			   ;ALL PORTS CONFIGURED
   KD.MPT==:17B5		   ;MAXIMUM NUMBER OF PORTS
   KD.BMX==:1B6			   ;BLOCK MULTIPLEX DEVICE
   KD.MXD==:1B7			   ;MULTIIPLE TRANSFER DEVICE
   KD.PWT==:1B8			   ;POSITION WHILE XFER IN PROGRESS ALLOWED
   KD.SIR==:1B9			   ;SOFTWARE INTERRUPT REQUESTED

KDBPCC::!BLOCK	1		;# WORDS,,STARTING OFFSET INDICATING
				; PHYSICALLY CONTIGUOUS CORE REQUIREMENTS

IFN FTKL10,<
KDBCSO::!BLOCK	1		;CONSO SKIP CHAIN POINTER
> ;END IFN FTKL10
KDBVIN::!BLOCK	1		;VECTOR INTERRUPT POINTER

KDBDVC::!BLOCK	1		;DEVICE CODE OR UNIBUS BASE ADDRESS

KDBIOB::!			;START OF WORDS CONTAINING I/O INSTRUCTIONS
KDBCNI::!BLOCK	1		;CONI  DEV,T1
KDBCNO::!BLOCK	1		;CONO  DEV,(T1)
KDBDTI::!BLOCK	1		;DATAI DEV,T2
KDBDTO::!BLOCK	1		;DATAO DEV,T2
KDBBKI::!BLOCK	1		;BLKI  DEV,T2
KDBBKO::!BLOCK	1		;BLKO  DEV,T2
KDBIOE::!			;END OF WORDS CONTAINING I/O INSTRUCTIONS

KDBIVI::!BLOCK	1		;DATAO CONTENTS TO SET UP INTERRUPT VECTOR

KDBUNI::!BLOCK	1		;MASSBUS UNIT NUMBER,,ATTENTION BIT
				;UNIT = -1 ON NON-MULTI UNIT KONTROLLERS

KDBSIZ::!			;LENGTH OF COMMON KDB

	 .ORG
SUBTTL	UNIT DATA BLOCK (UDB) -- OFFSETS COMMON TO ALL KONTROLLERS


	 .ORG	0

UDBNAM::!BLOCK	1		;UNIT NAME

UDBPDN::!BLOCK	1		;PHYSICAL DRIVE NUMBER

UDBDSN::!BLOCK	2		;DRIVE SERIAL NUMBER

UDBKDB::!BLOCK	MXPORT		;KDB ADDRESSES FOR EACH PORT

UDBCAM::!BLOCK	1		;CPU ACCESSIBILITY MASK

UDBDDB::!BLOCK	1		;NORMAL DDB ADDRESS

UDBPCC::!BLOCK	1		;NUMBER OF WORDS,,STARTING OFFSET INDICATING
				; PHYSICALLY CONTIGUOUS CORE REQUIREMENTS

UDBSIZ::!			;LENGTH OF COMMON UDB

	 .ORG
SUBTTL	GENERAL DEFINITIONS -- SXX -- IBM CHANNEL SENSE BYTES

;SENSE BYTES COMMON TO ALL IBM CHANNEL DEVICES ARE DEFINED HERE;
;DEVICE-DEPENDENT SENSE BYTES ARE DEFINED LATER.

S00WRD==0		;SENSE BYTE 0 (PDP-10 WORD 0 BYTE 0)
   S00REJ==1B0		   ;COMMAND REJECT
   S00IRQ==1B1		   ;INTERVENTION REQUIRED
   S00BOC==1B2		   ;BUS OUT CHECK
   S00EQP==1B3		   ;EQUIPMENT CHECK
   S00DCK==1B4		   ;DATA CHECK
   S00OVR==1B5		   ;OVERRUN
   S00WCZ==1B6		   ;WORD COUNT ZERO
   S00DCC==1B7		   ;DATA CONVERTER CHECK

S01WRD==0		;SENSE BYTE 1 (PDP-10 WORD 0 BYTE 1)

S02WRD==0		;SENSE BYTE 2 (PDP-10 WORD 0 BYTE 2)

S03WRD==0		;SENSE BYTE 3 (PDP-10 WORD 0 BYTE 3)

S04WRD==1		;SENSE BYTE 4 (PDP-10 WORD 1 BYTE 0)

S05WRD==1		;SENSE BYTE 5 (PDP-10 WORD 1 BYTE 1)

S06WRD==1		;SENSE BYTE 6 (PDP-10 WORD 1 BYTE 2)

S07WRD==1		;SENSE BYTE 7 (PDP-10 WORD 1 BYTE 3)

S08WRD==2		;SENSE BYTE 8 (PDP-10 WORD 2 BYTE 0)

S09WRD==2		;SENSE BYTE 9 (PDP-10 WORD 2 BYTE 1)

S10WRD==2		;SENSE BYTE 10 (PDP-10 WORD 2 BYTE 2)

S11WRD==2		;SENSE BYTE 11 (PDP-10 WORD 2 BYTE 3)

S12WRD==3		;SENSE BYTE 12 (PDP-10 WORD 3 BYTE 0)

S13WRD==3		;SENSE BYTE 13 (PDP-10 WORD 3 BYTE 1)

S14WRD==3		;SENSE BYTE 14 (PDP-10 WORD 3 BYTE 2)

S15WRD==3		;SENSE BYTE 15 (PDP-10 WORD 3 BYTE 3)

S16WRD==4		;SENSE BYTE 16 (PDP-10 WORD 4 BYTE 0)

S17WRD==4		;SENSE BYTE 17 (PDP-10 WORD 4 BYTE 1)

S18WRD==4		;SENSE BYTE 18 (PDP-10 WORD 4 BYTE 2)

S19WRD==4		;SENSE BYTE 19 (PDP-10 WORD 4 BYTE 3)

S20WRD==5		;SENSE BYTE 20 (PDP-10 WORD 4 BYTE 0)

S21WRD==5		;SENSE BYTE 21 (PDP-10 WORD 4 BYTE 1)

S22WRD==5		;SENSE BYTE 22 (PDP-10 WORD 4 BYTE 2)

S23WRD==5		;SENSE BYTE 23 (PDP-10 WORD 4 BYTE 3)
SUBTTL	DISK DEFINITIONS -- KONTROLLER TYPES


;KONTROLLER TYPES
	TYPDR==:0		;DR (FUTURE DRUM)
	TYPFH==:1		;FH (RC10/RM10B BURROUGHS DISK OR BRYANT DRUM)
	TYPDP==:2		;DP (RP10 MEMOREX)
	TYPMD==:3		;MD (BRYANT MASS [MOBY] DISK)
	TYPFS==:4		;FS (RH10)
	TYPRP==:5		;RP (RH10/RH11/RH20)
	TYPRN==:6		;RN (RH20/DX20/RP20CT)
	TYPRA==:7		;RA (CI20/HSC)
				;10 - 12 RESERVED FOR FUTURE USE BY DIGITAL
				;13 - 17 RESERVED FOR CUSTOMER TYPE CODES
	TYPDS==:17		;DS (SA10/IBM CHANNEL DISKS)
SUBTTL	DISK DEFINITION -- SXX - IBM CHANNEL SENSE BYTES

;S01WRD==0		;SENSE BYTE 1 (PDP-10 WORD 0 BYTE 1)
   D01PME==1B8		   ;PERMANENT ERROR
   D01ITF==1B9		   ;INVALID TRACK FORMAT
   D01EOC==1B10		   ;END OF CYLINDER
			   ;BIT 11 UNUSED
   D01NRF==1B12		   ;NO RECORD FOUND
   D01FPR==1B13		   ;FILE PROTECTED
   D01WRL==1B14		   ;WRITE-LOCKED
   D01OPI==1B15		   ;OPERATION INCOMPLETE

;S02WRD==0		;SENSE BYTE 2 (PDP-10 WORD 0 BYTE 2)
   D02COR==1B17		   ;CORRECTABLE ERROR
   D02EDP==1B19		   ;ENVIRONMENTAL DATA PRESENT

;S07WRD==7		;SENSE BYTE 7 (PDP-10 WORD 1 BYTE 3)
   D07FMC==377B31	   ;FORMAT/MESSAGE CODE
      FMCECC==123	      ;FORMAT 5, MESSAGE 3="CORRECTABLE DATA AREA"

;S09WRD==2		;SENSE BYTE 9 (PDP-10 WORD 2 BYTE 1)
   D09PLU==1B8		   ;PLO UNSAFE

;S11WRD==2		;SENSE BYTE 11 (PDP-10 WORD 2 BYTE 3)
   D11HUS==1B26		   ;HEAD UNSAFE

;S12WRD==3		;SENSE BYTE 12 (PDP-10 WORD 3 BYTE 0)
   D12DUS==1B0		   ;DATA SAFETY (DATA UNSAFE)
   D12SUS==1B1		   ;SERVO SAFETY (DC UNSAFE)
   D12PUS==1B3		   ;PAD UNSAFE

;S15WRD==3		;SENSE BYTE 15 (PDP-10 WORD 3 BYTE 3)
   D15RD1==377B31	   ;1ST OF 3 BYTES OF RESTART DISPLACEMENT
;S16WRD==4		;SENSE BYTE 16 PDP-10 WORD 4 BYTES 0,1)
   D16RD2==177777B15	   ;2ND AND 3RD OF 3 BYTES OF RESTART DISPLACEMENT
   D16ERD==177777B31	   ;1ST AND 2ND OF 2 BYTES OF ERROR DISPLACEMENT
;S20WRD==5		;SENSE BYTE 20 PDP-10 WORD 5
   D16EC1==377B7	   ;1ST OF 3 ECC PATTERN BYTES
   D16EC2==377B15	   ;2ND OF 3 ECC PATTERN BYTES
   D16EC3==377B23	   ;3RD OF 3 ECC PATTERN BYTES

;S23WRD==5		;SENSE BYTE 23 (PDP-10 WORD 4 BYTE 3)
   D23CHT==1B31		   ;CHANNEL TRUNCATION OCCURRED
SUBTTL	DISK DEFINITIONS -- COMMON KONTROLLER DATA BLOCK MACRO

DEFINE	XXKON	(PFX),<

	KDBBEG	(PFX,\PFX'XKLN)

	SETWRD	(KDBNAM,<SIXBIT /PFX/>)
	SETWRD	(KDBIUN,<XWD -PFX'XDMX,PFX'XUTB>)
	SETWRD	(KDBCUN,<XWD -PFX'XDMX,PFX'XUTB>)
	SETWRD	(KDBIUM,<PFX'XIUM>)
	SETWRD	(KDBNUM,<PFX'XNUM>)

	SETWRD	(KONPTR,<PFX'XUTB(P3)>)
	SETWRD	(KONREG,\<PFX'ERNO>)
	SETWRD	(KONEBK,PFX'XEBK)

	SETWRD	(KONRED,<XWD PFX'BMX,PFX'XRED>)
	SETWRD	(KONRDS,PFX'XRDS)
	SETWRD	(KONRDF,PFX'XRDF)
	SETWRD	(KONRDC,<XWD PFX'RDC,PFX'XRDC>)

	SETWRD	(KONWRT,PFX'XWRT)
	SETWRD	(KONWTS,PFX'XWTS)
	SETWRD	(KONWTF,PFX'XWTF)
	SETWRD	(KONWTC,<XWD PFX'RDC,PFX'XWTC>)

	SETWRD	(KONUNL,<XWD PFX'UNL,PFX'XUNL>)
	SETWRD	(KONPOS,<XWD PFX'FIX,PFX'XPOS>)
	SETWRD	(KONLTM,<XWD PFX'MX,PFX'XLTM>)
	SETWRD	(KONUPA,PFX'XUPA)
	SETWRD	(KONCPY,<XWD PFX'CPY,PFX'XCPY>)
	SETWRD	(KONHWP,<PFX'XHWP>)
	SETWRD	(KONRCL,<XWD PFX'DRB,PFX'XRCL>)
	SETWRD	(KONSTP,PFX'XSTP)
	SETWRD	(KONERR,<XWD PFX'OFS,PFX'XERR>)
	SETWRD	(KONECC,<XWD PFX'ECA,PFX'XECC>)
	SETWRD	(KONRRG,PFX'XREG)
	SETWRD	(KONCCM,PFX'XCCM)
	SETWRD	(KONALV,PFX'XALV)
	SETWRD	(KONRLD,PFX'XRLD)
	SETWRD	(KONEDL,PFX'XEDL)
	SETWRD	(KONSEC,PFX'XSEC)
	SETWRD	(KONELG,PFX'XELG)

>; END DEFINE XXKON
SUBTTL	DISK DEFINITIONS -- KON - KONTROLLER DATA BLOCK


	CPUMSK==:77		;SYMBOL FOR MASK OF ALL CPU BITS
	 .ORG	KDBSIZ

KONBSY::!BLOCK	1		;LH = KONTROLLER BUSY FLAG (SIGN BIT)
   KOPBSY==:400000		   ;KONTROLLER IS BUSY WHEN SET
IFN FTCIDSK,<
   KOPBND==:1			   ;THIS KON ALREADY BOUND (ONCE ONLY)
>; END IFN FTCIDSK
KONCNT::!BLOCK	1		;NUMBER OF WORDS IN TRANSFER ON FORMAT

;DISPATCH TABLE
KONRED::!BLOCK	1		;READ
   KONBMX==:KONRED		   ;BLOCK MULTIPLEX KONTROLLER
      KOPBMX==:(1B0)		      ;BLOCK MULTIPLEX KONTROLLER
				      ;MUST BE SIGN BIT
   KOBKTP==:KONRED		   ;KONTROLLER TYPE
      KOSKTP==^D6		      ;BYTE SIZE
      KONKTP==^D8		      ;BYTE PTR POS
KONRDS::!BLOCK	1		;READ, STOP ON ERR
   KOBKNM==:KONRDS		   ;KONTROLLER NUMBER
      KOSKNM==^D6		      ;BYTE SIZE
      KONKNM==^D8		      ;BYTE PTR POS
KONRDF::!BLOCK	1		;READ HEADER AND DATA
KONRDC::!BLOCK	1		;READ IN 10/11 COMPAT. MODE
KONWRT::!BLOCK	1		;WRITE
KONWTS::!BLOCK	1		;WRITE, STOP ON ERR
   KONCNA==:KONWTS		   ;CREDITS NOT AVAILABLE
      KOPCNA==:(1B0)		      ;DON'T QUEUE ANYTHING MORE
				      ;MUST BE SIGN BIT
KONWTF::!BLOCK	1		;WRITE FORMAT
KONWTC::!BLOCK	1		;WRITE IN 10/11 COMPAT. MODE
KONUNL::!BLOCK	1		;UNLOAD A DRIVE
KONPOS::!BLOCK	1		;POSITION
   KOPFIX==:400000		   ;BIT 0=1 IF FIXED HEAD DEV
   KOPPWX==:200000		   ;BIT 1=1 IF CAN SEEK WHILE XFER IN PROGRESS
KONLTM::!BLOCK	1		;RETURN TIME TO BEGINNING OF TRANSFER
   KONMX==:KONLTM		   ;MULTI XFERS
      KOPMX==400000		      ;DRIVE CAN DO MULTIPLE XFERS AT SAME TIME
KONUPA::!BLOCK	1		;TEST IF KONTROLLER IS ON-LINE
   KONDWN==:KONUPA		   ;KONTROLLER IS DOWN
      KOPDWN==:400000		      ;THE BIT (SET BY KONCHK - NOT BY XXXUPA)
				      ;KONTROLLER OFFLINE WHEN SYSTEM STARTED
				      ;AND OPERATOR COULD NOT PUT IT ONLINE
				      ;SKIP RETURN IF YES, NO SKIP IF NOT
      KOPWHL==:200000		      ;WRITE-HEADER-LOCKOUT SWITCH IS "WRONG"
   KONMPS==:KONUPA		   ;WORD OFFSET TO TEST KOPMPS BIT
      KOPMPS==:100000		      ;THIS KDB REPRESENTS A MICROCODED
				      ;DISK CONTROLLER AND THE MICROPROCESSOR
				      ;HAS STOPPED.
KONCPY::!BLOCK	1		;DETERMINE TYPE & CAPACITY OF UNIT
   KOPIDL==:400000		   ;KONTROLLER MUST BE IDLE TO READ UNIT TYPE
   KOPUHE==:200000		   ;UNIT HAD ERROR OF ANY KIND - LH T4 VALUE
   KOPNSU==:100000		   ;NO SUCH UNIT - LH T4 VALUE
KONRCL::!BLOCK	1		;RECALIBRATE THIS UNIT
   KONDRB==:KONRCL		   ;WORD OFFSET TO TEST KOPDRB BIT
      KOPDRB==:(1B0)		      ;DRIVER HANDLES I/O VIA DISK IORBS
KONSTP::!BLOCK	1		;STOP A HUNG UNIT
KONHWP::!BLOCK	1		;CHECK HARDWARE WRITE PROTECT

KONCUA::!BLOCK	1		;UDB ADDRESS DOING DATA XFER (OR LAST ONE)
KONPTR::!BLOCK	1		;USED TO PICKUP UNIT DATA BLOCK ADDRESS
KONDMP::!BLOCK	1		;STORAGE FOR DEVDMP WHEN STARTING DUMP MODE I/O
KONERR::!BLOCK	1		;ERROR RECOVERY PROGRAM IN KONTROL ROUTINE
KONECC::!BLOCK	1		;GENERATE ECC MASK, POSITION
  KONECA==:KONECC		   ;KONTROLLER KNOWS THAT ECC CAN BE DONE
      KOPECA==:(1B0)		      ;WE KNOW ECC CAN BE DONE WITHOUT ERROR
KONRRG::!BLOCK	1		;READ DRIVE REGISTERS
KONCCM::!BLOCK	1		;COMPUTE DISTANCE FROM CYLINDER
KONALV::!BLOCK	1		;ENSURE KONTROLLER HAS A PIA
KONRLD::!BLOCK	1		;RELOAD DISK CONTROLLER
KONEDL::!BLOCK	1		;ENABLE/DISABLE MICROCODE LOADING
KONSEC::!BLOCK	1		;ONCE PER SECOND CALL
KONELG::!BLOCK	1		;MAKE AN ERROR LOG ENTRY

;THESE MUST BE THE LAST LOCATIONS IN THE KDB BEFORE KONTROLLER-DEPENDENT STUFF
KONECR::!BLOCK	1		;CONTROL REG ON ERROR
KONEDB::!BLOCK	1		;DATA BUFFER REG ON ERROR
KONREG::!BLOCK	1		;NUMBER OF DRIVE REGISTERS TO SAVE ON ERR
KONEBK::!BLOCK	1		;ADDRESS OF DRIVE REGISTER STORAGE
KONUDB::!			;TABLE OF POINTERS TO UDBS

	 .ORG
SUBTTL	DISK DEFINITIONS -- OP - DRIVER DISPATCH OFFSETS


	 .ORG	0
OPRED::!BLOCK	1		;(00) READ
OPWRT::!BLOCK	1		;(01) WRITE
	BLOCK	1		;(02)
OPWTF::!BLOCK	1		;(03) FORMAT
OPPOS::!BLOCK	1		;(04) POSITION
OPCLR::!BLOCK	1		;(05) CLEAR
OPSEL::!BLOCK	1		;(06) SELECT
OPCAL::!BLOCK	1		;(07) RECALIBRATE
OPLEN::!			;LENGTH OF DISPATCH
	 .ORG
SUBTTL	DISK DEFINITIONS -- MISCELLANEOUS


KOPOFL==:400000		;'OFF-LINE' OR 'NOT-READY' OR 'FILE UNSAFE' BIT
			; (LIGHTS UNPOFL IN UNIDES)
KOPFUS==:200000		;FILE UNSAFE - ADD TO MESSAGE TO OPERATOR
KOPUSI==:100000		;UNIT STATUS INCONSISTENT
KOPWLK==:040000		;WRITE LOCK (IF ALL THE OTHER BITS ARE OFF, THEN
			;THE PROBLEM IS ASSUMED TO BE WRITE LOCK).
KOPNOC==:020000		;(CI ONLY) NO CREDITS
KOPDER==:010000		;(CI ONLY) DEVICE ERROR
KONERM==:KOPOFL+KOPFUS+KOPUSI+KOPWLK+KOPNOC+KOPDER ;ALL ERRORS
SUBTTL	DISK DEFINITIONS -- UNIT DATA BLOCK


	 .ORG	UDBSIZ

UNILOG::!BLOCK	1	;SIXBIT LOGICAL UNIT NAME WITHIN STR
			; LAST DIGIT OR TWO IS 0 TO 77 LEFT JUSTIFIED
UNIHID::!BLOCK	1	;SIXBIT HOME BLOCK IDNAME - NEVER CHANGED IN HOME BLOCK
UNISYS::!BLOCK	1	;LH=CORE ADDRESS (ACROSS POINTER) OF NEXT UNIT DATA
			; BLOCK IN SYSTEM, LH=0 IN LAST UNIT IN SYSTEM
UNISIC==:UNISYS		;# SAT BLOCKS IN CORE FOR THIS UNIT
    UNSSIC==^D8		    ;BYTE SIZE
    UNNSIC==^D25	    ;BYTE PTR POS
UNILUN==:UNISYS		;LOGICAL UNIT NUMBER WITHIN FILE STRUCTURE OF THIS UNIT
    UNSLUN==^D6		    ;BYTE SIZE
    UNNLUN==^D35	    ;BYTE PTR POS
UNISTR::!BLOCK	1	;LH=ADDRESS OF NEXT UNIT DATA BLOCK IN STR
			; LH=0 IN LAST UNIT IN FILE STRUCTURE
			;RH=UPWARD POINTER TO FILE STR. DATA BLOCK.
			;WORD=0 IF THIS UNIT IS NOT IN AN STR
UNICHN::!BLOCK	1	;ADDRESS OF NEXT UNIT DATA BLOCK ON SAME CHANNEL
			; LAST UNIT POINTS BACK TO FIRST UNIT (RING)
UNIKON::!BLOCK	1	;ADDRESS OF NEXT UNIT DATA BLOCK ON SAME KON
			; LAST UNIT POINTS BACK TO FIRST UNIT (RING)
UNISWP::!BLOCK	1	;LH=CORE ADDR OF NEXT UNIT FOR SWAPPING
UNICFS==:UNISWP		;RH CONTAINS BYTE WHICH IS CLASS FOR SWAPPING
			;SWAPPER WILL TRY EVERYTHING TO SWAP ON ONE CLASS
			;BEFORE TRYING NEXT CLASS, TO KEEP ON FASTEST UNITS
    UNSCFS==^D3		    ;BYTE SIZE
    UNNCFS==^D22	    ;BYTE PTR POS

;ERROR STATISTICS:

UNIHCT::!BLOCK	1	;NO. OF HARD DISK ERRORS ON THIS UNIT (RETRYS FAILED
			; TO CLEAR ERROR)
			;LH=NO. DEVICE+SEEK + SEARCH ERRORS(IODERR)(CHAN+CONTROL)
			;(SEE UNIPCT)
			;RH=NO. DATA ERRORS(IODTER)(HARDWARE DEVICE DATA PARITY)
UNISCT::!BLOCK	1	;NO. OF SOFT + NO. OF HARD ERRORS - INCREMENTED
			; ONCE WHEN SUCCESS FOLLOWS ONE OR MORE FAILURES
			; NOT INCREMENTED ON HARD ERRORS
			;LH=NO. SOFT+HARD DEVICE+SEARCH ERRORS(SEE UNIPCT)
			;RH=NO SOFT+HARD DATA ERRORS
UNIMCT::!BLOCK	1	;NO. OF MONITOR DETECTED ERRORS(THREE 12-BIT FIELDS)
			; USER PROGRAM SEES IOIMPM ERROR BIT SET FOR ALL 3 TYPES OF ERRORS
    UNPSER==:100	    ;NO. OF SAT FAILURES(NO. OF FREE CLUSTERS ON DISK SAT
			    ; DISAGREE WITH EXPECTED NO AS STORED IN CORE)
    UNPRER==:10000	    ;NO. OF RIB REDUNDANT INFO FAILED TO COMPARE
    UNPCER==:1		    ;NO. OF SOFTWARE FOLDED CHECKSUM FAILURES(USER IO BUT NOT
			    ; SWAP) (MUST BE RIGHT JUSTIFIED FOR AOS)
UNIERR::!BLOCK	1	;LAST ERROR DEVICE STATUS WHICH OCCURRED ON THIS UNIT
			; AFTER FIRST RECOVERY ATTEMPT FAILED. SET BY
			; MOVEM T2,UNIERR(U) IN FILSER WHERE T2 IS SET DIRECTLY
			; FROM KONTROLLER STATUS WORD IN KONTROLLER DEPENDENT
			; ROUTINE. IF RECOVERY SUCCEEDS BEFORE FIRST RECAL,
			; UNIERR WILL CONTAIN 0
UNISOF::!BLOCK	1	;LAST ERROR DEVICE STATUS ON THIS UNIT
			; BEFORE ANY RECOVERY ATTEMPTED
			; DEVICE, DATA, SEARCH, HUNG ERRORS
UNIHBN::!BLOCK	1	;LAST LOGICAL BLOCK NUMBER ON HARD OR SOFT ERROR

;PERFORMANCE MONITORING DATA LOCATIONS:
;NOTE FOLLOWING 6 ENTRIES ARE MUTUALLY EXCLUSIVE AND ACCOUNT FOR ALL
; TRANSFERS ON THIS UNIT (EXCEPT ERROR RETRYS)
;WRITE COUNT MUST BE READ COUNT+1

UNIBRC::!BLOCK	1	;NO. OF BUFFERED MODE 128 WORD BLOCKS READ
UNIBWC::!BLOCK	1	;NO. OF BUFFERRED MODE 128 WORD BLOCKS WRITTEN
UNIDRC::!BLOCK	1	;NO. OF DUMP MODE 128 WORD BLOCKS READ(INCLUDEING GETS)
UNIDWC::!BLOCK	1	;NO. OF DUMP MODE 128 WORD BLOCKS WRITTEN(INCLUDING SAVES)
UNIMRC::!BLOCK	1	;NO. OF MONITOR 128 WORD BLOCKS READ(SAT,UFD,MFD,BAT,SWAP)
UNIMWC::!BLOCK	1	;NO. OF MONITOR 128 WORD BLOCKS WRITTEN(SAT,UFD,MFD,BAT,SWAP)
;NOTE: TO COMPUTE NO. OF MONITOR OVERHEAD READS(WRITES)
;  SUBTRACT UNIICT(UNIOCT) FROM UNIMRC(UNIMWC)
UNIICT::!BLOCK	1	;NO. OF 128 WORD BLOCKS SWAPPED IN(SET BY SWPINT)
UNIOCT::!BLOCK	1	;NO. OF 128 WORD BLOCKS SWAPPED OUT(SET BY SWPINT)
;NOTE: FOLLOWING 2 ENTRIES ARE MUTUALLY EXCLUSIVE AND ACCOUNT FOR ALL SEEKS
; ON THIS UNIT EXCEPT END OF CYLINDER AND RECALIBRATION AND SEEK UUOS
UNIMSC::!BLOCK	1	;COUNT OF NO. OF MONITOR+SWAP SEEKS
UNIUSC::!BLOCK	1	;COUNT OF NO. OF USER (BUFFER+DUMP) SEEKS
			; (INCLUDES GETS AND SAVES)

;MORE ERROR STATISTICS:
UNIPCT::!BLOCK	1	;SEEK INCOMPLETE ERRORS (UPDATED BY KONTOLLER ROUTINES
			; RATHER THAN FILSER). NOTE THIS IS DIFFERENT FROM
			; SEARCH ERRORS (SEE UNIHCT,UNISCT)
			;RH=SOFT+HARD SEEK-INCOMPLETE FAILURES
			;LH=POSITIONING FAILURES
			;HARD ERRORS ARE REPORTED TO FILSER AS DEVICE ERRORS TOO
			;FILSER RETRYS 'DSKTRY' TIMES AND COUNTS IN LH UNIHCT,UNISCT
UNIFKS::!BLOCK	1	;FREE K FOR SWAPPING ON THIS UNIT
			; 0 MEANS FULL OR UNIT DOESN'T HAVE SWAPPING SPACE ALLOCATED
UNISUN==:UNIFKS		;THIS LOCATION TIME-SHARED BY ONCE ONLY CODE TO
			; REMEMBER LOG. UNIT # OF UNIT IN ACTIVE SWAPPING LIST
			; -1 IF NOT IN LIST.
UNISDI::!BLOCK	1	;LAST ERROR DATAI STATUS WORD
			; DATA,DEVICE,SEARCH HUNG ERRORS BEFORE RECOVERY ATTEMPTED
UNIHDI::!BLOCK	1	;LAST ERROR DATAI STATUS WORD
			; DATA,DEVICE,SEARCH ERRORS AFTER FIRST RECOVERY ATTEMPT FAILS
UNIECT::!BLOCK	1	;NO. OF CONSECUTIVE TIMES AN ERROR STATUS WAS RETURNED
			; FOR THE LAST OPERATION ON THIS UNIT. (IE, FIRST+RETRIES
			; WITH ERRORS).  SET BACK TO 1 ON FIRST ERROR, RATHER THAN
			; BEGINNING OF NEW OPERATION, SO USER PROGRAMS HAVE MORE
			; TIME TO LOOK AT IT.
    UNPFIR==:400000	    ;SIGN BIT (UNPFIR)=1 DURING FIRST TRY, 0 DURING RETRIES
			    ; THIS BIT IS TOO DYNAMIC TO BE USEFUL FOR DAEMON ERR
			    ; REPORTING
    UNPHRD==:200000	    ;UNPHRD=1 IF LAST ERROR WAS HARD, RESET WHEN RETRY COUNTER
			    ; RESET SO IT IS USEFUL FOR ERROR REPORTING
    UNPHNG==:100000	    ;SET IF DRIVE WAS HUNG
    UNPECC==:40000	    ;SET IF SOME RETRY WAS ECC-CORRECTABLE
    UNPECE==:20000	    ;SET IF ALLOWING ECC-CORRECTION OF ERRORS
UNIHNG::!BLOCK	1	;RH=NO. OF TIME OUTS WHICH WERE RECOVERED
    UNPHNR==:1000	    ;LH BIT TO COUNT HUNGS NOT RECOVERED BY
			    ; STOPPING UNIT (KONSTP) UNIT IN TRANSFER STATE
    UNPHRC==:1		    ;LH BIT TO COUNT HUNGS RECOVERED BY
			    ; STOPPING UNIT (KONSTP) UNIT IN TRANSFER STATE
    UNPHRS==:1		    ;RH BIT TO COUNT HUNGS RECOVERED BY
			    ; RESTARTING UNIT (UUOTWQ OR PIKTRN)
			    ; UNIT WAS IDLE OR TRANSFER WAIT
			    ; AND CHANNEL WAS IDLE.  (MUST BE BIT 35 FOR AOS)
    UNPHPS==:1000	    ;RH BIT TO COUNT NUMBER OF HUNGS
			    ; CAUSED (AND RECOVERED WITHOUT OPERATOR INTEVENTION)
			    ; BY UNIT IN POSITION STATE
UNISTS::!BLOCK	1	;STATUS WORD FOR UNIT - SET, CHANGED BY FILSER ONLY
			;ONLY WHOLE WORD USED SO THAT EXCH TRICK CAN BE USED
			;THESE SAME CODES ARE USED IN DEYCOD BYTE
	ICOD==:0		;IDLE - NO POSITIONING OR TRANSFERRING AND NO QUEUED
				; REQUESTS FOR POSITIONING OR TRANSFERRING
	PWCOD==:ICOD+1		;WAITING TO POSITION WITH IMPLIED TRANSFER INTENDED
	PCOD==:PWCOD+1		;IN PROCESS OF POSITIONING
	TWCOD==:PCOD+1		;WAITING TO DO DATA TRANSFER
	TCOD==:TWCOD+1		;IN PROCESS OF DATA TRANSFER
	MDACOD==:TCOD+1		;ONLY USABLE BY MDA (REREAD HOM BLOCKS, NO COMPARE)
;NOTE THAT THE FOLLOWING CODES MUST BE THE HIGHEST DEFINED
	OWCOD==:MDACOD+1	;WAITING FOR OPERATOR INTERVENTION, FILE IN T STATE
	OCOD==:OWCOD+1		;WAITING FOR OPR INTERVENTION, NO FILE ACTIVE
	OW2COD==:OWCOD+2	;OW, BUT NO MESSAGE ONCE A MINUTE
	O2COD==:OCOD+2		;O, BUT NO MESSAGE
UNICCT::!BLOCK	1
UNIBCT==:UNICCT		;BITS 9-17 = NUMBER OF SLOTS LEFT IN BAT BLOCK FOR UNIT
			; 777 MEANS DONT KNOW
    UNSBCT==^D9		    ;BYTE SIZE
    UNNBCT==^D17	    ;POSITION
UNISNS==:UNICCT		;BITS 0-8=SECTION NUMBER OF SECTION
			; CONTAINING SWAPPING SATS
    UNSSNS==^D9		    ;BYTE SIZE
    UNNSNS==^D8		    ;BYTE POSITION
UNIHOM::!BLOCK	1	;LOGICAL DISK BLOCK NO. WITHIN UNIT (NOT STR) OF THE
			; TWO HOME BLOCKS ON THIS UNIT.
			;LH=FIRST HOME BLOCK, RH=REDUNDANT ONE.  NOTE:
			; LOGICAL BLOCK NOS. ARE NOT USUALLY RESTRICTED TO
			; ANYTHING LESS THAN 36 BITS. HOWEVER THE HOME BLOCKS ARE
			; RESTRICTED TO BEING LOCATED SOMEWHERE ON THE FIRST
			; 262,000 BLOCKS ON THIS UNIT
			;THESE ARE THE ONLY DISK ADDRESSES ASSEMBLED INTO THE
			; MONITOR. ALL OTHER DISK ADDRESSES ARE
			; STORED ON THE DISK, STARTING WITH THE HOME BLOCK
UNIQUE::!BLOCK	1	;LH=ADDRESS OF FIRST (LONGEST WAITING) DEVICE DATA BLOCK (FILE)
			; IN POSITION WAIT FOR THIS UNIT (PW QUEUE)
			;RH=JOB NUMBER FOR DDB WHOSE ADDRESS IS IN LH
			;AS A FLAG, BOTH HALVES ARE SET TO 0 WHEN NO FILES IN
			; POSITION WAIT QUEUE.
			;NOTE: THE FILE WHICH IS IN P STATE IS NOT IN QUEUE
UNIGRP::!BLOCK	1	;LH=NO. OF SEQUENTIAL BLOCKS (NOT CLUSTERS) TO TRY ON
			; SEQUENTIAL OUTPUT (CAN BE CHANGED WITHOUT REFRESHING)
			;BITS	22-26	UNUSED
IFN FTMP,<
UNIPWQ==:UNIGRP		;BIT 18 ON IF THERE IS AN OUTSTANDING CLOCK REQUEST
			; FOR THE OTHER CPU TO PROCESS ITS POSITION WAIT QUEUE
    UNPPWQ==:1B18
>; END IFN FTMP
UNINDU==:UNIGRP		;BIT 19 ON IF WANT TO FLUSH UNIT FROM DISK CACHE
    UNPNDU==:1B19
UNIRHP==:UNIGRP		;BIT 20 ON IF REHEAD OF HOME IS IN PROGRESS
    UNPRHP==:1B20
UNIMSG==:UNIGRP		;BIT 21 ON IF UNIT OFFLINE MSG HAS BEEN PRINTED THIS MINUTE
    UNPMSG==:1B21
UNILKP==:UNIGRP		;BITS 27-35 = LAST KNOWN POSITION OF DISK
			; MEANINGFUL ONLY FOR RP20
    UNSLKP==^D9		    ;BYTE SIZE
    UNNLKP==^D35	    ;BYTE PTR POS
UNIBPU::!BLOCK	1	;NO. OF LOGICAL BLOCKS PER UNIT(RETURNED BY DSKCHR)
UNIBPM::!BLOCK	1	;NO OF LOGICAL BLOCKS PER UNIT INCLUDING MAINTENANCE CYLINDERS
UNIPCI::!BLOCK	1	;NO OF BLOCKS PAGED IN
UNIPCO::!BLOCK	1	;NO OF BLOCKS PAGED OUT
UNICHR::!BLOCK	1	;UNIT CHARACTERISTICS (RETURNED IN DSKCHR UUO)
UNIBPC==:UNICHR		;BITS 0-8 = # BLOCKS/CLUSTER
    UNSBPC==^D9		    ;BYTE SIZE
    UNNBPC==^D8		    ;BYTE PTR POS
UNIBPT==:UNICHR		;BITS 9-17 = # BLOCKS/TRACK
    UNSBPT==^D9		    ;BYTE SIZE
    UNNBPT==^D17	    ;BYTE PTR POS
UNIBPY==:UNICHR		;BITS 18-35= # BLOCKS/CYLINDER (THE SMALLEST IF CYLINDER
    UNSBPY==^D18	    ; HAVE DIFFERENT SIZES (MDF)) - BYTE SIZE
    UNNBPY==^D35	    ;BYTE PTR POS
UNICPS::!BLOCK	1	;RH=NO. OF CLUSTERS PER SAT TABLE ON THIS UNIT
			; (ROUNDED UP IF NOT AN EVEN NUMBER OF CLUSTERS)
UNIWPS==:UNICPS		;# OF WORDS PER SAF BLOCK ON DISK FOR THIS UNIT
			; LIMITED TO 128 WORDS OR CLUSTER SIZE WHICHEVER IS SMALLER
    UNSWPS==^D9		    ;BYTE SIZE
    UNNWPS==^D8		    ;BYTE PTR POS
UNISPU==:UNICPS		;NO. OF SAT BLOCKS ON THIS UNIT
    UNSSPU==^D8		    ;BYTE SIZE
    UNNSPU==^D17	    ;BYTE PTR POS
UNICYL::!BLOCK	1	;PHYSICAL CYLINDER UNIT IS CURRENTLY AT OR POSITIONING TOWARDS.
			; THIS IS ONLY WORD SET AND LOOKED AT BY DEVICE DEPENDENT ROUTINE.
			; USED BY FILSER TO SEE IF UNITS IN POSITION, NEVER CHANGED BY
			; FILSER.  INITIALIZE TO -1 SO FORCE POSITIONING FOR FIRST READ
			; ELSE GET POSITIONING ERROR AND FALSE ERROR DATA
UNIBLK::!BLOCK	1	;LOGICAL BLOCK NUMBER WITHIN THE UNIT.
UNISAB::!BLOCK	1	;LH=ADDR. OF FIRST SAB BLOCK IN RING FOR UNIT
UNITAL::!BLOCK	1	;NO. OF FREE BLOCKS(RESERVED+FCFS) LEFT ON THIS UNIT
UNIDES::!BLOCK	1	;WORD RETURNED IN AC FOR DSKCHR UUO DESCRIBES THIS DISK
			; UNIT IN TERMS OF STR NUMBER, CHANNEL, KONTROLLER UNIT
			; NUMBER. ETC.
			;HENCE, UNIDES RH=(3)CHANNEL NUM(6)KONTROLLER TYPE
			; (3)KONTROLLER NUM(3)UNIT TYPE(3)UNIT NUMBER
    UNPRHB==:400000	    ;SET IF MONITOR MUST REREAD HOME BLOCK BEFORE NEXT
			    ; OPERATION TO INSURE THE PACK ID IS CORRECT.  THE
			    ; MONITOR SETS THIS BIT WHENEVER A DISK PACK GOES OFF LINE.
    UNPOFL==:200000	    ;SET IF THE UNIT IS OFF LINE
    UNPHWP==:100000	    ;SET IF THE UNIT IS HARDWARE WRITE PROTECTED
    UNPWPO==:UNPHWP!UNPOFL  ;WRITE PROTECT OR OFFLINE BITS
    UNPSWP==:40000	    ;SET IF THIS UNIT IS A MEMBER OF A STR WHICH IS
			    ; SOFTWARE WRITE PROTECTED FOR THIS JOB.
			    ;BIT IS NEVER STORED HERE IN UNIT DATA BLOCK.  MUST
			    ; BE COMPUTED ON EACH DSKCHR UUO FOR EACH JOB
    UNPCHG==:UNPSWP	    ;TIMESHARED BIT-A PARAMETER WAS CHANGED SO HOME BLOCK MUST
			    ; BE WRITTEN.  USED ONLY DURING ONCE ONLY CODE THEN
			    ; CLEARED BEFORE SYSTEM STARTED
    UNPSAF==:20000	    ;SET IF UNIT IS MEMBER OF SINGLE-ACCESS F.S.
			    ; NOT STORED IN UNIT DATA BLOCK
    UNPNMU==:UNPSAF	    ;TIMESHARED BIT-A UNIT WHICH BELONGS TO A DISK SET
			    ; NOT MOUNTED TO THIS SYSTEM. USED ONLY DURING ONCE
			    ; ONLY CODE THEN CLEARED BEFORE SYSTEM STARTED
    UNPZMT==:10000	    ;SET IF THIS UNIT IS A MEMBER OF A STR WHOSE MOUNT
			    ; COUNT HAS GONE DOWN TO ZERO, MEANING NO ONE IS
			    ; USING THE STR.  NOT STORED IN UNIT DATA BLOCK.
    UNPTSB==:UNPCHG	    ;TIMESHARED BITS TO CLEAR WHEN EXITING ONCE ONLY CODE
    UNPTSB==:UNPTSB!UNPNMU    ;INCLUDE THIS BIT
UNIPRF==:UNIDES		;UNIT IS A MEMBER OF A PRIVATE STR
    UNSPRF==^D1		    ;BYTE SIZE
    UNNPRF==^D6		    ;BYTE PTR POS
    UNPPRF==:4000	    ;THE BIT
UNIUST==:UNIDES		;UNIT STATUS
    UNSUST==^D2		    ;BYTE SIZE
    UNNUST==^D8		    ;BYTE PTR POS
	UNVPIM==:0		;UNIT IS UP AND PACK IS MOUNTED
	UNVPBM==:1		;UNIT IS UP AND PACK BEING MOUNTED BY OPERATOR
	UNVNPM==:2		;UNIT IS UP BUT NO PACK MOUNTED
	UNVDWN==:3		;UNIT IS DOWN
    UNPMSB==:400	    ;SET IF THIS UNIT HAS MORE THAN ONE SAT BLOCK
    UNPNNA==:200	    ;SET IF THIS UNIT IS A MEMBER OF A STR FOR WHICH THE
			    ; OPERATOR HAS REQUESTED NO NEW ACCESS INIT'S, LOOKUPS, OR
			    ; ENTERS. SET BY PRIVILEGED STRUUO FUNCTION
UNIAWL==:UNIDES		;SET IF THIS STR IS SOFTWARE WRTIE PROTECTED FROM ALL JOBS
    UNSAWL==^D1		    ;BYTE SIZE
    UNNAWL==^D11	    ;BYTE PTR POS
    UNPAWL==:100	    ;THE BIT
    UNPFUS==:40		    ;SET IF THIS UNIT GOT A FILE UNSAFE CONDITION
			    ; AT CONNECT TIME (UUO OR INT). USED TO TELL OPERATOR
			    ; CLEARED WHEN UMT COMES ON-LINE WITH INTERRUPT
    UNPSTS==:UNPAWL	    ;BITS CHANGEABLE BY STRUUO .FSRDF
			    ; EITHER SINGLE ACCESS OR WRITE PROTECTED FROM ALL JOBS
    UNPSTL==:UNPSTS!UNPNNA!UNPRHB!UNPMSB!UNPHWP	;BITS TO BE DETERMINED WHEN STR
			    ; DEFINED (STRUUO-.FSDEF)
UNIWMD==:UNIDES		;UNIT WAITING FOR MDA TO DO SOMETHING
    UNPWMD==:20		    ;THE BIT
    UNPALT==:10		    ;BIT SET IN AC IF THIS IS DUAL PORTED
    UNPUSI==:4		    ;UNIT STATUS INCONSISTENT (BADUNI)
    UNPRSS==:2		    ;REMOVING SWAPPING UNIT
    UNPUNO==:UNPFUS+UNPOFL  ;OFF-LINE + UNSAFE
		;BITS 15 - 17 ARE A CODE WHICH TELLS WHETHER THE ARGUMENT PASSED TO
		; MONITOR IN LOC WAS: (NEVER STORED IN UNIT DATA BLOCK)
		; 0	GENERIC DEVICE DSK OR LOGICAL NAME FOR IT (E.G., DSK)
		; 1	SUBSET OF STR BECAUSE OF AN STR ABBREVIATION
		; 2	STR NAME OR LOGICAL NAME FOR IT (E.G., DSKA)
		; 3	UNIT WITHIN A FILE STRUCTURE OR A LOGICAL NAME FOR IT
		; 	(E.G., DSKA0)
		; 4	A KONTROLLER CLASS NAME OR A LOGICAL NAME FOR IT
		; 	(E.G., DR,FH,DP,MD)
		; 5	A KONTROLLER NAME OR A LOGICAL NAME FOR IT
		; 	(E.G., DRA,FHA,DPA,MDA,DPB)
		; 6	A PHYSICAL DISK UNIT NAME OR A LOGICAL NAME FOR IT
		; 	(E.G., DRA0,DPA3)
		;RH CONFIGURATION INFORMATION:
UNIKTP==:UNIDES		;BITS 21-26 CONTROLLER TYPE
    UNSKTP==^D6		    ;BYTE SIZE
    UNNKTP==^D26	    ;BYTE PTR POS
	TYPDR==:0		; 0	DR (FUTURE DRUM, IF ANY)
	TYPFH==:1		; 1	FH (BURROUGHS DISK OR BRYANT DRUM)
	TYPDP==:2		; 2	DP (MEMOREX RP01,RP02,RP03)
	TYPMD==:3		; 3	MD (BRYANT MASS DISK)
	TYPFS==:4		; 4	FS (RH10/RS04)
	TYPRP==:5		; 5	RP (RH10/RP04,RP05)
	TYPRN==:6		; 6	RN (RH20/RP20)
UNIUTP==:UNIDES		;BITS 30-32 UNIT TYPE - A KONTROLLER DEPENDENT FIELD USED TO
    UNSUTP==^D3		    ; DISTINGUISH VARIOUS OPTIONS OF A UNIT ON ITS KONTROLLER
    UNNUTP==^D32	    ;BYTE PTR POS
    UNPUTP==:10		    ;RIGHT MOST BIT
	FRSTDR==:0		;POSITION OF OR UNIT TYPES ON TABLES IN ONCMOD
		;	0	     0
	FRSTFH==:FRSTDR+2	;POSITION OF FH UNIT TYPES ON TABLES IN ONCMOD
		;	1	     0	BURROUGHS DISK ON RC10
		;		     1	BRYANT DRUM ON RC10
	FRSTDP==:FRSTFH+2	;POSITION OF DP UNIT TYPES ON TABLES IN ONCMOD
		;	2	     0	RP01
		;		     1	RP02
		;		     2	RP03
	FRSTMD==:FRSTDP+3	;POSTION OF MD UNIT TYPES ON TABLES IN ONCMOD
		;	3	     0	DUAL POSITIONER
		;		     1	SINGLE POSITIONER
	FRSTFS==:FRSTMD+2	;POSITION OF FS UNIT TYPES
	FRSTRP==:FRSTFS+1	;POSITION OF RP UNIT TYPES
		;	5	     0	RP04
		;		     1	RP06
		;		     2	RM03
		;		     3	RP07
	FRSTRN==:FRSTRP+4	;POSITION OF RN UNIT TYPES
		;	6	     0	RP20
	FRSTRA==:FRSTRN+1	;POSITION OF RA UNIT TYPES
		;	7	     0	RA80
		;		     1	RA81
		;		     2	RA60
UNIPTR::!BLOCK	1	;LH=-LENGTH OF SWAP SAT TABLE
			;RH=ADDR OF SWAP SAT TABLE (ALWAYS IN CORE)
			; EACH BIT REPRESENTS 1K OF SWAPPING STORAGE
UNISLB::!BLOCK	1	;FIRST SWAP LOGICAL BLOCK # ON THIS UNIT

UNIXRA::!BLOCK	1	;LH=-NUMBER OF BLOCKS WRITTEN VIA EXTENDED RIBS
			;RH=-NUMBER OF BLOCKS READ VIA EXTENDED RIBS
UNICDA::!BLOCK	1	;RH=ADR OF DDB CURRENTLY
			; POSITIONING OR XFERRING ON THIS WAIT
			;LH=FORMER RH (RH ZEROED WHEN UNIT IDLE)
UNIGEN::!BLOCK	1	;GENERATION NUMBER OF UDB (AOS'D WHEN UNIT DISMOUNTED)
UNIRCV::!BLOCK	1	;NUMBER OF RETRIES OF HUNG UNIT WITHOUT RECOVERING
UNISWA::!BLOCK	1	;ADDRESS OF CURRENT SWPLST ENTRY
UNISID==:UNISWA		;TIME-SHARED WORD BY ONCE ONLY TO REMEMBER SWAPPING ID
UNISWD::!BLOCK	1	;DISTANCE (OR TIME TO BLOCK) OF BEST SWAP FOR UNIT

UNIQUL::!BLOCK	1	;LENGTH OF POSITION WAIT QUEUE

UNIBUC::!BLOCK	1	;NO OF BLOCKS ON UNIT IN 10/11 COMPAT.MODE

UNIDIA::!BLOCK	1	;JOB NUMBER,,DDB OF JOB SHUTTING DOWN IO (DIAG.)

IFN FTDUAL!FTCIDSK,<
UNIALT::!BLOCK	1	;RH = ADDRESS OF ALTERNATE PORT (UNLIKE UNI2ND NEVER
			; CHANGES ONCE SET UP BY MATUN)
    CPUMSK==:77		    ;LH = BIT MASK OF CPUS WHICH HAVE ATTACHED THIS PORT
			    ; (BITS 12-17)
UNI2ND::!BLOCK	1	;RH=ADDR OF OTHER PORT
			;LH=-1 IFF THIS PORT IS THE ALTERNATE PORT
			;(I.E. UNI2ND=-1,,<MAIN PORT>)
>; END IFN FTDUAL!FTCIDSK
UNITIM::!BLOCK	1	;HUNG-TIMER (PDVTIM NOT USED FOR DSK DDBS)
UNIJOB::!BLOCK	1	;RH=JOB NUMBER FOR DDB WHOSE ADDRESS IS IN RH(UNICDA)
			; (0 WHEN RH(UNICDA)=0)
			;LH=PREVIOUS RH(UNIJOB)
UNIAJB::!BLOCK	1	;RH NUMBER OF JOB OWNING DA OR ZERO
			;LH NUMBER OF PEOPLE WANTING (WAITERS+USER)
UNIDS2::!BLOCK	1	;MORE STATUS BITS
			;LH BITS
    U2PNRM==:400000	    ;SET IF NON-REMOVABLE MEDIA
    U2PPGA==:200000	    ;SET IF PORT WENT AWAY WITHOUT AN OFF-LINE INTERRUPT
    U2PFEP==:100000	    ;SET IF DRIVE PORTED TO FRONT-END
    U2PDPD==:40000	    ;SET IF DRIVE HAS DUAL-PORT HARDWARE
    U2PNOC==:20000	    ;SET IF MONITOR I/O ON UNIT SHOULD NOT BE CACHED
    U2PIGN==:10000	    ;SET IF NEXT UNIT AVAIL MSG SHOULD BE IGNORED (CI)
UNIKOF==:UNIDS2		;BITS 9-17 "KONTAB" OFFSET
    UNSKOF==^D9		    ;BYTE SIZE
    UNNKOF==^D17	    ;BYTE PTR POS
UNIKNM==:UNIDS2		;BITS 18-26 KONTROLLER NUMBER
    UNSKNM==^D9		    ;BYTE SIZE
    UNNKNM==^D26	    ;BYTE PTR POS
			;BITS 27-35 FREE
IFN FTMDA,<
UNILTM::!BLOCK	1	;UNIVERSAL DATE-TIME OF LOCK ON STR
>;END IFN FTMDA
UNISPT::!BLOCK	1	;RH=ADDRESS OF STORAGE ALLOC. POINTERS (SPT) TABLE
UNIPGT::!BLOCK	1	;PAGE QTR TURNS,,PAGE TURN
			;NO OF TIMES WE REREAD RIB TO GET NEW PNTRS
UNICRC::!BLOCK	1	;MONITOR CACHE READ CALLS
UNICRH::!BLOCK	1	;MONITOR CACHE READ HITS
UNICWC::!BLOCK	1	;MONITOR CACHE WRITE CALLS
UNICWH::!BLOCK	1	;MONITOR CACHE WRITE HITS
UNICBK::!BLOCK	1	;MONITOR BLOCKS CACHED THIS UNIT
UNIK4S::!BLOCK	1	;K FOR SWAPPING ON THIS UNIT
			; WHETHER UNIT IS IN ACTIVE SWAPPING LIST OR NOT
    UNSK4S==^D36	    ;BYTE SIZE
    UNNK4S==^D35	    ;BYTE PTR POS

;THESE MUST BE THE LAST THINGS IN THE UDB.......
UNILAS::!BLOCK	1	;LAST COMMAND ISSUED TO MASSBUS DEVICE

;DAEMON DEPENDS ON NEXT 5 LABELS BEING CONTIGUOUS
UNISCR::!BLOCK	1	;CONTROL REGISTER AT 1ST ERROR
UNIHCR::!BLOCK	1	;CONTROL REGISTER AT END
UNISDR::!BLOCK	1	;DATA REGISTER AT 1ST ERROR
UNIHDR::!BLOCK	1	;DATA REGISTER AT END
UNIEBK::!		;DRIVE REGISTERS SAVED ON ERROR HERE
			;LH=LAST ERROR, RH=1ST ERROR
			;LAST WORD IN BLOCK IS COMMAND WHICH CAUSED THE ERROR

	.ORG
SUBTTL	IPA20 DEFINITIONS -- COMMON PART OF KONTROLLER DATA BLOCK


	.ORG	KDBSIZ

IPKDDB::!BLOCK	1		;ADDRESS OF DRAM DUMP BUFFER AREA

IPKSIZ::!			;LENGTH OF COMMON PART OF KONTROLLER DATA BLOCK

	.ORG
SUBTTL	MAGTAPE DEFINITIONS -- TRB - I/O REQUEST BLOCK


	 .ORG	IRBSIZ

TRBFNC::!BLOCK	1	;FUNCTION DATA
   RB.EXC==:(1B0)	   ;SIGN BIT - UNIT EXCEPTION (TRBSTS NON-ZERO)
   RB.AIO==:(1B1)	   ;THIS REQUEST IS ASYNC
   RB.PCL==:(1B2)	   ;FROM QUEUED PROTOCOL
   RB.PAR==:(1B3)	   ;PARITY THIS REQUEST (1=EVEN)

   RB.DNS==:4		   ;DENSITY BYTE SIZE
   RB.DNP==:^D7		   ;BYTE POSITION OF DENSITY BYTE
      RB.D2==:1		      ;200 BPI
      RB.D5==:2		      ;556 BPI
      RB.D8==:3		      ;800 BPI
      RB.D16==:4	      ;1600 BPI
      RB.D62==:5	      ;6250 BPI

   RB.MDS==:3		   ;MODE BYTE SIZE
   RB.MDP==:^D10	   ;RIGHT MOST BIT OF MODE BYTE
      RB.MCD==:1	      ;CORE DUMP (9 TRK)
      RB.MBY==:2	      ;BYTE MODE (4 8 BIT BYTES/WD - 9 TRK)
      RB.M6B==:3	      ;SIXBIT  (9 TRK SPCL)
      RB.M7B==:4	      ;7 BIT MODE ("MARVELOUS ASCII")
      RB.M7T==:5	      ;7-TRK CORE DUMP (SIXBIT)

   RB.BYS==:RB.MDS+RB.DNS+1 ;PARITY/DENSITY/MODE BYTE
   RB.BYP==:RB.MDP

   RB.RQS==:2		   ;REQUEST STATUS BYTE SIZE
   RB.RQP==:^D12	   ;RIGHT MOST BIT POSITION OF STATUS
      RB.RPN==:1	      ;REQUEST PENDING
      RB.ACT==:2	      ;REQUEST ACTIVE
      RB.DUN==:3	      ;REQUEST DONE

   RB.FNS==:5		   ;FUNCTION BYTE SIZE
   RB.FNP==:^D17	   ;RIGHT MOST BIT OF FCN BYTE
      RB.FRD==:1	      ;READ FORWARD
      RB.FWT==:2	      ;WRITE
      RB.FRB==:3	      ;READ BACKWARDS
      RB.FSR==:4	      ;SPACE FORWARD RECORD
      RB.FBR==:5	      ;SPACE BACKWARD RECORD
      RB.FSF==:6	      ;SPACE FORWARD FILE
      RB.FBF==:7	      ;SPACE BACKWARD FILE
      RB.FLG==:10	      ;WRITE LONG GAP (3")
      RB.FSE==:11	      ;DATA SECURITY ERASE
      RB.FRW==:12	      ;REWIND
      RB.FRU==:13	      ;REWIND AND UNLOAD
      RB.FTM==:14	      ;WRITE TAPE MARK
      RB.FYB==:15	      ;WAIT FOR KONTROLLER IDLE (YELLOW BALL)
      RB.FCR==:16	      ;PERFORM CORRECTION READ
      RB.FRL==:17	      ;READ AT LOW THRESHOLD

TRBSTS::!BLOCK	1	;TERMINATION STATUS
   RB.SER==:(1B0)	   ;NON RECOVERABLE ERROR
   RB.SDE==:(1B1)	   ;0 = CHN/DEV ERR, 1 = DATA ERR
   RB.SED==:(1B2)	   ;SOME ERROR ENCOUNTERED
   RB.STM==:(1B3)	   ;TAPE MARK ENCOUNTERED
   RB.SBT==:(1B4)	   ;HIT BOT
   RB.SET==:(1B5)	   ;HIT EOT
   RB.STL==:(1B6)	   ;RECORD TOO LONG (READ)
   RB.SLK==:(1B7)	   ;WRITE ATTEMPTED ON W.L. TAPE
   RB.SNM==:(1B8)	   ;TAPE DIDN'T MOVE
   RB.SOL==:(1B9)	   ;UNIT OFF LINE
   RB.SRW==:(1B10)	   ;UNIT REWINDING
   RB.SRE==:(1B11)	   ;RECOVERED ERROR (OLD INFO STILL VALID)
   RB.SIL==:(1B12)	   ;ILLEGAL OP
   RB.SEN==:(1B13)	   ;ERROR ON NEXT RECORD (THIS ONE OK)
   RB.SMO==:(1B14)	   ;MONITOR-DIRECTED OFF-LINE
   RB.SAP==:(1B15)	   ;TAPE ALREADY REPOSITIONED FOR ERROR RECIVERY

TRBRCT::!BLOCK	1	;BYTE COUNT OF TRANSFER, IF DATA READ

TRBLEN::!		;LENGTH OF BLOCK
	 .ORG
SUBTTL	MAGTAPE DEFINITIONS -- KONTROLLER TYPES


;KONTROLLER TYPES
	K.TMA==:0		;TM10A
	K.TMB==:1		;TM10B
	K.TC1==:2		;TC10C
	K.TX1==:3		;DX10/TX01/TX02
	K.TM2==:4		;TM02/TM03 ON RH10/RH20
	K.TM2H==:5		;TM02/TM03 ON RH11
	K.DX2==:6		;DX20/TX01/TX02
	K.T78==:7		;TM78
				;10 - 12 RESERVED FOR FUTURE USE BY DIGITAL
				;13 - 17 RESERVED FOR CUSTOMER TYPE CODES
	K.TS1==:17		;SA10/IBM CHANNEL MAGTAPES
	K.MAX==:17		;MAXIMUM KONTROLLER TYPE
SUBTTL	MAGTAPE DEFINITIONS -- SXX - IBM CHANNEL SENSE BYTES


;SENSE BYTE DEFINITIONS
SNSBYT==^D24		;NUMBER OF SENSE BYTES RETURNED
SNSWDS==<SNSBYT+3>/^D4	;NUMBER OF WORDS OF SENSE INFORMATION RETURNED

;S00WRD IS DEFINED PREVIOUSLY

;S01WRD==0		;SENSE BYTE 1 (PDP-10 WORD 0 BYTE 1)
   S01NOI==1B8		   ;NOISE
   S01TUA==1B9		   ;TU STATUS A
   S01TUB==1B10		   ;TU STATUS B
   S017TK==1B11		   ;SEVEN TRACK
   S01BOT==1B12		   ;LOAD POINT
   S01WRT==1B13		   ;WRITE STATUS
   S01WLK==1B14		   ;FILE PROTECTED
   S01NCP==1B15		   ;NOT CAPABLE

;S02WRD==0		;SENSE BYTE 2 (PDP-10 WORD 0 BYTE 2)
   S02TIE==377B23	   ;TRACK IN ERROR BYTE

;S03WRD==0		;SENSE BYTE 3 (PDP-10 WORD 0 BYTE 3)
   S03VRC==1B24		   ;READ/WRITE VRC
   S03MTE==1B25		   ;LRC/MTE
   S03SKW==1B26		   ;SKEW ERROR
   S03CRC==1B27		   ;EDC/CRC ERROR
   S03ENV==1B28		   ;ENV/ECC ERROR
   S03D16==1B29		   ;1600 BPI
   S03BKW==1B30		   ;BACKWARD STATUS
   S03CPC==1B31		   ;C/P COMPARE

;S04WRD==1		;SENSE BYTE 4 (PDP-10 WORD 1 BYTE 0)
   S04REJ==1B1		   ;REJECT TU
   S04TPI==1B2		   ;TAPE INDICATE
   S04WTV==1B3		   ;WRT TRIG VRC
   S04LWR==1B5		   ;LWR
   S04TUC==1B6		   ;TU CHECK
   S04RPQ==1B7		   ;RESERVED FOR RPQ

;S05WRD==1		;SENSE BYTE 5 (PDP-10 WORD 1 BYTE 1)
   S05NSS==1B9		   ;NEW SUBSYSTEM
   S05WTM==1B10		   ;WTM CHECK
   S05PEB==1B11		   ;PE ID BURST CHECK
   S05PRC==1B13		   ;PARTIAL RECORD
   S05PSE==1B14		   ;POSTAMBLE ERROR
   S059MD==1B15		   ;9-TRACK MULTIPLE DENSITY

;S06WRD==1		;SENSE BYTE 6 (PDP-10 WORD 1 BYTE 2)
   S067TK==1B16		   ;7 TRACK
   S06WCF==1B17		   ;WRITE CURRENT FAIL
   S06DTU==1B18		   ;DUAL DENSITY TU
   S06N16==1B19		   ;NOT 1600 BPI
   S06D62==1B20		   ;6250 BPI TAPE
   S06MOD==17B23	   ;TU MODEL (S06D62 IS HIGH ORDER BIT)

;S07WRD==1	   	;SENSE BYTE 7 (PDP-10 WORD 1 BYTE 3)
   S07COL==1B24		   ;COLUMN
   S07LCF==1B25		   ;LEFT COLUMN FAIL
   S07RCF==1B26		   ;RIGHT COLUMN FAIL
   S07RSK==1B27		   ;RESET KEY
   S07DSE==1B28		   ;DATA SECURITY ERASE FAILURE
   S07ERA==1B21		   ;ERASE HEAD
   S07LDF==1B23		   ;LOAD FAILURE

;S08WRD==2   		;SENSE BYTE 8 (PDP-10 WORD 2 BYTE 0)
   S08IBG==1B0		   ;IBG DETECTED

;S09WRD==2		;SENSE BYTE 9 (PDP-10 WORD 2 BYTE 1)
   S09C62==1B8		   ;6250 BPI CORRECTION
   S09VEL==1B9		   ;VELOCITY CHANGE
   S09CBC==1B10		   ;CHANNEL BUFFER CHECK
   S09CRC==1B11		   ;CRC III
   S09D62==1B12		   ;6250 BPT TCU

;S10WRD==2		   ;SENSE BYTE 10 (PDP-10 WORD 2 BYTE 2)
   S10CSR==1B16		   ;COMMAND START REJECT
   S10RND==1B19		   ;RECORD NOT DETECTED
   S10TSF==1B21		   ;TACH START FAIL
   S10VCK==1B23		   ;VELOCITY CHECK

;S11WRD==2		;SENSE BYTE 11 (PDP-10 WORD 2 BYTE 3)
   S11BYT==377B31	   ;RESERVED

;S12WRD==3		;SENSE BYTE 12 (PDP-10 WORD 3 BYTE 0)
	S12BYT==377B7	   ;RESERVED

;S13WRD==3		;SENSE BYTE 13 (PDP-10 WORD 3 BYTE 1)
   S13FET==3B9		   ;TCU FEATURES
   S13TCH==77B15	   ;TCU SERIAL HIGH

;S14WRD==3		;SENSE BYTE 14 (PDP-10 WORD 3 BYTE 2)
   S14TCL==377B23	   ;TCU SERIAL LOW

;S15WRD==3		;SENSE BYTE 15 (PDP-10 WORD 3 BYTE 3)
   S15TUH==377B31	   ;TU SERIAL HIGH

;S16WRD==4		;SENSE BYTE 16 (PDP-10 WORD 4 BYTE 0)
   S16TUL==377B7	   ;TU SERIAL LOW

;S17WRD==4		;SENSE BYTE 17 (PDP-10 WORD 4 BYTE 1)
   S172CH==1B8		   ;2 CHANNEL SWITCH FEATURE
   S17SWF==7B11		   ;SWITCH FEATURES
   S17TCE==17B15	   ;TCU EC LEVEL

;S18WRD==4		;SENSE BYTE 18 (PDP-10 WORD 4 BYTE 2)
   S18TUE==17B23	   ;TU EC LEVEL

;S19WRD==4		;SENSE BYTE 19 (PDP-10 WORD 4 BYTE 3)
   S19TU7==1B24		   ;BUSY STATUS - TU 7
   S19TU6==1B25		   ;            - TU 6
   S19TU5==1B26		   ;            - TU 5
   S19TU4==1B27		   ;            - TU 4
   S19TU3==1B28		   ;            - TU 3
   S19TU2==1B29		   ;            - TU 2
   S19TU1==1B30		   ;            - TU 1
   S19TU0==1B31		   ;            - TU 0

;S20WRD==5		;SENSE BYTE 20 (PDP-10 WORD 5 BYTE 0)
   S20TUF==1B0		   ;BUSY STATUS - TU F
   S20TUE==1B1		   ;            - TU E
   S20TUD==1B2		   ;            - TU D
   S20TUC==1B3		   ;            - TU C
   S20TUB==1B4		   ;            - TU B
   SA0TUA==1B5		   ;            - TU A
   S20TU9==1B6		   ;            - TU 9
   S20TU8==1B7		   ;            - TU 8

;S21WRD==5		;SENSE BYTE 21 (PDP-10 WORD 5 BYTE 1)
   S21BYT==377B15

;S22WRD==5		;SENSE BYTE 22 (PDP-10 WORD 5 BYTE 2)
   S22MDE==377B23	   ;MICROPROGRAM DETECTED ERRORS (PAGE QA025)

;S23WRD==5		;SENSE BYTE 23 (PDP-10 WORD 5 BYTE 3)
   S23M4T==1B24		   ;MOD IV TCU
   S23MDE==177B31	   ;MICROPROGRAM DETECTED ERRORS (PAGE AQ025)
SUBTTL	MAGTAPE DEFINITIONS -- TKB - KONTROLLER DATA BLOCK


	 .ORG	KDBSIZ

TKBCNT::!BLOCK	1		;NUMBER OF RECORDS DONE ON THIS OPERATION

TKBSTS::!BLOCK	1		;KONTROLLER STATUS

TKBJOB::!BLOCK	1		;JOB NUMBER OF MAINT-MODE OWNER
				; TKBJOB MUST IMMEDIATELY PRECEDE TKBCCL
TKBCCL::!BLOCK	<TKWCCL==:5>	;CHANNEL COMMAND LIST

TKBERB::!BLOCK	TRBLEN		;IORB FOR ERROR RECOVERY

IFN FTMP,<
TKBFCT::!BLOCK	1		;FAIRNESS COUNT TO ALLOW QUEUED I/O TO START
				; EVEN IF PENDING REQUESTS ON THIS CPU
>

TKBCRD::!BLOCK	1		;NUMBER OF CHARACTERS READ

TKBCWR::!BLOCK	1		;NUMBER OF CHARACTERS WRITTEN

TKBUDB::!			;TABLE OF POINTERS TO UDBS

	 .ORG
SUBTTL	MAGTAPE DEFINITIONS -- TUB - UNIT DATA BLOCK


	 .ORG	UDBSIZ

TUBAKA::!BLOCK	1		;ACTIVE (CURRENT) KDB ADDRESS
TUBCUR::!BLOCK	1		;POINTER TO CURRENT DDB
TUBDDL::!BLOCK	1		;LABEL DDB ADDRESS
TUBCNF::!BLOCK	1		;CONFIG INFORMATION
TUBSTS::!BLOCK	1		;UNIT STATUS
TUBIEP::!BLOCK	1		;INITIAL ERROR POINTER
TUBFEP::!BLOCK	1		;FINAL ERROR POINTER
TUBQUE::!BLOCK	1		;QUEUE PNTR FOR IORB'S
TUBERR::!BLOCK	1		;ERROR RECOVERY INFO
TUBSTB::!			;BEGINING OF TAPE STATISTICS ERROR RECORD
TUBRID::!BLOCK	1		;REELID
TUBFIL::!BLOCK	1		;NUMBER OF FILES FROM BOT
TUBREC::!BLOCK	1		;NUMBER OF RECORDS FROM EOF
TUBCRD::!BLOCK	1		;NUMBER OF CHARACTERS READ SINCE UNLOAD
TUBCWR::!BLOCK	1		;NUMBER OF CHARACTERS WRITTEN SINCE UNLOAD
TUBSRE::!BLOCK	1		;NUMBER OF SOFT READ ERRORS
TUBHRE::!BLOCK	1		;NUMBER OF HARD READ ERRORS
TUBSWE::!BLOCK	1		;NUMBER OF SOFT WRITE ERRORS
TUBHWE::!BLOCK	1		;NUMBER OF HARD WRITE ERRORS
TUBTME::!BLOCK	1		;TOTAL MEDIA ERRORS SINCE UNLOAD
TUBSTE::!			;END OF TAPE STATISTICS ERROR RECORD
TUBTDE::!BLOCK	1		;TOTAL DEVICE ERRORS SINCE RELOAD
TUBTUN::!BLOCK	1		;TOTAL UNLOADS
TUBTRY::!BLOCK	1		;RETRIES TO RESOLVE ERROR
TUBCCR::!BLOCK	1		;CHAR CNT ON LAST REC
TUBPBE::!BLOCK	1		;POSITION BEFORE ERROR (FILE,,RECORD)
TUBFES::!BLOCK	1		;FINAL ERROR STATE WORD
TPCHMX==:.-TUBRID		;MAX ARG ALLOWED FOR MTACHR UUO
TUBCHR::!BLOCK	1		;STATISTICS FOR MTCHR. UUO
TUBPGM::!BLOCK	1		;PROGRAM NAME ON ERROR
TUBUID::!BLOCK	1		;PPN USING DRIVE ON ERROR
TUBDVC::!BLOCK	1		;DEVICE CODE FOR ERROR LOGGING
TUBKTY::!BLOCK	1		;CHANNEL TYPE FOR ERROR LOGGING
TUBCNI::!BLOCK	1		;ERROR STATUS FOR NEXT RECORD
TUBHTT::!BLOCK	4		;HUNG TIMER TABLE
TUBMTV::!BLOCK	1		;TIMEOUT INCASE NO ACCESS TO SOME PORT
TUBTIM::!BLOCK	1		;RUNNING HUNG TIMER
TUBMDL::!BLOCK	1		;SIXBIT DRIVE MODEL NAME
IFN FTTLAB,<
TUBPTR::!BLOCK	1		;BYTE POINTER TO FILE.EXT
TUBMSG::!BLOCK	1		;LENGTH,,FUNCTION CODE FOR LABEL MESSAGE
TUBPHY::!BLOCK	1		;PHYSICAL NAME FOR LABEL PCS
TUBLBL::!BLOCK	1		;LABEL STATUS WORD
TLMSIZ==.-TUBMSG
TUBLIB::!			;START OF LABEL INFORMATION BLOCK
TUBRFM::!BLOCK	1		;RECORD FORMAT (FOR LABELS ONLY)
TUBRCC::!BLOCK	1		;RECORD SIZE (FOR LABELS ONLY)
TUBBKL::!BLOCK	1		;BLOCK SIZE (FOR LABELS ONLY)
TUBEXP::!BLOCK	1		;EXPIRATION DATE (FOR LABELS ONLY)
TUBPRT::!BLOCK	1		;PROTECTION (FOR LABELS ONLY)
TUBPSN::!BLOCK	1		;FILE POSITION #
TUBFNM::!BLOCK	<^D17+4>/5	;17 CHAR (ASCII) FILE NAME
TUBGVR::!BLOCK	1		;GENERATION + VERSION #
TLPMAX==:.-TUBLIB
> ;END IFN FTTLAB
TUBLEN::!			;LENGTH OF TUB
	.ORG
SUBTTL	MAGTAPE DEFINITIONS -- TPK - DRIVER DISPATCH


	 .ORG	DRVLEN
TPKISR::!BLOCK	1		;INTERRUPT SERVICE
TPKRES::!BLOCK	1		;RESET ACTIVE TRANSFER
TPKSIO::!BLOCK	1		;START I/O
TPKCCF::!BLOCK	1		;COMMAND CHAINING FLAG
TPKCMD::!BLOCK	1		;SET DEVICE COMMAND IN LIST (COMMAND CHAINING)
TPKIDL::!BLOCK	1		;SET DEVICE IDLE
TPKONL::!BLOCK	1		;SKIP IF KONTROLLER ONLINE
TPKSCH::!BLOCK	1		;CAUSE SCHEDULE CYCLE
TPKELG::!BLOCK	1		;MAKE A ERROR LOG ENTRY
TPKEDL::!BLOCK	1		;ENABLE/DISABLE MICROCODE LOADING
TPKLOD::!BLOCK	1		;LOAD MICROCODE
TPKDRV::!BLOCK	1		;AUTOCONFIGURE A SINGLE DRIVE
TPKBSY::!BLOCK	1		;CHECK FOR KONTROLLER BUSY
TPKBSZ::!BLOCK	1		;MAXIMUM BLOCK SIZE ALLOWABLE
TPKLEN::!			;LENGTH OF SERVICE DEPENDENT DISPATCH
	 .ORG


DEFINE	TPK	(PFX,CCF,BSZ),<
	XLIST
	IFIW	PFX'ISR		;;INTERRUPT SERVICE
	IFIW	PFX'RES		;;RESET ACTIVE TRANSFER
	IFIW	PFX'SIO		;;START I/O
IFIDN <CCF><NO>,< EXP	0>	;;NO COMMAND CHAINING FLAG
IFIDN <CCF><YES>,<EXP	-1>	;;COMMAND CHAINING FLAG AVAILABLE
	IFIW	PFX'CMD		;;SET DEVICE COMMAND
	IFIW	PFX'IDL		;;SET DEVICE IDLE
	IFIW	PFX'ONL		;;SKIP IF KONTROLLER ONLINE
	IFIW	PFX'SCH		;;CAUSE SCHEDULE CYCLE
	IFIW	PFX'ELG		;;MAKE A ERROR LOG ENTRY
	IFIW	PFX'EDL		;;ENABLE/DISABLE MICROCODE LOADING
	IFIW	PFX'LOD		;;LOAD MICROCODE
	IFIW	PFX'DRV		;;ATTACH DRIVE
	IFIW	PFX'BSY		;;CHECK FOR KONTROLLER BUSY
	EXP	BSZ		;;MAXIMUM BLOCK SIZE ALLOWABLE
	LIST
;;TPKLEN==:TPKLEN			;;DETECT MULTIPLY DEFINED GLOBALS
> ;END DEFINE TPK
SUBTTL	MAGTAPE DEFINITIONS -- TPNBF - NON-BLOCKING FUNCTION MASK


;MACRO TO DEFINE A MASK OF THE NON-BLOCKING HARDWARE FUNCTIONS
;FOR A GIVEN KONTROLLER

DEFINE	TPNBF	(FCN),<

	ZZ==0
	IRP	FCN,<ZZ==ZZ!<1B0_-RB.F'FCN>>
	EXP	ZZ
	PURGE	ZZ

> ;END DEFINE NBF
SUBTTL	END

	END