1
2
3
4
5
6
7
8
9
10
11
12
13 deactivate_segs: proc (a_pds_astep);
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 dcl a_pds_astep pointer parameter;
31
32 dcl asp pointer;
33 dcl drsp pointer;
34 dcl (dstep, kst_astep, pds_astep, seg_astep) pointer;
35 dcl tsdw fixed bin (71);
36 dcl tsdwp pointer;
37 dcl rdstep bit (18) aligned;
38 dcl (highseg, hcscnt, rel_dstep, i) fixed bin;
39 dcl sdw_address fixed bin (26);
40 dcl sdwp pointer;
41
42 dcl bit18 bit (18) aligned based;
43 dcl based_ptr ptr based;
44 dcl sdwa (0 : 1023) fixed bin (71) aligned based;
45
46 dcl abs_seg$ fixed bin external static;
47 dcl backup_abs_seg$ external static;
48 dcl dir_seg$ fixed bin ext external static;
49
50 dcl pds$dstep bit (18) external static;
51 dcl sst_seg$ external static;
52
53 dcl check_trailer entry (fixed bin) returns (bit (1) aligned);
54 dcl get_ptrs_$given_astep entry (ptr) returns (fixed bin (71));
55 dcl get_ptrs_$given_sdw entry (pointer) returns (pointer);
56 dcl grab_aste$release entry (ptr);
57 dcl grab_aste$release_prewithdraw entry (ptr);
58 dcl lock$lock_ast entry ();
59 dcl lock$unlock_ast entry ();
60 dcl pmut$swap_sdw entry (ptr, ptr);
61 dcl setfaults$deltrailer entry (ptr, fixed bin (17), fixed bin (17));
62 dcl sdw_util_$get_address entry (pointer, fixed bin (26));
63 dcl syserr entry options (variable);
64
65 dcl (baseno, ptr, rel, addr, fixed, null) builtin;
66
67
68
69 pds_astep = a_pds_astep;
70 asp = addr (abs_seg$);
71 drsp = addr (dir_seg$);
72 tsdwp = addr (tsdw);
73 tsdw = get_ptrs_$given_astep (pds_astep);
74 call pmut$swap_sdw (asp, tsdwp);
75
76 rdstep = ptr (asp, rel (addr (pds$dstep))) -> bit18;
77 dstep = ptr (addr (sst_seg$), rdstep);
78 kstp = ptr (asp, rel (addr (pds$kstp))) -> based_ptr;
79
80 tsdw = get_ptrs_$given_astep (dstep);
81 call pmut$swap_sdw (asp, tsdwp);
82
83 if kstp ^= null () then do;
84 kst_astep = get_ptrs_$given_sdw (addr (asp -> sdwa (fixed (baseno (kstp), 18))));
85 tsdw = get_ptrs_$given_astep (kst_astep);
86 call pmut$swap_sdw (drsp, tsdwp);
87 highseg = drsp -> kst.highest_used_segno;
88 hcscnt = drsp -> kst.lowseg;
89 call grab_aste$release (kst_astep);
90 end;
91
92
93
94
95
96 call grab_aste$release_prewithdraw (pds_astep);
97
98 if kstp ^= null () then do;
99 rel_dstep = fixed (rdstep, 18);
100 tsdw = get_ptrs_$given_astep (dstep);
101 call pmut$swap_sdw (asp, tsdwp);
102 call lock$lock_ast;
103 do i = hcscnt + 1 to highseg,
104 fixed (baseno (addr (backup_abs_seg$)), 18);
105
106 sdwp = addr (asp -> sdwa (i));
107 call sdw_util_$get_address (sdwp, sdw_address);
108 if sdw_address ^= 0 then do;
109 seg_astep = get_ptrs_$given_sdw (sdwp);
110 call setfaults$deltrailer (seg_astep, i, rel_dstep);
111 end;
112 end;
113
114
115
116
117
118
119
120 if "0"b then
121 if check_trailer (rel_dstep) then
122 call syserr (1, "deactivate_segs: unflushed trailer");
123
124 call lock$unlock_ast;
125 end;
126
127
128
129 call grab_aste$release_prewithdraw (dstep);
130
131 tsdw = 0;
132 call pmut$swap_sdw (asp, tsdwp);
133 call pmut$swap_sdw (drsp, tsdwp);
134 return;
135
136 %page; %include aste;
137 %page; %include kst;
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159 end deactivate_segs;