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

Unified Diff: fusl/src/thread/or1k/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/or1k/__unmapself.s ('k') | fusl/src/thread/or1k/syscall_cp.s » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/src/thread/or1k/clone.s
diff --git a/fusl/src/thread/or1k/clone.s b/fusl/src/thread/or1k/clone.s
new file mode 100644
index 0000000000000000000000000000000000000000..02f380bd5f96db837840e4be2365c24e61252155
--- /dev/null
+++ b/fusl/src/thread/or1k/clone.s
@@ -0,0 +1,30 @@
+/* int clone(fn, stack, flags, arg, ptid, tls, ctid)
+ * r3 r4 r5 r6 sp+0 sp+4 sp+8
+ * sys_clone(flags, stack, ptid, ctid, tls)
+ */
+.global __clone
+.type __clone,@function
+__clone:
+ l.addi r4, r4, -8
+ l.sw 0(r4), r3
+ l.sw 4(r4), r6
+ /* (fn, st, fl, ar, pt, tl, ct) => (fl, st, pt, ct, tl) */
+ l.ori r3, r5, 0
+ l.lwz r5, 0(r1)
+ l.lwz r6, 8(r1)
+ l.lwz r7, 4(r1)
+ l.ori r11, r0, 220 /* __NR_clone */
+ l.sys 1
+
+ l.sfeqi r11, 0
+ l.bf 1f
+ l.nop
+ l.jr r9
+ l.nop
+
+1: l.lwz r11, 0(r1)
+ l.jalr r11
+ l.lwz r3, 4(r1)
+
+ l.ori r11, r0, 93 /* __NR_exit */
+ l.sys 1
« no previous file with comments | « fusl/src/thread/or1k/__unmapself.s ('k') | fusl/src/thread/or1k/syscall_cp.s » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698