#define _KLIBC_ARCHCONFIG_H
#define _KLIBC_USE_RT_SIG 1
+/* We provide our own restorer that call rt_sigreturn() */
+#define _KLIBC_NEEDS_SA_SIGINFO 1
#define _KLIBC_STATFS_F_TYPE_64 0
#endif /* _KLIBC_ARCHCONFIG_H */
always := crt0.o
targets := crt0.o
-klib-y := pipe.o setjmp.o syscall.o sysdual.o
+klib-y := pipe.o setjmp.o sigreturn.o syscall.o sysdual.o
# Special CFLAGS for the divide code
DIVCFLAGS = $(KLIBCREQFLAGS) $(KLIBCARCHREQFLAGS) \
# the binary.
KLIBCSHAREDFLAGS = -Ttext-segment 0x1c0000000
-# Kernel uses stack trampoline for signal return unless we set
-# sa_restorer
-KLIBCEXECSTACK := y
+# Kernel uses our sa_restorer for signal return
+KLIBCEXECSTACK := n
--- /dev/null
+/*
+ * arch/alpha/sigreturn.S
+ */
+
+#include <machine/asm.h>
+#include <asm/unistd.h>
+
+ .text
+ .align 3
+ .type __sigreturn,@function
+ .ent __sigreturn,0
+ .globl __sigreturn
+__sigreturn:
+ mov sp,a0 # struct sigcontext on stack
+ lda v0,__NR_rt_sigreturn(zero)
+ callsys
+ .size __sigreturn,.-__sigreturn
+ .end __sigreturn
void (*)(void), size_t);
#elif defined(__alpha__)
__extern int __rt_sigaction(int, const struct sigaction *, struct sigaction *,
- size_t, void *);
+ size_t, void (*)(void));
#else
__extern int __rt_sigaction(int, const struct sigaction *, struct sigaction *,
size_t);
rv = __rt_sigaction(sig, act, oact, restorer, sizeof(sigset_t));
}
# elif defined(__alpha__)
- rv = __rt_sigaction(sig, act, oact, sizeof(sigset_t), NULL);
+ rv = __rt_sigaction(sig, act, oact, sizeof(sigset_t), &__sigreturn);
# else
rv = __rt_sigaction(sig, act, oact, sizeof(sigset_t));
# endif