SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (1)     780  DECLARATIONS

   (1)    1820  EXE$SWAPINIT - INITIALIZATION AND STARTUP FOR S

   (1)    2580  BALANCE FREE PAGE COUNT

   (1)    3160  SCHEDULE SWAP

   (1)    3780  OUTSWAP

   (1)    7640  RELPHD - RELEASE PROCESS HEADER

   (1)    9460  DELPHD - DELETE PROCESS HEADER FOR DELETED PROC

   (1)   10320  GBLTRANS/GBLVALID/GBLWRTVALID - HANDLE GLOBAL P

   (1)   11660  PROCTRANS - PROCESS PAGE IN TRANSITION

   (1)   12620  PAGE TABLE WORKING SET LIST ENTRIES

   (1)   12900  INSWAP

   (1)   19720  FILLPHD - FILL SPT ENTRIES TO MAP PHD

   (1)   20780  RELINIT - INITIALIZE REGISTERS FOR PAGE RELEASE

   (1)   21320  OSINIT - OUTSWAP SCAN REGISTER INITIALIZATION

   (1)   21760  RELPAGE - RELEASE DUPLICATE PAGE

   (1)   22460  SWPREAD/SWPWRITE - SWAPPER I/O ROUTINES

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page   1

0501                                                                                                                             (1)



                                     0000    20 	.TITLE	SWAPPER  WORKING SET SWAPPER 

                                     0000    40 	.IDENT	/0501/

                                     0000    60 ;

                                     0000    80 ; COPYRIGHT (C) 1977,1978

                                     0000   100 ; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS 01754

                                     0000   120 ;

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

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

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

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

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

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

                                     0000   260 ; REMAIN IN DEC.

                                     0000   280 ;

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

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

                                     0000   340 ; CORPORATION.

                                     0000   360 ;

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

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

                                     0000   420 

                                     0000   440 ;++

                                     0000   460 ; FACILITY: EXECUTIVE, SWAPPER

                                     0000   480 ;

                                     0000   500 ; ABSTRACT: THE SWAPPER SCHEDULES AND EXECUTES SWAPPING OF PROCESS

                                     0000   520 ;	    WORKING SETS BETWEEN SWAP STORAGE AND MAIN MEMORY.

                                     0000   540 ;

                                     0000   560 ; ENVIRONMENT:

                                     0000   580 ;	MODE = KERNEL ,  RESIDENT

                                     0000   600 ;

                                     0000   620 ; AUTHOR:  R. HUSTVEDT	 CREATION DATE: 30-NOV-76

                                     0000   640 ;

                                     0000   660 ; MODIFIED BY:

                                     0000   680 ;

                                     0000   700 ;  , VERSION  ,

                                     0000   720 ; 01	- 

                                     0000   740 ;--

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page   2

0501            DECLARATIONS                                                                                                     (1)



                                     0000   780 	.SBTTL	DECLARATIONS

                                     0000   800 ;

                                     0000   820 ; INCLUDE FILES:

                                     0000   840 ;

                                     0000   860 

                                     0000   880 	$ACBDEF				; DEFINE AST CONTROL BLOCK OFFSETS

                                     0000   900 	$IPLDEF				; DEFINE INTERRUPT PRIORITY LEVELS

                                     0000   920 	$IRPDEF				; DEFINE I/O REQUEST PACKET OFFSETS

                                     0000   940 	$PCBDEF				; DEFINE PCB OFFSETS

                                     0000   960 	$PFNDEF				; DEFINE PFN VALUES

                                     0000   980 	$PHDDEF				; DEFINE PHD OFFSETS

                                     0000  1000 	$PRDEF				; DEFINE PROCESSOR REGISTERS

                                     0000  1020 	$PTEDEF				; DEFINE PAGE TABLE ENTRY

                                     0000  1040 	$SFTDEF				; DEFINE SWAP FILE TABLE OFFSETS

                                     0000  1060 	$VADEF				; DEFINE VIRTUAL ADDRESS FIELDS

                                     0000  1080 	$WSLDEF				; DEFINE WORKING SET LIST BITS

                                     0000  1100 ;

                                     0000  1120 ; MACROS:

                                     0000  1140 ;

                                     0000  1160 

                                     0000  1180 

                                     0000  1200 ;

                                     0000  1220 ; EQUATED SYMBOLS:

                                     0000  1240 ;

                                     0000  1260 

                                     0000  1280 ;

                                     0000  1300 ; OWN STORAGE:

                                     0000  1320 ;

                                     0000  1340 

                                 00000000  1360 	.PSECT	$$$220,LONG		; SWAPPER/SCHEDULER WRITABLE DATA

                                     0000  1380 IOROUTINE:				; ADDRESS OF PROPER BUILD PACKET ROUTINE

                           00000000  0000  1400 	.LONG	0			;

                           00000000  0004  1420 IOEA:	.LONG	0			; I/O END ACTION RETURN

                           00000000  0008  1440 RWSSWP:	.LONG	0			; REMAINING WS SWP ADDRESS

                           00000000  000C  1460 RSVAPTE:.LONG	0			; REMAINING SVA OF PTE

                               0000  0010  1480 RPGCNT:	.WORD	0			; REMAINING PAGE COUNT

                               0000  0012  1500 OSWPPGS:.WORD	0			; OUTSWAP PAGE COUNT

                           00000000  0014  1520 OSWPPCB:.LONG	0			; PCB ADDRESS OF OUTSWAP PROCESS

                                     0018  1540 SWP$GW_BALCNT::				; COUNT OF PROCESSES IN BALANCE SET

                               FFFF  0018  1560 	.WORD	-1			; EXCLUDING NULL PROCESS AND SWAPPER

                                     001A  1580 

                                 00000000  1600 	.PSECT	$AEXENONPAGED		; NON-PAGED PSECT

                                     0000  1620 

   45 58 45 2E 54 49 4E 49 53 59 53  0000  1640 IMGNAM:	.ASCII	/SYSINIT.EXE/		; SYSTEM INITIALIZATION PROCESS

                           0000000B  000B  1660 IMGLEN=.-IMGNAM

                  00000000'0000000B  000B  1680 IMGDESC:.LONG	IMGLEN,IMGNAM

                        30 41 50 4F  0013  1700 TT0NAM:	.ASCII	/OPA0/

                           00000004  0017  1720 TT0LEN=.-TT0NAM

                  00000013'00000004  0017  1740 TT0DESC:.LONG	TT0LEN,TT0NAM

                                     001F  1760 

                                     001F  1780 

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page   3

0501            EXE$SWAPINIT - INITIALIZATION AND STARTUP FOR S                                                                  (1)



                                     001F  1820 	.SBTTL	EXE$SWAPINIT - INITIALIZATION AND STARTUP FOR SWAPPER

                                     001F  1840 ;++

                                     001F  1860 ; FUNCTIONAL DESCRIPTION:

                                     001F  1880 ;	EXE$SWAPINIT IS ENTERED WHEN THE SWAPPER PROCESS IS FIRST

                                     001F  1900 ;	SCHEDULED AFTER A SYSTEM BOOT/STARTUP.  THIS TRANSFER OCCURS

                                     001F  1920 ;	VIA THE INITIAL PC VALUE BUILT INTO THE HARDWARE PCB FOR THE

                                     001F  1940 ;	SWAPPER PROCESS.

                                     001F  1960 ;

                                     001F  1980 ;

                                     001F  2000 ;--

                                     001F  2020 	.LIST	MEB			; LIST GENERATED MACRO CODE

                                     001F  2040 

                                     001F  2060 EXE$SWAPINIT::				; SWAPPER INITIALIZATION

                                     001F  2080 

            5B   00000000'EF     D0  001F  2100 	MOVL	EXE$GL_PAGED,R11	; POINT TO START OF PAGED POOL

                          8B     D4  0026  2120 	CLRL	(R11)+			; ZAP FORWARD LINK

            6B   00000000'8F     D0  0028  2140 	MOVL	#SGN$GL_PAGEDYN,(R11)	; AND SET SIZE

                                     002F  2160 ;

                                     002F  2180 ;	CREATE INITIAL PROCESSES

                                     002F  2200 ;

                                     002F  2220 

                                     002F  2240 	$CREPRC_S	INPUT=TT0DESC,-	;

                                     002F  2260 			OUTPUT=TT0DESC,-;

                                     002F  2280 			IMAGE=IMGDESC,-	;

                                     002F  2300 			UIC=#^X80020,-	;

                                     002F  2320 			BASPRI=#2	;

                          00     DD  002F       		PUSHL	#0

            7E            00     3C  0031       		MOVZWL	#0,-(SP)

                 00080020 8F     DD  0034       		PUSHL	#^X80020

                          02     DD  003A       		PUSHL	#2

                          00     DD  003C       		PUSHL	#0

                          00     DD  003E       		PUSHL	#0

                          00     DD  0040       		PUSHL	#0

                          00     DD  0042       		PUSHL	#0

                       D0 AF     7F  0044       		PUSHAQ	TT0DESC

                       CD AF     7F  0047       		PUSHAQ	TT0DESC

                       BE AF     7F  004A       		PUSHAQ	IMGDESC

                          00     DD  004D       		PUSHL	#0

   00000000'GF            0C     FB  004F       		CALLS	#12,G^SYS$CREPRC

                          002E   30  0056  2340 10$:	BSBW	BALANCE			; BALANCE FREE PAGE COUNT

                          FFA4'  30  0059  2360 	BSBW	MMG$WRTMFYPAG		; WRITE MODIFIED PAGES

                          006F   30  005C  2380 	BSBW	SWAPSCHED		; SCHEDULE SWAP

                     0000'CF     D5  005F  2385 	TSTL	W^EXE$GL_PFATIM		; CHECK FOR POWER FAIL TIME

                          06     13  0063  2390 	BEQL	15$			; BRANCH IF NO POWERFAIL

                 00000000'EF     16  0065  2395 	JSB	EXE$POWERAST		; GIVE ANY REQUIRED POWER FAIL ASTS

            54       0000'CF     D0  006B  2400 15$:	MOVL	W^SCH$GL_CURPCB,R4	; GET PROPER PCB ADDRESS

            52       0000'CF     7E  0070  2420 	MOVAQ	W^SCH$GQ_HIBWQ,R2	; AND ADDRESS OF WAIT QUEUE HEADER

                                     0075  2440 	SETIPL	#IPL$_SYNCH		; BLOCK SYSTEM EVENTS WHILE CHECKING

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

         28 A4            0C     E4  0078  2460 	BBSC	#PCB$V_WAKEPEN,PCB$L_STS(R4),20$ ; TEST AND CLEAR WAKE PENDING

                          05         007C       

                          00     DD  007D  2480 	PUSHL	#0			; NULL PSL

                          FF7E'  30  007F  2500 	BSBW	SCH$WAITK		; WAIT WITH STACK CLEAN

                                     0082  2520 20$:	SETIPL	#0			; DROP IPL

            12            00     DA  0082       		MTPR	#0,S^#PR$_IPL

                          CF     11  0085  2540 	BRB	10$			; CHECK FOR WORK TO DO

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page   4

0501            BALANCE FREE PAGE COUNT                                                                                          (1)



                                     0087  2580 	.SBTTL	BALANCE FREE PAGE COUNT

                                     0087  2600 ;

                                     0087  2620 ;	BALANCE FREE PAGE COUNT

                                     0087  2640 ;

                                     0087  2660 BALANCE:				; BALANCE FREE PAGE COUNT

                                     0087  2680 

       0000'CF       0000'CF     C3  0087  2700 	SUBL3	W^SCH$GL_FREELIM,W^SCH$GL_FREECNT,R3	; SUFFICIENT FREE PAGES?

                          53         008E       

                          0B     19  008F  2720 	BLSS	20$			; NO, MUST ACQUIRE SOME

                     0000'CF     B5  0091  2740 	TSTW	W^SCH$GW_DELPHDCT	; CHECK FOR DELETED PROCESS HEADERS

                          04     13  0095  2760 	BEQL	10$			; NONE, EXIT

                          53     D4  0097  2780 	CLRL	R3			; INDICATE NO FREE PAGES NEEDED

                          0F     11  0099  2800 	BRB	25$			;

                                 05  009B  2820 10$:	RSB				; IN BALANCE, RETURN

                                     009C  2840 20$:					;

       0000'CF            00'    E0  009C  2860 	BBS	S^#SCH$V_MPW,W^SCH$GB_SIP,25$	; MODIFIED PAGE WRITING ACTIVE

                          08         00A1       

                     0000'CF     D4  00A2  2880 	CLRL	W^SCH$GL_MFYLIM		; TRIGGER MODIFIED PAGE WRITING

                     0000'CF     D4  00A6  2900 	CLRL	W^SCH$GL_MFYLOLIM	; AND FLUSH ENTIRE LIST

       0000'CF            00'    E2  00AA  2920 25$:	BBSS	S^#SCH$V_SIP,W^SCH$GB_SIP,10$	; EXIT IF SWAPPER ALREADY BUSY

                          EB         00AF       

                                     00B0  2940 	DSBINT	#IPL$_SYNCH		; BLOCK SYSTEM EVENTS

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

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

                     3FC0 8F     BB  00B6  2960 	PUSHR	#^M<R6,R7,R8,R9,R10,R11,AP,FP>	; SAVE NON-STANDARD REGISTERS

                     0000'CF     94  00BA  2980 	CLRB	W^SWP$GB_ISWPRI		; SET PRIORITY FOR SWAP SCHEDULE

            5D            53     D0  00BE  3000 	MOVL	R3,FP			; GET AND TEST FREE PAGE DEFICIT

                          08     18  00C1  3020 	BGEQ	30$			; NONE, PURGING DELETED HEADERS

                     0018'CF     B5  00C3  3040 	TSTW	W^SWP$GW_BALCNT		; CHECK FOR SINGULAR BALANCE SET

                          02     12  00C7  3060 	BNEQ	30$			; NO, CAN OUTSWAP

                          5D     D4  00C9  3080 	CLRL	FP			; PREVENT OUTSWAP SCHEDULE

                          005A   31  00CB  3100 30$:	BRW	OUTSWAP			; TRY TO FORCE AN OUTSWAP

                                     00CE  3120 

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page   5

0501            SCHEDULE SWAP                                                                                                    (1)



                                     00CE  3160 	.SBTTL	SCHEDULE SWAP

                                     00CE  3180 ;

                                     00CE  3200 ;	SCHEDULE SWAP

                                     00CE  3220 ;

                                     00CE  3240 SWAPSCHED:				;

                                     00CE  3260 	DSBINT	#IPL$_SYNCH		; BLOCK SYSTEM EVENTS

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

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

       0000'CF            00'    E2  00D4  3280 	BBSS	S^#SCH$V_SIP,W^SCH$GB_SIP,5$	; EXIT IF SWAP IN PROGRESS

                          0F         00D9       

            20            00     EA  00DA  3300 	FFS	#0,#32,W^SCH$GL_COMOQS,R2; FIND HIGHEST PRIORITY QUEUE

            52       0000'CF         00DD       

                          0A     12  00E1  3320 	BNEQ	10$			; FOUND ONE

       0000'CF            00'    E5  00E3  3340 	BBCC	S^#SCH$V_SIP,W^SCH$GB_SIP,5$	; CLEAR SWAP IN PROGRESS

                          00         00E8       

                                     00E9  3360 5$:	ENBINT				; DROP IPL

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

                                 05  00EC  3380 	RSB				; AND RETURN

                                     00ED  3400 

                                     00ED  3420 10$:					;

                     3FC0 8F     BB  00ED  3440 	PUSHR	#^M<R6,R7,R8,R9,R10,R11,AP,FP>	; SAVE REGS OTHER THAN R0-R5

            53       0000'CF42   7E  00F1  3460 	MOVAQ	W^SCH$AQ_COMOH[R2],R3	; COMPUTE ADDRESS OF QUEUE HEADER

            54            63     D0  00F7  3480 	MOVL	(R3),R4			; GET PCB ADDRESS

            50         3A A4     3C  00FA  3500 	MOVZWL	PCB$W_PPGCNT(R4),R0	; COUNT OF PROCESS PAGES

            5A         38 A4     3C  00FE  3520 	MOVZWL	PCB$W_GPGCNT(R4),R10	; COUNT OF GLOBAL PAGES

            5A            50     C0  0102  3540 	ADDL	R0,R10			; SUM PAGE COUNTS

         28 A4            12     E1  0105  3560 	BBC	#PCB$V_PHDRES,PCB$L_STS(R4),15$	; CONTINUE IF HEADER NON-RESIDENT

                          07         0109       

            50         34 A4     3C  010A  3580 	MOVZWL	PCB$W_APTCNT(R4),R0	; GET ACTIVE PAGE TABLE COUNT

            5A            50     C2  010E  3600 	SUBL	R0,R10			; SUBTRACT RESIDENT HEADER PAGES FROM REQUIRED

                                     0111  3620 15$:					;

       0000'CF       0000'CF     C3  0111  3640 	SUBL3	W^SCH$GL_FREELIM,W^SCH$GL_FREECNT,R0	; COMPUTE PAGES AVAILABLE

                          50         0118       

       0000'CF         0B A4     90  0119  3660 	MOVB	PCB$B_PRI(R4),W^SWP$GB_ISWPRI	; SAVE PRIORITY OF INSWAP

            50            5A     C3  011F  3680 	SUBL3	R10,R0,FP			; WILL PROCESS FIT?

                          5D         0122       

                          03     19  0123  3700 	BLSS	20$			; NO, MUST OUTSWAP

                          03E0   31  0125  3720 	BRW	INSWAP			; YES PERFORM SWAP

                                     0128  3740 20$:					; SCHEDULE OUTSWAP

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page   6

0501            OUTSWAP                                                                                                          (1)



                                     0128  3780 	.SBTTL	OUTSWAP

                                     0128  3800 ;--------------------------------------------------------------------

                                     0128  3820 ;

                                     0128  3840 ;	SCHEDULE AND PERFORM OUTSWAPS IF POSSIBLE

                                     0128  3860 ;

                                     0128  3880 ;--------------------------------------------------------------------

                                     0128  3900 ;

                                     0128  3920 ; INPUT:	FP - NEGATIVE VALUE WILL PERMIT PROCESS OUTSWAP

                                     0128  3940 ;		     ZERO OR POSITIVE WILL PURGE HEADERS ONLY.

                                     0128  3960 ;

                                     0128  3980 

                                     0128  4000 OUTSWAP:				; TRY TO OUTSWAP

   00000000'EF            01     C3  0128  4020 	SUBL3	#1,SGN$GL_BALSETCT,R8	; INIT INDEX FOR BALANCE SLOT SCAN

                          58         012F       

            59            00     D2  0130  4040 	MCOML	#0,R9			; INDICATE NO FREE LIST PURGE CANDIDATE

                     0000'DF48   B5  0133  4060 10$:	TSTW	@W^PHV$GL_REFCBAS[R8]	; IS SLOT IN NEED OF CLEANUP?

                          03     12  0138  4080 	BNEQ	12$			; CONTINUE IF NOT RELEASABLE

                          00A4   31  013A  4100 	BRW	60$			; GO RELEASE PAGE TABLES AND HEADER

            54       0000'DF48   32  013D  4120 12$:	CVTWL	@W^PHV$GL_PIXBAS[R8],R4	; GET PROCESS INDEX

                          0A     15  0143  4140 	BLEQ	15$			; DELETED PROCESS OR VACANT SLOT

            54       0000'DF44   D0  0145  4160 	MOVL	@W^SCH$GL_PCBVEC[R4],R4	; GET PCB ADDRESS FOR PIX

            09         28 A4     E8  014B  4180 	BLBS	PCB$L_STS(R4),20$	; SKIP IF PROCESS IS RESIDENT

                          07     13  014F  4200 15$:	BEQL	20$			; VACANT SLOT

                          59     D5  0151  4220 	TSTL	R9			; CHECK FOR REMEMBERED INDEX

                          03     18  0153  4240 	BGEQ	20$			; YES DONT OVERWRITE

            59            58     D0  0155  4260 	MOVL	R8,R9			; SAVE BALANCE SLOT NUMBER OF CANDIDATE

            D8            58     F4  0158  4280 20$:	SOBGEQ	R8,10$			; TRY ALL SLOTS

            58            59     D0  015B  4300 	MOVL	R9,R8			; GET AND TEST SLOT INDEX FOR SECONDARY CANDIDATE

                          6B     19  015E  4320 	BLSS	50$			; NO SLOT FOR CLEANUP

       0000'CF            02     9C  0160  4340 	ROTL	#2,W^SWP$GL_BSLOTSZ,R7	; GET SIZE OF BALANCE SLOT IN BYTES

                          57         0165       

            58            57     C5  0166  4360 	MULL3	R7,R8,R6		; COMPUTE OFFSET TO BASE OF SLOT

                          56         0169       

                     0000'DF46   9F  016A  4380 	PUSHAB	@W^SWP$GL_BALSPT[R6]	; ADD BASE TO GET ADDRESS

            56            07     9C  016F  4400 	ROTL	#7,R6,R2		; FORM OFFSET TO PHD BASE

                          52         0172       

                     0000'DF42   9F  0173  4420 	PUSHAB	@W^SWP$GL_BALBASE[R2]	; BASE ADDRESS FOR PHD

            57            07     9C  0178  4440 	ROTL	#7,R7,R1		; MUL SPT SLOT SIZE BY 128

                          51         017B       

                       04 BE47   9F  017C  4460 	PUSHAB	@4(SP)[R7]		; FORM HIGH LIMIT FOR PAGTBLPPTE

                       04 BE41   9F  0180  4480 	PUSHAB	@4(SP)[R1]		; ANS SAVE PTE HIGH LIMIT

                                     0184  4500 

                                     0184  4520 ;

                                     0184  4540 ;	AT THIS POINT:

                                     0184  4560 ;

                                     0184  4580 ;	00(SP) - HIGH LIMIT ADDRESS FOR PROCESS HEADER

                                     0184  4600 ;	04(SP) - HIGH LIMIT FOR PROCESS PAGE TABLE PTE

                                     0184  4620 ;	08(SP) - LOW LIMIT FOR PROCESS HEADER

                                     0184  4640 ;	12(SP) - LOW LIMIT  FOR PROCESS PAGE TABLE PTE

                                     0184  4660 ;

                                     0184  4680 	ASSUME	PFN$C_FREPAGLST EQ 0	;

            50       0000'CF     3C  0184  4700 	MOVZWL	W^PFN$AW_HEAD,R0	; GET HEAD OF FREELIST TO START SCAN

                          3D     13  0189  4720 	BEQL	45$			; NO FREE PAGES, DONE

            59       0000'DF40   3C  018B  4740 30$:	MOVZWL	@W^PFN$AW_FLINK[R0],R9	; GET FORWARD LINK

            53       0000'DF40   D0  0191  4760 	MOVL	@W^PFN$AL_PTE[R0],R3	; GET SVA OF PTE FOR PAGE

                                     0197  4780 	ASSUME	PFN$C_PPGTBL EQ 4	

                                     0197  4800 	ASSUME	PFN$C_GPGTBL EQ 5

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page   7

0501            OUTSWAP                                                                                                          (1)



            01            02     EF  0197  4820 	EXTZV	#2,#1,@W^PFN$AB_TYPE[R0],R1	; GET PAGE TABLE BIT

            51       0000'DF40       019A       

         08 AE41          53     D1  019F  4840 	CMPL	R3,8(SP)[R1]		; COMPARE WITH LOW LIMIT

                          0E     1F  01A4  4860 	BLSSU	40$			; OUT OF RANGE

            6E41          53     D1  01A6  4880 	CMPL	R3,(SP)[R1]		; COMPARE WITH HIGH LIMIT

                          08     1E  01AA  4900 	BGEQU	40$			; OUT OF RANGE

                          52     D4  01AC  4920 	CLRL	R2			; INDICATE FREE PAGE LIST

                          FE4F'  30  01AE  4940 	BSBW	MMG$REMPFN		; REMOVE PAGE FROM FREE LIST

                          07A6   30  01B1  4960 	BSBW	RELDELPAGE		; RELEASE PAGE DELETING CONTENT

            50            59     D0  01B4  4980 40$:	MOVL	R9,R0			; FLINK TO NEXT PAGE

                          D2     12  01B7  5000 	BNEQ	30$			; ANOTHER PAGE TO TRY

            5E            10     C0  01B9  5020 	ADDL	#16,SP			; CLEAN STACK OF LIMITS

                     0000'DF48   B5  01BC  5040 	TSTW	@W^PHV$GL_REFCBAS[R8]	; DID WE FREE PROCESS HEADER

                          1E     13  01C1  5060 	BEQL	60$			; YES, RELEASE IT

            59            00     D2  01C3  5080 	MCOML	#0,R9			; NO, TRY FOR ANOTHER

                          90     11  01C6  5100 	BRB	20$			; NOW ATTEMPT CLEANUP

            5E            10     C0  01C8  5120 45$:	ADDL	#16,SP			; CLEAN STACK OF LIMITS

                          5D     D5  01CB  5140 50$:	TSTL	FP			; CHECK FOR DELETED HEADER PURGE

                          07     18  01CD  5160 	BGEQ	55$			; YES, DONT OUTSWAP

                          FE2E'  30  01CF  5180 	BSBW	SCH$OSWPSCHED		; SCHEDULE OUTSWAP

                          54     D5  01D2  5200 	TSTL	R4			; ANY CANDIDATE?

                          0E     12  01D4  5220 	BNEQ	70$			; YES

                     0000'CF     D4  01D6  5240 55$:	CLRL	W^SCH$GL_MFYLOLIM	; RESET LOWER THRESHOLD

                     0000'CF     B4  01DA  5260 	CLRW	W^SCH$GL_MFYLIM		; AND UPPER THRESHOLD

                          06E9   31  01DE  5280 	BRW	SWAPEXIT		; ELSE EXIT AND TRY LATER

                          0108   31  01E1  5300 60$:	BRW	RELPHD			; GO RELEASE PROCESS HEADER

                                     01E4  5320 70$:					;

                                     01E4  5340 ;

                                     01E4  5360 ;	R4 - PCB OF OUTSWAP CANDIDATE, ALREADY MARKED NON-RESIDENT

                                     01E4  5380 ;

                                     01E4  5400 

            55         64 A4     D0  01E4  5420 	MOVL	PCB$L_PHD(R4),R5	; GET PROCESS HEADER ADDRESS

                                     01E8  5440 

                     0018'CF     B7  01E8  5460 	DECW	W^SWP$GW_BALCNT		; DECREASE NUMBER IN BALANCE SET

                          075B   30  01EC  5480 	BSBW	OSINIT			; INIT REGISTERS FOR SCAN

                       34 A4     B4  01EF  5500 	CLRW	PCB$W_APTCNT(R4)	; INITIALIZE ACTIVE PAGE TABLE COUNT

            57         08 A5     3C  01F2  5520 	MOVZWL	PHD$W_WSLIST(R5),R7	; WS INDEX FOR PERM PAGES

            56         12 A5     3C  01F6  5540 	MOVZWL	PHD$W_WSLAST(R5),R6	; END OF WORKING SET LIST

                                     01FA  5560 ;

                                     01FA  5580 ;	REGISTER CONVENTIONS FOR OWSLOOP ARE:

                                     01FA  5600 ;

                                     01FA  5620 ;	R0 - PFN

                                     01FA  5640 ;	R1 - SCRATCH, WSLX

                                     01FA  5660 ;	R2 - WORKING SET LIST ENTRY (VIRTUAL ADDRESS+FLAGS)

                                     01FA  5680 ;	R3 - SVA OF PTE FOR WORKING SET LIST ENTRY

                                     01FA  5700 ;	R4 - PCB ADDRESS

                                     01FA  5720 ;	R5 - PHD ADDRESS

                                     01FA  5740 ;	R6 - END INDEX TO WORKING SET LIST

                                     01FA  5760 ;	R7 - WSLX (WORKING SET LIST INDEX)

                                     01FA  5780 ;	R8 - PTE CONTENT

                                     01FA  5800 ;	R9 - WORKING POINTER TO SWP$AL_MAP

                                     01FA  5820 ;	R10 - PTE$M_VALID!PTE$C_SRKW

                                     01FA  5840 ;	R11 - BASE ADDRESS OF SWP$AL_MAP

                                     01FA  5860 ;

                                     01FA  5880 OWSLOOP:				; OUTSWAP WS LOOP

            52            6547   D0  01FA  5900 	MOVL	(R5)[R7],R2		; GET WORKING SET LIST ENTRY

            15            52     E9  01FE  5920 	BLBC	R2,NOTVALID		; SKIP IF NOT VALID

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page   8

0501            OUTSWAP                                                                                                          (1)



                          FDFC'  30  0201  5940 	BSBW	MMG$SVAPTECHK		; CONVERT VA TO SVA OF PTE

                                     0204  5960 ;

                                     0204  5980 ;	R3 <- SVA OF PTE FOR VA IN R2

                                     0204  6000 ;

            58            63     D0  0204  6020 	MOVL	(R3),R8			; GET CONTENT OF PTE

                          02     19  0207  6040 	BLSS	10$			; CONTINUE IF VALID PAGE

                          52     D7  0209  6060 	DECL	R2			; CLEAR VALID FLAG

            52         E0 8F     8A  020B  6080 10$:	BICB	#^C<WSL$M_VALID!WSL$M_PAGTYP!WSL$M_PFNLOCK>,R2; ISOLATE INTERESTING FLAGS 

            15            00     EF  020F  6100 	EXTZV	#PTE$V_PFN,#PTE$S_PFN,R8,R0	; GET PFN FROM PTE

            50            58         0212       

                          06     10  0214  6120 	BSBB	OSDISPATCH		; DISPATCH ON PAGE TYPE

                                     0216  6140 NOTVALID:				;

            57            56     F3  0216  6160 	AOBLEQ	R6,R7,OWSLOOP		; PROCESS ENTIRE WORKING SET LIST

                          E0         0219       

                          1D     11  021A  6180 	BRB	PROCWRT			; DONE WITH WORKING SET LIST, RESET HEADER

                                     021C  6200 OSDISPATCH:				; 

                                     021C  6220 	ASSUME	WSL$V_VALID   EQ  0

                                     021C  6240 	ASSUME	WSL$V_PAGTYP  EQ  1

                                     021C  6260 	ASSUME	WSL$V_PFNLOCK EQ  4

                                     021C  6280 	ASSUME	PFN$C_PROCESS EQ  0

                                     021C  6300 	ASSUME	PFN$C_SYSTEM  EQ  1

                                     021C  6320 	ASSUME	PFN$C_GLOBAL  EQ  2

                                     021C  6340 	ASSUME	PFN$C_GBLWRT  EQ  3

                                     021C  6360 	ASSUME	PFN$C_PPGTBL  EQ  4

                                     021C  6380 	ASSUME	PFN$C_GPGTBL  EQ  5

            5D            6547   DE  021C  6400 	MOVAL	(R5)[R7],FP		; COMPUTE ADDRESS OF WSL ENTRY

                                     0220  6420 	CASE	R2,<-			; SWITCH ON WSL PAGE TYPE + PTE VALID BIT

                                     0220  6440 		PROCTRANS,-		; 0 => PROCESS TRANSITION PAGE

                                     0220  6460 		PROCVALID,-		; 1 => PROCESS VALID PAGE

                                     0220  6480 		WSLERR,-		; 2 => ????  BUGCHECK

                                     0220  6500 		WSLERR,-		; 3 => ????  BUGCHECK

                                     0220  6520 		GBLTRANS,-		; 4 => GLOBAL TRANSITION

                                     0220  6540 		GBLVALID,-		; 5 => GLOBAL VALID

                                     0220  6560 		GBLWRTTRANS,-		; 6 => GLOBAL WRITABLE TRANSITION

                                     0220  6580 		GBLWRTVALID-		; 7 => GLOBAL WRITABLE VALID

                                     0220  6600 		PPGTBLTRANS,-		; 8 => PROCESS PAGE TABLE TRANSITION

                                     0220  6620 		PPGTBLVALID,-		; 9 => PROCESS PAGE TABLE VALID

                                     0220  6640 		>,TYPE=B		;

            00            52     8F  0220       	CASEB	R2,#0,S^#<<30001$-30000$>/2>-1

                          09'        0223       

                                     0224       30000$:

                               0283' 0224       	.WORD	PROCTRANS-30000$

                               0299' 0226       	.WORD	PROCVALID-30000$

                               02D5' 0228       	.WORD	WSLERR-30000$

                               02D5' 022A       	.WORD	WSLERR-30000$

                               0211' 022C       	.WORD	GBLTRANS-30000$

                               024F' 022E       	.WORD	GBLVALID-30000$

                               021A' 0230       	.WORD	GBLWRTTRANS-30000$

                               0274' 0232       	.WORD	GBLWRTVALID-30000$

                               02D9' 0234       	.WORD	PPGTBLTRANS-30000$

                               02D9' 0236       	.WORD	PPGTBLVALID-30000$

                                     0238       30001$:

                                 05  0238  6660 	RSB				; SKIP PFN LOCK PAGES

                                     0239  6680 

                                     0239  6700 PROCWRT:				; RESET PROCESS HEADER BASE REGISTERS

            52         24 A4     D0  0239  6720 	MOVL	PCB$L_WSSWP(R4),R2	; GET SWAP ADDRESS

                          0B     12  023D  6740 	BNEQ	10$			; ALREADY ALLOCATED, USE IT

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page   9

0501            OUTSWAP                                                                                                          (1)



                          FDBE'  30  023F  6760 	BSBW	SWP$ALLOC		; ALLOCATE A SWAP FILE SLOT

                          52     D5  0242  6780 	TSTL	R2			; CHECK FOR ALLOCATION

                          04     12  0244  6800 	BNEQ	10$			; YES, CONTINUE

                                     0246  6820 	BUG_CHECK INSSWPFIL,FATAL	; INSUFFICIENT SWAP FILE SPACE

                               FEFF  0246       		.WORD	^XFEFF

                               0004' 0248       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_INSSWPFIL!4

         24 A4            52     D0  024A  6840 10$:	MOVL	R2,PCB$L_WSSWP(R4)	; SAVE SWAP SLOT ADDRESS

            50         34 A4     3C  024E  6860 	MOVZWL	PCB$W_APTCNT(R4),R0	; GET COUNT OF ACTIVE PAGE TABLES

       0014'CF            54     D0  0252  6880 	MOVL	R4,W^OSWPPCB		; SAVE ADDRESS OF OUTSWAP PROCESS

            59            5B     C2  0257  6900 	SUBL	R11,R9			; COMPUTE NUMBER OF PAGES * 4

            59            1E     9C  025A  6920 	ROTL	#<32-2>,R9,R4		; DIVIDE COUNT BY 4

                          54         025D       

       0012'CF            54     B0  025E  6940 	MOVW	R4,W^OSWPPGS		; SAVE COUNT OF OUTSWAP PAGES

            53            5B     D0  0263  6960 	MOVL	R11,R3			; SVAPTE FOR OUTSWAP I/O

            52            50     C0  0266  6980 	ADDL	R0,R2			; SKIP HEADER AND ACTIVE PAGE TABLES

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  10

0501            OUTSWAP                                                                                                          (1)



                                     0269  7020 

                                     0269  7040 ;----------------------------------------------------------------------------

                                     0269  7060 ;

                                     0269  7080 ;	DO OUTSWAP I/O FOR PROCESS HEADER AND BODY

                                     0269  7100 ;

                                     0269  7120 ;----------------------------------------------------------------------------

                     0000'CF     D6  0269  7140 	INCL	W^SWP$GL_OSWPCNT	; ACCOUNT FOR OUTSWAP

                          0707   30  026D  7160 	BSBW	SWPWRITE		; WRITE HEADER AND BODY

            04            50     E8  0270  7180 	BLBS	R0,20$			; CONTINUE IF NO I/O ERROR

                                     0273  7200 	BUG_CHECK OUTSWPERR,FATAL	; **** OUT SWAP I/O ERROR

                               FEFF  0273       		.WORD	^XFEFF

                               0004' 0275       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_OUTSWPERR!4

                                     0277  7220 20$:					;

                                     0277  7240 

                          06C6   30  0277  7260 	BSBW	RELINIT			; INIT REGISTERS FOR RELEASE LOOP

            55         64 A4     D0  027A  7280 	MOVL	PCB$L_PHD(R4),R5	; GET POINTER TO PHD

            58         46 A5     3C  027E  7300 	MOVZWL	PHD$W_PHVINDEX(R5),R8	; GET PROCESS HEADER SLOT INDEX

            89            5A     CB  0282  7320 30$:	BICL3	R10,(R9)+,R0 		; GET PAGE NUMBER TO RELEASE

                          50         0285       

            03            00     ED  0286  7340 	CMPZV	#PFN$V_PAGTYP,#PFN$S_PAGTYP,@W^PFN$AB_TYPE[R0],#PFN$C_GLOBAL	;

            02       0000'DF40       0289       

                          4E     13  028E  7360 	BEQL	80$			; PAGE IS GLOBAL, COMPLEX CLEANUP

            56       0000'DF40   D0  0290  7380 	MOVL	@W^PFN$AL_PTE[R0],R6	; GET POINTER TO PAGE TABLE FOR  PAGE

            66   84000000 8F     CA  0296  7400 	BICL	#<PTE$M_VALID!PTE$M_MODIFY>,(R6); CLEAR VALID AND MODIFY

                     0000'DF40   B5  029D  7420 	TSTW	@W^PFN$AW_SWPVBN[R0]	; WAS I/O IN PROGRESS?

                          25     13  02A2  7440 	BEQL	40$			; NO, DONT MARK PAGE MODIFIED

       0000'DF40       80 8F     88  02A4  7460 	BISB	#PFN$M_MODIFY,@W^PFN$AB_STATE[R0] ; MARK PAGE MODIFIED

                          00     ED  02AB  7462 	CMPZV	#PFN$V_LOC,#PFN$S_LOC,-	; IF THIS WAS READ IN PROGRESS

       0000'DF40          03         02AD  7464 		@W^PFN$AB_STATE[R0],#PFN$C_RDERR ; AND IS NOW PAGE READ ERROR

                          04         02B2       

                          14     12  02B3  7466 	BNEQ	40$			;

                                     02B5  7468 	DECREF				; AND IF THIS IS THE LAST REFERENCE

                     0000'DF40   B7  02B5       		DECW	@W^PFN$AW_REFCNT[R0]

                          03     18  02BA       		BGEQ	30002$

                          FD41'  30  02BC       		BSBW	MMG$REFCNTNEG

                                     02BF       30002$:

                          17     12  02BF  7470 	BNEQ	60$			;

            52            02     9A  02C1  7472 	MOVZBL	#PFN$C_BADPAGLST,R2	; THEN DIVERT THE PAGE TO

                          FD39'  30  02C4  7474 	BSBW	MMG$INSPFNT		; THE BAD PAGE LIST

                          0F     11  02C7  7476 	BRB	60$			;

                                     02C9  7480 40$:	DECREF				; DECREMENT REFERENCE COUNT FOR PAGE

                     0000'DF40   B7  02C9       		DECW	@W^PFN$AW_REFCNT[R0]

                          03     18  02CE       		BGEQ	30003$

                          FD2D'  30  02D0       		BSBW	MMG$REFCNTNEG

                                     02D3       30003$:

                          03     12  02D3  7500 	BNEQ	60$			; NOT RELEASABLE YET

                          FD28'  30  02D5  7520 50$:	BSBW	MMG$RELPFN		; RELEASE PFN AS APPROPRIATE

            A7            57     F5  02D8  7540 60$:	SOBGTR	R7,30$			; NEXT PAGE IN LIST

                          000E   31  02DB  7560 	BRW	RELPHD			; RELEASE PROCESS HEADER IF POSSIBLE

                                     02DE  7580 80$:	DECSHR	GTR=60$			; DECREASE SHARE COUNT FOR PAGE

                     0000'DF40   B7  02DE       		DECW	@W^PFN$AW_SHRCNT[R0]

                          F3     14  02E3       		BGTR	60$

                          03     18  02E5       		BGEQ	30004$

                          FD16'  30  02E7       		BSBW	MMG$SHRCNTNEG

                                     02EA       30004$:

                          DD     11  02EA  7600 	BRB	40$			; RELEASE PAGE TO FREE LIST IF REFCNT=0

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  11

0501            RELPHD - RELEASE PROCESS HEADER                                                                                  (1)



                                     02EC  7640 	.SBTTL	RELPHD - RELEASE PROCESS HEADER

                                     02EC  7660 ;++

                                     02EC  7680 ; FUNCTIONAL DESCRIPTION:

                                     02EC  7700 ;	RELPHD CHECKS THE REFERENCE  COUNT ON THE PROCESS HEADER

                                     02EC  7720 ;	AND RELEASES THE PAGE TABLES FROM THE PROCESS HEADER WHEN ALL

                                     02EC  7740 ;	OF THEIR PAGES HAVE BEEN RELEASED.  THE PAGE TABLES ARE FIRST WRITTEN

                                     02EC  7760 ;	TO THE SWAP IMAGE IF THEY ARE MARKED AS UPDATED.

                                     02EC  7780 ;

                                     02EC  7800 ; CALLING SEQUENCE:

                                     02EC  7820 ;	BRW/JMP	RELPHD

                                     02EC  7840 ;

                                     02EC  7860 ; INPUT PARAMETERS:

                                     02EC  7880 ;	R8 - BALANCE SLOT INDEX FOR HEADER TO BE RELEASED

                                     02EC  7900 ;

                                     02EC  7920 ; OUTPUT PARAMTERS:

                                     02EC  7940 ;	R0-R7,R9,R10 VOLATILE

                                     02EC  7960 ;

                                     02EC  7980 ; SIDE EFFECTS:

                                     02EC  8000 ;	THE PAGE TABLES FROM THE PROCESS HEADER MAY BE WRITTEN TO THE

                                     02EC  8020 ;	SWAP IMAGE FOR THE PROCESS IF THEY HAVE BEEN UPDATED.

                                     02EC  8040 ;

                                     02EC  8060 ;--

                                     02EC  8080 

                                     02EC  8100 

                                     02EC  8120 RELPHD:					;

                     0000'DF48   B5  02EC  8140 	TSTW	@W^PHV$GL_REFCBAS[R8]	; SEE IF PROCESS HEADER IS RELEASABLE

                          03     13  02F1  8160 	BEQL	5$			; YES, FREE ACTIVE PAGE TABLES

                          00E6   31  02F3  8180 	BRW	OSWPEXIT		; NO, TRY LATER

            57       0000'CF     D0  02F6  8200 5$:	MOVL	W^SWP$GL_BSLOTSZ,R7	; SET ITERATION COUNT TO WHOLE BALANCE SLOT

            58            57     C5  02FB  8220 	MULL3	R7,R8,R1		; GET LONG WORD OFFSET TO SLOT

                          51         02FE       

            56       0000'DF41   DE  02FF  8260 	MOVAL	@W^SWP$GL_BALSPT[R1],R6	; POINT TO BASE OF THIS SLOT

                          0642   30  0305  8280 	BSBW	OSINIT			; INIT REGISTERS FOR SCAN

            54       0000'DF48   32  0308  8300 	CVTWL	@W^PHV$GL_PIXBAS[R8],R4	; GET INDEX TO PROCESS IN SLOT

                          48     19  030E  8320 	BLSS	12$			; BR IF DELETED PROCESS

            54       0000'DF44   D0  0310  8340 	MOVL	@W^SCH$GL_PCBVEC[R4],R4	; AND TRANSLATE TO PCB ADDRESS

            55         64 A4     D0  0316  8360 	MOVL	PCB$L_PHD(R4),R5	; GET PROCESS HEADER ADDRESS

         64 A4            58     D0  031A  8380 	MOVL	R8,PCB$L_PHD(R4)	; INDICATE NO PHD FOR PROCESS

       00C8 C5            55     C2  031E  8400 	SUBL	R5,PHD$L_P0BR(R5)	; UNBIAS MEMORY MANAGEMENT BASE REGISTERS

       00D0 C5            55     C2  0323  8420 	SUBL	R5,PHD$L_P1BR(R5)	; FOR BOTH P0 AND P1 SPACE

         28 A4            12     E5  0328  8440 	BBCC	#PCB$V_PHDRES,PCB$L_STS(R4),7$	; MARK PHD NON-RESIDENT

                          00         032C       

            5C         4A A5     3C  032D  8460 7$:	MOVZWL	PHD$W_WSLX(R5),AP	; GET POINTER TO WSLX SAVE AREA

            5C            654C   DE  0331  8480 	MOVAL	(R5)[AP],AP		; AND CONVERT TO BYTE ADDRESS

            5D         48 A5     3C  0335  8500 	MOVZWL	PHD$W_BAK(R5),FP	; GET POINTER TO BACKING STORE VECTOR

            5D            654D   DE  0339  8520 	MOVAL	(R5)[FP],FP		; AND CONVERT TO BYTE ADDRESS

                     00D8 C5     B4  033D  8540 	CLRW	PHD$W_EMPTPG(R5)	; CLEAR COUNT OF EMPTY WSL PAGES

            8D            86     D0  0341  8560 10$:	MOVL	(R6)+,(FP)+		; COPY ENTRY FROM SPT

                          15     19  0344  8580 	BLSS	15$			; BR IF VALID

                          04     12  0346  8600 	BNEQ	13$			; BR IF NOT EMPTY WSL PAGE

                     00D8 C5     B6  0348  8620 	INCW	PHD$W_EMPTPG(R5)	; COUNT EMPTY WSL PAGES

         FC AD            1A     E1  034C  8640 13$:	BBC	#PTE$V_TYP1,-4(FP),15$	; BR IF TRANSITION GOODPAGE

                          0A         0350       

                       FC A6     D4  0351  8660 11$:	CLRL	-4(R6)			; ZAP INVALID ENTRY TO NO-ACCESS

                          8C     B4  0354  8680 	CLRW	(AP)+			; AND CLEAR WSLX VALUE FOR PAGE

                          23     11  0356  8700 	BRB	20$			; 

                          0084   31  0358  8720 12$:	BRW	DELPHD			; FINISH DELETE FOR PROCESS

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  12

0501            RELPHD - RELEASE PROCESS HEADER                                                                                  (1)



            15            00     EF  035B  8740 15$:	EXTZV	#PTE$V_PFN,#PTE$S_PFN,-4(FP),R0	; GET PFN FOR VALID ENTRY

            50         FC AD         035E       

                          EE     13  0361  8760 	BEQL	11$			; DEMAND ZERO OR NULL PTE

            00       0000'DF40   F0  0363  8780 	INSV	@W^PFN$AL_BAK[R0],#PTE$V_PGFLVB,#PTE$S_PGFLVB,-4(FP)	; SAVE BACKUP ADDR

         FC AD            16         0369       

            8C       0000'DF40   B0  036C  8800 	MOVW	@W^PFN$AW_WSLX[R0],(AP)+	; AND WORKING SET LIST INDEX

            5A            50     C9  0372  8820 	BISL3	R0,R10,(R9)+		; SET INTO SWAPPER MAP

                          89         0375       

         FC AD            1F     E2  0376  8840 	BBSS	#PTE$V_VALID,-4(FP),20$	; MARK PAGE VALID FOR INSWAP PURPOSES

                          00         037A       

            C3            57     F5  037B  8860 20$:	SOBGTR	R7,10$			; SCAN ENTIRE BALANCE SLOT

            59            5B     C2  037E  8880 	SUBL	R11,R9			; COMPUTE NUMBER OF PAGES * 4

            52         24 A4     D0  0381  8900 	MOVL	PCB$L_WSSWP(R4),R2	; WORKING SET SWAP SLOT

       0014'CF            54     D0  0385  8920 	MOVL	R4,W^OSWPPCB		; SAVE PCB ADDRESS FOR SLOT OWNER

            59            1E     9C  038A  8940 	ROTL	#<32-2>,R9,R4		; DIVIDE COUNT BY 4

                          54         038D       

       0012'CF            54     B0  038E  8960 	MOVW	R4,W^OSWPPGS		; SAVE COUNT OF OUTSWAP PAGES

            53            5B     D0  0393  8980 	MOVL	R11,R3			; SET SVA OF MAP FOR I/O

                     0000'CF     D6  0396  9000 	INCL	W^SWP$GL_HOSWPCNT	; ACCOUNT FOR HEADER OUTSWAP

                          05DA   30  039A  9020 	BSBW	SWPWRITE		; WRITE ACTIVE PAGE TABLES

            04            50     E8  039D  9040 	BLBS	R0,30$			; CONTINUE IF NO ERROR

                                     03A0  9060 	BUG_CHECK APTWRTERR,FATAL	; **** ACTIVE PAGE TABLE SWAP I/O ERROR

                               FEFF  03A0       		.WORD	^XFEFF

                               0004' 03A2       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_APTWRTERR!4

                          0599   30  03A4  9080 30$:	BSBW	RELINIT			; INIT REGISTERS FOR RELEASE LOOP

            58         64 A4     D0  03A7  9100 	MOVL	PCB$L_PHD(R4),R8	; RESTORE BALANCE SLOT INDEX

            89            5A     CB  03AB  9120 40$:	BICL3	R10,(R9)+,R0		; ISOLATE PAGE FRAME NUMBER

                          50         03AE       

            56       0000'DF40   D0  03AF  9140 	MOVL	@W^PFN$AL_PTE[R0],R6	; GET PTE ADDRESS

            66            50     D0  03B5  9160 	MOVL	R0,(R6)			; MAKE PTE CORRECT BUT INVALID

                     0000'DF40   B7  03B8  9180 	DECW	@W^PFN$AW_REFCNT[R0]	; DROP REFERENCE COUNT 

                          04     13  03BD  9200 	BEQL	50$			; MUST BE ZERO

                                     03BF  9220 	BUG_CHECK APTREFHIGH,FATAL	; INCONSISTENT PAGE TABLE REFERENCE COUNT

                               FEFF  03BF       		.WORD	^XFEFF

                               0004' 03C1       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_APTREFHIGH!4

            53            56     D0  03C3  9240 50$:	MOVL	R6,R3			; SVAPTE FOR DELCON

                          0591   30  03C6  9260 	BSBW	RELDELPAGE		; RELEASE PAGE THROUGH DELCONPFN

                          66     D4  03C9  9280 	CLRL	(R6)			; SET NO ACCESS ON PFN

            DD            57     F5  03CB  9300 	SOBGTR	R7,40$			; CONTINUE FOR ALL ACTIVE PAGE TABLES

       0000'DF48          01     AE  03CE  9320 	MNEGW	#1,@W^PHV$GL_REFCBAS[R8]	; MARK BALANCE SLOT AVAIL

                     0000'DF48   B4  03D4  9340 	CLRW	@W^PHV$GL_PIXBAS[R8]	; AND SET PIX TO NULL

                       64 A4     D4  03D9  9360 	CLRL	PCB$L_PHD(R4)		; AND SEVER CONNECTION WITH PROCESS

                                     03DC  9380 

                                     03DC  9400 OSWPEXIT:				; OUTSWAP COMPLETE

                          04E1   31  03DC  9420 	BRW	SWAPRETRY		; RETRY SWAP SCHEDULE AFTER OUTSWAP

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  13

0501            DELPHD - DELETE PROCESS HEADER FOR DELETED PROC                                                                  (1)



                                     03DF  9460 	.SBTTL	DELPHD - DELETE PROCESS HEADER FOR DELETED PROCESS

                                     03DF  9480 ;

                                     03DF  9500 ; FUNCTIONAL DESCRIPTION:

                                     03DF  9520 ;	DELPHD IS ENTERED BY RELPHD IF THE PROCESS INDEX ASSOCIATED WITH

                                     03DF  9540 ;	THE BALANCE SLOT IS NEGATIVE INDICATING THE PROCESS HAS BEEN DELETED.

                                     03DF  9560 ;	NOW THAT THE REFERENCE COUNT FOR THE HEADER IS ZERO, ALL PAGES AND

                                     03DF  9580 ;	BACKING STORE PAGES CAN BE RELEASED PERMITTING RELEASE OF THE BALANCE

                                     03DF  9600 ;	SLOT.  AT THIS POINT THE SPT ENTRIES ARE VALID WITH A PFN, DEMAND ZERO,

                                     03DF  9620 ;	OR BACKING STORE ADDRESS FORM.  THERE ARE NO REMAINING TRANSITION PAGES.

                                     03DF  9640 ;

                                     03DF  9660 ; INPUT PARAMETERS:

                                     03DF  9680 ;	R1 - PRODUCT OF SGN$C_BSLOTSZ * BALANCE_SLOT_INDEX

                                     03DF  9700 ;	R6 - ADDRESS OF FIRST SPT ENTRY FOR THIS BALANCE SLOT

                                     03DF  9720 ;	R7 - SGN$C_BSLOTSZ

                                     03DF  9740 ;	R8 - BALANCE_SLOT_INDEX

                                     03DF  9760 ;	R10- MASK OF PTE$M_VALID!PTE$M_MODIFY!PTE$C_SRKW

                                     03DF  9780 ;

                                     03DF  9800 DELPHD:					;

            51            09     9C  03DF  9820 	ROTL	#9,R1,R5		; COMPUTE OFFSET TO PHD FROM BASE

                          55         03E2       

            55       0000'CF     C0  03E3  9840 	ADDL	W^SWP$GL_BALBASE,R5	; FORM PHD ADDRESS

            5B         1F A5     9A  03E8  9860 	MOVZBL	PHD$B_PAGFIL(R5),R11	; GET PAGING FILE NUMBER

            50            86     D0  03EC  9880 10$:	MOVL	(R6)+,R0		; GET PTE FROM SPT

                          2C     13  03EF  9900 	BEQL	40$			; BR IF EMPTY

                          04     19  03F1  9920 	BLSS	20$			; BR IF VALID

            50            1A     E0  03F3  9940 	BBS	#PTE$V_TYP1,R0,25$	; BR IF TYPE 1 (BACKING STORE)

                          16         03F6       

            50            5A     CA  03F7  9960 20$:	BICL	R10,R0			; ISOLATE PFN

                          1E     13  03FA  9980 	BEQL	30$			; SKIP DEMAND ZERO PTE

            59       0000'DF40   D0  03FC 10000 	MOVL	@W^PFN$AL_BAK[R0],R9	; GET BACKUP ADDRESS

         FF A6         84 8F     8A  0402 10020 	BICB	#<<PTE$M_VALID!PTE$M_MODIFY>@-24>,-1(R6) ; CLEAR VALID AND MODIFY

                          0550   30  0407 10040 	BSBW	RELDELPAGE		; RELEASE PAGE

            50            59     D0  040A 10060 	MOVL	R9,R0			; GET BACKUP ADDRESS

            16            00     EF  040D 10080 25$:	EXTZV	#PTE$V_PGFLVB,#PTE$S_PGFLVB,R0,R0	; GET PAG FIL VB

            50            50         0410       

                          06     13  0412 10100 	BEQL	30$			; BR IF NONE

            51            5B     D0  0414 10120 	MOVL	R11,R1			; SET PAGING FILE NUMBER FOR RELEASE

                          FBE6'  30  0417 10140 	BSBW	MMG$DALCPAGFIL		; DEALLOCATE PAGING FILE PAGE

                       FC A6     D4  041A 10160 30$:	CLRL	-4(R6)			; ZAP SPT ENTRY

            CC            57     F5  041D 10180 40$:	SOBGTR	R7,10$			; RELEASE ENTIRE HEADER

                                     0420 10200 	INVALID				; INVALIDATE HEADER

            39            01     DA  0420       		MTPR	#1,S^#PR$_TBIA

       0000'DF48          01     AE  0423 10220 	MNEGW	#1,@W^PHV$GL_REFCBAS[R8]	; MARK SLOT EMPTY

                     0000'DF48   B4  0429 10240 	CLRW	@W^PHV$GL_PIXBAS[R8]	; POINT OWNER PIX AT NULL PROCESS

                     0000'CF     B7  042E 10260 	DECW	W^SCH$GW_DELPHDCT	; ACCOUNT FOR DELETED HEADER

                          048B   31  0432 10280 	BRW	SWAPRETRY		; AND RETRY SWAP ATTEMPT

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  14

0501            GBLTRANS/GBLVALID/GBLWRTVALID - HANDLE GLOBAL P                                                                  (1)



                                     0435 10320 	.SBTTL	GBLTRANS/GBLVALID/GBLWRTVALID - HANDLE GLOBAL PAGES

                                     0435 10340 

                                     0435 10360 ;

                                     0435 10380 ;	GBLTRANS HANDLES THE CASE OF A GLOBAL PAGE IN TRANSITION,

                                     0435 10400 ;	WHICH IMPLIES THAT THE PAGE HAS BEEN FAULTED BUT IS NOT YET

                                     0435 10420 ;	RESIDENT.  THE WORKING SET LIST ENTRY FOR THIS PAGE WILL BE

                                     0435 10440 ;	DELETED AND THE PAGE WILL HAVE TO BE FAULTED AGAIN.

                                     0435 10460 ;

                                     0435 10480 

                                     0435 10500 GBLTRANS:				; TRANSITION GLOBAL PAGE

            63   04400000 8F     D3  0435 10520 	BITL	#<PTE$M_TYP0! -		; CHECK FOR GPTX FORM OF PTE

                                     043C 10540 		  PTE$M_TYP1>,(R3)	;

                          31     13  043C 10560 	BEQL	GBLGOOD			; NO, GLOBAL GOOD PAGE

                                     043E 10580 GBLWRTTRANS:				; TRANSITION WRITABLE GLOBAL PAGE

            00       0000'DF40   F0  043E 10600 	INSV	@W^MMG$GL_GPTBASE[R0],#PTE$V_PFN,#PTE$S_PFN,R0	; GET GLOBAL PFN FROM MASTER

            50            15         0444       

                                     0446 10616 

                                     0446 10618 	.ENABL	LSB

                                     0446 10620 GBLDROP:				; DROP GLOBAL PAGE FROM WORKING SET

            51            57     D0  0446 10640 	MOVL	R7,R1			; GET WSL INDEX FOR RELEASE

                          53     DD  0449 10660 	PUSHL	R3			; SAVE SVAPTE FOR FOLLOWING DECPTREF

                          FBB2'  30  044B 10680 	BSBW	MMG$DELWSLEX		; DELETE WSL GIVEN INDEX

                          08     BA  044E 10700 	POPR	#^M<R3>			; RESTORE SVAPTE

                          FBAD'  30  0450 10720 	BSBW	MMG$DECPTREF		; AND DROP PAGE TABLE REFERENCE

                                     0453 10740 	DECSHR	GTR=10$			; DECREASE SHARE COUNT

                     0000'DF40   B7  0453       		DECW	@W^PFN$AW_SHRCNT[R0]

                          14     14  0458       		BGTR	10$

                          03     18  045A       		BGEQ	30005$

                          FBA1'  30  045C       		BSBW	MMG$SHRCNTNEG

                                     045F       30005$:

                                     045F 10755 PROCDROP:

                                     045F 10760 	DECREF	GTR=10$			; AND REF COUNT IF LAST SHARER

                     0000'DF40   B7  045F       		DECW	@W^PFN$AW_REFCNT[R0]

                          08     14  0464       		BGTR	10$

                          03     18  0466       		BGEQ	30006$

                          FB95'  30  0468       		BSBW	MMG$REFCNTNEG

                                     046B       30006$:

                          FB92'  30  046B 10780 	BSBW	MMG$RELPFN		; RELEASE PAGE IF LAST REFERENCE

                                     046E 10800 10$:					;

                                 05  046E 10820 	RSB				; RETURN FOR NEXT PAGE

                                     046F 10822 	.DSABL	LSB

                                     046F 10824 

                                     046F 10840 

                                     046F 10860 ;

                                     046F 10880 ;	GLOBAL "GOODPAGE" A PAGE ONCE PASSED OVER TO PERMIT A 

                                     046F 10900 ;	RE-ACCESS CHECK.

                                     046F 10920 ;

                                     046F 10940 

                                     046F 10960 GBLGOOD:				; GLOBAL PAGE ONCE PASSED OVER

            6D            06     E2  046F 10980 	BBSS	#WSL$V_GOODPAGE,(FP),10$; RECORD PAGE STATUS

                          00         0472       

                                     0473 11000 10$:					;

                                     0473 11020 					; AND TREAT AS NORMAL VALID PAGE

                                     0473 11040 ;

                                     0473 11060 ;	GBLVALID HANDLES A VALID, NON-WRITABLE, PAGE.

                                     0473 11080 ;

                                     0473 11100 GBLVALID:				; VALID GLOBAL PAGE

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  15

0501            GBLTRANS/GBLVALID/GBLWRTVALID - HANDLE GLOBAL P                                                                  (1)



            5A            50     C9  0473 11120 	BISL3	R0,R10,(R9)+		; SET IN SWAPPER MAP FOR OUT SWAP

                          89         0476       

                          FB86'  30  0477 11140 	BSBW	MMG$DECPTREF		; DROP PAGE TABLE REFERENCE FOR PAGE

                                     047A 11160 GBLRESET:				; RESET SLAVE PTE TO GPTX FORMAT

       0000'DF40     0000'CF     C3  047A 11180 	SUBL3	W^MMG$GL_GPTBASE,@W^PFN$AL_PTE[R0],R1	; GET GPTX FOR PAGE

                          51         0482       

            51            1E     9C  0483 11200 	ROTL	#<32-2>,R1,R1		; AND CONVERT TO CORRECT SCALE

                          51         0486       

                                     0487 11220 	ASSUME	PTE$V_TYP0 EQ PTE$S_GPTX

            51            16     E2  0487 11240 	BBSS	#PTE$V_TYP0,R1,10$	; MARK AS GLOBAL

                          00         048A       

            63   845FFFFF 8F     CB  048B 11260 10$:	BICL3	#<PTE$M_VALID ! -	; OBTAIN PERMANENT BITS FOR PTE

                          52         0492       

                                     0493 11280 		  PTE$M_TYP0  ! -	; BY CLEARING ALL OTHERS

                                     0493 11300 		  PTE$M_TYP1  ! -	;

                                     0493 11320 		  PTE$M_PFN>,(R3),R2	; TO FORM TRANSITION GLOBAL PTE

            52            51     C9  0493 11340 	BISL3	R1,R2,(R3)		; MUST SET ENTIRE PTE AT ONE TIME

                          63         0496       

                                     0497 11360 					; SO THAT I/O CAN SEE CONSISTENT PTE

                                 05  0497 11380 	RSB				; RETURN FOR NEXT PAGE

                                     0498 11400 

                                     0498 11420 ;

                                     0498 11440 ;	GBLWRTVALID HANDLES THE CASE OF A WRITABLE GLOBAL PAGE.

                                     0498 11460 ;	SUCH PAGES ARE DROPPED FROM THE WORKING SET BEFORE OUTSWAPPING

                                     0498 11480 ;	AND MUST BE SUBSEQUENTLY RE-FAULTED.

                                     0498 11500 ;

                                     0498 11520 GBLWRTVALID:				; VALID WRITABLE GLOBAL PAGE

            63            1A     E5  0498 11540 	BBCC	#PTE$V_MODIFY,(R3),10$	; TEST AND CLEAR MODIFY BIT IN SLAVE PTE

                          07         049B       

       0000'DF40       80 8F     88  049C 11560 	BISB	#PFN$M_MODIFY,@W^PFN$AB_STATE[R0] ; AND SAVE MODIFY STATE

                          D5     10  04A3 11580 10$:	BSBB	GBLRESET		; RESET PTE

                          9F     11  04A5 11600 	BRB	GBLDROP			; DELETE WORKING SET LIST ENTRY

                                     04A7 11620 

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  16

0501            PROCTRANS - PROCESS PAGE IN TRANSITION                                                                           (1)



                                     04A7 11660 	.SBTTL	PROCTRANS - PROCESS PAGE IN TRANSITION

                                     04A7 11680 ;

                                     04A7 11700 ;	THIS PAGE IS IN TRANSITION DUE TO THE FACT THAT THE PAGE FAULT

                                     04A7 11720 ;	READ OPERATION HAS NOT YET COMPLETED.  IT IS TREATED AS AN

                                     04A7 11740 ;	I/O IN PROGRESS PAGE.

                                     04A7 11760 ;

                                     04A7 11780 PROCTRANS:				; PROCESS PAGE IN TRANSITION

                          00     ED  04A7 11782 	CMPZV	#PFN$V_LOC,#PFN$S_LOC,-	; IF THIS PAGE COULD NOT

       0000'DF40          03         04A9 11784 		@W^PFN$AB_STATE[R0],#PFN$C_RDERR ; BE SUCCESSFULLY READ

                          04         04AE       

                          08     12  04AF 11786 	BNEQ	5$			;

            51            57     D0  04B1 11788 	MOVL	R7,R1			; DROP IT FROM THE WORKING SET

                          FB49'  30  04B4 11790 	BSBW	MMG$DELWSLEX		; DELETE THE WSL ENTRY GIVEN WSL INDEX

                          A6     11  04B7 11792 	BRB	PROCDROP		; AND RELEASE THE PFN IF LAST REF

            6D            06     E2  04B9 11800 5$:	BBSS	#WSL$V_GOODPAGE,(FP),10$; MARK AS GOOD PAGE

                          00         04BC       

                                     04BD 11820 10$:					; AND TREATE AS NORMAL VALID PAGE

                                     04BD 11840 

                                     04BD 11860 ;

                                     04BD 11880 ;	PROCVALID HANDLES THE CASE OF A VALID PROCESS PAGE WHICH INCURS

                                     04BD 11900 ;	SOME SPECIAL PROCESSING IF THERE IS I/O IN PROGRESS.  AN I/O IN 

                                     04BD 11920 ;	PROGRESS PAGE IS SWAPPED WITH THE BODY OF THE PROCESS TO RESERVE

                                     04BD 11940 ;	SPACE FOR IT IN THE SWAP IMAGE AND IS LATER WRITTEN WITH CORRECT 

                                     04BD 11960 ;	CONTENT BY THE MODIFIED PAGE WRITER TO THIS RESERVED SPACE IN THE

                                     04BD 11980 ;	SWAP IMAGE.

                                     04BD 12000 ;

                                     04BD 12020 PROCVALID:				; PROCESS VALID PAGE

                                     04BD 12040 	.ENABL	LSB

                                     04BD 12060 10$:					;

       0000'DF40          07     E4  04BD 12080 	BBSC	#PFN$V_MODIFY,@W^PFN$AB_STATE[R0],20$	; BR IF PAGE MODIFIED

                          04         04C3       

            63            1A     E1  04C4 12100 	BBC	#PTE$V_MODIFY,(R3),30$	; BR IF PAGE NOT MODIFIED

                          04         04C7       

            6D            08     E2  04C8 12120 20$:	BBSS	#WSL$V_MODIFY,(FP),30$	; SET WORKING SET MODIFIED BIT

                          00         04CB       

                                     04CC 12140 30$:					;

       0000'DF40          01     B1  04CC 12160 	CMPW	#1,@W^PFN$AW_REFCNT[R0]	; CHECK FOR I/O OUTSTANDING

                          1A     13  04D2 12180 	BEQL	40$			; NO, NONE

            06            52     E8  04D4 12200 	BLBS	R2,35$			; NOT A TRANSITION PAGE

            6D            06     E5  04D7 12220 	BBCC	#WSL$V_GOODPAGE,(FP),SETWRTBAK	; CLEAR GOOD PAGE FOR READ IN PROG

                          06         04DA       

                          04     11  04DB 12240 	BRB	SETWRTBAK		; 

            6D            08     E1  04DD 12260 35$:	BBC	#WSL$V_MODIFY,(FP),40$	; DONT WRITE UNMODIFIED PAGES

                          0D         04E0       

                                     04E1 12280 SETWRTBAK:				; SET PAGE FOR WRITE BACK TO SWAP FILE

            59            5B     C3  04E1 12300 	SUBL3	R11,R9,R1		; GET OFFSET TO PAGE IN SWAP MAP

                          51         04E4       

            51            04     C6  04E5 12320 	DIVL	#4,R1			; SCALE BACK TO PAGE NUMBER

       0000'DF40          51     B0  04E8 12340 	MOVW	R1,@W^PFN$AW_SWPVBN[R0]	; SET OFFSET INTO SWAP IMAGE LESS APTCNT

                                     04EE 12360 40$:					;

            5A            50     C9  04EE 12380 	BISL3	R0,R10,(R9)+		; PUT PAGE IN SWAPPER MAP

                          89         04F1       

                                     04F2 12400 ;

                                     04F2 12420 ;	SET DELETE CONTENT FLAG TO CAUSE PAGE TO BE PLACED AT HEAD

                                     04F2 12440 ;	OF FREE PAGE LIST AND CONTENT FORGOTTEN.

                                     04F2 12460 ;

       0000'DF40          10     88  04F2 12480 DELCON:	BISB	#PFN$M_DELCON,@W^PFN$AB_STATE[R0] ; SET TO DELETE CONTENT

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  17

0501            PROCTRANS - PROCESS PAGE IN TRANSITION                                                                           (1)



                                 05  04F8 12500 	RSB				; RETURN FOR NEXT PAGE

                                     04F9 12520 	.DSABL	LSB			;

                                     04F9 12540 

                                     04F9 12560 WSLERR:	BUG_CHECK IVWSETLIST,FATAL	; INVALID WORKING SET LIST ENTRY

                               FEFF  04F9       		.WORD	^XFEFF

                               0004' 04FB       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_IVWSETLIST!4

                                     04FD 12580 

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  18

0501            PAGE TABLE WORKING SET LIST ENTRIES                                                                              (1)



                                     04FD 12620 	.SBTTL	PAGE TABLE WORKING SET LIST ENTRIES

                                     04FD 12640 ;

                                     04FD 12660 ;	PAGE TABLE AND PROCESS HEADER ENTRIES IN THE WORKING SET LIST

                                     04FD 12680 ;	ARE IGNORED DURING THE PROCESS BODY OUTSWAP SCAN OF THE WORKING

                                     04FD 12700 ;	SET LIST.

                                     04FD 12720 ;

                                     04FD 12740 PPGTBLTRANS:				; TRANSITION PAGE TABLE

                                     04FD 12760 PPGTBLVALID:				; VALID PAGE TABLE

                       34 A4     B6  04FD 12780 	INCW	PCB$W_APTCNT(R4)	; ACCUMULATE ACTIVE PAGE TABLE COUNT

            6D            55     C2  0500 12800 	SUBL	R5,(FP)			; UNBIAS WSL VA FOR PAGE TABLE

            6D            1F     E2  0503 12820 	BBSS	#VA$V_SYSTEM,(FP),10$	; BUT FORCE SYSTEM BIT ON IN VA

                          00         0506       

                                 05  0507 12840 10$:	RSB				; RETURN

                                     0508 12860 

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  19

0501            INSWAP                                                                                                           (1)



                                     0508 12900 	.SBTTL	INSWAP

                                     0508 12920 

                                     0508 12940 INSWAP:					; PERFORM INSWAP

            55         64 A4     D0  0508 12960 	MOVL	PCB$L_PHD(R4),R5	; GET CURRENT PROCESS HEADER SLOT

                          06     13  050C 12980 	BEQL	10$			; NONE, MUST ALLOCATE ONE

            58         46 A5     3C  050E 13000 	MOVZWL	PHD$W_PHVINDEX(R5),R8	; GET BALANCE SLOT INDEX

                          34     11  0512 13020 	BRB	40$			; AND CONTINUE

                          58     D4  0514 13040 10$:	CLRL	R8			; INIT INDEX FOR BALANCE SLOT SEARCH

                     0000'DF48   B5  0516 13060 20$:	TSTW	@W^PHV$GL_REFCBAS[R8]	; CHECK FOR EMPTY

                          0E     19  051B 13080 	BLSS	30$			; YES, GOT ONE

            58   00000000'EF     F2  051D 13100 	AOBLSS	SGN$GL_BALSETCT,R8,20$	; TRY ALL BALANCE SET SLOTS

                          F1         0524       

            5D            01     CE  0525 13120 	MNEGL	#1,FP			; SET FLAG TO PERMIT OUTSWAPPING

                                     0528 13140 					; OF PROCESSES

                          FBFD   31  0528 13160 	BRW	OUTSWAP			; OUTSWAP IF NECESSARY TO GET SLOT

       0000'DF48       60 A4     B0  052B 13180 30$:	MOVW	PCB$L_PID(R4),@W^PHV$GL_PIXBAS[R8]	; SET PIX FOR BALANCE SET SLOT

                     0000'DF48   B4  0532 13200 	CLRW	@W^PHV$GL_REFCBAS[R8]	; AND BUMP REFERENCE COUNT

            58       0000'CF     C5  0537 13220 	MULL3	W^SWP$GL_BSLOTSZ,R8,R0	; COMPUTE BALANCE SLOT OFFSET

                          50         053C       

            50            09     9C  053D 13240 	ROTL	#9,R0,R0		; MAKE BYTE OFFSET

                          50         0540       

         64 A4       0000'DF40   9E  0541 13260 	MOVAB	@W^SWP$GL_BALBASE[R0],PCB$L_PHD(R4)	; AND SET ADDRESS IN PCB

                          59     D4  0548 13280 40$:	CLRL	R9			; INITIALIZE SWAPPER MAP INDEX

                          FAB3'  30  054A 13300 50$:	BSBW	MMG$ALLOCPFN		; ALLOCATE A PAGE

                          50     D5  054D 13320 	TSTL	R0			; MAKE SURE IT WAS ALLOCATED

                          04     18  054F 13340 	BGEQ	60$			; YES, CONTINUE

                                     0551 13360 	BUG_CHECK INSNFREPAG,FATAL	; INSUFFICIENT FREE PAGES

                               FEFF  0551       		.WORD	^XFEFF

                               0004' 0553       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_INSNFREPAG!4

                     0000'DF40   B6  0555 13380 60$:	INCW	@W^PFN$AW_REFCNT[R0]	; REFERENCE PAGE

       0000'DF40          07     90  055A 13400 	MOVB	#PFN$C_ACTIVE,@W^PFN$AB_STATE[R0]	; AND MARK IT ACTIVE

            50   D0000000 8F     C9  0560 13420 	BISL3	#<PTE$C_SRKW!PTE$M_VALID>,R0,@W^SWP$GL_MAP[R9] ; MARK VALID, WRITABLE

                     0000'DF49       0567       

            59            5A     F2  056B 13440 	AOBLSS	R10,R9,50$		; REPEAT FOR ALL REQUIRED PAGES

                          DB         056E       

                     0000'DF49   D4  056F 13460 	CLRL	@W^SWP$GL_MAP[R9]	; PUT STOPPER IN LIST

                                     0574 13480 ;

                                     0574 13500 ;	ALL PAGES HAVE NOW BEEN ACQUIRED AND A BALANCE SET SLOT

                                     0574 13520 ;	ALLOCATED.  THE INSWAP I/O OPERATION CAN NOW BE PERFORMED.

                                     0574 13540 ;

                     0018'CF     B6  0574 13560 	INCW	W^SWP$GW_BALCNT		; ADD ONE PROCESS TO BALANCE SET

       0000'CF            54     D0  0578 13580 	MOVL	R4,W^SWP$GL_INPCB	; SAVE POINTER TO IN SWAP PCB

       0000'CF            5A     D0  057D 13600 	MOVL	R10,W^SWP$GL_ISPAGCNT	; SAVE COUNT OF ALLOCATED PAGES

       0000'CF            58     B0  0582 13620 	MOVW	R8,W^SWP$GW_IBALSETX	; AND BALANCE SET SLOT NUMBER

                                     0587 13640 ;--------------------------------------------------------------------

                                     0587 13660 ;

                                     0587 13680 ;	PERFORM INSWAP I/O OPERATION

                                     0587 13700 ;

                                     0587 13720 ;--------------------------------------------------------------------

                                     0587 13740 

            52         24 A4     D0  0587 13760 	MOVL	PCB$L_WSSWP(R4),R2	; GET SWAP IMAGE DISK ADDRESS

         28 A4            12     E1  058B 13780 	BBC	#PCB$V_PHDRES,PCB$L_STS(R4),70$	; SWAP EVERYTHING IF HEADER NON-RES

                          07         058F       

            50         34 A4     3C  0590 13800 	MOVZWL	PCB$W_APTCNT(R4),R0	; GET ACTIVE PAGE TABLE COUNT

            52            50     C0  0594 13820 	ADDL	R0,R2			; ADD PAGE TABLE COUNT

            53       0000'DF     DE  0597 13840 70$:	MOVAL	@W^SWP$GL_MAP,R3	; SVA OF PAGE TABLE FOR I/O

                       24 A4     D5  059C 13860 	TSTL	PCB$L_WSSWP(R4)		; IS THIS A SHELL INSWAP

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  20

0501            INSWAP                                                                                                           (1)



                          07     12  059F 13880 	BNEQ	80$			; NO, USE FULL COUNT FOR I/O

            5A   00000000'EF     D0  05A1 13900 	MOVL	SWP$GL_SHELIO,R10	; GET I/O PAGE COUNT FOR SHELL

            54            5A     D0  05A8 13920 80$:	MOVL	R10,R4			; NUMBER OF PAGES TO READ

                     0000'CF     D6  05AB 13940 	INCL	W^SWP$GL_ISWPCNT	; BUMP INSWAP COUNTER

                          03BF   30  05AF 13960 	BSBW	SWPREAD			; PERFORM READ

            04            50     E8  05B2 13980 	BLBS	R0,SETUP		; CHECK FOR ERROR IN READ

                                     05B5 14000 	BUG_CHECK	INSWAPERR,FATAL	; ****TEMP BUGCHECK ON I/O ERROR

                               FEFF  05B5       		.WORD	^XFEFF

                               0004' 05B7       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_INSWAPERR!4

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  21

0501            INSWAP                                                                                                           (1)



                                     05B9 14040 

                                     05B9 14060 ;--------------------------------------------------------------------

                                     05B9 14080 ;

                                     05B9 14100 ;	SET UP PROCESS IN BALANCE SET SLOT

                                     05B9 14120 ;

                                     05B9 14140 ;--------------------------------------------------------------------

                                     05B9 14160 

                                     05B9 14180 SETUP:					; SETUP INSWAP PROCESS

                          038E   30  05B9 14200 	BSBW	OSINIT			; INIT REGISTERS

            54       0000'CF     D0  05BC 14220 	MOVL	W^SWP$GL_INPCB,R4	; GET PCB ADDRESS OF INSWAP PROCESS

                       24 A4     D5  05C1 14240 	TSTL	PCB$L_WSSWP(R4)		; CHECK FOR SHELL INSWAP

                          09     12  05C4 14260 	BNEQ	NOTSHELL		; BR IF NOT

                                     05C6 14280 	INVALID				; CLEAR TRANSLATION BUFFER

            39            01     DA  05C6       		MTPR	#1,S^#PR$_TBIA

                 00000000'9F     16  05C9 14300 	JSB	@#SWP$SHELINIT		; CALL SHELL INITIALIZATION

                                     05CF 14320 					; WHICH RETURNS WITH A FULLY INITED PHD

                                     05CF 14340 NOTSHELL:				;

            58       0000'CF     3C  05CF 14360 	MOVZWL	W^SWP$GW_IBALSETX,R8	; AND BALANCE SET INDEX

            58       0000'CF     C5  05D4 14380 	MULL3	W^SWP$GL_BSLOTSZ,R8,R7	; COMPUTE OFFSET TO THIS SLOT

                          57         05D9       

            57       0000'DF47   DE  05DA 14400 	MOVAL	@W^SWP$GL_BALSPT[R7],R7	; FORM BASE ADDRESS OF MAP FOR SLOT

            53            57     D0  05E0 14420 	MOVL	R7,R3			; NOW POINT TO PROCESS HEADER

         28 A4            12     E2  05E3 14440 	BBSS	#PCB$V_PHDRES,PCB$L_STS(R4),5$	; SKIP IF PROCESS HEADER STILL RESIDENT

                          17         05E7       

                     0000'CF     D6  05E8 14460 	INCL	W^SWP$GL_HISWPCNT	; COUNT SWAPS INCLUDING HEADER

                          02E9   30  05EC 14480 	BSBW	FILLPHD			; SET INTO SPT ENTRIES

                                     05EF 14500 ;

                                     05EF 14520 ;	FILLPHD RETURNS WITH R5 POINTING TO THE PROCESS HEADER POSITION

                                     05EF 14540 ;	WITHIN ITS P0 SPACE.

                                     05EF 14560 ;

         46 A5            58     B0  05EF 14580 	MOVW	R8,PHD$W_PHVINDEX(R5)	; SET BALANCE SLOT INDEX

       00C8 C5         64 A4     C0  05F3 14600 	ADDL	PCB$L_PHD(R4),PHD$L_P0BR(R5)	; RELOCATE P0 BASE REGISTER

       00D0 C5         64 A4     C0  05F9 14620 	ADDL	PCB$L_PHD(R4),PHD$L_P1BR(R5)	; RELOCATE P1 BASE REGISTER

            15            00     EF  05FF 14640 5$:	EXTZV	#0,#PTE$S_PFN,(R7),R0	; GET PHYSICAL ADDRESS OF PCB

            50            67         0602       

            50            09     9C  0604 14660 	ROTL	#9,R0,R0		; AND SET IN SOFTWARE PCB

                          50         0607       

         18 A4         78 A0     9E  0608 14680 	MOVAB	PHD$L_PCB(R0),PCB$L_PHYPCB(R4)	; ADD OFFSET TO HW PCB

                                     060D 14700 ;

                                     060D 14720 ;	NOW SET PAGES FROM WORKING SET LIST INTO PAGE TABLE ENTRIES

                                     060D 14740 ;

            55         64 A4     D0  060D 14760 	MOVL	PCB$L_PHD(R4),R5	; GET PROCESS HEADER ADDRESS

                                     0611 14780 	INVALID				; CLEAR TRANSLATION BUFFER TO SEE IT

            39            01     DA  0611       		MTPR	#1,S^#PR$_TBIA

                                     0614 14800 ;

                                     0614 14820 ;	A WINDOW IN P1 SPACE IS DOUBLE MAPPED TO ALL OF THE PROCESS

                                     0614 14840 ;	HEADER EXCEPT FOR THE PAGE TABLES. THIS PERMITS REFERENCE TO 

                                     0614 14860 ;	MOST OF THE PROCESS HEADER WHILE RUNNING AT IPL LESS THAN THE

                                     0614 14880 ;	SCHEDULER.  TO REFERENCE THE PROCESS HEADER IN SYSTEM SPACE

                                     0614 14900 ;	A PROCESS(OTHER THAN THE SWAPPER) MUST RAISE TO IPL$_SYNCH.

                                     0614 14920 ;

                                     0614 14940 

            52   00000000'EF     D0  0614 14960 	MOVL	SWP$GL_PHDBASVA,R2	; VIRTUAL ADDRESS OF PHD WINDOW

                          F9E2'  30  061B 14980 	BSBW	MMG$SVAPTECHK		; GET POINTER TO WINDOW PTE

            52       0000'CF     D0  061E 15000 	MOVL	W^SGN$GL_PHDPAGCT,R2	; SET COUNT OF PAGES FOR WINDOW

            51   F0000000 8F     D0  0623 15020 	MOVL	#<PTE$C_URKW!PTE$M_VALID>,R1	; SKELETON PTE

            50            87     D0  062A 15040 10$:	MOVL	(R7)+,R0		; GET SWAPPER PTE FOR PHD

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  22

0501            INSWAP                                                                                                           (1)



                          04     19  062D 15060 	BLSS	20$			; BR IF VALID PAGE

                          83     D4  062F 15080 	CLRL	(R3)+			; NO, SET NO ACCESS

                          08     11  0631 15100 	BRB	30$			;

            00            50     F0  0633 15120 20$:	INSV	R0,#PTE$V_PFN,#PTE$S_PFN,R1	; AND INSERT PFN INTO WINDOW PTE

            51            15         0636       

            83            51     D0  0638 15140 	MOVL	R1,(R3)+		; STORE IN WINDOW AND ADVANCE TO NEX PTE

            EC            52     F5  063B 15160 30$:	SOBGTR	R2,10$			; MAP ENTIRE PHD WINDOW

                                     063E 15180 ;

                                     063E 15200 ;	THE REMAINING LIST OF PAGES READ BY THE SWAPPER ARE NOW PROCESSED

                                     063E 15220 ;	ACCORDING TO THE CONTENT OF THE WORKING SET LIST IN THE HEADER OF

                                     063E 15240 ;	THE INSWAP PROCESS.  THE DISPOSITION OF EACH INSWAP PAGE DEPENDS

                                     063E 15260 ;	ON ITS TYPE AND WHETHER THE PAGE IS ALREADY PRESENT IN WHICH CASE

                                     063E 15280 ;	THE NEW, REDUNDANT COPY IS DISCARDED.  SHARED PAGES READ FROM THE

                                     063E 15300 ;	SWAP IMAGE WHICH ARE NOT ALREADY RESIDENT BECOME THE MASTER COPY

                                     063E 15320 ;	AS WELL AS SATISFYING THE REQUIREMENT OF THE INSWAP PROCESS.

                                     063E 15340 ;

            01            1F     9C  063E 15360 	ROTL	#PTE$V_VALID,#1,R11	; FORM VALID MASK

                          5B         0641       

            56         08 A5     3C  0642 15380 	MOVZWL	PHD$W_WSLIST(R5),R6	; INDEX TO START OF PERM ENTRIES

            57         12 A5     3C  0646 15400 	MOVZWL	PHD$W_WSLAST(R5),R7	; POINTER TO LAST WS ENTRY

                                     064A 15420 	.ENABL	LSB			;

            52            6546   D0  064A 15440 WSLOOP:	MOVL	(R5)[R6],R2		; GET A WORKING SET ENTRY

                          07     10  064E 15460 	BSBB	10$			; AND PROCESS IT

            56            57     F3  0650 15480 	AOBLEQ	R7,R6,WSLOOP		; SCAN ENTIRE WORKING SET LIST

                          F6         0653       

                          022E   31  0654 15500 	BRW	SETASTLVL		; END OF WORKING SET LIST

                                     0657 15520 	ASSUME	WSL$V_VALID EQ 0	; FOR USE OF BLBS

            0A            52     E8  0657 15540 10$:	BLBS	R2,20$			; CHECK FOR VALIDITY, BR IF VALID

                                 05  065A 15560 15$:	RSB				; GET NEXT WSL ENTRY IF NOT VALID

            52            55     C0  065B 15580 17$:	ADDL	R5,R2			; REBIAS VA FOR WSL ENTRY

            52            5B     C9  065E 15600 	BISL3	R11,R2,(R5)[R6]		; AND SET SYSTEM BIT IN VA

                          6546       0661       

                                 05  0663 15620 	RSB				; NEXT WORKING SET LIST ENTRY

                                     0664 15640 20$:					;

                          F5     19  0664 15660 	BLSS	17$			; SKIP PAGE TABLE ENTRIES

                          F997'  30  0666 15680 	BSBW	MMG$SVAPTECHK		; GET SVA OF PTE FOR PAGE

                                     0669 15700 ;

                                     0669 15720 ;	R0 - ALL BITS EXCEPT PFN FIELD ARE CLEAR

                                     0669 15740 ;	R2 - WS LIST ENTRY

                                     0669 15760 ;	R3 - SVA OF PTE

                                     0669 15780 ;	R4 - INSWAP PROCESS PCB

                                     0669 15800 ;	R5 - PHD ADDRESS FOR INSWAP PROCESS

                                     0669 15820 ;	R6 - WORKING SET INDEX

                                     0669 15840 ;	R7 - END INDEX TO WORKING SET

                                     0669 15860 ;	R8 - BALANCE SET SLOT INDEX

                                     0669 15880 ;	R9 - ADDRESS OF PHYSICAL PAGE POINTER IN SWP$AL_MAP

                                     0669 15900 ;	R10 - PTE$C_SRKW!PTE$M_VALID!PTE$M_MODIFY

                                     0669 15920 ;	R11 - CONSTANT PFN$M_VALID

                                     0669 15940 ;

            89            5A     CB  0669 15960 	BICL3	R10,(R9)+,R0		; GET PFN FROM MAP

                          50         066C       

                          04     12  066D 15980 	BNEQ	30$			; GOT A GOOD PFN

                                     066F 16000 	BUG_CHECK ZEROPAGE,FATAL	; ZERO PAGE TABLE ENTRY FROM SWAP MAP

                               FEFF  066F       		.WORD	^XFEFF

                               0004' 0671       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_ZEROPAGE!4

            5C            63     D0  0673 16020 30$:	MOVL	(R3),AP			; GET CONTENT OF PTE

                          04     18  0676 16040 	BGEQ	35$			; PTE VALID => PFN LOCK, NOT SWAPPED

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  23

0501            INSWAP                                                                                                           (1)



                                     0678 16060 	BUG_CHECK	ICPAGELOC,FATAL	; NOT YET IMPLEMENTED

                               FEFF  0678       		.WORD	^XFEFF

                               0004' 067A       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_ICPAGELOC!4

            5C            1A     E1  067C 16080 35$:	BBC	#PTE$V_TYP1,AP,NTYP1	; BR IF NOT TYPE 1

                          7C         067F       

       0000'DF40          53     D0  0680 16100 	MOVL	R3,@W^PFN$AL_PTE[R0]	; NOTE LOCATION OF PTE

       0000'DF40          56     B0  0686 16120 	MOVW	R6,@W^PFN$AW_WSLX[R0]	; AND POSITION IN WORKING SET

            17            00     EF  068C 16140 	EXTZV	#PFN$V_BAK,#PFN$S_BAK,(R3),R1 ; GET BACKING ADR FROM PTE

            51            63         068F       

            51            16     E0  0691 16160 	BBS	#PTE$V_TYP0,R1,40$	; BR IF SECTION ADDRESS

                          06         0694       

            18         1F A5     F0  0695 16180 	INSV	PHD$B_PAGFIL(R5),#PFN$V_PGFLX,#PFN$S_PGFLX,R1

            51            08         0699       

                                     069B 16200 					; SET PAGING FILE NUMBER

       0000'DF40          51     D0  069B 16220 40$:	MOVL	R1,@W^PFN$AL_BAK[R0]	; STORE BACKING ADDRESS

       0000'DF40          07     90  06A1 16240 	MOVB	#PFN$C_ACTIVE,@W^PFN$AB_STATE[R0]; SET PAGE ACTIVE

                                     06A7 16260 RECONNECT:				; RECONNECT TO PAGE

            63   867FFFFF 8F     CB  06A7 16280 	BICL3	#^C<PTE$M_PROT!PTE$M_OWN>,(R3),R1	; RETAIN PERMANENT BITS

                          51         06AE       

            52            6546   DE  06AF 16300 	MOVAL	(R5)[R6],R2		; GET ADDRESS OF WORKING SET LIST ENTRY

            62            08     E5  06B3 16320 	BBCC	#WSL$V_MODIFY,(R2),50$	; CHECK FOR MODIFIED AND CLEAR

                          07         06B6       

       0000'DF40       80 8F     88  06B7 16340 	BISB	#PFN$M_MODIFY,@W^PFN$AB_STATE[R0] ; RECORD MODIFY STATE

                                     06BE 16360 50$:					;

            62            06     E4  06BE 16380 	BBSC	#WSL$V_GOODPAGE,(R2),55$; CLEAR GOODPAGE FLAG

                          03         06C1       

            51            5B     C8  06C2 16400 	BISL	R11,R1			; SET VALID BIT FOR PTE

            51            50     C9  06C5 16420 55$:	BISL3	R0,R1,(R3)		; MERGE BITS WITH PFN  AND STORE IN PGTBL

                          63         06C8       

            15            09     EF  06C9 16440 	EXTZV	#VA$V_VPN,#VA$S_VPN,R3,R1	; GET VPN OF PAGE TABLE

            51            53         06CC       

            00       0000'DF41   F0  06CE 16460 	INSV	@W^MMG$GL_SPTBASE[R1],#0,#PTE$S_PFN,R0	; GET PT PFN

            50            15         06D4       

                                     06D6 16480 					; ASSUMES HIGH ORDER BITS OF R0 ARE CLEAR

                     0000'DF40   B5  06D6 16500 	TSTW	@W^PFN$AW_SHRCNT[R0]	; CHECK FOR FIRST ACTIVE PAGE

                          12     12  06DB 16520 	BNEQ	60$			; NO, JUST RAISE SHARE COUNT FOR PT

            51       0000'DF40   3C  06DD 16540 	MOVZWL	@W^PFN$AW_WSLX[R0],R1	; GET INDEX TO WSL ENTRY FOR PAGE TABLE

            6541          20     C8  06E3 16560 	BISL	#WSL$M_WSLOCK,(R5)[R1]	; AND MARK IT LOCKED IN WORKING SET

                       70 A5     B6  06E7 16580 	INCW	PHD$W_PTCNTACT(R5)	; COUNT ANOTHER ACTIVE PAGE TABLE

                     0000'DF48   B6  06EA 16600 	INCW	@W^PHV$GL_REFCBAS[R8]	; RAISE REFERENCE COUNT OF BALANCE SLOT

                                     06EF 16620 60$:					;

                     0000'DF40   B6  06EF 16640 	INCW	@W^PFN$AW_SHRCNT[R0]	; INDICATE ANOTHER ACTIVE PAGE FOR PT

                                 05  06F4 16660 	RSB				; RETURN TO GET NEXT WSL ENTRY

                                     06F5 16680 	.DSABL	LSB			;

                                     06F5 16700 

                                     06F5 16720 ZEROPG:	BUG_CHECK ZEROPAGE,FATAL	; ZERO PFN IN PTE

                               FEFF  06F5       		.WORD	^XFEFF

                               0004' 06F7       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_ZEROPAGE!4

                                     06F9 16730 BR_GLOBAL:

                          009F   31  06F9 16735 	BRW	GLOBAL			; GLOBAL PAGE

                                     06FC 16740 NTYP1:					; GLOBAL OR TRANSITION

            5C            16     E0  06FC 16760 	BBS	#PTE$V_TYP0,AP,BR_GLOBAL	; BR IF GLOBAL PAGE

                          F9         06FF       

            15            00     EF  0700 16780 	EXTZV	#PTE$V_PFN,#PTE$S_PFN,AP,FP	; GET OLD PFN IF ANY

            5D            5C         0703       

                          EE     13  0705 16800 	BEQL	ZEROPG			; BR IF ZERO PAGE (BUG CHECK)

                                     0707 16820 ;

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  24

0501            INSWAP                                                                                                           (1)



                                     0707 16840 ;	RELEASE PFN FOR PAGE ALREADY PRESENT

                                     0707 16860 ;

                          0253   30  0707 16880 	BSBW	RELPAGE			; RELEASE DUPLICATE PAGE

            50            5D     D0  070A 16900 	MOVL	FP,R0			; GET SAVED PFN

            03            00     EF  070D 16920 	EXTZV	#PFN$V_LOC,#PFN$S_LOC,@W^PFN$AB_STATE[R0],R2

            52       0000'DF40       0710       

                                     0715 16940 	ASSUME	PFN$C_FREPAGLST EQ 0	;

                                     0715 16960 	ASSUME	PFN$C_MFYPAGLST EQ 1	;

                                     0715 16980 	ASSUME	PFN$C_BADPAGLST EQ 2	;

                                     0715 17000 	ASSUME	PFN$C_RELPEND	EQ 3	;

                                     0715 17020 	ASSUME	PFN$C_RDERR	EQ 4	;

                                     0715 17040 	ASSUME	PFN$C_WRTINPROG	EQ 5	;

                                     0715 17060 	ASSUME	PFN$C_RDINPROG	EQ 6	;

                                     0715 17080 	ASSUME	PFN$C_ACTIVE	EQ 7	;

                                     0715 17100 	CASE	R2,<-			; DISPATCH ON PAGE LOCATION

                                     0715 17120 		20$,-			; 0 => FREE PAGE LIST

                                     0715 17140 		20$,-			; 1 => MODIFIED PAGE LIST

                                     0715 17160 		60$,-			; 2 => BAD PAGE LIST, PAGE READ/WRITE ERR

                                     0715 17180 		30$,-			; 3 => RELEASE PENDING

                                     0715 17200 		10$,-			; 4 => PAGE READ ERROR

                                     0715 17220 		30$,-			; 5 => WRITE IN PROGRESS

                                     0715 17240 		40$,-			; 6 => READ IN PROGRESS

                                     0715 17260 		30$>			; 7 => ACTIVE ( I/O NOT YET COMPLETE

            00            52     AF  0715       	CASEW	R2,#0,S^#<<30008$-30007$>/2>-1

                          07'        0718       

                                     0719       30007$:

                               0014' 0719       	.WORD	20$-30007$

                               0014' 071B       	.WORD	20$-30007$

                               004F' 071D       	.WORD	60$-30007$

                               0023' 071F       	.WORD	30$-30007$

                               0010' 0721       	.WORD	10$-30007$

                               0023' 0723       	.WORD	30$-30007$

                               002C' 0725       	.WORD	40$-30007$

                               0023' 0727       	.WORD	30$-30007$

                                     0729       30008$:

                                     0729 17280 

                                     0729 17300 10$:	BUG_CHECK ICPAGELOC,FATAL	; INCONSISTENT PAGE LOCATION

                               FEFF  0729       		.WORD	^XFEFF

                               0004' 072B       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_ICPAGELOC!4

                                     072D 17320 

                          53     DD  072D 17340 20$:	PUSHL	R3			; SAVE SVAPTE

                          F8CE'  30  072F 17360 	BSBW	MMG$REMPFN		; UNLINK PFN FROM FREE OR MODIFY LIST

                          08     BA  0732 17380 	POPR	#^M<R3>			; RESTORE SVAPTE

            52            6546   DE  0734 17400 	MOVAL	(R5)[R6],R2		; COMPUTE ADDRESS OF WSL ENTRY

            62            06     E4  0738 17420 25$:	BBSC	#WSL$V_GOODPAGE,(R2),35$; TEST AND CLEAR GOOD PAGE FLAG

                          03         073B       

                                     073C 17440 					; SKIP SETTING MODIFY BIT IF GOODPAGE

            63            5B     C8  073C 17460 30$:	BISL	R11,(R3)		; SET VALID BIT FOR PTE

                                     073F 17480 	ASSUME	PFN$V_LOC EQ 0		; TO USE BISB INSTEAD OF INSV

       0000'DF40          07     88  073F 17500 35$:	BISB	#PFN$C_ACTIVE,@W^PFN$AB_STATE[R0]	;

                                 8A  0745 17520 40$:	BICB	#<PFN$M_DELCON!-	; CLEAR DELETE AND

                                     0746 17540 		PFN$M_MODIFY>,-		; MODIFY

       0000'DF40       90 8F         0746 17560 		@W^PFN$AB_STATE[R0]	; FLAGS

                     0000'DF40   B6  074C 17580 45$:	INCW	@W^PFN$AW_REFCNT[R0]	; RAISE REFERENCE COUNT

                     0000'DF40   B4  0751 17600 	CLRW	@W^PFN$AW_SWPVBN[R0]	; INDICATE NO ALTERNATE LOCATION

            62            08     E5  0756 17620 	BBCC	#WSL$V_MODIFY,(R2),50$	; CLEAR MODIFY BIT FOR WSL

                          07         0759       

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  25

0501            INSWAP                                                                                                           (1)



       0000'DF40       80 8F     88  075A 17640 	BISB	#PFN$M_MODIFY,@W^PFN$AB_STATE[R0] ; RECORD PAGE AS MODIFIED

       0000'DF40          56     B0  0761 17660 50$:	MOVW	R6,@W^PFN$AW_WSLX[R0]	; SET WORKING SET LIST INDEX FOR PAGE

                                 05  0767 17680 	RSB				; AND RETURN FOR NEXT PAGE

                                     0768 17682 ;

                                     0768 17684 ; PAGE IS ON THE BAD PAGE LIST.  IT HAS THE FOLLOWING POSSIBLE STATES

                                     0768 17686 ;	1) BADPAG BIT SET IN PFN$AB_TYPE => BUG_CHECK

                                     0768 17688 ;	2) SWPVBN CLEAR => PAGE WRITE ERROR, CORRECT COPY OF MODIFY BIT

                                     0768 17690 ;	   IS THE LOGICAL OR OF THE WSLE BIT AND THE PFN BIT

                                     0768 17692 ;	3) SWPVBN SET => PAGE READ ERROR, SET RDERR STATE.

                                     0768 17694 ;

       0000'DF40          05     E0  0768 17696 60$:	BBS	#PFN$V_BADPAG,@W^PFN$AB_TYPE[R0],10$ ; ERROR IF BADPAG

                          BA         076E       

                          53     DD  076F 17698 	PUSHL	R3			; SAVE PTE ADDRESS

                          F88C'  30  0771 17700 	BSBW	MMG$REMPFN		; UNLINK PFN FROM THE BAD PAGE LIST

                          08     BA  0774 17702 	POPR	#^M<R3>			; RESTORE PTE ADDRESS

            52            6546   DE  0776 17704 	MOVAL	(R5)[R6],R2		; COMPUTE ADDRESS OF WSL ENTRY

                     0000'DF40   B5  077A 17706 	TSTW	@W^PFN$AW_SWPVBN[R0]	; IF SWPVBN SET, THEN PAGE READ ERROR

                          0D     12  077F 17708 	BNEQ	80$			; BRANCH IF PAGE READ ERROR

                                     0781 17710 ;

                                     0781 17712 ; PAGE WRITE ERROR

                                     0781 17714 ;

                                     0781 17716 	ASSUME	PFN$V_MODIFY EQ 7

                     0000'DF40   95  0781 17718 	TSTB	@W^PFN$AB_STATE[R0]	; IF PFN MODIFY BIT IS SET

                          B0     18  0786 17720 	BGEQ	25$			;

            62            08     E2  0788 17722 	BBSS	#WSL$V_MODIFY,(R2),25$	; THEN JAM THE WSL ENTRY MODIFY BIT

                          AC         078B       

                          AA     11  078C 17724 	BRB	25$			; AND CONNECT TO THE PAGE

                                     078E 17726 ;

                                     078E 17728 ; PAGE READ ERROR

                                     078E 17730 ;

                                 90  078E 17732 80$:	MOVB	#<PFN$M_DELCON ! PFN$C_RDERR>,- ; SET DELCON

       0000'DF40          14         078F 17734 		@W^PFN$AB_STATE[R0]	; AND PAGE READ ERROR STATE

            62       0140 8F     AA  0794 17736 	BICW	#<WSL$M_MODIFY ! WSL$M_GOODPAGE>,(R2) ; CLEAN UP WSLE

                          B1     11  0799 17738 	BRB	45$			; AND LEAVE PTE IN TRANSITION STATE

                                     079B 17750 ;

                                     079B 17752 ;	INSWAP GLOBAL PAGE

                                     079B 17754 ;

                                     079B 17760 GLOBAL:					; GLOBAL PAGE INSWAP

            16            00     EF  079B 17780 	EXTZV	#PTE$V_GPTX,#PTE$S_GPTX,AP,R1	; GET GLOBAL PAGE TABLE INDEX

            51            5C         079E       

            51       0000'DF41   DE  07A0 17800 	MOVAL	@W^MMG$GL_GPTBASE[R1],R1	; AND CONVERT TO ADDRESS OF GPTE

            52            61     D0  07A6 17820 	MOVL	(R1),R2			; PICK UP GLOBAL MASTER PTE

                          21     19  07A9 17840 	BLSS	10$			; BR IF VALID

            52            16     E0  07AB 17860 	BBS	#PTE$V_TYP0,R2,5$	; BR IF GLOBAL SECTION TYPE

                          17         07AE       

            15            00     EF  07AF 17880 	EXTZV	#PTE$V_PFN,#PTE$S_PFN,R2,R0	; GET PFN OF TRANSITION PAGE

            50            52         07B2       

                                     07B4 17900 	ASSUME	PFN$C_FREPAGLST EQ 0

            03            00     EF  07B4 17920 	EXTZV	#PFN$V_LOC,#PFN$S_LOC,@W^PFN$AB_STATE[R0],R2	; TEST FOR FREE PAGE LIST

            52       0000'DF40       07B7       

                          18     13  07BC 17940 	BEQL	20$			; YES, REFAULT IT

            52            06     91  07BE 17960 	CMPB	#PFN$C_RDINPROG,R2	; IS IT READ IN PROGRESS

                          05     12  07C1 17980 	BNEQ	6$			; NO, ERROR

                          0098   31  07C3 18000 	BRW	60$			; YES, WAIT FOR IT

                          6C     11  07C6 18020 5$:	BRB	50$			;

                                     07C8 18040 6$:	BUG_CHECK	ICPAGELOC,FATAL	; 

                               FEFF  07C8       		.WORD	^XFEFF

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  26

0501            INSWAP                                                                                                           (1)



                               0004' 07CA       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_ICPAGELOC!4

                                     07CC 18060 

                                     07CC 18080 10$:					; INSWAP WITH VALID GLOBAL PAGE

                          018E   30  07CC 18100 	BSBW	RELPAGE			; RELEASE REDUNDANT PAGE

            15            00     EF  07CF 18120 	EXTZV	#PTE$V_PFN,#PTE$S_PFN,R2,R0	; GET PFN FROM MASTER

            50            52         07D2       

                          56     11  07D4 18140 	BRB	40$			; AND GO SETUP SLAVE PTE

                                     07D6 18160 20$:					; GLOBAL ON FREE LIST

                          50     DD  07D6 18180 	PUSHL	R0			; SAVE MASTER PFN

         FC A9            5A     CB  07D8 18200 	BICL3	R10,-4(R9),R0		; GET REDUNDANT PFN

                          50         07DC       

                          017D   30  07DD 18220 	BSBW	RELPAGE			; AND RELEASE IT (PRESERVING R1-R3)

                          01     BA  07E0 18240 	POPR	#^M<R0>			; RESTORE MASTER PFN

            61            5B     C8  07E2 18260 	BISL	R11,(R1)		; SET PAGE VALID

                          0A     BB  07E5 18280 	PUSHR	#^M<R1,R3>		; SAVE SVAGPTE, SVAPTE

                          F816'  30  07E7 18300 	BSBW	MMG$REMPFN		; REMOVE PFN FROM FREELIST

                          0A     BA  07EA 18320 	POPR	#^M<R1,R3>		; RESTORE SVAGPTE, SVAPTE

            00            07     F0  07EC 18340 	INSV	#PFN$C_ACTIVE,#PFN$V_LOC,#PFN$S_LOC,@W^PFN$AB_STATE[R0]	;

       0000'DF40          03         07EF       

                     0000'DF40   B6  07F4 18360 	INCW	@W^PFN$AW_REFCNT[R0]	; RAISE REFERENCE COUNT

                          31     11  07F9 18380 	BRB	40$			;

            15            09     EF  07FB 18400 30$:	EXTZV	#VA$V_VPN,#VA$S_VPN,R1,R1	; GET VPN OF PAGE TABLE

            51            51         07FE       

            51       0000'DF41   D0  0800 18420 	MOVL	@W^MMG$GL_SPTBASE[R1],R1	; GET PAGE TABLE PTE

            15            00     EF  0806 18440 	EXTZV	#PTE$V_PFN,#PTE$S_PFN,R1,R1	; EXTRACT PFN 

            51            51         0809       

                     0000'DF41   B5  080B 18460 	TSTW	@W^PFN$AW_SHRCNT[R1]	; CHECK FOR FIRST REFERENCE TO PTABLE

                          15     12  0810 18480 	BNEQ	35$			; NO

                                     0812 18500 	BUG_CHECK GBLPAGSZRO,FATAL	; GLOBAL PAGE SHARE COUNT ZERO

                               FEFF  0812       		.WORD	^XFEFF

                               0004' 0814       		.IIF IDN <FATAL>,<FATAL> , .WORD	BUG$_GBLPAGSZRO!4

                     0000'DF41   B6  0816 18520 	INCW	@W^PFN$AW_REFCNT[R1]	; RAISE REFERENCE COUNT

            52   00000000'EF     D0  081B 18540 	MOVL	SGN$GL_BALSETCT,R2	; POINT TO SYSTEM SLOT

                     0000'DF42   B6  0822 18560 	INCW	@W^PHV$GL_REFCBAS[R2]	; OTHERWISE RAISE SLOT COUNT

                     0000'DF41   B6  0827 18580 35$:	INCW	@W^PFN$AW_SHRCNT[R1]	; RAISE GLOBAL PAGE TABLE SHARE COUNT

                     0000'DF40   B6  082C 18600 40$:	INCW	@W^PFN$AW_SHRCNT[R0]	; RAISE SHARE COUNT FOR GLOBAL PAGE

                          FE73   31  0831 18620 	BRW	RECONNECT		; RECONNECT AND REFERENCE PAGE TABLE

            17            00     EF  0834 18640 50$:	EXTZV	#PFN$V_BAK,#PFN$S_BAK,R2,@W^PFN$AL_BAK[R0] ; SAVE BACKING ADDR

       0000'DF40          52         0837       

            52   867FFFFF 8F     CA  083C 18660 	BICL	#^C<PTE$M_PROT!PTE$M_OWN>,R2	; SAVE PROTECTION AND OWNER FIELDS

            52            5B     C8  0843 18680 	BISL	R11,R2			; SET PTE VALID

            52            50     C9  0846 18700 	BISL3	R0,R2,(R1)		; AND STORE WITH PFN IN GPT

                          61         0849       

       0000'DF40          51     D0  084A 18720 	MOVL	R1,@W^PFN$AL_PTE[R0]	; SET SVAGPTE IN PFN DATA BASE

       0000'DF40          07     90  0850 18740 	MOVB	#PFN$C_ACTIVE,@W^PFN$AB_STATE[R0] ; SET STATE TO ACTIVE

       0000'DF40          02     90  0856 18760 	MOVB	#PFN$C_GLOBAL,@W^PFN$AB_TYPE[R0]  ; AND TYPE TO GLOBAL

                          9D     11  085C 18780 	BRB	30$			; NOW GO SETUP SLAVE PTE

                                     085E 18800 

       0000'DF40          10     88  085E 18820 60$:	BISB	#PFN$M_COLLISION,@W^PFN$AB_TYPE[R0]	; FLAG COLLISION FOR PAGEREAD

                          3C     BB  0864 18840 	PUSHR	#^M<R2,R3,R4,R5>	; SAVE REGS OVER WAIT

            54       0000'CF     D0  0866 18860 	MOVL	W^SCH$GL_CURPCB,R4	; AND SET PCB ADDRESS

                          F792'  30  086B 18880 	BSBW	SCH$NEWLVL		; SET ASTLVL CORRECTLY

            52       0000'CF     7E  086E 18900 	MOVAQ	W^SCH$GQ_COLPGWQ,R2	; GET ADDRESS OF WAIT QUEUE

                          00     DD  0873 18920 	PUSHL	#0			; NULL KERNEL MODE PSL

                          F788'  30  0875 18940 	BSBW	SCH$WAITK		; WAIT WITH NO CALL FRAME

                                     0878 18960 	SETIPL	#IPL$_SYNCH		; BLOCK SYSTEM EVENTS

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

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  27

0501            INSWAP                                                                                                           (1)



                          3C     BA  087B 18980 	POPR	#^M<R2,R3,R4,R5>	; RESTORE REGS

         FC A9            5A     CB  087D 19000 	BICL3	R10,-4(R9),R0		; RESTORE CURRENT PFN

                          50         0881       

                          FF16   31  0882 19020 	BRW	GLOBAL			; AND ATTEMPT TO REASSOCIATE PAGE

                                     0885 19040 

                                     0885 19060 

                                     0885 19080 ;

                                     0885 19100 ;	SET PROPER AST LEVEL

                                     0885 19120 ;

                                     0885 19140 SETASTLVL:				;

            53         10 A4     DE  0885 19160 	MOVAL	PCB$L_ASTQFL(R4),R3	; GET POINTER TO HEAD OF AST QUEUE

            52            63     D0  0889 19180 	MOVL	(R3),R2			; GET POINTER TO FIRST AST CONTROL BLOCK

            52            53     D1  088C 19200 	CMPL	R3,R2			; IS LIST EMPTY?

                          1C     13  088F 19220 	BEQL	20$			; YES, DONE

                          50     D4  0891 19240 	CLRL	R0			; ASSUME KERNEL MODE

            53         0B A2     90  0893 19260 	MOVB	ACB$B_RMOD(R2),R3	; GET ACTUAL MODE

                          0F     19  0897 19280 	BLSS	10$			; BR IF SPECIAL KERNEL AST

            02            00     EF  0899 19300 	EXTZV	#ACB$V_MODE,#ACB$S_MODE,R3,R0 ; GET ACCESS MODE

            50            53         089C       

         0D A4         0C A4     8B  089E 19320 	BICB3	PCB$B_ASTACT(R4),PCB$B_ASTEN(R4),R1	; CHECK FOR DELIVERABILITY

                          51         08A3       

            51            50     E1  08A4 19340 	BBC	R0,R1,20$		; BR IF NOT PRESENTLY DELIVERABLE

                          05         08A7       

       00CF C5            50     90  08A8 19360 10$:	MOVB	R0,PHD$B_ASTLVL(R5)	; SET AST LEVEL FOR PROCESS

         28 A4            09     C8  08AD 19380 20$:	BISL	#<<1@PCB$V_RES>!<1@PCB$V_INQUAN>>,PCB$L_STS(R4) ; MARK PROCESS RESIDENT

         40 A5   00000000'EF     B0  08B1 19400 	MOVW	SCH$GW_QUAN,PHD$W_QUANT(R5)	; AND GIVE NEW QUANTUM

            50         0B A4     9A  08B9 19420 	MOVZBL	PCB$B_PRI(R4),R0	; GET CURRENT PRIORITY OF PROCESS

                          F740'  30  08BD 19440 	BSBW	SCH$CHSEP		; CHANGE TO RESIDENT COMPUTE

                                     08C0 19460 SWAPRETRY:				; RETRY SWAP SCHEDULING

            54       0000'CF     D0  08C0 19480 	MOVL	W^SCH$GL_CURPCB,R4	; GET PCB ADDRESS

         28 A4            0C     E6  08C5 19500 	BBSSI	#PCB$V_WAKEPEN,PCB$L_STS(R4),20$	; SET TO CANCEL HIBER

                          00         08C9       

                                     08CA 19520 20$:

                                     08CA 19540 	.DSABL	LSB

                                     08CA 19560 SWAPEXIT:				; EXIT SWAPPER

       0000'CF            00'    E5  08CA 19580 	BBCC	S^#SCH$V_SIP,W^SCH$GB_SIP,10$	; CLEAR SWAP IN PROGRESS

                          00         08CF       

                                     08D0 19600 10$:	

                                     08D0 19620 SWAPEXITA:				; ALTERNATE EXIT, LEAVING SIP SET

                     3FC0 8F     BA  08D0 19640 	POPR	#^M<R6,R7,R8,R9,R10,R11,AP,FP>	; RESTORE REGISTERS

                                     08D4 19660 	ENBINT				; DROP IPL

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

                                 05  08D7 19680 	RSB				;

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  28

0501            FILLPHD - FILL SPT ENTRIES TO MAP PHD                                                                            (1)



                                     08D8 19720 	.SBTTL	FILLPHD - FILL SPT ENTRIES TO MAP PHD

                                     08D8 19740 ;++

                                     08D8 19760 ; FUNCTIONAL DESCRIPTION:

                                     08D8 19780 ;	FILLPHD SETS THE PTE ENTRIES FOR THE PROCESS HEADER INTO THE

                                     08D8 19800 ;	SPT.

                                     08D8 19820 ;

                                     08D8 19840 ; CALLING SEQUENCE:

                                     08D8 19860 ;	BSB/JSB	FILLPHD

                                     08D8 19880 ;

                                     08D8 19900 ; INPUT PARAMETERS:

                                     08D8 19920 ;	R3  -  POINTER TO FIRST SPT ENTRY FOR PHD

                                     08D8 19940 ;	R9  -  ADDRESS OF SWAPPER MAP ENTRY TO BE MOVED TO SPT

                                     08D8 19960 ;	R10 -  PTE$C_SRKW!PTE$M_VALID!PTE$M_MODIFY

                                     08D8 19980 ;

                                     08D8 20000 ; OUTPUT PARAMETERS:

                                     08D8 20020 ;	R5 - ZERO

                                     08D8 20040 ;	R6 - DESTROYED

                                     08D8 20060 ;	R9 - UPDATED

                                     08D8 20080 ;	R11 - DESTROYED

                                     08D8 20100 ;	AP - DESTROYED

                                     08D8 20120 ;	FP - DESTROYED

                                     08D8 20140 ;--

                                     08D8 20160 

                                     08D8 20180 FILLPHD:				;

                                     08D8 20200 

                          55     D4  08D8 20220 	CLRL	R5			; SET PHD ADDRESS TO SWAPPER P0 SPACE

                                     08DA 20240 	INVALID				; TO SEE CORRECT PROCESS HEADER IN SWAPPER P0

            39            01     DA  08DA       		MTPR	#1,S^#PR$_TBIA

                          5B     D4  08DD 20260 	CLRL	R11			; INIT HEADER PAGE INDEX 

            56       00D8 C5     3C  08DF 20280 	MOVZWL	PHD$W_EMPTPG(R5),R6	; GET COUNT OF EMPTY PAGES

            56            09     78  08E4 20300 	ASHL	#9,R6,R6		; CONVERT TO BYTE OFFSET

                          56         08E7       

            5C         4A A5     3C  08E8 20320 	MOVZWL	PHD$W_WSLX(R5),AP	; FORM BASE ADDRESS FOR WSLX

            5C            654C   DE  08EC 20340 	MOVAL	(R5)[AP],AP		; SAVE VECTOR FOR PHD

            5D         48 A5     3C  08F0 20360 	MOVZWL	PHD$W_BAK(R5),FP	; FORM BASE ADDRESS FOR BACKING STORE ADDRESS

            5D            654D   DE  08F4 20380 	MOVAL	(R5)[FP],FP		; VECTOR

            5C            56     C2  08F8 20400 	SUBL	R6,AP			; ACCOUNT FOR EMPTY PAGES

            5D            56     C2  08FB 20420 	SUBL	R6,FP			; BY SUBTRACTING THEIR SPACE

            56       0000'CF     D0  08FE 20440 	MOVL	W^SWP$GL_BSLOTSZ,R6	; SET ITERATION COUNT FOR ENTIRE HEADER

            83            8D     D0  0903 20460 10$:	MOVL	(FP)+,(R3)+		; SET BACKUP FORM OF PTE IN SPT SLOT

                          33     18  0906 20480 	BGEQ	30$			; DONE IF NOT VALID

            89            5A     CB  0908 20500 	BICL3	R10,(R9)+,R0		; GET PAGE FROM SWAPPER MAP

                          50         090B       

       0000'DF40          73     DE  090C 20520 	MOVAL	-(R3),@W^PFN$AL_PTE[R0]	; SET PTE BACK POINTER

            17            00     EF  0912 20540 	EXTZV	#PFN$V_BAK,#PFN$S_BAK,(R3),R1	; ISOLATE BACKING STORE ADDRESS

            51            63         0915       

            18         1F A5     F0  0917 20560 	INSV	PHD$B_PAGFIL(R5),#PFN$V_PGFLX,#PFN$S_PGFLX,R1	; ADD FILE NUMBER

            51            08         091B       

       0000'DF40          51     D0  091D 20580 	MOVL	R1,@W^PFN$AL_BAK[R0]	; SAVE IN PFN DATA BASE

       0000'DF40          6C4B   B0  0923 20600 	MOVW	(AP)[R11],@W^PFN$AW_WSLX[R0]	; SAVE WORKING SET LIST INDEX

            5A            50     C9  092A 20620 	BISL3	R0,R10,(R3)+		; SET VALID PTE FOR PAGE

                          83         092D       

       0000'DF40       87 8F     90  092E 20640 	MOVB	#<PFN$C_ACTIVE!PFN$M_MODIFY>,@W^PFN$AB_STATE[R0] ; MARK PAGE ACTIVE

       0000'DF40          04     90  0935 20660 	MOVB	#PFN$C_PPGTBL,@W^PFN$AB_TYPE[R0]	; STORE TYPE IN PFN DATA BASE

            5B            56     F2  093B 20680 30$:	AOBLSS	R6,R11,10$		; FILL ENTIRE PROCESS HEADER

                          C4         093E       

                                 05  093F 20700 	RSB

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  29

0501            FILLPHD - FILL SPT ENTRIES TO MAP PHD                                                                            (1)



                                     0940 20720 

                                     0940 20740 

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  30

0501            RELINIT - INITIALIZE REGISTERS FOR PAGE RELEASE                                                                  (1)



                                     0940 20780 	.SBTTL	RELINIT - INITIALIZE REGISTERS FOR PAGE RELEASE LOOP

                                     0940 20800 ;++

                                     0940 20820 ; FUNCTIONAL DESCRIPTION:

                                     0940 20840 ;	RELINIT SETS UP REGISTERS FOR THE PAGE RELEASE LOOPS FOLLOWING

                                     0940 20860 ;	OUTSWAP I/O OPERATIONS.

                                     0940 20880 ;

                                     0940 20900 ; CALLING SEQUENCE:

                                     0940 20920 ;	BSB/JSB	RELINIT

                                     0940 20940 ;

                                     0940 20960 ; INPUT PARAMETERS:

                                     0940 20980 ;	NONE

                                     0940 21000 ;

                                     0940 21020 ; OUTPUT PARAMETERS:

                                     0940 21040 ;	R0  -  0

                                     0940 21060 ;	R4  -  OUT SWAP PCB ADDRESS (OSWPPCB)

                                     0940 21080 ;	R7  -  PAGE COUNT TO RELEASE

                                     0940 21100 ;	R9  -  BASE ADDRESS FOR SWAPPER MAP (SWP$AL_MAP)

                                     0940 21120 ;	R10 -  PTE$C_SRKW!PTE$M_VALID!PTE$M_MODIFY

                                     0940 21140 ;	R11 -  BASE ADDRESS FOR SWAPPER MAP (SWP$AL_MAP)

                                     0940 21160 ;

                                     0940 21180 ;--

                                     0940 21200 

                                     0940 21220 RELINIT:				; RELEASE LOOP INITIALIZATION

            54       0014'CF     D0  0940 21240 	MOVL	W^OSWPPCB,R4		; GET PCB ADDRESS OF OUT SWAP PROCESS

            57       0012'CF     3C  0945 21260 	MOVZWL	W^OSWPPGS,R7		; AND PAGE COUNT FOR RELEASE LOOP

                                     094A 21280 ;	BRB	OSINIT			; FALL INTO OSINIT

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  31

0501            OSINIT - OUTSWAP SCAN REGISTER INITIALIZATION                                                                    (1)



                                     094A 21320 	.SBTTL	OSINIT - OUTSWAP SCAN REGISTER INITIALIZATION

                                     094A 21340 ;++

                                     094A 21360 ; FUNCTIONAL DESCRIPTION:

                                     094A 21380 ;	OSINIT SETS UP REGISTERS FOR PAGE TABLE SCANS REQUIRED DURING

                                     094A 21400 ;	OUTSWAPPING.

                                     094A 21420 ;

                                     094A 21440 ; INPUT PARAMETERS:

                                     094A 21460 ;	NONE

                                     094A 21480 ;

                                     094A 21500 ; OUTPUT PARAMETERS:

                                     094A 21520 ;	R9 - BASE ADDRESS OF SWAPPER MAP (SWP$AL_MAP)

                                     094A 21540 ;	R10 - PTE$C_SRKW!PTE$M_VALID

                                     094A 21560 ;	R11 - BASE ADDRESS OF SWAPPER MAP (SWP$AL_MAP)

                                     094A 21580 ;

                                     094A 21600 ;--

                                     094A 21620 

                                     094A 21640 OSINIT:					;

            59       0000'DF     DE  094A 21660 	MOVAL	@W^SWP$GL_MAP,R9		; SET BASE OF SWAPPER MAP

            5B            59     D0  094F 21680 	MOVL	R9,R11			; AND MAKE REFERENCE COPY

            5A   D4000000 8F     D0  0952 21700 	MOVL	#<PTE$C_SRKW!PTE$M_VALID!PTE$M_MODIFY>,R10 ; MASK TO VALIDATE SWAP PTE

                                 05  0959 21720 	RSB				; RETURN

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  32

0501            RELPAGE - RELEASE DUPLICATE PAGE                                                                                 (1)



                                     095A 21760 	.SBTTL	RELPAGE - RELEASE DUPLICATE PAGE

                                     095A 21780 ;++

                                     095A 21800 ; FUNCTIONAL DESCRIPTION:

                                     095A 21820 ;	RELPAGE RELEASES A PHYSICAL PAGE WHICH DUPLICATES A PAGE ALREADY

                                     095A 21840 ;	PRESENT FOR THE PROCESS.  THIS SITUATION CAN ARISE DUE TO A PARTIAL

                                     095A 21860 ;	INSWAP OR A GLOBAL PAGE WHICH IS ALREADY PRESENT.

                                     095A 21880 ;

                                     095A 21900 ; CALLING SEQUENCE:

                                     095A 21920 ;	BSB/JSB	RELPAGE

                                     095A 21940 ;

                                     095A 21960 ; INPUT PARAMETERS:

                                     095A 21980 ;	R0 - PFN TO RELEASE

                                     095A 22000 ;	R3 - SVA OF PTE (RELDELPAGE ONLY)

                                     095A 22020 ;

                                     095A 22040 ; OUTPUT PARAMETERS:

                                     095A 22060 ;	R1 - PRESERVED (RELPAGE ONLY)

                                     095A 22080 ;	R2 - PRESERVED (RELPAGE ONLY)

                                     095A 22100 ;	R3 - PRESERVED (RELPAGE ONLY)

                                     095A 22120 ;

                                     095A 22140 ;--

                                     095A 22160 

                                     095A 22180 

                                     095A 22200 RELDELPAGE:				; RELEASE PAGE THROUGH DELCONPFN

                          F6A3'  30  095A 22220 	BSBW	MMG$DELCONPFN		; DELETE PAGE CONTENT AND INIT PFN DATA

                                     095D 22240 RELPAGE:				; RELEASE PAGE

                          0E     BB  095D 22260 	PUSHR	#^M<R1,R2,R3>		; PRESERVE REGISTERS

                     0000'DF40   94  095F 22280 	CLRB	@W^PFN$AB_STATE[R0]	; INIT PFN DATA FOR RELEASE

                     0000'DF40   B4  0964 22300 	CLRW	@W^PFN$AW_REFCNT[R0]	; ZERO REFERENCE COUNT

                                     0969 22320 	ASSUME	PFN$C_FREPAGLST EQ 0	;

                          52     D4  0969 22340 	CLRL	R2			; INDICATE FREELIST

                          F692'  30  096B 22360 	BSBW	MMG$INSPFNH		; RELEASE PFN TO HEAD OF FREE LIST

                          0E     BA  096E 22380 	POPR	#^M<R1,R2,R3>		; RESTORE REGISTERS

                                 05  0970 22400 	RSB				; AND RETURN TO CALLER

                                     0971 22420 

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  33

0501            SWPREAD/SWPWRITE - SWAPPER I/O ROUTINES                                                                          (1)



                                     0971 22460 	.SBTTL	SWPREAD/SWPWRITE - SWAPPER I/O ROUTINES

                                     0971 22480 ;++

                                     0971 22500 ; FUNCTIONAL DESCRIPTION:

                                     0971 22520 ;	SWPREAD AND SWPWRITE PERFORM THE DETAIL WORK REQUIRED TO READ

                                     0971 22540 ; 	OR WRITE A SET OF CONTIGUOUS PAGES IN A WORKING SET SWAP IMAGE.

                                     0971 22560 ;	THE CALL TO EITHER SWPREAD OR SWPWRITE IS ACTUALLY A CO-ROUTINE

                                     0971 22580 ;	CALL WHICH RETURNS ONLY AFTER ALL SEGMENTS OF THE I/O OPERATION

                                     0971 22600 ;	HAVE BEEN PERFORMED.  THIS RETURN IS EFFECTED BY A SPECIAL KERNEL

                                     0971 22620 ;	AST.

                                     0971 22640 ;

                                     0971 22660 ; CALLING SEQUENCE:

                                     0971 22680 ;	BSB/JSB	SWPREAD/SWPWRITE

                                     0971 22700 ;

                                     0971 22720 ; INPUT PARAMETERS:

                                     0971 22740 ;	R2 - WSSWP FORM OF DISK ADDRESS

                                     0971 22760 ;	R3 - SYSTEM VIRTUAL ADDRESS OF PTE

                                     0971 22780 ;	R4 - PAGE COUNT

                                     0971 22800 ;

                                     0971 22820 ;	00(SP) - RETURN ADDRESS AFTER I/O COMPLETION

                                     0971 22840 ;	04(SP) - SAVED R6

                                     0971 22860 ;	08(SP) - SAVED R7

                                     0971 22880 ;	12(SP) - SAVED R8

                                     0971 22900 ;	16(SP) - SAVED R9

                                     0971 22920 ;	20(SP) - SAVED R10

                                     0971 22940 ;	24(SP) - SAVED R11

                                     0971 22960 ;	28(SP) - SAVED AP

                                     0971 22980 ;	32(SP) - SAVED FP

                                     0971 23000 ;	36(SP) - SAVED IPL

                                     0971 23020 ;	40(SP) - RETURN TO PREVIOUS THREAD

                                     0971 23040 ;

                                     0971 23060 ; IMPLICIT INPUTS:

                                     0971 23080 ;	SWAP FILE TABLE ENTRY (SFT) SELECTED BY WSSWP INPUT

                                     0971 23100 ;

                                     0971 23120 ; OUTPUT PARAMETERS:

                                     0971 23140 ;	R0 - COMPLETION STATUS OF I/O OPERATION

                                     0971 23160 ;

                                     0971 23180 ;--

                                     0971 23200 

                                     0971 23220 	.ENABL	LSB			

                                     0971 23240 SWPREAD:				; SWAP READ INITIATION

                     0000'CF     9F  0971 23260 	PUSHAB	W^EXE$BLDPKTSWPR	; SET ADDRESS OF BUILD PACKET ROUTINE

                          04     11  0975 23280 	BRB	10$			;

                                     0977 23300 SWPWRITE:				; SWAP WRITE INITIATION

                     0000'CF     9F  0977 23320 	PUSHAB	W^EXE$BLDPKTSWPW	; SET ADDRESS OF BUILD PACKET ROUTINE

            51       0000'CF     9E  097B 23340 10$:	MOVAB	W^IOROUTINE,R1		; ADDRESS OF I/O DATA

            81            8E     7D  0980 23360 	MOVQ	(SP)+,(R1)+		; SAVE I/O END ACTION ADDRESS

                     3FC0 8F     BA  0983 23380 	POPR	#^M<R6,R7,R8,R9,R10,R11,AP,FP>; RESTORE REGISTERS OTHER THAN STANDARD SET

            08            18     EF  0987 23400 15$:	EXTZV	#24,#8,R2,R0		; GET SWAP FILE INDEX

            50            52         098A       

            50       0000'DF40   D0  098C 23420 	MOVL	@W^MMG$GL_PAGSWPVC[R0],R0; GET BASE ADDRESS OF SWAP FILE TABLE

            55         01 A0     9A  0992 23440 	MOVZBL	SFT$B_IOSZ(R0),R5	; GET I/O SIZE

            55            54     D1  0996 23460 	CMPL	R4,R5			; COMPARE REMAINING PGCNT WITH MAX TRANSFER

                          03     14  0999 23480 	BGTR	20$			; USE MAXIMUM TRANSFER

            55            54     D0  099B 23500 	MOVL	R4,R5			; SET TRANSFER TO REMAINING PAGES

            52            55     C1  099E 23520 20$:	ADDL3	R5,R2,(R1)+		; SAVE UPDATED DISK ADDRESS

                          81         09A1       

            81            6345   DE  09A2 23540 	MOVAL	(R3)[R5],(R1)+		; AND UPDATED SAVPTE

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  34

0501            SWPREAD/SWPWRITE - SWAPPER I/O ROUTINES                                                                          (1)



                                     09A6 23560 	ENBINT				; DROP IPL

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

            54            55     A3  09A9 23580 	SUBW3	R5,R4,(R1)		; SAVE REMAINING PAGE COUNT

                          61         09AC       

                          53     DD  09AD 23600 	PUSHL	R3			; SAVE SVAPTE

                       0C A0     DD  09AF 23620 	PUSHL	SFT$L_WINDOW(R0)	; GET WINDOW ADDRESS 

            55            09     9C  09B2 23640 	ROTL	#9,R5,-(SP)		; CONVERT PAGES TO BYTE COUNT

                          7E         09B5       

            18            00     EF  09B6 23660 	EXTZV	#0,#24,R2,-(SP)		; AND ISOLATE BLOCK NUMBER

            7E            52         09B9       

            6E         10 A0     C0  09BB 23680 	ADDL	SFT$L_VBN(R0),(SP)	; ADD BASE VBN

            54       0000'CF     D0  09BF 23700 	MOVL	W^SCH$GL_CURPCB,R4	; SET PCB ADDRESS

            55       0000'DF     0F  09C4 23720 	REMQUE	@W^IOC$GL_IRPFL,R5	; GET A PACKET IF POSSIBLE

                          06     1C  09C9 23740 	BVC	30$			; BR IF ONE AVAILABLE

                          F632'  30  09CB 23760 	BSBW	EXE$ALLOCIRP		; ALLOCATE ONE THE LONG WAY

            55            52     D0  09CE 23780 	MOVL	R2,R5			; SET PACKET ADDRESS IN PROPER REGISTER

         14 A5         E2'AF     9E  09D1 23800 30$:	MOVAB	B^IODONE,IRP$L_ASTPRM(R5); SET ADDRESS FOR COMPLETION

         23 A5         33 A4     90  09D6 23820 	MOVB	PCB$B_PRIB(R4),IRP$B_PRI(R5)	; SET PRIORITY FOR TRANSFER

                          0F     BA  09DB 23840 	POPR	#^M<R0,R1,R2,R3>	; RESTORE VBN,BYTECNT,WINDOW,SVAPTE

                     0000'DF     16  09DD 23860 	JSB	@W^IOROUTINE		; CALL READ OR WRITE ROUTINE

                                 05  09E1 23880 	RSB				; AND RETURN TO ORIGINAL CALLER

                                     09E2 23900 

                                     09E2 23920 IODONE:					; CONTINUATION CALLED AS KERNEL AST

                       34 A5     DD  09E2 23940 	PUSHL	IRP$L_MEDIA(R5)		; SAVE COMPLETION STATUS

            50            55     D0  09E5 23960 	MOVL	R5,R0			; SET PACKET ADDRESS FOR RELEASE

                          F615'  30  09E8 23980 	BSBW	EXE$DEANONPAGED		; AND RELEASE IT

            50            8E     D0  09EB 24000 	MOVL	(SP)+,R0		; RESTORE STATUS

                                     09EE 24020 	DSBINT	#IPL$_SYNCH		; BLOCK SYSTEM EVENTS

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

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

            11            50     E9  09F4 24040 	BLBC	R0,60$			; EXIT IF ERROR

            51       0008'CF     9E  09F7 24060 	MOVAB	W^RWSSWP,R1		; GET ADDRESS OF REMAINING TRANSFER PARAMS

            52            61     7D  09FC 24080 	MOVQ	(R1),R2			; RESTORE WSSWP,SVAPTE TO R2,R3

            54         08'A1     3C  09FF 24100 	MOVZWL	B^<RPGCNT-RWSSWP>(R1),R4	; AND REMAINING PAGE COUNT

                          03     13  0A03 24120 	BEQL	60$			; DONE IF NO MORE PAGES REMAIN

                          FF7F   31  0A05 24140 	BRW	15$			; CONTINUE IF MORE PAGES REMAIN

                     3FC0 8F     BB  0A08 24160 60$:	PUSHR	#^M<R6,R7,R8,R9,R10,R11,AP,FP>; SAVE NON-STANDARD REGISTERS

                     0004'DF     17  0A0C 24180 	JMP	@W^IOEA			; AND CONTINUE SWAP

                                     0A10 24200 

                                     0A10 24220 	.DSABL	LSB			;

                                     0A10 24240 	.END

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  35

SYMBOL TABLE                                                                                                                     (1)



$$T1           = 00000000            IPL$_HWCLK     = 00000018            IRP$V_PRIVIO   = 00000009            

ACB$B_RMOD       0000000B            IPL$_IOPOST    = 00000004            IRP$V_SWAPIO   = 00000006            

ACB$B_TYPE       0000000A            IPL$_MAILBOX   = 0000000B            IRP$V_VIRTUAL  = 00000004            

ACB$L_AST        00000010            IPL$_POWER     = 0000001F            IRP$W_ABCNT      0000003C            

ACB$L_ASTPRM     00000014            IPL$_QUEUEAST  = 00000006            IRP$W_BCNT       00000032            

ACB$L_ASTQBL     00000004            IPL$_SCHED     = 00000003            IRP$W_BOFF       00000030            

ACB$L_ASTQFL     00000000            IPL$_SYNCH     = 00000007            IRP$W_CHAN       00000028            

ACB$L_KAST       00000018            IPL$_TIMER     = 00000007            IRP$W_FUNC       00000020            

ACB$L_PID        0000000C            IRP$B_CARCON     00000038            IRP$W_OBCNT      0000003E            

ACB$M_QUOTA    = 00000040            IRP$B_EFN        00000022            IRP$W_SIZE       00000008            

ACB$S_MODE     = 00000002            IRP$B_PRI        00000023            IRP$W_STS        0000002A            

ACB$V_KAST     = 00000007            IRP$B_RMOD       0000000B            IRP$W_TT_PRMPT   0000003C            

ACB$V_MODE     = 00000000            IRP$B_TYPE       0000000A            MMG$ALLOCPFN     ********   X   04   

ACB$V_QUOTA    = 00000006            IRP$C_LENGTH     0000004C            MMG$DALCPAGFIL   ********   X   04   

ACB$W_SIZE       00000008            IRP$K_LENGTH     0000004C            MMG$DECPTREF     ********   X   04   

BALANCE          00000087 R     04   IRP$L_AST        00000010            MMG$DELCONPFN    ********   X   04   

BIT...         = 00000000            IRP$L_ASTPRM     00000014            MMG$DELWSLEX     ********   X   04   

BR_GLOBAL        000006F9 R     04   IRP$L_DIAGBUF    00000044            MMG$GL_GPTBASE   ********   X   04   

BUG$_APTREFHIGH  ********   X   04   IRP$L_IOQBL      00000004            MMG$GL_PAGSWPVC  ********   X   04   

BUG$_APTWRTERR   ********   X   04   IRP$L_IOQFL      00000000            MMG$GL_SPTBASE   ********   X   04   

BUG$_GBLPAGSZRO  ********   X   04   IRP$L_IOSB       00000024            MMG$INSPFNH      ********   X   04   

BUG$_ICPAGELOC   ********   X   04   IRP$L_IOST1      00000034            MMG$INSPFNT      ********   X   04   

BUG$_INSNFREPAG  ********   X   04   IRP$L_IOST2      00000038            MMG$REFCNTNEG    ********   X   04   

BUG$_INSSWPFIL   ********   X   04   IRP$L_MEDIA      00000034            MMG$RELPFN       ********   X   04   

BUG$_INSWAPERR   ********   X   04   IRP$L_PID        0000000C            MMG$REMPFN       ********   X   04   

BUG$_IVWSETLIST  ********   X   04   IRP$L_SEGVBN     00000040            MMG$SHRCNTNEG    ********   X   04   

BUG$_OUTSWPERR   ********   X   04   IRP$L_SEQNUM     00000048            MMG$SVAPTECHK    ********   X   04   

BUG$_ZEROPAGE    ********   X   04   IRP$L_SVAPTE     0000002C            MMG$WRTMFYPAG    ********   X   04   

DELCON           000004F2 R     04   IRP$L_TT_TERM    00000038            NOTSHELL         000005CF R     04   

DELPHD           000003DF R     04   IRP$L_UCB        0000001C            NOTVALID         00000216 R     04   

EXE$ALLOCIRP     ********   X   04   IRP$L_WIND       00000018            NTYP1            000006FC R     04   

EXE$BLDPKTSWPR   ********   X   04   IRP$M_BUFIO    = 00000001            OSDISPATCH       0000021C R     04   

EXE$BLDPKTSWPW   ********   X   04   IRP$M_CHAINED  = 00000020            OSINIT           0000094A R     04   

EXE$DEANONPAGED  ********   X   04   IRP$M_COMPLX   = 00000008            OSWPEXIT         000003DC R     04   

EXE$GL_PAGED     ********   X   04   IRP$M_DIAGBUF  = 00000080            OSWPPCB          00000014 R     03   

EXE$GL_PFATIM    ********   X   04   IRP$M_FUNC     = 00000002            OSWPPGS          00000012 R     03   

EXE$POWERAST     ********   X   04   IRP$M_MBXIO    = 00000400            OUTSWAP          00000128 R     04   

EXE$SWAPINIT     0000001F RG    04   IRP$M_PAGIO    = 00000004            OWSLOOP          000001FA R     04   

FILLPHD          000008D8 R     04   IRP$M_PHYSIO   = 00000100            PCB$B_ASTACT     0000000C            

GBL...         = 00000000            IRP$M_PRIVIO   = 00000200            PCB$B_ASTEN      0000000D            

GBLDROP          00000446 R     04   IRP$M_SWAPIO   = 00000040            PCB$B_PRI        0000000B            

GBLGOOD          0000046F R     04   IRP$M_VIRTUAL  = 00000010            PCB$B_PRIB       00000033            

GBLRESET         0000047A R     04   IRP$Q_NT_PRVMSK  0000003C            PCB$B_TYPE       0000000A            

GBLTRANS         00000435 R     04   IRP$S_FCODE    = 00000006            PCB$B_WEFC       00000032            

GBLVALID         00000473 R     04   IRP$S_FMOD     = 0000000A            PCB$C_LENGTH     0000007C            

GBLWRTTRANS      0000043E R     04   IRP$S_MODE     = 00000002            PCB$K_LENGTH     0000007C            

GBLWRTVALID      00000498 R     04   IRP$V_BUFIO    = 00000000            PCB$L_ASTQBL     00000014            

GLOBAL           0000079B R     04   IRP$V_CHAINED  = 00000005            PCB$L_ASTQFL     00000010            

IMGDESC          0000000B R     04   IRP$V_COMPLX   = 00000003            PCB$L_EFC2P      00000058            

IMGLEN         = 0000000B            IRP$V_DIAGBUF  = 00000007            PCB$L_EFC3P      0000005C            

IMGNAM           00000000 R     04   IRP$V_FCODE    = 00000000            PCB$L_EFCS       00000050            

INSWAP           00000508 R     04   IRP$V_FMOD     = 00000006            PCB$L_EFCU       00000054            

IOC$GL_IRPFL     ********   X   04   IRP$V_FUNC     = 00000001            PCB$L_EFWM       0000004C            

IODONE           000009E2 R     04   IRP$V_MBXIO    = 0000000A            PCB$L_OWNER      0000001C            

IOEA             00000004 R     03   IRP$V_MODE     = 00000000            PCB$L_PHD        00000064            

IOROUTINE        00000000 R     03   IRP$V_PAGIO    = 00000002            PCB$L_PHYPCB     00000018            

IPL$_ASTDEL    = 00000002            IRP$V_PHYSIO   = 00000008            PCB$L_PID        00000060            

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  36

SYMBOL TABLE                                                                                                                     (1)



PCB$L_PQB        0000004C            PFN$AW_REFCNT    ********   X   04   PHD$L_FREPTECNT  0000002C            

PCB$L_SQBL       00000004            PFN$AW_SHRCNT    ********   X   04   PHD$L_KSP        00000078            

PCB$L_SQFL       00000000            PFN$AW_SWPVBN    ********   X   04   PHD$L_P0BR       000000C8            

PCB$L_STS        00000028            PFN$AW_WSLX      ********   X   04   PHD$L_P0LRASTL   000000CC            

PCB$L_UIC        00000020            PFN$C_ACTIVE   = 00000007            PHD$L_P1BR       000000D0            

PCB$L_WSSWP      00000024            PFN$C_BADPAGLST= 00000002            PHD$L_P1LR       000000D4            

PCB$L_WTIME      0000002C            PFN$C_FREPAGLST= 00000000            PHD$L_PAGEFLTS   0000004C            

PCB$T_LNAME      0000006C            PFN$C_GBLWRT   = 00000003            PHD$L_PAGFIL     0000001C            

PCB$V_ASTPEN   = 00000011            PFN$C_GLOBAL   = 00000002            PHD$L_PC         000000C0            

PCB$V_BATCH    = 0000000E            PFN$C_GPGTBL   = 00000005            PHD$L_PCB        00000078            

PCB$V_DELPEN   = 00000001            PFN$C_MFYPAGLST= 00000001            PHD$L_PGFLCNT    00000034            

PCB$V_FORCPEN  = 00000002            PFN$C_PPGTBL   = 00000004            PHD$L_PGFLQUOTA  0000005C            

PCB$V_HIBER    = 00000013            PFN$C_PROCESS  = 00000000            PHD$L_PSL        000000C4            

PCB$V_INQUAN   = 00000003            PFN$C_RDERR    = 00000004            PHD$L_PSTBASOFF  00000020            

PCB$V_LOGIN    = 00000014            PFN$C_RDINPROG = 00000006            PHD$L_PTWSLELCK  00000064            

PCB$V_NETWRK   = 00000015            PFN$C_RELPEND  = 00000003            PHD$L_PTWSLEVAL  00000068            

PCB$V_NOACNT   = 0000000F            PFN$C_SYSTEM   = 00000001            PHD$L_R0         00000088            

PCB$V_NODELET  = 00000017            PFN$C_WRTINPROG= 00000005            PHD$L_R1         0000008C            

PCB$V_PHDRES   = 00000012            PFN$M_BADPAG   = 00000020            PHD$L_R10        000000B0            

PCB$V_PSWAPM   = 00000004            PFN$M_BAK      = 007FFFFF            PHD$L_R11        000000B4            

PCB$V_PWRAST   = 00000016            PFN$M_COLLISION= 00000010            PHD$L_R12        000000B8            

PCB$V_RES      = 00000000            PFN$M_DELCON   = 00000010            PHD$L_R13        000000BC            

PCB$V_RESPEN   = 00000005            PFN$M_GBLBAK   = 00800000            PHD$L_R2         00000090            

PCB$V_SSFEXC   = 00000006            PFN$M_LOC      = 00000007            PHD$L_R3         00000094            

PCB$V_SSFEXCE  = 00000007            PFN$M_MODIFY   = 00000080            PHD$L_R4         00000098            

PCB$V_SSFEXCS  = 00000008            PFN$M_PAGTYP   = 00000007            PHD$L_R5         0000009C            

PCB$V_SSFEXCU  = 00000009            PFN$M_PGFLX    = FF000000            PHD$L_R6         000000A0            

PCB$V_SSRWAIT  = 0000000A            PFN$M_RPTEVT   = 00000040            PHD$L_R7         000000A4            

PCB$V_SUSPEN   = 0000000B            PFN$S_BAK      = 00000017            PHD$L_R8         000000A8            

PCB$V_SWPVBN   = 00000010            PFN$S_GBLBAK   = 00000001            PHD$L_R9         000000AC            

PCB$V_WAKEPEN  = 0000000C            PFN$S_LOC      = 00000003            PHD$L_REFERFLT   00000014            

PCB$V_WALL     = 0000000D            PFN$S_PAGTYP   = 00000003            PHD$L_SSP        00000080            

PCB$W_APTCNT     00000034            PFN$S_PGFLX    = 00000008            PHD$L_USP        00000084            

PCB$W_ASTCNT     0000003C            PFN$V_BADPAG   = 00000005            PHD$L_WSL        00000118            

PCB$W_BIOCNT     0000003E            PFN$V_BAK      = 00000000            PHD$M_DALCSTX  = 00000002            

PCB$W_BIOLM      00000040            PFN$V_COLLISION= 00000004            PHD$M_PFMFLG   = 00000001            

PCB$W_BYTCNT     00000042            PFN$V_DELCON   = 00000004            PHD$M_WSPEAKCHK= 00000004            

PCB$W_BYTLM      00000068            PFN$V_GBLBAK   = 00000017            PHD$Q_PRIVMSK    00000000            

PCB$W_DIOCNT     00000044            PFN$V_LOC      = 00000000            PHD$S_ASTLVL   = 00000008            

PCB$W_DIOLM      00000046            PFN$V_MODIFY   = 00000007            PHD$S_P0LR     = 00000018            

PCB$W_FILCNT     00000048            PFN$V_PAGTYP   = 00000000            PHD$V_ASTLVL   = 00000018            

PCB$W_GPGCNT     00000038            PFN$V_PGFLX    = 00000018            PHD$V_DALCSTX  = 00000001            

PCB$W_GRP        00000022            PFN$V_RPTEVT   = 00000006            PHD$V_P0LR     = 00000000            

PCB$W_MEM        00000020            PHD$B_ASTLVL     000000CF            PHD$V_PFMFLG   = 00000000            

PCB$W_MTXCNT     0000000E            PHD$B_DFPFC      00000038            PHD$V_WSPEAKCHK= 00000002            

PCB$W_PPGCNT     0000003A            PHD$B_PAGFIL     0000001F            PHD$W_ASTLM      00000044            

PCB$W_PRCCNT     0000006A            PHD$B_PGTBPFC    00000039            PHD$W_BAK        00000048            

PCB$W_SIZE       00000008            PHD$C_LENGTH     00000118            PHD$W_DFWSCNT    0000001A            

PCB$W_STATE      00000030            PHD$C_PHDPAGCTX= 00000008            PHD$W_EMPTPG     000000D8            

PCB$W_TMBU       00000036            PHD$K_LENGTH     00000118            PHD$W_EXTDYNWS   00000076            

PCB$W_TQCNT      0000004A            PHD$L_BIOCNT     00000054            PHD$W_FILLM      00000060            

PFN$AB_STATE     ********   X   04   PHD$L_CPULIM     00000058            PHD$W_FLAGS      0000003A            

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

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

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

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

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

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  37

SYMBOL TABLE                                                                                                                     (1)



PHD$W_PSTLAST    00000024            PR$_TXDB       = 00000023            PTE$V_WRT      = 00000012            

PHD$W_PTCNTACT   00000070            PR$_USP        = 00000003            RECONNECT        000006A7 R     04   

PHD$W_PTCNTLCK   0000006C            PR$_WCSA       = 0000002C            RELDELPAGE       0000095A R     04   

PHD$W_PTCNTMAX   00000072            PR$_WCSD       = 0000002D            RELINIT          00000940 R     04   

PHD$W_PTCNTVAL   0000006E            PROCDROP         0000045F R     04   RELPAGE          0000095D R     04   

PHD$W_QUANT      00000040            PROCTRANS        000004A7 R     04   RELPHD           000002EC R     04   

PHD$W_TQLM       00000062            PROCVALID        000004BD R     04   RPGCNT           00000010 R     03   

PHD$W_WSAUTH     0000000A            PROCWRT          00000239 R     04   RSVAPTE          0000000C R     03   

PHD$W_WSDYN      0000000E            PTE$C_EOWN     = 00800000            RWSSWP           00000008 R     03   

PHD$W_WSFLUID    00000074            PTE$C_ER       = 38000000            SCH$AQ_COMOH     ********   X   04   

PHD$W_WSLAST     00000012            PTE$C_ERKW     = 30000000            SCH$CHSEP        ********   X   04   

PHD$W_WSLIST     00000008            PTE$C_EW       = 28000000            SCH$GB_SIP       ********   X   04   

PHD$W_WSLOCK     0000000C            PTE$C_KOWN     = 00000000            SCH$GL_COMOQS    ********   X   04   

PHD$W_WSLX       0000004A            PTE$C_KR       = 18000000            SCH$GL_CURPCB    ********   X   04   

PHD$W_WSNEXT     00000010            PTE$C_KW       = 10000000            SCH$GL_FREECNT   ********   X   04   

PHD$W_WSQUOTA    00000018            PTE$C_NA       = 00000000            SCH$GL_FREELIM   ********   X   04   

PHV$GL_PIXBAS    ********   X   04   PTE$C_SOWN     = 01000000            SCH$GL_MFYLIM    ********   X   04   

PHV$GL_REFCBAS   ********   X   04   PTE$C_SR       = 58000000            SCH$GL_MFYLOLIM  ********   X   04   

PPGTBLTRANS      000004FD R     04   PTE$C_SREW     = 48000000            SCH$GL_PCBVEC    ********   X   04   

PPGTBLVALID      000004FD R     04   PTE$C_SRKW     = 50000000            SCH$GQ_COLPGWQ   ********   X   04   

PR$_ACCR       = 00000029            PTE$C_SW       = 40000000            SCH$GQ_HIBWQ     ********   X   04   

PR$_ACCS       = 00000028            PTE$C_UOWN     = 01800000            SCH$GW_DELPHDCT  ********   X   04   

PR$_ASTLVL     = 00000013            PTE$C_UR       = 78000000            SCH$GW_QUAN      ********   X   04   

PR$_ESP        = 00000001            PTE$C_UREW     = 68000000            SCH$NEWLVL       ********   X   04   

PR$_ICCS       = 00000018            PTE$C_URKW     = 70000000            SCH$OSWPSCHED    ********   X   04   

PR$_ICR        = 0000001A            PTE$C_URSW     = 60000000            SCH$V_MPW        ********   X   04   

PR$_IPL        = 00000012            PTE$C_UW       = 20000000            SCH$V_SIP        ********   X   04   

PR$_ISP        = 00000004            PTE$M_CRF      = 00010000            SCH$WAITK        ********   X   04   

PR$_KSP        = 00000000            PTE$M_DZRO     = 00020000            SETASTLVL        00000885 R     04   

PR$_MAPEN      = 00000038            PTE$M_GPTX     = 003FFFFF            SETUP            000005B9 R     04   

PR$_NICR       = 00000019            PTE$M_MODIFY   = 04000000            SETWRTBAK        000004E1 R     04   

PR$_P0BR       = 00000008            PTE$M_OWN      = 01800000            SFT$B_IOSZ       00000001            

PR$_P0LR       = 00000009            PTE$M_PFN      = 001FFFFF            SFT$B_PFC        0000000B            

PR$_P1BR       = 0000000A            PTE$M_PGFLVB   = 003FFFFF            SFT$B_SLTCNT     00000000            

PR$_P1LR       = 0000000B            PTE$M_PROT     = 78000000            SFT$B_TYPE       0000000A            

PR$_PCBB       = 00000010            PTE$M_TYP0     = 00400000            SFT$C_LENGTH     00000020            

PR$_PME        = 0000003D            PTE$M_TYP1     = 04000000            SFT$K_LENGTH     00000020            

PR$_RXCS       = 00000020            PTE$M_VALID    = 80000000            SFT$L_BITMAP     00000014            

PR$_RXDB       = 00000021            PTE$M_WRT      = 00040000            SFT$L_VBN        00000010            

PR$_SBIER      = 00000034            PTE$S_GPTX     = 00000016            SFT$L_WINDOW     0000000C            

PR$_SBIFS      = 00000030            PTE$S_OWN      = 00000002            SFT$W_SIZE       00000008            

PR$_SBIMT      = 00000033            PTE$S_PFN      = 00000015            SFT$W_SLOTSZ     00000002            

PR$_SBIQC      = 00000036            PTE$S_PGFLVB   = 00000016            SGN$GL_BALSETCT  ********   X   04   

PR$_SBIS       = 00000031            PTE$S_PROT     = 00000004            SGN$GL_PAGEDYN   ********   X   04   

PR$_SBISC      = 00000032            PTE$S_STX      = 00000010            SGN$GL_PHDPAGCT  ********   X   04   

PR$_SBITA      = 00000035            PTE$V_CRF      = 00000010            SWAPEXIT         000008CA R     04   

PR$_SBR        = 0000000C            PTE$V_DZRO     = 00000011            SWAPEXITA        000008D0 R     04   

PR$_SCBB       = 00000011            PTE$V_GPTX     = 00000000            SWAPRETRY        000008C0 R     04   

PR$_SID        = 0000003E            PTE$V_MODIFY   = 0000001A            SWAPSCHED        000000CE R     04   

PR$_SIRR       = 00000014            PTE$V_OWN      = 00000017            SWP$ALLOC        ********   X   04   

PR$_SISR       = 00000015            PTE$V_PFN      = 00000000            SWP$GB_ISWPRI    ********   X   04   

PR$_SLR        = 0000000D            PTE$V_PGFLVB   = 00000000            SWP$GL_BALBASE   ********   X   04   

PR$_SSP        = 00000002            PTE$V_PROT     = 0000001B            SWP$GL_BALSPT    ********   X   04   

PR$_TBIA       = 00000039            PTE$V_STX      = 00000000            SWP$GL_BSLOTSZ   ********   X   04   

PR$_TBIS       = 0000003A            PTE$V_TYP0     = 00000016            SWP$GL_HISWPCNT  ********   X   04   

PR$_TODR       = 0000001B            PTE$V_TYP1     = 0000001A            SWP$GL_HOSWPCNT  ********   X   04   

PR$_TXCS       = 00000022            PTE$V_VALID    = 0000001F            SWP$GL_INPCB     ********   X   04   

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  38

SYMBOL TABLE                                                                                                                     (1)



SWP$GL_ISPAGCNT  ********   X   04   

SWP$GL_ISWPCNT   ********   X   04   

SWP$GL_MAP       ********   X   04   

SWP$GL_OSWPCNT   ********   X   04   

SWP$GL_PHDBASVA  ********   X   04   

SWP$GL_SHELIO    ********   X   04   

SWP$GW_BALCNT    00000018 RG    03   

SWP$GW_IBALSETX  ********   X   04   

SWP$SHELINIT     ********   X   04   

SWPREAD          00000971 R     04   

SWPWRITE         00000977 R     04   

SYS$CREPRC       ********   X   04   

TMP...         = 00000001            

TT0DESC          00000017 R     04   

TT0LEN         = 00000004            

TT0NAM           00000013 R     04   

VA$M_BYTE      = 000001FF            

VA$M_P1        = 40000000            

VA$M_SYSTEM    = 80000000            

VA$M_VPG       = FFFFFE00            

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            

WSL$C_GBLWRT   = 00000006            

WSL$C_GLOBAL   = 00000004            

WSL$C_GPGTBL   = 0000000A            

WSL$C_LENGTH   = 00000004            

WSL$C_PPGTBL   = 00000008            

WSL$C_PROCESS  = 00000000            

WSL$C_SYSTEM   = 00000002            

WSL$M_GOODPAGE = 00000040            

WSL$M_MODIFY   = 00000100            

WSL$M_PAGTYP   = 0000000E            

WSL$M_PFNLOCK  = 00000010            

WSL$M_VALID    = 00000001            

WSL$M_WSLOCK   = 00000020            

WSL$S_PAGTYP   = 00000003            

WSL$V_GOODPAGE = 00000006            

WSL$V_MODIFY   = 00000008            

WSL$V_PAGTYP   = 00000001            

WSL$V_PFNLOCK  = 00000004            

WSL$V_VALID    = 00000000            

WSL$V_WSLOCK   = 00000005            

WSLERR           000004F9 R     04   

WSLOOP           0000064A R     04   

ZEROPG           000006F5 R     04   





PROGRAM SECTION SYNOPSIS



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

SWAPPER         WORKING SET SWAPPER                              21-AUG-1978 20:12:22   VAX-11 MACRO X0.3-11               Page  39

PROGRAM SECTION SYNOPSIS                                                                                                         (1)



. 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  

$$$220           0000001A      03     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT LONG  

$AEXENONPAGED    00000A10      04     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  





THERE WERE NO ERRORS OR WARNINGS.

10148. BYTES LEFT IN FREE MEMORY POOL.

38. BYTES OF RECLAIMED MEMORY.

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

19 MLB DIR RDS - 862 GETS TO DEFINE 32 MACROS. 74 INTER. FILE WRITES. 

