Special considerations for FRRs

Consider the following when writing an FRR:

FRR stack: When you define an FRR, the SETFRR macro creates an entry in a system area called an FRR stack. The size of the FRR stack satisfies the recovery needs of the system. If additional FRRs placed on the stack cause the size to be exceeded, the routine issuing the SETFRR macro ends abnormally. User-written routines outside of the system may add up to two FRRs to the FRR stack. All remaining stack entries are reserved for the system. If a routine attempts to add an entry to the stack when the stack is full, the system issues an X'07D' abend.

SDWA: The system always gives control to FRRs with an SDWA. If the system cannot supply an SDWA, the system bypasses the FRR, goes to the next FRR, and again attempts to supply an SDWA. When no FRRs remain, the system gives control to any ESTAE-type recovery routines that are available. When an FRR receives control in AMODE 64 the SDWA may be in 31-bit addressable storage.

AMODE 31 users of SETFRR can specify SDWALOC31=YES to indicate that their FRR can tolerate an SDWA in 31-bit addressable storage. Considering that 31-bit storage is less likely to be constrained than 24-bit storage and RTM skips FRRs for which it can not obtain an SDWA, use SDWALOC31=YES whenever possible for AMODE 31 FRRs.

Locks: When the system invokes an FRR, the FRR runs with the locks (and the enablement implied by those locks) that were held at the time of the error, plus an additional CPU lock obtained for the system if the FRR was holding any CPU locks, unless a previous FRR does one of the following:
The FRR should take the following action regarding locks held when the FRR is entered:
Deactivating an FRR: When an FRR wants to deactivate itself, the FRR should issue SETRP with REMREC=YES. FRRs can also issue SETFRR D, but must exercise caution when doing so. The FRR should not call any other program or service after issuing SETFRR D because of the following:

For example, suppose the FRR issues SETFRR D, and then issues the SDUMPX macro. SDUMPX processing places another FRR on the FRR stack, in the location of the original FRR. If SDUMPX processing encounters an error, the system does not give control to its FRR because the system thinks it is the original FRR, to which control was already given.

Thus, IBM® recommends that you issue SETRP with REMREC=YES rather than issuing SETFRR D within an FRR. If the FRR specifies SETRP REMREC=YES, the system deactivates the FRR after the FRR gives up control, thus removing the entry from the FRR stack at a safe time.