NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES | SEE ALSO
#include <exec/chTrap.h>int svSysTrapHandlerConnect(unsigned int trapnumber, KnLapDesc * newhandler);
CORE
The svSysTrapHandler calls are used to manage system trap handlers. These calls are restricted to SUPERVISOR threads.
The trapnumber parameter identifies the trap number to which the handler must be connected.
Trap handlers are specified in the form of lap descriptors (see svLapCreate(2K)).
When a thread executes a hardware trap instruction, the system invokes (see lapInvoke(2K) ) the trap handler connected to the trap number specified by the trap instruction.
The argument of the lap trap handler is a pointer to a KnSysTrapDesc data structure. This structure has the following fields:
KnThreadCtx *threadCtx ; unsigned int trapNumber ;
The threadCtx field gives access to the register context of the thread saved immediatly after it performed the hardware trap instruction. This context is processor--dependent and may be modified by the trap handler.
The trapNumber field is a processor--dependent trap number.
The svSysTrapHandlerConnect system call duplicates the lap descriptor pointed to by newhandler into the lap descriptor associated with trapNumber .
The svSysTrapHandlerDisconnect system call clears the lap descriptor associated with trapNumber . If curhandler is not equal to K_CONNECTED_LAP, it must point to a lap descriptor identical to the lap descriptor currently installed.
The svSysTrapHandlerGetConnected system call copies the lap descriptor associated with trapNumber at the location pointed to by curhandler ..
Upon successful completion, the calls return K_OK, otherwise a negative error code is returned.
svSysTrapHandlerConnect is called and there is already a valid lap descriptor installed for the trap trapnumber .
trapnumber is invalid. The curhandler lap descriptor specified to svSysTrapHandlerDisconnect is not equal to K_CONNECTED_LAP and does not match the lap descriptor currently installed.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES | SEE ALSO