

; Bliss-32 10.1-416	Monday 21-AUG-1978 22:49:24	DBB3:[F11A.SRC]CHKDMO.B32;13					Page 1

;

;	0001	MODULE CHKDMO (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'A0007A'

;	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 dismounts the volume in use if it should be.

;	0033	!

;	0034	! ENVIRONMENT:

;	0035	!

;	0036	!	STARLET operating system, including privileged system services

;	0037	!	and internal exec routines.

;	0038	!

;	0039	!--

;	0040	!

;	0041	!

;	0042	! AUTHOR:  Andrew C. Goldstein,	 CREATION DATE:  29-Apr-1977  17:19

;	0043	!

;	0044	! REVISION HISTORY:

;	0045	!

;	0046	!   Andrew C. Goldstein, 5-May-1977  22:31

;	0047	!   X0002 - Clear volume protection in UCB on dismount

;	0048	!

;	0049	!   Andrew C. Goldstein, 9-May-1977  16:48

;	0050	!   X0003 - Add call to flush buffer pool

;	0051	!

;	0052	!   Andrew C. Goldstein, 1-Nov-1977  18:04

;	0053	!   X0004 - Leave DEV$V_DIR set on dismount

;	0054	!

;	0055	!   Andrew C. Goldstein, 16-May-78  16:31



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:49:24	DBB3:[F11A.SRC]CHKDMO.B32;13					Page 1-1

;

;	0056	!   A0005 - Clear software valid bit, add UNLOAD option

;	0057	!

;	0058	!   Andrew C. Goldstein, 21-Jun-78  17:20

;	0059	!   A0006 - Add UCB dismount sequence count

;	0060	!

;	0061	!   Andrew C. Goldstein, 26-Jun-78  16:53

;	0062	!   A0007 - Add dismount error log entry

;	0063	!

;	0064	!**

;	0065	

;	0066	

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

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

;	0387	

;	0388	

;	0389	!

;	0390	! Part of this routine runs at IPL$_SYNCH, so it must be locked into the

;	0391	! working set.

;	0392	!

;	0393	

;	0394	LOCK_CODE;



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:49:24	DBB3:[F11A.SRC]CHKDMO.B32;13					Page 2

;

;	0395	GLOBAL ROUTINE CHECK_DISMOUNT : NOVALUE =

;	0396	

;	0397	!++

;	0398	!

;	0399	! FUNCTIONAL DESCRIPTION:

;	0400	!

;	0401	!	This routine checks if the volume in use is marked for dismount and

;	0402	!	idle. If so, it completes the dismount.

;	0403	!

;	0404	! CALLING SEQUENCE:

;	0405	!	CHECK_DISMOUNT ()

;	0406	!

;	0407	! INPUT PARAMETERS:

;	0408	!	NONE

;	0409	!

;	0410	! IMPLICIT INPUTS:

;	0411	!	CURRENT_UCB: UCB of unit in use

;	0412	!	CURRENT_VCB: VCB of volume in use

;	0413	!	ACP$AQB0: queue header for ACP

;	0414	!

;	0415	! OUTPUT PARAMETERS:

;	0416	!	NONE

;	0417	!

;	0418	! IMPLICIT OUTPUTS:

;	0419	!	NONE

;	0420	!

;	0421	! ROUTINE VALUE:

;	0422	!	NONE

;	0423	!

;	0424	! SIDE EFFECTS:

;	0425	!	Volume dismounted if appropriate

;	0426	!

;	0427	!--

;	0428	

;	0429	BEGIN

;	0430	

;	0431	LOCAL

;	0432		UCB		: REF BBLOCK,	! local address of UCB

;	0433		VCB		: REF BBLOCK,	! local address of VCB

;	0434		FCB		: REF BBLOCK;	! local address of FCB

;	0435	

;	0436	EXTERNAL

;	0437		IO_CHANNEL,			! channel number for all I/O

;	0438		CURRENT_UCB	: REF BBLOCK,	! UCB of unit in process

;	0439		CURRENT_VCB	: REF BBLOCK,	! VCB of volume in process

;	0440		QUEUE_HEAD	: REF BBLOCK;	! address of ACP queue header

;	0441	

;	0442	EXTERNAL ROUTINE

;	0443		LOCK_IODB,			! lock I/O data base mutex

;	0444		UNLOCK_IODB,			! unlock I/O data base mutex

;	0445		DEALLOCATE,			! deallocate dynamic memory

;	0446		FLUSH_FID,			! flush blocks from the buffer pool

;	0447		SEND_ERRLOG;			! send message to error logger

;	0448	

;	0449	



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:49:24	DBB3:[F11A.SRC]CHKDMO.B32;13					Page 2-1

;

;	0450	! First check the mark for dismount bit.

;	0451	!

;	0452	

;	0453	UCB = .CURRENT_UCB;

;	0454	IF NOT .BBLOCK [UCB[UCB$L_DEVCHAR], DEV$V_DMT]

;	0455	THEN RETURN;

;	0456	

;	0457	! The volume is marked for dismount. The remainder of the tests and the

;	0458	! dismount bit twiddling must be done interlocked.

;	0459	!

;	0460	

;	0461	LOCK_IODB ();

;	0462	SET_IPL (IPL$_SYNCH);

;	0463	

;	0464	VCB = .CURRENT_VCB;

;	0465	IF .VCB[VCB$W_TRANS] EQL 1

;	0466	THEN

;	0467	    BEGIN

;	0468	

;	0469	! The volume is marked for dismount and idle. Make an error log entry to

;	0470	! record the dismount.

;	0471	!

;	0472	

;	0473	    SEND_ERRLOG (0, .UCB);

;	0474	

;	0475	! Mark the volume dismounted and disconnect the VCB from the UCB.

;	0476	!

;	0477	

;	0478	    BBLOCK [UCB[UCB$L_DEVCHAR], DEV$V_MNT] = 0;

;	0479	    BBLOCK [UCB[UCB$L_DEVCHAR], DEV$V_DMT] = 0;

;	0480	    BBLOCK [UCB[UCB$L_DEVCHAR], DEV$V_SWL] = 0;

;	0481	    UCB[UCB$V_VALID] = 0;

;	0482	    UCB[UCB$L_VCB] = 0;

;	0483	    UCB[UCB$W_VPROT] = 0;

;	0484	    UCB[UCB$L_OWNUIC] = 0;

;	0485	    UCB[UCB$W_DIRSEQ] = .UCB[UCB$W_DIRSEQ] + 1;

;	0486	

;	0487	! We can now release the locks while we proceed to clean up the mounted

;	0488	! volume data base.

;	0489	!

;	0490	

;	0491	    UNLOCK_IODB ();

;	0492	

;	0493	    FCB = .VCB[VCB$L_FCBFL];		! index file FCB

;	0494	    DEALLOCATE (.FCB[FCB$L_WLFL]);	! release index file window

;	0495	

;	0496	    WHILE 1 DO

;	0497		BEGIN

;	0498		IF REMQUE (.VCB[VCB$L_FCBFL], FCB) THEN EXITLOOP;

;	0499		DEALLOCATE (.FCB);		! release all FCB's

;	0500		END;

;	0501	

;	0502	    DEALLOCATE (.VCB);			! release the VCB

;	0503	

;	0504	! Flush the buffer pool of any blocks of this volume.



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:49:24	DBB3:[F11A.SRC]CHKDMO.B32;13					Page 2-2

;

;	0505	! ***** Note - this call must be moved to exec mode if we get a write on

;	0506	! ***** replace cache.

;	0507	!

;	0508	

;	0509	    FLUSH_FID (0);

;	0510	

;	0511	! Issue an unload function if unload was requested.

;	0512	!

;	0513	

;	0514	    IF .UCB[UCB$V_UNLOAD]

;	0515	    THEN $QIOW (

;     P 0516			CHAN = .IO_CHANNEL,

;     P 0517			EFN  = EFN,

;     P 0518			FUNC = IO$_UNLOAD

;     P 0519			);

;	0520	

;	0521	    QUEUE_HEAD[AQB$B_MNTCNT] = .QUEUE_HEAD[AQB$B_MNTCNT] - 1;

;	0522	    END				! end of dismount processing

;	0523	

;	0524	ELSE

;	0525	    UNLOCK_IODB ();

;	0526	

;	0527	END;					! end of routine CHECK_DISMOUNT





							    .TITLE  CHKDMO

							    .IDENT  \A0007A\



							    .EXTRN  IO_CHANNEL, CURRENT_UCB, CURRENT_VCB, QUEUE_HEAD

							    .EXTRN  LOCK_IODB, UNLOCK_IODB, DEALLOCATE, FLUSH_FID

							    .EXTRN  SEND_ERRLOG, SYS$QIOW



							    .PSECT  $LOCKEDC1$,NOWRT,2



					 001C 00000 	    .ENTRY  CHECK_DISMOUNT, Save R2,R3,R4			      ; 0395

		         52 	0000G  CF  D0 00002 	    MOVL    CURRENT_UCB, UCB					      ; 0453

	   01 	    36   A2	       05  E0 00007 	    BBS     #5, 54(UCB), 1$					      ; 0454

					   04 0000C 	    RET     							      ;

		  0000G  CF	       00  FB 0000D 1$:     CALLS   #0, LOCK_IODB					      ; 0461

		         12 	       07  DA 00012 	    MTPR    #7, #18						      ; 0462

		         54 	0000G  CF  D0 00015 	    MOVL    CURRENT_VCB, VCB					      ; 0464

		         01 	  0C   A4  B1 0001A 	    CMPW    12(VCB), #1						      ; 0465

				       6E  12 0001E 	    BNEQ    5$							      ;

				       52  DD 00020 	    PUSHL   UCB							      ; 0473

				       7E  D4 00022 	    CLRL    -(SP)						      ;

		  0000G  CF	       02  FB 00024 	    CALLS   #2, SEND_ERRLOG					      ;

		    36   A2	0228   8F  AA 00029 	    BICW2   #552, 54(UCB)					      ; 0480

		    59   A2	       08  8A 0002F 	    BICB2   #8, 89(UCB)						      ; 0481

				  30   A2  D4 00033 	    CLRL    48(UCB)						      ; 0482

				  1A   A2  B4 00036 	    CLRW    26(UCB)						      ; 0483

				  1C   A2  D4 00039 	    CLRL    28(UCB)						      ; 0484

				0088   C2  B6 0003C 	    INCW    136(UCB)						      ; 0485

		  0000G  CF	       00  FB 00040 	    CALLS   #0, UNLOCK_IODB					      ; 0491

		         53 	       64  D0 00045 	    MOVL    (VCB), FCB						      ; 0493

				  10   A3  DD 00048 	    PUSHL   16(FCB)						      ; 0494



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:49:24	DBB3:[F11A.SRC]CHKDMO.B32;13					Page 2-3

;

		  0000G  CF	       01  FB 0004B 2$:     CALLS   #1, DEALLOCATE					      ;

		         53 	  00   B4  0F 00050 	    REMQUE  @0(VCB), FCB					      ; 0498

				       04  1D 00054 	    BVS     3$							      ;

				       53  DD 00056 	    PUSHL   FCB							      ; 0499

				       F1  11 00058 	    BRB     2$							      ;

				       54  DD 0005A 3$:     PUSHL   VCB							      ; 0502

		  0000G  CF	       01  FB 0005C 	    CALLS   #1, DEALLOCATE					      ;

				       7E  D4 00061 	    CLRL    -(SP)						      ; 0509

		  0000G  CF	       01  FB 00063 	    CALLS   #1, FLUSH_FID					      ;

	   18 	    59   A2	       04  E1 00068 	    BBC     #4, 89(UCB), 4$					      ; 0514

				       7E  7C 0006D 	    CLRQ    -(SP)						      ; 0519

				       7E  7C 0006F 	    CLRQ    -(SP)						      ;

				       7E  7C 00071 	    CLRQ    -(SP)						      ;

				       7E  7C 00073 	    CLRQ    -(SP)						      ;

		         7E 	       01  7D 00075 	    MOVQ    #1, -(SP)						      ;

				0000G  CF  DD 00078 	    PUSHL   IO_CHANNEL						      ;

				       01  DD 0007C 	    PUSHL   #1							      ;

	      00000000G  9F	       0C  FB 0007E 	    CALLS   #12, @#SYS$QIOW					      ;

		         50 	0000G  CF  D0 00085 4$:     MOVL    QUEUE_HEAD, R0					      ; 0521

				  0B   A0  97 0008A 	    DECB    11(R0)						      ;

					   04 0008D 	    RET     							      ; 0465

		  0000G  CF	       00  FB 0008E 5$:     CALLS   #0, UNLOCK_IODB					      ; 0525

					   04 00093 6$:     RET     							      ; 0395



; Routine Size:  148 bytes





;	0528	

;	0529	END

;	0530	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $LOCKEDC1$     	   148  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        18         0       238











; Bliss-32 10.1-416	Monday 21-AUG-1978 22:49:24	DBB3:[F11A.SRC]CHKDMO.B32;13					Page 2-4

;



; Size:		148 code + 0 data bytes

; Run Time:	00:06.0

; Elapsed Time:	00:12.5

; Memory Used:	291 pages

; Compilation Complete

