

; Bliss-32 10.1-416	Monday 21-AUG-1978 22:52:45	DBB3:[F11A.SRC]CREWIN.B32;8					Page 1

;

;	0001	MODULE CREWIN (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'A0005'

;	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 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, 5-May-78  13:21



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:52:45	DBB3:[F11A.SRC]CREWIN.B32;8					Page 1-1

;

;	0056	!   A0005 - Add maximal window size support

;	0057	!

;	0058	!**

;	0059	

;	0060	

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

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



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:52:45	DBB3:[F11A.SRC]CREWIN.B32;8					Page 2

;

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

;	0382	

;	0383	!++

;	0384	!

;	0385	! FUNCTIONAL DESCRIPTION:

;	0386	!

;	0387	!	This routine creates a file access window.

;	0388	!

;	0389	! CALLING SEQUENCE:

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

;	0391	!

;	0392	! INPUT PARAMETERS:

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

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

;	0395	!	ARG3: address of file header

;	0396	!	ARG4: PID of accessor

;	0397	!	ARG5: address of file FCB

;	0398	!

;	0399	! IMPLICIT INPUTS:

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

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

;	0402	!

;	0403	! OUTPUT PARAMETERS:

;	0404	!	NONE

;	0405	!

;	0406	! IMPLICIT OUTPUTS:

;	0407	!	NONE

;	0408	!

;	0409	! ROUTINE VALUE:

;	0410	!	address of window

;	0411	!

;	0412	! SIDE EFFECTS:

;	0413	!	window block created

;	0414	!

;	0415	!--

;	0416	

;	0417	BEGIN

;	0418	

;	0419	MAP

;	0420		HEADER		: REF BBLOCK,	! file header arg

;	0421		FCB		: REF BBLOCK;	! FCB arg

;	0422	

;	0423	LOCAL

;	0424		WINDOW_SIZE,			! actual size of window

;	0425		WINDOW		: REF BBLOCK;	! window created

;	0426	

;	0427	EXTERNAL

;	0428		CURRENT_VCB	: REF BBLOCK,	! VCB in process

;	0429		CURRENT_UCB	: REF BBLOCK;	! UCB in process

;	0430	

;	0431	EXTERNAL ROUTINE

;	0432		ALLOCATE,			! allocate dynamic memory

;	0433		TURN_WINDOW;			! window turner routine

;	0434	

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



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:52:45	DBB3:[F11A.SRC]CREWIN.B32;8					Page 2-1

;

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

;	0437	! the window turner will allocate the window.

;	0438	!

;	0439	

;	0440	WINDOW_SIZE = .SIZE;

;	0441	IF .WINDOW_SIZE EQL 0

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

;	0443	

;	0444	IF .WINDOW_SIZE NEQ -1

;	0445	THEN

;	0446	    BEGIN

;	0447	    IF .WINDOW_SIZE GTRU MAX_WINDOW

;	0448	    THEN WINDOW_SIZE = MAX_WINDOW;

;	0449	    IF .WINDOW_SIZE LSSU MIN_WINDOW

;	0450	    THEN WINDOW_SIZE = MIN_WINDOW;

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

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

;	0453	    END

;	0454	ELSE

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

;	0456	

;	0457	! Init cells within the window

;	0458	!

;	0459	

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

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

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

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

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

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

;	0466	IF .HEADER[FH1$V_READCHECK] THEN WINDOW[WCB$V_READCK] = 1;

;	0467	IF .HEADER[FH1$V_WRITCHECK] THEN WINDOW[WCB$V_WRITECK] = 1;

;	0468	

;	0469	RETURN .WINDOW;

;	0470	

;	0471	END;					! end of routine CREATE_WINDOW





							    .TITLE  CREWIN

							    .IDENT  \A0005\



							    .EXTRN  CURRENT_VCB, CURRENT_UCB, ALLOCATE, TURN_WINDOW



							    .PSECT  $CODE$,NOWRT,2



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

		         50 	  08   AC  D0 00002 	    MOVL    SIZE, WINDOW_SIZE					      ; 0440

				       09  12 00006 	    BNEQ    1$							      ; 0441

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

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

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

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

				       32  13 0001C 	    BEQL    4$							      ;

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

				       04  1B 00025 	    BLEQU   2$							      ;



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:52:45	DBB3:[F11A.SRC]CREWIN.B32;8					Page 2-2

;

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

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

				       03  1E 0002E 	    BGEQU   3$							      ;

		         50 	       01  D0 00030 	    MOVL    #1, WINDOW_SIZE					      ; 0450

				       01  DD 00033 3$:     PUSHL   #1							      ; 0451

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

				       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$							      ; 0444

				       01  DD 00050 4$:     PUSHL   #1							      ; 0455

				       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)					      ; 0460

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

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

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

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

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

				  0B   A2     0007E									      ;

	   04 	    0C   A3	       03  E1 00080 	    BBC     #3, 12(R3), 6$					      ; 0466

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

	   04 	    0C   A3	       04  E1 00089 6$:     BBC     #4, 12(R3), 7$					      ; 0467

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

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

					   04 00095 	    RET     							      ; 0381



; Routine Size:  150 bytes





;	0472	

;	0473	END

;	0474	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 22:52:45	DBB3:[F11A.SRC]CREWIN.B32;8					Page 2-3

;

;				LIBRARY STATISTICS

;

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

;	File				     Total    Loaded   Percent      Read

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582        14         0       232











; Size:		150 code + 0 data bytes

; Run Time:	00:05.1

; Elapsed Time:	00:10.8

; Memory Used:	279 pages

; Compilation Complete

