WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (1)    3700  DECLARATIONS

   (2)     100  MODIFIED PAGE WRITE COMPLETION AST

   (3)     100  WRTMFYPAG - WRITE MODIFIED PAGES

   (4)     100  GETPFNCTX

   (5)     100  PTESCAN - SCAN ADJACENT PTE'S

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page   1

X0306                                                                                                                            (1)



                                     0000   100 	.TITLE	WRTMFYPAG - WRITE MODIFIED PAGES

                                     0000   200 	.IDENT	/X0306/

                                     0000   300 ;

                                     0000   400 ; COPYRIGHT (C) 1978

                                     0000   500 ; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS 01754

                                     0000   600 ;

                                     0000   700 ; THIS SOFTWARE IS FURNISHED  UNDER A LICENSE FOR USE ONLY ON A SINGLE

                                     0000   800 ; COMPUTER  SYSTEM AND  MAY BE  COPIED ONLY WITH  THE INCLUSION OF THE

                                     0000   900 ; ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE, OR ANY OTHER COPIES THEREOF,

                                     0000  1000 ; MAY NOT BE PROVIDED OR  OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

                                     0000  1100 ; EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE

                                     0000  1200 ; TERMS.  TITLE TO AND  OWNERSHIP OF THE  SOFTWARE  SHALL AT ALL TIMES

                                     0000  1300 ; REMAIN IN DEC.

                                     0000  1400 ;

                                     0000  1500 ; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE

                                     0000  1600 ; AND SHOULD  NOT BE CONSTRUED  AS A COMMITMENT  BY DIGITAL  EQUIPMENT

                                     0000  1700 ; CORPORATION.

                                     0000  1800 ;

                                     0000  1900 ; DEC ASSUMES  NO  RESPONSIBILITY  FOR  THE USE OR  RELIABILITY OF ITS

                                     0000  2000 ; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

                                     0000  2100 

                                     0000  2200 ;++

                                     0000  2300 ; FACILITY:

                                     0000  2400 ;

                                     0000  2500 ; ABSTRACT:

                                     0000  2600 ;

                                     0000  2700 ; ENVIRONMENT:

                                     0000  2800 ;

                                     0000  2900 ; AUTHOR: PETER H. LIPMAN	, CREATION DATE: 3-JAN-77

                                     0000  3000 ;

                                     0000  3100 ; MODIFIED BY:

                                     0000  3200 ;

                                     0000  3300 ;	, : VERSION

                                     0000  3400 ; 01	- 

                                     0000  3500 ;--

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page   2

X0306           DECLARATIONS                                                                                                     (1)



                                     0000  3700 	.SBTTL	DECLARATIONS

                                     0000  3800 ;

                                     0000  3900 ; INCLUDE FILES:

                                     0000  4000 ;

                                     0000  4100 	$CADEF				;CONDITIONAL ASSEMBLY DEFINITIONS

                                     0000  4200 	$IRPDEF				;I/O REQUEST PACKET DEFINITIONS

                                     0000  4300 	$IPLDEF				;PROCESSOR PRIORITY LEVELS

                                     0000  4400 	$PCBDEF				;PROCESS CONTROL BLOCK DEFINITIONS

                                     0000  4500 	$PFLDEF				;PAGE FILE CONTROL BLOCK DEFINITIONS

                                     0000  4600 	$PFNDEF				;PAGE FRAME NUMBER DATA BASE DEFINITIONS

                                     0000  4700 	$PHDDEF				;PROCESS HEADER DEFINITIONS

                                     0000  4800 	$PRDEF				;PROCESSOR REGISTER DEFINITIONS

                                     0000  4900 	$PRIDEF				;PRIORITY INCREMENT CLASS DEFINITIONS

                                     0000  5000 	$PTEDEF				;PAGE TABLE ENTRY DEFINITIONS

                                     0000  5100 	$SECDEF				;SECTION TABLE ENTRY DEFINITIONS

                                     0000  5200 	$VADEF				;VIRTUAL ADDRESS FIELD DEFINITIONS

                                     0000  5300 ;

                                     0000  5400 ; MACROS:

                                     0000  5500 ;

                                     0000  5600 

                                     0000  5700 ;

                                     0000  5800 ; EQUATED SYMBOLS:

                                     0000  5900 ;

                                     0000  6020 	$VIELD	MPW,0,<-

                                     0000  6025 		<SUCCESS,,M>,-		;SUCCESSFUL COMPLETION BIT

                                     0000  6030 		<BADPAG,,M>,-		;THIS PAGE HAD A WRITE ERROR

                                     0000  6040 		<NOTDONE,,M> -		;THESE PAGES WERE NOT WRITTEN

                                     0000  6050 		>

                                     0000  6100 ;

                                     0000  6200 ; OWN STORAGE:

                                     0000  6300 ;

                                 00000000  6400 	.PSECT	$$$210,LONG

                                     0000  6500 

                                     0000  7000 MPW$AL_PTE::

                           00000000  0000  7100 	.LONG	0			;ADDRESS OF PAGE TABLE ENTRY ARRAY

                                     0004  7200 MPW$AW_PHVINDEX::

                           00000000  0004  7300 	.LONG	0			;ADDRESS OF PROCESS HEADER VECTOR INDEX ARRAY

                                     0008  7400 ;

                                     0008  7500 ; **********************************************************************

                                     0008  7600 ;

                                     0008  7700 ; **************** THIS ENTIRE MODULE MUST BE RESIDENT *****************

                                     0008  7800 ;

                                 00000000  7900 	.PSECT	$MMGCOD

                                     0000  8000 ;

                                     0000  8100 ; **********************************************************************

                                     0000  8200 ;

                                     0000  8300 	.LIST	MEB

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page   3

X0306           MODIFIED PAGE WRITE COMPLETION AST                                                                               (2)



                                     0000   100 	.SBTTL	MODIFIED PAGE WRITE COMPLETION AST

                                     0000   200 ;++

                                     0000   300 ; FUNCTIONAL DESCRIPTION:

                                     0000   400 ;

                                     0000   500 ;	THIS ROUTINE IS A KERNEL MODE AST WHICH DOES THE CLEANUP OPERATIONS

                                     0000   600 ; TO COMPLETE THE WRITING OF THE MODIFIED PAGES.  IT ALSO STARTS

                                     0000   700 ; THE NEXT MODIFIED PAGE WRITE IF THERE IS ANY TO DO.

                                     0000   800 ;

                                     0000   900 ; CALLING SEQUENCE:

                                     0000  1000 ;

                                     0000  1100 ;	BSBW	WRITEDONE

                                     0000  1200 ;

                                     0000  1300 ; INPUT PARAMETERS:

                                     0000  1400 ;

                                     0000  1500 ;	IPL = ASTDEL

                                     0000  1600 ;	R5 = AST CONTROL BLOCK = I/O REQUEST PACKET

                                     0000  1700 ;

                                     0000  1800 ; IMPLICIT INPUTS:

                                     0000  1900 ;

                                     0000  2000 ;	NONE

                                     0000  2100 ;

                                     0000  2200 ; OUTPUT PARAMETERS:

                                     0000  2300 ;

                                     0000  2400 ;	R4, R5 ALTERED

                                     0000  2500 ;

                                     0000  2600 ; IMPLICIT OUTPUTS:

                                     0000  2700 ;

                                     0000  2800 ;	NONE

                                     0000  2900 ;

                                     0000  3000 ; COMPLETION CODES:

                                     0000  3100 ;

                                     0000  3200 ;	NONE

                                     0000  3300 ;

                                     0000  3400 ; SIDE EFFECTS:

                                     0000  3500 ;

                                     0000  3600 ;	NONE

                                     0000  3700 ;

                                     0000  3800 ;--

                                     0000  3900 

                                     0000  4400 WRITEDONE:

                     1FC0 8F     BB  0000  4500 	PUSHR	#^M<R6,R7,R8,R9,R10,R11,AP> ;PRESERVE NON-VOLATILE REGISTERS

                                     0004  4600 	DSBINT	#IPL$_SYNCH		;INTERLOCK FOR PFN DATA BASE MANIPULATION

            7E            12     DB  0004       		MFPR	S^#PR$_IPL,-(SP)

            12            07     DA  0007       		MTPR	#IPL$_SYNCH,S^#PR$_IPL

                                     000A  4700 					;SAVE CALLED IPL ON STACK

                          09     EF  000A  4810 	EXTZV	#VA$V_VPN,#<16-VA$V_VPN>,- ;GET ORIGINAL PAGE COUNT

         3E A5            07         000C  4820 		IRP$W_OBCNT(R5),R10

                          5A         000F       

            5B         34 A5     D0  0010  4830 	MOVL	IRP$L_IOST1(R5),R11	;GET ERROR STATUS AND TRANSFERRED BYTE COUNT

            5B            06     CA  0014  4840 	BICL	#<MPW$M_BADPAG ! MPW$M_NOTDONE>,R11 ;CLEAR FLAGS

            50            55     D0  0017  5000 	MOVL	R5,R0			;I/O REQUEST PACKET ADDRESS

                          FFE3'  30  001A  5100 	BSBW	EXE$DEANONPAGED		;DEALLOCATE THE PACKET

                          56     D4  001D  5200 	CLRL	R6			;INIT PTE INDEX

            07            19     EF  001F  5220 	EXTZV	#<16+VA$V_VPN>,#<16-VA$V_VPN>,R11,R7 ;TRANSFERRED PAGE COUNT

            57            5B         0022       

                          71     13  0024  5240 	BEQL	90$			;BRANCH IF NO PAGES SUCCESSFULLY TRANSFERRED

            50       0000'DF46   D0  0026  5300 20$:	MOVL	@W^MPW$AL_PTE[R6],R0	;GET PAGE FRAME NUMBER OF NEXT PAGE

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page   4

X0306           MODIFIED PAGE WRITE COMPLETION AST                                                                               (2)



            54       0004'DF46   32  002C  5400 	CVTWL	@W^MPW$AW_PHVINDEX[R6],R4 ;AND THE CORRESPONDING PROCESS 

                                     0032  5410 					;HEADER VECTOR INDEX

                          07     18  0032  5420 	BGEQ	22$			;BRANCH IF NOT SWAPVBN WRITE

            0F            00     EF  0034  5430 	EXTZV	#0,#15,R4,R4		;FIX UP THE PHV INDEX

            54            54         0037       

                          0C     11  0039  5440 	BRB	25$			;AND IN THE CASE OF A WRITE ERROR

                                     003B  5450 					;DO NOT JAM ON THE MODIFY BIT

            5B            06     D3  003B  5510 22$:	BITL	#<MPW$M_BADPAG ! MPW$M_NOTDONE>,R11 ;NOT SUCCESSFULLY TRANSFERRED?

                          07     13  003E  5520 	BEQL	25$			;BRANCH IF THIS PAGE IS OK

       0000'DF40       80 8F     88  0040  5530 	BISB	#PFN$M_MODIFY,@W^PFN$AB_STATE[R0] ;NOTE PAGE STILL MODIFIED

            58       0000'DF40   90  0047  5600 25$:	MOVB	@W^PFN$AB_TYPE[R0],R8	;PAGE TYPE AND RPTEVT BIT

                          00     ED  004D  5700 	CMPZV	#PFN$V_PAGTYP,#PFN$S_PAGTYP,- ;PROCESS PAGE TABLE?

            58            03         004F  5800 		R8,#PFN$C_PPGTBL

                          04         0051       

                          06     12  0052  5900 	BNEQ	40$			;BRANCH IF NOT

            51            54     D0  0054  6000 	MOVL	R4,R1			;PROCESS HEADER VECTOR INDEX

                          FFA6'  30  0057  6100 	BSBW	MMG$DECPHDREF1		;ONE LESS PROCESS HEADER REF

                                     005A  6200 					;AT PAGE WRITE COMPLETION

                                     005A  6300 40$:	DECREF	GTR=60$			;ONE LESS REFERENCE

                     0000'DF40   B7  005A       		DECW	@W^PFN$AW_REFCNT[R0]

                          14     14  005F       		BGTR	60$

                          03     18  0061       		BGEQ	30000$

                          FF9A'  30  0063       		BSBW	MMG$REFCNTNEG

                                     0066       30000$:

            5B            01     E1  0066  6310 	BBC	#MPW$V_BADPAG,R11,50$	;BRANCH IF NOT PAGE WRITE ERROR PAGE

                          08         0069       

            52            02     9A  006A  6320 	MOVZBL	#PFN$C_BADPAGLST,R2	;PLACE THIS PAGE

                          FF90'  30  006D  6330 	BSBW	MMG$INSPFNT		;ON THE BAD PAGE LIST

                          03     11  0070  6340 	BRB	60$

                          FF8B'  30  0072  6400 50$:	BSBW	MMG$RELPFN		;RELEASE THE PAGE

            54       0000'DF44   32  0075  6500 60$:	CVTWL	@W^PHV$GL_PIXBAS[R4],R4	;CALCULATE PCB ADDRESS FROM PHV INDEX

                          16     19  007B  6600 	BLSS	80$			;BRANCH IF PCB IS GONE

            54       0000'DF44   D0  007D  6700 	MOVL	@W^SCH$GL_PCBVEC[R4],R4	;FETCH PCB ADR

         28 A4            10     E4  0083  6800 	BBSC	#PCB$V_SWPVBN,PCB$L_STS(R4),70$ ;DONE WITH SWPVBN WRITE IF ANY

                          00         0087       

                                     0088  6900 ;

                                     0088  7000 ; IF DELPAG IS WAITING FOR THIS WRITE COMPLETION, THE RPTEVT BIT IS SET

                                     0088  7100 ;

            58            06     E1  0088  7200 70$:	BBC	#PFN$V_RPTEVT,R8,80$	;BRANCH IF NO REPORT EVENT REQUESTED

                          07         008B       

            52            01     9A  008C  7300 	MOVZBL	#PRI$_IOCOM,R2		;I/O COMPLETE PRIORITY CLASS

                                     008F  7400 	RPTEVT	PFCOM			;REPORT PAGE FAULT COMPLETE

                          FF6E'  30  008F       		BSBW	SCH$RSE

                                 00' 0092       		.BYTE	EVT$_PFCOM

            56            57     F2  0093  7500 80$:	AOBLSS	R7,R6,20$		;LOOP THROUGH ALL PAGES

                          8F         0096       

            10            5B     E8  0097  7510 90$:	BLBS	R11,100$		;BRANCH IF PAGE WRITE HAD NO ERROR

                          57     D6  009A  7520 	INCL	R7			;ONE MORE PAGE FOR THE ERROR PAGE

            5B            01     E3  009C  7530 	BBCS	#MPW$V_BADPAG,R11,20$	;BRANCH IF HAVEN'T PROCESSED THE ERROR PAGE

                          86         009F       

                                     00A0  7540 ;

                                     00A0  7550 ; NOW PROCESS THE UNWRITTEN PAGES IF ANY

                                     00A0  7560 ;

            57            5A     D0  00A0  7570 	MOVL	R10,R7			;RESET LIMIT TO ORIGINAL PAGE COUNT

                          56     D7  00A3  7580 	DECL	R6			;IN ORDER TO EXECUTE THE LOOP 0 OR MORE TIMES

            5B            05     90  00A5  7590 	MOVB	#<MPW$M_SUCCESS ! MPW$M_NOTDONE>,R11 ;COMPLETE THE PAGES NOT TRANSFERRED

                          E9     11  00A8  7600 	BRB	80$

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page   5

X0306           MODIFIED PAGE WRITE COMPLETION AST                                                                               (2)



                                     00AA  7650 100$:	SETIPL	(SP)			;BACK TO CALLED IPL

            12            6E     DA  00AA       		MTPR	(SP),S^#PR$_IPL

                          00     DD  00AD  7700 	PUSHL	#0			;NO I/O PACKET ALLOCATED YET

       0000'CF       0000'CF     D1  00AF  7800 	CMPL	W^SCH$GL_MFYCNT,W^SCH$GL_MFYLOLIM ;ENOUGH PAGES ON MODIFY LIST

                                     00B6  7900 					;TO TRY FOR ANOTHER CLUSTER?

                          4D     1A  00B6  8000 	BGTRU	GET_NXT_CLUSTER		;BRANCH IF YES

                          0A     11  00B8  8100 	BRB	NOMOREPAGES		;NO, ALL DONE FOR NOW

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page   6

X0306           WRTMFYPAG - WRITE MODIFIED PAGES                                                                                 (3)



                                     00BA   100 	.SBTTL	WRTMFYPAG - WRITE MODIFIED PAGES

                                     00BA   200 ;++

                                     00BA   300 ; FUNCTIONAL DESCRIPTION:

                                     00BA   400 ;

                                     00BA   500 ;	THIS ROUTINE GATHERS A CLUSTER OF PAGES OF LIKE KIND FROM THE

                                     00BA   600 ; MODIFIED PAGE LIST, AND WRITES THEM BACK TO THEIR BACKING STORE ADDRESSES.

                                     00BA   700 ; FOR PAGING FILE PAGES, THE ADDRESSES ARE REALLOCATED AS A CONTIGUOUS BLOCK

                                     00BA   800 ; AND THE PAGES ARE WRITTEN BACK IN ONE OPERATION.

                                     00BA   900 ;

                                     00BA  1000 ; CALLING SEQUENCE:

                                     00BA  1100 ;

                                     00BA  1200 ;	BSBW	MMG$WRTMFYPAG

                                     00BA  1300 ;

                                     00BA  1400 ; INPUT PARAMETERS:

                                     00BA  1500 ;

                                     00BA  1600 ;	IPL = 0

                                     00BA  1700 ;

                                     00BA  1800 ; IMPLICIT INPUTS:

                                     00BA  1900 ;

                                     00BA  2000 ;	NONE

                                     00BA  2100 ;

                                     00BA  2200 ; OUTPUT PARAMETERS:

                                     00BA  2300 ;

                                     00BA  2400 ;	R4, R5 ALTERED

                                     00BA  2500 ;

                                     00BA  2600 ; IMPLICIT OUTPUTS:

                                     00BA  2700 ;

                                     00BA  2800 ;	NONE

                                     00BA  2900 ;

                                     00BA  3000 ; COMPLETION CODES:

                                     00BA  3100 ;

                                     00BA  3200 ;	NONE

                                     00BA  3300 ;

                                     00BA  3400 ; SIDE EFFECTS:

                                     00BA  3500 ;

                                     00BA  3600 ;	NONE

                                     00BA  3700 ;

                                     00BA  3800 ;--

                                     00BA  3900 ;

                                     00BA  4000 ; NEED TO ALLOCATE AN I/O PACKET AND WAIT IF NONE AVAILABLE

                                     00BA  4100 ; ***** IT IS ASSUMED THAT THIS PROCESS IS RUNNING WITH RESOURCE WAIT ENABLED

                                     00BA  4200 ;

                                     00BA  4300 GET_IRP:

                          FF43'  30  00BA  4400 	BSBW	EXE$ALLOCIRP		;ALLOCATE AN I/O REQUEST PACKET

            51            50     E8  00BD  4500 	BLBS	R0,GOT_IRP		;BRANCH IF GOT ONE, MAY HAVE WAITED

                                     00C0  4600 	BUG_CHECK MPWALCIRP,FATAL	;FAILED TO ALLOCATE I/O REQUEST PACKET

                               FEFF  00C0       		.WORD	^XFEFF

                               0004' 00C2       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_MPWALCIRP!4

                                     00C4  4700 

                                     00C4  4800 NOMOREPAGES:

       0000'CF       0000'CF     D0  00C4  4900 	MOVL	W^SCH$GL_MFYLIMSV,W^SCH$GL_MFYLIM ;RE-ENABLE LIMIT CHECK

       0000'CF       0000'CF     D0  00CB  5000 	MOVL	W^SCH$GL_MFYLOSV,W^SCH$GL_MFYLOLIM ;RESTORE LOW LIMIT

       0000'CF            00'    E7  00D2  5100 	BBCCI	S^#SCH$V_MPW,W^SCH$GB_SIP,10$ ;MODIFIED PAGE WRITER INACTIVE

                          00         00D7       

            50            8E     D0  00D8  5200 10$:	MOVL	(SP)+,R0		;UNUSED I/O PACKET TO RELEASE?

                          08     13  00DB  5300 	BEQL	20$			;BRANCH IF NOT

         08 A0         4C 8F     9A  00DD  5400 	MOVZBL	#IRP$C_LENGTH,IRP$W_SIZE(R0) ;SET SIZE OF PACKET

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page   7

X0306           WRTMFYPAG - WRITE MODIFIED PAGES                                                                                 (3)



                          FF1B'  30  00E2  5500 	BSBW	EXE$DEANONPAGED		;DEALLOCATE THE I/O REQUEST PACKET

                                     00E5  5600 20$:	ENBINT				;RESTORE CALLERS IPL

            12            8E     DA  00E5       		MTPR	(SP)+,S^#PR$_IPL

                     1FC0 8F     BA  00E8  5700 	POPR	#^M<R6,R7,R8,R9,R10,R11,AP> ;RESTORE NON-VOLATILE REGISTERS

                                 05  00EC  5800 	RSB				;AND RETURN

                                     00ED  5900 

                                     00ED  6000 MMG$WRTMFYPAG::

            15            00     ED  00ED  6100 	CMPZV	#PTE$V_PFN,#PTE$S_PFN,W^SCH$GL_MFYLIM,- ;ENOUGH PAGES ON MODIFIED

                                     00F0       

       0000'CF       0000'CF         00F0  6200 		W^SCH$GL_MFYCNT		;PAGE LIST TO CONSIDER WRITING?

                          01     19  00F6  6300 	BLSS	20$			;BRANCH IF YES

                                 05  00F8  6400 10$:	RSB				;NO, NOTHING TO DO FOR NOW

       0000'CF            00'    E6  00F9  6500 20$:	BBSSI	S^#SCH$V_MPW,W^SCH$GB_SIP,10$ ;DO NOTHING IF ALREADY ACTIVE

                          F9         00FE       

                                     00FF  6600 ;

                                     00FF  6700 ; FIRST ENTRY TO MODIFIED PAGE WRITER

                                     00FF  6800 ;

                     1FC0 8F     BB  00FF  6900 	PUSHR	#^M<R6,R7,R8,R9,R10,R11,AP> ;SAVE NON-VOLATILE REGISTERS

                          7E     7C  0103  7000 	CLRQ	-(SP)			;SAVED IPL = 0, NO IRP ALLOCATED

                                     0105  7100 ;

                                     0105  7200 ; SEE IF THERE ARE ANY MORE PAGES TO BE WRITTEN

                                     0105  7300 ; 0(SP) = SAVED I/O REQUEST PACKET ADDRESS OR ZERO IF NONE ALLOCATED YET

                                     0105  7400 ; 4(SP) = CALLERS IPL

                                     0105  7500 ; IPL = ASTDEL OR LOWER

                                     0105  7600 ;

                                     0105  7700 GET_NXT_CLUSTER:

            54       0000'CF     D0  0105  7800 	MOVL	W^SCH$GL_CURPCB,R4	;GET PCB ADDRESS OF THIS PROCESS

                                     010A  7900 ;

                                     010A  8000 ; ***** NOTE THAT PCB$W_DIOCNT(R4) IS ASSUMED GREATER THAN 0

                                     010A  8100 ; ***** SIMULTANEOUS I/O REQUESTS WILL INVALIDATE THIS ASSUMPTION

                                     010A  8200 ;

            52       0000'DF     0F  010A  8300 	REMQUE	@W^IOC$GL_IRPFL,R2	;GET AN I/O REQUEST PACKET

                          A9     1D  010F  8400 	BVS	GET_IRP			;BRANCH IF NONE ON SIDE LIST

                                     0111  8500 GOT_IRP:

            6E            52     D0  0111  8600 	MOVL	R2,(SP)			;SAVE IRP ADDRESS

                                     0114  8700 	SETIPL	#IPL$_SYNCH		;RAISE TO SYNCH FOR THE DURATION

            12            07     DA  0114       		MTPR	#IPL$_SYNCH,S^#PR$_IPL

            50       0000'CF     3C  0117  8800 	MOVZWL	W^PFN$AW_MFYLSTHD,R0	;FIRST PFN IN MODIFIED PAGE LIST

                                     011C  8900 GET_PAGE_TYPE:

                          A6     13  011C  9000 	BEQL	NOMOREPAGES		;BRANCH IF LIST IS EMPTY

                          0151   30  011E  9100 	BSBW	GETPFNCTX		;SET UP TO PROCESS THIS PFN

                          56     D4  0121  9200 	CLRL	R6			;INIT INDEX TO PTE ARRAY

                                     0123  9300 	CASE	R1,<-			;DISPATCH ON BACKING STORE TYPE

                                     0123  9400 		PAGEFILE,-		;PAGING FILE PAGE

                                     0123  9500 		SECTION,-		;SECTION PAGE (PROCESS OR GLOBAL)

                                     0123  9600 		BADBAKADR,-		;GLOBAL BACKING STORE ADDRESS

                                     0123  9700 		SWPVBN  >		;SWPVBN, WRITE BACK TO SWAP FILE

            00            51     AF  0123       	CASEW	R1,#0,S^#<<30002$-30001$>/2>-1

                          03'        0126       

                                     0127       30001$:

                               0016' 0127       	.WORD	PAGEFILE-30001$

                               00DF' 0129       	.WORD	SECTION-30001$

                               0008' 012B       	.WORD	BADBAKADR-30001$

                               0100' 012D       	.WORD	SWPVBN-30001$

                                     012F       30002$:

                                     012F  9800 BADBAKADR:

                                     012F  9900 	BUG_CHECK IVBAKADIO,FATAL	;INVALID BACKING STORE ADDRESS FOR I/O

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page   8

X0306           WRTMFYPAG - WRITE MODIFIED PAGES                                                                                 (3)



                               FEFF  012F       		.WORD	^XFEFF

                               0004' 0131       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_IVBAKADIO!4

                                     0133 10000 ;

                                     0133 10100 ; NO PAGE FILE VBN'S AVAILABLE IN THIS PAGE FILE

                                     0133 10200 ;

                                     0133 10300 NO_PAGEFILE:

                          09     BA  0133 10400 	POPR	#^M<R0,R3>		;RECOVER SAVED REGISTERS

                                     0135 10500 NEXT_MFYPAG:

            50       0000'DF40   3C  0135 10600 	MOVZWL	@W^PFN$AW_FLINK[R0],R0	;CHAIN TO NEXT PAGE

                          DF     11  013B 10700 	BRB	GET_PAGE_TYPE		;AND PROCESS IT

                                     013D 10800 ;

                                     013D 10900 ; PAGE FILE PAGE, GATHER A CLUSTER FROM THE SAME PAGE FILE

                                     013D 11000 ;

                                     013D 11100 PAGEFILE:

            08            18     EF  013D 11200 	EXTZV	#PFN$V_PGFLX,#PFN$S_PGFLX,R2,R7 ;PAGE FILE INDEX

            57            52         0140       

                          09     BB  0142 11300 	PUSHR	#^M<R0,R3>		;SAVE PFN AND SVAPTE

            51            57     D0  0144 11400 	MOVL	R7,R1			;PAGE FILE INDEX

            52       0000'CF     3C  0147 11500 	MOVZWL	W^MPW$GW_MPWPFC,R2	;DESIRED CLUSTER SIZE

                          FEB1'  30  014C 11600 	BSBW	MMG$ALCPAGFIL		;ALLOCATE A CLUSTER

            5B            52     D0  014F 11700 	MOVL	R2,R11			;SAVE NUMBER OF PAGES ALLOCATED

            58            50     D0  0152 11800 	MOVL	R0,R8			;AND THE STARTING PAGE FILE VBN

                          DC     15  0155 11900 	BLEQ	NO_PAGEFILE		;BRANCH IF CANNOT ALLOCATE ANY

                          09     BA  0157 12000 	POPR	#^M<R0,R3>		;RECOVER PFN, SVAPTE

            59            5B     D0  0159 12100 	MOVL	R11,R9			;NUMBER OF PAGEFILE PAGES ALLOCATED

                                     015C 12200 ;

                                     015C 12300 ; AT THIS POINT THE REGISTERS CONTAIN THE FOLLOWING VALUES:

                                     015C 12400 ;	R0  = PFN

                                     015C 12500 ;	R3  = SYSTEM VIRTUAL ADDRESS OF PAGE TABLE ENTRY

                                     015C 12600 ;	R4  = PCB ADDRESS FOR THE PROCESS IN WHICH THIS CODE IS RUNNING

                                     015C 12700 ;	R5  = PHD ADDRESS OF THE PROCESS WHICH OWNS THE MODIFIED PAGE

                                     015C 12800 ;	R6  = INDEX TO NEXT ENTRY TO USE IN PTE AND PHVINDEX ARRAYS

                                     015C 12900 ;	R7  = PAGE FILE INDEX

                                     015C 13000 ;	R8  = NEXT PAGE FILE VBN TO USE

                                     015C 13100 ;	R9  = NUMBER OF PAGE FILE VBN'S NOT YET USED IN THE CLUSTER ALLOCATED

                                     015C 13200 ;	R11 = NUMBER OF PAGE FILE VBN'S ALLOCATED IN THE CLUSTER

                                     015C 13300 ;

                                     015C 13400 PAGFILCLUSTER:

                          5B     DD  015C 13500 	PUSHL	R11			;SAVE COUNT OF ALLOCATED PAGE FILE

            7E       0000'DF40   3C  015E 13600 	MOVZWL	@W^PFN$AW_BLINK[R0],-(SP) ;REMEMBER WHERE TO RESTART SCAN OF LIST

                          0194   30  0164 13700 	BSBW	PTESCAN			;TRY TO GET ADJACENT PAGES TO THIS ONE

                                     0167 13800 ;

                                     0167 13900 ; DONE WITH THIS CLUSTER OF PAGE TABLE ENTRIES

                                     0167 14000 ; IF MORE PAGE FILE VBN'S ARE LEFT, SCAN MODIFIED LIST FOR MORE PAGES

                                     0167 14100 ; IN SAME PAGE FILE.

                                     0167 14200 ; 0(SP) = SAVED PFN (OR 0) TO LINK FORWARD FROM

                                     0167 14300 ; 4(SP) = NUMBER OF PAGE FILE VBN'S ALLOCATED

                                     0167 14400 ;

                     0801 8F     BA  0167 14500 	POPR	#^M<R0,R11>		;R0 = SAVED PFN TO LINK FORWARD

                                     016B 14600 					;R11 = NUMBER OF PAGE FILE VBN'S ALLOCATED

            5B            56     C3  016B 14700 	SUBL3	R6,R11,R9		;NO. OF PAGE FILE VBN'S NOT USED

                          59         016E       

                          24     13  016F 14800 	BEQL	100$			;BRANCH IF USED THEM ALL

                          50     D5  0171 14900 	TSTL	R0			;PFN 0 IS LIST HEAD

                          07     12  0173 15000 	BNEQ	70$			;GET FLINK AS NEXT CANDIDATE

            50       0000'CF     3C  0175 15100 	MOVZWL	W^PFN$AW_MFYLSTHD,R0	;NEXT CANDIDATE FROM FRONT OF LIST

                          06     11  017A 15200 	BRB	75$

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page   9

X0306           WRTMFYPAG - WRITE MODIFIED PAGES                                                                                 (3)



            50       0000'DF40   3C  017C 15300 70$:	MOVZWL	@W^PFN$AW_FLINK[R0],R0	;CHAIN TO NEXT PFN IN LIST

                          11     13  0182 15400 75$:	BEQL	100$			;BRANCH IF END OF LIST

                          00EB   30  0184 15500 80$:	BSBW	GETPFNCTX		;SET UP TO PROCESS THIS PFN

                          51     D5  0187 15600 	TSTL	R1			;PAGE FILE VBN?

                          F1     12  0189 15700 	BNEQ	70$			;BRANCH IF NOT

            08            18     ED  018B 15800 	CMPZV	#PFN$V_PGFLX,#PFN$S_PGFLX,R2,R7 ;SAME PAGE FILE INDEX?

            57            52         018E       

                          EA     12  0190 15900 	BNEQ	70$			;BRANCH IF NOT

                          FFC7   31  0192 16000 	BRW	PAGFILCLUSTER		;FIND ANOTHER PTE CLUSTER

                                     0195 16100 ;

                                     0195 16200 ; SET UP TO WRITE THIS CLUSTER OF PAGES

                                     0195 16300 ;

            58            56     C3  0195 16400 100$:	SUBL3	R6,R8,R11		;FORM AND SAVE FIRST PAGE FILE VBN

                          5B         0198       

            5A       0000'DF47   D0  0199 16450 	MOVL	@W^MMG$GL_PAGSWPVC[R7],R10 ;ADDRESS OF PAGE FILE CONTROL BLOCK

            50            59     D0  019F 16500 	MOVL	R9,R0			;ANY PAGE FILE VBN'S TO DEALLOCATE?

                          2E     13  01A2 16600 	BEQL	140$			;BRANCH IF THEY WERE ALL USED

                                     01A4 16610 ;

                                     01A4 16620 ; THERE WERE R9 PAGES OF PAGE FILE ALLOCATED BUT NOT USED STARTING WITH VBN R8.

                                     01A4 16630 ; MUST RETURN THEM TO THE PAGE FILE

                                     01A4 16640 ;

            52            78     9E  01A4 16650 	MOVAB	-(R8),R2		;R8=R2=R8-1, STARTING PAGE (BASE 0)

            51            20     D0  01A7 16652 	MOVL	#32,R1			;DEALLOCATE 32 BLOCKS AT AT TIME

            51            50     D1  01AA 16654 110$:	CMPL	R0,R1			;FEWER THAN 32 BLOCKS TO DEALLOCATE?

                          03     18  01AD 16656 	BGEQ	120$			;BRANCH IF NOT

            51            50     D0  01AF 16658 	MOVL	R0,R1			;DEALLOCATE WHAT IS LEFT

            52   FFFFFFFF 8F     F0  01B2 16660 120$:	INSV	#-1,R2,R1,@PFL$L_BITMAP(R10) ;MAKE THE PAGES AVAILABLE AGAIN

         00 BA            51         01B9       

            52            51     C0  01BC 16662 	ADDL	R1,R2			;NEXT STARTING BLOCK TO DEALLOCATE

            50            51     C2  01BF 16664 	SUBL	R1,R0			;NUMBER OF BLOCKS LEFT TO DEALLOCATE

                          E6     14  01C2 16666 	BGTR	110$			;BRANCH IF MORE TO DEALLOCATE

                                     01C4 16670 ;

                                     01C4 16680 ; NORMALLY WHEN PAGES ARE DEALLOCATED TO THE PAGE FILE, A CHECK IS MADE

                                     01C4 16690 ; TO SEE IF THE PAGE FILE HAD BEEN OUT OF FREE PAGES IN WHICH CASE THE  

                                     01C4 16700 ; PAGE FILE RESOURCE IS REPORTED AS AVAILABLE (SCH$RAVAIL).

                                     01C4 16710 ; THIS CHECK IS NOT NECESSARY HERE BECAUSE THE ALLOCATION AND DEALLOCATION

                                     01C4 16720 ; WERE DONE WITHOUT DROPPING IPL BELOW SYNCH.

                                     01C4 16730 ;

         18 AA            59     C0  01C4 16740 	ADDL	R9,PFL$L_FREPAGCNT(R10)	;UPDATE THE FREE PAGE COUNT

         1C AA            59     C0  01C8 16745 	ADDL	R9,PFL$L_RESERVCNT(R10)	;UPDATE RESERVED PAGES COUNT

            58         FD 8F     78  01CC 16750 	ASHL	#-3,R8,PFL$L_STARTBYTE(R10) ;MOVE STARTING BYTE BACK

                       04 AA         01D0       

                                     01D2 17100 ;

                                     01D2 17200 ; NOW SET UP TO DO THE CALL TO BUILDPKT

                                     01D2 17300 ;	R6  = NO. OF PAGES TO TRANSFER

                                     01D2 17400 ;	R7  = PAGE FILE INDEX

                                     01D2 17450 ;	R10 = PAGE FILE CONTROL BLOCK ADDRESS

                                     01D2 17500 ;	R11 = STARTING PAGEFILE VBN

                                     01D2 17600 ;

                                     01D2 17900 	ASSUME	SEC$L_VBN EQ PFL$L_VBN

                                     01D2 18000 	ASSUME	SEC$L_WINDOW EQ PFL$L_WINDOW

         10 AA            5B     C1  01D2 18100 140$:	ADDL3	R11,PFL$L_VBN(R10),R0	;FORM VBN IN PAGE FILE

                          50         01D6       

            52         0C AA     D0  01D7 18200 	MOVL	PFL$L_WINDOW(R10),R2	;WINDOW ADDRESS

                                     01DB 18300 ;

                                     01DB 18400 ; 0(SP) = ADDRESS OF I/O REQUEST PACKET

                                     01DB 18500 ; 4(SP) = CALLER'S IPL

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page  10

X0306           WRTMFYPAG - WRITE MODIFIED PAGES                                                                                 (3)



                                     01DB 18600 ; R0 = VBN IN FILE TO WRITE

                                     01DB 18700 ; R2 = ADDRESS OF WINDOW FOR FILE

                                     01DB 18800 ; R4 = PROCESS CONTROL BLOCK ADDRESS FOR THE PROCESS IN WHICH THIS CODE IS RUNNING

                                     01DB 18900 ; R6 = NUMBER OF PAGES TO WRITE

                                     01DB 19000 ;

                                     01DB 19100 MPW_BLDPKT:

            56            09     78  01DB 19200 	ASHL	#9,R6,R1		;NUMBER OF BYTES TO WRITE

                          51         01DE       

            53       0000'DF     DE  01DF 19300 	MOVAL	@W^MPW$AL_PTE,R3	;SVAPTE FOR TRANSFER

            55            8E     D0  01E4 19400 	MOVL	(SP)+,R5		;GET I/O PACKET ADDRESS

         14 A5       FE15 CF     DE  01E7 19600 	MOVAL	W^WRITEDONE,IRP$L_ASTPRM(R5) ;ADDRESS OF KERNEL MODE AST

                                     01ED 19700 					;FOR WRITE COMPLETION PROCESSING

         23 A5         33 A4     90  01ED 19800 	MOVB	PCB$B_PRIB(R4),IRP$B_PRI(R5) ;SET TRANSFER PRIORITY

                          FE0B'  30  01F2 19900 	BSBW	EXE$BLDPKTSWPW		;BUILD AND QUEUE THE I/O REQUEST PACKET

                                     01F5 20000 ;

                                     01F5 20100 ; R4 NO LONGER HAS PCB ADDRESS IN IT

                                     01F5 20200 ;

                                     01F5 20300 	ENBINT				;BACK TO CALLED IPL

            12            8E     DA  01F5       		MTPR	(SP)+,S^#PR$_IPL

                                     01F8 20400 

                           00000002  01F8 20500 	.IF	GT,CA$_MEASURE

       0000'CF            56     C0  01F8 20600 	ADDL	R6,W^PMS$GL_PWRITES	;COUNT THE PAGES WRITTEN

                     0000'CF     D6  01FD 20700 	INCL	W^PMS$GL_PWRITIO	;AND THE NUMBER OF WRITE REQUESTS

                                     0201 20800 	.ENDC

                                     0201 20900 

                     1FC0 8F     BA  0201 21000 	POPR	#^M<R6,R7,R8,R9,R10,R11,AP> ;RESTORE NON-VOLATILE REGISTERS

                                 05  0205 21100 	RSB

                                     0206 21200 ;

                                     0206 21300 ; SECTION PAGE - TRY TO FORM A CLUSTER OF THESE

                                     0206 21400 ;

                                     0206 21500 

                                     0206 21600 	.ENABL	LSB

                                     0206 21700 

                                     0206 21800 SECTION:

            57            52     D0  0206 21900 	MOVL	R2,R7			;BACKING STORE ADDRESS

            59       0000'CF     3C  0209 22000 	MOVZWL	W^MPW$GW_MPWPFC,R9	;MAXIMUM NUMBER OF PAGES TO CLUSTER

                          00EA   30  020E 22100 	BSBW	PTESCAN			;LOOK AT ADJACENT PTE'S FOR A CLUSTER TO WRITE

            50       0000'DF     D0  0211 22200 	MOVL	@W^MPW$AL_PTE,R0	;GET STARTING PAGE NUMBER

            52       0000'DF40   D0  0216 22300 	MOVL	@W^PFN$AL_BAK[R0],R2	;GET ITS BACKING STORE ADDRESS

            53       0000'DF40   D0  021C 22400 	MOVL	@W^PFN$AL_PTE[R0],R3	;AND ITS PAGE TABLE ENTRY ADDRESS

                                     0222 22500 ;

                                     0222 22600 ; R5 = PROCESS HEADER ADR ASSOCIATED WITH THIS SVAPTE FROM ORIGINAL GETPFNCTX CALL

                                     0222 22700 ;

                          FDDB'  30  0222 22800 10$:	BSBW	MMG$INIBLDPKT		;TRANSLATE BACKING STORE TO VBN AND WINDOW

                          B4     11  0225 22900 	BRB	MPW_BLDPKT		;GO QUEUE THE REQUEST

                                     0227 23000 ;

                                     0227 23100 ; THIS PAGE IS A SWPVBN PAGE AND IS TO BE WRITTEN BACK TO THE SWAP FILE

                                     0227 23200 ; RATHER THAN ITS NORMAL BACKING STORE ADDRESS

                                     0227 23300 ;

                                     0227 23400 SWPVBN:

       0000'CF            00'    E0  0227 23500 	BBS	S^#SCH$V_SIP,W^SCH$GB_SIP,40$ ;DON'T PROCESS SWAP VBN'S

                          3E         022C       

                                     022D 23600 					;IF SWAPPER IS ACTIVE

            51         46 A5     3C  022D 23700 	MOVZWL	PHD$W_PHVINDEX(R5),R1	;GET PROCESS HEADER VECTOR INDEX

            51       0000'DF41   32  0231 23800 	CVTWL	@W^PHV$GL_PIXBAS[R1],R1	;GET PROCESS INDEX

                          35     19  0237 23900 	BLSS	PROCESS_GONE		;BRANCH IF PROCESS IS NO LONGER AROUND

            57       0000'DF41   D0  0239 24000 	MOVL	@W^SCH$GL_PCBVEC[R1],R7	;GET PCB ADDRESS

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page  11

X0306           WRTMFYPAG - WRITE MODIFIED PAGES                                                                                 (3)



            59         34 A7     3C  023F 24100 	MOVZWL	PCB$W_APTCNT(R7),R9	;FORM VBN IN SWAP SLOT

            59            52     C0  0243 24200 	ADDL	R2,R9			;R2 HAD THE SWAP VBN

            59         24 A7     C0  0246 24300 	ADDL	PCB$L_WSSWP(R7),R9	;FORM SWAP FILE BACKING STORE ADDRESS

                     0000'DF40   B4  024A 24400 	CLRW	@W^PFN$AW_SWPVBN[R0]	;ALL DONE WITH THE SWPVBN FIELD

         28 A7            10     E2  024F 24500 	BBSS	#PCB$V_SWPVBN,PCB$L_STS(R7),20$ ;NOTE SWPVBN WRITE IN PROGRESS

                          00         0253       

            5C            53     D0  0254 24600 20$:	MOVL	R3,AP			;STARTING PTE RANGE

            5A            53     D0  0257 24700 	MOVL	R3,R10			;ENDING PTE RANGE

            57            01     CE  025A 24800 	MNEGL	#1,R7			;SET PTE$V_TYP0

                          0109   30  025D 24900 	BSBW	SCAN_DONE		;PUT JUST THIS PAGE IN MPW PTE ARRAY

                                     0260 25000 ;

                                     0260 25100 ; R9, R10 ASSUMED PRESERVED

                                     0260 25200 ;

            52            59     7D  0260 25300 	MOVQ	R9,R2			;R2 = BACKING STORE ADR, R3 = SVAPTE

       0004'DF            0F     E3  0263 25350 	BBCS	#15,@W^MPW$AW_PHVINDEX,10$ ;INDICATE SWAP VBN PAGE WRITE

                          B9         0268       

                          B7     11  0269 25400 	BRB	10$			;SET UP FOR BUILDPKT

                                     026B 25500 ;

                                     026B 25600 ; DO NOT PROCESS THIS MODIFIED PAGE WITH SWPVBN SET SINCE SWAPPER IS ACTIVE

                                     026B 25700 ;

                          FEC7   31  026B 25800 40$:	BRW	NEXT_MFYPAG		;SKIP THIS MODIFIED PAGE

                                     026E 25900 

                                     026E 26000 	.DSABL	LSB

                                     026E 26100 ;

                                     026E 26200 ; PROCESS WAS DELETED AND SWAP VBN WAS SET IN PFN DATA BASE

                                     026E 26300 ;

                                     026E 26400 PROCESS_GONE:

                                     026E 26500 	BUG_CHECK PROCGONE,FATAL	;PROCESS NOT IN SYSTEM

                               FEFF  026E       		.WORD	^XFEFF

                               0004' 0270       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_PROCGONE!4

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page  12

X0306           GETPFNCTX                                                                                                        (4)



                                     0272   100 	.SBTTL	GETPFNCTX

                                     0272   200 ;

                                     0272   300 ; CALLING SEQUENCE:

                                     0272   400 ;

                                     0272   500 ;	BSBW	GETPFNCTX

                                     0272   600 ;

                                     0272   700 ; INPUTS:

                                     0272   800 ;

                                     0272   900 ;	R0 = PFN

                                     0272  1000 ;

                                     0272  1100 ; OUTPUTS:

                                     0272  1200 ;

                                     0272  1300 ;	R0 = PFN (PRESERVED)

                                     0272  1400 ;	R1 = TYPE OF BACKING STORE ADDRESS

                                     0272  1500 ;	   = 0 IF PAGING FILE

                                     0272  1600 ;	   = 1 IF SECTION ADDRESS

                                     0272  1700 ; 	   = 2 IF ILLEGAL

                                     0272  1800 ;	   = 3 IF SWPVBN

                                     0272  1900 ;	   = 4 IF NOT A PAGE ON THE MODIFIED PAGE LIST (CHKNXTPTE)

                                     0272  2000 ;	R2 = BACKING STORE ADDRESS OR SWPVBN

                                     0272  2100 ;	R3 = SYSTEM VIRTUAL ADDRESS OF PAGE TABLE ENTRY

                                     0272  2200 ;	R4 = PRESERVED

                                     0272  2300 ;	R5 = PROCESS HEADER ADDRESS

                                     0272  2400 ;

                                     0272  2500 GETPFNCTX:

            53       0000'DF40   D0  0272  2600 	MOVL	@W^PFN$AL_PTE[R0],R3	;SYSTEM VIRTUAL ADDRESS OF PAGE TABLE ENTRY

            03            00     EF  0278  2700 	EXTZV	#PFN$V_PAGTYP,#PFN$S_PAGTYP,@W^PFN$AB_TYPE[R0],R1 ;PAGE TYPE

            51       0000'DF40       027B       

                                     0280  2800 

                                     0280  2900 	ASSUME	PFN$C_PROCESS EQ 0

                                     0280  3000 	ASSUME	PFN$C_SYSTEM  EQ 1

                                     0280  3100 	ASSUME	PFN$C_GLOBAL  EQ 2

                                     0280  3200 	ASSUME	PFN$C_GBLWRT  EQ 3

                                     0280  3300 	ASSUME	PFN$C_PPGTBL  EQ 4

                                     0280  3400 	ASSUME	PFN$C_GPGTBL  EQ 5

                                     0280  3500 

                                     0280  3600 	CASE	R1,<-

                                     0280  3700 		PROCESS,-		;PROCESS PAGE

                                     0280  3800 		SYSPHD,-		;SYSTEM PAGE

                                     0280  3900 		BADTYP,-		;GLOBAL READ ONLY

                                     0280  4000 		SYSPHD,-		;GLOBAL WRITABLE

                                     0280  4100 		PHDR,-			;PROCESS PAGE TABLE

                                     0280  4200 		SYSPHD-			;GLOBAL PAGE TABLE

                                     0280  4300 	>

            00            51     AF  0280       	CASEW	R1,#0,S^#<<30004$-30003$>/2>-1

                          05'        0283       

                                     0284       30003$:

                               0023' 0284       	.WORD	PROCESS-30003$

                               0010' 0286       	.WORD	SYSPHD-30003$

                               000C' 0288       	.WORD	BADTYP-30003$

                               0010' 028A       	.WORD	SYSPHD-30003$

                               0017' 028C       	.WORD	PHDR-30003$

                               0010' 028E       	.WORD	SYSPHD-30003$

                                     0290       30004$:

                                     0290  4400 BADTYP:	BUG_CHECK BADPAGTYPE,FATAL	;BAD PAGE TYPE

                               FEFF  0290       		.WORD	^XFEFF

                               0004' 0292       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_BADPAGTYPE!4

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page  13

X0306           GETPFNCTX                                                                                                        (4)



                                     0294  4500 

                                     0294  4600 SYSPHD:

            55       0000'DF     DE  0294  4700 	MOVAL	@W^MMG$GL_SYSPHD,R5	;ADDRESS OF SYSTEM HEADER

                          2E     11  0299  4800 	BRB	GOTPHDR			;JOIN THE COMMON CODE

                                     029B  4900 

                                     029B  5000 PHDR:

            53       0000'CF     C3  029B  5100 	SUBL3	W^SWP$GL_BALSPT,R3,R5	;NO. OF BYTES INTO SPT BEYOND BALSET BASE

                          55         02A0       

            55            07     78  02A1  5200 	ASHL	#7,R5,R5		;NO. OF SPT ENTRIES * 512

                          55         02A4       

                          06     11  02A5  5300 	BRB	GETPHDR			;GET PROCESS HEADER ADDRESS

                                     02A7  5400 

                                     02A7  5500 PROCESS:

            53       0000'CF     C3  02A7  5600 	SUBL3	W^SWP$GL_BALBASE,R3,R5	;NO. OF BYTES BEYOND FIRST BAL SET PAGE

                          55         02AC       

                                     02AD  5700 GETPHDR:

            55   00000000'EF     C6  02AD  5800 	DIVL	SWP$GL_BSLOTSZ,R5	;FORM PROCESS HEADER INDEX

            55         F7 8F     78  02B4  5900 	ASHL	#-9,R5,R5		;DIVIDE BY PAGE SIZE

                          55         02B8       

            55   00000000'EF     C4  02B9  6000 	MULL	SWP$GL_BSLOTSZ,R5	;CONVERT PROCESS INDEX

            55            09     9C  02C0  6100 	ROTL	#9,R5,R5		;MULL BY BYTES PER PAGE

                          55         02C3       

            55       0000'CF     C0  02C4  6200 	ADDL	W^SWP$GL_BALBASE,R5	;TO PROCESS HEADER ADDRESS

                                     02C9  6300 GOTPHDR:

            52       0000'DF40   3C  02C9  6400 	MOVZWL	@W^PFN$AW_SWPVBN[R0],R2	;IS SWPVBN SET?

                          0C     12  02CF  6500 	BNEQ	40$			;BRANCH IF YES

            52       0000'DF40   D0  02D1  6600 	MOVL	@W^PFN$AL_BAK[R0],R2	;GET BACKING STORE ADDRESS

                                     02D7  6700 

                                     02D7  6800 	ASSUME	PFN$V_GBLBAK EQ PTE$V_TYP0+1

            02            16     EF  02D7  6900 	EXTZV	#PTE$V_TYP0,#2,R2,R1	;GET BACKING STORE ADDRESS TYPE

            51            52         02DA       

                                 05  02DC  7000 	RSB

                                     02DD  7100 40$:

                                     02DD  7200 	ASSUME	PFN$C_PROCESS EQ 0

       0000'DF40          07     93  02DD  7300 	BITB	#PFN$M_PAGTYP,@W^PFN$AB_TYPE[R0] ;REQUIRE SWPVBN PAGE TO BE PROCESS PAGE

                          04     12  02E3  7400 	BNEQ	60$			;BRANCH IF NOT, ERROR

            51            03     D0  02E5  7500 	MOVL	#3,R1			;CODE FOR SWPVBN BACKING DESTINATION

                                 05  02E8  7600 	RSB

                                     02E9  7700 60$:	BUG_CHECK BADSWPVBN,FATAL	;SWAP VBN ONLY FOR PROCESS PAGES

                               FEFF  02E9       		.WORD	^XFEFF

                               0004' 02EB       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_BADSWPVBN!4

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page  14

X0306           PTESCAN - SCAN ADJACENT PTE'S                                                                                    (5)



                                     02ED   100 	.SBTTL	PTESCAN - SCAN ADJACENT PTE'S

                                     02ED   200 ;

                                     02ED   300 ; PTESCAN, ROUTINE TO SCAN ADJACENT PAGE TABLE ENTRIES FOR TRANSITION

                                     02ED   400 ; PAGES THAT ARE ON THE MODIFIED PAGE LIST AND HAVE THE APPROPRIATE

                                     02ED   500 ; BACKING STORE ADDRESS FOR CLUSTERING.

                                     02ED   600 ; A SCAN IS MADE BACKWARDS FROM THE SVAPTE AND THEN FORWARDS.

                                     02ED   700 ;

                                     02ED   800 ; CALLING SEQUENCE:

                                     02ED   900 ;

                                     02ED  1000 ;	BSBW	PTESCAN

                                     02ED  1100 ;

                                     02ED  1200 ; INPUTS:

                                     02ED  1300 ;

                                     02ED  1400 ;	R3 = SVAPTE TO START SCANNING FROM

                                     02ED  1500 ;	R5 = PROCESS HEADER ADDRESS ASSOCIATED WITH THAT SVAPTE

                                     02ED  1600 ;	R6 = INDEX TO NEXT AVAILABLE SLOT IN MODIFIED PAGE WRITER

                                     02ED  1700 ;	     PTE AND PHVINDEX ARRAYS

                                     02ED  1800 ;	R7 = PAGE FILE INDEX IF PAGE FILE PAGE, TYP0 BIT CLEAR

                                     02ED  1900 ;	   = SECTION BACKING STORE ADDRESS IF TYP0 BIT SET

                                     02ED  2000 ;	R8 = PAGE FILE VBN TO USE IF SCANNING FOR PAGE FILE PAGES

                                     02ED  2100 ;	R9 = MAXIMUM NUMBER OF PAGES TO FIND

                                     02ED  2200 ;

                                     02ED  2300 ; OUTPUTS:

                                     02ED  2400 ;

                                     02ED  2500 ;	R6 UPDATED TO POINT TO NEXT SLOT NOT USED

                                     02ED  2600 ;	R8 = FIRST PAGE FILE VBN NOT USED

                                     02ED  2700 ;	R4,R5,R7 PRESERVED

                                     02ED  2800 ;	R0,R1,R2,R3 SCRATCHED

                                     02ED  2900 ;	R9,R10,R11,AP SCRATCHED

                                     02ED  3000 ;

                                     02ED  3100 CHK_ACCESS:

            15            09     EF  02ED  3200 	EXTZV	#VA$V_VPN,#VA$S_VPN,R3,R1 ;INDEX INTO SYSTEM PAGE TABLE

            51            53         02F0       

                     0000'DF41   D5  02F2  3300 	TSTL	@W^MMG$GL_SPTBASE[R1]	;IS THIS PAGE OF PAGE TABLE ENTRIES VALID

                          60     18  02F7  3400 	BGEQ	SCAN_FORWARD		;BRANCH IF NOT

                          18     11  02F9  3500 	BRB	SCAN_NEXT1

                                     02FB  3600 PTESCAN:

            5C            53     D0  02FB  3700 	MOVL	R3,AP			;SAVE SVAPTE

            15            09     EF  02FE  3800 	EXTZV	#VA$V_VPN,#VA$S_VPN,R3,R1 ;KEEP PAGE NUMBER OF SVAPTE

            51            53         0301       

            5B            04     CE  0303  3900 	MNEGL	#4,R11			;GOING BACKWARDS LOOKING AT PTE'S

                          49     11  0306  4000 	BRB	SCAN_AGAIN		;LOOK AT NEXT PAGE TABLE ENTRY

                                     0308  4100 ;

                                     0308  4200 ; NOTE THAT R1 = PAGE NUMBER OF AN ACCESSABLE PTE

                                     0308  4300 ;

                                     0308  4400 SCAN_NEXT:

            5B            5A     C1  0308  4500 	ADDL3	R10,R11,R3		;FORM NEXT SVAPTE TO CHECK

                          53         030B       

            15            09     ED  030C  4600 	CMPZV	#VA$V_VPN,#VA$S_VPN,R3,R1 ;PTE IN SAME PAGE?

            51            53         030F       

                          DA     12  0311  4700 	BNEQ	CHK_ACCESS		;BRANCH IF NOT, CHECK ACCESSABILITY

                                     0313  4800 SCAN_NEXT1:

            63   7B800000 8F     CB  0313  4900 	BICL3	#^C<PTE$M_VALID !-

                          50         031A       

                                     031B  5000 		PTE$M_TYP1 ! PTE$M_TYP0 !-

                                     031B  5100 		PTE$M_PGFLVB>,(R3),R0	;GET PFN IF TRANSITION PAGE

                          3C     13  031B  5200 	BEQL	SCAN_FORWARD		;BRANCH IF DEMAND ZERO PAGE

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page  15

X0306           PTESCAN - SCAN ADJACENT PTE'S                                                                                    (5)



            50         EA 8F     78  031D  5300 	ASHL	#-PTE$V_TYP0,R0,R2	;VALID, TYP1, TYP0 ALL ZERO?

                          52         0321       

                          35     12  0322  5400 	BNEQ	SCAN_FORWARD		;BRANCH IF NOT TRANSITION PAGE

                          00     ED  0324  5500 	CMPZV	#PFN$V_LOC,#PFN$S_LOC,-	;SEE IF ON MODIFIED PAGE LIST

       0000'DF40          03         0326  5600 		@W^PFN$AB_STATE[R0],#PFN$C_MFYPAGLST

                          01         032B       

                          2B     12  032C  5700 	BNEQ	SCAN_FORWARD		;BRANCH IF NOT ON MODIFIED PAGE LIST

                     0000'DF40   B5  032E  5800 	TSTW	@W^PFN$AW_SWPVBN[R0]	;IF SWAP VBN PAGE,

                          24     12  0333  5900 	BNEQ	SCAN_FORWARD		;DON'T USE IT

            52       0000'DF40   D0  0335  6000 	MOVL	@W^PFN$AL_BAK[R0],R2	;GET BACKING STORE ADDRESS

            57            16     E0  033B  6100 	BBS	#PTE$V_TYP0,R7,60$	;BRANCH IF SECTION ADDRESS

                          0D         033E       

                                     033F  6200 ;

                                     033F  6300 ; PAGE FILE PAGE, REQUIRE ANOTHER PAGE FILE PAGE WITH SAME PAGE FILE INDEX

                                     033F  6400 ;

            52            16     E0  033F  6500 	BBS	#PTE$V_TYP0,R2,SCAN_FORWARD ;BRANCH IF SECTION PAGE

                          16         0342       

            08            18     ED  0343  6600 	CMPZV	#PFN$V_PGFLX,#PFN$S_PGFLX,R2,R7 ;SAME PAGE FILE INDEX?

            57            52         0346       

                          07     13  0348  6700 	BEQL	SCAN_AGAIN		;BRANCH IF YES

                          0D     11  034A  6800 	BRB	SCAN_FORWARD		;NOT SAME PAGE FILE

                                     034C  6900 ;

                                     034C  7000 ; SECTION PAGE, MUST CHECK FOR SECTION BACKING STORE TYPE AND SAME BACKING STORE

                                     034C  7100 ;

            57            52     D1  034C  7200 60$:	CMPL	R2,R7			;SAME SECTION?

                          08     12  034F  7300 	BNEQ	SCAN_FORWARD		;BRANCH IF NOT

                                     0351  7400 SCAN_AGAIN:

            5A            53     D0  0351  7500 	MOVL	R3,R10			;ADDRESS OF LAST PTE CHECKED

            B1            59     F5  0354  7600 	SOBGTR	R9,SCAN_NEXT		;BRANCH IF MORE PAGE FILE VBN'S TO USE

                          10     11  0357  7700 	BRB	SCAN_DONE		;ALLOCATED PAGE FILE EXHAUSTED,

                                     0359  7800 					;WRITE THE CLUSTER

                                     0359  7900 ;

                                     0359  8000 ; PTE SCAN CANNOT PROCEED IN CURRENT DIRECTION, SWITCH TO SCAN FORWARD

                                     0359  8100 ; IF NOT ALREADY SCANNING FORWARD

                                     0359  8200 ;

                                     0359  8300 SCAN_FORWARD:

            5B            5B     CE  0359  8400 	MNEGL	R11,R11			;SWITCH DIRECTION OF PTE SCAN

                          0B     19  035C  8500 	BLSS	SCAN_DONE		;PTE SCAN COMPLETE IF ALREADY SCANNED FORWARD

            53            5C     D0  035E  8600 	MOVL	AP,R3			;GET STARTING PTE ADDRESS

            5C            5A     D0  0361  8700 	MOVL	R10,AP			;RECORD THIS AS STARTING PTE ADDRESS

                                     0364  8800 					;SINCE IT IS LEQU THAN STARTING PTE

            5A            53     D0  0364  8900 	MOVL	R3,R10			;START FORWARD FROM ORIGINAL START PTE

                          9F     11  0367  9000 	BRB	SCAN_NEXT		;CONTINUE THE PTE SCAN

                                     0369  9100 ;

                                     0369  9200 ; AP = SVAPTE, R10 IS THE OTHER SVAPTE, NOT NECESSARILY IN ORDER

                                     0369  9300 ; R7 = PAGE FILE INDEX OR SECTION BACKING STORE ADDRESS

                                     0369  9400 ;	IF PTE$V_TYP0 IS SET, NO BACKING STORE MANIPULATION

                                     0369  9500 ; R9 PRESERVED FROM HERE ON

                                     0369  9600 ; R10 PRESERVED FROM HERE ON IF AP LEQU R10

                                     0369  9700 ;

                                     0369  9800 SCAN_DONE:

            5A            5C     D1  0369  9900 	CMPL	AP,R10			;GET PTE ADDRESSES IN ORDER

                          09     1B  036C 10000 	BLEQU	40$			;BRANCH IF R10 IS TOP OF RANGE

            50            5A     D0  036E 10100 	MOVL	R10,R0			;SAVE BOTTOM OF RANGE

            5A            5C     D0  0371 10200 	MOVL	AP,R10			;HIGH END OF RANGE

            5C            50     D0  0374 10300 	MOVL	R0,AP			;LOW END OF RANGE

                                     0377 10400 ;

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page  16

X0306           PTESCAN - SCAN ADJACENT PTE'S                                                                                    (5)



                                     0377 10500 ; AP = FIRST PTE ADDRESS, R10 = LAST PTE ADDRESS INCLUSIVE

                                     0377 10600 ;	ALL PFN'S IN THESE PTE'S ARE ON THE MODIFIED PAGE LIST AND

                                     0377 10700 ;	ARE FROM THE SAME PAGE FILE OR SECTION

                                     0377 10800 ;

            8C   FFE00000 8F     CB  0377 10900 40$:	BICL3	#^C<PTE$M_PFN>,(AP)+,R11 ;GET PAGE FRAME NUMBER

                          5B         037E       

       0000'DF46          5B     D0  037F 11000 	MOVL	R11,@W^MPW$AL_PTE[R6]	;STORE PFN IN PTE ARRAY

       0004'DF46       46 A5     B0  0385 11100 	MOVW	PHD$W_PHVINDEX(R5),@W^MPW$AW_PHVINDEX[R6] ;STORE THE ASSOCIATED

                          56     D6  038C 11200 	INCL	R6			;NEXT PTE INDEX

                                     038E 11300 					;PROCESS HEADER VECTOR INDEX

            57            16     E0  038E 11400 	BBS	#PTE$V_TYP0,R7,65$	;BRANCH IF SECTION PAGE

                          20         0391       

       0000'DF4B FFC00000 8F     CB  0392 11500 	BICL3	#^C<PTE$M_PGFLVB>,@W^PFN$AL_BAK[R11],R0 ;OLD PAGE FILE ADDRESS

                          50         039C       

                                     039D 11600 					;TO DEALLOCATE IF ANY

                          06     13  039D 11700 	BEQL	60$			;BRANCH IF NONE TO DEALLOCATE

            51            57     D0  039F 11800 	MOVL	R7,R1			;PAGE FILE INDEX TO DEALLOCATE FROM

                          FC5B'  30  03A2 11900 	BSBW	MMG$DALCPAGFIL		;DEALLOCATE THIS PAGE FILE VBN

            57            18     78  03A5 12000 60$:	ASHL	#PFN$V_PGFLX,R7,R2	;PAGE FILE INDEX TO ITS BACKING STORE FIELD

                          52         03A8       

            58            52     C9  03A9 12100 	BISL3	R2,R8,@W^PFN$AL_BAK[R11] ;AND RECORD IT IN THE BACKING STORE ADR

                     0000'DF4B       03AC       

                          58     D6  03B0 12200 	INCL	R8			;NEXT PAGE FILE VBN

            50            5B     D0  03B2 12300 65$:	MOVL	R11,R0			;PFN TO CONVENTIONAL REGISTER

            52            01     9A  03B5 12400 	MOVZBL	#PFN$C_MFYPAGLST,R2	;INDEX TO MODIFIED PAGE LIST

                          FC45'  30  03B8 12500 	BSBW	MMG$REMPFN		;REMOVE PAGE FROM MODIFIED PAGE LIST

                                 8B  03BB 12600 	BICB3	#<PFN$M_MODIFY ! PFN$M_LOC>,- ;SHUT OFF MODIFY BIT

       0000'DF40       87 8F         03BC 12700 		@W^PFN$AB_STATE[R0],R1

                          51         03C2       

            51            05     89  03C3 12800 	BISB3	#PFN$C_WRTINPROG,R1,@W^PFN$AB_STATE[R0] ;SET WRITE IN PROGRESS

                     0000'DF40       03C6       

                     0000'DF40   B6  03CA 12900 	INCW	@W^PFN$AW_REFCNT[R0]	;AND COUNT AN I/O REFERENCE

                          00     ED  03CF 13000 	CMPZV	#PFN$V_PAGTYP,#PFN$S_PAGTYP,- ;IF PROCESS PAGE TABLE PAGE

       0000'DF40          03         03D1 13100 		@W^PFN$AB_TYPE[R0],#PFN$C_PPGTBL

                          04         03D6       

                          09     12  03D7 13200 	BNEQ	80$

            51         46 A5     3C  03D9 13300 	MOVZWL	PHD$W_PHVINDEX(R5),R1	;THEN MUST COUNT A PROCESS HEADER REF

                     0000'DF41   B6  03DD 13400 	INCW	@W^PHV$GL_REFCBAS[R1]

            5A            5C     D1  03E2 13500 80$:	CMPL	AP,R10			;DONE LAST PTE IN RANGE?

                          90     1B  03E5 13600 	BLEQU	40$			;BRANCH IF MORE TO DO

                                 05  03E7 13700 	RSB

                                     03E8 13800 

                                     03E8 13900 

                                     03E8 14000 	.END

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page  17

SYMBOL TABLE                                                                                                                     (5)



BADBAKADR        0000012F R     04   IRP$M_BUFIO    = 00000001            MPW$V_NOTDONE  = 00000002            

BADTYP           00000290 R     04   IRP$M_CHAINED  = 00000020            MPW$V_SUCCESS  = 00000000            

BIT...         = 00000003            IRP$M_COMPLX   = 00000008            MPW_BLDPKT       000001DB R     04   

BUG$_BADPAGTYPE  ********   X   04   IRP$M_DIAGBUF  = 00000080            NEXT_MFYPAG      00000135 R     04   

BUG$_BADSWPVBN   ********   X   04   IRP$M_FUNC     = 00000002            NOMOREPAGES      000000C4 R     04   

BUG$_IVBAKADIO   ********   X   04   IRP$M_MBXIO    = 00000400            NO_PAGEFILE      00000133 R     04   

BUG$_MPWALCIRP   ********   X   04   IRP$M_PAGIO    = 00000004            PAGEFILE         0000013D R     04   

BUG$_PROCGONE    ********   X   04   IRP$M_PHYSIO   = 00000100            PAGFILCLUSTER    0000015C R     04   

CA$_MEASURE    = 00000002            IRP$M_PRIVIO   = 00000200            PCB$B_ASTACT     0000000C            

CA$_MEASURE_IOT= 00000004            IRP$M_SWAPIO   = 00000040            PCB$B_ASTEN      0000000D            

CA$_SIMULATOR  = 00000001            IRP$M_VIRTUAL  = 00000010            PCB$B_PRI        0000000B            

CHK_ACCESS       000002ED R     04   IRP$Q_NT_PRVMSK  0000003C            PCB$B_PRIB       00000033            

EVT$_PFCOM       ********   X   04   IRP$S_FCODE    = 00000006            PCB$B_TYPE       0000000A            

EXE$ALLOCIRP     ********   X   04   IRP$S_FMOD     = 0000000A            PCB$B_WEFC       00000032            

EXE$BLDPKTSWPW   ********   X   04   IRP$S_MODE     = 00000002            PCB$C_LENGTH     0000007C            

EXE$DEANONPAGED  ********   X   04   IRP$V_BUFIO    = 00000000            PCB$K_LENGTH     0000007C            

GBL...         = 00000000            IRP$V_CHAINED  = 00000005            PCB$L_ASTQBL     00000014            

GETPFNCTX        00000272 R     04   IRP$V_COMPLX   = 00000003            PCB$L_ASTQFL     00000010            

GETPHDR          000002AD R     04   IRP$V_DIAGBUF  = 00000007            PCB$L_EFC2P      00000058            

GET_IRP          000000BA R     04   IRP$V_FCODE    = 00000000            PCB$L_EFC3P      0000005C            

GET_NXT_CLUSTER  00000105 R     04   IRP$V_FMOD     = 00000006            PCB$L_EFCS       00000050            

GET_PAGE_TYPE    0000011C R     04   IRP$V_FUNC     = 00000001            PCB$L_EFCU       00000054            

GOTPHDR          000002C9 R     04   IRP$V_MBXIO    = 0000000A            PCB$L_EFWM       0000004C            

GOT_IRP          00000111 R     04   IRP$V_MODE     = 00000000            PCB$L_OWNER      0000001C            

IOC$GL_IRPFL     ********   X   04   IRP$V_PAGIO    = 00000002            PCB$L_PHD        00000064            

IPL$_ASTDEL    = 00000002            IRP$V_PHYSIO   = 00000008            PCB$L_PHYPCB     00000018            

IPL$_HWCLK     = 00000018            IRP$V_PRIVIO   = 00000009            PCB$L_PID        00000060            

IPL$_IOPOST    = 00000004            IRP$V_SWAPIO   = 00000006            PCB$L_PQB        0000004C            

IPL$_MAILBOX   = 0000000B            IRP$V_VIRTUAL  = 00000004            PCB$L_SQBL       00000004            

IPL$_POWER     = 0000001F            IRP$W_ABCNT      0000003C            PCB$L_SQFL       00000000            

IPL$_QUEUEAST  = 00000006            IRP$W_BCNT       00000032            PCB$L_STS        00000028            

IPL$_SCHED     = 00000003            IRP$W_BOFF       00000030            PCB$L_UIC        00000020            

IPL$_SYNCH     = 00000007            IRP$W_CHAN       00000028            PCB$L_WSSWP      00000024            

IPL$_TIMER     = 00000007            IRP$W_FUNC       00000020            PCB$L_WTIME      0000002C            

IRP$B_CARCON     00000038            IRP$W_OBCNT      0000003E            PCB$T_LNAME      0000006C            

IRP$B_EFN        00000022            IRP$W_SIZE       00000008            PCB$V_ASTPEN   = 00000011            

IRP$B_PRI        00000023            IRP$W_STS        0000002A            PCB$V_BATCH    = 0000000E            

IRP$B_RMOD       0000000B            IRP$W_TT_PRMPT   0000003C            PCB$V_DELPEN   = 00000001            

IRP$B_TYPE       0000000A            MMG$ALCPAGFIL    ********   X   04   PCB$V_FORCPEN  = 00000002            

IRP$C_LENGTH     0000004C            MMG$DALCPAGFIL   ********   X   04   PCB$V_HIBER    = 00000013            

IRP$K_LENGTH     0000004C            MMG$DECPHDREF1   ********   X   04   PCB$V_INQUAN   = 00000003            

IRP$L_AST        00000010            MMG$GL_PAGSWPVC  ********   X   04   PCB$V_LOGIN    = 00000014            

IRP$L_ASTPRM     00000014            MMG$GL_SPTBASE   ********   X   04   PCB$V_NETWRK   = 00000015            

IRP$L_DIAGBUF    00000044            MMG$GL_SYSPHD    ********   X   04   PCB$V_NOACNT   = 0000000F            

IRP$L_IOQBL      00000004            MMG$INIBLDPKT    ********   X   04   PCB$V_NODELET  = 00000017            

IRP$L_IOQFL      00000000            MMG$INSPFNT      ********   X   04   PCB$V_PHDRES   = 00000012            

IRP$L_IOSB       00000024            MMG$REFCNTNEG    ********   X   04   PCB$V_PSWAPM   = 00000004            

IRP$L_IOST1      00000034            MMG$RELPFN       ********   X   04   PCB$V_PWRAST   = 00000016            

IRP$L_IOST2      00000038            MMG$REMPFN       ********   X   04   PCB$V_RES      = 00000000            

IRP$L_MEDIA      00000034            MMG$WRTMFYPAG    000000ED RG    04   PCB$V_RESPEN   = 00000005            

IRP$L_PID        0000000C            MPW$AL_PTE       00000000 RG    03   PCB$V_SSFEXC   = 00000006            

IRP$L_SEGVBN     00000040            MPW$AW_PHVINDEX  00000004 RG    03   PCB$V_SSFEXCE  = 00000007            

IRP$L_SEQNUM     00000048            MPW$GW_MPWPFC    ********   X   04   PCB$V_SSFEXCS  = 00000008            

IRP$L_SVAPTE     0000002C            MPW$M_BADPAG   = 00000002            PCB$V_SSFEXCU  = 00000009            

IRP$L_TT_TERM    00000038            MPW$M_NOTDONE  = 00000004            PCB$V_SSRWAIT  = 0000000A            

IRP$L_UCB        0000001C            MPW$M_SUCCESS  = 00000001            PCB$V_SUSPEN   = 0000000B            

IRP$L_WIND       00000018            MPW$V_BADPAG   = 00000001            PCB$V_SWPVBN   = 00000010            

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page  18

SYMBOL TABLE                                                                                                                     (5)



PCB$V_WAKEPEN  = 0000000C            PFN$M_BAK      = 007FFFFF            PHD$L_R11        000000B4            

PCB$V_WALL     = 0000000D            PFN$M_COLLISION= 00000010            PHD$L_R12        000000B8            

PCB$W_APTCNT     00000034            PFN$M_DELCON   = 00000010            PHD$L_R13        000000BC            

PCB$W_ASTCNT     0000003C            PFN$M_GBLBAK   = 00800000            PHD$L_R2         00000090            

PCB$W_BIOCNT     0000003E            PFN$M_LOC      = 00000007            PHD$L_R3         00000094            

PCB$W_BIOLM      00000040            PFN$M_MODIFY   = 00000080            PHD$L_R4         00000098            

PCB$W_BYTCNT     00000042            PFN$M_PAGTYP   = 00000007            PHD$L_R5         0000009C            

PCB$W_BYTLM      00000068            PFN$M_PGFLX    = FF000000            PHD$L_R6         000000A0            

PCB$W_DIOCNT     00000044            PFN$M_RPTEVT   = 00000040            PHD$L_R7         000000A4            

PCB$W_DIOLM      00000046            PFN$S_BAK      = 00000017            PHD$L_R8         000000A8            

PCB$W_FILCNT     00000048            PFN$S_GBLBAK   = 00000001            PHD$L_R9         000000AC            

PCB$W_GPGCNT     00000038            PFN$S_LOC      = 00000003            PHD$L_REFERFLT   00000014            

PCB$W_GRP        00000022            PFN$S_PAGTYP   = 00000003            PHD$L_SSP        00000080            

PCB$W_MEM        00000020            PFN$S_PGFLX    = 00000008            PHD$L_USP        00000084            

PCB$W_MTXCNT     0000000E            PFN$V_BADPAG   = 00000005            PHD$L_WSL        00000118            

PCB$W_PPGCNT     0000003A            PFN$V_BAK      = 00000000            PHD$M_DALCSTX  = 00000002            

PCB$W_PRCCNT     0000006A            PFN$V_COLLISION= 00000004            PHD$M_PFMFLG   = 00000001            

PCB$W_SIZE       00000008            PFN$V_DELCON   = 00000004            PHD$M_WSPEAKCHK= 00000004            

PCB$W_STATE      00000030            PFN$V_GBLBAK   = 00000017            PHD$Q_PRIVMSK    00000000            

PCB$W_TMBU       00000036            PFN$V_LOC      = 00000000            PHD$S_ASTLVL   = 00000008            

PCB$W_TQCNT      0000004A            PFN$V_MODIFY   = 00000007            PHD$S_P0LR     = 00000018            

PFL$B_PFC        0000000B            PFN$V_PAGTYP   = 00000000            PHD$V_ASTLVL   = 00000018            

PFL$B_TYPE       0000000A            PFN$V_PGFLX    = 00000018            PHD$V_DALCSTX  = 00000001            

PFL$C_LENGTH     00000020            PFN$V_RPTEVT   = 00000006            PHD$V_P0LR     = 00000000            

PFL$K_LENGTH     00000020            PHD$B_ASTLVL     000000CF            PHD$V_PFMFLG   = 00000000            

PFL$L_BITMAP     00000000            PHD$B_DFPFC      00000038            PHD$V_WSPEAKCHK= 00000002            

PFL$L_BITMAPSIZ  00000014            PHD$B_PAGFIL     0000001F            PHD$W_ASTLM      00000044            

PFL$L_FREPAGCNT  00000018            PHD$B_PGTBPFC    00000039            PHD$W_BAK        00000048            

PFL$L_RESERVCNT  0000001C            PHD$C_LENGTH     00000118            PHD$W_DFWSCNT    0000001A            

PFL$L_STARTBYTE  00000004            PHD$C_PHDPAGCTX= 00000008            PHD$W_EMPTPG     000000D8            

PFL$L_VBN        00000010            PHD$K_LENGTH     00000118            PHD$W_EXTDYNWS   00000076            

PFL$L_WINDOW     0000000C            PHD$L_BIOCNT     00000054            PHD$W_FILLM      00000060            

PFL$W_SIZE       00000008            PHD$L_CPULIM     00000058            PHD$W_FLAGS      0000003A            

PFN$AB_STATE     ********   X   04   PHD$L_CPUTIM     0000003C            PHD$W_PHVINDEX   00000046            

PFN$AB_TYPE      ********   X   04   PHD$L_DIOCNT     00000050            PHD$W_PRCLM      00000042            

PFN$AL_BAK       ********   X   04   PHD$L_ESP        0000007C            PHD$W_PST        00000020            

PFN$AL_PTE       ********   X   04   PHD$L_FREP0VA    00000028            PHD$W_PSTBASMAX  0000004A            

PFN$AW_BLINK     ********   X   04   PHD$L_FREP1VA    00000030            PHD$W_PSTFREE    00000026            

PFN$AW_FLINK     ********   X   04   PHD$L_FREPTECNT  0000002C            PHD$W_PSTLAST    00000024            

PFN$AW_MFYLSTHD  ********   X   04   PHD$L_KSP        00000078            PHD$W_PTCNTACT   00000070            

PFN$AW_REFCNT    ********   X   04   PHD$L_P0BR       000000C8            PHD$W_PTCNTLCK   0000006C            

PFN$AW_SWPVBN    ********   X   04   PHD$L_P0LRASTL   000000CC            PHD$W_PTCNTMAX   00000072            

PFN$C_ACTIVE   = 00000007            PHD$L_P1BR       000000D0            PHD$W_PTCNTVAL   0000006E            

PFN$C_BADPAGLST= 00000002            PHD$L_P1LR       000000D4            PHD$W_QUANT      00000040            

PFN$C_FREPAGLST= 00000000            PHD$L_PAGEFLTS   0000004C            PHD$W_TQLM       00000062            

PFN$C_GBLWRT   = 00000003            PHD$L_PAGFIL     0000001C            PHD$W_WSAUTH     0000000A            

PFN$C_GLOBAL   = 00000002            PHD$L_PC         000000C0            PHD$W_WSDYN      0000000E            

PFN$C_GPGTBL   = 00000005            PHD$L_PCB        00000078            PHD$W_WSFLUID    00000074            

PFN$C_MFYPAGLST= 00000001            PHD$L_PGFLCNT    00000034            PHD$W_WSLAST     00000012            

PFN$C_PPGTBL   = 00000004            PHD$L_PGFLQUOTA  0000005C            PHD$W_WSLIST     00000008            

PFN$C_PROCESS  = 00000000            PHD$L_PSL        000000C4            PHD$W_WSLOCK     0000000C            

PFN$C_RDERR    = 00000004            PHD$L_PSTBASOFF  00000020            PHD$W_WSLX       0000004A            

PFN$C_RDINPROG = 00000006            PHD$L_PTWSLELCK  00000064            PHD$W_WSNEXT     00000010            

PFN$C_RELPEND  = 00000003            PHD$L_PTWSLEVAL  00000068            PHD$W_WSQUOTA    00000018            

PFN$C_SYSTEM   = 00000001            PHD$L_R0         00000088            PHDR             0000029B R     04   

PFN$C_WRTINPROG= 00000005            PHD$L_R1         0000008C            PHV$GL_PIXBAS    ********   X   04   

PFN$M_BADPAG   = 00000020            PHD$L_R10        000000B0            PHV$GL_REFCBAS   ********   X   04   

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page  19

SYMBOL TABLE                                                                                                                     (5)



PMS$GL_PWRITES   ********   X   04   PTE$C_KW       = 10000000            SCH$GL_PCBVEC    ********   X   04   

PMS$GL_PWRITIO   ********   X   04   PTE$C_NA       = 00000000            SCH$RSE          ********   X   04   

PR$_ACCR       = 00000029            PTE$C_SOWN     = 01000000            SCH$V_MPW        ********   X   04   

PR$_ACCS       = 00000028            PTE$C_SR       = 58000000            SCH$V_SIP        ********   X   04   

PR$_ASTLVL     = 00000013            PTE$C_SREW     = 48000000            SEC$B_AMOD       00000015            

PR$_ESP        = 00000001            PTE$C_SRKW     = 50000000            SEC$B_PFC        0000000B            

PR$_ICCS       = 00000018            PTE$C_SW       = 40000000            SEC$C_LENGTH     00000020            

PR$_ICR        = 0000001A            PTE$C_UOWN     = 01800000            SEC$K_LENGTH     00000020            

PR$_IPL        = 00000012            PTE$C_UR       = 78000000            SEC$K_MATALL   = 00000000            

PR$_ISP        = 00000004            PTE$C_UREW     = 68000000            SEC$K_MATEQU   = 00000001            

PR$_KSP        = 00000000            PTE$C_URKW     = 70000000            SEC$K_MATLEQ   = 00000002            

PR$_MAPEN      = 00000038            PTE$C_URSW     = 60000000            SEC$L_CCB        00000000            

PR$_NICR       = 00000019            PTE$C_UW       = 20000000            SEC$L_GSD        00000000            

PR$_P0BR       = 00000008            PTE$M_CRF      = 00010000            SEC$L_PAGCNT     0000001C            

PR$_P0LR       = 00000009            PTE$M_DZRO     = 00020000            SEC$L_REFCNT     00000018            

PR$_P1BR       = 0000000A            PTE$M_GPTX     = 003FFFFF            SEC$L_VBN        00000010            

PR$_P1LR       = 0000000B            PTE$M_MODIFY   = 04000000            SEC$L_VPXPFC     00000008            

PR$_PCBB       = 00000010            PTE$M_OWN      = 01800000            SEC$L_WINDOW     0000000C            

PR$_PME        = 0000003D            PTE$M_PFN      = 001FFFFF            SEC$M_AMOD     = 00000300            

PR$_RXCS       = 00000020            PTE$M_PGFLVB   = 003FFFFF            SEC$M_CRF      = 00000002            

PR$_RXDB       = 00000021            PTE$M_PROT     = 78000000            SEC$M_DZRO     = 00000004            

PR$_SBIER      = 00000034            PTE$M_TYP0     = 00400000            SEC$M_GBL      = 00000001            

PR$_SBIFS      = 00000030            PTE$M_TYP1     = 04000000            SEC$M_PERM     = 00004000            

PR$_SBIMT      = 00000033            PTE$M_VALID    = 80000000            SEC$M_SYSGBL   = 00008000            

PR$_SBIQC      = 00000036            PTE$M_WRT      = 00040000            SEC$M_WRT      = 00000008            

PR$_SBIS       = 00000031            PTE$S_GPTX     = 00000016            SEC$S_AMOD     = 00000002            

PR$_SBISC      = 00000032            PTE$S_OWN      = 00000002            SEC$S_CRF      = 00000001            

PR$_SBITA      = 00000035            PTE$S_PFN      = 00000015            SEC$S_DZRO     = 00000001            

PR$_SBR        = 0000000C            PTE$S_PGFLVB   = 00000016            SEC$S_GBL      = 00000001            

PR$_SCBB       = 00000011            PTE$S_PROT     = 00000004            SEC$S_PERM     = 00000001            

PR$_SID        = 0000003E            PTE$S_STX      = 00000010            SEC$S_PFC      = 00000008            

PR$_SIRR       = 00000014            PTE$V_CRF      = 00000010            SEC$S_SYSGBL   = 00000001            

PR$_SISR       = 00000015            PTE$V_DZRO     = 00000011            SEC$S_VPX      = 00000016            

PR$_SLR        = 0000000D            PTE$V_GPTX     = 00000000            SEC$S_WRT      = 00000001            

PR$_SSP        = 00000002            PTE$V_MODIFY   = 0000001A            SEC$V_AMOD     = 00000008            

PR$_TBIA       = 00000039            PTE$V_OWN      = 00000017            SEC$V_CRF      = 00000001            

PR$_TBIS       = 0000003A            PTE$V_PFN      = 00000000            SEC$V_DZRO     = 00000002            

PR$_TODR       = 0000001B            PTE$V_PGFLVB   = 00000000            SEC$V_GBL      = 00000000            

PR$_TXCS       = 00000022            PTE$V_PROT     = 0000001B            SEC$V_PERM     = 0000000E            

PR$_TXDB       = 00000023            PTE$V_STX      = 00000000            SEC$V_PFC      = 00000018            

PR$_USP        = 00000003            PTE$V_TYP0     = 00000016            SEC$V_SYSGBL   = 0000000F            

PR$_WCSA       = 0000002C            PTE$V_TYP1     = 0000001A            SEC$V_VPX      = 00000000            

PR$_WCSD       = 0000002D            PTE$V_VALID    = 0000001F            SEC$V_WRT      = 00000003            

PRI$_IOCOM     = 00000001            PTE$V_WRT      = 00000012            SEC$W_FLAGS      00000014            

PRI$_NULL      = 00000000            PTESCAN          000002FB R     04   SEC$W_SECXBL     00000006            

PRI$_RESAVL    = 00000002            SCAN_AGAIN       00000351 R     04   SEC$W_SECXFL     00000004            

PRI$_TICOM     = 00000004            SCAN_DONE        00000369 R     04   SECTION          00000206 R     04   

PRI$_TIMER     = 00000002            SCAN_FORWARD     00000359 R     04   SWP$GL_BALBASE   ********   X   04   

PRI$_TOCOM     = 00000003            SCAN_NEXT        00000308 R     04   SWP$GL_BALSPT    ********   X   04   

PROCESS          000002A7 R     04   SCAN_NEXT1       00000313 R     04   SWP$GL_BSLOTSZ   ********   X   04   

PROCESS_GONE     0000026E R     04   SCH$GB_SIP       ********   X   04   SWPVBN           00000227 R     04   

PTE$C_EOWN     = 00800000            SCH$GL_CURPCB    ********   X   04   SYSPHD           00000294 R     04   

PTE$C_ER       = 38000000            SCH$GL_MFYCNT    ********   X   04   TMP...         = 00000001            

PTE$C_ERKW     = 30000000            SCH$GL_MFYLIM    ********   X   04   VA$M_BYTE      = 000001FF            

PTE$C_EW       = 28000000            SCH$GL_MFYLIMSV  ********   X   04   VA$M_P1        = 40000000            

PTE$C_KOWN     = 00000000            SCH$GL_MFYLOLIM  ********   X   04   VA$M_SYSTEM    = 80000000            

PTE$C_KR       = 18000000            SCH$GL_MFYLOSV   ********   X   04   VA$M_VPG       = FFFFFE00            

WRTMFYPAG       - WRITE MODIFIED PAGES                           21-AUG-1978 20:16:19   VAX-11 MACRO X0.3-11               Page  20

SYMBOL TABLE                                                                                                                     (5)



VA$M_VPN       = 3FFFFE00            

VA$S_BYTE      = 00000009            

VA$S_VPG       = 00000017            

VA$S_VPN       = 00000015            

VA$V_BYTE      = 00000000            

VA$V_P1        = 0000001E            

VA$V_SYSTEM    = 0000001F            

VA$V_VPG       = 00000009            

VA$V_VPN       = 00000009            

WRITEDONE        00000000 R     04   





PROGRAM SECTION SYNOPSIS



.  ABS  .        00000000      00     NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT BYTE  

. BLANK .        00000000      01     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  

$ABS$            0000011C      02     NOPIC   USR   CON   ABS   LCL NOSHR   EXE   RD    WRT BYTE  

$$$210           00000008      03     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT LONG  

$MMGCOD          000003E8      04     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  





THERE WERE NO ERRORS OR WARNINGS.

12738. BYTES LEFT IN FREE MEMORY POOL.

716. BYTES OF RECLAIMED MEMORY.

OBJ$:WRTMFYPAG,LIS$:WRTMFYPAG/-SP=EXECML$/ML,SRC$:WRTMFYPAG

15 MLB DIR RDS - 817 GETS TO DEFINE 29 MACROS. 61 INTER. FILE WRITES. 

