]> git.proxmox.com Git - wasi-libc.git/blob - libc-top-half/musl/src/thread/mips/syscall_cp.s
WASI libc prototype implementation.
[wasi-libc.git] / libc-top-half / musl / src / thread / mips / syscall_cp.s
1 .set noreorder
2
3 .global __cp_begin
4 .hidden __cp_begin
5 .type __cp_begin,@function
6 .global __cp_end
7 .hidden __cp_end
8 .type __cp_end,@function
9 .global __cp_cancel
10 .hidden __cp_cancel
11 .type __cp_cancel,@function
12 .hidden __cancel
13 .global __syscall_cp_asm
14 .hidden __syscall_cp_asm
15 .type __syscall_cp_asm,@function
16 __syscall_cp_asm:
17 subu $sp, $sp, 32
18 __cp_begin:
19 lw $4, 0($4)
20 bne $4, $0, __cp_cancel
21 move $2, $5
22 move $4, $6
23 move $5, $7
24 lw $6, 48($sp)
25 lw $7, 52($sp)
26 lw $8, 56($sp)
27 lw $9, 60($sp)
28 lw $10,64($sp)
29 sw $8, 16($sp)
30 sw $9, 20($sp)
31 sw $10,24($sp)
32 sw $2, 28($sp)
33 lw $2, 28($sp)
34 syscall
35 __cp_end:
36 beq $7, $0, 1f
37 addu $sp, $sp, 32
38 subu $2, $0, $2
39 1: jr $ra
40 nop
41
42 __cp_cancel:
43 move $2, $ra
44 bal 1f
45 addu $sp, $sp, 32
46 .gpword .
47 .gpword __cancel
48 1: lw $3, ($ra)
49 subu $3, $ra, $3
50 lw $25, 4($ra)
51 addu $25, $25, $3
52 jr $25
53 move $ra, $2