1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 disk_emergency: proc (a_pvtx, a_errflags);
23
24
25
26
27
28
29
30
31
32 dcl a_pvtx fixed bin;
33 dcl a_errflags bit (36) aligned;
34
35 dcl addr builtin;
36 dcl erflagbuf bit (36) aligned;
37 dcl pvtx fixed bin;
38 dcl tc_data$system_shutdown fixed bin (35) ext;
39 dcl pvt$n_entries fixed bin ext;
40 dcl syserr entry options (variable);
41 dcl (pmut$wire_and_mask, pmut$unwire_unmask) entry (fixed bin (71), ptr);
42 dcl page$time_out entry;
43 dcl disk_control$test_drive entry (fixed bin);
44
45 dcl ptwp ptr;
46 dcl oldmask fixed bin (71);
47 dcl p99 pic "99";
48 dcl masked bit (1) init ("0"b);
49
50 %include pvte;
51 %include device_error;
52
53 ^L
54
55 pvt_arrayp = addr (pvt$array);
56 pvtx = a_pvtx;
57 pvtep = addr (pvt_array (pvtx));
58 erflagbuf = a_errflags;
59 erfp = addr (erflagbuf);
60
61 if tc_data$system_shutdown = 0 then return;
62
63 if ^pvte.device_inoperative then call mark;
64 return;
65
66 ^L
67 test_all_drives_masked: entry;
68
69 masked = "1"b;
70
71
72 test_all_drives: entry;
73 pvt_arrayp = addr (pvt$array);
74 erfp = addr (erflagbuf);
75 errflags.device_inoperative = "1"b;
76
77
78 if ^masked then call pmut$wire_and_mask (oldmask, ptwp);
79
80
81 do pvtx = 1 to pvt$n_entries;
82 pvtep = addr (pvt_array (pvtx));
83 if (pvte.used | pvte.permanent) & pvte.storage_system
84 then do;
85 pvte.device_inoperative = "0"b;
86 pvte.testing = "1"b;
87 call disk_control$test_drive (pvtx);
88 do while (pvte.testing);
89 call page$time_out;
90 end;
91 if pvte.device_inoperative then call mark;
92 end;
93 end;
94
95 if ^masked then call pmut$unwire_unmask (oldmask, ptwp);
96 return;
97
98
99 mark: proc;
100
101 if errflags.device_inoperative then do;
102 pvte.device_inoperative = "1"b;
103 p99 = pvte.logical_area_number;
104 call syserr (3, "disk_emergency: ^a_^a inoperative: shutdown of ^a_^a suspended.",
105 pvte.devname, p99, pvte.devname, p99);
106 end;
107 return;
108 end mark;
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 end;