diff options
author | Barry Song <barry.song@analog.com> | 2009-12-08 04:55:37 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-12-15 00:16:52 -0500 |
commit | d1be2e485bfb5e3ee3ef5d2131f0151f9a3c4387 (patch) | |
tree | 58cb8950840e263f2f1e0dd9d18a5a6df0aa7578 /arch/blackfin | |
parent | 88f7c2fb0fa96887c7be8cdb00afb1a6f9d7894e (diff) |
Blackfin: add support for TIF_NOTIFY_RESUME
Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/include/asm/thread_info.h | 2 | ||||
-rw-r--r-- | arch/blackfin/kernel/signal.c | 18 | ||||
-rw-r--r-- | arch/blackfin/mach-common/entry.S | 4 |
3 files changed, 23 insertions, 1 deletions
diff --git a/arch/blackfin/include/asm/thread_info.h b/arch/blackfin/include/asm/thread_info.h index afb3a8626380..a40d9368c38a 100644 --- a/arch/blackfin/include/asm/thread_info.h +++ b/arch/blackfin/include/asm/thread_info.h | |||
@@ -103,11 +103,13 @@ static inline struct thread_info *current_thread_info(void) | |||
103 | #define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ | 103 | #define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ |
104 | #define TIF_FREEZE 6 /* is freezing for suspend */ | 104 | #define TIF_FREEZE 6 /* is freezing for suspend */ |
105 | #define TIF_IRQ_SYNC 7 /* sync pipeline stage */ | 105 | #define TIF_IRQ_SYNC 7 /* sync pipeline stage */ |
106 | #define TIF_NOTIFY_RESUME 8 /* callback before returning to user */ | ||
106 | 107 | ||
107 | /* as above, but as bit values */ | 108 | /* as above, but as bit values */ |
108 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 109 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
109 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | 110 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) |
110 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 111 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
112 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) | ||
111 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 113 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
112 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | 114 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) |
113 | #define _TIF_FREEZE (1<<TIF_FREEZE) | 115 | #define _TIF_FREEZE (1<<TIF_FREEZE) |
diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c index 9d90c18fab23..e0fd63e9e38a 100644 --- a/arch/blackfin/kernel/signal.c +++ b/arch/blackfin/kernel/signal.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/binfmts.h> | 12 | #include <linux/binfmts.h> |
13 | #include <linux/freezer.h> | 13 | #include <linux/freezer.h> |
14 | #include <linux/uaccess.h> | 14 | #include <linux/uaccess.h> |
15 | #include <linux/tracehook.h> | ||
15 | 16 | ||
16 | #include <asm/cacheflush.h> | 17 | #include <asm/cacheflush.h> |
17 | #include <asm/ucontext.h> | 18 | #include <asm/ucontext.h> |
@@ -332,3 +333,20 @@ asmlinkage void do_signal(struct pt_regs *regs) | |||
332 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | 333 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); |
333 | } | 334 | } |
334 | } | 335 | } |
336 | |||
337 | /* | ||
338 | * notification of userspace execution resumption | ||
339 | */ | ||
340 | asmlinkage void do_notify_resume(struct pt_regs *regs) | ||
341 | { | ||
342 | if (test_thread_flag(TIF_SIGPENDING) || test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
343 | do_signal(regs); | ||
344 | |||
345 | if (test_thread_flag(TIF_NOTIFY_RESUME)) { | ||
346 | clear_thread_flag(TIF_NOTIFY_RESUME); | ||
347 | tracehook_notify_resume(regs); | ||
348 | if (current->replacement_session_keyring) | ||
349 | key_replace_session_keyring(); | ||
350 | } | ||
351 | } | ||
352 | |||
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S index f3f8bb46b517..b0ed0b487ff2 100644 --- a/arch/blackfin/mach-common/entry.S +++ b/arch/blackfin/mach-common/entry.S | |||
@@ -713,6 +713,8 @@ ENTRY(_system_call) | |||
713 | cc = BITTST(r7, TIF_RESTORE_SIGMASK); | 713 | cc = BITTST(r7, TIF_RESTORE_SIGMASK); |
714 | if cc jump .Lsyscall_do_signals; | 714 | if cc jump .Lsyscall_do_signals; |
715 | cc = BITTST(r7, TIF_SIGPENDING); | 715 | cc = BITTST(r7, TIF_SIGPENDING); |
716 | if cc jump .Lsyscall_do_signals; | ||
717 | cc = BITTST(r7, TIF_NOTIFY_RESUME); | ||
716 | if !cc jump .Lsyscall_really_exit; | 718 | if !cc jump .Lsyscall_really_exit; |
717 | .Lsyscall_do_signals: | 719 | .Lsyscall_do_signals: |
718 | /* Reenable interrupts. */ | 720 | /* Reenable interrupts. */ |
@@ -721,7 +723,7 @@ ENTRY(_system_call) | |||
721 | 723 | ||
722 | r0 = sp; | 724 | r0 = sp; |
723 | SP += -12; | 725 | SP += -12; |
724 | call _do_signal; | 726 | call _do_notify_resume; |
725 | SP += 12; | 727 | SP += 12; |
726 | 728 | ||
727 | .Lsyscall_really_exit: | 729 | .Lsyscall_really_exit: |