--- src/sys/i386/include/Attic/tls.h 2005/05/11 15:50:14 1.5 +++ src/sys/i386/include/Attic/tls.h 2005/05/11 19:46:47 1.6 @@ -37,10 +37,20 @@ #include #include +/* + * NOTE: the tcb_{self,dtv,pthread,errno) fields must be declared + * in the structure in the specified order as assembly will access the + * fields with a hardwired offset. + * + * Outside of this file, the system call layer generation will hardwire + * the offset for tcb_errno. + */ struct tls_tcb { struct tls_tcb *tcb_self; /* pointer to self*/ void *tcb_dtv; /* Dynamic Thread Vector */ void *tcb_pthread; /* thread library's data*/ + int *tcb_errno_p; /* pointer to per-thread errno */ + void *tcb_unused[4]; }; struct tls_dtv { @@ -93,7 +103,12 @@ tls_set_tcb(struct tls_tcb *tcb) __asm __volatile("movl %0, %%gs" : : "r" (seg)); } -struct tls_tcb *_rtld_allocate_tls(struct tls_tcb *); +struct tls_tcb *_rtld_allocate_tls(void); +struct tls_tcb *_libc_allocate_tls(void); void _rtld_free_tls(struct tls_tcb *); +void _libc_free_tls(struct tls_tcb *); +void _rtld_call_init(void); +struct tls_tcb *_libc_init_tls(void); +struct tls_tcb *_init_tls(void); #endif /* !_MACHINE_TLS_H_ */