From 86ab9452bd10f08dbfa22d94e1155838f6f9f2e0 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 31 Oct 2021 23:11:11 +0100 Subject: [PATCH] mips: Fix new syscall numbers The MIPS32 and MIPS64 O32 ABI are adding 4000 to all syscall numbers. The MIPS64 N64 ABI adds 5000 to each syscall and the MIPS64 N32 ABI adds 6000 to each syscall number. We can not sue the shared file for MIPS and have to define this for each sycall separately. Without this change valgrind is not able to detect new syscalls like clock_gettime64 correctly. Signed-off-by: Hauke Mehrtens --- include/pub_tool_vkiscnums_asm.h | 3 --- include/vki/vki-scnums-mips32-linux.h | 36 +++++++++++++++++++++++++++ include/vki/vki-scnums-mips64-linux.h | 32 ++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 3 deletions(-) --- a/include/pub_tool_vkiscnums_asm.h +++ b/include/pub_tool_vkiscnums_asm.h @@ -63,15 +63,12 @@ # 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_nanomips_linux) # include "vki/vki-scnums-nanomips-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_freebsd) || defined(VGP_amd64_freebsd) --- a/include/vki/vki-scnums-mips32-linux.h +++ b/include/vki/vki-scnums-mips32-linux.h @@ -401,6 +401,42 @@ #define __NR_pkey_free (__NR_Linux + 365) #define __NR_statx (__NR_Linux + 366) +#define __NR_clock_gettime64 (__NR_Linux + 403) +#define __NR_clock_settime64 (__NR_Linux + 404) +#define __NR_clock_adjtime64 (__NR_Linux + 405) +#define __NR_clock_getres_time64 (__NR_Linux + 406) +#define __NR_clock_nanosleep_time64 (__NR_Linux + 407) +#define __NR_timer_gettime64 (__NR_Linux + 408) +#define __NR_timer_settime64 (__NR_Linux + 409) +#define __NR_timerfd_gettime64 (__NR_Linux + 410) +#define __NR_timerfd_settime64 (__NR_Linux + 411) +#define __NR_utimensat_time64 (__NR_Linux + 412) +#define __NR_pselect6_time64 (__NR_Linux + 413) +#define __NR_ppoll_time64 (__NR_Linux + 414) +#define __NR_io_pgetevents_time64 (__NR_Linux + 416) +#define __NR_recvmmsg_time64 (__NR_Linux + 417) +#define __NR_mq_timedsend_time64 (__NR_Linux + 418) +#define __NR_mq_timedreceive_time64 (__NR_Linux + 419) +#define __NR_semtimedop_time64 (__NR_Linux + 420) +#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421) +#define __NR_futex_time64 (__NR_Linux + 422) +#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423) +#define __NR_pidfd_send_signal (__NR_Linux + 424) +#define __NR_io_uring_setup (__NR_Linux + 425) +#define __NR_io_uring_enter (__NR_Linux + 426) +#define __NR_io_uring_register (__NR_Linux + 427) +#define __NR_open_tree (__NR_Linux + 428) +#define __NR_move_mount (__NR_Linux + 429) +#define __NR_fsopen (__NR_Linux + 430) +#define __NR_fsconfig (__NR_Linux + 431) +#define __NR_fsmount (__NR_Linux + 432) +#define __NR_fspick (__NR_Linux + 433) + +#define __NR_clone3 (__NR_Linux + 435) +#define __NR_close_range (__NR_Linux + 436) + +#define __NR_faccessat2 (__NR_Linux + 439) + /* * Offset of the last Linux o32 flavoured syscall */ --- a/include/vki/vki-scnums-mips64-linux.h +++ b/include/vki/vki-scnums-mips64-linux.h @@ -363,6 +363,22 @@ #define __NR_pkey_free (__NR_Linux + 325) #define __NR_statx (__NR_Linux + 326) +#define __NR_pidfd_send_signal (__NR_Linux + 424) +#define __NR_io_uring_setup (__NR_Linux + 425) +#define __NR_io_uring_enter (__NR_Linux + 426) +#define __NR_io_uring_register (__NR_Linux + 427) +#define __NR_open_tree (__NR_Linux + 428) +#define __NR_move_mount (__NR_Linux + 429) +#define __NR_fsopen (__NR_Linux + 430) +#define __NR_fsconfig (__NR_Linux + 431) +#define __NR_fsmount (__NR_Linux + 432) +#define __NR_fspick (__NR_Linux + 433) + +#define __NR_clone3 (__NR_Linux + 435) +#define __NR_close_range (__NR_Linux + 436) + +#define __NR_faccessat2 (__NR_Linux + 439) + #elif defined(VGABI_N32) /* @@ -702,6 +718,22 @@ #define __NR_pkey_free (__NR_Linux + 329) #define __NR_statx (__NR_Linux + 330) +#define __NR_pidfd_send_signal (__NR_Linux + 424) +#define __NR_io_uring_setup (__NR_Linux + 425) +#define __NR_io_uring_enter (__NR_Linux + 426) +#define __NR_io_uring_register (__NR_Linux + 427) +#define __NR_open_tree (__NR_Linux + 428) +#define __NR_move_mount (__NR_Linux + 429) +#define __NR_fsopen (__NR_Linux + 430) +#define __NR_fsconfig (__NR_Linux + 431) +#define __NR_fsmount (__NR_Linux + 432) +#define __NR_fspick (__NR_Linux + 433) + +#define __NR_clone3 (__NR_Linux + 435) +#define __NR_close_range (__NR_Linux + 436) + +#define __NR_faccessat2 (__NR_Linux + 439) + #else #error unknown mips64 abi #endif > 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455