Commit 577ade59 authored by Al Viro's avatar Al Viro Committed by Richard Weinberger
Browse files

um: move amd64 variant of mmap(2) to arch/x86/um/syscalls_64.c

parent 8f5c84f3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ extra-y := vmlinux.lds

obj-y = config.o exec.o exitcode.o irq.o ksyms.o mem.o \
	physmem.o process.o ptrace.o reboot.o sigio.o \
	signal.o syscall.o sysrq.o time.o tlb.o trap.o \
	signal.o sysrq.o time.o tlb.o trap.o \
	um_arch.o umid.o maccess.o kmsg_dump.o capflags.o skas/

obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o

arch/um/kernel/syscall.c

deleted100644 → 0
+0 −28
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
 */

#include <linux/file.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/utsname.h>
#include <linux/syscalls.h>
#include <asm/current.h>
#include <asm/mman.h>
#include <linux/uaccess.h>
#include <asm/unistd.h>

long old_mmap(unsigned long addr, unsigned long len,
	      unsigned long prot, unsigned long flags,
	      unsigned long fd, unsigned long offset)
{
	long err = -EINVAL;
	if (offset & ~PAGE_MASK)
		goto out;

	err = ksys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
 out:
	return err;
}
+0 −3
Original line number Diff line number Diff line
@@ -23,9 +23,6 @@ extern syscall_handler_t *sys_call_table[];
				      UPT_SYSCALL_ARG5(&regs->regs), \
				      UPT_SYSCALL_ARG6(&regs->regs)))

extern long old_mmap(unsigned long addr, unsigned long len,
		     unsigned long prot, unsigned long flags,
		     unsigned long fd, unsigned long pgoff);
extern syscall_handler_t sys_modify_ldt;
extern syscall_handler_t sys_arch_prctl;

+0 −3
Original line number Diff line number Diff line
@@ -18,9 +18,6 @@
#define sys_iopl sys_ni_syscall
#define sys_ioperm sys_ni_syscall

/* On UML we call it this way ("old" means it's not mmap2) */
#define sys_mmap old_mmap

#define __SYSCALL(nr, sym) extern asmlinkage long sym(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
#include <asm/syscalls_64.h>

+10 −0
Original line number Diff line number Diff line
@@ -88,3 +88,13 @@ void arch_switch_to(struct task_struct *to)

	arch_prctl(to, ARCH_SET_FS, (void __user *) to->thread.arch.fs);
}

SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
		unsigned long, prot, unsigned long, flags,
		unsigned long, fd, unsigned long, off)
{
	if (off & ~PAGE_MASK)
		return -EINVAL;

	return ksys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
}