Initializing extended ECBs and ECB extensions

The user must obtain and initialize the extended ECBs and ECB extensions. A system service is not available to perform these functions.

The ECB extension must be obtained and initialized before the initialization of the extended ECB. This sequence avoids the possibility of an initialized extended ECB being posted before the initialization of the ECB extension.

The ECB extension is two words long, begins on a word boundary, and can be from any subpool. However, the POST routine must be able to read from the ECB extension in the PSW key of the issuer of the POST macro. The ECB extension must also be accessible in the addressing mode of the POST's caller. More than one extended ECB can point to it. The mapping for the ECB extension is available via the EXT=YES parameter on the IHAECB mapping macro. The ECB extension has the format shown in Table 1:
Table 1. ECB Extension (ECBE)
ECB extension format    

VALUE
(1 byte)

MODE
(1 byte)

RESERVED
(2 bytes)

 

POST DATA
(4 bytes)
 

 
The fields in the ECBE are:
VALUE
is one byte containing a value of 1 to 255. A value of 1 indicates that the POST exit function is being requested.
MODE
The first bit of this byte indicates the addressing mode of the exit routine. If the byte contains X'80', the exit routine will receive control in 31-bit addressing mode. If the byte contains X'00', the exit routine will receive control in 24-bit addressing mode.
POST DATA
This field contains the address of the exit routine to be given control when the POST occurs.
The extended ECB must conform to current requirements for ECBs and be initialized as shown below. The extended ECB must be initialized only after it is eligible for posting. The extended ECB must be initialized using a compare-and-swap (CS) instruction. Holding the LOCAL lock does not eliminate the requirement to use the CS instruction to initialize the ECB because the ECB could be quick posted by a routine, using CS, that does not hold the LOCAL lock. It is unnecessary to hold the LOCAL lock to initialize an extended ECB. Compare and swap is necessary and sufficient to initialize the extended ECB. The meaning of the bits in the extended ECB follows:
Bits
Meaning
0
If one, indicates initialized ECB.
1-29
Bits 1-29 of the address of the associated ECB extension.
30-31
If ones, indicates an extended ECB.

If the compare and swap fails and if the ECB is pre-posted, the user should perform the appropriate POST exit functions in order to replace those ordinarily performed by the already concluded POST processing.