Rev 6068 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | #include |
2 | |||
3 | void init_reent(); |
||
4 | |||
6068 | serge | 5 | void _exit(int __status) __attribute__((noreturn)); |
6 | |||
4349 | Serge | 7 | void __attribute__((noreturn)) |
8 | __thread_startup (int (*entry)(void*), void *param, |
||
9 | void *stacklow, void *stackhigh) |
||
10 | { |
||
11 | int retval; |
||
12 | |||
13 | __asm__ __volatile__( // save stack limits |
||
14 | "movl %0, %%fs:8 \n\t" // use TLS |
||
6536 | serge | 15 | "movl %1, %%fs:12 \n\t" |
4349 | Serge | 16 | ::"r"(stacklow), "r"(stackhigh)); |
17 | |||
18 | init_reent(); // initialize thread reentry structure |
||
19 | |||
20 | retval = entry(param); // call user thread function |
||
21 | |||
22 | _exit(retval); |
||
23 | }; |
||
24 |