aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/signal.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2005-05-31 07:49:19 -0400
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 14:31:17 -0400
commite50c0a8fa60da9ac0e0a70caa8a3a803815c1f2f (patch)
tree1928e8b0a4b7fb615e5a9f65dc934ba2e74cb9cd /arch/mips/kernel/signal.c
parent10f650db1bcc193ea07d4f8c2f07315da38ea0c4 (diff)
Support the MIPS32 / MIPS64 DSP ASE.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/signal.c')
-rw-r--r--arch/mips/kernel/signal.c52
1 files changed, 10 insertions, 42 deletions
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index eb127230cc9a..8504febf8b22 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -21,6 +21,7 @@
21#include <linux/unistd.h> 21#include <linux/unistd.h>
22#include <linux/compiler.h> 22#include <linux/compiler.h>
23 23
24#include <asm/abi.h>
24#include <asm/asm.h> 25#include <asm/asm.h>
25#include <linux/bitops.h> 26#include <linux/bitops.h>
26#include <asm/cacheflush.h> 27#include <asm/cacheflush.h>
@@ -36,7 +37,7 @@
36 37
37#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 38#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
38 39
39static int do_signal(sigset_t *oldset, struct pt_regs *regs); 40int do_signal(sigset_t *oldset, struct pt_regs *regs);
40 41
41/* 42/*
42 * Atomically swap in the new signal mask, and wait for a signal. 43 * Atomically swap in the new signal mask, and wait for a signal.
@@ -216,7 +217,7 @@ _sys_sigreturn(nabi_no_regargs struct pt_regs regs)
216badframe: 217badframe:
217 force_sig(SIGSEGV, current); 218 force_sig(SIGSEGV, current);
218} 219}
219#endif 220#endif /* CONFIG_TRAD_SIGNALS */
220 221
221save_static_function(sys_rt_sigreturn); 222save_static_function(sys_rt_sigreturn);
222__attribute_used__ noinline static void 223__attribute_used__ noinline static void
@@ -262,7 +263,7 @@ badframe:
262} 263}
263 264
264#ifdef CONFIG_TRAD_SIGNALS 265#ifdef CONFIG_TRAD_SIGNALS
265static void inline setup_frame(struct k_sigaction * ka, struct pt_regs *regs, 266void setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
266 int signr, sigset_t *set) 267 int signr, sigset_t *set)
267{ 268{
268 struct sigframe *frame; 269 struct sigframe *frame;
@@ -318,7 +319,7 @@ give_sigsegv:
318} 319}
319#endif 320#endif
320 321
321static void inline setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs, 322void setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
322 int signr, sigset_t *set, siginfo_t *info) 323 int signr, sigset_t *set, siginfo_t *info)
323{ 324{
324 struct rt_sigframe *frame; 325 struct rt_sigframe *frame;
@@ -410,22 +411,10 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info,
410 411
411 regs->regs[0] = 0; /* Don't deal with this again. */ 412 regs->regs[0] = 0; /* Don't deal with this again. */
412 413
413#ifdef CONFIG_TRAD_SIGNALS 414 if (sig_uses_siginfo(ka))
414 if (ka->sa.sa_flags & SA_SIGINFO) { 415 current->thread.abi->setup_rt_frame(ka, regs, sig, oldset, info);
415#else
416 if (1) {
417#endif
418#ifdef CONFIG_MIPS32_N32
419 if ((current->thread.mflags & MF_ABI_MASK) == MF_N32)
420 setup_rt_frame_n32 (ka, regs, sig, oldset, info);
421 else
422#endif
423 setup_rt_frame(ka, regs, sig, oldset, info);
424 }
425#ifdef CONFIG_TRAD_SIGNALS
426 else 416 else
427 setup_frame(ka, regs, sig, oldset); 417 current->thread.abi->setup_frame(ka, regs, sig, oldset);
428#endif
429 418
430 spin_lock_irq(&current->sighand->siglock); 419 spin_lock_irq(&current->sighand->siglock);
431 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 420 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
@@ -435,21 +424,12 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info,
435 spin_unlock_irq(&current->sighand->siglock); 424 spin_unlock_irq(&current->sighand->siglock);
436} 425}
437 426
438extern int do_signal32(sigset_t *oldset, struct pt_regs *regs); 427int do_signal(sigset_t *oldset, struct pt_regs *regs)
439extern int do_irix_signal(sigset_t *oldset, struct pt_regs *regs);
440
441static int do_signal(sigset_t *oldset, struct pt_regs *regs)
442{ 428{
443 struct k_sigaction ka; 429 struct k_sigaction ka;
444 siginfo_t info; 430 siginfo_t info;
445 int signr; 431 int signr;
446 432
447#ifdef CONFIG_BINFMT_ELF32
448 if ((current->thread.mflags & MF_ABI_MASK) == MF_O32) {
449 return do_signal32(oldset, regs);
450 }
451#endif
452
453 /* 433 /*
454 * We want the common case to go fast, which is why we may in certain 434 * We want the common case to go fast, which is why we may in certain
455 * cases get here from kernel mode. Just return without doing anything 435 * cases get here from kernel mode. Just return without doing anything
@@ -501,18 +481,6 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, sigset_t *oldset,
501{ 481{
502 /* deal with pending signal delivery */ 482 /* deal with pending signal delivery */
503 if (thread_info_flags & _TIF_SIGPENDING) { 483 if (thread_info_flags & _TIF_SIGPENDING) {
504#ifdef CONFIG_BINFMT_ELF32 484 current->thread.abi->do_signal(oldset, regs);
505 if (likely((current->thread.mflags & MF_ABI_MASK) == MF_O32)) {
506 do_signal32(oldset, regs);
507 return;
508 }
509#endif
510#ifdef CONFIG_BINFMT_IRIX
511 if (unlikely(current->personality != PER_LINUX)) {
512 do_irix_signal(oldset, regs);
513 return;
514 }
515#endif
516 do_signal(oldset, regs);
517 } 485 }
518} 486}