pub type ExceptionHandler = fn(exception_number: u64, exception_info: *mut ExceptionInfo, context: *mut Context, page_fault_address: u64) -> bool;Expand description
Exception handler function type.
Handlers receive mutable pointers to the exception information and CPU context, allowing direct access and modification of exception state.
§Parameters
exception_number- Exception vector number (0-30)exception_info- Mutable pointer to exception information (instruction pointer, error code, etc.)context- Mutable pointer to saved CPU context (registers, FPU state, etc.)page_fault_address- Page fault address (only valid for page fault exceptions)
§Returns
true- Suppress the default abort behavior and continue executionfalse- Allow the default abort to occur
§Safety
This function type uses raw mutable pointers. Handlers must ensure:
- Pointers are valid for the duration of the handler
- Any modifications to exception state maintain system integrity
- Modified values are valid for CPU state (e.g., valid instruction pointers, aligned stack pointers)