Commit 2bd1c1e2 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

[PATCH] PA-RISC signal handler fix

Fix singlestepping into a signal handler
Signed-off-by: default avatarRandolph Chung <tausq@parisc-linux.org>
Signed-off-by: default avatarMatthew Wilcox <willy@parisc-linux.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8eaa6900
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/offsets.h>
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
#include <linux/compat.h> #include <linux/compat.h>
...@@ -443,6 +444,18 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -443,6 +444,18 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
psw |= PSW_W; psw |= PSW_W;
#endif #endif
/* If we are singlestepping, arrange a trap to be delivered
when we return to userspace. Note the semantics -- we
should trap before the first insn in the handler is
executed. Ref:
http://sources.redhat.com/ml/gdb/2004-11/msg00245.html
*/
if (pa_psw(current)->r) {
pa_psw(current)->r = 0;
psw |= PSW_R;
mtctl(-1, 0);
}
regs->gr[0] = psw; regs->gr[0] = psw;
regs->iaoq[0] = haddr | 3; regs->iaoq[0] = haddr | 3;
regs->iaoq[1] = regs->iaoq[0] + 4; regs->iaoq[1] = regs->iaoq[0] + 4;
......
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