MCPcopy Create free account
hub / github.com/devkitPro/libctru / threadOnException

Function threadOnException

libctru/include/3ds/thread.h:113–123  ·  view source on GitHub ↗

* @brief Sets the exception handler for the current thread. Called from the main thread, this sets the default handler. * @param handler The exception handler, necessarily an ARM function that does not return * @param stack_top A pointer to the top of the stack that will be used by the handler. See also @ref RUN_HANDLER_ON_FAULTING_STACK * @param exception_data A pointer to the buffer that will

Source from the content-addressed store, hash-verified

111 * The current thread need not be a libctru thread.
112 */
113static inline void threadOnException(ExceptionHandler handler, void* stack_top, ERRF_ExceptionData* exception_data)
114{
115 u8* tls = (u8*)getThreadLocalStorage();
116
117 *(u32*)(tls + 0x40) = (u32)handler;
118 *(u32*)(tls + 0x44) = (u32)stack_top;
119 *(u32*)(tls + 0x48) = (u32)exception_data;
120
121 __dsb();
122 __isb();
123}

Callers

nothing calls this directly

Calls 3

getThreadLocalStorageFunction · 0.85
__dsbFunction · 0.85
__isbFunction · 0.85

Tested by

no test coverage detected