diff options
author | Jeff Dike <jdike@addtoit.com> | 2005-09-03 18:57:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 03:06:23 -0400 |
commit | e32dacb9f481fd6decb41adb28e720c923d34f54 (patch) | |
tree | 77594001f5c670380897d84367442725740383d9 /arch/um/kernel/tt | |
parent | 08964c565b2fe49e338ffbe4907adcc19647ef16 (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.c | 47 | ||||
-rw-r--r-- | arch/um/kernel/tt/syscall_user.c | 35 |
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 2650a628719e..3d29c90514cc 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 | ||
17 | extern syscall_handler_t *sys_call_table[]; | 19 | void syscall_handler_tt(int sig, struct pt_regs *regs) |
18 | |||
19 | long 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(®s->regs); | ||
29 | SC_START_SYSCALL(sc); | ||
30 | |||
31 | syscall_trace(®s->regs, 0); | ||
32 | |||
26 | current->thread.nsyscalls++; | 33 | current->thread.nsyscalls++; |
27 | nsyscalls++; | 34 | nsyscalls++; |
28 | #endif | ||
29 | syscall = UPT_SYSCALL_NR(®s->regs); | 35 | syscall = UPT_SYSCALL_NR(®s->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(®s->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(®s->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 b218316cfdb2..902987bf379b 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 | |||
20 | void 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 | |||
52 | void do_sigtrap(void *task) | 19 | void do_sigtrap(void *task) |
53 | { | 20 | { |
54 | UPT_SYSCALL_NR(TASK_REGS(task)) = -1; | 21 | UPT_SYSCALL_NR(TASK_REGS(task)) = -1; |