X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=arch%2Fum%2Fkernel%2Fexec.c;h=7c77adecd9193d899531b3ffe80e4e6497beeebf;hb=b160fb6309dc907cbd8849e549d83badb86dd35b;hp=356e50f5aaed4c6567e8780adbba06f80494e2a2;hpb=5cefcab3db2b13093480f2a42bf081574dd72d3d;p=linux-2.6-omap-h63xx.git diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c index 356e50f5aae..7c77adecd91 100644 --- a/arch/um/kernel/exec.c +++ b/arch/um/kernel/exec.c @@ -1,34 +1,43 @@ /* - * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com) + * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) * Licensed under the GPL */ -#include "linux/slab.h" +#include "linux/stddef.h" +#include "linux/fs.h" #include "linux/smp_lock.h" #include "linux/ptrace.h" -#include "asm/ptrace.h" -#include "asm/pgtable.h" -#include "asm/tlbflush.h" +#include "linux/sched.h" +#include "asm/current.h" +#include "asm/processor.h" #include "asm/uaccess.h" -#include "kern_util.h" -#include "as-layout.h" #include "mem_user.h" -#include "kern.h" -#include "irq_user.h" -#include "tlb.h" +#include "skas.h" #include "os.h" -#include "choose-mode.h" -#include "mode_kern.h" void flush_thread(void) { + void *data = NULL; + unsigned long end = proc_mm ? task_size : CONFIG_STUB_START; + int ret; + arch_flush_thread(¤t->thread.arch); - CHOOSE_MODE(flush_thread_tt(), flush_thread_skas()); + + ret = unmap(¤t->mm->context.id, 0, end, 1, &data); + if (ret) { + printk(KERN_ERR "flush_thread - clearing address space failed, " + "err = %d\n", ret); + force_sig(SIGKILL, current); + } + + __switch_mm(¤t->mm->context.id); } void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp) { - CHOOSE_MODE_PROC(start_thread_tt, start_thread_skas, regs, eip, esp); + set_fs(USER_DS); + PT_REGS_IP(regs) = eip; + PT_REGS_SP(regs) = esp; } #ifdef CONFIG_TTY_LOG @@ -38,7 +47,7 @@ extern void log_exec(char **argv, void *tty); static long execve1(char *file, char __user * __user *argv, char __user *__user *env) { - long error; + long error; #ifdef CONFIG_TTY_LOG struct tty_struct *tty; @@ -48,17 +57,16 @@ static long execve1(char *file, char __user * __user *argv, log_exec(argv, tty); mutex_unlock(&tty_mutex); #endif - error = do_execve(file, argv, env, ¤t->thread.regs); - if (error == 0){ + error = do_execve(file, argv, env, ¤t->thread.regs); + if (error == 0) { task_lock(current); - current->ptrace &= ~PT_DTRACE; + current->ptrace &= ~PT_DTRACE; #ifdef SUBARCH_EXECVE1 SUBARCH_EXECVE1(¤t->thread.regs.regs); #endif task_unlock(current); - set_cmdline(current_cmd()); - } - return(error); + } + return error; } long um_execve(char *file, char __user *__user *argv, char __user *__user *env) @@ -66,9 +74,9 @@ long um_execve(char *file, char __user *__user *argv, char __user *__user *env) long err; err = execve1(file, argv, env); - if(!err) - do_longjmp(current->thread.exec_buf, 1); - return(err); + if (!err) + UML_LONGJMP(current->thread.exec_buf, 1); + return err; } long sys_execve(char __user *file, char __user *__user *argv, @@ -85,5 +93,5 @@ long sys_execve(char __user *file, char __user *__user *argv, putname(filename); out: unlock_kernel(); - return(error); + return error; }