+ avr32-implement-kernel_execve.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     AVR32: Implement kernel_execve

has been added to the -mm tree.  Its filename is

     avr32-implement-kernel_execve.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: AVR32: Implement kernel_execve
From: Haavard Skinnemoen <hskinnemoen@xxxxxxxxx>

Move execve() into arch/avr32/kernel/sys_avr32.c, rename it to
kernel_execve() and return the syscall return value directly without
setting errno.

This also gets rid of the __KERNEL_SYSCALLS__ stuff from unistd.h and
expands #ifdef __KERNEL__ to cover everything in unistd.h except the
__NR_foo definitions.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@xxxxxxxxx>
Cc: Arnd Bergmann <arnd@xxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/avr32/kernel/sys_avr32.c |   14 +++++
 include/asm-avr32/unistd.h    |   80 +-------------------------------
 2 files changed, 17 insertions(+), 77 deletions(-)

diff -puN arch/avr32/kernel/sys_avr32.c~avr32-implement-kernel_execve arch/avr32/kernel/sys_avr32.c
--- a/arch/avr32/kernel/sys_avr32.c~avr32-implement-kernel_execve
+++ a/arch/avr32/kernel/sys_avr32.c
@@ -49,3 +49,17 @@ asmlinkage long sys_mmap2(unsigned long 
 		fput(file);
 	return error;
 }
+
+int kernel_execve(const char *file, char **argv, char **envp)
+{
+	register long scno asm("r8") = __NR_execve;
+	register long sc1 asm("r12") = (long)file;
+	register long sc2 asm("r11") = (long)argv;
+	register long sc3 asm("r10") = (long)envp;
+
+	asm volatile("scall"
+		     : "=r"(sc1)
+		     : "r"(scno), "0"(sc1), "r"(sc2), "r"(sc3)
+		     : "cc", "memory");
+	return sc1;
+}
diff -puN include/asm-avr32/unistd.h~avr32-implement-kernel_execve include/asm-avr32/unistd.h
--- a/include/asm-avr32/unistd.h~avr32-implement-kernel_execve
+++ a/include/asm-avr32/unistd.h
@@ -281,30 +281,10 @@
 #define __NR_tee		263
 #define __NR_vmsplice		264
 
+#ifdef __KERNEL__
 #define NR_syscalls		265
 
 
-/*
- * AVR32 calling convention for system calls:
- *   - System call number in r8
- *   - Parameters in r12 and downwards to r9 as well as r6 and r5.
- *   - Return value in r12
- */
-
-/*
- * user-visible error numbers are in the range -1 - -124: see
- * <asm-generic/errno.h>
- */
-
-#define __syscall_return(type, res) do {				\
-		if ((unsigned long)(res) >= (unsigned long)(-125)) {	\
-			errno = -(res);					\
-			res = -1;					\
-		}							\
-		return (type) (res);					\
-	} while (0)
-
-#ifdef __KERNEL__
 #define __ARCH_WANT_IPC_PARSE_VERSION
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_ALARM
@@ -319,62 +299,6 @@
 #define __ARCH_WANT_SYS_GETPGRP
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
-#endif
-
-#if defined(__KERNEL_SYSCALLS__) || defined(__CHECKER__)
-
-#include <linux/types.h>
-#include <linux/linkage.h>
-#include <asm/signal.h>
-
-struct pt_regs;
-
-/*
- * we need this inline - forking from kernel space will result
- * in NO COPY ON WRITE (!!!), until an execve is executed. This
- * is no problem, but for the stack. This is handled by not letting
- * main() use the stack at all after fork(). Thus, no function
- * calls - which means inline code for fork too, as otherwise we
- * would use the stack upon exit from 'fork()'.
- *
- * Actually only pause and fork are needed inline, so that there
- * won't be any messing with the stack from main(), but we define
- * some others too.
- */
-static inline int execve(const char *file, char **argv, char **envp)
-{
-	register long scno asm("r8") = __NR_execve;
-	register long sc1 asm("r12") = (long)file;
-	register long sc2 asm("r11") = (long)argv;
-	register long sc3 asm("r10") = (long)envp;
-	int res;
-
-	asm volatile("scall"
-		     : "=r"(sc1)
-		     : "r"(scno), "0"(sc1), "r"(sc2), "r"(sc3)
-		     : "lr", "memory");
-	res = sc1;
-	__syscall_return(int, res);
-}
-
-asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize);
-asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
-			       struct pt_regs *regs);
-asmlinkage int sys_rt_sigreturn(struct pt_regs *regs);
-asmlinkage int sys_pipe(unsigned long __user *filedes);
-asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
-			  unsigned long prot, unsigned long flags,
-			  unsigned long fd, off_t offset);
-asmlinkage int sys_cacheflush(int operation, void __user *addr, size_t len);
-asmlinkage int sys_fork(struct pt_regs *regs);
-asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
-			 unsigned long parent_tidptr,
-			 unsigned long child_tidptr, struct pt_regs *regs);
-asmlinkage int sys_vfork(struct pt_regs *regs);
-asmlinkage int sys_execve(char __user *ufilename, char __user *__user *uargv,
-			  char __user *__user *uenvp, struct pt_regs *regs);
-
-#endif
 
 /*
  * "Conditional" syscalls
@@ -384,4 +308,6 @@ asmlinkage int sys_execve(char __user *u
  */
 #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall");
 
+#endif /* __KERNEL__ */
+
 #endif /* __ASM_AVR32_UNISTD_H */
_

Patches currently in -mm which might be from hskinnemoen@xxxxxxxxx are

git-mtd.patch
avr32-arch.patch
avr32-config_debug_bugverbose-and-config_frame_pointer.patch
avr32-fix-invalid-constraints-for-stcond.patch
avr32-add-support-for-irq-flags-state-tracing.patch
avr32-turn-off-support-for-discontigmem-and-sparsemem.patch
avr32-always-enable-config_embedded.patch
avr32-export-the-find__bit-functions.patch
avr32-add-defconfig-for-at32stk1002.patch
avr32-use-autoconf-instead-of-marker.patch
avr32-dont-assume-anything-about-max_nr_zones.patch
avr32-add-i-o-port-access-primitives.patch
avr32-use-linux-pfnh.patch
avr32-kill-config_discontigmem-support-completely.patch
avr32-fix-bug-in-__avr32_asr64.patch
avr32-switch-to-generic-timekeeping-framework.patch
avr32-set-kbuild_defconfig.patch
avr32-kprobes-compile-fix.patch
avr32-asm-ioh-should-include-asm-byteorderh.patch
avr32-fix-output-constraints-in-asm-bitopsh.patch
avr32-standardize-pxx_page-macros-fix.patch
generic-ioremap_page_range-implementation.patch
generic-ioremap_page_range-flush_cache_vmap.patch
generic-ioremap_page_range-alpha-conversion.patch
generic-ioremap_page_range-avr32-conversion.patch
generic-ioremap_page_range-cris-conversion.patch
generic-ioremap_page_range-i386-conversion.patch
generic-ioremap_page_range-i386-conversion-fix.patch
generic-ioremap_page_range-m32r-conversion.patch
generic-ioremap_page_range-mips-conversion.patch
generic-ioremap_page_range-mips-conversion-fix.patch
generic-ioremap_page_range-parisc-conversion.patch
generic-ioremap_page_range-s390-conversion.patch
generic-ioremap_page_range-sh-conversion.patch
generic-ioremap_page_range-sh64-conversion.patch
generic-ioremap_page_range-x86_64-conversion.patch
generic-ioremap_page_range-x86_64-conversion-fix.patch
avr32-implement-kernel_execve.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux