netfilter: xt_hashlimit: simplify seqfile code
[safe/jmp/linux-2.6] / arch / sh / kernel / process_64.c
index 96be839..31f80c6 100644 (file)
@@ -323,7 +323,6 @@ ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *))
 int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
 {
        struct pt_regs regs;
-       int pid;
 
        memset(&regs, 0, sizeof(regs));
        regs.regs[2] = (unsigned long)arg;
@@ -333,13 +332,10 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
        regs.sr = (1 << 30);
 
        /* Ok, create the new process.. */
-       pid = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
+       return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
                      &regs, 0, NULL, NULL);
-
-       trace_mark(kernel_arch_kthread_create, "pid %d fn %p", pid, fn);
-
-       return pid;
 }
+EXPORT_SYMBOL(kernel_thread);
 
 /*
  * Free current thread data structures etc..
@@ -408,7 +404,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
        if (fpvalid) {
                if (current == last_task_used_math) {
                        enable_fpu();
-                       save_fpu(tsk, regs);
+                       save_fpu(tsk);
                        disable_fpu();
                        last_task_used_math = 0;
                        regs->sr |= SR_FD;
@@ -422,6 +418,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
        return 0; /* Task didn't use the fpu at all. */
 #endif
 }
+EXPORT_SYMBOL(dump_fpu);
 
 asmlinkage void ret_from_fork(void);
 
@@ -430,12 +427,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
                struct task_struct *p, struct pt_regs *regs)
 {
        struct pt_regs *childregs;
-       unsigned long long se;                  /* Sign extension */
 
 #ifdef CONFIG_SH_FPU
        if(last_task_used_math == current) {
                enable_fpu();
-               save_fpu(current, regs);
+               save_fpu(current);
                disable_fpu();
                last_task_used_math = NULL;
                regs->sr |= SR_FD;
@@ -446,11 +442,19 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 
        *childregs = *regs;
 
+       /*
+        * Sign extend the edited stack.
+        * Note that thread.pc and thread.pc will stay
+        * 32-bit wide and context switch must take care
+        * of NEFF sign extension.
+        */
        if (user_mode(regs)) {
-               childregs->regs[15] = usp;
+               childregs->regs[15] = neff_sign_extend(usp);
                p->thread.uregs = childregs;
        } else {
-               childregs->regs[15] = (unsigned long)task_stack_page(p) + THREAD_SIZE;
+               childregs->regs[15] =
+                       neff_sign_extend((unsigned long)task_stack_page(p) +
+                                        THREAD_SIZE);
        }
 
        childregs->regs[9] = 0; /* Set return value for child */
@@ -459,17 +463,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
        p->thread.sp = (unsigned long) childregs;
        p->thread.pc = (unsigned long) ret_from_fork;
 
-       /*
-        * Sign extend the edited stack.
-         * Note that thread.pc and thread.pc will stay
-        * 32-bit wide and context switch must take care
-        * of NEFF sign extension.
-        */
-
-       se = childregs->regs[15];
-       se = (se & NEFF_SIGN) ? (se | NEFF_MASK) : se;
-       childregs->regs[15] = se;
-
        return 0;
 }
 
@@ -529,11 +522,6 @@ asmlinkage int sys_execve(char *ufilename, char **uargv,
                          (char __user * __user *)uargv,
                          (char __user * __user *)uenvp,
                          pregs);
-       if (error == 0) {
-               task_lock(current);
-               current->ptrace &= ~PT_DTRACE;
-               task_unlock(current);
-       }
        putname(filename);
 out:
        return error;