Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4679373 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds
Browse files

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: default avatarChristoph 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: default avatarH. 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: default avatarJesper Nilsson <jesper.nilsson@axis.com>
Acked-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Acked-by: default avatarGreg Ungerer <gerg@uclinux.org>
Acked-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5d0e5283
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -443,6 +443,7 @@
#define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_OLD_MMAP
#define __ARCH_WANT_SYS_OLD_SELECT

#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
+1 −1
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@
		CALL(sys_swapon)
		CALL(sys_reboot)
		CALL(OBSOLETE(sys_old_readdir))	/* used by libc4 */
/* 90 */	CALL(OBSOLETE(old_mmap))	/* used by libc4 */
/* 90 */	CALL(OBSOLETE(sys_old_mmap))	/* used by libc4 */
		CALL(sys_munmap)
		CALL(sys_truncate)
		CALL(sys_ftruncate)
+0 −26
Original line number Diff line number Diff line
@@ -28,32 +28,6 @@
#include <linux/ipc.h>
#include <linux/uaccess.h>

struct mmap_arg_struct {
	unsigned long addr;
	unsigned long len;
	unsigned long prot;
	unsigned long flags;
	unsigned long fd;
	unsigned long offset;
};

asmlinkage int old_mmap(struct mmap_arg_struct __user *arg)
{
	int error = -EFAULT;
	struct mmap_arg_struct a;

	if (copy_from_user(&a, arg, sizeof(a)))
		goto out;

	error = -EINVAL;
	if (a.offset & ~PAGE_MASK)
		goto out;

	error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT);
out:
	return error;
}

#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
/*
 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
+1 −1
Original line number Diff line number Diff line
@@ -692,7 +692,7 @@ sys_call_table:
	.long sys_swapon
	.long sys_reboot
	.long sys_old_readdir
	.long old_mmap		/* 90 */
	.long sys_old_mmap	/* 90 */
	.long sys_munmap
	.long sys_truncate
	.long sys_ftruncate
+1 −1
Original line number Diff line number Diff line
@@ -615,7 +615,7 @@ sys_call_table:
	.long sys_swapon
	.long sys_reboot
	.long sys_old_readdir
	.long old_mmap		/* 90 */
	.long sys_old_mmap	/* 90 */
	.long sys_munmap
	.long sys_truncate
	.long sys_ftruncate
Loading