Merge master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6
[pandora-kernel.git] / arch / parisc / kernel / process.c
index 998700c..0dd3847 100644 (file)
@@ -13,7 +13,7 @@
  *    Copyright (C) 2000 Grant Grundler <grundler with parisc-linux.org>
  *    Copyright (C) 2001 Alan Modra <amodra at parisc-linux.org>
  *    Copyright (C) 2001-2002 Ryan Bradetich <rbrad at parisc-linux.org>
- *    Copyright (C) 2001-2002 Helge Deller <deller at parisc-linux.org>
+ *    Copyright (C) 2001-2007 Helge Deller <deller at parisc-linux.org>
  *    Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
  *
  *
 #include <asm/uaccess.h>
 #include <asm/unwind.h>
 
-/*
- * Power off function, if any
- */ 
-void (*pm_power_off)(void);
-EXPORT_SYMBOL(pm_power_off);
-
-void default_idle(void)
-{
-       barrier();
-}
-
 /*
  * The idle thread. There's no useful work to be
  * done, so just try to conserve power and have a
@@ -142,6 +131,7 @@ void machine_halt(void)
        */
 }
 
+void (*chassis_power_off)(void);
 
 /*
  * This routine is called from sys_reboot to actually turn off the
@@ -150,8 +140,8 @@ void machine_halt(void)
 void machine_power_off(void)
 {
        /* If there is a registered power off handler, call it. */
-       if(pm_power_off)
-               pm_power_off();
+       if (chassis_power_off)
+               chassis_power_off();
 
        /* Put the soft power button back under hardware control.
         * If the user had already pressed the power button, the
@@ -167,6 +157,8 @@ void machine_power_off(void)
               KERN_EMERG "Please power this system off now.");
 }
 
+void (*pm_power_off)(void) = machine_power_off;
+EXPORT_SYMBOL(pm_power_off);
 
 /*
  * Create a kernel thread
@@ -311,7 +303,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
                 * Copy function and argument to be called from
                 * ret_from_kernel_thread.
                 */
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
                cregs->gr[27] = pregs->gr[27];
 #endif
                cregs->gr[26] = pregs->gr[26];
@@ -363,8 +355,8 @@ asmlinkage int sys_execve(struct pt_regs *regs)
        error = PTR_ERR(filename);
        if (IS_ERR(filename))
                goto out;
-       error = do_execve(filename, (char __user **) regs->gr[25],
-               (char __user **) regs->gr[24], regs);
+       error = do_execve(filename, (char __user * __user *) regs->gr[25],
+               (char __user * __user *) regs->gr[24], regs);
        if (error == 0) {
                task_lock(current);
                current->ptrace &= ~PT_DTRACE;
@@ -376,7 +368,14 @@ out:
        return error;
 }
 
-unsigned long 
+extern int __execve(const char *filename, char *const argv[],
+               char *const envp[], struct task_struct *task);
+int kernel_execve(const char *filename, char *const argv[], char *const envp[])
+{
+       return __execve(filename, argv, envp, current);
+}
+
+unsigned long
 get_wchan(struct task_struct *p)
 {
        struct unwind_frame_info info;