]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] uml: move _kern.c files
authorJeff Dike <jdike@addtoit.com>
Mon, 10 Jul 2006 11:45:13 +0000 (04:45 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 10 Jul 2006 20:24:24 +0000 (13:24 -0700)
Move most *_kern.c files in arch/um/kernel to *.c.  This makes UML somewhat
more closely resemble the other arches.

[akpm@osdl.org: use the new INTF_* flags]
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/um/kernel/Makefile
arch/um/kernel/exec.c [moved from arch/um/kernel/exec_kern.c with 87% similarity]
arch/um/kernel/sigio.c [moved from arch/um/kernel/sigio_kern.c with 94% similarity]
arch/um/kernel/signal.c [moved from arch/um/kernel/signal_kern.c with 96% similarity]
arch/um/kernel/syscall.c [moved from arch/um/kernel/syscall_kern.c with 82% similarity]
arch/um/kernel/time.c [moved from arch/um/kernel/time_kern.c with 100% similarity]
arch/um/kernel/trap.c [moved from arch/um/kernel/trap_kern.c with 95% similarity]

index 82b435897256c4123a3c967ba444775fba6fbe6b..a2d93065b2d0aa10e2b2b363b74366d60276696c 100644 (file)
@@ -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
similarity index 87%
rename from arch/um/kernel/exec_kern.c
rename to arch/um/kernel/exec.c
index c0cb627bf594bd870aed412e9362679ee5d8613b..fc38a6d5906d4251599a95753f229486eae2cb4e 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)
  * Licensed under the GPL
  */
@@ -31,18 +31,27 @@ 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
-       log_exec(argv, current->tty);
+       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());
         }
similarity index 94%
rename from arch/um/kernel/sigio_kern.c
rename to arch/um/kernel/sigio.c
index 5102ba5d5bd08e1b0be8db133f026fb8c6b2e5ca..0ad755ceb212e80a0b6684f69e4b894ff15c39dd 100644 (file)
@@ -31,7 +31,7 @@ int write_sigio_irq(int fd)
        int err;
 
        err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt,
-                            IRQF_DISABLED | IRQF_SAMPLE_RANDOM, "write sigio",
+                            IRQF_DISABLED|IRQF_SAMPLE_RANDOM, "write sigio",
                             NULL);
        if(err){
                printk("write_sigio_irq : um_request_irq failed, err = %d\n",
similarity index 96%
rename from arch/um/kernel/signal_kern.c
rename to arch/um/kernel/signal.c
index da17b7541e08dd4c2526159f6a2cfaab94ee7486..4aa9808ba2642c99b4a19fbebc445ca17956a853 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
  * Licensed under the GPL
  */
@@ -36,7 +36,7 @@ EXPORT_SYMBOL(unblock_signals);
 
 /*
  * OK, we're invoking a handler
- */    
+ */
 static int handle_signal(struct pt_regs *regs, unsigned long signr,
                         struct k_sigaction *ka, siginfo_t *info,
                         sigset_t *oldset)
@@ -88,7 +88,7 @@ static int handle_signal(struct pt_regs *regs, unsigned long signr,
                force_sigsegv(signr, current);
        } else {
                spin_lock_irq(&current->sighand->siglock);
-               sigorsets(&current->blocked, &current->blocked, 
+               sigorsets(&current->blocked, &current->blocked,
                          &ka->sa.sa_mask);
                 if(!(ka->sa.sa_flags & SA_NODEFER))
                        sigaddset(&current->blocked, signr);
@@ -136,7 +136,7 @@ static int kern_do_signal(struct pt_regs *regs)
                        PT_REGS_RESTART_SYSCALL(regs);
                        break;
                case -ERESTART_RESTARTBLOCK:
-                       PT_REGS_SYSCALL_RET(regs) = __NR_restart_syscall;
+                       PT_REGS_ORIG_SYSCALL(regs) = __NR_restart_syscall;
                        PT_REGS_RESTART_SYSCALL(regs);
                        break;
                }
@@ -146,7 +146,7 @@ static int kern_do_signal(struct pt_regs *regs)
         * you set a breakpoint on a system call instruction and singlestep
         * from it, the tracing thread used to PTRACE_SINGLESTEP the process
         * rather than PTRACE_SYSCALL it, allowing the system call to execute
-        * on the host.  The tracing thread will check this flag and 
+        * on the host.  The tracing thread will check this flag and
         * PTRACE_SYSCALL if necessary.
         */
        if(current->ptrace & PT_DTRACE)
similarity index 82%
rename from arch/um/kernel/syscall_kern.c
rename to arch/um/kernel/syscall.c
index 37d3978337d87a3e31756c1b997047026d945dfa..abf14aaf905ffb2fda7789ccbfab5779122f91e8 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
  * Licensed under the GPL
  */
@@ -110,7 +110,7 @@ long sys_uname(struct old_utsname __user * name)
        if (!name)
                return -EFAULT;
        down_read(&uts_sem);
-       err=copy_to_user(name, &system_utsname, sizeof (*name));
+       err = copy_to_user(name, utsname(), sizeof (*name));
        up_read(&uts_sem);
        return err?-EFAULT:0;
 }
@@ -123,27 +123,27 @@ long sys_olduname(struct oldold_utsname __user * 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,&system_utsname.sysname,
+
+       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,&system_utsname.nodename,
+       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,&system_utsname.release,
+       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,&system_utsname.version,
+       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,&system_utsname.machine,
+       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);
-       
+       error |= __put_user(0, name->machine + __OLD_UTS_LEN);
+
        up_read(&uts_sem);
-       
+
        error = error ? -EFAULT : 0;
 
        return error;
similarity index 95%
rename from arch/um/kernel/trap_kern.c
rename to arch/um/kernel/trap.c
index 02f6d4d8dc3af3a5fd5842909f24fe1b89f980bb..ac70fa5a2e2aa8e70ecf9688dfc7a8aec1a730fd 100644 (file)
@@ -35,7 +35,7 @@
 #include "os.h"
 
 /* Note this is constrained to return 0, -EFAULT, -EACCESS, -ENOMEM by segv(). */
-int handle_page_fault(unsigned long address, unsigned long ip, 
+int handle_page_fault(unsigned long address, unsigned long ip,
                      int is_write, int is_user, int *code_out)
 {
        struct mm_struct *mm = current->mm;
@@ -55,20 +55,20 @@ int handle_page_fault(unsigned long address, unsigned long ip,
 
        down_read(&mm->mmap_sem);
        vma = find_vma(mm, address);
-       if(!vma) 
+       if(!vma)
                goto out;
-       else if(vma->vm_start <= address) 
+       else if(vma->vm_start <= address)
                goto good_area;
-       else if(!(vma->vm_flags & VM_GROWSDOWN)) 
+       else if(!(vma->vm_flags & VM_GROWSDOWN))
                goto out;
        else if(is_user && !ARCH_IS_STACKGROW(address))
                goto out;
-       else if(expand_stack(vma, address)) 
+       else if(expand_stack(vma, address))
                goto out;
 
 good_area:
        *code_out = SEGV_ACCERR;
-       if(is_write && !(vma->vm_flags & VM_WRITE)) 
+       if(is_write && !(vma->vm_flags & VM_WRITE))
                goto out;
 
        /* Don't require VM_READ|VM_EXEC for write faults! */
@@ -184,14 +184,14 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user, void *sc)
        else if(catcher != NULL){
                current->thread.fault_addr = (void *) address;
                do_longjmp(catcher, 1);
-       } 
+       }
        else if(current->thread.fault_addr != NULL)
                panic("fault_addr set but no fault catcher");
         else if(!is_user && arch_fixup(ip, sc))
                return(0);
 
-       if(!is_user) 
-               panic("Kernel mode fault at addr 0x%lx, ip 0x%lx", 
+       if(!is_user)
+               panic("Kernel mode fault at addr 0x%lx, ip 0x%lx",
                      address, ip);
 
        if (err == -EACCES) {