Google
 

Trailing-Edge - PDP-10 Archives - AP-D471B-SB_1978 - mcss.mac
There are no other files named mcss.mac in the archive.
UNIVERSAL MCSS - MCS CONFIGURATION FILE MACROS
SUBTTL /CDO/ILG  29 MAR 77

;***COPYRIGHT (C) 1974, 1975, 1976, 1977 DIGITAL EQUIPMENT CORP., MAYNARD, MASS.***


	.VRMSS==:2		;VERSION OF MCSS IN USE
	MSSEDT==7		;MINOR EDIT NUMBER


	.DIRECTIVE	.NOBIN	;ONLY UNIVERSAL FILE NEEDED

	SALL

; REVISION HISTORY
;1		ADD VERSION NUMBER AND MACRO TO CHECK AGAINST GEN
;2		REMOVE UNNECESSARY JOB TABLES
;3		ADD NEW ENTRY TO LEAF MACRO FOR SELECTIVE FAILSOFTING
;4		RE-WORK %PORT AND %SRC MACROS FOR SUPPORT OF "FREE" PORTS
;5		REDUCE NUMBER OF WORDS GENERATED BY %SRC
;6		ADD .DIRECTIVE .NOBIN SINCE REL FILE NEVER NEEDED
;7		ADD ANOTHER WORD GENERATED BY %SRC MACRO


	RADIX 10
SUBTTL GENERAL PURPOSE MACROS

	DEFINE $VRCHK(A)<
	.VRGEN==:A
	IFN .VRGEN-.VRMSS,<
	PRINTX ?MGNVSB VERSION SKEW BETWEEN MCSGEN AND MCSS
	PASS2
	END>
  > ;END OF $VRCHK DEFINITION

DEFINE	GATHER(A)<
	IFE	CHAR-5,<
		ZZ==ZZ_1
		EXP	ZZ
		ZZ==0
		CHAR==0>;;END OF IFN
	ZZ==ZZ_7+"A"
	CHAR==CHAR+1
>; END OF MACRO GATHER

DEFINE	FINISH<
	IFE	CHAR-5,<
		ZZ==ZZ_1
		EXP	ZZ
		ZZ==0
		CHAR==0>;;END OF IFN
	ZZ==ZZ_7
	CHAR==CHAR+1
>; END OF MACRO FINISH

DEFINE	GETNAME(NAME,SIZE,TYPE)<
	ZZ==0
	N==0
	CHAR==0
	IRPC	NAME,<
		N==N+1
		IFGE	SIZE-N,<GATHER(NAME)>;; END IFGE >;; END OF IRPC
	REPEAT	SIZE-N,<
		FINISH>;; END OF REPEAT
	IF1,	
	   <IFL	SIZE-N,
		<PRINTX ?'TYPE "NAME" TOO LONG. TRUNCATED>>
	IFN	CHAR,<REPEAT 5-CHAR,<FINISH>
				EXP ZZ_1 ;;FILL OUT LAST WORD>;; END OF IFN
>; END OF MACRO GETNAME


DEFINE	CONCAT(A)<
	IFE	CHAR-5,<
		ZZ==ZZ_1
		EXP	ZZ
		ZZ==0
		CHAR==0>;;END OF IFN
	ZZ==ZZ_7+A
	CHAR==CHAR+1
>; END OF MACRO CONCAT

DEFINE	MAKEWORD(NAME)<
	IRP	NAME,<
		N==N+1
		IFGE	.SIZE-N,<CONCAT(NAME)>;; END IFGE >;; END OF IRPC
	REPEAT	.SIZE-N,<
		PAD>;; END OF REPEAT
>

DEFINE	PAD<
	IFE	CHAR-5,<
		ZZ==ZZ_1
		EXP	ZZ
		ZZ==0
		CHAR==0>;;END OF IFN
	ZZ==ZZ_7
	CHAR==CHAR+1
>; END OF MACRO PAD

DEFINE	GETSTR(NAME,SIZE,TYPE)<
	ZZ==0
	N==0
	CHAR==0
	.SIZE==SIZE
	MAKEWORD(NAME)
	IF1,	
	   <IFL	SIZE-N,
		<PRINTX ?'TYPE "NAME" TOO LONG. TRUNCATED>>
	IFN	CHAR,<REPEAT 5-CHAR,<PAD>
				EXP ZZ_1 ;;FILL OUT LAST WORD>;; END OF IFN
>; END OF MACRO GETSTR
	SUBTTL	MESSAGE CLASS MACRO

	TRUE=1
	FALSE=0

	SYSNAMLEN==24

	DEFINE %MCLASS(A)<
	GETNAME(A,MCSIZE,MESSAGE CLASS NAME)
	%MCNT=%MCNT+1>;; END OF %MCLASS

	MCSIZE=8		;; CONSTANT FROM ASCII SPEC

	SUBTTL	PASSWROD MACRO

DEFINE	PASSWORD(A)<
	PCOUNT=PCOUNT+1
	GETNAME(A,^D10,PASSWORD)
>; END OF MACRO PASSWORD

	SUBTTL	TREE MACROS

	NODENAMESIZE=^D12

DEFINE	NODE(NAME,PARENT,MPP,THRESHOLD,NXTND,NXTSAM,LEVEL)<
	GETNAME(NAME,NODENAMESIZE,NODE NAME)		;;NAME
	XWD	PARENT,0	;;POINTER TO PARENT,,0
	XWD	MPP,THRESHOLD	;;MPP TO START,,MPPSTARTINGCRITERIA
	XWD	NXTND,NXTSAM	;;NEXT LEVEL,,NEXT THIS LEVEL
	BYTE (18)0(1)0(2)LEVEL(1)0(14)0	;;QUOTA,STATUS,LEVEL,CHKPNT,LEAF NUMBER
>


	CHKPNT=1
	NOCHKPNT=0

DEFINE	LEAF(NAME,PARENT,MPP,THRESHOLD,NXTND,NXTSAM,LEVEL,QUOTA,STATUS,DOCHKPNT)<
	LEAFNO=LEAFNO+1
	GETNAME(NAME,NODENAMESIZE,LEAF NAME)		;;NAME
	XWD	PARENT,0	;;POINTER TO PARENT,,0
	XWD	MPP,THRESHOLD	;;MPPTOSTART,,MPPSTARTINGCRITERIA
	IFN	NXTND,
		<PRINTX ?LEAF NAME HAS A NON-ZERO VALUE FOR NEXT NODE>
	XWD	NXTND,NXTSAM	;;NEXTLEVEL,,NEXT THIS LEVEL
	BYTE (18)QUOTA(1)STATUS(2)LEVEL(1)DOCHKPNT(14)LEAFNO
	EXP	0,0		;; LEAVE ROOM FOR GROUP HEADERS ETC.
>



	ENABLED=0
	DISABLED=1
	SUBTTL	LEAF TABLE MACRO

DEFINE	%LFTAB(NAME,LEAFPTR,STATUS)<
	IFNB <NAME>,<
	GETNAME(NAME,12,LEAF TABLE NAME)
	BYTE	(18)LEAFPTR(1)STATUS(17)0
	EXP	0
	>;; END OF IFNB ON %LFTAB
	IFB	<NAME>,<EXP 0>;;END OF IFB
>;;END OF %LFTAB MACRO

	SUBTTL	MPP TABLE MACRO

	DEVLEN==6
	NAMLEN==6

; NOTE.. ARGUMENT "LOCK" IS NO LONGER USED AND THE KERNEL TOOK 1B18 IN MP$HPQ

DEFINE	%MPP(TYPE,NEXTALT,DEV,NAME,PPN,COR,MIN,MAX,INITIAL,HPQ,LOCK,LOCAL,IMORTL)<
	IFNDEF	MP$BEG,<MP$BEG==.>
	IFNDEF	MP$ALT,<MP$ALT==:.-MP$BEG>
	XWD	TYPE, NEXTALT
	IFNDEF	MP$DEV,<MP$DEV==:.-MP$BEG>
	GETNAM(DEV,DEVLEN,MPP DEVICE NAME)
	IFNDEF	MP$MPP,<MP$MPP==:.-MP$BEG>
	IFE LOCAL,<GETNAM(NAME,NAMLEN,MPP FILE NAME)>	; IF NOT LOCAL MPP GATHER NAME
	IFN LOCAL,<EXP NAME,0>		; IF LOCAL STORE ROUTINE ADDR
	IFNDEF	MP$PPN,<MP$PPN==:.-MP$BEG>
	XWD	PPN
	IFNDEF	MP$COR,<MP$COR==:.-MP$BEG>
	EXP	COR
	IFNDEF	MP$COP,<MP$COP==:.-MP$BEG>
	XWD	MIN, MAX
	IFNDEF	MP$RUN,<MP$RUN==:.-MP$BEG>
	XWD	INITIAL, 0
	IFNDEF	MP$HPQ,<MP$HPQ==:.-MP$BEG>
	BYTE	(18)HPQ (1)0 (1)LOCAL (1)IMORTL (15)0
>
	SUBTTL	PORT TABLE MACRO

DEFINE	%PORT(NAME,SRCTAB)<
	<SIXBIT /NAME/>
IFNB <SRCTAB>,< XWD 0,SRCTAB>
IFB <SRCTAB>,< XWD TTLAST+<FREEPORTS*<TT2-TT1>>,0
		FREEPORTS==FREEPORTS+1>
	EXP	0>
	SUBTTL	SOURCE TABLE MACROS

	INACC==2
	ACC==3

DEFINE SETARRAY(WHICH,WHICH1,WHAT)<WHICH'WHICH1==WHAT>

DEFINE OUTARRAY(WHICH,WHICH1)<EXP WHICH'WHICH1>

DEFINE SETLF(INDEX,.OFFSET,WHAT)<
	IFN	<L2F'INDEX & <WHAT>B<.OFFSET>>,<LFERR==1>
	IFE WHAT-3,<
		L2F'INDEX==L2F'INDEX ! <WHAT>B<.OFFSET>
		L1F'INDEX==L1F'INDEX & < -<<3>B<.OFFSET> > - 1 >
		>
	IFE WHAT-2,<
		L2F'INDEX==L2F'INDEX ! <WHAT>B<.OFFSET>
		L1F'INDEX==L1F'INDEX ! <WHAT>B<.OFFSET>
		>
	IFE WHAT-1,<
		L2F'INDEX==L2F'INDEX ! <WHAT>B<.OFFSET>
		L1F'INDEX==L1F'INDEX ! <WHAT>B<.OFFSET>
		>
	IFE WHAT,<
		L2F'INDEX==L2F'INDEX ! <1>B<.OFFSET>
		L1F'INDEX==L1F'INDEX & < -<<1>B<.OFFSET> > - 1 >
		>
>;; END OF SETLF MACRO


DEFINE LFERROR(WHICH,TTY)
<PRINTX ?STATUS OF LEAF #'WHICH MULTIPLY
PRINTX DEFINED FOR TERMINAL #'TTY
>

DEFINE SETLEAF(A)<
	LFERR==0
	SLFIRST==0
	DIT=2			;; THE ASSUMPTION IS MADE THAT IF THIS
				;;  ROUTINE IS CALLED THEN DIT WILL
				;;  ALWAYS BE SOME.

	IRP A<IFE SLFIRST,<WHICH==A>
		IFN SLFIRST,<
		INDEX==A/18
		.OFFSET==<<A-<INDEX*18>>*2>+1
		SETLF(\INDEX,.OFFSET,WHICH)
		IF1,<IFN LFERR,<LFERROR(\WHICH,\<SRCCNT+1>)>;;END IFN LFERR
		>;; END IF1
	>;;END OF IFN SLFIRST
	SLFIRST==1>;;END OF IRP A
>;; END OF SETLEAF MACRO

DEFINE	SETACCESS(A)<
;; EXPECTED FORMAT FOR A::
;;	FIRST VALUE = THE STATUS WHICH MOST OF THE LEAVES HAVE
;;	SECOND AND FOLLOWING = PAIRS:: STATUS FOR LEAF,LEAF NUMBER
;;		ENDCLOSED IN ANGLE BRACKETS

	FIRST==0
	IRP	A<IFE FIRST,<
		OK=1
		IFE	A,< OK=0
			DIT=0
			I==0
			REPEAT LFSTSSIZE,<SETARRAY(L1F,\I,0)
					I==I+1>;; END OF REPEAT>;; END OF IFE
		IFN	A&2,<OK=0
			DIT=3
			I==0
			REPEAT LFSTSSIZE,<SETARRAY(L1F,\I,-1)
					I==I+1>;; END OF REPEAT>;; END OF IFE
		IFE	A-1,< OK=0
			DIT=3
			I==0
			REPEAT LFSTSSIZE,<SETARRAY(L1F,\I,^O252525252525)
					I==I+1>;; END OF REPEAT>;; END OF IFE
		IF1,<IFN OK,<PRINTX ?INVALID MOSTLY>>;;END OF IF1
		I==0
		REPEAT LFSTSSIZE,<SETARRAY(L2F,\I,0)
				I==I+1>;; END OF REPEAT>;;END OF IFE FIRST

	IFN FIRST,<SETLEAF(A)>;;END OF IFN FIRST

	FIRST==1>;; END OF IRP A


	IFDEF	ERRLN,<SETLEAF(<ACC,ERRLN>)>	;; END OF IFDEF
	IFDEF	DCRLN,<SETLEAF(<ACC,DCRLN>)>	;; END OF IFDEF
	IFDEF	DMRLN,<SETLEAF(<ACC,DMRLN>)>	;; END OF IFDEF
	IFDEF	SONLN,<SETLEAF(<ACC,SONLN>)>	;; END OF IFDEF
	IFDEF	SOFFLN,<SETLEAF(<ACC,SOFFLN>)>	;; END OF IFDEF
>;; END OF SETACCESS MACRO

DEFINE	OUTBLOCK<
	I==0
	REPEAT LFSTSSIZE,<OUTARRAY(L1F,\I)
			I==I+1>;; END OF REPEAT
>;; END OF OUTBLOCK MACRO

	SRCNAMESIZE=12

;; NOTE:: ALTERNATE TERMINALS, PORT (IF CONV), & PHONE # TO BE ADDED
;; ====

DEFINE	%SRC(NAME,ED,LFSTS,ALTLST,%INITBL)<
IFNB	<NAME>,<
	GETNAME(NAME,SRCNAMESIZE,SOURCE NAME)	;;EXPAND TERMINAL NAME ( 3 WORDS)
	EXP	0, 0, 0, 0, 0		;;TSN, IGH, (SOT,,DFGCNT), DGHS, CHUNKS
	SETACCESS(LFSTS)		;;SET DIT STATUS
	BYTE	(18)0 (8)0 (1)ED (1)0 (1)1 (1)0 (2)DIT (1)0 (1)ED (2)DIT
	IFB <ALTLST>,<XWD 0,%INITBL>	;;NO ALTERNATES,,PTR TO INI LEAF STATUS TABLE
	IFNB <ALTLST>,<	XWD ALTLST,%INITBL >	;; ALTERNATE PTR,,INITIAL L.S. TABLE
	0				;;OUTPUT CHAIN ( PREV,,NEXT )
	OUTBLOCK			;;EXPAND LEAF STATUS TABLE
%INITBL:OUTBLOCK			;;AND AGAIN FOR TEMPLATE
	SRCCNT=SRCCNT+1
	>;;END OF IFNB
IFB	<NAME>,<
TTLAST:	BLOCK	FREEPORTS*<TT2-TT1>
	SRCCNT=SRCCNT+1
	Z					;; END OF SRCTAB
>
	>;; END OF %SRC MACRO
SUBTTL JOB SLOT TABLE DEFINATIONS
	DEFINE	$JBTBL,<
	LALL
JB$MPP::BLOCK	MAXJSN	;XWD 0,POINTER TO THE PROTOTYPE MPP
			;=0 IF THE JOB SLOT IS UNASSIGNED
JB$UDX::BLOCK	MAXJSN	;SYSTEM JOB#,,UDX
JB$PID::BLOCK	MAXJSN	;PID FOR IPCSER
JB$MLF::BLOCK	MAXJSN	;MCS LOGIC FLAGS
RECVQ::	.+1		;
	BLOCK	MAXJSN	;RECEIVE QUEUE
SENDQ::	.+1		;
	BLOCK	MAXJSN	;SEND QUEUE

LHTSN::	BLOCK	1
RHTSN::	BLOCK	1
	SALL
>;END OF $JBTBL




	END				; END OF MCSS