summaryrefslogtreecommitdiff
path: root/src/thread/microblaze/clone.s
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-09-29 01:05:31 -0400
committerRich Felker <dalias@aerifal.cx>2012-09-29 01:05:31 -0400
commit8c0a3d9e5c169fc9d0f246ab59362b658b029ad7 (patch)
tree6ac54202768db511e8bb959d85060adb98cbf226 /src/thread/microblaze/clone.s
parente0ea44cb764fcdbe8515f22096930bede2c7896f (diff)
downloadmusl-8c0a3d9e5c169fc9d0f246ab59362b658b029ad7.tar.gz
musl-8c0a3d9e5c169fc9d0f246ab59362b658b029ad7.tar.bz2
musl-8c0a3d9e5c169fc9d0f246ab59362b658b029ad7.tar.xz
musl-8c0a3d9e5c169fc9d0f246ab59362b658b029ad7.zip
microblaze port
based on initial work by rdp, with heavy modifications. some features including threads are untested because qemu app-level emulation seems to be broken and I do not have a proper system image for testing.
Diffstat (limited to 'src/thread/microblaze/clone.s')
-rw-r--r--src/thread/microblaze/clone.s33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/thread/microblaze/clone.s b/src/thread/microblaze/clone.s
new file mode 100644
index 00000000..cff80efa
--- /dev/null
+++ b/src/thread/microblaze/clone.s
@@ -0,0 +1,33 @@
+.global __clone
+.weak clone
+.type __clone,@function
+.type clone,@function
+
+# r5, r6, r7, r8, r9, r10, stack
+# fn, st, fl, ar, pt, tl, ct
+# fl, st, pt, tl, ctx
+
+__clone:
+clone:
+ andi r6, r6, -16
+ addi r6, r6, -16
+ swi r5, r6, 0
+ swi r8, r6, 4
+
+ ori r5, r7, 0
+ ori r7, r9, 0
+ ori r8, r10, 0
+ lwi r9, r1, 28
+ ori r12, r0, 120
+
+ brki r14, 8
+ beqi r3, 1f
+ rtsd r15, 8
+ nop
+
+1: lwi r3, r1, 0
+ lwi r5, r1, 4
+ brald r15, r3
+ nop
+ ori r12, r0, 1
+ brki r14, 8