Choosing an ESTAE-type recovery routine

Use ESTAE-type recovery routines to protect programs running under enabled, unlocked tasks (EUTs). ESTAE-type recovery routines can be in either problem state or supervisor state, and can have any PSW key.

Programs that are disabled, hold locks, or are in SRB mode cannot use ESTAE-type recovery routines. If your program obtains a lock after you activate an ESTAE-type recovery routine, and then encounters an error causing your recovery routine to get control, the system releases the lock. You could use an ESTAE-type recovery routine in this situation if your program can tolerate losing its lock. For example, the lock might be used only to protect a queue from change while it is being read.

Whatever is said about ESTAE-type recovery routines throughout this information applies to recovery routines defined in all of the following ways, unless stated otherwise:
  • STAE, ESTAE, and ESTAEX macros
  • ATTACH and ATTACHX macros with STAI and ESTAI parameters
  • ETDEF macro (ARR parameter, together with the ETCRE macro) or IEAARR macro
  • FESTAE macro.
The following describes the recovery routines you can define with each of the above macros:
  • STAE, ESTAE, and ESTAEX macros
    To provide recovery to protect itself and any other programs running under the same task, a program can issue either the STAE, ESTAE, or ESTAEX macro with the CT parameter. Each of these macros both defines and activates the recovery routine. The recovery routine is defined and activated until one of the following events occurs:
    • You deactivate it and request that it be no longer defined (issue STAE 0, ESTAE 0, or ESTAEX 0).
    • The recovery routine fails to or chooses not to retry (explained under Understanding recovery routine options).
    • The request block (RB) under which the caller of the macro is running terminates.

    A program cannot protect other tasks with recovery routines defined through these macros.

    IBM® recommends you always use IEAARR or ESTAEX unless your program and your recovery routine are in 24-bit addressing mode, or your program requires a branch entry. In these cases, you should use ESTAE. ESTAE and ESTAEX provide the same function, except that ESTAEX can be issued in AR ASC mode and in cross memory mode.

    The remainder of this information refers to the recovery routines you define and activate through the ESTAE and ESTAEX macros as ESTAE routines or ESTAEX routines, respectively.

  • ATTACH and ATTACHX macros with STAI and ESTAI parameters

    To attach a task and provide recovery to protect the attached task and all of its subtasks, a program can issue either the ATTACH or the ATTACHX macro with either the STAI or the ESTAI parameter. You define the recovery routine when you issue the macro. The recovery routine is not activated until the attached task gets control. The recovery routine remains activated as long as the attached task is still running, or until the recovery routine fails to or chooses not to retry. The system deactivates the recovery routine when the attached task ends. At that point, the recovery routine is no longer defined.

    The program attaching the task is not protected by the recovery defined in this manner. Only the attached task and its subtasks are protected.

    IBM recommends you always use the ESTAI, rather than the STAI, parameter on ATTACHX, rather than ATTACH. ATTACH and ATTACHX provide the same function, except that ATTACHX can be issued in AR ASC mode.

    The remainder of this information refers to the recovery routines you define through ATTACHX with ESTAI as ESTAI routines. All references to the ATTACHX macro apply also to the ATTACH macro.

  • ETDEF macro (ARR parameter, together with the ETCRE macro) or IEAARR macro

    To provide recovery for a stacking PC routine, the program defining the stacking PC routine can use the ARR parameter on the ETDEF macro to identify an associated recovery routine (ARR). Using the ETDEF macro with the ARR parameter, together with the ETCRE macro, defines the ARR to the system. You can also cause the system to establish an ARR to cover a target routine by issuing the IEAARR macro. When you issue the PC instruction to give control to the stacking PC routine, the ARR is activated. The ARR remains activated, and cannot be deactivated, while the stacking PC routine is running. The ARR receives control if the stacking PC routine encounters an error. The ARR is deactivated when the stacking PC routine issues the PR instruction to return control to its caller. When you issue the ETDES macro, the ARR is no longer defined.

    Note: Use an ARR only if the stacking PC routine is always entered in enabled, unlocked task mode. See Using ARRs for more information about ARRs.
  • FESTAE macro

    The recovery routine you define with the FESTAE macro is similar to an ESTAE routine, but is limited to types 2, 3, and 4 SVCs that require recovery with minimal processor overhead.

    You both define and activate the recovery routine by issuing the FESTAE macro with the EXITADR parameter. You deactivate the recovery routine and request that it be no longer defined by issuing FESTAE with the 0,WRKREG parameter.

    The remainder of this information refers to the recovery routines you define through the FESTAE macro as FESTAE routines. See Providing recovery with minimal processor overhead (FESTAE macro) for more information about using FESTAE.

In summary, ESTAE-type recovery routines include ESTAE and ESTAEX routines, ESTAI routines, ARRs, and FESTAE routines.

All ESTAE-type recovery routines handle the Floating Point Registers (FPRs) and Floating Point Control (FPC) register the same as for FRRs (see below), except that the DXC field in the Floating Point Control register could have been altered by an asynchronous exit. Also, in general ESTAE-type routines should not depend on the FPRs and FPC register containing the time-of-error values.