From: Bart Van Assche Date: Mon, 1 Jul 2019 22:01:59 +0000 (-0700) Subject: Update Linux x86 system call number definitions X-Git-Tag: VALGRIND_3_16_0~257 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9fc7bceeb0b090d1010312fe8da10f359b5097e;p=thirdparty%2Fvalgrind.git Update Linux x86 system call number definitions Introduce new header files for the system call numbers that are shared across all Linux architectures and also for the system call numbers that are shared across all 32-bit architectures. --- diff --git a/include/pub_tool_vkiscnums_asm.h b/include/pub_tool_vkiscnums_asm.h index 484dded829..af1552ffc9 100644 --- a/include/pub_tool_vkiscnums_asm.h +++ b/include/pub_tool_vkiscnums_asm.h @@ -32,30 +32,43 @@ #define __PUB_TOOL_VKISCNUMS_ASM_H #if defined(VGP_x86_linux) +# include "vki/vki-scnums-shared-linux.h" +# include "vki/vki-scnums-32bit-linux.h" # include "vki/vki-scnums-x86-linux.h" #elif defined(VGP_amd64_linux) +# include "vki/vki-scnums-shared-linux.h" # include "vki/vki-scnums-amd64-linux.h" #elif defined(VGP_ppc32_linux) +# include "vki/vki-scnums-shared-linux.h" +# include "vki/vki-scnums-32bit-linux.h" # include "vki/vki-scnums-ppc32-linux.h" #elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) +# include "vki/vki-scnums-shared-linux.h" # include "vki/vki-scnums-ppc64-linux.h" #elif defined(VGP_s390x_linux) +# include "vki/vki-scnums-shared-linux.h" # include "vki/vki-scnums-s390x-linux.h" #elif defined(VGP_arm_linux) +# include "vki/vki-scnums-shared-linux.h" +# include "vki/vki-scnums-32bit-linux.h" # include "vki/vki-scnums-arm-linux.h" #elif defined(VGP_arm64_linux) +# include "vki/vki-scnums-shared-linux.h" # include "vki/vki-scnums-arm64-linux.h" #elif defined(VGP_mips32_linux) +# include "vki/vki-scnums-shared-linux.h" +# include "vki/vki-scnums-32bit-linux.h" # include "vki/vki-scnums-mips32-linux.h" #elif defined(VGP_mips64_linux) +# include "vki/vki-scnums-shared-linux.h" # include "vki/vki-scnums-mips64-linux.h" #elif defined(VGP_x86_darwin) || defined(VGP_amd64_darwin) diff --git a/include/vki/vki-scnums-32bit-linux.h b/include/vki/vki-scnums-32bit-linux.h new file mode 100644 index 0000000000..f276ddaedd --- /dev/null +++ b/include/vki/vki-scnums-32bit-linux.h @@ -0,0 +1,49 @@ +/* + This file is part of Valgrind, a dynamic binary instrumentation framework. + + Copyright (C) 2019 Bart Van Assche + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + The GNU General Public License is contained in the file COPYING. +*/ + +#ifndef __VKI_SCNUMS_32BIT_LINUX_H +#define __VKI_SCNUMS_32BIT_LINUX_H + +// Derived from the __BITS_PER_LONG == 32 sections in +// linux-5.2/include/uapi/asm-generic/unistd.h + +#define __NR_clock_gettime64 403 +#define __NR_clock_settime64 404 +#define __NR_clock_adjtime64 405 +#define __NR_clock_getres_time64 406 +#define __NR_clock_nanosleep_time64 407 +#define __NR_timer_gettime64 408 +#define __NR_timer_settime64 409 +#define __NR_timerfd_gettime64 410 +#define __NR_timerfd_settime64 411 +#define __NR_utimensat_time64 412 +#define __NR_pselect6_time64 413 +#define __NR_ppoll_time64 414 +#define __NR_io_pgetevents_time64 416 +#define __NR_recvmmsg_time64 417 +#define __NR_mq_timedsend_time64 418 +#define __NR_mq_timedreceive_time64 419 +#define __NR_semtimedop_time64 420 +#define __NR_rt_sigtimedwait_time64 421 +#define __NR_futex_time64 422 +#define __NR_sched_rr_get_interval_time64 423 + +#endif diff --git a/include/vki/vki-scnums-amd64-linux.h b/include/vki/vki-scnums-amd64-linux.h index ee6cccb51a..65134734a5 100644 --- a/include/vki/vki-scnums-amd64-linux.h +++ b/include/vki/vki-scnums-amd64-linux.h @@ -30,7 +30,7 @@ #ifndef __VKI_SCNUMS_AMD64_LINUX_H #define __VKI_SCNUMS_AMD64_LINUX_H -// Derived from linux-2.6/arch/x86/entry/syscalls/syscall_64.tbl +// Derived from linux-5.2/arch/x86/entry/syscalls/syscall_64.tbl #define __NR_read 0 #define __NR_write 1 @@ -412,6 +412,8 @@ #define __NR_pkey_alloc 330 #define __NR_pkey_free 331 #define __NR_statx 332 +#define __NR_io_pgetevents 333 +#define __NR_rseq 334 #endif /* __VKI_SCNUMS_AMD64_LINUX_H */ diff --git a/include/vki/vki-scnums-shared-linux.h b/include/vki/vki-scnums-shared-linux.h new file mode 100644 index 0000000000..6221d5a819 --- /dev/null +++ b/include/vki/vki-scnums-shared-linux.h @@ -0,0 +1,42 @@ + +/* System call numbers for Linux that are shared across all architectures. */ + +/* + This file is part of Valgrind, a dynamic binary instrumentation + framework. + + Copyright (C) 2019 Bart Van Assche + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + The GNU General Public License is contained in the file COPYING. +*/ + +#ifndef __VKI_SCNUMS_SHARED_LINUX_H +#define __VKI_SCNUMS_SHARED_LINUX_H + +// Derived from linux-5.2/include/uapi/asm-generic/unistd.h + +#define __NR_pidfd_send_signal 424 +#define __NR_io_uring_setup 425 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_open_tree 428 +#define __NR_move_mount 429 +#define __NR_fsopen 430 +#define __NR_fsconfig 431 +#define __NR_fsmount 432 +#define __NR_fspick 433 + +#endif diff --git a/include/vki/vki-scnums-x86-linux.h b/include/vki/vki-scnums-x86-linux.h index 37683aa35b..5019321d39 100644 --- a/include/vki/vki-scnums-x86-linux.h +++ b/include/vki/vki-scnums-x86-linux.h @@ -30,7 +30,7 @@ #ifndef __VKI_SCNUMS_X86_LINUX_H #define __VKI_SCNUMS_X86_LINUX_H -// Derived from linux-2.6/arch/x86/entry/syscalls/syscall_32.tbl +// Derived from linux-5.2/arch/x86/entry/syscalls/syscall_32.tbl #define __NR_restart_syscall 0 #define __NR_exit 1 @@ -417,6 +417,18 @@ #define __NR_pkey_free 382 #define __NR_statx 383 #define __NR_arch_prctl 384 +#define __NR_io_pgetevents 385 +#define __NR_rseq 386 +#define __NR_semget 393 +#define __NR_semctl 394 +#define __NR_shmget 395 +#define __NR_shmctl 396 +#define __NR_shmat 397 +#define __NR_shmdt 398 +#define __NR_msgget 399 +#define __NR_msgsnd 400 +#define __NR_msgrcv 401 +#define __NR_msgctl 402 #endif /* __VKI_SCNUMS_X86_LINUX_H */