Exception handling.
More...
Exception handler function.
- Parameters
-
type | Exception type |
subtype | Exception subtype |
addr | Exception address |
regs | Register state at time of exception |
fpuregs | FPU state at time of exception. NULL if unused. |
- Returns
- If this function returns, the register state specified in regs/fpuregs will be resumed.
Enumerator |
---|
EXCEPT_PAGEFAULT |
Page fault (or other memory access fault)
|
EXCEPT_BREAKPOINT |
Software breakpoint.
|
EXCEPT_SINGLESTEP |
Single-step execution.
|
Subtype for page fault exceptions.
Enumerator |
---|
PAGEFLT_READ |
Read page fault.
|
PAGEFLT_WRITE |
Write page fault.
|
PAGEFLT_EXEC |
Execute (instruction fetch) page fault.
|
errval_t thread_set_exception_handler |
( |
exception_handler_fn |
newhandler, |
|
|
exception_handler_fn * |
oldhandler, |
|
|
void * |
new_stack_base, |
|
|
void * |
new_stack_top, |
|
|
void ** |
old_stack_base, |
|
|
void ** |
old_stack_top |
|
) |
| |
Set the exception handler function for the current thread. Optionally also change its stack, and return the old values.
- Parameters
-
newhandler | New exception handler. Pass NULL to disable an existing handler. |
oldhandler | If non-NULL, returns previous exception handler |
new_stack_base | If non-NULL, sets a new exception handler stack (base) |
new_stack_top | If non-NULL, sets a new exception handler stack (top) |
old_stack_base | If non-NULL, returns previous stack base |
old_stack_top | If non-NULL, returns previous stack top |