diff options
Diffstat (limited to 'arch/um/kernel')
-rw-r--r-- | arch/um/kernel/exec.c | 1 | ||||
-rw-r--r-- | arch/um/kernel/irq.c | 1 | ||||
-rw-r--r-- | arch/um/kernel/mem.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/process.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/ptrace.c | 70 | ||||
-rw-r--r-- | arch/um/kernel/reboot.c | 1 | ||||
-rw-r--r-- | arch/um/kernel/skas/mmu.c | 1 | ||||
-rw-r--r-- | arch/um/kernel/skas/syscall.c | 4 | ||||
-rw-r--r-- | arch/um/kernel/syscall.c | 45 |
9 files changed, 24 insertions, 103 deletions
diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c index fda30d21fb90..97974c1bdd12 100644 --- a/arch/um/kernel/exec.c +++ b/arch/um/kernel/exec.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include "linux/smp_lock.h" | 8 | #include "linux/smp_lock.h" |
9 | #include "linux/ptrace.h" | 9 | #include "linux/ptrace.h" |
10 | #include "linux/sched.h" | 10 | #include "linux/sched.h" |
11 | #include "linux/slab.h" | ||
11 | #include "asm/current.h" | 12 | #include "asm/current.h" |
12 | #include "asm/processor.h" | 13 | #include "asm/processor.h" |
13 | #include "asm/uaccess.h" | 14 | #include "asm/uaccess.h" |
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index 89474ba0741e..a3f0b04d7101 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include "linux/module.h" | 12 | #include "linux/module.h" |
13 | #include "linux/sched.h" | 13 | #include "linux/sched.h" |
14 | #include "linux/seq_file.h" | 14 | #include "linux/seq_file.h" |
15 | #include "linux/slab.h" | ||
15 | #include "as-layout.h" | 16 | #include "as-layout.h" |
16 | #include "kern_util.h" | 17 | #include "kern_util.h" |
17 | #include "os.h" | 18 | #include "os.h" |
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index a5d5e70cf6f5..8137ccc9635b 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c | |||
@@ -5,10 +5,10 @@ | |||
5 | 5 | ||
6 | #include <linux/stddef.h> | 6 | #include <linux/stddef.h> |
7 | #include <linux/bootmem.h> | 7 | #include <linux/bootmem.h> |
8 | #include <linux/gfp.h> | ||
9 | #include <linux/highmem.h> | 8 | #include <linux/highmem.h> |
10 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
11 | #include <linux/swap.h> | 10 | #include <linux/swap.h> |
11 | #include <linux/slab.h> | ||
12 | #include <asm/fixmap.h> | 12 | #include <asm/fixmap.h> |
13 | #include <asm/page.h> | 13 | #include <asm/page.h> |
14 | #include "as-layout.h" | 14 | #include "as-layout.h" |
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 2f910a1b7454..fab4371184f6 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c | |||
@@ -7,13 +7,13 @@ | |||
7 | #include <linux/stddef.h> | 7 | #include <linux/stddef.h> |
8 | #include <linux/err.h> | 8 | #include <linux/err.h> |
9 | #include <linux/hardirq.h> | 9 | #include <linux/hardirq.h> |
10 | #include <linux/gfp.h> | ||
11 | #include <linux/mm.h> | 10 | #include <linux/mm.h> |
12 | #include <linux/module.h> | 11 | #include <linux/module.h> |
13 | #include <linux/personality.h> | 12 | #include <linux/personality.h> |
14 | #include <linux/proc_fs.h> | 13 | #include <linux/proc_fs.h> |
15 | #include <linux/ptrace.h> | 14 | #include <linux/ptrace.h> |
16 | #include <linux/random.h> | 15 | #include <linux/random.h> |
16 | #include <linux/slab.h> | ||
17 | #include <linux/sched.h> | 17 | #include <linux/sched.h> |
18 | #include <linux/seq_file.h> | 18 | #include <linux/seq_file.h> |
19 | #include <linux/tick.h> | 19 | #include <linux/tick.h> |
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c index 8e3d69e4fcb5..484509948ee9 100644 --- a/arch/um/kernel/ptrace.c +++ b/arch/um/kernel/ptrace.c | |||
@@ -12,16 +12,25 @@ | |||
12 | #endif | 12 | #endif |
13 | #include "skas_ptrace.h" | 13 | #include "skas_ptrace.h" |
14 | 14 | ||
15 | static inline void set_singlestepping(struct task_struct *child, int on) | 15 | |
16 | |||
17 | void user_enable_single_step(struct task_struct *child) | ||
16 | { | 18 | { |
17 | if (on) | 19 | child->ptrace |= PT_DTRACE; |
18 | child->ptrace |= PT_DTRACE; | ||
19 | else | ||
20 | child->ptrace &= ~PT_DTRACE; | ||
21 | child->thread.singlestep_syscall = 0; | 20 | child->thread.singlestep_syscall = 0; |
22 | 21 | ||
23 | #ifdef SUBARCH_SET_SINGLESTEPPING | 22 | #ifdef SUBARCH_SET_SINGLESTEPPING |
24 | SUBARCH_SET_SINGLESTEPPING(child, on); | 23 | SUBARCH_SET_SINGLESTEPPING(child, 1); |
24 | #endif | ||
25 | } | ||
26 | |||
27 | void user_disable_single_step(struct task_struct *child) | ||
28 | { | ||
29 | child->ptrace &= ~PT_DTRACE; | ||
30 | child->thread.singlestep_syscall = 0; | ||
31 | |||
32 | #ifdef SUBARCH_SET_SINGLESTEPPING | ||
33 | SUBARCH_SET_SINGLESTEPPING(child, 0); | ||
25 | #endif | 34 | #endif |
26 | } | 35 | } |
27 | 36 | ||
@@ -30,7 +39,7 @@ static inline void set_singlestepping(struct task_struct *child, int on) | |||
30 | */ | 39 | */ |
31 | void ptrace_disable(struct task_struct *child) | 40 | void ptrace_disable(struct task_struct *child) |
32 | { | 41 | { |
33 | set_singlestepping(child,0); | 42 | user_disable_single_step(child); |
34 | } | 43 | } |
35 | 44 | ||
36 | extern int peek_user(struct task_struct * child, long addr, long data); | 45 | extern int peek_user(struct task_struct * child, long addr, long data); |
@@ -69,53 +78,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
69 | ret = -EIO; | 78 | ret = -EIO; |
70 | break; | 79 | break; |
71 | 80 | ||
72 | /* continue and stop at next (return from) syscall */ | ||
73 | case PTRACE_SYSCALL: | ||
74 | /* restart after signal. */ | ||
75 | case PTRACE_CONT: { | ||
76 | ret = -EIO; | ||
77 | if (!valid_signal(data)) | ||
78 | break; | ||
79 | |||
80 | set_singlestepping(child, 0); | ||
81 | if (request == PTRACE_SYSCALL) | ||
82 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
83 | else clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
84 | child->exit_code = data; | ||
85 | wake_up_process(child); | ||
86 | ret = 0; | ||
87 | break; | ||
88 | } | ||
89 | |||
90 | /* | ||
91 | * make the child exit. Best I can do is send it a sigkill. | ||
92 | * perhaps it should be put in the status that it wants to | ||
93 | * exit. | ||
94 | */ | ||
95 | case PTRACE_KILL: { | ||
96 | ret = 0; | ||
97 | if (child->exit_state == EXIT_ZOMBIE) /* already dead */ | ||
98 | break; | ||
99 | |||
100 | set_singlestepping(child, 0); | ||
101 | child->exit_code = SIGKILL; | ||
102 | wake_up_process(child); | ||
103 | break; | ||
104 | } | ||
105 | |||
106 | case PTRACE_SINGLESTEP: { /* set the trap flag. */ | ||
107 | ret = -EIO; | ||
108 | if (!valid_signal(data)) | ||
109 | break; | ||
110 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
111 | set_singlestepping(child, 1); | ||
112 | child->exit_code = data; | ||
113 | /* give it a chance to run. */ | ||
114 | wake_up_process(child); | ||
115 | ret = 0; | ||
116 | break; | ||
117 | } | ||
118 | |||
119 | #ifdef PTRACE_GETREGS | 81 | #ifdef PTRACE_GETREGS |
120 | case PTRACE_GETREGS: { /* Get all gp regs from the child. */ | 82 | case PTRACE_GETREGS: { /* Get all gp regs from the child. */ |
121 | if (!access_ok(VERIFY_WRITE, p, MAX_REG_OFFSET)) { | 83 | if (!access_ok(VERIFY_WRITE, p, MAX_REG_OFFSET)) { |
diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c index 00197d3d21ec..869bec9f2516 100644 --- a/arch/um/kernel/reboot.c +++ b/arch/um/kernel/reboot.c | |||
@@ -4,6 +4,7 @@ | |||
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include "linux/sched.h" | 6 | #include "linux/sched.h" |
7 | #include "linux/slab.h" | ||
7 | #include "kern_util.h" | 8 | #include "kern_util.h" |
8 | #include "os.h" | 9 | #include "os.h" |
9 | #include "skas.h" | 10 | #include "skas.h" |
diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c index 8bfd1e905812..3d099f974785 100644 --- a/arch/um/kernel/skas/mmu.c +++ b/arch/um/kernel/skas/mmu.c | |||
@@ -5,6 +5,7 @@ | |||
5 | 5 | ||
6 | #include "linux/mm.h" | 6 | #include "linux/mm.h" |
7 | #include "linux/sched.h" | 7 | #include "linux/sched.h" |
8 | #include "linux/slab.h" | ||
8 | #include "asm/pgalloc.h" | 9 | #include "asm/pgalloc.h" |
9 | #include "asm/pgtable.h" | 10 | #include "asm/pgtable.h" |
10 | #include "as-layout.h" | 11 | #include "as-layout.h" |
diff --git a/arch/um/kernel/skas/syscall.c b/arch/um/kernel/skas/syscall.c index 4e3b820bd2be..f5173e1ec3ac 100644 --- a/arch/um/kernel/skas/syscall.c +++ b/arch/um/kernel/skas/syscall.c | |||
@@ -10,7 +10,7 @@ | |||
10 | #include "sysdep/syscalls.h" | 10 | #include "sysdep/syscalls.h" |
11 | 11 | ||
12 | extern int syscall_table_size; | 12 | extern int syscall_table_size; |
13 | #define NR_syscalls (syscall_table_size / sizeof(void *)) | 13 | #define NR_SYSCALLS (syscall_table_size / sizeof(void *)) |
14 | 14 | ||
15 | void handle_syscall(struct uml_pt_regs *r) | 15 | void handle_syscall(struct uml_pt_regs *r) |
16 | { | 16 | { |
@@ -30,7 +30,7 @@ void handle_syscall(struct uml_pt_regs *r) | |||
30 | * in case it's a compiler bug. | 30 | * in case it's a compiler bug. |
31 | */ | 31 | */ |
32 | syscall = UPT_SYSCALL_NR(r); | 32 | syscall = UPT_SYSCALL_NR(r); |
33 | if ((syscall >= NR_syscalls) || (syscall < 0)) | 33 | if ((syscall >= NR_SYSCALLS) || (syscall < 0)) |
34 | result = -ENOSYS; | 34 | result = -ENOSYS; |
35 | else result = EXECUTE_SYSCALL(syscall, regs); | 35 | else result = EXECUTE_SYSCALL(syscall, regs); |
36 | 36 | ||
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c index cccab850c27e..4393173923f5 100644 --- a/arch/um/kernel/syscall.c +++ b/arch/um/kernel/syscall.c | |||
@@ -51,51 +51,6 @@ long old_mmap(unsigned long addr, unsigned long len, | |||
51 | return err; | 51 | return err; |
52 | } | 52 | } |
53 | 53 | ||
54 | long sys_uname(struct old_utsname __user * name) | ||
55 | { | ||
56 | long err; | ||
57 | if (!name) | ||
58 | return -EFAULT; | ||
59 | down_read(&uts_sem); | ||
60 | err = copy_to_user(name, utsname(), sizeof (*name)); | ||
61 | up_read(&uts_sem); | ||
62 | return err?-EFAULT:0; | ||
63 | } | ||
64 | |||
65 | long sys_olduname(struct oldold_utsname __user * name) | ||
66 | { | ||
67 | long error; | ||
68 | |||
69 | if (!name) | ||
70 | return -EFAULT; | ||
71 | if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) | ||
72 | return -EFAULT; | ||
73 | |||
74 | down_read(&uts_sem); | ||
75 | |||
76 | error = __copy_to_user(&name->sysname, &utsname()->sysname, | ||
77 | __OLD_UTS_LEN); | ||
78 | error |= __put_user(0, name->sysname + __OLD_UTS_LEN); | ||
79 | error |= __copy_to_user(&name->nodename, &utsname()->nodename, | ||
80 | __OLD_UTS_LEN); | ||
81 | error |= __put_user(0, name->nodename + __OLD_UTS_LEN); | ||
82 | error |= __copy_to_user(&name->release, &utsname()->release, | ||
83 | __OLD_UTS_LEN); | ||
84 | error |= __put_user(0, name->release + __OLD_UTS_LEN); | ||
85 | error |= __copy_to_user(&name->version, &utsname()->version, | ||
86 | __OLD_UTS_LEN); | ||
87 | error |= __put_user(0, name->version + __OLD_UTS_LEN); | ||
88 | error |= __copy_to_user(&name->machine, &utsname()->machine, | ||
89 | __OLD_UTS_LEN); | ||
90 | error |= __put_user(0, name->machine + __OLD_UTS_LEN); | ||
91 | |||
92 | up_read(&uts_sem); | ||
93 | |||
94 | error = error ? -EFAULT : 0; | ||
95 | |||
96 | return error; | ||
97 | } | ||
98 | |||
99 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | 54 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]) |
100 | { | 55 | { |
101 | mm_segment_t fs; | 56 | mm_segment_t fs; |