Educational Services

VMS Internals II: Memory Management, I/O, and Advanced Topics

Source Listings Book EY-9769E-DA-0002

October 1989

The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Corporation. Digital Equipment Corporation assumes no responsibility for any errors that may appear in this document.

The software described in this document is furnished under a license and may be used or copied only in accordance with the terms of such license.

No responsibility is assumed for the use or reliability of software on equipment that is not supplied by Digital Equipment Corporation or its affiliated companies.

Restricted Rights: Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013.

Copyright ©1989 by Digital Equipment Corporation

All Rights Reserved. Printed in U.S.A.

The following are trademarks of Digital Equipment Corporation:

DEC EduSystem UNIBUS DEC/CMS IAS VAX

DEC/MMS MASSBUS VAXcluster DECsystem-10 PDP VAX DOCUMENT DECSYSTEM- PDT VMS

20 RSTS VT

DECUS RSX

DECwriter TK5O dlifgliltial

DIBOL

CONTENTS

4 PAGEWAULT AG 3 0% ieseiin baka rented aed Avene Ra Rien 1 2 WRIMPYPAG IS = inc cicnncriasesanieadiwetarawbentcduxccaed sakcianwes 62 S SYSQIOREQ L1G 6 isis ddeaniive chic s doe dores poaneenwuseiiaceamatsdentawed 99 4 SYSIMGACT US 6956s bias hse Oi Sha Sach he eg FA dae Suk eawks 129 5 CHECK _VERSION.LIS .......... 00. ccc cece ccc ccc ccccecccevsesevecseees 204 6 PERMANENT_DEVICE_DATABASE.LIS ........... 0.00 cccccececeesceeeee 212 TALDATUIS ea ccchinecdile Uecend nulad thu tinerd oon gah was ann ae wise deacon eouaeates 234 8 MMDAT IS a26 shina sadeduciaawowsn at ciwesteleksnae recs iware tau 256 9 DOINTPINS cs 6s oe san tes cid ouan boda ae des eeb sia caeinduccarrssasdes 262 10 PTALLOC LIS oo) indica eskah AGU ee aNde able eia hol shears eiae sees 277 11 SMPROUTIIS o biqaenc.504 eta aeateear cece hsues oboe waeese coe 287 12: SPINLOCKS LIS cise. i does ea need anoles Rok vealed woud sates 328

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

1 PAGEFAULT.LIS

PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY-1989 16:31:05 VAX MACRO V5.0=-

8 Page 0

Table of contents

(1) (2) (3) (4) (5) (6) (7) * (8) (9) (10) (11) (12) (13) (14) (16) (18) (20) (22) (23) (25) (27) (28) (30)

36 195 280 297 352 417 547 622

1102

1270 - 1381

1538 1650 1701 1996 2081 2151 2251 2305 2385 2467 2539 2617

HISTORY ? DETAILED

DECLARATIONS

Initialization Routine

PAGE FAULT HANDLER

SYSTEM PAGE FAULT, ESTABLISH PAGE TYPE

EXECEPTION ENTRY POINT - PAGE TYPE DISPATCHER PAGE FILE, SECTION TABLE INDEX, OR GLOBAL PAGE PAGE NOT RESIDENT, QUEUE A READ REQUEST

FORM A CLUSTER OF PAGES TO READ

DEMAND ZERO PAGE

FREE, MODIFIED, OR BAD PAGE LIST, RELEASE PENDING SCANDEADPT - SCAN A DEAD PAGE TABLE FOR TRANSITION PAGES WSLEPFN - FETCH PFN FROM WORKING SET LIST ENTRY FREWSLE - FREE A WORKING SET LIST ENTRY

DELWSLEX - DELETE WORKING SET LIST ENTRY BY INDEX ININEWPFN - ALLOCATE AND INIT A NEW PFN

MAKEWSLE - MAKE A WORKING SET LIST ENTRY

LOCKPGTB - LOCK PAGE TABLE

INCPTREF - INCREMENT PAGE TABLE REFERENCE COUNT DECPTREF - DECREMENT PAGE TABLE REFERENCE COUNT DECPHDREF - DECREMENT PROCESS HEADER REFERENCE COUNT INIBLDPKT - INIT FOR CALLING BUILDPRT

MMGSSWITCH _PRCPGFL - Switch process pagefile

DIGITAL INTERNAL USE ONLY 1

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY-1989 16:31:05 VAX MACRO V5.0- 8 Page 1 : X-39 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 (1)

1 -TITLE PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLER 2 -IDENT ‘'X-39' 3; BRI III II III IIIT TTT I AI IIS ITI III IIA IASI INS SAS AAAI SAI AI AINA AN: 5 gk. * 6 ;* COPYRIGHT (c) 1978, 1980, 1982, 1984 BY * 7 ;* DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. * 8 ;* ALL RIGHTS RESERVED. * 9 ;* * 10 ;* THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED * 11 ;* ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE * 12 ;* INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER * 13 ;* COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY * 14 ;* OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY * 15 ;* TRANSFERRED. * 16 7* * 17 ;* THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE * 18 ;* AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT * 19 ;* CORPORATION. * 20 ;* * 21 ;* DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS * 22 ;* SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. * 23 2 24 ;* * 25 RRR RRRR ER RRA RRIE IRR IIKII KIKI IRIN III ISR IIIS IIIA SIR ISAIAH IIR IAI III HIN 26 27 ++ 28 ; FACILITY: EXECUTIVE, TRANSLATION NOT VALID EXCEPTION HANDLER 29 ; 30 ; ABSTRACT: 31 ; 32 ; ENVIRONMENT: 33 3 34 7-- 35.5 36 -SBTTL HISTORY ? DETAILED 37 3 38 ; AUTHOR: PETER H. LIPMAN » CREATION DATE: 14-SEP-76 39 ; 40 ; MODIFIED BY: 41; 42 ; X-39 SSA0013 Stan Amway 14-Sep-1988 43 ; Count system page fault I/Os. 44 ; 45 ; X-38 SSA0012 Stan Amway 1-Jul-1988 46 ; Remove debugging code. 47 ; 48 ; X~-37 SSA0011 Stan Amway 21-Jun-1988 49 ; Collect statistics for CRF page faults. 50 ; Sl ; X-36 SSA0010 Stan Amway 12-Apr-1988 52 ; In SCANDEADPT, call MMGSPURGEMPL to selectively 53 3 flush modified page list. 54 ; 55 ; In MMGSFREWSLE, always use current process PCB address 56 ; when checking for owned mutexes. On entry to the routine, 57 3 R4 may contain the system PCB address.

2 DIGITAL INTERNAL USE ONLY

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

‘PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY-1989 16:31:05 VAX MACRO V5.0-

8 Page 2

X-39 HISTORY ; DETAILED 29-SEP-1988 11:26:39 (SYS.SRC]PAGEFAULT.MAR;1 (1)

112 113 114

we Ve n jo Ne Ne Ne Ne Ne Ne Ne Se No Se Ne Se Se Ne Se Se Ne Se Se Se Se Ne Ne Se Se Ne Se Se Se Se Ne Se te Ne Ne Ne Ne Ne Se Se Ne Se Se Se Ne Se Ne Ne Se Se Se Se Se Ne Ne Me

X-35

X-34

X~-33

X-32

X-+31

X-30

X-29

X~-28

X-27 X-26

X-24

X-23

wMcO0035 Wayne Cardoza 22-Feb-1988 Use longword instructions to modify invalid global slave PTEs. INSV lets CI see bad PTEs.

SSA0009 Stan Amway 1-Feb-1988 Re-instate full MPL flush removed in X-30, but still place process in MPBUSY (rather than MPLEMPTY) state.

SUF Stu Farnham 21-Jan-1988 Close window in which a modify bit set by a write by one CPU can be lost if another CPU is concurrently replacing the same page.

Also:

SSA0008 Stan Amway 18-Jan-1988 Prevent processes from being placed into a permanent PFW wait state due to an intrinsic timing window.

SSA0007 Stan Amway 17-Nov-1987 Use page count specified by MMGS$GL_RSRVPAGCNT when reserving process page file pages in MMGSSWITCH_PRCPGFL.

SSA0006 Stan Amway 6-Oct-1987 Check for installed page file(s) before placing process in MPWBUSY wait state.

SSA0005 Stan Amway 8-Sep-1987 In SCANDEADPT, move pages on modified list to the beginning of the list, flush at most 128 pages, and Place process in MPWBUSY state instead of MPLEMPTY. These changes are meant to avoid (and in practice, eliminate) possible deadlocks.

Check for process holding mutex in MMGSFREWSLE.

SSA0004 Stan Amway 14-Aug-1987

Swap file allocation changes.

Remove DEAD code in demand~zero page fault path.

SUF Stu Farnham 13-Aug-1987 Fix DZRO faults. SF Steve Fiorelli

Fix errors in X-27

SF00027 Stephen Fiorelli 4-Aug~1987 Large working set support.

SUF Stu Farnham 21-July-1987 Make TBIS comply with SRM rev H.

RNG5024 Rod Gamache 13-Mar-1987 Put back synchronization changed in last edit. Add 1 more performance optimization.

RNG5023 Rod Gamache 12-Mar-1987 Add some performance optimizations.

DIGITAL INTERNAL USE ONLY 3

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY-1989 16:31:05 VAX MACRO V5.0-

8 Page 3

X-39 HISTORY ; DETAILED 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 (1)

115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134

135.

136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171

me Ne Ne Ne Me Ne Ne Ne Ne Ne Me Ye Ve Te Ne Ye Te Te Te Ne Ne Ne Se Ne Ye Ye Se Ne Ne “Ye Ne Se me Ye te Ne Se Ne Me Se Ne Se Se Ne Ye Seo Ne Te Neo Ne Ne Ye Ye “Ne No Ne Ne

X-22 X-21

X-20

X-19 -18

X-17

X-16

X-15

X-14

X-13

X-12

X-11

SFO4001 Stephen Fiorelli 09-Mar-1987 Access syspcb through pointer. Use standard name for system_primitives data.

WCTO0032 Ward C. Travis 27-Feb-1987 Update remaining old lookaside listhead references to reflect that they are now interlocked queues.

SSA0003 Stan Amway 23-Feb-1987 Correctly assign backing store in clustering loop. Correctly return process page file backing store in logic that handles concurrent zeroing of a global, demand zero page.

SSA0002 Stan Amway 11-Nov-1986 Add support for multiple pagefiles per process.

RNGOO17 Rod N. Gamache 28-Oct-1986 Fix branch errors.

RNGOO16 Rod N. Gamache 29-Sep-1986 Release the MMG spinlock before calling EXESBUILDPRTR. The WCB is protected separately by a lock of FILSYS in IOCS$MAPVBLK.

SSA0001 Stan Amway 12-Sep-1986 In MMGSFREWSLE, when checking the modified page list count, use an adaptive threshold based on whether

the modified page writer is active. If not active, use MPWSGL_WAITLIM, else use MPWSGL_LOWAITLIM. Since the page write I/O completion routine uses the latter value to determine when to reawaken proceses in the MPWBUSY wait state, this change prevents processes from becoming permanently stuck in the wait state due to continual modified page generation.

MSH0276 Michael S. Harvey 15-Aug-1986 ‘Don’t try to release MMG more than once on a pagefault exit path.

MSH0274 Michael S. Harvey 10-Aug-1986

Hold MMG across call to EXES$BUILDPKTR to ensure, for now anyway, that the WCB remains protected. This necessitates moving the MMG spinlock down in rank to be less than IOLOCK8 which the routine being called will attempt to acquire.

WMC0006 Wayne Cardoza 28-Jul-1986 Get rid of re-executeable switch.

RNGOO11 Rod Gamache 25-Jul-1986 Change most of the synchronization around - release

MMG spinlock as early as possible, acquire SCHED as late as possible and don’t hold onto MMG while doing I/O thru EXESBUILDPKTR.

4 DIGITAL INTERNAL USE ONLY

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY-1989 16:31:05 VAX MACRO V5.0-

8 Page 4

X-39 HISTORY

172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193

me Ye Ve Ye Be Ve Ye Veo Ve Te Ye Ve Ye Ve Ve Ve Ve Ye Ye Yo Wo Vo

# DETAILED 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 (1)

X-10

x-9

X-1D2

vo4-001

WMcO0005 Wayne Cardoza 21-Jul-1986 Change many JSBs to BSBWs.

SUF Stu Farnham 7-Jul-1986 Manually merge X-4 and X-2H3 to form new mainline.

SUF Stu Farnham 5-Jul-1986 Fix more merge errors. ***WARNING*** The merge SERIOUSLY SCARMBELD this file.

wMco004 Wayne Cardoza 18-Jun-1986 Initialization routine should return status.

WMCO0003 Wayne Cardoza 20-May-1986 Fix initialization macro.

WMC0001 Wayne Cardoza 21-Jan-1986 Add initialization routine for SCB.

TCMO0002 Trudy C. Matthews 29-Mar-1985 Move global data cells in psect $$$210 to SYSDATA.MAR

DIGITAL INTERNAL USE ONLY 5

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

‘PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY-1989 16:31:05 VAX MACRO V5.0-

8 Page 5

X-39 DECLARATIONS 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 (2)

195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236

237 238 239 240 241 242 243 244 245 246 247

-e Ne Ye

we Ne Ye se Ye YW

we Ne Ye

FLTCTL: FLIVA: FLTPC: FLTPSL:

se Ne Ve

-SBTTL DECLARATIONS

INCLUDE FILES:

SCADEF SCPUDEF SIPLDEF SIRPDEF SMPWDEF SPCBDEF SPHDDEF SPRDEF SPFLDEF SPFNDEF SPRTDEF $PSLDEF SP TEDEF SRSNDEF S$SECDEF SSSDEF $$SYSTEM_PRIM_DATADEF SVADEF SWOHDEF SWSLDEF

EXTERNAL SYMBOLS:

MACROS :

EQUATED SYMBOLS:

SOFFSET <4*6>, POSITIVE, <- FLTCTL, -

FLTVA, -

FLTPC, -

FLTPSL-

>

SVIELD PGF, 0,<- LENVIO, - PGTBFLT, - WRTACC-

>

$OFFSET 0, POSITIVE, <- PTEDAT, -

6 DIGITAL INTERNAL USE ONLY

; CONDITIONAL ASSEMBLY DEFINITIONS ;DEFINE PER-CPU DATA BLOCK OFFSETS #PROCESSOR PRIORITY LEVEL DEFINITIONS 31/0 REQUEST PACKET DEFINITIONS

3; Define MPW structures and constants 7;PROCESS CONTROL BLOCK DEFINITIONS ;PROCESS HEADER DEFINTIONS

7; PROCESSOR REGISTER DEFINITIONS

7;PAGE FILE CONTROL BLOCK DEFINITIONS 3;PFN DATA BASE DEFINITIONS ;PROTECTION FIELD DEFINITIONS

7 PROCESSOR STATUS LONG WORD DEFINITIONS 7;PAGE TABLE ENTRY OFFSETS

? RESOURCE. NAME. DEFINITIONS.

7;SECTION TABLE DEFINITIONS

?;SYSTEM STATUS DEFINITIONS

7 SYSTEM PRIMITIVES LOCAL DATA

; VIRTUAL ADDRESS VIELDS

;WAIT QUEUE HEADER DEFINITIONS

; WORKING SET LIST DEFINITIONS

;OFFSET TO FAULT CONTROL BITS 7;OFFSET TO FAULT VIRTUAL ADDRESS 7;OFFSET TO FAULT PC

;OFFSET TO FAULT PSL

#DEFINE PAGE FAULT CONTROL BITS #LENGTH VIOLATION 7;PAGE TABLE FAULT 7 REFERENCE WAS WRITE OR MODIFY

OFFSETS INTO I/O PACKET WHILE BEING USED AS SCRATCH STORAGE FOR CLUSTERING

7MASTER PTE CONTENTS

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

PAGEFAULT ~ TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY~-1989 16:31:05 VAX MACRO V5.0-

8 Page 6

X=-39 DECLARATIONS 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 (2)

248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269

270 271 272 273 274 275 276 277 278

SVAPTE, - SIZE_TYPE, ~- VA,- AST,- ASTPRM, - GPTX, - GPTX_PTE, - <CLUSTER, 1>,- <COUNT, 1>,- <STATE,1>,- <PRI,1>,- BAK, - INC1,- INC4,- INC512,- VBN,- WINDOW, - FP_SAV,- <PCB_SAV, 8>,- PHVREFCADR, - <CLU_SCRATCH_SIZ, 0>- >

PTEDAT:

SVAPTE:

SIZE_ TYPE:

VA:

AST:

ASTPRM:

GPTX :

GPTX_PTE:

CLUSTER:

COUNT:

STATE:

PRI:

BAK:

INC1:

INC4:

INC512:

VBN:

WINDOW:

FP_SAV:

PCB_ SAV:

PHVREFCADR:

CLU_SCRATCH_SIZ:

ASSUME ASSUME ASSUME ASSUME ASSUME

AST EQ IRPSL AST

PRI EQ IRP$B_PRI

we Ne Ve

OWN STORAGE:

ASTPRM EQ IRP$L_ASTPRM

?7MASTER PTE ADDRESS .

;RESERVED FOR SIZE AND TYPE ;VIRTUAL ADDRESS

7;AST INFO

7 AND PARAMETER

7PROCESS PTE CONTENT FOR GLOBAL PAGE 7PROCESS PTE ADR FOR GLOBAL PAGE 7DESIRED CLUSTER SIZE

7; CURRENT COUNT OF PAGES

7SAVED PFN_STATE BYTE

;PRIORITY OF I/O TRANSFER

7PFN BACKING STORE ADDRESS

37+ OR - 1 7+ OR - 4 37+ OR - 512

7 VIRTUAL BLOCK NUMBER

#WINDOW CONTROL BLOCK ADR

7; SAVED FP

7SAVED PCB, PHD ADDRESS

7;PROCESS HEADER REFERENCE COUNT ADDRESS 7SIZE OF THIS SCRATCH AREA

CLU_SCRATCH SIZ LE IRP$C_LENGTH SIZE_TYPE £Q IRP$W_SIZE

DIGITAL INTERNAL USE ONLY 7

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

PAGEFAULT ~- TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY-1989 16:31:05 VAX MACRO V5.0- 8 Page 7 ie -_ X-39 Initialization Routine 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 (3)

280 -SBTTL Initialization Routine

281 ; :

282 ; Initialize the SCB with the pagefault handler address.

283 ; .

284 ;

285 DECLARE _PSECT EXECSINIT_CODE

286

287 INITIALIZATION ROUTINE ~-

288 PAGEFAULT_INIT

289

290 PAGEFAULT_INIT: .

291 - MOVL = G*EXE$GL_SCB, RO 7 SCB address 292 MOVAB W*MMGSPAGEFAULT, “X24 (RO) 7 Fill in TNV vector 293 MOVL #SS$_NORMAL, RO

294 RSB

295

8 DIGITAL INTERNAL USE ONLY

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY-1989 16:31:05 VAX MACRO VS5.0-

8 Page 8

X-39 PAGE FAULT HANDLER 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 (4)

297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350

-SBTTL PAGE FAULT HANDLER

r++ FUNCTIONAL DESCRIPTION:

THIS MODULE CONTAINS THE PAGEFAULT HANDLER. IT IS ENTERED VIA A TRANSLATION-NOT-VALID FAULT. AT THE TIME OF A FAULT, THE KERNEL STACK CONTAINS THE FOLLOWING INFORMATION:

$o---------- wane nn nn nn-- o---- <4

! REASON MASK ! --> BIT 0 - ALWAYS 0 FOR

fren ene - == -- == === ---- = - + TRANS-NOT-VALID FAULTS

! INVALID VIRTUAL ADDRESS ! BIT 1 - 0 INDIC VIRT ADR NOT VALID fren nnn nn === ------------ === + 1 INDIC ASSOC PTE NOT VALID ! PC OF FAULTING INSTRUCTION ! BIT 2 - 0 INDIC READ ACCESS

fon nn == -- -- = + ------ -- += -- + 1 INDIC MODIFY/WRITE ACCESS ! PSL OF FAULTING INSTRUCTION !

ponnn------------------------- +

CALLING SEQUENCE: NONE

INPUT PARAMETERS: NONE

IMPLICIT INPUTS: NONE

OUTPUT PARAMETERS _ NONE

IMPLICIT OUTPUTS: NONE

COMPLETION CODES: NONE

SIDE EFFECTS: NONE

™e Ne Ye Se Ve Ve Ye Ne Ye Be Yeo Be Ye Be Ne Ne Ve Ve Ve Ye Be Yo Ve We Be Ye Ye Ne We We Ye Ye Ve We Ye Bo Ne Ye oe

PESESEELSELESSSE SESE SRS ERE RE SESS SSR ERE SES ESSE E SESE SERS ESE SESE SES ESSE ESE SS

KkkKKKKKKKKKKKKK THIS ENTIRE MODULE MUST BE RESIDENT *®282eeeReRKRA EEK

me Ye Se Ye Oe

DECLARE_PSECT EXECSNONPAGED CODE

KHAKI KKK IK KIRK H KEK IK KIRKE KEKERKEKEKHKKEKKKEKEKRKEKEKEKKEEKEKKKEKKKKKK

we Ne Ne

-LIST MEB

DIGITAL INTERNAL USE ONLY 9-

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY-1989 16:31:05 VAX MACRO V5.0-

8 Page 9

X-39 SYSTEM PAGE FAULT, ESTABLISH PAGE TYPE 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1

352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408

-SBTTL SYSTEM PAGE FAULT, ESTABLISH PAGE TYPE -ENABL LSB 7 # BAD SYSTEM PAGE - PROCESS HEADER OR PAGE TABLE PAGE FOR ANOTHER PROCESS 3; IF THE PROCESS HEADER HAS JUST BEEN INSWAPPED (PHD$V_NOACCVIO IS SET), + SIMPLY DISMISS THE FAULT. IN ALL OTHER CASES, REPORT AN ACCESS VIOLATION 3 EXCEPTION. ; ; IF THE PROCESS WAS OUTSWAPPED WHILE ACCESSING ITS OWN HEADER, ; DISMISSING THE EXCEPTION WILL CAUSE THE REFERENCE TO OCCUR AGAIN, ; BUT THIS TIME TO THE CORRECT BALANCE SLOT. ; IF THE PROCESS WAS MAKING AN ILLEGAL REFERENCE TO THE HEADER OF ANOTHER ; PROCESS, DISMISSING THE EXCEPTION WILL CAUSE THE SAME ILLEGAL REFERENCE ; TO OCCUR AGAIN, BUT NOW WITH PHDS$V_ACCVIO CLEAR, CAUSING AN ACCESS ; VIOLATION TO BE REPORTED. BADSYSPAG: BBSC #PHD$V_NOACCVIO, PHDSW_FLAGS (R5),10$ ;BRANCH IF HEADER JUST INSWAPPED BRW ACVIOLAT 7FAKE AN ACCESS VIOLATION 10$: BRW PGFCOMPLETE SIMPLY DISMISS THE PAGE FAULT ; SEE IF PAGE IS A GLOBAL PAGE TABLE PAGE, OTHERWISE ERROR GPGTBL: CMPW RO, G*SGNSGL_BALSETCT 7SYSTEM BALANCE SET SLOT? BLSS BADSYSPAG #BRANCH IF NOT CMPL R2,G*MMGSGL_MAXGPTE 7;LEGAL GPTE ADDRESS BGEQU BADSYSPAG MOVB #WSLS$C_GPGTBL, R2 7PAGE IS GLOBAL PAGE TABLE BRB 50$ 7 PAGE IS NOT SYSTEM PAGE TYPE, COULD BE GLOBAL PAGE TABLE, PROCESS PAGE TABLE 7 OR PROCESS HEADER PAGE NOTSYSTEM: ASHL #-9,R0,RO ;SCALE VA DIFFERENCE TO PAGE NUMBER MOVL PCBSL_PHD (R4) ,R5 7ADDRESS OF PROCESS HEADER DIVL G*SWPSGL_BSLOTSZ, RO 7;PROCESS HEADER INDEX CMPW RO, PHDSW_PHVINDEX (R5) 7THIS PROCESS’ HEADER? BNEQ GPGTBL 7BRANCH IF NOT, MAYBE GLOBAL PAGE TABLE MOVB #WSLSC_PPGTBL, R2 7; ASSUME PROCESS PAGE TABLE BRB 70$ 7 PAGE FAULT FOR SYSTEM SPACE VIRTUAL ADDRESS ; R2 = FAULT VA, LOW BITS CLEARED ; R4 = PROCESS PCB ADDRESS SYSTEMSPACE: EXTZV #VASV_VPN, #VASS_VPN,R2,R3 ;PAGE NOMBER IN SYSTEM SPACE SUBL3 G*SWPSGL_BALBASE,R2,RO ;ABOVE BASE OF BALANCE SET SLOTS? BGEQ NOTSYSTEM 7BRANCH IF NOT SYSTEM PAGE TYPE

40S: MOVB #WSLSC_SYSTEM, R2 7SYSTEM PAGE

10 DIGITAL INTERNAL USE ONLY

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

' PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY~-1989 16:31:05 VAX MACRO V5.0-

8 Page 10 X-39 SYSTEM PAGE FAULT, ESTABLISH PAGE TYPE 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 409 50S: MOVL G“MMGSAR_SYSPCB, R4 ;ADDRESS OF SYSTEM PCB 410 MOVL PCBSL_PHD (R4) ,R5 ;ADDRESS OF SYSTEM PROCESS HEADER 411 70S: MOVAL @W“MMGSGL_SPTBASE[R3],R3 ;ADDRESS OF PAGE TABLE ENTRY 412 BRB GETPAGELOC 413 414 -DSABL LSB 415

DIGITAL INTERNAL USE ONLY 11

CONFIDENTIAL AND PROPRIETARY | DIGITAL EQUIPMENT CORPORATION

PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY-1989 16:31:05 VAX MACRO V5.0-

8 Page 11 X-39 EXECEPTION ENTRY POINT - PAGE TYPE DISPA 29-SEP-1988 11:26:39 [SYS.SRC])PAGEFAULT.MAR;1 417 -SBTTL EXECEPTION ENTRY POINT - PAGE TYPE DISPATCHER 4is = 419 ; ~ a 420 ; PAGE FAULT MONITORING ENABLED FOR THIS PROCESS... 421 ; : 422 PGFMONITOR: 423 JSB G“*PFMSMON 7;CALL THE RECORDING ROUTINE 424 BRB PGFMONITOR1 7RETURN IN LINE 425 426 IPLHI: BUG CHECK PGFIPLHI, FATAL 7;IPL TOO HIGH FOR PAGE FAULT » WORD “XFEFF -IIF IDN <FATAL>,<FATAL> , .WORD BUGS PGFIPLHI! 4 427 428 ; 429 ; THIS IS A PROCESS PAGE TABLE FAULT 430 ; 431 PPGTBL: 432 BICL3 #VASM_BYTE, R3, R2 7R2 = FAULT VA 433 BRB SYSTEMSPACE 434 435 -ALIGN LONG 436. UNIVERSAL_SYMBOL MMGSPAGEFAULT

MMGSPAGEFAULT: : 437 ;MMGSPAGEFAULT: :

438 PUSHL R5 7 SAVE R5

439 PUSHL R4 ?7SAVE R4

440 CMPZV #PSLSV_IPL, #PSL$S_IPL, <12+8>(SP),#IPL$_ASTDEL ;CHECK FAULT IPL 441 BGTR IPLHI #BRANCH IF IPL IS TOO HIGH

442 PUSHL R3 7SAVE R3

443 PUSHL R2 7SAVE R2

444 PUSHL Ril ?SAVE R1

445 PUSHL RO 7 SAVE RO

446 LOCK LOCKNAME=MMG, - 7LOCK MMG DATABASE

447 PRESERVE=NO 7DON’T PRESERVE RO

-SAVE LOCAL BLOCK -PSECT $ABS$, ABS

-=0

. RESTORE

-SAVE LOCAL BLOCK -PSECT $ABS$, ABS

-=0

. RESTORE

BLBC §G“SMPSGL_FLAGS, 30002$ MOVZBL S*#SPL$C_MMG, RO JSB G*SMPSACQUIRE

BRB 30003$ 30002$: MTPR S*#IPLS$_MMG,S*#PR$_IPL

30003$: 448 MOVL § G*CTLSGL_PCB, R4 ;R4 = ADDRESS OF PCB 449 BICL3 #VASM_BYTE,FLTVA(SP),R2 ;R2 = VA OF FAULT (LOW BITS CLEAR) 450 BLSS § SYSTEMSPACE ;BRANCH IF SYSTEM SPACE ADDRESS 451 MOVL § PCBSL_PHD(R4) ,R5 7R5 = ADDRESS OF HEADER 452 ASSUME PHD$V_PFMFLG EQ 0 453 BLBS § PHD$W_FLAGS(R5),PGFMONITOR ;BRANCH IF PAGE FAULT MONITORING 454 PGFMONITOR1: 455 EXTZV #VASV_VPN, #VA$S_VPN,R2,R3 ;VIRTUAL PAGE IN PO OR P1 SPACE

12 DIGITAL INTERNAL USE ONLY

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY~-1989 16:31:05 VAX MACRO V5.0- 8 Page 12

X-39 EXECEPTION ENTRY POINT - PAGE TYPE DISPA 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1

456 BBC #VASV_P1,R2,POADDR BRANCH IF PO SPACE

457 MOVAL @PHDSL_P1BR(R5)[R3],R3 ;GET SYS VIRT ADR OF PTE FOR P1 SPACE 458 BRB GETPAGELOC

459

460 VALID: BRW PGFCOMPLETE ;IF VALID, JUST EXIT

461

462 DZRO_PTE 0:

463 BRW DZRO_PTE

464

465 RSRCWAIT_3:

466 ADDL #3%*4,SP ;CLEAN OFF 3 LONG WORDS

467 BRW RESOURCEWAIT 7;AND GO WAIT FOR A RESOURCE

468

469 POADDR: MOVAL @PHDSL_POBR(R5) [R3],R3 GET SYS VIRT ADR OF PTE FOR PO SPACE 470 ;:

471 ; R2 = VA (LOW BITS = PAGTYP)

472 ; R3 = SVAPTE

473

474 GETPAGELOC:

475 EXTZV #VASV_VPN, #VASS_VPN, R3, RO 7; INDEX TO SPT ENTRY

476 MOVAL Q@W“MMGSGL_SPTBASE[RO],R1 ;ADDRESS OF SPTE FOR PAGE TABLE 477 TSTL (R1) | 7IS SPTE VALID?

478 BGEQ PPGTBL ;BRANCH IF NOT, FAULT IT

479 BICL3 #°C<PTESM_VALID -;CHECK VALID BIT

480 ! PTESM TYP1 ! PTESM_TYPO -;GET PTE TYPE BITS

481 ! PTESM_BAKX>, (R3), RO zAND PFN or PGFLVBN/PRCPGFLX BITS TO RO 482 BLSS VALID BRANCH IF VALID

483 ;

484 ; RO = TYP1 ! TYPO ! BAKX, VALID IS KNOWN TO BE OFF AT THIS POINT

485 ; R1 = SPT ENTRY ADDRESS FOR PAGE TABLE PAGE

486 ; R2 = VA (LOW BITS = PAGTYP)

487 ; R3 = SVAPTE

488 ; R4 = PCB ADDRESS

489 ; R5 = PHD ADDRESS.

490 ;

491 INCL G*PMSS$GL_FAULTS ;COUNT ALL THE PAGE FAULTS

492 INCL PHDSL PAGEFLTS (R5) ; COUNT PROCESS’ PAGE FAULTS

493 PUSHL R3 ~ 7; SAVE NEEDED VOLATILE REGISTERS 494 PUSHL R2 ;

495 PUSHL R1

496 BSBW MMGSFREWSLE ;FREE A WORKING SET LIST ENTRY 497 BLBC RO, RSRCWAIT_3 ;BRANCH IF HAVE TO WAIT

498 MOVL 8(SP),R3 7; SVAPTE

499 ;

500 ; MUST RECHECK VALIDITY OF PAGE TABLE PAGE, SINCE FREWSLE MIGHT HAVE DISCARDED IT 501 ;

502 TSTL @ (SP) + 7IS PAGE TABLE PAGE VALID?

503 BGEQ PPGTBL 2 7NO, GO FAULT THE PAGE TABLE

504 ;

505 ; ***** ALI, POINTS DISPATCHED TO FROM HERE MUST REMEMBER THAT

506 ; ****k** O(SP) = VA (LOW BITS = PAGTYP), 4(SP) = SVAPTE

507 ;

508 ;

509 ; MUST FETCH PAGE TABLE ENTRY CONTENTS AGAIN SINCE DEAD PAGE TABLE SCAN 510 ; IN FREWSLE MIGHT HAVE DISCARDED THE PAGE. NOTE THAT VALID IS KNOWN 0. 511 ;

512 BICL3 #°C<PTESM VALID ! - ;FETCH VALID BIT

DIGITAL INTERNAL USE ONLY 13

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY-1989 16:31:05 VAX MACRO V5.0-

8 Page 13 : X-39 EXECEPTION ENTRY POINT - PAGE TYPE DISPA 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1

513 PTESM_TYP1 ! PTESM_TYPO !- ;PTE TYPE BITS 514 PTESM BAKX>, (R3), RO yAND PGFLVBN/PRCPGFLX, GPTX, SECX, PFN 515 BEQL DZRO_PTE 0 ;BRANCH IF PAGE IS DEMAND ZERO 516 ; 517 ; FORM R1 = 4 BIT SIGN EXTENDED VIELD LOW BIT = TYPO, SIGN = TYP1 518 ; 519 EXTV #PTESV_TYPO, #<PTES$V_TYP1+1-PTE$V_TYPO>, RO,R1 520 BNEQ NOTRANSITION ;BRANCH IF NOT TRANSITION PAGE 521 ; 522 ; THIS IS A PAGE IN TRANSITION 523 ; RO = PFN, R2 = VA (LOW BITS = PAGTYP), R3 = SVAPTE 524 ; 525 TRANSITION: ; §26 | EXTZV #PFNSV_LOC, #PFNS$S_LOC, @W*PFNSAB_STATE[RO],R2 ;PAGE LOCATION 527 528 IF GT, CA$_MEASURE 529 INCL G*PMSSAL_TRANSFLT [R2] ;COUNT VARIOUS TRANSITION FAULTS 530 -ENDC 531 532 CASE R2,<- 533 PFNLIST, - - 3ON THE FREE PAGE LIST 534 PFNLIST, - 7ON THE MODIFIED PAGE LIST 535 PFNLIST, - 7ON THE BAD PAGE LIST 536 RELEASEPEND, - ;RELEASE PENDING 537 READERR, - ;PAGE READ ERROR 538 WRITEINPROG, - 7;PAGE WRITE IN PROGRESS 539 READINPROG- ;PAGE READ IN PROGRESS 540 >

CASEW —R2, #0, S*#<<30007$-30006$>/2>-1

30006$:

- SIGNED_WORD PFNLIST-30006$

. SIGNED WORD PFNLIST-30006$

-SIGNED_WORD PFNLIST~30006$

-SIGNED_WORD RELEASEPEND-30006$

- SIGNED WORD READERR-30006$

-SIGNED_WORD WRITEINPROG-30006$

- SIGNED _WORD READ INPROG~30006$

30007$: 541 LOCBAD: BUG CHECK PGFLOCBAD, FATAL :BAD PAGE LOCATION FIELD -WORD “XFEFF -IIF IDN <FATAL>,<FATAL> , .WORD BUG$_PGFLOCBAD ! 4

542 543 PPGTBL 2: 544 ADDL #2*4,SP 7CLEAN OFF 2 LONG WORDS 545 BRW PPGTBL ;FAULT A PROCESS PAGE TABLE

14 DIGITAL INTERNAL USE ONLY

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

PAGEFAULT ~- TRANSLATION NOT VALID EXCEPTION HANDLE 10~MAY~-1989 16:31:05 VAX MACRO V5.0-

8 Page 14 ‘X-39 PAGE FILE, SECTION TABLE INDEX, OR GLOBA 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 547 -SBTTL PAGE FILE, SECTION TABLE INDEX, OR GLOBAL PAGE 548 ; : 549 ; GLOBAL PAGE, MASTER PTE VALID. 550 ; RO = MASTER PTE CONTENTS (VALID, MODIFY AND PFN BITS) 551 ; O(SP) = PROCESS VA (LOW BITS = PAGTYP), 4(SP) = SLAVE PTE ADDRESS 552 ; 553 GBLVALID: 554 INCL G*PMS$GL_GVALID 7;UPDATE GLOBAL VALID COUNTER 555 ‘MOVO (SP), R2 7R2=VA (LOW BITS = PAGTYP), R3=SVAPTE 556 PUSHL RO *SAVE MASTER PTE 557 ASSUME PTESV PFN EQ 0 558 BICL #°C<PTESM_PFN>, RO 7;GET PAGE FRAME NUMBER 559 BSBW MMGSMAKEWSLE 7;MAKE A WORKING SET LIST ENTRY 560 POPL R1 7;R1=MASTER PTE 561 MOVOQ (SP)+,R2 ;R2=VA, R3=SVAPTE 562 BRW SETSLAVEPTE 7SET PROCESS’ PTE AND EXIT 563 ; : 564 ; DEMAND ZERO GLOBAL SECTION WITH PAGE FILE BACKING STORE 565 ; , 566 GBLDZRO_ PGFL: 567 MOVL #PTESM_TYPO, RO 7ADD A TYPO BIT TO THE MASTER PTE (0) 568 BRB GBLDZRO 7;GO JOIN COMMON CODE 569 ; 570 ; PAGE IS NOT A TRANSITION OR DEMAND ZERO PAGE 571 ; RO = LOW 23 BITS OF PTE AND TYPE BITS (PAGE FILE VBN, GPTX OR STX) 572 ; R1 = RESULT OF EXTV ABOVE, CONDITION CODES SET FROM EXTV 573 ; O0(SP) = VA (LOW BITS = PAGTYP), 4(SP) = SVAPTE 574 ; 575 NOTRANSITION: 576 BLSS NOTGLOBAL ?;BRANCH IF TYP1 SET, NOT A GLOBAL PAGE 577 . BICL #PTESM_TYPO,RO 7;LEAVE JUST GLOBAL PAGE TABLE INDEX 578 MOVAL @W*MMGSGL_GPTBASE[RO],R3 ;ADDRESS OF MASTER PTE 579 ROTL #<32-<PTESV_OWN-WSLSV_PAGTYP>>, (R3),R1 ;OWNER FIELD TO LOW BITS 580 ; 581 ; MASTER PTE OWNER FIELD CONTAINS THE VALUE PFN$C_GLOBAL OR PFN$C_GBLWRT 582 ; 583 BICB3 #°C<WSLSM PAGTYP>, R1, (SP) ;SET PAGE TYPE FIELD 584 BICL3 #°C<PTESM VALID ! - ;GET THE VALID BIT 585 PTESM TYP1 ! PTESM TYPO ! - ;THE PTE TYPE BITS 586 PTESM BAKX>, (R3),RO ;AND PGFLVBN/PRCPGFLX, OR STX 587 BLSS GBLVALID ;BRANCH IF MASTER PTE IS VALID 588 BEQL GBLDZRO_PGFL ;MASTER PTE IS DEMAND ZERO 589 EXTV #PTESV_ TYPO, #<PTESV_TYP1+1-PTESV_TYPO>, RO,R1 590 ; 591 ; R1 = O IF TYP1 AND TYPO ARE BOTH ZERO 592 ; R1 = NEGATIVE IF TYP1 IS SET 593 ; R1<O> = 1 IF TYPO IS SET 594 ; 595 BGTR GBLBAD ;BRANCH IF GLOBAL AGAIN, ERROR 596 BEQL TRANSITION BRANCH IF GLOBAL TRANSITION 597 333 BLSS 20$ 7BRANCH IF SECTION OR PAGE FILE ADDRESS 598 ; 599 ; MASTER PAGE TABLE ENTRY IS A SECTION OR PAGE FILE ADDRESS 600 ; 601 20S: BLBC R1,30$ ;BRANCH IF PAGE FILE 602 BBS #PTESV_DZRO,RO,GBLDZRO ;BRANCH IF DEMAND ZERO GLOBAL SECTION 603 BBS #PTESV_CRF, RO, GBLCRF ;BRANCH IF COPY ON REFERENCE

DIGITAL INTERNAL USE ONLY 15

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION |

PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY-1989 16:31:05 VAX MACRO V5.0- 8 Page 15 X-39 PAGE FILE, SECTION TABLE INDEX, OR GLOBA 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR; 1

604 ; 605 ; GLOBAL SECTION (NOT CRF OR DZRO) OR PAGE FILE BACKING STORE ADR 606 ; 607 308: MOVL 4(SP),RO ; SAVE SLAVE PTE ADR INDICATING GLOBAL 608 BRB GBLNOTRESIDENT © ; 609 ; 610 ; BAD MASTER PAGE TABLE ENTRY FORMAT FOR A GLOBAL PAGE 611 ; 612 GBLBAD: BUG CHECK PGFGBLBAD, FATAL ;BAD MASTER PTE FORMAT FOR GLOBAL PAGE «WORD “XFEFF -IIF IDN <FATAL>,<FATAL> , .WORD BUGS PGFGBLBAD! 4 613 ; 614 ; 615 ; GLOBAL COPY ON REFERENCE PAGE 616 ; 617 GBLCRF: 618 CLRB. (SP) 3SAY PAGE IS PROCESS: PAGE: 619 MOVIL. R3, RO 7; MASTER: PTE: ADDRESS. 620 BRB GBLNOTRESIDENT ;

16 DIGITAL INTERNAL USE ONLY

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY~1989 16:31:05 VAX MACRO V5.0- 8 Page 16

X-39 PAGE NOT RESIDENT, QUEUE A READ REQUEST 29-SEP-1988 11:26:39 [SYS. creer MAR;1 (

622 -SBTTL PAGE NOT RESIDENT, QUEUE A READ REQUEST

623 eENABL LSB

624

625 ;

626 ; MUST WAIT FOR AN I/O REQUEST PACKET

627 ;

628 IRPWAIT_ 3:

629 POPL R1 7;CLEAN OFF 1 LONG WORD

630 MOVZBL #RSN$_NPDYNMEM, R1 7NON PAGED DYNAMIC MEMORY RESOURCE NUMBER 631 10S: ADDL #2*4, SP ;CLEAN OFF 2 LONG WORDS

632 BRW RESOURCEWAIT ;WAIT FOR RESOURCE IN R1

633 ;

634 ; THIS PAGE READ WOULD EXCEED THIS PROCESS’ DIRECT I/O QUOTA.

635 ; WAIT UNTIL SOME OF HIS OUTSTANDING I/O COMPLETES.

636 ;

637 DIOCNTWAIT 2:

638 MOVZBL #RSNS_ASTWAIT, R1 ' gAST WAIT RESOURCE NUMBER

639: BRB: 10$

640

641 -DSABL LSB

642

643 ;

644 ; DEMAND ZERO GLOBAL SECTION PAGE

645 ;

646 GBLDZRO:

647 MOVL (R3),R1 MASTER PTE CONTENTS

648 BRW DZRO_GBL_SEC

649 ;

650 ; DEMAND ZERO PROCESS SECTION PAGE

651 ;

652 DZRO_PROC_SEC:

653 BRW DZRO_ PTE

654 3;

655 ; PAGE IS NOT A GLOBAL PAGE

656 ; R1<31>=TYP1, R1<0>=TYPO, RO = TYP1 ! TYPO ! BAKX

657 3;

658 NOTGLOBAL:

659 BLBC R1,10$ BRANCH IF NOT SECTION PAGE

660 BBS #PTESV_| DZRO, RO, DZRO_PROC_ SEC ;BRANCH IF DEMAND ZERO PROCESS SECTION 661 10S: CLRL RO } INDICATE NO SLAVE PAGE TABLE ENTRY 662 ;

663 ; O(SP) = VA (LOW BITS = PAGTYP), 4(SP) = SVAPTE (SLAVE IF GLOBAL)

664 3; RO = MASTER PTE ADDRESS IF GLOBAL CRF

665 ; = SLAVE PTE ADDRESS IF GLOBAL NOT CRF

666 ; = 0 IF NOT GLOBAL

667 3:

668 -ENABL LSB

669 GBLNOTRESIDENT:

670 CMPB PHDSB_PGTBPFC (RS), #1 ; IF CLUSTERING PAGE TABLE PAGES 671 BLEQ 40s

672 EXTZV #VASV_VPN, #VASS | VPN,4(SP),R2 ;SEE IF ADJACENT PAGE TABLES 673 MOVAL @W°MMGSGL _ SPTBASE[R2], R1 ; NEED TO BE FAULTED, GET SPT ENTRY ADR 674 BITL #<PTESM | VALID ! -

675 PTESM | TYP1 ! PTESM | TYPO ! -

676 PTESM | BAKX>, (R1) ; CHECK PREVIOUS SPT ENTEY

677 BGTR 10$ 7;BRANCH IF NOT VALID, NO? DZRO

678 BITL #<PTESM_VALID ! -

DIGITAL INTERNAL USE ONLY 17

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

PAGEFAULT ~- TRANSLATION NOT VALID EXCEPTION HANDLE. 10-MAY-1989 16:31:05 VAX MACRO V5.0-

8 Page 17 X-39 PAGE NOT RESIDENT, QUEUE A READ REQUEST 29-SEP-1968 11:26:39 [{SYS.SRC]PAGEFAULT.MAR;1 ( 679 _ -PTESM_TYP1 ! PTESM_TYPO ! - | 680 PTESM_BAKX>, 8 (R1) ;CHECK NEXT SPT ENTRY 681 BLEQ 40S ;BRANCH IF IT IS VALID 682 ; 683 ; NEXT PAGE TABLE NEEDS TO BE FAULTED 684 ; 685 INCL R2 ;SET NEXT SPT INDEX 686 BRB _ 20$ 687 ;. 7 688 ; NO I/O PACKETS ON THE SIDE LIST, MUST ALLOCATE ONE FROM NON-PAGED POOL 689 ; O0(SP) = PLACE TO STORE ADDRESS OF PACKET, TOTAL OF 3 LONG WORDS ON STACK 690 ; 691 GET_IRP: Ms 692 MOVL RO, (SP) 7; SAVE REGISTER. 693 MOVZBL #IRPS$C_LENGTH, Ri 7;SIZE OF 1/0 PACKET 694 JSB G“EXESALONONPAGED : ALLOCATE THE PACKET 695 BLBC RO, IRPWAIT 3 7BRANCH. IF NONE. AVAILABLE. 696. MOVL.. (SP),RO 7 RESTORE: SAVED: REGISTER™ 697 MOVL R2, (SP) ;SAVE I/O PACKET ADDRESS 698 BRB GOT_IRP s;REJOIN THE MAIN FLOW 699 ; 700 ; PREVIOUS PAGE TABLE NEEDS TO BE FAULTED 701 3; 702 108: DECL R2 7;SET PREVIOUS SPT INDEX 703 208: ROTL #9,R2,R2 ' gs TURN SPT INDEX BACK INTO 104 BISL #VASM_SYSTEM, R2 ; SYSTEM VIRTUAL ADDRESS 705 ADDL #2*4, SP ;CLEAN OFF 2 LONG WORDS 706 BRW SYSTEMSPACE 3GO FAULT THE PAGE TABLE 707 408: MOVL G“CTLS$GL_PCB, R1 ;COULD HAVE SYSTEM PCB IN R4 _s. 7108 TSTW PCBSW_DIOCNT(R1) 7;ENOUGH DIRECT I/O QUOTA FOR THIS READ? 709 7NOTE THAT BUILDPKT WILL CHARGE THE READ 710 BLEQ DIOCNTWAIT 2 7;BRANCH IF NO, MUST WAIT. 711 712 ASSUME IOC_GQ IRPIQ EQ 0 713 MOVL G“EXESAR_SYSTEM PRIMITIVES DATA, R2 7;IRP LIST HEAD IS 1ST CELL IN DAT 714 CLRL ~ (SP) ;MAKE ROOM ON STACK FOR IRP ADDRESS 715 ; SREMQHI (R2), (SP),R3 ;GET AN I/O PACKET FROM THE SIDE LIST CLRL “R3 300088: REMQHI (R2), (SP) . BcC 30009$ AOBLSS #900000, R3,30008$ - WORD “XFEFF -IIF IDN <FATAL>,<FATAL> , .WORD BUG$ BADQHDR!4 300098: 300108: 716 3; NOTE: R3 is scratch in SREMQOHI macro 717 BVS GET_IRP 7;BRANCH IF NEED TO GET ONE FROM THE POOL 718 719 -DSABL LSB 720 721 ; 722 3; RO = MASTER PTE ADDRESS IF GLOBAL CRF 723 ; = SLAVE PTE ADDRESS. IF GLOBAL NOT CRF 724 ; = 0 IF NOT GLOBAL 725 ; O(SP) = I/O REQUEST PACKET ADDRESS 126 ;

ITAL INTERNAL USE ONLY

CONFIDENTIAL AND PROPRIETARY DIGITAL EQUIPMENT CORPORATION

PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY-1989 16:31:05 VAX MACRO V5.0-

8 Page 18 X-39 PAGE NOT RESIDENT, QUEUE A READ REQUEST 29-SEP-1988 11:26:39 [SYS.SRC]PAGFFAULT.MAR;1 (

727 -ENABL LSB

728 GOT_IRP:

129 MOVQ 4(SP),R2 ;R2=VA (LOW BITS = PAGTYP), R3=#SVAPTE 730 CLRL - (SP) ; INIT CRF INDICATOR TO NOT CRF PAGE 731 PUSHL RO 7;SAVE GLOBAL, GBLCRF INDICATOR

7132 BSBW MMGS ININEWPFN 7;ALLOCATE AND INIT A NEW PFN

733 TSTL RO 7;PFN ALLOCATED SUCCESSFULLY?

7134 BLSS FREPAGWAIT 5 ;BRANCH IF NOT, MUST WAIT

735 MOVL @W“PFNSAL_PTE[RO],R3 ;GET MASTER PTE ADDRESS

736 ;SAME AS SLAVE UNLESS GLOBAL

7137 MOVL R3,16 (SP) ;SAVE FOR LATER USE

7138 INCW Q@W*PFNSAW_REFCNT[RO] 72ND REFERENCE FOR PAGE I/O

739 3

740 ; FORM R2 = BACKING STORE ADDRESS

741 ; O(SP) = MASTER PAGE TABLE ENTRY ADDRESS IF GLOBAL CRF

742 3 = SLAVE PAGE TABLE ENTRY ADDRESS IF GLOBAL NOT CRF

743 ; = 0 IF NOT GLOBAL PAGE

744 ; 4(SP) = 0 INITIALIZED TO NOT COPY ON REFERENCE

745 ; SET THIS TO CORRECT BACKING STORE ADDRESS IF CRF PAGE

746 ; 8(SP) = I/O REQUEST PACKET ADDRESS

747 ; 12(SP) = VIRTUAL ADDRESS (LOW