LSEXPAND — Expand the linkage stack capacity

Description

The LSEXPAND macro expands a normal linkage stack, or a recovery linkage stack, to support the specified number of entries by allocating additional DREF storage.

If a program does not specify the LSEXPAND macro, it receives a normal linkage stack with 96 entries and a recovery linkage stack with 24 entries.

Environment

The requirements for the caller are:

Environmental factor Requirement
Minimum authorization: Problem state and any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
AMODE: 31-bit
ASC mode: Primary or AR
Interrupt status: Enabled for I/O and external interrupts
Locks: No locks held
Control parameters: Not applicable

Programming requirements

If the system has already issued a stack full program interruption, the system will not accept the LSEXPAND macro. In other words, do not wait until the normal or recovery linkage stacks are full to issue this macro.

Restrictions

None.

Input register information

Before issuing the LSEXPAND 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.

Output register information

When control returns to the caller, the general purpose registers (GPRs) contain:
Register
Contents
0-1
Used as work registers 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 a work register 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.

Syntax

The LSEXPAND macro is written as follows:

Syntax Description
   
   name name: Symbol. Begin name in column 1.
   
One or more blanks must precede LSEXPAND.
   
LSEXPAND  
   
One or more blanks must follow LSEXPAND.
   
NORMAL=n n: Symbol or number or value in register (2) - (12).
   
RECOVERY=n n: Symbol or number or value in register (2) - (12).
   

Parameters

LSEXPAND
Specifies the number of entries that a task has for its normal linkage stack or its recovery linkage stack.
NORMAL=n
Specifies the number of entries in the normal linkage table, where n can be between 97 and 16000. If you don't specify this parameter, the normal linkage stack has 96 entries.
RECOVERY=n
Specifies the number of entries in the recovery linkage stack, where n can be between 25 and 4000. If you don't specify this parameter, the recovery linkage stack has 24 entries.

ABEND codes

None.

Return codes

When LSEXPAND macro returns control to your program, GPR 15 contains a return code.

Table 1. Return and Reason Codes for the LSEXPAND Macro
Hexadecimal Return Code Meaning and Action
00 Meaning: Successful completion.

Action: None.

08 Meaning: Program error. The caller was not unlocked.

Action: Release locks before calling LSEXPAND.

0C Meaning: Program error. The caller was not in task mode.

Action: Change your code to run in task mode.

10 Meaning: Program error. The specified normal stack size exceeds 16000.

Action: Specify a stack size less than 16000.

14 Meaning: Program error. The specified recovery stack size exceeds 4000.

Action: Specify a stack size less than 4000.

18 Meaning: Program error. The recovery stack cannot be expanded because it is currently in use.

Action: Restructure your program to issue the LSEXPAND before the stack becomes full.

1C Meaning: Program error. The normal stack cannot expand because the specified value is smaller than the current normal stack size.

Action: Specify a larger stack size.

20 Meaning: Program error. The recovery stack cannot expand because the specified value is smaller than the current recovery stack size.

Action: Specify a larger stack size.

24 Meaning: Environmental error. Not enough virtual storage was available for the normal linkage stack or the recovery linkage stack.

Action: Retry the request one or more times. If the problem persists, check with the operator to see why there is a storage constraint.

28 Meaning: System error. The normal linkage stack is unchanged. The recovery linkage stack might be expanded.

Action: Retry the request.

Example 1

Expand the normal linkage stack to 192 entries.
LSEXPAND NORMAL=192

Example 2

Expand the recovery linkage stack to 96 entries.
LA   6,96
LSEXPAND RECOVERY=(6)