clarify the purpose of this project
[nyanglibc.git] / time / clock_nanosleep.s
blobdcbde4a0f23ee688f860207e1cffe8b67debfd3a
1 .text
2 .p2align 4,,15
3 .globl __clock_nanosleep
4 .hidden __clock_nanosleep
5 .type __clock_nanosleep, @function
6 __clock_nanosleep:
7 cmpl $3, %edi
8 je .L6
9 cmpl $2, %edi
10 movl $-6, %eax
11 movq %rcx, %r10
12 cmove %eax, %edi
13 #APP
14 # 43 "../sysdeps/unix/sysv/linux/clock_nanosleep.c" 1
15 movl %fs:24,%eax
16 # 0 "" 2
17 #NO_APP
18 testl %eax, %eax
19 jne .L14
20 movl $230, %eax
21 #APP
22 # 43 "../sysdeps/unix/sysv/linux/clock_nanosleep.c" 1
23 syscall
25 # 0 "" 2
26 #NO_APP
27 negl %eax
28 ret
29 .p2align 4,,10
30 .p2align 3
31 .L6:
32 movl $22, %eax
33 ret
34 .p2align 4,,10
35 .p2align 3
36 .L14:
37 subq $40, %rsp
38 movq %rdx, 16(%rsp)
39 movl %esi, 12(%rsp)
40 movl %edi, (%rsp)
41 movq %rcx, 24(%rsp)
42 call __libc_enable_asynccancel
43 movq 24(%rsp), %r10
44 movl %eax, %r8d
45 movq 16(%rsp), %rdx
46 movl 12(%rsp), %esi
47 movl (%rsp), %edi
48 movl $230, %eax
49 #APP
50 # 43 "../sysdeps/unix/sysv/linux/clock_nanosleep.c" 1
51 syscall
53 # 0 "" 2
54 #NO_APP
55 movl %r8d, %edi
56 movq %rax, (%rsp)
57 call __libc_disable_asynccancel
58 movq (%rsp), %rax
59 addq $40, %rsp
60 negl %eax
61 ret
62 .size __clock_nanosleep, .-__clock_nanosleep
63 .weak clock_nanosleep
64 .set clock_nanosleep,__clock_nanosleep
65 .hidden __libc_disable_asynccancel
66 .hidden __libc_enable_asynccancel