blob: 63647c586b43f3415747c1071df61871e95281e3 [file] [log] [blame]
Michal Simek7dcbbb22009-03-27 14:25:28 +01001/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
4 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
5 *
6 * Copyright (C) 2006 Atmark Techno, Inc.
7 * Yasushi SHOJI <yashi@atmark-techno.com>
8 * Tetsuya OHKAWA <tetsuya@atmark-techno.com>
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file "COPYING" in the main directory of this archive
12 * for more details.
13 */
14
15#include <linux/errno.h>
16#include <linux/mm.h>
17#include <linux/smp.h>
Michal Simek7dcbbb22009-03-27 14:25:28 +010018#include <linux/syscalls.h>
19#include <linux/sem.h>
20#include <linux/msg.h>
21#include <linux/shm.h>
22#include <linux/stat.h>
23#include <linux/mman.h>
24#include <linux/sys.h>
25#include <linux/ipc.h>
Michal Simek7dcbbb22009-03-27 14:25:28 +010026#include <linux/file.h>
27#include <linux/module.h>
28#include <linux/err.h>
29#include <linux/fs.h>
Michal Simek7dcbbb22009-03-27 14:25:28 +010030#include <linux/semaphore.h>
Michal Simek7dcbbb22009-03-27 14:25:28 +010031#include <linux/uaccess.h>
32#include <linux/unistd.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090033#include <linux/slab.h>
Michal Simek7dcbbb22009-03-27 14:25:28 +010034
35#include <asm/syscalls.h>
Michal Simek7dcbbb22009-03-27 14:25:28 +010036
Arnd Bergmanne5135882009-06-18 19:55:30 +020037asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
Michal Simek7dcbbb22009-03-27 14:25:28 +010038 unsigned long prot, unsigned long flags,
Arnd Bergmanne5135882009-06-18 19:55:30 +020039 unsigned long fd, off_t pgoff)
Michal Simek7dcbbb22009-03-27 14:25:28 +010040{
Al Virof8b72562009-11-30 17:37:04 -050041 if (pgoff & ~PAGE_MASK)
42 return -EINVAL;
Michal Simek7dcbbb22009-03-27 14:25:28 +010043
Al Virof8b72562009-11-30 17:37:04 -050044 return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT);
Michal Simek7dcbbb22009-03-27 14:25:28 +010045}