clarify the purpose of this project
[nyanglibc.git] / posix / getcpu.s
blob428a7fd8f38ecfa7a8a95aa4e4699d9b0fc4b056
1 .text
2 .p2align 4,,15
3 .globl __getcpu
4 .hidden __getcpu
5 .type __getcpu, @function
6 __getcpu:
7 pushq %rbp
8 pushq %rbx
9 movq %rsi, %rbp
10 movq %rdi, %rbx
11 subq $8, %rsp
12 movq _dl_vdso_getcpu(%rip), %rax
13 testq %rax, %rax
14 je .L6
15 xorl %edx, %edx
16 call *%rax
17 movslq %eax, %rdx
18 cmpq $-4096, %rdx
19 jbe .L1
20 cmpq $-38, %rdx
21 je .L6
22 .L3:
23 movq __libc_errno@gottpoff(%rip), %rax
24 negl %edx
25 movl %edx, %fs:(%rax)
26 movl $-1, %eax
27 .L5:
28 .L1:
29 addq $8, %rsp
30 popq %rbx
31 popq %rbp
32 ret
33 .p2align 4,,10
34 .p2align 3
35 .L6:
36 xorl %edx, %edx
37 movq %rbp, %rsi
38 movq %rbx, %rdi
39 movl $309, %eax
40 #APP
41 # 27 "../sysdeps/unix/sysv/linux/getcpu.c" 1
42 syscall
44 # 0 "" 2
45 #NO_APP
46 cmpq $-4096, %rax
47 movq %rax, %rdx
48 ja .L3
49 jmp .L1
50 .size __getcpu, .-__getcpu
51 .weak getcpu
52 .set getcpu,__getcpu