Trailing-Edge
-
PDP-10 Archives
-
bb-x130a-sb
-
whosys.mac
There are 4 other files named whosys.mac in the archive. Click here to see a list.
TITLE WHOSYS - Get system information
SEARCH WHOMAC
$SETUP (WHOSYS)
; TABLE OF CONTENTS FOR SYSGET
;
;
; SECTION PAGE
; 1. Main SYS routines
; 1.1 SYSSET - Setup for a new SYS...................... 3
; 2. SYS tables
; 2.1 Define all SYS subfields.......................... 4
; 2.2 Define all fields................................. 5
; 3. STORAGE................................................... 6
SUBTTL Main SYS routines -- SYSSET - Setup for a new SYS
SYSSET::$ONESL SYSCOR,.SBLEN ;SET IT ALL TO -1
SKPYES S.INCREMENTAL## ;SEE IF /INCREMENTAL
POPJ P, ;NO--RETURN NOW
PUSHJ P,.SAVE3## ;SAVE P1,P3
MOVSI P1,-INCLEN ;GET -LEN
MOVEI P2,INCOLD ;POINT TO OLD VALUES
MOVEI P3,INCINC ;POINT TO CURRENT VALUES
SYSS.1: PUSHJ P,@INCGET(P1) ;GET CURRENT VALUE
MOVE T2,T1 ;SAVE
EXCH T1,(P2) ;STORE OLD,,GET PREVIOUS OLD
SUB T2,T1 ;COMPUTE CURRENT-OLD
MOVEM T2,(P3) ;STORE
MOVEI T3,@INCOFF(P1) ;GET OFFSET
MOVEM T2,(T3) ;STORE VALUE
SETZM -1(T3) ;INDICATE WE GOT IT
ADDI P2,1 ;ADVANCE
ADDI P3,1 ;..
AOBJN P1,SYSS.1 ;LOOP
POPJ P, ;AND RETURN
DEFINE INCS,<
X UPT
>
DEFINE X(Z),<EXP SB$'Z>
INCGET: INCS
INCLEN==.-INCGET
DEFINE X(Z),<.SB'Z+SYSCOR>
INCOFF: INCS
SUBTTL SYS tables -- Define all SYS subfields
;This macro fetches a sub-field about the job. If the field has been
;gotten before, it simply returns the known field. If the field has
;not been gotten before, it it derived/computed, stored for later
;use, and returned.
;
;In all cases, the field will be returned in T1, and set in table
;.SBxxx (flag SB%xxx indicates if the field has been gotten)
DEFINE SB$(X,N<1>),<
XLIST
SB%'X==.SBLEN ;;FLAG WORD
.SB'X==.SBLEN+1 ;;DATA WORD
.SBLEN==.SBLEN+2
IFG N-1,.SBLEN==.SBLEN+N
SB$'X:: AOSN SB%'X+SYSCOR ;;DO WE HAVE THE INFO?
JRST SB1'X ;;NO--GO GET IT
MOVE T1,.SB'X+SYSCOR ;;YES--JUST GET IT NOW
POPJ P, ;;AND RETURN
SB1'X: ;;(HERE TO GET INFO)
DEFINE END$,<
XLIST
MOVEM T1,.SB'X+SYSCOR ;STORE
POPJ P, ;AND RETURN
LIST
>
LIST
>;END DEFINE
.SBLEN==0 ;START CLEAN
SUBTTL SYS tables -- Define all fields
SB$(TIM) ;TIME (MILLISECONDS)
MOVX T1,%CNTIM ;GET TIME (JIFFIES)
PUSHJ P,GTAB## ;FETCH
PUSHJ P,TK2MS## ;MAKE MILLISECONDS
END$
SB$(UPT) ;UPTIME (MILLISECONDS)
MOVX T1,%CNSUP ;SYSTEM UPTIME
PUSHJ P,GTAB## ;FETCH
PUSHJ P,TK2MS## ;MAKE MILLISECONDS
END$
SB$(NAM,6) ;SYSTEM NAME
PUSHJ P,.SAVE3## ;SAVE P1-P3
MOVEI P1,.SBNAM+1+SYSCOR ;POINT TO STORAGE
MOVX P2,%CNFG0 ;START WITH NAME
NAM.1: MOVE T1,P2 ;COPY GETTAB
PUSHJ P,GTAB## ;GET IT
MOVEM T1,(P1) ;STORE
ADD P2,[%CNFG1-%CNFG0] ;ADVANCE TO NEXT
CAMG P2,[%CNFG4] ;PAST END?
AOJA P1,NAM.1 ;NO--LOOP FOR ALL
SETZM .SBNAM+1+5+SYSCOR ;INSURE ASCIZ
MOVEI T1,.SBNAM+1+SYSCOR ;RETURN STORAGE
END$
SB$(SCH) ;SCHEDULE BITS
MOVX T1,%CNSTS ;GET SWITCH STATES
PUSHJ P,GTAB## ;FROM MONITOR
HRRZS T1 ;GET SCHED BITS
END$
SB$(NNM) ;HOST NODE NAME
PUSHJ P,SB$NNU ;GET NODE NUMBER
PUSHJ P,ANODE## ;CONVERT TO SIXBIT
MOVE T1,[SIXBIT/CENTRA/] ;FAILED
END$
SB$(SCD) ;SYSTEM CREATION DATE
PUSHJ P,.SAVE1## ;SAVE P1
MOVEI P1,.SBSCD+1+SYSCOR ;POINT TO STORAGE
MOVX T1,%CNDT0 ;GET DATE PART 1
PUSHJ P,GTAB## ;..
MOVEM T1,(P1) ;STORE
MOVX T1,%CNDT1 ;GET DATE PART 2
PUSHJ P,GTAB## ;..
MOVEM T1,1(P1) ;STORE
MOVEI T1,(P1) ;RETURN POINTER TO DATE
END$
SB$(JMX) ;JOBMAX
MOVX T1,%CNSJN ;GET -SEGN,,JOBN+1
PUSHJ P,GTAB## ;..
MOVEI T1,-1(T1) ;ISOLATE JOBN
END$
SB$(SCN) ;STOPCODE NAME
MOVX T1,%SYSPC ;GET LAST STOPCODE
PUSHJ P,GTAB## ;..
HLLZS T1 ;JUST LH
END$
DEFINE SGETS,<
XLIST
X CVN,%CNCVN ;CUSTOMER VERSNION NUMBER
X DVN,%CNDVN ;DIGITAL VERSION NUMBER
X CSN,%CNSER ;CPU0 SERIAL NUMBER
X BBQ,%SSBBQ ;BACKGROUND BATCH QUEUE
X UDT,%CNDTM ;UNIVERSAL DATE/TIME
X DAT,%CNDAT ;DATE (15 BIT FORMAT)
X NNU,.GTLOC ;HOST NODE NUMBER
X LNM,%CNLNM ;LOGNUM
X BNM,%CNBNM ;BATNUM
X LMX,%CNLMX ;LOGMAX
X BMX,%CNBMX ;BATMAX
X BMN,%CNBMN ;BATMIN
X CMX,%NSCMX ;CORMAX
X MDA,%SIMDA ;MDA's PID
X SMS,%CNSIZ ;SYSTEM MEMORY SIZE (WORDS)
X LJR,%CVLJR ;LAST JOB RUN (CPU 0)
X CJR,%CVJOB ;CURRENT JOB RUNNING (CPU 0)
LIST
>
DEFINE X(NAM,ITEM),<
SB%'NAM==.SBLEN ;;FLAG WORD
.SB'NAM==.SBLEN+1 ;;DATA WORD
.SBLEN==.SBLEN+2
SB$'NAM::AOSN SB%'NAM+SYSCOR ;;DO WE HAVE THE INFO?
JRST SB1'NAM ;;NO--GO GET IT
MOVE T1,.SB'NAM+SYSCOR ;;YES--JUST GET IT NOW
POPJ P, ;;AND RETURN
SB1'NAM:MOVX T1,'ITEM ;;GET THE GETTAB REQUEST
PUSHJ P,GTAB## ;;FETCH IT
MOVEM T1,.SB'NAM+SYSCOR ;;STORE
POPJ P, ;;AND RETURN
>
SGETS
SUBTTL STORAGE
$LOW
INCOLD: BLOCK INCLEN
INCINC: BLOCK INCLEN
SYSCOR::BLOCK .SBLEN
END