1 /*  START OF:       vtoc_buffer.incl.pl1   November 1982      *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */
  2 
  3 
  4 
  5 /****^  HISTORY COMMENTS:
  6   1) change(86-04-21,Fawcett), approve(86-04-21,MCR7383),
  7      audit(86-05-27,GDixon), install(86-07-18,MR12.0-1098):
  8      Add the software read-alter-rewrite when needed for devices that do only
  9      512 word IO.
 10                                                    END HISTORY COMMENTS */
 11 
 12 
 13 dcl          vtoc_buffer_seg$       ext;
 14 
 15      dcl     vtoc_buffer_segp       ptr;
 16      dcl     vtoc_buf_descp         ptr;
 17      dcl     vtoc_bufp              ptr;
 18      dcl     vtoc_buf_desc_arrayp   ptr;
 19      dcl     vtoc_buf_arrayp        ptr;
 20 
 21      dcl     vtoc_buf_n_buffers     fixed bin;
 22      dcl     vtoc_buf_n_buckets     fixed bin;
 23 
 24 
 25      dcl     1 vtoc_buffer          aligned based (vtoc_buffer_segp),
 26 
 27                2 lock,                                      /* Global lock for VTOC buffers */
 28                  3 processid        bit (36) aligned,       /* Owner */
 29                  3 wait_event       bit (36) aligned,       /* For lock */
 30                  3 notify_sw        bit (1) aligned,        /* ON => notify on unlock */
 31 
 32                2 n_bufs             fixed bin,              /* Number of full VTOCE buffers */
 33                2 n_hash_buckets     fixed bin,              /* Number of hash table buckets */
 34                2 hash_mask          bit (36) aligned,       /* Mask for hash algorithm */
 35                2 abs_addr           fixed bin (24),         /* Absolute address of vtoc_buffer_seg */
 36                2 wait_event_constant fixed bin (36) uns unal,    /* Constant to add to part index to form wait event */
 37                2 buf_desc_offset    bit (18),               /* Offset of buf_desc */
 38                2 buf_offset         bit (18),               /* Offset of buf */
 39                2 hash_table_offset  bit (18),               /* Offset of hash_table */
 40                2 search_index       fixed bin,              /* Roving pointer for buffer selection */
 41                2 unsafe_pvtx        fixed bin,              /* PVTE index with update in progress */
 42                2 scavenger_free_p_clock
 43                                     fixed bin (35),         /* Pseudo-Clock for scavenger-free-other-allocate race */
 44                2 meters,
 45                  3 call_get         fixed bin (35),         /* Calls to get_vtoce */
 46                  3 call_put         fixed bin (35),         /* Calls to put_vtoce */
 47                  3 call_alloc       fixed bin (35),         /* Calls to alloc_and_put_vtoce */
 48                  3 call_free        fixed bin (35),         /* Calls to free_vtoce */
 49                  3 call_await       fixed bin (35),         /* Calls to await_vtoce */
 50                  3 steps            fixed bin (35),         /* Steps through buffer allocation */
 51                  3 skip_os          fixed bin (35),         /* Skipped because out-of-service */
 52                  3 skip_hot         fixed bin (35),         /* Skipped because buffer hot */
 53                  3 skip_wait        fixed bin (35),         /* Skipped because notify_sw set */
 54                  3 disk_reads       fixed bin (35),         /* Number of same */
 55                  3 disk_writes      fixed bin (35),         /* Number of same */
 56                  3 get_buffer_calls fixed bin (35),         /* Number of calls to GET_BUFFER */
 57                  3 get_buffer_hits  fixed bin (35),         /* Number times VTOCE in buffer */
 58                  3 wait_calls       fixed bin (35),         /* Number of calls to WAIT */
 59                  3 wait_os          fixed bin (35),         /* Number of times had to wait */
 60                  3 scavenger_free_checks
 61                                     fixed bin (35),         /* Number of times had to check pseudo-clock */
 62                  3 scavenger_free_losses
 63                                     fixed bin (35),         /* Number of times race lost between scavenger freeing and other allocate */
 64                  3 soft_rar         fixed bin (35),         /* Nunber of times a software read_alter_rewrite performed */
 65 
 66                  3 pad (14)         fixed bin (35),
 67 
 68                2 hash_table         (vtoc_buf_n_buckets refer (vtoc_buffer.n_hash_buckets)) bit (18) aligned,
 69 
 70 
 71                2 buf_desc           (vtoc_buf_n_buffers refer (vtoc_buffer.n_bufs)) aligned like vtoc_buf_desc,
 72 
 73                2 buffer             (vtoc_buf_n_buffers refer (vtoc_buffer.n_bufs)) aligned like vtoce_buffer;
 74 
 75 
 76 
 77      dcl     1 vtoc_buf_desc_array  (vtoc_buffer.n_bufs) aligned based (vtoc_buf_desc_arrayp) like vtoc_buf_desc;
 78 
 79 
 80      dcl     1 vtoc_buf_desc        aligned based (vtoc_buf_descp),
 81                2 pvtx               fixed bin (17) unal,    /* PVTE index */
 82                2 vtocx              fixed bin (17) unal,    /* VTOCE Index */
 83                2 parts_used         bit (3) unal,           /* Mask of parts used or os */
 84                2 err                bit (1) unal,           /* ON => I/O error on buffer */
 85                2 notify_sw          bit (1) unal,           /* ON => notify requied on I/O completion */
 86                2 write_sw           bit (1) unal,           /* ON => write I/O */
 87                2 os                 bit (1) unal,           /* ON => I/O in progress */
 88                2 ioq                bit (1) unal,           /* ON => I/O has been requested */
 89                2 used               bit (1) unal,           /* ON => this descriptor is in use */
 90                2 pad                bit (9) unal,
 91                2 wait_index         fixed bin (17) unal,    /* Buffer index for forming wait event */
 92                2 ht_thread          bit (18) unal,          /* Offset of next entry in hash table */
 93                2 buf_rel            bit (18) unal;          /* Offset of buffer in segment */
 94 
 95      dcl     1 vtoce_buffer_array   (vtoc_buffer.n_bufs) aligned based (vtoc_buf_arrayp) like vtoce_buffer;
 96 
 97      dcl     1 vtoce_buffer         aligned based (vtoc_bufp),
 98                2 parts              (3) aligned,
 99                  3 words            (64) bit (36) aligned;
100 
101 
102      dcl     N_PARTS_PER_VTOCE      fixed bin int static options (constant) init (3);
103      dcl     VTOCE_PART_SIZE        fixed bin int static options (constant) init (64);
104      dcl     VTOCE_BUFFER_SIZE      fixed bin int static options (constant) init (3 * 64);
105      dcl     N_VTOCE_PER_RECORD     fixed bin int static options (constant) init (5);
106      dcl     N_SECTOR_PER_VTOCE     fixed bin int static options (constant) init (3);
107 
108 
109 /*  END OF:         vtoc_buffer.incl.pl1                      *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */