Signal Exception (SIGEXCP)


Op Code (Hex) Extender Operand 1 Operand 2 Operand 3-4
SIGEXCP 10CA
Attribute template Exception data


SIGEXCPB 1CCA Branch options Attribute template Exception data Branch targets


SIGEXCPI 18CA Indicator options Attribute template Exception data Indicator targets

Operand 1: Space pointer.

Operand 2: Space pointer.

Operand 3-4:

Description

This instruction signals a new exception or resignals an existing exception to the thread. Optionally, the instruction branches to one of the specified targets based on the results of the signal and the selected branch options in the extender field, or it sets indicators based on the results of the signal. The signal is presented starting at the invocation identified in the signal template.

The template identified by operand 1 specifies the signal option and starting point. It must be 16-byte aligned in the space with the following format.

Offset
Dec Hex
Field Name
Data Type and Length
0 0
Target invocation address
Space pointer or Invocation pointer
16 10
Signal option
Char(1)
16 10
Signal/resignal option
Bit 0



0 = Signal new exception.
1 = Resignal currently handled exception (valid only for an external exception handler).



16 10
Invoke PDEH (process default exception handler) option
Bit 1



0 = Invoke PDEH if no exception description found for invocation.
1 = Do not invoke PDEH if no exception description found for invocation (ignore if base invocation entry specified).



16 10
Exception description search control
Bit 2



0 = Exception description search control not present
1 = Exception description present



16 10
Reserved (binary 0)
Bits 3-7
17 11
Reserved (binary 0)
Char(1)
18 12
First exception description to search
Bin(2)
20 14
--- End ---

The target invocation address pointer uniquely identifies the invocation to which the exception is to be signalled. Signalling directly to the PDEH can not be accomplished via this instruction. If the target invocation address pointer locates neither a valid invocation entry nor the base invocation entry, the invalid invocation address  (hex 1603) exception is signaled.

The invocation which issued this instruction will be checked to ensure it has the proper authority to send an exception message to the target invocation. If the authority check fails, activation group access violation  (hex 2C12) exception will be signaled. If the program associated with the invocation has defined an exception description to handle the exception, the specified action is taken; otherwise, the PDEH is invoked unless the invoke PDEH option bit is 1 (the exception is considered ignored). If the base invocation entry is addressed instead of an existing invocation, the PDEH will be invoked.

A change has been made to the way in which exception handlers are determined for bound programs. The following description relates only to the invocation of exception handlers related to non-bound programs. In both instances the actions of signalling and handling have been broken apart.

Note:

Exception descriptions of an invocation are searched in ascending ODT number sequence. If the exception description search control specified exception description search control not present, the search begins with the first exception description defined in the ODT. Otherwise, the first exception description to search value identifies the relative number of the exception description to be used to start the search. The value must be a nonzero positive binary number determined by the order of definition of exception descriptions in the ODT. This value is also returned by the Sense Exception Description (SNSEXCPD) instruction. A value of 1 indicates that the first exception description in the invocation is to be used to begin the search. If the value is greater than the number of exception descriptions for the invocation, the template value invalid  (hex 3801) exception is signaled.

If an exception ID in an exception description corresponds to the signaled exception, the corresponding compare values are verified. If the compare value length in the exception description is less than the compare value length in the signal template, the length of the compare value in the exception description is used for the match. If the compare value length in the exception description is greater than the compare value length in the signal template, an automatic mismatch results. Machine-signaled exceptions have a 4-byte compare value of binary 0's.

An exception description may monitor for an exception with a generic ID as follows:

Hex 0000 =

Any signaled exception ID results in a match.

Hex nn00 =

Any signaled exception ID in class nn results in a match.

Hex nnmm =

The signaled exception ID must be exactly nnmm in order for a match to occur.

An exception description may be in one of five states, each of which determines an action to be taken when the match criteria on the exception ID and compare value are met.

IGNORE

No exception handling occurs. The Signal Exception instruction is assigned a resultant condition of ignored. If a corresponding branch or indicator setting is present, that action takes place.

DISABLE

The exception description is bypassed, and the search for a monitor continues with the next exception description defined for the invocation.

RESIGNAL

The search for a monitoring exception description is to be reinitiated at the preceding invocation. A resignal from the initial invocation in the thread results in the invocation of the process default exception handler.

DEFER

The exception description is signaled, and the Signal Exception instruction is assigned the resultant condition of deferred. If a corresponding branch or indicator setting is present, that action takes place. To take future action on a deferred exception, the exception description must be synchronously tested with the Test Exception (TESTEXCP) instruction in the signaled invocation.

HANDLE

Control is passed to the indicated exception handler, which may be a branch point, an internal subinvocation, or an external invocation.

If the exception description is in the ignore or defer state and if the Signal Exception instruction does not specify a branch or indicator condition or if it specifies branch or indicator conditions that are not met, then the instruction following the Signal Exception instruction is executed.

When control is given to an internal or branch point exception handler, all invocations up to, but not including, the exception handling invocation are terminated. Any invocation exit programs set for the terminated invocations will be given control before execution proceeds in the signaled exception handler.

When this instruction is invoked with the resignal option, all invocations up to, but not including, the interrupted invocation are cancelled and the message is signalled to the next oldest invocation in the stack. This implies that the Return from Exception (RTNEXCP) instruction can no longer return to the invocation that issued the resignal request. Any cancel handlers set for the cancelled invocations will be given control before execution proceeds in the signaled exception handler.

If a failure to invoke an external exception handler or an invocation exit occurs, a failure to invoke program event is signaled. For each destroyed invocation, the invocation count in the corresponding activation entry (if any) is decremented by 1.

The template identified by operand 2 must be 16-byte aligned in the space. It specifies the exception-related data to be passed with the exception signal. The format of the exception data is the same as that returned by the Retrieve Exception Data (RETEXCPD) instruction. The format is as follows:

Offset
Dec Hex
Field Name
Data Type and Length
0 0
Template size
Char(8)
0 0
Number of bytes of data to be signaled
Bin(4)



(must be at least 48 bytes)


4 4
Number of bytes available for materialization
Bin(4) +
8 8
Exception identification
Char(2)
10 A
Compare value length (maximum of 32 bytes)
Bin(2)
12 C
Compare value
Char(32)
44 2C
Reserved
Char(4) +
48 30
Exception specific data
Char(*)
* *
--- End ---

Note: Fields shown here with a plus sign (+) are ignored by the instruction.
Operand 2 is ignored if signal/resignal option is resignal because the exception-related data is the same as for the exception currently being processed; however, it must be specified when signaling a new exception.

The maximum size for exception specific data that is to accompany an exception signaled by the Signal Exception instruction is 65,503 bytes, including the standard exception data.

The following parameters will be given the following default values:

Message status - log message + retain + action pending

Initial monitor priority - 64

Interrupt class mask - Message generated by Signal Exception instruction

Source invocation - invocation issuing SIGEXCP instruction

Resultant Conditions

Authorization Required

The invocation which originated the exception must have proper activation group access to the target invocation. The following algorithm is used to determine this access.

  1. The invocation which invoked the SIGEXCP instruction must have access to the invocation identified as the Originating Invocation.

  2. The Originating Invocation must have access to the invocation identified as the Source Invocation or to the invocation directly called by the Source invocation.

  3. The Originating Invocation must have access to the invocation identified as the Target Invocation or to the invocation directly called by the Target Invocation.

If any of the access checks fail then an activation group access violation  (hex 2C12) exception will be signaled.

Lock Enforcement

Exceptions

06 Addressing

08 Argument/Parameter

10 Damage Encountered

16 Exception Management

1C Machine-Dependent

20 Machine Support

22 Object Access

24 Pointer Specification

2C Program Execution

2E Resource Control Limit

36 Space Management

38 Template Specification

44 Protection Violation