General
Application area: | Memory pools; see "Common memory areas shared by several users (Memory pools)" |
Macro type: | Type S, MF format 1: standard/L/E form; see "S-type macros" |
A user can explicitly request (REQMP) and also release (RELMP) contiguous memory space in a memory pool. The following applies to the release of memory space in a memory pool:
the caller must be a pool participant (ENAMP),
it is irrelevant which of the pool participants requested the memory space and in what units it was requested.
Macro description
The user can release contiguous memory space in a memory pool with the RELMP macro. The release is carried out in memory pages (4K).
Notes
A memory pool is accessed via the pool name or via its ID (see ENAMP).
The release of pool pages does not change the size of a memory pool as specified in the ENAMP macro.
The memory space to be released need not have been allocated as a contiguous memory area.
RELMP is rejected if the memory pool is write-protected (CSTMP macro).
Macro format and description of operands
RELMP |
{ {MPNAME=name / MPNAMAD={addr / (r)}[,MPNAMLN={length / (r)}]} [,SCOPE={LOCAL / GROUP / USER_GROUP / GLOBAL}] / MPID={addr / (r)} } [,ADDR=addr / (r)] [,BSIZE=number / (r) / ALL] [,PARMOD=24 / 31] [,MF=L / (E,..)] |
MPNAME=
Defines the name of the memory pool (note the connection with the SCOPE operand).
name
Name of the memory pool.
MPNAMAD=
Specifies the address of the field containing “name” (note the connection with the SCOPE operand).
addr
Symbolic address (name) of the field.
(r)
Register containing the address value “addr”.
MPNAMLN=
Specifies the length of the memory pool name specified under MPNAMAD. If omitted: length attribute of the “addr” field, or 54 bytes if MPNAMAD=(r) was specified.
length
Length in bytes
(r)
Register containing “length”.
SCOPE=
Defines the scope (authorized users) of the memory pool. This specification is used to identify the memory pool uniquely and must always be entered in conjunction with the MPNAME or MPNAMAD operand.
LOCAL
The memory pool is only used by the user who created it.
GROUP
Memory pool users can be all tasks with the ID of the user that created the memory pool.
USER_GROUP
All the tasks, whose user IDs belong to the same user group as the user ID of the creating participant, can be participants.
The operand value assumes the existence of user groups and may therefore only be specified when the SRPM function unit of the SECOS software product is available in the system. This is why the GETUGR macro (see the “SECOS” manual [14 (Related publications)]) has to check whether SRPM is available prior to a macro call with SCOPE=USER_GROUP. The program reaction is dependent on the result (return code).
GLOBAL
Users can be all the tasks running in the system.
MPID=
Specifies the address of a field (length = 4 bytes) with the ID for the memory pool (see ENAMP). The ID provides unique identification of the memory pool; this operand speeds up processing.
addr
Symbolic address (name) of the field containing the ID.
(r)
Register containing the address value “addr”.
ADDR=
Specifies the start address of the memory area to be released. The address must be aligned on a 4K boundary. The entire area must be in the specified memory pool.
Note
The ADDR operand is mandatory unless BSIZE=ALL is specified.
addr
Start address.
(r)
Register containing the start address.
BSIZE=
Specifies the size in (4K) memory pages of the memory area to be released. Default value: BSIZE=1.
Note
The BSIZE=0 operand is permitted; memory space is not released.
number
Number of memory pages.
(r)
Register containing “number”.
ALL
All the memory pages requested for the memory pool are released.This operand can also be executed in register “r” in the form C' ALL'.
MF=
For a general description of the MF operand, its operand values and any subsequent operands (e.g. for a prefix), see section “S-type macros”. The valid MF values are given at the start of the macro description under “Macro type” and are included in the macro format.
PARMOD=
Controls macro expansion. Either the 24-bit or the 31-bit interface is generated.
If PARMOD is not specified here, macro expansion is performed according to the specification for the GPARMOD macro or according to the default setting for the assembler (= 24-bit interface).
24
The 24-bit interface is generated. Data lists use 24-bit addresses. (Address space <= 16 Mb).
31
The 31-bit interface is generated.
Data lists use 31-bit addresses (address space <= 2 Gb) and start with the standard header.
Return information and error flags
After macro processing, register R1 contains the operand list address.
R15:
+---------------+ | | | | | |b|b|0|0|0|0|a|a| +---------------+
A structured return code (aa = primary return code,
bb = secondary return code) relating to the execution of the RELMP macro is transferred in register R15.
aa = X'00': normal execution,
aa = X'04': function was not carried out.
X'bb' | X'aa' | Meaning |
X'00' | X'00' | Normal execution. Memory pages were released |
X'18' | X'00' | Normal execution. Memory pages were released; not all the pages in the specified |
X'04' | X'04' | Function was not executed. The caller is not a memory pool participant (no |
X'18' | X'04' | Function was not executed; invalid memory area:
|
X'1C' | X'04' | The function was not executed; operand error:
|
X'24' | X'04' | Function was not executed; authorization error:
|
31-bit interface:
In the event of errors in the initialization of the standard header, the return codes X'0001FFFF' / X'0003FFFF' / X'0004FFFF' are additionally transferred in register R15; see table “Standard return codes” (Standard header).
No return codes are transferred in the standard header.