.MCALL .MODULE .MODULE RESUMR,VERSION=3,COMMENT=,IDENT=NO ; 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. ; ; Edit Who Date Description of modification ; ---- --- ---- --------------------------- ; 001 WLD 13-MAY-1991 Correct UMRSER for SB and FB ; monitors. Model for change taken ; from RESJOB. ;-- ; Edit History: ; 001 George Stevens Overlaid version of RESORC. Created from RESORC ; Version 97 ; 002 George Stevens Fix bug in SHOW UMR when a device is present which ; does not support UMR. .NLIST .INCLUDE /SRC:RESPFX.MAC/ .LIST .SBTTL UMR - List UB information ;+ ; This routine displays information about UB. When the SHOW ALL ; is entered, information is displayed only if UB is loaded. To ; obtain information as to why UB did not load, use SHOW UMR. ;- ORIGIN RESUMR .ENABL LSB SHWUMR:: .PRINT #CRLF ; Skip a line BIT #CF3.UB,$CNFG3(R5) ; Is UB loaded? BEQ 10$ ; Branch if not JMP UBLDED ; Jump if so 10$: TST A$$ ; Is this a show all? BNE 80$ ; Branch if so PRINT UBNLD1,^%UB not loaded, \<200>\% BIT #C2.PC!C2.BUS,$CNFG2(R5) ; Is this a UNIBUS system? BEQ 20$ ; Branch if so PRINT UBNLD2, BR 80$ 20$: .TRPSET #AREA,#TRP1 ; Catch traps to 4 or 10 TST @#UMRCSR ; Is UMR present? NOP ; - Delay BCC 30$ ; Branch if so .TRPSET #AREA,#0 ; Disable trap catcher PRINT UBNLD3, BR 80$ 30$: .TRPSET #AREA,#0 ; Disable trap catcher BIT #C1.XM,$CNFG1(R5) ; Is this an XM system? BNE 40$ ; Branch if not PRINT UBNLD4, BR 80$ 40$: MOV $MEMPT(R5),R1 ; Get address of memory data table CMP $RAMSZ(R1),#256*16 ; Is there more than 256KB of ram? BHI 50$ ; Branch if so PRINT UBNLD5, BR 80$ 50$: .LOOKUP #AREA,#1,#UBXSYS ; Is SY:UBX.SYS present? BCC 60$ ; Branch if so PRINT UBNLD6, BR 80$ 60$: .PURGE #1 ; Purge the channel BIT #CF3.UI,$CNFG3(R5) ; Is UB set noinstal? BEQ 70$ ; Branch if not PRINT UBNLD7, BR 80$ 70$: BIT #CF3.DM,$CNFG3(R5) ; Are there any DMA handlers? BNE LNUBDV ; Branch if so PRINT UBNLD8, 80$: RETURN .DSABL LSB ;+ ; ROUTINE TO LIST THE NAMES OF THE DEVICE HANDLERS WHICH DO NOT SUPPORT UMR ;- ; Get value of $SLOT and pointer to $PNAME and $DVREC .ENABL LSB LNUBDV: MOV S.PNAM(R5),R4 ; R4 = offset from RMON to $PNAME. ADD R5,R4 ; R4 -> $PNAME MOV R4,R3 ; R3 -> $PNAME ; Calculate $SLOT*4 by searching for -1 at end of $ENTRY table 10$: CMP (R3)+,#-1 ; Search for end of $ENTRY table. BNE 10$ ; Keep going MOV R3,R2 ; R2 -> $STAT table TST -(R2) ; R2 -> -1 at end of $ENTRY table SUB R4,R2 ; R2 = bytes in combined tables ; R2 now contains the value $SLOT*4; the size of 2 tables ROR R2 ; R2 = $SLOT*2 ADD R2,R3 ; R3 -> $DVREC table ROR R2 ; R2 = $SLOT ; Register usage ; R2 = $SLOT ; R3 -> $DVREC ; R4 -> $PNAME ; R5 -> $RMON INC 50$ ; Set one time flag .LOOKUP #AREA,#0,#SYSDEV ; Non-file structured lookup on system device BCC 30$ ; Branch if no error 20$: CALLR SEVER ; Else call the error routine 30$: TST (R4) ; Is there a device name here? BEQ 70$ ; Branch if not TST (R3) ; Is there a handler for this device? BEQ 70$ ; Branch if not MOV (R3),R1 ; Get physical block number of handler block 1 DEC R1 ; Get physical block number of handler block 0 .READW #AREA,#0,INBUFF,#256.,R1 ; Read handler block 0 BCC 40$ ; Branch if no error TSTB @#$EMTER ; What kind of error? BEQ 20$ ; Shouldn't happen $ERROR INE,LEVEL=FATAL,RETURN=NO,FILE=MONDEV ; Hard I/O error 40$: MOV INBUFF,R1 ; R1 -> beginning of handler block 0 ADD #H.64UM,R1 ; R1 -> H.64UM BIT #HUM.UB,(R1) ; Is handler ready for UB? BNE 70$ ; Branch if so MOV (R4),PHYNAM ; Get device name ADD #^R X,PHYNAM ; Add in suffix ASR (PC)+ ; Test one time flag 50$: .WORD 0 BCC 60$ MOV #BUFFER,R0 BR 65$ 60$: FORMAT #BUFFER,<\\ \\> 65$: FORMAT ,,<#PHYNAM,#1> .PRINT #BUFFER ; Print message 70$: CMP (R3)+,(R4)+ ; Point to next word in table SOB R2,30$ ; Loop till done .CLOSE #0 ; Close the channel RETURN .DSABL LSB ;+ ; UB LOADED, CHECK TO SEE IF UB ACTIVE ;- UBLDED: BIT #CF3.UA,$CNFG3(R5) ; Is UB active? BNE UMRRPT ; Branch if so PRINT UBACTV, RETURN ;+ ; UB LOADED AND ACTIVE. PRINT UB DATA ; ; INBUFF: ; +-------------------------------+ ; UBDATA: | ^RUBD | ; +---------------+---------------+ ; JOBFLG: | JOB 1 | JOB 0 | BIT 0 = 0 ; +---------------+---------------+ JOB IS SET NO SERIAL ; | JOB 3 | JOB 2 | ; +---------------+---------------+ ; | JOB 5 | JOB 4 | BIT 0 = 1 ; +---------------+---------------+ JOB IS SET SERIAL ; | JOB 7 | JOB 6 | ; +---------------+---------------+ ; UMRCNT: | TOTAL # UMRs IN USE | ; +-------------------------------+ ; PRMCNT: | PERMANENT UMRs IN USE | ; +-------------------------------+ ; TMPCNT: | TEMPORARY UMRs IN USE | ; +-------------------------------+ ; QUECNT: | QELS AWAITING UMR ALLOCATION | ; +-------------------------------+ ; PSTART: | OFFSET TO 1st PERMANENT UMR | ([Word offset] From UMR 0) ; +-------------------------------+ ; | UMR 0 | ; +-------------------------------+ ; | UMR 1 | ; +-------------------------------+ ; . ; . ; . ; +-------------------------------+ ; | UMR 35 | ; +-------------------------------+ ; | UMR 36 | ; +-------------------------------+ ; | IOPAGE UMR (177777) | ; +-------------------------------+ ; ; For UMR 0 thru UMR 36, the entry can be one of two forms depending on ; the state of bit 0. ; ; +-----------------------------+-+ ; | ADDRESS |0| ; +-----------------------------+-+ ; ; bit 15 8 7 6 2 1 0 ; +---------------+-+---------+-+-+ ; | GROUP SIZE | | unused | |1| ; +---------------+-+---------+-+-+ ; ^ ^ ; | | ; GROUP IS PERMANENT --+ | ; UMR IS GROUP HEAD ---------------+ ;- ; Define offsets for UMR data table and UMR entry size table UBDATA= 0 ; Beginning of UMR data table JOBFLG= UBDATA+2 ; Beginning of JOB flags B.SERI= 1 ; 0, job is set NOSERIAL ; 1, job is set SERIAL UMRCNT= JOBFLG+10 ; Total number of UMRs in use PRMCNT= UMRCNT+2 ; Number of permanent UMRs in use TMPCNT= PRMCNT+2 ; Number of temporary UMRs in use QUECNT= TMPCNT+2 ; Queue elements awaiting permanent allocation PSTART= QUECNT+2 ; Offset to 1st permanent UMR from UMRTBL UMRTBL= PSTART+2 ; Beginning of UMR allocation table UMRSIZ= UMRTBL+<32.*2> ; Beginning of UMR cluster size table UTBSIZ= UMRSIZ+<32.*2> ; Size of dynamic storage needed for UMRRPT GRPFRE= 1 ; Group is free GRPHEA= 2 ; UMR is group head GRPPRM= 200 ; Group is permanent UMRRPT: .LOOKUP #AREA,#1,#UBDEV ; Open UB BCS 10$ ; Branch if unsuccessful .SPFUN #AREA,#1,#372,INBUFF,#42.,#0 ; Fetch UMR table BCC 20$ ; Branch if successful 10$: CALLR SEVER ; Else call the error routine 20$: .PURGE #1 ; Purge the channel MOV INBUFF,R3 ; Get address of UMR data ADD #PSTART,R3 ; Get address of 1st perm UMR offset MOV (R3)+,R2 ; R2 = offset to 1st perm UMR MOV R3,R4 ; R3 -> UMR allocation table ADD #UMRSIZ-UMRTBL,R4 ; R4 -> UMR cluster size table 30$: CLR R1 ; Clear UMR cluster size counter 40$: BIT #GRPFRE,(R3) ; Is this group free? BNE 60$ ; Branch if so TST R1 ; Was an address found previously? BNE 50$ ; Branch if so MOV (R3),R0 ; Save last address found 50$: CMP R0,(R3) ; Is last address = UMR address? BNE 100$ ; Branch if not, cluster size in R1 TST (R3)+ ; Point to next UMR alloc. table entry INC R1 ; Increment UMR cluster size counter BR 40$ ; Check some more entries 60$: CLR R0 ; Clear offset to next UMR cluster BIT #GRPHEA,(R3) ; Is this entry a group head? BEQ 80$ ; Branch if not TST R1 ; Is there currently a cluster size? BNE 100$ ; Branch if so, cluster size in R1 BISB 1(R3),R0 ; R0 = Offset to next cluster/2 BEQ 70$ ; Branch if no cluster size MOV R0,R1 ; R1 = cluster size BR 90$ 70$: $ERROR ITB,LEVEL=FATAL,RETURN=NO ;We can't do much, so give up 80$: BISB 1(R3),R0 ; R0 = cluster size BEQ 70$ ; Branch if no cluster size SUB R1,R0 ; R0 = Offset to next cluster/2 ADD R0,R1 ; R1 = cluster size 90$: ASL R0 ; R0 = Offset to next cluster ADD R0,R3 ; R3 -> next UMR cluster 100$: MOV R1,R0 ; Setup loop counter ADD #'0,R1 ; Change cluster size to a character 110$: MOV R1,(R4)+ ; Load cluster size in UMR size table DEC R2 ; Move closer to 1st permanent UMR SOB R0,110$ ; Loop till done TST R2 ; At 1st permanemt UMR? BNE 30$ ; Branch if not MOV INBUFF,R3 ; Get address of end of size table ADD #UTBSIZ,R3 ; R3 -> end of size table 120$: MOV #'P,(R4)+ ; Put permanent character is size tbl CMP R4,R3 ; Done? BLO 120$ ; Branch if not, loop till done ; UMR cluster size table is now loaded with the ASCII character of the ; cluster size or 'P if entry is a permanent UMR. .ENABL LSB UPRTBL: PRINT UMRHDR,< UMR allocation> FORMAT #BUFFER,<[N50:-]> .PRINT #BUFFER MOV INBUFF,R4 ; R4 -> UBDATA ADD #PSTART,R4 ; R4 -> PSTART .ASSUME UMRTBL EQ PSTART+2 MOV (R4)+,R2 ; R2 = offset to first permanent UMR ; R4 -> UMRTBL ASL R2 ; R2 = Byte offer to 1st perm. UMR ADD R4,R2 ; R2 -> 1st permanent UMR MOV R4,R3 ; R3 -> UMRTBL ADD #UMRSIZ-UMRTBL,R3 ; R3 -> UMRSIZ CLR R1 ; R1 = UMR number 10$: MOV #BUFFER,R0 ; R0 -> BUFFER 20$: CALL PTUMRN ; Put UMR number into output string MOVB #' ,(R0)+ ; Outout a space ; FORMAT ,<[B2] >, ; Put UMR number into output string CMP #-1,(R4) ; Is this the end of the UMR table? BEQ 50$ ; Branch if so BIT #GRPFRE,(R4) ; Is this entry free? BNE 40$ ; Branch if so CMP R4,R2 ; Is this a permanent UMR? BLO 30$ ; Branch if not FORMAT ,<..[R]>,<(R4),#1> ; Output device name to string DEC R0 ; - Only 2 character device name FORMAT ,<..> BR 60$ 30$: FORMAT ,<[B6]>,<(R4)> ; Output address to string BR 60$ 40$: FORMAT ,<......> ; Output dashs for free entry to str BR 60$ 50$: FORMAT , ; Output 'IOPAGE' to string 60$: FORMAT ,< [A*] >,<(R3)> ; Output allocation to string CMP #30,R1 ; Is UMR number >= 30 ? BLOS 70$ ; Branch if not ADD #10,R1 ; Setup for next UMR to output ADD #<10*2>,R3 ; - Update ptr to UMRSIZ [word] ADD #<10*2>,R4 ; - Update ptr to UMRTBL [word] BR 20$ 70$: .PRINT #BUFFER ; Print the string CMP #37,R1 ; Done? BEQ 80$ ; Branch if so SUB #27,R1 ; Setup for next string SUB #<27*2>,R3 ; - Update ptr to UMRSIZ [word] SUB #<27*2>,R4 ; - Update ptr to UMRTBL [word] BR 10$ 80$: .PRINT #CRLF ; Skip a line MOV INBUFF,R4 ; Get pointer to UMR data ADD #UMRCNT,R4 ; R4 -> UMRs in use FORMAT #BUFFER,<[U]. UMRs in use>,<(R4)+> .PRINT #BUFFER .ASSUME PRMCNT EQ UMRCNT+2 FORMAT #BUFFER,<[U]. UMRs permanently assigned>,<(R4)+> .PRINT #BUFFER .ASSUME TMPCNT EQ PRMCNT+2 FORMAT #BUFFER,<[U]. UMRs dynamically assigned>,<(R4)+> .PRINT #BUFFER .PRINT #CRLF .ASSUME QUECNT EQ TMPCNT+2 FORMAT #BUFFER,<[U]. requests waiting for UMR allocation>,<(R4)> .PRINT #BUFFER .PRINT #CRLF .ENABL LSB UMRSER: MOV INBUFF,R4 ; R4 -> UBDATA .ASSUME JOBFLG EQ UBDATA+2 TST (R4)+ ; R4 -> JOBFLG CLR R3 ; R3 = job number for .GTJB 10$: .GTJB #AREA,#BUFF,R3 ; Get job information BCS 50$ ; Branch if unsuccessful MOV #BUFF+22,R2 ; R2 -> to job name TST R3 ; BG Job? BNE 11$ ; BR if not. MOV #RESRC,R2 ; Set to display RESORC as job name. 11$: FORMAT #BUFFER,<[S]>, MOV R0,-(SP) ; Save R0 20$: TSTB -(R0) ; Null byte? BNE 30$ ; Branch if not MOVB #BLANK,(R0) ; Make it a blank BR 20$ ; Continue 30$: MOV (SP)+,R0 ; Restore FORMAT ,< = > BITB #B.SERI,(R4) ; Is job set SERIAL? BNE 40$ ; Branch if so FORMAT , 40$: FORMAT , .PRINT #BUFFER 50$: TSTB (R4)+ ; R4 -> JOBFLG for next job TST (R3)+ ; R3 = .GTJB job number of next job CMP #20,R3 ; All jobs done? BNE 10$ ; Branch if not RETURN .DSABL LSB ;+ ; This routine outputs the UMR number as two octal digits into the output ; string pointed to by R0. ; ; R0 is updated to point to the next location after the 2 character string. ;- PTUMRN: MOV R1,-(SP) ; Save UMR number ROR R1 ; Get high octal digit ROR R1 ROR R1 BIC #^C7,R1 ; Use lower 3 bits ADD #'0,R1 ; Convert to an ASCII character MOVB R1,(R0)+ ; Store character into output string MOV (SP),R1 ; Get low octal digit BIC #^C7,R1 ; Use lower 3 bits ADD #'0,R1 ; Convert to an ASCII character MOVB R1,(R0)+ ; Store character into output string MOV (SP)+,R1 ; Restore R1 RETURN .END