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 /****^  HISTORY COMMENTS:
 16   1) change(88-02-23,Farley), approve(88-02-23,MCR7759),
 17      audit(88-02-24,Fawcett), install(88-03-01,MR12.2-1029):
 18      Corrected main entry to copy a_errflags to erflagbuf.
 19                                                    END HISTORY COMMENTS */
 20 
 21 
 22 disk_emergency: proc (a_pvtx, a_errflags);
 23 
 24 /* Procedure in wired world to mark disks as inoperative
 25    at appropriate times.
 26 
 27    Bernard Greenberg  02/27/77
 28 
 29    Modified March 1982 by J. Bongiovanni for new PVTE format
 30 */
 31 
 32 dcl  a_pvtx fixed bin;
 33 dcl  a_errflags bit (36) aligned;
 34 
 35 dcl  addr builtin;
 36 dcl  erflagbuf bit (36) aligned;
 37 dcl  pvtx fixed bin;
 38 dcl  tc_data$system_shutdown fixed bin (35) ext;
 39 dcl  pvt$n_entries fixed bin ext;
 40 dcl  syserr entry options (variable);
 41 dcl (pmut$wire_and_mask, pmut$unwire_unmask) entry (fixed bin (71), ptr);
 42 dcl  page$time_out entry;
 43 dcl  disk_control$test_drive entry (fixed bin);
 44 
 45 dcl  ptwp ptr;
 46 dcl  oldmask fixed bin (71);
 47 dcl  p99 pic "99";
 48 dcl  masked bit (1) init ("0"b);
 49 
 50 %include pvte;
 51 %include device_error;
 52 
 53 ^L
 54 
 55           pvt_arrayp = addr (pvt$array);
 56           pvtx = a_pvtx;
 57           pvtep = addr (pvt_array (pvtx));
 58           erflagbuf = a_errflags;
 59           erfp = addr (erflagbuf);
 60 
 61           if tc_data$system_shutdown = 0 then return;
 62 
 63           if ^pvte.device_inoperative then call mark;
 64           return;
 65 
 66 ^L
 67 test_all_drives_masked: entry;
 68 
 69           masked = "1"b;
 70 
 71 
 72 test_all_drives: entry;                                     /* does like it says */
 73           pvt_arrayp = addr (pvt$array);
 74           erfp = addr (erflagbuf);
 75           errflags.device_inoperative = "1"b;
 76 
 77 
 78           if ^masked then call pmut$wire_and_mask (oldmask, ptwp);
 79 
 80 
 81           do pvtx = 1 to pvt$n_entries;
 82                pvtep = addr (pvt_array (pvtx));
 83                if (pvte.used | pvte.permanent) & pvte.storage_system
 84                     then do;
 85                     pvte.device_inoperative = "0"b;
 86                     pvte.testing = "1"b;
 87                     call disk_control$test_drive (pvtx);
 88                     do while (pvte.testing);
 89                          call page$time_out;
 90                     end;
 91                     if pvte.device_inoperative then call mark;
 92                end;
 93           end;
 94 
 95           if ^masked then call pmut$unwire_unmask (oldmask, ptwp);
 96           return;
 97 
 98 
 99 mark:     proc;                                             /* Perform the actual marking */
100 
101                if errflags.device_inoperative then do;
102                     pvte.device_inoperative = "1"b;
103                     p99 = pvte.logical_area_number;
104                     call syserr (3, "disk_emergency: ^a_^a inoperative: shutdown of ^a_^a suspended.",
105                          pvte.devname, p99, pvte.devname, p99);
106                end;
107                return;
108           end mark;
109 
110 /* BEGIN MESSAGE DOCUMENTATION
111 
112    Message:
113    disk_emergency: DSKX_NN inoperative; shutdown of DSKX_NN suspended
114 
115    S: $beep
116 
117    T: Emergency shutdown.
118 
119    M: During emergency shutdown, DSKX_NN was found inoperative.
120    Data in main memory or on the paging device
121    which need to be flushed
122    to the pack on DSKX_NN cannot be written out.
123    The data remain where they were and ESD may be tried again.
124 
125    A: If the drive
126    can be made ready, make it ready and try ESD again.
127    Do NOT move packs before trying ESD,
128    unless address plugs are changed so that the same pack
129    appears to have the same address.
130    (If this action is performed, the MPC must be halted
131    and restarted with a reset and branch.)
132    If the pack is not successfully shut down,
133    the system will volume salvage it
134    when it is next brought up,
135    and data from main memory which belongs on the pack will be lost.
136 
137    END MESSAGE DOCUMENTATION */
138 
139      end;