pub unsafe extern "C" fn threadOnException(
    handler: ExceptionHandler,
    stack_top: *mut c_void,
    exception_data: *mut ERRF_ExceptionData
)
Expand description

Sets the exception handler for the current thread. Called from the main thread, this sets the default handler.

§Arguments

  • handler - The exception handler, necessarily an ARM function that does not return
  • stack_top - A pointer to the top of the stack that will be used by the handler. See also RUN_HANDLER_ON_FAULTING_STACK
  • exception_data - A pointer to the buffer that will contain the exception data. See also WRITE_DATA_TO_HANDLER_STACK and WRITE_DATA_TO_FAULTING_STACK

To have CPU exceptions reported through this mechanism, it is normally necessary that UNITINFO is set to a non-zero value when Kernel11 starts, and this mechanism is also controlled by svcKernelSetState type 6, see 3dbrew.

VFP exceptions are always reported this way even if the process is being debugged using the debug SVCs.

The current thread need not be a libctru thread.