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 @@ #include "linux/smp_lock.h" #include "linux/ptrace.h" #include "linux/sched.h" +#include "linux/slab.h" #include "asm/current.h" #include "asm/processor.h" #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 @@ #include "linux/module.h" #include "linux/sched.h" #include "linux/seq_file.h" +#include "linux/slab.h" #include "as-layout.h" #include "kern_util.h" #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 @@ #include <linux/stddef.h> #include <linux/bootmem.h> -#include <linux/gfp.h> #include <linux/highmem.h> #include <linux/mm.h> #include <linux/swap.h> +#include <linux/slab.h> #include <asm/fixmap.h> #include <asm/page.h> #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 @@ #include <linux/stddef.h> #include <linux/err.h> #include <linux/hardirq.h> -#include <linux/gfp.h> #include <linux/mm.h> #include <linux/module.h> #include <linux/personality.h> #include <linux/proc_fs.h> #include <linux/ptrace.h> #include <linux/random.h> +#include <linux/slab.h> #include <linux/sched.h> #include <linux/seq_file.h> #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 @@ #endif #include "skas_ptrace.h" -static inline void set_singlestepping(struct task_struct *child, int on) + + +void user_enable_single_step(struct task_struct *child) { - if (on) - child->ptrace |= PT_DTRACE; - else - child->ptrace &= ~PT_DTRACE; + child->ptrace |= PT_DTRACE; child->thread.singlestep_syscall = 0; #ifdef SUBARCH_SET_SINGLESTEPPING - SUBARCH_SET_SINGLESTEPPING(child, on); + SUBARCH_SET_SINGLESTEPPING(child, 1); +#endif +} + +void user_disable_single_step(struct task_struct *child) +{ + child->ptrace &= ~PT_DTRACE; + child->thread.singlestep_syscall = 0; + +#ifdef SUBARCH_SET_SINGLESTEPPING + SUBARCH_SET_SINGLESTEPPING(child, 0); #endif } @@ -30,7 +39,7 @@ static inline void set_singlestepping(struct task_struct *child, int on) */ void ptrace_disable(struct task_struct *child) { - set_singlestepping(child,0); + user_disable_single_step(child); } 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) ret = -EIO; break; - /* continue and stop at next (return from) syscall */ - case PTRACE_SYSCALL: - /* restart after signal. */ - case PTRACE_CONT: { - ret = -EIO; - if (!valid_signal(data)) - break; - - set_singlestepping(child, 0); - if (request == PTRACE_SYSCALL) - set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); - else clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); - child->exit_code = data; - wake_up_process(child); - ret = 0; - break; - } - -/* - * make the child exit. Best I can do is send it a sigkill. - * perhaps it should be put in the status that it wants to - * exit. - */ - case PTRACE_KILL: { - ret = 0; - if (child->exit_state == EXIT_ZOMBIE) /* already dead */ - break; - - set_singlestepping(child, 0); - child->exit_code = SIGKILL; - wake_up_process(child); - break; - } - - case PTRACE_SINGLESTEP: { /* set the trap flag. */ - ret = -EIO; - if (!valid_signal(data)) - break; - clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); - set_singlestepping(child, 1); - child->exit_code = data; - /* give it a chance to run. */ - wake_up_process(child); - ret = 0; - break; - } - #ifdef PTRACE_GETREGS case PTRACE_GETREGS: { /* Get all gp regs from the child. */ 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 @@ */ #include "linux/sched.h" +#include "linux/slab.h" #include "kern_util.h" #include "os.h" #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 @@ #include "linux/mm.h" #include "linux/sched.h" +#include "linux/slab.h" #include "asm/pgalloc.h" #include "asm/pgtable.h" #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 @@ #include "sysdep/syscalls.h" extern int syscall_table_size; -#define NR_syscalls (syscall_table_size / sizeof(void *)) +#define NR_SYSCALLS (syscall_table_size / sizeof(void *)) void handle_syscall(struct uml_pt_regs *r) { @@ -30,7 +30,7 @@ void handle_syscall(struct uml_pt_regs *r) * in case it's a compiler bug. */ syscall = UPT_SYSCALL_NR(r); - if ((syscall >= NR_syscalls) || (syscall < 0)) + if ((syscall >= NR_SYSCALLS) || (syscall < 0)) result = -ENOSYS; else result = EXECUTE_SYSCALL(syscall, regs); 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, return err; } -long sys_uname(struct old_utsname __user * name) -{ - long err; - if (!name) - return -EFAULT; - down_read(&uts_sem); - err = copy_to_user(name, utsname(), sizeof (*name)); - up_read(&uts_sem); - return err?-EFAULT:0; -} - -long sys_olduname(struct oldold_utsname __user * name) -{ - long error; - - if (!name) - return -EFAULT; - if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) - return -EFAULT; - - down_read(&uts_sem); - - error = __copy_to_user(&name->sysname, &utsname()->sysname, - __OLD_UTS_LEN); - error |= __put_user(0, name->sysname + __OLD_UTS_LEN); - error |= __copy_to_user(&name->nodename, &utsname()->nodename, - __OLD_UTS_LEN); - error |= __put_user(0, name->nodename + __OLD_UTS_LEN); - error |= __copy_to_user(&name->release, &utsname()->release, - __OLD_UTS_LEN); - error |= __put_user(0, name->release + __OLD_UTS_LEN); - error |= __copy_to_user(&name->version, &utsname()->version, - __OLD_UTS_LEN); - error |= __put_user(0, name->version + __OLD_UTS_LEN); - error |= __copy_to_user(&name->machine, &utsname()->machine, - __OLD_UTS_LEN); - error |= __put_user(0, name->machine + __OLD_UTS_LEN); - - up_read(&uts_sem); - - error = error ? -EFAULT : 0; - - return error; -} - int kernel_execve(const char *filename, char *const argv[], char *const envp[]) { mm_segment_t fs; |