clarify the purpose of this project
[nyanglibc.git] / resource / ulimit.shared.s
blobbdc4908de51f96e16d7ad6dab6ea02ec3e61cd22
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .globl __ulimit
9 .type __ulimit, @function
10 __ulimit:
11 pushq %rbx
12 subq $96, %rsp
13 cmpl $2, %edi
14 leaq 112(%rsp), %rax
15 movq %rsi, 56(%rsp)
16 movl $8, 24(%rsp)
17 movq %rax, 32(%rsp)
18 leaq 48(%rsp), %rax
19 movq %rax, 40(%rsp)
20 je .L3
21 cmpl $4, %edi
22 je .L4
23 cmpl $1, %edi
24 je .L18
25 movq __libc_errno@gottpoff(%rip), %rax
26 movl $22, %fs:(%rax)
27 .L15:
28 movq $-1, %rbx
29 addq $96, %rsp
30 movq %rbx, %rax
31 popq %rbx
32 ret
33 .p2align 4,,10
34 .p2align 3
35 .L18:
36 movq %rsp, %rsi
37 call __GI___getrlimit
38 testl %eax, %eax
39 jne .L15
40 movq (%rsp), %rax
41 movabsq $9223372036854775807, %rbx
42 movq %rax, %rdx
43 shrq $9, %rdx
44 cmpq $-1, %rax
45 cmovne %rdx, %rbx
46 addq $96, %rsp
47 movq %rbx, %rax
48 popq %rbx
49 ret
50 .p2align 4,,10
51 .p2align 3
52 .L4:
53 movl $4, %edi
54 call __GI___sysconf
55 addq $96, %rsp
56 movq %rax, %rbx
57 movq %rbx, %rax
58 popq %rbx
59 ret
60 .L3:
61 movq 40(%rsp), %rax
62 movl $16, 24(%rsp)
63 movq 8(%rax), %rbx
64 movabsq $36028797018963967, %rax
65 cmpq %rax, %rbx
66 jbe .L10
67 movq $-1, %rax
68 movabsq $9223372036854775807, %rbx
69 movq %rax, (%rsp)
70 movq %rax, 8(%rsp)
71 .L11:
72 movq %rsp, %rsi
73 movl $1, %edi
74 call __GI___setrlimit
75 cmpl $-1, %eax
76 je .L15
77 addq $96, %rsp
78 movq %rbx, %rax
79 popq %rbx
80 ret
81 .L10:
82 movq %rbx, %rax
83 salq $9, %rax
84 movq %rax, (%rsp)
85 movq %rax, 8(%rsp)
86 jmp .L11
87 .size __ulimit, .-__ulimit
88 .weak ulimit
89 .set ulimit,__ulimit