* @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
| 111 | * The current thread need not be a libctru thread. |
| 112 | */ |
| 113 | static 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 | } |
nothing calls this directly
no test coverage detected