1 /****  START OF:    ocu_structures.incl.pl1                  *  *  *  *  *  */
  2 
  3 /****^  HISTORY COMMENTS:
  4   1) change(86-08-12,Elhard), approve(86-08-12,MCR7505),
  5      audit(86-12-10,DGHowe), install(86-12-10,MR12.0-1241):
  6      Originally written to define the structures used internally be ocu_
  7      during object segment definition and generation.
  8   2) change(86-12-19,Elhard), approve(86-12-19,PBF7505),
  9      audit(86-12-22,DGHowe), install(87-01-05,MR12.0-1256):
 10      Changed declaration of list_template initialization to explicitly declare
 11      template words as bit (36) rather than letting them default to fixed bin
 12      (17) to prevent size errors in debugging versions.
 13                                                    END HISTORY COMMENTS */
 14 
 15   /*** ****************************************************************/
 16   /***                                                                */
 17   /***    Name:     ocu_structures                                    */
 18   /***    Function: these structures are the intermediate structures  */
 19   /***              used by ocu_ to maintain object segment info      */
 20   /***              until the object segment is created.              */
 21   /***                                                                */
 22   /*** ****************************************************************/
 23 
 24   /*** ****************************************************************/
 25   /***                                                                */
 26   /***    Name:     ocu_data                                          */
 27   /***    Function: This data structure maintains the general data    */
 28   /***              for the object segment and pointers to the info   */
 29   /***              structures for the various sections.              */
 30   /***                                                                */
 31   /*** ****************************************************************/
 32 
 33   dcl ocu_datap               ptr;
 34   dcl ocu_data_version_1      char (8) static options (constant)
 35                                    init ("ocu_ 1.0");
 36 
 37   dcl 01 ocu_data             aligned based (ocu_datap),
 38        02 version             char (8),
 39        02 flags               aligned,
 40         03 bound              bit (1) unaligned,
 41         03 relocatable        bit (1) unaligned,
 42         03 procedure          bit (1) unaligned,
 43         03 separate_static    bit (1) unaligned,
 44         03 perprocess_static  bit (1) unaligned,
 45         03 no_hash_table      bit (1) unaligned,
 46         03 mbz                bit (30) unaligned,
 47        02 target              aligned,
 48         03 dir                char (168) unaligned,
 49         03 entry              char (32) unaligned,
 50         03 segp               ptr,
 51         03 bc                 fixed bin (24),
 52         03 acinfop            ptr,
 53        02 msf_info            aligned,
 54         03 component_count    fixed bin,
 55         03 my_component       fixed bin,
 56        02 lengths             aligned,
 57         03 text               fixed bin (18) unsigned,
 58         03 defs               fixed bin (18) unsigned,
 59         03 link               fixed bin (18) unsigned,
 60         03 stat               fixed bin (18) unsigned,
 61         03 symb               fixed bin (18) unsigned,
 62        02 text_infop          ptr,
 63        02 text_relinfop       ptr,
 64        02 def_infop           ptr,
 65        02 string_map_infop    ptr,
 66        02 string_segp         ptr,
 67        02 exp_word_infop      ptr,
 68        02 type_pair_infop     ptr,
 69        02 trap_pair_infop     ptr,
 70        02 init_infop          ptr,
 71        02 init_segp           ptr,
 72        02 static_infop        ptr,
 73        02 link_infop          ptr,
 74        02 firstref_trap_infop ptr,
 75        02 symbol_infop        ptr,
 76        02 symbol_relinfop     ptr;
 77 
 78   /*** ****************************************************************/
 79   /***                                                                */
 80   /***    Name:     ocu_data_ptrs                                     */
 81   /***    Function: This data structure is identical to the ocu_data  */
 82   /***              structure except that the pointers to the other   */
 83   /***              extensible structures are replaced by an array of */
 84   /***              pointers to be used by the get_temp_segments_     */
 85   /***              and release_temp_segments_ subroutines.           */
 86   /***                                                                */
 87   /*** ****************************************************************/
 88 
 89   dcl 01 ocu_data_ptrs        aligned based (ocu_datap),
 90        02 version             char (8),
 91        02 flags               aligned,
 92         03 bound              bit (1) unaligned,
 93         03 relocatable        bit (1) unaligned,
 94         03 procedure          bit (1) unaligned,
 95         03 separate_static    bit (1) unaligned,
 96         03 perprocess_static  bit (1) unaligned,
 97         03 no_hash_table      bit (1) unaligned,
 98         03 mbz                bit (30) unaligned,
 99        02 target              aligned,
100         03 dir                char (168) unaligned,
101         03 entry              char (32) unaligned,
102         03 segp               ptr,
103         03 bc                 fixed bin (24),
104         03 acinfop            ptr,
105        02 msf_map             aligned,
106         03 component_count    fixed bin,
107         03 my_component       fixed bin,
108        02 lengths             aligned,
109         03 text               fixed bin (18) unsigned,
110         03 defs               fixed bin (18) unsigned,
111         03 link               fixed bin (18) unsigned,
112         03 stat               fixed bin (18) unsigned,
113         03 symb               fixed bin (18) unsigned,
114        02 temp_segs (15)      ptr;
115 
116   /*** ****************************************************************/
117   /***                                                                */
118   /***    Name:     text_info                                         */
119   /***    Function: This structure contains the block of words which  */
120   /***              make up the text section.                         */
121   /***                                                                */
122   /*** ****************************************************************/
123 
124   dcl 01 text_info            aligned based,
125        02 header              aligned,
126         03 N_text_words       fixed bin,
127         03 text_relinfol      fixed bin (21),
128        02 text_word           (0 refer (text_info.N_text_words))
129                               bit (36);
130 
131   /*** ****************************************************************/
132   /***                                                                */
133   /***    Name:     relinfo_str                                       */
134   /***    Function: This string contains the relocation info for the  */
135   /***              text or symbol word arrays.  The relinfo is       */
136   /***              stored in a separate segment since these sections */
137   /***              could conceivably be close to a full segment in   */
138   /***              size.                                             */
139   /***                                                                */
140   /*** ****************************************************************/
141 
142   dcl relinfo_strl            fixed bin (21);
143   dcl relinfo_strp            ptr;
144   dcl relinfo_str             char (relinfo_strl) based (relinfo_strp);
145 
146   /*** ****************************************************************/
147   /***                                                                */
148   /***    Name:     def_info                                          */
149   /***    Function: This structure contains the definition list for   */
150   /***              the object segment.  No threading information is  */
151   /***              included as this will be synthesized when the     */
152   /***              object is closed and the real definition section  */
153   /***              is constructed.                                   */
154   /***                                                                */
155   /*** ****************************************************************/
156 
157   dcl 01 def_info             aligned based,
158        02 header              aligned,
159         03 N_defs             fixed bin,
160        02 def                 (0 refer (def_info.N_defs)) like def_entry;
161 
162   dcl 01 def_entry            aligned based,
163        02 strx                fixed bin,
164        02 class               fixed bin,
165        02 offset              fixed bin,
166        02 flags               aligned,
167         03 ignore             bit (1) unaligned,
168         03 entry              bit (1) unaligned,
169         03 retain             bit (1) unaligned,
170         03 indirect           bit (1) unaligned,
171         03 duplicate          bit (1) unaligned,
172         03 mbz                bit (13) unaligned,
173        02 dup_tbl_relp        fixed bin (18) unsigned unaligned;
174 
175   /*** ****************************************************************/
176   /***                                                                */
177   /***    Name:     string_map_info                                   */
178   /***    Function: This structure defines the ACC strings to be      */
179   /***              placed in the definition section.  All references */
180   /***              to strings in other structures are stores as the  */
181   /***              stringmap index of the appropriate string.  The   */
182   /***              actual text is stored in a separate segment and   */
183   /***              individual strings identified as a start point    */
184   /***              and length.                                       */
185   /***                                                                */
186   /*** ****************************************************************/
187 
188   dcl 01 string_map_info      aligned based,
189        02 header              aligned,
190         03 string_segl        fixed bin (21),
191         03 N_strings          fixed bin,
192        02 string              dim (0 refer (string_map_info.N_strings))
193                               like string_map_entry;
194 
195   dcl 01 string_map_entry     aligned based,
196        02 start_offset        fixed bin (18) unsigned,
197        02 length              fixed bin (18) unsigned,
198        02 relp                fixed bin (18) unsigned;
199 
200   /*** ****************************************************************/
201   /***                                                                */
202   /***    Name:     exp_word_info                                     */
203   /***    Function: This structure maintains an array of expression   */
204   /***              words to be inserted into the definition section. */
205   /***              Expression words are referenced in the associated */
206   /***              link by an array index in this array.  The type   */
207   /***              pair associated with this expression word is      */
208   /***              identified by index in the type_pairs structure.  */
209   /***                                                                */
210   /*** ****************************************************************/
211 
212   dcl 01 exp_word_info        aligned based,
213        02 header              aligned,
214         03 N_exp_words        fixed bin,
215        02 exp_wd              (0 refer (exp_word_info.N_exp_words))
216                               like exp_word_entry;
217 
218   dcl 01 exp_word_entry       aligned based,
219        02 expression          fixed bin (18) unsigned,
220        02 type_pairx          fixed bin (18) unsigned,
221        02 relp                fixed bin (18) unsigned;
222 
223   /*** ****************************************************************/
224   /***                                                                */
225   /***    Name:     type_pair_info                                    */
226   /***    Function: This structure contains an array of type pairs to */
227   /***              be inserted into the definition section.  Each    */
228   /***              type pair entry contains the type, and class      */
229   /***              (only for type=1 and type=5), init_info table     */
230   /***              index (only for type=5), trap table index (only   */
231   /***              for type^=5, hopefully not ever), segname         */
232   /***              stringmap index (only for type=3 and type=4), and */
233   /***              offsetname stringmap index (only for type=4 and   */
234   /***              type=5).                                          */
235   /***                                                                */
236   /*** ****************************************************************/
237 
238   dcl 01 type_pair_info       aligned based,
239        02 header              aligned,
240         03 N_type_pairs       fixed bin,
241        02 type_pr             (0 refer (type_pair_info.N_type_pairs))
242                               like type_pair_entry;
243 
244   dcl 01 type_pair_entry      aligned based,
245        02 type                fixed bin (18) unsigned,
246        02 init_infox          fixed bin (18) unsigned,
247        02 segnamex            fixed bin (18) unsigned,
248        02 offsetnamex         fixed bin (18) unsigned,
249        02 relp                fixed bin (18) unsigned;
250 
251   /*** ****************************************************************/
252   /***                                                                */
253   /***    Name:     trap_pair_info                                    */
254   /***    Function: This structure contains trap pairs for specifying */
255   /***              trap-before-links.  Hopefully, this will never be */
256   /***              used, but since it is still documented, it should */
257   /***              be supported.                                     */
258   /***                                                                */
259   /*** ****************************************************************/
260 
261   dcl 01 trap_pair_info       aligned based,
262        02 header              aligned,
263         03 N_trap_pairs       fixed bin,
264        02 trap_pair           (0 refer (trap_pair_info.N_trap_pairs))
265                               like trap_pair_entry;
266 
267   dcl 01 trap_pair_entry      aligned based,
268        02 call_relp           fixed bin (18) unsigned,
269        02 info_relp           fixed bin (18) unsigned,
270        02 relp                fixed bin (18) unsigned;
271 
272   /*** ****************************************************************/
273   /***                                                                */
274   /***    Name:     init_info                                         */
275   /***    Function: This structure defines the init_info to be used   */
276   /***              for each type-5, class-5, (*system) link.  Each   */
277   /***              entry defines a single initialization info. Since */
278   /***              init_infos are of variable length, the actual     */
279   /***              init_info blocks supplied are appended back to    */
280   /***              back in another segment (pointed to by            */
281   /***              ocu_data.init_segp), and the init_info array      */
282   /***              giving start word and length.                     */
283   /***                                                                */
284   /*** ****************************************************************/
285 
286   dcl 01 init_info            aligned based,
287        02 header              aligned,
288         03 init_segl          fixed bin,
289         03 N_inits            fixed bin,
290        02 init                (0 refer (init_info.N_inits)) like init_entry;
291 
292   dcl 01 init_entry           aligned based,
293        02 start               fixed bin (18) unsigned,
294        02 length              fixed bin (18) unsigned,
295        02 relp                fixed bin (18) unsigned;
296 
297   /*** ****************************************************************/
298   /***                                                                */
299   /***    Name:     text_seg                                          */
300   /***    Function: This is the character string used to contain the  */
301   /***              actual text of the strings in the stringmap.      */
302   /***                                                                */
303   /*** ****************************************************************/
304 
305   dcl text_segl               fixed bin (21);
306   dcl text_segp               ptr;
307   dcl text_seg                char (text_segl) based (text_segp);
308 
309   /*** ****************************************************************/
310   /***                                                                */
311   /***    Name:     static_info                                       */
312   /***    Function: This structure defines the block of words that    */
313   /***              will make up the static section.  No relocation   */
314   /***              information is required.                          */
315   /***                                                                */
316   /*** ****************************************************************/
317 
318   dcl 01 static_info          aligned based,
319        02 header              aligned,
320         03 N_static_words     fixed bin,
321        02 static_word         dim (0 refer (static_info.N_static_words))
322                                    bit (36);
323 
324   /*** ****************************************************************/
325   /***                                                                */
326   /***    Name:     link_info                                         */
327   /***    Function: This structure defines the information required   */
328   /***              to construct the linkage section.  It contains    */
329   /***              the information to be inserted as the link array. */
330   /***              Each link entry contains the index of the         */
331   /***              exp_word entry for this link as well as the link  */
332   /***              modifier.  No header information or header offset */
333   /***              is included as this will be calculated when the   */
334   /***              real linkage section is produced.                 */
335   /***                                                                */
336   /*** ****************************************************************/
337 
338   dcl 01 link_info            aligned based,
339        02 header              aligned,
340         03 N_links            fixed bin,
341        02 link                (0 refer (link_info.N_links)) like link_entry;
342 
343   dcl 01 link_entry           aligned based,
344        02 exp_wordx           fixed bin (18) unsigned,
345        02 type                fixed bin (18) unsigned,
346        02 component           fixed bin (18) unsigned,
347        02 offset              fixed bin (18) unsigned,
348        02 modifier            bit (6);
349 
350   /*** ****************************************************************/
351   /***                                                                */
352   /***    Name:     firstref_trap_info                                */
353   /***    Function: This structure contains the information required  */
354   /***              to construct a first reference trap block in the  */
355   /***              linkage section if one is required.  Each trap    */
356   /***              entry contains a relpointer to the call link,     */
357   /***              which must be relocated to account for the static */
358   /***              section, as other linkage references, and a       */
359   /***              relpointer to the info link (likewise), or 0 if   */
360   /***              no info link is required.                         */
361   /***                                                                */
362   /*** ****************************************************************/
363 
364   dcl 01 firstref_trap_info   aligned based,
365        02 header              aligned,
366         03 N_traps            fixed bin,
367        02 trap                (0 refer (firstref_trap_info.N_traps))
368                               like firstref_trap_entry;
369 
370   dcl 01 firstref_trap_entry  aligned based,
371        02 call_relp           fixed bin (18) unsigned,
372        02 info_relp           fixed bin (18) unsigned;
373 
374   /*** ****************************************************************/
375   /***                                                                */
376   /***    Name:     symbol_info                                       */
377   /***    Function: This data structure contains the words which will */
378   /***              make up the symbol section and the associated     */
379   /***              relocation info for each halfword.  Note that the */
380   /***              relocation info itself should not be included in  */
381   /***              the symbol words emitted as it will be generated  */
382   /***              by ocu_.  Also note that the first thing in the   */
383   /***              symbol section is assumed to be a standard symbol */
384   /***              header, so that the relocation relp values can be */
385   /***              properly inserted.                                */
386   /***                                                                */
387   /*** ****************************************************************/
388 
389   dcl 01 symbol_info          aligned based (ocu_data.symbol_infop),
390        02 header              aligned,
391         03 N_symbol_words     fixed bin,
392         03 symbol_relinfol    fixed bin (21),
393        02 symbol_word (0 refer (symbol_info.N_symbol_words))
394                               bit (36);
395 
396   /*** ****************************************************************/
397   /***                                                                */
398   /***    Name:     relinfo_blocks                                    */
399   /***    Function: this is the relocation info bit strings to be     */
400   /***              inserted into the symbol section.                 */
401   /***                                                                */
402   /*** ****************************************************************/
403 
404   dcl 01 relinfo_blocks       aligned based,
405        02 header              aligned,
406         03 no_relinfo         bit (1),
407         03 n_bits             fixed bin,
408         03 section            dim (1:4),
409          04 start_offset      fixed bin,
410          04 n_bits            fixed bin,
411        02 relbits             bit (0 refer (relinfo_blocks.header.n_bits))
412                               aligned;
413 
414   dcl Rel_text                fixed bin static options (constant) init (1);
415   dcl Rel_defs                fixed bin static options (constant) init (2);
416   dcl Rel_link                fixed bin static options (constant) init (3);
417   dcl Rel_symb                fixed bin static options (constant) init (4);
418 
419   /*** ****************************************************************/
420   /***                                                                */
421   /***    Name:     relinfo                                           */
422   /***    Function: This structure is the structure of the relocation */
423   /***              information as stored in the object segment and   */
424   /***              as used in the creation time relocation info      */
425   /***              storage.                                          */
426   /***                                                                */
427   /*** ****************************************************************/
428 
429   dcl 01 relinfo              aligned based,
430        02 header              aligned,
431         03 decl_vers          fixed bin,
432         03 n_bits             fixed bin,
433        02 relbits             bit (0 refer (relinfo.n_bits)) aligned;
434 
435   /*** ****************************************************************/
436   /***                                                                */
437   /***    Name:     init_list_template                                */
438   /***    Function: This structure is the link_init_list_template     */
439   /***              init info block restructured so a like attribute  */
440   /***              can be used without contortions.                  */
441   /***                                                                */
442   /*** ****************************************************************/
443 
444   dcl 01 init_list_template   aligned based,
445        02 full_header         aligned,
446         03 header             aligned like link_init,
447         03 pad                bit (18) unaligned,
448         03 n_words_in_list    fixed bin (18) unsigned unaligned,
449        02 template            (0 refer (init_list_template.n_words_in_list))
450                               bit (36);
451 
452   /*** ****************************************************************/
453   /***                                                                */
454   /***    Name:     template_entry                                    */
455   /***    Function: This structure is the list_template_entry         */
456   /***              reorganized so that a like attribute declaration  */
457   /***              can be used without contortions.                  */
458   /***                                                                */
459   /*** ****************************************************************/
460 
461   dcl 01 template_entry       aligned based,
462        02 header              aligned,
463         03 n_bits             fixed bin (35) aligned,
464         03 mbz                bit (3) unaligned,
465         03 init_type          fixed bin (3) unsigned unaligned,
466         03 repeat             fixed bin (30) unsigned unaligned,
467        02 datum               bit (0 refer (list_template_entry.n_bits));
468 
469   /*** ****************************************************************/
470   /***                                                                */
471   /***    Name:     msf_symbol_scn                                    */
472   /***    Function: This structure is the symbol section for creating */
473   /***              component 0 of an object MSF.  It contains the    */
474   /***              minimal information required for component 0 to   */
475   /***              be a real live object segment.                    */
476   /***                                                                */
477   /*** ****************************************************************/
478 
479   dcl 01 msf_symbol_scn       aligned based,
480        02 header              aligned,
481         03 decl_version       fixed bin,
482         03 identifier         char (8) aligned,
483         03 gen_number         fixed bin,
484         03 gen_created        fixed bin (71),
485         03 object_created     fixed bin (71),
486         03 generator          char (8),
487         03 gen_version        unaligned,
488          04 offset            fixed bin (18) unsigned,
489          04 size              fixed bin (18) unsigned,
490         03 userid             unaligned,
491          04 offset            fixed bin (18) unsigned,
492          04 size              fixed bin (18) unsigned,
493         03 comment            unaligned,
494          04 offset            fixed bin (18) unsigned,
495          04 size              fixed bin (18) unsigned,
496         03 text_boundary      fixed bin (18) unsigned unaligned,
497         03 stat_boundary      fixed bin (18) unsigned unaligned,
498         03 source_map         fixed bin (18) unsigned unaligned,
499         03 area_pointer       fixed bin (18) unsigned unaligned,
500         03 backpointer        fixed bin (18) unsigned unaligned,
501         03 block_size         fixed bin (18) unsigned unaligned,
502         03 next_block         fixed bin (18) unsigned unaligned,
503         03 rel_text           fixed bin (18) unsigned unaligned,
504         03 rel_def            fixed bin (18) unsigned unaligned,
505         03 rel_link           fixed bin (18) unsigned unaligned,
506         03 rel_symbol         fixed bin (18) unsigned unaligned,
507         03 mini_truncate      fixed bin (18) unsigned unaligned,
508         03 maxi_truncate      fixed bin (18) unsigned unaligned,
509        02 user                aligned char (user_length
510                                refer(msf_symbol_scn.header.userid.size)),
511        02 version             aligned char (version_length
512                                refer(msf_symbol_scn.header.gen_version.size));
513   dcl user_length             fixed bin;
514   dcl version_length          fixed bin;
515 
516   /*** ****************************************************************/
517   /***                                                                */
518   /***    Name:     msf_info                                          */
519   /***    Function: this structure is used to retain the list of      */
520   /***              components in the MSF                             */
521   /***                                                                */
522   /*** ****************************************************************/
523 
524   dcl 01 msf_info             aligned based,
525        02 header              aligned,
526         03 containing_dir     char (168) unaligned,
527         03 gen_info           aligned,
528          04 gen_created       fixed bin (71),
529          04 generator         char (8),
530          04 gen_number        fixed bin,
531          04 gen_version       char (512) varying,
532         03 N_components       fixed bin,
533        02 component           dim (0 refer (msf_info.N_components)),
534         03 segp               ptr,
535         03 bc                 fixed bin (24),
536         03 text_relp          fixed bin (18) unsigned,
537         03 defn_relp          fixed bin (18) unsigned,
538         03 link_relp          fixed bin (18) unsigned,
539         03 stat_relp          fixed bin (18) unsigned,
540         03 symb_relp          fixed bin (18) unsigned;
541 
542 /****  END OF:      ocu_structures.incl.pl1                  *  *  *  *  *  */