2 * Enhanced Seccomp MIPS Specific Code
4 * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
5 * Author: Paul Moore <paul@paul-moore.com>
10 * This library is free software; you can redistribute it and/or modify it
11 * under the terms of version 2.1 of the GNU Lesser General Public License as
12 * published by the Free Software Foundation.
14 * This library is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this library; if not, see <http://www.gnu.org/licenses>.
28 #include "arch-mips64n32.h"
31 #define __SCMP_NR_BASE 6000
33 /* NOTE: based on Linux 4.5-rc4 */
34 const struct arch_syscall_def mips64n32_syscall_table
[] = { \
35 { "_llseek", __PNR__llseek
},
36 { "_newselect", (__SCMP_NR_BASE
+ 22) },
37 { "_sysctl", (__SCMP_NR_BASE
+ 152) },
38 { "accept", (__SCMP_NR_BASE
+ 42) },
39 { "accept4", (__SCMP_NR_BASE
+ 297) },
40 { "access", (__SCMP_NR_BASE
+ 20) },
41 { "acct", (__SCMP_NR_BASE
+ 158) },
42 { "add_key", (__SCMP_NR_BASE
+ 243) },
43 { "adjtimex", (__SCMP_NR_BASE
+ 154) },
44 { "afs_syscall", (__SCMP_NR_BASE
+ 176) },
45 { "alarm", (__SCMP_NR_BASE
+ 37) },
46 { "arm_fadvise64_64", __PNR_arm_fadvise64_64
},
47 { "arm_sync_file_range", __PNR_arm_sync_file_range
},
48 { "arch_prctl", __PNR_arch_prctl
},
49 { "bdflush", __PNR_bdflush
},
50 { "bind", (__SCMP_NR_BASE
+ 48) },
51 { "bpf", (__SCMP_NR_BASE
+ 319) },
52 { "break", __PNR_break
},
53 { "breakpoint", __PNR_breakpoint
},
54 { "brk", (__SCMP_NR_BASE
+ 12) },
55 { "cachectl", (__SCMP_NR_BASE
+ 198) },
56 { "cacheflush", (__SCMP_NR_BASE
+ 197) },
57 { "capget", (__SCMP_NR_BASE
+ 123) },
58 { "capset", (__SCMP_NR_BASE
+ 124) },
59 { "chdir", (__SCMP_NR_BASE
+ 78) },
60 { "chmod", (__SCMP_NR_BASE
+ 88) },
61 { "chown", (__SCMP_NR_BASE
+ 90) },
62 { "chown32", __PNR_chown32
},
63 { "chroot", (__SCMP_NR_BASE
+ 156) },
64 { "clock_adjtime", (__SCMP_NR_BASE
+ 305) },
65 { "clock_getres", (__SCMP_NR_BASE
+ 227) },
66 { "clock_gettime", (__SCMP_NR_BASE
+ 226) },
67 { "clock_nanosleep", (__SCMP_NR_BASE
+ 228) },
68 { "clock_settime", (__SCMP_NR_BASE
+ 225) },
69 { "clone", (__SCMP_NR_BASE
+ 55) },
70 { "close", (__SCMP_NR_BASE
+ 3) },
71 { "connect", (__SCMP_NR_BASE
+ 41) },
72 { "copy_file_range", (__SCMP_NR_BASE
+ 324) },
73 { "creat", (__SCMP_NR_BASE
+ 83) },
74 { "create_module", (__SCMP_NR_BASE
+ 167) },
75 { "delete_module", (__SCMP_NR_BASE
+ 169) },
76 { "dup", (__SCMP_NR_BASE
+ 31) },
77 { "dup2", (__SCMP_NR_BASE
+ 32) },
78 { "dup3", (__SCMP_NR_BASE
+ 290) },
79 { "epoll_create", (__SCMP_NR_BASE
+ 207) },
80 { "epoll_create1", (__SCMP_NR_BASE
+ 289) },
81 { "epoll_ctl", (__SCMP_NR_BASE
+ 208) },
82 { "epoll_ctl_old", __PNR_epoll_ctl_old
},
83 { "epoll_pwait", (__SCMP_NR_BASE
+ 276) },
84 { "epoll_wait", (__SCMP_NR_BASE
+ 209) },
85 { "epoll_wait_old", __PNR_epoll_wait_old
},
86 { "eventfd", (__SCMP_NR_BASE
+ 282) },
87 { "eventfd2", (__SCMP_NR_BASE
+ 288) },
88 { "execve", (__SCMP_NR_BASE
+ 57) },
89 { "execveat", (__SCMP_NR_BASE
+ 320) },
90 { "exit", (__SCMP_NR_BASE
+ 58) },
91 { "exit_group", (__SCMP_NR_BASE
+ 205) },
92 { "faccessat", (__SCMP_NR_BASE
+ 263) },
93 { "fadvise64", (__SCMP_NR_BASE
+ 216) },
94 { "fadvise64_64", __PNR_fadvise64_64
},
95 { "fallocate", (__SCMP_NR_BASE
+ 283) },
96 { "fanotify_init", (__SCMP_NR_BASE
+ 300) },
97 { "fanotify_mark", (__SCMP_NR_BASE
+ 301) },
98 { "fchdir", (__SCMP_NR_BASE
+ 79) },
99 { "fchmod", (__SCMP_NR_BASE
+ 89) },
100 { "fchmodat", (__SCMP_NR_BASE
+ 262) },
101 { "fchown", (__SCMP_NR_BASE
+ 91) },
102 { "fchown32", __PNR_fchown32
},
103 { "fchownat", (__SCMP_NR_BASE
+ 254) },
104 { "fcntl", (__SCMP_NR_BASE
+ 70) },
105 { "fcntl64", (__SCMP_NR_BASE
+ 212) },
106 { "fdatasync", (__SCMP_NR_BASE
+ 73) },
107 { "fgetxattr", (__SCMP_NR_BASE
+ 185) },
108 { "finit_module", (__SCMP_NR_BASE
+ 312) },
109 { "flistxattr", (__SCMP_NR_BASE
+ 188) },
110 { "flock", (__SCMP_NR_BASE
+ 71) },
111 { "fork", (__SCMP_NR_BASE
+ 56) },
112 { "fremovexattr", (__SCMP_NR_BASE
+ 191) },
113 { "fsetxattr", (__SCMP_NR_BASE
+ 182) },
114 { "fstat", (__SCMP_NR_BASE
+ 5) },
115 { "fstat64", __PNR_fstat64
},
116 { "fstatat64", __PNR_fstat64
},
117 { "fstatfs", (__SCMP_NR_BASE
+ 135) },
118 { "fstatfs64", (__SCMP_NR_BASE
+ 218) },
119 { "fsync", (__SCMP_NR_BASE
+ 72) },
120 { "ftime", __PNR_ftime
},
121 { "ftruncate", (__SCMP_NR_BASE
+ 75) },
122 { "ftruncate64", __PNR_ftruncate64
},
123 { "futex", (__SCMP_NR_BASE
+ 194) },
124 { "futimesat", (__SCMP_NR_BASE
+ 255) },
125 { "get_kernel_syms", (__SCMP_NR_BASE
+ 170) },
126 { "get_mempolicy", (__SCMP_NR_BASE
+ 232) },
127 { "get_robust_list", (__SCMP_NR_BASE
+ 273) },
128 { "get_thread_area", __PNR_get_thread_area
},
129 { "getcpu", (__SCMP_NR_BASE
+ 275) },
130 { "getcwd", (__SCMP_NR_BASE
+ 77) },
131 { "getdents", (__SCMP_NR_BASE
+ 76) },
132 { "getdents64", (__SCMP_NR_BASE
+ 299) },
133 { "getegid", (__SCMP_NR_BASE
+ 106) },
134 { "getegid32", __PNR_getegid32
},
135 { "geteuid", (__SCMP_NR_BASE
+ 105) },
136 { "geteuid32", __PNR_geteuid32
},
137 { "getgid", (__SCMP_NR_BASE
+ 102) },
138 { "getgid32", __PNR_getgid32
},
139 { "getgroups", (__SCMP_NR_BASE
+ 113) },
140 { "getgroups32", __PNR_getgroups32
},
141 { "getitimer", (__SCMP_NR_BASE
+ 35) },
142 { "getpeername", (__SCMP_NR_BASE
+ 51) },
143 { "getpgid", (__SCMP_NR_BASE
+ 119) },
144 { "getpgrp", (__SCMP_NR_BASE
+ 109) },
145 { "getpid", (__SCMP_NR_BASE
+ 38) },
146 { "getpmsg", (__SCMP_NR_BASE
+ 174) },
147 { "getppid", (__SCMP_NR_BASE
+ 108) },
148 { "getpriority", (__SCMP_NR_BASE
+ 137) },
149 { "getrandom", (__SCMP_NR_BASE
+ 317) },
150 { "getresgid", (__SCMP_NR_BASE
+ 118) },
151 { "getresgid32", __PNR_getresgid32
},
152 { "getresuid", (__SCMP_NR_BASE
+ 116) },
153 { "getresuid32", __PNR_getresuid32
},
154 { "getrlimit", (__SCMP_NR_BASE
+ 95) },
155 { "getrusage", (__SCMP_NR_BASE
+ 96) },
156 { "getsid", (__SCMP_NR_BASE
+ 122) },
157 { "getsockname", (__SCMP_NR_BASE
+ 50) },
158 { "getsockopt", (__SCMP_NR_BASE
+ 54) },
159 { "gettid", (__SCMP_NR_BASE
+ 178) },
160 { "gettimeofday", (__SCMP_NR_BASE
+ 94) },
161 { "getuid", (__SCMP_NR_BASE
+ 100) },
162 { "getuid32", __PNR_getuid32
},
163 { "getxattr", (__SCMP_NR_BASE
+ 183) },
164 { "gtty", __PNR_gtty
},
165 { "idle", __PNR_idle
},
166 { "init_module", (__SCMP_NR_BASE
+ 168) },
167 { "inotify_add_watch", (__SCMP_NR_BASE
+ 248) },
168 { "inotify_init", (__SCMP_NR_BASE
+ 247) },
169 { "inotify_init1", (__SCMP_NR_BASE
+ 292) },
170 { "inotify_rm_watch", (__SCMP_NR_BASE
+ 249) },
171 { "io_cancel", (__SCMP_NR_BASE
+ 204) },
172 { "io_destroy", (__SCMP_NR_BASE
+ 201) },
173 { "io_getevents", (__SCMP_NR_BASE
+ 202) },
174 { "io_setup", (__SCMP_NR_BASE
+ 200) },
175 { "io_submit", (__SCMP_NR_BASE
+ 203) },
176 { "ioctl", (__SCMP_NR_BASE
+ 15) },
177 { "ioperm", __PNR_ioperm
},
178 { "iopl", __PNR_iopl
},
179 { "ioprio_get", (__SCMP_NR_BASE
+ 278) },
180 { "ioprio_set", (__SCMP_NR_BASE
+ 277) },
181 { "ipc", __PNR_ipc
},
182 { "kcmp", (__SCMP_NR_BASE
+ 311) },
183 { "kexec_file_load", __PNR_kexec_file_load
},
184 { "kexec_load", (__SCMP_NR_BASE
+ 274) },
185 { "keyctl", (__SCMP_NR_BASE
+ 245) },
186 { "kill", (__SCMP_NR_BASE
+ 60) },
187 { "lchown", (__SCMP_NR_BASE
+ 92) },
188 { "lchown32", __PNR_lchown32
},
189 { "lgetxattr", (__SCMP_NR_BASE
+ 184) },
190 { "link", (__SCMP_NR_BASE
+ 84) },
191 { "linkat", (__SCMP_NR_BASE
+ 259) },
192 { "listen", (__SCMP_NR_BASE
+ 49) },
193 { "listxattr", (__SCMP_NR_BASE
+ 186) },
194 { "llistxattr", (__SCMP_NR_BASE
+ 187) },
195 { "lock", __PNR_lock
},
196 { "lookup_dcookie", (__SCMP_NR_BASE
+ 206) },
197 { "lremovexattr", (__SCMP_NR_BASE
+ 190) },
198 { "lseek", (__SCMP_NR_BASE
+ 8) },
199 { "lsetxattr", (__SCMP_NR_BASE
+ 181) },
200 { "lstat", (__SCMP_NR_BASE
+ 6) },
201 { "lstat64", __PNR_lstat64
},
202 { "madvise", (__SCMP_NR_BASE
+ 27) },
203 { "mbind", (__SCMP_NR_BASE
+ 231) },
204 { "membarrier", (__SCMP_NR_BASE
+ 322) },
205 { "memfd_create", (__SCMP_NR_BASE
+ 318) },
206 { "migrate_pages", (__SCMP_NR_BASE
+ 250) },
207 { "mincore", (__SCMP_NR_BASE
+ 26) },
208 { "mkdir", (__SCMP_NR_BASE
+ 81) },
209 { "mkdirat", (__SCMP_NR_BASE
+ 252) },
210 { "mknod", (__SCMP_NR_BASE
+ 131) },
211 { "mknodat", (__SCMP_NR_BASE
+ 253) },
212 { "mlock", (__SCMP_NR_BASE
+ 146) },
213 { "mlock2", (__SCMP_NR_BASE
+ 323) },
214 { "mlockall", (__SCMP_NR_BASE
+ 148) },
215 { "mmap", (__SCMP_NR_BASE
+ 9) },
216 { "mmap2", __PNR_mmap2
},
217 { "modify_ldt", __PNR_modify_ldt
},
218 { "mount", (__SCMP_NR_BASE
+ 160) },
219 { "move_pages", (__SCMP_NR_BASE
+ 271) },
220 { "mprotect", (__SCMP_NR_BASE
+ 10) },
221 { "mpx", __PNR_mpx
},
222 { "mq_getsetattr", (__SCMP_NR_BASE
+ 239) },
223 { "mq_notify", (__SCMP_NR_BASE
+ 238) },
224 { "mq_open", (__SCMP_NR_BASE
+ 234) },
225 { "mq_timedreceive", (__SCMP_NR_BASE
+ 237) },
226 { "mq_timedsend", (__SCMP_NR_BASE
+ 236) },
227 { "mq_unlink", (__SCMP_NR_BASE
+ 235) },
228 { "mremap", (__SCMP_NR_BASE
+ 24) },
229 { "msgctl", (__SCMP_NR_BASE
+ 69) },
230 { "msgget", (__SCMP_NR_BASE
+ 66) },
231 { "msgrcv", (__SCMP_NR_BASE
+ 68) },
232 { "msgsnd", (__SCMP_NR_BASE
+ 67) },
233 { "msync", (__SCMP_NR_BASE
+ 25) },
234 { "multiplexer", __PNR_multiplexer
},
235 { "munlock", (__SCMP_NR_BASE
+ 147) },
236 { "munlockall", (__SCMP_NR_BASE
+ 149) },
237 { "munmap", (__SCMP_NR_BASE
+ 11) },
238 { "name_to_handle_at", (__SCMP_NR_BASE
+ 303) },
239 { "nanosleep", (__SCMP_NR_BASE
+ 34) },
240 { "newfstatat", (__SCMP_NR_BASE
+ 256) },
241 { "nfsservctl", (__SCMP_NR_BASE
+ 173) },
242 { "nice", __PNR_nice
},
243 { "oldfstat", __PNR_oldfstat
},
244 { "oldlstat", __PNR_oldlstat
},
245 { "oldolduname", __PNR_oldolduname
},
246 { "oldstat", __PNR_oldstat
},
247 { "olduname", __PNR_olduname
},
248 { "oldwait4", __PNR_oldwait4
},
249 { "open", (__SCMP_NR_BASE
+ 2) },
250 { "open_by_handle_at", (__SCMP_NR_BASE
+ 304) },
251 { "openat", (__SCMP_NR_BASE
+ 251) },
252 { "pause", (__SCMP_NR_BASE
+ 33) },
253 { "pciconfig_iobase", __PNR_pciconfig_iobase
},
254 { "pciconfig_read", __PNR_pciconfig_read
},
255 { "pciconfig_write", __PNR_pciconfig_write
},
256 { "perf_event_open", (__SCMP_NR_BASE
+ 296) },
257 { "personality", (__SCMP_NR_BASE
+ 132) },
258 { "pipe", (__SCMP_NR_BASE
+ 21) },
259 { "pipe2", (__SCMP_NR_BASE
+ 291) },
260 { "pivot_root", (__SCMP_NR_BASE
+ 151) },
261 { "poll", (__SCMP_NR_BASE
+ 7) },
262 { "ppoll", (__SCMP_NR_BASE
+ 265) },
263 { "prctl", (__SCMP_NR_BASE
+ 153) },
264 { "pread64", (__SCMP_NR_BASE
+ 16) },
265 { "preadv", (__SCMP_NR_BASE
+ 293) },
266 { "prlimit64", (__SCMP_NR_BASE
+ 302) },
267 { "process_vm_readv", (__SCMP_NR_BASE
+ 309) },
268 { "process_vm_writev", (__SCMP_NR_BASE
+ 310) },
269 { "prof", __PNR_prof
},
270 { "profil", __PNR_profil
},
271 { "pselect6", (__SCMP_NR_BASE
+ 264) },
272 { "ptrace", (__SCMP_NR_BASE
+ 99) },
273 { "putpmsg", (__SCMP_NR_BASE
+ 175) },
274 { "pwrite64", (__SCMP_NR_BASE
+ 17) },
275 { "pwritev", (__SCMP_NR_BASE
+ 294) },
276 { "query_module", (__SCMP_NR_BASE
+ 171) },
277 { "quotactl", (__SCMP_NR_BASE
+ 172) },
278 { "read", (__SCMP_NR_BASE
+ 0) },
279 { "readahead", (__SCMP_NR_BASE
+ 179) },
280 { "readdir", __PNR_readdir
},
281 { "readlink", (__SCMP_NR_BASE
+ 87) },
282 { "readlinkat", (__SCMP_NR_BASE
+ 261) },
283 { "readv", (__SCMP_NR_BASE
+ 18) },
284 { "reboot", (__SCMP_NR_BASE
+ 164) },
285 { "recv", __PNR_recv
},
286 { "recvfrom", (__SCMP_NR_BASE
+ 44) },
287 { "recvmmsg", (__SCMP_NR_BASE
+ 298) },
288 { "recvmsg", (__SCMP_NR_BASE
+ 46) },
289 { "remap_file_pages", (__SCMP_NR_BASE
+ 210) },
290 { "removexattr", (__SCMP_NR_BASE
+ 189) },
291 { "rename", (__SCMP_NR_BASE
+ 80) },
292 { "renameat", (__SCMP_NR_BASE
+ 258) },
293 { "renameat2", (__SCMP_NR_BASE
+ 315) },
294 { "request_key", (__SCMP_NR_BASE
+ 244) },
295 { "restart_syscall", (__SCMP_NR_BASE
+ 214) },
296 { "rmdir", (__SCMP_NR_BASE
+ 82) },
297 { "rt_sigaction", (__SCMP_NR_BASE
+ 13) },
298 { "rt_sigpending", (__SCMP_NR_BASE
+ 125) },
299 { "rt_sigprocmask", (__SCMP_NR_BASE
+ 14) },
300 { "rt_sigqueueinfo", (__SCMP_NR_BASE
+ 127) },
301 { "rt_sigreturn", (__SCMP_NR_BASE
+ 211) },
302 { "rt_sigsuspend", (__SCMP_NR_BASE
+ 128) },
303 { "rt_sigtimedwait", (__SCMP_NR_BASE
+ 126) },
304 { "rt_tgsigqueueinfo", (__SCMP_NR_BASE
+ 295) },
305 { "rtas", __PNR_rtas
},
306 { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read
},
307 { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write
},
308 { "s390_runtime_instr", __PNR_s390_runtime_instr
},
309 { "sched_get_priority_max", (__SCMP_NR_BASE
+ 143) },
310 { "sched_get_priority_min", (__SCMP_NR_BASE
+ 144) },
311 { "sched_getaffinity", (__SCMP_NR_BASE
+ 196) },
312 { "sched_getattr", (__SCMP_NR_BASE
+ 314) },
313 { "sched_getparam", (__SCMP_NR_BASE
+ 140) },
314 { "sched_getscheduler", (__SCMP_NR_BASE
+ 142) },
315 { "sched_rr_get_interval", (__SCMP_NR_BASE
+ 145) },
316 { "sched_setaffinity", (__SCMP_NR_BASE
+ 195) },
317 { "sched_setattr", (__SCMP_NR_BASE
+ 313) },
318 { "sched_setparam", (__SCMP_NR_BASE
+ 139) },
319 { "sched_setscheduler", (__SCMP_NR_BASE
+ 141) },
320 { "sched_yield", (__SCMP_NR_BASE
+ 23) },
321 { "seccomp", (__SCMP_NR_BASE
+ 316) },
322 { "security", __PNR_security
},
323 { "select", __PNR_select
},
324 { "semctl", (__SCMP_NR_BASE
+ 64) },
325 { "semget", (__SCMP_NR_BASE
+ 62) },
326 { "semop", (__SCMP_NR_BASE
+ 63) },
327 { "semtimedop", (__SCMP_NR_BASE
+ 215) },
328 { "send", __PNR_send
},
329 { "sendfile", (__SCMP_NR_BASE
+ 39) },
330 { "sendfile64", (__SCMP_NR_BASE
+ 219) },
331 { "sendmmsg", (__SCMP_NR_BASE
+ 307) },
332 { "sendmsg", (__SCMP_NR_BASE
+ 45) },
333 { "sendto", (__SCMP_NR_BASE
+ 43) },
334 { "set_mempolicy", (__SCMP_NR_BASE
+ 233) },
335 { "set_robust_list", (__SCMP_NR_BASE
+ 272) },
336 { "set_thread_area", (__SCMP_NR_BASE
+ 246) },
337 { "set_tid_address", (__SCMP_NR_BASE
+ 213) },
338 { "set_tls", __PNR_set_tls
},
339 { "setdomainname", (__SCMP_NR_BASE
+ 166) },
340 { "setfsgid", (__SCMP_NR_BASE
+ 121) },
341 { "setfsgid32", __PNR_setfsgid32
},
342 { "setfsuid", (__SCMP_NR_BASE
+ 120) },
343 { "setfsuid32", __PNR_setfsuid32
},
344 { "setgid", (__SCMP_NR_BASE
+ 104) },
345 { "setgid32", __PNR_setgid32
},
346 { "setgroups", (__SCMP_NR_BASE
+ 114) },
347 { "setgroups32", __PNR_setgroups32
},
348 { "sethostname", (__SCMP_NR_BASE
+ 165) },
349 { "setitimer", (__SCMP_NR_BASE
+ 36) },
350 { "setns", (__SCMP_NR_BASE
+ 308) },
351 { "setpgid", (__SCMP_NR_BASE
+ 107) },
352 { "setpriority", (__SCMP_NR_BASE
+ 138) },
353 { "setregid", (__SCMP_NR_BASE
+ 112) },
354 { "setregid32", __PNR_setregid32
},
355 { "setresgid", (__SCMP_NR_BASE
+ 117) },
356 { "setresgid32", __PNR_setresgid32
},
357 { "setresuid", (__SCMP_NR_BASE
+ 115) },
358 { "setresuid32", __PNR_setresuid32
},
359 { "setreuid", (__SCMP_NR_BASE
+ 111) },
360 { "setreuid32", __PNR_setreuid32
},
361 { "setrlimit", (__SCMP_NR_BASE
+ 155) },
362 { "setsid", (__SCMP_NR_BASE
+ 110) },
363 { "setsockopt", (__SCMP_NR_BASE
+ 53) },
364 { "settimeofday", (__SCMP_NR_BASE
+ 159) },
365 { "setuid", (__SCMP_NR_BASE
+ 103) },
366 { "setuid32", __PNR_setuid32
},
367 { "setxattr", (__SCMP_NR_BASE
+ 180) },
368 { "sgetmask", __PNR_sgetmask
},
369 { "shmat", (__SCMP_NR_BASE
+ 29) },
370 { "shmctl", (__SCMP_NR_BASE
+ 30) },
371 { "shmdt", (__SCMP_NR_BASE
+ 65) },
372 { "shmget", (__SCMP_NR_BASE
+ 28) },
373 { "shutdown", (__SCMP_NR_BASE
+ 47) },
374 { "sigaction", __PNR_sigaction
},
375 { "sigaltstack", (__SCMP_NR_BASE
+ 129) },
376 { "signal", __PNR_signal
},
377 { "signalfd", (__SCMP_NR_BASE
+ 280) },
378 { "signalfd4", (__SCMP_NR_BASE
+ 287) },
379 { "sigpending", __PNR_sigpending
},
380 { "sigprocmask", __PNR_sigprocmask
},
381 { "sigreturn", __PNR_sigreturn
},
382 { "sigsuspend", __PNR_sigsuspend
},
383 { "socket", (__SCMP_NR_BASE
+ 40) },
384 { "socketcall", __PNR_socketcall
},
385 { "socketpair", (__SCMP_NR_BASE
+ 52) },
386 { "splice", (__SCMP_NR_BASE
+ 267) },
387 { "spu_create", __PNR_spu_create
},
388 { "spu_run", __PNR_spu_run
},
389 { "ssetmask", __PNR_ssetmask
},
390 { "stat", (__SCMP_NR_BASE
+ 4) },
391 { "stat64", __PNR_stat64
},
392 { "statfs", (__SCMP_NR_BASE
+ 134) },
393 { "statfs64", (__SCMP_NR_BASE
+ 217) },
394 { "stime", __PNR_stime
},
395 { "stty", __PNR_stty
},
396 { "subpage_prot", __PNR_subpage_prot
},
397 { "swapcontext", __PNR_swapcontext
},
398 { "swapoff", (__SCMP_NR_BASE
+ 163) },
399 { "swapon", (__SCMP_NR_BASE
+ 162) },
400 { "switch_endian", __PNR_switch_endian
},
401 { "symlink", (__SCMP_NR_BASE
+ 86) },
402 { "symlinkat", (__SCMP_NR_BASE
+ 260) },
403 { "sync", (__SCMP_NR_BASE
+ 157) },
404 { "sync_file_range", (__SCMP_NR_BASE
+ 268) },
405 { "sync_file_range2", __PNR_sync_file_range2
},
406 { "syncfs", (__SCMP_NR_BASE
+ 306) },
407 { "syscall", __PNR_syscall
},
408 { "sys_debug_setcontext", __PNR_sys_debug_setcontext
},
409 { "sysfs", (__SCMP_NR_BASE
+ 136) },
410 { "sysinfo", (__SCMP_NR_BASE
+ 97) },
411 { "syslog", (__SCMP_NR_BASE
+ 101) },
412 { "sysmips", (__SCMP_NR_BASE
+ 199) },
413 { "tee", (__SCMP_NR_BASE
+ 269) },
414 { "tgkill", (__SCMP_NR_BASE
+ 229) },
415 { "time", __PNR_time
},
416 { "timer_create", (__SCMP_NR_BASE
+ 220) },
417 { "timer_delete", (__SCMP_NR_BASE
+ 224) },
418 { "timer_getoverrun", (__SCMP_NR_BASE
+ 223) },
419 { "timer_gettime", (__SCMP_NR_BASE
+ 222) },
420 { "timer_settime", (__SCMP_NR_BASE
+ 221) },
421 { "timerfd", (__SCMP_NR_BASE
+ 281) },
422 { "timerfd_create", (__SCMP_NR_BASE
+ 284) },
423 { "timerfd_gettime", (__SCMP_NR_BASE
+ 285) },
424 { "timerfd_settime", (__SCMP_NR_BASE
+ 286) },
425 { "times", (__SCMP_NR_BASE
+ 98) },
426 { "tkill", (__SCMP_NR_BASE
+ 192) },
427 { "truncate", (__SCMP_NR_BASE
+ 74) },
428 { "truncate64", __PNR_truncate64
},
429 { "tuxcall", __PNR_tuxcall
},
430 { "ugetrlimit", __PNR_ugetrlimit
},
431 { "ulimit", __PNR_ulimit
},
432 { "umask", (__SCMP_NR_BASE
+ 93) },
433 { "umount", __PNR_umount
},
434 { "umount2", (__SCMP_NR_BASE
+ 161) },
435 { "uname", (__SCMP_NR_BASE
+ 61) },
436 { "unlink", (__SCMP_NR_BASE
+ 85) },
437 { "unlinkat", (__SCMP_NR_BASE
+ 257) },
438 { "unshare", (__SCMP_NR_BASE
+ 266) },
439 { "uselib", __PNR_uselib
},
440 { "userfaultfd", (__SCMP_NR_BASE
+ 321) },
441 { "usr26", __PNR_usr26
},
442 { "usr32", __PNR_usr32
},
443 { "ustat", (__SCMP_NR_BASE
+ 133) },
444 { "utime", (__SCMP_NR_BASE
+ 130) },
445 { "utimensat", (__SCMP_NR_BASE
+ 279) },
446 { "utimes", (__SCMP_NR_BASE
+ 230) },
447 { "vfork", __PNR_vfork
},
448 { "vhangup", (__SCMP_NR_BASE
+ 150) },
449 { "vm86", __PNR_vm86
},
450 { "vm86old", __PNR_vm86old
},
451 { "vmsplice", (__SCMP_NR_BASE
+ 270) },
452 { "vserver", (__SCMP_NR_BASE
+ 240) },
453 { "wait4", (__SCMP_NR_BASE
+ 59) },
454 { "waitid", (__SCMP_NR_BASE
+ 241) },
455 { "waitpid", __PNR_waitpid
},
456 { "write", (__SCMP_NR_BASE
+ 1) },
457 { "writev", (__SCMP_NR_BASE
+ 19) },
458 { NULL
, __NR_SCMP_ERROR
},
462 * Resolve a syscall name to a number
463 * @param name the syscall name
465 * Resolve the given syscall name to the syscall number using the syscall table.
466 * Returns the syscall number on success, including negative pseudo syscall
467 * numbers; returns __NR_SCMP_ERROR on failure.
470 int mips64n32_syscall_resolve_name(const char *name
)
473 const struct arch_syscall_def
*table
= mips64n32_syscall_table
;
475 /* XXX - plenty of room for future improvement here */
476 for (iter
= 0; table
[iter
].name
!= NULL
; iter
++) {
477 if (strcmp(name
, table
[iter
].name
) == 0)
478 return table
[iter
].num
;
481 return __NR_SCMP_ERROR
;
485 * Resolve a syscall number to a name
486 * @param num the syscall number
488 * Resolve the given syscall number to the syscall name using the syscall table.
489 * Returns a pointer to the syscall name string on success, including pseudo
490 * syscall names; returns NULL on failure.
493 const char *mips64n32_syscall_resolve_num(int num
)
496 const struct arch_syscall_def
*table
= mips64n32_syscall_table
;
498 /* XXX - plenty of room for future improvement here */
499 for (iter
= 0; table
[iter
].num
!= __NR_SCMP_ERROR
; iter
++) {
500 if (num
== table
[iter
].num
)
501 return table
[iter
].name
;
508 * Iterate through the syscall table and return the syscall name
509 * @param spot the offset into the syscall table
511 * Return the syscall name at position @spot or NULL on failure. This function
512 * should only ever be used internally by libseccomp.
515 const char *mips64n32_syscall_iterate_name(unsigned int spot
)
517 /* XXX - no safety checks here */
518 return mips64n32_syscall_table
[spot
].name
;