From: Jeff Dike <jdike@addtoit.com>
To: akpm@osdl.org, Blaisorblade <blaisorblade_spam@yahoo.it>,
Bodo Stroesser <bstroesser@fujitsu-siemens.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 4/11] - UML - redundant code removal from signal delivery
Date: Fri, 12 Nov 2004 21:00:51 -0500 [thread overview]
Message-ID: <200411130200.iAD20ppT005864@ccure.user-mode-linux.org> (raw)
>From Bodo Stroesser - 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: Jeff Dike <jdike@addtoit.com>
Index: 2.6.9/arch/um/include/kern_util.h
===================================================================
--- 2.6.9.orig/arch/um/include/kern_util.h 2004-11-12 13:33:26.000000000 -0500
+++ 2.6.9/arch/um/include/kern_util.h 2004-11-12 13:41:43.000000000 -0500
@@ -29,7 +29,7 @@
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);
Index: 2.6.9/arch/um/kernel/process_kern.c
===================================================================
--- 2.6.9.orig/arch/um/kernel/process_kern.c 2004-11-12 13:33:26.000000000 -0500
+++ 2.6.9/arch/um/kernel/process_kern.c 2004-11-12 13:41:43.000000000 -0500
@@ -141,7 +141,7 @@
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)
Index: 2.6.9/arch/um/kernel/signal_kern.c
===================================================================
--- 2.6.9.orig/arch/um/kernel/signal_kern.c 2004-11-12 13:31:46.000000000 -0500
+++ 2.6.9/arch/um/kernel/signal_kern.c 2004-11-12 18:05:29.000000000 -0500
@@ -159,9 +159,10 @@
return(0);
}
-int do_signal(int error)
+int do_signal(void)
{
- return(kern_do_signal(¤t->thread.regs, NULL, error));
+ return(kern_do_signal(¤t->thread.regs, NULL,
+ PT_REGS_SYSCALL_RET(¤t->thread.regs)));
}
/*
Index: 2.6.9/arch/um/kernel/skas/syscall_user.c
===================================================================
--- 2.6.9.orig/arch/um/kernel/skas/syscall_user.c 2004-11-12 13:24:54.000000000 -0500
+++ 2.6.9/arch/um/kernel/skas/syscall_user.c 2004-11-12 13:41:43.000000000 -0500
@@ -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 @@
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);
Index: 2.6.9/arch/um/kernel/tt/syscall_user.c
===================================================================
--- 2.6.9.orig/arch/um/kernel/tt/syscall_user.c 2004-11-12 13:34:34.000000000 -0500
+++ 2.6.9/arch/um/kernel/tt/syscall_user.c 2004-11-12 13:41:43.000000000 -0500
@@ -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 @@
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);
reply other threads:[~2004-11-12 23:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200411130200.iAD20ppT005864@ccure.user-mode-linux.org \
--to=jdike@addtoit.com \
--cc=akpm@osdl.org \
--cc=blaisorblade_spam@yahoo.it \
--cc=bstroesser@fujitsu-siemens.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome