2 * File: arch/blackfin/kernel/sys_bfin.c
7 * Description: This file contains various random system calls that
8 * have a non-standard calling sequence on the Linux/bfin
12 * Copyright 2004-2006 Analog Devices Inc.
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, see the file COPYING, or write
28 * to the Free Software Foundation, Inc.,
29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 #include <linux/smp_lock.h>
33 #include <linux/spinlock.h>
34 #include <linux/sem.h>
35 #include <linux/msg.h>
36 #include <linux/shm.h>
37 #include <linux/syscalls.h>
38 #include <linux/mman.h>
39 #include <linux/file.h>
40 #include <linux/uaccess.h>
41 #include <linux/ipc.h>
42 #include <linux/unistd.h>
44 #include <asm/cacheflush.h>
48 * sys_pipe() is the normal C calling standard for creating
49 * a pipe. It's not the way unix traditionally does this, though.
51 asmlinkage int sys_pipe(unsigned long *fildes)
58 if (copy_to_user(fildes, fd, 2 * sizeof(int)))
64 /* common code for old and new mmaps */
66 do_mmap2(unsigned long addr, unsigned long len,
67 unsigned long prot, unsigned long flags,
68 unsigned long fd, unsigned long pgoff)
71 struct file *file = NULL;
73 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
74 if (!(flags & MAP_ANONYMOUS)) {
80 down_write(¤t->mm->mmap_sem);
81 error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
82 up_write(¤t->mm->mmap_sem);
90 asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
91 unsigned long prot, unsigned long flags,
92 unsigned long fd, unsigned long pgoff)
94 return do_mmap2(addr, len, prot, flags, fd, pgoff);
97 asmlinkage int sys_getpagesize(void)
102 asmlinkage void *sys_sram_alloc(size_t size, unsigned long flags)
104 return sram_alloc_with_lsl(size, flags);
107 asmlinkage int sys_sram_free(const void *addr)
109 return sram_free_with_lsl(addr);
112 asmlinkage void *sys_dma_memcpy(void *dest, const void *src, size_t len)
114 return safe_dma_memcpy(dest, src, len);