From 38229bcdcf45221857163f39d865d1d5d113a9b7 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 25 May 2006 02:33:13 +0000 Subject: * cygtls.cc (_cygtls::call): Call call2 using _my_tls. (_cygtls::init_exception_handler): Always replace existing exception handler with cygwin exception handler. * cygtls.h (_cygtls::call2): Remove static designation. * dcrto.cc (dll_crt0_1): Define in a way that allows calling via _cygtls::call. (_initialize_main_tls): Delete. (_dll_crt0): Call dll_crt0_1 via cygtls::call. Set _main_tls here. * external.cc (cygwin_internal): Implement CW_CYGTLS_PADSIZE. * include/sys/cygwin.h (CW_CYGTLS_PADSIZE): Define. * tlsoffsets.h: Regenerate. --- winsup/cygwin/cygtls.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'winsup/cygwin/cygtls.cc') diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc index 4f4fe06e2..d3a67565b 100644 --- a/winsup/cygwin/cygtls.cc +++ b/winsup/cygwin/cygtls.cc @@ -64,15 +64,15 @@ void _cygtls::call (DWORD (*func) (void *, void *), void *arg) { char buf[CYGTLS_PADSIZE]; - call2 (func, arg, buf); + _my_tls.call2 (func, arg, buf); } void _cygtls::call2 (DWORD (*func) (void *, void *), void *arg, void *buf) { - _my_tls.init_thread (buf, func); + init_thread (buf, func); DWORD res = func (arg, buf); - _my_tls.remove (INFINITE); + remove (INFINITE); ExitThread (res); } @@ -248,10 +248,7 @@ _cygtls::handle_threadlist_exception (EXCEPTION_RECORD *e, exception_list *frame return 0; } -/* Set up the exception handler for the current thread. The PowerPC & Mips - use compiler generated tables to set up the exception handlers for each - region of code, and the kernel walks the call list until it finds a region - of code that handles exceptions. The x86 on the other hand uses segment +/* Set up the exception handler for the current thread. The x86 uses segment register fs, offset 0 to point to the current exception handler. */ extern exception_list *_except_list asm ("%fs:0"); @@ -260,9 +257,7 @@ void _cygtls::init_exception_handler (exception_handler *eh) { el.handler = eh; - el.prev = _except_list; - if (!el.prev->prev && !el.prev->handler) - el.prev = ⪙ + el.prev = ⪙ _except_list = ⪙ } -- cgit v1.2.3