Google
 

Trailing-Edge - PDP-10 Archives - tops10_703a_sys_ap115_bb-ju01b-bb - sclink.c14
There are 3 other files named sclink.c14 in the archive. Click here to see a list.
 REP 4/7	;14C1
		SCNHSZ==^D223		;Hash table size
 WIT
	IFN FTOPS20,<
		SCNHSZ==^D223		;Hash table size
	>; END IFN FTOPS20
	IFN FTOPS10,<
		SCNHSZ==^D509		;Hash table size (largest prime less than 512)
		MAPBAS==777,,000000	;Base Pseudo address used in pseudo map
	>; END IFN FTOPS10
 REP 10/11	;14C2
	SCTCCR::MOVEI T1,SCNHSZ		;HASH TABLE SIZE
		OPSTR <ADD T1,>,IBMXA,+IBBLK ;PLUS NUMBER OF NODES IN AREA
		ADDI T1,1		;AND AN EXTRA WORD FOR NODE 0
 WIT
	SCTCCR::OPSTR <MOVE T1,>,IBMXA,+IBBLK ;NUMBER OF NODES IN AREA
		ADDI T1,1		;AND AN EXTRA WORD FOR NODE 0
		ADD T1,SCTMPS		;AND SIZE OF PSEUDO MAP
 REP 54/36	;14C3
		  STOR T2,SLSOB,(SL)	;SAVE IT FOR SYSDPY AND THE LIKE
 WIT
		  STOR T2,SLDOB,(SL)	;SAVE IT FOR SYSDPY AND THE LIKE
 REP 17/70	;14C4
		STOR T1,SLDOB,(SL)	; and store as destination PDB in SLB
 WIT
		STOR T1,SLSOB,(SL)	; and store as source PDB in SLB
 REP 50/104	;14C5
		OPSTR <CAME T2,>,SLSOB,(SL) ;The same object numbers?
 WIT
		OPSTR <CAME T2,>,SLDOB,(SL) ;The same object numbers?
 REP 34/116	;14C6
		CAIE T1,SC.VER		;SAME AS OURS?
 WIT
		CAIGE T1,SC.VER		;SAME AS OURS?
 REP 53/124	;14C7
		MOVEM T1,HSHTAB		;Save hash table address
		ADDI T1,SCNHSZ		;Add hash table size
		MOVEM T1,ADRTAB		;Save node address table address
	IFN FTOPS10,<
		OPSTR <ADD T1,>,IBMXA,+IBBLK ;Compute end of allocation
		ADDI T1,1		;...
		MOVEM T1,DCNVFF##	;Update DECnet first free address
 WIT
	IFN FTOPS20,<
		MOVEM T1,HSHTAB		;Save hash table address
		ADDI T1,SCNHSZ		;Add hash table size
	>; END IFN FTOPS20
		MOVEM T1,ADRTAB		;Save node address table address
	IFN FTOPS10,<
		OPSTR <ADD T1,>,IBMXA,+IBBLK ;Compute end of address table
		ADDI T1,1		;...
		MOVEM T1,SCTMAP		;Set up pseudo map
		ADD T1,SCTMPS		;Add size of pseudo map
		MOVEM T1,DCNVFF##	;Update DECnet first free address
	IFN FTMP,<
		SNCALL (UPMM##,MCSEC1)	;Get MM for GETPHP
	>; END IFN FTMP
		MOVEI T3,1		;Number of pages to allocate
		SNCALL (GETPHP##,MCSEC1) ;Get a physical page
	IFN FTMP,<
		SNCALL (DWNMM##,MCSEC1) ;Give back MM
	>; END IFN FTMP
		MOVE T2,SCTMAP		;Get address of pseudo map
		MOVEM T1,(T2)		;Store first entry
		AOS SCTMPF		;Increment pseudo map first free
		MOVX T1,MAPBAS		;Set up pseudo address of hash table
		MOVEM T1,HSHTAB		;...
 INS 61/126	;14C8
	IFN FTOPS10,<
		  CALL UMPBUC		;  Compute unmapped address
	>; END IFN FTOPS10
 INS 80/126	;14C9
	IFN FTOPS10,<
		CALL MAPBUC		; Map entry
	>; END IFN FTOPS10
 INS 86/126	;14C10
	IFN FTOPS10,<
		  CALL MAPBUC		;  Map unmapped bucket
	>; END IFN FTOPS10
 INS 109/126	;14C11
	IFN FTOPS10,<
		CALL UMPBUC		;Compute unmapped address
		EXCH T1,T4		;Save in T4
	>; END IFN FTOPS10
 REP 114/126	;14C12
		STOR T1,BUNXT,(T4)	;Link new bucket into chain
 WIT
	IFN FTOPS10,<
		CALL UMPBUC		;Compute unmapped bucket address
		EXCH T1,T4		;Save unmapped address, get original bucket
		CALL MAPBUC		;Map original bucket
		EXCH T1,T4		;Swap around again
	>; END IFN FTOPS10
		STOR T1,BUNXT,(T4)	;Link new bucket into chain
	IFN FTOPS10,<
		CALL MAPBUC		;Map new bucket again
	>; END IFN FTOPS10
 INS 121/126	;14C13
	IFN FTOPS10,<
		EXCH T1,T2		;Get mapped bucket address
		CALL UMPBUC		;Compute unmapped bucket address
		EXCH T1,T2		;...
	>; END IFN FTOPS10
 INS 34/127	;14C14
	IFN FTOPS10,<
		MOVE T1,T2		;Get unmapped bucket address
		CALL MAPBUC		;Map unmapped bucket
		MOVE T2,T1		;Get mapped address
	>; END IFN FTOPS10
 INS 60/127	;14C15
	IFN FTOPS10,<
		  CALL MAPBUC		; Map entry
	>; END IFN FTOPS10
 INS 63/127	;14C16
	IFN FTOPS10,<
		    CALL MAPBUC		;    Map unmapped bucket
	>; END IFN FTOPS10
 INS 14/129	;14C17
	IFN FTOPS10,<
		CALL MAPBUC		; Map entry
	>; END IFN FTOPS10
 INS 19/129	;14C18
	IFN FTOPS10,<
		  MOVE T1,T2		;  Get unmapped bucket address
		  CALL MAPBUC		;  Map unmapped bucket
		  MOVE T2,T1		;  Get mapped bucket address
	>; END IFN FTOPS10
 REP 20/132	;14C19
		  D36ON			; Release interlock
	IFN FTOPS20,<
 WIT
	IFN FTOPS20,<
		  D36ON			; Release interlock
 REP 25/132	;14C20
	>; END IFN FTOPS20
	IFN FTOPS10,<
		  MOVEI T2,PAGSIZ##	;Get size of memory to allocate
		  XCALL (MSEC1,GFWNZD##) ;Allocate needed memory
		    RNMXER (NF.RES)	;None, give error
		  MOVEI T2,<PAGSIZ##/BU.LEN> ;Get bucket count
	>; END IFN FTOPS10
		  D36OFF		; Get interlock
 WIT
		  D36OFF		; Get interlock
	>; END IFN FTOPS20
	IFN FTOPS10,<
	GETBU1:	  MOVE T4,SCTMPF	; Any room in pseudo page map?
		  CAMGE T4,SCTMPS	; ...
		  JRST GETBU2		; Yes, continue
		  CALL EXPMAP		; Expand it
		    JRST [D36ON		; Unsuccessful, release interlock
			  RNMXER (NF.RES)] ;And give error return
		  JRST GETBU1		; And try again
	GETBU2:	  AOS SCTMPF		; Update first free
		  D36ON			; Release interlock
		  PUSH P,T4		; Save index into pseudo map
	IFN FTMP,<
		  SNCALL (UPMM##,MCSEC1) ;Get MM for GETPHP
	>; END IFN FTMP
		  MOVEI T3,1		;Number of pages to allocate
		  SNCALL (GETPHP##,MCSEC1) ;Get a physical page
	IFN FTMP,<
		  SNCALL (DWNMM##,MCSEC1) ;Give back MM
	>; END IFN FTMP
		  MOVEI T2,<PAGSIZ##/BU.LEN> ;Get bucket count
		  POP P,T4		; Restore pseudo map index
		  D36OFF		; Get interlock
		  ADD T4,SCTMAP		; Compute address of first free
		  MOVEM T1,(T4)		; Store physical address in pseudo map
		  SUB T4,SCTMAP		; Compute pseudo address
		  LSH T4,P2WLSH##	; ...
		  ADDX T4,MAPBAS	; ...
		  MOVE T1,T4		; ...
	>; END IFN FTOPS10
 INS 39/132	;14C21
	IFN FTOPS10,<
		    CALL MAPBUC		;    Map unmapped bucket
	>; END IFN FTOPS10
 INS 43/132	;14C22
	IFN FTOPS10,<
		  MOVE T1,T3		;Get unmapped address
		  CALL MAPBUC		;Map unmapped bucket address
		  MOVE T3,T1		;Get mapped address
	>; END IFN FTOPS10
 INS 46/132	;14C23
	IFN FTOPS10,<
		CALL MAPBUC		;Map unmapped bucket
	>; END IFN FTOPS10
 INS 1/133	;14C24
		SUBTTL	Node name/number database -- Expand pseudo map

	;EXPMAP - Expand pseudo map
	;
	;Call:	CALL EXPMAP
	;
	;Return: RET if unable to expand map
	;	 RETSKP on success

	IFN FTOPS10,<
	EXPMAP:	MOVE T1,SCTMPS		;Get size of map
		ADDI T1,^D20		;Expand by 20 words
		CALL DNGWDZ		;...
		  RET			;Can't return
		MOVE T3,T1		;Get address of new map
		MOVE T2,SCTMAP		;Get address of old map
		MOVE T1,SCTMPS		;Get size of old map
		MOVEM T3,SCTMAP		;Store address of new map
		CALL XBLTA##		;Copy old map into new map
		MOVEI T1,^D20		;Update size of new map
		ADDM T1,SCTMPS		;...
		RETSKP			;And return
	>; END IFN FTOPS10
		SUBTTL	Node name/number database -- Map a bucket

	;MAPBUC - Map an unmapped bucket
	;
	;Call:	T1/ Unmapped address of bucket
	;	CALL MAPBUC
	;
	;Return: RET with T1/ Virtual address of bucket

		XSWAPCD
	IFN FTOPS10,<
	MAPBUC:	SAVEAC <T2>		;Save T2
		MOVE T2,T1		;Copy unmapped address
		SUBX T2,MAPBAS		;Convert to map slot number
		LSH T2,W2PLSH##		;...
		ADD T2,SCTMAP		;Add address of map
		MOVE T2,(T2)		;Get physical address
		HRLI T2,(<PM.DCD>B2+PM.WRT+PM.PUB) ;Get mapping info
		EXCH T2,.UPMP+.UMTMP	;Map in temp slot
		ANDI T1,PG.BDY##	;Compute virtual address
		IORI T1,.TEMP		;...
	;	CAME T2,.UPMP+.UMTMP	;Mapping change?
		CLRPGT (0,.TEMP)	;Yes, flush previous mapping
		RET			;And return
	>; END IFN FTOPS10
		SUBTTL	Node name/number database -- Compute bucket's unmapped address

	;UMPBUC - Compute unmapped address of bucket
	;
	;Call:	T1/ Mapped address of bucket
	;	CALL UMPBUC
	;
	;Return: RET with T1/ Unmapped address of bucket

	IFN FTOPS10,<
	UMPBUC:	SAVEAC <T2,T3,T4>	;Save T2-T4
		MOVE T2,.UPMP+.UMTMP	;Get mapping information
		TXZ T2,PM.NAD		;Mask off non-address bits
		MOVE T3,SCTMPS		;Get size of pseudo page map
		MOVE T4,SCTMAP		;And address
	UMPBU1:	SOSGE T3		;Adjust and check count
		BUG. (CHK,SCLPMI,SCLINK,SOFT,<Node database pseudo page map inconsistent>,,,RTN)
		CAME T2,(T4)		;Found the correct entry?
		AOJA T4,UMPBU1		;No, loop back
		SUB T4,SCTMAP		;Compute pseudo map slot
		LSH T4,P2WLSH##		;Make into pseudo address
		ADDX T4,MAPBAS		;Compute unmapped address
		ANDI T1,PG.BDY##	;...
		IOR T1,T4		;...
		RET			;And return
	>; END IFN FTOPS10
		SUBTTL	Node name/number database -- SCTMOV - SET MEMORY OFFLINE support

	;SCTMOV - Called on SET MEMORY OFFLINE to move any affected pages
	;
	; Call:
	;	P1/ First affected page number
	;	P2/ Last affected page number
	;
	; Return:
	;	RET always

	IFN FTOPS10,<
	SCTMOV::SAVEAC <P3,P4>		;Save P3-P4
		MOVE P3,SCTMPS		;Get size of pseudo map
		MOVE P4,SCTMAP		;And address of pseudo map
	SCTMO1:	JUMPE P3,RTN		;Exit when finished checking
		MOVE T1,(P4)		;Get next physical page in pseudo map
		JUMPE T1,SCTMO2		;Skip entry if zero
		CAML T1,P1		;In range being set offline?
		CAMLE T1,P2		;...
		JRST SCTMO2		;No, skip this entry
		SNCALL (MOVPAG##,MCSEC1) ;Ask LOKCON to move the page
		MOVEM T1,(P4)		;Store new page number
	SCTMO2:	AOJ P4,			;Bump pointer into pseudo map
		SOJA P3,SCTMO1		;And loop back for entire map
	>; END IFN FTOPS10
 REP 40/135	;14C25
	PARAMETER(^D510,,,^D1000,%SCINT,<MOVEM T2,SCTINT>,<MOVE T2,SCTINT>,<MOVEM T2,SCTINT>,<Incoming timer>)
	PARAMETER(^D511,,,^D1000,%SCOTT,<MOVEM T2,SCTOTT>,<MOVE T2,SCTOTT>,<MOVEM T2,SCTOTT>,<Outgoing timer>)
 WIT
	PARAMETER(^D510,,,<1>,%SCINT,<CALL [IMULI T2,TIMBAS##
					    MOVEM T2,SCTINT
					    RNMXOK]>,<
				      CALL [MOVE T2,SCTINT
					    IDIVI T2,TIMBAS##
					    RNMXOK]>,<
				      CALL [IMULI T2,TIMBAS##
					    MOVEM T2,SCTINT
					    RNMXOK]>,<Incoming timer>)
	PARAMETER(^D511,,,<1>,%SCOTT,<CALL [IMULI T2,TIMBAS##
					    MOVEM T2,SCTOTT
					    RNMXOK]>,<
				      CALL [MOVE T2,SCTOTT
					    IDIVI T2,TIMBAS##
					    RNMXOK]>,<
				      CALL [IMULI T2,TIMBAS##
					    MOVEM T2,SCTOTT
					    RNMXOK]>,<Outgoing timer>)
 INS 63/137	;14C26
	IFN FTOPS10,<
		    EXCH T1,T3		;Map bucket
		    CALL MAPBUC		;...
		    EXCH T1,T3		;...
	>; END IFN FTOPS10
 INS 121/137	;14C27
	IFN FTOPS10,<
		  CALL MAPBUC		; Map entry
	>; END IFN FTOPS10
 INS 124/137	;14C28
	IFN FTOPS10,<
		    CALL MAPBUC		; Map bucket
	>; END IFN FTOPS10
 INS 20/141	;14C29
	SCTMPF:	BLOCK	1		;First free name/address pseudo page map slot
	SCTMPS:	EXP <<SCNHSZ+777>/PAGSIZ##>+^D20 ;Size of name/address pseudo page map
	SCTMAP:	BLOCK	1		;Address of Name/address psuedo page map
 SUM 150085