aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/syscalls.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-04-06 03:02:57 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-06 03:02:57 -0400
commitf541ae326fa120fa5c57433e4d9a133df212ce41 (patch)
treebdbd94ec72cfc601118051cb35e8617d55510177 /include/linux/syscalls.h
parente255357764f92afcafafbd4879b222b8c752065a (diff)
parent0221c81b1b8eb0cbb6b30a0ced52ead32d2b4e4c (diff)
Merge branch 'linus' into perfcounters/core-v2
Merge reason: we have gathered quite a few conflicts, need to merge upstream Conflicts: arch/powerpc/kernel/Makefile arch/x86/ia32/ia32entry.S arch/x86/include/asm/hardirq.h arch/x86/include/asm/unistd_32.h arch/x86/include/asm/unistd_64.h arch/x86/kernel/cpu/common.c arch/x86/kernel/irq.c arch/x86/kernel/syscall_table_32.S arch/x86/mm/iomap_32.c include/linux/sched.h kernel/Makefile Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/syscalls.h')
-rw-r--r--include/linux/syscalls.h64
1 files changed, 62 insertions, 2 deletions
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index ab1d77247395..471143bf2aae 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -66,6 +66,7 @@ struct perf_counter_hw_event;
66#include <asm/signal.h> 66#include <asm/signal.h>
67#include <linux/quota.h> 67#include <linux/quota.h>
68#include <linux/key.h> 68#include <linux/key.h>
69#include <linux/ftrace.h>
69 70
70#define __SC_DECL1(t1, a1) t1 a1 71#define __SC_DECL1(t1, a1) t1 a1
71#define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__) 72#define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__)
@@ -96,7 +97,46 @@ struct perf_counter_hw_event;
96#define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) 97#define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__)
97#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) 98#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__)
98 99
100#ifdef CONFIG_FTRACE_SYSCALLS
101#define __SC_STR_ADECL1(t, a) #a
102#define __SC_STR_ADECL2(t, a, ...) #a, __SC_STR_ADECL1(__VA_ARGS__)
103#define __SC_STR_ADECL3(t, a, ...) #a, __SC_STR_ADECL2(__VA_ARGS__)
104#define __SC_STR_ADECL4(t, a, ...) #a, __SC_STR_ADECL3(__VA_ARGS__)
105#define __SC_STR_ADECL5(t, a, ...) #a, __SC_STR_ADECL4(__VA_ARGS__)
106#define __SC_STR_ADECL6(t, a, ...) #a, __SC_STR_ADECL5(__VA_ARGS__)
107
108#define __SC_STR_TDECL1(t, a) #t
109#define __SC_STR_TDECL2(t, a, ...) #t, __SC_STR_TDECL1(__VA_ARGS__)
110#define __SC_STR_TDECL3(t, a, ...) #t, __SC_STR_TDECL2(__VA_ARGS__)
111#define __SC_STR_TDECL4(t, a, ...) #t, __SC_STR_TDECL3(__VA_ARGS__)
112#define __SC_STR_TDECL5(t, a, ...) #t, __SC_STR_TDECL4(__VA_ARGS__)
113#define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__)
114
115#define SYSCALL_METADATA(sname, nb) \
116 static const struct syscall_metadata __used \
117 __attribute__((__aligned__(4))) \
118 __attribute__((section("__syscalls_metadata"))) \
119 __syscall_meta_##sname = { \
120 .name = "sys"#sname, \
121 .nb_args = nb, \
122 .types = types_##sname, \
123 .args = args_##sname, \
124 }
125
126#define SYSCALL_DEFINE0(sname) \
127 static const struct syscall_metadata __used \
128 __attribute__((__aligned__(4))) \
129 __attribute__((section("__syscalls_metadata"))) \
130 __syscall_meta_##sname = { \
131 .name = "sys_"#sname, \
132 .nb_args = 0, \
133 }; \
134 asmlinkage long sys_##sname(void)
135
136#else
99#define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) 137#define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void)
138#endif
139
100#define SYSCALL_DEFINE1(name, ...) SYSCALL_DEFINEx(1, _##name, __VA_ARGS__) 140#define SYSCALL_DEFINE1(name, ...) SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
101#define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__) 141#define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
102#define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__) 142#define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
@@ -118,10 +158,26 @@ struct perf_counter_hw_event;
118#endif 158#endif
119#endif 159#endif
120 160
161#ifdef CONFIG_FTRACE_SYSCALLS
162#define SYSCALL_DEFINEx(x, sname, ...) \
163 static const char *types_##sname[] = { \
164 __SC_STR_TDECL##x(__VA_ARGS__) \
165 }; \
166 static const char *args_##sname[] = { \
167 __SC_STR_ADECL##x(__VA_ARGS__) \
168 }; \
169 SYSCALL_METADATA(sname, x); \
170 __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
171#else
172#define SYSCALL_DEFINEx(x, sname, ...) \
173 __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
174#endif
175
121#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 176#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
122 177
123#define SYSCALL_DEFINE(name) static inline long SYSC_##name 178#define SYSCALL_DEFINE(name) static inline long SYSC_##name
124#define SYSCALL_DEFINEx(x, name, ...) \ 179
180#define __SYSCALL_DEFINEx(x, name, ...) \
125 asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__)); \ 181 asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__)); \
126 static inline long SYSC##name(__SC_DECL##x(__VA_ARGS__)); \ 182 static inline long SYSC##name(__SC_DECL##x(__VA_ARGS__)); \
127 asmlinkage long SyS##name(__SC_LONG##x(__VA_ARGS__)) \ 183 asmlinkage long SyS##name(__SC_LONG##x(__VA_ARGS__)) \
@@ -135,7 +191,7 @@ struct perf_counter_hw_event;
135#else /* CONFIG_HAVE_SYSCALL_WRAPPERS */ 191#else /* CONFIG_HAVE_SYSCALL_WRAPPERS */
136 192
137#define SYSCALL_DEFINE(name) asmlinkage long sys_##name 193#define SYSCALL_DEFINE(name) asmlinkage long sys_##name
138#define SYSCALL_DEFINEx(x, name, ...) \ 194#define __SYSCALL_DEFINEx(x, name, ...) \
139 asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__)) 195 asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__))
140 196
141#endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */ 197#endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */
@@ -462,6 +518,10 @@ asmlinkage long sys_pread64(unsigned int fd, char __user *buf,
462 size_t count, loff_t pos); 518 size_t count, loff_t pos);
463asmlinkage long sys_pwrite64(unsigned int fd, const char __user *buf, 519asmlinkage long sys_pwrite64(unsigned int fd, const char __user *buf,
464 size_t count, loff_t pos); 520 size_t count, loff_t pos);
521asmlinkage long sys_preadv(unsigned long fd, const struct iovec __user *vec,
522 unsigned long vlen, unsigned long pos_l, unsigned long pos_h);
523asmlinkage long sys_pwritev(unsigned long fd, const struct iovec __user *vec,
524 unsigned long vlen, unsigned long pos_l, unsigned long pos_h);
465asmlinkage long sys_getcwd(char __user *buf, unsigned long size); 525asmlinkage long sys_getcwd(char __user *buf, unsigned long size);
466asmlinkage long sys_mkdir(const char __user *pathname, int mode); 526asmlinkage long sys_mkdir(const char __user *pathname, int mode);
467asmlinkage long sys_chdir(const char __user *filename); 527asmlinkage long sys_chdir(const char __user *filename);