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 "choose-mode.h"
22 #include "mode_kern.h"
24 void flush_thread(void)
26 arch_flush_thread(¤t->thread.arch);
27 CHOOSE_MODE(flush_thread_tt(), flush_thread_skas());
30 void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp)
32 CHOOSE_MODE_PROC(start_thread_tt, start_thread_skas, regs, eip, esp);
36 extern void log_exec(char **argv, void *tty);
39 static long execve1(char *file, char __user * __user *argv,
40 char __user *__user *env)
44 struct tty_struct *tty;
46 mutex_lock(&tty_mutex);
47 tty = get_current_tty();
50 mutex_unlock(&tty_mutex);
52 error = do_execve(file, argv, env, ¤t->thread.regs);
55 current->ptrace &= ~PT_DTRACE;
56 #ifdef SUBARCH_EXECVE1
57 SUBARCH_EXECVE1(¤t->thread.regs.regs);
60 set_cmdline(current_cmd());
65 long um_execve(char *file, char __user *__user *argv, char __user *__user *env)
69 err = execve1(file, argv, env);
71 do_longjmp(current->thread.exec_buf, 1);
75 long sys_execve(char __user *file, char __user *__user *argv,
76 char __user *__user *env)
82 filename = getname(file);
83 error = PTR_ERR(filename);
84 if (IS_ERR(filename)) goto out;
85 error = execve1(filename, argv, env);