clarify the purpose of this project
[nyanglibc.git] / stdlib / abort.shared.s
blobdcb870b6c1dc26e16213a603c0c2dac2182a6a41
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .globl __GI_abort
9 .hidden __GI_abort
10 .type __GI_abort, @function
11 __GI_abort:
12 pushq %rbx
13 subq $288, %rsp
14 movq %fs:16, %rbx
15 cmpq %rbx, 8+lock(%rip)
16 je .L2
17 #APP
18 # 54 "abort.c" 1
19 movl %fs:24,%eax
20 # 0 "" 2
21 #NO_APP
22 testl %eax, %eax
23 jne .L3
24 movl $1, %edx
25 #APP
26 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
27 cmpxchgl %edx, lock(%rip)
28 # 0 "" 2
29 #NO_APP
30 .L4:
31 movq %rbx, 8+lock(%rip)
32 .L2:
33 movl stage(%rip), %eax
34 addl $1, 4+lock(%rip)
35 testl %eax, %eax
36 je .L22
37 .L5:
38 cmpl $1, %eax
39 je .L23
40 cmpl $2, %eax
41 je .L14
42 .L15:
43 cmpl $3, %eax
44 je .L24
45 .L16:
46 cmpl $4, %eax
47 je .L25
48 .L17:
49 cmpl $5, %eax
50 je .L26
51 .p2align 4,,10
52 .p2align 3
53 .L18:
54 #APP
55 # 121 "abort.c" 1
56 hlt
57 # 0 "" 2
58 #NO_APP
59 jmp .L18
60 .L3:
61 xorl %eax, %eax
62 movl $1, %edx
63 lock cmpxchgl %edx, lock(%rip)
64 je .L4
65 leaq lock(%rip), %rdi
66 call __lll_lock_wait_private
67 jmp .L4
68 .L26:
69 movl $127, %edi
70 movl $6, stage(%rip)
71 call __GI__exit
72 .L25:
73 movl $5, stage(%rip)
74 #APP
75 # 107 "abort.c" 1
76 hlt
77 # 0 "" 2
78 #NO_APP
79 movl stage(%rip), %eax
80 jmp .L17
81 .L24:
82 movl $6, %edi
83 movl $4, stage(%rip)
84 call __GI_raise
85 movl stage(%rip), %eax
86 jmp .L16
87 .L23:
88 movl 4+lock(%rip), %eax
89 movl $0, stage(%rip)
90 subl $1, %eax
91 testl %eax, %eax
92 movl %eax, 4+lock(%rip)
93 jne .L8
94 movq $0, 8+lock(%rip)
95 #APP
96 # 77 "abort.c" 1
97 movl %fs:24,%edx
98 # 0 "" 2
99 #NO_APP
100 testl %edx, %edx
101 jne .L9
102 subl $1, lock(%rip)
103 .L8:
104 movl $6, %edi
105 call __GI_raise
106 movq %fs:16, %rbx
107 cmpq %rbx, 8+lock(%rip)
108 je .L11
109 #APP
110 # 81 "abort.c" 1
111 movl %fs:24,%eax
112 # 0 "" 2
113 #NO_APP
114 testl %eax, %eax
115 jne .L12
116 movl $1, %edx
117 #APP
118 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
119 cmpxchgl %edx, lock(%rip)
120 # 0 "" 2
121 #NO_APP
122 .L13:
123 movq %rbx, 8+lock(%rip)
124 .L11:
125 addl $1, 4+lock(%rip)
126 .L14:
127 leaq 128(%rsp), %rsi
128 xorl %eax, %eax
129 movl $38, %ecx
130 xorl %edx, %edx
131 movl $3, stage(%rip)
132 movq %rsi, %rdi
133 rep stosl
134 movl $6, %edi
135 movq $-1, 136(%rsp)
136 call __GI___sigaction
137 movl stage(%rip), %eax
138 jmp .L15
139 .L12:
140 xorl %eax, %eax
141 movl $1, %edx
142 lock cmpxchgl %edx, lock(%rip)
143 je .L13
144 leaq lock(%rip), %rdi
145 call __lll_lock_wait_private
146 jmp .L13
147 .L22:
148 movq %rsp, %rsi
149 xorl %edx, %edx
150 movl $1, %edi
151 movl $1, stage(%rip)
152 movq $32, (%rsp)
153 call __GI___sigprocmask
154 movl stage(%rip), %eax
155 jmp .L5
156 .L9:
157 #APP
158 # 77 "abort.c" 1
159 xchgl %eax, lock(%rip)
160 # 0 "" 2
161 #NO_APP
162 subl $1, %eax
163 jle .L8
164 xorl %r10d, %r10d
165 movl $1, %edx
166 movl $129, %esi
167 leaq lock(%rip), %rdi
168 movl $202, %eax
169 #APP
170 # 77 "abort.c" 1
171 syscall
173 # 0 "" 2
174 #NO_APP
175 jmp .L8
176 .size __GI_abort, .-__GI_abort
177 .globl abort
178 .set abort,__GI_abort
179 .local lock
180 .comm lock,16,16
181 .local stage
182 .comm stage,4,4
183 .hidden __GI___abort_msg
184 .globl __GI___abort_msg
185 .bss
186 .align 8
187 .type __GI___abort_msg, @object
188 .size __GI___abort_msg, 8
189 __GI___abort_msg:
190 .zero 8
191 .globl __abort_msg
192 .set __abort_msg,__GI___abort_msg
193 .hidden __lll_lock_wait_private