1 /*  START OF:       ocu_dcls.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 subroutines and data structures used by
  7      callers of ocu_.
  8                                                    END HISTORY COMMENTS */
  9 
 10   /*** ****************************************************************/
 11   /***                                                                */
 12   /***    Name:     ocu_dcls                                          */
 13   /***    Function: These are the entrypoints and structures required */
 14   /***              to use the ocu_ object creation utilities.        */
 15   /***                                                                */
 16   /*** ****************************************************************/
 17 
 18   /* open option flags */
 19 
 20   dcl OPEN_FLAGS_BOUND        bit (6) static options (constant)
 21                               init ("100000"b);
 22   dcl OPEN_FLAGS_RELOCATABLE  bit (6) static options (constant)
 23                               init ("010000"b);
 24   dcl OPEN_FLAGS_PROCEDURE    bit (6) static options (constant)
 25                               init ("001000"b);
 26   dcl OPEN_FLAGS_SEPARATE_STATIC
 27                               bit (6) static options (constant)
 28                               init ("000100"b);
 29   dcl OPEN_FLAGS_PERPROCESS_STATIC
 30                               bit (6) static options (constant)
 31                               init ("000010"b);
 32   dcl OPEN_FLAGS_NO_HASHTABLE bit (6) static options (constant)
 33                               init ("000001"b);
 34 
 35   /* definition flags */
 36 
 37   dcl DEFINITION_FLAGS_IGNORE bit (4) static options (constant) init ("1000"b);
 38   dcl DEFINITION_FLAGS_ENTRY  bit (4) static options (constant) init ("0100"b);
 39   dcl DEFINITION_FLAGS_RETAIN bit (4) static options (constant) init ("0010"b);
 40   dcl DEFINITION_FLAGS_INDIRECT
 41                               bit (4) static options (constant) init ("0001"b);
 42 
 43   /* input structures */
 44 
 45   dcl word_arrayp             ptr;
 46   dcl word_arrayl             fixed bin (18) unsigned;
 47 
 48   dcl word_array(word_arrayl) bit (36) based (word_arrayp);
 49 
 50   dcl reloc_strp              ptr;
 51   dcl reloc_strl              fixed bin (21);
 52 
 53   dcl reloc_str               char (reloc_strl) based (reloc_strp);
 54 
 55   dcl component_listp         ptr;
 56   dcl component_count         fixed bin (15) unsigned;
 57 
 58   dcl component_list (1:component_count)
 59                               ptr based (component_listp);
 60 
 61   dcl 01 gen_info             aligned based,
 62        02 gen_created         fixed bin (71),
 63        02 generator           char (8),
 64        02 gen_number          fixed bin,
 65        02 gen_version         char (512) varying;
 66 
 67   /* entrypoint declarations */
 68 
 69   dcl ocu_$open               /* setup to create an object            */
 70           entry (char(*),               /* directory name       (in ) */
 71                  char(*),               /* entry name           (in ) */
 72                  bit(*),                /* option flags         (in ) */
 73                  ptr,                   /* ocu_data pointer     (out) */
 74                  fixed bin(35));        /* error code           (out) */
 75 
 76   dcl ocu_$close              /* create the object segment            */
 77           entry (ptr,                   /* ocu_data pointer     (in ) */
 78                  fixed bin(35));        /* error code           (out) */
 79 
 80   dcl ocu_$release            /* release storage on cleanup           */
 81           entry (ptr);                  /* ocu_data pointer     (in ) */
 82 
 83   dcl ocu_$emit_text          /* emit a block of text words           */
 84           entry (ptr,                   /* ocu_data pointer     (in ) */
 85                  ptr,                   /* word array pointer   (in ) */
 86                  ptr,                   /* reloc string pointer (in ) */
 87                  fixed bin (18) uns)    /* word count           (in ) */
 88           returns(fixed bin (18) uns);  /* text relp            (out) */
 89 
 90   dcl ocu_$emit_definition    /* emit a single definition entry       */
 91           entry (ptr,                   /* ocu_data pointer     (in ) */
 92                  char(*) var,           /* definition name      (in ) */
 93                  fixed bin (3),         /* target section       (in ) */
 94                  fixed bin (18) uns,    /* offset in section    (in ) */
 95                  bit(*))                /* definition flags     (in ) */
 96           returns(fixed bin (18) uns);  /* definition relp      (out) */
 97 
 98   dcl ocu_$emit_segname       /* emit a single segname definition     */
 99           entry (ptr,                   /* ocu_data pointer     (in ) */
100                  char(*) var,           /* segname              (in ) */
101                  bit(*))                /* definition flags     (in ) */
102           returns(fixed bin (18) uns);  /* definition relp      (out) */
103 
104   dcl ocu_$emit_msf_map       /* emit an msf map (MSF components)     */
105           entry (ptr,                   /* ocu_data pointer     (in ) */
106                  fixed bin (15) uns,    /* component count      (in ) */
107                  fixed bin (15) uns);   /* my component         (in ) */
108 
109   dcl ocu_$emit_static        /* emit a block of static words         */
110           entry (ptr,                   /* ocu_data pointer     (in ) */
111                  ptr,                   /* word array pointer   (in ) */
112                  fixed bin (18) uns)    /* word count           (in ) */
113           returns(fixed bin (18) uns);  /* static relp          (out) */
114 
115   dcl ocu_$emit_link          /* emit a single external link          */
116           entry (ptr,                   /* ocu_data pointer     (in ) */
117                  fixed bin (3),         /* link type            (in ) */
118                  fixed bin (3),         /* link class           (in ) */
119                  char(*) var,           /* target refname       (in ) */
120                  char(*) var,           /* target definition    (in ) */
121                  fixed bin,             /* expression offset    (in ) */
122                  bit(6),                /* link modifier        (in ) */
123                  ptr)                   /* init info pointer    (in ) */
124           returns(fixed bin (18) uns);  /* link relp            (out) */
125 
126   dcl ocu_$emit_partial_link  /* emit a single partial link           */
127           entry (ptr,                   /* ocu_data pointer     (in ) */
128                  fixed bin (15) uns,    /* target component     (in ) */
129                  fixed bin (3),         /* target section       (in ) */
130                  fixed bin (18) uns,    /* offset in section    (in ) */
131                  bit(6))                /* link modifier        (in ) */
132           returns(fixed bin (18) uns);  /* link relp            (out) */
133 
134   dcl ocu_$emit_firstref_trap /* add a trap to the firstref block     */
135           entry (ptr,                   /* ocu_data pointer     (in ) */
136                  fixed bin (18) uns,    /* call relp            (in ) */
137                  fixed bin (18) uns);   /* info relp            (in ) */
138 
139   dcl ocu_$emit_symbol        /* emit a block of symbol words         */
140           entry (ptr,                   /* ocu_data pointer     (in ) */
141                  ptr,                   /* word array pointer   (in ) */
142                  ptr,                   /* reloc string pointer (in ) */
143                  fixed bin (18) uns)    /* word count           (in ) */
144           returns(fixed bin (18) uns);  /* symbol relp          (out) */
145 
146   dcl ocu_$backpatch          /* patch a word in the text/symbol scn  */
147           entry (ptr,                   /* ocu_data pointer     (in ) */
148                  char(*),               /* section              (in ) */
149                  fixed bin (18) uns,    /* offset in section    (in ) */
150                  char(*),               /* side and size        (in ) */
151                  fixed bin (35));       /* new value to patch   (in ) */
152 
153   dcl ocu_$create_msf         /* create component 0 of the MSF        */
154           entry (ptr,                   /* component array ptr  (in ) */
155                  fixed bin (15) uns,    /* component count      (in ) */
156                  ptr,                   /* generator info ptr   (in ) */
157                  fixed bin(35));        /* error code           (out) */
158 
159 /*  END OF:         ocu_dcls.incl.pl1                        *  *  *  *  *  */