Chris Zankel | fc4fb2a | 2006-12-10 02:18:52 -0800 | [diff] [blame] | 1 | /* |
| 2 | * arch/xtensa/kernel/syscall.c |
| 3 | * |
| 4 | * This file is subject to the terms and conditions of the GNU General Public |
| 5 | * License. See the file "COPYING" in the main directory of this archive |
| 6 | * for more details. |
| 7 | * |
| 8 | * Copyright (C) 2001 - 2005 Tensilica Inc. |
| 9 | * Copyright (C) 2000 Silicon Graphics, Inc. |
| 10 | * Copyright (C) 1995 - 2000 by Ralf Baechle |
| 11 | * |
| 12 | * Joe Taylor <joe@tensilica.com, joetylr@yahoo.com> |
| 13 | * Marc Gauthier <marc@tensilica.com, marc@alumni.uwaterloo.ca> |
| 14 | * Chris Zankel <chris@zankel.net> |
| 15 | * Kevin Chea |
| 16 | * |
| 17 | */ |
| 18 | #include <asm/uaccess.h> |
Chris Zankel | 1c0350b | 2006-12-13 00:34:32 -0800 | [diff] [blame] | 19 | #include <asm/syscall.h> |
Chris Zankel | fc4fb2a | 2006-12-10 02:18:52 -0800 | [diff] [blame] | 20 | #include <asm/unistd.h> |
| 21 | #include <linux/linkage.h> |
| 22 | #include <linux/stringify.h> |
| 23 | #include <linux/errno.h> |
| 24 | #include <linux/syscalls.h> |
| 25 | #include <linux/file.h> |
| 26 | #include <linux/fs.h> |
| 27 | #include <linux/mman.h> |
| 28 | #include <linux/shm.h> |
| 29 | |
| 30 | typedef void (*syscall_t)(void); |
| 31 | |
| 32 | syscall_t sys_call_table[__NR_syscall_count] /* FIXME __cacheline_aligned */= { |
| 33 | [0 ... __NR_syscall_count - 1] = (syscall_t)&sys_ni_syscall, |
| 34 | |
Chris Zankel | fc4fb2a | 2006-12-10 02:18:52 -0800 | [diff] [blame] | 35 | #define __SYSCALL(nr,symbol,nargs) [ nr ] = (syscall_t)symbol, |
Chris Zankel | 2f72d4f | 2012-10-23 20:17:05 -0700 | [diff] [blame^] | 36 | #include <uapi/asm/unistd.h> |
Chris Zankel | fc4fb2a | 2006-12-10 02:18:52 -0800 | [diff] [blame] | 37 | }; |
| 38 | |
Chris Zankel | fc4fb2a | 2006-12-10 02:18:52 -0800 | [diff] [blame] | 39 | asmlinkage long xtensa_shmat(int shmid, char __user *shmaddr, int shmflg) |
| 40 | { |
| 41 | unsigned long ret; |
| 42 | long err; |
| 43 | |
Will Deacon | 079a96a | 2012-07-30 14:42:38 -0700 | [diff] [blame] | 44 | err = do_shmat(shmid, shmaddr, shmflg, &ret, SHMLBA); |
Chris Zankel | fc4fb2a | 2006-12-10 02:18:52 -0800 | [diff] [blame] | 45 | if (err) |
| 46 | return err; |
| 47 | return (long)ret; |
| 48 | } |
| 49 | |
Chris Zankel | 2f72d4f | 2012-10-23 20:17:05 -0700 | [diff] [blame^] | 50 | asmlinkage long xtensa_fadvise64_64(int fd, int advice, |
| 51 | unsigned long long offset, unsigned long long len) |
Chris Zankel | bc671aa | 2007-08-05 10:22:58 -0700 | [diff] [blame] | 52 | { |
| 53 | return sys_fadvise64_64(fd, offset, len, advice); |
| 54 | } |
| 55 | |