summaryrefslogtreecommitdiffstats
path: root/libc/arch-sh
diff options
context:
space:
mode:
authorAndrei Popescu <andreip@google.com>2010-02-25 13:27:46 +0000
committerAndrei Popescu <andreip@google.com>2010-03-02 11:43:24 +0000
commiteb9d5ed3477ef8cd9ccfa424ea585541ea3af84a (patch)
tree57860bc44d54d743b05f8a7680267170af3f3069 /libc/arch-sh
parent8f8b5310d2c3fe8782377bd66b65ed14dc6511a4 (diff)
downloadbionic-eb9d5ed3477ef8cd9ccfa424ea585541ea3af84a.zip
bionic-eb9d5ed3477ef8cd9ccfa424ea585541ea3af84a.tar.gz
bionic-eb9d5ed3477ef8cd9ccfa424ea585541ea3af84a.tar.bz2
add sigaltstack syscall
Diffstat (limited to 'libc/arch-sh')
-rw-r--r--libc/arch-sh/syscalls.mk1
-rw-r--r--libc/arch-sh/syscalls/sigaltstack.S32
2 files changed, 33 insertions, 0 deletions
diff --git a/libc/arch-sh/syscalls.mk b/libc/arch-sh/syscalls.mk
index ac12ae4..c848954 100644
--- a/libc/arch-sh/syscalls.mk
+++ b/libc/arch-sh/syscalls.mk
@@ -41,6 +41,7 @@ syscall_src += arch-sh/syscalls/chroot.S
syscall_src += arch-sh/syscalls/prctl.S
syscall_src += arch-sh/syscalls/capget.S
syscall_src += arch-sh/syscalls/capset.S
+syscall_src += arch-sh/syscalls/sigaltstack.S
syscall_src += arch-sh/syscalls/acct.S
syscall_src += arch-sh/syscalls/read.S
syscall_src += arch-sh/syscalls/write.S
diff --git a/libc/arch-sh/syscalls/sigaltstack.S b/libc/arch-sh/syscalls/sigaltstack.S
new file mode 100644
index 0000000..8b03e27
--- /dev/null
+++ b/libc/arch-sh/syscalls/sigaltstack.S
@@ -0,0 +1,32 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type sigaltstack, @function
+ .globl sigaltstack
+ .align 4
+
+sigaltstack:
+
+ /* invoke trap */
+ mov.l 0f, r3 /* trap num */
+ trapa #(2 + 0x10)
+
+ /* check return value */
+ cmp/pz r0
+ bt __NR_sigaltstack_end
+
+ /* keep error number */
+ sts.l pr, @-r15
+ mov.l 1f, r1
+ jsr @r1
+ mov r0, r4
+ lds.l @r15+, pr
+
+__NR_sigaltstack_end:
+ rts
+ nop
+
+ .align 2
+0: .long __NR_sigaltstack
+1: .long __set_syscall_errno