e84273c973225af11927ac5c409af0fa4df2b82e
[openwrt/staging/mans0n.git] / package / devel / valgrind / patches / 010-mips-Fix-new-syscall-numbers.patch
1 From 86ab9452bd10f08dbfa22d94e1155838f6f9f2e0 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sun, 31 Oct 2021 23:11:11 +0100
4 Subject: [PATCH] mips: Fix new syscall numbers
5
6 The MIPS32 and MIPS64 O32 ABI are adding 4000 to all syscall numbers.
7 The MIPS64 N64 ABI adds 5000 to each syscall and the MIPS64 N32 ABI adds
8 6000 to each syscall number. We can not sue the shared file for MIPS and
9 have to define this for each sycall separately.
10
11 Without this change valgrind is not able to detect new syscalls like
12 clock_gettime64 correctly.
13
14 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
15 ---
16 include/pub_tool_vkiscnums_asm.h | 3 ---
17 include/vki/vki-scnums-mips32-linux.h | 36 +++++++++++++++++++++++++++
18 include/vki/vki-scnums-mips64-linux.h | 32 ++++++++++++++++++++++++
19 3 files changed, 68 insertions(+), 3 deletions(-)
20
21 --- a/include/pub_tool_vkiscnums_asm.h
22 +++ b/include/pub_tool_vkiscnums_asm.h
23 @@ -63,15 +63,12 @@
24 # include "vki/vki-scnums-arm64-linux.h"
25
26 #elif defined(VGP_mips32_linux)
27 -# include "vki/vki-scnums-shared-linux.h"
28 -# include "vki/vki-scnums-32bit-linux.h"
29 # include "vki/vki-scnums-mips32-linux.h"
30
31 #elif defined(VGP_nanomips_linux)
32 # include "vki/vki-scnums-nanomips-linux.h"
33
34 #elif defined(VGP_mips64_linux)
35 -# include "vki/vki-scnums-shared-linux.h"
36 # include "vki/vki-scnums-mips64-linux.h"
37
38 #elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd)
39 --- a/include/vki/vki-scnums-mips32-linux.h
40 +++ b/include/vki/vki-scnums-mips32-linux.h
41 @@ -401,6 +401,42 @@
42 #define __NR_pkey_free (__NR_Linux + 365)
43 #define __NR_statx (__NR_Linux + 366)
44
45 +#define __NR_clock_gettime64 (__NR_Linux + 403)
46 +#define __NR_clock_settime64 (__NR_Linux + 404)
47 +#define __NR_clock_adjtime64 (__NR_Linux + 405)
48 +#define __NR_clock_getres_time64 (__NR_Linux + 406)
49 +#define __NR_clock_nanosleep_time64 (__NR_Linux + 407)
50 +#define __NR_timer_gettime64 (__NR_Linux + 408)
51 +#define __NR_timer_settime64 (__NR_Linux + 409)
52 +#define __NR_timerfd_gettime64 (__NR_Linux + 410)
53 +#define __NR_timerfd_settime64 (__NR_Linux + 411)
54 +#define __NR_utimensat_time64 (__NR_Linux + 412)
55 +#define __NR_pselect6_time64 (__NR_Linux + 413)
56 +#define __NR_ppoll_time64 (__NR_Linux + 414)
57 +#define __NR_io_pgetevents_time64 (__NR_Linux + 416)
58 +#define __NR_recvmmsg_time64 (__NR_Linux + 417)
59 +#define __NR_mq_timedsend_time64 (__NR_Linux + 418)
60 +#define __NR_mq_timedreceive_time64 (__NR_Linux + 419)
61 +#define __NR_semtimedop_time64 (__NR_Linux + 420)
62 +#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421)
63 +#define __NR_futex_time64 (__NR_Linux + 422)
64 +#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423)
65 +#define __NR_pidfd_send_signal (__NR_Linux + 424)
66 +#define __NR_io_uring_setup (__NR_Linux + 425)
67 +#define __NR_io_uring_enter (__NR_Linux + 426)
68 +#define __NR_io_uring_register (__NR_Linux + 427)
69 +#define __NR_open_tree (__NR_Linux + 428)
70 +#define __NR_move_mount (__NR_Linux + 429)
71 +#define __NR_fsopen (__NR_Linux + 430)
72 +#define __NR_fsconfig (__NR_Linux + 431)
73 +#define __NR_fsmount (__NR_Linux + 432)
74 +#define __NR_fspick (__NR_Linux + 433)
75 +
76 +#define __NR_clone3 (__NR_Linux + 435)
77 +#define __NR_close_range (__NR_Linux + 436)
78 +
79 +#define __NR_faccessat2 (__NR_Linux + 439)
80 +
81 /*
82 * Offset of the last Linux o32 flavoured syscall
83 */
84 --- a/include/vki/vki-scnums-mips64-linux.h
85 +++ b/include/vki/vki-scnums-mips64-linux.h
86 @@ -363,6 +363,22 @@
87 #define __NR_pkey_free (__NR_Linux + 325)
88 #define __NR_statx (__NR_Linux + 326)
89
90 +#define __NR_pidfd_send_signal (__NR_Linux + 424)
91 +#define __NR_io_uring_setup (__NR_Linux + 425)
92 +#define __NR_io_uring_enter (__NR_Linux + 426)
93 +#define __NR_io_uring_register (__NR_Linux + 427)
94 +#define __NR_open_tree (__NR_Linux + 428)
95 +#define __NR_move_mount (__NR_Linux + 429)
96 +#define __NR_fsopen (__NR_Linux + 430)
97 +#define __NR_fsconfig (__NR_Linux + 431)
98 +#define __NR_fsmount (__NR_Linux + 432)
99 +#define __NR_fspick (__NR_Linux + 433)
100 +
101 +#define __NR_clone3 (__NR_Linux + 435)
102 +#define __NR_close_range (__NR_Linux + 436)
103 +
104 +#define __NR_faccessat2 (__NR_Linux + 439)
105 +
106 #elif defined(VGABI_N32)
107
108 /*
109 @@ -702,6 +718,22 @@
110 #define __NR_pkey_free (__NR_Linux + 329)
111 #define __NR_statx (__NR_Linux + 330)
112
113 +#define __NR_pidfd_send_signal (__NR_Linux + 424)
114 +#define __NR_io_uring_setup (__NR_Linux + 425)
115 +#define __NR_io_uring_enter (__NR_Linux + 426)
116 +#define __NR_io_uring_register (__NR_Linux + 427)
117 +#define __NR_open_tree (__NR_Linux + 428)
118 +#define __NR_move_mount (__NR_Linux + 429)
119 +#define __NR_fsopen (__NR_Linux + 430)
120 +#define __NR_fsconfig (__NR_Linux + 431)
121 +#define __NR_fsmount (__NR_Linux + 432)
122 +#define __NR_fspick (__NR_Linux + 433)
123 +
124 +#define __NR_clone3 (__NR_Linux + 435)
125 +#define __NR_close_range (__NR_Linux + 436)
126 +
127 +#define __NR_faccessat2 (__NR_Linux + 439)
128 +
129 #else
130 #error unknown mips64 abi
131 #endif