Commit a54f1655 authored by Al Viro's avatar Al Viro

m68k: add TIF_NOTIFY_RESUME and handle it.

TIF_NOTIFY_RESUME added (as bit 5).  That way nommu glue needs no changes at
all; mmu one needs just to replace jmi do_signal_return to jne do_signal_return
There we have flags shifted up, until bit 6 (SIGPENDING) is in MSBit; instead
of checking that MSBit is set (jmi) we check that MSBit or something below it
is set (jne); bits 0..4 are never set, so that's precisely "bit 6 or bit 5 is
set".

Usual handling of NOTIFY_RESUME/SIGPENDING is done in do_notify_resume(); glue
calls it instead of do_signal().
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 899dfaa7
...@@ -71,6 +71,7 @@ static inline struct thread_info *current_thread_info(void) ...@@ -71,6 +71,7 @@ static inline struct thread_info *current_thread_info(void)
* bits 0-7 are tested at every exception exit * bits 0-7 are tested at every exception exit
* bits 8-15 are also tested at syscall exit * bits 8-15 are also tested at syscall exit
*/ */
#define TIF_NOTIFY_RESUME 5 /* callback before returning to user */
#define TIF_SIGPENDING 6 /* signal pending */ #define TIF_SIGPENDING 6 /* signal pending */
#define TIF_NEED_RESCHED 7 /* rescheduling necessary */ #define TIF_NEED_RESCHED 7 /* rescheduling necessary */
#define TIF_DELAYED_TRACE 14 /* single step a syscall */ #define TIF_DELAYED_TRACE 14 /* single step a syscall */
......
...@@ -148,7 +148,7 @@ syscall_exit_work: ...@@ -148,7 +148,7 @@ syscall_exit_work:
jcs do_trace_exit jcs do_trace_exit
jmi do_delayed_trace jmi do_delayed_trace
lslw #8,%d0 lslw #8,%d0
jmi do_signal_return jne do_signal_return
pea resume_userspace pea resume_userspace
jra schedule jra schedule
...@@ -172,7 +172,7 @@ exit_work: ...@@ -172,7 +172,7 @@ exit_work:
| save top of frame | save top of frame
movel %sp,%curptr@(TASK_THREAD+THREAD_ESP0) movel %sp,%curptr@(TASK_THREAD+THREAD_ESP0)
lslb #1,%d0 lslb #1,%d0
jmi do_signal_return jne do_signal_return
pea resume_userspace pea resume_userspace
jra schedule jra schedule
...@@ -182,7 +182,7 @@ do_signal_return: ...@@ -182,7 +182,7 @@ do_signal_return:
subql #4,%sp | dummy return address subql #4,%sp | dummy return address
SAVE_SWITCH_STACK SAVE_SWITCH_STACK
pea %sp@(SWITCH_STACK_SIZE) pea %sp@(SWITCH_STACK_SIZE)
bsrl do_signal bsrl do_notify_resume
addql #4,%sp addql #4,%sp
RESTORE_SWITCH_STACK RESTORE_SWITCH_STACK
addql #4,%sp addql #4,%sp
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/binfmts.h> #include <linux/binfmts.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/tracehook.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -1154,7 +1155,7 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -1154,7 +1155,7 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
* want to handle. Thus you cannot kill init even with a SIGKILL even by * want to handle. Thus you cannot kill init even with a SIGKILL even by
* mistake. * mistake.
*/ */
asmlinkage void do_signal(struct pt_regs *regs) static void do_signal(struct pt_regs *regs)
{ {
siginfo_t info; siginfo_t info;
struct k_sigaction ka; struct k_sigaction ka;
...@@ -1186,3 +1187,15 @@ asmlinkage void do_signal(struct pt_regs *regs) ...@@ -1186,3 +1187,15 @@ asmlinkage void do_signal(struct pt_regs *regs)
sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
} }
} }
void do_notify_resume(struct pt_regs *regs)
{
if (test_thread_flag(TIF_SIGPENDING))
do_signal(regs);
if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME)) {
tracehook_notify_resume(regs);
if (current->replacement_session_keyring)
key_replace_session_keyring();
}
}
...@@ -119,7 +119,7 @@ Lsignal_return: ...@@ -119,7 +119,7 @@ Lsignal_return:
subql #4,%sp /* dummy return address*/ subql #4,%sp /* dummy return address*/
SAVE_SWITCH_STACK SAVE_SWITCH_STACK
pea %sp@(SWITCH_STACK_SIZE) pea %sp@(SWITCH_STACK_SIZE)
bsrw do_signal bsrw do_notify_resume
addql #4,%sp addql #4,%sp
RESTORE_SWITCH_STACK RESTORE_SWITCH_STACK
addql #4,%sp addql #4,%sp
......
...@@ -115,7 +115,7 @@ Lsignal_return: ...@@ -115,7 +115,7 @@ Lsignal_return:
subql #4,%sp /* dummy return address*/ subql #4,%sp /* dummy return address*/
SAVE_SWITCH_STACK SAVE_SWITCH_STACK
pea %sp@(SWITCH_STACK_SIZE) pea %sp@(SWITCH_STACK_SIZE)
bsrw do_signal bsrw do_notify_resume
addql #4,%sp addql #4,%sp
RESTORE_SWITCH_STACK RESTORE_SWITCH_STACK
addql #4,%sp addql #4,%sp
......
...@@ -152,7 +152,7 @@ Lsignal_return: ...@@ -152,7 +152,7 @@ Lsignal_return:
subql #4,%sp /* dummy return address */ subql #4,%sp /* dummy return address */
SAVE_SWITCH_STACK SAVE_SWITCH_STACK
pea %sp@(SWITCH_STACK_SIZE) pea %sp@(SWITCH_STACK_SIZE)
jsr do_signal jsr do_notify_resume
addql #4,%sp addql #4,%sp
RESTORE_SWITCH_STACK RESTORE_SWITCH_STACK
addql #4,%sp addql #4,%sp
......
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