aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel
diff options
context:
space:
mode:
authorFranck Bui-Huu <fbuihuu@gmail.com>2007-02-05 09:24:24 -0500
committerRalf Baechle <ralf@linux-mips.org>2007-02-10 17:38:46 -0500
commit722bb63de630f9500db1f12ed32e1dd9349a8049 (patch)
treea4579b19efc69adb05e486cc0f64d18f1b85cc92 /arch/mips/kernel
parent601dde45f698ee1be5fe03a68b895efe6ca6b858 (diff)
[MIPS] signal: factorize debug code
Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/signal-common.h8
-rw-r--r--arch/mips/kernel/signal.c13
-rw-r--r--arch/mips/kernel/signal32.c16
-rw-r--r--arch/mips/kernel/signal_n32.c7
4 files changed, 20 insertions, 24 deletions
diff --git a/arch/mips/kernel/signal-common.h b/arch/mips/kernel/signal-common.h
index 6700bde06053..9a8abd67ec5c 100644
--- a/arch/mips/kernel/signal-common.h
+++ b/arch/mips/kernel/signal-common.h
@@ -11,6 +11,14 @@
11#ifndef __SIGNAL_COMMON_H 11#ifndef __SIGNAL_COMMON_H
12#define __SIGNAL_COMMON_H 12#define __SIGNAL_COMMON_H
13 13
14/* #define DEBUG_SIG */
15
16#ifdef DEBUG_SIG
17# define DEBUGP(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ##args)
18#else
19# define DEBUGP(fmt, args...)
20#endif
21
14/* 22/*
15 * Horribly complicated - with the bloody RM9000 workarounds enabled 23 * Horribly complicated - with the bloody RM9000 workarounds enabled
16 * the signal trampolines is moving to the end of the structure so we can 24 * the signal trampolines is moving to the end of the structure so we can
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index d676805a34ba..a5adab1c94c3 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -34,8 +34,6 @@
34 34
35#include "signal-common.h" 35#include "signal-common.h"
36 36
37#define DEBUG_SIG 0
38
39#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 37#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
40 38
41#if ICACHE_REFILLS_WORKAROUND_WAR == 0 39#if ICACHE_REFILLS_WORKAROUND_WAR == 0
@@ -424,11 +422,9 @@ int setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
424 regs->regs[31] = (unsigned long) frame->sf_code; 422 regs->regs[31] = (unsigned long) frame->sf_code;
425 regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; 423 regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
426 424
427#if DEBUG_SIG 425 DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
428 printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
429 current->comm, current->pid, 426 current->comm, current->pid,
430 frame, regs->cp0_epc, frame->regs[31]); 427 frame, regs->cp0_epc, regs->regs[31]);
431#endif
432 return 0; 428 return 0;
433 429
434give_sigsegv: 430give_sigsegv:
@@ -484,11 +480,10 @@ int setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
484 regs->regs[31] = (unsigned long) frame->rs_code; 480 regs->regs[31] = (unsigned long) frame->rs_code;
485 regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; 481 regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
486 482
487#if DEBUG_SIG 483 DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
488 printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
489 current->comm, current->pid, 484 current->comm, current->pid,
490 frame, regs->cp0_epc, regs->regs[31]); 485 frame, regs->cp0_epc, regs->regs[31]);
491#endif 486
492 return 0; 487 return 0;
493 488
494give_sigsegv: 489give_sigsegv:
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index 5934f33224f8..1a99a57739e1 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -104,8 +104,6 @@ typedef struct compat_siginfo {
104#define __NR_O32_rt_sigreturn 4193 104#define __NR_O32_rt_sigreturn 4193
105#define __NR_O32_restart_syscall 4253 105#define __NR_O32_restart_syscall 4253
106 106
107#define DEBUG_SIG 0
108
109#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 107#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
110 108
111/* 32-bit compatibility types */ 109/* 32-bit compatibility types */
@@ -640,11 +638,10 @@ int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
640 regs->regs[31] = (unsigned long) frame->sf_code; 638 regs->regs[31] = (unsigned long) frame->sf_code;
641 regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; 639 regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
642 640
643#if DEBUG_SIG 641 DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
644 printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
645 current->comm, current->pid, 642 current->comm, current->pid,
646 frame, regs->cp0_epc, frame->sf_code); 643 frame, regs->cp0_epc, regs->regs[31]);
647#endif 644
648 return 0; 645 return 0;
649 646
650give_sigsegv: 647give_sigsegv:
@@ -701,11 +698,10 @@ int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
701 regs->regs[31] = (unsigned long) frame->rs_code; 698 regs->regs[31] = (unsigned long) frame->rs_code;
702 regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; 699 regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
703 700
704#if DEBUG_SIG 701 DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
705 printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
706 current->comm, current->pid, 702 current->comm, current->pid,
707 frame, regs->cp0_epc, frame->rs_code); 703 frame, regs->cp0_epc, regs->regs[31]);
708#endif 704
709 return 0; 705 return 0;
710 706
711give_sigsegv: 707give_sigsegv:
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
index 192073ee098f..1d4f39cd0386 100644
--- a/arch/mips/kernel/signal_n32.c
+++ b/arch/mips/kernel/signal_n32.c
@@ -47,8 +47,6 @@
47#define __NR_N32_rt_sigreturn 6211 47#define __NR_N32_rt_sigreturn 6211
48#define __NR_N32_restart_syscall 6214 48#define __NR_N32_restart_syscall 6214
49 49
50#define DEBUG_SIG 0
51
52#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 50#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
53 51
54/* IRIX compatible stack_t */ 52/* IRIX compatible stack_t */
@@ -221,11 +219,10 @@ int setup_rt_frame_n32(struct k_sigaction * ka,
221 regs->regs[31] = (unsigned long) frame->rs_code; 219 regs->regs[31] = (unsigned long) frame->rs_code;
222 regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; 220 regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
223 221
224#if DEBUG_SIG 222 DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
225 printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
226 current->comm, current->pid, 223 current->comm, current->pid,
227 frame, regs->cp0_epc, regs->regs[31]); 224 frame, regs->cp0_epc, regs->regs[31]);
228#endif 225
229 return 0; 226 return 0;
230 227
231give_sigsegv: 228give_sigsegv: