fix broken sigsetjmp on x86_64

This commit is contained in:
Rich Felker 2011-04-08 11:56:52 -04:00
parent 7168790763
commit 60685ecad1
1 changed files with 9 additions and 7 deletions

View File

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