* 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.
This commit is contained in:
Christopher Faylor
2004-02-08 19:59:27 +00:00
parent f5133f95b0
commit 6946073e78
11 changed files with 214 additions and 100 deletions

View File

@@ -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