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 debug
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 initialize_faults:
53 procedure;
54
55
56
57 dcl sctptr ptr;
58 dcl sctp (0:1023) ptr unal based;
59
60 dcl core_map$ ext bit (36);
61 dcl copy_on_write_handler_$copy_on_write_handler_ ext entry;
62 dcl dseg$ (0:4095) fixed bin (71) ext;
63 dcl emergency_shutdown$ ext bit (36);
64 dcl fault_vector$ ext bit (36);
65 dcl fim$drl_entry entry ext;
66 dcl fim$onc_start_shut_entry entry ext;
67 dcl fim$parity_entry entry ext;
68 dcl fim$signal_entry entry ext;
69 dcl fim$access_violation_entry entry ext;
70 dcl fim$primary_fault_entry entry ext;
71 dcl hardcore_sct_seg$hardcore_sct_seg ext fixed bin;
72 dcl iom_interrupt$interrupt_entry entry ext;
73 dcl isot_fault_handler_$isot_fault_handler_ ext entry;
74 dcl lot_fault_handler_$lot_fault_handler_ ext entry;
75 dcl pds$stack_0_ptr ptr ext;
76 dcl 1 pds$fim_data aligned like mc external;
77 dcl 1 pds$page_fault_data aligned like mc external;
78 dcl 1 pds$signal_data aligned like mc external;
79 dcl 1 prds$fim_data aligned like mc external;
80 dcl prds$fast_connect_code entry external;
81 dcl 1 prds$ignore_data aligned like scu external;
82 dcl prds$ignore_pl (8) bit (36) aligned external;
83 dcl 1 prds$interrupt_data aligned like mc external;
84 dcl 1 prds$sys_trouble_data aligned like mc external;
85 dcl return_to_ring_0_$restart_fault_ptr ptr ext;
86 dcl signal_$signal_ entry external;
87 dcl tc_data$ bit (36) aligned external;
88 dcl wired_fim$xec_fault entry external;
89 dcl wired_fim$unexp_fault entry external;
90 dcl wired_fim$ignore entry external;
91 dcl page_fault$fault entry external;
92 dcl wired_fim$timer_runout entry external;
93
94 dcl (
95 emergency_shutdown$lp,
96 emergency_shutdown$pp,
97 fim$prs,
98 fim$scu,
99 fim$sig_prs,
100 fim$sig_scu,
101 fim$lp,
102 iom_interrupt$iilink,
103 iom_interrupt$prds_prs,
104 iom_interrupt$prds_scu,
105 page_fault$my_lp,
106 pds$apt_ptr,
107 restart_fault$,
108 restart_fault$lp,
109 restart_fault$scu,
110 wired_fim$prs,
111 wired_fim$scuinfo,
112 wired_fim$trouble_prs,
113 wired_fim$trouble_scuinfo,
114 wired_fim$int_scuinfo,
115 wired_fim$ignore_pl,
116 wired_fim$ignore_scuinfo,
117 wired_fim$my_linkage_ptr,
118 page_fault$cme_offsets,
119 page_fault$pf_prs,
120 page_fault$pf_scuinfo
121 ) pointer external;
122
123
124 dcl cme_offsets (0:size (cme) - 1) ptr based (addr (page_fault$cme_offsets));
125
126 dcl lot$ (0:1023) pointer unaligned external static;
127
128 dcl privileged_mode_ut$cam_both ext entry,
129 privileged_mode_ut$set_mask entry (bit (72) aligned, fixed bin (71)),
130
131 privileged_mode_ut$ldt ext entry (fixed bin);
132
133 dcl sdw_util_$get_access entry (ptr, bit (4) unaligned);
134 dcl sdw_util_$set_access entry (ptr, bit (4) unaligned);
135
136
137 dcl (
138 ignore_ptr,
139 ignore_d_ptr,
140 primary_trap,
141 primary_scup,
142 signal_trap,
143 signal_scup,
144 onc_trap,
145 onc_scup,
146 unexp_trap,
147 unexp_scup,
148 p
149 ) ptr;
150
151 dcl i fixed bin (5);
152 dcl access bit (4);
153
154 dcl (addr, baseno, baseptr, codeptr, fixed, null, ptr, size) builtin;
155
156 declare (
157 initialize_faults_data$primary_one,
158 initialize_faults_data$primary_two,
159 initialize_faults_data$signal_one,
160 initialize_faults_data$signal_two,
161 initialize_faults_data$onc_one,
162 initialize_faults_data$onc_two
163 ) (0:31) bit (1) unaligned ext static;
164 ^L
165
166
167
168
169
170 fault_init_one:
171 entry;
172
173
174
175 call GET_STANDARD_POINTERS;
176
177
178 do i = 0 to 31;
179
180 if initialize_faults_data$primary_one (i)
181 then do;
182 fv.f_tra_ptr (i) = primary_trap;
183 fv.f_scu_ptr (i) = primary_scup;
184 end;
185 else if initialize_faults_data$signal_one (i)
186 then do;
187 fv.f_tra_ptr (i) = signal_trap;
188 fv.f_scu_ptr (i) = signal_scup;
189 end;
190 else if initialize_faults_data$onc_one (i)
191 then do;
192 fv.f_tra_ptr (i) = onc_trap;
193 fv.f_scu_ptr (i) = onc_scup;
194 end;
195 else do;
196 fv.f_tra_ptr (i) = unexp_trap;
197 fv.f_scu_ptr (i) = unexp_scup;
198 end;
199
200
201 fv.i_tra_ptr (i) = ignore_ptr;
202 fv.i_scu_ptr (i) = ignore_d_ptr;
203
204 end;
205
206 fv.f_tra_ptr (FAULT_NO_LUF) = ignore_ptr;
207 fv.f_scu_ptr (FAULT_NO_LUF) = ignore_d_ptr;
208
209 fv.f_tra_ptr (FAULT_NO_TRO) = ignore_ptr;
210 fv.f_scu_ptr (FAULT_NO_TRO) = ignore_d_ptr;
211
212
213 fv.f_tra_ptr (FAULT_NO_EXF) = codeptr (wired_fim$xec_fault);
214 fv.f_scu_ptr (FAULT_NO_EXF) = addr (prds$sys_trouble_data.scu);
215
216
217 fv.f_tra_ptr (FAULT_NO_DF1) = codeptr (page_fault$fault);
218 fv.f_scu_ptr (FAULT_NO_DF1) = addr (pds$page_fault_data.scu);
219
220
221 fv.f_tra_ptr (FAULT_NO_DF0) = codeptr (fim$primary_fault_entry);
222 fv.f_scu_ptr (FAULT_NO_DF0) = addr (addr (pds$fim_data) -> mc.scu (0));
223
224
225 fv.f_tra_ptr (FAULT_NO_CON) = codeptr (prds$fast_connect_code);
226 fv.f_scu_ptr (FAULT_NO_CON) = addr (prds$fim_data.scu);
227
228
229
230 fv.f_tra_ptr (FAULT_NO_DRL) = addr (fim$drl_entry);
231
232
233
234 call set_access (fim$prs);
235 fim$prs = addr (pds$fim_data);
236 fim$scu = addr (pds$fim_data.scu);
237 fim$sig_prs = addr (pds$signal_data);
238 fim$sig_scu = addr (pds$signal_data.scu);
239 call set_lp (fim$lp);
240
241
242
243 call set_access (iom_interrupt$prds_prs);
244
245 iom_interrupt$prds_prs = addr (prds$interrupt_data);
246
247 iom_interrupt$prds_scu = addr (prds$interrupt_data.scu);
248
249 call set_lp (iom_interrupt$iilink);
250
251
252
253 call set_access (wired_fim$prs);
254
255 wired_fim$prs = addr (prds$fim_data);
256 wired_fim$scuinfo = addr (prds$fim_data.scu);
257
258
259 wired_fim$trouble_prs = addr (prds$sys_trouble_data);
260
261 wired_fim$trouble_scuinfo = addr (prds$sys_trouble_data.scu);
262
263
264 wired_fim$int_scuinfo = addr (pds$page_fault_data.scu);
265
266
267 wired_fim$ignore_pl = addr (prds$ignore_pl);
268 wired_fim$ignore_scuinfo = ignore_d_ptr;
269
270 call set_lp (wired_fim$my_linkage_ptr);
271
272
273
274 call set_access (page_fault$my_lp);
275
276 page_fault$pf_prs = addr (pds$page_fault_data);
277 page_fault$pf_scuinfo = addr (pds$page_fault_data.scu);
278
279 cmep = null;
280 do i = 0 to size (cme) - 1;
281 cme_offsets (i) = ptr (addr (core_map$), i);
282 end;
283 call set_lp (page_fault$my_lp);
284
285
286
287 call set_access (restart_fault$scu);
288 restart_fault$scu = addr (pds$signal_data.scu);
289 call set_lp (restart_fault$lp);
290
291
292
293 call set_access (emergency_shutdown$lp);
294 emergency_shutdown$pp = addr (emergency_shutdown$);
295
296 call set_lp (emergency_shutdown$lp);
297
298 pds$apt_ptr = addr (tc_data$);
299
300
301
302
303 call set_access (return_to_ring_0_$restart_fault_ptr);
304
305 return_to_ring_0_$restart_fault_ptr = addr (restart_fault$);
306
307 call restore_access;
308
309
310
311
312
313 pds$stack_0_ptr = stackbaseptr ();
314 stackbaseptr () -> stack_header.signal_ptr = codeptr (signal_$signal_);
315 stackbaseptr () -> stack_header.unwinder_ptr = null;
316
317 stackbaseptr () -> stack_header.sct_ptr = addr (hardcore_sct_seg$hardcore_sct_seg);
318
319
320
321
322 fv.fpair (FAULT_NO_DRL).scu = rel (addr (fv.f_scu_ptr (FAULT_NO_DRL))) || "657220"b3;
323
324 fv.fpair (FAULT_NO_DRL).tra = rel (addr (fv.f_tra_ptr (FAULT_NO_DRL))) || "710220"b3;
325
326 scs$faults_initialized = "1"b;
327 return;
328 ^L
329
330
331
332 interrupt_init:
333 entry;
334
335
336
337 fvp = addr (fault_vector$);
338
339
340
341 call privileged_mode_ut$set_mask (scs$sys_level, 0);
342
343
344 fv.i_tra_ptr (*) = codeptr (iom_interrupt$interrupt_entry);
345 fv.i_scu_ptr (*) = addr (prds$interrupt_data.scu);
346
347
348
349 call privileged_mode_ut$set_mask (scs$open_level, 0);
350
351
352 return;
353 ^L
354
355
356
357
358 fault_init_two:
359 entry;
360
361
362 call GET_STANDARD_POINTERS;
363
364
365
366 call privileged_mode_ut$ldt (-1);
367
368
369
370 do i = 0 to 31;
371
372 if initialize_faults_data$primary_two (i)
373 then do;
374 fv.f_tra_ptr (i) = primary_trap;
375 fv.f_scu_ptr (i) = primary_scup;
376 end;
377 else if initialize_faults_data$signal_two (i)
378 then do;
379 fv.f_tra_ptr (i) = signal_trap;
380 fv.f_scu_ptr (i) = signal_scup;
381 end;
382 else if initialize_faults_data$onc_two (i)
383 then do;
384 fv.f_tra_ptr (i) = onc_trap;
385 fv.f_scu_ptr (i) = onc_scup;
386 end;
387 else if i > 25 & i < 31
388 then do;
389 fv.f_tra_ptr (i) = unexp_trap;
390 fv.f_scu_ptr (i) = unexp_scup;
391 end;
392 end;
393
394
395
396 fv.f_tra_ptr (FAULT_NO_ACV) = codeptr (fim$access_violation_entry);
397 fv.f_scu_ptr (FAULT_NO_ACV) = primary_scup;
398
399
400
401 fv.f_tra_ptr (FAULT_NO_DRL) = addr (fim$drl_entry);
402
403
404
405 fv.f_tra_ptr (FAULT_NO_TRO) = codeptr (wired_fim$timer_runout);
406 fv.f_scu_ptr (FAULT_NO_TRO) = addr (prds$fim_data.scu);
407
408
409
410 fv.f_tra_ptr (FAULT_NO_PAR) = codeptr (fim$parity_entry);
411 fv.f_scu_ptr (FAULT_NO_PAR) = primary_scup;
412
413
414
415
416 sctptr = addr (hardcore_sct_seg$hardcore_sct_seg);
417
418 sctptr -> sctp (no_write_permission_sct_index) = codeptr (copy_on_write_handler_$copy_on_write_handler_);
419 sctptr -> sctp (isot_fault_sct_index) = codeptr (isot_fault_handler_$isot_fault_handler_);
420 sctptr -> sctp (lot_fault_sct_index) = codeptr (lot_fault_handler_$lot_fault_handler_);
421
422 return;
423 %page;
424
425
426 set_lp:
427 proc (link_ptr);
428
429 dcl link_ptr ptr;
430
431 dcl segno fixed bin (15);
432 dcl target_ptr ptr;
433
434 target_ptr = addr (link_ptr);
435
436 segno = fixed (baseno (target_ptr), 18);
437 link_ptr = lot$ (segno);
438
439
440 call restore_access;
441
442 return;
443
444 end set_lp;
445
446
447
448
449
450 set_access:
451 procedure (textp);
452
453 dcl segno fixed bin (15);
454 dcl textp ptr;
455
456 segno = fixed (baseno (addr (textp)), 18);
457 call sdw_util_$get_access (addr (dseg$ (segno)), access);
458
459 call sdw_util_$set_access (addr (dseg$ (segno)), access | RW_ACCESS);
460
461 call privileged_mode_ut$cam_both;
462
463 return;
464
465
466 restore_access:
467 entry;
468
469 call sdw_util_$set_access (addr (dseg$ (segno)), access);
470
471 call privileged_mode_ut$cam_both;
472
473 return;
474
475
476 end set_access;
477
478
479 GET_STANDARD_POINTERS:
480 procedure;
481
482 fvp = addr (fault_vector$);
483 ignore_ptr = codeptr (wired_fim$ignore);
484 ignore_d_ptr = addr (prds$ignore_data);
485
486
487
488 primary_trap = codeptr (fim$primary_fault_entry);
489 primary_scup = addr (pds$fim_data.scu);
490 signal_trap = codeptr (fim$signal_entry);
491 signal_scup = addr (pds$signal_data.scu);
492 onc_trap = codeptr (fim$onc_start_shut_entry);
493 onc_scup = primary_scup;
494 unexp_trap = codeptr (wired_fim$unexp_fault);
495 unexp_scup = addr (prds$sys_trouble_data.scu);
496 end;
497
498 %page;
499 %include cmp;
500 %include fault_vector;
501 %include mc;
502 %include scs;
503 %include static_handlers;
504 %include stack_header;
505 %include access_mode_values;
506 end initialize_faults;