Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/listings/rsx11s/coral.list
There are no other files named coral.list in the archive.
CORAL	MACRO M1110  22-AUG-79 07:04  PAGE 3


      1						.TITLE	CORAL
      2						.IDENT	/07/
      3
      4					;
      5					; COPYRIGHT (C) 1974, 1976
      6					; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
      9					; OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
     10					;
     11					; VERSION 07
     12					;
     13					; D. N. CUTLER 3-AUG-73
     14					;
     15					; PREVIOUSLY MODIFIED BY:
     16					;
     17					;	D. N. CUTLER
     18					;	T. J. MILLER
     19					;
     20					; MODIFIED BY:
     21					;
     22					; CORE BUFFER ALLOCATION ROUTINES
     23					;
     24					; MACRO LIBRARY CALLS
     25					;
     26
     27						.MCALL	CLKDF$,PKTDF$
     28	000000					CLKDF$			;DEFINE CLOCK QUEUE CONTROL BLOCK OFFSETS
     29	000000					PKTDF$			;DEFINE I/O PACKET OFFSETS
     30
     31					;+
     32					; **-$ALOCB-ALLOCATE CORE BUFFER
     33					; **-$ALOC1-ALLOCATE CORE BUFFER (ALTERNATE ENTRY)
     34					;
     35					; THIS ROUTINE IS CALLED TO ALLOCATE AN EXEC CORE BUFFER. THE ALLOCATION
     36					; ALGORITHM IS FIRST FIT AND BLOCKS ARE ALLOCATED IN MULTIPLES OF FOUR
     37					; BYTES.
     38					;
     39					; INPUTS:
     40					;
     41					;	R0=ADDRESS OF CORE ALLOCATION LISTHEAD-2 IF ENTRY AT $ALOC1.
     42					;	R1=SIZE OF THE CORE BUFFER TO ALLOCATE IN BYTES.
     43					;
     44					; OUTPUTS:
     45					;
     46					;	C=1 IF INSUFFICIENT CORE IS AVAILABLE TO ALLOCATE THE BLOCK.
     47					;	C=0 IF THE BLOCK IS ALLOCATED.
     48					;		R0=ADDRESS OF THE ALLOCATED BLOCK.
     49					;		R1=LENGTH OF BLOCK ALLOCATED
     50					;-
     51
     52						.ENABL	LSB
     53	000000	012700 	177776G		$ALOCB::MOV	#$CRAVL-2,R0	;POINT TO ALLOCATION MASK WORD
     54
     55
     56						.IF DF	Q$$OPT
     57
CORAL	MACRO M1110  22-AUG-79 07:04  PAGE 3-1


     58						ADD	(R0),R1		;ROUND TO NEXT BOUNDARY
     59						BIC	(R0)+,R1	;
     60						BEQ	5$		;IF EQ ZERO LENGTH REQUEST
     61						CMP	R1,#I.LGTH	;REQUEST SIZE OF PACKET?
     62						BNE	5$		;IF NE NO
     63						MOV	#$PKAVL,R2	;POINT TO PACKET AVAILABLE POINTER
     64						MOV	(R2),R0		;PICK UP PACKET POINTER
     65						BEQ	4$		;IF EQ THERE IS NONE
     66						MOV	(R0),(R2)+	;UNLINK PACKET FROM LIFO LIST
     67						DEC	(R2)		;INDICATE ONE PACKET LESS IN LIST
     68						RETURN			;
     69					4$:	MOV	#$CRAVL-2,R0	;POINT BACK TO ALLOCATION MASK WORD
     70
     71						.ENDC
     72
     73
     74	000004	061001 			$ALOC1::ADD	(R0),R1		;ROUND TO NEXT BOUNDARY
     75	000006	042001 				BIC	(R0)+,R1	;CLEAR EXCESS
     76	000010	000261 			5$:	SEC			;ASSUME ZERO LENGTH BLOCK
     77	000012	001417 				BEQ	30$		;IF EQ ZERO LENGTH REQUEST
     78	000014	010002 			10$:	MOV	R0,R2		;SAVE ADDRESS OF CURRENT BLOCK
     79	000016	011200 				MOV	(R2),R0		;GET ADDRESS OF NEXT BLOCK
     80	000020	001414 				BEQ	30$		;IF EQ END OF CHAIN
     81	000022	026001 	000002 			CMP	2(R0),R1	;BLOCK BIG ENOUGH?
     82	000026	103772 				BLO	10$		;IF LO NO
     83	000030	001407 				BEQ	20$		;IF EQ BLOCK IS EXACT SIZE
     84	000032	005720 				TST	(R0)+		;POINT TO SIZE OF FREE BLOCK
     85	000034	160110 				SUB	R1,(R0)		;CALCULATE SIZE REMAINING
     86	000036	060001 				ADD	R0,R1		;POINT TO NEW FREE BLOCK
     87	000040	011011 				MOV	(R0),(R1)	;COPY SIZE
     88	000042	014041 				MOV	-(R0),-(R1)	;COPY LINK
     89	000044	010110 				MOV	R1,(R0)		;STORE LINK TO NEW FREE BLOCK
     90	000046	160001 				SUB	R0,R1		;RESTORE SIZE OF BLOCK
     91	000050	011012 			20$:	MOV	(R0),(R2)	;UPDATE LINK TO NEW FREE BLOCK
     92	000052				30$:	RETURN			;
     93						.DSABL	LSB
     94
     95					;+
     96					; **-$ALCLK-ALLOCATE CLOCK QUEUE CORE BLOCK
     97					;
     98					; THIS ROUTINE IS CALLED TO ALLOCATE A CORE BLOCK FOR A CLOCK QUEUE ENTRY.
     99					;
    100					; INPUTS:
    101					;
    102					;	NONE.
    103					;
    104					; OUTPUTS:
    105					;
    106					;	IF INSUFFICIENT CORE IS AVAILABLE TO ALLOCATE THE BLOCK, THEN A
    107					;	DIRECTIVE STATUS OF 'D.RS1' IS RETURNED. ELSE THE ADDRESS OF
    108					;	THE ALLOCATED BLOCK IS RETURNED TO THE CALLER IN R0.
    109					;-
    110
    111						.ENABL	LSB
    112	000054	012701 	000020 		$ALCLK::MOV	#C.LGTH,R1	;PICK UP LENGTH OF CLOCK BLOCK
    113	000060	000405 				BR	10$		;
    114
CORAL	MACRO M1110  22-AUG-79 07:04  PAGE 3-2


    115					;+
    116					; **-$DECLK-DEALLOCATE CLOCK QUEUE CORE BLOCK
    117					;
    118					; THIS ROUTINE IS CALLED TO DEALLOCATE A CORE BLOCK THAT WAS BEING USED
    119					; FOR A CLOCK QUEUE ENTRY.
    120					;
    121					; INPUTS:
    122					;
    123					;	R0=ADDRESS OF THE CORE BLOCK TO BE DEALLOCATED.
    124					;
    125					; OUTPUTS:
    126					;
    127					;	THE CLOCK QUEUE ENTRY CORE BLOCK IS DEALLOCATED.
    128					;-
    129
    130	000062	012701 	000020 		$DECLK::MOV	#C.LGTH,R1	;PICK UP LENGTH OF CLOCK BLOCK
    131	000066	000410 				BR	$DEACB		;
    132
    133					;+
    134					; **-$ALPKT-ALLOCATE SEND OR I/O REQUEST CORE BLOCK
    135					;
    136					; THIS ROUTINE IS CALLED TO ALLOCATE A CORE BLOCK FOR A SEND OR I/O
    137					; REQUEST QUEUE ENTRY.
    138					;
    139					; INPUTS:
    140					;
    141					;	NONE.
    142					;
    143					; OUTPUTS:
    144					;
    145					;	IF INSUFFICIENT CORE IS AVAILABLE TO ALLOCATE THE BLOCK, THEN A
    146					;	DIRECTIVE STATUS OF 'D.RS1' IS RETURNED. ELSE THE ADDRESS OF
    147					;	THE ALLOCATED BLOCK IS RETURNED TO THE CALLER IN R0.
    148					;-
    149
    150	000070	012701 	000044 		$ALPKT::MOV	#I.LGTH,R1	;SET LENGTH OF I/O PACKET
    151	000074				10$:	CALL	$ALOCB		;ATTEMPT TO ALLOCATE BLOCK
    152	000100	103060 				BCC	80$		;IF CC SUCCESSFUL
    153	000102					DRSTS	D.RS1		;ALLOCATION FAILURE
    154
    155					;+
    156					; **-$DEPKT-DEALLOCATE SEND OR I/O REQUEST CORE BLOCK
    157					;
    158					; THIS ROUTINE IS CALLED TO DEALLOCATE A CORE BLOCK THAT WAS BEING USED
    159					; FOR A SEND OR I/O REQUEST QUEUE ENTRY.
    160					;
    161					; INPUTS:
    162					;
    163					;	R0=ADDRESS OF THE CORE BLOCK TO BE DEALLOCATED.
    164					;
    165					; OUTPUTS:
    166					;
    167					;	THE SEND OR I/O REQUEST QUEUE ENTRY CORE BLOCK IS DEALLOCATED.
    168					;-
    169
    170	000104	012701 	000044 		$DEPKT::MOV	#I.LGTH,R1	;SET LENGTH OF I/O PACKET
    171
CORAL	MACRO M1110  22-AUG-79 07:04  PAGE 3-3


    172					;+
    173					; **-$DEACB-DEALLOCATE CORE BUFFER
    174					; **-$DEAC1-DEALLOCATE CORE BUFFER (ALTERNATE ENTRY)
    175					;
    176					; THIS ROUTINE IS CALLED TO DEALLOCATE AN EXEC CORE BUFFER. THE BLOCK IS
    177					; INSERTED INTO THE FREE BLOCK CHAIN BY CORE ADDRESS. IF AN ADJACENT
    178					; BLOCK IS CURRENTLY FREE, THEN THE TWO BLOCKS ARE MERGED AND INSERTED
    179					; IN THE FREE BLOCK CHAIN.
    180					;
    181					; INPUTS:
    182					;
    183					;	R0=ADDRESS OF THE CORE BUFFER TO BE DEALLOCATED.
    184					;	R1=SIZE OF THE CORE BUFFER TO DEALLOCATE IN BYTES.
    185					;	R3=ADDRESS OF CORE ALLOCATION LISTHEAD-2 IF ENTRY AT $DEAC1.
    186					;
    187					; OUTPUTS:
    188					;
    189					;	THE CORE BLOCK IS MERGED INTO THE FREE CORE CHAIN BY CORE
    190					;	ADDRESS AND IS AGCOMERATED IF NECESSARY WITH ADJACENT BLOCKS.
    191					;-
    192
    193	000110	012703 	177776G		$DEACB::MOV	#$CRAVL-2,R3	;POINT TO ALLOCATION MASK WORD
    194
    195
    196						.IF DF	Q$$OPT
    197
    198						ADD	(R3),R1		;ROUND TO NEXT BOUNDARY
    199						BIC	(R3)+,R1	;
    200						BEQ	80$		;IF EQ NO BLOCK TO RELEASE
    201						CMP	R1,#I.LGTH	;LENGTH EQUAL TO I/O PACKET?
    202						BNE	30$		;IF NE NO
    203						MOV	#$PKMAX,R2	;PNT TO MAX # OF PACKETS TO PREALLOCATE
    204						CMPB	(R2),-(R2)	;MAX NUMBER PREALLOCATED?
    205						BLOS	30$		;IF LOS YES
    206						INC	(R2)		;INDICATE ONE MORE AVAILABLE
    207						MOV	-(R2),(R0)	;LINK PACKET INTO LIFO LIST
    208						MOV	R0,(R2)		;
    209						RETURN			;
    210
    211						.ENDC
    212
    213
    214	000114	061301 			$DEAC1::ADD	(R3),R1		;ROUND TO NEXT BOUNDARY
    215	000116	042301 				BIC	(R3)+,R1	;CLEAR EXCESS
    216	000120	001450 				BEQ	80$		;IF EQ NO BLOCK TO RELEASE
    217	000122				30$:				;REF LABEL
    218
    219
    220						.IF DF	R$$DER
    221
    222	000122	010346 				MOV	R3,-(SP)	;SAVE ADDRESS OF LISTHEAD
    223
    224						.IFTF
    225
    226	000124	010302 			40$:	MOV	R3,R2		;SAVE ADDRESS OF CURRENT BLOCK
    227	000126	011203 				MOV	(R2),R3		;GET ADDRESS OF NEXT BLOCK
    228	000130	001402 				BEQ	50$		;IF EQ END OF CHAIN
CORAL	MACRO M1110  22-AUG-79 07:04  PAGE 3-4


    229	000132	020003 				CMP	R0,R3		;BLOCK GO HERE?
    230	000134	103373 				BHIS	40$		;IF HIS NO
    231	000136	010310 			50$:	MOV	R3,(R0)		;ASSUME NO AGLOMERATION
    232	000140	010046 				MOV	R0,-(SP)	;CALCULATE ADDRESS OF NEW BLOCK
    233	000142	060116 				ADD	R1,(SP)		;
    234
    235						.IFT
    236
    237	000144	103441 				BCS	100$		;IF CS ILLEGAL DEALLOCATION
    238	000146	026627 	000002 	000000G		CMP	2(SP),#$CRAVL	;DEALLOCATION IN EXECUTIVE POOL?
    239	000154	001006 				BNE	55$		;IF NE NO
    240	000156	020027 	000000G			CMP	R0,#$POOL	;DEALLOCATION BEFORE FRONT OF LIST?
    241	000162	103432 				BLO	100$		;IF LO YES
    242	000164	021667 	000000G			CMP	(SP),$EXSIZ	;DEALLOCATION PAST END OF POOL?
    243	000170	101027 				BHI	100$		;IF HI YES
    244	000172				55$:				;REFERENCE LABEL
    245
    246						.IFTF
    247
    248	000172	020326 				CMP	R3,(SP)+	;EQUAL TO NEXT IN CHAIN?
    249
    250						.IFT
    251
    252	000174	103423 				BLO	90$		;IF LO, DEALLOCATION OVERLAPS
    253
    254						.IFTF
    255
    256	000176	001002 				BNE	60$		;IF NE NO
    257	000200	012310 				MOV	(R3)+,(R0)	;MOVE LINK WORD TO BLOCK RELEASED
    258	000202	061301 				ADD	(R3),R1		;MERGE TWO BLOCKS
    259	000204	010246 			60$:	MOV	R2,-(SP)	;SAVE ADDRESS OF PREVIOUS BLOCK
    260	000206	010022 				MOV	R0,(R2)+	;ASSUME NO AGLOMERATION
    261	000210	061216 				ADD	(R2),(SP)	;CALCULATE ADDRESS OF NEXT BLOCK
    262	000212	020026 				CMP	R0,(SP)+	;EQUAL TO BLOCK BEING RELEASED?
    263
    264						.IFT
    265
    266	000214	103003 				BHIS	65$		;IF HIS, NO OVERLAP
    267	000216	021627 	000000G			CMP	(SP),#$CRAVL	;DEALLOCATION IN EXECUTIVE CORE POOL?
    268	000222	001412 				BEQ	100$		;IF EQ YES (ELSE NOT SURE OF OVERLAP)
    269	000224				65$:				;REF LABEL
    270
    271						.IFTF
    272
    273	000224	001003 				BNE	70$		;IF NE NO
    274	000226	061201 				ADD	(R2),R1		;MERGE TWO BLOCKS
    275	000230	011042 				MOV	(R0),-(R2)	;MOVE LINK WORD TO PREVIOUS BLOCK
    276	000232	010200 				MOV	R2,R0		;SET NEW ADDRESS OF BLOCK
    277	000234	010160 	000002 		70$:	MOV	R1,2(R0)	;SET SIZE OF BLOCK RELEASED
    278
    279						.IFT
    280
    281	000240	005726 				TST	(SP)+		;POP ADDRESS OF LISTHEAD
    282
    283						.IFTF
    284
    285	000242				80$:	RETURN			;
CORAL	MACRO M1110  22-AUG-79 07:04  PAGE 3-5


    286
    287						.IFT
    288
    289	000244	005703 			90$:	TST	R3		;INSERT AT END OF LIST?
    290	000246	001756 				BEQ	60$		;IF EQ YES, OK
    291	000250				100$:	CRASH			;CRASH SYSTEM, BAD CORE DEALLOCATION
    292
    293						.ENDC
    294
    295
    296						.DSABL	LSB
    297
    298		000001 				.END
CORAL	MACRO M1110  22-AUG-79 07:04  PAGE 3-6
SYMBOL TABLE

A$$CHK= 000000   	C.LNK   000000   	H$$RTZ= 000074   	K$$IEN= 000115   	R$$11S= 000000
A$$CPS= 000000   	C.MRKT= 000000   	I$$RDN= 000000   	K$$LDC= 000001   	S$$YSZ= 001740
A$$TRP= 000000   	C.RQT   000002   	I.AST   000022   	K$$TPS= 000074   	V$$CTR= 001200
A.AST   000006   	C.RSI   000012   	I.ATTL= 000044   	L$$ASG= 000000   	V$$RSN= 000031
A.BYT   000004   	C.SCHD= 000002   	I.EFN   000003   	L$$DRV= 000000   	X$$DBT= 000000
A.CBL   000002   	C.SRC   000014   	I.FCN   000012   	M$$CRB= 000124   	$ALCLK  000054RG
A.DQSR  177776   	C.SSHT= 000004   	I.IOSB  000014   	M$$MGE= 000000   	$ALOCB  000000RG
A.KSR5  177774   	C.SUB   000012   	I.LGTH= 000044   	M$$NET= 000000   	$ALOC1  000004RG
A.NPR   000010   	C.SYST= 000006   	I.LNK   000000   	M$$NT2= 000000   	$ALPKT  000070RG
A.PRM   000012   	C.SYTK= 000010   	I.LN2   000006   	N$$LDV= 000001   	$CRAVL= ****** GX
C$$ORE= 002000   	C.TCB   000004   	I.PRI   000002   	P$$RTY= 000000   	$DEACB  000110RG
C.AR5   000014   	C.TIM   000006   	I.PRM   000024   	P$$TPT= 000000   	$DEAC1  000114RG
C.AST   000012   	C.UIC   000016   	I.TCB   000004   	R$$DER= 000000   	$DECLK  000062RG
C.CSTP= 000012   	D.RS1 = ****** GX	I.UCB   000010   	R$$EXV= 000000   	$DEPKT  000104RG
C.DST   000016   	G$$TPP= 000000   	K$$CNT= 177546   	R$$SND= 000000   	$EXSIZ= ****** GX
C.EFN   000003   	G$$TTK= 000000   	K$$CSR= 177546   	R$$11M= 000000   	$POOL = ****** GX
C.LGTH= 000020

. ABS.	177776	   000
      	000252	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1997 WORDS  ( 8 PAGES)
DYNAMIC MEMORY:  2980 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[11,24]CORAL,SY0:[11,34]CORAL/-SP=[1,1]EXEMC/ML,[11,10]RSXMC/PA:1,CORAL