add aarch64 port
[oweals/musl.git] / src / thread / aarch64 / syscall_cp.s
1 // __syscall_cp_asm(&self->cancel, nr, u, v, w, x, y, z)
2 //                  x0             x1  x2 x3 x4 x5 x6 x7
3
4 // syscall(nr, u, v, w, x, y, z)
5 //         x8  x0 x1 x2 x3 x4 x5
6
7 .global __syscall_cp_asm
8 .type __syscall_cp_asm,%function
9 __syscall_cp_asm:
10 .global __cp_begin
11 __cp_begin:
12         ldr w0,[x0]
13         cbnz w0,1f
14         mov x8,x1
15         mov x0,x2
16         mov x1,x3
17         mov x2,x4
18         mov x3,x5
19         mov x4,x6
20         mov x5,x7
21         svc 0
22 .global __cp_end
23 __cp_end:
24         ret
25
26         // cbnz might not be able to jump far enough
27 1:      b __cancel