diff options
author | Christopher Faylor <me@cgf.cx> | 2006-05-16 07:14:24 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-05-16 07:14:24 +0400 |
commit | 562adf789066f0bbcd2999944a2648b42e8e8df9 (patch) | |
tree | 4f94240c4750774b1d4c0ac8dab6e5766e19859d /winsup/cygwin/cygtls.h | |
parent | a9e36321fda82e1f565f2291a2fc4eaf97de4fc6 (diff) |
* sigproc.cc (no_signals_available): Detect hwait_sig == INVALID_HANDLE_VALUE.
(wait_sig): Set hwait_sig to INVALID_HANDLE_VALUE on __SIGEXIT.
* cygtls.cc (_cygtls::init_thread): Zero entire _my_tls structure and no more.
* cygtls.h (_my_tls::padding): Delete.
(CYGTLS_PADSIZE): Redefine concept of padding to mean padding at the end of the
stack.
* dcrt0.cc (initialize_main_tls): Change return to void.
* gentls_offsets: Treat const specially, too. Keep going after a '}' is found.
Change negative offset calculation to use CYGTLS_PADSIZE.
* init.cc (_my_oldfunc): New variable.
(threadfunc_fe): Use stored tls value for oldfunc rather than blindly writing
to the stack.
(munge_threadfunc): Set oldfunc in tls.
(dll_entry): Initialize tls allocation.
* tlsoffsets.h: Regenerate.
Diffstat (limited to 'winsup/cygwin/cygtls.h')
-rw-r--r-- | winsup/cygwin/cygtls.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/winsup/cygwin/cygtls.h b/winsup/cygwin/cygtls.h index 030680be0..fb34df2d7 100644 --- a/winsup/cygwin/cygtls.h +++ b/winsup/cygwin/cygtls.h @@ -170,7 +170,6 @@ struct _cygtls __stack_t *stackptr; __stack_t stack[TLS_STACK_SIZE]; unsigned initialized; - unsigned padding[0]; /*gentls_offsets*/ static CRITICAL_SECTION protect_linked_list; @@ -235,13 +234,15 @@ struct _cygtls }; #pragma pack(pop) +const int CYGTLS_PADSIZE = 3 * sizeof (_cygtls); +/*gentls_offsets*/ + extern char *_tlsbase __asm__ ("%fs:4"); extern char *_tlstop __asm__ ("%fs:8"); -#define _my_tls (((_cygtls *) _tlsbase)[-1]) +#define _my_tls (*((_cygtls *) (_tlsbase - CYGTLS_PADSIZE))) extern _cygtls *_main_tls; extern _cygtls *_sig_tls; -/*gentls_offsets*/ class myfault { jmp_buf buf; @@ -253,9 +254,7 @@ public: return _my_tls.setup_fault (buf, sebastian, myerrno); } }; -/*gentls_offsets*/ #define __getreent() (&_my_tls.local_clib) -const int CYGTLS_PADSIZE = (((char *) _main_tls->padding) - ((char *) _main_tls)); -#endif /*_CYGTLS_H*/ +#endif /*_CYGTLS_H*/ /*gentls_offsets*/ |