Barrelfish
Typedefs | Enumerations | Functions
except.h File Reference

Exception handling. More...

Typedefs

typedef void(* exception_handler_fn) (enum exception_type type, int subtype, void *addr, arch_registers_state_t *regs, arch_registers_fpu_state_t *fpuregs)
 Exception handler function. More...
 

Enumerations

Functions

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. More...
 

Detailed Description

Exception handling.

Typedef Documentation

typedef void(* exception_handler_fn) (enum exception_type type, int subtype, void *addr, arch_registers_state_t *regs, arch_registers_fpu_state_t *fpuregs)

Exception handler function.

Parameters
typeException type
subtypeException subtype
addrException address
regsRegister state at time of exception
fpuregsFPU state at time of exception. NULL if unused.
Returns
If this function returns, the register state specified in regs/fpuregs will be resumed.

Enumeration Type Documentation

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.

Function Documentation

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
newhandlerNew exception handler. Pass NULL to disable an existing handler.
oldhandlerIf non-NULL, returns previous exception handler
new_stack_baseIf non-NULL, sets a new exception handler stack (base)
new_stack_topIf non-NULL, sets a new exception handler stack (top)
old_stack_baseIf non-NULL, returns previous stack base
old_stack_topIf non-NULL, returns previous stack top