[MIPS] signal: factorize debug code
authorFranck Bui-Huu <fbuihuu@gmail.com>
Mon, 5 Feb 2007 14:24:24 +0000 (15:24 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Sat, 10 Feb 2007 22:38:46 +0000 (22:38 +0000)
Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/signal-common.h
arch/mips/kernel/signal.c
arch/mips/kernel/signal32.c
arch/mips/kernel/signal_n32.c

index 6700bde06053e9bf22b8bcca6e41e733d9882414..9a8abd67ec5c94a0bad855251f296d2f07be8bf3 100644 (file)
 #ifndef __SIGNAL_COMMON_H
 #define __SIGNAL_COMMON_H
 
+/* #define DEBUG_SIG */
+
+#ifdef DEBUG_SIG
+#  define DEBUGP(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ##args)
+#else
+#  define DEBUGP(fmt, args...)
+#endif
+
 /*
  * Horribly complicated - with the bloody RM9000 workarounds enabled
  * the signal trampolines is moving to the end of the structure so we can
index d676805a34ba053ef7b88fe6eb5fdd977ec2219c..a5adab1c94c365ea0b045b957de5b07131d39a86 100644 (file)
@@ -34,8 +34,6 @@
 
 #include "signal-common.h"
 
-#define DEBUG_SIG 0
-
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
 #if ICACHE_REFILLS_WORKAROUND_WAR == 0
@@ -424,11 +422,9 @@ int setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
        regs->regs[31] = (unsigned long) frame->sf_code;
        regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
 
-#if DEBUG_SIG
-       printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
+       DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
               current->comm, current->pid,
-              frame, regs->cp0_epc, frame->regs[31]);
-#endif
+              frame, regs->cp0_epc, regs->regs[31]);
        return 0;
 
 give_sigsegv:
@@ -484,11 +480,10 @@ int setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
        regs->regs[31] = (unsigned long) frame->rs_code;
        regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
 
-#if DEBUG_SIG
-       printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
+       DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
               current->comm, current->pid,
               frame, regs->cp0_epc, regs->regs[31]);
-#endif
+
        return 0;
 
 give_sigsegv:
index 5934f33224f8b63eb14e78c1bcc6633b2c8d89c1..1a99a57739e1a2f97cc257532fa565fb1ee3c25a 100644 (file)
@@ -104,8 +104,6 @@ typedef struct compat_siginfo {
 #define __NR_O32_rt_sigreturn          4193
 #define __NR_O32_restart_syscall       4253
 
-#define DEBUG_SIG 0
-
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
 /* 32-bit compatibility types */
@@ -640,11 +638,10 @@ int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
        regs->regs[31] = (unsigned long) frame->sf_code;
        regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
 
-#if DEBUG_SIG
-       printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
+       DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
               current->comm, current->pid,
-              frame, regs->cp0_epc, frame->sf_code);
-#endif
+              frame, regs->cp0_epc, regs->regs[31]);
+
        return 0;
 
 give_sigsegv:
@@ -701,11 +698,10 @@ int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
        regs->regs[31] = (unsigned long) frame->rs_code;
        regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
 
-#if DEBUG_SIG
-       printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
+       DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
               current->comm, current->pid,
-              frame, regs->cp0_epc, frame->rs_code);
-#endif
+              frame, regs->cp0_epc, regs->regs[31]);
+
        return 0;
 
 give_sigsegv:
index 192073ee098f370d65f2b2c730d46ba1c3b0e474..1d4f39cd03869a91b4609a6f1256d4aec473a28b 100644 (file)
@@ -47,8 +47,6 @@
 #define __NR_N32_rt_sigreturn          6211
 #define __NR_N32_restart_syscall       6214
 
-#define DEBUG_SIG 0
-
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
 /* IRIX compatible stack_t  */
@@ -221,11 +219,10 @@ int setup_rt_frame_n32(struct k_sigaction * ka,
        regs->regs[31] = (unsigned long) frame->rs_code;
        regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
 
-#if DEBUG_SIG
-       printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
+       DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
               current->comm, current->pid,
               frame, regs->cp0_epc, regs->regs[31]);
-#endif
+
        return 0;
 
 give_sigsegv: