blob: a519341887c40173b2dbeb7aa37731c91cb8ae6f [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From 54d6ad3348fb50f5b972fe9c05d0d8757bfe73ba Mon Sep 17 00:00:00 2001
2From: Aleksandar Rikalo <arikalo@gmail.com>
3Date: Fri, 10 May 2024 17:59:28 +0200
4Subject: mips: skip using shared syscall numbers for mips32
5
6mips does not use shared syscall numbers, so we can not use
7vki-scnums-shared-linux.h.
8
9This partially fixes KDE #444781.
10
11Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
12Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
13---
14 coregrind/m_syswrap/syswrap-mips32-linux.c | 1 +
15 include/pub_tool_vkiscnums_asm.h | 2 -
16 include/vki/vki-scnums-mips32-linux.h | 105 ++++++++++++++++-----
17 3 files changed, 83 insertions(+), 25 deletions(-)
18
19--- a/coregrind/m_syswrap/syswrap-mips32-linux.c
20+++ b/coregrind/m_syswrap/syswrap-mips32-linux.c
21@@ -1110,6 +1110,7 @@ static SyscallTableEntry syscall_main_ta
22 LINX_ (__NR_pwritev2, sys_pwritev2), // 362
23 //..
24 LINXY(__NR_statx, sys_statx), // 366
25+ GENX_(__NR_rseq, sys_ni_syscall), // 367
26
27 LINXY(__NR_clock_gettime64, sys_clock_gettime64), // 403
28 LINX_(__NR_clock_settime64, sys_clock_settime64), // 404
29--- a/include/pub_tool_vkiscnums_asm.h
30+++ b/include/pub_tool_vkiscnums_asm.h
31@@ -63,8 +63,6 @@
32 # include "vki/vki-scnums-arm64-linux.h"
33
34 #elif defined(VGP_mips32_linux)
35-# include "vki/vki-scnums-shared-linux.h"
36-# include "vki/vki-scnums-32bit-linux.h"
37 # include "vki/vki-scnums-mips32-linux.h"
38
39 #elif defined(VGP_nanomips_linux)
40--- a/include/vki/vki-scnums-mips32-linux.h
41+++ b/include/vki/vki-scnums-mips32-linux.h
42@@ -380,35 +380,94 @@
43 #define __NR_setns (__NR_Linux + 343)
44 #define __NR_process_vm_readv (__NR_Linux + 345)
45 #define __NR_process_vm_writev (__NR_Linux + 346)
46-#define __NR_kcmp (__NR_Linux + 347)
47-#define __NR_finit_module (__NR_Linux + 348)
48-#define __NR_sched_setattr (__NR_Linux + 349)
49-#define __NR_sched_getattr (__NR_Linux + 350)
50-#define __NR_renameat2 (__NR_Linux + 351)
51-#define __NR_seccomp (__NR_Linux + 352)
52-#define __NR_getrandom (__NR_Linux + 353)
53-#define __NR_memfd_create (__NR_Linux + 354)
54-#define __NR_bpf (__NR_Linux + 355)
55-#define __NR_execveat (__NR_Linux + 356)
56-#define __NR_userfaultfd (__NR_Linux + 357)
57-#define __NR_membarrier (__NR_Linux + 358)
58-#define __NR_mlock2 (__NR_Linux + 359)
59-#define __NR_copy_file_range (__NR_Linux + 360)
60-#define __NR_preadv2 (__NR_Linux + 361)
61-#define __NR_pwritev2 (__NR_Linux + 362)
62-#define __NR_pkey_mprotect (__NR_Linux + 363)
63-#define __NR_pkey_alloc (__NR_Linux + 364)
64-#define __NR_pkey_free (__NR_Linux + 365)
65-#define __NR_statx (__NR_Linux + 366)
66-
67+#define __NR_kcmp (__NR_Linux + 347)
68+#define __NR_finit_module (__NR_Linux + 348)
69+#define __NR_sched_setattr (__NR_Linux + 349)
70+#define __NR_sched_getattr (__NR_Linux + 350)
71+#define __NR_renameat2 (__NR_Linux + 351)
72+#define __NR_seccomp (__NR_Linux + 352)
73+#define __NR_getrandom (__NR_Linux + 353)
74+#define __NR_memfd_create (__NR_Linux + 354)
75+#define __NR_bpf (__NR_Linux + 355)
76+#define __NR_execveat (__NR_Linux + 356)
77+#define __NR_userfaultfd (__NR_Linux + 357)
78+#define __NR_membarrier (__NR_Linux + 358)
79+#define __NR_mlock2 (__NR_Linux + 359)
80+#define __NR_copy_file_range (__NR_Linux + 360)
81+#define __NR_preadv2 (__NR_Linux + 361)
82+#define __NR_pwritev2 (__NR_Linux + 362)
83+#define __NR_pkey_mprotect (__NR_Linux + 363)
84+#define __NR_pkey_alloc (__NR_Linux + 364)
85+#define __NR_pkey_free (__NR_Linux + 365)
86+#define __NR_statx (__NR_Linux + 366)
87+#define __NR_rseq (__NR_Linux + 367)
88+#define __NR_io_pgetevents (__NR_Linux + 368)
89+#define __NR_semget (__NR_Linux + 393)
90+#define __NR_semctl (__NR_Linux + 394)
91+#define __NR_shmget (__NR_Linux + 395)
92+#define __NR_shmctl (__NR_Linux + 396)
93+#define __NR_shmat (__NR_Linux + 397)
94+#define __NR_shmdt (__NR_Linux + 398)
95+#define __NR_msgget (__NR_Linux + 399)
96+#define __NR_msgsnd (__NR_Linux + 400)
97+#define __NR_msgrcv (__NR_Linux + 401)
98+#define __NR_msgctl (__NR_Linux + 402)
99+#define __NR_clock_gettime64 (__NR_Linux + 403)
100+#define __NR_clock_settime64 (__NR_Linux + 404)
101+#define __NR_clock_adjtime64 (__NR_Linux + 405)
102+#define __NR_clock_getres_time64 (__NR_Linux + 406)
103+#define __NR_clock_nanosleep_time64 (__NR_Linux + 407)
104+#define __NR_timer_gettime64 (__NR_Linux + 408)
105+#define __NR_timer_settime64 (__NR_Linux + 409)
106+#define __NR_timerfd_gettime64 (__NR_Linux + 410)
107+#define __NR_timerfd_settime64 (__NR_Linux + 411)
108+#define __NR_utimensat_time64 (__NR_Linux + 412)
109+#define __NR_pselect6_time64 (__NR_Linux + 413)
110+#define __NR_ppoll_time64 (__NR_Linux + 414)
111+#define __NR_io_pgetevents_time64 (__NR_Linux + 416)
112+#define __NR_recvmmsg_time64 (__NR_Linux + 417)
113+#define __NR_mq_timedsend_time64 (__NR_Linux + 418)
114+#define __NR_mq_timedreceive_time64 (__NR_Linux + 419)
115+#define __NR_semtimedop_time64 (__NR_Linux + 420)
116+#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421)
117+#define __NR_futex_time64 (__NR_Linux + 422)
118+#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423)
119+#define __NR_pidfd_send_signal (__NR_Linux + 424)
120+#define __NR_io_uring_setup (__NR_Linux + 425)
121+#define __NR_io_uring_enter (__NR_Linux + 426)
122+#define __NR_io_uring_register (__NR_Linux + 427)
123+#define __NR_open_tree (__NR_Linux + 428)
124+#define __NR_move_mount (__NR_Linux + 429)
125+#define __NR_fsopen (__NR_Linux + 430)
126+#define __NR_fsconfig (__NR_Linux + 431)
127+#define __NR_fsmount (__NR_Linux + 432)
128+#define __NR_fspick (__NR_Linux + 433)
129+#define __NR_pidfd_open (__NR_Linux + 434)
130+#define __NR_clone3 (__NR_Linux + 435)
131+#define __NR_close_range (__NR_Linux + 436)
132+#define __NR_openat2 (__NR_Linux + 437)
133+#define __NR_pidfd_getfd (__NR_Linux + 438)
134+#define __NR_faccessat2 (__NR_Linux + 439)
135+#define __NR_process_madvise (__NR_Linux + 440)
136+#define __NR_epoll_pwait2 (__NR_Linux + 441)
137+#define __NR_mount_setattr (__NR_Linux + 442)
138+#define __NR_quotactl_fd (__NR_Linux + 443)
139+#define __NR_landlock_create_ruleset (__NR_Linux + 444)
140+#define __NR_landlock_add_rule (__NR_Linux + 445)
141+#define __NR_landlock_restrict_self (__NR_Linux + 446)
142+#define __NR_process_mrelease (__NR_Linux + 448)
143+#define __NR_futex_waitv (__NR_Linux + 449)
144+#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
145+#define __NR_cachestat (__NR_Linux + 451)
146+#define __NR_fchmodat2 (__NR_Linux + 452)
147 /*
148 * Offset of the last Linux o32 flavoured syscall
149 */
150-#define __NR_Linux_syscalls 366
151+#define __NR_Linux_syscalls 366
152
153
154 #define __NR_O32_Linux 4000
155-#define __NR_O32_Linux_syscalls 366
156+#define __NR_O32_Linux_syscalls 366
157
158
159 #endif /* __VKI_SCNUMS_MIPS32_LINUX_H */