Google
 

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


      1						.TITLE	DREIF
      2						.IDENT	/09/
      3
      4					;
      5					; COPYRIGHT (C) 1974, 1978
      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 09
     12					;
     13					; D. N. CUTLER 13-SEP-73
     14					;
     15					; PREVIOUSLY MODIFIED BY:
     16					;
     17					;	D. N. CUTLER
     18					;	T. J. MILLER
     19					;
     20					; MODIFIED BY:
     21					;
     22					;	T. J. MILLER 7-DEC-76
     23					;
     24					;		TM069 -- ADDITION OF CHECK FOR OUTSTANDING TERMINAL I/O.
     25					;
     26					;	T. J. MILLER 25-JAN-77
     27					;
     28					;		TM074 -- CORRECT BUG IN I/O RUNDOWN.
     29					;
     30					;	T. J. MILLER 21-APR-77
     31					;
     32					;		TM077 -- DEALLOCATE RECEIVE BY REFERENCE AST BLOCK.
     33					;
     34					;	T. J. MILLER 6-JUN-77
     35					;
     36					;		TM088 -- CLEAN UP CONNECT TO INTERRUPT ITB'S ON TASK
     37					;			EXIT.
     38					;
     39					;	T. J. MILLER 21-JUL-77
     40					;
     41					;		TM096 -- FIX BUG RELATING TO THE RELEASE OF MEMORY IN
     42					;			PLAS SYSTEMS.
     43					;
     44					;	T. J. MILLER 5-OCT-77
     45					;
     46					;		TM113 -- DEALLOCATE TASK PCB ON LOAD FAILURE IN PLAS
     47					;			SYSTEM.
     48					;
     49					; EXIT DIRECTIVES
     50					;
     51					; MACRO LIBRARY CALLS
     52					;
     53
     54						.MCALL	ABODF$,HDRDF$,PCBDF$,PKTDF$,TCBDF$
     55	000000					ABODF$			;DEFINE TASK ABORT CODES
     56	000000					HDRDF$			;DEFINE TASK HEADER OFFSETS
     57	000000					PCBDF$			;DEFINE PARTITION CONTROL BLOCK OFFSETS
DREIF	MACRO M1110  22-AUG-79 06:58  PAGE 3-1


     58	000000					PKTDF$			;DEFINE I/O PACKET OFFSETS
     59	000000					TCBDF$			;DEFINE TASK CONTROL BLOCK OFFSETS
     60
     61					;
     62					; LOCAL SYMBOL DEFINITION
     63					;
     64
     65		150700 			CLRMSK=T2.AST!T2.DST!T2.CKD!T2.HLT!T2.ABO!T2.CAF
     66		150777 			CLRMSK=CLRMSK!<<T2.STP!T2.SPN!T2.WFR>*2>!T2.STP!T2.SPN!T2.WFR
     67
     68					;+
     69					; **-$DREIF-EXIT IF
     70					;
     71					; THIS DIRECTIVE INSTRUCTS THE SYSTEM TO TERMINATE THE EXECUTION OF THE
     72					; ISSUING TASK IF, AND ONLY IF, AN INDICATED EVENT FLAG IS CLEAR.
     73					;
     74					; DPB FORMAT:
     75					;
     76					;	WD. 00 -- DIC(53.),DPB SIZE(2.).
     77					;	WD. 01 -- EVENT FLAG NUMBER OF EVENT FLAG THAT MUST BE CLEAR.
     78					;
     79					; INPUTS:
     80					;
     81					;	R0=EVENT FLAG MASK WORD.
     82					;	R1=EVENT FLAG MASK ADDRESS.
     83					;	R2=ADDRESS OF THE TASK STATUS WORD OF THE CURRENT TASK.
     84					;	R3=ADDRESS OF THE LAST WORD IN THE DPB+2.
     85					;	R4=ADDRESS OF THE HEADER OF THE CURRENT TASK.
     86					;	R5=ADDRESS OF THE TCB OF THE CURRENT TASK.
     87					;
     88					; OUTPUTS: (DIRECTIVE STATUS AND PS RETURNED TO TASK)
     89					;
     90					;	C=0 IF DIRECTIVE IS SUCCESSFULLY COMPLETED.
     91					;		DIRECTIVE STATUS OF 'D.RS22' IS RETURNED IF THE SPECIFIED
     92					;			EVENT FLAG IS SET.
     93					;	C=1 IF DIRECTIVE IS REJECTED.
     94					;		DIRECTIVE STATUS OF 'D.RS97' IF NO OR AN INVALID EVENT
     95					;			FLAG NUMBER IS SPECIFIED.
     96					;-
     97
     98	000000	030011 			$DREIF::BIT	R0,(R1)		;EVENT FLAG CLEAR?
     99	000002	001401 				BEQ	$DREXT		;IF EQ YES
    100	000004					DRSTS	D.RS22		;SET DIRECTIVE STATUS
    101
    102					;+
    103					; **-$DREXT-EXIT
    104					;
    105					; THIS DIRECTIVE INSTRUCTS THE SYSTEM TO TERMINATE THE EXECUTION OF THE
    106					; ISSUING TASK.
    107					;
    108					; DPB FORMAT:
    109					;
    110					;	WD. 00 -- DIC(51.),DPB SIZE(1.).
    111					;
    112					; INPUTS:
    113					;
    114					;	R2=ADDRESS OF THE TASK STATUS WORD OF THE CURRENT TASK.
DREIF	MACRO M1110  22-AUG-79 06:58  PAGE 3-2


    115					;	R3=ADDRESS OF THE LAST WORD IN THE DPB+2.
    116					;	R4=ADDRESS OF THE HEADER OF THE CURRENT TASK.
    117					;	R5=ADDRESS OF THE TCB OF THE CURRENT TASK.
    118					;
    119					;	NOTE: THIS DIRECTIVE IS ALSO CALLED FROM THE DISPATCHER AND
    120					;		THEREFORE ONLY REQUIRES R5 TO BE LOADED ON ENTRANCE.
    121					;
    122					; OUTPUTS: (DIRECTIVE STATUS AND PS RETURNED TO TASK)
    123					;
    124					;	NO STATUS IS RETURNED TO THE ISSUING TASK SINCE THIS DIRECTIVE
    125					;	TERMINATES ITS EXECUTION.
    126					;-
    127
    128	000006				$DREXT::CALL	$DRCMT		;CANCEL MARK TIME REQUESTS
    129					 									; TM088
    130					 									; TM088
    131						.IF DF	C$$INT							; TM088
    132					 									; TM088
    133						BIT	#T2.CKD,T.ST2(R5) ;DOES TASK POSSIBLY HAVE ANY ITB'S?	; TM088
    134						BEQ	2$		;IF EQ NO				; TM088
    135					1$:	MOV	T.CPCB(R5),R1	;PICK UP NEXT ITB POINTER		; TM088
    136						BEQ	2$		;IF EQ NONE LEFT			; TM088
    137						CALL	$DISIN		;DISCONNECT INTERRUPT VECTOR		; TM088
    138						BR	1$		;					; TM088
    139					2$:				;REF LABEL				; TM088
    140					 									; TM088
    141						.ENDC								; TM088
    142
    143
    144						.IF DF	M$$CRX
    145
    146						CALL	$RLMCB		;RELEASE MCR COMMAND BUFFER
    147
    148						.ENDC
    149
    150
    151	000012	020567 	000000G			CMP	R5,$LSTLK	;TASK OWN MCR DATA BASE LOCK?
    152	000016	001002 				BNE	3$		;IF NE NO				; TM088
    153	000020	005067 	000000G			CLR	$LSTLK		;CLEAR OWNER TCB ADDRESS		;**-1
    154	000024	052765 	000200 	000034 	3$:	BIS	#T2.HLT,T.ST2(R5) ;SET TO HALT TASK			; TM088
    155														;**-1
    156
    157						.IF DF	A$$TRP&F$$LPP
    158
    159						MOV	#H.FPVA,R4	;SET OFFSET TO AST CONTROL BLOCK IN HEADER
    160						CALL	$DASTT		;DECLARE FLOATING POINT AST
    161
    162						.ENDC
    163
    164
    165						.IF DF	A$$TRP&P$$RFL
    166
    167						MOV	#H.PFVA,R4	;SET OFFSET TO AST CONTROL BLOCK IN HEADER
    168						CALL	$DASTT		;DECLARE POWERFAIL AST
    169
    170						.ENDC
    171
DREIF	MACRO M1110  22-AUG-79 06:58  PAGE 3-3


    172
    173						.IF DF	A$$TRP&R$$SND
    174
    175	000032	012704 	000036 			MOV	#H.RCVA,R4	;SET OFFSET TO AST CONTROL BLOCK IN HEADER
    176	000036					CALL	$DASTT		;DECLARE RECEIVE AST
    177
    178						.ENDC
    179
    180
    181						.IF DF	A$$TRP&P$$LAS&P$$SRF					; TM077
    182					 									; TM077
    183						MOV	#H.RRVA,R4	;SET OFFSET TO AST CONTROL BLOCK	; TM077
    184						CALL	$DASTT		;DECLARE RECEIVE BY REFERENCE AST	; TM077
    185					 									; TM077
    186						.ENDC								; TM077
    187					 									; TM077
    188					 									; TM077
    189						.IF DF	A$$TRP!T$$BUF
    190
    191	000042	004567 	000332 			JSR	R5,MTQUE	;EMPTY AST QUEUE
    192	000046	000016 				.WORD	T.ASTL		;OFFSET TO AST QUEUE LISTHEAD
    193	000050	000000G				.WORD	$DEACB		;ADDRESS OF DEALLOCATION ROUTINE
    194
    195						.ENDC
    196
    197
    198						.IF DF	R$$SND
    199
    200	000052	032765 	100200 	000036 		BIT	#T3.NSD!T3.ACP,T.ST3(R5) ;FLUSH RECEIVE QUEUE?
    201	000060	001004 				BNE	4$		;IF NE NO
    202	000062	004567 	000312 			JSR	R5,MTQUE	;EMPTY RECEIVE QUEUE
    203	000066	000012 				.WORD	T.RCVL		;OFFSET TO RECEIVE QUEUE LISTHEAD
    204	000070	000000G				.WORD	$DEPKT		;ADDRESS OF DEALLOCATION ROUTINE
    205	000072				4$:				;REF LABEL
    206
    207						.ENDC
    208
    209
    210						.IF DF	P$$LAS&P$$SRF
    211
    212						JSR	R5,MTQUE	;EMPTY RECEIVE BY REFERENCE QUEUE
    213						.WORD	T.RRFL		;OFFSET TO RECEIVE BY REF LISTHEAD
    214						.WORD	$DEPKT		;ADDRESS OF DEALLOCATION ROUTINE
    215
    216						.ENDC
    217
    218
    219						.IF DF	I$$RAR!I$$RDN!M$$MGE
    220
    221	000072	012746 	000440'		5$:	MOV	#SCNLN,-(SP)	;SET ADDRESS OF LUT SCANNING CO-ROUTINE
    222	000076	105765 	000003 			TSTB	T.IOC(R5)	;ANY I/O OUTSTANDING?
    223
    224
    225						.IF DF	T$$BUF
    226
    227						BNE	6$		;IF NE YES
    228						BIT	#T2.TIO,T.ST2(R5) ;OUTSTANDING TERMINAL I/O?
DREIF	MACRO M1110  22-AUG-79 06:58  PAGE 3-4


    229
    230						.ENDC
    231
    232
    233	000102	001416 				BEQ	30$		;IF EQ NO
    234	000104	032765 	000100 	000034 	6$:	BIT	#T2.ABO,T.ST2(R5) ;TASK ALREADY MARKED FOR ABORT?
    235	000112	001004 				BNE	10$		;IF NE YES
    236	000114	012700 	000032 			MOV	#S.IOMG,R0	;SET REASON FOR ABORT
    237	000120					CALL	$ABCTK		;ABORT CURRENT TASK
    238	000124	011646 			10$:	MOV	(SP),-(SP)	;DUPLICATE ADDRESS OF LUT SCANNING CO-ROUTINE
    239	000126				20$:	CALL	@(SP)+		;GET NEXT ASSIGNED LUN
    240	000130	103403 				BCS	30$		;IF CS END OF LOGICAL UNIT TABLE
    241	000132					CALL	$IOKIL		;KILL I/O ON UNIT FOR CURRENT TASK
    242	000136	000773 				BR	20$		;GO AGAIN
    243	000140				30$:	CALL	@(SP)+		;GET NEXT ASSIGNED LUN
    244	000142	103473 				BCS	100$		;IF CS END OF LOGICAL UNIT TABLE
    245	000144	026765 	000000G	000000G		CMP	$TKTCB,U.ATT(R5) ;UNIT ATTACHED TO CURRENT TASK?
    246	000152	001003 				BNE	40$		;IF NE NO
    247	000154	012704 	000000G			MOV	#IO.DET,R4	;SET DETACH I/O FUNCTION
    248	000160	000406 				BR	50$		;
    249	000162	011102 			40$:	MOV	(R1),R2		;FILE OPEN ON UNIT?
    250	000164	001765 				BEQ	30$		;IF EQ NO
    251	000166	006202 				ASR	R2		;ACCESS OR DEACCESS PENDING?
    252	000170	103763 				BCS	30$		;IF CS YES
    253	000172	012704 	000000G			MOV	#IO.CLN,R4	;SET CLOSE LUN I/O FUNCTION
    254	000176	022626 			50$:	CMP	(SP)+,(SP)+	;CLEAN STACK
    255	000200	010146 				MOV	R1,-(SP)	;SAVE ADDRESS OF SECOND LUN WORD
    256	000202	012701 	000044 			MOV	#I.LGTH,R1	;SET LENGTH OF BLOCK NEEDED
    257	000206					CALL	$ALOCB		;ALLOCATE I/O PACKET
    258	000212	012603 				MOV	(SP)+,R3	;RETRIEVE ADDRESS OF SECOND LUN WORD
    259	000214	103444 				BCS	90$		;IF CS NO CORE AVAILABLE
    260	000216	010001 				MOV	R0,R1		;COPY ADDRESS OF I/O PACKET
    261	000220	005720 				TST	(R0)+		;POINT TO SECOND WORD
    262	000222	016702 	000000G			MOV	$TKTCB,R2	;GET ADDRESS OF TCB OF CURRENT TASK
    263	000226	116246 	000003 			MOVB	T.IOC(R2),-(SP)	;SAVE CURRENT I/O COUNT			; TM074
    264	000232	105262 	000003 			INCB	T.IOC(R2)	;INCREMENT OUTSTANDING I/O COUNT
    265	000236	116220 	000002 			MOVB	T.PRI(R2),(R0)+	;SET REQUEST PRIORITY
    266	000242	105020 				CLRB	(R0)+		;CLEAR EVENT FLAG NUMBER
    267	000244	010220 				MOV	R2,(R0)+	;INSERT CURRENT TASK TCB ADDRESS
    268	000246	010320 				MOV	R3,(R0)+	;INSERT ADDRESS OF SECOND LUN WORD
    269	000250	010520 				MOV	R5,(R0)+	;INSERT UCB ADDRESS
    270	000252	010420 				MOV	R4,(R0)+	;INSERT I/O FUNCTION CODE
    271	000254	022704 	000000G			CMP	#IO.CLN,R4	;CLOSE LUN I/O FUNCTION?
    272	000260	001003 				BNE	60$		;IF NE NO
    273	000262	005275 	000000G			INC	@U.VCB(R5)	;INCREMENT VOLUME TRANSACTION COUNT
    274	000266	005213 				INC	(R3)		;INTERLOCK LUN USAGE
    275	000270	012702 	000014 		60$:	MOV	#12.,R2		;SET LOOP COUNT
    276	000274	005020 			70$:	CLR	(R0)+		;CLEAR REMAINDER OF I/O PACKET
    277	000276	005302 				DEC	R2		;ANY MORE TO CLEAR?
    278	000300	003375 				BGT	70$		;IF GT YES
    279	000302					CALL	$DRQRQ		;QUEUE I/O REQUEST
    280	000306	016705 	000000G			MOV	$TKTCB,R5	;GET ADDRESS OF TCB OF CURRENT TASK
    281	000312	126526 	000003 			CMPB	T.IOC(R5),(SP)+	;REQUEST ALREADY FINISHED?		; TM074
    282	000316	001665 				BEQ	5$		;IF EQ YES				;**-1
    283	000320	052765 	040000 	000032 	80$:	BIS	#TS.RDN,T.STAT(R5) ;SET I/O RUNDOWN IN PROGRESS
    284	000326				90$:	CALLR	$TKWSE		;WAITFOR SIGNIFICANT EVENT
    285	000332	105765 	000003 		100$:	TSTB	T.IOC(R5)	;ANY I/O STILL OUTSTANDING?
DREIF	MACRO M1110  22-AUG-79 06:58  PAGE 3-5


    286	000336	001370 				BNE	80$		;IF NE YES
    287
    288					 									; TM069
    289						.IF DF	T$$BUF							; TM069
    290					 									; TM069
    291						BIT	#T2.TIO,T.ST2(R5) ;OUTSTANDING TERMINAL I/O?		; TM069
    292						BNE	80$		;IF NE YES				; TM069
    293					 									; TM069
    294						.ENDC								; TM069
    295					 									; TM069
    296					 									; TM069
    297						.ENDC
    298
    299
    300	000340	062705 	000034 			ADD	#T.ST2,R5	;POINT TO SECOND TASK STATUS WORD
    301
    302
    303						.IF DF	T$$KMG
    304
    305						BIT	#T2.ABO,(R5)	;TASK MARKED FOR ABORT?
    306						BEQ	110$		;IF EQ NO
    307						MOV	$TKNPT,R0	;GET TERMINATION NOTIFICATION TCB ADDRESS
    308						BEQ	110$		;IF EQ NOT IN SYSTEM
    309						CMP	$TKTCB,R0	;TERMINATION NOTIFICATION TASK BEING TERMINATED?
    310						BEQ	103$		;IF EQ YES
    311						BIS	#TS.MSG,-(R5)	;SET ABORT MESSAGE IN PROGRESS
    312						CALL	$EXRQN		;REQUEST TERMINATION NOTIFICATION TASK
    313						CALLR	$TKWSE		;WAITFOR SIGNIFICANT EVENT
    314					103$:	MOV	$ACTHD,R0	;GET ADDRESS OF FIRST TCB
    315					107$:	BIC	#TS.MSG,T.STAT(R0) ;CLEAR WAITING FOR MESSAGE
    316						BIC	#T2.ABO,T.ST2(R0) ;CLEAR MARKED FOR ABORT
    317						MOV	T.ACTL(R0),R0	;GET ADDRESS OF NEXT TCB
    318						TST	T.ACTL(R0)	;NULL TASK?				; TM096
    319						BNE	107$		;IF NE MORE TO GO
    320					110$:				;REF LABEL
    321
    322						.ENDC
    323
    324
    325						.IF DF	I$$RAR
    326
    327						BIT	#T3.REM,2(R5)	;REMOVE TASK AT EXIT?
    328						BEQ	120$		;IF EQ NO
    329						MOV	#M$$CRB,R1	;SET LENGTH OF BLOCK NEEDED
    330						CALL	$ALOCB		;ALLOCATE CORE BLOCK
    331						BCS	90$		;IF CS WAITFOR SIGNIFICANT EVENT
    332						MOV	R0,-(SP)	;SAVE ADDRESS OF CORE BLOCK
    333						TST	(R0)+		;POINT TO SECOND WORD IN BLOCK
    334						MOV	T.UCB-T.ST2(R5),(R0)+ ;INSERT TI UCB ADDRESS
    335						MOV	(PC)+,(R0)+	;INSERT REMOVE COMMAND
    336						.ASCII	/RE/		;
    337						MOV	(PC)+,(R0)+	;
    338						.ASCII	/M /		;
    339						MOV	T.NAM-T.ST2(R5),R1 ;GET FIRST HALF OF TASK NAME
    340						CALL	$C5TA		;CONVERT TO ASCII
    341						MOV	T.NAM+2-T.ST2(R5),R1 ;GET SECOND HALF OF TASK NAME
    342						CALL	$C5TA		;CONVERT TO ASCII
DREIF	MACRO M1110  22-AUG-79 06:58  PAGE 3-6


    343						MOVB	#33,(R0)	;INSERT ALTMODE AS TERMINAL BYTE
    344						MOV	(SP)+,R1	;RETRIEVE ADDRESS OF CORE BLOCK
    345						CALL	$QMCRL		;QUEUE MCR COMMAND LINE
    346
    347						.ENDC
    348
    349
    350	000344	052745 	100000 		120$:	BIS	#TS.EXE,-(R5)	;DEACTIVATE TASK
    351	000350	042725 	020100 			BIC	#TS.CKR!TS.MSG,(R5)+ ;CLEAR STATUS BITS
    352	000354	042715 	150777 			BIC	#CLRMSK,(R5)	;
    353
    354
    355						.IF DF	A$$PRI
    356
    357						MOVB	T.DPRI-T.ST2(R5),T.PRI-T.ST2(R5) ;RESTORE TASK PRIORITY
    358
    359						.ENDC
    360
    361
    362						.IF DF	D$$ISK
    363
    364						BIT	#T2.FXD,(R5)+	;TASK FIXED IN MEMORY?
    365						BNE	130$		;IF NE YES
    366						BIS	#TS.OUT,-4(R5)	;SET TASK OUT OF MEMORY
    367
    368
    369						.IF DF	P$$LAS
    370
    371						MOV	T.PCB-T.ST3(R5),R0 ;POINT TO TASK PCB			; TM096
    372						MOV	R0,-(SP)	;SAVE CURRENT PCB POINTER		; TM096
    373						BIT	#PS.SYS,P.STAT(R0) ;IS IT A SYSTEM CONTROLLED PARTITION?; TM096
    374						BEQ	124$		;IF EQ NO				; TM096
    375						MOV	P.MAIN(R0),(SP)	;POINT BACK TO MAIN PCB			; TM096
    376					124$:	MOV	R5,-(SP)	;SAVE ADDRESS OF THIRD STATUS WORD	; TM096
    377						TST	T.ATT-T.ST3(R5)	;ATTACH QUEUE EMPTY (IF EQ LOAD FAILURE);**-1
    378						BNE	125$		;IF NE NO
    379						MOV	R5,R0		;COPY TCB POINTER
    380						SUB	#T.ST3,R0	;POINT TO START OF TCB
    381						CALL	$RLPAR		;RELEASE TASK PARTITION
    382						MOV	T.PCB-T.ST3(R5),R0 ;PICK UP TASK PCB ADDRESS		; TM113
    383						BIT	#PS.SYS,P.STAT(R0) ;SYSTEM CONTROLLED PARTITION?	; TM113
    384						BEQ	125$		;IF EQ NO				; TM113
    385						MOV	#P.LGTH,R1	;SET SIZE TO RELEASE			; TM113
    386						CALL	$DEACB		;DEALLOCATE TASK PCB			; TM113
    387					125$:	MOV	(SP),R5		;PICK UP ADDRESS OF THIRD STATUS WORD
    388						MOV	T.ATT-T.ST3(R5),R5 ;POINT TO NEXT ATTACHMENT DESCRIPTOR
    389						BEQ	126$		;IF EQ THERE IS NONE
    390						SUB	#A.TCBL,R5	;POINT TO START OF ATTACHMENT DESCRIPTOR
    391						CALL	$DETRG		;DETACH THE REGION
    392						BR	125$		;
    393					126$:	MOV	(SP)+,R5	;RESTORE ADDRESS OF THIRD STATUS WORD
    394						MOV	(SP)+,T.PCB-T.ST3(R5) ;RESET TASK PCB ADDRESS		; TM096
    395
    396						.ENDC
    397
    398
    399						.IF DF	M$$MGE
DREIF	MACRO M1110  22-AUG-79 06:58  PAGE 3-7


    400
    401						MOV	R4,R0		;SET ADDRESS OF TASK HEADER
    402						MOV	H.HDLN(R0),R1	;GET LENGTH OF HEADER IN BYTES
    403						CALL	$DEACB		;DEALLOCATE HEADER
    404
    405						.ENDC
    406
    407
    408						MOV	$TKTCB,R0	;SET ADDRESS OF TASK TCB
    409
    410
    411						.IF NDF	P$$LAS							; TM096
    412					 									; TM096
    413					 									; TM096
    414						.IF DF	D$$YNM&M$$MGE
    415
    416						MOV	T.PCB(R0),R4	;SAVE ADDRESS OF TASK PCB
    417
    418						.IFTF
    419						CALL	$RLPAR		;RELEASE TASK PARTITION			;**-4
    420
    421						.IFT								;**-3
    422
    423						BIT	#PS.SYS,P.STAT(R4) ;SYSTEM CONTROLLED PARTITION?
    424						BEQ	130$		;IF EQ NO
    425						MOV	$TKTCB,R0	;RETRIEVE ADDRESS OF TCB
    426						MOV	P.MAIN(R4),T.PCB(R0) ;RESET TASK PCB POINTER
    427						MOV	R4,R0		;SET ADDRESS OF BLOCK TO RELEASE	;**-4
    428						MOV	#P.LGTH,R1	;SET LENGTH OF BLOCK TO RELEASE
    429						CALL	$DEACB		;DEALLOCATE PARTITION CONTROL BLOCK
    430
    431						.ENDC
    432
    433
    434						.ENDC
    435
    436
    437					130$:				;REFERENCE LABEL
    438
    439						.ENDC
    440
    441
    442	000360	005067 	000000G			CLR	$HEADR		;DO NOT SAVE CONTEXT OF CURRENT TASK
    443	000364	016700 	000000G			MOV	$TKTCB,R0	;GET ADDRESS OF CURRENT TCB
    444	000370					CALL	$ACTRM		;REMOVE TCB FROM THE ATL QUEUE
    445
    446
    447						.IF DF	M$$CRX
    448
    449						BIT	#T3.MCR,(R5)	;MCR EXTERNAL FUNCTION TASK?
    450						BEQ	140$		;IF EQ NO
    451						BIC	#T3.MCR,(R5)	;CLEAR MCR FUNCTION FLAG
    452						MOV	#4,R1		;SET SIZE OF BLOCK REQUIRED
    453						CALL	$ALOCB		;ALLOCATE CORE BLOCK
    454						BCS	140$		;IF CS ALLOCATION FAILURE
    455						MOV	R0,R1		;COPY ADDRESS OF BLOCK
    456						TST	(R0)+		;POINT TO SECOND WORD OF BLOCK
DREIF	MACRO M1110  22-AUG-79 06:58  PAGE 3-8


    457						MOV	T.UCB-T.ST3(R5),(R0) ;INSERT TI UCB ADDRESS
    458						INC	(R0)		;SET FLAG TO SIGNIFY MCR PROMPT
    459						CALL	$QMCRL		;QUEUE MCR COMMAND LINE
    460
    461						.ENDC
    462
    463
    464	000374				140$:	CALLR	$DRDSE		;DECLARE SIGNIFICANT EVENT
    465
    466					;
    467					; SUBROUTINE TO EMPTY QUEUE
    468					;
    469
    470
    471						.IF DF	A$$TRP!R$$SND!T$$BUF
    472
    473	000400	012504 			MTQUE:	MOV	(R5)+,R4	;GET OFFSET TO QUEUE LISTHEAD
    474	000402	061604 				ADD	(SP),R4		;CALCULATE ADDRESS OF QUEUE LISTHEAD
    475	000404	005725 			10$:	TST	(R5)+		;ADVANCE TO RETURN ADDRESS
    476	000406	010400 			13$:	MOV	R4,R0		;SET ADDRESS OF LISTHEAD
    477	000410					CALL	$QRMVF		;REMOVE AN ENTRY FROM QUEUE
    478	000414	103410 				BCS	40$		;IF CS NO ENTRIES LEFT
    479	000416	010100 				MOV	R1,R0		;SET ADDRESS OF BLOCK TO DEALLOCATE
    480	000420	116001 	000002 			MOVB	2(R0),R1	;SET LENGTH OF BLOCK (FOR AST'S ONLY)
    481	000424	003002 				BGT	20$		;IF GT LENGTH SPECIFIED (AST'S ONLY)
    482
    483
    484						.IF DF	C$$CKP&T$$BUF
    485
    486						BEQ	17$		;IF EQ NOT BUFFERED I/O
    487						CMP	#T.ASTL,-4(R5)	;PROCESSING AST QUEUE?
    488						BEQ	30$		;IF EQ YES
    489
    490						.IFTF
    491
    492	000426	012701 	000020 		17$:	MOV	#8.*2,R1	;SET SIZE OF BLOCK TO RELEASE
    493	000432				20$:	CALL	@-(R5)		;DEALLOCATE CORE BLOCK
    494	000434	000763 				BR	10$		;GO AGAIN
    495
    496						.IFT
    497
    498					30$:	CALL	$FINBF		;FINISH BUFFERED I/O
    499						BR	13$		;
    500
    501						.ENDC
    502
    503
    504	000436	000205 			40$:	RTS	R5		;
    505
    506						.ENDC
    507
    508
    509					;
    510					; CO-ROUTINE TO SCAN LOGICAL UNIT TABLE
    511					;
    512
    513
DREIF	MACRO M1110  22-AUG-79 06:58  PAGE 3-9


    514						.IF DF	I$$RAR!I$$RDN!M$$MGE
    515
    516	000440	011603 			SCNLN:	MOV	(SP),R3		;SAVE RETURN ADDRESS
    517	000442	005016 				CLR	(SP)		;START AT LUN ZERO
    518	000444	016705 	000000G		10$:	MOV	$TKTCB,R5	;GET ADDRESS OF CURRENT TASK TCB
    519	000450	016704 	000000G			MOV	$HEADR,R4	;GET ADDRESS OF HEADER OF CURRENT TASK
    520	000454	011601 			20$:	MOV	(SP),R1		;GET NEXT LUN NUMBER
    521	000456	005216 				INC	(SP)		;INCREMENT LUN NUMBER
    522	000460	026416 	000074 			CMP	H.NLUN(R4),(SP)	;END OF LUT?
    523	000464	103407 				BLO	30$		;IF LO YES
    524	000466					CALL	$MPLNE		;MAP LUN NUMBER TO UCB ADDRESS
    525	000472	103770 				BCS	20$		;IF CS NO DEVICE ASSIGNED TO LUN
    526	000474	010005 				MOV	R0,R5		;COPY UCB ADDRESS
    527	000476					CALL	(R3)		;CALL THE CALLER BACK
    528	000500	012603 				MOV	(SP)+,R3	;RETRIEVE RETURN ADDRESS
    529	000502	000760 				BR	10$		;GO AGAIN
    530	000504	010316 			30$:	MOV	R3,(SP)		;SET RETURN ADDRESS
    531	000506					RETURN			;
    532
    533						.ENDC
    534
    535
    536		000001 				.END
DREIF	MACRO M1110  22-AUG-79 06:58  PAGE 3-10
SYMBOL TABLE

AS.DEL= 000010   	H.ODVL  000024   	PS.NSF= 000400   	TS.EXE= 100000   	T2.TIO= 001000
AS.EXT= 000004   	H.OVLY  000054   	PS.OUT= 100000   	TS.MSG= 020000   	T2.WFR= 000001
AS.RED= 000001   	H.PFVA  000032   	PS.PER= 002000   	TS.NRP= 010000   	T3.ACP= 100000
AS.WRT= 000002   	H.RCVA  000036   	PS.PIC= 000100   	TS.OUT= 000400   	T3.CAL= 000100
A$$CHK= 000000   	H.RRVA  000062   	PS.SYS= 000040   	TS.RDN= 040000   	T3.CLI= 001000
A$$CPS= 000000   	H.SPRI  000060   	P$$RTY= 000000   	TS.RUN= 004000   	T3.MCR= 004000
A$$TRP= 000000   	H.TKVA  000026   	P$$TPT= 000000   	T.ACTL  000052   	T3.NET= 000020
A.AST   000006   	H.TKVL  000030   	P.BLKS  000016   	T.ASTL  000016   	T3.NSD= 000200
A.BYT   000004   	H.VEXT  000056   	P.BUSY  000024   	T.ATT   000054   	T3.PMD= 040000
A.CBL   000002   	H.WND   000044   	P.IOC   000003   	T.CPCB  000004   	T3.PRV= 010000
A.DQSR  177776   	IO.CLN= ****** GX	P.LNK   000000   	T.DPRI  000040   	T3.REM= 020000
A.IOC   000003   	IO.DET= ****** GX	P.MAIN  000012   	T.EFLG  000022   	T3.ROV= 000040
A.KSR5  177774   	I$$RDN= 000000   	P.NAM   000004   	T.IOC   000003   	T3.RST= 000400
A.LGTH= 000014   	I.AST   000022   	P.OWN   000026   	T.LBN   000041   	T3.SLV= 002000
A.MPCT  000011   	I.ATTL= 000044   	P.PRI   000002   	T.LDV   000044   	U.ATT = ****** GX
A.NPR   000010   	I.EFN   000003   	P.REL   000014   	T.LNK   000000   	U.VCB = ****** GX
A.PCB   000012   	I.FCN   000012   	P.SIZE  000016   	T.MXSZ  000050   	V$$CTR= 001200
A.PCBL  000000   	I.IOSB  000014   	P.STAT  000030   	T.NAM   000006   	V$$RSN= 000031
A.PRI   000002   	I.LGTH= 000044   	P.SUB   000010   	T.NCRE= 000006   	W.BATT  000006
A.PRM   000012   	I.LNK   000000   	P.SWSZ  000022   	T.NCWF= 000004   	W.BFPD  000014
A.STAT  000010   	I.LN2   000006   	P.TCB   000026   	T.NDMO= 000010   	W.BHVR  000004
A.TCB   000004   	I.PRI   000002   	P.WAIT  000020   	T.NDNR= 000000   	W.BLGH  000020
A.TCBL  000006   	I.PRM   000024   	R$$DER= 000000   	T.NDSE= 000002   	W.BLPD  000016
CLRMSK= 150777   	I.TCB   000004   	R$$EXV= 000000   	T.NLDN= 000014   	W.BLVR  000002
C$$ORE= 002000   	I.UCB   000010   	R$$SND= 000000   	T.NLUP= 000016   	W.BNPD  000015
D.RS22= ****** GX	K$$CNT= 177546   	R$$11M= 000000   	T.OFF   000060   	W.BOFF  000012
G$$TPP= 000000   	K$$CSR= 177546   	R$$11S= 000000   	T.PCB   000046   	W.BPCB  000000
G$$TTK= 000000   	K$$IEN= 000115   	SCNLN   000440R  	T.PRI   000002   	W.BSIZ  000010
H$$RTZ= 000074   	K$$LDC= 000001   	S$$YSZ= 001740   	T.RCVL  000012   	X$$DBT= 000000
H.CSP   000000   	K$$TPS= 000074   	S.CABO= 000024   	T.RRFL  000064   	$ABCTK= ****** GX
H.CUIC  000010   	L$$ASG= 000000   	S.CAST= 000022   	T.SRCT  000063   	$ACTRM= ****** GX
H.DSW   000046   	L$$DRV= 000000   	S.CBPT= 000004   	T.STAT  000032   	$ALOCB= ****** GX
H.DUIC  000012   	MTQUE   000400R  	S.CCRF= 000030   	T.ST2   000034   	$DASTT= ****** GX
H.EFLM  000004   	M$$CRB= 000124   	S.CEMT= 000012   	T.ST3   000036   	$DEACB= ****** GX
H.EFSV  000040   	M$$MGE= 000000   	S.CFLT= 000016   	T.TCBL  000030   	$DEPKT= ****** GX
H.FCS   000050   	M$$NET= 000000   	S.CILI= 000010   	T.UCB   000026   	$DRCMT= ****** GX
H.FORT  000052   	M$$NT2= 000000   	S.CIOT= 000006   	T2.ABO= 000100   	$DRDSE= ****** GX
H.FPSA  000042   	N$$LDV= 000001   	S.CLRF= 000026   	T2.AST= 100000   	$DREIF  000000RG
H.FPVA  000034   	PS.APR= 000007   	S.COAD= 000000   	T2.BFX= 004000   	$DREXT  000006RG
H.GARD  000072   	PS.CHK= 010000   	S.CSGF= 000002   	T2.CAF= 000400   	$DRQRQ= ****** GX
H.HDLN  000002   	PS.CKP= 040000   	S.CSST= 000020   	T2.CHK= 020000   	$HEADR= ****** GX
H.IPC   000016   	PS.CKR= 020000   	S.CTRP= 000014   	T2.CKD= 010000   	$IOKIL= ****** GX
H.IPS   000014   	PS.COM= 000200   	S.IOMG= 000032   	T2.DST= 040000   	$LSTLK= ****** GX
H.ISP   000020   	PS.DEL= 000010   	S.PRTY= 000034   	T2.FXD= 002000   	$MPLNE= ****** GX
H.LUN   000076   	PS.DRV= 000020   	TS.BLK= 170700   	T2.HLT= 000200   	$QRMVF= ****** GX
H.NLUN  000074   	PS.FXD= 004000   	TS.CKP= 000200   	T2.SPN= 000004   	$TKTCB= ****** GX
H.NML   000061   	PS.LIO= 001000   	TS.CKR= 000100   	T2.STP= 000020   	$TKWSE= ****** GX
H.ODVA  000022

. ABS.	177776	   000
      	000510	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  4306 WORDS  ( 17 PAGES)
DYNAMIC MEMORY:  5092 WORDS  ( 19 PAGES)
ELAPSED TIME:  00:00:24
[11,24]DREIF,SY0:[11,34]DREIF/-SP=[1,1]EXEMC/ML,[11,10]RSXMC/PA:1,DREIF