SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page   0
Table of contents

    (1)      531        DECLARATIONS
    (1)      667        INITIALIZATION CODE
    (1)      914        SCS$ACCEPT
    (1)      997        SCS$ALLOC_CDT
    (1)     1090        SCS$ALLOC_RSPID
    (1)     1153        SCS$CONFIG_PTH
    (1)     1287        SCS$CONFIG_SYS
    (1)     1399        SCS$CONNECT
    (1)     1593        SCS$DEALL_CDT
    (1)     1699        SCS$DEALL_RSPID - Dellocate a response id
    (1)     1700        SCS$RECYL_RSPID - Recycle a response id
    (1)     1793        NO_MSCP_LISTN
    (1)     1828        SCS$DIRECTORY
    (1)     1962        SCS$DISCONNECT
    (1)     2048        SCS$ENTER
    (1)     2109        SCS$FIND_RDTE - Find RDTE for RSPID
    (1)     2159        SCS$LISTEN
    (1)     2229        SCS$LOCLOOKUP
    (1)     2284        SCS$REMOVE
    (1)     2347        SCS$RESUMEWAITR
    (1)     2426        SCS$LKP_RDTCDRP
    (1)     2525        SCS$LKP_RDTWAIT
    (1)     2621        SCS$LKP_MSGWAIT - Scan message wait queues
    (2)     2747        SCS$NEW_SB - New/Reused System Block Available for Polling
    (3)     2811        SCS$POLL_PROC - Declare a process name to the poller
    (4)     2909        SCS$POLL_MODE - Enable/Disable polling for a process
    (5)     2988        START_POLL - Start poll of requested processes
    (6)     3191        SCS$DIR_LOOKUP - look up process names on remote node
    (12)    3456        SCS$POLL_MBX - Declare Polling Notification Mailbox
    (13)    3600        SCS$CANCEL_MBX - Cancel Polling Notification Mailbox
    (14)    3654        SCS$SHUTDOWN - Shutdown all SCS virtual circuits
    (15)    3707        Dynamic load sharing routines
    (16)    3888        Dynamic Load Sharing Database
    (19)    4124        -	New Connection Processing
    (19)    4125        -		SCS_REGISTER_LOCAL_NAME - assign index to name
    (20)    4201        -		SCS_SELECT_PATH - find a path for a new cnx
    (21)    4304        -		SCS$UPDATE_PORT_LOAD_VECTOR - update the load vector
    (22)    4413        -	New Virtual Circuit Processing
    (22)    4414        -		SCS$NEW_PB - Recognize a new path block
    (23)    4490        -		WORSE_PATH_CONNECTIONS - handle unequal paths
    (24)    4610        -		SCS$SET_LOAD_RATING - Set a connection's load rating
    (25)    4741        -	Periodic Processing
    (25)    4742        -		INIT_LOAD_SHARE - start load sharing activity
    (26)    4881        -		SCS_REDISTRIBUTE_CDTS 
    (27)    4921        -		SCS_GET_LOAD_VECTOR - allocate a load vector
    (28)    4995        -		SCS_LOAD_SHARE_TIMER - periodic TQE routine
    (29)    5282        -		MOST_LOADED - Get current most loaded port
    (29)    5283        -		LEAST_LOADED - Get current least loaded port
    (30)    5375        -		FIND_BEST_MATCH - Find the best match connection
    (31)    5667        -		CHECK_MIN_PORT_WAIT - Check ports' min wait time 
    (32)    5748        -		CALCULATE_LOAD - Calculate ports' load 
    (33)    6054        -		CALC_EB		 - Calculate effective bandwidths of ports
    (34)    6308        -		SCS_CHECK_QUEUES - Check and process SCS load sharing queues
    (35)    6491        -		SCS_CTRS_UPDATE   - Update conditional counters
    (36)    6998        -		SCS_UPDATE_REG_CTRS - Update regular counters
    (37)    7220        -		SCS_CALC_BYTES_XFER - Calculate Bytes Xfer counters
    (38)    7350        -		SCS_PROCESS_CDTS - Process CDTs in DISCONNECT queue
    (39)    7409        -		SCS_CHK_CDT_REUSE_QUEUE - check REUSE queue for matching CDT
    (40)    7551        -		LOAD_SHARE_BUGCHECK - note bad load rating
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page   1
X-19                                                                     13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0000     1 	.TITLE	SYS$SCS - System Communications Service Loadcode
                                     0000     2 	.IDENT	'X-19'
                                     0000     3 ;
                                     0000     4 ;****************************************************************************
                                     0000     5 ;*									    *
                                     0000     6 ;*  COPYRIGHT (c) 1978, 1980, 1982, 1984, 1986, 1987, 1991 BY		    *
                                     0000     7 ;*  DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS.		    *
                                     0000     8 ;*  ALL RIGHTS RESERVED.						    *
                                     0000     9 ;* 									    *
                                     0000    10 ;*  THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED   *
                                     0000    11 ;*  ONLY IN  ACCORDANCE WITH  THE  TERMS  OF  SUCH  LICENSE  AND WITH THE   *
                                     0000    12 ;*  INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR  ANY  OTHER   *
                                     0000    13 ;*  COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY   *
                                     0000    14 ;*  OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE IS  HEREBY   *
                                     0000    15 ;*  TRANSFERRED.							    *
                                     0000    16 ;* 									    *
                                     0000    17 ;*  THE INFORMATION IN THIS SOFTWARE IS  SUBJECT TO CHANGE WITHOUT NOTICE   *
                                     0000    18 ;*  AND  SHOULD  NOT  BE  CONSTRUED AS  A COMMITMENT BY DIGITAL EQUIPMENT   *
                                     0000    19 ;*  CORPORATION.							    *
                                     0000    20 ;* 									    *
                                     0000    21 ;*  DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE  OR  RELIABILITY OF ITS   *
                                     0000    22 ;*  SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.		    *
                                     0000    23 ;* 									    *
                                     0000    24 ;*									    *
                                     0000    25 ;****************************************************************************
                                     0000    26 ;
                                     0000    27 
                                     0000    28 ;++
                                     0000    29 ; FACILITY:
                                     0000    30 ;	Executive data base
                                     0000    31 ;
                                     0000    32 ; ABSTRACT:          
                                     0000    33 ;	This module contains the global entry point vectors for System
                                     0000    34 ;	Communications Services (SCS).  The targets of these vectors are
                                     0000    35 ;	updated to point to the actual SCS image after it is loaded into
                                     0000    36 ;	non-paged pool.
                                     0000    37 ;
                                     0000    38 ; ENVIRONMENT:  
                                     0000    39 ;
                                     0000    40 ; AUTHOR:  KERBEY T. ALTMANN, CREATION DATE:	22-APR-1981
                                     0000    41 ;
                                     0000    42 ; MODIFIED BY:
                                     0000    43 ;
                                     0000    44 ;	X-19	DOS0019		Dan O'Shaughnessy	12-May-1992
                                     0000    45 ;		Fix DSSI loadsharing threshold tables.
                                     0000    46 ;
                                     0000    47 ;	X-18	JSSTS0006	John S. Simakauskas	 1-Mar-1991
                                     0000    48 ;		Add support for tape server, TMSCP.
                                     0000    49 ;
                                     0000    50 ;	X-17		Joseph A. Dziedzic		27-Feb-1991
                                     0000    51 ;		Move allocation of "black hole" page back to INIT;
                                     0000    52 ;		SCS is not always loaded.  Fix problem addressed by
                                     0000    53 ;		edit X-8 by allocating the "black hole" page earlier
                                     0000    54 ;		in INIT.
                                     0000    55 ;
                                     0000    56 ;	X-13U4	VBK	Vaikom B. Krishnan		11-Apr-1990
                                     0000    57 ;		Make SCS$GA_EXISTS point to SCS_START instead of SCS_INIT.
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page   2
X-19                                                                     13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0000    58 ;		This fix is required by PC SAMP.
                                     0000    59 ;
                                     0000    60 ;	X-13U3  VBK	Vaikom B. Krishnan		30-Mar-1990
                                     0000    61 ;		Fold in changes from 13U2. AN earlier version checked 
                                     0000    62 ;		in as X-13U2 by mistake.
                                     0000    63 ;	X-13U2  VBK	Vaikom B. Krishnan		30-Mar-1990
                                     0000    64 ;		Remove declaration of SCS_INIT as an initialization 
                                     0000    65 ;		routine as SYS$SCS reverts back to non execlet status 
                                     0000    66 ;		for Aetna
                                     0000    67 ;
                                     0000    68 ;	X-13U1	TYC0019		Theresa Y. Chin		28-Mar-1990
                                     0000    69 ;		SCS_CHECK_QUEUES routine was modified so that R5
                                     0000    70 ;		is saved in stack before calling SYSAP's error routine
                                     0000    71 ;		to disconnect unequal path connections.  This is
                                     0000    72 ;		due to the fact that SYSAP uses R5 and thus wipes out
                                     0000    73 ;		the contents of R5.
                                     0000    74 ;
                                     0000    75 ;	X-13	TYC0018		Theresa Y. Chin		22-Jan-1990
                                     0000    76 ;		Add effective bandwidth table entries for KFMSA and
                                     0000    77 ;		also for default type (i.e. any unknown CI port type).
                                     0000    78 ;		Modified CALC_EB routine to calculate KFMSA and
                                     0000    79 ;		any unknown CI type port's effective bandwidths.
                                     0000    80 ;
                                     0000    81 ;	X-12	TYC0017		Theresa Y. Chin		21-Nov-1989
                                     0000    82 ;		Fix CALC_EB routine so that if the port had absolutely
                                     0000    83 ;		no traffic (such as in the case of early boot time),
                                     0000    84 ;		the average transfer size is set to 0 instead of 
                                     0000    85 ;		doing DIV instr. to calculate it.
                                     0000    86 ;
                                     0000    87 ;	X-11	TYC0016		Theresa Y. Chin		24-Oct-1989
                                     0000    88 ;		Added CI ports' effective bandwidths table for 
                                     0000    89 ;		load sharing.  Also added CALC_EB routine to calculate
                                     0000    90 ;		a port's effective bandwidth to be used as the
                                     0000    91 ;		current saturation point.  SCS_UPDATE_REG_CTRS
                                     0000    92 ;		routine is now broken down to 2 routines.  The
                                     0000    93 ;		other routine SCS_CALC_BYTES_XFER calculates
                                     0000    94 ;		the "bytes transferred during last interval"
                                     0000    95 ;		counters for ports and connections to be used
                                     0000    96 ;		during load sharing interval and also calculates
                                     0000    97 ;		effective bandwidth of CI ports.  SCS_UPDATE_REG_CTRS
                                     0000    98 ;		is then called at the end of load sharing interval.
                                     0000    99 ;
                                     0000   100 ;	X-10	TYC0015		Theresa Y. Chin		31-Aug-1989
                                     0000   101 ;		Modified several routines due to load sharing
                                     0000   102 ;		PDT and CDT counters definition change necessary
                                     0000   103 ;		so that utilities such as MONITOR won't break.
                                     0000   104 ;		The routines modified are: SCS$DISCONNECT,
                                     0000   105 ;		SCS_CHK_CDT_REUSE_QUEUE, SCS$DEALL_CDT,
                                     0000   106 ;		SCS_LOAD_SHARE_TIMER, CALCULATE_LOAD, FIND_BEST_MATCH,
                                     0000   107 ;		SCS_CTRS_UPDATE, and SCS_UPDATE_REG_CTRS.
                                     0000   108 ;
                                     0000   109 ;	X-9	TYC0014		Theresa Y. Chin		14-Aug-1989
                                     0000   110 ;		Modified CALCULATE_LOAD routine to calculate each
                                     0000   111 ;		port's tolerance threshold according to its port
                                     0000   112 ;		utilization.
                                     0000   113 ;
                                     0000   114 ;	X-8	VBK	      Vaikom B. Krishnan	11-Aug-1989
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page   3
X-19                                                                     13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0000   115 ;		Initialize EXE$GL_BLAKHOLE.
                                     0000   116 ;
                                     0000   117 ;	X-7	VBK	      Vaikom B. Krishnan	04-Aug-1989
                                     0000   118 ;		Correct code in SCS$ENTER to get the SCS$GQ_DIRECT 
                                     0000   119 ;		list head properly.
                                     0000   120 ;
                                     0000   121 ;	X-6	TYC0013		Theresa Y. Chin		02-Aug-1989
                                     0000   122 ;		Modified FIND_BEST_MATCH routine to select the
                                     0000   123 ;		connection with the lowest load rating and to use
                                     0000   124 ;		next best optimal path if there is no optimal path
                                     0000   125 ;		to the same remote port.
                                     0000   126 ;		
                                     0000   127 ;	X-5	VBK	      Vaikom B. Krishnan	02-Aug-1989
                                     0000   128 ;		Move initialization of SCS$GL_MCADR to the right place
                                     0000   129 ;		in SCS_INIT.
                                     0000   130 ;
                                     0000   131 ;		Change ident number to reflect generation number.
                                     0000   132 ;
                                     0000   133 ;	X-34	VBK	      Vaikom B. Krishnan	02-Aug-1989
                                     0000   134 ;		Initialise SCS$GL_MCADR to point to start of microcode.
                                     0000   135 ;
                                     0000   136 ;	X-33	VBK	      Vaikom B. Krishnan	01-Aug-1989
                                     0000   137 ;		Change reference to SCS$GQ_CONFIG in SCS$ENTER to
                                     0000   138 ;		SCS$GQ_DIRECT. 
                                     0000   139 ;
                                     0000   140 ;	X-32	TYC0012		Theresa Y. Chin		31-Jul-1989
                                     0000   141 ;		SCS$DIRECTORY routine is modified to change a
                                     0000   142 ;		parameter name (formerly MOVE_PATH_ADDR) in ACCEPT
                                     0000   143 ;		macro call since the macro definition has changed
                                     0000   144 ;		in SYSMAR.MAR.  SYS$DIR_LOOKUP routine is modified
                                     0000   145 ;		to change MOVE_PATH_ADDR parameter to MOVADR in
                                     0000   146 ;		CONNECT macro call.
                                     0000   147 ;
                                     0000   148 ;		Also INIT_LOAD_SHARE routine is modified to initialize
                                     0000   149 ;		global load sharing parameters since these values
                                     0000   150 ;		can and might be changing.  By setting values here,
                                     0000   151 ;		we won't have to modify SYSTEM_DATA_CELLS.MAR each
                                     0000   152 ;		time.
                                     0000   153 ;
                                     0000   154 ;	X-31	VBK	     Vaikom B. Krishnan		25-Jul-1989
                                     0000   155 ;		Make SCSLOA exec loadable: change global routines to
                                     0000   156 ;		universal symbols; move global data cells to SYS;
                                     0000   157 ;		remove transfer vector definitions; and change PSECT 
                                     0000   158 ;		definitions to conform to an exec loadable image structure.
                                     0000   159 ;
                                     0000   160 ;	X-30	TYC0011		Theresa Chin		10-Jul-1989
                                     0000   161 ;		Modified FIND_BEST_MATCH routine to search for
                                     0000   162 ;		a path to the same remote port when checking for
                                     0000   163 ;		a CDT with best match load.
                                     0000   164 ;
                                     0000   165 ;	X-29	TYC0010		Theresa Chin		22-Jun-1989
                                     0000   166 ;		SCS_GET_LOAD_VECTOR routine is modified to get rid
                                     0000   167 ;		of code that clears the old vector field which is
                                     0000   168 ;		no longer present in the vector structure.
                                     0000   169 ;
                                     0000   170 ;		SCS$CONNECT and SCS$ACCEPT routines are modified
                                     0000   171 ;		to use a new flag to distinguish pre-load sharing
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page   4
X-19                                                                     13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0000   172 ;		version of SYSAPs from load sharing version of 
                                     0000   173 ;		SYSAPs instead of using UNEQUAL_PATH load rating
                                     0000   174 ;		since this rating is a valid rating which can be
                                     0000   175 ;		passed by load sharing version of SYSAPs.
                                     0000   176 ;
                                     0000   177 ;	X-28	TYC0009		Theresa Chin		22-May-1989
                                     0000   178 ;		WORSE_PATH_CONNECTIONS routine is modified so that
                                     0000   179 ;		SYSAPs with load rating of DISABLED will not be moved
                                     0000   180 ;		even for NI to CI path transition.
                                     0000   181 ;
                                     0000   182 ;		SCS_UPDATE_REG_CTRS routine is modified so that CDT
                                     0000   183 ;		interval counters are not cleared if the CDT is in
                                     0000   184 ;		SCS$GQ_DISCONNECT queue.  SCS$DEALL_CDT routine is
                                     0000   185 ;		modified to clear CDT interval counters if the CDT
                                     0000   186 ;		is being reused.
                                     0000   187 ;
                                     0000   188 ;		The last spare vector space is used now for a global
                                     0000   189 ;		event log enable/disable flag.
                                     0000   190 ;
                                     0000   191 ;	X-27	TYC0008		Theresa Chin		08-May-1989
                                     0000   192 ;		CALCULATE_LOAD routine is modified to set port load
                                     0000   193 ;		rating field in PDT.  SCS_UPDATE_REG_CTRS routine is
                                     0000   194 ;		modified to clear port load rating before ending the
                                     0000   195 ;		current load sharing interval.
                                     0000   196 ;
                                     0000   197 ;	X-26	TYC0007		Theresa Chin		24-Apr-1989
                                     0000   198 ;		Add new global variables for dynamic load sharing.
                                     0000   199 ;		INIT_LOAD_BALANCE routine is renamed to INIT_LOAD_SHARE
                                     0000   200 ;		and modified to initialize dynamic load sharing.
                                     0000   201 ;
                                     0000   202 ;		SCS$UPDATE_PORT_LOAD routine is renamed to SCS$UPDATE_
                                     0000   203 ;		PORT_LOAD_VECTOR and modified for dynamic load sharing. 
                                     0000   204 ;		Corresponding changes are made to SCS_GET_LOAD_VECTOR.
                                     0000   205 ;
                                     0000   206 ;		SCS$NEW_PB and WORSE_PATH_CONNECTIONS routines are
                                     0000   207 ;		modified for dynamic load sharing design.
                                     0000   208 ;
                                     0000   209 ;		LOAD_BAL_BUGCHECK_COUNT is renamed to LOAD_SHARE_
                                     0000   210 ;		BUGCHECK_COUNT and LOAD_BAL_BUGCHECK routine is
                                     0000   211 ;		renamed to LOAD_SHARE_BUGCHECK.
                                     0000   212 ;
                                     0000   213 ;		SCS$SET_LOAD_RATING routine is modified and
                                     0000   214 ;		START_BALANCE_TQE, DEQUEUE_CDT, and SCS_CHECK_LOAD_VECTORS
                                     0000   215 ;		routines are deleted since they are no longer used.
                                     0000   216 ;		CHECK_VECTOR_COUNT is also gone.
                                     0000   217 ;
                                     0000   218 ;		SCS_PROCESS_CDTS routine is modified for
                                     0000   219 ;		dynamic load sharing.
                                     0000   220 ;
                                     0000   221 ;		Folded in change made in 18U2 increasing CDT
                                     0000   222 ;		extension from 100 to 200.
                                     0000   223 ;
                                     0000   224 ;		New local macros PEAK_CTR_UPDATE and AVG_CTR_UPDATE
                                     0000   225 ;		and new subroutines SCS_CTRS_UPDATE, SCS_CHECK_QUEUES,
                                     0000   226 ;		CHECK_MIN_PORT_WAIT, CALCULATE_LOAD, and SCS_UPDATE_REG_CTRS have 
                                     0000   227 ;		been added for load sharing.
                                     0000   228 ;
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page   5
X-19                                                                     13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0000   229 ;		SCS_LOAD_BALANCE_TIMER routine is renamed to SCS_LOAD_SHARE_
                                     0000   230 ;		TIMER and modified.  New subroutines MOST_LOADED, LEAST_LOADED,
                                     0000   231 ;		and FIND_BEST_MATCH were added to support dynamic load
                                     0000   232 ;		sharing activity.
                                     0000   233 ;
                                     0000   234 ;		When SYSAP's MOVE PATH routine is called, the R0 will have
                                     0000   235 ;		status code of SS$_DISCONNECT and R1 will have additional status
                                     0000   236 ;		code of SCS$C_USE_ALTERNATE_PORT.
                                     0000   237 ;
                                     0000   238 ;		SCS$DEALL_CDT routine is modified to queue disconnecting
                                     0000   239 ;		CDT to SCS$GQ_REUSE_CDT queue if this is the disconnect
                                     0000   240 ;		due to dynamic load sharing activity.
                                     0000   241 ;
                                     0000   242 ;		SCS$DIRECTORY and SCS$DIR_LOOKUP routines were modified to set 
                                     0000   243 ;		initial load
                                     0000   244 ;		rating to LOAD_SHARE_DISABLED and DIR_MOVE routine was
                                     0000   245 ;		modified to be a NOP routine since it shouldn't
                                     0000   246 ;		participate in load sharing.
                                     0000   247 ;
                                     0000   248 ;		SCS$CONNECT routine is modified and a new subroutine is
                                     0000   249 ;		called (SCS_CHK_CDT_REUSE_QUEUE) to see if a CDT with
                                     0000   250 ;		the optimal path can be used for this connection.
                                     0000   251 ;
                                     0000   252 ;		SCS$LISTEN routine is modified so that listening CDT
                                     0000   253 ;		will also have local process name index filled.
                                     0000   254 ;
                                     0000   255 ;	X-25	TYC0006		Theresa Chin		30-Mar-1989
                                     0000   256 ;		Updated SCS$K_CDTEXT to 200 from 100.
                                     0000   257 ;
                                     0000   258 ;	X-24	TYC0005		Theresa Chin		27-Mar-1989		
                                     0000   259 ;		Load sharing global variables are moved to vector area,
                                     0000   260 ;		taking up 6 vectors space for now since we cannot increase 
                                     0000   261 ;		the size of SCSVEC.OBJ.  In addition, new global variable
                                     0000   262 ;		SCS$GL_LOAD_SHARE_PDT_TABLE is initialized to point to
                                     0000   263 ;		the PDT address table which is allocated from the non-paged
                                     0000   264 ;		pool.
                                     0000   265 ;
                                     0000   266 ;	X-23	TYC0004		Theresa Chin		20-Mar-1989
                                     0000   267 ;		Moved the dynamic load sharing global variables
                                     0000   268 ;		to the front section where they will be included
                                     0000   269 ;		when SCSVEC.OBJ is built.  This is so that SYS.STB
                                     0000   270 ;		will have these variable definitions and thus
                                     0000   271 ;		enable other SCS and PADRIVER modules to access
                                     0000   272 ;		these variables.
                                     0000   273 ;
                                     0000   274 ;	X-22	TYC0003		Theresa Chin		15-Feb-1989
                                     0000   275 ;		Add new global variables for dynamic load sharing.
                                     0000   276 ;
                                     0000   277 ;	X-21	TYC0021		Theresa Chin		14-Feb-1989
                                     0000   278 ;		Changed SCS$ACCEPT and SCS$CONNECT routines to add
                                     0000   279 ;		a new parameter for load sharing.
                                     0000   280 ;
                                     0000   281 ;		Change ref. to V5.1 as ref. to V5.2 in load balancing
                                     0000   282 ;		code sections.
                                     0000   283 ;							
                                     0000   284 ;		Change CDT$C_EQUAL_PATH to CDT$C_YELLOW in
                                     0000   285 ;		SCS_PROCESS_CDTS routine.
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page   6
X-19                                                                     13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0000   286 ;
                                     0000   287 ;		Changed SCS$ACCEPT and SCS$CONNECT routines to use
                                     0000   288 ;		CDT$L_LOAD_RATING when dealing with SYSAP which
                                     0000   289 ;		doesn't have MOVE_PATH routine.
                                     0000   290 ;
                                     0000   291 ;		SCS$SET_LOAD_STATUS routine is modified and renamed
                                     0000   292 ;		to SCS$SET_LOAD_RATING.  
                                     0000   293 ;		Local counter STATUS_BUGCHECK_COUNT is renamed to
                                     0000   294 ;		LOAD_BAL_BUGCHECK_COUNT.
                                     0000   295 ;							
                                     0000   296 ;		DIR_MOVE routine is modified to call SCS$SET_LOAD_RATING
                                     0000   297 ;		with the value CDT$C_UNEQUAL_PATH.
                                     0000   298 ;		SCS$DEALL_CDT, SCS$UPDATE_PORT_LOAD, and SCS$NEW_PB 
                                     0000   299 ;		routines are modified 
                                     0000   300 ;		to eliminate ref. to MOVE_STATUS field.
                                     0000   301 ;		
                                     0000   302 ;		The counter CONNECTION_MOVE_COUNT is incremented during
                                     0000   303 ;		a call to WORSE_PATH_CONNECTIONS or SCS_PROCESS_CDTS
                                     0000   304 ;		when a MOVE_PATH routine or an error routine is called
                                     0000   305 ;		to request a SYSAP to disconnect. 
                                     0000   306 ;
                                     0000   307 ;		WORSE_PATH_CONNECTIONS and SCS_PROCESS_CDTS routines are 
                                     0000   308 ;		modified to eliminate
                                     0000   309 ;		ref. to MOVE_STATUS field and to change connection load
                                     0000   310 ;		bal. timer value from 24 hours to 1 hour since we don't
                                     0000   311 ;		check whether the SYSAP actually disconnects or not.
                                     0000   312 ;
                                     0000   313 ;	X-20	TYC0020		Theresa Chin		23-Nov-1988
                                     0000   314 ;		Merge V5.1 (X-18U1) into V5_HES (X-19) stream.
                                     0000   315 ;
                                     0000   316 ;	X-18U1	DOSU109		Dan O'Shaughnessy 	31-Aug-1988
                                     0000   317 ;	   	Change SCS$SHUTDOWN to close all VCs on SCS ports
                                     0000   318 ;		before issuing the last gasp DG.
                                     0000   319 ;
                                     0000   320 ;	X-19	EJL0201		Edward J. Los		25-Jul-1988
                                     0000   321 ;		Add the MOVE_PATH_ADDR to the CONNECT and ACCEPT calls
                                     0000   322 ;		Add dynamic load balancing code (see documentation under
                                     0000   323 ;		 "Dynamic load balancing routines" and update the SCS$DIRECTORY
                                     0000   324 ;		 and SCS$DIR_POLL sysaps to use the MOVE_PATH interface.
                                     0000   325 ;		Remove "What city, plez?" to satisfy an offended customer
                                     0000   326 ;		Increase the initial credits on the SCS$DIR_LOOKUP CONNECT
                                     0000   327 ;		 request to prevent excessive credit request messages
                                     0000   328 ;		 during polling.
                                     0000   329 ;
                                     0000   330 ;	X-18	SF00018		Stephen Fiorelli	02-Feb-1988
                                     0000   331 ;		Add padding to the end of the vector area linked
                                     0000   332 ;		into sys.exe.  This is to allow the addition of
                                     0000   333 ;		new vectors after version 5.
                                     0000   334 ;
                                     0000   335 ;		Note:  When adding a new vector AFTER V5 ships,
                                     0000   336 ;		add at the end, and substract the padding.
                                     0000   337 ;
                                     0000   338 ;	X-17	WLG0017		William Goleman		15-Feb-1988
                                     0000   339 ;		Add pointer for SCS$GL_MSCP_NEWDEV, a routine called by
                                     0000   340 ;		the new unit processing code in the disk class driver.
                                     0000   341 ;		This assures that devices being served are available to
                                     0000   342 ;		cluster client nodes in time for cluster-wide services
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page   7
X-19                                                                     13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0000   343 ;		to complete successfully.
                                     0000   344 ;
                                     0000   345 ;	X-16    EJL0182		Edward J. Los		08-Feb-1988
                                     0000   346 ;		Add a hook for remote sda
                                     0000   347 ;
                                     0000   348 ;	X-15	SF00014		Stephen Fiorelli	17-Nov-1987
                                     0000   349 ;		Add version mask values.
                                     0000   350 ;
                                     0000   351 ;	X-14	EJL0181		Edward J. Los		17-Nov-1987
                                     0000   352 ;		Temporary patch to reduce the level of periodic polling
                                     0000   353 ;		on a cluster.  This patch can be turned off by not defining
                                     0000   354 ;		the symbol SCS$NO_MSCP_POLL.  This patch should be turned
                                     0000   355 ;		off as soon as a general, architected means or reducing
                                     0000   356 ;		polling is implemented.
                                     0000   357 ;
                                     0000   358 ;		When SCS$NO_MSCP_POLL is defined, two special listeners
                                     0000   359 ;		will appear on systems that do not support MSCP servers.
                                     0000   360 ;
                                     0000   361 ;		       Sysap name     Sysap Data 
                                     0000   362 ;			MSCP$DISK   NOT PRESENT HERE
                                     0000   363 ;			MSCP$TAPE   NOT PRESENT HERE
                                     0000   364 ;
                                     0000   365 ;		On systems that have MSCP$DISK support (CLU$GL_MSCP_LOAD is
                                     0000   366 ;		nonzero, only the MSCP$TAPE listener will appear.
                                     0000   367 ;
                                     0000   368 ;		When the process poller discovers these two SYSAP names
                                     0000   369 ;		on a remote node, the poller will check the Sysap Data to
                                     0000   370 ;		see whether 'NOT PRESENT HERE' appears.  If so, then
                                     0000   371 ;		the poller will disable polling for that process.  If not,
                                     0000   372 ;		then the poller will invoke the appropriate action routine.
                                     0000   373 ;
                                     0000   374 ;		Incompatible VMS versions may discover the listening SYSAP
                                     0000   375 ;		and attempt to connect to it.  In such a case, the listener
                                     0000   376 ;		will immediately reject the connection.
                                     0000   377 ;
                                     0000   378 ;	X-13	MAS0159		Mark A. Stiles		15-Aug-1987
                                     0000   379 ;		Add pointer for SCS$GL_MSCP_MV, a routine called during
                                     0000   380 ;		mount verification of a served device which forces the
                                     0000   381 ;		server to set the device offline to all hosts, thereby
                                     0000   382 ;		propagating mount verification status correctly.  Lack
                                     0000   383 ;		of this ability could be either a volume security or
                                     0000   384 ;		data integrity problem.  The routine address is initialized
                                     0000   385 ;		at MSCPserver startup.
                                     0000   386 ;
                                     0000   387 ;	X-12	WES0141		William E. Snaman	15-Mar-1987
                                     0000   388 ;		Prevent duplicate polling requests.  This is the
                                     0000   389 ;		same change as X-3N1.
                                     0000   390 ;
                                     0000   391 ;	X-11	EJL0156		Edward J. Los		11-March-1987
                                     0000   392 ;		Disable directory polling for local ports
                                     0000   393 ;
                                     0000   394 ;	X-10	HH0248		Hai Huang		07-Feb-1987
                                     0000   395 ;		Remove references to SCS$GA_LOCALSB. Access to local SB
                                     0000   396 ;		must be made thru SCS$AR_LOCALSB.
                                     0000   397 ;
                                     0000   398 ;	X-9	EJL0133		Edward J. Los		17-Dec-1986
                                     0000   399 ;		Delay a call to RESET_TIMER until after the DISCONNECT has
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page   8
X-19                                                                     13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0000   400 ;		completed.
                                     0000   401 ;
                                     0000   402 ;	X-8	EJL0088		Edward J. Los		26-Sep-1986
                                     0000   403 ;		Count CDT allocation failures.
                                     0000   404 ;		Count RSPID allocation failures
                                     0000   405 ;		Check for overrun of the CDT table.
                                     0000   406 ;		Change the connection state machine to keep listening
                                     0000   407 ;		 CDT's permanently in that state.  For this common layer
                                     0000   408 ;		 this change means that SCS$ACCEPT will no longer allocate
                                     0000   409 ;		 a new CDT.  For compatibility with existing drivers, the
                                     0000   410 ;		 old code will be retained.  SCSLOA will check the SCSVERSION
                                     0000   411 ;		 field to decide which code should be used.
                                     0000   412 ;		Clear the remote connection ID for new connect requests.
                                     0000   413 ;		Temporarily disable initializaton code deallocation.
                                     0000   414 ;		Add resorce failure bugcheck to the initialization code
                                     0000   415 ;
                                     0000   416 ;	X-7	RNG0007		Rod Gamache		23-Sep-1986
                                     0000   417 ;		Replace forgotten DSBINT's with LOCK macros.
                                     0000   418 ;
                                     0000   419 ;	X-6	RNG0006		Rod Gamache		31-Jul-1986
                                     0000   420 ;		Remove extra SPINLOCK RELEASE.
                                     0000   421 ;
                                     0000   422 ;	X-2	RNG0002		Rod Gamache		24-Jul-1986
                                     0000   423 ;		Synchronize wakeups from TQE expirations.
                                     0000   424 ;
                                     0000   425 ;	X-1D1	SF04001		Stephen Fiorelli	10-Dec-1985
                                     0000   426 ;		Resolve conflicts from initial merge of exec
                                     0000   427 ;		reorg thread and mainline (4.4 BL7).
                                     0000   428 ;
                                     0000   429 ;	V04-002	EJL0031		Edward J. Los		05-Aug-1985
                                     0000   430 ;		Change SCS$CONNECT to optimize path selection in the
                                     0000   431 ;		dual path case
                                     0000   432 ;
                                     0000   433 ;	V04-001	DYC0001		Dennis Y. Chan		15-Jul-1985
                                     0000   434 ;		Add consistency check in SCS$ALLOC_RSPID for free but
                                     0000   435 ;		busy RDTE.
                                     0000   436 ;
                                     0000   437 ;	V03-033	DWT0237		David W. Thiel		10-Aug-1984
                                     0000   438 ;		Correct reference to RDT$L_MAXRDIDX to match change
                                     0000   439 ;		made in V03-032 below.
                                     0000   440 ;
                                     0000   441 ;	V03-032	NPK3058		N. Kronenberg		25-Jul-1984
                                     0000   442 ;		Fix maximume RDTE index to be index rather than number
                                     0000   443 ;		of RDTEs configured.
                                     0000   444 ;
                                     0000   445 ;	V03-031	NPK3056		N. Kronenberg		23-Jul-1984
                                     0000   446 ;		Add capacity in Connection Descriptor List for addition
                                     0000   447 ;		of CDT's beyond the sysgened number.  Add to SCS$ALLOC_CDT
                                     0000   448 ;		the ability to allocate more CDTs from pool if the
                                     0000   449 ;		are no free CDTs linked to the CDL.
                                     0000   450 ;		Fix error in computation of CDL max index in CDL header
                                     0000   451 ;		(it was # CDTs not index.)
                                     0000   452 ;
                                     0000   453 ;	V03-030	TCM0001		Trudy C. Matthews	20-Jul-1984
                                     0000   454 ;		Remove routine IOC$THREADCRB; put it in IOSUBNPAG instead.
                                     0000   455 ;
                                     0000   456 ;	V03-029	KTA3113		Kerbey T. Altmann	20-Mar-1984
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page   9
X-19                                                                     13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0000   457 ;		Add new entry - SCS$SHUTDOWN to shut down all SCS virtual
                                     0000   458 ;		circuits.  Add new pointers for MSCP image and list of PDTs.
                                     0000   459 ;
                                     0000   460 ;	V03-028	KTA3102		Kerbey T. Altmann	09-Feb-1984
                                     0000   461 ;		Prevent RDT/CDT sequence numbers from ever being zero.
                                     0000   462 ;
                                     0000   463 ;	V03-027	TMK0001		Todd M. Katz		05-Jan-1984
                                     0000   464 ;		Change SCS$DIRECTORY so that it sends a counted sequential
                                     0000   465 ;		message back to the remote SYSAP with the results of the
                                     0000   466 ;		directory lookup. SCS$DIRECTORY was sending an un-counted
                                     0000   467 ;		sequential message, and if the local SCSMAXMSG size was greater
                                     0000   468 ;		than the remote SCSMAXMSG size, then this was resulting in
                                     0000   469 ;		the remote port driver receiving a sequential message larger
                                     0000   470 ;		in size then any of its receive buffers. 
                                     0000   471 ;
                                     0000   472 ;	V03-026	KDM0063		Kathleen D. Morse	03-Aug-1983
                                     0000   473 ;		Replace random number generation usage of PR$_TODR with
                                     0000   474 ;		usage of EXE$GQ_SYSTIME.
                                     0000   475 ;
                                     0000   476 ;	V03-025	NPK3029		N. Kronenberg		22-Jul-1983
                                     0000   477 ;		Zero most fields in a freshly allocated CDT (needed
                                     0000   478 ;		for per connection counters.)
                                     0000   479 ;		Modify SCS$CONFIG_PTH to take advantage of rearranged
                                     0000   480 ;		path block.
                                     0000   481 ;
                                     0000   482 ;	V03-024	MSH0010		Maryann Hinden		11-Jul-1983
                                     0000   483 ;		Fix method of addressing SCS$GA_EXISTS.
                                     0000   484 ;
                                     0000   485 ;	V03-023	MSH0009		Maryann Hinden		27-Jun-1983
                                     0000   486 ;		Modifications to error handling for SCS$DIRECTORY.
                                     0000   487 ;		Keep process poller from polling a given system until
                                     0000   488 ;		current poll is complete.
                                     0000   489 ;
                                     0000   490 ;	V03-022	MSH0008		Maryann Hinden		27-Jun-1983
                                     0000   491 ;		Use remote process name in DIR_LOOKUP which won't get
                                     0000   492 ;		deallocated.
                                     0000   493 ;
                                     0000   494 ;	V03-021	MSH0007		Maryann Hinden		23-Jun-1983
                                     0000   495 ;		Use $PRCPOLDEF.  Check for nonpaged pool not available
                                     0000   496 ;		in SCS$DIRECTORY.  Add SCS$GA_EXISTS to start CONFIGURE
                                     0000   497 ;		process.
                                     0000   498 ;
                                     0000   499 ;	V03-020	MSH0006		Maryann Hinden		18-May-1983
                                     0000   500 ;		Put nodename in process poller mailbox.
                                     0000   501 ;
                                     0000   502 ;	V03-019	ROW0184		Ralph O. Weber		19-APR-1983
                                     0000   503 ;		Change order of wait queue searching in SCS$LKP_MSGWAIT so 
                                     0000   504 ;		that message buffer wait queue is scanned first.  This is done 
                                     0000   505 ;		because the way PADRIVER enters CDRPs into to the send credit 
                                     0000   506 ;		and message buffer wait queues makes the message buffer wait 
                                     0000   507 ;		queue is likely to contain older (longer waiting) CDRPs.  The 
                                     0000   508 ;		connection manager needs this additional level of age ordering 
                                     0000   509 ;		to help provide sequential delivery of messages.
                                     0000   510 ;
                                     0000   511 ;	V03-018 MSH0005		Maryann Hinden		19-Apr-1983
                                     0000   512 ;		Use only one CDRP per connection.
                                     0000   513 ;
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  10
X-19                                                                     13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0000   514 ;	V03-017	JWH0217		Jeffrey W. Horn		14-Apr-1983
                                     0000   515 ;		Change second SLV table to be generated with SLVTAB macro.
                                     0000   516 ;
                                     0000   517 ;	V03-016	MSH0004		Maryann Hinden		08-Apr-1983
                                     0000   518 ;		Changes to support HSC. Various bug fixes.
                                     0000   519 ;
                                     0000   520 ;	V03-015	JWH0211		Jeffrey W. Horn		13-Apr-1983
                                     0000   521 ;		Use SLVTAB macro to produce loadable-code prologue.
                                     0000   522 ;
                                     0000   523 ;	V03-014	MSH0003		Maryann Hinden		01-Apr-1983
                                     0000   524 ;		Move location of MY_PROC.
                                     0000   525 ;	
                                     0000   526 ;	V03-013	MSH0002		Maryann Hinden		24-Mar-1983
                                     0000   527 ;
                                     0000   528 ;--
                                     0000   529 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  11
X-19                            DECLARATIONS                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0000   531 	.SBTTL	DECLARATIONS
                                     0000   532 ;
                                     0000   533 ;	Temporary switch to reduce the frequency of MSCP polling.
                                     0000   534 ;
                           00000000  0000   535 	SCS$NO_MSCP_POLL = 0
                                     0000   536 ;
                                     0000   537 ; INCLUDE FILES
                                     0000   538 ;
                                     0000   539 	.nocross
                                     0000   540 	$BIICDEF			; (TYC0016) BI interface chip definitions
                                     0000   541 	$CCBDEF
                                     0000   542 	$CDLDEF
                                     0000   543 	$CDRPDEF
                                     0000   544 	$CDTDEF
                                     0000   545 	$CRBDEF
                                     0000   546 	$DDBDEF
                                     0000   547 	$DDTDEF
                                     0000   548 	$DYNDEF
                                     0000   549 	$IPLDEF
                                     0000   550 	$NDTDEF				; (TYC0016) Nexus Device Type codes
                                     0000   551 	$PBDEF
                                     0000   552 	$PBODEF
                                     0000   553 	$PDTDEF
                                     0000   554 	.if defined EXTRA_CTR		; Conditional assembly code
                                     0000   555 	$EMBHDDEF			; (TYC 26-May-89) Error log header
                                     0000   556 	.endc
                                     0000   557 	$PDTLISTDEF			; (TYC 28-Feb-89) PDT List 
                                     0000   558 	$PLVECDEF			; Port load vector
                                     0000   559 	$PRCPOLDEF
                                     0000   560 	$RDDEF
                                     0000   561 	$RDTDEF
                                     0000   562 	$SBDEF
                                     0000   563 	$SYSVERSIONDEF			; Version definitions
                                     0000       
                                     0000       ;
                                     0000       ;
                                     0000       ;		DEFINITIONS OF VERSION CATEGORIES
                                     0000       ;
                                     0000       ;
                                     0000       ; BASE_IMAGE
                                     0000       ;
                                     0000       ; 	Base image transfer vectors.  To be changed whenever a transfer vector
                                     0000       ; 	is added.  The major ID is to be changed only when there is no
                                     0000       ; 	alternative.  This will force all code to relink.
                                     0000       ;
                                     0000       ;
                                     0000       ; MEMORY_MANAGEMENT
                                     0000       ;
                                     0000       ; 	All memory management data structures and routines.  This is also used
                                     0000       ; 	for pool management.
                                     0000       ;
                                     0000       ;
                                     0000       ; IO
                                     0000       ;
                                     0000       ; 	All I/O  data structures and routines.
                                     0000       ;
                                     0000       ;
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  12
X-19                            DECLARATIONS                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0000       ; FILES_VOLUMES
                                     0000       ;
                                     0000       ; 	All RMS and file system related items.
                                     0000       ;
                                     0000       ;
                                     0000       ; PROCESS_SCHED
                                     0000       ;
                                     0000       ; 	Data structures  and routines related to process control, scheduling,
                                     0000       ; 	and process structure.   This includes the layout of P1 space.
                                     0000       ; 	Timers, ASTs and event flags are also included in this category.
                                     0000       ;
                                     0000       ;
                                     0000       ; SYSGEN
                                     0000       ;
                                     0000       ; 	SYSGEN parameters.  This category should not be used for any other
                                     0000       ; 	purpose.  Its intent is to allow us to eventually move all SYSGEN
                                     0000       ; 	parameters to another virtual address range.
                                     0000       ;
                                     0000       ;
                                     0000       ; CLUSTERS_LOCKMGR
                                     0000       ; 	Routines and data structures related to clusters, connection manager,
                                     0000       ; 	lock manager, and similar cluster wide facilities.
                                     0000       ;
                                     0000       ;
                                     0000       ; LOGICAL_NAMES
                                     0000       ;
                                     0000       ; 	Logical name  data structures and routines.
                                     0000       ;
                                     0000       ;
                                     0000       ; SECURITY
                                     0000       ;
                                     0000       ; 	The security subsystem.
                                     0000       ;
                                     0000       ;
                                     0000       ; IMAGE_ACTIVATOR
                                     0000       ;
                                     0000       ; 	Image activation and image file interpretation.
                                     0000       ;
                                     0000       ;
                                     0000       ; NETWORKS
                                     0000       ;
                                     0000       ; 	DECnet and support for datalink drivers.
                                     0000       ;
                                     0000       ;
                                     0000       ; COUNTERS
                                     0000       ;
                                     0000       ; 	Cells which are interpreted as counts.  This category is separate
                                     0000       ; 	because it should almost never be necessary to change the major ID
                                     0000       ; 	of this category.
                                     0000       ;
                                     0000       ;
                                     0000       ; STABLE
                                     0000       ;
                                     0000       ; 	Routines and data  structures which are expected to be very stable.
                                     0000       ; 	If a change is necessary, the cell or routine should be renamed rather
                                     0000       ; 	than change the major ID.  The major ID may be changed  every few years
                                     0000       ; 	to garbage collect obsolete cells.
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  13
X-19                            DECLARATIONS                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0000       ;
                                     0000       ;
                                     0000       ; MISC
                                     0000       ;
                                     0000       ; 	Things that don't fit any other category.
                                     0000       ;
                                     0000       ;
                                     0000       ; CPU
                                     0000       ;
                                     0000       ; 	CPU  specific support.
                                     0000       ;
                                     0000       ;
                                     0000       ; VOLATILE
                                     0000       ;
                                     0000       ; 	The major ID of this category will be iuncremented on a fairly regular
                                     0000       ; 	basis.  This should be used for new items which are expected to undergo
                                     0000       ; 	a large amount of change.  If for example, a new IO structure is added,
                                     0000       ; 	but is expected to have significant change in the next release, it
                                     0000       ; 	should be categorized as both volatile and IO.  In this way, it will
                                     0000       ; 	not be necessary to change the major ID for the IO category when
                                     0000       ; 	the structure changes.  Thus, not all drivers will be forced to relink.
                                     0000       ;
                                     0000       ;
                                     0000       ; SHELL
                                     0000       ;
                                     0000       ; 	Cells related to the layout of SHELL.
                                     0000       ;
                                     0000       ;
                                     0000       ; POSIX
                                     0000       ;
                                     0000       ;	Cells related to VMS Posix
                                     0000       ;
                                     0000       ;
                                     0000   564 	$SBNBDEF			; SCA Balance Name Block definitions
                                     0000   565 	$SBODEF
                                     0000   566 	$SCSDEF				; (TYC 22-Mar-89) SCS status definitions
                                     0000   567 	$SDIRDEF
                                     0000   568 	$SPNBDEF
                                     0000   569 	$SPLCODDEF
                                     0000   570 	$SPPBDEF
                                     0000   571 	$SSDEF
                                     0000   572 	$TQEDEF
                                     0000   573 	$UCBDEF
                                     0000   574 ;
                                     0000   575 ; (TYC0016) PALIB.MLB definitions
                                     0000   576 ;
                                     0000   577 	$PAPDTDEF			; CI extension to PDT
                                     0000   578 	$PAREGDEF			; CI register layout
                                     0000   579 	$PAUCBDEF			; UCB extensions
                                     0000   580 	.cross
                                     0000   581 ;
                                     0000   582 ; (TYC 13-Mar-89) Local macros to update load sharing counters
                                     0000   583 ; (TYC 31-Aug-89) Modified due to different way of counting
                                     0000   584 ; Peak counter update 
                                     0000   585 
                                     0000   586 	.MACRO	PEAK_CTR_UPDATE	 PEAK_CTR,LAST_INT_CTR, -
                                     0000   587 				 LIFE_CTR,INT_CTR,?EXIT
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  14
X-19                            DECLARATIONS                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0000   588 	.show binary			
                                     0000   589 	SUBL3	(LAST_INT_CTR),-	; Calculate current 
                                     0000   590 		(LIFE_CTR),INT_CTR	;  interval counter
                                     0000   591 	CMPL	(PEAK_CTR),INT_CTR	; If current peak is greater
                                     0000   592 					;  than interval counter,
                                     0000   593 	BGEQ	EXIT			;  we're done
                                     0000   594 	MOVL	INT_CTR,(PEAK_CTR)	; Else, current interval counter
                                     0000   595 					;  is the new peak value
                                     0000   596 EXIT:
                                     0000   597 	.noshow binary			
                                     0000   598 	.ENDM	PEAK_CTR_UPDATE
                                     0000   599 
                                     0000   600 ; (TYC 31-Aug-89) Modified due to different way of counting
                                     0000   601 ; Average counter update
                                     0000   602 
                                     0000   603 	.MACRO	AVG_CTR_UPDATE	AVG_CTR,LAST_INT_CTR, -
                                     0000   604 				LIFE_CTR,INT_CTR,?CALCAVG,?EXIT
                                     0000   605 	.show binary			
                                     0000   606 	TSTL	(AVG_CTR)		; Is average counter 0?
                                     0000   607 	BNEQ	CALCAVG			;  No, calculate new one
                                     0000   608 	SUBL3	(LAST_INT_CTR),(LIFE_CTR),-
                                     0000   609 		(AVG_CTR)		; Yes, copy interval counter
                                     0000   610 	BRB	EXIT
                                     0000   611 CALCAVG:
                                     0000   612 	;
                                     0000   613 	; R0_R1 = (AVG_CTR * SHARE_TIMER_COUNT) + INT_CTR
                                     0000   614 	; AVG_CTR = R0_R1 / (SHARE_TIMER_COUNT + 1)
                                     0000   615 	;
                                     0000   616 	PUSHL	R2			; Save reg. for computation
                                     0000   617 	MOVL	SHARE_TIMER_COUNT,R2	; Copy timer count
                                     0000   618 	SUBL3	(LAST_INT_CTR),-	; Calculate current
                                     0000   619 		(LIFE_CTR),INT_CTR	;  interval counter
                                     0000   620 	EMUL	(AVG_CTR),R2,-
                                     0000   621 		INT_CTR,R0		
                                     0000   622 	INCL	R2			; Increment timer count
                                     0000   623 	EDIV	R2,R0,-
                                     0000   624 		(AVG_CTR),R1
                                     0000   625 	POPL	R2			; Restore reg.
                                     0000   626 EXIT:
                                     0000   627 	.noshow binary			
                                     0000   628 	.ENDM	AVG_CTR_UPDATE
                                     0000   629 
                                     0000   630 ;
                                     0000   631 ; Misc labels
                                     0000   632 ;
                                     0000   633 	DECLARE_PSECT	EXEC$NONPAGED_DATA
                                     0000   634              
                                     0000   635 SCS$GA_DFLTMSK::			; Mask of processes to enable
                           00000002  0000   636 	.BLKB	SB$S_ENBMSK		;	in new systems that appear
                                     0002   637 SCS$GW_NEXTBIT::			; Next bit available for assignment
                               0000  0002   638 	.WORD	0
                           000000C8  0004   639 SCS$K_CDTEXT == 200			; Allow # CDT's to be extended
                                     0004   640 					;  by 200 beyond sysgened value
                                     0004   641 SCS$GW_CDTMAX::
                                     0004   642 
                               00C7  0004   643 	.WORD	SCS$K_CDTEXT-1		; This will be the maximum CDT 
                                     0006   644 					;  index ever allowed in the CDL.
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  15
X-19                            DECLARATIONS                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0006   645 					;  It = 100-1 + sysgened # CDT's
                                     0006   646 					;  to be filled in during SCS init
                                     0006   647 
                                     0006   648 ;
                                     0006   649 ;  The following three queue headers must be 
                                     0006   650 ; in sequential locations.
                                     0006   651 ;
                                     0006   652 ; ASSUME	SCS$GQ_REUSE_CDT+8   EQ	SCS$GQ_DISCONNECT
                                     0006   653 ; ASSUME	SCS$GQ_DISCONNECT+8  EQ SCS$GQ_WORSE_PATH	
                                     0006   654 
                                     0006   655 	DECLARE_PSECT	EXEC$NONPAGED_CODE
                                     0000   656 DO_RSB:
                            50   D4  0000   657 	CLRL	R0			; Failure status
                                 05  0002   658 	RSB				; Ignore call to unloaded routine
                                     0003   659 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  16
X-19                            DECLARATIONS                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0003   661 ;
                                     0003   662 ; The SCA process name poller makes the following assumptions
                                     0003   663 ;
                                     0003   664 	ASSUME	IPL$_TIMER  EQ  IPL$_SCS
                                     0003   665 	ASSUME	IPL$_SYNCH  EQ	IPL$_SCS
                                     0003   666 
                                     0003   667 	.SBTTL	INITIALIZATION CODE
                                     0003   668 
                                     0003   669 ;+
                                     0003   670 ; This code is called once upon the loading of SCS.  It initializes any
                                     0003   671 ; piece of SCS that needs it.
                                     0003   672 ;-
                                     0003   673 	.show binary
                                     0003   674 SCS_INIT::
                       007C 8F   BB  0003   675 	PUSHR	#^M<R2,R3,R4,R5,R6>	; Save registers for the loader
                            06   11  0007   676 	BRB	1$
                                     0009   677 ;	NOP
                                     0009   678 ;	NOP
                   00000000'GF   16  0009   679 	JSB	G^INI$BRK
                                     000F   680 
                                     000F   681 1$:
                   00000000'GF   D0  000F   682 	MOVL	G^BOO$GL_UCODE,-	; Transfer the address of any
                   00000000'GF       0015   683 		G^SCS$GL_MCADR		;  loaded microcode
                                     001A   684 
                       5E   0C   C2  001A   685 	SUBL	#12, SP			; Get some scratch area
                       56   5E   D0  001D   686 	MOVL	SP, R6			; Set a pointer
                          0103   30  0020   687 	BSBW	SEQ_NO			; Get a sequence number
                          01C9   30  0023   688 	BSBW	INIT_RDT		; Do the Request Desc
                         03 50   E8  0026   689 	BLBS	R0, 5$			; Branch on success
                          00A6   31  0029   690 	BRW	10$			; No pool
                                     002C   691 5$:
                                     002C   692 ;	BSBB	SEQ_NO			; Get a sequence number
               01 A6   10F3 8F   A0  002C   693 	ADDW2	#^X10F3, 1(R6)		; Permute the low byte
                          0113   30  0032   694 	BSBW	INIT_CDL		; Do the Connect Desc
                       5E   0C   C0  0035   695 	ADDL	#12, SP			; Release the scratch area
                         03 50   E8  0038   696 	BLBS	R0, 6$			; Branch on success
                          0094   31  003B   697 	BRW	10$			; No pool
                                     003E   698 6$:
                          11E7   30  003E   699 	BSBW	INIT_LOAD_SHARE		; (TYC 24-Apr-89) Init dynamic load sharing
                         03 50   E8  0041   700 	BLBS	R0,7$			; Continue if success
                          008B   31  0044   701 	BRW	10$			; Branch on error
                                     0047   702 7$:	
                                     0047   703 ;***********
                                     0047   704 ; (TYC 1-may-89) debugging code
                                     0047   705 ; enable tracing by calling init code
                                     0047   706 ;
                                     0047   707 ;        .if defined EXTRA_CTR           ; Conditional assembly code
                                     0047   708 ;	.WEAK	TRC$INIT		; TRC$INIT is defined in PAMONIT
                                     0047   709 ;	MOVAL	G^TRC$INIT,R0		; Tracing support?
                                     0047   710 ;	BEQL	26$			; Branch if not present
                                     0047   711 ;	JSB	(R0)			; Init the trace buffers
                                     0047   712 ;26$:
                                     0047   713 ;	.endc
                                     0047   714 ;************
                                     0047   715 	LISTEN	MSGADR=W^SCS$DIRECTORY,-
                                     0047   716 		ERRADR=W^LISTENERR,-
                                     0047   717 		LPRNAM=W^DIRNAME,-
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  17
X-19                            INITIALIZATION CODE                      13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0047   718 		PRINFO=W^DIRINFO 	; Put our name in directory-leave
                         60'AF   9F  0047       		PUSHAB	B^30000$
                       00E6'CF   9F  004A       		PUSHAB	W^DIRINFO
                       00D6'CF   9F  004E       		PUSHAB	W^DIRNAME
                       07E0'CF   9F  0052       		PUSHAB	W^LISTENERR
                       0705'CF   9F  0056       		PUSHAB	W^SCS$DIRECTORY
                   00000874'GF   17  005A       		JMP	G^SCS$LISTEN
                                     0060       30000$:
                                     0060   719 					; (MUST BE AFTER INIT OF CDT)
                         6F 50   E9  0060   720 	BLBC	R0, 10$			; Check for error
                                     0063   721 	.IF DEFINED SCS$NO_MSCP_POLL
                                     0063   722 	;
                                     0063   723 	;  Declare dummy MSCP$DISK and MSCP$TAPE servers to reduce polling
                                     0063   724 	;
                   00000000'GF   D5  0063   725 	TSTL	G^CLU$GL_TMSCP_LOAD	; load tape server?
                            1C   12  0069   726 	BNEQ	22$			; BR if the answer is YES
                                     006B   727 	LISTEN	MSGADR=W^NO_MSCP_LISTN,-; No MSCP$TAPE listener on this system
                                     006B   728 		ERRADR=W^LISTENERR,-	;  so put a dummy name in the directory
                                     006B   729 		LPRNAM=W^TAPE_SERV_NAME,- ; 
                                     006B   730 		PRINFO=W^SERV_INFO	; 
                         84'AF   9F  006B       		PUSHAB	B^30001$
                       00F6'CF   9F  006E       		PUSHAB	W^SERV_INFO
                       0116'CF   9F  0072       		PUSHAB	W^TAPE_SERV_NAME
                       07E0'CF   9F  0076       		PUSHAB	W^LISTENERR
                       06FC'CF   9F  007A       		PUSHAB	W^NO_MSCP_LISTN
                   00000874'GF   17  007E       		JMP	G^SCS$LISTEN
                                     0084       30001$:
                         4B 50   E9  0084   731 	BLBC	R0, 10$			; Check for error
                                     0087   732 
                   00000000'GF   D5  0087   733 22$:	TSTL	G^CLU$GL_MSCP_LOAD	; Will the MSCP server be loaded?
                            1C   12  008D   734 	BNEQ	20$			; Branch if so
                                     008F   735 	LISTEN	MSGADR=W^NO_MSCP_LISTN,-; No MSCP$DISK listener on this system
                                     008F   736 		ERRADR=W^LISTENERR,-	;  so put a dummy name in the directory
                                     008F   737 		LPRNAM=W^DISK_SERV_NAME,- ; 
                                     008F   738 		PRINFO=W^SERV_INFO	; 
                         A8'AF   9F  008F       		PUSHAB	B^30002$
                       00F6'CF   9F  0092       		PUSHAB	W^SERV_INFO
                       0106'CF   9F  0096       		PUSHAB	W^DISK_SERV_NAME
                       07E0'CF   9F  009A       		PUSHAB	W^LISTENERR
                       06FC'CF   9F  009E       		PUSHAB	W^NO_MSCP_LISTN
                   00000874'GF   17  00A2       		JMP	G^SCS$LISTEN
                                     00A8       30002$:
                         27 50   E9  00A8   739 	BLBC	R0, 10$			; Check for error
                                     00AB   740 20$:
                                     00AB   741 	.ENDC				; SCS$NO_MSCP_POLL
                          0190   30  00AB   742 	BSBW	POLLER_INIT		; Initialize process name poller
                         21 50   E9  00AE   743 	BLBC	R0,10$			; Branch on error
              50   00000000'EF   DE  00B1   744 	MOVAL	SCS_START, R0		; Set R0--> start of code
              00000000'GF   50   D0  00B8   745 	MOVL	R0,G^SCS$GA_EXISTS	; Indicate presence of SCS 
                                     00BF   746 					; (flag to start CONFIGURE process)
                                     00BF   747 	.weak	SCS$INIT_REMOTE_SDA	; Initialize remote SDA
              50   00000000'GF   DE  00BF   748 	MOVAL	G^SCS$INIT_REMOTE_SDA,R0; Linked to remote SDA?
                            02   13  00C6   749 	BEQL	25$			; No, continue
                            60   16  00C8   750 	JSB	(R0)			; Yes, initialize it
                                     00CA   751 25$:
                       50   01   D0  00CA   752 	MOVL	#1,R0			; Set success
                       007C 8F   BA  00CD   753 	POPR	#^M<R2,R3,R4,R5,R6>	; Restore registers for the loader
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  18
X-19                            INITIALIZATION CODE                      13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                 05  00D1   754 	RSB
                                     00D2   755 10$:	BUG_CHECK	RESEXH,FATAL	; Not enough resources to continue
                               FEFF  00D2       		.WORD	^XFEFF
                               0004' 00D4       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_RESEXH!4
                                     00D6   756 
52 4F 54 43 45 52 49 44 24 53 43 53  00D6   757 DIRNAME:.ASCII	/SCS$DIRECTORY   /
                        20 20 20 59  00E2       
65 53 20 79 72 6F 74 63 65 72 69 44  00E6   758 DIRINFO:.ASCII	/Directory Server/
                        72 65 76 72  00F2       
                                     00F6   759 	.IF DEFINED SCS$NO_MSCP_POLL
                                     00F6   760 SERV_INFO:
20 54 4E 45 53 45 52 50 20 54 4F 4E  00F6   761 	.ASCII	/NOT PRESENT HERE/
                        45 52 45 48  0102       
                                     0106   762 DISK_SERV_NAME:
20 20 20 4B 53 49 44 24 50 43 53 4D  0106   763 	.ASCII	/MSCP$DISK       /
                        20 20 20 20  0112       
                                     0116   764 TAPE_SERV_NAME:
20 20 20 45 50 41 54 24 50 43 53 4D  0116   765 	.ASCII	/MSCP$TAPE       /
                        20 20 20 20  0122       
                                     0126   766 	.ENDC				; SCS$NO_MSCP_POLL
                                     0126   767 
                                     0126   768 ;
                                     0126   769 ; Calculate a random sequence number from the system time
                                     0126   770 ;
                                     0126   771 SEQ_NO:	
              66   00000002'GF   D0  0126   772 	MOVL	G^EXE$GQ_TODCBASE+2,(R6); Get middle bits of system time
                       50   66   3C  012D   773 	MOVZWL	(R6), R0		; Get low 16 bits
                    51   02 A6   3C  0130   774 	MOVZWL	2(R6), R1		; Get another 16 bits
                       51   50   C4  0134   775 	MULL2	R0, R1			; Multiply them
                    50   01 A6   3C  0137   776 	MOVZWL	1(R6), R0		; Add in a fudge
                  66   51   50   C1  013B   777 	ADDL3	R0, R1, (R6)		; Store away for later
                         01 A6   B5  013F   778 	TSTW	1(R6)			; Check for zero
                            03   12  0142   779 	BNEQ	10$			; Not so, okay
                         01 A6   B6  0144   780 	INCW	1(R6)			; Yes, fix it
                                 05  0147   781 10$:	RSB
                                     0148   782 ;
                                     0148   783 ; Allocate and initialize the Connection Descriptor List
                                     0148   784 ;
                                     0148   785 	.enable lsb
                                     0148   786 INIT_CDL:
              54   00000000'9F   3C  0148   787 	MOVZWL	@#SCS$GW_CDTCNT, R4	; Pick up number of CDT's to alloc
              00000004'EF   54   A0  014F   788 	ADDW	R4,SCS$GW_CDTMAX	; Add sysgened # CDT's to # extension
                                     0156   789 					;  CDT's allowed
                  57   0160 8F   3C  0156   790 	MOVZWL	#<<CDT$C_LENGTH+15>&^C15>,R7  ; Get rounded CDT size
                  51   54   57   C5  015B   791 	MULL3	R7, R4, R1		; Get total amount of space
              54   000000C8 8F   C0  015F   792 	ADDL	#SCS$K_CDTEXT,R4	; Get # CDL pointers to CDTs needed
                       55   10   D0  0166   793 	MOVL	#CDL$C_LENGTH, R5	; Fixed portion of CDL
                  55   0F A544   DE  0169   794 	MOVAL	15(R5)[R4], R5		; Compute total CDL size with
                       55   0F   CA  016E   795 	BICL	#15, R5			;  appropriate rounding
                       51   55   C0  0171   796 	ADDL	R5, R1			; Compute total pool needed
                          07AF   30  0174   797 	BSBW	SCS_ALONONPAGED		; Allocate it
                         74 50   E9  0177   798 	BLBC	R0, 20$			; Error - no memory
                                     017A   799 ;
                                     017A   800 ; R1  =  Size of allocated block
                                     017A   801 ; R2 --> Allocated block
                                     017A   802 ; R4  =  #CDT's to allocate now + # extension CDTs allowed
                                     017A   803 ; R5  =  Size of CDL (Rounded up)
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  19
X-19                            INITIALIZATION CODE                      13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     017A   804 ; R7  =  Size of CDT(Rounded up)
                                     017A   805 ;
              54   000000C8 8F   C2  017A   806 	SUBL	#SCS$K_CDTEXT,R4	; Back off R4 to # CDT's to allocate now
                            3F   BB  0181   807 	PUSHR	#^M<R0,R1,R2,R3,R4,R5>	; Save reg
        62   51   00   6E   00   2C  0183   808 	MOVC5	#0, (SP), #0, R1, (R2)	; Clear it all out
                            3F   BA  0189   809 	POPR	#^M<R0,R1,R2,R3,R4,R5>
           00000000'GF   10 A2   DE  018B   810 	MOVAL	CDL$C_LENGTH(R2), -
                                     0193   811 		G^SCS$GL_CDL		; Set pointer to CDL in system space
                     51   6245   9E  0193   812 	MOVAB	(R2)[R5], R1		; Get pointer to first CDT
                       62   54   D0  0197   813 	MOVL	R4, (R2)		; Set # CDTs initially
                            82   D7  019A   814 	DECL	(R2)+			; Convert # CDTs to max initl index
                       82   51   D0  019C   815 	MOVL	R1, (R2)+		; Set first free CDT
                       82   55   B0  019F   816 	MOVW	R5, (R2)+		; Set size of CDL
                  82   0160 8F   B0  01A2   817 	MOVW	#DYN$C_SCS!-
                                     01A7   818 		<DYN$C_SCS_CDL@8>,(R2)+	; Set type and subtype
                            82   D4  01A7   819 	CLRL	(R2)+			; Clear stall counter
                            55   D4  01A9   820 	CLRL	R5			; Initialize index
                       82   51   D0  01AB   821 10$:	MOVL	R1, (R2)+		; Set address 	
                     53   6147   9E  01AE   822 	MOVAB	(R1)[R7], R3		; Get address of next CDT
                       61   53   D0  01B2   823 	MOVL	R3, CDT$L_LINK(R1)	; Set it into link field
                    08 A1   57   B0  01B5   824 	MOVW	R7, CDT$W_SIZE(R1)	; Set size field
               0A A1   0260 8F   B0  01B9   825 	MOVW	#DYN$C_SCS!-
                                     01BF   826 		<DYN$C_SCS_CDT@8>, -
                                     01BF   827 		 CDT$B_TYPE(R1)		; Set type and subtype
                    18 A1   55   B0  01BF   828 	MOVW	R5, CDT$L_LCONID(R1)	; Set index piece of CONID
                 1A A1   01 A6   B0  01C3   829 	MOVW	1(R6),CDT$L_LCONID+2(R1); Set sequence piece of CONID
                         28 A1   D4  01C8   830 	CLRL	CDT$W_STATE(R1)		; Set state to virgin
                 30 A1   30 A1   9E  01CB   831 	MOVAB	CDT$L_WAITQFL(R1), -
                                     01D0   832 		CDT$L_WAITQFL(R1)	; Set up initial cond
                 34 A1   30 A1   9E  01D0   833 	MOVAB	CDT$L_WAITQFL(R1), -
                                     01D5   834 		CDT$L_WAITQBL(R1)	; Set up initial cond
                 38 A1   38 A1   9E  01D5   835 	MOVAB	CDT$L_CRWAITQFL(R1), -
                                     01DA   836 		CDT$L_CRWAITQFL(R1)	; Set up initial cond
                 3C A1   38 A1   9E  01DA   837 	MOVAB	CDT$L_CRWAITQFL(R1), -
                                     01DF   838 		CDT$L_CRWAITQBL(R1)	; Set up initial cond
                       51   53   D0  01DF   839 	MOVL	R3, R1			; Get next CDT
                    C5 55   54   F2  01E2   840 	AOBLSS	R4, R5,10$		; Loop until all done
                       51   57   C2  01E6   841 	SUBL	R7,R1			; Step back to last CDT
                            61   D4  01E9   842 	CLRL	(R1)			;  and clear the list pointer
                       50   01   D0  01EB   843 	MOVL	#1, R0
                                 05  01EE   844 20$:	RSB
                                     01EF   845 	.disable lsb
                                     01EF   846 ;
                                     01EF   847 ; Allocate and initialize the Request Descriptor Table
                                     01EF   848 ;
                                     01EF   849 INIT_RDT:
                                     01EF   850 	ASSUME	RD$C_LENGTH EQ 8
              54   00000000'9F   3C  01EF   851 	MOVZWL	@#SCS$GW_RDTCNT, R4	; Pick up number of RDTE's
                       51   18   D0  01F6   852 	MOVL	#RDT$C_LENGTH, R1	; Fixed portion
                     51   6144   7E  01F9   853 	MOVAQ	(R1)[R4], R1		; Total space needed
                          0726   30  01FD   854 	BSBW	SCS_ALONONPAGED		; Allocate it
                         3A 50   E9  0200   855 	BLBC	R0, 20$			; No space, error
                    53   18 A2   9E  0203   856 	MOVAB	RDT$C_LENGTH(R2), R3	; Set past RDT
              00000000'GF   53   D0  0207   857 	MOVL	R3, G^SCS$GL_RDT	; Set pointer to RDT in system space
                       55   52   D0  020E   858 	MOVL	R2, R5			; Save it
                       82   55   D0  0211   859 	MOVL	R5, (R2)+		; Set initial condition
                       82   55   D0  0214   860 	MOVL	R5, (R2)+		; Ditto
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  20
X-19                            INITIALIZATION CODE                      13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                       82   51   B0  0217   861 	MOVW	R1, (R2)+		; Set size field
                  82   0660 8F   B0  021A   862 	MOVW	#DYN$C_SCS!-
                                     021F   863 		<DYN$C_SCS_RDT@8>,(R2)+	; Set type & subtype
                       82   53   7D  021F   864 	MOVQ	R3, (R2)+		; Set first free RDTE & # RDTEs
                         FC A2   D7  0222   865 	DECL	-4(R2)			; Convert # RDTEs to maximum index
                            82   D4  0225   866 	CLRL	(R2)+			; Clear stall counter
                    53   08 A3   9E  0227   867 	MOVAB	RD$C_LENGTH(R3), R3	; Set R3 point to next RDTE
                       82   83   7E  022B   868 10$:	MOVAQ	(R3)+, (R2)+		; Set next free RDTE link
                            82   B4  022E   869 	CLRW	(R2)+			; Set state to FREE
                    82   01 A6   B0  0230   870 	MOVW	1(R6), (R2)+		; Set in sequence number
                         F4 54   F5  0234   871 	SOBGTR	R4, 10$			; Loop until done
                         F8 A2   D4  0237   872 	CLRL	-RD$C_LENGTH(R2)	; Zero out final next pointer
                       50   01   D0  023A   873 	MOVL	#1, R0
                                 05  023D   874 20$:	RSB
                                     023E   875 ;
                                     023E   876 ; Initialize the process name poller
                                     023E   877 ;
                                     023E   878 POLLER_INIT:
              53   00000000'GF   DE  023E   879 	MOVAL	G^SCS$GQ_CONFIG,R3	; Address of system block listhead
                       52   63   D0  0245   880 	MOVL	(R3),R2			; Address of first SB
                       53   52   D1  0248   881 10$:	CMPL	R2,R3			; Back to listhead?
                            08   13  024B   882 	BEQL	20$			; Branch if done
                          07F1   30  024D   883 	BSBW	SCS$NEW_SB		; New system to poll	
                       52   62   D0  0250   884 	MOVL	SB$L_FLINK(R2),R2	; Chain to next SB
                            F3   11  0253   885 	BRB	10$			; Iterate over known systems
                                     0255   886 ;
                                     0255   887 ; Design note:
                                     0255   888 ;
                                     0255   889 ;	The following could be done in less code by having EXE$TIMEOUT make
                                     0255   890 ;	the call.  The tradeoff is that if EXE$TIMEOUT calls the poller,
                                     0255   891 ;	then there is a JSB/RSB overhead every second when not in an SCS
                                     0255   892 ;	environment.  In an SCS environment, however, a TQE and the
                                     0255   893 ;	associated queue management is avoided each second.
                                     0255   894 ;
                       51   34   3C  0255   895 20$:	MOVZWL	#TQE$K_LENGTH,R1	; Size of a TQE
                          06CB   30  0258   896 	BSBW	SCS_ALONONPAGED		; Allocate a TQE
                         67 50   E9  025B   897 	BLBC	R0,30$			; Exit on error
                    08 A2   51   B0  025E   898 	MOVW	R1,TQE$W_SIZE(R2)	; Store size
                    0A A2   0F   90  0262   899 	MOVB	#DYN$C_TQE,TQE$B_TYPE(R2)	; Store type
                    0B A2   05   90  0266   900 	MOVB	#TQE$C_SSREPT,TQE$B_RQTYPE(R2)	; Store type of timer queue entry
               0C A2   0B2B'CF   9E  026A   901 	MOVAB	W^START_POLL,TQE$L_FPC(R2)	; Address of timeout routine
                                     0270   902 	ASSUME	TQE$L_FR3+4,EQ,TQE$L_FR4
                         10 A2   7C  0270   903 	CLRQ	TQE$L_FR3(R2)		; Zero R3 and R4
 20 A2   00   01   00989680 8F   7A  0273   904 	EMUL	#10*1000*1000,#1,#0, -	; Delta time = 1 second
                                     027D   905 		TQE$Q_DELTA(R2)
                       55   52   D0  027D   906 	MOVL	R2,R5			; Address of TQE
                                     0280   907 	read_systime R0			; Get system time - immediate timeout
                                     0280       	.SAVE	LOCAL_BLOCK
                                     0280       	.PSECT	$ABS$,ABS
                           00000000  42B0       	.=0
                                 00000280       	.RESTORE
                                     0280       	.SAVE	LOCAL_BLOCK
                                     0280       	.PSECT	$ABS$,ABS
                           00000000  42B0       	.=0
                                 00000280       	.RESTORE
                       7E   12   DB  0280       	 MFPR	S^#PR$_IPL,-(SP)
                10 00000000'GF   E9  0283       	BLBC	G^SMP$GL_FLAGS,30005$
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  21
X-19                            INITIALIZATION CODE                      13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                            50   DD  028A       	 PUSHL	R0
                       50   23   9A  028C       	 MOVZBL	S^#SPL$C_HWCLK,R0
                   00000000'GF   16  028F       	 JSB	G^SMP$ACQUIRE
                            50 8ED0  0295       	 POPL	R0
                            03   11  0298       	BRB	30006$
                                     029A       30005$:
                       12   18   DA  029A       		MTPR	S^#IPL$_HWCLK,S^#PR$_IPL
                                     029D       30006$:
              50   00000000'GF   7D  029D       	  MOVQ	G^EXE$GQ_SYSTIME,R0
                0E 00000000'GF   E9  02A4       	BLBC	G^SMP$GL_FLAGS,30012$
                            50   DD  02AB       	 PUSHL	R0
                       50   23   9A  02AD       	 MOVZBL	S^#SPL$C_HWCLK,R0
                   00000000'GF   16  02B0       	 JSB	G^SMP$RELEASE
                            50 8ED0  02B6       	 POPL	R0
                                     02B9       30012$:
                       12   8E   DA  02B9       	 MTPR	(SP)+,S^#PR$_IPL
                   00000000'GF   16  02BC   908 	JSB	G^EXE$INSTIMQ		; Link into timer queue
                       50   01   D0  02C2   909 	MOVL	S^#SS$_NORMAL,R0	; All is well
                                 05  02C5   910 30$:	RSB
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  22
X-19                            INITIALIZATION CODE                      13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     02C6   912 	DECLARE_PSECT	EXEC$NONPAGED_CODE
                                 000002C6       	.PSECT	EXEC$NONPAGED_CODE,LONG,NOWRT,EXE,PIC
                                     02C6   913 
                                     02C6   914 	.SBTTL	SCS$ACCEPT
                                     02C6   915 ;++
                                     02C6   916 ;
                                     02C6   917 ; FUNCTIONAL DESCRIPTION:
                                     02C6   918 ;
                                     02C6   919 ; (TYC 14-Feb-89) New parameter LOAD_RATING is added so that SYSAP can
                                     02C6   920 ; set initial load rating.
                                     02C6   921 ;
                                     02C6   922 ; CALLING SEQUENCE:
                                     02C6   923 ;
                                     02C6   924 ;	BSBW	SCS$ACCEPT
                                     02C6   925 ;
                                     02C6   926 ; INPUTS:
                                     02C6   927 ;
                                     02C6   928 ;	R3 = Address of listening CDT
                                     02C6   929 ;	 0(SP) = # of parameters		  12
                                     02C6   930 ;	 4(SP) = Input address			MSGADR
                                     02C6   931 ;	 8(SP) = [Datagram input address]	DGADR
                                     02C6   932 ;	12(SP) = Error address			ERRADR
                                     02C6   933 ;	16(SP) = Initial credit value		INITCR
                                     02C6   934 ;	18(SP) = Minimum send credit value	MINSCR
                                     02C6   935 ;	20(SP) = Initial DG credit value	INITDG
                                     02C6   936 ;	22(SP) = [Block transfer priority]	BLKPRI
                                     02C6   937 ;	24(SP) = Address of connect data	CONDAT
                                     02C6   938 ;	28(SP) = Address of auxilary structure	AUXSTR
                                     02C6   939 ;	32(SP) = [Bad response packet address]	BADRSP
                                     02C6   940 ;	36(SP) = [Move Path notificiation addr] MOVADR
                                     02C6   941 ;	40(SP) = [Initial load rating]		LOAD_RATING
                                     02C6   942 ;	44(SP) = Return address
                                     02C6   943 ;
                                     02C6   944 ; OUTPUTS:
                                     02C6   945 ;
                                     02C6   946 ;	R0 = Status
                                     02C6   947 ;	R2 = Address of CDT allocated (for SYSAPs to do a REJECT on a failed 
                                     02C6   948 ;	     ACCEPT).
                                     02C6   949 ;	R3 = Address of CDT allocated
                                     02C6   950 ;	R4 = Address of PDT for listening
                                     02C6   951 ;	R1,R2 Destroyed
                                     02C6   952 ;	R5   Preserved
                                     02C6   953 ;
                                     02C6   954 ;--
                                     02C6   955 
                                     02C6   956 	UNIVERSAL_SYMBOL SCS$ACCEPT
                                     02C6       SCS$ACCEPT::
                                     02C6   957 
                                     02C6   958 ;SCS$ACCEPT:
                                     02C6   959 	ASSUME	PDT$C_BASEVER EQ 0	; Base version of SCS
                       00F4 C4   B5  02C6   960 	TSTW	PDT$W_SCSVERSION(R4)	; Which version?
                            04   12  02CA   961 	BNEQ	20$			; New version
                                     02CC   962 	BUG_CHECK	VAXPORT,FATAL	; Old V4 code no longer understood
                               FEFF  02CC       		.WORD	^XFEFF
                               0004' 02CE       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_VAXPORT!4
                                     02D0   963 	;
                                     02D0   964 	;	V5.0 version of the code -- the CDT was allocated when the
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  23
X-19                            SCS$ACCEPT                               13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     02D0   965 	;	connection request came in.  
                                     02D0   966 	;
                    50   54 A3   D0  02D0   967 20$:	MOVL	CDT$L_LPROCNAM(R3),R0	; Get the local process name
                          0C54   30  02D4   968 	BSBW	SCS_REGISTER_LOCAL_NAME ;  and register it
                       52   53   D0  02D7   969 	MOVL	R3, R2			; Transfer listen CDT ptr
                                     02DA   970 	;
                                     02DA   971 	;	(TYC 21-Jun-89)
                                     02DA   972 	;	Load sharing version of the code has the number of parameters (12)
                                     02DA   973 	;	stored at the top of the stack.  If this count is not present,
                                     02DA   974 	;	then the SYSAP was assembled against the old SYSMAR.  Just
                                     02DA   975 	;	set the connection load rating to UNEQUAL_PATH and don't look
                                     02DA   976 	;	for a MOVE_PATH parameter.  Also set a flag in CDT to indicate
                                     02DA   977 	;	pre-load sharing version of SYSAP.
                                     02DA   978 	;
                       6E   0C   D1  02DA   979 	CMPL	#12,(SP)		; (TYC 21-Jun-89) Load sharing SYSAP?
                            08   12  02DD   980 	BNEQ	24$			; It isn't
                       0157 C3   94  02DF   981 	CLRB	CDT$B_SYSAP_VERSION(R3) ; (21-Jun-89) Clear SYSAP version flag
                            8E   D5  02E3   982 	TSTL	(SP)+			; Get rid of count
                            0A   11  02E5   983 	BRB	25$			; and continue
                            07   D0  02E7   984 24$:	MOVL	#CDT$C_UNEQUAL_PATH,-	; (TYC 21-Jun-89) Pre-load sharing SYSAPs 
                       00B0 C3       02E9   985 		CDT$L_LOAD_RATING(R3)	;  must be static.
                            01   90  02EC   986 	MOVB	#CDT$C_PRE_LOADSHARE,-	; (TYC 21-JUN-89) set flag for pre-load sharing
                       0157 C3       02EE   987 		CDT$B_SYSAP_VERSION(R3) ;  version
                                     02F1   988 
                                     02F1   989 	ASSUME	CDT$L_MSGINPUT+4 EQ CDT$L_DGINPUT
                       63   8E   7D  02F1   990 25$:	MOVQ	(SP)+,CDT$L_MSGINPUT(R3); Get both MSGINPUT and DGINPUT
                         0C A3 8ED0  02F4   991 	POPL	CDT$L_ERRADDR(R3)	; Set address of error routine
                    54   10 A3   D0  02F8   992 	MOVL	CDT$L_PDT(R3), R4	; Pick up PDT addr from listen
                       51   0C   9A  02FC   993 	MOVZBL	#PDT$L_ACCEPT, R1	; Offset in PDT to use
                          02A7   31  02FF   994 	BRW	PDT_JMP			; Finish in port dependent code
                                     0302   995 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  24
X-19                            SCS$ALLOC_CDT                            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0302   997 	.SBTTL	SCS$ALLOC_CDT
                                     0302   998 ;++
                                     0302   999 ;
                                     0302  1000 ; FUNCTIONAL DESCRIPTION:
                                     0302  1001 ;
                                     0302  1002 ; 	Attempt to remove a CDT from the free list.  If no more
                                     0302  1003 ;	are available, and the CDL has room for an extension CDT,
                                     0302  1004 ;	then allocate one CDT from pool.  Put new CDT address in CDT,
                                     0302  1005 ;	step current maximum index in CDL header, init CDT to closed 
                                     0302  1006 ;	state, and give it a local connection ID.
                                     0302  1007 ;
                                     0302  1008 ;	In allocated CDT, init wait queues, zero most of the rest of
                                     0302  1009 ;	the CDT, and return to caller.
                                     0302  1010 ;
                                     0302  1011 ; CALLING SEQUENCE:
                                     0302  1012 ;
                                     0302  1013 ;	BSBW	SCS$ALLOC_CDT
                                     0302  1014 ;
                                     0302  1015 ; INPUTS:
                                     0302  1016 ;
                                     0302  1017 ;	NONE
                                     0302  1018 ;
                                     0302  1019 ; OUTPUTS:
                                     0302  1020 ;
                                     0302  1021 ;	R0 = SS$_NORMAL if success
                                     0302  1022 ;	   = SS$_INSFCDT if no CDT's available
                                     0302  1023 ;	R1 = CONID
                                     0302  1024 ;	R3 = Pointer to CDT if successful
                                     0302  1025 ;	   = 0 otherwize
                                     0302  1026 ;	R2,R4,R5 preserved
                                     0302  1027 ;
                                     0302  1028 ;--
                                     0302  1029 
                                     0302  1030 	UNIVERSAL_SYMBOL SCS$ALLOC_CDT
                                     0302       SCS$ALLOC_CDT::
                                     0302  1031 
                                     0302  1032 ;SCS$ALLOC_CDT:
              51   00000000'GF   D0  0302  1033 	MOVL	G^SCS$GL_CDL, R1	; Pick up pointer to list
                    53   F4 A1   D0  0309  1034 	MOVL	CDL$L_FREECDT(R1), R3	; Find first free one
                            4C   12  030D  1035 	BNEQ	20$			; Branch if got one
                         F0 A1   B1  030F  1036 	CMPW	CDL$W_MAXCONIDX(R1),-	; Have we already allocated all of
                   00000004'EF       0312  1037 		SCS$GW_CDTMAX		;  the available pointers?
                            7C   18  0317  1038 	BGEQ	NO_CDT			; Branch if so
                  51   015B 8F   3C  0319  1039  	MOVZWL	#CDT$C_LENGTH,R1	; Get size of a CDT
                            52   DD  031E  1040 	PUSHL	R2			; Save caller's register
                          0603   30  0320  1041 	BSBW	SCS_ALONONPAGED		; Allocate one from pool
                       53   52   D0  0323  1042 	MOVL	R2,R3			; Copy assumed new CDT addr
                            52 8ED0  0326  1043 	POPL	R2			; Restore caller's R2
                         69 50   E9  0329  1044 	BLBC	R0,NO_CDT		; Branch if didn't get CDT from pool
                    08 A3   51   B0  032C  1045 	MOVW	R1,CDT$W_SIZE(R3)	; Set CDT size,
                                 B0  0330  1046 	MOVW	#DYN$C_SCS!-		;  structure type,
                                     0331  1047 		<DYN$C_SCS_CDT@8>,-	;  and subtype
               0A A3   0260 8F       0331  1048 		CDT$B_TYPE(R3)		;
                         28 A3   D4  0336  1049 	CLRL	CDT$W_STATE(R3)		; Set CDT state = closed
              51   00000000'GF   D0  0339  1050 	MOVL	G^SCS$GL_CDL,R1		; Get start of CDT list
                       50   61   D0  0340  1051 	MOVL	(R1),R0			; Get 1st CDT address
                    50   18 A0   D0  0343  1052 	MOVL	CDT$L_LCONID(R0),R0	; Get 1st CDT's local CONID
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  25
X-19                            SCS$ALLOC_CDT                            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0347  1053 					;  in order to capture its sequence #
                         F0 A1   B6  0347  1054 	INCW	CDL$W_MAXCONIDX(R1)	; Step max legal CONID index in CDL
                    50   F0 A1   B0  034A  1055 	MOVW	CDL$W_MAXCONIDX(R1),R0	; Combine seq # and index
                    18 A3   50   D0  034E  1056 	MOVL	R0,CDT$L_LCONID(R3)	;  = new CDT's connection ID
                       50   50   3C  0352  1057 	MOVZWL	R0,R0			; Isolate index
                     6140   53   D0  0355  1058 	MOVL	R3,(R1)[R0]		; Save new CDT addr in CDL
                            04   11  0359  1059 	BRB	30$			; Join common CDT init
                                     035B  1060 
                    F4 A1   63   D0  035B  1061 20$:	MOVL	CDT$L_LINK(R3), -
                                     035F  1062 		CDL$L_FREECDT(R1)	; Set pointer to next free CDT
                                     035F  1063 
                            3C   BB  035F  1064 30$:	PUSHR	#^M<R2,R3,R4,R5>	; Save registers for MOVC
                         14 A3   D4  0361  1065 	CLRL	CDT$L_RCONID(R3)	; Zero remote CONID
               00   00 8F   00   2C  0364  1066 	MOVC5	#0,#0,#0,-		; Zero CDT from longwd after
                       013F 8F       0369  1067 		#<CDT$C_LENGTH-CDT$L_LCONID-4>,-
                         1C A3       036C  1068 		CDT$L_LCONID+4(R3)	;  local CONID to end
                            3C   BA  036E  1069 	POPR	#^M<R2,R3,R4,R5>	; Restore destroyed registers
                    51   18 A3   D0  0370  1070 	MOVL	CDT$L_LCONID(R3), R1	; Get conid for return to caller
                 30 A3   30 A3   9E  0374  1071 	MOVAB	CDT$L_WAITQFL(R3), -
                                     0379  1072 		CDT$L_WAITQFL(R3)	; Set up initial cond
                 34 A3   30 A3   9E  0379  1073 	MOVAB	CDT$L_WAITQFL(R3), -
                                     037E  1074 		CDT$L_WAITQBL(R3)	; Set up initial cond
                 38 A3   38 A3   9E  037E  1075 	MOVAB	CDT$L_CRWAITQFL(R3), -
                                     0383  1076 		CDT$L_CRWAITQFL(R3)	; Set up initial cond
                 3C A3   38 A3   9E  0383  1077 	MOVAB	CDT$L_CRWAITQFL(R3), -
                                     0388  1078 		CDT$L_CRWAITQBL(R3)	; Set up initial cond
                   00000000'GF   D0  0388  1079 	MOVL	G^EXE$GL_ABSTIM,-	; Give this connection a time stamp
                       00B4 C3       038E  1080 		CDT$L_TIME_STAMP(R3)
                       50   01   D0  0391  1081 	MOVL	#1,R0			; Set success
                                 05  0394  1082 	RSB
                                     0395  1083 
                                     0395  1084 NO_CDT:
              51   00000000'GF   D0  0395  1085 	MOVL	G^SCS$GL_CDL, R1	; Restore list pointer
                         FC A1   D6  039C  1086 	INCL	CDL$L_NOCDT_CNT(R1)	; Count failures
                  50   21AC 8F   3C  039F  1087 	MOVZWL	#SS$_INSFCDT,R0		; Set error status
                                 05  03A4  1088 	RSB				;  and return to caller
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  26
X-19                            SCS$ALLOC_RSPID                          13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     03A5  1090 	.SBTTL	SCS$ALLOC_RSPID
                                     03A5  1091 ;++
                                     03A5  1092 ;
                                     03A5  1093 ; FUNCTIONAL DESCRIPTION:
                                     03A5  1094 ;
                                     03A5  1095 ;
                                     03A5  1096 ; CALLING SEQUENCE:
                                     03A5  1097 ;
                                     03A5  1098 ;	BSBW	SCS$ALLOC_RSPID
                                     03A5  1099 ;
                                     03A5  1100 ; INPUTS:
                                     03A5  1101 ;
                                     03A5  1102 ;	R5 = Pointer to context block (usually CDRP)
                                     03A5  1103 ;
                                     03A5  1104 ; OUTPUTS:
                                     03A5  1105 ;
                                     03A5  1106 ;	R1 = RSPID
                                     03A5  1107 ;	R2 = Pointer to RDTE
                                     03A5  1108 ;	R0,R3,R4 preserved
                                     03A5  1109 ;
                                     03A5  1110 ;	RSPID stored in CDRP	(* What if not a CDRP input??? *)
                                     03A5  1111 ;
                                     03A5  1112 ; SIDE EFFECTS:
                                     03A5  1113 ;
                                     03A5  1114 ;	If no RSPID available, process is put on wait queue, and control
                                     03A5  1115 ;	returned to caller's caller.
                                     03A5  1116 ;
                                     03A5  1117 ;--
                                     03A5  1118 
                                     03A5  1119 	UNIVERSAL_SYMBOL SCS$ALLOC_RSPID
                                     03A5       SCS$ALLOC_RSPID::
                                     03A5  1120 
                                     03A5  1121 ;SCS$ALLOC_RSPID:
              51   00000000'GF   D0  03A5  1122 	MOVL	G^SCS$GL_RDT, R1	; Pick up list head
                    52   F4 A1   D0  03AC  1123 	MOVL	RDT$L_FREERD(R1), R2	; Find first free one
                            23   13  03B0  1124 	BEQL	10$			; None available
                                     03B2  1125 
                                     03B2  1126 	ASSUME	RD$V_BUSY EQ 0
                      37 04 A2   E8  03B2  1127 	BLBS	RD$W_STATE(R2),90$	; RDTE is free but busy !
                                     03B6  1128 
                    F4 A1   62   D0  03B6  1129 	MOVL	RD$L_LINK(R2), -
                                     03BA  1130 		RDT$L_FREERD(R1)	; Update free list
                  51   52   51   C3  03BA  1131 	SUBL3	R1, R2, R1		; Form offset
                  51   51   0D   78  03BE  1132 	ASHL	#13, R1, R1		; Turn into slot number
                    51   06 A2   B0  03C2  1133 	MOVW	RD$W_SEQNUM(R2), R1	; Insert sequence number
                  51   51   10   9C  03C6  1134 	ROTL	#16, R1, R1		; Reverse to correct order
                    20 A5   51   D0  03CA  1135 	MOVL	R1, CDRP$L_RSPID(R5)	; Store in contex block
                       62   55   D0  03CE  1136 	MOVL	R5, RD$L_CDRP(R2)	; Fill in context block addr
                         04 A2   B6  03D1  1137 	INCW	RD$W_STATE(R2)		; Set state to IN-USE
                                 05  03D4  1138 	RSB
                                     03D5  1139 
                    10 A5   53   7D  03D5  1140 10$:	MOVQ	R3, CDRP$L_FR3(R5)	; Save R3,R4 in context block
                         0C A5 8ED0  03D9  1141 	POPL	CDRP$L_FPC(R5)		; ... and PC
                         FC A1   D6  03DD  1142 	INCL	RDT$L_QRDT_CNT(R1)	; Count stalls
                    EC B1   65   0E  03E0  1143 	INSQUE	CDRP$L_FQFL(R5), -	; Insert this context block
                                     03E4  1144 		@RDT$L_WAITBL(R1)	;   on RDT wait queue
                    50   28 A5   D0  03E4  1145 	MOVL	CDRP$L_RWCPTR(R5), R0	; Pick up any counter
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  27
X-19                            SCS$ALLOC_RSPID                          13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                            02   13  03E8  1146 	BEQL	20$			; None
                            60   B6  03EA  1147 	INCW	(R0)			; Bump the number of resources
                                 05  03EC  1148 20$:	RSB				; Return to caller's caller
                                     03ED  1149 
                                     03ED  1150 90$:	BUG_CHECK  INCONSTATE,FATAL	; Inconsistency
                               FEFF  03ED       		.WORD	^XFEFF
                               0004' 03EF       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_INCONSTATE!4
                                     03F1  1151 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  28
X-19                            SCS$CONFIG_PTH                           13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     03F1  1153 	.SBTTL	SCS$CONFIG_PTH
                                     03F1  1154 ;++
                                     03F1  1155 ;
                                     03F1  1156 ; FUNCTIONAL DESCRIPTION:
                                     03F1  1157 ;
                                     03F1  1158 ;	CONFIG_PTH searches  the  path  blocks  on  all  system
                                     03F1  1159 ;	blocks for one with a matching station address and local
                                     03F1  1160 ;	port name.  If none is found, then error is returned in
                                     03F1  1161 ;	R0.   Otherwise, most of the path block information
                                     03F1  1162 ;	is returned in the caller's output array plus the system
                                     03F1  1163 ;	ID of the remote system on this  path  and  the  station
                                     03F1  1164 ;	address  of  the  next  path  to this remote system.  If
                                     03F1  1165 ;	there are no more paths, the remote station ID  returned
                                     03F1  1166 ;	is -1.
                                     03F1  1167 ;
                                     03F1  1168 ;	A fork process interested in discovering all paths to  a
                                     03F1  1169 ;	particular  system  first  issues  a  CONFIG_SYS call to
                                     03F1  1170 ;	learn the station addr/local port name  of  the 1st  path
                                     03F1  1171 ;	to the system. The fork  process  then  calls  CONFIG_PTH
                                     03F1  1172 ;	repeatedly  until  a  next  station  address  of  -1  is
                                     03F1  1173 ;	returned.
                                     03F1  1174 ;
                                     03F1  1175 ; CALLING SEQUENCE:
                                     03F1  1176 ;
                                     03F1  1177 ;	BSBW	CONFIG_PTH
                                     03F1  1178 ;
                                     03F1  1179 ; INPUTS:
                                     03F1  1180 ;
                                     03F1  1181 ;	R1 = Address of station address followed by local port name:
                                     03F1  1182 ;
                                     03F1  1183 ;	     +--------+--------+--------+--------+
                                     03F1  1184 ;	     |	    Remote station addr, l.o.    |
                                     03F1  1185 ;	     +--------+--------+--------+--------+
                                     03F1  1186 ;	     |    unused       | Rstation, h.o.  |
                                     03F1  1187 ;	     +--------+--------+--------+--------+
                                     03F1  1188 ;	     |     Local port name, e.g., PAA0   |
                                     03F1  1189 ;	     +--------+--------+--------+--------+
                                     03F1  1190 ;
                                     03F1  1191 ;	R2 = Address of output buffer to return path information
                                     03F1  1192 ;		0 if no output desired
                                     03F1  1193 ;
                                     03F1  1194 ; OUTPUTS:
                                     03F1  1195 ;
                                     03F1  1196 ;	R0 = SS$_NOSUCHNODE if failure to find specified path
                                     03F1  1197 ;	   = 1 if success
                                     03F1  1198 ;	R1 = Address of path block found (if R0 = success)
                                     03F1  1199 ;	R2,R3,R4,R5 preserved
                                     03F1  1200 ;
                                     03F1  1201 ;--
                                     03F1  1202 
                                     03F1  1203 ;
                                     03F1  1204 ; Path block and output array adjacency assumptions:
                                     03F1  1205 ;
                                     03F1  1206 
                                     03F1  1207 ASSUME	PB$B_RSTATION+6	  EQ  PB$W_STATE
                                     03F1  1208 ASSUME	PB$W_STATE+2	  EQ  PB$L_RPORT_TYP
                                     03F1  1209 ASSUME	PB$L_RPORT_TYP+4 EQ  PB$L_RPORT_REV
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  29
X-19                            SCS$CONFIG_PTH                           13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     03F1  1210 ASSUME	PB$L_RPORT_REV+4  EQ  PB$L_RPORT_FCN
                                     03F1  1211 ASSUME	PB$L_RPORT_FCN+4  EQ  PB$B_RST_PORT
                                     03F1  1212 ASSUME	PB$B_RST_PORT+1	  EQ  PB$B_RSTATE
                                     03F1  1213 ASSUME	PB$B_RSTATE+1	  EQ  PB$W_RETRY
                                     03F1  1214 ASSUME	PB$W_RETRY+2	  EQ  PB$T_LPORT_NAME
                                     03F1  1215 ASSUME	PB$T_LPORT_NAME+4 EQ  PB$B_CBL_STS
                                     03F1  1216 ASSUME	PB$B_CBL_STS+1	  EQ  PB$B_P0_STS
                                     03F1  1217 ASSUME	PB$B_P0_STS+1	  EQ  PB$B_P1_STS
                                     03F1  1218 
                                     03F1  1219 ASSUME	PBO$B_RSTATION+6  EQ  PBO$W_STATE
                                     03F1  1220 ASSUME	PBO$W_STATE+2	  EQ  PBO$L_RPORT_TYP
                                     03F1  1221 ASSUME	PBO$L_RPORT_TYP+4 EQ  PBO$L_RPORT_REV
                                     03F1  1222 ASSUME	PBO$L_RPORT_REV+4 EQ  PBO$L_RPORT_FCN
                                     03F1  1223 ASSUME	PBO$L_RPORT_FCN+4 EQ  PBO$B_RST_PORT
                                     03F1  1224 ASSUME	PBO$B_RST_PORT+1  EQ  PBO$B_RSTATE
                                     03F1  1225 ASSUME	PBO$B_RSTATE+1	  EQ  PBO$W_RETRY
                                     03F1  1226 ASSUME	PBO$W_RETRY+2	  EQ  PBO$T_LPORT_NAME
                                     03F1  1227 ASSUME	PBO$T_LPORT_NAME+4 EQ PBO$B_CBL_STS
                                     03F1  1228 ASSUME	PBO$B_CBL_STS+1	  EQ  PBO$B_P0_STS
                                     03F1  1229 ASSUME	PBO$B_P0_STS+1	  EQ  PBO$B_P1_STS
                                     03F1  1230 ASSUME	PBO$B_P1_STS+2	  EQ  PBO$B_NXT_RSTAT
                                     03F1  1231 ASSUME	PBO$B_NXT_RSTAT+8 EQ  PBO$T_NXT_LPORT
                                     03F1  1232 ASSUME	PBO$T_NXT_LPORT+4 EQ  PBO$B_SYSTEMID
                                     03F1  1233 
                                     03F1  1234 	UNIVERSAL_SYMBOL SCS$CONFIG_PTH
                                     03F1       SCS$CONFIG_PTH::
                                     03F1  1235 
                                     03F1  1236 ;SCS$CONFIG_PTH:
                            1C   BB  03F1  1237 	PUSHR	#^M<R2,R3,R4>		; Save registers and output buf. ptr.
              50   00000000'GF   DE  03F3  1238 	MOVAL	G^SCS$GQ_CONFIG, R0	; Pick up pointer to database
                       52   50   D0  03FA  1239 	MOVL	R0, R2			; Hold starting point
                       50   60   D0  03FD  1240 10$:	MOVL	(R0), R0		; Get next block in list
                       52   50   D1  0400  1241 	CMPL	R0, R2			; Back where we started (empty) ?
                            61   13  0403  1242 	BEQL	50$			; Yes, leave now
                                     0405  1243 ;
                                     0405  1244 ; Got a system block, now search for a path block
                                     0405  1245 ;
                    53   0C A0   DE  0405  1246 	MOVAL	SB$L_PBFL(R0), R3	; No, have a sys block - find 1st path
                       54   53   D0  0409  1247 	MOVL	R3, R4			; Hold starting point
                       53   63   D0  040C  1248 20$:	MOVL	(R3), R3		; Get next block in list
                       54   53   D1  040F  1249 	CMPL	R3, R4			; Back where we started (empty) ?
                            E9   13  0412  1250 	BEQL	10$			; Yes, try another system
                    0C A3   61   D1  0414  1251 	CMPL	(R1), PB$B_RSTATION(R3)	; No, have a pth - check for ID match
                            F2   12  0418  1252 	BNEQ	20$			; No match on first 32 bits, try again
                 10 A3   04 A1   B1  041A  1253 	CMPW	4(R1), PB$B_RSTATION+4(R3) ; Check high order
                            EB   12  041F  1254 	BNEQ	20$			; No match on next 16 bits, try again
                 24 A3   08 A1   D1  0421  1255 	CMPL	8(R1), PB$T_LPORT_NAME(R3) ; Check local port name
                            E4   12  0426  1256 	BNEQ	20$			; Branch if no match, try again
                                     0428  1257 ;
                                     0428  1258 ; Found a path block whose virtual circuit matches - return the info.
                                     0428  1259 ;
                       52   6E   D0  0428  1260 	MOVL	(SP),R2			; Recover addr to store info
                            34   13  042B  1261 	BEQL	40$			; None, done store anything
                    51   0C A3   DE  042D  1262 	MOVAL	PB$B_RSTATION(R3), R1	; R1 covers info in PB
                       82   81   7D  0431  1263 	MOVQ	(R1)+, (R2)+		; Transfer 8 bytes (RSTATION)
                       82   81   7D  0434  1264 	MOVQ	(R1)+, (R2)+		; Transfer 8 bytes (port type/rev)
                       82   81   7D  0437  1265 	MOVQ	(R1)+, (R2)+		; Transfer 8 bytes (port fcn/state,retries)
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  30
X-19                            SCS$CONFIG_PTH                           13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                       82   61   7D  043A  1266 	MOVQ	(R1), (R2)+		; Transfer 8 bytes (LPORT name/cable sts)
                       82   01   CE  043D  1267 	MNEGL	#1, (R2)+		; Set reserved address to
                       82   01   CE  0440  1268 	MNEGL	#1, (R2)+		; to indicate no next path.
                            82   D4  0443  1269 	CLRL	(R2)+			; Zero out next local port name
                       51   63   D0  0445  1270 	MOVL	(R3), R1		; Get next path block
                       54   51   D1  0448  1271 	CMPL	R1, R4			; Is there a next?
                            0D   13  044B  1272 	BEQL	30$			; No
                 F4 A2   0C A1   7D  044D  1273 	MOVQ	PB$B_RSTATION(R1), -12(R2) ; Yes, transfer its station address
                         FA A2   B4  0452  1274 	CLRW	-6(R2)			; Clear out reserved field
                 FC A2   24 A1   D0  0455  1275 	MOVL	PB$T_LPORT_NAME(R1), -4(R2) ;  and transfer its local port name
                    62   18 A0   7D  045A  1276 30$:	MOVQ	SB$B_SYSTEMID(R0), (R2)	; Transfer associated system ID
                         06 A2   B4  045E  1277 	CLRW	6(R2)			; Clear out reserved field
                       50   01   D0  0461  1278 40$:	MOVL	#1, R0			; Set for success
                            05   11  0464  1279 	BRB	60$			; Clean up
                                     0466  1280 
                  50   028C 8F   3C  0466  1281 50$:	MOVZWL	#SS$_NOSUCHNODE, R0	; Set for failure
                            52 8ED0  046B  1282 60$:	POPL	R2			; Restore R2
                       51   53   D0  046E  1283 	MOVL	R3, R1			; Transfer path block pointer
                       53   8E   7D  0471  1284 	MOVQ	(SP)+, R3		; Restore R3,R4
                                 05  0474  1285 	RSB				; Leave
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  31
X-19                            SCS$CONFIG_SYS                           13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0475  1287 	.SBTTL	SCS$CONFIG_SYS
                                     0475  1288 ;++
                                     0475  1289 ;
                                     0475  1290 ; FUNCTIONAL DESCRIPTION:
                                     0475  1291 ;
                                     0475  1292 ;	CONFIG_SYS searches the list of System Blocks  until  it
                                     0475  1293 ;	finds  one  with  a system ID matching the specified ID.
                                     0475  1294 ;	If no match is found,  error  is  returned.   Otherwise,
                                     0475  1295 ;	most  of  the SB is returned to the caller together with
                                     0475  1296 ;	the ID of the next system in the list.
                                     0475  1297 ;
                                     0475  1298 ;	A fork process interested in finding out about  all  the
                                     0475  1299 ;	systems  in  the  configuration simply issues successive
                                     0475  1300 ;	CONFIG_SYS  calls  on  the  next  system  ID  until  the
                                     0475  1301 ;	returned  next  system ID = 0.  To get information about
                                     0475  1302 ;	the first system, specify system ID of 0.   There  is  a
                                     0475  1303 ;	possibility  that  the configuration will change between
                                     0475  1304 ;	calls unless the entire configuration scan is conducted
                                     0475  1305 ;	at SCS IPL or higher.
                                     0475  1306 ;
                                     0475  1307 ; CALLING SEQUENCE:
                                     0475  1308 ;
                                     0475  1309 ;	BSBW	CONFIG_SYS
                                     0475  1310 ;
                                     0475  1311 ; INPUTS:
                                     0475  1312 ;
                                     0475  1313 ;	R1 = Address of system id to search for
                                     0475  1314 ;	R2 = Address of output buffer to return system information
                                     0475  1315 ;		0 if none desired
                                     0475  1316 ;
                                     0475  1317 ; OUTPUTS:
                                     0475  1318 ;
                                     0475  1319 ;	R0 = SS$_NOSUCHNODE if system id not found
                                     0475  1320 ;	R1 = Address of system block found (if R0 = success)
                                     0475  1321 ;	R2,R3,R4,R5  Preserved
                                     0475  1322 ;
                                     0475  1323 ;--
                                     0475  1324 
                                     0475  1325 ASSUME	SB$B_SYSTEMID+8	  EQ  SB$W_MAXDG
                                     0475  1326 ASSUME	SB$W_MAXDG+2	  EQ  SB$W_MAXMSG
                                     0475  1327 ASSUME	SB$W_MAXMSG+2	  EQ  SB$T_SWTYPE
                                     0475  1328 ASSUME	SB$T_SWTYPE+4	  EQ  SB$T_SWVERS
                                     0475  1329 ASSUME	SB$T_SWVERS+4	  EQ  SB$Q_SWINCARN
                                     0475  1330 ASSUME	SB$Q_SWINCARN+8	  EQ  SB$T_HWTYPE
                                     0475  1331 ASSUME	SB$T_HWTYPE+4	  EQ  SB$B_HWVERS
                                     0475  1332 ASSUME	SB$B_HWVERS+12	  EQ  SB$T_NODENAME
                                     0475  1333 ASSUME	SB$T_NODENAME+16  EQ  SB$L_DDB
                                     0475  1334 
                                     0475  1335 ASSUME	SBO$B_SYSTEMID+8  EQ  SBO$W_MAXDG
                                     0475  1336 ASSUME	SBO$W_MAXDG+2	  EQ  SBO$W_MAXMSG
                                     0475  1337 ASSUME	SBO$W_MAXMSG+2	  EQ  SBO$T_SWTYPE
                                     0475  1338 ASSUME	SBO$T_SWTYPE+4	  EQ  SBO$T_SWVERS
                                     0475  1339 ASSUME	SBO$T_SWVERS+4	  EQ  SBO$Q_SWINCARN
                                     0475  1340 ASSUME	SBO$Q_SWINCARN+8  EQ  SBO$T_HWTYPE
                                     0475  1341 ASSUME	SBO$T_HWTYPE+4	  EQ  SBO$B_HWVERS
                                     0475  1342 ASSUME	SBO$B_HWVERS+12	  EQ  SBO$T_NODENAME
                                     0475  1343 ASSUME	SBO$T_NODENAME+16 EQ  SBO$B_RSTATION1
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  32
X-19                            SCS$CONFIG_SYS                           13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0475  1344 ASSUME	SBO$B_RSTATION1+8  EQ  SBO$T_LPORT1
                                     0475  1345 ASSUME	SBO$T_LPORT1+4	  EQ  SBO$B_NXT_SYSID
                                     0475  1346 
                           0000003C  0475  1347 SB_COPY_LEN = SB$T_NODENAME+16 - SB$B_SYSTEMID
                                     0475  1348 
                                     0475  1349 	UNIVERSAL_SYMBOL SCS$CONFIG_SYS
                                     0475       SCS$CONFIG_SYS::
                                     0475  1350 
                                     0475  1351 ;SCS$CONFIG_SYS:
                            0C   BB  0475  1352 	PUSHR	#^M<R2,R3>		; Save reg. and output buffer ptr.
              50   00000000'GF   DE  0477  1353 	MOVAL	G^SCS$GQ_CONFIG, R0	; Pick up pointer to database
                       52   50   D0  047E  1354 	MOVL	R0, R2			; Hold starting point
                       50   60   D0  0481  1355 10$:	MOVL	(R0), R0		; Get next block in list
                       52   50   D1  0484  1356 	CMPL	R0, R2			; Back where we started (empty) ?
                            5D   13  0487  1357 	BEQL	60$			; Yes, leave now
                            61   D5  0489  1358 	TSTL	(R1)			; Is this possibly the magic 0 value?
                            05   12  048B  1359 	BNEQ	20$			; No, continue
                         04 A1   B5  048D  1360 	TSTW	4(R1)			; Yes, try the high 16 bits
                            0D   13  0490  1361 	BEQL	30$			; Yes, it is 0 - just get the first one
                    18 A0   61   D1  0492  1362 20$:	CMPL	(R1), SB$B_SYSTEMID(R0)	; Nonzero value - check for a match
                            E9   12  0496  1363 	BNEQ	10$			; No match - try again
                 1C A0   04 A1   B1  0498  1364 	CMPW	4(R1), SB$B_SYSTEMID+4(R0) ; Lo 32 bits match - try high 16 bit
                            E2   12  049D  1365 	BNEQ	10$			; No match - try again
                                     049F  1366 ;
                                     049F  1367 ; Found a matching system block - transfer the information
                                     049F  1368 ;
                       53   6E   D0  049F  1369 30$:	MOVL	(SP),R3			; Recover pointer to output array
                            3A   13  04A2  1370 	BEQL	50$			; None, don't bother to transfer
                            35   BB  04A4  1371 	PUSHR	#^M<R0,R2,R4,R5>	; Save registers destroyed in MOVC
                            3C   28  04A6  1372 	MOVC3	#SB_COPY_LEN,-		; Copy data from SYSTEMID in SB
                    63   18 A0       04A8  1373 		SB$B_SYSTEMID(R0),(R3)	;  through nodename to output array
                            35   BA  04AB  1374 	POPR	#^M<R0,R2,R4,R5>	; Restore registers
                       83   01   CE  04AD  1375 	MNEGL	#1,(R3)+		; Set 1st station addr to -1
                       83   01   CE  04B0  1376 	MNEGL	#1,(R3)+		;  in case there is no path on SB
                            83   D4  04B3  1377 	CLRL	(R3)+			; Zero local port name of first path
                    51   0C A0   D0  04B5  1378 	MOVL	SB$L_PBFL(R0), R1	; Get 1st path block
                            12   13  04B9  1379 	BEQL	40$			; None there
                       61   51   D1  04BB  1380 	CMPL	R1, (R1)		; Is there really one?
                            0D   13  04BE  1381 	BEQL	40$			; No, skip on
                 F4 A3   0C A1   7D  04C0  1382 	MOVQ	PB$B_RSTATION(R1), -12(R3) ; Yes, move in station id
                         FA A3   B4  04C5  1383 	CLRW	-6(R3)			; Clear out reserved word
                 FC A3   24 A1   D0  04C8  1384 	MOVL	PB$T_LPORT_NAME(R1),-4(R3) ; Move in local port name
                            63   7C  04CD  1385 40$:	CLRQ	(R3)			; Clear out next system id
                       51   60   D0  04CF  1386 	MOVL	SB$L_FLINK(R0), R1	; Get next system block
                       52   51   D1  04D2  1387 	CMPL	R1, R2			; Is there really one?
                            07   13  04D5  1388 	BEQL	50$			; No, skip on
                    63   18 A1   7D  04D7  1389 	MOVQ	SB$B_SYSTEMID(R1), (R3)	; Yes, move in system id
                         06 A3   B4  04DB  1390 	CLRW	6(R3)			; Clear out reserved word
                       51   50   D0  04DE  1391 50$:	MOVL	R0, R1			; Recover system block address
                       50   01   D0  04E1  1392 	MOVL	#1, R0			; Set success
                            05   11  04E4  1393 	BRB	70$
                                     04E6  1394 
                  50   028C 8F   3C  04E6  1395 60$:	MOVZWL	#SS$_NOSUCHNODE, R0	; Set failure
                       52   8E   7D  04EB  1396 70$:	MOVQ	(SP)+, R2		; Clean stack
                                 05  04EE  1397 	RSB
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  33
X-19                            SCS$CONNECT                              13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     04EF  1399 	.SBTTL	SCS$CONNECT
                                     04EF  1400 ;++
                                     04EF  1401 ;
                                     04EF  1402 ; FUNCTIONAL DESCRIPTION:
                                     04EF  1403 ;
                                     04EF  1404 ; (TYC 14-Feb-89) New parameter LOAD_RATING is added so that SYSAP can
                                     04EF  1405 ; set initial load rating.
                                     04EF  1406 ;
                                     04EF  1407 ; CALLING SEQUENCE:
                                     04EF  1408 ;
                                     04EF  1409 ;	BSBW	SCS$CONNECT
                                     04EF  1410 ;
                                     04EF  1411 ; INPUTS:
                                     04EF  1412 ;
                                     04EF  1413 ;	 0(SP) = Number of parameters			16
                                     04EF  1414 ;	 4(SP) = Input address				MSGADR
                                     04EF  1415 ;	 8(SP) = [Datagram input address]		DGADR
                                     04EF  1416 ;	12(SP) = Error address				ERRADR
                                     04EF  1417 ;	16(SP) = Address of remote system ID		RSYSID
                                     04EF  1418 ;	20(SP) = [Address of remote station addr]	RSTADR
                                     04EF  1419 ;	24(SP) = Address of remote process name		RPRNAM
                                     04EF  1420 ;	28(SP) = Address of local process name		LPRNAM
                                     04EF  1421 ;	32(SP) = Initial credit value			INITCR
                                     04EF  1422 ;	34(SP) = Minimum send credit value		MINSCR
                                     04EF  1423 ;	36(SP) = [Initial datagram credit value]	INITDG
                                     04EF  1424 ;	38(SP) = [Block transfer priority]		BLKPRI
                                     04EF  1425 ;	40(SP) = [Address of connect data]		CONDAT
                                     04EF  1426 ;	44(SP) = [Address of auxilary structure]	AUXSTR
                                     04EF  1427 ;	48(SP) = [Bad response packet address]		BADRSP
                                     04EF  1428 ;	52(SP) = [Move path notification address]       MOVADR
                                     04EF  1429 ;	56(SP) = [Initial load rating]			LOAD_RATING
                                     04EF  1430 ;	60(SP) = Return address
                                     04EF  1431 ;
                                     04EF  1432 ; OUTPUTS:
                                     04EF  1433 ;
                                     04EF  1434 ;	R0 = Status
                                     04EF  1435 ;	R3 = Address of CDT allocated if success
                                     04EF  1436 ;	   = 0 if error status
                                     04EF  1437 ;	R4 = Address of PDT for this station address
                                     04EF  1438 ;	R1,R2 Destroyed
                                     04EF  1439 ;	R5  Preserved
                                     04EF  1440 ;
                                     04EF  1441 ;	CDT fields filled in
                                     04EF  1442 ;
                                     04EF  1443 ;--
                                     04EF  1444 
                                     04EF  1445 	.ENABLE lsb
                                     04EF  1446 	UNIVERSAL_SYMBOL SCS$CONNECT
                                     04EF       SCS$CONNECT::
                                     04EF  1447 
                                     04EF  1448 ;SCS$CONNECT:
                            52   D4  04EF  1449 	CLRL	R2			; Clear for use as a flag
                       0380 8F   BB  04F1  1450 	PUSHR	#^M<R7,R8,R9>		; Save reg.
                    57   1C AE   D0  04F5  1451 	MOVL	28(SP),R7		; Get addr. of RSYSID
                    58   20 AE   D0  04F9  1452 	MOVL	32(SP),R8		; Get addr. of RSTADR
                    59   28 AE   D0  04FD  1453 	MOVL	40(SP),R9		; Get addr. of LPRNAM
                          1EAB   30  0501  1454 	BSBW	SCS_CHK_CDT_REUSE_QUEUE	; (TYC 18-Apr-89) Check CDT REUSE 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  34
X-19                            SCS$CONNECT                              13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0504  1455 					;  queue for a matching CDT  
                       0380 8F   BA  0504  1456 	POPR	#^M<R7,R8,R9>		; Restore reg.
                            53   D5  0508  1457 	TSTL	R3			; Was there a matching CDT for reuse?
                            09   12  050A  1458 	BNEQ	5$			; Yes, don't allocate a new one
                          FDF3   30  050C  1459 	BSBW	SCS$ALLOC_CDT		; Allocate a CDT
                         03 50   E8  050F  1460 	BLBS	R0, 5$			; Okay
                          00C8   31  0512  1461 	BRW	140$			; None, clean up and leave
                                     0515  1462 	;
                                     0515  1463 	;	(TYC 21-Jun-89)
                                     0515  1464 	;	Load sharing version of the code has the number of parameters (16)
                                     0515  1465 	;	stored at the top of the stack.  If this count is not present,
                                     0515  1466 	;	then the SYSAP was assembled against the old SYSMAR.  Just
                                     0515  1467 	;	set the connection load rating to UNEQUAL_PATH and don't look
                                     0515  1468 	;	for a MOVE_PATH parameter.  Also set a flag in CDT to indicate
                                     0515  1469         ;       pre-load sharing version of SYSAP.
                                     0515  1470 	;
                       6E   10   D1  0515  1471 5$:	CMPL	#16,(SP)		; (TYC 21-Jun-89) Load sharing SYSAP?
                            08   12  0518  1472 	BNEQ	6$			; It isn't
                       0157 C3   94  051A  1473         CLRB    CDT$B_SYSAP_VERSION(R3) ; (21-Jun-89) Clear SYSAP version flag
                            8E   D5  051E  1474 	TSTL	(SP)+			; Get rid of count
                            0A   11  0520  1475 	BRB	7$			; and continue
                            07   D0  0522  1476 6$:	MOVL	#CDT$C_UNEQUAL_PATH,-	; (TYC 21-Jun-89) Pre-load sharing SYSAPs 
                       00B0 C3       0524  1477 		CDT$L_LOAD_RATING(R3)	;  must be static.
                            01   90  0527  1478 	MOVB	#CDT$C_PRE_LOADSHARE,-	; (TYC 21-JUN-89) set flag for pre-load sharing
                       0157 C3       0529  1479 		CDT$B_SYSAP_VERSION(R3) ;  version
                                     052C  1480 
                                     052C  1481 	ASSUME	CDT$L_MSGINPUT+4 EQ CDT$L_DGINPUT
                       63   8E   7D  052C  1482 7$:	MOVQ	(SP)+,CDT$L_MSGINPUT(R3); Get both MSGINPUT and DGINPUT
                         0C A3 8ED0  052F  1483 	POPL	CDT$L_ERRADDR(R3)	; Set address of error routine
                                     0533  1484 ;
                                     0533  1485 ;	Register the local process name
                                     0533  1486 ;
                    50   0C AE   D0  0533  1487 	MOVL	12(SP),R0		; Get the address of the local process
                                     0537  1488 					; name
                          09F1   30  0537  1489 	BSBW	SCS_REGISTER_LOCAL_NAME	; Register the name and fill in the
                                     053A  1490 					;  CDT$W_LOCAL_INDEX field
                                     053A  1491 ;
                                     053A  1492 ; (TYC 18-Apr-89) Check the R2 and if non-zero, skip the path block search
                                     053A  1493 ;
                            52   D5  053A  1494 	TSTL	R2			; Are we reusing a CDT?
                            06   13  053C  1495 	BEQL	8$			; No, find a path block
                            8E   D5  053E  1496 	TSTL	(SP)+			; Yes, we already have PB so get
                            8E   D5  0540  1497 	TSTL	(SP)+			; rid of rem system id and station addr
                            48   11  0542  1498 	BRB	100$			
                                     0544  1499 ;
                                     0544  1500 ; Check if remote station/local port specified.  If so, go connect over
                                     0544  1501 ;  that vc.
                                     0544  1502 ;
                                     0544  1503 8$:
                         04 AE   D5  0544  1504 	TSTL	4(SP)			; RSTADR specified?
                            19   12  0547  1505 	BNEQ	70$			; Branch if so
                                     0549  1506 ;
                                     0549  1507 ; Now obtain the remote system id and use it to search the system
                                     0549  1508 ;  blocks for the correct one.  If found, return the PDT for the next 
                                     0549  1509 ;  path block and update that field.
                                     0549  1510 ;
                            51 8ED0  0549  1511 	POPL	R1			; Pick up addr of rem system id
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  35
X-19                            SCS$CONNECT                              13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                            52   D4  054C  1512 	CLRL	R2			; Don't want any info block
                          FF24   30  054E  1513 	BSBW	SCS$CONFIG_SYS		; Get the pointer to system block
                         04 50   E8  0551  1514 	BLBS	R0, 10$			; Found it, continue
                            8E   D5  0554  1515 	TSTL	(SP)+			; Get rid of rem station addr
                            25   11  0556  1516 	BRB	90$			; Clean up stack and leave
                                     0558  1517 ;
                                     0558  1518 ; From the system block pick up the path block. In the case of two paths
                                     0558  1519 ; to a given system, give preference to a CI path.
                                     0558  1520 ;
                            8E   D5  0558  1521 10$:	TSTL	(SP)+			; Remove RSTADR parameter
                          0A46   30  055A  1522 	BSBW	SCS_SELECT_PATH		; Select a new path
                         2C 50   E8  055D  1523 	BLBS	R0,100$			; Branch if success
                            1B   11  0560  1524 	BRB	90$			; Branch on failure
                                     0562  1525 ;
                                     0562  1526 ; Remote station/local port specified, get the exact path.  Check to see 
                                     0562  1527 ; that it is open.
                                     0562  1528 ;
                            8E   D5  0562  1529 70$:	TSTL	(SP)+			; Clear remote system ID parameter
                            51 8ED0  0564  1530 	POPL	R1			; Get addr of remote sta/local port
                            52   D4  0567  1531 	CLRL	R2			; No info to move
                          FE85   30  0569  1532 	BSBW	SCS$CONFIG_PTH		; Find it
                       54   51   D0  056C  1533 	MOVL	R1, R4			; Transfer to correct register	
                         0B 50   E9  056F  1534 	BLBC	R0, 90$			; Error, leave
                    03   12 A4   B1  0572  1535 80$:	CMPW	PB$W_STATE(R4),#PB$C_OPEN ; Is it good?
                            14   13  0576  1536 	BEQL	100$			; Yes
                  50   2094 8F   3C  0578  1537 	MOVZWL	#SS$_UNREACHABLE, R0	; No, no good path
                            01   91  057D  1538 90$:	CMPB	#CDT$C_PRE_LOADSHARE,-	; (TYC 21-JUN-89) Pre-load share format?
                       0157 C3       057F  1539 		CDT$B_SYSAP_VERSION(R3)
                            03   13  0582  1540 	BEQL	95$			; Yes, no move_path_addr argument
                       5E   08   C0  0584  1541 	ADDL	#8,SP			; (TYC 21-Jun-89) Load sharing format, 
                                     0587  1542 					; remove move_path_addr and initial load rating
                          00F5   30  0587  1543 95$:	BSBW	SCS$DEALL_CDT1		; Bad id, get rid of the CDT
                            5D   11  058A  1544 	BRB	150$			; Leave
                 20 A3   0C A4   D0  058C  1545 100$:	MOVL	PB$B_RSTATION(R4), -	; Move in 32 bits of Remote Sta Id
                                     0591  1546 		CDT$B_RSTATION(R3)	;    into the CDT
                 24 A3   10 A4   B0  0591  1547 	MOVW	PB$B_RSTATION+4(R4), -	; Another 16 bits
                                     0596  1548 		CDT$B_RSTATION+4(R3)
                    1C A3   54   D0  0596  1549 	MOVL	R4, CDT$L_PB(R3)	; Store the pointer to Path Block
                    54   2C A4   D0  059A  1550 	MOVL	PB$L_PDT(R4), R4	; Recover PDT entry
                    10 A3   54   D0  059E  1551 	MOVL	R4, CDT$L_PDT(R3)	; Store the PDT
                       51   18   9A  05A2  1552 	MOVZBL	#PDT$L_CONNECT, R1	; Offset in PDT to jump to
                                     05A5  1553 	ASSUME	CDT$L_RPROCNAM+4 EQ CDT$L_LPROCNAM
                    50 A3   8E   7D  05A5  1554 	MOVQ	(SP)+,CDT$L_RPROCNAM(R3); Get both local & remote process names
                                     05A9  1555 ;
                                     05A9  1556 ; Now take care of the credit fields
                                     05A9  1557 ;
                                     05A9  1558 	ASSUME	CDT$W_MINSEND EQ CDT$W_INITLREC+2
                                     05A9  1559 	ASSUME	CDT$W_DGREC EQ CDT$W_MINSEND+2
                                     05A9  1560 	ASSUME	CDT$B_PRIORITY EQ CDT$W_DGREC+2
                    48 A3   8E   7D  05A9  1561 PDT_JMP:MOVQ	(SP)+,CDT$W_INITLREC(R3); Pick up initial rec, min send, dgrec,pro
                         58 A3 8ED0  05AD  1562 	POPL	CDT$L_CONDAT(R3)	; Transfer connection data
                            05   12  05B1  1563 	BNEQ	110$			; Something there
                 58 A3   ED'AF   9E  05B3  1564 	MOVAB	B^BLANK,CDT$L_CONDAT(R3); Else give 'em blanks
                                     05B8  1565 	ASSUME	CDT$L_AUXSTRUC+4 EQ CDT$L_BADRSP
                    5C A3   8E   7D  05B8  1566 110$:	MOVQ	(SP)+,CDT$L_AUXSTRUC(R3); Pick up aux struc addr & bad resp addr
                                     05BC  1567 
                            01   91  05BC  1568 	CMPB	#CDT$C_PRE_LOADSHARE,-	; (TYC 21-JUN-89) Pre-load share format?
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  36
X-19                            SCS$CONNECT                              13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                       0157 C3       05BE  1569 		CDT$B_SYSAP_VERSION(R3)
                            15   13  05C1  1570 	BEQL	112$			; Yes, no move path routine
                       009C C3 8ED0  05C3  1571 	POPL	CDT$L_MOVE_PATH_ADDR(R3); Pick up move path routine
                            09   12  05C8  1572 	BNEQ	111$			; Got one
                            07   D0  05CA  1573 	MOVL	#CDT$C_UNEQUAL_PATH,-	; (TYC 3-JAN-89) This connection is static.
                       00B0 C3       05CC  1574 		CDT$L_LOAD_RATING(R3)
                            8E   D5  05CF  1575 	TSTL	(SP)+			; (TYC 14-FEB-89) get rid of initial load rating
                            05   11  05D1  1576 	BRB	112$
                       00B0 C3 8ED0  05D3  1577 111$:	POPL	CDT$L_LOAD_RATING(R3)	; (TYC 14-FEB-89) get initial load rating
                       51   54   C0  05D8  1578 112$:	ADDL2	R4,R1			; Pick up address from PDT
                            91   17  05DB  1579 	JMP	@(R1)+			; Finish in port dependent code
                                     05DD  1580 
                       6E   10   D1  05DD  1581 140$:	CMPL	#16,(SP)		; (TYC 21-JUN-89) Load sharing format?
                            03   12  05E0  1582 	BNEQ	145$			; No, use old values
                       5E   0C   C0  05E2  1583 	ADDL	#3*4,SP			; (TYC 21-JUN-89) Remove load sharing arguments
                       5E   30   C0  05E5  1584 145$:	ADDL	#12*4,SP		; Remove V5.0 arguments
                                 05  05E8  1585 	RSB
                                     05E9  1586 
                       5E   1C   C0  05E9  1587 150$:	ADDL	#7*4, SP		; Remove additional arguments
                                 05  05EC  1588 	RSB
                                     05ED  1589 
20 20 20 20 20 20 20 20 20 20 20 20  05ED  1590 BLANK:	.ASCII/                /
                        20 20 20 20  05F9       
                                     05FD  1591 	.DISABLE lsb
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  37
X-19                            SCS$DEALL_CDT                            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     05FD  1593 	.SBTTL	SCS$DEALL_CDT
                                     05FD  1594 ;++
                                     05FD  1595 ;
                                     05FD  1596 ; FUNCTIONAL DESCRIPTION:
                                     05FD  1597 ;
                                     05FD  1598 ;
                                     05FD  1599 ; CALLING SEQUENCE:
                                     05FD  1600 ;
                                     05FD  1601 ;	BSBW	SCS$DEALL_CDT
                                     05FD  1602 ;
                                     05FD  1603 ; INPUTS:
                                     05FD  1604 ;
                                     05FD  1605 ;	R3 = Pointer to CDT
                                     05FD  1606 ;
                                     05FD  1607 ; OUTPUTS:
                                     05FD  1608 ;
                                     05FD  1609 ;	R1 trashed
                                     05FD  1610 ;	R3 cleared
                                     05FD  1611 ;	R0,R2,R4,R5  preserved
                                     05FD  1612 ;
                                     05FD  1613 ; COMPLETION CODES:
                                     05FD  1614 ;
                                     05FD  1615 ;	NONE (always succedes)
                                     05FD  1616 ;
                                     05FD  1617 ;--
                                     05FD  1618 
                                     05FD  1619 	UNIVERSAL_SYMBOL SCS$DEALL_CDT
                                     05FD       SCS$DEALL_CDT::
                                     05FD  1620 
                                     05FD  1621 ;SCS$DEALL_CDT:				
                                     05FD  1622 					; Unlink from PB first
                            52   DD  05FD  1623 	PUSHL	R2			; Save a register
                    51   1C A3   D0  05FF  1624 	MOVL	CDT$L_PB(R3), R1	; Pick up Path block
                    51   C8 A1   DE  0603  1625 	MOVAL	PB$L_CDTLST-CDT$L_CDTLST(R1), R1 ; Point to head of list
                    52   6C A1   D0  0607  1626 10$:	MOVL	CDT$L_CDTLST(R1), R2	; Get next block
                            12   13  060B  1627 	BEQL	30$			; There is none	
                       53   52   D1  060D  1628 	CMPL	R2, R3			; Are we next block?
                            05   13  0610  1629 	BEQL	20$			; Yes
                       51   52   D0  0612  1630 	MOVL	R2, R1			; No, shift pointer
                            F0   11  0615  1631 	BRB	10$			; And try again
                                     0617  1632 
                 6C A1   6C A3   D0  0617  1633 20$:	MOVL	CDT$L_CDTLST(R3), -
                                     061C  1634 		CDT$L_CDTLST(R1)	; Put our next link in last block
                         6C A3   D4  061C  1635 	CLRL	CDT$L_CDTLST(R3)	; Clear out link
                            52 8ED0  061F  1636 30$:	POPL	R2			; Restore a register
                                     0622  1637 ;
                                     0622  1638 ; (TYC 21-Mar-89) Dynamic load sharing change --
                                     0622  1639 ; If load sharing flag set in CDT, keep the CDT in REUSE queue
                                     0622  1640 ; after unlinking it from the current path block so that
                                     0622  1641 ; optimal path can be used next time around.
                                     0622  1642 ;
                       00A0 C3   D5  0622  1643 	TSTL	CDT$L_SHARE_FLINK(R3)	; Is this CDT on any queue?
                            0A   13  0626  1644 	BEQL	35$			; No, continue without dequeuing
                            50   DD  0628  1645 	PUSHL	R0			; Save R0
                  50   00A0 C3   0F  062A  1646 	REMQUE	CDT$L_SHARE_FLINK(R3),R0 ; Remove the CDT from the queue 
                            50 8ED0  062F  1647 	POPL	R0			; Restore R0
                  0156 C3   01   91  0632  1648 35$:	CMPB	#1,CDT$B_LS_FLAG(R3)	; Is the flag set?
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  38
X-19                            SCS$DEALL_CDT                            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                            46   12  0637  1649 	BNEQ	40$			; No, return the CDT to pool
                   00000000'GF   D0  0639  1650 	MOVL	G^EXE$GL_ABSTIM,-	; Time stamp this disconnect 
                       00B4 C3       063F  1651 		CDT$L_TIME_STAMP(R3)	
                       00A0 C3   0E  0642  1652 	INSQUE	CDT$L_SHARE_FLINK(R3),- ; Queue to REUSE queue 
                   00000000'GF       0646  1653 		G^SCS$GQ_REUSE_CDT	; 
                   00000000'GF   D0  064B  1654 	MOVL	G^EXE$GL_ABSTIM,-	; Timestamp the queue insertion
                       00B8 C3       0651  1655 		CDT$L_QUEUE_TIME_STAMP(R3)
                       00BC C3   D6  0654  1656 	INCL	CDT$L_DISCON_COUNTER(R3); Increment disconnect counter
                                     0658  1657 
                                     0658  1658 ;
                                     0658  1659 ; (TYC 25-Apr-89) Copy ptr. to local process name in SBNB block
                                     0658  1660 ; since CDT pointer is garbled by SYSAP when connection is disconnected.
                                     0658  1661 ; This section can be taken out in the future if the SCS becomes a
                                     0658  1662 ; separate loadable image.
                                     0658  1663 ;
                            30   BB  0658  1664 	PUSHR	#^M<R4,R5>		; Save some reg.	 
              54   00000000'GF   7E  065A  1665 	MOVAQ	G^SCS$GQ_LOCAL_NAMES,R4	; Get the local name listhead
                       55   54   D0  0661  1666 	MOVL	R4,R5			; Copy for reference
                       55   65   D0  0664  1667 36$:	MOVL	(R5),R5			; Get first/next entry
                       54   55   D1  0667  1668 	CMPL	R5,R4			; End of list?
                            0F   13  066A  1669 	BEQL	38$			; Branch if yes
                       0154 C3   B1  066C  1670 	CMPW	CDT$W_LOCAL_INDEX(R3),-	; Is the index the same?
                         1C A5       0670  1671 		SBNB$W_LOCAL_INDEX(R5)	; 
                            02   13  0672  1672 	BEQL	37$			; If correct SBNB, branch
                            EE   11  0674  1673 	BRB	36$			; Else, get next SBNB block ptr	
                         0C A5   DE  0676  1674 37$:	MOVAL	SBNB$B_PROCNAM(R5),-	; Copy SBNB local name pointer
                         54 A3       0679  1675 		CDT$L_LPROCNAM(R3)	;  to CDT 
                                     067B  1676 
                            30   BA  067B  1677 38$:	POPR	#^M<R4,R5>		; Restore reg.
                                     067D  1678 ;
                            17   11  067D  1679 	BRB	ENDDEALL	
                                     067F  1680 40$:
                                     067F  1681 ;
                                     067F  1682 SCS$DEALL_CDT1:				; Deallocate w/o unlinking
              51   00000000'GF   D0  067F  1683 	MOVL	G^SCS$GL_CDL, R1	; Pick up list head
                    63   F4 A1   D0  0686  1684 	MOVL	CDL$L_FREECDT(R1), -
                                     068A  1685 		CDT$L_LINK(R3)		; Insert in chain
                    F4 A1   53   D0  068A  1686 	MOVL	R3, CDL$L_FREECDT(R1)	; Set this block as first free
                                     068E  1687 	;
                                     068E  1688 	; The following code is repeated for safety's sake to avoid a problem
                                     068E  1689 	;  for direct calls to SCS$DEAL_CDT1
                                     068E  1690 	;
                         1A A3   B6  068E  1691 10$:	INCW	CDT$L_LCONID+2(R3)	; Bump sequence number
                            FB   13  0691  1692 	BEQL	10$			; Zero not allowed
                                     0693  1693 	ASSUME	CDT$W_STATE+2 EQ CDT$W_BLKSTATE
                         28 A3   D4  0693  1694 	CLRL	CDT$W_STATE(R3)		; Set to CLOSED
                                     0696  1695 ENDDEALL:
                            53   D4  0696  1696 	CLRL	R3			; Eliminate any chance of spurious CDT
                                 05  0698  1697 	RSB
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  39
X-19                            SCS$DEALL_RSPID - Dellocate a response i 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0699  1699 	.SBTTL	SCS$DEALL_RSPID - Dellocate a response id
                                     0699  1700 	.SBTTL	SCS$RECYL_RSPID - Recycle a response id
                                     0699  1701 ;++
                                     0699  1702 ;
                                     0699  1703 ; SCS$DEALL_RSPID - Dellocate a response id
                                     0699  1704 ; SCS$RECYL_RSPID - Recycle a response id
                                     0699  1705 ;
                                     0699  1706 ; Functional description:
                                     0699  1707 ;
                                     0699  1708 ;	Check validity of the value in the CDRP$L_RSPID field. Increment
                                     0699  1709 ;	the RDTE sequence number.
                                     0699  1710 ;
                                     0699  1711 ;	For deallocate a response id (SCS$DEALL_RSPID):
                                     0699  1712 ;
                                     0699  1713 ;		Dequeue next waiter for an RDTE and start him up.  If no 
                                     0699  1714 ;		waiter to dequeue, set the RDTE state to unallocated, link 
                                     0699  1715 ;		RDTE as first entry in the free list, and return
                                     0699  1716 ;
                                     0699  1717 ;	For recycle a response id (SCS$RECYL_RSPID):
                                     0699  1718 ;
                                     0699  1719 ;		Update response id in CDRP and return.
                                     0699  1720 ;
                                     0699  1721 ; Calling sequence:
                                     0699  1722 ;
                                     0699  1723 ;	BSBW	SCS$DEALL_RSPID
                                     0699  1724 ;	BSBW	SCS$RECYL_RSPID
                                     0699  1725 ;
                                     0699  1726 ; Inputs:
                                     0699  1727 ;
                                     0699  1728 ;	R5 --> CDRP
                                     0699  1729 ;	SCS$GL_RDT
                                     0699  1730 ;
                                     0699  1731 ; Outputs:
                                     0699  1732 ;
                                     0699  1733 ;	R0,R1,R2  Destroyed; R3,R4,R5  Preserved -- SCS$DEALL_RSPID
                                     0699  1734 ;	R0,R1  Destroyed; R2,R3,R4,R5  Preserved -- SCS$RECYL_RSPID
                                     0699  1735 ;
                                     0699  1736 ;--
                                     0699  1737 
                                     0699  1738 	UNIVERSAL_SYMBOL SCS$RECYL_RSPID
                                     0699       SCS$RECYL_RSPID::
                                     0699  1739 
                                     0699  1740 ;SCS$RECYL_RSPID:
                            7E   D4  0699  1741 	CLRL	-(SP)			; Put SCS$RECYL_RSPID flag on stack.
                                     069B  1742 
                                     069B  1743 	UNIVERSAL_SYMBOL SCS$DEALL_RSPID
                                     069B       SCS$DEALL_RSPID::
                                     069B  1744 
                                     069B  1745 ;SCS$DEALL_RSPID:
                                     069B  1746 
                            55   DD  069B  1747 	PUSHL	R5			; Save CDRP address.
                    55   20 A5   D0  069D  1748 	MOVL	CDRP$L_RSPID(R5), R5	; Get RSPID (if any).
                            4A   13  06A1  1749 	BEQL	90$			; No RSPID, then bugcheck.
                          01A3   30  06A3  1750 	BSBW	SCS$FIND_RDTE		; Locate RDTE for the RSPID.
                         44 50   E9  06A6  1751 	BLBC	R0, 90$			; Branch if error in RSPID.
                       50   55   D0  06A9  1752 	MOVL	R5, R0			; Save RDTE address.
                         06 A0   B6  06AC  1753 5$:	INCW	RD$W_SEQNUM(R0)		; Bump RDTE sequence number.
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  40
X-19                            SCS$RECYL_RSPID - Recycle a response id  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                            FB   13  06AF  1754 	BEQL	5$			; Zero sequence number not allowed.
                         04 AE   D5  06B1  1755 	TSTL	4(SP)			; Was this a SCS$RECYL_RSPID call?
                            3B   13  06B4  1756 	BEQL	50$			; Branch if recycling a response id.
                    55   E8 B1   0F  06B6  1757 	REMQUE	@RDT$L_WAITFL(R1), R5	; Grab any process waiting on RSPIDs.
                            1F   1D  06BA  1758 	BVS	10$			; Branch if no processes waiting.
                                     06BC  1759 ;
                                     06BC  1760 ; There is a stalled process waiting for a RSPID, resume it.
                                     06BC  1761 ;
                       7E   53   7D  06BC  1762 	MOVQ	R3, -(SP)		; Save context registers.
                  52   50   51   C3  06BF  1763 	SUBL3	R1, R0, R2		; Get RDTE offset from RDT base.
                                     06C3  1764 	ASSUME	RD$C_LENGTH EQ 8
                  52   52   0D   78  06C3  1765 	ASHL	#13, R2, R2		; Form index in high order R2.
                    52   06 A0   B0  06C7  1766 	MOVW	RD$W_SEQNUM(R0), R2	; Insert sequence number.
               20 A5   52   10   9C  06CB  1767 	ROTL	#16, R2, CDRP$L_RSPID(R5) ; Form final RSPID and store in CDRP.
                       60   55   D0  06D0  1768 	MOVL	R5, RD$L_CDRP(R0)	; Store his CDRP in the RDTE.
                          0265   30  06D3  1769 	BSBW	SCS$RESUMEWAITR		; Resume the waiter
                       53   8E   7D  06D6  1770 	MOVQ	(SP)+, R3		; Restore saved registers.
                            0B   11  06D9  1771 	BRB	20$			; Join common completion path.
                                     06DB  1772 
                         04 A0   B4  06DB  1773 10$:	CLRW	RD$W_STATE(R0)		; Set state as free.
                    60   F4 A1   D0  06DE  1774 	MOVL	RDT$L_FREERD(R1), -
                                     06E2  1775 		RD$L_LINK(R0)		; Insert RDTE in free RDTE chain.
                    F4 A1   50   D0  06E2  1776 	MOVL	R0, RDT$L_FREERD(R1)	; Make it the first free entry.
                            55 8ED0  06E6  1777 20$:	POPL	R5			; Restore CDRP address.
                         20 A5   D4  06E9  1778 	CLRL	CDRP$L_RSPID(R5)	; Clear out RSPID.
                                 05  06EC  1779 	RSB				; Return from SCS$DEALL_RSPID.
                                     06ED  1780 
                                     06ED  1781 
                                     06ED  1782 90$:	BUG_CHECK  INVRSPID,FATAL	; "Invalid RSPID" bugcheck.
                               FEFF  06ED       		.WORD	^XFEFF
                               0004' 06EF       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_INVRSPID!4
                                     06F1  1783 
                                     06F1  1784 
                                     06F1  1785 					; Complete SCS$RECYL_RSPID call.
                            55 8ED0  06F1  1786 50$:	POPL	R5			; Restore CDRP address.
                 22 A5   06 A0   B0  06F4  1787 	MOVW	RD$W_SEQNUM(R0), -	; Copy new sequence number to
                                     06F9  1788 		CDRP$L_RSPID+2(R5)	; CDRP.
                            8E   D5  06F9  1789 	TSTL	(SP)+			; Pop SCS$RECYL_RSPID call flag.
                                 05  06FB  1790 	RSB				; Return from SCS$RECYL_RSPID.
                                     06FC  1791 	.IF DEFINED SCS$NO_MSCP_POLL
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  41
X-19                            NO_MSCP_LISTN                            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     06FC  1793 	.SBTTL	NO_MSCP_LISTN
                                     06FC  1794 ;++
                                     06FC  1795 ;
                                     06FC  1796 ; FUNCTIONAL DESCRIPTION:
                                     06FC  1797 ;
                                     06FC  1798 ;	This is the SCS message input routine for the dummy MSCP$DISK
                                     06FC  1799 ;	and MSCP$TAPE SYSAP's.  An incoming connect request means that
                                     06FC  1800 ;	there are mixed versions of SCS$NO_MSCP_POLL support in the cluster.
                                     06FC  1801 ;	Simply reject the connection.
                                     06FC  1802 ;
                                     06FC  1803 ; CALLING SEQUENCE:
                                     06FC  1804 ;
                                     06FC  1805 ;	BSBW	NO_MSCP_LISTN
                                     06FC  1806 ;
                                     06FC  1807 ; INPUTS:
                                     06FC  1808 ;
                                     06FC  1809 ;	NONE
                                     06FC  1810 ;
                                     06FC  1811 ; OUTPUTS:
                                     06FC  1812 ;
                                     06FC  1813 ;	NONE
                                     06FC  1814 ;
                                     06FC  1815 ; SIDE EFFECTS:
                                     06FC  1816 ;
                                     06FC  1817 ;	NONE
                                     06FC  1818 ;
                                     06FC  1819 ;--
                                     06FC  1820 
                                     06FC  1821 NO_MSCP_LISTN::
                            50   D4  06FC  1822 	CLRL	R0			; Always reject this request
                                     06FE  1823 	REJECT	#1			; 
                       50   01   D0  06FE       		MOVL	#1, R0
                         4C B4   16  0701       		JSB	@PDT$L_REJECT(R4)
                                 05  0704  1824 	RSB				; 
                                     0705  1825 	.ENDC				; SCS$NO_MSCP_POLL
                                     0705  1826 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  42
X-19                            SCS$DIRECTORY                            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0705  1828 	.SBTTL	SCS$DIRECTORY
                                     0705  1829 ;++
                                     0705  1830 ;
                                     0705  1831 ; FUNCTIONAL DESCRIPTION:
                                     0705  1832 ;
                                     0705  1833 ;
                                     0705  1834 ; CALLING SEQUENCE:
                                     0705  1835 ;
                                     0705  1836 ;	BSBW	SCS$DIRECTORY
                                     0705  1837 ;
                                     0705  1838 ; INPUTS:
                                     0705  1839 ;
                                     0705  1840 ;	NONE
                                     0705  1841 ;
                                     0705  1842 ; OUTPUTS:
                                     0705  1843 ;
                                     0705  1844 ;	NONE
                                     0705  1845 ;
                                     0705  1846 ; SIDE EFFECTS:
                                     0705  1847 ;
                                     0705  1848 ;	NONE
                                     0705  1849 ;
                                     0705  1850 ;--
                                     0705  1851 
                                     0705  1852 SCS$DIRECTORY:
                                     0705  1853 	ACCEPT	MSGADR=B^30$,-
                                     0705  1854 		ERRADR=W^DIRERR,-	; If error, disconnect.
                                     0705  1855 		INITCR=#1,-		; We'll accept anything
                                     0705  1856 		MOVADR=DIR_MOVE,-	; Load sharing move path routine
                                     0705  1857 		LOAD_RATING=#CDT$C_LOAD_SHARE_DISABLE 
                         34'AF   9F  0705       		PUSHAB	B^30016$
                            08   DD  0708       	PUSHL	 #CDT$C_LOAD_SHARE_DISABLE
                   00000E24'EF   9F  070A       		PUSHAB	DIR_MOVE
                            00   DD  0710       		PUSHL	#0
                            00   DD  0712       		PUSHL	#0
                            00   DD  0714       		PUSHL	#0
                       7E   00   9B  0716       		MOVZBW	#0,-(SP)
                       7E   00   B0  0719       		MOVW	#0,-(SP)
                       7E   00   B0  071C       		MOVW	#0,-(SP)
                       7E   01   B0  071F       		MOVW	#1,-(SP)
                       079F'CF   9F  0722       		PUSHAB	W^DIRERR
                            00   DD  0726       		PUSHL	#0
                         3F'AF   9F  0728       		PUSHAB	B^30$
                       7E   0C   D0  072B       		MOVL	#12,-(SP)
                   000002C6'GF   17  072E       		JMP	G^SCS$ACCEPT
                                     0734       30016$:
                                     0734  1858 					; Set load rating to move disabled
                         01 50   E9  0734  1859 	BLBC	R0,10$			; If error, reject
                                 05  0737  1860 	RSB
                                     0738  1861 
                       53   52   D0  0738  1862 10$:	MOVL	R2,R3			; Copy of listening CDT address
                                     073B  1863 	REJECT
                         4C B4   16  073B       		JSB	@PDT$L_REJECT(R4)
                                 05  073E  1864 	RSB
                                     073F  1865 	
                    51   04 A2   9E  073F  1866 30$:	MOVAB	4(R2), R1		; Pick up procname
                       7E   52   7D  0743  1867 	MOVQ	R2,-(SP)		; Save address of message and CDT
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  43
X-19                            SCS$DIRECTORY                            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                          015A   30  0746  1868 	BSBW	SCS$LOCLOOKUP		; Look it up
                       62   50   B0  0749  1869 	MOVW	R0, (R2)		; Set status
                         0C 50   E9  074C  1870 	BLBC	R0,35$			; If LBC, unsuccessful lookup
                    52   14 A2   9E  074F  1871 	MOVAB	<16+4>(R2), R2		; Set to info
                    82   1C A1   7D  0753  1872 	MOVQ	SDIR$B_PROCINF(R1),(R2)+    ; Transfer first 8 bytes
                    62   24 A1   7D  0757  1873 	MOVQ	<SDIR$B_PROCINF+8>(R1),(R2) ; ... and sec 8
                       51   2C   3C  075B  1874 35$:	MOVZWL	#CDRP$C_LENGTH, R1	; Size of block needed
                          01C5   30  075E  1875 	BSBW	SCS_ALONONPAGED		; Allocate it
                         2E 50   E9  0761  1876 	BLBC	R0,40$			; Branch if no pool available
                       55   52   D0  0764  1877 	MOVL	R2, R5			; Transfer address
                       52   8E   7D  0767  1878 	MOVQ	(SP)+, R2		; Restore registers
                    08 A5   51   B0  076A  1879 	MOVW	R1, CDRP$W_CDRPSIZE(R5)	; Set up block
                    0A A5   39   9B  076E  1880 	MOVZBW	#DYN$C_CDRP, -
                                     0772  1881 		CDRP$B_CD_TYPE(R5)	; Set type
                         18 A5   D4  0772  1882 	CLRL	CDRP$L_SAVD_RTN(R5)	; Just to be safe
                    1C A5   52   D0  0775  1883 	MOVL	R2, CDRP$L_MSG_BUF(R5)	; Set address of buffer
                         20 A5   D4  0779  1884 	CLRL	CDRP$L_RSPID(R5)	; Indicate we are turning around
                    24 A5   53   D0  077C  1885 	MOVL	R3, CDRP$L_CDT(R5)	; Set in pointer
                         28 A5   D4  0780  1886 	CLRL	CDRP$L_RWCPTR(R5)	; Just to be safe
                                     0783  1887 	RECYCL_MSG_BUF			; We are going to recycle the buffer
                         48 B4   16  0783       		JSB	@PDT$L_RCLMSGBUF(R4)
                       51   24   9A  0786  1888 	MOVZBL	#36,R1			; Maximum size of message 
                                     0789  1889 	SEND_CNT_MSG_BUF		; Send message and term thread
                         60 B4   16  0789       		JSB	@PDT$L_SNDCNTMSG(R4)
                       50   55   D0  078C  1890 	MOVL	R5, R0			; Set pointer to head of block
                          01A3   31  078F  1891 	BRW	SCS_DEALNONPAGD		; Get rid of the block
                                     0792  1892 
                                     0792  1893 ;
                                     0792  1894 ;  We come here if we could not allocate pool for the CDRP
                                     0792  1895 ;
                       52   8E   7D  0792  1896 40$:	MOVQ	(SP)+,R2		; Pop stack
                                     0795  1897 	DEALLOC_MSG_BUF_REG		; Deallocate message buf
                         24 B4   16  0795       		JSB	@PDT$L_DEALRGMSG(R4)
                                     0798  1898 	DISCONNECT
                   000007E7'GF   16  0798       		JSB	G^SCS$DISCONNECT
                                 05  079E  1899 	RSB
                                     079F  1900 
                                     079F  1901 ;
                                     079F  1902 ;  Clean up if there is an error while responding to a directory message
                                     079F  1903 ;
                                     079F  1904 ;  On entry:
                                     079F  1905 ;	R0 	- error status
                                     079F  1906 ;	R3	- address of CDT
                                     079F  1907 ;	R4	- address of PDT
                                     079F  1908 ;
                                     079F  1909 DIRERR:
                                     079F  1910 	SCAN_MSGBUF_WAIT -		; Find CDRP'S 
                                     079F  1911 	  	ACTION = DIR_CLEANUP
              50   000007B3'EF   9E  079F       		MOVAB	DIR_CLEANUP, R0
                   000009F0'GF   16  07A6       		JSB	G^SCS$LKP_MSGWAIT
                                     07AC  1912 	DISCONNECT			; Break connection
                   000007E7'GF   16  07AC       		JSB	G^SCS$DISCONNECT
                                 05  07B2  1913 	RSB
                                     07B3  1914 
                                     07B3  1915 ;
                                     07B3  1916 ;  For each CDRP which is found, remove it from queue, if needed, deallocate
                                     07B3  1917 ;  associated message buffer, if any, and return CDRP to pool.
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  44
X-19                            SCS$DIRECTORY                            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     07B3  1918 ;
                                     07B3  1919 ;  On entry:
                                     07B3  1920 ;	R3	- address of CDT
                                     07B3  1921 ;	R4	- address of PDT
                                     07B3  1922 ;	R5	- address of CDRP
                                     07B3  1923 ;
                                     07B3  1924 DIR_CLEANUP:
                                     07B3  1925 
                                     07B3  1926 ;
                                     07B3  1927 ;  Remove CDRP from queue, if needed
                                     07B3  1928 ;
                            52   DD  07B3  1929 	PUSHL	R2
                         04 A5   D5  07B5  1930 	TSTL	CDRP$L_FQBL(R5)		; Is there a queue pointer?
                            11   13  07B8  1931 	BEQL	5$			; If EQL, none
                    55   04 B5   D1  07BA  1932 	CMPL	@CDRP$L_FQBL(R5),R5	; Is CDRP in a queue?
                            0B   12  07BE  1933 	BNEQ	5$			; If NEQ, no
                       55   65   0F  07C0  1934 	REMQUE	(R5),R5			; Dequeue CDRP
                    52   28 A5   D0  07C3  1935 	MOVL	CDRP$L_RWCPTR(R5),R2	; Get wait count pointer
                            02   13  07C7  1936 	BEQL	5$			; Branch if none
                            62   B7  07C9  1937 	DECW	(R2)			; Adjust
                                     07CB  1938 
                                     07CB  1939 ;
                                     07CB  1940 ;  Deallocate associated message buffer, if any
                                     07CB  1941 ;
                            52 8ED0  07CB  1942 5$:	POPL	R2			; Restore reg
                         1C A5   D5  07CE  1943 	TSTL	CDRP$L_MSG_BUF(R5)	; Do we have any message buffers?
                            03   13  07D1  1944 	BEQL	10$			; If EQL, no
                                     07D3  1945 	DEALLOC_MSG_BUF			; Get rid of it
                         20 B4   16  07D3       		JSB	@PDT$L_DEALLOMSG(R4)
                                     07D6  1946 
                                     07D6  1947 ;
                                     07D6  1948 ;  Return CDRP to non-paged pool
                                     07D6  1949 ;
                       50   55   D0  07D6  1950 10$:	MOVL	R5,R0			; Address of CDRP in R0
                   00000000'GF   16  07D9  1951 	JSB	G^COM$DRVDEALMEM	; Give back to pool
                                 05  07DF  1952 	RSB				; Cleanup done
                                     07E0  1953 
                                     07E0  1954 ;
                                     07E0  1955 ;  Clean up for errors on the listen
                                     07E0  1956 ;
                                     07E0  1957 LISTENERR:
                                     07E0  1958 	DISCONNECT			; Nothing to clean up -- disconnect
                   000007E7'GF   16  07E0       		JSB	G^SCS$DISCONNECT
                                 05  07E6  1959 	RSB				; Return from error routine.
                                     07E7  1960 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  45
X-19                            SCS$DISCONNECT                           13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     07E7  1962 	.SBTTL	SCS$DISCONNECT
                                     07E7  1963 ;++
                                     07E7  1964 ;
                                     07E7  1965 ; FUNCTIONAL DESCRIPTION:
                                     07E7  1966 ;
                                     07E7  1967 ;
                                     07E7  1968 ; INPUTS:
                                     07E7  1969 ;
                                     07E7  1970 ;	R0 -->  Disconnect reason code
                                     07E7  1971 ;	R3 -->	CDT
                                     07E7  1972 ;	R4 -->	PDT
                                     07E7  1973 ;
                                     07E7  1974 ; IMPLICIT INPUTS:
                                     07E7  1975 ;
                                     07E7  1976 ;	CDT$W_STATE
                                     07E7  1977 ;
                                     07E7  1978 ; OUTPUTS:
                                     07E7  1979 ;
                                     07E7  1980 ;	NONE
                                     07E7  1981 ;
                                     07E7  1982 ; SIDE EFFECTS:
                                     07E7  1983 ;
                                     07E7  1984 ;	If state was LISTEN, then directory entry removed and CDT deallocated.
                                     07E7  1985 ;
                                     07E7  1986 ;--
                                     07E7  1987 
                                     07E7  1988 	UNIVERSAL_SYMBOL SCS$DISCONNECT
                                     07E7       SCS$DISCONNECT::
                                     07E7  1989 
                                     07E7  1990 ;SCS$DISCONNECT:
                                     07E7  1991 	ASSUME	CDT$C_CLOSED EQ 0
                         28 A3   B5  07E7  1992 	TSTW	CDT$W_STATE(R3)		; Is state CLOSED?
                            06   12  07EA  1993 	BNEQ	10$			; No
                  50   06A9 8F   3C  07EC  1994 	MOVZWL	#SS$_ALRDYCLOSED,R0	; Yes, issue qualified success
                                 05  07F1  1995 	RSB
                                     07F2  1996 
                    01   28 A3   B1  07F2  1997 10$:	CMPW	CDT$W_STATE(R3), - 	; Is state LISTEN?
                                     07F6  1998 		#CDT$C_LISTEN
                            03   12  07F6  1999 	BNEQ	20$			; No
                          00FB   31  07F8  2000 	BRW	SCS$REMOVE		; Yes, remove the entry and exit
                                     07FB  2001 
                                     07FB  2002 20$:	
                                     07FB  2003 ;
                                     07FB  2004 ; (TYC 8-may-89) test code ***********
                                     07FB  2005 ; Broadcast disconnect message to OPA0.
                                     07FB  2006 ;
                                     07FB  2007 ;	.if defined EXTRA_CTR		; Conditional assembly code
                                     07FB  2008 ;	JSB	G^SCS$BRO_DISC_MSG	; Go broadcast the message	
                                     07FB  2009 ;
                                     07FB  2010 ; Put disconnect entry into error log file if not DIR_LOOKUP
                                     07FB  2011 ;
                                     07FB  2012 ;	CMPL	#CDT$C_LOAD_SHARE_DISABLE,-
                                     07FB  2013 ;		CDT$L_LOAD_RATING(R3)   ; Is this DIRLOOKUP connection?
                                     07FB  2014 ;	BEQL	45$			; Yes, don't log
                                     07FB  2015 ;	PUSHR	#^M<R0,R1,R2,R5>	; Save regs
                                     07FB  2016 ;	MOVL	#<EMB$C_HD_LENGTH+40>,R1; Set buffer size
                                     07FB  2017 ;	JSB	G^ERL$ALLOCEMB		; Get error log buffer
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  46
X-19                            SCS$DISCONNECT                           13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     07FB  2018 ;	MOVW	#126,EMB$W_HD_ENTRY(R2) ; Connection entry type
                                     07FB  2019 ;	MOVAB	EMB$C_HD_LENGTH(R2),R5	; Start location to move data
                                     07FB  2020 ;	MOVL	CDT$L_PDT(R3),R4	; Get PDT addr
                                     07FB  2021 ;	MOVB	PDT$W_LOAD_CLASS(R4),(R5)+ ; Copy port type (NI/CI)
                                     07FB  2022 ;	MOVB	PDT$B_PORT_NUM(R4),(R5)+; Local port #
                                     07FB  2023 ;	MOVL	CDT$L_PB(R3),R4		; Get PB addr
                                     07FB  2024 ;	MOVB	PB$B_RSTATION(R4),(R5)+ ; Remote port #
                                     07FB  2025 ;	TSTB	CDT$B_LS_FLAG(R3)	; Is disconnect due to load sharing?
                                     07FB  2026 ;	BEQL	30$			; No
                                     07FB  2027 ;	MOVB	#1,(R5)+		; Yes
                                     07FB  2028 ;	BRB	40$
                                     07FB  2029 ;30$:	CLRB	(R5)+			; Normal disconnect
                                     07FB  2030 ;40$:	MOVL	CDT$L_BYTES_XFER_INT(R3),- ; (TYC 31-Aug-89)
                                     07FB  2031 ;		(R5)+			; Copy connection load
                                     07FB  2032 ;	MOVL	CDT$L_LPROCNAM(R3),R0	; Copy local SYSAP name
                                     07FB  2033 ;	MOVQ	(R0)+,(R5)+		; 
                                     07FB  2034 ;	MOVQ	(R0)+,(R5)+		; 
                                     07FB  2035 ;	MOVL	PB$L_SBLINK(R4),R0	; SB addr
                                     07FB  2036 ;	MOVQ	SB$T_NODENAME(R0),(R5)+ ; Copy remote system name
                                     07FB  2037 ;	MOVQ	SB$T_NODENAME+8(R0),(R5)+
                                     07FB  2038 ;
                                     07FB  2039 ;	JSB	G^ERL$RELEASEMB		; Output to error log
                                     07FB  2040 ;	POPR	#^M<R0,R1,R2,R5>
                                     07FB  2041 ;45$:
                                     07FB  2042 ;	.endc
                                     07FB  2043 ;*************************************
                                     07FB  2044 
                    54   10 A3   D0  07FB  2045 	MOVL	CDT$L_PDT(R3),R4	; Pick up the PDT address
                         28 B4   17  07FF  2046 	JMP	@PDT$L_DCONNECT(R4)	; Let port driver handle other states
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  47
X-19                            SCS$ENTER                                13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0802  2048 	.SBTTL	SCS$ENTER
                                     0802  2049 ;++
                                     0802  2050 ;
                                     0802  2051 ; FUNCTIONAL DESCRIPTION:
                                     0802  2052 ;
                                     0802  2053 ;
                                     0802  2054 ; CALLING SEQUENCE:
                                     0802  2055 ;
                                     0802  2056 ;	BSBW	SCS$ENTER
                                     0802  2057 ;
                                     0802  2058 ; INPUTS:
                                     0802  2059 ;
                                     0802  2060 ;	R0 = Address of process name (16 byte string)
                                     0802  2061 ;	R1 = Address of process info (16 byte string)
                                     0802  2062 ;	R2 = CONID
                                     0802  2063 ;
                                     0802  2064 ;	SCS$GQ_DIRECT
                                     0802  2065 ;
                                     0802  2066 ; OUTPUTS:
                                     0802  2067 ;
                                     0802  2068 ;	R0 = SS$_INSFMEM if no pool for directory block
                                     0802  2069 ;	   = SS$_NORMAL if success
                                     0802  2070 ;	R1,R2  destroyed
                                     0802  2071 ;	R3,R4,R5  preserved
                                     0802  2072 ;
                                     0802  2073 ; SIDE EFFECTS:
                                     0802  2074 ;
                                     0802  2075 ;	NONE
                                     0802  2076 ;
                                     0802  2077 ;--
                                     0802  2078 
                                     0802  2079 	UNIVERSAL_SYMBOL SCS$ENTER
                                     0802       SCS$ENTER::
                                     0802  2080 
                                     0802  2081 ;SCS$ENTER:
                            0F   BB  0802  2082 	PUSHR	#^M<R0,R1,R2,R3>	; Save registers and arguments.
                       51   30   D0  0804  2083 	MOVL	#SDIR$C_LENGTH, R1	; Size of a directory entry
                          011C   30  0807  2084 	BSBW	SCS_ALONONPAGED		; Allocate it
                         37 50   E9  080A  2085 	BLBC	R0, 40$			; None, error out
                    53   08 A2   9E  080D  2086 	MOVAB	SDIR$W_SIZE(R2), R3	; Set pointer to size field
                       83   51   B0  0811  2087 	MOVW	R1, (R3)+		; Set size field
                  83   0360 8F   B0  0814  2088 	MOVW	#DYN$C_SCS!<DYN$C_SCS_DIR@8>, (R3)+ ; Size type and subtype
                            51 8ED0  0819  2089 	POPL	R1			; Get pointer to process name
                       83   81   7D  081C  2090 	MOVQ	(R1)+, (R3)+		; Move 8 bytes
                       83   61   7D  081F  2091 	MOVQ	(R1), (R3)+		; Move 8 bytes
                            51 8ED0  0822  2092 	POPL	R1			; Get pointer to process info
                            08   13  0825  2093 	BEQL	10$			; None present
                       83   81   7D  0827  2094 	MOVQ	(R1)+, (R3)+		; Move 8 bytes
                       83   61   7D  082A  2095 	MOVQ	(R1), (R3)+		; Move 8 bytes
                            04   11  082D  2096 	BRB	20$
                                     082F  2097 
                            83   7C  082F  2098 10$:	CLRQ	(R3)+			; Clear it out
                            83   7C  0831  2099 	CLRQ	(R3)+			; Ditto
                            63 8ED0  0833  2100 20$:	POPL	(R3)			; Set in CONID
              53   00000004'GF   D0  0836  2101 	MOVL	G^SCS$GQ_DIRECT+4, R3	; End of queue pointer
                       63   62   0E  083D  2102 	INSQUE	(R2), (R3)		; Insert at end
                            53 8ED0  0840  2103 30$:	POPL	R3			; Restore register
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  48
X-19                            SCS$ENTER                                13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                 05  0843  2104 	RSB
                                     0844  2105 
                       5E   0C   C0  0844  2106 40$:	ADDL	#3*4, SP		; Clean up stack
                            F7   11  0847  2107 	BRB	30$			; ... and out
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  49
X-19                            SCS$FIND_RDTE - Find RDTE for RSPID      13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0849  2109 	.SBTTL	SCS$FIND_RDTE - Find RDTE for RSPID
                                     0849  2110 ;++
                                     0849  2111 ;
                                     0849  2112 ; SCS$FIND_RDTE - Find the RDTE for a given RSPID
                                     0849  2113 ;
                                     0849  2114 ; Functional description:
                                     0849  2115 ;
                                     0849  2116 ;	The RDT ID index is extracted from the given response id, RSPID, and 
                                     0849  2117 ;	validated.  The index is then used to locate the RDTE in the RDT.  A 
                                     0849  2118 ;	sequence number check is then performed and a check is made to insure 
                                     0849  2119 ;	that the RDTE is busy.
                                     0849  2120 ;
                                     0849  2121 ; Inputs:
                                     0849  2122 ;
                                     0849  2123 ;	R5	a response id, RSPID
                                     0849  2124 ;
                                     0849  2125 ;	IPL	IPL$_SCS
                                     0849  2126 ;
                                     0849  2127 ; Outputs:
                                     0849  2128 ;
                                     0849  2129 ;	R0	1 ==> Lookup successful
                                     0849  2130 ;		0 ==> invalid response ID
                                     0849  2131 ;	R1	RDT base address (This is not advertized to SYSAPs but is
                                     0849  2132 ;				 required by SCS$DEALL_RSPID.)
                                     0849  2133 ;	R2-R4	preserved
                                     0849  2134 ;	R5	RDTE address (if R0 = 1)
                                     0849  2135 ;-
                                     0849  2136 
                                     0849  2137 	UNIVERSAL_SYMBOL SCS$FIND_RDTE
                                     0849       SCS$FIND_RDTE::
                                     0849  2138 
                                     0849  2139 ;SCS$FIND_RDTE:
                                     0849  2140 
              51   00000000'GF   D0  0849  2141 	MOVL	G^SCS$GL_RDT, R1	; Get base address of RDT.
                       50   55   3C  0850  2142 	MOVZWL	R5, R0			; Get RDT index from RSPID.
                    F8 A1   50   D1  0853  2143 	CMPL	R0, RDT$L_MAXRDIDX(R1)	; Is index too big?
                            18   1A  0857  2144 	BGTRU	90$			; Branch if too big.
                                     0859  2145 	ASSUME	RD$C_LENGTH EQ 8
                          6140   7F  0859  2146 	PUSHAQ	(R1)[R0]		; Get pointer to RDTE.
                  50   55   10   9C  085C  2147 	ROTL	#16, R5, R0		; Get response id sequence number.
                            55 8ED0  0860  2148 	POPL	R5			; Prepair to return RDTE pointer.
                    50   06 A5   B1  0863  2149 	CMPW	RD$W_SEQNUM(R5), R0	; Do the sequence numbers match?
                            08   12  0867  2150 	BNEQ	90$			; Branch if no match.
                                     0869  2151 	ASSUME	RD$V_BUSY EQ 0
                      04 04 A5   E9  0869  2152 	BLBC	RD$W_STATE(R5), 90$	; Branch if RDTE is not busy.
                       50   01   D0  086D  2153 	MOVL	#1, R0			; Set success status.
                                 05  0870  2154 	RSB				; Return to caller.
                                     0871  2155 
                            50   D4  0871  2156 90$:	CLRL	R0			; Set error status.
                                 05  0873  2157 	RSB				; Return to caller.
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  50
X-19                            SCS$LISTEN                               13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0874  2159 	.SBTTL	SCS$LISTEN
                                     0874  2160 ;++
                                     0874  2161 ;
                                     0874  2162 ; FUNCTIONAL DESCRIPTION:
                                     0874  2163 ;
                                     0874  2164 ;
                                     0874  2165 ; CALLING SEQUENCE:
                                     0874  2166 ;
                                     0874  2167 ;	BSBW	SCS$LISTEN
                                     0874  2168 ;
                                     0874  2169 ; INPUTS:
                                     0874  2170 ;
                                     0874  2171 ;	00(SP) = Address to call with CONNECT_REQ msg		MSGADR
                                     0874  2172 ;	04(SP) = Address to call with error in VC		ERRADR
                                     0874  2173 ;	08(SP) = Address of listening process name		LPRNAM
                                     0874  2174 ;	0C(SP) = Address of listening process information	PRINFO
                                     0874  2175 ;	10(SP) = Return address
                                     0874  2176 ;
                                     0874  2177 ; OUTPUTS:
                                     0874  2178 ;
                                     0874  2179 ;	R0 = SS$_INSFCDT if could not allocate CDT
                                     0874  2180 ;	   = SS$_INSFMEM if could not allocate pool for directory entry
                                     0874  2181 ;	   = SS$_NORMAL if success
                                     0874  2182 ;	R1,R2 destroyed
                                     0874  2183 ;	R3 = Pointer to CDT if success
                                     0874  2184 ;	   = 0 if failure
                                     0874  2185 ;	R4,R5 preserved
                                     0874  2186 ;
                                     0874  2187 ;	CDT$L_INPUT	Address to call process with CONNECT_REQ msgs
                                     0874  2188 ;	CDT$L_LCONID	Local connection id for CDT in R3
                                     0874  2189 ;	CDT$W_STATE	LISTENING
                                     0874  2190 ;
                                     0874  2191 ; SIDE EFFECTS:
                                     0874  2192 ;
                                     0874  2193 ;	Directory entry made if successful, CDT state set to LISTEN
                                     0874  2194 ;
                                     0874  2195 ;--
                                     0874  2196 
                                     0874  2197 	UNIVERSAL_SYMBOL SCS$LISTEN
                                     0874       SCS$LISTEN::
                                     0874  2198 
                                     0874  2199 ;SCS$LISTEN:
                          FA8B   30  0874  2200 	BSBW	SCS$ALLOC_CDT		; Grab a CDT
                         1E 50   E9  0877  2201 	BLBC	R0, 10$			; None, error out
                       52   51   D0  087A  2202 	MOVL	R1, R2			; Shift CONID around
                            63 8ED0  087D  2203 	POPL	CDT$L_MSGINPUT(R3)	; Fill in with address
                         0C A3 8ED0  0880  2204 	POPL	CDT$L_ERRADDR(R3)	; Ditto for errors
                                     0884  2205 ;
                                     0884  2206 ;	(TYC 24-Apr-89) Register the local process name so
                                     0884  2207 ;	that listening CDT also has local process name index
                                     0884  2208 ;	that can be used in other SCS modules.
                                     0884  2209 ;
                       50   6E   D0  0884  2210 	MOVL	(SP),R0			; Get the address of the local process
                                     0887  2211 					; name
                          06A1   30  0887  2212 	BSBW	SCS_REGISTER_LOCAL_NAME	; Register the name and fill in the
                                     088A  2213 					;  CDT$W_LOCAL_INDEX field
                                     088A  2214 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  51
X-19                            SCS$LISTEN                               13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                       50   8E   7D  088A  2215 	MOVQ	(SP)+, R0		; Pick up arguments
                          FF72   30  088D  2216 	BSBW	SCS$ENTER		; Make a directory entry
                         09 50   E9  0890  2217 	BLBC	R0, 20$			; None, error out
                    28 A3   01   B0  0893  2218 	MOVW	#CDT$C_LISTEN, -	; Set state to LISTENing
                                     0897  2219 		CDT$W_STATE(R3)
                                 05  0897  2220 	RSB
                                     0898  2221 
                       5E   10   C0  0898  2222 10$:	ADDL	#4*4, SP		; Clean up arguments
                                 05  089B  2223 	RSB
                                     089C  2224 
                          FDE0   30  089C  2225 20$:	BSBW	SCS$DEALL_CDT1		; Get rid of the CDT
                       5E   0C   C0  089F  2226 	ADDL	#3*4, SP		; Clean up arguments
                                 05  08A2  2227 	RSB
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  52
X-19                            SCS$LOCLOOKUP                            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     08A3  2229 	.SBTTL	SCS$LOCLOOKUP
                                     08A3  2230 ;++
                                     08A3  2231 ;
                                     08A3  2232 ; FUNCTIONAL DESCRIPTION:
                                     08A3  2233 ;
                                     08A3  2234 ;
                                     08A3  2235 ; INPUTS:
                                     08A3  2236 ;
                                     08A3  2237 ;	R1 = Addr of local process name to look up
                                     08A3  2238 ;
                                     08A3  2239 ; OUTPUTS:
                                     08A3  2240 ;
                                     08A3  2241 ;	R0 = SS$_NOSUCHOBJ if listener could not be found
                                     08A3  2242 ;	   = SS$_NORMAL if listener found
                                     08A3  2243 ;	R1 = Addr of entry if found
                                     08A3  2244 ;	R2 = Preserved
                                     08A3  2245 ;	R3 = Addr of listening CDT for local process, if success
                                     08A3  2246 ;	   = 0 if failure
                                     08A3  2247 ;	R4,R5 Preserved
                                     08A3  2248 ;
                                     08A3  2249 ;--
                                     08A3  2250 
                                     08A3  2251 	UNIVERSAL_SYMBOL SCS$LOCLOOKUP
                                     08A3       SCS$LOCLOOKUP::
                                     08A3  2252 
                                     08A3  2253 ;SCS$LOCLOOKUP:
                            55   DD  08A3  2254 	PUSHL	R5			; Save a register
                       55   51   D0  08A5  2255 	MOVL	R1, R5			; Copy addr of proc name
                            54   DD  08A8  2256 	PUSHL	R4			; Save another reg
                            52   DD  08AA  2257 	PUSHL	R2			; ... and another
              54   00000000'GF   DE  08AC  2258 	MOVAL	G^SCS$GQ_DIRECT, R4	; Get head of directory list
                            54   DD  08B3  2259 	PUSHL	R4			; Save a copy
                       54   64   D0  08B5  2260 10$:	MOVL	(R4), R4		; Next entry
                       6E   54   D1  08B8  2261 	CMPL	R4, (SP)		; End of the line?
                            30   13  08BB  2262 	BEQL	30$			; Yes, leave - not found
               0C A4   65   10   29  08BD  2263 	CMPC3	#16, (R5), -
                                     08C2  2264 		SDIR$B_PROCNAM(R4)	; Names match?
                            F1   12  08C2  2265 	BNEQ	10$			; No, try again
                    55   2C A4   D0  08C4  2266 	MOVL	SDIR$L_CONID(R4), R5	; Yes, pick up CONID
                            23   13  08C8  2267 	BEQL	30$			; Zero is error
                       52   55   3C  08CA  2268 	MOVZWL	R5, R2			; Isolate index
              53   00000000'GF   D0  08CD  2269 	MOVL	G^SCS$GL_CDL, R3	; Pick up pointer to CDL
                     53   6342   D0  08D4  2270 	MOVL	(R3)[R2], R3		; Obtain pointer to selected CDT
                    18 A3   55   D1  08D8  2271 	CMPL	R5, CDT$L_LCONID(R3)	; CONID's match?
                            0F   12  08DC  2272 	BNEQ	30$			; No, failure
                       50   01   D0  08DE  2273 	MOVL	#1, R0			; Yes, success
                       51   54   D0  08E1  2274 	MOVL	R4, R1			; Return pointer to entry
                            8E   D5  08E4  2275 20$:	TSTL	(SP)+			; Get rid of temp
                            52 8ED0  08E6  2276 	POPL	R2			; Recover R2
                       54   8E   7D  08E9  2277 	MOVQ	(SP)+,R4		; Restore registers
                                 05  08EC  2278 	RSB
                                     08ED  2279 
                  50   20A4 8F   3C  08ED  2280 30$:	MOVZWL	#SS$_NOSUCHOBJ, R0	; Could not find listener *** TEMP ****
                            53   D4  08F2  2281 	CLRL	R3			; No chance of spurious CDT
                            EE   11  08F4  2282 	BRB	20$			;  and out
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  53
X-19                            SCS$REMOVE                               13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     08F6  2284 	.SBTTL	SCS$REMOVE
                                     08F6  2285 ;++
                                     08F6  2286 ;
                                     08F6  2287 ; FUNCTIONAL DESCRIPTION:
                                     08F6  2288 ;
                                     08F6  2289 ;
                                     08F6  2290 ; CALLING SEQUENCE:
                                     08F6  2291 ;
                                     08F6  2292 ;	BSBW	SCS$REMOVE
                                     08F6  2293 ;
                                     08F6  2294 ; INPUTS:
                                     08F6  2295 ;
                                     08F6  2296 ;	R3 = CDT address
                                     08F6  2297 ;
                                     08F6  2298 ; OUTPUTS:
                                     08F6  2299 ;
                                     08F6  2300 ;	R0 = SS$_NOSUCHOBJ if could not find entry
                                     08F6  2301 ;	   = SS$_NORMAL if successful
                                     08F6  2302 ;	R1,R2 destroyed
                                     08F6  2303 ;	R3 = 0 if successful
                                     08F6  2304 ;	   = CDT if failure
                                     08F6  2305 ;	R4,R5 preserved
                                     08F6  2306 ;
                                     08F6  2307 ; SIDE EFFECTS:
                                     08F6  2308 ;
                                     08F6  2309 ;	Directory entry removed from directory.
                                     08F6  2310 ;
                                     08F6  2311 ;--
                                     08F6  2312 
                                     08F6  2313 	UNIVERSAL_SYMBOL SCS$REMOVE
                                     08F6       SCS$REMOVE::
                                     08F6  2314 
                                     08F6  2315 ;SCS$REMOVE:
                  50   20A4 8F   3C  08F6  2316 	MOVZWL	#SS$_NOSUCHOBJ, R0	; Assume failure
              52   00000000'GF   DE  08FB  2317 	MOVAL	G^SCS$GQ_DIRECT, R2	; Get pointer to directory head
                       51   52   D0  0902  2318 	MOVL	R2, R1			; Copy
                       52   62   D0  0905  2319 10$:	MOVL	(R2), R2		; Get next entry
                       52   51   D1  0908  2320 	CMPL	R1, R2			; End of the line?
                            18   13  090B  2321 	BEQL	20$			; Yes, leave can't find entry
                 2C A2   18 A3   D1  090D  2322 	CMPL	CDT$L_LCONID(R3), -
                                     0912  2323 		SDIR$L_CONID(R2)	; Match CONID?
                            F1   12  0912  2324 	BNEQ	10$			; No, try next one
                       50   62   0F  0914  2325 	REMQUE	(R2), R0		; Yes, remove it
                            53   DD  0917  2326 	PUSHL	R3			; Save CDT addr
                          0019   30  0919  2327 	BSBW	SCS_DEALNONPAGD		; Release the pool space
                            53 8ED0  091C  2328 	POPL	R3			; Restore CDT
                       50   01   D0  091F  2329 	MOVL	#1, R0			; Set for success
                          FD5A   31  0922  2330 	BRW	SCS$DEALL_CDT1		; Get rid of CDT and return
                                     0925  2331 
                                 05  0925  2332 20$:	RSB				; Leave
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  54
X-19                            SCS$REMOVE                               13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0926  2334 ;
                                     0926  2335 ; Misc routines
                                     0926  2336 ;
                                     0926  2337 
                                     0926  2338 SCS_ALONONPAGED:
                   00000000'9F   16  0926  2339 	JSB	@#EXE$ALONONPAGED	; Allocate the pool
                         05 50   E8  092C  2340 	BLBS	R0, 10$			; Skip out if success
                  50   0124 8F   3C  092F  2341 	MOVZWL	#SS$_INSFMEM, R0	; Set a reconizible error code
                                 05  0934  2342 10$:	RSB				; Leave
                                     0935  2343 
                                     0935  2344 SCS_DEALNONPAGD:
                   00000000'9F   17  0935  2345 	JMP	@#COM$DRVDEALMEM	; Deallocated
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  55
X-19                            SCS$RESUMEWAITR                          13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     093B  2347 	.SBTTL	SCS$RESUMEWAITR
                                     093B  2348 ;++
                                     093B  2349 ;
                                     093B  2350 ; FUNCTIONAL DESCRIPTION:
                                     093B  2351 ;
                                     093B  2352 ; 	Global SCS routine to resume a thread that had been
                                     093B  2353 ;	waiting on a resource wait queue.  This routine resumes the thread
                                     093B  2354 ;	and upon return from the thread, if the CDRP associated with the
                                     093B  2355 ;	resumed thread had a RWAITCNT, then we attempt to start any stalled
                                     093B  2356 ;	IRP's that may have been queued to the UCB while we were waiting.
                                     093B  2357 ;
                                     093B  2358 ; INPUTS:
                                     093B  2359 ;
                                     093B  2360 ;	R5 => CDRP of thread to resume
                                     093B  2361 ;
                                     093B  2362 ; OUTPUTS:
                                     093B  2363 ;
                                     093B  2364 ;	Thread resumed and IRP's started up when appropriate.
                                     093B  2365 ;
                                     093B  2366 ;	Note all registers R0 - R5 may be modified.
                                     093B  2367 ;
                                     093B  2368 ;--
                                     093B  2369 
                                     093B  2370 	UNIVERSAL_SYMBOL SCS$RESUMEWAITR
                                     093B       SCS$RESUMEWAITR::
                                     093B  2371 
                                     093B  2372 ;SCS$RESUMEWAITR:			; Here we will start driver thread that
                                     093B  2373 					;  was waiting for resource.
                                     093B  2374 
                                     093B  2375 ;
                                     093B  2376 ; We divide the CDRP thread to be restarted into two classes:  Those which
                                     093B  2377 ;	do NOT have a RWAITCNT and those which do.  The code path for those
                                     093B  2378 ;	without is very simple and appears directly below.  The more complex
                                     093B  2379 ;	case of CDRP's with a RWAITCNT begins at label THREAD_HAS_RWAITCNT.
                                     093B  2380 ;
                                     093B  2381 
                    53   28 A5   D0  093B  2382 	MOVL	CDRP$L_RWCPTR(R5),R3	; R3 => UCB$L_RWAITCNT or R3 = 0.
                            08   12  093F  2383 	BNEQ	THREAD_HAS_RWAITCNT	; NEQ implies R3 => UCB$L_RWAITCNT.
                    53   10 A5   7D  0941  2384 	MOVQ	CDRP$L_FR3(R5),R3	; Restore register context to thread.
                         0C B5   16  0945  2385 	JSB	@CDRP$L_FPC(R5)		; Call back driver thread.
                                 05  0948  2386 	RSB				; Return to caller.
                                     0949  2387 
                                     0949  2388 THREAD_HAS_RWAITCNT:			; Here we have R3 =>  UCB$L_RWAITCNT.
                            63   B7  0949  2389 	DECW	(R3)			; One less CDRP waiting for resources.
                         BC A5   DD  094B  2390 	PUSHL	CDRP$L_UCB(R5)		; Save this CDRP'S UCB address on stack.
                    53   10 A5   7D  094E  2391 	MOVQ	CDRP$L_FR3(R5),R3	; Restore context of waiting IRP.
                         0C B5   16  0952  2392 	JSB	@CDRP$L_FPC(R5)		; Call back driver thread.
                            55 8ED0  0955  2393 	POPL	R5			; R5 => UCB.
                                     0958  2394 
                                     0958  2395 ;
                                     0958  2396 ; Here we have experienced return from a resumed thread that maintains a
                                     0958  2397 ;	UCB$W_RWAITCNT.  Now we see if we can start up any IRP's that may have
                                     0958  2398 ;	backed on this UCB.  These would be new IRP's that had not yet gotten
                                     0958  2399 ;	into STARTIO.
                                     0958  2400 ;
                                     0958  2401 ; NOTE - This entrypoint SCS$UNSTALLUCB may be called independently to
                                     0958  2402 ;	unstall UCB's that may have had non-zero RWAITCNT's for other
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  56
X-19                            SCS$RESUMEWAITR                          13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0958  2403 ;	reasons.
                                     0958  2404 ;
                                     0958  2405 
                                     0958  2406 	UNIVERSAL_SYMBOL SCS$UNSTALLUCB
                                     0958       SCS$UNSTALLUCB::
                                     0958  2407 
                                     0958  2408 ;SCS$UNSTALLUCB:
                         6A A5   B5  0958  2409 10$:	TSTW	UCB$W_RWAITCNT(R5)	; Can we startup backed up IRP's?
                            1A   12  095B  2410 	BNEQ	20$			; NEQ implies NO, so branch around.
                    53   60 B5   0F  095D  2411 	REMQUE	@UCB$L_IOQFL(R5),R3	; Remove 1st (if any) IRP from queue.
                            14   1D  0961  2412 	BVS	20$			; VS implies no backed up IRP's.
                            55   DD  0963  2413 	PUSHL	R5			; Remember UCB address on stack.
                                 AA  0965  2414 	BICW	#UCB$M_CANCEL!-
                                     0966  2415 		 UCB$M_TIMOUT,-
               78 A5   0048 8F       0966  2416 		UCB$W_STS(R5)		; Clear cancel and time out
                                     096B  2417 
                                     096B  2418 	ASSUME	DDT$L_START	EQ	0
                  51   009C D5   D0  096B  2419 	MOVL	@UCB$L_DDT(R5),R1	; R1 => Start_io routine.
                            61   16  0970  2420 	JSB	(R1)			;START I/O OPERATION
                            55 8ED0  0972  2421 	POPL	R5			; Restore R5 => UCB of interest.
                            E1   11  0975  2422 	BRB	10$			; Loop back to start more backed up IRP's.
                                     0977  2423 
                                 05  0977  2424 20$:	RSB
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  57
X-19                            SCS$LKP_RDTCDRP                          13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0978  2426 	.SBTTL	SCS$LKP_RDTCDRP
                                     0978  2427 
                                     0978  2428 ;++
                                     0978  2429 ;
                                     0978  2430 ; FUNCTIONAL DESCRIPTION:
                                     0978  2431 ;
                                     0978  2432 ;	Search RDT for CDRPs with CDT address matching the one in R3
                                     0978  2433 ;	upon entry.  For each CDRP found, call user-supplied action 
                                     0978  2434 ;	routine.
                                     0978  2435 ;
                                     0978  2436 ; CALLING SEQUENCE:
                                     0978  2437 ;
                                     0978  2438 ;	JSB	SCS$LKP_RDTCDRP
                                     0978  2439 ;
                                     0978  2440 ; INPUTS:
                                     0978  2441 ;
                                     0978  2442 ;	R0 -->  Addr of action routine
                                     0978  2443 ;	R3 -->	Addr of CDT
                                     0978  2444 ;
                                     0978  2445 ; OUTPUTS:
                                     0978  2446 ;
                                     0978  2447 ;	R0 -->	status code
                                     0978  2448 ;		success ==> RDT contains no CDRPs with matching CDT
                                     0978  2449 ;		failure ==> RDT contains one or more CDRPs with matching CDT
                                     0978  2450 ;	R1	not altered or preserved by this routine; may be used as a 
                                     0978  2451 ;		communication mechanism between action routine and caller of 
                                     0978  2452 ;		this routine
                                     0978  2453 ;	R2 - R5	preserved
                                     0978  2454 ;
                                     0978  2455 ; ACTION ROUTINE INPUTS:
                                     0978  2456 ;
                                     0978  2457 ;	R1 -->	unchanged from value set by this routine's caller
                                     0978  2458 ;	R3 -->	Addr of CDT
                                     0978  2459 ;	R4 -->	unchanged from value set by this routine's caller
                                     0978  2460 ;	R5 -->	Addr of CDRP
                                     0978  2461 ;
                                     0978  2462 ; ACTION ROUTINE OUTPUTS:
                                     0978  2463 ;
                                     0978  2464 ;	R0	scratch
                                     0978  2465 ;	R1	value to be returned to this routine's caller
                                     0978  2466 ;	R2	scratch
                                     0978  2467 ;	R3	Addr of CDT; MUST be preserved
                                     0978  2468 ;	R4 - R5	scratch
                                     0978  2469 ;
                                     0978  2470 ;	N.B. More likely than not R4 is a PDT address which also must be
                                     0978  2471 ;	preserved.  However, this routine makes no such assumption.
                                     0978  2472 ;
                                     0978  2473 ; STACK USAGE:
                                     0978  2474 ;
                                     0978  2475 ;	This routine manipulates the stack in a rather odd mannor.  Therefore, 
                                     0978  2476 ;	the following map of the stack, as it is at the time of the JSB to the 
                                     0978  2477 ;	action routine, is provided to describe how the stack is used.
                                     0978  2478 ;
                                     0978  2479 ;	!---------------------------------------------------------------!
                                     0978  2480 ;	!			Saved index R0				! :(SP)
                                     0978  2481 ;	!---------------------------------------------------------------!
                                     0978  2482 ;	!		      Saved list base R2			!
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  58
X-19                            SCS$LKP_RDTCDRP                          13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     0978  2483 ;	!---------------------------------------------------------------!
                                     0978  2484 ;	! r0		    Action routine address			!
                                     0978  2485 ;	!---------------------------------------------------------------!
                                     0978  2486 ;	! r1		       "found-one" flag			     R0 !
                                     0978  2487 ;	!---------------------------------------------------------------!
                                     0978  2488 ;	! r2			Saved register 2		     R2 !
                                     0978  2489 ;	!---------------------------------------------------------------!
                                     0978  2490 ;	! r4			Saved register 4		     R4 !
                                     0978  2491 ;	!---------------------------------------------------------------!
                                     0978  2492 ;	! r5			Saved register 5		     R5 !
                                     0978  2493 ;	!---------------------------------------------------------------!
                                     0978  2494 ;	  ^							      ^
                                     0978  2495 ;	  |-as saved by PUSHR			  as restored by POPR-|
                                     0978  2496 ;
                                     0978  2497 ;--
                                     0978  2498 
                                     0978  2499 	UNIVERSAL_SYMBOL SCS$LKP_RDTCDRP
                                     0978       SCS$LKP_RDTCDRP::
                                     0978  2500 
                                     0978  2501 ;SCS$LKP_RDTCDRP:
                            37   BB  0978  2502 	PUSHR	#^M<R0,R1,R2,R4,R5>	; Save registers, make place for saved
                    04 AE   01   D0  097A  2503 	MOVL	#1, 4(SP)		; "found-one" flag, & init. none found.
              50   00000000'9F   3C  097E  2504 	MOVZWL	@#SCS$GW_RDTCNT, R0	; Pick up number of entries.
              52   00000000'GF   D0  0985  2505 	MOVL	G^SCS$GL_RDT, R2	; Pick up pointer to list.
                            52   DD  098C  2506 	PUSHL	R2			; Save that on the stack.
                                     098E  2507 	ASSUME	RD$C_LENGTH EQ 8
                  55   F8 A240   7E  098E  2508 10$:	MOVAQ	B^-8(R2)[R0], R5	; Pick up next entry.
                         04 A5   B5  0993  2509 	TSTW	RD$W_STATE(R5)		; Is it in use?
                            19   13  0996  2510 	BEQL	20$			; No, try another.
                       55   65   D0  0998  2511 	MOVL	RD$L_CDRP(R5), R5	; Pick up CDRP pointer.
                            14   13  099B  2512 	BEQL	20$			; None, try another.
                    53   24 A5   D1  099D  2513 	CMPL	CDRP$L_CDT(R5), R3	; CDT's match?
                            0E   12  09A1  2514 	BNEQ	20$			; No, try some other.
                         08 AE   D4  09A3  2515 	CLRL	8(SP)			; Raise "found-one" flag.
                            50   DD  09A6  2516 	PUSHL	R0			; Save list index.
                         08 BE   16  09A8  2517 	JSB	@8(SP)			; Call action routine.
                            50 8ED0  09AB  2518 	POPL	R0			; Restore list index.
                       52   6E   D0  09AE  2519 	MOVL	(SP), R2		; Restore list base address.
                         DA 50   F5  09B1  2520 20$:	SOBGTR	R0, 10$			; Loop until done.
                    5E   08 AE   9E  09B4  2521 	MOVAB	8(SP), SP		; Cleanup the stack.
                            35   BA  09B8  2522 	POPR	#^M<R0,R2,R4,R5>	; Restore saved "found-one" flag and
                                 05  09BA  2523 	RSB				; other preserved registers.
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  59
X-19                            SCS$LKP_RDTWAIT                          13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     09BB  2525 	.SBTTL	SCS$LKP_RDTWAIT
                                     09BB  2526 
                                     09BB  2527 ;++
                                     09BB  2528 ;
                                     09BB  2529 ; FUNCTIONAL DESCRIPTION:
                                     09BB  2530 ;
                                     09BB  2531 ;	Search RSPID wait queue for next CDRP with CDRP$L_CDT that 
                                     09BB  2532 ;	matches CDT specified in R3.  For each CDRP found, call user-
                                     09BB  2533 ;	supplied action routine.
                                     09BB  2534 ;
                                     09BB  2535 ; CALLING SEQUENCE:
                                     09BB  2536 ;
                                     09BB  2537 ;	JSB	SCS$LKP_RDTWAIT
                                     09BB  2538 ;
                                     09BB  2539 ; INPUTS:
                                     09BB  2540 ;
                                     09BB  2541 ;	R0 -->  Addr of action routine
                                     09BB  2542 ;	R3 -->	Addr of CDT
                                     09BB  2543 ;
                                     09BB  2544 ; OUTPUTS:
                                     09BB  2545 ;
                                     09BB  2546 ;	R0 -->	status code
                                     09BB  2547 ;		success ==> RDT contains no CDRPs with matching CDT
                                     09BB  2548 ;		failure ==> RDT contains one or more CDRPs with matching CDT
                                     09BB  2549 ;	R1	not altered or preserved by this routine; may be used as a 
                                     09BB  2550 ;		communication mechanism between action routine and caller of 
                                     09BB  2551 ;		this routine
                                     09BB  2552 ;	R2 - R5	preserved
                                     09BB  2553 ;
                                     09BB  2554 ; ACTION ROUTINE INPUTS:
                                     09BB  2555 ;
                                     09BB  2556 ;	R1 -->	unchanged from value set by this routine's caller
                                     09BB  2557 ;	R3 -->	Addr of CDT
                                     09BB  2558 ;	R4 -->	unchanged from value set by this routine's caller
                                     09BB  2559 ;	R5 -->	Addr of CDRP
                                     09BB  2560 ;
                                     09BB  2561 ; ACTION ROUTINE OUTPUTS:
                                     09BB  2562 ;
                                     09BB  2563 ;	R0	scratch
                                     09BB  2564 ;	R1	value to be returned to this routine's caller
                                     09BB  2565 ;	R2	scratch
                                     09BB  2566 ;	R3	Addr of CDT; MUST be preserved
                                     09BB  2567 ;	R4 - R5	scratch
                                     09BB  2568 ;
                                     09BB  2569 ;	N.B. More likely than not R4 is a PDT address which also must be
                                     09BB  2570 ;	preserved.  However, this routine makes no such assumption.
                                     09BB  2571 ;
                                     09BB  2572 ;   STACK USAGE:
                                     09BB  2573 ;	This routine manipulates the stack in a rather odd mannor.  Therefore, 
                                     09BB  2574 ;	the following map of the stack, as it is at the time of the JSB to the 
                                     09BB  2575 ;	action routine, is provided to describe how the stack is used.
                                     09BB  2576 ;
                                     09BB  2577 ;	!---------------------------------------------------------------!
                                     09BB  2578 ;	!		  Saved next entry address R5			! :(SP)
                                     09BB  2579 ;	!---------------------------------------------------------------!
                                     09BB  2580 ;	!		   Saved end of list address			!
                                     09BB  2581 ;	!---------------------------------------------------------------!
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  60
X-19                            SCS$LKP_RDTWAIT                          13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     09BB  2582 ;	! r0		    Action routine address			!
                                     09BB  2583 ;	!---------------------------------------------------------------!
                                     09BB  2584 ;	! r1		       "found-one" flag			     R0 !
                                     09BB  2585 ;	!---------------------------------------------------------------!
                                     09BB  2586 ;	! r2			Saved register 2		     R2 !
                                     09BB  2587 ;	!---------------------------------------------------------------!
                                     09BB  2588 ;	! r4			Saved register 4		     R4 !
                                     09BB  2589 ;	!---------------------------------------------------------------!
                                     09BB  2590 ;	! r5			Saved register 5		     R5 !
                                     09BB  2591 ;	!---------------------------------------------------------------!
                                     09BB  2592 ;	  ^							      ^
                                     09BB  2593 ;	  |-as saved by PUSHR			  as restored by POPR-|
                                     09BB  2594 ;
                                     09BB  2595 ;--
                                     09BB  2596 
                                     09BB  2597 	UNIVERSAL_SYMBOL SCS$LKP_RDTWAIT
                                     09BB       SCS$LKP_RDTWAIT::
                                     09BB  2598 
                                     09BB  2599 ;SCS$LKP_RDTWAIT:
                            37   BB  09BB  2600 	PUSHR	#^M<R0,R1,R2,R4,R5>	; Save registers, make place for saved
                    04 AE   01   D0  09BD  2601 	MOVL	#1, 4(SP)		; "found-one" flag, & init. none found.
              55   00000000'GF   D0  09C1  2602 	MOVL	G^SCS$GL_RDT, R5	; Pick up pointer to list.
                    55   E8 A5   DE  09C8  2603 	MOVAL	RDT$L_WAITFL(R5), R5	; Point at wait queue head.
                            55   DD  09CC  2604 	PUSHL	R5			; Save end of queue information.
                       55   65   D0  09CE  2605 30$:	MOVL	(R5), R5		; Pick up next entry.
                       6E   55   D1  09D1  2606 33$:	CMPL	R5, (SP)		; End of queue?
                            13   13  09D4  2607 	BEQL	60$			; Yes, quit.
                    53   24 A5   D1  09D6  2608 	CMPL	CDRP$L_CDT(R5), R3	; CDT's match?
                            F2   12  09DA  2609 	BNEQ	30$			; No, try again.
                         08 AE   D4  09DC  2610 	CLRL	8(SP)			; Raise "found-one" flag.
                            65   DD  09DF  2611 	PUSHL	(R5)			; Save next entry address.
                         08 BE   16  09E1  2612 	JSB	@8(SP)			; Call action routine.
                            55 8ED0  09E4  2613 	POPL	R5			; Restore address of next entry.
                            E8   11  09E7  2614 	BRB	33$			; Since R5 already has the address
                                     09E9  2615 					; of the next entry, skip the queue
                                     09E9  2616 					; traversal step of this loop.
                    5E   08 AE   9E  09E9  2617 60$:	MOVAB	8(SP), SP		; Cleanup the stack.
                            35   BA  09ED  2618 	POPR	#^M<R0,R2,R4,R5>	; Restore saved "found-one" flag and
                                 05  09EF  2619 	RSB				; other preserved registers.
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  61
X-19                            SCS$LKP_MSGWAIT - Scan message wait queu 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     09F0  2621 	.SBTTL	SCS$LKP_MSGWAIT - Scan message wait queues
                                     09F0  2622 
                                     09F0  2623 ;++
                                     09F0  2624 ;
                                     09F0  2625 ; SCS$LKP_MSGWAIT - Scan message wait queues
                                     09F0  2626 ;
                                     09F0  2627 ; Functional description:
                                     09F0  2628 ;
                                     09F0  2629 ;	Search send credit wait and message buffer wait queues for CDRPs with 
                                     09F0  2630 ;	CDRP$L_CDT that matches CDT specified in R3.  For each CDRP found, 
                                     09F0  2631 ;	call user-supplied action routine.
                                     09F0  2632 ;
                                     09F0  2633 ;	This routine completely searches the message buffer wait queue before 
                                     09F0  2634 ;	searching the send credit wait queue.  Both queues are searched front 
                                     09F0  2635 ;	to back.  This is the reverse of the order in which the PADRIVER adds 
                                     09F0  2636 ;	entries to these queues.  This searching stratagy has been choosen to 
                                     09F0  2637 ;	maximize the possibility of locating CDRPs in the order in which the 
                                     09F0  2638 ;	PADRIVER processed them.  This is very important to the connection 
                                     09F0  2639 ;	manager which is trying to assure sequential delivery of specific 
                                     09F0  2640 ;	message types to remote systems.  The lock manager, in turn, depends 
                                     09F0  2641 ;	upon this sequential delivery promise.
                                     09F0  2642 ;
                                     09F0  2643 ;	DO NOT break this attempt at sequential location of CDRPs.  Do not 
                                     09F0  2644 ;	change the ordering of queue insertion (in the PADRIVER or other port 
                                     09F0  2645 ;	drivers used to maintain VAX-to-VAX connections) or the order of queue 
                                     09F0  2646 ;	scanning here.
                                     09F0  2647 ;
                                     09F0  2648 ; Calling sequence:
                                     09F0  2649 ;
                                     09F0  2650 ;	JSB	SCS$LKP_MSGWAIT
                                     09F0  2651 ;
                                     09F0  2652 ; INPUTS:
                                     09F0  2653 ;
                                     09F0  2654 ;	R0 -->  Addr of action routine
                                     09F0  2655 ;	R3 -->	Addr of CDT
                                     09F0  2656 ;	R4 -->  Addr of PDT
                                     09F0  2657 ;
                                     09F0  2658 ; OUTPUTS:
                                     09F0  2659 ;
                                     09F0  2660 ;	R0 -->	status code
                                     09F0  2661 ;		success ==> RDT contains no CDRPs with matching CDT
                                     09F0  2662 ;		failure ==> RDT contains one or more CDRPs with matching CDT
                                     09F0  2663 ;	R1	not altered or preserved by this routine; may be used as a 
                                     09F0  2664 ;		communication mechanism between action routine and caller of 
                                     09F0  2665 ;		this routine
                                     09F0  2666 ;	R2 - R5	preserved
                                     09F0  2667 ;
                                     09F0  2668 ; ACTION ROUTINE INPUTS:
                                     09F0  2669 ;
                                     09F0  2670 ;	R1 -->	unchanged from value set by this routine's caller
                                     09F0  2671 ;	R3 -->	Addr of CDT
                                     09F0  2672 ;	R4 -->	unchanged from value set by this routine's caller
                                     09F0  2673 ;	R5 -->	Addr of CDRP
                                     09F0  2674 ;
                                     09F0  2675 ; ACTION ROUTINE OUTPUTS:
                                     09F0  2676 ;
                                     09F0  2677 ;	R0	scratch
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  62
X-19                            SCS$LKP_MSGWAIT - Scan message wait queu 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                                     09F0  2678 ;	R1	value to be returned to this routine's caller
                                     09F0  2679 ;	R2	scratch
                                     09F0  2680 ;	R3	Addr of CDT; MUST be preserved
                                     09F0  2681 ;	R4 - R5	scratch
                                     09F0  2682 ;
                                     09F0  2683 ;   STACK USAGE:
                                     09F0  2684 ;	This routine manipulates the stack in a rather odd mannor.  Therefore, 
                                     09F0  2685 ;	the following map of the stack, as it is at the time of the JSB to the 
                                     09F0  2686 ;	action routine, is provided to describe how the stack is used.
                                     09F0  2687 ;
                                     09F0  2688 ;	!---------------------------------------------------------------!
                                     09F0  2689 ;	!		  Saved next entry address R5			! :(SP)
                                     09F0  2690 ;	!---------------------------------------------------------------!
                                     09F0  2691 ;	!		   Saved end of list address			!
                                     09F0  2692 ;	!---------------------------------------------------------------!
                                     09F0  2693 ;	! r0		    Action routine address			!
                                     09F0  2694 ;	!---------------------------------------------------------------!
                                     09F0  2695 ;	! r1		       "found-one" flag			     R0 !
                                     09F0  2696 ;	!---------------------------------------------------------------!
                                     09F0  2697 ;	! r2			Saved register 2		     R2 !
                                     09F0  2698 ;	!---------------------------------------------------------------!
                                     09F0  2699 ;	! r4		     Saved register 4 (PDT)		     R4 !
                                     09F0  2700 ;	!---------------------------------------------------------------!
                                     09F0  2701 ;	! r5			Saved register 5		     R5 !
                                     09F0  2702 ;	!---------------------------------------------------------------!
                                     09F0  2703 ;	  ^							      ^
                                     09F0  2704 ;	  |-as saved by PUSHR			  as restored by POPR-|
                                     09F0  2705 ;
                                     09F0  2706 ;--
                                     09F0  2707 
                                     09F0  2708 	UNIVERSAL_SYMBOL SCS$LKP_MSGWAIT
                                     09F0       SCS$LKP_MSGWAIT::
                                     09F0  2709 
                                     09F0  2710 ;SCS$LKP_MSGWAIT:
                            37   BB  09F0  2711 	PUSHR	#^M<R0,R1,R2,R4,R5>	; Save registers, make place for saved
                    04 AE   01   D0  09F2  2712 	MOVL	#1, 4(SP)		; "found-one" flag, & init. none found.
                  55   00B8 C4   DE  09F6  2713 	MOVAL	PDT$L_WAITQFL(R4), R5	; Point at msg. buf. wait queue header.
                            55   DD  09FB  2714 	PUSHL	R5			; Save end of queue information.
                       55   65   D0  09FD  2715 30$:	MOVL	(R5), R5		; Pick up next entry.
                       6E   55   D1  0A00  2716 33$:	CMPL	R5, (SP)		; End of queue?
                            13   13  0A03  2717 	BEQL	60$			; Yes, quit.
                    53   24 A5   D1  0A05  2718 	CMPL	CDRP$L_CDT(R5), R3	; CDT's match?
                            F2   12  0A09  2719 	BNEQ	30$			; No, try again.
                         08 AE   D4  0A0B  2720 	CLRL	8(SP)			; Raise "found-one" flag.
                            65   DD  0A0E  2721 	PUSHL	(R5)			; Save next entry address.
                         08 BE   16  0A10  2722 	JSB	@8(SP)			; Call action routine.
                            55 8ED0  0A13  2723 	POPL	R5			; Restore address of next entry.
                            E8   11  0A16  2724 	BRB	33$			; Since R5 already has the address
                                     0A18  2725 					; of the next entry, skip the queue
                                     0A18  2726 					; traversal step of this loop.
                    55   38 A3   DE  0A18  2727 60$:	MOVAL	CDT$L_CRWAITQFL(R3), R5	; Point at send credit wait queue head.
                       6E   55   D0  0A1C  2728 	MOVL	R5, (SP)		; Save end of queue information.
                       55   65   D0  0A1F  2729 80$:	MOVL	(R5), R5		; Pick up next entry.
                       6E   55   D1  0A22  2730 83$:	CMPL	R5, (SP)		; End of queue?
                            13   13  0A25  2731 	BEQL	100$			; Yes, quit.
                    53   24 A5   D1  0A27  2732 	CMPL	CDRP$L_CDT(R5), R3	; CDT's match?
                            F2   12  0A2B  2733 	BNEQ	80$			; No, try again.
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  63
X-19                            SCS$LKP_MSGWAIT - Scan message wait queu 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (1)

                         08 AE   D4  0A2D  2734 	CLRL	8(SP)			; Raise "found-one" flag.
                            65   DD  0A30  2735 	PUSHL	(R5)			; Save next entry address.
                         08 BE   16  0A32  2736 	JSB	@8(SP)			; Call action routine.
                            55 8ED0  0A35  2737 	POPL	R5			; Restore address of next entry.
                            E8   11  0A38  2738 	BRB	83$			; Since R5 already has the address
                                     0A3A  2739 					; of the next entry, skip the queue
                                     0A3A  2740 					; traversal step of this loop.
                                     0A3A  2741 
                    5E   08 AE   9E  0A3A  2742 100$:	MOVAB	8(SP), SP		; Cleanup the stack.
                            35   BA  0A3E  2743 	POPR	#^M<R0,R2,R4,R5>	; Restore saved "found-one" flag and
                                 05  0A40  2744 	RSB				; other preserved registers.
                                     0A41  2745 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  64
X-19                            SCS$NEW_SB - New/Reused System Block Ava 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (2)

                                     0A41  2747 	.SBTTL	SCS$NEW_SB - New/Reused System Block Available for Polling
                                     0A41  2748 
                                     0A41  2749 ;++
                                     0A41  2750 ;
                                     0A41  2751 ; FUNCTIONAL DESCRIPTION:
                                     0A41  2752 ;
                                     0A41  2753 ;	This routine is called whenever SCS builds a new system block
                                     0A41  2754 ;	(SB) or reuses an existing SB with a new software incarnation
                                     0A41  2755 ;	number.  This routine initializes the poller fields in the
                                     0A41  2756 ;	system block.
                                     0A41  2757 ;
                                     0A41  2758 ; CALLING SEQUENCE:
                                     0A41  2759 ;
                                     0A41  2760 ;	JSB	SCS$NEW_SB
                                     0A41  2761 ;	IPL must be at IPL$_SCS, IPL$_TIMER
                                     0A41  2762 ;
                                     0A41  2763 ; INPUT PARAMETERS:
                                     0A41  2764 ;
                                     0A41  2765 ;	R2 contains the address of the system block of the new system.
                                     0A41  2766 ;
                                     0A41  2767 ; OUTPUT PARAMETERS:
                                     0A41  2768 ;
                                     0A41  2769 ;	NONE
                                     0A41  2770 ;
                                     0A41  2771 ; COMPLETION CODES:
                                     0A41  2772 ;
                                     0A41  2773 ;	NONE
                                     0A41  2774 ;
                                     0A41  2775 ; SIDE EFFECTS:
                                     0A41  2776 ;
                                     0A41  2777 ;	R0 and R1 are destroyed
                                     0A41  2778 ;
                                     0A41  2779 ;--
                                     0A41  2780 
                                     0A41  2781 ; Use of SB$W_TIMEOUT:
                                     0A41  2782 ;
                                     0A41  2783 ;	SB$W_TIMEOUT indicates that state of polling on a particular node
                                     0A41  2784 ;
                                     0A41  2785 ;		>0  : Seconds remaining until polling is triggered
                                     0A41  2786 ;		=0  : Ready to be polled
                                     0A41  2787 ;		-1  : Polling in progress, reset timer on completion
                                     0A41  2788 ;		-2  : Polling in progress, set to 0 on completion to repoll
                                     0A41  2789 ;
                                     0A41  2790 ; Use of SB$B_ENBMSK:
                                     0A41  2791 ;
                                     0A41  2792 ;	Each process name to be polled is assigned a bit in the SB$B_ENBMSK
                                     0A41  2793 ;	array.  If the bit is set, then polling for the process name is
                                     0A41  2794 ;	enabled; if the bit is clear, polling for the name is disabled.
                                     0A41  2795 ;	This allows system by system control over which processes are
                                     0A41  2796 ;	polled.
                                     0A41  2797 ;
                                     0A41  2798 
                                     0A41  2799 	UNIVERSAL_SYMBOL SCS$NEW_SB
                                     0A41       SCS$NEW_SB::
                                     0A41  2800 
                                     0A41  2801 ;SCS$NEW_SB:
                            3C   BB  0A41  2802 	PUSHR	#^M<R2,R3,R4,R5>	; Save registers
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  65
X-19                            SCS$NEW_SB - New/Reused System Block Ava 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (2)

                         58 A2   B4  0A43  2803 	CLRW	SB$W_TIMEOUT(R2)	; Trigger for immediate polling
              00000000'EF   02   28  0A46  2804 	MOVC3	#SB$S_ENBMSK, -		; Initialize polling mask
                         5A A2       0A4D  2805 		SCS$GA_DFLTMSK, -
                                     0A4F  2806 		SB$B_ENBMSK(R2)
                            3C   BA  0A4F  2807 	POPR	#^M<R2,R3,R4,R5>	; Restore registers
                                 05  0A51  2808 	RSB
                                     0A52  2809 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  66
X-19                            SCS$POLL_PROC - Declare a process name t 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (3)

                                     0A52  2811 	.SBTTL	SCS$POLL_PROC - Declare a process name to the poller
                                     0A52  2812 
                                     0A52  2813 ;++
                                     0A52  2814 ;
                                     0A52  2815 ; FUNCTIONAL DESCRIPTION:
                                     0A52  2816 ;
                                     0A52  2817 ;	This routine is called to declare a process to be polled.
                                     0A52  2818 ;	The routine builds a Poller Process block and links it.
                                     0A52  2819 ;	An unused bit is allocated and assigned to this process.
                                     0A52  2820 ;
                                     0A52  2821 ;	Polling for the process is NOT enabled.
                                     0A52  2822 ;
                                     0A52  2823 ;	Note: Things could be simplified by omitting this routine
                                     0A52  2824 ;	and wiring the necessary (and short) list of processes to
                                     0A52  2825 ;	be polled into this module.
                                     0A52  2826 ;
                                     0A52  2827 ; CALLING SEQUENCE:
                                     0A52  2828 ;
                                     0A52  2829 ;	JSB	SCS$POLL_PROC
                                     0A52  2830 ;	IPL must be at IPL$_SCS, IPL$_TIMER
                                     0A52  2831 ;
                                     0A52  2832 ; INPUT PARAMETERS:
                                     0A52  2833 ;
                                     0A52  2834 ;	R0 contains the address of the notification routine
                                     0A52  2835 ;	R1 contains the context to be passed to the notification routine
                                     0A52  2836 ;	R2 contains the address of the process name
                                     0A52  2837 ;
                                     0A52  2838 ; OUTPUT PARAMETERS:
                                     0A52  2839 ;
                                     0A52  2840 ;	R1 contains address of the SPPB (to be used as context to other calls)
                                     0A52  2841 ;
                                     0A52  2842 ; COMPLETION CODES:
                                     0A52  2843 ;
                                     0A52  2844 ;	R0 contains status
                                     0A52  2845 ;
                                     0A52  2846 ; SIDE EFFECTS:
                                     0A52  2847 ;
                                     0A52  2848 ;	R0 is destroyed
                                     0A52  2849 ;	New data structures are built
                                     0A52  2850 ;
                                     0A52  2851 ;--
                                     0A52  2852 
                                     0A52  2853 	UNIVERSAL_SYMBOL SCS$POLL_PROC
                                     0A52       SCS$POLL_PROC::
                                     0A52  2854 
                                     0A52  2855 ;SCS$POLL_PROC:
                            3F   BB  0A52  2856 	PUSHR 	#^M<R0,R1,R2,R3,R4,R5>	; Save registers
                                     0A54  2857 	;
                                     0A54  2858    	; If an identical polling request already exists, simply
                                     0A54  2859 	; disable polling for all systems and return.
                                     0A54  2860 	;
              54   00000000'GF   7E  0A54  2861 	MOVAQ	G^SCS$GQ_POLL,R4	; List head address
                       55   54   D0  0A5B  2862 	MOVL	R4,R5			; Copy it
                       55   65   D0  0A5E  2863 5$:	MOVL	(R5),R5			; Get next entry
                       55   54   D1  0A61  2864 	CMPL	R4,R5			; End of list?
                            24   13  0A64  2865  	BEQL	8$			; Yes 
                    1C A5   6E   D1  0A66  2866 	CMPL	(SP),SPPB$L_RTN(R5) 	; Same notification routine?
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  67
X-19                            SCS$POLL_PROC - Declare a process name t 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (3)

                            F2   12  0A6A  2867 	BNEQ	5$			; No
                 20 A5   04 AE   D1  0A6C  2868 	CMPL	4(SP),SPPB$L_CTX(R5)	; Same context?
                            EB   12  0A71  2869 	BNEQ	5$			; No
            0C A5   08 BE   10   29  0A73  2870 	CMPC3	#SPPB$S_PROCNAM, -	; Same process name?
                                     0A79  2871 		@8(SP),SPPB$B_PROCNAM(R5)
                            E3   12  0A79  2872 	BNEQ	5$			; No
                    04 AE   55   D0  0A7B  2873 	MOVL	R5,4(SP)		; Store SPPB address for the return
                       51   55   D0  0A7F  2874 	MOVL	R5,R1			; Copy address of SPPB   
                            50   D4  0A82  2875 	CLRL	R0			; Disable polling
                            52   D4  0A84  2876 	CLRL	R2			;  for all systems
                            48   10  0A86  2877 	BSBB	SCS$POLL_MODE		; Turn off the polling
                            41   11  0A88  2878 	BRB	30$			; Common exit
                                     0A8A  2879 	;
                                     0A8A  2880 	; Process a new polling request
                                     0A8A  2881 	;
              55   00000002'EF   3E  0A8A  2882 8$:	MOVAW	SCS$GW_NEXTBIT,R5	; Address of next bit to allocate
                       10   65   B1  0A91  2883 	CMPW	(R5),#SB$S_ENBMSK*8	; Any bits left?
                            33   18  0A94  2884 	BGEQ	20$			; Branch if all bits used
                       51   28   3C  0A96  2885 	MOVZWL	#SPPB$K_LENGTH,R1	; Size of a SPPB
                          FE8A   30  0A99  2886 	BSBW	SCS_ALONONPAGED		; Allocate a SPPB
                         2C 50   E9  0A9C  2887 	BLBC	R0,30$			; Exit on error
                    08 A2   51   B0  0A9F  2888 	MOVW	R1,SPPB$W_SIZE(R2)	; Store size
                                     0AA3  2889 	ASSUME	SPPB$B_SUBTYP,EQ,SPPB$B_TYPE+1
               0A A2   0860 8F   B0  0AA3  2890 	MOVW	#DYN$C_SCS! -		; Store type and subtype
                                     0AA9  2891 		<DYN$C_SCS_SPPB@8>, -
                                     0AA9  2892 		SPPB$B_TYPE(R2)
                                     0AA9  2893 	ASSUME	SPPB$L_RTN+4,EQ,SPPB$L_CTX
                    1C A2   8E   7D  0AA9  2894 	MOVQ	(SP)+,SPPB$L_RTN(R2)	; Store routine address and context
                    24 A2   65   B0  0AAD  2895 	MOVW	(R5),SPPB$W_BIT(R2)	; Store allocated mask bit
                            65   B6  0AB1  2896 	INCW	(R5)			; Mark bit used
                            52   DD  0AB3  2897 	PUSHL	R2			; Save SPPB address
            0C A2   04 BE   10   28  0AB5  2898 	MOVC3	#SPPB$S_PROCNAM, -	; Store process name
                                     0ABB  2899 		@4(SP),SPPB$B_PROCNAM(R2)
           00000000'GF   00 BE   0E  0ABB  2900 	INSQUE	@(SP),G^SCS$GQ_POLL	; Link into head of list of SPPB's
                       50   01   D0  0AC3  2901 	MOVL	S^#SS$_NORMAL,R0	; Success
                            3E   BA  0AC6  2902 10$:	POPR	#^M<R1,R2,R3,R4,R5>
                                 05  0AC8  2903 	RSB
                            50   D4  0AC9  2904 20$:	CLRL	R0			; Set failure return
                       5E   04   C0  0ACB  2905 30$:	ADDL2	#4,SP			; Balance stack with main path
                            F6   11  0ACE  2906 	BRB	10$
                                     0AD0  2907 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  68
X-19                            SCS$POLL_MODE - Enable/Disable polling f 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (4)

                                     0AD0  2909 	.SBTTL	SCS$POLL_MODE - Enable/Disable polling for a process
                                     0AD0  2910 
                                     0AD0  2911 ;++
                                     0AD0  2912 ;
                                     0AD0  2913 ; FUNCTIONAL DESCRIPTION:
                                     0AD0  2914 ;
                                     0AD0  2915 ;	This routine enable or disable polling for a process on
                                     0AD0  2916 ;	either a specified system or a global basis.  If polling
                                     0AD0  2917 ;	is enabled on any existing system, a poll is requested.
                                     0AD0  2918 ;
                                     0AD0  2919 ; CALLING SEQUENCE:
                                     0AD0  2920 ;
                                     0AD0  2921 ;	JSB	SCS$POLL_MODE
                                     0AD0  2922 ;	IPL must be at IPL$_SCS, IPL$_TIMER
                                     0AD0  2923 ;
                                     0AD0  2924 ; INPUT PARAMETERS:
                                     0AD0  2925 ;
                                     0AD0  2926 ;	R0 contains 0 to disable or 1 to enable polling
                                     0AD0  2927 ;	R1 contains the address of the SPPB block
                                     0AD0  2928 ;	R2 contains the address of the System ID or 0 (for global)
                                     0AD0  2929 ;
                                     0AD0  2930 ; OUTPUT PARAMETERS:
                                     0AD0  2931 ;
                                     0AD0  2932 ;	NONE
                                     0AD0  2933 ;
                                     0AD0  2934 ; COMPLETION CODES:
                                     0AD0  2935 ;
                                     0AD0  2936 ;	R0 contains status
                                     0AD0  2937 ;
                                     0AD0  2938 ; SIDE EFFECTS:
                                     0AD0  2939 ;
                                     0AD0  2940 ;	All registers preserved
                                     0AD0  2941 ;
                                     0AD0  2942 ;--
                                     0AD0  2943 
                                     0AD0  2944 	UNIVERSAL_SYMBOL SCS$POLL_MODE
                                     0AD0       SCS$POLL_MODE::
                                     0AD0  2945 
                                     0AD0  2946 ;SCS$POLL_MODE:
                            3E   BB  0AD0  2947 	PUSHR	#^M<R1,R2,R3,R4,R5>
                       53   50   D0  0AD2  2948 	MOVL	R0,R3			; Set/clear flag
                    54   24 A1   3C  0AD5  2949 	MOVZWL	SPPB$W_BIT(R1),R4	; Process' bit number
                            52   D5  0AD9  2950 	TSTL	R2			; Is system name specified?
                            1F   12  0ADB  2951 	BNEQ	20$			; Branch if yes
    00000000'EF   01   54   53   F0  0ADD  2952 	INSV	R3,R4,#1, -		; Set bit in default mask
                                     0AE6  2953 		SCS$GA_DFLTMSK
              50   00000000'GF   DE  0AE6  2954 	MOVAL	G^SCS$GQ_CONFIG,R0	; Address of SB listhead
                       51   60   D0  0AED  2955 	MOVL	(R0),R1			; Address of first SB
                       50   51   D1  0AF0  2956 10$:	CMPL	R1,R0			; End of list?
                            14   13  0AF3  2957 	BEQL	30$			; Branch if done
                            18   10  0AF5  2958 	BSBB	100$			; Handle a system
                       51   61   D0  0AF7  2959 	MOVL	SB$L_FLINK(R1),R1	; Link to next SB
                            F4   11  0AFA  2960 	BRB	10$			; Iterate
                                     0AFC  2961 
                       51   52   D0  0AFC  2962 20$:	MOVL	R2,R1			; Address of system ID
                            52   D4  0AFF  2963 	CLRL	R2			; No output buffer
                          F971   30  0B01  2964 	BSBW	SCS$CONFIG_SYS		; Lookup system ID
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  69
X-19                            SCS$POLL_MODE - Enable/Disable polling f 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (4)

                         05 50   E9  0B04  2965 	BLBC	R0,40$			; Branch if System ID not found
                            06   10  0B07  2966 	BSBB	100$			; Enable/disable polling
                       50   01   D0  0B09  2967 30$:	MOVL	S^#SS$_NORMAL,R0	; Success
                            3E   BA  0B0C  2968 40$:	POPR	#^M<R1,R2,R3,R4,R5>
                                 05  0B0E  2969 	RSB
                                     0B0F  2970 
                                     0B0F  2971 ;
                                     0B0F  2972 ; R3 is set/clear flag
                                     0B0F  2973 ; R4 is bit number
                                     0B0F  2974 ; R1 is address of the SB
                                     0B0F  2975 ;
                         13 53   E9  0B0F  2976 100$:	BLBC	R3,120$			; Branch to disable polling
                 13 5A A1   54   E2  0B12  2977 	BBSS	R4,SB$B_ENBMSK(R1),130$	; Branch if already enabled
                         58 A1   B5  0B17  2978 	TSTW	SB$W_TIMEOUT(R1)	; Check timeout
                            04   19  0B1A  2979 	BLSS	110$			; Branch if in progress to retrigger
                         58 A1   B4  0B1C  2980 	CLRW	SB$W_TIMEOUT(R1)	; Set to 0 to trigger polling
                                 05  0B1F  2981 	RSB				; Return
                    58 A1   02   AE  0B20  2982 110$:	MNEGW	#2,SB$W_TIMEOUT(R1)	; Polling in progress, retrigger
                                 05  0B24  2983 	RSB
                 00 5A A1   54   E5  0B25  2984 120$:	BBCC	R4,SB$B_ENBMSK(R1),130$	; Disable polling
                                 05  0B2A  2985 130$:	RSB				; Return
                                     0B2B  2986 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  70
X-19                            START_POLL - Start poll of requested pro 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (5)

                                     0B2B  2988 	.SBTTL	START_POLL - Start poll of requested processes
                                     0B2B  2989 
                                     0B2B  2990 ;++
                                     0B2B  2991 ;
                                     0B2B  2992 ; FUNCTIONAL DESCRIPTION:
                                     0B2B  2993 ;
                                     0B2B  2994 ;	This routine is called as a result of a timeout.  It must
                                     0B2B  2995 ;	scan the list of system decrementing the timeouts.  If
                                     0B2B  2996 ;	a system has timed out, a poll of the processes listed
                                     0B2B  2997 ;	for that system must be begun.
                                     0B2B  2998 ;
                                     0B2B  2999 ; CALLING SEQUENCE:
                                     0B2B  3000 ;
                                     0B2B  3001 ;	JSB	START_POLL
                                     0B2B  3002 ;	IPL must be at IPL$_SCS, IPL$_TIMER
                                     0B2B  3003 ;
                                     0B2B  3004 ; INPUT PARAMETERS:
                                     0B2B  3005 ;
                                     0B2B  3006 ;	R5 is the address of a TQE block
                                     0B2B  3007 ;	R4 is the address of the SB which is the start of the
                                     0B2B  3008 ;	   circular sequence used to select the next system to
                                     0B2B  3009 ;	   poll.  If R4 does not point to an SB, the sequence
                                     0B2B  3010 ;	   begins with the first SB.
                                     0B2B  3011 ;
                                     0B2B  3012 ; OUTPUT PARAMETERS:
                                     0B2B  3013 ;
                                     0B2B  3014 ;	R4 is the new SB at which the search sequence is to
                                     0B2B  3015 ;	   start.
                                     0B2B  3016 ;
                                     0B2B  3017 ; COMPLETION CODES:
                                     0B2B  3018 ;
                                     0B2B  3019 ;	NONE
                                     0B2B  3020 ;
                                     0B2B  3021 ; SIDE EFFECTS:
                                     0B2B  3022 ;
                                     0B2B  3023 ;	R0,R1,R2,R3 are destroyed
                                     0B2B  3024 ;
                                     0B2B  3025 ;--
                                     0B2B  3026 
                                     0B2B  3027 START_POLL:
                                     0B2B  3028 	LOCK	LOCKNAME=SCS,-		; Lock access to SCS structures
                                     0B2B  3029 		LOCKIPL=#IPL$_SYNCH,-	; Set IPL
                                     0B2B  3030 		PRESERVE=NO		; Don't preserve R0
                0B 00000000'GF   E9  0B2B       	BLBC	G^SMP$GL_FLAGS,30019$
                       50   34   9A  0B32       	 MOVZBL	S^#SPL$C_SCS,R0
                   00000000'GF   16  0B35       	 JSB	G^SMP$ACQUIRE
                            03   11  0B3B       	BRB	30020$
                                     0B3D       30019$:
                       12   08   DA  0B3D       		MTPR	S^#IPL$_SCS,S^#PR$_IPL
                                     0B40       30020$:
              52   00000000'GF   DE  0B40  3031 	MOVAL	G^SCS$GQ_CONFIG,R2	; Address system listhead
                       50   54   D0  0B47  3032 	MOVL	R4,R0			; Position in scan
                            53   7C  0B4A  3033 	CLRQ	R3			; No timed-out system found yet
                       51   62   D0  0B4C  3034 	MOVL	(R2),R1			; First SB
                       51   52   D1  0B4F  3035 10$:	CMPL	R2,R1			; All done?
                            55   13  0B52  3036 	BEQL	80$			; Return
                       51   50   D1  0B54  3037 	CMPL	R0,R1			; At start of new scan?
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  71
X-19                            START_POLL - Start poll of requested pro 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (5)

                            05   12  0B57  3038 	BNEQ	20$
                       54   53   D0  0B59  3039 	MOVL	R3,R4			; Save preceding match
                            53   D4  0B5C  3040 	CLRL	R3			; Look for succeeding match
                         58 A1   B7  0B5E  3041 20$:	DECW	SB$W_TIMEOUT(R1)	; Decrement timer
                            0F   15  0B61  3042 	BLEQ	60$			; Timed out
                       51   61   D0  0B63  3043 30$:	MOVL	SB$L_FLINK(R1),R1	; Advance to next SB
                            E7   11  0B66  3044 	BRB	10$
                                     0B68  3045 
                            03   BA  0B68  3046 40$:	POPR	#^M<R0,R1>		; Restore registers
               58 A1   7FFF 8F   B0  0B6A  3047 50$:	MOVW	#^X7FFF, -		; Set max timeout -- this will be
                                     0B70  3048 		SB$W_TIMEOUT(R1)	;	reduced when a bit is set
                            F1   11  0B70  3049 	BRB	30$			; Continue scan
                                     0B72  3050 
                            05   13  0B72  3051 60$:	BEQL	70$			; Have just timed out
                         58 A1   B6  0B74  3052 	INCW	SB$W_TIMEOUT(R1)	; Poll in progress, unmung timer
                            EA   12  0B77  3053 	BNEQ	30$			; Was -2, ignore for now
                                     0B79  3054 ;
                                     0B79  3055 ; here if polling is triggered but not yet begun
                                     0B79  3056 ;
                            03   BB  0B79  3057 70$:	PUSHR	#^M<R0,R1>		; Save registers
                    50   0C A1   9E  0B7B  3058 	MOVAB	SB$L_PBFL(R1),R0	; Address of path block queue header
                       60   50   D1  0B7F  3059 	CMPL	R0,(R0)			; Is there a path block?
                            E4   13  0B82  3060 	BEQL	40$			; Branch if no
                       50   60   D0  0B84  3061 	MOVL	(R0),R0			; Get the first entry
                            04   E0  0B87  3062 	BBS	#PB$V_LOCAL,-		; Don't poll local ports -- AUTOCONFIGURE
                      DC 44 A0       0B89  3063 		PB$W_STS(R0),40$	;  handles them.
               5A A1   02   00   3B  0B8C  3064 	SKPC	#0,#SB$S_ENBMSK, -	; Any polling bits set?
                                     0B91  3065 		SB$B_ENBMSK(R1)
                            D5   13  0B91  3066 	BEQL	40$			; Branch if no bits are set
                            03   BA  0B93  3067 	POPR	#^M<R0,R1>		; Restore registers
              00000000'GF   51   D1  0B95  3068 	CMPL	R1,G^SCS$AR_LOCALSB	; Local system?
                            CC   13  0B9C  3069 	BEQL	50$			; Wait a long time
                            53   D5  0B9E  3070 	TSTL	R3			; Found one yet this pass?
                            C1   12  0BA0  3071 	BNEQ	30$			; Branch if yes
                       53   51   D0  0BA2  3072 	MOVL	R1,R3			; Remember this one
                            54   D4  0BA5  3073 	CLRL	R4			; Forget lower precedence type
                            BA   11  0BA7  3074 	BRB	30$			; Rejoin main flow
                                     0BA9  3075 
                                     0BA9  3076 ;
                                     0BA9  3077 ; The scan over all SB's is completed.
                                     0BA9  3078 ; R3 NEQ 0:
                                     0BA9  3079 ;	R3 is the first SB ready for polling following the mark
                                     0BA9  3080 ;	point set during the last pass, or if there is not
                                     0BA9  3081 ;	such system, R3 is the first SB ready for polling following
                                     0BA9  3082 ;	the list header.  R4 is 0.
                                     0BA9  3083 ; R3 EQL 0:
                                     0BA9  3084 ;	R4 is 0 or the address of the first SB ready for polling
                                     0BA9  3085 ;	preceding mark point set during the last pass and no SB ready
                                     0BA9  3086 ;	for polling was found following the mark point.
                                     0BA9  3087 ; 
                                     0BA9  3088 ; If any systems are ready for polling, initiate polling one
                                     0BA9  3089 ; of these.
                                     0BA9  3090 ;
                       53   54   C8  0BA9  3091 80$:	BISL2	R4,R3			; Address is in R3
                            03   13  0BAC  3092 	BEQL	90$			; Branch if no system
                       54   63   D0  0BAE  3093 	MOVL	SB$L_FLINK(R3),R4	; Address of scan restart point
                    14 A5   54   D0  0BB1  3094 90$:	MOVL	R4,TQE$L_FR4(R5)	; Save restart point
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  72
X-19                            START_POLL - Start poll of requested pro 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (5)

                            71   13  0BB5  3095 	BEQL	140$			; Branch if no system ready for polling
                            55   DD  0BB7  3096 	PUSHL	R5			; Save address of TQE
              51   00000002'EF   3C  0BB9  3097 	MOVZWL	SCS$GW_NEXTBIT,R1	; Number of possible SPPBs
                       51   04   C4  0BC0  3098 	MULL2	#4,R1			; One longword per SPPB
                       51   1C   C0  0BC3  3099 	ADDL2	#SPNB$C_HDRSIZ+4,R1	; Space for listhead and trailer
                            53   DD  0BC6  3100 	PUSHL	R3			; Save SB address
                          FD5B   30  0BC8  3101 	BSBW	SCS_ALONONPAGED		; Get pool
                            53 8ED0  0BCB  3102 	POPL	R3			; Restore SB address
                         54 50   E9  0BCE  3103 	BLBC	R0,130$			; Can't, so exit nicely
                            3F   BB  0BD1  3104 	PUSHR	#^M<R0,R1,R2,R3,R4,R5>
        62   51   00   62   00   2C  0BD3  3105 	MOVC5	#0,(R2),#0,R1,(R2)	; Zero allocated block
                            3F   BA  0BD9  3106 	POPR	#^M<R0,R1,R2,R3,R4,R5>
                    08 A2   51   B0  0BDB  3107 	MOVW	R1,SPNB$W_SIZE(R2)	; Store size
                         15 A2   B4  0BDF  3108 	CLRW	SPNB$W_REFC(R2)		; Init reference count
                                     0BE2  3109 	ASSUME	SPNB$B_SUBTYP EQ SPNB$B_TYPE+1
               0A A2   0960 8F   B0  0BE2  3110 	MOVW	#DYN$C_SCS!-
                                     0BE8  3111 		<DYN$C_SCS_SPNB@8>,SPNB$B_TYPE(R2) ; Set type
                    0C A2   53   D0  0BE8  3112 	MOVL	R3,SPNB$L_SB(R2)	; Address of SB
                 10 A2   39'AF   9E  0BEC  3113 	MOVAB	B^300$,SPNB$L_ROUTINE(R2) ; Address of local notification routine
                    54   18 A2   9E  0BF1  3114 	MOVAB	SPNB$B_NAMLST(R2),R4	; Address data area
              55   00000000'GF   DE  0BF5  3115 	MOVAL	G^SCS$GQ_POLL,R5	; Poller process list head
                       50   65   D0  0BFC  3116 	MOVL	(R5),R0			; Address of first SPPB
                       50   55   D1  0BFF  3117 100$:	CMPL	R5,R0			; All done?
                            15   13  0C02  3118 	BEQL	120$			; Branch if yes
                    51   24 A0   3C  0C04  3119 	MOVZWL	SPPB$W_BIT(R0),R1	; Get process bit number
                 07 5A A3   51   E1  0C08  3120 	BBC	R1,SB$B_ENBMSK(R3),110$	; Branch if poll not enabled
                    84   0C A0   9E  0C0D  3121 	MOVAB	SPPB$B_PROCNAM(R0), -	; Save address of process name
                                     0C11  3122 		(R4)+
                         15 A2   B6  0C11  3123 	INCW	SPNB$W_REFC(R2)		; Increment reference count
                       50   60   D0  0C14  3124 110$:	MOVL	SPPB$L_FLINK(R0),R0	; Advance to next process
                            E6   11  0C17  3125 	BRB	100$			; Iterate over all SPPBs
                                     0C19  3126 
                            84   D4  0C19  3127 120$:	CLRL	(R4)+			; List end mark
                                     0C1B  3128 
                                     0C1B  3129 ;
                                     0C1B  3130 ; call SCS$DIRECTORY_LOOKUP to do lookups
                                     0C1B  3131 ;
                                     0C1B  3132 ;	R3 : address of SB
                                     0C1B  3133 ;	R2 : address of allocated argument list
                                     0C1B  3134 ;
                         58 A3   B7  0C1B  3135 	DECW	SB$W_TIMEOUT(R3)	; Set timeout to -1 to flag scan
                            18   BB  0C1E  3136 	PUSHR	#^M<R3,R4>		; Save regs
                          0073   30  0C20  3137 	BSBW	SCS$DIR_LOOKUP		; Call lookup routine
                            18   BA  0C23  3138 	POPR	#^M<R3,R4>
                            55 8ED0  0C25  3139 130$:	POPL	R5			; Restore TQE address
                                     0C28  3140 140$:	UNLOCK	LOCKNAME=SCS,-		; Unlock SCS access
                                     0C28  3141 		PRESERVE=NO		; Don't preserve R0
                09 00000000'GF   E9  0C28       	BLBC	G^SMP$GL_FLAGS,30026$
                       50   34   9A  0C2F       	 MOVZBL	S^#SPL$C_SCS,R0
                   00000000'GF   16  0C32       	 JSB	G^SMP$RELEASE
                                     0C38       30026$:
                                     0C38  3142 					;** Don't change IPL
                                 05  0C38  3143 	RSB
                                     0C39  3144 
                                     0C39  3145 ;
                                     0C39  3146 ; Get here when a polled process is found;
                                     0C39  3147 ;
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  73
X-19                            START_POLL - Start poll of requested pro 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (5)

                                     0C39  3148 ;	R1 is address of process name in SPPB
                                     0C39  3149 ;	R2 is address of SB
                                     0C39  3150 ;	R3 is address of process info in message buffer
                                     0C39  3151 ;	Preserves R1-R5
                                     0C39  3152 ;
                                     0C39  3153 300$:	
                    50   18 A1   3C  0C39  3154 	MOVZWL	SPPB$W_BIT-SPPB$B_PROCNAM(R1),R0	; Polling bit number
                 33 5A A2   50   E1  0C3D  3155 	BBC	R0,SB$B_ENBMSK(R2),310$	; Branch if not interested
                            3E   BB  0C42  3156 	PUSHR	#^M<R1,R2,R3,R4,R5>	; Save some registers
                                     0C44  3157 	.IF DEFINED SCS$NO_MSCP_POLL
                                     0C44  3158 	;
                                     0C44  3159 	;	Check for the 'NOT PRESENT HERE' string.  
                                     0C44  3160 	;
             63   F4AD CF   10   29  0C44  3161 	CMPC3	#16,SERV_INFO,(R3)		; Look for match
                            05   12  0C4A  3162 	BNEQ	302$				; No match -- call requester
                       50   01   9A  0C4C  3163 	MOVZBL	#1,R0				; Got the 'NOT PRESENT STRING'
                            16   11  0C4F  3164 	BRB	308$				;  stop polling
                       51   6E   D0  0C51  3165 302$:	MOVL	(SP),R1				; Restore registers
                    52   04 AE   7D  0C54  3166 	MOVQ	4(SP),R2
                                     0C58  3167 	.ENDC				; SCS$NO_MSCP_POLL
                    54   44 A2   9E  0C58  3168 	MOVAB	SB$T_NODENAME(R2),R4	; Address of node name
                    52   18 A2   9E  0C5C  3169 	MOVAB	SB$B_SYSTEMID(R2),R2	; Address of system ID
                    50   14 A1   D0  0C60  3170 	MOVL	SPPB$L_CTX-SPPB$B_PROCNAM(R1),R0	; Context longword
                                     0C64  3171 ;
                                     0C64  3172 ; Call notification routine with:
                                     0C64  3173 ;
                                     0C64  3174 ;	R0 is context longword
                                     0C64  3175 ;	R1 is address of process name
                                     0C64  3176 ;	R2 is address of system ID
                                     0C64  3177 ;	R3 is address of process information
                                     0C64  3178 ;	R4 is address of node name
                                     0C64  3179 ;
                                     0C64  3180 ;	If the notification routine returns success, disable polling
                                     0C64  3181 ;	for the process on the system on which is was found
                                     0C64  3182 ;
                         10 B1   16  0C64  3183 	JSB	@SPPB$L_RTN-SPPB$B_PROCNAM(R1)	; Call notification routine
                            3E   BA  0C67  3184 308$:	POPR	#^M<R1,R2,R3,R4,R5>	; Restore registers
                         09 50   E9  0C69  3185 	BLBC	R0,310$			; Branch to leave polling enabled
                    50   18 A1   3C  0C6C  3186 	MOVZWL	SPPB$W_BIT-SPPB$B_PROCNAM(R1),R0	; Polling bit number
                 00 5A A2   50   E5  0C70  3187 	BBCC	R0,SB$B_ENBMSK(R2),310$	; Clear polling bit		
                                 05  0C75  3188 310$:	RSB				; Have handled event
                                     0C76  3189 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  74
X-19                            SCS$DIR_LOOKUP - look up process names o 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (6)

                                     0C76  3191 	.SBTTL SCS$DIR_LOOKUP - look up process names on remote node
                                     0C76  3192 ;++
                                     0C76  3193 ;  SCS$DIR_LOOKUP
                                     0C76  3194 ;
                                     0C76  3195 ;  INPUTS
                                     0C76  3196 ;	R2	- address of SPNB (System Process Name Block)
                                     0C76  3197 ;	R3 	- address of target SB
                                     0C76  3198 ;	IPL	- IPL$SCS
                                     0C76  3199 ;
                                     0C76  3200 ;  FUNCTION
                                     0C76  3201 ;	Connect to SCS$DIRECTORY service on remote system, look
                                     0C76  3202 ;	up process names in specified list, and notify caller
                                     0C76  3203 ;	of the ones which exist
                                     0C76  3204 ;--
                                     0C76  3205 
4B 4F 4F 4C 5F 52 49 44 24 53 43 53  0C76  3206 MY_PROC:	.ASCII /SCS$DIR_LOOKUP  /	; Name of process on local node
                        20 20 50 55  0C82       
52 4F 54 43 45 52 49 44 24 53 43 53  0C86  3207 REM_PROC:	.ASCII /SCS$DIRECTORY   /	; Name of process on remote node
                        20 20 20 59  0C92       
                                     0C96  3208 	UNIVERSAL_SYMBOL SCS$DIR_LOOKUP
                                     0C96       SCS$DIR_LOOKUP::
                                     0C96  3209 
                                     0C96  3210 ;SCS$DIR_LOOKUP:
                                     0C96  3211 
                                     0C96  3212 ;
                                     0C96  3213 ; Connect to remote node
                                     0C96  3214 ;
                       55   52   D0  0C96  3215 	MOVL	R2,R5				; Save context in safe register
                                     0C99  3216 	CONNECT MSGADR=MSG_INPUT,-		; Try connect to directory
                                     0C99  3217 		ERRADR=ERR_ROUTINE,-		; service on remote node
                                     0C99  3218 		RPRNAM=REM_PROC,-
                                     0C99  3219 		LPRNAM=MY_PROC,-
                                     0C99  3220 		RSYSID=SB$B_SYSTEMID(R3),-
                                     0C99  3221 		INITCR=#3,-
                                     0C99  3222 		AUXSTR=(R2),-
                                     0C99  3223 		MOVADR=DIR_MOVE,- 	; Load sharing move path routine
                                     0C99  3224 		LOAD_RATING=#CDT$C_LOAD_SHARE_DISABLE 
                         D8'AF   9F  0C99       		PUSHAB	B^30030$
                            08   DD  0C9C       	PUSHL	 #CDT$C_LOAD_SHARE_DISABLE
                   00000E24'EF   9F  0C9E       		PUSHAB	DIR_MOVE
                            00   DD  0CA4       		PUSHL	#0
                            62   9F  0CA6       		PUSHAB	(R2)
                            00   DD  0CA8       		PUSHL	#0
                       7E   00   9B  0CAA       		MOVZBW	#0,-(SP)
                       7E   00   B0  0CAD       		MOVW	#0,-(SP)
                       7E   00   B0  0CB0       		MOVW	#0,-(SP)
                       7E   03   B0  0CB3       		MOVW	#3,-(SP)
                         BD AF   9F  0CB6       		PUSHAB	MY_PROC
                         CA AF   9F  0CB9       		PUSHAB	REM_PROC
                            00   DD  0CBC       		PUSHL	#0
                         18 A3   9F  0CBE       		PUSHAB	SB$B_SYSTEMID(R3)
                   00000DD4'EF   9F  0CC1       		PUSHAB	ERR_ROUTINE
                            00   DD  0CC7       		PUSHL	#0
                   00000D6C'EF   9F  0CC9       		PUSHAB	MSG_INPUT
                       7E   10   D0  0CCF       		MOVL	#16,-(SP)
                   000004EF'GF   17  0CD2       		JMP	G^SCS$CONNECT
                                     0CD8       30030$:
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  75
X-19                            SCS$DIR_LOOKUP - look up process names o 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (6)

                                     0CD8  3225 					; Set load rating to move disabled
                         0D 50   E8  0CD8  3226 	BLBS	R0,10$				; If LBS, okay
                       50   55   D0  0CDB  3227 	MOVL	R5,R0				; Get SPNB
                          00D7   30  0CDE  3228 	BSBW	RESET_TIMER			; Re-enable polling on this node
                   00000000'GF   16  0CE1  3229 	JSB	G^COM$DRVDEALMEM		; And deallocate
                                 05  0CE7  3230 	RSB					; Return
                                     0CE8  3231 	
                    52   5C A3   D0  0CE8  3232 10$:	MOVL	CDT$L_AUXSTRUC(R3),R2		; Restore context
                    14 A2   01   8E  0CEC  3233 	MNEGB	#1,SPNB$B_INDEX(R2)		; Init index
                                     0CF0  3234 
                                     0CF0  3235 ;
                                     0CF0  3236 ; Allocate CDRP and set it up
                                     0CF0  3237 ;
                       51   2C   3C  0CF0  3238 	MOVZWL	#CDRP$C_LENGTH,R1		; Specify number of bytes needed
                            53   DD  0CF3  3239 	PUSHL	R3
                          FC2E   30  0CF5  3240 	BSBW	SCS_ALONONPAGED			; Allocate from npagedpool
                            53 8ED0  0CF8  3241 	POPL	R3 
                         58 50   E9  0CFB  3242 	BLBC	R0,25$				; No memory available
                            3F   BB  0CFE  3243 	PUSHR	#^M<R0,R1,R2,R3,R4,R5>		; Save regs destroyed by MOVC
        62   2C   00   62   00   2C  0D00  3244 	MOVC5	#0,(R2),#0,#CDRP$C_LENGTH,(R2)	; Zero out block
                            3F   BA  0D06  3245 	POPR	#^M<R0,R1,R2,R3,R4,R5>		; Restore regs	
                       55   52   D0  0D08  3246 	MOVL	R2,R5				; Move CDRP to arg register
                    08 A5   51   B0  0D0B  3247 	MOVW	R1, CDRP$W_CDRPSIZE(R5)		; Set up block size
                    0A A5   39   9B  0D0F  3248 	MOVZBW	#DYN$C_CDRP, -
                                     0D13  3249 		CDRP$B_CD_TYPE(R5)		; Set type
                    24 A5   53   D0  0D13  3250 	MOVL	R3,CDRP$L_CDT(R5)		; Set CDT
                                     0D17  3251 
                                     0D17  3252 ;
                                     0D17  3253 ; Allocate message buffer and store next process name to look for
                                     0D17  3254 ;
                                     0D17  3255 15$:	ALLOC_MSG_BUF
                         14 B4   16  0D17       		JSB	@PDT$L_ALLOCMSG(R4)
                    53   24 A5   D0  0D1A  3256 	MOVL	CDRP$L_CDT(R5),R3		; Get CDT
                       00C0 8F   BB  0D1E  3257 	PUSHR	#^M<R6,R7>			; Save CDT
                    56   5C A3   D0  0D22  3258 	MOVL	CDT$L_AUXSTRUC(R3),R6		; Get SPNB
                         14 A6   96  0D26  3259 	INCB	SPNB$B_INDEX(R6)		; Point to next name
                    57   14 A6   9A  0D29  3260 	MOVZBL	SPNB$B_INDEX(R6),R7		; Get index
                  57   18 A647   D0  0D2D  3261 	MOVL	SPNB$B_NAMLST(R6)[R7],R7	; Get next process name
                            1A   13  0D32  3262 	BEQL	20$				; If zero, end of list
                            62   D4  0D34  3263 	CLRL	(R2)				; Zero out first longword of msg
                    04 A2   67   7D  0D36  3264 	MOVQ	(R7),4(R2)			; Move to message buffer
                 0C A2   08 A7   7D  0D3A  3265 	MOVQ	8(R7),12(R2)			; (16 bytes)
                       00C0 8F   BA  0D3F  3266 	POPR	#^M<R6,R7>			; Restore CDT
                       51   24   D0  0D43  3267 	MOVL	#36,R1				; Maximum size of msg (for HSC)
                         20 A5   D4  0D46  3268 	CLRL	CDRP$L_RSPID(R5)		; No response ID
                                     0D49  3269 	SEND_CNT_MSG_BUF			; Send it
                         60 B4   16  0D49       		JSB	@PDT$L_SNDCNTMSG(R4)
                            C9   11  0D4C  3270 	BRB	15$				; More names to look for?
                                     0D4E  3271 
                                     0D4E  3272 ;
                                     0D4E  3273 ; No more processes to look for - clean up
                                     0D4E  3274 ;
                                     0D4E  3275 20$:	
                       00C0 8F   BA  0D4E  3276 	POPR	#^M<R6,R7>			; Restore CDT and stack
                                     0D52  3277 	DEALLOC_MSG_BUF				; Deallocate message buffer
                         20 B4   16  0D52       		JSB	@PDT$L_DEALLOMSG(R4)
                                 05  0D55  3278 	RSB
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  76
X-19                            SCS$DIR_LOOKUP - look up process names o 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (6)

                                     0D56  3279 
                                     0D56  3280 ;
                                     0D56  3281 ; Deallocate SPNB (when CDRP allocate fails)
                                     0D56  3282 ;	
                    55   5C A3   D0  0D56  3283 25$:	MOVL	CDT$L_AUXSTRUC(R3),R5		; Get SPNB in a safe register
                                     0D5A  3284 	DISCONNECT				; Break connection
                   000007E7'GF   16  0D5A       		JSB	G^SCS$DISCONNECT
                       50   55   D0  0D60  3285 	MOVL	R5,R0				; Copy SPNB address
                            53   10  0D63  3286 	BSBB	RESET_TIMER			; Re-enable polling for node
                   00000000'GF   16  0D65  3287 	JSB	G^COM$DRVDEALMEM		; And deallocate
                                 05  0D6B  3288 	RSB
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  77
X-19                            SCS$DIR_LOOKUP - look up process names o 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (7)

                                     0D6C  3290 ;++
                                     0D6C  3291 ;  MSG_INPUT
                                     0D6C  3292 ;	Process responses from SCS$DIRECTORY
                                     0D6C  3293 ;
                                     0D6C  3294 ;  INPUTS
                                     0D6C  3295 ;	R2	- Address of response message
                                     0D6C  3296 ;	R3	- CDT address
                                     0D6C  3297 ;	R4	- PDT address
                                     0D6C  3298 ;	IPL	- Port device fork IPL
                                     0D6C  3299 ;
                                     0D6C  3300 ;  FUNCTION
                                     0D6C  3301 ;	Notifies lookup initiator of found process
                                     0D6C  3302 ;
                                     0D6C  3303 ;--
                                     0D6C  3304 
                                     0D6C  3305 MSG_INPUT:
                         31 62   E9  0D6C  3306 	BLBC	(R2),35$			; If no success, return
                       00FE 8F   BB  0D6F  3307 	PUSHR	#^M<R1,R2,R3,R4,R5,R6,R7>	; Save registers
                    55   5C A3   D0  0D73  3308 	MOVL	CDT$L_AUXSTRUC(R3),R5		; Get address of SPNB
                       54   52   D0  0D77  3309 	MOVL	R2,R4				; Move to safe register
                                     0D7A  3310 
                                     0D7A  3311 ;
                                     0D7A  3312 ;  Search for name in list of names we've asked about
                                     0D7A  3313 ;
                            56   D4  0D7A  3314 	CLRL	R6				; Init index
                  57   18 A546   D0  0D7C  3315 10$:	MOVL	SPNB$B_NAMLST(R5)[R6],R7	; Get next name
                            2D   13  0D81  3316 	BEQL	90$				; If eql, end of list
               04 A4   67   10   29  0D83  3317 	CMPC3	#16,(R7),4(R4) 			; Look for match
                            04   13  0D88  3318 	BEQL	20$				; Found one
                            56   D6  0D8A  3319 	INCL	R6				; Next item in list
                            EE   11  0D8C  3320 	BRB	10$				; Loop
                                     0D8E  3321 
                                     0D8E  3322 ;
                                     0D8E  3323 ;  Send on notice that remote node has process
                                     0D8E  3324 ;
                       51   57   D0  0D8E  3325 20$:	MOVL	R7,R1				; Get address of process name
                    53   14 A4   9E  0D91  3326 	MOVAB	<4+16>(R4),R3			; Get address of process info
                    52   0C A5   D0  0D95  3327 	MOVL	SPNB$L_SB(R5),R2		; Get address of SB
                         10 B5   16  0D99  3328 	JSB	@SPNB$L_ROUTINE(R5)		; Pass to our notification rtn
                                     0D9C  3329 ;
                                     0D9C  3330 ;  Clean up
                                     0D9C  3331 ;
                       00FE 8F   BA  0D9C  3332 30$:	POPR	#^M<R1,R2,R3,R4,R5,R6,R7>	; Restore registers
                                     0DA0  3333 35$:	
                                     0DA0  3334 	DEALLOC_MSG_BUF_REG			; Return message buf to SCS
                         24 B4   16  0DA0       		JSB	@PDT$L_DEALRGMSG(R4)
                    50   5C A3   D0  0DA3  3335 	MOVL	CDT$L_AUXSTRUC(R3),R0		; Get address of SPNB
                         15 A0   B7  0DA7  3336 	DECW	SPNB$W_REFC(R0)			; Decrement reference count
                            01   13  0DAA  3337 	BEQL	40$				; Branch if done on connection
                                 05  0DAC  3338 	RSB					; And return
                                     0DAD  3339 
                            25   10  0DAD  3340 40$:	BSBB	ERR_ROUTINE			; Clean up on connection
                                     0DAF  3341 						; & disconnect
                                 05  0DAF  3342 	RSB
                                     0DB0  3343 
                                     0DB0  3344 ;
                                     0DB0  3345 ;  We get here if there is no match in the list of names we are polling
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  78
X-19                            SCS$DIR_LOOKUP - look up process names o 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (7)

                                     0DB0  3346 ;  for.  The reference count is not decremented - the connection will
                                     0DB0  3347 ;  remain open without further polling as a way of flagging this error.
                                     0DB0  3348 ;
                       00FE 8F   BA  0DB0  3349 90$:	POPR	#^M<R1,R2,R3,R4,R5,R6,R7>	; Just exit here
                                     0DB4  3350 	DEALLOC_MSG_BUF_REG			; Get rid of buffer
                         24 B4   16  0DB4       		JSB	@PDT$L_DEALRGMSG(R4)
                                 05  0DB7  3351 	RSB					;
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  79
X-19                            SCS$DIR_LOOKUP - look up process names o 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (8)

                                     0DB8  3353 ;++
                                     0DB8  3354 ;  RESET_TIMER
                                     0DB8  3355 ;	Re-enable polling on a node
                                     0DB8  3356 ;
                                     0DB8  3357 ;  INPUT
                                     0DB8  3358 ;	R0	- address of SPNB
                                     0DB8  3359 ;
                                     0DB8  3360 ;  OUTPUT
                                     0DB8  3361 ;	Polling is re-enabled on node
                                     0DB8  3362 ;--
                                     0DB8  3363 
                                     0DB8  3364 RESET_TIMER:
                            52   DD  0DB8  3365 	PUSHL	R2			; Save R2
                    52   0C A0   D0  0DBA  3366 	MOVL	SPNB$L_SB(R0),R2	; Get address of system block
                         58 A2   B6  0DBE  3367 	INCW	SB$W_TIMEOUT(R2)	; Polling complete
                            05   13  0DC1  3368 	BEQL	10$			; Branch to reset timer
                         58 A2   B4  0DC3  3369 	CLRW	SB$W_TIMEOUT(R2)	; Request polling
                            08   11  0DC6  3370 	BRB	20$
                                     0DC8  3371 
           58 A2   00000000'GF   B0  0DC8  3372 10$:	MOVW	G^SCS$GW_PRCPOLINT, -	; Reset timer
                                     0DD0  3373 		SB$W_TIMEOUT(R2)
                            52 8ED0  0DD0  3374 20$:	POPL	R2			; Restore R2
                                 05  0DD3  3375 	RSB				; Return
                                     0DD4  3376 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  80
X-19                            SCS$DIR_LOOKUP - look up process names o 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1         (9)

                                     0DD4  3378 ;++
                                     0DD4  3379 ;  ERR_ROUTINE
                                     0DD4  3380 ;	Handle broken connections
                                     0DD4  3381 ;
                                     0DD4  3382 ;  INPUTS
                                     0DD4  3383 ;	R0 	- error status
                                     0DD4  3384 ;	R3	- address of CDT
                                     0DD4  3385 ;	R4	- address of PDT
                                     0DD4  3386 ;
                                     0DD4  3387 ;  FUNCTION
                                     0DD4  3388 ;	Deallocate all message buffers and CDRP'S associated with
                                     0DD4  3389 ;	given CDT, and disconnect.
                                     0DD4  3390 ;--
                                     0DD4  3391 ERR_ROUTINE:
                                     0DD4  3392 	SCAN_MSGBUF_WAIT -		; Find CDRP'S 
                                     0DD4  3393 	  	ACTION = CLEANUP_RTN	
              50   00000DF7'EF   9E  0DD4       		MOVAB	CLEANUP_RTN, R0
                   000009F0'GF   16  0DDB       		JSB	G^SCS$LKP_MSGWAIT
                                     0DE1  3394 
                    55   5C A3   D0  0DE1  3395 	MOVL	CDT$L_AUXSTRUC(R3),R5	; Get address of SPNB in a safe place.
                                     0DE5  3396 	DISCONNECT			; Break connection
                   000007E7'GF   16  0DE5       		JSB	G^SCS$DISCONNECT
                       50   55   D0  0DEB  3397 	MOVL	R5,R0			; Copy the SPNB address
                            C8   10  0DEE  3398 	BSBB	RESET_TIMER		; Re-enable polling
                   00000000'GF   16  0DF0  3399 	JSB	G^COM$DRVDEALMEM	; Return to pool
                                 05  0DF6  3400 	RSB
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  81
X-19                            SCS$DIR_LOOKUP - look up process names o 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (10)

                                     0DF7  3402 ;++
                                     0DF7  3403 ;  CLEANUP_RTN
                                     0DF7  3404 ;
                                     0DF7  3405 ;  INPUTS
                                     0DF7  3406 ;	R3	- address of CDT
                                     0DF7  3407 ;	R4	- address of PDT
                                     0DF7  3408 ;	R5	- address of CDRP
                                     0DF7  3409 ;--
                                     0DF7  3410 
                                     0DF7  3411 CLEANUP_RTN:
                                     0DF7  3412 
                                     0DF7  3413 ;
                                     0DF7  3414 ;  Remove CDRP from queue, if needed
                                     0DF7  3415 ;
                            52   DD  0DF7  3416 	PUSHL	R2
                         04 A5   D5  0DF9  3417 	TSTL	CDRP$L_FQBL(R5)		; Is there a queue pointer?
                            11   13  0DFC  3418 	BEQL	5$			; If EQL, none
                    55   04 B5   D1  0DFE  3419 	CMPL	@CDRP$L_FQBL(R5),R5	; Is CDRP in a queue?
                            0B   12  0E02  3420 	BNEQ	5$			; If NEQ, no
                       55   65   0F  0E04  3421 	REMQUE	(R5),R5			; Dequeue CDRP
                    52   28 A5   D0  0E07  3422 	MOVL	CDRP$L_RWCPTR(R5),R2	; Get wait count pointer
                            02   13  0E0B  3423 	BEQL	5$			; Branch if none
                            62   B7  0E0D  3424 	DECW	(R2)			; Adjust
                                     0E0F  3425 
                                     0E0F  3426 ;
                                     0E0F  3427 ;  Deallocate associated message buffer, if any
                                     0E0F  3428 ;
                            52 8ED0  0E0F  3429 5$:	POPL	R2			; Restore reg
                         1C A5   D5  0E12  3430 	TSTL	CDRP$L_MSG_BUF(R5)	; Do we have any message buffers?
                            03   13  0E15  3431 	BEQL	10$			; If EQL, no
                                     0E17  3432 	DEALLOC_MSG_BUF			; Get rid of it
                         20 B4   16  0E17       		JSB	@PDT$L_DEALLOMSG(R4)
                                     0E1A  3433 
                                     0E1A  3434 ;
                                     0E1A  3435 ;  Return CDRP to non-paged pool
                                     0E1A  3436 ;
                       50   55   D0  0E1A  3437 10$:	MOVL	R5,R0			; Address of CDRP in R0
                   00000000'GF   16  0E1D  3438 	JSB	G^COM$DRVDEALMEM	; Give back to pool
                                 05  0E23  3439 	RSB				; Cleanup done
                                     0E24  3440 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  82
X-19                            SCS$DIR_LOOKUP - look up process names o 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (11)

                                     0E24  3442 ;++
                                     0E24  3443 ;  DIR_MOVE 
                                     0E24  3444 ;	This routine is invoked when the connection load balancing
                                     0E24  3445 ;	algorithm wants this connection to move.  Because the directory
                                     0E24  3446 ;	service is going to disconnect shortly, the service will always
                                     0E24  3447 ;	refuse to move.
                                     0E24  3448 ;
                                     0E24  3449 ;  INPUTS
                                     0E24  3450 ;	R3	- address of CDT
                                     0E24  3451 ;	R4	- address of PDT
                                     0E24  3452 ;--
                                     0E24  3453 DIR_MOVE:				; Can't move a directory
                                 05  0E24  3454 	RSB
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  83
X-19                            SCS$POLL_MBX - Declare Polling Notificat 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (12)

                                     0E25  3456 	.SBTTL	SCS$POLL_MBX - Declare Polling Notification Mailbox
                                     0E25  3457 
                                     0E25  3458 ;++
                                     0E25  3459 ;
                                     0E25  3460 ; FUNCTIONAL DESCRIPTION:
                                     0E25  3461 ;
                                     0E25  3462 ;	This routine is called to declare a mailbox to receive notification
                                     0E25  3463 ;	when a process name appears in an SCS directory.
                                     0E25  3464 ;
                                     0E25  3465 ;	This routine, and its companion SCS$CANCEL_MBX, are assumed to be
                                     0E25  3466 ;	used as follows:
                                     0E25  3467 ;
                                     0E25  3468 ;		$CREMBX	...			;create mailbox
                                     0E25  3469 ;		BLBC	R0,xxx
                                     0E25  3470 ;		JSB	SCS$POLL_MBX		;declare polling notification
                                     0E25  3471 ;		BLBC	R0,xxx
                                     0E25  3472 ;
                                     0E25  3473 ;		...
                                     0E25  3474 ;
                                     0E25  3475 ;		$QIO	#IO$_READVBLK,...	;read messages from mailbox
                                     0E25  3476 ;
                                     0E25  3477 ;		...
                                     0E25  3478 ;
                                     0E25  3479 ;		JSB	SCS$CANCEL_MBX		;cancel polling notification
                                     0E25  3480 ;		$DASSGN	...			;deassign mailbox
                                     0E25  3481 ;
                                     0E25  3482 ;		Note that this sequence must be complete before the process
                                     0E25  3483 ;		exists, for whatever reason!
                                     0E25  3484 ;
                                     0E25  3485 ; CALLING SEQUENCE:
                                     0E25  3486 ;
                                     0E25  3487 ;	JSB	SCS$POLL_MBX
                                     0E25  3488 ;	IPL must be at IPL$_ASTDEL
                                     0E25  3489 ;
                                     0E25  3490 ; INPUT PARAMETERS:
                                     0E25  3491 ;
                                     0E25  3492 ;	R0 is the mailbox channel number
                                     0E25  3493 ;	R2 is the address of process name address
                                     0E25  3494 ;
                                     0E25  3495 ; OUTPUT PARAMETERS:
                                     0E25  3496 ;
                                     0E25  3497 ;	R1 is the address of the SPPB created to service this request.
                                     0E25  3498 ;
                                     0E25  3499 ; COMPLETION CODES:
                                     0E25  3500 ;
                                     0E25  3501 ;	R0 contains status
                                     0E25  3502 ;
                                     0E25  3503 ; SIDE EFFECTS:
                                     0E25  3504 ;
                                     0E25  3505 ;	R0,R1 are destroyed
                                     0E25  3506 ;
                                     0E25  3507 ;--
                                     0E25  3508 
                                     0E25  3509 	UNIVERSAL_SYMBOL SCS$POLL_MBX
                                     0E25       SCS$POLL_MBX::
                                     0E25  3510 
                                     0E25  3511 ;SCS$POLL_MBX:
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  84
X-19                            SCS$POLL_MBX - Declare Polling Notificat 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (12)

                            0C   BB  0E25  3512 	PUSHR	#^M<R2,R3>
                   00000000'GF   16  0E27  3513 	JSB	G^IOC$VERIFYCHAN	; Verify channel number
                         48 50   E9  0E2D  3514 	BLBC	R0,20$			; Branch on invalid channel
                       52   6E   7D  0E30  3515 	MOVQ	(SP),R2			; Restore registers
                       51   61   D0  0E33  3516 	MOVL	CCB$L_UCB(R1),R1	; UCB address
                         70 A1   B6  0E36  3517 	INCW	UCB$W_REFC(R1)		; Nail down UCB -- security blanket
                                     0E39  3518 	LOCK	LOCKNAME=SCS,-		; Lock SCS database
                                     0E39  3519 		LOCKIPL=#IPL$_SCS,-	; Raise IPL
                                     0E39  3520 		SAVIPL=-(SP),-		; Save current IPL
                                     0E39  3521 		PRESERVE=NO		; Don't preserve R0
                       7E   12   DB  0E39       	 MFPR	S^#PR$_IPL,-(SP)
                0B 00000000'GF   E9  0E3C       	BLBC	G^SMP$GL_FLAGS,30033$
                       50   34   9A  0E43       	 MOVZBL	S^#SPL$C_SCS,R0
                   00000000'GF   16  0E46       	 JSB	G^SMP$ACQUIRE
                            03   11  0E4C       	BRB	30034$
                                     0E4E       30033$:
                       12   08   DA  0E4E       		MTPR	S^#IPL$_SCS,S^#PR$_IPL
                                     0E51       30034$:
                    50   7B'AF   9E  0E51  3522 	MOVAB	B^100$,R0		; Address of notication routine
                          FBFA   30  0E55  3523 	BSBW	SCS$POLL_PROC		; Declare process to poll
                         05 50   E9  0E58  3524 	BLBC	R0,10$			; Branch on error
                            52   D4  0E5B  3525 	CLRL	R2			; Set polling mode for all systems
                                     0E5D  3526 					; R1 is address of SPPB
                                     0E5D  3527 					; R0 is odd to enable polling
                          FC70   30  0E5D  3528 	BSBW	SCS$POLL_MODE		; Enable polling
                                     0E60  3529 
                                     0E60  3530 10$:	UNLOCK	LOCKNAME=SCS,-		; Unlock SCS database
                                     0E60  3531 		NEWIPL=(SP)+		; Save current IPL
                0E 00000000'GF   E9  0E60       	BLBC	G^SMP$GL_FLAGS,30040$
                            50   DD  0E67       	 PUSHL	R0
                       50   34   9A  0E69       	 MOVZBL	S^#SPL$C_SCS,R0
                   00000000'GF   16  0E6C       	 JSB	G^SMP$RELEASE
                            50 8ED0  0E72       	 POPL	R0
                                     0E75       30040$:
                       12   8E   DA  0E75       	 MTPR	(SP)+,S^#PR$_IPL
                            0C   BA  0E78  3532 20$:	POPR	#^M<R2,R3>		; Restore registers
                                 05  0E7A  3533 	RSB
                                     0E7B  3534 
                                     0E7B  3535 ;
                                     0E7B  3536 ; Mailbox message format:
                                     0E7B  3537 ;
                                     0E7B  3538 ;	 31           24 23           16 15           08 07           00	
                                     0E7B  3539 ;	+---------------+---------------+---------------+---------------+
                                     0E7B  3540 ;    00	|       		System ID (l.o.)			|
                                     0E7B  3541 ;	+---------------+---------------+---------------+---------------+
                                     0E7B  3542 ;    04	|       Unused (zero)           |        System ID (h.o.)	|
                                     0E7B  3543 ;	+---------------+---------------+---------------+---------------+
                                     0E7B  3544 ;    08	|			Node Name				|
                                     0E7B  3545 ;	|			( 16 bytes )				|
                                     0E7B  3546 ;	|								|
                                     0E7B  3547 ;	|								|
                                     0E7B  3548 ;	+---------------+---------------+---------------+---------------+
                                     0E7B  3549 ;    24	|		Process						|
                                     0E7B  3550 ;	|		    Name					|
                                     0E7B  3551 ;	|			( 16					|
                                     0E7B  3552 ;	|			    Bytes )				|
                                     0E7B  3553 ;	+---------------+---------------+---------------+---------------+
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  85
X-19                            SCS$POLL_MBX - Declare Polling Notificat 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (12)

                                     0E7B  3554 ;    40	|		Directory					|
                                     0E7B  3555 ;	|		    Information					|
                                     0E7B  3556 ;	|			( 16					|
                                     0E7B  3557 ;	|			    Bytes )				|
                                     0E7B  3558 ;	+---------------+---------------+---------------+---------------+
                                     0E7B  3559 ;    56
                                     0E7B  3560 ; 
                                     0E7B  3561 ;
                                     0E7B  3562 ; Notification routine called when process name is found
                                     0E7B  3563 ;
                                     0E7B  3564 ; Inputs:
                                     0E7B  3565 ;	R0 is UCB address
                                     0E7B  3566 ;	R1 is address of process name
                                     0E7B  3567 ;	R2 is address of system ID
                                     0E7B  3568 ;	R3 is address of process information
                                     0E7B  3569 ;	R4 is address of node name
                                     0E7B  3570 ;
                                     0E7B  3571 ; Outputs:
                                     0E7B  3572 ;	R1-R5 destroyed
                                     0E7B  3573 ;	R0 is status
                                     0E7B  3574 ;
                       55   50   D0  0E7B  3575 100$:	MOVL	R0,R5			; Notification still wanted?
                            39   13  0E7E  3576 	BEQL	110$			; Branch if no
                                     0E80  3577 	ASSUME	PRCPOL$C_SIZ,EQ,56      ; Ensure size is longword aligned
                       5E   38   C2  0E80  3578 	SUBL2	#PRCPOL$C_SIZ,SP	; Make room on stack
                       50   5E   D0  0E83  3579 	MOVL	SP,R0			; Get address of allocated space
                                     0E86  3580 	ASSUME	SDIR$S_PROCINF,EQ,16    ; Use R0 to point to message on stack
                 30 A0   08 A3   7D  0E86  3581 	MOVQ	8(R3),PRCPOL$B_DIRINF+8(R0) ; Process information --
                    28 A0   63   7D  0E8B  3582 	MOVQ	(R3),PRCPOL$B_DIRINF(R0)    ;	16 bytes
                                     0E8F  3583 	ASSUME	SDIR$S_PROCNAM,EQ,16
                 20 A0   08 A1   7D  0E8F  3584 	MOVQ	8(R1),PRCPOL$B_PRCNAM+8(R0) ; Process name --
                    18 A0   61   7D  0E94  3585 	MOVQ	(R1),PRCPOL$B_PRCNAM(R0)    ;	16 bytes
                                     0E98  3586 	ASSUME	SB$T_NODENAME+16  EQ  SB$L_DDB
                 10 A0   08 A4   7D  0E98  3587 	MOVQ	8(R4),PRCPOL$T_NODNAM+8(R0) ; Node name -- 
                    08 A0   64   7D  0E9D  3588 	MOVQ	(R4),PRCPOL$T_NODNAM(R0)    ;   16 bytes
                                     0EA1  3589 	ASSUME	SB$S_SYSTEMID,EQ,6
                 04 A0   04 A2   3C  0EA1  3590 	MOVZWL	4(R2),PRCPOL$W_SYSIDH(R0)   ; System ID --
                       60   62   D0  0EA6  3591 	MOVL	(R2),PRCPOL$L_SYSIDL(R0)    ;	6 bytes
                       54   50   D0  0EA9  3592 	MOVL	R0,R4			; Address of message
                       53   38   9A  0EAC  3593 	MOVZBL	#PRCPOL$C_SIZ,R3	; Length of message
                   00000000'GF   16  0EAF  3594 	JSB	G^EXE$WRTMAILBOX	; Put message into mailbox
                       5E   38   C0  0EB5  3595 	ADDL2	#PRCPOL$C_SIZ,SP	; Clean stack
                                 05  0EB8  3596 	RSB				; On success, disable polling
                       50   01   D0  0EB9  3597 110$:	MOVL	S^#SS$_NORMAL,R0	; Disable polling
                                 05  0EBC  3598 	RSB	
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  86
X-19                            SCS$CANCEL_MBX - Cancel Polling Notifica 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (13)

                                     0EBD  3600 	.SBTTL	SCS$CANCEL_MBX - Cancel Polling Notification Mailbox
                                     0EBD  3601 ;++
                                     0EBD  3602 ;
                                     0EBD  3603 ; FUNCTIONAL DESCRIPTION:
                                     0EBD  3604 ;
                                     0EBD  3605 ;	This routine is called to cancel mailbox delivery of notification
                                     0EBD  3606 ;	when a process name appears in an SCS directory.
                                     0EBD  3607 ;
                                     0EBD  3608 ;	The user of a notification mailbox must call this routine before
                                     0EBD  3609 ;	exiting and before deassigning its channel to the mailbox.  If this
                                     0EBD  3610 ;	constraint is not satisfied, the mailbox may remain forever,
                                     0EBD  3611 ;	undeleted.
                                     0EBD  3612 ;
                                     0EBD  3613 ; CALLING SEQUENCE:
                                     0EBD  3614 ;
                                     0EBD  3615 ;	JSB	SCS$CANCEL_MBX
                                     0EBD  3616 ;	IPL must be in range 0 to IPL$_SCS, IPL$_TIMER
                                     0EBD  3617 ;
                                     0EBD  3618 ; INPUT PARAMETERS:
                                     0EBD  3619 ;
                                     0EBD  3620 ;	R1 is the address of the SPPB
                                     0EBD  3621 ;
                                     0EBD  3622 ; OUTPUT PARAMETERS:
                                     0EBD  3623 ;
                                     0EBD  3624 ;	NONE
                                     0EBD  3625 ;
                                     0EBD  3626 ; COMPLETION CODES:
                                     0EBD  3627 ;
                                     0EBD  3628 ;	R0 contains status
                                     0EBD  3629 ;
                                     0EBD  3630 ; SIDE EFFECTS:
                                     0EBD  3631 ;
                                     0EBD  3632 ;	R0,R1,R2 are destroyed
                                     0EBD  3633 ;
                                     0EBD  3634 ;--
                                     0EBD  3635 
                                     0EBD  3636 	UNIVERSAL_SYMBOL SCS$CANCEL_MBX
                                     0EBD       SCS$CANCEL_MBX::
                                     0EBD  3637 
                                     0EBD  3638 ;SCS$CANCEL_MBX:
                                     0EBD  3639 	LOCK	LOCKNAME=SCS,-		; Lock SCS database
                                     0EBD  3640 		LOCKIPL=#IPL$_SCS,-	; Raise IPL
                                     0EBD  3641 		SAVIPL=-(SP),-		; Save current IPL
                                     0EBD  3642 		PRESERVE=NO		; Don't preserve R0
                       7E   12   DB  0EBD       	 MFPR	S^#PR$_IPL,-(SP)
                0B 00000000'GF   E9  0EC0       	BLBC	G^SMP$GL_FLAGS,30046$
                       50   34   9A  0EC7       	 MOVZBL	S^#SPL$C_SCS,R0
                   00000000'GF   16  0ECA       	 JSB	G^SMP$ACQUIRE
                            03   11  0ED0       	BRB	30047$
                                     0ED2       30046$:
                       12   08   DA  0ED2       		MTPR	S^#IPL$_SCS,S^#PR$_IPL
                                     0ED5       30047$:
                    50   20 A1   D0  0ED5  3643 	MOVL	SPPB$L_CTX(R1),R0	; Mailbox UCB address
                         20 A1   D4  0ED9  3644 	CLRL	SPPB$L_CTX(R1)		; Forget mailbox UCB address
                         70 A0   B7  0EDC  3645 	DECW	UCB$W_REFC(R0)		; Release grip on UCB -- security blanket
                            52   D4  0EDF  3646 	CLRL	R2			; For all systems
                            50   D4  0EE1  3647 	CLRL	R0			;    disable polling
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  87
X-19                            SCS$CANCEL_MBX - Cancel Polling Notifica 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (13)

                          FBEA   30  0EE3  3648 	BSBW	SCS$POLL_MODE		; Disable polling
                                     0EE6  3649 	UNLOCK	LOCKNAME=SCS,-		; Unlock SCS database
                                     0EE6  3650 		NEWIPL=(SP)+,-		; Save current IPL
                                     0EE6  3651 		CONDITION=RESTORE	; Conditionally release spinlock
                0E 00000000'GF   E9  0EE6       	BLBC	G^SMP$GL_FLAGS,30053$
                            50   DD  0EED       	 PUSHL	R0
                       50   34   9A  0EEF       	 MOVZBL	S^#SPL$C_SCS,R0
                   00000000'GF   16  0EF2       	 JSB	G^SMP$RESTORE
                            50 8ED0  0EF8       	 POPL	R0
                                     0EFB       30053$:
                       12   8E   DA  0EFB       	 MTPR	(SP)+,S^#PR$_IPL
                                 05  0EFE  3652 	RSB
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  88
X-19                            SCS$SHUTDOWN - Shutdown all SCS virtual  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (14)

                                     0EFF  3654 	.SBTTL	SCS$SHUTDOWN - Shutdown all SCS virtual circuits
                                     0EFF  3655 ;++
                                     0EFF  3656 ;
                                     0EFF  3657 ; FUNCTIONAL DESCRIPTION:
                                     0EFF  3658 ;
                                     0EFF  3659 ;	This routine runs down the singly linked list of SCS speaking
                                     0EFF  3660 ;	PDT's, calling the associated port driver for each one it finds.
                                     0EFF  3661 ;	The port driver will close all virtual circuits it has outstanding.
                                     0EFF  3662 ;	Control will return upon the port being offline, encountering any
                                     0EFF  3663 ;	errors, or successful termination.
                                     0EFF  3664 ;
                                     0EFF  3665 ; CALLING SEQUENCE:
                                     0EFF  3666 ;
                                     0EFF  3667 ;	JSB	SCS$SHUTDOWN
                                     0EFF  3668 ;	IPL = 31.
                                     0EFF  3669 ;               
                                     0EFF  3670 ; INPUT PARAMETERS:
                                     0EFF  3671 ;
                                     0EFF  3672 ;	NONE
                                     0EFF  3673 ;
                                     0EFF  3674 ; OUTPUT PARAMETERS:
                                     0EFF  3675 ;
                                     0EFF  3676 ;	NONE
                                     0EFF  3677 ;
                                     0EFF  3678 ; COMPLETION CODES:
                                     0EFF  3679 ;
                                     0EFF  3680 ;	NONE
                                     0EFF  3681 ;
                                     0EFF  3682 ; SIDE EFFECTS:
                                     0EFF  3683 ;
                                     0EFF  3684 ;	R0-R4 are destroyed
                                     0EFF  3685 ;
                                     0EFF  3686 ;--
                                     0EFF  3687 
                                     0EFF  3688 	UNIVERSAL_SYMBOL SCS$SHUTDOWN
                                     0EFF       SCS$SHUTDOWN::
                                     0EFF  3689 
                                     0EFF  3690 ;SCS$SHUTDOWN:
              54   00000000'GF   DE  0EFF  3691 	MOVAL	G^SCS$GL_PDT,R4		; Pick up list head of PDT's
                       54   64   D0  0F06  3692 10$:	MOVL	(R4),R4			; Get next entry
                            0D   13  0F09  3693 	BEQL	20$			; There is none
                  00   009C C4   D1  0F0B  3694         CMPL	PDT$L_SHUT_ALL_VC(R4),#0 ; Check for valid module
                            F4   13  0F10  3695 	BEQL	10$			; branch and get next PDT if not
                       009C D4   16  0F12  3696 	JSB	@PDT$L_SHUT_ALL_VC(R4)	; Call the port driver to issue SETCKT to all VC's
                            EE   11  0F16  3697 	BRB	10$			; Loop for next one
                                     0F18  3698 ;
              54   00000000'GF   DE  0F18  3699 20$:	MOVAL	G^SCS$GL_PDT,R4		; Pick up list head of PDT's
                       54   64   D0  0F1F  3700 30$:	MOVL	(R4),R4			; Get next entry
                            06   13  0F22  3701 	BEQL	40$			; There is none
                       0080 D4   16  0F24  3702 	JSB	@PDT$L_STOP_VCS(R4)	; Call the port driver to issue last gasp DG
                            F5   11  0F28  3703 	BRB	30$			; Loop for next one
                                     0F2A  3704 
                                 05  0F2A  3705 40$:	RSB				; Finish, leave
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  89
X-19                            Dynamic load sharing routines            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (15)

                                     0F2B  3707 	.SBTTL	Dynamic load sharing routines
                                     0F2B  3708 ;++
                                     0F2B  3709 ;
                                     0F2B  3710 ;  	The following routines implement load sharing for the following
                                     0F2B  3711 ; configuration: 
                                     0F2B  3712 ; 
                                     0F2B  3713 ;        +--------------+
                                     0F2B  3714 ;        |      |       |                          +-------+
                                     0F2B  3715 ;        |      | PAA0: |___________     __________| HSC #1|
                                     0F2B  3716 ;        |      +-------|           \   /          +-------+
                                     0F2B  3717 ;        | VAX          |            \ /
                                     0F2B  3718 ;        |              |             *
                                     0F2B  3719 ;        |      +-------|            / \           +-------+
                                     0F2B  3720 ;        |      | PAB0: |___________/   \__________| HSC #2|
                                     0F2B  3721 ;        |      |       |                          +-------+
                                     0F2B  3722 ;        +--------------+
                                     0F2B  3723 ;  
                                     0F2B  3724 ; 
                                     0F2B  3725 ;  	In the above drawing, the VAX is a large VAX qualified for two or
                                     0F2B  3726 ; more CI ports. This VAX communicates with two or more servers, such as
                                     0F2B  3727 ; HSC's. 
                                     0F2B  3728 ; 
                                     0F2B  3729 ;	Load sharing initialization consists of several stages, SCS initialization,
                                     0F2B  3730 ; port initialization, virtual circuit initialization and connection 
                                     0F2B  3731 ; initialization. First, at SCS initialization time, all queues and global
                                     0F2B  3732 ; data structures for load sharing are initialized and the
                                     0F2B  3733 ; load sharing timer queue entry is started. This will start the first load
                                     0F2B  3734 ; sharing interval.
                                     0F2B  3735 ;
                                     0F2B  3736 ;	Port initialization for load sharing consists of two parts (only
                                     0F2B  3737 ; the CI ports are initialized for load sharing).  The address of the PDT 
                                     0F2B  3738 ; for a port must be entered into the SCS Load Sharing PDT List and the 
                                     0F2B  3739 ; corresponding port bit in the SCS Load Sharing Port Bit Map set. Each
                                     0F2B  3740 ; bit position in the bit map can be used to index into the Load Sharing
                                     0F2B  3741 ; PDT List to find the PDT address of the corresponding port. All load 
                                     0F2B  3742 ; sharing queues defined in the PDT must be initialized.
                                     0F2B  3743 ; The load sharing threshold values for normal, yellow and red ranges of
                                     0F2B  3744 ; this particular port type must be calculated and copied into the
                                     0F2B  3745 ; corresponding PDT fields.
                                     0F2B  3746 ;
                                     0F2B  3747 ;	When a new System Block (SB) and its Path Block (PB) are formed, 
                                     0F2B  3748 ; the SB's Load Sharing Port Bit Map field will be cleared except for 
                                     0F2B  3749 ; the bit corresponding to the current/local port over which this path was 
                                     0F2B  3750 ; formed. From then on, whenever a new PB is added or deleted from this 
                                     0F2B  3751 ; System Block, the corresponding port bit should be set or reset in 
                                     0F2B  3752 ; the SB's Port Bit Map respectively.
                                     0F2B  3753 ;
                                     0F2B  3754 ;	Note that the SB's Port Bit Map is always a subset of the
                                     0F2B  3755 ; SCS Load Share Port Bit Map.  These bit maps are only for
                                     0F2B  3756 ; those ports which support load sharing.
                                     0F2B  3757 ;
                                     0F2B  3758 ;	In addition, the pointer to the new PB should be inserted into 
                                     0F2B  3759 ; the corresponding PDT's doubly linked list of PBs and it should be 
                                     0F2B  3760 ; dequeued when the path goes away.
                                     0F2B  3761 ;
                                     0F2B  3762 ;	When a connection is opening, the connecting
                                     0F2B  3763 ; CDT is inserted at the tail of the PDT's Load Share Wait Queue  and
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  90
X-19                            Dynamic load sharing routines            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (15)

                                     0F2B  3764 ; timestamped to mark the connection open. At each load sharing interval,
                                     0F2B  3765 ; this timestamp is subtracted from the current time and if the elapsed
                                     0F2B  3766 ; time is greater than or equal to the Minimum Connection Wait Interval,
                                     0F2B  3767 ; this CDT will be dequeued from the Load Share Wait Queue and inserted
                                     0F2B  3768 ; at the tail of the Load Share Yellow, Red, or Disabled Queue depending
                                     0F2B  3769 ; on its current Connection Load Rating value. 
                                     0F2B  3770 ;
                                     0F2B  3771 ;	When a system initially boots up, all port loads will be below the minimum
                                     0F2B  3772 ; thruput threshold necessary to require load sharing to begin. While all 
                                     0F2B  3773 ; ports are below this threshold (the port I/O load is in the normal range) new 
                                     0F2B  3774 ; connections will be assigned to a port based on the number of connections 
                                     0F2B  3775 ; and the type of SYSAP which has established the connection. This will 
                                     0F2B  3776 ; insure that initially not only will the number of connections be evenly 
                                     0F2B  3777 ; distributed across all of a systems CI ports but the type of
                                     0F2B  3778 ; connections (based on SYSAP name) are evenly distributed as well.
                                     0F2B  3779 ;
                                     0F2B  3780 ;	After initialization has been completed, the I/O port load will 
                                     0F2B  3781 ; be periodically examined to determine if load sharing 
                                     0F2B  3782 ; is required. Load sharing is performed independently on each load sharing
                                     0F2B  3783 ; domain in the system. A load sharing domain consists of the set of ports
                                     0F2B  3784 ; in the system which support load sharing and have at least one VC to a 
                                     0F2B  3785 ; common remote system. Multiple load sharing domains may exist in a single
                                     0F2B  3786 ; system.  A SCS port can belong to only one load sharing domain. 
                                     0F2B  3787 ; Connections are only moved between ports belonging to the same domain.
                                     0F2B  3788 ;
                                     0F2B  3789 ;	If the I/O load for any ports in a load sharing domain 
                                     0F2B  3790 ; have not exceeded the minimum thruput threshold (remains in the normal 
                                     0F2B  3791 ; range) during the last time interval, load sharing will not be attempted. 
                                     0F2B  3792 ;
                                     0F2B  3793 ;	A port which exceeds the minimum thruput threshold will first 
                                     0F2B  3794 ; attempt to move enough connections to bring the port load below the 
                                     0F2B  3795 ; threshold without raising the load of any other ports above the threshold. 
                                     0F2B  3796 ; Failing this, the port must calculate the ports fair share of the I/O load
                                     0F2B  3797 ; to determine if load sharing is required. 
                                     0F2B  3798 ;
                                     0F2B  3799 ;	The ports fair share of the I/O load is the percentage of 
                                     0F2B  3800 ; the total I/O transfer for all ports in the same load sharing domain
                                     0F2B  3801 ; which should occur equally  across all ports.  The fair share of a port 
                                     0F2B  3802 ; for each domain will be independently calculated. 
                                     0F2B  3803 ;
                                     0F2B  3804 ;	I/O load is calculated as the total number of bytes transmitted or received 
                                     0F2B  3805 ; through all CI ports in the same load sharing domain divided by the number 
                                     0F2B  3806 ; of ports. If the ports load is greater than its fair share plus
                                     0F2B  3807 ; a load sharing tolerance threshold, it must begin to request SYSAP's to
                                     0F2B  3808 ; disconnect. The purpose of the load sharing tolerance threshold is to minimize
                                     0F2B  3809 ; sensitivity to minor variations in a ports load. Enough connections must 
                                     0F2B  3810 ; be requested to disconnect to bring the port to within it's fair share of the 
                                     0F2B  3811 ; load +/- the load sharing threshold value. 
                                     0F2B  3812 ;
                                     0F2B  3813 ;	Ports in a load sharing domain, in which all available ports are 
                                     0F2B  3814 ; loaded above the minimum thruput threshold (yellow or red ranges), have a 
                                     0F2B  3815 ; load disproportion equal to the difference between the current port I/O 
                                     0F2B  3816 ; load and the ports fair share. In a system where there is sufficient 
                                     0F2B  3817 ; thruput available in ports loaded in the normal range, the port's load 
                                     0F2B  3818 ; disproportion is the difference between its current port I/O load and 
                                     0F2B  3819 ; the minimum thruput threshold.
                                     0F2B  3820 ;
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  91
X-19                            Dynamic load sharing routines            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (15)

                                     0F2B  3821 ;	Connections are eligible to be moved for load sharing based on 
                                     0F2B  3822 ; the length of time since they were established, the time since they 
                                     0F2B  3823 ; were last requested to move, and on the assigned load rating
                                     0F2B  3824 ; a connection receives from a SYSAP. A connection is not eligible to participate
                                     0F2B  3825 ; in load sharing until it has been established for the minimal connection wait
                                     0F2B  3826 ; interval. The minimum connection wait interval is intended to
                                     0F2B  3827 ; prevent the possibility of any thrashing of connections as they are initiallly
                                     0F2B  3828 ; established in the system. A connection is also not eligible to participate in
                                     0F2B  3829 ; load sharing until the minimum connection wait interval has passed since
                                     0F2B  3830 ; it was last requested to be moved. This will prevent the same connection from 
                                     0F2B  3831 ; being repeatedly requested to move but for some reason is not being
                                     0F2B  3832 ; disconnected by the SYSAP. 
                                     0F2B  3833 ;
                                     0F2B  3834 ;	Determining which connections to request to disconnect is the hard part. In
                                     0F2B  3835 ; each CDT will be the sum total of all data transfered during the last Load
                                     0F2B  3836 ; Sharing Interval.  SCS load sharing will attempt to move
                                     0F2B  3837 ; a connection from the current most loaded port to the least loaded port (the 
                                     0F2B  3838 ; port with the most thruput available). All CDT's existing on VCs of the
                                     0F2B  3839 ; most loaded port shared will be searched to find the "best" connection 
                                     0F2B  3840 ; to move. The "best" connection is a connection which most closely matches 
                                     0F2B  3841 ; the available thruput of the least loaded port. In order for a connection to 
                                     0F2B  3842 ; be eligible to be moved, it must have a connection load rating less than or 
                                     0F2B  3843 ; equal to the ports load rating.   SCS will look for an eligible connection which has
                                     0F2B  3844 ; the largest I/O load less than or equal to the current port disproportion.
                                     0F2B  3845 ; When a connection has been selected that connection is placed on the disconnect
                                     0F2B  3846 ; queue and the available thruput of the two ports are updated to
                                     0F2B  3847 ; reflect the load of the connection. The address of the path block describing
                                     0F2B  3848 ; the VC between the remote system and new port is set in the CDT.
                                     0F2B  3849 ;
                                     0F2B  3850 ;	More than one connection might be required to be
                                     0F2B  3851 ; moved to complete load sharing for this load sharing domain. 
                                     0F2B  3852 ; A new most loaded port and least loaded port are selected and
                                     0F2B  3853 ; the "best" connection is again searched for. This is repeated until
                                     0F2B  3854 ; SCS has attempted to distribute equivalent loads across
                                     0F2B  3855 ; all the ports in this domain. This process is performed for each load
                                     0F2B  3856 ; sharing domain in a system.  SCS will restrict the number of
                                     0F2B  3857 ; connections which can be requested to move during any time interval.
                                     0F2B  3858 ;
                                     0F2B  3859 ;	When SCS has completed the selection of all candidate connections to be moved,
                                     0F2B  3860 ; it will call the MOVE_PATH routine in each CDT on the disconnect queue. The SYSAP
                                     0F2B  3861 ; for each MOVE_PATH routine, will issue a disconnect on the connection. SCS will
                                     0F2B  3862 ; perform normal disconnect processing except for deallocating the CDT. The CDT
                                     0F2B  3863 ; will be placed in the reuse CDT queue. After disconnecting, the SYSAP should
                                     0F2B  3864 ; issue a connect request. SCS will first search the REUSE queue for a CDT
                                     0F2B  3865 ; with the same SYSAP index and a path block to the desired remote system. If
                                     0F2B  3866 ; a CDT is not found, one is allocated and a search is made for an available
                                     0F2B  3867 ; path block. The CDT reuse queue is flushed of any CDTs after one load sharing
                                     0F2B  3868 ; interval.
                                     0F2B  3869 ;
                                     0F2B  3870 ;	A system receiving a disconnect request with a status of USE_ALTERNATE_PORT
                                     0F2B  3871 ; will also save the CDT on the CDT REUSE queue instead of deallocating it.
                                     0F2B  3872 ; When the system receives a CONNECT REQUEST it will determine  if this  is 
                                     0F2B  3873 ; the "best" port to make the connection across before starting to establish 
                                     0F2B  3874 ; the connection. If a CDT is found corresponding to
                                     0F2B  3875 ; the same SYSAP and receiving port on the REUSE queue, the request is processed.
                                     0F2B  3876 ; If it is not the "best" port the receiving system will
                                     0F2B  3877 ; return a connect response PPD with a status of USE ALTERNATE PORT and include
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  92
X-19                            Dynamic load sharing routines            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (15)

                                     0F2B  3878 ; the address of the "best" remote port. The initiating system will issue the
                                     0F2B  3879 ; connect request again using the address of the alternate port without
                                     0F2B  3880 ; involvement of the SYSAP.
                                     0F2B  3881 ;
                                     0F2B  3882 ;	After a port has been involved in load sharing, it must wait the
                                     0F2B  3883 ; minimum port wait interval before the port is available to participate
                                     0F2B  3884 ; in load sharing again.      
                                     0F2B  3885 ; 
                                     0F2B  3886 ;--
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  93
X-19                            Dynamic Load Sharing Database            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (16)

                                     0F2B  3888 	.SBTTL	Dynamic Load Sharing Database
                                     0F2B  3889 
                                     0F2B  3890 	DECLARE_PSECT	EXEC$NONPAGED_DATA
                                 00000006       	.PSECT	EXEC$NONPAGED_DATA,QUAD,WRT,NOEXE,PIC
                                     0006  3891 ;+
                                     0006  3892 ;
                                     0006  3893 ;  TQE control variables
                                     0006  3894 ;
                                     0006  3895 ;  (TYC 16-Feb-89) These variables control the work of the SCS load sharing
                                     0006  3896 ;  Timer Queue Routine which becomes active every SCS$GL_LOAD_SHARE_INTERVAL.
                                     0006  3897 ;
                                     0006  3898 ;-
                                     0006  3899 	.align long
                                     0008  3900 SCS_L_SHARE_TQE:			; Saved load sharing TQE when Nonzero.
                           00000000  0008  3901 	.LONG	0			;  When zero, means that the TQE has
                                     000C  3902 					;  already been queued
                                     000C  3903 					;
                                     000C  3904 SCS_VECTOR_FLAG:			; Load vector check flag
                           00000000  000C  3905 	.LONG	0			; Bit 0 of this flag is set whenever
                                     0010  3906 					;  there is a failure to get the port
                                     0010  3907 					;  load vector
                                     0010  3908 					; Bit 1 of this flag is set whenever
                                     0010  3909 					;  there is a bugcheck so that multiple
                                     0010  3910 					;  nonfatal bugchecks during the 
                                     0010  3911 					;  incarnation of the system will be 
                                     0010  3912 					;  prevented.
                                     0010  3913 ;+
                                     0010  3914 ;
                                     0010  3915 ;    Load sharing internal variables
                                     0010  3916 ;
                                     0010  3917 ;    These are variables used when calculating and maintaining various
                                     0010  3918 ;    values used at each port load share interval.
                                     0010  3919 ;
                                     0010  3920 ;	PORT_FAIR_SHARE -- The percentage of the total I/O transfer
                                     0010  3921 ;	in bytes encompassing a set of ports which should occur equally
                                     0010  3922 ;	across all ports.  The set of ports defines a load sharing
                                     0010  3923 ;	domain and includes all ports which have a VC to at least
                                     0010  3924 ;	one common remote system.  The port fair share is calculated
                                     0010  3925 ;	as follows:
                                     0010  3926 ;
                                     0010  3927 ;	If all ports have the same port type,
                                     0010  3928 ;
                                     0010  3929 ;				   Total System Load
                                     0010  3930 ;		PORT_FAIR_SHARE = ---------------------
                                     0010  3931 ;				   Number of Ports
                                     0010  3932 ;
                                     0010  3933 ;	Fair share for a particular port type (i.e. CIXCD port) is
                                     0010  3934 ;
                                     0010  3935 ;		PORT_FAIR_SHARE = (Max. CIXCD throughput) * (% of Current System Load)
                                     0010  3936 ;
                                     0010  3937 ;	where % of Current System Load can be calculated as,
                                     0010  3938 ;
                                     0010  3939 ;					    Total Current System Load
                                     0010  3940 ;		% of Current System Load = ---------------------------
                                     0010  3941 ;					    Maximum Total System Load
                                     0010  3942 ;
                                     0010  3943 ;	AVAILABLE_THRUPUT_PORTS -- A 32-bit map which is a subset of the
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  94
X-19                            Dynamic Load Sharing Database            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (16)

                                     0010  3944 ;	current load sharing domain's port bit map.  It is used at load
                                     0010  3945 ;	sharing interval to keep track of ports which have available
                                     0010  3946 ;	throughputs and thus are candidates to get re-established 
                                     0010  3947 ;	connections in order to off-load connections from ports which
                                     0010  3948 ;	are excessively loaded.
                                     0010  3949 ;
                                     0010  3950 ;		Port's Available Throughput = - Excess Throughput
                                     0010  3951 ;	where
                                     0010  3952 ;		Excess Throughput = MINIMUM (port load - YELLOW threshold,
                                     0010  3953 ;				port load - (PORT_FAIR_SHARE+port tolerance threshold))	 
                                     0010  3954 ;
                                     0010  3955 ;-
                                     0010  3956 PORT_FAIR_SHARE:			; Port fair share in bytes
                           00000000  0010  3957 	.LONG	0			;
                                     0014  3958 					;
                                     0014  3959 AVAILABLE_THRUPUT_PORTS:		; 32-bit port map.  If a bit set,
                           00000000  0014  3960 	.LONG	0			;  the corresponding port has
                                     0018  3961 					;  available throughput.
                                     0018  3962 					;
                                     0018  3963 LS_DOMAIN_PORTS:			; 32-bit port map indicating which
                           00000000  0018  3964 	.LONG	0			;   ports in the current load sharing
                                     001C  3965 					;   domain are excessively loaded and
                                     001C  3966 					;   thus need to be load shared.
                                     001C  3967 					;
                                     001C  3968 NUM_DISCONNECT:				; Number of connections to be disconnected
                                 00  001C  3969 	.BYTE	0			; for this domain
                                     001D  3970 ;+
                                     001D  3971 ;
                                     001D  3972 ;	Load sharing performance counters 
                                     001D  3973 ;
                                     001D  3974 ;-
                                     001D  3975 SCS$GL_LOAD_SHARE_COUNTERS::		; SCS load sharing counter listhead
                                     001D  3976 SHARE_TIMER_COUNT:			; Number of TQE activations, i.e. # of
                           00000000  001D  3977 	.LONG	0			;  of load sharing intervals elapsed
                                     0021  3978 					;  This is used with conditional assembly
                                     0021  3979 
                                     0021  3980 					;
                                     0021  3981 EMB_BUFFER:				; (TYC 26-May-89) error log buffer addr
                           00000000  0021  3982 	.LONG	0			;  Used only with conditional assembly
                                     0025  3983 EMB_CURRENT:				; (TYC 26-May-89) current loc. in EMB_BUFFER
                           00000000  0025  3984 	.LONG	0			;  Used only with conditional assembly
                                     0029  3985 EQUAL_PATH_CALL_COUNT:			; Number of equal path move requests
                           00000000  0029  3986 	.LONG	0
                                     002D  3987 UNEQUAL_PATH_CALL_COUNT:		; Number of unequal path move requests
                           00000000  002D  3988 	.LONG	0
                                     0031  3989 CONNECTION_MOVE_COUNT:			; (TYC 4-JAN-89) Number of connection moves we request
                           00000000  0031  3990 	.LONG	0
                                     0035  3991 LOAD_SHARE_BUGCHECK_COUNT:		; (TYC 3-JAN-89) Number of bad connection load ratings
                           00000000  0035  3992 	.LONG	0
                                     0039  3993 LOAD_SHARE_BEG_TIME:			; (TYC 26-Apr-89) Timestamp for beg. of load sharing 
                           00000000  0039  3994 	.LONG	0			;  interval
                                     003D  3995 LOAD_SHARE_END_TIME:			; (TYC 26-Apr-89) Timestamp for end of load sharing 
                           00000000  003D  3996 	.LONG	0			;  interval
                                     0041  3997 
                                     0041  3998 ;+
                                     0041  3999 ;
                                     0041  4000 ;    Defined Constants
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  95
X-19                            Dynamic Load Sharing Database            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (16)

                                     0041  4001 ;
                                     0041  4002 ;	The connection rating is defined by:
                                     0041  4003 ;
                                     0041  4004 ;		R = T + FAC*C
                                     0041  4005 ;
                                     0041  4006 ;	Where T is the total number of connections on the port; C is the
                                     0041  4007 ;	number of connections of the same type on the port; and FAC is
                                     0041  4008 ;	an arbitrary factor (in this case SCS_C_RATING_FACTOR).  This rating 
                                     0041  4009 ;	method guarantees that priority is given first to balancing 
                                     0041  4010 ;	connections of the same type as the new connection and second to 
                                     0041  4011 ;	balancing the total number of connections for static load sharing.
                                     0041  4012 ;
                                     0041  4013 ;-
                           00000008  0041  4014 	SCS_V_RATING_FACTOR = 8			; Rating factor bit position
                           00000100  0041  4015 	SCS_C_RATING_FACTOR = 1@SCS_V_RATING_FACTOR	; Rating factor
                                     0041  4016 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  96
X-19                            Dynamic Load Sharing Database            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (18)

                                     0041  4018 
                                     0041  4019 ;+
                                     0041  4020 ; (TYC0016) Effective Bandwidths of CI Ports
                                     0041  4021 ;
                                     0041  4022 ; The following arrays constitute the effective bandwidths table for CI ports.
                                     0041  4023 ; This table is used for calculating the effective bandwidth (instead of raw bandwidth)
                                     0041  4024 ; of a CI port at each load sharing interval given the average transfer size 
                                     0041  4025 ; of block data.  The bandwidths are in MB/sec unit.  CIXCD values are estimated values
                                     0041  4026 ; for now.
                                     0041  4027 ;
                                     0041  4028 ; (TYC0018) Add KFMSA entries in the table.  For now just put 1.0 for all size since
                                     0041  4029 ; we don't know the measurement yet for this adapter.  Also put a default table
                                     0041  4030 ; entries to be used for any unknown CI port types since we don't want to leave them
                                     0041  4031 ; undefined when calculating load shares.
                                     0041  4032 ;
                                     0041  4033 ;				Transfer size
                                     0041  4034 ;	------------------------------------------------------------------------------------
                                     0041  4035 ; Type	   0.5KB	1.0KB	   2.0KB	4.0KB	   8.0KB	16.0KB	  32.0KB
                                     0041  4036 ; ------------------------------------------------------------------------------------------
                                     0041  4037 ; CI780	   0.57		1.00	   1.56		2.00	   2.30		2.50	  2.60
                                     0041  4038 ; CIBCI	   0.45		0.66	   0.87		1.00	   NA		NA	  NA
                                     0041  4039 ; CIBCAA   0.45		0.76	   1.04		1.10	   1.10		1.20	  1.20
                                     0041  4040 ; CIBCAB   0.54		0.93	   1.48		1.70	   2.00		2.30	  2.50
                                     0041  4041 ; CIXCD	   2.10		3.60	   5.70		NA	   7.50		7.50	  7.50	
                                     0041  4042 ; KFMSA	   1.00		1.40	   1.70		2.10	   2.60		2.60      2.67
                                     0041  4043 ; DEFAULT  0.45		0.66	   1.00		1.00	   1.00		1.00	  1.00
                                     0041  4044 ; ------------------------------------------------------------------------------------------
                                     0041  4045 ;-
                           00000006  0041  4046 SCS_C_EB_MAX_INDEX = 6			; Total of 7 items in an array
                                     0041  4047 
                                     0041  4048 SCS$L_EB_TBL::				; CI ports Effective Bandwidths table arrays				
                                     0041  4049 TRANSFER_SIZE:				; Transfer size index array
                           00000200  0041  4050 	.LONG	512			; 0.5 KB
                           00000400  0045  4051 	.LONG	1024			; 1.0 KB
                           00000800  0049  4052 	.LONG	2048			; 2.0 KB                                 
                           00001000  004D  4053 	.LONG	4096			; 4.0 KB
                           00002000  0051  4054 	.LONG	8192			; 8.0 KB
                           00004000  0055  4055 	.LONG	16384			; 16.0 KB
                           00008000  0059  4056 	.LONG	32768			; 32.0 KB
                                     005D  4057 
                                     005D  4058 CI780_EB:				; CI780 EB array
                           0008B290  005D  4059 	.LONG	 570000			; 0.57 MBytes/second
                           000F4240  0061  4060 	.LONG	1000000			; 1.00 MBytes/second
                           0017CDC0  0065  4061 	.LONG	1560000			; 1.56 MBytes/second
                           001E8480  0069  4062 	.LONG	2000000			; 2.00 MBytes/second
                           00231860  006D  4063 	.LONG	2300000			; 2.30 MBytes/second
                           002625A0  0071  4064 	.LONG	2500000			; 2.50 MBytes/second
                           0027AC40  0075  4065 	.LONG	2600000			; 2.60 MBytes/second
                                     0079  4066 
                                     0079  4067 CIBCI_EB:				; CIBCI EB array                         
                           0006DDD0  0079  4068 	.LONG	 450000			; 0.45 MBytes/second
                           000A1220  007D  4069 	.LONG	 660000			; 0.66 MBytes/second
                           000D4670  0081  4070 	.LONG	 870000			; 0.87 MBytes/second
                           000F4240  0085  4071 	.LONG	1000000			; 1.00 MBytes/second
                           000F4240  0089  4072 	.LONG	1000000			; 1.00 MBytes/second
                           000F4240  008D  4073 	.LONG	1000000			; 1.00 MBytes/second
                           000F4240  0091  4074 	.LONG	1000000			; 1.00 MBytes/second
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  97
X-19                            Dynamic Load Sharing Database            13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (18)

                                     0095  4075 
                                     0095  4076 CIBCAA_EB:				; CIBCAA EB array
                           0006DDD0  0095  4077 	.LONG	 450000			; 0.45 MBytes/second
                           000B98C0  0099  4078 	.LONG	 760000			; 0.76 MBytes/second
                           000FDE80  009D  4079 	.LONG	1040000			; 1.04 MBytes/second
                           0010C8E0  00A1  4080 	.LONG	1100000			; 1.10 MBytes/second
                           0010C8E0  00A5  4081 	.LONG	1100000			; 1.10 MBytes/second
                           00124F80  00A9  4082 	.LONG	1200000			; 1.20 MBytes/second                     
                           00124F80  00AD  4083 	.LONG	1200000			; 1.20 MBytes/second
                                     00B1  4084 
                                     00B1  4085 CIBCAB_EB:				; CIBCAB EB array
                           00083D60  00B1  4086 	.LONG	 540000			; 0.54 MBytes/second
                           000E30D0  00B5  4087 	.LONG	 930000			; 0.93 MBytes/second
                           00169540  00B9  4088 	.LONG	1480000			; 1.48 MBytes/second
                           0019F0A0  00BD  4089 	.LONG	1700000			; 1.70 MBytes/second
                           001E8480  00C1  4090 	.LONG	2000000			; 2.00 MBytes/second
                           00231860  00C5  4091 	.LONG	2300000			; 2.30 MBytes/second
                           002625A0  00C9  4092 	.LONG	2500000			; 2.50 MBytes/second
                                     00CD  4093 
                                     00CD  4094 CIXCD_EB:				; CIXCD EB array
                           00200B20  00CD  4095 	.LONG	2100000			; 2.10 MBytes/second
                           0036EE80  00D1  4096 	.LONG	3600000			; 3.60 MBytes/second
                           0056F9A0  00D5  4097 	.LONG	5700000			; 5.70 MBytes/second                     
                           00602160  00D9  4098 	.LONG	6300000			; 6.30 MBytes/second
                           007270E0  00DD  4099 	.LONG	7500000			; 7.50 MBytes/second
                           007270E0  00E1  4100 	.LONG	7500000			; 7.50 MBytes/second
                           007270E0  00E5  4101 	.LONG	7500000			; 7.50 MBytes/second
                                     00E9  4102 
                                     00E9  4103 ; (TYC0018)
                                     00E9  4104 KFMSA_EB:				; KFMSA EB array
                           000F4240  00E9  4105 	.LONG	1000000			; 1.00 MBytes/second
                           00155CC0  00ED  4106 	.LONG	1400000			; 1.00 MBytes/second
                           0019F0A0  00F1  4107 	.LONG	1700000			; 1.00 MBytes/second
                           002191C0  00F5  4108 	.LONG	2200000			; 1.00 MBytes/second
                           0027AC40  00F9  4109 	.LONG	2600000			; 1.00 MBytes/second
                           0027AC40  00FD  4110 	.LONG	2600000			; 1.00 MBytes/second
                           0027AC40  0101  4111 	.LONG	2600000			; 1.00 MBytes/second
                                     0105  4112 
                                     0105  4113 DEFAULT_EB:				; DEFAULT EB array
                           000F4240  0105  4114 	.LONG	1000000			; 0.45 MBytes/second
                           00155CC0  0109  4115 	.LONG	1400000			; 0.66 MBytes/second
                           0019F0A0  010D  4116 	.LONG	1700000			; 1.00 MBytes/second
                           002191C0  0111  4117 	.LONG	2200000			; 1.00 MBytes/second
                           002625A0  0115  4118 	.LONG	2500000			; 1.00 MBytes/second
                           002625A0  0119  4119 	.LONG	2500000			; 1.00 MBytes/second
                           002625A0  011D  4120 	.LONG	2500000			; 1.00 MBytes/second
                                     0121  4121 			
                                     0121  4122 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  98
X-19                            - New Connection Processing              13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (19)

                                     0121  4124 	.SBTTL	-	New Connection Processing
                                     0121  4125 	.SBTTL	-		SCS_REGISTER_LOCAL_NAME - assign index to name
                                     0121  4126 
                                     0121  4127 	DECLARE_PSECT	EXEC$NONPAGED_CODE
                                 00000F2B       	.PSECT	EXEC$NONPAGED_CODE,LONG,NOWRT,EXE,PIC
                                     0F2B  4128 ;+
                                     0F2B  4129 ;  SCS_REGISTER_LOCAL_NAME - register a local process name
                                     0F2B  4130 ; 
                                     0F2B  4131 ; FUNCTIONAL DESCRIPTION:
                                     0F2B  4132 ;
                                     0F2B  4133 ;	This routine scans the directory of local names for the specified
                                     0F2B  4134 ;	process name.  If found, the routine copies the name index to the
                                     0F2B  4135 ;	CDT.  If not found, the routine assigns a new index and copies
                                     0F2B  4136 ;	that index to the CDT.  If no additional indices are  available,
                                     0F2B  4137 ;	the highest index is used for all remaining SYSAP's.
                                     0F2B  4138 ;
                                     0F2B  4139 ; CALLING SEQUENCE:
                                     0F2B  4140 ;
                                     0F2B  4141 ;	BSBW	SCS_REGISTER_LOCAL_NAME
                                     0F2B  4142 ;
                                     0F2B  4143 ; INPUT PARAMETERS:
                                     0F2B  4144 ;
                                     0F2B  4145 ;	R0	- address of the SYSAP's local name
                                     0F2B  4146 ;	R3	- address of the CDT.
                                     0F2B  4147 ;
                                     0F2B  4148 ; OUTPUT PARAMETERS:
                                     0F2B  4149 ;
                                     0F2B  4150 ;	NONE
                                     0F2B  4151 ;
                                     0F2B  4152 ; COMPLETION CODES:
                                     0F2B  4153 ;
                                     0F2B  4154 ;	NONE
                                     0F2B  4155 ;
                                     0F2B  4156 ; SIDE EFFECTS:
                                     0F2B  4157 ;
                                     0F2B  4158 ;	All registers are preserved.
                                     0F2B  4159 ;	A new SBNB may be added to the local SYSAP name queue.
                                     0F2B  4160 ;-
                                     0F2B  4161 	.enable lsb
                                     0F2B  4162 SCS_REGISTER_LOCAL_NAME:
                            3F   BB  0F2B  4163 	PUSHR	#^M<R0,R1,R2,R3,R4,R5>	; Save some registers
              54   00000000'GF   7E  0F2D  4164 	MOVAQ	G^SCS$GQ_LOCAL_NAMES,R4	; Get the local name listhead
                       55   54   D0  0F34  4165 	MOVL	R4,R5			; Copy for reference
                       55   65   D0  0F37  4166 10$:	MOVL	(R5),R5			; Get next entry
                       54   55   D1  0F3A  4167 	CMPL	R5,R4			; End of list?
                            0E   13  0F3D  4168 	BEQL	20$
                    00 BE   10   29  0F3F  4169 	CMPC3	#SBNB$S_PROCNAM,@(SP),-	; Same name?
                         0C A5       0F43  4170 		SBNB$B_PROCNAM(R5)
                            F0   12  0F45  4171 	BNEQ	10$			; No, look for more
                         1C A5   3C  0F47  4172 	MOVZWL	SBNB$W_LOCAL_INDEX(R5),- ; Get the index
                            51       0F4A  4173 		R1
                            4A   11  0F4B  4174 	BRB	40$			; Yes, done
              51   00000000'GF   3C  0F4D  4175 20$:	MOVZWL	G^SCS$GW_NEXT_INDEX,R1	; Get the next index
                       51   0A   B1  0F54  4176 	CMPW	#PLVEC$C_MAX_INDEX,R1	; All indices allocated?
                            3E   13  0F57  4177 	BEQL	40$			; Yes, use the maximum
                       51   24   3C  0F59  4178 	MOVZWL	#SBNB$K_LENGTH,R1	; Get the name block length
                   00000000'GF   16  0F5C  4179 	JSB	G^EXE$ALONONPAGED	; Allocate some pool
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page  99
X-19                            -  SCS_REGISTER_LOCAL_NAME - assign inde 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (19)

                         2F 50   E9  0F62  4180 	BLBC	R0,30$			; None - just use the maximum index
                    08 A2   51   B0  0F65  4181 	MOVW	R1,SBNB$W_SIZE(R2)	; Save the size
                                 B0  0F69  4182 	MOVW	#DYN$C_SCS-		; Store the type/subtype
                                     0F6A  4183 		!<DYN$C_SCS_SBNB@8>,-
               0A A2   0A60 8F       0F6A  4184 		SBNB$B_TYPE(R2)
                            52   DD  0F6F  4185 	PUSHL	R2			; Save the address
                    04 BE   10   28  0F71  4186 	MOVC3	#SBNB$S_PROCNAM,@4(SP),-
                         0C A2       0F75  4187 		SBNB$B_PROCNAM(R2)	; Copy over the process name
                            55 8ED0  0F77  4188 	POPL	R5			; Restore SBNB to R5
              00000000'GF   65   0E  0F7A  4189 	INSQUE	(R5),G^SCS$GQ_LOCAL_NAMES ; Insert it on the queue
              51   00000000'GF   3C  0F81  4190 	MOVZWL	G^SCS$GW_NEXT_INDEX,R1	; Obtain the local index
                    1C A5   51   B0  0F88  4191 	MOVW	R1,SBNB$W_LOCAL_INDEX(R5) ; and fill it in
                   00000000'GF   B6  0F8C  4192 	INCW	G^SCS$GW_NEXT_INDEX	; Point to the next
                            03   11  0F92  4193 	BRB	40$			; And save it in the CDT
                       51   0A   3C  0F94  4194 30$:	MOVZWL	#PLVEC$C_MAX_INDEX,R1	; Pool failure - Pin at the maximum
                    53   0C AE   D0  0F97  4195 40$:	MOVL	12(SP),R3		; Restore R3
                  0154 C3   51   B0  0F9B  4196 	MOVW	R1,CDT$W_LOCAL_INDEX(R3); Copy the index
                            3F   BA  0FA0  4197 	POPR	#^M<R0,R1,R2,R3,R4,R5>	; Restore all registers
                                 05  0FA2  4198 	RSB				;  and return
                                     0FA3  4199 	.disable lsb
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 100
X-19                            -  SCS_SELECT_PATH - find a path for a n 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (20)

                                     0FA3  4201 	.SBTTL	-		SCS_SELECT_PATH - find a path for a new cnx
                                     0FA3  4202 ;+
                                     0FA3  4203 ;	This routine scans the available path blocks searching for one that
                                     0FA3  4204 ;	meets the following criteria:
                                     0FA3  4205 ;
                                     0FA3  4206 ;	a.  The path block must be open
                                     0FA3  4207 ;	b.  The port must be at the maximum load class
                                     0FA3  4208 ;	c.  The port must have the minimum connection rating for
                                     0FA3  4209 ;	    the load class
                                     0FA3  4210 ;	
                                     0FA3  4211 ;	The connection rating is defined by:
                                     0FA3  4212 ;
                                     0FA3  4213 ;		R = T + FAC*C
                                     0FA3  4214 ;
                                     0FA3  4215 ;	Where T is the total number of connections on the port; C is the
                                     0FA3  4216 ;	number of connections of the same type on the port; and FAC is
                                     0FA3  4217 ;	an arbitrary factor (in this case SCS_C_RATING_FACTOR).  This rating 
                                     0FA3  4218 ;	method guarantees that priority is given first to balancing 
                                     0FA3  4219 ;	connections of the same type as the new connection and second to 
                                     0FA3  4220 ;	balancing the total number of connections.
                                     0FA3  4221 ;
                                     0FA3  4222 ;	In the special case where the connection rating can not be calculated
                                     0FA3  4223 ;	because the PDT is of the pre-V5.2 format, then the first available
                                     0FA3  4224 ;	open path block will be used.
                                     0FA3  4225 ;
                                     0FA3  4226 ;	Inputs
                                     0FA3  4227 ;		R1 = SB
                                     0FA3  4228 ;		R3 = CDT
                                     0FA3  4229 ;
                                     0FA3  4230 ;	Outputs
                                     0FA3  4231 ;		R0 = SS$_NORMAL or SS$_UNREACHABLE
                                     0FA3  4232 ;		R4 = PB if success
                                     0FA3  4233 ;-		R1,R2 - destroyed
                                     0FA3  4234 	.enable lsb
                                     0FA3  4235 SCS_SELECT_PATH:
                       01E0 8F   BB  0FA3  4236 	PUSHR	#^M<R5,R6,R7,R8>
                    50   0C A1   DE  0FA7  4237 	MOVAL	SB$L_PBFL(R1), R0	; Hold path block list head
                            50   DD  0FAB  4238 	PUSHL	R0			; Save for future reference
                            56   D4  0FAD  4239 	CLRL	R6			; Clear load class
                            57   D4  0FAF  4240 	CLRL	R7			; Clear the preferred path block
              58   7FFFFFFF 8F   D0  0FB1  4241 	MOVL	#^X7FFFFFFF,R8		; Use the maximum rating
                       50   60   D0  0FB8  4242 10$:	MOVL	(R0),R0			; Get first/next path block
                       6E   50   D1  0FBB  4243 	CMPL	R0,(SP)			; Back at start?
                            61   13  0FBE  4244 	BEQL	60$			; Branch if so
                    03   12 A0   B1  0FC0  4245 	CMPW	PB$W_STATE(R0),#PB$C_OPEN ; Is it good?
                            F2   12  0FC4  4246 	BNEQ	10$			; No, keep looking
                    54   2C A0   D0  0FC6  4247 	MOVL	PB$L_PDT(R0),R4		; Obtain the PDT
                            02   B1  0FCA  4248 	CMPW	#PDT$C_BALANCEVER,-	; Do we understand this PDT?
                       00F4 C4       0FCC  4249 		PDT$W_SCSVERSION(R4)
                            06   15  0FCF  4250 	BLEQ	20$			; Branch if so
                                     0FD1  4251 	;
                                     0FD1  4252 	;  Here we have a port which does not understand connection
                                     0FD1  4253 	;  load sharing.  Just use this path block and exit
                                     0FD1  4254 	;
                       54   50   D0  0FD1  4255 	MOVL	R0,R4			; This is the one we want
                          0056   31  0FD4  4256 	BRW	70$			;  exit with success	
                                     0FD7  4257 	;
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 101
X-19                            -  SCS_SELECT_PATH - find a path for a n 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (20)

                                     0FD7  4258 	;  This port understands connection load sharing.  Check its load
                                     0FD7  4259 	;  class first
                                     0FD7  4260 	;
                  56   00FC C4   B1  0FD7  4261 20$:	CMPW	PDT$W_LOAD_CLASS(R4),R6	; Right load class?
                            DA   19  0FDC  4262 	BLSS	10$			; Too small, look for another port
                            0E   13  0FDE  4263 	BEQL	30$			;  branch if same
                                     0FE0  4264 	;
                                     0FE0  4265 	;  This port has a higher rating than any previous one.  Restart
                                     0FE0  4266 	;  the search using this port.
                                     0FE0  4267 	;
                  56   00FC C4   3C  0FE0  4268 	MOVZWL	PDT$W_LOAD_CLASS(R4),R6	; Set the new load class
                            57   D4  0FE5  4269 	CLRL	R7			; Clear the preferred path block
              58   7FFFFFFF 8F   D0  0FE7  4270 	MOVL	#^X7FFFFFFF,R8		; Use the maximum rating
                                     0FEE  4271 	;
                                     0FEE  4272 	;  Now calculate the connection rating
                                     0FEE  4273 	;
              55   7FFFFFF0 8F   D0  0FEE  4274 30$:	MOVL	#^X7FFFFFF0,R5		; Assume slightly less than 
                                     0FF5  4275 					;  worst load rating
                            50   DD  0FF5  4276 	PUSHL	R0			; Save the PB
                          03F2   30  0FF7  4277 	BSBW	SCS_GET_LOAD_VECTOR	; Get the load vector
                         06 50   E8  0FFA  4278 	BLBS	R0,40$			; Branch if success
                            50 8ED0  0FFD  4279 	POPL	R0			; Restore the PB
                          0010   31  1000  4280 	BRW	50$			;  and use default
                            50 8ED0  1003  4281 40$:	POPL	R0			; Restore the PB
                  55   0154 C3   3C  1006  4282 	MOVZWL	CDT$W_LOCAL_INDEX(R3),R5 ; Get the local index
                55   6245   08   78  100B  4283 	ASHL	#SCS_V_RATING_FACTOR,(R2)[R5],R5 ; Multiply the connections of our
                                     1010  4284 					;  type by an arbitrary factor
                       55   62   C0  1010  4285 	ADDL	(R2),R5			; Add in the total # of connections
                       58   55   D1  1013  4286 50$:	CMPL	R5,R8			; Better than what we already have?
                            A0   18  1016  4287 	BGEQ	10$			; Branch if not
                       57   50   D0  1018  4288 	MOVL	R0,R7			; Set a new preferred path block
                       58   55   D0  101B  4289 	MOVL	R5,R8			; Set its port connection rating
                          FF97   31  101E  4290 	BRW	10$			; Look for more path blocks
                                     1021  4291 	;
                                     1021  4292 	;	End of the scan, see what we have got
                                     1021  4293 	;	
                       54   57   D0  1021  4294 60$:	MOVL	R7,R4			; Obtain the chosen path block
                            07   12  1024  4295 	BNEQ	70$			; Got a real one
                  50   2094 8F   3C  1026  4296 	MOVZWL	#SS$_UNREACHABLE, R0	; No good path
                            03   11  102B  4297 	BRB	80$			; Just exit here
                       50   01   9A  102D  4298 70$:	MOVZBL	#SS$_NORMAL,R0		; Set success
                            8E   D5  1030  4299 80$:	TSTL	(SP)+			; Clean PB header off stack
                       01E0 8F   BA  1032  4300 	POPR	#^M<R5,R6,R7,R8>	; Restore Registers
                                 05  1036  4301 	RSB
                                     1037  4302 	.disable lsb
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 102
X-19                            -  SCS$UPDATE_PORT_LOAD_VECTOR - update  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (21)

                                     1037  4304 	.SBTTL	-		SCS$UPDATE_PORT_LOAD_VECTOR - update the load vector
                                     1037  4305 ;+
                                     1037  4306 ;  SCS$UPDATE_PORT_LOAD_VECTOR - update a port's load status
                                     1037  4307 ; 
                                     1037  4308 ; FUNCTIONAL DESCRIPTION:
                                     1037  4309 ;
                                     1037  4310 ;	This routine is called by the session layer when a CDT is
                                     1037  4311 ;	transiting to or from the OPEN state.
                                     1037  4312 ;
                                     1037  4313 ;	Each PDT requires a load vector with a number of longwords equal
                                     1037  4314 ;	to the maximum number of SCS load shared SYSAP types plus 1.
                                     1037  4315 ;	The zero location in the vector is the sum of the connections
                                     1037  4316 ;	on the port and the other locations is the sum of connections with
                                     1037  4317 ;	a given index type.  This vector is used for the assignment of
                                     1037  4318 ;	new connections and for the transfer of connections from one
                                     1037  4319 ;	port to another when the optimal path is unknown.
                                     1037  4320 ;
                                     1037  4321 ;	In addition, the opening CDT is inserted at the tail of
                                     1037  4322 ;	PDT$Q_CONN_WAIT queue unless its load rating is either CDT$C_UNEQUAL_PATH
                                     1037  4323 ;	or CDT$C_LOAD_SHARE_DISABLE in which case the CDT is inserted to the 
                                     1037  4324 ;	PDT$Q_DISABLED queue. The CDT time stamp is updated
                                     1037  4325 ;	to reflect open/close state time.
                                     1037  4326 ;
                                     1037  4327 ; CALLING SEQUENCE:
                                     1037  4328 ;
                                     1037  4329 ;	JSB	G^SCS$UPDATE_PORT_LOAD_VECTOR
                                     1037  4330 ;
                                     1037  4331 ; INPUT PARAMETERS:
                                     1037  4332 ;
                                     1037  4333 ;	R0	- +1 for a newly opening connection
                                     1037  4334 ;		- -1 for a newly closing connection
                                     1037  4335 ;	R1	- Zero, or the VMS status for a disconnection
                                     1037  4336 ;	R3	- address of the CDT.
                                     1037  4337 ;	CDT$L_PDT(R3) - address of the PDT.
                                     1037  4338 ;
                                     1037  4339 ;	NOTE:  Although CDT$L_PDT(R3) normally duplicates the contents of
                                     1037  4340 ;	R4, this assumption is not true in test software used to debug
                                     1037  4341 ;	connection sharing.
                                     1037  4342 ;
                                     1037  4343 ; OUTPUT PARAMETERS:
                                     1037  4344 ;
                                     1037  4345 ;	NONE
                                     1037  4346 ;
                                     1037  4347 ; COMPLETION CODES:
                                     1037  4348 ;
                                     1037  4349 ;	NONE
                                     1037  4350 ;
                                     1037  4351 ; SIDE EFFECTS:
                                     1037  4352 ;
                                     1037  4353 ;	A load vector will be allocated for the PDT if none exists
                                     1037  4354 ;
                                     1037  4355 ;--
                                     1037  4356 	.enable lsb
                                     1037  4357 	UNIVERSAL_SYMBOL SCS$UPDATE_PORT_LOAD_VECTOR
                                     1037       SCS$UPDATE_PORT_LOAD_VECTOR::
                                     1037  4358 
                                     1037  4359 ;SCS$UPDATE_PORT_LOAD_VECTOR:
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 103
X-19                            -  SCS$UPDATE_PORT_LOAD_VECTOR - update  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (21)

                            37   BB  1037  4360 	PUSHR	#^M<R0,R1,R2,R4,R5>	; Save registers
                                     1039  4361 	;
                                     1039  4362 	;	Validate the parameter
                                     1039  4363 	;
                    54   10 A3   D0  1039  4364 	MOVL	CDT$L_PDT(R3),R4	; When using the dummy port for
                                     103D  4365 					;  debugging, use the PDT in the CDT
                                     103D  4366 					;  and not the PDT on which the message
                                     103D  4367 					;  was received
                  52   50   01   C1  103D  4368 	ADDL3	#1,R0,R2		; -1?
                            0A   13  1041  4369 	BEQL	10$			; branch if so
                  52   50   01   C3  1043  4370 	SUBL3	#1,R0,R2		; +1?
                            04   13  1047  4371 	BEQL	10$			; branch if so
                                     1049  4372 	BUG_CHECK	VAXPORT,FATAL	; problem here with the port driver
                               FEFF  1049       		.WORD	^XFEFF
                               0004' 104B       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_VAXPORT!4
                                     104D  4373 	;
                                     104D  4374 	;	Update the load vector
                                     104D  4375 	;
                          039C   30  104D  4376 10$:	BSBW	SCS_GET_LOAD_VECTOR	; Get the load vector
                         05 50   E8  1050  4377 	BLBS	R0,20$			; Continue if successful
                            50 8ED0  1053  4378 	POPL	R0			; Restore the parameter
                            0F   11  1056  4379 	BRB	30$			;  and return
                            50 8ED0  1058  4380 20$:	POPL	R0			; Restore the parameter
                       62   50   C0  105B  4381 	ADDL	R0,(R2)			; Update the total # of connections
                  51   0154 C3   3C  105E  4382 	MOVZWL	CDT$W_LOCAL_INDEX(R3),R1 ; Get the local index
                     6241   50   C0  1063  4383 	ADDL	R0,(R2)[R1]		; Update count of individual connections
                                     1067  4384 	;
                                     1067  4385 	;   (TYC 17-Feb-89)
                                     1067  4386 	;   Update CDT timestamps and insert CDT to PDT load sharing queue if
                                     1067  4387 	;   the call is for connection open.
                                     1067  4388 	;
                   00000000'GF   D0  1067  4389 30$:	MOVL	G^EXE$GL_ABSTIM,-	; Timestamp the open/close event
                       00B4 C3       106D  4390 		CDT$L_TIME_STAMP(R3)
                            50   D5  1070  4391 	TSTL	R0			; Which operation?
                            27   15  1072  4392 	BLEQ	50$			; a disconnect
                            07   D1  1074  4393 	CMPL	#CDT$C_UNEQUAL_PATH,-	; If load rating indicates
                       00B0 C3       1076  4394 		CDT$L_LOAD_RATING(R3)	; not to move for equal path,
                            07   13  1079  4395 	BEQL	35$
                            08   D1  107B  4396 	CMPL	#CDT$C_LOAD_SHARE_DISABLE,-	
                       00B0 C3       107D  4397 		CDT$L_LOAD_RATING(R3)	; 
                            09   12  1080  4398 	BNEQ	40$
                       00A0 C3   0E  1082  4399 35$:	INSQUE	CDT$L_SHARE_FLINK(R3),-	; insert the CDT at the tail
                       0124 D4       1086  4400 		@PDT$Q_DISABLED+4(R4)	; of move disabled queue
                            07   11  1089  4401 	BRB	45$
                       00A0 C3   0E  108B  4402 40$:	INSQUE	CDT$L_SHARE_FLINK(R3),-	; Insert the CDT at the tail
                       010C D4       108F  4403 		@PDT$Q_CONN_WAIT+4(R4)	; of connection wait queue
                   00000000'GF   D0  1092  4404 45$:	MOVL	G^EXE$GL_ABSTIM,-	; Timestamp the queue insertion
                       00B8 C3       1098  4405 		CDT$L_QUEUE_TIME_STAMP(R3)
                                     109B  4406 	;
                                     109B  4407 	; Disconnect status -- Do nothing further (TYC 4-JAN-89)
                                     109B  4408 	;
                            36   BA  109B  4409 50$:	POPR	#^M<R1,R2,R4,R5>	; Restore registers
                                 05  109D  4410 	RSB				; And return	
                                     109E  4411 	.disable lsb
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 104
X-19                            - New Virtual Circuit Processing         13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (22)

                                     109E  4413 	.SBTTL  -	New Virtual Circuit Processing
                                     109E  4414 	.SBTTL	-		SCS$NEW_PB - Recognize a new path block
                                     109E  4415 ;+
                                     109E  4416 ;  SCS$NEW_PB - recognize a new path block
                                     109E  4417 ;
                                     109E  4418 ; This routine is invoked whenever a new path block is entered into the
                                     109E  4419 ; SCS database.  
                                     109E  4420 ;
                                     109E  4421 ; The routine first checks to see whether (1) this new path block is the
                                     109E  4422 ; only path to the remote system and (2) this new path block is on a port
                                     109E  4423 ; which is in a lower load class to that other path blocks to the remote
                                     109E  4424 ; system.  If either criterium holds, then there is no need for static
                                     109E  4425 ; load sharing and the routine simply exits.
                                     109E  4426 ;
                                     109E  4427 ; If both criteria do not hold, the routine then checks for any CDT's
                                     109E  4428 ; on path blocks which are at a lower load class than the new path block.
                                     109E  4429 ; If allowed, the connection will be invoked at its
                                     109E  4430 ; MOVE_PATH_ADDR routine with the CDT$C_UNEQUAL_PATH load rating.
                                     109E  4431 ;
                                     109E  4432 ; If the load class of the new path block matches the load class of existing
                                     109E  4433 ; path blocks, then this routine does nothing since possible shifts of
                                     109E  4434 ; connections will occur at next load sharing interval.
                                     109E  4435 ;
                                     109E  4436 ; Calling Sequence:
                                     109E  4437 ;
                                     109E  4438 ;	JSB	G^SCS$NEW_PB
                                     109E  4439 ;
                                     109E  4440 ; Inputs:
                                     109E  4441 ;
                                     109E  4442 ;	R2		- Address of the new SB
                                     109E  4443 ;	R3		- Address of the new PB
                                     109E  4444 ;	R4		- Address of the PDT
                                     109E  4445 ;	
                                     109E  4446 ; Outputs:
                                     109E  4447 ;
                                     109E  4448 ;	R1-R5		- Preserved
                                     109E  4449 ;	
                                     109E  4450 ;-
                                     109E  4451 	.enable lsb
                                     109E  4452 
                                     109E  4453 	UNIVERSAL_SYMBOL SCS$NEW_PB
                                     109E       SCS$NEW_PB::
                                     109E  4454 
                                     109E  4455 ;SCS$NEW_PB:
                       027E 8F   BB  109E  4456 	PUSHR	#^M<R1,R2,R3,R4,R5,R6,R9> ; Save registers
                            02   B1  10A2  4457 	CMPW	#PDT$C_BALANCEVER,-	; Do we understand this PDT?
                       00F4 C4       10A4  4458 		PDT$W_SCSVERSION(R4)
                            03   15  10A7  4459 	BLEQ	10$			; Yes
                          0036   31  10A9  4460 	BRW	110$			; Obsolete PDT format - take no
                                     10AC  4461 					;  further action
                  56   00FC C4   3C  10AC  4462 10$:	MOVZWL	PDT$W_LOAD_CLASS(R4),R6	; R6 contains the load class
                    51   0C A2   DE  10B1  4463 	MOVAL	SB$L_PBFL(R2),R1	; Get queue header
                       59   51   D0  10B5  4464 	MOVL	R1,R9			; Save pointer to start
                                     10B8  4465 	;
                                     10B8  4466 	;  Scan all path blocks to this system
                                     10B8  4467 	;
                       51   61   D0  10B8  4468 20$:	MOVL	(R1),R1			; Get the next entry
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 105
X-19                            -  SCS$NEW_PB - Recognize a new path blo 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (22)

                       59   51   D1  10BB  4469 	CMPL	R1,R9			; Back at start?
                            22   13  10BE  4470 	BEQL	110$			; Yes, we are done
                       53   51   D1  10C0  4471 	CMPL	R1,R3			; Our own PB?
                            F3   13  10C3  4472 	BEQL	20$			; Yes, skip it
                            03   B1  10C5  4473 	CMPW	#PB$C_OPEN,-		; Is this PB open?
                         12 A1       10C7  4474 		PB$W_STATE(R1)
                            ED   12  10C9  4475 	BNEQ	20$			; No, don't consider it
                    55   2C A1   D0  10CB  4476 	MOVL	PB$L_PDT(R1),R5		; Get the associated PDT
                            02   B1  10CF  4477 	CMPW	#PDT$C_BALANCEVER,-	; Do we understand this PDT?
                       00F4 C5       10D1  4478 		PDT$W_SCSVERSION(R5)
                            0C   14  10D4  4479 	BGTR	110$			; Branch if we don't - take  no
                                     10D6  4480 					;  further action
                  56   00FC C5   B1  10D6  4481 	CMPW	PDT$W_LOAD_CLASS(R5),R6	; Check its load class
                            03   18  10DB  4482 	BGEQ	30$			; Branch if same or greater
                          0007   30  10DD  4483 	BSBW	WORSE_PATH_CONNECTIONS	; Go move any connections on 
                                     10E0  4484 					; this lower load class PB
                            D6   11  10E0  4485 30$:	BRB	20$			; Look for more PB's
                       027E 8F   BA  10E2  4486 110$:	POPR	#^M<R1,R2,R3,R4,R5,R6,R9> ; Restore the registers
                                 05  10E6  4487 	RSB
                                     10E7  4488 	.disable lsb
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 106
X-19                            -  WORSE_PATH_CONNECTIONS - handle unequ 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (23)

                                     10E7  4490 	.SBTTL	-		WORSE_PATH_CONNECTIONS - handle unequal paths
                                     10E7  4491 ;+
                                     10E7  4492 ;
                                     10E7  4493 ;	This routine is called whenever a lower bandwidth path has connections
                                     10E7  4494 ;	which should be moved to a higher bandwidth path.  
                                     10E7  4495 ;	
                                     10E7  4496 ;	Check all CDT's on this PB and suggest that they move now if in OPEN
                                     10E7  4497 ;	state.  Otherwise insert the CDT into SCS$GQ_WORSE_PATH queue so that
                                     10E7  4498 ;	it can be moved later at load sharing interval when the state becomes
                                     10E7  4499 ;	OPEN.
                                     10E7  4500 ;
                                     10E7  4501 ; Calling Sequence:
                                     10E7  4502 ;
                                     10E7  4503 ;	BSBW	WORSE_PATH_CONNECTIONS
                                     10E7  4504 ;
                                     10E7  4505 ; Inputs:
                                     10E7  4506 ;
                                     10E7  4507 ;	R1		- Path block address of worse path
                                     10E7  4508 ;	R2		- New SB address
                                     10E7  4509 ;	R3		- New PB address
                                     10E7  4510 ;	
                                     10E7  4511 ; Outputs:
                                     10E7  4512 ;
                                     10E7  4513 ;	R0-R5		- Preserved
                                     10E7  4514 ;	
                                     10E7  4515 ;-
                                     10E7  4516 	.enable lsb
                                     10E7  4517 WORSE_PATH_CONNECTIONS:
                            3F   BB  10E7  4518 	PUSHR	#^M<R0,R1,R2,R3,R4,R5>	; Save registers
                                     10E9  4519 	;
                                     10E9  4520 	; Look for an CDT on this path which is not in the VC_FAIL
                                     10E9  4521 	; state.  
                                     10E9  4522 	;
                       55   53   D0  10E9  4523 	MOVL	R3,R5			; Keep new PB address
                    53   34 A1   D0  10EC  4524 	MOVL	PB$L_CDTLST(R1),R3	; Get first CDT
                            03   12  10F0  4525 	BNEQ	10$
                          0099   31  10F2  4526 	BRW	60$			; None there
                                     10F5  4527 10$:	
                            24   BB  10F5  4528 	PUSHR	#^M<R2,R5>		; Save New PB and SB address
                         6C A3   DD  10F7  4529 	PUSHL	CDT$L_CDTLST(R3)	; Save next CDT
                                     10FA  4530 ;
                                     10FA  4531 ; (TYC 22-May-89) If the connection has load rating of DISABLED,
                                     10FA  4532 ; don't ask to disconnect it.
                                     10FA  4533 ;
                            08   D1  10FA  4534 	CMPL	#CDT$C_LOAD_SHARE_DISABLE,-
                       00B0 C3       10FC  4535 		CDT$L_LOAD_RATING(R3)	; Is the rating "DISABLED"?
                            03   12  10FF  4536 	BNEQ	5$
                          0080   31  1101  4537 	BRW	50$			; Yes, go look for next CDT	
                                     1104  4538 5$:
                  00C0 C3   55   D0  1104  4539 	MOVL	R5,CDT$L_OPTIMAL_PATH(R3) ; Copy new optimal path to re-connect
                  00A8 C3   52   D0  1109  4540 	MOVL	R2,CDT$L_SB(R3)		; Copy new path's system block addr
                            02   B1  110E  4541 	CMPW	#CDT$C_OPEN,-		; Is the connection open?
                         28 A3       1110  4542 		CDT$W_STATE(R3)
                            1F   13  1112  4543 	BEQL	20$			; It is, try to close it
                                     1114  4544 					
                       00A0 C3   D5  1114  4545 	TSTL	CDT$L_SHARE_FLINK(R3)	; No, is this CDT on any queue?
                            05   13  1118  4546 	BEQL	15$			; No, we can just queue it
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 107
X-19                            -  WORSE_PATH_CONNECTIONS - handle unequ 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (23)

                  50   00A0 C3   0F  111A  4547 	REMQUE	CDT$L_SHARE_FLINK(R3),R0 ; Yes, remove it from the queue first
                       00A0 C3   0E  111F  4548 15$:	INSQUE	CDT$L_SHARE_FLINK(R3),- ; Queue to WORSE_PATH for now
                   00000000'GF       1123  4549 		G^SCS$GQ_WORSE_PATH	; 
                   00000000'GF   D0  1128  4550 	MOVL	G^EXE$GL_ABSTIM,-	; Timestamp the queue insertion
                       00B8 C3       112E  4551 		CDT$L_QUEUE_TIME_STAMP(R3)
                            51   11  1131  4552 	BRB	50$			; and continue for next CDT 
                                     1133  4553 	;
                                     1133  4554 	;  We have an open connection on a less desirable path.  We will call
                                     1133  4555 	;  the connection at the MOVE_PATH routine if it is possible to invoke
                                     1133  4556 	;  this routine.
                                     1133  4557 	;
                                     1133  4558 	;  For compatability with older SYSAP's, if no MOVE_PATH routine 
                                     1133  4559 	;  exists, then invoke the SYSAP at the error entry point with a
                                     1133  4560 	;  success status.  Although the virtual circuit won't be broken,
                                     1133  4561 	;  most SYSAP's appear to handle error recovery well enough to be
                                     1133  4562 	;  able to perform a disconnect on a live virtual circuit.
                                     1133  4563 	;
                                     1133  4564 20$:	
                       00A0 C3   D5  1133  4565 	TSTL	CDT$L_SHARE_FLINK(R3)	; Is this CDT on any queue?
                            10   13  1137  4566 	BEQL	25$			; No, continue
                  50   00A0 C3   0F  1139  4567 	REMQUE	CDT$L_SHARE_FLINK(R3),R0 ; Yes, remove it from the queue first
                   00000000'GF   D0  113E  4568 	MOVL	G^EXE$GL_ABSTIM,-	; Timestamp the removal from queue
                       00B8 C3       1144  4569 		CDT$L_QUEUE_TIME_STAMP(R3)
                            60   D4  1147  4570 	CLRL	(R0)			; Show that it is not queued anywhere
                                     1149  4571 					; for load sharing
                  0156 C3   01   90  1149  4572 25$:	MOVB	#1,CDT$B_LS_FLAG(R3)	; Set load share flag for disconnect
                                     114E  4573 
                  55   009C C3   D0  114E  4574 	MOVL	CDT$L_MOVE_PATH_ADDR(R3),R5 ; Get the move path address
                            0A   13  1153  4575 	BEQL	30$			; None there
                                     1155  4576 	;
                                     1155  4577 	;  Since a low performance path is most undesirable, ignore the previous
                                     1155  4578 	;  history of the connection and invoke the move routine for all cases
                                     1155  4579 	;  except for those in which the error routine has already been invoked.
                                     1155  4580 	;
                                     1155  4581 	;
                  50   204C 8F   3C  1155  4582 	MOVZWL	#SS$_DISCONNECT,R0	; (TYC 22-Mar-89) Disconnect status
                            2A   3C  115A  4583 	MOVZWL	#SCS$C_USE_ALTERNATE_PORT,-
                            51       115C  4584 		R1			; (TYC 22-Mar-89) Move path status
                            0B   11  115D  4585 	BRB	40$			; Complete the request.
                                     115F  4586 	;	(TYC 5-JAN-89) For SYSAP with no MOVE_PATH routine, 
                                     115F  4587 	;	call the routine at the error entry point to
                                     115F  4588 	;	recommend a disconnect.
                                     115F  4589 	;
                    55   0C A3   D0  115F  4590 30$:	MOVL	CDT$L_ERRADDR(R3),R5	; Get the error address
                  50   210C 8F   3C  1163  4591 	MOVZWL	#SS$_RESET,R0		; Flag that better path was reset
                            51   D4  1168  4592 	CLRL	R1			; Clear the auxiliary status
                    54   10 A3   D0  116A  4593 40$:	MOVL	CDT$L_PDT(R3),R4	; Get the PDT
                   0000002D'EF   D6  116E  4594 	INCL	UNEQUAL_PATH_CALL_COUNT	; Count these
                       01B8 C4   D6  1174  4595 	INCL	PDT$L_UNEQUAL_PATH_CALL_COUNT(R4)
                   00000031'EF   D6  1178  4596 	INCL	CONNECTION_MOVE_COUNT	; (TYC 4-JAN-89) increment move counter
                       01BC C4   D6  117E  4597 	INCL	PDT$L_CONNECTION_MOVE_COUNT(R4)
                            65   16  1182  4598 	JSB	(R5)			; Call the routine
                                     1184  4599 	;
                                     1184  4600 	;	Done with this CDT -- look for more
                                     1184  4601 	;
                            53 8ED0  1184  4602 50$:	POPL	R3			; Retrieve CDT address
                            24   BA  1187  4603 	POPR	#^M<R2,R5>		; Restore destroyed addresses
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 108
X-19                            -  WORSE_PATH_CONNECTIONS - handle unequ 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (23)

                            03   13  1189  4604 	BEQL	60$			; Done if no more
                          FF67   31  118B  4605 	BRW	10$			; Go for more
                            3F   BA  118E  4606 60$:	POPR	#^M<R0,R1,R2,R3,R4,R5>	; Restore registers.
                                 05  1190  4607 	RSB
                                     1191  4608 	.disable lsb
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 109
X-19                            -  SCS$SET_LOAD_RATING - Set a connectio 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (24)

                                     1191  4610 	.SBTTL	-		SCS$SET_LOAD_RATING - Set a connection's load rating
                                     1191  4611 ;+
                                     1191  4612 ;  SCS$SET_LOAD_RATING
                                     1191  4613 ; 
                                     1191  4614 ; FUNCTIONAL DESCRIPTION:
                                     1191  4615 ;
                                     1191  4616 ;	This routine is called by a SYSAP to provide information to the 
                                     1191  4617 ;	port driver that will be used in selecting candidates for load sharing.
                                     1191  4618 ;	The value provided to this routine should give an indication of the
                                     1191  4619 ;	impact on the system of breaking this connection.  If an invalid value
                                     1191  4620 ;	is passed, the routine returns an error status.
                                     1191  4621 ;	
                                     1191  4622 ;	If the new load rating is different from the previous rating, 
                                     1191  4623 ;	the CDT is moved from one load sharing queue in the PDT to another.
                                     1191  4624 ;
                                     1191  4625 ; CALLING SEQUENCE:
                                     1191  4626 ;
                                     1191  4627 ;	JSB	G^SCS$SET_LOAD_RATING
                                     1191  4628 ;
                                     1191  4629 ; INPUT PARAMETERS:
                                     1191  4630 ;
                                     1191  4631 ;	R1	- Connection load rating
                                     1191  4632 ;	R3	- address of the CDT.
                                     1191  4633 ;	R4	- address of the PDT.
                                     1191  4634 ;
                                     1191  4635 ; OUTPUT PARAMETERS:
                                     1191  4636 ;
                                     1191  4637 ;	NONE
                                     1191  4638 ;
                                     1191  4639 ; COMPLETION CODES:
                                     1191  4640 ;
                                     1191  4641 ;	R0	- lbs if successful
                                     1191  4642 ;		- SS$_ILLCDTST	Illegal connection state
                                     1191  4643 ;		- SS$_BADPARAM  Bad parameter value
                                     1191  4644 ;
                                     1191  4645 ; SIDE EFFECTS:
                                     1191  4646 ;
                                     1191  4647 ;	R0 destroyed.
                                     1191  4648 ;	CDT might be queued to another load sharing queue.
                                     1191  4649 ;
                                     1191  4650 ;--
                                     1191  4651 	.enable lsb
                                     1191  4652 	UNIVERSAL_SYMBOL SCS$SET_LOAD_RATING
                                     1191       SCS$SET_LOAD_RATING::
                                     1191  4653 
                                     1191  4654 ;SCS$SET_LOAD_RATING:
                            02   B1  1191  4655 	CMPW	#CDT$C_OPEN,-		; Is the connection open?
                         28 A3       1193  4656 		CDT$W_STATE(R3)
                            06   13  1195  4657 	BEQL	10$			;Yes, continue.
                  50   2154 8F   3C  1197  4658 	MOVZWL	#SS$_ILLCDTST,R0	;Set error status
                                 05  119C  4659 	RSB				; and return		
                                     119D  4660 10$:	
                                     119D  4661 ;****************
                                     119D  4662 ; (TYC 25-May-89) debugging code
                                     119D  4663 ; call tracing routine here
                                     119D  4664 ;
                                     119D  4665 ;        .if defined EXTRA_CTR           ; Conditional assembly code
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 110
X-19                            -  SCS$SET_LOAD_RATING - Set a connectio 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (24)

                                     119D  4666 ;	BSBW	TRC$LOGPC		; Log PC and R0-R5 and load rating
                                     119D  4667 ;	.endc
                                     119D  4668 ;****************
                                     119D  4669 
                  00B0 C3   51   D1  119D  4670 	CMPL	R1,CDT$L_LOAD_RATING(R3); Has the rating changed?
                            7E   13  11A2  4671 	BEQL	55$			; If not, done
                                     11A4  4672 	DISPATCH	-		; Dispatch on user-specified load rating
                                     11A4  4673 			R1,-		;
                                     11A4  4674 		TYPE=B, -
                                     11A4  4675 		PREFIX=CDT$C_,-
                                     11A4  4676 		<-
                                     11A4  4677 		<RATING0,		40$>,-	; Undefined but valid value
                                     11A4  4678 		<RATING1,		40$>,-	; Undefined but valid value
                                     11A4  4679 		<RATING2,		40$>,-	; Undefined but valid value
                                     11A4  4680 		<RATING3,		40$>,-	; Undefined but valid value
                                     11A4  4681 		<YELLOW,		40$>,-	; Yellow zone
                                     11A4  4682 		<RATING5,		40$>,-	; Undefined but valid value
                                     11A4  4683 		<RED,			40$>,-	; Red zone
                                     11A4  4684 		<UNEQUAL_PATH,		30$>,- 	; Unequal path load sharing
                                     11A4  4685 		<LOAD_SHARE_DISABLE,	30$>,- 	; Load sharing disabled
                                     11A4  4686 		>				     
                  08   00   51   8F  11A4       	CASEB	R1,#$$BASE,#$$LIMIT
                                     11A8       30057$:
                               0036' 11A8       	.SIGNED_WORD	40$-30057$
                               0036' 11AA       	.SIGNED_WORD	40$-30057$
                               0036' 11AC       	.SIGNED_WORD	40$-30057$
                               0036' 11AE       	.SIGNED_WORD	40$-30057$
                               0036' 11B0       	.SIGNED_WORD	40$-30057$
                               0036' 11B2       	.SIGNED_WORD	40$-30057$
                               0036' 11B4       	.SIGNED_WORD	40$-30057$
                               0019' 11B6       	.SIGNED_WORD	30$-30057$
                               0019' 11B8       	.SIGNED_WORD	30$-30057$
                          12D9   30  11BA  4687 20$:	BSBW	LOAD_SHARE_BUGCHECK	; Anything else is illegal for now
                       50   14   3C  11BD  4688 	MOVZWL	#SS$_BADPARAM,R0	; Set error status
                                 05  11C0  4689 	RSB
                                     11C1  4690 
                                     11C1  4691 ;
                                     11C1  4692 ;	Static connection - keep in DISABLED queue.
                                     11C1  4693 ;	This connection is only moved when a better path is available
                                     11C1  4694 ;
                                     11C1  4695 30$:	
                                     11C1  4696 					; This test is for safety's sake
                                     11C1  4697 					; CDT should always be queued when
                                     11C1  4698 					; in OPEN state
                       00A0 C3   D5  11C1  4699 	TSTL	CDT$L_SHARE_FLINK(R3)	; Is this CDT on any queue?
                            05   13  11C5  4700 	BEQL	35$			; No, continue
                  50   00A0 C3   0F  11C7  4701 	REMQUE	CDT$L_SHARE_FLINK(R3),R0 ; Remove it from the queue first
                       00A0 C3   0E  11CC  4702 35$:	INSQUE	CDT$L_SHARE_FLINK(R3),- ; Queue to tail of DISABLED queue
                       0124 D4       11D0  4703 		@PDT$Q_DISABLED+4(R4)	; 
                   00000000'GF   D0  11D3  4704 	MOVL	G^EXE$GL_ABSTIM,-	; Timestamp the queue move
                       00B8 C3       11D9  4705 		CDT$L_QUEUE_TIME_STAMP(R3)
                            3F   11  11DC  4706 	BRB 50$	
                                     11DE  4707 ;
                                     11DE  4708 ; non-static connection -- check if currently in CONN_WAIT queue
                                     11DE  4709 ;  If so, don't move the CDT yet.  Otherwise move to new queue.
                                     11DE  4710 ;
                            52   DD  11DE  4711 40$:	PUSHL	R2			; Save register
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 111
X-19                            -  SCS$SET_LOAD_RATING - Set a connectio 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (24)

                  50   0108 C4   7E  11E0  4712 	MOVAQ	PDT$Q_CONN_WAIT(R4), R0	; Get the CONN_WAIT listhead
                       52   50   D0  11E5  4713 	MOVL	R0,R2			; Copy for reference
                       52   62   D0  11E8  4714 45$:    MOVL	(R2),R2			; Get next entry
                       50   52   D1  11EB  4715 	CMPL	R2,R0			; End of list?
                            07   13  11EE  4716 	BEQL	46$			; Yes
                       53   52   D1  11F0  4717 	CMPL	R2,R3			; Same CDT as current one?
                            F3   12  11F3  4718 	BNEQ	45$			; No, look for more
                            23   11  11F5  4719 	BRB	49$			; Yes, it is in this queue
                                     11F7  4720 46$:					; No, We can move to other queue
                  50   00A0 C3   0F  11F7  4721 	REMQUE	CDT$L_SHARE_FLINK(R3),R0 ; Remove it from the queue first
                       51   04   D1  11FC  4722 	CMPL	#CDT$C_YELLOW,R1	; Is new rating YELLOW?
                            09   18  11FF  4723 	BGEQ	YELLOWQ			; yes
                       00A0 C3   0E  1201  4724 	INSQUE	CDT$L_SHARE_FLINK(R3),- ; No, queue to RED queue
                       011C D4       1205  4725 		@PDT$Q_RED+4(R4)	; at tail
                            07   11  1208  4726 	BRB	48$
                                     120A  4727 YELLOWQ:	
                       00A0 C3   0E  120A  4728 	INSQUE	CDT$L_SHARE_FLINK(R3),-	; Queue to tail of
                       0114 D4       120E  4729 		@PDT$Q_YELLOW+4(R4)	; YELLOW queue
                                     1211  4730 
                   00000000'GF   D0  1211  4731 48$:	MOVL	G^EXE$GL_ABSTIM,-	; Timestamp the queue move
                       00B8 C3       1217  4732 		CDT$L_QUEUE_TIME_STAMP(R3)
                                     121A  4733 
                            52 8ED0  121A  4734 49$:	POPL	R2			; restore register
                                     121D  4735 
                  00B0 C3   51   D0  121D  4736 50$:	MOVL	R1,CDT$L_LOAD_RATING(R3);Set the new load rating
                       50   01   9A  1222  4737 55$:	MOVZBL	#SS$_NORMAL,R0		; Successful return
                                 05  1225  4738 	RSB				; Return to SYSAP
                                     1226  4739 	.disable lsb
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 112
X-19                            - Periodic Processing                    13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (25)

                                     1226  4741 	.SBTTL	-	Periodic Processing
                                     1226  4742 	.SBTTL	-		INIT_LOAD_SHARE - start load sharing activity
                                     1226  4743 ;++
                                     1226  4744 ;
                                     1226  4745 ; FUNCTIONAL DESCRIPTION:
                                     1226  4746 ;
                                     1226  4747 ;	The initialization routine allocates a periodic TQE which will be
                                     1226  4748 ;	used for periodic checks of the progress of dynamic load sharing 
                                     1226  4749 ;	operations.  Also all load sharing queues and global data
                                     1226  4750 ;	structures are initialized.  The TQE is started for the first
                                     1226  4751 ;	load sharing interval.
                                     1226  4752 ;
                                     1226  4753 ; CALLING SEQUENCE:
                                     1226  4754 ;
                                     1226  4755 ;	BSBW	INIT_LOAD_SHARE
                                     1226  4756 ;
                                     1226  4757 ; INPUT PARAMETERS:
                                     1226  4758 ;
                                     1226  4759 ;	NONE
                                     1226  4760 ;
                                     1226  4761 ; OUTPUT PARAMETERS:
                                     1226  4762 ;
                                     1226  4763 ;	NONE
                                     1226  4764 ;
                                     1226  4765 ; COMPLETION CODES:
                                     1226  4766 ;
                                     1226  4767 ;	NONE
                                     1226  4768 ;
                                     1226  4769 ; SIDE EFFECTS:
                                     1226  4770 ;
                                     1226  4771 ;	R0-R4 are destroyed
                                     1226  4772 ;	The TQE is started
                                     1226  4773 ;
                                     1226  4774 ;--
                                     1226  4775 	.align long
                                     1228  4776 	.enable lsb
                                     1228  4777 INIT_LOAD_SHARE:
                                     1228  4778 ;
                                     1228  4779 ;	Initialize global loadsharing parameters
                                     1228  4780 ;
     00000000'GF   0000012C 8F   D0  1228  4781 	MOVL	#300, G^SCS$GL_INIT_TIMEOUT	; initial conn. redistribution time
                            3C   D0  1233  4782 	MOVL	#60,-			; 1 minute
                   00000000'GF       1235  4783 		G^SCS$GL_MIN_PORT_WAIT_INTERVAL	
                   00000078 8F   D0  123A  4784 	MOVL	#120,-			; 2 minute
                   00000000'GF       1240  4785 		 G^SCS$GL_MIN_CONN_WAIT_INTERVAL
                            0A   90  1245  4786 	MOVB	#10,-			; max. # of connections allowed
                   00000000'GF       1247  4787 		 G^SCS$GB_DISCON_LIMIT	; to disconnect per load share domain
                                     124C  4788 
                   00000000'GF   DE  124C  4789 	MOVAL	G^SCS$GQ_LOCAL_NAMES,-	; Init the local name queue
                   00000000'GF       1252  4790 		G^SCS$GQ_LOCAL_NAMES
                   00000000'GF   DE  1257  4791 	MOVAL	G^SCS$GQ_LOCAL_NAMES,-	
                   00000004'GF       125D  4792 		G^SCS$GQ_LOCAL_NAMES+4
                   00000000'GF   DE  1262  4793 	MOVAL	G^SCS$GQ_REUSE_CDT,-	; Init the reusable CDT queue
                   00000000'GF       1268  4794 		G^SCS$GQ_REUSE_CDT
                   00000000'GF   DE  126D  4795 	MOVAL	G^SCS$GQ_REUSE_CDT,-	
                   00000004'GF       1273  4796 		G^SCS$GQ_REUSE_CDT+4
                   00000000'GF   DE  1278  4797 	MOVAL	G^SCS$GQ_DISCONNECT,-	; Init the disconnect CDT queue
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 113
X-19                            -  INIT_LOAD_SHARE - start load sharing  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (25)

                   00000000'GF       127E  4798 		G^SCS$GQ_DISCONNECT
                   00000000'GF   DE  1283  4799 	MOVAL	G^SCS$GQ_DISCONNECT,-	
                   00000004'GF       1289  4800 		G^SCS$GQ_DISCONNECT+4
                   00000000'GF   DE  128E  4801 	MOVAL	G^SCS$GQ_WORSE_PATH,-	; Init the worse path CDT queue
                   00000000'GF       1294  4802 		G^SCS$GQ_WORSE_PATH
                   00000000'GF   DE  1299  4803 	MOVAL	G^SCS$GQ_WORSE_PATH,-	
                   00000004'GF       129F  4804 		G^SCS$GQ_WORSE_PATH+4
                                     12A4  4805 
                  51   008C 8F   3C  12A4  4806 	MOVZWL	#PDTLIST$C_LENGTH,R1	; Allocate PDT List vector 
                   00000000'GF   16  12A9  4807 	JSB	G^EXE$ALONONPAGED	; from some non-paged pool
                         03 50   E8  12AF  4808 	BLBS	R0,5$			; Continue if available
                          0135   31  12B2  4809 	BRW	10$			; Exit if none available
                            82   7C  12B5  4810 5$:  	CLRQ	(R2)+			; Clear FLINK and BLINK
                       82   51   B0  12B7  4811 	MOVW	R1,(R2)+		; Set size
                                 B0  12BA  4812 	MOVW	#DYN$C_SCS-		; Set type and subtype
                                     12BB  4813 		!<DYN$C_SCS_PDTLIST@8>,-
                  82   0C60 8F       12BB  4814 		(R2)+
              00000000'GF   52   D0  12BF  4815 	MOVL	R2,-			; Save the address of 1st entry
                                     12C6  4816 		G^SCS$GL_LOAD_SHARE_PDT_TABLE 
                            38   BB  12C6  4817 	PUSHR	#^M<R3,R4,R5>		; Save reg for MOVC5
               00   00 8F   00   2C  12C8  4818 	MOVC5	#0,#0,#0,-		; Zero the vector entries
                       0080 8F       12CD  4819 		#<4*<PDTLIST$C_MAX_INDEX>>,-
                            62       12D0  4820 		(R2)
                            38   BA  12D1  4821 	POPR	#^M<R3,R4,R5>		; Restore regs.
                                     12D3  4822 
                       51   34   3C  12D3  4823 	MOVZWL	#TQE$C_LENGTH,R1	; Length of the TQE
                   00000000'GF   16  12D6  4824 	JSB	G^EXE$ALONONPAGED	; Get one
                         03 50   E8  12DC  4825 	BLBS	R0,6$			; Continue if available
                          0108   31  12DF  4826 	BRW	10$			; Exit if none available
              00000008'EF   52   D0  12E2  4827 6$:	MOVL	R2,SCS_L_SHARE_TQE	; Save it
                    50   08 A2   9E  12E9  4828 	MOVAB	TQE$W_SIZE(R2),R0	; point to the size
                                     12ED  4829 	ASSUME  TQE$B_TYPE   EQ TQE$W_SIZE+2
                                     12ED  4830 	ASSUME  TQE$B_RQTYPE EQ TQE$B_TYPE+1
                                     12ED  4831 	ASSUME  TQE$L_FPC    EQ TQE$B_RQTYPE+1
                       80   51   B0  12ED  4832 	MOVW	R1,(R0)+		; Set the size
                       80   0F   90  12F0  4833 	MOVB	#DYN$C_TQE,(R0)+	; Set the type
                       80   05   90  12F3  4834 	MOVB	#TQE$C_SSREPT,(R0)+ 	; Set the request type
              60   00001436'EF   9E  12F6  4835 	MOVAB	SCS_LOAD_SHARE_TIMER,(R0) ; Set the TQE routine
                   00989680 8F   7A  12FD  4836 	EMUL	#10*1000*1000,-		; Store the timeout interval
                   00000000'GF       1303  4837 		G^SCS$GL_LOAD_SHARE_INTERVAL,-
                    20 A2   00       1308  4838 		#0,TQE$Q_DELTA(R2)
                            55   DD  130B  4839         PUSHL   R5			; Save register 5
              55   00000008'EF   D0  130D  4840 	MOVL	SCS_L_SHARE_TQE,R5	; Get the TQE 
                   00000008'EF   D4  1314  4841 	CLRL	SCS_L_SHARE_TQE		; Clear the address
                                     131A  4842 	READ_SYSTIME	R0		; Get current system time
                       7E   12   DB  131A       	 MFPR	S^#PR$_IPL,-(SP)
                10 00000000'GF   E9  131D       	BLBC	G^SMP$GL_FLAGS,30060$
                            50   DD  1324       	 PUSHL	R0
                       50   23   9A  1326       	 MOVZBL	S^#SPL$C_HWCLK,R0
                   00000000'GF   16  1329       	 JSB	G^SMP$ACQUIRE
                            50 8ED0  132F       	 POPL	R0
                            03   11  1332       	BRB	30061$
                                     1334       30060$:
                       12   18   DA  1334       		MTPR	S^#IPL$_HWCLK,S^#PR$_IPL
                                     1337       30061$:
              50   00000000'GF   7D  1337       	  MOVQ	G^EXE$GQ_SYSTIME,R0
                0E 00000000'GF   E9  133E       	BLBC	G^SMP$GL_FLAGS,30067$
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 114
X-19                            -  INIT_LOAD_SHARE - start load sharing  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (25)

                            50   DD  1345       	 PUSHL	R0
                       50   23   9A  1347       	 MOVZBL	S^#SPL$C_HWCLK,R0
                   00000000'GF   16  134A       	 JSB	G^SMP$RELEASE
                            50 8ED0  1350       	 POPL	R0
                                     1353       30067$:
                       12   8E   DA  1353       	 MTPR	(SP)+,S^#PR$_IPL
                    50   20 A2   C0  1356  4843 	ADDL	TQE$Q_DELTA(R2),R0	; Add the timeout value to
                    51   24 A2   D8  135A  4844 	ADWC	TQE$Q_DELTA+4(R2),R1	;  current time to get
                                     135E  4845 					;  expiration time
                   00000000'GF   16  135E  4846 	JSB	G^EXE$INSTIMQ		; Start the TQE by queuing 
                            55 8ED0  1364  4847 	POPL	R5			; Restore register 5
                                     1367  4848 ;
                                     1367  4849 ; (TYC 7-Mar-89) Initialize and start another TQE to
                                     1367  4850 ; redistribute connections at boot time.
                                     1367  4851 ;
                       51   34   3C  1367  4852 	MOVZWL	#TQE$C_LENGTH,R1	; Length of the TQE
                   00000000'GF   16  136A  4853 	JSB	G^EXE$ALONONPAGED	; Get one
                         77 50   E9  1370  4854 	BLBC	R0,10$
                    50   08 A2   9E  1373  4855 	MOVAB	TQE$W_SIZE(R2),R0	; point to the size
                                     1377  4856 	ASSUME  TQE$B_TYPE   EQ TQE$W_SIZE+2
                                     1377  4857 	ASSUME  TQE$B_RQTYPE EQ TQE$B_TYPE+1
                                     1377  4858 	ASSUME  TQE$L_FPC    EQ TQE$B_RQTYPE+1
                       80   51   B0  1377  4859 	MOVW	R1,(R0)+		; Set the size
                       80   0F   90  137A  4860 	MOVB	#DYN$C_TQE,(R0)+	; Set the type
                       80   01   90  137D  4861 	MOVB	#TQE$C_SSSNGL,(R0)+ 	; Set the request type
                                     1380  4862 					; to single shot request
              60   000013EB'EF   9E  1380  4863 	MOVAB	SCS_REDISTRIBUTE_CDTS,(R0) ; Set the TQE routine
                   00989680 8F   7A  1387  4864 	EMUL	#10*1000*1000,-		; Store the timeout interval
                   00000000'GF       138D  4865 		G^SCS$GL_INIT_TIMEOUT,-
                    20 A2   00       1392  4866 		#0,TQE$Q_DELTA(R2)
                            55   DD  1395  4867         PUSHL   R5			; Save register 5
                       55   52   D0  1397  4868 	MOVL	R2,R5			; Get the TQE 
                                     139A  4869 	READ_SYSTIME	R0		; Get the current system time
                       7E   12   DB  139A       	 MFPR	S^#PR$_IPL,-(SP)
                10 00000000'GF   E9  139D       	BLBC	G^SMP$GL_FLAGS,30073$
                            50   DD  13A4       	 PUSHL	R0
                       50   23   9A  13A6       	 MOVZBL	S^#SPL$C_HWCLK,R0
                   00000000'GF   16  13A9       	 JSB	G^SMP$ACQUIRE
                            50 8ED0  13AF       	 POPL	R0
                            03   11  13B2       	BRB	30074$
                                     13B4       30073$:
                       12   18   DA  13B4       		MTPR	S^#IPL$_HWCLK,S^#PR$_IPL
                                     13B7       30074$:
              50   00000000'GF   7D  13B7       	  MOVQ	G^EXE$GQ_SYSTIME,R0
                0E 00000000'GF   E9  13BE       	BLBC	G^SMP$GL_FLAGS,30080$
                            50   DD  13C5       	 PUSHL	R0
                       50   23   9A  13C7       	 MOVZBL	S^#SPL$C_HWCLK,R0
                   00000000'GF   16  13CA       	 JSB	G^SMP$RELEASE
                            50 8ED0  13D0       	 POPL	R0
                                     13D3       30080$:
                       12   8E   DA  13D3       	 MTPR	(SP)+,S^#PR$_IPL
                    50   20 A2   C0  13D6  4870 	ADDL	TQE$Q_DELTA(R2),R0	; Add the timeout value to
                    51   24 A2   D8  13DA  4871 	ADWC	TQE$Q_DELTA+4(R2),R1	;  current time to get
                                     13DE  4872 					;  expiration time
                   00000000'GF   16  13DE  4873 	JSB	G^EXE$INSTIMQ		; Start the TQE by queuing
                            55 8ED0  13E4  4874 	POPL	R5			; Restore register 5
                                     13E7  4875 ; 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 115
X-19                            -  INIT_LOAD_SHARE - start load sharing  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (25)

                       50   01   9A  13E7  4876 	MOVZBL	#SS$_NORMAL,R0		; Declare success
                                 05  13EA  4877 10$:	RSB				; Done for now
                                     13EB  4878 	.disable lsb
                                     13EB  4879 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 116
X-19                            -  SCS_REDISTRIBUTE_CDTS                 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (26)

                                     13EB  4881 	.SBTTL  -		SCS_REDISTRIBUTE_CDTS 
                                     13EB  4882 ;+
                                     13EB  4883 ;
                                     13EB  4884 ; FUNCTIONAL DESCRIPTION:
                                     13EB  4885 ;
                                     13EB  4886 ;	This routine is called only once after the system boots in order
                                     13EB  4887 ;	to redistribute the connections that were formed in the boot CI port.
                                     13EB  4888 ;	It is done by calling either the SYSAP's MOVE_PATH routine or
                                     13EB  4889 ;	error routine asking to disconnect.  All connections on the boot port
                                     13EB  4890 ;	that were formed prior to this routine call will be asked to disconnect.
                                     13EB  4891 ;
                                     13EB  4892 ; CALLING SEQUENCE:
                                     13EB  4893 ;
                                     13EB  4894 ;	Called from a TQE
                                     13EB  4895 ;
                                     13EB  4896 ; INPUT PARAMETERS:
                                     13EB  4897 ;
                                     13EB  4898 ;	R5 = TQE address
                                     13EB  4899 ;
                                     13EB  4900 ; OUTPUT PARAMETERS:
                                     13EB  4901 ;
                                     13EB  4902 ;	R5 = TQE address
                                     13EB  4903 ;
                                     13EB  4904 ; COMPLETION CODES;
                                     13EB  4905 ;
                                     13EB  4906 ;	NONE
                                     13EB  4907 ;
                                     13EB  4908 ; SIDE EFFECTS:
                                     13EB  4909 ;
                                     13EB  4910 ;	R0 is destroyed
                                     13EB  4911 ;
                                     13EB  4912 ;-
                                     13EB  4913 	.enable lsb
                                     13EB  4914 SCS_REDISTRIBUTE_CDTS:
                                     13EB  4915 ;**************
                                     13EB  4916 ;****** not implemented yet ********
                                     13EB  4917 ;**************	
                                 05  13EB  4918 	RSB
                                     13EC  4919 	.disable lsb
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 117
X-19                            -  SCS_GET_LOAD_VECTOR - allocate a load 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (27)

                                     13EC  4921 	.SBTTL	-		SCS_GET_LOAD_VECTOR - allocate a load vector
                                     13EC  4922 ;+
                                     13EC  4923 ;  SCS_GET_LOAD_VECTOR
                                     13EC  4924 ; 
                                     13EC  4925 ; FUNCTIONAL DESCRIPTION:
                                     13EC  4926 ;
                                     13EC  4927 ;	This routine obtains the address of the port load vector
                                     13EC  4928 ;	and allocates one if none exists.
                                     13EC  4929 ;
                                     13EC  4930 ; CALLING SEQUENCE:
                                     13EC  4931 ;
                                     13EC  4932 ;	BSBW	SCS_GET_LOAD_VECTOR
                                     13EC  4933 ;
                                     13EC  4934 ; INPUT PARAMETERS:
                                     13EC  4935 ;
                                     13EC  4936 ;	R4	- address of the PDT.
                                     13EC  4937 ;
                                     13EC  4938 ; OUTPUT PARAMETERS:
                                     13EC  4939 ;
                                     13EC  4940 ;	R2	- address of the load vector
                                     13EC  4941 ;
                                     13EC  4942 ; COMPLETION CODES:
                                     13EC  4943 ;
                                     13EC  4944 ;	R0	- lbs if successful
                                     13EC  4945 ;		- SS$_INSFMEM	no pool
                                     13EC  4946 ;		- 0		incompatible PDT
                                     13EC  4947 ;
                                     13EC  4948 ; SIDE EFFECTS:
                                     13EC  4949 ;
                                     13EC  4950 ;	SCS_VECTOR_FLAG is set when an insufficient pool condition occurs
                                     13EC  4951 ;	 to indicate that the information in the vectors may be invalid.
                                     13EC  4952 ;	R0,R2 destroyed
                                     13EC  4953 ;
                                     13EC  4954 ;--
                                     13EC  4955 	.enable lsb
                                     13EC  4956 SCS_GET_LOAD_VECTOR:
                            02   B1  13EC  4957 	CMPW	#PDT$C_BALANCEVER,-	; Do we understand this PDT?
                       00F4 C4       13EE  4958 		PDT$W_SCSVERSION(R4)
                            03   15  13F1  4959 	BLEQ	10$			; Branch if we do
                            50   D4  13F3  4960 	CLRL	R0			; Signal failure
                                 05  13F5  4961 	RSB				;  and return
                  52   00F8 C4   D0  13F6  4962 10$:	MOVL	PDT$L_LOAD_VECTOR(R4),R2 ; Get the load vector
                            35   12  13FB  4963 	BNEQ	40$			; One exists
                                     13FD  4964 	;
                                     13FD  4965 	; Here we need to allocate a load vector
                                     13FD  4966 	;
                            3A   BB  13FD  4967 	PUSHR	#^M<R1,R3,R4,R5>	; Save some registers
                       51   3C   3C  13FF  4968 	MOVZWL	#PLVEC$C_LENGTH,R1 ; Get the size
                   00000000'GF   16  1402  4969 	JSB	G^EXE$ALONONPAGED	; Get some non-paged pool
                         0A 50   E8  1408  4970 	BLBS	R0,20$			; Branch if we have one
                                     140B  4971 	;
                                     140B  4972 	; Here we have no pool.  
                                     140B  4973 	;
              0000000C'EF   01   88  140B  4974 	BISB	#1,SCS_VECTOR_FLAG	; Flag that the vectors are invalid
                            3A   BA  1412  4975 	POPR	#^M<R1,R3,R4,R5>	; Restore some registers
                                 05  1414  4976 	RSB				; Return 
                                     1415  4977 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 118
X-19                            -  SCS_GET_LOAD_VECTOR - allocate a load 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (27)

                            82   7C  1415  4978 20$:	CLRQ	(R2)+			; Clear FLINK and BLINK
                       82   51   B0  1417  4979 	MOVW	R1,(R2)+		; Set size
                                 B0  141A  4980 	MOVW	#DYN$C_SCS-		; Set type and subtype
                                     141B  4981 		!<DYN$C_SCS_PLVEC@8>,-
                  82   0B60 8F       141B  4982 		(R2)+
                  00F8 C4   52   D0  141F  4983 	MOVL	R2,PDT$L_LOAD_VECTOR(R4) ; Save the address of interest
                            52   DD  1424  4984 	PUSHL	R2			; Save offset
               00   00 8F   00   2C  1426  4985 	MOVC5	#0,#0,#0,-		; Zero the vector entries
                            2C       142B  4986 		#<4*<PLVEC$C_MAX_INDEX+1>>,-
                            62       142C  4987 		(R2)
                            52 8ED0  142D  4988 	POPL	R2			; Restore offset
                            3A   BA  1430  4989 30$:	POPR	#^M<R1,R3,R4,R5>	; Restore remaining registers
                       50   01   9A  1432  4990 40$:	MOVZBL	#SS$_NORMAL,R0		; Set success
                                 05  1435  4991 	RSB				; and return
                                     1436  4992 	.disable lsb
                                     1436  4993 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 119
X-19                            -  SCS_LOAD_SHARE_TIMER - periodic TQE r 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (28)

                                     1436  4995 	.SBTTL	-		SCS_LOAD_SHARE_TIMER - periodic TQE routine
                                     1436  4996 ;++
                                     1436  4997 ;
                                     1436  4998 ; FUNCTIONAL DESCRIPTION:
                                     1436  4999 ;
                                     1436  5000 ;	This routine is periodically activated by a TQE at each load
                                     1436  5001 ;	sharing interval to distribute loads among load sharing ports.
                                     1436  5002 ;
                                     1436  5003 ;	If the SCS$GL_SHARE_ENABLE flag is not set (i.e. dynamic load sharing
                                     1436  5004 ;	disabled), this routine does nothing and just returns.
                                     1436  5005 ;	
                                     1436  5006 ;	The following is a rough description of the algorithm used in
                                     1436  5007 ;	this routine:
                                     1436  5008 ;
                                     1436  5009 ;		Call SCS_CHECK_QUEUES to check various load sharing queues
                                     1436  5010 ;(TYC 31-Aug-89)
                                     1436  5011 ;		If the conditional assembly flag EXTRA_CTR is defined, 
                                     1436  5012 ;		  call SCS_CTRS_UPDATE to update the peak
                                     1436  5013 ;			and average counters
                                     1436  5014 ;
                                     1436  5015 ;(TYC0016)	Call SCS_CALC_BYTES_XFER
                                     1436  5016 ;
                                     1436  5017 ;		Get first active PDT from SCS$GL_AVAILABLE_PORT
                                     1436  5018 ;	LOOP1:
                                     1436  5019 ;		Clear NUM_DISCONNECT
                                     1436  5020 ;		Get PDT's load sharing domain bit map, PDT$L_PORT_MAP
                                     1436  5021 ;		IF (only bit set is for the current PDT)
                                     1436  5022 ;		  BRANCH to CAL_DOMAIN:
                                     1436  5023 ;		ELSE
                                     1436  5024 ;		  Perform logical AND operation on PDT$L_PORT_MAP and
                                     1436  5025 ;			SCS$GL_AVAILABLE_PORT
                                     1436  5026 ;		  Call CHECK_MIN_PORT_WAIT to check port wait time
                                     1436  5027 ;		  Call CALCULATE_LOAD to get system load, port fair share,
                                     1436  5028 ;			and to evaluate ports' available/excess thruput
                                     1436  5029 ;	LOOP2:	   
                                     1436  5030 ;		  IF ((LS_DOMAIN_PORTS map is clear) OR
                                     1436  5031 ;		      (NUM_DISCONNECT = SCS$GB_DISCON_LIMIT))
                                     1436  5032 ;		    BRANCH to CAL_DOMAIN:
                                     1436  5033 ;		  ELSE
                                     1436  5034 ;		    Call MOST_LOADED to find most loaded port
                                     1436  5035 ;		    Call LEAST_LOADED to find least loaded port
                                     1436  5036 ;	LOOP3:
                                     1436  5037 ;		    Call FIND_BEST_MATCH to find best match connection
                                     1436  5038 ;		    IF (the best match CDT not found)
                                     1436  5039 ;		      Clear current least loaded port's bit from
                                     1436  5040 ;			AVAILABLE_THRUPUT_PORTS
                                     1436  5041 ;		      IF (AVAILABLE_THRUPUT_PORTS is clear)
                                     1436  5042 ;			Clear current most loaded port from
                                     1436  5043 ;			  LS_DOMAIN_PORTS map
                                     1436  5044 ;		        Update AVAILABLE_THRUPUT_PORTS for remaining
                                     1436  5045 ;			  ports
                                     1436  5046 ;			BRANCH to LOOP2:
                                     1436  5047 ;		      ELSE
                                     1436  5048 ;			Call LEAST_LOADED to get next least loaded port
                                     1436  5049 ;			BRANCH to LOOP3:
                                     1436  5050 ;		      END
                                     1436  5051 ;		    ELSE 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 120
X-19                            -  SCS_LOAD_SHARE_TIMER - periodic TQE r 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (28)

                                     1436  5052 ;		      Update AVAILABLE_THRUPUT_PORTS for remaining ports
                                     1436  5053 ;		      BRANCH to LOOP2:
                                     1436  5054 ;		    END
                                     1436  5055 ;		  END
                                     1436  5056 ;		END
                                     1436  5057 ;	CAL_DOMAIN:
                                     1436  5058 ;		Find next load sharing domain by:
                                     1436  5059 ;		  XORing current domain map PDT$L_PORT_MAP,
                                     1436  5060 ;		  ANDing the result with SCS$GL_AVAILABLE_PORT,
                                     1436  5061 ;		  getting the first PDT from the resultant map
                                     1436  5062 ;		IF (no more domain left)
                                     1436  5063 ;		  BRANCH to EXIT:
                                     1436  5064 ;		ELSE
                                     1436  5065 ;		  BRANCH to LOOP1:
                                     1436  5066 ;		END
                                     1436  5067 ;	EXIT: 
                                     1436  5068 ;		Call SCS_UPDATE_REG_CTRS to update regular counters
                                     1436  5069 ;		Call SCS_PROCESS_CDTS to process CDTs on disconnect queue
                                     1436  5070 ;
                                     1436  5071 ; CALLING SEQUENCE:
                                     1436  5072 ;
                                     1436  5073 ;	Called from a TQE	
                                     1436  5074 ;	
                                     1436  5075 ; INPUT PARAMETERS:
                                     1436  5076 ;
                                     1436  5077 ;	R5 = TQE address
                                     1436  5078 ;
                                     1436  5079 ; OUTPUT PARAMETERS:
                                     1436  5080 ;
                                     1436  5081 ;	R5 = TQE address
                                     1436  5082 ;
                                     1436  5083 ; COMPLETION CODES:
                                     1436  5084 ;
                                     1436  5085 ;	NONE
                                     1436  5086 ;
                                     1436  5087 ; SIDE EFFECTS:
                                     1436  5088 ;
                                     1436  5089 ;	R0-R4 are destroyed
                                     1436  5090 ;	R2 is used for PDT address table pointer
                                     1436  5091 ;	R11 is used for keeping updated subset of
                                     1436  5092 ;		SCS$GL_AVAILABLE_PORT map
                                     1436  5093 ;
                                     1436  5094 ;--
                                     1436  5095 	.enable lsb
                                     1436  5096 SCS_LOAD_SHARE_TIMER:
                       0FE0 8F   BB  1436  5097 	PUSHR	#^M<R5,R6,R7,R8,R9,R10,R11>	; Save some registers	
                                     143A  5098 	LOCK	LOCKNAME=SCS,-		; Lock access to SCS structures
                                     143A  5099 		LOCKIPL=#IPL$_SYNCH,-	; Set IPL
                                     143A  5100 		PRESERVE=NO		; Don't preserve R0
                0B 00000000'GF   E9  143A       	BLBC	G^SMP$GL_FLAGS,30086$
                       50   34   9A  1441       	 MOVZBL	S^#SPL$C_SCS,R0
                   00000000'GF   16  1444       	 JSB	G^SMP$ACQUIRE
                            03   11  144A       	BRB	30087$
                                     144C       30086$:
                       12   08   DA  144C       		MTPR	S^#IPL$_SCS,S^#PR$_IPL
                                     144F       30087$:
                   00000000'GF   D0  144F  5101 	MOVL	G^EXE$GL_ABSTIM,-	; (26-Apr-89) Timestamp beginning 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 121
X-19                            -  SCS_LOAD_SHARE_TIMER - periodic TQE r 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (28)

                   00000039'EF       1455  5102 		LOAD_SHARE_BEG_TIME	;  of timer routine
                                     145A  5103 
                          071F   30  145A  5104 	BSBW	SCS_CHECK_QUEUES	; Call subroutine to check queues
                                     145D  5105 	
              00000000'GF   00   E0  145D  5106 	BBS	#0,G^SCS$GL_SHARE_ENABLE,-; If dynamic load sharing not enabled,
                            03       1464  5107 		1$			;  exit from this routine
                          012E   31  1465  5108 	BRW	100$
                                     1468  5109 1$:	
                                     1468  5110 	.if defined EXTRA_CTR		; Conditional assembly code
                                     1468  5111 	BSBW	SCS_CTRS_UPDATE		; Update various additional counters
                                     1468  5112 	.endc
                                     1468  5113 
                          0E6B   30  1468  5114 	BSBW	SCS_CALC_BYTES_XFER	; (TYC0016) calculate "bytes transferred
                                     146B  5115 					; during last interval" counters and
                                     146B  5116 					; effective bandwidth of CI ports
                                     146B  5117 
                   00000000'GF   D0  146B  5118 	MOVL	G^SCS$GL_AVAILABLE_PORT,- ; Get a copy of bit map for use 
                            5B       1471  5119 		R11			;  in calculating next domain
                                     1472  5120 ;			
                                     1472  5121 ; Get first active PDT from SCS$GL_AVAILABLE_PORT
                                     1472  5122 ; R1 = bit position of the first PDT 
                                     1472  5123 ;
                       20   00   EA  1472  5124 	FFS	#0,#32,-
              51   00000000'GF       1475  5125 		G^SCS$GL_AVAILABLE_PORT,R1; Get first bit set
                            03   12  147B  5126 	BNEQ	2$			
                                     147D  5127 					; There's no active load sharing port 
                          0105   31  147D  5128 	BRW	EXIT			;  so update counters and exit this routine
                   00000000'GF   D0  1480  5129 2$:	MOVL	G^SCS$GL_LOAD_SHARE_PDT_TABLE,-
                            52       1486  5130 		R2			; Get the PDT addr table
                     54   6241   D0  1487  5131 	MOVL	(R2)[R1],R4		; Get the desired PDT address
                                     148B  5132 LOOP1:  
                   0000001C'EF   94  148B  5133 	CLRB	NUM_DISCONNECT		; Clear # of connections to move in
                                     1491  5134 					; this domain
                       50   01   D0  1491  5135 	MOVL	#1,R0			; Set bit map including only this port
                  50   50   51   78  1494  5136 	ASHL	R1,R0,R0		;
                  0128 C4   50   D1  1498  5137 	CMPL	R0,PDT$L_PORT_MAP(R4)	; Is there only one port in this domain?
                            03   12  149D  5138 	BNEQ	3$			; No, continue
                          00D0   31  149F  5139 	BRW	CAL_DOMAIN		; Yes, go get next domain
                                     14A2  5140 	;
                                     14A2  5141 	; Perform logical AND on PDT$L_PORT_MAP and SCS$GL_AVAILABLE_PORT
                                     14A2  5142 	; in order to find active port bits for current domain
                                     14A2  5143 	;
                  59   0128 C4   D2  14A2  5144 3$:	MCOML	PDT$L_PORT_MAP(R4),R9	; R9 = NOT (PDT$L_PORT_MAP)
              00000000'GF   59   CB  14A7  5145 	BICL3	R9,G^SCS$GL_AVAILABLE_PORT,-
                            5A       14AE  5146 		R10			; R10 = (SCS$GL_AVAILABLE_PORT) AND (NOT R9)
                       5A   50   D1  14AF  5147 	CMPL	R0,R10			; Is there only one active port in this domain?
                            03   12  14B2  5148 	BNEQ	4$			; No, continue	
                          00BB   31  14B4  5149 	BRW	CAL_DOMAIN		; Yes, go get next domain
                                     14B7  5150 	
                          036F   30  14B7  5151 4$:	BSBW	CHECK_MIN_PORT_WAIT	; Check ports' min wait time for this domain
                       57   01   D1  14BA  5152 	CMPL	#1,R7			; Are there more than one port that 
                                     14BD  5153 					;  can participate for load sharing?
                            03   12  14BD  5154 	BNEQ	5$			; Yes, continue
                          00B0   31  14BF  5155 	BRW	CAL_DOMAIN		; No, go get next domain
                                     14C2  5156 
                          03B2   30  14C2  5157 5$:	BSBW	CALCULATE_LOAD		; Calculate ports' load 
                                     14C5  5158 LOOP2:
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 122
X-19                            -  SCS_LOAD_SHARE_TIMER - periodic TQE r 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (28)

                   00000018'EF   D5  14C5  5159 	TSTL	LS_DOMAIN_PORTS		; Is there a need to load share this domain?
                            03   12  14CB  5160 	BNEQ	6$			; Yes
                          00A2   31  14CD  5161 	BRW	CAL_DOMAIN		; No, go get next domain
                   0000001C'EF   91  14D0  5162 6$:	CMPB	NUM_DISCONNECT,-
                   00000000'GF       14D6  5163 		G^SCS$GB_DISCON_LIMIT	; Have we reached the max. number to disconnect?
                            03   12  14DB  5164 	BNEQ	7$
                          0092   31  14DD  5165 	BRW	CAL_DOMAIN		; Yes, go get next domain
                                     14E0  5166 7$:
                                     14E0  5167 ;
                                     14E0  5168 ; (TYC0016) This should never happen, but in case it does, we want
                                     14E0  5169 ; to go on to next domain.
                                     14E0  5170 ;
                   00000014'EF   D5  14E0  5171 	TSTL	AVAILABLE_THRUPUT_PORTS ; Is there any avail. port?
                            03   12  14E6  5172 	BNEQ	8$			; Yes, continue
                          0087   31  14E8  5173 	BRW	CAL_DOMAIN		; No, go get next domain
                                     14EB  5174 ;
                                     14EB  5175 ; Find currently most loaded and least loaded ports in this domain
                                     14EB  5176 ;
                                     14EB  5177 8$:
                          00BD   30  14EB  5178 	BSBW	MOST_LOADED		; Get the most loaded port in R5
                            57   DD  14EE  5179 	PUSHL	R7			; Save most loaded port's position
                          00FD   30  14F0  5180 	BSBW	LEAST_LOADED		; Get the least loaded port in R6
                            57   DD  14F3  5181 	PUSHL	R7			; Save least loaded port's position
                                     14F5  5182 
                                     14F5  5183 LOOP3:
                                     14F5  5184 ;
                                     14F5  5185 ; Find a CDT with best match load to the least loaded port's 
                                     14F5  5186 ; availalable throughput and whose connection can be re-established
                                     14F5  5187 ; across the least loaded port.
                                     14F5  5188 ;
                          013D   30  14F5  5189 	BSBW	FIND_BEST_MATCH		; R3 = CDT addr if best match
                                     14F8  5190 					;   found, else zero
                            53   D5  14F8  5191 	TSTL	R3			; Was there a candidate CDT?
                            35   12  14FA  5192 	BNEQ	UPDATE_AVAIL_MAP	; Yes, go look for more work
                       59   01   D0  14FC  5193 	MOVL	#1,R9			; No
                       56   6E   D0  14FF  5194 	MOVL	(SP),R6			; Get bit pos. of least loaded port
                  59   59   56   78  1502  5195 	ASHL	R6,R9,R9		; Get mask for least loaded port
              00000014'EF   59   CA  1506  5196 	BICL	R9,-
                                     150D  5197 		AVAILABLE_THRUPUT_PORTS ; Clear least loaded port in map
                   00000014'EF   D5  150D  5198 	TSTL	AVAILABLE_THRUPUT_PORTS ; Is the map clear?
                            0A   13  1513  5199 	BEQL	10$			;Yes
                            56 8ED0  1515  5200 	POPL	R6			; Get rid of old bit position
                          00D5   30  1518  5201 	BSBW	LEAST_LOADED		; No, get next least loaded port
                            57   DD  151B  5202 	PUSHL	R7			; Save least loaded port's position
                            D6   11  151D  5203 	BRB	LOOP3			; Find next best match CDT
                                     151F  5204 10$:
                       59   01   D0  151F  5205 	MOVL	#1,R9			; 
                    55   04 AE   D0  1522  5206 	MOVL    4(SP),R5		; Get bit pos. of most loaded port
                  59   59   55   78  1526  5207 	ASHL	R5,R9,R9		; Get mask for most loaded port
              00000018'EF   59   CA  152A  5208 	BICL	R9,-
                                     1531  5209 		LS_DOMAIN_PORTS		; Clear most loaded port in map
                                     1531  5210 
                                     1531  5211 UPDATE_AVAIL_MAP:
                                     1531  5212 ;
                                     1531  5213 ; Set bits in AVAILABLE_THRUPUT_PORTS for remaining ports which
                                     1531  5214 ; still have available throughput.
                                     1531  5215 ;
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 123
X-19                            -  SCS_LOAD_SHARE_TIMER - periodic TQE r 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (28)

                                     1531  5216 ; R2  - PDT address table
                                     1531  5217 ; R10 - domain map with currently active ports
                                     1531  5218 ;
                            56 8ED0  1531  5219 	POPL	R6			; Get rid of old bit pos.
                            56 8ED0  1534  5220 	POPL	R6			; Get rid of old bit pos.
                                     1537  5221 
                            56   D4  1537  5222 	CLRL	R6			; Initialize bit position
                       59   20   D0  1539  5223 	MOVL	#32,R9			; Init. the size of bit field
             58   5A   59   56   EA  153C  5224 20$:	FFS	R6,R9,R10,R8		; Get next bit set from map
                            2C   13  1541  5225 	BEQL	40$			; No more port
                     55   6248   D0  1543  5226 	MOVL	(R2)[R8],R5		; Get the PDT address 
                       0220 C5   95  1547  5227 	TSTB	PDT$B_LS_FLAG(R5)	; Is this port available?
                            15   12  154B  5228 	BNEQ	30$			; No, get next port 
                  012C C5   00   D1  154D  5229 	CMPL	#0,PDT$L_AVAIL_THRUPUT(R5) ; Does this have free thruput?
                            0E   18  1552  5230 	BGEQ	30$			; No, get next port
                       57   01   D0  1554  5231 	MOVL	#1,R7			;
                  57   57   58   78  1557  5232 	ASHL	R8,R7,R7		; Get mask for this port
              00000014'EF   57   C8  155B  5233 	BISL	R7,-			; Set this port bit in
                                     1562  5234 		AVAILABLE_THRUPUT_PORTS;  available map
                  59   1F   58   C3  1562  5235 30$:	SUBL3	R8,#31,R9		; Get remaining size of bit field
                            07   13  1566  5236 	BEQL	40$			; End of scan
                            58   D6  1568  5237 	INCL	R8			; Set to next bit position 
                       56   58   D0  156A  5238 	MOVL	R8,R6			;  to look
                            CD   11  156D  5239 	BRB	20$			; Go back to look for next port
                                     156F  5240 
                          FF53   31  156F  5241 40$:	BRW	LOOP2			; Go find next most loaded port
                                     1572  5242 
                                     1572  5243 CAL_DOMAIN:
                                     1572  5244 ;
                                     1572  5245 ; Find the next load sharing domain by:
                                     1572  5246 ;	XORing current domain map PDT$L_PORT_MAP,
                                     1572  5247 ;	ANDing the result with SCS$GL_AVAILABLE_PORT (in R11),
                                     1572  5248 ;	(the BIC instr. does these steps in one instr)
                                     1572  5249 ;	getting the first PDT from the resultant map
                                     1572  5250 ;	
                                     1572  5251 ; The resultant bit map is saved in R11 for next domain iteration
                                     1572  5252 ; since we don't want to repeat the same domains.
                                     1572  5253 ;
                                     1572  5254 ;	R11 = resultant map of SCS$GL_AVAILABLE_PORT
                                     1572  5255 ;	R1 = position of first bit set in R11
                                     1572  5256 ;	R2 = PDT address table 
                                     1572  5257 ;
                  5B   0128 C4   CA  1572  5258 	BICL	PDT$L_PORT_MAP(R4),R11	; Take out current domain ports
             51   5B   20   00   EA  1577  5259 	FFS	#0,#32,R11,R1		; Get first bit set in resultant map
                            07   13  157C  5260 	BEQL	EXIT			; No more port
                     54   6241   D0  157E  5261 	MOVL	(R2)[R1],R4		; Get the corresponding PDT address
                          FF06   31  1582  5262 	BRW	LOOP1
                                     1585  5263 
                                     1585  5264 EXIT:
                                     1585  5265 ; 
                                     1585  5266 ; (TYC0016) Update regular load sharing PDT and CDT counters here
                                     1585  5267 ;
                          0C06   30  1585  5268 	BSBW	SCS_UPDATE_REG_CTRS	; Call subroutine to update regular counters
                                     1588  5269 
                          0DD9   30  1588  5270 	BSBW	SCS_PROCESS_CDTS	; Process the CDTs on disconnect queue
                                     158B  5271 
                   00000000'GF   D0  158B  5272 	MOVL	G^EXE$GL_ABSTIM,-	; (26-Apr-89) Timestamp ending
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 124
X-19                            -  SCS_LOAD_SHARE_TIMER - periodic TQE r 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (28)

                   0000003D'EF       1591  5273 		LOAD_SHARE_END_TIME	;  of timer routine
                                     1596  5274 
                                     1596  5275 100$:	UNLOCK	LOCKNAME=SCS,-		; Unlock SCS access
                                     1596  5276 		PRESERVE=NO		; Don't preserve R0
                09 00000000'GF   E9  1596       	BLBC	G^SMP$GL_FLAGS,30093$
                       50   34   9A  159D       	 MOVZBL	S^#SPL$C_SCS,R0
                   00000000'GF   16  15A0       	 JSB	G^SMP$RELEASE
                                     15A6       30093$:
                                     15A6  5277 					;** Don't change IPL
                       0FE0 8F   BA  15A6  5278 	POPR	#^M<R5,R6,R7,R8,R9,R10,R11>	; Restore registers	
                                 05  15AA  5279 	RSB
                                     15AB  5280 	.disable lsb
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 125
X-19                            -  MOST_LOADED - Get current most loaded 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (29)

                                     15AB  5282 	.SBTTL	-		MOST_LOADED - Get current most loaded port
                                     15AB  5283 	.SBTTL  -		LEAST_LOADED - Get current least loaded port
                                     15AB  5284 ;++
                                     15AB  5285 ;
                                     15AB  5286 ; MOST_LOADED:
                                     15AB  5287 ;
                                     15AB  5288 ;	This subroutine checks the LS_DOMAIN_PORTS map to find the
                                     15AB  5289 ;	most loaded port.  The most loaded port's PDT address is
                                     15AB  5290 ;	returned in R5.
                                     15AB  5291 ;
                                     15AB  5292 ; LEAST_LOADED:
                                     15AB  5293 ;	
                                     15AB  5294 ;	This subroutine checks the AVAILABLE_THRUPUT_PORTS map to
                                     15AB  5295 ;	find the least loaded port.  The least loaded port's PDT
                                     15AB  5296 ;	address is returned in R6.
                                     15AB  5297 ;
                                     15AB  5298 ; CALLING SEQUENCE:
                                     15AB  5299 ;
                                     15AB  5300 ;	Called from SCS_LOAD_SHARE_TIMER routine
                                     15AB  5301 ;
                                     15AB  5302 ; INPUT PARAMETERS:
                                     15AB  5303 ;	
                                     15AB  5304 ;	R2	- PDT address table
                                     15AB  5305 ; 
                                     15AB  5306 ; OUTPUT PARAMETERS:
                                     15AB  5307 ;
                                     15AB  5308 ;	R5	- PDT address of most loaded port
                                     15AB  5309 ;	R6	- PDT address of least loaded port
                                     15AB  5310 ;	R7	- Bit position of either most or least loaded port
                                     15AB  5311 ;
                                     15AB  5312 ; COMPLETION CODES:
                                     15AB  5313 ;
                                     15AB  5314 ;	NONE
                                     15AB  5315 ;
                                     15AB  5316 ; SIDE EFFECTS:
                                     15AB  5317 ;
                                     15AB  5318 ;	Input parameter is preserved.
                                     15AB  5319 ;	Registers R0,R3,R7,R8,R9 are used for computations.
                                     15AB  5320 ;
                                     15AB  5321 ;--
                                     15AB  5322 	.enable lsb
                                     15AB  5323 MOST_LOADED:
         00000018'EF   20   00   EA  15AB  5324 	FFS	#0,#32,LS_DOMAIN_PORTS,-
                            57       15B3  5325 		R7			; Init the most loaded port bit
                     55   6247   D0  15B4  5326 	MOVL	(R2)[R7],R5		; Get the PDT address
                       012C C5   D0  15B8  5327 	MOVL	PDT$L_AVAIL_THRUPUT(R5),-
                            53       15BC  5328 		R3			; Init the most excess throughput
                       58   57   D0  15BD  5329 	MOVL	R7,R8			; Set the bit position for loop
                  59   1F   58   C3  15C0  5330 10$:	SUBL3	R8,#31,R9		; Get remaining size of bit field
                            25   13  15C4  5331 	BEQL	30$			; End of scan
                            58   D6  15C6  5332 	INCL	R8			; Set to next bit position to look
                       50   58   D0  15C8  5333 	MOVL	R8,R0			;
    58   00000018'EF   59   50   EA  15CB  5334 	FFS	R0,R9,LS_DOMAIN_PORTS,R8; Get next bit position to look
                            15   13  15D4  5335 	BEQL	30$			; No more, end of scan
                     55   6248   D0  15D6  5336 	MOVL	(R2)[R8],R5		; Get the PDT address for this port
                  012C C5   53   D1  15DA  5337 	CMPL	R3,-
                                     15DF  5338 		PDT$L_AVAIL_THRUPUT(R5)	; Is the new port more overloaded?
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 126
X-19                            -  LEAST_LOADED - Get current least load 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (29)

                            08   19  15DF  5339 	BLSS	20$			; No, keep the current max.
                       57   58   D0  15E1  5340 	MOVL	R8,R7			; Yes, get the new most loaded port
                       012C C5   D0  15E4  5341 	MOVL	PDT$L_AVAIL_THRUPUT(R5),-
                            53       15E8  5342 		R3			; Update new current max.	
                            D5   11  15E9  5343 20$:	BRB	10$			
                                     15EB  5344 30$:
                     55   6247   D0  15EB  5345 	MOVL	(R2)[R7],R5		; Get the most loaded PDT address	
                                 05  15EF  5346 	RSB				; Return to caller
                                     15F0  5347 
                                     15F0  5348 LEAST_LOADED:
         00000014'EF   20   00   EA  15F0  5349 	FFS	#0,#32,AVAILABLE_THRUPUT_PORTS,-
                            57       15F8  5350 		R7			; Init the least loaded port bit
                     56   6247   D0  15F9  5351 	MOVL	(R2)[R7],R6		; Get the PDT address
                       012C C6   D0  15FD  5352 	MOVL	PDT$L_AVAIL_THRUPUT(R6),-
                            53       1601  5353 		R3			; Init the most available throughput
                       58   57   D0  1602  5354 	MOVL	R7,R8			; Set the bit position for loop
                  59   1F   58   C3  1605  5355 40$:	SUBL3	R8,#31,R9		; Get remaining size of bit field
                            25   13  1609  5356 	BEQL	60$			; End of scan
                            58   D6  160B  5357 	INCL	R8			; Set to next bit position to look
                       50   58   D0  160D  5358 	MOVL	R8,R0			;
    58   00000018'EF   59   50   EA  1610  5359 	FFS	R0,R9,LS_DOMAIN_PORTS,R8; Get next bit position to look
                            15   13  1619  5360 	BEQL	60$			; No more, end of scan
                     56   6248   D0  161B  5361 	MOVL	(R2)[R8],R6		; Get the PDT address for this port
                  012C C6   53   D1  161F  5362 	CMPL	R3,-
                                     1624  5363 		PDT$L_AVAIL_THRUPUT(R6)	; Is the new port less loaded?
                            08   14  1624  5364 	BGTR	50$			; No, keep the current least loaded
                       57   58   D0  1626  5365 	MOVL	R8,R7			; Yes, get the new least loaded port
                       012C C6   D0  1629  5366 	MOVL	PDT$L_AVAIL_THRUPUT(R6),-
                            53       162D  5367 		R3			; Update new current avail. amount	
                            D5   11  162E  5368 50$:	BRB	40$			
                                     1630  5369 60$:
                     56   6247   D0  1630  5370 	MOVL	(R2)[R7],R6		; Get the least loaded PDT address	
                                 05  1634  5371 	RSB				; Return to caller
                                     1635  5372 
                                     1635  5373 	.disable lsb
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 127
X-19                            -  FIND_BEST_MATCH - Find the best match 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (30)

                                     1635  5375 	.SBTTL	-		FIND_BEST_MATCH - Find the best match connection
                                     1635  5376 ;++
                                     1635  5377 ;
                                     1635  5378 ; FIND_BEST_MATCH:
                                     1635  5379 ;
                                     1635  5380 ;	This subroutine searches for a connection in the most loaded port
                                     1635  5381 ;	with the best match load
                                     1635  5382 ;	to the current least loaded port's available throughput and
                                     1635  5383 ;	which is able to be re-established across the least loaded port to
                                     1635  5384 ;	the same remote port since the assumption is that the remote node
                                     1635  5385 ;	is balanced.
                                     1635  5386 ; (TYC 25-Jul-89)
                                     1635  5387 ;	If there is no path to the same remote port, but there
                                     1635  5388 ;	is a path to the same remote system, this path is used as the
                                     1635  5389 ;	best possible optimal path instead.
                                     1635  5390 ;
                                     1635  5391 ;	The best match load means that it is less than or equal to
                                     1635  5392 ;	the least loaded port's available throughput and closest
                                     1635  5393 ;	in size to the available throughput.
                                     1635  5394 ;
                                     1635  5395 ; (TYC 02-Aug-89)
                                     1635  5396 ;	The algorithm also makes sure that the connection with the 
                                     1635  5397 ;	lowest load rating is selected.  This is so that more expensive
                                     1635  5398 ;	connections are moved after the less expensive connections.
                                     1635  5399 ;
                                     1635  5400 ;	If the most loaded port is in YELLOW zone, only the
                                     1635  5401 ;	YELLOW queue will be searched for CDTs.  If the port is
                                     1635  5402 ;	above RED zone, first the YELLOW queue is searched and
                                     1635  5403 ;	then the RED queue is searched.
                                     1635  5404 ;
                                     1635  5405 ;	If the best match connection is found, it is queued to the
                                     1635  5406 ;	SCS$GQ_DISCONNECT queue with the optimal path address and
                                     1635  5407 ;	load sharing disconnect flag set in the CDT to be used later
                                     1635  5408 ;	at reconnect time.  The routine also timestamps the current
                                     1635  5409 ;	most loaded port and least loaded port and updates their available
                                     1635  5410 ;	throughput values.
                                     1635  5411 ;
                                     1635  5412 ; CALLING SEQUENCE:
                                     1635  5413 ;
                                     1635  5414 ;	Called from SCS_LOAD_SHARE_TIMER routine
                                     1635  5415 ;
                                     1635  5416 ; INPUT PARAMETERS:
                                     1635  5417 ;
                                     1635  5418 ;	R1	-  Index to the first PDT in this domain
                                     1635  5419 ;	R2	-  PDT address table
                                     1635  5420 ;	R4	-  PDT address of the first port in this domain
                                     1635  5421 ;	R5	-  Current most loaded port
                                     1635  5422 ;	R6	-  Current least loaded port
                                     1635  5423 ;	R10	-  Current domain port bit map	
                                     1635  5424 ;	R11	-  Subset of SCS$GL_AVAILABLE_PORT map
                                     1635  5425 ;
                                     1635  5426 ; OUTPUT PARAMETERS:
                                     1635  5427 ;
                                     1635  5428 ;	R3	- Best match CDT address or null if not found
                                     1635  5429 ;
                                     1635  5430 ; COMPLETION CODES:
                                     1635  5431 ;
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 128
X-19                            -  FIND_BEST_MATCH - Find the best match 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (30)

                                     1635  5432 ;	NONE
                                     1635  5433 ;
                                     1635  5434 ; SIDE EFFECTS:
                                     1635  5435 ;
                                     1635  5436 ;	Input parameters are preserved.
                                     1635  5437 ;	R0,R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11 are used for computations.
                                     1635  5438 ;
                                     1635  5439 ;--
                                     1635  5440 	.enable lsb
                                     1635  5441 FIND_BEST_MATCH:
                       0C76 8F   BB  1635  5442 	PUSHR	#^M<R1,R2,R4,R5,R6,R10,R11>	; Save input registers
                            51   D4  1639  5443 	CLRL	R1			; Init best match load
                            59   D4  163B  5444 	CLRL	R9			; Init best match CDT
                  57   0110 C5   7E  163D  5445 	MOVAQ	PDT$Q_YELLOW(R5),R7	; Get YELLOW queue header
                                     1642  5446 ; (TYC 02-Aug-89)
                            55   DD  1642  5447 	PUSHL	R5			; Save most loaded port PDT
                       55   04   D0  1644  5448 	MOVL	#CDT$C_YELLOW,R5	; Init best load rating
                                     1647  5449 ;	
                       58   57   D0  1647  5450 	MOVL	R7,R8			; Copy for reference
                       58   68   D0  164A  5451 10$:	MOVL	(R8),R8			; Get first/next CDT
                       57   58   D1  164D  5452 	CMPL	R8,R7			; End of this queue?
                            74   13  1650  5453 	BEQL	ENDYELLOW		; Yes
                       FF60 C8   DE  1652  5454 	MOVAL	-CDT$L_SHARE_FLINK(R8),-
                            53       1656  5455 		R3			; Point to beg. of CDT
                   00000000'GF   C7  1657  5456 	DIVL3	G^SCS$GL_LOAD_SHARE_INTERVAL,-
                       0150 C3       165D  5457 		CDT$L_BYTES_XFER_INT(R3),- ; (TYC 31-Aug-89)
                            50       1660  5458 		R0			; Get the conn. load per second
                  012C C6   50   D1  1661  5459 	CMPL	R0,PDT$L_AVAIL_THRUPUT(R6) ; Is this load possible match?
                            E2   14  1666  5460 	BGTR	10$			; No, get next CDT
                                     1668  5461 ; (TYC 02-Aug-89)
                  55   00B0 C3   D1  1668  5462 	CMPL	CDT$L_LOAD_RATING(R3),R5; Compare conn. load rating
                            DB   14  166D  5463 	BGTR	10$			; Get next CDT if cur. rate > best
                            05   19  166F  5464 	BLSS	15$			; Don't compare load if
                                     1671  5465 					;  cur. rate < cur. best rate 
                                     1671  5466 					; If equal, compare load		
                                     1671  5467 ;
                       51   50   D1  1671  5468 	CMPL	R0,R1			; Is this the new best match?
                            D4   15  1674  5469 	BLEQ	10$			; No, check next CDT
                                     1676  5470 ;
                                     1676  5471 ; Now check for compatible path
                                     1676  5472 ;
                                     1676  5473 15$:
                            58   DD  1676  5474 	PUSHL	R8			; (TYC 25-Jul-89) Save R8
                            58   D4  1678  5475 	CLRL	R8			; Clear possible optimal path
                                     167A  5476 
                            57   DD  167A  5477 	PUSHL	R7			; Save for computation
                    52   1C A3   D0  167C  5478 	MOVL	CDT$L_PB(R3),R2		; Get conn.'s path block
                  5A   0100 C6   7E  1680  5479 	MOVAQ	PDT$Q_PB(R6),R10	; Get PB queue header
                       5B   5A   D0  1685  5480 	MOVL	R10,R11			; Copy for reference
                       5B   6B   D0  1688  5481 20$:	MOVL	(R11),R11		; Get first/next PB 
                       5A   5B   D1  168B  5482 	CMPL	R11,R10			; End of PB queue?
                            25   13  168E  5483 	BEQL	27$			; Yes, no compatible path
                         AC AB   DE  1690  5484 	MOVAL	-PB$L_SHARE_FLINK(R11),-
                            57       1693  5485 		R7			; Point to beg. of PB
                         30 A2   D1  1694  5486 	CMPL	PB$L_SBLINK(R2),-	; Are the paths compatible?
                         30 A7       1697  5487 		PB$L_SBLINK(R7)
                            ED   12  1699  5488 	BNEQ	20$			; No, check next PB
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 129
X-19                            -  FIND_BEST_MATCH - Find the best match 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (30)

                                     169B  5489 
                       58   57   D0  169B  5490 	MOVL	R7,R8			; (TYC 25-Jul-89) Save possible
                                     169E  5491 					;  optimal path	
                         0C A2   91  169E  5492 	CMPB	PB$B_RSTATION(R2),-	; (TYC 10-Jul-89) Are the remote 
                         0C A7       16A1  5493 		PB$B_RSTATION(R7)	;  ports the same?
                            E3   12  16A3  5494 	BNEQ	20$			; No, check next PB
                       54   57   D0  16A5  5495 	MOVL	R7,R4			; Yes, save new optimal path,
                       51   50   D0  16A8  5496 24$:	MOVL	R0,R1			;  update the new best match
                       59   53   D0  16AB  5497 	MOVL	R3,R9			;  load and CDT address
                                     16AE  5498 ; (TYC 02-Aug-89)
                  55   00B0 C3   D0  16AE  5499 	MOVL	CDT$L_LOAD_RATING(R3),R5;  & new lowest conn. load rating
                                     16B3  5500 		
                            09   11  16B3  5501 	BRB	30$			; 
                                     16B5  5502 ;
                                     16B5  5503 ; (TYC 25-Jul-89) No exact remote port match was found.  If there was
                                     16B5  5504 ; a possible optimal path with other remote port, use that PB.
                                     16B5  5505 ;
                            58   D5  16B5  5506 27$:	TSTL	R8			; Possible optimal path?
                            05   13  16B7  5507 	BEQL	30$			; No
                       54   58   D0  16B9  5508 	MOVL	R8,R4			; Yes, use this as optimal PB
                            EA   11  16BC  5509 	BRB	24$
                                     16BE  5510 
                            57 8ED0  16BE  5511 30$:	POPL	R7			; Restore ptr. to YELLOW queue
                            58 8ED0  16C1  5512 	POPL	R8			; (TYC 25-Jul-89) Restore R8
                                     16C4  5513 
                            84   11  16C4  5514 	BRB	10$			; Get next CDT entry
                                     16C6  5515 ENDYELLOW:
                                     16C6  5516 ;
                                     16C6  5517 ; If R1 and R9 are 0, there was no best match in YELLOW queue.
                                     16C6  5518 ;
                            55 8ED0  16C6  5519 	POPL	R5			; (TYC 02-Aug-89) Restore PDT ptr.
                                     16C9  5520 ;
                       53   59   D0  16C9  5521 	MOVL	R9,R3			; Get the best match CDT
                            53   D5  16CC  5522 	TSTL	R3			; Was there a best match?
                            03   13  16CE  5523 	BEQL	CHKRED			; (TYC 25-Jul-89) No
                          00A4   31  16D0  5524 	BRW	CDTFOUND		; Yes, go process further
                                     16D3  5525 ;
                                     16D3  5526 ; Check most loaded port's load zone to see if in RED zone.  If so,
                                     16D3  5527 ; loop through RED queue for best match connection.
                                     16D3  5528 ;
                                     16D3  5529 CHKRED:					; (TYC 25-Jul-89)
                            06   D1  16D3  5530 	CMPL	#PDT$C_RED,-		; Is the port in RED zone?
                       0130 C5       16D5  5531 		PDT$L_LOAD_RATING(R5)
                            03   13  16D8  5532 	BEQL	35$			; Yes, check the RED queue
                          0147   31  16DA  5533 	BRW	80$			; No, we didn't have best match
                                     16DD  5534 35$:					; 
                            51   D4  16DD  5535 	CLRL	R1			; Init best match load
                            59   D4  16DF  5536 	CLRL	R9			; Init best match CDT
                  57   0118 C5   7E  16E1  5537 	MOVAQ	PDT$Q_RED(R5),R7	; Get RED queue header
                                     16E6  5538 ; (TYC 02-Aug-89)
                            55   DD  16E6  5539 	PUSHL	R5			; Save most loaded port PDT
                       55   06   D0  16E8  5540 	MOVL	#CDT$C_RED,R5		; Init best load rating
                                     16EB  5541 ;	
                       58   57   D0  16EB  5542 	MOVL	R7,R8			; Copy for reference
                       58   68   D0  16EE  5543 40$:	MOVL	(R8),R8			; Get first/next CDT
                       57   58   D1  16F1  5544 	CMPL	R8,R7			; End of this queue?
                            74   13  16F4  5545 	BEQL	ENDRED			; Yes
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 130
X-19                            -  FIND_BEST_MATCH - Find the best match 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (30)

                       FF60 C8   DE  16F6  5546 	MOVAL	-CDT$L_SHARE_FLINK(R8),-
                            53       16FA  5547 		R3			; Point to beg. of CDT
                   00000000'GF   C7  16FB  5548 	DIVL3	G^SCS$GL_LOAD_SHARE_INTERVAL,-
                       0150 C3       1701  5549 		CDT$L_BYTES_XFER_INT(R3),- ; (TYC 31-Aug-89)
                            50       1704  5550 		R0			; Get the conn. load per second
                  012C C6   50   D1  1705  5551 	CMPL	R0,PDT$L_AVAIL_THRUPUT(R6) ; Is this load possible match?
                            E2   14  170A  5552 	BGTR	40$			; No, get next CDT
                                     170C  5553 ; (TYC 02-Aug-89)
                  55   00B0 C3   D1  170C  5554 	CMPL	CDT$L_LOAD_RATING(R3),R5; Compare conn. load rating
                            DB   14  1711  5555 	BGTR	40$			; Get next CDT if cur. rate > best
                            05   19  1713  5556 	BLSS	45$			; Don't compare load if
                                     1715  5557 					;  cur. rate < cur. best rate 
                                     1715  5558 					; If equal, compare load		
                                     1715  5559 ;
                       51   50   D1  1715  5560 	CMPL	R0,R1			; Is this the new best match?
                            D4   15  1718  5561 	BLEQ	40$			; No, check next CDT
                                     171A  5562 ;
                                     171A  5563 ; Now check for compatible path
                                     171A  5564 ;
                                     171A  5565 45$:
                            58   DD  171A  5566 	PUSHL	R8			; (TYC 25-Jul-89) Save R8
                            58   D4  171C  5567 	CLRL	R8			; Clear possible optimal path
                                     171E  5568 
                            57   DD  171E  5569 	PUSHL	R7			; Save for computation
                    52   1C A3   D0  1720  5570 	MOVL	CDT$L_PB(R3),R2		; Get conn.'s path block
                  5A   0100 C6   7E  1724  5571 	MOVAQ	PDT$Q_PB(R6),R10	; Get PB queue header
                       5B   5A   D0  1729  5572 	MOVL	R10,R11			; Copy for reference
                       5B   6B   D0  172C  5573 50$:	MOVL	(R11),R11		; Get first/next PB 
                       5A   5B   D1  172F  5574 	CMPL	R11,R10			; End of PB queue?
                            25   13  1732  5575 	BEQL	57$			; Yes, no compatible path
                         AC AB   DE  1734  5576 	MOVAL	-PB$L_SHARE_FLINK(R11),-
                            57       1737  5577 		R7			; Point to beg. of PB
                         30 A2   D1  1738  5578 	CMPL	PB$L_SBLINK(R2),-	; Are the paths compatible?
                         30 A7       173B  5579 		PB$L_SBLINK(R7)
                            ED   12  173D  5580 	BNEQ	50$			; No, check next PB
                                     173F  5581 
                       58   57   D0  173F  5582 	MOVL	R7,R8			; (TYC 25-Jul-89) Save possible
                                     1742  5583 					;  optimal path	
                         0C A2   91  1742  5584 	CMPB	PB$B_RSTATION(R2),-	; (TYC 10-Jul-89) Are the remote 
                         0C A7       1745  5585 		PB$B_RSTATION(R7)	;  ports the same?
                            E3   12  1747  5586 	BNEQ	50$			; No, check next PB
                       54   57   D0  1749  5587 	MOVL	R7,R4			; Yes, save new optimal path,
                       51   50   D0  174C  5588 54$:	MOVL	R0,R1			;  update the new best match
                       59   53   D0  174F  5589 	MOVL	R3,R9			;  load and CDT address
                                     1752  5590 ; (TYC 02-Aug-89)
                  55   00B0 C3   D0  1752  5591 	MOVL	CDT$L_LOAD_RATING(R3),R5;  & new lowest conn. load rating
                                     1757  5592 
                            09   11  1757  5593 	BRB	60$			; 
                                     1759  5594 ;
                                     1759  5595 ; (TYC 25-Jul-89) No exact remote port match was found.  If there was
                                     1759  5596 ; a possible optimal path with other remote port, use that PB.
                                     1759  5597 ;
                            58   D5  1759  5598 57$:	TSTL	R8			; Possible optimal path?
                            05   13  175B  5599 	BEQL	60$			; No
                       54   58   D0  175D  5600 	MOVL	R8,R4			; Yes, use this as optimal PB
                            EA   11  1760  5601 	BRB	54$
                                     1762  5602 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 131
X-19                            -  FIND_BEST_MATCH - Find the best match 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (30)

                            57 8ED0  1762  5603 60$:	POPL	R7			; Restore ptr. to RED queue
                            58 8ED0  1765  5604 	POPL	R8			; (TYC 25-Jul-89) Restore R8
                                     1768  5605 
                            84   11  1768  5606 	BRB	40$			; Get next CDT entry
                                     176A  5607 ENDRED:
                                     176A  5608 ;
                                     176A  5609 ; If R1 and R9 are 0, there was no best match in RED queue.
                                     176A  5610 ;
                            55 8ED0  176A  5611 	POPL	R5			; (TYC 02-Aug-89) Restore PDT ptr.
                                     176D  5612 ;
                       53   59   D0  176D  5613 	MOVL	R9,R3			; Get the best match CDT
                            53   D5  1770  5614 	TSTL	R3			; Was there a best match?
                            03   12  1772  5615 	BNEQ	CDTFOUND		; Yes, go process further
                          00AD   31  1774  5616 	BRW	80$			; No, return to caller
                                     1777  5617 
                                     1777  5618 CDTFOUND:
                                     1777  5619 ;
                                     1777  5620 ; Best match CDT was found.
                                     1777  5621 ;	R1 - Best match connection load
                                     1777  5622 ;	R3 - CDT address
                                     1777  5623 ;	R4 - Optimal path address to reconnect
                                     1777  5624 ;
                   0000001C'EF   96  1777  5625 	INCB	NUM_DISCONNECT		; Increment # of connections to
                                     177D  5626 					;  disconnect for this domain
                  50   00A0 C3   0F  177D  5627 	REMQUE	CDT$L_SHARE_FLINK(R3),R0 ; Remove CDT from current queue 
                       00A0 C3   0E  1782  5628 	INSQUE	CDT$L_SHARE_FLINK(R3),- ; Insert the CDT at the head of
                   00000000'GF       1786  5629 		G^SCS$GQ_DISCONNECT	;  disconnect queue
                   00000000'GF   D0  178B  5630 	MOVL	G^EXE$GL_ABSTIM,-	; Timestamp the queue insertion
                       00B8 C3       1791  5631 		CDT$L_QUEUE_TIME_STAMP(R3)
                  00C0 C3   54   D0  1794  5632 	MOVL	R4,CDT$L_OPTIMAL_PATH(R3); Save optimal path address
                         30 A4   D0  1799  5633 	MOVL	PB$L_SBLINK(R4),-
                       00A8 C3       179C  5634 		CDT$L_SB(R3)		; Copy optimal path's system block addr
                  0156 C3   01   90  179F  5635 	MOVB	#1,CDT$B_LS_FLAG(R3)	; Set flag for load share disconn.
                  012C C5   51   C0  17A4  5636 	ADDL	R1,-			; Update avail thruput for most
                                     17A9  5637 		PDT$L_AVAIL_THRUPUT(R5) ;  loaded port
                  012C C6   51   C2  17A9  5638 	SUBL	R1,-			; Update avail thruput for least
                                     17AE  5639 		PDT$L_AVAIL_THRUPUT(R6) ;  loaded port
                   00000000'GF   D0  17AE  5640 	MOVL	G^EXE$GL_ABSTIM,-	; Timestamp both ports		
                       0134 C5       17B4  5641 		PDT$L_TIME_STAMP(R5)	;
                   00000000'GF   D0  17B7  5642 	MOVL	G^EXE$GL_ABSTIM,-	;		
                       0134 C6       17BD  5643 		PDT$L_TIME_STAMP(R6)
                            00   D1  17C0  5644 	CMPL	#0,-			; Does least loaded port still
                       012C C6       17C2  5645 		PDT$L_AVAIL_THRUPUT(R6) ;  have any avail. thruput?
                            2B   19  17C5  5646 	BLSS	70$			; Yes
                  0220 C6   01   90  17C7  5647 	MOVB	#1,PDT$B_LS_FLAG(R6)	; No, set the flag to indicate this	
                                     17CC  5648 	GET_PDT_INDEX R1,R6,R2		; Get port bit position
                            51   D4  17CC       	CLRL	R1
                   00000000'GF   D0  17CE       	MOVL	G^SCS$GL_LOAD_SHARE_PDT_TABLE,-
                            52       17D4       		R2
                            20   D1  17D5       30097$:	CMPL	#PDTLIST$C_MAX_INDEX,-
                            51       17D7       		R1
                            0A   13  17D8       	BEQL	30098$
                     6241   56   D1  17DA       	CMPL	R6,(R2)[R1]
                            04   13  17DE       	BEQL	30098$
                            51   D6  17E0       	INCL	R1
                            F1   11  17E2       	BRB	30097$
                                     17E4       30098$:
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 132
X-19                            -  FIND_BEST_MATCH - Find the best match 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (30)

                       52   01   D0  17E4  5649 	MOVL	#1,R2			;  
                  52   52   51   78  17E7  5650 	ASHL	R1,R2,R2		; Get mask for least loaded port	
              00000014'EF   52   CA  17EB  5651 	BICL	R2,-
                                     17F2  5652 		AVAILABLE_THRUPUT_PORTS	; Clear least loaded port in map
                            00   D1  17F2  5653 70$:	CMPL	#0,-			; Does most loaded port now have
                       012C C5       17F4  5654 		PDT$L_AVAIL_THRUPUT(R5)	;  non-negative avail. thruput?
                            2B   14  17F7  5655 	BGTR	80$			; No, still overloaded
                  0220 C5   01   90  17F9  5656 	MOVB	#1,PDT$B_LS_FLAG(R5)	; Yes, set the flag for it
                                     17FE  5657 	GET_PDT_INDEX R1,R5,R2		; Get port bit position
                            51   D4  17FE       	CLRL	R1
                   00000000'GF   D0  1800       	MOVL	G^SCS$GL_LOAD_SHARE_PDT_TABLE,-
                            52       1806       		R2
                            20   D1  1807       30099$:	CMPL	#PDTLIST$C_MAX_INDEX,-
                            51       1809       		R1
                            0A   13  180A       	BEQL	30100$
                     6241   55   D1  180C       	CMPL	R5,(R2)[R1]
                            04   13  1810       	BEQL	30100$
                            51   D6  1812       	INCL	R1
                            F1   11  1814       	BRB	30099$
                                     1816       30100$:
                       52   01   D0  1816  5658 	MOVL	#1,R2			;
                  52   52   51   78  1819  5659 	ASHL	R1,R2,R2		; Get mask for most loaded port
              00000018'EF   52   CA  181D  5660 	BICL	R2,LS_DOMAIN_PORTS	; Clear from overloaded port map		
                                     1824  5661 
                       0C76 8F   BA  1824  5662 80$:	POPR	#^M<R1,R2,R4,R5,R6,R10,R11>	; Restore input registers
                                 05  1828  5663 	RSB				; Return
                                     1829  5664 	.disable lsb		
                                     1829  5665 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 133
X-19                            -  CHECK_MIN_PORT_WAIT - Check ports' mi 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (31)

                                     1829  5667 	.SBTTL	-		CHECK_MIN_PORT_WAIT - Check ports' min wait time 
                                     1829  5668 ;++
                                     1829  5669 ;
                                     1829  5670 ; CHECK_MIN_PORT_WAIT:
                                     1829  5671 ;
                                     1829  5672 ;	This subroutine checks each PDT in the current domain and if
                                     1829  5673 ;	Minimum Port Wait Interval hasn't elapsed yet, sets PDT$B_LS_FLAG
                                     1829  5674 ;	so that this port won't participate in this load sharing interval.
                                     1829  5675 ;	Otherwise the flag is cleared.	The algorithm used is as follows:
                                     1829  5676 ;	
                                     1829  5677 ;	IF (ELAPSED TIME >= (MIN. PORT WAIT INTERVAL + 1 LOAD SHARE INTERVAL
                                     1829  5678 ;				- 1 MINUTE))
                                     1829  5679 ;		THEN clear PDT$B_LS_FLAG
                                     1829  5680 ;		ELSE set PDT$B_LS_FLAG
                                     1829  5681 ;
                                     1829  5682 ;	If at the end of the routine, there is only one port with PDT$B_LS_FLAG
                                     1829  5683 ;	cleared, we don't want to deal with this domain at this load load sharing
                                     1829  5684 ;	interval.
                                     1829  5685 ; 
                                     1829  5686 ; CALLING SEQUENCE:
                                     1829  5687 ;
                                     1829  5688 ;	Called from SCS_LOAD_SHARE_TIMER routine
                                     1829  5689 ;
                                     1829  5690 ; INPUT PARAMETERS:
                                     1829  5691 ;
                                     1829  5692 ;	R1	-  Index to the first PDT in this domain
                                     1829  5693 ;	R2	-  PDT address table
                                     1829  5694 ;	R4	-  PDT address of the first port in this domain
                                     1829  5695 ;	R10	-  Current domain port bit map	
                                     1829  5696 ;
                                     1829  5697 ; OUTPUT PARAMETERS:
                                     1829  5698 ; 
                                     1829  5699 ;	R7	- Number of ports that can participate in load sharing
                                     1829  5700 ;		  at this interval
                                     1829  5701 ;
                                     1829  5702 ; COMPLETION CODES:
                                     1829  5703 ;
                                     1829  5704 ;	NONE
                                     1829  5705 ;
                                     1829  5706 ; SIDE EFFECTS:
                                     1829  5707 ;
                                     1829  5708 ;	Input parameters are preserved.
                                     1829  5709 ;	R0,R5,R6,R7,R8,R9 are used for computations.
                                     1829  5710 ;
                                     1829  5711 ;--
                                     1829  5712 	.enable lsb
                                     1829  5713 CHECK_MIN_PORT_WAIT:
                            54   DD  1829  5714 	PUSHL	R4			; Save the initial PDT address
                                     182B  5715 ;
                                     182B  5716 ; R0 = (MINN. PORT WAIT INTERVAL + 1 LOAD SHARE INTERVAL - 1 MIN)
                                     182B  5717 ;
                   00000000'GF   C1  182B  5718 	ADDL3	G^SCS$GL_MIN_PORT_WAIT_INTERVAL,-
              50   00000000'GF       1831  5719 		G^SCS$GL_LOAD_SHARE_INTERVAL,R0
                       50   3C   C2  1837  5720 	SUBL	#60,R0			; Subtract 1 minute (= 60 seconds)
                                     183A  5721 
                       58   51   D0  183A  5722 	MOVL	R1,R8			; Copy the initial port's bit position
                            57   D4  183D  5723 	CLRL	R7			; Initialize the counter
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 134
X-19                            -  CHECK_MIN_PORT_WAIT - Check ports' mi 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (31)

                                     183F  5724 
                       0134 C4   C3  183F  5725 10$:	SUBL3	PDT$L_TIME_STAMP(R4),-
              55   00000000'GF       1843  5726 		G^EXE$GL_ABSTIM,R5	; Calculate elapsed time in seconds
                       50   55   D1  1849  5727 	CMPL	R5,R0			; Is it time to use this port for load sharing?		
                            08   19  184C  5728 	BLSS	20$			; Not yet, set the flag
                       0220 C4   94  184E  5729 	CLRB	PDT$B_LS_FLAG(R4)	; Yes, so clear the flag
                            57   D6  1852  5730 	INCL	R7			; Increment the available port counter
                            05   11  1854  5731 	BRB	30$				
                  0220 C4   01   90  1856  5732 20$:	MOVB	#1,PDT$B_LS_FLAG(R4)	; Set the flag
                                     185B  5733 30$:					 
                  59   1F   58   C3  185B  5734 	SUBL3	R8,#31,R9		; Get remaining size of bit field to test
                            12   13  185F  5735 	BEQL	40$			; No more port in this domain 
                            58   D6  1861  5736 	INCL	R8			; Set to next bit position to look	
                       56   58   D0  1863  5737 	MOVL	R8,R6			; 
             58   5A   59   56   EA  1866  5738 	FFS	R6,R9,R10,R8		; Get next bit set from domain map
                            06   13  186B  5739 	BEQL	40$			; No more port
                     54   6248   D0  186D  5740 	MOVL	(R2)[R8],R4		; Get the PDT address for this port
                            CC   11  1871  5741 	BRB	10$			; Go check min. wait time for this port
                                     1873  5742 
                            54 8ED0  1873  5743 40$:	POPL	R4			; Restore initial PDT address
                                 05  1876  5744 	RSB				; return
                                     1877  5745 	.disable lsb		
                                     1877  5746 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 135
X-19                            -  CALCULATE_LOAD - Calculate ports' loa 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (32)

                                     1877  5748 	.SBTTL	-		CALCULATE_LOAD - Calculate ports' load 
                                     1877  5749 ;++
                                     1877  5750 ;
                                     1877  5751 ; CALCULATE_LOAD:
                                     1877  5752 ;
                                     1877  5753 ;	This subroutine calculates the system load and port fair share load 
                                     1877  5754 ;	for the current domain.
                                     1877  5755 ;	The current system load is the sum of all current domain's 
                                     1877  5756 ;	load share participating ports load.
                                     1877  5757 ;	The port fair share load is the current system load divided by
                                     1877  5758 ;	the number of participating ports in the domain.  This value is
                                     1877  5759 ;	then divided by the SCS$GL_LOAD_SHARE_INTERVAL to get the port
                                     1877  5760 ;	fair share load per second.  It is assumed
                                     1877  5761 ;	that all participating ports are of the same port type.
                                     1877  5762 ;
                                     1877  5763 ;	(NOTE:  For now, the total bytes transferred port counter is treated
                                     1877  5764 ;		as a longword.  If necessary, the quadword can be used in
                                     1877  5765 ;		the future.) 
                                     1877  5766 ;
                                     1877  5767 ;	Once the fair share is calculated, each of the participating ports
                                     1877  5768 ;	is checked to see if it has excess load or available throughput.
                                     1877  5769 ;
                                     1877  5770 ; CALLING SEQUENCE:
                                     1877  5771 ;
                                     1877  5772 ;	Called from SCS_LOAD_SHARE_TIMER routine
                                     1877  5773 ;
                                     1877  5774 ; INPUT PARAMETERS:
                                     1877  5775 ;
                                     1877  5776 ;	R1	-  Index to the first PDT in this domain
                                     1877  5777 ;	R2	-  PDT address table
                                     1877  5778 ;	R4	-  PDT address of the first port in this domain
                                     1877  5779 ;	R10	-  Current domain port bit map	
                                     1877  5780 ;
                                     1877  5781 ; OUTPUT PARAMETERS:
                                     1877  5782 ; 
                                     1877  5783 ;	NONE
                                     1877  5784 ;
                                     1877  5785 ; COMPLETION CODES:
                                     1877  5786 ;
                                     1877  5787 ;	NONE
                                     1877  5788 ;
                                     1877  5789 ; SIDE EFFECTS:
                                     1877  5790 ;
                                     1877  5791 ;	LS_DOMAIN_PORTS is non-zero if this domain needs load sharing.
                                     1877  5792 ;	Input parameters are preserved.
                                     1877  5793 ;	R0,R1,R3,R4,R5,R6,R7,R8,R9 are used for computations.
                                     1877  5794 ;
                                     1877  5795 ;--
                                     1877  5796 	.enable lsb
                                     1877  5797 CALCULATE_LOAD:
                            54   DD  1877  5798 	PUSHL	R4			; Save the input register
                       58   51   D0  1879  5799 	MOVL	R1,R8			; Copy the initial port's bit position
                            57   D4  187C  5800 	CLRL	R7			; Initialize the # of participating ports
                            55   7C  187E  5801 	CLRQ	R5			; Clear R5 and R6 to have intermediate result
                       0220 C4   95  1880  5802 10$:	TSTB	PDT$B_LS_FLAG(R4)	; Is this port available for load sharing?
                            0A   12  1884  5803 	BNEQ	20$			; No, get next port in this domain
                       01B0 C4   C0  1886  5804 	ADDL	PDT$L_BYTES_XFER_INT(R4),- ; (TYC 31-Aug-89)
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 136
X-19                            -  CALCULATE_LOAD - Calculate ports' loa 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (32)

                            55       188A  5805 		R5			; Get the current port's total bytes xferred
                       56   00   D8  188B  5806 	ADWC	#0,R6			; Add to the current system load
                                     188E  5807 					;	 	
                            57   D6  188E  5808 	INCL	R7			; Increment the # of participating ports
                  59   1F   58   C3  1890  5809 20$:	SUBL3	R8,#31,R9		; Get remaining size of bit field to test
                            12   13  1894  5810 	BEQL	30$			; No more port in this domain
                            58   D6  1896  5811 	INCL	R8			; Set to next bit position to look
                       53   58   D0  1898  5812 	MOVL	R8,R3			; 
             58   5A   59   53   EA  189B  5813 	FFS	R3,R9,R10,R8		; Get next bit set from domain map
                            06   13  18A0  5814 	BEQL	30$			; No more port
                     54   6248   D0  18A2  5815 	MOVL	(R2)[R8],R4		; Get the PDT address for this port
                            D8   11  18A6  5816 	BRB	10$			; Go add this port's load
                                     18A8  5817 30$:
                                     18A8  5818 ;
                                     18A8  5819 ; (TYC 8-may-89) test code ***********
                                     18A8  5820 ; Broadcast load sharing message with system load to OPA0.
                                     18A8  5821 ;
                                     18A8  5822 ;        .if defined EXTRA_CTR           ; Conditional assembly code
                                     18A8  5823 ;	JSB	G^SCS$BRO_LOADSHARE_MSG	; Go broadcast msg
                                     18A8  5824 ;
                                     18A8  5825 ; Put load sharing message entry into error log file
                                     18A8  5826 ;
                                     18A8  5827 ;	PUSHR	#^M<R1,R2,R8>		; Save regs
                                     18A8  5828 ;	MULL3	#8,R7,R1		; # of ports*8 bytes
                                     18A8  5829 ;	ADDL	#<EMB$C_HD_LENGTH -	; Error log entry header
                                     18A8  5830 ;		+ 4 -			; # of port subpkts
                                     18A8  5831 ;		+ 8 -			; System load
                                     18A8  5832 ;		>,R1			; Set buffer size
                                     18A8  5833 ;	JSB	G^ERL$ALLOCEMB		; Get error log buffer
                                     18A8  5834 ;	MOVL	R2,EMB_BUFFER		; Save buffer address
                                     18A8  5835 ;	MOVW	#125,EMB$W_HD_ENTRY(R2) ; Port entry type
                                     18A8  5836 ;	MOVAB	EMB$C_HD_LENGTH(R2),R8	; Start location to move data
                                     18A8  5837 ;	MOVL	R7,(R8)+		; # of participating ports
                                     18A8  5838 ;	MOVQ	R5,(R8)+		; Copy total system load
                                     18A8  5839 ;	MOVL	R8,EMB_CURRENT		; Save current buffer loc.
                                     18A8  5840 ;	POPR	#^M<R1,R2,R8>
                                     18A8  5841 ;
                                     18A8  5842 ;	.endc
                                     18A8  5843 ;*************************************
                                     18A8  5844 
                                     18A8  5845 ; Now calculate the port's current fair share load per second
                                     18A8  5846 ;	R5_R6 = current total system load 
                                     18A8  5847 ;	R7 = # of participating ports
                                     18A8  5848 
                   00000018'EF   D4  18A8  5849 	CLRL	LS_DOMAIN_PORTS		; Init the port bit maps
                   00000014'EF   D4  18AE  5850 	CLRL	AVAILABLE_THRUPUT_PORTS	;
                                     18B4  5851 
                            55   D5  18B4  5852 	TSTL	R5			; Is the system load > 0?
                            03   12  18B6  5853 	BNEQ	35$			; Yes, continue
                          00ED   31  18B8  5854 	BRW	60$			; No, nothing to be done
    50   00000010'EF   55   57   7B  18BB  5855 35$:	EDIV	R7,R5,PORT_FAIR_SHARE,R0
                   00000000'GF   C6  18C4  5856 	DIVL	G^SCS$GL_LOAD_SHARE_INTERVAL,-
                   00000010'EF       18CA  5857 		PORT_FAIR_SHARE
                                     18CF  5858 
                                     18CF  5859 ;
                                     18CF  5860 ; Loop through each participating port, setting bit in LS_DOMAIN_PORTS
                                     18CF  5861 ; if the port is overloaded, calculating port's available throughput,
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 137
X-19                            -  CALCULATE_LOAD - Calculate ports' loa 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (32)

                                     18CF  5862 ; and setting bit in AVAILABLE_THRUPUT_PORTS if there is available 	
                                     18CF  5863 ; throughput in this port.
                                     18CF  5864 ;
                            54 8ED0  18CF  5865 	POPL	R4			; Restore initial PDT address
                            54   DD  18D2  5866 	PUSHL	R4			; Save again 
                       58   51   D0  18D4  5867 	MOVL	R1,R8			; Copy the initial port's bit position
                       0220 C4   95  18D7  5868 40$:	TSTB	PDT$B_LS_FLAG(R4)	; Is this port available for load sharing?
                            03   13  18DB  5869 	BEQL	CALC_PORT_LOAD		; Yes
                          00AF   31  18DD  5870 	BRW	50$			; No, get next port in this domain
                                     18E0  5871 CALC_PORT_LOAD:	
                                     18E0  5872 
                   00000000'GF   C7  18E0  5873 	DIVL3	G^SCS$GL_LOAD_SHARE_INTERVAL,-
                       01B0 C4       18E6  5874 		PDT$L_BYTES_XFER_INT(R4),- ; (TYC 31-Aug-89)
                            50       18E9  5875 		R0			; Get port's current load per second		
                                     18EA  5876 
                                     18EA  5877 ;
                                     18EA  5878 ; (TYC 14-Aug-89) Calculate port tolerance threshold according to
                                     18EA  5879 ; the formula:  
                                     18EA  5880 ;	TOLERANCE (%) = (100 - PU) / 2
                                     18EA  5881 ; 		where PU = current load per second divided by
                                     18EA  5882 ;			   saturation point
                                     18EA  5883 ; 
                                     18EA  5884 ; Regs. R3, R5, R6, R9 are used for computations
                                     18EA  5885 ;
                       59   50   4E  18EA  5886     	CVTLF	R0,R9			; Convert current load to float value
                       0138 C4   4E  18ED  5887 	CVTLF	PDT$L_SATURATION_PT(R4),-
                            55       18F1  5888 		R5			; Convert to float value
                       59   55   46  18F2  5889 	DIVF	R5,R9			; Get PU
                       59   08   51  18F5  5890 	CMPF	#1.0,R9			; (TYC0016) Is PU >= 100%?
                            13   15  18F8  5891 	BLEQ	ZERO_TOL		; Yes, set tolerance threshold to 0
                  59   08   59   43  18FA  5892 	SUBF3	R9,#1.0,R9		; (1.0 - Port Utilization) 
                       59   10   46  18FE  5893 	DIVF	#2.0,R9			; (1.0 - PU) / 2
                            53   D4  1901  5894 	CLRL	R3			; Init for EMODF instr.
                       53   59   54  1903  5895 	EMODF	R9,-            	; Calculate and store port
             56   0144 C4   55       1906  5896 		R3,R5,-			; tolerance threshold
                                     190B  5897                 PDT$L_TOLERANCE_THRESHOLD(R4),R6
                            04   11  190B  5898 	BRB	SET_RATING		; (TYC0016) Go calc. load rating
                                     190D  5899 ZERO_TOL:				; (TYC0016) Clear threshold
                       0144 C4   D4  190D  5900 	CLRL	PDT$L_TOLERANCE_THRESHOLD(R4) ; for PU >= 100%
                                     1911  5901 SET_RATING:				; (TYC0016)
                                     1911  5902 ;
                                     1911  5903 ;
                                     1911  5904 ; (TYC 8-may-89) calculate and set port load rating
                                     1911  5905 ;
                                     1911  5906 ;
                  013C C4   50   D1  1911  5907 	CMPL	R0,-			; Is this in RED zone?
                                     1916  5908 		PDT$L_MAX_THRUPUT_THRESHOLD(R4)
                            07   19  1916  5909 	BLSS	Y_ZONE			; No
                            06   D0  1918  5910 	MOVL	#PDT$C_RED,-		; Yes, set load rating to RED
                       0130 C4       191A  5911 		PDT$L_LOAD_RATING(R4)
                            12   11  191D  5912 	BRB	RATE_DONE		; Continue
                  0140 C4   50   D1  191F  5913 Y_ZONE: CMPL	R0,-			; Is this in YELLOW zone?
                                     1924  5914 		PDT$L_MIN_THRUPUT_THRESHOLD(R4)
                            07   19  1924  5915 	BLSS	NORMAL_ZONE		; No
                            04   D0  1926  5916 	MOVL	#PDT$C_YELLOW,-		; Yes, set load rating to YELLOW
                       0130 C4       1928  5917 		PDT$L_LOAD_RATING(R4)
                            04   11  192B  5918 	BRB	RATE_DONE		; Continue
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 138
X-19                            -  CALCULATE_LOAD - Calculate ports' loa 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (32)

                                     192D  5919 NORMAL_ZONE:
                       0130 C4   D4  192D  5920 	CLRL	PDT$L_LOAD_RATING(R4)	; Else in normal load zone 
                                     1931  5921 
                                     1931  5922 RATE_DONE:
                       0140 C4   C3  1931  5923 	SUBL3	PDT$L_MIN_THRUPUT_THRESHOLD(R4),-
                       55   50       1935  5924 		R0,R5			; Get (current load - YELLOW threshold)
                            2D   19  1937  5925 	BLSS	CALC_AVAIL		; If less, this port has available throughput 
                   00000010'EF   C1  1939  5926 	ADDL3	PORT_FAIR_SHARE,-
                       0144 C4       193F  5927 		PDT$L_TOLERANCE_THRESHOLD(R4),-
                            56       1942  5928 		R6			; Get fair share + tolerance threshold per second
                  57   50   56   C3  1943  5929 	SUBL3	R6,R0,R7		; Get (current load - (fair share + tolerance))
                            1D   19  1947  5930 	BLSS	CALC_AVAIL		; If less, this port has available thruput
                                     1949  5931 					; Otherwise this port is overloaded
                       59   01   D0  1949  5932 	MOVL	#1,R9			
                  59   59   58   78  194C  5933 	ASHL	R8,R9,R9		;  Get the mask for the bit
              00000018'EF   59   C8  1950  5934 	BISL	R9,LS_DOMAIN_PORTS	; Set this port bit in LS_DOMAIN_PORTS	
                                     1957  5935 ;
                                     1957  5936 ; (TYC 8-may-89) test code ***********
                                     1957  5937 ; Broadcast port load sharing message to OPA0.
                                     1957  5938 ;
                                     1957  5939 ;        .if defined EXTRA_CTR           ; Conditional assembly code
                                     1957  5940 ;	CLRL	R3			; Set flag that this port is overloaded
                                     1957  5941 ;	JSB	G^SCS$BRO_PORT_MSG	; Go broadcast msg
                                     1957  5942 ;
                                     1957  5943 ;	PUSHL	R8			; Save reg
                                     1957  5944 ;	MOVL	EMB_CURRENT,R8		; Restore saved current loc
                                     1957  5945 ;	MOVB	PDT$B_PORT_NUM(R4),(R8)+; Copy local port #
                                     1957  5946 ;	CMPL	#PDT$C_RED,-		; Is the rating RED?
                                     1957  5947 ;		PDT$L_LOAD_RATING(R4)		
                                     1957  5948 ;	BEQL	EMB_RED1		; Yes
                                     1957  5949 ;	CMPL	#PDT$C_YELLOW,-		; Is the rating YELLOW?
                                     1957  5950 ;		PDT$L_LOAD_RATING(R4)		
                                     1957  5951 ;	BEQL	EMB_YELLOW1		; Yes
                                     1957  5952 ;	MOVB	#^A/N/,(R8)+		; No, it's Normal load
                                     1957  5953 ;	BRB	EMBEND1
                                     1957  5954 ;EMB_RED1:
                                     1957  5955 ;	MOVB	#^A/R/,(R8)+		; Set to RED rating
                                     1957  5956 ;	BRB	EMBEND1
                                     1957  5957 ;EMB_YELLOW1:
                                     1957  5958 ;	MOVB	#^A/Y/,(R8)+		; Set to YELLOW rating
                                     1957  5959 ;EMBEND1:	
                                     1957  5960 ;	MOVB	#1,(R8)+		; Overloaded port
                                     1957  5961 ;	CLRB	(R8)+			; Not used field
                                     1957  5962 ;	MOVL	R0,(R8)+		; Copy port load/second		
                                     1957  5963 ;	MOVL	R8,EMB_CURRENT		; Save current loc.
                                     1957  5964 ;	POPL	R8			; Restore reg
                                     1957  5965 ;
                                     1957  5966 ;	.endc
                                     1957  5967 ;*************************************
                                     1957  5968 
                       57   55   D1  1957  5969 	CMPL	R5,R7			; Calculate excess throughput
                            03   14  195A  5970 	BGTR	41$			;  Excess throughput will be -(Available thruput)
                       57   55   D0  195C  5971 	MOVL	R5,R7			; (current load - YELLOW threshold)
                  012C C4   57   CE  195F  5972 41$:	MNEGL	R7,-
                                     1964  5973 		PDT$L_AVAIL_THRUPUT(R4)	; Set to negative available throughput
                            29   11  1964  5974 	BRB	50$			; Get next port to process		
                                     1966  5975 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 139
X-19                            -  CALCULATE_LOAD - Calculate ports' loa 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (32)

                                     1966  5976 CALC_AVAIL:
                       59   01   D0  1966  5977 	MOVL	#1,R9			
                  59   59   58   78  1969  5978 	ASHL	R8,R9,R9		; Get the mask for the port bit
              00000014'EF   59   C8  196D  5979 	BISL	R9,AVAILABLE_THRUPUT_PORTS	; Set this port bit in available map
                                     1974  5980 ;
                                     1974  5981 ; (TYC 8-may-89) test code ***********
                                     1974  5982 ; Broadcast port load sharing message to OPA0.
                                     1974  5983 ;
                                     1974  5984 ;        .if defined EXTRA_CTR           ; Conditional assembly code
                                     1974  5985 ;	MOVL	#1,R3			; Set flag that this port is available
                                     1974  5986 ;	JSB	G^SCS$BRO_PORT_MSG	; Go broadcast msg
                                     1974  5987 ;
                                     1974  5988 ;	PUSHL	R8			; Save reg
                                     1974  5989 ;	MOVL	EMB_CURRENT,R8		; Restore saved current loc
                                     1974  5990 ;	MOVB	PDT$B_PORT_NUM(R4),(R8)+; Copy local port #
                                     1974  5991 ;	CMPL	#PDT$C_RED,-		; Is the rating RED?
                                     1974  5992 ;		PDT$L_LOAD_RATING(R4)		
                                     1974  5993 ;	BEQL	EMB_RED2		; Yes
                                     1974  5994 ;	CMPL	#PDT$C_YELLOW,-		; Is the rating YELLOW?
                                     1974  5995 ;		PDT$L_LOAD_RATING(R4)		
                                     1974  5996 ;	BEQL	EMB_YELLOW2		; Yes
                                     1974  5997 ;	MOVB	#^A/N/,(R8)+		; No, it's Normal load
                                     1974  5998 ;	BRB	EMBEND2
                                     1974  5999 ;EMB_RED2:
                                     1974  6000 ;	MOVB	#^A/R/,(R8)+		; Set to RED rating
                                     1974  6001 ;	BRB	EMBEND2
                                     1974  6002 ;EMB_YELLOW2:
                                     1974  6003 ;	MOVB	#^A/Y/,(R8)+		; Set to YELLOW rating
                                     1974  6004 ;EMBEND2:	
                                     1974  6005 ;	CLRB	(R8)+			; Available port
                                     1974  6006 ;	CLRB	(R8)+			; Not used field
                                     1974  6007 ;	MOVL	R0,(R8)+		; Copy port load/second		
                                     1974  6008 ;	MOVL	R8,EMB_CURRENT		; Save current loc.
                                     1974  6009 ;	POPL	R8			; Restore reg
                                     1974  6010 ;
                                     1974  6011 ;	.endc
                                     1974  6012 ;*************************************
                                     1974  6013 
                   00000010'EF   C1  1974  6014 	ADDL3	PORT_FAIR_SHARE,-	; Get fair share + tolerance threshold per second
                       0144 C4       197A  6015 		PDT$L_TOLERANCE_THRESHOLD(R4),-
                            56       197D  6016 		R6			; We need to do this again in case it was 
                                     197E  6017 					; the first branch to CALC_AVAIL
                  57   50   56   C3  197E  6018 	SUBL3	R6,R0,R7		; Get (current load - (fair share + tolerance))
                       57   55   D1  1982  6019 	CMPL	R5,R7			; See which value is greater
                            03   14  1985  6020 	BGTR	42$			; Available thruput is 
                                     1987  6021 					;    ((fair share+tolerance) - current load)
                       57   55   D0  1987  6022 	MOVL	R5,R7			; Else it is (YELLOW threshold - current load)
                  012C C4   57   CE  198A  6023 42$:	MNEGL	R7,-
                                     198F  6024 		PDT$L_AVAIL_THRUPUT(R4)	; Set to positive available throughput
                                     198F  6025 
                  59   1F   58   C3  198F  6026 50$:	SUBL3	R8,#31,R9		; Get remaining size of bit field to test
                            13   13  1993  6027 	BEQL	60$			; No more port in this domain
                            58   D6  1995  6028 	INCL	R8			; Set to next bit position to look
                       53   58   D0  1997  6029 	MOVL	R8,R3			; 
             58   5A   59   53   EA  199A  6030 	FFS	R3,R9,R10,R8		; Get next bit set from domain map
                            07   13  199F  6031 	BEQL	60$			; No more port
                     54   6248   D0  19A1  6032 	MOVL	(R2)[R8],R4		; Get the PDT address for this port
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 140
X-19                            -  CALCULATE_LOAD - Calculate ports' loa 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (32)

                          FF2F   31  19A5  6033 	BRW	40$			; Go check this port's load
                                     19A8  6034 60$:
                                     19A8  6035 ;
                                     19A8  6036 ; (TYC 26-may-89) test code ***********
                                     19A8  6037 ; Enter port load sharing message to error log file.
                                     19A8  6038 ;
                                     19A8  6039 ;        .if defined EXTRA_CTR           ; Conditional assembly code
                                     19A8  6040 ;
                                     19A8  6041 ;	PUSHL	R2			; Save reg.
                                     19A8  6042 ;	MOVL	EMB_BUFFER,R2		; Restore buffer address
                                     19A8  6043 ;	JSB	G^ERL$RELEASEMB		; Output to error log
                                     19A8  6044 ;	POPL	R2			; Restore reg.
                                     19A8  6045 ;
                                     19A8  6046 ;	.endc
                                     19A8  6047 ;*************************************
                                     19A8  6048 
                            54 8ED0  19A8  6049 	POPL	R4			; Restore input register
                                 05  19AB  6050 	RSB				; return
                                     19AC  6051 	.disable lsb		
                                     19AC  6052 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 141
X-19                            -  CALC_EB   - Calculate effective bandw 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (33)

                                     19AC  6054 	.SBTTL	-		CALC_EB		 - Calculate effective bandwidths of ports
                                     19AC  6055 ;++
                                     19AC  6056 ; CALC_EB	(TYC0016)
                                     19AC  6057 ;	This subroutine calculates the effective bandwidth of the specified port 
                                     19AC  6058 ;	according to the port's average block transfer size over
                                     19AC  6059 ;	the last load sharing interval.  The Effective Bandwidth table arrays
                                     19AC  6060 ;	are used according to the port type and if the average block transfer size
                                     19AC  6061 ;	falls in between two table values, linear interpolation will be used to
                                     19AC  6062 ;	calculate the effective bandwidth.  This calculated effective bandwidth will 
                                     19AC  6063 ;	be used as the current saturation point of the port and the max. and min.
                                     19AC  6064 ;	throughput threshold values will also be calculated for the port using this
                                     19AC  6065 ;       saturation point value.
                                     19AC  6066 ;
                                     19AC  6067 ;	The average transfer size is calculated as follows:
                                     19AC  6068 ;
                                     19AC  6069 ;				# of total bytes xferred during this interval
                                     19AC  6070 ;		Avg_xfer_size = --------------------------------------------------
                                     19AC  6071 ;				 # of DGs, MSGs, and # of packets for bytes mapped
                                     19AC  6072 ;
                                     19AC  6073 ; For CIXCD adapter, we use the hardware counters to calculate the transfer size. 
                                     19AC  6074 ;
                                     19AC  6075 ; (TYC0018) For an unknown type of CI ports, just use DEFAULT_EB table to set
                                     19AC  6076 ; up default values for the effective bandwidths.
                                     19AC  6077 ;
                                     19AC  6078 ; CALLING SEQUENCE:
                                     19AC  6079 ;
                                     19AC  6080 ;	Called from CALCULATE_LOAD routine
                                     19AC  6081 ;
                                     19AC  6082 ; INPUT PARAMETERS:
                                     19AC  6083 ;
                                     19AC  6084 ;	R4 =	Port's PDT address
                                     19AC  6085 ; 
                                     19AC  6086 ; OUTPUT PARAMETERS:
                                     19AC  6087 ;
                                     19AC  6088 ;	None
                                     19AC  6089 ;
                                     19AC  6090 ; COMPLETION CODES:
                                     19AC  6091 ;
                                     19AC  6092 ;	None
                                     19AC  6093 ;
                                     19AC  6094 ; SIDE EFFECTS:
                                     19AC  6095 ;
                                     19AC  6096 ;	All registers preserved
                                     19AC  6097 ;	Port's saturation point, max. and min. threshold values calculated
                                     19AC  6098 ;	and written to respective PDT locations.
                                     19AC  6099 ;
                                     19AC  6100 ;--
                                     19AC  6101 	.enable lsb		
                                     19AC  6102 CALC_EB:
                       00FF 8F   BB  19AC  6103 	PUSHR	#^M<R0,R1,R2,R3,R4,R5,R6,R7> ; Save some registers
                  55   00E8 C4   D0  19B0  6104 	MOVL	PDT$L_UCB0(R4),R5	; Get UCB address
         00F4 C5   00000C05 8F   D1  19B5  6105 	CMPL	#NDT$_CIXCD,UCB$L_NDT(R5) ; Is this a CIXCD type?
                            44   13  19BE  6106 	BEQL	10$			; Yes, special case	
                       0190 C4   C3  19C0  6107 	SUBL3	PDT$L_DG_XMT_LAST(R4),-
                  50   015C C4       19C4  6108 		PDT$L_DG_XMT(R4),R0	; Get # of DG xmted for this interval
                       0194 C4   C3  19C8  6109 	SUBL3	PDT$L_DG_RCV_LAST(R4),-
                  51   0160 C4       19CC  6110 		PDT$L_DG_RCV(R4),R1	; Get # of DG rcv'd for this interval
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 142
X-19                            -  CALC_EB   - Calculate effective bandw 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (33)

                       50   51   C0  19D0  6111 	ADDL	R1,R0			; Add the two values 
                       0198 C4   C3  19D3  6112 	SUBL3   PDT$L_MSG_XMT_LAST(R4),-
                  51   0164 C4       19D7  6113 		PDT$L_MSG_XMT(R4),R1	; Get # of MSG xmted for this interval
                       50   51   C0  19DB  6114 	ADDL	R1,R0			; Add to the # of operations completed
                       019C C4   C3  19DE  6115 	SUBL3   PDT$L_MSG_RCV_LAST(R4),-
                  51   0168 C4       19E2  6116 		PDT$L_MSG_RCV(R4),R1	; Get # of MSG rcv'd for this interval
                       50   51   C0  19E6  6117 	ADDL	R1,R0			; Add to the # of operations completed
                                     19E9  6118 
                       01A8 C4   C3  19E9  6119 	SUBL3   PDT$L_NUM_MAP_LAST(R4),-
                  51   0174 C4       19ED  6120 		PDT$L_NUM_MAP(R4),R1	; Get # of map operations for this interval
                                     19F1  6121 	
                       50   51   C0  19F1  6122 	ADDL	R1,R0			; Add to the # of operations completed
                            50   D5  19F4  6123 	TSTL	R0			; (TYC0017) Is # of operations 0?
                            04   12  19F6  6124 	BNEQ	5$			;  No, safe to use DIV instr.
                            56   D4  19F8  6125 	CLRL	R6			;  Yes, set avg xfer size to 0
                            66   11  19FA  6126 	BRB	40$			;  Go calculate effective bandwidth
                                     19FC  6127 5$:
                  01B0 C4   50   C7  19FC  6128 	DIVL3	R0,PDT$L_BYTES_XFER_INT(R4),-
                            56       1A01  6129 		R6			; Get average transfer size	 
                            5E   11  1A02  6130 	BRB	40$			; Go calculate effective bandwidth
                                     1A04  6131 
                                     1A04  6132 10$:
                                     1A04  6133 ; CIXCD port -- use hardware counters for calculating
                                     1A04  6134 ; average transfer size.
                                     1A04  6135 ;
                       0720 C4   C3  1A04  6136 	SUBL3	PDT$L_SNDDAT_OPER_SNT_LAST(R4),-
                       0688 C4       1A08  6137 		PDT$L_SNDDAT_OPER_SNT(R4),-
                            50       1A0B  6138 		R0			; Get # of Send Data operations for this int.
                       0728 C4   C3  1A0C  6139 	SUBL3	PDT$L_REQDAT_OPER_SNT_LAST(R4),-
                       0694 C4       1A10  6140 		PDT$L_REQDAT_OPER_SNT(R4),-
                            51       1A13  6141 		R1			; Get # of REQDAT operations for this int.
                       50   51   C0  1A14  6142 	ADDL	R1,R0			; Add two values
                       072C C4   C3  1A17  6143 	SUBL3	PDT$L_CNF_SNT_LAST(R4),-
                       06A8 C4       1A1B  6144 		PDT$L_CNF_SNT(R4),-	; Get # of Block data confirmations
                            51       1A1E  6145 		R1			;  sent for this int.
                       50   51   C0  1A1F  6146 	ADDL	R1,R0			; Add to the # of operations performed
                       0734 C4   C3  1A22  6147 	SUBL3	PDT$L_DATREQ_BODIES_RCV_LAST(R4),-
                       06AC C4       1A26  6148 		PDT$L_DATREQ_BODIES_RCV(R4),-
                            51       1A29  6149 		R1			; Get # of DATREQ bodies rcv'd for this int.
                       50   51   C0  1A2A  6150 	ADDL	R1,R0			; Add to the # of operations performed
                                     1A2D  6151 
                       071C C4   C3  1A2D  6152 	SUBL3	PDT$L_SNDDAT_DATA_SNT_LAST(R4),-
                       068C C4       1A31  6153 		PDT$L_SNDDAT_DATA_SNT(R4),-
                            52       1A34  6154 		R2			; Get # of SNDDAT bytes sent for this int.
                       0724 C4   C3  1A35  6155 	SUBL3	PDT$L_RETDAT_DATA_RCV_LAST(R4),-
                       0698 C4       1A39  6156 		PDT$L_RETDAT_DATA_RCV(R4),-
                            51       1A3C  6157 		R1			; Get # of RETDAT bytes rcvd for this int.
                       52   51   C0  1A3D  6158 	ADDL	R1,R2			; Add two values
                       0730 C4   C3  1A40  6159 	SUBL3	PDT$L_SNTDAT_DATA_REC_LAST(R4),-
                       06A4 C4       1A44  6160 		PDT$L_SNTDAT_DATA_REC(R4),-
                            51       1A47  6161 		R1			; Get # of SNTDAT bytes rcvd for this int.
                       52   51   C0  1A48  6162 	ADDL	R1,R2			; Add to the # of bytes xferred
                       0738 C4   C3  1A4B  6163 	SUBL3	PDT$L_RETDAT_DATA_SNT_LAST(R4),-
                       06B4 C4       1A4F  6164 		PDT$L_RETDAT_DATA_SNT(R4),-
                            51       1A52  6165 		R1			; Get # of RETDAT bytes sent for this int.
                       52   51   C0  1A53  6166 	ADDL	R1,R2			; Add to the # of bytes xferred
                                     1A56  6167 	
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 143
X-19                            -  CALC_EB   - Calculate effective bandw 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (33)

                            50   D5  1A56  6168 	TSTL	R0			; (TYC0017) Is # of operations 0?
                            04   12  1A58  6169 	BNEQ	30$			;  No, safe to use DIV instr.
                            56   D4  1A5A  6170 	CLRL	R6			;  Yes, set avg xfer size to 0
                            04   11  1A5C  6171 	BRB	40$			;  Go calculate effective bandwidth
                                     1A5E  6172 30$:	
                  56   52   50   C7  1A5E  6173 	DIVL3	R0,R2,R6		; Get average transfer size
                                     1A62  6174 
                                     1A62  6175 40$:
                                     1A62  6176 ;
                                     1A62  6177 ; R6 = the average transfer size calculated
                                     1A62  6178 ; R5 = UCB address
                                     1A62  6179 ;  Now get the proper effective bandwidth array given the port type.
                                     1A62  6180 ;
                                     1A62  6181 
                                     1A62  6182 ;*** DEBUG code ************
                  073C C4   56   D0  1A62  6183 	MOVL	R6,PDT$L_AVG_XFER_SIZE(R4) ; Save average xfer size
                                     1A67  6184 ;***
                                     1A67  6185 
                  00F4 C5   38   D1  1A67  6186 	CMPL	#NDT$_CI,UCB$L_NDT(R5)	; Is this a CI750/780 type?
                            2F   13  1A6C  6187 	BEQL	CI780			; Yes	
         00F4 C5   8000010B 8F   D1  1A6E  6188 	CMPL	#NDT$_BCI750,UCB$L_NDT(R5) ; Is this a CIBCI type?
                            2D   13  1A77  6189 	BEQL	CIBCI			; Yes
         00F4 C5   80000108 8F   D1  1A79  6190 	CMPL	#NDT$_BCA,UCB$L_NDT(R5) ; Is this a CIBCA type?
                            2B   13  1A82  6191 	BEQL	CIBCA			; Yes
         00F4 C5   00000C05 8F   D1  1A84  6192 	CMPL	#NDT$_CIXCD,UCB$L_NDT(R5) ; Is this a CIXCD type?
                            3E   13  1A8D  6193 	BEQL	CIXCD			; Yes
         00F4 C5   00000810 8F   D1  1A8F  6194 	CMPL	#NDT$_KFMSA,UCB$L_NDT(R5) ; (TYC0018) Is this a KFMSA type?
                            3C   13  1A98  6195 	BEQL	KFMSA			; Yes
                          0042   31  1A9A  6196 	BRW	DEFAULT			; Else go to default type
                                     1A9D  6197 CI780:
              53   0000005D'EF   DE  1A9D  6198 	MOVAL	CI780_EB,R3		; Get addr of CI780 array 
                            40   11  1AA4  6199 	BRB	COMMON_CALC		; Go join common code
                                     1AA6  6200 CIBCI:
              53   00000079'EF   DE  1AA6  6201 	MOVAL	CIBCI_EB,R3		; Get addr of CIBCI array
                            37   11  1AAD  6202 	BRB	COMMON_CALC		; Go join common code
                                     1AAF  6203 CIBCA:	
                  55   023C C4   D0  1AAF  6204 	MOVL	PDT$L_ADAPTER(R4),R5	; Get adapter base address
                       55   65   D0  1AB4  6205 	MOVL	BIIC$L_DTREG(R5),R5	; Get the device type register
                    09 55   17   E0  1AB7  6206 	BBS	#BCA_DT_V_UCODE,R5,-
                                     1ABB  6207 		CIBCAB			; Branch if CIBCA-B type
                                     1ABB  6208 CIBCAA:
              53   00000095'EF   DE  1ABB  6209 	MOVAL	CIBCAA_EB,R3		; Get addr of CIBCA-A array
                            22   11  1AC2  6210 	BRB	COMMON_CALC		; Go join common code
                                     1AC4  6211 CIBCAB:
              53   000000B1'EF   DE  1AC4  6212 	MOVAL	CIBCAB_EB,R3		; Get addr of CIBCA-B array
                            19   11  1ACB  6213 	BRB	COMMON_CALC		; Go join common code
                                     1ACD  6214 
                                     1ACD  6215 CIXCD:
              53   000000CD'EF   DE  1ACD  6216 	MOVAL	CIXCD_EB,R3		; Get addr of CIXCD array
                            10   11  1AD4  6217 	BRB	COMMON_CALC		; Go join common code
                                     1AD6  6218 
                                     1AD6  6219 ; (TYC0018) Take care of KFMSA adapter and unknown types.
                                     1AD6  6220 
                                     1AD6  6221 KFMSA:
              53   000000E9'EF   DE  1AD6  6222 	MOVAL	KFMSA_EB,R3		; Get addr of KFMSA array
                            07   11  1ADD  6223 	BRB	COMMON_CALC		; Go join common code
                                     1ADF  6224 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 144
X-19                            -  CALC_EB   - Calculate effective bandw 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (33)

                                     1ADF  6225 DEFAULT:
              53   00000105'EF   DE  1ADF  6226 	MOVAL	DEFAULT_EB,R3		; Get addr of default array
                                     1AE6  6227 ;
                                     1AE6  6228 COMMON_CALC:
                                     1AE6  6229 ;
                                     1AE6  6230 ; R6 = average transfer size in bytes
                                     1AE6  6231 ; R3 = addr of EB array
                                     1AE6  6232 ; R4 = PDT
                                     1AE6  6233 ; R0 = array index
                                     1AE6  6234 ; R1 = transfer size index array
                                     1AE6  6235 ;
                                     1AE6  6236 ; Calculate effective bandwidth using array and transfer size
                                     1AE6  6237 ;
              51   00000041'EF   DE  1AE6  6238 	MOVAL	TRANSFER_SIZE,R1	; Get addr of xfer size array
                            50   D4  1AED  6239 	CLRL	R0			; Initialize array index
                     6140   56   D1  1AEF  6240 	CMPL	R6,(R1)[R0]		; Is the xfer size less than
                                     1AF3  6241 					;  or equal to 0.5 KB? 
                            08   14  1AF3  6242 	BGTR	50$			; No, check next size
                0138 C4   6340   D0  1AF5  6243 	MOVL	(R3)[R0],-		; Yes, use smallest EB value
                                     1AFB  6244 		PDT$L_SATURATION_PT(R4)	;  as current saturation pt.
                            47   11  1AFB  6245 	BRB	CALC_MAX_MIN		; Go calc max & min threshold
                                     1AFD  6246 50$:
                            50   D6  1AFD  6247 	INCL	R0			; Increment index
                     6140   56   D1  1AFF  6248 	CMPL	R6,(R1)[R0]		; Is the xfer size 
                                     1B03  6249 					;  equal to current index size?
                            39   13  1B03  6250 	BEQL	70$			; Yes
                            07   19  1B05  6251 	BLSS	60$			; Branch if less than 
                       50   06   D1  1B07  6252 	CMPL	#SCS_C_EB_MAX_INDEX,R0	; Is this the last index?
                            F1   12  1B0A  6253 	BNEQ	50$			; No, get next xfer size index
                            30   11  1B0C  6254 	BRB	70$			; Yes, use the largest EB value
                                     1B0E  6255 60$:
                                     1B0E  6256 ;
                                     1B0E  6257 ; This is where the avg xfer size is somewhere in between current
                                     1B0E  6258 ; xfer size and the previous xfer size in the table.  In this case
                                     1B0E  6259 ; we calculate the slope by dividing the Effective Bandwidths difference
                                     1B0E  6260 ; by the transfer sizes difference.  Then multiply the slope by
                                     1B0E  6261 ; the (avg xfer size - previous xfer size) and add to the previous
                                     1B0E  6262 ; xfer size to get the effective bandwidth.
                                     1B0E  6263 ;
                       52   50   D0  1B0E  6264 	MOVL	R0,R2			; Copy index
                            52   D7  1B11  6265 	DECL	R2			; Get previous index
                0138 C4   6342   D0  1B13  6266 	MOVL	(R3)[R2],-		; Init saturation pt with
                                     1B19  6267 		PDT$L_SATURATION_PT(R4)	;  previous EB entry
                   6342   6340   D1  1B19  6268 	CMPL	(R3)[R0],(R3)[R2]	; Are two EB entries the same?
                            24   13  1B1E  6269 	BEQL	CALC_MAX_MIN		; Yes, go calc max. & min. threshold
              55   6340   6342   C3  1B20  6270 	SUBL3	(R3)[R2],(R3)[R0],R5	; Get EB difference
              57   6140   6142   C3  1B26  6271 	SUBL3	(R1)[R2],(R1)[R0],R7	; Get xfer size difference
                       55   57   C6  1B2C  6272 	DIVL	R7,R5			; Get the slope
                57   56   6142   C3  1B2F  6273 	SUBL3	(R1)[R2],R6,R7		; Get (avg xfer size - prev size)
                       55   57   C4  1B34  6274 	MULL	R7,R5			; Get amount to add to EB
                  0138 C4   55   C0  1B37  6275 	ADDL	R5,PDT$L_SATURATION_PT(R4) ; Add to the saturation pt
                            06   11  1B3C  6276 	BRB	CALC_MAX_MIN		; Go calc max & min threshold
                                     1B3E  6277 70$:
                0138 C4   6340   D0  1B3E  6278 	MOVL	(R3)[R0],-		; Yes, use EB value in table
                                     1B44  6279 		PDT$L_SATURATION_PT(R4)	;  as current saturation pt.
                                     1B44  6280 CALC_MAX_MIN:
                                     1B44  6281 ;
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 145
X-19                            -  CALC_EB   - Calculate effective bandw 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (33)

                                     1B44  6282 ; Calculate new max. and min. threshold values using the current
                                     1B44  6283 ; saturation point value.
                                     1B44  6284 ;
                       0138 C4   4E  1B44  6285 	CVTLF	PDT$L_SATURATION_PT(R4),-
                            57       1B48  6286 		R7			; Convert to float value
                            51   D4  1B49  6287 	CLRL	R1			; Clear the register for EMODF instr.
                                     1B4B  6288 
                   00000000'GF   4E  1B4B  6289 	CVTLF	G^SCS$GL_RED_THRESHOLD,-
                            50       1B51  6290 		R0			; Convert to float first
              50   D70A3D23 8F   44  1B52  6291 	MULF	#0.01,R0		; Get percentage
                       51   50   54  1B59  6292 	EMODF	R0,-
             53   013C C4   57       1B5C  6293 		R1,R7,-			; Store max. throughput
                                     1B61  6294 		PDT$L_MAX_THRUPUT_THRESHOLD(R4),R3
                                     1B61  6295 	
                   00000000'GF   4E  1B61  6296 	CVTLF	G^SCS$GL_YELLOW_THRESHOLD,-
                            50       1B67  6297 		R0			; Convert to float first
              50   D70A3D23 8F   44  1B68  6298 	MULF	#0.01,R0		; Get percentage
                       51   50   54  1B6F  6299 	EMODF	R0,-
             53   0140 C4   57       1B72  6300 		R1,R7,-			; Store min. throughput
                                     1B77  6301 		PDT$L_MIN_THRUPUT_THRESHOLD(R4),R3
                                     1B77  6302 100$:
                       00FF 8F   BA  1B77  6303 	POPR	#^M<R0,R1,R2,R3,R4,R5,R6,R7> ; Restore some registers
                                 05  1B7B  6304 	RSB				; return
                                     1B7C  6305 	.disable lsb		
                                     1B7C  6306 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 146
X-19                            -  SCS_CHECK_QUEUES - Check and process  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (34)

                                     1B7C  6308 	.SBTTL	-		SCS_CHECK_QUEUES - Check and process SCS load sharing queues
                                     1B7C  6309 ;++
                                     1B7C  6310 ;
                                     1B7C  6311 ; SCS_CHECK_QUEUES
                                     1B7C  6312 ;	This subroutine checks SCS load sharing queues and move some of the CDTs
                                     1B7C  6313 ;	to other queues or release the CDT to CDT free pool, depending on the
                                     1B7C  6314 ;	conditions checked.  First SCS$GQ_WORSE_PATH queue is checked and if
                                     1B7C  6315 ;	any CDT is in OPEN state, this routine calls the SYSAP's MOVE_PATH routine
                                     1B7C  6316 ;	so that the connection can be formed in a better path.
                                     1B7C  6317 ;
                                     1B7C  6318 ;	Next, all CDTs in PDT$Q_CONN_WAIT queue off the CI ports will be examined
                                     1B7C  6319 ;	and if the minimum connection wait interval has elapsed since the CDT was
                                     1B7C  6320 ;	queued, it is dequeued and requeued to other queues depending on its load
                                     1B7C  6321 ;	rating.  The algorithm used is as follows:
                                     1B7C  6322 ;	
                                     1B7C  6323 ;	IF (ELAPSED_TIME >= (MIN. CONNECTION WAIT INTERVAL + 1 LOAD SHARE INTERVAL
                                     1B7C  6324 ;				- 1 MINUTE))
                                     1B7C  6325 ;		THEN dequeue from connection wait queue
                                     1B7C  6326 ;
                                     1B7C  6327 ;	That is, if the MIN. CONNECTION WAIT INTERVAL = 2 LOAD SHARE INTERVALS,
                                     1B7C  6328 ;	we want to skip this connection from being a candidate for move for at
                                     1B7C  6329 ;	least 2 load sharing intervals.  If this connection was moved at load
                                     1B7C  6330 ;	share interval 1, then we should skip this connection at load share
                                     1B7C  6331 ;	intervals 2 and 3, and reconsider for move at load share interval 4.
                                     1B7C  6332 ;
                                     1B7C  6333 ;	If there is any CDT still in SCS$GQ_REUSE_CDT queue and if 
                                     1B7C  6334 ;	one load sharing interval has elapsed since its disconnect time, this
                                     1B7C  6335 ;	CDT is dequeued and returned to the free pool.
                                     1B7C  6336 ;
                                     1B7C  6337 ; CALLING SEQUENCE:
                                     1B7C  6338 ;
                                     1B7C  6339 ;	Called from SCS_LOAD_SHARE_TIMER routine
                                     1B7C  6340 ;
                                     1B7C  6341 ; INPUT PARAMETERS:
                                     1B7C  6342 ;
                                     1B7C  6343 ;	NONE
                                     1B7C  6344 ;
                                     1B7C  6345 ; OUTPUT PARAMETERS:
                                     1B7C  6346 ; 
                                     1B7C  6347 ;	NONE
                                     1B7C  6348 ;
                                     1B7C  6349 ; COMPLETION CODES:
                                     1B7C  6350 ;
                                     1B7C  6351 ;	NONE
                                     1B7C  6352 ;
                                     1B7C  6353 ; SIDE EFFECTS:
                                     1B7C  6354 ;
                                     1B7C  6355 ;	All registers preserved
                                     1B7C  6356 ;	CDT(s) might be moved from one queue to another or released
                                     1B7C  6357 ;	to the free pool.
                                     1B7C  6358 ;--
                                     1B7C  6359 	.enable lsb
                                     1B7C  6360 SCS_CHECK_QUEUES:
                       01FF 8F   BB  1B7C  6361 	PUSHR	#^M<R0,R1,R2,R3,R4,R5,R6,R7,R8> ; Save some registers
              55   00000000'GF   7E  1B80  6362 	MOVAQ	G^SCS$GQ_WORSE_PATH,R5	; Get first queue header addr
                       56   55   D0  1B87  6363 	MOVL	R5,R6			; Copy for reference
                       56   66   D0  1B8A  6364 	MOVL	(R6),R6			; Get first/next CDT entry
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 147
X-19                            -  SCS_CHECK_QUEUES - Check and process  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (34)

                       55   56   D1  1B8D  6365 10$:	CMPL	R6,R5			; End of this queue?
                            62   13  1B90  6366 	BEQL	DONE1			; Yes
                  53   FF60 C6   DE  1B92  6367 	MOVAL	-CDT$L_SHARE_FLINK(R6),R3 ; Point to the beg. of CDT
                  56   00A0 C3   D0  1B97  6368 	MOVL	CDT$L_SHARE_FLINK(R3),R6; Get ptr. to next CDT now
                                     1B9C  6369 					;  since we might clear it
                            02   B1  1B9C  6370 	CMPW	#CDT$C_OPEN,-		; Is the connection open?
                         28 A3       1B9E  6371 		CDT$W_STATE(R3)
                            EB   12  1BA0  6372 	BNEQ	10$			; No, keep in the queue
                  50   00A0 C3   0F  1BA2  6373 	REMQUE	CDT$L_SHARE_FLINK(R3),R0 ; Yes, remove it from the queue first
                   00000000'GF   D0  1BA7  6374 	MOVL	G^EXE$GL_ABSTIM,-	; Timestamp the removal from queue
                       00B8 C3       1BAD  6375 		CDT$L_QUEUE_TIME_STAMP(R3)
                            60   D4  1BB0  6376 	CLRL	(R0)			; Show that it's not queued
                  0156 C3   01   90  1BB2  6377 	MOVB	#1,CDT$B_LS_FLAG(R3)	; Set load share flag for disconnect
                  52   009C C3   D0  1BB7  6378 	MOVL	CDT$L_MOVE_PATH_ADDR(R3),R2 ; Get the move path address
                            0A   13  1BBC  6379 	BEQL	20$			; None there
                  50   204C 8F   3C  1BBE  6380 	MOVZWL	#SS$_DISCONNECT,R0	; (TYC 22-Mar-89) Disconnect status
                            2A   3C  1BC3  6381 	MOVZWL	#SCS$C_USE_ALTERNATE_PORT,-
                            51       1BC5  6382 		R1			; (TYC 22-Mar-89) Move path status
                            0B   11  1BC6  6383 	BRB	30$			; Complete the request.
                    52   0C A3   D0  1BC8  6384 20$:	MOVL	CDT$L_ERRADDR(R3),R2	; Get the error address
                  50   210C 8F   3C  1BCC  6385 	MOVZWL	#SS$_RESET,R0		; Flag that better path was reset
                            51   D4  1BD1  6386 	CLRL	R1			; Clear the auxiliary status
                    54   10 A3   D0  1BD3  6387 30$:	MOVL	CDT$L_PDT(R3),R4	; Get the PDT
                   0000002D'EF   D6  1BD7  6388 	INCL	UNEQUAL_PATH_CALL_COUNT	; Count these
                       01B8 C4   D6  1BDD  6389 	INCL	PDT$L_UNEQUAL_PATH_CALL_COUNT(R4)
                   00000031'EF   D6  1BE1  6390 	INCL	CONNECTION_MOVE_COUNT	; Increment move counter
                       01BC C4   D6  1BE7  6391 	INCL	PDT$L_CONNECTION_MOVE_COUNT(R4)
                                     1BEB  6392 
                            55   DD  1BEB  6393 	PUSHL	R5			; (TYC0019) Save R5 since it gets 
                                     1BED  6394 					; blown off in SYSAP routine
                            62   16  1BED  6395 	JSB	(R2)			; Call the routine
                                     1BEF  6396 
                            55 8ED0  1BEF  6397 	POPL	R5			; (TYC0019) Restore R5
                            99   11  1BF2  6398 	BRB	10$			; Go look for next CDT
                                     1BF4  6399 DONE1:
                                     1BF4  6400 ; 
                                     1BF4  6401 ; Calculate (MIN. CONNECTION WAIT INTERVAL + 1 LOAD SHARE INTERVAL - 1 MIN)
                                     1BF4  6402 ;
                   00000000'GF   C1  1BF4  6403 	ADDL3	G^SCS$GL_MIN_CONN_WAIT_INTERVAL,-
              57   00000000'GF       1BFA  6404 		G^SCS$GL_LOAD_SHARE_INTERVAL,R7
                       57   3C   C2  1C00  6405 	SUBL	#60,R7			; Subtract 1 minute (=60 seconds)
                                     1C03  6406 
              54   00000000'GF   DE  1C03  6407 	MOVAL	G^SCS$GL_PDT,R4		; Get the PDT listhead
                       54   64   D0  1C0A  6408 40$:	MOVL	(R4),R4			; Get the first/next listhead
                            03   12  1C0D  6409 	BNEQ	50$			; Continue if there's more PDT
                          007B   31  1C0F  6410 	BRW	PDTDONE			; No more, done
                            02   B1  1C12  6411 50$:	CMPW	#PDT$C_BALANCEVER,-	; Do we understand this PDT?
                       00F4 C4       1C14  6412 		PDT$W_SCSVERSION(R4)
                            F1   14  1C17  6413 	BGTR	40$			; Branch if we don't - take  no
                                     1C19  6414 					;  further action for this PDT
                            14   B1  1C19  6415 	CMPW	#PDT$C_CI_CLASS,-	; Is this load sharing level port?
                       00FC C4       1C1B  6416 		PDT$W_LOAD_CLASS(R4)	;
                            EA   14  1C1E  6417 	BGTR	40$			; Branch if not - It must be NI port
                  55   0108 C4   7E  1C20  6418 	MOVAQ	PDT$Q_CONN_WAIT(R4),R5	; Get conn. wait queue header addr
                       56   55   D0  1C25  6419 	MOVL	R5,R6			; Copy for reference
                       56   66   D0  1C28  6420 	MOVL	(R6),R6			; Get first/next CDT entry
                       55   56   D1  1C2B  6421 60$:	CMPL	R6,R5			; End of this queue?
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 148
X-19                            -  SCS_CHECK_QUEUES - Check and process  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (34)

                            5A   13  1C2E  6422 	BEQL	DONE2			; Yes
                  53   FF60 C6   DE  1C30  6423 	MOVAL	-CDT$L_SHARE_FLINK(R6),R3 ; Point to the beg. of CDT
                  56   00A0 C3   D0  1C35  6424 	MOVL	CDT$L_SHARE_FLINK(R3),R6; Get ptr. to next CDT now
                                     1C3A  6425 					;  since we might clear it
                       00B4 C3   C3  1C3A  6426 	SUBL3	CDT$L_TIME_STAMP(R3),-
              58   00000000'GF       1C3E  6427 		G^EXE$GL_ABSTIM,R8	; Calculate elapsed time in seconds
                       57   58   D1  1C44  6428 	CMPL	R8,R7			; Is it time to move CDT from wait queue?
                            E2   19  1C47  6429 	BLSS	60$			; No, process next CDT		
                  50   00A0 C3   0F  1C49  6430 	REMQUE	CDT$L_SHARE_FLINK(R3),R0 ; Yes, remove it from the queue first
                   00000000'GF   D0  1C4E  6431 	MOVL	G^EXE$GL_ABSTIM,-	; Timestamp the removal from queue
                       00B8 C3       1C54  6432 		CDT$L_QUEUE_TIME_STAMP(R3)
                                     1C57  6433 	DISPATCH	-		; Dispatch on CDT load rating
                                     1C57  6434 		CDT$L_LOAD_RATING(R3),-	;
                                     1C57  6435 		TYPE=L, -
                                     1C57  6436 		PREFIX=CDT$C_,-	
                                     1C57  6437 		<-
                                     1C57  6438 		<RATING0,		70$>,-	; Undefined but valid value
                                     1C57  6439 		<RATING1,		70$>,-	; Undefined but valid value
                                     1C57  6440 		<RATING2,		70$>,-	; Undefined but valid value
                                     1C57  6441 		<RATING3,		70$>,-	; Undefined but valid value
                                     1C57  6442 		<YELLOW,		70$>,-	; Yellow zone
                                     1C57  6443 		<RATING5,		80$>,-	; Undefined but valid value
                                     1C57  6444 		<RED,			80$>,-	; Red zone
                                     1C57  6445 		<UNEQUAL_PATH,		90$>,- 	; Unequal path load sharing
                                     1C57  6446 		<LOAD_SHARE_DISABLE,	90$>,- 	; Load sharing disabled
                                     1C57  6447 		>				     
                                     1C6F  6448 70$:					; Put into tail of YELLOW queue
                       00A0 C3   0E  1C6F  6449 	INSQUE	CDT$L_SHARE_FLINK(R3),- ; 
                       0114 D4       1C73  6450 		@PDT$Q_YELLOW+4(R4)	; 
                            B3   11  1C76  6451 	BRB	60$			; Go process next CDT
                                     1C78  6452 80$:					; Put into tail of RED queue
                       00A0 C3   0E  1C78  6453 	INSQUE	CDT$L_SHARE_FLINK(R3),- ; 
                       011C D4       1C7C  6454 		@PDT$Q_RED+4(R4)	; 
                            AA   11  1C7F  6455 	BRB	60$			; Go process next CDT
                                     1C81  6456 90$:					; Put into tail of DISABLED queue		
                       00A0 C3   0E  1C81  6457 	INSQUE	CDT$L_SHARE_FLINK(R3),- ; 
                       0124 D4       1C85  6458 		@PDT$Q_DISABLED+4(R4)	; 
                            A1   11  1C88  6459 	BRB	60$			; Go process next CDT
                          FF7D   31  1C8A  6460 DONE2:	BRW	40$			; Go process next PDT
                                     1C8D  6461 
                                     1C8D  6462 PDTDONE:
                                     1C8D  6463 ;
                                     1C8D  6464 ; Check CDTs in SCS$GQ_REUSE_CDT if any, and return to free pool
                                     1C8D  6465 ; if no one claimed to reuse it.
                                     1C8D  6466 ;
              55   00000000'GF   7E  1C8D  6467 	MOVAQ	G^SCS$GQ_REUSE_CDT,R5	; Get queue header addr
                       56   55   D0  1C94  6468 	MOVL	R5,R6			; Copy for reference
                       56   66   D0  1C97  6469 	MOVL	(R6),R6			; Get first/next CDT entry
                       55   56   D1  1C9A  6470 100$:	CMPL	R6,R5			; End of this queue?
                            33   13  1C9D  6471 	BEQL	DONE3			; Yes
                  53   FF60 C6   DE  1C9F  6472 	MOVAL	-CDT$L_SHARE_FLINK(R6),R3 ; Point to the beg. of CDT
                  56   00A0 C3   D0  1CA4  6473 	MOVL	CDT$L_SHARE_FLINK(R3),R6; Get ptr. to next CDT now
                                     1CA9  6474 					;  since we might clear it
                   00000000'GF   D0  1CA9  6475 	MOVL	G^SCS$GL_LOAD_SHARE_INTERVAL,-
                            57       1CAF  6476 		R7			; Get load share interval value
                       00B4 C3   C3  1CB0  6477 	SUBL3	CDT$L_TIME_STAMP(R3),-	; Calculate elapsed time in seconds
              58   00000000'GF       1CB4  6478 		G^EXE$GL_ABSTIM,R8	;  since the disconnect time
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 149
X-19                            -  SCS_CHECK_QUEUES - Check and process  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (34)

                       57   58   D1  1CBA  6479 	CMPL	R8,R7			; Is it time to discard this CDT?
                            DB   19  1CBD  6480 	BLSS	100$			; No, process next CDT	
                  50   00A0 C3   0F  1CBF  6481 	REMQUE	CDT$L_SHARE_FLINK(R3),R0 ; Yes, remove it from the queue first
                   00000000'GF   D0  1CC4  6482 	MOVL	G^EXE$GL_ABSTIM,-	; Timestamp the removal from queue
                       00B8 C3       1CCA  6483 		CDT$L_QUEUE_TIME_STAMP(R3)
                          E9AF   30  1CCD  6484 	BSBW	SCS$DEALL_CDT1		; Return this CDT to free pool
                            C8   11  1CD0  6485 	BRB	100$			; Go process next CDT
                                     1CD2  6486 DONE3:
                       01FF 8F   BA  1CD2  6487 	POPR	#^M<R0,R1,R2,R3,R4,R5,R6,R7,R8> ; Restore registers
                                 05  1CD6  6488 	RSB				; return
                                     1CD7  6489 	.disable lsb		
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 150
X-19                            -  SCS_CTRS_UPDATE   - Update conditiona 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (35)

                                     1CD7  6491 	.SBTTL	-		SCS_CTRS_UPDATE   - Update conditional counters
                                     1CD7  6492 ;++
                                     1CD7  6493 ;
                                     1CD7  6494 ; SCS_CTRS_UPDATE:
                                     1CD7  6495 ;
                                     1CD7  6496 ;	This routine updates conditional load sharing counters at
                                     1CD7  6497 ;	each load sharing interval if the conditional assembly flag EXTRA_CTR is
                                     1CD7  6498 ;	defined.  
                                     1CD7  6499 ;
                                     1CD7  6500 ; CALLING SEQUENCE:
                                     1CD7  6501 ;
                                     1CD7  6502 ;	Called from SCS_LOAD_SHARE_TIMER routine
                                     1CD7  6503 ;
                                     1CD7  6504 ; INPUT PARAMETERS:
                                     1CD7  6505 ;
                                     1CD7  6506 ;	NONE
                                     1CD7  6507 ;
                                     1CD7  6508 ; OUTPUT PARAMETERS:
                                     1CD7  6509 ; 
                                     1CD7  6510 ;	NONE
                                     1CD7  6511 ;
                                     1CD7  6512 ; COMPLETION CODES:
                                     1CD7  6513 ;
                                     1CD7  6514 ;	NONE
                                     1CD7  6515 ;
                                     1CD7  6516 ; SIDE EFFECTS:
                                     1CD7  6517 ;
                                     1CD7  6518 ;	All registers preserved
                                     1CD7  6519 ;	Conditional counters are updated in load sharing PDTs and CDTs.
                                     1CD7  6520 ;--
                                     1CD7  6521 	.enable lsb
                                     1CD7  6522 SCS_CTRS_UPDATE:
                                     1CD7  6523 
                                     1CD7  6524 ASSUME	PDT$L_BYTES_DG_XMT_LAST+4	EQ	PDT$L_BYTES_DG_RCV_LAST	
                                     1CD7  6525 ASSUME	PDT$L_BYTES_DG_RCV_LAST+4	EQ	PDT$L_BYTES_MSG_XMT_LAST
                                     1CD7  6526 ASSUME	PDT$L_BYTES_MSG_XMT_LAST+4	EQ	PDT$L_BYTES_MSG_RCV_LAST
                                     1CD7  6527 ASSUME	PDT$L_BYTES_MSG_RCV_LAST+4	EQ	PDT$L_BYTES_MAPPED_LAST
                                     1CD7  6528 ASSUME	PDT$L_BYTES_MAPPED_LAST+4	EQ	PDT$L_DG_XMT_LAST
                                     1CD7  6529 ASSUME	PDT$L_DG_XMT_LAST+4		EQ	PDT$L_DG_RCV_LAST
                                     1CD7  6530 ASSUME	PDT$L_DG_RCV_LAST+4		EQ	PDT$L_MSG_XMT_LAST
                                     1CD7  6531 ASSUME	PDT$L_MSG_XMT_LAST+4		EQ	PDT$L_MSG_RCV_LAST
                                     1CD7  6532 ASSUME	PDT$L_MSG_RCV_LAST+4		EQ	PDT$Q_BYTES_XFER_LAST
                                     1CD7  6533 ASSUME	PDT$Q_BYTES_XFER_LAST+8		EQ	PDT$L_NUM_MAP_LAST	
                                     1CD7  6534 ASSUME	PDT$L_NUM_MAP_LAST+4		EQ	PDT$L_PORT_CMD_LAST	
                                     1CD7  6535 
                                     1CD7  6536 ASSUME	PDT$L_BYTES_DG_XMT_PEAK+4	EQ	PDT$L_BYTES_DG_RCV_PEAK	
                                     1CD7  6537 ASSUME	PDT$L_BYTES_DG_RCV_PEAK+4	EQ	PDT$L_BYTES_MSG_XMT_PEAK
                                     1CD7  6538 ASSUME	PDT$L_BYTES_MSG_XMT_PEAK+4	EQ	PDT$L_BYTES_MSG_RCV_PEAK
                                     1CD7  6539 ASSUME	PDT$L_BYTES_MSG_RCV_PEAK+4	EQ	PDT$L_BYTES_MAPPED_PEAK
                                     1CD7  6540 ASSUME	PDT$L_BYTES_MAPPED_PEAK+4	EQ	PDT$L_DG_XMT_PEAK
                                     1CD7  6541 ASSUME	PDT$L_DG_XMT_PEAK+4		EQ	PDT$L_DG_RCV_PEAK
                                     1CD7  6542 ASSUME	PDT$L_DG_RCV_PEAK+4		EQ	PDT$L_MSG_XMT_PEAK
                                     1CD7  6543 ASSUME	PDT$L_MSG_XMT_PEAK+4		EQ	PDT$L_MSG_RCV_PEAK
                                     1CD7  6544 ASSUME	PDT$L_MSG_RCV_PEAK+4		EQ	PDT$Q_BYTES_XFER_PEAK
                                     1CD7  6545 ASSUME	PDT$Q_BYTES_XFER_PEAK+8		EQ	PDT$L_PORT_CMD_PEAK
                                     1CD7  6546 
                                     1CD7  6547 ASSUME	PDT$L_BYTES_DG_XMT_AVG+4	EQ	PDT$L_BYTES_DG_RCV_AVG	
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 151
X-19                            -  SCS_CTRS_UPDATE   - Update conditiona 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (35)

                                     1CD7  6548 ASSUME	PDT$L_BYTES_DG_RCV_AVG+4	EQ	PDT$L_BYTES_MSG_XMT_AVG
                                     1CD7  6549 ASSUME	PDT$L_BYTES_MSG_XMT_AVG+4	EQ	PDT$L_BYTES_MSG_RCV_AVG
                                     1CD7  6550 ASSUME	PDT$L_BYTES_MSG_RCV_AVG+4	EQ	PDT$L_BYTES_MAPPED_AVG
                                     1CD7  6551 ASSUME	PDT$L_BYTES_MAPPED_AVG+4	EQ	PDT$L_DG_XMT_AVG
                                     1CD7  6552 ASSUME	PDT$L_DG_XMT_AVG+4		EQ	PDT$L_DG_RCV_AVG
                                     1CD7  6553 ASSUME	PDT$L_DG_RCV_AVG+4		EQ	PDT$L_MSG_XMT_AVG
                                     1CD7  6554 ASSUME	PDT$L_MSG_XMT_AVG+4		EQ	PDT$L_MSG_RCV_AVG
                                     1CD7  6555 ASSUME	PDT$L_MSG_RCV_AVG+4		EQ	PDT$Q_BYTES_XFER_AVG
                                     1CD7  6556 ASSUME	PDT$Q_BYTES_XFER_AVG+8		EQ	PDT$L_PORT_CMD_AVG
                                     1CD7  6557 
                                     1CD7  6558 ASSUME	CDT$L_BYTES_XFER_LAST+4		EQ	CDT$L_BYTES_DG_XMT_LAST 
                                     1CD7  6559 ASSUME	CDT$L_BYTES_DG_XMT_LAST+4	EQ	CDT$L_BYTES_DG_RCV_LAST 
                                     1CD7  6560 ASSUME	CDT$L_BYTES_DG_RCV_LAST+4	EQ	CDT$L_BYTES_MSG_XMT_LAST 
                                     1CD7  6561 ASSUME	CDT$L_BYTES_MSG_XMT_LAST+4	EQ	CDT$L_BYTES_MSG_RCV_LAST 
                                     1CD7  6562 ASSUME	CDT$L_BYTES_MSG_RCV_LAST+4	EQ	CDT$L_BYTMAPD_LAST
                                     1CD7  6563 ASSUME	CDT$L_BYTMAPD_LAST+4		EQ	CDT$L_DGSENT_LAST 
                                     1CD7  6564 ASSUME	CDT$L_DGSENT_LAST+4		EQ	CDT$L_DGRCVD_LAST 
                                     1CD7  6565 ASSUME	CDT$L_DGRCVD_LAST+4		EQ	CDT$L_MSGSENT_LAST
                                     1CD7  6566 ASSUME	CDT$L_MSGSENT_LAST+4		EQ	CDT$L_MSGRCVD_LAST 
                                     1CD7  6567 
                                     1CD7  6568 ASSUME	CDT$L_BYTES_XFER_PEAK+4		EQ	CDT$L_BYTES_DG_XMT_PEAK 
                                     1CD7  6569 ASSUME	CDT$L_BYTES_DG_XMT_PEAK+4	EQ	CDT$L_BYTES_DG_RCV_PEAK 
                                     1CD7  6570 ASSUME	CDT$L_BYTES_DG_RCV_PEAK+4	EQ	CDT$L_BYTES_MSG_XMT_PEAK 
                                     1CD7  6571 ASSUME	CDT$L_BYTES_MSG_XMT_PEAK+4	EQ	CDT$L_BYTES_MSG_RCV_PEAK 
                                     1CD7  6572 ASSUME	CDT$L_BYTES_MSG_RCV_PEAK+4	EQ	CDT$L_BYTMAPD_PEAK
                                     1CD7  6573 ASSUME	CDT$L_BYTMAPD_PEAK+4		EQ	CDT$L_DGSENT_PEAK 
                                     1CD7  6574 ASSUME	CDT$L_DGSENT_PEAK+4		EQ	CDT$L_DGRCVD_PEAK 
                                     1CD7  6575 ASSUME	CDT$L_DGRCVD_PEAK+4		EQ	CDT$L_MSGSENT_PEAK
                                     1CD7  6576 ASSUME	CDT$L_MSGSENT_PEAK+4		EQ	CDT$L_MSGRCVD_PEAK 
                                     1CD7  6577 
                                     1CD7  6578 ASSUME	CDT$L_BYTES_XFER_AVG+4		EQ	CDT$L_BYTES_DG_XMT_AVG 
                                     1CD7  6579 ASSUME	CDT$L_BYTES_DG_XMT_AVG+4	EQ	CDT$L_BYTES_DG_RCV_AVG 
                                     1CD7  6580 ASSUME	CDT$L_BYTES_DG_RCV_AVG+4	EQ	CDT$L_BYTES_MSG_XMT_AVG 
                                     1CD7  6581 ASSUME	CDT$L_BYTES_MSG_XMT_AVG+4	EQ	CDT$L_BYTES_MSG_RCV_AVG 
                                     1CD7  6582 ASSUME	CDT$L_BYTES_MSG_RCV_AVG+4	EQ	CDT$L_BYTMAPD_AVG
                                     1CD7  6583 ASSUME	CDT$L_BYTMAPD_AVG+4		EQ	CDT$L_DGSENT_AVG 
                                     1CD7  6584 ASSUME	CDT$L_DGSENT_AVG+4		EQ	CDT$L_DGRCVD_AVG 
                                     1CD7  6585 ASSUME	CDT$L_DGRCVD_AVG+4		EQ	CDT$L_MSGSENT_AVG
                                     1CD7  6586 ASSUME	CDT$L_MSGSENT_AVG+4		EQ	CDT$L_MSGRCVD_AVG 
                                     1CD7  6587 
                       0FFF 8F   BB  1CD7  6588 	PUSHR	#^M<R0,R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11> ; Save some registers
                                     1CDB  6589 
              54   00000000'GF   DE  1CDB  6590 	MOVAL	G^SCS$GL_PDT,R4		; Get the PDT listhead
                       54   64   D0  1CE2  6591 10$:	MOVL	(R4),R4			; Get the first/next listhead
                            03   12  1CE5  6592 	BNEQ	15$			; Continue if there's more PDT
                          02AF   31  1CE7  6593 	BRW	DONE_PDT		; No more, done
                            02   B1  1CEA  6594 15$:	CMPW	#PDT$C_BALANCEVER,-	; Do we understand this PDT?
                       00F4 C4       1CEC  6595 		PDT$W_SCSVERSION(R4)
                            F1   14  1CEF  6596 	BGTR	10$			; Branch if we don't - take  no
                                     1CF1  6597 					;  further action for this PDT
                                     1CF1  6598 ;
                                     1CF1  6599 ; Update port peak counters (TYC 31-Aug-89 modified)
                                     1CF1  6600 ;
                       52   0A   D0  1CF1  6601 	MOVL	#10,R2			; Get # of counters to update
                  55   01C0 C4   DE  1CF4  6602 	MOVAL	PDT$L_BYTES_DG_XMT_PEAK(R4),R5  ; Get addr. of first peak counter
                  56   017C C4   DE  1CF9  6603 	MOVAL	PDT$L_BYTES_DG_XMT_LAST(R4),R6  ; Get addr. of first last interval ctr
                  57   0148 C4   DE  1CFE  6604 	MOVAL	PDT$L_BYTES_DG_XMT(R4),R7 ; Get addr. of first life time counter
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 152
X-19                            -  SCS_CTRS_UPDATE   - Update conditiona 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (35)

                                     1D03  6605 20$:	PEAK_CTR_UPDATE R5,R6,R7,R8	; Update the peak counter
                            66   C3  1D03       	SUBL3	(R6),-	; Calculate current 
                       58   67       1D05       		(R7),R8	;  interval counter
                       58   65   D1  1D07       	CMPL	(R5),R8	; If current peak is greater
                            03   18  1D0A       	BGEQ	30102$			;  we're done
                       65   58   D0  1D0C       	MOVL	R8,(R5)	; Else, current interval counter
                                     1D0F       30102$:
                       55   04   C0  1D0F  6606 	ADDL	#4,R5			; Point to next peak counter
                       56   04   C0  1D12  6607 	ADDL	#4,R6			; Point to next last interval counter
                       57   04   C0  1D15  6608 	ADDL	#4,R7			; Point to next life time counter
                            52   D7  1D18  6609 	DECL	R2			; Decrement the # of counters
                            E7   12  1D1A  6610 	BNEQ	20$			; If not done, update next counter
                                     1D1C  6611 ;
                                     1D1C  6612 ; Update port average counters (TYC 31-Aug-89 modified)
                                     1D1C  6613 ;
                       52   0A   D0  1D1C  6614 	MOVL	#10,R2			; Get # of counters to update
                  55   01F0 C4   DE  1D1F  6615 	MOVAL	PDT$L_BYTES_DG_XMT_AVG(R4),R5   ; Get addr. of first avg. counter
                  56   017C C4   DE  1D24  6616 	MOVAL	PDT$L_BYTES_DG_XMT_LAST(R4),R6  ; Get addr. of first interval ctr
                  57   0148 C4   DE  1D29  6617 	MOVAL   PDT$L_BYTES_DG_XMT(R4),R7 ; Get addr. of first life time counter
                                     1D2E  6618 30$:	AVG_CTR_UPDATE R5,R6,R7,R8	; Update the average counter
                            65   D5  1D2E       	TSTL	(R5)		; Is average counter 0?
                            06   12  1D30       	BNEQ	30103$			;  No, calculate new one
                       67   66   C3  1D32       	SUBL3	(R6),(R7),-
                            65       1D35       		(R5)		; Yes, copy interval counter
                            1C   11  1D36       	BRB	30104$
                                     1D38       30103$:
                            52   DD  1D38       	PUSHL	R2			; Save reg. for computation
              52   0000001D'EF   D0  1D3A       	MOVL	SHARE_TIMER_COUNT,R2	; Copy timer count
                            66   C3  1D41       	SUBL3	(R6),-	; Calculate current
                       58   67       1D43       		(R7),R8	;  interval counter
                  58   52   65   7A  1D45       	EMUL	(R5),R2,-
                            50       1D49       		R8,R0		
                            52   D6  1D4A       	INCL	R2			; Increment timer count
                  65   50   52   7B  1D4C       	EDIV	R2,R0,-
                            51       1D50       		(R5),R1
                            52 8ED0  1D51       	POPL	R2			; Restore reg.
                                     1D54       30104$:
                       55   04   C0  1D54  6619 	ADDL	#4,R5			; Point to next average counter
                       56   04   C0  1D57  6620 	ADDL	#4,R6			; Point to next last interval counter
                       57   04   C0  1D5A  6621 	ADDL	#4,R7			; Point to next life time counter
                            52   D7  1D5D  6622 	DECL	R2			; Decrement the # of counters
                            CD   12  1D5F  6623 	BNEQ	30$			; If not done, update next counter
                                     1D61  6624 
                            14   B1  1D61  6625 	CMPW	#PDT$C_CI_CLASS,-	; Is this load sharing level port?
                       00FC C4       1D63  6626 		PDT$W_LOAD_CLASS(R4)	;
                            46   14  1D66  6627 	BGTR	40$			; Branch if not - It must be NI port
                                     1D68  6628 
                  55   01EC C4   DE  1D68  6629 	MOVAL	PDT$L_PORT_CMD_PEAK(R4),R5  ; Get addr. of port cmd peak ctr
                  56   01AC C4   DE  1D6D  6630 	MOVAL	PDT$L_PORT_CMD_LAST(R4),R6  ; Get addr. of port cmd last interval ctr
                  57   0178 C4   DE  1D72  6631 	MOVAL	PDT$L_PORT_CMD(R4),R7	    ; Get addr. of port cmd life time ctr
                                     1D77  6632 	PEAK_CTR_UPDATE R5,R6,R7,R8	; Update the peak counter
                            66   C3  1D77       	SUBL3	(R6),-	; Calculate current 
                       58   67       1D79       		(R7),R8	;  interval counter
                       58   65   D1  1D7B       	CMPL	(R5),R8	; If current peak is greater
                            03   18  1D7E       	BGEQ	30105$			;  we're done
                       65   58   D0  1D80       	MOVL	R8,(R5)	; Else, current interval counter
                                     1D83       30105$:
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 153
X-19                            -  SCS_CTRS_UPDATE   - Update conditiona 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (35)

                                     1D83  6633 
                  55   021C C4   DE  1D83  6634 	MOVAL	PDT$L_PORT_CMD_AVG(R4),R5   ; Get addr. of port cmd avg. ctr
                                     1D88  6635 	AVG_CTR_UPDATE R5,R6,R7,R8	; Update the average counter
                            65   D5  1D88       	TSTL	(R5)		; Is average counter 0?
                            06   12  1D8A       	BNEQ	30106$			;  No, calculate new one
                       67   66   C3  1D8C       	SUBL3	(R6),(R7),-
                            65       1D8F       		(R5)		; Yes, copy interval counter
                            1C   11  1D90       	BRB	30107$
                                     1D92       30106$:
                            52   DD  1D92       	PUSHL	R2			; Save reg. for computation
              52   0000001D'EF   D0  1D94       	MOVL	SHARE_TIMER_COUNT,R2	; Copy timer count
                            66   C3  1D9B       	SUBL3	(R6),-	; Calculate current
                       58   67       1D9D       		(R7),R8	;  interval counter
                  58   52   65   7A  1D9F       	EMUL	(R5),R2,-
                            50       1DA3       		R8,R0		
                            52   D6  1DA4       	INCL	R2			; Increment timer count
                  65   50   52   7B  1DA6       	EDIV	R2,R0,-
                            51       1DAA       		(R5),R1
                            52 8ED0  1DAB       	POPL	R2			; Restore reg.
                                     1DAE       30107$:
                                     1DAE  6636 
                                     1DAE  6637 ;
                                     1DAE  6638 ; Now for all CDTs queued off from this PDT, update counters
                                     1DAE  6639 ;
                                     1DAE  6640 40$:
                                     1DAE  6641 
                                     1DAE  6642 ASSUME	PDT$Q_CONN_WAIT+8  EQ	PDT$Q_YELLOW
                                     1DAE  6643 ASSUME	PDT$Q_YELLOW+8	   EQ	PDT$Q_RED
                                     1DAE  6644 ASSUME  PDT$Q_RED+8	   EQ	PDT$Q_DISABLED
                                     1DAE  6645 
                       59   04   D0  1DAE  6646 	MOVL	#4,R9			; Get # of CDT queues in PDT
                  57   0108 C4   7E  1DB1  6647 	MOVAQ	PDT$Q_CONN_WAIT(R4),R7	; Get first queue header addr
                       58   57   D0  1DB6  6648 L0:	MOVL	R7,R8			; Copy for reference
                       58   68   D0  1DB9  6649 WLOOP:	MOVL	(R8),R8			; Get next CDT entry
                       57   58   D1  1DBC  6650 	CMPL	R8,R7			; End of this queue?
                            03   12  1DBF  6651 	BNEQ	L01			; No, continue
                          01C8   31  1DC1  6652 	BRW	WDONE			; Yes
                                     1DC4  6653 L01:
                  53   FF60 C8   DE  1DC4  6654 	MOVAL	-CDT$L_SHARE_FLINK(R8),R3 ; Point to the beginning of CDT
                                     1DC9  6655 ;
                                     1DC9  6656 ; (TYC 31-Aug-89) Modified due to change in counter definitions
                                     1DC9  6657 ;
                       52   05   D0  1DC9  6658 	MOVL	#5,R2			; Get # of counters to update
                  55   0100 C3   DE  1DCC  6659 	MOVAL	CDT$L_BYTES_XFER_PEAK(R3),R5  ; Get addr. of first peak counter
                  56   00D8 C3   DE  1DD1  6660 	MOVAL	CDT$L_BYTES_XFER_LAST(R3),R6  ; Get addr. of first last interval ctr
                  5A   00C4 C3   DE  1DD6  6661 	MOVAL   CDT$L_BYTES_XFER(R3),R10 ; Get addr. of first life time counter
                                     1DDB  6662 L1:	PEAK_CTR_UPDATE R5,R6,R10,R11	; Update the peak counter
                            66   C3  1DDB       	SUBL3	(R6),-	; Calculate current 
                       5B   6A       1DDD       		(R10),R11	;  interval counter
                       5B   65   D1  1DDF       	CMPL	(R5),R11	; If current peak is greater
                            03   18  1DE2       	BGEQ	30108$			;  we're done
                       65   5B   D0  1DE4       	MOVL	R11,(R5)	; Else, current interval counter
                                     1DE7       30108$:
                       55   04   C0  1DE7  6663 	ADDL	#4,R5			; Point to next peak counter
                       56   04   C0  1DEA  6664 	ADDL	#4,R6			; Point to next last interval counter
                       5A   04   C0  1DED  6665 	ADDL    #4,R10			; Point to next life time counter
                            52   D7  1DF0  6666 	DECL	R2			; Decrement the # of counters
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 154
X-19                            -  SCS_CTRS_UPDATE   - Update conditiona 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (35)

                            E7   12  1DF2  6667 	BNEQ	L1			; If not done, update next counter
                                     1DF4  6668 ;
                                     1DF4  6669 ; (TYC 31-Aug-89) update remaining 5 counters -- these have to be done 
                                     1DF4  6670 ; serially since they are not sequentially located in $CDTDEF
                                     1DF4  6671 ;
                       00EC C3   C3  1DF4  6672 	SUBL3	CDT$L_BYTMAPD_LAST(R3),-; Calculate current interval
                  5B   0094 C3       1DF8  6673 		CDT$L_BYTMAPD(R3),R11	;  counter
                       0114 C3   D1  1DFC  6674 	CMPL	CDT$L_BYTMAPD_PEAK(R3),-; If current peak is greater
                            5B       1E00  6675 		R11			;  than interval counter,
                            05   18  1E01  6676 	BGEQ	PEAK1			;  we're done with this counter
                  0114 C3   5B   D0  1E03  6677 	MOVL	R11,-			; Else, current interval counter
                                     1E08  6678 		CDT$L_BYTMAPD_PEAK(R3)	;  is the new peak value
                                     1E08  6679 PEAK1:
                       00F0 C3   C3  1E08  6680 	SUBL3	CDT$L_DGSENT_LAST(R3),-	; Calculate current interval
                    5B   70 A3       1E0C  6681 		CDT$L_DGSENT(R3),R11	;  counter
                       0118 C3   D1  1E0F  6682 	CMPL	CDT$L_DGSENT_PEAK(R3),-; If current peak is greater
                            5B       1E13  6683 		R11			;  than interval counter,
                            05   18  1E14  6684 	BGEQ	PEAK2			;  we're done with this counter
                  0118 C3   5B   D0  1E16  6685 	MOVL	R11,-			; Else, current interval counter
                                     1E1B  6686 		CDT$L_DGSENT_PEAK(R3)	;  is the new peak value
                                     1E1B  6687 PEAK2:
                       00F4 C3   C3  1E1B  6688 	SUBL3	CDT$L_DGRCVD_LAST(R3),-	; Calculate current interval
                    5B   74 A3       1E1F  6689 		CDT$L_DGRCVD(R3),R11	;  counter
                       011C C3   D1  1E22  6690 	CMPL	CDT$L_DGRCVD_PEAK(R3),-; If current peak is greater
                            5B       1E26  6691 		R11			;  than interval counter,
                            05   18  1E27  6692 	BGEQ	PEAK3			;  we're done with this counter
                  011C C3   5B   D0  1E29  6693 	MOVL	R11,-			; Else, current interval counter
                                     1E2E  6694 		CDT$L_DGRCVD_PEAK(R3)	;  is the new peak value
                                     1E2E  6695 PEAK3:
                       00F8 C3   C3  1E2E  6696 	SUBL3	CDT$L_MSGSENT_LAST(R3),-; Calculate current interval
                    5B   7C A3       1E32  6697 		CDT$L_MSGSENT(R3),R11	;  counter
                       0120 C3   D1  1E35  6698 	CMPL	CDT$L_MSGSENT_PEAK(R3),-; If current peak is greater
                            5B       1E39  6699 		R11			;  than interval counter,
                            05   18  1E3A  6700 	BGEQ	PEAK4			;  we're done with this counter
                  0120 C3   5B   D0  1E3C  6701 	MOVL	R11,-			; Else, current interval counter
                                     1E41  6702 		CDT$L_MSGSENT_PEAK(R3)	;  is the new peak value
                                     1E41  6703 PEAK4:
                       00FC C3   C3  1E41  6704 	SUBL3	CDT$L_MSGRCVD_LAST(R3),-; Calculate current interval
                  5B   0080 C3       1E45  6705 		CDT$L_MSGRCVD(R3),R11	;  counter
                       0124 C3   D1  1E49  6706 	CMPL	CDT$L_MSGRCVD_PEAK(R3),-; If current peak is greater
                            5B       1E4D  6707 		R11			;  than interval counter,
                            05   18  1E4E  6708 	BGEQ	PEAK5			;  we're done with this counter
                  0124 C3   5B   D0  1E50  6709 	MOVL	R11,-			; Else, current interval counter
                                     1E55  6710 		CDT$L_MSGRCVD_PEAK(R3)	;  is the new peak value
                                     1E55  6711 PEAK5:
                                     1E55  6712 		
                       52   05   D0  1E55  6713 	MOVL	#5,R2			; Get # of counters to update
                  55   0128 C3   DE  1E58  6714 	MOVAL	CDT$L_BYTES_XFER_AVG(R3),R5   ; Get addr. of first avg. counter
                  56   00D8 C3   DE  1E5D  6715 	MOVAL	CDT$L_BYTES_XFER_LAST(R3),R6  ; Get addr. of first last interval ctr
                  5A   00C4 C3   DE  1E62  6716 	MOVAL   CDT$L_BYTES_XFER(R3),R10 ; Get addr. of first life time counter
                                     1E67  6717 L2:	AVG_CTR_UPDATE R5,R6,R10,R11	; Update the average counter
                            65   D5  1E67       	TSTL	(R5)		; Is average counter 0?
                            06   12  1E69       	BNEQ	30109$			;  No, calculate new one
                       6A   66   C3  1E6B       	SUBL3	(R6),(R10),-
                            65       1E6E       		(R5)		; Yes, copy interval counter
                            1C   11  1E6F       	BRB	30110$
                                     1E71       30109$:
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 155
X-19                            -  SCS_CTRS_UPDATE   - Update conditiona 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (35)

                            52   DD  1E71       	PUSHL	R2			; Save reg. for computation
              52   0000001D'EF   D0  1E73       	MOVL	SHARE_TIMER_COUNT,R2	; Copy timer count
                            66   C3  1E7A       	SUBL3	(R6),-	; Calculate current
                       5B   6A       1E7C       		(R10),R11	;  interval counter
                  5B   52   65   7A  1E7E       	EMUL	(R5),R2,-
                            50       1E82       		R11,R0		
                            52   D6  1E83       	INCL	R2			; Increment timer count
                  65   50   52   7B  1E85       	EDIV	R2,R0,-
                            51       1E89       		(R5),R1
                            52 8ED0  1E8A       	POPL	R2			; Restore reg.
                                     1E8D       30110$:
                       55   04   C0  1E8D  6718 	ADDL	#4,R5			; Point to next average counter
                       56   04   C0  1E90  6719 	ADDL	#4,R6			; Point to next last interval counter
                       5A   04   C0  1E93  6720 	ADDL    #4,R10			; Point to next life time counter
                            52   D7  1E96  6721 	DECL	R2			; Decrement the # of counters
                            CD   12  1E98  6722 	BNEQ	L2			; If not done, update next counter
                                     1E9A  6723 ;
                                     1E9A  6724 ; (TYC 31-Aug-89) update remaining 5 counters -- these have to be done 
                                     1E9A  6725 ; serially since they are not sequentially located in $CDTDEF
                                     1E9A  6726 ;
                       013C C3   D5  1E9A  6727 	TSTL	CDT$L_BYTMAPD_AVG(R3)	; Is average counter 0?
                            0C   12  1E9E  6728 	BNEQ	CALCAVG1		;  No, calculate new one
                       00EC C3   C3  1EA0  6729 	SUBL3	CDT$L_BYTMAPD_LAST(R3),-; Yes, copy interval counter
                       0094 C3       1EA4  6730 		CDT$L_BYTMAPD(R3),-
                       013C C3       1EA7  6731 		CDT$L_BYTMAPD_AVG(R3)
                            1F   11  1EAA  6732 	BRB	EXITAVG1
                                     1EAC  6733 CALCAVG1:
              55   0000001D'EF   D0  1EAC  6734 	MOVL	SHARE_TIMER_COUNT,R5	; Copy timer count
                       00EC C3   C3  1EB3  6735 	SUBL3	CDT$L_BYTMAPD_LAST(R3),-; Calculate current
                  5B   0094 C3       1EB7  6736 		CDT$L_BYTMAPD(R3),R11	;  interval counter
                       013C C3   7A  1EBB  6737 	EMUL	CDT$L_BYTMAPD_AVG(R3),-	; Calculate average
                  50   5B   55       1EBF  6738 		R5,R11,R0		;  counter
                            55   D6  1EC2  6739 	INCL	R5			; Increment timer count
        51   013C C3   50   55   7B  1EC4  6740 	EDIV	R5,R0,-
                                     1ECB  6741 		CDT$L_BYTMAPD_AVG(R3),R1 
                                     1ECB  6742 EXITAVG1:
                       0140 C3   D5  1ECB  6743 	TSTL	CDT$L_DGSENT_AVG(R3)	; Is average counter 0?
                            0B   12  1ECF  6744 	BNEQ	CALCAVG2		;  No, calculate new one
                       00F0 C3   C3  1ED1  6745 	SUBL3	CDT$L_DGSENT_LAST(R3),-; Yes, copy interval counter
                         70 A3       1ED5  6746 		CDT$L_DGSENT(R3),-
                       0140 C3       1ED7  6747 		CDT$L_DGSENT_AVG(R3)
                            1E   11  1EDA  6748 	BRB	EXITAVG2
                                     1EDC  6749 CALCAVG2:
              55   0000001D'EF   D0  1EDC  6750 	MOVL	SHARE_TIMER_COUNT,R5	; Copy timer count
                       00F0 C3   C3  1EE3  6751 	SUBL3	CDT$L_DGSENT_LAST(R3),-; Calculate current
                    5B   70 A3       1EE7  6752 		CDT$L_DGSENT(R3),R11	;  interval counter
                       0140 C3   7A  1EEA  6753 	EMUL	CDT$L_DGSENT_AVG(R3),-	; Calculate average
                  50   5B   55       1EEE  6754 		R5,R11,R0		;  counter
                            55   D6  1EF1  6755 	INCL	R5			; Increment timer count
        51   0140 C3   50   55   7B  1EF3  6756 	EDIV	R5,R0,-
                                     1EFA  6757 		CDT$L_DGSENT_AVG(R3),R1 
                                     1EFA  6758 EXITAVG2:
                       0144 C3   D5  1EFA  6759 	TSTL	CDT$L_DGRCVD_AVG(R3)	; Is average counter 0?
                            0B   12  1EFE  6760 	BNEQ	CALCAVG3		;  No, calculate new one
                       00F4 C3   C3  1F00  6761 	SUBL3	CDT$L_DGRCVD_LAST(R3),-; Yes, copy interval counter
                         74 A3       1F04  6762 		CDT$L_DGRCVD(R3),-
                       0144 C3       1F06  6763 		CDT$L_DGRCVD_AVG(R3)
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 156
X-19                            -  SCS_CTRS_UPDATE   - Update conditiona 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (35)

                            1E   11  1F09  6764 	BRB	EXITAVG3
                                     1F0B  6765 CALCAVG3:
              55   0000001D'EF   D0  1F0B  6766 	MOVL	SHARE_TIMER_COUNT,R5	; Copy timer count
                       00F4 C3   C3  1F12  6767 	SUBL3	CDT$L_DGRCVD_LAST(R3),-; Calculate current
                    5B   74 A3       1F16  6768 		CDT$L_DGRCVD(R3),R11	;  interval counter
                       0144 C3   7A  1F19  6769 	EMUL	CDT$L_DGRCVD_AVG(R3),-	; Calculate average
                  50   5B   55       1F1D  6770 		R5,R11,R0		;  counter
                            55   D6  1F20  6771 	INCL	R5			; Increment timer count
        51   0144 C3   50   55   7B  1F22  6772 	EDIV	R5,R0,-
                                     1F29  6773 		CDT$L_DGRCVD_AVG(R3),R1 
                                     1F29  6774 EXITAVG3:
                       0148 C3   D5  1F29  6775 	TSTL	CDT$L_MSGSENT_AVG(R3)	; Is average counter 0?
                            0B   12  1F2D  6776 	BNEQ	CALCAVG4		;  No, calculate new one
                       00F8 C3   C3  1F2F  6777 	SUBL3	CDT$L_MSGSENT_LAST(R3),-; Yes, copy interval counter
                         7C A3       1F33  6778 		CDT$L_MSGSENT(R3),-
                       0148 C3       1F35  6779 		CDT$L_MSGSENT_AVG(R3)
                            1E   11  1F38  6780 	BRB	EXITAVG4
                                     1F3A  6781 CALCAVG4:
              55   0000001D'EF   D0  1F3A  6782 	MOVL	SHARE_TIMER_COUNT,R5	; Copy timer count
                       00F8 C3   C3  1F41  6783 	SUBL3	CDT$L_MSGSENT_LAST(R3),-; Calculate current
                    5B   7C A3       1F45  6784 		CDT$L_MSGSENT(R3),R11	;  interval counter
                       0148 C3   7A  1F48  6785 	EMUL	CDT$L_MSGSENT_AVG(R3),-	; Calculate average
                  50   5B   55       1F4C  6786 		R5,R11,R0		;  counter
                            55   D6  1F4F  6787 	INCL	R5			; Increment timer count
        51   0148 C3   50   55   7B  1F51  6788 	EDIV	R5,R0,-
                                     1F58  6789 		CDT$L_MSGSENT_AVG(R3),R1 
                                     1F58  6790 EXITAVG4:
                       014C C3   D5  1F58  6791 	TSTL	CDT$L_MSGRCVD_AVG(R3)	; Is average counter 0?
                            0C   12  1F5C  6792 	BNEQ	CALCAVG5		;  No, calculate new one
                       00FC C3   C3  1F5E  6793 	SUBL3	CDT$L_MSGRCVD_LAST(R3),-; Yes, copy interval counter
                       0080 C3       1F62  6794 		CDT$L_MSGRCVD(R3),-
                       014C C3       1F65  6795 		CDT$L_MSGRCVD_AVG(R3)
                            1F   11  1F68  6796 	BRB	EXITAVG5
                                     1F6A  6797 CALCAVG5:
              55   0000001D'EF   D0  1F6A  6798 	MOVL	SHARE_TIMER_COUNT,R5	; Copy timer count
                       00FC C3   C3  1F71  6799 	SUBL3	CDT$L_MSGRCVD_LAST(R3),-; Calculate current
                  5B   0080 C3       1F75  6800 		CDT$L_MSGRCVD(R3),R11	;  interval counter
                       014C C3   7A  1F79  6801 	EMUL	CDT$L_MSGRCVD_AVG(R3),-	; Calculate average
                  50   5B   55       1F7D  6802 		R5,R11,R0		;  counter
                            55   D6  1F80  6803 	INCL	R5			; Increment timer count
        51   014C C3   50   55   7B  1F82  6804 	EDIV	R5,R0,-
                                     1F89  6805 		CDT$L_MSGRCVD_AVG(R3),R1 
                                     1F89  6806 EXITAVG5:
                                     1F89  6807 
                          FE2D   31  1F89  6808 	BRW	WLOOP			; Get next CDT in this queue
                                     1F8C  6809 WDONE:
                       57   08   C0  1F8C  6810 	ADDL	#8,R7			; Point to next queue header addr
                            59   D7  1F8F  6811 	DECL	R9			; Decrement # of loop L0 iterations
                            03   13  1F91  6812 	BEQL	WDONE1			; If done, go process next PDT
                          FE20   31  1F93  6813 	BRW	L0			; If not done, go process next queue
                                     1F96  6814 WDONE1:
                          FD49   31  1F96  6815 	BRW	10$			; Go process next PDT
                                     1F99  6816 DONE_PDT:
                                     1F99  6817 ;
                                     1F99  6818 ; Update counters for CDTs which are queued in other SCS queues
                                     1F99  6819 ;
                                     1F99  6820 ; ASSUME	SCS$GQ_REUSE_CDT+8   EQ	SCS$GQ_DISCONNECT
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 157
X-19                            -  SCS_CTRS_UPDATE   - Update conditiona 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (35)

                                     1F99  6821 ; ASSUME	SCS$GQ_DISCONNECT+8  EQ SCS$GQ_WORSE_PATH	
                                     1F99  6822 
                       59   03   D0  1F99  6823 	MOVL	#3,R9			; Get # of SCS queues 
              57   00000000'GF   7E  1F9C  6824 	MOVAQ	G^SCS$GQ_REUSE_CDT,R7	; Get first queue header addr
                       58   57   D0  1FA3  6825 L10:	MOVL	R7,R8			; Copy for reference
                       58   68   D0  1FA6  6826 SLOOP:	MOVL	(R8),R8			; Get next CDT entry
                       57   58   D1  1FA9  6827 	CMPL	R8,R7			; End of this queue?
                            03   12  1FAC  6828 	BNEQ	L10CONT			; No, continue
                          01C8   31  1FAE  6829 	BRW	SDONE			; Yes
                                     1FB1  6830 L10CONT:
                  53   FF60 C8   DE  1FB1  6831 	MOVAL	-CDT$L_SHARE_FLINK(R8),R3 ; Point to the beginning of CDT
                                     1FB6  6832 ;
                                     1FB6  6833 ; (TYC 31-Aug-89) Modified due to change in counter definitions
                                     1FB6  6834 ;
                       52   05   D0  1FB6  6835 	MOVL	#5,R2			; Get # of counters to update
                  55   0100 C3   DE  1FB9  6836 	MOVAL	CDT$L_BYTES_XFER_PEAK(R3),R5  ; Get addr. of first peak counter
                  56   00D8 C3   DE  1FBE  6837 	MOVAL	CDT$L_BYTES_XFER_LAST(R3),R6  ; Get addr. of first last interval ctr
                  5A   00C4 C3   DE  1FC3  6838 	MOVAL   CDT$L_BYTES_XFER(R3),R10 ; Get addr. of first life time counter
                                     1FC8  6839 L11:	PEAK_CTR_UPDATE R5,R6,R10,R11	; Update the peak counter
                            66   C3  1FC8       	SUBL3	(R6),-	; Calculate current 
                       5B   6A       1FCA       		(R10),R11	;  interval counter
                       5B   65   D1  1FCC       	CMPL	(R5),R11	; If current peak is greater
                            03   18  1FCF       	BGEQ	30111$			;  we're done
                       65   5B   D0  1FD1       	MOVL	R11,(R5)	; Else, current interval counter
                                     1FD4       30111$:
                       55   04   C0  1FD4  6840 	ADDL	#4,R5			; Point to next peak counter
                       56   04   C0  1FD7  6841 	ADDL	#4,R6			; Point to next last interval counter
                       5A   04   C0  1FDA  6842 	ADDL    #4,R10                  ; Point to next life time counter
                            52   D7  1FDD  6843 	DECL	R2			; Decrement the # of counters
                            E7   12  1FDF  6844 	BNEQ	L11			; If not done, update next counter
                                     1FE1  6845 ;
                                     1FE1  6846 ; (TYC 31-Aug-89) update remaining 5 counters -- these have to be done 
                                     1FE1  6847 ; serially since they are not sequentially located in $CDTDEF
                                     1FE1  6848 ;
                       00EC C3   C3  1FE1  6849 	SUBL3	CDT$L_BYTMAPD_LAST(R3),-; Calculate current interval
                  5B   0094 C3       1FE5  6850 		CDT$L_BYTMAPD(R3),R11	;  counter
                       0114 C3   D1  1FE9  6851 	CMPL	CDT$L_BYTMAPD_PEAK(R3),-; If current peak is greater
                            5B       1FED  6852 		R11			;  than interval counter,
                            05   18  1FEE  6853 	BGEQ	PEAK11			;  we're done with this counter
                  0114 C3   5B   D0  1FF0  6854 	MOVL	R11,-			; Else, current interval counter
                                     1FF5  6855 		CDT$L_BYTMAPD_PEAK(R3)	;  is the new peak value
                                     1FF5  6856 PEAK11:
                       00F0 C3   C3  1FF5  6857 	SUBL3	CDT$L_DGSENT_LAST(R3),-	; Calculate current interval
                    5B   70 A3       1FF9  6858 		CDT$L_DGSENT(R3),R11	;  counter
                       0118 C3   D1  1FFC  6859 	CMPL	CDT$L_DGSENT_PEAK(R3),-; If current peak is greater
                            5B       2000  6860 		R11			;  than interval counter,
                            05   18  2001  6861 	BGEQ	PEAK12			;  we're done with this counter
                  0118 C3   5B   D0  2003  6862 	MOVL	R11,-			; Else, current interval counter
                                     2008  6863 		CDT$L_DGSENT_PEAK(R3)	;  is the new peak value
                                     2008  6864 PEAK12:
                       00F4 C3   C3  2008  6865 	SUBL3	CDT$L_DGRCVD_LAST(R3),-	; Calculate current interval
                    5B   74 A3       200C  6866 		CDT$L_DGRCVD(R3),R11	;  counter
                       011C C3   D1  200F  6867 	CMPL	CDT$L_DGRCVD_PEAK(R3),-; If current peak is greater
                            5B       2013  6868 		R11			;  than interval counter,
                            05   18  2014  6869 	BGEQ	PEAK13			;  we're done with this counter
                  011C C3   5B   D0  2016  6870 	MOVL	R11,-			; Else, current interval counter
                                     201B  6871 		CDT$L_DGRCVD_PEAK(R3)	;  is the new peak value
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 158
X-19                            -  SCS_CTRS_UPDATE   - Update conditiona 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (35)

                                     201B  6872 PEAK13:
                       00F8 C3   C3  201B  6873 	SUBL3	CDT$L_MSGSENT_LAST(R3),-; Calculate current interval
                    5B   7C A3       201F  6874 		CDT$L_MSGSENT(R3),R11	;  counter
                       0120 C3   D1  2022  6875 	CMPL	CDT$L_MSGSENT_PEAK(R3),-; If current peak is greater
                            5B       2026  6876 		R11			;  than interval counter,
                            05   18  2027  6877 	BGEQ	PEAK14			;  we're done with this counter
                  0120 C3   5B   D0  2029  6878 	MOVL	R11,-			; Else, current interval counter
                                     202E  6879 		CDT$L_MSGSENT_PEAK(R3)	;  is the new peak value
                                     202E  6880 PEAK14:
                       00FC C3   C3  202E  6881 	SUBL3	CDT$L_MSGRCVD_LAST(R3),-; Calculate current interval
                  5B   0080 C3       2032  6882 		CDT$L_MSGRCVD(R3),R11	;  counter
                       0124 C3   D1  2036  6883 	CMPL	CDT$L_MSGRCVD_PEAK(R3),-; If current peak is greater
                            5B       203A  6884 		R11			;  than interval counter,
                            05   18  203B  6885 	BGEQ	PEAK15			;  we're done with this counter
                  0124 C3   5B   D0  203D  6886 	MOVL	R11,-			; Else, current interval counter
                                     2042  6887 		CDT$L_MSGRCVD_PEAK(R3)	;  is the new peak value
                                     2042  6888 PEAK15:
                                     2042  6889 
                       52   05   D0  2042  6890 	MOVL	#5,R2			; Get # of counters to update
                  55   0128 C3   DE  2045  6891 	MOVAL	CDT$L_BYTES_XFER_AVG(R3),R5   ; Get addr. of first avg. counter
                  56   00D8 C3   DE  204A  6892 	MOVAL	CDT$L_BYTES_XFER_LAST(R3),R6  ; Get addr. of first last interval ctr
                  5A   00C4 C3   DE  204F  6893 	MOVAL   CDT$L_BYTES_XFER(R3),R10 ; Get addr. of first life time counter
                                     2054  6894 L12:	AVG_CTR_UPDATE R5,R6,R10,R11	; Update the average counter
                            65   D5  2054       	TSTL	(R5)		; Is average counter 0?
                            06   12  2056       	BNEQ	30112$			;  No, calculate new one
                       6A   66   C3  2058       	SUBL3	(R6),(R10),-
                            65       205B       		(R5)		; Yes, copy interval counter
                            1C   11  205C       	BRB	30113$
                                     205E       30112$:
                            52   DD  205E       	PUSHL	R2			; Save reg. for computation
              52   0000001D'EF   D0  2060       	MOVL	SHARE_TIMER_COUNT,R2	; Copy timer count
                            66   C3  2067       	SUBL3	(R6),-	; Calculate current
                       5B   6A       2069       		(R10),R11	;  interval counter
                  5B   52   65   7A  206B       	EMUL	(R5),R2,-
                            50       206F       		R11,R0		
                            52   D6  2070       	INCL	R2			; Increment timer count
                  65   50   52   7B  2072       	EDIV	R2,R0,-
                            51       2076       		(R5),R1
                            52 8ED0  2077       	POPL	R2			; Restore reg.
                                     207A       30113$:
                       55   04   C0  207A  6895 	ADDL	#4,R5			; Point to next average counter
                       56   04   C0  207D  6896 	ADDL	#4,R6			; Point to next last interval counter
                       5A   04   C0  2080  6897 	ADDL    #4,R10                  ; Point to next life time counter
                            52   D7  2083  6898 	DECL	R2			; Decrement the # of counters
                            CD   12  2085  6899 	BNEQ	L12			; If not done, update next counter
                                     2087  6900 ;
                                     2087  6901 ; (TYC 31-Aug-89) update remaining 5 counters -- these have to be done 
                                     2087  6902 ; serially since they are not sequentially located in $CDTDEF
                                     2087  6903 ;
                       013C C3   D5  2087  6904 	TSTL	CDT$L_BYTMAPD_AVG(R3)	; Is average counter 0?
                            0C   12  208B  6905 	BNEQ	CALCAVG11		;  No, calculate new one
                       00EC C3   C3  208D  6906 	SUBL3	CDT$L_BYTMAPD_LAST(R3),-; Yes, copy interval counter
                       0094 C3       2091  6907 		CDT$L_BYTMAPD(R3),-
                       013C C3       2094  6908 		CDT$L_BYTMAPD_AVG(R3)
                            1F   11  2097  6909 	BRB	EXITAVG11
                                     2099  6910 CALCAVG11:
              55   0000001D'EF   D0  2099  6911 	MOVL	SHARE_TIMER_COUNT,R5	; Copy timer count
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 159
X-19                            -  SCS_CTRS_UPDATE   - Update conditiona 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (35)

                       00EC C3   C3  20A0  6912 	SUBL3	CDT$L_BYTMAPD_LAST(R3),-; Calculate current
                  5B   0094 C3       20A4  6913 		CDT$L_BYTMAPD(R3),R11	;  interval counter
                       013C C3   7A  20A8  6914 	EMUL	CDT$L_BYTMAPD_AVG(R3),-	; Calculate average
                  50   5B   55       20AC  6915 		R5,R11,R0		;  counter
                            55   D6  20AF  6916 	INCL	R5			; Increment timer count
        51   013C C3   50   55   7B  20B1  6917 	EDIV	R5,R0,-
                                     20B8  6918 		CDT$L_BYTMAPD_AVG(R3),R1 
                                     20B8  6919 EXITAVG11:
                       0140 C3   D5  20B8  6920 	TSTL	CDT$L_DGSENT_AVG(R3)	; Is average counter 0?
                            0B   12  20BC  6921 	BNEQ	CALCAVG12		;  No, calculate new one
                       00F0 C3   C3  20BE  6922 	SUBL3	CDT$L_DGSENT_LAST(R3),-; Yes, copy interval counter
                         70 A3       20C2  6923 		CDT$L_DGSENT(R3),-
                       0140 C3       20C4  6924 		CDT$L_DGSENT_AVG(R3)
                            1E   11  20C7  6925 	BRB	EXITAVG12
                                     20C9  6926 CALCAVG12:
              55   0000001D'EF   D0  20C9  6927 	MOVL	SHARE_TIMER_COUNT,R5	; Copy timer count
                       00F0 C3   C3  20D0  6928 	SUBL3	CDT$L_DGSENT_LAST(R3),-; Calculate current
                    5B   70 A3       20D4  6929 		CDT$L_DGSENT(R3),R11	;  interval counter
                       0140 C3   7A  20D7  6930 	EMUL	CDT$L_DGSENT_AVG(R3),-	; Calculate average
                  50   5B   55       20DB  6931 		R5,R11,R0		;  counter
                            55   D6  20DE  6932 	INCL	R5			; Increment timer count
        51   0140 C3   50   55   7B  20E0  6933 	EDIV	R5,R0,-
                                     20E7  6934 		CDT$L_DGSENT_AVG(R3),R1 
                                     20E7  6935 EXITAVG12:
                       0144 C3   D5  20E7  6936 	TSTL	CDT$L_DGRCVD_AVG(R3)	; Is average counter 0?
                            0B   12  20EB  6937 	BNEQ	CALCAVG13		;  No, calculate new one
                       00F4 C3   C3  20ED  6938 	SUBL3	CDT$L_DGRCVD_LAST(R3),-; Yes, copy interval counter
                         74 A3       20F1  6939 		CDT$L_DGRCVD(R3),-
                       0144 C3       20F3  6940 		CDT$L_DGRCVD_AVG(R3)
                            1E   11  20F6  6941 	BRB	EXITAVG13
                                     20F8  6942 CALCAVG13:
              55   0000001D'EF   D0  20F8  6943 	MOVL	SHARE_TIMER_COUNT,R5	; Copy timer count
                       00F4 C3   C3  20FF  6944 	SUBL3	CDT$L_DGRCVD_LAST(R3),-; Calculate current
                    5B   74 A3       2103  6945 		CDT$L_DGRCVD(R3),R11	;  interval counter
                       0144 C3   7A  2106  6946 	EMUL	CDT$L_DGRCVD_AVG(R3),-	; Calculate average
                  50   5B   55       210A  6947 		R5,R11,R0		;  counter
                            55   D6  210D  6948 	INCL	R5			; Increment timer count
        51   0144 C3   50   55   7B  210F  6949 	EDIV	R5,R0,-
                                     2116  6950 		CDT$L_DGRCVD_AVG(R3),R1 
                                     2116  6951 EXITAVG13:
                       0148 C3   D5  2116  6952 	TSTL	CDT$L_MSGSENT_AVG(R3)	; Is average counter 0?
                            0B   12  211A  6953 	BNEQ	CALCAVG14		;  No, calculate new one
                       00F8 C3   C3  211C  6954 	SUBL3	CDT$L_MSGSENT_LAST(R3),-; Yes, copy interval counter
                         7C A3       2120  6955 		CDT$L_MSGSENT(R3),-
                       0148 C3       2122  6956 		CDT$L_MSGSENT_AVG(R3)
                            1E   11  2125  6957 	BRB	EXITAVG14
                                     2127  6958 CALCAVG14:
              55   0000001D'EF   D0  2127  6959 	MOVL	SHARE_TIMER_COUNT,R5	; Copy timer count
                       00F8 C3   C3  212E  6960 	SUBL3	CDT$L_MSGSENT_LAST(R3),-; Calculate current
                    5B   7C A3       2132  6961 		CDT$L_MSGSENT(R3),R11	;  interval counter
                       0148 C3   7A  2135  6962 	EMUL	CDT$L_MSGSENT_AVG(R3),-	; Calculate average
                  50   5B   55       2139  6963 		R5,R11,R0		;  counter
                            55   D6  213C  6964 	INCL	R5			; Increment timer count
        51   0148 C3   50   55   7B  213E  6965 	EDIV	R5,R0,-
                                     2145  6966 		CDT$L_MSGSENT_AVG(R3),R1 
                                     2145  6967 EXITAVG14:
                       014C C3   D5  2145  6968 	TSTL	CDT$L_MSGRCVD_AVG(R3)	; Is average counter 0?
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 160
X-19                            -  SCS_CTRS_UPDATE   - Update conditiona 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (35)

                            0C   12  2149  6969 	BNEQ	CALCAVG15		;  No, calculate new one
                       00FC C3   C3  214B  6970 	SUBL3	CDT$L_MSGRCVD_LAST(R3),-; Yes, copy interval counter
                       0080 C3       214F  6971 		CDT$L_MSGRCVD(R3),-
                       014C C3       2152  6972 		CDT$L_MSGRCVD_AVG(R3)
                            1F   11  2155  6973 	BRB	EXITAVG15
                                     2157  6974 CALCAVG15:
              55   0000001D'EF   D0  2157  6975 	MOVL	SHARE_TIMER_COUNT,R5	; Copy timer count
                       00FC C3   C3  215E  6976 	SUBL3	CDT$L_MSGRCVD_LAST(R3),-; Calculate current
                  5B   0080 C3       2162  6977 		CDT$L_MSGRCVD(R3),R11	;  interval counter
                       014C C3   7A  2166  6978 	EMUL	CDT$L_MSGRCVD_AVG(R3),-	; Calculate average
                  50   5B   55       216A  6979 		R5,R11,R0		;  counter
                            55   D6  216D  6980 	INCL	R5			; Increment timer count
        51   014C C3   50   55   7B  216F  6981 	EDIV	R5,R0,-
                                     2176  6982 		CDT$L_MSGRCVD_AVG(R3),R1 
                                     2176  6983 EXITAVG15:
                                     2176  6984 
                          FE2D   31  2176  6985 	BRW	SLOOP			; Get next CDT in this queue
                                     2179  6986 SDONE:
                       57   08   C0  2179  6987 	ADDL	#8,R7			; Point to next queue header addr
                            59   D7  217C  6988 	DECL	R9			; Decrement # of loop L10 iterations
                            03   13  217E  6989 	BEQL	SDONE1			; If done, exit
                          FE20   31  2180  6990 	BRW	L10			; If not done, go process next queue
                                     2183  6991 SDONE1:
                   0000001D'EF   D6  2183  6992 	INCL	SHARE_TIMER_COUNT	; Count # of load sharing TQE activations
                                     2189  6993 
                       0FFF 8F   BA  2189  6994 	POPR	#^M<R0,R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11> ; Restore registers
                                 05  218D  6995 	RSB				; return
                                     218E  6996 	.disable lsb		
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 161
X-19                            -  SCS_UPDATE_REG_CTRS - Update regular  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (36)

                                     218E  6998 	.SBTTL	-		SCS_UPDATE_REG_CTRS - Update regular counters
                                     218E  6999 ;++
                                     218E  7000 ;
                                     218E  7001 ; SCS_UPDATE_REG_CTRS:
                                     218E  7002 ;
                                     218E  7003 ;	This subroutine updates all regular load sharing port and
                                     218E  7004 ;	connection counters at the end of each load sharing interval.
                                     218E  7005 ; (TYC 31-Aug-89)
                                     218E  7006 ;	The current system life-time counters are copied
                                     218E  7007 ;	to the life-time counters up to the last load sharing interval.
                                     218E  7008 ;
                                     218E  7009 ;	(NOTE:  For now, the total bytes transferred port counters are treated
                                     218E  7010 ;		as a longword.  If necessary, the quadword can be used in
                                     218E  7011 ;		the future.) 
                                     218E  7012 ;
                                     218E  7013 ; CALLING SEQUENCE:
                                     218E  7014 ;
                                     218E  7015 ;	Called from SCS_LOAD_SHARE_TIMER routine
                                     218E  7016 ;
                                     218E  7017 ; INPUT PARAMETERS:
                                     218E  7018 ;
                                     218E  7019 ;	NONE
                                     218E  7020 ;
                                     218E  7021 ; OUTPUT PARAMETERS:
                                     218E  7022 ; 
                                     218E  7023 ;	NONE
                                     218E  7024 ;
                                     218E  7025 ; COMPLETION CODES:
                                     218E  7026 ;
                                     218E  7027 ;	NONE
                                     218E  7028 ;
                                     218E  7029 ; SIDE EFFECTS:
                                     218E  7030 ;
                                     218E  7031 ;	All registers preserved
                                     218E  7032 ;	Counters are updated in PDTs and CDTs.
                                     218E  7033 ;--
                                     218E  7034 	.enable lsb
                                     218E  7035 SCS_UPDATE_REG_CTRS:
                                     218E  7036 
                                     218E  7037 ASSUME	PDT$L_BYTES_DG_XMT_LAST+4	EQ	PDT$L_BYTES_DG_RCV_LAST	
                                     218E  7038 ASSUME	PDT$L_BYTES_DG_RCV_LAST+4	EQ	PDT$L_BYTES_MSG_XMT_LAST
                                     218E  7039 ASSUME	PDT$L_BYTES_MSG_XMT_LAST+4	EQ	PDT$L_BYTES_MSG_RCV_LAST
                                     218E  7040 ASSUME	PDT$L_BYTES_MSG_RCV_LAST+4	EQ	PDT$L_BYTES_MAPPED_LAST
                                     218E  7041 ASSUME	PDT$L_BYTES_MAPPED_LAST+4	EQ	PDT$L_DG_XMT_LAST
                                     218E  7042 ASSUME	PDT$L_DG_XMT_LAST+4		EQ	PDT$L_DG_RCV_LAST
                                     218E  7043 ASSUME	PDT$L_DG_RCV_LAST+4		EQ	PDT$L_MSG_XMT_LAST
                                     218E  7044 ASSUME	PDT$L_MSG_XMT_LAST+4		EQ	PDT$L_MSG_RCV_LAST
                                     218E  7045 ASSUME	PDT$L_MSG_RCV_LAST+4		EQ	PDT$Q_BYTES_XFER_LAST
                                     218E  7046 ASSUME	PDT$Q_BYTES_XFER_LAST+8		EQ	PDT$L_NUM_MAP_LAST	
                                     218E  7047 ASSUME	PDT$L_NUM_MAP_LAST+4		EQ	PDT$L_PORT_CMD_LAST	
                                     218E  7048 
                                     218E  7049 ASSUME	PDT$L_BYTES_DG_XMT+4	EQ	PDT$L_BYTES_DG_RCV	
                                     218E  7050 ASSUME	PDT$L_BYTES_DG_RCV+4	EQ	PDT$L_BYTES_MSG_XMT
                                     218E  7051 ASSUME	PDT$L_BYTES_MSG_XMT+4	EQ	PDT$L_BYTES_MSG_RCV
                                     218E  7052 ASSUME	PDT$L_BYTES_MSG_RCV+4	EQ	PDT$L_BYTES_MAPPED
                                     218E  7053 ASSUME	PDT$L_BYTES_MAPPED+4	EQ	PDT$L_DG_XMT
                                     218E  7054 ASSUME	PDT$L_DG_XMT+4		EQ	PDT$L_DG_RCV
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 162
X-19                            -  SCS_UPDATE_REG_CTRS - Update regular  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (36)

                                     218E  7055 ASSUME	PDT$L_DG_RCV+4		EQ	PDT$L_MSG_XMT
                                     218E  7056 ASSUME	PDT$L_MSG_XMT+4		EQ	PDT$L_MSG_RCV
                                     218E  7057 ASSUME	PDT$L_MSG_RCV+4		EQ	PDT$Q_BYTES_XFER
                                     218E  7058 ASSUME	PDT$Q_BYTES_XFER+8	EQ	PDT$L_NUM_MAP	
                                     218E  7059 ASSUME	PDT$L_NUM_MAP+4		EQ	PDT$L_PORT_CMD	
                                     218E  7060 
                                     218E  7061 ASSUME	CDT$L_BYTES_XFER_LAST+4		EQ	CDT$L_BYTES_DG_XMT_LAST 
                                     218E  7062 ASSUME	CDT$L_BYTES_DG_XMT_LAST+4	EQ	CDT$L_BYTES_DG_RCV_LAST 
                                     218E  7063 ASSUME	CDT$L_BYTES_DG_RCV_LAST+4	EQ	CDT$L_BYTES_MSG_XMT_LAST 
                                     218E  7064 ASSUME	CDT$L_BYTES_MSG_XMT_LAST+4	EQ	CDT$L_BYTES_MSG_RCV_LAST 
                                     218E  7065 
                                     218E  7066 ASSUME	CDT$L_BYTES_XFER+4		EQ	CDT$L_BYTES_DG_XMT 
                                     218E  7067 ASSUME	CDT$L_BYTES_DG_XMT+4		EQ	CDT$L_BYTES_DG_RCV 
                                     218E  7068 ASSUME	CDT$L_BYTES_DG_RCV+4		EQ	CDT$L_BYTES_MSG_XMT 
                                     218E  7069 ASSUME	CDT$L_BYTES_MSG_XMT+4		EQ	CDT$L_BYTES_MSG_RCV 
                                     218E  7070 
                       03FC 8F   BB  218E  7071 	PUSHR	#^M<R2,R3,R4,R5,R6,R7,R8,R9> ; Save some registers
              54   00000000'GF   DE  2192  7072 	MOVAL	G^SCS$GL_PDT,R4		; Get the PDT listhead
                       54   64   D0  2199  7073 10$:	MOVL	(R4),R4			; Get the first/next listhead
                            03   12  219C  7074 	BNEQ	20$			; Continue if there's more PDT
                          00D3   31  219E  7075 	BRW	90$			; No more, done
                            02   B1  21A1  7076 20$:	CMPW	#PDT$C_BALANCEVER,-	; Do we understand this PDT?
                       00F4 C4       21A3  7077 		PDT$W_SCSVERSION(R4)
                            F1   14  21A6  7078 	BGTR	10$			; Branch if we don't - take  no
                                     21A8  7079 					;  further action for this PDT
                                     21A8  7080 
                       52   0A   D0  21A8  7081 	MOVL	#10,R2			; Get # of PDT counters to update
                  55   0148 C4   DE  21AB  7082 	MOVAL	PDT$L_BYTES_DG_XMT(R4),R5 ; Get addr. of first life-time ctr.
                  56   017C C4   DE  21B0  7083 	MOVAL	PDT$L_BYTES_DG_XMT_LAST(R4),R6  ; Get addr. of first last interval ctr
                       66   65   D0  21B5  7084 30$:	MOVL	(R5),(R6)		; Update up to last interval counter
                       55   04   C0  21B8  7085 	ADDL	#4,R5			; Point to next life-time counter
                       56   04   C0  21BB  7086 	ADDL	#4,R6			; Point to next last interval counter
                            52   D7  21BE  7087 	DECL	R2			; Decrement the # of counters
                            F3   12  21C0  7088 	BNEQ	30$			; If not done, update next counter
                                     21C2  7089 ;
                                     21C2  7090 ; (TYC0016) Update "up to last interval" counters for the extended 
                                     21C2  7091 ; hardware counters
                                     21C2  7092 ;
                  57   00E8 C4   D0  21C2  7093  	MOVL	PDT$L_UCB0(R4),R7	; Get the UCB addr
                   00000C05 8F   D1  21C7  7094 	CMPL	#NDT$_CIXCD,-
                       00F4 C7       21CD  7095 		UCB$L_NDT(R7)		; Is this a CIXCD port?
                            38   12  21D0  7096 	BNEQ	40$			; No, go update CDT ctrs
                       068C C4   D0  21D2  7097 	MOVL	PDT$L_SNDDAT_DATA_SNT(R4),-
                       071C C4       21D6  7098 		PDT$L_SNDDAT_DATA_SNT_LAST(R4)
                       0688 C4   D0  21D9  7099 	MOVL	PDT$L_SNDDAT_OPER_SNT(R4),-
                       0720 C4       21DD  7100 		PDT$L_SNDDAT_OPER_SNT_LAST(R4)
                       0698 C4   D0  21E0  7101 	MOVL	PDT$L_RETDAT_DATA_RCV(R4),-
                       0724 C4       21E4  7102 		PDT$L_RETDAT_DATA_RCV_LAST(R4)
                       0694 C4   D0  21E7  7103 	MOVL	PDT$L_REQDAT_OPER_SNT(R4),-
                       0728 C4       21EB  7104 		PDT$L_REQDAT_OPER_SNT_LAST(R4)
                       06A4 C4   D0  21EE  7105 	MOVL	PDT$L_SNTDAT_DATA_REC(R4),-
                       0730 C4       21F2  7106 		PDT$L_SNTDAT_DATA_REC_LAST(R4)
                       06A8 C4   D0  21F5  7107 	MOVL	PDT$L_CNF_SNT(R4),-
                       072C C4       21F9  7108 		PDT$L_CNF_SNT_LAST(R4)
                       06B4 C4   D0  21FC  7109 	MOVL	PDT$L_RETDAT_DATA_SNT(R4),-
                       0738 C4       2200  7110 		PDT$L_RETDAT_DATA_SNT_LAST(R4)
                       06AC C4   D0  2203  7111 	MOVL	PDT$L_DATREQ_BODIES_RCV(R4),-
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 163
X-19                            -  SCS_UPDATE_REG_CTRS - Update regular  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (36)

                       0734 C4       2207  7112 		PDT$L_DATREQ_BODIES_RCV_LAST(R4)
                                     220A  7113 	
                                     220A  7114 40$:
                                     220A  7115 ; 
                                     220A  7116 ; (TYC0016) Reset the # of seconds left till next RDCNT 
                                     220A  7117 ; to 59 seconds so that next load sharing interval will
                                     220A  7118 ; pick up latest RDCNT results.
                                     220A  7119 ;
                  0634 C4   3B   D0  220A  7120 	MOVL	#59,PDT$L_CURCNT(R4)	; Reset # of secs left
                                     220F  7121 
                                     220F  7122 ; (TYC0016) Update # of block data map operations
                                     220F  7123 
                       0174 C4   D0  220F  7124 	MOVL	PDT$L_NUM_MAP(R4),-
                       01A8 C4       2213  7125 		PDT$L_NUM_MAP_LAST(R4)
                                     2216  7126 ;	
                                     2216  7127 
                                     2216  7128 ;
                                     2216  7129 ; Now go through all 4 queues in PDT to update CDT life-time counters
                                     2216  7130 ;
                                     2216  7131 ASSUME	PDT$Q_CONN_WAIT+8  EQ	PDT$Q_YELLOW
                                     2216  7132 ASSUME	PDT$Q_YELLOW+8	   EQ	PDT$Q_RED
                                     2216  7133 ASSUME  PDT$Q_RED+8	   EQ	PDT$Q_DISABLED
                                     2216  7134 
                       59   04   D0  2216  7135 	MOVL	#4,R9			; Get # of CDT queues in PDT
                  57   0108 C4   7E  2219  7136 	MOVAQ	PDT$Q_CONN_WAIT(R4),R7	; Get first queue header addr
                       58   57   D0  221E  7137 50$:	MOVL	R7,R8			; Copy for reference
                       58   68   D0  2221  7138 60$:	MOVL	(R8),R8			; Get next CDT entry
                       57   58   D1  2224  7139 	CMPL	R8,R7			; End of this queue?
                            41   13  2227  7140 	BEQL	80$			; Yes
                  53   FF60 C8   DE  2229  7141 	MOVAL	-CDT$L_SHARE_FLINK(R8),R3 ; Point to the beginning of CDT
                                     222E  7142 
                       52   05   D0  222E  7143 	MOVL	#5,R2			; Get # of counters to update
                  55   00C4 C3   DE  2231  7144 	MOVAL	CDT$L_BYTES_XFER(R3),R5  ; Get addr. of first life-time counter
                  56   00D8 C3   DE  2236  7145 	MOVAL	CDT$L_BYTES_XFER_LAST(R3),R6  ; Get addr. of first last interval ctr
                       66   65   D0  223B  7146 70$:	MOVL	(R5),(R6)		; Update up to last interval counter
                       55   04   C0  223E  7147 	ADDL	#4,R5			; Point to next life-time counter
                       56   04   C0  2241  7148 	ADDL	#4,R6			; Point to next last interval counter
                            52   D7  2244  7149 	DECL	R2			; Decrement the # of counters
                            F3   12  2246  7150 	BNEQ	70$			; If not done, update next counter
                                     2248  7151 ;
                                     2248  7152 ; now update remaining 5 counters -- these have to be done serially
                                     2248  7153 ; since they are not sequentially located in $CDTDEF
                                     2248  7154 ;
                       0094 C3   D0  2248  7155 	MOVL	CDT$L_BYTMAPD(R3),-
                       00EC C3       224C  7156 		CDT$L_BYTMAPD_LAST(R3)
                         70 A3   D0  224F  7157 	MOVL	CDT$L_DGSENT(R3),-
                       00F0 C3       2252  7158 		CDT$L_DGSENT_LAST(R3)	
                         74 A3   D0  2255  7159 	MOVL	CDT$L_DGRCVD(R3),-
                       00F4 C3       2258  7160 		CDT$L_DGRCVD_LAST(R3)	
                         7C A3   D0  225B  7161 	MOVL	CDT$L_MSGSENT(R3),-
                       00F8 C3       225E  7162 		CDT$L_MSGSENT_LAST(R3)	
                       0080 C3   D0  2261  7163 	MOVL	CDT$L_MSGRCVD(R3),-
                       00FC C3       2265  7164 		CDT$L_MSGRCVD_LAST(R3)	
                                     2268  7165 
                            B7   11  2268  7166 	BRB	60$			; Get next CDT in this queue
                                     226A  7167 80$:
                       57   08   C0  226A  7168 	ADDL	#8,R7			; Point to next queue header addr
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 164
X-19                            -  SCS_UPDATE_REG_CTRS - Update regular  13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (36)

                            59   D7  226D  7169 	DECL	R9			; Decrement # of loop iterations
                            AD   12  226F  7170 	BNEQ	50$			; If not done, go process next queue
                          FF25   31  2271  7171 	BRW	10$			; Go process next PDT
                                     2274  7172 90$:
                                     2274  7173 ;
                                     2274  7174 ; Update counters for CDTs which are queued in other SCS queues
                                     2274  7175 ;
                                     2274  7176 ; ASSUME	SCS$GQ_REUSE_CDT+8   EQ	SCS$GQ_DISCONNECT
                                     2274  7177 ; ASSUME	SCS$GQ_DISCONNECT+8  EQ SCS$GQ_WORSE_PATH	
                                     2274  7178 
                       59   03   D0  2274  7179 	MOVL	#3,R9			; Get # of SCS queues 
              57   00000000'GF   7E  2277  7180 	MOVAQ	G^SCS$GQ_REUSE_CDT,R7	; Get first queue header addr
                       58   57   D0  227E  7181 100$:	MOVL	R7,R8			; Copy for reference
                       58   68   D0  2281  7182 110$:	MOVL	(R8),R8			; Get next CDT entry
                       57   58   D1  2284  7183 	CMPL	R8,R7			; End of this queue?
                            41   13  2287  7184 	BEQL	130$			; Yes
                  53   FF60 C8   DE  2289  7185 	MOVAL	-CDT$L_SHARE_FLINK(R8),R3 ; Point to the beginning of CDT
                                     228E  7186 
                       52   05   D0  228E  7187 	MOVL	#5,R2			; Get # of counters to update
                  55   00C4 C3   DE  2291  7188 	MOVAL	CDT$L_BYTES_XFER(R3),R5  ; Get addr. of first life-time counter
                  56   00D8 C3   DE  2296  7189 	MOVAL	CDT$L_BYTES_XFER_LAST(R3),R6  ; Get addr. of first last interval ctr
                       66   65   D0  229B  7190 120$:	MOVL	(R5),(R6)		; Update up to last interval counter
                       55   04   C0  229E  7191 	ADDL	#4,R5			; Point to next life-time counter
                       56   04   C0  22A1  7192 	ADDL	#4,R6			; Point to next last interval counter
                            52   D7  22A4  7193 	DECL	R2			; Decrement the # of counters
                            F3   12  22A6  7194 	BNEQ	120$			; If not done, update next counter
                                     22A8  7195 ;
                                     22A8  7196 ; now update remaining 5 counters -- these have to be done serially
                                     22A8  7197 ; since they are not sequentially located in $CDTDEF
                                     22A8  7198 ;
                       0094 C3   D0  22A8  7199 	MOVL	CDT$L_BYTMAPD(R3),-
                       00EC C3       22AC  7200 		CDT$L_BYTMAPD_LAST(R3)
                         70 A3   D0  22AF  7201 	MOVL	CDT$L_DGSENT(R3),-
                       00F0 C3       22B2  7202 		CDT$L_DGSENT_LAST(R3)	
                         74 A3   D0  22B5  7203 	MOVL	CDT$L_DGRCVD(R3),-
                       00F4 C3       22B8  7204 		CDT$L_DGRCVD_LAST(R3)	
                         7C A3   D0  22BB  7205 	MOVL	CDT$L_MSGSENT(R3),-
                       00F8 C3       22BE  7206 		CDT$L_MSGSENT_LAST(R3)	
                       0080 C3   D0  22C1  7207 	MOVL	CDT$L_MSGRCVD(R3),-
                       00FC C3       22C5  7208 		CDT$L_MSGRCVD_LAST(R3)	
                                     22C8  7209 
                            B7   11  22C8  7210 125$:	BRB	110$			; Get next CDT in this queue
                                     22CA  7211 130$:
                       57   08   C0  22CA  7212 	ADDL	#8,R7			; Point to next queue header addr
                            59   D7  22CD  7213 	DECL	R9			; Decrement # of loop iterations
                            AD   12  22CF  7214 	BNEQ	100$			; If not done, go process next queue
                                     22D1  7215 
                       03FC 8F   BA  22D1  7216 	POPR	#^M<R2,R3,R4,R5,R6,R7,R8,R9> ; Restore registers
                                 05  22D5  7217 	RSB				; return
                                     22D6  7218 	.disable lsb		
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 165
X-19                            -  SCS_CALC_BYTES_XFER - Calculate Bytes 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (37)

                                     22D6  7220 	.SBTTL	-		SCS_CALC_BYTES_XFER - Calculate Bytes Xfer counters
                                     22D6  7221 ;++
                                     22D6  7222 ; (TYC0016)
                                     22D6  7223 ; SCS_CALC_BYTES_XFER:
                                     22D6  7224 ;
                                     22D6  7225 ;	The "bytes transferred during last interval" counters are  
                                     22D6  7226 ;	calculated by subtracting the life-time counter values up to last
                                     22D6  7227 ;	load sharing interval from the current system life-time
                                     22D6  7228 ;	counters.  
                                     22D6  7229 ;
                                     22D6  7230 ;	(NOTE:  For now, the total bytes transferred port counters are treated
                                     22D6  7231 ;		as a longword.  If necessary, the quadword can be used in
                                     22D6  7232 ;		the future.) 
                                     22D6  7233 ;
                                     22D6  7234 ;	This routine also calculates effective bandwidth of each CI port.
                                     22D6  7235 ;
                                     22D6  7236 ; CALLING SEQUENCE:
                                     22D6  7237 ;
                                     22D6  7238 ;	Called from SCS_LOAD_SHARE_TIMER routine
                                     22D6  7239 ;
                                     22D6  7240 ; INPUT PARAMETERS:
                                     22D6  7241 ;
                                     22D6  7242 ;	NONE
                                     22D6  7243 ;
                                     22D6  7244 ; OUTPUT PARAMETERS:
                                     22D6  7245 ; 
                                     22D6  7246 ;	NONE
                                     22D6  7247 ;
                                     22D6  7248 ; COMPLETION CODES:
                                     22D6  7249 ;
                                     22D6  7250 ;	NONE
                                     22D6  7251 ;
                                     22D6  7252 ; SIDE EFFECTS:
                                     22D6  7253 ;
                                     22D6  7254 ;	All registers preserved
                                     22D6  7255 ;	Bytes Counters are updated in PDTs and CDTs.
                                     22D6  7256 ;--
                                     22D6  7257 	.enable lsb
                                     22D6  7258 SCS_CALC_BYTES_XFER:
                                     22D6  7259 
                       0398 8F   BB  22D6  7260 	PUSHR	#^M<R3,R4,R7,R8,R9>	; Save some registers
              54   00000000'GF   DE  22DA  7261 	MOVAL	G^SCS$GL_PDT,R4		; Get the PDT listhead
                       54   64   D0  22E1  7262 10$:	MOVL	(R4),R4			; Get the first/next listhead
                            03   12  22E4  7263 	BNEQ	20$			; Continue if there's more PDT
                          0049   31  22E6  7264 	BRW	90$			; No more, done
                            02   B1  22E9  7265 20$:	CMPW	#PDT$C_BALANCEVER,-	; Do we understand this PDT?
                       00F4 C4       22EB  7266 		PDT$W_SCSVERSION(R4)
                            F1   14  22EE  7267 	BGTR	10$			; Branch if we don't - take  no
                                     22F0  7268 					;  further action for this PDT
                                     22F0  7269 
                                     22F0  7270 ; for now don't distinguish XCD ports
                                     22F0  7271 ; 	MOVL	PDT$L_UCB0(R4),R7	; Get the UCB addr
                                     22F0  7272 ;	CMPL	#NDT$_CIXCD,-
                                     22F0  7273 ;		UCB$L_NDT(R7)		; Is this a CIXCD port?
                                     22F0  7274 ;	BEQL	40$			; Yes, don't update life-time counters
                                     22F0  7275 
                                     22F0  7276 ;
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 166
X-19                            -  SCS_CALC_BYTES_XFER - Calculate Bytes 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (37)

                                     22F0  7277 ; Calculate bytes xferred during current interval
                                     22F0  7278 ;
                       01A0 C4   C3  22F0  7279 	SUBL3	PDT$Q_BYTES_XFER_LAST(R4),-
                       016C C4       22F4  7280 		PDT$Q_BYTES_XFER(R4),-
                       01B0 C4       22F7  7281 		PDT$L_BYTES_XFER_INT(R4)
                                     22FA  7282 
                            14   B1  22FA  7283 	CMPW	#PDT$C_CI_CLASS,-	; Is this a CI port?
                       00FC C4       22FC  7284 		PDT$W_LOAD_CLASS(R4)	;
                            03   14  22FF  7285 	BGTR	40$			; Branch if not 
                                     2301  7286 
                          F6A8   30  2301  7287 	BSBW	CALC_EB			; Calculate effective bandwidth
                                     2304  7288 					; of this CI port
                                     2304  7289 40$:
                                     2304  7290 
                                     2304  7291 ;
                                     2304  7292 ; Now go through all 4 queues in PDT to update CDT counters
                                     2304  7293 ;
                                     2304  7294 ASSUME	PDT$Q_CONN_WAIT+8  EQ	PDT$Q_YELLOW
                                     2304  7295 ASSUME	PDT$Q_YELLOW+8	   EQ	PDT$Q_RED
                                     2304  7296 ASSUME  PDT$Q_RED+8	   EQ	PDT$Q_DISABLED
                                     2304  7297 
                       59   04   D0  2304  7298 	MOVL	#4,R9			; Get # of CDT queues in PDT
                  57   0108 C4   7E  2307  7299 	MOVAQ	PDT$Q_CONN_WAIT(R4),R7	; Get first queue header addr
                       58   57   D0  230C  7300 50$:	MOVL	R7,R8			; Copy for reference
                       58   68   D0  230F  7301 60$:	MOVL	(R8),R8			; Get next CDT entry
                       57   58   D1  2312  7302 	CMPL	R8,R7			; End of this queue?
                            11   13  2315  7303 	BEQL	80$			; Yes
                  53   FF60 C8   DE  2317  7304 	MOVAL	-CDT$L_SHARE_FLINK(R8),R3 ; Point to the beginning of CDT
                                     231C  7305 ;
                                     231C  7306 ; Calculate bytes xferred during current interval
                                     231C  7307 ;
                       00D8 C3   C3  231C  7308 	SUBL3   CDT$L_BYTES_XFER_LAST(R3),-
                       00C4 C3       2320  7309 		CDT$L_BYTES_XFER(R3),-
                       0150 C3       2323  7310 		CDT$L_BYTES_XFER_INT(R3)
                                     2326  7311 
                            E7   11  2326  7312 	BRB	60$			; Get next CDT in this queue
                                     2328  7313 80$:
                       57   08   C0  2328  7314 	ADDL	#8,R7			; Point to next queue header addr
                            59   D7  232B  7315 	DECL	R9			; Decrement # of loop iterations
                            DD   12  232D  7316 	BNEQ	50$			; If not done, go process next queue
                          FFAF   31  232F  7317 	BRW	10$			; Go process next PDT
                                     2332  7318 90$:
                                     2332  7319 ;
                                     2332  7320 ; Update counters for CDTs which are queued in other SCS queues
                                     2332  7321 ;
                                     2332  7322 ; ASSUME	SCS$GQ_REUSE_CDT+8   EQ	SCS$GQ_DISCONNECT
                                     2332  7323 ; ASSUME	SCS$GQ_DISCONNECT+8  EQ SCS$GQ_WORSE_PATH	
                                     2332  7324 
                       59   03   D0  2332  7325 	MOVL	#3,R9			; Get # of SCS queues 
              57   00000000'GF   7E  2335  7326 	MOVAQ	G^SCS$GQ_REUSE_CDT,R7	; Get first queue header addr
                       58   57   D0  233C  7327 100$:	MOVL	R7,R8			; Copy for reference
                       58   68   D0  233F  7328 110$:	MOVL	(R8),R8			; Get next CDT entry
                       57   58   D1  2342  7329 	CMPL	R8,R7			; End of this queue?
                            11   13  2345  7330 	BEQL	130$			; Yes
                  53   FF60 C8   DE  2347  7331 	MOVAL	-CDT$L_SHARE_FLINK(R8),R3 ; Point to the beginning of CDT
                                     234C  7332 ;
                                     234C  7333 ;  Calculate bytes xferred during current interval
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 167
X-19                            -  SCS_CALC_BYTES_XFER - Calculate Bytes 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (37)

                                     234C  7334 ;
                       00D8 C3   C3  234C  7335 	SUBL3   CDT$L_BYTES_XFER_LAST(R3),-
                       00C4 C3       2350  7336 		CDT$L_BYTES_XFER(R3),-
                       0150 C3       2353  7337 		CDT$L_BYTES_XFER_INT(R3)
                                     2356  7338 
                            E7   11  2356  7339 125$:	BRB	110$			; Get next CDT in this queue
                                     2358  7340 130$:
                       57   08   C0  2358  7341 	ADDL	#8,R7			; Point to next queue header addr
                            59   D7  235B  7342 	DECL	R9			; Decrement # of loop iterations
                            DD   12  235D  7343 	BNEQ	100$			; If not done, go process next queue
                                     235F  7344 
                       0398 8F   BA  235F  7345 	POPR	#^M<R3,R4,R7,R8,R9>	; Restore registers
                                 05  2363  7346 	RSB				; return
                                     2364  7347 	.disable lsb		
                                     2364  7348 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 168
X-19                            -  SCS_PROCESS_CDTS - Process CDTs in DI 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (38)

                                     2364  7350 	.SBTTL	-		SCS_PROCESS_CDTS - Process CDTs in DISCONNECT queue
                                     2364  7351 ;++
                                     2364  7352 ;
                                     2364  7353 ; SCS_PROCESS_CDTS:
                                     2364  7354 ;
                                     2364  7355 ;	This routine processes connections which are to be moved at
                                     2364  7356 ;	each load sharing interval.  It loops through the CDTs in
                                     2364  7357 ;	SCS$GQ_DISCONNECT queue and calls the SYSAP's MOVE_PATH routine
                                     2364  7358 ;	for each CDT.
                                     2364  7359 ;
                                     2364  7360 ; CALLING SEQUENCE:
                                     2364  7361 ;
                                     2364  7362 ;	Called from SCS_LOAD_SHARE_TIMER routine
                                     2364  7363 ;
                                     2364  7364 ; INPUT PARAMETERS:
                                     2364  7365 ;
                                     2364  7366 ;	SCS$GQ_DISCONNECT - a queue of CDT's whose connections are to be moved
                                     2364  7367 ;
                                     2364  7368 ; OUTPUT PARAMETERS:
                                     2364  7369 ; 
                                     2364  7370 ;	NONE
                                     2364  7371 ;
                                     2364  7372 ; COMPLETION CODES:
                                     2364  7373 ;
                                     2364  7374 ;	NONE
                                     2364  7375 ;
                                     2364  7376 ; SIDE EFFECTS:
                                     2364  7377 ;
                                     2364  7378 ;	All registers preserved
                                     2364  7379 ;	SYSAP's MOVE_PATH routine(s) is called.
                                     2364  7380 ;--
                                     2364  7381 	.enable lsb
                                     2364  7382 SCS_PROCESS_CDTS:
                            1F   BB  2364  7383 	PUSHR	#^M<R0,R1,R2,R3,R4>	; Save some registers
              51   00000000'GF   9E  2366  7384 10$:	MOVAB	G^SCS$GQ_DISCONNECT,R1	; Get pointer to queue head
                    53   00 B1   0F  236D  7385 	REMQUE	@(R1),R3		; Get the first/next entry
                            39   1D  2371  7386 	BVS	DONE			; Empty queue, we're done processing
                                     2373  7387 					; Not empty, process this CDT
                            63   D4  2373  7388 	CLRL	(R3)			; clear forward link since it's not queued
                  53   FF60 C3   DE  2375  7389 	MOVAL	-CDT$L_SHARE_FLINK(R3),R3 ; Point to the beginning of CDT
                   00000000'GF   D0  237A  7390 	MOVL    G^EXE$GL_ABSTIM,-       ; Timestamp the queue move
                       00B8 C3       2380  7391                 CDT$L_QUEUE_TIME_STAMP(R3)
                  50   204C 8F   3C  2383  7392 	MOVZWL	#SS$_DISCONNECT,R0	; (TYC 22-Mar-89) Disconnect status
                            2A   3C  2388  7393 	MOVZWL	#SCS$C_USE_ALTERNATE_PORT,-
                            51       238A  7394 		R1			; (TYC 22-Mar-89) Move path status
                       009C C3   D0  238B  7395 	MOVL	CDT$L_MOVE_PATH_ADDR(R3),-; Get the move path routine address
                            52       238F  7396 		R2
                    54   10 A3   D0  2390  7397 	MOVL	CDT$L_PDT(R3),R4	; Get the PDT
                   00000029'EF   D6  2394  7398 	INCL	EQUAL_PATH_CALL_COUNT	; Count the equal path move
                       01B4 C4   D6  239A  7399 	INCL	PDT$L_EQUAL_PATH_CALL_COUNT(R4)
                   00000031'EF   D6  239E  7400 	INCL	CONNECTION_MOVE_COUNT	; Increment move counter
                       01BC C4   D6  23A4  7401 	INCL	PDT$L_CONNECTION_MOVE_COUNT(R4)
                            62   16  23A8  7402 	JSB	(R2)			; Call the routine
                            BA   11  23AA  7403 	BRB	10$			; Go get next CDT in queue
                                     23AC  7404 DONE:
                            1F   BA  23AC  7405 	POPR	#^M<R0,R1,R2,R3,R4>	; Restore registers
                                 05  23AE  7406 	RSB				; return
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 169
X-19                            -  SCS_PROCESS_CDTS - Process CDTs in DI 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (38)

                                     23AF  7407 	.disable lsb		
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 170
X-19                            -  SCS_CHK_CDT_REUSE_QUEUE - check REUSE 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (39)

                                     23AF  7409 	.SBTTL  -		SCS_CHK_CDT_REUSE_QUEUE - check REUSE queue for matching CDT
                                     23AF  7410 ;+
                                     23AF  7411 ;  SCS_CHK_CDT_REUSE_QUEUE
                                     23AF  7412 ;
                                     23AF  7413 ; FUNCTIONAL DESCRIPTION:
                                     23AF  7414 ;
                                     23AF  7415 ;	This routine is called by SCS$CONNECT to see if a CDT in the
                                     23AF  7416 ;	SCS$GQ_REUSE_CDT queue can be used for the connection.
                                     23AF  7417 ;	The remote station address or the system ID and the local
                                     23AF  7418 ;	process name passed in the stack are compared with those in
                                     23AF  7419 ;	the CDTs to find a match.  If a match is found, the CDT is
                                     23AF  7420 ;	dequeued from the REUSE queue, initialized, and returned to 
                                     23AF  7421 ;	the caller with the optimal PB address.  Note that the load
                                     23AF  7422 ;	sharing counters are kept.
                                     23AF  7423 ;  
                                     23AF  7424 ; CALLING SEQUENCE:
                                     23AF  7425 ;
                                     23AF  7426 ;	BSBW	SCS_CHK_CDT_REUSE_QUEUE
                                     23AF  7427 ;
                                     23AF  7428 ; INPUT PARAMETERS:
                                     23AF  7429 ;	R2 = 0
                                     23AF  7430 ;	R7 = Address of RSYSID
                                     23AF  7431 ;	R8 = Address of RSTADR
                                     23AF  7432 ;	R9 = Address of LPRNAM
                                     23AF  7433 ;
                                     23AF  7434 ; OUTPUT PARAMETERS:
                                     23AF  7435 ;
                                     23AF  7436 ;	R2 = 1 if CDT is being reused 
                                     23AF  7437 ;	R3 = Pointer to CDT if a match is found
                                     23AF  7438 ;	   = 0 otherwise
                                     23AF  7439 ;	R4 = PB address if a match is found
                                     23AF  7440 ;
                                     23AF  7441 ; SIDE EFFECTS:
                                     23AF  7442 ;	R0, R1, R4 used for comparison
                                     23AF  7443 ;-
                                     23AF  7444 	.enable	lsb
                                     23AF  7445 SCS_CHK_CDT_REUSE_QUEUE:
                       0060 8F   BB  23AF  7446 	PUSHR	#^M<R5,R6>		; Save reg.
              50   00000000'GF   7E  23B3  7447 	MOVAQ	G^SCS$GQ_REUSE_CDT,R0	; Get first queue header addr
                       51   50   D0  23BA  7448 	MOVL	R0,R1			; Copy for reference
                       51   61   D0  23BD  7449 10$:  	MOVL	(R1),R1			; Get first/next CDT entry
                       50   51   D1  23C0  7450 	CMPL	R1,R0			; End of the queue?
                            03   12  23C3  7451 	BNEQ	20$			; No, continue
                          00C7   31  23C5  7452 	BRW	100$			; Yes, exit the routine
                  53   FF60 C1   DE  23C8  7453 20$:	MOVAL   -CDT$L_SHARE_FLINK(R1),R3 ; Point to the beg. of CDT
                                     23CD  7454 ;
                                     23CD  7455 ; Validate the optimal path saved in CDT 
                                     23CD  7456 ;
                  56   00A8 C3   D0  23CD  7457 	MOVL	CDT$L_SB(R3),R6		; Get optimal path's system block
                    54   0C A6   DE  23D2  7458 	MOVAL	SB$L_PBFL(R6),R4	; Get 1st path block
                       55   54   D0  23D6  7459 	MOVL	R4,R5			; Copy starting point
                       54   64   D0  23D9  7460 30$:	MOVL	(R4),R4			; Get next block in list
                  00C0 C3   54   D1  23DC  7461 	CMPL	R4,CDT$L_OPTIMAL_PATH(R3) ; Is this optimal path?
                            07   13  23E1  7462 	BEQL	40$			; Yes, it's still valid PB
                       55   54   D1  23E3  7463 	CMPL	R4,R5			; Else end of PB list?
                            D5   13  23E6  7464 	BEQL	10$			; Yes, go check next CDT			
                            EF   11  23E8  7465 	BRB	30$			; No, check next PB
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 171
X-19                            -  SCS_CHK_CDT_REUSE_QUEUE - check REUSE 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (39)

                    03   12 A4   B1  23EA  7466 40$:	CMPW	PB$W_STATE(R4),#PB$C_OPEN ; Is this path good?
                            CD   12  23EE  7467 	BNEQ	10$			; No, go check next CDT	
                                     23F0  7468 
                            58   D5  23F0  7469 	TSTL	R8			; RSTADR specified?
                            0F   12  23F2  7470 	BNEQ	50$			; Branch if so
                                     23F4  7471 
                                     23F4  7472 					; Else get addr of remote sys ID 
                    18 A6   67   D1  23F4  7473 	CMPL	(R7),SB$B_SYSTEMID(R6)	; Compare with one in system block
                            C3   12  23F8  7474 	BNEQ	10$			; No match, check next CDT
                 1C A6   04 A7   B1  23FA  7475 	CMPW	4(R7),SB$B_SYSTEMID+4(R6) ; Compare high 16 bits
                            BC   12  23FF  7476 	BNEQ	10$			; No match, check next CDT
                            14   11  2401  7477 	BRB	70$			; Found a matching system block
                                     2403  7478 50$:					; 
                                     2403  7479 					; Get RSTADR parameter
                    0C A4   68   D1  2403  7480 	CMPL	(R8),PB$B_RSTATION(R4)	; Check for rem station ID match
                            B4   12  2407  7481 	BNEQ	10$			; No match, check next CDT
                 10 A4   04 A8   B1  2409  7482 	CMPW	4(R8),PB$B_RSTATION+4(R4) ; Check high order 16 bits
                            AD   12  240E  7483 	BNEQ	10$			; No match, check next CDT
                 24 A4   08 A8   D1  2410  7484 	CMPL	8(R8),PB$T_LPORT_NAME(R4) ; Check local port name
                            A6   12  2415  7485 	BNEQ	10$			; Branch if no match
                                     2417  7486 ;
                                     2417  7487 ; Compare local process names now
                                     2417  7488 ;
                                     2417  7489 70$:
              55   00000000'GF   7E  2417  7490 	MOVAQ	G^SCS$GQ_LOCAL_NAMES,R5	; Get the local name listhead
                       56   55   D0  241E  7491 	MOVL	R5,R6			; Copy for reference
                       56   66   D0  2421  7492 80$:	MOVL	(R6),R6			; Get first/next entry		
                       55   56   D1  2424  7493 	CMPL	R6,R5			; End of list?
                            94   13  2427  7494 	BEQL	10$			; Yes, check next CDT
                         1C A6   B1  2429  7495 	CMPW	SBNB$W_LOCAL_INDEX(R6),-
                       0154 C3       242C  7496 		CDT$W_LOCAL_INDEX(R3)	; Same name index?
                            F0   12  242F  7497 	BNEQ	80$			; No, check next name block
                            0F   BB  2431  7498 	PUSHR	#^M<R0,R1,R2,R3>	; Save reg. for CMPC instr.
                       69   10   29  2433  7499 	CMPC3	#SBNB$S_PROCNAM,(R9),-
                         0C A6       2436  7500 		SBNB$B_PROCNAM(R6)	; Same local process name?		
                            0F   BA  2438  7501 	POPR	#^M<R0,R1,R2,R3>	; 
                            03   13  243A  7502 	BEQL	85$			; Yes, we can use this CDT
                          FF7E   31  243C  7503 	BRW	10$			; No, check next CDT
                                     243F  7504 ;
                                     243F  7505 ; A matching reusable CDT is found.  Initialize this CDT
                                     243F  7506 ; and set up return paramters.  R4 at this point already has
                                     243F  7507 ; the PB address.
                                     243F  7508 ;  	
                  50   00A0 C3   0F  243F  7509 85$:	REMQUE	CDT$L_SHARE_FLINK(R3),R0 ; Remove it from REUSE queue
                            60   D4  2444  7510 	CLRL	(R0)			; Clear forward link since not queued
                   00000000'GF   D0  2446  7511 	MOVL    G^EXE$GL_ABSTIM,-       ; Timestamp the queue move
                       00B8 C3       244C  7512                 CDT$L_QUEUE_TIME_STAMP(R3)
                                     244F  7513 
                         14 A3   D4  244F  7514 	CLRL	CDT$L_RCONID(R3)	; Zero remote CONID
                         1A A3   B6  2452  7515 90$:	INCW	CDT$L_LCONID+2(R3)	; Bump sequence number
                            FB   13  2455  7516 	BEQL	90$			; Zero not allowed
                                     2457  7517 
                            18   BB  2457  7518 	PUSHR	#^M<R3,R4>		; Save registers for MOVC
                                     2459  7519 ASSUME	CDT$L_LCONID+4	EQ	CDT$L_PB
                                     2459  7520 ASSUME  CDT$L_CDTLST+4	EQ	CDT$L_DGSENT
               00   00 8F   00   2C  2459  7521 	MOVC5	#0,#0,#0,-		; Zero CDT from longwd after
                       0054 8F       245E  7522 		#<CDT$L_DGSENT-CDT$L_PB>,-
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 172
X-19                            -  SCS_CHK_CDT_REUSE_QUEUE - check REUSE 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (39)

                         1C A3       2461  7523 		CDT$L_PB(R3)		;  local CONID to CDTLST
                                     2463  7524 
                            18   BA  2463  7525 	POPR	#^M<R3,R4>		; Restore destroyed registers
                                     2465  7526 
                       0156 C3   94  2465  7527 	CLRB	CDT$B_LS_FLAG(R3)	; Clear load sharing flag
                       00AC C3   D4  2469  7528 	CLRL	CDT$L_CON_REQ_CTR(R3)	; Clear # of times CON REQ msg sent
                                     246D  7529 
                 30 A3   30 A3   9E  246D  7530 	MOVAB	CDT$L_WAITQFL(R3), -
                                     2472  7531 		CDT$L_WAITQFL(R3)	; Set up initial cond
                 34 A3   30 A3   9E  2472  7532 	MOVAB	CDT$L_WAITQFL(R3), -
                                     2477  7533 		CDT$L_WAITQBL(R3)	; Set up initial cond
                 38 A3   38 A3   9E  2477  7534 	MOVAB	CDT$L_CRWAITQFL(R3), -
                                     247C  7535 		CDT$L_CRWAITQFL(R3)	; Set up initial cond
                 3C A3   38 A3   9E  247C  7536 	MOVAB	CDT$L_CRWAITQFL(R3), -
                                     2481  7537 		CDT$L_CRWAITQBL(R3)	; Set up initial cond
                   00000000'GF   D0  2481  7538 	MOVL	G^EXE$GL_ABSTIM,-	; Give this connection a time stamp
                       00B4 C3       2487  7539 		CDT$L_TIME_STAMP(R3)
                                     248A  7540 
                       52   01   D0  248A  7541 	MOVL	#1,R2			; Set success
                            02   11  248D  7542 	BRB	110$			; Return CDT
                                     248F  7543 
                            53   D4  248F  7544 100$:	CLRL	R3			; No reusable CDT found
                                     2491  7545 110$:
                       0060 8F   BA  2491  7546 	POPR	#^M<R5,R6>		; Restore reg.
                                 05  2495  7547 	RSB				; return
                                     2496  7548         .disable lsb
                                     2496  7549 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 173
X-19                            -  LOAD_SHARE_BUGCHECK - note bad load r 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (40)

                                     2496  7551 	.SBTTL	-		LOAD_SHARE_BUGCHECK - note bad load rating
                                     2496  7552 ;+
                                     2496  7553 ;  LOAD_SHARE_BUGCHECK
                                     2496  7554 ; 
                                     2496  7555 ; FUNCTIONAL DESCRIPTION:
                                     2496  7556 ;
                                     2496  7557 ;	This routine performs a nonfatal bugcheck when an unexpected connection
                                     2496  7558 ;	load rating is passed from SYSAP.  The high bit in the load rating field is set to
                                     2496  7559 ;	prevent bugcheck looping.
                                     2496  7560 ;
                                     2496  7561 ; CALLING SEQUENCE:
                                     2496  7562 ;
                                     2496  7563 ;	BSBW	LOAD_SHARE_BUGCHECK
                                     2496  7564 ;
                                     2496  7565 ; INPUT PARAMETERS:
                                     2496  7566 ;
                                     2496  7567 ;	R3	- address of the CDT
                                     2496  7568 ;
                                     2496  7569 ; OUTPUT PARAMETERS:
                                     2496  7570 ;
                                     2496  7571 ;	NONE
                                     2496  7572 ;
                                     2496  7573 ; COMPLETION CODES:
                                     2496  7574 ;
                                     2496  7575 ;	NONE
                                     2496  7576 ;
                                     2496  7577 ; SIDE EFFECTS:
                                     2496  7578 ;
                                     2496  7579 ;	All registers are preserved.  The high bit is set in the
                                     2496  7580 ;	CDT$L_LOAD_RATING field
                                     2496  7581 ;
                                     2496  7582 ;--
                                     2496  7583 	.enable	LSB
                                     2496  7584 LOAD_SHARE_BUGCHECK:			;(TYC 4-JAN-89)
                       00B0 C3   D5  2496  7585 	TSTL	CDT$L_LOAD_RATING(R3)	; Already bugchecked?
                            13   19  249A  7586 	BLSS	10$			; Branch if so
                   00000035'EF   D6  249C  7587 	INCL	LOAD_SHARE_BUGCHECK_COUNT	; Count these
                                     24A2  7588 	BUG_CHECK  VAXPORT,NONFATAL
                   80000000 8F   C8  24A6  7589 	BISL	#CDT$C_BAD_RATING,-	; Note a bad load rating
                       00B0 C3       24AC  7590 		CDT$L_LOAD_RATING(R3)
                                 05  24AF  7591 10$:	RSB
                                     24B0  7592 	.disable lsb
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 174
X-19                            -  LOAD_SHARE_BUGCHECK - note bad load r 13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (41)

                                     24B0  7594 SCS_END:
                                     24B0  7595 	.END
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 175
Symbol table                                                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (41)

$$$ADR                         = 000000E0                 CALCAVG4                         00001F3A R     03        
$$$CURSIZ                      = 000004A8                 CALCAVG5                         00001F6A R     03        
$$$NEWSIZ                      = 000004B0                 CALCULATE_LOAD                   00001877 R     03        
$$BASE                         = 00000000                 CALC_AVAIL                       00001966 R     03        
$$CHK                          = 00000000                 CALC_EB                          000019AC R     03        
$$DISPL                        = 00000009                 CALC_MAX_MIN                     00001B44 R     03        
$$GENSW                        = 00000001                 CALC_PORT_LOAD                   000018E0 R     03        
$$HIGH                         = 00000008                 CAL_DOMAIN                       00001572 R     03        
$$LEN                          = 00000000                 CCB$L_UCB                      = 00000000                 
$$LIMIT                        = 00000008                 CCI_CNF                          00000000                 
$$LOW                          = 00000000                 CCI_MADR                         00000014                 
$$MNSW                         = 00000001                 CCI_MDATR                        00000018                 
$$MXSW                         = 00000001                 CCI_PMC                          00000004                 
$$TMP                          = 00000000                 CDL$C_LENGTH                   = 00000010                 
....DEF                        = 00000001                 CDL$L_FREECDT                  = FFFFFFF4                 
..SMP_FLAG..                   = 00000100                 CDL$L_NOCDT_CNT                = FFFFFFFC                 
AVAILABLE_THRUPUT_PORTS          00000014 R     02        CDL$W_MAXCONIDX                = FFFFFFF0                 
BCA_CQ0                          00001010                 CDRP$B_CD_TYPE                 = 0000000A                 
BCA_CQ1                          00001014                 CDRP$C_LENGTH                  = 0000002C                 
BCA_CQ2                          00001018                 CDRP$L_CDT                     = 00000024                 
BCA_CQ3                          0000101C                 CDRP$L_FPC                     = 0000000C                 
BCA_DFQ                          00001030                 CDRP$L_FQBL                    = 00000004                 
BCA_DT_V_UCODE                 = 00000017                 CDRP$L_FQFL                    = 00000000                 
BCA_MADR                         00001008                 CDRP$L_FR3                     = 00000010                 
BCA_MDATR                        0000100C                 CDRP$L_MSG_BUF                 = 0000001C                 
BCA_MFQ                          00001034                 CDRP$L_RSPID                   = 00000020                 
BCA_MTC                          00001038                 CDRP$L_RWCPTR                  = 00000028                 
BCA_MTEC                         0000103C                 CDRP$L_SAVD_RTN                = 00000018                 
BCA_PDC                          00001028                 CDRP$L_UCB                     = FFFFFFBC                 
BCA_PEC                          00001024                 CDRP$W_CDRPSIZE                = 00000008                 
BCA_PESR                         000000FC                 CDT$B_LS_FLAG                  = 00000156                 
BCA_PFAR                         000000F4                 CDT$B_PRIORITY                 = 0000004E                 
BCA_PIC                          0000102C                 CDT$B_RSTATION                 = 00000020                 
BCA_PMC                          00001004                 CDT$B_SYSAP_VERSION            = 00000157                 
BCA_PPR                          000000F8                 CDT$B_TYPE                     = 0000000A                 
BCA_PQBBR                        000000F0                 CDT$C_BAD_RATING               = 80000000                 
BCA_PS                           00001000                 CDT$C_CLOSED                   = 00000000                 
BCA_PSR                          00001020                 CDT$C_LENGTH                   = 0000015B                 
BICA_CNF                         00000100                 CDT$C_LISTEN                   = 00000001                 
BICA_MADR                        00000114                 CDT$C_LOAD_SHARE_DISABLE       = 00000008                 
BICA_MDATR                       00000118                 CDT$C_OPEN                     = 00000002                 
BICA_PMC                         00000110                 CDT$C_PRE_LOADSHARE            = 00000001                 
BIIC$L_DTREG                   = 00000000                 CDT$C_RATING0                  = 00000000                 
BLANK                            000005ED R     03        CDT$C_RATING1                  = 00000001                 
BOO$GL_UCODE                     ********   X   03        CDT$C_RATING2                  = 00000002                 
BUG$_INCONSTATE                  ********   X   03        CDT$C_RATING3                  = 00000003                 
BUG$_INVRSPID                    ********   X   03        CDT$C_RATING5                  = 00000005                 
BUG$_RESEXH                      ********   X   03        CDT$C_RED                      = 00000006                 
BUG$_VAXPORT                     ********   X   03        CDT$C_UNEQUAL_PATH             = 00000007                 
CALCAVG1                         00001EAC R     03        CDT$C_YELLOW                   = 00000004                 
CALCAVG11                        00002099 R     03        CDT$L_AUXSTRUC                 = 0000005C                 
CALCAVG12                        000020C9 R     03        CDT$L_BADRSP                   = 00000060                 
CALCAVG13                        000020F8 R     03        CDT$L_BYTES_DG_RCV             = 000000CC                 
CALCAVG14                        00002127 R     03        CDT$L_BYTES_DG_RCV_AVG         = 00000130                 
CALCAVG15                        00002157 R     03        CDT$L_BYTES_DG_RCV_LAST        = 000000E0                 
CALCAVG2                         00001EDC R     03        CDT$L_BYTES_DG_RCV_PEAK        = 00000108                 
CALCAVG3                         00001F0B R     03        CDT$L_BYTES_DG_XMT             = 000000C8                 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 176
Symbol table                                                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (41)

CDT$L_BYTES_DG_XMT_AVG         = 0000012C                 CDT$L_SHARE_FLINK              = 000000A0                 
CDT$L_BYTES_DG_XMT_LAST        = 000000DC                 CDT$L_TIME_STAMP               = 000000B4                 
CDT$L_BYTES_DG_XMT_PEAK        = 00000104                 CDT$L_WAITQBL                  = 00000034                 
CDT$L_BYTES_MSG_RCV            = 000000D4                 CDT$L_WAITQFL                  = 00000030                 
CDT$L_BYTES_MSG_RCV_AVG        = 00000138                 CDT$W_BLKSTATE                 = 0000002A                 
CDT$L_BYTES_MSG_RCV_LAST       = 000000E8                 CDT$W_DGREC                    = 0000004C                 
CDT$L_BYTES_MSG_RCV_PEAK       = 00000110                 CDT$W_INITLREC                 = 00000048                 
CDT$L_BYTES_MSG_XMT            = 000000D0                 CDT$W_LOCAL_INDEX              = 00000154                 
CDT$L_BYTES_MSG_XMT_AVG        = 00000134                 CDT$W_MINSEND                  = 0000004A                 
CDT$L_BYTES_MSG_XMT_LAST       = 000000E4                 CDT$W_SIZE                     = 00000008                 
CDT$L_BYTES_MSG_XMT_PEAK       = 0000010C                 CDT$W_STATE                    = 00000028                 
CDT$L_BYTES_XFER               = 000000C4                 CDTFOUND                         00001777 R     03        
CDT$L_BYTES_XFER_AVG           = 00000128                 CHECK_MIN_PORT_WAIT              00001829 R     03        
CDT$L_BYTES_XFER_INT           = 00000150                 CHKRED                           000016D3 R     03        
CDT$L_BYTES_XFER_LAST          = 000000D8                 CI780                            00001A9D R     03        
CDT$L_BYTES_XFER_PEAK          = 00000100                 CI780_EB                         0000005D R     02        
CDT$L_BYTMAPD                  = 00000094                 CIBCA                            00001AAF R     03        
CDT$L_BYTMAPD_AVG              = 0000013C                 CIBCAA                           00001ABB R     03        
CDT$L_BYTMAPD_LAST             = 000000EC                 CIBCAA_EB                        00000095 R     02        
CDT$L_BYTMAPD_PEAK             = 00000114                 CIBCAB                           00001AC4 R     03        
CDT$L_CDTLST                   = 0000006C                 CIBCAB_EB                        000000B1 R     02        
CDT$L_CONDAT                   = 00000058                 CIBCI                            00001AA6 R     03        
CDT$L_CON_REQ_CTR              = 000000AC                 CIBCI_EB                         00000079 R     02        
CDT$L_CRWAITQBL                = 0000003C                 CIPA_CQ0                         00000908                 
CDT$L_CRWAITQFL                = 00000038                 CIPA_CQ1                         0000090C                 
CDT$L_DGINPUT                  = 00000004                 CIPA_CQ2                         00000910                 
CDT$L_DGRCVD                   = 00000074                 CIPA_CQ3                         00000914                 
CDT$L_DGRCVD_AVG               = 00000144                 CIPA_DFQ                         00000928                 
CDT$L_DGRCVD_LAST              = 000000F4                 CIPA_MFQ                         0000092C                 
CDT$L_DGRCVD_PEAK              = 0000011C                 CIPA_MTC                         00000930                 
CDT$L_DGSENT                   = 00000070                 CIPA_MTEC                        00000934                 
CDT$L_DGSENT_AVG               = 00000140                 CIPA_PDC                         00000920                 
CDT$L_DGSENT_LAST              = 000000F0                 CIPA_PEC                         0000091C                 
CDT$L_DGSENT_PEAK              = 00000118                 CIPA_PESR                        0000093C                 
CDT$L_DISCON_COUNTER           = 000000BC                 CIPA_PFAR                        00000938                 
CDT$L_ERRADDR                  = 0000000C                 CIPA_PIC                         00000924                 
CDT$L_LCONID                   = 00000018                 CIPA_PPR                         00000940                 
CDT$L_LINK                     = 00000000                 CIPA_PQBBR                       00000904                 
CDT$L_LOAD_RATING              = 000000B0                 CIPA_PS                          00000900                 
CDT$L_LPROCNAM                 = 00000054                 CIPA_PSR                         00000918                 
CDT$L_MOVE_PATH_ADDR           = 0000009C                 CIXCD                            00001ACD R     03        
CDT$L_MSGINPUT                 = 00000000                 CIXCD_CQ0                        00001028                 
CDT$L_MSGRCVD                  = 00000080                 CIXCD_CQ1                        0000102C                 
CDT$L_MSGRCVD_AVG              = 0000014C                 CIXCD_CQ2                        00001030                 
CDT$L_MSGRCVD_LAST             = 000000FC                 CIXCD_CQ3                        00001034                 
CDT$L_MSGRCVD_PEAK             = 00000124                 CIXCD_DFQ                        00001048                 
CDT$L_MSGSENT                  = 0000007C                 CIXCD_EB                         000000CD R     02        
CDT$L_MSGSENT_AVG              = 00000148                 CIXCD_FADRH                      0000002C                 
CDT$L_MSGSENT_LAST             = 000000F8                 CIXCD_FADRL                      00000008                 
CDT$L_MSGSENT_PEAK             = 00000120                 CIXCD_MFQ                        0000104C                 
CDT$L_OPTIMAL_PATH             = 000000C0                 CIXCD_MTC                        00001050                 
CDT$L_PB                       = 0000001C                 CIXCD_MTEC                       00001054                 
CDT$L_PDT                      = 00000010                 CIXCD_PCCR                       00001004                 
CDT$L_QUEUE_TIME_STAMP         = 000000B8                 CIXCD_PDC                        00001040                 
CDT$L_RCONID                   = 00000014                 CIXCD_PDCSR                      00000020                 
CDT$L_RPROCNAM                 = 00000050                 CIXCD_PEC                        0000103C                 
CDT$L_SB                       = 000000A8                 CIXCD_PESR                       00001008                 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 177
Symbol table                                                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (41)

CIXCD_PFAR                       0000100C                 EXE$GQ_SYSTIME                   ********   X   03        
CIXCD_PIC                        00001044                 EXE$GQ_TODCBASE                  ********   X   03        
CIXCD_PIDR                       00001018                 EXE$INSTIMQ                      ********   X   03        
CIXCD_PIVR                       00001020                 EXE$WRTMAILBOX                   ********   X   03        
CIXCD_PMC                        0000001C                 EXIT                             00001585 R     03        
CIXCD_PPER                       00001058                 EXITAVG1                         00001ECB R     03        
CIXCD_PPR                        00001010                 EXITAVG11                        000020B8 R     03        
CIXCD_PQBBR                      00001000                 EXITAVG12                        000020E7 R     03        
CIXCD_PS                         00000024                 EXITAVG13                        00002116 R     03        
CIXCD_PSCR                       00000014                 EXITAVG14                        00002145 R     03        
CIXCD_PSDR                       00000018                 EXITAVG15                        00002176 R     03        
CIXCD_PSNR                       00001014                 EXITAVG2                         00001EFA R     03        
CIXCD_PSR                        00001038                 EXITAVG3                         00001F29 R     03        
CIXCD_XCOMM                      00000010                 EXITAVG4                         00001F58 R     03        
CLEANUP_RTN                      00000DF7 R     03        EXITAVG5                         00001F89 R     03        
CLU$GL_MSCP_LOAD                 ********   X   03        FIND_BEST_MATCH                  00001635 R     03        
CLU$GL_TMSCP_LOAD                ********   X   03        INI$BRK                          ********   X   03        
COM$DRVDEALMEM                   ********   X   03        INIT_CDL                         00000148 R     03        
COMMON_CALC                      00001AE6 R     03        INIT_LOAD_SHARE                  00001228 R     03        
CONNECTION_MOVE_COUNT            00000031 R     02        INIT_RDT                         000001EF R     03        
DDT$L_START                    = 00000000                 IOC$VERIFYCHAN                   ********   X   03        
DEFAULT                          00001ADF R     03        IPL$_HWCLK                     = 00000018                 
DEFAULT_EB                       00000105 R     02        IPL$_SCS                       = 00000008                 
DIRERR                           0000079F R     03        IPL$_SYNCH                     = 00000008                 
DIRINFO                          000000E6 R     03        IPL$_TIMER                     = 00000008                 
DIRNAME                          000000D6 R     03        KFMSA                            00001AD6 R     03        
DIR_CLEANUP                      000007B3 R     03        KFMSA_CQ0                        00004080                 
DIR_MOVE                         00000E24 R     03        KFMSA_CQ0_2                      00004280                 
DISK_SERV_NAME                   00000106 R     03        KFMSA_CQ1                        00004084                 
DONE                             000023AC R     03        KFMSA_CQ1_2                      00004284                 
DONE1                            00001BF4 R     03        KFMSA_CQ2                        00004088                 
DONE2                            00001C8A R     03        KFMSA_CQ2_2                      00004288                 
DONE3                            00001CD2 R     03        KFMSA_CQ3                        0000408C                 
DONE_PDT                         00001F99 R     03        KFMSA_CQ3_2                      0000428C                 
DO_RSB                           00000000 R     03        KFMSA_DFQ                        00004090                 
DPT$M_SMPMOD                   = 00000100                 KFMSA_DFQ2                       00004290                 
DYN$C_CDRP                     = 00000039                 KFMSA_EB                         000000E9 R     02        
DYN$C_SCS                      = 00000060                 KFMSA_FADRH                      0000002C                 
DYN$C_SCS_CDL                  = 00000001                 KFMSA_FADRL                      00000008                 
DYN$C_SCS_CDT                  = 00000002                 KFMSA_MFQ                        00004094                 
DYN$C_SCS_DIR                  = 00000003                 KFMSA_MFQ2                       00004294                 
DYN$C_SCS_PDTLIST              = 0000000C                 KFMSA_MTC                        000040A8                 
DYN$C_SCS_PLVEC                = 0000000B                 KFMSA_MTC2                       000042A8                 
DYN$C_SCS_RDT                  = 00000006                 KFMSA_MTEC                       000040AC                 
DYN$C_SCS_SBNB                 = 0000000A                 KFMSA_MTEC2                      000042AC                 
DYN$C_SCS_SPNB                 = 00000009                 KFMSA_PDC                        000040A0                 
DYN$C_SCS_SPPB                 = 00000008                 KFMSA_PDC2                       000042A0                 
DYN$C_TQE                      = 0000000F                 KFMSA_PEC                        0000409C                 
EMB_BUFFER                       00000021 R     02        KFMSA_PEC2                       0000429C                 
EMB_CURRENT                      00000025 R     02        KFMSA_PESR                       00004050                 
ENDDEALL                         00000696 R     03        KFMSA_PESR2                      00004250                 
ENDRED                           0000176A R     03        KFMSA_PFAR                       00004054                 
ENDYELLOW                        000016C6 R     03        KFMSA_PFAR2                      00004254                 
EQUAL_PATH_CALL_COUNT            00000029 R     02        KFMSA_PIC                        000040A4                 
ERR_ROUTINE                      00000DD4 R     03        KFMSA_PIC2                       000042A4                 
EXE$ALONONPAGED                  ********   X   03        KFMSA_PIDR                       0000003C                 
EXE$GL_ABSTIM                    ********   X   03        KFMSA_PIDR2                      00000040                 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 178
Symbol table                                                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (41)

KFMSA_PIDR3                      00000044                 PB$C_OPEN                      = 00000003                 
KFMSA_PIPL                       00000030                 PB$L_CDTLST                    = 00000034                 
KFMSA_PIPL2                      00000034                 PB$L_PDT                       = 0000002C                 
KFMSA_PIPL3                      00000038                 PB$L_RPORT_FCN                 = 0000001C                 
KFMSA_PMC                        0000405C                 PB$L_RPORT_REV                 = 00000018                 
KFMSA_PMC2                       0000425C                 PB$L_RPORT_TYP                 = 00000014                 
KFMSA_PPR                        00004058                 PB$L_SBLINK                    = 00000030                 
KFMSA_PPR2                       00004258                 PB$L_SHARE_FLINK               = 00000054                 
KFMSA_PQBBR                      00004048                 PB$T_LPORT_NAME                = 00000024                 
KFMSA_PQBBR2                     00004248                 PB$V_LOCAL                     = 00000004                 
KFMSA_PS                         0000404C                 PB$W_RETRY                     = 00000022                 
KFMSA_PS2                        0000424C                 PB$W_STATE                     = 00000012                 
KFMSA_PSER                       00000020                 PB$W_STS                       = 00000044                 
KFMSA_PSER2                      00000024                 PBO$B_CBL_STS                  = 0000001C                 
KFMSA_PSR                        00004098                 PBO$B_NXT_RSTAT                = 00000020                 
KFMSA_PSR2                       00004298                 PBO$B_P0_STS                   = 0000001D                 
KFMSA_PVR                        00000048                 PBO$B_P1_STS                   = 0000001E                 
KFMSA_PVR2                       0000004C                 PBO$B_RSTATE                   = 00000015                 
KFMSA_PVR3                       00000050                 PBO$B_RSTATION                 = 00000000                 
KFMSA_XPCCSR                     00000028                 PBO$B_RST_PORT                 = 00000014                 
KFMSA_XPCCTRL                    00000018                 PBO$B_SYSTEMID                 = 0000002C                 
L0                               00001DB6 R     03        PBO$L_RPORT_FCN                = 00000010                 
L01                              00001DC4 R     03        PBO$L_RPORT_REV                = 0000000C                 
L1                               00001DDB R     03        PBO$L_RPORT_TYP                = 00000008                 
L10                              00001FA3 R     03        PBO$T_LPORT_NAME               = 00000018                 
L10CONT                          00001FB1 R     03        PBO$T_NXT_LPORT                = 00000028                 
L11                              00001FC8 R     03        PBO$W_RETRY                    = 00000016                 
L12                              00002054 R     03        PBO$W_STATE                    = 00000006                 
L2                               00001E67 R     03        PDT$B_AD_HWVERS                  0000033C                 
LEAST_LOADED                     000015F0 R     03        PDT$B_AD_PRTVRS                  00000324                 
LISTENERR                        000007E0 R     03        PDT$B_AD_RP_TYP                  00000325                 
LOAD_SHARE_BEG_TIME              00000039 R     02        PDT$B_DQIMAP                     00000574                 
LOAD_SHARE_BUGCHECK              00002496 R     03        PDT$B_FSNMAP                     00000594                 
LOAD_SHARE_BUGCHECK_COUNT        00000035 R     02        PDT$B_HSHUT_DG                   000004B0                 
LOAD_SHARE_END_TIME              0000003D R     02        PDT$B_LS_FLAG                  = 00000220                 
LOOP1                            0000148B R     03        PDT$B_MAX_PORT                   00000246                 
LOOP2                            000014C5 R     03        PDT$B_NXT_PORT                   000005F8                 
LOOP3                            000014F5 R     03        PDT$B_P0_LBSTS                   000005FA                 
LS_DOMAIN_PORTS                  00000018 R     02        PDT$B_P1_LBSTS                   000005FB                 
MOST_LOADED                      000015AB R     03        PDT$B_PD_HWVERS                  000002F8                 
MSG_INPUT                        00000D6C R     03        PDT$B_PD_PRTVRS                  000002E4                 
MY_PROC                          00000C76 R     03        PDT$B_PLOGMAP                    00000554                 
NDT$_BCA                       = 80000108                 PDT$B_PORT1                      000007C4                 
NDT$_BCI750                    = 8000010B                 PDT$B_PORTMAP                    00000534                 
NDT$_CI                        = 00000038                 PDT$B_PORT_NUM                   00000240                 
NDT$_CIXCD                     = 00000C05                 PDT$B_RDPMAP                     000005D4                 
NDT$_KFMSA                     = 00000810                 PDT$B_REQIDPS                    000005F9                 
NORMAL_ZONE                      0000192D R     03        PDT$B_SAMAP                      000005B4                 
NO_CDT                           00000395 R     03        PDT$B_SETCKT_DG                  000004D8                 
NO_MSCP_LISTN                    000006FC RG    03        PDT$C_BALANCEVER               = 00000002                 
NUM_DISCONNECT                   0000001C R     02        PDT$C_BASEVER                  = 00000000                 
PB$B_CBL_STS                   = 00000028                 PDT$C_CI_CLASS                 = 00000014                 
PB$B_P0_STS                    = 00000029                 PDT$C_CREDITVER                = 00000002                 
PB$B_P1_STS                    = 0000002A                 PDT$C_CTREND                   = 0000071C                 
PB$B_RSTATE                    = 00000021                 PDT$C_CTRSTART                 = 00000654                 
PB$B_RSTATION                  = 0000000C                 PDT$C_EXT_CTREND               = 000006E0                 
PB$B_RST_PORT                  = 00000020                 PDT$C_EXT_CTRSTART             = 00000674                 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 179
Symbol table                                                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (41)

PDT$C_LASTGASP_DG              = 000004D8                 PDT$L_CURCNTR                    00000630                 
PDT$C_LENGTH                   = 00000228                 PDT$L_CURERLCNT                  0000063C                 
PDT$C_PAREGBASE                  00000740                 PDT$L_DATA                       0000074C                 
PDT$C_PAREGEND                   000007BC                 PDT$L_DATREQ_BODIES_RCV          000006AC                 
PDT$C_PBREGBASE                  00000740                 PDT$L_DATREQ_BODIES_RCV_LAST     00000734                 
PDT$C_PBREGEND                   00000750                 PDT$L_DCONNECT                 = 00000028                 
PDT$C_PQB                      = 00000260                 PDT$L_DEALLOMSG                = 00000020                 
PDT$C_RED                      = 00000006                 PDT$L_DEALRGMSG                = 00000024                 
PDT$C_SCSLENGTH                = 00000740                 PDT$L_DEBUGCHECK                 00000470                 
PDT$C_SPEC_CTREND              = 0000071C                 PDT$L_DEFCNTR                    0000062C                 
PDT$C_SPEC_CTRSTART            = 000006E0                 PDT$L_DEVTYPE                    00000610                 
PDT$C_STD_CTRSTART             = 00000654                 PDT$L_DFQ                        0000076C                 
PDT$C_YELLOW                   = 00000004                 PDT$L_DFQHDR                     00000288                 
PDT$L_ACCEPT                   = 0000000C                 PDT$L_DGALLOCSZ                  0000048C                 
PDT$L_ADAPTER                    0000023C                 PDT$L_DGNETHD                    00000488                 
PDT$L_ALLOCMSG                 = 00000014                 PDT$L_DGSNT                      000006B8                 
PDT$L_ALTADP                     000007BC                 PDT$L_DG_DISC                    00000670                 
PDT$L_ALTPDT                     000007C0                 PDT$L_DG_RCV                   = 00000160                 
PDT$L_AVAIL_THRUPUT            = 0000012C                 PDT$L_DG_RCV_AVG               = 00000208                 
PDT$L_AVG_XFER_SIZE              0000073C                 PDT$L_DG_RCV_LAST              = 00000194                 
PDT$L_BASEBL                     00000618                 PDT$L_DG_RCV_PEAK              = 000001D8                 
PDT$L_BASEFL                     00000614                 PDT$L_DG_REC                     000006CC                 
PDT$L_BVPWAITCNT                 00000754                 PDT$L_DG_TXTREC                  000006D0                 
PDT$L_BVP_LEVEL                  000002C0                 PDT$L_DG_TXT_SNT                 000006BC                 
PDT$L_BYTES_DG_RCV             = 0000014C                 PDT$L_DG_XMT                   = 0000015C                 
PDT$L_BYTES_DG_RCV_AVG         = 000001F4                 PDT$L_DG_XMT_AVG               = 00000204                 
PDT$L_BYTES_DG_RCV_LAST        = 00000180                 PDT$L_DG_XMT_LAST              = 00000190                 
PDT$L_BYTES_DG_RCV_PEAK        = 000001C4                 PDT$L_DG_XMT_PEAK              = 000001D4                 
PDT$L_BYTES_DG_XMT             = 00000148                 PDT$L_DPRT_OFFSET                00000498                 
PDT$L_BYTES_DG_XMT_AVG         = 000001F0                 PDT$L_DQELOGOUT                  00000360                 
PDT$L_BYTES_DG_XMT_LAST        = 0000017C                 PDT$L_EQUAL_PATH_CALL_COUNT    = 000001B4                 
PDT$L_BYTES_DG_XMT_PEAK        = 000001C0                 PDT$L_ERLCNTR                    00000638                 
PDT$L_BYTES_MAPPED             = 00000158                 PDT$L_ERROR                      00000748                 
PDT$L_BYTES_MAPPED_AVG         = 00000200                 PDT$L_EXTNO_CTR                  00000674                 
PDT$L_BYTES_MAPPED_LAST        = 0000018C                 PDT$L_FADRH                      00000788                 
PDT$L_BYTES_MAPPED_PEAK        = 000001D0                 PDT$L_FADRL                      00000784                 
PDT$L_BYTES_MSG_RCV            = 00000154                 PDT$L_FUNC_MASK                  000002B8                 
PDT$L_BYTES_MSG_RCV_AVG        = 000001FC                 PDT$L_GPTBASE                    000002AC                 
PDT$L_BYTES_MSG_RCV_LAST       = 00000188                 PDT$L_GPTLEN                     000002B0                 
PDT$L_BYTES_MSG_RCV_PEAK       = 000001CC                 PDT$L_INS_COMQH                  00000464                 
PDT$L_BYTES_MSG_XMT            = 00000150                 PDT$L_INS_COMQL                  00000460                 
PDT$L_BYTES_MSG_XMT_AVG        = 000001F8                 PDT$L_INS_DFREQ                  00000468                 
PDT$L_BYTES_MSG_XMT_LAST       = 00000184                 PDT$L_INS_MFREQ                  0000046C                 
PDT$L_BYTES_MSG_XMT_PEAK       = 000001C8                 PDT$L_INTR_WPE                   000006F8                 
PDT$L_BYTES_XFER_INT           = 000001B0                 PDT$L_IPORT_STS                  00000228                 
PDT$L_CLSCKT_DG                  00000230                 PDT$L_KEEPALIVE                  000002B4                 
PDT$L_CMDR_WPE                   000006F4                 PDT$L_LBDG                       000005FE                 
PDT$L_CNF                        00000740                 PDT$L_LOAD_RATING              = 00000130                 
PDT$L_CNF_SNT                    000006A8                 PDT$L_LOAD_VECTOR              = 000000F8                 
PDT$L_CNF_SNT_LAST               0000072C                 PDT$L_LPORT_MULT                 000004FC                 
PDT$L_CNTUSERS                   00000640                 PDT$L_MADR                       00000748                 
PDT$L_CONNECT                  = 00000018                 PDT$L_MAR_WPE                    000006FC                 
PDT$L_CONNECTION_MOVE_COUNT    = 000001BC                 PDT$L_MAX_THRUPUT_THRESHOLD    = 0000013C                 
PDT$L_CQ0                        00000758                 PDT$L_MBPB_WPE                   000006F0                 
PDT$L_CQ1                        0000075C                 PDT$L_MBR_WPE                    00000700                 
PDT$L_CTRL                       00000740                 PDT$L_MCWI_PE                    00000710                 
PDT$L_CURCNT                     00000634                 PDT$L_MDATR                      0000074C                 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 180
Symbol table                                                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (41)

PDT$L_MFQ                        00000770                 PDT$L_PPER2                      000007B4                 
PDT$L_MFQE_COUNT                 00000484                 PDT$L_PPR                        0000077C                 
PDT$L_MFQHDR                     0000028C                 PDT$L_PQBBR                      00000754                 
PDT$L_MFQ_DEFICIT                00000478                 PDT$L_PRVR                       0000079C                 
PDT$L_MFQ_INCREMENT              00000480                 PDT$L_PS                         00000750                 
PDT$L_MFQ_THRESHOLD              0000047C                 PDT$L_PSCR                       000007A8                 
PDT$L_MIB_PE                     0000070C                 PDT$L_PSDR                       000007AC                 
PDT$L_MIN_THRUPUT_THRESHOLD    = 00000140                 PDT$L_PSERNUM                    000007B8                 
PDT$L_MISC_REC                   000006DC                 PDT$L_PSNR                       00000780                 
PDT$L_MISC_SNT                   000006C8                 PDT$L_PSR                        00000760                 
PDT$L_MPB_RPE                    00000704                 PDT$L_PVR                        00000794                 
PDT$L_MQELOGOUT                  000003A0                 PDT$L_RCLMSGBUF                = 00000048                 
PDT$L_MSGHDRSZ                 = 000000C0                 PDT$L_RDCNTDG                    00000624                 
PDT$L_MSG_RCV                  = 00000168                 PDT$L_REJECT                   = 0000004C                 
PDT$L_MSG_RCV_AVG              = 00000210                 PDT$L_REQDAT_OPER_SNT            00000694                 
PDT$L_MSG_RCV_LAST             = 0000019C                 PDT$L_REQDAT_OPER_SNT_LAST       00000728                 
PDT$L_MSG_RCV_PEAK             = 000001E0                 PDT$L_RESP_CNT                   00000474                 
PDT$L_MSG_REC                    000006D4                 PDT$L_RETDAT_BODIES_RCV          0000069C                 
PDT$L_MSG_SNT                    000006C0                 PDT$L_RETDAT_BODIES_SNT          000006B0                 
PDT$L_MSG_TXT_REC                000006D8                 PDT$L_RETDAT_DATA_RCV            00000698                 
PDT$L_MSG_TXT_SNT                000006C4                 PDT$L_RETDAT_DATA_RCV_LAST       00000724                 
PDT$L_MSG_XMT                  = 00000164                 PDT$L_RETDAT_DATA_SNT            000006B4                 
PDT$L_MSG_XMT_AVG              = 0000020C                 PDT$L_RETDAT_DATA_SNT_LAST       00000738                 
PDT$L_MSG_XMT_LAST             = 00000198                 PDT$L_RSPR_WPE                   000006EC                 
PDT$L_MSG_XMT_PEAK             = 000001DC                 PDT$L_SATURATION_PT            = 00000138                 
PDT$L_MTC                        00000774                 PDT$L_SCS_OFFSET                 00000490                 
PDT$L_NUM_MAP                  = 00000174                 PDT$L_SETCKTMSK                  000005F4                 
PDT$L_NUM_MAP_LAST             = 000001A8                 PDT$L_SHUT_ALL_VC              = 0000009C                 
PDT$L_PATH0_ACK                  00000658                 PDT$L_SNDCNTMSG                = 00000060                 
PDT$L_PATH0_NAK                  0000065C                 PDT$L_SNDDAT_BODIES_SNT          00000690                 
PDT$L_PATH0_NRSP                 00000660                 PDT$L_SNDDAT_DATA_SNT            0000068C                 
PDT$L_PATH1_ACK                  00000664                 PDT$L_SNDDAT_DATA_SNT_LAST       0000071C                 
PDT$L_PATH1_NAK                  00000668                 PDT$L_SNDDAT_OPER_SNT            00000688                 
PDT$L_PATH1_NRSP                 0000066C                 PDT$L_SNDDAT_OPER_SNT_LAST       00000720                 
PDT$L_PCKT_RCRC                  000006E4                 PDT$L_SNTDAT_BODIES_REC          000006A0                 
PDT$L_PDCSR                      000007A4                 PDT$L_SNTDAT_DATA_REC            000006A4                 
PDT$L_PEC                        00000764                 PDT$L_SNTDAT_DATA_REC_LAST       00000730                 
PDT$L_PEND_INST                  00000750                 PDT$L_SPARE1_CNT                 00000678                 
PDT$L_PESR                       0000078C                 PDT$L_SPARE2_CNT                 0000067C                 
PDT$L_PEVR                       00000798                 PDT$L_SPARE3_CNT                 00000680                 
PDT$L_PFAR                       00000778                 PDT$L_SPARE4_CNT                 00000684                 
PDT$L_PIC                        00000768                 PDT$L_SPECNO_CTR                 000006E0                 
PDT$L_PIDR                       00000790                 PDT$L_SPRT_OFFSET                00000494                 
PDT$L_PIV                        000002BC                 PDT$L_SPTBASE                    000002A4                 
PDT$L_PMC                        00000744                 PDT$L_SPTLEN                     000002A8                 
PDT$L_POLLERDUE                  00000530                 PDT$L_STAT                       00000744                 
PDT$L_POOLDUE                    00000528                 PDT$L_STDNO_CTR                  00000654                 
PDT$L_PORTQBUFBL                 00000620                 PDT$L_STOP_VCS                 = 00000080                 
PDT$L_PORTQBUFFL                 0000061C                 PDT$L_TBUF_PE                    00000708                 
PDT$L_PORT_CMD                 = 00000178                 PDT$L_TIME_STAMP               = 00000134                 
PDT$L_PORT_CMD_AVG             = 0000021C                 PDT$L_TOLERANCE_THRESHOLD      = 00000144                 
PDT$L_PORT_CMD_LAST            = 000001AC                 PDT$L_TQEADDR                    00000608                 
PDT$L_PORT_CMD_PEAK            = 000001EC                 PDT$L_UCB0                     = 000000E8                 
PDT$L_PORT_IDLE                  000006E8                 PDT$L_UNEQUAL_PATH_CALL_COUNT  = 000001B8                 
PDT$L_PORT_MAP                 = 00000128                 PDT$L_VBDT                       0000029C                 
PDT$L_PPD_SUB                    0000049C                 PDT$L_VC_CHECK                   000002B4                 
PDT$L_PPER                       000007B0                 PDT$L_VC_CHKDUE                  0000052C                 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 181
Symbol table                                                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (41)

PDT$L_VPQB                       00000298                 PEAK15                           00002042 R     03        
PDT$L_WAITQFL                  = 000000B8                 PEAK2                            00001E1B R     03        
PDT$L_XCOMM                      000007A0                 PEAK3                            00001E2E R     03        
PDT$L_XREG_PE                    00000718                 PEAK4                            00001E41 R     03        
PDT$L_YREG_PE                    00000714                 PEAK5                            00001E55 R     03        
PDT$Q_BYTES_XFER               = 0000016C                 PLVEC$C_LENGTH                 = 0000003C                 
PDT$Q_BYTES_XFER_AVG           = 00000214                 PLVEC$C_MAX_INDEX              = 0000000A                 
PDT$Q_BYTES_XFER_LAST          = 000001A0                 POLLER_INIT                      0000023E R     03        
PDT$Q_BYTES_XFER_PEAK          = 000001E4                 PORT_FAIR_SHARE                  00000010 R     02        
PDT$Q_COMQ2                      00000270                 PR$_IPL                        = 00000012                 
PDT$Q_COMQ3                      00000278                 PRCPOL$B_DIRINF                = 00000028                 
PDT$Q_COMQBASE                   00000260                 PRCPOL$B_PRCNAM                = 00000018                 
PDT$Q_COMQH                      00000268                 PRCPOL$C_SIZ                   = 00000038                 
PDT$Q_COMQL                      00000260                 PRCPOL$L_SYSIDL                = 00000000                 
PDT$Q_CONN_WAIT                = 00000108                 PRCPOL$T_NODNAM                = 00000008                 
PDT$Q_DFREEQ                     00000250                 PRCPOL$W_SYSIDH                = 00000004                 
PDT$Q_DISABLED                 = 00000120                 RATE_DONE                        00001931 R     03        
PDT$Q_FORMPB                     00000234                 RD$C_LENGTH                    = 00000008                 
PDT$Q_LAST_ERR                   00000644                 RD$L_CDRP                      = 00000000                 
PDT$Q_MFREEQ                     00000258                 RD$L_LINK                      = 00000000                 
PDT$Q_PB                       = 00000100                 RD$V_BUSY                      = 00000000                 
PDT$Q_PD_CURTIME                 00000304                 RD$W_SEQNUM                    = 00000006                 
PDT$Q_RED                      = 00000118                 RD$W_STATE                     = 00000004                 
PDT$Q_RSPQ                       00000280                 RDT$C_LENGTH                   = 00000018                 
PDT$Q_TEMP_RSPQ                  000004A0                 RDT$L_FREERD                   = FFFFFFF4                 
PDT$Q_TIME_RDCNT                 0000064C                 RDT$L_MAXRDIDX                 = FFFFFFF8                 
PDT$Q_YELLOW                   = 00000110                 RDT$L_QRDT_CNT                 = FFFFFFFC                 
PDT$T_AD_HWTYPE                  00000338                 RDT$L_WAITBL                   = FFFFFFEC                 
PDT$T_AD_SWTYPE                  00000330                 RDT$L_WAITFL                   = FFFFFFE8                 
PDT$T_AD_SWVERS                  00000334                 REM_PROC                         00000C86 R     03        
PDT$T_PD_HWTYPE                  000002F4                 RESET_TIMER                      00000DB8 R     03        
PDT$T_PD_SWTYPE                  000002EC                 SB$B_ENBMSK                    = 0000005A                 
PDT$T_PD_SWVERS                  000002F0                 SB$B_HWVERS                    = 00000038                 
PDT$W_AD_MAXDG                   0000032C                 SB$B_SYSTEMID                  = 00000018                 
PDT$W_AD_MAXMSG                  0000032E                 SB$L_DDB                       = 00000054                 
PDT$W_BDTLEN                     000002A0                 SB$L_FLINK                     = 00000000                 
PDT$W_CTRFLAG                    00000628                 SB$L_PBFL                      = 0000000C                 
PDT$W_DQELEN                     00000290                 SB$Q_SWINCARN                  = 0000002C                 
PDT$W_LOAD_CLASS               = 000000FC                 SB$S_ENBMSK                    = 00000002                 
PDT$W_LPORT_STS                  0000022C                 SB$S_SYSTEMID                  = 00000006                 
PDT$W_MQELEN                     00000294                 SB$T_HWTYPE                    = 00000034                 
PDT$W_PBCOUNT                    0000022E                 SB$T_NODENAME                  = 00000044                 
PDT$W_PD_MAXDG                   000002E8                 SB$T_SWTYPE                    = 00000024                 
PDT$W_PD_MAXMSG                  000002EA                 SB$T_SWVERS                    = 00000028                 
PDT$W_SCSVERSION               = 000000F4                 SB$W_MAXDG                     = 00000020                 
PDT$W_STDGDYN                    00000602                 SB$W_MAXMSG                    = 00000022                 
PDT$W_STDGUSED                   00000604                 SB$W_TIMEOUT                   = 00000058                 
PDT$W_TIMVCFAIL                  0000060C                 SBNB$B_PROCNAM                 = 0000000C                 
PDTDONE                          00001C8D R     03        SBNB$B_TYPE                    = 0000000A                 
PDTLIST$C_LENGTH               = 0000008C                 SBNB$K_LENGTH                  = 00000024                 
PDTLIST$C_MAX_INDEX            = 00000020                 SBNB$S_PROCNAM                 = 00000010                 
PDT_JMP                          000005A9 R     03        SBNB$W_LOCAL_INDEX             = 0000001C                 
PEAK1                            00001E08 R     03        SBNB$W_SIZE                    = 00000008                 
PEAK11                           00001FF5 R     03        SBO$B_HWVERS                   = 00000020                 
PEAK12                           00002008 R     03        SBO$B_NXT_SYSID                = 00000048                 
PEAK13                           0000201B R     03        SBO$B_RSTATION1                = 0000003C                 
PEAK14                           0000202E R     03        SBO$B_SYSTEMID                 = 00000000                 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 182
Symbol table                                                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (41)

SBO$Q_SWINCARN                 = 00000014                 SCS$K_CDTEXT                   = 000000C8  G              
SBO$T_HWTYPE                   = 0000001C                 SCS$LISTEN                       00000874 RG    03        
SBO$T_LPORT1                   = 00000044                 SCS$LKP_MSGWAIT                  000009F0 RG    03        
SBO$T_NODENAME                 = 0000002C                 SCS$LKP_RDTCDRP                  00000978 RG    03        
SBO$T_SWTYPE                   = 0000000C                 SCS$LKP_RDTWAIT                  000009BB RG    03        
SBO$T_SWVERS                   = 00000010                 SCS$LOCLOOKUP                    000008A3 RG    03        
SBO$W_MAXDG                    = 00000008                 SCS$L_EB_TBL                     00000041 RG    02        
SBO$W_MAXMSG                   = 0000000A                 SCS$NEW_PB                       0000109E RG    03        
SB_COPY_LEN                    = 0000003C                 SCS$NEW_SB                       00000A41 RG    03        
SCS$ACCEPT                       000002C6 RG    03        SCS$NO_MSCP_POLL               = 00000000                 
SCS$ALLOC_CDT                    00000302 RG    03        SCS$POLL_MBX                     00000E25 RG    03        
SCS$ALLOC_RSPID                  000003A5 RG    03        SCS$POLL_MODE                    00000AD0 RG    03        
SCS$AR_LOCALSB                   ********   X   03        SCS$POLL_PROC                    00000A52 RG    03        
SCS$CANCEL_MBX                   00000EBD RG    03        SCS$RECYL_RSPID                  00000699 RG    03        
SCS$CONFIG_PTH                   000003F1 RG    03        SCS$REMOVE                       000008F6 RG    03        
SCS$CONFIG_SYS                   00000475 RG    03        SCS$RESUMEWAITR                  0000093B RG    03        
SCS$CONNECT                      000004EF RG    03        SCS$SET_LOAD_RATING              00001191 RG    03        
SCS$C_USE_ALTERNATE_PORT       = 0000002A                 SCS$SHUTDOWN                     00000EFF RG    03        
SCS$DEALL_CDT                    000005FD RG    03        SCS$UNSTALLUCB                   00000958 RG    03        
SCS$DEALL_CDT1                   0000067F R     03        SCS$UPDATE_PORT_LOAD_VECTOR      00001037 RG    03        
SCS$DEALL_RSPID                  0000069B RG    03        SCS_ALONONPAGED                  00000926 R     03        
SCS$DIRECTORY                    00000705 R     03        SCS_CALC_BYTES_XFER              000022D6 R     03        
SCS$DIR_LOOKUP                   00000C96 RG    03        SCS_CHECK_QUEUES                 00001B7C R     03        
SCS$DISCONNECT                   000007E7 RG    03        SCS_CHK_CDT_REUSE_QUEUE          000023AF R     03        
SCS$ENTER                        00000802 RG    03        SCS_CTRS_UPDATE                  00001CD7 R     03        
SCS$FIND_RDTE                    00000849 RG    03        SCS_C_EB_MAX_INDEX             = 00000006                 
SCS$GA_DFLTMSK                   00000000 RG    02        SCS_C_RATING_FACTOR            = 00000100                 
SCS$GA_EXISTS                    ********   X   03        SCS_DEALNONPAGD                  00000935 R     03        
SCS$GB_DISCON_LIMIT              ********   X   03        SCS_END                          000024B0 R     03        
SCS$GL_AVAILABLE_PORT            ********   X   03        SCS_GET_LOAD_VECTOR              000013EC R     03        
SCS$GL_CDL                       ********   X   03        SCS_INIT                         00000003 RG    03        
SCS$GL_INIT_TIMEOUT              ********   X   03        SCS_LOAD_SHARE_TIMER             00001436 R     03        
SCS$GL_LOAD_SHARE_COUNTERS       0000001D RG    02        SCS_L_SHARE_TQE                  00000008 R     02        
SCS$GL_LOAD_SHARE_INTERVAL       ********   X   03        SCS_PROCESS_CDTS                 00002364 R     03        
SCS$GL_LOAD_SHARE_PDT_TABLE      ********   X   03        SCS_REDISTRIBUTE_CDTS            000013EB R     03        
SCS$GL_MCADR                     ********   X   03        SCS_REGISTER_LOCAL_NAME          00000F2B R     03        
SCS$GL_MIN_CONN_WAIT_INTERVAL    ********   X   03        SCS_SELECT_PATH                  00000FA3 R     03        
SCS$GL_MIN_PORT_WAIT_INTERVAL    ********   X   03        SCS_START                        ********   X   03        
SCS$GL_PDT                       ********   X   03        SCS_UPDATE_REG_CTRS              0000218E R     03        
SCS$GL_RDT                       ********   X   03        SCS_VECTOR_FLAG                  0000000C R     02        
SCS$GL_RED_THRESHOLD             ********   X   03        SCS_V_RATING_FACTOR            = 00000008                 
SCS$GL_SHARE_ENABLE              ********   X   03        SDIR$B_PROCINF                 = 0000001C                 
SCS$GL_YELLOW_THRESHOLD          ********   X   03        SDIR$B_PROCNAM                 = 0000000C                 
SCS$GQ_CONFIG                    ********   X   03        SDIR$C_LENGTH                  = 00000030                 
SCS$GQ_DIRECT                    ********   X   03        SDIR$L_CONID                   = 0000002C                 
SCS$GQ_DISCONNECT                ********   X   03        SDIR$S_PROCINF                 = 00000010                 
SCS$GQ_LOCAL_NAMES               ********   X   03        SDIR$S_PROCNAM                 = 00000010                 
SCS$GQ_POLL                      ********   X   03        SDIR$W_SIZE                    = 00000008                 
SCS$GQ_REUSE_CDT                 ********   X   03        SDONE                            00002179 R     03        
SCS$GQ_WORSE_PATH                ********   X   03        SDONE1                           00002183 R     03        
SCS$GW_CDTCNT                    ********   X   03        SEQ_NO                           00000126 R     03        
SCS$GW_CDTMAX                    00000004 RG    02        SERV_INFO                        000000F6 R     03        
SCS$GW_NEXTBIT                   00000002 RG    02        SET_RATING                       00001911 R     03        
SCS$GW_NEXT_INDEX                ********   X   03        SHAC_CQ0                         00000080                 
SCS$GW_PRCPOLINT                 ********   X   03        SHAC_CQ1                         00000084                 
SCS$GW_RDTCNT                    ********   X   03        SHAC_CQ2                         00000088                 
SCS$INIT_REMOTE_SDA              ********W GX   03        SHAC_CQ3                         0000008C                 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 183
Symbol table                                                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (41)

SHAC_DFQ                         00000090                 SYS$K_CLUSTERS_LOCKMGR         = 00000006                 
SHAC_MFQ                         00000094                 SYS$K_COUNTERS                 = 0000000B                 
SHAC_MTC                         000000A8                 SYS$K_CPU                      = 0000000E                 
SHAC_MTEC                        000000AC                 SYS$K_FILES_VOLUMES            = 00000003                 
SHAC_PDC                         000000A0                 SYS$K_IMAGE_ACTIVATOR          = 00000009                 
SHAC_PEC                         0000009C                 SYS$K_IO                       = 00000002                 
SHAC_PESR                        00000050                 SYS$K_LOGICAL_NAMES            = 00000007                 
SHAC_PFAR                        00000054                 SYS$K_MEMORY_MANAGEMENT        = 00000001                 
SHAC_PIC                         000000A4                 SYS$K_MISC                     = 0000000D                 
SHAC_PMC                         0000005C                 SYS$K_NETWORKS                 = 0000000A                 
SHAC_PPR                         00000058                 SYS$K_POSIX                    = 00000011                 
SHAC_PQBBR                       00000048                 SYS$K_PROCESS_SCHED            = 00000004                 
SHAC_PS                          0000004C                 SYS$K_SECURITY                 = 00000008                 
SHAC_PSR                         00000098                 SYS$K_SHELL                    = 00000010                 
SHAC_SSHMA                       00000044                 SYS$K_STABLE                   = 0000000C                 
SHARE_TIMER_COUNT                0000001D R     02        SYS$K_SYSGEN                   = 00000005                 
SIZ...                         = 00000001                 SYS$K_VOLATILE                 = 0000000F                 
SLOOP                            00001FA6 R     03        TAPE_SERV_NAME                   00000116 R     03        
SMP$ACQUIRE                      ********   X   03        THREAD_HAS_RWAITCNT              00000949 R     03        
SMP$GL_FLAGS                     ********   X   03        TQE$B_RQTYPE                   = 0000000B                 
SMP$RELEASE                      ********   X   03        TQE$B_TYPE                     = 0000000A                 
SMP$RESTORE                      ********   X   03        TQE$C_LENGTH                   = 00000034                 
SMP$V_ENABLED                  = 00000000                 TQE$C_SSREPT                   = 00000005                 
SPL$C_HWCLK                    = 00000023                 TQE$C_SSSNGL                   = 00000001                 
SPL$C_SCS                      = 00000034                 TQE$K_LENGTH                   = 00000034                 
SPNB$B_INDEX                   = 00000014                 TQE$L_FPC                      = 0000000C                 
SPNB$B_NAMLST                  = 00000018                 TQE$L_FR3                      = 00000010                 
SPNB$B_SUBTYP                  = 0000000B                 TQE$L_FR4                      = 00000014                 
SPNB$B_TYPE                    = 0000000A                 TQE$Q_DELTA                    = 00000020                 
SPNB$C_HDRSIZ                  = 00000018                 TQE$W_SIZE                     = 00000008                 
SPNB$L_ROUTINE                 = 00000010                 TRANSFER_SIZE                    00000041 R     02        
SPNB$L_SB                      = 0000000C                 UCB$B_DT                         000000F8                 
SPNB$W_REFC                    = 00000015                 UCB$B_INI_FLAGS                  000000F9                 
SPNB$W_SIZE                    = 00000008                 UCB$B_LMERTCNT                   0000019A                 
SPPB$B_PROCNAM                 = 0000000C                 UCB$B_LMERTMAX                   0000019B                 
SPPB$B_SUBTYP                  = 0000000B                 UCB$B_LMEST                      00000198                 
SPPB$B_TYPE                    = 0000000A                 UCB$B_LMET                       00000199                 
SPPB$K_LENGTH                  = 00000028                 UCB$B_MSG_TYP                    000000FC                 
SPPB$L_CTX                     = 00000020                 UCB$B_PDT_TYPE                   000000FD                 
SPPB$L_FLINK                   = 00000000                 UCB$K_BGN_ADPSUB                 00000110                 
SPPB$L_RTN                     = 0000001C                 UCB$K_BGN_ADPTAB                 000000F4                 
SPPB$S_PROCNAM                 = 00000010                 UCB$K_BGN_PDTSUB                 00000150                 
SPPB$W_BIT                     = 00000024                 UCB$K_END_ADPTAB                 00000168                 
SPPB$W_SIZE                    = 00000008                 UCB$K_ERRDGBYTS                = 000000B4                 
SS$_ALRDYCLOSED                = 000006A9                 UCB$K_LMPKTBYTS                = 00000040                 
SS$_BADPARAM                   = 00000014                 UCB$L_ADP                        000000E8                 
SS$_DISCONNECT                 = 0000204C                 UCB$L_CICMD                      000001B8                 
SS$_ILLCDTST                   = 00002154                 UCB$L_DDT                      = 0000009C                 
SS$_INSFCDT                    = 000021AC                 UCB$L_DPC                      = 000000B0                 
SS$_INSFMEM                    = 00000124                 UCB$L_ENB_INT                    00000120                 
SS$_NORMAL                     = 00000001                 UCB$L_FORMAT_REV                 00000124                 
SS$_NOSUCHNODE                 = 0000028C                 UCB$L_INIFKBLK                   000000B4                 
SS$_NOSUCHOBJ                  = 000020A4                 UCB$L_INIRETURN                  000000EC                 
SS$_RESET                      = 0000210C                 UCB$L_INIT_PDT                   00000118                 
SS$_UNREACHABLE                = 00002094                 UCB$L_INS_COMQH                  00000154                 
START_POLL                       00000B2B R     03        UCB$L_INS_COMQL                  00000150                 
SYS$K_BASE_IMAGE               = 00000000                 UCB$L_INS_DFREQ                  00000158                 
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 184
Symbol table                                                             13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (41)

UCB$L_INS_MFREQ                  0000015C                 
UCB$L_INTERRUPT                  00000130                 
UCB$L_IOQFL                    = 00000060                 
UCB$L_LSINDX                     00000104                 
UCB$L_LSLENGTH                   00000108                 
UCB$L_MEM_DUMP                   00000144                 
UCB$L_MFQEFKBLK                  000000CC                 
UCB$L_MSGFKBLK                   00000168                 
UCB$L_NDT                        000000F4                 
UCB$L_PMC                        0000010C                 
UCB$L_POKE_PORT                  0000012C                 
UCB$L_POWER_FAIL                 00000114                 
UCB$L_PPD_SIZE                   00000100                 
UCB$L_REG_DISP                   00000140                 
UCB$L_REG_DUMP                   0000013C                 
UCB$L_RELEASE_PS                 00000148                 
UCB$L_REV_TABLE                  00000110                 
UCB$L_START_UCODE                0000011C                 
UCB$L_STOP_UCODE                 00000134                 
UCB$L_TIMER                      00000128                 
UCB$L_UNMAP_PDT                  00000138                 
UCB$M_CANCEL                   = 00000008                 
UCB$M_TIMOUT                   = 00000040                 
UCB$N_LSADDR                     000001A0                 
UCB$N_LSID                       000001A6                 
UCB$N_RSADDR                     000001AC                 
UCB$N_RSID                       000001B2                 
UCB$T_MSGDATA                    000001C0                 
UCB$T_OPA0_TEMP                  00000180                 
UCB$W_INCARN                     000000E4                 
UCB$W_LMERRCNT                   0000019C                 
UCB$W_MSGBYTCNT                  000001BC                 
UCB$W_MSGPPDTYP                  000001BE                 
UCB$W_PDT_SIZE                   000000FE                 
UCB$W_REFC                     = 00000070                 
UCB$W_RWAITCNT                 = 0000006A                 
UCB$W_STS                      = 00000078                 
UNEQUAL_PATH_CALL_COUNT          0000002D R     02        
UPDATE_AVAIL_MAP                 00001531 R     03        
WDONE                            00001F8C R     03        
WDONE1                           00001F96 R     03        
WLOOP                            00001DB9 R     03        
WORSE_PATH_CONNECTIONS           000010E7 R     03        
YELLOWQ                          0000120A R     03        
Y_ZONE                           0000191F R     03        
ZERO_TOL                         0000190D R     03        

                                                +----------------+
                                                ! Psect synopsis !
                                                +----------------+

PSECT name                      Allocation          PSECT No.  Attributes     
----------                      ----------          ---------  ----------     
.  ABS  .                       00000000  (    0.)  00 (  0.)  NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT NOVEC BYTE  
$ABS$                           000042B0  (17072.)  01 (  1.)  NOPIC   USR   CON   ABS   LCL NOSHR   EXE   RD    WRT NOVEC BYTE  
EXEC$NONPAGED_DATA              00000121  (  289.)  02 (  2.)    PIC   USR   CON   REL   LCL NOSHR NOEXE   RD    WRT NOVEC QUAD  
EXEC$NONPAGED_CODE              000024B0  ( 9392.)  03 (  3.)    PIC   USR   CON   REL   LCL NOSHR   EXE   RD  NOWRT NOVEC LONG  
SYS$SCS                         - System Communications Service Loadcode  7-JUL-1992 21:09:05  VAX MACRO V5.4-3            Page 185
VAX-11 Macro Run Statistics                                              13-MAY-1992 11:01:55  [SYSLOA.SRC]SYS$SCS.MAR;1        (41)


                                             +------------------------+
                                             ! Performance indicators !
                                             +------------------------+

Phase                    Page faults    CPU Time       Elapsed Time   
-----                    -----------    --------       ------------   
Initialization                   28     00:00:00.03    00:00:00.24
Command processing              915     00:00:00.52    00:00:01.86
Pass 1                         1711     00:00:23.94    00:00:39.16
Symbol table sort                12     00:00:02.06    00:00:02.86
Pass 2                           46     00:00:07.24    00:00:21.66
Symbol table output               0     00:00:00.24    00:00:00.41
Psect synopsis output             2     00:00:00.01    00:00:00.01
Cross-reference output            0     00:00:00.00    00:00:00.00
Assembler run totals           2734     00:00:34.06    00:01:06.21

The working set limit was 4112 pages.
520892 bytes (1018 pages) of virtual memory were used to buffer the intermediate code.
There were 300 pages of symbol table space allocated to hold 4660 non-local and 356 local symbols.
7595 source lines were read in Pass 1, producing 47 object records in Pass 2.
98 pages of virtual memory were used to define 71 macros.

                                            +--------------------------+
                                            ! Macro library statistics !
                                            +--------------------------+

Macro library name                           Macros defined      
------------------                           --------------      
_$22$DIA9:[SHRLIB]PALIB.MLB;1                           3        
_$22$DIA9:[SYS.OBJ]LIB.MLB;1                           51        
_$22$DIA9:[SYSLIB]STARLET.MLB;2                         9        
TOTALS (all libraries)                                 63        

5558 GETS were required to define 63 macros.

There were no errors, warnings or information messages.

MACRO/LIS=LIS$:SYS$SCS/OBJ=OBJ$:SYS$SCS TMP$:SYS$SCS.MAR+EXECML$/LIB+SHRLIB$:PALIB/LIB
