

; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 1

; Digital Equipment Corporation

;

;	0001	MODULE CNTRL (

;	0002			LANGUAGE (BLISS32),

;	0003			MAIN = STARTUP,

;	0004			IDENT = 'A0005'

;	0005			) =

;	0006	BEGIN

;	0007	

;	0008	!

;	0009	! COPYRIGHT (C) 1977

;	0010	! DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS 01754

;	0011	!

;	0012	! THIS SOFTWARE IS FURNISHED  UNDER A LICENSE FOR USE ONLY ON A SINGLE

;	0013	! COMPUTER  SYSTEM AND  MAY BE  COPIED ONLY WITH  THE INCLUSION OF THE

;	0014	! ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE, OR ANY OTHER COPIES THEREOF,

;	0015	! MAY NOT BE PROVIDED OR  OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

;	0016	! EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE

;	0017	! TERMS.  TITLE TO AND  OWNERSHIP OF THE  SOFTWARE  SHALL AT ALL TIMES

;	0018	! REMAIN IN DEC.

;	0019	!

;	0020	! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE

;	0021	! AND SHOULD  NOT BE CONSTRUED  AS A COMMITMENT  BY DIGITAL  EQUIPMENT

;	0022	! CORPORATION.

;	0023	!

;	0024	! DEC ASSUMES  NO  RESPONSIBILITY  FOR  THE USE OR  RELIABILITY OF ITS

;	0025	! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

;	0026	

;	0027	!++

;	0028	!

;	0029	! FACILITY:  MTAACP

;	0030	!

;	0031	! ABSTRACT:

;	0032	!	MAIN CONTROL MODULE FOR MTAACP

;	0033	!

;	0034	! ENVIRONMENT:

;	0035	!

;	0036	!	STARLET OPERATING SYSTEM, INCLUDING PRIVILEGED SYSTEM SERVICES

;	0037	!	AND INTERNAL EXEC ROUTINES.

;	0038	!

;	0039	!--

;	0040	!

;	0041	!

;	0042	! AUTHOR:  D. H. GILLESPIE,	 CREATION DATE:  15-MAY-1977  

;	0043	!

;	0044	! REVISION HISTORY:

;	0045	!

;	0046	!   D. H. Gillespie, 24-Jan-1978  10:31

;	0047	!   X0002 - CHANGE TO NEW BUGCHECK

;	0048	!

;	0049	!   D. H. Gillespie, 12-May-78  9:09

;	0050	!   A0001 - change CURRENT_VCB  to a register

;	0051	!

;	0052	!   D. H. Gillespie, 18-May-78  11:26

;	0053	!   A0002 - add IO$_MOUNT function

;	0054	!

;	0055	!   D. H. Gillespie, 22-May-78  16:37



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 1-1

; Digital Equipment Corporation

;

;	0056	!   A0003 - add NOTUSED

;	0057	!

;	0058	!   D. H. Gillespie, 8-Jun-78  8:13

;	0059	!   A0004 - change SCH$AL_PCB to @SCH$GL_PCBVEC

;	0060	!

;	0061	!   D. H. Gillespie, 19-Jun-78  8:45

;	0062	!   A0005 - add $PURGWS

;	0063	!

;	0064	!**

;	0065	

;	0066	

;	0067	LIBRARY 'SYS$LIBRARY:LIB.L32';

;	0068	REQUIRE 'SRC$:MTADEF.B32';

;	0364	

;	0365	FORWARD ROUTINE

;	0366		CANCEL		: COMMON_CALL NOVALUE,		!SIGNAL CANCEL ERROR

;	0367		EXCEPT_HNDLR	: COMMON_CALL NOVALUE,		!HANDLES EXCEPTIONS

;	0368		MTA_CONTROL	: NOVALUE NOPRES,		!MAIN CONTROL

;	0369		RETURN_ALL_ERR	: COMMON_CALL NOVALUE;		!RETURN ALL BLOCKED IO IN ERROR



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 2

; Digital Equipment Corporation

;

;	0370	GLOBAL ROUTINE STARTUP: NOVALUE =

;	0371	

;	0372	!++

;	0373	!

;	0374	! FUNCTIONAL DESCRIPTION:

;	0375	!	THIS ROUTINE IS THE STARTUP POINT FOR MTAACP.  IT LOCKS THE APPROPRIATE PARTS OF MTAACP INTO

;	0376	!	MEMORY AND THEN CALLS THE CONTROL LOOP IN EXEC MODE.

;	0377	!

;	0378	! CALLING SEQUENCE:

;	0379	!	STARTUP()

;	0380	!

;	0381	! INPUT PARAMETERS:

;	0382	!	NONE

;	0383	!

;	0384	! IMPLICIT INPUTS:

;	0385	!	NONE

;	0386	!

;	0387	! OUTPUT PARAMETERS:

;	0388	!	NONE

;	0389	!

;	0390	! IMPLICIT OUTPUTS:

;	0391	!	NONE

;	0392	!

;	0393	! ROUTINE VALUE:

;	0394	!	NONE

;	0395	!

;	0396	! SIDE EFFECTS:

;	0397	!	MTAACP LOCKED INTO MEMORY, CONTROL STARTED

;	0398	!

;	0399	!--

;	0400	

;	0401	BEGIN

;	0402	

;	0403	EXEC_CALL (MTA_CONTROL)			!END OF ROUTINE STARTUP

;	0404	

;	0405	END;





							    .TITLE  CNTRL

							    .IDENT  \A0005\



							    .GLOBL  SYS$CMEXEC



							    .PSECT  $CODE$,NOWRT,2



					 0000 00000 	    .ENTRY  STARTUP, Save nothing				      ; 0370

				       7E  D4 00002 	    CLRL    -(SP)						      ; 0403

				       5E  DD 00004 	    PUSHL   SP							      ;

				0000V  CF  9F 00006 	    PUSHAB  MTA_CONTROL						      ;

	      00000000G  9F	       03  FB 0000A 	    CALLS   #3, @#SYS$CMEXEC					      ;

					   04 00011 	    RET     							      ; 0370



; Routine Size:  18 bytes







; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 2-1

; Digital Equipment Corporation

;



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 3

; Digital Equipment Corporation

;

;	0406	ROUTINE MTA_CONTROL : NOVALUE NOPRES =

;	0407	

;	0408	!++

;	0409	!

;	0410	! FUNCTIONAL DESCRIPTION:

;	0411	!	MAIN CONTROL MODULE FOR MTAACP

;	0412	!

;	0413	! CALLING SEQUENCE:

;	0414	!	MTA_CONTROL()

;	0415	!

;	0416	! INPUT PARAMETERS:

;	0417	!	NONE

;	0418	!

;	0419	! IMPLICIT INPUTS:

;	0420	!	ACP QUEUE

;	0421	!

;	0422	! OUTPUT PARAMETERS:

;	0423	!	NONE

;	0424	!

;	0425	! IMPLICIT OUTPUTS:

;	0426	!	NONE

;	0427	!

;	0428	! ROUTINE VALUE:

;	0429	!	NONE

;	0430	!

;	0431	! SIDE EFFECTS:

;	0432	!	MTAACP FUNCTIONS EXECUTED

;	0433	!

;	0434	!--

;	0435	

;	0436	BEGIN

;	0437	

;	0438	EXTERNAL REGISTER

;	0439		COMMON_REG;

;	0440	

;	0441	

;	0442	

;	0443	GLOBAL

;	0444	

;	0445	! THE FOLLOWING ARE NOT INITIALIZED FOR EACH REQUEST

;	0446		QUEUE_HEAD:	REF BBLOCK,		!PTER TO MTAACP INPUT QUEUE

;	0447		DISK_UCB:	REF BBLOCK,		!UCB OF SYS$DISK

;	0448		IO_CHANNEL,				!CHANNEL # FOR I/O

;	0449		MAIL_CHANNEL,				!CHANNEL # FOR MAILBOX

;	0450		FREE_PAGE_HEAD:	VECTOR [2],		!FREE PAGE LIST HEAD

;	0451		LAST_PAGE,				!LAST PAGE OF PROGRAM REGION IN VIRTUAL MEMORY

;	0452	

;	0453	! THE FOLLOWING ARE INITIALIZED FOR EACH REQUEST

;	0454		USER_STATUS:	VECTOR [2],		!I/O STATUS TO USER

;	0455		IO_STATUS:	VECTOR [2],		!STATUS BLOCK USED BY MTAACP

;	0456		IO_PACKET:	REF BBLOCK,		!ADDR OF I/O REQUEST PACKET

;	0457		CURRENT_UCB:	REF BBLOCK,		!ADDR OF CURRENT UCB

;	0458		CURRENT_WCB:	REF BBLOCK,		!ADDR OF CURRENT WCB

;	0459		HDR1:		REF BBLOCK,		!ADDRESS HDR1 LABEL(EOF1)

;	0460		HDR2:		REF BBLOCK,		!ADDRESS HDR2 LABEL(EOF2)



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 3-1

; Digital Equipment Corporation

;

;	0461		LOCAL_FIB:	BBLOCK [FIB$K_MTALEN],	!COPY OF FIB

;	0462		IMPURE_END:	VECTOR [0];

;	0463	

;	0464	GLOBAL LITERAL

;	0465		IMPURE_SIZE = IMPURE_END - USER_STATUS;

;	0466	LOCAL

;	0467		FUNCTION;				!FUNCTION CODE AND QUALIFIERS

;	0468	

;	0469	

;	0470	OWN

;	0471		RANGE	:	VECTOR [2]

;	0472				INITIAL(0,%X'FFFFFFFF');

;	0473	

;	0474	

;	0475	EXTERNAL ROUTINE

;	0476		END_OF_VOL	: NOPRES,		!END-OF-VOLUME PROCESSING

;	0477		GET_REQ		: L$GET_REQ,		!GET NEXT REQUEST

;	0478		INIT_MTAACP,				!ACP INITIALIZATION

;	0479		IO_DONE,				!COMPLETE I/O PROCESSING

;	0480		MTA_ACCESS	: NOPRES,		!ACCESS A FILE

;	0481		MTA_ACPCNTRL	: NOPRES,		!MTAACP CONTROL FUNCTIONS

;	0482		MTA_CREATE	: NOPRES,		!CREATE A FILE

;	0483		MTA_DEACCESS	: NOPRES,		!DEACCESS A FILE

;	0484		MTA_MODIFY	: NOPRES,		!MODIFY A FILE

;	0485		MTA_MOUNT	: NOPRES,		!MOUNT A VOLUME

;	0486		SYS$PURGWS	: ADDRESSING_MODE(ABSOLUTE);

;	0487	

;	0488	! ENABLE EXCEPT_HNDLR

;	0489	

;	0490	BEGIN

;	0491	BUILTIN FP;

;	0492	.FP = EXCEPT_HNDLR;

;	0493	END;

;	0494	

;	0495	KERNEL_CALL(INIT_MTAACP);			!INITIALIZE ACP, ONE TIME ONLY

;	0496	SYS$PURGWS(RANGE);

;	0497	

;	0498	WHILE 1 DO

;	0499	    BEGIN

;	0500	! INITIALIZE IMPURE AREA AND SET USER STATUS TO SUCCESS

;	0501	    CH$FILL(0,IMPURE_SIZE,USER_STATUS);

;	0502	    USER_STATUS[0] = 1;

;	0503	    IO_PACKET = GET_REQ();			!GET A REQUEST

;	0504	

;	0505	    FUNCTION = .IO_PACKET[IRP$V_FCODE];

;	0506	    IF .CURRENT_VCB[VCB$V_CANCELIO] AND .FUNCTION NEQ IO$_DEACCESS

;	0507	    THEN CANCEL() ELSE

;	0508	    IF .FUNCTION EQL IO$_READPBLK OR .FUNCTION EQL IO$_WRITEPBLK

;	0509	    THEN END_OF_VOL()				!END OF VOLUME PROCESSING

;	0510	    ELSE

;	0511		BEGIN

;	0512		    CASE .FUNCTION FROM IO$_ACCESS TO IO$_MOUNT OF

;	0513			SET

;	0514			[IO$_ACCESS]	: MTA_ACCESS();

;	0515			[IO$_CREATE]	: MTA_CREATE();



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 3-2

; Digital Equipment Corporation

;

;	0516			[IO$_DEACCESS]	: MTA_DEACCESS();

;	0517			[IO$_DELETE]	: (ERROR(SS$_ILLIOFUNC);0);

;	0518			[IO$_MODIFY]	: MTA_MODIFY();

;	0519			[IO$_ACPCONTROL]: MTA_ACPCNTRL();

;	0520			[IO$_MOUNT]	: MTA_MOUNT();

;	0521			[INRANGE]	: (ERROR(SS$_ILLIOFUNC);0);

;	0522			[OUTRANGE]	: (ERROR(SS$_ILLIOFUNC);0);

;	0523			TES;

;	0524		END;

;	0525	    IF .IO_PACKET NEQ 0 THEN KERNEL_CALL(IO_DONE,.IO_PACKET);

;	0526	    

;	0527	    END;					!END OF WHILE LOOP

;	0528	

;	0529	END;						!END OF ROUTINE







							    .PSECT  $LOCKEDD1$,NOEXE,2



					      00000 QUEUE_HEAD::

							    .BLKB   4

					      00004 DISK_UCB::

							    .BLKB   4

					      00008 IO_CHANNEL::

							    .BLKB   4

					      0000C MAIL_CHANNEL::

							    .BLKB   4

					      00010 FREE_PAGE_HEAD::

							    .BLKB   8

					      00018 LAST_PAGE::

							    .BLKB   4

					      0001C USER_STATUS::

							    .BLKB   8

					      00024 IO_STATUS::

							    .BLKB   8

					      0002C IO_PACKET::

							    .BLKB   4

					      00030 CURRENT_UCB::

							    .BLKB   4

					      00034 CURRENT_WCB::

							    .BLKB   4

					      00038 HDR1::  .BLKB   4

					      0003C HDR2::  .BLKB   4

					      00040 LOCAL_FIB::

							    .BLKB   28

					      0005C IMPURE_END::

							    .BLKB   0

					      0005C RANGE:  .LONG   0, -1						      ;



						    IMPURE_SIZE==	64

							    .GLOBL  END_OF_VOL, GET_REQ, INIT_MTAACP, IO_DONE, MTA_ACCESS

							    .GLOBL  MTA_ACPCNTRL, MTA_CREATE, MTA_DEACCESS, MTA_MODIFY

							    .GLOBL  MTA_MOUNT, SYS$PURGWS, SYS$CMKRNL



							    .PSECT  $CODE$,NOWRT,2



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 3-3

; Digital Equipment Corporation

;



					 0000 00012 MTA_CONTROL:

							    .WORD   Save nothing					      ; 0406

		         5E	       04  C2 00014 	    SUBL2   #4, SP						      ;

		         6D	0000V  CF  9E 00017 	    MOVAB   EXCEPT_HNDLR, (FP)					      ; 0492

				       7E  D4 0001C 	    CLRL    -(SP)						      ; 0495

				       5E  DD 0001E 	    PUSHL   SP							      ;

				0000G  CF  9F 00020 	    PUSHAB  INIT_MTAACP						      ;

	      00000000G  9F	       03  FB 00024 	    CALLS   #3, @#SYS$CMKRNL					      ;

				0000'  CF  9F 0002B 	    PUSHAB  RANGE						      ; 0496

	      00000000G  9F	       01  FB 0002F 	    CALLS   #1, @#SYS$PURGWS					      ;

	   00	         6E	       00  2C 00036 1$:     MOVC5   #0, (SP), #0, #64, USER_STATUS			      ; 0501

		  0000'  CF	0040   8F     0003A									      ;

		  0000'  CF	       01  D0 00040 	    MOVL    #1, USER_STATUS					      ; 0502

				     0000  30 00045 	    BSBW    GET_REQ						      ; 0503

		  0000'  CF	       50  D0 00048 	    MOVL    R0, IO_PACKET					      ;

		         50	0000'  CF  D0 0004D 	    MOVL    IO_PACKET, R0					      ; 0505

      20   A0	         06	       00  EF 00052 	    EXTZV   #0, #6, 32(R0), FUNCTION				      ;

				       6E     00057									      ;

	   0C	    0B   AB	       05  E1 00058 	    BBC     #5, 11(CURRENT_VCB), 2$				      ; 0506

		         34	       6E  D1 0005D 	    CMPL    FUNCTION, #52					      ;

				       07  13 00060 	    BEQL    2$							      ;

		  0000V  CF	       00  FB 00062 	    CALLS   #0, CANCEL						      ; 0507

				       57  11 00067 	    BRB     13$							      ; 0506

		         0C	       6E  D1 00069 2$:     CMPL    FUNCTION, #12					      ; 0508

				       05  13 0006C 	    BEQL    3$							      ;

		         0B	       6E  D1 0006E 	    CMPL    FUNCTION, #11					      ;

				       07  12 00071 	    BNEQ    4$							      ;

		  0000G  CF	       00  FB 00073 3$:     CALLS   #0, END_OF_VOL					      ; 0509

				       46  11 00078 	    BRB     13$							      ; 0508

	   07	         32	       6E  CF 0007A 4$:     CASEL   FUNCTION, #50, #7					      ; 0512

	 0020	       0019	     0012     0007E 5$:     .WORD   6$-5$,-						      ;

	 003C	       0027	     003C     00084		    7$-5$,-						      ;

		       0035	     002E     0008A		    8$-5$,-						      ;

								    12$-5$,-						      ;

								    9$-5$,-						      ;

								    12$-5$,-						      ;

								    10$-5$,-						      ;

								    11$-5$						      ;

				       2A  11 0008E 	    BRB     12$							      ; 0522

		  0000G  CF	       00  FB 00090 6$:     CALLS   #0, MTA_ACCESS					      ; 0514

				       29  11 00095 	    BRB     13$							      ; 0512

		  0000G  CF	       00  FB 00097 7$:     CALLS   #0, MTA_CREATE					      ; 0515

				       22  11 0009C 	    BRB     13$							      ; 0512

		  0000G  CF	       00  FB 0009E 8$:     CALLS   #0, MTA_DEACCESS					      ; 0516

				       1B  11 000A3 	    BRB     13$							      ; 0512

		  0000G  CF	       00  FB 000A5 9$:     CALLS   #0, MTA_MODIFY					      ; 0518

				       14  11 000AA 	    BRB     13$							      ; 0512

		  0000G  CF	       00  FB 000AC 10$:    CALLS   #0, MTA_ACPCNTRL					      ; 0519

				       0D  11 000B1 	    BRB     13$							      ; 0512

		  0000G  CF	       00  FB 000B3 11$:    CALLS   #0, MTA_MOUNT					      ; 0520

				       06  11 000B8 	    BRB     13$							      ; 0512

		  0000G  CF	  F4   8F  9B 000BA 12$:    MOVZBW  #244, USER_STATUS					      ; 0521

		         50	0000'  CF  D0 000C0 13$:    MOVL    IO_PACKET, R0					      ; 0525

				       11  13 000C5 	    BEQL    14$							      ;



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 3-4

; Digital Equipment Corporation

;

				       50  DD 000C7 	    PUSHL   R0							      ;

				       01  DD 000C9 	    PUSHL   #1							      ;

				       5E  DD 000CB 	    PUSHL   SP							      ;

				0000G  CF  9F 000CD 	    PUSHAB  IO_DONE						      ;

	      00000000G  9F	       04  FB 000D1 	    CALLS   #4, @#SYS$CMKRNL					      ;

				     FF5B  31 000D8 14$:    BRW     1$							      ; 0498



; Routine Size:  201 bytes





;	0530	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 4

; Digital Equipment Corporation

;

;	0531	GLOBAL ROUTINE EXCEPT_HNDLR(SIGNAL,MECHANISM) : COMMON_CALL NOVALUE  =

;	0532	

;	0533	!++

;	0534	!

;	0535	! FUNCTIONAL DESCRIPTION:

;	0536	!	THIS ROUTINE HANDLES EXCEPTIONS.  THIS CODE STORES THE CONDITION VALUE

;	0537	!	(IF GIVEN) IN THE USER STATUS BLOCK, UNWINDS THE STACK, COMPLETES

;	0538	!	IO AND RETURNS.

;	0539	!

;	0540	!

;	0541	! CALLING SEQUENCE:

;	0542	!	EXCEPT_HNLR(ARG1,ARG2)

;	0543	!

;	0544	! INPUT PARAMETERS:

;	0545	!	ARG1 - ADDRESS OF SIGNAL ARRAY

;	0546	!	ARG2 - ADDRESS OF MECHANISM ARRAY

;	0547	!

;	0548	! IMPLICIT INPUTS:

;	0549	!	NONE

;	0550	!

;	0551	! OUTPUT PARAMETERS:

;	0552	!	NONE

;	0553	!

;	0554	! IMPLICIT OUTPUTS:

;	0555	!	USER_STATUS - RECEIVES EXCEPTION PARAMETER

;	0556	!

;	0557	! ROUTINE VALUE:

;	0558	!	NONE

;	0559	!

;	0560	! SIDE EFFECTS:

;	0561	!	STACK IS UNWOUND TO MAIN LEVEL TO CONTINUE PROCESSING REQUESTS.

;	0562	!

;	0563	!--

;	0564	

;	0565	BEGIN

;	0566	

;	0567	EXTERNAL REGISTER

;	0568		COMMON_REG;

;	0569	

;	0570	

;	0571	

;	0572	LOCAL

;	0573		FUNCTION	: BLOCK [1];			!IO REQUEST FUNCTION WITH MODIFIERS

;	0574	

;	0575	

;	0576	MAP

;	0577		SIGNAL		: REF BBLOCK,			!SIGNAL ARRAY

;	0578		MECHANISM	: REF BBLOCK;			!MECHANISM ARRAY

;	0579	

;	0580	

;	0581	EXTERNAL

;	0582		IO_PACKET	: REF BBLOCK,			!ADDRESS OF CURRENT IO REQUEST PACKET

;	0583		USER_STATUS	: WORD;				!STATUS RETURNED TO USER

;	0584	

;	0585	EXTERNAL ROUTINE



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 4-1

; Digital Equipment Corporation

;

;	0586		SYS$UNWIND	: ADDRESSING_MODE(ABSOLUTE),	!UNWIND THE STACK

;	0587		TERMINATE_VOL,					!TERMINATE ACTIVITY ON THIS VOLUME

;	0588		ZERO_CHANNEL;					!CLEAN UP USER CHANNEL

;	0589	

;	0590	! CHECK THE SIGNAL CODE. THE ONLY PERMISSIBLE ONES ARE SS$_UNWIND WHICH IS IGNORED

;	0591	! AND SS$_CMODUSER.  THE ERROR STATUS IS THE 16 BIT CHMU CODE.  IF THE ERROR

;	0592	! VALUE IS NON_ZERO, STORE IT IN THE USER STATUS, COMPLETE THE I/O, UNWIND

;	0593	! THE STACK AND RETURN TO THE CONTROL MODULE.  IF THE ERROR VALUE IS ZERO

;	0594	! THE USER STATUS IS NOT CHANGED BUT THE I/O IS COMPLETED, THE STACK IS UNWOUND AND

;	0595	! THE RETURN IS TO THE CONTROL MODULE.

;	0596	

;	0597	IF .SIGNAL[CHF$L_SIG_NAME] EQL SS$_UNWIND THEN RETURN;

;	0598	IF .SIGNAL[CHF$L_SIG_NAME] NEQ SS$_CMODUSER

;	0599	THEN BUG_CHECK(UNXSIGNAL);

;	0600	

;	0601	! IF ACCESS MODIFIER BIT IS SET, THEN USER CHANNEL MUST BE CLEANED UP

;	0602	FUNCTION = .IO_PACKET[IRP$W_FUNC];			!GET IO FUNCTION

;	0603	IF .FUNCTION[IO$V_ACCESS] THEN KERNEL_CALL(ZERO_CHANNEL,.IO_PACKET);	!CLEAN UP USER CHANNEL

;	0604	

;	0605	! ERROR TO BE RETURNED TO USER

;	0606	IF .SIGNAL[CHF$L_SIG_ARG1] NEQ 0

;	0607	THEN USER_STATUS = .SIGNAL[CHF$L_SIG_ARG1];

;	0608	IF NOT .CURRENT_VCB[VCB$V_WAIUSRLBL] THEN KERNEL_CALL(RETURN_ALL_ERR);	!RETURN ALL BLOCKED IO IN ERROR

;	0609	

;	0610	!

;	0611	! IF TAPE POSITION LOST, THEN FORCE USER TO CLOSE OPEN FILES AND REPOSITION AT 

;	0612	! BEGINNING OF VOLUME SET

;	0613	!

;	0614	IF .SIGNAL[CHF$L_SIG_ARG1] EQL SS$_TAPEPOSLOST

;	0615	THEN KERNEL_CALL(TERMINATE_VOL,.CURRENT_VCB[VCB$L_WCB]);

;	0616	SYS$UNWIND(MECHANISM[CHF$L_MCH_DEPTH],0);

;	0617	RETURN;

;	0618	END;







							    .PSECT  $LOCKEDC2$,NOWRT,2



					      00000 P.AAA:  .WORD   0, -257						      ;

					      00004 	    .WORD    <BUG$_UNXSIGNAL!4>					      ;

					      00006	    .BLKB   2



							    .GLOBL  SYS$UNWIND, TERMINATE_VOL, ZERO_CHANNEL, BUG$_UNXSIGNAL



							    .PSECT  $CODE$,NOWRT,2



					 0404 000DB 	    .ENTRY  EXCEPT_HNDLR, Save R2,R10				      ; 0531

		         5A 00000000G  9F  9E 000DD 	    MOVAB   @#SYS$CMKRNL, R10					      ;

		         52	  04   AC  D0 000E4 	    MOVL    SIGNAL, R2						      ; 0597

	      00000920   8F	  04   A2  D1 000E8 	    CMPL    4(R2), #2336					      ;

				       69  13 000F0 	    BEQL    6$							      ;

	      00000424   8F	  04   A2  D1 000F2 	    CMPL    4(R2), #1060					      ; 0598

				       05  13 000FA 	    BEQL    1$							      ;

		  0000'  CF	       00  FB 000FC 	    CALLS   #0, P.AAA						      ; 0599

		         50	0000G  CF  D0 00101 1$:     MOVL    IO_PACKET, R0					      ; 0602



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 4-2

; Digital Equipment Corporation

;

		         51	  20   A0  3C 00106 	    MOVZWL  32(R0), FUNCTION					      ;

	   0D	         51	       06  E1 0010A 	    BBC     #6, FUNCTION, 2$					      ; 0603

				       50  DD 0010E 	    PUSHL   R0							      ;

				       01  DD 00110 	    PUSHL   #1							      ;

				       5E  DD 00112 	    PUSHL   SP							      ;

				0000G  CF  9F 00114 	    PUSHAB  ZERO_CHANNEL					      ;

		         6A	       04  FB 00118 	    CALLS   #4, SYS$CMKRNL					      ;

		         52	  08   A2  D0 0011B 2$:     MOVL    8(R2), R2						      ; 0606

				       05  13 0011F 	    BEQL    3$							      ;

		  0000G  CF	       52  B0 00121 	    MOVW    R2, USER_STATUS					      ; 0607

	   0B	    0B   AB	       04  E0 00126 3$:     BBS     #4, 11(CURRENT_VCB), 4$				      ; 0608

				       7E  D4 0012B 	    CLRL    -(SP)						      ;

				       5E  DD 0012D 	    PUSHL   SP							      ;

				0000V  CF  9F 0012F 	    PUSHAB  RETURN_ALL_ERR					      ;

		         6A	       03  FB 00133 	    CALLS   #3, SYS$CMKRNL					      ;

	      00000224   8F	       52  D1 00136 4$:     CMPL    R2, #548						      ; 0614

				       0E  12 0013D 	    BNEQ    5$							      ;

				  38   AB  DD 0013F 	    PUSHL   56(CURRENT_VCB)					      ; 0615

				       01  DD 00142 	    PUSHL   #1							      ;

				       5E  DD 00144 	    PUSHL   SP							      ;

				0000G  CF  9F 00146 	    PUSHAB  TERMINATE_VOL					      ;

		         6A	       04  FB 0014A 	    CALLS   #4, SYS$CMKRNL					      ;

				       7E  D4 0014D 5$:     CLRL    -(SP)						      ; 0616

	   7E	    08   AC	       08  C1 0014F 	    ADDL3   #8, MECHANISM, -(SP)				      ;

	      00000000G  9F	       02  FB 00154 	    CALLS   #2, @#SYS$UNWIND					      ;

					   04 0015B 6$:     RET     							      ; 0531



; Routine Size:  129 bytes





;	0619	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 5

; Digital Equipment Corporation

;

;	0620	GLOBAL ROUTINE RETURN_ALL_ERR : COMMON_CALL NOVALUE  =

;	0621	

;	0622	!++

;	0623	!

;	0624	! FUNCTIONAL DESCRIPTION:

;	0625	!	THIS ROUTINE RETURNS ALL BLOCKED IO WITH THE ERROR GIVEN IN USER_STATUS

;	0626	!

;	0627	! CALLING SEQUENCE:

;	0628	!	RETURN_ALL_ERROR, CALLED IN KERNEL MODE

;	0629	!

;	0630	! INPUT PARAMETERS:

;	0631	!	NONE

;	0632	!

;	0633	! IMPLICIT INPUTS:

;	0634	!	CURRENT_VCB - ADDRESS OF CURRENT VOLUME CONTROL BLOCK

;	0635	!

;	0636	! OUTPUT PARAMETERS:

;	0637	!	NONE

;	0638	!

;	0639	! IMPLICIT OUTPUTS:

;	0640	!	NONE

;	0641	!

;	0642	! ROUTINE VALUE:

;	0643	!	NONE

;	0644	!

;	0645	! SIDE EFFECTS:

;	0646	!	NONE

;	0647	!

;	0648	! USER ERRORS:

;	0649	!	NONE

;	0650	!

;	0651	!--

;	0652	

;	0653	BEGIN

;	0654	

;	0655	EXTERNAL REGISTER

;	0656		COMMON_REG;

;	0657	

;	0658	

;	0659	

;	0660	EXTERNAL ROUTINE

;	0661		IO_DONE;			!COMPLETE IO

;	0662	

;	0663	EXTERNAL

;	0664		USER_STATUS;			!STATUS TO BE RETURNED TO USER

;	0665	

;	0666	LOCAL

;	0667		STATUS,				!SAVE STATUS

;	0668		PACKET		: REF BBLOCK;

;	0669	

;	0670	STATUS = .USER_STATUS;			!SAVE STATUS

;	0671	USER_STATUS<16,16> = 0;			!THESE IO'S HAVE NO TRANSFER COUNT

;	0672	WHILE 1 DO

;	0673	    BEGIN

;	0674	    IF REMQUE(.CURRENT_VCB[VCB$L_BLOCKFL],PACKET) THEN EXITLOOP;



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 5-1

; Digital Equipment Corporation

;

;	0675	    PACKET[IRP$V_VIRTUAL] = 0;		!MAKE SURE NOT SEEN AGAIN

;	0676	    IO_DONE(.PACKET);

;	0677	    END;

;	0678	USER_STATUS = .STATUS;			!RESTORE STATUS

;	0679	

;	0680	END;					!END OF ROUTINE











					 000C 0015C 	    .ENTRY  RETURN_ALL_ERR, Save R2,R3				      ; 0620

		         53	0000G  CF  D0 0015E 	    MOVL    USER_STATUS, STATUS					      ; 0670

				0000G  CF  B4 00163 	    CLRW    USER_STATUS+2					      ; 0671

		         52	  00   BB  0F 00167 1$:     REMQUE  @0(CURRENT_VCB), PACKET				      ; 0674

				       0D  1D 0016B 	    BVS     2$							      ;

		    2A   A2	       10  8A 0016D 	    BICB2   #16, 42(PACKET)					      ; 0675

				       52  DD 00171 	    PUSHL   PACKET						      ; 0676

		  0000G  CF	       01  FB 00173 	    CALLS   #1, IO_DONE						      ;

				       ED  11 00178 	    BRB     1$							      ; 0672

		  0000G  CF	       53  D0 0017A 2$:     MOVL    STATUS, USER_STATUS					      ; 0678

					   04 0017F 	    RET     							      ; 0620



; Routine Size:  36 bytes





;	0681	

;	0682	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 6

; Digital Equipment Corporation

;

;	0683	ROUTINE CANCEL : COMMON_CALL NOVALUE  =

;	0684	

;	0685	!++

;	0686	!

;	0687	! FUNCTIONAL DESCRIPTION:

;	0688	!	THIS ROUTINE SIGNALS THE CANCEL ERROR.  THE CALL IS NECESSARY SO

;	0689	!	THAT THE UNWIND RETURNS TO THE CONTROL MODULE AND NOT EXIT

;	0690	!

;	0691	! CALLING SEQUENCE:

;	0692	!

;	0693	! INPUT PARAMETERS:

;	0694	!	NONE

;	0695	!

;	0696	! IMPLICIT INPUTS:

;	0697	!	NONE

;	0698	!

;	0699	! OUTPUT PARAMETERS:

;	0700	!	NONE

;	0701	!

;	0702	! IMPLICIT OUTPUTS:

;	0703	!	NONE

;	0704	!

;	0705	! ROUTINE VALUE:

;	0706	!	NONE

;	0707	!

;	0708	! SIDE EFFECTS:

;	0709	!	NONE

;	0710	!

;	0711	! USER ERRORS:

;	0712	!	NONE

;	0713	!

;	0714	!--

;	0715	

;	0716	BEGIN

;	0717	

;	0718	EXTERNAL REGISTER

;	0719		COMMON_REG;

;	0720	

;	0721	

;	0722	ERR_EXIT(SS$_CANCEL);

;	0723	END;











					 0000 00180 CANCEL: .WORD   Save nothing					      ; 0683

				0830   8F  BF 00182 	    CHMU    #2096						      ; 0722

					   04 00186 	    RET     							      ; 0683



; Routine Size:  7 bytes





;	0724	END

;	0725	ELUDOM



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:55	DBB3:[MTAACP.SRC]CNTRL.B32;12					Page 6-1

; Digital Equipment Corporation

;













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	   391  NOWRT,  RD ,  EXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)

;  $LOCKEDD1$     	   100    WRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)

;  $LOCKEDC2$     	     8  NOWRT,  RD ,  EXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)









;				LIBRARY STATISTICS

;

;					     -------- Symbols --------    Blocks

;	File				     Total    Loaded   Percent      Read

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582        32         0       242











;	0726	

; Size:		391 code + 108 data bytes

; Run Time:	00:12.2

; Elapsed Time:	00:32.6

; Memory Used:	297 pages

; Compilation Complete

