about summary refs log tree commit diff
path: root/src/signal/x86_64/sigsetjmp.s
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-04-08 11:56:52 -0400
committerRich Felker <dalias@aerifal.cx>2011-04-08 11:56:52 -0400
commit60685ecad1c2398b4ab95fa7bf88c8336d914a6c (patch)
treebea9a736f8f38f6efc3fa9e0edf836021b8fa235 /src/signal/x86_64/sigsetjmp.s
parent7168790763cdeb794df52be6e3b39fbb021c5a64 (diff)
downloadmusl-60685ecad1c2398b4ab95fa7bf88c8336d914a6c.tar.gz
musl-60685ecad1c2398b4ab95fa7bf88c8336d914a6c.tar.xz
musl-60685ecad1c2398b4ab95fa7bf88c8336d914a6c.zip
fix broken sigsetjmp on x86_64
Diffstat (limited to 'src/signal/x86_64/sigsetjmp.s')
-rw-r--r--src/signal/x86_64/sigsetjmp.s16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/signal/x86_64/sigsetjmp.s b/src/signal/x86_64/sigsetjmp.s
index 0a450785..ac02adb2 100644
--- a/src/signal/x86_64/sigsetjmp.s
+++ b/src/signal/x86_64/sigsetjmp.s
@@ -1,11 +1,13 @@
 /* Copyright 2011 Nicholas J. Kain, licensed GNU LGPL 2.1 or later */
 .global sigsetjmp
 sigsetjmp:
-	test %rsi,%rsi
-	jz 1f              /* if save == 0, just goto setjmp */
-	movq %rsi,64(%rdi) /* move save -> jmp_buf[8] */
-	addq $72,%rdi      /* add sizeof(jmp_buf) to rdi */
-	movl $0,%esi       /* arg2 = 0 */
-	movl $2,%edx       /* arg3 = 2 */
-	call sigprocmask   /* sigprocmask(jmp_buf, 0, 2) */
+	andl %esi,%esi
+	movq %rsi,64(%rdi)
+	jz 1f
+	pushq %rdi
+	leaq 72(%rdi),%rsi
+	xorl %edx,%edx
+	movl $2,%edi
+	call sigprocmask
+	popq %rdi
 1:	jmp setjmp