1 /*  START OF:       bsr_structures.incl.pl1                   *  *  *  *  *  */
  2 
  3 /* format: style4,declareind10,dclind10,idind20,indattr,delnl,insnl */
  4 
  5 /****^  HISTORY COMMENTS:
  6   1) change(86-09-17,Farley), approve(86-07-18,MCR7439),
  7      audit(86-09-24,Fawcett), install(86-10-20,MR12.0-1189):
  8      Created to define the BCE Save/Restore internal structures.
  9   2) change(87-07-09,Farley), approve(87-07-17,MCR7733),
 10      audit(87-07-21,Fawcett), install(87-07-31,MR12.1-1051):
 11      Added tdcw and pad fields to stat_ws structure for chaining set-densities
 12      to first read/write I/O..
 13   3) change(87-11-16,Farley), approve(88-02-26,MCR7811),
 14      audit(88-03-04,Fawcett), install(88-03-15,MR12.2-1035):
 15      Added zero_vtoc flag to pv structure. Moved zrec counter from part to pv.
 16      This will allow zeroing of both partition and vtoc areas.
 17   4) change(88-04-12,Farley), approve(88-05-31,MCR7902),
 18      audit(88-05-31,Fawcett), install(88-07-05,MR12.2-1052):
 19      Added tcb.records_written to count actual records written to tape and to
 20      validate the tape sequence numbers of the records written to tape.
 21                                                    END HISTORY COMMENTS */
 22 
 23 dcl       iobp                ptr;
 24 dcl       1 iob               aligned based (iobp),         /* I/O buffer */
 25             2 next_bufx       fixed bin (17) unal,          /* ptr to the next buffer in list of all buffers */
 26             2 next_statex     fixed bin (17) unal,          /* ptr to next buffer of this state */
 27             2 state           fixed bin,                    /* buffer state */
 28             2 state_time      fixed bin (71),               /* time of state change */
 29             2 datax           bit (18) unal,                /* index of data page */
 30             2 flags           unal,
 31               3 write         bit (1),                      /* "1"b = write data */
 32                                                             /* "0"b = read data */
 33               3 pad           bit (17),
 34             2 disk_post_buf   fixed bin,                    /* # of the disk IO posting buffer */
 35             2 idcw_word       bit (36),                     /* holds IDCW */
 36             2 header_dcw      bit (36),                     /* index to iob.head */
 37             2 data_dcw        bit (36),                     /* index to page of data */
 38             2 tdcw_word       bit (36),                     /* transfer dcw to the next buffer */
 39             2 head            like rec_header,              /* tape record header. */
 40             2 pad2            (2) bit (36);                 /* pad out to 24 words */
 41 
 42 dcl       part_arrayp         ptr;
 43 dcl       1 part_array        (64) aligned like part based (part_arrayp);
 44 
 45 dcl       partp               ptr;
 46 dcl       1 part              aligned based (partp),        /* partition list entry */
 47             2 name            char (4),                     /* partition name */
 48             2 pv_name         char (32),                    /* volume name */
 49             2 device          char (8),                     /* "dskX_NNs" */
 50             2 pv_pvtx         fixed bin (17) unal,          /* pv index */
 51             2 next_idx        fixed bin (17) unal,          /* thread to next part */
 52             (
 53             2 complete        bit (1),                      /* save/restore complete */
 54             2 removed         bit (1),                      /* don't process flag */
 55             2 pad             bit (16)
 56             )                 unal,
 57             2 frec            fixed bin (17) unal,          /* starting record from PV label */
 58             2 lrec            fixed bin (17) unal,          /* ending record from PV label */
 59             2 nrec            fixed bin (17) unal,          /* number of recs from PV label */
 60             2 tfrec           fixed bin (17) unal,          /* starting record from preamble.label */
 61             2 tlrec           fixed bin (17) unal,          /* ending record from preamble.label */
 62             2 tnrec           fixed bin (17) unal;          /* number of recs from preamble.label */
 63 
 64 dcl       pv_arrayp           ptr;
 65 dcl       1 pv_array          (63) aligned like pv based (pv_arrayp);
 66 
 67 dcl       pvp                 ptr;
 68 dcl       1 pv                aligned based (pvp),          /* PV list entry */
 69             2 name            char (32),                    /* pv_name */
 70             2 real_name       char (32),                    /* pv_name from PV label */
 71             2 device          char (8),                     /* "dskX_NNs" */
 72             2 pvtx            fixed bin (17) unal,          /* pv index */
 73             2 state           fixed bin (17) unal,          /* current state in S/R */
 74             2 restart         aligned,                      /* volume restart info */
 75               3 rec_on_pv     fixed bin (18),               /* restart at this record */
 76               3 rec_in_type   fixed bin,                    /* relative record */
 77             2 part_idx        fixed bin (17) unal,          /* index to partition thread */
 78             (
 79             2 all             bit (1),                      /* save all flag */
 80             2 part_requested  bit (1),                      /* asked for partition(s) */
 81             2 all_parts       bit (1),                      /* user wants all partitions */
 82             2 only_part       bit (1),                      /* only s/r partition flag */
 83             2 complete        bit (1),                      /* save/restore complete */
 84             2 removed         bit (1),                      /* don't process flag */
 85             2 zero_vtoc       bit (1),                      /* used to clear VTOC before restore */
 86             2 pad             bit (11)
 87             )                 unal,
 88             2 zrec            fixed bin (17) unal;          /* used during zeroing on restore */
 89 
 90 dcl       si_version_1        char (8) internal static options (constant) init ("si_ver01");
 91 dcl       si_ptr              ptr;
 92 dcl       1 si                aligned based (si_ptr),       /* per set info */
 93             2 version_id      char (8),
 94 /**** Pointers */
 95             2 bit_map_ptr     ptr,                          /* ptr to bit map */
 96             2 datap           ptr,                          /* ptr to tape data page */
 97             2 info_tape_label_ptr
 98                               ptr,
 99             2 part_ptr        ptr,
100             2 pv_ptr          ptr,
101             2 tape_label_ptr  ptr,
102             2 tcb_ptr         ptr,                          /* tape control-block ptr */
103             2 vol_preamble_ptr
104                               ptr,
105             2 vol_map_ptr     ptr,
106             2 vol_info_ptr    ptr,
107 /**** Fixed Bin */
108             2 current_rec_in_area
109                               fixed bin (18),
110             2 first_disk_post_buf
111                               fixed bin,
112             2 first_rec       fixed bin (18),
113             2 first_tape_number
114                               fixed bin,
115             2 ioi_term_post_buf
116                               fixed bin,
117             2 ioi_spec_post_buf
118                               fixed bin,
119             2 ioi_statusx     fixed bin (18),
120             2 last_rec        fixed bin (18),
121             2 last_tape_number
122                               fixed bin,
123             2 last_used_vtoc_record
124                               fixed bin (18),
125             2 next_tape_number
126                               fixed bin,
127             2 old_rec_type    fixed bin,
128             2 part_count      fixed bin,
129             2 previous_rec    fixed bin (18),
130             2 pv_count        fixed bin,
131             2 pvx             fixed bin,
132             2 rec_type        fixed bin,
133             2 recordx         fixed bin (18),
134             2 tape_count      fixed bin,
135             2 tape_rec_count  fixed bin (35),
136             2 tape_seq_number fixed bin,
137             2 tcbx            fixed bin,                    /* index into tape control-block array */
138             2 usable_tape_devices
139                               fixed bin,
140 /**** Character Strings */
141             2 old_part_name   char (4) unal,
142             2 tape_set        char (32) unal,
143 /**** Bit Strings */
144             2 complete        bit (1),
145             2 display_pv_record
146                               bit (1),
147             2 find_start_of_part
148                               bit (1),
149             2 last_idcwx      bit (18),
150             2 need_info_tape  bit (1),
151             2 need_zero_record
152                               bit (1),
153             2 pv_record_detected
154                               bit (1),
155             2 pvid_being_restored
156                               bit (36),
157             2 restart         bit (1),
158             2 restart_requested
159                               bit (1),
160             2 tape_set_uid    bit (36),
161             2 write_eof       bit (1),
162             2 written_preamble
163                               bit (1),
164             2 written_tape_label
165                               bit (1);
166 
167 dcl       sri_version_1       char (8) internal static options (constant) init ("sri_v001");
168 dcl       srip                ptr;
169 dcl       1 sri               aligned based (srip),         /* save/restore info */
170             2 version_id      char (8),                     /* current structure version */
171             2 cf_arrayp       ptr,                          /* control file array ptr */
172             2 cf_count        fixed bin,                    /* control files given */
173             2 cfx             fixed bin,                    /* current control file index */
174             2 flags           unaligned,
175               3 doing_restore bit (1),                      /* "1"= restore, "0"= save */
176               3 debug         bit (1),                      /* general debug flag */
177               3 pad           bit (34),
178             2 set_index       fixed bin (17) unal,          /* current set_info index */
179             2 set_count       fixed bin (17) unal,          /* SETs defined */
180             2 set_infop       ptr,                          /* ptr to set_info array */
181             2 part_area_ptr   ptr,                          /* ptr to part area */
182             2 pv_area_ptr     ptr,                          /* ptr to pv area */
183             2 tcb_area_ptr    ptr,                          /* ptr to tcb area */
184             2 pvt_array_ptr   ptr,                          /* ptr to  pvt_array */
185             2 whoami          char (8) unaligned;           /* "save" or "restore" */
186 
187 dcl       1 stat_ws           aligned based (tcb.wksp),     /* IOI workspace for non-data xfers */
188             2 retry_dcw       (3) bit (36),
189             2 idcw            bit (36),                     /* non-data idcw */
190             2 tdcw            bit (36),                     /* tdcw for chaining when needed */
191             2 pad             bit (36),                     /* pad, so stat_ws.stat will be even */
192             2 stat            like istat;
193 
194 dcl       1 survey_ws         aligned based (tcb.wksp),     /* IOI workspace for survey devices */
195             2 idcw            bit (36),                     /* survey devices command. */
196             2 dcw             bit (36),                     /* DCW for survey devices command. */
197             2 stat            like istat,
198             2 data,
199               3 handler       (16) unaligned,
200                 4 pad1        bit (1),
201                 4 reserved    bit (1),
202                 4 operational bit (1),
203                 4 ready       bit (1),
204                 4 number      uns fixed bin (5),
205                 4 pad2        bit (1),
206                 4 speed       uns fixed bin (3),
207                 4 nine_track  bit (1),
208                 4 density     uns fixed bin (4);
209 
210 dcl       tcb_arrayp          ptr;
211 dcl       1 tcb_array         (0:16) aligned like tcb based (tcb_arrayp);
212                                                             /* 0 is for MPC if needed */
213 
214 dcl       tcbp                ptr;
215 dcl       1 tcb               aligned based (tcbp),         /* tape control-block */
216             2 name            char (8),                     /* "tapX_nn" */
217             2 device          fixed bin,                    /* device number */
218             2 ioi_index       fixed bin,                    /* IOI index */
219             2 ioi_ev_chn      fixed bin (71),               /* event channel */
220             2 wksp            ptr,                          /* ptr to workspace */
221             2 tape_vol_number char (4),                     /* current tape volume# */
222             2 nbufs           fixed bin,                    /* # of buffers */
223             2 buf_listx       fixed bin,                    /* offset to buffer list */
224             2 status_count    fixed bin,                    /* number of entries in status queue */
225             2 status_idx      fixed bin,                    /* status queue index */
226             2 statusx         fixed bin,                    /* position of status queue */
227             2 records_written fixed bin,                    /* number of records written */
228             2 retry_count     fixed bin,                    /* times we've retried */
229             2 flags           unal,                         /* FLAGS */
230               3 removed       bit (1),                      /* device is unavailable */
231               3 attached      bit (1),                      /* device is attached via IOI */
232               3 surveyed      bit (1),                      /* device has been surveyed */
233               3 fips          bit (1),                      /* device is a FIPS type */
234               3 write_tape    bit (1),                      /* user wants to write */
235               3 mount_requested
236                               bit (1),                      /* Mount message already displayed */
237               3 tape_mounted  bit (1),                      /* tape on device */
238               3 write_protected
239                               bit (1),                      /* no write ring */
240               3 density_set   bit (1),                      /* device density has been set */
241               3 one_eof       bit (1),                      /* single EOF detected */
242               3 eot           bit (1),                      /* EOT detected */
243               3 retry_in_progress
244                               bit (1),
245             2 density_command bit (6) unal,                 /* for idcw when setting density */
246             2 density         bit (5) unal,                 /* current density */
247                                                             /* "00000"b = not set */
248                                                             /* "00100"b = 800 */
249                                                             /* "00010"b = 1600 */
250                                                             /* "00001"b = 6250 */
251             2 densities_available
252                               bit (5) unal,                 /* available densities */
253             2 speed           bit (3) unal;                 /* speed of device */
254                                                             /* "100"b = 75 ips */
255                                                             /* "010"b = 125 ips */
256                                                             /* "001"b = 200 ips */
257 
258 
259 
260 /*  END OF:         bsr_structures.incl.pl1                   *  *  *  *  *  */