1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 init_pvt:
29 procedure;
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65 dcl char4 char (4) aligned;
66 dcl dcp (32) pointer unaligned;
67
68
69 dcl device_type fixed bin;
70 dcl drive_idx fixed bin;
71 dcl driveno fixed bin;
72 dcl group_idx fixed bin;
73 dcl max_driveno fixed bin;
74 dcl nd fixed bin;
75 dcl pri_pvtep ptr;
76 dcl pri_tx fixed bin;
77 dcl partition char (4);
78 dcl ss_drive_count fixed bin;
79 dcl subsys (32) char (4) aligned;
80
81 dcl subsys_idx fixed bin;
82 dcl sv_cur fixed bin;
83 dcl swap bit (1) aligned;
84 dcl tx fixed bin;
85
86 dcl sst$write_limit fixed bin (35) ext static;
87
88 dcl config_$find entry (char (4) aligned, ptr);
89 dcl config_$find_parm entry (char (4) aligned, ptr);
90
91 dcl page$init ext entry (fixed bin, ptr);
92 dcl syserr entry options (variable);
93
94 dcl WHOAMI char (32) internal static options (constant) init ("init_pvt");
95 dcl MAX_DRIVES_PER_SUBSYSTEM
96 fixed bin init (32) int static options (constant);
97
98 dcl (
99 VOLMAP_LOCK_WAIT_CONSTANT
100 init ("444000000000"b3),
101 VOLMAP_IDLE_WAIT_CONSTANT
102 init ("445000000000"b3),
103 VTOC_MAP_LOCK_WAIT_CONSTANT
104 init ("446000000000"b3)
105 ) bit (36) aligned int static options (constant);
106
107
108 dcl (addr, addrel, clock, divide, hbound, max, null, ptr, size, substr)
109 builtin;
110
111
112 %page;
113
114
115
116
117 pvtp = addr (pvt$);
118 pvt_arrayp = addr (pvt.array);
119 pvt.time_of_bootload = clock ();
120 pvt.volmap_lock_wait_constant = VOLMAP_LOCK_WAIT_CONSTANT;
121 pvt.volmap_idle_wait_constant = VOLMAP_IDLE_WAIT_CONSTANT;
122 pvt.vtoc_map_lock_wait_constant = VTOC_MAP_LOCK_WAIT_CONSTANT;
123
124 pvt.root_pvid = ""b;
125 pvt.root_pvtx = -1;
126 pvt.root_vtocx = -1;
127
128
129
130 nd = 0;
131 prph_dsk_cardp = null;
132 NEXT_DISK_CARD:
133 call config_$find (PRPH_CARD_WORD, prph_dsk_cardp);
134
135 if prph_dsk_cardp ^= null
136 then do;
137 if substr (prph_dsk_card.name, 1, 3) ^= "dsk"
138 then goto NEXT_DISK_CARD;
139
140 do subsys_idx = 1 to nd;
141 if subsys (subsys_idx) = prph_dsk_card.name
142 then call syserr (CRASH, "^a: Duplicate prph ^a card.", WHOAMI, prph_dsk_card.name);
143 end;
144
145 nd = nd + 1;
146 if nd > hbound (subsys, 1)
147 then
148 call syserr (CRASH, "^a: Too many disk subsystems configured. Limit is ^d.", WHOAMI,
149 hbound (subsys, 1));
150
151 subsys (nd) = prph_dsk_card.name;
152 dcp (nd) = prph_dsk_cardp;
153 goto NEXT_DISK_CARD;
154 end;
155
156 if nd = 0
157 then
158 call syserr (CRASH, "^a: no PRPH DSKn cards", WHOAMI);
159
160
161
162 swap = "1"b;
163 do while (swap);
164 swap = "0"b;
165 do subsys_idx = 1 to nd - 1;
166 if subsys (subsys_idx) > subsys (subsys_idx + 1)
167 then do;
168 swap = "1"b;
169 prph_dsk_cardp = dcp (subsys_idx);
170 dcp (subsys_idx) = dcp (subsys_idx + 1);
171 dcp (subsys_idx + 1) = prph_dsk_cardp;
172
173 char4 = subsys (subsys_idx);
174 subsys (subsys_idx) = subsys (subsys_idx + 1);
175 subsys (subsys_idx + 1) = char4;
176 end;
177 end;
178 end;
179 ^L
180
181
182
183 stock_segp = addr (stock_seg$);
184 stock_seg.record_stock_arrayp = ptr (stock_segp, size (stock_seg));
185 stock_seg.vtoce_stock_arrayp =
186 addrel (stock_seg.record_stock_arrayp, stock_seg.n_stock_entries * stock_seg.record_stock_size);
187 ^L
188
189
190
191 tx = 0;
192 SUBSYS_LOOP:
193 do subsys_idx = 1 to nd;
194 prph_dsk_cardp = dcp (subsys_idx);
195 if IS_FIPS_DEVICE ()
196 then do;
197 driveno = -1;
198 max_driveno = 31;
199 end;
200 else do;
201 driveno = 0;
202 max_driveno = 63;
203 end;
204 ss_drive_count = 0;
205 GROUP_LOOP:
206 do group_idx = 1 to hbound (prph_dsk_card_array.group, 1);
207
208 if prph_dsk_card.group (group_idx).ndrives = -1
209
210 then call syserr (CRASH, "^a: Missing ndrives field on config card for ^a subsystem.", WHOAMI,
211 prph_dsk_card.name);
212
213 if prph_dsk_card.group (group_idx).model = -1
214 then call syserr (CRASH, "^a: Missing model field on config card for ^a subsystem.", WHOAMI,
215 prph_dsk_card.name);
216 if prph_dsk_card.group (group_idx).model = 0
217 then do;
218
219 driveno = driveno + prph_dsk_card.group (group_idx).ndrives;
220 goto NEXT_DRIVE_GROUP;
221 end;
222
223 do device_type = 1 to hbound (MODEL, 1)
224 while (prph_dsk_card.group (group_idx).model ^= MODEL (device_type));
225 end;
226 if device_type > hbound (MODEL, 1)
227 then do;
228 call syserr (CRASH, "init_pvt: Unknown model number ^d on prph ^a",
229 prph_dsk_card.group (group_idx).model, prph_dsk_card.name);
230 end;
231 device_type = MODELX (device_type);
232
233 DRIVE_LOOP:
234 do drive_idx = 1 to prph_dsk_card.group (group_idx).ndrives;
235
236 driveno = driveno + 1;
237
238 if driveno > max_driveno
239 then call syserr (CRASH, "^a: ^a contains a drive number higher than ^d.", WHOAMI,
240 prph_dsk_card.name, max_driveno);
241 ss_drive_count = ss_drive_count + 1;
242 if ss_drive_count > MAX_DRIVES_PER_SUBSYSTEM
243 then call syserr (CRASH, "^a: More than ^d drives defined for ^a.", WHOAMI,
244 MAX_DRIVES_PER_SUBSYSTEM, prph_dsk_card.name);
245 tx = tx + 1;
246 pvtep = addr (pvt_array (tx));
247 pvte.devname = prph_dsk_card.name;
248 pvte.logical_area_number = driveno;
249 pvte.device_type = device_type;
250 pvte.storage_system = "1"b;
251 pvte.curn_dmpr_vtocx (*) = -1;
252 pvte.volmap_stock_ptr = null ();
253 pvte.vtoc_map_stock_ptr = null ();
254 pvte.is_sv = (number_of_sv (device_type) >= 2);
255 pvte.num_of_svs = number_of_sv (device_type);
256 pvte.removable_pack = media_removable (device_type);
257 pvte.records_per_cyl = rec_per_cyl (device_type);
258 pri_tx = tx;
259 pri_pvtep = pvtep;
260 if pvte.is_sv
261 then do;
262 pvte.sv_num = 0;
263 pvte.sv_name = valid_sv_array (pvte.sv_num);
264 pvte.record_factor = pvte.sv_num * rec_per_cyl (device_type);
265 call page$init (pri_tx, prph_dsk_cardp);
266
267 do sv_cur = 2 to number_of_sv (device_type);
268 tx = tx + 1;
269 pvtep = addr (pvt_array (tx));
270 pvte = pri_pvtep -> pvte;
271
272 pvte.sv_num = sv_cur - 1;
273
274 pvte.sv_name = valid_sv_array (pvte.sv_num);
275 pvte.record_factor = pvte.sv_num * rec_per_cyl (device_type);
276
277 end;
278 end;
279 else do;
280 pvte.sv_num = -1;
281 pvte.record_factor = 0;
282 pvte.sv_name = " ";
283 call page$init (pri_tx, prph_dsk_cardp);
284
285 end;
286
287 end DRIVE_LOOP;
288 NEXT_DRIVE_GROUP:
289 end GROUP_LOOP;
290 end SUBSYS_LOOP;
291
292
293 pvt.n_entries = tx;
294
295 if sys_info$collection_1_phase = SERVICE_INITIALIZATION
296 then do;
297 sst$write_limit = 53 + max (0, 47 * (nd - 1));
298
299
300 call config_$find_parm ("wlim", parm_ptr);
301
302 if parm_ptr ^= null ()
303 then
304 if (numeric_parm.value < 2000) & (numeric_parm.value > 4)
305 then
306 sst$write_limit = numeric_parm.value;
307 else call syserr (BEEP, "^a: Invalid parm wlim value ^d. Default of ^d used.", WHOAMI,
308 numeric_parm.value, sst$write_limit);
309 end;
310 return;
311
312
313 %page;
314 IS_FIPS_DEVICE:
315 proc () returns (bit (1));
316
317
318
319
320
321 dcl (i, j) fixed bin;
322
323 do j = 1 to hbound (prph_dsk_card.group,1);
324 if prph_dsk_card.group(j).model ^= 0 then do;
325 do i = 1 to config_data_$disk_drive_model_names.count;
326 if config_data_$disk_drive_model_names.names (i).model =
327 prph_dsk_card.group (j).model then
328 return (config_data_$disk_drive_model_names.names (i).device_0_valid);
329 end;
330 end;
331 end;
332 return ("0"b);
333 end IS_FIPS_DEVICE;
334 %page; %include collection_1_phases;
335 %page; %include config_prph_dsk_card;
336 %include config_prph_card;
337 %include config_parm_card;
338 %page; %include config_data_dcls;
339 %page; %include fs_dev_types;
340 %page; %include pvt;
341 %page; %include pvte;
342 %page; %include stock_seg;
343 %page; %include syserr_constants;
344 %page;
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
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
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460 end init_pvt;