• Aucun résultat trouvé

GETMAIN - Allocate Virtual Storage

Dans le document ana Macro Instructions (Page 193-200)

The GETMAIN macro instruction requests the control program to allocate one or more areas of virtual storage to the active task. The virtual storage areas are allocated from the specified subpool in the virtual storage area assigned to the associated job step. The virtual storage areas each begin on a doubleword or page boundary and are not cleared to 0 when allocated. (The storage is set to zero for the initial allocation of a page.) The total of the lengths specified must not exceed the length available. For most subpools the storage will be released when the task assigned ownership terminates, or through the use of the FREEMAIN macro instructions.

The options R, LC, LU, VC, VU, EC, or EU can be used by callers in either 24-bit or 31-bit addressing mode. If one of these options is specified, storage area addresses and lengths will be treated as 24-bit addresses and values. The parameter list addresses and the pointers to the length and address lists in the parameter lists (if present) will be treated as 31-bit addresses if the caller's addressing mode is 31-bit; otherwise, they will be treated as 24-bit addresses.

The options RU, RC, VRU, and VRC can be used by callers in either 24-bit or 31-bit addressing mode. However, all values and addresses will be treated as 31-bit values and addresses.

GETMAIN - Allocate Virtual Storage 181

The standard form of the GETMAIN macro instruction is written as follows:

One or more blanks must precede GETMAIN.

One or more blanks must follow GETMAIN.

length addr: A-type address, or register (2) - (12).

length value: symbol, decimal digit, or register (2) - (12). If R is specified, register (0) may also be specified.

addr: A-type address, or register (2) - (12).

Note: RC, RU, VRC, or VRU must be used to allocate storage with addresses greater than 16Mb.

maximum length value: symbol, decimal, digit, or register (2) - (12).

minimum length value: symbol, decimal, digit, or register (2) - (12).

sub pool nmbr: symbol, decimal digit 0-127, or register (2) - (12).

Note: Subpools are specified as follows:

LC,LU,VC,VU,EC,EU,RC,RU,VRC, and VRU use the SP parameter.

R with LV not equal to (0) uses the SP parameter.

R with LV = (0) must use register O. The low-order three bytes of register

o must contain the length of the subpool, and the high-order byte must contain the number of the subpool.

Default: BNDRY = DBLWD

Note: This parameter may not be specified with R above.

Default: LaC = RES

Note: This parameter can only be used with RC, RU, VRC, or VRU.

On all other forms, the default, LaC = RES is used.

value: any valid macro keyword specification.

The parameters are explained as follows:

LC,LA = length addr,A = addr

VRC,LV=(maximum length value, minimum length value) VRU,LV = (maximum length value, minimum length value)

specifies the type of GETMAIN request:

LC and LU indicate conditional (LC) and unconditional (LU) list requests and specify

182

Supervisor Services and Macro Instructions

requests for one or more areas of virtual storage. The length of each virtual storage area is indicated by the values in a list beginning at the address specified in the LA parameter.

The address of each of the virtual storage areas is returned in a list beginning at the address specified in the A parameter. No virtual storage is allocated unless all of the requests in the list can be satisfied.

VC and VU indicate conditional (VC) and unconditional (VU) variable requests and specify requests for single areas of virtual storage. The length of the single virtual storage area is between the two values at the address specified in the LA parameter. The address and actual length of the allocated virtual storage area are returned by the control program at the address indicated in the A parameter.

EC and EU indicate conditional (EC) and unconditional (EU) element requests, and specify requests for single areas of virtual storage. The length of the single virtual storage area is indicated in the LV =:= length value parameter. The address of the allocated virtual storage area is returned at the address indicated in the A parameter.

RC indicates a conditional register request, and Rand RU indicate unconditional register requests. RC, RU, and R specify requests for single areas of virtual storage. The length of the single virtual area is indicated in the LV = length value parameter. The address of the allocated virtual storage area is returned in register 1. (R generates the SVC 10 calling sequence, whereas RU and RC generate the SVC 120 and associated parameter format.)

VRC and VRU indicate variable register conditional (VRC) and unconditional (VRU) requests for a single area of virtual storage. The length returned will be between the maximum and minimum lengths specified by the parameter LV=(maximum length value, minimum length value). The address of the allocated virtual storage is returned in register 1 and the length in register O.

Notes:

1. A conditional request indicates that the task is not to be abnormally terminated

if

virtual storage is not allocated to the active task. An unconditional request indicates that the task is to be abnormally terminated in this situation.

2. The LC, LU, VC, VU, EC, EU, and Rforms of the GETMAIN macro instruction can only be used to obtain virtual storage with addresses below 16 Mb. The RC, RU, VRC, and VRU forms of the GETMAIN macro instruction must be used to obtain virtual storage with addresses above 16 Mb.

LA specifies the virtual storage address of consecutive full words starting on a fullword boundary. Each fullword must contain the required length in the low-order three bytes, with the high-order byte set to O. The lengths should be multiples of 8; if they are not, the control program uses the next higher multiple of 8. If VC or VU was coded, two words are required. The first word contains the minimum length required, the second word contains the maximum length. If LC or LU was coded, one word is required for each virtual storage area requested; the high-order bit of the last word must be set to I to indicate the end of the list. The list must not overlap the virtual storage area specified in the A parameter.

LV = length value specifies the length, in bytes, of the requested virtual storage. The number should be a multiple of 8; if it is not, the control program uses the next higher multiple of 8. If R is specified, LV

=

(0) may be coded; the low-order three bytes of

GETMAIN - Allocate Virtual Storage 183

register 0 must contain the length, and the high-order byte must contain the subpool number. LV = (maximum length value, minimum length value) specifies the maximum and minimum values of the length of the storage request.

A specifies the virtual storage address of consecutive fullwords, starting on a fullword boundary. The control program places the address of the virtual storage area allocated in one or more words. If E was coded, one word is required. If L was coded, one word is required for each entry in the LA list. If V was coded, two words are required. The first word contains the address of the virtual storage area, and the second word contains the length actually allocated. The list must not overlap the virtual storage area specified in the LA parameter.

,SP = subpool nmbr

specifies the number of the subpool from which the virtual storage area is to be allocated.

The subpool number must be a valid subpool number between 0 and 127.

,BNDRY=DBLWD ,BNDRY=PAGE

specifies that alignment on a double word boundary (DBLWD) or alignment with the start of a virtual page on a 4K boundary (PAGE) is required for the start of a requested area.

If one of the following subpools 226, 233-235, 239, 245, or 253-255 is requested, the BNDRY=PAGE keyword is ignored. Requests for storage from these subpools are assigned from a single page, unless the request is greater than a page.

,LOC=BELOW ,LOC = (BELOW,ANY) ,LOC=ANY

,LOC = (ANY,ANY) ,LOC=RES ,LOC = (RES,ANY)

specifies the location of virtual and real storage. When LOC is specified, real storage is allocated anywhere until the storage is fixed. After the storage is fixed, virtual and real storage are located in the following manner.

LOC = BELOW indicates that real and virtual storage are to be located below 16 Mb.

LOC = (BELOW,ANY) indicates that virtual storage is to be located below 16 Mb and real storage can be located anywhere.

LOC = ANY and LOC = (ANY,ANY) indicates that virtual and real storage can be located anywhere.

Note: The LOC parameter is not valid for fixed subpools. For fixed subpools the actual location of the virtual storage area depends on the subpool specified. If the subpool is supported (backed) above 16 megabytes, GETMAIN attempts to locate the virtual storage area above 16 megabytes. If this is not possible, GETMAIN locates the virtual storage below 16 megabytes. LSQA subpools will be backed anywhere regardless of the LOC parameter.

LOC = RES indicates that the location of virtual and real storage depends on the location of the caller. If the caller resides below 16 Mb, virtual and real storage are to be located below 16 Mb; if the caller resides above 16 Mb, virtual and real storage are to be located anywhere.

184 Supervisor Services and Macro Instructions

LOC = (RES,ANY) indicates that the location of virtual storage depends upon the location of the caller. If the caller resides below 16 Mb, virtual storage is to be located below 16 Mb; if the caller resides above 16 Mb, virtual storage can be located anywhere.

In either case, real storage can be located anywhere.

,RELATED = value

specifies information used to self-document macro instructions by 'relating' functions or services to corresponding functions or services. The format and contents of the

information specified are at the discretion of the user, and may be any valid coding values.

The RELATED parameter is available on macro instructions that provide opposite services (for example, ATTACH/DETACH, GETMAIN/FREEMAIN, and

LOAD/DELETE), and on macro instructions that relate to previous occurrences of the same macro instructions (for example, CHAP and EST AE).

The RELATED parameter may be used, for example, as follows:

GETl GETMAIN

FREEl FREEMAIN

R,LV=4096,RELATED=(FREEl, 'GET STORAGE')

R,LV=4096,A=(l),RELATED=(GETl, 'FREE STORAGE')

Note: Each of these macro instructions will fit on one line when coded, so there is no need for a continuation indicator.

When control is returned, for conditional type requests (LC, EC, VC, RC, and VRC) register 15 contains one of the following return codes:

Hexadecimal

Code Meaning

00 Virtual storage requested was allocated.

04 The request could not be satisfied because of insufficient virtual storage.

The contents of registers 0, 1, and 15 are not preserved when the GETMAIN macro instruction is issued.

GETMAIN - Allocate Virtual Storage 185

Example 1

Example 2

Example 3

Operation: Obtain 400 bytes of storage from subpool 10. If the storage is available, the address will be returned in register 1 and register 15 will contain 0; if virtual storage is not available, register 15 will contain 4.

GETMAIN RC,LV=400,SP=10

Operation: Obtain 48 bytes of storage from default subpool O. If the storage is available, the address will be stored in the word at AREAADDR; if the virtual storage is not available, the task will be abnormally terminated.

GETMAIN EU,LV=48,A=AREAADDR

AREAADDR DS F

Operation: Obtain a maximum of 4096 or a minimum of 1024 bytes of virtual storage, with addresses above or below 16 Mb. Indicate that if the real storage is fixed, it should also be located above or below 16 Mb. If the storage is available, the address will be returned in register 1 and the length of the storage allocated will be returned in register 0; if the storage is not available, the task will be terminated.

GETMAIN VRU,LV=(4096,1024),LOC=ANY

186 Supervisor Services and Macro Instructions

GETMAIN (List Form)

Use the list form of the GETMAIN macro instruction to construct a control program parameter list.

The list form of the GETMAIN macro instruction is written as follows:

name b

GETMAIN b

LC LV VC VV EC EV

,LA = length addr ,LV = length value

,A = addr ,SP = subpool nmbr ,BNDRY=DBLWD ,BNDRY=PAGE ,RELATED = value ,MF=L

name: symbol. Begin name in column 1.

One or more blanks must precede GETMAIN.

One or more blanks must follow GETMAIN.

length addr: A-type address.

length value: symbol or decimal digit.

Note: LA may only be specified with EC or EV above.

Note: LV may only be specified with Le, LV,or VV above.

addr: A-type address.

sub pool nmbr: symbol or decimal digit 0-127.

Default: BNDRY=DBLWD

value: any valid macro keyword specified.

The parameters are explained under the standard form of the GETMAIN macro instruction, with the following exception:

,MF=L

specifies the list form of the GETMAIN macro instruction.

GETMAIN (List Form) 187

GETMAIN (Execute Form)

A remote control program parameter list is used in, and can be modified by, the execute form of the GETMAIN macro instruction. The parameter list can be generated by the list form of either a GETMAIN or a FREEMAIN.

The execute form of the GETMAIN macro instruction is written as follows:

name b

GETMAIN b

LC LV VC VV EC EV

,LA = length addr ,LV = length value

,A=addr ,SP = subpool nmbr ,BNDRY= DBLWD ,BNDRY = PAGE ,RELATED = value ,MF = (E,ctrl prog)

name: symbol. Begin name in column 1.

One or more blanks must precede GETMAIN.

One or more blanks must follow GETMAIN.

length addr: RX-type address or register (2) - (12).

length value: symbol, decimal digit, or register (2) - (12).

Note: LA may only be specified with EC or EV above.

Note: LV may only be specified with LC, LV, VC, or VV above.

addr: RX-type address, or register (2) - (12).

subpool nmbr: symbol, decimal digit 0-127, or register (2) - (12).

Default: BNDRY = DBL WD

value: any valid macro keyword specified.

ctrl prog: RX-type address, or register (1) or (2) - (12).

The parameters are explained under the standard form of the GETMAIN macro instruction, with the following exception:

,MF

=

(E,ctrl prog)

specifies the execute form of the GETMAIN macro instruction using a remote control program parameter list.

188 Supervisor Services and Macro Instructions

Dans le document ana Macro Instructions (Page 193-200)