summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/xtensa/sigrestorer.S
diff options
context:
space:
mode:
authorChris Zankel <chris@zankel.net>2008-02-20 00:30:54 +0000
committerChris Zankel <chris@zankel.net>2008-02-20 00:30:54 +0000
commitd8f106289ffc338f15568f373b209f0c47755a54 (patch)
tree68d366e9f056bd36acb747c69cd02e5d595e2467 /libc/sysdeps/linux/xtensa/sigrestorer.S
parent5bb327a1dbe37208a812a9134763aa5adfa90e12 (diff)
Xtensa: Provide an architecture specific sigaction and sa_restorer function in libc to avoid having to place executable code on stack.
Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'libc/sysdeps/linux/xtensa/sigrestorer.S')
-rw-r--r--libc/sysdeps/linux/xtensa/sigrestorer.S19
1 files changed, 19 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/xtensa/sigrestorer.S b/libc/sysdeps/linux/xtensa/sigrestorer.S
new file mode 100644
index 000000000..474a89319
--- /dev/null
+++ b/libc/sysdeps/linux/xtensa/sigrestorer.S
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2008 Tensilica Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#if __NR_rt_sigreturn > 255
+# error value of __NR_rt_sigreturn is too big!
+#endif
+
+ .text
+ .align 4
+ .global __default_sa_restorer
+ .type __default_sa_restorer, @function
+__default_sa_restorer:
+ movi a2, __NR_rt_sigreturn
+ syscall