Heiko Carstens | b07edab | 2014-02-27 09:52:01 +0100 | [diff] [blame] | 1 | #include <linux/syscalls.h> |
| 2 | #include <linux/compat.h> |
Heiko Carstens | 86d295e | 2014-02-27 15:16:04 +0100 | [diff] [blame^] | 3 | #include "entry.h" |
Heiko Carstens | b07edab | 2014-02-27 09:52:01 +0100 | [diff] [blame] | 4 | |
| 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 | |
| 25 | COMPAT_SYSCALL_WRAP1(exit, int, error_code); |
| 26 | COMPAT_SYSCALL_WRAP1(close, unsigned int, fd); |
| 27 | COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode); |
| 28 | COMPAT_SYSCALL_WRAP2(link, const char __user *, oldname, const char __user *, newname); |
| 29 | COMPAT_SYSCALL_WRAP1(unlink, const char __user *, pathname); |
| 30 | COMPAT_SYSCALL_WRAP1(chdir, const char __user *, filename); |
| 31 | COMPAT_SYSCALL_WRAP3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev); |
| 32 | COMPAT_SYSCALL_WRAP2(chmod, const char __user *, filename, umode_t, mode); |
| 33 | COMPAT_SYSCALL_WRAP1(oldumount, char __user *, name); |
| 34 | COMPAT_SYSCALL_WRAP1(alarm, unsigned int, seconds); |
| 35 | COMPAT_SYSCALL_WRAP2(access, const char __user *, filename, int, mode); |
| 36 | COMPAT_SYSCALL_WRAP1(nice, int, increment); |
Heiko Carstens | 473a065 | 2014-02-27 13:42:10 +0100 | [diff] [blame] | 37 | COMPAT_SYSCALL_WRAP2(kill, int, pid, int, sig); |
| 38 | COMPAT_SYSCALL_WRAP2(rename, const char __user *, oldname, const char __user *, newname); |
| 39 | COMPAT_SYSCALL_WRAP2(mkdir, const char __user *, pathname, umode_t, mode); |
| 40 | COMPAT_SYSCALL_WRAP1(rmdir, const char __user *, pathname); |
| 41 | COMPAT_SYSCALL_WRAP1(dup, unsigned int, fildes); |
| 42 | COMPAT_SYSCALL_WRAP1(pipe, int __user *, fildes); |
| 43 | COMPAT_SYSCALL_WRAP1(brk, compat_ulong_t, brk); |
| 44 | COMPAT_SYSCALL_WRAP2(signal, int, sig, __sighandler_t, handler); |
| 45 | COMPAT_SYSCALL_WRAP1(acct, const char __user *, name); |
| 46 | COMPAT_SYSCALL_WRAP2(umount, char __user *, name, int, flags); |
Heiko Carstens | be06fbf | 2014-02-27 14:04:43 +0100 | [diff] [blame] | 47 | COMPAT_SYSCALL_WRAP2(setpgid, compat_pid_t, pid, compat_pid_t, pgid); |
| 48 | COMPAT_SYSCALL_WRAP1(umask, int, mask); |
| 49 | COMPAT_SYSCALL_WRAP1(chroot, const char __user *, filename); |
| 50 | COMPAT_SYSCALL_WRAP2(dup2, unsigned int, oldfd, unsigned int, newfd); |
| 51 | COMPAT_SYSCALL_WRAP3(sigsuspend, int, unused1, int, unused2, compat_old_sigset_t, mask); |
| 52 | COMPAT_SYSCALL_WRAP2(sethostname, char __user *, name, int, len); |
| 53 | COMPAT_SYSCALL_WRAP2(symlink, const char __user *, old, const char __user *, new); |
| 54 | COMPAT_SYSCALL_WRAP3(readlink, const char __user *, path, char __user *, buf, int, bufsiz); |
| 55 | COMPAT_SYSCALL_WRAP1(uselib, const char __user *, library); |
| 56 | COMPAT_SYSCALL_WRAP2(swapon, const char __user *, specialfile, int, swap_flags); |
Heiko Carstens | c355ce1 | 2014-02-27 14:20:53 +0100 | [diff] [blame] | 57 | COMPAT_SYSCALL_WRAP4(reboot, int, magic1, int, magic2, unsigned int, cmd, void __user *, arg); |
| 58 | COMPAT_SYSCALL_WRAP2(munmap, compat_ulong_t, addr, compat_size_t, len); |
| 59 | COMPAT_SYSCALL_WRAP2(fchmod, unsigned int, fd, umode_t, mode); |
| 60 | COMPAT_SYSCALL_WRAP2(getpriority, int, which, int, who); |
| 61 | COMPAT_SYSCALL_WRAP3(setpriority, int, which, int, who, int, niceval); |
| 62 | COMPAT_SYSCALL_WRAP3(syslog, int, type, char __user *, buf, int, len); |
| 63 | COMPAT_SYSCALL_WRAP1(swapoff, const char __user *, specialfile); |
| 64 | COMPAT_SYSCALL_WRAP1(fsync, unsigned int, fd); |
| 65 | COMPAT_SYSCALL_WRAP2(setdomainname, char __user *, name, int, len); |
| 66 | COMPAT_SYSCALL_WRAP1(newuname, struct new_utsname __user *, name); |
Heiko Carstens | 86d295e | 2014-02-27 15:16:04 +0100 | [diff] [blame^] | 67 | COMPAT_SYSCALL_WRAP3(mprotect, compat_ulong_t, start, compat_size_t, len, compat_ulong_t, prot); |
| 68 | COMPAT_SYSCALL_WRAP3(init_module, void __user *, umod, compat_ulong_t, len, const char __user *, uargs); |
| 69 | COMPAT_SYSCALL_WRAP2(delete_module, const char __user *, name_user, unsigned int, flags); |
| 70 | COMPAT_SYSCALL_WRAP4(quotactl, unsigned int, cmd, const char __user *, special, qid_t, id, void __user *, addr); |
| 71 | COMPAT_SYSCALL_WRAP1(getpgid, compat_pid_t, pid); |
| 72 | COMPAT_SYSCALL_WRAP1(fchdir, unsigned int, fd); |
| 73 | COMPAT_SYSCALL_WRAP2(bdflush, int, func, compat_long_t, data); |
| 74 | COMPAT_SYSCALL_WRAP3(sysfs, int, option, compat_ulong_t, arg1, compat_ulong_t, arg2); |
| 75 | COMPAT_SYSCALL_WRAP1(s390_personality, unsigned int, personality); |
| 76 | COMPAT_SYSCALL_WRAP5(llseek, unsigned int, fd, u32, high, u32, low, loff_t __user *, result, unsigned int, whence); |