aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-05-03 15:10:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-03 16:50:33 -0400
commitd35c7b0e54a596c5a8134d75999b7f391a9c6550 (patch)
tree697bb89dbeccae28eb928b2589f500d747ed38ec /arch/x86/kernel
parent2ddcca36c8bcfa251724fe342c8327451988be0d (diff)
unified (weak) sys_pipe implementation
This replaces the duplicated arch-specific versions of "sys_pipe()" with one unified implementation. This removes almost 250 lines of duplicated code. It's marked __weak, so that *if* an architecture wants to override the default implementation it can do so by simply having its own replacement version, since many architectures use alternate calling conventions for the 'pipe()' system call for legacy reasons (ie traditional UNIX implementations often return the two file descriptors in registers) I still haven't changed the cris version even though Linus says the BKL isn't needed. The arch maintainer can easily do it if there are really no obstacles. Signed-off-by: Ulrich Drepper <drepper@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/sys_i386_32.c17
-rw-r--r--arch/x86/kernel/sys_x86_64.c17
2 files changed, 0 insertions, 34 deletions
diff --git a/arch/x86/kernel/sys_i386_32.c b/arch/x86/kernel/sys_i386_32.c
index a86d26f036e1..d2ab52cc1d6b 100644
--- a/arch/x86/kernel/sys_i386_32.c
+++ b/arch/x86/kernel/sys_i386_32.c
@@ -22,23 +22,6 @@
22#include <asm/uaccess.h> 22#include <asm/uaccess.h>
23#include <asm/unistd.h> 23#include <asm/unistd.h>
24 24
25/*
26 * sys_pipe() is the normal C calling standard for creating
27 * a pipe. It's not the way Unix traditionally does this, though.
28 */
29asmlinkage int sys_pipe(unsigned long __user * fildes)
30{
31 int fd[2];
32 int error;
33
34 error = do_pipe(fd);
35 if (!error) {
36 if (copy_to_user(fildes, fd, 2*sizeof(int)))
37 error = -EFAULT;
38 }
39 return error;
40}
41
42asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, 25asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
43 unsigned long prot, unsigned long flags, 26 unsigned long prot, unsigned long flags,
44 unsigned long fd, unsigned long pgoff) 27 unsigned long fd, unsigned long pgoff)
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
index bd802a5e1aa3..3b360ef33817 100644
--- a/arch/x86/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
@@ -17,23 +17,6 @@
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include <asm/ia32.h> 18#include <asm/ia32.h>
19 19
20/*
21 * sys_pipe() is the normal C calling standard for creating
22 * a pipe. It's not the way Unix traditionally does this, though.
23 */
24asmlinkage long sys_pipe(int __user *fildes)
25{
26 int fd[2];
27 int error;
28
29 error = do_pipe(fd);
30 if (!error) {
31 if (copy_to_user(fildes, fd, 2*sizeof(int)))
32 error = -EFAULT;
33 }
34 return error;
35}
36
37asmlinkage long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, 20asmlinkage long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags,
38 unsigned long fd, unsigned long off) 21 unsigned long fd, unsigned long off)
39{ 22{