mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-10 03:20:30 +01:00
This adds the new kernel_execve function on all architectures that were using _syscall3() to implement execve. The implementation uses code from the _syscall3 macros provided in the unistd.h header file. I don't have cross-compilers for any of these architectures, so the patch is untested with the exception of i386. Most architectures can probably implement this in a nicer way in assembly or by combining it with the sys_execve implementation itself, but this should do it for now. [[email protected]: m68knommu build fix] [[email protected]: build fix] [[email protected]: build fix] [[email protected]: mips fix] [[email protected]: s390 fix] Signed-off-by: Arnd Bergmann <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Russell King <[email protected]> Cc: Ian Molton <[email protected]> Cc: Mikael Starvik <[email protected]> Cc: David Howells <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: Hirokazu Takata <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Kyle McMartin <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Paul Mundt <[email protected]> Cc: Kazumoto Kojima <[email protected]> Cc: Richard Curnow <[email protected]> Cc: William Lee Irwin III <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Paolo 'Blaisorblade' Giarrusso <[email protected]> Cc: Miles Bader <[email protected]> Cc: Chris Zankel <[email protected]> Cc: "Luck, Tony" <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Roman Zippel <[email protected]> Signed-off-by: Ralf Baechle <[email protected]> Signed-off-by: Bernhard Rosenkraenzer <[email protected]> Signed-off-by: Mark Haverkamp <[email protected]> Signed-off-by: Adrian Bunk <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
34 lines
1.0 KiB
ArmAsm
34 lines
1.0 KiB
ArmAsm
/* in-kernel program execution
|
|
*
|
|
* Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
|
|
* Written by David Howells (dhowells@redhat.com)
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version
|
|
* 2 of the License, or (at your option) any later version.
|
|
*/
|
|
|
|
#include <linux/linkage.h>
|
|
#include <asm/unistd.h>
|
|
|
|
###############################################################################
|
|
#
|
|
# 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[])
|
|
#
|
|
# On entry: GR8/GR9/GR10: arguments to function
|
|
# On return: GR8: syscall return.
|
|
#
|
|
###############################################################################
|
|
.globl kernel_execve
|
|
.type kernel_execve,@function
|
|
kernel_execve:
|
|
setlos __NR_execve,gr7
|
|
tira gr0,#0
|
|
bralr
|
|
|
|
.size kernel_execve,.-kernel_execve
|