blob: 78886e2417a6a6cc1ef4a2ff28b0e9a5afd96033 [file] [log] [blame]
Chris Metcalf867e3592010-05-28 23:09:12 -04001/*
2 * syscalls.h - Linux syscall interfaces (arch-specific)
3 *
4 * Copyright (c) 2008 Jaswinder Singh Rajput
5 * Copyright 2010 Tilera Corporation. All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, version 2.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
14 * NON INFRINGEMENT. See the GNU General Public License for
15 * more details.
16 */
17
18#ifndef _ASM_TILE_SYSCALLS_H
19#define _ASM_TILE_SYSCALLS_H
20
21#include <linux/compiler.h>
22#include <linux/linkage.h>
23#include <linux/signal.h>
24#include <linux/types.h>
Chris Metcalf0707ad32010-06-25 17:04:17 -040025#include <linux/compat.h>
26
27/* The array of function pointers for syscalls. */
28extern void *sys_call_table[];
29#ifdef CONFIG_COMPAT
30extern void *compat_sys_call_table[];
31#endif
32
33/*
34 * Note that by convention, any syscall which requires the current
Chris Metcalfd929b6a2010-10-14 14:34:33 -040035 * register set takes an additional "struct pt_regs *" pointer; a
36 * _sys_xxx() trampoline in intvec*.S just sets up the pointer and
37 * jumps to sys_xxx().
Chris Metcalf0707ad32010-06-25 17:04:17 -040038 */
Chris Metcalf867e3592010-05-28 23:09:12 -040039
40/* kernel/sys.c */
41ssize_t sys32_readahead(int fd, u32 offset_lo, u32 offset_hi, u32 count);
42long sys32_fadvise64(int fd, u32 offset_lo, u32 offset_hi,
43 u32 len, int advice);
44int sys32_fadvise64_64(int fd, u32 offset_lo, u32 offset_hi,
45 u32 len_lo, u32 len_hi, int advice);
Chris Metcalfcd6f32a2012-03-29 15:25:59 -040046long sys_cacheflush(unsigned long addr, unsigned long len,
47 unsigned long flags);
Chris Metcalfd929b6a2010-10-14 14:34:33 -040048#ifndef __tilegx__ /* No mmap() in the 32-bit kernel. */
49#define sys_mmap sys_mmap
Chris Metcalf0707ad32010-06-25 17:04:17 -040050#endif
51
Chris Metcalf867e3592010-05-28 23:09:12 -040052#ifndef __tilegx__
53/* mm/fault.c */
Chris Metcalf6b14e412012-10-23 13:30:54 -040054long sys_cmpxchg_badaddr(unsigned long address);
Chris Metcalf0707ad32010-06-25 17:04:17 -040055#endif
56
57#ifdef CONFIG_COMPAT
Chris Metcalf0707ad32010-06-25 17:04:17 -040058/* These four are not defined for 64-bit, but serve as "compat" syscalls. */
59long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg);
60long sys_fstat64(unsigned long fd, struct stat64 __user *statbuf);
61long sys_truncate64(const char __user *path, loff_t length);
62long sys_ftruncate64(unsigned int fd, loff_t length);
Chris Metcalf867e3592010-05-28 23:09:12 -040063#endif
64
Chris Metcalf6b14e412012-10-23 13:30:54 -040065/* Provide versions of standard syscalls that use current_pt_regs(). */
Chris Metcalf6b14e412012-10-23 13:30:54 -040066long sys_rt_sigreturn(void);
Chris Metcalf6b14e412012-10-23 13:30:54 -040067#define sys_rt_sigreturn sys_rt_sigreturn
Chris Metcalf6b14e412012-10-23 13:30:54 -040068
69/* These are the intvec*.S trampolines. */
70long _sys_rt_sigreturn(void);
71long _sys_clone(unsigned long clone_flags, unsigned long newsp,
72 void __user *parent_tid, void __user *child_tid);
Chris Metcalfd929b6a2010-10-14 14:34:33 -040073
74#include <asm-generic/syscalls.h>
75
Chris Metcalf867e3592010-05-28 23:09:12 -040076#endif /* _ASM_TILE_SYSCALLS_H */