1 /* BEGIN INCLUDE FILE - dm_lm_system_data.incl.pl1 */
  2 
  3 /* format: style3,idind25 */
  4 /* HISTORY:
  5 
  6 Written by Benson Margulies, 4/83.
  7 Modified:
  8 04/24/84 by R. Michael Tague:  moved the meters structure definition to
  9    dm_lm_meters.incl.pl1.  Added this history section.
 10 05/01/84 by R. Michael Tague:  removed the %include dm_lm_meters.
 11 10/17/84 by Stanford S. Cox:  Added version constant, and changed
 12    transaction_table to use a refer extent (to allow outer ring reference).
 13 */
 14 
 15 dcl       lock_seg_ptr             ptr;
 16 dcl       lock_transaction_table_ptr
 17                                    ptr;
 18 dcl       lock_hash_table_ptr      ptr;
 19 dcl       lock_aux_seg_ptr         ptr;
 20 dcl       lock_block_ptr           ptr;
 21 dcl       lock_block_array_ptr     ptr;
 22 dcl       lock_free_block_ptr      ptr;
 23 dcl       lock_object_ptr          ptr;
 24 dcl       lock_owner_ptr           ptr;
 25 dcl       lock_segments_ptr        ptr;
 26 dcl       lock_waiter_ptr          ptr;
 27 dcl       lock_deadlock_ptr        ptr;
 28 
 29 dcl       n_lock_blocks            fixed bin;
 30 dcl       n_lock_deadlock          fixed bin;
 31 
 32 dcl       LOCK_SEG_VERSION_1       char (8) aligned init ("locksg 1") int static options (constant);
 33 
 34 dcl       1 lock_seg               aligned based (lock_seg_ptr),
 35                                                             /* Per-system lock data */
 36             2 version              char (8) aligned,
 37             2 header               aligned,
 38               3 lock               fixed bin (71),          /* Fast Lock on system lock operations */
 39               3 n_lock_segments    fixed bin,               /* Number of segments in system lock data */
 40               3 lock_seg_size      fixed bin (19),          /* Number of words per segment */
 41               3 max_lock_segments  fixed bin,               /* Maximum number of segments */
 42               3 n_transaction_table_entries
 43                                    fixed bin,               /* Size of transaction table */
 44               3 n_hash_table_entries
 45                                    fixed bin,               /* Size of hash table */
 46               3 hash_mask          bit (36) aligned,        /* Used by hashing routine */
 47               3 free_list_ptr      aligned like lock_virtual_ptr,
 48                                                             /* Thread of free blocks */
 49               3 transaction_table_offset
 50                                    fixed bin (18) unsigned aligned,
 51                                                             /* Offset of transaction table */
 52               3 hash_table_offset  fixed bin (18) unsigned aligned,
 53                                                             /* Offset of hash table */
 54               3 n_lock_blocks      fixed bin,               /* Number of blocks crated */
 55               3 lock_array_offset  fixed bin (18) unsigned aligned,
 56                                                             /* Offset of block array */
 57             2 transaction_table    (0 refer (lock_seg.n_transaction_table_entries)) aligned like lock_transaction_table,
 58             2 hash_table           aligned like lock_hash_table,
 59             2 meters               aligned like lock_meters,
 60             2 free                 fixed bin (71);          /* Free space */
 61 
 62 dcl       1 lock_aux_seg           aligned based (lock_aux_seg_ptr),
 63                                                             /* Other than first segment */
 64             2 n_lock_blocks        fixed bin,               /* Number of blocks in this segment */
 65             2 lock_array_offset    fixed bin (18) unsigned aligned,
 66                                                             /* Offset of block array */
 67             2 free                 fixed bin (71);          /* Free space */
 68 
 69 dcl       1 lock_transaction_table aligned based (lock_transaction_table_ptr),
 70                                                             /* Process table entry */
 71             2 deadlock_inx         fixed bin,               /* Index used for deadlock detection */
 72             2 process_id           bit (36) aligned,        /* Multics process identifier */
 73             2 txn_id               bit (36) aligned,        /* Current transaction ID */
 74             2 ev_channel           fixed bin (71),
 75             2 own_ptr              aligned like lock_virtual_ptr,
 76                                                             /* First in thread of owning blocks */
 77             2 wait_ptr             aligned like lock_virtual_ptr;
 78                                                             /* Waiting block */
 79 
 80 dcl       1 lock_hash_table        aligned based (lock_hash_table_ptr),
 81             2 buckets              (lock_seg.n_hash_table_entries) aligned like lock_virtual_ptr;
 82 
 83 
 84 dcl       1 lock_block             aligned based (lock_block_ptr),
 85                                                             /* Generic block */
 86             2 seg_inx              fixed bin unal,
 87             2 type                 fixed bin unal,
 88             2 pad                  (5) bit (36) aligned;
 89 
 90 dcl       1 lock_block_array       (n_lock_blocks) aligned like lock_block based (lock_block_array_ptr);
 91 
 92 dcl       1 lock_free_block        aligned based (lock_free_block_ptr),
 93                                                             /* Free block */
 94             2 seg_inx              fixed bin unal,
 95             2 type                 fixed bin unal,          /* TYPE_FREE */
 96             2 free_fp              aligned like lock_virtual_ptr,
 97                                                             /* Thread of free blocks */
 98             2 pad                  (4) bit (36) aligned;
 99 
100 dcl       1 lock_object            aligned based (lock_object_ptr),
101                                                             /* That which is locked */
102             2 seg_inx              fixed bin unal,
103             2 type                 fixed bin unal,          /* TYPE_OBJECT */
104             2 uid                  bit (36) aligned,        /* Page File UID */
105             2 ci_no                fixed bin (35),          /* Control Interval (-1 => Page File) */
106             2 owners_ptr           aligned like lock_virtual_ptr,
107                                                             /* First in thread of owning blocks */
108             2 waiters_ptr          aligned like lock_virtual_ptr,
109                                                             /* First in thread of waiting blocks */
110             2 ht_fp                aligned like lock_virtual_ptr;
111                                                             /* Hash Table thread */
112 
113 dcl       1 lock_owner             aligned based (lock_owner_ptr),
114                                                             /* Owner of a lock */
115             2 seg_inx              fixed bin unal,
116             2 type                 fixed bin unal,          /* TYPE_OWNER */
117             2 lock_ptr             aligned like lock_virtual_ptr,
118                                                             /* Pointer to lock_object */
119             2 mode                 fixed bin,               /* Type of lock */
120             2 owners_fp            aligned like lock_virtual_ptr,
121                                                             /* Thread of owners */
122             2 transaction_fp       aligned like lock_virtual_ptr,
123                                                             /* Thread of locks owned by this transaction */
124             2 transaction_ptr      aligned like lock_virtual_ptr;
125                                                             /* Pointer to transaction table entry */
126 
127 
128 dcl       1 lock_waiter            aligned based (lock_waiter_ptr),
129                                                             /* Waiter for a lock */
130             2 seg_inx              fixed bin unal,
131             2 type                 fixed bin unal,          /* TYPE_WAITER */
132             2 lock_ptr             aligned like lock_virtual_ptr,
133                                                             /* Pointer to lock_object */
134             2 mode                 fixed bin,               /* Desired mode */
135             2 waiters_fp           aligned like lock_virtual_ptr,
136                                                             /* Thread of waiters */
137             2 transaction_ptr      aligned like lock_virtual_ptr,
138                                                             /* Process table entry of this proces */
139             2 pad                  bit (36) aligned;
140 
141 
142 dcl       1 lock_segments          aligned based (lock_segments_ptr),
143             2 seg_baseptr          (lock_seg.n_lock_segments) ptr unal;
144 
145 dcl       1 lock_virtual_ptr       aligned based,
146             2 seg_inx              fixed bin unal,
147             2 offset               fixed bin (18) unsigned unal;
148 
149 dcl       1 lock_deadlock          aligned based (lock_deadlock_ptr),
150             2 wait_own             (n_lock_deadlock, n_lock_deadlock) bit (1) unaligned;
151 
152 declare   1 lock_deadlock_36       aligned based (lock_deadlock_ptr),
153             2 wait_own             (36, 36) bit (1) unaligned;
154 
155 declare   1 lock_deadlock_72       aligned based (lock_deadlock_ptr),
156             2 wait_own             (72, 72) bit (1) unaligned;
157                                                             /* (x,y) ON => x waiting for lock owned by y */
158 
159 declare   lock_deadlock_txn_ids_ptr
160                                    pointer;
161 declare   lock_deadlock_txn_ids    (n_lock_deadlock) bit (36) aligned based (lock_deadlock_txn_ids_ptr);
162 dcl       (
163           TYPE_FREE                init (1),
164           TYPE_OBJECT              init (2),
165           TYPE_OWNER               init (3),
166           TYPE_WAITER              init (4),
167           MAX_TYPE                 init (4)
168           )                        fixed bin int static options (constant);
169 
170 
171 dcl       1 NULL_VPTR              aligned int static options (constant),
172             2 seg_inx              fixed bin unal init (-1),
173             2 offset               fixed bin (18) unsigned unal init (0);
174 
175 
176 dcl       LOCK_BLOCK_SIZE          fixed bin int static options (constant) init (6);
177                                                             /* Size of all lock blocks */
178 
179 dcl       LOCK_SEGNAME             char (9) int static options (constant) init ("lock_seg_");
180 
181 dcl       lock_segno               pic "999";
182 
183 dcl       (
184           LOCK_MESSAGE_DEADLOCK    init (1243657)
185           )                        fixed bin (71) int static options (constant);
186 
187 
188 /* END INCLUDE FILE - dm_lm_system_data.incl.pl1 */