regmap: allow regmap instances to be named
[linux-2.6.git] / include / linux / syscalls.h
index 3c280d7..1ff0ec2 100644 (file)
@@ -23,16 +23,22 @@ struct kexec_segment;
 struct linux_dirent;
 struct linux_dirent64;
 struct list_head;
+struct mmap_arg_struct;
 struct msgbuf;
 struct msghdr;
+struct mmsghdr;
 struct msqid_ds;
 struct new_utsname;
 struct nfsctl_arg;
 struct __old_kernel_stat;
+struct oldold_utsname;
+struct old_utsname;
 struct pollfd;
 struct rlimit;
+struct rlimit64;
 struct rusage;
 struct sched_param;
+struct sel_arg_struct;
 struct semaphore;
 struct sembuf;
 struct shmid_ds;
@@ -56,6 +62,7 @@ struct robust_list_head;
 struct getcpu_cache;
 struct old_linux_dirent;
 struct perf_event_attr;
+struct file_handle;
 
 #include <linux/types.h>
 #include <linux/aio_abi.h>
@@ -98,45 +105,6 @@ struct perf_event_attr;
 #define __SC_TEST5(t5, a5, ...)        __SC_TEST(t5); __SC_TEST4(__VA_ARGS__)
 #define __SC_TEST6(t6, a6, ...)        __SC_TEST(t6); __SC_TEST5(__VA_ARGS__)
 
-#ifdef CONFIG_EVENT_PROFILE
-#define TRACE_SYS_ENTER_PROFILE(sname)                                        \
-static int prof_sysenter_enable_##sname(struct ftrace_event_call *unused)      \
-{                                                                             \
-       return reg_prof_syscall_enter("sys"#sname);                            \
-}                                                                             \
-                                                                              \
-static void prof_sysenter_disable_##sname(struct ftrace_event_call *unused)    \
-{                                                                             \
-       unreg_prof_syscall_enter("sys"#sname);                                 \
-}
-
-#define TRACE_SYS_EXIT_PROFILE(sname)                                         \
-static int prof_sysexit_enable_##sname(struct ftrace_event_call *unused)       \
-{                                                                             \
-       return reg_prof_syscall_exit("sys"#sname);                             \
-}                                                                             \
-                                                                              \
-static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused)     \
-{                                                                              \
-       unreg_prof_syscall_exit("sys"#sname);                                  \
-}
-
-#define TRACE_SYS_ENTER_PROFILE_INIT(sname)                                   \
-       .profile_count = ATOMIC_INIT(-1),                                      \
-       .profile_enable = prof_sysenter_enable_##sname,                        \
-       .profile_disable = prof_sysenter_disable_##sname,
-
-#define TRACE_SYS_EXIT_PROFILE_INIT(sname)                                    \
-       .profile_count = ATOMIC_INIT(-1),                                      \
-       .profile_enable = prof_sysexit_enable_##sname,                         \
-       .profile_disable = prof_sysexit_disable_##sname,
-#else
-#define TRACE_SYS_ENTER_PROFILE(sname)
-#define TRACE_SYS_ENTER_PROFILE_INIT(sname)
-#define TRACE_SYS_EXIT_PROFILE(sname)
-#define TRACE_SYS_EXIT_PROFILE_INIT(sname)
-#endif
-
 #ifdef CONFIG_FTRACE_SYSCALLS
 #define __SC_STR_ADECL1(t, a)          #a
 #define __SC_STR_ADECL2(t, a, ...)     #a, __SC_STR_ADECL1(__VA_ARGS__)
@@ -152,105 +120,72 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused)     \
 #define __SC_STR_TDECL5(t, a, ...)     #t, __SC_STR_TDECL4(__VA_ARGS__)
 #define __SC_STR_TDECL6(t, a, ...)     #t, __SC_STR_TDECL5(__VA_ARGS__)
 
+extern struct ftrace_event_class event_class_syscall_enter;
+extern struct ftrace_event_class event_class_syscall_exit;
+extern struct trace_event_functions enter_syscall_print_funcs;
+extern struct trace_event_functions exit_syscall_print_funcs;
+
 #define SYSCALL_TRACE_ENTER_EVENT(sname)                               \
-       static const struct syscall_metadata __syscall_meta_##sname;    \
-       static struct ftrace_event_call event_enter_##sname;            \
-       struct trace_event enter_syscall_print_##sname = {              \
-               .trace                  = print_syscall_enter,          \
-       };                                                              \
-       static int init_enter_##sname(struct ftrace_event_call *call)   \
-       {                                                               \
-               int num, id;                                            \
-               num = __syscall_meta_##sname.syscall_nr;                \
-               if (num < 0)                                            \
-                       return -ENOSYS;                                 \
-               id = register_ftrace_event(&enter_syscall_print_##sname);\
-               if (!id)                                                \
-                       return -ENODEV;                                 \
-               event_enter_##sname.id = id;                            \
-               INIT_LIST_HEAD(&event_enter_##sname.fields);            \
-               return 0;                                               \
-       }                                                               \
-       TRACE_SYS_ENTER_PROFILE(sname);                                 \
+       static struct syscall_metadata __syscall_meta_##sname;          \
        static struct ftrace_event_call __used                          \
-         __attribute__((__aligned__(4)))                               \
-         __attribute__((section("_ftrace_events")))                    \
          event_enter_##sname = {                                       \
                .name                   = "sys_enter"#sname,            \
-               .system                 = "syscalls",                   \
-               .event                  = &enter_syscall_print_##sname, \
-               .raw_init               = init_enter_##sname,           \
-               .show_format            = syscall_enter_format,         \
-               .define_fields          = syscall_enter_define_fields,  \
-               .regfunc                = reg_event_syscall_enter,      \
-               .unregfunc              = unreg_event_syscall_enter,    \
+               .class                  = &event_class_syscall_enter,   \
+               .event.funcs            = &enter_syscall_print_funcs,   \
                .data                   = (void *)&__syscall_meta_##sname,\
-               TRACE_SYS_ENTER_PROFILE_INIT(sname)                     \
-       }
-
-#define SYSCALL_TRACE_EXIT_EVENT(sname)                                        \
-       static const struct syscall_metadata __syscall_meta_##sname;    \
-       static struct ftrace_event_call event_exit_##sname;             \
-       struct trace_event exit_syscall_print_##sname = {               \
-               .trace                  = print_syscall_exit,           \
+               .flags                  = TRACE_EVENT_FL_CAP_ANY,       \
        };                                                              \
-       static int init_exit_##sname(struct ftrace_event_call *call)    \
-       {                                                               \
-               int num, id;                                            \
-               num = __syscall_meta_##sname.syscall_nr;                \
-               if (num < 0)                                            \
-                       return -ENOSYS;                                 \
-               id = register_ftrace_event(&exit_syscall_print_##sname);\
-               if (!id)                                                \
-                       return -ENODEV;                                 \
-               event_exit_##sname.id = id;                             \
-               INIT_LIST_HEAD(&event_exit_##sname.fields);             \
-               return 0;                                               \
-       }                                                               \
-       TRACE_SYS_EXIT_PROFILE(sname);                                  \
        static struct ftrace_event_call __used                          \
-         __attribute__((__aligned__(4)))                               \
          __attribute__((section("_ftrace_events")))                    \
+        *__event_enter_##sname = &event_enter_##sname;
+
+#define SYSCALL_TRACE_EXIT_EVENT(sname)                                        \
+       static struct syscall_metadata __syscall_meta_##sname;          \
+       static struct ftrace_event_call __used                          \
          event_exit_##sname = {                                        \
                .name                   = "sys_exit"#sname,             \
-               .system                 = "syscalls",                   \
-               .event                  = &exit_syscall_print_##sname,  \
-               .raw_init               = init_exit_##sname,            \
-               .show_format            = syscall_exit_format,          \
-               .define_fields          = syscall_exit_define_fields,   \
-               .regfunc                = reg_event_syscall_exit,       \
-               .unregfunc              = unreg_event_syscall_exit,     \
+               .class                  = &event_class_syscall_exit,    \
+               .event.funcs            = &exit_syscall_print_funcs,    \
                .data                   = (void *)&__syscall_meta_##sname,\
-               TRACE_SYS_EXIT_PROFILE_INIT(sname)                      \
-       }
+               .flags                  = TRACE_EVENT_FL_CAP_ANY,       \
+       };                                                              \
+       static struct ftrace_event_call __used                          \
+         __attribute__((section("_ftrace_events")))                    \
+       *__event_exit_##sname = &event_exit_##sname;
 
 #define SYSCALL_METADATA(sname, nb)                            \
        SYSCALL_TRACE_ENTER_EVENT(sname);                       \
        SYSCALL_TRACE_EXIT_EVENT(sname);                        \
-       static const struct syscall_metadata __used             \
-         __attribute__((__aligned__(4)))                       \
-         __attribute__((section("__syscalls_metadata")))       \
+       static struct syscall_metadata __used                   \
          __syscall_meta_##sname = {                            \
                .name           = "sys"#sname,                  \
+               .syscall_nr     = -1,   /* Filled in at boot */ \
                .nb_args        = nb,                           \
                .types          = types_##sname,                \
                .args           = args_##sname,                 \
                .enter_event    = &event_enter_##sname,         \
                .exit_event     = &event_exit_##sname,          \
-       };
+               .enter_fields   = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \
+       };                                                      \
+       static struct syscall_metadata __used                   \
+         __attribute__((section("__syscalls_metadata")))       \
+        *__p_syscall_meta_##sname = &__syscall_meta_##sname;
 
 #define SYSCALL_DEFINE0(sname)                                 \
        SYSCALL_TRACE_ENTER_EVENT(_##sname);                    \
        SYSCALL_TRACE_EXIT_EVENT(_##sname);                     \
-       static const struct syscall_metadata __used             \
-         __attribute__((__aligned__(4)))                       \
-         __attribute__((section("__syscalls_metadata")))       \
-         __syscall_meta_##sname = {                            \
+       static struct syscall_metadata __used                   \
+         __syscall_meta__##sname = {                           \
                .name           = "sys_"#sname,                 \
+               .syscall_nr     = -1,   /* Filled in at boot */ \
                .nb_args        = 0,                            \
                .enter_event    = &event_enter__##sname,        \
                .exit_event     = &event_exit__##sname,         \
+               .enter_fields   = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \
        };                                                      \
+       static struct syscall_metadata __used                   \
+         __attribute__((section("__syscalls_metadata")))       \
+        *__p_syscall_meta_##sname = &__syscall_meta__##sname;  \
        asmlinkage long sys_##sname(void)
 #else
 #define SYSCALL_DEFINE0(name)     asmlinkage long sys_##name(void)
@@ -358,7 +293,7 @@ asmlinkage long sys_capget(cap_user_header_t header,
                                cap_user_data_t dataptr);
 asmlinkage long sys_capset(cap_user_header_t header,
                                const cap_user_data_t data);
-asmlinkage long sys_personality(u_long personality);
+asmlinkage long sys_personality(unsigned int personality);
 
 asmlinkage long sys_sigpending(old_sigset_t __user *set);
 asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set,
@@ -381,6 +316,8 @@ asmlinkage long sys_clock_settime(clockid_t which_clock,
                                const struct timespec __user *tp);
 asmlinkage long sys_clock_gettime(clockid_t which_clock,
                                struct timespec __user *tp);
+asmlinkage long sys_clock_adjtime(clockid_t which_clock,
+                               struct timex __user *tx);
 asmlinkage long sys_clock_getres(clockid_t which_clock,
                                struct timespec __user *tp);
 asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags,
@@ -462,7 +399,7 @@ asmlinkage long sys_umount(char __user *name, int flags);
 asmlinkage long sys_oldumount(char __user *name);
 asmlinkage long sys_truncate(const char __user *path, long length);
 asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
-asmlinkage long sys_stat(char __user *filename,
+asmlinkage long sys_stat(const char __user *filename,
                        struct __old_kernel_stat __user *statbuf);
 asmlinkage long sys_statfs(const char __user * path,
                                struct statfs __user *buf);
@@ -471,21 +408,21 @@ asmlinkage long sys_statfs64(const char __user *path, size_t sz,
 asmlinkage long sys_fstatfs(unsigned int fd, struct statfs __user *buf);
 asmlinkage long sys_fstatfs64(unsigned int fd, size_t sz,
                                struct statfs64 __user *buf);
-asmlinkage long sys_lstat(char __user *filename,
+asmlinkage long sys_lstat(const char __user *filename,
                        struct __old_kernel_stat __user *statbuf);
 asmlinkage long sys_fstat(unsigned int fd,
                        struct __old_kernel_stat __user *statbuf);
-asmlinkage long sys_newstat(char __user *filename,
+asmlinkage long sys_newstat(const char __user *filename,
                                struct stat __user *statbuf);
-asmlinkage long sys_newlstat(char __user *filename,
+asmlinkage long sys_newlstat(const char __user *filename,
                                struct stat __user *statbuf);
 asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf);
 asmlinkage long sys_ustat(unsigned dev, struct ustat __user *ubuf);
 #if BITS_PER_LONG == 32
-asmlinkage long sys_stat64(char __user *filename,
+asmlinkage long sys_stat64(const char __user *filename,
                                struct stat64 __user *statbuf);
 asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user *statbuf);
-asmlinkage long sys_lstat64(char __user *filename,
+asmlinkage long sys_lstat64(const char __user *filename,
                                struct stat64 __user *statbuf);
 asmlinkage long sys_truncate64(const char __user *path, loff_t length);
 asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length);
@@ -673,10 +610,15 @@ asmlinkage long sys_send(int, void __user *, size_t, unsigned);
 asmlinkage long sys_sendto(int, void __user *, size_t, unsigned,
                                struct sockaddr __user *, int);
 asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags);
+asmlinkage long sys_sendmmsg(int fd, struct mmsghdr __user *msg,
+                            unsigned int vlen, unsigned flags);
 asmlinkage long sys_recv(int, void __user *, size_t, unsigned);
 asmlinkage long sys_recvfrom(int, void __user *, size_t, unsigned,
                                struct sockaddr __user *, int __user *);
 asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, unsigned flags);
+asmlinkage long sys_recvmmsg(int fd, struct mmsghdr __user *msg,
+                            unsigned int vlen, unsigned flags,
+                            struct timespec __user *timeout);
 asmlinkage long sys_socket(int, int, int);
 asmlinkage long sys_socketpair(int, int, int, int __user *);
 asmlinkage long sys_socketcall(int call, unsigned long __user *args);
@@ -685,6 +627,7 @@ asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds,
                                long timeout);
 asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
                        fd_set __user *exp, struct timeval __user *tvp);
+asmlinkage long sys_old_select(struct sel_arg_struct __user *arg);
 asmlinkage long sys_epoll_create(int size);
 asmlinkage long sys_epoll_create1(int flags);
 asmlinkage long sys_epoll_ctl(int epfd, int op, int fd,
@@ -699,6 +642,8 @@ asmlinkage long sys_gethostname(char __user *name, int len);
 asmlinkage long sys_sethostname(char __user *name, int len);
 asmlinkage long sys_setdomainname(char __user *name, int len);
 asmlinkage long sys_newuname(struct new_utsname __user *name);
+asmlinkage long sys_uname(struct old_utsname __user *);
+asmlinkage long sys_olduname(struct oldold_utsname __user *);
 
 asmlinkage long sys_getrlimit(unsigned int resource,
                                struct rlimit __user *rlim);
@@ -707,6 +652,9 @@ asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *r
 #endif
 asmlinkage long sys_setrlimit(unsigned int resource,
                                struct rlimit __user *rlim);
+asmlinkage long sys_prlimit64(pid_t pid, unsigned int resource,
+                               const struct rlimit64 __user *new_rlim,
+                               struct rlimit64 __user *old_rlim);
 asmlinkage long sys_getrusage(int who, struct rusage __user *ru);
 asmlinkage long sys_umask(int mask);
 
@@ -728,6 +676,8 @@ asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg);
 asmlinkage long sys_shmget(key_t key, size_t size, int flag);
 asmlinkage long sys_shmdt(char __user *shmaddr);
 asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
+asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,
+               unsigned long third, void __user *ptr, long fifth);
 
 asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr);
 asmlinkage long sys_mq_unlink(const char __user *name);
@@ -752,13 +702,11 @@ asmlinkage long sys_sysctl(struct __sysctl_args __user *args);
 asmlinkage long sys_sysinfo(struct sysinfo __user *info);
 asmlinkage long sys_sysfs(int option,
                                unsigned long arg1, unsigned long arg2);
-asmlinkage long sys_nfsservctl(int cmd,
-                               struct nfsctl_arg __user *arg,
-                               void __user *res);
 asmlinkage long sys_syslog(int type, char __user *buf, int len);
 asmlinkage long sys_uselib(const char __user *library);
 asmlinkage long sys_ni_syscall(void);
-asmlinkage long sys_ptrace(long request, long pid, long addr, long data);
+asmlinkage long sys_ptrace(long request, long pid, unsigned long addr,
+                          unsigned long data);
 
 asmlinkage long sys_add_key(const char __user *_type,
                            const char __user *_description,
@@ -817,7 +765,7 @@ asmlinkage long sys_linkat(int olddfd, const char __user *oldname,
                           int newdfd, const char __user *newname, int flags);
 asmlinkage long sys_renameat(int olddfd, const char __user * oldname,
                             int newdfd, const char __user * newname);
-asmlinkage long sys_futimesat(int dfd, char __user *filename,
+asmlinkage long sys_futimesat(int dfd, const char __user *filename,
                              struct timeval __user *utimes);
 asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode);
 asmlinkage long sys_fchmodat(int dfd, const char __user * filename,
@@ -826,13 +774,13 @@ asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user,
                             gid_t group, int flag);
 asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
                           int mode);
-asmlinkage long sys_newfstatat(int dfd, char __user *filename,
+asmlinkage long sys_newfstatat(int dfd, const char __user *filename,
                               struct stat __user *statbuf, int flag);
-asmlinkage long sys_fstatat64(int dfd, char __user *filename,
+asmlinkage long sys_fstatat64(int dfd, const char __user *filename,
                               struct stat64 __user *statbuf, int flag);
 asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf,
                               int bufsiz);
-asmlinkage long sys_utimensat(int dfd, char __user *filename,
+asmlinkage long sys_utimensat(int dfd, const char __user *filename,
                                struct timespec __user *utimes, int flags);
 asmlinkage long sys_unshare(unsigned long unshare_flags);
 
@@ -872,11 +820,28 @@ asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *,
 asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int,
                          struct timespec __user *, const sigset_t __user *,
                          size_t);
+asmlinkage long sys_fanotify_init(unsigned int flags, unsigned int event_f_flags);
+asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags,
+                                 u64 mask, int fd,
+                                 const char  __user *pathname);
+asmlinkage long sys_syncfs(int fd);
 
-int kernel_execve(const char *filename, char *const argv[], char *const envp[]);
+int kernel_execve(const char *filename, const char *const argv[], const char *const envp[]);
 
 
 asmlinkage long sys_perf_event_open(
                struct perf_event_attr __user *attr_uptr,
                pid_t pid, int cpu, int group_fd, unsigned long flags);
+
+asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len,
+                       unsigned long prot, unsigned long flags,
+                       unsigned long fd, unsigned long pgoff);
+asmlinkage long sys_old_mmap(struct mmap_arg_struct __user *arg);
+asmlinkage long sys_name_to_handle_at(int dfd, const char __user *name,
+                                     struct file_handle __user *handle,
+                                     int __user *mnt_id, int flag);
+asmlinkage long sys_open_by_handle_at(int mountdirfd,
+                                     struct file_handle __user *handle,
+                                     int flags);
+asmlinkage long sys_setns(int fd, int nstype);
 #endif