Trailing-Edge
-
PDP-10 Archives
-
BB-FP64A-SB_1986
-
10,7/who/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::MOVE T1,[SYSCOR,,SYSCOR+1] ;SET UP BLT
SETOM SYSCOR ;INIT FIRST WORD
BLT T1,SYSCOR+.XBLEN-1 ;SET ALL WORDS 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 XB$'Z>
INCGET: INCS
INCLEN==.-INCGET
DEFINE X(Z),<.XB'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
;.XBxxx (flag XB%xxx indicates if the field has been gotten)
DEFINE XB$(X,N<1>),<
XLIST
XB%'X==.XBLEN ;;FLAG WORD
.XB'X==.XBLEN+1 ;;DATA WORD
.XBLEN==.XBLEN+2
IFG N-1,.XBLEN==.XBLEN+N
XB$'X:: AOSN XB%'X+SYSCOR ;;DO WE HAVE THE INFO?
JRST XB1'X ;;NO--GO GET IT
MOVE T1,.XB'X+SYSCOR ;;YES--JUST GET IT NOW
POPJ P, ;;AND RETURN
XB1'X: ;;(HERE TO GET INFO)
DEFINE END$,<
XLIST
MOVEM T1,.XB'X+SYSCOR ;STORE
POPJ P, ;AND RETURN
LIST
>
LIST
>;END DEFINE
.XBLEN==0 ;START CLEAN
SUBTTL SYS tables -- Define all fields
XB$(TIM) ;TIME (MILLISECONDS)
MOVX T1,%CNTIM ;GET TIME (JIFFIES)
PUSHJ P,GTAB## ;FETCH
PUSHJ P,TK2MS## ;MAKE MILLISECONDS
END$
XB$(UPT) ;UPTIME (MILLISECONDS)
MOVX T1,%CNSUP ;SYSTEM UPTIME
PUSHJ P,GTAB## ;FETCH
PUSHJ P,TK2MS## ;MAKE MILLISECONDS
END$
XB$(NAM,6) ;SYSTEM NAME
PUSHJ P,.SAVE3## ;SAVE P1-P3
MOVEI P1,.XBNAM+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 .XBNAM+1+5+SYSCOR ;INSURE ASCIZ
MOVEI T1,.XBNAM+1+SYSCOR ;RETURN STORAGE
END$
XB$(SCH) ;SCHEDULE BITS
MOVX T1,%CNSTS ;GET SWITCH STATES
PUSHJ P,GTAB## ;FROM MONITOR
HRRZS T1 ;GET SCHED BITS
END$
XB$(NNM) ;HOST NODE NAME
PUSHJ P,XB$NNU ;GET NODE NUMBER
PUSHJ P,ANODE## ;CONVERT TO SIXBIT
MOVE T1,[SIXBIT/CENTRA/] ;FAILED
END$
XB$(SCD) ;SYSTEM CREATION DATE
PUSHJ P,.SAVE1## ;SAVE P1
MOVEI P1,.XBSCD+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$
XB$(JMX) ;JOBMAX
MOVX T1,%CNSJN ;GET -SEGN,,JOBN+1
PUSHJ P,GTAB## ;..
MOVEI T1,-1(T1) ;ISOLATE JOBN
END$
XB$(SCN) ;STOPCODE NAME
MOVX T1,%SYSCD ;GET LAST STOPCODE
PUSHJ P,GTAB## ;..
END$
XB$(PKJ) ;JOB NUMBER THAT LAST POKED
MOVX T1,%CNPUC ;GET JOB,,NUMBER OF POKES
PUSHJ P,GTAB## ;..
HLRZS T1 ;JUST JOB NUMBER
END$
XB$(PKN) ;NUMBER OF POKES
MOVX T1,%CNPUC ;GET JOB,,NUMBRE OF POKES
PUSHJ P,GTAB## ;...
HRRZS T1 ;JUST THE COUNT
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)
X PKA,%CNPOK ;ADDRESS OF LAST POKE
LIST
>
DEFINE X(NAM,ITEM),<
XB%'NAM==.XBLEN ;;FLAG WORD
.XB'NAM==.XBLEN+1 ;;DATA WORD
.XBLEN==.XBLEN+2
XB$'NAM::AOSN XB%'NAM+SYSCOR ;;DO WE HAVE THE INFO?
JRST XB1'NAM ;;NO--GO GET IT
MOVE T1,.XB'NAM+SYSCOR ;;YES--JUST GET IT NOW
POPJ P, ;;AND RETURN
XB1'NAM:MOVX T1,'ITEM ;;GET THE GETTAB REQUEST
PUSHJ P,GTAB## ;;FETCH IT
MOVEM T1,.XB'NAM+SYSCOR ;;STORE
POPJ P, ;;AND RETURN
>
SGETS
SUBTTL STORAGE
$LOW
INCOLD: BLOCK INCLEN
INCINC: BLOCK INCLEN
SYSCOR::BLOCK .XBLEN
END