

; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:09	DBB3:[F11A.SRC]GETREQ.B32;10					Page 1

;

;	0001	MODULE GETREQ (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'A0013'

;	0004			) =

;	0005	BEGIN

;	0006	

;	0007	!

;	0008	! Copyright (c) 1977

;	0009	! Digital Equipment Corporation, Maynard, Massachusetts 01754

;	0010	!

;	0011	! This software is furnished  under a license for use only on a single

;	0012	! computer  system and  may be  copied only with  the inclusion of the

;	0013	! above copyright notice.  This software, or any other copies thereof,

;	0014	! may not be provided or  otherwise made available to any other person

;	0015	! except for use on such system and to one who agrees to these license

;	0016	! terms.  Title to and  ownership of the  software  shall at all times

;	0017	! remain in DEC.

;	0018	!

;	0019	! The information in this software is subject to change without notice

;	0020	! and should  not be construed  as a commitment  by Digital  Equipment

;	0021	! Corporation.

;	0022	!

;	0023	! DEC assumes  no  responsibility  for  the use or  reliability of its

;	0024	! software on equipment which is not supplied by DEC.

;	0025	

;	0026	!++

;	0027	!

;	0028	! FACILITY:  F11ACP Structure Level 1

;	0029	!

;	0030	! ABSTRACT:

;	0031	!

;	0032	!	This routine gets the next I/O request from the ACP queue.

;	0033	!	If no requests are queued, it hibernates.

;	0034	!

;	0035	! ENVIRONMENT:

;	0036	!

;	0037	!	STARLET operating system, including privileged system services

;	0038	!	and internal exec routines. This routine must be called

;	0039	!	in kernel mode.

;	0040	!

;	0041	!--

;	0042	!

;	0043	!

;	0044	! AUTHOR:  Andrew C. Goldstein,	 CREATION DATE:  19-Dec-1976  17:26

;	0045	!

;	0046	! REVISION HISTORY:

;	0047	!

;	0048	!   Andrew C. Goldstein, 25-Mar-1977  17:55

;	0049	!   X0002 - Add control block type checks

;	0050	!

;	0051	!   Andrew C. Goldstein, 1-Apr-1977  16:24

;	0052	!   X0003 - Move in buffer descriptor initialization from GETFIB

;	0053	!

;	0054	!   Andrew C. Goldstein, 18-Aug-1977  13:28

;	0055	!   X0004 - Clean out low bits of window pointer in I/O packet



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:09	DBB3:[F11A.SRC]GETREQ.B32;10					Page 1-1

;

;	0056	!

;	0057	!   Andrew C. Goldstein, 6-Sep-1977  21:43

;	0058	!   X0005 - Check deaccess interlock in packet window pointer

;	0059	!

;	0060	!   Andrew C. Goldstein, 7-Sep-1977  17:47

;	0061	!   X0006 - Flush ACP control functions instantly

;	0062	!

;	0063	!   Andrew C. Goldstein, 12-Sep-1977  21:09

;	0064	!   X0007 - Check window interlock bit; check presence of buffer packet

;	0065	!

;	0066	!   Andrew C. Goldstein, 12-Oct-1977  17:05

;	0067	!   X0008 - Force interlocked use of REMQUE

;	0068	!

;	0069	!   Andrew C. Goldstein, 27-Oct-1977  10:26

;	0070	!   X0009 - Exit the ACP when mount count in the AQB goes to zero.

;	0071	!

;	0072	!   Andrew C. Goldstein, 27-Jan-1978  3:07

;	0073	!   X0010 - Don't zero result length and result buffer

;	0074	!

;	0075	!   Andrew C. Goldstein, 14-Feb-1978  13:37

;	0076	!   X0011 - Remove direct reference to CCB base

;	0077	!

;	0078	!   Andrew C. Goldstein, 17-Feb-1978  14:41

;	0079	!   X0012 - Use new bug check

;	0080	!

;	0081	!   Andrew C. Goldstein, 6-Jun-78  0:34

;	0082	!   A0013 - Set spool file bit if I/O is to spooled device

;	0083	!

;	0084	!**

;	0085	

;	0086	

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

;	0088	REQUIRE 'SRC$:FCPDEF.B32';

;	0407	

;	0408	

;	0409	FORWARD ROUTINE

;	0410		GET_REQUEST,			! get next FCP request

;	0411		GET_CCB;			! get address of CCB of channel



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:09	DBB3:[F11A.SRC]GETREQ.B32;10					Page 2

;

;	0412	GLOBAL ROUTINE GET_REQUEST =

;	0413	

;	0414	!++

;	0415	!

;	0416	! FUNCTIONAL DESCRIPTION:

;	0417	!

;	0418	!	This routine gets the next I/O request from the ACP queue.

;	0419	!	If no requests are queued, it hibernates.

;	0420	!

;	0421	! CALLING SEQUENCE:

;	0422	!	GET_REQUEST ()

;	0423	!

;	0424	! INPUT PARAMETERS:

;	0425	!	NONE

;	0426	!

;	0427	! IMPLICIT INPUTS:

;	0428	!	QUEUE_HEAD: address of ACP queue block

;	0429	!	IO_CHANNEL: I/O channel number

;	0430	!

;	0431	! OUTPUT PARAMETERS:

;	0432	!	NONE

;	0433	!

;	0434	! IMPLICIT OUTPUTS:

;	0435	!	CURRENT_UCB: address of UCB of request

;	0436	!	CURRENT_VCB: address of VCB of request

;	0437	!	CURRENT_WINDOW: window of file if accessed

;	0438	!	PRIMARY_FCB: FCB of file if accessed

;	0439	!

;	0440	! ROUTINE VALUE:

;	0441	!	address of request I/O packet

;	0442	!

;	0443	! SIDE EFFECTS:

;	0444	!	I/O channel assigned to device of request

;	0445	!

;	0446	!--

;	0447	

;	0448	BEGIN

;	0449	

;	0450	! Note that the ACP queue header must be referenced through an explicit

;	0451	! register. This is to ensure that the REMQUE expression in fact produces

;	0452	! an single REMQUE instruction, and is not broken into an instruction

;	0453	! sequence that is not interlocked.

;	0454	!

;	0455	REGISTER

;	0456		QUEUE_POINTER	: REF BBLOCK;

;	0457	

;	0458	LOCAL

;	0459		P		: REF BBLOCK,	! pointer to chase AQB list

;	0460		CCB		: REF BBLOCK,	! pointer to CCB of i/o channel

;	0461		ABD		: REF BBLOCKVECTOR [,ABD$C_LENGTH],

;	0462						! pointer to buffer descriptor packet

;	0463		PACKET		: REF BBLOCK;	! address of new I/O packet

;	0464	

;	0465	EXTERNAL

;	0466		CLEANUP_FLAGS	: BITVECTOR,	! cleanup action flags



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:09	DBB3:[F11A.SRC]GETREQ.B32;10					Page 2-1

;

;	0467		QUEUE_HEAD	: REF BBLOCK,	! ACP queue list head

;	0468		DISK_UCB	: REF BBLOCK,	! UCB of device 'SYS$DISK'

;	0469		CURRENT_UCB	: REF BBLOCK,	! address of current UCB

;	0470		CURRENT_VCB	: REF BBLOCK,	! address of current VCB

;	0471		CURRENT_WINDOW	: REF BBLOCK,	! address of file window

;	0472		PRIMARY_FCB	: REF BBLOCK,	! address of file FCB

;	0473		IO_CHANNEL,			! channel for all I/O

;	0474		IOC$GL_AQBLIST	: REF BBLOCK ADDRESSING_MODE (ABSOLUTE);

;	0475						! system AQB listhead

;	0476	

;	0477	EXTERNAL ROUTINE

;	0478		LOCK_IODB,			! interlock system I/O database

;	0479		UNLOCK_IODB;			! unlock system I/O database

;	0480	

;	0481	! Attempt to dequeue a packet. If unsuccessful, hibernate and try again.

;	0482	!

;	0483	

;	0484	WHILE 1 DO

;	0485	    BEGIN

;	0486	    QUEUE_POINTER = .QUEUE_HEAD;

;	0487	    IF NOT REMQUE (.QUEUE_POINTER[AQB$L_ACPQFL], PACKET)

;	0488	    THEN EXITLOOP;

;	0489	

;	0490	    IF .QUEUE_POINTER[AQB$B_MNTCNT] EQL 0

;	0491	    THEN

;	0492	

;	0493	! If the REMQUE failed and the mount count in the AQB is zero, this ACP is

;	0494	! potentially idle. Interlock the I/O database and check the queue and the

;	0495	! count again. If the ACP is no longer idle, proceed as if nothing had happened.

;	0496	! If it still is, unhook the AQB from the system AQB list. Once unhooked, the

;	0497	! ACP can no longer be found by anyone. Then restore the original UCB of our

;	0498	! I/O channel, deassign the channel, and go away.

;	0499	!

;	0500	

;	0501		BEGIN

;	0502		LOCK_IODB ();

;	0503		IF .QUEUE_POINTER[AQB$B_MNTCNT] EQL 0

;	0504		AND .QUEUE_POINTER[AQB$L_ACPQFL] EQL QUEUE_POINTER[AQB$L_ACPQFL]

;	0505		THEN

;	0506		    BEGIN

;	0507		    P = .IOC$GL_AQBLIST;

;	0508		    IF .P EQL .QUEUE_POINTER

;	0509		    THEN IOC$GL_AQBLIST = .QUEUE_POINTER[AQB$L_LINK]

;	0510		    ELSE

;	0511			BEGIN

;	0512			UNTIL .P[AQB$L_LINK] EQL .QUEUE_POINTER

;	0513			DO P = .P[AQB$L_LINK];

;	0514			P[AQB$L_LINK] = .QUEUE_POINTER[AQB$L_LINK];

;	0515			END;

;	0516		    UNLOCK_IODB ();

;	0517		    CCB = GET_CCB (.IO_CHANNEL);

;	0518		    CCB[CCB$L_UCB] = .DISK_UCB;

;	0519		    $DASSGN (CHAN = .IO_CHANNEL);

;	0520		    $DELPRC ();

;	0521		    END



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:09	DBB3:[F11A.SRC]GETREQ.B32;10					Page 2-2

;

;	0522		ELSE

;	0523		    UNLOCK_IODB ();

;	0524		END;

;	0525	

;	0526	    $HIBER;

;	0527	    END;				! end of ACP wait loop

;	0528	

;	0529	! First check the type code in the packet.

;	0530	!

;	0531	

;	0532	IF .PACKET[IRP$B_TYPE] NEQ DYN$C_IRP

;	0533	THEN BUG_CHECK (NOTIRPAQB, FATAL, 'Not IRP pointer in AQB');

;	0534	

;	0535	! Set up the UCB and VCB pointers and assign the I/O channel to the UCB.

;	0536	! Check the type codes on all packets and control blocks.

;	0537	!

;	0538	

;	0539	CURRENT_UCB = .PACKET[IRP$L_UCB];

;	0540	IF .CURRENT_UCB[UCB$B_TYPE] NEQ DYN$C_UCB

;	0541	THEN BUG_CHECK (NOTUCBIRP, FATAL, 'Not UCB pointer in IRP');

;	0542	

;	0543	CURRENT_VCB = .CURRENT_UCB[UCB$L_VCB];

;	0544	IF .CURRENT_VCB[VCB$B_TYPE] NEQ DYN$C_VCB

;	0545	THEN BUG_CHECK (NOTVCBUCB, FATAL, 'Not VCB pointer in UCB');

;	0546	

;	0547	CCB = GET_CCB (.IO_CHANNEL);

;	0548	CCB[CCB$L_UCB] = .CURRENT_UCB;		! and assign it by stuffing UCB

;	0549	

;	0550	! Get the window and FCB addresses if there is a file open on the channel.

;	0551	! If the low bit of the window pointer is on, ignore the pointer (deaccess pending).

;	0552	!

;	0553	

;	0554	CURRENT_WINDOW = .PACKET[IRP$L_WIND];

;	0555	IF .(PACKET[IRP$L_WIND])<0,1>

;	0556	THEN CURRENT_WINDOW = 0;

;	0557	IF .(PACKET[IRP$L_WIND])<1,2> NEQ 0

;	0558	THEN BUG_CHECK (BADWCBPT, FATAL, 'Bad WCB pointer in IRP');

;	0559	

;	0560	IF .CURRENT_WINDOW NEQ 0

;	0561	THEN

;	0562	    BEGIN

;	0563	    IF .CURRENT_WINDOW[WCB$B_TYPE] NEQ DYN$C_WCB

;	0564	    THEN BUG_CHECK (NOTWCBIRP, FATAL, 'Not WCB Pointer in IRP');

;	0565	

;	0566	    IF .CURRENT_WINDOW[WCB$V_NOTFCP]

;	0567	    THEN BUG_CHECK (NOTFCPWCB, FATAL, 'Not FCP window in IRP');

;	0568	

;	0569	    PRIMARY_FCB = .CURRENT_WINDOW[WCB$L_FCB];

;	0570	    IF .PRIMARY_FCB[FCB$B_TYPE] NEQ DYN$C_FCB

;	0571	    THEN BUG_CHECK (NOTFCBWCB, FATAL, 'Bad FCB pointer in window');

;	0572	    END;

;	0573	

;	0574	! If this is a normal file processor request (as opposed to a window turn),

;	0575	! clear the byte count in the descriptor for the channel window

;	0576	! pointer to inhibit write-back. Also zero out the result string and



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:09	DBB3:[F11A.SRC]GETREQ.B32;10					Page 2-3

;

;	0577	! length buffers. Set the spool file bit is this is I/O to a spool file.

;	0578	! This is denoted for ACP functions by noting that IRP$L_UCB is different

;	0579	! from IRP$L_MEDIA (the latter containing the spooled device UCB address.

;	0580	!

;	0581	

;	0582	IF .PACKET[IRP$V_COMPLX]

;	0583	THEN

;	0584	    BEGIN

;	0585	    ABD = .BBLOCK [.PACKET[IRP$L_SVAPTE], AIB$L_DESCRIPT];

;	0586	    ABD[ABD$C_WINDOW, ABD$W_COUNT] = 0;

;	0587	    IF .PACKET[IRP$L_UCB] NEQ .PACKET[IRP$L_MEDIA]

;	0588	    THEN CLEANUP_FLAGS[CLF_SPOOLFILE] = 1;

;	0589	    END

;	0590	

;	0591	! If there is no buffer packet, the function must be an ACP control function.

;	0592	!

;	0593	

;	0594	ELSE

;	0595	    BEGIN

;	0596	    IF .PACKET[IRP$V_FCODE] GTRU IO$_LOGICAL

;	0597	    AND .PACKET[IRP$V_FCODE] NEQ IO$_ACPCONTROL

;	0598	    THEN BUG_CHECK (NOBUFPCKT, FATAL, 'Required buffer packet not present');

;	0599	    END;

;	0600	

;	0601	RETURN .PACKET;

;	0602	

;	0603	END;					! end of routine GETREQ





							    .TITLE  GETREQ

							    .IDENT  \A0013\



							    .PSECT  $LOCKEDC2$,NOWRT,2



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

					0000* 00004 	    .WORD   <BUG$_NOTIRPAQB!4>					      ;

					      00006	    .BLKB   2

				  FEFF  0000  00008 P.AAB:  .WORD   0, -257						      ;

					0000* 0000C 	    .WORD   <BUG$_NOTUCBIRP!4>					      ;

					      0000E	    .BLKB   2

				  FEFF  0000  00010 P.AAC:  .WORD   0, -257						      ;

					0000* 00014 	    .WORD   <BUG$_NOTVCBUCB!4>					      ;

					      00016	    .BLKB   2

				  FEFF  0000  00018 P.AAD:  .WORD   0, -257						      ;

					0000* 0001C 	    .WORD   <BUG$_BADWCBPT!4>					      ;

					      0001E	    .BLKB   2

				  FEFF  0000  00020 P.AAE:  .WORD   0, -257						      ;

					0000* 00024 	    .WORD   <BUG$_NOTWCBIRP!4>					      ;

					      00026	    .BLKB   2

				  FEFF  0000  00028 P.AAF:  .WORD   0, -257						      ;

					0000* 0002C 	    .WORD   <BUG$_NOTFCPWCB!4>					      ;

					      0002E	    .BLKB   2

				  FEFF  0000  00030 P.AAG:  .WORD   0, -257						      ;

					0000* 00034 	    .WORD   <BUG$_NOTFCBWCB!4>					      ;

					      00036	    .BLKB   2



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:09	DBB3:[F11A.SRC]GETREQ.B32;10					Page 2-4

;

				  FEFF  0000  00038 P.AAH:  .WORD   0, -257						      ;

					0000* 0003C 	    .WORD   <BUG$_NOBUFPCKT!4>					      ;

					      0003E	    .BLKB   2



							    .EXTRN  CLEANUP_FLAGS, QUEUE_HEAD, DISK_UCB, CURRENT_UCB

							    .EXTRN  CURRENT_VCB, CURRENT_WINDOW, PRIMARY_FCB, IO_CHANNEL

							    .EXTRN  IOC$GL_AQBLIST, LOCK_IODB, UNLOCK_IODB, SYS$DASSGN

							    .EXTRN  SYS$DELPRC, SYS$HIBER, BUG$_NOTIRPAQB, BUG$_NOTUCBIRP

							    .EXTRN  BUG$_NOTVCBUCB, BUG$_BADWCBPT, BUG$_NOTWCBIRP

							    .EXTRN  BUG$_NOTFCPWCB, BUG$_NOTFCBWCB, BUG$_NOBUFPCKT



							    .PSECT  $CODE$,NOWRT,2



					 0FFC 00000 	    .ENTRY  GET_REQUEST, Save R2,R3,R4,R5,R6,R7,R8,R9,R10,R11	      ; 0412

		         5B 	0000G  CF  9E 00002 	    MOVAB   IO_CHANNEL, R11					      ;

		         5A 	0000G  CF  9E 00007 	    MOVAB   CURRENT_UCB, R10					      ;

		         59 00000000G  9F  9E 0000C 	    MOVAB   @#IOC$GL_AQBLIST, R9				      ;

		         58 	0000G  CF  9E 00013 	    MOVAB   CURRENT_WINDOW, R8					      ;

		         57 	0000'  CF  9E 00018 	    MOVAB   P.AAA, R7						      ;

		         52 	0000G  CF  D0 0001D 1$:     MOVL    QUEUE_HEAD, QUEUE_POINTER				      ; 0486

		         53 	  00   B2  0F 00022 	    REMQUE  @0(QUEUE_POINTER), PACKET				      ; 0487

				       6B  1C 00026 	    BVC     7$							      ;

				       55  D4 00028 	    CLRL    R5							      ; 0490

				  0B   A2  95 0002A 	    TSTB    11(QUEUE_POINTER)					      ;

				       5B  12 0002D 	    BNEQ    6$							      ;

				       55  D6 0002F 	    INCL    R5							      ;

		  0000G  CF	       00  FB 00031 	    CALLS   #0, LOCK_IODB					      ; 0502

		         4C 	       55  E9 00036 	    BLBC    R5, 5$						      ; 0503

		         52 	       62  D1 00039 	    CMPL    (QUEUE_POINTER), QUEUE_POINTER			      ; 0504

				       47  12 0003C 	    BNEQ    5$							      ;

		         54 	       69  D0 0003E 	    MOVL    IOC$GL_AQBLIST, P					      ; 0507

		         52 	       54  D1 00041 	    CMPL    P, QUEUE_POINTER					      ; 0508

				       06  12 00044 	    BNEQ    2$							      ;

		         69 	  10   A2  D0 00046 	    MOVL    16(QUEUE_POINTER), IOC$GL_AQBLIST			      ; 0509

				       11  11 0004A 	    BRB     4$							      ; 0508

		         52 	  10   A4  D1 0004C 2$:     CMPL    16(P), QUEUE_POINTER				      ; 0512

				       06  13 00050 	    BEQL    3$							      ;

		         54 	  10   A4  D0 00052 	    MOVL    16(P), P						      ; 0513

				       F4  11 00056 	    BRB     2$							      ; 0512

		    10   A4	  10   A2  D0 00058 3$:     MOVL    16(QUEUE_POINTER), 16(P)				      ; 0514

		  0000G  CF	       00  FB 0005D 4$:     CALLS   #0, UNLOCK_IODB					      ; 0516

				       6B  DD 00062 	    PUSHL   IO_CHANNEL						      ; 0517

		  0000V  CF	       01  FB 00064 	    CALLS   #1, GET_CCB						      ;

		         56 	       50  D0 00069 	    MOVL    R0, CCB						      ;

		         66 	0000G  CF  D0 0006C 	    MOVL    DISK_UCB, (CCB)					      ; 0518

				       6B  DD 00071 	    PUSHL   IO_CHANNEL						      ; 0519

	      00000000G  9F	       01  FB 00073 	    CALLS   #1, @#SYS$DASSGN					      ;

				       7E  7C 0007A 	    CLRQ    -(SP)						      ; 0520

	      00000000G  9F	       02  FB 0007C 	    CALLS   #2, @#SYS$DELPRC					      ;

				       05  11 00083 	    BRB     6$							      ; 0503

		  0000G  CF	       00  FB 00085 5$:     CALLS   #0, UNLOCK_IODB					      ; 0523

	      00000000G  9F	       00  FB 0008A 6$:     CALLS   #0, @#SYS$HIBER					      ; 0524

				       8A  11 00091 	    BRB     1$							      ; 0484

		         0A 	  0A   A3  91 00093 7$:     CMPB    10(PACKET), #10					      ; 0532

				       03  13 00097 	    BEQL    8$							      ;



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:09	DBB3:[F11A.SRC]GETREQ.B32;10					Page 2-5

;

		         67 	       00  FB 00099 	    CALLS   #0, P.AAA						      ; 0533

		         6A 	  1C   A3  D0 0009C 8$:     MOVL    28(PACKET), CURRENT_UCB				      ; 0539

		         50 	       6A  D0 000A0 	    MOVL    CURRENT_UCB, R0					      ; 0540

		         10 	  0A   A0  91 000A3 	    CMPB    10(R0), #16						      ;

				       04  13 000A7 	    BEQL    9$							      ;

		    08   A7	       00  FB 000A9 	    CALLS   #0, P.AAB						      ; 0541

		         50 	       6A  D0 000AD 9$:     MOVL    CURRENT_UCB, R0					      ; 0543

		  0000G  CF	  30   A0  D0 000B0 	    MOVL    48(R0), CURRENT_VCB					      ;

		         50 	0000G  CF  D0 000B6 	    MOVL    CURRENT_VCB, R0					      ; 0544

		         11 	  0A   A0  91 000BB 	    CMPB    10(R0), #17						      ;

				       04  13 000BF 	    BEQL    10$							      ;

		    10   A7	       00  FB 000C1 	    CALLS   #0, P.AAC						      ; 0545

				       6B  DD 000C5 10$:    PUSHL   IO_CHANNEL						      ; 0547

		  0000V  CF	       01  FB 000C7 	    CALLS   #1, GET_CCB						      ;

		         56 	       50  D0 000CC 	    MOVL    R0, CCB						      ;

		         66 	       6A  D0 000CF 	    MOVL    CURRENT_UCB, (CCB)					      ; 0548

		         68 	  18   A3  D0 000D2 	    MOVL    24(PACKET), CURRENT_WINDOW				      ; 0554

		         02 	  18   A3  E9 000D6 	    BLBC    24(PACKET), 11$					      ; 0555

				       68  D4 000DA 	    CLRL    CURRENT_WINDOW					      ; 0556

		         06 	  18   A3  93 000DC 11$:    BITB    24(PACKET), #6					      ; 0557

				       04  13 000E0 	    BEQL    12$							      ;

		    18   A7	       00  FB 000E2 	    CALLS   #0, P.AAD						      ; 0558

		         50 	       68  D0 000E6 12$:    MOVL    CURRENT_WINDOW, R0					      ; 0560

				       2E  13 000E9 	    BEQL    15$							      ;

		         12 	  0A   A0  91 000EB 	    CMPB    10(R0), #18						      ; 0563

				       04  13 000EF 	    BEQL    13$							      ;

		    20   A7	       00  FB 000F1 	    CALLS   #0, P.AAE						      ; 0564

		         50 	       68  D0 000F5 13$:    MOVL    CURRENT_WINDOW, R0					      ; 0566

	   04 	    0B   A0	       02  E1 000F8 	    BBC     #2, 11(R0), 14$					      ;

		    28   A7	       00  FB 000FD 	    CALLS   #0, P.AAF						      ; 0567

		         50 	       68  D0 00101 14$:    MOVL    CURRENT_WINDOW, R0					      ; 0569

		  0000G  CF	  18   A0  D0 00104 	    MOVL    24(R0), PRIMARY_FCB					      ;

		         50 	0000G  CF  D0 0010A 	    MOVL    PRIMARY_FCB, R0					      ; 0570

		         07 	  0A   A0  91 0010F 	    CMPB    10(R0), #7						      ;

				       04  13 00113 	    BEQL    15$							      ;

		    30   A7	       00  FB 00115 	    CALLS   #0, P.AAG						      ; 0571

	   16 	    2A   A3	       03  E1 00119 15$:    BBC     #3, 42(PACKET), 16$					      ; 0582

		         50 	  2C   B3  D0 0011E 	    MOVL    @44(PACKET), ABD					      ; 0585

				  02   A0  B4 00122 	    CLRW    2(ABD)						      ; 0586

		    34   A3	  1C   A3  D1 00125 	    CMPL    28(PACKET), 52(PACKET)				      ; 0587

				       1C  13 0012A 	    BEQL    17$							      ;

		  0000G  CF	  80   8F  88 0012C 	    BISB2   #128, CLEANUP_FLAGS					      ; 0588

				       14  11 00132 	    BRB     17$							      ; 0582

      20   A3	         06 	       00  ED 00134 16$:    CMPZV   #0, #6, 32(PACKET), #47				      ; 0596

				       2F     00139									      ;

				       0C  1B 0013A 	    BLEQU   17$							      ;

      20   A3	         06 	       00  ED 0013C 	    CMPZV   #0, #6, 32(PACKET), #56				      ; 0597

				       38     00141									      ;

				       04  13 00142 	    BEQL    17$							      ;

		    38   A7	       00  FB 00144 	    CALLS   #0, P.AAH						      ; 0598

		         50 	       53  D0 00148 17$:    MOVL    PACKET, R0						      ; 0601

					   04 0014B 	    RET     							      ; 0412



; Routine Size:  332 bytes





; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:09	DBB3:[F11A.SRC]GETREQ.B32;10					Page 2-6

;





; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:09	DBB3:[F11A.SRC]GETREQ.B32;10					Page 3

;

;	0604	GLOBAL ROUTINE GET_CCB (CHANNEL) =

;	0605	

;	0606	!++

;	0607	!

;	0608	! FUNCTIONAL DESCRIPTION:

;	0609	!

;	0610	!	This routine returns the address of the channel control block

;	0611	!	associated with the given channel.

;	0612	!

;	0613	!

;	0614	! CALLING SEQUENCE:

;	0615	!	GET_CCB (ARG1)

;	0616	!

;	0617	! INPUT PARAMETERS:

;	0618	!	ARG1: channel number

;	0619	!

;	0620	! IMPLICIT INPUTS:

;	0621	!	NONE

;	0622	!

;	0623	! OUTPUT PARAMETERS:

;	0624	!	NONE

;	0625	!

;	0626	! IMPLICIT OUTPUTS:

;	0627	!	NONE

;	0628	!

;	0629	! ROUTINE VALUE:

;	0630	!	address of CCB

;	0631	!

;	0632	! SIDE EFFECTS:

;	0633	!	NONE

;	0634	!

;	0635	!--

;	0636	

;	0637	

;	0638	BEGIN

;	0639	

;	0640	LINKAGE

;	0641		L_VERIFYCHAN	= JSB (REGISTER = 0) :

;	0642				  GLOBAL (CCB = 1)

;	0643				  NOPRESERVE (2, 3, 4, 5);

;	0644	

;	0645	GLOBAL REGISTER

;	0646		CCB		= 1 : REF BBLOCK; ! CCB address returned

;	0647	

;	0648	LOCAL

;	0649		STATUS,				! status of system call

;	0650		CCB_BASE	: REF BBLOCK;	! other copy of CCB address, due to

;	0651						! faulty flow analysis in BLISS

;	0652	

;	0653	EXTERNAL ROUTINE

;	0654		IOC$VERIFYCHAN	: L_VERIFYCHAN ADDRESSING_MODE (ABSOLUTE);

;	0655						! exec routine to find CCB

;	0656	

;	0657	STATUS = IOC$VERIFYCHAN (.CHANNEL);

;	0658	CCB_BASE = .CCB;



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:09	DBB3:[F11A.SRC]GETREQ.B32;10					Page 3-1

;

;	0659	IF NOT .STATUS

;	0660	THEN BUG_CHECK (INVCHAN, FATAL, 'Invalid ACP channel number');

;	0661	

;	0662	RETURN .CCB_BASE;

;	0663	

;	0664	END;					! end of routine GET_CCB







							    .PSECT  $LOCKEDC2$,NOWRT,2



				  FEFF  0000  00040 P.AAI:  .WORD   0, -257						      ;

					0000* 00044 	    .WORD   <BUG$_INVCHAN!4>					      ;

					      00046	    .BLKB   2



							    .EXTRN  IOC$VERIFYCHAN, BUG$_INVCHAN



							    .PSECT  $CODE$,NOWRT,2



					 0FFC 0014C 	    .ENTRY  GET_CCB, Save R2,R3,R4,R5,R6,R7,R8,R9,R10,R11	      ; 0604

		         50 	  04   AC  D0 0014E 	    MOVL    CHANNEL, R0						      ; 0657

			    00000000G  9F  16 00152 	    JSB     @#IOC$VERIFYCHAN					      ;

		         52 	       51  D0 00158 	    MOVL    CCB, CCB_BASE					      ; 0658

		         05 	       50  E8 0015B 	    BLBS    STATUS, 1$						      ; 0659

		  0000'  CF	       00  FB 0015E 	    CALLS   #0, P.AAI						      ; 0660

		         50 	       52  D0 00163 1$:     MOVL    CCB_BASE, R0					      ; 0662

					   04 00166 	    RET     							      ; 0604



; Routine Size:  27 bytes





;	0665	

;	0666	END

;	0667	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

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

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









;				LIBRARY STATISTICS

;

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

;	File				     Total    Loaded   Percent      Read

;



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:09	DBB3:[F11A.SRC]GETREQ.B32;10					Page 3-2

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582        33         0       249











; Size:		359 code + 72 data bytes

; Run Time:	00:10.4

; Elapsed Time:	00:21.2

; Memory Used:	322 pages

; Compilation Complete

