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 2;            \
31  .global name;          \
32  .type name, %function; \
33name:
34
35#define END(name) .size name, . - name
36
37ENTRY(cloudabi_sys_clock_res_get)
38  str r0, [sp, #-16]
39  str r1, [sp, #-20]
40  mov r0, #0
41  sub r2, sp, #16
42  swi 0
43  ldrcc r1, [sp, #-20]
44  ldrcc r2, [sp, #-16]
45  strcc r2, [r1, #0]
46  ldrcc r2, [sp, #-12]
47  strcc r2, [r1, #4]
48  bx lr
49END(cloudabi_sys_clock_res_get)
50
51ENTRY(cloudabi_sys_clock_time_get)
52  str r0, [sp, #-16]
53  str r2, [sp, #-8]
54  str r3, [sp, #-4]
55  mov r0, #1
56  sub r2, sp, #16
57  swi 0
58  ldrcc r1, [sp, #0]
59  ldrcc r2, [sp, #-16]
60  strcc r2, [r1, #0]
61  ldrcc r2, [sp, #-12]
62  strcc r2, [r1, #4]
63  bx lr
64END(cloudabi_sys_clock_time_get)
65
66ENTRY(cloudabi_sys_condvar_signal)
67  str r0, [sp, #-24]
68  mov r0, #0
69  str r0, [sp, #-20]
70  str r1, [sp, #-16]
71  str r2, [sp, #-8]
72  mov r0, #2
73  sub r2, sp, #24
74  swi 0
75  bx lr
76END(cloudabi_sys_condvar_signal)
77
78ENTRY(cloudabi_sys_fd_close)
79  str r0, [sp, #-16]
80  mov r0, #3
81  sub r2, sp, #16
82  swi 0
83  bx lr
84END(cloudabi_sys_fd_close)
85
86ENTRY(cloudabi_sys_fd_create1)
87  str r0, [sp, #-16]
88  str r1, [sp, #-20]
89  mov r0, #4
90  sub r2, sp, #16
91  swi 0
92  ldrcc r1, [sp, #-20]
93  ldrcc r2, [sp, #-16]
94  strcc r2, [r1, #0]
95  bx lr
96END(cloudabi_sys_fd_create1)
97
98ENTRY(cloudabi_sys_fd_create2)
99  str r0, [sp, #-16]
100  str r1, [sp, #-20]
101  str r2, [sp, #-24]
102  mov r0, #5
103  sub r2, sp, #16
104  swi 0
105  ldrcc r1, [sp, #-20]
106  ldrcc r2, [sp, #-16]
107  strcc r2, [r1, #0]
108  ldrcc r1, [sp, #-24]
109  ldrcc r2, [sp, #-8]
110  strcc r2, [r1, #0]
111  bx lr
112END(cloudabi_sys_fd_create2)
113
114ENTRY(cloudabi_sys_fd_datasync)
115  str r0, [sp, #-16]
116  mov r0, #6
117  sub r2, sp, #16
118  swi 0
119  bx lr
120END(cloudabi_sys_fd_datasync)
121
122ENTRY(cloudabi_sys_fd_dup)
123  str r0, [sp, #-16]
124  str r1, [sp, #-20]
125  mov r0, #7
126  sub r2, sp, #16
127  swi 0
128  ldrcc r1, [sp, #-20]
129  ldrcc r2, [sp, #-16]
130  strcc r2, [r1, #0]
131  bx lr
132END(cloudabi_sys_fd_dup)
133
134ENTRY(cloudabi_sys_fd_pread)
135  str r0, [sp, #-32]
136  str r1, [sp, #-24]
137  mov r0, #0
138  str r0, [sp, #-20]
139  str r2, [sp, #-16]
140  str r0, [sp, #-12]
141  ldr r1, [sp, #0]
142  str r1, [sp, #-8]
143  ldr r1, [sp, #4]
144  str r1, [sp, #-4]
145  mov r0, #8
146  sub r2, sp, #32
147  swi 0
148  ldrcc r1, [sp, #8]
149  ldrcc r2, [sp, #-32]
150  strcc r2, [r1, #0]
151  bx lr
152END(cloudabi_sys_fd_pread)
153
154ENTRY(cloudabi_sys_fd_pwrite)
155  str r0, [sp, #-32]
156  str r1, [sp, #-24]
157  mov r0, #0
158  str r0, [sp, #-20]
159  str r2, [sp, #-16]
160  str r0, [sp, #-12]
161  ldr r1, [sp, #0]
162  str r1, [sp, #-8]
163  ldr r1, [sp, #4]
164  str r1, [sp, #-4]
165  mov r0, #9
166  sub r2, sp, #32
167  swi 0
168  ldrcc r1, [sp, #8]
169  ldrcc r2, [sp, #-32]
170  strcc r2, [r1, #0]
171  bx lr
172END(cloudabi_sys_fd_pwrite)
173
174ENTRY(cloudabi_sys_fd_read)
175  str r0, [sp, #-24]
176  str r1, [sp, #-16]
177  mov r0, #0
178  str r0, [sp, #-12]
179  str r2, [sp, #-8]
180  str r0, [sp, #-4]
181  str r3, [sp, #-28]
182  mov r0, #10
183  sub r2, sp, #24
184  swi 0
185  ldrcc r1, [sp, #-28]
186  ldrcc r2, [sp, #-24]
187  strcc r2, [r1, #0]
188  bx lr
189END(cloudabi_sys_fd_read)
190
191ENTRY(cloudabi_sys_fd_replace)
192  str r0, [sp, #-16]
193  str r1, [sp, #-8]
194  mov r0, #11
195  sub r2, sp, #16
196  swi 0
197  bx lr
198END(cloudabi_sys_fd_replace)
199
200ENTRY(cloudabi_sys_fd_seek)
201  str r0, [sp, #-24]
202  str r2, [sp, #-16]
203  str r3, [sp, #-12]
204  ldr r1, [sp, #0]
205  str r1, [sp, #-8]
206  mov r0, #12
207  sub r2, sp, #24
208  swi 0
209  ldrcc r1, [sp, #4]
210  ldrcc r2, [sp, #-24]
211  strcc r2, [r1, #0]
212  ldrcc r2, [sp, #-20]
213  strcc r2, [r1, #4]
214  bx lr
215END(cloudabi_sys_fd_seek)
216
217ENTRY(cloudabi_sys_fd_stat_get)
218  str r0, [sp, #-16]
219  str r1, [sp, #-8]
220  mov r0, #0
221  str r0, [sp, #-4]
222  mov r0, #13
223  sub r2, sp, #16
224  swi 0
225  bx lr
226END(cloudabi_sys_fd_stat_get)
227
228ENTRY(cloudabi_sys_fd_stat_put)
229  str r0, [sp, #-24]
230  str r1, [sp, #-16]
231  mov r0, #0
232  str r0, [sp, #-12]
233  str r2, [sp, #-8]
234  mov r0, #14
235  sub r2, sp, #24
236  swi 0
237  bx lr
238END(cloudabi_sys_fd_stat_put)
239
240ENTRY(cloudabi_sys_fd_sync)
241  str r0, [sp, #-16]
242  mov r0, #15
243  sub r2, sp, #16
244  swi 0
245  bx lr
246END(cloudabi_sys_fd_sync)
247
248ENTRY(cloudabi_sys_fd_write)
249  str r0, [sp, #-24]
250  str r1, [sp, #-16]
251  mov r0, #0
252  str r0, [sp, #-12]
253  str r2, [sp, #-8]
254  str r0, [sp, #-4]
255  str r3, [sp, #-28]
256  mov r0, #16
257  sub r2, sp, #24
258  swi 0
259  ldrcc r1, [sp, #-28]
260  ldrcc r2, [sp, #-24]
261  strcc r2, [r1, #0]
262  bx lr
263END(cloudabi_sys_fd_write)
264
265ENTRY(cloudabi_sys_file_advise)
266  str r0, [sp, #-32]
267  str r2, [sp, #-24]
268  str r3, [sp, #-20]
269  ldr r1, [sp, #0]
270  str r1, [sp, #-16]
271  ldr r1, [sp, #4]
272  str r1, [sp, #-12]
273  ldr r1, [sp, #8]
274  str r1, [sp, #-8]
275  mov r0, #17
276  sub r2, sp, #32
277  swi 0
278  bx lr
279END(cloudabi_sys_file_advise)
280
281ENTRY(cloudabi_sys_file_allocate)
282  str r0, [sp, #-24]
283  str r2, [sp, #-16]
284  str r3, [sp, #-12]
285  ldr r1, [sp, #0]
286  str r1, [sp, #-8]
287  ldr r1, [sp, #4]
288  str r1, [sp, #-4]
289  mov r0, #18
290  sub r2, sp, #24
291  swi 0
292  bx lr
293END(cloudabi_sys_file_allocate)
294
295ENTRY(cloudabi_sys_file_create)
296  str r0, [sp, #-32]
297  str r1, [sp, #-24]
298  mov r0, #0
299  str r0, [sp, #-20]
300  str r2, [sp, #-16]
301  str r0, [sp, #-12]
302  str r3, [sp, #-8]
303  mov r0, #19
304  sub r2, sp, #32
305  swi 0
306  bx lr
307END(cloudabi_sys_file_create)
308
309ENTRY(cloudabi_sys_file_link)
310  str r0, [sp, #-48]
311  str r1, [sp, #-44]
312  str r2, [sp, #-40]
313  mov r0, #0
314  str r0, [sp, #-36]
315  str r3, [sp, #-32]
316  str r0, [sp, #-28]
317  ldr r1, [sp, #0]
318  str r1, [sp, #-24]
319  ldr r1, [sp, #4]
320  str r1, [sp, #-16]
321  str r0, [sp, #-12]
322  ldr r1, [sp, #8]
323  str r1, [sp, #-8]
324  str r0, [sp, #-4]
325  mov r0, #20
326  sub r2, sp, #48
327  swi 0
328  bx lr
329END(cloudabi_sys_file_link)
330
331ENTRY(cloudabi_sys_file_open)
332  str r0, [sp, #-40]
333  str r1, [sp, #-36]
334  str r2, [sp, #-32]
335  mov r0, #0
336  str r0, [sp, #-28]
337  str r3, [sp, #-24]
338  str r0, [sp, #-20]
339  ldr r1, [sp, #0]
340  str r1, [sp, #-16]
341  ldr r1, [sp, #4]
342  str r1, [sp, #-8]
343  str r0, [sp, #-4]
344  mov r0, #21
345  sub r2, sp, #40
346  swi 0
347  ldrcc r1, [sp, #8]
348  ldrcc r2, [sp, #-40]
349  strcc r2, [r1, #0]
350  bx lr
351END(cloudabi_sys_file_open)
352
353ENTRY(cloudabi_sys_file_readdir)
354  str r0, [sp, #-32]
355  str r1, [sp, #-24]
356  mov r0, #0
357  str r0, [sp, #-20]
358  str r2, [sp, #-16]
359  str r0, [sp, #-12]
360  ldr r1, [sp, #0]
361  str r1, [sp, #-8]
362  ldr r1, [sp, #4]
363  str r1, [sp, #-4]
364  mov r0, #22
365  sub r2, sp, #32
366  swi 0
367  ldrcc r1, [sp, #8]
368  ldrcc r2, [sp, #-32]
369  strcc r2, [r1, #0]
370  bx lr
371END(cloudabi_sys_file_readdir)
372
373ENTRY(cloudabi_sys_file_readlink)
374  str r0, [sp, #-40]
375  str r1, [sp, #-32]
376  mov r0, #0
377  str r0, [sp, #-28]
378  str r2, [sp, #-24]
379  str r0, [sp, #-20]
380  str r3, [sp, #-16]
381  str r0, [sp, #-12]
382  ldr r1, [sp, #0]
383  str r1, [sp, #-8]
384  str r0, [sp, #-4]
385  mov r0, #23
386  sub r2, sp, #40
387  swi 0
388  ldrcc r1, [sp, #4]
389  ldrcc r2, [sp, #-40]
390  strcc r2, [r1, #0]
391  bx lr
392END(cloudabi_sys_file_readlink)
393
394ENTRY(cloudabi_sys_file_rename)
395  str r0, [sp, #-48]
396  str r1, [sp, #-40]
397  mov r0, #0
398  str r0, [sp, #-36]
399  str r2, [sp, #-32]
400  str r0, [sp, #-28]
401  str r3, [sp, #-24]
402  ldr r1, [sp, #0]
403  str r1, [sp, #-16]
404  str r0, [sp, #-12]
405  ldr r1, [sp, #4]
406  str r1, [sp, #-8]
407  str r0, [sp, #-4]
408  mov r0, #24
409  sub r2, sp, #48
410  swi 0
411  bx lr
412END(cloudabi_sys_file_rename)
413
414ENTRY(cloudabi_sys_file_stat_fget)
415  str r0, [sp, #-16]
416  str r1, [sp, #-8]
417  mov r0, #0
418  str r0, [sp, #-4]
419  mov r0, #25
420  sub r2, sp, #16
421  swi 0
422  bx lr
423END(cloudabi_sys_file_stat_fget)
424
425ENTRY(cloudabi_sys_file_stat_fput)
426  str r0, [sp, #-24]
427  str r1, [sp, #-16]
428  mov r0, #0
429  str r0, [sp, #-12]
430  str r2, [sp, #-8]
431  mov r0, #26
432  sub r2, sp, #24
433  swi 0
434  bx lr
435END(cloudabi_sys_file_stat_fput)
436
437ENTRY(cloudabi_sys_file_stat_get)
438  str r0, [sp, #-32]
439  str r1, [sp, #-28]
440  str r2, [sp, #-24]
441  mov r0, #0
442  str r0, [sp, #-20]
443  str r3, [sp, #-16]
444  str r0, [sp, #-12]
445  ldr r1, [sp, #0]
446  str r1, [sp, #-8]
447  str r0, [sp, #-4]
448  mov r0, #27
449  sub r2, sp, #32
450  swi 0
451  bx lr
452END(cloudabi_sys_file_stat_get)
453
454ENTRY(cloudabi_sys_file_stat_put)
455  str r0, [sp, #-40]
456  str r1, [sp, #-36]
457  str r2, [sp, #-32]
458  mov r0, #0
459  str r0, [sp, #-28]
460  str r3, [sp, #-24]
461  str r0, [sp, #-20]
462  ldr r1, [sp, #0]
463  str r1, [sp, #-16]
464  str r0, [sp, #-12]
465  ldr r1, [sp, #4]
466  str r1, [sp, #-8]
467  mov r0, #28
468  sub r2, sp, #40
469  swi 0
470  bx lr
471END(cloudabi_sys_file_stat_put)
472
473ENTRY(cloudabi_sys_file_symlink)
474  str r0, [sp, #-40]
475  mov r0, #0
476  str r0, [sp, #-36]
477  str r1, [sp, #-32]
478  str r0, [sp, #-28]
479  str r2, [sp, #-24]
480  str r3, [sp, #-16]
481  str r0, [sp, #-12]
482  ldr r1, [sp, #0]
483  str r1, [sp, #-8]
484  str r0, [sp, #-4]
485  mov r0, #29
486  sub r2, sp, #40
487  swi 0
488  bx lr
489END(cloudabi_sys_file_symlink)
490
491ENTRY(cloudabi_sys_file_unlink)
492  str r0, [sp, #-32]
493  str r1, [sp, #-24]
494  mov r0, #0
495  str r0, [sp, #-20]
496  str r2, [sp, #-16]
497  str r0, [sp, #-12]
498  str r3, [sp, #-8]
499  mov r0, #30
500  sub r2, sp, #32
501  swi 0
502  bx lr
503END(cloudabi_sys_file_unlink)
504
505ENTRY(cloudabi_sys_lock_unlock)
506  str r0, [sp, #-16]
507  mov r0, #0
508  str r0, [sp, #-12]
509  str r1, [sp, #-8]
510  mov r0, #31
511  sub r2, sp, #16
512  swi 0
513  bx lr
514END(cloudabi_sys_lock_unlock)
515
516ENTRY(cloudabi_sys_mem_advise)
517  str r0, [sp, #-24]
518  mov r0, #0
519  str r0, [sp, #-20]
520  str r1, [sp, #-16]
521  str r0, [sp, #-12]
522  str r2, [sp, #-8]
523  mov r0, #32
524  sub r2, sp, #24
525  swi 0
526  bx lr
527END(cloudabi_sys_mem_advise)
528
529ENTRY(cloudabi_sys_mem_map)
530  str r0, [sp, #-48]
531  mov r0, #0
532  str r0, [sp, #-44]
533  str r1, [sp, #-40]
534  str r0, [sp, #-36]
535  str r2, [sp, #-32]
536  str r3, [sp, #-24]
537  ldr r1, [sp, #0]
538  str r1, [sp, #-16]
539  ldr r1, [sp, #8]
540  str r1, [sp, #-8]
541  ldr r1, [sp, #12]
542  str r1, [sp, #-4]
543  mov r0, #33
544  sub r2, sp, #48
545  swi 0
546  ldrcc r1, [sp, #16]
547  ldrcc r2, [sp, #-48]
548  strcc r2, [r1, #0]
549  bx lr
550END(cloudabi_sys_mem_map)
551
552ENTRY(cloudabi_sys_mem_protect)
553  str r0, [sp, #-24]
554  mov r0, #0
555  str r0, [sp, #-20]
556  str r1, [sp, #-16]
557  str r0, [sp, #-12]
558  str r2, [sp, #-8]
559  mov r0, #34
560  sub r2, sp, #24
561  swi 0
562  bx lr
563END(cloudabi_sys_mem_protect)
564
565ENTRY(cloudabi_sys_mem_sync)
566  str r0, [sp, #-24]
567  mov r0, #0
568  str r0, [sp, #-20]
569  str r1, [sp, #-16]
570  str r0, [sp, #-12]
571  str r2, [sp, #-8]
572  mov r0, #35
573  sub r2, sp, #24
574  swi 0
575  bx lr
576END(cloudabi_sys_mem_sync)
577
578ENTRY(cloudabi_sys_mem_unmap)
579  str r0, [sp, #-16]
580  mov r0, #0
581  str r0, [sp, #-12]
582  str r1, [sp, #-8]
583  str r0, [sp, #-4]
584  mov r0, #36
585  sub r2, sp, #16
586  swi 0
587  bx lr
588END(cloudabi_sys_mem_unmap)
589
590ENTRY(cloudabi_sys_poll)
591  str r0, [sp, #-24]
592  mov r0, #0
593  str r0, [sp, #-20]
594  str r1, [sp, #-16]
595  str r0, [sp, #-12]
596  str r2, [sp, #-8]
597  str r0, [sp, #-4]
598  str r3, [sp, #-28]
599  mov r0, #37
600  sub r2, sp, #24
601  swi 0
602  ldrcc r1, [sp, #-28]
603  ldrcc r2, [sp, #-24]
604  strcc r2, [r1, #0]
605  bx lr
606END(cloudabi_sys_poll)
607
608ENTRY(cloudabi_sys_proc_exec)
609  str r0, [sp, #-40]
610  str r1, [sp, #-32]
611  mov r0, #0
612  str r0, [sp, #-28]
613  str r2, [sp, #-24]
614  str r0, [sp, #-20]
615  str r3, [sp, #-16]
616  str r0, [sp, #-12]
617  ldr r1, [sp, #0]
618  str r1, [sp, #-8]
619  str r0, [sp, #-4]
620  mov r0, #38
621  sub r2, sp, #40
622  swi 0
623  bx lr
624END(cloudabi_sys_proc_exec)
625
626ENTRY(cloudabi_sys_proc_exit)
627  str r0, [sp, #-16]
628  mov r0, #39
629  sub r2, sp, #16
630  swi 0
631END(cloudabi_sys_proc_exit)
632
633ENTRY(cloudabi_sys_proc_fork)
634  str r0, [sp, #-20]
635  str r1, [sp, #-24]
636  mov r0, #40
637  sub r2, sp, #16
638  swi 0
639  ldrcc r1, [sp, #-20]
640  ldrcc r2, [sp, #-16]
641  strcc r2, [r1, #0]
642  ldrcc r1, [sp, #-24]
643  ldrcc r2, [sp, #-8]
644  strcc r2, [r1, #0]
645  bx lr
646END(cloudabi_sys_proc_fork)
647
648ENTRY(cloudabi_sys_proc_raise)
649  str r0, [sp, #-16]
650  mov r0, #41
651  sub r2, sp, #16
652  swi 0
653  bx lr
654END(cloudabi_sys_proc_raise)
655
656ENTRY(cloudabi_sys_random_get)
657  str r0, [sp, #-16]
658  mov r0, #0
659  str r0, [sp, #-12]
660  str r1, [sp, #-8]
661  str r0, [sp, #-4]
662  mov r0, #42
663  sub r2, sp, #16
664  swi 0
665  bx lr
666END(cloudabi_sys_random_get)
667
668ENTRY(cloudabi_sys_sock_recv)
669  str r0, [sp, #-24]
670  str r1, [sp, #-16]
671  mov r0, #0
672  str r0, [sp, #-12]
673  str r2, [sp, #-8]
674  str r0, [sp, #-4]
675  mov r0, #43
676  sub r2, sp, #24
677  swi 0
678  bx lr
679END(cloudabi_sys_sock_recv)
680
681ENTRY(cloudabi_sys_sock_send)
682  str r0, [sp, #-24]
683  str r1, [sp, #-16]
684  mov r0, #0
685  str r0, [sp, #-12]
686  str r2, [sp, #-8]
687  str r0, [sp, #-4]
688  mov r0, #44
689  sub r2, sp, #24
690  swi 0
691  bx lr
692END(cloudabi_sys_sock_send)
693
694ENTRY(cloudabi_sys_sock_shutdown)
695  str r0, [sp, #-16]
696  str r1, [sp, #-8]
697  mov r0, #45
698  sub r2, sp, #16
699  swi 0
700  bx lr
701END(cloudabi_sys_sock_shutdown)
702
703ENTRY(cloudabi_sys_thread_create)
704  str r0, [sp, #-16]
705  mov r0, #0
706  str r0, [sp, #-12]
707  str r1, [sp, #-20]
708  mov r0, #46
709  sub r2, sp, #16
710  swi 0
711  ldrcc r1, [sp, #-20]
712  ldrcc r2, [sp, #-16]
713  strcc r2, [r1, #0]
714  bx lr
715END(cloudabi_sys_thread_create)
716
717ENTRY(cloudabi_sys_thread_exit)
718  str r0, [sp, #-16]
719  mov r0, #0
720  str r0, [sp, #-12]
721  str r1, [sp, #-8]
722  mov r0, #47
723  sub r2, sp, #16
724  swi 0
725END(cloudabi_sys_thread_exit)
726
727ENTRY(cloudabi_sys_thread_yield)
728  mov r0, #48
729  sub r2, sp, #16
730  swi 0
731  bx lr
732END(cloudabi_sys_thread_yield)
733