blob: 558a1d485aa98e8d99d9253055157fe89f1ece57 [file] [log] [blame]
Heiko Carstensb07edab2014-02-27 09:52:01 +01001#include <linux/syscalls.h>
2#include <linux/compat.h>
Heiko Carstens86d295e2014-02-27 15:16:04 +01003#include "entry.h"
Heiko Carstensb07edab2014-02-27 09:52:01 +01004
5#define COMPAT_SYSCALL_WRAP1(name, ...) \
6 COMPAT_SYSCALL_WRAPx(1, _##name, __VA_ARGS__)
7#define COMPAT_SYSCALL_WRAP2(name, ...) \
8 COMPAT_SYSCALL_WRAPx(2, _##name, __VA_ARGS__)
9#define COMPAT_SYSCALL_WRAP3(name, ...) \
10 COMPAT_SYSCALL_WRAPx(3, _##name, __VA_ARGS__)
11#define COMPAT_SYSCALL_WRAP4(name, ...) \
12 COMPAT_SYSCALL_WRAPx(4, _##name, __VA_ARGS__)
13#define COMPAT_SYSCALL_WRAP5(name, ...) \
14 COMPAT_SYSCALL_WRAPx(5, _##name, __VA_ARGS__)
15#define COMPAT_SYSCALL_WRAP6(name, ...) \
16 COMPAT_SYSCALL_WRAPx(6, _##name, __VA_ARGS__)
17
18#define COMPAT_SYSCALL_WRAPx(x, name, ...) \
19 asmlinkage long compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
20 asmlinkage long compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
21 { \
22 return sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
23 }
24
25COMPAT_SYSCALL_WRAP1(exit, int, error_code);
26COMPAT_SYSCALL_WRAP1(close, unsigned int, fd);
27COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode);
28COMPAT_SYSCALL_WRAP2(link, const char __user *, oldname, const char __user *, newname);
29COMPAT_SYSCALL_WRAP1(unlink, const char __user *, pathname);
30COMPAT_SYSCALL_WRAP1(chdir, const char __user *, filename);
31COMPAT_SYSCALL_WRAP3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev);
32COMPAT_SYSCALL_WRAP2(chmod, const char __user *, filename, umode_t, mode);
33COMPAT_SYSCALL_WRAP1(oldumount, char __user *, name);
34COMPAT_SYSCALL_WRAP1(alarm, unsigned int, seconds);
35COMPAT_SYSCALL_WRAP2(access, const char __user *, filename, int, mode);
36COMPAT_SYSCALL_WRAP1(nice, int, increment);
Heiko Carstens473a0652014-02-27 13:42:10 +010037COMPAT_SYSCALL_WRAP2(kill, int, pid, int, sig);
38COMPAT_SYSCALL_WRAP2(rename, const char __user *, oldname, const char __user *, newname);
39COMPAT_SYSCALL_WRAP2(mkdir, const char __user *, pathname, umode_t, mode);
40COMPAT_SYSCALL_WRAP1(rmdir, const char __user *, pathname);
41COMPAT_SYSCALL_WRAP1(dup, unsigned int, fildes);
42COMPAT_SYSCALL_WRAP1(pipe, int __user *, fildes);
43COMPAT_SYSCALL_WRAP1(brk, compat_ulong_t, brk);
44COMPAT_SYSCALL_WRAP2(signal, int, sig, __sighandler_t, handler);
45COMPAT_SYSCALL_WRAP1(acct, const char __user *, name);
46COMPAT_SYSCALL_WRAP2(umount, char __user *, name, int, flags);
Heiko Carstensbe06fbf2014-02-27 14:04:43 +010047COMPAT_SYSCALL_WRAP2(setpgid, compat_pid_t, pid, compat_pid_t, pgid);
48COMPAT_SYSCALL_WRAP1(umask, int, mask);
49COMPAT_SYSCALL_WRAP1(chroot, const char __user *, filename);
50COMPAT_SYSCALL_WRAP2(dup2, unsigned int, oldfd, unsigned int, newfd);
51COMPAT_SYSCALL_WRAP3(sigsuspend, int, unused1, int, unused2, compat_old_sigset_t, mask);
52COMPAT_SYSCALL_WRAP2(sethostname, char __user *, name, int, len);
53COMPAT_SYSCALL_WRAP2(symlink, const char __user *, old, const char __user *, new);
54COMPAT_SYSCALL_WRAP3(readlink, const char __user *, path, char __user *, buf, int, bufsiz);
55COMPAT_SYSCALL_WRAP1(uselib, const char __user *, library);
56COMPAT_SYSCALL_WRAP2(swapon, const char __user *, specialfile, int, swap_flags);
Heiko Carstensc355ce12014-02-27 14:20:53 +010057COMPAT_SYSCALL_WRAP4(reboot, int, magic1, int, magic2, unsigned int, cmd, void __user *, arg);
58COMPAT_SYSCALL_WRAP2(munmap, compat_ulong_t, addr, compat_size_t, len);
59COMPAT_SYSCALL_WRAP2(fchmod, unsigned int, fd, umode_t, mode);
60COMPAT_SYSCALL_WRAP2(getpriority, int, which, int, who);
61COMPAT_SYSCALL_WRAP3(setpriority, int, which, int, who, int, niceval);
62COMPAT_SYSCALL_WRAP3(syslog, int, type, char __user *, buf, int, len);
63COMPAT_SYSCALL_WRAP1(swapoff, const char __user *, specialfile);
64COMPAT_SYSCALL_WRAP1(fsync, unsigned int, fd);
65COMPAT_SYSCALL_WRAP2(setdomainname, char __user *, name, int, len);
66COMPAT_SYSCALL_WRAP1(newuname, struct new_utsname __user *, name);
Heiko Carstens86d295e2014-02-27 15:16:04 +010067COMPAT_SYSCALL_WRAP3(mprotect, compat_ulong_t, start, compat_size_t, len, compat_ulong_t, prot);
68COMPAT_SYSCALL_WRAP3(init_module, void __user *, umod, compat_ulong_t, len, const char __user *, uargs);
69COMPAT_SYSCALL_WRAP2(delete_module, const char __user *, name_user, unsigned int, flags);
70COMPAT_SYSCALL_WRAP4(quotactl, unsigned int, cmd, const char __user *, special, qid_t, id, void __user *, addr);
71COMPAT_SYSCALL_WRAP1(getpgid, compat_pid_t, pid);
72COMPAT_SYSCALL_WRAP1(fchdir, unsigned int, fd);
73COMPAT_SYSCALL_WRAP2(bdflush, int, func, compat_long_t, data);
74COMPAT_SYSCALL_WRAP3(sysfs, int, option, compat_ulong_t, arg1, compat_ulong_t, arg2);
75COMPAT_SYSCALL_WRAP1(s390_personality, unsigned int, personality);
76COMPAT_SYSCALL_WRAP5(llseek, unsigned int, fd, u32, high, u32, low, loff_t __user *, result, unsigned int, whence);