[][src]Function sunrise_libuser::threads::thread_trampoline

extern "fastcall" fn thread_trampoline(thread_context_addr: usize) -> !

Small stub executed by every thread but the main thread when they start.

Saves the pointer to their ThreadContext in their TLS, performs copy of .tdata and .tbss, calls the routine this thread was meant to perform, and calls svcExitThread when it's finished.

ABI

This function is the entry point of a thread, called directly by the kernel, with the argument passed by Thread::create. It expects this argument to be the address of its ThreadContext so it can save it its TLS.

The routine to call and its argument are expected to be found in this ThreadContext.