1 /* BEGIN INCLUDE FILE ... tty_buf.incl.pl1 */
  2 
  3 /* Date Last Modified and Reason
  4    Created 04/19/77 by J. Stern (from part of tty.incl.pl1)
  5    Modified January 1978 by Robert Coren and Larry Johnson for variable-size buffers
  6    Modified 2/6/78 by Robert Coren to make circular_queue size settable
  7    Modified Aug 78 by J. Nicholls to move the buffer block format to a file of its own
  8    and wtcb to its own plus other modification for ring 0 multiplexing, tty_buffer_block.incl.pl1
  9    Modified 7/17/79 by B. Greenberg for echo negotiation meters.
 10    Modified November 1979 by C. Hornig for MCS tracing.
 11    Modified December 1979 by Robert Coren to add FNP channel lock meter
 12    Modified February 1980 by Robert Coren to remove all references to circular buffer
 13    Modified March 1980 by Robert Coren to reorganize metering information
 14    Modified December 1980 by Robert Coren to add FNP-specific events
 15    Modified 24 March 1982, W. Olin Sibert, to add mcs_timer support, recoverable_error_severity
 16    Modified November 1984 by Robert Coren to add tty_area_lock
 17 */
 18 
 19 dcl  ttybp ptr,
 20      tty_buf$ ext static,                                   /* tty buffer segment */
 21      tty_ev fixed bin int static options (constant) init (57), /* event used for wait and notify */
 22      abs_buf_limit fixed bin (18) static options (constant) init (64), /* minimum number of words we will leave free */
 23      input_bpart fixed bin (18) static options (constant) init (2), /* fraction of bleft we will allow for input */
 24      output_bpart fixed bin (18) static options (constant) init (4); /* fraction of bleft we will allow for output */
 25 
 26 
 27 dcl  qblock_size fixed bin int static options (constant) init (16); /* size in words of a delay queue block */
 28 dcl  bsizec fixed bin int static options (constant) init (60); /* number of characters in smallest buffer */
 29 dcl  buf_per_second fixed bin int static options (constant) init (10); /* for figuring out max. buffer size based on speed */
 30 
 31 dcl  FNP_DUMP_PATCH_EVENT fixed bin int static options (constant) init (58);
 32 dcl  FNP_METER_EVENT fixed bin int static options (constant) init (59);
 33 dcl  TTY_AREA_LOCK_EVENT bit (36) aligned int static options (constant) init ("74"b3);
 34 
 35 dcl 1 tty_buf aligned based (ttybp),                        /* declaration of tty buffer seg */
 36     2 slock bit (36),                                       /* per system lock */
 37     2 absorig fixed bin (24),                               /* abs address of this seg */
 38     2 borig bit (18),                                       /* index of start of buffer area */
 39     2 bleft fixed bin (18),                                 /* words left in pool */
 40     2 free bit (18),                                        /* pointer to start of free pool */
 41     2 fnp_config_flags (8) bit (1) unal,                    /* flag(i) ON if fnp(i) configured */
 42     2 padb1 bit (28) unaligned,
 43     2 lct_ptr ptr,                                          /* pointer to logical channel table */
 44 
 45     2 nrawread fixed bin (35),                              /* number of raw chars input, total */
 46     2 nrawwrite fixed bin (35),                             /* number of raw characters output */
 47     2 ninchars fixed bin (35),                              /* total input chars after conversion */
 48     2 noutchars fixed bin (35),                             /* total output chars before conversion */
 49     2 readblocked fixed bin (35),                           /* number of times go input blocked */
 50     2 nblocked fixed bin (35),                              /* number of times process output blocked */
 51     2 minbuf fixed bin (18),                                /* min output buffer size */
 52     2 totbuf fixed bin (35),                                /* divide by nblocked to get ave buffer size */
 53 
 54     2 preconverted fixed bin (35),                          /* number of converted chars held in tty_buf */
 55     2 input_restart fixed bin,                              /* number of times tty_read had to start over */
 56     2 output_restart fixed bin,                             /* number of times tty_write has had to start over */
 57     2 output_buffer_overflow fixed bin,                     /* number of times tty_write has run out of buffers */
 58     2 read_time fixed bin (71),                             /* total time spent in tty_read */
 59     2 write_time fixed bin (71),                            /* total time spent in tty_write */
 60 
 61     2 read_calls fixed bin (35),                            /* number of calls to tty_read */
 62     2 write_calls fixed bin (35),                           /* number of calls to tty_write */
 63     2 bfx fixed bin,                                        /* used in calls to iobm */
 64     2 nquits fixed bin (35),                                /* number of quits */
 65     2 space_needed_data,
 66       3 space_needed bit (1) unal,                          /* space_needed bit on in at least 1 lcte */
 67       3 space_needed_calls fixed bin (34) unal,             /* meter of uses of this facility */
 68     2 space_lock_count fixed bin (35),                      /* count of times tty_buf.slock locked */
 69     2 space_lock_wait_count fixed bin (35),                 /* count of times necessary to loop to lock it */
 70     2 space_lock_wait_time fixed bin (35),                  /* total time looped trying to lock it */
 71 
 72     2 alloc_calls fixed bin (35),                           /* total number of allocations performed in tty_buf */
 73     2 free_calls fixed bin (35),                            /* total number of freeings in tty_buf */
 74     2 alloc_time fixed bin (35),                            /* time spent masked in tty_space_man$get entries */
 75     2 free_time fixed bin (35),                             /* time spent masked in tty_space_man$free entries */
 76     2 total_alloc_steps fixed bin (35),                     /* number of steps thru free chain while doing above */
 77     2 alloc_failures fixed bin (35),                        /* number of unsuccessful attempts to allocate space */
 78     2 cumulative_input_space fixed bin (71),                /* cumulative amount of space allocated for input */
 79 
 80     2 cumulative_output_space fixed bin (71),               /* cumulative amount of space allocated for output */
 81     2 cumulative_control_space fixed bin (71),              /* cumulative amount of space allocated by tty_space_man$get_space */
 82     2 input_space_updates fixed bin (35),                   /* number of increments to cumulative_input_space */
 83     2 output_space_updates fixed bin (35),                  /* number of increments to cumulative_output_space */
 84     2 control_space_updates fixed bin (35),                 /* number of increments to cumulative_control_space */
 85     2 minimum_free_space fixed bin (18),                    /* smallest amount of free space ever available */
 86 
 87     2 current_input_space fixed bin (18),                   /* amount of space currently allocated for input */
 88     2 current_output_space fixed bin (18),                  /* amount of space currently allocated for output */
 89     2 current_control_space fixed bin (18),                 /* amount of space currently allocated by get_space */
 90     2 tty_lock_calls fixed bin (35),                        /* number of calls to tty_lock$lock entries */
 91     2 found_channel_locked fixed bin (35),                  /* number of times tty_lock found channel already locked */
 92     2 max_wait_time fixed bin (35),                         /* longest time waited for any channel lock */
 93     2 total_wait_time fixed bin (71),                       /* total amount of time spent waiting for channel locks */
 94 
 95     2 echo_neg_time fixed bin (71),                         /* cumulative time spent doing echo negotiation */
 96     2 echo_neg_interrupts fixed bin (35),                   /* Echo-negotiated shipments */
 97     2 echo_neg_r0_chars fixed bin (35),                     /* Chars echoed by ring 0 */
 98     2 echo_neg_mux_chars fixed bin (35),                    /* Chars echoed by mux */
 99     2 echo_neg_sndopt_restarts fixed bin (35),              /* Echo reinits */
100     2 echo_neg_mux_nonecho fixed bin (35),
101     2 echo_neg_entries fixed bin (35),                      /* Entries into negotiate */
102 
103     2 echo_neg_mux_inhibit bit (1) aligned,                 /* For testing */
104     2 n_queued_interrupts fixed bin (35),                   /* number of interrupts queued by tty_lock */
105     2 trace unaligned,                                      /* tracing information */
106       3 flags,
107       4 enable bit,                                         /* global tracing control */
108       4 default_mode bit,                                   /* whether to trace channels by default */
109       4 read bit,                                           /* read */
110       4 write bit,                                          /* write */
111       4 data bit,                                           /* buffers on reads and writes */
112       4 control bit,                                        /* control, priv_control, and hpriv_control */
113       4 modes bit,                                          /* (get set check)_modes */
114       4 interrupt bit,                                      /* interrupt, interrupt_later */
115       4 init bit,                                           /* init_multiplexer, terminate_multiplexer */
116       4 start bit,                                          /* start, stop */
117       4 shutdown bit,                                       /* shutdown */
118       4 space_man bit,                                      /* tty_space_man$* */
119       4 pad_flags bit (6),
120       3 data_offset bit (18),                               /* offset of tracing data */
121 
122     2 recoverable_error_severity fixed bin,                 /* Syserr severity for recoverable MCS errors */
123 
124     2 timer_lock bit (36) aligned,                          /* Lock owned by mcs_timer */
125     2 next_timer_offset bit (18) aligned,                   /* Offset of next timer to come due */
126     2 timer_count fixed bin,                                /* Number of timers outstanding */
127     2 timer_process bit (36) aligned,                       /* Who is doing timers? */
128 
129     2 timer_ev_chn fixed bin (71),                          /* How get get him */
130     2 timer_lock_wait_time fixed bin (71),                  /* CPU time spent spinning on timer lock */
131 
132     2 timer_lock_count fixed bin (35),                      /* Number of times timer lock locked */
133     2 timer_lock_wait_count fixed bin (35),                 /* Number of times imer lock waited on */
134     2 timer_call_time fixed bin (71),                       /* CPU time spent in call side timer operations */
135 
136     2 timer_polling_time fixed bin (71),                    /* CPU time spent polling (including channel_manager) */
137     2 timer_set_calls fixed bin (35),                       /* Number of calls to mcs_timer$set, set_wired */
138     2 timer_reset_calls fixed bin (35),                     /* Number of calls to mcs_timer$reset, reset_wired */
139 
140     2 timer_change_calls fixed bin (35),                    /* Number of calls to mcs_timer$change, change_wired */
141     2 timer_poll_calls fixed bin (35),                      /* Number of calls to mcs_timer$poll */
142     2 timer_error_calls fixed bin (35),                     /* Number of mcs_timer calls ending with recoverable errors */
143     2 timer_duplicate_pollings fixed bin (35),              /* Number of timer polling found in progress on other CPU */
144 
145     2 tty_area_lock like hc_fast_lock,                      /* to prevent contention in allocating/freeing in tty_area */
146 
147     2 pad2 (13) fixed bin (35),
148 
149     2 free_space fixed bin;                                 /* start of free space region */
150 
151 
152 %include hc_fast_lock;
153 
154 /* END INCLUDE FILE ... tty_buf.incl.pl1 */