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 
13 /* format: style3 */
14 ast_lock_meter_seg:
15      proc;                                                  /* AST_LOCK_METER_SEG - Metering data for the Global AST Lock
16 
17    Written November 1981 by J. Bongiovanni
18 
19 */
20 
21 /*  Automatic  */
22 
23 
24 dcl       1 cdsa              aligned like cds_args;
25 dcl       code                fixed bin (35);
26 
27 /*  Static  */
28 
29 dcl       EXCLUDE_PAD         (1) char (32) aligned int static options (constant) init ("pad*");
30 dcl       MYNAME              char (32) int static options (constant) init ("ast_lock_meter_seg");
31 
32 
33 /*  Entry  */
34 
35 dcl       com_err_            entry options (variable);
36 dcl       create_data_segment_
37                               entry (ptr, fixed bin (35));
38 dcl       get_temp_segment_   entry (char (*), ptr, fixed bin (35));
39 dcl       release_temp_segment_
40                               entry (char (*), ptr, fixed bin (35));
41 
42 /*  Condition  */
43 
44 dcl       cleanup             condition;
45 %page;
46           ast_lock_meter_segp = null ();
47 
48           on cleanup goto CLEAN_UP;
49 
50           call get_temp_segment_ (MYNAME, ast_lock_meter_segp, code);
51           if code ^= 0
52           then do;
53                     call com_err_ (code, MYNAME, "Getting temp segment");
54                     return;
55                end;
56 
57           ast_lock_meters.n_entries = 1;
58           ast_lock_meters.max_n_entries = 1024;
59           ast_lock_meters.meters (1).caller = null ();
60 
61           unspec (cdsa) = "0"b;
62           cdsa.sections (1).p = ast_lock_meter_segp;
63           cdsa.sections (1).len = currentsize (ast_lock_meters);
64           cdsa.sections (1).struct_name = "ast_lock_meters";
65 
66           cdsa.seg_name = "ast_lock_meter_seg";
67           cdsa.num_exclude_names = 1;
68           cdsa.exclude_array_ptr = addr (EXCLUDE_PAD);
69 
70           cdsa.switches.have_text = "1"b;
71 
72           call create_data_segment_ (addr (cdsa), code);
73           if code ^= 0
74           then call com_err_ (code, MYNAME);
75 
76 CLEAN_UP:
77           if ast_lock_meter_segp ^= null ()
78           then call release_temp_segment_ (MYNAME, ast_lock_meter_segp, code);
79 
80 
81 %page;
82 %include cds_args;
83 %page;
84 %include ast_lock_meters;
85      end ast_lock_meter_seg;