Linux-Seccomp

 view release on metacpan or  search on metacpan

libseccomp/src/arch-mips-syscalls.c  view on Meta::CPAN

/**
 * Enhanced Seccomp MIPS Specific Code
 *
 * Copyright (c) 2014 Imagination Technologies Ltd.
 * Author: Markos Chandras <markos.chandras@imgtec.com>
 *
 */

/*
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of version 2.1 of the GNU Lesser General Public License as
 * published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library; if not, see <http://www.gnu.org/licenses>.
 */

#include <string.h>

#include <seccomp.h>

#include "arch.h"
#include "arch-mips.h"

/* O32 ABI */
#define __SCMP_NR_BASE		4000

/* NOTE: based on Linux 4.5-rc4 */
const struct arch_syscall_def mips_syscall_table[] = { \
	{ "_llseek", (__SCMP_NR_BASE + 140) },
	{ "_newselect", (__SCMP_NR_BASE + 142) },
	{ "_sysctl", (__SCMP_NR_BASE + 153) },
	{ "accept", (__SCMP_NR_BASE + 168) },
	{ "accept4", (__SCMP_NR_BASE + 334) },
	{ "access", (__SCMP_NR_BASE + 33) },
	{ "acct", (__SCMP_NR_BASE + 51) },
	{ "add_key", (__SCMP_NR_BASE + 280) },
	{ "adjtimex", (__SCMP_NR_BASE + 124) },
	{ "afs_syscall", __SCMP_NR_BASE + 137 },
	{ "alarm", (__SCMP_NR_BASE + 27) },
	{ "arm_fadvise64_64", __PNR_arm_fadvise64_64 },
	{ "arm_sync_file_range", __PNR_arm_sync_file_range },
	{ "arch_prctl", __PNR_arch_prctl },
	{ "bdflush", (__SCMP_NR_BASE + 134) },
	{ "bind", (__SCMP_NR_BASE + 169) },
	{ "bpf", (__SCMP_NR_BASE + 355) },
	{ "break", __SCMP_NR_BASE + 17 },
	{ "breakpoint", __PNR_breakpoint },
	{ "brk", (__SCMP_NR_BASE + 45) },
	{ "cachectl", (__SCMP_NR_BASE + 148) },
	{ "cacheflush", (__SCMP_NR_BASE + 147) },
	{ "capget", (__SCMP_NR_BASE + 204) },
	{ "capset", (__SCMP_NR_BASE + 205) },
	{ "chdir", (__SCMP_NR_BASE + 12) },
	{ "chmod", (__SCMP_NR_BASE + 15) },
	{ "chown", (__SCMP_NR_BASE + 202) },
	{ "chown32", (__PNR_chown32) },
	{ "chroot", (__SCMP_NR_BASE + 61) },
	{ "clock_adjtime", (__SCMP_NR_BASE + 341) },
	{ "clock_getres", (__SCMP_NR_BASE + 264) },
	{ "clock_gettime", (__SCMP_NR_BASE + 263) },
	{ "clock_nanosleep", (__SCMP_NR_BASE + 265) },
	{ "clock_settime", (__SCMP_NR_BASE + 262) },
	{ "clone", (__SCMP_NR_BASE + 120) },
	{ "close", (__SCMP_NR_BASE + 6) },
	{ "connect", (__SCMP_NR_BASE + 170) },
	{ "copy_file_range", (__SCMP_NR_BASE + 360) },
	{ "creat", (__SCMP_NR_BASE + 8) },
	{ "create_module", __SCMP_NR_BASE + 127 },
	{ "delete_module", (__SCMP_NR_BASE + 129) },
	{ "dup", (__SCMP_NR_BASE + 41) },
	{ "dup2", (__SCMP_NR_BASE + 63) },
	{ "dup3", (__SCMP_NR_BASE + 327) },
	{ "epoll_create", (__SCMP_NR_BASE + 248) },
	{ "epoll_create1", (__SCMP_NR_BASE + 326) },
	{ "epoll_ctl", (__SCMP_NR_BASE + 249) },
	{ "epoll_ctl_old", __PNR_epoll_ctl_old },
	{ "epoll_pwait", (__SCMP_NR_BASE + 313) },
	{ "epoll_wait", (__SCMP_NR_BASE + 250) },
	{ "epoll_wait_old", __PNR_epoll_wait_old },
	{ "eventfd", (__SCMP_NR_BASE + 319) },
	{ "eventfd2", (__SCMP_NR_BASE + 325) },
	{ "execve", (__SCMP_NR_BASE + 11) },
	{ "execveat", (__SCMP_NR_BASE + 356) },
	{ "exit", (__SCMP_NR_BASE + 1) },
	{ "exit_group", (__SCMP_NR_BASE + 246) },
	{ "faccessat", (__SCMP_NR_BASE + 300) },
	{ "fadvise64", __SCMP_NR_BASE + 254 },
	{ "fadvise64_64", __PNR_fadvise64_64 },
	{ "fallocate", (__SCMP_NR_BASE + 320) },
	{ "fanotify_init", (__SCMP_NR_BASE + 336) },
	{ "fanotify_mark", (__SCMP_NR_BASE + 337) },
	{ "fchdir", (__SCMP_NR_BASE + 133) },
	{ "fchmod", (__SCMP_NR_BASE + 94) },
	{ "fchmodat", (__SCMP_NR_BASE + 299) },
	{ "fchown", (__SCMP_NR_BASE + 95) },
	{ "fchown32", (__PNR_fchown32) },
	{ "fchownat", (__SCMP_NR_BASE + 291) },
	{ "fcntl", (__SCMP_NR_BASE + 55) },
	{ "fcntl64", (__SCMP_NR_BASE + 220) },
	{ "fdatasync", (__SCMP_NR_BASE + 152) },
	{ "fgetxattr", (__SCMP_NR_BASE + 229) },
	{ "finit_module", (__SCMP_NR_BASE + 348) },
	{ "flistxattr", (__SCMP_NR_BASE + 232) },
	{ "flock", (__SCMP_NR_BASE + 143) },
	{ "fork", (__SCMP_NR_BASE + 2) },
	{ "fremovexattr", (__SCMP_NR_BASE + 235) },
	{ "fsetxattr", (__SCMP_NR_BASE + 226) },
	{ "fstat", (__SCMP_NR_BASE + 108) },
	{ "fstat64", (__SCMP_NR_BASE + 215) },
	{ "fstatat64", (__SCMP_NR_BASE + 293) },
	{ "fstatfs", (__SCMP_NR_BASE + 100) },
	{ "fstatfs64", (__SCMP_NR_BASE + 256) },
	{ "fsync", (__SCMP_NR_BASE + 118) },
	{ "ftime", (__SCMP_NR_BASE + 35) },
	{ "ftruncate", (__SCMP_NR_BASE + 93) },
	{ "ftruncate64", (__SCMP_NR_BASE + 212) },
	{ "futex", (__SCMP_NR_BASE + 238) },
	{ "futimesat", (__SCMP_NR_BASE + 292) },
	{ "get_kernel_syms", (__SCMP_NR_BASE + 130) },
	{ "get_mempolicy", (__SCMP_NR_BASE + 269) },
	{ "get_robust_list", (__SCMP_NR_BASE + 310) },
	{ "get_thread_area", __PNR_get_thread_area },
	{ "getcpu", (__SCMP_NR_BASE + 312) },
	{ "getcwd", (__SCMP_NR_BASE + 203) },
	{ "getdents", (__SCMP_NR_BASE + 141) },
	{ "getdents64", (__SCMP_NR_BASE + 219) },
	{ "getegid", (__SCMP_NR_BASE + 50) },
	{ "getegid32", __PNR_getegid32 },
	{ "geteuid", (__SCMP_NR_BASE + 49) },
	{ "geteuid32", __PNR_geteuid32 },
	{ "getgid", (__SCMP_NR_BASE + 47) },
	{ "getgid32", __PNR_getgid32 },
	{ "getgroups", (__SCMP_NR_BASE + 80) },
	{ "getgroups32", __PNR_getgroups32 },
	{ "getitimer", (__SCMP_NR_BASE + 105) },
	{ "getpeername", (__SCMP_NR_BASE + 171) },
	{ "getpgid", (__SCMP_NR_BASE + 132) },
	{ "getpgrp", (__SCMP_NR_BASE + 65) },
	{ "getpid", (__SCMP_NR_BASE + 20) },
	{ "getpmsg", (__SCMP_NR_BASE + 208) },
	{ "getppid", (__SCMP_NR_BASE + 64) },
	{ "getpriority", (__SCMP_NR_BASE + 96) },
	{ "getrandom", (__SCMP_NR_BASE + 353) },
	{ "getresgid", (__SCMP_NR_BASE + 191) },
	{ "getresgid32", __PNR_getresgid32 },
	{ "getresuid", (__SCMP_NR_BASE + 186) },
	{ "getresuid32", __PNR_getresuid32 },
	{ "getrlimit", (__SCMP_NR_BASE + 76) },
	{ "getrusage", (__SCMP_NR_BASE + 77) },
	{ "getsid", (__SCMP_NR_BASE + 151) },
	{ "getsockname", (__SCMP_NR_BASE + 172) },
	{ "getsockopt", (__SCMP_NR_BASE + 173) },
	{ "gettid", (__SCMP_NR_BASE + 222) },
	{ "gettimeofday", (__SCMP_NR_BASE + 78) },
	{ "getuid", (__SCMP_NR_BASE + 24) },
	{ "getuid32", __PNR_getuid32 },
	{ "getxattr", (__SCMP_NR_BASE + 227) },
	{ "gtty", (__SCMP_NR_BASE + 32) },
	{ "idle", (__SCMP_NR_BASE + 112) },
	{ "init_module", (__SCMP_NR_BASE + 128) },
	{ "inotify_add_watch", (__SCMP_NR_BASE + 285) },
	{ "inotify_init", (__SCMP_NR_BASE + 284) },
	{ "inotify_init1", (__SCMP_NR_BASE + 329) },
	{ "inotify_rm_watch", (__SCMP_NR_BASE + 286) },
	{ "io_cancel", (__SCMP_NR_BASE + 245) },
	{ "io_destroy", (__SCMP_NR_BASE + 242) },
	{ "io_getevents", (__SCMP_NR_BASE + 243) },
	{ "io_setup", (__SCMP_NR_BASE + 241) },
	{ "io_submit", (__SCMP_NR_BASE + 244) },
	{ "ioctl", (__SCMP_NR_BASE + 54) },
	{ "ioperm", (__SCMP_NR_BASE + 101) },
	{ "iopl", (__SCMP_NR_BASE + 110) },
	{ "ioprio_get", (__SCMP_NR_BASE + 315) },
	{ "ioprio_set", (__SCMP_NR_BASE + 314) },
	{ "ipc", (__SCMP_NR_BASE + 117) },
	{ "kcmp", (__SCMP_NR_BASE + 347)  },
	{ "kexec_file_load", __PNR_kexec_file_load },
	{ "kexec_load", (__SCMP_NR_BASE + 311) },
	{ "keyctl", (__SCMP_NR_BASE + 282) },
	{ "kill", (__SCMP_NR_BASE + 37) },
	{ "lchown", (__SCMP_NR_BASE + 16) },
	{ "lchown32", __PNR_lchown32 },
	{ "lgetxattr", (__SCMP_NR_BASE + 228) },
	{ "link", (__SCMP_NR_BASE + 9) },
	{ "linkat", (__SCMP_NR_BASE + 296) },
	{ "listen", (__SCMP_NR_BASE + 174) },
	{ "listxattr", (__SCMP_NR_BASE + 230) },
	{ "llistxattr", (__SCMP_NR_BASE + 231) },
	{ "lock", (__SCMP_NR_BASE + 53) },
	{ "lookup_dcookie", (__SCMP_NR_BASE + 247) },
	{ "lremovexattr", (__SCMP_NR_BASE + 234) },
	{ "lseek", (__SCMP_NR_BASE + 19) },
	{ "lsetxattr", (__SCMP_NR_BASE + 225) },
	{ "lstat", (__SCMP_NR_BASE + 107) },
	{ "lstat64", (__SCMP_NR_BASE + 214) },
	{ "madvise", (__SCMP_NR_BASE + 218) },
	{ "mbind", (__SCMP_NR_BASE + 268) },
	{ "membarrier", (__SCMP_NR_BASE + 358) },
	{ "memfd_create", (__SCMP_NR_BASE + 354) },
	{ "migrate_pages", (__SCMP_NR_BASE + 287) },
	{ "mincore", (__SCMP_NR_BASE + 217) },
	{ "mkdir", (__SCMP_NR_BASE + 39) },
	{ "mkdirat", (__SCMP_NR_BASE + 289) },
	{ "mknod", (__SCMP_NR_BASE + 14) },
	{ "mknodat", (__SCMP_NR_BASE + 290) },
	{ "mlock", (__SCMP_NR_BASE + 154) },
	{ "mlock2", (__SCMP_NR_BASE + 359) },
	{ "mlockall", (__SCMP_NR_BASE + 156) },
	{ "mmap", (__SCMP_NR_BASE + 90) },
	{ "mmap2", (__SCMP_NR_BASE + 210) },
	{ "modify_ldt", (__SCMP_NR_BASE + 123) },
	{ "mount", (__SCMP_NR_BASE + 21) },
	{ "move_pages", (__SCMP_NR_BASE + 308) },
	{ "mprotect", (__SCMP_NR_BASE + 125) },
	{ "mpx", (__SCMP_NR_BASE + 56) },
	{ "mq_getsetattr", (__SCMP_NR_BASE + 276) },
	{ "mq_notify", (__SCMP_NR_BASE + 275) },
	{ "mq_open", (__SCMP_NR_BASE + 271) },
	{ "mq_timedreceive", (__SCMP_NR_BASE + 274) },
	{ "mq_timedsend", (__SCMP_NR_BASE + 273) },
	{ "mq_unlink", (__SCMP_NR_BASE + 272) },
	{ "mremap", (__SCMP_NR_BASE + 167) },
	{ "msgctl", __PNR_msgctl },
	{ "msgget", __PNR_msgget },
	{ "msgrcv", __PNR_msgrcv },
	{ "msgsnd", __PNR_msgsnd },
	{ "msync", (__SCMP_NR_BASE + 144) },
	{ "multiplexer", __PNR_multiplexer },
	{ "munlock", (__SCMP_NR_BASE + 155) },
	{ "munlockall", (__SCMP_NR_BASE + 157) },
	{ "munmap", (__SCMP_NR_BASE + 91) },
	{ "name_to_handle_at", (__SCMP_NR_BASE + 339) },
	{ "nanosleep", (__SCMP_NR_BASE + 166) },
	{ "newfstatat", __PNR_newfstatat },
	{ "nfsservctl", (__SCMP_NR_BASE + 189) },
	{ "nice", (__SCMP_NR_BASE + 34) },
	{ "oldfstat", __PNR_oldfstat },
	{ "oldlstat", __PNR_oldlstat },
	{ "oldolduname", __PNR_oldolduname },
	{ "oldstat", __PNR_oldstat },
	{ "olduname", __PNR_olduname },
	{ "oldwait4", __PNR_oldwait4 },



( run in 1.361 second using v1.01-cache-2.11-cpan-71847e10f99 )