aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Zankel <chris@zankel.net>2012-10-23 23:17:05 -0400
committerChris Zankel <chris@zankel.net>2012-10-25 17:53:36 -0400
commit2f72d4f6a29cf84c40fc05c76020b347b4774393 (patch)
tree3877c9fdac29b33d2beaab2c58c36a0d6f7649ca
parent6f0c0580b70c89094b3422ba81118c7b959c7556 (diff)
xtensa: allow multi-inclusion for uapi/unistd.h
Xtensa implements a method that allows to generate a arbitrary output for each system call by defining the __SYSCALL(number, function, num_args). This usually requires to include uapi/unistd.h twice. Instead of removing the guard agains multiple inclusion entirely, allow to include unistd.h again only if __SYSCALL is defined. Note that __SYSCALL gets always undefined at the end of the file. Signed-off-by: Chris Zankel <chris@zankel.net>
-rw-r--r--arch/xtensa/include/asm/unistd.h14
-rw-r--r--arch/xtensa/include/uapi/asm/unistd.h14
-rw-r--r--arch/xtensa/kernel/syscall.c7
3 files changed, 10 insertions, 25 deletions
diff --git a/arch/xtensa/include/asm/unistd.h b/arch/xtensa/include/asm/unistd.h
index 9ef1c31d2c8..d9fa52dbfba 100644
--- a/arch/xtensa/include/asm/unistd.h
+++ b/arch/xtensa/include/asm/unistd.h
@@ -1,16 +1,8 @@
1/* 1#ifndef _XTENSA_UNISTD_H
2 * include/asm-xtensa/unistd.h 2#define _XTENSA_UNISTD_H
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 */
10 3
11#include <uapi/asm/unistd.h> 4#include <uapi/asm/unistd.h>
12 5
13
14/* 6/*
15 * "Conditional" syscalls 7 * "Conditional" syscalls
16 * 8 *
@@ -37,3 +29,5 @@
37#define __IGNORE_mmap /* use mmap2 */ 29#define __IGNORE_mmap /* use mmap2 */
38#define __IGNORE_vfork /* use clone */ 30#define __IGNORE_vfork /* use clone */
39#define __IGNORE_fadvise64 /* use fadvise64_64 */ 31#define __IGNORE_fadvise64 /* use fadvise64_64 */
32
33#endif /* _XTENSA_UNISTD_H */
diff --git a/arch/xtensa/include/uapi/asm/unistd.h b/arch/xtensa/include/uapi/asm/unistd.h
index 479abaea5aa..1fd157f3121 100644
--- a/arch/xtensa/include/uapi/asm/unistd.h
+++ b/arch/xtensa/include/uapi/asm/unistd.h
@@ -1,14 +1,4 @@
1/* 1#if !defined(_UAPI_XTENSA_UNISTD_H) || defined(__SYSCALL)
2 * include/asm-xtensa/unistd.h
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 - 2012 Tensilica Inc.
9 */
10
11#ifndef _UAPI_XTENSA_UNISTD_H
12#define _UAPI_XTENSA_UNISTD_H 2#define _UAPI_XTENSA_UNISTD_H
13 3
14#ifndef __SYSCALL 4#ifndef __SYSCALL
@@ -759,4 +749,6 @@ __SYSCALL(331, sys_kcmp, 5)
759 749
760#define SYS_XTENSA_COUNT 5 /* count */ 750#define SYS_XTENSA_COUNT 5 /* count */
761 751
752#undef __SYSCALL
753
762#endif /* _UAPI_XTENSA_UNISTD_H */ 754#endif /* _UAPI_XTENSA_UNISTD_H */
diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c
index a5c01e74d5d..5702065f472 100644
--- a/arch/xtensa/kernel/syscall.c
+++ b/arch/xtensa/kernel/syscall.c
@@ -32,10 +32,8 @@ typedef void (*syscall_t)(void);
32syscall_t sys_call_table[__NR_syscall_count] /* FIXME __cacheline_aligned */= { 32syscall_t sys_call_table[__NR_syscall_count] /* FIXME __cacheline_aligned */= {
33 [0 ... __NR_syscall_count - 1] = (syscall_t)&sys_ni_syscall, 33 [0 ... __NR_syscall_count - 1] = (syscall_t)&sys_ni_syscall,
34 34
35#undef __SYSCALL
36#define __SYSCALL(nr,symbol,nargs) [ nr ] = (syscall_t)symbol, 35#define __SYSCALL(nr,symbol,nargs) [ nr ] = (syscall_t)symbol,
37#undef __KERNEL_SYSCALLS__ 36#include <uapi/asm/unistd.h>
38#include <asm/unistd.h>
39}; 37};
40 38
41asmlinkage long xtensa_shmat(int shmid, char __user *shmaddr, int shmflg) 39asmlinkage long xtensa_shmat(int shmid, char __user *shmaddr, int shmflg)
@@ -49,7 +47,8 @@ asmlinkage long xtensa_shmat(int shmid, char __user *shmaddr, int shmflg)
49 return (long)ret; 47 return (long)ret;
50} 48}
51 49
52asmlinkage long xtensa_fadvise64_64(int fd, int advice, unsigned long long offset, unsigned long long len) 50asmlinkage long xtensa_fadvise64_64(int fd, int advice,
51 unsigned long long offset, unsigned long long len)
53{ 52{
54 return sys_fadvise64_64(fd, offset, len, advice); 53 return sys_fadvise64_64(fd, offset, len, advice);
55} 54}