[PATCH] uml: system call path cleanup
This merges two sets of files which had no business being split apart in the first place. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
08964c565b
commit
e32dacb9f4
@@ -12,36 +12,41 @@
|
||||
#include "asm/uaccess.h"
|
||||
#include "asm/stat.h"
|
||||
#include "sysdep/syscalls.h"
|
||||
#include "sysdep/sigcontext.h"
|
||||
#include "kern_util.h"
|
||||
#include "syscall.h"
|
||||
|
||||
extern syscall_handler_t *sys_call_table[];
|
||||
|
||||
long execute_syscall_tt(void *r)
|
||||
void syscall_handler_tt(int sig, struct pt_regs *regs)
|
||||
{
|
||||
struct pt_regs *regs = r;
|
||||
long res;
|
||||
void *sc;
|
||||
long result;
|
||||
int syscall;
|
||||
|
||||
#ifdef CONFIG_SYSCALL_DEBUG
|
||||
int index;
|
||||
index = record_syscall_start(syscall);
|
||||
#endif
|
||||
sc = UPT_SC(®s->regs);
|
||||
SC_START_SYSCALL(sc);
|
||||
|
||||
syscall_trace(®s->regs, 0);
|
||||
|
||||
current->thread.nsyscalls++;
|
||||
nsyscalls++;
|
||||
#endif
|
||||
syscall = UPT_SYSCALL_NR(®s->regs);
|
||||
|
||||
if((syscall >= NR_syscalls) || (syscall < 0))
|
||||
res = -ENOSYS;
|
||||
else res = EXECUTE_SYSCALL(syscall, regs);
|
||||
result = -ENOSYS;
|
||||
else result = EXECUTE_SYSCALL(syscall, regs);
|
||||
|
||||
return(res);
|
||||
/* regs->sc may have changed while the system call ran (there may
|
||||
* have been an interrupt or segfault), so it needs to be refreshed.
|
||||
*/
|
||||
UPT_SC(®s->regs) = sc;
|
||||
|
||||
SC_SET_SYSCALL_RETURN(sc, result);
|
||||
|
||||
syscall_trace(®s->regs, 1);
|
||||
#ifdef CONFIG_SYSCALL_DEBUG
|
||||
record_syscall_end(index, result);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Overrides for Emacs so that we follow Linus's tabbing style.
|
||||
* Emacs will notice this stuff at the end of the file and automatically
|
||||
* adjust the settings for this buffer only. This must remain at the end
|
||||
* of the file.
|
||||
* ---------------------------------------------------------------------------
|
||||
* Local variables:
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
*/
|
||||
|
@@ -13,42 +13,9 @@
|
||||
#include "task.h"
|
||||
#include "user_util.h"
|
||||
#include "kern_util.h"
|
||||
#include "syscall_user.h"
|
||||
#include "syscall.h"
|
||||
#include "tt.h"
|
||||
|
||||
|
||||
void syscall_handler_tt(int sig, union uml_pt_regs *regs)
|
||||
{
|
||||
void *sc;
|
||||
long result;
|
||||
int syscall;
|
||||
#ifdef UML_CONFIG_DEBUG_SYSCALL
|
||||
int index;
|
||||
#endif
|
||||
|
||||
syscall = UPT_SYSCALL_NR(regs);
|
||||
sc = UPT_SC(regs);
|
||||
SC_START_SYSCALL(sc);
|
||||
|
||||
#ifdef UML_CONFIG_DEBUG_SYSCALL
|
||||
index = record_syscall_start(syscall);
|
||||
#endif
|
||||
syscall_trace(regs, 0);
|
||||
result = execute_syscall_tt(regs);
|
||||
|
||||
/* regs->sc may have changed while the system call ran (there may
|
||||
* have been an interrupt or segfault), so it needs to be refreshed.
|
||||
*/
|
||||
UPT_SC(regs) = sc;
|
||||
|
||||
SC_SET_SYSCALL_RETURN(sc, result);
|
||||
|
||||
syscall_trace(regs, 1);
|
||||
#ifdef UML_CONFIG_DEBUG_SYSCALL
|
||||
record_syscall_end(index, result);
|
||||
#endif
|
||||
}
|
||||
|
||||
void do_sigtrap(void *task)
|
||||
{
|
||||
UPT_SYSCALL_NR(TASK_REGS(task)) = -1;
|
||||
|
Reference in New Issue
Block a user