1
2
3
4
5
6
7
8
9
10
11 init_scu: proc (P_tag, P_errtag, P_code);
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 dcl P_tag fixed bin (3) parameter;
36 dcl P_errtag fixed bin (3) parameter;
37 dcl P_code fixed bin (35) parameter;
38
39 dcl code fixed bin (35);
40 dcl tag fixed bin (3);
41 dcl ptp pointer;
42 dcl i fixed bin (3);
43 dcl j fixed bin (3);
44 dcl x fixed bin (5);
45 dcl low_base fixed bin;
46 dcl high_base fixed bin;
47 dcl mem_size fixed bin;
48 dcl found bit (1) aligned;
49 dcl unfound_mask (4) bit (1) unal;
50
51 dcl cdp ptr;
52 dcl pdp ptr;
53 dcl 1 cdata based (cdp) like scs$controller_data aligned;
54 dcl 1 pdata based (pdp) like scs$processor_data aligned;
55
56 dcl privileged_mode_ut$check_for_mem_overlap
57 entry (fixed bin, fixed bin, fixed bin (35));
58 dcl scr_util$read_cfg entry (fixed bin (3));
59 dcl scr_util$set_mask entry (fixed bin (3), fixed bin (3), fixed bin (71));
60 dcl syserr entry options (variable);
61
62 dcl tag_letter (0:7) char (1) aligned static init ("A", "B", "C", "D", "E", "F", "G", "H");
63
64 dcl (addr, bit, divide, index, string) builtin;
65 ^L
66
67 tag = P_tag;
68
69 cdp = addr (scs$controller_data (tag));
70 call set_scas_ptw ((tag), (cdata.base));
71
72
73
74
75 call scr_util$read_cfg (tag);
76
77 mem_size = cdata.lower_store_size + cdata.upper_store_size;
78
79 if cdata.size < mem_size then
80 call init_error (rcerr_addscu_size, 0);
81
82 if scs$controller_config_size (tag) > mem_size then
83 call init_error (rcerr_addscu_bigconfig, 0);
84
85 if ^cdata.program then
86 call init_error (rcerr_addscu_manual, 0);
87
88 if (cdata.type < "0010"b) & (string (scs$expanded_ports) ^= ""b) then
89 call init_error (rcerr_addscu_oldexpand, 0);
90
91
92
93 if (cdata.store_b_is_lower & cdata.store_a_online) |
94 (^cdata.store_b_is_lower & cdata.store_b_online) then
95 call set_scas_ptw (tag + 8, cdata.base + cdata.lower_store_size);
96
97 if (cdata.store_b_is_lower & cdata.store_b1_online) |
98 (^cdata.store_b_is_lower & cdata.store_a1_online) then
99 call set_scas_ptw (tag + 16, cdata.base + divide (cdata.lower_store_size, 2, 17, 0));
100
101 if (cdata.store_b_is_lower & cdata.store_a1_online) |
102 (^cdata.store_b_is_lower & cdata.store_b1_online) then
103 call set_scas_ptw (tag + 24, cdata.base + cdata.lower_store_size + divide (cdata.lower_store_size, 2, 17, 0));
104
105
106
107
108
109
110
111 if (cdata.store_b_is_lower & cdata.store_b_online & ^cdata.store_b1_online) |
112 (^cdata.store_b_is_lower & cdata.store_a_online & ^cdata.store_a1_online) then do;
113 low_base = cdata.base;
114 high_base = cdata.base + divide (cdata.lower_store_size, 2, 17, 0);
115 call privileged_mode_ut$check_for_mem_overlap
116 (low_base, high_base, code);
117
118 if code ^= 0 then
119 call init_error (rcerr_addscu_memoverlap, 0);
120 end;
121
122
123
124 if (cdata.lower_store_size = cdata.upper_store_size) then
125 if (cdata.store_b_is_lower & cdata.store_b_online & cdata.store_a_online & ^cdata.store_a1_online) |
126 (^cdata.store_b_is_lower & cdata.store_a_online & cdata.store_b_online & ^cdata.store_b1_online) then do;
127 low_base = cdata.base + cdata.lower_store_size;
128 high_base = cdata.base + cdata.lower_store_size +
129 divide (cdata.lower_store_size, 2, 17, 0);
130 call privileged_mode_ut$check_for_mem_overlap
131 (low_base, high_base, code);
132
133 if code ^= 0 then
134 call init_error (rcerr_addscu_memoverlap, 0);
135 end;
136 ^L
137
138
139
140
141
142 string (unfound_mask) = "1111"b;
143
144 do i = 0 to 7;
145 pdp = addr (scs$processor_data (i));
146 if ^(pdata.offline | pdata.online) then
147 goto NEXT_CPU_LOOP;
148
149 found = "0"b;
150 do j = 1 to 4;
151 if cdata.eima_data (j).mask_assigned then do;
152 if pdata.controller_port = cdata.eima_data (j).mask_assignment then do;
153 if ^found then do;
154 unfound_mask (j) = "0"b;
155 found = "1"b;
156 call scr_util$set_mask (tag, (pdata.controller_port), 0);
157 end;
158
159 else call init_error (rcerr_addscu_dup_mask, i);
160 end;
161 end;
162
163 else unfound_mask (j) = "0"b;
164 end;
165
166 if (cdata.type < "0010"b) & ^found then
167 call init_error (rcerr_addscu_no_mask, i);
168
169 NEXT_CPU_LOOP:
170 end;
171
172 if string (unfound_mask) ^= ""b then
173 call init_error (rcerr_addscu_bad_mask, (index (string (unfound_mask), "1"b) - 1));
174
175
176 if ^(sys_info$collection_1_phase = EARLY_INITIALIZATION | sys_info$collection_1_phase > SERVICE_INITIALIZATION)
177 then if scs$controller_config_size (tag) < mem_size then
178 call syserr (0, "init_scu: Warning - Not all of MEM ^a will be used.", tag_letter (tag));
179
180 P_code = 0;
181 P_errtag = 0;
182
183 ERROR_RETURN:
184 return;
185 ^L
186
187 final_scu: entry (P_tag);
188
189 tag = P_tag;
190
191 do x = tag by 8 while (x < 32);
192 call reset_scas_ptw (x);
193 end;
194
195 return;
196 ^L
197
198 init_error: proc (return_code, error_tag);
199
200 dcl return_code fixed bin parameter;
201 dcl error_tag fixed bin (3) parameter;
202
203
204 call final_scu (tag);
205
206 P_code = return_code;
207 P_errtag = error_tag;
208
209 goto ERROR_RETURN;
210 end init_error;
211
212
213
214 set_scas_ptw: proc (scasx, base);
215
216 dcl scasx fixed bin (5) parameter;
217 dcl base fixed bin (14) parameter;
218
219
220 ptp = addr (scs$scas_page_table (scasx));
221
222 ptp -> l68_ptw.add = bit (base);
223 ptp -> l68_ptw.phu = "1"b;
224 ptp -> l68_ptw.valid = "1"b;
225
226 return;
227 end set_scas_ptw;
228
229
230
231 reset_scas_ptw: proc (scasx);
232
233 dcl scasx fixed bin (5) parameter;
234
235
236 ptp = addr (scs$scas_page_table (scasx));
237
238 ptp -> l68_ptw.valid = "0"b;
239
240 return;
241 end reset_scas_ptw;
242
243 %page; %include collection_1_phases;
244 %page; %include scs;
245 %page; %include "ptw.l68";
246 %page; %include rcerr;
247 ^L
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268 end init_scu;