Skip to contentSkip to conversation

UML - Move _kern.c files

PATCH In review Jeff Dike 1 participant 1 message Jul 7, 2006 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 15/19 UML - Move _kern.c files

Move most *_kern.c files in arch/um/kernel to *.c. This makes UML somewhat more closely resemble the other arches.

arch/um/kernel/exec.c new file +86 -0
Index: linux-2.6.17/arch/um/kernel/exec.c
===================================================================
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2000, 2001 Jeff Dike ([email protected])
+ * Licensed under the GPL
+ */
+
+#include "linux/slab.h"
+#include "linux/smp_lock.h"
+#include "linux/ptrace.h"
+#include "asm/ptrace.h"
+#include "asm/pgtable.h"
+#include "asm/tlbflush.h"
+#include "asm/uaccess.h"
+#include "user_util.h"
+#include "kern_util.h"
+#include "mem_user.h"
+#include "kern.h"
+#include "irq_user.h"
+#include "tlb.h"
+#include "os.h"
+#include "choose-mode.h"
+#include "mode_kern.h"
+
+void flush_thread(void)
+{
+	arch_flush_thread(&current->thread.arch);
+	CHOOSE_MODE(flush_thread_tt(), flush_thread_skas());
+}
+
+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);
+}
+
+#ifdef CONFIG_TTY_LOG
+extern void log_exec(char **argv, void *tty);
+#endif
+
+static long execve1(char *file, char __user * __user *argv,
+		    char __user *__user *env)
+{
+        long error;
+
+#ifdef CONFIG_TTY_LOG
+	task_lock(current);
+	log_exec(argv, current->signal->tty);
+	task_unlock(current);
+#endif
+        error = do_execve(file, argv, env, &current->thread.regs);
+        if (error == 0){
+		task_lock(current);
+                current->ptrace &= ~PT_DTRACE;
+#ifdef SUBARCH_EXECVE1
+		SUBARCH_EXECVE1(&current->thread.regs.regs);
+#endif
+		task_unlock(current);
+                set_cmdline(current_cmd());
+        }
+        return(error);
+}
+
+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);
+}
+
+long sys_execve(char __user *file, char __user *__user *argv,
+		char __user *__user *env)
+{
+	long error;
+	char *filename;
+
+	lock_kernel();
+	filename = getname(file);
+	error = PTR_ERR(filename);
+	if (IS_ERR(filename)) goto out;
+	error = execve1(filename, argv, env);
+	putname(filename);
+ out:
+	unlock_kernel();
+	return(error);
+}
arch/um/kernel/sigio.c new file +55 -0

55 lines not on this page · raw message

arch/um/kernel/signal.c new file +191 -0

191 lines not on this page · raw message

arch/um/kernel/time.c new file +182 -0

182 lines not on this page · raw message

arch/um/kernel/time_kern.c deleted +0 -182

182 lines not on this page · raw message

arch/um/kernel/trap.c new file +251 -0

251 lines not on this page · raw message

arch/um/kernel/trap_kern.c deleted +0 -251

251 lines not on this page · raw message

arch/um/kernel/syscall.c new file +166 -0

166 lines not on this page · raw message

arch/um/kernel/syscall_kern.c deleted +0 -166

166 lines not on this page · raw message

arch/um/kernel/exec_kern.c deleted +0 -77

77 lines not on this page · raw message

arch/um/kernel/sigio_kern.c deleted +0 -55

55 lines not on this page · raw message

arch/um/kernel/signal_kern.c deleted +0 -191

191 lines not on this page · raw message

arch/um/kernel/Makefile +4 -5
Index: linux-2.6.17/arch/um/kernel/Makefile
===================================================================
@@ -6,11 +6,10 @@
 extra-y := vmlinux.lds
 clean-files :=
 
-obj-y = config.o exec_kern.o exitcode.o \
-	init_task.o irq.o ksyms.o mem.o physmem.o \
-	process_kern.o ptrace.o reboot.o resource.o sigio_kern.o \
-	signal_kern.o smp.o syscall_kern.o sysrq.o \
-	time_kern.o tlb.o trap_kern.o uaccess.o um_arch.o umid.o
+obj-y = config.o exec.o exitcode.o init_task.o irq.o ksyms.o mem.o \
+	physmem.o process_kern.o ptrace.o reboot.o resource.o sigio.o \
+	signal.o smp.o syscall.o sysrq.o time.o tlb.o trap.o uaccess.o \
+	um_arch.o umid.o
 
 obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
 obj-$(CONFIG_GPROF)	+= gprof_syms.o

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel