mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-24 23:56:49 +03:00
27ddc31f12
git-svn-id: svn://kolibrios.org@3805 a494cfbc-eb01-0410-851d-a64ba20cac60
23 lines
572 B
C
23 lines
572 B
C
#include <newlib.h>
|
|
|
|
void init_reent();
|
|
|
|
void __attribute__((noreturn))
|
|
__thread_startup (int (*entry)(void*), void *param,
|
|
void *stacklow, void *stackhigh)
|
|
{
|
|
int retval;
|
|
|
|
__asm__ __volatile__( // save stack limits
|
|
"movl %0, %%fs:8 \n\t" // use TLS
|
|
"movl %1, %%fs:12 \n\t"
|
|
::"r"(stacklow), "r"(stackhigh));
|
|
|
|
init_reent(); // initialize thread reentry structure
|
|
|
|
retval = entry(param); // call user thread function
|
|
|
|
_exit(retval);
|
|
};
|
|
|