aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/syscalls.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/syscalls.h')
-rw-r--r--include/linux/syscalls.h45
1 files changed, 29 insertions, 16 deletions
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 18cd0684fc4e..83ecc1749ef6 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -62,6 +62,7 @@ struct robust_list_head;
62struct getcpu_cache; 62struct getcpu_cache;
63struct old_linux_dirent; 63struct old_linux_dirent;
64struct perf_event_attr; 64struct perf_event_attr;
65struct file_handle;
65 66
66#include <linux/types.h> 67#include <linux/types.h>
67#include <linux/aio_abi.h> 68#include <linux/aio_abi.h>
@@ -125,62 +126,66 @@ extern struct trace_event_functions enter_syscall_print_funcs;
125extern struct trace_event_functions exit_syscall_print_funcs; 126extern struct trace_event_functions exit_syscall_print_funcs;
126 127
127#define SYSCALL_TRACE_ENTER_EVENT(sname) \ 128#define SYSCALL_TRACE_ENTER_EVENT(sname) \
128 static struct syscall_metadata \ 129 static struct syscall_metadata __syscall_meta_##sname; \
129 __attribute__((__aligned__(4))) __syscall_meta_##sname; \
130 static struct ftrace_event_call __used \ 130 static struct ftrace_event_call __used \
131 __attribute__((__aligned__(4))) \
132 __attribute__((section("_ftrace_events"))) \
133 event_enter_##sname = { \ 131 event_enter_##sname = { \
134 .name = "sys_enter"#sname, \ 132 .name = "sys_enter"#sname, \
135 .class = &event_class_syscall_enter, \ 133 .class = &event_class_syscall_enter, \
136 .event.funcs = &enter_syscall_print_funcs, \ 134 .event.funcs = &enter_syscall_print_funcs, \
137 .data = (void *)&__syscall_meta_##sname,\ 135 .data = (void *)&__syscall_meta_##sname,\
136 .flags = TRACE_EVENT_FL_CAP_ANY, \
138 }; \ 137 }; \
139 __TRACE_EVENT_FLAGS(enter_##sname, TRACE_EVENT_FL_CAP_ANY) 138 static struct ftrace_event_call __used \
139 __attribute__((section("_ftrace_events"))) \
140 *__event_enter_##sname = &event_enter_##sname;
140 141
141#define SYSCALL_TRACE_EXIT_EVENT(sname) \ 142#define SYSCALL_TRACE_EXIT_EVENT(sname) \
142 static struct syscall_metadata \ 143 static struct syscall_metadata __syscall_meta_##sname; \
143 __attribute__((__aligned__(4))) __syscall_meta_##sname; \
144 static struct ftrace_event_call __used \ 144 static struct ftrace_event_call __used \
145 __attribute__((__aligned__(4))) \
146 __attribute__((section("_ftrace_events"))) \
147 event_exit_##sname = { \ 145 event_exit_##sname = { \
148 .name = "sys_exit"#sname, \ 146 .name = "sys_exit"#sname, \
149 .class = &event_class_syscall_exit, \ 147 .class = &event_class_syscall_exit, \
150 .event.funcs = &exit_syscall_print_funcs, \ 148 .event.funcs = &exit_syscall_print_funcs, \
151 .data = (void *)&__syscall_meta_##sname,\ 149 .data = (void *)&__syscall_meta_##sname,\
150 .flags = TRACE_EVENT_FL_CAP_ANY, \
152 }; \ 151 }; \
153 __TRACE_EVENT_FLAGS(exit_##sname, TRACE_EVENT_FL_CAP_ANY) 152 static struct ftrace_event_call __used \
153 __attribute__((section("_ftrace_events"))) \
154 *__event_exit_##sname = &event_exit_##sname;
154 155
155#define SYSCALL_METADATA(sname, nb) \ 156#define SYSCALL_METADATA(sname, nb) \
156 SYSCALL_TRACE_ENTER_EVENT(sname); \ 157 SYSCALL_TRACE_ENTER_EVENT(sname); \
157 SYSCALL_TRACE_EXIT_EVENT(sname); \ 158 SYSCALL_TRACE_EXIT_EVENT(sname); \
158 static struct syscall_metadata __used \ 159 static struct syscall_metadata __used \
159 __attribute__((__aligned__(4))) \
160 __attribute__((section("__syscalls_metadata"))) \
161 __syscall_meta_##sname = { \ 160 __syscall_meta_##sname = { \
162 .name = "sys"#sname, \ 161 .name = "sys"#sname, \
162 .syscall_nr = -1, /* Filled in at boot */ \
163 .nb_args = nb, \ 163 .nb_args = nb, \
164 .types = types_##sname, \ 164 .types = types_##sname, \
165 .args = args_##sname, \ 165 .args = args_##sname, \
166 .enter_event = &event_enter_##sname, \ 166 .enter_event = &event_enter_##sname, \
167 .exit_event = &event_exit_##sname, \ 167 .exit_event = &event_exit_##sname, \
168 .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \ 168 .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \
169 }; 169 }; \
170 static struct syscall_metadata __used \
171 __attribute__((section("__syscalls_metadata"))) \
172 *__p_syscall_meta_##sname = &__syscall_meta_##sname;
170 173
171#define SYSCALL_DEFINE0(sname) \ 174#define SYSCALL_DEFINE0(sname) \
172 SYSCALL_TRACE_ENTER_EVENT(_##sname); \ 175 SYSCALL_TRACE_ENTER_EVENT(_##sname); \
173 SYSCALL_TRACE_EXIT_EVENT(_##sname); \ 176 SYSCALL_TRACE_EXIT_EVENT(_##sname); \
174 static struct syscall_metadata __used \ 177 static struct syscall_metadata __used \
175 __attribute__((__aligned__(4))) \
176 __attribute__((section("__syscalls_metadata"))) \
177 __syscall_meta__##sname = { \ 178 __syscall_meta__##sname = { \
178 .name = "sys_"#sname, \ 179 .name = "sys_"#sname, \
180 .syscall_nr = -1, /* Filled in at boot */ \
179 .nb_args = 0, \ 181 .nb_args = 0, \
180 .enter_event = &event_enter__##sname, \ 182 .enter_event = &event_enter__##sname, \
181 .exit_event = &event_exit__##sname, \ 183 .exit_event = &event_exit__##sname, \
182 .enter_fields = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \ 184 .enter_fields = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \
183 }; \ 185 }; \
186 static struct syscall_metadata __used \
187 __attribute__((section("__syscalls_metadata"))) \
188 *__p_syscall_meta_##sname = &__syscall_meta__##sname; \
184 asmlinkage long sys_##sname(void) 189 asmlinkage long sys_##sname(void)
185#else 190#else
186#define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) 191#define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void)
@@ -311,6 +316,8 @@ asmlinkage long sys_clock_settime(clockid_t which_clock,
311 const struct timespec __user *tp); 316 const struct timespec __user *tp);
312asmlinkage long sys_clock_gettime(clockid_t which_clock, 317asmlinkage long sys_clock_gettime(clockid_t which_clock,
313 struct timespec __user *tp); 318 struct timespec __user *tp);
319asmlinkage long sys_clock_adjtime(clockid_t which_clock,
320 struct timex __user *tx);
314asmlinkage long sys_clock_getres(clockid_t which_clock, 321asmlinkage long sys_clock_getres(clockid_t which_clock,
315 struct timespec __user *tp); 322 struct timespec __user *tp);
316asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags, 323asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags,
@@ -818,6 +825,7 @@ asmlinkage long sys_fanotify_init(unsigned int flags, unsigned int event_f_flags
818asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags, 825asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags,
819 u64 mask, int fd, 826 u64 mask, int fd,
820 const char __user *pathname); 827 const char __user *pathname);
828asmlinkage long sys_syncfs(int fd);
821 829
822int kernel_execve(const char *filename, const char *const argv[], const char *const envp[]); 830int kernel_execve(const char *filename, const char *const argv[], const char *const envp[]);
823 831
@@ -830,5 +838,10 @@ asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len,
830 unsigned long prot, unsigned long flags, 838 unsigned long prot, unsigned long flags,
831 unsigned long fd, unsigned long pgoff); 839 unsigned long fd, unsigned long pgoff);
832asmlinkage long sys_old_mmap(struct mmap_arg_struct __user *arg); 840asmlinkage long sys_old_mmap(struct mmap_arg_struct __user *arg);
833 841asmlinkage long sys_name_to_handle_at(int dfd, const char __user *name,
842 struct file_handle __user *handle,
843 int __user *mnt_id, int flag);
844asmlinkage long sys_open_by_handle_at(int mountdirfd,
845 struct file_handle __user *handle,
846 int flags);
834#endif 847#endif