diff options
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 9 | ||||
-rw-r--r-- | winsup/cygwin/cygtls.h | 4 | ||||
-rw-r--r-- | winsup/cygwin/exceptions.cc | 4 | ||||
-rwxr-xr-x | winsup/cygwin/gendef | 69 |
4 files changed, 82 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index a1321c57d..5886f06b4 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,14 @@ 2005-08-28 Christopher Faylor <cgf@timesys.com> + * cygtls.h (__ljfault): Declare. + (_cygtls::return_from_fault): Use __ljfault. + * exceptions.cc (set_signal_mask): Revert previous checkin. + * gendef (__sjfault): Split out into a separate function which doesn't + bother with any special signal locking. routines. + (_ljfault): Return from a __sjfault without bothering with signals. + +2005-08-28 Christopher Faylor <cgf@timesys.com> + * cygtls.h (_local_storage::strerror_buf): Allocate more space. * errno.cc (strerror_worker): New function, adapted from strerror. (strerror): Use strerror_worker. diff --git a/winsup/cygwin/cygtls.h b/winsup/cygwin/cygtls.h index 777031cd1..627531849 100644 --- a/winsup/cygwin/cygtls.h +++ b/winsup/cygwin/cygtls.h @@ -148,6 +148,8 @@ typedef struct struct_waitq #include "cygerrno.h" extern "C" int __sjfault (jmp_buf); +extern "C" int __ljfault (jmp_buf, int); + /*gentls_offsets*/ typedef __uint32_t __stack_t; @@ -223,7 +225,7 @@ struct _cygtls { if (_myfault_errno) set_errno (_myfault_errno); - longjmp ((int *) _myfault, 1); + __ljfault ((int *) _myfault, 1); } int setup_fault (jmp_buf j, int myerrno) __attribute__ ((always_inline)) { diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 98539d41d..eaad588bd 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -978,17 +978,19 @@ set_process_mask_delta () extern "C" void __stdcall set_signal_mask (sigset_t newmask, sigset_t& oldmask) { + if (GetCurrentThreadId () == sigtid) + small_printf ("********* waiting in signal thread\n"); mask_sync.acquire (INFINITE); newmask &= ~SIG_NONMASKABLE; sigset_t mask_bits = oldmask & ~newmask; sigproc_printf ("oldmask %p, newmask %p, mask_bits %p", oldmask, newmask, mask_bits); oldmask = newmask; - mask_sync.release (); if (mask_bits) sig_dispatch_pending (true); else sigproc_printf ("not calling sig_dispatch_pending"); + mask_sync.release (); return; } diff --git a/winsup/cygwin/gendef b/winsup/cygwin/gendef index 9d8a211e6..e743ebcfc 100755 --- a/winsup/cygwin/gendef +++ b/winsup/cygwin/gendef @@ -272,9 +272,8 @@ EOF sub longjmp { return <<EOF; - .globl _setjmp, ___sjfault + .globl _setjmp _setjmp: -___sjfault: pushl %ebp movl %esp,%ebp pushl %edi @@ -312,6 +311,72 @@ ___sjfault: leave ret + .globl ___sjfault +___sjfault: + pushl %ebp + movl %esp,%ebp + pushl %edi + movl 8(%ebp),%edi + movl %eax,0(%edi) + movl %ebx,4(%edi) + movl %ecx,8(%edi) + movl %edx,12(%edi) + movl %esi,16(%edi) + movl -4(%ebp),%eax + movl %eax,20(%edi) + movl 0(%ebp),%eax + movl %eax,24(%edi) + movl %esp,%eax + addl \$12,%eax + movl %eax,28(%edi) + movl 4(%ebp),%eax + movl %eax,32(%edi) + movw %es,%ax + movw %ax,36(%edi) + movw %fs,%ax + movw %ax,38(%edi) + movw %gs,%ax + movw %ax,40(%edi) + movw %ss,%ax + movw %ax,42(%edi) + popl %edi + movl \$0,%eax + leave + ret + + .global ___ljfault +___ljfault: + pushl %ebp + movl %esp,%ebp + movl 8(%ebp),%edi + + movl 12(%ebp),%eax + testl %eax,%eax + jne 0f + incl %eax + +0: movl %eax,0(%edi) + movl 24(%edi),%ebp + pushfl + popl %ebx + movw 42(%edi),%ax + movw %ax,%ss + movl 28(%edi),%esp + pushl 32(%edi) + pushl %ebx + movw 36(%edi),%ax + movw %ax,%es + movw 40(%edi),%ax + movw %ax,%gs + movl 0(%edi),%eax + movl 4(%edi),%ebx + movl 8(%edi),%ecx + movl 16(%edi),%esi + movl 12(%edi),%edx + movl 20(%edi),%edi + popfl + ret + .globl _longjmp _longjmp: pushl %ebp |