1 /*  START OF:       oc_data.incl.pl1                          *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
  2 
  3 
  4 /****^  HISTORY COMMENTS:
  5   1) change(1985-11-14,Farley), approve(1985-11-14,MCR6979),
  6      audit(1985-11-14,Fawcett), install(1986-03-21,MR12.0-1033):
  7      Add support for MCA
  8      and IMU.
  9   2) change(1985-12-03,Farley), approve(1985-12-03,MCR7306),
 10      audit(1985-12-03,Fawcett), install(1986-03-21,MR12.0-1033):
 11      Fix bugs found while doing Dipper changes.
 12   3) change(1985-12-03,Farley), approve(1985-12-03,MCR7312),
 13      audit(1985-12-03,Fawcett), install(1986-03-21,MR12.0-1033):
 14      Add BCE MCA lock and unlock.
 15   4) change(1986-08-07,Farley), approve(1986-10-07,MCR7523),
 16      audit(1986-10-03,Fawcett), install(1986-10-09,MR12.0-1181):
 17      Removed timeout_factor, as it is nolonger needed.
 18   5) change(1989-08-28,Farley), approve(1989-09-18,MCR8132),
 19      audit(1989-10-10,WAAnderson), install(1989-10-11,MR12.3-1091):
 20      Increased MAX_IO_LENGTH from 132 to 256 to be consistent with
 21      oc_trans_output_.  This also affects the size of oc_data structures. Trace
 22      entries have been reduced from 168 to 130.
 23   6) change(2021-10-29,Swenson), approve(2021-10-29,MCR10095),
 24      audit(2021-10-29,GDixon), install(2021-10-29,MR12.8-1004):
 25      added got_terminate_int no lock flag.
 26                                                    END HISTORY COMMENTS */
 27 
 28           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */
 29           /*                                                                                                  */
 30           /* Purpose:                                                                                         */
 31           /*                                                                                                  */
 32           /*        This include file describes the contents of the oc_data segment as well various other     */
 33           /*        static values utilized to interface operator's consoles. Changes to this structure that   */
 34           /*        would affect the size of the oc_data segment will require a change in the size of oc_data */
 35           /*        as specified in the MST header. This is true because the segment is fabricated at boot    */
 36           /*        time and the size must be known prior to fabrication.                                     */
 37           /*                                                                                                  */
 38           /*        This include file was recoded from its original version to add support for multiple       */
 39           /*        consoles.                                                                                 */
 40           /*                                                                                                  */
 41           /* Re-written:                05/01/83                                                              */
 42           /*                                                                                                  */
 43           /* Author:                    E. A. Ranzenbach    (Ranzenbach.Multics@M)                            */
 44           /* Location:                  System-M.                                                             */
 45           /* Release:                   MR10.2                                                                */
 46           /*                                                                                                  */
 47           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */
 48           /*                                                                                                  */
 49           /* Modifications:                                                                                   */
 50           /*                                                                                                  */
 51           /*  Date    Author                      Reason                                                      */
 52           /*                                                                                                  */
 53           /*  840410  Edward A. Ranzenbach        Cut size of I/O's to 132 chars...                           */
 54           /*  840427  Edward A. Ranzenbach        Added "off" console state..."                               */
 55           /*  850111  Edward A. Ranzenbach        Added lost special interrupt protection.                    */
 56           /*  850215  Paul K Farley               Add pcw_ignored flag in oc_entry.                           */
 57           /*  850522  Paul K Farley               Add MCA lock/unlock info.                                   */
 58           /*  850827  Paul K Farley               Add more info to event trace.                               */
 59           /*  850913  Paul K Farley               Add timeout_factor variable to oc_entry.                    */
 60           /*  851114  Paul K Farley               Remove pcw_ignored flag, imu flag will do.                  */
 61           /*                                                                                                  */
 62           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */
 63 
 64 /* format: off */
 65 ^L
 66           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */
 67           /*                                                                                                  */
 68           /* The DCW list consists of an array of sixteen single word Device Control Words that are used to   */
 69           /* drive the console devices. These DCWs are listed in their stored order followed by the effects   */
 70           /* that they produce:                                                                               */
 71           /*                                                                                                  */
 72           /*        1  =  reset status IDCW       ->        Reset the console channel...                      */
 73           /*        2  =  write alert IDCW        ->        Output a bell character to the console...         */
 74           /*        3  =  write IDCW              ->        Put console in output mode...                     */
 75           /*        4  =  write  DCW              ->        Describes intended outgoing data transfer...      */
 76           /*        5  =  write IDCW - newline    ->        Put console in output mode...                     */
 77           /*        6  =  write  DCW - newline    ->        Describes newline transfer...                     */
 78           /*        7  =  read  IDCW              ->        Put the console in input mode...                  */
 79           /*        8  =  read   DCW              ->        Describes intended data transfer...               */
 80           /*        9  =  read_unechoed  IDCW     ->        Put the console in unechoed input mode...         */
 81           /*        10 =  read_unechoed  DCW      ->        Describes intended data transfer...               */
 82           /*        11 =  write IDCW - prompt                                                                 */
 83           /*        12 =  write  DCW - prompt                                                                 */
 84           /*        13 =  write IDCW - discard    ->        Put console in output mode...                     */
 85           /*        14 =  write  DCW - discard    ->        Describes discard notice...                       */
 86           /*        15 =  lock MCA IDCW           ->        Disable MCA input from console...                 */
 87           /*        16 =  unlock MCA IDCW         ->        Enable MCA input from console...                  */
 88           /*                                                                                                  */
 89           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */
 90 ^L
 91      dcl  oc_data$            external;                                         /* so we can find it...                 */
 92 
 93      dcl  1 oc_data                     aligned    based     (oc_data_ptr),
 94                2 lock                   bit (36),                               /* global lock for all of oc_data...    */
 95                2 version                char      (4),                          /* should equal oc_data_version...      */
 96                2 console_cnt            fixed bin (17)      unaligned,          /* number of configured consoles...     */
 97                2 bootload_console_idx   fixed bin (17)      unaligned,          /* index into opc of bootload console...*/
 98                2 flags,
 99                     3 in_service        bit       (1)       unaligned,          /* ON => at least one usable console... */
100                     3 crash_on_crf      bit       (1)       unaligned,          /* ON => crash on recovery failure...   */
101                     3 mc_io_enabled     bit       (1)       unaligned,          /* ON => MC is handling I/O...          */
102                     3 list_consoles     bit       (1)       unaligned,          /* ON => list the console assignments...*/
103                     3 printer_on        bit       (1)       unaligned,          /* ON => echo read characters...        */
104                     3 write_q_full      bit       (1)       unaligned,          /* ON => the write queue is full...     */
105                     3 must_have_console bit       (1)       unaligned,          /* ON => we must have a real console... */
106                     3 pad_oc_data_flags bit       (29)      unaligned,          /* pad to word boundry...               */
107                2 no_lock_flags,                                                 /* these flags can be modified without  */
108                                                                                 /* lock protection...                   */
109                     3 got_special_int   bit       (1)       unaligned,          /* we could not process this special... */
110                     3 got_terminate_int bit       (1)       unaligned,          /* we could not process this terminate. */
111                     3 pad_no_lock_flags bit       (34)      unaligned,
112                2 pad_misc               fixed bin (35),                         /* to preserve even word alignment...   */
113                2 prompt                 char      (8),                          /* string used to prompt for input...   */
114                2 discard_notice         char      (24),                         /* displayed at BREAK condition...      */
115                2 write_return           bit       (36),                         /* newline string = PAD PAD CR NL...    */
116                2 abs_addr               fixed bin (26),                         /* absolute address of oc_data$...      */
117                2 status_ptr             ptr,                                    /* points to IOM status word...         */
118                2 io_ptr                 ptr,                                    /* -> I/O being processed...            */
119                2 last_read_queued       fixed bin (71),                         /* last time a READ was queued...       */
120                2 last_write_queued      fixed bin (71),                         /* last time a WRITE was queued...      */
121                2 last_poll_time         fixed bin (71),                         /* last time of timeout poll by pxss... */
122                2 max_computed_io_time   fixed bin (71),                         /* maximum time an I/O could take...    */
123                2 err_event_cid          fixed bin (71),                         /* channel used to signal inop state... */
124                2 err_event_pid          bit       (36),                         /* ID of process handling inop states...*/
125                2 reader_process_id      bit       (36),                         /* only process allowed to read...      */
126                2 next_free_write        fixed bin (17)      unaligned,          /* index of the next free WRITE slot... */
127                2 next_event             fixed bin (17)      unaligned,          /* next event index...                  */
128                2 stacked_read_cnt       fixed bin (17)      unaligned,          /* READ stack...                        */
129                2 pad_oc_data            bit       (18)      unaligned,
130                2 priority_io  like      console_io,                             /* oc_data|42(8)...                     */
131                2 read_io      like      console_io,                             /* oc_data|154(8)...                    */
132                2 write_queue            (WRITE_QUEUE_SIZE)                      /* oc_data|266(8)...                    */
133                               like      console_io,
134                2 meters,                                                        /* metering cell at oc_data|1406...     */
135                     3 pushed_read_cnt   fixed bin (35),                         /* count of times read stack was used...*/
136                     3 write_q_full_cnt  fixed bin (35),                         /* count of WRITE fails for no room...  */
137                     3 queued_special_int_count
138                                         fixed bin (35),
139                     3 pad_meters(7)     fixed bin (35),                         /* for future use...                    */
140                2 opc          (MAX_OPC_CNT)                                     /* oc_data|1420, 1454, 1510, 1544, 1600...*/
141                               like      oc_entry,                               /* 1634, 1670, 1724...                  */
142                2 event        (EVENT_QUEUE_SIZE)                                /* oc_data|1760 thru oc_data|3777...    */
143                               like      oc_event;
144 ^L
145 
146           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */
147           /*                                                                                                  */
148           /* The following structure describes a configured console.                                          */
149           /*                                                                                                  */
150           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */
151 
152 
153      dcl  1 oc_entry          aligned   based     (oc_entry_ptr),               /* one for each console 34(8) words... */
154                2 name                   char      (4),                          /* name of this console, i.e. "opca"... */
155                2 opc_idx                fixed bin (17)      unaligned,          /* index of this entry in opc array...  */
156                2 model                  fixed bin (17)      unaligned,          /* model of the console...              */
157                2 flags,
158                     3 active            bit       (1)       unaligned,          /* ON => this entry is in use...        */
159                     3 assigned          bit       (1)       unaligned,          /* ON => io_manager knows device...     */
160                     3 bootload_console  bit       (1)       unaligned,          /* ON => this is the bootload console...*/
161                     3 alternate         bit       (1)       unaligned,          /* ON => console used if active fails...*/
162                     3 inop_device       bit       (1)       unaligned,          /* ON => console is inoperative...      */
163                     3 io_device         bit       (1)       unaligned,          /* ON => console is not available to us.*/
164                     3 no_device         bit       (1)       unaligned,          /* ON => console has been deleted...    */
165                     3 config_change     bit       (1)       unaligned,          /* ON => config change has occurred...  */
166                     3 prompt            bit       (1)       unaligned,          /* ON => prompt for input...            */
167                     3 pcw_io            bit       (1)       unaligned,          /* ON => use PCW's instead of IDCW's... */
168                     3 io_in_progress    bit       (1)       unaligned,          /* ON => I/O op is in progress...       */
169                     3 got_special_int   bit       (1)       unaligned,          /* ON => RE(TURN QUEST) key was hit...  */
170                     3 oper_request      bit       (1)       unaligned,          /* ON => operator has hit request key...*/
171                     3 discard           bit       (1)       unaligned,          /* ON => discard output...              */
172                     3 discarded         bit       (1)       unaligned,          /* ON => (output discarded) printed...  */
173                     3 read_unechoed_option                                      /* ON => read_unechoed option installed.*/
174                                         bit       (1)       unaligned,          /* option must not be installed...      */
175                     3 imu               bit       (1)       unaligned,          /* ON => console located in an IMU...   */
176                     3 pad_flag          bit       (19)      unaligned,          /* pad to word boundry...               */
177                2 channel                char      (8),                          /* name of this console's channel...    */
178                2 device_idx             fixed bin (35),                         /* operator's console device id...      */
179                2 line_leng              fixed bin (17)      unaligned,          /* line length of the console...        */
180                2 dcw_list_idx           fixed bin (17)      unaligned,          /* DCW list in progess...               */
181                2 retry_cnt              fixed bin (17)      unaligned,          /* times I/O op has been retried...     */
182                2 RESERVED_PAD           fixed bin (17)      unaligned,          /* pad to oc_entry + 10(8)...           */
183                2 io_time                fixed bin (71),                         /* time last I/O began...               */
184                2 status_word            bit       (36),                         /* last valid status word received...   */
185                2 dcw_list     (16)      bit       (36),                         /* DCWs used to drive the console...    */
186                2 pad_oc_entry_end       bit       (36);                         /* pad to 34(8) words...                */
187 ^L
188 
189           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */
190           /*                                                                                                  */
191           /* This is the format of a console I/O. A pointer to this structure is passed to us by the process  */
192           /* wishing to perform a console I/O. The caller will fill in the following things for a read I/O:   */
193           /*                                                                                                  */
194           /*        console_io.event_chan         - Will be an event channel to wake the user on when the     */
195           /*                                        I/O completes.                                            */
196           /*                                                                                                  */
197           /*        console_io.read               - Set to "1"b indicating a read.                            */
198           /*                                                                                                  */
199           /*  For a write the following information is supplied:                                              */
200           /*                                                                                                  */
201           /*        console_io.alert              - Set to "1"b if the console alarm is to be on for the      */
202           /*                                        write.                                                    */
203           /*                                                                                                  */
204           /*        console_io.read               - Set to "0"b.                                              */
205           /*                                                                                                  */
206           /*        console_io.sequence_no        - Set to the syserr sequence number for syserr calls.       */
207           /*                                                                                                  */
208           /*        console_io.leng               - Set to the word length of the message to be written.      */
209           /*                                                                                                  */
210           /*        console_io.text               - Set to the text of the message.                           */
211           /*                                                                                                  */
212           /* In all cases ocdcm_ will properly reset those items not necessary to the type of I/O being       */
213           /* performed.                                                                                       */
214           /*                                                                                                  */
215           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */
216 
217      dcl  1 console_io                  aligned   based     (console_io_ptr),   /* format of a I/O, 112(8) words...     */
218                2 time_queued            fixed bin (71),                         /* 0 indicates a free entry...          */
219                2 event_chan             fixed bin (71),                         /* to send wakeup to when I/O completes.*/
220                2 process_id             bit       (36),                         /* of the caller...                     */
221                2 console                char      (4),                          /* name of the console the I/O went to..*/
222                2 flags,                                                         /* start at console_io + 6(8)...        */
223                     3 alert             bit       (1)       unaligned,          /* ON => ring bell first...             */
224                     3 read              bit       (1)       unaligned,          /* ON => this is a read request...      */
225                     3 alerted           bit       (1)       unaligned,          /* ON => we have successfully alerted...*/
226                     3 prompted          bit       (1)       unaligned,          /* ON => we have successfully prompted..*/
227                     3 in_progress       bit       (1)       unaligned,          /* ON => I/O has been started...        */
228                     3 completed         bit       (1)       unaligned,          /* ON => the I/O has completed...       */
229                     3 retry_reset       bit       (1)       unaligned,          /* ON => I/O was reset by retry_io...   */
230                     3 pad_flag          bit       (29)      unaligned,          /* pad to word boundry...               */
231                2 sequence_no            fixed bin (35),                         /* syserr sequence number...            */
232                2 leng                   fixed bin (17)      unaligned,          /* in words of the I/O...               */
233                2 MBZ                    fixed bin (17)      unaligned,          /* reserved for future use...           */
234                2 pad_text               fixed bin (35),                         /* I/O must start on even word boundry..*/
235                2 text                   char      (MAX_IO_LENGTH);              /* the actual I/O...                    */
236 ^L
237 
238           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */
239           /*                                                                                                  */
240           /* The following structure is used to log an event occurring in in the console software.            */
241           /*                                                                                                  */
242           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */
243 
244 
245      dcl  1 oc_event                    aligned   based     (oc_event_ptr),     /* each event is 10(8) words long...    */
246                2 time                   fixed bin (71),                         /* time event took place...             */
247                2 opc_name               char (4),                               /* bootload console at time of event... */
248                2 opc_flags              like oc_entry.flags,                    /* bootload console flags...            */
249                2 process_id             bit       (36),                         /* process logging the event...         */
250                2 event_number           fixed bin (35),                         /* number of the event being logged...  */
251                2 event_io_ptr           ptr;                                    /* ptr to I/O in progress during event..*/
252 ^L
253      dcl  (                                                                     /* indices for ease of use...           */
254           RESET_DCW                     init      (1),
255           ALERT_DCW                     init      (2),
256           WRITE_DCW                     init      (3),
257           NEWLINE_DCW                   init      (5),
258           READ_DCW                      init      (7),
259           READ_UNECHOED_DCW             init      (9),
260           PROMPT_DCW                    init      (11),
261           DISCARD_DCW                   init      (13),
262           LOCK_MCA_DCW                  init      (15),
263           UNLOCK_MCA_DCW                init      (16)
264           )                             fixed bin (17)
265                                         internal static     options (constant);
266      dcl  (                                                                     /* list of event numbers...             */
267           INIT_OC_DATA                  init      (1),
268           GOT_SPECIAL_INT               init      (2),
269           PRIORITY_OUTPUT               init      (3),
270           QUEUED_READ                   init      (4),
271           QUEUED_WRITE                  init      (5),
272           STARTED_READ                  init      (6),
273           STARTED_UNECHOED_READ         init      (7),
274           STARTED_WRITE                 init      (8),
275           RESET_CHANNEL                 init      (9),
276           SENT_ALERT                    init      (10),
277           SENT_NEWLINE                  init      (11),
278           SENT_PROMPT                   init      (12),
279           TERMINATED_RESET              init      (13),
280           TERMINATED_ALERT              init      (14),
281           TERMINATED_NEWLINE            init      (15),
282           TERMINATED_PROMPT             init      (16),
283           TERMINATED_READ               init      (17),
284           TERMINATED_WRITE              init      (18),
285           SENT_WAKEUP                   init      (19),
286           READ_PICKUP                   init      (20),
287           PUSHED_READ                   init      (21),
288           POPPED_READ                   init      (22),
289           READ_NOT_IN_PROGRESS          init      (23),
290           LOGGED_ERROR                  init      (24),
291           IO_TIMEOUT                    init      (25),
292           RETRY_IO                      init      (26),
293           GOT_LOCK                      init      (27),
294           FREED_LOCK                    init      (28),
295           DISCARDED_OUTPUT              init      (29),
296           SENT_MC_IO                    init      (30),
297           SENT_MC_PRIORITY_IO           init      (31),
298           MC_IO_PICKUP                  init      (32),
299           MC_IO_FAILURE                 init      (33),
300           LOCK_MCA_IO                   init      (34),
301           UNLOCK_MCA_IO                 init      (35),
302           TERMINATED_MCA_LOCK           init      (36),
303           TERMINATED_MCA_UNLOCK         init      (37)
304           )                             fixed bin (35)
305                                         internal static     options (constant);
306 
307      dcl  oc_data_version               char      (4)       init      ("1.3")   /* for general information...           */
308                                         static internal     options (constant);
309 
310      dcl  (
311           oc_data_ptr,
312           oc_entry_ptr,
313           oc_event_ptr,
314           console_io_ptr
315           )                             ptr;
316 
317      dcl  (
318           MAX_OPC_CNT                   init      (8),                          /* maximum number of consoles...        */
319           MAX_RETRIES                   init      (2),                          /* we retry I/O ops this many times...  */
320           EVENT_QUEUE_SIZE              init      (130),                        /* use up the rest of the 2 pages...    */
321           WRITE_QUEUE_SIZE              init      (8)                           /* number of queued writes allowed...   */
322           )
323                                         fixed bin (17)
324                                         internal static     options (constant);
325 
326      dcl  MAX_IMU_IO_TIME               fixed bin (17)                          /* longest possible IMU I/O time...     */
327                                         internal static     options (constant)
328                                         init      (150);                        /* 2 minutes 30 seconds...              */
329 
330      dcl  MAX_IO_TIME         (16)      fixed bin (17)                          /* maximum time the associated I/O      */
331                                         internal static     options (constant)  /* operation is allowed to take in      */
332                                         init                                    /* seconds...                           */
333                                        (
334                                         1,                                      /* RESET_STATUS...                      */
335                                         1,                                      /* WRITE ALERT...                       */
336                                         10,                                     /* WRITE DATA...                        */
337                                         0,                                      /* DUMMY for WRITE DATA DCW...          */
338                                         2,                                      /* WRITE CR, NL...                      */
339                                         0,                                      /* DUMMY for WRITE CR, NL DCW...        */
340                                         90,                                     /* READ DATA...                         */
341                                         0,                                      /* DUMMY for READ DATA DCW...           */
342                                         90,                                     /* READ_UNECHOED DATA...                */
343                                         0,                                      /* DUMMY for READ_UNECHOED DATA DCW...  */
344                                         1,                                      /* WRITE PROMPT...                      */
345                                         0,                                      /* DUMMY for WRITE PROMPT DCW...        */
346                                         10,                                     /* DISCARD DCW...                       */
347                                         0,                                      /* DUMMY for DISCARD DCW...             */
348                                         30,                                     /* LOCK MCA IO...                       */
349                                         30                                      /* UNLOCK MCA IO...                     */
350                                         );
351 
352      dcl  MAX_IO_LENGTH                 fixed bin (17)
353                                         internal static     options (constant)
354                                         init      (256);                        /* in characters...                     */
355      dcl  MAX_MAX_IO_TIME               fixed bin (17)                          /* longest possible I/O time...         */
356                                         internal static     options (constant)
357                                         init      (150);                        /* should be the same as the longest... */
358 
359 
360 /*  END OF:         oc_data.incl.pl1                          *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */