diff options
author | Christoph Hellwig <hch@lst.de> | 2010-03-10 18:21:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 18:52:32 -0500 |
commit | a4679373cf4ee0e7792dc56205365732b725c2c1 (patch) | |
tree | 6cf8040f608ad46ae7c605284af1ca585fb50eaa /arch/h8300 | |
parent | 5d0e52830e9ae09b872567f4aca3dfb5b5918079 (diff) |
Add generic sys_old_mmap()
Add a generic implementation of the old mmap() syscall, which expects its
argument in a memory block and switch all architectures over to use it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: James Morris <jmorris@namei.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/h8300')
-rw-r--r-- | arch/h8300/include/asm/unistd.h | 1 | ||||
-rw-r--r-- | arch/h8300/kernel/sys_h8300.c | 34 | ||||
-rw-r--r-- | arch/h8300/kernel/syscalls.S | 2 |
3 files changed, 2 insertions, 35 deletions
diff --git a/arch/h8300/include/asm/unistd.h b/arch/h8300/include/asm/unistd.h index 3bea0b3eb24f..54dab4726954 100644 --- a/arch/h8300/include/asm/unistd.h +++ b/arch/h8300/include/asm/unistd.h | |||
@@ -348,6 +348,7 @@ | |||
348 | #define __ARCH_WANT_SYS_LLSEEK | 348 | #define __ARCH_WANT_SYS_LLSEEK |
349 | #define __ARCH_WANT_SYS_NICE | 349 | #define __ARCH_WANT_SYS_NICE |
350 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | 350 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT |
351 | #define __ARCH_WANT_SYS_OLD_MMAP | ||
351 | #define __ARCH_WANT_SYS_OLD_SELECT | 352 | #define __ARCH_WANT_SYS_OLD_SELECT |
352 | #define __ARCH_WANT_SYS_OLDUMOUNT | 353 | #define __ARCH_WANT_SYS_OLDUMOUNT |
353 | #define __ARCH_WANT_SYS_SIGPENDING | 354 | #define __ARCH_WANT_SYS_SIGPENDING |
diff --git a/arch/h8300/kernel/sys_h8300.c b/arch/h8300/kernel/sys_h8300.c index e9a3ecf90c9c..1f13fd6e5309 100644 --- a/arch/h8300/kernel/sys_h8300.c +++ b/arch/h8300/kernel/sys_h8300.c | |||
@@ -27,40 +27,6 @@ | |||
27 | #include <asm/unistd.h> | 27 | #include <asm/unistd.h> |
28 | 28 | ||
29 | /* | 29 | /* |
30 | * Perform the select(nd, in, out, ex, tv) and mmap() system | ||
31 | * calls. Linux/m68k cloned Linux/i386, which didn't use to be able to | ||
32 | * handle more than 4 system call parameters, so these system calls | ||
33 | * used a memory block for parameter passing.. | ||
34 | */ | ||
35 | |||
36 | struct mmap_arg_struct { | ||
37 | unsigned long addr; | ||
38 | unsigned long len; | ||
39 | unsigned long prot; | ||
40 | unsigned long flags; | ||
41 | unsigned long fd; | ||
42 | unsigned long offset; | ||
43 | }; | ||
44 | |||
45 | asmlinkage int old_mmap(struct mmap_arg_struct *arg) | ||
46 | { | ||
47 | struct mmap_arg_struct a; | ||
48 | int error = -EFAULT; | ||
49 | |||
50 | if (copy_from_user(&a, arg, sizeof(a))) | ||
51 | goto out; | ||
52 | |||
53 | error = -EINVAL; | ||
54 | if (a.offset & ~PAGE_MASK) | ||
55 | goto out; | ||
56 | |||
57 | error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, | ||
58 | a.offset >> PAGE_SHIFT); | ||
59 | out: | ||
60 | return error; | ||
61 | } | ||
62 | |||
63 | /* | ||
64 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | 30 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. |
65 | * | 31 | * |
66 | * This is really horribly ugly. | 32 | * This is really horribly ugly. |
diff --git a/arch/h8300/kernel/syscalls.S b/arch/h8300/kernel/syscalls.S index fe5ae20e60c5..faefaff7d43d 100644 --- a/arch/h8300/kernel/syscalls.S +++ b/arch/h8300/kernel/syscalls.S | |||
@@ -104,7 +104,7 @@ SYMBOL_NAME_LABEL(sys_call_table) | |||
104 | .long SYMBOL_NAME(sys_swapon) | 104 | .long SYMBOL_NAME(sys_swapon) |
105 | .long SYMBOL_NAME(sys_reboot) | 105 | .long SYMBOL_NAME(sys_reboot) |
106 | .long SYMBOL_NAME(sys_old_readdir) | 106 | .long SYMBOL_NAME(sys_old_readdir) |
107 | .long SYMBOL_NAME(old_mmap) /* 90 */ | 107 | .long SYMBOL_NAME(sys_old_mmap) /* 90 */ |
108 | .long SYMBOL_NAME(sys_munmap) | 108 | .long SYMBOL_NAME(sys_munmap) |
109 | .long SYMBOL_NAME(sys_truncate) | 109 | .long SYMBOL_NAME(sys_truncate) |
110 | .long SYMBOL_NAME(sys_ftruncate) | 110 | .long SYMBOL_NAME(sys_ftruncate) |