

; Bliss-32 10.1-416	Monday 21-AUG-1978 23:11:08	DBB3:[F11B.SRC]CREWIN.B32;8					Page 1

;

;	0001	MODULE CREWIN (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'B0006'

;	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 2

;	0029	!

;	0030	! ABSTRACT:

;	0031	!

;	0032	!	This routine creates and initializes a file window.

;	0033	! ENVIRONMENT:

;	0034	!

;	0035	!	STARLET operating system, including privileged system services

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

;	0037	!	in kernel mode.

;	0038	!

;	0039	!--

;	0040	!

;	0041	!

;	0042	! AUTHOR:  Andrew C. Goldstein,	 CREATION DATE:  14-Dec-1976  17:10

;	0043	!

;	0044	! REVISION HISTORY:

;	0045	!

;	0046	!   Andrew C. Goldstein, 16-Feb-1977  14:53

;	0047	!   X0002 - Modify for condition handling

;	0048	!

;	0049	!   Andrew C. Goldstein, 22-Jul-1977  11:13

;	0050	!   X0003 - Add additional arg to TURN_WINDOW

;	0051	!

;	0052	!   Andrew C. Goldstein, 26-Sep-1977  15:17

;	0053	!   X0004 - Add read check and write check file characteristics

;	0054	!

;	0055	!   Andrew C. Goldstein, 14-Dec-1977  14:25



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:11:08	DBB3:[F11B.SRC]CREWIN.B32;8					Page 1-1

;

;	0056	!   X0005 - Modify for structure level 2

;	0057	!

;	0058	!   Andrew C. Goldstein, 5-May-78  11:46

;	0059	!   B0006 - Add maximal window size support

;	0060	!

;	0061	!**

;	0062	

;	0063	

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

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



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:11:08	DBB3:[F11B.SRC]CREWIN.B32;8					Page 2

;

;	0414	GLOBAL ROUTINE CREATE_WINDOW (ACCTL, SIZE, HEADER, PID, FCB) =

;	0415	

;	0416	!++

;	0417	!

;	0418	! FUNCTIONAL DESCRIPTION:

;	0419	!

;	0420	!	This routine creates a file access window.

;	0421	!

;	0422	! CALLING SEQUENCE:

;	0423	!	CREATE_WINDOW (ARG1, ARG2, ARG3, ARG4, ARG5)

;	0424	!

;	0425	! INPUT PARAMETERS:

;	0426	!	ARG1: access control word (from FIB, usually)

;	0427	!	ARG2: size of window in # of pointers

;	0428	!	ARG3: address of file header

;	0429	!	ARG4: PID of accessor

;	0430	!	ARG5: address of file FCB

;	0431	!

;	0432	! IMPLICIT INPUTS:

;	0433	!	CURRENT_VCB: address of VCB of volume in process

;	0434	!	CURRENT_UCB: address of UCB of disk in process

;	0435	!

;	0436	! OUTPUT PARAMETERS:

;	0437	!	NONE

;	0438	!

;	0439	! IMPLICIT OUTPUTS:

;	0440	!	NONE

;	0441	!

;	0442	! ROUTINE VALUE:

;	0443	!	address of window

;	0444	!

;	0445	! SIDE EFFECTS:

;	0446	!	window block created

;	0447	!

;	0448	!--

;	0449	

;	0450	BEGIN

;	0451	

;	0452	MAP

;	0453		HEADER		: REF BBLOCK,	! file header arg

;	0454		FCB		: REF BBLOCK;	! FCB arg

;	0455	

;	0456	LOCAL

;	0457		WINDOW_SIZE,			! actual size of window

;	0458		WINDOW		: REF BBLOCK;	! window created

;	0459	

;	0460	EXTERNAL

;	0461		CURRENT_VCB	: REF BBLOCK,	! VCB in process

;	0462		CURRENT_UCB	: REF BBLOCK;	! UCB in process

;	0463	

;	0464	EXTERNAL ROUTINE

;	0465		ALLOCATE,			! allocate dynamic memory

;	0466		TURN_WINDOW;			! window turner routine

;	0467	

;	0468	! Compute the size of the window. If fixed, allocate it and turn it to



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:11:08	DBB3:[F11B.SRC]CREWIN.B32;8					Page 2-1

;

;	0469	! map VBN 1. If a maximal window is requested (indicated by a size of -1),

;	0470	! the window turner will allocate the window.

;	0471	!

;	0472	

;	0473	WINDOW_SIZE = .SIZE;

;	0474	IF .WINDOW_SIZE EQL 0

;	0475	THEN WINDOW_SIZE = .CURRENT_VCB[VCB$B_WINDOW];

;	0476	

;	0477	IF .WINDOW_SIZE NEQ -1

;	0478	THEN

;	0479	    BEGIN

;	0480	    IF .WINDOW_SIZE GTRU MAX_WINDOW

;	0481	    THEN WINDOW_SIZE = MAX_WINDOW;

;	0482	    IF .WINDOW_SIZE LSSU MIN_WINDOW

;	0483	    THEN WINDOW_SIZE = MIN_WINDOW;

;	0484	    WINDOW = ALLOCATE (.WINDOW_SIZE * 6 + WCB$C_LENGTH, WCB_TYPE);

;	0485	    TURN_WINDOW (.WINDOW, .HEADER, 1, 1);

;	0486	    END

;	0487	ELSE

;	0488	    WINDOW = TURN_WINDOW (0, .HEADER, 1, 1);

;	0489	

;	0490	! Init cells within the window

;	0491	!

;	0492	

;	0493	WINDOW[WCB$L_PID]	= .PID;			! accessor PID

;	0494	WINDOW[WCB$L_ORGUCB]	= .CURRENT_UCB;		! original device UCB

;	0495	WINDOW[WCB$W_ACON]	= .ACCTL<0,16>;		! access control bits

;	0496	WINDOW[WCB$L_FCB]	= .FCB;			! FCB address

;	0497	WINDOW[WCB$V_READ]	= 1;			! read access always allowed

;	0498	WINDOW[WCB$V_WRITE]	= .WINDOW[WCB$V_WRITEAC]; ! write access sometimes

;	0499	IF .HEADER[FH2$V_READCHECK] THEN WINDOW[WCB$V_READCK] = 1;

;	0500	IF .HEADER[FH2$V_WRITCHECK] THEN WINDOW[WCB$V_WRITECK] = 1;

;	0501	

;	0502	RETURN .WINDOW;

;	0503	

;	0504	END;					! end of routine CREATE_WINDOW





							    .TITLE  CREWIN

							    .IDENT  \B0006\



							    .EXTRN  CURRENT_VCB, CURRENT_UCB, ALLOCATE, TURN_WINDOW



							    .PSECT  $CODE$,NOWRT,2



					 000C 00000 	    .ENTRY  CREATE_WINDOW, Save R2,R3				      ; 0414

		         50 	  08   AC  D0 00002 	    MOVL    SIZE, WINDOW_SIZE					      ; 0473

				       09  12 00006 	    BNEQ    1$							      ; 0474

		         51 	0000G  CF  D0 00008 	    MOVL    CURRENT_VCB, R1					      ; 0475

		         50 	  48   A1  9A 0000D 	    MOVZBL  72(R1), WINDOW_SIZE					      ;

		         53 	  0C   AC  D0 00011 1$:     MOVL    HEADER, R3						      ; 0485

	      FFFFFFFF   8F	       50  D1 00015 	    CMPL    WINDOW_SIZE, #-1					      ; 0477

				       32  13 0001C 	    BEQL    4$							      ;

	      00000050   8F	       50  D1 0001E 	    CMPL    WINDOW_SIZE, #80					      ; 0480

				       04  1B 00025 	    BLEQU   2$							      ;



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:11:08	DBB3:[F11B.SRC]CREWIN.B32;8					Page 2-2

;

		         50 	  50   8F  9A 00027 	    MOVZBL  #80, WINDOW_SIZE					      ; 0481

		         01 	       50  D1 0002B 2$:     CMPL    WINDOW_SIZE, #1					      ; 0482

				       03  1E 0002E 	    BGEQU   3$							      ;

		         50 	       01  D0 00030 	    MOVL    #1, WINDOW_SIZE					      ; 0483

				       01  DD 00033 3$:     PUSHL   #1							      ; 0484

		         50 	       06  C4 00035 	    MULL2   #6, R0						      ;

				  24   A0  9F 00038 	    PUSHAB  36(R0)						      ;

		  0000G  CF	       02  FB 0003B 	    CALLS   #2, ALLOCATE					      ;

		         52 	       50  D0 00040 	    MOVL    R0, WINDOW						      ;

				       01  DD 00043 	    PUSHL   #1							      ; 0485

				       01  DD 00045 	    PUSHL   #1							      ;

				       0C  BB 00047 	    PUSHR   #^M<R2,R3>						      ;

		  0000G  CF	       04  FB 00049 	    CALLS   #4, TURN_WINDOW					      ;

				       10  11 0004E 	    BRB     5$							      ; 0477

				       01  DD 00050 4$:     PUSHL   #1							      ; 0488

				       01  DD 00052 	    PUSHL   #1							      ;

				       53  DD 00054 	    PUSHL   R3							      ;

				       7E  D4 00056 	    CLRL    -(SP)						      ;

		  0000G  CF	       04  FB 00058 	    CALLS   #4, TURN_WINDOW					      ;

		         52 	       50  D0 0005D 	    MOVL    R0, WINDOW						      ;

		    0C   A2	  10   AC  D0 00060 5$:     MOVL    PID, 12(WINDOW)					      ; 0493

		    10   A2	0000G  CF  D0 00065 	    MOVL    CURRENT_UCB, 16(WINDOW)				      ; 0494

		    14   A2	  04   AC  B0 0006B 	    MOVW    ACCTL, 20(WINDOW)					      ; 0495

		    18   A2	  14   AC  D0 00070 	    MOVL    FCB, 24(WINDOW)					      ; 0496

		    0B   A2	       01  88 00075 	    BISB2   #1, 11(WINDOW)					      ; 0497

	   01 	         01 	  15   A2  F0 00079 	    INSV    21(WINDOW), #1, #1, 11(WINDOW)			      ; 0498

				  0B   A2     0007E									      ;

	   04 	    34   A3	       03  E1 00080 	    BBC     #3, 52(R3), 6$					      ; 0499

		    15   A2	       02  88 00085 	    BISB2   #2, 21(WINDOW)					      ;

	   04 	    34   A3	       04  E1 00089 6$:     BBC     #4, 52(R3), 7$					      ; 0500

		    14   A2	       20  88 0008E 	    BISB2   #32, 20(WINDOW)					      ;

		         50 	       52  D0 00092 7$:     MOVL    WINDOW, R0						      ; 0502

					   04 00095 	    RET     							      ; 0414



; Routine Size:  150 bytes





;	0505	

;	0506	END

;	0507	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

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











; Bliss-32 10.1-416	Monday 21-AUG-1978 23:11:08	DBB3:[F11B.SRC]CREWIN.B32;8					Page 2-3

;

;				LIBRARY STATISTICS

;

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

;	File				     Total    Loaded   Percent      Read

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582        20         0       234











; Size:		150 code + 0 data bytes

; Run Time:	00:05.4

; Elapsed Time:	00:13.5

; Memory Used:	282 pages

; Compilation Complete

