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