Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Unified Diff: fusl/src/thread/mips/clone.s

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fusl/src/thread/mips/__unmapself.s ('k') | fusl/src/thread/mips/syscall_cp.s » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/src/thread/mips/clone.s
diff --git a/fusl/src/thread/mips/clone.s b/fusl/src/thread/mips/clone.s
new file mode 100644
index 0000000000000000000000000000000000000000..37dddf57ba9575c9e849b03ad195b0caea1ddf4a
--- /dev/null
+++ b/fusl/src/thread/mips/clone.s
@@ -0,0 +1,32 @@
+.set noreorder
+.global __clone
+.type __clone,@function
+__clone:
+ # Save function pointer and argument pointer on new thread stack
+ and $5, $5, -8
+ subu $5, $5, 16
+ sw $4, 0($5)
+ sw $7, 4($5)
+ # Shuffle (fn,sp,fl,arg,ptid,tls,ctid) to (fl,sp,ptid,tls,ctid)
+ move $4, $6
+ lw $6, 16($sp)
+ lw $7, 20($sp)
+ lw $9, 24($sp)
+ subu $sp, $sp, 16
+ sw $9, 16($sp)
+ li $2, 4120
+ syscall
+ beq $7, $0, 1f
+ nop
+ addu $sp, $sp, 16
+ jr $ra
+ subu $2, $0, $2
+1: beq $2, $0, 1f
+ nop
+ addu $sp, $sp, 16
+ jr $ra
+ nop
+1: lw $25, 0($sp)
+ lw $4, 4($sp)
+ jr $25
+ nop
« no previous file with comments | « fusl/src/thread/mips/__unmapself.s ('k') | fusl/src/thread/mips/syscall_cp.s » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698