about summary refs log tree commit diff
path: root/src/thread/mips/syscall_cp.s
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-07-11 11:35:27 -0400
committerRich Felker <dalias@aerifal.cx>2012-07-11 11:35:27 -0400
commit5c94367a9b0f1c1dd0deadb0f320242b59f844bb (patch)
treeca74a84a1939322c1f043075d7cfc69af2635d36 /src/thread/mips/syscall_cp.s
parentd0bfbd9dca27e3053534bbf70b36e229d0c0cf21 (diff)
downloadmusl-5c94367a9b0f1c1dd0deadb0f320242b59f844bb.tar.gz
musl-5c94367a9b0f1c1dd0deadb0f320242b59f844bb.tar.xz
musl-5c94367a9b0f1c1dd0deadb0f320242b59f844bb.zip
first attempt at making threads work on mips
Diffstat (limited to 'src/thread/mips/syscall_cp.s')
-rw-r--r--src/thread/mips/syscall_cp.s31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/thread/mips/syscall_cp.s b/src/thread/mips/syscall_cp.s
new file mode 100644
index 00000000..9a796bd6
--- /dev/null
+++ b/src/thread/mips/syscall_cp.s
@@ -0,0 +1,31 @@
+.set    noreorder
+
+.global __syscall_cp_asm
+.type   __syscall_cp_asm,@function
+__syscall_cp_asm:
+.global __cp_begin
+__cp_begin:
+	lw      $4, 0($4)
+	bne     $4, $0, 2f
+	move    $10, $5
+	move    $4, $6
+	move    $5, $7
+	lw      $6, 16($sp)
+	lw      $7, 20($sp)
+	lw      $8, 24($sp)
+	lw      $9, 28($sp)
+	subu    $sp, $sp, 32
+	sw      $8, 16($sp)
+	sw      $9, 20($sp)
+	move    $2, $10
+	syscall
+.global __cp_end
+__cp_end:
+	beq     $7, $0, 1f
+	addu    $sp, $sp, 32
+	subu    $2, $0, $2
+1:	jr      $ra
+	nop
+2:	lw      $25, %call16(__cancel)($gp)
+	jr      $25
+	nop