1
2
3
4
5
6
7
8
9
10
11
12
13 deact_proc: proc;
14
15
16
17
18
19 dcl code fixed bin (35);
20
21 dcl save_ring fixed bin (3),
22 (sstp, pds_astep) ptr,
23 name char (32) aligned;
24
25 dcl delentry$dfile entry (char (*) aligned, char (*) aligned, fixed bin (35)),
26 del_dir_tree entry (char (*) aligned, char (*) aligned, fixed bin (35)),
27 unique_chars_ entry (bit (*) aligned) returns (char (15) aligned),
28 level$get entry returns (fixed bin (3)),
29 level$set entry (fixed bin (3)),
30 pxss$stop_wakeup entry (bit (36) aligned, fixed bin),
31 tc_util$process_status entry (ptr),
32 pxss$empty_t ext entry (ptr),
33 deactivate_segs ext entry (ptr),
34 reconfig$destroy_cpu_test_env entry,
35 ioam_$process_release entry (bit (36) aligned);
36
37 dcl error_table_$action_not_performed fixed bin (35) ext,
38 sst_seg$ fixed bin ext;
39
40 dcl (addr, ptr) builtin;
41
42 dcl 1 process_info based (pi_ptr) aligned,
43 2 processid bit (36),
44 2 page_faults fixed bin (35),
45 2 aptep ptr,
46 2 ex_state fixed bin,
47 2 mp_state fixed bin,
48 2 last_block_time fixed bin (71),
49 2 cpu_time_used fixed bin (71),
50 2 paging_measure fixed bin (71),
51 2 virtual_cpu_time fixed bin (71),
52 2 reserved fixed bin (71);
53
54 dcl 1 info aligned like process_info;
55
56
57
58
59
60 % include apte;
61 % include scs;
62
63
64
65
66
67
68
69
70
71
72
73 destroy_process_begin: entry (pi_ptr, code);
74
75 dcl pi_ptr ptr;
76
77 info.processid = pi_ptr -> process_info.processid;
78 call pxss$stop_wakeup (info.processid, info.ex_state);
79 if info.ex_state = 0 then code = error_table_$action_not_performed;
80 else code = 0;
81 return;
82
83
84
85 destroy_process_finish: entry (pi_ptr, code);
86
87 info.processid = pi_ptr -> process_info.processid;
88 call tc_util$process_status (addr (info));
89
90 if ^((info.ex_state = 5) & (info.mp_state = 1)) then do;
91 code = error_table_$action_not_performed;
92 return;
93 end;
94 sstp = addr (sst_seg$);
95 pds_astep = ptr (sstp, info.aptep -> apte.asteps.pds);
96 call deactivate_segs (pds_astep);
97 info.aptep -> apte.lock_id = ""b;
98 info.aptep -> apte.processid = ""b;
99 call pxss$empty_t (info.aptep);
100 call ioam_$process_release (info.processid);
101 if scs$reconfig_lock = info.processid then
102 call reconfig$destroy_cpu_test_env;
103 name = unique_chars_ (info.processid);
104 save_ring = level$get ();
105 call level$set (0);
106 call del_dir_tree (">process_dir_dir", name, code);
107 if code = 0 then
108 call delentry$dfile (">process_dir_dir", name, code);
109 call level$set (save_ring);
110 pi_ptr -> process_info = info;
111 return;
112
113 end deact_proc;