* gendef (sigdelayed): Handle return here rather than going through sigbe to

ensure that flags are properly restored.
This commit is contained in:
Christopher Faylor 2004-03-05 19:09:04 +00:00
parent 71826fa7fa
commit f2afcfa616
2 changed files with 96 additions and 85 deletions

View File

@ -1,41 +1,41 @@
2004-03-05 Christopher Faylor <cgf@redhat.com>
* gendef (sigdelayed): Handle return here rather than going through
sigbe to ensure that flags are properly restored.
2004-03-04 Thomas Pfaff <tpfaff@gmx.net> 2004-03-04 Thomas Pfaff <tpfaff@gmx.net>
* include/pthread.h (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): * include/pthread.h (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): New
New define. define.
(PTHREAD_NORMAL_MUTEX_INITIALIZER_NP): Ditto. (PTHREAD_NORMAL_MUTEX_INITIALIZER_NP): Ditto.
(PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Ditto. (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Ditto.
* thread.cc (pthread_mutex::is_good_initializer): * thread.cc (pthread_mutex::is_good_initializer): Check for all
Check for all posssible initializers posssible initializers
(pthread_mutex::is_good_initializer_or_object): Ditto. (pthread_mutex::is_good_initializer_or_object): Ditto.
(pthread_mutex::is_good_initializer_or_bad_object): Ditto. (pthread_mutex::is_good_initializer_or_bad_object): Ditto.
(verifyable_object_isvalid): Support up to three static (verifyable_object_isvalid): Support up to three static initializers.
initializers.
(verifyable_object_isvalid (void const *,long)): Remove. (verifyable_object_isvalid (void const *,long)): Remove.
(pthread_cond::is_good_initializer_or_bad_object): Remove (pthread_cond::is_good_initializer_or_bad_object): Remove unneeded
unneeded objectState var. objectState var.
(pthread_cond::init): Condition remains unchanged when creation (pthread_cond::init): Condition remains unchanged when creation has
has failed. failed.
(pthread_rwlock::is_good_initializer_or_bad_object): Remove (pthread_rwlock::is_good_initializer_or_bad_object): Remove unneeded
unneeded objectState var. objectState var.
(pthread_rwlock::init): Rwlock remains unchanged when creation (pthread_rwlock::init): Rwlock remains unchanged when creation has
has failed. failed.
(pthread_mutex::init): Remove obsolete comment. (pthread_mutex::init): Remove obsolete comment. Mutex remains
Mutex remains unchanged when creation has failed. Add support unchanged when creation has failed. Add support for new initializers.
for new initializers. (pthread_mutex_getprioceiling): Do not create mutex, just return
(pthread_mutex_getprioceiling): Do not create mutex, ENOSYS.
just return ENOSYS.
(pthread_mutex_lock): Simplify. (pthread_mutex_lock): Simplify.
(pthread_mutex_trylock): Remove unneeded local themutex. (pthread_mutex_trylock): Remove unneeded local themutex.
(pthread_mutex_unlock): Just return EPERM if mutex is not (pthread_mutex_unlock): Just return EPERM if mutex is not initialized.
initialized. (pthread_mutex_setprioceiling): Do not create mutex, just return
(pthread_mutex_setprioceiling): Do not create mutex, ENOSYS.
just return ENOSYS. * thread.h (verifyable_object_isvalid): Support up to three static
* thread.h (verifyable_object_isvalid): Support up to three initializers.
static initializers. (verifyable_object_isvalid (void const *,long)): Remove prototype.
(verifyable_object_isvalid (void const *,long)): Remove (pthread_mutex::init): Add optional initializer to parameter list.
prototype.
(pthread_mutex::init): Add optional initializer to parameter
list.
2004-03-03 Christopher Faylor <cgf@redhat.com> 2004-03-03 Christopher Faylor <cgf@redhat.com>

View File

@ -87,7 +87,7 @@ EOF
$res = <<EOF . longjmp () . $res; $res = <<EOF . longjmp () . $res;
.text .text
.stabs "_sigfe:F(0,1)",36,0,0,__sigbe .stabs "_sigfe:F(0,1)",36,0,0,__sigfe
__sigfe: __sigfe:
pushl %ebx pushl %ebx
pushl %edx pushl %edx
@ -135,6 +135,72 @@ __sigbe:
popl %edx popl %edx
ret ret
.global _sigreturn
.stabs "sigreturn:F(0,1)",36,0,0,_sigreturn
_sigreturn:
addl \$4,%esp # Remove argument
call _set_process_mask\@4
1: movl %fs:4,%edx
movl \$1,%eax # potential lock value
lock xchgl %eax,$tls::stacklock(%edx) # see if we can grab it
movl %eax,$tls::spinning(%edx) # flag if we are waiting for lock
orl %eax,%eax # it will be zero
jz 2f # if so
xorl %eax,%eax # nope. not zero
call _low_priority_sleep # sleep
jmp 1b # and loop
2: popl %ebx # saved errno
testl %ebx,%ebx # Is it < 0
jl 3f # yup. ignore it
movl $tls::errno_addr(%edx),%eax
movl %ebx,(%eax)
3: movl \$-4,%eax # now decrement aux stack
xadd %eax,$tls::stackptr(%edx) # and get pointer
xorl %ebp,%ebp
xchgl %ebp,-4(%eax) # get return address from signal stack
xchgl %ebp,28(%esp) # store real return address
decl $tls::stacklock(%edx) # unlock
popl %eax
popl %ebx
popl %ecx
popl %edx
popl %edi
popl %esi
popf
ret
.global _sigdelayed
.stabs "sigdelayed:F(0,1)",36,0,0,_sigdelayed
_sigdelayed:
pushl %ebp
movl %esp,%ebp
pushf
pushl %esi
pushl %edi
pushl %edx
pushl %ecx
pushl %ebx
pushl %eax
movl %fs:4,%ebx
pushl $tls::saved_errno(%ebx) # saved errno
3: pushl $tls::oldmask(%ebx) # oldmask
pushl $tls::sig(%ebx) # signal argument
pushl \$_sigreturn
call _reset_signal_arrived\@0
pushl $tls::func(%ebx) # signal func
pushl $tls::newmask(%ebx) # newmask - eaten by set_process_mask
call _set_process_mask\@4
cmpl \$0,$tls::threadkill(%ebx)#pthread_kill signal?
jnz 4f #yes. Callee clears signal number
movl \$0,$tls::sig(%ebx) # zero the signal number as a
# flag to the signal handler thread
# that it is ok to set up sigsave
4: ret
.global __ZN7_cygtls3popEv .global __ZN7_cygtls3popEv
__ZN7_cygtls3popEv: __ZN7_cygtls3popEv:
1: pushl %ebx 1: pushl %ebx
@ -191,61 +257,6 @@ stabilize_sig_stack:
call __ZN7_cygtls19call_signal_handlerEv call __ZN7_cygtls19call_signal_handlerEv
jmp 1b jmp 1b
3: ret 3: ret
.global _sigreturn
.stabs "sigreturn:F(0,1)",36,0,0,_sigreturn
_sigreturn:
addl \$4,%esp # Remove argument
call _set_process_mask\@4
call stabilize_sig_stack
1: popl %ebx # saved errno
testl %ebx,%ebx # Is it < 0
jl 2f # yup. ignore it
movl $tls::errno_addr(%edx),%eax
movl %ebx,(%eax)
2: popl %eax
popl %ebx
popl %ecx
popl %edi
popl %esi
popf
decl $tls::stacklock(%edx) # relinquish lock
popl %edx
popl %ebp
jmp __sigbe
.global _sigdelayed
.stabs "sigdelayed:F(0,1)",36,0,0,_sigdelayed
_sigdelayed:
pushl %ebp
movl %esp,%ebp
pushl %edx
pushf
pushl %esi
pushl %edi
pushl %ecx
pushl %ebx
pushl %eax
movl %fs:4,%ebx
pushl $tls::saved_errno(%ebx) # saved errno
3: pushl $tls::oldmask(%ebx) # oldmask
pushl $tls::sig(%ebx) # signal argument
pushl \$_sigreturn
call _reset_signal_arrived\@0
pushl $tls::func(%ebx) # signal func
pushl $tls::newmask(%ebx) # newmask - eaten by set_process_mask
call _set_process_mask\@4
cmpl \$0,$tls::threadkill(%ebx)#pthread_kill signal?
jnz 4f #yes. Callee clears signal number
movl \$0,$tls::sig(%ebx) # zero the signal number as a
# flag to the signal handler thread
# that it is ok to set up sigsave
4: ret
EOF EOF
} }
return $res; return $res;