clarify the purpose of this project
[nyanglibc.git] / signal / sigstack.s
bloba4c226fa74f0e6af8fd56175e079d70e6fd9b7cb
1 .text
2 #APP
3 .section .gnu.warning.sigstack
4 .previous
5 #NO_APP
6 .p2align 4,,15
7 .globl sigstack
8 .type sigstack, @function
9 sigstack:
10 pushq %rbx
11 movq %rsi, %rbx
12 movq %rdi, %rax
13 movl $0, %edx
14 subq $64, %rsp
15 testq %rbx, %rbx
16 leaq 32(%rsp), %rsi
17 cmove %rdx, %rsi
18 xorl %edi, %edi
19 testq %rax, %rax
20 je .L3
21 movq (%rax), %rdx
22 movl 8(%rax), %eax
23 movq %rsp, %rdi
24 testl %eax, %eax
25 movq %rdx, (%rsp)
26 movq %rdx, 16(%rsp)
27 setne %al
28 movzbl %al, %eax
29 movl %eax, 8(%rsp)
30 .L3:
31 call __sigaltstack
32 testl %eax, %eax
33 jne .L1
34 testq %rbx, %rbx
35 je .L1
36 movq 32(%rsp), %rdx
37 movq %rdx, (%rbx)
38 movl 40(%rsp), %edx
39 andl $1, %edx
40 movl %edx, 8(%rbx)
41 .L1:
42 addq $64, %rsp
43 popq %rbx
44 ret
45 .size sigstack, .-sigstack
46 .section .gnu.warning.sigstack
47 #,"a",@progbits
48 .align 32
49 .type __evoke_link_warning_sigstack, @object
50 .size __evoke_link_warning_sigstack, 77
51 __evoke_link_warning_sigstack:
52 .string "the `sigstack' function is dangerous. `sigaltstack' should be used instead."
53 .hidden __sigaltstack