1 // Assembly code for making x86 syscalls.
3 // On x86 we use the "fastcall" convention which passes the first two
4 // arguments in ecx and edx. Outline.rs reorders the arguments to put
5 // a1 and a2 in those registers so they we don't have to move them to
6 // set up the kernel convention.
8 // "fastcall" expects callee to pop argument stack space, so we use
9 // `ret imm` instructions to clean up the stack. We don't need callee
10 // cleanup per se, it just comes along with using "fastcall".
13 .intel_syntax noprefix
15 .section .text.rustix_indirect_syscall0_nr_last_fastcall,"ax",@progbits
17 .weak rustix_indirect_syscall0_nr_last_fastcall
18 .hidden rustix_indirect_syscall0_nr_last_fastcall
19 .type rustix_indirect_syscall0_nr_last_fastcall, @function
20 rustix_indirect_syscall0_nr_last_fastcall:
26 .size rustix_indirect_syscall0_nr_last_fastcall, .-rustix_indirect_syscall0_nr_last_fastcall
28 .section .text.rustix_indirect_syscall1_nr_last_fastcall,"ax",@progbits
30 .weak rustix_indirect_syscall1_nr_last_fastcall
31 .hidden rustix_indirect_syscall1_nr_last_fastcall
32 .type rustix_indirect_syscall1_nr_last_fastcall, @function
33 rustix_indirect_syscall1_nr_last_fastcall:
40 call DWORD PTR [esp+0x8]
45 .size rustix_indirect_syscall1_nr_last_fastcall, .-rustix_indirect_syscall1_nr_last_fastcall
47 .section .text.rustix_indirect_syscall1_noreturn_nr_last_fastcall,"ax",@progbits
49 .weak rustix_indirect_syscall1_noreturn_nr_last_fastcall
50 .hidden rustix_indirect_syscall1_noreturn_nr_last_fastcall
51 .type rustix_indirect_syscall1_noreturn_nr_last_fastcall, @function
52 rustix_indirect_syscall1_noreturn_nr_last_fastcall:
56 call DWORD PTR [esp+0x4]
59 .size rustix_indirect_syscall1_noreturn_nr_last_fastcall, .-rustix_indirect_syscall1_noreturn_nr_last_fastcall
61 .section .text.rustix_indirect_syscall2_nr_last_fastcall,"ax",@progbits
63 .weak rustix_indirect_syscall2_nr_last_fastcall
64 .hidden rustix_indirect_syscall2_nr_last_fastcall
65 .type rustix_indirect_syscall2_nr_last_fastcall, @function
66 rustix_indirect_syscall2_nr_last_fastcall:
72 mov eax,DWORD PTR [esp+0x8]
73 call DWORD PTR [esp+0xc]
78 .size rustix_indirect_syscall2_nr_last_fastcall, .-rustix_indirect_syscall2_nr_last_fastcall
80 .section .text.rustix_indirect_syscall3_nr_last_fastcall,"ax",@progbits
82 .weak rustix_indirect_syscall3_nr_last_fastcall
83 .hidden rustix_indirect_syscall3_nr_last_fastcall
84 .type rustix_indirect_syscall3_nr_last_fastcall, @function
85 rustix_indirect_syscall3_nr_last_fastcall:
90 mov ebx,DWORD PTR [esp+0x8]
91 mov eax,DWORD PTR [esp+0xc]
92 call DWORD PTR [esp+0x10]
97 .size rustix_indirect_syscall3_nr_last_fastcall, .-rustix_indirect_syscall3_nr_last_fastcall
99 .section .text.rustix_indirect_syscall4_nr_last_fastcall,"ax",@progbits
101 .weak rustix_indirect_syscall4_nr_last_fastcall
102 .hidden rustix_indirect_syscall4_nr_last_fastcall
103 .type rustix_indirect_syscall4_nr_last_fastcall, @function
104 rustix_indirect_syscall4_nr_last_fastcall:
107 .cfi_def_cfa_offset 8
109 .cfi_def_cfa_offset 12
112 mov ebx,DWORD PTR [esp+0xc]
113 mov esi,DWORD PTR [esp+0x10]
114 mov eax,DWORD PTR [esp+0x14]
115 call DWORD PTR [esp+0x18]
117 .cfi_def_cfa_offset 8
119 .cfi_def_cfa_offset 4
122 .size rustix_indirect_syscall4_nr_last_fastcall, .-rustix_indirect_syscall4_nr_last_fastcall
124 .section .text.rustix_indirect_syscall5_nr_last_fastcall,"ax",@progbits
126 .weak rustix_indirect_syscall5_nr_last_fastcall
127 .hidden rustix_indirect_syscall5_nr_last_fastcall
128 .type rustix_indirect_syscall5_nr_last_fastcall, @function
129 rustix_indirect_syscall5_nr_last_fastcall:
132 .cfi_def_cfa_offset 8
134 .cfi_def_cfa_offset 12
136 .cfi_def_cfa_offset 16
140 mov ebx,DWORD PTR [esp+0x10]
141 mov esi,DWORD PTR [esp+0x14]
142 mov edi,DWORD PTR [esp+0x18]
143 mov eax,DWORD PTR [esp+0x1c]
144 call DWORD PTR [esp+0x20]
146 .cfi_def_cfa_offset 12
148 .cfi_def_cfa_offset 8
150 .cfi_def_cfa_offset 4
153 .size rustix_indirect_syscall5_nr_last_fastcall, .-rustix_indirect_syscall5_nr_last_fastcall
155 .section .text.rustix_indirect_syscall6_nr_last_fastcall,"ax",@progbits
157 .weak rustix_indirect_syscall6_nr_last_fastcall
158 .hidden rustix_indirect_syscall6_nr_last_fastcall
159 .type rustix_indirect_syscall6_nr_last_fastcall, @function
160 rustix_indirect_syscall6_nr_last_fastcall:
163 .cfi_def_cfa_offset 8
165 .cfi_def_cfa_offset 12
167 .cfi_def_cfa_offset 16
169 .cfi_def_cfa_offset 20
174 mov ebx,DWORD PTR [esp+0x14]
175 mov esi,DWORD PTR [esp+0x18]
176 mov edi,DWORD PTR [esp+0x1c]
177 mov ebp,DWORD PTR [esp+0x20]
178 mov eax,DWORD PTR [esp+0x24]
179 call DWORD PTR [esp+0x28]
181 .cfi_def_cfa_offset 16
183 .cfi_def_cfa_offset 12
185 .cfi_def_cfa_offset 8
187 .cfi_def_cfa_offset 4
190 .size rustix_indirect_syscall6_nr_last_fastcall, .-rustix_indirect_syscall6_nr_last_fastcall
192 .section .text.rustix_syscall0_nr_last_fastcall,"ax",@progbits
194 .weak rustix_syscall0_nr_last_fastcall
195 .hidden rustix_syscall0_nr_last_fastcall
196 .type rustix_syscall0_nr_last_fastcall, @function
197 rustix_syscall0_nr_last_fastcall:
203 .size rustix_syscall0_nr_last_fastcall, .-rustix_syscall0_nr_last_fastcall
205 .section .text.rustix_syscall1_nr_last_fastcall,"ax",@progbits
207 .weak rustix_syscall1_nr_last_fastcall
208 .hidden rustix_syscall1_nr_last_fastcall
209 .type rustix_syscall1_nr_last_fastcall, @function
210 rustix_syscall1_nr_last_fastcall:
213 .cfi_def_cfa_offset 8
219 .cfi_def_cfa_offset 4
222 .size rustix_syscall1_nr_last_fastcall, .-rustix_syscall1_nr_last_fastcall
224 .section .text.rustix_syscall1_noreturn_nr_last_fastcall,"ax",@progbits
226 .weak rustix_syscall1_noreturn_nr_last_fastcall
227 .hidden rustix_syscall1_noreturn_nr_last_fastcall
228 .type rustix_syscall1_noreturn_nr_last_fastcall, @function
229 rustix_syscall1_noreturn_nr_last_fastcall:
236 .size rustix_syscall1_noreturn_nr_last_fastcall, .-rustix_syscall1_noreturn_nr_last_fastcall
238 .section .text.rustix_syscall2_nr_last_fastcall,"ax",@progbits
240 .weak rustix_syscall2_nr_last_fastcall
241 .hidden rustix_syscall2_nr_last_fastcall
242 .type rustix_syscall2_nr_last_fastcall, @function
243 rustix_syscall2_nr_last_fastcall:
246 .cfi_def_cfa_offset 8
249 mov eax,DWORD PTR [esp+0x8]
252 .cfi_def_cfa_offset 4
255 .size rustix_syscall2_nr_last_fastcall, .-rustix_syscall2_nr_last_fastcall
257 .section .text.rustix_syscall3_nr_last_fastcall,"ax",@progbits
259 .weak rustix_syscall3_nr_last_fastcall
260 .hidden rustix_syscall3_nr_last_fastcall
261 .type rustix_syscall3_nr_last_fastcall, @function
262 rustix_syscall3_nr_last_fastcall:
265 .cfi_def_cfa_offset 8
267 mov ebx,DWORD PTR [esp+0x8]
268 mov eax,DWORD PTR [esp+0xc]
271 .cfi_def_cfa_offset 4
274 .size rustix_syscall3_nr_last_fastcall, .-rustix_syscall3_nr_last_fastcall
276 .section .text.rustix_syscall4_nr_last_fastcall,"ax",@progbits
278 .weak rustix_syscall4_nr_last_fastcall
279 .hidden rustix_syscall4_nr_last_fastcall
280 .type rustix_syscall4_nr_last_fastcall, @function
281 rustix_syscall4_nr_last_fastcall:
284 .cfi_def_cfa_offset 8
286 .cfi_def_cfa_offset 12
289 mov ebx,DWORD PTR [esp+0xc]
290 mov esi,DWORD PTR [esp+0x10]
291 mov eax,DWORD PTR [esp+0x14]
294 .cfi_def_cfa_offset 8
296 .cfi_def_cfa_offset 4
299 .size rustix_syscall4_nr_last_fastcall, .-rustix_syscall4_nr_last_fastcall
301 .section .text.rustix_syscall5_nr_last_fastcall,"ax",@progbits
303 .weak rustix_syscall5_nr_last_fastcall
304 .hidden rustix_syscall5_nr_last_fastcall
305 .type rustix_syscall5_nr_last_fastcall, @function
306 rustix_syscall5_nr_last_fastcall:
309 .cfi_def_cfa_offset 8
311 .cfi_def_cfa_offset 12
313 .cfi_def_cfa_offset 16
317 mov ebx,DWORD PTR [esp+0x10]
318 mov esi,DWORD PTR [esp+0x14]
319 mov edi,DWORD PTR [esp+0x18]
320 mov eax,DWORD PTR [esp+0x1c]
323 .cfi_def_cfa_offset 12
325 .cfi_def_cfa_offset 8
327 .cfi_def_cfa_offset 4
330 .size rustix_syscall5_nr_last_fastcall, .-rustix_syscall5_nr_last_fastcall
332 .section .text.rustix_syscall6_nr_last_fastcall,"ax",@progbits
334 .weak rustix_syscall6_nr_last_fastcall
335 .hidden rustix_syscall6_nr_last_fastcall
336 .type rustix_syscall6_nr_last_fastcall, @function
337 rustix_syscall6_nr_last_fastcall:
340 .cfi_def_cfa_offset 8
342 .cfi_def_cfa_offset 12
344 .cfi_def_cfa_offset 16
346 .cfi_def_cfa_offset 20
351 mov ebx,DWORD PTR [esp+0x14]
352 mov esi,DWORD PTR [esp+0x18]
353 mov edi,DWORD PTR [esp+0x1c]
354 mov ebp,DWORD PTR [esp+0x20]
355 mov eax,DWORD PTR [esp+0x24]
358 .cfi_def_cfa_offset 16
360 .cfi_def_cfa_offset 12
362 .cfi_def_cfa_offset 8
364 .cfi_def_cfa_offset 4
367 .size rustix_syscall6_nr_last_fastcall, .-rustix_syscall6_nr_last_fastcall
369 .section .text.rustix_int_0x80,"ax",@progbits
371 .weak rustix_int_0x80
372 .hidden rustix_int_0x80
373 .type rustix_int_0x80, @function
379 .size rustix_int_0x80, .-rustix_int_0x80
381 .section .note.GNU-stack,"",@progbits