]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sh/kernel/sys_sh.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[linux-2.6-omap-h63xx.git] / arch / sh / kernel / sys_sh.c
index b68ff705f0673c56c1a6845d97569689df136932..8fde95001c346873744057040b85c6f3cdbb094d 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/cacheflush.h>
 #include <asm/uaccess.h>
 #include <asm/ipc.h>
+#include <asm/unistd.h>
 
 /*
  * sys_pipe() is the normal C calling standard for creating
@@ -281,7 +282,7 @@ asmlinkage int sys_uname(struct old_utsname * 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;
 }
@@ -309,3 +310,19 @@ asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1,
                                (u64)len0 << 32 | len1, advice);
 #endif
 }
+
+/*
+ * 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 long __sc0 __asm__ ("r3") = __NR_execve;
+       register long __sc4 __asm__ ("r4") = (long) filename;
+       register long __sc5 __asm__ ("r5") = (long) argv;
+       register long __sc6 __asm__ ("r6") = (long) envp;
+       __asm__ __volatile__ ("trapa    #0x13" : "=z" (__sc0)
+                       : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6)
+                       : "memory");
+       return __sc0;
+}