1 02/06/84  prepare_mc_restart_
  2 
  3 The prepare_mc_restart_ subroutine checks machine conditions for
  4 restartability, and makes modifications to the machine conditions (to
  5 accomplish user modifications to process execution) before a condition
  6 handler returns.
  7 
  8 The prepare_mc_restart_ subroutine should be called by a condition
  9 handler, which was invoked as a result of a hardware-detected
 10 condition, if the handler wishes the process to:
 11 
 12 1.  retry the faulting instruction.
 13 2.  skip the faulting instruction and continue.
 14 3.  execute some other instruction instead of the faulting instruction
 15     and continue.
 16 4.  resume execution at some other location in the same program.
 17 
 18 
 19 When a condition handler is invoked for a hardware-detected condition,
 20 it is passed a pointer to the machine-conditions data at the time of
 21 the fault.  If the handler returns, the system attempts to restore
 22 these machine conditions and restart the process at the point of
 23 interruption encoded in the machine-conditions data.  After certain
 24 conditions, however, the hardware is unable to restart the processor.
 25 In other cases, an attempt to restart always causes the same condition
 26 to occur again, because the system software has already exhausted all
 27 available recovery possibilities (e.g., disk read errors).
 28 
 29 
 30 Entry points in prepare_mc_restart_:
 31    (List is generated by the help command)
 32 
 33 
 34 :Entry:  replace:  02/06/84 prepare_mc_restart_$replace
 35 
 36 
 37 Function: modifies machine-conditions data so that the process
 38 executes a specified machine instruction, instead of the faulting
 39 instruction, and then continues normally.
 40 
 41 
 42 Syntax:
 43 declare prepare_mc_restart_$replace entry (ptr, bit(36),
 44      fixed bin(35));
 45 call prepare_mc_restart_$replace (mc_ptr, new_ins, code);
 46 
 47 
 48 Arguments:
 49 mc_ptr
 50    is a pointer to the machine conditions.  (Input)  The format of
 51    the machine conditions is described in the Programmer's Reference
 52    Manual.
 53 new_ins
 54    is the desired substitute machine instruction.  (Input)
 55 
 56 
 57 code
 58    is a standard status code.  If it is nonzero on return, the machine
 59    conditions cannot be restarted.  (Output)  The following codes can
 60    be returned:
 61    error_table_$badarg
 62       an invalid mc_ptr was provided.
 63    error_table_$no_restart
 64       the machine conditions cannot be restarted.
 65    error_table_$bad_ptr
 66       the restart location is not accessible.
 67    error_table_$useless_restart
 68       the same error will occur again if restart is attempted.
 69 
 70 
 71 :Entry:  retry:  02/06/84 prepare_mc_restart_$retry
 72 
 73 
 74 Function: prepares the machine conditions for retry at the point of
 75 the hardware-detected condition.  For example, this operation is
 76 appropriate for a linkage error signal, resulting from the absence of
 77 a segment, that the condition handler has been able to locate.
 78 
 79 
 80 Syntax:
 81 declare prepare_mc_restart_$retry entry (ptr, fixed bin(35));
 82 call prepare_mc_restart_$retry (mc_ptr, code);
 83 
 84 
 85 Arguments:
 86 mc_ptr
 87    is a pointer to the machine conditions.  (Input)  The format of
 88    the machine conditions is described in the Programmer's Reference
 89    Manual.
 90 
 91 
 92 code
 93    is a standard status code.  If it is nonzero on return, the machine
 94    conditions cannot be restarted.  (Output)  The following codes can
 95    be returned:
 96    error_table_$badarg
 97       an invalid mc_ptr was provided.
 98    error_table_$no_restart
 99       the machine conditions cannot be restarted.
100    error_table_$bad_ptr
101       the restart location is not accessible.
102    error_table_$useless_restart
103       the same error will occur again if restart is attempted.
104 
105 
106 :Entry:  tra:  02/06/84 prepare_mc_restart_$tra
107 
108 
109 Function: modifies machine conditions data so that the process resumes
110 execution, taking its next instruction from a specified location.  The
111 instruction transferred to must be in the same segment that caused the
112 fault.
113 
114 
115 Syntax:
116 declare prepare_mc_restart_$tra entry (ptr, ptr, fixed bin(35));
117 call prepare_mc_restart_$tra (mc_ptr, newp, code);
118 
119 
120 Arguments:
121 mc_ptr
122    is a pointer to the machine conditions.  (Input)  The format of
123    the machine conditions is described in the Programmer's Reference
124    Manual.
125 newp
126    is used in replacing the instruction counter in the machine
127    conditions.  (Input)
128 
129 
130 code
131    is a standard status code.  If it is nonzero on return, the machine
132    conditions cannot be restarted.  (Output)  The following codes can
133    be returned:
134    error_table_$badarg
135       an invalid mc_ptr was provided.
136    error_table_$no_restart
137       the machine conditions cannot be restarted.
138    error_table_$bad_ptr
139       the restart location is not accessible.
140    error_table_$useless_restart
141       the same error will occur again if restart is attempted.