Handles exceptions that occur while a kernel thread is executing in user mode.
#include <sys/types.h> #include <sys/errno.h> #include <sys/except.h>
int func (exp, type, tid, mst)
struct excepth * exp;
int type;
tid_t tid;
struct mstsave * mst;
The user-mode exception handler (exp->func) is called for synchronous exceptions that are detected while a kernel thread is executing in user mode. The kernel exception handler saves exception information in the mstsave area of the structure. For user-mode exceptions, it calls the first exception handler found on the user exception handler list. The exception handler executes in an interrupt environment at the priority level of either INTPAGER or INTIODONE.
If the registered exception handler returns a return code indicating that the exception was handled, the kernel exits from the exception handler without calling additional exception handlers from the list. If the exception handler returns a return code indicating that the exception was not handled, the kernel invokes the next exception handler on the list. The last exception handler in the list is the default handler. This is typically signalling the thread.
The kernel exception handler must not page fault. It should also register an exception handler using the setjmpx kernel service if any exception-handling activity can result in an exception. This is important particularly if the exception handler is handling the I/O. If the exception handler did not handle the exception, the return code should be set to the EXCEPT_NOT_HANDLED value for user-mode exception handling.
The user-mode exception handler for the uexadd kernel service is called in the interrupt environment at the INTPAGER or INTIODONE priority level.
EXCEPT_HANDLED | Indicates that the exception was successfully handled. |
EXCEPT_NOT_HANDLED | Indicates that the exception was not handled. |
The uexadd kernel service.
User-Mode Exception Handling and Kernel Extension and Device Driver Management Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.