summaryrefslogtreecommitdiff
path: root/src/thread/superh/syscall_cp.s
diff options
context:
space:
mode:
authorBobby Bingham <koorogi@koorogi.info>2013-10-05 05:13:18 -0500
committerBobby Bingham <koorogi@koorogi.info>2014-02-23 16:15:54 -0600
commit3a3c813e08d808224c12fd0e9104aeff7c45c9a7 (patch)
tree508b28c42438615d711afcb9b44d7b0e0842f28d /src/thread/superh/syscall_cp.s
parentd05aaedaabd4f5472c233dbbd1ff4bb9c9c99794 (diff)
downloadmusl-3a3c813e08d808224c12fd0e9104aeff7c45c9a7.tar.gz
musl-3a3c813e08d808224c12fd0e9104aeff7c45c9a7.tar.bz2
musl-3a3c813e08d808224c12fd0e9104aeff7c45c9a7.tar.xz
musl-3a3c813e08d808224c12fd0e9104aeff7c45c9a7.zip
superh port
Diffstat (limited to 'src/thread/superh/syscall_cp.s')
-rw-r--r--src/thread/superh/syscall_cp.s39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/thread/superh/syscall_cp.s b/src/thread/superh/syscall_cp.s
new file mode 100644
index 00000000..5677b9c0
--- /dev/null
+++ b/src/thread/superh/syscall_cp.s
@@ -0,0 +1,39 @@
+.text
+.global __syscall_cp_asm
+.type __syscall_cp_asm, @function
+__syscall_cp_asm:
+
+.global __cp_begin
+__cp_begin:
+ mov.l @r4, r4
+ tst r4, r4
+ bt 2f
+
+ mov.l L1, r0
+ braf r0
+ nop
+1:
+
+.align 2
+L1: .long __cancel@PLT-(1b-.)
+
+2: mov r5, r3
+ mov r6, r4
+ mov r7, r5
+ mov.l @r15, r6
+ mov.l @(4,r15), r7
+ mov.l @(8,r15), r0
+ mov.l @(12,r15), r1
+ trapa #22
+
+.global __cp_end
+__cp_end:
+ ! work around hardware bug
+ or r0, r0
+ or r0, r0
+ or r0, r0
+ or r0, r0
+ or r0, r0
+
+ rts
+ nop