aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-04-24 02:30:16 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-21 23:59:48 -0400
commita53bb24e7666870bbc195e295a936aa0a58ce313 (patch)
treea6262e348507e0b391993649c70e21e72e1a2cb7 /arch/xtensa/kernel
parent8314019141e4f7274ea4dc264a47bbb2e17c66dd (diff)
xtensa: add handling of TIF_NOTIFY_RESUME
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/xtensa/kernel')
-rw-r--r--arch/xtensa/kernel/entry.S5
-rw-r--r--arch/xtensa/kernel/signal.c20
2 files changed, 19 insertions, 6 deletions
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S
index b1bb6d79d8b9..7e6236073397 100644
--- a/arch/xtensa/kernel/entry.S
+++ b/arch/xtensa/kernel/entry.S
@@ -409,14 +409,15 @@ common_exception_return:
409 l32i a4, a2, TI_FLAGS 409 l32i a4, a2, TI_FLAGS
410 410
411 _bbsi.l a4, TIF_NEED_RESCHED, 3f 411 _bbsi.l a4, TIF_NEED_RESCHED, 3f
412 _bbsi.l a4, TIF_NOTIFY_RESUME, 2f
412 _bbci.l a4, TIF_SIGPENDING, 4f 413 _bbci.l a4, TIF_SIGPENDING, 4f
413 414
414 l32i a4, a1, PT_DEPC 4152: l32i a4, a1, PT_DEPC
415 bgeui a4, VALID_DOUBLE_EXCEPTION_ADDRESS, 4f 416 bgeui a4, VALID_DOUBLE_EXCEPTION_ADDRESS, 4f
416 417
417 /* Call do_signal() */ 418 /* Call do_signal() */
418 419
419 movi a4, do_signal # int do_signal(struct pt_regs*, sigset_t*) 420 movi a4, do_notify_resume # int do_notify_resume(struct pt_regs*)
420 mov a6, a1 421 mov a6, a1
421 callx4 a4 422 callx4 a4
422 j 1b 423 j 1b
diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c
index bb00cc470ca9..c5e4ec0598d2 100644
--- a/arch/xtensa/kernel/signal.c
+++ b/arch/xtensa/kernel/signal.c
@@ -20,6 +20,7 @@
20#include <linux/ptrace.h> 20#include <linux/ptrace.h>
21#include <linux/personality.h> 21#include <linux/personality.h>
22#include <linux/freezer.h> 22#include <linux/freezer.h>
23#include <linux/tracehook.h>
23 24
24#include <asm/ucontext.h> 25#include <asm/ucontext.h>
25#include <asm/uaccess.h> 26#include <asm/uaccess.h>
@@ -446,16 +447,13 @@ asmlinkage long xtensa_sigaltstack(const stack_t __user *uss,
446 * the kernel can handle, and then we build all the user-level signal handling 447 * the kernel can handle, and then we build all the user-level signal handling
447 * stack-frames in one go after that. 448 * stack-frames in one go after that.
448 */ 449 */
449void do_signal(struct pt_regs *regs) 450static void do_signal(struct pt_regs *regs)
450{ 451{
451 siginfo_t info; 452 siginfo_t info;
452 int signr; 453 int signr;
453 struct k_sigaction ka; 454 struct k_sigaction ka;
454 sigset_t oldset; 455 sigset_t oldset;
455 456
456 if (!user_mode(regs))
457 return;
458
459 if (try_to_freeze()) 457 if (try_to_freeze())
460 goto no_signal; 458 goto no_signal;
461 459
@@ -542,3 +540,17 @@ no_signal:
542 return; 540 return;
543} 541}
544 542
543void do_notify_resume(struct pt_regs *regs)
544{
545 if (!user_mode(regs))
546 return;
547
548 if (test_thread_flag(TIF_SIGPENDING))
549 do_signal(regs);
550
551 if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME)) {
552 tracehook_notify_resume(regs);
553 if (current->replacement_session_keyring)
554 key_replace_session_keyring();
555 }
556}