summaryrefslogtreecommitdiff
path: root/src/signal/x86_64/sigsetjmp.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/signal/x86_64/sigsetjmp.s')
-rw-r--r--src/signal/x86_64/sigsetjmp.s11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/signal/x86_64/sigsetjmp.s b/src/signal/x86_64/sigsetjmp.s
new file mode 100644
index 00000000..0a450785
--- /dev/null
+++ b/src/signal/x86_64/sigsetjmp.s
@@ -0,0 +1,11 @@
+/* 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) */
+1: jmp setjmp