projects
/
musl
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
first attempt at making threads work on mips
[musl]
/
src
/
thread
/
mips
/
clone.s
1
.set noreorder
2
.global __clone
3
.type __clone,@function
4
__clone:
5
# Save function pointer and argument pointer
6
move $25, $4
7
move $8, $7
8
# Shuffle (fn,sp,fl,arg,ptid,tls,ctid) to (sp,fl,ptid,tls,ctid)
9
move $4, $5
10
move $5, $6
11
lw $6, 16($sp)
12
lw $7, 20($sp)
13
lw $9, 24($sp)
14
sw $9, 16($sp)
15
li $2, 4120
16
syscall
17
beq $7, $0, 1f
18
nop
19
jr $ra
20
subu $2, $0, $2
21
1: beq $2, $0, 1f
22
nop
23
jr $ra
24
nop
25
1: move $4, $8
26
jr $25
27
nop