Skip to main content

Full text of "dec :: vax :: vms :: training :: EY-9769E-DA-0002 VMS Internals II Memory Mgmt IO and Advanced Topics Listings 198910"

See other formats




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 BITS = PAGTYP) 

748 ; 16(SP) = SVAPTE, GLOBAL IF NOT GBL CRF, PROCESS IF NOT GBL OR IF GBL CRF 
749 ; 

750 BICL3 #°C<PTESM PROT ! PTESM_OWN>, (R3),R1 ;R1 = PROT AND OWN 

751 BICL3 R1, (R3),R2 7;R2 = TYP1 ! TYPO ! BAKX 

752 BISL3 RO,R1, (R3) 7;PTE = PROT ! OWN ! PFN = TRANSITION PTE 
753 BBSC #PTESV_TYP1,R2,20$ ;BRANCH IF PAGE FILE OR SECTION 

754 : 

755 ; GLOBAL COPY ON REFERENCE PAGE 

756 ; 

757 MOVL (SP)+,R3 7GET MASTER PAGE TABLE ENTRY ADDRESS 
758 BISL3 #PFNSM_GBLBAK, R2, (SP) ;GBL BACKING STORE ADR IN CRE INDICATOR 
759 PUSHL (R3) ?;SAVE MASTER PAGE TABLE ENTRY CONTENTS 
760 ASSUME PFNS$V_BAKO EQ 0O 

761 BICL3 #°C<PFNSM_BAKO>, (R3),R2 ;GET ADDR FROM MASTER PTE 

762 BRB 258 7;TO COPY ON REFERENCE SECTION LOGIC 
763 ; 

764 ; MUST WAIT FOR A FREE PAGE, 5 LONG WORDS ON STACK, FIRST 2 ARE GARBAGE 

765 ; 8(SP) = I/O REQUEST PACKET ADDRESS TO BE DEALLOCATED, LAST 2 ARE SCRATCH 
766 3; 

767 FREPAGWAIT_5: 

768 MOVL 8(SP),RO 3I/O PACKET ADDRESS TO RO 

769 ADDL #<5*4>, SP ;CLEAN OFF 5 LONG WORDS 

770 MOVZBL #IRPS$C_LENGTH, IRP$W_SIZE(RO) ;SET PACKET SIZE AND CLEAR TYPE 
771 JSB G*“EXESDEANONPAGED z;AND DEALLOCATE IT 

7172 BRW FREEPAGEWAIT 

7173 3; 

774 ; PAGE FILE OR SECTION ADDRESS 

775 ; 

776 208: BBC #PTESV_TYPO,R2, 40$ ;BRANCH IF PAGING FILE 

77 BBC #PTESV_CRF, R2,50$ ;BRANCH IF NOT CRF 

778 3 

779 ; COPY ON REFERENCE SECTION TABLE ENTRY 

780 ; 

781 MOVL R2, 4(SP) ; SAVE BACKING ADDRESS IN CRF INDICATOR 
782 258: 

783 ASSIGN BACKING STORE BAK=@W“PFNSAL_BAK[RO], FAIL=27$, RETRY=26$ 


DIGITAL INTERNAL USE ONLY 19 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


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


DECW PHDSW_PRCPGFLPAGES (R5) 
BLSS 27$ 


26$: 
MOVL PHDSL_PAGFIL(R5) , QW*PFNSAL_BAK[RO] 
784 BISB #<PFNSM_ MODIFY ! PFNS$C_RDINPROG>, - 
785 @W“PFNSAB_ STATE [RO] 7;FORCE MODIFY BIT, READ IN PROGRESS 
786 BRB 60$ 
787 
788 27$: SWITCH PROCESS PAGEFILE R5,26$ 
PUSHAB B“*26$ 
BRW MMGSSWITCH PRCPGFL 
789 ; = 
790 ; PAGING FILE BACKING STORE ADDRESS 
791 ; 
792 308: 
793 BUG CHECK BADPRCPGFLX, FATAL 7 Bad process page file index in PTE 
794 ; 
795 ; PAGING FILE. BACKING. STORE: ADDRESS. 
796 ; 
797 40$: MOVL R5,R1 
798 TSTL (SP) 71S IT GLOBAL 
799 BEQL 45$ 7NO 
800 MOVL G“MMG$GL_SYSPHD, R1 7GET SYSTEM HEADER 
801 
802 45S: PUSHL R2 
803 EXTZV  #PTESV_PRCPGFLX, - + R2 = PROCESS page file index from PTE 
804 #PTESS PRCPGFLX, R2, R2 
805 
806 ASSUME PFNS$V_PGFLX EQ 24 
807 ASSUME PFNSS PGFLX EQ 8 
808 MOVB PHDS$B_PRCPGFL(R1) [R2],- ; Set SYSTEM page file index 
809 3 (SP) 7 in backing store 
810 BEQL 30$ 3 Bugcheck if not a valid page file 
811 POPL R2 
812 ; 
813 ; SECTION TABLE BACKING STORE ADDRESS 
814 ; 
815 50S: BISB #PFNSC_RDINPROG, @W*PFNSAB_ STATE [RO] 7;READ IN PROGRESS 
816 MOVL R2, @W*PEFNSAL_BAK[RO] 7;STORE BACKING STORE ADDRESS 
817 ; 
818 ; RO = PFN 
819 ; R2 = BACKING STORE ADDRESS 
820 ; R3 = PAGE TABLE ENTRY ADDRESS, PROCESS ADR IF NOT GLOBAL, 
821 ; GLOBAL ADDRESS IF GLOBAL OR GLOBAL CRF 
822 ; R4 = PROCESS PCB IF PROCESS PAGE, PROCESS PAGE TABLE, OR GLOBAL PAGE, 
823 ; = SYSTEM PCB IF SYSTEM PAGE OR GLOBAL PAGE TABLE 
824 ; R5 = PROCESS HEADER ADDRESS CORRESPONDING TO THE ABOVE PCB ADDRESS 
825 ; O(SP) = MASTER PTE CONTENTS IF GLOBAL CRF (>0) 
826 ; = SLAVE PTE ADDRESS IF GLOBAL NOT CRF (<0) 
827 ; = 0 IF NOT GLOBAL 
828 ; 4(SP) = 0 IF PAGE IS NOT COPY ON REFERENCE 
829 ; = BACKING STORE ADDRESS (FOR GBL CRF TOO) IF CRF PAGE 
830 ; 8(SP) = I/O REQUEST PACKET ADDRESS 
831 ; 12(SP) = VIRTUAL ADDRESS (LOW BITS = PAGTYP) 
832 ; 16(SP) = SVAPTE, GLOBAL IF NOT GBL CRF, PROCESS IF NOT GBL OR IF GBL CRF 
833 ; 
834 6 


OS: MOVL 8(SP),R1 7;ADDRESS OF I/O REQUEST PACKET 


20. 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 20 


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


835 MOVL FP,FP_SAV(R1) ;SAVE A REGISTER 
836 MOVL R1, FP ;USE THIS FOR CLUSTER CONTEXT 
837 MOVO R4,PCB_SAV(FP) ;SAVE PCB, PHD ADDRESSES 
838 TSTL (SP) ;LESS THAN O IF GLOBAL PAGE 
839 BEQL 70$ ;BRANCH IF NOT GLOBAL PAGE 
840 BGTR 65$ ;BRANCH IF GLOBAL CRF 
841 MOVL G“MMGSAR_SYSPCB, R4 ;USE SYSTEM PCB FOR GLOBAL PAGES 
842 ;WANT THE PRIORITY FROM IT 
843 658: MOVL G“MMGS$GL_SYSPHD,R5 ;SYSTEM PROCESS HEADER ADDRESS 
844 ; 
845 ; IF THE BACKING STORE ADDRESS IN R2 IS A GLOBAL ADDRESS, THEN R3 IS THE MASTER PTE 
846 ; AND R5 IS THE SYSTEM PROCESS HEADER, OTHERWISE R3 IS THE PROCESS PTE 
847 ; ADDRESS AND R5 IS THE PROCESS HEADER ADDRESS. 
848 ; 
849 708: MOVO R2, PTEDAT (FP) ;SAVE PTE DATA, AND ADDRESS 
850 
851 ASSUME ASTPRM EQ AST+4 
852 MOVO (SP)+,AST (FP) ;STORE PARAMETERS TO IOPOST IN IRP 
853 ; 
854 ; FETCH THE TRANSFER PRIORITY FROM PROCESS PCB IF PROCESS PAGE, 
855 : PROCESS PAGE TABLE, OR GLOBAL CRF PAGE. USE SYSTEM PRIORITY 
856 ; IF SYSTEM PAGE, GLOBAL PAGE, OR GLOBAL PAGE TABLE. 
857 3 
858 MOVB PCBS$B_PRIB(R4),PRI(FP) ;STORE PRIORITY OF TRANSFER IN IRP 
859 MOVL @W*PFNSAL BAK[RO],BAK(FP) ;SAVE BACKING STORE ADDRESS 
860 BICB3 #*C<PFNSM MODIFY ! PFNSM_LOC>,- ;AND STATE BYTE INFORMATION 
861 QW*PFNSAB | | STATE [RO], STATE (FP) ;FROM PFN DATA OF FIRST PAGE 
862 CLRL (SP) :THROUGH WITH IRP ADDRESS, USE FOR SCRATCH 
863 :WILL BE PAGE TABLE FAULT CLUSTER IF PPGTBL 
864 CLRL PHVREFCADR (FP) ;ADDRESS OF PROCESS HEADER REF CNT IF PPGTBL 
865 : 
866 ASSUME PFNS$C_PROCESS EQ 0 
867 ASSUME PFNSC_SYSTEM EQ 1 
868 ASSUME PFNSC_GLOBAL EQ 2 
869 ASSUME PFNS$C_GBLWRT EQ 3 
870 ASSUME PFNSC_PPGTBL EQ 4 
871 ASSUME PFNSC_GPGTBL EQ 5 
872 CMPZV #WSLSV_PAGTYP, #WSL$S_PAGTYP,- ;IF PAGE TABLE PAGE 
873 4(SP),#PFNSC_PPGTBL ;THEN SEPARATE CLUSTER FACTOR 
874 BLSS 90$ ;BRANCH IF NOT PAGE TABLE 
875 BGTR 80S :BRANCH IF GLOBAL PAGE TABLE 
~876 3 
877 ; MUST RECORD A PROCESS HEADER REFERENCE FOR PAGE READ OF PROCESS HEADER PAGE 
878 3 
879 MOVZWL PHDS$W_PHVINDEX(R5),R1  ;PROCESS HEADER VECTOR INDEX 
880 MOVAW @PHVSGL_REFCBAS[R1],R1 ;ADDRESS OF PROCESS HEADER REF CNT 
881. INCW (R1) ;COUNT ANOTHER REFERENCE 
882 MOVL R1, PHVREFCADR (FP) ;SAVE ADDRESS FOR CLUSTERING CODE 
883 MOVB PHDS$B_PGTBPFC(R5), (SP) ;GET PAGE TABLE CLUSTER FACTOR 
884 BNEQ 90$ :BRANCH IF SPECIFIED 
885 80S: MOVL #1, (SP) : INDICATE NO CLUSTERING 
886 90S: BSBW MMGSINIBLDPKT ;SET UP REGISTERS TO CALL BUILDPKT 
887 BBS #EXESV_NOCLUSTER, G*EXESGL_FLAGS,110$ ;BRANCH IF CLUSTERING DISABLED 
888 MOVQ PCB | SAV (FP), R4 ;RECOVER PCB, PHD ADDRESSES 
889 
890 ASSUME SECS$B_PFC EQ PFLS$B_PFC 
891 MOVB SECSB_PFC(R1), 1(SP) :PAGE FAULT CLUSTER FROM 


DIGITAL INTERNAL USE ONLY 21 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


8 Page 21 
X-39 PAGE NOT RESIDENT, QUEUE A READ REQUEST 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 ( 
892 ;SECTION OR PAGE FILE CONTROL BLOCK 
893 MOVZBL (SP),R1 7SEE IF PAGE TABLE CLUSTER SPECIFIED 
894 BGTR 100$ ;BRANCH IF SPECIFIED 
895 MOVZBL 1(SP),R1 7SEE IF PAGE FILE OR SECTION TABLE 
896 7CLUSTER WAS SPECIFIED 
897 BGTR 100$ 7BRANCH IF IT WAS 
898 MOVZBL PHDSB_DFPFC(R5),R1 ;DEFAULT FROM PROCESS HEADER 
899 . 7PROCESS IF PROCESS OR GLOBAL PAGE 
900 7;SYSTEM IF SYSTEM PAGE 
901 1008: CMPL R1, #1 ;CLUSTER OF 1? 
902 BLEQ 110$ 7BRANCH IF YES 
903 ADDL #4, SP 7CLEAN OFF CLUSTER FACTOR SCRATCH 
904 BRW TRY_TO CLUSTER 7GO TRY TO CLUSTER 
905 1108: MOVL #1,R1 7ONE PAGE READ 
906 ADDL #4, SP . gCLEAN OFF CLUSTER FACTOR SCRATCH 
907 POPL VA (FP) 7 Save VA (for page type bits) 
908 MOVL (SP)+,R3 ;SVAPTE FROM PFNSAL_PTE 
909 
910 -DSABL LSB 
911 ; 
912 ; RO = VBN, R1 = PAGE COUNT, R2 = WINDOW, R3 = SVAPTE, FP = IRP 
913 ; VA(FP) = page type (in low 9 bits) 
914 ; 
915 QUEUE_PAGE READ: 
916 
917 INCL G“PMSS$GL_PREADIO ;COUNT PAGE READ I/O REQUESTS (SYSTEM) 
918 ADDL R1, G*PMS$GL_PREADS 7;AND THE NUMBER OF PAGES READ 
919 =; ; 
920 ; If this is a system or global page table page, count the I/O in the system header 
921 ; 
922 ASSUME PFNSC_PROCESS EQ 0 
923 ASSUME PFNSC_SYSTEM EQ 1 
924 ASSUME PFNSC_GLOBAL EQ 2 
925 ASSUME PFNSC_GBLWRT EQ 3 
926 ASSUME PFNSC_PPGTBL EQ 4 
927 ASSUME PFNSC_GPGTBL EQ 5 
928 
929 EXTV #WSLSV_PAGTYP, #WSL$S_PAGTYP,- ; R4 = sign-extended page type 
930 VA(FP) ,R4 
931 BLBC R4,5$ 7 BR if process, global, or process page tab 
932 BLSS 1s 7 BR if global page table page 
933 BBS #1,R4,58 : BR if global writable page 
934 18: MOVL G“MMGS$GL_SYSPHD,R5 7 Fetch system PHD address 
935 INCL PHDSL_PGFLTIO(R5) ¢ Count page read I/O requests (SYSTEM) 
936 
937 58: PUSHL R3 3 Save SVAPTE 
938 
939 IF GT, CA$_MEASURE 
940 TSTL ASTPRM (FP) 3 CRF page ? 
941 BEQL 10$ 7 BR if not 
942 EXTZV #PFNSV_GBLBAK, #1,ASTPRM(FP),R3 ; Differentiate private and global CR 
943 — INCL G*PMSSAL , CRFIO[R3] 7 Count CRF page I/O requests 
944 ADDL2 Rl, G*PMSSAL_CRF [R3] # and the number of CRF pages 
945 , MOVL (SP) ,R3. 3 Restore. SVAPTE 
946 10$: : 
947 -ENDC 
948 


22 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 22 
X-39 PAGE NOT RESIDENT, QUEUE A READ REQUEST 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 ( 
949 MOVL G*CTLSGL_PCB, R4 - 3PCB ADDRESS 
950 MOVL PCBSL_PHD (R4) ,R5 7;PHD ADDRESS 
951 INCL PHDSL_PGFLTIO (R5) ;COUNT PAGE READ I/O REQUESTS (PROCESS) 
952 ASHL #9,R1,R1 7FORM BYTE COUNT TO TRANSFER 
953 MOVL FP,RS 7I/O PACKET ADDRESS 
954 MOVL FP_SAV(RS5) , FP 7;RESTORE SAVED REGISTER 
955 
956 ; 
957 ; O(SP) = SVAPTE (Master if global, slave if process or GBL CRF) 
958 ; 
959 ; RO = VBN 
960 ; Rl = NUMBER OF BYTES TO READ 
961 ; R2 = WINDOW ADDRESS 
962 ; R3 = SVAPTE (MASTER IF GLOBAL, SLAVE IF GLOBAL CRF) 
963 ; R4 = PROCESS PCB ADDRESS 
964 ; R5 = I/O REQUEST PACKET ADDRESS 
965 ; 
966 ; IRP$L_AST(RS5) 
967 ; = MASTER PTE CONTENTS IF GLOBAL CRF (>0) 
968 ; = SLAVE PTE ADDRESS IF GLOBAL NOT CRF (<0) 
969 ; = 0 IF NOT GLOBAL 
970 ; IRPS$L_ASTPRM(R5) 
971 ; = BACKING STORE ADDRESS IF CRF PAGE (GBLBAK SET IF GBL CRF) 
972 ; = 0 IF NOT CRF PAGE 
973 ; IRPSB_PRI(R5) = DESIRED TRANSFER PRIORITY 
974 ; 
975 ‘* UNLOCK LOCKNAME=MMG 7 UNLOCK MMG ACCESS 
976 7** DON’T CHANGE IPL 
977 JSB G*EXESBUILDPKTR ;BUILD AND QUEUE THE I/O PACKET 
978 ; 
979 ; THE FOLLOWING WAITS THE PROCESS AT THE FAULTING MODE 
980 ; 
981 ; O(SP) = SVAPTE (Master if global, slave if process or GBL CRF) 
982 ; 
983 PROCPAG: 
984 LOCK LOCKNAME=SCHED, - 7;LOCK SCHED DATA BASE 
985 PRESERVE=NO 7DON’T PRESERVE RO 
986 ; 
987 ; Test the PTE contents to see if the page is valid. This can 
988 ; happen if the page fault I/O completes after releasing the 
989 ; MMG and SCHED spin locks. Not testing the page can result in 
990 ; the process entering a persistent PFW wait state. 
991 ; 
992 ; This test depends upon the following assumptions: 
993 ; 
994 ; 1. Page read completion code in IOCIOPOST has the following 
995 ; processing template. 
996 ; 
997 ; LOCK MMG 
998 ; <Do all MMG page read completion processing, SETTING PTE VALID BIT L 
999 ; LOCK SCHED 
1000 ; Declare PFCOM event for process 
1001 ; If required, declare COLPGA event for all processes in the COLPG que 
1002 ; UNLOCK SCHED 
1003 ; UNLOCK MMG 
1004 ; , 
1005 ; . 2. IPL remains at SYNCH after releasing the MMG lock. Thus, the faulting 


DIGITAL INTERNAL USE ONLY 23 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


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


1006 ; process remains CURrent, which implies that the process cannot be 
1007 ; affected by the SWAPPER in any way. 

1008 ; 

1009 TSTL @(SP) + ? Was page concurrently made valid ? 
1010 BLSS 10$ ; BR if yes to avoid waiting process 
1011 

1012 MOVAQ G*SCHS$GQ_PFWQ, RO 7PAGE FAULT WAIT QUEUE ADDRESS 

1013 PUSHAB B*PGFEXIT 7;Stack subroutine return address 

1014 BRW MMGSPGFLTWAIT 1 7PUT PROCESS ON PAGE FAULT WAIT QUEUE 
1015 

1016 108: UNLOCK LOCKNAME=SCHED 7;UNLOCK SCHED ACCESS 

1017 ; 7** DON’T CHANGE IPL 

1018 BRW PGFCOMPLETE2 ?7Branch helper 

1019 PGFEXIT: 

1020 MOVQ (SP)+,R0 7RESTORE THE REGISTERS 

1021 MOVO (SP) +,R2 ? eee 

1022 MOVQ (SP)+,R4 3 eee 

1023 ADDL. #8,SP 7 CLEAN OFF’ THE’ EXCEPTION PARAMETERS 
1024 ; 

1025 ; STACK NOW CONTAINS JUST THE FAULT PC, PSL PAIR 

1026 ; 

1027 UNIVERSAL SYMBOL MMGS SVPCTX 

1028 ;MMGSSVPCTX: : 

1029 SVPCTX SAVE PROCESS CONTEXT, WITH R4 SAME 
1030 7 AS WHEN PAGEFAULT OCCURRED 

1031 MOVL G*CTLS$GL_PCB, R4 7NOW GET PCB ADDRESS 

1032 JMP G*SCHSWAITM zJOIN COMMON WAIT CODE FOLLOWING SVPCTX 
1033 3 SCHSWAITM will release SCHED spinlock 
1034 ; 

1035 ; WAIT FOR RESOURCE IN R1 TO BECOME AVAILABLE 

1036 ; 

1037 RESOURCEWAIT: 

1038 BSBB MMGSRESRCWAIT ?7SET UP TO WAIT FOR THE RESOURCES 
1039 7- RELEASE MMG LOCK, ACQUIRE SCHED LOCK 
1040 BRB PGFEXIT zAND EXIT TO THE SCHEDULER 

1041 ; 

1042 ; FAULT FOR PAGE WHICH IS ALREADY ON THE WAY INTO MEMORY 

1043 ; 

1044 READINPROG: 

1045 MOVQ (SP)+,R2 ;R2=VA (LOW BITS = PAGTYP), R3=SVAPTE 
1046 ASSUME PFNSC_PROCESS EQ 0 

1047 BITB #PFNSM_PAGTYP, @W“PFNSAB_ TYPE[RO] ;PROCESS PAGE? 

1048 BNEQ 5$ 7BRANCH IF NO 

1049 UNLOCK LOCKNAME=MMG, - 7; UNLOCK MMG ACCESS 

1050 PRESERVE=NO 7DON’T PRESERVE RO 

1051 3** DON’T CHANGE IPL 

1052 PUSHL  R3 3; SVAPTE must be on top of stack 
1053 BRB PROCPAG . 7 CONTINUE 

1054 5S: ; 

1055 ; COLLIDED PAGE (NOT A PROCESS PAGE) | 

1056 ; 

1057 BISB #PFNSM_COLLISION, @W“PFNSAB_TYPE [RO] s;COLLISION OCCURRED 

1058 MOVAQ G*SCHSGQ COLPGWQ, RO. ;COLLISION PAGE WAIT QUEUE 

1059 FREEPAGEWAIT1: 

1060 LOCK  § LOCKNAME=SCHED 7;LOCK SCHED DATA BASE 

1061 UNLOCK LOCKNAME=MMG ; UNLOCK MMG ACCESS 

1062 BSBB MMGSPGFLTWAIT_1 ?;PLACE PROCESS ON THE COLLISION QUEUE 


24 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 24 


X-39 PAGE NOT RESIDENT, QUEUR A READ REQUEST 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 ( 


1063 BRB PGFEXIT ;EXIT TO THE SCHEDULER 

1064 ; 

1065 ; NO FREE PAGES AVAILABLE ON THE FREE PAGE LIST, MUST WAIT 

1066 ; 

1067 FREEPAGEWAIT: 

1068 MOVAQ G*SCHS$GQ_FPGWQ, RO ;WAIT ON FREE PAGE WAIT QUEUE 
1069 BRB FREEPAGEWAIT1 

1070 ; 

1071 ; WAIT FOR RESOURCE IN R1 TO BECOME AVAILABLE 

1072 ; RO,R1,R2,R3 ALTERED, R4 RETURNED WITH CURRENT PCB ADDRESS 

1073 ; 

1074 ; WE MUST HOLD ONTO THE MMG SPINLOCK UNTIL AFTER THE RESMASK BIT IS SET! 
1075 ; 

1076 -ENABL LSB 

1077 UNIVERSAL SYMBOL MMGSRESRCWAIT 

1078 ;MMGSRESRCWAIT:: 

1079 LOCK LOCKNAME=SCHED, - 3;LOCK SCHED DATA BASE 

1080 PRESERVE=NO ?DON’T PRESERVE RO 

1081 MOVL G“CTLSGL_PCB, R4 7R4 = CURRENT PCB ADDRESS 
1082 MOVL © R1, PCBSL_EFWM (R4) 7;SET RESOURCE NEEDED 

1083 BBSSI R1,G“SCHSGL_RESMASK, 10$ s;NOTE SOMEONE WAITING 

1084 108: 

1085 UNLOCK LOCKNAME=MMG, - ; UNLOCK MMG ACCESS 

1086 PRESERVE=NO :DON’T PRESERVE RO 

1087 7;** DON’T CHANGE IPL 

1088 MOVAQ G*SCHS$GQ MWAIT, RO ;WAIT ON MISCELLANEOUS QUEUE 
1089 BRB 20$ 37GO WAIT THIS PROCESS 

1090 MMGSPGFLTWAIT_1: 

1091 MOVL G“CTLSGL_PCB, R4 ;MUST WAIT THE PROCESS PCB 
1092 

1093 UNIVERSAL_SYMBOL MMGSPGFLTWAIT 

1094 ;MMGSPGFLTWAIT:: 

1095 208: 

1096 INCW WQHSW_WOCNT (RO) ;COUNT THIS PROCESS WAITING 
1097 INSQUE (R4), (RO) SQUEVE THIS PCB 

1098 MOVW WOQHSW_WOSTATE (RO) , PCBSW_STATE (R4) 3;SET WAIT STATE IN PCB 
1099 RSB 

1100 


DIGITAL INTERNAL USE ONLY 25 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


8 Page 25 


X-39 FORM A CLUSTER OF PAGES TO READ 29-SEP-1988 11:26:39 [SYS.SRC)PAGEFAULT.MAR;1 (9) 


1102 
1103 
1104 
1105 
1106 
1107 
1108 
1109 
1110 
1111 
1112 
1113 
1114 
1115 
1116 
1117 
1118 
1119 
1120 
1121 
1122 
1123 
1124 
1125 
1126 
1127 
1128 
1129 
1130 
1131 
1132 
1133 
1134 
1135 
1136 
1137 
1138 
1139 
1140 
1141 
1142 
1143 
1144 
1145 
1146 
1147 
1148 
1149 
1150 
1151 
1152 
1153 
1154 
1155 
1156 
1157 
1158 


.SBTTL FORM A CLUSTER OF PAGES TO READ 
; RO = VBN IN FILE OF FIRST PAGE TO READ 
; Rl = DESIRED CLUSTER SIZE 
+ R2 = WINDOW CONTROL BLOCK ADDRESS 
; R4 = PCB ADDRESS, PROCESS IF PROCESS OR GLOBAL PAGE, SYSTEM IF SYSTEM PAGE 
; RS = PHD ADDRESS, PROCESS IF PROCESS OR GLOBAL PAGE, SYSTEM IF SYSTEM PAGE 
; FP = I/O REQUEST PACKET ADDRESS 
? O(SP) = VIRTUAL ADDRESS (LOW BITS = PAGTYP) 
; 4(SP) = SVAPTE FROM PFNSAL_PTE 
-ENABL LSB 
TRY_TO_CLUSTER: 
MOVL  §(SP)+,VA(FP) ;SAVE VIRTUAL ADDRESS 
MOVL RO, VBN(FP) :SET VIRTUAL BLOCK NUMBER 
ASSUME COUNT EQ CLUSTER+1 
BISW3 #*X0100,R1,CLUSTER(FP) ;SET COUNT AND CLUSTER 
MOVL § R2,WINDOW(FP) ;WINDOW ADDRESS 
; PUT PTEDAT INTO FORM OF TYP1 ! TYPO ! BAKX 
ASSUME PFNSV_PGFLX GE 24 
ASSUME PTESV_TYP1 GE 24 | 
MOVB #PTESM_TYP1@-24,PTEDAT+3(FP) ;TURN TYP1 BACK ON, CLEAR PAGE FILE IND 
MOVL § AST (FP) ,R3 ;PROCESS PTE ADR IF GBL NOT CRF 
BEQL 30$ ;BRANCH IF NOT GLOBAL PAGE 
BLSS = 10$ ;BRANCH IF GBL NOT CRF 
; GLOBAL COPY ON REFERENCE PAGE 
MOVL (SP), R3 ;PROCESS PTE ADR WHEN GBL CRF 
MOVL § ASTPRM(FP), R2 ;GPTX PTE CONTENTS FOR THIS CASE 
BRB 20$ 
CLU_END1: 
BRW CLU_END 
; GLOBAL PAGE NOT COPY ON REFERENCE 
10$: MOVL (R3),R2 ;GPTX FROM PROCESS PTE 
20$:  BICL  #*C<PTES$M_TYP1 ! PTESM TYPO !- ; ISOLATE PAGE TYPE 
PTE$M_GPTX>, R2 ;AND GPTX BITS 
ASSUME GPTX_ PTE EQ GPTX+4 
30$: MOVQ  R2,GPTX(FP) ;SET GPTX AND GPTX_PTE 
MOVL = #1, INC1 (FP) | ;INIT TO SCAN FORWARDS 
-DSABL LSB 
CLU_INI_INC: 
ASHL = #2, INC1 (FP) , INC4 (FP) 7+ OR - 4 
ASHL #9, INC1(FP),INC512(FP) ;+ OR - 512 
CLU_NXT: 


26 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 26 


X-39 FORM A CLUSTER OF PAGES TO READ 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 (9) 


1159 
1160 
1161 
1162 
1163 
1164 
1165 
1166 
1167 
1168 
1169 
1170 
1171 
1172 


1173: 


1174 
1175 
1176 
1177 
1178 
1179 
1180 
1181 
1182 
1183 
1184 
1185 
1186 
1187 
1188 
1189 
1190 
1191 
1192 
1193 
1194 
1195 
1196 
1197 
1198 
1199 
1200 
1201 
1202 


1203. 


1204 
1205 
1206 
1207 
1208 
1209 
1210 
1211 
1212 
1213 
1214 
1215 


208: 


™e Ne Xe 


Rl 


GC) se Se Me Ne 


OSs: 


we Se Ne Ne 


708: 


ADDL3 
MOVL 
BBS 
ADDL 
EXTZV 
TSTL 
BGEQ 
BICL3 


CMPL 
BNEQ 
TSTL 
BEQL 


ADDL3 
EXTZV 
TSTL 
BGEQ 
BICL3 


ADDL3 
CMPL 
BNEQ 


ASSUME 
MOVO 


INC4 (FP) ,SVAPTE(FP),R3 ;NEXT PTE TO CHECK 


R3, SVAPTE (FP) 7UPDATE CONTEXT 
#PTESV_TYPO,PTEDAT(FP),20$ ;BRANCH IF SECTION ADDRESS 
INC1 (FP) ,PTEDAT (FP) 7; INCREMENT PAGE FILE ADDRESS 


#VASV_VPN, #VASS_VPN,R3,R1 ;CHECK THAT PTE IS RESIDENT 
@W*MMGS$GL SPTBASE[R1] | ;BY MAKING SURE ITS SPTE IS VALID 


CLU_END1 7;BRANCH IF IT ISN’T 

#°C<PTESM_VALID !- 7GET VALID BIT 

PTESM_TYP1 ! PTESM_TYPO ! -;PAGE TYPE BITS 

PTESM_BAKX>, (R3) , RO 7AND PGFLVBN/PRCPGFLX or GPTX FROM PTE 

RO, PTEDAT (FP) 7;MUST AGREE IF THIS PAGE IS IN THE CLUSTER 
CLU_END1 7BRANCH IF AT END OF CLUSTER 

GPTX_PTE (FP) 7WAS THAT THE MASTER PTE FOR A GLOBAL? 

60$ 7BRANCH IF NO, IT WAS PROCESS PTE 


MUST TEST THAT PROCESS PTE POINTS AT THE GPTX 


INC4 (FP) ,GPTX_PTE(FP),R3 ;NEXT PROCESS PTE ADR 
#VASV_VPN, #VASS_VPN,R3,R1 ;CHECK THAT THIS PTE IS ACCESSIBLE 
@W*MMGSGL_SPTBASE [R1] 7BY MAKING SURE ITS SPTE IS VALID 


CLU_END1 ;BRANCH IF IT ISN’T 

#°C<PTESM_ VALID ! - 7GET VALID BIT 

PTESM_TYP1 ! PTESM_TYPO ! -;PAGE TYPE BITS 

PTESM_BAKX>, (R3) , RO 7;AND PGFLVBN/PRCPGFLX or GPTX FROM PTE 
INC1 (FP) ,GPTX (FP), R2 7;NEXT GLOBAL PAGE TABLE INDEX 

RO, R2 7IN THE CLUSTER? 

CLU_END1 7;BRANCH IF NOT 


GPTX_PTE EQ GPTX+4 
R2, GPTX (FP) 7;UPDATE GPTX 


= SPT INDEX FOR PAGE TABLE PAGE 


PUSHL 
PUSHL 
BSBW 
MOVO 
BLBC 


TSTL 
BGEQ 
ADDL3 
MOVL 
BSBW 
TSTL 
BLSS 
INCB 
MOVL 


BEQL 
INCW. 
MOVL 


R3 = PROCESS PTE ADDRESS 


R3 7SAVE PROCESS PTE ADR 

R1 . ;SAVE SPT INDEX 

MMGSFREWSLE 7GET A FREE WORKING SET LIST ENTRY 
(SP)+,R2 ;RESTORE PROCESS PTE ADR, SPT INDEX 
RO, CLU_END RESRC1 7; IF CANNOT GET ONE, END THE CLUSTER 


MUST CHECK THE SPT ENTRY FOR PROCESS PAGE TABLE IS STILL VALID 
FREWSLE MIGHT HAVE DISCARDED IT FROM THE WORKING SET. 


@W“MMGSGL SPTBASE [R2] 7IS SPT ENTRY FOR PT STILL VALID 


CLU_END_RESRC1 ;BRANCH IF NOT 
INC512(FP),VA(FP),R2 § ;NEXT VIRTUAL ADDRESS 
R2,VA(FP) | ;UPDATE THE CONTEXT 
MMGS$ ININEWPFN ;ALLOC AND INIT A PFN 
RO ;IF NO PEN’S AVAILABLE 
CLU_END_RESRC1 ;THEN END THE CLUSTER 
COUNT (FP) ;COUNT ANOTHER PAGE IN THE CLUSTER 
PHVREFCADR (FP) , R1 ;PROCESS HEADER REF CNT ADR 
;IF THIS IS A PROCESS PAGE TABLE PAGE 
70$ ;BRANCH IF NOT A PROCESS PAGE TABLE PAGE 
(R1) ;COUNT ANOTHER PROCESS HEADER REFERENCE 


@W*PFNSAL_ PTE[RO],R3 7;PROCESS PTE ADR IF NOT GLOBAL OR IF GBL CRF 
7GLOBAL PTE ADR IF GLOBAL NOT CRF 


DIGITAL INTERNAL USE ONLY 27 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


8 Page 27 


X-39 FORM A CLUSTER OF PAGES TO READ 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 (9) 


1216 
1217 
1218 
1219 
1220 
1221 
1222 
1223 
1224 
1225 
1226 


1227 
1228 
1229: 
1230 
1231 
1232 
1233 


1234 
1235 
1236 
1237 
1238 
1239 
1240 
1241 
1242 
1243 
1244 
1245 
1246 
1247 
1248 
1249 
1250 
1251 
1252 
1253 
1254 
1255 
1256 
1257 
1258 
1259 
1260 
1261 
1262 
1263 
1264 
1265 
1266 


INCW @W“PFNSAW_REFCNT [RO] 7;SECOND REFERENCE FOR I/O IN PROGRESS 
BICL3 #°C<PTESM_PROT ! PTESM_OWN>, (R3),R1 ;PROTECTION AND OWNER FIELDS 
BISL3 RO,R1, (R3) 7FORM TRANSITION PTE FORMAT 

MOVL BAK (FP) ,R2 7BACKING STORE FROM PREV PFN 

BBS #PTESV_TYPO, R2, 80$ 7BRANCH IF SECTION ADDRESS 

BITL | #PFNS$M_PGFLVBN, R2 7IF NOT A NULL PAGE FILE ADDRESS 

BEQL 75$ 

ADDL INC1 (FP) ,R2 7THEN INCREMENT THE ADDRESS 

MOVL R2, BAK (FP) 7AND UPDATE THE CONTEXT 

BRB 80$ 


7583: ASSIGN_BACKING STORE BAK=R2, FAIL=90$, RETRY=77$ 

DECW PHDSW_PRCPGFLPAGES (R5) 
BLSS 90$ 

778: 

MOVL PHDSL_PAGFIL(RS5) ,R2 

80S: MOVL R2, QW*PFNSAL_BAK [RO] 3;SET BACKING STORE ADR FOR THIS PEN 
BISB STATE (FP) , @W*PFNSAB_ STATE [RO] ;USE STATE FROM PREV PFN 
CMPB: COUNT (FP) , CLUSTER (FP) 3711S CLUSTER FULL? 
BGEQ CLU_END_RESRC ?BRANCH IF YES, QUEUE THE READ 
BRW CLU_NXT 3NO, TRY FOR ANOTHER PAGE 


90$: SWITCH PROCESS PAGEFILE R5, 77$ 
PUSHAB B*77$ 
BRW MMGSSWITCH_PRCPGFL 


CLU_END_RESRC1: 
BRB CLU_END_RESRC 


; 
3 END OF CLUSTER 


CLU_END: 
CMPB COUNT (FP) , #1 ;IF AT LEAST 2 PAGES IN CLUSTER 
BGTR § CLU_END_RESRC ;THEN READ THE CLUSTER 
MNEGL INC1(FP),INC1(FP) ;OTHERWISE TRY TO SCAN BACKWARDS 
BGTR § CLU_END_RESRC ;UNLESS ALREADY TRIED THAT 
SUBL #4, SVAPTE (FP) ;BACK TO STARTING SVAPTE 
BBS — #PTESV_TYPO,PTEDAT(FP),20$ ;BRANCH IF SECTION PAGE 
DECL § PTEDAT (FP) ;BACK TO ORIG PAGE FILE VBN 
20$: = BRW CLU_INI_INC 
; SET UP TO DO THE PAGE READ 
CLU_END_RESRC: 
MOVL  §(SP)+,R3 ;GET PTE ADR OF FIRST PFN IN CLUSTER 
MOVL § VBN(FP),RO ;AND ITS ASSOCIATED VBN IN THE FILE 
MOVZBL COUNT(FP),R1 ;NUMBER OF PAGES IN THE CLUSTER 
TSTL § INC1(FP) ;IF CLUSTER WENT BACKWARDS 
BGTR 208 
SUBL3 -R1, #1, R2 | ;- (COUNT-1) 
ADDL _—R2, RO ;ADJUST FILE VBN 
MOVAL (R3) [R2],R3 ;AND PTE ADR 
MOVL AST (FP) ,R4 ;PROCESS PTE ADDRESS FOR GLOBAL PAGE? 
BEQL 208 ;BRANCH IF NOT GLOBAL 
BLSS  10$ ;BRANCH IF GLOBAL BUT NOT CRF 
ADDL = R2, ASTPRM(FP) ;ADJUST GLOBAL BACKING STORE ADDRESS 
BRB 208 
10$:  MOVAL (R4) [R2],AST (FP) ;ADJUST PROCESS PTE ADDRESS FOR GLOBAL PAGE 


28 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 28 
X-39 FORM A CLUSTER OF PAGES TO READ 29~SEP~-1988 11:26:39 [SYS.SRC] PAGEFANLT.MAR;1 (9) 
1267 20$: MOVL WINDOW (FP), R2 7GET WINDOW ADDRESS 
1268 BRW QUEUE _PAGE_READ .  9gGO QUEUE THE PAGE READ 


DIGITAL INTERNAL USE ONLY 29 


CONFIDENTIAL AND PROPRIETARY | 
DIGITAL EQUIPMENT CORPORATION. 


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


8 Page 29 a 
X-39 DEMAND ZERO PAGE 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 (10) . 
1270 -SBTTL DEMAND. ZERO PAGE 
1271 ; 
1272 ; MUST WAIT FOR FREE PAGES TO BECOME AVAILABLE 
1273 ; 
1274 DZROFPGWAIT_ 5: 
1275 ADDL #<5*4>, SP 7;CLEAN OFF 5 LONG WORDS 
1276 BRW FREEPAGEWAIT 7AND GO WAIT FOR A FREE PAGE | 
1277 ; 
1278 ; THIS IS A DEMAND ZERO FORMAT PAGE TABLE ENTRY, RO = 0 
1279 ; 
1280 DZRO PTE: 
1281 CLRL R3 7NO GLOBAL MASTER PTE ADDRESS 
1282 CLRL R1 7;NO MASTER PTE CONTENTS 
1283 ; 
1284 ; RO = BACKING STORE ADDRESS, TYP1 ! TYPO ! BAKX 
1285 ; Rl = MASTER PAGE TABLE ENTRY CONTENTS IF GLOBAL, O IF NOT 
1286 ; R3 = GLOBAL PAGE TABLE ENTRY ADDRESS IF GLOBAL, 0 IF NOT 
1287 ; O(SP) = FAULT VA (LOW BITS. = PAGTYP). 
1288 ; 4(SP) = CORRESPONDING SVAPTE 
1289 ; 
1290 DZRO_GBL_SEC: 
1291 PUSHL R3 ;SAVE GBL PTE ADDR 
1292 PUSHL Rl 7SAVE MAGSTER PTE CONTENTS 
1293 PUSHL RO 7SAVE BACKING STORE ADDRESS 
1294 MOVOQ 12(SP),R2 7R2=VA, R3=SVAPTE 
1295 BSBW MMGS ININEWPEN 7;ALLOCATE AND INIT A PFN 
1296 TSTL RO ;SEE IF A PFN WAS ALLOCATED 
1297 BLSS DZROFPGWAIT_5 ;BRANCH IF HAVE TO WAIT 
1298 BISB #PFNSC_ACTIVE, @W°PFNSAB_STATE[RO] ;MARK PAGE ACTIVE 
1299 MOVL (SP)+,R1 7;GET BACKING STORE ADDRESS. 
1300 BEQL 158 ; Branch if demand zero format 
1301 BBS #PTESV_CRF,R1,15$ 7 Branch if DZRO, CRF section 
1302 BBS #PTESV_TYP1,R1,10$ 7;CHECK FOR GLOBAL WITH PAGE FILE BACING STOR 
1303 BBCC #PTESV_TYPO,R1,10$ 
1304 ; PAGE FILE BACKING STORE GLOBAL SECTION 
1305 38: MOVL G*MMGS$GL_SYSPHD, R2 7GET SYSTEM HEADER 
1306 ASSIGN BACKING STORE PHD=R2, BAK=R2, SUCCESS=20$, FAIL=5$, RETRY=4$ 
DECW PHDS$W_PRCPGFLPAGES (R2) 
BLSS 5$ 
4S: 
MOVL PHDSL_PAGFIL(R2),R2 
BRB 20$ 
1307 
1308 ; Failed to reserve pagefile using system header 
1309 58: PUSHL  R5 
1310 MOVL R2,R5 
1311 BSBB 9$ 
1312 POPL R5 
1313 BRB 4$ ; Make reservation using new pagefile 
1314 
1315 ; Failed to reserve pagefile using process header 
1316 7S: PUSHAB B%*17$ 7 Fall through to local subroutine 
1317 
1318 ; 
1319 ; Try to switch to a new pagefile 
1320 ; PHD address (process or system) in R5 
1321 ; 


30 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 30 


X-39 DEMAND ZERO PAGE 29~SEP-1988 11:26:39 [SYS.SRC]PAGEFANULT.MAR;1 (10) 


1322 


1323 
1324 
1325 
1326 
1327 
1328 
1329 


1330 
1331 
1332 
1333 
1334 
1335 
1336 
1337 
1338 
1339 
1340 
1341 
1342 
1343 
1344 
1345 
1346 
1347 
1348 
1349 
1350 
1351 
1352 
1353 
1354 
1355 
1356 
1357 
1358 
1359 
1360 
1361 


1362 
1363 
1364 
1365 
1366 
1367 
1368 
1369 


9$: SWITCH PROCESS PAGEFILE R5 
BSBW MMGS$SWITCH_ FRCPGEL 
RSB 


108: BICL3 #<PTESM_DZRO ! “C<PFN$M_BAKO>>,R1,R2 ;BACKING STORE ADR 
;WITH DZRO SHUT OFF 


BRB 20$ 


15$:° ASSIGN | BACKING | ‘STORE BAK=R2, FAIL=7$, RETRY=17$ 
DECW PHDSW | PRCPGFLPAGES (R5) 


BLSS 7$ 
178: 
MOVL PHDSL_PAGFIL(R5) ,R2 
2083 MOVL R2, QW*PFNSAL_BAK[RO] 3; STORE THE BACKING STORE ADDRESS 


O(SP) = MASTER PTE CONTENTS IF GLOBAL, 0 IF NOT 

4(SP) = MASTER PTE ADDRESS IF GLOBAL, O IF NOT 

8(SP) = VIRTUAL ADDRESS (LOW BITS = PAGE TYPE) 

12(SP) = SYSTEM VIRTUAL ADDRESS OF PROCESS PAGE TABLE ENTRY 


™e Te Ye Ne Ne Ne 


MOVO 8 (SP) ,R2 7R2=VA (LOW BITS = PAGTYP), R3=SVAPTE 
BICL3 #°C<PTESM_PROT ! PTESM_OWN>, - 
(R3),-(SP) 7PROTECTION AND OWNER FROM PTE 


BISL3 #<PTESM_VALID ! PTESC_KW ! - 
PTESM | MODIFY>, RO, (R3) 7MAKE PAGE KERNEL WRITE FOR ZEROING 


IF GT, CA$_MEASURE 
INCL  G*PMS$GL_DZROFLTS ;COUNT DEMAND ZERO PAGE FAULTS 
-ENDC 


BE AWARE THAT THE FOLLOWING CLRB ASSUMES THAT BIT 8 is NOoT 
IN USE FOR ANY OF THE PAGE TYPE FLAGS, ETC. 


+ * 
+ & 
+ * 
* 
+ * 


™e Te Ne Ve 


CLRB R2 7;CLEAR OUT THE PAGE TYPE 
PUSHL R3 #SAVE AROUND MOVCS5 
Movcs #0, (R4), #0, #*X200, (R2) ;ZERO THE PAGE, PCB ADDRESS TO R1 
MOVL (SP) +,R3 7RESTORE REGISTER 
MOVL R1,R4 ;RECOVER PCB ADDRESS 
MOVL (SP)+,R1 ?;PICK UP SAVED PROT AND OWNER 
MOVL 8 (SP) ,R2 7;VA TO INVALIDATE 
BICL3 #°C<PTESM_ VALID ! PTESM_MODIFY ! - 
PTESM_PFN>, (R3) ,RO ;CLEAR OUT ALL BUT VALID,MODIFY, AND PFN 
INVALIDATE TB R2,- ;INVALIDATE TRANSLATION BUFFER 
INST1=<BISL3 RO,R1, (R3)>;SET PTE WITH CORRECT PROT AND OWNER 
ett 
# NB: Co-routine address + 2 LWs are on top of stack during execution 
;-- 
MOVQ (SP),R1 ;SEE IF DZRO GLOBAL 
BEQL 60$ 7;BRANCH IF NOT, BOTH ARE ZERO 
‘o 
7 GLOBAL DEMAND ZERO PAGE, MAKE MASTER PTE VALID TOO 
408: BICL #°C<PTESM PROT ! PTESM_OWN>,R1 ;MASTER PTE PROTECTION AND OWNER 
BISL3 RO,R1, (R2) ;SET MASTER PTE VALID 
608: ADDL #4*4,SP 7;CLEAN OFF 4 LONG WORDS 


DIGITAL INTERNAL USE ONLY 31 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


8 Page 31 


X-39 DEMAND ZERO PAGE 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 (10) 


1370 
1371 
1372 
1373 
1374 
1375 
1376 
1377 
1378 
1379 


-dsabl 
PGFCOMPLETE: 
UNLOCK 


PGFCOMPLETE2 : 
MOVOQ 
MOVQ 
MOVO 
ADDL 
RE IMAC 


lsb 


LOCKNAME=MMG, - 
PRESERVE=NO 


(SP)+,R0 
(SP)+,R2 
(SP)+,R4 
#8, SP 


32 DIGITAL INTERNAL USE ONLY 


;RELEASE MMG LOCK/PRESERVE IPL 


° 
tf 


7RESTORE THE REGISTERS 


CLEAN OFF THE EXCEPTION PARAMETERS 
7;AND RETURN FROM THE EXCEPTION 


e Ye te Ve 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


X-39 FREE, MODIFIED, OR BAD PAGE LIST, RELEAS 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 


1381 -SBTTL FREE, MODIFIED, OR BAD PAGE LIST, RELEASE PENDING 
1382 ; 

1383 ; THIS IS A FAULT OFF THE FREE, MODIFIED, OR BAD PAGE LISTS 

1384 ; RO = PFN, R2 = LISTID, 

1385 ; O(SP) = VA (LOW BITS = PAGTYP), 4(SP) = SVAPTE 

1386 ; 

1387 -ENABL LSB 

1388 PFNLIST: 

1389 BSBW MMGSREMPFN ;REMOVE PFN FROM LIST 


1390 WRITEINPROG: 
1391 RELEASEPEND: 


1392 MOVQ (SP) ,R2 7;R2 = VA, R3 = SVAPTE 

1393 BSBW MMGSMAKEWSLE 7;MAKE A WORKING SET LIST ENTRY 

1394 MOVQ (SP) +,R2 7;R2=VA, R3*SVAPTE 

1395 ; 

1396 ; SET PAGE ACTIVE AND VALID 

1397 ; 

1398 MOVL Q@W“PFNSAL PTE[RO],R1 ;GET MASTER PTE ADDRESS 

1399 

1400 ASSUME PFNS$V_DELCON EQ PFNS$V_LOC+PFNSS_LOC+1 ;DELCON IS 2ND BIT TO LEFT OF 
1401 7;BIT IN BETWEEN IS FOR LOC EXPANSION 
1402 INSV #PFNSC_ACTIVE, #PFNSV_LOC, #PFN$S_LOC+2,~ ;SET PAGE ACTIVE 
1403 @W*PFNSAB_STATE [RO] 7;AND CLEAR DELCON 

1404 BISB #<PTESM_VALID@-24>,3(R1) ;SET VALID BIT 

1405 CMPB R2, #WSL$C_GLOBAL 7;GLOBAL OR PAGE TABLE PAGE? 

1406 BGEQ 100$ ;BRANCH IF YES 

1407 60S: UNLOCK LOCKNAME=MMG, - ;RELEASE MMG LOCK/PRESERVE IPL 

1408 PRESERVE=NO 7;DON’T PRESERVE RO 

1409 MOVQ (SP)+,R0O ;RESTORE THE REGISTERS 

1410 MOVQ (SP)+,R2 ; ates 

1411 MOVQ (SP)+,R4 : Sve 

1412 ADDL #8, SP ;CLEAN OFF THE EXCEPTION PARAMETERS 
1413 RE IMAC 7;AND RETURN FROM FAULT 

1414 ; 

1415 ; GLOBAL PAGE OR PAGE TABLE PAGE 

1416 ; 

1417 1008: CMPB R2, #WSLSC_PPGTBL ;PROCESS PAGE TABLE PAGE? 

1418 BGEQ 120$ :;BRANCH IF PROCESS OR GLOBAL PAGE TABLE 
1419 ; 

1420 ; GLOBAL PAGE 

1421 ; 

1422 BICL3 #°C<PTESM VALID ! PTESM_MODIFY ! PTESM_PFN>, (R1),R1 ;MASTER PTE 
1423 ; 

1424 ; R1 = VALID AND PFN BITS TO STORE INTO SLAVE PTE 

1425 ; R3 = SLAVE PTE ADDRESS 

1426 ; 

1427 SETSLAVEPTE: 

1428 BICL3 #°C<PTESM_ PROT ! PTES$M_OWN>, (R3),R2 ;PROTECTION AND OWNER FROM SLAVE 
1429 BISL3 R1,R2, (R3) ‘STORE THE NEW SLAVE PTE 

1430 BRB 60$ 7;AND EXIT THROUGH COMMON CODE 

1431 ; 

1432 ; PROCESS OR GLOBAL PAGE TABLE 

1433 ; 

1434 1208: BGTR 60$ ;BRANCH IF GLOBAL PAGE TABLE 

1435 PUSHL R1 ;SAVE REGISTER AROUND THE CALL 

1436 BSBW MMGSDECPHDREF ;ONE LESS LOCK ON HDR SPTE 

1437 POPL R1 ; RESTORE REGISTER 


DIGITAL INTERNAL USE ONLY 33 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


8 Page 33 
X-39 FREE, MODIFIED, OR BAD PAGE LIST, RELEAS 29-SEP-1988 11:26:39 [SYS.SRC])PAGEFANILT .MAR;1 
1438 BRB 60$ 7;AND EXIT THROUGH COMMON CODE 
1439 
1440 -DSABL LSB 
1441 ; 
1442 ; FAILED TO READ THE DESIRED PAGE, RELEASE THE PFN AND ISSUE AN EXCEPTION 
1443 ; RO = PAGE FRAME NUMBER 
1444 ; R4 = PROCESS CONTROL BLOCK ADDRESS 
1445 ; R5 = SYSTEM ADDRESS OF PROCESS HEADER 
1446 ; 0(SP) = VIRTUAL ADDRESS (LOW BITS = PAGE TYPE) 
1447 ; 4(SP) = SYSTEM VIRTUAL ADDRESS OF PAGE TABLE ENTRY 
1448 ; 
1449 READERR: 
1450 MOVQ (SP)+,R2 7R2=VA (LOW BITS = PAGTYP), R3=SVAPTE 
1451 PFN_REFERENCE - : 
1452 MOVZWL <@W*PFNSAX_WSLX[RO],R1>, ~- 7GET WORKING SET LIST INDEX IF NOT G 
1453 LONG _OPCODE=MOVL, - 
1454 IMAGE=SYS_NONPAGED 
1455 
1456 ASSUME PFNSC_PROCESS EQ 0 
1457 ASSUME PFNSC_SYSTEM EQ 1 
1458 ASSUME PFNSC_GLOBAL EQ 2 
1459 ASSUME PFNSC_GBLWRT EQ 3 
1460 ASSUME PFNSC_PPGTBL EQ 4 
1461 ASSUME PFNSC_GPGTBL EQ 5 
1462 CMPV #WSLSV_PAGTYP, #WSL$S_PAGTYP,R2, #PFNSC_GLOBAL ;IS PAGE GLOBAL? 
1463 BLSS 20$ 7;BRANCH IF NOT 
1464 ; 
1465 ; GLOBAL PAGE DOES NOT HAVE WORKING SET LIST INDEX IN WSLX ARRAY 
1466 ; MUST SCAN THE PROCESS’ WORKING SET LIST FOR THE VIRTUAL ADDRESS 
1467 ; 
1468 SUBL R5,R3 - sgUNBIAS SVAPTE, COULD BE SWAPPED HERE. 
1469 MOVL G“CTL$GL_PHD, R5 7USE P1 SPACE HEADER WINDOW 
1470 JSB G“MMGS SCNWSLX 7SCAN FOR THE WORKING SET LIST INDEX 
1471 ; 
1472 ; COULD HAVE BEEN SWAPPED IN THE ABOVE ROUTINE, BUT IPL IS BACK AT SYNCH NOW 
1473 ; 
1474 MOVL PCBS$L_PHD(R4),R5 7;RECOVER SYSTEM ADDRESS OF PHD 
1475 ADDL RS, R3 7REBIAS PTE ADDRESS 
1476 TSTL R1 7SEE IF FOUND WORKING SET LIST ENTRY 
1477 BEQL 40s s;IF NOT, PAGE WENT AWAY OR SOME OTHER 
1478 7;PROCESS WAS THE ORIGINATOR OF THE I/O 
1479 208: MOVL (R5) [R1],R2 7;FETCH WORKING SET LIST ENTRY 
1480 MOVQ R2,-(SP) 7;SAVE VIRTUAL ADDRESS AND PTE ADDRESS 
1481 BSBW MMGSFREWSLX 7FREE THIS WORKING SET LIST ENTRY 
1482 MOVQ (SP)+,R2 7RECOVER VA AND SVAPTE 
1483 BLBC RO, 39S 7;BRANCH IF ERROR 
1484 ; 
1485 ; IF THIS PAGE FAULT IS FROM USER OR SUPER MODE THEN ISSUE A 
1486 ; PAGE READ ERROR EXCEPTION. 
1487 ; 
1488 308: CMPZV #PSLSV_CURMOD, #PSL$S_CURMOD,- ;IR FAULTING MODE IS 
1489 FLTPSL(SP), #PSL$C_SUPER ;USER OR SUPER 
1490 BGEQ 40$ ;THEN PAGE READ ERROR EXCEPTION 
1491 


1493 CRASH THE SYSTEM. IF THIS PAGE IS OWNED BY USER OR SUPER THEN TRY 


; 
1492 ; THIS IS A BAD SITUATION NOW, AN EXCEPTION IN EXEC OR KERNEL MODE WILL 
? 
1494 ; SUBSTITUTING A PAGE OF ZEROS. THIS SHOULD SATISFY THE SYSTEM CODE WHICH 


34 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 34 
X-39 FREE, MODIFIED, OR BAD PAGE LIST, RELEAS 29-SEP-1988 11:26:39 [SYS.SRC] PAGEFAUI.T.MAR;1 


1495 -: IS ACCESSING THE PROCESS PAGE SINCE IT IS PARANOID ABOUT USER SUPPLIED 
1496 ; DATA. THE NEW PAGE WILL BE EXEC READ WRITE BUT OWNED BY THE ORIGINAL 
1497 ; OWNER. THIS WILL RESULT IN AN ACCESS VIOLATION WHEN THE PAGE IS TOUCHED 
1498 ; IN USER OR SUPER MODE. 

1499 ; 

1500 EXTZV #PTESV_OWN, #PTESS OWN, (R3) ,RO 7;GET THE PAGE OWNER 

1501 CMPI RO, #PSL$C_SUPER ;OWNED BY USER OR SUPER? 

1502 BLSS 40$ 7;BRANCH IF NOT, READ ERROR FOR 
1503 7A CRUCIAL PAGE, ISSUE THE PAGE 
1504 7;READ ERROR EXCEPTION, DOWN WE GO. 
1505 UNLOCK LOCKNAME=MMG, - ; UNLOCK MMG DATABASE 

1506 NEWIPL=#IPL$ ASTDEL 7;LOWEST POSSIBLE FAULT IPL 

1507 ; 

1508 ; FORM ARGUMENT LIST FOR CRETVA 

1509 ; 

1510 PUSHL R2 ; VIRTUAL ADDRESS TO CREATE 

1511 PUSHL R2 s; ANOTHER COPY TO FORM RANGE 

1512 PUSHL RO s;SAVE ACCESS MODE PARAMETER 

1513 MOVB S“*#PRTSC_EW, 1 (SP) 3;SET DESIRED PAGE PROTECTION 
1514 PUSHL #0 s;NULL RETURN ADDRESS 

1515 PUSHAL 8(SP) s;ADDRESS OF RANGE TO CREATE 

1516 CALLS #5, G“MMGSCRETVA 7;KERNEL MODE ENTRY TO CRETVA 
1517 Z;PRESERVES IPL 

1518 ;STRIP OFF INPUT RANGE WHEN DONE 
1519 BRW PGFCOMPLETE2 ;FAULT THIS PAGE FROM SCRATCH 
1520 398: 

1521 ; 

1522 ; FREWSLX CAN ONLY FAIL IF PAGE FILE NEEDED TO BE ALLOCATED AND IT COULDN’T BE 
1523 ; THIS CASE IS NOT POSSIBLE HERE. 

1524 ; 

1525 BUG CHECK FREWSLX, FATAL 

1526 

1527 408: INCW FLTCTL+2 (SP) ; INDICATE PAGE READ ERROR 

1528 ACVIOLAT: 

1529 MOVZWL FLTPSL+2 (SP),R1 ;GET IPL FROM FAULT PSL 

1530 UNLOCK LOCKNAME=MMG, - 7RELEASE MMG LOCK 

1531 NEWIPL=R1, - 3 RESTORE IPL 

1532 PRESERVE=NO 3; DON’T PRESERVE RO 

1533 POPR #°M<RO, R1,R2,R3,R4,R5> ;RESTORE REGISTERS SAVED BY PAGE FAULT 
1534 BBCC #16, (SP),10$ ;BRANCH IF ACCESS VIOLATION 

1535 JMP G*EXESPAGRDERR ; ISSUE THE EXCEPTION 

1536 108: JMP G“EXESACVIOLAT zs ACCESS VIOATION 


DIGITAL INTERNAL USE ONLY 35 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


X-39 SCANDEADPT - SCAN A DEAD PAGE TABLE FOR 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 ( 


1538 -SBTTL SCANDEADPT - SCAN A DEAD PAGE TABLE FOR TRANSITION PAGES 
1539 ; 

1540 ; INPUTS: 

1541 ; 

1542 ; R2 = VIRTUAL ADDRESS OF PAGE TABLE (LOW BITS = PAGE TYPE) 

1543 ; R5 = PROCESS HEADER ADDRESS 

1544 ; IPL = SYNCH 

1545 ; 

1546 ; OUTPUTS: 

1547 ; 

1548 ; NONE 

1549 ; 

1550 -ENABL LSB 

1551 BRW_508: 

1552 BRW 50$ ;LONG BRANCH TO 50$ 

1553 

1554 SCANDEADPT: 

1555 SUBW3.. PHDSW PTCNIVAL(R5).,PHD$W _PTCNTACT(RS),RO ;ACTIVE PAGE TABLES 
1556 ;THAT DON’T CONTAIN VALID WSLE’S 

1557 ;ARE DEAD PAGE TABLES 

1558 BLEQ BRW_50$ 7BR IF NO DEAD PAGE TABLES 

1559 ADDW PHDSW_PTCNTLCK(R5) , RO ;ADD IN THE LOCKED PAGE TABLES 

1560 MOVL PHDSL_WSFLUID (R5),-(SP) ; Get ready to add in fluid 

1561 ADDL (SP), RO ;NEED TWICE FLUID EXTRA 

1562 ADDL (SP) +,RO 

1563 MOVL PHDSL_WSSIZE(R5),-(SP) ;GET CURRENT WS SIZE 

1564 SUBL (SP) ,RO ; SUBTRACT OUT CURRENT WSL SIZE 

1565 - SUBL3 PHDSL_WSLIST(R5) ,PHDSL_WSDYN(R5), (SP) ;GET LOCKED PORTION OF WS 
1566 ADDL (SP)+,R0 ;ADD IN LOCKED ENTRY COUNT 

1567 BLSS 50$ ; BRANCH IF SAFE TO POSTPONE DEAD PAGE 
1568 ;TABLE SCAN 

1569 SUBL3 PHDSL_POBR(R5) , R2, RO ;BYTE OFFSET FROM FIRST PO PAGE TABLE 
1570 BLSS 50$ ;BRANCH IF PROCESS HEADER PAGE 

1571 ASHL #-9,RO,RO ; FORM PAGE NUMBER 

1572 ADDL R5, RO ;ADD IN PHD BASE 

1573 ADDL PHDSL_PTWSLEVAL(R5),RO ;ADD IN OFFSET TO BYTE ARRAY OF COUNTS 
1574 ;OF VALID WSLE’S IN EACH PAGE TABLE 
1575 TSTB (RO) ;IS THIS A DEAD PAGE TABLE 

1576 BGEQ 50$ ;BRANCH IF NOT 

1577 ; 

1578 ; R1,R2,R3 ARE PRESERVED UP TO THIS POINT 

1579 ; 

1580 MOVL R1, PHD$L_WSNEXT (R5) ; UPDATE NEXT POINTER 

1581 INCL G“PMS$GL_DPTSCN ; COUNT. THESE SCANS 

1582 EXTZV #VASV_VPN, #VASS_VPN, R2, RO ;PAGE NUMBER OF THE PT IN SYSTEM SPACE 
1583 BICL3 #°C<PTESM VALID ! PTESM_PFN>,- ;GET PFN AND VALID BIT 

1584 @W“MMGSGL_SPTBASE [RO], RO 7FROM SPT ENTRY FOR THE PAGE TABLE 
1585 BBCC #PTESV_VALID, RO, 40$ ;CLEAR VALID BRANCH IF IT WAS CLEAR 
1586 PUSHL #0 ;FLAG FOR MODIFIED PAGE WRITER NEEDED 
1587 PFN_REFERENCE - 

1588 MOVZWL <@W*PFNSAX_SHRCNT[RO],-(SP) >,~ ;NUMBER OF TRANSITION PAGES 
1589 LONG_OPCODE=MOVL, - 

1590 IMAGE=SYS_NONPAGED 

1591 BEQL 40$ ;IF NONE, INCONSISTENT 

1592 BICW #VASM_BYTE, R2 ;START SCANNING PT AT BEGINNING 

1593 MOVZBL #128,R3 7;AT MOST 128 PTE’S 

1594 208: BICL3 #°C<PTESM VALID ! - ;7;GET THE VALID BIT 


36 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 36 


X-39 SCANDEADPT - SCAN A DEAD PAGE TABLE FOR 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 ( 


1595 PTESM _TYP1 ! PTESM_TYPO ! - ;PTE TYPE BITS 

1596 PTESM_PFN>, (R2) +, RO 7;AND THE PFN FROM THE PTE 

1597 BEOL 30$ 7;BRANCH IF DEMAND ZERO PAGE 

1598 ASHL #-PTESV_TYPO,RO,R1 ;VALID, TYP1, TYPO ALL O IF TRANSITION 
1599 BEQL 60$ 7BRANCH IF TRANSITION PAGE 

1600 30S: SOBGTR R3,20$ 7LOOP THROUGH THE PAGE TABLE 

1601 BRB 100$ #ALL DONE, CNT=# I/O REQ OUTSTANDING 
1602 408: BUG CHECK SCANDEADPT, FATAL #SPT ENTRY FOR PAGE TABLE NOT VALID 
1603 

1604 50S: MOVL #1,R0 #SET CONTINUE RATHER THAN RESTART 
1605 RSB 

1606 7SHRCNT FOR PAGE TABLE IS 0 

1607 *DIDN’T FIND SHRCNT TRANSITION PAGES 
1608 7BEFORE RUNNING OFF THE END OF THE PT 
1609 ; 

1610 ; THIS IS A TRANSITION PAGE 

1611. ; 

1612 60$: MOVQ R2,-(SP) 7SAVE THESE REGISTERS 

1613 EXTZV #PFNSV_PAGTYP, #PFNSS_PAGTYP, - 7GET PAGE LOCATION 

1614 @W“PFNSAB STATE[RO],R2 ;FROM THE STATE BYTE 

1615 CMPL R2, #PFNSC_MFYPAGLST 7ON MODIFIED OR FREE PAGE LIST 

1616 BGTR 90$ ;BRANCH IF NOT ON EITHER 

1617 BEQL 80$ 7BRANCH IF ON MODIFIED PAGE LIST 
1618 ; 

1619 ; PAGE IS ON THE FREE PAGE LIST 

1620 ; 

1621 BSBW MMGSREMPFN ;ON FREE LIST, REMOVE IT 

1622 BISB #PFNSM_DELCON, @W“PFNSAB_STATE[RO] ;FORCE DELETE CONTENTS 
1623 BSBW MMGSRELPEN 7AND RELEASE THE PAGE 

1624 BRB 90$ 

1625 ; 

1626 ; PAGE IS ON MODIFIED PAGE LIST 

1627 ; 

1628 80S: BISB #PFNSM_DELCON, @W“PFNSAB STATE[RO] ;DELETE CONTENTS AFTER WRITING 
1629 INCL 12 (SP) 7 Count another modified page 

1630 BSBW MMGSREMPFN ; Remove page from modified list 
1631 BSBW MMGS INSPF'NH ? Insert at head of modified list 
1632 90S: MOVQ (SP)+,R2 #RESTORE SAVE REGISTERS 

1633 SOBGTR (SP) ,30$ ;COUNT DOWN THE TRANSITION COUNT 
1634 1008S: MOVQ (SP)+,RO ;CLEAN OFF THE EXHAUSTED COUNT AND FLAG 
1635 TSTL R1 7R1 = count of modified pages found 
1636 BEQL 110$ 7BRANCH IF NO MODIFIED PAGE WRITING 
1637 MOVL #MPWSC_SVAPTE, RO 7 Range-based purge request : 
1638 - MOVAL) -128(R2),R1 ; Low SVAPTE 

1639 MOVAL -4(R2),R2 ; High SVAPTE (inclusive range) 

1640 JSB G*MMGS$PURGEMPL 7 Initiate MPL purge 

1641 TSTL G*MMG$GL_MAXPFIDX ; Any page files installed ? 

1642 BEQL 110$ + None - don’t wait the process 

1643 MOVZWL #RSNS$_MPWBUSY, R1 ;SET RESOURCE TO WAIT FOR 

1644 ADDL #4,SP ;RETURN TO ORIGINAL CALLER 

1645 1108: CLRL RO 7SET FAILURE (OR RESTART) 

1646 RSB 

1647 

1648 -DSABL LSB 


DIGITAL INTERNAL USE ONLY 37 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


8 Page 37 
X-39 WSLEPFN - FETCH PFN FROM WORKING SET LIS 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT .MAR;1 
1650 -SBTTL WSLEPFN - FETCH PFN FROM WORKING SET LIST ENTRY 
1651 ; 
1652 ; CALLING SEQUENCE: 
1653 ; 
1654 ; JSB G“MMGSWSLEPFN 
1655 ; 
1656 ; INPUTS: 
1657 ; 
1658 ; R3 = SYSTEM VIRTUAL ADDRESS OF PAGE TABLE ENTRY 
1659 ; FOR A PAGE THAT IS IN THE WORKING SET LIST 
1660 ; 
1661 ; OUTPUTS: 
1662 ; 
1663 ; RO = PFN 
1664 ; R2,R3 PRESERVED 
1665 ; 
1666 WSLEPFNMSK: 
1667 -LONG “C<PTESM_ VALID ! PTESM_TYPO ! PTESM TYP1 ! PTESM_BAKX>: 
1668 
1669 UNIVERSAL _SYMBOL MMGSWSLEPFN 
1670 ;MMGSWSLEPEN: : 
1671 BICL3 B“WSLEPFNMSK, (R3) , RO 7GET VALID, TYPO, TYP1, PFN/GPTX 
1672 ASHL #-PTESV_TYPO,RO,R1 ;7;SEE IF TRANSITION OR VALID PAGE 
1673 BGTR FRE_GBLTRANS 7BRANCH IF NEITHER 
1674 ASSUME PTESV_PFN EQ 0 
1675 BICL #“°C<PTESM_ PFN>, RO 7GET PAGE FRAME NUMBER 
1676 RSB 7AND RETURN 
1677 ; 
1678 ; INPUTS: 
1679 ; 
1680 ; RO = PAGE TABLE ENTRY WITH TYPO, TYP1 AND GPTX BITS 
1681 ; Rl = RESULT OF SHIFTING RO BY -PTESV_TYPO 
1682 ; = 1 IF PAGE IS GLOBAL 
1683 ; > 1 IF PAGE TYPE IS INVALID FOR THIS CONTEXT 
1684 ; 
1685 ; OUTPUTS: 
1686 ; 
1687 ; RO = PFN IF GLOBAL PAGE IN TRANSITION 
1688 ; BUGCHK IF NOT 
1689 ; 
1690 FRE_GBLTRANS: 
1691 SOBGTR R1,WSLVANVAL ;BRANCH IF NOT GLOBAL FORMAT 
1692 BBCC #PTESV_TYPO,RO,WSLVANVAL ;CLEAR TYPO, MUST HAVE BEEN SET 
1693 BICL3 B“WSLEPFNMSK, @W*MMGSGL_GPTBASE[RO],RO ;FETCH MASTER PTE 
1694 ASHL #-PTESV_TYPO,RO,R1 ;MAKE SURE THIS IS IN TRANSITION 
1695 BNEQ WSLVANVAL 7;BRANCH IF IT IS NOT 
1696 RSB 7;ELSE, RO = PFN 
1697 WSLVANVAL: 
1698 BUG_CHECK WSLVANVAL, FATAL ;WORKING SET LIST ENTRY VIRTUAL 
1699 ;ADDRESS IS NOT VALID 


38 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 38 
X-39 FREWSLE ~ FREE A WORKING SET LIST ENTRY 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 ( 
1701 -SBTTL FREWSLE ~ FREE A WORKING SET LIST ENTRY 
1702 ++ 
1703 ; FUNCTIONAL DESCRIPTION: 
1704 ; 
1705 ; THIS ROUTINE CHOOSES A WORKING SET LIST ENTRY, RELEASES THE 
1706 ; PAGE WHICH OCCUPIES IT (IF ANY), MARKS THE ENTRY AVAILABLE, AND 
1707 ; LEAVES THE WSNEXT POINTER POINTING TO THE AVAILABLE ENTRY. 
1708 ; IN RELEASING A PAGE, IF ITS BACKING STORE ADDRESS IS A 
1709 ; NOT YET ALLOCATED PAGING FILE ADDRESS, THEN A PAGING FILE VBN 
1710 ; IS ALLOCATED AT THIS TIME. IT IS POSSIBLE THAT NO VBN’S ARE AVAILABLE 
1711 ; AND THUS THIS ROUTINE CAN RETURN UNSUCCESSFULLY. 
1712 ; 
1713 ; CALLING SEQUENCE: 
1714 ; 
1715 ; JSB G“MMGSFREWSLE 
1716 ; 
1717 ; INPUT PARAMETERS: 
1718 ; 
1719 ; R4 = PCB ADDRESS 
1720 ; R5 = PROCESS HEADER ADDRESS - MAY BE P1 SPACE ADDRESS 
1721 ; IF WORKING WITH PROCESS WORKING SET LIST 
1722 ; IPL = SYNCH 
1723 ; 
1724 ; IMPLICIT INPUTS: 
1725 ; NONE 
1726 ; 
1727 ; OUTPUT PARAMETERS: 
1728 ; 
1729 ; IF SUCCESSFUL . 
1730 ; RO LOW BIT IS SET 
1731 ; IF NOT SUCCESSFUL — 
1732 ; RO LOW BIT IS CLEAR AND 
1733 ; Rl = RESOURCE TO WAIT FOR (#RSNS$_XXXXX) 
1734 ;: 
1735 ; IMPLICIT OUTPUTS: 
1736 ; . 
1737 3: IF A WORKING SET ENTRY WAS FREED, IT IS PLACED ON THE FREE LIST 
1738 ; 
1739 ; COMPLETION CODES: 
1740 ; NONE 
1741 ; 
1742 ; SIDE EFFECTS: 
1743 ; NONE 
1744 ; 
1745 ;3-- 


DIGITAL INTERNAL USE ONLY 39 


CONFIDENTIAL AND PROPRIETARY. .. 
DIGITAL EQUIPMENT CORPORATION 


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


X-39 FREWSLE - FREE A WORKING SET LIST ENTRY 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 ( 


1747 ; FOR G*MMGSFREWSLX ENTRY POINT 

1748 ; 

1749 ; INPUTS: 

1750 ; 

1751 ; Rl = WORKING SET LIST INDEX 

1752 ; R2 = VIRTUAL ADDRESS (LOW BITS = PAGE TYPE) 

1753 7 R3 = SYSTEM VIRTUAL ADDRESS OF PAGE TABLE ENTRY 

1754 ; R4 = PROCESS CONTROL BLOCK ADDRESS 

1755 ; R5 | = PROCESS HEADER ADDRESS 

1756 ; IPL = SYNCH 

1757 ; 

1758 ; OUTPUTS: 

1759 ; 

1760 ; -RO = STATUS 

1761 ; Rl = RESOURCE TO WAIT FOR IF NOT SUCCESSFUL 

1762 ; | 

1763 

1764 ; 

1765 ; FOUND AN EMPTY WORKING SET LIST ENTRY, CHECK WHETHER THERE IS A 

1766 ; NEW PEAK WORKING SET SIZE AND WHETHER SWAP AREA NEEDS TO GROW. 

1767 ; 

1768 ; RO = GPGCNT+PPGCNT 

1769 ; 

1770 -ENABLE LSB 

1771 | 

1772 10$: BBC #PHDS$V_WSPEAKCHK, PHDSW_FLAGS(R5),15$ ;BRANCH IF CANNOT BE 
1773 ;ABOVE PREVIOUS PEAK WORKING SET SIZE 
1774 CMPL RO,G*CTLS$GL_WSPEAK ;ABOVE PREVIOUS RECORDED PEAK? 

1775 BLSSU 15$ ;BRANCH IF NOT 

1776 ADDL3 #1,R0,G*CTL$GL WSPEAK ;YES, NEW PEAK INCLUDES THE PAGE 

1777 ;ABOUT TO BE ADDED TO THE WORKING SET 
1778 15$: BBC #PHD$V_IWSPEAKCK, PHDSW_FLAGS(R5),20$ ;BRANCH IF CANNOT BE 
1779 ;ABOVE PREVIOUS PEAK WORKING SET SIZE 
1780 CMPL § RO,G*CTLSGL_IWSPEAK ;ABOVE PREVIOUS RECORDED PEAK? 

1781 BLSSU  _20$ ;BRANCH IF NOT 

1782 ADDL3 #1,RO,G*CTLS$GL_IWSPEAK ;YES, NEW PEAK INCLUDES THE PAGE 

1783 ;ABOUT TO BE ADDED TO THE WORKING SET 
1784 20$: MOVL Rl, PHD$L_WSNEXT(R5) ;UPDATE NEXT POINTER 

1785 MOVZWL #SS$ NORMAL, RO ; SUCCESSFUL RETURN INDICATION 

1786 RSB 

1787 

1788 35$: BRB 10$ ;GET BRANCH DESTINATION TO REACH 
1789 

1790 LCKWSLE_NOTPGTB: 

1791 BUG CHECK BADLCKWSLE, FATAL ;LOCKED WORKING SET LIST ENTRY NOT PAGE TABL 
1792 WSSIZEERR: 

1793 BUG CHECK WSSIZEERR, FATAL ;VALUE OF WSSIZE IS SMALLER THAN IN USE 
1794 ; | | 

1795 ; THIS IS A LOCKED PAGE IN THE DYNAMIC PORTION OF THE WORKING SET LIST 

1796 ; IT MUST BE A PAGE TABLE PAGE, NOTE THE CONDITION CODES ARE STILL SET 

1797 ; FROM THE FETCH OF THE WORKING SET LIST ENTRY. 

1798 ; 

1799 50$:  BGEQ  §LCKWSLE_NOTPGTB ;BRANCH IF THIS IS NOT A PAGE TABLE 
1800 BBS #WSLSV_PAGTYP,R2,60$ | ;BRANCH TO SKIP GLOBAL PAGE TABLE PAGES 
1801 BSBW § SCANDEADPT ;SCAN THE PAGE TABLE TO SEE IF DEAD 
1802 ;IF SO RID IT OF TRANSITION PAGES. 
1803 BLBS RO, 60$ 7AND NOW GET A FREE WS LIST ENTRY 


40 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 40 
X-39 FREWSLE ~- FREE A WORKING SET LIST ENTRY 29-SEP-1988 11:26:39 [SYS.SRC])PAGEFANLT.MAR;1 ( 
1804 . 
1805 UNIVERSAL_SYMBOL MMGS$FREWSLE 


1806 ;MMGSFREWSLE:: 


1807 MOV2ZWL G*SGNS$GW_WSLMXSEP, R3 ;MAX NUMBER OF TB VALID ENTRIES TO SKIP 
1808 MOVL PHDSL_WSNEXT(R5) , R1 7; INDEX TO NEXT CANDIDATE TO DISCARD 
1809 TSTL (R5) (R1) 7IS THIS ENTRY FREE? 
1810 BEQL 80$ ;BRANCH IF SO, CHECK FOR TRULY FREE 
1811 608: INCL R1 ;STEP TO NEXT ENTRY 
1812 CMPL R1, PHD$L_WSLAST (RS) ;AT THE END YET? 
1813 BLEQU 70$ ? CONTINUE 
1814 MOVL PHDSL_WSDYN (R5) ,R1 7;BACK TO THE TOP 
1815 70$: MOVL (R5) [R1],R2 7R2 = VA FROM WSLE 
1816 BNEQ 120$ ?;BRANCH IF ENTRY IN USE 
1817 80S: ADDL3 PCBSL_PPGCNT(R4) , PCBSL_GPGCNT(R4),RO ;CURRENT PAGE COUNT IN USE 
1818 CMPL RO, PHD$L_WSSIZE (R5) 7;ARE PAGES IN USE = WORKING SET SIZE? 
1819 BEQL 90$ ;BRANCH IF SO, NEED TO REPLACE A PAGE 
1820 BGTRU WSSIZEERR 7 BRANCH IF MORE PAGES IN WS THAN IN WSSIZE 
1821 SUBL3 PHDSL_WSLIST(R5) , PHDSL_WSQUOTA(R5),R2 ;QUOTA NUMBER OF PAGES- 

1 
1822 CMPL RO, R2 7;ARE WE WITHIN QUOTA NUMBER OF PAGES? 
1823 BLEQU 35$ 7;BRANCH IF SO, ALLOWED ANOTHER PAGE 
1824 CMPL G*SCHSGL_GROWLIM, G*SCH$GL_FREECNT ;ENOUGH FREE PAGES TO EXTEND? 
1825 BLSS 35$ 7BR IF so 
1826 90S: SUBL3 #1,R1,R0 7;SAVE INDEX OF LAST NON-ZERO WSLE 
1827 1008: INCL R1 7;STEP TO NEXT ENTRY 
1828 CMPL R1, PHD$L_WSLAST (R5) 7;AT THE END YET? 
1829 BLEQU 110$ ; CONTINUE 
1830 MOVL PHDSL_WSDYN (R5) ,R1 7BACK TO THE TOP 
1831 BLBS G*MMGSGB_FREWFLGS,110$ ;IF SWAPPER REQUESTED, DON’T MOVE LAST 
1832 MOVL RO, PHD$L_WSLAST (R5) ? SHRINK WSLAST BACK OVER 0 WSLE’S 
1833 7THIS IS SAFE BECAUSE WS IS FULL 
1834 1108: MOVL (R5) [R1},R2 ;R2 = VA FROM WSLE . 
1835 BEQL 100$ ;BRANCH IF UNUSABLE FREE ENTRY 
1836 1208: BLBC R2, WSLENOVAL 7BRANCH IF ENTRY NOT VALID 
1837 BBS #WSLSV_WSLOCK, R2, 50$ ;SKIP ENTRY IF IT IS LOCKED 
1838 CONDITION CODES STILL SET FROM LOAD OF R2 
1839 BBC S“*#EXESV_TBCHK, G*EXESGL_FLAGS,130$ ;BRANCH IF TBCHK NOT ENABLED 
1840 MTPR R2, #PR$_TBCHK ;TEST FOR VALID IN TB 
1841 BVvc 130$ ;BRANCH IF NO VALID TRANSLATION 
1842 SOBGEQ R3,60$ 7;SKIP PAGE UNLESS COUNT EXHAUSTED 
1843 1308S: MOVL R1, PHD$L_WSNEXT (R5) ; UPDATE NEXT POINTER 
1844 BSBW MMGSSVAPTECHK ;RETURN R3 = SYS VA OF PAGE TABLE ENTRY 
1845 7;OK FOR PROCESS PAGE TABLES AND 
1846 ;PROCESS HEADER PAGES WITH PROCESS PCB ADR 
1847 -DISABLE LSB 
1848 ; 
1849 ; R1 = WSLX, R2 = VA FROM WSLE, R3 = SVAPTE, R4 = PCB, R5 = PHD 
1850 ; 
18651 BBC #PTESV_MODIFY, (R3),MMGSFREWSLX ;BRANCH IF PAGE NOT MODIFIED 
1852 ;IF ENTRY NOT VALID MODIFY=#0 SO BRANCH 
1853 CMPL G“MPWSGL_WAITLIM, - 
1854 G*SCHSGL_MFYCNT ; Above upper wait process threshold ? 
1855 BLEQ 140$ ; BR if yes 
1856 BBC S*#SCHSV_MPW, G*SCHSGB_SIP,~ 
1857 MMGSFREWSLX ; BR if modified page writer not active 
1858 CMPL G*“MPWSGL_LOWAITLIM, - 
1859 G*SCH$GL_MFYCNT 3; Above lower wait process threshold ? 

; BR if no 


1860 BGTR MMGSFREWSLX 


DIGITAL. INTERNAL USE ONLY 41 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


X-39 FREWSLE - FREE A WORKING SET LIST ENTRY 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 ( 


1861 1408: MOVL G*CTLSGL_PCB, RO Get process PCB address (R4 may be SYSTEM’ 


1862 TSTW PCBSW_MTXCNT (RO) + Does process hold any mutexes ? 
1863 BNEQ MMGSFREWSLX + BR if yes (avoids possible deadlocks) 
1864 BBS S*#MMGSV_NOWAIT, G*MMGS$GB_FREWFLGS, MMGSFREWSLX 

1865 7BRANCH IF THIS IS SWAPPER 

1866 TSTL G*MMGS$GL_MAXPF IDX ? Any page files installed ? 

1867 BEQL MMGSFREWSLX # None - don’t wait the process 
1868 MOVZWL #RSNS$ MPWBUSY, R1 #R1 = RESOURCE TO WAIT FOR 

1869 CLRL RO 7RETURN FAILURE INDICATION 

1870 RSB #RETURN RESOURCE TO WAIT FOR IN Rl 
1871 

1872 WSLENOVAL: 

1873 BUG CHECK WSLENOVAL, FATAL ;WSL ENTRY NOT VALID 

1874 

1875 -ENABLE LSB 

1876 

1877 UNIVERSAL_SYMBOL MMGS FREWSLX 

1878 ;MMGSFREWSLX: : 

1879 PUSHL Ri *SAVE WSLX FOR DELETE BY WSLX 
1880 

1861 ASSUME PTESV_MODIFY EQ PTE$V_TYP1 

1882 BICL3 #°C<PTESM_ VALID ! - ;FETCH VALID BIT 

1883 PTESM_TYP1 ! PTESM_TYPO ! - ;PTE TYPE BITS 

1884 PTESM_GPTX>, (R3), RO 7AND PFN/GPTX FROM PAGE TABLE ENTRY 
1885 BBSC #PTESV_VALID, RO, 10$ *BRANCH IF PTE VALID 

1886 #CLEAR VALID BIT IN RO 

1887 


1888 ; PAGE TABLE ENTRY NOT VALID, 


1889 ; PAGE IN TRANSITION AND READINPROG OR 
1890 ; GLOBAL PTE POINTING TO TRANSITION PTE 
1891 ; 
1892 ASHL #-PTESV_TYPO, RO,R1 7IF NEITHER TYP1 OR TYPO IS SET 
1893 BEQL 30$ ;BRANCH TO RELEASE PAGE 
1894 ; 
1895 ; THIS WORKING SET LIST ENTRY POINTED TO A PAGE WITH A PAGE TABLE ENTRY 
1896 ; WHICH IS NEITHER VALID NOR IN TRANSITION. THIS PAGE MUST BE A GLOBAL 
1897 ; PAGE ON THE WAY IN TO MEMORY. THE GLOBAL PTE MUST BE IN TRANSITION. 
1898 ; 
1899 BSBW FRE_GBLTRANS 7GET PEN IF PAGE IS GLOBAL TRANSITION 
1900 BRB 30$ 7;RELEASE ACTIVE PAGE 
1901 
1902 108: INVALIDATE_TB R2,- 7; INVALIDATE TRANSLATION BUFFER 
1903 INST1=<MOVL (R3),R1>,- 
1904 INST2=<BICB #<PTES$M_VALID!PTE$M MODIFY>@~-24, 3 (R3) > 
e++ 
7 NB: Co-routine address + 2 LWs are on top of stack during execution 
P edad 
1905 ;RESET VALID AND MODIFY 
1906 ;LEAVING TRANSITION PAGE FOR I/O TO SEE 
1907 BBC #PTESV_MODIFY,R1,30$ 7 BR IF PAGE NOT MODIFIED 
1908 BICL #PTESM_MODIFY, RO 7; CLEAR MODIFY BIT TO INDEX PFN DB 
1909 BISB #PFENSM MODIFY, @W*PFNSAB_STATE[RO] ;RECORD MODIFY BIT 
1910 
1911 UNIVERSAL_SYMBOL MMGSFRE_TRYSKIP 
1912 ;MMGSFRE_TRYSKIP:: 7;HOOK RETURN LOCATION FOR MP SUPPORT 
1913 ; 


42 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 42 
X-39 FREWSLE - FREE A WORKING SET LIST ENTRY 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 ( 


1914 ; RELEASE THIS WORKING SET LIST ENTRY 


1915 ; 

1916 308: MOVL Q@W“PFNSAL_BAK[RO],R1 7;GET BACKING STORE ADDRESS (VBN) 

1917 BBS #PFNSV_MODIFY, @W°PFNSAB_STATE [RO], 50$ ;BRANCH IF PAGE MODIFIED 
1918 BITL #PFNSM_PGFLVBN, R1 ;DOES PAGE HAVE BACKING STORE? 

1919 BNEQ 70$ ;BRANCH IF YES 

1920 ; : 

1921 ; NULL PAGE FILE BACKING STORE ADDRESS, AND PAGE IS NOT MODIFIED 

1922 ; 

1923 NULLPGFL_NOMFY: 

1924 BUG CHECK MFYNULPGFL, FATAL 

1925 ; 

1926 ; NOW THAT WE HAVE A MODIFIED COPY OF THE PAGE IN MEMORY, NO NEED FOR OBSOLETE 
1927 ; PAGE FILE COPY. 

1928 ; 

1929 50S: PUSHL R3 7;SAVE SVAPTE 

1930 BSBW MMGSDALCBAKSTORE 7; RELEASE OLD PAGE FILE BACKING STORE 
1931 POPL R3 ;RESTORE SVAPTE 

1932 3; . 

1933 ; G“PFNSAL_BAK [RO] IS ALL SET UP, RO = PFN, R2 = VA, R3 = SVAPTE (SLAVE IF GBL) 
1934 ; 

1935 70S: ASSUME PFNSC_PROCESS EQ 0 

1936 ASSUME PFNSC_SYSTEM EQ 1 

1937 ASSUME PFNSC_GLOBAL EQ 2 

1938 ASSUME PFNSC_GBLWRT EQ 3 

1939 ASSUME PFNSC_PPGTBL EQ 4 

1940 ASSUME PFNSC_GPGTBL EQ 5 

1941 : 

1942 CMPV #WSLSV_PAGTYP, #WSLS$S_PAGTYP, R2, #PFN$C_GLOBAL ;GLOBAL PAGE? 
1943 BLSSU 130$ BRANCH IF PROCESS OR SYSTEM 

1944 BLSS 120$ ;BRANCH IF PROCESS OR GLOBAL PAGE TABLE 
1945 ; 

1946 ; GLOBAL PAGE - MAKE SLAVE PTE INTO GLOBAL FORMAT 

1947 ¢: 

1948 SUBL3 G*MMGSGL_GPTBASE, @W*PFNSAL_PTE[RO],R1 ;BYTE INDEX TO GPTE 

1949 ROTL #32-2,R1,R1 ;GLOBAL PAGE TABLE INDEX 

1950 ASSUME PTESV_TYPO EQ PTESS GPTX ;TYPO ADJACENT TO GPTX FIELD 

1951 BISL #PTESM TYPO,R1 7;SET TYPO BIT FOR GLOBAL FORMAT 

1952 BICL3 #<PTESM TYPO!PTESM _GPTX>,- ;STORE GPTX + TYPO IN PTE 

1953 (R3),-(SP) ; CHANGING FROM TRANSITION TO GLOBAL 
1954 BISL3 R1, (SP)+, (R3) 

1955 BSBW MMGSDECPTREF ; SLAVE PTE NO LONGER LOCKED 

1956 DECSHR GTR=150S,- ;ONE LESS SHARER, BRANCH IF STILL IN USE 
1957 IMAGE_FLAG=SYS_NONPAGED 

1958 MOVL @W“PFNSAL_PTE[RO],R1 :;GET MASTER PTE ADR 

1959 BICB #<PTESM VALID ! PTESM_MODIFY>@-24,3(R1) ;FORM TRANSITION PTE 
1960 BRB 1308 3;GO COUNT ONE LESS WSL REF 

1961 

1962 ; 

1963 ; PROCESS OR GLOBAL PAGE TABLE 

1964 ; 

1965 1205S: CMPZV #WSLSV_PAGTYP, #WSLSS_PAGTYP,R2, #PFNSC_PPGTBL PROCESS PAGE TABLE? 
1966 BNEQ 130$ 7;BRANCH IF NO 

1967 MOVZWL PHDSW_PHVINDEX(R5),R1 ;PROCESS HEADER VECTOR INDEX 

1968 INCW @PHVSGL_REFCBAS [R1] 7;ADD A PROCESS HEADER REFERENCE 

1969 ;WHEN PROCESS PAGE TABLE IS POT 

1970 ; INTO TRANSITION STATE 


DIGITAL INTERNAL USE ONLY 43 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


6 Page 43 
X~-39 FREWSLE - FREE A WORKING SET LIST ENTRY 29-SEP-1988 11:26:39 [SYS.SRC)PAGEFANLT.MAR;1 ( 
1971 1308: DECREF EQL=140$ 7;COUNT ONE LESS WSL REF 
1972 ; ; 
1973 ; OTHER REFERENCES OUTSTANDING, COULD BE DIRECT I/0, PAGING I/O 
1974 ; IF CURRENT PAGE STATE IS ACTIVE CHANGE IT TO RELEASE PENDING WHICH 
1975 ; IF REFAULTED WILL BE TRANSFORMED BACK TO ACTIVE. 
1976 ; LEAVE READ IN PROGRESS STATE AS Is. 
1977 ; 
1978 CMPZV #PFNSV_LOC, #PFNSS_ LOC, @W*PFNSAB_STATE([RO]), #PFNS$C_ACTIVE 
1979 ;UNLESS STATE IS ACTIVE 
1980 BNEQ 150$ 7;LEAVE IT AS IT WAS 
1981 INSV #PFNSC_RELPEND, #PFNS$V_LOC, #PFNS$S_LOC, @W“PFNSAB_STATE [RO] 
1982 7OTHERWISE SET RELEASE PENDING STATE 
1983 BRB 150$ 
1984 ; 
1985 ; RO = PFN, REFCNT = 0, R2 = VA, R3 = SVAPTE 
1986 ; 
1987 
1968 1408: BSBW MMGSRELPFN 7REFCNT = 0, RELEASE PFN 
1989 1508S: MOVL (SP) +,R1 7RECOVER SAVED WSLX 
1990 BSBB MMGSDELWSLEX #;DELETE WORKING SET LIST ENTRY (BY INDEX) 
1991 MOVZWL #SS$_NORMAL, RO 3 SUCCESSFUL RETURN INDICATION 
1992 RSB 
1993 
1994 -DISABLE LSB 


“44 «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 44 


X-39 DELWSLEX - DELETE WORKING SET LIST ENTRY 29-SEP-1988 11:26:39 {SYS .SRC] PAGEFAULT .MAR;1 


1996 
1997 
1998 
1999 
2000 
2001 
2002 
2003 
2004 
2005 
2006 
2007 
2008 
2009 
2010 
2011 
2012 
2013 
2014 
2015 
2016 
2017 
2018 
2019 
2020 
2021 
2022 
2023 
2024 
2025 
2026 
2027 
2028 
2029 
2030 
2031 
2032 
2033 
2034 
2035 


e 
, 
e 
ao 
se 
o 
e 
a 
e 
? 
° 
’ 
e 
’ 
e 
’ 
e 
co 
e 
” 
e 
o 
e 
o 
e 
oe 
° 
a 
° 
’ 
e 
o 
e 
’ 
° 
e 
° 
a 
° 
a 
e 
’ 
e 
’ 
e 
&’ 
e 
ae 
e 
a’ 
e 
o 
° 
& 
e 
’ 
e 
ao 
’ 
e 
a’ 
e 
’ 
’ 
? 
’ 


ao 


e 
o 


.SBTTL DELWSLEX - DELETE WORKING SET LIST ENTRY BY INDEX 
++ 
FUNCTIONAL DESCRIPTION: 


THIS ROUTINE DELETES THE WORKING SET LIST ENTRY INDEXED BY 
R1, AND PLACES THE WORKING SET LIST ENTRY ON THE FREE LIST. 


CALLING SEQUENCE: 


JSB G“MMGSDELWSLEX 
JSB G“MMGSDELWSLEPPG 


INPUT PARAMETERS : 


R1 = WORKING SET LIST INDEX 

R2 = VIRTUAL ADDRESS IF ENTERING AT DELWSLEPPG 
R4 = PROCESS CONTROL BLOCK ADDRESS 

R5 = PROCESS HEADER ADDRESS 


IMPLICIT INPUTS:° 
NONE 

OUTPUT PARAMETERS: 
RO PRESERVED 

IMPLICIT OUTPUTS: 
NONE 

COMPLETION CODES: 
NONE 

SIDE EFFECTS: 


NONE 


DIGITAL INTERNAL USE ONLY 45 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


8 Page 45 
X-39 DELWSLEX - DELETE WORKING SET LIST ENTRY 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 


2037 -ENABL LSB 

2038 

2039 UNIVERSAL_SYMBOL MMGS DELWSLEX 

2040 ;MMGSDELWSLEX: : 

2041 MOVL (R5) [R1],R2 ;FETCH WORKING SET LIST ENTRY 

2042 EXTZV #WSLSV_PAGTYP, #WSLS$S_PAGTYP,R2,R3 ;GET THE PAGE TYPE 

2043 BEQL 30$ 7BRANCH IF PROCESS PAGE 

2044 CASE R3,<- 7AND DISPATCH ON IT 

2045 30$,- 7;PROCESS PAGE 

2046 45$,- 7SYSTEM PAGE 

2047 10$,- 7;GLOBAL READ ONLY 

2048 10$,- 7GLOBAL WRITABLE 

2049 45$,- 7PROCESS PAGE TABLE 

2050 45$ > 7;GLOBAL PAGE TABLE 

2051 BUG CHECK DELWSLEX, FATAL 7BAD PAGE TYPE 

2052 ; 

2053 ; GLOBAL PAGE, READ ONLY OR WRITABLE. 

2054 ; ‘ 

2055 108: BSBB DECVALWSLECNT 7;DEC VALID WORKING SET LIST ENTRY COUNT 
2056 DECL PCBSL_GPGCNT (R4) 7;ONE LESS GLOBAL PAGE IN WORKING SET 
2057 BRB 50$ 

2058 ; 

2059 ; PROCESS PAGE, R2 = VIRTUAL ADDRESS 

2060 ; 

2061 UNIVERSAL SYMBOL MMGS$DELWSLEP PG 

2062 ;MMGSDELWSLEPPG: : 

2063 308: BSBB DECVALWSLECNT 7;DECREMENT VALID WORKING SET LIST ENTRY CNT 
2064 458: DECL PCBSL_PPGCNT (R4) 7ONE LESS PROCESS PAGE IN WORKING SET 
2065 508: CLRL (R5) [R11] ;FREE THE WORKING SET LIST ENTRY 

2066 RSB 

2067 

2068 -DSABL LSB 

2069 : 

2070 DECVALWSLECNT: 

2071 ADDL3 PHDSL_PTWSLEVAL(R5),R5,R3 ;BASE ADR OF BYTE ARRAY OF COUNTS OF 
2072 7;VALID WSLE’S IN EACH PAGE TABLE 

2073 EXTV #VASV_VPN+7,#VASS_VPN+1-7,R2,R2 ;BITS 16:30 OF VA SIGN EXTENDED 
2074 BGEQ 10$ 7;BRANCH IF PO SPACE 

2075 ADDL G“SGNSGL_PTPAGCNT, R3 7END ADDRESS OF BYTE ARRAY 

2076 108: DECB (R3) [R2] 7;ONE LESS VALID WSLE IN THIS PAGE TABLE 
2077 BGEQ 20$ 7;BRANCH IF PT STILL HAS OTHER VALID WSLE’S 
2078 DECW PHDSW_PTCNTVAL (R5) ;ONE LESS PT WITH VALID WSLE’S 


2079 208: RSB 


46 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 46 
X-39 ININEWPFN - ALLOCATE AND INIT A NEW PFN 29-SEP-1988 11:26:39 [SYS.SRC])PAGFFAULT.MAR;1 ( 
2081 -SBTTL ININEWPFN - ALLOCATE AND INIT A NEW PFN 
2082 ;++ 
2083 ; FUNCTIONAL DESCRIPTION: 
2084 ; 
2085 ; ALLOCATE A NEW PFN AND INITIALIZE THE PFN DATA BASE FOR IT 
2086 ; AND MAKE A WORKING SET LIST ENTRY. 
2087 ; 
2088 ; CALLING SEQUENCE: 
2089 ; 
2090 ; JSB G*“MMGS ININEWPFN 7;ALLOCATE AND INIT NEW PFN 
2091 ; 
2092 ; INPUT PARAMETERS: 
2093 ; 
2094 ; R2 = FAULT VA (LOW BITS = PAGTYP) 
2095 ; R3 = SVAPTE (SLAVE IF GLOBAL) 
2096 ; R4 = PCB ADDRESS (PROCESS IF GLOBAL) 
2097 ; R5 = PROCESS HEADER ADDRESS (PROCESS IF GLOBAL) 
2098 ; 
2099 ; IMPLICIT INPUTS: 
2100 ; 
2101 ; NONE 
2102 ; 
2103 ; OUTPUT PARAMETERS: 
2104 ; 
2105 ; RO = PFN, OR NEGATIVE IF NONE AVAILABLE 
2106 ; 
2107 ; IMPLICIT OUTPUTS: 
2108 ; 
2109 ; NONE 
2110 ; 
2111 ; COMPLETION CODES: 
2112 ; 
2113 ; NONE 
2114 ; 
2115 ; SIDE EFFECTS: 
2116 ; 
2117 ; NONE 
2118 ; 
2119 ;-- 


DIGITAL INTERNAL USE ONLY 47 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


X-39 ININEWPFN - ALLOCATE AND INIT A NEW PFN 29-SEP-1988 11:26:39 [SYS.SRC] PAGEFAULT.MAR;1 
2121 ININEWPFNWAIT: 


2122 POPR #°M<R2, R3,R5> ;RESTORE SAVED REGISTERS 
2123 RSB . ;AND RETURN NO FREE PAGES INDICATION 
2124 | 
2125 UNIVERSAL_SYMBOL MMGS$ ININEWPFN 
2126 ;MMGSININEWPFN: : 
2127 PUSHL R5 ;SAVE PHD 
2128 PUSHL R3 ;SAVE SVAPTE 
2129 PUSHL R2 ;SAVE VA 
2130 BSBW § MMGSALLOCPFN ;ALLOCATE A NEW PFN 
2131 BBS #31,RO, ININEWPFNWAIT ;BRANCH IF NONE AVAILABLE 
2132 MOVO (SP), R2 ;R2=VA, R3=SVAPTE 
2133 CMPV #WSLSV_PAGTYP, #WSL$S_PAGTYP,R2, #PFN$C_GLOBAL ;GLOBAL PAGE? 
2134 BLSS 40$ ;BRANCH IF NOT 
2135 ASSUME PTESV_GPTX EQ 0 
2136 BICL3 #*C<PTESM GPTX>, (R3),R3 ;GLOBAL PAGE TABLE INDEX 
2137 MOVAL @W*MMG$GL_GPTBASE[R3],R3 ;SVAPTE OF MASTER 
2138 MOVL G“MMGSGL_SYSPHD,R5 ;SYSTEM PROCESS HEADER ADR FOR GLOBAL 
2139 40$: BBS #VASV_SYSTEM, R2, 50$ ;DON’ T COUNT PT REF FOR SYSTEM PAGE 
2140 BSBW $$ MMGSINCPTREF ;LOCK PAGE TABLE ENTRY (NOT FOR SYSTEM) 
2141 508: MOVL R3, @W*PFNSAL_PTE [RO] ;STORE PTE ADDRESS 
2142 ASSUME PFNSV_PAGTYP EQ 0 
2143 ROTL #<32-WSLS$V_PAGTYP>,R2,R2 ;POSITION PAGE TYPE FIELD 
2144 BICB3 #*C<PFNS$M_PAGTYP>,R2,@W*PFNSAB_TYPE[RO] ;SET PAGE TYPE 
2145 MOVO (SP)+,R2 ;R2=VA, R3=SVAPTE 
2146 POPL R5 ;R5=PHD 
2147 ; 
2148 ; FALL THROUGH TO G*MMGSMAKEWSLE 
a 


2149 


48 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 48 


X-39 MAKEWSLE ~ MAKE A WORKING SET LIST ENTRY 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 


2151 -SBTTL MAKEWSLE ~ MAKE A WORKING SET LIST ENTRY 

2152 3++ 

2153 ; FUNCTIONAL DESCRIPTION: 

2154 ; 

2155 ; THIS ROUTINE ENTERS SPECIFIED VIRTUAL ADDRESS INTO THE WORKING 
2156 ; SET LIST. IT ASSUMES THAT THERE IS A FREE WORKING SET LIST ENTRY ON THE 
2157 ; FREE LIST. IF THE PAGE IS A GLOBAL PAGE THE SLAVE PAGE TABLE ENTRY IS 
2158 ; LOCKED AT THIS TIME AND THE SHRCNT AND/OR REFCNT IS INCREMENTED. 
2159 3; THIS ROUTINE ALSO KEEPS THE ACTIVE PAGE COUNTERS IN THE PCB (PPGCNT, GPGCNT). 
2160 ; 

2161 ; 

2162 3; CALLING SEQUENCE: 

2163 ; 

2164 ; JSB G“MMGSMAKEWSLE 

2165 ; 

2166 ; INPUT PARAMETERS: 

2167 ;: 

2168 ; RO = PAGE FRAME NUMBER 

2169 ; R2 = VA (LOW BITS = PAGTYP) 

2170 ; R3 = SVAPTE (SLAVE IF GLOBAL) 

2171 ; R4 = PCB ADDRESS (PROCESS IF GLOBAL) 

2172 ; R5 = PHD ADDRESS (PROCESS IF GLOBAL) 

2173 ; 

2174 ; IMPLICIT INPUTS: 

2175 ; ; 

2176 ; FREE WORKING SET LIST CONTAINS AT LEAST ONE ENTRY 

2177 ; 

2178 ; OUTPUT PARAMETERS: 

2179 ; 

2180 ; RO = PFN PRESERVED 

2181 ; 

2182 ; IMPLICIT OUTPUTS: 

2183 ; 

2184 ; NONE 

2185 ; 

2186 ; COMPLETION CODES: 

2187 ; 

2188 ; NONE 

2189 ; 

2190 ; SIDE EFFECTS: 

2191 ; 

2192 ; NONE 

2193 ; 

2194 ;-- 


DIGITAL INTERNAL USE ONLY 49 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


8 Page 49 
X-39 MAKEWSLE - MAKE A WORKING SET LIST ENTRY 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAUlT.MAR; 1 


2196 UNIVERSAL SYMBOL MMGSMAKEWSLE 

2197 s;MMGSMAKEWSLE: : 

2198 MOVL PHDSL_WSNEXT(R5),R1 ;WSLX FOR FREE ENTRY 

2199 

2200 ASSUME WSLSV VALID EQ 0 

2201 BLBS (R5) [R1], 208 ;BRANCH IF ENTRY BUSY, ERROR 

2202 BISL3 #WSLSM_VALID,R2, (R5) [R1] ;STORE NEW WSLE 

2203 

2204 EXTZV #WSLSV_PAGTYP, #WSLSS_PAGTYP, R2,R1 s;EXTRACT THE PAGE TYPE 
2205 BEQL 50$ ;BRANCH IF PROCESS PAGE 

2206 CASE R1, <- 7;AND DISPATCH ON IT 

2207 50$,- 7;PROCESS PAGE 

2208 70$,- ; SYSTEM PAGE 

2209 30$,- 7;GLOBAL READ ONLY 

2210 30$,- ;GLOBAL WRITABLE 

2211 710$8,- ; PROCESS PAGE TABLE 

2212 . 70$ > ;GLOBAL PAGE TABLE 

2213 208: BUG CHECK MAKEWSLE, FATAL 7;BAD PAGE TYPE OR 

2214 ;WSNEXT POINTS TO VALID WSLE 

2215 ; 

2216 ; GLOBAL PAGE, READ ONLY OR WRITABLE 

2217 ; 

2218 308: BSBB MMGS INCPTREF ?LOCK THE SLAVE PAGE TABLE ENTRY 
2219 BSBB INCVALWSLECNT 3 INC VALID WORKING SET LIST ENTRY COUNT 
2220 INCL PCBSL_GPGCNT (R4) ; ANOTHER GLOBAL PAGE IN WORKING SET LIST 
2221 PFN_REFERENCE - 

2222 ACBW <#1, #1, @W*PFNSAX_SERCNT [RO], 80$>, - ;COUNT SHARER, BRANCH IF FIR 
2223 LONG _OPCODE=ACBL, - 

2224 IMAGE=SYS_NONPAGED 

2225 BRB 90$ 

2226 ; 

2227 ; PROCESS PAGE 

2228 ; 

2229 50S: BSBB INCVALWSLECNT 3; INC VALID WORKING SET LIST ENTRY COUNT 
2230 708: INCL PCBSL_PPGCNT (R4) ;ONE MORE ACTIVE PROCESS PAGE IN WSL 
2231 PFN REFERENCE - 

2232 MOVW <PHDS$L_WSNEXT (R5) , @W*PFNSAX_WSLX[RO]>, - 7;SET INDEX TO WSLE 
2233 LONG_OPCODE=MOVL, - 

2234 IMAGE=SYS NONPAGED 

2235 = sONLY FOR PRIVATE PAGES 

2236 


2237 808: INCW Q@W*PFNSAW_REFCNT [RO] 7;ANOTHER REFERENCE FOR THE PAGE 
2238 90S: RSB 


2239 

2240 INCVALWSLECNT: 

2241 ADDL3 PHDSL_PTWSLEVAL(R5),R5,R3 ;BASE ADR OF BYTE ARRAY OF COUNTS OF 
2242 7;VALID WSLE’S IN EACH PAGE TABLE 

2243 EXTV #VASV_VPN+7, #VASS_VPN+1-7,R2,R2 ;BITS 16:30 OF VA SIGN EXTENDED 
2244 BGEQ 10$ 7BRANCH IF PO SPACE 

2245 ADDL G*SGNS$GL_PTPAGCNT, R3 7;BASE ADR TO NEGATIVE INDEX FROM 

2246 108: INCB (R3) [R2] ; ANOTHER VALID WSLE IN THIS PAGE TABLE 

2247 BGTR 20$ 7;BRANCH IF NOT THE FIRST 

2248 INCW PHDSW_PTCNTVAL (R5) 7; ANOTHER PAGE TABLE WITH VALID WSLE’S 


2249 208: RSB 


50 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 50 
- X-39 LOCKPGTB - LOCK PAGE TABLE 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 (22) 

2251 -SBTTL LOCKPGTB - LOCK PAGE TABLE 
2252 3++ 
2253 ; FUNCTIONAL DESCRIPTION: 
2254 ;: 
2255 ; LOCKPGTB TAKES A VIRTUAL ADDRESS, REFERENCES AND 
2256 ; LOCKS THE ASSOCIATED PAGE TABLE, AND RETURNS THE SYSTEM 
2257 ; VIRTUAL ADDRESS OF THE PAGE TABLE ENTRY. IT IS CALLED 
2258 ; WITH IPL = ASTDEL OR LOWER AND RETURNS WITH IPL = SYNCH. 
2259 3; 
2260 ; CALLING SEQUENCE: 
2261 ; 
2262 ; JSB G“MMGSLOCKPGTB 
2263 ; 
2264 ; INPUT PARAMETERS: 
2265 ; 
2266 ; R2 = VIRTUAL ADDRESS ; 
2267 ; R4 = PROCESS CONTROL BLOCK ADDRESS 
2268 ; R5 = PROCESS HEADER ADDRESS (P1 SPACE IF PROCESS PCB, 
2269 ; SYSTEM SPACE OF SYSTEM PCB) 
2270 : IPL = ASTDEL OR LOWER 
2271 ; 
2272 ; IMPLICIT INPUTS: 
2273 3; 
2274 ; NONE 
2275 3 
2276 ; OUTPUT PARAMETERS: 
2277 3; 
2278 ; R2 PRESERVED 
2279 ¢ R3 = SYSTEM VIRTUAL ADDRESS OF PAGE TABLE ENTRY 
2280 ; IPL = SYNCH 
2281 ; 
2282 ; IMPLICIT OUTPUTS: 
2283 ; 
2284 ; PAGE TABLE LOCKED VIA INCPTREF 
2285 ; 
2286 ; COMPLETION CODES: 
2287 ; 
2288 ; NONE 
2289 ; 
2290 ; SIDE EFFECTS: 
2291 ; 
2292 ; NONE 
2293 ; 
2294 ;-- 
2295 
2296 UNIVERSAL SYMBOL MMGS LOCKPGTB 
2297 s:MMGSLOCKPGTB: : 
2298 BSBW MMGSP TEREF ; REFERENCE PTE, GET SVAPTE 
2299 ;RETURNS AT IPL=SYNCH 
2300 BLBC RO, INCPTREF BUG ;BRANCH IF LENGTH VIOLATION 
2301 ; 
2302 ; FALL THROUGH TO G*MMGSINCPTREF 
2303 ; 


DIGITAL INTERNAL USE ONLY 51 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION ~ 


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


X-39 INCPTREF - INCREMENT PAGE TABLE REFERENC 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR; 1. 


2305 -SBTTL INCPTREF - INCREMENT PAGE TABLE REFERENCE COUNT 
2306 ;++ 

2307 ; FUNCTIONAL DESCRIPTION: 

2308 ; 

2309 ; THIS ROUTINE ACCEPTS THE ADDRESS OF A PAGE TABLE ENTRY AND 
2310 ; LOCKS THE ASSOCIATED PAGE TABLE INTO MEMORY. IT ALSO MAINTAINS THE 
2311 ; COUNT OF SUCH LOCKED PAGE TABLES IN THE PROCESS HEADER VECTOR. 
2312 ; 

2313 ; CALLING SEQUENCE: 

2314 ;. 

2315 ; JSB G“MMGS INCPTREF 

2316 ; 

2317 ; INPUT PARAMETERS: 

2318 ; 

2319 ; R3 = SYSTEM VIRTUAL ADDRESS OF PAGE TABLE ENTRY (MASTER IF GLOBAL) 
2320 ; R5 = PROCESS HEADER ADDRESS (SYSTEM IF GLOBAL) 

2321 ; 

2322 ; IMPLICIT INPUTS: 

2323 ; 

2324 3; NONE 

2325 ; 

2326 ; OUTPUT PARAMETERS: 

2327 ; 

2328 ; RO,R2,R3 PRESERVED 

2329 ; 

2330 ; IMPLICIT OUTPUTS: 

2331 ; 

2332 ; NONE 

2333 ; 

2334 ; COMPLETION CODES: 

2335 ; 

2336 3; NONE 

2337 ; 

2338 ; SIDE EFFECTS: 

2339 ; 

2340 ; NONE 

2341 ; 

2342 ;-- 


52 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 52 


X-39 INCPTREF - INCREMENT PAGE TABLE REFERENC 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 


2344 UNIVERSAL SYMBOL MMGS INCPTREF 

2345 sMMGSINCPTREF:: 

2346 EXTZV #VASV_VPN, #VASS_VPN, R3,R1 ;GET PAGE NUMBER OF PT CONTAINING THIS PTE 
2347 ; 

2348 ; ***** WARNING ***** THE FOLLOWING DEPENDS ON GPTBASE = SPTBASE 

2349 ; - 

2350 MOVL @W*MMGSGL_SPTBASE[R1],R1 ;PTE FOR PAGE TABLE 

2351 BGEQ 208 ;DISASTER IF NOT VALID 

2352 ASSUME PTESV_PFN EQ 0 

2353 BICL #°C<PTESM_PFN>, R1 7;GET PAGE FRAME NUMBER 

2354 CMPL R1, G*MMGS$GL_MAXPFN 3; IS THERE PFN DATABASE? 

2355 BGTR 5$ 3; NO, SKIP INCREMENT 

2356 PFN REFERENCE - 

2357 ACBW <#1, #1, QW*PFNSAX_SHRCNT[R1],10$>, - z;INC SHRCNT, BRANCH IF FIRST 
2358 LONG_OPCODE=ACBL, - 

2359 IMAGE=SYS_ NONPAGED 

2360 5S: RSB 

2361 ; 

2362 ; SHARE COUNT JUST WENT FROM O TO 1 INDICATING THAT THE FIRST ACTIVE 
2363 ; PAGE TABLE ENTRY WAS JUST PLACED IN THE PAGE TABLE 

2364 ; 

2365 ; ASSUMPTION HERE IS THAT THIS ROUTINE IS NOT CALLED FOR SYSTEM PAGE TABLES 
2366 ; THIS IS EITHER A PROCESS OR GLOBAL PAGE TABLE. 

2367 ; 

2368 108: PFN_ REFERENCE — 

2369 MOVZWL <@W*PFNSAX_WSLX[R1],R1>,- ;WORKING SET LIST INDEX 
2370 LONG _OPCODE=MOVL, - 

2371 IMAGE=SYS_ NONPAGED 

2372 BISL #WSLSM_WSLOCK, (R5) [R1] ;SET WORKING SET LOCKDOWN BIT 
2373 INCW PHDSW_PTCNTACT (R5) s;ANOTHER ACTIVE PAGE TABLE 

2374 MOVZWL | PHDSW_PHVINDEX (R5) , R1 ;PROCESS HEADER VECTOR INDEX 
2375 INCW @PHVSGL_REFCBAS [R1] ;COUNT ANOTHER PAGE TABLE LOCKED 
2376 RSB 

2377 3; 

2378 ; PAGE TABLE PAGE WAS NOT VALID 

2379 ; 

2380 208: 

2381 INCPTREFBUG: 

2382 BUG CHECK INCPTREF, FATAL ;PAGE TABLE NOT VALID 

2383 ~ ; LENGTH VIOLATION FROM LOCKPGTB 


DIGITAL INTERNAL USE ONLY 53 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


_ PAGEFAULT - TRANSLATION NOT VALID EXCEPTION HANDLE 10-MAY-1989 16:31:05 VAX MACRO V5.0- 
8 Page 53 
X~-39 DECPTREF - DECREMENT PAGE TABLE REFERENC 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFANT.T.MAR;1 


2385 -SBTTL DECPTREF - DECREMENT PAGE TABLE REFERENCE COUNT 
2386 ;++ 

2387 ; FUNCTIONAL DESCRIPTION: 

2388 ; . 

2389 ; THIS ROUTINE DECREMENTS THE REFERENCE COUNT FOR THE PAGE TABLE 
2390 ; CONTAINING THE PAGE TABLE ENTRY ADDRESSED BY R3. IF THE RESULTING REFERENCE 
2391 ; COUNT INDICATES THAT NO MORE PAGE TABLE ENTRIES ARE IN USE, THE PROCESS 
2392 ; HEADER VECTOR REFERENCE COUNT IS DECREMENTED AS WELL INDICATING A 
2393 ; FREE PAGE TABLE 

2394 ; 

2395 ; CALLING SEQUENCE: 

2396 ; 

2397 ; JSB G“MMGSDECPTREF 

2398 ; 

2399 :; INPUT PARAMETERS: 

2400 ; 

2401 ; R3 = SYSTEM VIRTUAL ADDRESS OF PAGE TABLE. ENTRY 

2402 ; 

2403 ; IMPLICIT INPUTS: 

2404 ; 

2405 ; NONE 

2406 3; 

2407 ; OUTPUT PARAMETERS: 

2408 ¢ 

2409 ; RO,R2,R3 PRESERVED 

2410 ; 

2411 : IMPLICIT OUTPUTS: 

2412 ; 

2413 ; NONE 

2414 ; 

2415 ; COMPLETION CODES: 

2416 ; 

2417 ; NONE 

2418 ; 

2419 ; SIDE EFFECTS: 

2420 ; 

2421 ; NONE 

2422 ; 

2423 3;-- 


54 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 54 

X-39 DECPTREF - DECREMENT PAGE TABLE REFERENC 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 
2425 UNIVERSAL_SYMBOL MMGSDECPTREF 

2426 :MMGSDECPTREF: : 

2427 EXTZV #VASV_VPN, #VASS_VPN,R3,R1 ;INDEX TO SPT ENTRY FOR PAGE TABLE 
2428 MOVL @W*MMGSGL_SPTBASE[R1],R1 7;PTE FOR PAGE TABLE 

2429 BGEQ 40$ 7;BRANCH IF NOT VALID, ERROR 

2430 ASSUME PTESV_PFN EQ 0 

2431 BICL #°C<PTESM_PFN>, R1 ;GET PAGE FRAME NUMBER FOR PAGE TABLE 
2432 CMPL R1, G“MMG$GL_MAXPFN 7;IS THERE PFN DATA BASE FOR THIS PAGE? 
2433 BGTR 20$ 7;NO, SKIP DECREMENT 

2434 DECSHR PFN=R1,GTR=20$S,- 7;ONE LESS ACTIVE PTE IN THIS PT 

2435 IMAGE _FLAG=SYS_NONPAGED 

2436 ; 

2437 : SHARE COUNT JUST WENT TO 0, THIS PAGE TABLE IS NO LONGER REQUIRED 

2438 ; TO REMAIN RESIDENT 

2439 ; R1 = PFN FOR PAGE TABLE PAGE 

2440 ; 

2441 PUSHL RO ;SAVE THIS REGISTER 

2442 PFN_REFERENCE - 

2443 MOVZWL <@W*PFNSAX_WSLX[R1],RO>,- ;USE IT TO HOLD THE WORKING SET LIST 
2444 LONG_OPCODE=MOVL, - 

2445 IMAGE=SYS_NONPAGED 

2446 MOVL G*MMGSGL_SYSPHD,R1 ;ADDRESS OF SYSTEM HEADER 

2447 CMPL R3,R1 7PTE ADR IN SYSTEM HEADER? 

2448 BGEQU 10$ 7;BRANCH IF YES, GLOBAL PAGE TABLE 
2449 SUBL3 G*SWP$GL_BALBASE,R3,R1 ;ADR RELATIVE TO BEGIN OF BAL SET 
2450 DIVL G“SWP$GL_BSLOTSZ, R1 7PROCESS HEADER INDEX 

2451 ASHL #-9,R1,R1 ;DIVIDE BY PAGE SIZE 

2452 BSBB MMGSDECPHDREF 1 ;DECREMENT PROCESS HEADER REFERENCE COUNT 
2453 MULL G“SWPS$GL_BSLOTSZ, R1 ;CONVERT PROCESS HEADER INDEX 

2454 ROTL #9,R1,R1 ;MULL BY PAGE SIZE | 

2455 ADDL G*SWPSGL_BALBASE, R1 7;TO PROCESS HEADER ADDRESS 

2456 108: BICL #WSLSM_WSLOCK, (R1) [RO] ;SHUT OFF WORKING SET LOCK 

2457 DECW PHDS$W_PTCNTACT (R1) 7ONE LESS ACTIVE PAGE TABLE 

2458 BLSS 40$ 7;BRANCH IF ERROR 

2459 POPL RO ;RESTORE SAVED REGISTER 

2460 208: RSB ;AND RETURN 

2461 ; 

2462 ; PAGE TABLE PTE NOT VALID, OR PAGE TABLE REFERENCE COUNT IS BAD 

2463 ; OR PTCNTACT WENT NEGATIVE 

2464 ; 

2465 408: BUG CHECK DECPTREF, FATAL ;ERROR IN DECPTREF 


DIGITAL INTERNAL USE ONLY 55 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


X-39 DECPHDREF - DECREMENT PROCESS HEADER REF 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 


2467 -SBTTL DECPHDREF - DECREMENT PROCESS HEADER REFERENCE COUNT 
2468 st++ 

2469 ; FUNCTIONAL DESCRIPTION: 

2470 ; 

2471 ¢ DECPHDREF REDUCES THE PROCESS HEADER REFERENCE COUNT AND INFORMS 
2472 ; THE SWAPPER IF THE COUNT GOES TO ZERO. THIS COUNT IS RAISED ONCE 
2473 ; FOR EACH REASON THAT A GIVEN SPT ENTRY IS BUSY NOT COUNTING THE 
2474 ; WORKING SET LIST ENTRY REFERENCE. THE FOLLOWING ARE REASONS WHY 
2475 3; THE REFERENCE COUNT IS INCREASED FOR A GIVEN PAGE TABLE PAGE. 
2476 ; 1. PLACED ON THE FREE OR MODIFIED LIST 

2477 ; 2. READ OR WRITE IN PROGRESS 

2478 ; 3. SHARE COUNT IS ABOVE O, I.E. IT CONTAINS ACTIVE PTE’S 
2479 ; THE REFERENCE COUNT IS DECREASED UNDER THE FOLLOWING CONDITIONS: 
2480 ; 1. SHARE COUNT DECREASED FROM 1 TO 0, I.E. LAST PTE GONE 
2481 ; 2. READ OR WRITE COMPLETE 

2482 ; 3. PAGE CONTENTS DELETED (DELCONPFN) 

2483 ; 4. FAULTED: OUT OF TRANSITION STATE. 

2484 ; 

2485 ; CALLING SEQUENCE: 

2486 ; 

2487 ; JSB MMGSDECPHDREF 7;R5 = PROCESS HEADER ADDRESS 
2488 ; JSB MMGSDECPHDREF 1 7R1 = PROCESS HEADER VECTOR INDEX 
2489 ; 

2490 ; INPUT PARAMETERS: 

2491 ; 

2492 ; DECPHDREF 

2493 ; R5 = PROCESS HEADER ADDRESS FOR PAGE TABLE PAGE 

2494 ; 

2495 ; DECPHDREF1 

2496 ; R1 = PROCESS HEADER VECTOR INDEX 

2497 ; 

2498 ; IMPLICIT INPUTS: 

2499 ; 

2500 ; NONE 

2501 ; 

2502 ; OUTPUT PARAMETERS: 

2503 ; 

2504 3; DECPHDREF 

2505 ; ONLY R1 ALTERED 

2506 3; 

2507 ; DECPHDREF1 

2508 3; ALL REGISTERS PRESERVED 

2509 ; 

2510 ; IMPLICIT OUTPUTS: 

2511 ; 

2512 ; NONE 

2513 ; 

2514 ; COMPLETION CODES: 

2515 ; 

2516 ; NONE 

2517 ; 

2518 ; SIDE EFFECTS: 

2519 ; 

2520 ; NONE 

2521 ; 

2522 7-- 

2523 


56 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 56 | i 
X-39 DECPHDREF - DECREMENT PROCESS HEADER REF 29-SEP-1988 11:26:39 [SYS.SRC]PAGEFAULT.MAR;1 


2524 UNIVERSAL_SYMBOL MMGS$DECPHDREF 

2525 ;MMGSDECPHDREF: : 

2526 MOVZWL PHD$W_PHVINDEX(R5),R1 ;PROCESS HEADER VECTOR INDEX 

2527 UNIVERSAL_SYMBOL MMG$DECPHDREF1 

2528 ;MMGS$DECPHDREF1: : | 

2529 DECW #§ @PHVS$GL_REFCBAS[R1] ;COUNT ONE LESS REFERENCE . 
2530 BEQL 10$ ;BRANCH IF THAT WAS THE LAST REFERENCE 
2531 RSB | 
2532 108: LOCK § LOCKNAME=SCHED ;LOCK SCHED DATABASE 

2533 JSB G* SCHSSWPWAKE ; INFORM THE SWAPPER, HEADER MAY GO 
2534 UNLOCK LOCKNAME=SCHED, - ;UNLOCK SCHED DATABASE | 

2535 CONDITION=RESTORE ;JUST RESTORE OWNERSHIP COUNT 

2536 ; NO IPL CHANGE 

2537 RSB 


DIGITAL INTERNAL USE ONLY 57 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


8 Page 57 


X-39 INIBLDPKT - INIT FOR CALLING BIILDPKT 29-SEP-1988 11:26:39 [SYS.SRC] PAGEFAULT. MAR; 1 (2€ 


_ 2539 
— 2540 
2541 
2542 
2543 
2544 
2545 
2546 
2547 
2548 
2549 
2550 
2551 
2552 
2553 
2554 
2555 
2556 
2557 
2558 
2559 
2560 
2561 
2562 
2563 
2564 
2565 
2566 
2567 
2568 
2569 
2570 
2571 
2572 
2573 
2574 
2575 
2576 
2577 
2578 
2579 
2580 
2581 
2582 
2583 


we Te Ve Ve Te Ve Ve Ye Ve “eo Ve 


me Ye Se Ne Se Ne Me Me Me Me Me Me Me Ye Ve Ye Ye Ve Ye Yeo Ye Ve Ve Ve 


“eo “Se Se Ne 


we Me Ve Ve Ye 


-SBTTL INIBLDPKT - INIT FOR CALLING BUILDPRT 


+ 
+ 


FUNCTIONAL DESCRIPTION: 


THIS ROUTINE SETS UP RO-R2 FOR A SINGLE PAGE READ/WRITE 
TO THE ADDRESS SPECIFIED BY THE BACKING STORE ADDRESS. 


CALLING SEQUENCE: 
JSB G“MMGSINIBLDPRT 
INPUT PARAMETERS: 
R2 = BACKING STORE ADDRESS 
R3 = PAGE TABLE ENTRY ADDRESS (MASTER IF GLOBAL) 
R5 = PROCESS HEADER ADDRESS (SYSTEM HEADER IF GLOBAL PAGE) 
THIS IS ONLY USED FOR SECTION TYPE BACKING STORE ADDRESSES. 
IF THE BACKING STORE ADDRESS: IN R2° IS. KNOWN TO: BE A. 
PAGING FILE ADDRESS, THEN IT SELF DESCRIBES AND THIS 
PARAMETER IS IGNORED. 
IMPLICIT INPUTS: 
NONE 
OUTPUT PARAMETERS: 
RO = VIRTUAL BLOCK NUMBER 
Rl = SECTION OR PAGE FILE CONTROL BLOCK ADDRESS 
R2 = WINDOW ADDRESS | 
R3 = PAGE TABLE ENTRY ADDRESS. (PRESERVED) 
IMPLICIT OUTPUTS: 
NONE 
COMPLETION CODES: 
NONE 
SIDE EFFECTS: 


NONE 


58 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 58 


X-39 INIBLDPKT - INIT FOR CALLING BUILDPKT 29-SEP-1988 11:26:39 [(SYS.SRC]PAGEFAULT.MAR;1 (2¢ 
UNIVERSAL SYMBOL MMGS$ INIBLDPKT © 


2585 
2586 
2587 
2588 
2589 
2590 
2591 
2592 
2593 
2594 
2595 
2596 
2597 
2598 
2599 
2600 
2601 
2602 
2603 
2604 
2605 
2606 
2607 
2608 
2609 
2610 
2611 
2612 
2613 
2614 
2615 


#MMGSINIBLDPRT: : 


BBS 
BBS 
EXTZV 
MOVL 
ASSUME 
BICL3 
BNEOQ 


°o 
a 
ee 


WA) se Se Se ft Ne Ne Ne 


OS: CVTWL 
ADDL3 
MOVAL 
SUBL3 
ASHL 
ASSUME 
BICL3 
SUBL 
40S: 
ASSUME 
ASSUME 
ADDL 
MOVL 
RSB 


#PFNSV_GBLBAK, R2, 10$ ;NOT AN I/O ADDRESS IF GBL BAK 
#PTESV_TYPO,R2,20$ ;BRANCH IF SECTION ADDRESS 
#PFNSV_PGFLX, #PFNSS_PGFLX,R2,R1 ;PAGE FILE INDEX 
@W“MMGSGL_PAGSWPVC[R1],R1 ;PAGE FILE CONTROL BLOCK ADDRESS 
PTESV_PGFLVBN EQ 0 

#°C<PTESM PGFLVBN>,R2,RO ;PAGE FILE VBN 

40$ BRANCH IF GOOD VBN 


INVALID BACKING STORE ADDRESS FOR I/0 
BUG CHECK IVBAKADIO, FATAL 7; INVALID BACKING STORE ADR FOR 1/0 


SECTION TABLE BACKING STORE ADDRESS 


R2,R2 7SECTION TABLE INDEX 

PHDS$L_PSTBASOFF (R5),R5,R1 ;SECTION TABLE BASE ADDRESS 

(R1) [R2],R1 *;SECTION TABLE ENTRY ADDRESS 
PHDSL_POBR(R5) , R3, RO 7BYTE OFFSET FROM BASE OF PAGE TABLE 
#-2,R0,RO 7LONG WORD INDEX FROM PAGTBL BASE 


SECSV_VPX EQ 0 
#°C<SECSM_VPX>, SECSL_VPXPFC(R1),R2 ;VIRTUAL PAGE NUMBER 
R2, RO 7RELATIVE PAGE IN SECTION 


SEC$L_VBN EQ PFLSL_VBN 

SEC$L_WINDOW EQ PFLS$L_WINDOW 
SEC$L_VBN(R1) , RO ;FORM FILE VBN 
SEC$L_WINDOW(R1) , R2 ?FILE WINDOW 


DIGITAL INTERNAL USE ONLY 59 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


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


2617 -SBTTL MMGSSWITCH PRCPGFL ~ Switch process pagefile 

2618 7++ 

2619 ; FUNCTIONAL DESCRIPTION: 

2620 ; 

2621 ; This routine is called after a failure to allocate page file 

2622 ; backing store for the current PROCESS page file. It reserves 

2623 ; an additional number of pages in the BEST, available PROCESS 

2624 ; page file. 

2625 ; 

2626 ; CALLING SEQUENCE: 

2627 ; 

2628 ; BSBx/JSB MMGSSWITCH_ PRCPGFL 

2629 ; 

2630 ; INPUT PARAMETERS: 

2631 ; 

2632 ; R5 = Process header address (system header if global page) 

2633 ; 

2634 ; IMPLICIT INPUTS: 

2635 3 

2636 ; PHDSW_PRCPGFLPAGES assumed to be -1 

2637 ; (i.e., called just after failure to allocate backing store) 

2638 ; 

2639 ; OUTPUT PARAMETERS: 

2640 ; 

2641 ; NONE 

2642 ; 

2643 ; IMPLICIT OUTPUTS: 

2644 ; 

2645 ; Switch to BEST PROCESS pagefile, which can be any one of the 

2646 ; existing assignments (including the current one on entry), or 

2647 ; a new assignment resulting from calling MMGSASNPRCPGFL. 

2648 ; 

2649 ; NB: All process header fields are correctly set to allow the caller to 
2650 ; immediately allocate page file backing store. It is assumed that 
2651 ; PHDSW_PRCPGFLPAGES is not decremented again in the caller’s 

2652 ; assignment retry logic. 

2653 ; 

2654 ; COMPLETION CODES: 

2655 ; 

2656 ; NONE 

2657 ; 

2658 ; SIDE EFFECTS: 

2659 ; 

2660 ; NONE 

2661 ; 

2662 7-- 

2663 

2664 UNIVERSAL SYMBOL MMGS$ SWITCH_PRCPGFL 

2665 sMMGSSWITCH PRCPGFL:: 

2666 MOVOQ RO, -(SP) 7 Save working registers 
2667 MCOMW PHDSW_PRCPGFLPAGES (R5) ,RO 7 Reservable page count = -1 ? 
2668 BNEQ 30$ 3 Bugcheck if not... 

2669 MOVZBL PHDS$B_PRCPAGFIL(R5),- (SP) 7; Save current assignment 
2670 BSBW MMGSASNPRCPGFL 3; Make BEST pagefile current 
2671 POPL RO 7 Retrieve old assignment and 
2672 CVTWL $PHDSW PRCPGFLOPAGES (R5),R1 7 # pages with backing store 
2673 BLSS 40$ 7 Bugcheck if page count < 0 


60 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 60 

X-39 MMGSSWITCH_PRCPGFL - Switch process page 29-SEP-1988 11:26:39 (SYS.SRC]PAGEFAULT.MAR;1 
2674 SUBL2 R1,PHDS$L_PRCPGFLREFS (R5) [RO] ? Adj. page cnt. for prev. file 
2675 BLSS 40$ : ? Bugcheck if ref count < 0 
2676 CLRW PHDSW_PRCPGFLOPAGES (R5) # Show no current allocation 
2677 MOVL G“MMGSGL_RSRVPAGCNT, R1 7 # pages to reserve 

2678 BSBW MMGSRSRVPRCPGFL2 7 Reserve the pages 

2679 208: MOVQ (SP) +,R0 # Restore working registers 
2680 RSB 7 and return 

2681 

2682 308: BUG CHECK NOPRCPGFL, FATAL 

2683 — ; 

2684 40S: BUG CHECK BADPRCPGFLC, FATAL 

2685 

2686 -END 


_ DIGITAL INTERNAL USE ONLY 61 


CONFIDENTIAL AND PROPRIETARY _ 
DIGITAL EQUIPMENT CORPORATION 


2 WRTMFYPAG.LIS 


WRIMFPYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 0 
Table of contents 


(2) 166 DECLARATIONS 

(3) 312 Modified page writer initialization 

(4) 388 MODIFIED PAGE WRITE COMPLETION AST 

(5) 575 WRTMFYPAG - WRITE MODIFIED PAGES 

(6) 1117 GETPFNCTX 

(7) 1255 PTESCAN - SCAN ADJACENT PTE’S 

(8) 1403 PURGEMPL - Setup to selectively flush pages from MPL 
(9) 1589 MMGSMPW_END - Terminate current MPW thread 

(10) 1712 PURGEMPL CLEANUP ~ Remove any DEAD MPL purge requests 


62 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0~-8 Page 1 
X-26 5-APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 (2) 


ODI auewWwhd 


“we Ne Se Se Se Se Ne Ne Ne Ne te Ne Me Ne Te Ne Se Ne Me Ne Ne 


MODIFIED BY: 


X-26 SSA0017 Stan Amway 5-Apr-1989 
Rework error handling in I/O completion code to 
accomodate failures due to VBN mapping failures. 
Normally, these should not occur. However, for pages 
with section backing store, some file space management 
operations (notably file extension) can cause the 
the window control blocks to be in a state where 
mapping failures are possible. 


Change table in comments that preface MMGSMPW_END 
to reflect algorithmic changes made in X-25. 


X-25 SSA0016 Stan Amway 15-Mar-1989 
Several miscellaneous fixes in MMGSPURGEMPL and 
MMGSMPW_END. Change ’HALT’s to ‘'BUG CHECK’s. 


X-24 SSA0015 Stan Amway 10-Aug-1988 
In MMGSPURGEMPL, accept optional parameter 


a* 


a ee ae ee a ae a ee a a es 


TITLE WRITMFYPAG ~- WRITE MODIFIED PAGES 
»IDENT 'X-26' 
; PERF STATS=1 
; DEBUG=*X00000002 
JIGS IESG IO IOI ISIS IS IO IO IO IO IO IOI IO IOI TOIT OTT IO IST IIIS TI IIT TOT TO IAI II IIE 
o%* ; 
eo 
7;* COPYRIGHT (c) 1978, 1980, 1982, 1984, 1987 BY 
7* DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. 
7;* ALL RIGHTS RESERVED. 
3* 
?* THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED 
7* ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE 
3* INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER 
7* COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY 
3;* OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY 
7* TRANSFERRED. 
3* 
;* THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE 
;* AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT 
;* CORPORATION. 
ox 
’ 
7* DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS 
3;* SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. 
3* 
3* 
ZK IK IKKE IRIE IKK KK IKKE IK EE KK EKIKIK HERE REE REA EK REE REREKRIEHEKEREKKREKEKEEKKEKE 
r++ 
; FACILITY: 
Hi 
+ ABSTRACT: 
Hi 
; ENVIRONMENT: 
rf 
; AUTHOR: PETER H. LIPMAN , CREATION DATE: 3-JAN-77 


DIGITAL INTERNAL USE ONLY 63 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 2 
X-26 5-APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 (2) 


59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
107 
108 
109 
110 
lil 
112 
113 
114 
115 


we Ve Se Ne Ye Ne 


we Ne Ne Me Se Ne Ye Te Ne Ne Ne 


ws Ye Ye Ve Ve Ve Ye Ve Ne Ve Ve Veo Vo Ne Vo No Ve “We Ve 


we Ne Ne Te Te Te Ve Ve Ve Ve Ve Ye “Ve Ne Yo Ve 


we Ne Ve Veo Ne 


X~-23 


X~22 


~21 


X-20 


X-19 


x-18 


X-17 


X-16 


X-15 


X-14 


X-13 


X-12 


X-11 


X-10 


for MAINTAIN request. 


SSA0014 Stan Amway 11-Jul-1988 
Rework MPL threshold checking logic. 


SSA0013 Stan Amway 24-Jun-1988 
Cleanup MMG locking: remove CONDITION=RESTORE in 

UNLOCK macro invocations; avoid a benign, but superfluous 
LOCK request at label GET _NXT_CLUSTER_1. 


SSA0012 Stan Amway 14-Jun-1988 
Bound latency (IPL SYNCH, MMG lock) of list processing. 


SSAO0011 Stan Amway 19-Apr-1988 
Add routine MMGSPURGEMPL to selectively purge pages 
from the modified list. Add logic to MMGSWRTMFYPAG 
to process list based upon any outstanding criteria 
established by MMGSPURGEMPL.. 


JDC0387 Jon Callas 14-APR~-1988 
Chase the GSD-delete queue properly. 


wMc0017 Wayne Cardoza 8-Mar-1988 


Properly synchronize with swapper when pages with SWPVBN are 
being written. 


SSA0010 Stan Amway 16-Nov-1987 
Reduce the probability (to practically 0) of the SWAPPER 
being placed into the FPG or other PFN-depletion related 
wait states during GSD cleanup. This change complements 
the one in X-15. 


SSA0009 Stan Amway 6-Nov-1987 
Prevent SWAPPER from being placed in RWMPB wait state 
due to page faulting during GSD cleanup. 


SSA0008 Stan Amway 6~-Oct-1987 
Reinstate code that reenables threshold checking 
(removed in X-13). Remove setting/clearing of 
PCBSV_SWPVBN in PCBSL_STS. It was never used, 

and with multi-threading, a single bit is not adequate. 
Correctly handle SWPVBN pages when PFLMAP has 

been allocated. 


JDC0357 Jon Callas 16-APR-1987 
Add support for cleaning the delete-pending GSD queue. 
Use ADAWI to modify PCBSW_DIOCNT. 


SSA0007 Stan Amway 5-Jun-1987 
Handle page file depletion case correctly to avoid 
infinite loop. 


SSAO0006 Stan Amway 18-Mar-1987 
Properly initialize page file allocation failure array. 


SSAO0005 Stan Amway 27-Feb-1987 
Call MPW-specific routines for page file allocation 


64 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 3 
X-26 5-APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 (2) 


116 ; and deallocation. 

117 ; 

118 ; xX-9 SSA0004 Stan Amway 4-Nov-1986 
119 ; Force MPW_LOWAITLIMIT >= MPW_LOLIMIT. 

120 ; Add support for multiple pagefiles per process. 

121 ; 

122 ; X-8 SSA0003 Stan Amway 13-Oct-1986 © 
123 ; Call EXESBLDPKTMPW, instead of EXESBLDPKTSWPW. 

124 ; ; 

223° 5 X-7 RNGOO07 Rod Gamache 8-Oct-1986 
126 ; Acquire MMG spinlock at appropriate times. 

127 ; . 

128 ; X-6 RNGOOO6 Rod Gamache 24-Sep-1986 
129 ; Unlock MMG before initiating MP write operation. 

130 ; 

131 ; v04-005 SSA0002 Stan Amway 11-Sep-1986 
132 ; Reinstate the optimization to initially test the 

133 ; modified page count without raising IPL to SYNCH 

134 ; and acquiring the MMG spinlock. 

135 ; 

136 ; v04-004 SSA0001 Stan Amway 22-Aug-1986 
137: 3 Multi-thread modified page writing. 

138 ; 

139 ; Allow modified list processing to continue after page 
140 ; file space allocation failures. 

141 ; 

142 ; When completing an I/0 operation, resume processes in 
143 ; MPW_BUSY wait state when modified page count reaches 
144 ; MPW_LOWAITLIMIT, rather than MPW_LOLIMIT. 

145 ; 

146 ; Keep track of pages with I/O in process. This value 
147 ; is used by code that checks the free list size to get 
148 ; a better estimate of the true free list size. This finesse 
149 ; is now important because of the potential number of such 
150 ; pages due to multi-threading. 

151 ; 

152 ; Add module initialization routine. Logic was formerly 
133.3 in INIT.MAR. 

154 ; 

155 ; X-1D2 wMco001 Wayne Cardoza 12-Feb-1986 
156 ; Make some references G%. 

157 3; 

158 ; V04-002 TCM0002 Trudy C. Matthews 3~Oct-1985 
159 ; Change reference to MPWSGL_BADPAGTOTAL to G*. 

160 ; 

161 ; V04-001 TCMOO01 Trudy C. Matthews 29-Mar-1985 
162 ; Move global data cells in psect $$$210 to SYSDATA.MAR. 
163 ; 

164 ;-- 


DIGITAL INTERNAL USE ONLY 65 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 4 
X-26 DECLARATIONS 5-APR-1989 11:28:29 [SYS.SRC]WRTMFYPAG.MAR;1 (2) 


166 
167 
168 
169 
170 
171 
172 
173 
174 
175 
176 
177 
178 
179 
180 
181 
182 
183 
184 
185 
186 
187 
188 
189 
190 
191 
192 
193 
194 
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 


-SBTTL DECLARATIONS 


INCLUDE FILES: 


we Ye Ne 


SBOOSTATEDEF 
SCADEF 
SCPUDEF 
SDYNDEF 
SGSDDEF 
SINIRTNDEF 
SIRPDEF 
SIPLDEF 
SMPWDEF 
SOPDEF 
SPCBDEF 
SPFLDEF 
SPFLMAPDEF 
SPFNDEF 
SPHDDEF 
SPRDEF 
SPRIDEF 
SPTEDEF 
SRSNDEF 
SSECDEF 
S$SSDEF 
$$SYSTEM PRIM DATADEF 
SVADEF 


MACROS : 


we ‘Se Ne 


.IF DF, DEBUG 

IF EQ, DEBUG-1 
MPW_EVTS$C_ALCIRP=0 
MPW_EVTS$C_WRTPAG=1 
MPW_EVT$C_WRTSEC=2 
MPW_EVT$C_WRTSWP=3 
MPW_EVT$C_WRTDON=4 
MPW_EVT$C_DALIRP=5 


Bootstrap state definitions 
CONDITIONAL ASSEMBLY DEFINITIONS 
PER-CPU DATA BLOCK OFFSETS 
Dynamically allocated structure codes 
Global section descriptor definitions 
System loader init routine definitions 
7I/O REQUEST PACKET DEFINITIONS 
7PROCESSOR PRIORITY LEVELS 

7 Define MPW structures and constants 
;DEFINE OPCODE EQUIVALENT VALUES 
7PROCESS CONTROL BLOCK DEFINITIONS 

7PAGE FILE CONTROL BLOCK DEFINITIONS 

7 Page file mapping window definitions 
7PAGE FRAME NUMBER DATA BASE DEFINITIONS 
7PROCESS HEADER DEFINITIONS. 

7PROCESSOR REGISTER DEFINITIONS 
7PRIORITY INCREMENT CLASS DEFINITIONS 
?;PAGE TABLE ENTRY DEFINITIONS 

7RESOURCE NUMBER DEFINITIONS 

7;SECTION TABLE ENTRY DEFINITIONS 

7 System service return codes 

#DATA PRIVATE TO SYSTEM PRIMITIVES IMAGE 
?VIRTUAL ADDRESS FIELD DEFINITIONS 


se Ne Ne Se Ne 


=e 


.MACRO LOG EVENT EVT, SRC= (SP) , IREG=0 


-LIST MEB 
MOVZBL W*MPWSGB_TRCPTR, R’ IREG 


BISL3 #MPW | EVTS§c _. EVT, SRC, W“MPWSGL_TRCBUF [R’ IREG] 


INCB W*MPWSGB TRCPTR 
eNLIST MEB 

-ENDM 

»ENDC 

-ENDC 


EQUATED SYMBOLS: 


ee Ve Ne 


SVIELD MPW,0,<- 
<SUCCESS, ,M>, - 
<BADPAG, , M>, - 
<NOTDONE, ,M>, - 
<INCSEGTRA, ,M> - 


66 DIGITAL INTERNAL USE ONLY 


7; SUCCESSFUL COMPLETION BIT 

7;THIS PAGE HAD A WRITE ERROR 

7; THESE PAGES WERE NOT WRITTEN 

71/0 incomplete due to VBN map failure 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY~-1989 16:36:29 VAX MACRO V5.0-8 Page 5 
X-26 DECLARATIONS 5-APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 (2) 


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 
248 
249 


250 
251 
252 
253 
254 
255 
256 
257 
258 
259 
260 
261 
262 
263 
264 


> 


MPWSC_MAXREQCNT = 32 


MPWSC_MAXPAGCNT = 128 


se Ne Ne Ne Ye 


OWN STORAGE: 


se Ye Ve 


DECLARE _PSECT 


MPWSGL_SVAPTELOW: : 
-LONG 0,0 
MPWS$GL_SVAPTEHIGH==MPWSGL_SVAPTELOW+4 


MPWSGQ_SVAPTE:: 


- LONG 0(2*MPWSC_MAXREQCNT] 


MPWSAL PTE: : 
- LONG 0 


MPWSAW_PHVINDEX: : 
- LONG 0 


MPWSGL_IRPFL:: 
.LONG 0 


MPWSGL_IRPBL: : 
«LONG 0 


MPWS$GQ_PGFLX_FAIL:: 
-BLKQ 2 


™e Ye Ye 


=e Ye Ve 


EXECSNONPAGED_ DATA 


we Ve 


=e -e Tt) 7 


=e 


Max. no. of pending MPL purge requests 
(NB: must be <= 32 because of ties to 


no. of bits in REQFND/REQFAIL) 


Maximum number of pages to examine 
without releasing MMG spinlock and 
lowering IPL to ASTDEL 


HHKKKKKKKKHEREKKKKEKEKEKKHKEREKEKRKREREKKREKREKKERREKKKHKKEKEKEKEKKEKKKKKKKK 


HEKKKKKKKKNKKKKK THIS ENTIRE MODULE MUST BE RESIDENT *224XxxkekKRREREK 


Pee ESE SLRS SESS ESSE SE EEE SESE SEES SESE SSE ST ELE SESE S ESE ES ES ESET ESS PT ETT ET SS 


Aggregate SVAPTE extent range for 
outstanding MPL purge requests 


Array of SVAPTE ranges for 
outstanding MPL purge requests 


Address of page table entry array 

Address of process header vector index arr 
MPW IRP lookaside list FLINK 

MPW IRP lookaside list BLINK 


Page file allocation failure array 


DIGITAL INTERNAL USE ONLY 67. 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 6 
X-26 DECLARATIONS 5-APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 (2) 


265 
266 
267 
268 
269 
270 
271 
272 
273 
274 
275 
276 
277 
278 
279 
280 
281 
282 
283 
284 
285 
286 
287 
288 
289 
290 
291 
292 
293 
294 
295 
296 
297 
298 
299 
300 
301 
302 
303 
304 
305 
306 
307 
308 
309 
310 


++ 

7 The following two longwords must be adjacent and in fixed order 

MPWSGL_REQFND: : 
-LONG 0 Bit mask of SVAPTE range indices 


found during MPL processing 


we fe 


MPWSGL_REQFAIL:: 
' .LONG 0O Bit mask of SVAPTE range indices 
found during MPL processing, but 


that couldn’t be written 


™e Se Ne 


a, 


MPWSGL_REQIDX:: 


-LONG 0 Current SVAPTE range request index 


ne 


z++ 
3 The following two longwords must be adjacent and in fixed order 
MPWSGL_PAGECOUNT: : 


-LONG 0 7 Pages: examined with MMG lock held 
MPWSGL SAVED _PFN:: 
-LONG 0 ; Current PFN at processing suspension 
3++ 
; The following two bytes must be adjacent and in fixed order 
MPWSGB_STATE:: 7 MPL purge control state 
-BYTE 0 
MPWSGB_REQCNT: : # No. of outstanding MPL purge requests 
-BYTE 0 


, 


MPW$GB_IOCNT: : 


-BYTE 0 7 MPW I/O thread count semaphore 
IF DF, DEBUG 
-IF EQ, DEBUG=-1 


MPWSGB_TRCPTR:: 

-BYTE 0 
-=.+1 
MPWSGL_TRCBUF: : 

- LONG 0[256] 


«ENDC 
-ENDC 


68 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 1LO-MAY~1989 16:36:29 VAX MACRO V5.0-8 Page 7 
X-26 Modified page writer initialization 5-APR-1989 11:28:29 [SYS.SRC]WRTMPYPAG.MAR;1 (3) 


312 
313 
314 
315 
316 
317 
318 
319 
320 


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 
351 
352 
353 
354 
355 
356 
357 
358 
359 
360 
361 
362 
363 
364 
365 
366 
367 
368 


+ 
+ 


™e Se Ne Ye Te Ye Te Se Ve Ve Ye Ye We Ye Ve 


FUNCTIONAL DESCRIPTION: 


_-SBTTL Modified page writer initialization 


This routine is called by the exec loader to initialize all 
data structures and cells required for modified page writing. 


For each modified page writing thread, an MPW I/O request packet 
(MPW IRP) is allocated and linked into a lookaside list. Each MPW 
IRP contains: 


Standard I/O request packet 


Page table entry array 


INITIALIZATION ROUTINE - 


DECLARE PSECT 


DELAY INIT: 


BBCC 


RSB 


MPWSINIT: : 


108: 


128: 


148: 


168: 


208: 


BBC 


PUSHR 
MOVZWL 
BICL 
BNEQ 
MOVL 
MOVW 
MOVW 
MOVL 
CMPL 
BGEQ 
ADDL3 


MPWSINIT 


EXECSINIT_ CODE 


#INIRTNSV_NO_RECALL, - 
(R5) ,10$ 
#SS$ NORMAL, RO 


#BOOSTATES$V_POOL INIT, - 


e 
a 


Process header vector index array 


Do nothing if 


G“EXESGL STATE,DELAY_INIT; non-paged pool not initialized 


#°M<R1,R2, R3> 
G*MPWSGW_MPWPFC, R1 
#7,R1 

10$ 

#16,R1 

R1, G*MPWSGW_MPWPFC 
R1, G*SWPS$GW_SWPINC 
G*SCH$GL_MFYLIM, RO 
G*MPWSGL_WAITLIM, RO 
12$ 

R1,RO, G°*MPWS$GL_WAITLIM 


G*MPWS$GL_LOWAITLIM, R2 
R2, RO 

14$ 

R1,RO, R2 

R2, G*SCH$GL_MFYLOLIM 
16$ 
G*SCH$GL_MFYLOLIM, R2 
R2,G*MPWSGL_LOWAITLIM 


G“MPWS$GB_IOLIM, R3 
R3, #1 

20$ 

#1,R3 

R3, G*MPWSGB_IOLIM 
#7,R1 


we “Ss Se Se Ye Ws we Ve Ne se “eo Ne Me Me Ne 


ve Ne 


=e Ne 


Modified page writer page fault cluster 
Truncate to multiple of 8 

Cannot allow zero 

Use minimum instead 

Reset parameter 

Make swapfile allocation match MPWPFC 


If MPW_WAITLIMIT not >= MPW_HILIMIT, 
force parameter to 
MPW_HILIMIT + MPW_ WRTCLUSTER 


If MPW_LOWAITLIMIT not <= MPW_HILIMIT, 
force parameter to 

MPW_HILIMIT - MPW_WRICLUSTER 

If MPW _LOWAITLIMIT not >= MPW_LOLIMIT, 
force parameter to 

MPW_LOLIMIT 


Maximum MPW concurrent I/O threads 
Insure that value is in range 1-127 


Reset parameter 
Allow bit-level page file allocation 


DIGITAL INTERNAL USE ONLY 69 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 8 
X-26 Modified page writer initialization 5-APR-1989 11:28:29 [SYS.SRC]WRTMPYPAG.MAR;1 (3) 


369 ROTL 
370 MOVAW 
371 MOVAL 
372 MOVAL 
373 308: JSB 
374 BLBC 
375 MOVW 
376 MOVW 
377 

378 INSQUE 
379 INCB 
380 SOBGTR 
381 338: TSTB 
382 BEQL 
383 CLRB 


384 358: MOVL 
385 40$: POPR 
386 RSB 


#2,R1,R4 7 Size of pte array 

IRP§$C_LENGTH(R4) [R1],R1 ; 6 bytes per page to allocate + IRP 
W“MPWSGL_IRPFL, W“MPWSGL_IRPFL 

W“MPWSGL_IRPFL, W“MPWSGL_IRPBL 


G“EXESALONONPAGED ? Allocate the storage 
RO, 33$ 
R1, IRP$W_SIZE (R2) 7 Set structure size 


#<DYN$C_MPWMAP@8 ! DYNS$C_INIT>, - 

IRPS$B_ TYPE (R2) Set structure type 

(R2) , @W*MPWSGL_IRPBL Insert into MPW IRP lookaside list 
W“MPWSGB_IOCNT Show 1 more thread available 


R3, 308 Create a MPW IRP for each I/O thread 
W“MPWSGB_IOCNT At least 1 thread available ? 
40$ BR if no 


Se Ne Ye Ye Ye Ye Vo 


W°MPWSGB_IOCNT 
#SS$_NORMAL, RO 
#°M<R1, R2, R3> 


Set semaphore to initial state 


70 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG ~- WRITE MODIFIED PAGES 10-MAY~-1989 16:36:29 VAX MACRO V5.0-8 Page 9 
X=-26 MODIFIED PAGE WRITE COMPLETION AST 5-APR~-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 (4) 


-SBTTL MODIFIED PAGE WRITE COMPLETION AST 


388 
389 
390 
391 
392 
393 
394 
395 
396 
397 
398 
399 
400 
401 
402 
403 
404 
405 
406 
407 
408 
409 
410 
411 
412 
413 
414 
415 
416 
417 
418 
419 
420 
421 
422 
423 
424 
425 
426 
427 
428 
429 
430 
431 
432 
433 
434 
435 
436 
437 
438 
439 
440 
441 
442 
443 
444 


+ 
+ 


BSBW 


NONE 


NONE 


NONE 


NONE 


se Se Ne Se Se Ne Me Ne Ne Ne Se Ne Ne Se Ye Se Se Ne Te Ne Te Se Ne Te Neo Ye Yeo Ne Te Ye Ne Ne Ye Yo Ye Ye Ys 


SIDE EFFECTS: 


FUNCTIONAL DESCRIPTION: 

THIS ROUTINE IS A KERNEL MODE AST WHICH DOES THE CLEANUP OPERATIONS 
TO COMPLETE THE WRITING OF THE MODIFIED PAGES. IT ALSO STARTS 
THE NEXT MODIFIED PAGE WRITE IF THERE IS ANY TO DO. 


CALLING SEQUENCE: 


WRITEDONE 


INPUT PARAMETERS : 


IPL = ASTDEL 
R5 = AST CONTROL BLOCK = I/O REQUEST PACKET 


IMPLICIT INPUTS: 


OUTPUT PARAMETERS : 


R4, R5 ALTERED 


IMPLICIT OUTPUTS: 


COMPLETION CODES: 


DECLARE _PSECT EXECSNONPAGED_CODE 


-ENABLE LSB 
WRITEDONE : 
PUSHR #°M<R6,R7,R8,R9,R10,R11,AP> ;PRESERVE NON-VOLATILE REGISTERS 
LOCK LOCKNAME=MMG, - 7;LOCK MMG DATABASE FOR PFN CHANGES 
LOCKIPL=#IPL$_ SYNCH, - 7RAISE IPL 
SAVIPL=- (SP), - 7;SAVE CURRENT IPL 
PRESERVE=NO 7 OK to destroy RO 
EXTZV #VASV_VPN, #<16-VASV_VPN>,- ;GET ORIGINAL PAGE COUNT 
IRPS$W_OBCNT (R5) ,R10 
SUBL2 R10,G°MPWSGL_IOPAGCNT ; Show pages no longer in transit 
MOVL IRPS$L_IOST1(R5),R11 7;GET ERROR STATUS AND TRANSFERRED BYTE COUNT 
BICL #<MPWSM_BADPAG!MPWSM_NOTDONE!MPWSM_INCSEGTRA>,R11 ;CLEAR FLAGS 
CMPW IRP$L_IOST1(R5),#SS$_INCSEGTRA ; VBN mapping failure ? 
BNEQ 10$ 
BISL 


108: PUSHL 


#MPWSM_INCSEGTRA, R11 3; Yes, remember this case 
R5 3: Deallocate MPW IRP 


DIGITAL INTERNAL USE ONLY 71 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


/ 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 10 
X-26 MODIFIED PAGE WRITE COMPLETION AST 5-APR-1989 11:28:29 [SYS.SRC]WRTMFYPAG.MAR;1 (4) 


445 
446 
447 
448 
449 
450 
451 
452 
453 
454 
455 
456 
457 
458 
459 
460 
461 
462 
463 
464 
465 
466 
467 
468 
469 
470 
471 
472 
473 
474 
475 
476 
477 
478 
479 
480 
481 
482 
483 
484 
485 
486 
487 
488 
489 
490 
491 
492 
493 
494 
495 
496 
497 
498 
499 
500 
501 


208: 


228: 


258: 


408: 


458: 


508: 
60$: 


~] me Ye Ne 


0S: 


IF 


-IF 
IF 


DF, DEBUG 
EQ, DEBUG-1 


LOG_EVENT EVT=WRTDON 


-ENDC 
-ENDC 
BSBW 
MOVAB 


MOVZWL 
BISL2 
MOVAL 


BGEQ 
BRW 
BITL 
BEQL 
BISB 
CMPZV 


BNEQ 
MOVL 
JSB 


DECREF 
BBC 
BBS 


MOVZBL 
JSB 
INCL 
BRB 
MOVL 
BBS 


BUG CHECK VBNMAPFAIL, FATAL 


JSB 
CVTWL 
BLSS 
MOVL 


DEALLOCATE MPW IRP 
IRP$C_LENGTH(R5) , ~ 
WMPWSAL_PTE 
G“MPWSGW_MPWPFC, RO # Set address of MPW PHV index array 
#7,R0 

QW*MPWSAL_PTE[RO], - 

W*“MPWSAW_PHVINDEX 


Set address of MPW PTE array 


_e 


NB: The addresses just established 
point into the MPW IRP just 
returned to the lookaside list. 


ee Ye Se 


R6 7INIT PTE INDEX 

#<16+VASV_VPN>, #<16-VASV_VPN>,R11,R7 ;TRANSFERRED PAGE COUNT 

20$ ?7BRANCH IF NO PAGES SUCCESSFULLY TRANSFERRED 
90$ 


Q@W“MPWSAL PTE[R6],RO 7;GET PAGE FRAME NUMBER OF NEXT PAGE 

@W*PFNSAB_TYPE[RO],R8 7;PAGE TYPE AND RPTEVT BIT 

QW“MPWSAW _PHVINDEX[R6],R4 ;AND THE CORRESPONDING PROCESS 
?;HEADER VECTOR INDEX 


22$ ?BRANCH IF NOT SWAPVBN WRITE 

200$ 

#<MPWSM_BADPAG ! MPWSM_NOTDONE>,R11 ;NOT SUCCESSFULLY TRANSFERRED? 
25$ #BRANCH IF THIS PAGE IS OK 


#PFNSM_MODIFY, @W*PFNSAB _STATE[RO] ;NOTE PAGE STILL MODIFIED 
#PFNSV_PAGTYP, #PFNSS_PAGTYP,- ;PROCESS PAGE TABLE? 
R8, #PFNSC_PPGTBL 


408 ?7BRANCH IF NOT 

R4,R1 7PROCESS HEADER VECTOR INDEX 

G“MMGSDECPHDREF1 7ONE LESS PROCESS HEADER REF 
7AT PAGE WRITE COMPLETION 

GTR=60$ 7;ONE LESS REFERENCE 


#MPWSV_BADPAG, R11, 50$ ?BRANCH IF NOT PAGE WRITE ERROR PAGE 
#MPWS$V_INCSEGTRA, R11,45$; If VBN map failure, don’t place on bad 
page list; return to modify list 


we Ne 


#PFNSC_BADPAGLST, R2 7;PLACE THIS PAGE 
G“MMGSINSPFNT 7ON THE BAD PAGE LIST 
G*MPWSGL_BADPAGTOTAL 7;COUNT IT 

60$ 


@W“PFNSAL BAK[RO],R9 7Get backing store address 
#PTESV_TYPO,R9, 50$ Continue if section backing store, 
VBN mapping failure should never 
happen for pages destined for a page 


=e “Me Ye Ve 


file 
G“MMGSRELPFN ;RELEASE THE PAGE 
@W“PHVSGL_PIXBAS [R4],R4 ;CALCULATE PCB ADDRESS FROM PHV INDEX 
80$ ;BRANCH IF PCB IS GONE 


@W*SCHSGL_PCBVEC([R4],R4 ;FETCH PCB ADR 


DELPAG IS WAITING FOR THIS WRITE COMPLETION, THE RPTEVT BIT IS SET 


BBC 
BSBW 


#PFNSV_RPTEVT, R8, 80$ ;BRANCH IF NO REPORT EVENT REQUESTED 
RPT _EvT ;ELSE, REPORT THE PFCOM EVENT 


72 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRTMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 11 
X-26 MODIFIED PAGE WRITE COMPLETION AST 5-APR-1989 11:28:29 [SYS.SRC]WRTMFYPAG.MAR;1 (4) 


502 
563 
504 
505 
506 
507 
508 
509 
210 


512 
513 
514 
515 
516 
517 
518 
519 
520 
521 
522 
523 
524 
525 
526 
527 
528 
529 
530 
531 
532 
533 
534 
535 
536 
537 
538 
539 
540 
541 
542 
543 
544 
545 
546 
547 
548 
549 
550 
551 
552 
553 
554 
555 
556 
557 
558 


80S: 
908: 


958: 


100$: 


me Te We 


ft Ne Me 


508: 


NAO ve we Ne 


008: 


2108: 


2208: 


AOBLSS 


BLBS 
INCL 
BBSS 
BRW | 


MOVL 
DECL 
BICB 
BISB 
BRB 
BBS 
UNLOCK 


BRW 


ASSUME 
CLRQ 
ASSUME 
CLRQ 


CLRL 
BRW 


EXTZV 
BBC 
CVTWL 
BLSS 
MOVL 
CMPL 
BNEQ 
DECREF 
INCW 
BRB 
MOVZBL 
JSB 
BRW 


CLRW 
BITL 
BEQL 


BUG CHECK VBNMAPFAIL, FATAL 


R7,R6, 928 ?LOOP THROUGH ALL PAGES 

R11,100$ *BRANCH IF PAGE WRITE HAD NO ERROR 

R7 7;ONE MORE PAGE FOR THE ERROR PAGE 
#MPWSV_BADPAG,R11,95$ 7BRANCH IF ALREADY MARKED BAD 

20$ +BRANCH IF HAVEN’T PROCESSED THE ERROR PAGE 


NOW PROCESS THE UNWRITTEN PAGES IF ANY 


R10,R7 ' ;RESET LIMIT TO ORIGINAL PAGE COUNT 

R6 7IN ORDER TO EXECUTE THE LOOP O OR MORE TIME 
#“°C<MPWSM |_INCSEGTRA>, R11; Save INCSEGTRA flag 

#<MPWSM_SUCCESS ! MPWSM_NOTDONE>, R11 ;COMPLETE THE PAGES NOT TRANSFE 
80$ 

#MPWSV_INCSEGTRA, R1i,150$ ; BR if VBN map failure 


LOCKNAME=MM6G, - 7UNLOCK MMG DATABASE 

NEWIPL=(SP),- *RESTORE PREVIOUS IPL 

PRESERVE=NO + OK to destroy RO 

GET_NXT_CLUSTER # Try to write another I/O cluster 


We have incurred a VBN mapping failure on an I/O segment (a very rare event). 
Quiesce the current modified page writing thread to minimize the probability 
that we’ll have to deal with this case again in the near future. 


MPWSGL_REQFAIL EQ MPWS$GL_REQFND+4 

W“MPWSGL , REQFND 7 Show no pages found/ failed 
MPWSGL_ SAVED _| PFN EQ MPWSGL_PAGECOUNT+4 

W°MPWSGL | PAGECOUNT Show no pages examined 

and no saved PFN 

No MPW IRP allocated yet 
Terminate MPW in orderly fashion 


we Ne Ne 


~ (SP) 
NOMOREPAGES 


‘ee 


PROCESS SWPVBN CASE 


#0, #15,R4,R4 7;FIX UP THE PHV INDEX 
S“#SCHSV_SIP,G*SCH$GB_SIP,220$ ;CONTINUE IF SWAPPER NOT ACTIVE 
@W“PHVSGL , PIXBAS [R4], R2 ;CALCULATE PCB ADDRESS FROM PHV INDEX 


2208 7BRANCH IF PCB IS GONE 

@W*SCHSGL PCBVEC[R2],R2 ;FETCH PCB ADR 

R2,G*SWP$GL_INPCB ;COULD IT BE THIS PROCESS INSWAPPING 
220$ 7NO - JUST PROCEED NORMALLY 

EQL=210$ #MAKE SURE SWAPPER HASN’T HANDLED IT 
QW*PFNSAW_REFCNT[RO] 7;PUT REF COUNT BACK THE WAY IT WAS 
220$ ?;HANDLE PAGE NORMALLY 
#PFNSC_MFYPAGLST, R2 7PUT BACK ON MODIFY LIST 

G*MMGS INSPFNT ;AT TAIL SO WE WON'T SEE IT FOR A WHILE 
70$ 

@W*PFNSAW_SWPVBN[RO] 7ALL DONE WITH THE SWPVBN FIELD 


#MPWSM_INCSEGTRA, R11 
2308 


VBN mapping failure ? 

Continue if not 

VBN mapping failure should never 
happen for pages destined for a swap 
image 


&%e Se Ne Te Ve 


DIGITAL INTERNAL USE ONLY 73 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRITMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 12 
X-26 MODIFIED PAGE WRITE COMPLETION AST 5-APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 (4) 


559 230$: BRW 258 

560 

561 

562 RPT_EVT: 

563 MOVZBL #PRI$_IOCOM, R2 
564 LOCK § LOCKNAME=SCHED, - 
565 LOCKIPL=#IPL$ SYNCH, - 
566 PRESERVE=NO 

567 RPTEVT PFCOM 

568 UNLOCK LOCKNAME=SCHED, - 
569 PRESERVE=NO 

570 

571 RSB 

572 

573 -DISABLE LSB 


74 DIGITAL INTERNAL USE ONLY 


7AND IN THE CASE OF A WRITE ERROR 
7;DO NOT JAM ON THE MODIFY BIT 


71/0 COMPLETE PRIORITY CLASS 
7LOCK SCHED DATABASE FOR RPTEVT 
7;RAISE IPL (already at that IPL) 
3 OK to destroy RO 

7REPORT PAGE FAULT COMPLETE 
7UNLOCK SCHED DATABASE 

3 OK to destroy RO 

7LEAVE IPL AT SYNCH 

3 Return 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRTMFYPAG - WRITE MODIFIED PAGES 10~-MAY~1989 16:36:29 VAX MACRO V5.0-8 Page 13 
X-26 WRIMFYPAG ~ WRITE MODIFIED PAGES 5~APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 (5) 


575 -SBTTL WRTMFYPAG - WRITE MODIFIED PAGES 
576 3++ 

577 ; FONCTIONAL DESCRIPTION: 

578 ; 

579 ; THIS ROUTINE GATHERS A CLUSTER OF PAGES OF LIKE KIND FROM THE 
580 ; MODIFIED PAGE LIST, AND WRITES THEM BACK TO THEIR BACKING STORE ADDRESSES. 
581 ; FOR PAGING FILE PAGES, THE ADDRESSES ARE REALLOCATED AS A CONTIGUOUS BLOCK 
582 ; AND THE PAGES ARE WRITTEN BACK IN ONE OPERATION. 
583 ; 

584 ; CALLING SEQUENCE: 

585 ; 

586 ; BSBW MMGSWRTMF YP AG 

587 ; 

588 ; INPUT PARAMETERS: 

589 ; 

590 ; IPL = 0 

591 ; 

592 ; IMPLICIT INPUTS: 

593 ; 

594 ; NONE 

595 ; 

596 ; OUTPUT PARAMETERS: 

597 ; 

598 ; R4, RS ALTERED 

599 ; 

600 ; IMPLICIT OUTPUTS: 

601 ; 

602 ; NONE 

603 ; 

604 ; COMPLETION CODES: 

605 ; 

606 ; NONE 

607 ; 

608 ; SIDE EFFECTS: 

609 ; 

610 ; NONE 

611 ; 

612 :-- 

613 

614 - ENABLE LOCAL BLOCK 

615 a 

616 ;- 

617 ; Local subroutine to conditionally deallocate a MPW IRP 
618 ; 

619 ; Inputs: 

620 ; (SP) Return address 

621 ; 4(SP) O or MPW IRP to deallocate 

622 ; 

623 ; Outputs: 

624 ; NONE 

625 ; 

626 ; Side Effects: 

627 ; RO, R1 Destroyed 

628 ; 

629 ; If MPW IRP address was <> 0, then 

630 ; IRP returned returned to lookaside list 
631 ; MPWSGB_IOCNT updated 


DIGITAL INTERNAL USE ONLY 75 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 14 
X-26 WRIMFYPAG - WRITE MODIFIED PAGES 5-APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 (5) 


632 
633 
634 
635 
636 
637 
638 
639 
640 
641 
642 
643 
644 
645 
646 
647 
648 
649 
650 
651 
652 
653 
654 
655 
656 
657 
658 
659 
660 
661 
662 
663 
664 
665 
666 
667 
668 
669 
670 
671 
672 
673 
674 
675 
676 
677 
678 
679 
680 
681 
682 
683 
684 
685 
686 
687 
688 


we Ye Me 


DEALLOCATE_MPW_IRP: 


=e 


MPW IRP address removed from stack 


Get PCB address 

Unused MPW IRP to release ? 

Br if none 

Return MPW IRP to lookaside list 


Restore DIO quota 
Show 1 less MPW I/O thread 


Remove: MPW IRP address: from stack 


MOVL ~~ G“CTLSGL_PCB, RO 
MOVL 4(SP),R1 
BEQL 1$ 
INSQUE (R1),@W*MPWSGL_IRPBL 
IF DF, DEBUG 
IF EQ, DEBUG-1 
LOG EVENT EVT=DALIRP, SRC=4 (SP) , IREG=1 
.ENDC 
.ENDC 
ADAWI = #-1, PCBSW_DIOCNT (RO) 
INCB W*MPWSGB_IOCNT 
BGTR BR_BAD MPW_CNT 
1$: MOVL (SP) +, (SP) 
RSB. 


BR_BAD_MPW_CNT: 


BRW BAD _MPW_CNT 


7; Inputs: 
? MMG spinlock must be held - IPL 
‘’ 
NOMOREPAGES : 
BSBB DEALLOCATE_MPW_IRP 
CMPL #MPWSC_MAXPAGCNT, - 
W“MPWSGL_PAGECOUNT 
BLSS 10$ 
PUSHAB B%*21$ 
BRW MMGSMPW_END 
+++ 
Inputs: 


MMG spinlock must be held - IPL 


ee Se Ne Ve 


™e Ne 


we Ne Se Ye Ye Se 


Return 


SYNCH 


Deallocate MPW IRP 

Are we here due to examined 
page count overflow ? 

BR if yes 

(cheap branch) 

Cleanup and set MPW state 


SYNCH 

Unlock MMG database 

Lower IPL, but block AST threads 
Lock MMG database 

Retrieve saved PFN 


Page still on modified list ? 


List has changed - restart scan from begin 
Show no pages examined 
Join mainline processing at restart point 


;RESTORE PREVIOUS IPL 


(SP) = Saved IPL at entry 
108: UNLOCK LOCKNAME=MMG, - ; 
NEWIPL=#IPL$ ASTDEL, - ; 
PRESERVE=NO 7 OK to destroy RO 
LOCK LOCKNAME=MMG, ~- ; 
PRESERVE=NO 7 OK to destroy RO 
MOVL W“MPWSGL_SAVED_PFN, RO ; 
CMPZV #PFNSV_LOC, #PFNSS_LOC,- ; 
@W“PFNSAB_ STATE [RO], #PFNSC_MFYPAGLST 
BEQL 20$ ; BR if yes 
15$: CLRL W“MPWSGL_SAVED_PFN ; 
208: CLRL W“MPWSGL_PAGECOUNT ; 
BRW GET_NXT_CLUSTER_1 ; 
21$: UNLOCK LOCKNAME=MMG, - 7;UNLOCK MMG DATABASE 
NEWIPL= (SP) +, - 
PRESERVE=NO 7 OK to destroy RO 
pttt 


76 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10~-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 15 
X-26 WRIMFYPAG - WRITE MODIFIED PAGES 5~APR-1989 11:28:29 [SYS.SRC]WRTMFPYPAG.MAR;1 (5) 


689 
690 
691 
692 
693 
694 
695 
696 
697 
&94% 
699 
700 
701 
7102 
703 
7104 
705 
706 
107 
708 
709 
710 
711 
712 
713 
714 
715 
716 
717 
718 
719 
720 
721 
7122 
723 
724 
725 
7126 
727 
728 
729 
730 
731 
732 
733 
734 
735 
736 
137 
738 
739 
740 
741 
742 
743 
744 
745 


™e Te WS 


228: 


258: 


ce) 

° 

an 
1° 


we Se Te Ye Ne Ye Ne Yo Ne Ne 


608: 


CMPL 


BNEQ 


POPR 
RSB 


MOVL 
JSB 
BLBC 


BISB 
MOVAL 


CMPL 
BLEQU 
MOVL 
CMPL 
BEQL 
MOVL 
BEQL 
JSB 
CLRL 
BRB 


BICB 
PUSHAB 
JMP 


IF 


ENTRY STATS: 


MOVZBL 
ADDL2 


INCL 


Check the queue of deleted GSDs for clean-up 


G“*EXESGL_GSDDELFL, ~- ?Quick check on the deleted GSD queue. 
#EXESGL_GSDDELFL sIf we miss this because of SMP, we 
25$ zdon’t care for two reasons: (1) we’1l 


zdo it again in another second. (2) it 
?wasn’t the reason we’re running now 
yanyway. We’ll be woken again if need 
tbe. 


#°M<R6,R7,R8,R9,R10,R11,AP> ;RESTORE NON-VOLATILE REGISTERS 
7AND RETORN 


G*EXE$GL_GSDMTX, RO 7Get the GSD mutex, but don’t wait. 
G*CTLSGL_PCB, R4 

G*SCHSLOCKWNOWAIT 

RO, 22$ 


S“*#MMGSM_NOWAIT,G“MMGSGB_FREWFLGS ; Prevent FREWLSE MWAIT 
G*EXESGL_GSDDELFL, R2 7Get the head of the queue 
R2, R3 


The following check is done to avoid placing the SWAPPER in a memory 
management related wait state due to unavailable physical page frames. 
The worst case requirement, assuming that a GSD is <= 1 page in size, 

is 2 pages (allowing for a page crossing). While it is possible that 
either a) concurrent activity by a higher priority, real time process, or 
b) concurrent activity on other CPUs in a SMP configuration could use 
all available page frames after the check is made, the probability is 
EXTREMELY small, approaching zero for practical purposes. 


G*SCHSGL_FREECNT, #16 Do we have adequate free pages ? 


“=e Ne 


60$ BR if no; avoid FPG wait, etc. 
(R3),R3 7Get next entry. 

R2,R3 3;No more? 

60S 7Then exit. 

GSD$L_IPID(R3), RO 7Get the IPID of the nominal owner 
30$ 7Skip it if null 
G“MMGSQUEUVE_GSD_CLEAN ;Queue the AST 

GSD$L_IPID(R3) #Don’t queue it twice 

30$ #Go back and get another 
S*#MMGSM_NOWAIT, G“MMGS$GB_FREWFLGS z Allow FREWLSE MWAIT 
B*22$ 3; (return through common exit) 
G“MMGSGSDMTXULK 7;Unlock the mutex 


DF, PERF STATS 


W“MPWSGB STATE, RO 3; Get current MPW state for indexing 
G*SCH$GL MFYCNT, - ? Accumulate MPL count at entry 
G*PMS$GL_RESERVED1+ ~ 

<4*<MPWSC_ MAXSTATE*2>>[RO] 

G*PMSSGL RESERVED1+ - ; Count the number of entries 
<4*<MPWSC_MAXSTATE*3>> [RO] 


DIGITAL INTERNAL USE ONLY 77 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION | 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 16 
X-26 WRIMFYPAG - WRITE MODIFIED PAGES S-APR-1989 11:28:29 [SYS.SRC])WRIMFYPAG.MAR;1 (5) 


746 
747 
748 
749 
750 
751 
752 
753 
754 
755 
756 
757 
758 
759 
760 
761 
762 
763 
764 
765 
766 
767 
768 
769 
770 
771 
772 
773 
774 
775 
776 
777 
778 
779 
780 
781 
782 
783 
784 
785 
786 
787 
788 
789 
790 
791 
792 
793 
794 
795 
796 
797 
798 
799 
800 
801 
802 


BRB GET_NXT_CLUSTER_2 7 Join main processing loop 
»ENDC 

-DISABLE LOCAL BLOCK 

UNIVERSAL_SYMBOL MMGSWRTMFYPAG 


?;MMGSWRTMFYPAG: : 


108: 
208: 


=e Ne 


FIRST 


CMPL G*SCHS$GL_MFYLIM, ~ 
G*SCHSGL_MFYCNT 

BLEQ 208 BR if yes 

RSB Nothing to do for now 

BBSSI S*#SCHSV_MPW, G*SCHS$GB_SIP,10$ ; Do nothing if already active 


Enough pages on modified 
page list to consider writing? 


=e Ne Ne Ne 


ENTRY TO MODIFIED PAGE WRITER 


PUSHR #°M<R6,R7,R8,R9,R10,R11,AP> ; Save non-volatile registers 
CLRQ - (SP) No MPW IRP allocated, saved IPL = 0 
LOCK LOCKNAME=MMG, ~- Lock MMG database 

LOCKIPL=#IPLS$_ SYNCH, - Raise IPL 

PRESERVE=NO OK to destroy RO 


™e we NS Ne 


ASSUME MPWSGL REQFAIL EQ MPWSGL_REOQFND+4 

CLRQ W°MPWSGL_REQFND # Show no pages found/failed 
ASSUME MPWSGL_SAVED_PFN EQ MPWS$GL_PAGECOUNT+4 

CLRQ W“MPWSGL_PAGECOUNT 7 Show no pages examined 

7 and no saved PFN 


# Set maintenance state (conditionally) 
MOVZWL #<MPWSC_MAINTAIN!MPWSM_LOLIMIT>, RO 
MOVL G“MPWSGL_LOWAITLIM, R1 3; New low MPL limit is MPW_LOWAITLIMIT 


IF NDF, PERF _STATS 

PUSHAB B“GET_NXT_CLUSTER_2 ; Join main processing loop 
~IFF 

PUSHAB B“ENTRY_STATS ; Maintain entry statistics 
-ENDC 

BRW MMGSPURGEMPL 


BAD _MPW_CNT: 


BUG CHECK MPWALCIRP, FATAL 3; Failure to correctly allocate MPW IRP 


7 Continuation after either I/O initiation or completion 
; 


GET_NXT_CLUSTER: 


Lock MMG database 
Raise IPL 


LOCK LOCKNAME=MMG, - 
LOCKIPL=#IPL$_SYNCH, - 


Ze we VO 


PRESERVE=NO OK to destroy RO 
ASSUME MPWSGL_REQFAIL EQ MPWSGL_REQFND+4 
CLRQ W“MPWSGL_REQFND 7 Show no pages found/failed 
ASSUME MPWSGL_SAVED_PFN EQ MPWSGL_PAGECOUNT+4 
CLRQ W“MPWSGL_PAGECOUNT + Show no pages examined 
7 and no saved PFN 


, 
7 Continuation after processing suspension 
7 


GET_NXT_CLUSTER_1: 


CLRL  -(SP) 7 No MPW IRP allocated yet 


78 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMPYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 17 
X-26 WRIMPYPAG ~ WRITE MODIFIED PAGES 5-APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 (5) 


803 
804 
805 
806 
807 
808 
809 
810 
811 
812 
813 
814 
815 
816 
817 
818 
819 
820 
821 
822 
823 
824 
825 
826 
827 
828 
829 
830 
831 
832 
833 
834 
835 
836 
837 
838 
839 
840 
841 
842 
843 
844 
845 
846 
847 
848 
849 
850 
851 
852 
853 
854 
855 
856 
857 
858 
859 


CMPL G*SCHSGL_MFYCNT, - 
G*SCHSGL_MFYLOLIM 
BLEQU) BR_NOMOREPAGES 


; Continuation after initial entry 


GET_NXT_CLUSTER_2: 
REMQUE @W*MPWSGL_IRPFL, R2 


BVS BR_NOMOREPAGES 
MOVL _—-R2,, (SP) 

IF DF, DEBUG 

IF EQ, DEBUG-1 
LOG_EVENT EVT=ALCIRP 

-ENDC 

-ENDC 

MOVL § G*CTLSGL_PCB, R4 
ADAWI #1, PCB$W_DIOCNT(R4) 
DECB W“MPWSGB_IOCNT 
BGEQ §BAD_MPW CNT 

MOVAB IRPS$C_LENGTH(R2) ,- 


W°MPWSAL_PTE 
MOVZWL G“MPWSGW_MPWPFC, RO 
BISL2  #7,RO0 
MOVAL @W*MPWSAL_PTE[RO],- 
W°MPWSAW_PHVINDEX 
CLRQ  W*MPWS$GQ PGFLX FAIL 
CLRQ  W“MPWS$GQ PGFLX FAIL+8 
CLRL § W°MPWSGL_REQIDX 
MOVL § W*MPWSGL_SAVED_PFN, RO 
BNEQ GET PAGE TYPE 1 
MOVL §§ G*PFNSAL_MFYLSTHD, RO 
GET_PAGE TYPE: 
BEQL § BR_NOMOREPAGES 


GET_ PAGE TYPE 1: 
AOBLEQ #MPWS$C_MAXPAGCNT, - 
W“MPWSGL_PAGECOUNT, - 


PROCESS PAGE 
MOVL § RO, W*MPWS$GL_SAVED_PFN 
BR_NOMOREPAGES: 
BRW NOMOREPAGES 
PROCESS_PAGE: 
BSBW GETPFNCTX 
CLRL = R6 
CASE Ri, <- 
PAGEF ILE, - 
SECTION, ~ 
BADBAKADR, ~ 
SWPVBN, - 
NEXT_MFYPAG > 
BADBAKADR: 


BUG CHECK IVBAKADIO, FATAL 


Enough pages on modify list 
to try for another cluster? 
No, all done for now 


=e Ne Ye 


Get a MPW IRP from lookaside list 
BR if none available 
Save MPW IRP address 


we “Ne Xe 


Get PCB address of this process 
Insure enough DIO quota 

Show another MPW I/O thread active 
Bugcheck if count >= 0 

Set address of MPW PTE array 


we Ne Se Ne Ye 


Set address of MPW PHV index array 


~e 


Clear page file allocation 
failure array 

Assume current index will be zero 
7; Retrieve saved PFN (if any) 


“ee %e Ne 


7FIRST PFN IN MODIFIED PAGE LIST 
7BRANCH IF LIST IS EMPTY 


Count another page examined 

and suspend processing if maximum 
page count exceeded 

Save restart PFN 


ee Ye Ne 


we 


7;SET UP TO PROCESS THIS PFN 
INIT INDEX TO PTE ARRAY 
s;DISPATCH ON BACKING STORE TYPE 
PAGING FILE PAGE 

7;SECTION PAGE (PROCESS OR GLOBAL) 
7;GLOBAL BACKING STORE ADDRESS 
7;SWPVBN, WRITE BACK TO SWAP FILE 
7 Skip page 


;INVALID BACKING STORE ADDRESS FOR I/O 


NO PAGE FILE VBN’S AVAILABLE IN THIS PAGE FILE 


7 
NO_PAGEFILE: 
BBSS W“MPWSGL_REQIDX, ~ 


W“MPWSGL_REOFAIL, 5$ 


3 Show failure to write for current 
7 request index 


DIGITAL INTERNAL USE ONLY 79 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 18 
X-26 WRIMFYPAG - WRITE MODIFIED PAGES 5-APR-1989 11:28:29 [SYS.SRC]WRTMFYPAG.MAR;1 (5) 


860 
861 
862 
863 
864 
865 
866 
867 
868 
869 
870 
871 
872 
873 
874 
875 
876 
877 
878 
879 
880 
881 
882 
883 
884 
885 
886 
887 
888 
889 
890 
891 
892 
893 
894 
895 
896 
897 
898 
899 
900 
901 
902 
903 
904 
905 
906 
907 
908 
909 
910 
911 
912 
913 
914 
915 
916 


58: 


108: 


POPR 
BBSS 


BBCC 


I 


#°M<RO,R3,R4,R5,R6,R7> ;RECOVER REGISTERS FROM STACK 
R7,W°MPWSGQ PGFLX_FAIL,-; Show an allocation failure for this 
NEXT_MFYPAG 7 page file index 
S*#SCHSV_TCD,G*SCH$GB_SIP,~- ; Enable threshold checking again 
NEXT_MFYPAG 


; (Fall through to try next page...) 
NEXT MFYPAG: 


108: 


208: 


AT 


Ve Se Ne Yeo Ne Yo Ye Se Ye Ne Ne 


ty se 


=e 


MOV2ZWL 


BRB 


AGEFILE : 


EXTZV 


BBS 


PUSHR 


CLRQ 
MOVL 


MOV2ZBL 


JSB 
BNEQ 
SUBL 
BLEQ 
- MOVB 
CLRL 
BRB 


JSB 

BEQL 
MOVL 
MOVL 
POPR 
MOVL 


PFN_REFERENCE - 

<@W*PFNSAx_FLINK[RO], RO>,- ;CHAIN TO NEXT PAGE 
LONG_OPCODE=MOVL, - : 
IMAGE=SYS_NONPAGED 

GET_PAGE_TYPE ;AND PROCESS IT 


PAGE FILE PAGE, GATHER A CLUSTER FROM THE SAME PAGE FILE 


#PFNSV_PGFLX, #PFN$S_PGFLX,R2,R7 ;PAGE FILE INDEX 
R7,W“*MPWSGQ PGFLX FAIL,~-; Skip page if previous space allocation 


NEXT _MFYPAG._ * failure for this page file index 
#°M<RO,R3,R4,R5,R6,R7> ;SAVE PFN, SVAPTE,PCB,PHD,PTE INDEX, FILE 
RO 7;NOTHING TO FREE 


@MMGSGL_PAGSWPVC[R7],R3 ;GET PAGE FILE CONTROL BLOCK ADDRESS 


PFL$B_ALLOCSIZ (R3) , R2 #7DESIRED CLUSTER SIZE 
G“MPWSALLOCPAGFIL1 7ALLOCATE A CLUSTER 

20$ 7BRANCH IF WE HAVE ALLOCATION 

#16,R2 7ALLOCATION FAILED, TRY SMALLER CLUSTER 
10$ 7BRANCH IF ALREADY AT MINIMUM 
R2,PFLS$B_ALLOCSIZ (R3) 7SET NEW SIZE TO ATTEMPT FROM NOW ON 
PFLSL_STARTBYTE (R3) 7START AT BEGINNING OF MAP 

5$ 7TRY AGAIN 

G“MPWSALLOCPAGFIL2 7;ALLOCATE SPACE, ANY AMOUNT OK 
NO_PAGEFILE 7BRANCH IF NONE, NO WRITING CAN BE DONE 
R2,R11 7;SAVE NUMBER OF PAGES ALLOCATED 

RO,R8 7AND THE STARTING PAGE FILE VBN 
#°M<RO,R3,R4,R5,R6,R7> ;RECOVER PFN, SVAPTE 

R11,R9 7;NUMBER OF PAGEFILE PAGES ALLOCATED 


THIS POINT THE REGISTERS CONTAIN THE FOLLOWING VALUES: 


RO 
R3 
R4 
R5 
R6 
R7 
R8 
R9 
R11 


AGFILCLUSTER: 


PUSHL 


PFN 

SYSTEM VIRTUAL ADDRESS OF PAGE TABLE ENTRY 

PCB ADDRESS FOR THE PROCESS IN WHICH THIS CODE IS RUNNING 

PHD ADDRESS OF THE PROCESS WHICH OWNS THE MODIFIED PAGE 

INDEX TO NEXT ENTRY TO USE IN PTE AND PHVINDEX ARRAYS 

PAGE FILE INDEX 

NEXT PAGE FILE VBN TO USE 

NUMBER OF PAGE FILE VBN’S NOT YET USED IN THE CLUSTER ALLOCATED 
NUMBER OF PAGE FILE VBN’S ALLOCATED IN THE CLUSTER 


R11 ?SAVE COUNT OF ALLOCATED PAGE FILE 
PFN_REFERENCE = 


MOVZWL <@W*PFNSAx BLINK[RO],-(SP) >,- ;REMEMBER WHERE TO RESTART SCAN OF L 


CLRL 


BSBW 


LONG_OPCODE=MOVL, - 

IMAGE=SYS_NONPAGED 

MPWSL_COUNT _- g INIT COUNT OF CLUSTER TO 0 

PTESCAN ;TRY TO GET ADJACENT PAGES TO THIS ONE 


80 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG ~- WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 19 
X-26 WRIMFPYPAG ~ WRITE MODIFIED PAGES 5-APR-1989 11:28:29 [(SYS.SRC]WRIMFYPAG.MAR;1 (5) 


917 
918 
919 
920 
- 921 
922 
923 
924 
925 
, 926 
927 
926 
929 
930 
931 
932 
933 
934 
935 
936 
937 
938 
939 
940 
941 
942 
943 
944 
945 
946 
947 
946 
949 
950 
951 
952 
953 


; 
3 


Se te Se Ye Ye Ye Yo 


=e se Ve 


MOVL MPWSL_COUNT, RO 7;GET THE COUNT 
INCL MPWSA_PGFLCLUSTERS[RO} ;BOMP THE COUNT 


DONE WITH THIS CLUSTER OF PAGE TABLE ENTRIES 

IF MORE PAGE FILE VBN’S ARE LEFT, SCAN MODIFIED LIST FOR MORE PAGES 
IN SAME PAGE FILE. 

O(SP) = SAVED PFN (OR 0) TO LINK FORWARD FROM 

4(SP) = NUMBER OF PAGE FILE VBN’S ALLOCATED 


POPR #°M<RO, R11> 7RO = SAVED PFN TO LINK FORWARD 
7R11 = NUMBER OF PAGE FILE VBN’S ALLOCATED 
SUBL3 R6,R11,R9 7NO. OF PAGE FILE VBN’S NOT USED 


DISABLE THE FOLLOWING BECAUSE THIS MIGHT RETURN A SMALL ALLOCATION WITHOUT 
WRITING ANY PAGES AT ALL. 


CMPW s«aRO,, W*MPWS$GW_MINLIM ;ARE WE AT THRESHOLD TO SHUT OFF CLUSTER 
BLEQ  100$ ;BRANCH IF USED ALL THAT WE SHOULD 
TSTL RO 7PFN 0 IS LIST HEAD 
BNEQ 70$ ;GET FLINK AS NEXT CANDIDATE 
MOVL § G“PFNSAL_MFYLSTHD,RO #§_;NEXT CANDIDATE FROM FRONT OF LIST 
BRB 75$ 
70$: PFN_REFERENCE - | 
MOVZWL <@W*PFNSAx_FLINK[RO],RO>,- ;CHAIN TO NEXT PFN IN LIST 


LONG _OPCODE=MOVL, - 
IMAGE=SYS NONPAGED 


75$: BEOL 100$ ;BRANCH IF END OF LIST 
80$: BSBW GETPFNCTX ;SET UP TO PROCESS THIS PFN 
7 TSTL R1 7PAGE FILE VBN? 
BNEQ 70$ 7; BRANCH IF NOT 
CMPZV #PFNSV_PGFLX, #PFNSS_PGFLX,R2,R7 ;SAME PAGE FILE INDEX? 
BNEQ 70$ ;BRANCH IF NOT 
BRB ' PAGFILCLUSTER ;FIND ANOTHER PTE CLUSTER 


fd we Se Se 


954 


955 
956 
957 
958 
959 
960 
961 
962 
963 
964 
965 
966 
967 
968 
969 
970 
971 
972 
973 


%e Se Se Ye 


™e “Se “Ne Te Ye Ye So 


SET UP TO WRITE THIS CLUSTER OF PAGES 


00$: SUBL3 R6,R8,R11 7FORM AND SAVE FIRST PAGE FILE VBN 
MOVL @MMGSGL_PAGSWPVC[R7],R3 ;ADDRESS OF PAGE FILE CONTROL BLOCK 
- MOVL R9, R1 7;ANY PAGE FILE VBN’S TO DEALLOCATE? 
BEQL 140$ 7BRANCH IF THEY WERE ALL USED 
MOVL R8,RO 7;SET VBN NUMBER OR AREA TO DEALLOCATE 


THERE ARE Rl PAGES OF PAGE FILE ALLOCATED BUT NOT USED STARTING WITH VBN RO. 
MUST RETURN. THEM TO THE PAGE FILE 


JSB G“MPWSDEALLOCPAGFIL 7FREE THE PAGES IN THE FILE 


NOW SET UP TO DO THE CALL TO BUILDPKT 
R3 = PAGE FILE CONTROL BLOCK ADDRESS 
R6 = NO. OF PAGES TO TRANSFER 
R7 = PAGE FILE INDEX 
R11 = STARTING PAGEFILE VBN 


ASSUME SECS$L_VBN EQ PFLSL_VBN 
ASSUME SEC$L_WINDOW EQ PFLSL_ WINDOW 


1408: 


IF DF, DEBUG 
IF EQ, DEBUG-1 


DIGITAL INTERNAL USE ONLY 81 


CONFIDENTIAL AND PROPRIETARY — 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 20 
X-26 WRIMFYPAG ~ WRITE MODIFIED PAGES 5-APR~-1989 11:28:29 [SYS.SRC]WRTMFYPAG.MAR;1 (5) 


7FORM VBN IN PAGE FILE 
7;WINDOW ADDRESS 


R4 = PROCESS CONTROL BLOCK ADDRESS FOR THE PROCESS IN WHICH THIS CODE IS RUNNING 


7 Show more pages being written 
7;NUMBER OF BYTES TO WRITE 
7;SVAPTE FOR TRANSFER 


;COUNT THE PAGES WRITTEN 
;AND THE NUMBER OF WRITE REQUESTS 


; Get current MPW state for indexing 


G“PMS$GL_RESERVED1+<4*MPWSC_MAXSTATE>[R5] ;AND THE NUMBER OF WRITE R 


3; UNLOCK MMG DATABASE 
3; Lower IPL, but bleck AST threads 


7GET I/O PACKET ADDRESS 
#ADDRESS OF KERNEL MODE AST 
7FOR WRITE COMPLETION PROCESSING 


G*MPWSGB_PRIO, #31, IRPSB_PRI(R5) ;SET PRIORITY FOR TRANSFER 
;BUILD AND QUEUE THE I/O REQUEST PACKET 


3; Try to write another I/O cluster 


7BACKING STORE ADDRESS 

7MAXIMUM NUMBER OF PAGES TO CLUSTER 

7; INIT COUNT OF CLUSTER TO 0 

7LOOK AT ADJACENT PTE’S FOR A CLUSTER TO WRI 
7GET THE COUNT 


974 LOG EVENT EVT=WRTPAG 
975 ~ENDC 
976 -ENDC 
977 ADDL3 R11, PFL$L_VBN(R3) , RO 
978 MOVL PFLSL_WINDOW(R3) , R2 
979 3 
980 ; O(SP) = ADDRESS OF I/O REQUEST PACKET 
981 ; 4(SP) = CALLER’S IPL 
982 ; RO = VBN IN FILE TO WRITE 
983 =; R2 = ADDRESS OF WINDOW FOR FILE 
984 ; 
. 985 ; R6 = NUMBER OF PAGES TO WRITE 
986 ; 
987 MPW_BLDPRT: 
988 ADDL2 R6,G*MPWSGL_IOPAGCNT 
989 ASHL #9,R6,R1 
990 MOVAL @W*MPWSAL_PTE,R3 
991 
992 
993 IF GT, CA$_MEASURE 
994 ADDL R6, G*PMS$GL_PWRITES 
995 INCL G*“PMS$GL_PWRITIO 
996 -ENDC 
997 
998 IF DF, PERF_ STATS 
999 MOVZBL W“MPWSGB_STATE, R5 
1yv00 ADDL R6,G*PMS$GL_RESERVED1 [R5] 3; COUNT THE PAGES WRITTEN 
1001 INCL 
1002 -ENDC 
1003 
1004 UNLOCK LOCKNAME=MMG,- 
1005 NEWIPL=#IPL$_ASTDEL 
1006 
1007 MOVL (SP) +,R5 
1008 MOVAL W“WRITEDONE, IRP$L_ASTPRM(R5) 
1009 
1010 SUBB3 
1011 JSB G“*EXESBLDPKTMPW 
1012 ; 
1013 ; R4 NO LONGER HAS PCB ADDRESS IN IT 
1014 ; 
1015 . 
1016 BRW GET_NXT_CLUSTER 
1017 
1018 ; 
1019 - SECTION PAGE - TRY TO FORM A CLUSTER OF THESE 
1020 ; 
1021 
1022 -ENABL LSB 
1023 
1024 SECTION: 
1025 MOVL R2,R7 
1026 MOVZWL G*“MPWSGW_MPWPFC, R9 
1027 ; CLRL MPWSL_COUNT 
1028 BSBW PTESCAN 
1029 ; MOVL MPWSL_COUNT, RO 
1030 ; INCL MPWSA_SECTCLUSTERS [RO] 


82 DIGITAL INTERNAL USE ONLY 


7BUMP THE COUNT 


CONFIDENTIAL AND PROPRIETARY © 
DIGITAL EQUIPMENT CORPORATION 


WRIMPYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 21 
X-26 WRIMFYPAG - WRITE MODIFIED PAGES 5-APR-1989 11:28:29 [SYS.SRC])WRIMFYPAG.MAR;1 (5) 


1031 
1032 
1033 
1034 


1035 | 


1036 
1037 
1038 
1039 
1040 
1041 
1042 
1043 
1044 
1045 
1046 
1047 
1048 
1049 
1050 
1051 
1052 
1053 
1054 
1055 
1056 
1057 
1058 
1059 
1060 
1061 
1062 
1063 
1064 
1065 
1066 
1067 
1068 
1069 
1070 
1071 
1072 
1073 
1074 
1075 
1076 
1077 
1078 
1079 
1080 
1081 
1082 
1083 
1084 
1085 
1086 
1087 


7GET STARTING PAGE NUMBER 
;GET ITS BACKING STORE ADDRESS 
#AND ITS PAGE TABLE ENTRY ADDRESS 


#TRANSLATE BACKING STORE TO VBN AND WINDOW 
7GO QUEVE THE REQUEST 


N’T PROCESS SWAP VBN’S 

7; IF SWAPPER IS ACTIVE 

7GET PROCESS HEADER VECTOR INDEX 

#;GET. PROCESS INDEX 

?7BRANCH IF PROCESS IS NO LONGER AROUND 

3; Convert rel. page # to PF#/VBN (WSSWP form 
7;STARTING PTE RANGE 

7;ENDING PTE RANGE 


#PUT JUST THIS PAGE IN MPW PTE ARRAY 


7R2 = BACKING STORE ADR, R3 = SVAPTE 


7SET UP FOR BUILDPKT 


3 Show failure to write for current 


7;SKIP THIS MODIFIED PAGE 


IF DF, DEBUG 
IF EQ, DEBUG-1 
LOG EVENT EVT=WRTSEC 
-ENDC 
-ENDC : ; 
MOVL QW“MPWSAL_PTE, RO 
MOVL @W“PFNSAL_BAK[RO),R2 
MOVL @W“PFNSAL_PTE[RO],R3 
; 
# RS = PROCESS HEADER ADR ASSOCIATED WITH THIS SVAPTE FROM ORIGINAL GETPFNCTX CALL 
3 
108: BSBW MMGS INIBLDPKT 
BRW MPW_BLDPKT 
; 
3 THIS PAGE IS A SWPVBN PAGE AND IS TO BE WRITTEN BACK TO THE SWAP FILE 
3 RATHER THAN ITS NORMAL BACKING STORE ADDRESS 
2 
SWPVBN : 
BBS S“*#SCHSV_SIP, G*SCHSGB_SIP,40$ ; 
MOVZWL PHDSW_PHVINDEX (RS) ,R1 
CVTWL @W*PHVSGL_PIXBAS[R1),R1 
BLSS PROCESS GONE 
BSBB MAP_SWPVBN 
MOVL R3, AP 
MOVL R3,R10 
_ MNEGL #1,R7 #SET PTESV_TYPO 
BSBW §_ SCAN_DONE 
7 R9, R10 ASSUMED PRESERVED 
MOVQ R9,R2 
-IF DF, DEBUG 
-IF EQ, DEBUG-1 
LOG EVENT EVT=WRTSWP 
-ENDC 
-ENDC 
BBCcS #15, @W“MPWSAW PHVINDEX,10$ ;INDICATE SWAP VBN PAGE WRITE 
BRB 10$ 
7 DO NOT PROCESS THIS MODIFIED PAGE WITH SWPVBN SET SINCE SWAPPER IS ACTIVE 
408: BBSS W*MPWSGL_REQIDX, - 
W“MPWSGL_REQFAIL, 45$ request index 
45$: BRW NEXT_MFYPAG 
-DSABL LSB 
? 
; Local subroutine to convert relative page number 
7 in swap image to PF#/VBN format. 
MAP_SWPVBN: 


MOVL 
MOVZWL 
ADDL 
MOVAL 
TSTL 


QW*SCHSGL_PCBVEC[R1],R7 
PCBSW_APTCNT (R7) , R9 
R2,R9 

PCBSL_WSSWP (R7) , R8 

(R8) 


Get PCB address 

R9 = active page table pages to skip 
RO = relative page number in swap slot 
R8 = address of mapping pointer 

Is there a PFLMAP ? 


"oe Se Se te te 


DIGITAL INTERNAL USE ONLY 83 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 22 
X-26 WRIMFYPAG - WRITE MODIFIED PAGES 5-APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 (5) 


1088 
1089 
1090 
1091 
1092 
1093 
1094 
1095 
1096 
1097 
1098 
1099 
1100 
1101 
1102 
1103 
1104 
1105 
1106 
1107 
1108 
1109 
1110 
1111 
1112 
1113 
1114 
1115 


° 
e 
c7 
o 
e 
’ 


™e Ye Ye Yeo Ne 


-e te VWs 


BR if no 
BR if swap space not allocated 
Address lst pointer in mapping window 


Get pointer page count 

Subtract from pages remaining to skip 
Quit if enough pages skipped 
Bugcheck if last pointer 

Move to next pointer 


R9 contains -(excess page count) 
R8 = WSSWP of page beyond current pointer 
R9 = WSSWP of SWPVBN page 


7PROCESS NOT IN SYSTEM 


- BGTR 10$ 

BEQL NOSWAPSPACE 

ADDL3 #PFLMAPSQ PTR, (R8),R8 
108: BICL3 #<1@31>, 4(R8),R7 

SUBL2 R7,R9 

BLSS 13$ 

BBS ..-—s- #31, 4 (R8) ,12$ 

MOVAQ 8(R8),R8 

BRB 10$ 
128: BUG CHECK INVPFLMAP, FATAL 
13$: ADDL3 _~iR7, (R8), R8 

ADDL3 R9,R8,R9 

RSB 
3 
? PROCESS WAS DELETED AND SWAP VBN WAS SET IN PFN DATA BASE 
3 E 
PROCESS _ GONE: 

BUG CHECK PROCGONE, FATAL 
(ae 4 
3 No swap space allocated for process 
NOSWAP SPACE: 


BUG CHECK INSSWPFIL, FATAL 


84 DIGITAL INTERNAL USE ONLY 


eo 


INSUFFICIENT SWAP FILE SPACE 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


‘WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 23 
X-26 GETPFNCTX 5-APR~-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 (6) 


-SBTTL GETPENCTX 


1117 
1118 
1119 
1120 
1121 
1122 
1123 
1124 
1125 
fies 
1127 
1128 
1129 
1130 
1131 
1132 
1133 
1134 
1135 
1136 
1137 
1138 
1139 
1140 
1141 
1142 
1143 
1144 
1145 
1146 
1147 
1148 
1149 
1150 
1151 
1152 
1153 
1154 
1155 
1156 
1157 
1158 
1159 
1160 
1161 
1162 
1163 
1164 
1165 
1166 
1167 
1168 
1169 
1170 
1171 
1172 


BSBW 
INPUTS: 

RO = 
OUTPUTS: 


RO 


Ql Se Ne Se Se Ne Ne Ne Se Se Se Ne Ne Ne Ne Se Ne Ne Ne Ne Ne Se Ye Se 


CALLING SEQUENCE : 


GETPFNCTX 


PFN 


PFN (PRESERVED) 


bo 
Rl = TYPE OF BACKING STORE ADDRESS 
= 0 IF PAGING FILE 
= 1 IF SECTION ADDRESS 
= 2 IF ILLEGAL 
= 3 IF SWPVBN . 
= 4 if page is to be skipped based on selective MPL flush criteria 
R2 = BACKING STORE ADDRESS OR SWPVBN 
R3 = SYSTEM VIRTUAL ADDRESS OF PAGE TABLE ENTRY 
R4 = PRESERVED 
R5 = PROCESS HEADER ADDRESS 
ETPFNCTX: 
MOVL @W*PFNSAL PTE[RO],R3 7SYSTEM VIRTUAL ADDRESS OF PAGE TABLE ENTRY 
ASSUME MPWSC_IDLE EQ 0 


ASSUME MPWSC_MAINTAIN EQ 1 
ASSUME MPWSC_SVAPTE EQ 2 
ASSUME MPWS$C_OPCCRASH EQ 3 
EXTZV #1, #1,W*MPWSGB_STATE, R1 


BNEQ 


we 


CHECK _PURGE_RANGE BR if selective MPL writing in effect ? 


GETPFNCTX_CONT: 


' BBSS 


R1, W“MPWSGL_REQFND, - 7 Show a writable page found 
GETPFNCTX_CONT2 


GETPFNCTX_CONT2: 


EXTZV #PFNSV_PAGTYP, #PFN$S_PAGTYP, @W*PFNSAB_TYPE[RO],R1 ;PAGE TYPE 

ASSUME PFNSC PROCESS EQ 0 

ASSUME PFNSC_SYSTEM EQ 1 

ASSUME PFNSC_GLOBAL EQ 2 

ASSUME PFNSC_GBLWRT EQ 3 

ASSUME PFNS$C_PPGTBL EQ 4 

ASSUME PFNS$C_GPGTBL EQ 5 

CASE R1,<- 
PROCESS, - ;PROCESS PAGE 
SYSPHD, - ;SYSTEM PAGE 
BADTYP, - | ;GLOBAL READ ONLY 
SYSPHD, - ;GLOBAL WRITABLE 
PHDR, - : PROCESS PAGE TABLE 
SYSPHD- :;GLOBAL PAGE TABLE 

> 

BADTYP: BUG CHECK BADPAGTYPE, FATAL ;BAD PAGE TYPE 


1173 CHECK_PURGE_RANGE: 


DIGITAL INTERNAL USE ONLY 85 


CONFIDENTIAL AND. PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 24 
X-26 GETPFNCTX 5-APR-1989 11:28:29 [SYS.SRC]WRTMFYPAG.MAR;1 (6) 


1174 
1175 
1176 
1177 
1178 
1179 
1180 
1181 
1182 
1183 
1184 
1185 
1186 
1187 
1188 
1189 
1190 
1191 
1192 
1193 
1194 
1195 
1196 
1197 
1198 
1199 
1200 
1201 
1202 
1203 
1204 
1205 
1206 
1207 
1208 
1209 
1210 
1211 
1212 
1213 
1214 
1215 
1216 
1217 
1218 
1219 
1220 
1221 
1222 
1223 
1224 
1225 
1226 
1227 
1228 
1229 
1230 


18: 
28: 


108: 


208: 


308: 


358: 


Be Se Ne Ne te 


Os: 


508: 


~IF 
IF 
BLBC 
BBC 
BRB 
JSB 


-ENDC 
- ENDC 
CMPL 
BLSSU 
CMPL 
BLEQU 
MOVL 
RSB 
MOVZBL 
DECL 
BGTR 
MOVL 
CMPB 
BNEQ 


PUSHAB 
BRB 


MOVAQ 
CMPL 
BLSSU 
CMPL 
BLEQU 
SOBGEQ 
MOVL 
RSB 


DF, DEBUG 
EQ, DEBUG-2 
G*SGN$GL_VMSD1, 2$ 
#1,G*SGNSGL_VMSD1,1$ 
GETPFNCTX_CONT 
G*INI$BRK 


R3,W°MPWSGL_SVAPTELOW 
10$ 


R3, W*MPWSGL_SVAPTEHIGH 


20$ 
#4,R1 


W*MPWSGB_REQCNT, R1 
R1 
40$ 
R1, W“MPWSGL_REQIDX 


? Quick check - is SVAPTE within 
3 the aggregate extent range ? 


SVAPTE definitely out of range 

Return with SKIP PAGE status 

SVAPTE within the aggregate extent range 
If only one request, specific range is 
identical to aggregate range, so we're don 
Set current request index 


we Ne 


me Se Ne Xe 


#MPWS$C_OPCCRASH, W*MPWSGB_STATE 


GETPFNCTX_CONT 


B*CHECK_PURGE_PAGETYPE 


GETPFNCTX_CONT2 


W“MPWSGQ_ SVAPTE[R1],R2 


R3, (R2) 
50$ 

R3, 4(R2) 
30$ 
R1,40$ 
#4,R1 


CHECK _PURGE_PAGETYPE: 


108: 
208: 


SYSPHD: 


PHDR: 


TSTL 
BNEQ 
MOVL 
RSB 


BBSS 


RSB 


MOVL 
BRB 


SUBL3 
ASHL 
BRB 


R1 
10$ 
#4,R1 


W°MPWSGL_REQIDX, - 
W°MPWSGL_REOFND, 20$ 


G*MMGS$GL_SYSPHD, R5 
GOTPHDR 


G*SWPS$GL_BALSPT, R3,R5 
#7,R5,R5 
GETPHDR 


86 DIGITAL INTERNAL USE ONLY 


?; BR if not OPCCRASH request 


7 Force return through pagetype checking 


We have to check multiple SVAPTE ranges. 
Loop through the requests to see if we have a match. 


R2 = address of SVAPTE range 

SVAPTE high enough ? 

BR if no 

SVAPTE low enough ? 

BR if yes 

Loop until all requests examined or match 
Return SKIP PAGE status 


we Se Ve Me Me Ne Ne 


Is this a pagefile page ? 
BR if no 
Return SKIP PAGE status 


=e Ye Ne 


Show at least one page found 
for this range 


me Ne 


7; ADDRESS OF SYSTEM HEADER 
7;JOIN THE COMMON CODE 


7NO. OF BYTES INTO SPT BEYOND BALSET BASE 
7NO. OF SPT ENTRIES * 512 
#GET PROCESS HEADER ADDRESS 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY~1989 16:36:29 VAX MACRO V5.0-8 Page 25 
X-26 GETPFNCTX 5S-APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 (6) 


1231 PROCESS: 


1232 SUBL3 
1233 GETPHDR: 

1234 DIVL 
1235 ASHL 
1236 MOLL 
1237 ROTL 
1238 ADDL 
1239 GOTPHDR: 

1240 MOVZWL 
1241 BNEQ 
1242 MOVL 
1243 

1244 ASSUME 
1245 EXTZV 
1246 RSB 
1247 408: 

1248 ASSUME 
1249 BITB 
1250 BNEQ 
1251 MOVL 
1252 RSB 


G*SWPS$GL_BALBASE, R3, R5 


GSWPSGL_BSLOTSZ, R5 
#-9,R5,R5 
GSWPSGL_BSLOTSZ, R5 
#9,R5,R5 
G*SWPSGL_BALBASE, R5 


QW“PFNSAW_SWPVBN [RO] , R2 
40$ 
@W*PFNSAL_BAK [RO], R2 


7NO. OF BYTES BEYOND FIRST BAL SET PAGE 


#FORM PROCESS HEADER INDEX 
#;DIVIDE BY PAGE SIZE 
7;CONVERT PROCESS INDEX 
sMULL BY BYTES PER PAGE 
#TO PROCESS HEADER ADDRESS 


7IS SWPVBN SET? 
#BRANCH IF YES 
#GET BACKING STORE ADDRESS 


PFNSV_GBLBAK EQ PTESV_TYPO+1 


#PTESV_TYPO, #2,R2,R1 


PFNS$C_ PROCESS EQ 0 


#GET BACKING STORE ADDRESS TYPE 


#PFNSM_PAGTYP, @W*PFNSAB_TYPE[RO] #REQUIRE SWPVBN PAGE TO BE PROCESS 


60$ 
#3,R1 


1253 608: BUG CHECK BADSWPVBN, FATAL 


?BRANCH IF NOT, ERROR 
7CODE FOR SWPVBN BACKING DESTINATION 


7SWAP VBN ONLY FOR PROCESS PAGES 


DIGITAL INTERNAL USE ONLY 87 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 26 
X-26 PTESCAN - SCAN ADJACENT PTE’S 5-APR-1989 11:28:29 [SYS.SRC]WRTMFYPAG.MAR;1 (7) 


1255 
1256 
1257 
1258 
1259 
1260 
1261 
1262 
1263 
1264 
1265 
1266 
1267 
1268 
1269 
1270 
1271 
1272 
1273 
1274 
1275 
1276 
1277 
1278 
1279 
1280 
1281 
1282 
1283 
1284 
1285 
1286 
1287 
1288 
1289 
1290 
1291 
1292 
1293 
1294 
1295 
1296 
1297 
1298 
1299 
1300 
1301 
1302 
1303 
1304 
1305 
1306 
1307 
1308 
1309 
1310 
1311 


-SBTTL 


BSBW 
INPUTS : 
R3 


RS 
R6 


R7 


R8 
RO 


OUTPUTS : 


CQ so Me Ne Ne Ne Ne Ne Se Ne Ne Se Ne Ne Se Se Se Se Se Se Ne Se Se Se Ne we 3s Se Ne Ne 


HK_ACCESS: 
EXTZV 
TSTL 
BGEQ 
BRB 

PTESCAN: 

MOVL 

EXTZV 

MNEGL 

BRB 


NOTE THAT Rl 


Gwe Se Ne 


CAN NEXT: 
ADDL3 
CMPZV 
BNEQ 

SCAN_NEXT1: 

BICL3 


BEQL 
ASHL 
BNEQ 
CMPL 
BGTR 
CMPZV 


PTESCAN - SCAN ADJACENT PTE’S 


PTESCAN, ROUTINE TO SCAN ADJACENT PAGE TABLE ENTRIES FOR TRANSITION 
PAGES THAT ARE ON THE MODIFIED PAGE LIST AND HAVE THE APPROPRIATE 
BACKING STORE ADDRESS FOR CLUSTERING. 


A SCAN IS MADE BACKWARDS FROM THE SVAPTE AND THEN FORWARDS. 


CALLING SEQUENCE: 


PTESCAN 


SVAPTE TO START SCANNING FROM 

PROCESS HEADER ADDRESS ASSOCIATED WITH THAT SVAPTE 
INDEX TO NEXT AVAILABLE SLOT IN MODIFIED PAGE WRITER 
PTE AND PHVINDEX ARRAYS 

PAGE FILE INDEX IF PAGE FILE PAGE, TYPO BIT CLEAR 
SECTION BACKING STORE ADDRESS IF TYPO BIT SET 

PAGE FILE VBN TO USE IF SCANNING FOR PAGE FILE PAGES 
MAXIMUM NUMBER OF PAGES TO FIND 


R6 UPDATED TO POINT TO NEXT SLOT NOT USED 
R8 = FIRST PAGE FILE VBN NOT USED 
R4,R5,R7 PRESERVED 

RO,R1,R2,R3 SCRATCHED 

R9,R10,R11,AP SCRATCHED 


#VASV_VPN, #VASS_VPN,R3,R1 ;INDEX INTO SYSTEM PAGE TABLE 

@W°MMGSGL SPTBASE(R1] ;IS THIS PAGE OF PAGE TABLE ENTRIES VALID 
SCAN_FORWARD ;BRANCH IF NOT 

SCAN_NEXT1 


R3, AP ;SAVE SVAPTE 

#VASV_VPN, #VASS_VPN,R3,R1 ;KEEP PAGE NUMBER OF SVAPTE 
#4,R11 ;GOING BACKWARDS LOOKING AT PTE’S 
SCAN AGAIN ;LOOK AT NEXT PAGE TABLE ENTRY 


= PAGE NUMBER OF AN ACCESSABLE PTE 


R10,R11,R3 ;FORM NEXT SVAPTE TO CHECK 
#VASV_VPN, #VAS$S_VPN,R3,R1 ;PTE IN SAME PAGE? 
CHK_ACCESS ;BRANCH IF NOT, CHECK ACCESSABILITY 


#°C<PTESM VALID !- 

PTESM TYP1 ! PTESM_TYPO !- 

PTESM BAKX>, (R3),RO 7;GET PFN IF TRANSITION PAGE 
SCAN_FORWARD 7;BRANCH IF DEMAND ZERO PAGE 
#-PTESV_ TYPO, RO,R2 7;VALID, TYP1, TYPO ALL ZERO? 
SCAN_FORWARD 7;BRANCH IF NOT TRANSITION PAGE 
RO, G*MMGSGL_MAXPFN 7IS THIS A LEGAL PFN? 

SCAN FORWARD 7NO (ALSO REJECTS WINDOW PAGES) 
#PFNSV_LOC, #PFN$S_LOC, - 7SEE IF ON MODIFIED PAGE LIST 


88 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY~-1989 16:36:29 VAX MACRO V5.0-8 Page 27 
X-26 PTESCAN - SCAN ADJACENT PTE’S 5-APR-1989 11:28:29 [SYS.SRC]WRTMPYPAG.MAR;1 (7) 


1312. — QW*PFNSAB _ STATE (RO) , #PFNSC_! MFYPAGLST 

1313 BNEQ SCAN_FORWARD ;BRANCH IF NOT ON MODIFIED PAGE LIST 
1314 TSTW @W“PFNSAW_SWPVBN [RO] ;IF SWAP VBN PAGE, 

1315 BNEQ SCAN_FORWARD ;DON’T USE IT 

1316 CMPL R3, QW*PFNSAL_PTE[RO] ;CHECK FOR SPURIOUS MATCH 

1317 BNEQ SCAN_FORWARD ;BRANCH IF SPURIOUS 

1318 MOVL @W*PFNSAL_BAK[RO] , R2 7GET BACKING STORE ADDRESS 

1319 BBS #PTESV_TYPO,R7, 60$ 7BRANCH IF SECTION ADDRESS 

1320 ; 

1221 3; PAGE FILE PAGE, REQUIRE ANOTHER PAGE FILE PAGE WITH SAME PAGE FILE INDEX 
1322 ; 

1323 BBS #PTESV_TYPO,R2,SCAN FORWARD ;BRANCH IF SECTION PAGE 

1324 CMPZ2V #PFNSV "PGELX, #PENSS PGFLX,R2,R7 ;SAME PAGE FILE INDEX? 

1325 BEQL SCAN_AGAIN ;BRANCH IF YES 

1326 BRB SCAN FORWARD z;NOT SAME PAGE FILE 

1327 ; 

1328 ; SECTION PAGE, MUST CHECK FOR SECTION BACKING STORE TYPE AND SAME BACKING STORE 
1329 ; 
1330 608: CMPI R2,R7 ¢SAME SECTION? 

1331 BNEQ SCAN_FORWARD ;BRANCH IF NOT 

1332 SCAN_AGAIN: 

1333 MOVL R3,R10 ;ADDRESS OF LAST PTE CHECKED 

1334 SOBGTR R9,SCAN_NEXT ;BRANCH IF MORE PAGE FILE VBN’S TO USE 
1335 ; INCL L*MPWSL_BACKUPFAIL (R11) ; COUNT FAILURE FOR EITHER DIRECTION 
1336 BRB SCAN_DONE s;ALLOCATED PAGE FILE EXHAUSTED, 

1337 ;WRITE THE CLUSTER 

1338 ; 

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

1340 ; IF NOT ALREADY SCANNING FORWARD 

1341 ; 

1342 SCAN_FORWARD: 

1343 MNEGL R11,Ri1 ; SWITCH DIRECTION OF PTE SCAN 

1344 BLSS SCAN_DONE 7;PTE SCAN COMPLETE IF ALREADY SCANNED FORWAR 
1345 MOVL AP, R3 ;GET STARTING PTE ADDRESS 

1346 MOVL R10, AP ;RECORD THIS AS STARTING PTE ADDRESS 
1347 ;SINCE IT IS LEQU THAN STARTING PTE 
1348 MOVL R3,R10 ; START FORWARD FROM ORIGINAL START PTE 
1349 BRB SCAN NEXT ; CONTINUE THE PTE SCAN 

1350 ; 

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

1352 ; R7 = PAGE FILE INDEX OR SECTION BACKING STORE ADDRESS 

1353 ; IF PTESV_TYPO IS SET, NO BACKING STORE MANIPULATION 

1354 ; R9 PRESERVED FROM HERE ON 

1355 : R10 PRESERVED FROM HERE ON IF AP LEQU R10 

1356 ; 

1357 SCAN_DONE: 

1358 CMPL AP, R10 7;GET PTE ADDRESSES IN ORDER 

1359 BLEQU 40s ;BRANCH IF R10 IS TOP OF RANGE 

1360 MOVL R10,R0 ; SAVE BOTTOM OF RANGE 

1361 MOVL AP, R10 7;HIGH END OF RANGE 

1362 MOVL RO, AP ;LOW END OF RANGE 

1363 ; 

1364 ; AP = FIRST PTE ADDRESS, R10 = LAST PTE ADDRESS INCLUSIVE 

1365 ; ALL PFN’S IN THESE PTE’S ARE ON THE MODIFIED PAGE LIST AND 

1366 ; ARE FROM THE SAME PAGE FILE OR SECTION 

1367 ; 

1368 40S: BICL3 #°C<PTESM PFN>, (AP)+,R11 ;GET PAGE FRAME NUMBER 


DIGITAL INTERNAL USE ONLY 89 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 28 . 
X-26 PTESCAN - SCAN ADJACENT PTE’S 5-APR-1989 11:28:29 [SYS .SRC]WRIMFYPAG .MAR;1 (7). 


1369 
1370 
1371 
1372 
1373 
1374 
1375 
1376 
1377 
1378 
1379 
1380 
1381 
1382 
1383 
1384 
1385 
1386 
1387 
1388 
1389 
1390 
1391 
1392 
1393 
1394 
1395 
1396 
1397 
1398 
1399 
1400 
1401 


we 


65$: 


80S: 


1008: 


MOVL R11, @W“MPWSAL_PTE[R6] 7;STORE PFN IN PTE ARRAY 
MOVW PHDSW_PHVINDEX (RS) , QW“MPWSAW_PHVINDEX[R6] ;STORE THE ASSOCIATED 
7PROCESS HEADER VECTOR INDEX 

INCL R6 7;NEXT PTE INDEX 

INCL MPWSL_COUNT 7;COUNT PAGES IN THIS CLUSTER 

BBS #PTESV_TYPO,R7, 65$ 7BRANCH IF SECTION PAGE 

BICL3 #°C<PFNS$M_PGFLVBN! PFNSM_PRCPGFLX>,- ; Fetch page file VBN and 
@W*PFNSAL BAK(R11],R2 +; PROCESS page file index 

BITL #PFNSM_PGFLVBN, R2 ; Backing store already assigned ? 

BNEQ 100$ 7 BR if yes; BUGCHECK 

INSV R7, #PFNSV_PGFLX, - 7 Insert SYSTEM page file index 

#PFNSS_PGFLX, R2 7 into its backing store field 

BISL3 R2,R8,- 7 Merge allocated VBN into the 
Q@W*PFNSAL_ BAK [R11] 7 backing store address 

INCL R8 ?;NEXT PAGE FILE VBN 

MOVL R11, R0 7PFN TO CONVENTIONAL REGISTER 

MOVZBL #PFNSC_MFYPAGLST, R2 7 INDEX TO MODIFIED PAGE LIST 

JSB G“MMGSREMPFN 7REMOVE PAGE FROM MODIFIED PAGE LIST 

BICB3 #<PFNSM_MODIFY ! PFNSM_LOC>,- ;SHUT OFF MODIFY BIT 
QW“PFNSAB STATE [RO],R1 

BISB3 #PFNSC_WRTINPROG, R1, @W*PFNSAB_STATE(RO] ;SET WRITE IN PROGRESS 

INCW @W*PFNSAW_REFCNT [RO] 7AND COUNT AN I/O REFERENCE 

CMPZV #PENSV_PAGTYP, #PFNSS_PAGTYP,- ;IF PROCESS PAGE TABLE PAGE 
Q@W“PENSAB_TYPE[RO], #PENSC_PPGTBL 

BNEQ 80$ 

MOVZWL PHDSW_PHVINDEX(R5),R1 7 THEN MUST COUNT A PROCESS HEADER REF 

INCW @W“PHVSGL_REFCBAS [R1] 

CMPL AP,R10 7DONE LAST PTE IN RANGE? 

BLEQU 40$ 7BRANCH IF MORE TO DO 

RSB 


BUG CHECK MODRELNBAK, FATAL 7BACKING STORE VBN FOR MODIFIED PAGE 


90 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 29 
X-26 PURGEMPL - Setup to selectively flush pa 5-APR-1989 11:26:29 [SYS.SRC]WRIMFYPAG.MAR;1 ( 


1403 -SBTTL PURGEMPL - Setup to selectively flush pages from MPL 
1404 3++ 

1405 ; Functional description: 

1406 ; 

1407 ; This routine accepts requests for selective flushing, or purging, 
1408 ; of the modified page list and does the necessary setup for 
1409 ; the mainline modified page writing code. 
1410 ; 

1411 ; CALLING SEQUENCE: 

1412 ; 

1413 ; JSB MMGSPURGEMPL 

1414 ; 

1415 ; INPUT PARAMETERS: 

1416 ; 

1417 ; RO<7:0> = Request type 

1418 ; 

1419 ; 0 Reserved 

1420 ; 

1421 ; , MAINTAINence purge request 
1422 ; 

1423 ; 2 SVAPTE range request 

1424 ; Low/high SVAPTE in R1/R2 
1425 ; 

1426 ; 3 OPCCRASH purge request 
1427 ; 

1428 ; RO<31:8> = Request-type specific modifiers 
1429 

1430 ; R1 = Request-type specific parameter 
° 1431 ; R2 = Request-type specific parameter 
1432 ; 

1433 ; IMPLICIT INPUTS: 

1434 ; 

1435 ; IPL = SYNCH, MMG spinlock held 

1436 ; 

1437 ; OUTPUT PARAMETERS: 

1438 ; 

1439 ; RO, R1, R2 destroyed 

1440 ; 

1441 ; IMPLICIT OUTPUTS: 

1442 ; 

1443 ; Selective modified page list flushing has been initiated 
1444 ; 

1445 ; COMPLETION CODES: 

1446 ; 

1447 ; NONE 

1448 ; 

1449 ; SIDE EFFECTS: 

1450 ; 

1451 ; NONE 

1452 ; 

1453 ;-- 

1454 

1455 UNIVERSAL SYMBOL MMGS PURGEMPL 

1456 ;MMGSPURGEMPL: : 

1457 IF DF, DEBUG 

1458 IF EQ, DEBUG~2 

1459 BLBC G*SGNS$GL_VMSD1, 10$ 


DIGITAL INTERNAL USE ONLY 91 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 30 
X-26 PURGEMPL ~- Setup to selectively flush pa 5-APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 ( 


1460 BBC #1,G*SGN$GL_VMSD1,5$ 

1461 BRW WAKE_MPW 

1462 5$: JSB G*INISBRK 

1463 108: 

1464 -ENDC 

1465 -ENDC 

1466 

1467 ASSUME MPWSC_IDLE EQ 0 

1468 ASSUME MPWSC_MAINTAIN EQ 1 

1469 ASSUME MPWSC_SVAPTE EQ 2 

1470 ASSUME MPWSC_OPCCRASH EQ 3 

1471 CASE RO, <- 

1472 BADREQTYPE, - ? Reserved/illegal request 

1473 MAINTAIN, - + MAINTAINence purge request 

1474 SVAPTE, - 7 SVAPTE range request 

1475 OPCCRASH, ~- 7 OPCCRASH purge request 

1476 >, TYPE=B 

1477 BADREQTYPE: 

1478 BUG _ CHECK WRTPGSBAK, FATAL 

1479 

1480 -ENABLE LSB 

1481 OPCCRASH: 

1482 MOVB #MPWSC_OPCCRASH, - 7 Set MPL purge state 

1483 W°MPWSGB_ STATE 

1484 CLRB W“MPWSGB_REQCNT 7 OPCCRASH preempts all other requests, 
1485 CLRL RO 7 80 show no outstanding requests 

1486 MOVL  #<1@31>,R1 7 SVAPTE low = 80000000 

1487 ADDL3 #<<1@30>-4>,R1,R2 3; SVAPTE high = BFFFFFFC 

1488 BBCCI S*#SCHSV_TCD,G*SCHS$GB_SIP,45$ ; Enable threshold checking 

1489 BRB 45$ 

1490 

1491 408: BSBW CHECK_SVAPTE 3; Check for duplicate request 

1492 7 (Returns to caller if duplicate found) 
1493 CMPL R1,W°MPWSGL_SVAPTELOW ; Set lowest SVAPTE seen so far 

1494 BGEQU) 418 

1495 MOVL R1,W*MPWSGL_SVAPTELOW 

1496 418: CMPL R2,W*MPWSGL_SVAPTEHIGH ; Set highest SVAPTE seen so far 

1497 BLEQU) 42$ 

1498 MOVL R2, W“MPWSGL_SVAPTEHIGH 

1499 428: CMPB RO, #MPWSC_MAXREQCNT 7 Exceeded maximum number of pending request 
1500 BLSSU 508 ; BR if no to join common exit code 

1501 ; 

1502 ; The maximum number of concurrent SVAPTE requests has been exceeded. Since all 
1503 ; callers of this routine can tolerate premature reactivation (from the RWMPB wait 
1504 ; state), we simply drop all current requests on the floor. Note that the MPWBUSY 
1505 ; resource will be declared available during the MPW thread termination processing. 
1506 ; 

1507 ; This stategy assumes that the request list does not artificially fill up with 
1508 ; duplicate requests (prevented by CHECK _SVAPTE), that the probability of exceeding 
1509 ; the maximum request count is very. small, and that the probability of having this 
1510 ; situation immediately recur (due to unsatisfied, pending requests) is also very sm 
1511 ; 

1512 CLRL RO 3 Show no outstanding requests 

1513 CLRB W“MPWSGB_REQCNT 

1514 BRB 45$ 7 Make this request the sole request 

1515 


1516 SVAPTE: 


92 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


_WRTMFYPAG ~ WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 31 
X-26 PURGEMPL - Setup to selectively flush pa 5-APR-1989 11:28:29 [SYS.SRC]WRTMFYPAG.MAR;1 ( 


1517 -IF _ DF,PERF_STATS 

1518 INCL G*PMS$GL_RESERVED18 

1519 -ENDC 

1520 CMPB #MPWSC_SVAPTE, - # Is higher rank request is pending ? 

1521 W“MPWSGB_ STATE 

1522 BLSSU 100$ 7 BR if yes (ignore this request) 

1523 MOVB #MPWSC_SVAPTE, - 7 Set MPL purge state 

1524 W“MPWSGB_STATE 

1525 MOVZBL W°MPWSGB_REQCNT, RO RO = current number of pending requests 
£326 BNEQ 40$ BR if there are any, else do things the ea 


1527 45$: MOVQ. R1,W*MPWS$GL_SVAPTELOW 


Aggregate extent range is identical to req 
1528 50S: MOVO R1,W°*MPWSGQ_ SVAPTE[RO] 


Set extent range for this request. 


Re Ve Te Se Ve 


1529 INCB W“MPWSGB_REQCNT Show one more pending request 

1530 ; BRB WAKE_MPW 

1531 ; 

1532 WAKE_MPW: 

1533 CLRL G*SCHSGL_MFYLOLIM 7 Indicate MPL flush desired 

1534 CLRL G*SCHS$GL_MFYLIM 

1535 1008: RSB 

1536 

1537 MAINTAIN: 

1538 IF DF, PERF_ STATS 

1539 INCL G“PMS$GL_RESERVED17 

1540 -ENDC 

1541 MOVL G“SCHSGL_MFYLOSV, R2 7 Assume flushing to MPW_LOLIMIT 

1542 BBC #MPWSV_LOLIMIT,RO,150$ ; BR if assumption is correct 

1543 CMPL R1,R2 ; 7 Parameter > MPW_LOLIMIT ? 

1544 BLEQU 150$ 7; BR if no - ignore parameter 

1545 MOVL R1,R2 3 Else use parameter 

1546 1508: CMPB #MPWSC_MAINTAIN, - ; Is same or higher rank request pending ? 
1547 W“MPWSGB_STATE 

1548 BLSSU 200$ 7 BR if higher rank pending (ignore this reg 
1549 BNEQ 175$ 7 BR if no previous MAINTAIN request 
1550 CMPL R2,G*SCH$GL_MFYLIM 7 Is requested new limit lower than old limi 
1551 BGEQU 200$ 7 BR if not (ignore this request) 
1552 1758: MOVB #MPWSC_MAINTAIN, - 7 Set MPL purge state 

1553 W“MPWSGB_STATE 

1554 MOVL R2,G*SCHSGL_MFYLIM 7 Start modified page writing 

1555 MOVL R2, G*SCHS$GL_MFYLOLIM 7 Set new low limit 

1556 BBCCI S“*#SCHS$V_TCD,G*SCH$GB_SIP,200$ ; Enable threshold checking 
1557 2008: RSB 

1558 

1559 -DISABLE LSB 

1560 

1561 ; Check for duplicate SVAPTE request. These can occur if a process makes such 
1562 ; a request, is placed into RWMPB, and then reawakened when the modified page 
1563 ; count reaches MPW LOWAITLIMIT, but before all requested pages have been 
1564 ; written. 

1565 ; 

1566 ; RO = current request count (known to be > 0) 

1567 ; R1,R2 = SVAPTE range for which to search 

1568 ; (SP) = return address (in this module) 

1569 ; 4(SP) = return address of caller of MPWSPURGEMPL 

1570 ; 

1571 ; If a duplicate request is found, control returns directly to the caller 
1572 ; of MPWSPURGEMPL. 

1573 


DIGITAL INTERNAL USE ONLY 93 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG ~- WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 32 
X-26 PURGEMPL - Setup to selectively flush pa 5-APR-1989 11:28:29 [SYS.SRC]WRTMFYPAG.MAR;1 ( 


1574 CHECK_SVAPTE: 

1575 PUSHL RO 
1576 10$: SOBGEQ R0,50$ 
1577 20$:  POPL RO 


Save current request count 


=e 


Restore current request count 


=e 


1578 RSB 

1579 50S: PUSHAQ W“MPWSGQ_SVAPTE[R0O} 3; Low limit matches ? 

1580 CMPL R1, @(SP)+ 

1581 _ BNEQ 10$ 7 No - examine next entry 

1582 PUSHAQ W“MPWSGQ SVAPTE+4 {RO] # High limit matches ? 

1583 CMPL R2, @(SP)+ 

1584 BNEQ 10$ 3 No - examine next entry 

1585 ADDL2 #8,SP 3 Remove saved RO and return address 
1586 RSB 3 Return to caller of MPWSPURGEMPL 
1587 


94 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMPYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO VS.0-8 Page 33 
X-26 MMGSMPW_END - Terminate current MPW thre 5-APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 { 


1589 ~SBTTL MMGSMPW_END - Terminate current MPW thread 

1590 ;++ 

1591 ; Functional description: 

1592 ; 

1593 ; This routine does all of the necessary end of thread 

1594 ; cleanup for the modified page writer. 

1595 ; 

1596 ; CALLING SEQUENCE: 

1597 ; 

1598 ; JSB MMGSMPW_END 

1599 ; 

1600 ; INPUT PARAMETERS: 

1601 ; 

1602 ; NONE 

1603 ; 

1604 ; IMPLICIT INPUTS: 

1605 ; 

1606 ; IPL = SYNCH, MMG spinlock held 

1607 ; 

1608 ; OUTPUT PARAMETERS: 

1609 ;— 

1610 ; RO, R1, R2 destroyed 

1611 ; 

1612 ; IMPLICIT OUTPUTS: 

1613 ; ; 

1614 ; End of thread processing complete 

1615 ; MPW state correctly set 

1616 ; 

1617 ; COMPLETION CODES: 

1618 ; 

1619 ; NONE 

1620 ; 

1621 ; SIDE EFFECTS: 

1622 ; 

1623 ; NONE 

1624 ; 

1625 3-- 

1626 

1627 ;2eeesee sce Ss SE SAAS SEAS SSE 
1628 ; Declare Threshold HI/LO 

1629 ; IOCNT REQFAIL STATE MPWBUSY MPLEMPTY Checking Limits WAKEPEN MPW_ SIP 
1630 3 weer meme nnn wenn eee enn em meer nn Sommer ernn Seer enn e cee weres soreen= 
1631 ; /= 0 x (Outstanding I/0) Unchanged Unchanged N (1) 
1632 ; MAINTAIN Y(1) N 

1633 ; SVAPTE Y(2) N 

1634 ; OPCCRASH Y(2) N 

1635 ; 

1636 ; == 0 == 0 (Normal termination) (Enabled) Restored Y 0 
1637 ; New state = IDLE 

1638 ; MAINTAIN Y(1) N 

1639 ; SVAPTE Y(2) N 

1640 ; OPCCRASH N Y(2) 

1641 ; 

1642 ; == 0 /=0 (Abnormal termination) Enabled Unchanged N 0 
1643 ; New state = old state 

1644 ; MAINTAIN Y¥(1) N 

1645 ; SVAPTE Y(2) N 


DIGITAL INTERNAL USE ONLY 95 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRTMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 34 
X-26 MMGSMPW_END - Terminate current MPW thre 5-APR-1989 11:28:29 [SYS.SRC]WRTMFYPAG.MAR;1 ( 


1646 ; Enabled Restored ._ Y 0 
1647 ; New state = IDLE 

1648 ; OPCCRASH N Y(2) 

1649 ; 

1650 ; Notes: 

1651 ; (1) Event is conditionally declared based upon comparision of modified 
1652 ; page count and MPW_LOWAITLIMIT. 

1653 ; (2) Event is unconditionally declared. 

1654 3; Sse es SSeS SS SSS SSS SS SS eS se SS ae ee ee ee ee ea ee tee ee ee et ee 
1655 MMGSMPW_END:: 

1656 MOVL G*SCHS$GL_MFYCNT, R6 7 Get modified page count for compares 
1657 TSTB W*MPWSGB_IOCNT 

1658 BEQL 10$ 7; BR if no outstanding MPW I/O 

1659 ASSUME MPWSC_SVAPTE EQ 2 

1660 ASSUME MPWSC_OPCCRASH EQ 3 

1661 BBS #1,W°MPWSGB_STATE, 4$ 7; BR if state is SVAPTE or OPCCRASH 
1662 CMPL R6,G*MPWSGL_LOWAITLIM =; At or below low busy wait threshold ? 
1663 BGTRU 5$ 7; BR if no ; 
1664 4S: MOVZBL #RSNS$_MPWBUSY, RO 7; Set resource wait that is satisfied 
1665 JSB G*SCHSRAVAIL : Declare modified page writer done 
1666 5S: RSB 

1667 7 No outstanding 1/0 

1668 10S: TSTL W*MPWSGL_REQFAIL + Any failures to write pages ? 

1669 BNEQ 100$ ; BR if yes 

1670 BBCCI S*#SCHSV_TCD,G*SCHSGB_SIP,12$ ; Enable threshold checking 

1671 12S: MOVL G*SCHSGL_MFYLIMSV, G*SCH$GL_MFYLIM 7 Restore high limit 

1672 MOVL G*SCHS$GL_MFYLOSV, G*SCHSGL_MFYLOLIM ; Restore low limit 

1673 MOVL G“CTLSGL_PCB, RO 7; Get PCB address 

1674 BBSS #PCBSV_WAKEPEN, PCBSL_STS(RO),15$ ; Set wake pending to force 
1675 7; swap schedule re-evaluation 
1676 15$: 

1677 ASSUME MPWSC_IDLE EQ 0 

1678 ASSUME MPWSC_MAINTAIN EQ 1 

1679 ASSUME MPWSC_SVAPTE EQ 2 

1680 ASSUME MPWSC_OPCCRASH EQ 3 

1681 

1682 MOVZBL W*“MPWSGB_STATE, RO ? Fetch MPW state 

1683 ASSUME MPWSGB_REQCNT EQ MPWSGB_STATE+1 

1684 CLRW W“MPWSGB_ STATE ; Set state to IDLE; show zero requests 
1685 CASE RO, <17$,30$,40$,20$> 7 BR on MPW state 

1686 1758: BUG CHECK WRTPGSBAK, FATAL 

1687 

1688 20S: MOVZBL #RSN$_MPLEMPTY, RO 3; Set resource wait that is satisfied 
1689 BRB 45$ 

1690 308: CMPL R6,G*MPWSGL_LOWAITLIM ; At or below low busy wait threshold ? 
1691 BGTRU 50$ 7 BR if no 

1692 408: MOVZBL #RSNS$_MPWBUSY, RO 3; Set resource wait that is satisfied 
1693 458: JSB G*SCHSRAVAIL ? Declare modified page writer done 
1694 50S: BBCCI S*#SCHSV_MPW,G*SCHSGB SIP,60$ ;MODIFIED PAGE WRITER INACTIVE 
1695 60S: RSB 

1696 


1697 100$: BBCCI S*#SCHSV_TCD,G*SCH$GB_SIP,105$ ; Enable threshold checking again 
1698 1058S: 


1699 ASSUME MPWSC_IDLE EQ 0 
1700 - ASSUME MPWSC_MAINTAIN EQ 1 
1701 ASSUME MPWSC_SVAPTE EQ 2 
1702 ASSUME MPWSC_OPCCRASH EQ 3 


96 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMFYPAG - WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 35 ie 
X~-26 MMGSMPW_END - Terminate current MPW thre 5-APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 ( 


1703 

1704 CASE W“MPWSGB._ STATE, - 3 BR on MPW state 
1705 <107$,30$,110$,12$>,- 

1706 TYPE=B 

1707 1078: BUG CHECK - WRTPGSBAK, FATAL 

1708 ; 

1709 1108: PUSHAB B*40$ 3; Do SVAPTE request cleanup 
1710 ; BRB PURGEMPL_CLEANUP # Call routine by falling through... 
“1711 . 
i712 -SBTTL PURGEMPL CLEANUP - Remove any DEAD MPL purge requests 
1713 ;++ 

1714 ; Functional description: 

1715 ; 

1716 ; This routine removes any DEAD MPL purge requests from 
1717 ; the current set of requests. A DEAD request is one for 
1718 ; which no pages were found in the current invocation of 
1719 ; the modified page writer. 

1720 ; 

1721 ; CALLING SEQUENCE: 

1722 ; 

1723 ; JSB MMGSPURGEMPL CLEANUP 

1724 ; 

1725 ; INPUT PARAMETERS: 

1726 ; 

1727 ; bit masks of requests with processed pages 

1728 ; 

1729 ; IMPLICIT INPUTS: 

1730 ; 

1731 ; IPL = SYNCH, MMG spinlock held 

1732 ; 

1733 ; OUTPUT PARAMETERS: 

1734 ; 

1735 ; RO, R1, R2 destroyed 

1736 ; 

1737 ; IMPLICIT OUTPUTS: 

1738 ; 

1739 ; NONE 

1740 ; 

1741 ; COMPLETION CODES: 

1742 ; 

1743 ; NONE 

1744 ; 

1745 ; SIDE EFFECTS: 

1746 ; 

1747 ; NONE 

1748 ; 

1749 ;-- 

1750 

1751 MMGSPURGEMPL CLEANUP: : 

1752 IF DF, DEBUG 

1753 IF EQ, DEBUG-2 

1754 BLBC G*SGN$GL_VMSD1, 2$ 

1755 BBC #1,G*SGNSGL VMSD1,1$ 

1756 RSB = 

1757 18: JSB G*INISBRK 

1758 28: 

1759 -ENDC 


DIGITAL INTERNAL USE ONLY 97 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


WRIMPYPAG ~- WRITE MODIFIED PAGES 10-MAY-1989 16:36:29 VAX MACRO V5.0-8 Page 36 
X-26 PURGEMPL CLEANUP - Remove any "dead" MPL 5-APR-1989 11:28:29 [SYS.SRC]WRIMFYPAG.MAR;1 ( 


1760 -ENDC 

1761 CMPB #MPWSC_SVAPTE, - 3; If current state is not SVAPTE, 

1762 W“MPWSGB_ STATE 

1763 BNEQ 10$ # just return quietly 

1764 MCOML W*MPWSGL_REQFND, RO # In RO, form bit mask of requests that 
1765 BICL3 RO,W*MPWSGL_REQFAIL,RO ; are to remain pending 

1766 MOVZBL W*MPWSGB_REQCNT, R2 3 Get request count 

1767 DECL R2 7 Convert to maximum index 

1768 BNEQ 20$ ? BR if more than one pending request 
1769 BLBS RO, 10$ 3 If sole entry should be kept, just return 
1770 5$: : 

1771 ASSUME MPWSGB_REQCNT EQ MPWSGB_STATE+1 

1772 CLRW W“MPWSGB_STATE # Set state to IDLE; show zero requests 
1773 108: RSB 

1774 

1775 208: CLRL R1 

1776 308: BBS R1,R0,50$ # Next entry if this one should be kept 
1777 MOVQ W“*MPWSGQ SVAPTE([R2],- ; Move last pending request to new slot 
1778 W“MPWSGQ_ SVAPTE[R1) 

1779 CLRQ W“MPWSGQ_SVAPTE (R2] 

1780 BBC R2,R0, 40$ 7 If old bit was clear, nothing to do 
1781 BBSS R1, RO, 40$ 3 Else set new bit 


1782 408: DECL R2 
1783 50$: AOBLEQ R2,R1,30$ 


Show one less pending request 


1784 7 R2 = # pending requests - 1 

1785 ADDB3 = #1, R2, W*MPW$GB_REQCNT =; Update pending request count 

1786 BEQL 5$ ? BR if no remaining, pending requests 
1787 RSB 

1788 

1789 -END 


98 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


3 SYSQIOREQ.LIS 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 0 
Table of contents 


(2) 
(3) 
(4) 
(5) 
(6) 
(7) 
(8) 
(9) 
(9) 
(10) 
(11) 


126 
220 
266 
717 
865 
950 
974 
1114 
1192 
1234 
1322 


DECLARATIONS 

QIO ERROR AND EXCEPTION HANDLING ROUTINES 
QUEVE 1/0 REQUEST 

BUILD I/O PACKET FOR PAGE BERD (WPI TE 
COMPLETE I/O OPERATION 

QUEUE I/O PACKET TO DRIVER 

EXESALTQUEPKT ~ Call driver ALTSTART entry point 
QUEUE I/O PACKET TO ACP 

EXESQXQPPKT - QUEUE I/O PACKET TO XQP 
INSERT I/O PACKET IN UNIT QUEUE 

INSERT I/O PACKET IN QUEUE BY PRIORITY 


DIGITAL INTERNAL USE ONLY 99 : 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 1 
X-25 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (1) 


1 
2 -TITLE SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 
3 -IDENT ‘'X-25' 
4 
53 
6 III III IOI III IOI IOI III TOTO TOT TOT TTT OT TTT TTA AAAI IAI Fe 
7 3* * 
8 ;* COPYRIGHT (c) 1978, 1980, 1982, 1984 BY * 
‘ 9 3* DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. * 
10 ;* ALL RIGHTS RESERVED. | * 
11 3* * 
12 ;* THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED * 
13 ;* ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE * 
14 ;* INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER * 
15 ;* COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY * 
16 ;* OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY * 
17 ;* TRANSFERRED. ® 
18 ;* * 
19 ;* THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE * 
20 ;* AND SHOULD NOT BE cCONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT * 
21 ;* CORPORATION. * 
22 ;* * 
23 ;* DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS * 
24 ;* SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. * 
25 3* * 
26 * * 
279 III IIIT JOO TOUT T I ION 
28 ; 
29 ++ 
30 ; 
31 ; AUTHOR: 
32 ; 
33 ; D. N. CUTLER, 14-JUN-76 
34 3 
35 ; FACILITY: 
36 ; 
37 ; SYSTEM SERVICE QUEUE I/O REQUEST 
38 ; 
39 ; MODIFIED BY: 
40 ; 
41; X-25 EMB0403 Ellen M. Batbouta 24-Apr-1989 
42 ; Preserve R5 across the call to the driver’s alternate 
43 ; STARTIO routine in EXESALTQUEPRT. 
44; 
45 ; X-24 EMB0356 Ellen M. Batbouta 17-Aug-1988 
46 ; When checking for device affinity in EXESALTQUEPKT, 
47 ; a special check must be made for affinity to the primary, 
48 ; since primary affinity is specified by the value, zero.. 
49 ; 
50 ; X~-23 EMB0337 Ellen M. Batbouta 15-Aug-1988 
51 ; Add a new busy bit, ALTBSY, and wait queue to the UCB 
52 3 for the alternate startio routine, EXESALTQUEPKT. This 
53 3; will maintain the correct ordering of I/Os to the driver 
54 ; when a CPU switch must be made because of device affinity. 
55 ; 
56 ; X-22 RNG5022 Rod Gamache 7-Apr-1988 
37 3 Make I/0’s thru FINISHIO/ABORTIO complete synchronously. 


“100 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 2 
X-25 24-APR-1989 14:49:16 [SYS.SRC)SYSQIOREQ.MAR;1 (1) 


58 ; 
59 ; X-21 “RNG5O21 Rod Gamache 31-Jan-1988 
60 ; Don’t access POST queue directly - use SMPSIOPOST_IRP. 
61; — 
62 3 X-20 ACGO544 Andrew C. Goldstein, 6-Jan-1988 14:23 
63 ; Remove taking of forklock in EXESQIOACPPRT 
64 ; es raver | 
65 ; X-19 RNGS5O19 ~~ Rod Gamache 24-Apr-1987 
66 ; Add support of unmodified device drivers by checking 
67 ; UCBSB_FLCK for a FIPL vs. a FLCK. 
68 ; 
69 ; X-18 SUF Stu Farnham 20-Mar-1987 
70 ; Fix broken branch. 
71 3 
72 3 X~17 SF04002 Stephen Fiorelli 07-Mar-1987 
73 3 Use vms standard name for system primitives data. 
14 3 
75 3 X-16 WCT0032 Ward C. Travis 19-Feb-1987 
76 3 Update remaining old lookaside listhead references 
17 3 to reflect that they are now interlocked queues. 
78 ; 
79 3 X-15 RNG5015 Rod Gamache 15-Jan-1987 
80 3 Make some performance optimizations. 
81 7 
82 ; X-14 wmco014 Wayne Cardoza 06-Jan-1987 
83 ; Change some JSBs to BSBWs. 
84 ; 
85 ; X-13 ROW73864 Ralph 0. Weber 04-DEC-1986 15:35 
86 ; Change IOCSVERIFYCHAN part of the S$QIO system service so that 
87 ; it returns SS$_IVCHAN for unassigned channels, not SS$ NOPRIV. 
88 ; 
89 ; X~-12 ACG0525 Andrew C. Goldstein, 27-Aug-1986 15:47 
90 ; Decrement process I/O count before queuing packet in BLDPKT. 
91; 
92 ; X-11 RNGOO11 Rod Gamache 29-Oct-1986 
93 3 Fix branch errors. 
94 ; 
95 ; X-10 RNGOO10 Rod Gamache 22-Oct-1986 
96 ; Make all AQB queues interlocked queues - implies that 
97 ; entries can only be inserted on the tail of the AQB queue. 
98 ; 
99 ; X-9 SSAO0001 Stan Amway 13-Oct-1986 
100 ; . Add entry point EXESBLDPKTMPW. 
101 ; 
102 ; X~-8 RNGOOOS8 Rod Gamache 30-Sep-1986 
103 ; Make sure mods to PCBSW DIOCNT & BIOCNT are interlocked. 
104 ; 
105 ; X~7 RNGOO007 Rod Gamache 24-Sep-1986 
106 ; Interlock access to PCBSL_EFCS. 
107 ; Don't check packet type when going thru EXESALTQUEPRT. 
108 ; Save RS around calls to IOCSINITIATE. 
109 ; 
110 ; X-4 SUF Stu Farnham 1-Jul-1986 
111 ; Use per-CPU IOPOST queue 
112 ; 
113 ; V04-003 RNG4003 Rod Gamache 4-Jun-1986 
114 ; Fix branch destination errors. 


DIGITAL INTERNAL USE ONLY 101 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 3 
X-25 24-APR~-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (1) 


115 ; 

116 ; v0O4-001 SF04001 Stephen Fiorelli 24-Oct-1985 

117 ; System_service macro used to declare entry point 

118 ; and build system service descriptor block. 

119 ; Added $SYSVECTORDEF . 

120 ; 

121 ; V0O4-001 ACG0467 Andrew C. Goldstein, 12-Sep-1984 17:33 
122 ; Fix protection holes in QIO device protection check 

123 ; 

124 3-- 


102 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 


DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 4 
X-25 DECLARATIONS 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (2) 


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 
172 
173 
174 
175 
176 
177 
178 
179 
180 
181 
182 


-SBTTL DECLARATIONS 


MACRO LIBRARY CALLS 


we “Ne Ne 


SACBDEF . 
SAQBDEF 
SCADEF 
SCCBDEF 
SCDRPDEF 
SCPUDEF 
SDDBDEF 
SDDTDEF 
SDEVDEF 
SDYNDEF 
$F11BDEF 
SIODEF 
SIPLDEF 
SIRPDEF 
SPCBDEF 
SPHDDEF 
SPRDEF 
SPRIDEF 
SPRVDEF 
SPSLDEF 
SRSNDEF 
SSECDEF 
SSSDEF 
$SYSVECTORDEF 
$$SYSTEM_PRIM DATADEF 
SUCBDEF 
SVCBDEF 
SWCBDEF 


we Ne 


LOCAL SYMBOLS 


ARGUMENT LIST OFFSET DEFINITIONS 


we Ye Ne 


EFN=4 
CHAN=8 
FUNC=12 
IOSB=16 


7; DEFINE 
; DEFINE 
7; DEFINE 
7; DEFINE 
7 DEFINE 
?; DEFINE 
; DEFINE 
7; DEFINE 
; DEFINE 
; DEFINE 
7; DEFINE 
; DEFINE 
; DEFINE 
?; DEFINE 
? DEFINE 
; DEFINE 
; DEFINE 
; DEFINE 
7; DEFINE 
; DEFINE 
; DEFINE 
7; DEFINE 
?: DEFINE 
; DEFINE 
7; DEFINE 
; DEFINE 
; DEFINE 
; DEFINE 


ACB OFFSETS 

AQB OFFSETS 

CONDITIONAL ASSEMBLY PARAMETERS 
CCB OFFSETS 

CDRP OFFSETS 

CPU DATABASE OFFSETS 

DDB OFFSETS 

DDT OFFSETS 

DEV VALUES 

DATA STRUCTURE TYPE CODES 
F11BXQP OFFSETS 

IO FUNCTION CODES 

INTERRUPT PRIORITY LEVELS 
IRP OFFSETS 

PCB OFFSETS 

PHD OFFSETS 

PROCESSOR REGISTERS 

PRIORITY CLASS INCREMENTS 
PRIVILEGE BITS 

PROCESSOR STATUS FIELDS 
RESOURCE WAIT NUMBERS 

SEC OFFSETS 

STATUS VALUES 

SYSTEM SERVICE VECTOR OFFSETS 
SYSTEM PRIMITIVES DATA AREA 
UCB OFFSETS : 
VCB OFFSETS 

WINDOW CONTROL BLOCK OFFSETS 


;EVENT FLAG NUMBER 

7I1/O CHANNEL NUMBER 

:I/O FUNCTION CODE 

sADDRESS OF I/O STATUS BLOCK 


ASTADR=20 
ASTPRM=24 


P1=28 
P2=32 
P3=36 
P4=40 
P5=44 
P6=48 


;ADDRESS OF AST SERVICE ROUTINE 

;AST SERVICE ROUTINE PARAMETER 

;FIRST FUNCTION DEPENDENT PARAMETER 
;SECOND FUNCTION DEPENDENT PARAMETER 
7;THIRD FUNCTION DEPENDENT PARAMETER 
;FOURTH FUNCTION DEPENDENT PARAMETER 
;FIFTH FUNCTION DEPENDENT PARAMETER 
;SIXTH FUNCTION DEPENDENT PARAMETER 


; FUNCTION DECISION TABLE OFFSET DEFINITIONS 


DIGITAL INTERNAL USE ONLY 103 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 5 
X-25 DECLARATIONS 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (2) 


183 

184 LEGAL=0 7;LEGAL FUNCTION MASK 

185 IOTYPE=8 71/0 FUNCTION TYPE MASK 

186 FDTACT=16 zACTION ROUTINE MASKS 

187 

188 ; 

189 ; TABLES FOR DETERMINING THE ACCESS DESIRED, BASED UPON THE I/O FUNCTION 
190 ; CODE. THIS IS NECESSARY FOR THE FIRST TIME THROUGH PROTECTION CHECK DONE 
191 ; ON SHARABLE, NON-MOUNTABLE (NON-FILES ORIENTED) DEVICES. 

192 ; . 

193 

194 «MACRO ACCMSK CODES 


195 MASKL = 0 
196 MASKH = 0 


197 

198 -IRP _ X, <CODES> 

199 IF GT <I0$_’X&1I0$_VIRTUAL>-31 
200 MASKH = MASKH!<1@<<I0$ 'X&IO$ VIRTUAL>-32>> 
201 -IFF 

202 MASKL = MASKL!<1@<I0$_’X&I0$_VIRTUAL>> 

203 -ENDC; GT <I0$_'X&I0$_VIRTUAL>-31 
204 -ENDR ; X,<CODES> 

205 -LONG MASKL, MASKH 

206 -ENDM ACCMSK 

207 

208 DECLARE _PSECT EXECSNONPAGED_DATA 

209 READ ACCESS: 

210 ACCMSK <READPBLK, READLBLK, READVBLK, - 
211 READHEAD, READTRACKD, REREADN, REREADP, - 
212 READPROMPT, TTYREADALL, TTYREADPALL> 
213 

214 WRITE_ACCESS: 

215 ACCMSK <WRITEPBLK, WRITELBLK, WRITEVBLK, - 
216 WRITECHECK, WRITECHECKH, - 

217 WRITEHEAD, WRITETRACKD, WRITERET> 


104 DIGITAL INTERNAL USE ONLY 


SYSQIOREQ ~ QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY~-1989 16:24:35 VAX MACRO V5.0-8 Page 6 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


X-25 DECLARATIONS 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (3) 


EXECSNONPAGED CODE 


.SBTTL QIO ERROR AND EXCEPTION HANDLING ROUTINES 


219 DECLARE PSECT 

220 

221 

222 3 

223 3; Device is not mountable. 


See if it is necessary to do the protection check. 


224 ; 

225 NOT FILE DEV: 
226 BBC #DEVSV_SHR, UCB$L_DEVCHAR(R5) , 20$ ?XFER IF NOT SHARABLE 
227 BBC R7, READ_ACCESS, 10$ #XFER IF NOT A READ FUNCTION 

228 BBS #CCBS$V_RDCHKDON, CCB$B_STS (R6) , 10$ 7XFER IF HERE ALREADY 
229 JSB G*“EXESCHKRDACCES 7DO PROTECTION CHECK 

230 BLBC RO, ERRORB 7XFER IF NOT SUCCESSFUL 

231 BISB #CCBSM_RDCHKDON, CCBSB_STS (R6) sNOTE PROT CHECK MADE 
232 108: BBC R7,WRITE_ACCESS, 20$ ?XFER IF NOT A WRITE FUNCTION 

233 BBS #CCBS$V_WRTCHKDON, CCBS$B_STS(R6), 20$ 7XFER IF HERE ALREADY 
234 JSB G*EXESCHKWRTACCES 7DO PROTECTION CHECK 

235 BLBC RO, ERRCRB 7XFER IF NOT SUCCESSFUL 

236 - BISB #CCB$M_WRTCHKDON, CCBSB_STS (R6) sNOTE PROT CHECK MADE 
237 208: BRW CHKDON 7ELSE REJOIN MAINLINE CODE 
238 

239 ; 

‘240 ; An access or deaccess operation is pending for this channel. Wait for 

241 ; it to complete, then retry the QIO. 

242 ; 

243 

244 DEACCESS PENDING: 

245 

246 LOCK LOCKNAME=SCHED 7LOCK THE SCHED DATABASE 


247 MOVZWL #RSNS$_ASTWAIT, PCBSL_EFWM(R4) ;SET AST WAIT RESOURCE NUMBER 


248 MOVAQ G*SCHSGQ MWAIT, R2 7;SET ADDRESS OF WAIT QUEUE 
249 BBSSI #RSN$_ ASTWAIT, G*SCH$GL_RESMASK, 10$ 3;SET WAITING FLAG 
250 108: JMP G“SCHSWAIT ;WAIT FOR AST 

251 

252 3 

253 ; MISCELLANEOUS ERROR HANDLING AND EXCEPTION HANDLING ROUTINES. THESE HAVE 
254 ; BEEN MOVED OUT OF LINE TO MAKE THE COMMON PATH NEARLY BRANCH FREE. 
255 3 

256 

257 CLREF: JSB G“SCHSCLREF ;CLEAR SPECIFIED EVENT FLAG 
258 BRB VCHAN ; CONTINUE WITH QIO 

259 IVCHAN: MOVZWL #SS$_IVCHAN, RO 3;SET ERROR STATUS 

260 BRB ERRORB ; AND ERROR REQUEST 


261 PRIVERR: MOVZWL #SS$_NOPRIV, RO 
262 ERRORB: BRW ERROR 

263 , 

264 DACSPND: BRB 


7SET ERROR STATUS 
7AND ERROR REQUEST 


DEACCESS PENDING Branch assist 


DIGITAL INTERNAL USE ONLY 105 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 7 
X-25 QUEVE I/O REQUEST 24-APR~-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (4) 


266 -SBTTL QUEUE I/O REQUEST 
267 3+ 
268 ; EXESQIOREQ - QUEVE I/O REQUEST 
269 ; 
270 ; THIS SERVICE PROVIDES THE CAPABILITY TO INITIATE AN I/O OPERATION 
271 ; BY QUEUEING A REQUEST TO A DEVICE’S ASSOCIATED DRIVER. ONCE THE 
272 : OPERATION HAS BEEN INITIATED, CONTROL WILL RETURN TO THE CALLER 
273 ; WHO CAN SYNCHRONIZE I/O COMPLETION IN ONE OF THREE WAYS: 
274 ; 
275 ; 1) SPECIFY THE ADDRESS OF AN AST ROUTINE THAT WILL BE 
276 ; EXECUTED WHEN THE I/O COMPLETES. 
277 3 
278 ; 2) WAIT FOR THE SPECIFIED EVENT FLAG TO BE SET. 
279 ; 
280 ; 3) POLL THE SPECIFIED I/O STATUS BLOCK FOR A COMPLETION 
281 ; STATUS. 
282 ; 
283 : THIS ROUTINE VERIFIES THE FUNCTION INDEPENDENT PARAMETERS, ALLOCATES 
284 ; AN I/O REQUEST PACKET, COPIES THE FUNCTION INDEPENDENT PARAMETERS AND 
285 ; PROCESS INFORMATION TO THE I/O PACKET, CHECKS ACCESS TO THE DEVICE, 
286 ; AND CALLS THE DRIVER’S FUNCTION DECISION TABLE ROUTINE(S) THAT CORRESPOND 
287 ; TO THE SPECIFIED FUNCTION. IT IS THEN UP TO THE FDT ROUTINE TO EITHER 
288 ; COMPLETE THE REQUEST IMMEDIATELY (EXESABORTIO OR EXESFINISHIO) OR TO 
289 - QUEUE THE I/O REQUEST FOR FURTHER PROCESSING BY THE DRIVER’S STARTIO 
290 ; ROUTINE (EXESQIODRVPRT). 
291 ; 
292 ; INPUTS: 
293 ;: 
294 ; EFN(AP) = EVENT FLAG NUMBER. 
295 ; CHAN(AP) = I/O CHANNEL NUMBER. 
296 ; FUNC (AP) = I/O FUNCTION CODE. 
297 3; IOSB(AP) = ADDRESS OF I/O STATUS BLOCK. 
298 ; ASTADR(AP) = ADDRESS OF AST SERVICE ROUTINE. 
299 ; ASTPRM(AP) = AST SERVICE ROUTINE PARAMETER. 
300 ; P1(AP) TO P6(AP) = FUNCTION DEPENDENT PARAMETERS. 
301 ; 
302 ; R4 = CURRENT PROCESS PCB ADDRESS. 
303 ; 
304 ; OUTPUTS: 
305 ; 
306 ; RO LOW BIT CLEAR INDICATES FAILURE TO INITIATE THE I/O REQUEST. 
307 ; 
308 ; RO = SS$_ABORT - A NETWORK LOGICAL LINK WAS BROKEN. 
309 ; 
310 ; RO = SS$_ACCVIO - THE I/O STATUS BLOCK CANNOT BE WRITTEN BY 
311 ; THE CALLER. 
312 ; 
313 ; RO = SS$_DEVOFFLINE - THE SPECIFIED DEVICE IS OFFLINE. 
314 ; 
315 ; RO = SS$_EXQUOTA - THE PROCESS HAS EXCEEDED ITS BUFFERED I/O 
316 ; QUOTA, DIRECT I/O QUOTA, OR BUFFERED I/O BYTE COUNT 
317 ; QUOTA AND HAS DISABLED RESOURCE WAIT MODE. OR, THE 
318 ; PROCESS HAS EXCEEDED ITS AST LIMIT QUOTA. 
319 ; 
320 ; RO = SS$_ILLEFC - AN ILLEGAL EVENT FLAG NUMBER WAS SPECIFIED. 
321 ; 
322 ; RO = SS$_INSFMEM - INSUFFICIENT DYNAMIC MEMORY IS AVAILABLE 


106 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY~1989 16:24:35 VAX MACRO VS.0-8 Page 8 
X-25 QUEUE I/O REQUEST 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (4) 


323 ; TO ALLOCATE AN I/O REQUEST PACKET AND THE PROCESS HAS 
324 ; DISABLED RESOURCE WAIT MODE. 

325 ; 

326 ; RO = SS$_ IVCHAN - AN INVALID CHANNEL NUMBER WAS SPECIFIED. 
327 ; 

328 ; RO = SS$_NOPRIV - THE SPECIFIED CHANNEL DOES NOT EXIST OR WAS 
329 ; ASSIGNED FROM A MORE PRIVILEGED ACCESS MODE. OR, THE 
330 ; PROCESS DOES NOT HAVE THE PRIVILEGE TO PERFORM THE 
331 ; SPECIFIED TYPE OF I/O FUNCTION ON THE DEVICE. 

332 ; 

333 ; RO = SS$_UNASEFC - UNASSOCIATED EVENT FLAG CLUSTER SPECIFIED. 
334 ; 

335 ; RO LOW BIT SET INDICATES SUCCESSFUL COMPLETION. 

336 ; 

337 ; RO = SS$ NORMAL - NORMAL COMPLETION. 

338 ;- 

339 

340 SYSTEM _SERVICE QIO,- 

341 <R2, R3,R4,R5,R6,R7,R8, RY, R10, R115, - 

342 MODE=KERNEL, - 

343 NARG=12, - 

344 TYPE=QIOW 

345 ; 

346 ; Clear specified event flag. For local event flags, this is done in line. 
347 ; 

348 ° 

349 QIO: MOVZBL EFN(AP),R3 7GET EVENT FLAG NUMBER 

350 CMPB R3, #63 ;CHECK FOR LOCAL 

351 BGTRU CLREF 7IF NO, MUST DO FULL CLREF 

352 BBCCI R3,PCBSL_EFCS(R4),VCHAN ;CLEAR SPECIFIED EVENT FLAG 

353 

354 ; 

355 ; Validate channel number, compute CCB address and acquire UCB address. 

356 ; 

357 

358 VCHAN: BICL3 #<*“XFFFF0000 !<CCB$C_LENGTH~1>>,-;FETCH CHANNEL NUMBER AND 
359 CHAN (AP) , RO 7;CLEAR EXTRANEOUS BITS 

360 BEQL IVCHAN 7IF EQL INVALID CHANNEL 

361 CMPW RO, G*CTLS$GW_CHINDX 7LEGAL CHANNEL NUMBER? 

362 BGTRU IVCHAN 7IF GTRU NO 

363 MNEGL RO,R9 7CONVERT TO CHANNEL INDEX 

364 MOVL G*CTLS$GL_CCBBASE, R6 7GET BASE ADDESS OF CCB’S 

365 MOVAB (R6) [R9] ,R6 7GET ADDRESS OF CORRESPONDING CCB 

366 MOVPSL R3 7READ CURRENT PSL 

367 MOVZBL CCBS$B_ AMOD(R6) ,RO 7;GET CHANNEL ACCESS MODE 

368 BEQL IVCHAN ;BRANCH IF CHANNEL IS UNASSIGNED 

369 EXTZV #PSLSV_PRVMOD, #PSL$S_PRVMOD,R3,R11 ;EXTRACT PSL PREV. MODE FIELD 
370 ASHL #16,R9,R9 ;PREPARE CHANNEL INDEX FOR LATER MERGE 
371 CMPB R11,R0 ;CALLER HAVE PRIVILEGE TO ACCESS CHANNEL? 
372 BGEQ PRIVERR 7IF GEQ NO 

373 MOVL CCBSL_UCB(R6) ,R5 7GET ASSIGNED DEVICE UCB ADDRESS 

374 BLBS CCBSL_WIND (R6),DACSPND ;IF LBS ACCESS/DEACCESS PENDING 

375 

376 ; 

377 ; Isolate function code and begin decoding 

378 ; 

379 


DIGITAL INTERNAL USE ONLY 107 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 9 
X-25 QUEUE I/O REQUEST 24~-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (4) 


FUNC (AP) ,R10 


#*C<IOS$M_FCODE>, R10, R7 


7GET I/O FUNCTION CODE AND MODIFIERS 
7CLEAR ALL BUT I/O FUNCTION CODE 


S“#DEVS$V_SPL, UCBSL_DEVCHAR(R5),SPOOL ;IF SET, DEVICE IS SPOOLED 


380 MOVZWL 

381 BICL3 

382 BBS 

383 

364 ; 

385 ; Acquire FDT address. 
386 ; 

387 


388 NSPOOL: BBC 
389 CHKDON: MOVL 


#DEVS$V_FOD, UCB$L_DEVCHAR(R5),NOT_ FILE DEVB 


UCBS$L_DDT(R5) , RO 


*XFER IF NOT MOUNTAB 
7GET ADDRESS OF DDT 


;IF CLR, ILLEGAL I/O FUNCTION 


7GET ADDRESS OF I/O STATUS BLOCK 
7IF EQL NONE SPECIFIED 

;CAN I/O STATUS BLOCK BE WRITTEN? 
;CLEAR I/O STATUS BLOCK 


Counts will have to 
Set IPL to block process 


?PREVENT PROCESS DELETION 


;IF CLR, DIRECT I/O FUNCTION 
7TO ALLOW INCREMENT BELOW 


;CHARGE FOR ANOTHER BUFFERED 1/0 


7SET ADDRESS OF QUOTA CELL 
;FETCH QUOTA ADDRESS 


7;LOWER IPL TO WAIT AT IPL 0 

;CHECK UNIT QUOTA OF I/O FUNCTION TYPE 
7;IF LBC QUOTA EXCEEDED 

;CHARGE FOR I/O OF TYPE 


? ‘ 


7SET ILLEGAL I/O FUNCTION STATUS 


;CHECK FOR DEACCESS I/O FUNCTION 
7;ALLOW IT TO PROCEED 

; LIKEWISE FOR ACP CONTROL 

7SO THAT A FILE ON AN OFFLINE DEVICE 


7SET DEVICE OFFLINE STATUS 


390 MOVL DDT$L_FDT (RO) ,R8 3GET ADDRESS OF FDT 
391 BBC R7, LEGAL (R8) , ILLIO 

392 BBC #UCBSV_ONLINE, UCBSW_STS(RS),OFFLINE ;IF CLR, DEVICE OFFLINE 
393 

394 ; ; 

395 ; Probe and clear IOSB if it is specified. 

396 ; 

397 

398 PRIOSB: MOVL IOSB (AP) ,R1 

399 BEQL NOIOSB 

400 IFNOWRT #8, (R1),ACCVIO 

401 CLRQ (R1) 

402 

403 ; 

404 ; Charge appropriate I/O counts depending upon type. 

405 ; be backed out if no I/O packet is available. 

406 ; deletion once we are committed. 

407 ; 

408 

409 NOIOSB: SETIPL #IPL$ ASTDEL 

410 BBS R7, IOTYPE (R8) ,10$ 7BR IF BUFFERED I/O 
411 BRW DIRECT 

412 10S$: ASSUME IRPSM_BUFIO EQ 1 

413 INCW R9 *SET IRP$M_BUFIO 
414 ADAWI #-1, PCBSW_BIOCNT (R4) 

415 BLSS 20$ ;CHECK QUOTA 

416 BRW OK 70K IF NOT NEGATIVE 
417 208: PUSHAW PCBSW_BIOCNT(R4) 

418 NOCNT: MOVL (SP), R2 

419 ADAWI #1, (R2) sBACKOUT CHARGE 
420 SETIPL #0 : 

421 JSB G“*EXESSNGLEQUOTA 

422 BLBC RO, ERROR 

423 ADAWI #-1,@(SP)+ 

424 BRB OK ; 

425 

426 ILLIO: MOVZWL #SS$_ILLIOFUNC, RO 

427 BRB ERROR : 

428 

429 OFFLINE :CMPB #IO$_DEACCESS, R7 

430 BEQL PRIOSB 

431 CMPB #I0$_ACPCONTROL, R7 

432 BEQL PRIOSB 

433 7MAY BE CLOSED 
434 MOVZWL #SS$_DEVOFFLINE, RO 

435 BRB ERROR ; 

436 


108 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 10 
X-25 QUEUE I/O REQUEST 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (4) 


437 
438 
439 
440 
441 
442 
443 
444 
445 
446 

447 
448 
449 
450 
451 
452 
453 
454 
455 
456 
457 
458 
459 
460 
461 
462 
463 
464 
465 
466 
467 
468 
469 
470 
471 


472. 


473 
474 
475 
476 
477 
478 
479 
480 
481 
482 
483 
484 
485 
466 
487 
488 
489 
490 
491 
492 
493 


; 


3 Device is marked spooled. Acquire intermediate UCB address if virtual funtion. 


; 

SPOOL: CMPL 
BGEQ 
MOVL 
BRB 


e 
’ 


3; Intermediate 

3 

NOT_FILE DEVB: 
BRW 


ACCVIO: MOVZWL 
ERROR: SETIPL 
_ PUSHL 
MOVL 
CLRL 
MOVZBL 
JSB 
POPL 
RET 


we Ye Xe 


ALLOC: JSB 
BLBS 
PUSHAW 
BLBS 
PUSHAW 

NALLOC: ADAWI 
BRB 


NODCNT: PUSHAW 
BRB 


se Se Xe 


SECTION: CVTWL 
MOVL 
ADDL 
MOVL 
BRB 


DIRECT: ADAWI 
BLSS 


OK: 
GTPKT: MOVL 


SREMQHI 


BVS 


S“#I0$_ LOGICAL, R7 ;VIRTUAL I/O FUNCTION? 

NSPOOL 7IF GEQ NO 

UCBSL_AMB(R5),R5 7GET INTERMEDIATE DEVICE UCB ADDRESS 
NSPOOL ; 


branch to the protection checking routine. 


NOT_FILE_ DEV 


S*#SS$_ACCVIO, RO 7SET ACCESS VIOLATION STATUS 

#0 7;ALLOW INTERRUPTS 

RO ?7;SAVE FINAL STATUS 
PCB$L_PID(R4),R1 7;GET PROCESS ID OF CURRENT PROCESS 
R2 . ;SET PRIORITY CLASS INCREMENT 

EFN (AP), R3 7GET SPECIFIED EVENT FLAG NUMBER 
G*“SCHSPOSTEF 7POST SPECIFIED EVENT FLAG 

RO ;RESTORE FINAL STATUS 


e 
a 


ALLOCATE REQUEST I/O PACKET - WHEN THE LOOKASIDE LIST IS EMPTY. 


G“EXESALLOCIRP ;ALLOCATE I/O REQUEST PACKET 

RO, SUCCES 7IF LBS SUCCESSFUL ALLOCATION 
PCBSW_BIOCNT (R4) ;ASSUME BUFFERED 1/0 

R9, NALLOC ;IF SET, BUFFERED 1/0 

PCBSW_DIOCNT (R4) ;ELSE DIRECT I/0 

#1,@(SP)+ ;RESTORE COUNT, SINCE NO I/O STARTED 
ERROR 7 

PCBSW_DIOCNT (R4) 7SET FOR DIRECT I/O FUNCTION 

NOCNT ; 


Convert section index to window address. 


CCBS$L_WIND (R6) , RO ;SIGN EXTEND SECTION INDEX 
G*CTLSGL PHD, R1 :GET ADDRESS OF PROCESS HEADER 

PHD$L PSTBASOFF(R1),R1 ;CALCULATE BASE ADDRESS OF SECTION TABLE 
SEC$L WINDOW(R1) [RO], -4 (R2) ;GET ADDRESS OF REAL WINDOW 
NOSECT ; 

#-1, PCBSW_DIOCNT (R4) ;CHARGE FOR ANOTHER DIRECT 1/0 

NODCNT 7BR IF NONE ALLOWED 


G*EXESAR_SYSTEM PRIMITIVES DATA,R2 
;ADDRESS OF SYSTEM PRIMITIVES DATA AREA 


IOC_GQ IRPIQ(R2),R2 ;GET I/O PACKET FROM LOOK ASIDE LIST 
;NOTE: RO is scratch in SREMQHI macro 
ALLOC :;IF VS EMPTY LIST 


DIGITAL INTERNAL USE ONLY 109 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 11 
X-25 QUEUE I/O REQUEST 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (4) 


494 
495 
496 
497 
498 
499 
500 
$01 
502 
503 
504 
S505 
506 
507 
508 
509 
510 
511 
512 
513 
514 
515 
516 
517 
518 
519 
520 
$21 
522 
523 
524 
525 
526 
527 
528 
529 
530 
531 
532 
533 
534 
535 
536 
537 
538 
539 
540 
541 
542 
543 
544 
545 
546 
547 
548 
549 
550 


BUILD DEVICE INDEPENDENT PART OF I/O PACKET 


R2 - 


IRP Address 


R4 - PCB Address 
R5 - UCB Address 
R6 - CCB Address 


R8 - FDT address 
RQ9 - Channel index @ 16 + (IRPS$M_BUFIO -- if buffered I/0) 
R10 - Function code (transformed) 
R11 - Access mode 


UCCES: INCW 
ASSUME 
MOVAQ 
MOVO 
MOVL 
ASSUME 
TSTL 
BEQL 
BISB 
ADAWI 
ASHL 
ASSUME 
BISL3 
ROTL 
ASSUME 
MOVL 
MOVB 


58: 


ASSUME 
ASSUME 
MOVQ 
ROTL 


ASSUME 
MOVL 
BLEQ 
BRW 


ASSUME 


NOSECT: MOVL 
ASSUME 
MOVW 

_ ASSUME 
ASSUME 
ASSUME 
MOVL 
ADDL 
MOVL 
ADDL 
ASSUME 
ASSUME 
ROTL 
BICL3 


; 
? R7 - Function code (original) 
; 
7 
s 


CCB$W_IOC (R6) 
IRP$W_SIZE EQ 8 
(R2) +, R3 
ASTADR (AP) , RO 


7 INCREMENT OUTSTANDING I/O ON CHANNEL 
7FOR FOLLOWING OPTIMIZATION 

sCOPY ADDRESS AND ADD IRPSW_SIZE TO R2 
# INSERT AST ADDRESS AND PARAMETER 


PCBSL_ARB(R4),IRP$L_ARB(R3) ;COPY ACCESS RIGHTS BLOCK ADDRESS 


IRP$B_RMOD EQ 11 

RO | 

5$ 

#ACB$M_QUOTA, R11 
#-1, PCBSW_ASTCNT (R4) 
#24,R11,R11 
IRP$B_TYPE EQ 10 


7FOR SHIFT BELOW 
7CHECK FOR AST 

7 NONE 

7NOTE QUOTA CHARGE 
;CHARGE QUOTA 
7ALIGN ACCESS MODE 
7FOR BISL BELOW 


R11, #<<DYN$C_IRP@16>! IRP$C_LENGTH>, (R2)+ 7 INSERT TYPE AND LENGTH 
#16,PCBSB_PRIB-3(R4),R11;FETCH AND ALIGN PRIORITY 


IRP$L_PID EQ 12 
PCBSL_PID(R4), (R2)+ 
EFN (AP) ,R11 


IRP$L_AST EQ 16 
IRP$L_ASTPRM EQ 20 
RO, (R2) + 
#16,R11,R11 


IRP$L_WIND EQ 24 
CCB$L_WIND(R6), (R2) + 
NOSECT | 
SECTION 


IRP$L_UCB EQ 28 
R5, (R2) + 
IRP$W_FUNC EQ 32 
R10,Ri1 
IRP$B_EFN EQ 34 
IRP$B_PRI EQ 35 
IRP$L_IOSB EQ 36 
R11, (R2)+ 
#FDTACT-12,R8 
IOSB(AP), (R2)+ 
#P1,AP 
IRP$W_CHAN EQ 40 
IRPSW_STS EQ 42 
#16,R9, (R2)+ 
#1,R7,R9 


110 DIGITAL INTERNAL USE ONLY 


° 
a 


7 INSERT PROCESS ID OF CURRENT PROCESS 
7MERGE EVENT FLAG NUMBER 


7FOR MOVQ BELOW 

7FOR MOVQ BELOW 

7 INSERT AST ADDRESS AND PARAMETER 
7;ALIGN PRIORITY AND EVENT FLAG NUMBER 


3;GET WINDOW ADDRESS 
7;Branch if no section index 
2:BR IF SECTION INDEX 


7 INSERT DEVICE UCB ADDRESS 


7MERGE I/O FUNCTION CODE 


7 INSERT PRI, EFN, FUNC 

#POINT TO ACTION ROUTINE MASKS 

sINSERT I/O STATUS BLOCK ADDRESS 

#POINT TO FIRST FUNCTION DEPENDENT PARAMETER 


7 INSERT CHANNEL INDEX AND STATUS 
7;PREPARE FOR VIRTUAL CHECK BELOW 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 12 
X-25 QUEUE I/O REQUEST 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (4) 


§51 
552 
553 
554 
555 
556 
557 
558 
559 
560 
561 
562 
563 
564 
565 
566 
567 
568 
569 
570 
571 
572 
573 
574 
575 
576 
577 
578 


3S: 


& 
n 
ee 


CHECK 


NOTE : 


me Ye Ye Ne Xe 


579 - 


580 
5861 
582 
583 
584 
585 
586 
587 
588 
589 
590 
591 
592 
593 
594 
§95 
596 
597 
598 
599 
600 
601 
602 
603 
604 
605 
606 
607 


me Ge Yo 


=e Se Ve 


5S: 


=2 Ve Ye 


908: 


CLRQ 
CLRL 
CLRL 


-IF DF 
TSTL 
BEQL 
JSB 
BRB 
-ENDC 


LOCK 
MOVL 


INCL 
UNLOCK 


MOVL 


(R2)+ 7;CLEAR PTE ADDRESS, BYTE OFFSET, AND BYTE CO 
(R2) ; 

IRP$L_DIAGBUF (R3) ;INIT ORIGINAL PTE ADDR (LOG OR VIRT 1/0 

CA$_MEASURE_IOT 

G*PMSS$GL_IOPFMPDB 7DATA COLLECTION ENABLED? 

3$ 7BR IF NO 

G“PMSS$START_RQ ;INSERT START OF I/O REQUEST MESSAGE 

4s ; 

LOCKNAME=PERFMON, - ;LOCK THE PERFMON DATABASE 

PRESERVE=NO 7 Don’t preserve RO 

G“PMSSGL_IOPFMSEQ, IRP$L_SEQNUM(R3) ;INSERT PACKET SEQUENCE NUMBER 
G*PMS$GL_IOPFMSEQ ; INCREMENT I/O TRANSACTION SEQUENCE NUMBER 

LOCKNAME=PERFMON, - 7; UNLOCK THE PERFMON DATABASE 

NEWIPL=#IPL$_ASTDEL, - #DROP IPL 

PRESERVE=NO 7 Don’t preserve RO 


UCBSL_DEVCHAR (R5) ,Ril 7GET DEVICE CHARACTISTICS FOR MANY 
7COMPARES BELOW 


IF REQUESTING PROCESS HAS PRIVILEGE TO ACCESS DEVICE 


LOW BIT OF FUNCTION CODE WAS CLEARED ABOVE 


ASSUME 
CMPL 
BNEQ 
BBC 


THE FOLLOWING 


TSTL 
BNEQ 
BBC 
BBC 


SUBL 
SUBW 
BITL 


BNEQ 


TSTW 
BLSS 


I10$_READVBLK-I0$_WRITEVBLK EQ 1 


S*#I0$ WRITEVBLK, R9 7 VIRTUAL READ OR WRITE? 
15$ 7 IF NEQ NO 
S“#DEVS$V_FOD, R11, 5$ 7;IF CLR, NOT FILE DEVICE 


TEST IS NECESSITATED BY THE SYSTEM INITIALiZATION SEQUENCE 


IRPSL_WIND (R3) :WINDOW ADDRESS SPECIFIED? 
90$ 7;IF NEQ YES 

S“#DEVSV_MNT, R11, 60$ 7;IF CLR, DEVICE NOT MOUNTED 
S“*#DEVSV_FOR, R11, 80$ 7IF CLR, MOUNTED STRUCTURED 


CONVERT VIRTUAL READ/WRITE FUNCTION TO ITS LOGICAL COUNTERPART 


S“*#IO$_READVBLK-I0$_READLBLK,R7 ;CONVERT TO LOGICAL FUNCTION 
S*#I0$ | ; READVBLK-10$ ; READLBLK, IRP$W_! FUNC (R3) ; 


#<DEVSM | SPL!- ;NOT SPOOLED, 
DEV$M_FOD!- ;NOT FILE DEVICE, 
DEVSM_SHR>, R11 7;AND NOT SHARABLE 
15$ 7BR IF SATISFIED 


CHECK IF AST QUOTA IS EXCEEDED 


PCBSW_ASTCNT (R4) 7AST GUEVE ENTRY QUOTA EXCEEDED? 
75$ 7IF LEQ YES 


DIGITAL INTERNAL USE ONLY 111 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0~-8 Page 13 
X-25 QUEUE I/O REQUEST 24-APR-1989 14:49:16 [SYS.SRC])SYSQIOREQ.MAR;1 (4) 


608 
609 
610 
611 
612 
613 
614 
615 
616 
617 
618 
619 
620 
621 
622 
623 
624 
625 
626 
627 
628 
629 
630 
631 
632 
633 
634 
635 
636 
637 
638 
639 
640 
641 
642 
643 
644 
645 
646 
647 
648 
649 
650 
651 
652 
653 
654 
655 
656 
657 
658 
659 
660 
661 
662 
663 
664 


R10 = SCRATCH. 
Rll = SCRATCH. 


JSB @8 (R8) 


me Ye Te Ye Ve Te Ye Ye Ye Ve Ye Ye Ye Ye Ye Ye Ne Ye Ye Yo Yo Ve Vo 


breaking user written drivers. 


1108: ADDL #12,R8 
BBC R7, (R8),110$ 
MOVL 8 (R8) , RO 
JSB (RO) 
BRB 110$ 


@e Ye we 


15$: CMPL 


S*#10$_ LOGICAL, R7 
BLSS 3 


80$ 


we 


LOGICAL OR PHYSICAL I/O FUNCTION 


me Xe 


IFPRIV PHY I0,80$ 


CMPL § S*#I0$_PHYSICAL,R7 
BLSS  20$ 
IFNPRIV LOG IO, 60$ 
MOVL = #CCB$V_PHYCHKDON, R9 
MOVAB G*EXESCHKPHYACCES, R10 
BRB 30$ 
40$: BBC S*#DEVS$V_SHR, R11, 80$ 
508: 
BBS R9, CCB$B_STS(R6) , 80$ 
JSB (R10) 
BLBC _— RO, 708 
BBSS _§ R9, CCBSB_STS(R6), 55$ 
55$: BRB 80$ 


112 DIGITAL INTERNAL USE ONLY 


SCAN FUNCTION DECISION TABLE CALLING EACH SELECTED ACTION ROUTINE WITH: 


(UPDATED TO POINT TO ACTION ROUTINE MASKS) 


RO = ADDRESS OF ACTION ROUTINE ENTRY POINT. 
Rl = SCRATCH. 

R2 = SCRATCH. 

R3 = ADDRESS OF I/O REQUEST PACKET. 

R4 = CURRENT PROCESS PCB ADDRESS. 

R5 = ASSIGNED DEVICE UCB ADDRESS. 

R6 = ADDRESS OF CCB. 

R7 = I/O FUNCTION CODE BIT NUMBER. 

R8 = FDT DISPATCH ADDRESS. 

R9 = SCRATCH. 


AP = ADDRESS OF FIRST FUNCTION DEPENDENT PARAMETER. 


NB: in the Guide to Writing a Device Driver, we document the contents 
of RO as being the address of the FDT action routine entry point. 
This is the only reason that the dispatch code below does not read: 


Should future gererations wish to modify FDT dispatching to use the 
single dispatch instruction, they must bear the responsibility for 


7;POINT TO NEXT FUNCTION MASK 

7IF CLR, THEN ACTION NOT SELECTED 
7GET ADDRESS OF ACTION ROUTINE 
CALL ACTION ROUTINE 


me Ne 


CONTINUE DECODING FUNCTIONS OTHER THAN VIRTUAL READ/WRITE 


7VIRTUAL 1/0 FUNCTION? 
7IF LSS YES 


#PROCESS HAVE PHYSICAL I/O PRIVILEGE? 
;PHYSICAL I/O FUNCTION? 

;IF LSS NO - MUST BE LOGICAL I/O 
#PROCESS HAVE LOGICAL I/O PRIVILEGE? 


4 


7SET FOR PHYSICAL I/O FUNCTION CHECK 


* 


7;IF CLR, DEVICE NOT SHAREABLE 
7 R4 - PCB ADDRESS 

7 R5 - UCB ADDRESS 

7HAS PROT CHECK BEEN MADE? 
;CHECK ACCESS TO VOLUME 

7EXIT ON FAILURE 

7;MARK PROT CHECK DONE 

7ACCESS ALLOWED 


CONFIDENTIAL AND PROPRIETARY | 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 14 
X-25 QUEUE I/O REQUEST 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (4) 


665 
666 
667 
668 
669 
670 
671 
672 
673 
674 
675 
676 
677 
678 
679 
680 
681 
682 
683 
684 
685 
686 
687 
688 
689 
690 
691 
692 
693 
694 
695 
696 
697 
698 
699 
700 
701 
702 
703 
704 
705 
706 
707 
708 
709 
710 
711 
712 
713 
714 
715 


; 


3 ERROR EXITS 


3 

60S: 
708: 
7583 


CD we we we 


OS: 


we Te Ye 


1308: 


-e ee Ne 


208: 


Re Xe Ne 


308: 


MOV2ZWL 
JUMP 
TSTL 
BEQL 
MOVZWL 
BRB 


CMPL 
BLSS 
BISW 
MOVL 
BEQL 


#SS$_NOPRIV, RO ;SET NO PRIVILEGE STATUS 
G*EXESABORTIO A 

IRP$L_AST(R3) ;DOES THIS REQUEST NEED AN AST? 
110$ 7NO, THEN CAN’T BE QUOTA EXCEEDED. 
#SS$_EXQUOTA, RO 7AST QUOTA EXCEEDED 

70$ ; 


PROCESS HAS ACCESS TO DEVICE 


S*#IO$_ PHYSICAL, R7 ;LOGICAL OR VIRTUAL I/O FUNCTION? 
90$ 7IF LSS YES 

#IRPS$M_PHYSIO, IRP$W_STS(R3) ;SET PHYSICAL I/O FLAG 
<P6-P1>(AP) ,R9 ?7GET ADDRESS OF DIAGNOSTIC BUFFER 
90$ 7IF EQL THEN NOT SPECIFIED 


Process diagnostic buffer parameter 


IFNPRIV DIAGNOSE, 60$ ;PROCESS HAVE PRIVILEGE TO DIAGNOSE? 
MOVL UCBSL_DDT(R5),R1 7GET ADDRESS OF DDT 

MOVZWL DDTSW_DIAGBUF (R1),R1 7GET SIZE OF DIAGNOSTIC BUFFER 

BEQL 130$ 7IF EQL NO DIAGNOSTIC FUNCTIONS 

JSB G*EXESALLOCBUF 7; ALLOCATE DIAGNOSTIC BUFFER 

BLBC RO, 70$ 7; IF LBC ALLOCATION FAILURE 

MOVL R2, IRP$L_DIAGBUF (R3) ;SAVE ADDRESS OF DIAGNOSTIC BUFFER 
MOVAB 12 (R2) , (R2) + ?;SET POINTER TO DATA AREA 

MOVL RQ, (R2) ' 3SAVE USER ADDRESS OF DIAGNOSTIC BUFFER 
BISW #IRP$M_DIAGBUF, IRP$W_STS(R3) ;SET DIAGNOSTIC BUFFER PRESENT 
BRW 90$ 


LOGICAL I/O FUNCTION 


IFPRIV LOG _I0,1308. #PROCESS HAVE LOGICAL I/O PRIVILEGE? 
MOVL #CCBS$V_LOGCHKDON, R9 ; 
MOVAB G*EXESCHKLOGACCES, R10 7;SET FOR LOGICAL I/O FUNCTION CHECK 


BBS 
BBC 
BBC 
BBC 
BRW 


PHYSICAL OR LOGICAL I/O FUNCTION - CHECK ACCESSIBILITY OF DEVICE 


S*#DEVS$V_SPL, R11, 60$ 7;IF SET, SPOOLED DEVICE 
S*#DEVSV_FOD, R11, 40$ 7;IF CLR, NOT FILE DEVICE 
S“*#DEVS$V_MNT, R11, 60$ 3; IF CLR, DEVICE NOT MOUNTED 
S*#DEVSV_FOR, R11, 60$ ;IF CLR, MOUNTED STRUCTURED 
50$ ? 


DIGITAL INTERNAL USE ONLY 113 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 15 
X-25 BUILD I/O PACKET FOR PAGE READ/WRITE 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (5) 


717 
718 
719 
720 
721 
722 
723 
724 
725 
726 
727 
728 
729 
730 
731 
732 
733 
734 
735 
736 
737 
738 
739 
740 
741 
742 
743 
744 
745 
746 
747 
748 
749 
750 
751 
752 
753 
754 
755 
756 
757 
758 
759 
760 
761 
762 
763 
764 
765 
766 
767 
768 
769 
770 
771 
772 
773 


me Ne Ne 


’e Ye Ne Ye 


Se Ne Ye Ye Te Se Ye Ye Ve 


me Me Ve Ve Se Ye Veo Ve Ye Ve Ve Ve Se Se Ve Ye Ve Vs eo 


™e Ye Me Se Se Ye MO Me Me Te Se Se Ye Se Ye Yeo Ne Ye Ye Ne Ve 


-SBTTL BUILD I/O PACKET FOR PAGE READ/WRITE 


+ 


EXESBUILDPKTR - BUILD I/O PACKET FOR PAGE READ 

EXESBUILDPKTW - BUILD I/O PACKET FOR PAGE WRITE 

EXESBLDPKTSWPR - BUILD I/O PACKET FOR SWAP READ 

EXESBLDPKTSWPW - BUILD I/O PACKET FOR SWAP WRITE 

EXESBLDPKTGSR - BUILD I/O PACKET FOR SHARED MEMORY GLOBAL SECTION READ 
EXESBLDPKTGSW - BUILD I/O PACKET FOR SHARED MEMORY GLOBAL SECTION WRITE 
EXESBLDPKTMPW - BUILD I/O PACKET FOR MODIFIED PAGE WRITER 


THIS ROUTINE IS CALLED TO FILL OUT AND QUEUE AN I/O PACKET 
FOR A SWAPPING OR PAGING READ OR WRITE. 


INPUTS : 


RO 
R1 
R2 
R3 
R4 


VIRTUAL BLOCK NUMBER 

NUMBER OF BYTES TO TRANSFER (PAGE INCREMENTS) 
WINDOW ADDRESS FOR MAPPING VBN TO LBN 

SYSTEM VIRTUAL ADDRESS OF PAGE TABLE ENTRY 
CURRENT PROCESS CONTROL BLOCK ADDRESS 
PCBSW_DIOCNT(R4) IS ASSUMED GREATER THAN ZERO 
AND MUST BE CHECKED BY THE CALLER. 

R5 = I/O REQUEST PACKET ADDRESS 

WITH THE FOLLOWING FIELDS ALREADY FILLED IN 


IRP$W_SIZE(R5) AND IRP$B_TYPE(R5) 
FOR ENTRY AT EXESBUILDPKTW, EXESBLDPKTGSR, EXE$BLDPKTGSW, AND 
EXESBLDPKTMPW, THESE ARE FILLED IN BY THE CALL. FOR ALL 
OTHER ENTRY POINTS, THEY ARE FILLED IN BY THIS CODE. 
IRP$L_AST(R5) = 
FOR PAGE READ CASE - SYSTEM VIRTUAL ADDRESS OF SLAVE (PROCESS) 
PAGE TABLE ENTRY FOR THE CASE OF A GLOBAL PAGE READ. 
THIS MUST BE 0 FOR A SYSTEM OR PROCESS PAGE READ. 
FOR PAGE WRITE CASE - STANDARD QI/O AST ADDRESS 
FOR SWAPIO CASE - THIS PARAMETER IS CURRENTLY NOT USED 


IRP$L_ASTPRM(R5) = 
FOR PAGE READ CASE - THE CONTENTS OF THE FAULTED PAGE TABLE ENTRY 
USED TO RECOVER THE ORIGINAL BACKING STORE ADDRESS WHEN A PAGE 
READ ERROR OCCURRED FOR A COPY ON REFERENCE PAGE. 
FOR PAGE WRITE CASE - STANDARD QI/O AST PARAMETER 
FOR SWAPIO CASE - ADDRESS OF KERNEL AST ROUTINE TO CALL 


IRP$B_PRI(R5) = THE PRIORITY AT WHICH THE TRANSFER IS TO BE QUEUED 
IRP$B_RMOD(R5) = 


FOR PAGE WRITE CASE STANDARD QI/O MODE OF REQUESTER 
FOR ALL OTHER CASES ~ CONTAINS GARBAGE WHICH IS IGNORED 


IRP$B_EFN(R5) = 
FOR PAGE WRITE CASE - STANDARD QI/O EVENT FLAG NUMBER 
FOR ALL OTHER CASES - CONTAINS GARBAGE WHICH IS IGNORED 


IRP$L_IOSB(R5) = 
FOR PAGE WRITE CASE - STANDARD QI/O I/O STATUS BLOCK ADDRESS 
FOR ALL OTHER CASES - CONTAINS GARBAGE WHICH IS IGNORED 


114 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 16 
X-25 BUILD I/O PACKET FOR PAGE READ/WRITE 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (5) 


774 
775 
776 
777 
778 
779 
780 
781 
782 
783 
784 
785 
786 
787 
788 
789 
790 
791 
792 
793 
794 
795 
796 
797 
798 
799 
800 
801 
802 
803 
804 
805 
806 
807 
808 
809 
810 
811 
812 
813 
814 
815 
816 
817 
818 
819 
820 
821 
822 
823 
824 
825 
826 
827 
828 
829 
830 


Read operation 
Write operation 


;BUILD PACKET FOR SHMGSD READ 
! IRPS$M_VIRTUAL ! IRP$M_FUNC>@16 
;TYPE/SIZE ALREADY SET IN PACKET 


3 OUTPUTS: 
2 
; R4,R5 ALTERED 
+ had 
-ENABL LSB 
3 Note that the differentiation between READ and WRITE operations is 
#7 encoded in the setting of the IRPS$M FUNC bit. 
; IRP$M_FUNC = 1 => I0$ READPBLK ; 
; IRP$M FUNC = 0 => I0$ WRITEPBLK ; 
UNIVERSAL SYMBOL EXESBLDPKTGSR 
;EXESBLDPKTGSR:: 
PUSHL #<IRP$M_SWAPIO 
BRB 20$ 
UNIVERSAL SYMBOL EXESBLDPKTGSW 
7; EXESBLDPKTGSW: : 


;BUILD PACKET FOR SHMGSD WRITE 
! IRP$M_VIRTUAL>@16 
;TYPE/SIZE ALREADY SET IN PACKET 


EXESBLDPKTSWPR 
;BUILD SWAP READ PACKET 
! IRP$M VIRTUAL ! IRP$M_FUNC>@16 


4 
ao 


EXESBLDPKTSWPW 
?;BUILD SWAP WRITE PACKET 
! IRP$M_VIRTUAL>@16 


‘c 


EXESBLDPKTMPW 
;BUILD I/O PACKET FOR MODIFIED PAGE WRITER 
! IRP$M_VIRTUAL>@16 


e 
’ 


EXES$BUILDPKTW 
;BUILD I/O PACKET FOR PAGE WRITE 
IRP$M_VIRTUAL>@16 


’ 


EXESBUILDPKTR 
;BUILD I/O PACKET FOR PAGE READ 


#<IRPSM_PAGIO ! IRPSM VIRTUAL ! IRP$M_FUNC>@16 


#<DYNSC_IRP@16 ! IRPS$C_LENGTH>,- ;SET SIZE 


7AND TYPE OF PACKET 

7SYSTEM VIRTUAL ADR OF PAGE TABLE ENTRY 
;NEED COPY OF ORIGINAL FOR SEGMENTED XFERS 
7;PACKET ADDRESS TO R3 


PUSHL #<IRPS$M_SWAPIO 
BRB 20$ 
UNIVERSAL_SYMBOL 
7; EXESBLDPKTSWPR: : 
PUSHL #<IRP$M_SWAPIO 
BRB 10$ 
UNIVERSAL _ SYMBOL 
7 EXESBLDPKTSWPW: : 
PUSHL #<IRPSM_SWAPIO 
BRB 10$ 
UNIVERSAL_SYMBOL 
; EXESBLDPKTMPW:: 
PUSHL #<IRPS$M_SWAPIO 
BRB 20$ 
UNIVERSAL SYMBOL 
; EXESBUILDPKTW: : 
PUSHL #<IRP$M_PAGIO ! 
BRB 208 
UNIVERSAL SYMBOL 
;EXESBUILDPKTR:: 
PUSHL 
10S: INSV 
#0, #24, IRPSW_SIZE (R5) 
208: MOVL R3, IRP$L_SVAPTE (R5) 
MOVL R3, IRPS$L_DIAGBUF (R5) 
MOVL R5,R3 
EXTV #<IRPS$V_FUNC+16>, #1, (SP) ,R5 
; R5 = -1 for read 
; R5 = O for write 


DIGITAL INTERNAL USE ONLY 115 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 17 
X-25 BUILD I/O PACKET FOR PAGE READ/WRITE 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (5) 


831 
832 
833 
834 
835 
836 
837 
838 
839 
840 
841 
842 
843 
844 
845 
846 
847 
848 
849 
850 
851 
852 
853 
854 
855 
856 
857 
858 
859 
860 
861 
862 
863 


ASSUME 
ASSUME 


INCL 
SUBW3 
BICL3 
ASSUME 
MOVL 
MOVL 
MOVL 
MOVL 


MOVL 
MOVL 


-IF 


JSB 


-ENDC 


ADAWI 


-DSABL 


<I0$_WRITEPBLK + 1> EQ IO$_READPBLK 
<WCBSL_WRITES - 4> EQ WCBSL_READS 


WCBSL_WRITES (R2) (R5] 7U0SE CODE TO BUMP READ OR WRITE COUNT 
RS, #I10$_WRITEPBLK, IRP$W_FUNC(R3) ;SET REAL FUNCTION CODE 
#“XFFFF, (SP) +,R5 ?GET STATUS BITS AND CLEAR CHANNEL 


IRP$W_STS EQ IRP$W_CHAN+2 


R5, IRP$W_CHAN (R3) ?SET CHANNEL AND STATUS 
WCBSL_ORGUCB (R2), R5 7GET UCB ADDRESS FROM WINDOW 
RS, IRP$L_UCB (R3) 7SET UCB ADDRESS 
PCBSL_PID(R4),IRP$L_PID(R3) ;PROCESS ID FROM PCB 

RO, IRP$L_SEGVBN (R3) #STARTING VIRTUAL BLOCK NUMBER 
R2, IRP$L_WIND (R3) 7;WINDOW ADDRESS 

PCBSL_ARB(R4), IRP$L_ARB(R3) ;ACCESS RIGHTS BLOCK ADDRESS 
IRPSW_BOFF (R3) 3ZERO BYTE OFFSET 

R1, IRPS$L_BCNT (R3) 7;SET BYTE COUNT 

IRP$L_ABCNT (R3) 7ZERO ACCUMULATED BYTE COUNT 
R1, IRP$L_OBCNT (R3) 7SET ORIGINAL BYTE COUNT 
IRPSW_STS2 (R3) 7CLEAR STATUS EXTENSION 


DF, CA$_MEASURE_IOT 


G“PMSSSTART_RQ 7 INSERT START OF I/O REQUEST MESSAGE 


#-1, PCBSW_DIOCNT (R4) ;CHARGE DIRECT I/O TO PROCESS 

IOCSQNXTSEG1 7QUEUE THE FIRST SEGMENT OF THE I/O REQUEST 
7AND RETURN 

LSB 


116 DIGITAL INTERNAL USE ONLY 


SYSQIOREQ - QUEUE 1/0 REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 18 


CONFIDENTIAL AND PROPRIETARY 7 
DIGITAL EQUIPMENT CORPORATION 


X-25 COMPLETE I/O OPERATION 24-APR-1989 14:49:16 [SYS. iis aa aaa MAR;1 (6) 


865 
866 
867 
. 868 
— 869 
870 
871 
872 
873 
874 
875 
876 
877 
878 
879 
880 
881 
882 
883 
884 
885 
886 
887 
888 
889 
890 
891 
892 
893 
894 
895 
896 
897 
898 
899 
900 
901 
902 
903 
904 
905 
906 
907 
908 
909 
910 
911 
912 
913 
914 
915 
916 
917 
918 
919 
920 
921 


-SBTTL COMPLETE I/O OPERATION 
7+ 
J 
3 EXESABORTIO - ABORT I/O OPERATION 
a B58 
? THIS ROUTINE IS JUMPED TO FROM A FUNCTION DECISION TABLE ACTION ROUTINE 
3; TO FINISH AN I/O OPERATION WITHOUT RETURNING THE FINAL I/O STATUS. 
; 
3 EXESFINISHIO - FINISH I/O OPERATION 
; ei . 
? THIS ROUTINE IS JUMPED TO FROM A FUNCTION DECISION TABLE ACTION ROUTINE 
? TO FINISH AN I/O OPERATION AND RETURN THE FINAL I/O STATUS. 
? EXESFINISHIOC - FINISH I/O OPERATION WITH SECOND I/O STATUS LONGWORD CLEARED | 
‘ 
7 THIS ROUTINE IS JUMPED TO FROM A FUNCTION DESCISION TABLE ACTION ROUTINE 
3 TO FINISH AN I/O OPERATION AND RETURN THE FINAL I/O STATUS WITH THE 
+ SECOND I/O STATUS LONGWORD CLEARED. 
; 
3 INPUTS: 
7 
? RO = FIRST LONGWORD OF FINAL I/O STATUS. 
; R1 = SECOND LONGWORD OF FINAL I/O STATUS. 
: R3 = ADDRESS OF I/O REQUEST PACKET. 
3 R4 = CURRENT PROCESS PCB ADDRESS. 
; R5 = UCB ADDRESS OF DEVICE UNIT. 
A 
; OUTPUTS: 
; THE FINAL I/O STATUS IS STORED IN THE I/O PACKET AND THE PACKET IS 
; INSERTED IN THE I/O POST PROCESSING QUEUE. A SOFTWARE INTERRUPT 
; IS GENERATED TO INITIATE I/O POST PROCESSING AND THE FIRST WORD 
; OF THE FINAL I/O STATUS IS RETURNED AS THE SERVICE STATUS. 
3 
7 ENVIRONMENT: 
; 
? THE FORKLOCKS ARE ACQUIRED TO INSURE THAT THE LOCK IS HELD WHILE 
; UPDATING OPERATIONS COUNT ON THE UCB. AND TO MAKE SURE THAT WE CAN 
; ALWAYS RELEASE THE FORKLOCK, IN CASE THE DRIVER HAD ACQUIRED IT. 
77 
-ENABL LSB 
10$: SETIPL UCBSB_FIPL(R5),- 3; RAISE IPL 
_ ENVIRON=UNIPROCESSOR 
BRB 20$ 3 CONTINUE 
UNIVERSAL_SYMBOL EXESABORTIO 
;EXESABORTIO:: ; ABORT I/O OPERATION 
ASSUME UCBSB_FIPL EQ UCBS$B_FLCK 
ASSUME SPL$ MIN INDEX EQ 32 
BBC #5,UCBS$B _FLCK(R5),10$ ;BR IF FIPL 
FORKLOCK UCBSB_FLCK(R5) ;LOCK FORK THREADS/USE IPL OF LOCK 
208: CLRL IRPSL_ IOSB (R3) ;CLEAR ADDRESS OF I/O STATUS BLOCK 
BBCC #ACBSV | QUOTA, IRPSB | RMOD (R3),60S ;IF CLR, NO AST SPECIFIED 
ADAWI #1, PCBSW | ASTCNT (R4). ; UPDATE AVAILABLE AST QUEUE ENTRIES 
BRB 60$ ; 
308: SETIPL UCBSB_FIPL(R5),- 3; RAISE IPL 


DIGITAL INTERNAL USE ONLY 117 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE 1/0 REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 19 
X-25 COMPLETE I/O OPERATION 24-APR-1989 14:49:16 [SYS.SRC] SYSQIOREQ.MAR;1 (6) 


922 
923 
924 
925 
926 
927 
928 
929 
930 
931 
932 
933 
934 
935 
936 
937 
938 
939 


940. 


941 
942 
943 
944 
945 
946 
947 
948 


ENVIRON=UNIPROCESSOR 
BRB 40$ 7 CONTINUE 
UNIVERSAL SYMBOL EXESFINISHIOC 
7 EXESFINISHIOC: : : ;FINISH I/O OPERATION CLEAR SECOND L 
CLRL Rl 7CLEAR SECOND I/O STATUS LONGWORD 
UNIVERSAL SYMBOL EXESFINISHIO 
7 EXESFINISHIO: : 7FINISH I/O OPERATION 
MOVQ RO, IRP$L_MEDIA(R3) 7STORE FINAL I/O STATUS 


40$: 


608: 


ASSUME UCB$B_FIPL EQ UCBS$B_FLCK 
ASSUME SPL$ MIN INDEX EQ 32 


BBC #5,UCBSB_FLCK(R5),30$  ;BR IF FIPL 

FORKLOCK UCB$B_FLCK(R5) , - ?;LOCK FORK THREADS/USE IPL OF LOCK 
PRESERVE=NO ? DON’T PRESERVE RO 

INCL UCB$L_OPCNT (R5) ; INCREMENT OPERATIONS COMPLETED 

MOVZWL S*#SS$_NORMAL, RO SET NORMAL COMPLETION STATUS 


3 Make these I/0’s complete synchronously by using per-CPU queue 


find _cpu_data Rl 

INSQUE (R3),@CPUS$L_PSBL(R1) 
SOFTINT #IPL$_IOPOST 
FORKUNLOCK UCB$B_FLCK(RS5) 
BRW QIORETURN 


Get pexr-CPU database address 
INSQUE into Q for this CPU. 
Signal 1/0 post interrupt 
UNLOCK FORK THREADS/USE SAME IPL 


we Ye Ye Ye Ve 


-DSABL LSB 


118 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQTOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY~1989 16:24:35 VAX MACRO V5.0-8 Page 20 
X-25 QUEUE I/O PACKET TO DRIVER 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (7) 


950 
951 
952 
953 
954 
955 
956 
957 
958 
959 
960 
961 
962 
963 
964 
965 
966 
967 
968 
969 
970 
971 
972 


-SBTTL QUEUE I/O PACKET TO DRIVER 


+ 


EXESQIODRVPKT ~ QUEVE I/O PACKET TO DRIVER 


THIS ROUTINE IS JUMPED TO FROM A FUNCTION DECISION TABLE ACTION ROUTINE 
TO QUEUE AN I/O PACKET TO THE APPROPRIATE DRIVER. 


INPUTS : 
R3 = ADDRESS OF I/O REQUEST PACKET. 
R4 = CURRENT PROCESS PCB ADDRESS. 
R5 = UCB ADDRESS OF DEVICE UNIT. 


OUTPUTS: 


THE I/O PACKET IS QUEUED BY PRIORITY IN THE APPROPRIATE DEVICE 
QUEUE AND A NORMAL COMPLETION STATUS IS RETURNED. 


me te Ve Ve Ve Yo Te Ve Ye Ye Ye Ye Yo Vo Ve Ve Yo 


UNIVERSAL_SYMBOL EXESQIODRVPKT 

7 EXESQIODRVPKT: : ;QUEVE I/O PACKET 
BSBW EXESINSIOQ 7 INSERT I/O PACKET IN DEVICE QUEUE 
BRW EXESQIORETURN1 ; 


DIGITAL INTERNAL USE ONLY 119 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 21 
X-25 EXESALTQUEPKT - Call driver ALTSTART ent 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 


974 
975 
976 
977 
978 
979 
980 
981 
982 
983 
984 
985 
986 
987 
988 
989 
990 
991 
992 
993 
994 
995 
996 
997 
998 
999 
1000 
1001 
1002 
1003 
1004 
1005 
1006 
1007 
1008 
1009 
1010 
1011 
1012 
1013 
1014 
1015 
1016 
1017 
1018 
1019 
1020 
1021 
1022 
1023 
1024 
1025 
1026 
1027 
1028 
1029 
1030 


~e Ye Ye Ye Te Ye Ye Ne Ye Yeo Ye Ye Ye Te Te Ye Ye Te Te Ne Ye Ye “Yo Yo Ye 


58: 


™e Ve Ye Ve Te Ye Ye 


108: 


118: 


12$: 


-SBTTL EXESALTQUEPKT - Call driver ALTSTART entry point 


EXESALTQUEPKT - activates a driver at its ALTSTART entry point 


Routine description: 


Locates and calls a driver entry point supplied as an alternate 
START I/O entry point. Does test for unit busy before the 
call. Exits by returning to caller. 


The routine expects to gain control at or below driver fork 
level. The routine raises to driver fork IPL before the call, 
and restores the previous IPL before returning to its caller. 


Inputs: 
R3 - address of IRP 
R5 - address of UCB 
Outputs: 


Control returns to the requesting process. 


The routine destroys RO-R1l. R3 is destroyed by SMPSSWITCH_CPU. 


-ENABL LSB 


7 Unmodified device driver - just use FIPLs 


DSBINT UCBSB_FIPL(R5) ,- + RAISE IPL 
ENVIRON#=UNIPROCESSOR 
MOVL UCBSL_DDT(R5) , RO ? Get address of unit’s DDT. 
JSB @DDTS$L_ALTSTART (RO) 7 Call alternate start I/O routine. 
ENBINT + RESTORE IPL 
RSB + RETURN TO CALLER 


Device is busy ~ Place IRP on alternate startio wait queue. 
NOTE: 
may be performed. But since this would involve adding 2 longwords to the UCB 
and this is not a major release, this is not allowed. So for now this 

will be a singly linked list. This should be changed as soon as possible. 


This wait queue should be a doubly linked list so that an INSQUE 


ASSUME IRPSL_IOQFL EQ 0 


CLRL (R3) 3 Clear link to indicate end of queue. 
MOVAB UCBSL_ALTIOWQ(R5) , RO 3 Search for the end of the 

TSTL (RO) ? 

BEQL 12$ # alternate IO wait queue. 

MOVL (RO), RO 3 Follow the link. 

BRB 11$ 7 Keep going until hit the end. 


MOVL R3, (RO) Insert at end of queue. 

FORKUNLOCK LOCK=UCBS$B_FLCK(R5),- ; Unlock the FORK spinlock 
NEWIPL= (SP) +, - 3 Restore previous IPL 
CONDITION=RESTORE, - + Conditionally release spinlock 


120 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1969 16:24:35 VAX MACRO V5.0-8 Page 22 
X-25 EXESALTQUEPRT - Call driver ALTSTART ent 24-APR-1989 14:49:16 [SYS.SRC] SYSQIOREQ.MAR;1 


1031 
1032 
1033 
1034 
1035 
1036 
1037 
1038 
1039 
1040 
1041 
1042 
1043 
1044 
1045 
1046 
1047 
1048 
1049 
1050 
1051 
1052 
1053 
1054 
1055 
1056 
1057 
1058 
1059 
1060 
1061 
1062 
1063 
1064 
1065 
1066 
1067 
1068 
1069 
1070 
1071 
1072 
1073 
1074 
1075 
1076 
1077 
1078 
1079 
1080 
1081 
1082 
1083 
1084 
1085 
1086 
1087 


PRESERVE=NO ; Don’t preserve RO 
RSB ; 
UNIVERSAL SYMBOL EXESALTQUEPKT 
;EXESALTQUEPKT : : 3; Start I/O in driver. 
ASSUME UCBSB_FIPL EQ UCBSB_FLCK 
ASSUME SPLS_! MIN_ INDEX EQ 32 ; 
BBC #5, UCBSB | ) FLCK(R5) , 5$ 7BR IF FIPL 
FORKLOCK LOCK=UCB$B_FLCK (R5) , ~ 7; Lock the FORK spinlock 
SAVIPL=#~(SP),=- 3 Save the current IPL 
PRESERVE=NO + Don’t preserve RO 
BBS S“*#UCBSV_ALTBSY, UCBSL_STS(R5),10$ ;IF SET, THEN DEVICE IS BUSY 
PUSHL RS ? Preserve R5_~ 
ASSUME SMPSV_ENABLED EQ 0 
BLBC G“SMPSGL_FLAGS, 20$ ; Br if SMP is not enabled . 
find cpu_data  R0 7 Get address of CPU<-specific database 
MOVL CPUSL_PHY CPUID(RO),RO ; Get our CPU ID 
BBC RO, UCBSL_AFFINITY(RS5),60$ ; Br if can’t run on this CPU 
20$: MOVL § UCBSL_DDT(R5) , RO ; Get address of unit’s DDT. 
JSB @DDTSL , ALTSTART (RO) y Call alternate start I/O routine. 
40S: POPL RS 7 Restore R5 
FORKUNLOCK LOCK=UCB$B_FLCK(R5),- ; Unlock the FORK spinlock 
NEWIPL= (SP) +, - ; Restore previous IPL 
CONDITION=RESTORE, - # Conditionally release spinlock 
PRESERVE=NO 7 Don’t preserve RO 
RSB ? Return to caller. 
60S: : 
7 One last check to see if we can run on this CPU. If UCBSL_AFFINITY 
7 is equal to 0, then this implies that this device is tied to the 
; primary CPU. So if this CPU is the primary, then the I/O can be 
7 started now. Otherwise, a switch to the right CPU must be made. 
TSTL UCBSL_AFFINITY (R5) ; Check for logical primary 
BNEQ 65$ + Br if not primary 
CMPL RO, G*SMP$GL_PRIMID 7 Now is this CPU the primary? 
BEQL 20$ ; Br if yes, all set to start I/O 
e 
7 We will now fork onto the correct CPU to start this I/0. 
7 We will have to fork on the CDRP portion of the IRP. First, 
7 set the busy bit to indicate that the device is busy with an I/O. 
7 This is necessary since we are about to relinquish the fork- 
7 lock and we need a way to guarantee that no other I/O will be 
3; started before this 1/0 is started on the correct CPU. The correct 
7 ordering of I/O must be maintained. 
65$: BISL #UCBSM_ALTBSY, UCBSL_STS (R5) ; Set busy bit. 
PUSHAB B“40$ ; Push return address 
JSB G*SMPS$SWITCH_CPU 7 Switch to right CPU 
7 
7 This code executes as fork thread on correct CPU 
7 R3 = IRP address 
; RS = UCB address 
FORKLOCK LOCK=UCBSB FLCK(R5),~ ; Lock the FORK spinlock 
SAVIPL=-(SP),- 3; Save the current IPL 


DIGITAL INTERNAL USE ONLY 121 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 23 


X-25 EXESALTQUEPKT - Call driver ALTSTART ent 


1088 
1089 
1090 
1091 
1092 
1093 
1094 
1095 
1096 
1097 
1098 
1099 
1100 
1101 
1102 
1103 
1104 
1105 
1106 
1107 
1108 
1109 
1110 
1111 


1112. 


708: 


75$: 


Check 
set. 


ete Ve Ye Vo 


80S: 


PUSHL 


PRESERVE=NO 
RS 


find_cpu_data RO 


MOVL 
BBS 

TSTL 
BNEQ 
CMPL 
BNEQ 
MOVL 
JSB 


for any 


MOVL 
MOVL 
BEOL 
ASSUME 
MOVL 
BRB 


BICL 
BRW 
-DSABL 


CPUSL_PHY_CPUID (RO) ,. RO : 
RO, UCBSL_AFFINITY (R5) , 75$ 
UCBSL_AFFINITY (R5) ? 
65$ ; 
RO, G*SMP$GL_PRIMID A 
65$ ; 
UCB$L_DDT(R5) , RO ; 
@DDTS$L_ALTSTART (RO) ; 


24-APR-1989 14:49:16 [SYS.SRC)SYSQIOREQ.MAR;1 


Don’t preserve RO 

Preserve R5. 

Get address of CPU-specific database 
Get our CPU ID 

? Br if can run on this CPU 

Check for logical primary 

Br if not primary 

Now is this CPU the primary? 

Br if not primary, go switch to it. 
Get address of unit’s DDT. 

Call alternate start I/O routine. 


IRPs that may have been waiting while the busy bit was 


(SP),R5 ; 
UCBSL_ALTIOWQ(R5),R3 . + 
80$ ; 
IRPSL_IOQFL EQ 0 

(R3),UCB$L_ALTIOWQ(R5) ; 


Retrieve R5 from the stack. 
Any IRPs in waiting 
EQL, none waiting ~- done. 


Remove entry 


70$ ? and process it. 
#0CBSM_ALTBSY, UCBSL_STS (R5) 7 Clear busy bit. 
40$ 

LSB 


122 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ'- QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 24 
X-25 QUEVE I/O PACKET TO ACP 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (9) 


1114 
1115 
1116 
1117 
1118 
1119 


~“ 1120 


1121 
1122 
1123 
1124 
1125 
1126 
1127 
1128 
1129 
1130 
1131 
1132 
1133 
1134 
1135 
1136 
1137 
1138 
1139 
1140 
1141 
1142 
1143 
1144 
1145 
1146 
1147 
1148 
1149 
1150 
1151 
1152 
1153 
1154 
1155 
1156 
1157 
1158 
1159 
1160 
1161 
1162 
1163 
1164 
1165 
1166 
1167 
1168 
1169 


-SBTTL QUEUE I/O PACKET TO ACP 
+ 


+ EXESQIOACPPKT ~- QUEUE I/O PACKET TO ACP 


; 


+ THIS ROUTINE IS JUMPED TO FROM A FUNCTION DECISION TABLE ACTION ROUTINE 


INPUTS: 


OUTPUTS: 


R4 ALTERED 


Se Ye Se Ne Ve Ye Yo Te es Te Te Yeo Ye Te Ye Yeo 


UNIVERSAL_SYMBOL 
7 EXESQIOACPPRT: : 


TO QUEUE AN I/O PACKET TO THE APPROPRIATE ACP OR XQP. 


R3 = ADDRESS OF I/O REQUEST PACKET. 
R4 = CURRENT PROCESS PCB ADDRESS. 
R5 = UCB ADDRESS OF DEVICE UNIT. 


CURRENT IPL MUST BE IPLS$_ASTDEL OR IPL$_SCHED 


THE I/O PACKET IS QUEUVED AT THE END OF THE APPROPRIATE ACP OR XQP QUEUE 
AND A NORMAL COMPLETION STATUS IS RETURNED. 


EXESQIOACPPKT 


7QUEUVE I/O PACKET TO ACP 


7GET ADDRESS OF ACP AQB 


GIVE TO XQP 
; INSERT I/O PACKET AT END OF ACP QUEUE 


;NOTE: RO IS DESTROYED BY SINSQTI MACRO 
7;IF NEQ NOT FIRST ENTRY IN QUEUE 


; UNLOCK SCHED DATABASE 


7IF LBS ACP STILL PRESENT 
7NONEXISTENT ACP PROCESS 


;QUEVE I/O REQUEST COMPLETION STATUS RETURN 


THE PROBLEM IS THAT SOME 
WHILE OTHERS DO NOT 


;LOCK FORK THREADS/USE IPL OF LOCK 


MOVL UCBSL_VCB (R5) ,R2 7;GET ADDRESS OF VCB 
MOVL VCBSL_AQB(R2) ,R2 
TSTL AQBSL_ACPPID (R2) 7GET ADDRESS OF AQB 
BNEQ 40$ 7;NEQ - IT’S FOR XQP 
BRW XQP 7 ELSE, 
408: SINSQTI (R3),AQBSQ_ACPIQ(R2),RO 
BNEQ EXESQIORETURN1 
MOVL AQBSL_ACPPID(R2),R1 ?GET ACP PROCESS ID 
LOCK LOCKNAME=SCHED, - 7LOCK SCHED DATABASE 
P RESERVE=NO 7 Don’t preserve RO 
JSB G“SCHSWAKE ;WAKE UP ACP PROCESS 
UNLOCK LOCKNAME=SCHED, - 
NEWIPL=#0 7DROP IPL 
BLBS RO, EXESQIORETURN1 
BUG CHECK NONEXSTACP 
UNIVERSAL SYMBOL EXESQIORETURN 
7 EXESQIORETURN: : 
7 SMP NOTE- THE FOLLOWING NONSENSICAL CODE INSURES THAT THE FORKLOCK 
7 IS HELD, SO WE CAN UNLOCK THE FORKLOCK. 
; DRIVERS RETURN HERE WITH THE FORKLOCK HELD, 
; OWN THE FORKLOCK. THIS CODE SEQUENCE MAKES BOTH CASES WORK! 
ASSUME UCBSB FIPL EQ UCBSB_FLCK 
ASSUME SPLS$_MIN_ INDEX EQ 32 
BBC #5,UCBSB_FLCK(R5),EXESQIORETURN1 ;BR IF FIPL 
FORKLOCK UCBSB_FLCK(R5) ,- 
PRESERVE=NO 


1170 EXESQIORETURNL: 


7 Don’t preserve RO 


DIGITAL INTERNAL USE ONLY 123 


CONFIDENTIAL AND PROPRIETARY. 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 25 
X-25 QUEUE I/O PACKET TO ACP 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (9) 


1171 
1172 
1173 
1174 
1175 
1176 
1177 
1178 
1179 
1180 
1181 
1182 
1183 
1184 
1185 
1186 
1187 
1188 
1189 
1190 
1191 
1192 
1193 
1194 
1195 
1196 
1197 
1198 
1199 
1200 
1201 
1202 
1203 
1204 
1205 
1206 
1207 
1208 
1209 
1210 
1211 
1212 
1213 
1214 
1215 
1216 
1217 
1218 
1219 
1220 
1221 
1222 
1223 
1224 
1225 
1226 
1227 


ASSUME UCBSB_FIPL EQ UCBSB_FLCK 
ASSUME SPL$_MIN_ INDEX EQ 32 


BBC #5,U0CBS$B_FLCK(R5),EXESQIORETURN1 ;BR IF FIPL 
FORKUNLOCK LOCK=UCBS$B_FLCK(R5),- ;UNLOCK FORK SPINLOCK 
PRESERVE=NO ' 3 Don’t preserve RO 
EXESQIORETURN1 : : 7;QUEUE I/O REQUEST COMPLETION STATUS RETURN 
MOVZWL #SS$_NORMAL, RO 7SET NORMAL COMPLETION STATUS 
QIORETURN : ;RETURN SPECIFIED STATUS 
SETIPL #0 _  jgALLOW ALL INTERRUPTS 
XQP : : 
SETIPL #IPL$_ASTDEL, - 7ALLOW PAGEFAULTS 
ENVIRON#=UNIPROCESSOR 
MOVAB IRPS$L_FOFL(R3), RS 7USE CDRP PART OF IRP AS ACB 
PUSHAB QIORETURN 7RETURN ADDRESS FROM EXESQXQPPRT 


FALL THROUGH TO XQP QUEUEING ROUTINE IMMEDIATELY FOLLOWING. 
RSB FROM THIS ROUTINE RETURNS TO EXIT ABOVE. 


me Ye Ye Ne 


-SBTTL EXESQXQPPKT - QUEUE I/O PACKET TO XQP 
+ 
EXESQXQPPKT - INSERT I/O PACKET IN XQP QUEUE 


THIS ROUTINE IS CALLED TO INSERT AN I/O PACKET IN THE XQP QUEUE 
AND START THE THREAD OF EXECUTION IF IT IS THE ONLY REQUEST. 


CALLING SEQUENCE: 
BSB/JSB EXESQXQPPKT - THIS IS EITHER CALLED FROM QIO OR 
AS A SPECIAL KERNEL AST INVOKED BY IOPOST. 

INPUTS : 


R4 = CURRENT PROCESS PCB ADDRESS. 
R5 = ADDRESS OF TEMP ACB PART OF IRP. 


OUTPUTS: 
RO = status from SCHSQAST. 
IF SUCCESS: 
A KERNEL AST IS QUEUED TO THE DISPATCH ROUTINE OF THE XQP 
IF NO PACKETS WERE ALREADY ON THE REQUEST QUEUE OF THE XOQP. 
THIS ROUTINE MUST BE CALLED AT IPL ASTDEL SO THAT THE 


IRP CANNOT BE LOST (BECAUSE OF PROCESS DELETION) UNTIL IT 
IS PLACED ON THE XQP REQUEST QUEUE. 


™e Ve Re Se Te Ye Be Ye Te Yo Ye Be Ve We We Be Be Ye Ve Ne Yeo We Yo Be We Ye Yo Vo 


UNIVERSAL_SYMBOL EXESQXQPPKT 
7 EXESQXQPPKT:: 
MOVL G“CTLSGL_F11BXQP, RO 7ADDR OF XQP QUEUE HEAD 
MOVAB CDRPSL_IOQFL(RS), - ;ADDRESS OF IRP 
ACBSL_ASTPRM(RS) 7IS AST PARAMETER. 
MOVB #PSLS$C_KERNEL!ACBS$M_NODELETE,- ;KERNEL MODE, DON’T DELETE IRP 


124 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 26 
X-25 EXESQXQPPRT - QUEUE I/O PACKET TO XQP 24-APR-1989 14:49:16 [(SYS.SRC]SYSQIOREQ.MAR;1 (9) 


1228 
1229 
1230 
1231 
1232 


MOVL 
MOVL 
MOVL 
JMP 


ACB$B_RMOD (R5) 

PCB$L_PID(R4), ACB$L_PID(R5) ;COPY PID. 
F11B$L_DISPATCH(RO), ACB$L_AST(R5) ;XQP DISPATCHER ADDRESS. 
#PRIS$_RESAVL, R2 ;SAME AS AFTER WAITING FOR A LOCK. 
G*SCHSQAST ;QUEVE THE AST AND RETURN. 


DIGITAL INTERNAL USE ONLY 125 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 27 
X-25 INSERT I/O PACKET IN UNIT QUEUE 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (10) 


1234 
1235 
1236 
1237 
1238 
1239 
1240 
1241 
1242 
1243 
1244 
1245 
1246 
1247 
1248 
1249 
1250 
1251 
1252 
1253 
1254 
1255 
1256 
1257 
1258 
1259 
1260 
1261 
1262 
1263 
1264 
1265 
1266 
1267 
1268 
1269 
1270 
1271 
1272 
1273 
1274 
1275 
1276 
1277 
1278 
1279 
1280 
1281 
1282 
1283 
1284 
1285 
1286 
1287 
1288 
1289 
1290 


+ 


=e 


me Te Se Be Se Te Ve Ye Ye Be Yo Ye Vo 


20$ 


Q FIPL: 


60$ 


-SBTTL 


INPUTS : 


INSERT I/O PACKET IN UNIT QUEUE 


EXESINSIOQ - INSERT I/O PACKET IN UNIT QUEUE 


THIS ROUTINE IS CALLED TO INSERT AN I/O PACKET IN A UNIT QUEUE AND CALL 
THE APPROPRIATE I/O DRIVER IF THE UNIT IS NOT BUSY. 


R3 = ADDRESS OF I/O REQUEST PACKET. 
R5 = UCB ADDRESS OF DEVICE UNIT. 


ENVIRONMENT : 


THE FORK SPINLOCK IS ACQUIRED, AND THEN UNCONDITIONALLY RELEASED. 


UNIVERSAL_SYMBOL EXES INSIOQ 
? EXESINSIOQ: : 


ASSUME 
ASSUME 
BBC 


FORKLOCK LOCK=UCB$B | FLCK (RS) , - 


INCW 
BBSS 
PUSHL 
BSBW 
POPL 


7 INSERT IN I/O QUEUE 
UCBSB_ FIPL EQ UCBSB_FLCK 
SPLS | MIN INDEX EQ 32 
#5,UCBSB | ) FLCK(R5),Q FIPL ;BR IF FIPL 
Lock the FORK spinlock 
Save the current IPL 
PRESERVE=NO Don’t preserve RO 
UCBSW_QLEN (R5) Bump device queue length 
#UCBSV  BSY, UCBSW_STS(R5),20$ ;IF SET, THEN DEVICE IS BUSY 


SAVIPL=- (SP) ,- 


me Veo Ne we 


R5 ? Save UCB address 
IOCSINITIATE s INITIATE 1/0 FUNCTION 
R5 * Restore UCB address 


FORKUNLOCK LOCK=#UCBSB_FLCK(R5),- ; Unlock the FORK spinlock 


RSB 


MOVAL 
BSBW 


NEWIPL= (SP) +, - 3? Restore previous IPL 
PRESERVE=NO 3 Don’t preserve RO 

; 
UCBSL_IOQFL(RS5S),R2 #GET ADDRESS OF I/O QUEUE LISTHEAD 
EXES INSERTIRP ; INSERT I/O PACKET IN DEVICE QUEUE 


FORKUNLOCK LOCK=UCBSB_FLCK(R5),- ; Unlock the FORK spinlock 


RSB 


DSBINT 


INCW 
BBSS 
PUSHL 
BSBW 
POPL 
ENBINT 
RSB 


MOVAL 
BSBB 
ENBINT 
RSB 


NEWIPL= (SP) +, - 7 Restore previous IPL 
PRESERVE=NO 7 Don’t preserve RO 
UCBSB_FIPL(R5) ,- ; RAISE IPL 
ENVIRON=UNIPROCESSOR 
UCBSW_QLEN (R5) ; Bump device queue length 
#UCBSV_BSY, UCBSW_STS (R5) , 60$ 7IF SET, THEN DEVICE IS BUSY 
R5 7; Save UCB address 
IOCSINITIATE ; INITIATE I/O FUNCTION 
R5 3 Restore UCB address 

3 Restore previous IPL 

? 
UCBSL_IOQFL(RS5) , R2 ;GET ADDRESS OF I/O QUEUE LISTHEAD 
EXES INSERTIRP ; INSERT I/O PACKET IN DEVICE QUEUE 


7 Restore previous IPL 
; 


126 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE I/O REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 28 
X-25 INSERT I/O PACKET IN UNIT QUEUE 24-APR-1989 14:49:16 [SYS.SRC] SYSQIOREQ.MAR;1 (10) 


1291 ; 

1292 ; INSERT PACKET ON I/O AND CONDITIONALLY RELEASE SPINLOCK 

1293 ; 

1294 Le le a a EXES INSIOQC 

1295 ;EXESINSIOQC:: 7; INSERT IN I/O QUEUE 

1296 ASSUME UCBSB | FIPL EQ UCBSB_! FLCK 

1297 ASSUME SPLS_! MIN _ INDEX EQ 32 

1298 BBC #5, UCBSB | | FLCK(R5),Q_ FIPL ;BR IF FIPL 

1299 FORKLOCK LOCK=UCB$B | FLCK (R5) , - ? Lock the FORK spinlock 

1300 SAVIPL=-(SP),- 3 Save the current IPL 

1301 PRESERVE=NO 3 Don’t preserve RO 

1302 INCW UCBSW | QLEN (R5) 3 Bump device queue length 

1303 BBSS #UCBSV _BSY, UCBSW_STS(R5),20$ ;IF SET, THEN DEVICE IS BUSY 
1304 PUSHL R5 3; Save UCB address 

1305 BSBW IOCSINITIATE ; INITIATE I/O FUNCTION 

1306 POPL R5 3 Restore UCB address 

1307 FORKUNLOCK LOCK=UCBSB_FLCK(R5),- + Unlock the FORK spinlock 

1308 NEWIPL= (SP) +, - ; Restore previous IPL 

1309 CONDITION=RESTORE, - # Conditionally release lock 

1310 PRESERVE=NO 7 Don’t preserve RO 

1311 RSB ; 

1312 

1313 208: MOVAL UCBSL_IOQFL(R5), R2 ;GET ADDRESS OF I/O QUEUE LISTHEAD 
1314 BSBB EXES INSERTIRP ; INSERT I/O PACKET IN DEVICE QUEUE 
1315 FORKUNLOCK LOCK=UCBSB_FLCK(R5),- ; Unlock the FORK spinlock 

1316 NEWIPL= (SP) +, - 7 Restore previous IPL 

1317 CONDITION=RESTORE, - 7 Conditionally release lock 

1318 PRESERVE=NO 7 Don’t preserve RO 

1319 RSB ; 

1320 


DIGITAL INTERNAL USE ONLY 127 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSQIOREQ - QUEUE 1/0 REQUEST SYSTEM SERVICE 10-MAY-1989 16:24:35 VAX MACRO V5.0-8 Page 29 
X-25 INSERT I/O PACKET IN QUEUE BY PRIORITY 24-APR-1989 14:49:16 [SYS.SRC]SYSQIOREQ.MAR;1 (1 


1322 
1323 
1324 
1325 
1326 
1327 
1328 
1329 
1330 
1331 
1332 
1333 
1334 
1335 
1336 
1337 
1338 
1339 
1340 
1341 
1342 
1343 
1344 
1345 
1346 
1347 
1348 
1349 
1350 
1351 
1352 
1353 
1354 
1355 
1356 
1357 
1358 
1359 
1360 


-SBTTL INSERT I/O PACKET IN QUEUE BY PRIORITY 


+ 


EXESINSERTIRP - INSERT I/O PACKET IN QUEUE BY PRIORITY 


THIS ROUTINE IS CALLED TO INSERT AN I/O PACKET IN A SPECIFIED QUEUE BY 
PRIORITY. 


INPUTS : 


R2 = ADDRESS OF QUEUE LISTHEAD. 
R3 = ADDRESS OF I/O PACKET. 


CURRENT IPL MUST BE THE FORK LEVEL OF THE RESPECTIVE DRIVER PROCESS 
OR HIGHER. 


OUTPUTS : 


THE I/O PACKET IS INSERTED IN THE SPECIFIED QUEUE BY PRIORITY AND 
THE ‘2’ CONDITION CODE IS RETURNED TO THE CALLER. 


‘Z’ = i = ENTRY WAS FIRST ENTRY IN THE QUEUE. 


‘2’ = 0 = ENTRIES WERE ALREADY IN THE QUEUE. 


Se Ye Ye Ne Se Se Ye Ye Yo Ye Ye Ye Ye Be Ye We Te Te Ye Ye Ne Ye Yo Ye Yo 


R2 AND R3 ARE PRESERVED ACROSS THE CALL. 


UNIVERSAL_SYMBOL EXES INSERTIRP 

#EXESINSERTIRP : : ; INSERT I/O PACKET IN QUEUE BY PRIOR 
MOVL R2,R1 7;COPY LISTHEAD ADDRESS 

108: MOVL IRPS$L_IOQBL(R1),R1 7GET ADDRESS OF NEXT ENTRY 
CMPL R2,R1 7END OF QUEUE? 
BEQL 20$ 3;IF EQL YES 
CMPB IRP$B_PRI(R3),IRP$B_PRI(R1) ;NEW ENTRY PRIORITY GREATER? 
BLSSU 10$ 7IF LSS YES 

20$: INSQUE IRPS$L_IOQFL(R3),IRPS$L_IOQFL(R1) ;INSERT PACKET IN I/O QUEUE 
RSB ; 
-END 


128 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY | 
DIGITAL EQUIPMENT CORPORATION 


4 SYSIMGACT.LIS 


SYSIMGACT ~ Image Activator System Service 10-May-1989 16:11:13 VAX Bliss-32 V4.5- 


862 Page 1 


0001 
0002 
0003 
0004 
0005 
0006 
0007 
0008 
0009 
0010 
0011 
0012 
0013 
0014 
0015 
0016 
0017 
0018 
0019 
0020 
0021 
0022 
0023 
0024 
0025 
0026 
0027 
0028 
0029 
0030 
0031 
0032 
0033 
0034 
0035 
0036 
0037 
0038 
0039 
0040 
0041 
0042 
0043 
0044 
0045 
0046 
0047 
0048 
0049 
0050 
0051 
0052 
0053 
0054 
0055 
0056 
0057 


a ee eo ooo) 


LO-Apr-1989 10:48:52 _$254$ 


%*TITLE ’SYSIMGACT - Image Activator System Service’ 
MODULE SYSS$IMGACT ( 


IDENT = ’X-14’ ! File: SRC$:SYSIMGACT.B32 
) = 


BEGIN 


PRKEKRHEKKEHREREKKEHREKE EKER HEE KEKKEKRERKEKKKKEKEEKEKEEKREEKERKKKRKERKRERKEKKEKRRREKRHKKKKK 


1* 
{* 
1* 
1* 
'* 
1* 
t* 
1* 
1% 
1* 
1* 
t* 
t* 
t* 
t* 
t* 
t* 
t* 
1* 
t* 


COPYRIGHT (c) 1978, 1980, 1982, 1984, 1987 BY 
DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. 
ALL RIGHTS RESERVED. 


THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED 
ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE 
INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER 
COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY 
OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY 
TRANSFERRED. 


THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE 
AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT 
CORPORATION. 


DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS 
SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. 


® 
* 
* 
* 
x 
* 
* 
x 
* 
* 
* 
* 
x 
* 
* 
* 
* 
* 
* 
* 


FH KKH HH KIKI KKH KIKI KKK HH KI KHER KRERHE REIKI RR KIKI KEKE KEKE KK KEKKEKEKEKEKKEA 


1++ 

! Facility: 

! 

! Executive, System Service 

! 

! Abstract: 

! 

! This module contains the code necessary to map a portion of process 
! address space to a particular image file. 

! 

! Environment: 

! 

! The bulk of the code in this module executes in executive mode, in 
! a layer outside RMS. One routine executes a small amount of code in 
! kernel mode. 

! 

! Note that the image activator is not reentrant. 

! 

! Author: 

t 

! 

! 

! 

' 

! 

! 

! 

' 


Lawrence J. Kenah 


The original version of the image activator was written by Peter Lipma 


During Version 2 of VMS, extensive enhancements were made by Kathy 
Morse. 


Creation Date: 


DIGITAL INTERNAL USE ONLY 129 


CONFIDENTIAL AND PROPRIETARY 


DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 2 


X-14 


0058 
0059 
0060 
0061 
0062 
0063 
0064 
0065 
0066 
0067 
0068 
0069 
0070 
0071 
0072 
0073 
0074 
0075 
0076 
0077 
0078 
0079 
0080 
0081 
0082 
0083 
0084 
0085 
0086 
0087 
0088 
0089 
0090 
0091 
0092 
0093 
0094 
0095 
0096 
0097 
0098 
0099 
0100 
0101 
0102 
0103 
0104 
0105 
0106 
0107 
0108 
0109 
0110 
0111 
0112 
0113 
0114 


™e Te Se Ne Ye Se Se Ye Ve Se Ne Se Se Se We Be Ne Ye Ve Te Ne Se Te Te Ve Te VO Ve Be Te Yeo Vo Te Ve Ve Ve Ve Ne Ye Ye Ye Ne Ne ™e Ve Ve Ye Ve Ye Ve Vo Ve Ve Ye “Ne Ye Vo 


130 DIGITAL INTERNAL USE ONLY 


Pr ee ee ne ee oN ell ee oe el el ol oe el el el oe 


10-Apr-1989 10:48:52 _$25 


15 April 1983 


Modified By: 


X-14 


X-13 


X-12 


X-11 


X-10 


X-9 


X-1D5 


X-1D4 


X-1D3 


wMcO0014 Wayne Cardoza 10-Apr-1988 
More checks on protected images. 


HHO334 Hai Huang 31-Aug-1988 
Treat SS$_SYSVERDIF as a fatal error. 


HHO317 Hai Huang 25-Apr-1988 
Reset VVIEF transfer address when activating a main program. 


wmcooll Wayne Cardoza 29-Oct-1987 
Check flag bit before cleaning up image. 


JWT0297 Jim Teague 13-Aug-1987 
Use ADAWI for manipulating JIBSW_FILCNT. 


JDC0370 Jon Callas 30-JUL~1987 
Implement ECOs 24 and 65 in source. 


wMco0008 Wayne Cardoza 06-Jul-1987 
Allow more message sections. 


AKS0002 Al Simons 16-Feb-1987 
Fix bug which kept init routines in /header_res shareable 
images from being activated. 


AKS0001 Al Simons 26-Jan-1987 
Create a valid resultant name string area for the 
secondary image being activated. Allocate it from 
the Pl scratch space. Fix the S$ASSUME checking P1 
scratch space allocation to properly account for all 
items allocated there. 


SF04002 Stephen Fiorelli 03-Nov-1986 
Add support for new version checking mechanism. 
Version checking will be performed with a call 

to the routine EXESCHECK_VERSION. Also remove 

the case where the version is checked for an 

image whose header is resident. This is 
unnecessary since this check will have been made 
when the image was installed. 


SSA0001 Stan Amway 16-Oct-1986 
Support for exec mode rundown handlers. 


RNHO042 Richard N. Holstein, 28-Jan-1986 
Correct typo in previous. 


RNHO042 Richard N. Holstein, 28-Jan-1986 
Reference VECTORS from LIB.L32, also. 


RNHOO42 Richard N. Holstein, 28-Jan-1986 
Move SYS_OFFSETS into LIB.L32. 


CONFIDENTIAL AND PROPRIETARY - 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 3 


X~-14 


me Ze Ye We Ye Ye Ye Be Ye Be Ye We We Be Ze Ve Ve Ye We Yo Ye Ve Ve Ve Wo Ye Be Ye We 


=e Te Te Ye Se Ye Ne Ne Ve Se Be Ve Ye Ne Ye Ye Ve Ye Ve ™e Ye Ye Ye Se Be Re 


we Ne 


0115 
0116 
0117 
0118 
0119 
0120 
0121 
0122 
0123 
0124 
0125 
0126 
0127 
0128 
0129 
0130 
0131 
0132 
0133 
0134 
0135 
0136 
0137 
0138 
0139 
0140 


0141 


0142 
0143 
0144 
0145 
0146 
0147 
0148 
0149 
0150 
0151 
0152 
0153 
0154 
0155 
0156 
0157 
0158 
0159 
0160 
0161 
0162 
0163 
0164 
0165 
0166 
0167 
0168 
0169 
0170 
0171 


ll aol ell oll ol eel ol ol el oe el ol ool el oe oe oe ee ee ee 


<> > om Om fom OO Cem Cam Om fmm Cm Cm Cm Cem Cm Cam fem Cm fm fmm Cem cm cam tem Cam com tm cnt 8emD Oem Cee Cm Cam Pam cam Cem Om Cam tam Cm Cm cm mm cam cam cam cam cam Cam cam cm cm cam com com cam com 


X-1D2 


X-1C6 


v04-002 


vo4-001 


V03B-021 


V03B-020 


VYO3B-019 


V03B-018 


V03B-017 


VO3B-016 


V0O3B-015 


v0O3B-014 


lLO-Apr-1989 10:48:52 $25 


RNHOO42 Richard N. Holstein, 28-Jan-1986 
Reference SYS OFFSETS from SHRLIB$ instead of LIBS. 


SF04001 Stephen Fiorelli 17-Nov-1985 
Addition of system_service macro to build a 

system service descriptor block for the image 
activator. Also added require files SYS_OFFSETS 
and VECTORS to support the macro. 


TCMO001 Trudy C. Matthews 26-Sep-1985 
Use require file to define standard psects. 


LJK0289 Lawrence J. Kenah 7-Sep-1984 
Make SET VECTORS loop into a zero-pass loop if there is no 
work to do. 


MSHO0056 Michael S. Harvey 22-Jul-1984 
Rearrange new code for previous fix so the merged 
activation path for a CLI doesn’t get screwed up. 


MSH0056 Michael S. Harvey 21-Jun-1984 

When a secondary image must be substituted (such as 

with an AME or CLI) for a primary image, make sure to 
reinitialize the proper context variables, thus preventing 
Executive mode bugchecks. 


LJK0286 Lawrence J. Kenah 5-Jun-1984 
Set flag bit in IMAGCTX that indicates to SIMGFIX that 
shareable images contain initialization code. 


LJK0283 Lawrence J. Kenah 11-May-1984 

Set the DONE bit in all ICBs that result from a successful 
activation so that they do not disappear in a later 
activation that fails. 


LJKO0276 Lawrence J. Kenah 8-May-1984 
Make sure that ICBs are not left dangling when an image 
has already been activated or along error paths. 


LJK0274 Lawrence J. Kenah 16-Apr-1984 
Fix ERROR_CLEAN UP routine. 


LJK0269 Lawrence J. Kenah 31-Mar-1984 
Miscellaneous small changes. 

Add code that cleans up if an error is detected after 

some pages have been successfully mapped. 

Set internal status bit that indicates that the PO half 

of a Pl merge operation is taking place. 

Change the way that privileged vector context is stored. 
Return correct context if image is already mapped. 

Add state flags passed from $IMGACT to S$IMGFIX. 

Add error routine that performs a complete cleanup if 

an error occurs after an image has been successfully mapped. 
Defer addition of privileged vectors until fixups are done. 


LJKO268 Lawrence J. Kenah 29-Mar-1984 
Turn on code that records SHRCNT and USECNT in KFE. 


DIGITAL INTERNAL USE ONLY 131 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss~- 


32 V4.5-862 Page 4 


X-14 - 


0172 
0173 
0174 
0175 
0176 
0177 
0178 
0179 
0180 
0181 
0182 
0183 
0184 
0185 
0186 
0187 
0188 
0189 
0190 
0191 
0192 
0193 
0194 
0195 
0196 
0197 
0198 
0199 
0200 
0201 
0202 
0203 
0204 
0205 
0206 
0207 
0208 
0209 
0210 
0211 
0212 
0213 
0214 
0215 
0216 
0217 
0218 
0219 
0220 
0221 
0222 


we Ve Te Te Te Ne Te Ye Ye Yo Ye Ye Ye Ve Ye Ye Yo Ye Ye Yo Te Ye Te Se Yo Te Ye Ye Ye Te Ye Ne Ne 


we Te Se Ye Ve Ye Te Ye Ye Ye Ye Yo Ye Ye Ye Ye Ye Ye 


ee ae oe oe oe On ee oe ee ee ee ee ee ee ee ee ee ee ee 


own cab com cmm COR Cum CD Cab COR com Cam Ce cam Cam com Cab cam Cam cam Cam cum Cm Ca Cam ccm com CG cmb Com cam Cab Cam Cab com Cem COD cam COB ce COD cam Com cam Ce com Co CO Cem Cum cam 


V03B-013 


V03B-013 


V0O3B-012 
Vvo3B-011 


VO3B-010 


V03B-009 
V0O3B-008 
V0O3B-007 


VO3B-006 


V03B-005 


V0O3B-004 
V03B-003 


V03B-002 


V03B-001 


132 DIGITAL INTERNAL USE ONLY 


10-Apr-1989 10:48:52 $25 


LJK0267 Lawrence J. Kenah 28-Mar-1984 
Use name stored in KFE as global section name. This allows 
correct redirection of shareable images installed /SHARED. 


LJK02 66 Lawrence J. Kenah 27-Mar-1984 
Add major and minor ID consistency checks on the 
image header. 


MSHO0022 Michael S. Harvey 25-Mar-1984 
Unconceal known file lookups. 

wMc0003 Wayne Cardoza 24-Mar-1984 
Call RMSSET to set up image I/O area. 

WMCc0002 Wayne Cardoza 23-Jan-1984 
Misc small fixes. 

Add sequential loading of images. 

LJK0244 Lawrence J. Kenah 23~Aug-1983 


Turn on image accounting. Set default stack size. 


womcoo0ol Wayne Cardoza 05-Aug-1983 
Remove code for passing back FAB on failure. 


LJK0242 Lawrence J. Kenah 2-Aug-1983 
Add support for writable global sections. 


LJK0235 Lawrence J. Kenah 26-Jul-1983 
Add concept of image base address, different from starting 
address. Continue fixing bugs and cleaning up loose ends. 


LJK0232 Lawrence J. Kenah 21-Jul-1983 
The starting address of the image I/O segment should 
be page aligned. 


LJK0230 Lawrence J. Kenah 18-Jul-1983 
Add system version check. Add 001 suffix to main image name 


LJKO0228 Lawrence J. Kenah 12-Jul-1983 
Propogate setting of EXPREG flag into the ICB. 


LJK0219 Lawrence J. Kenah 29-Jun-1983 
Add support for compatibility mode and other alias images. 
Fix the many bugs that were discovered during debugging. 


LJKO0200 Lawrence J. Kenah 15-Apr-1983 
Being a complete rewrite of the original image activator 
system service. 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 5 


X-14 


~e Se Te 


™e Re Te Se Re Ye We Ve Be “ea Ye We Ve Ve 


we Ne 


=e Ve Se Ve Ye Vo 


we Ye Ye Yo Ve Ye 


we Me Ne 


me Me Ye Ve Ye Se Ne Ve Ne Ne 


™e Ye Ve 


™e Se Te Ne Ve Ve Ve Ye Be We 


0224 
0225 
0226 
0227 
0228 
0376 
0377 
0378 
0464 
0621 
0622 
0623 
0624 
0625 
0626 
0627 
0628 
0629 
0630 
0631 
0632 
0633 
0634 
0635 
0636 
0637 
0638 
0639 
0640 
0641 
0642 
0643 
0644 
0645 
0646 
0647 
0648 
0649 
0650 
0651 
0652 
0653 
0654 
0655 
0656 
0657 
0658 
0659 
0660 
0661 
0662 
0663 
0664 
0665 
0666 
0667 
0668 


a ee ee ee ee ee ee ee oe ee 


Declarations 10-Apr-1989 10:48:52 _$25 
%SBTTL 'Declarations’ 


SWITCHES ADDRESSING MODE (EXTERNAL = GENERAL, NONEXTERNAL = WORD RELATIVE) ; 


REQUIRE ’SRC$:PAGED_PSECTS.R32’; ! Define standard psects 
LIBRARY '’SYSSLIBRARY:LIB.L32’; ! Define system data structures 
REQUIRE ‘LIBS: IMGMSGDEF .R32! ; ! Get status code definitions 
REQUIRE ‘'LIBS$: IMGACTCTX.R32’ ; ! Define internal structures 


! Machine dependent features 


BUILTIN 
MOVCS, 
MOVPSL, 
MTPR, 
PROBER, 
PROBEW, 
INSQUE, 
REMQUE; 


! Miscellaneous internal symbols 


LITERAL 
TRUE = 1, 
FALSE = 0, 


BYTES PER PAGE = 512, 

RETURN BUFFER _SIZE = 512, 

EXTRA_USER_STACK = 2, 

END OF PO SPACE = %X’3FFFFFFF’, 

EXEC PROT = (PRT$C_UREW * 8) OR PSLSC_EXEC, 
MESSAGE_OFFSET = 1024; 


! Linkage declaration for procedures invoked with the S$CMKRNL system service 


LINKAGE 
SYS _CMKRNL = CALL : GLOBAL (PCB = 4); 


! Internal references 


FORWARD ROUTINE 
CHECK PARAMS, 
INIT_WINDOW 
CHECK MATCH CONTROL, 
GET _OTHER_IMAGE, 
END PROCESSING, 
SET CONTROL REGION : SYS_CMKRNL, 
GET LOCK, 
RELEASE_LOCK, 
ERROR_CLEAN_UP : NOVALUE, 
SET_VECTORS; 


SYS_CMKRNL, 


eo 


! Routines that will be referenced by the ISD mapping routines as well 
! as internally 


FORWARD ROUTINE 
IMG$GET_HEADER, 


DIGITAL INTERNAL USE ONLY 133 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator 


32 V4.5-862 Page 6 


System Service 10-May-1989 16:11:13 VAX Bliss- 


X-14 Declarations 10-Apr-1989 10:48:52 _$25 
; 0669 1 IMGSOPEN_IMAGE, 

; 0670 1 IMGSALLOCATE_ICB, 

, 0671 1 IMGSDEALLOCATE_ICB : NOVALUE; 

; 0672 1 

7 0673 1 ! Linkage declarations to JSB routines in exec 

; 0674 1 

; 0675 1 LINKAGE 

? 0676 1 RM_RESET = JSB : NOPRESERVE (0,1, 2) 

: 0677 1 NOTUSED (3,4,5,6,7,8,9,10,11), 

; 0678 1 RM _SET = JSB (REGISTER = 0, REGISTER = 1) : 
; 0679 1 NOPRESERVE (0,1,2) 

3 o6s0 1 NOTUSED (3,4,5,6,7,8,9,10,11), 

; o6s1 1 EXE_ALOP1PROC = JSB (REGISTER = 1; REGISTER = 1,REGISTER = 2) : 
; 0682 1 NOPRESERVE (3) 

; 0683 1 NOTUSED (4,5,6,7,8,9,10,11), 

; 0684 1 EXE_DEAP1 = JSB (REGISTER = 0, REGISTER = 1) : 
; o6s5 1 NOPRESERVE (2,3) 

; o6s6 1 NOTUSED (4,5,6,7,8,9,10,11), 

; 0687 1 EXE_MAXACMODE = JSB (REGISTER = 0; REGISTER = 0) : 
; o6ss 1 NOPRESERVE (1) 

; 0689 1 NOTUSED (2,3,4,5,6,7,8,9,10,11), 

; 0690 1 EXE_PROBE_DSC = JSB (REGISTER = 1; REGISTER = 1, REGISTER = 2) : 
; 0691 1 NOPRESERVE (3) 

; 0692 1 NOTUSED (4,5,6,7,8,9,10,11), 

; 0693 1 IMG_IS_ IT MAPPED = JSB (REGISTER = 0; REGISTER = 1) : 
; 0694 1 PRESERVE (2,3,4,5,6,7) 

: 0695 1 NOTUSED (8,9,10,11), 

: 0696 1 IOC_VERIFYCHAN = JSB (REGISTER = 0; REGISTER = 1, REGISTER = 2) : 
; 0697 1 NOPRESERVE (3) 

: 0698 1 NOTUSED (4,5,6,7,8,9,10,11), 

; 0699 1 FIL_INIWCB = JSB (REGISTER = 1, REGISTER = 2, REGISTER = 3; 
; 0700 1 REGISTER = 2) : 

; 0701 1 PRESERVE (3, 4,5) 

; 0702 1 NOTUSED (6,7,8,9,10,11); 

; 0703 1 

; 0704 1 ! External references with explicit linkage mechanisms 

; 0705 1 

; 0706 1 EXTERNAL ROUTINE 

; 0707 1 EXESALOP1PROC : EXE_ALOP1IPROC, 

; 0708 1 EXESDEAP1 : EXE _DEAP1, 

. 0709 1 EXESMAXACMODE : EXE _MAXACMODE, 

: 0710 1 EXESPROBER_DSC : EXE_PROBE_DSC, 

; 0711 1 EXESPROBEW_DSC : EXE_PROBE_DSC, 

; 0712 1 IMGSIS IT MAPPED : IMG IS IT MAPPED, 

? 0713 #1 IOCSVERIFYCHAN : IOC_VERIFYCHAN, 

; 0714 #1 FILSINIWCB : FIL _INIWCB, 

z 0715 1 RMSRESET : RM RESET, 

; 0716 1 RMSSET : RM SET; 

; 0717 #1 

; 0718 1 ! External procedure references 

; 0719 1 

; 0720 1 EXTERNAL ROUTINE 

; 0721 1 EXESCHECK_VERSION, 

; 0722 1 FILSOPENFILE, 

; 0723 1 IMGSDECODE_IHD, 

; 0724 1 IMG$DO_WORK_LIST, 

? 0725 1 MMGSCRETVA : SYS _ CMKRNL; 


134 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 7 


X-14 


™e Ye “Me Ne Te Ve Ye Ye We Vo We Ye Ve VWs Ve Ve Ve We Ye Ne Ye 


ve 


™e Se Te Ve Ze Ys Be We Ye We Ve 


=e Ye te Me Me Me Ne Me 


™e Se Se Ne Ne 


me Ye Te Ne Yeo Be Ye Yo Ye Se we 


0726 
0727 
0728 
0729 
0730 
0731 
0732 
0733 
0734 
0735 
0736 
0737 
0738 
0739 
0740 
0741 
0742 
0743 
0744 
0745 
0746 
0747 
0748 
0749 
0750 
0751 
0752 
0753 
0754 
0755 
0756 
0757 
0758 
0759 
0760 
0761 
0762 
0763 
0764 
0765 
0766 
0767 
0768 
0769 
0770 
0771 
0772 
0773 
0774 
0775 
0776 
0777 
0778 
0779 
0780 
0781 
0782 


ee I en al I ce No OO OO 


Declarations 


! External data cells in Pl space 


EXTERNAL 
CTLSAG_CMEDATA, 
CTLSAL_STACK 
CTLS$A_DISPVEC, 
CTL$GL_CTLBASVA, 
CTLS$GL_FIXUPLNK, 
CTL$GL_IMGHDREF, 
CTLS$GL_PHD 
CTLS$GL_RMSBASE, 
CTLS$GL_ VOLUMES, 
CTL$GQ_PROCPRIV 
LACSAW_VECSET 
IACS$GL_ICBFL 
IACS$AL_IMGACTBUF, 
IAC$GL_FIRST_ICB, 
IAC$GL_IMAGCTX 
IACSGL_MAIN_ICB, 
IAC$GL_ WORK LIST 
IAC$GL_IMAGE LIST 
IACSGL_STACK_ SIZE, 
PIO$GW_IIOIMPA 
CTL$GL_VVIEF_ADDR, 
MMG$GL_ VVIEF_ADDR; 


10-Apr-1989 10:48:52 _$25 
: VECTOR [4], 
: REF SBBLOCK, 
: VECTOR [2], 
: VECTOR [5, WORD], 
: VECTOR [2], 


: $BBLOCK, 


VECTOR [2], 
VECTOR [2], 


: $BBLOCK, 


! The following cells in P1 space are used exclusively for image accounting 


EXTERNAL 
CTL$GL_ICPUTIM, 
CTL$GL_IFAULTS, 
CTL$GL_IFAULTIO, 
CTL$GL_IWSPEAK, 
CTLS$GL_IPAGEFL, 
CTLS$GL_IDIOCNT, 
CTL$GL_IBIOCNT, 
CTL$GL_IVOLUMES, 
CTL$GQ_ISTART 


: VECTOR [2]; 


! External data cells in system space 


EXTERNAL 
EXE$GL_ACMFLAGS 
EXESGL_FLAGS 
EXE$GL KNOWN FILES, 
EXE$GL_SYSID_ LOCK, 
EXE$GQ_KFE_LCKNAM, 
EXE$GQ_SYSTIME 
SGNSGW_IMGIOCNT 


SBBLOCK, 
SBBLOCK, 


VECTOR [2], 
WORD; 


! Miscellaneous constants defined elsewhere 


EXTERNAL LITERAL 
EXE$C_SYSEFN 
EXE$V_INIT 
SYS$K_VERSION 


UNSIGNED (6), 
UNSIGNED (6), 
UNSIGNED (31), 


DIGITAL INTERNAL USE ONLY 135 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 8 


X-14 


0783 
0784 
0785 
0786 
0787 
0788 
0789 
0790 
0791 
0792 
0793 
0794 
0795 
0796 
0797 
0798 
0799 
0800 
0801 
0802 
0803 
0804 
0805 
0806 
0807 
0808 
0809 
0810 
0811 
0812 
0813 
0814 
0815 
0816 
0817 
0818 
0819 
0820 
0821 
0822 
0823 
0824 
0825 


we “e Te Ve Ye Neo Ve Ne Te Se Ye Yeo Ye Ye “Ye Ye Ye Ye Ne Yo Ve Yo 


vu ty tg ty 


™e Ne Ne Ne Ye Se Ne Ye Ne Se Ye Ye Ye “Ye Ne Ye Ye Te Wo Se Ye 


PO re ee ee en en ee ee ee ee ll ll 


Declarations 


SYS$SO_VECTOR_BASE; 


10-Apr-1989 10:48:52 _$25 


! Make the bit position of the INIT flag available to BLISS 


MACRO EXE_V_INIT = 0, EXESV_INIT, 1, 


0 &; 


! Some miscellaneous address definitions 


decoded image header is assumed to 


LITERAL 


The first part of the image activator scratch area is divided up into two 
large pieces, each of which is further subdivided into a FAB, a NAM block, 
a 512-byte block into which each succeeding block of the image header will 
be read, and a buffer that will receive the decoded image header. The 


be smaller than a page. The area that 


follows these buffers is used as OWN storage by the image activator. 


INPUT BUFFER_SIZE = BYTES PER PAGE, 
IHD BUFFER_SIZE = BYTES PER PAGE; 


BIND 
INPUT BUFFER = IACS$AL_IMGACTBUF, 
PRIMARY_IHD = INPUT BUFFER + 512, 
AUX_BUFFER = PRIMARY_IHD + 512, 
AUX_IHD = AUX BUFFER + 512, 
PRIMARY FAB = AUX_IHD + 512, 
PRIMARY NAM = PRIMARY _FAB + FABSK_BLN, 
AUX_FAB = PRIMARY NAM + NAMSK BLN, 
AUX_NAM = AUX_FAB + FABSK_BLN, 
RESULT_NAME = AUX_NAM + NAMSK_BLN, 
AUX_RESULT_NAME = RESULT_NAME + NAMS$C_MAXRSS, 
OWN_STORAGE = AUX_RESULT NAME + NAMSC_MAXRSS : $BBLOCK; 


! There are eight pages set aside in Pl space (in module SHELL) for 
! the image activator scratch area. The following assumption guarantees 
! that the scratch area that is defined here fits into eight pages. 


SASSUME ( OWN_STORAGE SIZE + (2 * (INPUT _BUFFER_SIZE + 


LEQU, 
8 * BYTES PER PAGE ); 


136 DIGITAL INTERNAL USE ONLY 


IHD BUFFER_SIZE + 
FABSK_BLN + 
NAMSK_BLN + 
NAM$C_MAXRSS) ), 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 9 


X-14 


™e Ne Ne Se Ye Se “Se Ne Se Ne Ye Ne Ne Ye Ne Ne Ye Te Ne Ye Ye Ne Ye Ne Ye Ne Se Ye Ye Ye Ne Te Ye Ye Ye Ye Ye Ye Ye Ne We Ye No Ne Ye Te Be Ne Ye Ye Ve Ne Ye oe Ye Ye Ne 


0827 
0828 
0829 
0830 
0831 
0832 
0833 
0834 
0835 
0836 
0837 
0838 
0839 
0840 
0841 
0842 
0843 
0844 
0845 
0846 
0847 
0848 
0849 
0850 
0851 
0852 
0853 
0854 
0855 
0856 
0857 
0858 
0859 
0860 
0861 
0862 
0863 
0864 
0865 
0866 


. 0867 


0868 
0869 
0870 
0871 
0872 
0873 
0874 
0875 
0876 
0877 
0878 
0879 
0880 
ossl 
0882 
0883 


NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN D F&F F&F ee eee oe Oe oe et et ot oe ot pt et pt pt 


EXESIMGACT ~ Image Activator System Service Rou 10-Apr-1989 10:48:52 _$25 
%SBTTL ’EXESIMGACT - Image Activator System Service Routine’ 
GLOBAL ROUTINE EXESIMGACT 


(IMAGE _NAME ADDR , DEFAULT_NAME ADDR , BUFFER , CONTROL _ FLAGS , 
INADR , RETADR , IDENT , MODE ) = 


I++ 
! FUNCTIONAL DESCRIPTION: 
! 
This routine receives control from the system service dispatcher 
to perform the actual work of activating an image. 
CALLING SEQUENCE: 


CALLx G“SYSS$IMGACT 


TBS 


! 

{ 

! 

t 

! 

! 

! 

! FORMAL PARAMETERS : 
! 

t 

! 

! STATUS CODES: 
’ 

’ 

i= 


TBS 
BEGIN 
SYSTEM_SERVICE (NAME=IMGACT, ! This macro builds a system 
NARG=8, ! service descriptor block 
MODE=EXEC) ! for the image activator 
BUILTIN 
AP, 
CALLG; 


BIND FLAGS = OWN STORAGE [INPUT FLAGS] : $BBLOCK; 


LOCAL 
ICB_ADR : REF $BBLOCK, 
IHD CTX : S$BBLOCK [CTX_K_LENGTH], 
STATUS; 


! The portion of the impure area that is used as OWN storage is filled with 
! zeros. This initializes system service parameters, copies of input 
! parameters, and the like. 


CHSFILL (0, OWN_STORAGE_SIZE, OWN | STORAGE) ; 
OWN_STORAGE [FINAL_ STATUS] = Ss$_| NORMAL; ! Assume successful 
OWN | | STORAGE [USER_. STACK _ SIZE) = EXTRA _| USER STACK; . ! Assume a minimal u 


! No access check is required for the activation flags, which are present in 
! the argument list itself. A safe copy must be made, however, to insure tha 
! the flags are not destroyed by a mapping request issued by the image 
! activator. To avoid this, the flags are stored away in a safe place. 


OWN_STORAGE [INPUT FLAGS] = .CONTROL FLAGS; 


DIGITAL INTERNAL USE ONLY 137) 


CONFIDENTIAL AND PROPRIETARY. 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 10 


X-14 


0884 
0885 
0886 
0887 
0888 
0889 
0890 
0891 
0892 
0893 
0894 
os95 
0896 
0897 
0898 
0899 
0900 
0901 
0902 
0903 
0904 
0905 
0906 
0907 
0908 
0909 
0910 
0911 
0912 
0913 
0914 
0915 
0916 
0917 
0918 
0919 
0920 
0921 
0922 
0923 
0924 
0925 
0926 
0927 
0928 
0929 
0930 
0931 
0932 
0933 
0934 
0935 
0936 
0937 
0938 
0939 
0940 


a Me Se Se Te Ne Ve Ve Ve Ne Te Te Ne Yo Ye Ve Ve Ye Ye we Ve Te We Se Ne Ne Ye Ve Neo Ne Ne Veo Se Yo Ve Ve Te Te Ve Yo To Neo Ne Ve Ne Ne Ne Vo we Ve Ve Ye Yo 


ee Se Ve Ne 


NNNNNNNONWWWhKWNHWWWWWWNNDNNNNNNNNNNNNNWWWWWWWNnNNNNNWWWWWNnNNNND 


EXESIMGACT - Image Activator System Service Rou 10-Apr-1989 10:48:52 _$25 


IF .FLAGS [IACS$V_SETVECTOR] 
THEN RETURN SET VECTORS (); 


! Save the callers mode for use in various checks 


BEGIN 
LOCAL psl : BLOCK[4, BYTE]; 


MOVPSL (psl); 

OWN_STORAGE [CALL_MODE] = .psl[psl$v_prvmod]; 

END; 

! Set up the starting points for the various privileged vectors 


INCRU I FROM 0 TO 4 DO 
BEGIN 


BIND 
DISPVEC = CTLSA_DISPVEC + (.I * 256) : LONG; 


DISPVEC = .IACSAW_VECSET [.I]; 
END; 


! The input parameter list is checked for accessibility and the parameters a 
! stored in the impure area for later use. 


STATUS = CALLG (.AP, CHECK _PARAMS) ; 
IF NOT .STATUS THEN RETURN .STATUS; 


! Several other miscellaneous areas need to be initialized if this is 
! not a activation that merges an additional image into existing address 
! space. Note that the fixup vector listhead is unconditionally cleared. 


CTLS$GL_FIXUPLNK = 0; ! Set the fixup vector list to empty 

IF NOT .FLAGS [IACS$V_MERGE] 

THEN 
BEGIN 
RMSRESET (); ! Clear the image I/O segment 
CTL$GL_VVIEF_ADDR = .MMGSGL_VVIEF_ADDR; ! Reset VVIEF transfer address 
IACS$GL_IMAGCTX = 0; ! Start with a clean context slate 
OWN STORAGE [MAIN PROGRAM] = TRUE; ! Indicate that this is the activati 
END ! of a main program 

ELSE 
BEGIN 


BIND CONTEXT = IACSGL_IMAGCTX : VECTOR [2, WORD]; 


CONTEXT [1] = 0; ! Only clear flags passed to SIMGFIX 
END; 


! Before we open the image file, we need to check whether the image is alrea 
! mapped. If it is, we simply return successfully, passing back as much data 
! as is available about the image. 


STATUS = IMGSALLOCATE_ICB (ICB_ADR); ! Allocate an ICB for the primary im 


138 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 11 


- X-14 


=e Me Ye “eo Yeo Se Te Te Te Ye Ye Ne Te “Wo We 


Se Ye So Se Se Ne Ne Me te Se Se Se Ne Ye Ye “Se Se Ye “Ne Se Ye Ye Ye Yo 


se Ye Se Ye Ne 


Se Te Me Se Ne Ne 


=e Se Me Se Ye te Ne 


0941 
0942 
0943 
0944 
0945 
0946 
0947 
0948 
0949 
0950 
0951 
0952 
0953 
0954 
0955 
0956 
0957 
0958 
0959 
0960 
0961 
0962 
0963 
0964 
0965 
0966 
0967 
0968 
0969 
0970 
0971 
0972 
0973 
0974 
0975 
0976 
0977 
0978 
0979 
0980 
0981 
0982 
0983 
0984 
0985 
0986 
0987 
0988 
0989 
0990 
0991 
0992 
0993 
0994 
0995 
0996 
0997 


aba HLL HKH MTVU UUHUUYU UL HS AUN UD Hd oeWWWWWWwWWwWwWsWwwwwWwWvdWwWwWwWWwWdwwWwWnndNnnDn ND 


EXE$ IMGACT ~ Image Activator System Service Rou 10-Apr-1989 10:48:52 _$25 
IF NOT .STATUS THEN RETURN .STATUS; 


! The following check is only made for a merge activation 


IF .FLAGS [IACSV_MERGE] 
THEN 
BEGIN 


BIND 
INPUT_NAME = OWN STORAGE [IMAGE_NAME DESC] : SBBLOCK, 
ICB | NAME = ICB | ADR [ICBST_ IMAGE | NAME) 3 VECTOR {, BYTE], 
RETADR = - OWN _. STORAGE [RETURN __ ARRAY _ ADDRESS] : VECTOR [2], 
BUFFER = OWN _ STORAGE [BUFFER_. - ADDRESS) : VECTOR [128]; 


LOCAL 
MAPPED ICB : REF SBBLOCK; 


ICB_NAME [0] = .INPUT_NAME [DSCSW_LENGTH] ; 
movcs ( 
INPUT_NAME (DSCSW_LENGTH], 
- INPUT_NAME [DSCSA_POINTER], 
SREF (0), 
SREF (ICB$S_IMAGE_ NAME-~-1), 
ICB_NAME {1]); 
STATUS = IMGSIS IT MAPPED (ICB_NAME; MAPPED _ICB); 


! If the shareable image has already been mapped, we return successfully 
! after passing back to the caller whatever information is available. 


IF .STATUS EQL SS$_NORMAL 
THEN 
BEGIN | 


IF RETADR NEQU 0 


THEN 
BEGIN 
RETADR [0] = .MAPPED_ICB [ICB$L_STARTING_ADDRESS] ; 
RETADR [1] = .MAPPED_ICB {ICB$L_END_ ADDRESS]; 
END; 


IF BUFFER NEQU 0 

THEN 
BEGIN 
BIND IFD = BUFFER [3] : $BBLOCK; 
BUFFER [0] = 0; 
BUFFER [1] = IFD; 
BUFFER [2] = 0; 
IFD [IFD$W_CHAN] = .MAPPED_ICB [ICBSW_CHAN]; 
IFD [IFD$W_FLAGS] = .IAC$GL_IMAGCTX; 
END; 

IMGS$DEALLOCATE_ICB (.ICB_ADR); 


RETURN SS$_NORMAL; 


DIGITAL INTERNAL USE ONLY 139 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 12 


X-14 EXESIMGACT - Image Activator System Service Rou 10-Apr-1989 10:48:52 _$25 
; o99s 4 

? 0999 3 END; 

s 1000 3 

; 1001 2 END; 

; 1002 2 

? 1003 2 IAC$GL_FIRST_ICB = .ICB ADR; Remember address of this ICB 

; 1004 2 IF OWN STORAGE (MAIN_| PROGRAM) 

; 1005 2 THEN IACSGL_| MAIN _ICB = .ICB_ ADR; Remember it here, too, if main pro 
? 1006 2 ICB_ADR [ICB$L_CONTEXT] = IHD_CTX; Store address before opening image 
; 1007 2 

; 1008 2 STATUS = GET _LOCK(); Lock the KFE data base for read ac 
; 1009 2 IF NOT .STATUS THEN RETURN .STATUS; 

; 1010 2 

; 1011 2 STATUS = IMGSOPEN_IMAGE ( Open the image file 

; 1012 2 OWN_STORAGE [IMAGE_NAME_ DESC], 

; 1013 2 OWN | STORAGE [DFLT_| NAME | DESC], 

; 1014 2 PRIMARY FAB, 

; 1015 2 PRIMARY _NAM, 

; 1016 2 RESULT_NAME, 

- 1017 2 - ICB_ADR) ; 

; 1018 2 IF NOT .STATUS 

; 1019 2 THEN 

; 1020 3 BEGIN 

; 1021 3 IMGSDEALLOCATE_ICB (.ICB_ ADR); 

; 1022 3 RELEASE_LOCK QO; 

; 1023 3 RETURN .STATUS 

; 1024 2 END; 

? 1025 2 

; 1026 2 ! The IHD CTX context block stores the image header data that does not need 
; 1027 2 ! to exist once the image activator is done. Because this ICB represents the 
? 1028 2 ! image whose name was passed directly to the image activator, the primary 

; 1029 2 ! input buffer and IHD buffer are used. 

3 1030 2 

; 1031 2 IHD_CTX [CTX_L_ BUFFER] = INPUT BUFFER; 

; 1032 2 IHD | CTX [CTX L _ IHDBUF) = PRIMARY '_THD; 

? 1033 2 

? 1034 2 STATUS = IMG$GET_HEADER (.ICB_ADR) ; ! Decode and store away the IHD cont 
? 1035 2 IF NOT .STATUS 

; 1036 2 THEN 

? 06.1037 3 BEGIN 

; 1038 3 SDASSGN (CHAN = .ICB_ ADR [ICBSW_CHAN] ); 

; 1039 3 ERROR_CLEAN_UP (); 

; 1040 3 IMGSDEALLOCATE_ICB (.ICB_ADR) ; 

3 1041 3 RELEASE _LOCK (); 

; 1042 3 RETURN .STATUS 

? 1043 2 END; 

; 1044 2 

; 1045 2 ! There are several alias images that cause a secondary image to be activate 
3 1046 2 ! leaving the primary image opened and its name stored in P1 space for later 
; 1047 2 ! possible use by the secondary image, the one actually activated. 

; 1048 2 

? 1049 2 IF .IHD_CTX [CTX_W_ALIAS] NEQ IHDSC_NATIVE 

; 1050 2 THEN 

; 1051 3 BEGIN 

; 1052 3 STATUS = GET _OTHER_IMAGE (.ICB_ ADR); 

? 1053 3 IF NOT .STATUS 

; 1054 3 THEN 


140 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT. SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 13 


X~-14 


me Ve Me Ve Ye Se Be Ye We Ve We Be Ye Ye We Ve Te Ze “eo Ze Se Ve Be We Ve 


™e 


me Ne Ye Ve Ye Be We Ve Ve Ye We We We We Ye Ye We Ve 


se Ye Se Ye Ne Ye 


Se Se te Ne “eo Ye Ne 


1055 
1056 
1057 
1058 
1059 
1060 
1061 
1062 
1063 
1064 
1065 
1066 
1067 
1068 
1069 
1070 
1071 
1072 
1073 
1074 
1075 
1076 
1077 
1078 
1079 
1080 
1081 
1082 
1083 
1084 
1085 
1086 
1087 
1088 
1089 
1090 
1091 
1092 
1093 
1094 
1095 
1096 
1097 
1098 
1099 
1100 
1101 
1102 
1103 
1104 
1105 
1106 
1107 
1108 
1109 
1110 
1111 


WWWWNHNNNWWWWNNNDNNNNNNNWWNHNNNKH WWWnN WWW WW Ww WWnNONNNNHNNNNNNN W & & & Db 


EXESIMGACT - Image Activator System Service Rou 10-Apr-1989 10:48:52 _$25 


BEGIN 
IMGSDEALLOCATE_ICB (.ICB ADR); 
RELEASE LOCK (); 
RETURN .STATUS 
END; 
END; 


! Several other fields in the ICB must be loaded with information obtained 
! from the input parameter list. 


Note that EXPREG is only valid when mapping into PO space. Note further th 
the input map range is specified explicitly, rather than using the EXPREG 
flag in the ICB, which is only meaningful in ICBs for shareable images 
implicitly referenced during the activation of the primary image. 


IF .FLAGS (IACS$V_EXPREG] 
THEN 
BEGIN 


BIND 
PHD = .CTLSGL_PHD : $BBLOCK; 


ICB_ADR [ICB$L_STARTING ADDRESS] = .PHD [PHDS$L_FREPOVA]; 
ICB_ ADR [ICBS$L_END_ADDRESS] = END_OF_PO_ SPACE; 
END 
ELSE 
BEGIN 
ICB_ADR [ICB$L_STARTING ADDRESS) = .OWN_STORAGE [INPUT _START_ADDRESS]; 
ICB_ADR [ICBSL | END _ ADDRESS) = .OWN_ STORAGE (INPUT_END | ADDRESS) ; 
END; 


ICB_ ADR [ICBS$B_ACCESS MODE] = .OWN_STORAGE [ACCESS MODE]; 
ICB | } ADR [ICB$B ACT CODE} == 
' (IF . FLAGS [IACSV_ MERGE} 
THEN ICBSK_| MERGED ~ “IMAGE 
ELSE ICBSK | MAIN | PROGRAM) ; 
ICB_ADR [ICBSL | MATCH | CONTROL] = .OWN_STORAGE [MATCH CONTROL]; 
ICB | . ADR [ICBSL _ VERSION) = .OWN |_ STORAGE {VERSION] ; 


! The image control block is inserted into the work list where it can be 
! retrieved by the routine that converts ISDs into mapping requests. 


INSQUE (.ICB ADR , .IAC$GL_WORK_LIST [1]); ! Insert at tail of work lis 
STATUS = IMGS$DO_| WORK _LIST(); 
IF NOT .STATUS THEN 

BEGIN 

ERROR_CLEAN_UP (); 

RELEASE LOCK (); 

RETURN .STATUS 

END; 


STATUS = END PROCESSING (.ICB ADR); ! Set final state for image 
IF NOT .STATUS THEN 

BEGIN 

ERROR_CLEAN UP (); 

RELEASE LOCK (); 

RETURN .STATUS 


DIGITAL INTERNAL USE ONLY 141 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 14 


EXESIMGACT - Image Activator System Service Rou 10-Apr-1989 10:48:52 


_$25 


{ Allow exclusive access again 
! ... and return 


! End of routine EXESIMGACT main rou 


SYS$IMGACT SYSIMGACT - Image Activator System S 
ervice | 


X-14 
- 1112 2 END; 
7 1113 2 
; 1114 2 RELEASE_LOCK () ; 
- 1115 2 RETURN .OWN STORAGE [FINAL STATUS]; 
- 1116 2 
- 1117 1 END; 
TITLE 
.IDENT \X-14\ 
-PSECT 


000000006 00000 
. LONG 
00000000’ 00004 
08 00008 
-BYTE 
08 00009 
-BYTE 
MODE_IMGACT: 
BYTE 
IMASK_IMGACT: 
BYTE 
TYPE_IMGACT: 
.BYTE 
EXIT_IMGACT: 
-BYTE 
RESERVED_IMGACT: 
WORD 


01 OO00A 


81 0000B 


00 0000Cc 


00 0000D 


0000 0O000E 


- EXTRN 
- EXTRN 
- EXTRN 
-EXTRN 
-EXTRN 
-EXTRN 
-EXTRN 
- EXTRN 
-EXTRN 
-EXTRN 
- EXTRN 
-EXTRN 
-EXTRN 
- EXTRN 
-EXTRN 
-EXTRN 
-EXTRN 
-EXTRN 
-EXTRN 
- EXTRN 
-EXTRN 
- EXTRN 
-EXTRN 
- EXTRN 


142 DIGITAL INTERNAL USE ONLY 


EXECSINIT SSTBL_001, PIC,2 


BASE_VECTOR_IMGACT: 


SYS$SO_VECTOR_BASE+400 


ze 


SELF_RELATIVE_IMGACT: 
-ADDRESS EXESIMGACT 
MINIMUM _ARG_IMGACT: 


=e 


8 


we 


MAXIMUM _ARG IMGACT: 


@e 


1 


=e 


~127 


=e 


0 


=e 


0 


ve 


0 


=e 


EXES$ALOP1PROC, EXES$DEAP1 
EXES$MAXACMODE, EXESPROBER_DSC 
EXES$PROBEW_DSC, IMGS$IS_IT MAPPED 
IOC$VERIFYCHAN, FILSINIWCB 
RMSRESET, RMSSET 
EXE$CHECK_VERSION 

FILSOPENFILE, IMGS$DECODE_IHD 
IMG$DO_WORK_LIST 

MMGSCRETVA, CTL$AG_CMEDATA 
CTL$AL_STACK, CTLS$A_DISPVEC 
CTL$GL_CTLBASVA 

CTLS$GL_FIXUPLNK 

CTL$GL_IMGHDRBF 

CTL$GL_PHD, CTL$GL_RMSBASE 
CTL$GL_VOLUMES, CTL$GQ_PROCPRIV 
IACSAW_VECSET, IAC$GL_ICBFL 
IACS$AL_IMGACTBUF 
IACSGL_FIRST_ICB 
IAC$GL_IMAGCTX, IAC$GL_MAIN_ICB 
IACSGL_WORK_LIST 
IAC$GL_IMAGE LIST 
IACSGL_STACK SIZE 
PIO$GW_IIOIMPA, CTLS$GL_VVIEF_ADDR 
MMGSGL_VVIEF_ADDR 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 15 
X-14 EXESIMGACT - Image Activator System Service Rou 10-Apr-1989 10:48:52 _$25 


-EXTRN CTLS$GL_ICPUTIM, CTLS$GL_IFAULTS 
-EXTRN CTLS$GL_IFAULTIO . 

-EXTRN CTLS$GL_IWSPEAK, CTLS$GL_IPAGEFL 
-EXTRN CTLS$GL_IDIOCNT, CTLS$GL_IBIOCNT 
-EXTRN CTLS$GL_IVOLUMES 

-EXTRN CTL$GQ_ISTART, EXE$GL_ACMFLAGS 
-EXTRN EXESGL FLAGS, EXE$GL_KNOWN FILES 
-EXTRN EXE$GL_SYSID_LOCK 

-EXTRN EXES$GQ_KFE_LCKNAM 

-EXTRN EXE$GQ SYSTIME, SGNSGW_IMGIOCNT 
-EXTRN EXESC_SYSEFN, EXE$V_INIT 

-EXTRN SYS$K_VERSION, SYS$S0_VECTOR_BASE 
-EXTRN SYSS$DASSGN 


-PSECT EXECSPAGED CODE,NOWRT, PIC,2 


OFFC 00000 -ENTRY EXESIMGACT, Save R2,R3,R4,R5,R6,R7,R8,R9,- 
3 0829 
R10,R11 ? 
00000000G 00 9E 00002 MOVAB IACS$GL_IMAGCTX, R11 ; 
00000000G 00 9E 00009 MOVAB OWN _STORAGE+68, R10 7 
BG AE 9E 00010 MOVAB -72(SP), SP ; 
00 2C 00014 MOvc5 #0, (SP), #0, #104, OWN_STORAGE ; 0873 
BC AA 0001B : 
01 DO 0001D MOVL #1, OWN _STORAGE+16 3; 0874 
02 DO 00021 MOVL #2, OWN STORAGE+28 : 0875 
10 AC DO 00025 MOVL CONTROL FLAGS, OWN _STORAGE+68 : 0882 
05 El 00029 - BBC #5, FLAGS+2, 1$ 7 0884 
00 FB 0002E CALLS #0, SET_VECTORS ; 0885 
04 00033 RET t 
50 DC 00034 1S: MOVPSL PSL 3; 0892 
16 EF 00036 EXTZV #22, #2, PSL, R1 7 0893 
51 90 0003B MOVB R1,. OWN_STORAGE+36 : 
50 D4 0003F CLRL r 7; 0898 
08 78 00041 2S: ASHL #8, I, R1 3 0902 
00000000G0041 9F 00045 PUSHAB CTLSA_DISPVEC[R1] 7 0904 
00000000G0040 3c 0004c MOVZWL IACSAW_VECSET[I], @(SP)+ ; 
50 D6 00054 INCL I ; 
50 D1 00056 CMPL I, #4 ? 
E6 1B 00059 BLEQU 2S ; 
6C FA 0005B CALLG (AP), CHECK_PARAMS 7 0911 
50 DO 00060 MOVL RO, STATUS ; 
59 E9 00063 BLBC STATUS, 5$ 3 0912 
00000000G 00 D4 00066 CLRL CTL$GL_FIXUPLNK 7 0918 
04 £0 0006C BBS #4, FLAGS, 3$ 7 0919 
00000000G 00 16 00070 _JSB RMSRESET 7 0922 
00000000G 00 DO 00076 MOVL MMGS$GL_VVIEF_ADDR, CTL$GL_VVIEF_ADDR 7 0923 
6B D4 00081 CLRL IACS$GL_IMAGCTX 7 0924 
01 88 00083 BISB2 #1, OWN_STORAGE 7 0925 
03 11 00087 BRB 4s : 2 
02 AB. B4 00089 38: CLRW CONTEXT+2 7 0932 
5E DD 0008C 4S: PUSHL SP 7 0939 
O01 FB 0O00O8E CALLS #1, IMGSALLOCATE_ICB : 
50 DO 00093 MOVL RO, STATUS é 
59 E8 00096 5S: BLBS STATUS, 6$ 7 0941 
0157 31 00099 BRW 21$ ? 
04 El 0009C 68: BBC #4, FLAGS, 9$ 7 0945 
14 C1 OO0AO0 ADDL3 #20, ICB_ADR, R8& 7 0951 


DIGITAL INTERNAL USE ONLY 143 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT ~- Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 16 


X-14 EXESIMGACT - Image Activator System Service Rou 10-Apr-1989 10:48:52 
oc AA DO OOOA4 MOVL OWN _STORAGE+80, R7 

Fc AA DO OOOAS MOVL OWN _STORAGE+64, R6 

EC AA _ 90 OOOAC MOVB INPUT_NAME, (R8) 

FO AA DO OOOBO MOVL INPUT _NAME+4, RO 

EC AA 2C 000B4 MOVCS INPUT NAME, (RO), #0, #39, 1(R8) 

01 A8 OOOBA 
58 DO OOOBC MOVL R8, RO 

00000000G 00 16 OOOBF JSB IMGSIS_IT MAPPED 
50 DO 000Cc5 MOVL RO, STATUS 
59 Di oo00cs CMPL STATUS, #1 
2D 12 OO0OCB BNEQ 9$ 
57 DS OoO0CcD TSTL R7 
04 13 OOOCF BEQL 7§ 

48 Al 7D 000D1 MOVQ 72(MAPPED_ICB), (R7) 
56 D5 000D5 7S: TSTL R6 
16 13 000D7 BEQL 8$ 

OC <A6 9E O00D9 MOVAB 12(R6), RO 
66 D4 OOODD CLRL (R6) 

50 DO OOODF MOVL RO, 4(R6) 

08 <A6 D4 OO0E3 CLRL 8 (R6) 

OE Al_ BO OOOE6 MOVW 14 (MAPPED ICB), 8(RO) 
6B BO OOOEB MOVW IACSGL_IMAGCTX, 16 (RO) 
6E DD OOOEF 8S: PUSHL ICB_ADR 
01 FB OOOF1 CALLS #1, IMGSDEALLOCATE_ICB 
O01 DO OOOF6 MOVL #1, RO 

04 OOOF9 RET 
6E DO OOOFA 98: MOVL ICB_ADR, R2 
52 DO OOOFD MOVL R2, IACSGL_FIRST_ICB 

BC AA £E9 00104 BLBC OWN STORAGE, 10$ 
52 DO 00108 MOVL R2, IACS$GL_MAIN_ICB 

04 AE 9E OO10F 108: MOVAB IHD CTX, 88 (R2) 

oO FB 00114 CALLS #0, GET_LOCK 
50 DO 00119 MOVL RO, STATUS 
59 E8 0011C BLBS STATUS, 11$ 
OOD1 31 0011F BRW 21$ 
52 DD 00122 118: PUSHL R2 
FDBE CA 9F 00124 PUSHAB RESULT NAME 
FCAE CA 9F 00128 PUSHAB PRIMARY _NAM 
FC5E CA 9F 0012C PUSHAB PRIMARY_FAB 

F4 AA 9F 00130 PUSHAB OWN _STORAGE+56 

EC AA 9F 00133 PUSHAB OWN STORAGE+48 
06 FB 00136 CALLS #6, IMGSOPEN_ IMAGE 
50 DO 0013B MOVL RO, STATUS 
59 E9 0013E BLBC STATUS, 13$ 

F45E CA 9E 00141 MOVAB INPUT BUFFER, IHD_CTX 
F65E CA 9E 00147 MOVAB PRIMARY_IHD, IHD CTX+4 
52 DD 0014D PUSHL R2 
O1 FB 0014F CALLS #1, IMGSGET_ HEADER 
50 DO 00154 MOVL RO, STATUS 
59 E8 00157 BLBS STATUS, 12$ 
OE A2 3C 0015A MOVZWL 14(R2), —-(SP) 
O01 FB OO15E CALLS #1, SYSSDASSGN 
00 FB 00165 CALLS #0, ERROR_CLEAN_UP 
15 11 OO16A BRB 13$ 

12 AE Bl 0016C 12$: CMPW IHD CTX+14, #-1 
16 13 00172 BEQL 14$ 
52 DD 00174 PUSHL R2 


144 DIGITAL INTERNAL USE ONLY 


=e Te Ne Ne Se Ye Se Me Te Se Ye Se Te Te Ye Tea Se “Ne “se Ye Ne Ye Ye Ye Ye Ne Ye “Ne Ye Ye Ye Ye Ye Yo Ye Ye Te Se Ye Ye Ne Yea Se Ne Se Ye Ye Ve Ye Ye Te Ve Ye Ye Te Ne No 


_$25 


0952 
0953 
0958 
0961 
0964 


0965 


0970 
0974 


0978 
0981 


0985 


0987 


0988 
0989 
0990 
0991 
0995 


0997 


1003 


1004 
1005 
1006 
1008 


1009 


1011 
1016 
1015 
1014 
1013 
1012 


1018 
1031 
1032 
1034 


1035 
1038 
1039 
1040 
1049 


1052 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 17 


X-14 EXESIMGACT ~ Image Activator System Service Rou 10-Apr-1989 10:48:52 _$25 
O01 FB 00176 CALLS #1, GET OTHER_IMAGE ; 
50 DO 0017B MOVL RO, STATUS ; 
59 E8 O0O17E BLBS STATUS, 148 # 1053 
52 DD 00181 138: PUSHL R2 # 1056 
01 FB 00183 CALLS #1, IMGSDEALLOCATE_ICB ; 
64 11 00188 BRB 20$ # 1057 
OS £E1 0018A 14S: BBC #5, FLAGS, 15$ ? 1070 
00000000G 00 DO 0018E MOVL CTL$GL_PHD, RO 3 1075 
oo9c co po 00195 MOVL 156(RO), 72(R2) ? 1077 
3FFFFFFF 8F DO 0019B MOVL #1073741823, 76(R2) # 1078 
05 11 OO1A3 BRB 16$ ; 
04 =AA 7D 001A5 158: MOVQ OWN STORAGE+72, 72 (R2) 7 1083 
20 AA 90 OOIAA 168: MOVB OWN _STORAGE+100, 12(R2) 7 1086 
04 El OO1AF BBC #4, FLAGS, 17$ 7 1088 
02 DO 001B3 MOVL #2, RO 7 1089 
03 11 00186 BRB 18$ ; 
01 DO 001B8 17$: MOVL #1, RO 7 1090 
50 90 001BB 18S: MOVB RO, 13(R2) z 1087 
18 AA 7D 001BF MOVQ OWN_STORAGE+92, 64 (R2) z 1092 
00000000G 00 9E 001C4 MOVAB IACSGL_WORK_LIST+4, RO ? 1097 
62 OE 001CB INSQUE (R2), @0 (RO) z 
00 FB OO1CF CALLS #0, IMGSDO_WORK_LIST ? 1098 
50 DO 001D6 MOVL RO, STATUS ; 
59 E9 001D9 BLBC STATUS, 198 7 1099 
6E DD 001DC — PUSHL ICB_ADR 7 1106 
01 FB 00O1DE CALLS #1, END_PROCESSING ; 
50 DO 001E3 MOVL RO, STATUS ; 
59 E8 O01E6 BLBS STATUS, 22$ # 1107 
00 FB O01E9 198: CALLS #0, ERROR_CLEAN UP ? 1109 
00 FB OO1EE 208: CALLS #0, RELEASE _LOCK ? 1110 
59 DO OO1F3 218: MOVL STATUS, RO #1111 
04 OO1F6 RET ? 
00 FB OO1F7 228: CALLS #0, RELEASE_LOCK 7 1114 
cc AA DO 001FC MOVL OWN _STORAGE+16, RO 7 1115 
04 00200 RET ; 


# Routine Size: 513 bytes, Routine Base: EXEC$PAGED CODE + 0000 


DIGITAL INTERNAL USE ONLY 145 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 18 


X-14 


1119 
1120 
1121 
1122 
1123 
1124 
1125 
1126 
1127 
1128 
1129 
1130 
1131 
1132 
1133 
1134 
1135 
1136 
1137 
1138 
1139 
1140 
1141 
1142 
1143 
1144 
1145 
1146 
1147 
1148 
1149 
1150 
1151 
1152 
1153 
1154 
1155 
1156 
1157 
1158 
1159 
1160 
1161 
1162 
1163 
1164 
1165 
1166 
1167 
1168 
1169 
1170 
1171 
1172 
1173 
1174 
1175 


™e Te Ve Ve Ve Ve Te Ve Ve Ve Ve Ve Vo Vo Ye Ve Ve Ve We Ve Ye Ye Ye Ye Ve Ne 


me Ve Ve Ye Ye “Ys Yeo Ve Neo 


we Ye Te Se Ne Ye Ss Ve Ne Yeo Ve Ve 


te Ye Ne 


™e “Ne Se Se 88 Ne Ye 


NNN WWE BRBRWNHNNYNHNNNNNNNNNNNNNNNNHNNNANNNANNANN KF BP RPP Pe PRP eee ee ee 


CHECK_PARAMS - Check Accessibility and Store Pa 10-Apr-1989 10:48:52 _$25 
%SBTTL ’'CHECK_ PARAMS ~- Check Accessibility and Store Parameters’ 


ROUTINE CHECK_PARAMS (NAME, DEFAULT, BUFFER, FLAGS, INADR, RETADR, IDENT,ACMODE) = 


Functional Description: 
This routine probes each input parameter for read access and stores 
the value of the parameter in a safe place. Output parameters are probe 
for write access and their addresses are stored for later use. 


Calling Sequence: 


CHECK_PARAMS (NAME, DEFAULT, BUFFER, FLAGS, INADR, RETADR, IDENT, ACMODE) 


SAFE_PLACE, 
STATUS; 


! Define some synonyms for the local storage called SAFE PLACE 


BIND 
LOCAL NAME = SAFE PLACE : REF $BBLOCK, 
LOCAL DFLT = SAFE PLACE : REF $BBLOCK, 
LOCAL BUFFER = SAFE_PLACE, 
LOCAL_INADR = INADR : REF VECTOR, 
LOCAL _RETADR = RETADR : REF VECTOR, 
LOCAL IDENT = SAFE_PLACE : REF VECTOR; 


! Define some more synonyms for the two file name descriptors 


BIND 
NAM_DSC = OWN_STORAGE [IMAGE_NAME_ DESC] : $BBLOCK, 
DFLT_DSC = OWN_STORAGE [DFLT_NAME DESC] : $BBLOCK; 


! The image name is the only required parameter for the image activator. If 
! image name is not present, this routine returns with an IMGS_NONAME error. 


LOCAL _NAME = .NAME; 
IF .LOCAL_ NAME EQL 0 
THEN 
RETURN IMG$_NONAME 
ELSE 
BEGIN 
IF NOT (STATUS = EXES$PROBER_DSC ( 
. LOCAL_NAME ; 
NAM_DSC [DSC$W_LENGTH] , 
NAM DSC [DSC$A_POINTER]) ) 
THEN 
RETURN .STATUS 
END; 


! The default name descriptor is probed and stored in a similar fashion. No 


146 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 19 


X-14 


=e Ne Ye Ye Ne Ye Ve Ye Re Ve Ye Ve Ye Ye Ve Vo We We We We Wo Ye We Ye Ve We Ne Ye Ve Ye Ye Ye Yo 


™e Ye Se Ye Veo Ve Ne Be Ne Ye Ve Ye Ve Ye Ve Ve Ve Te We Ve Yo We We Ye 


1176 
1177 
1178 
1179 
1180 
1181 
1182 
1183 
1184 
1185 
1186 
1187 
1188 
1189 
1190 
1191 
1192 
1193 
1194 
1195 
1196 
1197 
1198 
1199 
1200 
1201 
1202 
1203 
1204 
1205 
1206 
1207 
1208 
1209 
1210 
1211 
1212 
1213 
1214 
1215 
1216 
1217 
1218 
1219 
1220 
1221 
1222 
1223 
1224 
1225 
1226 
1227 
1228 
1229 
1230 
1231 
1232 


WWWW WW WW WW NYNDNDWNHONNNNHONNNNNNWNHWNHNNNHNNNNNNNNHN WW OOo BWN WWW WDNDYDY DD 


CHECK_PARAMS - Check Accessibility and Store Pa 10-Apr-1989 10:48:52 _$25 


! error occurs if the default name is missing. 


LOCAL DFLT = .DEFAULT; 
IF .LOCAL DFLT EQL 0 
THEN 
BEGIN 
DFLT_DSC [DSC$W_LENGTH] = 0; 
DFLT_DSC {DSCSA_POINTER] = 0; 
END 
ELSE 
BEGIN 
IF NOT (STATUS = EXESPROBER_DSC ( 
~LOCAL_DFLT; 
DFLT_DSC [DSC$W_LENGTH], 
DFLT_DSC [DSC$A_POINTER] )) 
THEN 
RETURN .STATUS 
END; 


The address of a 512-byte buffer is tucked away after the buffer is 
checked for write access. 


NOTE WELL 
Because the image activator issues calls to other memory management syster 


services, the protection on this buffer may change. This buffer must be pr 
again by the completion code before anything is written to the buffer. 


LOCAL BUFFER = .BUFFER; 
IF (.LOCAL BUFFER NEQ 0) 
AND 
_(NOT PROBEW (%REF(0), %REF (RETURN BUFFER SIZE), -.LOCAL_ BUFFER) ) 
THEN RETURN SS$_ ACCVIO ~ 
ELSE OWN_STORAGE [BUFFER_ADDRESS] = .LOCAL BUFFER; 


!!! NEED TO PROPOGATE SOME OF THE FLAGS INFORMATION INTO OTHER OWN_ STORAGE 
!!! CELLS. ALSO NEED TO DO CONSISTENCY CHECKS BETWEEN FLAGS AND OTHER 
!!! INPUT PARAMETERS. 


! The input address range array specifies the address range into which the 
! image is to be mapped. It must be readable by the caller. 


LOCAL _INADR = .INADR; 
IF (.LOCAL_INADR NEQ 0) AND (NOT PROBER (REF (0), *REF(8), .LOCAL INADR) ) 
THEN RETURN SS$_ACCVIO; 
IF .LOCAL_INADR NEQ 0 
THEN 
BEGIN 


BIND 
FLAG BITS = OWN STORAGE [INPUT FLAGS) : $BBLOCK, 
ADDRESS RANGE = OWN_STORAGE [INPUT_START_ADDRESS] : $BBLOCK; 


OWN STORAGE [INPUT _START_ADDRESS] = .LOCAL_INADR [0]; 
OWN STORAGE [INPUT _END_ ADDRESS] = .LOCAL_INADR [1]; 


! We need to remember that this is the PO part of a P1 merge operation 


DIGITAL INTERNAL USE ONLY 147 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 20 


X-14 


1233 
1234 
1235 
1236 
1237 
1238 
1239 
1240 
1241 
1242 
1243 
1244 
1245 
1246 
1247 
1248 
1249 
1250 
1251 
1252 
1253 
1254 
1255 
1256 
1257 
1258 
1259 
1260 
1261 
1262 
1263 
1264 
1265 
1266 
1267 
1268 
1269 
1270 
1271 
1272 
1273 
1274 
1275 
1276 
1277 
1278 
1279 
1280 
1281 
1282 
1283 
1284 
1285 
1286 
1287 
1288 
1289 


we Te Ne Se Ye Ve Ve Ve Ve Ve Ne We We We Be Be Ye Ve Ve Ye Ve Ye Yo Yeo Ye Yo Ve Me Ye Ye Ye Be Ye Ye Ye Ve Ye Be Ye Ye Ye Ve Ve Vo Ve Ye Ye Ne Ne Ye Ye Ve 


Te Ne Ne Ve 


=e 


NNNNNNNNNNNWWWNHNNWNHNNNNNNWWWNHDHNNNNWNHNNNNNNNNNNNHN WWW OS Ud WW 


CHECK_PARAMS - Check Accessibility and Store Pa 10-Apr-1989 10:48:52 _$25 


! because certain steps taken in a REAL activation must not take place. 


IF ( 
(.FLAG_BITS [IAC$V_P1MERGE]) 
AND 
(NOT (.ADDRESS_RANGE [VASV_P1))) 
) 
THEN | 
OWN STORAGE [P1_ MERGE PO] = TRUE; 


END; 


The caller can specify the address of an array that will receive the 
address range into which a collection of images was mapped. This array 

is probed for write access and set to contain FFFFFFFF in both elements, 
indicating that no mapping has yet occurred. Note that this array, like 
the output buffer must be probed again by the completion code before the 
actual return address arra is written to make sure that the accessibility 
of the array has not changed as a side effect of a system service call 
issued by the image activator. 


LOCAL_RETADR = .RETADR; 
IF (.LOCAL_RETADR NEQ 0) AND (NOT PROBEW (%REF(0), *REF(8), .LOCAL_RETADR) ) 
THEN RETURN SS$_ACCVIO; 
OWN_STORAGE {RETURN | ARRAY_ADDRESS] = .LOCAL_RETADR; 
OWN _ . STORAGE [RETURN | START ADDRESS] = ~-l; 
OWN _ | STORAGE (RETURN | END | ADDRESS) =m -1; 
IF “LOCAL | RETADR NEQ 0 
THEN 
BEGIN 
LOCAL_RETADR [0] = -1; 
LOCAL _RETADR [1] = -1; 
END; 


! The caller can specify explicit match control infermation that will be 
! compared to the version number contained in the image that is actually 
! activated. 


LOCAL_IDENT = .IDENT; 
IF (.LOCAL IDENT NEQ 0) AND (NOT PROBER (%REF(0), *REF(8), .LOCAL_IDENT)) 


THEN RETURN SS$ ACCVIO; 


IF .LOCAL IDENT NEQ 0 
THEN 
BEGIN 
OWN STORAGE [MATCH CONTROL] = .LOCAL_IDENT [0]; 
OWN STORAGE [VERSION] = .LOCAL IDENT [1]; 
END; 


The final input parameter is the access mode that will be used for two 
purposes. The channel on which the image file is opened will have this 
access mode associated with it. The pages that are mapped will be owned 
by the mode specified by this parameter. 


Because an access mode of kernel is meaningless, a missing ACCESS MODE 
parameter is interpreted as USER mode. If a nonzero value is present in th 
argument list, it is first maximized with caller’s mode and then stored in 
! a safe place. 


eam com cmt com cum oem cee cow 


148 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY | 


DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT ~ Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 21 
X~-14 


me Ne Te Ye Ye Ye Ve Ye Be Xe 


1290 
1291 
1292 
1293 
1294 
1295 
1296 
1297 
1298 
1299 


00000000G 
00000000G 
04 


o04peccc 


08 


04 


oc 


14 


18 


FPNNNNNNNN ND 


00 
00 
ac 
08 
8F 


54 
66 
51 
52 
50 
AC 
07 
65 
A5 
10 
54 
66 
51 
52 
50 


Ac 
08 
00 
65 
54 
Ac 
51 
50 
08 
51 
00 
4F 


60 
06 
06 
20 
ac 


CHECK_PARAMS - Check Accessibility and Store Pa 10-Apr-1989 10:48:52 


IF .ACMODE<0,2> EOL 0 
THEN 
OWN STORAGE [ACCESS MODE] = PSL$C_USER 


ELSE 


EXESMAXACMODE (.ACMODE<O,2>; OWN_STORAGE [ACCESS_MODE]); 


RETURN SS$_ NORMAL 


END; 


o07Cc 


9E 
9E 
DO 
12 
DO 
04 
DO 


BO 
DO 
E9 
DO 
12 
B4 
D4 
11 
DO 


BO 
DO 
E8 


DO 
13 
OD 
13 
DO 
DO 
D4 
D5 
13 
D6 
oc 
13 
E9 
7D 
El 
EO 
88 
DO 


00000 CHECK_PARAMS: 


00002 
00009 
00010 
00014 
00016 
0001D 
OOO1E 
00021 
00023 
00027 
0002B 
0002E 
00032 
00034 
00036 
00039 
0003B 
0003E 
00040 
00043 
00047 
O0004A 
0004B 
0004F 
00051 
00057 
00059 
0005D 
00061 
00063 
00065 
00067 
00069 
0006D 
OOO6F 
00072 
00076 
0007B 
00080 
00084 


28: 


3$: 


4s: 


5$: 


6S: 


783 


- WORD 
MOVAB 
MOVAB 
MOVL 
BNEQ 
MOVL 
RET 


MOVL 
JSB 
MOVW 
MOVL 
BLBS 
RET 
MOVL 
BEQL 
PROBEW 
BEQL 
MOVL 
MOVL 
CLRL 
TSTL 
BEQL 
INCL 
PROBER 
BEQL 
BLBC 
MOVOQ 
BBC 
BBS 
BISB2 
MOVL 


! End of routine CHECK_PARAMS 


Save R2,R3,R4,R5, R6 
EXESPROBER_DSC, R6 
DFLT_DSC, R5 

NAME, LOCAL_NAME 

1$ 

#5082316, RO 


LOCAL_NAME, R1 
EXESPROBER_DSC 
R1, NAM_DSC 
R2, NAM _DSC+4 
STATUS, 3$ 
DEFAULT, LOCAL DFLT 
2$ 

DFLT_DSsc 
DFLT_DSC+4 

4s 

LOCAL DFLT, Rl 
EXESPROBER_DSC 
R1, DFLT_Dsc 
R2, DFLT_DSc+4 
STATUS, 4$ 


BUFFER, LOCAL BUFFER 

5$ 

#0, #512, (LOCAL_BUFFEK; 
10$ 

LOCAL _BUFFER, OWN _STORAGE+64 
LOCAL_INADR, RO 

R1 

RO 

6$ 

R1 

#0, #8, (RO) 

10$ 

R1, 7$ | 

(RO), OWN_STORAGE+72 

#6, FLAG BITS, 7$ 

#6, ADDRESS RANGE+3, 7$ 
#32, OWN_STORAGE 
LOCAL_RETADR, RO 


DIGITAL INTERNAL USE ONLY 149 


we Se Me Me Ye Ve Ne 


ve 


=e Se Ve 


™e Ye Ve Se We Se Ye Ye Ve Ye Ye Yo Be Ne Ye We Ys Ne We 


we Me Te Te Ys Ve Ve Ve Ve Ys Ne 


_$25 


1121 


1161 
1162 
1164 


1167 


1169 
1170 


1178 
1179 
1182 
1183 


1187 


1189 
1190 


1204 
1205 
1207 


1209 
1219 


1221 
1230 
1236 
1238 
1241 
1255 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 22 
X~-14 


51 pD4 00088 
50 D5 0008A 
0s 13 0008C 
51 D6 O008E 
00 OD 00090 
28 13 00094 


50 DO 00096 8$ 


01 CE OO09A 
Ol CE OO09E 
51 E9 OOOA2 
01 CE OOOAS 
01 CE OOOAS8 


1¢ AC DO OOOAC 9$ 


50 D4 OO0BO 
54 D5 000B2 
oc 13 000B4 
50 D6 OO00B6 
00 oc 000B8 
04 12 OO0OBC 


OC DO OOOBE 10S: 


04 000Cl1 


50 E9 000C2 11$ 


64 7D 000C5 


20 AC 93 000C9 12$ 


06 12 000CD 
03 DO OOOCF 
10 11 000D3 


00 EF 000D5 13$ 


00000000G 00 16 OOODB 
50 DO OOO0E1 


01 DO OO0OES 14$ 


04 OOO0ES 


3; Routine Size: 


150 DIGITAL INTERNAL USE ONLY 


233 bytes, 


CLRL 
TSTL 
BEQL 
INCL 
PROBEW 
BEQL 
MOVL 
MNEGL 
MNEGL 
BLBC 
MNEGL 
MNEGL 
MOVL 
CLRL 
TSTL 
BEQL 
INCL 
PROBER 
BNEQ 
MOVL 
RET 
BLBC 
MOVO 
BITB 
BNEQ 
MOVL 
BRB 
EXTZV 
JSB 
MOVL 
MOVL 
RET 


Routine Base: 


R1 

RO 

8$ 

R1 

#0, #8, (RO) 

10$ 

RO, OWN_STORAGE+80 
#1, OWN_STORAGE+84 
#1, OWN_STORAGE+88 
R1, 9$ 

#1, (RO) 

#1, 4(RO) 

IDENT, LOCAL _IDENT 
RO 

LOCAL_IDENT 

11$ 

RO 

#0, #8, (LOCAL IDENT) 
11$ 

#12, RO 


RO, 12$ 

(LOCAL_IDENT), OWN_STORAGE+92 
ACMODE, #3 

13$ 

#3, OWN_STORAGE+100 

14$ 

#0, #2, ACMODE, RO 

EXE $MAXACMODE 

RO, OWN_STORAGE+100 

#1, RO 


EXECS$PAGED_CODE + 0201 


CHECK_PARAMS ~ Check Accessibility and Store Pa 10-Apr-1989 10:48:52 


ee Ye Be Ye Be Te Ye Be Be Ye Ye Yo Ve Yo Ye Yo Ve Ve Ye Yo Yo Ye Ye Ye Ve Ye Ye Ye Yo Ye Yo Yo 


_$25 


1257 
1258 
1259 
1260 
1263 
1264 
1271 
1272 


1273 - 
1274 
1278 
1291 
1293 


1295 


1297 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss~ | 


32 V4.5-862 Page 23 


X-14 


™e Te Ve Se Be Ve Ba Be Ye Be Ye Ye Be Ve Ve BS Yo We Ve We We We Yo Ye Ve 


™e Te Se “Se Se Ye Ye Ye “so Ve We 


we Se Ve Ve Ne 


Se Te Se Se Te Se 


™e Se Me Ne Ye Me Se Se Se Ne 


1301 
1302 
1303 
1304 
1305 
1306 
1307 
1308 
1309 
1310 
1311 
1312 
1313 
1314 
1315 
1316 
1317 
1318 
1319 
1320 
1321 
1322 
1323 
1324 
1325 
1326 
1327 
1328 
1329 
1330 
1331 
1332 
1333 
1334 
1335 
1336 
1337 
1338 
1339 
1340 
1341 
1342 
1343 
1344 
1345 
1346 
1347 
1348 
1349 
1350 
1351 
1352 
1353 
1354 
1355 
1356 
1357 


WWNHNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNEP BP BPP EP EP BP RPE RP BP BP EPP BP BPP PPP Pee 


IMGSOPEN_IMAGE ~ Open Next Image File (10-Apr-1989 10:48:52 _$25 
%SBTTL ‘IMGSOPEN_IMAGE ~ Open Next Image File’ 
GLOBAL ROUTINE IMGSOPEN_IMAGE (NAME DESC , DFLT DESC , 


FAB_ADDRESS , NAM_BLOCK_ADDRESS , 
NAME STRING , ICB POINTER) = 


+ 


Functional Description: 


This routine opens an image file as a process permanent file for 
subsequent use by one of the memory management system services. 


Calling Sequence: 
IMGSOPEN_ IMAGE () 
Input Parameters: 
NAME_DESC - Address of string descriptor for image file name 


DFLT_DESC - Address of default name descriptor 


BEGIN 


MAP 
NAME STRING : REF VECTOR; 


BIND 
FAB = .FAB_ADDRESS : $BBLOCK, 
NAME BLOCK = .NAM_ BLOCK ADDRESS : $BBLOCK, 
ICB = .ICB POINTER : $BBLOCK, 
DEV_CHAR = FAB [FABSL_DEV] : $BBLOCK, 
ICB_ NAME = ICB [ICBST_ IMAGE NAME] : VECTOR [, BYTE]; 


! Create synonyms for the CTX and STV fields in the FAB 


BIND 
CHAN = FAB [{FABSL_ STV], 
KFE ‘= FAB [FABSL_CTX] : REF S$BBLOCK; 
MAP 
NAME_DESC : REF $BBLOCK, 
DFLT_DESC : REF SBBLOCK; 
LOCAL 
STATUS; 


Once the system is fully initialized, RMS and the file system can be used 


routines must be used. At least two images, SYSINIT.EXE and F11BXQP.EXE, 
are activated along this alternate code path. 


! 

_! to open the various image files. Until that time, the bootstrap file 
! 
! 


IF .EXESGL FLAGS [EXE_V_INIT] 
THEN 
BEGIN 


DIGITAL INTERNAL USE ONLY 151 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Blise- 


32 V4.5-862 Page 24 


X-14 


1358 
1359 
1360 
1361 
1362 
1363 
1364 
1365 
1366 
1367 
1368 
1369 
1370 
1371 
1372 
1373 
1374 
1375 
1376 
1377 
1378 
1379 
1380 
1381 
1382 
1383 
1384 
1385 
1386 
1387 
1388 
1389 
1390 
1391 
1392 
1393 
1394 
1395 
1396 
1397 
1398 
1399 
1400 
1401 
1402 
1403 
1404 
1405 
1406 
1407 
1408 
:1409 
1410 
1411 
1412 
1413 
1414 


A a a = a a a 


wy DO fy fC OD fg 


we Ne Ve Se Se Ne Yo Ye Ne Ye se Ve Te Ye Ve Ne Se Ye Ve Ve Ye Te Ne Ne Ne Te Ve Ye Ye Ye Ne Te Ye Te Ye Ye Ve Ye Ye Ye Ye TSO Ye Ye Ye Ne Te Ne Ye NO Ye Ye Ye Yeo Ye Ye Ye 


WWWWWWWWW WWW WWW BE WWWWWNWWW WE DH HWWWWWWWWHW WW WWWWWWwdWwW WwW Www 


IMGSOPEN_IMAGE - Open Next Image File 10-Apr-1989 10:48:52 _$25 
$FAB_INIT ( 
FAB = FAB, 
FNS = .NAME_DESC [DSCSW_LENGTH], 
FNA = .NAME_DESC [DSCS$A_POINTER], 
DNS = .DFLT_DESC [DSCSW_LENGTH], 
DNA = .DFLT DESC [DSCS$A_POINTER], 
NAM = NAME BLOCK, 
FOP = ( 
KFO , ! Use the known file data base 
PPF , ! Process permanent file 
sQo , ! Network optimization 
UFO ), ! User file open 
CTX = 0, ! KFE address will be returned here 
RTV = -1 ! Insure that WCB completely maps file 


3 
FAB [FAB$V_CHAN MODE] = .OWN_STORAGE [ACCESS MODE]; 


! The image files associated with writable global sections are opened 
! for write access. All other image files are opened for execute access. 


IF .ICB [ICB$V_OPEN_FOR WRITE] 
THEN 
BEGIN 
FAB [FABSB_FAC] 
FAB [FABS$B_SHR] 
END 
ELSE 
BEGIN 
FAB [FABS$B_FAC] 
FAB [FABS$B_SHR] 
END; 


FABSM_PUT OR FABSM_} EXE; !Setting the EXE bit 
FABSM | SHRGET OR FABSM_. SHRPUT OR FABSM_UPI; 


FAB$M_EXE; 
0; 


! If we are currently running an executable image installed with privile 
! or this image or an ancestor of this image was installed /PROT, then 
! we must direct RMS to only use the logical name tables that cannot be 
! redefined by user mode code. 


FAB [FABSV_LNM MODE] = 
(IF .IACSGL_IMAGCTX [IMAGCTX$V_PRIV] OR .ICB [ICB$V_PARENT_PROT] 
OR .ICB [ICB$V_PROTECTED] 
THEN PSL$C_EXEC 
ELSE PSL$C_USER) ; 


! Load NAM block with descriptor for resultant (or merely expanded) name 
{ string. (If a known file entry is found, then RMS does not return an 
! resultant string but merely the expanded string.) 


SNAM_INIT 
(NAM = NAME BLOCK, 
RSS = NAMSC_MAXRSS, 


RSA = .NAME STRING, 
ESS = NAMSC_MAXRSS, 

ESA = .NAME BLOCK [NAMSL RSA], 
NOP = <NOCONCEAL> 


? 


152 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 25 


X-14 


™e Te Me MO Se Ye YM Me Ye Se Me Ne Ye Ye Be Ye Ye Ye Ye Yeo Ye Ye Ye Ye Ve Ve Ve Ye Ve Yo Ye Ye Ye Yo Ye Ye Ne 


™e Se Me Me Me Me Me Me Me Me Me Ye Me Ye Me Ye Ve Ye Ye Yo 


1415 
1416 
1417 
1418 
1419 
1420 
1421 
1422 
1423 
1424 
1425 
1426 
1427 
1428 
1429 
1430 
1431 
1432 
1433 
1434 
1435 
1436 
1437 
1438 
1439 
1440 
1441 
1442 
1443 
1444 
1445 
1446 
1447 
1448 
1449 
1450 
1451 
1452 
1453 
1454 
1455 
1456 
1457 
1458 
1459 
1460 
1461 
1462 
1463 
1464 
1465 
1466 
1467 
1468 
1469 
1470 
1471 


WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWn WW WWW W db db bw woe oe eW WW WW WwW Ww 


IMGSOPEN_IMAGE - Open Next Image File 
STATUS = SOPEN (FAB = FAB) ; 


10-Apr-1989 10:48:52 _$25 


!!! THE FOLLOWING HACK ALLOWS INFORMATION IN THE FAB TO BE PASSED tir! 
!!! BACK TO THE CALLER IN THE EVENT THAT THE ACTIVATION FAILS t! 


i! 


if .own_storage [buffer_address] nequ 0 


then 
begin 


bind 


bufhdr = .own_storage [buffer_address] : vector [3,long]; 


if probew (tref(0), sref (4), bufhdr [2]) 


then 


bufhdr [2] = fab; 


end; 
| 


omm cam com cam cm SOR Ce cmp com 


—- 


!! 
ee} 


!!! THIS IS THE END OF THE ERROR REPORTING HACK tint 


IF NOT .STATUS THEN RETURN .STATUS; ! 77? WHAT ELSE 2??? 
own_storage[fab fac] = .fab(fab$b_fac]; !Save the one’s complement o 


END 
ELSE 
BEGIN 


!This is part of V4’s ECO 24 


! This is the code path that is used to open image files before the file 
! system and RMS exist. 


LOCAL 
RTVRBUF : VECTOR 
IXFHDR : VECTOR 
FILHDR s VECTOR 
STATBLK : VECTOR 
RTVRLEN, 


BUF _DESC : VECTOR 


INITIAL (512, RTVRBUF 


LOCAL 
ARG LIST : VECTOR 


(512, BYTE], 
{[512, BYTE], 
(512, BYTE], 
[2], 


(2] 


[3] 


! 
! 
! 
! 
! 
! 
)3 


Retrieval pointer buffer 

Index fils header buffer 

File header buffer 

Statistics block 

Returned length of retrieval buffe 
Retrieval pointer buffer descripto 


INITIAL (2, 0, BUF_DESC); 


STATUS = FILSOPENFILE 
FAB [FABSL_STV], 
.NAME_DESC, 
IXFHDR, 
FILHDR, 
STATBLK, 
RTVRLEN, 
BUF_DESC) ; 

IF NOT .STATUS 

THEN RETURN .STATUS; 


( 


IF .RTVRLEN GTR .BUF_DESC [0] 
THEN RETURN SS$_BADIMGHDR; 


Store channel here 

Address of name descriptor 
Address of index file header buffe 
Address of file header buffer 
Address of statistics array 
Returned buffer size 

Retrieval buffer descriptor 


Exit if error detected 


If the mapping pointers can’t fit 
a single page, then return an err 


DIGITAL INTERNAL USE ONLY 153 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 26 


X~-14 


1472 
1473 
1474 
1475 
1476 
P 1477 
P 1478 
1479 
1480 
1481 
1482 
1483 
1484 
1485 
1486 
1487 
1488 
1489 
1490 
1491 
1492 
1493 
1494 
1495 
1496 
1497 
1498 
1499 
1500 
1501 
1502 
1503 
1504 
1505 
1506 
1507 
1508 
1509 
1510 
1511 
1512 
1513 
1514 
1515 
1516 
1517 
1518 
1519 
1520 
1521 
1522 
1523 
1524 
1525 
1526 
1527 
1528 


“e Se Te Te Ye Ne Se Se Ve Ve Ve Ve Ve Ve We Ne Ve Ve Be Ne Be Te Ye Yo Ye Ve Ye Ye Ys Be Ve Ye Ye Yo Ye Yo We Yo Ne Ne Ve Ne Vo me Te Ne Te Ye Ve Yeo Ye Ve 


se Ne Se Ye Ne 


WNNNNNNWWWWWWNNNNNNNNNNNNWWWWWWWWBUWWWWWWNWNWWWNWWWwWW Www WwW ww ww 


IMGSOPEN_IMAGE - Open Next Image File 10-Apr-1989 10:48:52 _$25 
IF .RTVRLEN EQL 0 ! If the file is empty, 
THEN RETURN SS$_BADIMGHDR ! then return an error 
ELSE BUF_DESC [0] = .RTVRLEN; ! Otherwise, use correct buffer size 
ARG_LIST [1] = .CHAN; ! Store channel number in argument 1 
STATUS = SCMKRNL ( ! Allocate and initialize a window 
ROUTIN = INIT WINDOW, ! control block in kernel mode 


ARGLST = ARG LIST); 
IF NOT .STATUS 
THEN RETURN .STATUS; ! Exit if error detected 


! The image file name string passed as input will be stored internally a 
! passed back to the caller if so requested. The entire file specificati 
! (and not merely the file name portion) will also be stored in the ICB. 


NAME_BLOCK [NAM$B_RSL] = .NAME DESC [DSCSW_LENGTH] ; 


CHSMOVE ( 
-NAME_BLOCK [NAMS$B_RSL], ! Store the input file specification 
- NAME DESC {[DSCSA_] POINTER], ! in the name string buffer 


- NAME STRING) ; 


! Rather than storing the name in the ICB, this code segment will merely 
! set up the NAM block fields so that the code below that loads the imag 
! name into the ICB will work correctly. Note that ICBSS_ IMAGE NAME incl 
! one byte of count and four bytes of 00n suffix. These must be subtrac 
! before the minimization takes place. 


NAME_BLOCK [NAM$B_NAME] = MINU ( ! Only use the beginning of the stri 
"»NAME_| DESC [DSCSW_| LENGTH], ! dif the input file specification i 
ICB$S_IMAGE_NAME - (1+4)); ! longer than 39 characters 

NAME_BLOCK [NAMSL_NAME] = .NAME STRING; 

END; 

ICB [ICBSW_CHAN] = .CHAN; ! Store channel number in ICB 
ICB [ICBSL_ , KFE] = .FAB [FABSL_' CTX); ! Pick up address of KFE 


! If ICB does not yet contain an image name, load the name contained in the 
! NAM block. The name stored in the ICB will be the filename portion of the 
! full file spec, the same name that the linker uses when constructing the 
! names of global ISDs. 


IF .ICB_NAME [0] EQL 0 
THEN 
BEGIN 
ICB NAME [0] = .NAME_ BLOCK [NAM$B_NAME] ; 
CHSMOVE ( 
-ICB_NAME [0], 
-NAME_BLOCK [NAM$L_NAME], 
ICB_NAME [1]); 
END; 


! If activating an image across the network or from magtape, the file is 
! not mapped. Rather, the address space is created and the contents of the 
! image file are read directly into the newly created pages. 


IF (.DEV_CHAR [DEVS$V_NET] OR 


154 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 27 


X-14 


™e Ve Te Se Se Te Wa Ye Be Ve Ye Ve Be Ye Ne We 


Se “Se Re Se Ye Se Ye Ye Te Ve Be We Ye Ve Ne Ve We Se Ve Ve We Te Ve Be We Ve Ye Ye We Be 


™e Ye Ye Ne Se Ne Me 


=e Se Se Ne 


1529 
1530 
1531 
1532 
1533 
1534 
1535 
1536 
1537 
1538 
1539 
1540 
1541 
1542 
1543 
1544 
1545 
1546 
1547 
1548 
1549 
1550 
1551 
1552 
1553 
1554 
1555 
1556 
1557 
1558 
1559 
1560 
1561 
1562 
1563 
1564 
1565 
1566 
1567 
1568 
1569 
1570 
1571 
1572 
1573 
1574 
1575 
1576 
1577 
1578 
1579 
1580 
1581 
1582 
1583 
1584 
1585 


WWWWWWWWWWWW &P eh WWWWWWWWWWWWWWWWwWwwWwWwWwWWwwwvwwWwWwWwwdwwwnwwwnnnn w 


IMGSOPEN_IMAGE - Open Next Image File 10-Apr-1989 10:48:52 _$25 


(.DEV_CHAR [DEVSV_SQD] AND (.FAB [FABSW_BLS] EQL 512))) 
THEN ICB TICBSV_ LOAD ) IMAGE] = TRUE; 


IF .ICB [ICBSL_KFE] EQL 0 
THEN 
BEGIN 
IF (.IACSGL_IMAGCTX [IMAGCTX$V_PRIV]) THEN RETURN SS$_ PRIVINSTALL 
END 
ELSE 
BEGIN 


! Make sure that the count byte immediately precedes the name string 
SASSUME (($BYTEOFFSET (KFE$B_FILNAMLEN) ) 


EQLU 
(SBYTEOFFSET (KFEST_FILNAM) = 1)); 


BIND 
KFE NAME = KFE [KFES$T_FILNAM] - 1 : VECTOR [,BYTE], ! Include co 
CTX = “ICB {ICBSL _ CONTEXT] : $BBLOCK, 
GSD_NAME = CTX (CTX_T GSD NAME] : VECTOR [, BYTE); 


! Several bits of housekeeping are in order if this was a successful 
! SOPEN of a known file. 


IF .KFE [KFESV_PROCPRIV] AND .OWN STORAGE [MAIN PROGRAM] 
THEN IACSGL_ IMAGCTX { IMAGCTXSV_| PRIV) = TRUE; 


ICB [ICBSV_PROTECTED] = .KFE [KFE$V_PROTECT]; 


! Images installed with the /ACCOUNT qualifier can cause image accountin: 
! records to be written each time they are run as main programs. The 

! ACCOUNT flag is ignored for shareable images and images that are merge 
! into an existing image’s address space. 


IF .KFE [KFES$V_ACCOUNT] AND .OWN_STORAGE [MAIN_PROGRAM] 
THEN OWN_ STORAGE [IMAGE | ACCOUNT] = TRUE; 
' 
!Set things up for execute-only access (ECO 24) 
! 
IF .kfe[kfeSv_exeonly] AND .own_storage[main_ program] 
AND (.own_storage[call_mode] EQL PSLS$C_USER) 
THEN BEGIN 
iac$gl_imagetx [imagetx$v_priv] = true; 
iac$gl_imagctx [imagctx$v_exeonly] = true; 
END; 


RMS returned an expanded string. We will store the size of the image 
file in the RSL field in the NAM block. We will also strip off the 
trailing semicolon (or dot) that would inhibit further known file 
lookups if the file name returned by the image activator were to be 
passed back into the image activator at a later time. 


IF .NAME BLOCK [NAMSB_VER] EQL 1 
THEN NAME | BLOCK [NAMSB | RSL] = .NAME BLOCK [NAMSB ESL] - 1; 


IF .KFE [KFESV_SHARED] 


DIGITAL INTERNAL USE ONLY 155 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 28 
X-14 


1586 
1587 
1588 
1589 
1590 
1591 
1592 
1593 
1594 
1595 
1596 
1597 
1598 
1599 
1600 
1601 
1602 
1603 
1604 
1605 
1606 
1607 
1608 
1609 
1610 
1611 
1612 
1613 
1614 
1615 
1616 
1617 
1618 
1619 
1620 
1621 
1622 
1623 
1624 


™e Te Ye Ye Yo Ne Ye Yo Ve Ye Ve Yo Ve Be Vo Yeo Ye Yeo Ve Ye Ne Ye Ye Yo Ye Ye Yo we Ye Ye Re Ve Bo We Ve 


PNNNN LS LHLHHHLBwHPeOeWWWWWNWNHNN WWW WWWhe BH HoH De oW 


we Ne Me Ne 


0000000 00000002 00000 P.AAA: .LONG 2, 0 
00000000 00008 -LONG 0 
30 30 30 SF 0000C P.AAB: .ASCII \_000\ 


IMGSOPEN_IMAGE ~ Open Next Image File 10-Apr-1989 10:48:52 _$25 


THEN 
BEGIN 
CHSMOVE ( 
(.KFE (KFESB_FILNAMLEN] + 1), 
KFE NAME [0], 
GSD_NAME [0]); 
CHSMOVE ( 
4, 
CHSPTR (UPLIT (’ 000’)), 
GSD_NAME [.KFE [KFES$B_FILNAMLEN] + 1]); 
ICB [ICB$V_SHAREABLE] = TRUE; 
END; 


!!! SOME MORE KFE FLAGS SHOULD BE COPIED INTO THE ICB 


!!! THE CURRENT CODE WORRIES ABOUT THIS SHMIDENT STUFF 


END; 
IF ( (.own_storage[fab fac) AND FABSM_EXE) NEQ 0) AND tif execute access a 
( (.own_storage[fab fac] AND FABS$M_GET) EQL 0) {Ino read access 
THEN 
BEGIN 
IF .own_storage [main program) !Is it a main program? 
THEN 
iac$gl_imagctx[imagetx$v_priv] = true !set the paranoia bit 
ELSE 
BEGIN 
IF .iac$gl_imagctx[imagctx$v_exeonly] !Installed execute only? 
THEN 
RETURN SS$_NORMAL !yes 
ELSE 
RETURN SS$_ACCONFLICT Ino 
END 
END; 


RETURN SS$_NORMAL; 


END; ! End of routine IMGSOPEN_IMAGE 


-PSECT EXECS$PAGED_DATA, PIC,2 


me Ye 


=e 


-EXTRN SYSSOPEN, SYSS$CMKRNL 
-PSECT EXECSPAGED CODE,NOWRT, PIC,2 


OFFC 00000 -ENTRY IMGSOPEN_IMAGE, Save R2,R3,R4,R5,R6,R7,R8,- 
3 1303 
R9,R10,R11 ; 
00000000G 00 9E 00002 MOVAB OWN _STORAGE, R11 : 
F9EO CE 9E 00009 MOVAB ~1568(SP), SP ; 
oc AC 7D OOOO0E MOVQ FAB_ADDRESS, R6 3 1331 


156 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5~862 Page 29 
X-14 


18 Ac 

14 A8 

04 ac 
00G 

oocs 

00 

66 

5003 SF 
40060040 8F 
02 

01 

02 

57 

04 AQ 

08 Ac 

04 AO 

04 BC 

60 

64 AB 

02 

16 A6 

81 8F 

43 8F 

0B 

16 A6 

80 8F 

17 A6 

o1 
03 
02 
01 
03 
03 
50 
00 
67 
8F 
01 
14 ac 
10 

01 

04 A7 
56 

01 

40 AB 
OB 

00 

04 

56 

50 

69 

0086 

0200 8F 
FEOO cD 
oc 

10 AE 
10 AE 


6002 


IMGSOPEN_IMAGE - Open Next Image File 


DO 
9E 
DO 
EO 
31 
2c 


BO 
DO 
90 
8E 
90 
DO 
DO 
DO 
DO 
90 
90 
FO 
El 
9E 
90 
90 
11 
9E 
90 
94 
EO 
EO 
El 
DO 
11 
DO 
FO 
2c 


BO. 


8E 
DO 
90 
8E 
DO 
DD 
FB 
DO 
13 
oD 
13 
DO 
E9 
90 
31 
3c 
9E 
28 
9E 
oF 


00012 
00016 
OO01A 
OOO01E 
00026 
00029 
00030 
00031 
00036 
0003E 
00042 
00046 
0004A 
0004E 
00053 
00057 
0005¢c 
00061 
00065 
0006c 
00071 
00075 
00079 
OOO7E 
00080 
00084 
00088 
0008B 
00093 
00098 
0009D 
OOOAO 
000A2 
OO00A5 
OOOAB 
000B2 
0O00B3 
O0O0OB8 
0o00BC 
000c1 
000c5 
000c9 
000CE 
000D0 
000D7 
OOODB 
OOODD 
O000E2 
O00E4 
O00E8 
OOOEB 
OOOEF 
OOOF2 
O0OF8 
OOOFE 
00105 
0010A 


18: 


28: 


38: 


4s: 


5$: 
6$: 


78: 


8S: 


MOVL 


MOVAB . 


MOVL 
BBS 
BRW 
MOVC5 


MOVW 
MOVL 
MOVB 


MNEGB 
MOVL 
PUSHL 
CALLS 
MOVL 
BEQL 
PROBEW 
BEQL 
MOVL 
BLBC 
MOVB 
BRW 
MOVZWL 
MOVAB 
MOVC3 
MOVAB 
PUSHAB 


ICB_ POINTER, R8 

20 (R8), R10 

NAME DESC, R9 

S*EXESV_INIT, EXES$GL FLAGS, 1$ 
8$ 
#0, (SP), #0, #80, (R6) 
#20483, (R6) 
#1074135104, 4(R6) 
#2, 22(R6) 

#1, 28(R6) 

#2, 31(R6) 

R7, 40(R6) 

4(R9), 44(R6) 
DFLT_DESC, RO 

4(RO), 48(R6) 

@NAME DESC, 52 (R6) 
(RO), 53(R6) 

OWN _STORAGE+100, #2, 
#2, 16(R8), 2$ 
22(R6), RO 

#-127, (R9) 

#67, 23(R6) 

3$ 

22 (R6), R9 

#~-128, (R9) 

23 (R6) 

#1, IACS$GL_IMAGCTX, 48 
#3, 17(R8), 4S 

#2, 17(R8), 5$ 

#1, RO 

6$ 
#3, 
RO, 
#0, 


#2, 74(R6) 


RO 
#0, #2, 
(SP), #0, 


74 (R6) 
#96, (R7) 
#24578, (R7) 

#1, 2(R7) 

NAME STRING, 4(R7) 

#16, 8(R7) 

#1, 10(R7) 

4(R7), 12(R7) 

R6 

#1, SYSSOPEN 

OWN STORAGE+64, R1 

7§ 
#0, 
7§ 
R6, 8(R1) 

STATUS, 11$ 

(R9), OWN STORAGE+37 
14$ 

#512, BUF_DESC 
RTVRBUF, BUF_DESC+4 
#12, P.AAA, ARG LIST 
BUF_DESC, ARG LIST+8 
BUF_DESC 


#4, 8(R1) 


DIGITAL INTERNAL USE ONLY 157 


10-Apr-1989 10:48:52 


~e Te Ve Ye Ye Veo Ve Ye Ve Yeo 


™e Se Se Ye Yo Ye Ye 


=e Ye Ye Ve Be Be Ye 


=e Ne 


=e 


Sy i. i i en) ee eT ee) ee) eT | 


=e Ve 


™e Ne Se Se Be Be We Be Ze Ze We We Ne We We 


ee Se Ne 


_$25 


1332 
1334 
1372 
1354 


1372 


1374 
1379 
1382 
1383 
1387 


1388 
1397 


1398 
1399 


1400 


1396 
1413 


1415 
1420 
1427 
1429 
1435 
1436 
1452 
1456 


1465 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 30 


X-14 
04 
20 
2c 
0230 
04 
oc 


44 


oc 
04 
o000V 


04 
03 


04 


14 
oc 
18 


3B 


3c 


54 


2054 


18 


10 


158 DIGITAL INTERNAL USE ONLY 


3ogeeotn oR ham 


IMGSOPEN_ IMAGE - Open Next Image File 


oF 
oF 
oF 
oF 
DD 
oF 
FB 
E9 
D1 
14 
D5 
12 
9A 
04 
DO 
DO 
oF 
oF 
FB 
E8 
04 
90 
9A 
28 
3c 
Bl 
1B 
DO 
90 
DO 
BO 
DO 
95 
12 
90 
9A 
28 
EO 
El 
Bl 
12 
88 
D5 
12 
El 
3c 
04 
DO 
Cl 
9E 
El 
E9 
88 
FO 
El 
E9 
88 


0010D 
00110 
00113 
00116 
0011A 
0011D 
00120 
00127 
0012A 
0012E 
00130 
00132 
00134 
00138 
00139 
0013D 
00142 
00145 
00149 
00150 
00153 
00154 
00159 
0015D 
00163 
00167 
0016A 
0016C 
OO16F 
00173 
00178 
0017D 
00182 
00184 
00186 
0018A 
0018D 
00193 
00198 
0019D 
001A3 
001A5 
OO1A9 
001AC 
OO1AE 
001B6 
001BB 
001BC 
001C0 
001C5 
oo01c9 
oo1cD 
001D0 
001D7 
001DD 
OO1E1 
O01E4 


10$ 


11$ 


12$ 


13$ 


14$ 


15$ 


168: 
178: 


18$ 


19$ 


PUSHAB 
PUSHAB 
PUSHAB 
PUSHAB 
PUSHL 
PUSHAB 
CALLS 
BLBC 
CMPL 
BGTR 
TSTL 
BNEQ 
MOVZBL 
RET 
MOVL 
MOVL 
PUSHAB 
PUSHAB 
CALLS 
BLBS 
RET 
MOVB 
MOVZBL 
MOVC3 
MOVZWL 
CMPW 
BLEQU 
MOVL 
MOVB 


RTVRLEN 
STATBLK 

FILHDR 

IXFHDR 

NAME_DESC 

12 (R6) 

#7, FILSOPENFILE 
STATUS, 11$ 
RTVRLEN, BUF DESC 
9$ = 
RTVRLEN 

10$ 

#68, RO 


RTVRLEN, BUF_DESC 
12(R6), ARG LIST+4 
ARG_LIST 
INIT_WINDOW 

#2, SYSSCMKRNL 
STATUS, 12$ 


@NAME_DESC, 3(R7) 
3(R7), RO 

RO, @4(R9), @NAME_STRING 
@NAME_DESC, RO 

RO, #35 

13$ 

#35, RO 

RO, 59(R7) 
NAME_STRING, 76(R7) 
12(R6), 14(R8) 
24(R6), 84(R8) 


(R10) 

15$ 

59(R7), (R10) 
(R10), RO 


RO, @76(R7), 1(R10) 

#5, 65(R6), 16$ 

#5, 64(R6), 178 

60(R6), #512 

17$ 

#16, 16(R8) 

84 (R8) 

18$ 

#1, IACS$GL_IMAGCTX, 23$ 
#8276, RO 


24(R6), RO 

#20, 88(R8), RE 
16(RO), R1 

#2, (R1), 19$ 

OWN STORAGE, 19$ 

#2, IAC$GL_IMAGCTX 
(R1), #2, #1, 17(R8) 
#9, (R1), 20$ 

OWN STORAGE, 20$ 
#4, OWN STORAGE 


10-Apr-1989 10:48:52 


=e Ve Se Te Te Ws VO Ye Ye Yeo Ys Be 


=e Se “Ye 


=e Te te Se Ye Ye Se Te Ye 


Se Ne Ne te Ye 


™e Ye Ne Te Ye Ye Se Ye Ve Te Be Yo Toe Ve Ne Ye Ye Be Ye Ve 


Re Ne Se Ne Ne Se Se Ne 


_$25 


1464 
1463 
1462 
1461 


1459 
1458 
1466 
1469 


1472 
1473 
1474 
1476 
1479 
1480 
1487 
1489 


1488 
1501 


1502 
1506 


. 1507 


1514 


1517 
1519 
1521 
1528 
1529 


1530 
1532 
1535 
1547 


1549 
1554 


1555 
1557 
1564 


1565 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 31 
X~14 


0B 

6B 

24 AB 
O07 

03 

3D A7 
06 

01 

05 

36 AO 
57 

57 

- 6746 
0000’ CF 
02 

25 AB 
50 

1D 

01 

6B 

02 

oD 
00000000G 00 
0800 8F 


01 


3 Routine Size: 


; 1625 1 


IMGSOPEN_IMAGE - Open Next Image File 


El 
E9 
91 
12 
88 
91 
12 
83 
El 
9A 
D6 
28 
oF 
DO 
88 
9A 
95 
18 
EO 
E9 
88 
11 
E8 
3c 
04 
DO 
04 


O01E7 
O0O1EB 
OO1EE 
001F2 
Oo1F4 
001FB 
OO1FF 
00201 
00207 
0020B 
0020F 
00211 
00216 
00219 
0021E 
00222 
00226 
00228 
0022A 
0022E 
00231 
00238 
0023A 
00241 
00246 
00247 
0024A 


20$ 


21$ 


22s 


23$ 


24$ 


25$ 


587 bytes, 


BBC 
BLBC 
CMPB 
BNEQ 
BISB2 
CMPB 
BNEQ 
SUBB3 
BBC 
MOVZBL 
INCL 
MOvCc3 
PUSHAB 
MOVL 
BISB2 
MOVZBL 
TSTB 
BGEQ 
BBS 
BLBC 
BISB2 
BRB 
BLBS 
MOVZWL 
RET 
MOVL 
RET 


_ Routine Base: 


#11, (R1), 21$ 

OWN STORAGE, 21$ 
OWN STORAGE+36, #3 
218 

#3, IACS$GL_IMAGCTX 
61(R7), #1 

22$ 

#1, 11(R7), 3(R7) 
#5, (R1), 23$ 
54(RO), R7 
R7 

R7, 54(RO), 
(R7) [R6] 
P.AAB, @(SP)+ 

#2, 16(R8) 

OWN STORAGE+37, RO 
RO 

258 

#1, RO, 25$ 

OWN STORAGE, 24$ 
#2, IACS$GL_IMAGCTX 
25$ 

IAC$GL_IMAGCTX, 25$ 
#2048, RO 


(R6) 


#1, RO 


EXECSPAGED_CODE + 0O2EA 


DIGITAL INTERNAL USE ONLY 159 


10-Apr-1989 10:48:52 


we Ve Se Se Ye Ne Ye Ve Se Ye Ye Seo Ne Ye Ne Se Ne Ye Yeo Ne Ye Yeo Yo Ve Ne Xe Ye 


_$25 
1569 


1570 


1572 
1582 


1583 
1585 
1589 


1588 
1594 


1596 
1605 


1606 
1609 
1611 


1614 
1618 


1622 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss-~ 


32 V4.5-862 Page 32 


X~14 


1627 
1628 
1629 
1630 
1631 
1632 
1633 
1634 
1635 
1636 
1637 
1638 
1639 
1640 
1641 
1642 
1643 
1644 
1645 
1646 
1647 
1648 
1649 
1650 
1651 
1652 
1653 
1654 
1655 
1656 
1657 
1658 
1659 
1660 
1661 
1662 
1663 
1664 
1665 
1666 
1667 
1668 
1669 
1670 
1671 
1672 
1673 
1674 
1675 


me Ne Ne Ye Ve Ne Ve Ys Ve Te Yeo Ye Ne Ve Be Ve Yo Be Ne Ye Yo No Vo 


me Se te Se Te Ne Ye Ye Se Ye Se Ye Ye Ne Ne 


we 


=e Te 


we Ne Yeo Te Ve Ve Ve Se 


7¢ 


KMPNUNNNNNNNHNNNNNNNNNNNNNNNHNNAN LEEK ERP RP BP eB eee eee eee oe ee 


A4 


INIT WINDOW - Interface Routine to FILSINIWCB 10-Apr-1989 10:48:52 _825 
%SBTTL ‘INIT WINDOW - Interface Routine to FILSINIWCB’ 


ROUTINE INIT WINDOW (CHANNEL, BUFFER_DESC) : SYS_CMKRNL = 


+ 


Functional Description: 
This routine acts as a jacket to the routine called FIL$INIWCB, which 
allocates a window control block in the absence of a complete file 
system. 

Calling Sequence: 
SCMKRNL (INIT WINDOW, ARGUMENT LIST) 

Formal Parameters: 


CHANNEL - Address of channel on which image file is opened 


BUFFER_DESC - Address of descriptor of retrieval pointer buffer 


cum cam com Cam com cum com cme cam cam Cam sem cab Sem cm cam com 


BEGIN 
BUILTIN 
ADAWI; ! Interlocked add 
EXTERNAL REGISTER ! We enter this procedure with the P 
PCB = 4 : REF SBBLOCK; { address contained in R4 
BIND 
JIB = .PCB (PCBSL_JIB] : $BBLOCK, 
BUF_DSC = .BUFFER_DESC : VECTOR [2]; 
LOCAL 
STATUS, 
CCB : REF SBBLOCK, 
WCB; 


STATUS = IOCSVERIFYCHAN (.CHANNEL; CCB) ; 

IF NOT .STATUS THEN RETURN .STATUS; 

STATUS = FILS$INIWCB (.BUF_DSC [0], .BUF_DSC [1], .CCB [CCB$L_UCB]; WCB); 
IF NOT .STATUS THEN RETURN .STATUS; 

CCB [CCBSL_WIND] = .WCB; 

CCB [CCB$B_AMOD) = PSLS$C_USER + 1; 

ADAWI ( %REF(-1), JIB[JIB$W_FILCNT] ); 

RETURN SS$_ NORMAL 


END; 


OOEC 00000 INIT WINDOW: 


-WORD Save R2,R3,R5,R6,R7 
DO 00002 MOVL 124 (PCB), R7 


1629 
1658 


160 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 33 


X-14 INIT WINDOW - Interface Routine to FILSINIWCB 10-Apr-1989 10:48:52 
08 AC pO 00006 MOVL BUFFER DESC, R6 ; 
04 AC DO OOOOA MOVL CHANNEL, RO ; 
00000000G 00 16 OOO00E JSB ‘IOCSVERIFYCHAN ; 
51 pO 00014 MOVL R1, R5 ; 
50 E9 00017 BLBC STATUS, 1$ ; 
65 DO 0001A MOVL (CCB), R3 ; 
66 7D 0001D MOVQ (R6), Rl ; 
00000000G 00 16 00020 JSB FILSINIWCB ; 
50 E9 00026 BLBC STATUS, 1$ ; 
52 DO 00029 MOVL WCB, 4(CCB) ; 
04 90 0002D MOVB #4, 9(CCB) ; 
FFFF 8F 58 00031 ADAWI #~-1, 48(R7) ? 
01 pO 00037 MOVL #1, RO ; 
04 0003A 15S: RET ; 


? Routine Size: 59 bytes, Routine Base: EXECSPAGED_CODE + 0535 


DIGITAL INTERNAL USE ONLY 161 


_$25 


1659 
1666 


1667 
1668 


1669 
1670 
1671 
1672 
1673 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 34 


X-14 


1677 
1678 
1679 
1680 
1681 
1682 
1683 
1684 
1685 
1686 
1687 
1688 
1689 
1690 
1691 
1692 
1693 
1694 
1695 
1696 
1697 
1698 
1699 
1700 
1701 
1702 
1703 
1704 
1705 
1706 
1707 
1708 
1709 
1710 
1711 
1712 
1713 
1714 
1715 
1716 
1717 
1718 
1719 
1720 
1721 
1722 
1723 
1724 
1725 
1726 
1727 
1728 
1729 
1730 
1731 
1732 
1733 


we Ye Ne Ye Be Ve Ve Ve Be Ye We Be Be Be Ve Ye We Be VWs Ye We 


=e 


™e Me Me Ne Be Ve Ve Ve Ve Ve Ze Ve Ye Ve Ve We Ve Ve Ve Ve Yo Ye Ye We Yo Be No 


Se Te Ve Se Be We 


ze Ne 


WWWWWWWWWWWWWWWWWWnNWWWWWnNNDNDNNNNNNNN FKP RPE RRP RP RE PRP RP PP Pe eee ee 


IMGS$GET_HEADER ~ Get Parameters from Image Head 10-Apr-1989 10:48:52 _$25 
SSBITL 'IMGS$GET_HEADER - Get Parameters from Image Header’ 


GLOBAL ROUTINE IMGSGET_HEADER (ICB ADDRESS) = 


! Functional Description: 


This routine is a jacket routine that handler two kinds of image header 
If an image was installed header resident, then there is no need to dec 
the header or verify its contents. Other images must have their headers 
read into memory before the decode and verification can occur. 


! Calling Sequence: 
IMGSGET_HEADER (ICB_ ADDRESS) 
! Formal Parameter: 


! 
! 
! 
! 
! 
! 
! 
' 
! 
! 
t 
! 
! 
' 
! ICB_ADDRESS - Address of image control block that describes the image 
! “that is currently being activated. 

t 


BEGIN 


BIND 
ICB_ADR = .ICB_ADDRESS : $BBLOCK, 
KFE = .ICB_ADR [ICB$L_KFE] : $BBLOCK, 
IHD CTX = .ICB_ADR [ICB$L_CONTEXT] : $BBLOCK; 


LOCAL 
STATUS; 


IF 
BEGIN 
IF KFE EQL 0 
THEN TRUE 
ELSE NOT .KFE [KFES$V_HDRRES] 
END 
THEN 
BEGIN 


STATUS = IMGSDECODE_IHD ( 
.ICB_ADR [ICB$W_CHAN], 
.IHD_ CTX [CTX_L BUFFER}, 
~IHD_CTX [CTX _L IHDBUF], 
IHD CTX [CTX_L VEN], 

IHD CTX [CTX _W_ISD OFFSET], 
IHD CTX [CTX_W GENERATION], 
IHD CTX [CTX_W_ALIAS}); 


IF NOT .STATUS THEN RETURN .STATUS; 
! Images that contain an alias of either IHDSC_RSX or IHDS$C_BPA are not 
! native images produced by the linker and, as a result, do not require 


! a check against the system version field. 


IF 


162 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 35 


X-14 


we Ve Te Ve Ne Be Ye Ve Ve Ye Ye Ve Ye Yo 


0 Te Te Me Ne Me Ne Me Ne Re Ye Ye Ne Ye Se Se Se Yeo Se Te Be Ve Ne Ye Se Ve Ve Ve Ve Ne Te Ve Teo Se Ye Ve Ye Ve Ve Vo Ve Vs Ve 


1734 
1735 
1736 
1737 
1738 
1739 
1740 
1741 
1742 
1743 
1744 
1745 
1746 
1747 
1748 
1749 
1750 
1751 
1752 
1753 
1754 
1755 
1756 
1757 
1758 
1759 
1760 
1761 
1762 
1763 
1764 
1765 
1766 
1767 
1768 
1769 
1770 
1771 
1772 
1773 
1774 
1775 
1776 
1777 
1778 
1779 
1780 
1781 
1782 
1783 
1784 
1785 
1786 
1787 
1788 
1789 
1790 


AQuanbhh LHe dH_LP UYU a OH HHP HUH IATA UA NGL UH d_ Hh Hb Hh Hh AHL ALdH Heb de Hh woh LW LWW HP 


IMGS$GET_HEADER - Get Parameters from Image Head 10-Apr-1989 10:48:52 _$25 


(.IHD_ CTX [CTX_W_ALIAS] NEQ IHD$C_RSX) 
AND 

(.IHD_CTX [CTX_W_ALIAS] NEQ IHD$C_BPA) 
AND 

(.IHD_CTX [CTX_W_ALIAS] NEQ IHD$C_ALIAS) 


THEN 


BEGIN 


BIND 
IHD = .IHD CTX [CTX_L_IHDBUF] : $BBLOCK, 
MINORID_| DIGIT = IHD (THDS$W_! MINORID] : VECTOR [2,BYTE], 
IHA = IHD + .IHD [ IHDSW_: ACTIVOFF] : VECTOR [5]; 


! MINORID DIGIT [0] maps the tens digit. 
! MINORID DIGIT [1] maps the units digit. 


LITERAL 
MINOR_ID TENS = IHDS$K_MINORID AND %X’FF’, 
MINOR _ ID _' ONES = IHDSK | MINORID “ <8; 


The major ID in the image header must be identically equal to 
the constant IHDSK_MAJORID. The minor ID in the image header 
must be LEQU the constant IHDSK_MINORID. Both IDs are stored 
as ASCII strings. 


a ee er | 


IF (.IHD [IHD$W_MAJORID] NEQU IHDS$K_MAJORID) 
THEN RETURN SS$_BADIMGHDR; 


IF ( | 
(.MINORID_DIGIT [0] GTRU MINOR_ID_ TENS) 
OR 
( 
(.MINORID_DIGIT [0] EQLU MINOR_ID_TENS) 
AND 
(.MINORID_ DIGIT (1) GTRU MINOR_ID_ ONES) 
) é 
) 
THEN RETURN SS$_BADIMGHDR; 


! Check match control data for shareable images that are being 
! activated because of global ISD references. 


IF .ICB_ADR [ICB$B_ACT_CODE] EQLU ICB$K_GLOBAL_IMAGE_SECTION 
THEN 

BEGIN 

STATUS = CHECK MATCH CONTROL (ICB_ADR, IHD); 

IF NOT .STATUS THEN RETURN .STATUS; 

END; 


! We must record whether we are activating a shareable image with an 
! initialization section. 


IF .IHD [IHDS$V_INISHR] 

THEN 
BEGIN 
ICB_ADR [ICBSL_INITIALIZE] = .IHA [4]; 
ICB ADR [ICBSV__ INITIALIZE] = TRUE; 


DIGITAL INTERNAL USE ONLY 163 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 36 


X-14 


1791 
1792 
1793 
1794 
1795 
1796 
1797 
1798 
1799 
1800 
1801 
1802 
1803 
1804 
1805 
1806 
1807 
1808 
1809 
1810 
1811 
1812 
1813 
1814 
1815 
1816 
1817 
1818 
1819 
1820 
1821 
1822 
1823 
1824 
1825 
1826 
1827 
1828 
1829 
1830 
1831 
1832 
1833 
1834 
1835 
1836 
1837 
1838 
1839 
1840 
1841 
1842 
1843 
1844 
1845 
1846 
1847 


Re Ne Ne te Ne Se Se Se Me Se Se Ue Se Ne te Se Se Me Ne Ne Se Se te Se Ye Se Seo Ye Se Te Ye Se Ye Ye Se Ye Ye Yeo Ye Se Ne Ne Ne Ne Ye Se Se te te Ye “Se Ne Ne Se Se Ne NO 


SHE BWWWWWWU PH WWWWWWWWWWWwWwWNWNWWUn WW db db oe SS Hd kde ee a HK Ho Hd HH KHL oY 


IMGSGET_HEADER - Get Parameters from Image Head 10-Apr-1989 10:48:52 _$25 
IACS$GL_IMAGCTX [IMAGCTX$V_INITIALIZE] = TRUE; 
END; 


! EXESCHECK_VERSION is the routine used by the various loading 
! mechanisms to check for version mismatches. 
! Status values returned are NORMAL, BADIMGHDR, and SYSVERDIF. 


STATUS = EXESCHECK_VERSION (IHD) ; 


The following piece of code here for historical purpose only: prior to 
VMS V5.1, system version mismatch was treated as an alternate success 
and the image is activated with privileges removed. This is causing more 
harm than good (i.e. it breaks the version checking scheme), so it is 
removed (i.e. image activation will fail if there is a version mismatch) . 


IF (.STATUS AND STS$M_CODE) EQL (SS$_SYSVERDIF AND STS$M_CODE) 
THEN 

BEGIN 

OWN STORAGE [REMOVE PRIVILEGE] = TRUE; 

STATUS = Ss$ _SYSVERDIF; 


om ccm com cub sam cam cam cam Cam cmb com cam cmb cam 


END; 

END; 

END 

ELSE ! Header is already resident 

BEGIN 

BIND 
IHD = .KFE [KFESL_IMGHDR] : $BBLOCK, 
KFRH = IHD - KFRHSK_LENGTH : $BBLOCK, 


THA = IHD + .IHD [IHD$W_ACTIVOFF] : VECTOR [5]; 


ICB_ADR [ICBSV_RES HEADER] = TRUE; ! Indicate that header is already in 
ICB_ADR [ICBSL_IHD] = IHD; ! Remember the address of the reside 
IHD_CTX [CTX_L_IHDBUF] = 0; ! Clear this so it won’t get used by 
IHD CTX [CTX_| W_ ISD_OFFSET] = .IHD [IHDSW_SIZE]; 

IHD CTX [CTX | WwW | GENERATION] = .KFRH [KFRHSB | HDRVER] ; 

IHD CTX [CTX _W ALIAS] = .KFRH [KFRHS$W ALIAS]; 


IF .ICB_ADR [ICBS$B_ACT_CODE] EQLU ICB$K_GLOBAL_IMAGE_SECTION 
THEN 

BEGIN 

STATUS = CHECK MATCH _CONTROL (ICB_ADR, IHD); 

IF NOT .STATUS THEN RETURN .STATUS; 

END; 


! We must record whether we are activating a shareable image with an 
! initialization section. 


IF .IHD [IHD$V_INISHR] 

THEN 
BEGIN 
ICB_ADR [ICB$L_INITIALIZE] = .IHA [4]; 
ICB_ADR [ICB$V_INITIALIZE] = TRUE; 
IACSGL_IMAGCTX [IMAGCTX$V_INITIALIZE] = TRUE; 


164 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 37 


X~14 


™e Ye Ve Ye Ve Yo %e 


1848 
1849 
1850 
1851 
1852 
1853 
1854 


04 


58 


OE 
10 
oc 
08 


OE 


OE 


04 
OE 
02 


oc 


01 


44 


OD 


10 


KMBNNN WW Ww 


IMG$GET HEADER - Get Parameters from Image Head 10-Apr-1989 10:48:52 


RETURN .STATUS; 


END; 


STATUS = SS$_ NORMAL; 


END; 


END; 


003C 
DO 
DO 
DO 
DS 


El 
31 
oF 
oF 
oF 
oF 
7D 
3c 
FB 
E9 
32 
13 
Bl 
13 
Bl 
12 
04 
DO 
9E 
3c 
cl 
Bl 


91 
1A 
12 
91 
1B 
9A 
04 
91 
12 
DD 
DD 
FB 
E9 
El 
DO 
88 


00000 
00002 
00006 
OOO0A 
O000E 
00010 
00012 
00017 
OOO1A 
0001D 
00020 
00023 
00026 
00029 
0002D 
00034 
00037 
0003B 
0003D 
00040 
00042 
00045 
00047 
00048 
0004C 
00050 
00054 
00058 
OOOSE 
00060 
00063 
00065 
00067 
0006B 
0006D 
00071 
00072 
00076 
00078 
OOO7A 
0007C 
00081 
00084 
60089 
O008E 


18: 


2$: 


38; 


48: 


58: 


6S: 
78:3 


- ENTRY 
MOVL 
MOVL 


TSTL 
BEQL 
BBC 
BRW 
PUSHAB 
PUSHAB 
PUSHAB 
PUSHAB 
MOVO 
MOVZWL 
CALLS 
BLBC 
CVTWL 
BEQL 
CMPW 
BEQL 
CMPW 
BNEQ 
RET 


MOVAB 
MOVZWL 
ADDL3 
CMPW 
BNEQ 
CMPB 
BGTRU 
BNEQ 
CMPB 
BLEQU 
MOVZBL 
RET 
CMPB 
BNEQ 
PUSHL 
PUSHL 
CALLS 
BLBC 
BBC 
MOVL 
BISB2 


IMGS$GET_HEADER, Save R2,R3,R4,R5 
ICB_ADDRESS, R4 
84(R4), RO 
88(R4), R2 

RO 

1$ 

#4, 16(RO), 1$ 
9$ 

14 (R2) 

16 (R2) 

12 (R2) 

8 (R2) 

(k2), -(SP) 
14(R4), ~(SP) 
#7, IMGSDECODE_IHD 
STATUS, 6$ 
14(R2), Rl 

2s 

Rl, #1 

2$ 

Rl, #2 

3$ 


4(R2), R3 
14(R3), R1 
2(R3), RS 
R5, R3, R2 
12(R3), #12848 
4$ 

(R1), #48 
4s 

5$ 

1(R1), #53 
5$ 

#68, RO 


13(R4), #3 

7$ 

R3 

R4 

#2, CHECK MATCH CONTROL 
STATUS, 12S 

#6, 32(R3), 8S 

16(R2), 96(R4) 

#32, 16(R4) 


DIGITAL INTERNAL USE ONLY 165 


“e “Ne Se Te Te Ye Ye Se Te Yo Ne Te Ys 


=e Ye Ne 


we Se Re Xe Ve Te Ye Ve Ve Ve Se Ye Yo Se Te Se Se “Ne Ye Ye Ye Yeo Ne 


@e Se Ve Ne Ne Ne 


_$25 


1679 
1702 
1703 
1704 
1711 


1713 
1725 
1724 
1723 
1722 
1718 
1719 


1727 
1734 


1736 
1738 
1742 
1744 
1745 
1759 
1763 


1766 
1768 


1771 
1776 
1779 
1780 
1786 


1789 
1790 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 38 


X-14 


1c 
F4 
02 


04 
OB 


04 
OD 


10 


3; Routine Size: 


02 
53 
01 


AO 
A3 
A3 
50 
08 
53 
A2 
63 
Al 
Al 
A4 
oc 
53 
54 
02 
50 
06 
A5 
20 
02 
ol 


IMGSGET_ HEADER - Get. Parameters from Image Head 10-Apr-1989 10:48:52 


88 
DD 
FB 
04 
DO 
9E 
3c 
cl 
88 
DO 
D4 
BO 
9B 
BO 
91 
12 
DD 
DD 
FB 
E9 
El 
DO 
88 
88 
DO 
04 


00092 
00099 8S: 
0009B 
OO0A2 
OO0OA3 98S: 
OO0A7 
OOOAB 
OOOAF 
OOOB3 
000B7 
000BB 
OOOBE 
000C2 
000C7 
oo0occ 
000DO 
000D2 
OO00D4 
OOOD6 
OOODB 
OOODE 108: 
OO0O0E3 
OOOES8 
OOOEC 
OOOF3 118: 
OOOF6 128: 


247 bytes, 


166 DIGITAL INTERNAL USE ONLY 


BISB2 
PUSHL 
CALLS 
RET 
MOVL 
MOVAB 
MOVZWL 
ADDL3 
BISB2 
MOVL 
CLRL 
MOVW 
MOVZBW 
MOVW 
CMPB 
BNEQ 
PUSHL 
PUSHL 
CALLS 
BLBC 
BBC 
MOVL 
BISB2 
BISB2 
MOVL 
RET 


#2, IACS$GL_IMAGCTX+2 
R3 
#1, EXESCHECK_VERSION 


28(RO), R3 
~12(R3), Rl 
2(R3), RO 

RO, R3, RS 

#8, 16(R4) 

R3, 80(R4) 
4(R2) 

(R3), 12(R2) 
11(R1), 16(R2) 
4(R1), 14(R2) 
13(R4), #3 

10$ 

R3 

R4 

#2, CHECK_MATCH CONTROL 
STATUS, 12$ 

#6, 32(R3), 118 
16(R5), 96(R4) 
#32, 16(R4) 

#2, IACSGL_IMAGCTX+2 
#1, STATUS 


Routine Base: EXECSPAGED CODE + 0570 


=e ‘Se Ye 


~e Me Me Ve Ve Ve Me Ve Ye Ye We 


me “e Te te Te Ye Ve Ye Ye Ye Ve Ve 


_ $25 


1791 
1798 


1821 
1822 
1823 


1825 
1826 
1827 
1828 
1829 
1830 
1832 


1835 


1836 
1842 
1845 
1846 
1847 
1850 
1852 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYS$IMGACT SYSIMGACT ~ Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5~862 Page 39 


X-14 


me Ye Te Se Ne Ne Te Ve Te Ve Vo Ve We Ve Ye Ye Ve 


™e Se Ne Me Ye Ne Se Ye Ne Ne Ne Ne Me Me Te Me Me Ye Ye Ve Te Te Ve Yo Ve Ve Ye Se Yeo Te Se We Ye Ne Te Ne Ye Yo Ne Ve 


1856 
1857 
1858 
1859 
1860 
1861 
1862 
1863 
1864 
1865 
1866 
1867 
1868 
1869 
1870 
1871 
1872 
1873 
1874 
1875 
1876 
1877 
1878 
1879 
1880 
1881 
1882 
1883 
1884 
1885 
1886 
1887 
1888 
1889 
1890 
1891 
1892 
1893 
1894 
1895 
1896 
1897 
1898 
1899 
1900 
1901 
1902 
1903 
1904 
1905 
1906 
1907 
1908 
1909 
1910 
1911 
1912 


NNNNONNNNNNNNNNNNNEP PEP HP EP EP BP BP EP BP BP BP EP EP BE BP PP Be Pe BP EPP BE PERE PEP Eee 


CHECK _MATCH CONTROL - Check Match Control Ident 10-Apr-1989 10:48:52 _$25 
%SSBTTL ‘CHECK_MATCH CONTROL - Check Match Control Identification’ 


ROUTINE CHECK_MATCH CONTROL (ICB, IHD ) = 


1+ 


1. 


ee ee re et re ae ee ec er 


BEGIN 


MACRO 


Functional Description: 


This routine checks that the match control information in the image hea 
is consistent with the match control information that is actually being 
requested. The check is made in three steps. 


The match control flag that is being requested must be at least as 
restrictive as the match control flag in the image header. 


If the resultant match control is MATCH ALWAYS, no further checks a 
made. If the resultant check is MATCH NEVER, ?777?. 


If the match control is either MATCH EQUAL or MATCH LEQUAL, two 
further checks are made. - 


a. The two major IDs (one in ICB and one in IHD) must be equal. 


b. The two minor IDs must be related according to the match contre 
In the case of MATCH EQUAL, they must be equal. In the case of 
MATCH LEQUAL, the requested minor ID (located in the ICB) must 
LEQU the minor ID in the image header of the image being 
activated. 


Calling Sequence: 
CHECK_MATCH CONTROL (ICB, IHD ) 
Formal Parameter: 


ICB - Address of image control block that describes the image 


that is currently being activated. 


IHD - Address of image header of image being activated. 


IHD _V_MINOR_ID = $BYTEOFFSET (IHD$L_IDENT), 0, 24, 0 %, 
IHD V_MAJOR_ID = $BYTEOFFSET (IHD$L IDENT), 24, 8, 0 %; 


MAP 
ICB 
THD 


: REF $BBLOCK, 
: REF S$BBLOCK; 


CASE .IHD [IHDS$V_MATCHCTL] 
FROM ISDS$K_MATALL TO ISD$K_MATNEV OF 


SET 


[ISD$K_MATALL] : 


SS$_NORMAL; ! Do nothing 


DIGITAL INTERNAL USE ONLY 167 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 40 


X-14 


1913 
1914 
1915 
1916 
1917 
1918 
1919 
1920 
1921 
1922 
1923 
1924 
1925 
1926 
1927 
1928 
1929 
1930 
1931 
1932 
1933 
1934 
1935 
1936 
1937 
1938 
1939 
1940 
1941 
1942 
1943 
1944 
1945 
1946 
1947 
1948 
1949 
1950 
1951 
1952 
1953 
1954 
1955 
1956 
1957 
1958 
1959 
1960 
1961 
1962 
1963 
1964 
1965 
1966 
1967 
1968 
1969 


wa Ne 


we Ye Ve Ns 


we Ne Ve Se Ve Ve Veo Ve Te Ve Ve 


oe Me Ne Ne Se Ne Me Me te Me Ne Me Se Ns Se Ne Ye Ne Se Se Se Ne Ne Se Ne Ne Me Se Se Ne Ne Se Se Ne =e te Ne Te Se Ve 


PNNNNWWWWWWWWWNNNNWWWWWWWWWNNNNNNNNNNNNNNNNHNNANNNNNWNHWNHNNN 


CHECK_MATCH CONTROL - Check Match Control Ident 10-Apr-1989 10:48:52 


[ISD$K_MATEQU] : 
IF 
(.ICB [ICB$V_MATCH CONTROL] EQLU ISD$K_MATALL) 
OR 
(.ICB [ICB$V_MATCH CONTROL] EQLU ISD$K_MATLEQ) 
THEN RETURN SS$_SHRIDMISMAT; 
[ISD$K_MATLEQ] : 


IF .ICB [ICB$V_MATCH CONTROL] EQLU ISD$K_MATALL 
THEN RETURN Ss$ __SHRIDMISMAT; 


[ISD$K_MATNEV] : 
RETURN SS$_SHRIDMISMAT; 
TES; 
CASE .ICB [ICB$V_MATCH CONTROL] 
FROM ISDSK_MATALL TO ISDS$K_MATNEV OF 
SET 
{ISDSK_MATALL] : 
RETURN SS$_NORMAL; 
[ISDSK_MATEQU, ISDS$K_MATNEV] : 
BEGIN 


IF .ICB [ICB$V_MAJOR_ID] NEQU .IHD [IHD_V_MAJOR_ID] 
THEN RETURN SS$_SHRIDMISMAT; 


IF .ICB [ICBSV_MINOR_ID] EQLU .IHD [IHD_V_MINOR_ID] 
THEN RETURN Ss$ | NORMAL 
ELSE RETURN SS$_SHRIDMISMAT; 
END; 
{ISD$K_MATLEQ] : 
BEGIN 


IF .ICB [ICBSV_MAJOR_ID] NEQU .IHD [IHD_V_MAJOR_ID] 
THEN RETURN SS$_SHRIDMISMAT; 


IF .ICB [ICBS$V_MINOR_ID] LEQU .IHD [IHD_V_MINOR_ID] 
THEN RETURN sss | NORMAL 
ELSE RETURN SS$_SHRIDMISMAT; 
END; 
TES; 


END; 


168 DIGITAL INTERNAL USE ONLY 


_$25 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 41 


X-14 


08 


04 
40 


04 
40 


04 


47 


47 


20BC 


3 Routine Size: 


Ac 
00 
52 
0026 


on 
\ 


Ac 
AO 


5A 


00 
08 
AC 
AO 
48 
Ac 
00 
52 
0036 


2c 
AO 
29 
00 
00 
1B 
15 
AO 
12 
00 
00 
04 
01 


8F 


CHECK_MATCH_ CONTROL:’- Check Match Control Ident 10-Apr-1989 10:48:52 


000C 00000 CHECK _MATCH_CONTROL: 
» WORD Save R2,R3 
DO 00002 MOVL IHD, Ri 
EF 00006 EXTZV #0, #3, 35(R1), R2 
CF 0000C CASEL R2, #0, #3 
00010 1S: -WORD 5$-1$,- 
2$-1$,- 
3$-158,- 
10$-1$ 
11 00018 BRB 5$ 
DO OOOI1A 2S: MOVL ICB, RO 
93 OOO1E BITB 64(RO), #7 
13 00022 BEQL 10$ 
ED 00024 CMP2ZV #0, #3, 64(RO), #2 
11 OO002A BRB 4$ 
DO 0002C 3S: MOVL ICB, RO 
93 00030 BITB 64(RO), #7 
13 00034 48: BEQL 10$ 
DO 00036 55S: MOVL ICB, RO 
EF OOO3A EXTZV #0, #3, 64(RO), R2 
CF 00040 CASEL R2, #0, #3 
00044 65S: - WORD 9$-6S,- 
78-68 co 
8$-68,- 
7$-68 
11 0004Cc BRB 9S 
91 OO04E 78: CMPB 71(R0), 39(R1) 
12 00053 BNEQ 10$ 
EF 00055 EXT2ZV #0, #24, 36(R1), R3 
ED 0005B CMP ZV #0, #24, 68(RO), R3 
12 00061 BNEQ 10$ 
11 00063 BRB 9$ 
91 00065 8S: CMPB 71(RO), 39(R1) 
12 OOO6A BNEQ 10$ 
EF 0006C EXTZV #0, #24, 36(R1), R3 
ED 00072 CMPZV #0, #24, 68(RO), R3 
1A 00078 BGTRU 10$ 
DO OOO7A 98: MOVL #1, RO 
04 0007D RET 
3C OOO7E 108: MOVZWL #8380, RO 
04 00083 RET 
132 bytes, Routine Base: EXEC$PAGED CODE + 0667 


DIGITAL INTERNAL USE ONLY 169 


=e “Se Te Ye 


ea Me Me Se Me Be Me Se Me Ne Ne Ne Me Me Me Me Se Me Ve MO Ye Me Ne Me Me Ne Ne te Se Ne Ne Se Se Se Me Ne 


_$25 


1858 
1906 


1912 
1917 
1919 


1924 


1933 


1939 
1945 


1948 
1949 
1958 


1961 


1962 


1963 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 42 


X~14 


1971 
1972 
1973 
1974 
1975 
1976 
1977 
1978 
1979 
1980 
1981 
1982 
1983 
1984 
1985 
1986 
1987 
1988 
1989 
1990 
1991 
1992 
1993 
1994 
1995 
1996 
1997 
1998 
1999 
2000 
2001 
2002 
2003 
2004 
2005 
2006 
2007 
2008 
2009 
2010 
2011 
2012 
2013 
2014 
2015 
2016 
2017 
2018 
2019 
2020 
2021 
2022 
2023 
2024 
2025 
2026 
2027 


™e Ne Ne Ve Ne te Me 


=e Se “e Ve Ne 


me Ne Ve Ye Te Ye Ne Me 


™e Se Ne Ne Ye Ye Se Se Me Me 


™e Se “Ne Ve Ve Ne We Ve Ve Ve Ye Ye Ye De 


ze Se Ve 


Ne Ne 


we Ne 


se Ne 


oY ee! en eT 


NNNNNNNNNNNNNNNNHNNNNHNNNNNHKFP HEB BP BBP HE BP PB Be PP PE BPP BEEP PPP BP eee ee ee 


END_PROCESSING - Final Steps of Image Activatio 10-Apr-1989 10:48:52 _§$25 
%SBTTL 'END PROCESSING - Final Steps of Image Activation’ 
ROUTINE END PROCESSING (ICB ADDRESS) = 
1+ 
! Functional Description: 
! 
! This routine performs the steps involved in image activation after all 
! of the ISDs have been processed. (Some of the details are actually 
! performed by the kernel mode routine SET CONTROL_REGION.) The operation 
! that need to be completed include 
! 
! © mapping the image I/O segment 
! 
! © mapping the user stack and setting the initial value of USP 
! 
! © setting up the process privilege mask 
! 
! © optionally setting up image accounting information 
! 
! © bumping the use count in any KFEs referenced by this activation 
! 
! © bumping the reference count in any shared WCBs referenced by this 
! activation 
' 
! © returning image parameters to the caller 
! 
! Calling Sequence: 
! 
! END PROCESSING (ICB_ ADDRESS) 
!— 
BEGIN 
LOCAL 
IMAGE_IO_ PAGE COUNT, 
STACK BASE, 
CRETVA_RANGE : VECTOR [2], 
ARG LIST : VECTOR [4] INITIAL ( 
3, ! Argument count 
CRETVA_RANGE, ! INADR 
oO, ! Null retadr 
EXEC_PROT), ! Access mode and protection 
IMGIO_SEG DESC : VECTOR [2] INITIAL (0,0), 
STATUS; 
BIND | 
ICB = .ICB_ADDRESS : $BBLOCK, 
KFE = .ICB [ICBSL_KFE] : $BBLOCK, 
PHD = .CTLSGL_PHD : S$BBLOCK, 
STACK_ARRAY = CRETVA_RANGE : VECTOR; 
! The location of the image header depends on whether the image was installe 
! with its header resident. 
BIND 


IHD 


170 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May~1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 43 


X-14 


Se te 


me Te Ye Te Se Ve We Ne Teo Ve Ye Ve We Ve We Be Ye Ve 


we we Ye Yo Ye Ye Ve 


~e Me Se Se Ye Se %e Ve Me Ve We We Ve 


Se Ne Ne Ne Ne Se Ne Se Ne 


Se Ss Se Te Ne Ne Ne 


=e 


2028 
2029 
2030 
2031 
2032 
2033 
2034 
2035 
2036 
2037 
2038 
2039 
2040 
2041 
2042 
2043 
2044 
2045 
2046 
2047 
2048 
2049 
2050 
2051 
2052 
2053 
2054 
2055 
2056 
2057 
2058 
2059 
2060 
2061 
2062 
2063 
2064 
2065 
2066 
2067 
2068 
2069 
2070 
2071 
2072 
2073 
2074 
2075 
2076 
2077 
2078 
2079 
2080 
2081 
2082 
2083 
2084 


Aa bbb Lh Hh LH HD Hb vee agree aAananon a be WWWW Ee we ww WNHOD NNO NN NY W 2 we HHL DL Dw hb Oo WW 


END_PROCESSING ~- Final Steps of Image Activatio 10-Apr-1989 10:48:52 _$25 
(IF .ICB [(ICB$L_IHD] EQL 0 
THEN 
BEGIN 
BIND 
CTX = .ICB [ICB$L_CONTEXT] : $BBLOCK; 


.CTX [CTX_L_IHDBUF] 


END 
ELSE 
-ICB [ICBSL_IHD]) : $BBLOCK; 


! If this is the activation of a main program, then the image I/O segment an 
! user stack must be mapped. 


IF .OWN_STORAGE [MAIN PROGRAM] 
THEN 
BEGIN 
IMAGE_IO PAGE COUNT = ( 
IF .IHD [IHD$W_IMGIOCNT] NEQ 0 
THEN 
.IHD [IHD$W_IMGIOCNT] 
ELSE 
. SGNS$GW_IMGIOCNT) ; 


IF .IMAGE IO PAGE COUNT GTR .SGNS$GW_IMGIOCNT 


THEN 
BEGIN 
IF .IHD [IHDSV_POIMAGE] 
THEN 
BEGIN 
CRETVA_RANGE [0] = .PHD [PHD$L_FREPOVA]; 
CRETVA_RANGE [1] = 
.CRETVA_RANGE [0] 
+ (.IMAGE_IO PAGE COUNT * BYTES_PER_PAGE) 
- 1; 
END 
ELSE 
BEGIN 


CRETVA_RANGE [1] 
CRETVA_RANGE [0] 
-CRETVA_RANGE [1] 
- (.IMAGE IO PAGE COUNT * BYTES PER PAGE) + 1? 
END; 


-CTL$GL_CTLBASVA - 1; 


! Create the image I/O segment using the internal routine that allow 
! a mixed-mode protection mask to be specified. 


STATUS = $CMKRNL ( 
ROUTIN = MMGSCRETVA, 
ARGLST = ARG LIST); 

IF NOT .STATUS 

THEN RETURN .STATUS; 


IMGIO SEG DESC [90] 


a | - IMAGE IO PAGE COUNT * BYTES PER PAGE; 
IMGIO_SEG DESC [1] 


-CRETVA_RANGE [0]; 


DIGITAL INTERNAL USE ONLY 171 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 44 


X~14 


2085 
2086 
2087 
2088 
2089 
2090 
2091 
2092 
2093 
2094 
2095 
2096 
2097 
2098 
2099 
2100 
2101 
2102 
2103 
2104 
2105 
2106 
2107 
2108 
2109 
2110 
2111 
2112 
2113 
2114 
2115 
2116 
2117 
2118 
2119 
2120 
2121 
2122 
2123 
2124 
2125 
2126 
2127 
2128 
2129 
2130 
2131 
2132 
2133 
2134 
2135 
2136 
2137 
2138 
2139 
2140 
2141 


—e Ve Ve “Ws Ve Ve Ye Ve Ve Ve Ye 


wu yy 


™e Ye Te Ve Vo 


vu UY 


™e Se Te Ye Ve Ve 


™e Se Te Ye Ve We Veo Ve Vo Ve Ve Ve Yeo Vso Ve 


‘we Se te Ye We Bea Se Veo We We Ve We Ve Ye Vo 


=e 


=e Ne Ne Ye 


WWWWWWWWWWWWWnNNNNNHNHNHANNNNNNNHNNNHWWWWE Pe KKH HW HL SH KD ee HWWW WW WD 


END_PROCESSING - Final Steps of Image Activatio 10-Apr-1989 10:48:52 _$25 


END; 


RMSSET (.IHD [IHD$L_LNKFLAGS], IMGIO_ SEG DESC); 


IF .IHD [IHD$V_POIMAGE] 


THEN 
BEGIN 


STATUS = $EXPREG ( 
.OWN_STORAGE [USER STACK SIZE], 


PAGCNT = 
RETADR 
ACMODE 
REGION 
STACK_BASE 
END 
ELSE 
BEGIN 


STACK_ARRAY, 
PSLS$C_USER, 

0); 

.STACK_ARRAY [1] + 1; 


STATUS = SEXPREG ( 
-OWN_STORAGE [USER_STACK_SIZE], 


PAGCNT = 

RETADR 

ACMODE 

REGION 
STACK_BASE 
END; 


IF NOT .STATUS 


STACK_ARRAY, 
PSLSC_USER, 

1); 

-STACK_ARRAY [0] + 1; 


THEN RETURN .STATUS; 


END; 


a ae ee ee ee ee, ee er re ey 


! End of test for main program 


The two main pieces of information are 


the image header except for all of the ISDs 


IF .OWN_ STORAGE [BUFFER_ADDRESS] NEQA 0 


THEN 
BEGIN 


! Because this buffer contains a variety of 


! at it in several different ways. 


BIND 
BUFFER 
BUFHDR 
NAM 


LOCAL 
IFD 
FILE NAME 


172 DIGITAL INTERNAL USE ONLY 


.OWN STORAGE [BUFFER ADDRESS] 
.OWN STORAGE [BUFFER ADDRESS] 
PRIMARY NAM 


: REF SBBLOCK, 
: REF VECTOR [, BYTE]; 


If the caller so requested, information about the image just activated is 
returned in a 512-byte buffer whose address was passed as an input paramet 


an image file descriptor whose primary piece is a string and descriptor 
for the image file just activated 


Note that the buffer must be probed again because one of the mapping reque 
issued by the image activator may have changed its protection. 


information, we need to look 


: VECTOR [RETURN_BUFFER_SIZE 
: VECTOR [3,LONG], 
: $BBLOCK; 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 45 


X-14 


we Se Se Se Ne Se Se Ye Me Ne Ne Ye 


=e 


me Ye Ne 


™e Se Se Ye Ne 


se Ne Ne Me 


™e “ese Te Ve Te We Ve Te We Ve Te Ve Ve Ve Ve We Ye Ye Ye Ye Ve 


me Ne Se Ve Ne Ve Se Ne 


me Se Se 


2142 
2143 
2144 
2145 


2146 


2147 
2148 
2149 
2150 
2151 
2152 
2153 
2154 
2155 
2156 
2157 
2158 
2159 
2160 
2161 
2162 
2163 
2164 
2165 
2166 
2167 
2168 
2169 
2170 
2171 
2172 
2173 
2174 
2175 
2176 
2177 
2178 
2179 
2180 
2181 
2182 
2183 
2184 
2185 
2186 
2187 
2188 
2189 
2190 
2191 
2192 
2193 
2194 
2195 
2196 
2197 


2198 


aaa au kb hl LoUUUUUUUUHuge UL UL HH HL HH dd HH SEL Hee oe WW Hh hh WW WwW WwW Ww Ww 


END PROCESSING - Final Steps of Image Activatio 10-Apr-1989 10:48:52 _§25 


! Insure that buffer is still writable by caller 


IF NOT PROBEW (%REF (0), *REF (RETURN BUFFER SIZE), .OWN_STORAGE [BUFFER_A 
THEN RETURN SS$_ACCVIO; 


! Insure that image header information will fit into a single page 


IF ( 
12 + ! Three longword header 
-IHD [IHDSW_SIZE] ! Image header less ISDs 
) 
LEQU RETURN_BUFFER_SIZE 

THEN 
BEGIN 


! Fill in the three pointers 


BUFHDR [0] = BUFFER ([(12]; ! Image header starts right 
BUFHDR [1] = 0; ! O until we see if IFD fits 
BUFHDR [2] = 0; ! Third longword is unused o 


! Copy the image header 
CHS$MOVE (.IHD [IHDS$W_SIZE), IHD, BUFFER [12]); 
! Any transfer address array elements that are not located in the 


! permanent portion of Pl space or in system space must be relocated 
! by an amount equal to the base address of the image just mapped. 


IF 
(.OWN_ STORAGE [TRANSFER_ARRAY_ BIAS] NEQ 0) 
AND 
(NOT .IHD [IHD$V_LNKNOTFR] ) 
THEN 
BEGIN 
BIND 
IHA = .BUFHDR [0] + .IHD [IHDSW_ACTIVOFF] : VECTOR [3] 
LOCAL 
I; 
INCR I FROM 0 TO 2 DO 
IF .IHA [.I] LSSU .CTLSGL_CTLBASVA 
THEN 
IHA [.I] = .IHA [.I]}] + .CWN_STORAGE [TRANSFER_ARRAY_ BIAS 
END; 


! See if we can also fit in the IFD 


IF ( 

12 + i Three longword header 

-IHD [IHDSW SIZE] + ! Image header less ISDs 
IFD$K_LENGTH + ! Fixed portion of IFD 

-NAM [NAMSB_ RSL] + ! Length of image file name 
1) ! Count byte in ASCIC string 


DIGITAL INTERNAL USE ONLY 173 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 46 


X-14 


2199 
2200 
2201 
2202 
2203 
2204 
2205 
2206 
2207 
2208 
2209 
2210 
2211 
2212 
2213 
2214 
2215 
2216 
2217 
2218 
2219 
2220 
2221 
2222 
2223 
2224 
2225 
2226 
2227 
2228 
2229 
2230 
2231 
2232 
2233 
2234 
2235 
2236 
2237 
2238 
2239 
2240 
2241 
2242 
2243 
2244 
2245 
2246 
2247 
2248 
2249 
2250 
2251 
2252 
2253 
2254 
2255 


™e Te “se Ye Ve Ne Se Ye Se Ye Ve Ve 


™e Ne Me Ne Me Ne Ne 


me Te Se Ne Me Se Me Se Me Me Me Me Me Me Ne Me Me Ne Ne 


Se Se Ve Ne Me Te Ne Me Me Ne Ne 


Re Se Me Se Be Se Se Me 


NNNANON WWW WW WW Pw HPD HLLHUOHKTUUTUUUIAUAARAAARAAARARAMYUUHNNnanawnwnne os & 


END_ PROCESSING ~- Final Steps of Image Activatio 10-Apr-1989 10:48:52 _$25 
LEQU RETURN _BUFFER_ SIZE 
THEN 
BEGIN 
IFD = BUFFER (12 + .IHD [IHD$W_SIZE]]; ! IFD follows the im 
BUFHDR [1] = .IFD; ! Store its address 


! Fill in the fixed portion of the IFD 

IFD [IFD$W_SIZE] = IFD$K_LENGTH + .NAM [NAMS$B_RSL]; 
IFD {IFDS$W_| FILNAMOFF] = IFDSK _LENGTH; 

IFD [IFDSW_ CHAN] = .ICB [ICB$W | CHAN] ; 


IFD [IFD$W_CMCHAN] = .OWN_ STORAGE [(OTHER_CHANNEL] ; 
IFD [IFDS$L_CMKFIADR] = .OWN_STORAGE [OTHER_KFE_ ADDRESS]; 


IFD [IFDS$W_FLAGS] = .IAC$GL_IMAGCTX; 
FILE NAME = .IFD + IFD$K_LENGTH; 
BEGIN 


BIND 
FILE NAME DESC = IFD [IFD$Q_CURPROG] : $BBLOCK; 


FILE NAME DESC [DSC$W_LENGTH] = .NAM [NAMS$B_RSL]; 
FILE , NAME _ DESC [DSCSA_| POINTER] = .FILE_| NAME + 1; 


END; 
FILE NAME [0] = .NAM [NAMSB_RSL]; 
CHSMOVE ( 
-NAM [NAMSB_RSL], 
RESULT NAME, 
FILE NAME [1]); 
END 
ELSE 
! Fill the IFD portion with zeros 
CHSFILL (0, RETURN_BUFFER_SIZE - 12 - .IHD [(IHDS$W_SIZE), 
BUFFER [12 + .IHD {IHDSW_SIZE]] ); 
END 
ELSE 


!!! FOR LACK OF ANYTHING BETTER TO DO IN THIS CASE, I WILL FILL 
!!! THE ENTIRE 512-BYTE BUFFER WITH ZEROS 


CHSFILL (0, RETURN BUFFER SIZE, .OWN STORAGE [BUFFER_ADDRESS)}) ; 


END; 


! If the caller so requested, the address range into which the image and all 
! of its associated shareable images were mapped is returned. Like the previ 
! buffer, this address range must be probed in case the protection on the 


174 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 47 


X-14 


2256 
2257 
2258 
2259 
2260 
2261 
2262 
2263 
2264 
2265 
2266 
2267 
2268 
2269 
2270 
2271 
2272 
2273 
2274 
2275 
2276 
2277 
2278 
2279 
2280 
2281 
2282 
2283 
P 2284 
P 2285 
2286 
2287 
2288 
2289 
2290 
2291 
2292 


™e Veo Ve Ne Te Ne Veo 


we 


Be Me te Ne Ne MS 


we Ze Ne Veo Me Ve Ye 


we Ne 


=e Ye 


=e Me Me Me NO 


we Se Me Ye Se Me Ne 


0000000 


1c 
04 
04 


END_PROCESSING - Final Steps of Image Activatio 10-Apr-1989 10:48:52 _825 


00000000G 00 DO 


BIND 


! pages changed since the argument was first validated. 
IF .OWN STORAGE [RETURN_ARRAY ADDRESS] NEQA 0 


THEN, 
BEGIN 


RETADR = .OWN STORAGE [RETURN_ARRAY_ ADDRESS] : VECTOR; 


! Insure that two longwords are still writable 


IF NOT PROBEW (%REF (0), %REF (8), .OWN_STORAGE [RETURN ARRAY ADDRESS] ) 
THEN RETURN SS$_ ACCVIO; 


2 
2 
2 
2 
3 
3 
3 
3 
3 
3 
3 
3 
3 
3 
3 ! Return the start and end addresses 
3 
3 RETADR [0] = .OWN STORAGE [RETURN START_ADDRESS]; 
3 RETADR [1] = .OWN STORAGE [RETURN END ADDRESS]; 
3 
2 END; 
2 
2 ! The following kernel mode routine executes unconditionally to perform thos 
2 ! completion chores that must be executed in kernel mode. 
2 
2 ARG LIST [1] = .STACK_BASE; 
2 ARG LIST [2] = IHD; 
2 ARG LIST [3] = KFE; 
2 
2 STATUS = SCMKRNL ( 
2 ROUTIN = SET CONTROL REGION, 
2 ARGLST = ARG LIST); 
2 IF NOT .STATUS 
2 THEN RETURN .STATUS; 
2 
2 RETURN SS$_ NORMAL 
2 
1 END; 
-PSECT EXECSPAGED DATA, PIC,2 
00000003 00010 P.AAC: .LONG 3 ; 
00000000 00014 . LONG 0, 0, 3329 ; 
-EXTRN SYSSEXPREG 
-PSECT EXECSPAGED CODE,NOWRT, PIC,2 
OFFC 00000 END PROCESSING: 
- WORD Save R2,R3,R4,R5,R6,R7,R8,R9,R10,R11 # 1973 
24 C2 00002 SUBL2 #36, SP ; 
10 28 00005 MOVC3 #16, P.AAC, ARG LIST ? 2013 
AE 9E 0000C MOVAB CRETVA_RANGE, ARG_LIST+4 3 2011 
AE 7C 00011 CLRQ IMGIO SEG DESC 7 2014 
AC DO 00014 MOVL ICB ADDRESS, RY ; 2018 
00018 MOVL CTL$GL_PHD, Rl ? 2020 


DIGITAL INTERNAL USE ONLY 175 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 48 


X-14 
50 AQ 
OA 
58 A9 
04 AO 
04 
50 AQ 
00000000G 00 
OOBB 
1E A8 
06 
1E A8 
07 
00000000G 00 
00 
4D 
09 
04 
oo9c cl 
1c AE 
FF AO 
13 
01 
52 
01 AO 
oc AE 
00000000G 00 
02 
50 
5B 
52 
1c AE 
04 AE 
20 A8 


00000000G 00 
000000006 00 
04 

03 

24 #£4x9AE 

50 

04 

50 

01 

18 

01 

03 

24 # AE 

50 

04 

50 

01 

5B 

0112 
00000000G 00 
03 

00ocB 

00 


END PROCESSING - Final Steps of Image Activatio 10-Apr-1989 10:48:52 


D5 
12 
DO 
DO 
11 
DO 
E8 
31 
B5 
13 
3c 
11 
3c 
ED 


18 
78 
El 
DO 
cl 
9E 
11 
C3 
C3 
9E 
oF 
oF 
FB 
DO 
E9 
DO 
DO 
9E 
DO 
16 
DO 
El 
7D 
oF 
DD 
FB 
DO 
cl 
11 
DD 
DD 
oF 
DD 
FB 
DO 
cl 
E8 
31 
co 
12 
31 
OD 


OOO1F 
00022 
00024 
00028 
0002c 
0002E 
00032 
00039 
0003C 
0003F 
00041 
00045 
00047 
0004E 


00057 
00059 
0005D 
00062 
00068 
0006D 
00072 
00074 
0007D 
00082 
00087 
OOO8A 
00090 
00097 
OO0O9A 
0009D 
OOOA1 
OOOAE6 
OOOAA 
OOOAE 
000B4 
OOOBB 
000CO 
000c3 
000CE6 
oo0ocs 
OOOCF 
000D2 
000D7 
O00D9 
OOODB 
OOODD 
OOOEO 
O00E2 
OOOE9 
OOOEC 
OooF1 
OOOF4 
OOOF7 
OOOFE 
00100 
00103 


18; 
2s: 


4S: 
58: 


8S: 


9$: 


108: 


118: 


128: 


176 DIGITAL INTERNAL USE ONLY 


TSTL 
BNEQ 
MOVL 
MOVL 
BRB 
MOVL 
BLBS 
BRW 
TSTW 
BEQL 
MOVZWL . 
BRB 
MOVZWL 
CMPZV 


BGEQ 
ASHL 
BBC 
MOVL 
ADDL3 
MOVAB 
BRB 
SUBL3 
SUBL3 
MOVAB 
PUSHAB 
PUSHAB 
CALLS 
MOVL 
BLBC 
MOVL 
MOVL 
MOVAB 


BNEQ 
BRW 
PROBEW 


80 (R9) 

1$ 

88(R9), RO 

4(RO), R8 

2$ 

80(R9), RS 

OWN STORAGE, 3$ 

11$ 

30(R8) 

4s 

30(R8), IMAGE _IO PAGE COUNT 
5$ 

SGN$GW_IMGIOCNT, IMAGE_IO PAGE COUNT 
#0, #16, SGNS$GW_IMGIOCNT, - 
IMAGE_IO PAGE _COUNT 

8S 

#9, IMAGE_IO PAGE COUNT, R2 
#4, 32(R8), 6$ 

156(R1), CRETVA_RANGE 
CRETVA_RANGE, R2, RO 
-1(RO), CRETVA_RANGE+4 

7$ 

#1, CTL$GL_CTLBASVA, CRETVA_RANGE+4 
R2, CRETVA_RANGE+4, RO 
1(RO), CRETVA_RANGE 
ARG_LIST 

MMGSCRETVA 

#2, SYSSCMKRNL 

RO, STATUS 

STATUS, 10$ 

R2, IMGIO SEG DESC 
CRETVA_RANGE, IMGIO SEG DESC+4 
IMGIO_SEG DESC, R1 

32(R8), RO 

RMSSET 

OWN _STORAGE+28, RO 

#4, 32(R8), 9$ 

#3, -(SP) 

STACK_ARRAY 

RO 

#4, SYSSEXPREG 

RO, STATUS 

#1, STACK_ARRAY+4, STACK_BASE. 
10$ 

#1 

#3 

STACK_ARRAY 

RO 

#4, SYSSEXPREG 

RO, STATUS 

#1, STACK_ARRAY, STACK _BASE 
STATUS, 11$ 

24S 

OWN _STORAGE+64, R6 

12$ 

208 

#0, #512, (R6) 


Se Ve Se Se Se Ye Ye Ye Ye Wo Ne Ye Ve Ye 


we Ye Te Ve Ve Se Ye Ve 


we Se Te Ve Yo We Ve Yo Ye Yeo “se Ve 


se Ne 


=e Ve Ve Ze Be Va NWo We 


we Ye Ve Se Ms Ye 


we Me Ne Ne Ne Ne Ne 


_$25 
2028 


2033 
2035 
2044 


2048 


2052 
2054 


2063 
2057 
2060 
2063 
2064 


2068 
2071 


2079 


2080 
2083 
2084 
2088 


2097 
2090 
2097 


2098 


2106 


2107 
2110 


2127 


2145 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 49 


X-14 


03 

OOCcF 

68 

oc A7 
SA 

03 

OOA5 

oc A6 
04 A6 
57 
00000000G 00 
20 

01 

02 A8 
66 


50 


6140 

04 

52 

02 

00000000G 00 
29 A247 

50 

4A 

SA 

50 

ic 

ic 

OE AQ 
00000000G 00 
00000000G 00 
00000000G 00 
1c AO 


01 Al 


00000000G 00 


00000000G 00 


54 AQ 
oc AE 
OOoocOoV CF 


END_PROCESSING - Final Steps of Image Activatio 10-Apr-1989 10:48:52 


12 


‘31 


3¢ 
9E 
Di 
1B 
31 
9E 
7 
28 
DO 
13 
EO 
3c 
co 
D4 
D1 
1E 
co 
F3 
9A 
9E 
D1 
1A 
cl 
DO 
Al 
BO 
BO 
BO 
DO 
BO 
9E 
co 
BO 
9E 
90 
28 
11 
C3 
2c 


1i 
2c 


DO 
13 
OD 
12 
DO 
04 
7D 
DG 
DO 
DO 
oF 
oF 


00109 
00108 
0010E 
ooll1 
00115 
oo1ic 
OO11E 
00121 
00125 
00128 
0012D 
00134 
00136 
0013B 
0013F 
00142 
00144 
0014¢c 
0014E 
00152 
00156 
0015D 
00162 
00169 
0016B 
OO16F 
00173 
00177 
0017B 
00180 
00188 
00190 
00198 
0019¢ 
0019F 
001A2 
OC1A7 
OO1AA 
001B3 
001B5 
001BD 
001C2 
001C4 
001C6 
001CD 
001CE 
001D5 
001D7 
001DB 
001DD 
001E0 
O0O1E1 
001E8 
OO1EC 
001F0 
OO1F5 
Oo1Fs 


13S: 


14S: 


15S: 


16S8: 
17S: 


18S: 


198: 


208: 


21S: 


2283 
238: 


BNEQ 
BRW 
MOVZWL 
MOVAB 
CMPL 
BLEQU 
BRW 
MOVAB 
CLRQ 
MOVC3 
MOVL 
BEQL 
BBS 
MOVZWL 
ADDL2 
CLRL 
CMPL 
BGEQU 
ADDL2 
ACBLEQ 
MOVZBL 
MOVAB 
CMPL 
BGTRU 
ADDL3 
MOVL 
ADDW3 


13$ 

21$ 

(R8), R7 

12(R7), R10 

R10, #512 

14$ 

19§ 

12(R6), (R6) 

4 (R6) 

R7, (R8), 12(R6) 
OWN_STORAGE+24, R2 

17$ 

#1, 32(R8), 17$ 

2(R8), R1 

(R6), R1 

I 

(R1) [I], CTL$GL_CTLBASVA 
16$ . 

R2, (R1) [TI] 

#2, I, 15$ 

NAM+3, R2 

41(R2) [R7], RO 

RO, #512 

18$ 

R10, R6, IFD 

IFD, 4(R6) 

#28, R2, (IFD) 

#28, 2(IFD) 

14(R9), 8(IFD) 

OWN _STORAGE+14, 10(IFD) 
OWN _STORAGE+20, 12(IFD) 
IACSGL_IMAGCTX, 16(IFD) 
28(RO), FILE_NAME 

#20, RO 

R2, (RO) 

1(FILE_NAME), 4 (RO) 

R2, (FILE_NAME) 

R2, RESULT NAME, 1(FILE NAME) 
20$ 

R7, #500, R7 

#0, (SP), #0, R7, (R10) [R6] 


20$ 
#0, (SP), #0, #512, (R6) 


OWN STORAGE+80, RO 


23$ 

#0, #8, (RO) 
228 

#12, RO 


OWN STORAGE+84, (RO) 
STACK BASE, ARG LIST+4 
R€, ARG LIST+8 

84(R9), ARG LIST+12 
ARG LIST 

SET _CONTROL_REGION 


/ 


DIGITAL INTERNAL USE ONLY 177 | 


“eo Se we Se Ne Se Ne Me Se Ne Ne Me Ne Ye Ye Ne Ye Se Se 


“oe Se Ne Se Ne 


we Ne 


~a 


“we Se Se Fe 


Ne te Ne Ne 


™s Ne %e Se Ye Se Ve Ye we Se “eo 


=e “Se Se Ve 


me 


=e Ne 


=e Se Se Ue 


_ $25. 


2152 
2151 
2154 


2160 
2162 
2166 
2173 


2175 
2180 


2185 
2186 


2188 
2185 
2197 
2198 
2199 


2202 
2203 
2207 
2208 
2209 
2211 
2212 
2214 
2216 
2221 
2223 
2224 
2228 
2231 


2240 


2249 
2258 
2267 
2268 
2273 
2280 
2281 


2282 
2286 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYS$IMGACT SYSIMGACT ~- Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 50 


X-14 END_ PROCESSING - Final Steps of Image Activatio 10-Apr-1989 10:48:52 _$25 
O02 FB OO1FC CALLS #2, SYSS$CMKRNL ; 
50 DO 00203 MOVL RO, STATUS ? 
5B E8 00206 BLBS STATUS, 25$ 3: 2287 
5B DO 00209 248: MOVL STATUS, RO 7 2288 
04 0020C RET 3 
O01 DO 0020D 258: MOVL #1, RO # 2290 
04 00210 RET ; 


; Routine Size: 529 bytes, Routine Base: EXECS$PAGED_CODE + O6EB 


178 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5~862 Page 51 
X-14 


™e Se Ne Ne Se Se Te Me Ve Ne Ne Se Ne Se Ye Ye Ne “Ye Ne Ye Ye Se Veo 


se Ve Fe 


“oe Ne 


Se Ne Me Ye Se Ne Ye Se Se Ye Se Ye Ye Me Se Se Ye Ne 


we Se Ve Se Ve Se Ve Ve Be Ye Ve 


SESE RE ae Sas SS S28 


ZS SE 


2294 
2295 
2296 
2297 
2298 
2299 
2300 
2301 
2302 
2303 
2304 
2305 
2306 
2307 
2308 
2309 
2310 
2311 
2312 
2313 
2314 
2315 
2316 
2317 
2318 
2319 
2320 
2321 
2322 
2323 
2324 
2325 
2326 
2327 
2328 
2329 
2330 
2331 
2332 
2333 
2334 
2335 
2336 
2337 
2338 
2339 
2340 
2341 
2342 
2343 
2344 
2345 
2346 
2347 
2348 
2349 
2350 


NNNNNNHNNNNNNNNNNNNNNNONNNYONNNN AN PK RPE PR BRP BP RPP RP RP RP RR RP eR ee Ree Pe ee be 


Ce ee ee ee ee ee ey ee a ee er ar er | 


SET CONTROL REGION ~ Kernel Mode Completion Rou 10-Apr-1989 10:48:52 _$25 


%SBTTL ‘SET CONTROL REGION - Kernel Mode Completion Routine’ 
ROUTINE SET CONTROL REGION ( 

USER_STACK_ADDRESS, 

IHD POINTER, 

KFE_POINTER) : SYS _CMKRNL = 


+ 
Functional Description: 


This routine performs the end processing that must be done in kernel 
mode. This includes loading the user stack pointer processor register, 
and setting up the process privilege mask. Note that these steps are 
only taken during the activation of a main program. 

Calling Sequence: 
SCMKRNL (SET CONTROL REGION, ARGUMENT LIST) 

Formal Parameters: 
USER_STACK_ADDRESS ~- Address of base (high address end) of user stack 


IHD POINTER - Pointer to image header for this image 


KFE_ POINTER - Pointer to known file entry for this image, if one exists 


BEGIN 

MACRO 

MOVE_PRIV_MASK (SRC, DST) = 
BEGIN 

VECTOR [DST, 0] 


VECTOR [DST, 1] 
END’ , 


-VECTOR [SRC, 0]; 
.VECTOR (SRC, 1]; 


ou 


CLEAR_PRIV_MASK (DST) = 


BEGIN 
VECTOR [DST, 0] 
VECTOR [DST, 1] 
ENDS , 


oo 
se Ne 


EXCLUDE PRIV_MASK (MASK, DST) = 


BEGIN 
VECTOR [DST, 0] 
VECTOR [DST,1] 
ENDS , 


- VECTOR [MASK,0O] AND .VECTOR [DST, 0]; 
- VECTOR [{MASK,1] AND .VECTOR [DST,1]; 


= 


INCLUDE PRIV_MASK (MASK, DST) = 


BEGIN 
VECTOR [DST,0] = .VECTOR [MASK,0O] OR .VECTOR [DST,0]; 


DIGITAL INTERNAL USE ONLY 179 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 52 


X-14 


M 2351 
2352 
2353 
2354 
2355 
2356 
2357 
2358 
2359 
2360 
2361 
2362 
2363 
2364 
2365 
2366 
2367 
2368 
2369 
2370 
2371 
2372 
2373 
2374 
2375 
2376 
2377 
2378 
2379 
2380 
2381 
2382 
2383 
2384 
2385 
2386 
2387 
2388 
2389 
2390 
2391 
2392 
2393 
2394 
2395 
2396 
2397 
2398 
2399 
2400 
2401 
2402 
2403 
2404 
2405 
2406 
2407 


me Me Se Me Se Se Se Se Se Se Ne Me Ne Te Ne Ne Ne Ye Te Ye Ne Se Ne Ve 


we “Ne Ne 


we Te Se Yeo Ye Se Ye Se Ye Ye Te Ve Ye Yo We We We Ve Ne Te We Ye Be Yo Te Ne Wo Ne We We 


H&P WWWWW WW WWW WWW WwWWWWUuUWW WWWWWWWNNNNNNNNNNNNNWNHNNNNNN NNN NN 


SET_CONTROL REGION - Kernel Mode Completion Rou 10-Apr-1989 10:48:52 _$25 
VECTOR [DST,1] = .VECTOR [{MASK,1] OR .VECTOR [DST,1]; 
_END% ; 
EXTERNAL REGISTER ! We enter this procedure with the P 
PCB = 4 : REF SBBLOCK; ! address contained in R4 
BIND 
IHD = .IHD POINTER : $BBLOCK, 
KFE = .KFE POINTER : SBBLOCK, 
PHD = .CTLS$GL_PHD : $BBLOCK; 
LITERAL 
CMKRNL OR_CMEXEC = (1 “* SBITPOSITION (PRVSV_CMKRNL) ) 
OR . 
(1 * $BITPOSITION (PRV$V_CMEXEC) ) ; 
LOCAL | 


PRIVILEGES : VECTOR [2], 
ICB : REF S$BBLOCK; 


! Most of the operations in this routine are only performed when activating 
! a main program. The only step that must be performed during a merged 


! activation is the USECNT adjustment for the KFEs. 


IF .OWN STORAGE [MAIN PROGRAM] 


THEN 


‘BEGIN 


! The high address end of the user stack is loaded into the stack limit 
! array. The user stack pointer is initialized with a value that is smal 
! than the input value by a value given by the EXTRA_USER_STACK compile 
! time constant. The size of the user stack is stored ina cell that wil 
! be used by the automatic stack expansion logic in EXCEPTION. Note that 
! this number can never be smaller than 2. 


CTL$AL_ STACK [PSL$C_USER] = .USER_STACK_ADDRESS; 

MTPR (%REF (.USER STACK_ADDRESS - (EXTRA_USER_STACK*BYTES PER_PAGE) ) 
, PR$_USP); 

IAC$GL_STACK_SIZE = .OWN STORAGE [USER_STACK SIZE]; 


! The privilege mask that will be used while this image is executing mus 
! be fabricated. 


MOVE _PRIV MASK (CTLS$GQ PROCPRIV, PRIVILEGES) ; ! Start with process 
! Eliminate those not present in the image header 
EXCLUDE _PRIV_MASK (IHD [IHD$Q_PRIVREQS), PRIVILEGES) ; 


! If the image was installed with privilege and we were called from othe 
! user mode, then add the privileges from the KFE 


IF .OWN STORAGE [CALL MODE] NEQ PSLS$C_USER 
AND 
BEGIN 
IF .KFE POINTER EQL 0 
THEN FALSE 


180 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5~862 Page 53 


X-14 


w™e Te “oe Ye Ye Ve Ve Ve Ve Ye We Ye We Ne Ve Ws Ve Ye Ye We Be Be Be We Ve Veo We We Ne We Ve Ve Ve Ze Ve Be Ye Ve Ye Ye Be Ve We 


Se Ne Ne Se te Se te Me Ne 


Se Te Ve Ve 


we 


2408 


2409 
2410 
2411 
2412 
2413 
2414 
2415 
2416 
2417 
2418 
2419 
2420 
2421 
2422 
2423 
2424 
2425 
2426 
2427 
2428 
2429 
2430 
2431 
2432 
2433 
2434 
2435 
2436 
2437 
2438 
2439 
2440 
2441 
2442 
2443 
2444 
2445 
2446 
2447 
2448 
2449 
2450 
2451 
2452 
2453 
2454 
2455 
2456 
2457 
2458 
2459 
2469 
2461 
2462 
2463 
2464 


NNNN WWH HKD HH LHP DoW WWWWWWWW WW wvWwWwuU hb BWW EWWW WW WW WWW bbb PW Sb HP 


SET_CONTROL_REGION - Kernel Mode Completion Rou 10-Apr-1989 10:48:52 $25 
ELSE .KFE [KFESV_PROCPRIV] 
END . ; 
THEN 
BEGIN 


INCLUDE_PRIV_MASK (KFE [KFESQ PROCPRIV], PRIVILEGES) ; 
MOVE _PRIV_MASK (KFE [KFE$Q PROCPRIV], PHD [PHD$Q_IMAGPRIV)); 
END 
ELSE 
CLEAR_PRIV_MASK (PHD [{PHD$Q_IMAGPRIV]); 


! Before the final privileges get stored, we need to check whether there 
! is a system version mismatch in any of the images that was mapped. (Th 
! mismatch was detected by the image header decode routine and remembere 
! in the REMOVE PRIVILEGE flag.) If a mismatch was detected, and either 
! CMEXEC or CMKRNIL is set, then CMKRNL and CMEXEC privileges are turned 
! off and an alternate status (SS$_SYSVERDIF) is returned. 


IF (.OWN_ STORAGE [REMOVE PRIVILEGE] ) 
AND 7 
((.PRIVILEGES [0] AND CMKRNL OR _CMEXEC) NEQU 0) 
THEN | 
BEGIN 
PRIVILEGES [0] = .PRIVILEGES [0] AND (NOT CMKRNL OR _CMEXEC) ; 
OWN STORAGE [FINAL STATUS] = SS$_SYSVERDIF; 
END; : #2 


! Store the privileges in the process header and in the PCB 


MOVE _PRIV_MASK (PRIVILEGES, PCB [PCBSQ_ PRIV]); 
MOVE _PRIV_MASK (PRIVILEGES, PHD [PHDSQ PRIVMSK}); 


! The address of the image header buffer must be stcred in the pointer f 
CTL$GL_IMGHDRBF = .OWN STORAGE [BUFFER_ADDRESS}]; 


! Finally, if image accounting was requested for this image, then the va 
{ image accounting cells must be initialized. 


IF .OWN STORAGE [IMAGE ACCOUNT] OR .EXESGL_ACMFLAGS [ACMSV_IMAGE] 
THEN 
BEGIN 
CTL$GL_ICPUTIM = .PHD [PHDS$L_CPUTIM]; 
CTL$GL_IFAULTS = .PHD [PYD$L PAGEFLTS]; 
CTL$GL_IFAULTIc = .PHD [PHD,L_PGFLTIO}; 
CTLS$GL_IWSPEAK = 0; 
CTL$GL_IPAGEFL = 0; 
CTLSGL_IDIOCNT = .PHD [PHD$L_DIOCNT]; 
CTL$GL_IBIOCNT = .PHD [PHDS$L BIOCNT]: 
CTLS$GL_IVOLUMES = .CTL$GL_VOuuiuw<, 
CTL$GQ_ISTART [0] = .EXESGQ SYSTIME [wv]; 
CTL$GQ_ISTART [1] = .EXESGQ_SYSTIME [1]; 
END; 


tt 


END; . ! End of test for main program 


The USECNT cell in each KFE must be incremented. In addition, any shared W 
! must have its REFCNT incremented. If the adjusted REFCNT is larger than th 


DIGITAL INTERNAL USE ONLY 181 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 54 


x-14 SET_ CONTROL REGION - Kernel Mode Completion Rou 10-Apr-1989 10:48:52 _$25 
; 2465 2 ! current high water REFCNT in the KFE, the KFE cell is adjusted. Finally, t 
: 2466 2 ! DONE bit in the ICB is turned ON, indicating that the activation for each 
; 2467 2 ! these ICBs is complete. 
; 2468 2 
: 2469 2 ICB = .IAC$GL_IMAGE LIST; 
: 2470 2 DO ~ - 
? 2471 3 BEGIN 
; 2472 3 
? 2473 3 LOCAL 
; 2474 3 KFE : REF $BBLOCK, 
+ 2475 3 WCB : REF $BBLOCK; 
; 2476 3 
; 2477 3 IF NOT .ICB [ICB$V_DONE] 
; 2478 3 THEN 
; 2479 4 BEGIN 
; 2480 4 ICB [ICBS$V_DONE] = TRUE; 
; 2481 4 KFE = .ICB [ICBSL_KFE]; 
; 2482 4 IF .KFE NEQU 0 
; 2483 4 THEN 
; 2484 5 BEGIN 
; 2485 5 KFE [KFESL_USECNT] = .KFE CReESS USECNT] + 1; 
; 2486 5 IF .KFE (KFESV | OPEN] 
; 2487 5 THEN 
; 2488 6 BEGIN 
; 2489 6 WCB = .KFE [KFESL_WCB]; 
; 2490 6 IF .WCB [WCBSW_| REFCNT) GTRU .KFE [KFESW_SHRCNT] 
; 2491 6 THEN KFE [KFESW_ SHRCNT] = .WCB [WCBSW_| REFCNT] ; 
; 2492 5 END; 
; 2493 4 END; 
; 2494 3 END; 
; 2495 3 ICB = .ICB [ICBSL_FLINK]; 
; 2496 3 END 
; 2497 2 UNTIL .ICB EQLA IAC$GL_IMAGE LIST; 
; 2498 2 
? 2499 2 IF .OWN STORAGE [RMS_BASE] NEQU 0 
; 2500 2 THEN CTLS$GL_RMSBASE = .OWN_STORAGE [RMS BASE] ; 
; 2501 2 
; 2502 2 RETURN SS$_NORMAL 
: 2503 2 
; 2504 1 END; 
006C 00000 SET_CONTROL_REGION: 

»WORD Save R2,R3,R5,R6 3 2296 
00000000G 00 9E 00002 MOVAB IACSGL_IMAGE LIST, R6 ; 
00000000G 00 9E 00009 MOVAB OWN STORAGE, R5 ; 

08 c2 00010 SUBL2 #8, SP ; 
0s AC DO 00013 MOVL IHD POINTER, R3 7 2358 
oc Ac DO 00017 MOVL. KFE POINTER, R2 7 2359 
00000000G 00 DO 0001B MOVL CTLS$GL_PHD, R1 7 2360 
65 E8 00022 BLBS OWN STORAGE, 1$ ? 2375 

OOE2 31 00025 BRW 6$ ; 
04 AC DO 00028 18: MOVL USER_STACK_ADDRESS, CTLSAL_STACK+12 7 2386 
04 AC DO 00030 MOVL USER_STACK_ADDRESS, RO 7 2387 


182 DIGITAL INTERNAL USE ONLY 


SYS$IMGACT SYSIMGACT - Image Activator Sy 
32 V4.5~862 Page 55 


X-14 
| FCOO 
ic 
000000006 
14 
04 
24 


oc 


20 


04 
0110 


0110 


239C 
0088 


40 


OOAC 
00co 
012c 
00000000G 
00000000G 
oocc 
0ODO 
00000000G 
00000000G 


40 
54 
14 


18 
OE 


OE 


co 
50 
A5 
00 
A3 
60 
53 
AO 
53 
A5 
20 
Ac 
1B 
02 
A2 
60 
AO 
cl 
60 
07 
cl 
60 
03 
6E 
09 
03 
8F 
C4 
6E 
6E 
A5 
02 
01 
cl 
cl 
cl 
00 
00 
cl 
cl 
00 
00 
66 
06 
8F 
A2 
18 
AO 
03 
AO 
Al 
O05 
Al 
62 
66 
52 
cD 


SET_CONTROL_REGION - Kernel Mode Completion Rou 10-Apr-1989 10:48:52 


9E 
DA 
DO 
7D 
9E 
D2 
CA 
D2 
CA 
91 
13 
D5 
13 
El 
9E 
cs 
cs 
9E 
7D 
11 
9E 
pie 
El 
93 
13 
8A 
3c 
oF 
7D 
7D 
DO 
EO 
El 
BO 
DBO 
DO 
D4 
D4 
DO 
DO 
DO 
7D 
DO 
EO 
88 
DO 
13 
D6 
El 
DO 
Bl 
1B 
BO 
DO 
9E 
D1 
12 


00034 
00039 
0003Cc 
00044 
0004B 
O0O04F 
00052 
00055 
00059 
0005D 
00061 
00063 
00066 
00068 
oo006D 
00071 
00074 
00079 
OOO7E 
00081 
00083 
00088 
OOO8A 
O008E 
00091 
00093 
00096 
oo009c 
OOOA1 
OOOA4 
O00A7 
OOOAF 
000B3 
OOOBB 
OVU0C4 
OO00CcD 
000D6 
ooopc 
O00E2 
OOOEB 
OOOF4 
OOOFF 
OO10A 
0010D 
00112 
00117 
0011B 
0011D 
00120 
00125 
00129 
0012E 
00130 
00135 
00138 
0013B 
0013E 


4S: 


583: 


6S: 
783 


8S: 


MOVAB 
MTPR . 
MOVL 
MOVQ 
MOVAB 
MCOML 
BICL2 
MCOML 
BICL2 
CMPB 
BEQL 
TSTL 
BEQL 
BBC 
MOVAB 
BISL2 
BISL2 
MOVAB 
MOVOQ 
BRB 
MOVAB 
CLRQ 
BBC 
BITB 
BEQL 
BICB2 
MOVZWL 
MOVAB 
MOVQ 
MOVQ 
MOVL 
BBS 
BBC 


CONFIDENTIAL AND PROPRIETARY _ 


DIGITAL EQUIPMENT CORPORATION 


-~1024(RO), RO 

RO, #3 ‘ 
OWN_STORAGE+28, IACS$GL_STACK_SIZE. 
CTL$GQ PROCPRIV, PRIVILEGES 
20(R3), RO 

(RO), R3 

R3, PRIVILEGES 

4(RO), R3 

R3, PRIVILEGES+4 
OWN_STORAGE+36, #3 

2$ 

KFE_ POINTER 

2$ 

#2, 16(R2), 2$ 

32(R2), RO 

(RO), PRIVILEGES 

4(RO), PRIVILEGES+4 
272(R1), R2 

(RO), (R2) 

3$ 

272(R1), RO 

(RO) 

#3, OWN_STORAGE, 4$ 
PRIVILEGES, #3 

4$ 

#3, PRIVILEGES 

#9116, OWN _STORAGE+16 
136(PCB), RO 

PRIVILEGES, (RO) 
PRIVILEGES, (R1) 
OWN_STORAGE+64, CTL$GL_IMGHDRBF 
#2, OWN_STORAGE, 5$ 

#1, EXESGL_ACMFLAGS, 6$ 
172(R1), CTL$GL_ICPUTIM 
192(R1), CTL$GL_IFAULTS 
300(R1), CTL$GL_IFAULTIO 
CTLS$GL_IWSPEAK 
CTL$GL_IPAGEFL 

204(R1), CTL$GL_IDIOCNT 
208(R1), CTL$GL_IBIOCNT 
CTL$GL_VOLUMES, CTLS$GL_IVOLUMES 
EXE$GQ SYSTIME, CTL$GQ_ISTART 
IACSGL_IMAGE LIST, ICB 

#6, 16(ICB), 8$ 

#64, 16(ICB) 

84(ICB), KFE 

8$ 

20 (KFE) 

#3, 16(KFE), 8$ 

24(KFE), WCB 

14(WCB), 52(KFE) 

8S 

14(WCB), 52 (KFE) 

(ICB), ICB 

IACSGL_IMAGE LIST, RO 

ICB, RO 

7$ 


DIGITAL INTERNAL USE ONLY 183 


stem Service 10-May-1989 16:11:13 VAX Bliss- 


se Se ‘Se Ne Ne 


™e “Te Te Ws 


Se Te Me 


se Se Ye Be “e Ne 


we 


~e Se Se Fe Me Me MA Ye Ne 


-e 


se Ne 


“se 


we Ye Ye Ve Ve 


™e “Ne Ye Re Se Se We Ye Wo We We Te Ye No 


me Ye Ge YW XD Ve 


_$25 


2388 
2389 
2394 
2398 


2403 
2406 


2408 
2412 


2413 


2416 


2425 
2427 


2430 
2431 
2436 


2437 
2441 
2446 


2449 
2450 
2451 
2452 
2453 
2454 
2455 
2456 
2458 
2469 
2477 
2480 
2481 
2482 
2485 
2486 
2489 
2490 


2491 
2495 
2497 


CONFIDENTIAL AND PROPRIETARY | 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 56 . 


X-14 SET_CONTROL_ REGION - Kernel Mode Completion Rou 10-Apr-1989 10:48:52 
2C AS DO 00140 MOVL OWN _STORAGE+44, RO ; 
07 13 00144 BEQL 9$ ? 
50 DO 00146 MOVL RO, CTL$GL_RMSBASE ; 
01 DO 0014D 98: MOVL #1, RO ? 
04 00150 RET ; 


7 Routine Size: 337 bytes, Routine Base: EXECSPAGED_CODE + O8Fc 


184 DIGITAL INTERNAL USE ONLY 


_$25 
2499 


2500 
2502 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16: 11:13 VAX Bliss- 


32 V4.5-862 Page 57 


X-14 


me Ye Be Ye Ne Ye Ye Ve We Yo Ye We Be We Ye Yo Ye Ve Ye Ve Ye Ye We Ne Be Ne We We Ve We Ye We We Yo We Ne Ne Ye We Ye Woe Vo Be Ve 


2506 
2507 


2508 


2509 
2510 
2511 
2512 
2513 
2514 
2515 
2516 
2517 
2518 
2519 
2520 
2521 
2522 
2523 
2524 
2525 
2526 
2527 
2528 
2529 
2530 
2531 
2532 
2533 
2534 
2535 
2536 
2537 
2538 
2539 
2540 
2541 
2542 
2543 
2544 
2545 
2546 
2547 
2548 
2549 


?; 9 Uy VU ID Ig 


FP NNN WWWWWWWWWWWUuWWWWnNNNNHN AN BPP RPE RP PR PP ee Pe ee ee 


GET LOCK - Lock Known File Data Base for Read A 10-Apr-1989 10:48: 52 /  _$25 
%SBTITL ‘GET LOCK ~- Lock Known File Data Base for Read Access’ 


ROUTINE GET LOCK = 


+ 


Functional Description: 


This routine locks the known file data base for read access. The image 
activator maintains this lock for the entire time that it will be openi 
files. Note that no lock is taken out during system initialization. unt 
INSTALL first executes and sets up the known file lists (and loads 
EXESGL_KNOWN FILES with nonzero contents. 


Calling Sequence: 


GET LOCK () 


<> Com Com com cam co cam ca Cc com ccm com com 


BEGIN 
LOCAL STATUS; 


IF .EXE$GL KNOWN FILES NEQ 0 
THEN 
BEGIN 


STATUS = SENQW ( 
EFN = EXESC_SYSEFN, 
LKMODE = LCKSK_PRMODE, 
LKSB = OWN STORAGE [LOCK_STATUS BLOCK], 
FLAGS = LCKSM | SYSTEM, 
RESNAM = EXE$GOQ | KFE LCKNAM, 
PARID = -EXESGL _ SYSID ) LOCK, 
ACMODE = PSL$C_EXEC) ; ! End of routine GET_LOCK 

IF NOT .STATUS 

THEN RETURN .STATUS 

ELSE RETURN .OWN STORAGE [LOCK_STATUS]; 


END 
ELSE ! No need to take out a lock yet 
RETURN SS$_ NORMAL 


END; 


-EXTRN SYSSENQW 


0004 00000 GET_LOCK: 


00000000G 00 
00000000G 00 


2A 
01 
TE 
TE 


«WORD Save R2 3; 2508 
9E 00002 MOVAB OWN STORAGE+4, R2 ; 
D5 00009 TSTL EXESGL_ KNOWN FILES 3; 2528 
13 OOO0OF BEQL 1$ ; 
7D 00011 MOVQ #1, ~-(SP) ? 2539 
7¢ 00014 CLRQ - (SP) ; 
D4 00016 CLRL - (SP) ; 


DIGITAL INTERNAL USE ONLY = 185 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5~-862 Page 58 
X-14 


00000000G 00 

00000000G 00 
10 
52 
03 
00G 
OB 
50 
62 


01 


3; Routine Size: 


186 DIGITAL INTERNAL USE ONLY 


GET_LOCK - Lock Known File Data Base for Read A 10-Apr-1989 10:48:52 


DD 
oF 
DD 
DD 
DD 
9A 
FB 
E9 
3c 
04 
DO 
04 


00018 
OOOlE 
00024 
00026 
00028 
0002A 
0002D 
00034 
00037 
0003A 
0003B 18: 
OO03E 2$: 


63 bytes, 


PUSHL  EXE$GL_SYSID_LOCK 
PUSHAB EXE$GQ_KFE LCKNAM 


PUSHL #16 
PUSHL R2 
PUSHL #3 


MOVZBL S“*EXESC_SYSEFN, ~-(SP) 
CALLS #11, SYSS$ENQW 

BLBC STATUS, 2$ 

MOVZWL OWN STORAGE+4, RO 
RET ae, 

MOVL #1, RO 

RET 


Routine Base: EXECSPAGED_CODE + OA4D 


re Se Ne Te Ve Ve “We Ye Te Ye Yo Ye 


_$25 


2541 
2543 


2547 


CONFIDENTIAL AND PROPRIETARY __ 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 59 
X-14 RELEASE LOCK - Unlock Lock Known File Data Base 10-Apr-1989 10:48:52 _8§25 


; 2551 1 %SBTTL 'RELEASE_LOCK - Unlock Lock Known File Data Base’ 
; 2552 1 
? 2553 1 ROUTINE RELEASE LOCK = 
; 2554 1 
: 2555 1 1+ 
; 2556 1 ! Functional Description: 
: 2557 1 ! 
3 2558 1 ! This routine unlocks the known file data base. This happens when 
3 2559 1 ! the image activator reaches the point where there are no more files 
: 2560 1 j to open, or when an error occurs with the lock granted. 
? 2561 1 ! 
? 2562 1 ! Calling Sequence: 
F) 2563 1 ! 
> 06 - 2564 1 ! RELEASE _LOCK () 
; 2565 1 {- 
2 2566 1 
; 2567 1 IF .OWN STORAGE [LOCK_ID]} NEQ 0. 
3; 2568 1 THEN 
; 2569 2 SDEQ (LKID = .OWN_STORAGE [LOCK_ID]) 
7; 2570 1 ELSE . 
? 2571 #1 SS$_NORMAL; 1 End of routine RELEASE_LOCK 
-EXTRN SYSSDEQ 
0000 00000 RELEASE LOCK: 
-WORD Save nothing 7. 2553 
00000000G 00 DO 00002 MOVL OWN_STORAGE+8, RO 7 2567 
OE 13 00009 | BEQL 1s ; 
7E 7C 0000B CLRQ - (SP) 7 2569 
7E D4 O0000D CLRL. - (SP) ; 
50 DD OOOOF PUSHL RO ; 
04 FB 00011 CALLS #4, SYSS$DEQ ; 
04 00018 RET 2 
01 bo 00019 15S: MOVL #1, RO 3 2571 
04 0001C RET 
; Routine Size: 29 bytes, Routine Base: EXECSPAGED_CODE + OA8C 


DIGITAL INTERNAL USE ONLY 187 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 60 


X-14 


2573 
2574 
2575 
2576 
2577 
- 2578 
2579 
2580 
2581 
2582 
2583 
2584 
2585 
2586 
2587 
2588 
2589 
2590 
2591 
2592 
2593 
2594 
2595 
2596 
2597 
2598 
2599 
2600 
2601 
2602 
2603 
2604 
2605 
2606 
2607 
2608 
2609 
2610 
2611 
2612 
2613 
2614 
2615 
2616 
2617 
2618 
2619 
2620 
2621 
2622 
2623 


Re Ne Se Ne Ne Ne Te Te Te Ye Ne Ye Te Te Ve Ye Se Yeo Ne Yo Te Te Be Ne Ve Te Ne Ye Ye Ye Yo Ye Ye Ve Ve Se Ne Ye Ne Yo Ye Ye Ye Te Ne Se Ye Ne Ye Ye Ve 


BPNNNNNNNNNNNNNNNNNEF PB EE RKP BE PP BP PRP EPP BP eB ee ee ee oe 


IMGSALLOCATE_ICB - Lock Known File Data Base fo 10-Apr-1989 10:48:52 | _$25 
%SBTTL '‘IMGSALLOCATE_ICB - Lock Known File Data Base for Read Access’ 


GLOBAL ROUTINE IMGSALLOCATE_ICB (ICB POINTER) = 


+ 


Functional Description: 


ICB is entirely filled with zeros. 


Calling Sequence: 
IMGSALLOCATE_ICB (ICB_ POINTER) 


Formal Parameter: 


allocated image control block. 
Status Return: 
SS$_NORMAL - ICB successfully allocated 


SS$_INSFMEM - Unable to allocate ICB 


com Cem cm Cem cm Cam fm em ce Cem Cam cam Cam com cam Com cam cam com cam Cem Cam com Com com cam com cap 


BEGIN 


LOCAL 
SIZE, 
ICB : REF $BBLOCK; 


IF REMQUE (.IACSGL_ICBFL, ICB) 

THEN IF NOT EXESALOP1PROC (ICB$K_LENGTH; SIZE, 
THEN RETURN SS$_INSFMEM; 

CHSFILL (0, ICB$K_LENGTH, .ICB); 

ICB [ICBSW_SIZE] = ICB$K_LENGTH; 

ICB [ICB$B_TYPE] = ICB$K_ICB TYPE_CODE; 

ICB [ICB$L_STARTING ADDRESS] = -1; 

ICB [ICB$L_END ADDRESS] = -1; 

-ICB_POINTER = .ICB; 

RETURN SS$_NORMAL; 


END; 


188 DIGITAL INTERNAL USE ONLY 


This routine allocates an image control block for use by later stages 
of the image activator. An allocation request is first made from a 
pool of previously used ICBs. A trip into kernel mode is thus only 
required if this lookaside list request fails. In ot ther case, the 


Note that only the process allocation region is used to insure that 
no ICBs are created in PO space. This would be no problem on merged 
activations but would mess up the simple execution of an image. 


ICB_POINTER - Address of cell that will receive the address of a newly 


ICB) 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5~-862 Page 61 


X-14 IMGSALLOCATE_ICB = Lock Known File Data Base fo 10-Apr-1989 10:48:52 
007C 00000 -ENTRY IMGSALLOCATE_ICB, Save R2,R3,R4,R5,R6 ? 
00000000G 00 9£ 00002 MOVAB IACSGL_ICBFL, RO ; 
00 =6©BO OCOF «00009 REMQUE @0(RO), ICB ; 
16 1¢ 0000D BVC 1$ ; 
68 8F 9A OOOOF MOVZBL #104, Ri ; 
00000000G 00 16 00013 JSB EXESALOP1PROC ; 
52 DO 00019 MOVL R2, R6 ; 
50 E8 0001C BLBS RO, 1$ ; 
0124 8F 3C O001F MOVZWL #292, RO ; 
04 00024 RET ; 
00 2C 00025 18: MOVC5S #0, (SP), #0, #104, (ICB) ; 
66 0002Cc ; 
68 8F 9B 0002D MOVZBW #104, 8(ICB) ; 
7F 8F 90 00032 MOVB #127, 10(ICB) ; 
01 CE 00037 MNEGL #1, 72(ICB) ; 
01 CE 0003B MNEGL #1, 76(ICB) ; 
56 DO 0003F MOVL ICB, @ICB_POINTER ; 
01 DO 00043 MOVL #1, RO ; 
04 00046 RET ; 


7 Routine Size: 71 bytes, Routine Base: EXECS$PAGED CODE + OAA9 


DIGITAL INTERNAL USE ONLY 189 


_$28 
2575 
2612 


2613 


2614 
2615 


2616 
2617 
2618 
2619 
2620 
2621 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


32 V4.5-862 Page 62 


190 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


X-14 


se Se Be 


™e Ve Me Ne Ne Ve Te Veo Se Ye Ye Yea Ne Ye Ye Ye Ye Be Ve Ve 


we Te Se Ye Neo Me Be Ve Be Ve Ve Ve Te We Ve Te Ye Ve Ys Ve Ne 


2625 
2626 
2627 
2628 
2629 
2630 
2631 
2632 
2633 
2634 
2635 
2636 
2637 
2638 
2639 
2640 
2641 
2642 
2643 
2644 
2645 
2646 
2647 
2648 
2649 
2650 
2651 
2652 
2653 
2654 
2655 
2656 
2657 
2658 
2659 
2660 
2661 
2662 
2663 
2664 
2665 
2666 
2667 
2668 


04 


00000000G 


08 
00000000G 


BPNNNNNNNNANNNHP HP EE EP BP BEEP RP RP EP RP EP BP Pe PP ee Pe BP eee eee 


AC 
06 
00 
60 


AO 
00 


IMGSDEALLOCATE_ICB - Deallocate an Unused ICB 10-Apr-1989 10:48:52 _$25 
%SBTTL ‘IMGSDEALLOCATE ICB - Deallocate an Unused ICB’ 


GLOBAL ROUTINE IMG$DEALLOCATE ICB (ICB) : NOVALUE = 


! Functional Description: 


This routine deallocates an ICB that was not used. This can be due to 
one of three reasons: 


The current image is being rundown, thus releasing all of its 
image control blocks back to pool. 


An ICB was allocated during image activation for an image that 
has already been activated. 


! 

! 

! 

! 

! 

! 

t 

! 

' 

! 

! 

! An error occurred, requiring that all images activated during the 
! current call be eliminated. 

t 

! If the ICB was allocated from Pl space, it is deallocated to a linked 
! list of free ICBs that will be used during later activations. ICBs 

! allocated from PO space use the normal deallocation routine. 

! 

! Calling Sequence: 

! 

! IMGSDEALLOCATE_ICB (ICB_ ADDRESS) 

t 
! 
! 
t 
! 


! Formal Parameter: 


ICB_ADDRESS - Address of ICB that is being deallocated 


BEGIN 
MAP 

ICB : REF $BBLOCK; 
BIND VA = ICB : S$BBLOCK; 


IF .VA [VASV_P1] 
THEN INSQUE (.ICB, .IACSGL_ICBFL [1]) ! Insert at tail of lookaside list 
ELSE EXESDEAP1 (.ICB, .ICB [ICBSW_SIZE]); 


END; 

000c 00000 -ENTRY IMGSDEALLOCATE_ICB, Save R2,R3 3? 2627 
DO 00002 MOVL ICB, RO ? 2665 
El 00006 BBC #6, VA+3, 1$ 3 2664 
9E 0000B MOVAB IACS$GL_ICBFL+4, R1 ? 2665 
OE 00012 INSQUE (RO), @0(R1) ; 
04 00016 RET ; 
3C 00017 18: MOVZWL 8(RO), R1 7 2666 
16 0001B JSB EXESDEAP1 3 


DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 63 
X-14 IMGSDEALLOCATE_ICB - Deallocate an Unused ICB 10-Apr-1989 10:46:52 _$25 


04 00021 RET 7. 2668 
3 Routine Size: 34 bytes, Routine Base: EXECSPAGED_CODE + OAFO 


DIGITAL INTERNAL USE ONLY 191 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 64 


X-14 


Se Ne Te Te Ve Ye Yeo Ye Ve Ye Ve Ne Ye Ye Ye Yo Ye Yeo Ve Ye Se Ye Ye Ye Ye Ye Yo Be Yeo Ye Ne Ye Yo We Yo Vo me Ye Te Te Ye Be Ye Be Ye Bea Ye We Ve Ve Ve Ve Ve Ye Vo Ya Ve 


2670 
2671 
2672 
2673 
2674 
2675 
2676 
2677 
2678 
2679 
2680 
2681 
2682 
2683 
2684 
2685 
2686 
2687 
2688 
2689 
2690 
2691 
2692 
2693 
2694 
2695 
2696 
2697 
2698 
2699 
2700 
2701 
2702 
2703 
2704 
2705 
2706 
2707 
2708 
2709 
2710 
2711 
2712 
2713 
2714 
2715 


2716 


2717 
2718 
2719 
2720 
2721 
2722 
2723 
2724 
2725 
2726 


PALL WWWWWWWWWNNNNNNNNNNNDDA 6 FB Me ee ee eee oe oe ot et ee 


-SET_VECTORS ~- Prepare privileged vectors for ex 10-Apr-1989 10:48:52 _$25 
%SBITL ‘SET VECTORS - Prepare privileged vectors for execution’ 


ROUTINE SET VECTORS = 


+ 


Functional Description: 


This routine takes the privileged vector entries that contain RSB 
instructions and replaces each with a JSB instruction. 


Calling Sequence: 
SET VECTORS () 
Input Parameters: 
none 
Implicit Input: 
IACSAW_VECSET - Array that locates the dividing point in each vector 
list between those vectors that already existed and those that were 
added as part of the latest activation. This is the starting point f 
the search. 
CTLSA_DISPVEC - This address locates the start of the three-page area 
containing the privileged vectors. The first longword of each area 


contains the current end of the vector list. This is the end point f 
the search. 


eam com Fn Cem com cam Cam Cem cam Co Cam CO cam com cum com Cem Cam Cam cam cam Co com Com cam cam 


BEGIN 


LITERAL 
ABSOLUTE MODE = %X’ 9F’, 
JSB_ABSOLUTE (ABSOLUTE_MODE “ 8) OR OPS$_JSB : UNSIGNED (16), 
RSB_ ABSOLUTE (ABSOLUTE_MODE “ 8) OR OP$_RSB : UNSIGNED (16); 


! Do the privileged vectors first 


INCRU I FROM 0 TO 3 DO 
BEGIN 


BIND 
END_POINT = CTLSA_DISPVEC + 
DISPVEC = CTLSA_DISPVEC + ( 


(.I * 256) : LONG, 
-I * 256) : VECTOR [256, BYTE]; 


J = .IACSAW_VECSET [.I]; 
WHILE .J LSSU .END POINT DO 


BEGIN 


BIND OPCODE = DISPVEC [.J] : WORD; 


192 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 65 
X~-14 SET_VECTORS - Prepare privileged vectors for ex 10-Apr-1989 10:48:52 _$25 


; 2727 4 IF .OPCODE EQLU RSB_ ABSOLUTE 
; 2728 4 THEN OPCODE = JSB_ABSOLUTE; 
; 2729 4 
; 2730 4 J = .J + 6; 
; 2731 4 
; 2732 3 END; 
; 2733 3 
; 2734 3 IACSAW_VECSET [.I] = .END_ POINT; 
? 2735 3 
; 2736 2 END; 
; 2737 2 
; 2738 2 ! Now do the message sections 
; 2739 2 
; 2740 2 IACSAW_VECSET [4] = .(CTLSA_DISPVEC + MESSAGE_OFFSET) ; 
; 2741 2 
; 2742 2 RETURN SS$_NORMAL; 
; 2743 2 
; 2744 #1 END; 
000C 00000 SET_ VECTORS: 
WORD Save R2,R3 # 2672 
50 D4 00002 CLRL I ? 2713 
08 78 00004 1$: ASHL #8, I, R1 # 2717 
00000000G0041 9E 00008 MOVAB CTLSA_DISPVEC[R1], R1 ; 
0000000060040 3E 00010 MOVAW IACSAW_VECSET[I], R2 7 2720 
~ 62 3¢ 00018 MOVZWL (R2), J ; 
53 D1 0001B 28: CMPL J, (R1) # 2721 
17 1E OOO1E BGEQU 4s : 
6341 9F 00020 PUSHAB (J) [R1] * 2727 
9E Bl 00023 CMPW @(SP)+, #40709 ; 
08 12 00028 BNEQ 3$ ; 
6341 9F OO002A PUSHAB (J) [R1] * 2728 
9F16 8F BO 0002D MOVW #-24810, @(SP)+ ; 
06 CO 00032 3S: ADDL2 #6, J # 2730 
E4 11 00035 BRB 2$ ; 
61 BO 00037 45S: MOVW (R1), (R2) 7 2734 
50 D6 0003A INCL I ? 2713 
50 D1 0003C CMPL I, #3 ; 
C3 1B 0003F BLEQU 1$ ; 
00000000G 00 BO 00041 MOVW CTLSA_DISPVEC+1024, IACSAW_VECSET+8 + 2740 
01 DbDO 0004C MOVL #1, RO 7 2742 
04 0004F RET ; 
7 Routine Size: 80 bytes, Routine Base: EXECS$PAGED_CODE + 0B12 


DIGITAL INTERNAL USE ONLY 193 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 66 


X-14 


2746 
2747 
2748 
2749 
2750 
2751 
2752 
2753 
2754 
2755 
2756 
2757 
2758 
2759 
2760 
2761 
2762 
2763 
2764 
2765 
2766 
2767 
2768 
2769 
2770 
2771 
2772 
2773 
2774 
2775 
2776 
2777 
2778 
2779 
2780 
2781 
2782 
2783 
2784 
2785 
2786 
2787 
2788 
2789 
2790 
2791 
2792 
2793 
2794 
2795 
2796 
2797 
2798 
2799 
2800 
2801 
2802 


me Ye Se Se Ve Ve Ye Ve Te Ye Ye Vo Ve Ye Ve Te Ye Ve Veo 


we Se Ye Ye Ye Pe Ve Ve Ve Ve Ve Ve Ye Yo Ye Yo 


™e Ve Ye ' Ne Ve Re Ve Ye We Ve Ve Ve oe 


=e Te Ne “Ne Se Se Ye Xe 


we 


NNNNNNNNNANN KB EP EB PB BR BE RP ee PP BPE Eee ee BRP EP BP EP EPP RP Pe Pe ee eee ee ee ee 


ERROR_CLEAN UP - Clean Up after an Error is Det 10-Apr-1989 10:48:52 _$25 
%SBTTL ‘ERROR CLEAN UP - Clean Up after an Error is Detected’ 


ROUTINE ERROR CLEAN UP : NOVALUE = 


+ 


Functional Description: 


This routine cleans up when an error is detected after some successful 
work has been completed. 


All ICBs on the WORK list are simply deallocated. 
ICBs that exist on the IMAGE (so-called done) list with the DONE bi 
clear indicate images that have been successfully activated as a pa 
of this activation before an error was detected. 
The address space associated with these images is deleted. 
The channel on which each image file was opened is closed. 
Each ICB is then deallocated. 
ICBs on the IMAGE list with the DONE bit clear must have their 
ACTIVE_SONS field reset. This is non-zero if some referenced image 
(a son) has not yet been fully processed. If we didn’t clear it, 
on a later mapping attempt we might report a false circularity. 


Note that an ICB with the addresses mapped bit not yet set will 
not have any address space deleted. 


Calling Sequence: 
ERROR_CLEAN UP () 

Formal Parameters: 
none 

Implicit Input: 


IAC$GL_IMAGE LIST - List of ICBs representing images that have been 
successfully activated 


IAC$GL_WORK_ LIST - List of ICBs representing work left to be done. 


en ee ee ee ee ee ee ed 


BEGIN 
LOCAL 
ICB : REF $BBLOCK, 
NEXT_ICB : REF $BBLOCK; 
! Simply deallocate the ICBs in the work list 


WHILE NOT (REMQUE (.IACSGL_WORK_LIST, ICB)) DO 
IMGS$DEALLOCATE_ICB (.ICB); 


194 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY i 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5~-862 Page 67 
X-14 ERROR_CLEAN_UP ~- Clean Up after an Error is Det 10-Apr-1989 10:48:52 _825 


; 2803 2 ! Traverse the done list, looking for ICBs with the done bit not yet set. 
; 2804 2 
? 2805 2 NEXT_ICB = - IACSGL_IMAGE_LIST; 
; 2806 2 
; 2807 2 WHILE .NEXT_ICB NEQA IACS$GL_ IMAGE_LIST DO 
; 2808 2 IF .NEXT_ ICB [ICBSV DONE] 
3 2809 2 THEN 
; 2810 3 BEGIN 
; 2811 3 NEXT_ICB [ICB$L_ACTIVE_SONS] = 0; ! Must be reset if error occurred 
; 2812 3 NEXT_ IcB = NEXT _| ICB [IcB$L » FLINK] ; 
; 2813 3 END 
; 2814 2 ELSE 
; 2815 3 BEGIN 
? 2816 3 REMQUE (.NEXT_ICB, ICB); 
; 2817 3 IF .ICB {ICBS$V_MAPPED] 
;? 2818 3 THEN ; 
3; P 2819 3 SDELTVA ( 
3 P 2820 3 INADR = ICB {ICB$Q_ADDRESS_ RANGE], 
? 2821 3 ACMODE = .OWN STORAGE [ACCESS MODE]) ; 
; 2822 3 
? 2823 3 SDASSGN (CHAN = .ICB [ICBSW | CHAN] ) 7 
; 2824 3 NEXT_ICB = .ICB {ICBSL _ FLINK]) ; 
‘7 2825 3 IMGS$DEALLOCATE__ ICB (.ICB)?; 
; 2826 2 END; 
; 2827 2 
; 2828 2 IACSGL_IMAGCTX [IMAGCTX$V_SETVECTOR] = FALSE; 
; 2829 2 
; 2830 1 END; 
-EXTRN SYSSDELTVA 
001c 00000 ERROR CLEAN UP: 2 
- WORD Save R2,R3,R4 3 2748 
00000000G 00 9E 00002 MOVAB IACS$GL_IMAGE LIST, R4 ; 
00000000G 00 9E 00009 18: MOVAB TACSGL_} WORK LIST, RO ¢ 2800 
00 BO OF 00010 REMQUE @0 (RO), ICB ; 
09 1D 00014 BVS 2$ ; 
52 DD 00016 PUSHL IcB 3 2801 
01 FB 00018 CALLS #1, IMGS$DEALLOCATE_ICB ; 
EA 11 0001D BRB 1$ ; 
64 DO OOO1F 2S: MOVL IACS$GL_ IMAGE LIST, NEXT_ICB 3; 2805 
64 9E 00022 358: MOVAB IACSGL _ IMAGE | LIST, RO 3 2807 
53 D1 00025 CMPL NEXT_ICB, RO ; 
3E 13 00028 BEQL 6$ ; 
O06 E1 OO002A BBC #6, 16(NEXT_ICB), 4$ : 2808 
64 A3 D4 0002F CLRL 100 (NEXT_ICB) 3 2811 
63 DO 00032 MOVL (NEXT_ICB), NEXT_ICB 3 2812 
EB 11 00035 BRB 3$ 3 
63 OF 00037 45S: REMQUE (NEXT_ICB), ICB 3; 2816 
01 E1 OOO3A BBC #1, 17(1CB), 5$ 7 2817 
00000000G 00 DD O0003F PUSHL OWN_STORAGE+100 7 2821 
7E D4 00045 CLRL - (SP) ; 
48 A2 9F 00047 PUSHAB 72(ICB) ; 
03 FB OOO4A CALLS #3, SYSSDELTVA Fi 
OE A2 3c 00051 58: MOVZWL 14(ICB), -(SP) 3 2823 


DIGITAL INTERNAL USE ONLY 195 


CONFIDENTIAL AND PROPRIETARY 


DIGITAL EQUIPMENT CORPORATION 


SYS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 68 
X-14 


01 
62 
52 
01 
BA 
01 


3; Routine Size: 


196 DIGITAL INTERNAL USE ONLY 


ERROR_CLEAN_UP - Clean Up after an Error is Det 10-Apr-1989 10:48:52 


FB 00055 
DO 0005C 
DD OO0OS5F 
FB 00061 
11 00066 
8A 00068 
04 OO06F 


6$ 


112 bytes, 


CALLS 
MOVL 
PUSHL 
CALLS 
BRB 
BICB2 
RET 


#1, SYS$DASSGN 
(ICB), NEXT_ICB 

IcB 

#1, IMGS$DEALLOCATE_ICB 
3$ | 

#1, IAC$GL_IMAGCTX+2 


Routine Base: EXECSPAGED CODE + OB62 


™e Me Ne Ne Ne Ne Me 


_$25 


2824 
2825 


2807 
2828 
2830 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May~1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 69 


X~-14 


we Se Ne Me Ne Ye Ne Ne Te Ne Te Ye Ye Ye Be Te Ve Ye Ne “oe Se Ye Te Ye Ye Ne Ne Yo Ne Ye Ne Ye Ne Ye Ye Se Te Ne Ve Ne Ve Ve Ve Te Ye Ne Te Te Ve Ne Ne Ye 


me Ye Ye Ne Ne 


2832 
2833 
2834 
2835 
2836 
2837 
2838 
2839 
2840 
2841 
2842 
2843 
2844 
2845 
2846 
2847 
2848 
2849 
2850 
2851 
2852 
2853 
2854 
2855 
2856 
2857 
2858 
2859 
2860 
2861 
2862 
2863 
2864 
2865 
2866 
2867 
2868 
2869 
2870 
2871 
2872 
2873 
2874 
2875 
2876 
2877 
2878 
2879 
2880 
2881 
2882 
2883 
2884 
2885 
2886 
2887 
2888 


NNNNNNNNNNEFP RP RP EP PEP RP BP RRP EPP PP PP eee eee eP Pe Pe Pee BEB ee PP ee eee eee 


GET_OTHER_ IMAGE ~ Open Primary Image File 10-Apr-1989 10:48:52 _$25 
SSBTTL ’GET_OTHER_IMAGE - Open Primary Image File’ 


ROUTINE GET OTHER_IMAGE (ICB) = 


ee ee ee ee ee ee ee ee ee ee ae ee ee 


+ 


Functional Description: 
This routine is called when the image passed to the image activator is 
really the image that should be activated. This situation occurs in the 
case of compatibility mode images and other specialized cases. The gene 
operation of this routine is as follows. 


Information about the original image is stored in various places sc 
that it is available to the image that eventually gets activated. 


A new image name is selected based on the alias code. 
This new image file is opened and its header decoded. 


Activation continues with the secondary image replacing the original in 
as the target of activation. 


Calling Sequence: 
GET_OTHER_IMAGE (ICB address) 
Input Parameter: 
ICB - Address of image control block that describes the primary image 
Output Parameters: 
none 
Implicit Output: 
The image name of the primary image is stored in the compatibility mode 
data page. The channel on which the primary image is opened (and its KF 
address if any) is stored for later return to the caller. 
Assumption: 
This routine can only be called from the main loop in the image activat 


This means that the primary buffers (FAB, NAM, IHD, etc.) describe the 
original image. 


BEGIN 
MAP 
ICB : REF $BBLOCK; 
BIND 
IHD CTX = .ICB [ICBS$L_CONTEXT] : S$BBLOCK, 
ICB_ NAME = ICB [ICBST_IMAGE_ NAME] : VECTOR [, BYTE], 
FAB = PRIMARY FAB : $BBLOCK, 
NAM = PRIMARY NAM : $BBLOCK, 


DIGITAL INTERNAL USE ONLY 197 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May~1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 70 


X-14 


2889 
2890 
2891 
2892 
2893 
2894 
2895 
2896 
2897 
2898 
2899 
2900 
2901 
2902 
2903 
2904 
2905 
2906 
2907 
2908 
2909 
2910 
2911 
2912 
2913 
2914 
2915 
2916 
2917 
2918 
2919 
2920 
2921 
2922 
2923 
2924 
2925 
2926 
2927 
2928 
2929 
2930 
2931 
2932 
2933 
2934 
2935 
2936 
2937 
2938 
2939 
2940 
2941 
2942 
2943 
2944 
2945 


Re Me Ne te Me Ne Me Me Ne Te Me Ne Ne Te Ve Ye Be Ve Ve Ws Wo Ve Ve Ve Ve Ve Ne Ye Ye Ve Ye Ve Ve Vo Ve Ve Te Ve Te Ye Te Ve Ve Ve Ye Yo Ye Veo Veo 


=e te Ye Ne 


™e Ne 


se Me 


NNNNNNNNHNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN 


GET_OTHER_IMAGE - Open Primary Image File 10-Apr-1989 10:48:52 _$25 
STORED NAME = CTLSAG_CMEDATA : VECTOR [, BYTE); 


! The image name for a type 2 image is stored in the last 126 bytes of the 
! first block of the image header as a counted ASCII string. 


MAP 3 
INPUT_BUFFER | : VECTOR [512, BYTE]; 


BIND 

TYPE_2 IMAGE NAME = 

INPUT _BUFFER [512 - 128] : VECTOR [128 - 2, BYTE]; 

! Three of the four cases handled by this routine activate specific images 
! whose names are listed here. (The fourth case extracts the image name fron 
! the end of the first block of the image header.) 
BIND 

RSX_NAME = SDESCRIPTOR (‘RSX’), 

BPA_NAME = SDESCRIPTOR (‘BPA’), 

LOGIN NAME = $DESCRIPTOR (’ LOGINOUT’), 

! All four cases use SYSS$SYSTEM as the default directory string 

SYSTEM_NAME = $DESCRIPTOR (’SYS$SYSTEM: .EXE’ ) ; 
LOCAL 

NEW_IMAGE NAME, 

NEW_ IMAGE - NAME | DESC : $BBLOCK [DSC$K_S_BLN], 

STATUS; 


OWN STORAGE [OTHER_CHANNEL] = .ICB [ICBSW_CHAN] ; 
OWN | STORAGE [OTHER _| KFE ADDRESS] = .FAB [FABSL CTX); 


! Now perform the steps that are specific to the type of other image that is 
! being selected. The name of the image to activate is the most important 
! part of this step. 
CASE .IHD CTX [CTX_W_ALIAS] FROM IHD$C_RSX TO IHD$C_CLI OF 
SET 
[IHD$C_RSX] : 


! This is an image produced by the RSX-11M task builder. Activate 
! SYSS$SYSTEM:RSX.EXE in its stead. 


NEW_IMAGE NAME = RSX_NAME; 
[IHDSC_BPA]: 


! There is no supported way that this type of image can be created. 
! will activate SYSS$SYSTEM:BPA.EXE anyway and let the chips fall ... 


NEW_IMAGE NAME = BPA NAME; 


[IHD$C_ALIAS]: 


198 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


32 V4.5-862 Page 71 


X-14 


™e Te Ye Ye Be Yo We Ye Be 


™e Ye Ne Ye Be Te eo 


me Se Ne Se Be Be Ye Ve We Ye We No We Ye Yo We Ye Ve Ve We We We Ve 


we Te Ye Be Ve Se Ve We Ye Ne Ve Be Ve Wo 


Ne Ne Ne 


=e 


2946 
2947 
2948 
2949 
2950 
2951 
2952 


2953 


2954 
2955 
2956 
2957 
2958 
2959 
2960 
2961 
2962 
2963 
2964 
2965 
2966 
2967 
2968 
2969 
2970 
2971 
2972 
2973 
2974 
2975 
2976 
2977 
2978 


2979 


2980 
2981 
2982 
2983 
2984 
2985 
2986 
2987 
2988 
2989 
2990 
2991 
2992 
2993 
2994 
2995 
2996 
2997 
2998 
2999 
3000 
3001 
3002 


WWWWNHNNNNNNNHNNNNNNNNNNNNNWWWWWWNNNNNNNNNNNNNHWWWWWWWDNNNNN ND 


GET_OTHER_IMAGE - Open Primary Image File 10-Apr-1989 10:48:52 _$25 


! This is a special form of image that contains the name of a second 
! image in the last 128 bytes of the first block of the image header 
! (The actual name is restricted to 125 bytes because the last word 
! of the first block is reserved to contain the code word and the 

! string contains a count byte.) 


BEGIN 


NEW_IMAGE_NAME DESC [DSCSW_LENGTH] = .TYPE_2 IMAGE NAME [0]; 
NEW _ IMAGE | NAME | __DESC [DSCSA | _ POINTER] = TYPE se _IMAGE | _NAME [1); 


NEW_IMAGE_NAME = NEW IMAGE NAME DESC; 
END; 
[IHD$C_CLI]: 


The image is a command language interpreter whose name was passed 
the Create Process system service. If this is the activation of a 
program (and not a merged activation, the usual way to put a CLI i 
Pl space), we will activate SYS$SYSTEM: LOGINOUT.EXE. In this case, 
will close the CLI image file first (by deassigning the channel) § 
LOGINOUT uses a more restrictive form of SOPEN than occurred above 


IF .OWN STORAGE [MAIN PROGRAM] 
THEN 
BEGIN 


SDASSGN (CHAN = .ICB [ICB$W_CHAN}); 
NEW_IMAGE_NAME = LOGIN NAME; 


END 
ELSE 
RETURN SS$_NORMAL; 
{[OUTRANGE] : 
RETURN SS$_BADIMGHDR; 
TES; 


! Any context established by the original image must be cleared before 
! the activation continues. 


ICB [ICBSL_FLAGS] = 0; ! Clear previous activation flags 
ICB [ICB$L_IHD] = 0; ! Clear pointer to resident header 
IHD CTX [CTX_L_IHDBUF] = PRIMARY_IHD; ! Reestablish IHD buffer 


! If the primary image was a CLI (type 3), only the file name is stored. In 
! all other cases, the entire resultant (or expanded) string is stored. 


IF .IHD CTX [CTX_W ALIAS] EQL IHD$C_CLI 
THEN 
BEGIN 
STORED NAME [0] = .NAM [NAMSB_NAME]; 
CHSMOVE (.STORED NAME [0], .NAM [NAMSL NAME], STORED_NAME [1]); 
END 


DIGITAL INTERNAL USE ONLY 199 


CONFIDENTIAL AND PROPRIETARY | 
DIGITAL EQUIPMENT CORPORATION 


32 V4.5-862 Page 72 


200 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 


we Ye Ye Ye Be Ye Ve We Ve Ye Ve Ye Yo Ye Ye Ve Be We Ve Ye We We Yeo Ye Yo Ve 


X-14 GET_OTHER_IMAGE - Open Primary Image File 10-Apr-1989 10:48:52 _$25 
3003 2 ELSE 
3004 3 ' BEGIN 
3005 3 STORED NAME [0] = .NAM (NAMS$B_RSL]; 
3006 3 CHSMOVE (.STORED NAME [0], .NAM [NAMS$L_RSA], STORED NAME [1)); 
3007 2 END; 
3008 2 , 
3009 2 ! Open the secondary image file, decode the image header, and resume process 
3010 2 ! in the main routine as if the secondary image were the one selected for 
3011 2 ! activation. 
3012 2 
3013 2 ICB_NAME [0] = 0; ! Force a new name to be stored in I 
3014 2 
3015 2 STATUS = IMGSOPEN_IMAGE ( ! Open the image file 
3016 2 -NEW_IMAGE NAME, 
3017 2 SYSTEM_NAME, 
3018 2 PRIMARY _FAB, 
3019 2 PRIMARY_NAM, 
3020 2 RESULT_NAME, 
3021 2 -« ICB) ; 
3022 2 .IF NOT .STATUS 
3023 2 THEN RETURN .STATUS; 
3024 2 
3025 2 STATUS = IMGS$GET_ HEADER (.ICB); ! Decode and store away the IHD cont 
3026 2 RETURN .STATUS; 
3027 2 
3028 1 END; 
-PSECT EXECSPAGED_DATA, PIC,2 
58 53 52 00020 P.AAE: .ASCII \RSX\ ; 
00023 - BLKB 1 


00000003 00024 P.AAD: .LONG 3 
00000000’ 00028 -ADDRESS P.AAE 
41 50 42 0002C P.AAG: .ASCII \BPA\ 


00000003 00030 P.AAF: .LONG 3 
00000000’ 00034 -ADDRESS P.AAG 

49 47 4F 4C 00038 P.AAI: .ASCII \LOGINOUT\ 
00000008 00040 P.AAH: .LONG’ 8 
00000000’ 00044 -ADDRESS P.AAI 

24 53 59 53 00048 P.AAK: .ASCII \SYSSSYSTEM: .EXE\ 


OOOOOOOF 00058 P.AAJ: .LONG 15 
00000000’ 0005C -ADDRESS P.AAK 


=e Se 


=e 


0002F -BLKB 1 


we Ve we we Ne 


=e 


00057 -BLKB 1 . ° 


@e Ne 


RSX_NAME= 
BPA_NAME= 

LOGIN_NAME= 
SYSTEM _NAME= 


-PSECT EXECSPAGED_CODE,NOWRT, PIC,2 


O3FC 00000 GET_OTHER_IMAGE: 


~WORD Save R2,R3 


DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY . 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 73 


X-14 GET_OTHER_IMAGE - Open Primary Image File - 10-Apr-1989 10:48:52 
00000000G 00 9E 00002 MOVAB STORED NAME, R9 
00000000G 00 9E 00009 MOVAB OWN STORAGE+14, R8 

08 C2 00010 SUBL2 #8, SP 
04 AC DO 00013 MOVL ICB, R6 
58 A6 DO 00017 MOVL 88(R6), R2 
OE A6 BO 0001B MOVW 14(R6), OWN _STORAGE+14 
FCAC C8 DO OOOILF MOVL FAB+24, OWN _STORAGE+20 
OE A2 AF 00025 CASEW 14(R2), #0, #3 
o000D 0002A 18: -WORD 2$-1$,- 
3$-15S, - 
4$-15, a 
5$-1$ 
44 8F 9A 00032 MOVZBL #68, RO 
04 00036 RET 
0000’ CF 9E 00037 28: MOVAB RSX_NAME, NEW_IMAGE NAME 
31 11 #0003C BRB 7§ 
0000’ CF 9E 0003E 38: MOVAB BPA_NAME, NEW_IMAGE NAME 
2A 11 00043 BRB 7$ 
F614 C8 9B 00045 48: MOVZBW TYPE 2 IMAGE NAME, NEW IMAGE NAME_DESC 
F615 C8 9E O0004A MOVAB TYPE 2 IMAGE NAME+1, NEW_IMAGE NAME DESC+4 
6E 9E 00050 MOVAB NEW _IMAGE NAME DESC, NEW _ IMAGE NAME 
1A 11 00053 BRB 7$ 
F2 A8 E9 00055 5$§: BLBC OWN STORAGE, 6$ 
OE A6 3C 00059 MOVZWL 14 (R6), ~ (SP) 
01 FB OO05D CALLS #1, SYSSDASSGN 
0000’ CF 9E 00064 MOVAB LOGIN_NAME, NEW_IMAGE NAME 
04 #11 00069 BRB 7$ 
O01 DO OOO6B 6S: MOVL #1, RO 
04 OOO6E RET 
10 A6 D4 OOOG6F 7§: CLRL 16 (R6) 
50 A6 D4 00072 CLRL 80 (R6) 
F694 C8 9E 00075 MOVAB PRIMARY IHD, 4(R2) 
OE A2_ Bi1 0007B CMPW 14(R2), #3 
OF 12 OOO7F BNEQ 8$ 
FDIF c8 90 00081 MOVB NAM+59, STORED NAME 
69 9A 00086 MOVZBL STORED NAME, R1 
FD30 cs DO 00089 MOVL NAM+76, RO 
OD 11 OO08E BRB 9$ 
FCE7 c8 90 00090 88: MOVB NAM+3, STORED NAME 
69 9A 00095 MOVZBL STORED NAME, Rl 
FCE8 c8 DO 00098 MOVL NAM+4, RO 
51 28 0009D 9S: MOVC3 Rl, (RO), STORED _NAME+1 
14 A6 94 OO00A2 CLRB 20 (R6) 
56 DD OOOAS PUSHL R6 
FDF4 C8 9F OO00A7 PUSHAB RESULT NAME 
FCE4 C8 9OF OOOAB PUSHAB PRIMARY NAM 
FC94 C8 9OF OOOAF PUSHAB PRIMARY_FAB 
0000’ CF 9F OO0B3 PUSHAB SYSTEM NAME 
57 DD 000B7 PUSHL NEW IMAGE NAME 
06 FB OOOB9 CALLS #6, IMGSOPEN IMAGE 
50 E9 OOOBE BLBC STATUS, 10S 
56. DD 000C1 PUSHL R6 
Ol FB 000C3 CALLS #1, IMGSGET_ HEADER 
04 000C8 10S: RET 


EXECSPAGED CODE + OBD2 


DIGITAL INTERNAL USE ONLY 201 


we Se Se Se Se Se Se Se Ye Ye Ne Me fe 


™e Te Te Te Te Ve 


Ne Ne Ne Me Se Me Ny 


me Ne Te Se Te Ve Te Ye We eo Ve Re Ne 


me Ne te te NO 


=e Me Ne Ne Te 


Se Me Ve 


se Ne 


_$25 


2885 


2919 
2920 
2926 


2983 
2935 
2942 


2954 
2955 
2957 


2970 
2974 


2975 
2979 


2990 
2991 
2992 
2997 


3000 
3001 


3005 
3006 


3013 
3015 
3020 
3019 
3018 
3017 
3016 


3022 
3025 


3026 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSIMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 74 
X-14 GET_OTHER_IMAGE - Open Primary Image File 10-Apr-1989 10:48:52 _$25 


202 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSS$IMGACT SYSIMGACT - Image Activator System Service 10-May-1989 16:11:13 VAX Bliss- 
32 V4.5-862 Page 75 


X-14 GET _OTHER_IMAGE ~ Open Primary Image File 10-Apr-1989 10:48:52 _§25 
é 3030 1 

* 3031 1 END ! End of module SYSS$IMGACT 

z 3032 1 

; 3033 0 


ELUDOM 


PSECT SUMMARY 


; 

; 

; Name Bytes Attributes 

; 

# EXECSINIT SSTBL_ 001 16 NOVEC, WRT, RD, EXE,NOSHR, LCL, REL, CON, 
# EXECSPAGED_ CODE 3227 NOVEC,NOWRT, RD, EXE,NOSHR, LCL, REL, CON, 
+ EXECSPAGED DATA 96 NOVEC, WRT, RD, EXE,NOSHR, LCL, REL, CON, 


Library Statistics 


ewe Ye Se Se 


SSS See Symbols ~-------- Pages Proc 
File Total Loaded Percent Mapped Time 

. 
# _$254$DUA55: [SYSLIB]LIB.L32;1 31401 183 0 1695 00 


COMMAND QUALIFIERS 
BLISS/CHECK= (FIELD, INITIAL, OPTIMIZE) /LIS=LISS : SYSIMGACT/OBJ=OBJ$:SYSIMGACT TMPS$:SYSI 


=e 


we 


Size: 3227 code + 112 data bytes 
Run Time: 00:15.6 

Elapsed Time: 00:22.8 

Lines/CPU Min: 11702 

Lexemes/CPU-Min: 115504 

Memory Used: 384 pages 

Compilation Complete 


™e Ye Se Se Ye Ye Ne 


DIGITAL INTERNAL USE ONLY 203 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


5 CHECK _VERSION.LIS 


EXESCHECK_VERSION - Check for SYS.STB Version Mismatch 10-MAY~-1989 16:53:02 VAX MACRO V5.0- 


8 Page 0 
Table of contents 
(2) 76 Declarations 
(3) 108 EXESCHECK_VERSION - Check for SYS.STB Version Mismatch 


204 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


EXESCHECK_VERSION - Check for SYS.STB Version Mismatch 10-MAY-1989 16:53:02 VAX MACRO V5.0- 


8 Page 1 
X-7 2-MAR-1989 10:15:30 [SYS.SRC]CHECK_VERSION.MAR;1 (1) 

1 -TITLE.. EXESCHECK _ vane ton: - Check for SYS.STB Version Mismatch 
2 -IDENT ‘'X-7' 
3 7 bg iy 
4 Ee pene ae tne ge ge Ghee oan, Pe een ee tee ag eg eee 
5 ;3;* 
6 :* COPYRIGHT (c) 1986 BY 
T 3;* DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. 
8 ;* ALL RIGHTS RESERVED. 
a As 


* 
* 
* 
* 
* 
10 ;* THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED ad 
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 ba 
14 ;* OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY * 
15 ;* TRANSFERRED. * 
16 ;* * 
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 ;* 

24 ;* 

25 PAR MRR KKH RE KER IKKE KER ER KKK EKER EEK ERE KRHE KEE REER EK EK KKREEKREKKEEERKKKE EK KEKE KKEE 
26 

27 ++ 

28 ; Facility: 

29 ; 

30 ; VAX/VMS Executive 

sl 7 

32 ; Image Activator and System-Space Code Loader 

33 ; 

34 ; Abstract: 

35 ; 

36 ; The routine in this module is used by any component that needs to 
37 ; check whether an image linked against the system symbol table 
38 ; (SYS.STB) is compatible with the running system system. 

39 ; 

40 ; Author: 

41 ; 

42; Lawrence J. Kenah 

43 ; ; 

44 ; Creation Date: 

45 ; 

46 ; 24 October 1986 

47 ; 

48 ; Modified by: 

49 ; 

50 ; X-6,7 SFO0006 Stephen Fiorelli 01-Mar-1989 
51 ; Skip checking of base image subversion because 

52.3 it’s screwed up. The silly version is not used 

Loe J for anything anyway. 

54 ; 

55 ; X-5 SFO0005 Stephen Fiorelli 23-Sep-1988 
56 ; Change the checking for the minor version id. 

57 3; First, the base_image minor id, or the overall 


DIGITAL INTERNAL USE ONLY © 205 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


EXESCHECK VERSION ~- Check for SYS.STB Version Mismatch 10-MAY-1989 16:53:02 VAX MACRO V5.0- 
8 Page 2 
X-7 2-MAR-1989 10:15:30 [SYS.SRC]CHECK_VERSION.MAR;1 (1) 


58 ; minor id has had its meaning changed. It contains 
59 ; a number corresponding to the release it was 

60 ; linked against. This number is relative to 

61 ; to other releases under active development. 

62 3 For example if both X and Y are releases 

63 ; under active development, and X is to be 

64 3; released before Y, then X’s overall minor 

65 ; id is less than Y's. 

66 3; 

67 ; X~4 SFO04001 Stephen Fiorelli 14-Jan-1987 
68 ; Remove temporary condition of checking according to 
69 ; the old version format. 

70 3 

71 3 x-3 LJK0002 Lawrence J. Kenah 29-Oct-1986 
72 3 Make version mismatch a warning, not an alternate success. 
73 3 

74 3; vo5-001 LJKO001 Lawrence J. Kenah Original 


206 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


EXESCHECK VERSION - Check for SYS.STB Version Mismatch 10-MAY-1989 16:53:02 VAX MACRO V5.0- 


8 Page 3 


X-7 Declarations 2-MAR-1989 10:15:30 [SYS.SRC]CHECK_VERSION.MAR;1 (2) 


me 


=e 


= 


=e 


we 


«SUBTITLE - Declarations 


Include files: 


SIHDDEF | 3; Offsets into pieces of image header 

S$ IHVNDEF 7 Layout of version number array elements 
SSSDEF 7 System service status codes 

$STSDEF # Status code internal structure 


Local symbol definitions 


IHD_POINTER = 4 Offset into argument list 


=e 


Status codes 

SS__SYSVERDIF WARNING = SS$ SYSVERDIF & STSS$M_CODE 
External declarations 

-DISABLE GLOBAL 
Global data cells 


» EXTERNAL = 
SYS$GL_VERSION 


PSECT Declarations: 
~ DEFAULT DISPLACEMENT , WORD 


DECLARE _PSECT EXECSNONPAGED_ CODE 


DIGITAL INTERNAL USE ONLY 207 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


EXESCHECK_VERSION - Check for SYS.STB Version Mismatch 10-MAY-1989 16:53:02 VAX MACRO V5.0- 


8 Page 4 
X-7 EXESCHECK_VERSION - Check for SYS.STB Ve 2-MAR-1989 10:15:30 [{SYS.SRC]CHECK_ VERSION .MAR; 
108 - SUBTITLE EXESCHECK_VERSION - Check for SYS.STB Version Mismatch 
109 ;+ 
110 ; Functional Description: 
111 ; 
112 ; This routine insures that an image (loadable or executable) that is 
113 3; linked against SYS.STB did not use a later set of routines than is 
114 ; currently running. 
115 ; 
116 ; These checks are used by the various loading mechanisms and by the 
117 ; image activator when an image linked against SYS.STB is activated into 
118 ; a privileged environment. 
119 ; 
120 ; Input Parameter: 
121 ; 
122 ; 4(AP) - Address of buffer containing the image header 
123 ; 
124 ; Implicit Input: 
125 ; 
126 ; SYSS$GL_VERSION - Address of a 33-longword array of version numbers 
127 ; 
128 ; [0] - contains SYS$K_VERSION 
129 ; [1] - contains SYS$K_VERSION_01 
130 ; [2] ~- contains SYSS$K_VERSION_02 
131 ; . 
132 ; . 
133 ; [32] - contains SYS$K_VERSION_32 
134 ; 
135 ; Output Parameters: 
136 ; 
137 ; none 
138 ; 
139 ; Status: 
140 ; 
141 ; RO low bit set indicates success. The image can be loaded or 
142 ; activated with no concern for version mismatch. 
143 ; 
144 ; RO low bit clear indicates a failure. 
145 ; 
146 ; SS$_VERSION_ MISMATCH (spelling?) 
147 ; 
148 ; Indicates that the image was linked against a SYS.STB that 
149 ; is incompatible with the running system. 
150 ; : 
181 ; SS$_BADIMGHDR 
152 ; 
153 ; Indicates a problem with the image header (or with the 
154 ; SYS.STB used in the link). This error is returned when 
155 ; IHDS$L_VERSION contains a zero but IHDS$W_VERSION ARRAY OFF 
156 ; is nonzero. In a proper environment, this cannot happen. 
157 ; 
158 ; Notes: 
159 ; 
160 ; There is no match control used by this routine. The semantics are 
161 ; simple. The major ID of the image must exactly match the major ID of 
162 ; the running system. The minor ID of the image must be less than or 
163 ; equal to (LEQU) the ID of the running system. 
164 ; 


208 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


EXESCHECK_VERSION - Check for SYS.STB Version Mismatch 10-MAY-1989 16:53:02 VAX MACRO V5.0- 


8 Page 5 


X~7 EXESCHECK_VERSION - Check for SYS.STB Ve 2-MAR-1989 10:15:30 [SYS .SRC]CHECK_VERSION.MAR; 


165 
166 
167 
168 
169 
170 
171 
172 
173 
174 
175 
176 
177 
178 
179 
180 
181 
182 
183 
184 
185 
186 
187 
188 
189 
190 
191 
192 
193 
194 
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 


me Ye Ve Te Ve Ye Ye Ve 


Thus, the minor ID semantics allow upward compatible growth while the 
major ID provides for incompatible changes in internal interfaces. 


The overall version number differs from the 32 subsystem version 
numbers in one small detail. Its major ID is 8 bits wide (and is likely 
never to change), leaving 24 bits for the minor ID. The subsystem IDs 
are exist as 16 bits of major ID and 16 bits of minor ID. 


UNIVERSAL ENTRY EXES$CHECK_VERSION, <“M<R2,R3,R4,R5>> 


MOVL IHD _POINTER(AP), R4 
MOVAL G*SYS$GL_VERSION, R5 


R4 points to image header buffer 
R5 locates version array in memory 


™e Ne 


MOVZWL IHDSW_VERSION ARRAY _OFF(R4), Rl ; R1 contains byte offset to version 


MOVL IHDSL_SYSVER(R4), R3 Get overall version number from IH 


me Ve 


BNEQ 208 Usual case is nonzero 
TSTL R1 3: Is offset also zero? 
BEQL 10$ ; Branch if yes 


3 If the array offset is nonzero but the overall version number is zero, 
# this indicates an image that is internally inconsistent. 


MOVZWL #SS$_BADIMGHDR, RO 
RET 


7 We should not even be in this procedure if both version indicators are 
# zero but will excuse sloppy callers by simply returning success. 


108: 


=e Xe 


™e Se Ne Ye Te 


208: 


e 
tf 
e 
eo 


MOVZWL #SS$_NORMAL, RO 
RET 


The overall IHD version number is nonzero. Compare this to the 
system version number. 


R2 - scratch 
R3 - overall version number from image header 
R5 - address of SYS$GL_VERSION (advanced to point to first subversion number 


Rl and R4 are not used for this step 
ASSUME IHVNSV_VERSION MAJOR_ID EQ 24 
ASSUME IHVNSS | VERSION | MAJOR _ ID EQ 8 


EXTZV #IHVNSV_VERSION MAJOR_ID, - 
#IHVNSS * VERSION | MAJOR _ _ID,- 


R3, R2 ; R2 gets IHD major ID 
CMPB R2, 3(R5) 3 Compare with system major ID 
BNEQ 90$ ; Report error if mismatch 


If the overall version number is acceptable and there is no additional 
version number information, simply return success. 


DIGITAL INTERNAL USE ONLY 209 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


EXESCHECK_VERSION - Check for SYS.STB Version Mismatch 10-MAY-1989 16:53:02 VAX MACRO V5.0- 


8 Page 6 


X-7 EXESCHECK_VERSION ~- Check for SYS.STB Ve 2-MAR-1989 10:15:30 [SYS.SRC])CHECK VERSION.MAR; 


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


TSTL R1 


Is offset also zero? 
BEQL 10$ . 


Branch if yes 


we Ne 


? The overall version numbers are compatible. Now make detailed checks on 
? all component version numbers that are relevant to this image. 


=e 


-e Me Se Ye Te Ne 


50$ 


we Ye Ve Ye Ve Ne Ze Ve Ye Bo Ye Ye Vo 


ASSUME IHVNSL_SUBSYSTEM_ MASK EQ 0 
ASSUME IHVNSL | SUBVERSION |_ARRAY EQ 4 


ADDL Rl, R4 
MOVL (R4)+, R1 


R4 now points to IHD version array 
Rl contains version mask 


=e 6 


ASSUME IHVNS$V_VERSION MINOR_ID EQ 0 
ASSUME IHVNSS_VERSION MINOR_ID EQ 24 


EXTZV #IHVNSV_VERSION MINOR_ID,- 
#IHVNSS | VERSION | | MINOR | _ ID,- 
R3, R3 


Store overall minor id from 
IHD in R3 


=e Ne 


Perform a subversion number check for each nonzero entry in the IHD array mask. 


RO - loop index 

Rl - version mask 

R2 - scratch (points to next significant system version number) 
R3 ~- overall version number from image header 

R4 - steps through version array in image header 

R5 - points to base of system version number array 


ASSUME IHVNS$V_SUBVERSION MINOR_ID EQ 0 
ASSUME IHVNSS_ SUBVERSION | MINOR | ID EQ 16 


ASSUME IHVNSV_SUBVERSION_MAJOR_ID EQ 16 
ASSUME IHVNS$S_SUBVERSION MAJOR _ID EQ 16 


CLRL RO ; Start with LSB (VERSION 01) 

BBC RO, R1, 60$ Skip checks if bit not set 

TSTL RO Are we testing the base image vers 
BEQL 70$ Yes, skip checking 


MOVAL 4(R5) [RO], R2 
CMPW (R2)+, (R4)+ 
BLSSU 90S 
BEQLU 55$ 


R2 points to next significant vers 
Compare minor IDs 

Error if IHD version GTRU system v 
If equal, no need to check overall 


™e Se Me Ne Ye Ne Ne 


If we get here the minor id from the image header is less than the 
minor id of the running system. We now check the release numbers 
which is the overall minor id. If the release the image was linked 
against is greater than the release of the running system, then 
there is a version mismatch. We cannot trust the minor ids in this 
case (unless they are equal). This is a conservative 

approach. We sometimes issue version mismatch when it might 

not be necessary, but never issue a success unless we really 

mean it. This conservative approach gets corrected, and normal 
version checking for minor ids occurs when the release the image 
linked against gets rebuilt. 


CMPZV #IHVNSV_VERSION_MINOR_ID,- 


210 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


EXESCHECK VERSION - Check for SYS.STB Version Mismatch 10-MAY-1989 16:53:02 VAX MACRO V5.0- 


8 Page 7 


X~7 EXESCHECK_VERSION - Check for SYS.STB Ve 2-MAR-1989 10:15:30 [SYS.SRC]CHECK VERSION .MAR; 


279 
280 
281 
282 
283 
284 
285 
286 
287 
288 
289 
290 
291 
292 
293 
294 
295 
296 
297 
298 
299 
300 
301 
302 
303 


#IHVNS$S_VERSION_MINOR_ID, - 
(R5), R3 
BLSSU 90$ 


Compare system minor ID with 
minor ID from IHD 
Error if overall minor ID is large 


=e “ese “oe 


558: CMPW (R2)+, (R4)+ 
BNEQ 90$ 
60S: AOBLEQ #31, RO, 50$ 


Now compare major IDs 
Major ID requires strict equality 
Loop through all 32 mask bits 


=e “te “Se 


3 If we drop through the loop, all component specific version numbers 
7 in the image are compatible with the running system. 
MOVZWL #SS$_NORMAL, RO 
RET 
3 If we get here if we were trying to test the base image version number. 
? Advance the version number array in image header 


70$: TSTL (R4)+ 


BRB 60$ 

7 Some incompatibility was discovered between the image header and 

7 the running system. Indicate a failure. 

908: MOVZWL #SS_SYSVERDIF_WARNING, RO ; Return warning status 
RET 
-END 


DIGITAL INTERNAL USE ONLY 211 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


6 PERMANENT DEVICE _DATABASE.LIS 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 


8 Page 0 
Table of contents 
(2) 138 Definition MACROS 
(3) 176 VAX/VMS SYSTEM PERMANENT DEVICE DATABASE 
(4) 250 Initialization of system permanent device database 
(6) 415 SYSTEM BOOT DEVICE DATABASE 
(7) 454 SYSTEM CONSOLE DEVICE DATABASE 
(8) 731 SYSTEM PERMANENT MAILBOX DATABASE 
(9) 879 NULL DEVICE (NLA) DATABASE 
(10) 912 NETWORK DEVICE DATABASE 


212 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 
8 Page 1 
X-8 15-SEP-1988 10:32:38 PERMANENT DEVICE _DATABASE.MAR;1 (1) 


-TITLE PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 
-IDENT ’X-8' 


1 

2 

3 

QF RRRKKHKKKEKKKREKEKKKEEEKRHKAREKREK EK EKEEKR ER KEEEKEKR EKER EERE KERHEKRKEKEKKKKKEKKKKKK 
5 3* 
6 
7 
8 
9 


* 

7* COPYRIGHT (c) 1987 BY * 
#* DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. * 
7* ALL RIGHTS RESERVED. * 
7* * 

10 ;* THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED 4) 

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

17 ;* THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE * 

18 ;* AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT 7 

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 ;* ® 

24 ;* * 

25 FRR HAE RKE KK EK EKER KEKE KKK RE KERK HIKER IKK KKK EK KKKEREKEKEKREKKKKKKERKKK K 

26 s++ 

27 ; Facility: 

28 ; 

29 ; Exec loaded_image SYSTEM PRIMITIVES 

30 ; 

31 ; Abstract: 

32 ; 

33 ; This module contains the system permanent device database 

34 ; 

35 ; Author: 

36 ; 

37 3; VMS development team 

38 ; 

39 ; Creation Date: 

40 ; 

41 ; April 2, 1987 

42 ; 

43 ; Modified by: 

44; 

45 ; x-8 DDP0315 Derrell D. Piper 18-Sep-1988 

46 ; Add a permanent mailbox for the audit server. 

47 ; 

48 ; X-7 FAKO002 Forrest A. Kenney 04-Feb-1988 

49 ; Make OPAO UCB use IOLOCK8 forklock, other changes 

50 ; allows OPAO to use this forklock again. 

51 ; 

52 ; X-6 RNG5006 Rod N. Gamache 7-Sep-1987 

53 7 Change IDB$L_CRB to IDBSL_SPL. 

54 ; 

55 ; X-5 RNG5005 Rod N. Gamache 27-May-1987 

56 ; Make OPAO UCB use IOLOCKS forklock. 

57 3 


DIGITAL INTERNAL USE ONLY 213 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 


8 Page 2 


X-8 15-SEP-1988 10:32:38 PERMANENT DEVICE DATABASE.MAR;1 (1) 


58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 


112 
113 
114 


ee Me Ye Se Ye Ye Ye Me Ye 


Se Ne Ne Ye Se Ne 


se Te Ve Ne Me Ne Ne 


we Se Ne Ne 


™e Ye Ye Te Ne Be Ye Ve Yeo 


we Ye 


“oe Ne Se Se Ne Ye Te Yeo Se Ve Ne Seo Te Yo Ve 


me Re Se Be Ne 


X-4 


X-OBS 


X-OBS 


X-OBS 


X-OBS 


X-OBS 


X-OBS 


X~OBS 


X-OBS 


X-OBS 


FAKOO001 Forrest A. Kenney 22-May-1987 
Change OPASVECTOR to use SVECINI and S$VEC macro to build 
port vector table. This will insure that the vector is 
always the correct size. 


MSH0313 Michael S. Harvey 15-May-1987 
Add RLS _PC longword to permanent spinlock structure. 


SFO00002 Stephen Fiorelli 14-Apr-1987 
Initialize tty$gl_jobctlmb with the job controller’s 
mailbox. 


SFO0001 Stephen Fiorelli 02-Apr-1987 
Part of system_misc.mar contain the system device 
database was moved here. Modification history of 
the database while it was part of system _misc is 
retained. 


MJW0113 Michael J. Worcester 26-Feb-1987 
Change reference of DYN$C_SPL_DEVICELOCK to 
SPLSC_SPL_DEVICELOCK to agree with new SPL definition. 


MSH0246 Michael S. Harvey 10-Feb-1987 
Remove obsolete spinlock counter cell. 


MASO025 Mary A. Sullivan 26-JAN-1987 
Fix ASSUMES and add space for VECS$W_NUMALT, VECSW_MAPALT 
in OPASCRB 


SF04008 Stephen Fiorelli 22-Jan-1987 
Remove the label IOCS$GL_DEVLIST from within the loacal 
secs system block. The DDB listhead will still remain, 
but a second listhead will be created with the movement 
of IOC$GL_DEVLIST to the system _data_cells.mar module. 
Both will point to the next element in the listhead; 
the system boot device. 


JCK Jonathan C. Kaplan 8-Dec-1986 
added longword field to OPASSPL that is now is the 
SPLDEF structure 


JCK Jonathan C. Kaplan 7-Dec~1986 
VECDEF has grown by 16 bytes and assumptions made 
about CRB are no longer true -- fix assumes no 
absolute dependence on CRB/VEC size in OPASCRB or 
SYS_CRB. 

PLL P. Levesque 25-Nov-1986 


Fix alignment of SYSS$GL_JOBCTLMB. 


DBM DB Mills 24-Nov-1986 
Changed ORB, DDB, and UCB macros to align data 
structures on quadword boundries. The file system 
expects the boot UCB to be quadword aligned and uses 
the low order 3 bits for the cache type. 


BJTOOS5O Benjamin J. Thomas III 30-Oct-1986 


214 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 


8 Page 3 


X-8 15-SEP-1988 10:32:38 PERMANENT DEVICE DATABASE .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 


me Me Me Se Ve Te Ye Ne Ye Yeo Te We We Vo Yo Ve Ye Ve Te We Ve Yo 


X-OBS 


X-OBS 


X-OBS 


X-OBS 


X-OBS 


Allocate more space at end of boot ucb 


RNGO 409 Rod Gamache 24-Jun-1986 
Add CRBSL_WOFL/WOBL as separate longwords. 


MSHO256 Michael S. Harvey 20-Jun-1986 
Prevent clobbering the console terminal’s device 
affinity mask. 


MSHO0252 Michael S. Harvey 16-Jun-1986 
Add standard data structure cells to spinlock control 
block. 


MSH0232 Michael S. Harvey 4-Mar~-1986 
Correct the UCB count in the console IDB to accurately 
reflect the number of potential UCBs for which there is 
space. 


RNHO0037 Richard N. Holstein 03-Jan-1986 
Initialize ORB$L_ OWNER via DPT_STORE for OP devices. 


DIGITAL INTERNAL USE ONLY 215 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 


8 Page 4 


X-8 Definition MACROS 15-SEP-1988 10:32:38 PERMANENT DEVICE DATABASE.MAR;1 (2) 
Definition MACROS 


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 
172 
173 
174 


216 DIGITAL INTERNAL USE ONLY 


ze 


- SUBTITLE 


SARBDEF 
SCRBDEF 
SDCDEF 

SDDBDEF 
SDEVDEF 
SDYNDEF 
$FKBDEF 
SIDBDEF 
SIPLDEF 
$IRPDEF 
SJIBDEF 
SORBDEF 


$SPLCODDEF 


S$SPLDEF 
STTYMACS 


STTYVECDEF 


se te Se Ne Se Ye Ye Ne Ye Ye Yo Ne Ye Ye Ye No 


ACCESS RIGHTS BLOCK DEFINITIONS 
DEFINE CRB 

DEFINE DEVICE CLASSES 

DEFINE DDB 

DEFINE DEVICE CHARACTERISTICS 
STRUCTURE TYPE CODE DEFINITIONS 
DEFINE FORK BLOCK OFFSETS 

DEFINE IDB 

DEFINE IPL LEVELS 

DEFINE IRP OFFSETS 

JOB INFORMATION BLOCK DEFINITIONS 
OBJECT’S RIGHTS BLOCK OFFSETS 

DEFINE SPINLOCK INDICES 

DEFINE SPINLOCK STRUCTURES 

THE TERMINAL DRIVER MACRO DEFINITIONS 
TERMINAL DRIVER PORT & CLASS VECTOR OFFESTS 


Definiton MACROS neeed for assembly 


S$SBDEF 
$SECDEF 


SSTATEDEF 


$TQEDEF 
STTDEF 
STTYDEF 
STTYMACS 
SUCBDEF 
STTYDEFS 
SVADEF 
SVECDEF 
SWCBDEF 
SWSLDEF 


INTSTK=1 


;PSTE/GSTE definitions 

7Define state numbers 

7;Define TQE offsets 

Define terminal characteristics 


7;The terminal driver MACRO definitions 
3;Define UCB 

;TTY UCB extension (must follow SUCBDEF) 
7Define virtual address fields 

7;Define CRB vector 

;Define WCB 

;Working set list definitions 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE ~ Miscellaneous system area - base image 10-MAY~-1989 16:57:36 VAX 


8 Page 5 
X-8 VAX/VMS SYSTEM PERMANENT DEVICE DATABASE 15-SEP-1988 10:32:38 PERMANENT DEVICE. DATABASE. 
176 -SBTTL VAX/VMS SYSTEM PERMANENT DEVICE DATABASE 
177 ; 
178 ; LOCAL MACROS 
179 ; 
180 -MACRO ORB LABEL, ?7EN, ?7ACL 
181 -ALIGN QUAD 
182 ORBASE=. 
183 LABEL: 
184 -LONG 0 
185 «WORD <-1,0 7 ACL MUTEX INITIALIZATION 
186 eWORD EN-LABEL 
187 -BYTE DYN$C_ORB 
188 -BYTE ORBSM_PROT_16 
189 -BLKB ORBSK_LENGTH - <. - LABEL> 
190 EN: 
191 -ENDM 
192 ; 
193 eMACRO STO ORB OFFSET, SIZE, VALUE 
194 X=. 
195 -=ORBASE+ORBS’ OFFSET 
196 -'SIZE ‘’VALUE 
197 =X 
198 -ENDM 
199 ; 
200 -MACRO UCB LABEL, EXPAND=0,ORB_ADDR, 710L, 7EN, 7ACL 
201 «ALIGN QUAD 
202 UCBASE=. 
203 LABEL: 
204 -LONG 0,0 
205 eWORD EN-LABEL 
206 -BYTE DYNS$C_UCB 
207 -BYTE 0 
208 -BLKB UCBSL_ORB - <. - LABEL> 
209 -ADDRESS ORB_ADDR 
210 -BLKB UCBSL_IOQFL - <. - LABEL> 
211 IOL: eADDRESS IOL, IOL 
212 -BLKB UCBS$K_LENGTH ~ <. - LABEL> 
213 -BLKL EXPAND 
214 EN: 
215 -ENDM 
216 ; 
217 -MACRO STO _UCB OFFSET, SIZE, VALUE 
218 X=. 
219 -=UCBASE+UCBS’ OFFSET 
220 -'SIZE ‘VALUE 
221 =X 
222 -ENDM 
223 
224 ASSUME DDBSL_LINK EQ 0 
225 ASSUME DDBSL_UCB EQ 4 
226 ASSUME DDBSW_SIZE EQ 8 
227 ASSUME DDBSB_ TYPE EQ 10 
228 ASSUME DDBS$L_DDT - EQ 12 
229 ASSUME DDBSL_ACPD EQ 16 
230 
231 «MACRO DDB NAME, NEXT, FUCB, DDT, ACP, ATYPE, DEVNAM, DRVNAM, ?7EN 
232 -ALIGN QUAD 


DIGITAL INTERNAL USE ONLY 217 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 
8 Page 6 
X-8 VAX/VMS SYSTEM PERMANENT DEVICE DATABASE 15-SEP-1988 10:32:38 PERMANENT DEVICE DATABASE. 


233 NAME: -ADDRESS NEXT 


234 -ADDRESS FUCB 

235 -WORD EN-’ NAME 

236 -BYTE DYNSC_DDB,0 

237 -ADDRESS DDT 

238 -LONG “A/‘ACP/+<’ ATYPE@24> 
239 -ASCIC /'DEVNAM/ 

240 -=! NAME+DDB$T_DRVNAME 
241 -ASCIC /’DRVNAM/ 

242 -=/NAME+DDBS$L_SB 

243 -ADDRESS SCS$GA_LOCALSB 
244 .='NAME+DDB$C_LENGTH 
245 EN: 

246 .ENDM 

247 

248 


218 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 1O-MAY-1989 16:57:36 VAX 


8 Page 7 


X-8 Initialization of system permanent devic 15-SEP-1988 10:32:38 PERMANENT DEVICE DATABASE. 


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 
279 
280 
281 
282 
283 
284 
285 
286 
287 
288 
289 
290 
291 
292 
293 
294 
295 
296 
297 
298 
299 
300 
301 
302 
303 
304 
305 
306 


-SBTTL Initialization of system permanent device database 
att 
; INISDEVICE DATABASE 
; FONCTIONAL DESCRIPTION: 
; This initializes the system permanent device database 
; data structures. 
; CALLING SEQUENCE: 
; JSB, called from INIT. 
j INPUT PARAMETERS : 
None. 
; IMPLICIT INPUTS: 
; None. 
; OUTPUT PARAMETERS: 
: None. 
; IMPLICIT OUTPUTS: 
; Address of SCSS$GA_LOCALSB stuffed in SCSS$AR_LOCALSB, 
; also set in the first two long words of SCS$GQ_ CONFIG. 
; Pointers to the various data structures which live 
; in the base image, sys. 
; ROUTINE VALUE: 
SS$_NORMAL 
; SIDE EFFECTS: 
5 None. 
-- 
7+ 
4 
DECLARE PSECT EXECSINIT_CODE 
INITIALIZATION ROUTINE INISDEVICE_DATABASE 
INISDEVICE_DATABASE: : 


Initialize the local system block 


=e Ne Ne 


DIGITAL INTERNAL USE ONLY 219 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 


8 Page 8 
X-8 Initialization of system permanent devic 15-SEP-1988 10:32:38 PERMANENT DEVICE DATABASE. 
307 MOVAL SCS$GA_LOCALSB, G*SCS$AR_LOCALSB 
308 MOVAL SCSS$GA_| LOCALSB, G*SCS$GQ | CONFIG 
309 MOVAL SCSS$GA_ LOCALSB, G*SCSSGQ | CONF IG+4 
310 
311 ; 
312 ; Initialize device data structure pointers in the base image 
313 ; 
314 
315 MOVAL SYS$GL_BOOTDDB, G*SYSS$AR_BOOTDDB 
316 MOVAL SYSS$GL | BOOTDDB, G*IOCSGL | DEVLIST 
317 MOVAL SYSSGL_| BOOTORB, G*SYSSAR_ BOOTORB 
318 MOVAL SYS$GL | BOOTUCB, G*SYS$AR_| BOOTUCB 
319 MOVAL OPASGL | DDB, G*OPASAR_DDB 
320 MOVAL OPSDPT, | G*OPSAR_DPT 
321 MOVAL OPASORBO, G*OPASAR_ORBO 
322 MOVAL OPASUCBO, G*OPASAR_UCBO 
323 MOVAL OPASCRB, G*OPASAR_CRB 
324 MOVAL OPASIDB, G*OPASAR_IDB 
325 MOVAL OPASSPL, G*OPASAR_SPL 
326 MOVAL MBSGL_DDB, G*MBSAR_| DDB 
327 MOVAL MBSORBO, G*MBSAR_ ORBO 
328 MOVAL MBSGL_ORB1, G*MBSAR_! ORB1 
329 MOVAL MBSGL ORB2, G*MBSAR __ ORB2 
330 MOVAL MBSGL | ORB3, G*MBSAR_| ORB3 
331 MOVAL MBSUCBO, G*MBSAR_| UCBO 
332 MOVAL MBSGL_UCB1, G*MBSAR_UCB1 
333 MOVAL MBSGL_UCB2, G“MBSAR_UCB2 
334 MOVAL MBSGL_UCB3, G“MBS$AR_UCB3 
335 MOVAL SYS$GL_OPRMBX, G*SYS$AR_OPRMBX 
336 MOVAL SYSSGL , AUDSRVMBX, G“SYSSAR_. AUDSRVMBX 
337 MOVAL NLSGL __ DDB, G*NLSAR_] DDB 
338 MOVAL NLSGL_ ORBO, G“NLSAR_| ORBO 
339 MOVAL NLSGL_ ucsBo, G“NLSAR_| UCBO 
340 MOVAL OPAS$VECTOR, G*OPASAR_VECTOR 
341 MOVAL SYSS$GL_JOBCTLMB, G*SYS$AR_JOBCTLMB 
342 MOVAL SYS$GL_JOBCTLMB, G*TTY$GL_JOBCTLMB 
343 
344 ; 
345 ; Store clone mailbox ucb size 
346 ; 
347 MOVW #SYS$C_MBXUCBSIZ, G*SYS$GW_MBXUCBSIZ 
348 
349 ; 
350 ; Initializae SCB vectors 
351 ; 
352 : 
353 MOVL G*EXESGL_SCB,R1 
354 MOVAL CONS INTDISI+INTSTK, “XF8 (R1) 
355 MOVAL CONS INTDISO+INTSTK, “XFC (R1) 
356 MOVL #SS$_NORMAL, RO 
357 RSB 


220 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area ~ base image 10-MAY-1989 16:57:36 VAX 


8 Page 9 


X-8 Initialization of system permanent devic 15-SEP-1988 10:32:38 PERMANENT DEVICE DATABASE. 


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 
409 
410 
411 
412 
413 


e 

a 

e 

o 

e 

rd 
Ss 


10$ 


™e “ee Ne Se Se Ve 


DECLARE_PSECT 
LOCAL SB 


CS$GA_LOCALSB: 


- LONG 
- LONG 
-WORD 
- BYTE 
-BYTE 
ASSUME 


SCS$GQ_CONFIG 
SCS$GQ_CONFIG 
SBSK_LENGTH 
DYN$C_scs 
DYNSC_SCS_SB 
SB$L_PBFL EQ 12 


ADDRESS 10S 
-ADDRESS 10$ 


ASSUME 
- LONG 
ASSUME 
-QUAD 
ASSUME 
- LONG 


ASSUME 
- LONG 
ASSUME 
- LONG 
ASSUME 
- QUAD 
ASSUME 
- LONG 
ASSUME 
- BLKB 
ASSUME 
-BLKB 
ASSUME 


SB$L_PBCONNX EQ 20 
0 
SB$B_SYSTEMID EQ 24 
0 
SBS$W_MAXDG EQ 32 
0 


SB$T_SWTYPE EQ 36 
0 ‘ 
SB$T_SWVERS EQ 40 
0 
SB$Q_SWINCARN EQ 44 
0 
SB$T_HWTYPE EQ 52 
0 
SB$B_HWVERS EQ 56 
12 
SB$T_NODENAME EQ 68 
16 
SB$L_DDB EQ 84 


™e Se Ne Ne Ye 


-e Ne 


™e 


me 


~™e Me 


we ™e me we 


aT) 


EXECSNONPAGED DATA, ALIGNMENT=QUAD 


SBS$L_FLINK 
SB$L_BLINK 
SBSW_SIZE 
SB$B_TYPE 
SB$B_SUBTYP 


SB$L_PBFL 
SB$L_PBBL 


SB$L_PBCONNX 
SB$B_SYSTEMID 


SBSW_MAXDG 
SBSW_MAXMSG 


SBS$T_SWTYPE 
SB$T_SWVERS 
SB$Q_SWINCARN 
SBS$T_HWTYPE 
SB$B_HWVERS 


SB$T_NODENAME 


Note: The listhead ioc$gl_devlist use to to be part 
of the local sb, located at the following cell. It 
is now separated out of the local sb, and is located 
in the base image sys.exe. 


-ADDRESS SYS$GL_BOOTDDB 


ASSUME 
- WORD 
ASSUME 
-BLKB 


ASSUME 
- LONG 


- BLKB 


-BLKB 


SBSW_TIMEOUT EQ 88 
=-2 ‘ 
SBS$B_ENBMSK EQ 90 
SB$S_ENBMSK 


SBSL_CSB EQ 92 
) 


SBSK_LENGTH-<.-SCSS$GA_LOCALSB> ; 


8 


=e Ne 


ze 


=e 


e 
a 


° 
a 


START DEVICE LIST AT BOOT DEVICE 
SB$L_DDB 


LOOKS LIKE TIMEOUT IS IN PROGRESS 


PROCESS POLL ENABLE MASK 


SB$L_CSB 
SPACE FOR REMAINING FIELDS 


Future expansion 


DIGITAL INTERNAL USE ONLY 221 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 


8 Page 10 


X-8 SYSTEM BOOT DEVICE DATABASE 15-SEP-1988 10:32:38 PERMANENT DEVICE DATABASE.MAR;1 (6) 


415 
416 
417 
418 
419 
420 
421 
422 
423 
424 
425 
426 
427 
428 
429 
430 
431 
432 
433 
434 
435 
436 
437 
438 
439 
440 
441 
442 
443 
444 
445 
446 
447 
448 
449 
450 
451 
452 


we Te Ye 


we Ve 


we Ne Be eo ee 


™e Ye Ye Ve 


-SBTTL SYSTEM BOOT DEVICE DATABASE 
BOOT DEVICE DDB 
DDB SYS$GL_BOOTDDB, OPA$GL_DDB, SYS$GL_BOOTUCB, 0, <F11>,1 


UCB FOR SYSTEM BOOT DEVICE 


NOTE - THE UCB FOR THE BOOT DEVICE IS CREATED WITH A REFERENCE COUNT OF 1 
TO AVOID HAVING THE FIRST $ASSIGN TRY TO TAKE OUT A LOCK ON IT BEFORE 
LOCKING IS ENABLED. 


THE UCB DATA STRUCTURE MUST BE QUAD WORD ALIGNED. THE XQP USES THE LOW 
ORDER THREE BITS AS A CACHE TYPE. 


ORB SYSS$GL_BOOTORB 
STO_ORB L_OWNER, LONG, <*X010001> 
UCB SYS$GL_BOOTUCB, 80, SYS$GL_BOOTORB 


STO_UCB B_FLCK, BYTE, SPL$C_IOLOCK8 
STO_UCB B_DIPL, BYTE, 21 
STO_UCB L_DDB, ADDRESS, SYS$GL_BOOTDDB 
STO_UCB L_DEVCHAR, LONG, <<DEVS$M_FOD! - 
DEV$M_DIR!- 
DEV$M_AVL!- 
DEV$M_ELG! - 
DEV$M_SHR!- 
DEV$M_IDV!- 
DEV$M_ODV!- 
DEV$M_RND>> 
STO_UCB B_DEVCLASS, BYTE, DC$_DISK 
STO_UCB L_AFFINITY, LONG, -1 
STO_UCB W_DEVBUFSIZ, WORD, 512 
STO_UCB B_ERTCNT, BYTE, 8 
STO_UCB B_ERTMAX, BYTE, 8 
STO_UCB W_REFC,WORD,1 


222 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area ~- base image 10-MAY-1989 16:57:36 VAX 


8 Page 11 


X-8 SYSTEM CONSOLE DEVICE DATABASE 15-SEP-1988 10:32:38 PERMANENT _DEVICE_DATABASF.MAR;1 (7) 
-SBTTL SYSTEM CONSOLE DEVICE DATABASE 


454 
455 
456 
457 
458 
459 
460 
461 
462 
463 
464 
465 
466 
467 
468 
469 
470 
471 
472 
473 
474 
475 
476 
477 
478 
479 
480 
481 
482 
483 
484 
485 
486 
487 
488 
489 
490 
491 
492 
493 
494 
495 
496 
497 
498 
499 
500 
501 
502 
503 
504 
505 
506 
507 
508 
509 


° 
td 
e 
’ 


we 


SYs. 


se Se Ye Ne Ne Se Ne Ne 


OPSDPT: 


DDB 


CONSOLE DPT 


CONSOLE TERMINAL DDB 


-PSECT $$$105 prologue, rd,wrt,noexe,pic,byte 


DECLARE PSECT 


DP TAB - 


EXECSNONPAGED DATA 


END=OP_DPTEND, - 


ADAPTER=UBA, - 


7FAKE ADAPTER 


UCBSIZE=<<<UCBS$C_TT_LENGTH+3+64>/4>*4>, - 
NAME=OPERATOR, - 
VECTOR=OPAS VECTOR 


DPT_STORE 
DPT STORE 
DPT STORE 
DPT STORE 
DPT STORE 
DPT STORE 
DPT STORE 
DPT STORE 


DPT_STORE 


DPT_STORE 
DPT STORE 
DPT STORE 
DPT STORE 
DPT STORE 
DPT STORE 
DPT STORE 
DPT STORE 
DPT STORE 


DPT_STORE 
DPT_STORE 
DPT STORE 


DPT_STORE 
DPT STORE 


510 OP_DPTEND: 


INIT 


UCB, UCBSL_TT_DECHAR, @L, TTY$GL_DEFCHAR ; 
UCB, UCBSL_TT DECHA1, @L, TTY$GL_DEFCHAR2 
UCB, UCBSL_DEVDEPEND, @L, TTY$GL_DEFCHAR 

UCB, UCB$L_TT_DEVDP1, @L, TTY$GL_DEFCHAR2 
UCB, UCBSB_FLCK,B, SPL$C_IOLOCK8 : 


UCB, UCB$B_ DIPL,B, 20 
UCB, UCBSL_DEVCHAR, L, <- 
DEV$M_REC! - 
DEV$M_AVL! - 
DEV$M_IDV! - 
DEVS$M_ODV!- 
DEV$M_TRM! - 
DEV$M_CCL> 
UCB, UCBSL_DEVCHAR2,L, -; 

<DEVS$M_NNM> : 


se Se Me Ye Ne 


ve 


CHARACTERISTICS 


UCB, UCBSB | DEVCLASS, B,DC$_TERM 


UCB, UCBSB | DEVTYPE, B, TTS _| UNKNOWN 


UCB, UCB$W_DEVBUFSIZ, W, 132 
UCB, UCBSW_STS, W, UCBS$M_ONLINE 
UCB, UCBSW TT DESIZE, W, 132 


UCB, UCB$W_TT SPEED,W,TT$C_BAUD_300 
UCB, UCB$B_TT DETYPE,B,TT$_LA36 
UCB, UCB$W_TT DESPEE, W, TT$C_BAUD_300 


ORB, ORBSB_FLAGS, B, - 


<ORBSM_PROT_16> 
ORB, ORBSW_PROT, QW, TTYSGW | PROT 
ORB, ORBSL | OWNER, @L, TTYSGL OWNUIC 


UCB, UCBSW__ STS, W, UCBSM | ONLINE 


REINIT 
END 


we TO Ve Ne Ne Ye Ne 


we Ne Ne Me 


OPASGL_DDB, MBSGL_DDB, OPASUCBO, 0, , 0, <OPA>, <OPERATOR> 


THE UCB SIZE INCLUDES 3 BYTES FOR ROUNDUP, AND 64 BYTES OF EXTRA 
SPACE TO ALLOW INCREASING UCB SIZE WITHOUT NEEDING TO BUILD A NEW 


DEFAULT CHARACTERISTICS 


FORK LOCK INDEX 
DEVICE IPL 


DEVICE CHARACTERISTICS 
PREFIX WITH NODES 


TYPE 

BUFFER SIZE 

Device comes up online 
BUFFER SIZE 

DEFAULT SPEED 

TYPE 


SOGW protection word. . 
Default protection: 
Default owner UIC © 
Device comes up online 


Is this needed? 


DIGITAL INTERNAL USE ONLY 223 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 
8 Page 12 
X-8 SYSTEM CONSOLE DEVICE DATABASE 15-SEP-1988 10:32:38 PERMANENT DEVICE DATABASE .MAR;1 (7) 


511 

512 ; 

513 ; CONSOLE UCB 

514 ; 

515 ORB OPASORBO 

516 STO_ORB L_OWNER, LONG, <*x010001> 

517 UCB OPASUCBO, <<UCBSC_TT LENGTH - UCB$C_LENGTH + 3 + 64> / 4>, OPASORBO 
518 STO_UCB B_FLCK, BYTE, SPL$C_IOLOCK8 

519 STO_UCB B DIPL, BYTE, 20 

520 STO_UCB L_CRB, ADDRESS, OPASCRB 

521 STO_UCB L_DLCK, ADDRESS, OPA$SPL 

522 STO_UCB L_DDB, ADDRESS, OPA$GL_DDB 

523 STO_UCB L_DEVCHAR, LONG, <<DEV$M_REC!- 
524 DEV$M_AVL!- 

525 DEV$M_CCL!- 

526 DEV$M_TRM! - 

527 DEV$M_IDV!- 

528 DEV$M_ODV>> 

529 STO_UCB L_DEVCHAR2, LONG, <<DEV$M_NNM>> 
530 STO UCB B DEVCLASS, BYTE,DC$_TERM 

531 STO_UCB L_AFFINITY, LONG, -1 

532 STO_UCB B_DEVTYPE, BYTE, DT$_LA36 

533 STO_UCB W_DEVBUFSIZ, WORD, 132 

534 STO_UCB W_STS, WORD, UCBSM. ONLINE 

535 STO_UCB L_DEVDEPEND, LONG, <<TT$M_LOWER!TT$M_TTSYNC!TTSM_WRAP>> 
536 STO_UCB L_DEVDEPEND+3, BYTE, 24 

537 STO_UCB W_TT _DESIZE, WORD, 132 

538 STO_UCB L_TT DECHAR, LONG, <<TT$M_LOWER!TT$M_TTSYNC!TTSM_WRAP>> 
539 STO UCB L_TT DECHAR+3, BYTE, 24 

540 STO_UCB W_TT SPEED, WORD, TT$C_BAUD_300 
541 STO_UCB B TT DETYPE,BYTE,TT$ LA36_ 

542 STO_UCB W_TT DESPEE, WORD, TT$C_BAUD_300 
543 

544 ; CONSOLE CRB 

545 

546 

547 ASSUME CRB$L_FQFL EQ 0 

548 ASSUME CRBS$L_FOBL EQ 4 

549 -LONG 0,0 ; FLINK, BLINK 
550 «WORD CD-OPASCRB ; SIZE 

551 -BYTE DYNS$C_CRB ; TYPE IS CRB 
552 

553 ASSUME CRB$B_FLCK EQ 11 

554 -BYTE 0 ; FLCK (FORK LOCK INDEX) 
555 

556 ASSUME CRBSI_FPC EQ 12 

557 ASSUME CRBSL_FR3 EQ 16 

558 ASSUME CRBSL FR4 EQ 20 

559 «LONG 0, 0, 0 : FPC, FR3, FR4 
560 

561 ASSUME CRBSL_WOFL EQ 24 

562 ASSUME CRBSL_WOBL EQ 28 

563 -LONG 0,0 

564 

565 ASSUME CRBSB_TT TYPE EQ 32 

566 -LONG 0 ; TT DEVICE TYPE + 3 UNUSED BYTES 
567 


224 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 


8 Page 13 


X-8 SYSTEM CONSOLE DEVICE DATARASE 15-SEP-1988 10:32:38 PERMANENT DEVICE DATABASE.MAR;1 (7) 


568 
569 
570 
571 
572 
573 
574 
575 
576 
577 
578 
579 
580 
581 
582 
583 
584 
585 
586 
587 
588 
589 
590 
591 
592 
593 
594 
595 
596 
597 
598 
599 
600 
601 
602 
603 
604 
605 
606 
607 
608 
609 
610 
611 
612 
613 
614 
615 
616 
617 
618 
619 
620 
621 
622 
623 
624 


ASSUME 
ASSUME 
ASSUME 


- LONG 
ASSUME 
- LONG 


ASSUME 
- LONG 


ASSUME 
- LONG 


ASSUME 
- LONG 


ASSUME 
- LONG 


ASSUME 


CRB$W_REFC EQ 
CRB$B MASK EQ 
CRBSB_UNIT BRK 


CRB$L_AUXSTRUC 
0 


CRBSL_TIMELINK 
0 


CRB$L_DUETIME 
0 


CRB$L_TOUTROUT 
0 


CRBS$L_LINK 
0 


CRBSL_DLCK 


-ADDRESS OPASSPL 


36 
38 
EQ 


EQ 


EQ 


EQ 


EQ 


EQ 


EQ 


39 


40 


44 


48 


52 


56 


60 


REF COUNT=1 AND NEVER BUSY 


ve 


Auxiliary structure ptr. 


=e 


CRB thread for periodic wakeups. 


=e 


Time when to periodically awaken 


we 


ze 


Routine to call at periodic awakening 


NO NEXT CRB 


we 


7 CONSOLE SPINLOCK ADDRESS 


ASSUME <CRBSL_INTD+VECS$L_BUGCHECK> EQ 64 


-BLKB 16 

CONSINTDISI:: 
ASSUME CONSINTDISI-OPASCRB 
ASSUME VECSQ DISPATCH EQ 0 
PUSHR #°M<RO, R1,R2,R3,R4,R5> 
JSB G*CONSINTINP 
ASSUME VECSL_IDB EQ 8 
~ADDRESS OPASIDB 
ASSUME VECSL_INITIAL EQ 12 
- LONG CONSINITIAL 
ASSUME VECSW_MAPREG EQ 16 
ASSUME VECSB_NUMREG EQ 18 
ASSUME VECSB_DATAPATH EQ 19 
-LONG 0 
ASSUME VECS$L_ADP EQ 20 
~ LONG 0 
ASSUME VECSL_UNITINIT EQ 24 
- LONG CONS INITLINE 
ASSUME VECSL_START EQ 28 
~- LONG 0 
ASSUME VECSL_UNITDISC EQ 32 
- LONG 0 
ASSUME VECSW_MAPALT EQ 36 


7e 


# room for multi-level dispatch code 
EQ CRBSL_INTD 


SAVE REGISTERS 
INPUT INTERRUPT SERVICE 


%e Ne 


POINTER TO IDB 


INITIALIZE CONTROLLER ENTRY POINT 


=e 


MAP AND DATA PATH ALLOCATION CONTROL 


=e 


ADDRESS OF ADP 


ze 


INITIALIZE UNIT 


=e 


UNUSED LONGWORD 


ve 


UNUSED LONGWORD 


se 


DIGITAL INTERNAL USE ONLY 225 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 


8 Page 14 


X-8 SYSTEM CONSOLE DEVICE DATABASE 15-SEP-1988 10:32:38 PERMANENT DEVICE DATABASE .MAR;1 (7) 


625 
626 
627 
628 
629 
630 
631 
632 
633 
634 
635 
636 
637 
638 
639 
640 
641 
642 
643 
644 
645 
646 
647 
648 
649 
650 
651 
652 
653 
654 
655 
656 
657 
658 
659 
660 
661 
662 
663 
664 
665 
666 
667 
668 
669 
670 
671 
672 
673 
674 
675 
676 
677 
678 
679 
680 
681 


ASSUME VECSW_NUMALT EQ 38 
- LONG 0 
ASSUME VECS$K_LENGTH EQ 56 
-BLKB 16 

CONSINTDISO: : 
ASSUME CONSINTDISO-OPASCRB 
ASSUME VECSQ DISPATCH EQ 0 
PUSHR #°M<RO,R1,R2,R3,R4,R5> 
JSB G*“CONSINTOUT 
-ADDRESS OPASIDB 
ASSUME VECSL_IDB EQ 8 


CD: 


; 
7 CONSOLE IDB 
; 


=e 


e 
’ 
° 
’ 


ALTERNATE MAP ALLOCATION CONTROL 


room for multi-level dispatch code 


EQ CRBSL_INTD2 


we Se Ne 


Se Ne Ye %e Ye Neo me Ye te Ye &e 


we 


we 


OPAS IDB: : 
ASSUME IDBSL_CSR EQ 0 
-LONG 0 
ASSUME IDB$L_OWNER EQ 4 
-LONG 0 
-WORD ID-OPAS$IDB 
-BYTE DYNS$C_IDB 
-BYTE 0 
ASSUME IDB$W_UNITS EQ 12 
-WORD 6 
-BYTE 0 
-BYTE 0 
ASSUME IDB$B_COMBO_ VECTOR_OFFSET 
-BYTE 0 
-BYTE 0 
-WORD 0 
ASSUME IDBS$L_SPL EQ 20 
-ADDRESS OPAS$SPL 
ASSUME IDBS$L_ADP EQ 24 
-LONG 0 
ASSUME IDB$L_UCBLST EQ 28 
-ADDRESS OPASUCBO 
-LONG 0 
-LONG 0 
-LONG 0 
-LONG 0 
-LONG 0 


we Ve Veo 


CONSOLE DEVICE SPINLOCK 


226 DIGITAL INTERNAL USE ONLY 


me Ne Se Ye Ye 


SAVE REGISTERS 
OUTPUT INTERRUPT SERVICE 
POINTER TO IDB 


CSR ADDRESS 


OWNER UCB ADDRESS 
SIZE OF IDB 

TYPE OF STRUCTURE 
UNUSED 


NUMBER OF UNITS 
TT ENABLE 
CSR OFFSET TO MAIN CSR FOR COMBO STYLE DEV 


EQ 16 
VECTOR OFFSET TO MAIN VECTOR FOR COMBO STY 
UNUSED 
UNUSED 


ADAPTER ADDRESS 


UNIT 0 UCB ADDRESS 

UNIT 1 UCB ADDRESS (FLOPPY) 

UNIT 2 INPUT UCB ADDRESS (FLOPPY) 
UNIT 3 USED BY VENUS ONLY 

UNIT 4 (RESERVED) 

UNIT 5 (RESERVED) 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 


8 Page 15 


X-8 SYSTEM CONSOLE DEVICE DATABASE 15-SEP-1988 10:32:38 PERMANENT DEVICE DATABASE.MAR;1 (7) 
682 OPASSPL:: 


683 
684 
685 
686 
687 
688 
689 
690 
691 
692 
693 
694 
695 
696 
697 
698 
699 
700 
701 
702 
703 
704 
705 
706 
707 
708 
709 
710 
711 
712 
713 
714 
715 
716 
717 
718 
719 
720 
721 
722 
723 
724 
725 
726 
727 
728 
7129 


ASSUME 
ASSUME 
ASSUME 
ASSUME 
-BYTE 
-BYTE 
-BYTE 
-BYTE 


ASSUME 
ASSUME 
» WORD 
«WORD 


ASSUME 
ASSUME 
ASSUME 
«WORD 
- BYTE 


' <¥BYTE 


ASSUME 
- LONG 


ASSUME 
-BLKL 


ASSUME 
- LONG 


ASSUME 
-QUAD 


ASSUME 
- LONG 


ASSUME 
-QUAD 


ASSUME 
- LONG 


ASSUME 
- LONG 


ASSUME 


SPL$B_SPINLOCK 
SPL$B_IPL 
SPL$B_RANK 
SPLS$B_VEC_INX 
a ee 

20 

-1 

0 


SPLSW_OWN_CNT 
SPLSW_WAIT_CPUS 
-1 

0 


SPLSW_SIZE 
SPL$B_TYPE 
SPL$B_SUBTYPE 
SPL$C_LENGTH 
DYNSC_SPL 


EQ 
EQ 
EQ 
EQ 


WNF OO 


EQ 4 
EQ 6 


EQ 8 
EQ 10 
EQ 11 


SPL$C_SPL_DEVICELOCK 


SPLS$L_OWN_CPU 
0 


SPL$L_OWN_PC_ VEC EQ 16 


EQ 12 


SPL$K_PC_VEC_CNT 


SPL$L_WAIT_PC 
0 


SPL$Q_ACQ COUNT 
0 


EQ 48 


EQ 52 


SPL$L_BUSY_WAITS EQ 60 


0 


SPL$Q_ SPINS 
0 


SPL$L_TIMO_INT 
0 


SPL$L_RLS PC 
0 


<.-OPASSPL> 


EQ 64 


EQ 72 


EQ 76 


~e Se Ye Ve 


se “Ne 


me Ne Ne 


=e 


2 
’ 


STRUCTURE AVAILABLE 
IPL = 20 

LOWEST RANK 

OWNER VECTOR INDEX 


NO OWNERS 
NO WAITERS 


STRUCTURE LENGTH 
SPINLOCK CONTROL BLOCK 
DYNAMIC SPINLOCK TYPE 


NO OWNER 


NO PC'S YET 


EQ SPL$K_LENGTH 


DIGITAL INTERNAL USE ONLY 227 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 
8 Page 16 


X-8 SYSTEM PERMANENT MAILBOX DATABASE 15-SEP-1988 10:32:38 PERMANENT DEVICE DATABASE.MAR;1 ( 


731 -SBTTL SYSTEM PERMANENT MAILBOX DATABASE 
732 

7133 ; 

734 ; MAILBOX DDB 

735 ; 

736 DDB MBSGL_DDB,NLS$GL_DDB, MB$GL_UCB1, 0, ,0, <MBA>, <MBDRIVER> 
737 3 

738 ; CLONE MAILBOX UCB 

7139 ; 

740 ; 

741 3: NOTE THAT THIS UCB IS NOT IN THE DDB’S UCB LIST 
742 3; 

743 ORB MBSORBO 

744 STO_ORB L_OWNER, LONG, <*xX010001> 

745 UCB MBSUCBO,0, MBSORBO 

746 STO_UCB W_MB SEED, WORD, 0 

747 STO UCB B FLCK, BYTE, SPL$C_MAILBOX 
748 STO UCB B_DIPL, BYTE, IPL$_MAILBOX 
749 STO_UCB W_MSGMAX, WORD, 20 

750 STO_UCB W_BUFQUO, WORD, -1 

751 STO_UCB L_CRB, ADDRESS, SYS_CRB 

752 3 STO_UCB L_DLCK, ADDRESS, SMP$GL_MAILBOX 
753 STO_UCB L_DDB, ADDRESS, MBSGL |! DDB 

754 STO_UCB 5 a | LINK, ADDRESS, MBSGL | UCB1 
755 STO_UCB L_DEVCHAR, LONG, <<DEV$M _| REC! - 
756 DEV$M_AVL!- 

757 DEVS$M_IDV!- 

758 DEVSM_MBX! - 

7159 DEVSM_ODV!- 

760 DEV$M_SHR>> 

761 STO_UCB L_] DEVCHAR2, LONG, <<DEVS$M_NNM>> 
762 STO_UCB B | | DEVCLASS, BYTE, DC$_! MAILBOX 
763 STO_UCB L , AFFINITY, LONG, -1 

7164 STO_UCB B . DEVTYPE, BYTE, DT$_| MBX 

765 STO_UCB Wi | DEVBUFSIZ, WORD, 256 

766 STO_UCB W_REFC, WORD, 1 

767 STO_UCB W_UNIT, WORD, 0 

768 STO_UCB W. | STS,WORD, UCB$SM_ONLINE 

769 STO_UCB Ww | DEVSTS, WORD, UCBSM_} PRMMBX 
770 STO_UCB L DDT, LONG, 0 

771 MBSMBO_END: 

772 SYS$C_MBXUCBSIZ == <MBS$MBO_END ~ MBSUCBO> 

173 

774 3 

775 3: SYSTEM JOB CONTROLLER MAILBOX 

776 ; 

177 -ALIGN QUAD 


778 SYS$GL_JOBCTLMB: : 
779 SYS$C_JOBCTLMB==“*A/MBA1/ 


780 UCB MBSGL_UCB1,0, MB$GL_ORB1 

781 STO UCB L_FOFL, ADDRESS, MB$GL_UCB1 
782 STO UCB L_FOFL+4, ADDRESS, MB$GL_UCB1 
783 STO UCB B FLCK, BYTE, SPLSC_MAILBOX 
784 STO UCB B DIPL, BYTE, IPL$_MAILBOX 
785 STO_UCB W _MSGMAX, WORD, 60 

786 STO_UCB W_BUFQUO, WORD, -1 

787 STO UCB L_CRB, ADDRESS, SYS_CRB 


228 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 
8 Page 17 
X-8 SYSTEM PERMANENT MAILBOX DATABASE 15-SEP-1988 10:32:38 PERMANENT DEVICE _DATABASE.MAR;1 ( 


788 ; STO UCB L_DLCK, ADDRESS, SMP$GL_MAILBOX 
789 STO_UCB L_ DDB, ADDRESS,MBSGL_DDB 

790 STO UCB L LINK, ADDRESS, MBSGL | UCB2 
791 STO_UCB L | | DEVCHAR, LONG, <<DEVSM | REC! - 
7192 DEV$M_AVL!- 

793 DEV$M_MBX!- 

794 DEVS$M_IDV!- 

795 DEV$M_ODV!- 

796 DEV$M_SHR>> 

7197 STO_UCB L _ DEVCHAR2, LONG, <<DEVSM _1 NNM>> 
798 STO UCB B | DEVCLASS, BYTE, DC$_1 MAILBOX 
799 STO_UCB L_AFFINITY, LONG, -1 

800 STO_UCB W_DEVBUFSIZ, WORD, 1024 

801 STO_UCB W_REFC, WORD, 1 

802 STO_UCB W_UNIT,WORD,1 

803 STO_UCB W_STS, WORD, UCB$M_ONLINE 

804 STO_UCB W_DEVSTS, WORD, <UCBSM_PRMMBX+*X08000> 
805 STO_UCB L_ DDT, LONG, 0 

806 ORB MBSGL_ORB1 

807 STO_ORB L_OWNER, LONG, <*X010004> 

808 STO_ORB W_PROT, WORD, <“XOFFOF> 

809 ; 

810 ; SYSTEM OPERATOR MAILBOX 

811 ; 

812 -ALIGN QUAD 

813 SYS$GL_OPRMBX:: 

814 SYS$C_OPRMBX==*A/MBA2/ 

815 UCB MB$GL_UCB2,0, MB$GL_ORB2 

816 STO_UCB L_FQFL, ADDRESS, MBSGL_UCB2 
817 STO_UCB L_FOFL+4, ADDRESS, MBSGL_UCB2 
818 STO_UCB B FLCK,BYTE,SPL$C_MAILBOX 
819 STO_UCB B DIPL, BYTE, IPL$ MAILBOX 

820 STO UCB W_MSGMAX, WORD, 20 

821 STO_UCB Wi | BUFQUO, WORD, -1 

822 STO UCB L. _ CRB, ADDRESS, SYS_CRB 

623 ; STO_UCB oe | DLCK, ADDRESS, SMPSGL | MAILBOX 
824 STO_UCB L | DDB, ADDRESS, MBSGL _| DDB 

825 STO_UCB a , LINK, ADDRESS, MBSGL_ UCB3 
826 STO_UCB L | | DEVCHAR, LONG, <<DEVSM | REC!- 
827 DEVSM . AVL! - 

828 DEVSM_MBX!- 

829 DEV$M_IDV!- 

830 DEV$M_ODV!- 

831 DEV$M_SHR>> 

832 STO UCB L _ DEVCHAR2, LONG, <<DEV$M_NNM>> 
833 STO_UCB B | ) DEVCLASS, BYTE, DC$_} MAILBOX 
834 STO UCB L_AFFINITY, LONG, -1 

835 STO _UCB Wi | DEVBUFSIZ, WORD, 2560 

836 STO_UCB W | REFC, WORD, 1 

837 STO_UCB Wi | UNIT, WORD, 2 

838 STO_UCB W_STS, WORD, UCBSM_ONLINE 

839 STO_UCB W DEVSTS, WORD, UCB$M_PRMMBX 
840 STO_UCB L_DDT, LONG, 0 

841 ORB MBSGL_ORB2 

842 STO_ORB L_OWNER, LONG, <*X010004> 

843 STO_ORB W_PROT, WORD, <*XOFFOF> 

644 ; 


DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE ~ Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 
8 Page 18 


X-8 SYSTEM PERMANENT MAILBOX DATABASE 15-SEP-1988 10:32:38 PERMANENT DEVICE _DATABASE.MAR;1 ( 


845 : AUDIT SERVER MAILBOX 
846 ; 
847 -ALIGN QUAD 


848 SYS$GL_AUDSRVMBX:: 
849 SYS$C_AUDSRVMBX==“A/MBA3/ 


850 UCB MB$GL_UCB3,0, MB$GL_ORB3 

851 STO_UCB L_FQFL, ADDRESS, MB$GL_UCB3 
852 STO_UCB L_FOQFL+4, ADDRESS, MBSGL_UCB3 
853 STO_UCB B_FLCK, BYTE, SPL$C_MAILBOX 
854 STO_UCB B DIPL, BYTE, IPL$_ MAILBOX 

855 STO_UCB W_MSGMAX, WORD, 20 

856 STO_UCB W_BUFQUO, WORD, -1 

857 STO UCB L_CRB, ADDRESS, SYS_CRB 

858 ; STO_UCB L_DLCK, ADDRESS, SMP$GL_MAILBOX 
859 STO _UCB L_DDB, ADDRESS, MBSGL_DDB 

860 STO_UCB L_DEVCHAR, LONG, <<DEV$M_REC!- 
861 DEV$M_AVL! - 

862 DEVS$M_MBX! - 

863 DEV$M_IDV! - 

864 DEV$M_ODV! - 

865 DEVS$M_SHR>> 

866 STO_UCB L_DEVCHAR2, LONG, <<DEV$M_NNM>> 
867 STO_UCB B_DEVCLASS, BYTE,DC$_MAILBOX 
868 STO_UCB L_AFFINITY, LONG, -1 

869 STO_UCB W_DEVBUFSIZ, WORD, 2560 

870 STO_UCB W_REFC, WORD, 1 

871 STO_UCB W_UNIT, WORD, 3 

872 STO_UCB W_STS, WORD, UCBSM_ONLINE 

873 STO_UCB W_DEVSTS, WORD, UCBSM_PRMMBX 
874 STO_UCB L_DDT,LONG, 0 

875 ORB MBSGL_ORB3 | 

876 STO_ORB L_OWNER, LONG, <*X010004> 

877 STO_ORB W_PROT, WORD, <“XOFFOF> 


230 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT_DEVICE_ DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 


8 Page 19 


X-8 NULL DEVICE (NLA) DATABASE 15-SEP-1988 10:32:38 PERMANENT DEVICE _DATABASE.MAR;1 (9) 
-SBTTL NULL DEVICE (NLA) DATABASE 


879 
880 
881 
882 
883 
884 
885 
886 
887 
888 
889 
890 
891 
892 
893 
894 
895 
896 
897 
898 
899 
900 
901 
902 
903 
904 
905 
906 
907 
908 
909 
910 


™e Se Ne 


™e te Ne 


=e Ye 


NLA DDB 


DDB 


NL$GL_DDB,0,NL$GL_UCBO, 0, ,0, <NLA>, <NLDRIVER> 


NL UCB FOR UNIT 0 


ORB 


UCB 


NL$GL_ORBO 


STO_ORB 


L_OWNER, LONG, <*X010001> 


NL§GL_UCBO,0, NLS$GL_ORBO 


STO_UCB 
STO_UCB 
STO_UCB 
STO_UCB 
STO_UCB 
STO_UCB 
STO_UCB 


STO_UCB 
STO_UCB 
STO_UCB 
STO_UCB 
STO_UCB 
STO_UCB 
STO_UCB 
STO_UCB 


B_FLCK, BYTE, SPL$C_IOLOCK8 
B_DIPL, BYTE, 8 

L_CRB, ADDRESS, SYS_CRB 

L_DLCK, ADDRESS, SMP$GL_MAILBOX 
L_DLCK, ADDRESS, SMP$GL_IOLOCK8???? 
L_DDB, ADDRESS, NL$GL_DDB 
L_DEVCHAR, LONG, <<DEV$M_REC! - 
DEVSM_AVL! - 

DEV$M_MBX! - 

DEV$M_IDV! - 

DEV$M_ODV!- 

DEVS$M_SHR>> 

B DEVCLASS, BYTE,DC$ MAILBOX 
L_AFFINITY, LONG, -1 
B_DEVTYPE, BYTE, DT$ NULL 
W_DEVBUFSIZ, WORD, 512 

W_REFC, WORD, 1 

W_UNIT, WORD, 0 
W_STS, WORD, UCB$M_ONLINE 
L_DDT, LONG, 0 


DIGITAL INTERNAL USE ONLY 231 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE - Miscellaneous system area - base image 10-MAY-1989 16:57:36 VAX 


8 Page 20 


X-8 NETWORK DEVICE DATABASE 15-SEP-1988 10:32:38 PERMANENT DEVICE DATABASE .MAR;1 (10) 


912 
913 
914 
915 
916 
917 
918 
919 
920 
921 
922 
923 
924 
925 
926 
927 
928 
929 
930 
931 
932 
933 
934 
935 
936 
937 
938 
939 
940 
941 
942 
943 
944 
945 
946 
947 
948 
949 
950 
951 
952 
953 
954 
955 
956 
957 
958 
959 
960 
961 
962 
963 
964 
965 
966 
967 
968 


YS_CRB: 


ze 


-SBTTL NETWORK DEVICE DATABASE 


ASSUME 
ASSUME 
- LONG 
-WORD 
-BYTE 
ASSUME 
-BYTE 
ASSUME 
ASSUME 
ASSUME 
- LONG 
ASSUME 
ASSUME 
- LONG 
ASSUME 
- LONG 
ASSUME 
ASSUME 
ASSUME 
- LONG 
ASSUME 
- LONG 
ASSUME 
- LONG 


ASSUME 
- LONG 


ASSUME 
» LONG 


ASSUME 
- LONG 


ASSUME 


CRB$L_FOFL £Q 
CRBSL_FQBL EQ 
0,0 
10$-SYS_CRB 
DYN$C_CRB 
CRB$B_FLCK £Q 
0 

CRBSL_FPC EQ 
CRBSL_FR3 EQ 
CRBSL_FR4 EQ 
0, 0, 0 
CRBSL_WOFL EQ 
CRBS$L_WOBL £Q 
0,0 

CRBSB_TT TYPE 
0 

CRB$W_REFC EQ 
CRB$B_MASK EQ 
CRB$B_UNIT_BRK 
0 
CRB$L_AUXSTRUC 
0 
CRB$L_TIMELINK 
0 


CRBS$L_DUETIME 
0 


CRB$L_TOUTROUT 
0 


CRB$L_LINK 
0 


CRBSL_DLCK 


0 
4 


il 
12 
16 
20 


24 
28 


EQ 
36 
38 
EQ 
EQ 


EQ 


EQ 


EQ 


EQ 


EQ 


-ADDRESS SMP$GL_ MAILBOX 


- LONG 


0 


COMMON CRB FOR MAILBOX TYPE DEVICES 


32 


39 


40 


44 


48 


52 


56 


60 


7 


ee Yeo Ve 


we 


ze 


™e 


me =e 


=e ~™e ™e 


=e 


e 
a 
e 
’ 


CRB LIST HEAD 
SIZE 
TYPE 


FLCK 


FPC, FR3, FR4 ~ 


TT DEVICE TYPE + 3 UNUSED BYTES 


REF COUNT=0 AND NEVER BUSY 
Auxiliary structure ptr. 


CRB thread for periodic wakeups. 

Time when to periodically awaken 
Routine to call at periodic awakening 
NO NEXT CRB 


SPINLOCK ADDRESS 
INITIALIZED BY INIT CODE 


ASSUME <CRBSL_INTD+VEC$L_BUGCHECK> EQ 64 


-BLKB 
ASSUME 
ASSUME 

» LONG 


ASSUME 


16 | 
.-SYS_CRB 
VEC$Q_ DISPATCH 
0,0 


VEC$L_IDB 


-ADDRESS SYS_CRB 


ASSUME 
ASSUME 
ASSUME 


VECS$L_INITIAL 
VECS$W_MAPREG 
VEC$B_NUMREG 


232 DIGITAL INTERNAL USE ONLY 


e 
e 


room for multi-level dispatch code 


EQ CRB$L_INTD 


EQ 


EQ 


EQ 
EQ 
EQ 


0 


12 
16 
18 


e 
a 


e 
co 


NO INTERRUPT VECTOR 


POINTER TO FAKE IDB 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PERMANENT DEVICE DATABASE ~ Miscellaneous system area ~ base image 10~MAY-1989 16:57:36 VAX 
8 Page 21 
X-8 NETWORK DEVICE DATABASE 15-SFP-1988 10:32:38 PERMANENT DEVICE DATABASE.MAR;1 (10) 


969 ASSUME VECSB_DATAPATH EQ 19 
970 ASSUME VECSL_ADP EQ 20 
971 ASSUME VECSL_UNITINIT EQ 24 
972 ASSUME VECSL_START EQ 28 
973 ASSUME VECSL_UNITDISC EQ 32 
974 ASSUME VECSW_MAPALT EQ 36 
975 ASSUME VECSW_NUMALT EQ 38 
976 -LONG 0,0,0,0,0,0,0 ? NO INITIALIZATION FOR CONTROLLER OR UNIT 
977 

978 ASSUME VECSK_LENGTH EQ 56 
979 -BLKB 16 # room for multi-level dispatch code 
980 108: 

981 ASSUME 10$-SYS_CRB EQ CRBSL_INTD2 
982 

983 

984 

985 OPASVECTOR: 

986 SVECINI OPA, CONSNULL 

987 

988 SVEC STARTIO, CONSSTARTIO 

989 SVEC DISCONNECT, CONSDISCONNECT 
990 SVEC SET_LINE, CONSSET_LINE 

991 SVEC DS_SET,CONSDS_ SET 

992 SVEC XON, CONSXON 

993 SVEC XOFF , CONSXOFF 

994 SVEC STOP, CONS STOP 

995 $VEC STOP2, CONSSTOP2 

996 SVEC ABORT, CONSABORT 

997 SVEC RESUME, CONS RESUME 

998 $VEC SET MODEM, CONSSET_MODEM 
999 
1000 S$VECEND 


1001 -END 


DIGITAL INTERNAL USE ONLY 233 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


7 LDAT.LIS 


LDAT - SPIN LOCK DATA BASES 10-MAY~-1989 16:57:58 VAX MACRO V5.0-8 Page 0 
Table of contents 


(2) 350 SPINLOCK DATA STRUCTURES 


234 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 1 
X-35 23-NOV-1988 14:12:56 $254SDUAS55: [SYS.SRC]LDAT.MAR;1 (1) 


ODA uh WD e 


NNNNAN EPR BPP BEEP BP HPP eB 
&2WNF OO DTA UU &® WN Ee O 
Se te Me Se Me Ne Se Ye Se Se “eo Ye Se Ye Ye Ye Ne Ve Ve Ye Ne Ye Ye Ye Ve 


25 


27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 


45 
46 
47 
48 
49 
50 
51 


53 
54 
55 
56 
57 


ee 


=e te Ye Se Be 


_s 


se Me Me Ne Me Me 


™e Te Ve Ye ea Ve Xe 


Me Ne Ne Re Se Se Ye Ne 


me Ne 


+t + © + ££ He + & 6 He ££ HF FF HF HF HE HH HE HE FF 


+ 
+ 


-TITLE LDAT - SPIN LOCK DATA BASES 
~IDENT ‘'X=-35' 


COPYRIGHT (c) 1987, 1988 BY 
DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. 
ALL RIGHTS RESERVED. 


THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED 
ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE 
INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER 
COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY 
OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY 
TRANSFERRED. 


THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE 
AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT 
CORPORATION. 


DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS 
SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. 


SYSTEM SPIN LOCKS 


AUTHOR: Rod Gamache 16-Jul-1985 


MODIFIED BY: 


X-35 EMB0369 Ellen M. Batbouta 21-Nov-1988 
The spinlocks, EMB and MCHECK, are now one spinlock. 
The spinlock vector table for EMB and MCHECK contains 
the address of SMP$GL_EMB for both vectors. 


X-34 MSHO350 Michael S. Harvey 17-Oct-1988 


HIKE KKH IKK KEK IK KH KHER KEKE KEI KHKE RE KKKKKREREKEKEKEKEEKEKKEKEKEKKKRKKKKKK 


+ ££ e+ yo + + yy» + HF He BH He H&E He HF HF HH OF 


[eS SESESLRSLELASELASRASALELSSLESZERE REESE SSE SSE SERS ERE SEES ESSE SESE SESE SES SELES ESS SE SS 


Replace references to IPL$_ SYNCH on originally defined locks 


with the lock specific IPL symbols, as was done for more 


recently added locks. Also, replace hardcoded IPL constants 


with symbols. 

X-33 RNG5033 Rod Gamache 23-Jul-1987 
Change IPL of INVALIDATE spinlock back to IPL 19. 
Make OWN CPU and RLS PC fields of SPL structure init to 0. 


X~-32 MSHO0313 Michael S. Harvey 15-May-1987 
Add longword for PC of releaser of multiple acquisitions. 


X-30 SUF Stu Farnham 11-May-1987 
Change IPL of INVALIDATE and VIRTCONS to 20. 


X-29 RNG5029 Rod Gamache 24-Mar-1987 


DIGITAL INTERNAL USE ONLY 235 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT ~- SPIN LOCK DATA BASES 10-MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 2 
X-35 23-NOV-1988 14:12:56 $254SDUA55: [SYS.SRC]LDAT.MAR;1 (1) 


58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 


107 
108 
109 
110 
111 
112 
113 
114 


me Se Me Me Se Me Ne Te Me Ye Me Ne Ne Ye Se Ne Ye Ye Ye 


me Ye Ye Ye Ye Ve Yo Se Ye Te Ye Te Yo Ye Ve Neo Ve We Ye Ve Se Vo Ys Ve We Ne Ve Vo ~e Ye Se Te 


se Se Ve Ne Ye Ne 


X-28 


X-27 


X-26 


X-25 


X-24 


X-23 


X~-22 


X-21 


X-20 


X~-19 


X-18 — 


X-17 
X-16 
X-15 


X-14 


Compress spinlock indices into range 20-3F (HEX). 


RNG5028 Rod Gamache | 12-Mar-1987 
Move JIB to below MMG in ranking. MMG should always 
be adjacent to SCHED to allow pool extension to work 
correctly. 


MSH0307 Michael S. Harvey 10-Mar-1987 
Add JIB and ASTDEL spinlocks. Also, simplify the way 
that forklocks are treated. 


RNG5026 Rod Gamache 3-Mar-1987 
Add MEGA synchronization spinlock. 


MJWO113 Michael J. Worcester 26-Feb-1987 
Change reference to DYNSC_SPL_ ‘'LOCKTYPE’ in SPINLOCK 
MACRO to SPLSC_SPL_ "LOCKTYPE’ . 


MSH0246 Michael S. Harvey 10-Feb-1987 
Remove obsolete spin counter in spinlock structures. 


RNG5023 Rod Gamache 30-Dec-1986 

Create an IPL vector which corresponds to the spinlock 

vector, but contains only IPLs. To be used for uniprocessor 
forklocking. Remove all vestiges of SMPSAR_RANK_MAP vector. 
Check that all forklocks have a rank higher than SPLSC_FORKLOCK. 
Create a spinlock vector that contains SPL$C_MAXLOCK entries. 


MSH0285 Michael S. Harvey 8-Dec-1986 
Remove BUSERR spinlock. 


RNGOO21 Rod Gamache 8-Dec-1986 
Move SPLS$L_TIMO_INT after the reserved longword. 


SUF Stu Farnham 8-Dec-1986 
Reorder FILSYS, IOLLOCK8, and PR_LK8. Place VIRTCONS 
spinlock correctly with respect to IPL. 


SUF Stu Farnham 18-Nov-1986 
Initialize SPLS$L_TIMO_ INT. 


MSH0285 Michael S. Harvey 4-Nov-1986 
Move MCHECK below EMB. 


MSH0285 Michael S. Harvey 29-Oct-1986 
Add machine check spinlock. 


RNGO0O16 Rod Gamache 28-Oct-1986 
Add check for IPL’s associated with each spinlock database. 


RNGOO15 Rod Gamache 24-Oct-1986 
Remove XDELTA spinlocks, add BUSERR spinlock. 


SUF Stu Farnham 13-Oct-1986 
Add virtual console spinlock. Deo absolutely nothing to 
the ranking of MMG, SCHED, and FILSYS. 


236 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT ~- SPIN LOCK DATA BASES 10-MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 3 
X-35 23-NOV-1988 14:12:56 $254$DUA55: [SYS.SRC]LDAT.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 


™e Me Te Te Ne Se Be Veo Xe 


me Se Te Ye Te Ve Se Se Ne Ye Ve Ve Ye Se Ye Ye Ye Ye Ne Ye Ye Ye Ye Ws Ye Se Ne Ye Ye Ne Se Ve Ye Ve 


me Ye Ve Be Ve Ve Be We We Ye We Ve Ve Xe 


X-13 


X-12 


X-11 


X-10 


X~6H10 


X-6H9 


X-6H8 


X-6H7 


X-6H6 


X-6H3 


RNGOO13 Rod N. Gamache 24-Sep-1986 . 
Move MMG spinlock up next to SCHED again! Also move 
FILSYS spinlock above both IOLOCK8 and PR_LOCKS. 


WCTOO1 Ward C. Travis 21-Aug-1986 
Add a PSECT to contain the label for the spinlock 
rank mapping vector, a new database to facilitate 
dynamic reordering of lock IPLs. Alter SPINLOCK 
macro to fill the rank map in at link. 


MSH0274 Michael S. Harvey 10-Aug-1986 
Move MMG back to where it was. PAGEFAULT and WRTMFYPAG 
still need MMG across build-pkt routines, which will 
acquire IOLOCK8. 


RNGOO10 Rod Gamache 30-Jul-1986 
Shuffle spinlocks again! Try moving MMG Peberscre up 
next to SCHED. 


SUF Stu Farnham 28-Jul-1986 
Rename IPINT spinlock to INVALIDATE to better reflect 
its function under the latest implementation of 
interprocessor interrupts. 


MSH02 66 Michael S. Harvey 23-Jul-1986 - 

Force IPINT spinlock’s IPL to the lower of two legal 

values, the value which is valid for existing multiprocessors. 
This will be restored later when I write a generalized 

routine for modifying a given spinlock’s IPL value and 
reordering the spinlock rank assignments accordingly. Such 
rank reordering is necessary to prevent rank or IPL violations 
when attempting to acquire/release adjacently ranked spinlocks 
whose IPLs have been modified. 


RNG6010 Rod Gamache 24-Jun-1986 
Switch the order of TIMER and SCHED spinlocks... 
EXESRMVTIMQ deallocates pool, which may need the SCHED 
SPINLOCK. 


SUF Stu Farnham 17-Jun-1986 
Change IPL of IPINT spinlock to 21 


MSH0252 Michael S. Harvey 16-Jun-1986 
Add spinlock data structure longword to the control block. 


RNG6007 Rod Gamache 13-Jun-1986 

IOLOCK8 can’t be lowest ranked spinlock at IPL 8 - PAGEFAULT 
calls the driver with MMG held! Therefore MMG must be below 
IOLOCK8! 


MSH0250 Michael S. Harvey 12-Jun-1986 
Remove initial IPL control since a new mechanism renders 
this feature obsolete. 


RNG6003 Rod Gamache 10-Jun-1986 


Shuffle spinlocks - move IOLOCK8 to lowest ranked spinlock 
at IPL 8. 


DIGITAL INTERNAL USE ONLY 237 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 4 
X-35 23-NOV-1988 14:12:56 $254$DUAS55: [SYS.SRC]LDAT.MAR;1 (1) 


172 
173 
174 
175 
176 
177 
178 
179 
180 
181 
182 
183 
184 
185 
186 
187 
1868 
189 
190 
191 
192 
193 
194 
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 


we 


~e te Me Ne Se Te Ye Ve Ne Ve Ve We Ve Ve 


Se Ve Se Ne Ye Se Ye 38 Te Ye Yeo Ye Se Ye Te Se Yeo Ne Ye Ne Ye Ve Ne Ye Se Yea Ne Ne Ve Ye Ye Ve Neo 


X-6H2 


X-6F8 


X-6F7 


X-6F6 


X-6F5 


X-6F4 


X-1A5 


X-1A4 


X-1A3 


X-1A2 


RNG6002 Rod Gamache 5-Jun-1986 

Make sure that all SPINLOCKS have an IPL above 3. Also, 
make sure that SPINLOCK database match constants defined 
in SPLCODDEF. 


MSH0243 Michael S. Harvey 20-May-1986 
Close off structure interlock vs. ownership by allowing 
the ownership counter to served as the indicator of 

a spinlock being owned. 


MSH0246 Michael S. Harvey 15-May-1986 

Add acquisition counts to the list of assumed offsets 
for spinlock data structures in the spinlock declaration 
macro. 


MSH0243 Michael S. Harvey 15-May-1986 
Snug up the allocation of rank values from highest 
possible value down, rather than from lowest possible 
value up. 


RNGO605 Rod N. Gamache 14-May-1986 
Add name to SPINLOCK structure. 


MSHO0243 Michael S. Harvey 13-May~1986 
Reverse the specification of rank. A higher rank 
has a lower valued rank number assigned. 


SUF Stu Farnham 9-May~1986 
Add IPL 22 interprocessor interrupt spinlock. This 
is because of the INCRDIBLE HACK which requires that 
CPUs which have their IP interrupts at IPL 22 LOWER 
IPL to 21. 


SUF Stu Farnham 23-Apr~1986 
Add primary cpu boot fork locks 


RNG4003 Rod Gamache 6-Nov-1985 

Place IOLOCK8 spinlock after MMG spinlock (ie make IOLOCK8 
have a higher rank than MMG). This allows SWAPPER/PAGEFAULT 
to initiate I/O while holding the MMG spinlock. 


RNG4002 Rod Gamache 8-Oct-1985 

Add new SPINLOCKS for second SMP baselevel, new LOCKS 
are for each IPL for queue, QUEUEAST, IOLOCK8, IOLOCKS, 
IOLOCK10, IOLOCK11. Remove KERNEL lock. Make the init 
IPL = real IPL for spinlocks intended for forking. 


238 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY~1989 16:57:58 VAX MACRO V5.0-8 Page 5 
X-35 23-NOV-1988 14:12:56 $254$DUAS5S: [SYS.SRC])LDAT.MAR;1 (1) 


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


™e “se Ye 


SDYNDEF 
SIPLDEF 
SPRDEF 

$SPLDEF 


MACRO LIBRARY CALLS > 


$SPLCODDEF 


LOWEST RANK = 30 


me Ye Ne 


ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 


we Ye Ne 


NAME 


IPL 


™e “Me Se Ye Ve Ne Ne Ve Ye Ye Ve 


SPLS$B_SPINLOCK 
SPLS$B_IPL 
SPLS$B_RANK 
SPL$B_VEC_INX 
SPL$W_OWN_ CNT 
SPLSW_WAIT CPUS 
SPLS$W_SIZE 
SPLS$B_TYPE 
SPL$B_ SUBTYPE 
SPLSL_ OWN CPU 


SPLS$L_OWN_PC_VEC EQ 


SPL$L_WAIT PC 


EQ 
EQ 
EQ 
EQ 
EQ 
EQ 
EQ 
EQ 
EQ 
EQ 


EQ 


SPL$Q_ACQ COUNT EQ 


SPLS$L_BUSY WAITS EQ 


SPL$Q_SPINS 
SPL$L_TIMO_INT 
SPL$L_RLS_PC 
SPL$K_LENGTH 


MACRO DEFINITIONS: 


EQ 
EQ 
EQ 
EQ 


~e Ye Ye Ve Ve 


se Se “Ne Ne Ne Se Ne Ne Se No 


DEFINE DATA STRUCTURE TYPE CODES 
DEFINE INTERRUPT PRIORITIES 
DEFINE PROCESSOR REGISTERS 
DEFINE SPIN LOCK STRUCTURES 
DEFINE SPINLOCK INDEX CODES 


DEFINED RANK RANGE IS CURRENTLY 
FROM 0-31. RANK 31 IS RESERVED FOR 
ALL DEVICELOCKS, SO THE VALID RANGE 
FOR SYSTEM SPINLOCKS IS 0-30. 


EXTENDING THE RANGE TO GREATER 
THAN A LONGWORD OF BITS REQUIRES 
MODIFICATIONS IN THIS MODULE AS 
WELL AS IN THE CODE THAT ACQUIRES 
AND RELEASES SPINLOCKS. 


Add some ASSUMES which the SPINLOCK macro below depends upon. 


SPINLOCK, a macro to create a spinlock database entry 


= The name of the spinlock. This string is equivalent 
to the name of the lock as specified in the various 
spinlock acquisition and release macros. 


= Specifies the synchronization IPL that is to be associated 
with the spinlock. When this lock is acquired, the acquiring 
CPU's IPL will be set to this value. 


DIGITAL INTERNAL USE ONLY 239 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 6 
X-35 23-NOV-1988 14:12:56 $254$DUA55: [SYS.SRC])LDAT.MAR;1 (1) 


278 ; Many spinlocks with an IPL that is in the range of software 
279 ; interrupts are potentially usable as forklocks, whether 
280 ; that is their primary use or not. Verify that the indices 
281 ; of these spinlocks are in the range required for forklocking. 
282 ; 

283 ; LOCKTYPE= Generates the subtype field of the spinlock data structure 
284 ; to indicate the expected primary use of the spinlock. 

285 ; 

286 

287 -MACRO SPINLOCK NAME, IPL, LOCKTYPE=SP INLOCK, EQUATE 

288 

289 ASSUME IPL EQ IPL$_’'NAME 

290 -LIF NDF SS$SRANK, S$$S$RANK = 0 

291 ASSUME $S$SRANK EQ <SPLS$C_’NAME~SPLS$_MIN_INDEX> 

292 ..-RANK ‘NAME = S$S$SRANK 

293 -IIF LT LOWEST _RANK-S$S$SRANK, .ERROR ; OVERRAN RESERVED DEVICELOCK RANK 
294 -IIF NDF $$$IPL, $$$IPL = 31 

295 -IIF GT IPL-S$SIPL, .ERROR ; OUT OF ORDER RANKING DETECTED 

296 S$$SIPL = IPL 

297 

298 -IF DIF <NAME>, <ASTDEL> 

299 -IIF GE 3-IPL, .ERROR ; IPL VALUE DOESN’T PREVENT RESCHEDULING ON SMP 
300 -ENDC 

301 

302 -IF B EQUATE 

303 -PSECT EXECSSMP_DDD, QUAD, WRT, NOEXE, PIC 

304 -ALIGN QUAD 

305 SMP$GL_’NAME:: 7 Name of spinlock 

306 -BYTE 0 3 Structure not currently interlocked 
307 -BYTE IPL 7 Synchronization level for lock 

308 -BYTE $S$SRANK + RANK for lock 

309 -BYTE 0 # PC vector index 

310 -WORD -1 z Owned if positive 

311 - WORD 0 3 Waiting CPUs 

312 -WORD SPLS$C_LENGTH # Length of spinlock control block 
313 -BYTE DYNSC_SPL 7 Data structure type code 
314 -BYTE SPL$C_SPL_’ LOCKTYPE’ # Spinlock subtype code 

315 -LONG 0 3 Physical ID of owning CPU 

316 -BLKL SPLS$K_PC_VEC_CNT ? PC history of owning CPU 

317 -LONG 0 7 PC of waiting CPU 

318 - QUAD 0 3 Number of successful acquisitions 
319 -LONG 0 7 Number of failed acquisitions 

320 - QUAD 0 # Number of spins 

321 -LONG “X7FFFFF ; Longest possible timeout interval 
322 -LONG 0 7 PC of last releaser of multiple acquisitio 
323 -ENDC 

324 S$SRANK = S$$$RANK+1 

325 -PSECT EXECS$SMP_BBB, LONG, WRT, NOEXE, PIC 

326 -=4*<SPLSC_’NAME-SPL$ MIN_INDEX> 

327 -IF B EQUATE 

328 .- ADDRESS SMPSGL_’ NAME # Enter spiniock address in vector 
329 -IFF 

330 -ADDRESS SMPSGL_ ‘EQUATE ; Enter address of equivalent spinlock 
331 -ENDC 

332 -PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 

333 .=4*<SPLS$C_’NAME-SPL$ MIN _INDEX> 

334 - LONG IPL 


240 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY~-1989 16:57:58 VAX MACRO V5.0-8 Page 7 
X-35 23-NOV-1988 14:12:56 $254$DUA55: (SYS.SRC]LDAT.MAR;1 (1) 


335 
336 
337 
338 
339 
340 
341 
342 
343 
344 
345 
346 
347 
348 


° 
, 


-LIST 


SP INLOCK 


; VERIFY IPL SYMBOLS: 


° 
co 


ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 
ASSUME 


IPL$_SYNCH 
IPL$_ SYNCH 
IPL$_ SYNCH 
IPL$ SYNCH 
IPL$_SYNCH 
IPL$_SYNCH 


EQ 
EQ 
EQ 
EQ 
EQ 
EQ 


IPL$ SCHED 
IPL$_MMG 
IPL$ FILSYS 
IPL$ TIMER 
IPL$_SCS 
IPL$ JIB 


DIGITAL INTERNAL USE ONLY 241 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 8 
X-35 SPINLOCK DATA STRUCTURES 23-NOV-1988 14:12:56 _§$254$DUA55: [SYS.SRC]LDAT.MAR;1 (2) 


350 -SBTTL SPINLOCK DATA STRUCTURES 
351 

352 -PSECT EXEC$SMP_CCC, LONG, WRT, NOEXE, PIC 
353 

354 SMP$GL_IPL_VEC==.-<4*SPL$ MIN _INDEX> 
355 

-356 

357 - LONG O(SPL$_NUM_LOCKS] 


BIAS IPL vector from starting index 
IPL vector (only used within loadable 
image - so not universal). 

Create vector of maximum IPLs 


=e Ye Se Neo 


358 

359 -PSECT EXEC$SMP_AAA, LONG, WRT, NOEXE, PIC 
360 
361 
362 
363 
364 
365 -PSECT EXEC$SMP_BBB, LONG, WRT, NOEXE, PIC 
366 

367 SMP$GL_SPNLKVEC==.-<4*SPL$ MIN INDEX> 

368 -LONG O[SPL$_NUM_ LOCKS] 


+ 
SPINLOCK DATA STRUCTURE ADDRESS TABLE 


=e Ve Se 


BIAS SPINLOCK vector from starting 
Create vector of maximum locks 


=e Ne 


369 
370 ; Vector of SPINLOCK addresses follow here 
371 
372 ;++ 
373 ; SPINLOCK STRUCTURES, ORDERED BY DECREASING RANK. 
374 ; 
375 ; RANK VALUES ARE ASSIGNED IN REVERSE ORDER. HIGHER NUMBERED 
376 ; VALUES INDICATE LOWER SPINLOCK RANK. 
377 3 
378 
379 
380 
381 
382 
383 SP INLOCK NAME=<EMB>, IPL=IPL$_EMB 
-PSECT EXECSSMP_DDD, QUAD, WRT, NOEXE, PIC 
SMPS$GL_EMB: : EMB of spinlock 


=e Se Se 


me “eo 


- BYTE 0 Structure not currently interlocked 
-BYTE IPLS_EMB # Synchronization level for lock 
- BYTE $$S$RANK 7 RANK for lock 

- BYTE 0 7 PC vector index 

-WORD -1 7 Owned if positive 

-WORD 0 7 Waiting CPUs 


-WORD SPLS$C_LENGTH Length of spinlock control block 


242 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY~-1989 16:57:58 VAX MACRO V5.0-8 Page 9 


X-35 SPINLOCK 


384 
385 
386 
387 
388 
389 
390 


391 
392 
393 
394 
395 


396 


- BYTE 
- BYTE 
- LONG 
-BLKL 
- LONG 
- QUAD 
- LONG 
-QUAD 
- LONG 
- LONG 
-PSECT 


- LONG 


ae . 
ve av 


THIS 


=e 
we 
=e 
we 
we 
ze 
ee 
‘ve 


=e Me Ye Se 


SP INLOCK 


SP 
THIS ENTRY POINT IS USED BY MACHINE CHECK AND OTHER HIGH IPL 
ERROR CODE. 


DYNSC_SPL 
SPL$C_SPL_SPINLOCK 
0 

SPL$K_PC_VEC_CNT 

0 

0 

0 

0 

AX7FFFFF 

0 


7e Ne Me Se te 


me Se Ne Ye Ne 


DATA STRUCTURES 23-NOV-1988 14:12:56 $254$DUA55: [SYS.SRC]LDAT.MAR;1 (2) 


Data structure type code 

Spinlock subtype code 

Physical ID of owning CPU 

PC history of owning CPU 

PC of waiting CPU 

Number of successful acquisitions 

Number of failed acquisitions 

Number of spins 

Longest possible timeout interval 

PC of last releaser of multiple acquisitio 


EXECS$SMP_BBB, LONG, WRT, NOEXE, PIC 
.=4*<SPL$C_EMB-SPL$ MIN _INDEX> 

- ADDRESS SMP§GL_EMB ; 
-PSECT BXEC$SMP_CCC, LONG, WRT, NOEXE, PIC 
.=4*<SPLS$C_EMB-SPL$ MIN INDEX> 


IPL$_EMB 


eoeseeeecee eeee 
ovrevrrevvwrervrrvanesr 


INLOCK VECTOR ENTRY CONTAI 


ar 
DM we 


Enter spinlock address in vector 


NAME=<MCHECK>, IPL=IPL$_MCHECK, EQUATE=<EMB> 


-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIC 


-=4*<SPL$C_MCHECK-SPL$_MIN_INDEX> 


- ADDRESS SMP$GL_EMB : 
-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC : 
-=4*<SPLS$C_MCHECK-SPL$_MIN_INDEX> 


Enter address of equivalent spinlock 


MEGA of spinlock 
Structure not currently interlocked 
# Synchronization level for lock 
RANK for lock 
PC vector index 
Owned if positive 


Length of spinlock control block 
Data structure type code 

Spinlock subtype code 

Physical ID of owning CPU 

PC history of owning CPU 

PC of waiting CPU 

Number of successful acquisitions 
Number of failed acquisitions 
Number of spins 

Longest possible timeout interval 
PC of last releaser of multiple acquisitio 


- LONG IPL$_MCHECK 
? KITCHEN SYNCH HEAVY DUTY 

SP INLOCK NAME=<MEGA>, IPL=IPL$_MEGA 

-PSECT EXECSSMP_DDD, QUAD, WRT, NOEXE, PIC 
SMPS$GL_MEGA: : : 

-BYTE 0 ; 

-BYTE IPL$ MEGA 

-BYTE SSSRANK ; 

-BYTE 0) z 

.- WORD 1 ; 

- WORD fe) 7; Waiting CPUs 

- WORD SPL$C_LENGTH ; 

- BYTE DYNSC_SPL 7 

- BYTE SPLS$C_SPL_SPINLOCK ; 

- LONG 0 ; 

-BLKL  SPL$K_PC_VEC_CNT ; 

- LONG 0 ? 

- QUAD 0 ; 

- LONG 0 ? 

- QUAD i) z 

- LONG “X7FFFFF ; 

- LONG 0 ; 

-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIC 


.=4*<SPL$C_MEGA-SPL$ MIN_INDEX> 
. ADDRESS SMP$GL_MEGA ; 


Enter spinlock address in vector 


DIGITAL INTERNAL USE ONLY 243 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 10 
X-35 SPINLOCK DATA STRUCTURES 23-NOV-1988 14:12:56 $254$DUA55: [SYS.SRC]LDAT.MAR;1 (2) 


397 
398 
399 
400 


401 
402 
403 
404 


-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 
-24*<SPL$C_MEGA-SPL$_MIN_INDEX> 
- LONG IPL$ MEGA 


i A ee A eZ 2 222222222222 222 
; HARDWARE CLOCK LOCK - FOR MODIFYING THE HARDWARE TIMER INTERVAL 
SP INLOCK NAME=<HWCLE>, IPL=IPLS _| HWCLK 
'.PSECT EXEC$SMP_DDD, QUAD, WRT, NOEXE, PIC 
SMP$GL_HWCLK: : + HWCLK of spinlock 
- BYTE 0 7 Structure not currently interlocked 
- BYTE IPL$_HWCLK ? Synchronization level for lock 
-BYTE $S$S$RANK 7; RANK for lock 
- BYTE 0 ? PC vector index 
-WORD -1 7 Owned if positive 
- WORD 0 7 Waiting CPUs 
- WORD SPLS$C_LENGTH ¢ Length of spinlock control block 
-BYTE DYNS$C_SPL 7 Data structure type code 
-BYTE SPLS$C_SPL_SPINLOCK ? Spinlock subtype code 
-LONG 0 # Physical ID of owning CPU 
-BLKL SPLSK_PC_VEC_ CNT # PC history of owning CPU 
-LONG 0 7 PC of waiting CPU 
- QUAD 0 7 Number of successful acquisitions 
-LONG 0 7 Number of failed acquisitions 
-QUAD 9) 3 Number of spins 
- LONG “X7TFFFFF 7 Longest possible timeout interval 
-LONG 0 3 PC of last releaser of multiple acquisitio 
-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIc 
-=4*<SPL$C_HWCLK-SPL$_MIN_INDEX> 
- ADDRESS SMP$GL_HWCLK 7 Enter spinlock address in vector 
-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 
-@4*<SPLSC_| HWCLK-SPLS$ | MIN_INDEX> 
- LONG IPL$_HWCLK 
i i 2 
; VIRTUAL CONSOLE SPINLOCK ~ OWNERSHIP OF ViRTUAL CONSOLE 
SPINLOCK NAME=<VIRTCONS>, IPL=IPL$_VIRTCONS 
-PSECT EXECSSMP_DDD, QUAD, WRT, NOEXE, PIC 
SMP$GL_VIRTCONS: : 7 VIRTCONS of spinlock 
-BYTE 0 7 Structure not currently interlocked 
-BYTE IPL$_VIRTCONS # Synchronization level for lock 
-BYTE $$S$RANK RANK for lock 
-BYTE 0 PC vector index 
-WORD ~l Owned if positive 
- WORD fe) Waiting CPUs 


-WORD SPL$C_LENGTH 
-BYTE DYNSC_SPL 
-BYTE SPLS$C_SPL_SPINLOCK 


Length of spinlock control block 
Data structure type code 
Spinlock subtype code 


Ne Se Se Me Se Ve Me Ne Ne Ve Ne Se Ye Ne 


-LONG 0 Physical ID of owning CPU 

-BLKL SPLS$K_PC_VEC_CNT PC history of owning CPU 

-LONG 0 PC of waiting CPU 

-QUAD 0 Number of successful acquisitions 

- LONG 0 Number of failed acquisitions 

-QUAD 0 Number of spins 

- LONG “X7FFEFE Longest possible timeout interval 

- LONG ¢) 7 PC of last releaser of multiple acquisitio 


-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIC 
=4*<SPL$C_VIRTCONS- SPL$_MIN_INDEX> 


244 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 11 
K-35 SPINLOCK DATA STRUCTURES 23-NOV-1988 14:12:56 $254$DUA55: [SYS.SRC]LDAT.MAR;1 (2) 


- ADDRESS SMP$GL_VIRTCONS ; Enter spinlock address in vector 
-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 
-=4*<SPLSC_VIRTCONS-SPL$ MIN INDEX> 

LONG IPL$ VIRTCONS 


Uh eee eee ee ee eee ee ee ee eee eee eee eee eee eee eee eee ee ee 
406 ; TB INVALIDATE SINGLE SPINLOCK 
407 ; 
408 SP INLOCK NAME=<INVALIDATE>, IPL=IPL$_INVALIDATE 
-PSECT EXECSSMP_ DDD, QUAD, WRT, NOEXE, PIC 
SMP$GL_INVALIDATE: : + INVALIDATE of spinlock 
-BYTE 0 + Structure not currently interlocked 
-BYTE IPL$_INVALIDATE # Synchronization level for lock 
-BYTE $S$S$RANK 3 RANK for lock 
«BYTE 0 7 PC vector index 
- WORD -1 7 Owned if positive 
- WORD 0 7; Waiting CPUs 
- WORD SPL$C_LENGTH # Length of spinlock control block 
- BYTE DYNSC_SPL + Data structure type code 
-BYTE SPLS$C_SPL_SPINLOCK # Spinlock subtype code 
-LONG 0 + Physical ID of owning CPU 
-BLKL SPL$K_PC_VEC_CNT # PC history of owning CPU 
- LONG 0 7 PC of waiting CPU 
- QUAD 0 ? Number of successful acquisitions 
- LONG 0 3 Number of failed acquisitions 
- QUAD 0 7 Number of spins 
- LONG “X7FEFFF + Longest possible timeout interval 
- LONG 0 7; PC of last releaser of multiple acquisitio 
-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIC 
-=4*<SPLS$C_INVALIDATE-SPL$_MIN_INDEX> 
- ADDRESS SMPS$GL_INVALIDATE — 7 Enter spinlock address in vector 
-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 
-=4*<SPLSC_INVALIDATE-SPL$_MIN_INDEX> 
- LONG IPL$_INVALIDATE 
M09 Peete eee e cere eee e eee reece e eae e eerie ee ceaa eee ee eee eeee erate ae aE 
410 ; PERFORMANCE MONITOR LOCK 
411 ; 
412 SP INLOCK NAME=<PERFMON>, IPL=IPLS_PERFMON 
-PSECT EXECS$SMP_ DDD, QUAD, WRT, NOEXE, PIC 
SMPS$GL_PERFMON: : + PERFMON of spinlock 
- BYTE 0 ; Structure not currently interlocked 
-BYTE IPL$_PERFMON # Synchronization level for lock 
-BYTE S$S$SRANK 3; RANK for lock 
-BYTE 0 7 PC vector index 
-WORD -1 7 Owned if positive 
- WORD 0 3; Waiting CPUs 


-WORD SPL$C_LENGTH 
-BYTE DYNSC_SPL 
-BYTE SPL$C_SPL SPINLOCK 


Length of spinlock control block 
Data structure type code 
Spinlock subtype code 


o 
-LONG 0 ? Physical ID of owning CPU 
-BLKL SPLS$K_PC_VEC_CNT 7 PC history of owning CPU 
- LONG 0 7 PC of waiting CPU 
-QUAD 0 7 Number of successful acquisitions 
- LONG 0 7 Number of failed acquisitions 
- QUAD 0 7 Number of spins 
- LONG “XTFFFFE ; Longest possible timeout interval 
- LONG 0 7 PC of last releaser of multiple acquisitio 


-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIC 


DIGITAL INTERNAL USE ONLY 245 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 12 
X-35 SPINLOCK DATA STRUCTURES 23-NOV-1988 14:12:56 $254$DUA55: [SYS.SRC]LDAT.MAR;1 (2) 


-=4*<SPLSC_PERFMON-SPL$_MIN_INDEX> 


- ADDRESS SMP$GL PERFMON 


o 


Enter spinlock address in vector 


-PSECT EXECS$SMP_CCC, LONG, WRT, NOEXE, PIC 
-=4*<SPLS$C_PERFMON-SPL$ MIN INDEX> 


- LONG IPL$_PERFMON 
@13 sesscerrersrterrtareaezreeeereeresereeaareecrceesaetaeaasaerarietaseaeta at aes 
414 ; NON-PAGED POOL DATABASE LOCK 
415 ; 
416 SP INLOCK NAME=<POOL>, IPL=IPL$_POOL 
-PSECT EXECSSMP_DDD, QUAD, WRT, NOEXE, PIC 
SMPS$GL_POOL: : ? POOL of spinlock 
-BYTE 0 7 Structure not currently interlocked 
- BYTE IPL$_ POOL # Synchronization level for lock 
-BYTE S$S$S$RANK ?; RANK for lock 
-BYTE 0 7; PC vector index 
- WORD a! 7 Owned if positive 
- WORD 0 ; Waiting CPUs 
- WORD SPLSC_ LENGTH ; Length of spinlock control block 
-BYTE DYNS$C_SPL ; Data structure type code 
-BYTE SPLS$C_SPL_SPINLOCK 3 Spinlock subtype code 
-LONG O 3 Physical ID of owning CPU 
-BLKL SPL$K_PC_VEC_CNT ? PC history of owning CPU 
- LONG 0 7; PC of waiting CPU 
-QUAD 0 3 Number of successful acquisitions 
-LONG O ? Number of failed acquisitions 
-QUAD 0 3 Number of spins 
- LONG “X7FFFFF ? Longest possible timeout interval 
-LONG 0 7; PC of last releaser of multiple acquisitio 
-PSECT EXECS$SMP_BBB, LONG, WRT, NOEXE, PIC 
-™4*<SPLSC_POOL-SPL$_MIN_INDEX> 
- ADDRESS SMP$GL_POOL 7 Enter spinlock address in vector 
-PSECT EXECS$SMP_CCC, LONG, WRT, NOEXE, PIC 
-™4*<SPLS$C_POOL-SPL$_MIN_INDEX> 
-LONG IPL$_POOL 
SS eee ee eee eee eee eee eee ee ee eee eee eee eee eee eee ee eee eee ee ee 
418 ; MAILBOX LOCK 
419 ; 
420 SP INLOCK NAME=<MAILBOX>, IPL=IPL$_MAILBOX 


-PSECT EXECSSMP_DDD, QUAD, WRT, NOEXE, PIC 


SMP$GL_MAILBOX: : 


-BYTE 0 

-BYTE IPL$_MAILBOX 
-BYTE $$SRANK 

-BYTE 0 

- WORD -1 

- WORD 0 

. WORD SPL$C_LENGTH 
-BYTE DYNS$C_SPL 

- BYTE SPL$C_SPL_SPINLOCK 
- LONG 0 

-BLKL SPL$K_PC_VEC_CNT 
-LONG 0 

- QUAD 0 

-LONG 0 

-QUAD 0 

- LONG “X7FFFFF 

- LONG 0 


246 DIGITAL INTERNAL USE ONLY 


we 


Me Te Ne Te Ve Ne Ve Ye Ye Ve Ze Ye Ve Ve Ve 


7 MAILBOX of spinlock 
Structure not currently interlocked 
# Synchronization level for lock 
RANK for lock 
PC vector index 
Owned if positive 
Waiting CPUs 
Length of spinlock control block 
Data structure type code 
Spinlock subtype code 
Physical ID of owning CPU 
PC history of owning CPU 
PC of waiting CPU 
Number of successful acquisitions 
Number of failed acquisitions 
Number of spins 
Longest possible timeout interval 
PC of last releaser of multiple acquisitio 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 13 
X-35 SPINLOCK DATA STRUCTURES 23-NOV-1988 14:12:56 $254$DUA55: [SYS.SRC]LDAT.MAR;1 (2) 


-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIC 
-=4*<SPLSC_MAILBOX-SPL$_MIN_INDEX> 


- ADDRESS 


SMP$GL_MAILBOX 


° 
a 


Enter spinlock address in vector 


-PSECT EXECS$SMP_CCC, LONG, WRT, NOEXE, PIC 
-=4*<SPLSC_MAILBOX-SPL$_MIN_INDEX> 


- LONG IPL$_MAILBOX 
421 sere srrsae reece creer errree eee eee ea ae ee ee 2 22 
422 ; IPL 11 PRIMARY CPU FORK LOCK 
423 ; 
424 SPINLOCK NAME=<PR_LK11>, IPL=IPL$_PR_LK11, LOCKTYPE=FORKLOCK 
-PSECT EXECSSMP_DDD, QUAD, WRT, NOEXE, PIC 
SMP$GL_PR_LK11:: *; PR_LK11 of spinlock 
-BYTE 10) 7 Structure not currently interlocked 
-BYTE IPL$ PR_LK11 ? Synchronization level for lock 
-BYTE S$S$SRANK ? RANK for lock 
-BYTE 0 7 PC vector index 
- WORD -1 7 Owned if positive 
- WORD 0 7; Waiting CPUs 
- WORD SPLS$C_LENGTH + Length of spinlock control block 
-BYTE DYNS$C_SPL 7 Data structure type code 
-BYTE SPLS$C_SPL_FORKLOCK + Spinlock subtype code 
- LONG 8) 7 Physical ID of owning CPU 
-BLKL SPLSK_PC_VEC_CNT ? PC history of owning CPU 
- LONG 1e) 7 PC of waiting CPU 
-QUAD 0 7 Number of successful acquisitions 
- LONG 0 3; Number of failed acquisitions 
- QUAD 0 ; Number of spins 
- LONG “X7FFFFF 7 Longest possible timeout interval 
«LONG 0 7 PC of last releaser of multiple acquisitio 
-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIC 
-=4*<SPLS$C_PR_LK11-SPL$_MIN_INDEX> 
- ADDRESS SMP$GL_PR_LK11 ; Enter spinlock address in vector 
-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 
-=4*<SPLS$C_PR_LK11-SPL$_MIN_INDEX> 
. LONG IPL$_PR_LK11 
Yo eA a oe 0 0 0 O00 ne ee ee 
426 ; IPL 11 I/O FORK QUEUE LOCK 
427 ; 
428 SP INLOCK NAME=<IOLOCK11>, IPL=IPL$_IOLOCK11, LOCKTYPE=FORKLOCK 


-PSECT EXECSSMP_DDD, QUAD, WRT, NOEXE, PIC 
SMP$GL_IOLOCK11:: 


7 IOLOCK11 of spinlock 


-BYTE 0 ; Structure not currently interlocked 
-BYTE IPL$_IOLOCKi1 ? Synchronization level for lock 
-BYTE SSSRANK ? RANK for lock 

-BYTE 0 7 PC vector index 

- WORD -1 7 Owned if positive 

- WORD 0 7; Waiting CPUs 

«WORD SPL$C_LENGTH + Length of spinlock control block 
-BYTE DYNS$C_SPL 7 Data structure type code 

-BYTE SPLSC_SPL FORKLOCK ? Spinlock subtype code 

-LONG O ? Physical ID of owning CPU 

-BLKL  SPLSK_PC_VEC_CNT 7 PC history of owning CPU 

- LONG 0 7 PC of waiting CPU 

-QUAD 0 ; Number of successful acquisitions 

- LONG 0 7 Number of failed acquisitions 

-QUAD 0 7 Number of spins 

- LONG “X7FFFFF 7 Longest possible timeout interval 


DIGITAL INTERNAL USE ONLY 247 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT ~- SPIN LOCK DATA BASES’10-MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 14 
X-35 SPINLOCK DATA STRUCTURES 23-NOV-1988 14:12:56 $254$DUA55: [SYS.SRC]LDAT.MAR;1 (2) 


429 
430 
431 
432 


433 
434 
435 
436 


-LONG 0 7 PC of last releaser of multiple acquisitio 
-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIC 

-*4*<SPLS$C_IOLOCK11~SPL$ MIN _INDEX> 

- ADDRESS SMP$GL_IOLOCK11 ; Enter spinlock address in vector 

-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 

-=4*<SPLSC_IOLOCK11-SPL$_MIN_INDEX> 

-LONG IPL$ IOLOCK11 


te ee ee ee A 2 2 2 
; IPL 10 PRIMARY CPU FORK LOCK 
eo 
SP INLOCK NAME=<PR_LK10>, IPL=IPL$_PR_LK10, LOCKTYPE=FORKLOCK 
-PSECT EXECS$SMP_DDD, QUAD, WRT, NOEXE, PIC 
SMP$GL_PR_LK10:: : PR_LK10 of spinlock 
-BYTE 0 ; Structure not currently interlocked 
-BYTE IPLS$_PR_LK10 # Synchronization level for lock 
-BYTE $S$S$RANK 7 RANK for lock 
- BYTE 0 7 PC vector index 
- WORD =1 7 Owned if positive 
- WORD 0 7; Waiting CPUs 
- WORD SPL$C_LENGTH 7 Length of spinlock control block 
-BYTE DYNSC_SPL + Data structure type code 
-BYTE SPL$C_SPL_FORKLOCK # Spinlock subtype code 
- LONG 0 7 Physical ID of owning CPU 
-BLKL SPL$K_PC_VEC_CNT : PC history of owning CPU 
- LONG 0 7 PC of waiting CPU 
-QUAD 0 7 Number of successful acquisitions 
-LONG 0 + Number of failed acquisitions 
-QUAD 0 7 Number of spins 
-LONG “X7FFFFF 7 Longest possible timeout interval 
- LONG 0 ? PC of last releaser of multiple acquisitio 
-PSECT EXECS$SMP_BBB, LONG, WRT, NOEXE, PIC 
-®4*<SPLSC_PR_LK10-SPL$_MIN_INDEX> 
- ADDRESS SMPS$GL_PR_LK10 ; Enter spinlock address in vector 
-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 
-™4*<SPLSC_PR_LK10~-SPL$_MIN_INDEX> 
-LONG IPL$_PR_LK10 
a i i ee 222222 20 2 
; IPL 10 I/O FORK QUEUE LOCK 
eo 
SPINLOCK NAME=<IOLOCK10>, IPL=IPL$_IOLOCK10, LOCKTYPE=FORKLOCK 
-PSECT EXECSSMP_DDD, QUAD, WRT, NOEXE, PIC 
SMP$GL_IOLOCK10:: # IOLOCK10 of spinlock 
-BYTE 0 ; Structure not currently interlocked 
- BYTE IPL$_IOLOCK10 ? Synchronization level for lock 
-BYTE SSSRANK RANK for lock 
-BYTE 0 PC vector index 
- WORD <r Owned if positive 
- WORD 0 Waiting CPUs 


-WORD SPLS$C_LENGTH 
-BYTE DYNS$C_SPL 
-BYTE SPL$C_SPL_FORKLOCK 


Length of spinlock control block 
Data structure type code 
Spinlock subtype code 


™e Te Me Me Ye Ve Ve 


- LONG 0 ? Physical ID of owning CPU 

-BLKL SPL$K_PC_VEC_CNT 7; PC history of owning CPU 

- LONG 0 7 PC of waiting CPU 

- QUAD 0 ; Number of successful acquisitions 
- LONG 0 + Number of failed acquisitions 
-QUAD 0 ; Number of spins 


248 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 15 
X~-35 SPINLOCK DATA STRUCTURES 23-NOV-1988 14:12:56 _$254$DUA55: [SYS.SRC]LDAT.MAR;1 (2) 


- LONG “X7FFFFF ? Longest possible timeout interval 

-LONG 0O 7 PC of last releaser of multiple acquisitio 
-PSECT EXECS$SMP_BBB, LONG, WRT, NOEXE, PIC 

-=4*<SPLSC_IOLOCK10-SPL$_ MIN INDEX> 

- ADDRESS SMP$GL_IOLOCK10 ; Enter spinlock address in vector 

-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 

-24*<SPLSC_IOLOCK10-SPL$ MIN_INDEX> 


- LONG IPL$_IOLOCK10 

GST PERESS TELE ISITE EVIE ER IESE STARE R EERE TEETER TERR ASR SEESIR CITI OR eis 

438 ; IPL 9 PRIMARY CPU FORK LOCK 

439 ; 

440 SP INLOCK NAME=<PR_LK9>, IPL=IPL$_PR_LK9, LOCKTYPE=FORKLOCK 
-PSECT EXECS$SMP_DDD, QUAD, WRT, NOEXE, PIC 

SMP$GL_PR_LK9:: 7 PR_LK9 of spinlock 
- BYTE 0 7 Structure not currently interlocked 
- BYTE IPL$_PR_LK9 ; Synchronization level for lock 
- BYTE SSSRANK 7 RANK for lock . 
-BYTE 0 7 PC vector index 
«WORD -1 # Owned if positive 
- WORD 0 7 Waiting CPUs 
- WORD SPLS$C_LENGTH 7 Length of spinlock control block 
- BYTE DYN$C_SPL ; Data structure type code 
-BYTE SPLS$C_SPL_FORKLOCK 7 Spinlock subtype code 
- LONG 0 ? Physical ID of owning CPU 
-BLKL SPLSK_PC_VEC_ CNT 7 PC history of owning CPU 
- LONG 0 7 PC of waiting CPU . 
-QUAD 0 7 Number of successful acquisitions 
-LONG 0O # Number of failed acquisitions 
- QUAD 0 7 Number of spins 
- LONG “XTFFFFF 7 Longest possible timeout interval 
- LONG 0 7 PC of last releaser of multiple acquisitio 
-PSECT EXECS$SMP_BBB, LONG, WRT, NOEXE, PIC 
-=4*<SPLSC_PR_LK9-SPL$_MIN_INDEX> 
- ADDRESS SMP$GL_PR_LK9 7 Enter spinlock address in vector 
-PSECT EXECS$SMP_CCC, LONG, WRT, NOEXE, PIC 
-=4*<SPLSC_PR_LK9-SPL$_ MIN INDEX> 
: - LONG IPL$_PR_LK9 

M40 coerce sire eee ee area eee ei cere e eee eee e caer ree ieee e area e eee RTE 

442 ; IPL 9 I/O FORK QUEUE LOCK 

443 ; 

444 SPINLOCK NAME=<IOLOCK9>, IPL=IPL$_IOLOCK9, LOCKTYPE=FORKLOCK 
-PSECT EXECS$SMP_ DDD, QUAD, WRT, NOEXE, PTC 

SMPS$GL_IOLOCK9:: 7 IOLOCK9 of spinlock 

-BYTE 0 ; Structure not currently interlocked 
- BYTE IPL$_IOLOCK9 3 Synchronization level for lock 
-BYTE $$SRANK RANK for lock 
-BYTE 0 PC vector index 
- WORD =1 Owned if positive 
- WORD 0 Waiting CPUs 


-WORD SPL$C_LENGTH 
.BYTE DYNSC_SPL 
-BYTE SPLS$C_SPL_FCRXLOCK 


Length of spinlock control block 
Data structure type code 
Spinlock subtype code 


we Te Ye Ne Se Se Se Me fe Ne Ne NS 


- LONG 0 Physical ID of owning CPU 

-BLKL SPLSK_PC_VEC CNT PC history of owning CPU 

- LONG 0 PC of waiting CPU 

-QUAD 0 Number of successful acquisitions 
- LONG i) Number of failed acquisitions 


DIGITAL INTERNAL USE ONLY 249 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT ~ SPIN LOCK DATA BASES 10~MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 16 
X-35 SPINLOCK DATA STRUCTURES 23-NOV-1988 14:12:56 $254$DUA55: [SYS.SRC]LDAT.MAR;1 (2) 


- QUAD 0 
- LONG “XTEPFFF 
- LONG 0 


e 
£ 


° 
av 


e 
cA 


Number of spins 
Longest possible timeout interval 
PC of last releaser of multiple acquisitio 


-PSECT EXECS$SMP_BBB, LONG, WRT, NOEXE, PIC 
.=4*<SPLS$C_IOLOCK9-SPL$_MIN_INDEX> 


- ADDRESS 


SMP$GL_IOLOCK9 


° 
a’ 


Enter spinlock address in vector 


»PSECT EXECS$SMP_CCC, LONG, WRT, NOEXE, PIC 
-=4*<SPLSC_IOLOCK9-SPL$_MIN_INDEX> 


eeeereeseerneeeeseeoseeneevseeeeenseneeseeereeeenene 
[A 2 i i i 2 A A A i A A A 2 A A A A A A A A A 


AND MUTEX LOCK 


SCHED of spinlock 
Structure not currently interlocked 
# Synchronization level for lock 
RANK for lock 
PC vector index 
Owned if positive 
Waiting CPUs 
Length of spinlock control block 
Data structure type code 
Spinlock subtype code 
Physical ID of owning CPU 
PC history of owning CPU 
PC of waiting CPU 
Number of successful acquisitions 
Number of failed acquisitions 
Number of spins 
Longest possible timeout interval 
PC of last releaser of multiple acquisitio 


XE, PIC 


Enter spinlock address in vector 


MMG of spinlock 

Structure not currently interlocked 
7 Synchronization level for lock 

RANK for lock 

PC vector index 

Owned if positive 

Waiting CPUs 

Length of spinlock control block 

Data structure type code 

Spinlock subtype code 

Physical ID of owning CPU 

PC history of owning CPU 


-LONG IPL$_IOLOCK9 
44S oseictrreerei reteset reer eear ee aes 
446 ; SCHEDULING DATABASE 
447 ; 
448 SP INLOCK NAME=<SCHED>, IPL=IPL$_SCHED 
-PSECT EXECS$SMP_DDD, QUAD, WRT, NOEXE, PIC 
SMP$GL_SCHED:: ; 
-BYTE 0 ; 
- BYTE IPL$_ SCHED 
-BYTE SSSRANK ; 
- BYTE a) ; 
- WORD -1 ; 
- WORD fe) ; 
.» WORD SPL$C_LENGTH ; 
-BYTE DYNS$C_SPL ; 
- BYTE SPLS$C_SPL_SPINLOCK : 
~ LONG 0 : 
-BLKL SPL$K_PC_VEC_CNT ? 
-LONG OO ; 
-QUAD 0 ; 
-~ LONG 0 3 
- QUAD 0 3 
~ LONG “X7TFFEFFF : 
-~ LONG 0 ? 
-PSECT EXECSSMP_BBB, LONG, WRT, NOE 
-™4*<SPLSC_SCHED-SPL$_MIN_INDEX> 
- ADDRESS SMP$GL_SCHED ; 
-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 
-=4*<SPLSC_SCHED-SPL$_MIN_INDEX> 
- LONG IPL$_SCHED 
(i) eee ee eee eee ee eee ee eee eee eee ee ee ; 
450 ; MEMORY MANAGEMENT, 
451 ; MODIFIED PAGE WRITER, SYSWS 
452 ; 
453 SP INLOCK NAME=<MMG>, IPL=IPL$_MMG 
-PSECT EXECS$SMP_DDD, QUAD, WRT, NOEXE, PIC 
SMP$GL_MMG:: 3 
BYTE 0 ? 
-BYTE IPL$_MMG 
-BYTE SSSRANK 3 
-BYTE 0 ; 
»WORD -1 ; 
-WORD 0 : 
» WORD SPLS$C_LENGTH ; 
-BYTE DYNSC_SPL ; 
- BYTE SPL$C_SPL_SPINLOCK ; 
- LONG 0 ; 
-BLKL SPL$K_PC_VEC_CNT ; 
- LONG 0 ? 


250 DIGITAL INTERNAL USE ONLY 


PC of waiting CPU 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10~MAY-1989 16:57:58 VAX MACRO V5.0~-8 Page 17 
X-35 SPINLOCK DATA STRUCTURES 23~-NOV-1988 14:12:56 $254$DUA55: [SYS.SRC]LDAT.MAR;1 (2) 


QUAD 0 7 Number of successful acquisitions 

- LONG 0 + Number of failed acquisitions 

-QUAD fe) + Number of spins 

- LONG “XTFEFFF 3 Longest possible timeout interval 

-LONG 0 3 PC of last releaser of multiple acquisitio 


-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIC 

.=4*<SPLSC_MMG-SPL$ _MIN_INDEX> 

- ADDRESS SMP$GL_MMG 7 Enter spinlock address in vector 
-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 
-=4*<SPLSC_MMG-SPL$_MIN_INDEX> 

- LONG IPL$ MMG 


\) Pete eee eee eee eZ 
455 ; JIB LOCK - LOCKS ACCESS TO BYTCNT AND BYTLM (RELATED 

456 ; TO NON-PAGED POOL) IN THE JIB 

457 ; 

458 SP INLOCK NAME=<JIB>, IPL=IPL$_JIB 


-PSECT EXECSSMP_ DDD, QUAD, WRT, NOEXE, PIC 
SMPS$GL_JIB:: JIB of spinlock 


se Ve 


- BYTE 0 Structure not currently interlocked 
-BYTE IPLS_ JIB + Synchronization level for lock 
-BYTE S$SSRANK RANK for lock 

-BYTE 0 PC vector index 

«WORD -1 Owned if positive 

-WORD 0 Waiting CPUs 


-WORD SPL$C_LENGTH 
-BYTE DYNSC_SPL 
-BYTE SPLS$C_SPL_SPINLOCK 


Length of spinlock control block 
Data structure type code 
Spinlock subtype code 


e@ Se Se Se Ye Ne Ne Ne Se Me Se Se Ne Me Ne 


- LONG 0 Physical ID of owning CPU 

-BLKL SPLS$K_PC_VEC_CNT PC history of owning CPU 

- LONG 0 PC of waiting CPU 

-QUAD fe) Number of successful acquisitions 

- LONG 0 Number of failed acquisitions 

- QUAD 0 Number of spins 

- LONG “X7FFFFF Longest possible timeout interval 

- LONG 0 PC of last releaser of multiple acquisitio 


-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIC 
-=4*<SPL$C_JIB-SPL$_MIN_INDEX> 

-ADDRESS SMP$GL_JIB ; Enter spinlock address in vector 
-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 
.=4*<SPL$C_JIB-SPL$_MIN_INDEX> 

-LONG IPL$_JIB 


tk: Ba oe ee ae eae Oe 00000 0 
460 ; TIMER QUEUE LOCK - FOR ADDING/DELETING/SEARCHING TIMER QUEUE 
461 ; 
462 SPINLOCK NAME=<TIMER>, IPL=IPL$_TIMER 
-PSECT EXECS$SMP_ DDD, QUAD, WRT, NOEXE, PIC 
SMPS$GL_TIMER:: ?; TIMER of spinlock 
-BYTE 0 ; Structure not currently interlocked 
-BYTE IPL$_TIMER ; Synchronization level for lock 
-BYTE SSSRANK RANK for lock 
-BYTE 0 PC vector index 
- WORD -1 Owned if positive 
- WORD 0 Waiting CPUs 


-WORD SPL$C_LENGTH 

-BYTE DYNS$C_SPL 

-BYTE SPL$C_SPL_SPINLOCK 
-LONG 0 


Length of spinlock control block 
Data structure type code 
Spinlock subtype code 

Physical ID of owning CPU 


"ee Ne Se Se Se Ve Ve Ve 


DIGITAL INTERNAL USE ONLY 251 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY~-1989 16:57:58 VAX MACRO V5.0-8 Page 18 
X-35 SPINLOCK DATA STRUCTURES 23-NOV-1988 14:12:56 $254$DUA55: [SYS.SRC]LDAT.MAR;1 (2) 


463 
464 
465 
466 


467 
468 
469 
470 


-BLKL SPLS$K_PC_VEC_CNT PC history of owning CPU 


- LONG 0 7 PC of waiting CPU 

-QUAD 0 3 Number of successful acquisitions 

-LONG 0 7 Number of failed acquisitions 

-QUAD 0 7 Number of spins 

- LONG “X7FFFFF 7; Longest possible timeout interval 

-LONG 0 3 PC of last releaser of multiple acquisitio 


»-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIC 
-™4*<SPLSC_TIMER-SPLS$_MIN_INDEX> 

- ADDRESS SMP$GL_TIMER 7 Enter spinlock address in vector 
-PSECT EXECS$SMP_CCC, LONG, WRT, NOEXE, PIC 
-24*<SPLSC_TIMER-SPL$_MIN_INDEX> 

- LONG IPL$ TIMER 


i 2 
; IPL 8 PRIMARY CPU FORK LOCK 
¢ 
SP INLOCK NAME=<PR_LK8>, IPL=IPL$_PR_LK8, LOCKTYPE=FORKLOCK 
-PSECT EXECSSMP_ DDD, QUAD, WRT, NOEXE, PIC 
SMPSGL_PR_LK8:: 7 PR_LK8 of spinlock 
-BYTE 0 7 Structure not currently interlocked 
-BYTE IPLS$ PR_LK8 # Synchronization level for lock 
-BYTE $S$SRANK : RANK for lock 
-BYTE 0 7 PC vector index 
«WORD -1 Owned if positive 
» WORD 0 Waiting CPUs 


-WORD SPLS$C_LENGTH 
-BYTE DYNS$C_SPL 
-BYTE SPL$C_SPL_FORKLOCK 


Length of spinlock control block 
Data structure type code 
Spinlock subtype code 


-LONG 0 + Physical ID of owning CPU 

-BLKL SPLS$K_PC_VEC_CNT 7 PC history of owning CPU 

«LONG 0 7 PC of waiting CPU 

-QUAD 0 7 Number of successful acquisitions 

-LONG 0 7 Number of failed acquisitions 

-QUAD 0 7 Number of spins 

LONG “X7FFFFF ? Longest possible timeout interval 

-LONG 0 7 PC of last releaser of multiple acquisitio 


-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIC 
-24*<SPL$C_PR_LK8-SPL$ MIN _INDEX> 
- ADDRESS SMPSGL_PR_LK8 ; Enter spinlock address in vector 
-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 
-=4*<SPLSC_PR_LK8-SPL$_MIN_INDEX> 

R 


-LONG IPL$ _PR_LK8 
eo ee 2 
; IPL 8 I/O FORK QUEUE LOCK & SCS LOCK 
vo 
SP INLOCK NAME=<IOLOCK8>, IPL=IPL$_ IOLOCK8, LOCKTYPE=FORKLOCK 
-PSECT EXECSSMP_DDD, QUAD, WRT, NOEXE, PIC 
SMPSGL_IOLOCK8: : # IOLOCKS of spinlock 
-BYTE 0 ; Structure not currently interlocked 
-BYTE IPL$_IOLOCK8 ; Synchronization level for lock 
- BYTE $S$SRANK 7 RANK for lock 
-BYTE 0 ; PC vector index 
-WORD -1 7 Owned if positive 
- WORD 0 Waiting CPUs 


-WORD SPLS$C_LENGTH 
-BYTE DYNSC_SPL 
-BYTE SPLS$C_SPL_ FORKLOCK 


Length of spinlock control block 
Data structure type code 
Spinlock subtype code 


~e Se Me Ne 


252 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY~1989 16:57:58 VAX MACRO V5.0-8 Page 19 
X-35 SPINLOCK DATA STRUCTURES 23-NOV-1988 14:12:56 $254$DUA55: [SYS.SRC]LDAT.MAR;1 (2) 


- LONG 0 7 Physical ID of owning CPU 

-BLKL SPLS$K_PC_VEC_CNT z PC history of owning CPU 

- LONG 0 7 PC of waiting CPU 

-QUAD 0 7 Number of successful acquisitions 
- LONG 0 7 Number of failed acquisitions 
-QUAD ce) 7 Number of spins 


- LONG “X7FFFFF Longest possible timeout interval 
-LONG 0 7 PC of last releaser of multiple acquisitio 
-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIC 
-=4*<SPLS$C_IOLOCK8-SPL$_MIN_INDEX> 
-ADDRESS SMP$GL_IOLOCK8 ; Enter spinlock address in vector 
-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 
-=4*<SPLSC | IOLOCK8-SPLS | MIN _INDEX> 
- LONG IPLS_ IOLOCK8 


oe eS e eee cere ele eee eee ee ee eee eee eee eee eee ee eee ee eee eee ea eee ree a eee ee 
472 ; THE FILE SYSTEM LOCK 

473 ; 

474 SP INLOCK NAME=<FILSYS>, IPL®IPL$ FILSYS 


-PSECT EXECSSMP_DDD, QUAD, WRT, NOEXE, PIC 
SMP$GL_FILSYS:: FILSYS of spinlock 


@e 


-BYTE 0 7 Structure not currently interlocked 
-BYTE IPLS$ FILSYS ; Synchronization level for lock 
-BYTE SSSRANK ; RANK for lock 

-BYTE 0 7 PC vector index 

~WORD -1 3 Owned if positive 

- WORD 0 7; Waiting CPUs 


- WORD SPL$C_LENGTH 
-BYTE DYNS$C_SPL 
-BYTE. SPLS$C_SPL_SPINLOCK 


Length of spinlock control block 
Data structure type code 
Spinlock subtype code 


- LONG 0 7 Physical ID of owning CPU 

-BLKL SPLSK_PC_VEC_CNT 7 PC history of owning CPU 

~-LONG O 7 PC of waiting CPU 

-QUAD 0 7; Number of successful acquisitions 

- LONG 0 3 Number of failed acquisitions 

-QUAD 0 ; Number of spins 

- LONG “X7FFFFF 7 Longest possible timeout interval 

-LONG 0 7 PC of last releaser of multiple acquisitio 


-PSECT EXECSSMP | BBB, LONG, WRT, NOEXE, PIC 

-=4*<SPL$C. FILSYS- SPL$_MIN_INDEX> 

-ADDRESS SMP$GL_FILSYS 7; Enter spinlock address in vector 
-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 

-=4*<SPLSC | FILSYS-SPLS$ | MIN _INDEX> 

- LONG IPLS | FILSYS 


«WORD SPLS$C_ LENGTH 


# Length of spinlock control block 
-BYTE DYNSC_SPL 


Data structure type code 


(Vi ee eee eee eee eee eee ee eee ee ee eee eee ee eee ee 2 
476 ; UEUEAST FORK QUEUE LOCK 
a7T7 ; 
478 SP INLOCK NAME=<QUEUVEAST>, IPL=IPL$ QUEUEAST 
-PSECT EXECS$SMP_DDD, QUAD, WRT, NOEXE, PIC 
SMPS$GL_QUEUEAST: : + QUEUVEAST of spinlock 
-BYTE 0 ; Structure not currently interlocked 
- BYTE IPL$ QUEUEAST ; Synchronization level for lock 
-BYTE $$$RANK ; RANK for lock 
-BYTE (9) 3; PC vector index 
- WORD <7 ; Owned if positive 
- WORD 0 ; Waiting CPUs 


DIGITAL INTERNAL USE ONLY 253 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT ~ SPIN LOCK DATA BASES 10-MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 20 


X-35 SPINLOCK 


479 
480 
481 
482 
483 
484 
485 
486 
487 
488 


489 


me Me Ve Ye Ye Ve Be Ve Veo 


SMP$GL_ASTDEL: : 


eoeseveoe 
eovrrvererveve 


emporary lock 


™e 


DATA STRUCTURES 23-NOV-1988 14:12:56 $254$DUA55: [SYS.SRC]LDAT.MAR;1 (2) 


-BYTE SPLS$C_SPL_SPINLOCK Spinlock subtype code 


- LONG 0 7 Physical ID of owning CPU 

-BLKL SPL$K_PC_VEC_CNT 7 PC history of owning CPU 

-LONG 0 7 PC of waiting CPU 

- QUAD 0 3 Number of successful acquisitions 

-LONG 0 # Number of failed acquisitions 

-QUAD 0 7 Number of spins 

- LONG “XTFFFFF 7 Longest possible timeout interval 

-LONG 0 7 PC of last releaser of multiple acquisitio 


-PSECT EXECS$SMP_BBB, LONG, WRT, NOEXE, PIC 
-™4*<SPLSC_QUEUEAST-SPL$_MIN_INDEX> 

- ADDRESS SMP$GL_QUEUEAST ; Enter spinlock address in vector 
-PSECT EXECSSMP_CCC, LONG, WRT, NOEXE, PIC 
-=4*<SPLSC_QUEUEAST-SPL$_MIN_INDEX> 

- LONG IPL$ QUEUEAST 


ee ee ee ee 2 2 
- this lock DOES NOT PROVIDE MULTIPROCESSOR SYNCHRONIZATION 
because it has an IPL that doesn’t prevent rescheduling. This lock 

is defined solely for early versions of UIS which need something to 


work in the first version of VMS that supports SMP. 


ee 
oe 


It is expected that this lock can be removed when UIS doesn’t 
need it anymore. 


SP INLOCK NAME=<ASTDEL>, IPL=2 
-PSECT EXECSSMP_DDD, QUAD, WRT, NOEXE, PIC 
ASTDEL of spinlock 


-BYTE 0 ; Structure not currently interlocked 
-BYTE 2 7 Synchronization level for lock 
-BYTE S$$SRANK ; RANK for lock 

-BYTE 0 3 PC vector index 

- WORD -1 7 Owned if positive 

-WORD 0 Waiting CPUs 


-WORD SPL$C_LENGTH 
-BYTE DYNSC_SPL 
-BYTE SPL$C_SPL_SPINLOCK 


Length of spinlock control block 
Data structure type code 
Spinlock subtype code 


- LONG 0 3; Physical ID of owning CPU 

-BLKL SPLS$K_PC_ VEC CNT 7 PC history of owning CPU 

- LONG 0 3 PC of waiting CPU 

- QUAD 0 ; Number of successful acquisitions 

-LONG 0 3 Number of failed acquisitions 

-QUAD 0 ; Number of spins 

- LONG “X7FFFFF 7 Longest possible timeout interval 

-LONG 0 7 PC of last releaser of multiple acquisitio 


-PSECT EXECSSMP_BBB, LONG, WRT, NOEXE, PIC 
-=4*<SPLS$C_ASTDEL-SPL$ MIN_INDEX> 


'. ADDRESS SMPS$GL ASTDEL 7 Enter spinlock address in vector 


-PSECT EXECS$SMP_CCC, LONG, WRT, NOEXE, PIC 
-=4*<SPL$C_ASTDEL-SPL$_MIN_INDEX> 
-LONG 2 


254 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


LDAT - SPIN LOCK DATA BASES 10-MAY-1989 16:57:58 VAX MACRO V5.0-8 Page 21 
X-35 SPINLOCK DATA STRUCTURES 23-NOV~1988 14:12:56 $254$DUA55: [SYS.SRC]LDAT. MAR; 1 (3) 


491 
492 
493 
494 
495 
496 
497 
498 
499 
S00 
501 
502 
503 
504 
505 
506 
507 
508 
S09 
510 
$11 
512 
513 


$14 
515 
516 
517 
518 
519 


+ 


ASSUMPTIONS 


™e Me Ye Ve 


Make sure that MMG and SCHED are adjacent to match checks done 
in MEMORYALC to allow for pool expansion. 


we Ne 


---RANK_MMG = ...RANK_ SCHED+1 


Make sure that all locks fall in the range 20 to 3E (hex). (Remember 
to reserve one index for dynamic spinlocks). This makes code paths 
like FORKCNTRL be able to test bit #5 to see if it is a FORKLOCK index 
in the FKB$B_FLCK or an IPL (range 0-1F). The test of bit #5 is 

also done in the FORKLOCK and FORKUNLOCK macros in certain instances. 


=e Ye Ye Ye Ve 


ASSUME SPL$ MIN_INDEX GE 32 
ASSUME SPL$_MAX_INDEX LE 62 


Make sure that there aren’t more spinlocks than table can handle. 
NUM_LOCKS accounts for the 1 reservation for the dynamic spinlocks - 


me Se 


? and is only equal to 31. 


ASSUME <SPLS$_MAX_INDEX-SPL$_MIN INDEX> LE SPL$ NUM LOCKS 
ASSUME SPLS$_NUM_LOCKS LE 31 


- END 


DIGITAL INTERNAL USE ONLY 255 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


8 MMDAT.LIS 


MMDAT 10-MAY-1989 17:04:31 VAX MACRO V5.0-8 Page 0 
Table of contents 


(3) 70 MMDAT_INIT 


256 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION | 


MMDMAT 10-MAY-1989 17:04:31 VAX MACRO V5.U-8 Page 1 
_X%-9 28-AUG-1986 10:34:47 $254$DUA55: [SYS.SRC]MMDAT.MAR;1 (1) 


O@eaHn Uhm WD 


we Te Ve 


=e Te Se te Se 


™e Me Ye Te Be Ne Se Se Ye Se Ye Ne Me Ve Be Se Ne Ne Ne Ne Ye Ye Yo No Ve 


~e Ne Ne Te Veo Ve Ve Ve Ve Ne We We Yo Ve Ve We Ye Ye Veo We 


ee Fe 


++ © + © + © & &€ & HF HF HF HF HF HH HF HH He FE 


AUTHOR: Trudy C. Matthews 


-TITLE MMDAT 
-IDENT ‘X-9' 


COPYRIGHT (c) 1978, 1980, 1982, 1984 BY 
DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. 
ALL RIGHTS RESERVED. 


THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED 
ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE 
INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER 
COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY 
OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY 
TRANSFERRED. 


THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE 
AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT 
CORPORATION. 


DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS 
SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. 


CREATION DATE: 25-MAY-1985 


FUNCTIONAL DESCRIPTION: 


This module contains read-only cells that are referenced by time- 
critical code in the system. All cells defined in this module can 
be referenced locally by any image which links this module into 
itself. 


ENVIRONMENT: 


MODIFIED BY: 


X-9 SSA0001 Stan Amway 28-Aug-1986 
Remove definitions of and references to MPWSAL_ PTE 
and MPWSAW_PHVINDEX. 


X-8 WMC0003 Wayne Cardoza 29-Jul-1986 
get rid of re-executeable flag. 


X-7 wéMc0002 Wayne Cardoza 18-Jun-1986 
Initialization routines should return status. 


X-6 wmcoool Wayne Cardoza 12-Feb-1985 
remove writeable modified page writer cells. 


xX-5 TCMO0003 Trudy C. Matthews 21-Nov-1985 
Remove LNMSAL HASHTBL, as it is the address of a TABLE and 
the entire table would have to be moved, not just the 
first longword. : 


V04-002 TCM0002 Trudy C. Matthews 3-Oct-1985 


KKK KKKKEKKKEEKKKEKRHRKEKEKEKKEEKEKKEKEKKKEKRKKEKKEKEKEKKREEKEKKREEKRHERERKKEEKKEKKEK 


* eH » € 6 we e HF HB He He He He HE HH HF FH 


KREMER KHER ERE IKEKEREKEKEKEEKKEMKEEEEEREKEKERKEEKEKKKKKKKKKKKKKKKKKKKKK 


DIGITAL INTERNAL USE ONLY 257 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


MMDAT 10-MAY-1989 17:04:31 VAX MACRO V5.0-8 Page 2 
X-9 28-AUG-1986 10:34:47 $254$DUA55: [SYS.SRC]MMDAT.MAR;1 (1) 


58 
59 
60 
61 
62 


=e Ye Ye Ve Yo 


Remove PFNSAL_HEAD, PFNSAL_TAIL, PFNSAL , COUNT, and 
MPWSGL_| BADPAGTOTAL cells as they are not read-only. 
LNM |. AL | , HASHTBL is more than a word offset, so do some 
arithmetic to get the address calculation right. 


258 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


MMDAT 10-MAY-1989 17:04:31 VAX MACRO V5.0-8 Page 3 
X-9 28-AUG-1986 10:34:47 $254S$DUASS5: [SYS.SRC]MMDAT.MAR;1 (2) 


e 
65 : MACRO LIBRARY CALLS 
66 3 
67 SBOOSTATEDEF 
68 ; 


DIGITAL INTERNAL USE ONLY 259 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


MMDAT 10-MAY-1989 17:04:31 VAX MACRO V5.0-8 Page 4 
X-9 MMDAT_INIT 28-AUG-1986 10:34:47 $254$DUA55: [SYS. 'SRC]MMDAT. MAR;1 (3) 


-SBTTL MMDAT_INIT 


70 
71 
72 
73 
74 
75 
76 
77 
78 
19 
80 
81 
82 
83 
84 
85 
86 


Inputs: 
None 


Outputs: 


™e Se Ye Ne Yo Ne Ye Ne Ye Vo Ve Ve 


ze 


When this image is loaded, copy data from the cells in the exec into 
these local copies. 


Implicit inputs: 
RO-R3 available as scratch registers. 


System data cells copied into local image. 


DECLARE _PSECT EXECSINIT_CODE 


INITIALIZATION ROUTINE - 
MMDAT_INIT 


MMDAT_INIT:: 
BBS 


BICL 


10$: MOVAB 
MOVL 
MOVL 
MOVL 
MOVL 
MOVL 
MOVL 


208: MOVL 
RSB 


#BOOSTATESV_SWAPPER, - 2 Some cells aren’t initialized until 
G*EXESGL_STATE, 10$ : INIT is done running 
#INIRTNSM_NO RECALL, (R5); Keep on trying 


G*SGNSA_COMPVALUES, RO 7 Get base of SYSGEN computed values. 
PFN AB | STATE (RO), W*PFNSAB_STATE 

PFN | | AB ) TYPE (RO), W“PFNSAB TYPE 

PFN "AL __BAK(RO), W*°PFNSAL_} BAK 

PFN ; "AL _ PTE (RO), W*PFNSAL | PTE 

PEN | | AW | REFCNT (RO), W*PENSAW | REFCNT 
PFN_AW_SWPVBN (RO), W*PENSAW_SWPVBN 
PFN_AX_BLINK (RO) , W*PFNSAX_BLINK 
PFN_AX_FLINK(RO) , W*PFNSAX_FLINK 
PFN_AX_SHRCNT (RO) , W*PFNSAX_SHRCNT 
PFN_AX_WSLX (RO) , W*PFNSAX_WSLX 

MMG GL | GPTBASE (RO) ,W°MMGSGL GPTBASE 
MMG GL , SPTBASE (RO), W°MMGSGL_; SPTBASE 
SWP GL , BALSPT (RO), W“SWPSGL | BALSPT 
SWP_GL_BALBASE (RO), W°SWPS$GL_BALBASE 


G*EXEC$SYSDATA_CELLS,RO ; Get base of SYSDATA cells. 
PHV_GL_REFCBAS (RO), W°PHVSGL | REFCBAS 

PHV_GL_PIXBAS (RO), W*PHVSGL_PIXBAS 

MMG_GL_PAGSWPVC (RO) , W*MMGS$GL_PAGSWPVC 

SCH_GL_PCBVEC (RO) , W*SCH$GL_PCBVEC 

SCH_GL_SEQVEC (RO), W*SCHS$GL_SEQVEC 


#SS$_ NORMAL, RO 


260 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


MMDAT 19-MAY-i9%! 17:04:31 VAX MACRO V5.0-8 Page 5 
X-9 MMDAT INIT 28-AUG-1986 10:34:47 $254$DUASS: [SYS.SRC]MMDAT.MAP:1 (4) 


121 DECLARE_PSECT EXECSNONPAGED DATA : 
122 ; 
123 ; 
124 ; 
125 PFNSAB_STATE:: 
126 «LONG 0 
127 PFNS$AB_TYPE:: 

128 ~ LONG 0 
129 PFNSAL_BAK:: 

130 - LONG 0 
131 PFNSAL_P | 
132 ~LONG 0 
133 PFNSAW_REFCNT: : 
134 - LONG 0 
135 PFNSAW_SWPVBN: : 
136 «LONG 0 
137 PFNSAX_BLINK:: 
138 ~ LONG 0 
139 PFNSAX_FLINK:: 
140 - LONG 0 
141 PFNSAX_SHRCNT:: 
142 ~ LONG 0 
143 PFNSAX_WSLX:: 

144 ~- LONG 0 
145 MMGSGL_GPTBASE: : 
146 - LONG 0 
147 MMGSGL_SPTBASE: : 
148 - LONG 0 
149 SWPSGL_BALSPT:: 
150 - LONG 0 
151 SWPSGL_BALBASE: : 
152 ~ LONG 0 
153 PHVS$GL_REFCBAS: : 
154 - LONG 0 
155 PHV$GL_PIXBAS:: 
156 ~ LONG 0 
157 MMGSGL_PAGSWPVC:: 
158 ~ LONG 0 
159 SCH$GL_PCBVEC:: 
160 ~ LONG 0 
161 SCHSGL_SEQVEC:: 
162 - LONG 0 
163 

164 ~END 


Define vectors for cells commonly used in an indirect data reference. 


DIGITAL INTERNAL USE-ONLY 261. 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


9 DOINIT.LIS 


SYSSDOINIT 10-MAY-1989 17:04:14 VAX MACRO V5.0-8 Page 0 


Table of contents 


(3) 
(4) 
(6) 
(7) 
(8) 
(9) 
(10) 
(11) 


136 
153 
290 
331 
434 
458 
512 
530 


INITIALIZATION VECTOR TABLES 

INISDOINIT ~ Call all initialization routines 

IMGSPRVSHRIMG Fixup Routine for Privileged Shareable Images 
FIXUP_ADDRESS Fixup .ADDRESS entries throughout the image 
PFN FIXUP ARRAYS 

INISPFN_FIXUP - Alter PFN references if large PFN configuration 
Build Table Vector 

INISSYSTEM_SERVICE - Load system service vectors 


262 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSDOINIT 10-MAY-1989 17:04:14 VAX MACRO V5.0-8 Page 1 
X-21 3-JUN-1987 12:33:40 (SYS.SRC]DOINIT.MAR;1 (1) 


oD n Uh WD BE 


PRR Re 
& WN HO 
se Be Ye Me Ye Ve Ve Teo Ve Ve Ve Ve Vso Te We 


ow 


NNNNNA & eB 
mWNHe OO @ ~l 
we Se Ne Ne Ne 


25 
26 


27 


28 
: 29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 


a4. 


45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 


Se Se Ne Ne Ne Me Ne te Ne Ne Ne te Ne 


ve 


we Se Ye Yeo Ye Ye 
. 


“se Se Se Ye Se Ne Ne 


=e 


me te Mc Fe Me NM 


+ + 4+ 6 © 6 FH HF HH HE HF HF HE HE HE HF HE HF FF 


.TITLE SYSS$DOINIT 
IDENT 'X-21' 


PEERS SLESSASALELLSSSSESSSLESE ESE S LESS SSL EER EES EE REESE SEES ER LASERS SESE ES SESS SS 


COPYRIGHT (c) 1978, 1980, 1982, 1984 BY 
DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. 
ALL RIGHTS RESERVED. 


THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED 
ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE 
INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER 
COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY 
OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY 
TRANSFERRED. 


THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE 
AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT 
CORPORATION. 


DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS 
SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. 


a a ee a a a ea rr oe 


RHR RK KK IKK KK RE RH KR EK RIKKI KIRKE II KKK IR IKKE RRR IKKE RE REREREREKEKKEK KEK 


AUTHOR: Trudy C. Matthews CREATION DATE: 1-Jul-1985 


- FUNCTIONAL DESCRIPTION: 


This module is linked into each VMS executive sharable image. It provides 
the mechinism to execute initialization routines on a module-by-module 

basis, and allows each module to independently declare its own initialization 
routine. 


Each module, if it has an initialization routine, will use the 
INITIALIZATION ROUTINE macro to declare its entry point. This macro will 
enter a self-relative offset to the initialization routine into the 
initialization routine vector table. At initialization time, DOINIT will 
JSB through each vector in the table. 


ENVIRONMENT: 


MODIFIED BY: 


X-21 WMC0005 Wayne Cardoza 03-Jun-1987 
Check MAPEN before non-paged fix-ups. 

X-20 SF0 4006 Stephen Fiorelli 09-Mar~1987 
Test initialization flags at the address in r5, not 
r5. 

X-19 WMC0004 Wayne Cardoza 15-Oct-1986 


INIT psects must all be EXE. 


x-14 SF04005 Stephen Fiorelli 10-Sep-1986 


DIGITAL INTERNAL USE ONLY 263 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSDOINIT 10-MAY-1989 17:04:14 VAX MACRO V5.0-8 Page 2 


X~21 3-JUN-1987 12:33: 


58 
59 


=e te Ve 


X-13 


ta) 
Ww 
™e Te Ye Ne 


X-12 
X-11 
X-10 


X-8,9 


ay 
ee Ye Be Ve Vo Ye Ve Noe Yo Yo Re Ve Vo 


X-6,7 


@ 
jo 
=e Se Ye Yeo Yo Ye Yo 


v04-005 


v04-004 


Vv04~003 


Vv04-002 


vo4-001 


a 
@e Te Ve Se Se Te Ye Ye Te Ye Te Ye Ye Te Ye Ye Ye Ye Se Ye Ve Ye Ve Ve 


40 [SYS.SRC]DOINIT.MAR;1 (1) 


Change the handling of errors, no longer issue a 
halt, bugcheck instead. : 


HH215 Hai Huang 02-Sep-1986 
This module is now inserted into STARLET.OLB, change 
module name to SYSSDOINIT. 


WwMC0003 Wayne Cardoza 25-Jul-1986 
Get rid of re_executeable switches. 


WMc0002 Wayne Cardoza 21-May-1986 
Rewrite most of it. 


wmco001 Wayne Cardoza 11-Mar-1986 
PFNTBL psects mut be byte aligned. 


SF04004 Stephen Fiorelli 17-Feb-1986 
Don’t need to convert to byte count in the size of 
image sections when doing .address fixups. Byte count 
is already stored. Also moved computation of ending 
addresses of image sections out of a loop. 


SF04003 Stephen Fiorelli 03-Feb-1986 
Change references to system service connection routines 
use exe$ prefix instead of exec$. 


SF04002 Stephen Fiorelli 03-Dec-1985 
Added error messages for system service initialization 
routine. 


SF04001 Stephen Fiorelli 16-Oct-1985 
Added initialization routine that will connect 
each system service within an EXEC shareable image 
to their vectors in the base image. Also added 
PSECTS to define the beginning and an of the build 
table (used in system service connecting). 


TCMO003 Trudy C. Matthews 14-Oct-1985 
More bug fixes in .ADDRESS fixup code. 


TCM0002 Trudy C. Matthews 11-Oct-1985 

Add conditional dispatching of iniialization routines based 
on SINIRTN flags. Also, enhance LOADERS$FIXUP_DOT_ADDRESS 

so that it will fixup .ADDRESS references in either non~paged 
only, paged only, or both paged and non-paged image sections, 
depending on what environment it is called from. Also, 
return status of success always from INISDOINIT. 


TCMOO00O1 Trudy C. Matthews 29-Sep-1985 
Add .ADDRESS fixup routines. 


264 DIGITAL INTERNAI. USE ONIV 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSDOINIT 10-MAY-1989 17:04:14. VAX MACRO V5.0-8 Page 3 
X-21 3-JUN-1987 12:33:40 [SYS:SRC]DOINIT.MAR;1 (2) 


110 
111 
112 
113 3 a” 
114 SBOOSTATEDEF 
115 SIAFDEF 

116 


MACRO LIBRARY CALLS 


™e Se Ne 


Define bootstrap stage flags 
Offsets into image activator fixup 

area within image file 
117 SINIRTNDEF Define initialization routine flags 

118 SLDRIMGDEF | . 8 Define. S¥SLDR: image data structure 

119 SPRDEF Ay” fe ce 

120 $SHLDEF Offsets into shareable image list element — 
121 $SSDESCRDEF System service descriptor block 
122 ae . . ‘ oe 
123 
124 
125 
126 
127 
128 
129 
130 
131 
132 
133 
134 


me Ve Me Ne Ye 


oe Ne 


LOCAL MACROS 


me Se Se 


LOCAL SYMBOLS 


=e Be Ne 


se Ne 


LOCAL DATA 


DIGITAL INTERNAL USE ONLY 265. 


CONFIDENTIAL AND PROPRIETARY. 
DIGITAL EQUIPMENT CORPORATION | 


SYS$DOINIT 10-MAY-1989 17:04:14 VAX MACRO V5.0-8 Page 4 
X-21 INITIALIZATION VECTOR TABLES 3-JUN~-1987 12:33:40 [SYS.SRC]DOINIT.MAR;1 (3) 


136 
137 
138 
139 
140 
141 
142 
143 
144 
145 
146 
147 
148 
149 
150 
151 


-SBTTL INITIALIZATION VECTOR TABLES 


-PSECT EXECSINIT_000, LONG, RD, WRT, EXE, PIC 
INISA_VECTOR_TABLE:: ? Beginning of vector table. 


DECLARE_PSECT EXECSINIT_001 — 
This psect is declared here for informational purposes only. Individual 


modules contribute the address or a self-relative offset to an initialization 
routine, plus a flags longword, to this table. 


™e Ye Te Ve Ne 


-PSECT EXECSINIT_002, LONG, RD, WRT, EXE, PIC 
-LONG 0 3 This is the signal for the end of the 
3 table. 


266 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSS$DOINIT 10~MAY-1989 17:04:14 VAX MACRO V5.0-8 Page 5 
X-21 INISDOINIT - Call all initialization rou 3-JUN-1987 12:33:40 [SYS.SRC]DOINIT.MAR;1 (4) 


~SBTTL INISDOINIT - Call all initialization routines 


153 
154 
155 
156 
157 
158 
159 
160 
161 
162 
163 
164 
165 
166 
167 
168 
169 
170 
171 
172 
173 
174 
175 
176 
177 
178 
179 
180 
181 
182 
183 
184 
185 
186 
187 
188 
189 
190 
191 
192 
193 
194 
195 
196 
197 
198 
199 
200 
201 
202 


7 


=e Te Ve 


we Ye Se Ve Ye 


_ Be Se Se Se Se Ve Ve Ve Neo 


10$ 


20$ 


308: 


408: 


50S: 
60S: 


DECLARE PSECT 


Inputs: 


4 (AP) 


Outputs: 


None 


EXECSINIT CODE 


Implicit outputs: 


Call each initialization routine in the vector table. 


- The address of this image data block (as created by SYSLDR) 


All routines in the vector table are called, based conditionally 


on the flags declared by that routine. 


On entry to each routine, 


the following inputs are available: 


- ENTRY 
MOVAB 


BICL 


BEQL 
MOVAL 
BBSS 


BBS 
ADDL 
JSB 

BISL 
BLBC 
BBS 

BISL 
ADDL 


BRB 


MOVL 
RET 


R4 - address of image data block 
R5 - address of initialization routine flags longword 
RO,R1,R2,R3 - available as scratch registers 


INISDOINIT, “M<R2,R3,R4,R5,R6,R7> ; 


INISA_VECTOR_TABLE, R6 
4(AP),R4 
#LDRIMGSM_DELAY_ INIT, - 
LDRIMGSL_ FLAGS (R4) 


(R6) , RO 

50$ 

4(R6),R5 
#INIRTN$V_NO_ RECALL, - 
(R5) , 40$ 


#INIRTINSV_SYSRTN, (R5),- 


30$ 
R6, RO 


(RO) 

#INIRTNSM CALLED, (R5) 
RO, 60$ 

#INIRTNSV_NO RECALL, - 
(RS) ,40$ 
#LDRIMGSM_DELAY_INIT, ~ 
LDRIMGS$L_FLAGS (R4) 


#8,R6 
10$ 


#SS$ NORMAL, RO 


=e "Ge 


=e 


~e Ye Ye 


me Be Te we Ty 


=e 


we 7S Ne 


a 
, 


sa te 


a 


Common initialization routine. 
Get address of vector table. 

Get address of image data block. 

Assume no delayed init 


Get address of init routine 

Zero - all done. 

Get initialization routine flags. 
Branch if routine not to be recalled 


Branch if reutine is external to 
this image. 

Convert self-relative offset to 
actual address of routine. 


Call initialization routine. 

Record that. it was called 

Error 

Branch if routine not to be recalled 
Request delayed init 

Step to next vector. 


See if there are any more. 


Sigqnai success always. 


DIGITAL INTERNAL USE ONLY 267 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSDOINIT 10-MAY-1989 17:04:14 VAX MACRO V5.0-8 Page 6 
X-21 INISDOINIT ~ Call all initialization rou 3-JUN-1987 12:33:40 [SYS.SRC]DOINIT.MAR;1 (5) 


Assume nothing to do 


Simply return if nothing to do 
Is it legal set of fix-ups 


Get base address 
Base of fix-up data 


Done with all fix-ups 


Skip image number 


Get flags that tell us what stage 


204 3+ 

205 ; LOADERSFIXUP_DOT_ ADDRESS 

206 ; 

207 ; Functional Description: 

208 ; 

209 ; This routine fixes up .ADDRESS references by adding the base address 
210 ; of the image to all .ADDRESS cells. 

211 ; 

212 ; Input Parameters: 

213 ; 

214 ; R4 - Address of loadable image block 

215 ; R5 ~ address of initialization routine flags 

216 ; RO,R1,R2,R3 ~ available as scratch registers 

217 ; 

218 ; Output Parameters: 

219 ; 

220 ; none 

221 ; 

222 ; Implicit Output: 

223 ; 

224 ; All cells within the image originally generated with either .ADDRESS 
225 ; directives or .ASCID directives are modified (FIXED UP) by adding 
226 ; the base address of the image to each cell. 

227 ; 

228 ; Final Status: 

229 ; 

230 ; Routines called by this routine may fail. These. failure codes are 
231 ; passed back to the caller. 

232 ;- 

233 

234 INITIALIZATION_ROUTINE - 

235 LOADERSFIXUP_DOT_ADDRESS 

236 

237 LOADERSFIXUP_DOT_ADDRESS: | 

238 MOVL #SS$_ NORMAL, RO ? 

239 TSTL LDRIMGSL_FIXUP_LEN(R4) ; Any work to do? 
240 BEQL 10$ ; 

241 BSBW IMGSPRVSHRIMG ; 

242 BLBS RO, 20$ 7 Yes 

243 10$: RSB 

244 ; 

245 208: MOVL LDRIMGS$L_BASE (R4) ,R1 ; 

246 MOVL LDRIMGSL_FIXUP_BASE(R4) ,R2 ; 

247 ADDL IAF$L_DOTADROFF (R2),R2 ; .ADDRESS area 
248 MOVL (R2)+,R3 3 Count of fix-ups 
249 BNEQ 30$ 

250 BISL #LDRIMGSM_FIX_UPS_DONE, -; 

251 LDRIMGSL_FLAGS (R4) 

252 RSB 

253 308: ADDL #4,R2 ; 

254 

255 3 

256 ; Now determine what environment we’re operating in, to see which (if any) 
257 ; types of fixups we should do. 

258 ; 

259 MOVL G*EXESGL_STATE, RO ; 

260 ; 


268 DIGITAL INTERNAL USE ONLY 


of bootstrap we’re currently in. 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSDOINIT 10-MAY-1989 17:04:14 VAX MACRO V5.0-8 Page 7 
X-21 INISDOINIT - Call all initialization rou 3-JUN-1987 12:33:40 [{SYS.SRC]DOINIT.MAR;1 (5) 


261 
262 
263 
264 
265 
266 
267 
268 
269 
270 
271 
272 
273 
274 
275 
276 
277 
278 
279 
280 
281 
282 
283 
284 
285 
286 
287 
288 


Re Te Ye Ne Ye Xe 


> 
° 
a 
oe 


If 
is 


gi we me Se Se Ye 


0S: 


558: 


608: 


BBC 
BBS 


BRW 
BRW 


If we're at the SWAPPER stage (which implies paging is now possible), which 
fixups we do depends on whether this initialization routine has been called 
before: if it has been called, the non-paged fixups are already done, so 
just do the paged; if it hasn’t, we must do them all. 


#BOOSTATESV_SWAPPER, - 3 Branch if we haven’t reached the 
RO, 50$ ; ? emer ER stage vets 

#LDRIMGSV_| NONPAGED FIXUP, - 

LDRIMGSL _ FLAGS (R4), 7, 40$ ? 

FIXUP_ADDRESS ALL 
FIXUP_ADDRESS PAGED 


We have gieeady done the non-paged 


we're at the INIT stage, we can only do non-paged fixups. The only check 
to see if this routine was already called, and so the non-paged fixups 


MFPR 
BLBC 
BBS 
BRW 
BICL 


MOVL 
RSB 


have already been done. 


#PR$_MAPEN, RO 

RO, 55$ 7 Wait unitl memory management enabled 
#LDRIMGSV_| NONPAGED_ FIXUP, - 

LDRIMGSL , FLAGS (R4), , 558 7 We have already done the non-paged 
FIXUP_ADDRESS_NONPAGED 


#INIRTNSM_NO RECALL, - 7 We need to be called again 


(RS) 
#SS$_NORMAL, RO 


DIGITAL INTERNAL USE ONLY 269 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYS$DOINIT 10-MAY~-1989 17:04:14 VAX MACRO V5.0-8 Page 8 
X-21 IMGSPRVSHRIMG Fixup Routine for Privileg 3-JUN-1987 12:33:40 [SYS.SRC]DOINIT.MAR;1 (6) 


IMGSPRVSHRIMG Fixup Routine for Privileged Shareable Images 


290 
291 
292 
293 
294 
295 
296 
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 


This routine checks that a privileged shareable image has no 


This routine began as a copy of the routine found in SYSIMGFIX.MAR, 
which is part of the image activator. 


IMGSPRVSHRIMG 


Address of LDRIMG image data block 


RO and Rl are destroyed 


#SS$_NORMAL, RO 


2 
o 


Shareable image has outbound calls 


Assume success 


LDRIMGSL_FIXUP_BASE(R4),R1 ; Get base of data structures 


IAF$L_SHRIMGCNT (R1), #1 
IAFSL_G FIXOFF (R1) 


#SS$_NOSHRIMG, RO 


-SBTTL 
7+ 
? Functional Description: 
; 
; outbound calls. 
7 Calling Sequence: 
? JSB 
; 
7 Input Parameters: 
3 
7 R4 
3 
3 
3 Side Effects: 
7 Completion Codes: 
; SS$_NORMAL 
7 
? SS$_NOSHRIMG 
77 ; 
IMGSPRVSHRIMG: 
MOVL 
MOVL 
CMPL 
BNEQ 10$ 
TSTL 
BEQL 20$ 
10$: MOVZWL 
208: RSB 


270 DIGITAL INTERNAL USE ONLY 


™e Veo Ve Ve %e 


precisely one image? 

No - error 

Any G* 

No - no problem 

No outbound calls allowed 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSDOINIT 10-MAY-1989 17:04:14 VAX MACRO V5.0-8 Page 9 
X-21 FIXUP_ADDRESS Fixup .ADDRESS entries thr 3-JUN-1987 12:33:40 [SYS.SRC]DOINIT.MAR;1 (7) 


331 
332 
333 
334 
335 
336 
337 
338 
339 
340 
341 
342 
343 
344 
345 
346 
347 
348 
349 
350 
351 
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 


+ 


me Se Se Se Se Ne Ye Ye Se Se Ys Ve Ne Ve 


™e Ne Me 


=e Me Ne 


Input 


“ee “Se Se Ye Me Me 


we Se Ye Se Se Ye Ye Ye Se Ve Ne 


.SBTTL FIXUP_ADDRESS Fixup .ADDRESS entries throughout the image 


Functional Description: 


This routine performs the .ADDRESS fixup for a specific exit vector. 
Specifically, the base address of the appropriate shareable image 
is added to each .ADDRESS entry in this shareable image. 


This routine has three entry points: 

FIXUP_ADDRESS_ALL - fix up all .ADDRESS references in the image 

FIXUP | _ADDRESS | - PAGED ~ only fix up those .ADDRESS references in the 
pagable portion of the image 

FIXUP_ADDRESS NONPAGED - only fix up those .ADDRESS references in the 
non-pagable portion of the image 


Calling Sequence: 


BSBW FIXUP_ADDRESS ALL 
BSBW FIXUP _ ADDRESS _ PAGED 
BSBW FIXUP_ADDRESS_NONPAGED 


Parameters: 

Rl = Base of image 

R2 = Address of .ADDRESS area. 

R3 = Count of fix-ups 

R4 = Address of LDRIMG image data block 
RS = Address of initialization flags 


Implicit Input: 


Contents of .ADDRESS fixup area 


Implicit Output: 


-ADDRESS directives within this shareable image have the base addresses 
of the appropriate shareable images added to them. 


FIXUP_ADDRESS_ALL: . 


10$ 


208: 


BISL #LDRIMGSM_FIX_UPS DONE- ; Done with all fix-ups 
!LDRIMGSM | NONPAGED ) FIXUP, - 
LDRIMGSL | FLAGS (R4) 


Get address of .ADDRESS directive 
Bias by base address of shareable image 
Do next entry 


ADDL3 R11, (R2)+, RO 
ADDL2 R11, (RO) 
SOBGTR R3,10$ 


me Me Ne 


MOVZWL #SS$ NORMAL, RO 
RSB 


Indicate success 
Return 


me Ne 


FIXUP_ADDRESS NONPAGED: 


PUSHR #“°M<R6, R7> 
BISL #LDRIMG$M_NONPAGED _FIXUP,- ; Record what we did 
LDRIMGSL _ FLAGS (R4) 


DIGITAL INTERNAL USE ONLY 271 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSDOINIT 10-MAY-1989 17:04:14 VAX MACRO V5.0-8 Page 10 
X-21 FIXUP_ADDRESS Fixup .ADDRESS entries thr 3-JUN-1987 12:33:40 [SYS.SRC]DOINIT.MAR;1 (7) 


388 ADDL3 LDRIMGSL_PAG W_BASE(R4),- 
389 _ LDRIMG$L_PAG W_LEN(R4),R7 
390 CLRL R6 ? 
391 108: ADDL3 R1, (R2)+,R0 : 
392 CMPL RO, LDRIMGSL_PAG W_BASE(R4) 
393 BLSSU 15$ 3 
394 CMPL RO, R7 ; 
395 BGEQU 15$ ; 
396 INCL R6 ? 
397 BRB 20$ 

398 158: ADDL2 R1, (RO) ; 
399 20S: SOBGTR R3,105S ; 
400 

401 TSTL R6 ? 
402 BNEQ 30$ 3 
403 BISL  #LDRIMGSM_FIX_UPS_DONE, -; 
404 LDRIMGSL_FLAGS (R4) 

405 BRB 40$ 

406 30S: BICL #INIRTNSM_NO_RECALL,- ; 
407 (R5) 

408 40S: MOVZWL #SS$_NORMAL, RO ; 
409 POPR #°M<R6, R7> 

410 RSB ? 
411 

412 

413 FIXUP_ADDRESS PAGED: 

414 BISL  #LDRIMGSM_FIX_UPS DONE, -; 
415 LDRIMGSL_FLAGS (R4) 

416 

417 PUSHR #°M<R7> 

418 ADDL3 LDRIMGSL_PAG W_BASE(R4),- 
419 LDRIMGS$L_PAG W_LEN(R4),- 
420 R7 

421 108: ADDL3 R1, (R2)+,R0O 3 
422 CMPL § RO, LDRIMGSL_PAG W_BASE(R4) 
423 BLSSU 20$ ; 
424 CMPL RO, R7 ; 
425 BGEQU 20$ ; 
426 

427 158: ADDL2 R1, (RO) ; 
428 20S: SOBGTR R3,10$ ; 
429 

430 MOVZWL #SS$_NORMAL, RO : 
431 POPR #“M<R7> 

432 RSB ; 


272 DIGITAL INTERNAL USE ONLY 


7 Compute the ending address 
7 of the pagable portion. 
Count of paged fix-ups 
Get address of .ADDRESS directive 
7 Compare against start of paged 
Not paged - go fix it up. 
Compare against end of paged region. 
Not paged - go fix it up. 
Count a paged one 


Bias by base address of shareable image 
Do next entry 


Any paged ones 


Yes 
Done with all fix-ups 


We need to be called again 


Indicate success 


Return 
Done with all fix-ups 


7 Compute the ending address 
; of the pagable portion. 
Get address of .ADDRESS directive 

7 Compare against start of paged 
Less than start - don’t fix it up 
Compare against end of paged region. 
Not in the paged part - don’t fix it. 


Bias by base address of shareable image 
Do next entry 


Indicate success 


Return 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYS$DOINIT 10-MAY-1989 17:04:14 VAX MACRO V5.0-8 Page 11 
X-21 PFN FIXUP ARRAYS 3-JUN-1987 12:33:40 [SYS. enc IPornar MAR; 1 (8) 


434 
435 
436 
437 
438 
439 
440 
441 
442 
443 
444 
445 
446 
447 
448 
449 
450 
451 
452 
453 
454 
455 
456 


-SBTTL PFN FIXUP ARRAYS 


+ 


Define global label for opcode/address table used by code that ’fixes up’ 
all pfn references if more than 32 Mbytes of memory is present on the system. 


we Me Me Me te 


-PSECT EXECSINIT_PFNTBL_000, LONG, RD, WRT, EXE, PIC 
MMGSAL_FIXUPTBL: : 


DECLARE _PSECT EXECSINIT PFNTBL | pons BYTE 


This psect is included here for idformdtion only. The table entries go 
in this psect. 


Each six byte entry in this table consists of a location whose contents 
are to be altered, a byte containing the current contents of that location 
(to be used as a sanity check), and a byte containing the new opcode. The 
table is terminated with a longword of zero. 


ee Ye Se Ye Ye Ve Be Ye Ve 


-PSECT EXECSINIT PFNTBL_002, BYTE, RD, WRT, EXE, PIC 
-LONG 0 7 End of PFN fixup table 


DIGITAL INTERNAL USE ONLY 273 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSDOINIT 10-MAY-1989 17:04:14 VAX MACRO V5.0-8 Page 12 
X-21 INISPFN_ FIXUP - Alter PFN references if 3-JUN-1987 12:33:40 [SYS.SRC]DOINIT.MAR;1 (9) 


458 
459 
460 
461 
462 
463 
464 
465 
466 
467 
468 
469 
470 
471 
472 
473 
474 
475 
476 
477 
478 
479 
480 
481 
482 


483 
484 
485 
486 
487 
488 
489 
490 
491 
492 
493 
494 
495 
496 
497 
498 
499 
500 
501 
502 
503 
504 
505 
506 


507 
508 
509 
510 


+ 


I 


@e te Ne Te Ye Ye Ye Ye Ne Te Ye Te Ve Yo So Yeo Ye Ye Ne 


INI 


10$ 


30$ 


Gl se Se Ye Se Ne 


o$ 


-SBTTL INISPFN_FIXUP ~ Alter PFN references if large PFN configuration 
DECLARE _PSECT EXECSINIT CODE 


NISPFN_FIXUP 
This initialization routine is common to many exec images. 


If there is less than 32 Mbytes of memory described in the PFN data base 
(MMG$GW_BIGPFN contains zero), this next block of code does nothing. 
Otherwise, an address table is scanned. 


1. Each address must be in the nonpaged system image. 
2. The current contents are verified as a consistency check. 
3. A new (longword context) opcode is stored at that location. 


Failure of either test prevents the system from being bootstrapped with 
more than 32 Mbytes of physical memory. (That is, the PHYSICALPAGES 
parameter must be used to allow the system to come up using less that 
its total amount of physical memory.) 


INITIALIZATION ROUTINE INISPFN_FIXUP 
SPFN_FIXUP:: 
PFN DISP_IF_BIGPFN_THEN END_BIGPFN_CODE=100$ 


#This code executes if the PFN link arrays are longword arrays. 


MOVAL G*MMGSAL_FIXUPTBL, R1 
3 TSTL (R1) 

BEQL 50$ 

MOVAB @(R1) (R1},RO 


Address of opcode/address table 
Self-relative offset of next fixup 
Zero indicates end of list 

Calculate address from self-relative 

offset 

Perform sanity check 

Quit with error if different 

Finally, alter the opcode 

R1 now points to old opcode byte 
and go back for the next one 


CMPB 4(R1), (RO) 
BNEQU 30$ 

MOVB 5(R1), (RO) 
ADDL #6,R1 

BRB 10$ 


—e Ye Ye Ve Ye Ye Ye Te Ye Ve 


2 BUG CHECK PFNFIXUP, FATAL 7 Opcode mismatch, bugcheck 


This is the successful exit path after all opcodes have been altered. It 
is necessary to execute an REI instruction in order that any instruction 
lookahead be invalidated and the new opcodes used. 


: MOVPSL -(SP) 3 Store PSL for REI 
PUSHAB B*100$ 3 Push PC also 
REI 7 Drop through to next instruction 


PFN_DISP_ENDIF COMMON_CODE=100$ 


7End of code that depends on size of PFN link arrays 
MOVL #SS$_NORMAL, RO 
RSB 


274 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYSSDOINIT 10-MAY-1989 17:04:14 VAX MACRO V5.0-8 Page 13 
‘X-21 Build Table Vector 3-JUN~1987 12:33:40 [SYS.SRC]DOINIT.MAR;1 (10) 


512 
513 
514 
515 
516 
517 
518 
519 
520 
521 
522 
523 
524 
525 
526 
527 
528 


-SBTTL Build Table Vector 


-PSECT EXECSINIT SSTBL_000, LONG, RD, WRT, EXE, PIC 
INISA_BUILD_ TABLE: : ? Beginning of build table 


DECLARE_PSECT EXECSINIT SSTBL_001 
This psect is declared here for informational purposes only. 


The SYSTEM SERVICE macro is responsible for contributing 
build table entries. 


™e Ye Ye Ve Ye 


-PSECT EXECS INIT_SSTBL_002, LONG, RD, WRT, EXE, PIC 
- LONG 0 7 This is the signal for the end of the 
rs 3; table. 


DIGITAL INTERNAL USE ONLY 275 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SYS$DOINIT 10-MAY-1989 17:04:14 VAX MACRO V5.0-8 Page 14 
X~-21 INISSYSTEM_SERVICE - Load system service 3-JUN-1987 12:33:40 [SYS.SRC]DOINIT.MAR;1 (11) 


530 
531 
532 
533 
534 
535 
536 
537 
538 
539 
540 
541 
542 
543 
544 
545 
546 
547 
548 
549 
550 
§51 
552 
553 
554 
555 
556 
557 
558 
559 
560 
$61 
562 
563 
564 
565 
566 
567 
568 
569 
570 
571 
572 
573 
574 
575 
576 


™e Ne Ye Te Te Te Ye Ve Ye Ye Ye Ye 


-SBTTL 


INISSYSTEM_SERVICE - Load system service vectors 


DECLARE PSECT EXECS$INIT_CODE 


This initialization routine is common to many EXEC 
shareable images. 


The build table for an EXEC shareable image is 
traversed to connect system services with their 
vectors in the base image. Each build table 
entry is passed to the system service connector. 


The build table is built at assemble time with 
the SYSTEM SERVICE macro. 


INITIALIZATION ROUTINE - 
INISSYSTEM_SERVICE 


INISSYSTEM_SERVICE:: 


108: 


208: 


308: 


40S: 


MOVL 
BBC 


MOVAL 
MOVL 
CALLS 


TSTL 
BEQL 
PUSHL 
CALLS 
MOVAB 
BRB 


MOVL 
RSB 


BICL 
BRB 


-END 


Get flags that tell us what stage 

of bootstrap we’re currently in. 

Branch if we haven’t reached the 

SWAPPER stage yet. 

INISA_BUILD TABLE, R2 Get the beginning of the build table 

#SSDESCR_| K | LENGTH, R3 Size of a build table entry 

#0, G*EXESSET | PAGES WRITABLE 3 Allow modifications to system serv 
? vectors in base image 


G*EXESGL_STATE, RO 


#BOOSTATESV_SWAPPER, - 
RO, 40$ 


=e Se Se we Ve Ve 


(R2) # Test for end of build table 

20$ 3; If end, then done 

R2 + Pass address of a build table entry 
#1,G“EXESCONNECT SERVICES ; Connect the system service 

(R2) [R3] ,R2 7 Move to next build table entry 

10$ ; 


#0,G*EXESSET_ PAGES READ ONLY; All done. Protect pages again. 
#SS$_NORMAL, RO 7 Always success 
#INIRTNSM_NO_RECALL,- ; We need to be called again 

(R5) 

30$ 


INISDOINIT This is the initialization routine. 


me 


276 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


10 PTALLOC.LIS 


PTALLOC - System page table allocation routines 10-MAY-1989 15:58:36 VAX MACRO V5.0- 


8 Page 0 


Table of contents 


(2) 
(3) 
(4) 
(5) 


95 
107 
201 
275 


DECLARATIONS 
LDRSALLOC_PT - Allocate page table entries 
SYNCHRONIZE - Synchronize allocation of system PTEs 
LDRSDEALLOC_PT - Deallocate page table entries 


DIGITAL INTERNAL USE ONLY 277 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PTALLOC - System page table allocation routines 10-MAY~1989 15:58:36 VAX MACRO V5.0- 
8 Page l 
X-11 25-JAN-1988 12:22:29 [SYS.SRC)PTALLOC.MAR;1 (1) 


a -TITLE PTALLOC - System page table allocation routines 
2 -IDENT ‘'X-11' 
33 
4 JEG ICICI GIO IO IO IO OIE EOS IO SIO IOI IOI III TOTO IOS IIIS ITO II TOOTS ISI SISTER 
5 3* : : * 
6 ;* COPYRIGHT (c) 1985 BY , * 
7 ;* DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. * 
8 ;* ALL RIGHTS RESERVED. * 
9 3% * 
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 ;* , a 
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 3% * 
24 ;* ‘ 
25 PRR HARRIE RE HK KIKEIK IIR EEK IKKE EI KEKIEKKREE RAKHI HREKERREERERREEREKEEKRKERKEKEEKREKE 
26 ; 
27 
28 ++ 
29 ; Facility: 
30 ; 
31; System Code Loader 
32 ; 
33 ; Abstract: 
34 ; 
35 ; Allocation of system page table entries. 
36 >; 
37 ; Environment: 
38 ; 
39 3 Kernel Mode. 
40 ; 
41 ; Author: 
42 ; 
43 ; Wayne Cardoza 
44; 
45 ; Creation Date: 
46 ; 
47 ; 10-Apr-1985 
48 ; 
49 ; Modified by: 
50 ; 
51.3 X-11 WMCO0008 Wayne Cardoza 25-Jan~1988 
52 ; Fix insertions to empty list and at end of list. 
53 ; 
54 ; X-10 WMCO0007 Wayne Cardoza 14-Nov-1986 
55 ; Base synchronization technique on swapper run yet. 
56 ; 
Ss? X-9 WMC0006 Wayne Cardoza 15-Oct-1986 


278 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PTALLOC - System page table allocation routines 10-MAY-1989 15:58:36 VAX MACRO V5.0- 


8 Page 2 


X-11 25-JAN-1988 12:22:29 [SYS.SRC]PTALLOC.MAR;1 (1) 


58 
59 
60 
61 


™e “Ne Ne Se Ne Te Te Te Be Ve Ye Ne Te Ne 


=e Ve 


se Me 


me “Ye Ne Be Ye Ye Se Se Ye Ye 


=e Ye Ye 


me Ye Se Ye Ne 


Xx-8 


X-5H3 


Yet another problem with combining. 


SF04002 Stephen Fiorelli 24-Sep-1986 
Fix deallocation when the block of ptes to be 
deallocated abuts another free block above it. 


wMco005 Wayne Cardoza 01-Aug-1986 
Handle empty list properly. 


WMC0004 Wayne Cardoza . 08-Jul-1986 
Link free list in reverse order. 


RNG5003 Rod Gamache 10-Jun-1986 


- Conditionally release MMG spinlocks. 


X-5H2 


vo04-001 


MSH0248 Michael S. Harvey 2-Jun~1986 

Add spinlock synchronization for SMP operation. Also, 

fix problems that would be caused if the length parameter 
is passed to these routines with a value of zero. 


SFO04001 Stephen Fiorelli 12-May-1986 
When searching through the pte links when deallocating 
a pte, add ldr$gl_sptbase to the next pte offset. 


WMC0003 Wayne Cardoza 07-Jan-1986 
Really preserve R2. 


WMC0002 Wayne Cardoza 14-Nov-1985 
Make routine vectored symbol. 


WMCc00O01 Wayne Cardoza 14-Nov-1985 
Add comment that R2 is preserved. 


LJK4011 Lawrence J. Kenah 18 July 1985 
Perform minor cleanup. 


DIGITAL INTERNAL USE ONLY 279 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PTALLOC - System page table allocation routines 10-MAY-1989 15:58:36 VAX MACRO V5.0- 
8 Page 3 
X-11 DECLARATIONS 25-JAN-1988 12:22:29 [SYS.SRC]PTALLOC.MAR;1 (2) 


95 - SUBTITLE DECLARATIONS 
96 

97 S$BOOSTATEDEF 

98 SIPLDEF 

99 SLDRPTEDEF 

100 SPRDEF 

101 S$SSDEF 

102 

103 ; Program section directives 

104 

105 DECLARE _PSECT EXECSNONPAGED_CODE 


280 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PTALLOC - System page table allocation routines 10-MAY-1989 15:58:36 VAX MACRO V5.0- 


8 Page 4 


X-11 LDRSALLOC_PT - Allocate page table entr 25-JAN-1988 12:22:29 [SYS.SRC]PTALLOC.MAR;1 (3) 
- SUBTITLE LDRSALLOC_PT - Allocate page table entries 


107 
108 
109 
110 
111 
112 
113 
114 
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 


+ 
+ 


LDRSALLOC PT - Allocate page table entries 


=e Ne Ye 


Calling Sequence: 
JSB LDRSALLOC_PT 
Input Parameters: 
R2 -> Requested PTE count 


Implicit Input: 


™e Ne Se Ne Ye Ye Te Ye Ve Ye Ye Ve Ve 


Linked list formats for free PTE entries: 


For 2 or more PTEs 


This subroutine allocates system page table entries. 


21 20 0 
tenner n= ------ $o--4+--------- +--+ -- +--+ + -- == + 
| | 0 | link (PTE offset) | 
$onnn----------- $---4--------------------------- + 
| total count | 
free nn nn nnn nn nn nn ne en ne eo == = + 

For a single free PTE 

21 20 0 
$--------------- fora fone nn nn en + 
| | 1 | link (PTE offset) 1 

a ee + 


List header: LDRSGL_FREE_ PT 
Output Parameters: 
RO -> Completion Status 
Rl -> Starting PTE address 


R2 -> Preserved 


Implicit Ouput: 


The pool of available PTEs is altered to reflect the allocation. 


me Ne Ne Ye Te Te Ne Te Ye Te Ne Ye Ye Ye Yeo Ye Te Ne Ye Ye Ne Neo Ye Ye Ne Se 
+ 
( 
j 
t 
( 
t 
] 
t 
( 
t 
t 
t 
{ 
t 
t 
{ 


UNIVERSAL SYMBOL LDRSALLOC_PT 


BSBB SYNCHRONIZE ; 


PUSHR #“M<R3> 
MOVL R2,R1 


BNEQ 5$ ; 
MOVL #SS$_BADPARAM, RO ; 
BRB 95S 

5$: MOVAB G“LDRSGL_FREE PT,R3 ; 
TSTL (R3) Hi 


BEQL 100$ 


Synchronize with all CPUs 


If length zero, clear PTE address 
If NEQ, continue with allocation 
Return status with a safe Rl 


No previous free ones 
Empty? 


DIGITAL INTERNAL USE ONLY 281 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PTALLOC - System page table allocation routines 10-MAY-1989 15:58:36 VAX MACRO V5.0-~- 


X-11 LDRSALLOC_PT - Allocate page table entr 25-JAN-1988 12:22:29 [SYS.SRC]PTALLOC.MAR;1 (3) 


8 Page 5 
164 MOVL 
165 ADDL 
166 108: MOVL 
167 BBS 
168 MOVL 
169 208: CMPL 
170 BLEQU 
171 MOVL 
172 EXTZV 
173 
174 BEQL 
175 ADDL 
176 BRB 
177 
178 40$8: BNEQ 
179 INSV 
180 
1861 BRB 
182 
183 60S: SUBL3 
184 MOVL 
185 CMPL 
186 BNEQ 
187 BBSS 
188 708: MOVAL 
189 908: MOVL 
190 MOVL 
191 918: CLRL 
192 SOBGTR 
193 
194 MOVL 
195 958: POPR 
196 RSB 
197 
198 1008: MOVZWL 
199 BRB 


G*LDR$GL_SPTBASE, Rl 
(R3) ,R1 

#1,R0 
#LDRPTESV_FLAG, (R1) ,20$ 
LDRPTE$L_COUNT(R1) , RO 
R2, RO 

40$ 

R1,R3 

#LDRPTES$V_LINK, #LDRPTES$S_LINK, - 
(R1),R1 

100$ 
G*LDR$GL_SPTBASE, R1 

10$ 


60$ 

(RL), #LDRPTE$V_LINK, - 
#LDRPTES$S_LINK, (R3) 
90$ 


-R2,LDRPTE$L_COUNT(R1) , RO 


RO, LDRPTE$L_COUNT (R1) 
RO, #1 

70$ 
#LDRPTES$V_FLAG, (R1) , 70$ 
(R1) [RO] ,R1 

R1,R3 

R2, RO 

(R3)+ 

RO, 91$ 


#SS$_ NORMAL, RO 
#°M<R3> 


#SS$_INSFSPTS, RO 
95$ 


282 DIGITAL INTERNAL USE ONLY 


e 
oe 
e 
’ 
e 
? 
e 
eo 
e 
ao 
e 
e 
e 
° 
e 
s 


-e Ve Ne 


me Ve 


eo Ye Ye Xe Ye Ye No Ye Vo 


. ™e 


Get base of system page table 
Get to first free PTE 

Assume only one 

Branch if really is only one 
Real count 

Enough? 

Yes 

Save previous pointer 

Get link to next free one 


No luck 
Next 
Try again 


Not an exact match 
Link around this one 


Shrink the current free space 
Save new size 

Do we need to set flag 

OK - more than one left 
Indicate only 1 

Address of first free one 
Address of first one 

Count 

Make sure they are all clear 


Desynchronize and return 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PTALLOC - System page table allocation routines 10-MAY--1989 15:58:36 VAX MACRO V5.0- 
8 Page 6 
X-11 SYNCHRONIZE - Synchronize allocation of 25-JAN-1988 12:22:29 [SYS.SRC]PTALLOC.MAR;1 (4) 


201 - SUBTITLE SYNCHRONIZE - Synchronize allocation of system PTEs 
202 ;+ 

203 ; SYNCHRONIZE ~- Synchronize allocation/deallocation of system page table entries 
204 ; 

205 ; This subroutine ensures that access to the system page table 

206 3 for the purposes of allocation and deallocation of the SPTEs 

207 ; is properly synchronized in all environments in which the caller 
208 ; may be operating. 

209 ; 

210 ; This routine will operate as a coroutine most of the time. A caller 
211 ; of this routine can assume upon return that synchronization has been 
212 ; achieved, and can simply execute an RSB instruction when it’s done. 
213 ; That RSB returns control to this coroutine which desynchronizes 

214 ; prior to returning control to the caller’s caller. 

215 ; 

216 ; Calling Sequence: 

217 ; 

218 ; BSBx/JSB SYNCHRONIZE 

219 ; 

220 ; Input Parameters: 

221 ; 

222 ; None. 

223 ; 

224 ; Implicit Input: 

225 ; 

226 ; Contents of the MAPEN IPR 

227 ; 

228 ; Output Parameters: 

229 ; 

230 ; None 

231 ; 

232 ; Implicit Output: 

233 ; 

234 ; If swapper initialization has not executed, this routine simply 

235 ; returns to the caller, assuming that synchronization is already 

236 ; achieved. This assumption is based on the following facts: 

237 7 

238 ; PRIMARY CPU only calls this during early stages of system 
239 ; initial booting. During this time, no other CPUs 

240 ; are running that need to be synchronized with. 

241 ; 

242 ; non-PRIMARY CPUs never call this code during early stages of 
243 ; booting. 

244 ; 

245 ; After swapper initialization, this routine synchronizes across 

246 ; all CPUs and then calls the caller as a coroutine. Desynchronization 
247 ; occurs when the caller executes an RSB back to this coroutine. 

248 ; 

249 ;~ 

250 SYNCHRONIZE: 7 Synchronize the caller with all CPUs 
251 BBC #BOOSTATESV_SWAPPER, - 

252 G“EXESGL_STATE, - ; If not set, assume that this is the 
253 BOOTING 7 PRIMARY CPU going through the 

254 ? system initialization sequence 
255 * and that there are no other CPUs 
256 ? with which to synchronize 

257 POPL RO 7 Pop return address into scratch register 


DIGITAL INTERNAL USE ONLY 283 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PTALLOC ~ System page table allocation routines 10-MAY-1989 15:58:36 VAX MACRO V5.0- 
8 Page 7 
X-11 SYNCHRONIZE - Synchronize allocation of 25-JAN-1988 12:22:29 [SYS.SRC]PTALLOC.MAR;1 (4) 


258 LOCK LOCKNAME=MMG, - ? Synchronize with all CPUs 

259 LOCKIPL=IPL$_ SYNCH, - : 

260 SAVIPL=- (SP) ; 

261 JSB (RO) 3 Call caller as a coroutine 

262 

263 3 

264 ; When the caller finishes, it will issue an RSB instruction which returns 
265 ; control to here. Desynchronize across all CPUs, restore IPL as appropriate, 
266 3; and return to the caller’s caller. 

267 3 

268 UNLOCK LOCKNAME=MMG, - # Desynchronize system structures 
269 NEWIPL=(SP)+,- ; 

270 CONDITION=RESTORE # Conditionally release spinlock 
271 


272 BOOTING: Booting path is not a coroutine 
273 RSB # Return for good.. 


we 


284 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PTALLOC - System page table allocation routines 10-MAY-1989 15:58:36 VAX MACRO V5.0- 


8 Page 8 


X~-11 LDRSDEALLOC_PT - Deallocate page table 25-JAN-1988 12:22:29 [SYS.SRC]PTALLOC.MAR;1 (5) 


275 
276 
277 
278 
279 
280 
281 
282 
283 
284 
285 
286 
287 
288 
289 
290 
291 
292 
293 
294 
295 
296 
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 


- SUBTITLE 


+ 


R2 


R2 


me Ye Ye Be Ys Ye Yo Be Ye Be Yo Ye Ye Be We Ve We Ye Ve We Be Ye Ne We Be Ve Ye We Ne No Nea oe 


LDR$DEALLOC_PT 


LDR$DEALLOC_PT 


Calling Sequence: 
JSB LDRS$DEALLOC_PT 
Input Parameters: 


Rl -> Starting PTE address 
-> PTE count 


Implicit Input: 
Linked list for free PTE entries: 
Output Parameters: 


RO -> Completion Status 
-> Not Preserved 


Implicit Output: 


UNIVERSAL_SYMBOL LDRSDEALLOC_PT 


BSBB 
PUSHR 
TSTL 
BEQL 
CLRL 
TSTL 
BNEQ 
AOBLSS 


208: 


MOVL 
ADDL 
MOVAL 


TSTL 

BEQL 
308: CMPL 
BLEQU 
MOVL 
MOVL 
EXTZV 


SYNCHRONIZE 
#°M<R3,R4,R5,RE> 
R2 

110$ 

RO 


AR1) [RO} 


100$ 
R2,R0,20$ 


G*LDRS$GL_SPTBASE, R4 
G*LDRSGL_FREE PT, R4 
G*LDRS$GL_FREE PT, R3 


(R3) 
2208 


R4,R1 

200$ 

R3, R6 

R4,R3 
#LDRPTESV_ LINK, #LDRPTESS LINK, - 


~ Deallocate page table entries 


Note that entries are linked in reverse address order. 
that freed entries are checked before the large initial block on 
allocation. 


ve 


se Ve 


=e Se Ne 


=e Se 


se Ve 


™e Se Ne Ne 


=e 


- Deallocate page table entries 


This subroutine deallocates system page table entries. 


This ensures 


The pool of free PTEs is altered to reflect the addition of PTEs that 
were just deallocated. 


Synchronize across all CPUs 


Non-zero length specified? 
If EQL yes, return an error 


Is PTE zero? 
No - potential disaster 
Go check the next one 


Address of first free PTE 
No previous one yet 


Empty list? 
Yes 


Is this the place to insert it 
Yes 

Save 2nd predecessor 

New predecessor 

Get link to next free one 


DIGITAL INTERNAL USE ONLY 285 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


PTALLOC - System page table allocation routines 10-MAY-1989 15:58:36 VAX MACRO V5.0- 


8 Page 9 


X-11 LDRSDEALLOC_PT - Deallocate page table 25-JAN-1988 12:22:29 [SYS.SRC]PTALLOC.MAR;1 (5) 


332 
333 
334 
335 
336 
337 
338 
339 
340 
341 
342 
343 
344 
345 
346 
347 
348 
349 
350 
351 
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 


1008: 


1108: 


2008: 


2108: 


2208: 


2308: 


2408: 


2508: 


3008: 
3108: 


BEQL 
ADDL 
BRB 


MOVL 
BRB 


EXTZV 


SUBL3 
INSV 


CMPL 
BEQL 
MOVL 
BRB 


BBSS 


MOVAL 
CMPL 
BNEQ 
EXTZV 


INSV 
BBS 
MOVL 
ADDL3 
BBCC 


POPR 
RSB 


- END 


(R3),R4 

220$ 
G*LDR$GL_SPTBASE, R4 
30$ 


=e Ne Ye 


#LOADERS$ PTE NOT EMPTY, RO 
310$ 


=e 


#SS$_BADPARAM, RO 
310$ 


we 


#1,R0 
#LDRPTESV_FLAG, (R4) ,210$ 
LDRPTESL_COUNT (R4) , RO 
(R4) [RO], R5 

R5,R1 

220$ 

R4,R1 

RO, R2 

R2, LDRPTE$L_COUNT (R4) 
#LDRPTESV_FLAG, (R4) ,240$ 
240$ 


™e Ne Yeo Te Ye Ve Ye Ye Vo Vo Yo 


#LDRPTESV_LINK, #LDRPTESS_LINK, - ; 


(R3), (R1) 
G*LDR$GL_SPTBASE, R1, RO 
RO, #LDRPTESV_LINK, - 
#LDRPTESS_LINK, (R3) 
R2, #1 

230$ 

R2, LDRPTESL_COUNT (R1) 
240$ 


Se Ve 


~™e Ve Ne 


#LDRPTES$V_FLAG, (R1) ,240$ ; 


(R1) [R2], RO ; 

RO, R3 ; 
300$ ; 
#LDRPTESV_LINK, #LDRPTESS_LINK,~ ; 
(R3),RO 


End of list 
Address of free PTE 
Go try next one 


PTEs aren’t all zero 


Bad deallocation length 


Assume preceeding is a single 
Is it? 

Get the correct count 
First PTE past preceeding 
Can they be combined 

No 

New starting address 

New count 

Make it one big one 

Make sure it is clear 
Skip all the linking 


Get link to next one 


Get offset to the new one 
Link in the new one 


Is there only one 
Yes 
Add the count 


Indicate only one PTE 


One PTE past the new ones 

Can we combine with the next — 
No 

Get link to next one 


RO, #LDRPTESV_LINK, #LDRPTE$S_LINK, (R6) 


#1, RO 
#LDRPTES$V_FLAG, (R3) ,250$ 
LDRPTE$L_COUNT(R3) , RO 
RO, R2, LDRPTE$SL_COUNT(R1) 
#LDRPTESV_FLAG, (R1) , 300$ 
#SS$_NORMAL, RO 

#°M<R3, R4,R5, RE> 


Se Ye Ye Se Yo 


=e 


286 DIGITAL INTERNAL USE ONLY 


Assume next is a single 
Is it? 

Get real count 
Combined count 

Make sure it is clear 


Desynchonize and return 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


11. SMPROUT.LIS 


SMPROUT - SMP routines for VMS 10-MAY~-1989 16:58:12 VAX MACRO V5.0-8 Page 0 


Table of contents 


(1) 
(2) 
(3) 
(4) 
(5) 
(6) 
(7) 
(8) 
(9) 
(10) 
(11) 
(12) 
(12) 
(13) 
(14) 


35 
350 
383 
426 
526 
590 
673 


HISTORY 

DECLARATIONS 

GET_CURPCB - Return current PCB address 

SMPSSWITCH_CPU - Switch to another CPU base on device affinity 
IOPOST_IRP - Place IRP on Per-processor IOPOST Q. 

SMPSINVALID - invalidate a single TB entry. 

SMPSTIMEOUT - SMP timeout processing routine 

INIT SANITY - Initialize SMP sanity timer pointer in CPU database 
SMPSSHUTDOWN | CPU - Final actions associated with stopping a CPU. 
SMPSINITIATE | BENIGN ~- Initiate a benign state 

SMP S$SETUP _| PFORK -- setup for fork to primary 

SMP SFORK_ TO |) PRIMARY- migrate work packet to primary CPU 

MESSAGE Display message on virtual console 

SMPSWRITE_OPAO - fork routine to broadcast message to console 
SYNCHSINIT | ONCE - Once only initialization for Spinlocks 


DIGITAL INTERNAL USE ONLY 287 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 1 
X~72 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1) 


woDwtane WH 


me Ne Te Ye Me Te Ne Te Te Te Ve Te Ne Yo Ve So Ve Yo Te Ne Ne Yo Ye Ne Ye Ye Ye Ye Vo No =e Ne 


=e te Ye Ve Se Ye 


me Ne Ye Te Se Ve Ve Be Be We Ve Ne Ye Ve Ye Ve 


*eee 8H ££ 6 HH HF HH SH SH HH HF HF FS 


TITLE SMPROUT - SMP routines for VMS 
IDENT ‘'X-72/ 


COPYRIGHT (c) 1978, 1980, 1982, 1984 BY 
DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. 
ALL RIGHTS RESERVED. 


THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED 
ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE 
INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER 
COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY 
OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY 
TRANSFERRED. 


THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE 
AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT 
CORPORATION. 


DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS 
SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. 


++ 
Facility: Symmetric Multiprocessing 
Abstract: The subroutines to implement the acquire and release busy 


wait spinlocks for symmetric multiprocessing. 


Environment: Kernel Mode. 


-SBTTL HISTORY 


Author: Rod N. Gamache Creation Date: 3-Mar-1986 


Modified by: 


X-72 Brian Porter 19-APR-1989 
RESTORE EMB lock rather than RELEASE. 


X-71 DDP0315 Derrell D. Piper 15-Sep-1988 
Initialize audit server mailbox device lock address. 


X-70 WMC0070 Wayne Cardoza 25-Aug-1988 
Major changes for redesign of affinity and capabilities. 
Several routines removed. 


X~69 EMBO0355 Ellen M. Batbouta 17-Aug-1988 
In SMP$SWITCH_CPU, check for primary affinity which 
is specified by the value zero in the UCBSL_AFFINITY 
field. 


X-68 WMC0068 Wayne Cardoza 02-Aug-1988 
Call routine to chnage process from CUR to COM. 


288 DIGITAL INTERNAL USE ONLY 


RHEKKKHKEKHHEKEKHKKKEKEKKEKKKEKEKEKREKKEKKKEKEKKEKEKRRKKEKKKKERKKKKKREKREREKKEKRKKKKREKKKKEKE 


+e + ~o + He 2 & * F HH HH He FF HF HF FF 


RHRERMRKEREKKEKEREEKEERKEREKKEKKKKEKKREKKREEKRKHEKKKEKKEKREKRERKEKHKERHERREKKKREEKRKEEKE 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 2 
X-72 HISTORY 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1) 


109 
110 
111 
112 
113 
114 


we Ye Ne We Ye Ye Ne Ye Ye Se Ne Ve Ve Be Ve Ve Ve We Ve Ve Be Ve Ye Wo 


™e Ve Te Ve Ye Ve Ye Se Te Ne Ye Re Ne Ye Se Ve Ne Ve Ne Te Ve Ve Ye Ye Ye Be We Ye Ye Yo Ve Ye Ye 


X~67 


X~-66 


X-65 


X~-64 


X-63 


X-62 


X-61 


X-60 


X-59 


X-58 


X-57 


X-56 


SOF Stu Farnham 30-Jun-1988 

Fix rescheduling logic in SETAFF/SETCAP. Correct operand 

erder on an ASHL in SHUTDOWN_CPU. Handle BOOT REJECTED state 
correctly in SMPS$SHUTDOWN | CPU. Fix a broken BBCC in SMPS$SHUTDOWN_CPU 


HHO320 Hai Huang 07-Jun-1988 
Unlock the SCHED spinlock with the RESTORE parameter, so 
SMPS$SETCAP/SMPSSETAFF can be called with SCHED already held. 


RNG5065 Rod Gamache 31-Mar-1988 
Modify SMPSIOPOST_IRP to use system-wide post queue. 


SUF Stu Farnham 9~Feb-1988 

1. Changes some names: 

EXESGL_WRITE_CONS POOL becomes SMP$GL_PFORK_POOL 
EXESWRITE | CONS becomes SMP$SETUP_PFORK 

2. Change initialization of PFORK_POOL to use contents 
of SMPS$GB PFORK POOL SIZE to determine how many pages 
to allocate. 

3. Move redundant code from several modules to this one 
at entrypoint SMPSWRITE_OPAO. Modify SMP$SHUTDOWN_CPU 
to use this entrypoint. 

4. Teach SMPS$SHUTDOWN_CPU to exit at IPL of entry. 


SJF Stu Farnham 27-Jan-1988 

Add SMPSFORK _| TO_PRIMARY (and assoc. code) to provide 

a mechanism for | high IPL threads to generate cosole output. 
Use that mechanism in SMPSSHUTDOWN_CPU. 


PT00012 Pankaj Tandon - 11-Jan-1988 
Insert in-line code in SMPS$SHUTDOWN_CPU for correct 
adjustment of pointers in sanity timer chain. 


MSH0329 Michael S. Harvey 28-Oct-1987 
Don’t assume that CPB$C_QUORUM is zero. Also, allow 
recognition of capability value zero when removing a 
process affinity by accepting 1’s complement input 
instead of 2's complement input. 


Also, fix a synchronization problem; fix supplied by Rod G. 


SJF . Stu Farnham 26-Oct-1987 
Take correct branch when SMPSTIMEOUT finds a halted CPU. 


RNG5059 Rod Gamache 21-Oct~1987 
Release SCHED spinlock as early as possible when shutting 
down a CPU. 


SUF Stu Farnham 19-Oct-1987 
Check for halted CPUs in SMPSTIMEOUT. 


RNG5057 Rod Gamache 5-Oct-1987 
Block re~scheduling while locking the CPU MUTEX. 


SUF Stu Farnham 24-Sep-1987 
Remove checks for process space and SMP enabled from 


DIGITAL INTERNAL USE ONLY .289 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 3 
X-72 HISTORY 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.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 


X-55 


X-54 


X-53 


X~52 


X-51 


X-50 


X-49 


Xx-48 


me Ne Ye Ye Ne Be Ne Ye Be Be Be Be Ye Ne Ve Ve We Ne Ye Ve Be Ve We Ye Yo Vo Vo Vo Ye Ve Vo 


X-47 


X-46 


X-45 


X~-44 


X~43 


™e Te Se Ne Ve Ye Ne Be Ne Ve Ne Ne Ye We Be We Ye Ve Ye Be Wo Ye Ve We We Ve 


SMPSINVALID. Putting them in the INVALIDATE_TB macro will 
speed up pagefault processing. 


SSA0001 Stan Amway 21-Sep-1987 
Change range checking in SMPSSETCAP (CLEAR path) to 
special case QUORUM capability, assumed to be CPB #0. 


RNGSO55 Rod Gamache 18-Sep-1987 
Fix missing label. 


RNG5054 Rod Gamache 9-Sep-1987 
Add call to SMP$HALT CPU when a CPU is to terminate itself. 


RNG5053 Rod Gamache 26-Aug-1987 
Add benign state processing. 


SUF Stu Farnham - 18-Aug-1987 
SMPSINVALID does not return properly for PO addresses. 
Clean up the return, and fix a typo. 


SUF Stu Farnham 11-Aug-1987 
Fix register usage in SMPSINVALID 


SFO00050 Stephen Fiorelli 06-Aug-1987 
Fix Coroutines with smpSinvalid. 


SF00049 Stephen Fiorelli 06-Aug-1987 
Coroutines with smpSinvalid. 


SUF Stu Farnham 17-July-1987 

Check for CPU in BOOT REJECTED state or (in active set 

*AND* in RUN state) in SMPSSHUTDOWN_CPU. Check for target CPU 
in active set in SMPSSETAFF. 


SUF Stu Farnham 10-Jun-1987 

1. initialize SPLSL_TIMC_ INT in OPAO devicelock 

2. Correct register save mask in SMPSSHUTDOWN_CPU 
to preserve R4 

3. Exit with correct status in all cases from $SETAFF/ 
SSETCAP. 

4. Modify SMPSCALCAFF to correctly handle a null 
capability selection mask as input. 

SUF Stu Farnham 5-Jun-1987 

Modify SYNCHSINIT_ONCE to initialize timeout intervals of 

all spinlocks ate IPL <= 8 to SMP_LNGSPINWAIT. 


RNG5045 Rod Gamache 3-Jun-1987 
Fix problem with bitmask usage in SMPSSETAFF. 


RNG5044 Rod Gamache 2-Jun-1987 
Fix problem with SMPSSETCAP not correctly generating 
a full capability mask. 


SUF Stu Farnham 27-May-1987 
Allow for nested $SETCAP calls for the same capability 
without modifying capability database. This allows a 


290 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 4 
X-72 HISTORY 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1) 


172 
173 
174 
175 
176 
177 
178 
179 
180 
181 
182 
183 
184 
185 
186 
187 
188 
189 
190 
191 
192 
193 
194 
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 


we Me “Me “Ne “Ye Ye Ye Ne We Ye Se Ye Ye Ye Se Ye Ye Ne Ne Ne Te Yo Ye Ve Te Ye Ve Ne Ne Yeo Ye Ve Ye Ye Ve Ye Yo Vo 


me Te Te Te Ye Ye Ve Ye Te Ve Ye Ye Ye Ne Be Ve Ye Ve Vs 


X-42 


X-41 


x-40 


X-39 


X-38 


X-37 


X~-36 


X-35 


X-34 


-33 © 


X-32 


X-31 


X-30 


X-29 


X-28 


single clear capability request to reset the database 
correctly. 


SUF Stu Farnham 19-May-1987 
Add generic, kernel mode $STOP/CPU functions to SMP$ 
SHUTDOWN_CPU. 


SUF Stu Farnham 22-Apr-1987 
Re-do part of edit X-39, which got dropped along the line. 


SUF Stu Farnham 22-Apr-1987 
Fix RESCHED request in SMPSSETAFF and SMPSSETCAP. 


SUF Stu Farnham 14-Apr-1987 
Fix SMPSSETAFF to index SMP$GW_AFFINITY_ COUNT correctly. 
Change EXESSTOP_CPU to SMP$SHUTDOWN_| CPU for naming consistency. 


SUF Stu Farnham 3-Apr-1987 
Add stub for EXESSTOP_ CPU. 


RNG5037 Rod Gamache 25-Mar-1987 
Cleanup SETCAP routine a little. Negative capability 
values are used to remove a capability. 


RNG5036 Rod Gamache 24-Mar-1987 
Change refs from SMPSAR_SPNLKVEC to SMP$GL_SPNLKVEC. 
Change refs from SMPS$AR_SPNLKCNT to SMPS$GW_SPNLKCNT. 
Init SMP$GW_MIN INDEX and SMP$GW_SPNLKCNT. 


RNG5035 Rod Gamache 18-Mar-1987 
Copy IPL vector from LDAT to base image. 


SUF Stu Farnham 16-Mar-1987 
Use SMP_LNGSPINWAIT as timeout interval for SCS,MMG and SCHED 
spinlocks to reflect long holding times for those locks. 


SFO001 Stephen Fioreli - 12-Mar-1987 
Place code in nonpaged psect. 


SUF Stu Farnham 4-Feb-1987 
Modify SMPSSETAFF and SMPSSETCAP to request a reschedule 


of a process whose affinity run mask has been changed 
if that process is current somewhere. 


Teach SMPSTIMEOUT about the TIME CONTROL sysgen param 
so it can detect SMP timeouts disabled. 


Remove unused entrypoints SMPSFIND_SELF, SMPSFIND_OTHER, 
and SMPS$SYNCH_TODR. 


SUF Stu Farnham 3-Feb~-1987 
FIx various spellos. 


WMC0029 Wayne Cardoza 28-Jan-1987 
Use indirect pointer to I/O structures. 


RNG5028 Rod Gamache 27-Jan-1987 


DIGITAL INTERNAL USE ONLY 291 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 5 
X-72 HISTORY 19-APR-1989 15:24:09 [(SYS.SRC]SMPROUT.MAR;1 (1) 


229 
230 
231 
232 
233 
234 
235 
236 
237 
238 
239 
240 
241 
242 
243 
244 
245 
246 
247 
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 
279 
280 
281 
282 
283 
284 
285 


Re We te Me Se Ne Se Se Ne Me Se Ne Me Ne Te Me Ne Te Te Se Te Se Ne Ye Ye Se Se Yo Te Ne Ne Se Ne Se Te Ne Ye Ne Se Ne Ne Ne Se Ye Se Ne Se Se Se Se “Se Ne Se Ne Ne Se Ne 


X-27 


X-26 


X-25 


X-24 


X-23 


X-22 


X-21 


X~-20 


X-19 


X-18 


X-17 


X-16 


X-15 


X-14 


Add SMPSTIMEOUT routine. 


SJF Stu Farnham 27-Jan-1987 
Fix typo. 
SUF Stu Farnham 26-Jan-1987 


Add busywait timeouts. Add SMPSINIT SANITY. Do NOT 
normalize wait intervals in order to save memory 
references during busywaits. 


SUF Stu Farnham 5-Jan-1987 
Initialize SPL$L_TIMO_INT in SYNCHS$INIT_ ONCE. Store 
normalized busywait and spinwait times in SMP$GQ_SPINWAIT 
and _BUSYWAIT. 


SUF Stu Farnham 30-Dec-1986 
Correct check for CPB #/ CPU ID for which to CLEAR 
affinity. 


SUF Stu Farnham 22-Dec-1986 
Rewrite affinity and capability routines, which were 
hopelessly broken. 


SJUF Stu Farnham 9-Dec~-1986 
Remove redundant (un) lock of CPU mutex in SMPSCALCAFF. 
Streamline revised affinity code. 


SUF Stu Farnham 4-Dec-1986 
Bug fixes to affinity routines: 

~ add missing RSB to SMPSCALCAFF 

~ £ix broken register 

- fix broken branch from CALCAFF_INCLUSIVE 


RNGO020 Rod Gamache 5-Nov-1986 
Fix loop problem in SMPS$INVALID. 


RNGOO19 Rod Gamache 31-Oct-1986 
Move code that adjusts IPLs to SMPSTART modules... 


SUF Stu Farnham 30-Oct-1986 
Remove temporary code. 


RNGOO17 Rod Gamache 29-Oct-1986 
Add $SPLCODDEF macro call, optimize SMPSINVALID for uniprocessor 
and remove use of WHAMI macro. 


RNGOO16 Rod Gamache 28-Oct-1986 
Optimize SMPSINVALID to return if SMP operation is not enabled. 


SUF Stu Farnham 6-Oct-1986 
Add process affinity entrypoints SMPSSETAFF, SMPSSETCAP, and 
SMPSCALCAFF (_INCLUSIVE) . 


RNGOO14 Rod Gamache 15-Sep-1986 
Make SMPSSWITCH_ CPU handle TWP’s. Remove temporary branch 
around SMPSADJUST_ IPL routine. 


292 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 6 
X-72 HISTORY 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1) 


286 
287 
288 
289 
290 
291 
292 
293 
294 
295 
296 
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 


se “Ne Se Ye Ye Ye Ye Ye Se Yeo Be Se Ye Ye Ye Ve Ne Ne Vo Se Ye Ye Ye Ye Ve Yo Ve Ve “We Ne Ne Ne Ye Ne Ne Ve 


=e Me Se 


~e Me Me Ve Me Ve Ne Ye Ve Ve Yo Wo Vo Ve Yo We Yo Vo 


X-12 


X-11 


X-10 


X-9 


X-6 


X-2H8 


X-2H7 


X-1H2 


X-1F8 


X-1F7 


X-1F6 


X-1F5 


X-1F4 


X-1F3 


RNGOO012 Rod Gamache 8-Sep-1986 
Change JSB to SMPS$ADJUST_IPL to BSBW. 


RNGOO11 Rod Gamache 8-Sep-1986 
Move HWCLK IPL adjustment into SYNCHSINIT ONCE routine. 


MSH0277 Michael S. Harvey 19-Aug-1986 
Speed up some code paths. 


SUF Stu Farnham 1-Aug-1986 
Fix spellos. 


SUF Stu Farnham 31-Jul-1986 
Add SMPS$SYNCH_TODR. 


WMC0002 Wayne Cardoza 29-Jul-1986 
Get rid of re-executeable flag. 


SUF Stu Farnham 28-Jul-1986 
Rename IPINT spinlock to INVALIDATE. Fix IPL of 
acquisition. 


MSH0270 ‘Michael S. Harvey 25-Jul-1986 
Make sure that mutex is used to protect active CPU 
bitmask. 


wmcoo0o1 Wayne Cardoza 24-Jul-1986 
Initialization routines must return status. 


SUF Stu Farnham 19-Jun-1986 
Change IPL of IPINT acquire to 21. 


SUF Stu Farnham 16-Jun-1986 
Clean up synchronization in SMPSINVALID. 


RNGO102 Rod Gamache 6-Jun-1986 
Add initialization routine to setup DEVICE LOCKs for 
the MAILBOX CRB and all associated UCBs. 


SUF | Stu Farnham 22-May-1986 
Modify SMPSINVALID to use IP ACK WAIT macro, and 
to request IP interrupts ONLY for SO addresses. 


RNG1007 Rod Gamache 22-May-1986 
Remove SMP$PLM RECORD routine. 


RNG1006 Rod Gamache 16-May-1986 
Fix SMPSINVALID instruction order. 


SUF Stu Farnham 14-May-1986 
Add SMPSINVALID 


RNG1004 Rod Gamache 13-May-1986 
Add SMPS$PML_ RECORD routine to record poor man’s lockdown 


pages. 


RLRSMP Robert L. Rappaport 13-May-1986 


DIGITAL INTERNAL USE ONLY 293 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10~-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 7 
X-72 HISTORY 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1) 


343 
344 
345 
346 
347 
348 


we Se Ne Te Ye Ve 


X-1F2_ 


Add SMPS$IOPOST_IRP entrypoint. 


RNG1002 Rod Gamache 24-Apr-1986 
Add SMPS$SWITCH_CPU routine to fork to another CPU based 
on device affinity. 


294 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0~-8 Page 8 
X~72 DECLARATIONS 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (2) 


350 
351 
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 


-SBTTL DECLARATIONS 


SBIICDEF : Define 
SBOOSTATEDEF ; Define 
SCPBDEF : Define 
SCPUDEF : Define 
SCRBDEF : Define 
SDYNDEF ?; Define 
SFKBDEF ; Define 
SINIRTNDEF : Define 
SIPLDEF : Define 
SIRPDEF 3? Define 
SKA810DEF ? Define 
SPCBDEF : Define 
SPRDEF : Define 
SPR8SSSDEF : Define 
SPSLDEF ; Define 
SPTEDEF ?; Define 
SSPLDEF ; Define 
SSPLCODDEF >; Define 
SSSDEF 3 Define 
SSTATEDEF ? Define 
STTYDEF ; Define 
SUCBDEF ?; Define 
-list meb 


DECLARE_PSECT EXECSNONPAGED_DATA 
-PSECT EXECSNONPAGED_ DATA, QUAD, WRT, NOEXE, PIC 


INVALID IPL: 
- LONG 


~e te 


BIIC offsets 
boostrap state flags 
system capability #s. 
per CPU data area 
CRB offsets 
structure types 

fork blocks 
initialization routine flag.. 
IPLs 

IRPs 

KA820 node private space 
process control block 
Processor Registers 

KA820 processor registers 
Processor Status Longword 
page table entry 

spinlock structures 
spinlock indices 

status returns 

scheduling states 

TTY WE structure 

UCB offsets 


Temporary storage to save IPL on stack 
for coroutine call in smpSinvalid 


DIGITAL INTERNAL USE ONLY 295 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0~-8 Page 9 
X-72 GET CURPCB - Return current PCB address 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (3) 


383 -SBTTL GET _CURPCB ~ Return current PCB address 

384 s++ 

385 ; SMPSGET_CURPCB - Return current PCB address 

386 ; 

387 ; This subroutine is used to find the PCB address that is currently 

388 ; executing on the CPU. 

389 ; 

390 ; Calling sequence: 

391 ; 

392 ; JSB/BSBx SMP$GET_CURPCB 

393 ; 

394 ; Inputs: 

395 ; 

396 ; None. 

397 ; 

398 ; Implicit Inputs: 

399 ; 

400 ; CPU database from Interrupt Stack 

401 ; 

402 ; Outputs: 

403 ; 

404 ; R4 = PCB address 

405 ; 

406 ; Implicit Ouputs: 

407 ; 

408 ; None 

409 ; 

410 ; Side Effects: 

411 ; 

412 ; None. 

413 ; 

414 ;-- 

415 

416 DECLARE _PSECT EXECSNONPAGED_CODE 
-PSECT EXECSNONPAGED_ CODE, LONG, NOWRT, EXE, PIC 

417 

418 UNIVERSAL_SYMBOL SMPS$GET_CURPCB 


SMP$GET_CURPCB:: 
419 ;SMPSGET_CURPCB:: 
420 DSBINT ENVIRON=UNIPROCESSOR 
MFPR S*#PR$_IPL, - (SP) 
MTPR #31,S°#PR$_IPL 
421 find_cpu_data R4 
MFPR S*#PRS$_ISP,R4 
BICL2 G“SMPS$GL_BASE_MSK, R4 
422 ‘MOVL CPUSL_CURPCB (R4) , R4 
423 ENBINT 


Raise IPL above SCHED 


=e 


Get per-CPU database address 


we 


Return PCB address 
Restore IPL 


se Ye 


MTPR (SP) +,S*#PRS$_IPL 
424 RSB 3; Return to caller 


296 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 10 
X-72 SMPSSWITCH CPU - Switch to another CPU b 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (4 


426 -SBTTL SMPSSWITCH_CPU - Switch to another CPU base on device affinity 
427 3++ 

428 ; SMPSSWITCH CPU - switch to another CPU 

429 ; 

430 ; This subroutine is used to switch execution to another CPU as a 
431 ; fork thread. 

432 ; 

433 ; Calling sequence: 

434 ; 

435 ; JSB/BSBx SMP$SWITCH_CPU 

436 ; 

437 ; Inputs: 

438 ; 

439 ; R3 = TWP/IRP ADDRESS (USED AS FORK BLOCK) 
440 ; R5 = UCB ADDRESS /with affinity mask 
441 ; 

442 ; Implicit Inputs: 

443 ; 

444 ; CPU database from Interrupt Stack 

445 ; 

446 ; Outputs: 

447 ; 

448 ; none. 

449 ; 

450 ; Implicit Ouputs: 

451 ; 

452 ; None 

453 ; 

454 ; Side Effects: 

455 ; 

456 ; RO and R3 are destroyed. 

457 ; 

458 ;-- 

459 

460 UNIVERSAL_SYMBOL SMPS$SWITCH_ CPU 


SMP$SWITCH_CPU:: 
461 ;SMPS$SWITCH_CPU:: 


462 CMPB #DYNSC_IRP, IRP$B_TYPE(R3) ; Is this an IRP? 
463 BNEQ 40$ ; Br if no 
464 MOVAB IRP$C_CDRP (R3) , R3 7 Point to CDRP part of IRP as FKB 
465 MOVB #DYNSC_IRP,FKBS$B_TYPE(R3) ; Set structure type 
466 MOVAB B*FORK_THREAD_IRP,FKBSL_FPC(R3) ; Save fork address 
467 108: MOVB UCBSB_FLCK(R5),FKB$B_FLCK(R3) ; Copy fork lock index 
468 MOVL R5, FKB$L_FR3(R3) # Save R5 in FORK BLOCK 
469 POPL FKBSL_FR4 (R3) 3 Save return PC in FORK BLOCK 
470 FFS #0, #32, UCBSL_AFFINITY(R5),RO ; Find first good CPU 
471 BNEQ 15$ 7; If NEQ, found a CPU 
472 MOVL G*SMP$GL_PRIMID, RO ; Affinity has been set to primary 
473 158: MOVL G*SMPSGL_CPU_DATA[RO],RO ; Get address of CPU database 
474 PUSHL R1 7 Save scratch register 
475 SINSQTI (R3),CPUSQ_WORK_FOFL(RO),R1 ; Insert work pkt on end of queue 
CLRL R1 
300008: 
INSQTI (R3),CPUSQ_WORK FOFL(RO) 
BCC 30001$ 


AOBLSS #900000,R1,30000$ 
- WORD “XFEFF 


DIGITAL INTERNAL USE ONLY 297 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 11 
X-72 SMPSSWITCH_CPU - Switch to another CPU b 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (4 


BUG$_BADQHDR! 4 


Note: R1 is destroyed by SINSQTI 


#CPUSV_WORK_FQP,CPU$L_ WORK REQ(RO),20$ ; Set work request bit 


Get physical CPU ID 
Generate IP Interrupt 


Return to caller’s caller 


Is this a TWP? 


Save fork address 


Inconsistent database if here 


BUG$_INCONSTATE! 4 


Backup to IRP 

Get UCB address 

7 Call back original routine 
Return to caller 


Restore TWP address to R3 
Get UCB address 
Call back original routine 


-IIF IDN <FATAL>,<FATAL> , .WORD 
300018: 
300028: 
476 ; 
477 POPL R1 3 Restore Ril 
478 BBSSI 
479 208: 
480 MOVL CPUSL_PHY_CPUID (RO) , RO ? 
481 IPINT CPU ; 
JSB G*“SMPSINTPROC 

482 RSB ; 
483 
484 40S: 3; Turn TWP into a fork block 
485 
486 CMPB #DYNSC_TWP, TTYSB_WB_TYPE(R3) ; 
487 BNEQ 99$ ; Br if no 
488 ASSUME FKB$B_FLCK EQ TTY$B_WB_FLCK 
489 ASSUME FKBSL_FPC EQ TTY$L_WB_FPC 
490 ASSUME FKBS$L_FR3 EQ TTYS$L_WB_FR3 
491 ASSUME FKBSL_FR4 EQ TTYS$L_WB_FR4 
492 MOVAB B*FORK_THREAD_TWP, FKBSL_FPC(R3) ? 
493 BRB 108 3 Continue 
494 
495 : 
496 995: BUG CHECK INCONSTATE, FATAL 3 

~ WORD AXFEFF 

-IIF IDN <FATAL>,<FATAL> , .WORD 
497 
498 ;+ 
499 ; Fork thread that executes after switching to other CPU via IRP. 
500 ; 
501 ; R5 = FORK BLOCK ADDRESS 
502 ; FKBSL_FR3 = UCB ADDRESS 
503 ; FKBSL_FR4 = Routine address 
504 ;:- 
505 
506 FORK THREAD IRP: 
507 SUBL3 #IRPS$C_CDRP,RS5,R3 3 
508 MOVL § IRPS$C_CDRP+FKBS$L_FR3(R3),R5 ; 
509 JSB @IRPS$C_CDRP+FKBSL_FR4 (R3) 
510 RSB ? 
§11 
512 ;+ 
513 ; Fork thread that executes after switching to other CPU via TWP. 
514 ; 
515 ; R5 = FORK BLOCK ADDRESS 
516 ; FKBSL_FR3 = UCB ADDRESS 
517 ; FKBSL_FR4 = Routine address 
518 ;- 
519 
520 FORK_THREAD TWP: 
521 MOVL R5,R3 ; 
522 MOVL FKBSL_FR3 (R3) ,R5 ; 
523 JSB @FKBSL_FR4 (R3) H 
524 RSB ; 


298 DIGITAL INTERNAL USE ONLY 


Return to caller 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 12 
X-72 IOPOST_IRP - Place IRP on Per=processor 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (5) 


526 
527 
528 
529 
530 
§31 
532 
533 
534 
535 
536 
537 
538 
539 
540 
541 
542 
543 
544 
545 
546 
547 
548 
549 
550 
551 
552 
553 
554 
555 
556 
557 
558 


559 
560 
561 
562 
563 


564 


565 
566 
567 
568 
569 
570 
$71 


-SBTTL IOPOST IRP - Place IRP on Per-processor IOPOST Q. 
ett 
7 SMPSIOPOST_IRP - Place IRP on Per-processor IOPOST Q. 
; This subroutine is used to INSQ an IRP on the IOPOST queue for 
? the current CPU. 
7 Calling sequence: 
7 
; JSB/BSBx SMPS$IOPOST_IRP 
; 
3; Inputs: 
? R3 => IRP 
3 Implicit Inputs: 
? CPU database from Interrupt Stack 
3; Outputs: 
7 
7 Implicit Ouputs: 
; None 
¢ Side Effects: 
7 
7 None 
7 
UNIVERSAL_SYMBOL SMP$IOPOST_IRP 


SMP$IOPOST_IRP:: 
;SMPSIOPOST_IRP:: 


PUSHL RO 7 Save register. 
ASSUME SMPSV_ENABLED EQ 0 
BLBS G*SMP$GL_FLAGS, 20$ 7 Br if a multi-processor 
SINSQTI (R3),G*IOC$SGQ POSTIQ 3 INSERT PACKET ON QUEUE 
CLRL RO 
300048: 
INSQTI (R3),G*IOC$GQ POSTIQ 
BCC 30005$ 
AOBLSS #900000, RO, 30004$ 
- WORD “XFEFF 
-IIF IDN <FPATAL>,<FATAL> , .WORD BUG$_BADQHDR!4 
30005$8: 
300068: 
SOFTINT S*#IPL$_IOPOST ? REQUEST FORK 
MTPR S*#IPL$_IOPOST, S*#PR$_SIRR 
POPL RO 7 Restore RO. 
RSB 7 RETURN 
208: This is a multiprocessor, don’t allow rescheduling so that 


SAVIPL -(SP) ; 


7 we guarantee the SOFTINT will happen on the correct CPU. 


Save the current IPL 


DIGITAL INTERNAL USE ONLY 299 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 13 
X-72 IOPOST_IRP - Place IRP on Per-processor 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (5) 


572 
573 
574 


575 


576 
577 


578 
579 
580 


581 


582 
583 
584 
585 
586 
587 


588 


408: 


30007$: 


300088: 
300098: 


608: 


808: 


300108: 


MFPR S“*#PRS$_IPL, - (SP) 
CMPB (SP), S*#IPL$_IOPOST # Is current IPL high enough? 
BGEQ 40$ ; Br if yes, continue 
SETIPL S“#IPL$_IOPOST, ENVIRON=UNIPROCESSOR ; Else, raise IPL 
MTPR S“*#IPL$_IOPOST, S*#PRS$_IPL 
SINSQTI (R3),G*IOC$GQ POSTIQ 3 INSERT PACKET ON QUEUE 
CLRL RO 


INSQTI (R3),G*IOC$GQ POSTIQ 
BCC 30008$ 
AOBLSS #900000, RO,30007$ 
WORD “XFEFF 
-IIF IDN <FATAL>,<FATAL> , .WORD BUGS BADQHDR!4 


BNEQ 60$ BRANCH IF QUEUE IS NOT EMPTY 
FIND CPU_DATA RO ; GET ADDRESS OF PER-CPU DATA 
MFPR S*#PR$_ISP,RO 

BICL2 G*SMPSGL_BASE_MSK, RO 

CMPL § G*SMPSGL_PRIMID,CPUSL_ PHY CPUID(RO) ; Are we the primary? 


we 


BNEQ 80$ + Br if not primary 
SOFTINT S*#IPL$_IOPOST 3 REQUEST FORK 
MTPR S*#IPL$_IOPOST, S*#PR$_SIRR 
ENBINT 3 RESTORE IPL 
MTPR (SP) +,S*#PRS$_IPL 
POPL RO ? Restore RO. 
RSB ; RETURN 


? This is not the primary CPU on an MP 


IPINT CPU IOPOST, G*SMP$GL_PRIMID ; Tell the primary to do a softint 
PUSHL RO 

MOVL G*SMPS$GL_PRIMID, RO 

PUSHL R1 

MOVAL G*SMP$GL_CPU_DATA, R1 

MOVL (R1) [RO),R1 

BBSSI S*#CPUSV_IOPOST, CPUSL_WORK_REQ(R1) , 30010$ 


POPL R1 

JSB G*SMP S$ INTPROC 

POPL RO 

BRB 60$ 3 Non-optimal case, don’t bother 


300 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 14 


X-72 SMPSINVALID - invalidate a single TB ent 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (€ 


590 
591 
592 
593 
594 
595 
596 
597 
598 
599 
600 
601 
602 
603 
604 
605 
606 
607 
608 
609 
610 
611 
612 
613 
614 
615 
616 
617 
618 
619 


620 
621 
622 
623 
624 


625 
626 
627 
628 


-SBTTL SMPSINVALID - invalidate a single TB entry. 


+ 
+ 


FUNTIONAL DESCRIPTION: 
SMPSINVALID is called to INVALIDate a single TB entry. 
CALLING SEQUENCE: 
BSB/JSB SMPSINVALID 
INPUT PARAMETERS : 
R2 = Address for which to invalidate TB 
OUTPUT PARAMETERS: 
NONE 
Side effects: 
The other processors in an SMP system are interrupted to invalidate 
the corresponding entry in their TBs. The routine waits for all 


processors to perform the invalidate, and then issues a TBACK and 
continues. 


me Yo Se Te Se Ye Ye Be We Ve Ye Ye Ve Ve Ve Ne Ve No Be Ve Ye Ye Veo Vo Yo 


-ENABL LSB 


UNIVERSAL _SYMBOL SMP$ INVALID 
SMPSINVALID: : 


;SMPSINVALID:: 
PUSHL RO 
LOCK LOCKNAME=INVALIDATE, - # synch the TB INVALIDATE database 
PRESERVE=NO, - 
SAVIPL=- (SP) 
- SAVE LOCAL BLOCK 
-PSECT S$ABSS$,ABS 
- RESTORE 
MFPR S“*#PRS$_IPL,- (SP) 
BLBC G*SMP$GL_FLAGS, 30013$ 
MOVZBL S*#SPLS$C_INVALIDATE, RO 
JSB G*SMP SACQUIRE 
BRB 30014$ 
300138: 
MTPR S*#IPL$_INVALIDATE, S“#PRS$_IPL 
300148: 
LOCK MUTEX=SMPS$GL_CPU_MUTEX,-; Lock the CPU bitmasks 
PRESERVE=NO, - ; 
SHARE=YES 7 to prevent them from changing 


-SAVE LOCAL BLOCK 
-PSECT $ABS$, ABS 
. RESTORE 
MFPR § S*#PRS$_IPL,- (SP) 
MTPR  #31,S*#PRS$_IPL 
MFPR  S“#PRS$_ISP, RO 


DIGITAL INTERNAL USE ONLY 301 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 15 
X-72 SMPSINVALID - invalidate a single TB ent 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (€ 


BICL2 G*SMP$GL_BASE_MSK, RO 
CLRL -(SP) 


300178: 
MULL3 G*SGN$GL_SMP_SPINWAIT, - 
CPUSL_TENUSEC (RO) , (SP) 
MULL  CPU$L_UBDELAY (RO), (SP) 
30018$: 
BBC #MTX$V_INTERLOCK, G*SMP$GL_CPU_MUTEX, 300208 — 
BBS § #CPUSV_BUGCHK, - 
CPUSL_WORK_REQ(RO) , 30019$ 
SOBGTR (SP) ,30018$ 
JSB G*SMPSTIMEOUT 
BRW 30017$ 
30019$: BUG CHECK CPUEXIT, FATAL 
-WORD “*XFEFF 
-IIF IDN <FATAL>,<FATAL> , .WORD BUG$_CPUEXIT! 4 


30020$: BBSSI #MTX$V_INTERLOCK, G*SMP$GL_CPU_MUTEX, 30017$ 
ADDL #4, SP 
INCB  CPUSB_CPUMTX (RO) 
INCW G“SMPS$GL_CPU_MUTEX 
BBCCI #MTX$V_INTERLOCK, G*SMP$GL_CPU_MUTEX, 30021$ 
30021$: ENBINT 
MIPR (SP) +,S*#PR$_IPL 


629 
630 IP_ACK_WAIT INTBIT=INV_TBS, - 
631 INS1=<MOVL R2,G*SMP$GL_INVALID>, - 
632 ACQUIRE=NO 
BLBC  §§ G“SMPS$GL_FLAGS, 30023$ 
MOVL R2,G*SMP$GL_INVALID 
MOVO ~—- RO, - (SP) 
MFPR S*#PRS_ISP,RO 
BICL2 6*SMP$GL_BASE_MSK, RO 
ASHL § CPUSL_PHY_CPUID (RO), #1, - 
G*SMP$GL_ACK_MASK 
PUSHL R2 
MOVL §_ S*#CPUSV_INV_TBS, R2 
JSB G*SMPSINTALL_ BIT 
POPL  R2 
CLRL -(SP) 
30024$: MULL3 G*SGNSGL_SMP_SPINWAIT, - 
CPUSL_TENUSEC (RO), (SP) 
MULL § CPU$L_UBDELAY (RO), (SP) 
30025$: BICL3 G6*SMPS$GL_ACK_MASK, - 
G*SMP$GL_ACTIVE_CPUS, R1 
BEQL = 30027$ 
BBS #CPUSV_BUGCHK, - 
CPUS$L_WORK_REQ(RO) , 30026$ 
SOBGTR (SP) ,30025$ 
JSB  _G*SMPS$TIMEOUT 
BRW = 30024$ 
30026$: BUG CHECK CPUEXIT, FATAL 
-WORD *XFEFF 
.IIF IDN <FATAL>,<FATAL> , .WORD BUG$_CPUEXIT!4 
30027$: ADDL #4,SP 
MOVQ (SP) +,RO 
300238: 
633 


302 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY. 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 16 
X-72 SMPSINVALID - invalidate a single TB ent 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (€ 


634 
635 
636 
637 
638 
639 
640 
641 
642 
643 
644 
645 


646 
647 
648 
649 
650 
651 
652 
653 
654 
655 
656 
657 
658 
659 
660 
661 


662 
663 
664 


eo Me Ne 


208: 


308: 


40s: 


300288: 


300298: 


300308: 


300318: 


300328: 


MOVL 


POPL 


JSB 


PUSHR 
MOVL 


(SP)+, INVALID IPL Get the stack straight for coroutine call 


request ip interrupts and wait 


-e te Ne 


RO restore register around coroutine 
@ (SP) + 3 return to caller as coroutine to 
7 modify PTE 
#°M<RO,R1, R2> 
INVALID_IPL, - (SP) 3; Place the IPL back on stack for UNLOCK 


set TBACK bit in each CPUs WORKREQ longword 


find_cpu_data RO 7 Get address of CPU data area 
MFPR S“#PRS_ISP,RO 
BICL2 G*SMP$GL_BASE_MSK, RO 
MOVIL CPUSL_PHY CPUID (RO) ,RO - 3 Get current CPU ID 
ASHL RO, #1, RO 3 Convert to bitmask 
BICL3 RO,G*SMPS$GL_ACTIVE_CPUS,R1 ; Clear bit for this CPU 
BEQL 40$ : No other CPUs 
MOVAL G*SMPSGL_CPU_DATA, R2 3; Get address of CPU data base vector 
FFS #0, #32,R1,RO 7; Find next CPU ID 
BEQL 40S ; Finished 
BBCC RO, R1,308 3; Clear this CPU’s mask 
MOVL (R2) [RO], RO 7 Target CPUs data area 
BBSSI #CPUSV_TBACK, - 
CPUSL_WORK_REQ(RO),20$ ; Set work request bit 
BRB 208 
UNLOCK MUTEX=SMP$GL_CPU_MUTEX, -; Unlock CPU bitmasks 
PRESERVE=NO, - ? 
SHARE=YES 7 
MFPR S*#PRS$_IPL,-(SP) 
MTPR #31,S°#PR$_IPL 
MFPR S*#PR$_ISP, RO 
BICL2 G*SMPS$GL_BASE_MSK, RO 
CLRL - (SP) 
MULL3 G*SGN$GL_SMP_SPINWAIT, - 
CPUSL_TENUSEC (RO), (SP) 
MULL CPUSL_UBDELAY (RO), (SP) 
BBC #MTX$V_INTERLOCK, G*SMP$GL_CPU_MUTEX, 30031$ 
BBS #CPUS$V_BUGCHK, - 
CPUSL_WORK_REQ(RO) , 30030$ 
SOBGTR (SP) ,30029$ 
JSB G*SMPSTIMEOUT 
BRW 30028$ 
BUG CHECK CPUEXIT, FATAL 
- WORD “XFEFF 
-IIF IDN <FATAL>,<FATAL> , .WORD BUG$_CPUEXIT!4 
BBSSI #MTX$V_INTERLOCK, G*SMP$GL_CPU_MUTEX, 30028$ 
ADDL #4, SP 
DECB CPUSB_CPUMTX (RO) 
DECW G*SMPS$GL_CPU_MUTEX 
BBCCI #MTX$V_INTERLOCK, G*SMP$GL_CPU_MUTEX, 30032$ 
MTPR (SP) +,S*#PRS$_IPL 
UNLOCK LOCKNAME=INVALIDATE, - 


PRESERVE=NO, - 


DIGITAL INTERNAL USE ONLY 303 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 17 
X-72 SMPSINVALID ~ invalidate a single TB ent 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (€ 


665 NEWIPL= (SP) + 
BLBC G*SMP$GL_FLAGS, 30035$ 
MOVZBL S“#SPLS$C_INVALIDATE, RO 
JSB G*SMP SRELEASE 


30035$: 
MTPR (SP)+,S*#PR$_IPL 

666 
667 POPR #“M<RO, R1,R2> ? Restore registers 
668 
669 RSB 
670 
671 -DSABL LSB 


304 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 18 
X-72 SMPSTIMEOUT - SMP timeout processing rou 19-APR-1989 15:24:09 [(SYS.SRC]SMPROUT.MAR;1 (7 


673 
674 
675 
676 
677 
678 
679 
680 
681 
682 
683 
684 
685 
686 
687 
688 
689 
690 


691 
692 
693 
694 
695 
696 
697 
698 
699 
700 
701 


702 


Se Se Te Se Ne Ye Ne Me Me Ne Ne Ne Ye Ye Ne 


-SBTTL SMPS$TIMEOUT - SMP timeout processing routine 


co 
+ 


FUNCTIONAL DESCRIPTION: 


This routine is called when a timeout is believed necessary. All 
possible conditions that can account for a timeout are checked - 
such as timeouts disabled. If there is a good reason that the timeout 
can continue, then we will proceed else bugcheck. 


INPUTS : 
NONE. 


OUTPUTS: 
Return if we may continue, else bugcheck. 


UNIVERSAL_SYMBOL SMPSTIMEOUT 
SMPSTIMEOUT: : 
3: SMPSTIMEOUT: : 


PUSHL RO 

JSB G*SMPSCONTROLP_CPUS 7 get halted CPU bitmask 
TSTL RO 7 are any CPUs halted? 
BNEQ 10$ 7 yes 

BBC #EXESV_ NOSPINWAIT, - 


g*EXE$GL_TIME CONTROL, 100$ 


1 Bugcheck if timeouts not disabled 
108: MOVL (SP) +,R0 


=e 


RSB 
1008S: BUG_CHECK CPUSPINWAIT, FATAL 
» WORD “XFEFF 
-IIF IDN <FATAL>,<FATAL> , .WORD BUG$_CPUSPINWAIT! 4 


DIGITAL INTERNAL USE ONLY 305 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 19 
X-72 INIT SANITY - Initialize SMP sanity time 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (€ 


704 
705 
706 
707 
708 
709 
710 
711 
712 
713 
714 
715 
716 
717 
718 
719 
720 
721 
722 
723 
724 
725 
726 
727 
728 
729 
730 
731 
732 
733 
734 
735 
736 
737 
738 
739 
740 
741 
742 
743 
744 
745 
746 
747 
748 


749 
750 
751 
752 
753 
754 
755 
756 
757 
758 
759 


-SBTTL INIT SANITY - Initialize SMP sanity timer pointer in CPU database 


+ 
+ 


SMPSINIT_ SANITY ~ Initialize SMP sanity timer pointer in CPU database 
This subroutine is used to find the active CPU with the next lowest 
CPU ID, and adjust its sanity timer pointer relative to that of 
a CPU joining the active set. 

Calling sequence: 
JSB/BSBx SMPSINIT_SANITY 

Inputs: 


R2 = Address of the CPU database of the CPU joining the 
active set. 


Implicit Inputs: 
Active set and assocaited CPU databases. 


It is assumed that, since the calling thread is modifying the 
active set, the CPU mutex is held by the caller. 


Outputs: 


CPUSW_SANITY_ TIMER and CPUSW_SANITY_TICKS are initialized for this 
CPU. 


CPUSL_TPOINTER of the active CPU with the next lowest CPU id 
is copied to the joining CPU’s TPOINTER, and the active CPU's 
TPOINTER set to point to the CPUSW_SANITY_TIMER of the joining 
CPU. 


me Ve Ye Vo Ye Ye We a Be We We We Be Yo Ye Ve Ze Yeo Ye Ve Ve Se We Ve Yeo Be Te Ye Yeo Yeo Ne Ve 


Implicit Ouputs: 
None 
Side Effects: 


None. 


me Ve Ve Ye Vo Be Ye Ye Ye We 


UNIVERSAL_SYMBOL SMP$INIT_SANITY 
SMP$INIT_ SANITY: : 
;SMPSINIT SANITY:: 

PUSHR #*M<R3,R4,R5,R6> 


initialize this CPUs sanity timer and tick count 


me Ne Ve 


MOVW = g*SGNSGW_SMP_SANITY_CNT, - 
CPUSW_SANITY_TIMER (R2) 

MOVW  §g*SGNSGW_SMP_TICK_CNT, - 
CPU$W_SANITY_TICKS (R2) 


=e 


306 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION | 


SMPROUT - SMP routines for vMs 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 20 
X-72 INIT SANITY - Initialize SMP sanity time 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (€ 


760 
761 
762 


763 
764 
765 
7166 
767 
768 
769 
770 
771 
772 
773 
774 
775 
776 
177 
778 
779 
780 
781 
7182 
783 
784 
785 
786 
787 
788 
789 
790 
791 
792 
793 
794 
795 
796 
797 
798 
7199 


we Ne te 


CPU. 


Se Ye Veo Ye Ve 


MOVL 
MNEGL 
ROTL 
BICL 
10S: FFS 
BEQL 
ADDL 
BICL 
MOVAL 
MOVL 
MOVL 


u 
BO 
ee 


MOVAW 


=e Me fe 


7 


ROTL 
BITL 
BEQL 
158: POPR 
RSB 


208: 


timer. 


we Se te Ne 


MOVAW 


BRB 


CPUSL_PHY_ CPUID (R2) ,R3 
R3,R4 
R4,g*SMP$GL_ACTIVE_CPUS,R4 
#1,R4 

#0, #32,R4,R5 

20$ 

R3,R5 

#*C<31>,R5 
g*SMP$GL_CPU_DATA, R6 
(R6) [R5],R6 
CPUSL_TPOINTER(R6) , - 
CPUSL_TPOINTER (R2) 
CPUSW_SANITY_TIMER (R2) , - 
CPUSL_TPOINTER (R6) 


R3, #1,R4 
R4,g*SMP$GL_ACTIVE_CPUS 
5$ 

#°M<R3,R4,R5, R6> 


CPUSW_SANITY_TIMER (R2) ,- 
CPUSL_TPOINTER (R2) 
15$ 


™e Se Ye “We Ve “Ne Ne Vo 


=e 


e 
‘ 


e 
e 


The TPOINTER of each active CPU points to the sanity timer of the active 
CPU with the next highest CPU ID. When a CPU joins the active set, it must 
find the CPU with the next lower CPU ID; that CPU’s TPOINTER will be point- 


ing to the joining CPUs higher neighbor. The joining CPU will copy the 
low neighbor’s TPOINTER to its own (i.e., point itself to its high neighbor), 
and point ithe low neighbor’s TPOINTER to the sanity timer of the joining 


rotate our bit into low position 
mask off our bit 
scan for next active CPU 
no other 
found CPU id is (bit position 
+ abs(shift count)) MOD 32 
CPU database vector address 
CPU database address of neighbor 


adopt the CPU neighbor was watchin 


point neighbors TPOINTER at us 


it is possible that our neighbor left the active set while the above 
code ran. Verify that it is still present before returning. 


form bitmask 


there is no active CPU but this one. point our TPOINTER at out SANITY 


DIGITAL INTERNAL USE ONLY 307 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 21 
X-72 SMPS$SHUTDOWN_CPU - Final actions associa 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (S 


801 
802 
803 
804 
805 
806 
807 
808 
809 
810 
811 
812 
813 
614 
815 
816 
817 
818 
819 
820 
821 
822 
823 
824 
825 
826 
827 
828 
829 
830 
831 
832 
833 
834 
835 
836 
837 
838 
839 
840 
841 
842 
843 
844 
845 
846 


847 
848 


849 
850 
851 
852 
853 


me Ne Te Te Ye Te Te Ye Ve Ye Te Ve Yo TS Ye Yo Ye Ve Te Te Ye Yo Ve Ye Ye Ye Ye Ye “Ne “Yo “No Se Ye Ne we 


Ee 
a 


i?) =e Ye Ve 


s 


se te Ne 


-SBTTL SMP$SHUTDOWN CPU - Final actions associated with stopping a CPU. 


+ 
+ 


FUNCTIONAL DESCRIPTION: 


This routine provides the kernel mode CPU specific functions 
required to implement the $STOP/CPU DCL command. 


CALLING SEQUENCE: 
BSB/JSB SMP$SHUTDOWN_CPU 
INPUTS : 


R1 = CPU ID to be stopped 

R2 = 0 -> verify that CPU should be stopped before stopping 
<> 0 -> skip checks before stopping (OVERRIDE CHECKS mode) 

R4 = process PCB address 


IMPLICIT INPUTS: 


Scheduling/affinity databases 
SMP configuration/membership database 


OUTPUTS: 
RO : LBS -> CPU stopped 
LBC -> CPU not stopped (checks failed) 
R1,R2 destroyed 
IMPLICIT OUTPUTS: 


CPU stopped if appropriate checks passed. 
Process returned to appropriate COM queue 


“x0D 
“XOA 


Carriage Return character 
Line Feed character 


a 
se Se 


Define some messages that may be issued when other CPUs begin executing. 


TOP_DONE: 
-ASCIC <CR><LF>\%SMP-I-STOPPED, CPU #\ 


TOP_DONE2: 
-ASCIC \ has been stopped.\ 


The following translation table is used in converting binary data into 
their equivalent ASCII strings. 


308 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP. routines for VMS 10-MAY-1989 16:58:12: VAX MACRO V5.0-8 Page 22 
X-72 SMPS$SHUTDOWN CPU - Final actions associa 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (S 


854 ; 

855 CH TABLE: 

856 -ASCII /00/ 
857 -ASCII /01/ * 
858 -ASCII /02/ 
859 -ASCII /03/ 
860 eASCII /04/ 
861 -ASCII /05/ 
862 -ASCII /06/ 
863 eASCII /07/ 
864 -ASCII /08/ 
865 -ASCII /09/ 
866 eASCII /10/ 
867 -ASCII /11/ 
868 eASCII /12/ 
869 -ASCII /13/ 
870 -ASCII /14/ 
871 eASCII /15/ 
872 eASCII /16/ 
873 eASCII. /17/ 
874 -ASCII /18/ 
875 -ASCII /19/ 
876 -ASCII /20/ 
877 -ASCII /21/ 
878 -ASCII /22/ 
879 -ASCII /23/ 
880 eASCII /24/ 
881 -ASCII /25/ 
882 ASCII /26/ 
883 -ASCII /27/ 
884 eASCII /28/ 
885 -ASCII /29/ 
886 -ASCII /30/ 
887 eASCII /31/ 
88s . 
889 UNIVERSAL_SYMBOL SMP$SHUTDOWN_CPU 


SMP$SHUTDOWN_CPU:: 
890 ;SMPSSHUTDOWN CPU:: 


891 SAVIPL -(SP) 
MFPR S*#PRS$_IPL, ~ (SP) 
892 PUSHL R1 # save register 
893 PUSHL R2 7 save register 
894 MOVL G*SMPSGL_CPU_DATA[R1] , R2 
895 JSB g*SMPSSTOP_CPU ? perform CPU-specific actions 
896 
897 SMPS$STOP_CPU may have placed the CPU in STOPPED state. Check for that 


we Ye Ye Ve Vo 


898 case before continuing. The STOP/CPU code should have weeded out all 
899 other invalid transitions. 

900 

901 CMPB CPUSB_STATE (R2) , #CPU$C_STOPPED 

902 BNEQ 30$ 


903 158: MOVL #SS$_ NORMAL, RO 
904 208: ADDL #8, SP 


905 BRW 3408 
906 3; 
907 a CPU must either be in (RUN state and active set) or BOOT REJECTED state 


=e Ne 


908 


DIGITAL INTERNAL USE ONLY. 309 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT ~ SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 23 
X-72 SMP$SHUTDOWN CPU ~- Final actions associa 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (¢ 


909 308: CMPB CPUSB_STATE (R2) , - 


910 #CPUSC_BOOT REJECTED ¢ boot rejected? 
911 BNEQ 32$ 7 no 
912 MOVB #CPUS$C_STOPPED, - 7; reset state 
913 CPUSB_ STATE (R2) 
914 BRB 15$ ; return to caller 
915 3258: CMPB CPUSB_STATE (R2) , #CPU$C_RUN 7; run state? 
916 BNEQ 35$ 7 no, error 
917 BBS CPUSL_PHY_CPUID (R2) ,- 7 allow stop if also 
918 G*SMPSGL_. ACTIVE CPUS, - ; din active set. 
919 40§ 
920 358: MOVL #SS$_DEVOFFLINE, RO 
921 BRB 20$ 
922 MOVB #CPUSC_STOPPING, - 
923 CPUSB_STATE (R2) ? note stop in progress 
924 ; 
925 ; set affinity to CPU to be stopped 
926 ; 
927 408: CLRL ~ (SP) 7 no return data 
928 PUSHL #CPBSM_FLAG CHECK CPU 3 make sure we can run 
929 PUSHL CPUSL | PHY "_CPUID (R2) 7 CPU ID 
930 PUSHL #CPBSM | EXPLICIT AFFINITY 
931 PUSHL R4 7 PCB 
932 CALLS #5,G“*SCHSREQUIRE CAPABILITY 
933 BLBC RO, 20$ 3; failed 
934 ; 
935 ; prevent other processes from running on this CPU 
936 ; 
937 SETIPL #IPL$_RESCHED, ENVIRON=UNIPROCESSOR 
MTPR #IPL$ RESCHED, S*#PR$_IPL 
938 ; 
939 ; clear affinity of this process for this CPU 
940 ; 
941 CLRQ - (SP) 7 no return data or flags 
942 PUSHL CPUSL_PHY_CPUID(R2) 3; CPU ID 
943 PUSHL #CPBSM | EXPLICIT AFFINITY 
944 PUSHL R4 3 PCB 
945 CALLS #5,G*SCHSRELEASE CAPABILITY 
946 BLBC RO, 20$ 
947 ; 
948 ; Acquire the scheduling spinlock . 
949 ; Test to see if checks have been overriden. If not, check that this CPU is 
950 ; not the last one providing a capability 
951 ; which is currently in use, and that there is no process with hard affinity 
952 ; for this CPU. Note that it is sufficient to lock SCHED (and not necessary 
953 ; to hold the CPU mutex) during these checks as SCHED is acquired before 
954 ; the affinity database is modified. 
955 ; 
956 LOCK LOCKNAME=SCHED, - 
957 PRESERVE=NO 3; freeze affinities 


BLBC G“SMPSGL_FLAGS, 30040$ 
MOVZBL S“#SPL$C_SCHED, RO 
JSB G*SMP SACQUIRE 
BRB 30041$ 
300408: 
MTPR S“*#IPL$_ SCHED, S“#PR$_IPL 
300418: 


310 DIGITAL INTERNAL USE ONLY 


SMPROUT - SMP routines for VMS 10-MAY-1989 16: 


X-72 SMPSSHUTDOWN_CPU - Final actions associa 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


58:12 VAX MACRO V5.0-8 Page 24 
19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (S 


release SCHED so other CPUs can schedule 


join the 


release SCHED so other CPUs can schedule 


958 TSTL (SP)+ 7 test for OVERRIDE CHECKS 
959 BNEQ 110$ ; OVERRIDE CHECKS enabled, skip checks 
960 TSTW CPUSW_HARDAFF (R2) # anyone with hard affinity? 
961 BEQL 110$ # no, go ahead 
962 
963 100S$: UNLOCK LOCKNAME=SCHED, - ; 
964 PRESERVE=NO 3 Don’t preserve RO 
BLBC G*SMP$GL_ FLAGS, 30046$ 
MOVZBL S*#SPLSC_SCHED, RO 
JSB G*SMP SRELEASE 
300468: 
965 CLRL RO # return bad status 
966 ADDL #4, SP 3; clear stack 
967 BRW 340$ 7 branch assist 
968 ; 
969 ; Now we know that there is no process which will be left unable 
970 ; to be scheduled if we remove this CPU, or that we have overriden 
971 ; checks for such cases. Output a console message,go to IPL 31, 
972 ; override set, remove the CPU from the active set and the capability 
973 ; database, place the process back in the appropriate COM queue, release 
974 ; SCHED, *LEAVE* the override set, and loop forever. 
973 3 ; 
976 1108: CLRL ~ (SP) 3; no returned data 
977 MCOML #0,-(SP) ¢ all capabilities 
978 PUSHL CPUSL_PHY_CPUID (R2) 7 CPU ID 
979 CALLS #3,G*SCHSREMOVE CPU_CAP 
980 
981 1275S: POPL R1 7 Clean up stack 
982 MOVPSL <-(SP) 7 Come back to this IPL 
983 PUSHAL 350$ 7 Resume here 
984 ; 
985 ; now make this process available for scheduling onto other CPUs 
986 ; 
987 JSB G*SCHS$CUR_TO_COM 
988 UNLOCK LOCKNAME=SCHED ; 
BLBC -G“SMPS$GL_ FLAGS, 30051$ 
PUSHL RO 
MOVZBL S*#SPLS$C_SCHED, RO 
JSB G*SMP SRELEASE 
POPL RO 
300518: 
989 
990 PUSHAB STOP _DONE2 7; Get secondary message address 
991 PUSHAB STOP _DONE 7 Get primary message address 
992 FIND_CPU_DATA R6 
MFPR S“#PR$_ISP, R6 
BICL2 G*SMP$GL_BASE_MSK, R6 
993 BSBW MESSAGE 
994 ADDL #8,SP 7 pop parameters 
995 SETIPL #IPL$ POWER, ENVIRON=UNIPROCESSOR 
MTPR #IPLS POWER, S*#PR$_IPL 
996 BBSSI R1,G*SMP$GL_ OVERRIDE, 140$ ; join override 
997 1408S: BBCCI R1, G*SMPSGL_ACTIVE_ CPUS, 150$ 3; leave active 
998 1508S: LOCK MUTEX=SMPSGL_CPU_MUTEX, - 
999 PRESERVE=NO 
MFPR S*#PR$_ IPL, -(SP) 
MTPR #31,S*°#PRS$_IPL 


DIGITAL INTERNAL USE ONLY 311 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 25 
X-72 SMPS$SHUTDOWN_CPU - Final actions associa 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (S 


MFPR § S*#PRS$_ISP,RO 
BICL2 G*SMP$GL_BASE_MSK, RO 
CLRL -(SP) 
30054$: 
MULL3 G“SGNSGL_SMP_SPINWAIT, - 
CPUS$L_TENUSEC (RO) , (SP) 
MULL  CPUS$L_UBDELAY (RO), (SP) 
30055$: 


CMPW G*SMPSGL_CPU_MUTEX, #-1 
BEQL 30057$ 


BUGS_CPUEXIT!4 


R2 is the cpu dbase pointer 


rotate my bit into least sig. posn 
mask off least aig. posn. 

find next higher active cpu 

not possible, since atleast one more sho 


take mod 32, R5 has the id 


STOPPED 


BBS #CPUSV_BUGCHK, - 
CPUS$L_WORK_REQ (RO) , 30056$ 
SOBGTR (SP) ,30055$ 
JSB G*“SMP STIMEOUT 
BRW 30054$ 
30056$: BUG_CHECK CPUEXIT, FATAL 
- WORD “XFEFF 
-IIF IDN <FATAL>,<FATAL> , .WORD 
30057$: BBSSI #MTX$V_INTERLOCK, G*SMP$GL_CPU_MUTEX, 30054§$ 
CMPW G*SMPSGL_CPU_MUTEX, #-1 
BEQL 30059$ - : 
BBCCI #MTX$V_INTERLOCK, G*SMP$GL_CPU_MUTEX, 30058$ 
30058$: BRB 30054$ 
300598: 
ADDL #4, SP 
1000 ; 
1001 ; Delete from sanity timer linked list 
1002 ; 
1003 165$: MOVL G*SMPS$GL_CPU_DATA[R1) ,R2 ; 
1004 MOVL CPUSL_PHY_CPUID (R2) ,R3 7 CPU id, 
1005 MNEGL R3,R4 
1006 ROTL R4,g°SMP$GL_ACTIVE_CPUS,R4 ; 
1007 BICL #1,R4 ; 
1008 1668: FFS #0, #32, R4,R5 ? 
1009 BEQL 170$ ; 
1010 ADDL R3,R5 # get my neighbours’ id 
1011 BICL #°C<31>,R5 F 
1012 MOVL G“SMPS$GL_CPU_DATA[R5],R6 ; cpu dbase address 
1013 MOVL CPUSL_TPOINTER(R2) ,- 
1014 CPUSL_TPOINTER (R6) : give him my pointer 
1015 ; 
1016 ; 
1017 ; 
1018 170$: UNLOCK MUTEX=SMP$GL_CPU_MUTEX, - 
1019 PRESERVE=NO 
BBCCI #MTX$V_INTERLOCK, G*SMP$GL_CPU_MUTEX, 30060$ 
300608 : 
BLBC G*EXES$GL_NS_FLAGS, 30069$ 
MFPR #°X92,-4 (SP) 
30069$: 
MTPR #0,S*°#PRS$_TBIA 
MTPR (SP)+,S*#PRS$_IPL 
1020 MOVB #CPUSC_STOPPED, CPUSB_STATE(R2) ; indicate 
1021 BBCCI R1,G*SMPS$GL_OVERRIDE,320$ ; leave override 
1022 3208: 
1023 ; 
1024 ; Perform CPU-specific shutdown of CPU 


312 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPRCUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 26 
X¥-72 SMP*SHUTDOWN_CPU - Final actions associa 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (¢ 


1025 ; 
1026 JSB G*SMPSHALT_CPU 3 perform CPU-specific halt 
1027 
1028 ; 
1029 ; Drop IPL and return error status in RO 
1030 ; 
1031 3408: ENBINT 
MTPR (SP) +, S*#PRS$_IPL 
1032 RSB 
1033 ; 
1034 3508: MOVL #SS$_NORMAL, RO 
1035 BRB 340$ 


DIGITAL INTERNAL USE ONLY 313 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION | 


SMPROUT ~- SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 27 
X-72 SMPSINITIATE_BENIGN - Initiate a benign 19-APR-1989 15:24:09 [SYS.SRC] SMPROUT.MAR;1 (1¢ 


1037 -SBTTL SMPSINITIATE_BENIGN - Initiate a benign state 
1038 3++ 

1039 ; FUNTIONAL DESCRIPTION: 

1040 ; 

1041 ; SMPSINITIATE_BENIGN - Request a benign state 
1042 ; SMPSTERMINATE_BENIGN - Leave a benign state 
1043 ; 

1044 ; ENVIRONMENT: 

1045 ; 

1046 ; Kernel mode, mapping must be enabled 
1047 ; 

1048 ; CALLING SEQUENCE: 

1049 ; 

1050 ; JSB G*SMPSINITIATE_BENIGN 

1051 ; JSB G“SMPSTERMINATE_BENIGN 

1052 ; 

1053 ; INPUT PARAMETERS: 

1054 ; 

1055 ; None 

1056 ; 

1057 ; OUTPUT PARAMETERS: 

1058 ; 

1059 ; None 

1060 ; 

1061 ;-- 

1062 

1063 UNIVERSAL_SYMBOL SMPSINITIATE_BENIGN 


SMPSINITIATE_BENIGN: : 
1064 ;SMPSINITIATE_BENIGN:: 


1065 LOCK LOCKNAME=MEGA + Serialize access to benign state 
BLBC G“SMPS$GL_FLAGS, 30072$ 
PUSHL RO 


MOVZBL S*#SPLS$C_MEGA, RO 
JSB G*SMP SACQUIRE 


POPL RO 
BRB 30073$ 
300728: 
MTPR $ S*#IPL$_MEGA, S*#PR$_IPL 
300738: 
1066 BBSSI #SMPS$V_BENIGN, G*SMP$GL_FLAGS,20$ ; Enter a benign state 
1067 20S: IPINT ALL INV_TBA + Request all other CPUs to follow 
PUSHL R2 
MOVL S*#CPUSV_INV_TBA, R2 
JSB G“SMPS$INTALL_BIT_ACQ 
POPL R2 
1068 RSB 
1069 
1070 UNIVERSAL_SYMBOL SMP$TERMINATE_BENIGN 


SMPS$TERMINATE_BENIGN: : 
1071 ;SMPS$TERMINATE BENIGN: : 


1072 BBCCI #SMPS$V_BENIGN, G*SMPS$GL_FLAGS,20$ ; Leave benign state 
1073 208: UNLOCK LOCKNAME=MEGA 3 Restore blocked threads 
BLBC G*SMPS$GL_FLAGS, 30078$ 
PUSHL RO 


MOVZBL S*#SPLSC_MEGA, RO 
JSB G“SMP SRELEASE 
POPL RO 


314 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP. routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 28 
X~72 SMPS$INITIATE_BENIGN - Initiate a benign 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1C 


300788: 
1074 RSB 


DIGITAL INTERNAL USE ONLY 315 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 29 
X-72 SMPS$SETUP_PFORK -- setup for fork to pri 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1 


1076 
1077 
1078 
1079 
1080 
1081 
1082 
1083 
1084 
1085 
1086 
1087 
1088 
1089 
1090 
1091 
1092 
1093 
1094 
1095 
1096 
1097 
1098 
1099 
1100 
1101 
1102 
1103 
1104 
1105 
1106 
1107 
1108 
1109 
1110 
1111 
1112 
1113 
1114 
1115 
1116 
1117 
1118 
1119 
1120 
1121 


1122 
1123 
1124 
1125 


ve 


Se Ye Ne Ve Ve Ye To Ve 


owe Me Ne Ne Se Se Ne Se Ne Se Ye Ne Se Se Se Se Se Se Se Se Ne Se Se Ne Se Ne Se Ne Se Se Ne Ne 


3 


-SBTTL SMPS$SETUP_PFORK -- setup for fork to primary 
+ 


These routines provide a mechanism to guarantee that a piece of 
code executes on the primary CPU at fork IPL. It was designed for 
use by high-IPL threads which need to write data to the console 
subsystem during steady-state operation, but there is nothing in- 
herent in the design which limits it to such a use. 


SMPS$SETUP_PFORK - set up for fork to primary 


The routine functions as follows: it is entered with a JSB, and 
takes 2 parameters, the number of bytes of 

data which the user wishes to pass to the fork process, and the 
fork lock index or FIPL of the fork process. 


A block of the appropriate size is allocated from a private pool 
(preallocated during INIT) FKBSW_SIZE, FKBS$B_TYPE, and FKBSB_FLCK 

are filled in, and R5 set to point to the user data area in the packet. 
On return to the user, the low bit of RO indicates whether 

er not a block was successfully allocated; if so, R5 points to the 
block. 


INPUTS : 


R3 = length of data (bytes) 
R4 = FLCK index or FIPL 


OUTPUTS: 


RO LBS: block successfully allocated. 
R5 = address of user data area within block 


RO LBC: no block of sufficient size available 
R5 = 0 


All registers preserved. 


No block of the required size could be found. return 0 in RO,r5. 


OBLOCK : 
UNLOCK LOCKNAME=EMB, - ?Unlock buffer pool database 
NEWIPL= (SP) +, - 
CONDITION=RESTORE 3 Restore IPL 
BLBC G“*SMPSGL_FLAGS, 30083$ 
PUSHL RO 
MOVZBL S*#SPLSC_EMB, RO 
JSB G*SMP SRESTORE 
POPL RO 
00838: 
MTPR (SP) +,S*#PRS_IPL 
MOVQ (SP)+,R1 
CLRL RO sInidcate failure 
CLRL R5 sIndicate failure 
RSB 


316 DIGITAL INTFRNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 30 
X-72 SMPSSETUP_PFORK -- setup for fork to pri 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1 


1126 
1127 


1128 
1129 
1130 
1131 
1132 
1133 
1134 
1135 
1136 
1137 
1138 


1139 
1140 
1141 
1142 
1143 
1144 
1145 
1146 
1147 
1148 
1149 
1150 
1151 
1152 
1153 
1154 


1155 
1156 
1157 
1158 
1159 
1160 
1161 
1162 
1163 


30088$: 
30089$: 


108: 


158: 


208: 


300948: 


UNIVERSAL_SYMBOL SMP$SETUP_PFORK 
SMP$SETUP_PFORK: : 
;SMP$SETUP_PFORK: : 


MOVQ 
ADDL3 
ADDL 
ADDL 
BICL 
MOVAB 


LOCK 


MFPR 
BLBC 

MOVZBL 

JSB 
BRB 


BLBC 
MOVZBL 
JSB 


MTPR 


R1,-(SP) 
#FKB$C_LENGTH, R3,R1 
#4,R1 
S*#EXE$C_ALCGRNMSK, R1 
S*#EXE$C_ALCGRNMSK, Ri 
G*SMP$GI._PFORK_POOL, - 
R2 | 
LOCKNAME=EMB, - 
SAVIPL=-(SP),- 
PRESERVE=NO 
S*#PR$_IPL,- (SP) 
G*SMP$GL_FLAGS, 30088$ 
S*#SPLS$C_EMB, RO 

G*SMP SACQUIRE 

30089$ 


MTPR 


R2,R5 
R5, RO 

(RO), R5 

NOBLOCK 

R1, 4(R5) 

10$ 

20$ 

RS,R1,R2 

(R5)+, (R2)+ 

R1, (R5), (R2) 
~(R2),-(R5) 

(R5), (RO) 
LOCKNAME=EMB, - 
PRESERVE=NO, - 
NEWIPL= (SP) +,- 

CONDI TION=RESTORE 
G*SMPS$GL_FLAGS, 30094$ 
S*#SPLSC_EMB, RO 

G*SMP SRESTORE 


(SP)+,S*#PR$_IPL 
R1, FKB$W_SIZE (RS) 
FKB$B_TYPE (R5) 

R4,FKB$B_FLCK (R5) 


<FKBS$C_LENGTH+4>(R5) ,- 


R5 
(SP)+,R1 
s“#1,R0 


zInclude FKB overhead 

7 plus extra LW for real FPC 
7Round size up to next boundry 
7Round size back to next boundry 


7Get address of buffer pool listhead 
zLock buffer pool database 

3Save current IPL 

7Don’t preserve RO 


S*#IPL$_EMB, S*#PR$_IPL 


7;Copy address of first free block address 
7Save address of previous free block 
3Get address of next free block 

7If eql no memory available 

7Free block big enough? 

7If gtru no 

7If eql free block is exact size 
7;Calculate address of new free block 
7;Copy link to next free block 
;Calculate size of new free block 
3;Set link to new free block 

7;Copy link to new free block 

;Unlock buffer pool database 


3; Restore IPL 


?7Size into 3rd lw 
3;Record FLCK 
7;Set adr of iuser buffer in block 


3; indicate success 


DIGITAL INTERNAL USE ONLY 317 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 31 
X-72 SMPSFORK_TO PRIMARY- migrate work packet 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1 


1165 
1166 
1167 
1168 
1169 
1170 
1171 
1172 
1173 
1174 
1175 
1176 
1177 
1178 
1179 
1180 
1181 
1182 
1183 
1184 
1185 
1186 
1187 
1188 
1189 
1190 
1191 
1192 
1193 
1194 
1195 
1196 
1197 
1198 
1199 


1200 
1201 
1202 
1203 
1204 
1205 
1206 
1207 
1208 
1209 


1210 
1211 
1212 
1213 
1214 
1215 
1216 
1217 
1218 


Gwe me Se Ye Ne Ye Veo Se Ve Se Ye Ve Ve Be Ve Be Be Yeo Yo Ye We Ve Ye Ve Woe We We Ye Yo Be Ve 


-SBTTL SMPSFORK_TO PRIMARY- migrate work packet to primary CPU 
SMPSFORK_TO PRIMARY- migrate work packet to primary CPU 


This routine is called after calling SMPS$SETUP_PFORK to allocate and 
initialize a packet, and after moving any caller-dependent data into the 
packet. 


The call to the user’s fork routine should be assumed to be asynchronous 
to the final RSB from SMP$FORK_TO PRIMARY (although it may not be). The 
user’s fork process will be called back on the primary CPU at the 
specified fork IPL AS IF it were called from the fork dispatcher 

(NB: actual dispatch mechanism will vary based on the caller’s original 
IPL and CPU). In particular, the specified fork lock will be held, RO-R2 
will be scratch, and R3 and R4 will contain whatever they did on enrty to 
SMPS$FORK_TO_ PRIMARY. The one difference is that R5 will point to the user 
data area within the packet, not to the beginning of the packet. 


When complete, the user’s fork process should RSB. The packet will then be 
be deallocated. 
INPUTS: 
RS = address of user buffer area in packet allocated and initial- 
ized by SMPSSETUP_PFORK. 
O(SP) = User’s FPC 
4(SP) + address of caller’s caller (i.e., return address 


for SMPS$FORK_TO_ PRIMARY 


OUTPUT: Fork process created and queued to primary. 
R5 destroyed. 


SER_FPC = 12 3 stack offset of user’s FPC 


UNIVERSAL SYMBOL SMP$FORK_TO_ PRIMARY 


SMP$FORK_TO_ PRIMARY: : 


° 
’ 


=e Se Se Ve 


GU) Se Ne Ne 


SMPSFORK_TO_ PRIMARY: : 
MOVQ RO, - (SP) 
MOVL R2,-~(SP) 
SUBL #<FKBSC_LENGTH+4>,R5 | ; back off pointer to start of packet 


the first divergence is based on whether the request is being made from 
the primary CPU. Make that determination. 


FIND CPU DATA RO 7 get this CPUs DB addr 
MFPR § S*#PR$_ISP,RO 

BICL2 G*SMP$GL_BASE_MSK, RO 

CMPL § CPUSL_PHY CPUID(RO),- 


g*SMP$GL_PRIMID compare to primary 


? 
BEQL 35$ ? primary 
BRW 200$ 7 branch if secondary 
primary -- the next divergence is based on IPL and whether we must fork 
5$: MOVZBL FKBS$B_FLCK(RS),R1 7GET FORK lock/FIPL 


318 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 32 
X-72 SMPS$FORK_TO PRIMARY- migrats work packet 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1 


? The following test of spinlock index VS. IPL is checked by an 
? ASSUME done in LDAT. Spinlock indices are in the range 20 to 3F (hex). 


1219 
1220 
1221 
1222 
1223 
1224 


1225 
1226 
1227 
1228 
1229 
1230 
1231 
1232 
1233 
1234 
1235 
1236 


1237 
1238 
1239 
1240 
1241 
1242 
1243 
1244 
1245 
1246 


1247 
1248 
1249 
1250 
1251 
1252 
1253 
1254 
1255 
1256 
1257 


BBC #5,R1,408$ 7;Br if direct IPL 
MOVL G*SMPSAL _IPLVEC(R1],R1 ;Get FORK IPL from spinlock database 
408: SAVIPL RO y and current IPL 
MFPR S*#PR$_IPL, RO 
CMPL RO,R1 + compare current to FIPL 
BGTR 100$ ? BR if too high 
primary, at or below FIPL -- emulate fork dispatcher. registers 


available to fork process are RO,R1,R2. 


Fork lock is held. 


se Ne Se Se Ne Ye 


FORKLOCK LOCK=FKBSB_FLCK(R5) , ~ 


v 
FIPL=YES, - ; 
SAVIPL=- (SP) ,- ; 
PRESERVE=NO ? 
MFPR S*#PR$_IPL,-(SP) 
MOVZBL FKB$B_FLCK (R5) , RO 
BBC #5,RO,30097$ 
BLBC G*SMP$GL_FLAGS, 30098$ 
JSB G*SMP SACQUIRE 
BRB 30099$ 
30097$: : 
MTPR RO,S*#PR$_IPL 
BRB 30099$ 
30098S: : 
MTPR G*SMPSAL IPLVEC[RO], 
300998: ~ 
ADDL #<FKBSC_LENGTH+4>, R5 ; 
JSB @<USER_FPC+4>(SP) ; 
SUBL #<FKBS$C_LENGTH+4>, R5 : 


R5 assumed to still point to block 


we Ne Ne 


FORKUNLOCK LOCK=FKBSB_FLCK(RS) , - 
NEWIPL= (SP) +, - 
PRESERVE=NO 


BLBC G“SMP$GL_FLAGS, 30100$ 
MOVZBL FKBSB_FLCK(R5) , RO 
JSB G“SMP SRELEASE 
301008: 
MTPR (SP)+,S*#PRS$_IPL 
BSBW DEALLOCATE 
90S: MOVL (SP)+,R2 
MOVQ = (SP)+,R0 
ADDL - #4,SP ; 
RSB 
7 primary -- IPL requires forking 
1008S: MOVL USER_FPC(SP),- 


R3,R4 have the same contents as at the time of the fork request. 


get fork lock 

check for degenerate case of IPL-only 
save IPL 

don’t save RO 


S*#PR$_IPL 


adjust R5 to point to user data 
eall user’s routine through location 
restore R5 


saved on stack. 


back up over user FPC 


DIGITAL INTERNAL USE ONLY 319 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 33 
X~-72 SMPS$FORK_TO_PRIMARY- migrate work packet 19-APR-1989 15:24:09 (SYS.SRC]SMPROUT.MAR;1 (1 


1258 
1259 
1260 
1261 
1262 
1263 
1264 
1265 
1266 
1267 
1268 
1269 
1270 
1271 
1272 


1273 
1274 
1275 
1276 


1277 
1278 
1279 
1280 
1281 
1282 
1283 
1284 
1285 
1286 
1287 
1288 
1289 
1290 
1291 
1292 
1293 
1294 
1295 
1296 
1297 
1298 
1299 
1300 
1301 
1302 
1303 
1304 


NY se Se Ne 


0 


30 


30 
30 


22 


25 


+ 


me Ne Ye Ye Ye Te Ye Yo Yeo Ne Ve 


| tag 


PUSHAB 
MOVAB 
JMP 


FKBSC_LENGTH(R5); save user's fork address 


90$ 
W“FORK_ DISPATCH, - (SP) 3 fork PC 
G*EXESFORK 7 create fork process 


secondary ~- queue work packet to primary 


0$: MOVAB w*FORK_DISPATCH, - # save fork PC 
FKBSL_FPC(R5) 
MOVL USER_FPC(SP),- 
FKBSC_LENGTH (R5) 3 caller’s REAL FPC 
MOVQ R3, FKBSL_FR3 (R5) 7 save registers 
MOVL G*SMPSGL_PRIMID, RO 
MOVL G*SMPSGL_CPU_DATA[RO],RO ; Get address of CPU database 
SINSQTI (R5),CPUSQ WORK_FQFL(RO),R1 ; Insert work pkt on end of queue 
CLRL R1 
1018: 
INSQTI (R5),CPU$Q_ WORK FOFL(RO) 
Bcc 30102$ 
AOBLSS #900000,R1,30101$ 
- WORD “XFEFF 
-IIF IDN <FATAL>,<FATAL> , .WORD BUG$_BADQHDR ! 4 
102$: 
1038: 
BBSSI #CPUS$V_WORK_FOQP, CPUSL_WORK_REQ(RO),220$ ; Set work request bit 
OS: 
MOVL CPUSL_PHY_CPUID(RO),RO ; Get physical CPU ID 
IPINT CPU 7 Generate IP Interrupt 
JSB G*SMP SINTPROC 
O$: MOVQ (SP)+,R0 
MOVL (SP)+,R2 
ADDL #4, SP 7 back up over user FPC 
RSB 


FORK DISPATCH: 


dispatch the user’s fork routine. 


INPUTS: 


R3 = whatever the caller specified 
R4 = ditto 

R5 = address of FKB 

FKB$C_LENGTH(R5S) = caller’s REAL FPC 
<FKB$C_LENGTH+4>(R5) = user’s data 
Fork lock held 

RO-R2 scratch 


FORK_DISPATCH: 


we Me Ve 


PUSHL 
ADDL 
JSB 
SUBL 
BSBW 
RSB 


DEALLOCATE 


FKBSC_LENGTH (R5) 
#<FKBSC_LENGTH+4>,R5 


push user’s FPC 
point R5 to user’s buffer 


@(SP) + dispatch user’s fork process 
#<FKBSC_LENGTH+4>, R5 point R5 to start of packet 
DEALLOCATE return packet to pool 


me Se Me Ye Yeo Ve 


return to fork dispatcher 


320 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.6-8 Page 34 
X-72 SMPS$FORK_TO PRIMARY- migrate work packet 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1 


1305 
1306 
1307 
1308 
1309 
1310 
1311 
1312 
1313 
1314 
1315 
1316 
1317 
1318 
1319 


1320 
1321 
1322 
1323 
1324 
1325 
1326 
1327 
1328 
1329 
1330 
1331 
1332 
1333 
1334 
1335 
1336 
1337 
1338 
1339 
1340 
1341 
1342 
1343 
1344 
1345 
1346 


1347 
1348 


we Te Ve Ve Ve Ve Ne Ve Ve 


. 


INPUT: 


OUTPUTS: 


THE SPECIFIED BLOCK IS RETURNED 


R5 = ADDRESS OF BLOCK TO BE DEALLOCATED. 
FKBSW_SIZE(RS) = SIZE OF BLOCK 


R5 destroyed 


DEALLOCATE : 


301078: 


301088: 
108: 


158: 


208: 


308: 


408: 
508: 


301138: 


MOVZWL 
LOCK 


MFPR 
BLBC 

MOVZBL 

JSB 
BRB 


BLEC 
MOVZBL 
JSB 


MTPR 
CLRL 
RSB 


FKBSW_SIZE(R5),R1 
LOCKNAME=EMB, ~ 
PRESERVE=NO, ~ 
SAVIPL=- (SP) 
S*#PR$_IPL,- (SP) 
G*SMP$GL_FLAGS, 30107$ 
S*#SPLS$C_EMB, RO 

G*SMP SACQUIRE 

30108$ 


MTPR 


G*SMPS$GL_PFORK_ POOL, - 
RO 

RO, R2 

(R2),RO 

208 

R5, RO 

10$ 

RO, (R5) 

30$ 

R5,R1,R4 

RO, R4 

30$ 

(RO) +, (R5) 

(RO), R1 

R2,R4 

R5, (R2)+ 

(R2),R4 

R5,R4 

40$ 

(R2),R1 
(R5),-(R2) 

R2,R5 

R1, 4(R5) 
LOCKNAME=EMB, - 
PRESERVE=NO, - 
NEWIPL=(SP) +, - 
CONDITION=RESTORE 
G*SMP$GL_FLAGS, 30113$ 
S*#SPLS$C_EMB, RO 
G*SMP $SRESTORE 


(SP)+,S*#PR$_IPL 
R5 


Get size of block in bytes 
Lock buffer pool database 


™e Me 


3; Save current IPL 


S*#IPL$_EMB,S*#PRS$_IPL 


7; Get address of listhead 

7;SAVE ADDRESS OF PREVIOUS FREE BLOCK 
7GET ADDRESS OF NEXT FREE BLOCK 

7;IF EQL END OF LIST 

7BLOCK LOGICALLY GO HERE? 

7IF GTRU NO 

7;ASSUME NO AGGLOMERATION 

7END OF LIST - NO AGGLOMERATION 
?7CALCULATE ADDRESS OF END OF BLOCK 
7END OF BLOCK EQUAL TO NEXT IN LIST? 
7;IF GTR DO NOT AGGLOMERATE 

7;MOVE LINK TO BLOCK BEING RELEASED 

7; ACCUMULATE LENGTH OF NEW FREE BLOCK 
7CALCULATE ENDING ADDRESS OF PREVIOUS BLOCK 
7; ASSUME NO AGGLOMERATION 

;ADD LENGTH TO BLOCK BASE ADDRESS 
7END ADDRESS EQUAL TO BLOCK BEING RELEASED? 
;IF GTR DO NOT AGGLOMERATE 

; ACCUMULATE SIZE OF NEW FREE BLOCK 
;MOVE LINK TO PREVIOUS FREE BLOCK 
7;SET ADDRESS OF NEW FREE BLOCK 

7SET SIZE OF FREE BLOCK 

7 Unlock buffer pool database 


3; Restore IPL 


; ZAP block address 


DIGITAL INTERNAL USE ONLY 321 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 35 
X-72 SMPSFORK_TO_PRIMARY- migrate work packet 19-APR-1989 15:24:09 [(SY¥S.SRC]SMPROUT.MAR;1 (1 


1349 
1350 -SBTTL MESSAGE Display message on virtual console 


322 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 36 
X-72 MESSAGE Display message on virtual conso 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1 


1352 
1353 
1354 
1355 
1356 
1357 
1358 
1359 
1360 
1361 
1362 
1363 
1364 
1365 
1366 
1367 
1368 
1369 
1370 
1371 
1372 
1373 
1374 
1375 
1376 
1377 
1378 
1379 
1380 
1381 
1382 
1383 
1384 
1385 
1386 
1387 
1388 
1389 
1390 
1391 
1392 
1393 
1394 
1395 
1396 
1397 
1398 
1399 
1400 
1401 
1402 
1403 
1404 
1405 
1406 
1407 
1408 


a++ 
? This code displays messages for this CPU on the console terminal. The 
; format of the messages is. structured such that there is a primary 
# message to be displayed first, then this routine will display this 
? processor’s ID in ASCII, then a secondary message is displayed. 
7; Inputs: 
’ 
? R6 = Address of per-CPU database 
’ 
: O(SP) = Return address 
? 4(SP) = Address of primary ASCIC text to display 
; 8(SP) = Address of secondary ASCIC text to display after CPU number 
FIRST PART = 24 7 Stack offset of address of first half of m 
SECOND PART = 28 3 Stack offset of address of second hal of m 
ADDTL. REGS = 8 ; Adjustment for addtl saved registers 
MESSAGE: ; 
PUSHR #°M<R1,R2,R3,R4, R5> 
MOVZBL @FIRST_PART(SP) ,R3 z length of first part of msg 
ADDB @SECOND_PART (SP), R3 ? length of second part, plus CPU ID 
ADDB #2,R3 
MOVL g*OPASAR_UCBO, R4 3;OPAO UCB addr 
MOVZBL UCBSB_FLCK(R4),- 
R4 7Use OPAO FLCK 
JSB g*SMPSSETUP_PFORK 3 allocate and init packet 
BLBS RO, 20$ 3; continue if allocation succeeded 
POPR #°M<R1,R2,R3,R4,R5> 
RSB 
7 RS now points to data area in packet 
208: PUSHR #*M<R3,R5> 3 save around MOVC 
MOVL <FIRST_PART+ADDTL_REGS> (SP) ,- 
R1 3 addr of first part of msg 
MOVZBL_ (R1)+,R2 7 length of string in R2, bump address 
MOVC3 R2, (R1), (R5) 7 move data to packet. 
7NB: Registers saved above 
MOVZBL CPUSL_PHY CPUID(R6),RO ; Get this CPU’s physical ID 
7 NB MOVC3 leaves R3 pointing to the next byte in the output buffer 
MOVW W*CH_TABLE[RO], (R3) + 7 ASCII CPU ID 
MOVL <SECOND_PART+ADDTL_REGS> (SP), - 
R1 ' 3 addr of second part of msg 
MOVZBL (R1)+,R2 7 length of string in R3, bump address 
MOVC3 R2, (R1), (R3) 7 move data to packet. 
POPR #°M<R3, R5> 
PUSHAB 30$ # simulate ‘caller’s caller’ 
PUSHAB G“SMPSWRITE_OPAO ? fork routine address 
JMP G*SMPSFORK_TO_ PRIMARY 7 dispatch packet 
308: POPR #°M<R1,R2,R3,R4,R5> ; SMPSFORK_TO PRIMARY will return here 


RSB 


DIGITAL INTERNAL USE ONLY 323 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY~-1989 16:58:12 VAX MACRO V5.0-8 Page 37 
X-72 SMPSWRITE_OPAO - fork routine to broadca 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1 


1410 -SBTTL SMPSWRITE OPAO - fork routine to broadcast message to console 
1411 ;++ 

1412 ; FUNTIONAL DESCRIPTION: 

1413 ; 

1414 ;SMPSWRITE_OPAO - fork routine to broadcast message to console 
1415 ; 

1416 ; ENVIRONMENT: 

1417 ; 

1418 ; 

1419 ; CALLING SEQUENCE: 

1420 ; 

1421 ; JSB G“SMPSWRITE_OPAO 

1422 ; 

1423 ; INPUT PARAMETERS: 

1424 ; 

1425 ; r3 = length of data 

1426 ; r5 = address of data 

1427 ; RO,r1,xr2 scratch 

1428 ; fork lock held. 

1429 ; 

1430 ; OUTPUT PARAMETERS: 

1431 ; 

1432 ; None 

1433 ; 

1434 ;-- 

1435 

1436 UNIVERSAL_SYMBOL SMPSWRITE_OPAO 


SMPS$WRITE_OPAO:: 
1437 ;SMPSWRITE_OPAO:: 


1438 ; 

1439 MOVL R3,R1 3 length of data 

1440 MOVL R5, R2 # address of data to output 
1441 MOVL G“OPASAR_UCBO, R5 # target device’s UCB 

1442 JSB G*“IOCS$BROADCAST 3 broadcast to OPAO 

1443 MOVL R2,R5 # restore register 

1444 7 NB: this assumes that 
1445 # IOCSBROADCAST preserves 
1446 7 all registers, R2 in particular 
1447 RSB 

1448 


324 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 38 
X-72 SYNCHSINIT ONCE - Once only initializati 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1 


1450 
1451 
1452 
1453 
1454 
1455 
1456 
1457 
1458 
1459 
1460 
1461 
1462 
1463 
1464 
1465 
1466 
1467 
1468 
1469 
1470 
1471 


1472. 


1473 
1474 


1475 
1476 
1477 
1478 
1479 
1480 
1481 
1482 
1483 
1484 
1485 
1486 
1487 
1488 
1489 
1490 
1491 
1492 
1493 
1494 
1495 
1496 
1497 
1498 
1499 
1500 


-SBTTL SYNCHSINIT ONCE - Once only initialization for Spinlocks 
3++ 
; FUNTIONAL DESCRIPTION: 
; 
+ SYNCHSINIT_ONCE - Once only initialization for Spinlocks 
; 
7 CALLING SEQUENCE: 
; JSB G*SYNCHSINIT_ONCE 
3 
7 INPUT PARAMETERS: 
3 
? R5 = Pointer to initialization routine flags 
7 
; OUTPUT PARAMETERS: 
? RO = Status of routine 
; 
INITIALIZATION ROUTINE - 
SYNCHSINIT_ONCE 
- SAVE 
-PSECT EXECSINIT_ 001, LONG, RD, WRT, EXE, PIC 
- LONG SYNCHSINIT_ONCE - . 
-LONG  ...FLAGS... 
- RESTORE 
DECLARE PSECT EXECSINIT CODE 
-PSECT EXECSINIT_CODE, LONG, RD, WRT, EXE, PIC 
SYNCHS$INIT ONCE: : # Once-only initialization 
BBS #BOOSTATESV_MAPPED, - ; Br if mapped 
G*EXESGL_STATE, 10$ 
BICL #INIRTNS$M_NO RECALL, (R5) 3; We need to be called again 
BRW 90S 
10$: 
MOVAB W°SMPS$GL_SPNLKVEC, ~ ; Init spinlock vector address 
G*SMPS$AR_SPNLKVEC 
MOVW #SPLS$_NUM_LOCKS, - 3 Init count of locks in vector 
G*SMPSGW_SPNLKCNT 
MOVW #SPL$_MIN_ INDEX, - ; Init first spinlock index 
G*SMPSGW_MIN INDEX 
3 
7 initialize spinwait timeout interval. Certain IPL 8 locks (e.g., 
7 SCHED, MMG) have long holding times; all spinlocks at IPL <= 8 
; therefore have their timeout intervals set to SMP_LNGSPINWAIT 
; to prevent SPINWAIT timeouts in cases of nested acquisition. 
7 All locks at IPLs greater than 8 have their timeout initialized to 
+; SMP_SPINWAIT. 
7 
MOVZWL #SPL$ MIN INDEX, RO ; starting SPNLKVEC index 
208: MOVL W“SMPSGL_SPNLKVEC [RO] ,R2 3; address of spinlock 
BGEQ 40$ ; empty slot if not SO address 
ASSUME IPLS_SCS EQ 8 


DIGITAL INTERNAL USE ONLY 325 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY~-1989 16:58:12 VAX MACRO V5.0-8 Page 39 
X-72 SYNCHSINIT_ONCE ~ Once only initializati 19-APR-1989 15:24:09 [SYS.SRC])SMPROUT.MAR;1 (1 


1501  CMPL SPL$B_IPL(R2),#IPL$_SCSs 3 locks at IPL <= 8 get long 
1502 BGTR 30$ 3; timeout interval 

1503 MOVL G*SGNSGL_ SMP _LNGSPINWAIT, - 

1504 SPLSL_' TIMO )_ INT (R2) ; set up LONG timeout interval 
1505 BRB 40$ 

1506 30S: MOVL G*SGNSGL_SMP_SPINWAIT, - 

1507 SPLSL _' TIMO )_INT(R2) + set up timeout interval 
1508 40$: AOBLSS #SPLS | MAX - INDEX, RO, 20$ ? loop until done. 

1509 

1510 3 Init NULL UCB device lock address 

1511 

1512 MOVL G“NLSAR_UCBO, R2 3; Get address of NULL UCB 
1513 MOVAB G*SMP$GL_MAILBOX, UCBSL_DLCK (R2) 3 Set DEVICE LOCK ADDRESS 
1514 , 

1515 ? Init SYSTEM CRB device lock address 

1516 

1517 MOVL UCBSL_CRB (R2) ,R2 ; Get SYSTEM CRB ADDRESS 
1518 MOVAB G*SMPS$GL_MAILBOX, CRBSL_DLCK(R2) ; Set DEVICE LOCK ADDRESS 
1519 

1520 ? Init MAILBOX TEMPLATE UCB device lock address 

1521 

1522 MOVL G“MBSAR_UCBO, R2 ¢ Get MAILBOX UCB address 
1523 MOVAB G*SMP$GL_MAILBOX, UCB$L_DLCK(R2) ; Set DEVICE LOCK ADDRESS 
1524 

1525 3 Init JOB CONTROLLER MAILBOX UCB device lock address 

1526 

1527 MOVL G*MBSAR_UCB1, R2 ; Get JBC UCB address 

1528 MOVAB G*SMP$GL_MAILBOX, UCBSL_DLCK(R2) ; Set DEVICE LOCK ADDRESS 
1529 

1530 3 Init OPERATOR MAILBOX device lock address 

1531 

1532 MOVL G*MBSAR_UCB2, R2 ; Get OPERATOR MAILBOX UCB address 
1533 MOVAB G*SMPS$GL_ MAILBOX, UCBSL_DLCK(R2) ; Set DEVICE LOCK ADDRESS 
1534 

1535 # Init AUDIT SERVER MAILBOX device lock address 

1536 

1537 MOVL G*MBSAR_UCB3, R2 + Get AUDIT SERVER MAILBOX UCB addre 
1538 MOVAB G*SMP$GL_MAILBOX, UCB$L_DLCK(R2) ; Set DEVICE LOCK ADDRESS 
1539 

1540 3; init timeout for OPAO devicelock 

1541 

1542 MOVL G*OPASAR_SPL, R2 7 pick up spinlock address 
1543 MOVL G*SGNS$GL_ SMP_SPINWAIT, - 

1544 SPLSL_' TIMO )_INT(R2) 7 set spinlock interval 
1545 ; 

1546 7 Copy IPL vector from LDAT to base image 

1547 ; . 

1548 PUSHR #*M<R3,R4,R5> 7 Save registers 

1549 MOVC3 #<4*SPL$_NUM_ LOCKS>, W*SMPS$GL_IPL | VEC+<4*SPL$ MIN INDEX>, - 
1550 G*SMPSAL_ IPLVEC+<4*SPLS 1 MIN _INDEX> 7 Copy LDAT vector 

1551 POPR #°M<R3,R4,R5> 7 Restore registers 

1552 ; 

1553 ; check to see if we can allocate free pages yet... 

1554 ; 

1555 BBS #BOOSTATESV_PFN_INIT, - ; Br if can do so 

1556 G*EXES$GL_STATE, 50$ 

1557 BICL #INIRINS$M_NO_ RECALL, (R5) 3 We need to be called again 


326 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SMPROUT - SMP routines for VMS 10-MAY-1989 16:58:12 VAX MACRO V5.0-8 Page 40 
X-72 SYNCHSINIT_ONCE ~- Once only initializati 19-APR-1989 15:24:09 [SYS.SRC]SMPROUT.MAR;1 (1 


1558  BRW 90$ 

1559 ; 

1560 ; initialize the buffer pool used by SMPSFORK_TO PRIMARY 

1561 ; 

1562 50S: MOVZBL G*SMPS$GB_PFORK POOL SIZE,- 

1563 R2 ? This many pages are needed. 
1564 JSB G“LDRSALLOC_PT 

1565 BLBC RO, 100$ ¢ Failure here 

1566 SUBL3 G*LDRSGL_SPTBASE,R1,R3 ; Calculate base address 

1567 ASHL #<9-2>,R3,R3 ? and initalize buffer pointer. 
1568 BISL3 #*X80000000, R3, - (SP) 

1569 

1570 80S: MOVQ R1,-(SP) 3 Preserve through following call 
1571 JSB G*MMGSALLOCPFN 3 Get one PFN. 

1572 MOVO (SP)+,R1_ 3 Restore loop indicies. 

1573 TSTL RO 7 Was one available? 

1574 BLEQ 100$ 3 LEQ: No! 

1575 MOVL RO, (R1) ? Map page. 

1576 BISL2 #<PTESM_ VALID! PTESC_ERKW!PTESC_KOWN>, (R1)+ ; Make page valid. 
1577 SOBGTR R2,80$ 

1578 ; 

1579 ; save pool address and initialize listhed. Listhead contains a FLINK and 
1580 ; a blocksize as the first 2 LW of each block. 

1581 ; 

1582 MOVL (SP)+,R3 

1583 MOVL R3,G*SMP$GL_PFORK_ POOL 

1584 CLRL (R3) + 3 Zero FLINK (empty list) 

1585 MOVZBL G*SMPSGB_PFORK_ POOL SIZE, -(SP) 

1586 MULL3 (SP) +, $512, (R3) 3; and set size 

1587 

1588 90S: MOVL #SS$_ NORMAL, RO 

1589 1008S: RSB ; Return 

1590 

1591 

1592 -end 


DIGITAL INTERNAL USE ONLY 327 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


12 SPINLOCKS.LIS 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 0 
Table of contents 


(1) 45 HISTORY 

(2) 297 DECLARATIONS 

(3) 312 SPINWAIT - Spinlock wait timeout macro 

(4) 403™ ACQUIRE - Acquire a spinlock through busy waiting 

(7) 993 RESTORE - Conditionally release a spinlock 

(10) 1168 RELEASE ~- Release a spinlock 

(12) 1375 REI_CHECK - Check spinlock database consistency 

(13) 1455 NOLOCKS - Make sure no spinlocks are held 

(14) 1512 SMPS$CHKLOCK - Make sure spinlock is owned before proceeding 
(15) 1588 ALLOC_SPL - Allocate a spinlock 

(16) 1639 INIT SPL - Initialize a spinlock 

(17) 1692 ADJUST_IPL ~- ADJUST THE IPL OF A LOCK, ALTER RANKS ACCORDINGLY 


328 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:3/ VAX MACRO V5.0-8 Page 1 
X-86 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 (1) 


1 -NLIST CND 

8 - TITLE SPINLOCKS ~- Spinlock routines for VMS/SMP 
11 
12 eIDENT 'X-86’ 

13 ; 
14 ZRH RK HHEKRHKK KEKE EKEK KEKE CK RRR KEKRK KEKE KKK KERRI KEKE KREKKEKEK EKER EK EKKKEKE 
15 3% * 
16 ;* COPYRIGHT (c) 1988 BY * 
17 ;* DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. * 
18 ;* ALL RIGHTS RESERVED. ¥ 
19 ;* . ® 
20 ;* THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED * 
21 ;* ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE * 
22 ;* INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER * 
23 ;* COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY * 
24 ;* OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY = 
25 ;* TRANSFERRED. = 
26 ;* * 
27 ;* THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE bl 
28 ;* AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT * 
29 ;* CORPORATION. * 
30 3* * 
31 ;* DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS * 
32 ;* SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. i 
33 ;* o 
34 ;* * 
35 PERKRKHEHREKRREEK HERE KEKE KERRIER KKEEKKKERKEKHREKEKKEHIEKEKEEKREKEKHEKKKKEKKK 
36 7 | 
37 ++ 
38 ; Facility: Symmetric Multiprocessing 
39 ; 
40 ; Abstract: The subroutines to implement the acquire and release 
41 ; synchronization spinlocks for symmetric multiprocessing. 
42 ; 
43 ; Environment: Kernel Mode. 
44 ; 
45 -SBTTL HISTORY 
46 ; 
47 ; Author: Rod Gamache, Bill Laing, Mike Harvey Creation Date: 17-May-1985 
48 ; 
49 ; Modified by: 

50 ; 
51 ; X-86 MSH0344 Michael S. Harvey 29-Mar-1988 
52 3 Close window where spinlock acquire/release operations 
53 ; could cause deadlocks should an interprocessor interrupt 
54 ; occur while a CPU has set the spinlock access bit. 
55 ; 
56 ; Also, modify SPINWAIT macro to utilize the per-CPU 
57 ; timer cells, rather than the obsolete EXES$xxx versions 
58 ; of the timer cells. 
59 ; 
60 ; x-85 MSH0333 Michael S. Harvey 18-Nov-1987 
61 ; Recognize BENIGN STATE and VIRTCONS requests in the 
62 ; spinwait code for CPUs that are in the OVERRIDE set 
63 ; and at high IPL. This prevents system deadlocks caused 

64 ; when these conditions are ignored at this level. 

65 ; , 


DIGITAL INTERNAL USE ONLY 329 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 2 
X~86 HISTORY 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 (1) 


66 ; X-84 MSH0327 Michael S. Harvey 11-Nov-1987 

67 ; OVERRIDE check in spinwait macro is too broad. This 

68 ; currently leads to deadlocks over IP IPL traffic. 

69 ; 

70 ; X~83 RNG5083 Rod N. Gamache 28-Oct-1987 

713 Allow members of OVERRIDE set to raise IPL if needed in 
72 3 the minimum version. 

73; 

74 3 X-82 MSH0328 Michael S. Harvey 26-Oct-1987 

78 3 Prevent lowering of IPL on ACQUIRE spinwait path if 

76 ; CPU is a member of the OVERRIDE set and has called 

TT 3 ACQUIRE at an IPL lower than that of the desired lock. 
718 ; 

19 ; X-81 MSH0327 Michael S. Harvey 23-Oct-1987 

80 ; Spinwait code must accomodate the case when it executes 
81 ; at an IPL that blocks ACTIVE set driven IP interrupt 

82 ; requests. Such requests MUST be acknowledged in the 

83 ; spinwait code, else the system will deadlock and crash. 
84 ; 

85 ; X-80 RNG5080 Rod N. Gamache 11-Sep-1987 

86 ; Fix previous edit - we must check for BUG DONE in order 
87 ; to allow the primary CPU to ’break’ spinlocks. 

88 ; Get free check of ‘invalid’ release of a spinlock when it 
89 ; is not owned in the minimum version of release. 

90 ; Initialize SPINLOCK size when spinlock is allocated. 

91 ; 

92 ; X~-78 RNG5078 Rod N. Gamache 8-Jul~1987 

93 ; Remove unnecessary checks in SMP minimum version of release 
94; code path. 

95 ; 

96 ; X-77 RNG5077 Rod N. Gamache 15-Jun-1987 

97 ; Don’t record release PC in minimum version of SPINLOCKS. 
98 ; 

99 ; X-76 MSH0313 Michael S. Harvey 15-May-1987 

100 ; Record release PC when multiple acquisitions are being 
101 ; wiped out. 

102 ; 

103 ; Also, don’t charge process for busywait time in 

104 ; minimal version of spinlock acquire (already done 

105 ; for full-blown version). 

106 ; 

107 ; X-75 SUF Stu Farnham 4-May~-1987 

108 ; Use SMP_LNGSPINWAIT for timeout interval for spinlocks 
109 ; held at IPLs <= 8 to compensate for the additive effects 
110 ; of the locks at that IPL with long holding times. 

111 ; 

112 ; X-74 RNG5074 Rod Gamache 4-Apr-1987 

113 ; Fix problem with ACQUIRE paths: make sure IPL is GTR 2 
114 ; when using FIND _CPU DATA macro. 

115 ; 

116 ; X-73 RNG5073 Rod Gamache 24-Mar-1987 
117 ; Change all refs from SMPSAR_SPNLKVEC to SMP$GL_SPNLKVEC. 
118 ; Change refs from SMPSGL_ SPNLKCNT to SMPSGW_ SPNLKCNT 
119 ; Check override membership before setting IPLs on uniprocessor. 
120 ; 
121 ; X-72 SUF Stu Farnham 16-Mar-1987 
122 ; Add a check for spinlock starvation to SPINWAIT macro. 


330 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 3 
X-86 HISTORY 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 (1) 


123 ; This occurs when contention for a lock is high, and 

124 ; ownership keeps changing. Under those conditions, a CPU 
125 ; may time out not because a lock is being held too long, 
126 ; but because that CPU may keep losing the race to acquire 
127 ; the lock. In such a case a new timeout quantum should be 
128 ; given instead of taking a CPUSPINWAIT bugcheck. 

129 ; 

130 ; X-71 MJW0113 Michael J. Worcester 26-Feb-1987 

131 ; Change reference of DYNS$C_SPL_DEVICELOCK to 

132 ; SPLSC_SPL_DEVICELOCK. 

133 ; 

134 ; X-70 SUF Stu Farnham 16-Feb-1987 

135 ; Reverse X-66 in the interests of efficiency. Parameter 
136 ; now expressed in the units of the calculation (10 usec) 
137 ; 

138 ; X-68,69 MSHO0246 Michael S. Harvey 10-Feb-1987 

139 ; Reduce spinlock counter magnitude. Remove obsolete ASSUME. 
140 ; 

141 ; X-67 CEGO02 Clair Grant 6-Feb-1987 

142 ; Fix branch destination out of range 

143 ; 

144 ; X-66 SJF Stu Farnham 5-Feb-1987 

145 ; Convert milli- to micro- seconds in SPINWAIT macro 

146 ; 

147 ; X-65 wcT0025 Ward C. Travis 28-Jan-1987 

148 ; Handle zero and other non-SO addresses in the 

149 ; spinlock address vector. , 

150 ; 

151 ; X-64 RNG5064 Rod Gamache 27-Jan-1987 

152 ; Add minimized version of spinlock acquisition. 

i53 ¢ 

154 ; X-63 SUF Stu Farnham 23-Dec-1986 

155 ; Initialize SPL$L_TIMO_INT in SMPSINIT_ SPL. 

156 ; Add spinwait timeouts. 

L573 

158 ; X-62 MSH0280 - Michael S. Harvey 19-Dec-1986 

159 ; Break up SPLIPLERR into more recognizable and separate 
160 ; error conditions, SPLIPLLOW and SPLIPLHIGH. 

161 ; 

162 ; X-61 MSHO0291 Michael S. Harvey 11-Dec-1986 

163 ; Allow high-IPL busywaits to see bugcheck signals. This 
164 ; mechanism predates an effective spinlock timeout mechanism. 
165 ; 

166 ; X-60 MSHO0287 Michael S. Harvey 1-Dec-1986 

167 ; Prevent IPL bouncing between Qbus devicelock IPLs and bus 
168 ; grant IPL that can occur on the busywait. This one was 
169 ; found by a technical writer! Good thing they’re around to 
170 ; keep the engineers honest, eh! 

171-3 

172 ; X-59 MSH0284 Michael S. Harvey 23-Oct-1986 

173 ; Recognize the OVERRIDE set. Allow members of the OVERRIDE 
174 ; set to acquire/release spinlocks without regard to the 
175 ; spinlock’s associated IPL. 

176 ; 

177 ; X-58 RNGOOS58 Rod Gamache 29-Oct-1986 

178 ; Change IPL$_SCHED to IPL$_RESCHED. 

179 ; 


DIGITAL INTERNAL USE ONLY 331 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 4 
X-86 HISTORY 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 (1) 


180 ; X-57 RNGOO57 Rod Gamache 6-Oct-1986 

181 ; Allow CHKLOCK to continue if called when INIT is running. 
182 ; 

183 ; xX-56 MSH0280 Michael S. Harvey 24-Sep~1986 

184 ; Allow bugcheck to effectively break held locks. 

185 ; Add SPLRSTERR to more readily distinguish the different 
186 ; spinlock release failures. 

187 ; 

188 ; X-54 RNGOO54 Rod Gamache 18-Sep-1986 

189 ; Allow CHK_LOCK to be called when IPL is 31. 

190 ; 

191 ; x-48 WwCT Ward C. Travis 11-Sep-1986 — 
192 ; ADJUST_IPL deloopified: needed to bug out if a lock’s 
193 ; rank was requested to change. 

194 ; 

195 ; X-47 RNGO047 Rod N. Gamache 10-Sep-1986 

196 ; Fix incorrect order of CMP arguments in ADJUST_IPL routine. 
197 ; 

198 ; X~-46 RNGOO046 Rod N. Gamache 8-Sep~1986 

199 ; Fix typos from previous edit. 

200 ; 

201 ; X-45 wct Ward C. Travis 22-Aug-1986 

202 ; Add SMPSADJUST_IPL to allow boot~-time reordering of 

203 ; SPL IPLs. 

204 ; 

205 ; X-44 MSH0262 Michael S. Harvey 16-Jul-1986 

206 ; Add DEVICELOCK path which doesn’t set the IPL on acquisition. 
207 ; Also, waive IPL violation on acquisition of DEVICELOCKS 
208 ; if the lock in question is already owned by the acquiring 
209 ; processor. 

210 ; 

211 ; X-43 RNGOO43 Rod N. Gamache 14-Jul-1986 

212 ; Record PC of callers of SMPS$RESTORE. 

213 ; 

214 ; X-42 MSH0261 Michael S. Harvey 14-Jul-1986 

215 ; Add some robustness on spinlock validation. 

216 ; 

217 ; X-40 MSH0259 Michael S. Harvey 11-Jul-1986 

218 ; Extend the IPL array in the per-CPU database to longwords. 
219 ; Also, detect overflow on spinlock ownership count. Also, 
220 ; restore SPINLOCK data type/size initialization. 

221 ; 

222 ; X-38 RNGOO38 Rod Gamache 26-Jun-1986 

223 3; ; Don’t init SPINLOCK data type/size - at least for now. 
224 3; 

225 ; X-36 MSH0252 Michael S. Harvey 16-Jun-1986 

226 ; Add support for data structure typing of the spinlock 
227 ; control block. 

228 ; 

229 ; X-35 MSHO250 Michael S. Harvey 12-Jun-1986 

230 ; Allow spinlock acquisition from IPL 31 for those 

231 ; processors that could not possibly have any 

232 ; lower IPL code threads preempted, by virtue of 

233 ; being in a boot sequence. 

234 ; 
235 ; X-34 MSH0249 Michael S. Harvey 11-Jun-1986 

236 ; Start using ‘real’ bugcheck messages. 


332 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 5 
X-86 HISTORY 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 (1) 


237 ; 

238 ; X-29 MSH0243 Michael S. Harvey 20-May-1986 
239 ; Remove devicelocks from generalized rank enforcement. 
240 ; Also, clean up the ownership mechanisms for spinlocks. 
241 ; 

242 ; X-28 MSH0247 Michael S. Harvey 16-May-1986 
243 ; Keep track of spinlock related IPL usage for ease of 
244 ; analysis and to speed up consistency checking. 

245 ; ; 

246 ; MSH0246 Michael S. Harvey 15-May-1986 
247 ; Count the number of failed and successful spinlock 

248 ; acquisitions. Also, extend spin count from 64 to 96 bits. 
249 ; 

250 ; X-27 MSH0245 Michael S. Harvey 14-May-1986 
251 ; Indicate when the CPU is busywaiting to avoid charging 
252 ; a process for the time involuntarily spent waiting 

253 ; for access to the spinlock. 

254 ; 

255 ; X-26 MSH0243 Michael S. Harvey 14-May~1986 
256 ; When busy-waiting, do so at the lowest practical IPL 
257 ; to avoid unnecessary blockage of other events. 

258 ; 

259 ; X-25 MSH0244 Michael S. Harvey 14-May-1986 
260 ; Fix out of phase symbols. 

261 ; 

262 ; X-24 MSHO0243 Michael S. Harvey 13-May-1986 
263 ; Reverse rank assignments and redesign the rank verification 
264 ; code to remove some bugs and speed up the code overall. Make 
265 ; other changes to speed up spinlock acquisition and release. 
266 ; Interlock access to the spinlock structure itself. 

267 ; 

268 ; X~-23 MSH0242 Michael S. Harvey 8-May-1986 

269 ; Replace logical CPU ID with physical CPU ID. 

270 ; 

271 ; X~1F2 RNG1002 Rod Gamache 7-May~-1986 

272 3 Remove extra check in SMPSACQUIRE. Add comments. 

273 3 

274 ; X-1A7 RNG4007 Rod Gamache 4-Mar-1986 

275 ; Move SMPSFIND_SELF routine to module SMPROUT. 

276 ; 

277 3; X-1A6 RNG4006 Rod Gamache 19-Feb-1986 
278 ; Re-position SMPSFIND SELF to a PSECT which is not 

279 ; overlayed by BUFSFATAL stuff. 

280 ; 

281 ; X-1A5 RNG4005 Rod Gamache 18-Feb-1986 
282 ; Add $CPUDEF external call. 

283 ; 

284 ; X-1A4 RNG4004 Rod Gamache 7-Feb-1986 

285 ; Add routine to find the PER CPU data area given on the 
286 ; PHYSICAL CPU ID. 

287 ; 

288 ; X-1A3 RNG4003 Rod Gamache 25-Nov-1985 
289 ; Add routines to allocate and initialize a spinlock. 
290 ; 

291 ; X-1A2 RNG4002 Rod Gamache 19-Nov-1985 
292 ; Add routines to make sure a specified spinlock is held and 
293 ; that no spinlocks are held. 


DIGITAL INTERNAL USE ONLY 333 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 6 
X-86 HISTORY 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 (1) 


294 3; 
295 ;-- . 


334 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 7 
X-86 DECLARATIONS 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS .MAR;1 


297 
298 
299 
300 
301 
302 
303 
304 
305 
306 
307 
308 
309 
310 


-SBTTL DECLARATIONS 


S$BIICDEF 
SCPBDEF 
S$CPUDEF 
SDYNDEF 
SIPLDEF 
$KA810DEF 
SPRDEF 
SPRSSSDEF 
SPSLDEF 
$SPLCODDEF 
$SPLDEF 
SSSDEF 


Define 
Define 
Define 
Define 
Define 
Define 
Define 
Define 
Define 
Define 
Define 
Define 


me Se Ve Te Ye Ye Yo Ye Yo Ye Ye Yo 


(2) 


BIIC offsets 

CPU capabilities 

per CPU data area 

data structure types 

IPLs 

KA820 node private space 
Processor Registers 
KA820 processor registers 
Processor Status Longword 
spinlock indices 

Spinlock structures 
status returns 


DIGITAL INTERNAL USE ONLY 335 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS ~- Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 8 
X-86 SPINWAIT - Spinlock wait timeout macro 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 (3) 


312 -SBTTL 
313 

314 ; 

315 ; 

316 ; 

317 ; Parameters: 
318 ; 

319 ; 

320 ; 

321 ; 

322 ; 

323 ; 

324 ; 

325 ; 

326 ; 

327 -MACRO 
328 

329 -LIST 
330 MFPR 
331 CLRQ 
332 Ll: MOVL 
333 

334 MULL3 
335 

336 MULL 
337 L2: 

338 ‘INS1’ 
339 *INS2’ 
340 ‘INS3’ 
341 ‘INS4’ 
342 *INSS’ 
343 CMPL 
344 BLSS 
345 BBS 
346 DSBINT 
347 JSB 
348 ENBINT 
349 L5: BBS 
350 

351 BBC 
352 

353 ASSUME 
354 BLBC 
355 IF DIF 
356 PUSHR 
357 MOVL 
358 LFF 
359 PUSHR 
360 ~IFTF 
361 JSB 
362 -IFT 
363 POPR 
364 ~IFF 
365 POPR 
366 -ENDC 
367 L6: BBCCI 
368 


SPINWAIT - Spinlock wait timeout macro 


SPINWAIT: Macro to time out spinlock spinwaits. 


SPINLOCK : register containing address of spinlock 
for which to wait 
CPUBASE : register containing base address of CPU. database 


DONELBL : label at end of successful completion of spinwait 
Li, etec.: local labels 


This macro will result in a bugcheck if the spinlock interlock is not 
freed within the timeout interval contained in SPL$L_TIMO_INT. 


SPINWAIT SPINLOCK, INS1, INS2, INS3, INS4, INSS, CPUBASE=R1, DONELBL, - 


?L1, ?2L2, ?L3, ?2L4, 2L5, ?72L6 


MEB 

#PRS$_IPL, -(SP) ? Save current IPL 

- (SP) ? Make room on stack 
SPLSL_OWN_CPU (SPINLOCK) , - 

4 (SP) 7; save current owner 


SPL$L_TIMO_INT (SPINLOCK) , ~ 
CPU$L_UBDELAY (CPUBASE) , (SP) 
CPU$L_TENUSEC (CPUBASE) , (SP) 


8 (SP) ,G*EXESGL_IPINT_IPL Blocking IP interrupts? 


L4 If LSS no, just spinwait 
#15, G*XDTSGW_OWNER_ID,L5 Is XDELTA active? 
ENVIRON=UNIPROCESSOR Yes, prepare for benign state 


G*XDTSCPU WAIT Enter benign state 

> Clean up from benign state 
#CPUSV_BUGCHK, - Watch for pending bugcheck 
CPUS$L_WORK_REQ(CPUBASE) , L3 
CPUSL PHY CPUID(CPUBASE) ,- 
G*SMP§GL_OVERRIDE, L4 

CPBSC PRIMARY EQ 0 


CPUSL_CAPABILITY (CPUBASE) , L6 # Ignore VIRTCONS if secondary 


Branch if not an OVERRIDE 
set member 


me Ye Ye Se Se Ye Ve Vo Veo Wo 


<CPUBASE>, R1 

#“M<RO,R1, R2> : Save some registers 
CPUBASE, R1 7 Copy per-~-CPU db address 
#°M<RO, R2> ? Save some registers 


G*SMPS$VIRTCONS_SERVER Check for VIRTCONS request 


ve 


#°M<RO,R1,R2> 


=e 


Restore registers 


#°M<RO, R2> Restore registers 


ve 


#CPUSV_INV_TBS, - 
CPU$L_WORK_REQ(CPUBASE) , L4 


Watch for pending TBIS 


we Ne 


336 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 9 
X-86 SPINWAIT - Spinlock wait timeout macro 1-APR-1988 09:19:41 (SYS.SRC]SPINLOCKS.MAR;1 (3) 


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 


we Ne Me 


L3: 


DONELBL : 


-IF DIF 
PUSHR 
MOVL 
- IFF 
PUSHR 
- IFTF 
JSB 
-IFT 
POPR 
-IFF 
POPR 
-ENDC 


SOBGTR 


CMPL 


BNEQ 
BSBW 
BRB 


<CPUBASE>, R1 
#°M<RO,R1, R2> 
CPUBASE, R1 

#°M<RO, R2> 
G*SMPSINVALID_SINGLE 
#°M<RO, R1,R2> 


#“M<RO, R2> 


(SP) ,L2 


The spinlock did not become available 


4(SP),- 

SPL$L_OWN_CPU (SPINLOCK) 
Ll 

SMPSTIMEOUT 

Ll 


BUG CHECK CPUEXIT, FATAL 


ADDL 


-NLIST 
-ENDM 


DECLARE _PSECT 


#12,SP 


MEB 
SPINWAIT 


Save some registers 
Copy per-CPU db address 


we we 


7 Save some registers 


Participate in TBIS exchange 


ve 


Restore registers 


ve 


Restore registers 


=e 


# decrement retry count and retry 


in the specified period of time. 


has owner changed? 

yes, give new quantum and retry — 
Bugcheck if necessary 

Retry if we come back from TIMEOUT 
This CPU was induced to bugcheck 


%e Ne Ye Ve 


clean up stack 


=e 


EXECSNONPAGED CODE 


DIGITAL INTERNAL USE ONLY ‘337 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 10 
X-86 ACQUIRE - Acquire a spinlock through bus 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 ( 


403 -SBTTL ACQUIRE - Acquire a spinlock through busy waiting 

404 ;++ 

405 ; SMPSACQUIRE - Acquire a SPINLOCK or FORKLOCK and force synchronization 
406 ; SMPSACQUIREL - Acquire a DEVICELOCK and force synchronization 

407 ; SMPSACQNOIPL - Acquire a DEVICELOCK without further synchronization 
408 ; 

409 ; These subroutines acquire a spinlock with an interlocked operation. 
410 ; If the spinlock is already in use, the CPU busy waits. 

411 ; 

412 ; Calling sequence: 

413 ; 

414 ; JSB/BSBx from KERNEL mode 

415 ; 

416 ; Input Parameters: 

417 ; 

418 ; RO -> The number of the lock being acquired for entry SMPSACQUIRE 
419 ; RO -> The spinlock structure address for entry SMPSACQUIREL and 
420 ; SMP SACQNOIPL 

421 ; 

422 ; Implicit Inputs: 

423 ; 

424 ; IPL is less than or equal to IPL required by lock for entries 
425 ; SMPSACQUIRE and SMPSACQUIREL. 

426 ; 

427 ; Output Parameters: 

428 ; 

429 ; Implicit Outputs: 

430 ; 

431 ; Local processor synchronization is achieved by setting IPL to 
432 ; the IPL associated with the spinlock for entries 

433 ; SMPSACQUIRE and SMPSACQUIREL. Local processor 

434 ; synchronization is assumed to be already achieved 

435 ; on entry via SMPSACQNOIPL. 

436 ; 

437 ; Regardless of the entry point, the spinlock is acquired, 
438 ; thus extending the local processor synchronization to 
439 ; all other processors. 

440 ; 

441 ; Side Effects: 

442 ; 

443 ; Note that busy-waits on locks that are held by another CPU 

444 ; will execute at the caller’s IPL. 

445 ; 

446 ; The spinlock performance/debug database is updated. 

447 ; 

448 ; RO is altered. 

449 ; 

450 ;-~- 

451 

824 


338 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS ~ Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 11 
X-86 ACQUIRE - Acquire a spinlock through bus 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 ( 


863 
864 
865 
866 
867 
868 
869 
870 
871 
872 
873 
874 
875 
876 
877 
878 
879 
880 
881 
882 
883 
884 
88s 
886 
887 
eee 
889 
890 
891 
892 
893 
894 
895 
896 
897 
898 
899 
900 
901 
902 
903 
904 
905 
906 
907 
908 
909 
910 
911 
912 
913 
914 
915 
916 
917 
918 
919 


-ENABL LSB 


SPINLOCK ACQUISITION ENTRY POINTS 


we %e Ve 


108: DSBINT #31, ENVIRON=UNIPROCESSOR 
find_cpu_data Rl 

BBC CPUSL_PHY_CPUID(R1),- 
G*SMP$GL_OVERRIDE, 12$ 
(SP), SPLS$B_IPL(RO) 

15$ 

SPLSB_IPL(RO), (SP) 


CMPB 
BGEQ 
MOVZBL 
ENBINT 
BRB 


128: 
158: 
SKIPSET 


-ALIGN LONG 

UNIVERSAL SYMBOL 
3; SMPSACQNOIPL:: 

PUSHL R11 

find_cpu_data Rl 

BRB SKIPSET 


SMPSACQNOIPL 


-ALIGN LONG 
UNIVERSAL SYMBOL 
7 SMPSACQUIRE:: 


SMPSACQUIRE 


MOVL W“SMPSGL_SPNLKVEC [RO], RO 

UNIVERSAL SYMBOL SMP SACQUIREL 
? SMPSACQUIREL:: 

PUSHL R1 

TSTL G*SMPS$GL_OVERRIDE 

BNEQ 10$ 

7; Else, raise the current IPL 


SETIPL SPL$B_IPL(RO),- 
ENVIRON=UNIPROCESSOR 
find_cpu_data Rl 


SKIPSET: 


=e Te Ve Ve 


=e ‘Ve 


™e §e Se 


we Ne Ne 


=e Ye Ne 


bid 


ve 


Disable all interrupts 

Get per-CPU database address 
Force setting IPL for non- 
members of the OVERRIDE set 
Is entry IPL < SPINLOCK_IPL? 
Br if no... leave IPL alone 
Return to spinlock’s IPL 
Restore IPL 

And skip setting new IPL 


Get some working registers 
Get per-CPU database address 
Don’t alter current IPL 


Get spinlock address in RO dak 


4 th. Spc beck , 


Get some working registers 
Is anyone in override? 
Br if yes, do long test 


Raise to spinlock’s IPL 


S pin Lock! TPC 


Get per-CPU database address 


RHEEKEKKEKHKKKRKEREKKRERRKEKRKEKKKEREKRHRERREKKEEEKHEEKEEKEKEKREREKKKEEKRKEKKEHKKEEKERKEKKKKK 


ACQUIRE SPINLOCK 


"ea Ne Me Se fe 


the acquisition fails, 


me Ve 


LEER SELESASSSSESALELESE SESE SEES ESSERE SEES ESET EEE SESE SESE SESS SRE REESE SEL ETE RES SS 


Attempt to acquire the spinlock itself with interlocked protection. If 
busy wait for the lock to become available. 


; RO = Address of desired spinlock structure 
; Rl = Address of current per-CPU database 

? (SP) = Saved Rl 

3 4(SP) = Caller’s PC 


DIGITAL INTERNAL USE ONLY 339 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 12 
X-86 ACQUIRE - Acquire a spinlock through bus 1-APR-1988 09:19:41 [(SYS.SRC]SPINLOCKS.MAR;1 ( 


920 20S: BBSSI #SPLSV_INTERLOCK, - 3; Interlock access to variable 
921 SPLS$B_SPINLOCK (RO), 40$ ; part of spinlock structure 
922 

923 ; The lock is now acquired for this CPU by virtue of the interlock bit changing 
924 ; from 0 to l. 

925 
926 MOVL R1, SPL$L_OWN_CPU (RO) 7 Remember which CPU acquired it 
927 308: INCW SPLSW_OWN_ CNT (RO) 7 Acquire spinlock ownership 
928 3538: POPL R1 7 Restore registers 

929 RSB ; Return with spinlock acquired 
930 

931 ; Come here if the attempt to acquire a spinlock failed because the spinlock 
932 ; is already owned. There are two important cases to consider. Either the 

933 ; spinlock is already owned by the current CPU, or by another CPU. In the 

934 ; former case, allow this acquisition attempt to complete successfully. In 

935 ; the latter case, this CPU must busy wait until the desired spinlock is 

936 ; released by the owning CPU. 

937 ; 

938 ; Assumptions: 

939 ; 

940 ; ° Cache is enabled - thus preventing accesses directly to memory 
941 ; while we are spinwaiting. This prevents excessive memory 

942 ; accesses while spinwaiting. 

943 ; 

944 ; ° Cache coherency is maintained by the hardware. Therefore, the 
945 ; cache contents will be immediately updated whenever the owning 
946 ; CPU releases the spinlock. 

947 

948 40S: CMPL R1, SPLS$L_OWN_CPU (RO) 3 Is spinlock already owned 
949. Lo: ; 3; by this CPU? 

950 '  BEOL 30$ : Br if yes, continue 

951 

952 ; Detect bugcheck caller and allow immediate lock ‘break’ (if PRIMARY) 

953 ; This check must discriminate between CPUs, e.g. one CPU may enter 

954 ; BUG CHECK while another CPU hasn’t. Therefore, we cannot simply change 

955 ; the transfer vector to another routine and simplify the checks used in 

956 ; the ‘normal’ path. 

957 ; 

958 ; Also, we MUST allow for the PRIMARY to ’break’ locks held by other 

959 ; CPUs when it is completing the ’BUGCHECK’. 

960 

961 BBC CPUSL_PHY_CPUID(R1),- 7; Br if this CPU did not bugcheck 
962 G*SMP$GL_BUG DONE, 60$ ; 

963 ; 

964 CMPL CPUSL_PHY_CPUID(R1),- ? Is this the PRIMARY? 

965 G*SMPSGL_PRIMID ; 

966 BEQL 30$ + Br if yes, Allow PRIMARY to 
967 7 ‘break’ lock 

968 BUG CHECK INCONSTATE, FATAL 7 Should never get to this state 
969 ; 

970 608: INCB CPUSB_BUSYWAIT(R1) 7 Avoid charging busywait time 
971 

972 ; The busy wait loop below assumes that a cache is present and that 

973 ; cache coherency is maintained on all available processors. Note that 

974 ; if the cache is not present and working, the busy wait is likely to 

975 ; impact the system performance overall by making many references to memory. 
976 


340 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 13 
X-86 ACQUIRE ~ Acquire a spinlock through bus 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 { 


3 Spin waiting for lock 


ce UY 


a 


merrsy AO 


977 
978 ASSUME SPLSV INTERLOCK EQ 0 
979 SPINWAIT SPINLOCK=RO, - 
980 INS 1=<BLBC SPLSB SPINLOCK (RO) ,51$>,- 
981 DONELBL=51$, - = 
982 CPUBASE=R] 
MFPR #PRS_IPL, - (SP) 3 Save current IPL 
CLRQ - (SP) 3; Make room on stack 
30000$: MOVL SPLSL_OWN_CPU(RO),- 
4 (SP) ; oOo Oake current owner 
MULL3 SPLS$L_TIMO_INT(RO) ,- 
CPUSL_UBDELAY(R1), (SP) 
MULL CPUSL | TENUSEC (R1), (SP \ 5 or eS ail 
300018: 


























SPL$B_SPINLOCK (RO)(51$) 
PD) G*EXES$GL_IPI 






















DTSGW_OWNER_ID, 30004 
S*#PRS$_IPL,- (SP) 
; #31,S*#PR$_IPL 
KDTSCPU_| WAIT 

(SP) +,S*#PR$_IPL 
#cpUsV _ BUGCHK, - 
CPUSL_WORK_REQ(R1) , 30002$ 
CPUSL_ PHY CPUID(R1),- ; 
G*SMPS$GL_OVERRIDE, 30003$ 


300048: 


BLBC CPUS$L_CAPABILITY(R1) , 30005$ 
PUSHR  #*M<RO,R2> 

JSB G*SMP$VIRTCONS SERVER 

POPR #°M<RO, R2> 


#CPUSV_INV_TBS, - 
CPU$L_WORK_REQ(R1) , 30003$ 
#°M<RO,R2>_ 
G*SMP$INVALID_ SINGLE 
<M<RO , R2> 






SOBGTR 
CMPL 4(SP),= 
SPLS$L_OWN_CPU (RO) ? 
BNEQ 30000$ ? 
BSBW SMP $TIMEOUT ; 
BRB 30000$ ; 
30002$: BUG_CHECK CPUE) , FATAL ; 


7WORD “XFEFF 
-IIF IDN <FATAL>, <FATAL> , 


ADDL #12,SP ; 
983 DECB CPUS$B_BUSYWAIT(R1) o\ 
984 BRW 20 
985 ‘ 
986 -DSABL LSB ae IN 
987 
991 


. 2 


Branch 


ee 


Blocking IP interrupts? 
If LSS no, just spinwait 
Is XDELTA active? 


we Se Ve 


7; Enter benign state 

Watch for pending bugcheck 
if not an OVERRIDE 

7; set member 

Ignore VIRTCONS if secondary 
Save some registers 

Check for VIRTCONS request 
Restore registers 

Watch for pending TBIS 


Save some registers 

Participate in TBIS exchange 
Restore registers 

decrement retry count and retry 


™e Ve Te Se Ne Ne Me Ve Ve Ve 


has owner changed? 

yes, give new quantum and retry 
Bugcheck if necessary 

Retry if we come back from TIMEOUT 
This CPU was induced to bugcheck 


- WORD BUGS _CPUEXIT!4 


clean up stack 


7 Resume charging process 
Retry if available 


DIGITAL INTERNAL USE ONLY 341 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 14 
X-86 RESTORE ~- Conditionally release a spinlo 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 { 


993 -SBTTL RESTORE - Conditionally release a spinlock 

994 ++ 

995 ; SMPSRESTORE ~- Conditionally release a spinlock or forklock 

996 ; SMPSRESTOREL - Conditionally release a devicelock 

997 ; 

998 ; This subroutine releases a single acquisition on a spinlock that 
999 ; another CPU may be busy-waiting on. If this is the last acquisition 
1000 ; of this spinlock by the current CPU, the spinlock is effectively 
1001 |; made available to other CPUs. 
1002; 

1003 ; Calling sequence: 
1004 ; 
1005 ; JSB/BSBx from KERNEL mode 
1006 ; 
1007 ; Input Parameters: 

1008 ; 

1009 ; RO -> The number of the lock being acquirdd for entry SMPS$RESTORE. 
1010 ; RO -> The spinlock structure address for entry SMPSRESTOREL. 
1011 ; 

1012 ; Implicit Inputs: 

1013 ; 

1014 ; IPL must be greater than ASTDEL and must be no lower than the IPL 
1015 ; at which the spinlock had originally been acquired. 
1016 ; 

1017 ; Implicit Outputs: 

1018 ; 

1019 ; The appropriate interlocked bit is cleared for the spinlock. 
1020 ; 

1021 ; Side Effects: 

1022 ; 
1023 ; The spinlock becomes available for another CPU to acquire if the 
1024 ; ownership count drops far enough. 

1025 ; 

1026 ;-- 
1027 

1123 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 15 
X-86 RESTORE - Conditionally release a spinlo 1-APR~1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 ( 


1141 

1142 -ENABL LSB 

1143 ; 

1144 ; SPINLOCK RESTORE ENTRY POINTS 

1145 ; 

1146 

1147 -ALIGN LONG 

1148 UNIVERSAL_SYMBOL SMP SRESTORE 

1149 ;SMPSRESTORE:: 7 Remove one acquisition 
1150 MOVL W“SMPSGL_SPNLKVEC [RO] , RO 3 Get spinlock address in RO 
1151 

1152 UNIVERSAL_SYMBOL SMP SRESTOREL 

1153 ;SMPSRESTOREL:: 

1154 ; 

1155 ; Decrement ownership count, leave if still owned 

1156 ; 

1157 DECW SPLSW_OWN_CNT (RO) 3; One less lock of database 
1158 BLSS RELEASE 3; Br if no locks left 
1159 RSB ; 

1160 

1161 -DSABL . LSB 

1162 

1164 

1166 


DIGITAL INTERNAL USE ONLY 343 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 16 
X-86 RELEASE ~- Release a spinlock 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 (10) 


1168 -SBTTL RELEASE - Release a spinlock 

1169 ;++ 

1170 ; SMPSRELEASE - Release a spinlock or forklock 

1171 ; SMPS$RELEASEL - Release a devicelock 

1172 ; 

1173 ; This subroutine completely releases a spinlock that another CPU may 
1174 ; be busy-waiting on in a single operation. That is, the spinlock may 
1175 ; have been acquired multiple times by the current CPU, this CPU uses 
1176 ; this subroutine to release all acquisitions of this spinlock all at 
1177 ; once. 

1178 ; 

1179 ; Calling sequence: 

1180 ; 

1181 ; JSB/BSBx from KERNEL mode 

1182 ; 

1183 ; Input Parameters: 

1184 ; 

1185 ; RO -> The number of the lock being acquired for entry SMPSRELEASE. 
1186 ; RO -> The spinlock structure address for entry SMPS$RELEASEL. 

1187 ; 

1188 ; Implicit Inputs: 

1189 ; 

1190 ; IPL must be greater than ASTDEL and must be no lower than the IPL 
1191 ; at which the spinlock had originally been acquired. 

1192 ; 

1193 ; Implicit Outputs: 

1194 ; 

1195 ; The appropriate interlocked bit is cleared for the spinlock. 

1196 ; 

1197 ; Side Effects: 

1198 ; 

1199 ;-- 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 17 
X-86 RELEASE - Release a spinlock 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 (11) 


1325 

1342 

1343 -ENABLE LSB 

1344 ; 

1345 ; SPINLOCK RELEASE ENTRY POINTS 

1346 ; 

1347 

1348 -ALIGN LONG 

1349 UNIVERSAL_SYMBOL SMP$RELEASE 

1350 ;SMPSRELEASE: : 7 Release spinlock 

1351 MOVL W*SMPS$GL_SPNLKVEC [RO], RO 3 Get spinlock address in RO 
1352 

1353 UNIVERSAL_SYMBOL SMPSRELEASEL 

1354 ;SMPSRELEASEL: : 

1355 MCOMW #0, SPLSW_OWN_CNT (RO) 7 Release spinlock completely 
1356 

1357 RELEASE: 

1358 

1359 CLRL SPLS$L_OWN_CPU (RO) 3 Invalidate owner CPU field 
1360 : 

1361 ; The spinlock is now released by virtue of the interlock bit changing 

1362 ; from 1 to 0. 

1363 

1364 BBCCI #SPLSV_INTERLOCK, - # Unlock spinlock data structure 
1365 SPLS$B_SPINLOCK (RO) , 60$ 2 

1366 50S: RSB 

1367 

1368 608: BUG CHECK SPLRELERR, FATAL ; Error releasing spinlock 
1369 -DSABL LSB 

1370 

1372 


DIGITAL INTERNAL USE ONLY 345 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 18 
X-86 REI CHECK - Check spinlock database cons 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 | 


1375 -SBTTL REI_CHECK - Check spinlock database consistency 

1376 ++ : 

1377 ; SMPS$REI_CHECK - Check spinlock database consistency 

1378 ; 

1379 ; This subroutine makes sure that all locks are released before 

1380 ; performing an REI. 

1381 ; 

1382 ; If the current mode is USER, SUPERVISOR or EXECUTIVE, this 

1383 ; routine assumes that no spinlocks are held by this CPU and 

1384 ; simply REIs for the caller. 

1385 ; 

1386 ; Calling sequence: 

1387 ; 

1388 ; JSB/BSBx G*SMPS$REI_CHECK from any mode 

1389 ; 

1390 ; NOTE - Although we get here via a JSB, the return PC is popped from 
1391 ; the stack just prior to performing the REI. The reason that 
1392 ; there is a JSB rather than a JMP is so we can see where the 
1393 ; bad REI was being performed. 

1394 ; 

1395 ; Input Parameters: 

1396 ; 

1397 ; 0O(SP) = Caller return address 

1398 ; 4(SP) = PC for REI instruction 

1399 ; 8(SP) = PSL for REI instruction 

1400 ; 

1401 ; Implicit Inputs: 

1402 ; 

1403 ; Implicit Outputs: 

1404 ; 

1405 ; This code does not return to the caller. An REI to the PC/PSL 

1406 ; pair below the caller’s return address on the stack is executed. 
1407 ; 

1408 ; Side Effects: 

1409 ; 

1410 ; *eETBSERS 

1411 ; 

1412 ;-- 

1413 

1446 

1447 UNIVERSAL_SYMBOL SMPSREI_ CHECK 

1448 ;SMPSREI_CHECK:: ? Verify spinlock IPL usage 

1449 TSTL (SP) + 7 Clean caller’s address from stack 
1450 REI ? Return from exception or interrupt 
1451 
1453 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 19 
X-86 NOLOCKS - Make sure no spinlocks are hel 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 ( 


1455 »SBTTL NOLOCKS ~ Make sure no spinlocks are held 
1456 ++ 

1457 ; SMPSNOLOCKS - Make sure no spinlocks are owned. 
1458 ; 

1459 ; This subroutine makes sure that no spinlocks are held by this CPU 
1460 ; at or above the current IPL. 

1461 ; 

1462 ; Calling sequence: 

1463 ; 

1464 ; JSB/BSBx from KERNEL mode 

1465 ; 

1466 ; Input Parameters: 

1467 ; 

1468 ; None 

1469 ; 

1470 ; Implicit Inputs: 

1471 ; 

1472 ; Spinlock database. 

1473 ; IPL must be greater than ASTDEL. 

1474 ; 

1475 ; Implicit Outputs: 

1476 ; 

1477 ; None 

1478 ; 

1479 ; Side Effects: 

1480 ; 

1481 ; e*KTBS RK 

1482 ; 

1483 ;-- 

1484 

1505 

1506 UNIVERSAL_SYMBOL SMP SNOLOCKS 

1507 ;SMPSNOLOCKS:: 

1508 RSB + Return to caller 
1509 


DIGITAL INTERNAL USE ONLY 347 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 20 
X-86 SMPSCHKLOCK - Make sure spinlock is owne 1-APR-1988 09:19:41 [SYS.SRC] SPINLOCKS.MAR;1 { 


1512 -SBTTL SMPSCHKLOCK - Make sure spinlock is owned before proceeding 
1523 7++ 

1514 ; SMPSCHKLOCK - Make sure spinlock is owned by this CPU before proceeding 
1515 ; 

1516 ; This subroutine makes sure that a specified spinlock is owned 
1517 ; by the current CPU before proceeding. 

1518 ; 

1519 ; Calling sequence: 

1520 ; 

1521 ; JSB/BSBx from KERNEL mode 

1522 ; 

1523 ; Input Parameters: 

1524 ; 

1525 ; RO = Spinlock index 

1526 ; 

1527 ; Implicit Inputs: 

1528 ; ; 

1529 ; Spinlock database. 

1530 ; 

1531 ; Implicit Outputs: 

1532 ; 

1533 ; IPL must be greater than ASTDEL. 

1534 ; 

1535 ; Side Effects: 

1536 ; 

1537 ; RO is altered 

1538 ; 

1539 ;-- 

1581 

1582 UNIVERSAL_SYMBOL SMP$CHKLOCK 

1583 ;SMPSCHKLOCK:: 7 Verify ownership of specified lock 
1584 RSB ? Return to caller 

1585 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS ~- Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 21 
X-86 ALLOC SPL - Allocate a spinlock 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 (15) 


1588 
1589 
1590 
1591 
1592 
1593 
1594 
1595 
1596 
1597 
1598 
1599 
1600 
1601 
1602 
1603 
1604 
1605 
1606 
1607 
1608 
1609 
1610 
1611 
1612 
1613 
1614 
1615 
1616 
1617 
1618 
1619 
1620 
1621 
1622 
1623 
1624 
1625 
1626 
1627 
1628 
1629 
1630 
1631 
1632 
1633 
1634 
1635 
1636 
1637 


me Ye Ye te Ye Ye Ye Ye Ve We Ye Be We Ye Ye Ye Ne Ye Ye Ve We We Ve Vea Ye Ye We Ye Ve Be Re 


90$: POPR #°M<R3, R4,R5> 


1108: MOVZWL #SS$_INSFMEM, RO 


-SBTTL ALLOC_SPL - Allocate a spinlock 


+ 
+ 


SMPSALLOC_SPL - Allocate a dynamic spinlock 


This subroutine allocates a dynamic spinlock and zeroes the structure. 


Calling sequence: 

JSB/BSBx from KERNEL mode 
Inputs: 

None. 
Implicit Inputs: 

Spinlock database. 


Outputs: 


RO = status of request, SS$_ SUCCESS or SS$_ 


R2 = address of structure on success 
Implicit Outputs: 

None 
Side Effects: 


R1 is destroyed. 


UNIVERSAL_SYMBOL SMPSALLOC_SPL 


;SMPS$ALLOC_SPL:: 


PUSHR #°M<R3,R4, R5> 
MOVZBL #SPLSK_LENGTH, Rl 


ce 
JSB G“EXESALONONPAGED : 
BLBC RO, 110$ ? 
PUSHL R2 ; 
Movcs5 #0, (SP), #0,R1, (R2) 2 
POPL R2 ; 


INSFMEM 


Save registers 
Get size of spinlock structure 


Allocate the structure 
Exit if error 


Save spinlock address 
Zero the structure 
Save spinlock address 


MOVL #<<SPLSC_SPL BV EYACEUUCR GS Art SP TRECs SPL@16>!SPLS$C_LENGTH>, - 


SPLSW | SIZE (R2) 
MOVZBL #1,RO_ 


=e 


we Ne 


RSB 


we Ne 


BRB 90$ 


Set data structure information 
Return success 
Restore registers 


Return error code 
Leave 


DIGITAL INTERNAL USE ONLY 349 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 22 
X-86 INIT SPL - Initialize a spinlock 1-APR-1988 09:19:41 [SYS.SRC] SPINLOCKS.MAR;1 (16) 


1639 -SBTTL INIT SPL - Initialize a spinlock 
1640 ;++ 
1641 ; SMPSINIT SPL - Initialize a dynamic spinlock 
1642 ; 
1643 ; This subroutine initializes a dynamic spinlock and zeroes the structure. 
1644 ; : 
1645 ; Calling sequence: 
1646 ; 
1647 ; JSB/BSBx from KERNEL mode 
1648 ; 
1649 ; Inputs: 
1650 ; 
1651 ; None. 
1652 ; 
1653 ; Implicit Inputs: 
1654 ; 
1655 ; Spinlock database. 
1656 ; 
1657 ; Outputs: 
1658 ; 
1659 ; RO = IPL for spinlock 
1660 ; 
1661 ; Implicit Outputs: 
1662 ; 
- 1663 ; None 
1664 ; 
1665 ; Side Effects: 
1666 ; 
1667 ; None. 
1668 ; 
1669 ;-- 
1670 
1671 UNIVERSAL_SYMBOL SMPSINIT_ SPL 
1672 ;SMPSINIT_SPL:: 
1673 MOVB RO, SPL$B_IPL(R2) ; Initialize IPL for spinlock 
1674 MCOMB #0,SPLSB_RANK(R2) ? Initialize rank field 
1675 MCOMW =e #0, SPLSW_ OWN_CNT (R2) # Initialize ownership 
1676 CLRL SPLSL_! OWN | CPU (R2) 7 No cpu owner 
1677 
1678 ASSUME SPLSW_SIZE+2 EQ SPLSB_TYPE 
1679 ASSUME SPLSB | TYPE+1 EQ SPLSB __ SUBTYPE 
1680 MOVL #<<SPLSC_ SPL , DEVICELOCK@24>!<DYNS$C , SPL@16>! SPLS$C_LENGTH>, - 
1681 SPLSW | SIZE (R2) ; Set data structure information 
1682 © CMPB SPL$B_IPL(R2), #IPL$_SCs 3 locks at IPL <= 8 get long 
1683 BGTRO 10$ 3 timeout interval 
1684 MOVL G*SGNSGL_SMP_LNGSPINWAIT, - 
1685 SPLSL_' TIMO )_INT (R2) 3 set up LONG timeout interval 
1686 RSB # Return to caller 
1687 10S: MOVL G“SGNS$GL_SMP_SPINWAIT, - 
1688 SPLSL_' TIMO )_INT(R2) 7 set up timeout interval 
1689 RSB ; Return to caller 
1690 
350 DIGITAL INTERNAL USE ONLY 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 23 
X-86 ADJUST_IPL - ADJUST THE IPT. OF A LOCK, A 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 ( 


1692 -SBTTL ADJUST_IPL - ADJUST THE IPL OF A LOCK, ALTER RANKS ACCORDINGLY 
1693 

1694 ¢+++ 

1695 ; SMPSADJUST IPL - Alter IPL of a static lock as required to 

1696 ; preserve integrity of the acquisition process. 
1697 ; This requires the lock’s rank to remain unchanged. 
(1698 ; 

1699 ; INPUT: Calling environment: JSB/BSBx 

1700 ; RO: Lock address 

1701 ; Rl: New IPL 

1702 ; 

1703 ; OUTPUT: 

1704 ; RO has LBS on success. If RO has LBC on exit, non-fatal error. 

1705 ; 

1706 ; Implicit output: Ranks of locks will shuffle to accomodate new 

1707 ; placement of the passed lock; passed lock will be given passed 

1708 ; IPL. 

1709 ; 

1710 ; NOTES: 

1711 ; Fatal errors exit via BUG CHECK . 

1712 ; 

1713 3--~ 

1714 

1715 -ENABL LSB 

1716 

1717 UNIVERSAL SYMBOL SMPSADJUST_IPL 

1718 

1719 ;SMPS$ADJUST_IPL:: 

1720 

1721 PUSHR #°M<R2,R3, R4> 7 RO, R1 destroyed during operation. 
1722 

1723 MOVL RO, R2 7; Keep address in a safe register 
1724 MOVL R1,R4 3; Keep IPL in a safe register 

1725 ; 

1726 ; Firewall code: Verify (address) to be a spinlock and bounds check the IPL. 
1727 ; 

1728 CMPW #SPLSC_LENGTH, SPL$W_SIZE (R2) 7 This thing the right size? 
1729 BNEQU 10$ 3; NEQ: No! 

1730 CMPB #DYNS$C_SPL, SPL$B_TYPE (R2) ; This thing an SPL? 

1731 BEQL 20$ 7 NEQ: No! ; 

1732 108: BUG CHECK SPLNOTSPL, FATAL 7 Bug out: invalid structure. 
1733 

1734 208: CMPB R4,#IPL$ RESCHED 3 Now check IPL. 

1735 BLSSU 30$ 

1736 CMPB R4, #31 3 Accept only 3 <= IPL <= 31. 

1737 BLEQU 40$ 

1738 308: BUG CHECK SPLINVIPL, FATAL ? Bug out: invalid IPL. 

1739 ; 

1740 ; Load flag value into R3. A zeroed R3 will mean RAISE THE IPL. 

1741 ; 

1742 40S: CLRL R3 7; Assume we will RAISE IPL. 

1743 CMPB SPLSB_IPL(R2),R4 3; Are we changing IPL to same IPL? 
1744 BEQL EXIT SUCCESS 7 EQL: yes, so do nothing, just exit. 
1745 BLSSU 60$ 7 GTRU : We are lowering the IPL. 
1746 INCL R3 3 Set R3 non-zero for LOWERING IPL. 
1747 608: MOVZWL #SPL$_MIN_ INDEX, R1 3; Start at first index. 

1748 70S: CMPL W“SMPS$GL_SPNLKVEC[R1],R2 ; Scan spinlock vector to find match. 


DIGITAL INTERNAL USE ONLY 351 


CONFIDENTIAL AND PROPRIETARY 
DIGITAL EQUIPMENT CORPORATION 


SPINLOCKS - Spinlock routines for VMS/SMP 10-MAY-1989 16:58:37 VAX MACRO V5.0-8 Page 24 
X-86 ADJUST IPL - ADJUST THE IPL OF A LOCK, A 1-APR-1988 09:19:41 [SYS.SRC]SPINLOCKS.MAR;1 ( 


1749 BEQL 80$ 7 If equal, Rl holds our map index. 
1750 AOBLSS #SPL$ MAX INDEX,R1,70$ ; Loop until end or branch-exit. 
1751 ; 

1752 ; If we get here, trouble - the passed lock was not in the vector. 

1753 ; 

1754 BUG CHECK SPLNOTMAP, FATAL # Bugheck, lock was not found. 
1755 ; 

1756 ; Register assignments are as follows: 

1757 ; 

1758 ; Rl -- will hold index of lock above/below passed lock. 

1759 ; R2 -- passed lock address. 

1760 ; R3 -- contains zero if we are raising IPL, nonzero otherwise. 

1761 ; R4 -- new ipl for passed lock. 

1762 ; 

1763 808: TSTL R3 # Is the next lock above or below? 
1764 BNEQ 90$ 3 NEQ, below; EQL, above. 

1765 828: DECL R1 ? Move index down to next lock. 
1766 BLSS EXIT IPL 3 Off the low end? Then done. 

1767 MOVL W*SMPS$GL_SPNLKVEC(R1),RO ; Get address of ‘next’ spinlock 
1768 BGEQ 82$ # Valid locks are in SO space 
1769 CMPB R4,SPL$B_IPL(RO) 7 Compare against new IPL. 

1770 BLEQ EXIT_IPL ? If new IPL > other’s IPL, 

1771 3 vank would have to change. 

1772 858: BUG CHECK SPLINVIPL, FATAL 7 Bugcheck on attempted rank changes. 
1773 

1774 90$: INCL Ri 7 Move index up to next lock. 

1775 CMPL § #SPL$_MAX_INDEX,R1 ; Off the high end? 

1776 BGEQ EXIT_IPL 7 GEQ: Yes. Then done. 

1777 MOVL W“SMPSGL_SPNLKVEC[R1],RO ; Get address of higher spinlock 
1778 BGEQ 90$ ? Valid locks are in SO space 
1779 CMPB R4,SPLSB_IPL(RO) 7 Compare against new IPL. 

1780 BLSS 85$ 3; If new IPL < other’s IPL, fatal error. 
1781 

1782 EXIT_IPL: 

1783 MOVB R4,SPLSB_IPL(R2) ? Store new IPL into passed lock. 
1784 EXIT_SUCCESS: 

1785 MOVZBL S*#SS$_NORMAL, RO # Indicate successful exit. 

1786 EXIT: POPR #“M<R2, R3,R4> + Restore registers and ... 

1787 RSB 3 .-- exit. RO has LBS on success. 
1788 

1789 -DSABL LSB 

1790 


1791 -END