Rev 1120 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1120 | Rev 1129 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | #ifndef __LIBC__ia32THREAD_H__ |
29 | #ifndef __LIBC__ia32THREAD_H__ |
30 | #define __LIBC__ia32THREAD_H__ |
30 | #define __LIBC__ia32THREAD_H__ |
31 | 31 | ||
32 | #include <libc.h> |
32 | #include <libc.h> |
33 | 33 | ||
- | 34 | typedef struct { |
|
- | 35 | void *self; |
|
- | 36 | void *pst_data; |
|
- | 37 | } tcb_t; |
|
- | 38 | ||
34 | static inline void __tls_set(void *tls) |
39 | static inline void __tcb_set(tcb_t *tcb) |
35 | { |
40 | { |
36 | __SYSCALL1(SYS_TLS_SET, (sysarg_t) tls); |
41 | __SYSCALL1(SYS_TLS_SET, (sysarg_t) tcb); |
37 | } |
42 | } |
38 | 43 | ||
39 | static inline void * __tls_get(void) |
44 | static inline tcb_t * __tcb_get(void) |
40 | { |
45 | { |
41 | void * retval; |
46 | void * retval; |
42 | 47 | ||
43 | __asm__ ("movl %%gs:0, %0" : "=r"(retval)); |
48 | __asm__ ("movl %%gs:0, %0" : "=r"(retval)); |
44 | return retval; |
49 | return retval; |