1
2
3
4
5
6
7
8
9
10 make_sdw: proc (a_segno, a_tsdw, a_astep, a_ptp);
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 dcl a_segno fixed bin (18) parameter;
37 dcl a_tsdw fixed bin (71) parameter;
38 dcl a_ptp pointer parameter;
39 dcl a_astep pointer parameter;
40 dcl a_pvtx fixed bin parameter;
41
42 dcl (error_table_no, pdsno, dsegno, pl1_ops_no, pl1_ops_pages, no_pages_wired) fixed bin;
43 dcl (ptsi, loopcnt) fixed bin;
44 dcl pvtx fixed bin;
45 dcl temp_sdw fixed bin (71);
46 dcl save_pts fixed bin;
47 dcl dummy fixed bin;
48 dcl asp ptr;
49 dcl pts fixed bin (9);
50 dcl (i, j) fixed bin;
51 dcl unthreaded bit (1) aligned;
52 dcl no_pages bit (1) aligned;
53
54 dcl 1 sdwi aligned like sdw_info automatic;
55
56 dcl seg (0:262143) fixed bin based aligned;
57 dcl bfword (0:1) fixed bin based;
58
59 dcl hcp_thread fixed bin int static init (0);
60 dcl hcp_first fixed bin int static init (0);
61
62 dcl abs_seg$ external static;
63 dcl breakpoint_page$ external static;
64 dcl dseg$ external static;
65 dcl name_table$ external static;
66 dcl pds$ external static;
67 dcl slt$ external static;
68
69 dcl pl1_operators_$end_pl1_operators fixed bin external static;
70 dcl error_table_$ external static;
71 dcl sys_info$system_type fixed bin external static;
72
73 dcl absadr entry (ptr, fixed bin (35)) returns (fixed bin (26));
74 dcl config_$find entry (char (4) aligned, ptr);
75 dcl get_ptrs_$given_astep ext entry (ptr) returns (fixed bin (71));
76 dcl pmut$swap_sdw entry (ptr, ptr);
77 dcl ptw_util_$make_core entry (pointer, fixed bin (26));
78 dcl ptw_util_$make_null entry (pointer, bit (22) aligned);
79 dcl ptw_util_$set_wired entry (pointer);
80 dcl sdw_util_$construct entry (pointer, pointer);
81 dcl sdw_util_$dissect entry (pointer, pointer);
82 dcl syserr ext entry options (variable);
83 dcl thread$cin ext entry (ptr, bit (18));
84 dcl thread$out ext entry (ptr, bit (18));
85
86 dcl (addr, addrel, baseno, bin, bit, divide, fixed, hbound, max, null, ptr, rel, string, substr) builtin;
87
88
89
90 unthreaded = "0"b;
91 no_pages = "0"b;
92 goto MAKE_SDW_COMMON;
93
94
95 unthreaded: entry (a_segno, a_tsdw, a_astep, a_ptp);
96
97 unthreaded = "1"b;
98 no_pages = "0"b;
99 goto MAKE_SDW_COMMON;
100
101 no_pages: entry (a_segno, a_tsdw, a_astep, a_ptp);
102 no_pages = "1"b;
103 unthreaded = "0"b;
104
105 MAKE_SDW_COMMON:
106
107 sstp = addr (sst_seg$);
108 pvt_arrayp = addr (pvt$array);
109 sltp = addr (slt$);
110 sltep = addr (slt.seg (a_segno));
111 asp = addr (abs_seg$);
112
113 pdsno = fixed (baseno (addr (pds$)), 17);
114 dsegno = fixed (baseno (addr (dseg$)), 17);
115 pl1_ops_no = fixed (baseno (addr (pl1_operators_$end_pl1_operators)), 17);
116 pl1_ops_pages = divide (fixed (rel (addr (pl1_operators_$end_pl1_operators)), 18) + 1023, 1024, 17, 0);
117 error_table_no = fixed (baseno (addr (error_table_$)), 17);
118
119 namep = ptr (addr (name_table$), slte.names_ptr);
120 do i = 1 to hbound (table_corresp, 1);
121 if table_corresp (i).slt_name = namep -> segnam.name (1)
122 then do tbcp = null repeat (tbcp);
123 call config_$find (tbl_card_name, tbcp);
124 if tbcp = null then go to no_card;
125 do j = 1 to hbound (tbls_card.tbl_spec, 1);
126 if tbls_card.tbl_name (j) = table_corresp (i).card_name then do;
127 pts, save_pts = tbls_card.cur_length (j);
128 slte_uns.max_length =
129 max (pts, slte_uns.max_length);
130 slte_uns.cur_length = pts;
131 go to got_pts;
132 end;
133 end;
134 end;
135 end;
136
137 no_card: pts = max (slte_uns.max_length, slte_uns.cur_length);
138 if (pts = 0 | (slte.abs_seg & ^ no_pages)) & ^unthreaded then do;
139
140
141 a_astep, a_ptp = null ();
142 a_tsdw = 0;
143 return;
144 end;
145
146 if ^ slte.breakpointable & ^ no_pages & substr (slte_uns.access, 2, 1) then do;
147 slte_uns.breakpointable = "1"b;
148 slte_uns.max_length = slte_uns.max_length + 1;
149 slte_uns.cur_length = slte_uns.cur_length + 1;
150 pts = pts + 1;
151 end;
152 save_pts = pts;
153
154 got_pts: do i = 3 to 0 by -1 while (sst.pts (i) >= pts);
155 end;
156
157 ptsi = i + 1;
158 loopcnt = 0;
159 pts = sst.pts (ptsi);
160
161 do astep = ptr (sstp, sst.ausedp (ptsi))
162 repeat ptr (sstp, aste.fp)
163 while (aste.usedf &
164 loopcnt <= fixed (sst.no_aste (ptsi), 17));
165 loopcnt = loopcnt + 1;
166 end;
167
168 if loopcnt > fixed (sst.no_aste (ptsi), 18) then
169 call syserr (1, "make_sdw: aste pool ^d too small", ptsi);
170
171 call thread$out (astep, sst.ausedp (ptsi));
172 do i = 0 to sst.astsize - 2;
173 astep -> bfword (i) = 0;
174 end;
175
176
177
178 aste.usedf = "1"b;
179 a_ptp = addrel (astep, sst.astsize);
180
181 if slte.wired then do;
182 if a_segno = pdsno then no_pages_wired = 1;
183 else if a_segno = dsegno then no_pages_wired = 1;
184 else if a_segno = pl1_ops_no then no_pages_wired = pl1_ops_pages;
185 else if a_segno = error_table_no then no_pages_wired = 1;
186 else no_pages_wired = save_pts;
187 sst.wired = sst.wired + no_pages_wired;
188 end;
189 else no_pages_wired = 0;
190
191 do i = 0 to pts - 1;
192 call ptw_util_$make_null (addrel (a_ptp, i), make_sdw_null_addr);
193 if i < no_pages_wired then call ptw_util_$set_wired (addrel (a_ptp, i));
194 end;
195
196 if slte_uns.breakpointable then
197 if no_pages_wired > 0 then do;
198 call ptw_util_$make_core (addrel (a_ptp, save_pts - 1), absadr (addr (breakpoint_page$), (0)));
199 call ptw_util_$set_wired (addrel (a_ptp, save_pts - 1));
200 if no_pages_wired = save_pts then sst.wired = sst.wired - 1;
201 end;
202
203 if ^unthreaded
204 then if slte.temp_seg then call thread$cin (astep, sst.atempp);
205 else if slte.branch_required then call thread$cin (astep, sst.ausedp (ptsi));
206 else if slte.init_seg then call thread$cin (astep, sst.ainitp);
207 else if slte.wired then do;
208 unthreaded = "1"b;
209 aste.hc = "1"b;
210 end;
211 else aste.hc = "1"b;
212
213 a_tsdw = get_ptrs_$given_astep (astep);
214 call sdw_util_$dissect (addr (a_tsdw), addr (sdwi));
215 sdwi.size = save_pts * 1024;
216 string (sdwi.access) = slte.access;
217 if sys_info$system_type = L68_SYSTEM then
218 sdwi.cache = slte.cache;
219 call sdw_util_$construct (addr (a_tsdw), addr (sdwi));
220
221 aste.nqsw = "1"b;
222 aste.dnzp = "1"b;
223 aste.ddnp = "1"b;
224 aste.strp = bit (a_segno, 18);
225 aste.ehs = "1"b;
226 aste.hc_sdw = "1"b;
227 aste.vtocx = -1;
228
229 a_astep = astep;
230
231
232
233 if no_pages then aste.csl, aste.records = bit (bin (slte_uns.cur_length, 9), 9);
234
235 if slte.abs_seg | no_pages then return;
236
237
238
239
240 if hcp_thread = 0 then do;
241 if sst.root_pvtx = 0 then do;
242 aste.pvtx = -1;
243 return;
244 end;
245 call syserr (1, "make_sdw: no hardcore partitions available.");
246 end;
247
248
249 if slte.branch_required then do;
250 pvtx = sst.root_pvtx;
251 pvtep = addr (pvt_array (pvtx));
252 goto got_pvtx;
253 end;
254
255 do pvtx = hcp_thread repeat pvte.brother_pvtx;
256 pvtep = addr (pvt_array (pvtx));
257 if pvte.nleft >= save_pts then go to got_pvtx;
258 if pvte.brother_pvtx = hcp_thread then call syserr
259 (1, "make_sdw: out of hardcore partition for ^a.", namep -> segnam.name (1));
260 end;
261 got_pvtx:
262 hcp_thread = pvte.brother_pvtx;
263 aste.pvtx = pvtx;
264 aste.hc_part = "1"b;
265
266
267
268 call pmut$swap_sdw (asp, addr (a_tsdw));
269 do i = 0 to save_pts - 1;
270 dummy = asp -> seg (i * 1024);
271 end;
272
273 if slte.breakpointable then do;
274 sdwi.access.write = "1"b;
275 call sdw_util_$construct (addr (temp_sdw), addr (sdwi));
276 call pmut$swap_sdw (asp, addr (temp_sdw));
277 addrel (asp, (save_pts - 1) * 1024) -> bkpt_page.sentinel = BKPT_page_sentinel;
278 end;
279
280 temp_sdw = 0;
281 call pmut$swap_sdw (asp, addr (temp_sdw));
282
283 return;
284
285 %page;
286
287
288
289
290
291
292
293 thread_hcp:
294 entry (a_pvtx);
295
296 pvt_arrayp = addr (pvt$array);
297 if hcp_thread = 0
298 then hcp_thread, hcp_first = a_pvtx;
299 else do;
300 pvt_array (hcp_thread).brother_pvtx = a_pvtx;
301 hcp_thread = a_pvtx;
302 end;
303
304 pvt_array (a_pvtx).brother_pvtx = hcp_first;
305
306 return;
307
308
309 reset_hcp:
310 entry;
311
312 hcp_thread, hcp_first = 0;
313 return;
314
315
316 %page; %include aste;
317 %page; %include bce_breakpoint_page;
318 %page; %include mc;
319 %page; %include null_addresses;
320 %page; %include pvte;
321 %page; %include sdw_info;
322 %page; %include slt;
323 %page; %include slte;
324 %page; %include sst;
325 %page; %include system_types;
326 %page; %include variable_tables;
327
328
329
330
331
332
333
334
335
336
337
338
339 XXX
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 end make_sdw;