1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 boundfault: proc (a_mcptr);
21
22
23
24
25
26
27
28 dcl a_mcptr ptr;
29
30 dcl (tsdwp, old_astep, new_astep, pastep, temptr, kstp, par_astep) ptr,
31 (pw1, pw2, pageno, segno, csl, pts, old_pts, ptsi) fixed bin,
32 offset fixed bin (18),
33 code fixed bin (35),
34 (time1, time2) fixed bin (71),
35 (last, relp) bit (18) aligned,
36 (lsw, par_ehs_status) bit (1) aligned,
37 tsdw fixed bin (71),
38 read_lock bit (36) aligned init ("0"b);
39
40 dcl (error_table_$boundviol, error_table_$illegal_deactivation, error_table_$synch_seg_limit,
41 error_table_$mylock, error_table_$root) ext fixed bin (35),
42 kst_seg$ ext fixed bin,
43 pds$bounds_faults fixed bin (35) ext,
44 dseg$ (0 : 512) bit (72) aligned ext;
45
46 dcl page$enter_data ext entry (fixed bin, fixed bin),
47 pc$move_page_table ext entry (ptr, ptr),
48 syserr entry options (variable),
49 usage_values ext entry (fixed bin, fixed bin (71)),
50 sum$getbranch_root_my ext entry (ptr, bit (36) aligned, ptr, fixed bin (35)),
51 lock$dir_unlock ext entry (ptr),
52 lock$lock_ast entry,
53 lock$unlock_ast entry,
54 get_ptrs_$given_segno ext entry (fixed bin) returns (ptr),
55 get_aste ext entry (fixed bin) returns (ptr),
56 get_aste$synchronized entry (fixed bin) returns (ptr),
57 put_aste ext entry (ptr),
58 search_ast$hash_in ext entry (ptr),
59 search_ast$hash_out ext entry (ptr),
60 setfaults ext entry (ptr, bit (1) aligned);
61
62 declare pmut$swap_sdw entry (pointer, pointer);
63 declare sdw_util_$set_size entry (pointer, fixed binary (19));
64 declare sdw_util_$get_address entry (pointer) returns (fixed bin (26));
65 dcl sst_seg$ external static;
66 dcl sst$pts (0 : 3) fixed bin external static;
67 dcl sst$cpu_bf_time fixed bin (71) external static;
68 dcl sst$total_bf_pf fixed bin (35) external static;
69 dcl sst$total_bf fixed bin (35) external static;
70 dcl sstp pointer;
71
72 dcl (addr, baseptr, bin, divide, max, min, null, ptr, rel) builtin;
73
74
75 % include mc;
76 % include trace_types;
77 % include dir_header;
78 % include dir_entry;
79 % include dir_name;
80 % include aste;
81 % include sstnt;
82
83 ^L
84 call usage_values (pw1, time1);
85 code = 0;
86 sstp = addr (sst_seg$);
87 kstp = addr (kst_seg$);
88 tsdwp = addr (tsdw);
89
90 scup = addr (a_mcptr -> mc.scu (0));
91 offset = bin (scup -> scu.ca, 18);
92 pageno = divide (offset, 1024, 17, 0);
93 if scup -> scu.apu.ptw2 then pageno = pageno + 1;
94 segno = bin (bin (scup -> scu.tsr, 15), 17);
95 call page$enter_data (segno, boundfault_start);
96
97 lsw = "1"b;
98
99 call sum$getbranch_root_my (baseptr (segno), read_lock, ep, code);
100 if code ^= 0
101 then if code = error_table_$mylock
102 then lsw = "0"b;
103 else if code = error_table_$root
104 then call syserr (2, "boundfault: on the root");
105 else go to update;
106
107 code = 0;
108 dp = ptr (ep, 0);
109 if sdw_util_$get_address (addr (dseg$ (segno))) = 0 then go to un;
110
111 temp_entry_name = (addr (ep -> entry.primary_name) -> names.name);
112
113
114 call lock$lock_ast;
115
116 old_astep = get_ptrs_$given_segno (segno);
117 if old_astep = null then goto unlock_set;
118
119 if pageno >= bin (old_astep -> aste.msl, 9)
120 then do;
121 code = error_table_$boundviol;
122 go to unlock_set;
123 end;
124
125 if old_astep -> aste.ehs then do;
126 code = error_table_$illegal_deactivation;
127 goto unlock_set;
128 end;
129
130 ptsi = bin (old_astep -> aste.ptsi, 2);
131 old_pts = sst$pts (ptsi);
132
133
134
135
136
137 Note
138
139
140 if pageno < old_pts then
141 begin;
142 declare temp_sdw bit (72) aligned;
143
144 temp_sdw = dseg$ (segno);
145
146 call sdw_util_$set_size ( addr (temp_sdw), min (old_pts, bin (old_astep -> aste.msl, 9)) * 1024);
147 call pmut$swap_sdw (baseptr (segno), addr (temp_sdw));
148
149 call lock$unlock_ast;
150 code = 0;
151 go to un;
152 end;
153
154 if ptsi >= 3 then do;
155 code = error_table_$boundviol;
156
157 unlock_set: call lock$unlock_ast;
158 go to un;
159 end;
160
161 call setfaults (old_astep, "0"b);
162
163 csl = bin (old_astep -> aste.csl, 9);
164 pts = max (pageno+1, csl);
165
166 if pts <= old_pts then do;
167 call lock$unlock_ast;
168 code = error_table_$boundviol;
169 go to un;
170 end;
171
172
173
174 par_astep = ptr (sstp, old_astep -> aste.par_astep);
175 par_ehs_status = par_astep -> aste.ehs;
176 par_astep -> aste.ehs = "1"b;
177
178
179 if ^old_astep -> aste.synchronized
180 then new_astep = get_aste (pts);
181 else do;
182 new_astep = get_aste$synchronized (pts);
183 if new_astep = null () then do;
184 call lock$unlock_ast;
185 code = error_table_$synch_seg_limit;
186 goto un;
187 end;
188 end;
189
190
191
192
193
194
195 new_astep -> aste.synchronized = old_astep -> aste.synchronized;
196
197
198
199 if new_astep = par_astep then call syserr (1, "boundfault: activating into father ^p", new_astep);
200 par_astep -> aste.ehs = par_ehs_status;
201
202
203
204 call pc$move_page_table (old_astep, new_astep);
205 nm_astep = new_astep;
206
207
208
209
210 pastep = ptr (sstp, old_astep -> aste.par_astep);
211
212 last = "0"b;
213 relp = pastep -> aste.infp;
214 do while (relp ^= rel (old_astep));
215 last = relp;
216 relp = ptr (sstp, relp) -> aste.infl;
217 end;
218 if last = "0"b then pastep -> aste.infp = rel (new_astep);
219 else ptr (sstp, last) -> aste.infl = rel (new_astep);
220
221
222
223
224
225 relp = old_astep -> aste.infp;
226 do while (relp);
227 temptr = ptr (sstp, relp);
228 temptr -> aste.par_astep = rel (new_astep);
229 relp = temptr -> aste.infl;
230 end;
231
232
233
234 call search_ast$hash_out (old_astep);
235 call search_ast$hash_in (new_astep);
236
237 call put_aste (old_astep);
238
239 %include make_sstnt_entry;
240
241 call lock$unlock_ast;
242 un: if lsw then call lock$dir_unlock (dp);
243
244 update:
245 a_mcptr -> mc.errcode = code;
246 call usage_values (pw2, time2);
247 sst$cpu_bf_time = sst$cpu_bf_time + time2 - time1;
248 sst$total_bf_pf = sst$total_bf_pf + pw2 - pw1;
249 sst$total_bf = sst$total_bf + 1;
250 pds$bounds_faults = pds$bounds_faults + 1;
251 call page$enter_data (segno, boundfault_end);
252 return;
253
254 ill_op_code: entry (a_mcptr);
255
256
257 a_mcptr -> mc.errcode = 1;
258 return;
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276 XXX
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291 end boundfault;