1
2
3
4
5
6
7
8
9
10
11
12
13
14 segno_usage: proc;
15
16
17
18
19
20
21
22
23
24
25
26
27 Note
28
29
30
31
32
33
34
35 dcl a_code fixed bin (35) parameter;
36 dcl a_ring fixed bin (3) parameter;
37 dcl a_segno fixed bin (17) parameter;
38
39
40
41 dcl code fixed bin (35);
42 dcl ring fixed bin (3);
43
44
45
46 dcl level$get returns (fixed bin (3));
47 dcl get_kstep entry (fixed bin (17), ptr, fixed bin (35));
48 %page;
49 increment: entry (a_segno, a_code);
50
51 ring = level$get ();
52 incr: call setup;
53 if kste.usage_count (ring) >= 0 then
54 kste.usage_count (ring) = kste.usage_count (ring) + 1;
55 return;
56
57 increment_other_ring: entry (a_segno, a_ring, a_code);
58
59 ring = a_ring;
60 go to incr;
61
62 decrement: entry (a_segno, a_code);
63
64 ring = level$get ();
65 call setup;
66 if kste.usage_count (ring) > 0 then
67 kste.usage_count (ring) = kste.usage_count (ring) - 1;
68 return;
69 %page;
70 setup: proc;
71
72 call get_kstep ((a_segno), kstep, code);
73 if code ^= 0 then do;
74 a_code = code;
75 go to return_to_caller;
76 end;
77 return;
78 end setup;
79
80 return_to_caller:
81 return;
82
83 %page; %include kst;
84 end segno_usage;