General
Application area: | Extended addressing with data spaces; see "Extended addressing with data spaces" |
Macro type: | Type S, MF format 3: C/D/L/M/R/E form; see "S-type macros" |
The ALESRV macro can can be used on all BS2000 servers
(see section “Extended addressing with data spaces”).
Macro description
The ALESRV connects a program running in AR mode with a data space that was set up using the DSPSRV macro. The system establishes a connection to the specified data space by searching for a free entry (ALE) in the task's access list, assigning it and returning the ALET for addressing purposes. When creating an ALE, the system checks whether the program is authorized to access this data space. Once the program has loaded a valid ALET into the access register, the system no longer performs a check before allowing access.
The ALESRV macro can also be used to release a data space. The system flags the entry (ALE) that connects the program to the data space as invalid in the task's access list. This entry is then available for a new connection (using FCT=CONNECT). If, during address conversion, an entry flagged as invalid is accessed, an interrupt occurs (see the STXIT macro).
If the user specifies an ALET, the ALESRV macro outputs the identification (SPID) associated with the data space which identifies the data space uniquely throughout the session.
The functions of the ALESRV macro make it possible to
set up a connection between a program and a data space (FCT=CONNECT),
clear this connection (FCT=DISCONN) and
output the SPID of a data space (FCT=IDENTIFY).
Macro format and description of operands
ALESRV |
FCT={CONNECT, SPID=spid_addr / DISCONN, ALET=alet_addr / IDENTIFY, ALET=alet_addr} ,MF=C / D / L / M / R / E [,PARAM=addr / (r)] ,PREFIX=N / p ,MACID=VDA / macid |
FCT=
Specifies which of the functions of the ALESRV macro is to be executed.
CONNECT
Connects a program running in AR mode to an existing data space. A free entry (ALE) in the access list is assigned and the ALET is output.
The SPID operand must be specified.
DISCONN
Disconnects the program running in AR mode from the data space by releasing an assigned entry (ALE) in the access list, i.e. by flagging it as invalid.
The ALET operand must be specified.
IDENTIFY
Identifies a data space by means of its ALET, which points to an entry (ALE) in the access list. The SPID of the data space is output.
The ALET operand must be specified.
ALET=
Is the contents of an access register and points to an entry in the access list. This entry connects the program with the data space.
This operand may be an input or output operand.
alet_addr
Symbolic address (name) of a 4-byte field containing the ALET of a specific data space.
SPID=
Identifies a data space uniquely throughout the system. The system assigns the SPID on creation of a data space. This operand can be an input or output operand.
spid_addr
Symbolic address (name) of an 8-byte field containing the SPID of a data space.
MF=
For a general description of the MF operand, its operand values and any subsequent operands (e.g. PREFIX, MACID and PARAM), 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.
It is possible to specify a PREFIX in the C form, D form, R form or M form of the macro, and additionally a MACID in the C form, R form or M form (see "S-type macros").
Notes on the macro call
The ALET operand can be an input or or output operand, i.e. FCT=CONNECT places it in the generated parameter list as an output operand; the next time this parameter list is used, the ALET operand is also valid as an input operand.
Multiple connections to one and the same data space can be set up using different ALETs. Each of these ALETs must be deleted by a corresponding FCT=DISCONNECT call, since the system does not automatically delete all corresponding ALETs when releasing a data space.
The ALET value assignment is deterministic, in other words for two programs in a BS2000 system run the sequence of the successful ALESRV calls with FCT=CONNECT and FCT=DISCONN is identical and parameterized in the same way (with CONNECT this means: SPID of the same data space specified; with DISCONN: the same ALET), thus both programs obtain the same ALET output value in the event of the nth ALESRV-CONNECT.What is meant here is as follows:If two TU programs behave in the same way with regard to connection to data spaces, they are also assigned the same ALETs.
A data space is released using the DSPSRV FCT=DESTROY macro or on termination of the program that created the data space.
Return information and error flags
Standard header:
+---------------+ | | | | | |c|c|b|b|a|a|a|a| +---------------+
A return code relating to the execution of the ALESRV macro is transferred in the standard header
(cc=Subcode2, bb=Subcode1, aaaa=Maincode)
X'cc' | X'bb' | X'aaaa' | Meaning |
X'00' | X'00' | X'0000' | Function executed successfully.
|
X'02' | X'00' | X'0001' | Warning: the entry in the access list was deleted but the associated data |
X'00' | X'01' | X'0003' | Error in data area |
X'01' | X'01' | X'0004' | SPID operand missing (if FCT=CONNECT) |
X'02' | X'01' | X'0004' | ALET operand missing (if FCT=DISCONN or FCT=IDENTIFY) |
X'20' | X'0005' | Internal error | |
X'00' | X'40' | X'0304' | Incorrect specification of SPID operand: |
X'01' | X'40' | X'0304' | Incorrect specification of SPID operand: |
X'00' | X'40' | X'0404' | Incorrect specification of ALET operand: |
X'01' | X'40' | X'0404 | Incorrect specification of ALET operand: |
X'00' | X'40' | X'0406' | Access list full, i.e. there are no free entries available for setting up a new |
X'00' | X'40' | X'0604' | Specified ALET references a data space that has already been deleted |
Other return codes which, in accordance with conventions, apply to all macros are given in the table “Standard return codes” (Standard header).
For an example see section “Extended addressing with data spaces”.