diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-18 22:33:44 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-01 00:53:11 -0400 |
commit | 019f96a345b6e23d4e0bc2c136ec5f7500b95834 (patch) | |
tree | 25fe5b25d9312962b589f8e02778008414b3e75b /arch/frv | |
parent | 460dabab73f2f60198c37ed7bf6d192d23eaa286 (diff) |
frv: switch to generic kernel_execve
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/frv')
-rw-r--r-- | arch/frv/include/asm/processor.h | 8 | ||||
-rw-r--r-- | arch/frv/include/asm/unistd.h | 1 | ||||
-rw-r--r-- | arch/frv/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/frv/kernel/entry.S | 5 | ||||
-rw-r--r-- | arch/frv/kernel/kernel_execve.S | 33 |
5 files changed, 10 insertions, 39 deletions
diff --git a/arch/frv/include/asm/processor.h b/arch/frv/include/asm/processor.h index dccb9d162318..cc86e07a4119 100644 --- a/arch/frv/include/asm/processor.h +++ b/arch/frv/include/asm/processor.h | |||
@@ -92,14 +92,12 @@ extern struct task_struct *__kernel_current_task; | |||
92 | 92 | ||
93 | /* | 93 | /* |
94 | * do necessary setup to start up a newly executed thread. | 94 | * do necessary setup to start up a newly executed thread. |
95 | * - need to discard the frame stacked by init() invoking the execve syscall | ||
96 | */ | 95 | */ |
97 | #define start_thread(_regs, _pc, _usp) \ | 96 | #define start_thread(_regs, _pc, _usp) \ |
98 | do { \ | 97 | do { \ |
99 | __frame = __kernel_frame0_ptr; \ | 98 | _regs->pc = (_pc); \ |
100 | __frame->pc = (_pc); \ | 99 | _regs->psr &= ~PSR_S; \ |
101 | __frame->psr &= ~PSR_S; \ | 100 | _regs->sp = (_usp); \ |
102 | __frame->sp = (_usp); \ | ||
103 | } while(0) | 101 | } while(0) |
104 | 102 | ||
105 | /* Free all resources held by a thread. */ | 103 | /* Free all resources held by a thread. */ |
diff --git a/arch/frv/include/asm/unistd.h b/arch/frv/include/asm/unistd.h index 24b64034866c..b6b07e55e473 100644 --- a/arch/frv/include/asm/unistd.h +++ b/arch/frv/include/asm/unistd.h | |||
@@ -373,6 +373,7 @@ | |||
373 | #define __ARCH_WANT_SYS_RT_SIGACTION | 373 | #define __ARCH_WANT_SYS_RT_SIGACTION |
374 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | 374 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND |
375 | #define __ARCH_WANT_SYS_EXECVE | 375 | #define __ARCH_WANT_SYS_EXECVE |
376 | #define __ARCH_WANT_KERNEL_EXECVE | ||
376 | 377 | ||
377 | /* | 378 | /* |
378 | * "Conditional" syscalls | 379 | * "Conditional" syscalls |
diff --git a/arch/frv/kernel/Makefile b/arch/frv/kernel/Makefile index 7b10bc19106e..3cbb3294b9f9 100644 --- a/arch/frv/kernel/Makefile +++ b/arch/frv/kernel/Makefile | |||
@@ -8,7 +8,7 @@ heads-$(CONFIG_MMU) := head-mmu-fr451.o | |||
8 | extra-y:= head.o vmlinux.lds | 8 | extra-y:= head.o vmlinux.lds |
9 | 9 | ||
10 | obj-y := $(heads-y) entry.o entry-table.o break.o switch_to.o \ | 10 | obj-y := $(heads-y) entry.o entry-table.o break.o switch_to.o \ |
11 | kernel_execve.o process.o traps.o ptrace.o signal.o dma.o \ | 11 | process.o traps.o ptrace.o signal.o dma.o \ |
12 | sys_frv.o time.o setup.o frv_ksyms.o \ | 12 | sys_frv.o time.o setup.o frv_ksyms.o \ |
13 | debug-stub.o irq.o sleep.o uaccess.o | 13 | debug-stub.o irq.o sleep.o uaccess.o |
14 | 14 | ||
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S index 7a886130ca10..002732960315 100644 --- a/arch/frv/kernel/entry.S +++ b/arch/frv/kernel/entry.S | |||
@@ -871,6 +871,11 @@ ret_from_kernel_thread: | |||
871 | calll @(gr21,gr0) | 871 | calll @(gr21,gr0) |
872 | bra sys_exit | 872 | bra sys_exit |
873 | 873 | ||
874 | .globl ret_from_kernel_execve | ||
875 | ret_from_kernel_execve: | ||
876 | ori gr28,0,sp | ||
877 | bra __syscall_exit | ||
878 | |||
874 | ################################################################################################### | 879 | ################################################################################################### |
875 | # | 880 | # |
876 | # Return to user mode is not as complex as all this looks, | 881 | # Return to user mode is not as complex as all this looks, |
diff --git a/arch/frv/kernel/kernel_execve.S b/arch/frv/kernel/kernel_execve.S deleted file mode 100644 index 9b074a16a052..000000000000 --- a/arch/frv/kernel/kernel_execve.S +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /* in-kernel program execution | ||
2 | * | ||
3 | * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <linux/linkage.h> | ||
13 | #include <asm/unistd.h> | ||
14 | |||
15 | ############################################################################### | ||
16 | # | ||
17 | # Do a system call from kernel instead of calling sys_execve so we end up with | ||
18 | # proper pt_regs. | ||
19 | # | ||
20 | # int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | ||
21 | # | ||
22 | # On entry: GR8/GR9/GR10: arguments to function | ||
23 | # On return: GR8: syscall return. | ||
24 | # | ||
25 | ############################################################################### | ||
26 | .globl kernel_execve | ||
27 | .type kernel_execve,@function | ||
28 | kernel_execve: | ||
29 | setlos __NR_execve,gr7 | ||
30 | tira gr0,#0 | ||
31 | bralr | ||
32 | |||
33 | .size kernel_execve,.-kernel_execve | ||