diff options
author | Christopher Faylor <me@cgf.cx> | 2004-02-08 19:59:27 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2004-02-08 19:59:27 +0000 |
commit | 6946073e784471e1fc51fffd705b0cbc4d58e730 (patch) | |
tree | 76e1a45c0d78871721c0c1c807bc89e343cd1454 /winsup/cygwin/gendef | |
parent | f5133f95b085c4fbe92fc5ca8fee9d5016257e4e (diff) | |
download | newlib-6946073e784471e1fc51fffd705b0cbc4d58e730.zip newlib-6946073e784471e1fc51fffd705b0cbc4d58e730.tar.gz newlib-6946073e784471e1fc51fffd705b0cbc4d58e730.tar.bz2 |
* localtime.cc (localtime_r): Call tzset.
* Makefile.in: Make version.h/cygwin.din version check a warning since it is
not foolproof.
* cygheap.h (CYGHEAPSIZE): Bump size down.
* cygtls.h (_threadinfo::stacklock): New element.
(_threadinfo::pop): Make regparm.
(_threadinfo::lock): New function.
(_threadinfo::unlock): New function.
* cygtls.cc (_threadinfo::push): Wait for a lock on the stack before performing
the operation.
(_threadinfo::pop): Move to another file.
* cygwin.din: More SIGFE changes.
* exceptions.cc (try_to_debug): Always display messages on console.
(handle_exceptions): Unwind stack only when actually about to call sig_send.
(setup_handler): Lock stack prior to performing any operations.
* gendef (_sigfe): Ditto.
(_sigbe): Ditto.
(_threadinfo::pop): Ditto. Move here.
* gen_tlsoffsets: Generate positive offsets.
* tlsoffsets.h: Regenerate.
Diffstat (limited to 'winsup/cygwin/gendef')
-rwxr-xr-x | winsup/cygwin/gendef | 78 |
1 files changed, 59 insertions, 19 deletions
diff --git a/winsup/cygwin/gendef b/winsup/cygwin/gendef index d317eea..2457314 100755 --- a/winsup/cygwin/gendef +++ b/winsup/cygwin/gendef @@ -88,40 +88,79 @@ EOF if (!$main::first++) { $res = <<EOF . longjmp () . $res; .text - .global __sigbe - .global _sigreturn - .global _sigdelayed .stabs "_sigfe:F(0,1)",36,0,0,__sigbe __sigfe: pushl %edx - movl %fs:4,%eax - movl \$4,%edx - xadd %edx,$tls::stackptr(%eax) - leal __sigbe,%eax - xchg %eax,8(%esp) - movl %eax,(%edx) + movl %fs:4,%edx +1: movl \$1,%eax + lock cmpxchg %eax,$tls::stacklock(%edx) + jne 2f + xorl %eax,%eax + call _low_priority_sleep + jmp 1b +2: movl \$4,%eax + xadd %eax,$tls::stackptr(%edx) + decl $tls::stacklock(%edx) + leal __sigbe,%edx + xchg %edx,8(%esp) + movl %edx,(%eax) popl %edx ret + .global __sigbe .stabs "_sigbe:F(0,1)",36,0,0,__sigbe __sigbe: - pushl %eax pushl %edx - movl \$-4,%edx -1: movl %fs:4,%eax - xadd %edx,$tls::stackptr(%eax) + pushl %eax + movl %fs:4,%edx +1: movl \$1,%eax + lock cmpxchg %eax,$tls::stacklock(%edx) + jne 2f xorl %eax,%eax - lock xchg %eax,-4(%edx) - testl %eax,%eax - jnz 2f call _low_priority_sleep - xorl %edx,%edx jmp 1b -2: xchg %eax,4(%esp) - popl %edx +2: movl \$-4,%eax + xadd %eax,$tls::stackptr(%edx) + xchg %edx,-4(%eax) + xchg %edx,4(%esp) + popl %eax + ret + + .global __ZN11_threadinfo3popEv +__ZN11_threadinfo3popEv: +1: pushl %ebx + movl %eax,%edx + movl \$-4,%ebx + xadd %ebx,$tls::pstackptr(%edx) + xorl %eax,%eax + xchg %eax,-4(%ebx) + decl $tls::pstacklock(%edx) + popl %ebx + ret + + .global __ZN11_threadinfo4lockEi +__ZN11_threadinfo4lockEi: + pushl %ebx + movl %eax,%ebx +1: movl \$1,%eax + lock cmpxchg %eax,$tls::pstacklock(%ebx) + jne 2f + cmpl %edx,%edx + jz 2f + xorl %eax,%eax + call _low_priority_sleep + jmp 1b +2: xorl \$1,%eax + popl %ebx ret + .global __ZN11_threadinfo6unlockEv +__ZN11_threadinfo6unlockEv: + decl $tls::pstacklock(%eax) + ret + + .global _sigreturn .stabs "sigreturn:F(0,1)",36,0,0,_sigreturn _sigreturn: addl \$4,%esp # Remove argument @@ -147,6 +186,7 @@ _sigreturn: popl %ebp jmp __sigbe + .global _sigdelayed .stabs "sigdelayed:F(0,1)",36,0,0,_sigdelayed _sigdelayed: pushl %ebp |