aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-09-26 19:28:00 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-10-14 19:26:53 -0400
commit2f12af35a988082700373acdebe049dfebaf49b6 (patch)
tree884f364fe18dd47a86bb725afd1cc54ab67ffb97 /arch/sparc
parent5230429ab1c20c348e17069230c24db8a6b53ca3 (diff)
sparc64: switch to generic kernel_execve()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/Kconfig1
-rw-r--r--arch/sparc/kernel/sys_sparc_64.c22
-rw-r--r--arch/sparc/kernel/syscalls.S10
3 files changed, 6 insertions, 27 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index ab8bd62b8dbe..e47eb324d77a 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -75,6 +75,7 @@ config SPARC64
75 select HAVE_C_RECORDMCOUNT 75 select HAVE_C_RECORDMCOUNT
76 select NO_BOOTMEM 76 select NO_BOOTMEM
77 select GENERIC_KERNEL_THREAD 77 select GENERIC_KERNEL_THREAD
78 select GENERIC_KERNEL_EXECVE
78 79
79config ARCH_DEFCONFIG 80config ARCH_DEFCONFIG
80 string 81 string
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index 11c6c9603e71..adfe60ece05f 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -729,25 +729,3 @@ SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
729 729
730 return ret; 730 return ret;
731} 731}
732
733/*
734 * Do a system call from kernel instead of calling sys_execve so we
735 * end up with proper pt_regs.
736 */
737int kernel_execve(const char *filename,
738 const char *const argv[],
739 const char *const envp[])
740{
741 long __res;
742 register long __g1 __asm__ ("g1") = __NR_execve;
743 register long __o0 __asm__ ("o0") = (long)(filename);
744 register long __o1 __asm__ ("o1") = (long)(argv);
745 register long __o2 __asm__ ("o2") = (long)(envp);
746 asm volatile ("t 0x6d\n\t"
747 "sub %%g0, %%o0, %0\n\t"
748 "movcc %%xcc, %%o0, %0\n\t"
749 : "=r" (__res), "=&r" (__o0)
750 : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__g1)
751 : "cc");
752 return __res;
753}
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S
index 624f34162c38..f72c12433869 100644
--- a/arch/sparc/kernel/syscalls.S
+++ b/arch/sparc/kernel/syscalls.S
@@ -115,13 +115,13 @@ ret_from_syscall:
115 call schedule_tail 115 call schedule_tail
116 mov %g7, %o0 116 mov %g7, %o0
117 ldx [%sp + PTREGS_OFF + PT_V9_I0], %o0 117 ldx [%sp + PTREGS_OFF + PT_V9_I0], %o0
118 brnz,a,pt %o0, ret_sys_call 118 brnz,pt %o0, ret_sys_call
119 ldx [%g6 + TI_FLAGS], %l0 119 ldx [%g6 + TI_FLAGS], %l0
120 ldx [%sp + PTREGS_OFF + PT_V9_G1], %l0 120 ldx [%sp + PTREGS_OFF + PT_V9_G1], %l1
121 call %l0 121 call %l1
122 ldx [%sp + PTREGS_OFF + PT_V9_G2], %o0 122 ldx [%sp + PTREGS_OFF + PT_V9_G2], %o0
123 call do_exit ! will not return 123 ba,pt %xcc, ret_sys_call
124 mov 0,%o0 124 mov 0, %o0
125 125
126 .globl sparc_exit 126 .globl sparc_exit
127 .type sparc_exit,#function 127 .type sparc_exit,#function