Read and write services for ESO hiperspaces

Environment

The requirements for the caller who requests CREAD and CWRITE are:

Environmental factor Requirement
Minimum authorization: Supervisor state or PSW key 0 - 7
Dispatchable unit mode: Task or SRB
Cross memory mode: Any PASN, any HASN, any SASN
AMODE: 31-bit
ASC mode: Primary or access register (AR)
Interrupt status: Enabled or disabled for I/O and external interrupts
Locks: The caller may hold locks, but is not required to hold any
Control parameters: The parameter list and range list must be in nonpageable, non-DREF storage. If the caller specifies HSPALET and is disabled, the save area must also be in nonpageable, non-DREF storage. The parameter list and save area must all be in the common area or in the private area of the caller's primary address space.

Programming requirements

Restrictions

If you code HSPALET, and you have an FRR recovery routine that gains control while HSPSERV is executing, your recovery routine cannot attempt retry at the time of error.

Input register information

Before issuing the HSPSERV macro, the caller does not have to place any information into any register unless using it in register notation for a particular parameter, or using it as a base register.

However, if the caller specifies the HSPALET parameter:
  • General purpose register (GPR) 13 must contain the address of a 144-byte save area. The save area must be in the caller's primary address space.
  • Access register (AR) 13 must contain 0, regardless of whether the caller is in primary or AR address space control (ASC) mode.

Output register information

When control returns to the caller, the general purpose registers (GPRs) contain:
Register
Contents
0
Reason code
1
Used as a work register by the system
2-13
Unchanged
14
Used as a work register by the system
15
Return code
When control returns to the caller, the access registers (ARs) contain:
Register
Contents
0-1
Used as work registers by the system
2-13
Unchanged
14-15
Used as work registers by the system

Some callers depend on register contents remaining the same before and after issuing a service. If the system changes the contents of registers on which the caller depends, the caller must save them before issuing the service, and restore them after the system returns control.

Performance implications

None.

The following figure describes the characteristics and restrictions for the use of ESO hiperspaces, the hiperspaces that act as a high-speed buffer or cache for data.
Figure 1. Characteristics and Restrictions for ESO Hiperspaces
ieaa2f1a

Syntax

The standard form of the HSPSERV macro for ESO hiperspaces follows.

CAUTION:
Code the parameters on the HSPSERV CREAD and HSPSERV CWRITE macros very carefully. Read the requirements for the address space buffer and the hiperspace, as listed in Figure 1. For performance reasons, the system does not verify the location of the addresses you specify on these macros. Incorrect coding can cause damage to the system.
Syntax Description
   
   name name: Symbol. Begin name in column 1.
   
One or more blanks must precede HSPSERV.
   
HSPSERV  
   
One or more blanks must follow HSPSERV.
   
CREAD  
CWRITE  
   
,STOKEN=stoken-addr stoken-addr: RX-type address or register (2) - (12).
   
   ,HSPALET=alet-addr alet-addr: RX-type address or register (2) - (12).
   
   ,NUMRANGE=n n: A number from 1 to 50.
   ,NUMRANGE=num-addr num-addr: RX-type address or register (2) - (12). Default: NUMRANGE=1.
   
,RANGLIST=list-addr list-addr: RX-type address or register (2) - (12).
   
   ,ADDRSP=HOME Default: ADDRSP=HOME.
   ,ADDRSP=PRIMARY  
   ,ADDRSP=COMMON  
   
   ,KEEP=YES Default: KEEP=YES.
   ,KEEP=NO  
   
   ,RETCODE=ret-addr ret-addr: RX-type address or register (2) - (12).
   
   ,RSNCODE=rsn-addr rsn-addr: RX-type address or register (2) - (12).
   
   ,MF=S  
   

Parameters

The parameters are explained as follows:

CREAD
Requests that the system read data from an ESO hiperspace

If all blocks requested to be read are available in the hiperspace, then the system performs the read operation. However, if one or more of the blocks to be read are no longer available in the hiperspace, then the system returns a failing return code. (See return code 08.) In this case, the system does not tell you which blocks it successfully reads, if any.

STOKEN and RANGLIST are required parameters on the CREAD request. ADDRSP, NUMRANGE, RSNCODE, and RETCODE are optional parameters.

CWRITE
Requests that the system write data to an ESO hiperspace. If the system cannot write all the requested blocks to the hiperspace, then it doesn't write any and rejects the request. (See return code 08.) In this case, the data in the specified range in the hiperspace is unpredictable. Therefore, after an unsuccessful write, do not issue another CREAD against the failing hiperspace range of virtual storage until an intervening CWRITE is successful.

STOKEN and RANGLIST are required parameters on the CWRITE request. ADDRSP, NUMRANGE, KEEP, RSNCODE, and RETCODE are optional parameters.

,STOKEN=stoken-addr
Specifies the address of the 8-character variable that contains the STOKEN for the ESO hiperspace from which the data is to be read or into which the data is to be written. Restrictions on the hiperspace are described in Figure 1.
,HSPALET=alet-addr
Specifies either the address of a fullword or a register that contains the ALET for the hiperspace that is to be accessed. The ALET must be for a hiperspace that is on the caller's DU-AL or PASN-AL.

Use of the HSPALET parameter requires that the caller provide a 144-byte save area in the caller's primary address space or in the common area. If the caller is disabled, the save area must be in nonpageable storage. AR/GPR 13 must provide addressability to this area regardless of the caller's ASC mode. GPR 13 must contain the address of the area and AR 13 must contain 0.

If you code HSPALET, do not code RELEASE=YES.

If you code HSPALET and you have an FRR recovery routine that gains control while HSPSERV is executing, your recovery routine cannot attempt retry at the time of error.

,NUMRANGE=n
,NUMRANGE=num-addr
Specifies a fullword that identifies the number of entries in the range list (that the RANGLIST parameter points to), or specifies a register containing the address of a fullword containing the number of entries, or specifies the number of entries, from 1 to 50. The default is NUMRANGE=1.

If you omit NUMRANGE, then HSPSERV reads or writes one virtual range.

,RANGLIST=list-addr
Specifies a fullword that contains the address of a parameter area in nonpageable storage that contains a list of up to 50 ranges that the system is to read or write, or specifies a register that contains the address of the fullword pointer to the range list.
The range list consists of a number of entries (specified by NUMRANGE) where each entry consists of three words as follows:
First word
The starting virtual address in the address space into which the data is to be read or from which the data is to be written.
Second word
The starting virtual address in the hiperspace from which the system is to read or into which the system is to write.
Third word
The number of blocks the system is to read or write.
An example of how to code the RANGLIST parameter when NUMRANGE=3 is as follows:
ieaa2nm1

The one or more address space ranges on RANGLIST must be consistent with the ADDRSP parameter. When you specify ADDRSP=COMMON, each address space range described in the range list must reside entirely within CSA and have no intersections with other common area subpools or the private area. When you specify ADDRSP=HOME or ADDRSP=PRIMARY, each address space range described in the range list must reside entirely within the private area.

Restrictions on the areas in the address space and the hiperspace are described in Figure 1.

The range list must be in the common area or in the private area of the caller's primary address space.

,ADDRSP=HOME
,ADDRSP=PRIMARY
,ADDRSP=COMMON
Specifies the location of the virtual storage range from which the system is to read or into which the system is to write. The location can be the caller's home address space (ADDRSP=HOME), the caller's primary address space (ADDRSP=PRIMARY), or the CSA (ADDRSP=COMMON). The default is ADDRSP=HOME.
,KEEP=YES
,KEEP=NO
Specifies whether or not the system preserves the source data in the virtual storage of the address space after it completes the CWRITE request. KEEP is valid only on the CWRITE request.

If you specify KEEP=YES, the data in the specified address space is unchanged and available for reference. The default is KEEP=YES.

If you specify KEEP=NO, the system might not preserve the data in the address space. If your program will reuse the same virtual storage area after the CWRITE request completes, use KEEP=NO.

,RETCODE=ret-addr
Specifies the location where the system is to store the return code. The return code is also in GPR 15.
,RSNCODE=rsn-addr
Specifies the location where the system is to store the reason code. The reason code is also in GPR 0.
,MF=S
Specifies the standard form of the macro. This form generates code to place the parameters into an inline parameter list and invoke the macro service.

ABEND codes

HSPSERV might abnormally terminate with abend code X'01D'. See z/OS MVS System Codes for an explanation of abend code X'01D'.

Return and reason codes

When control returns from HSPSERV CREAD or HSPSERV CWRITE, GPR 15 (and ret-addr, if you coded RETCODE) contains one of the following hexadecimal return codes. GPR 0 (and rsn-addr, if you coded RSNCODE) contains one of the following hexadecimal reason codes.

Note: yy is X'07' for CREAD and X'08' for CWRITE.
Table 1. Return and Reason Codes for HSPSERV CREAD and HSPSERV CWRITE
Hexadecimal Return Code Hexadecimal Reason Code Meaning and Action
00 00 Meaning: HSPSERV completed successfully.

Action: None.

08 xxyy01xx Meaning: Program error. The hiperspace data you requested is not available (CREAD request).

Action: The data must be retrieved from its permanent copy.

08 xxyy02xx Meaning: Program error. The system rejects the request because an address space page is not currently backed by real storage. You can repeat the HSPSERV request after you reference one or more pages, which causes the system to page the storage in CWRITE request.

Action: Reference the page or pages that are not in processor storage.

08 xxyy03xx Meaning: Environmental error. The system rejects the request because the necessary real storage frames are not currently available.

Action: Rerun your program one or more times during a period of lower system usage. If the problem persists, consult your system programmer, who might be able to tune the system so that more resources are available to your program.

08 xxyy04xx Meaning: Environmental error. The system rejects the request because no frames are currently available.

Action: Rerun your program one or more times during a period of lower system usage. If the problem persists, consult your system programmer, who might be able to tune the system so that more resources are available to your program.

08 xxyy05xx Meaning: System error. The system rejects the request because a hiperspace page is unavailable.

Action: Record the return and reason code and supply it to the appropriate IBM® support personnel.

08 xxyy06xx Meaning: System error. The system rejects the request because an address space page is unavailable.

Action: Record the return and reason code and supply it to the appropriate IBM support personnel.