Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-12-16 20:32:25 +0400
committerChristopher Faylor <me@cgf.cx>2011-12-16 20:32:25 +0400
commit56d06b9af37e33ebb03914c5452cb765352b4c03 (patch)
tree1d15b775d8a1237ddd871429619a4a2915edf45e /winsup/cygwin/gendef
parent6bd406f9ed9f5b397cdc47f7d5e0dc863322083c (diff)
* gendef (sigdelayed): Remember to pop all of the saved registers.
(sigreturn): Add "leave" label.
Diffstat (limited to 'winsup/cygwin/gendef')
-rwxr-xr-xwinsup/cygwin/gendef74
1 files changed, 37 insertions, 37 deletions
diff --git a/winsup/cygwin/gendef b/winsup/cygwin/gendef
index d20138ff7..a76711279 100755
--- a/winsup/cygwin/gendef
+++ b/winsup/cygwin/gendef
@@ -160,42 +160,6 @@ __sigbe: # return here after cygwin syscall
popl %ebx
ret
- .global _sigreturn
-_sigreturn:
- movl %fs:4,%ebx
- incl $tls::incyg(%ebx)
- addl \$12,%esp # remove arguments
- call _set_process_mask\@4
-
-1: movl \$1,%eax # potential lock value
- xchgl %eax,$tls::stacklock(%ebx) # see if we can grab it
- movl %eax,$tls::spinning(%ebx) # flag if we are waiting for lock
- testl %eax,%eax # it will be zero
- jz 2f # if so
- call _yield # sleep
- jmp 1b # and loop
-2: popl %edx # saved errno
- testl %edx,%edx # Is it < 0
- jl 3f # yup. ignore it
- movl $tls::errno_addr(%ebx),%eax
- movl %edx,(%eax)
-3: movl \$-4,%eax # now decrement aux stack
- xadd %eax,$tls::stackptr(%ebx) # 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::incyg(%ebx)
- decl $tls::stacklock(%ebx) # unlock
-
- popl %eax
- popl %ebx
- popl %ecx
- popl %edx
- popl %edi
- popl %esi
- popf
- ret
-
.global _sigdelayed
_sigdelayed:
pushl %ebp
@@ -223,7 +187,7 @@ _sigdelayed:
2: incl $tls::incyg(%ebx)
movl $tls::sig(%ebx),%eax
testl %eax,%eax
- jz 4f # call_signal_handler may have beat us
+ jz leave # call_signal_handler may have beat us
# to it
pushl $tls::saved_errno(%ebx) # saved errno
call _set_process_mask_delta
@@ -247,6 +211,42 @@ _sigdelayed:
decl $tls::stacklock(%ebx)
ret # return via signal handler
+ .global _sigreturn
+_sigreturn:
+ movl %fs:4,%ebx
+ incl $tls::incyg(%ebx)
+ addl \$12,%esp # remove arguments
+ call _set_process_mask\@4
+
+1: movl \$1,%eax # potential lock value
+ xchgl %eax,$tls::stacklock(%ebx) # see if we can grab it
+ movl %eax,$tls::spinning(%ebx) # flag if we are waiting for lock
+ testl %eax,%eax # it will be zero
+ jz 2f # if so
+ call _yield # sleep
+ jmp 1b # and loop
+2: popl %edx # saved errno
+ testl %edx,%edx # Is it < 0
+ jl 3f # yup. ignore it
+ movl $tls::errno_addr(%ebx),%eax
+ movl %edx,(%eax)
+3: movl \$-4,%eax # now decrement aux stack
+ xadd %eax,$tls::stackptr(%ebx) # and get pointer
+ xorl %ebp,%ebp
+ xchgl %ebp,-4(%eax) # get return address from signal stack
+ xchgl %ebp,28(%esp) # store real return address
+leave: decl $tls::incyg(%ebx)
+ decl $tls::stacklock(%ebx) # unlock
+
+ popl %eax
+ popl %ebx
+ popl %ecx
+ popl %edx
+ popl %edi
+ popl %esi
+ popf
+ ret
+
.global __ZN7_cygtls3popEv
__ZN7_cygtls3popEv:
1: pushl %ebx