aboutsummaryrefslogtreecommitdiffstats
path: root/arch/hexagon/include/asm
diff options
context:
space:
mode:
authorRichard Kuo <rkuo@codeaurora.org>2011-10-31 19:35:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-01 10:34:18 -0400
commitb9398a84590be3a828c168ed25bf1fd3d637988a (patch)
tree8467675f8d6787c7036beb3ddf599249a7903658 /arch/hexagon/include/asm
parent750850189b2b7e43c03f33bf5741887e8ca07d16 (diff)
Hexagon: Add syscalls
Signed-off-by: Richard Kuo <rkuo@codeaurora.org> Signed-off-by: Linas Vepstas <linas@codeaurora.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/hexagon/include/asm')
-rw-r--r--arch/hexagon/include/asm/syscall.h54
-rw-r--r--arch/hexagon/include/asm/unistd.h36
2 files changed, 90 insertions, 0 deletions
diff --git a/arch/hexagon/include/asm/syscall.h b/arch/hexagon/include/asm/syscall.h
new file mode 100644
index 00000000000..3e7d61d38d9
--- /dev/null
+++ b/arch/hexagon/include/asm/syscall.h
@@ -0,0 +1,54 @@
1/*
2 * Syscall support for the Hexagon architecture
3 *
4 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 and
8 * only version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301, USA.
19 */
20
21#ifndef _ASM_HEXAGON_SYSCALL_H
22#define _ASM_HEXAGON_SYSCALL_H
23
24typedef long (*syscall_fn)(unsigned long, unsigned long,
25 unsigned long, unsigned long,
26 unsigned long, unsigned long);
27
28asmlinkage int sys_execve(char __user *ufilename, char __user * __user *argv,
29 char __user * __user *envp);
30asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
31 unsigned long parent_tidp, unsigned long child_tidp);
32
33#define sys_execve sys_execve
34#define sys_clone sys_clone
35
36#include <asm-generic/syscalls.h>
37
38extern void *sys_call_table[];
39
40static inline long syscall_get_nr(struct task_struct *task,
41 struct pt_regs *regs)
42{
43 return regs->r06;
44}
45
46static inline void syscall_get_arguments(struct task_struct *task,
47 struct pt_regs *regs,
48 unsigned int i, unsigned int n,
49 unsigned long *args)
50{
51 BUG_ON(i + n > 6);
52 memcpy(args, &(&regs->r00)[i], n * sizeof(args[0]));
53}
54#endif
diff --git a/arch/hexagon/include/asm/unistd.h b/arch/hexagon/include/asm/unistd.h
new file mode 100644
index 00000000000..4d0ecde3665
--- /dev/null
+++ b/arch/hexagon/include/asm/unistd.h
@@ -0,0 +1,36 @@
1/*
2 * Syscall support for Hexagon
3 *
4 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 and
8 * only version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301, USA.
19 */
20
21#if !defined(_ASM_HEXAGON_UNISTD_H) || defined(__SYSCALL)
22#define _ASM_HEXAGON_UNISTD_H
23
24/*
25 * The kernel pulls this unistd.h in three different ways:
26 * 1. the "normal" way which gets all the __NR defines
27 * 2. with __SYSCALL defined to produce function declarations
28 * 3. with __SYSCALL defined to produce syscall table initialization
29 * See also: syscalltab.c
30 */
31
32#define sys_mmap2 sys_mmap_pgoff
33
34#include <asm-generic/unistd.h>
35
36#endif