1 /****^  ***********************************************************
 2         *                                                         *
 3         * Copyright, (C) Honeywell Bull Inc., 1987                *
 4         *                                                         *
 5         * Copyright, (C) Honeywell Information Systems Inc., 1982 *
 6         *                                                         *
 7         * Copyright (c) 1972 by Massachusetts Institute of        *
 8         * Technology and Honeywell Information Systems, Inc.      *
 9         *                                                         *
10         *********************************************************** */
11 
12 /* format: style4,indattr,ifthenstmt,ifthen,idind35,^indcomtxt */
13 
14 kst_info: proc;
15 
16 /*
17 
18    Written July 7, 1976 by Richard Bratt
19 
20    Last Modified:
21    8/26/76 by M. Weaver  to add high_low_seg_count entry
22    11/1/84 by K. Loepere to remove hdr.
23 
24    This module contains entries to extract information from a process' KST.
25    These entries may be called by hardcore gates
26 
27    --->  get_uid (segptr, uid, code)
28 
29    This entry translates a segment number (represented as a segptr) into the unique identifier
30    of the object to which the segment number is bound.
31 
32 */
33 
34 
35 get_uid: entry (a_segptr, a_uid, a_code);
36 
37 /* Parameters */
38 
39 dcl  a_code                             fixed bin (35, 0) parameter;
40 dcl  a_hcsc                             fixed bin (17) parameter;
41 dcl  a_high_seg                         fixed bin (17) parameter;
42 dcl  a_segptr                           ptr parameter;
43 dcl  a_uid                              bit (36) aligned parameter;
44 
45 /* Variables */
46 
47 dcl  code                               fixed bin (35, 0);
48 dcl  segptr                             ptr;
49 
50 /* Entries */
51 
52 dcl  get_kstep                          entry (fixed bin (17), ptr, fixed bin (35));
53 
54 /* Misc */
55 
56 dcl  segno                              builtin;
57 %page;
58           segptr = a_segptr;
59           a_uid = "0"b;
60           call get_kstep (segno (segptr), kstep, code);
61           if code ^= 0 then do;
62                a_code = code;
63                return;
64           end;
65 
66           a_uid = kste.uid;
67           a_code = 0;
68           return;
69 %page;
70 high_low_seg_count: entry (a_high_seg, a_hcsc);
71 
72 
73 /* 1) high_seg      the number to add to hcsc to get the highest segment number being used.
74 
75    2) hcsc          is the lowest non-hardcore segment number.
76 */
77 
78           kstp = pds$kstp;
79 
80           a_hcsc = kstp -> kst.lowseg;
81 
82           a_high_seg = kstp -> kst.highest_used_segno - kstp -> kst.lowseg;
83 
84           return;
85 %page; %include kst;
86      end kst_info;