aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-03-27 19:35:55 +0000
committerCorinna Vinschen <corinna@vinschen.de>2014-03-27 19:35:55 +0000
commit50b0a28824744cad81569fa5e4e5e63a07cca760 (patch)
tree2516d9385b3d1aae9868b4d5493db5bf76e84441 /winsup
parent31eade549dd5b829cb1c70fc384419f0c8930483 (diff)
downloadnewlib-50b0a28824744cad81569fa5e4e5e63a07cca760.zip
newlib-50b0a28824744cad81569fa5e4e5e63a07cca760.tar.gz
newlib-50b0a28824744cad81569fa5e4e5e63a07cca760.tar.bz2
* gendef (_sigbe/x86_64): Fix typo in .seh_proc pseudo-op.
(setjmp/x86_64): Drop storing ExceptionList pointer in jmp_buf->Frame. Drop comment. Store likely frame in rdx. Jump to __setjmpex. (__setjmpex): New function providing setjmp functionality. Fetch jmp_buf->Frame from rdx, like MSVCRT setjmpex. (__sjfault/x86_64): Store rdx content in jmp_buf->Frame. (__ljfault/x86_64): Don't restore ExceptionList pointer. (longjmp/x86_64): Ditto.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog11
-rwxr-xr-xwinsup/cygwin/gendef22
2 files changed, 23 insertions, 10 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index c61777c..188542a 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,14 @@
+2014-03-27 Corinna Vinschen <corinna@vinschen.de>
+
+ * gendef (_sigbe/x86_64): Fix typo in .seh_proc pseudo-op.
+ (setjmp/x86_64): Drop storing ExceptionList pointer in jmp_buf->Frame.
+ Drop comment. Store likely frame in rdx. Jump to __setjmpex.
+ (__setjmpex): New function providing setjmp functionality. Fetch
+ jmp_buf->Frame from rdx, like MSVCRT setjmpex.
+ (__sjfault/x86_64): Store rdx content in jmp_buf->Frame.
+ (__ljfault/x86_64): Don't restore ExceptionList pointer.
+ (longjmp/x86_64): Ditto.
+
2014-03-19 Christopher Faylor <me.cygwin2014@cgf.cx>
* fhandler_dsp.cc (fhandler_dev_dsp::ioctl): Actually pass ioctl
diff --git a/winsup/cygwin/gendef b/winsup/cygwin/gendef
index a7c036f..cef34a5 100755
--- a/winsup/cygwin/gendef
+++ b/winsup/cygwin/gendef
@@ -164,7 +164,7 @@ _sigfe: # stack is aligned on entry!
jmp *%rax # and jmp to it
.seh_endproc
- .seh_proc _sigfe
+ .seh_proc _sigbe
_sigbe: # return here after cygwin syscall
# stack is aligned on entry!
.seh_endprologue
@@ -589,10 +589,17 @@ sub longjmp {
.seh_proc setjmp
setjmp:
.seh_endprologue
- # We use the Windows jmp_buf layout. Store ExceptionList in Frame.
+ leaq 8(%rsp),%rdx
+ jmp __setjmpex
+ .seh_endproc
+
+ .globl __setjmpex
+ .seh_proc __setjmpex
+__setjmpex:
+ .seh_endprologue
+ # We use the Windows jmp_buf layout.
# Store alternative stackptr in Spare.
- movq %gs:0,%r10
- movq %r10,(%rcx)
+ movq %rdx,(%rcx)
movq %rbx,0x8(%rcx)
movq %rsp,0x10(%rcx)
movq %rbp,0x18(%rcx)
@@ -631,8 +638,7 @@ setjmp:
__sjfault:
.seh_endprologue
# Like setjmp, just w/o storing the alternate stackptr.
- movq %gs:0,%r10
- movq %r10,(%rcx)
+ movq %rdx,(%rcx)
movq %rbx,0x8(%rcx)
movq %rsp,0x10(%rcx)
movq %rbp,0x18(%rcx)
@@ -662,8 +668,6 @@ __sjfault:
.globl __ljfault
.seh_proc __ljfault
__ljfault:
- movq (%rcx),%r10
- movq %r10,%gs:0
movq 0x8(%rcx),%rbx
movq 0x10(%rcx),%rsp
movq 0x18(%rcx),%rbp
@@ -708,8 +712,6 @@ longjmp:
decl $tls::stacklock(%r11) # relinquish lock
xorl %r10d,%r10d
movl %r10d,$tls::incyg(%r11) # we're definitely not in cygwin anymore
- movq (%rcx),%r10
- movq %r10,%gs:0
movq 0x8(%rcx),%rbx
movq 0x10(%rcx),%rsp
movq 0x18(%rcx),%rbp