aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-10-03 14:56:02 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-10-14 23:12:33 -0400
commit1703a219f7f5ab2c39514f9f0763001cdc907d25 (patch)
treeaf79698ae74c94418ef31483c6e75d9588a3f757 /arch
parent69b58a67213506f98835b0ee8cf24324f59a1442 (diff)
cris: switch to generic kernel_execve/sys_execve
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/cris/Kconfig1
-rw-r--r--arch/cris/arch-v10/kernel/entry.S11
-rw-r--r--arch/cris/arch-v10/kernel/process.c23
-rw-r--r--arch/cris/arch-v32/kernel/entry.S13
-rw-r--r--arch/cris/arch-v32/kernel/process.c22
-rw-r--r--arch/cris/include/asm/unistd.h1
6 files changed, 6 insertions, 65 deletions
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index 3336a7d25341..81b59d18867e 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -50,6 +50,7 @@ config CRIS
50 select GENERIC_CMOS_UPDATE 50 select GENERIC_CMOS_UPDATE
51 select MODULES_USE_ELF_RELA 51 select MODULES_USE_ELF_RELA
52 select GENERIC_KERNEL_THREAD 52 select GENERIC_KERNEL_THREAD
53 select GENERIC_KERNEL_EXECVE
53 54
54config HZ 55config HZ
55 int 56 int
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S
index b8e39e00acb2..897bba67bf7a 100644
--- a/arch/cris/arch-v10/kernel/entry.S
+++ b/arch/cris/arch-v10/kernel/entry.S
@@ -87,8 +87,8 @@ ret_from_kernel_thread:
87 jsr schedule_tail 87 jsr schedule_tail
88 move.d $r2, $r10 ; argument is here 88 move.d $r2, $r10 ; argument is here
89 jsr $r1 ; call the payload 89 jsr $r1 ; call the payload
90 moveq 0, $r10 90 moveq 0, $r9 ; no syscall restarts, TYVM...
91 jsr sys_exit ; never returns 91 ba ret_from_sys_call
92 92
93ret_from_intr: 93ret_from_intr:
94 ;; check for resched if preemptive kernel or if we're going back to user-mode 94 ;; check for resched if preemptive kernel or if we're going back to user-mode
@@ -594,13 +594,6 @@ _ugdb_handle_breakpoint:
594 ba do_sigtrap ; SIGTRAP the offending process. 594 ba do_sigtrap ; SIGTRAP the offending process.
595 pop $dccr ; Restore dccr in delay slot. 595 pop $dccr ; Restore dccr in delay slot.
596 596
597 .global kernel_execve
598kernel_execve:
599 move.d __NR_execve, $r9
600 break 13
601 ret
602 nop
603
604 .data 597 .data
605 598
606hw_bp_trigs: 599hw_bp_trigs:
diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c
index 8a673aa81cdd..1d6458287f38 100644
--- a/arch/cris/arch-v10/kernel/process.c
+++ b/arch/cris/arch-v10/kernel/process.c
@@ -167,29 +167,6 @@ asmlinkage int sys_vfork(void)
167 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), current_pt_regs(), 0, NULL, NULL); 167 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), current_pt_regs(), 0, NULL, NULL);
168} 168}
169 169
170/*
171 * sys_execve() executes a new program.
172 */
173asmlinkage int sys_execve(const char *fname,
174 const char *const *argv,
175 const char *const *envp,
176 long r13, long mof, long srp,
177 struct pt_regs *regs)
178{
179 int error;
180 struct filename *filename;
181
182 filename = getname(fname);
183 error = PTR_ERR(filename);
184
185 if (IS_ERR(filename))
186 goto out;
187 error = do_execve(filename->name, argv, envp, regs);
188 putname(filename);
189 out:
190 return error;
191}
192
193unsigned long get_wchan(struct task_struct *p) 170unsigned long get_wchan(struct task_struct *p)
194{ 171{
195#if 0 172#if 0
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S
index a9bcbc419278..faa644111feb 100644
--- a/arch/cris/arch-v32/kernel/entry.S
+++ b/arch/cris/arch-v32/kernel/entry.S
@@ -92,8 +92,8 @@ ret_from_kernel_thread:
92 move.d $r2, $r10 92 move.d $r2, $r10
93 jsr $r1 93 jsr $r1
94 nop 94 nop
95 moveq 0, $r10 95 moveq 0, $r9 ; no syscall restarts, TYVM...
96 jsr sys_exit 96 ba ret_from_sys_call
97 nop 97 nop
98 .size ret_from_kernel_thread, . - ret_from_kernel_thread 98 .size ret_from_kernel_thread, . - ret_from_kernel_thread
99 99
@@ -544,15 +544,6 @@ _ugdb_handle_exception:
544 ba do_sigtrap ; SIGTRAP the offending process. 544 ba do_sigtrap ; SIGTRAP the offending process.
545 move.d [$sp+], $r0 ; Restore R0 in delay slot. 545 move.d [$sp+], $r0 ; Restore R0 in delay slot.
546 546
547 .global kernel_execve
548 .type kernel_execve,@function
549kernel_execve:
550 move.d __NR_execve, $r9
551 break 13
552 ret
553 nop
554 .size kernel_execve, . - kernel_execve
555
556 .data 547 .data
557 548
558 .section .rodata,"a" 549 .section .rodata,"a"
diff --git a/arch/cris/arch-v32/kernel/process.c b/arch/cris/arch-v32/kernel/process.c
index 3edbdb88110e..fe465401b6ec 100644
--- a/arch/cris/arch-v32/kernel/process.c
+++ b/arch/cris/arch-v32/kernel/process.c
@@ -186,28 +186,6 @@ sys_vfork(void)
186 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), current_pt_regs(), 0, NULL, NULL); 186 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), current_pt_regs(), 0, NULL, NULL);
187} 187}
188 188
189/* sys_execve() executes a new program. */
190asmlinkage int
191sys_execve(const char *fname,
192 const char *const *argv,
193 const char *const *envp, long r13, long mof, long srp,
194 struct pt_regs *regs)
195{
196 int error;
197 struct filename *filename;
198
199 filename = getname(fname);
200 error = PTR_ERR(filename);
201
202 if (IS_ERR(filename))
203 goto out;
204
205 error = do_execve(filename->name, argv, envp, regs);
206 putname(filename);
207 out:
208 return error;
209}
210
211unsigned long 189unsigned long
212get_wchan(struct task_struct *p) 190get_wchan(struct task_struct *p)
213{ 191{
diff --git a/arch/cris/include/asm/unistd.h b/arch/cris/include/asm/unistd.h
index 51873a446f87..f181d1fc7632 100644
--- a/arch/cris/include/asm/unistd.h
+++ b/arch/cris/include/asm/unistd.h
@@ -371,6 +371,7 @@
371#define __ARCH_WANT_SYS_SIGPROCMASK 371#define __ARCH_WANT_SYS_SIGPROCMASK
372#define __ARCH_WANT_SYS_RT_SIGACTION 372#define __ARCH_WANT_SYS_RT_SIGACTION
373#define __ARCH_WANT_SYS_RT_SIGSUSPEND 373#define __ARCH_WANT_SYS_RT_SIGSUSPEND
374#define __ARCH_WANT_SYS_EXECVE
374 375
375/* 376/*
376 * "Conditional" syscalls 377 * "Conditional" syscalls