clarify the purpose of this project
[nyanglibc.git] / nptl / shm-directory.shared.s
bloba8d803e9bb2a3b9e702548911cbacd4f7476416c
1 .text
2 .section .rodata.str1.1,"aMS",@progbits,1
3 .LC0:
4 .string "r"
5 .LC1:
6 .string "/proc/mounts"
7 .LC2:
8 .string "/etc/fstab"
9 .LC3:
10 .string "tmpfs"
11 .LC4:
12 .string "shm"
13 .text
14 .p2align 4,,15
15 .type where_is_shmfs, @function
16 where_is_shmfs:
17 pushq %r15
18 pushq %r14
19 leaq defaultdir(%rip), %rdi
20 pushq %r13
21 pushq %r12
22 pushq %rbp
23 pushq %rbx
24 subq $712, %rsp
25 leaq 64(%rsp), %rbp
26 movq %rbp, %rsi
27 call __statfs@PLT
28 testl %eax, %eax
29 jne .L2
30 movq 64(%rsp), %rax
31 cmpq $16914836, %rax
32 je .L16
33 movl $2240043254, %edx
34 cmpq %rdx, %rax
35 je .L16
36 .L2:
37 leaq .LC0(%rip), %rsi
38 leaq .LC1(%rip), %rdi
39 call __setmntent@PLT
40 testq %rax, %rax
41 movq %rax, %rbx
42 je .L35
43 .L5:
44 leaq 192(%rsp), %r13
45 leaq 16(%rsp), %r12
46 leaq .LC3(%rip), %r14
47 .L12:
48 movl $512, %ecx
49 movq %r13, %rdx
50 movq %r12, %rsi
51 movq %rbx, %rdi
52 call __getmntent_r@PLT
53 testq %rax, %rax
54 movq %rax, %r15
55 je .L10
56 movq 16(%r15), %rax
57 movl $6, %ecx
58 movq %r14, %rdi
59 movq %rax, %rsi
60 repz cmpsb
61 je .L6
62 leaq .LC4(%rip), %rdi
63 movl $4, %ecx
64 movq %rax, %rsi
65 repz cmpsb
66 jne .L12
67 .L6:
68 movq 8(%r15), %rdi
69 movq %rbp, %rsi
70 call __statfs@PLT
71 testl %eax, %eax
72 jne .L12
73 movq 64(%rsp), %rax
74 cmpq $16914836, %rax
75 je .L17
76 movl $2240043254, %esi
77 cmpq %rsi, %rax
78 jne .L12
79 .L17:
80 movq 8(%r15), %r15
81 movq %r15, %rdi
82 call strlen@PLT
83 testq %rax, %rax
84 je .L12
85 leaq 2(%rax), %rdi
86 movq %rax, 8(%rsp)
87 call malloc@PLT
88 testq %rax, %rax
89 movq %rax, %rbp
90 movq %rax, mountpoint(%rip)
91 je .L10
92 movq 8(%rsp), %rdx
93 movq %r15, %rsi
94 movq %rax, %rdi
95 call __mempcpy@PLT
96 cmpb $47, -1(%rax)
97 je .L11
98 movb $47, (%rax)
99 addq $1, %rax
100 .L11:
101 movb $0, (%rax)
102 subq %rbp, %rax
103 movq %rax, 8+mountpoint(%rip)
104 .L10:
105 movq %rbx, %rdi
106 call __endmntent@PLT
107 .L1:
108 addq $712, %rsp
109 popq %rbx
110 popq %rbp
111 popq %r12
112 popq %r13
113 popq %r14
114 popq %r15
116 .p2align 4,,10
117 .p2align 3
118 .L16:
119 leaq defaultdir(%rip), %rax
120 movq $9, 8+mountpoint(%rip)
121 movq %rax, mountpoint(%rip)
122 jmp .L1
123 .p2align 4,,10
124 .p2align 3
125 .L35:
126 leaq .LC0(%rip), %rsi
127 leaq .LC2(%rip), %rdi
128 call __setmntent@PLT
129 testq %rax, %rax
130 movq %rax, %rbx
131 jne .L5
132 jmp .L1
133 .size where_is_shmfs, .-where_is_shmfs
134 .p2align 4,,15
135 .globl __GI___shm_directory
136 .hidden __GI___shm_directory
137 .type __GI___shm_directory, @function
138 __GI___shm_directory:
139 pushq %rbx
140 leaq where_is_shmfs(%rip), %rsi
141 movq %rdi, %rbx
142 leaq once(%rip), %rdi
143 call __GI___pthread_once@PLT
144 movq mountpoint(%rip), %rax
145 testq %rax, %rax
146 je .L40
147 movq 8+mountpoint(%rip), %rdx
148 movq %rdx, (%rbx)
149 popq %rbx
151 .p2align 4,,10
152 .p2align 3
153 .L40:
154 movq errno@gottpoff(%rip), %rdx
155 movl $38, %fs:(%rdx)
156 popq %rbx
158 .size __GI___shm_directory, .-__GI___shm_directory
159 .globl __shm_directory
160 .set __shm_directory,__GI___shm_directory
161 .p2align 4,,15
162 .globl __shm_directory_freeres
163 .hidden __shm_directory_freeres
164 .type __shm_directory_freeres, @function
165 __shm_directory_freeres:
166 movq mountpoint(%rip), %rdi
167 leaq defaultdir(%rip), %rax
168 cmpq %rax, %rdi
169 je .L41
170 jmp free@PLT
171 .p2align 4,,10
172 .p2align 3
173 .L41:
174 rep ret
175 .size __shm_directory_freeres, .-__shm_directory_freeres
176 .local once
177 .comm once,4,4
178 .section .rodata.str1.8,"aMS",@progbits,1
179 .align 8
180 .type defaultdir, @object
181 .size defaultdir, 10
182 defaultdir:
183 .string "/dev/shm/"
184 .local mountpoint
185 .comm mountpoint,16,16
186 .weak __GI___pthread_once