Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (A-B)
Guardian Procedure Calls Reference Manual—522629-013
2-36
ARMTRAP Procedure
(Superseded by SIGACTION_INIT_ Procedure )
•
Resume the process and disarm all trap handling. This must be done by a call to
ARMTRAP from within a trap handler with
traphandlr-addr set to 0 and
trapstack-addr set to a negative value. See “Considerations” for details.
Trap Handler Activation and Termination
When a trap handler has been armed and a trap subsequently occurs, control passes
to the trap handler at the location specified by
traphandlr-addr in the same code
segment as the original call to ARMTRAP. Trap handling is automatically disabled. ‘S’
and ‘L’ are set to
trapstack-addr plus 6; the seven words starting at trapstack-
addr are (relative to the new ‘L’ setting):
'L'[-6] Reserved
'L'[-5] Space ID at the time of the trap
'L'[-4] Trap number:
0 Illegal address reference
1 Instruction failure
2 Arithmetic overflow
3 Stack overflow
4 Process loop timer timeout
5 Call from process with PIN > 255
11 Memory manager read error
12 No memory available
13 Uncorrectable memory error
'L'[-3] Value of ‘S’ at the time of the trap; it is -1 if the trap occurs in a
protected code area (see “Considerations”)
'L'[-2] Value of ‘P’ at the time of the trap; the ‘P’ value associated with the
space ID in ‘L’[-5] completely identifies the location of the trap
'L'[-1] Value of the hardware ENV register at the time of the trap
'L'[0] Value of ‘L’ at the time of the trap
The locations ‘L’[-5] through ‘L’[0] are referred to as trap variables: space ID, trap
number, S, P, ENV, and L, respectively.
The trap handler exits by a call to ARMTRAP with
trapstack-addr = 0. The
process’s registers at the time that it resumes are set to the values indicated by the
following ‘L’ relative locations:
'L'[-6] Reserved
'L'[-5] New value for space index, in bits <11:15>; bits <0:10> are ignored
(see “Considerations”)
'L'[-4] Ignored
'L'[-3] New value for S register