clarify the purpose of this project
[nyanglibc.git] / nptl / cleanup_defer_compat.s
blob1cd03ca99e329f4eff5e406ccb5ed16acc9580ed
1 .text
2 .p2align 4,,15
3 .globl _pthread_cleanup_push_defer
4 .type _pthread_cleanup_push_defer, @function
5 _pthread_cleanup_push_defer:
6 movq %fs:16, %rcx
7 movq %rsi, (%rdi)
8 movq %rdx, 8(%rdi)
9 #APP
10 # 30 "cleanup_defer_compat.c" 1
11 movq %fs:760,%rax
12 # 0 "" 2
13 #NO_APP
14 movq %rax, 24(%rdi)
15 #APP
16 # 32 "cleanup_defer_compat.c" 1
17 movl %fs:776,%edx
18 # 0 "" 2
19 #NO_APP
20 addq $776, %rcx
21 testb $2, %dl
22 jne .L3
23 .L2:
24 sarl %edx
25 andl $1, %edx
26 movl %edx, 16(%rdi)
27 #APP
28 # 54 "cleanup_defer_compat.c" 1
29 movq %rdi,%fs:760
30 # 0 "" 2
31 #NO_APP
32 ret
33 .p2align 4,,10
34 .p2align 3
35 .L4:
36 movl %eax, %edx
37 .p2align 4,,10
38 .p2align 3
39 .L3:
40 movl %edx, %esi
41 movl %edx, %eax
42 andl $-3, %esi
43 lock cmpxchgl %esi, (%rcx)
44 cmpl %eax, %edx
45 je .L2
46 jmp .L4
47 .size _pthread_cleanup_push_defer, .-_pthread_cleanup_push_defer
48 .globl __pthread_cleanup_push_defer
49 .set __pthread_cleanup_push_defer,_pthread_cleanup_push_defer
50 .p2align 4,,15
51 .globl _pthread_cleanup_pop_restore
52 .type _pthread_cleanup_pop_restore, @function
53 _pthread_cleanup_pop_restore:
54 movq %rdi, %rdx
55 movq 24(%rdi), %rax
56 #APP
57 # 65 "cleanup_defer_compat.c" 1
58 movq %rax,%fs:760
59 # 0 "" 2
60 #NO_APP
61 movl 16(%rdi), %eax
62 testl %eax, %eax
63 jne .L17
64 .L10:
65 testl %esi, %esi
66 je .L9
67 movq 8(%rdx), %rdi
68 jmp *(%rdx)
69 .p2align 4,,10
70 .p2align 3
71 .L9:
72 rep ret
73 .p2align 4,,10
74 .p2align 3
75 .L17:
76 #APP
77 # 69 "cleanup_defer_compat.c" 1
78 movl %fs:776,%ecx
79 # 0 "" 2
80 #NO_APP
81 testb $2, %cl
82 jne .L10
83 movq %fs:16, %rax
84 leaq 776(%rax), %rdi
85 .L11:
86 movl %ecx, %r8d
87 movl %ecx, %eax
88 orl $2, %r8d
89 lock cmpxchgl %r8d, (%rdi)
90 cmpl %eax, %ecx
91 jne .L13
92 #APP
93 # 86 "cleanup_defer_compat.c" 1
94 movl %fs:776,%eax
95 # 0 "" 2
96 #NO_APP
97 andl $-71, %eax
98 cmpl $8, %eax
99 jne .L10
100 subq $8, %rsp
101 #APP
102 # 86 "cleanup_defer_compat.c" 1
103 movq $-1,%fs:1584
104 # 0 "" 2
105 #NO_APP
106 movq %fs:16, %rax
107 #APP
108 # 304 "pthreadP.h" 1
109 lock;orl $16, 776(%rax)
110 # 0 "" 2
111 # 307 "pthreadP.h" 1
112 movq %fs:768,%rdi
113 # 0 "" 2
114 #NO_APP
115 call __pthread_unwind@PLT
116 .p2align 4,,10
117 .p2align 3
118 .L13:
119 movl %eax, %ecx
120 jmp .L11
121 .size _pthread_cleanup_pop_restore, .-_pthread_cleanup_pop_restore
122 .globl __pthread_cleanup_pop_restore
123 .set __pthread_cleanup_pop_restore,_pthread_cleanup_pop_restore