1 /****^  ***********************************************************
  2         *                                                         *
  3         * Copyright, (C) Honeywell Bull Inc., 1987                *
  4         *                                                         *
  5         * Copyright, (C) Honeywell Information Systems Inc., 1982 *
  6         *                                                         *
  7         * Copyright (c) 1972 by Massachusetts Institute of        *
  8         * Technology and Honeywell Information Systems, Inc.      *
  9         *                                                         *
 10         *********************************************************** */
 11 
 12 
 13           /*
 14 
 15 
 16                               vtoc_interrupt (core, code)
 17 
 18 
 19 
 20 
 21               The  "vtoc_interrupt"  procedure  is called upon completion of any
 22           64-word I/O operation. Its input arguments are the absolute address of
 23           the 64-word buffer involved in the operation  and  a  code  indicating
 24           whether or not the operation was successful.
 25 
 26           If  the  operation was successful, the input argument code is zero. In
 27           this case the procedure aknowledges the successful I/O termination  by
 28           turning  the  out  of  service  switch  OFF  in  the  buffer descripor
 29           associated with the operation. In  addition,  it  notifies  the  event
 30           associated  with  this  particular buffer.
 31           This  notification  takes place only if at least one process is waiting
 32           for the event.
 33 
 34           All these actions are performed without any  lock  and  are  therefore
 35           completely asynchronous with the execution of the vtoc_man procedures.
 36 
 37           If  the  operation was not successful, the input argument is non zero.
 38           The operation is posted with an error flag in the buffer control word.
 39           This causes read calls to return with an error,  freeing   the buffer,
 40           and write  calls to keep the  buffer 'hot', awaiting  later successful
 41           write calls or shutdown to requeue the I/O.
 42 
 43 
 44           Modified by :
 45 
 46           06/20/75  Andre Bensoussan.
 47           06/02/76  Bernard Greenberg for 'hot' buffers (non-fatal write errors)
 48           07/08/82 by J. Bongiovanni for new vtoc buffer strategy
 49 
 50           */
 51 ^L
 52 vtoc_interrupt : procedure (core, code);
 53 
 54 
 55           dcl core            fixed bin(24);
 56           dcl code            fixed bin(35);
 57 
 58           dcl bufx            fixed bin;
 59           dcl p99             pic "99";
 60           dcl wait_event      bit (36) aligned;
 61 
 62           dcl pxss$notify     entry (bit (36) aligned);
 63           dcl disk_emergency  entry (fixed bin, bit (36) aligned);
 64           dcl syserr          entry options (variable);
 65 
 66           /*        % include vtoc_buffer         see at the end      */
 67 
 68 
 69 
 70           vtoc_buffer_segp = addr (vtoc_buffer_seg$);
 71           vtoc_buf_desc_arrayp = ptr (vtoc_buffer_segp, vtoc_buffer.buf_desc_offset);
 72           vtoc_buf_arrayp = ptr (vtoc_buffer_segp, vtoc_buffer.buf_offset);
 73 
 74           bufx = divide (core - vtoc_buffer.abs_addr - bin (rel (vtoc_buf_arrayp)), size (vtoce_buffer), 17)
 75                + 1;
 76           if bufx < 1 | bufx > vtoc_buffer.n_bufs
 77                then call syserr (CRASH, "vtoc_interrupt: Bad core address");
 78 
 79           vtoc_buf_descp = addr (vtoc_buf_desc_array (bufx));
 80           vtoc_bufp = addr (vtoce_buffer_array (bufx));
 81 
 82           if ^vtoc_buf_desc.os
 83                then call syserr (CRASH, "vtoc_interrupt: Buffer not os at interrupt");
 84 
 85           if code ^= 0 then do;                   /* An error */
 86              if vtoc_buf_desc.write_sw then do;
 87                   pvt_arrayp = addr (pvt$array);
 88                   pvtep = addr (pvt_array (vtoc_buf_desc.pvtx));
 89                   call syserr (JUST_LOG, "vtoc_interrupt: Write error on ^a_^a vtocx ^o",
 90                        pvte.devname, convert (p99, pvte.logical_area_number), vtoc_buf_desc.vtocx);
 91              end;
 92              vtoc_buf_desc.err = "1"b;
 93              call disk_emergency ((vtoc_buf_desc.pvtx), unspec (code));
 94           end;
 95 
 96           vtoc_buf_desc.os = "0"b;
 97 
 98           if vtoc_buf_desc.notify_sw then do;
 99                wait_event = bit (bin (vtoc_buffer.wait_event_constant + vtoc_buf_desc.wait_index, 36), 36);
100                call pxss$notify (wait_event);
101           end;
102 
103           return;
104 
105 %page;
106 %include pvte;
107 %page;
108 %include syserr_constants;
109 %page;
110 %include vtoc_buffer;
111 %page;
112 /* BEGIN MESSAGE DOCUMENTATION
113 
114    Message:
115    vtoc_interrupt: bad core address
116 
117    S: $crash
118 
119    T: $run
120 
121    M: The disk dim reported a main memory address to the
122    VTOC manager which was not in the VTOC buffer segment,
123    or was not designating a legal buffer boundary.
124    $err
125 
126    A: $recover
127 
128    Message:
129    vtoc_interrupt: Buffer not os at interrupt
130 
131    S: $crash
132 
133    T: $run
134 
135    M: An I/O completion was received for a VTOC buffer which was
136    apparently not undergoing I/O.
137    $err
138 
139    A: $recover
140 
141    Message:
142    vtoc_interrupt: Write error on dskX_NN vtocx XXXXXX
143 
144    S: $log
145 
146    T: $run
147 
148    M: A bad I/O status was received by the VTOC manager for a write operation.
149    The unwritten vtoce-part will remain in main memory until the next attempt is
150    made to write it out, or demount or shutdown time.  Too many of these can
151    cause the system to crash.
152 
153    A: $ignore
154 
155    END MESSAGE DOCUMENTATION */
156 
157 end vtoc_interrupt;