Commit 0bc87fc2 authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds

[PATCH] uml: redundant code removal from signal delivery

From: Bodo Stroesser <bstroesser@fujitsu-siemens.com>

Change the do_signal interface to eliminate its argument.  Also, remove the
calls from the system call handlers since they are redundant.  In all cases,
pending signals are checked for in the interrupt handler.

Temporarily, do_signal passes the current error to kern_do_signal.
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a0c257d9
......@@ -29,7 +29,7 @@ extern int kernel_thread_proc(void *data);
extern void syscall_segv(int sig);
extern int current_pid(void);
extern unsigned long alloc_stack(int order, int atomic);
extern int do_signal(int error);
extern int do_signal(void);
extern int is_stack_fault(unsigned long sp);
extern unsigned long segv(unsigned long address, unsigned long ip,
int is_write, int is_user, void *sc);
......
......@@ -141,7 +141,7 @@ void *_switch_to(void *prev, void *next, void *last)
void interrupt_end(void)
{
if(need_resched()) schedule();
if(test_tsk_thread_flag(current, TIF_SIGPENDING)) do_signal(0);
if(test_tsk_thread_flag(current, TIF_SIGPENDING)) do_signal();
}
void release_thread(struct task_struct *task)
......
......@@ -159,9 +159,10 @@ static int kern_do_signal(struct pt_regs *regs, sigset_t *oldset, int error)
return(0);
}
int do_signal(int error)
int do_signal(void)
{
return(kern_do_signal(&current->thread.regs, NULL, error));
return(kern_do_signal(&current->thread.regs, NULL,
PT_REGS_SYSCALL_RET(&current->thread.regs)));
}
/*
......
......@@ -10,10 +10,6 @@
#include "sysdep/ptrace.h"
#include "sysdep/sigcontext.h"
/* XXX Bogus */
#define ERESTARTSYS 512
#define ERESTARTNOINTR 513
#define ERESTARTNOHAND 514
void handle_syscall(union uml_pt_regs *regs)
{
......@@ -26,9 +22,6 @@ void handle_syscall(union uml_pt_regs *regs)
result = execute_syscall(regs);
REGS_SET_SYSCALL_RETURN(regs->skas.regs, result);
if((result == -ERESTARTNOHAND) || (result == -ERESTARTSYS) ||
(result == -ERESTARTNOINTR))
do_signal(result);
syscall_trace(regs, 1);
record_syscall_end(index, result);
......
......@@ -17,10 +17,6 @@
#include "syscall_user.h"
#include "tt.h"
/* XXX Bogus */
#define ERESTARTSYS 512
#define ERESTARTNOINTR 513
#define ERESTARTNOHAND 514
void syscall_handler_tt(int sig, union uml_pt_regs *regs)
{
......@@ -42,9 +38,6 @@ void syscall_handler_tt(int sig, union uml_pt_regs *regs)
UPT_SC(regs) = sc;
SC_SET_SYSCALL_RETURN(sc, result);
if((result == -ERESTARTNOHAND) || (result == -ERESTARTSYS) ||
(result == -ERESTARTNOINTR))
do_signal(result);
syscall_trace(regs, 1);
record_syscall_end(index, result);
......
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