2 * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
6 #include "linux/slab.h"
7 #include "linux/smp_lock.h"
8 #include "linux/ptrace.h"
10 #include "asm/ptrace.h"
11 #include "asm/pgtable.h"
12 #include "asm/tlbflush.h"
13 #include "asm/uaccess.h"
14 #include "kern_util.h"
15 #include "as-layout.h"
21 #include "skas/skas.h"
23 void flush_thread(void)
26 unsigned long end = proc_mm ? task_size : CONFIG_STUB_START;
29 arch_flush_thread(¤t->thread.arch);
31 ret = unmap(¤t->mm->context.skas.id, 0, end, 1, &data);
33 printk("flush_thread - clearing address space failed, "
35 force_sig(SIGKILL, current);
38 __switch_mm(¤t->mm->context.skas.id);
41 void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp)
44 PT_REGS_IP(regs) = eip;
45 PT_REGS_SP(regs) = esp;
49 extern void log_exec(char **argv, void *tty);
52 static long execve1(char *file, char __user * __user *argv,
53 char __user *__user *env)
57 struct tty_struct *tty;
59 mutex_lock(&tty_mutex);
60 tty = get_current_tty();
63 mutex_unlock(&tty_mutex);
65 error = do_execve(file, argv, env, ¤t->thread.regs);
68 current->ptrace &= ~PT_DTRACE;
69 #ifdef SUBARCH_EXECVE1
70 SUBARCH_EXECVE1(¤t->thread.regs.regs);
77 long um_execve(char *file, char __user *__user *argv, char __user *__user *env)
81 err = execve1(file, argv, env);
83 do_longjmp(current->thread.exec_buf, 1);
87 long sys_execve(char __user *file, char __user *__user *argv,
88 char __user *__user *env)
94 filename = getname(file);
95 error = PTR_ERR(filename);
96 if (IS_ERR(filename)) goto out;
97 error = execve1(filename, argv, env);