1 /* Begin include file definition_dcls.incl.pl1 BIM 1981 */
  2 
  3 
  4 /****^  HISTORY COMMENTS:
  5   1) change(86-05-02,Elhard), approve(86-05-02,MCR7391),
  6      audit(86-07-18,DGHowe), install(86-11-20,MR12.0-1222):
  7      Modified to add indirect bit to definition flags, add msf_map_relp to the
  8      definition header, declare the msf_map, and add structures and constants
  9      for deferred initialization.
 10   2) change(86-06-24,DGHowe), approve(86-06-24,MCR7420),
 11      audit(86-08-05,Schroth), install(86-11-20,MR12.0-1222):
 12      added the structures for pointer initialization. pointer_init_template.
 13      changed list_template_entry
 14                                                    END HISTORY COMMENTS */
 15 
 16 
 17 /* Modified:  */
 18 /*   13 Dec 1982 by Lee A. Newcomb to put definition_header.hash_table_relp */
 19 /*        after unused half-word instead of before it. */
 20 /*   1 March 1983 by M. Weaver to add list template init type */
 21 
 22 /* format: style3,idind25 */
 23 /* everything for the definition section */
 24 
 25 declare   (
 26           CLASS_TEXT               init (0),                /* text section definition */
 27           CLASS_LINKAGE            init (1),                /* linkage section definition */
 28           CLASS_SYMBOL             init (2),                /* symbol section definition */
 29           CLASS_SEGNAME            init (3),                /* segment name definition */
 30           CLASS_STATIC             init (4),                /* static section definition */
 31           CLASS_SYSTEM             init (5),                /* valid only in self links, not def class */
 32           CLASS_HEAP               init (6)                 /* valid only in self links, not def class */
 33           )                        fixed bin (3) unsigned internal static options (constant);
 34 
 35 declare   CLASS_NAMES              (0:6) character (12) internal static options (constant)
 36                                    init ("text", "linkage", "symbol", "segname", "static", "system", "heap");
 37 
 38 declare   SYMBOLIC_SECTION_NAMES   (0:6) character (8)
 39                                    init ("*text", "*link", "*symbol", *, "*static", "*system", "*heap") internal static
 40                                    options (constant);
 41 
 42 declare   1 definition_flags       unaligned based,
 43             2 new                  bit (1),                 /* should be "1"b */
 44             2 ignore               bit (1),                 /* cannot snap link to this */
 45             2 entry                bit (1),                 /* can tra here */
 46             2 retain               bit (1),                 /* binder respects this */
 47             2 argcount             bit (1),                 /* OBSOLETE */
 48             2 descriptors          bit (1),                 /* OBSOLETE */
 49             2 indirect             bit (1),                 /* target is a pointer to actual target */
 50             2 unused               bit (8);                 /* Must be zero */
 51 
 52 
 53 
 54 
 55 /* Header of the definition section */
 56 
 57 declare   def_header_ptr           pointer;
 58 declare   1 definition_header      aligned based (def_header_ptr),
 59             2 def_list_relp        fixed bin (18) unsigned unaligned,
 60                                                             /* first definition, reloc def18 */
 61             2 msf_map_relp         fixed bin (18) unsigned unaligned,
 62                                                             /* msf_map if any, or 0 if none.  reloc def18 unless none */
 63             2 hash_table_relp      fixed bin (18) unsigned unaligned,
 64                                                             /* def hash table, if any, or 0 if none. reloc def18 unless none */
 65             2 flags                unaligned like definition_flags;
 66                                                             /* both new and ignore must be "1"b here */
 67 
 68 /* A non class=3 definition. See segname_definition below for class=3 */
 69 
 70 
 71 declare   def_ptr                  pointer;
 72 declare   1 definition             aligned based (def_ptr),
 73             2 forward_relp         unal fixed bin (18) unsigned,
 74                                                             /* offset of next def */
 75             2 backward_relp        unal fixed bin (18) unsigned,
 76                                                             /* offset of previous def */
 77             2 thing_relp           unal fixed bin (18) unsigned,
 78                                                             /* offset in section specified by class of thing this defines */
 79             2 flags                unaligned like definition_flags,
 80             2 class                unal fixed bin (3) unsigned,
 81                                                             /* Type of definition */
 82             2 name_relp            unal fixed bin (18) unsigned,
 83                                                             /* offset of ACC for symbol */
 84             2 segname_relp         unal fixed bin (18) unsigned;
 85                                                             /* offset of segname def to which this belongs */
 86 
 87 /* Class=3, segname definition */
 88 
 89 declare   segname_ptr              pointer;
 90 declare   1 segname_definition     aligned based (segname_ptr),
 91             2 forward_relp         unal fixed bin (18) unsigned,
 92                                                             /* offset of next def */
 93             2 backward_relp        unal fixed bin (18) unsigned,
 94                                                             /* offset of previous def */
 95             2 next_segname_relp    unal fixed bin (18) unsigned,
 96                                                             /* offset of next segname def */
 97             2 flags                unaligned like definition_flags,
 98             2 class                unal fixed bin (3) unsigned,
 99                                                             /* 3 for segname */
100             2 name_relp            unal fixed bin (18) unsigned,
101                                                             /* offset of ACC for symbol */
102             2 first_relp           unal fixed bin (18) unsigned;
103                                                             /* see following : */
104 
105 /* Definition blocks are chained off of segname definitions.
106    segname_definition.first_relp is one of three things:
107     (1) the def section offset of the first ordinary (class^=3) definition
108       belonging to this segname block. In the case where there are more than
109       one segname's on a block, all their first_relp will point
110       to the same place.
111 
112     (2) if there are no ordinary definitions associated with this segname,
113       then it is the def section offset of the next segname.
114 
115     (3) if there are no ordinary definitions in the block, and it
116       is the last block, then it points to a word containing 0.
117 
118  Thus the end of a list of synonym segnames can be detected by forward_relp
119    pointing to a class=3 definition whose first_relp is not the same as
120    the current definitions first_relp.
121 */
122 
123 /* All the definitions are linked through the forward and
124    backward thread variables. The end of the chain can is indicated
125    by forward pointing to a zero word. */
126 
127 
128 declare   exp_ptr                  pointer;
129 declare   1 exp_word               based (exp_ptr) aligned, /* expression word in link definition */
130             2 type_relp            fixed bin (18) unsigned unal,
131                                                             /* pointer (rel to defs) of type pair structure */
132             2 expression           fixed bin (17) unal;     /* constant expression to be added in when snapping link */
133 
134 declare   (
135           LINK_SELF_BASE           init (1),                /* *section|0+expression,modifier */
136                                                             /* which section determined by segname_relp */
137           LINK_OBSOLETE_2          init (2),                /* not used */
138           LINK_REFNAME_BASE        init (3),                /* refname|0+expression,modifier */
139           LINK_REFNAME_OFFSETNAME  init (4),                /* refname|offsetname+expression,modifier */
140           LINK_SELF_OFFSETNAME     init (5),                /* *section|offsetname+expression,modifier */
141           LINK_CREATE_IF_NOT_FOUND init (6),                /* OBSOLETE: like LINK_REFNAME_OFFSETNAME except that it will create instead of taking linkage_error */
142           SECTION_TEXT             init (0),                /* *text */
143           SECTION_LINK             init (1),                /* *link */
144           SECTION_SYMBOL           init (2),                /* *symbol */
145           SECTION_UNUSED           init (3),                /* reserved */
146           SECTION_STATIC           init (4),                /* *static */
147           SECTION_SYSTEM           init (5),                /* *system */
148           SECTION_HEAP             init (6)                 /* *heap */
149           )                        fixed bin (18) unsigned unaligned internal static options (constant);
150 
151 /* use CLASS_NAMES for section names */
152 
153 declare   LINK_TYPE_NAMES          (1:6)
154                                    init ("absolute in section", "unused", "absolute off of refname",
155                                    "symbolic off of refname", "symbolic in section", "symbolic off of refname; create")
156                                    character (32) varying internal static options (constant);
157 
158 
159 declare   type_ptr                 pointer;
160 declare   1 type_pair              based (type_ptr) aligned,/* type pair in link definition */
161             2 type                 fixed bin (18) unsigned unal,
162                                                             /* see above */
163             2 trap_relp            fixed bin (18) unsigned unal,
164                                                             /* pointer (rel to defs) to the trap word */
165                                                             /* unless LINK_SELF_OFFSETNAME off of *system or create link */
166             2 segname_relp         fixed bin (18) unsigned unal,
167                                                             /* pointer (rel to defs) to ACC reference name for segment referenced,
168  /*or section code for SELF links */
169             2 offsetname_relp      fixed bin (18) unsigned unal;
170                                                             /* for OFFSETNAME links, ACC string of name of location. */
171                                                             /* for others, must be ZERO */
172 
173 
174 /* Link Trap Pair */
175 
176 declare   link_trap_ptr            pointer;
177 declare   1 link_trap_pair         aligned based (link_trap_ptr),
178             2 call_relp            fixed bin (18) unsigned unaligned,
179                                                             /* LINK18, link to thing to call */
180             2 info_relp            fixed bin (18) unsigned unaligned;
181                                                             /* LINK18, link to argument list */
182 
183 
184 /* initialization info for *system or *heap link */
185 
186 
187 /* NOTE --------------------------------------------------
188    the following structures defining initialization information are also
189    defined in fortran_storage.incl.pl1  system_link_init_info.incl.pl1
190    and should be kept equivalent
191    -------------------------------------------------------
192 */
193 
194 declare   (
195           INIT_NO_INIT             init (0),
196           INIT_COPY_INFO           init (3),
197           INIT_DEFINE_AREA         init (4),
198           INIT_LIST_TEMPLATE       init (5),
199           INIT_DEFERRED            init (6)
200           )                        fixed bin internal static options (constant);
201 
202 /* for type = 0 or 4 */
203 
204 declare   link_init_ptr            pointer;
205 declare   1 link_init              aligned based (link_init_ptr),
206             2 n_words              fixed bin (35),          /* number to invent */
207             2 type                 fixed bin;               /* see types above */
208 
209 /* for type=3, there is data to copy */
210 
211 declare   1 link_init_copy_info    aligned based (link_init_ptr),
212             2 header               aligned like link_init,
213             2 initial_data         (link_init_n_words refer (link_init_copy_info.header.n_words)) bit (36) aligned;
214 
215 declare   link_init_n_words        fixed bin;
216 
217 /* for type = 5, there is a list template to copy */
218 
219 declare   1 link_init_list_template
220                                    aligned based (link_init_ptr),
221             2 header               aligned like link_init,
222             2 pad                  bit (18) unaligned,
223             2 n_words_in_list      fixed bin (18) unsigned unaligned,
224             2 template             (link_init_n_words_in_list refer (link_init_list_template.n_words_in_list));
225 
226 declare   link_init_n_words_in_list
227                                    fixed bin;
228 
229 /* A list template consists of a series of entries with the following
230    description, concatenated together.  n_bits and datum are bit items,
231    to permit a wide range of inputs.
232 
233    1.  A 'repeat' of '0' signifies skipping of 'n_bits' bits.
234    2.  A 'n_bits' of '0' signifies the last item of the list.
235 
236    COMMON, VLA's, and LA's are presumed to start at the base pointer
237    of their particular storage section. */
238 
239 declare   1 list_template_entry    aligned based,
240             2 n_bits               fixed bin (35) aligned,  /* size of datum */
241             2 mbz                  bit (3) unaligned,       /* future expansion */
242             2 init_type            fixed bin (3) unsigned unaligned, /* 0 normal init, 1 ptr init, 2 packed ptr init */
243             2 repeat               fixed bin (30) unsigned unaligned,
244                                                             /* number of times to repeat datum */
245             2 datum                bit (link_init_n_bits_in_datum refer (list_template_entry.n_bits));
246 
247 
248 /* the pointer_init_template represents the initialization information
249    for ITS and packed pointers.  Both pointer types require the entire
250    72 bit structure.
251 */
252 
253 dcl       1 pointer_init_template  based,
254             2 ptr_type             fixed bin (18) unsigned unaligned,  /* 0 text section, 1 linkage section, 2 static section */
255             2 section_offset       fixed bin (18) unsigned unaligned,  /* offset to item in specified section */
256             2 word_offset          fixed bin (18) unsigned unaligned,  /* offset from section item to target in words */
257             2 mbz                  bit (12) unaligned,
258             2 bit_offset           fixed bin (6) unsigned unaligned;   /* offset from section item|word offset to target in bits */
259 
260 
261 declare   link_init_n_bits_in_datum
262                                    fixed bin (35);
263 
264 /* for type = 6, the init_info resides in another MSF component */
265 /* target_relp is a linkage section offset to a partial link to */
266 /* the base of the linkage section of the component containing  */
267 /* the actual init_info. link_relp is the offset of the actual  */
268 /* link within that linkage section.                            */
269 
270 declare   1 link_init_deferred     aligned based (link_init_ptr),
271             2 header               aligned like link_init,
272             2 target_relp          fixed bin (18) unsigned unaligned,
273             2 link_relp            fixed bin (18) unsigned unaligned;
274 
275 /* Definition section hash table */
276 
277 declare   def_ht_ptr               pointer;
278 declare   1 definition_ht          aligned based (def_ht_ptr),
279             2 n_entries            fixed bin,
280             2 table                (def_ht_n_entries refer (definition_ht.n_entries)) aligned,
281               3 def_relp           fixed bin (18) unsigned unaligned,
282               3 unused             bit (18) unaligned;
283 
284 declare   def_ht_n_entries         fixed bin;
285 
286 
287 /* Component name ht */
288 declare   comp_ht_ptr              pointer;
289 declare   1 component_ht           aligned based (comp_ht_ptr),
290             2 n_entries            fixed bin,
291             2 table                (comp_ht_n_entries refer (component_ht.n_entries)) aligned,
292               3 def_relp           fixed bin (18) unsigned unaligned,
293                                                             /* hashed segname */
294               3 block_hdr_relp     fixed bin (18) unsigned unaligned;
295                                                             /* first segname def of block containing def_relp */
296 
297 declare   comp_ht_n_entries        fixed bin;
298 
299 /* Duplicate name table */
300 
301 declare   dup_table_ptr            pointer;
302 declare   1 duplicate_table        aligned based (dup_table_ptr),
303             2 mbz                  bit (18) unaligned,      /* to tell it from a definition */
304             2 n_names              fixed bin (18) unsigned unaligned,
305                                                             /* n in table */
306             2 table                (dup_table_n_names refer (duplicate_table.n_names)) aligned,
307               3 def_relp           fixed bin (18) unsigned unaligned,
308               3 block_hdr_relp     fixed bin (18) unsigned unaligned;
309 
310 declare   dup_table_n_names        fixed bin;
311 
312 /* The msf_map is found in the definition section of an     */
313 /* object MSF component.  It is used by the linker to       */
314 /* determine whether a segment is a component of an object  */
315 /* MSF or a standard single-segment object.                 */
316 
317   dcl msf_map_ptr             ptr;
318   dcl 01 msf_map              aligned based (msf_map_ptr),
319        02 version             char (8),
320        02 component_count     fixed bin (15) unsigned,
321        02 my_component        fixed bin (15) unsigned;
322 
323   dcl msf_map_version_1       char (8) static options (constant)
324                                    init ("msfmp1.0");
325 
326 declare   acc_string_ptr           pointer;
327 declare   1 acc_string             aligned based (acc_string_ptr),
328             2 count                fixed bin (9) unsigned unaligned,
329             2 string               character (max (3, acc_string_length) refer (acc_string.count)) unaligned,
330             2 mbz                  bit (0) aligned;         /* this causes the statement */
331                                                             /* unspec (acc_string) = ""b to zero out */
332                                                             /* the last word, if the string is not of length 0mod4 */
333 
334 declare   acc_string_length        fixed bin (21);
335 
336 
337 /* end include file definitions_dcls.incl.pl1 */