cloudabi_vdso_x86_64.S revision 307144
1// Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors.
2//
3// Redistribution and use in source and binary forms, with or without
4// modification, are permitted provided that the following conditions
5// are met:
6// 1. Redistributions of source code must retain the above copyright
7//    notice, this list of conditions and the following disclaimer.
8// 2. Redistributions in binary form must reproduce the above copyright
9//    notice, this list of conditions and the following disclaimer in the
10//    documentation and/or other materials provided with the distribution.
11//
12// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15// ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22// SUCH DAMAGE.
23//
24// This file is automatically generated. Do not edit.
25//
26// Source: https://github.com/NuxiNL/cloudabi
27
28#define ENTRY(name)      \
29  .text;                 \
30  .p2align 4, 0x90;      \
31  .global name;          \
32  .type name, @function; \
33name:
34
35#define END(name) .size name, . - name
36
37ENTRY(cloudabi_sys_clock_res_get)
38  push %rsi
39  mov $0, %eax
40  syscall
41  pop %rcx
42  jc 1f
43  mov %rax, (%rcx)
44  xor %eax, %eax
451:
46  ret
47END(cloudabi_sys_clock_res_get)
48
49ENTRY(cloudabi_sys_clock_time_get)
50  push %rdx
51  mov $1, %eax
52  syscall
53  pop %rcx
54  jc 1f
55  mov %rax, (%rcx)
56  xor %eax, %eax
571:
58  ret
59END(cloudabi_sys_clock_time_get)
60
61ENTRY(cloudabi_sys_condvar_signal)
62  mov $2, %eax
63  syscall
64  ret
65END(cloudabi_sys_condvar_signal)
66
67ENTRY(cloudabi_sys_fd_close)
68  mov $3, %eax
69  syscall
70  ret
71END(cloudabi_sys_fd_close)
72
73ENTRY(cloudabi_sys_fd_create1)
74  push %rsi
75  mov $4, %eax
76  syscall
77  pop %rcx
78  jc 1f
79  mov %eax, (%rcx)
80  xor %eax, %eax
811:
82  ret
83END(cloudabi_sys_fd_create1)
84
85ENTRY(cloudabi_sys_fd_create2)
86  push %rsi
87  push %rdx
88  mov $5, %eax
89  syscall
90  pop %rsi
91  pop %rcx
92  jc 1f
93  mov %eax, (%rcx)
94  mov %edx, (%rsi)
95  xor %eax, %eax
961:
97  ret
98END(cloudabi_sys_fd_create2)
99
100ENTRY(cloudabi_sys_fd_datasync)
101  mov $6, %eax
102  syscall
103  ret
104END(cloudabi_sys_fd_datasync)
105
106ENTRY(cloudabi_sys_fd_dup)
107  push %rsi
108  mov $7, %eax
109  syscall
110  pop %rcx
111  jc 1f
112  mov %eax, (%rcx)
113  xor %eax, %eax
1141:
115  ret
116END(cloudabi_sys_fd_dup)
117
118ENTRY(cloudabi_sys_fd_pread)
119  mov %rcx, %r10
120  push %r8
121  mov $8, %eax
122  syscall
123  pop %rcx
124  jc 1f
125  mov %rax, (%rcx)
126  xor %eax, %eax
1271:
128  ret
129END(cloudabi_sys_fd_pread)
130
131ENTRY(cloudabi_sys_fd_pwrite)
132  mov %rcx, %r10
133  push %r8
134  mov $9, %eax
135  syscall
136  pop %rcx
137  jc 1f
138  mov %rax, (%rcx)
139  xor %eax, %eax
1401:
141  ret
142END(cloudabi_sys_fd_pwrite)
143
144ENTRY(cloudabi_sys_fd_read)
145  push %rcx
146  mov $10, %eax
147  syscall
148  pop %rcx
149  jc 1f
150  mov %rax, (%rcx)
151  xor %eax, %eax
1521:
153  ret
154END(cloudabi_sys_fd_read)
155
156ENTRY(cloudabi_sys_fd_replace)
157  mov $11, %eax
158  syscall
159  ret
160END(cloudabi_sys_fd_replace)
161
162ENTRY(cloudabi_sys_fd_seek)
163  push %rcx
164  mov $12, %eax
165  syscall
166  pop %rcx
167  jc 1f
168  mov %rax, (%rcx)
169  xor %eax, %eax
1701:
171  ret
172END(cloudabi_sys_fd_seek)
173
174ENTRY(cloudabi_sys_fd_stat_get)
175  mov $13, %eax
176  syscall
177  ret
178END(cloudabi_sys_fd_stat_get)
179
180ENTRY(cloudabi_sys_fd_stat_put)
181  mov $14, %eax
182  syscall
183  ret
184END(cloudabi_sys_fd_stat_put)
185
186ENTRY(cloudabi_sys_fd_sync)
187  mov $15, %eax
188  syscall
189  ret
190END(cloudabi_sys_fd_sync)
191
192ENTRY(cloudabi_sys_fd_write)
193  push %rcx
194  mov $16, %eax
195  syscall
196  pop %rcx
197  jc 1f
198  mov %rax, (%rcx)
199  xor %eax, %eax
2001:
201  ret
202END(cloudabi_sys_fd_write)
203
204ENTRY(cloudabi_sys_file_advise)
205  mov %rcx, %r10
206  mov $17, %eax
207  syscall
208  ret
209END(cloudabi_sys_file_advise)
210
211ENTRY(cloudabi_sys_file_allocate)
212  mov $18, %eax
213  syscall
214  ret
215END(cloudabi_sys_file_allocate)
216
217ENTRY(cloudabi_sys_file_create)
218  mov %rcx, %r10
219  mov $19, %eax
220  syscall
221  ret
222END(cloudabi_sys_file_create)
223
224ENTRY(cloudabi_sys_file_link)
225  mov %rcx, %r10
226  mov $20, %eax
227  syscall
228  ret
229END(cloudabi_sys_file_link)
230
231ENTRY(cloudabi_sys_file_open)
232  mov %rcx, %r10
233  push %r9
234  mov $21, %eax
235  syscall
236  pop %rcx
237  jc 1f
238  mov %eax, (%rcx)
239  xor %eax, %eax
2401:
241  ret
242END(cloudabi_sys_file_open)
243
244ENTRY(cloudabi_sys_file_readdir)
245  mov %rcx, %r10
246  push %r8
247  mov $22, %eax
248  syscall
249  pop %rcx
250  jc 1f
251  mov %rax, (%rcx)
252  xor %eax, %eax
2531:
254  ret
255END(cloudabi_sys_file_readdir)
256
257ENTRY(cloudabi_sys_file_readlink)
258  mov %rcx, %r10
259  push %r9
260  mov $23, %eax
261  syscall
262  pop %rcx
263  jc 1f
264  mov %rax, (%rcx)
265  xor %eax, %eax
2661:
267  ret
268END(cloudabi_sys_file_readlink)
269
270ENTRY(cloudabi_sys_file_rename)
271  mov %rcx, %r10
272  mov $24, %eax
273  syscall
274  ret
275END(cloudabi_sys_file_rename)
276
277ENTRY(cloudabi_sys_file_stat_fget)
278  mov $25, %eax
279  syscall
280  ret
281END(cloudabi_sys_file_stat_fget)
282
283ENTRY(cloudabi_sys_file_stat_fput)
284  mov $26, %eax
285  syscall
286  ret
287END(cloudabi_sys_file_stat_fput)
288
289ENTRY(cloudabi_sys_file_stat_get)
290  mov %rcx, %r10
291  mov $27, %eax
292  syscall
293  ret
294END(cloudabi_sys_file_stat_get)
295
296ENTRY(cloudabi_sys_file_stat_put)
297  mov %rcx, %r10
298  mov $28, %eax
299  syscall
300  ret
301END(cloudabi_sys_file_stat_put)
302
303ENTRY(cloudabi_sys_file_symlink)
304  mov %rcx, %r10
305  mov $29, %eax
306  syscall
307  ret
308END(cloudabi_sys_file_symlink)
309
310ENTRY(cloudabi_sys_file_unlink)
311  mov %rcx, %r10
312  mov $30, %eax
313  syscall
314  ret
315END(cloudabi_sys_file_unlink)
316
317ENTRY(cloudabi_sys_lock_unlock)
318  mov $31, %eax
319  syscall
320  ret
321END(cloudabi_sys_lock_unlock)
322
323ENTRY(cloudabi_sys_mem_advise)
324  mov $32, %eax
325  syscall
326  ret
327END(cloudabi_sys_mem_advise)
328
329ENTRY(cloudabi_sys_mem_lock)
330  mov $33, %eax
331  syscall
332  ret
333END(cloudabi_sys_mem_lock)
334
335ENTRY(cloudabi_sys_mem_map)
336  mov %rcx, %r10
337  mov $34, %eax
338  syscall
339  jc 1f
340  mov 8(%rsp), %rcx
341  mov %rax, (%rcx)
342  xor %eax, %eax
3431:
344  ret
345END(cloudabi_sys_mem_map)
346
347ENTRY(cloudabi_sys_mem_protect)
348  mov $35, %eax
349  syscall
350  ret
351END(cloudabi_sys_mem_protect)
352
353ENTRY(cloudabi_sys_mem_sync)
354  mov $36, %eax
355  syscall
356  ret
357END(cloudabi_sys_mem_sync)
358
359ENTRY(cloudabi_sys_mem_unlock)
360  mov $37, %eax
361  syscall
362  ret
363END(cloudabi_sys_mem_unlock)
364
365ENTRY(cloudabi_sys_mem_unmap)
366  mov $38, %eax
367  syscall
368  ret
369END(cloudabi_sys_mem_unmap)
370
371ENTRY(cloudabi_sys_poll)
372  push %rcx
373  mov $39, %eax
374  syscall
375  pop %rcx
376  jc 1f
377  mov %rax, (%rcx)
378  xor %eax, %eax
3791:
380  ret
381END(cloudabi_sys_poll)
382
383ENTRY(cloudabi_sys_poll_fd)
384  mov %rcx, %r10
385  mov $40, %eax
386  syscall
387  jc 1f
388  mov 8(%rsp), %rcx
389  mov %rax, (%rcx)
390  xor %eax, %eax
3911:
392  ret
393END(cloudabi_sys_poll_fd)
394
395ENTRY(cloudabi_sys_proc_exec)
396  mov %rcx, %r10
397  mov $41, %eax
398  syscall
399  ret
400END(cloudabi_sys_proc_exec)
401
402ENTRY(cloudabi_sys_proc_exit)
403  mov $42, %eax
404  syscall
405END(cloudabi_sys_proc_exit)
406
407ENTRY(cloudabi_sys_proc_fork)
408  push %rdi
409  push %rsi
410  mov $43, %eax
411  syscall
412  pop %rsi
413  pop %rcx
414  jc 1f
415  mov %eax, (%rcx)
416  mov %edx, (%rsi)
417  xor %eax, %eax
4181:
419  ret
420END(cloudabi_sys_proc_fork)
421
422ENTRY(cloudabi_sys_proc_raise)
423  mov $44, %eax
424  syscall
425  ret
426END(cloudabi_sys_proc_raise)
427
428ENTRY(cloudabi_sys_random_get)
429  mov $45, %eax
430  syscall
431  ret
432END(cloudabi_sys_random_get)
433
434ENTRY(cloudabi_sys_sock_accept)
435  push %rdx
436  mov $46, %eax
437  syscall
438  pop %rcx
439  jc 1f
440  mov %eax, (%rcx)
441  xor %eax, %eax
4421:
443  ret
444END(cloudabi_sys_sock_accept)
445
446ENTRY(cloudabi_sys_sock_bind)
447  mov %rcx, %r10
448  mov $47, %eax
449  syscall
450  ret
451END(cloudabi_sys_sock_bind)
452
453ENTRY(cloudabi_sys_sock_connect)
454  mov %rcx, %r10
455  mov $48, %eax
456  syscall
457  ret
458END(cloudabi_sys_sock_connect)
459
460ENTRY(cloudabi_sys_sock_listen)
461  mov $49, %eax
462  syscall
463  ret
464END(cloudabi_sys_sock_listen)
465
466ENTRY(cloudabi_sys_sock_recv)
467  mov $50, %eax
468  syscall
469  ret
470END(cloudabi_sys_sock_recv)
471
472ENTRY(cloudabi_sys_sock_send)
473  mov $51, %eax
474  syscall
475  ret
476END(cloudabi_sys_sock_send)
477
478ENTRY(cloudabi_sys_sock_shutdown)
479  mov $52, %eax
480  syscall
481  ret
482END(cloudabi_sys_sock_shutdown)
483
484ENTRY(cloudabi_sys_sock_stat_get)
485  mov $53, %eax
486  syscall
487  ret
488END(cloudabi_sys_sock_stat_get)
489
490ENTRY(cloudabi_sys_thread_create)
491  push %rsi
492  mov $54, %eax
493  syscall
494  pop %rcx
495  jc 1f
496  mov %eax, (%rcx)
497  xor %eax, %eax
4981:
499  ret
500END(cloudabi_sys_thread_create)
501
502ENTRY(cloudabi_sys_thread_exit)
503  mov $55, %eax
504  syscall
505END(cloudabi_sys_thread_exit)
506
507ENTRY(cloudabi_sys_thread_yield)
508  mov $56, %eax
509  syscall
510  ret
511END(cloudabi_sys_thread_yield)
512