1
2
3
4
5
6
7
8
9
10
11
12
13 tc_shutdown: proc;
14
15
16
17 dcl aptptr ptr,
18 sstp ptr,
19 pds_astep ptr;
20
21 dcl i fixed bin,
22 state fixed bin,
23 size fixed bin,
24 length fixed bin;
25
26 dcl sst_seg$ fixed bin ext,
27 tc_data$apt_size fixed bin ext,
28 tc_data$apt_entry_size fixed bin ext,
29 tc_data$initializer_id ext bit (36) aligned,
30 tc_data$system_shutdown fixed bin ext,
31 tc_data$wait_enable fixed bin ext,
32 tc_data$apt fixed bin ext;
33
34 dcl deactivate_segs entry (ptr);
35
36 dcl (addr, addrel, bin) builtin;
37
38 % include apte;
39
40
41
42
43 tc_data$system_shutdown = 1;
44 tc_data$wait_enable = 0;
45
46 aptptr = addr (tc_data$apt);
47 size = tc_data$apt_size;
48 length = tc_data$apt_entry_size;
49 sstp = addr (sst_seg$);
50
51
52
53 do i = 1 to size;
54 state = bin(aptptr -> apte.flags.state, 18);
55 if state = 0 | state = 5
56 then go to end_apt_loop;
57 if aptptr -> apte.processid = tc_data$initializer_id
58 then go to end_apt_loop;
59 if aptptr -> apte.flags.idle
60 | aptptr -> apte.flags.hproc
61 then go to end_apt_loop;
62 pds_astep = ptr (sstp, aptptr -> apte.asteps.pds);
63 call deactivate_segs (pds_astep);
64
65 end_apt_loop:
66 aptptr = addrel (aptptr, length);
67 end;
68
69
70
71 end tc_shutdown;