.MCALL .MODULE .MODULE TRMTBL, VERSION=12, COMMENT= ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. .NLIST CND .SBTTL ************************************** .SBTTL * Multi-Terminal Data Tables For The * .IF NE MMG$T .IF NE SB .SBTTL * Extended Background (XB) Monitor * .IFF ;NE SB .SBTTL * Extended Memory (XM) Monitor * .ENDC ;NE SB .IFF ;NE MMG$T .IF NE RTE$M .SBTTL * RTEM Monitor * .IFF ;NE RTE$M .IF NE SB .SBTTL * Single Background (SB) Monitor * .IFF ;NE SB .SBTTL * Foreground/Background (FB) Monitor * .ENDC ;NE SB .ENDC ;NE RTE$M .ENDC ;NE MMG$T .SBTTL ************************************** .LIST CND .IF NE MTT$Y ;If multi-terminal (runs over entire file) .SBTTL Macro Calls ; .LIBRARY "SRC:HARDWA.MLB" ;+ ; Programmed Request and Miscellaneous Utility Macros ;- .MCALL .ASSUME DEFALT ;SYSMAC ;+ ; Structure Definition Macros ;- .MCALL .QTIDF .TCBDF .TCFDF .TSTDF ;SYSTEM .SBTTL Invoke Structure Definition Macros .QTIDF ;Timer Queue Element Format and Symbol Definitions FIX$ED=0 ;define floating symbols .TCBDF ;Terminal Control Block Format Definition FIX$ED=1 .TCFDF ;Terminal Configuration Bits .TSTDF ;Terminal Status Word (T.STAT) Format Definition .SBTTL Delete Structure Definition Macros (Free Up Workfile Space) .MDELET .QTIDF .TCBDF .TCFDF .TSTDF .SBTTL Conditional Defaults and Error Checking ;+ ; Multi-Terminal Default Definitions ;- DEFALT DLMD$M FLAG ;DL Controller Modem Support (default is no) DEFALT DZMD$M FLAG ;DZ Controller Modem Support (default is no) DEFALT DZV$11 FLAG ;DZV11 Multiplexor Support (default is DZ11) DL11$N =: DL11$L + DL11$M ;# of DL11 controllers/ports = Local + Remote DL$CMAX =: 8. ;Maximum # of DL controllers DZ$PORTS=: DZ11$L + DZ11$M ;# of DZ ports = Local + Remote DZ$CMAX =: 2. + ;Maximum # of DZ controllers (DZ=2, DZV=4) DZ$PPC =: 8. - ;# of DZ ports per controller (DZ=8, DZV=4) ;+ ; Error Checks of DL Conditional Symbol Values ;- .Assume DL11$L GE 1 ;Need at least one local DL11 for console. .Assume DL11$N LE DL$CMAX ;Maximum of 8 DL11 interfaces permitted. ;+ ; Error Checks of DZ Conditional Symbol Values ;- .Assume GE DZ$PORTS ;Error in DZ/DZV specification .Assume DZ11$N LE DZ$CMAX ;Too many DZ/DZV Controllers (max: DZ=2,DZV=4) ;+ ; DH Conditional Symbol Values ;- DEFALT DH11$N 0 ;Number of DH controllers DEFALT DH11$L 0 ;Number of local DH lines DEFALT DH11$M 0 ;Number of remote DH lines DEFALT DHSP$D 7000 ;Default Speed is 9600 baud DEFALT DHLE$N 8. ;Default character length is 8 bits DEFALT DHST$P 1. ;Default Stop Code is 1 unit stop ;+ ; Error Checks of DH Conditional Symbol Values ;- CTRL$N = 0 TOTA$L = 0 .REPT DH11$N .IRP .C.,<\CTRL$N> .ASSUME DHUS$'.C.' LE DHSZ$'.C.' ;Error in DH specification TOTA$L = TOTA$L + DHUS$'.C.' .ENDR CTRL$N = CTRL$N + 1 .ENDR ;DH11$N .Assume TOTA$L EQ ;Inconsistent DH specification ;+ ; Error checks for multi-terminal ;- TOTA$L = + + .Assume TOTA$L LE 17. ;Exceeded limit for serial lines .SBTTL Local Macro Definitions ;+ ; TCBBLK is a Macro to define a Terminal Control Block. ; TYPE = [DL,DZ,DH] ; LINE = [LOCAL,REMOTE] ; CSR = Base Control and Status Register address ; VEC = Base Vector address ; UNIT = Line # (0 for DL, ; 0-7 for DZ, 0-3 for DZV, ; 0-7 for DHQ11,DHV11,CXY08 ; 0-15 for DHF11, DHU11, CXA16, CXB16, CXF32) ; CTRL = Controller number (0-7 for DL, ; 0-1 for DZ, 0-3 for DZV, ; 0-15 for DH series) ;- .MACRO TCBBLK TYPE, LINE, CSR, VEC, UNIT, CTRL .NLIST .NLIST CND .LIST ME .LIST LUN = LUN + 1 CTMP = < PAGE$ + BKSP$ > ;Default to scope mode, no CRLF CTMP2 = 0 STMP = 0 .IF IDN ,
.IF EQ CTRL CTMP = < CTMP + FBTTY$ > STMP = < STMP + CONSL$ > .IF EQ SB STMP = < STMP + SHARE$ > .ENDC ;EQ SB .ENDC ;EQ CTRL .ENDC ;IDN ,
.IF IDN , CTMP = < CTMP + DZSP$D > CTMP2 = < CTMP2 + DZST$P + 30 > / 10 ;/10 STMP = < STMP + DZ11$ > .ENDC ;IDN , .IF IDN , .RADIX 16. .IRP ..C.., <\CTRL> .IRP ..U..,<\UNIT> .IF NDF DH$B'..C..''..U..' CTMP = < CTMP ! DHSP$D > .IFF ;NDF DH$B'..C..''..U..' CTMP = < CTMP ! DH$B'..C..''..U..' > .ENDC ;NDF DH$B'..C..''..U..' .ENDR ;..U.. .ENDR ;..C.. .RADIX 8. CTMP2 = < CTMP2 + <*4> + > STMP = < STMP + DH11$ > .ENDC ;IDN , .IF IDN , CTMP = < CTMP + REMOT$ > STMP = < STMP + HNGUP$ > .ENDC ;IDN , .RADIX 10. .IRP ..., <\LUN-1> .RADIX 8. .IRP .$N$., <\CTRL> .IRP .$U$., <\UNIT> ; TCB for TYPE controller # '.$N$. PUN # '.$U$. (line) TCB.'...:: X = TCB.'... .ENDR ;.$U$.,<\UNIT> .ENDR ;.$N$.,<\CTRL> .ENDR ;...,<\LUN-1> .WORD CTMP ;T.CNFG .WORD CTMP2 ;T.CNF2 .BYTE 0, 0 ;T.TFIL, T.FCNT .WORD 80. ;T.WID .BYTE 0, 0 ;T.OCHR, T.LPOS .WORD 0 ;T.OWNR .WORD STMP ;T.STAT .WORD CSR ;T.CSR .WORD VEC, ;T.VEC, T.PRI .BYTE 0 ;T.JOB .BYTE UNIT ;T.PUN .BYTE 0, 0 ;T.NFIL, T.PTTI .BYTE 0, 0 ;T.TCTF, T.TNFL .WORD 0, 0 ;T.TID .WORD 0 ;T.TTLC .WORD ;T.IRNG **BOOT** .WORD ;T.IPUT **BOOT** .WORD 0 ;T.ICTR .WORD ;T.IGET **BOOT** .WORD + TTBF$I ;T.ITOP **BOOT** .BLKB TTBF$I ;Input Ring Buffer .WORD ;T.OPUT **BOOT** .WORD 0 ;T.OCTR .WORD ;T.OGET **BOOT** .WORD + TTBF$O ;T.OTOP **BOOT** .BLKB TTBF$O ;Output Ring Buffer .IF NE ;If multi-terminal timeout ; or modem control .WORD 0 ;T.RTRY .WORD 0, 0, 0, 0, < C.MTTY + <*2> >, C.SYSV, 0 ;T.TBLK .ENDC ;NE .IF NE MAT$S .WORD 0 ;T.AST .IF NE MMG$T .WORD 0 .ENDC ;NE MMG$T .ENDC ;NE MAT$S .IF NE SYT$K .BYTE 0 ;T.XFLG .BYTE 0 ;T.XCNT .WORD 0 ;T.XPRE .BLKB 6 ;T.XBUF .IF EQ .WORD 8. ;T.CNT .IFF ;EQ .WORD 0 .ENDC ;EQ .ENDC ;NE SYT$K .NLIST .LIST CND .NLIST ME .LIST .ENDM TCBBLK .SBTTL Multi-terminal TCB Pointer Tables and PSW Save Areas .PSECT MTTY$ ;+ ; Table of pointers to TCB's. Ordered by Logical Unit Number. ; TCBLST is a GLOBAL label for the start of the TCB pointer table. ; DLTBL is a label for the start of the DL11 pointers, DZTBL is a ; label for the start of the DZ11 pointers, and DHTBL is a label ; for the start of the DH11 pointers. ;- TCBLST:: ;+ ; Pointers to TCB's for DL11's ;- DLTBL:: ;Reference label CTRL$N = 0 .REPT DL$CMAX .IF GT < DL11$N - CTRL$N > .WORD DLTCB + ;**BOOT** TCB ptr for DL11 #\CTRL$N .ENDC ;GT < DL11$N - CTRL$N > CTRL$N = CTRL$N + 1 .ENDR ;DL$CMAX ;+ ; Pointers to TCB's for DZ11's ;- .IF NE DZ11$N DZTCTB:: ;Table of pointers to DZ11 TCB's PORT$N = 0 .REPT .WORD DZTCB + ;** BOOT ** Pointer to DZ TCB PORT$N = PORT$N + 1 .ENDR ; .ENDC ;NE DZ11$N ;+ ; Pointers to TCB's for DH-type interfaces ;- .IF NE DH11$N DHTCTB:: ;Table of pointers to DH TCB's CTRL$N = 0 ;Controller number PORT$N = 0 ;DH port number .REPT DH11$N .IRP .C.,<\CTRL$N> DHT$'.C.'S = . ;Save base of TCB table for controller '.C.' .REPT DHUS$'.C. .WORD DHTCB + ;**BOOT** Pointer to TCB PORT$N = PORT$N + 1 .ENDR ;DHUS$'.C. DHT$'.C.'E = . ;Save end of TCB table for controller '.C.' CTRL$N = CTRL$N + 1 .ENDR ;.C.,<\CTRL$N> .ENDR ;DH11$N .ENDC ;NE DH11$N TCBMAX ==: <. - TCBLST> / 2 ;+ ; Table of pointers to the first TCB for each DZ controller. ; Indexed by priority bits from PSW at interrupt time. ;- .IF NE DZ11$N DZTBL:: ;Reference label CTRL$N = 0 .REPT DZ11$N .WORD DZTCTB + ;**BOOT** ;-> to Table of TCB ->'s CTRL$N = CTRL$N + 1 .ENDR ;DZ11$N .ENDC ;NE DZ11$N TCBPEND:: ;Reference label for boot ;+ ; Save area for PSW if Multiple DL11 controllers OR high speed ring buffer ;>>>??? Is <2*HSR$B> needed in following conditional??? ASSUMING DL11$N > 0 ?? ;- .IF GT < DL11$N - 1 > + <2*HSR$B> DLTMP:: .WORD 0 ;PSW save area for DL11's .ENDC ;GT < DL11$N - 1 > + <2*HSR$B> ;+ ; Save area for PSW if multiple DZ11 controllers ;- .IF GT < DZ11$N - 1 > DZTMP:: .WORD 0 ;PSW save area for multiple DZ's .ENDC ;GT < DZ11$N - 1 > ;+ ; Save area for PSW if multiple DH11 controllers ;- .IF GT < DH11$N - 1 > DHTMP:: .WORD 0 ;PSW save area for multiple DH's .ENDC ;GT < DH11$N - 1 > ;+ ; Table of DZ controller CSRs. ; Filled in at boot-time from CSR in first TCB for a controller. ; Indexed by priority bits from PSW at interrupt time. ;- .IF NE DZ11$N DZCSR:: ;Table of CSR'S for DZ11 .REPT DZ$CMAX .WORD 0 .ENDR ;DZ$CMAX .ENDC ;NE DZ11$N ;+ ; DH Controller Information Table ;- .IF NE DH11$N DHTBL:: CTRL$N = 0 .REPT DH11$N .RADIX 16. .IRP .C.,<\CTRL$N> DHCIT'.C.':: ;DH Controller '.C.' Information block .WORD DHCS$'.C.' ;CSR DHCTF'.C.':: .WORD DHT$'.C.'S ;Address of TCB pointer table **BOOT** DHCTL'.C.':: .WORD DHT$'.C.'E ;Address of word following last TCB **BOOT** .BYTE DHUS$'.C.' ;Number of lines used on controller '.C.' .BYTE 0 ;reserved .ENDR ;.C. .RADIX 8. CTRL$N = CTRL$N + 1 .ENDR ;DH11$N .ENDC ;NE DH11$N .SBTTL Multi-terminal TCB's ;+ ; Terminal Control Blocks allocated in order of increasing unit number: ; Local DL11 lines first, then remote DL11s, then local DZ11 lines, then ; remote DZ11 lines. Logical unit 0 is the boot-time Console LUN. ;- LUN = 0 ;Initialize logical unit counter DLTCB:: ;Reference label CTRL$N = 0 ;Initialize Controller Number .REPT DL$CMAX .IRP .$C$.,<\CTRL$N> .IF GT < DL11$L - CTRL$N > ;TCB for local DL11 #'.$C$. TCBBLK DL, LOCAL, DLC$'.$C$., DLV$'.$C$., 0, CTRL$N .IFF ;GT < DL11$L - CTRL$N > .IF GT < DL11$N - CTRL$N > ;TCB for remote DL11-E #'.$C$. TCBBLK DL, REMOTE, DLC$'.$C$., DLV$'.$C$., 0, CTRL$N .ENDC ;GT < DL11$N - CTRL$N > .ENDC ;GT < DL11$L - CTRL$N > .ENDR ;.$C$. CTRL$N = CTRL$N + 1 ;Next Controller .ENDR ;DL$CMAX DZTCB:: ;Reference label CTRL$N = 0 ;Initial Controller Number .REPT DZ$CMAX .IRP .$C$.,<\CTRL$N> PORT$N = 0 ;Initial Port Number .REPT DZ$PPC .IRP .$P$.,<\PORT$N> .IF GT < DZ11$N - CTRL$N > .IF GT < DZ11$L - - PORT$N > ;TCB-local DZ #'.$C$. line #'.$P$. TCBBLK DZ, LOCAL, DZCS$'.$C$., DZVC$'.$C$., PORT$N, CTRL$N .IFF ;GT < DZ11$L - - PORT$N > .IF GT < DZ$PORTS - - PORT$N > ;TCB-remote DZ #'.$C$. line #'.$P$. TCBBLK DZ, REMOTE, DZCS$'.$C$., DZVC$'.$C$., PORT$N, CTRL$N .ENDC ;GT < DZ$PORTS - - PORT$N > .ENDC ;GT < DZ11$L - - PORT$N > .ENDC ;GT < DZ11$N - CTRL$N > .ENDR ;.$P$. PORT$N = PORT$N + 1 ;Next Port .ENDR ;DZ$PPC .ENDR ;.$C$. CTRL$N = CTRL$N + 1 ;Next Controller .ENDR ;DZ$CMAX DHTCB:: ;DH TCB area CTRL$N = 0 ;Controller number PORT$N = 0 ;DH Port number .REPT DH11$N ;For each controller, .IRP .C.,<\CTRL$N> ; for this controller, ...CSR = DHCS$'.C. ...VEC = DHVC$'.C. PUN$N = 0 .REPT DHUS$'.C. ; for each line on this controller .IF LT TCBBLK DH, LOCAL, ...CSR, ...VEC, PUN$N, CTRL$N ;DH local line .IFF ;LT TCBBLK DH, REMOTE, ...CSR, ...VEC, PUN$N, CTRL$N ;DH remote line .ENDC ;LT PUN$N = PUN$N + 1 PORT$N = PORT$N+1 .ENDR ;DHUS$'.C. .ENDR ;.C.,<\CTRL$N> CTRL$N = CTRL$N+1 .ENDR ;DH11$N .ENDC ;NE MTT$Y ;Runs over entire module .END