Commit 722bb63d authored by Franck Bui-Huu's avatar Franck Bui-Huu Committed by Ralf Baechle

[MIPS] signal: factorize debug code

Signed-off-by: default avatarFranck Bui-Huu <fbuihuu@gmail.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 601dde45
...@@ -11,6 +11,14 @@ ...@@ -11,6 +11,14 @@
#ifndef __SIGNAL_COMMON_H #ifndef __SIGNAL_COMMON_H
#define __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 * Horribly complicated - with the bloody RM9000 workarounds enabled
* the signal trampolines is moving to the end of the structure so we can * the signal trampolines is moving to the end of the structure so we can
......
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
#include "signal-common.h" #include "signal-common.h"
#define DEBUG_SIG 0
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
#if ICACHE_REFILLS_WORKAROUND_WAR == 0 #if ICACHE_REFILLS_WORKAROUND_WAR == 0
...@@ -424,11 +422,9 @@ int setup_frame(struct k_sigaction * ka, struct pt_regs *regs, ...@@ -424,11 +422,9 @@ int setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
regs->regs[31] = (unsigned long) frame->sf_code; regs->regs[31] = (unsigned long) frame->sf_code;
regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
#if DEBUG_SIG DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
current->comm, current->pid, current->comm, current->pid,
frame, regs->cp0_epc, frame->regs[31]); frame, regs->cp0_epc, regs->regs[31]);
#endif
return 0; return 0;
give_sigsegv: give_sigsegv:
...@@ -484,11 +480,10 @@ int setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs, ...@@ -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->regs[31] = (unsigned long) frame->rs_code;
regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
#if DEBUG_SIG DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
current->comm, current->pid, current->comm, current->pid,
frame, regs->cp0_epc, regs->regs[31]); frame, regs->cp0_epc, regs->regs[31]);
#endif
return 0; return 0;
give_sigsegv: give_sigsegv:
......
...@@ -104,8 +104,6 @@ typedef struct compat_siginfo { ...@@ -104,8 +104,6 @@ typedef struct compat_siginfo {
#define __NR_O32_rt_sigreturn 4193 #define __NR_O32_rt_sigreturn 4193
#define __NR_O32_restart_syscall 4253 #define __NR_O32_restart_syscall 4253
#define DEBUG_SIG 0
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
/* 32-bit compatibility types */ /* 32-bit compatibility types */
...@@ -640,11 +638,10 @@ int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs, ...@@ -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->regs[31] = (unsigned long) frame->sf_code;
regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
#if DEBUG_SIG DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
current->comm, current->pid, current->comm, current->pid,
frame, regs->cp0_epc, frame->sf_code); frame, regs->cp0_epc, regs->regs[31]);
#endif
return 0; return 0;
give_sigsegv: give_sigsegv:
...@@ -701,11 +698,10 @@ int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs, ...@@ -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->regs[31] = (unsigned long) frame->rs_code;
regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
#if DEBUG_SIG DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
current->comm, current->pid, current->comm, current->pid,
frame, regs->cp0_epc, frame->rs_code); frame, regs->cp0_epc, regs->regs[31]);
#endif
return 0; return 0;
give_sigsegv: give_sigsegv:
......
...@@ -47,8 +47,6 @@ ...@@ -47,8 +47,6 @@
#define __NR_N32_rt_sigreturn 6211 #define __NR_N32_rt_sigreturn 6211
#define __NR_N32_restart_syscall 6214 #define __NR_N32_restart_syscall 6214
#define DEBUG_SIG 0
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
/* IRIX compatible stack_t */ /* IRIX compatible stack_t */
...@@ -221,11 +219,10 @@ int setup_rt_frame_n32(struct k_sigaction * ka, ...@@ -221,11 +219,10 @@ int setup_rt_frame_n32(struct k_sigaction * ka,
regs->regs[31] = (unsigned long) frame->rs_code; regs->regs[31] = (unsigned long) frame->rs_code;
regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
#if DEBUG_SIG DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
current->comm, current->pid, current->comm, current->pid,
frame, regs->cp0_epc, regs->regs[31]); frame, regs->cp0_epc, regs->regs[31]);
#endif
return 0; return 0;
give_sigsegv: give_sigsegv:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment