aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFranck Bui-Huu <fbuihuu@gmail.com>2007-02-05 09:24:22 -0500
committerRalf Baechle <ralf@linux-mips.org>2007-02-10 17:38:46 -0500
commit36a1f2c24f42fc2531d5e21914db56ce8ee346f6 (patch)
tree4d855436df1c3c1359c83913580cd718ba57c859
parentc0b9bae9d18980afa1797fb7b75adb4fbc837b66 (diff)
[MIPS] signal32: remove duplicate code
There's no point for signal32.c to redefine get_sigframe(). It should use the one define in signal.c instead. The same stands for install_sigtramp(). Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/kernel/signal32.c50
1 files changed, 4 insertions, 46 deletions
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index e0a855331826..5934f33224f8 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -33,6 +33,8 @@
33#include <asm/fpu.h> 33#include <asm/fpu.h>
34#include <asm/war.h> 34#include <asm/war.h>
35 35
36#include "signal-common.h"
37
36#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) 38#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3)
37 39
38typedef struct compat_siginfo { 40typedef struct compat_siginfo {
@@ -604,32 +606,6 @@ out:
604 return err; 606 return err;
605} 607}
606 608
607/*
608 * Determine which stack to use..
609 */
610static inline void __user *get_sigframe(struct k_sigaction *ka,
611 struct pt_regs *regs,
612 size_t frame_size)
613{
614 unsigned long sp;
615
616 /* Default to using normal stack */
617 sp = regs->regs[29];
618
619 /*
620 * FPU emulator may have it's own trampoline active just
621 * above the user stack, 16-bytes before the next lowest
622 * 16 byte boundary. Try to avoid trashing it.
623 */
624 sp -= 32;
625
626 /* This is the X/Open sanctioned signal stack switching. */
627 if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags (sp) == 0))
628 sp = current->sas_ss_sp + current->sas_ss_size;
629
630 return (void __user *)((sp - frame_size) & ALMASK);
631}
632
633int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs, 609int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
634 int signr, sigset_t *set) 610 int signr, sigset_t *set)
635{ 611{
@@ -640,15 +616,7 @@ int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
640 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) 616 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
641 goto give_sigsegv; 617 goto give_sigsegv;
642 618
643 /* 619 err |= install_sigtramp(frame->sf_code, __NR_O32_sigreturn);
644 * Set up the return code ...
645 *
646 * li v0, __NR_O32_sigreturn
647 * syscall
648 */
649 err |= __put_user(0x24020000 + __NR_O32_sigreturn, frame->sf_code + 0);
650 err |= __put_user(0x0000000c , frame->sf_code + 1);
651 flush_cache_sigtramp((unsigned long) frame->sf_code);
652 620
653 err |= setup_sigcontext32(regs, &frame->sf_sc); 621 err |= setup_sigcontext32(regs, &frame->sf_sc);
654 err |= __copy_to_user(&frame->sf_mask, set, sizeof(*set)); 622 err |= __copy_to_user(&frame->sf_mask, set, sizeof(*set));
@@ -695,17 +663,7 @@ int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
695 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) 663 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
696 goto give_sigsegv; 664 goto give_sigsegv;
697 665
698 /* Set up to return from userspace. If provided, use a stub already 666 err |= install_sigtramp(frame->rs_code, __NR_O32_rt_sigreturn);
699 in userspace. */
700 /*
701 * Set up the return code ...
702 *
703 * li v0, __NR_O32_rt_sigreturn
704 * syscall
705 */
706 err |= __put_user(0x24020000 + __NR_O32_rt_sigreturn, frame->rs_code + 0);
707 err |= __put_user(0x0000000c , frame->rs_code + 1);
708 flush_cache_sigtramp((unsigned long) frame->rs_code);
709 667
710 /* Convert (siginfo_t -> compat_siginfo_t) and copy to user. */ 668 /* Convert (siginfo_t -> compat_siginfo_t) and copy to user. */
711 err |= copy_siginfo_to_user32(&frame->rs_info, info); 669 err |= copy_siginfo_to_user32(&frame->rs_info, info);