fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / sh64 / kernel / sys_sh64.c
index 10d549f..ad0fa4e 100644 (file)
 #include <linux/file.h>
 #include <linux/utsname.h>
 #include <linux/syscalls.h>
-#include <linux/vs_cvirt.h>
 #include <asm/uaccess.h>
 #include <asm/ipc.h>
 #include <asm/ptrace.h>
+#include <asm/unistd.h>
 
 #define REG_3  3
 
@@ -280,7 +280,25 @@ asmlinkage int sys_uname(struct old_utsname * name)
        if (!name)
                return -EFAULT;
        down_read(&uts_sem);
-       err=copy_to_user(name, vx_new_utsname(), sizeof (*name));
+       err = copy_to_user(name, utsname(), sizeof (*name));
        up_read(&uts_sem);
        return err?-EFAULT:0;
 }
+
+/*
+ * Do a system call from kernel instead of calling sys_execve so we
+ * end up with proper pt_regs.
+ */
+int kernel_execve(const char *filename, char *const argv[], char *const envp[])
+{
+       register unsigned long __sc0 __asm__ ("r9") = ((0x13 << 16) | __NR_execve);
+       register unsigned long __sc2 __asm__ ("r2") = (unsigned long) filename;
+       register unsigned long __sc3 __asm__ ("r3") = (unsigned long) argv;
+       register unsigned long __sc4 __asm__ ("r4") = (unsigned long) envp;
+       __asm__ __volatile__ ("trapa    %1 !\t\t\t execve(%2,%3,%4)"
+       : "=r" (__sc0)
+       : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4) );
+       __asm__ __volatile__ ("!dummy   %0 %1 %2 %3"
+       : : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4) : "memory");
+       return __sc0;
+}