clarify the purpose of this project
[nyanglibc.git] / dirent / telldir.shared.s
blobd5d3f977568956bb3061cecfc59ab53fe538c15e
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 telldir
9 .type telldir, @function
10 telldir:
11 pushq %rbp
12 pushq %rbx
13 movq %rdi, %rbx
14 subq $8, %rsp
15 #APP
16 # 28 "../sysdeps/unix/sysv/linux/telldir.c" 1
17 movl %fs:24,%eax
18 # 0 "" 2
19 #NO_APP
20 testl %eax, %eax
21 leaq 4(%rdi), %rbp
22 jne .L2
23 movl $1, %edx
24 #APP
25 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
26 cmpxchgl %edx, 4(%rdi)
27 # 0 "" 2
28 #NO_APP
29 .L3:
30 movq 32(%rbx), %r8
31 #APP
32 # 30 "../sysdeps/unix/sysv/linux/telldir.c" 1
33 movl %fs:24,%eax
34 # 0 "" 2
35 #NO_APP
36 testl %eax, %eax
37 jne .L4
38 subl $1, 4(%rbx)
39 .L1:
40 addq $8, %rsp
41 movq %r8, %rax
42 popq %rbx
43 popq %rbp
44 ret
45 .p2align 4,,10
46 .p2align 3
47 .L2:
48 xorl %eax, %eax
49 movl $1, %edx
50 lock cmpxchgl %edx, 0(%rbp)
51 je .L3
52 movq %rbp, %rdi
53 call __lll_lock_wait_private
54 jmp .L3
55 .p2align 4,,10
56 .p2align 3
57 .L4:
58 xorl %eax, %eax
59 #APP
60 # 30 "../sysdeps/unix/sysv/linux/telldir.c" 1
61 xchgl %eax, 4(%rbx)
62 # 0 "" 2
63 #NO_APP
64 cmpl $1, %eax
65 jle .L1
66 xorl %r10d, %r10d
67 movl $1, %edx
68 movl $129, %esi
69 movq %rbp, %rdi
70 movl $202, %eax
71 #APP
72 # 30 "../sysdeps/unix/sysv/linux/telldir.c" 1
73 syscall
75 # 0 "" 2
76 #NO_APP
77 jmp .L1
78 .size telldir, .-telldir
79 .hidden __lll_lock_wait_private