Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

CSTMP - Set read/write access for memory pool

&pagelevel(3)&pagelevel

General

Application area:

Memory pools; see "Common memory areas shared by several users (Memory pools)"

Macro type:

Type S, MF format 1: standard/L/D/E form; see "S-type macros"


A memory pool (MP) is a memory area in class 6 memory that can be used by several users at the same time. Its size (and position) is determined by the first user. A memory pool can be furnished with write protection (CSTMP has priority over CSTAT).

Creating a “read-only memory pool”:

  1. create the MP and request memory pages (ENAMP, REQMP)

  2. write to the MP (e.g. load shared code)

  3. establish write protection = set MP to “read only” (CSTMP)

Macro description

The (authorized) user can provide a memory pool with write protection (only read access is allowed) or revoke this protection with the CSTMP macro. The requested access protection applies to all pages of the memory pool and all participants. The function is only carried out if the user has the required authorization (CSTMP-MACRO-ALLOWED=*YES) in the user catalog.

Notes

  • A memory pool is addressed by means of either its pool name or its ID (see ENAMP).

  • CSTMP overrides the effect of the CSTAT macro:

    • CSTAT is rejected if write protection has already been established with CSTMP.

    • write protection established with CSTAT can be removed or extended to all pool pages by means of CSTMP. Such an extended write protection can only be removed again by means of CSTMP.

  • Different levels of protection cannot be established with CSTMP.

  • It is not possible to either request (REQMP) or release (RELMP) pages for a writeprotected memory pool.

Macro format and description of operands

CSTMP

{{MPNAME=name / MPNAMAD=addr [,MPNAMLN=length]}

,SCOPE={LOCAL / GROUP / USER_GROUP / GLOBAL}} /

MPID=addr}

,ACCESS=WRITE / READ

[,PARMOD=24 / 31]

[,MF=L / (E,..) / (D,pre) / D]

MPNAME=
Defines the name of the memory pool.

name
Name of the memory pool (note the connection with the SCOPE operand).

MPNAMAD=
Specifies the address of the field containing the name of the memory pool.

addr
Symbolic address (name) of the field (note the connection with the SCOPE operand).

MPNAMLN=
Gives the length of the name to which MPNAMAD refers. If this operand is omitted, the length attribute of “addr” is assumed.

length
Length in bytes.

MPID=
Defines the address of the field (length = 4 bytes) with the ID for the memory pool (see also ENAMP). The ID identifies the memory pool uniquely. The use of the memory pool ID increases the speed of processing.

addr
Symbolic address (name) of the field containing the ID.

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 used only by the user that 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
All the tasks in the system are participants.

ACCESS=
Defines whether the memory pool is read-only or open to both read and write access (authorization for write access implies read access as well); this applies to all users.

WRITE
Write access is permissible.

READ
Only read access is permissible.

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.
A prefix (pre = 1..3 letters) can be specified in the D form of the macro, as shown in the macro format.
Default setting: pre = CST

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 and instructions use 24-bit addresses (address space <= 16 Mb).

31
The 31-bit interface is generated. Data lists and instructions use 31-bit addresses (address space <= 2 Gb). Data lists 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 CSTMP macro is transferred in register R15.
aa=X'00': normal execution;
aa=X'04': function is not executed.

X'bb'

X'aa'

Meaning

X'00'

X'00'

Normal execution

X'04'

X'04'

Function is not carried out; the caller is not a memory pool user (no ENAMP macro)

X'1C'

X'04'

Function is not carried out; operand error:

  • invalid address of the operand list

  • error in operand list structure

  • invalid address for MPNAMAD or MPID in the operand list

  • designation of the memory pool:

    • name contains invalid characters

    • invalid length specification (MPNAMLN)

    • memory pool not designated (MPNAME, MPNAMAD, MPID not specified)

    • MPNAMLN specified, but MPNAMAD omitted

    • SCOPE specified, but MPNAME/MPNAMAD omitted

    • designation not unequivocal: more than one operand was specified as
      designation (MPNAME/MPNAMAD/MPID)

  • invalid SCOPE specification

  • SCOPE=USER_GROUP was specified, but SRPM is not available in system

  • invalid ACCESS specification

  • PARMOD=24 specified in conjunction with 31-bit addressing mode (AMODE31)

X'24'

X'04'

Function not carried out; authorization error:

  • the caller is not authorized to call the CSTMP macro (missing entry in the user ID)

  • the caller is not authorized to change the access protection of a privileged or
    class 5 memory pool

  • The memory pool contains DIV or FASTPAM windows

31-bit interface:

  • In the event of errors in the alignment or 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.