clarify the purpose of this project
[nyanglibc.git] / nptl / pthread_rwlock_tryrdlock.shared.s
blob09911db34f7a7afa7947fec62233a7d494f08534
1 .text
2 .section .rodata.str1.8,"aMS",@progbits,1
3 .align 8
4 .LC0:
5 .string "The futex facility returned an unexpected error code.\n"
6 .text
7 .p2align 4,,15
8 .globl __pthread_rwlock_tryrdlock
9 .type __pthread_rwlock_tryrdlock, @function
10 __pthread_rwlock_tryrdlock:
11 movl (%rdi), %eax
12 .L6:
13 movl %eax, %edx
14 andl $2, %edx
15 testb $1, %al
16 jne .L2
17 testl %edx, %edx
18 je .L3
19 cmpl $2, 48(%rdi)
20 je .L12
21 .L3:
22 leal 8(%rax), %edx
23 jmp .L5
24 .p2align 4,,10
25 .p2align 3
26 .L2:
27 testl %edx, %edx
28 jne .L12
29 leal 8(%rax), %edx
30 xorl $1, %edx
31 .L5:
32 testl %edx, %edx
33 js .L13
34 lock cmpxchgl %edx, (%rdi)
35 jne .L6
36 testb $1, %al
37 jne .L7
38 .L15:
39 xorl %eax, %eax
40 ret
41 .p2align 4,,10
42 .p2align 3
43 .L7:
44 leaq 8(%rdi), %rcx
45 xorl %eax, %eax
46 xchgl (%rcx), %eax
47 testb $2, %al
48 je .L15
49 cmpl $1, 28(%rdi)
50 movl $2147483647, %edx
51 movq %rcx, %rdi
52 movl $202, %eax
53 sbbl %esi, %esi
54 xorl %r10d, %r10d
55 andl $128, %esi
56 addl $1, %esi
57 #APP
58 # 209 "../sysdeps/nptl/futex-internal.h" 1
59 syscall
61 # 0 "" 2
62 #NO_APP
63 cmpq $-4096, %rax
64 jbe .L15
65 cmpl $-22, %eax
66 je .L15
67 cmpl $-14, %eax
68 je .L15
69 leaq .LC0(%rip), %rdi
70 subq $8, %rsp
71 call __libc_fatal@PLT
72 .p2align 4,,10
73 .p2align 3
74 .L12:
75 movl $16, %eax
76 ret
77 .p2align 4,,10
78 .p2align 3
79 .L13:
80 movl $11, %eax
81 ret
82 .size __pthread_rwlock_tryrdlock, .-__pthread_rwlock_tryrdlock
83 .globl pthread_rwlock_tryrdlock
84 .set pthread_rwlock_tryrdlock,__pthread_rwlock_tryrdlock