aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2006-10-02 05:18:31 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-02 10:57:23 -0400
commit3db03b4afb3ecd66a0399b8ba57742ca953b0ecd (patch)
treefe0bd5c3663c58583f0181e2673d569c2df664e7 /arch
parent6760856791c6e527da678021ee6a67896549d4da (diff)
[PATCH] rename the provided execve functions to kernel_execve
Some architectures provide an execve function that does not set errno, but instead returns the result code directly. Rename these to kernel_execve to get the right semantics there. Moreover, there is no reasone for any of these architectures to still provide __KERNEL_SYSCALLS__ or _syscallN macros, so remove these right away. [akpm@osdl.org: build fix] [bunk@stusta.de: build fix] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Andi Kleen <ak@muc.de> Acked-by: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Ian Molton <spyro@f2s.com> Cc: Mikael Starvik <starvik@axis.com> Cc: David Howells <dhowells@redhat.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Hirokazu Takata <takata.hirokazu@renesas.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp> Cc: Richard Curnow <rc@rc0.org.uk> Cc: William Lee Irwin III <wli@holomorphy.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp> Cc: Chris Zankel <chris@zankel.net> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Adrian Bunk <bunk@stusta.de> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/alpha_ksyms.c3
-rw-r--r--arch/alpha/kernel/entry.S10
-rw-r--r--arch/arm/kernel/sys_arm.c4
-rw-r--r--arch/arm26/kernel/sys_arm.c4
-rw-r--r--arch/ia64/kernel/entry.S4
-rw-r--r--arch/parisc/kernel/process.c9
-rw-r--r--arch/powerpc/kernel/misc_32.S2
-rw-r--r--arch/powerpc/kernel/misc_64.S2
-rw-r--r--arch/um/kernel/syscall.c13
-rw-r--r--arch/x86_64/kernel/entry.S4
10 files changed, 37 insertions, 18 deletions
diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
index f042cc42b00..dbe327d32b6 100644
--- a/arch/alpha/kernel/alpha_ksyms.c
+++ b/arch/alpha/kernel/alpha_ksyms.c
@@ -36,7 +36,6 @@
36#include <asm/cacheflush.h> 36#include <asm/cacheflush.h>
37#include <asm/vga.h> 37#include <asm/vga.h>
38 38
39#define __KERNEL_SYSCALLS__
40#include <asm/unistd.h> 39#include <asm/unistd.h>
41 40
42extern struct hwrpb_struct *hwrpb; 41extern struct hwrpb_struct *hwrpb;
@@ -116,7 +115,7 @@ EXPORT_SYMBOL(sys_dup);
116EXPORT_SYMBOL(sys_exit); 115EXPORT_SYMBOL(sys_exit);
117EXPORT_SYMBOL(sys_write); 116EXPORT_SYMBOL(sys_write);
118EXPORT_SYMBOL(sys_lseek); 117EXPORT_SYMBOL(sys_lseek);
119EXPORT_SYMBOL(execve); 118EXPORT_SYMBOL(kernel_execve);
120EXPORT_SYMBOL(sys_setsid); 119EXPORT_SYMBOL(sys_setsid);
121EXPORT_SYMBOL(sys_wait4); 120EXPORT_SYMBOL(sys_wait4);
122 121
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index 01ecd09d4a6..c95e95e1ab0 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -655,12 +655,12 @@ kernel_thread:
655.end kernel_thread 655.end kernel_thread
656 656
657/* 657/*
658 * execve(path, argv, envp) 658 * kernel_execve(path, argv, envp)
659 */ 659 */
660 .align 4 660 .align 4
661 .globl execve 661 .globl kernel_execve
662 .ent execve 662 .ent kernel_execve
663execve: 663kernel_execve:
664 /* We can be called from a module. */ 664 /* We can be called from a module. */
665 ldgp $gp, 0($27) 665 ldgp $gp, 0($27)
666 lda $sp, -(32+SIZEOF_PT_REGS+8)($sp) 666 lda $sp, -(32+SIZEOF_PT_REGS+8)($sp)
@@ -704,7 +704,7 @@ execve:
704 704
7051: lda $sp, 32+SIZEOF_PT_REGS+8($sp) 7051: lda $sp, 32+SIZEOF_PT_REGS+8($sp)
706 ret 706 ret
707.end execve 707.end kernel_execve
708 708
709 709
710/* 710/*
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index 8170af47143..00c18d35913 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -279,7 +279,7 @@ out:
279 return error; 279 return error;
280} 280}
281 281
282long execve(const char *filename, char **argv, char **envp) 282int kernel_execve(const char *filename, char *const argv[], char *const envp[])
283{ 283{
284 struct pt_regs regs; 284 struct pt_regs regs;
285 int ret; 285 int ret;
@@ -317,7 +317,7 @@ long execve(const char *filename, char **argv, char **envp)
317 out: 317 out:
318 return ret; 318 return ret;
319} 319}
320EXPORT_SYMBOL(execve); 320EXPORT_SYMBOL(kernel_execve);
321 321
322/* 322/*
323 * Since loff_t is a 64 bit type we avoid a lot of ABI hastle 323 * Since loff_t is a 64 bit type we avoid a lot of ABI hastle
diff --git a/arch/arm26/kernel/sys_arm.c b/arch/arm26/kernel/sys_arm.c
index 85457897b8a..dc05aba58ba 100644
--- a/arch/arm26/kernel/sys_arm.c
+++ b/arch/arm26/kernel/sys_arm.c
@@ -283,7 +283,7 @@ out:
283} 283}
284 284
285/* FIXME - see if this is correct for arm26 */ 285/* FIXME - see if this is correct for arm26 */
286long execve(const char *filename, char **argv, char **envp) 286int kernel_execve(const char *filename, char *const argv[], char *const envp[])
287{ 287{
288 struct pt_regs regs; 288 struct pt_regs regs;
289 int ret; 289 int ret;
@@ -320,4 +320,4 @@ long execve(const char *filename, char **argv, char **envp)
320 return ret; 320 return ret;
321} 321}
322 322
323EXPORT_SYMBOL(execve); 323EXPORT_SYMBOL(kernel_execve);
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 12701cf32d9..e5b1be51b19 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -492,11 +492,11 @@ GLOBAL_ENTRY(prefetch_stack)
492 br.ret.sptk.many rp 492 br.ret.sptk.many rp
493END(prefetch_stack) 493END(prefetch_stack)
494 494
495GLOBAL_ENTRY(execve) 495GLOBAL_ENTRY(kernel_execve)
496 mov r15=__NR_execve // put syscall number in place 496 mov r15=__NR_execve // put syscall number in place
497 break __BREAK_SYSCALL 497 break __BREAK_SYSCALL
498 br.ret.sptk.many rp 498 br.ret.sptk.many rp
499END(execve) 499END(kernel_execve)
500 500
501GLOBAL_ENTRY(clone) 501GLOBAL_ENTRY(clone)
502 mov r15=__NR_clone // put syscall number in place 502 mov r15=__NR_clone // put syscall number in place
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 0b485ef4be8..2f9f9dfa66f 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -368,7 +368,14 @@ out:
368 return error; 368 return error;
369} 369}
370 370
371unsigned long 371extern int __execve(const char *filename, char *const argv[],
372 char *const envp[], struct task_struct *task);
373int kernel_execve(const char *filename, char *const argv[], char *const envp[])
374{
375 return __execve(filename, argv, envp, current);
376}
377
378unsigned long
372get_wchan(struct task_struct *p) 379get_wchan(struct task_struct *p)
373{ 380{
374 struct unwind_frame_info info; 381 struct unwind_frame_info info;
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 58758d88336..88fd73fdf04 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -843,7 +843,7 @@ _GLOBAL(kernel_thread)
843 addi r1,r1,16 843 addi r1,r1,16
844 blr 844 blr
845 845
846_GLOBAL(execve) 846_GLOBAL(kernel_execve)
847 li r0,__NR_execve 847 li r0,__NR_execve
848 sc 848 sc
849 bnslr 849 bnslr
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index e3ed21cd3d9..9c54eccad99 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -556,7 +556,7 @@ _GLOBAL(giveup_altivec)
556 556
557#endif /* CONFIG_ALTIVEC */ 557#endif /* CONFIG_ALTIVEC */
558 558
559_GLOBAL(execve) 559_GLOBAL(kernel_execve)
560 li r0,__NR_execve 560 li r0,__NR_execve
561 sc 561 sc
562 bnslr 562 bnslr
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c
index abf14aaf905..f5ed8624648 100644
--- a/arch/um/kernel/syscall.c
+++ b/arch/um/kernel/syscall.c
@@ -164,3 +164,16 @@ int next_syscall_index(int limit)
164 spin_unlock(&syscall_lock); 164 spin_unlock(&syscall_lock);
165 return(ret); 165 return(ret);
166} 166}
167
168int kernel_execve(const char *filename, char *const argv[], char *const envp[])
169{
170 mm_segment_t fs;
171 int ret;
172
173 fs = get_fs();
174 set_fs(KERNEL_DS);
175 ret = um_execve(filename, argv, envp);
176 set_fs(fs);
177
178 return ret;
179}
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index 2802524104f..b8285cf1a9c 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -1023,7 +1023,7 @@ ENDPROC(child_rip)
1023 * do_sys_execve asm fallback arguments: 1023 * do_sys_execve asm fallback arguments:
1024 * rdi: name, rsi: argv, rdx: envp, fake frame on the stack 1024 * rdi: name, rsi: argv, rdx: envp, fake frame on the stack
1025 */ 1025 */
1026ENTRY(execve) 1026ENTRY(kernel_execve)
1027 CFI_STARTPROC 1027 CFI_STARTPROC
1028 FAKE_STACK_FRAME $0 1028 FAKE_STACK_FRAME $0
1029 SAVE_ALL 1029 SAVE_ALL
@@ -1036,7 +1036,7 @@ ENTRY(execve)
1036 UNFAKE_STACK_FRAME 1036 UNFAKE_STACK_FRAME
1037 ret 1037 ret
1038 CFI_ENDPROC 1038 CFI_ENDPROC
1039ENDPROC(execve) 1039ENDPROC(kernel_execve)
1040 1040
1041KPROBE_ENTRY(page_fault) 1041KPROBE_ENTRY(page_fault)
1042 errorentry do_page_fault 1042 errorentry do_page_fault