aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/tt
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2005-09-03 18:57:42 -0400
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 03:06:23 -0400
commite32dacb9f481fd6decb41adb28e720c923d34f54 (patch)
tree77594001f5c670380897d84367442725740383d9 /arch/um/kernel/tt
parent08964c565b2fe49e338ffbe4907adcc19647ef16 (diff)
[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>
Diffstat (limited to 'arch/um/kernel/tt')
-rw-r--r--arch/um/kernel/tt/syscall_kern.c47
-rw-r--r--arch/um/kernel/tt/syscall_user.c35
2 files changed, 27 insertions, 55 deletions
diff --git a/arch/um/kernel/tt/syscall_kern.c b/arch/um/kernel/tt/syscall_kern.c
index 2650a628719..3d29c90514c 100644
--- a/arch/um/kernel/tt/syscall_kern.c
+++ b/arch/um/kernel/tt/syscall_kern.c
@@ -12,36 +12,41 @@
12#include "asm/uaccess.h" 12#include "asm/uaccess.h"
13#include "asm/stat.h" 13#include "asm/stat.h"
14#include "sysdep/syscalls.h" 14#include "sysdep/syscalls.h"
15#include "sysdep/sigcontext.h"
15#include "kern_util.h" 16#include "kern_util.h"
17#include "syscall.h"
16 18
17extern syscall_handler_t *sys_call_table[]; 19void syscall_handler_tt(int sig, struct pt_regs *regs)
18
19long execute_syscall_tt(void *r)
20{ 20{
21 struct pt_regs *regs = r; 21 void *sc;
22 long res; 22 long result;
23 int syscall; 23 int syscall;
24
25#ifdef CONFIG_SYSCALL_DEBUG 24#ifdef CONFIG_SYSCALL_DEBUG
25 int index;
26 index = record_syscall_start(syscall);
27#endif
28 sc = UPT_SC(&regs->regs);
29 SC_START_SYSCALL(sc);
30
31 syscall_trace(&regs->regs, 0);
32
26 current->thread.nsyscalls++; 33 current->thread.nsyscalls++;
27 nsyscalls++; 34 nsyscalls++;
28#endif
29 syscall = UPT_SYSCALL_NR(&regs->regs); 35 syscall = UPT_SYSCALL_NR(&regs->regs);
30 36
31 if((syscall >= NR_syscalls) || (syscall < 0)) 37 if((syscall >= NR_syscalls) || (syscall < 0))
32 res = -ENOSYS; 38 result = -ENOSYS;
33 else res = EXECUTE_SYSCALL(syscall, regs); 39 else result = EXECUTE_SYSCALL(syscall, regs);
34 40
35 return(res); 41 /* regs->sc may have changed while the system call ran (there may
36} 42 * have been an interrupt or segfault), so it needs to be refreshed.
43 */
44 UPT_SC(&regs->regs) = sc;
37 45
38/* 46 SC_SET_SYSCALL_RETURN(sc, result);
39 * Overrides for Emacs so that we follow Linus's tabbing style. 47
40 * Emacs will notice this stuff at the end of the file and automatically 48 syscall_trace(&regs->regs, 1);
41 * adjust the settings for this buffer only. This must remain at the end 49#ifdef CONFIG_SYSCALL_DEBUG
42 * of the file. 50 record_syscall_end(index, result);
43 * --------------------------------------------------------------------------- 51#endif
44 * Local variables: 52}
45 * c-file-style: "linux"
46 * End:
47 */
diff --git a/arch/um/kernel/tt/syscall_user.c b/arch/um/kernel/tt/syscall_user.c
index b218316cfdb..902987bf379 100644
--- a/arch/um/kernel/tt/syscall_user.c
+++ b/arch/um/kernel/tt/syscall_user.c
@@ -13,42 +13,9 @@
13#include "task.h" 13#include "task.h"
14#include "user_util.h" 14#include "user_util.h"
15#include "kern_util.h" 15#include "kern_util.h"
16#include "syscall_user.h" 16#include "syscall.h"
17#include "tt.h" 17#include "tt.h"
18 18
19
20void syscall_handler_tt(int sig, union uml_pt_regs *regs)
21{
22 void *sc;
23 long result;
24 int syscall;
25#ifdef UML_CONFIG_DEBUG_SYSCALL
26 int index;
27#endif
28
29 syscall = UPT_SYSCALL_NR(regs);
30 sc = UPT_SC(regs);
31 SC_START_SYSCALL(sc);
32
33#ifdef UML_CONFIG_DEBUG_SYSCALL
34 index = record_syscall_start(syscall);
35#endif
36 syscall_trace(regs, 0);
37 result = execute_syscall_tt(regs);
38
39 /* regs->sc may have changed while the system call ran (there may
40 * have been an interrupt or segfault), so it needs to be refreshed.
41 */
42 UPT_SC(regs) = sc;
43
44 SC_SET_SYSCALL_RETURN(sc, result);
45
46 syscall_trace(regs, 1);
47#ifdef UML_CONFIG_DEBUG_SYSCALL
48 record_syscall_end(index, result);
49#endif
50}
51
52void do_sigtrap(void *task) 19void do_sigtrap(void *task)
53{ 20{
54 UPT_SYSCALL_NR(TASK_REGS(task)) = -1; 21 UPT_SYSCALL_NR(TASK_REGS(task)) = -1;