2009-03-27 14:25:28 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
|
|
|
|
|
* Copyright (C) 2007-2009 PetaLogix
|
|
|
|
|
* Copyright (C) 2007 John Williams <john.williams@petalogix.com>
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 2006 Atmark Techno, Inc.
|
|
|
|
|
* Yasushi SHOJI <yashi@atmark-techno.com>
|
|
|
|
|
* Tetsuya OHKAWA <tetsuya@atmark-techno.com>
|
|
|
|
|
*
|
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
|
* for more details.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <linux/errno.h>
|
2013-02-01 13:10:35 +01:00
|
|
|
#include <linux/export.h>
|
2009-03-27 14:25:28 +01:00
|
|
|
#include <linux/mm.h>
|
|
|
|
|
#include <linux/smp.h>
|
|
|
|
|
#include <linux/syscalls.h>
|
|
|
|
|
#include <linux/sem.h>
|
|
|
|
|
#include <linux/msg.h>
|
|
|
|
|
#include <linux/shm.h>
|
|
|
|
|
#include <linux/stat.h>
|
|
|
|
|
#include <linux/mman.h>
|
|
|
|
|
#include <linux/sys.h>
|
|
|
|
|
#include <linux/ipc.h>
|
|
|
|
|
#include <linux/file.h>
|
|
|
|
|
#include <linux/err.h>
|
|
|
|
|
#include <linux/fs.h>
|
|
|
|
|
#include <linux/semaphore.h>
|
|
|
|
|
#include <linux/uaccess.h>
|
|
|
|
|
#include <linux/unistd.h>
|
2010-03-24 17:04:11 +09:00
|
|
|
#include <linux/slab.h>
|
2009-03-27 14:25:28 +01:00
|
|
|
#include <asm/syscalls.h>
|
|
|
|
|
|
2009-06-18 19:55:30 +02:00
|
|
|
asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
|
2009-03-27 14:25:28 +01:00
|
|
|
unsigned long prot, unsigned long flags,
|
2009-06-18 19:55:30 +02:00
|
|
|
unsigned long fd, off_t pgoff)
|
2009-03-27 14:25:28 +01:00
|
|
|
{
|
2009-11-30 17:37:04 -05:00
|
|
|
if (pgoff & ~PAGE_MASK)
|
|
|
|
|
return -EINVAL;
|
2009-03-27 14:25:28 +01:00
|
|
|
|
2009-11-30 17:37:04 -05:00
|
|
|
return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT);
|
2009-03-27 14:25:28 +01:00
|
|
|
}
|