Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* Copyright (c) 2005-2011, Google Inc. | 1 /* Copyright (c) 2005-2011, Google Inc. |
| 2 * All rights reserved. | 2 * All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 * Do not access these symbols from outside this file. They are not part | 79 * Do not access these symbols from outside this file. They are not part |
| 80 * of the supported API. | 80 * of the supported API. |
| 81 */ | 81 */ |
| 82 #ifndef SYS_LINUX_SYSCALL_SUPPORT_H | 82 #ifndef SYS_LINUX_SYSCALL_SUPPORT_H |
| 83 #define SYS_LINUX_SYSCALL_SUPPORT_H | 83 #define SYS_LINUX_SYSCALL_SUPPORT_H |
| 84 | 84 |
| 85 /* We currently only support x86-32, x86-64, ARM, MIPS, and PPC on Linux. | 85 /* We currently only support x86-32, x86-64, ARM, MIPS, and PPC on Linux. |
| 86 * Porting to other related platforms should not be difficult. | 86 * Porting to other related platforms should not be difficult. |
| 87 */ | 87 */ |
| 88 #if (defined(__i386__) || defined(__x86_64__) || defined(__ARM_ARCH_3__) || \ | 88 #if (defined(__i386__) || defined(__x86_64__) || defined(__ARM_ARCH_3__) || \ |
| 89 defined(__mips__) || defined(__PPC__) || defined(__ARM_EABI__)) \ | 89 defined(__mips__) || defined(__PPC__) || defined(__ARM_EABI__) || \ |
| 90 defined(__aarch64__)) \ | |
| 90 && (defined(__linux) || defined(__ANDROID__)) | 91 && (defined(__linux) || defined(__ANDROID__)) |
| 91 | 92 |
| 92 #ifndef SYS_CPLUSPLUS | 93 #ifndef SYS_CPLUSPLUS |
| 93 #ifdef __cplusplus | 94 #ifdef __cplusplus |
| 94 /* Some system header files in older versions of gcc neglect to properly | 95 /* Some system header files in older versions of gcc neglect to properly |
| 95 * handle being included from C++. As it appears to be harmless to have | 96 * handle being included from C++. As it appears to be harmless to have |
| 96 * multiple nested 'extern "C"' blocks, just add another one here. | 97 * multiple nested 'extern "C"' blocks, just add another one here. |
| 97 */ | 98 */ |
| 98 extern "C" { | 99 extern "C" { |
| 99 #endif | 100 #endif |
| 100 | 101 |
| 101 #include <errno.h> | 102 #include <errno.h> |
| 102 #include <fcntl.h> | 103 #include <fcntl.h> |
| 104 #include <sched.h> | |
| 103 #include <signal.h> | 105 #include <signal.h> |
| 104 #include <stdarg.h> | 106 #include <stdarg.h> |
| 105 #include <stddef.h> | 107 #include <stddef.h> |
| 106 #include <stdint.h> | 108 #include <stdint.h> |
| 107 #include <string.h> | 109 #include <string.h> |
| 108 #include <sys/ptrace.h> | 110 #include <sys/ptrace.h> |
| 109 #include <sys/resource.h> | 111 #include <sys/resource.h> |
| 110 #include <sys/time.h> | 112 #include <sys/time.h> |
| 111 #include <sys/types.h> | 113 #include <sys/types.h> |
| 112 #include <sys/syscall.h> | 114 #include <sys/syscall.h> |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 249 union { | 251 union { |
| 250 void (*sa_handler_)(int); | 252 void (*sa_handler_)(int); |
| 251 void (*sa_sigaction_)(int, siginfo_t *, void *); | 253 void (*sa_sigaction_)(int, siginfo_t *, void *); |
| 252 }; | 254 }; |
| 253 unsigned long sa_mask; | 255 unsigned long sa_mask; |
| 254 unsigned long sa_flags; | 256 unsigned long sa_flags; |
| 255 void (*sa_restorer)(void); | 257 void (*sa_restorer)(void); |
| 256 } __attribute__((packed,aligned(4))); | 258 } __attribute__((packed,aligned(4))); |
| 257 #elif (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) | 259 #elif (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) |
| 258 #define kernel_old_sigaction kernel_sigaction | 260 #define kernel_old_sigaction kernel_sigaction |
| 261 #elif defined(__aarch64__) | |
| 262 // No kernel_old_sigaction defined for arm64. | |
| 259 #endif | 263 #endif |
| 260 | 264 |
| 261 /* Some kernel functions (e.g. sigaction() in 2.6.23) require that the | 265 /* Some kernel functions (e.g. sigaction() in 2.6.23) require that the |
| 262 * exactly match the size of the signal set, even though the API was | 266 * exactly match the size of the signal set, even though the API was |
| 263 * intended to be extensible. We define our own KERNEL_NSIG to deal with | 267 * intended to be extensible. We define our own KERNEL_NSIG to deal with |
| 264 * this. | 268 * this. |
| 265 * Please note that glibc provides signals [1.._NSIG-1], whereas the | 269 * Please note that glibc provides signals [1.._NSIG-1], whereas the |
| 266 * kernel (and this header) provides the range [1..KERNEL_NSIG]. The | 270 * kernel (and this header) provides the range [1..KERNEL_NSIG]. The |
| 267 * actual number of signals is obviously the same, but the constants | 271 * actual number of signals is obviously the same, but the constants |
| 268 * differ by one. | 272 * differ by one. |
| 269 */ | 273 */ |
| 270 #ifdef __mips__ | 274 #ifdef __mips__ |
| 271 #define KERNEL_NSIG 128 | 275 #define KERNEL_NSIG 128 |
| 272 #else | 276 #else |
| 273 #define KERNEL_NSIG 64 | 277 #define KERNEL_NSIG 64 |
| 274 #endif | 278 #endif |
| 275 | 279 |
| 276 /* include/asm-{arm,i386,mips,x86_64}/signal.h */ | 280 /* include/asm-{arm,aarch64,i386,mips,x86_64}/signal.h */ |
| 277 struct kernel_sigset_t { | 281 struct kernel_sigset_t { |
| 278 unsigned long sig[(KERNEL_NSIG + 8*sizeof(unsigned long) - 1)/ | 282 unsigned long sig[(KERNEL_NSIG + 8*sizeof(unsigned long) - 1)/ |
| 279 (8*sizeof(unsigned long))]; | 283 (8*sizeof(unsigned long))]; |
| 280 }; | 284 }; |
| 281 | 285 |
| 282 /* include/asm-{arm,i386,mips,x86_64,ppc}/signal.h */ | 286 /* include/asm-{arm,i386,mips,x86_64,ppc}/signal.h */ |
| 283 struct kernel_sigaction { | 287 struct kernel_sigaction { |
| 284 #ifdef __mips__ | 288 #ifdef __mips__ |
| 285 unsigned long sa_flags; | 289 unsigned long sa_flags; |
| 286 union { | 290 union { |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 298 struct kernel_sigset_t sa_mask; | 302 struct kernel_sigset_t sa_mask; |
| 299 #endif | 303 #endif |
| 300 }; | 304 }; |
| 301 | 305 |
| 302 /* include/linux/socket.h */ | 306 /* include/linux/socket.h */ |
| 303 struct kernel_sockaddr { | 307 struct kernel_sockaddr { |
| 304 unsigned short sa_family; | 308 unsigned short sa_family; |
| 305 char sa_data[14]; | 309 char sa_data[14]; |
| 306 }; | 310 }; |
| 307 | 311 |
| 308 /* include/asm-{arm,i386,mips,ppc}/stat.h */ | 312 /* include/asm-{arm,aarch64,i386,mips,ppc}/stat.h */ |
| 309 #ifdef __mips__ | 313 #ifdef __mips__ |
| 310 #if _MIPS_SIM == _MIPS_SIM_ABI64 | 314 #if _MIPS_SIM == _MIPS_SIM_ABI64 |
| 311 struct kernel_stat { | 315 struct kernel_stat { |
| 312 #else | 316 #else |
| 313 struct kernel_stat64 { | 317 struct kernel_stat64 { |
| 314 #endif | 318 #endif |
| 315 unsigned st_dev; | 319 unsigned st_dev; |
| 316 unsigned __pad0[3]; | 320 unsigned __pad0[3]; |
| 317 unsigned long long st_ino; | 321 unsigned long long st_ino; |
| 318 unsigned st_mode; | 322 unsigned st_mode; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 371 unsigned st_atime_; | 375 unsigned st_atime_; |
| 372 unsigned st_atime_nsec_; | 376 unsigned st_atime_nsec_; |
| 373 unsigned st_mtime_; | 377 unsigned st_mtime_; |
| 374 unsigned st_mtime_nsec_; | 378 unsigned st_mtime_nsec_; |
| 375 unsigned st_ctime_; | 379 unsigned st_ctime_; |
| 376 unsigned st_ctime_nsec_; | 380 unsigned st_ctime_nsec_; |
| 377 unsigned long long st_ino; | 381 unsigned long long st_ino; |
| 378 }; | 382 }; |
| 379 #endif | 383 #endif |
| 380 | 384 |
| 381 /* include/asm-{arm,i386,mips,x86_64,ppc}/stat.h */ | 385 /* include/asm-{arm,aarch64,i386,mips,x86_64,ppc}/stat.h */ |
| 382 #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) | 386 #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) |
| 383 struct kernel_stat { | 387 struct kernel_stat { |
| 384 /* The kernel headers suggest that st_dev and st_rdev should be 32bit | 388 /* The kernel headers suggest that st_dev and st_rdev should be 32bit |
| 385 * quantities encoding 12bit major and 20bit minor numbers in an interleaved | 389 * quantities encoding 12bit major and 20bit minor numbers in an interleaved |
| 386 * format. In reality, we do not see useful data in the top bits. So, | 390 * format. In reality, we do not see useful data in the top bits. So, |
| 387 * we'll leave the padding in here, until we find a better solution. | 391 * we'll leave the padding in here, until we find a better solution. |
| 388 */ | 392 */ |
| 389 unsigned short st_dev; | 393 unsigned short st_dev; |
| 390 short pad1; | 394 short pad1; |
| 391 unsigned st_ino; | 395 unsigned st_ino; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 465 long st_atime_; | 469 long st_atime_; |
| 466 long st_atime_nsec_; | 470 long st_atime_nsec_; |
| 467 long st_mtime_; | 471 long st_mtime_; |
| 468 long st_mtime_nsec_; | 472 long st_mtime_nsec_; |
| 469 long st_ctime_; | 473 long st_ctime_; |
| 470 long st_ctime_nsec_; | 474 long st_ctime_nsec_; |
| 471 int st_blksize; | 475 int st_blksize; |
| 472 int st_blocks; | 476 int st_blocks; |
| 473 int st_pad4[14]; | 477 int st_pad4[14]; |
| 474 }; | 478 }; |
| 479 #elif defined(__aarch64__) | |
| 480 struct kernel_stat { | |
| 481 unsigned long st_dev; // Device. | |
|
Mark Seaborn
2014/04/03 21:44:22
Can you make the alignment indentation consistent
rmcilroy
2014/04/04 13:57:04
Done.
| |
| 482 unsigned long st_ino; // File serial number. | |
|
Mark Seaborn
2014/04/03 21:44:22
I'd leave out the comments for consistency with th
rmcilroy
2014/04/04 13:57:04
Done.
| |
| 483 unsigned int st_mode; // File mode. | |
| 484 unsigned int st_nlink; // Link count. | |
| 485 unsigned int st_uid; // User ID of the file's owner. | |
| 486 unsigned int st_gid; // Group ID of the file's group. | |
| 487 unsigned long st_rdev; // Device number, if device. | |
| 488 unsigned long __pad1; | |
| 489 long st_size; // Size of file, in bytes. | |
| 490 int st_blksize; // Optimal block size for I/O. | |
| 491 int __pad2; | |
| 492 long st_blocks; // Number 512-byte blocks allocated. | |
| 493 long st_atime; // Time of last access. | |
| 494 unsigned long st_atime_nsec; | |
| 495 long st_mtime; // Time of last modification. | |
| 496 unsigned long st_mtime_nsec; | |
| 497 long st_ctime; // Time of last status change. | |
| 498 unsigned long st_ctime_nsec; | |
| 499 unsigned int __unused4; | |
| 500 unsigned int __unused5; | |
| 501 }; | |
| 475 #endif | 502 #endif |
| 476 | 503 |
| 477 /* include/asm-{arm,i386,mips,x86_64,ppc}/statfs.h */ | 504 /* include/asm-{arm,aarch64,i386,mips,x86_64,ppc}/statfs.h */ |
| 478 #ifdef __mips__ | 505 #ifdef __mips__ |
| 479 #if _MIPS_SIM != _MIPS_SIM_ABI64 | 506 #if _MIPS_SIM != _MIPS_SIM_ABI64 |
| 480 struct kernel_statfs64 { | 507 struct kernel_statfs64 { |
| 481 unsigned long f_type; | 508 unsigned long f_type; |
| 482 unsigned long f_bsize; | 509 unsigned long f_bsize; |
| 483 unsigned long f_frsize; | 510 unsigned long f_frsize; |
| 484 unsigned long __pad; | 511 unsigned long __pad; |
| 485 unsigned long long f_blocks; | 512 unsigned long long f_blocks; |
| 486 unsigned long long f_bfree; | 513 unsigned long long f_bfree; |
| 487 unsigned long long f_files; | 514 unsigned long long f_files; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 552 struct { int val[2]; } f_fsid; | 579 struct { int val[2]; } f_fsid; |
| 553 unsigned long f_namelen; | 580 unsigned long f_namelen; |
| 554 unsigned long f_frsize; | 581 unsigned long f_frsize; |
| 555 unsigned long f_spare[5]; | 582 unsigned long f_spare[5]; |
| 556 }; | 583 }; |
| 557 #endif | 584 #endif |
| 558 | 585 |
| 559 | 586 |
| 560 /* Definitions missing from the standard header files */ | 587 /* Definitions missing from the standard header files */ |
| 561 #ifndef O_DIRECTORY | 588 #ifndef O_DIRECTORY |
| 562 #if defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) | 589 #if defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || defined(__aarch64__) |
| 563 #define O_DIRECTORY 0040000 | 590 #define O_DIRECTORY 0040000 |
| 564 #else | 591 #else |
| 565 #define O_DIRECTORY 0200000 | 592 #define O_DIRECTORY 0200000 |
| 566 #endif | 593 #endif |
| 567 #endif | 594 #endif |
| 568 #ifndef NT_PRXFPREG | 595 #ifndef NT_PRXFPREG |
| 569 #define NT_PRXFPREG 0x46e62b7f | 596 #define NT_PRXFPREG 0x46e62b7f |
| 570 #endif | 597 #endif |
| 571 #ifndef PTRACE_GETFPXREGS | 598 #ifndef PTRACE_GETFPXREGS |
| 572 #define PTRACE_GETFPXREGS ((enum __ptrace_request)18) | 599 #define PTRACE_GETFPXREGS ((enum __ptrace_request)18) |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 906 #ifndef __NR_ioprio_get | 933 #ifndef __NR_ioprio_get |
| 907 #define __NR_ioprio_get (__NR_SYSCALL_BASE + 315) | 934 #define __NR_ioprio_get (__NR_SYSCALL_BASE + 315) |
| 908 #endif | 935 #endif |
| 909 #ifndef __NR_move_pages | 936 #ifndef __NR_move_pages |
| 910 #define __NR_move_pages (__NR_SYSCALL_BASE + 344) | 937 #define __NR_move_pages (__NR_SYSCALL_BASE + 344) |
| 911 #endif | 938 #endif |
| 912 #ifndef __NR_getcpu | 939 #ifndef __NR_getcpu |
| 913 #define __NR_getcpu (__NR_SYSCALL_BASE + 345) | 940 #define __NR_getcpu (__NR_SYSCALL_BASE + 345) |
| 914 #endif | 941 #endif |
| 915 /* End of ARM 3/EABI definitions */ | 942 /* End of ARM 3/EABI definitions */ |
| 943 #elif defined(__aarch64__) | |
| 944 #ifndef __NR_pread64 | |
| 945 #define __NR_pread64 67 | |
|
Mark Seaborn
2014/04/03 21:44:22
Could you sort these by number?
rmcilroy
2014/04/04 13:57:04
Done.
| |
| 946 #endif | |
| 947 #ifndef __NR_pwrite64 | |
| 948 #define __NR_pwrite64 68 | |
| 949 #endif | |
| 950 #ifndef __NR_setresuid | |
| 951 #define __NR_setresuid 147 | |
| 952 #define __NR_getresuid 148 | |
| 953 #define __NR_setresgid 149 | |
| 954 #define __NR_getresgid 150 | |
| 955 #endif | |
| 956 #ifndef __NR_quotactl | |
| 957 #define __NR_quotactl 60 | |
| 958 #endif | |
| 959 #ifndef __NR_gettid | |
| 960 #define __NR_gettid 178 | |
| 961 #endif | |
| 962 #ifndef __NR_readahead | |
| 963 #define __NR_readahead 213 | |
| 964 #endif | |
| 965 #ifndef __NR_setxattr | |
| 966 #define __NR_setxattr 5 | |
| 967 #endif | |
| 968 #ifndef __NR_lsetxattr | |
| 969 #define __NR_lsetxattr 6 | |
| 970 #endif | |
| 971 #ifndef __NR_getxattr | |
| 972 #define __NR_getxattr 8 | |
| 973 #endif | |
| 974 #ifndef __NR_lgetxattr | |
| 975 #define __NR_lgetxattr 9 | |
| 976 #endif | |
| 977 #ifndef __NR_listxattr | |
| 978 #define __NR_listxattr 11 | |
| 979 #endif | |
| 980 #ifndef __NR_llistxattr | |
| 981 #define __NR_llistxattr 12 | |
| 982 #endif | |
| 983 #ifndef __NR_tkill | |
| 984 #define __NR_tkill 130 | |
| 985 #endif | |
| 986 #ifndef __NR_futex | |
| 987 #define __NR_futex 98 | |
| 988 #endif | |
| 989 #ifndef __NR_sched_setaffinity | |
| 990 #define __NR_sched_setaffinity 122 | |
| 991 #define __NR_sched_getaffinity 123 | |
| 992 #endif | |
| 993 #ifndef __NR_getdents64 | |
| 994 #define __NR_getdents64 61 | |
| 995 #endif | |
| 996 #ifndef __NR_getdents | |
| 997 #define __NR_getdents __NR_getdents64 | |
| 998 #endif | |
| 999 #ifndef __NR_set_tid_address | |
| 1000 #define __NR_set_tid_address 96 | |
| 1001 #endif | |
| 1002 #ifndef __NR_fadvise64 | |
| 1003 #define __NR_fadvise64 223 | |
| 1004 #endif | |
| 1005 #ifndef __NR_clock_gettime | |
| 1006 #define __NR_clock_gettime 113 | |
| 1007 #endif | |
| 1008 #ifndef __NR_clock_getres | |
| 1009 #define __NR_clock_getres 114 | |
| 1010 #endif | |
| 1011 #ifndef __NR_ioprio_set | |
| 1012 #define __NR_ioprio_set 30 | |
| 1013 #endif | |
| 1014 #ifndef __NR_ioprio_get | |
| 1015 #define __NR_ioprio_get 31 | |
| 1016 #endif | |
| 1017 #ifndef __NR_openat | |
| 1018 #define __NR_openat 56 | |
| 1019 #endif | |
| 1020 #ifndef __NR_readlinkat | |
| 1021 #define __NR_readlinkat 78 | |
| 1022 #endif | |
| 1023 #ifndef __NR_newfstatat | |
| 1024 #define __NR_newfstatat 79 | |
| 1025 #endif | |
| 1026 #ifndef __NR_unlinkat | |
| 1027 #define __NR_unlinkat 35 | |
| 1028 #endif | |
| 1029 #ifndef __NR_move_pages | |
| 1030 #define __NR_move_pages 239 | |
| 1031 #endif | |
| 1032 #ifndef __NR_fallocate | |
| 1033 #define __NR_fallocate 47 | |
| 1034 #endif | |
| 1035 #ifndef __NR_ppoll | |
| 1036 #define __NR_ppoll 73 | |
| 1037 #endif | |
| 1038 /* End of aarch64 definitions */ | |
| 916 #elif defined(__x86_64__) | 1039 #elif defined(__x86_64__) |
| 917 #ifndef __NR_pread64 | 1040 #ifndef __NR_pread64 |
| 918 #define __NR_pread64 17 | 1041 #define __NR_pread64 17 |
| 919 #endif | 1042 #endif |
| 920 #ifndef __NR_pwrite64 | 1043 #ifndef __NR_pwrite64 |
| 921 #define __NR_pwrite64 18 | 1044 #define __NR_pwrite64 18 |
| 922 #endif | 1045 #endif |
| 923 #ifndef __NR_setresuid | 1046 #ifndef __NR_setresuid |
| 924 #define __NR_setresuid 117 | 1047 #define __NR_setresuid 117 |
| 925 #define __NR_getresuid 118 | 1048 #define __NR_getresuid 118 |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1425 #elif defined(SYS_PREFIX) && SYS_PREFIX == 7 | 1548 #elif defined(SYS_PREFIX) && SYS_PREFIX == 7 |
| 1426 #define LSS_NAME(name) sys7_##name | 1549 #define LSS_NAME(name) sys7_##name |
| 1427 #elif defined(SYS_PREFIX) && SYS_PREFIX == 8 | 1550 #elif defined(SYS_PREFIX) && SYS_PREFIX == 8 |
| 1428 #define LSS_NAME(name) sys8_##name | 1551 #define LSS_NAME(name) sys8_##name |
| 1429 #elif defined(SYS_PREFIX) && SYS_PREFIX == 9 | 1552 #elif defined(SYS_PREFIX) && SYS_PREFIX == 9 |
| 1430 #define LSS_NAME(name) sys9_##name | 1553 #define LSS_NAME(name) sys9_##name |
| 1431 #endif | 1554 #endif |
| 1432 | 1555 |
| 1433 #undef LSS_RETURN | 1556 #undef LSS_RETURN |
| 1434 #if (defined(__i386__) || defined(__x86_64__) || defined(__ARM_ARCH_3__) \ | 1557 #if (defined(__i386__) || defined(__x86_64__) || defined(__ARM_ARCH_3__) \ |
| 1435 || defined(__ARM_EABI__)) | 1558 || defined(__ARM_EABI__) || defined(__aarch64__)) |
| 1436 /* Failing system calls return a negative result in the range of | 1559 /* Failing system calls return a negative result in the range of |
| 1437 * -1..-4095. These are "errno" values with the sign inverted. | 1560 * -1..-4095. These are "errno" values with the sign inverted. |
| 1438 */ | 1561 */ |
| 1439 #define LSS_RETURN(type, res) \ | 1562 #define LSS_RETURN(type, res) \ |
| 1440 do { \ | 1563 do { \ |
| 1441 if ((unsigned long)(res) >= (unsigned long)(-4095)) { \ | 1564 if ((unsigned long)(res) >= (unsigned long)(-4095)) { \ |
| 1442 LSS_ERRNO = -(res); \ | 1565 LSS_ERRNO = -(res); \ |
| 1443 res = -1; \ | 1566 res = -1; \ |
| 1444 } \ | 1567 } \ |
| 1445 return (type) (res); \ | 1568 return (type) (res); \ |
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2234 long __res; | 2357 long __res; |
| 2235 { | 2358 { |
| 2236 register int __flags __asm__("r0") = flags; | 2359 register int __flags __asm__("r0") = flags; |
| 2237 register void *__stack __asm__("r1") = child_stack; | 2360 register void *__stack __asm__("r1") = child_stack; |
| 2238 register void *__ptid __asm__("r2") = parent_tidptr; | 2361 register void *__ptid __asm__("r2") = parent_tidptr; |
| 2239 register void *__tls __asm__("r3") = newtls; | 2362 register void *__tls __asm__("r3") = newtls; |
| 2240 register int *__ctid __asm__("r4") = child_tidptr; | 2363 register int *__ctid __asm__("r4") = child_tidptr; |
| 2241 __asm__ __volatile__(/* if (fn == NULL || child_stack == NULL) | 2364 __asm__ __volatile__(/* if (fn == NULL || child_stack == NULL) |
| 2242 * return -EINVAL; | 2365 * return -EINVAL; |
| 2243 */ | 2366 */ |
| 2244 #ifdef __thumb2__» » » | 2367 #ifdef __thumb2__ |
| 2245 "push {r7}\n" | 2368 "push {r7}\n" |
| 2246 #endif» » » | 2369 #endif |
| 2247 "cmp %2,#0\n" | 2370 "cmp %2,#0\n" |
| 2248 "it ne\n" | 2371 "it ne\n" |
| 2249 "cmpne %3,#0\n" | 2372 "cmpne %3,#0\n" |
| 2250 "it eq\n" | 2373 "it eq\n" |
| 2251 "moveq %0,%1\n" | 2374 "moveq %0,%1\n" |
| 2252 "beq 1f\n" | 2375 "beq 1f\n" |
| 2253 | 2376 |
| 2254 /* Push "arg" and "fn" onto the stack that will be | 2377 /* Push "arg" and "fn" onto the stack that will be |
| 2255 * used by the child. | 2378 * used by the child. |
| 2256 */ | 2379 */ |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2294 "ldr pc,[sp]\n" | 2417 "ldr pc,[sp]\n" |
| 2295 #endif | 2418 #endif |
| 2296 | 2419 |
| 2297 /* Call _exit(%r0). | 2420 /* Call _exit(%r0). |
| 2298 */ | 2421 */ |
| 2299 "mov r7, %10\n" | 2422 "mov r7, %10\n" |
| 2300 "swi 0x0\n" | 2423 "swi 0x0\n" |
| 2301 "1:\n" | 2424 "1:\n" |
| 2302 #ifdef __thumb2__ | 2425 #ifdef __thumb2__ |
| 2303 "pop {r7}" | 2426 "pop {r7}" |
| 2304 #endif» » » | 2427 #endif |
| 2305 : "=r" (__res) | 2428 : "=r" (__res) |
| 2306 : "i"(-EINVAL), | 2429 : "i"(-EINVAL), |
| 2307 "r"(fn), "r"(__stack), "r"(__flags), "r"(arg), | 2430 "r"(fn), "r"(__stack), "r"(__flags), "r"(arg), |
| 2308 "r"(__ptid), "r"(__tls), "r"(__ctid), | 2431 "r"(__ptid), "r"(__tls), "r"(__ctid), |
| 2309 "i"(__NR_clone), "i"(__NR_exit) | 2432 "i"(__NR_clone), "i"(__NR_exit) |
| 2310 #ifdef __thumb2__ | 2433 #ifdef __thumb2__ |
| 2311 : "cc", "lr", "memory"); | 2434 : "cc", "lr", "memory"); |
| 2312 #else | 2435 #else |
| 2313 : "cc", "r7", "lr", "memory"); | 2436 : "cc", "r7", "lr", "memory"); |
| 2314 #endif | 2437 #endif |
| 2315 } | 2438 } |
| 2316 LSS_RETURN(int, __res); | 2439 LSS_RETURN(int, __res); |
| 2317 } | 2440 } |
| 2441 #elif defined(__aarch64__) | |
| 2442 /* Most definitions of _syscallX() neglect to mark "memory" as being | |
|
Mark Seaborn
2014/04/03 21:44:22
I realise this is copied from elsewhere in the fil
rmcilroy
2014/04/04 13:57:04
I was assuming it meant the _syscallX() macros whi
| |
| 2443 * clobbered. This causes problems with compilers, that do a better job | |
| 2444 * at optimizing across __asm__ calls. | |
| 2445 * So, we just have to redefine all of the _syscallX() macros. | |
| 2446 */ | |
| 2447 #undef LSS_REG | |
| 2448 #define LSS_REG(r,a) register long __r##r __asm__("x"#r) = (long)a | |
| 2449 #undef LSS_BODY | |
| 2450 #define LSS_BODY(type,name,args...) \ | |
| 2451 register long __res_x0 __asm__("x0"); \ | |
| 2452 long __res; \ | |
| 2453 __asm__ __volatile__ ("mov x8, %1\n" \ | |
| 2454 "svc 0x0\n" \ | |
| 2455 : "=r"(__res_x0) \ | |
| 2456 : "i"(__NR_##name) , ## args \ | |
| 2457 : "x8", "x30", "memory"); \ | |
| 2458 __res = __res_x0; \ | |
| 2459 LSS_RETURN(type, __res) | |
| 2460 #undef _syscall0 | |
| 2461 #define _syscall0(type, name) \ | |
| 2462 type LSS_NAME(name)(void) { \ | |
| 2463 LSS_BODY(type, name); \ | |
| 2464 } | |
| 2465 #undef _syscall1 | |
| 2466 #define _syscall1(type, name, type1, arg1) \ | |
| 2467 type LSS_NAME(name)(type1 arg1) { \ | |
| 2468 LSS_REG(0, arg1); LSS_BODY(type, name, "r"(__r0)); \ | |
| 2469 } | |
| 2470 #undef _syscall2 | |
| 2471 #define _syscall2(type, name, type1, arg1, type2, arg2) \ | |
| 2472 type LSS_NAME(name)(type1 arg1, type2 arg2) { \ | |
| 2473 LSS_REG(0, arg1); LSS_REG(1, arg2); \ | |
| 2474 LSS_BODY(type, name, "r"(__r0), "r"(__r1)); \ | |
| 2475 } | |
| 2476 #undef _syscall3 | |
| 2477 #define _syscall3(type, name, type1, arg1, type2, arg2, type3, arg3) \ | |
| 2478 type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3) { \ | |
| 2479 LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \ | |
| 2480 LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2)); \ | |
| 2481 } | |
| 2482 #undef _syscall4 | |
| 2483 #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ | |
| 2484 type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ | |
| 2485 LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \ | |
| 2486 LSS_REG(3, arg4); \ | |
| 2487 LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3)); \ | |
| 2488 } | |
| 2489 #undef _syscall5 | |
| 2490 #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ | |
| 2491 type5,arg5) \ | |
| 2492 type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \ | |
| 2493 type5 arg5) { \ | |
| 2494 LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \ | |
| 2495 LSS_REG(3, arg4); LSS_REG(4, arg5); \ | |
| 2496 LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3), \ | |
| 2497 "r"(__r4)); \ | |
| 2498 } | |
| 2499 #undef _syscall6 | |
| 2500 #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ | |
| 2501 type5,arg5,type6,arg6) \ | |
| 2502 type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \ | |
| 2503 type5 arg5, type6 arg6) { \ | |
| 2504 LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \ | |
| 2505 LSS_REG(3, arg4); LSS_REG(4, arg5); LSS_REG(5, arg6); \ | |
| 2506 LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3), \ | |
| 2507 "r"(__r4), "r"(__r5)); \ | |
| 2508 } | |
| 2509 | |
| 2510 LSS_INLINE pid_t LSS_NAME(getpid)(); | |
|
Mark Seaborn
2014/04/03 21:44:22
Nit: should be "(void)" for when compiling this wi
rmcilroy
2014/04/04 13:57:04
Done.
| |
| 2511 LSS_INLINE pid_t LSS_NAME(fork)() { | |
|
Mark Seaborn
2014/04/03 21:44:22
Since this file is huge and unmanageable and diffi
rmcilroy
2014/04/04 13:57:04
Ok, sounds good. Done.
| |
| 2512 // No fork syscall on aarch64 - implement by means of the clone syscall. | |
| 2513 pid_t pid = LSS_NAME(getpid)(); | |
| 2514 | |
| 2515 int flags = CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD; | |
| 2516 void * child_stack = NULL; | |
|
Mark Seaborn
2014/04/03 21:44:22
Nit: remove space after "*"
rmcilroy
2014/04/04 13:57:04
Done.
| |
| 2517 void * parent_tidptr = NULL; | |
| 2518 void * newtls = NULL; | |
| 2519 void * child_tidptr = &pid; | |
| 2520 | |
| 2521 LSS_REG(0, flags); | |
| 2522 LSS_REG(1, child_stack); | |
| 2523 LSS_REG(2, parent_tidptr); | |
| 2524 LSS_REG(3, newtls); | |
| 2525 LSS_REG(4, child_tidptr); | |
| 2526 LSS_BODY(pid_t, clone, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3), | |
| 2527 "r"(__r4)); | |
| 2528 } | |
| 2529 LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack, | |
| 2530 int flags, void *arg, int *parent_tidptr, | |
| 2531 void *newtls, int *child_tidptr) { | |
| 2532 long __res; | |
| 2533 { | |
| 2534 register int __flags __asm__("x0") = flags; | |
| 2535 register void *__stack __asm__("x1") = child_stack; | |
| 2536 register void *__ptid __asm__("x2") = parent_tidptr; | |
| 2537 register void *__tls __asm__("x3") = newtls; | |
| 2538 register int *__ctid __asm__("x4") = child_tidptr; | |
| 2539 __asm__ __volatile__(/* if (fn == NULL || child_stack == NULL) | |
|
Mark Seaborn
2014/04/03 21:44:22
How about doing these checks in C?
rmcilroy
2014/04/04 13:57:04
Done.
| |
| 2540 * return -EINVAL; | |
| 2541 */ | |
| 2542 "cbz %2, 1f\n" | |
| 2543 "cbz %3, 1f\n" | |
| 2544 | |
| 2545 /* Push "arg" and "fn" onto the stack that will be | |
| 2546 * used by the child. | |
| 2547 */ | |
| 2548 "stp %2, %5, [%3, #-16]!\n" | |
| 2549 | |
| 2550 /* %x0 = syscall(%x0 = flags, | |
| 2551 * %x1 = child_stack, | |
| 2552 * %x2 = parent_tidptr, | |
| 2553 * %x3 = newtls, | |
| 2554 * %x4 = child_tidptr) | |
| 2555 */ | |
| 2556 "mov x8, %9\n" | |
| 2557 "svc 0x0\n" | |
| 2558 | |
| 2559 /* if (%r0 != 0) | |
| 2560 * return %r0; | |
| 2561 */ | |
| 2562 "adds %0, xzr, x0\n" | |
| 2563 "bne 2f\n" | |
| 2564 | |
| 2565 /* In the child, now. Call "fn(arg)". | |
| 2566 */ | |
| 2567 "ldp x1, x0, [sp], #16\n" | |
| 2568 "blr x1\n" | |
| 2569 | |
| 2570 /* Call _exit(%r0). | |
| 2571 */ | |
| 2572 "mov x8, %10\n" | |
| 2573 "svc 0x0\n" | |
| 2574 "1:\n" | |
| 2575 "mov %0, %1\n" | |
| 2576 "2:\n" | |
| 2577 : "=r" (__res) | |
| 2578 : "i"(-EINVAL), | |
| 2579 "r"(fn), "r"(__stack), "r"(__flags), "r"(arg), | |
| 2580 "r"(__ptid), "r"(__tls), "r"(__ctid), | |
| 2581 "i"(__NR_clone), "i"(__NR_exit) | |
| 2582 : "cc", "x8", "x30", "memory"); | |
| 2583 } | |
| 2584 LSS_RETURN(int, __res); | |
| 2585 } | |
| 2318 #elif defined(__mips__) | 2586 #elif defined(__mips__) |
| 2319 #undef LSS_REG | 2587 #undef LSS_REG |
| 2320 #define LSS_REG(r,a) register unsigned long __r##r __asm__("$"#r) = \ | 2588 #define LSS_REG(r,a) register unsigned long __r##r __asm__("$"#r) = \ |
| 2321 (unsigned long)(a) | 2589 (unsigned long)(a) |
| 2322 #undef LSS_BODY | 2590 #undef LSS_BODY |
| 2323 #define LSS_BODY(type,name,r7,...) \ | 2591 #define LSS_BODY(type,name,r7,...) \ |
| 2324 register unsigned long __v0 __asm__("$2") = __NR_##name; \ | 2592 register unsigned long __v0 __asm__("$2") = __NR_##name; \ |
| 2325 __asm__ __volatile__ ("syscall\n" \ | 2593 __asm__ __volatile__ ("syscall\n" \ |
| 2326 : "+r"(__v0), r7 (__r7) \ | 2594 : "+r"(__v0), r7 (__r7) \ |
| 2327 : "0"(__v0), ##__VA_ARGS__ \ | 2595 : "0"(__v0), ##__VA_ARGS__ \ |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2721 #define __NR__gettid __NR_gettid | 2989 #define __NR__gettid __NR_gettid |
| 2722 #define __NR__mremap __NR_mremap | 2990 #define __NR__mremap __NR_mremap |
| 2723 LSS_INLINE _syscall1(void *, brk, void *, e) | 2991 LSS_INLINE _syscall1(void *, brk, void *, e) |
| 2724 LSS_INLINE _syscall1(int, chdir, const char *,p) | 2992 LSS_INLINE _syscall1(int, chdir, const char *,p) |
| 2725 LSS_INLINE _syscall1(int, close, int, f) | 2993 LSS_INLINE _syscall1(int, close, int, f) |
| 2726 LSS_INLINE _syscall2(int, clock_getres, int, c, | 2994 LSS_INLINE _syscall2(int, clock_getres, int, c, |
| 2727 struct kernel_timespec*, t) | 2995 struct kernel_timespec*, t) |
| 2728 LSS_INLINE _syscall2(int, clock_gettime, int, c, | 2996 LSS_INLINE _syscall2(int, clock_gettime, int, c, |
| 2729 struct kernel_timespec*, t) | 2997 struct kernel_timespec*, t) |
| 2730 LSS_INLINE _syscall1(int, dup, int, f) | 2998 LSS_INLINE _syscall1(int, dup, int, f) |
| 2731 LSS_INLINE _syscall2(int, dup2, int, s, | 2999 #if !defined(__NR_dup2) && defined(__NR_dup3) |
| 2732 int, d) | 3000 LSS_INLINE _syscall3(int, dup3, int, s, |
| 3001 int, d, int, f) | |
| 3002 LSS_INLINE int LSS_NAME(dup2) (int s, int d) { | |
| 3003 return LSS_NAME(dup3)(s, d, 0); | |
| 3004 } | |
| 3005 #else | |
| 3006 LSS_INLINE _syscall2(int, dup2, int, s, | |
| 3007 int, d) | |
| 3008 #endif | |
| 2733 LSS_INLINE _syscall3(int, execve, const char*, f, | 3009 LSS_INLINE _syscall3(int, execve, const char*, f, |
| 2734 const char*const*,a,const char*const*, e) | 3010 const char*const*,a,const char*const*, e) |
| 2735 LSS_INLINE _syscall1(int, _exit, int, e) | 3011 LSS_INLINE _syscall1(int, _exit, int, e) |
| 2736 LSS_INLINE _syscall1(int, exit_group, int, e) | 3012 LSS_INLINE _syscall1(int, exit_group, int, e) |
| 2737 LSS_INLINE _syscall3(int, fcntl, int, f, | 3013 LSS_INLINE _syscall3(int, fcntl, int, f, |
| 2738 int, c, long, a) | 3014 int, c, long, a) |
| 2739 LSS_INLINE _syscall0(pid_t, fork) | 3015 #if defined(__NR_fork) |
| 3016 // The fork syscall has been deprecated on aarch64. We implement it | |
| 3017 // by means of the clone syscall (see above). | |
| 3018 LSS_INLINE _syscall0(pid_t, fork) | |
| 3019 #endif | |
| 2740 LSS_INLINE _syscall2(int, fstat, int, f, | 3020 LSS_INLINE _syscall2(int, fstat, int, f, |
| 2741 struct kernel_stat*, b) | 3021 struct kernel_stat*, b) |
| 2742 LSS_INLINE _syscall2(int, fstatfs, int, f, | 3022 LSS_INLINE _syscall2(int, fstatfs, int, f, |
| 2743 struct kernel_statfs*, b) | 3023 struct kernel_statfs*, b) |
| 2744 #if defined(__x86_64__) | 3024 #if defined(__x86_64__) |
| 2745 /* Need to make sure off_t isn't truncated to 32-bits under x32. */ | 3025 /* Need to make sure off_t isn't truncated to 32-bits under x32. */ |
| 2746 LSS_INLINE int LSS_NAME(ftruncate)(int f, off_t l) { | 3026 LSS_INLINE int LSS_NAME(ftruncate)(int f, off_t l) { |
| 2747 LSS_BODY(2, int, ftruncate, LSS_SYSCALL_ARG(f), (uint64_t)(l)); | 3027 LSS_BODY(2, int, ftruncate, LSS_SYSCALL_ARG(f), (uint64_t)(l)); |
| 2748 } | 3028 } |
| 2749 #else | 3029 #else |
| 2750 LSS_INLINE _syscall2(int, ftruncate, int, f, | 3030 LSS_INLINE _syscall2(int, ftruncate, int, f, |
| 2751 off_t, l) | 3031 off_t, l) |
| 2752 #endif | 3032 #endif |
| 2753 LSS_INLINE _syscall4(int, futex, int*, a, | 3033 LSS_INLINE _syscall4(int, futex, int*, a, |
| 2754 int, o, int, v, | 3034 int, o, int, v, |
| 2755 struct kernel_timespec*, t) | 3035 struct kernel_timespec*, t) |
| 2756 LSS_INLINE _syscall3(int, getdents, int, f, | 3036 LSS_INLINE _syscall3(int, getdents, int, f, |
| 2757 struct kernel_dirent*, d, int, c) | 3037 struct kernel_dirent*, d, int, c) |
| 2758 LSS_INLINE _syscall3(int, getdents64, int, f, | 3038 LSS_INLINE _syscall3(int, getdents64, int, f, |
| 2759 struct kernel_dirent64*, d, int, c) | 3039 struct kernel_dirent64*, d, int, c) |
| 2760 LSS_INLINE _syscall0(gid_t, getegid) | 3040 LSS_INLINE _syscall0(gid_t, getegid) |
| 2761 LSS_INLINE _syscall0(uid_t, geteuid) | 3041 LSS_INLINE _syscall0(uid_t, geteuid) |
| 2762 LSS_INLINE _syscall0(pid_t, getpgrp) | 3042 |
| 3043 #if defined(__NR_getpgrp) | |
| 3044 // The getpgrp syscall has been deprecated on aarch64. | |
| 3045 LSS_INLINE _syscall0(pid_t, getpgrp) | |
| 3046 #endif | |
| 2763 LSS_INLINE _syscall0(pid_t, getpid) | 3047 LSS_INLINE _syscall0(pid_t, getpid) |
| 2764 LSS_INLINE _syscall0(pid_t, getppid) | 3048 LSS_INLINE _syscall0(pid_t, getppid) |
| 2765 LSS_INLINE _syscall2(int, getpriority, int, a, | 3049 LSS_INLINE _syscall2(int, getpriority, int, a, |
| 2766 int, b) | 3050 int, b) |
| 2767 LSS_INLINE _syscall3(int, getresgid, gid_t *, r, | 3051 LSS_INLINE _syscall3(int, getresgid, gid_t *, r, |
| 2768 gid_t *, e, gid_t *, s) | 3052 gid_t *, e, gid_t *, s) |
| 2769 LSS_INLINE _syscall3(int, getresuid, uid_t *, r, | 3053 LSS_INLINE _syscall3(int, getresuid, uid_t *, r, |
| 2770 uid_t *, e, uid_t *, s) | 3054 uid_t *, e, uid_t *, s) |
| 2771 #if !defined(__ARM_EABI__) | 3055 #if !defined(__ARM_EABI__) |
| 2772 LSS_INLINE _syscall2(int, getrlimit, int, r, | 3056 LSS_INLINE _syscall2(int, getrlimit, int, r, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2811 LSS_INLINE _syscall2(int, munmap, void*, s, | 3095 LSS_INLINE _syscall2(int, munmap, void*, s, |
| 2812 size_t, l) | 3096 size_t, l) |
| 2813 LSS_INLINE _syscall6(long, move_pages, pid_t, p, | 3097 LSS_INLINE _syscall6(long, move_pages, pid_t, p, |
| 2814 unsigned long, n, void **,g, int *, d, | 3098 unsigned long, n, void **,g, int *, d, |
| 2815 int *, s, int, f) | 3099 int *, s, int, f) |
| 2816 LSS_INLINE _syscall3(int, mprotect, const void *,a, | 3100 LSS_INLINE _syscall3(int, mprotect, const void *,a, |
| 2817 size_t, l, int, p) | 3101 size_t, l, int, p) |
| 2818 LSS_INLINE _syscall5(void*, _mremap, void*, o, | 3102 LSS_INLINE _syscall5(void*, _mremap, void*, o, |
| 2819 size_t, os, size_t, ns, | 3103 size_t, os, size_t, ns, |
| 2820 unsigned long, f, void *, a) | 3104 unsigned long, f, void *, a) |
| 2821 LSS_INLINE _syscall3(int, open, const char*, p, | 3105 |
| 2822 int, f, int, m) | 3106 #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) |
| 2823 LSS_INLINE _syscall3(int, poll, struct kernel_pollfd*, u, | 3107 LSS_INLINE _syscall4(int, openat, int, d, const char *, p, int, f, int, m) |
| 2824 unsigned int, n, int, t) | 3108 LSS_INLINE _syscall4(int, readlinkat, int, d, const char *, p, char *, b, |
| 3109 size_t, s) | |
| 3110 LSS_INLINE _syscall3(int, unlinkat, int, d, const char *, p, int, f) | |
| 3111 #endif | |
| 3112 #if !defined(__NR_open) && defined(__NR_openat) | |
| 3113 LSS_INLINE int LSS_NAME(open)(const char* pathname, int flags, int mode) { | |
| 3114 return LSS_NAME(openat)(AT_FDCWD, pathname, flags, mode); | |
| 3115 } | |
| 3116 #else | |
| 3117 LSS_INLINE _syscall3(int, open, const char*, p, | |
| 3118 int, f, int, m) | |
| 3119 #endif | |
| 3120 #if !defined(__NR_unlink) && defined(__NR_unlinkat) | |
| 3121 LSS_INLINE int LSS_NAME(unlink)(const char* pathname) { | |
| 3122 return LSS_NAME(unlinkat)(AT_FDCWD, pathname, 0); | |
| 3123 } | |
| 3124 #else | |
| 3125 LSS_INLINE _syscall1(int, unlink, const char*, f) | |
| 3126 #endif | |
| 3127 #if !defined(__NR_readlink) && defined(__NR_readlinkat) | |
| 3128 LSS_INLINE int LSS_NAME(readlink)(const char* pathname, char* buffer, | |
| 3129 size_t size) { | |
| 3130 return LSS_NAME(readlinkat)(AT_FDCWD, pathname, buffer, size); | |
| 3131 } | |
| 3132 #else | |
| 3133 LSS_INLINE _syscall3(int, readlink, const char*, p, | |
| 3134 char*, b, size_t, s) | |
| 3135 #endif | |
| 3136 #if !defined(__NR_poll) && defined(__NR_ppoll) | |
| 3137 LSS_INLINE _syscall5(int, ppoll, struct kernel_pollfd*, u, | |
| 3138 unsigned int, n, const struct kernel_timespec*, t, | |
| 3139 const kernel_sigset_t*, sigmask, size_t, s) | |
| 3140 LSS_INLINE int LSS_NAME(poll) (struct kernel_pollfd* fds, unsigned int nfds, | |
| 3141 int timeout) { | |
| 3142 struct kernel_timespec timeout_ts; | |
| 3143 struct kernel_timespec* timeout_ts_p = NULL; | |
| 3144 | |
| 3145 if (timeout >= 0) { | |
| 3146 timeout_ts.tv_sec = timeout / 1000; | |
| 3147 timeout_ts.tv_nsec = (timeout % 1000) * 1000000; | |
| 3148 timeout_ts_p = &timeout_ts; | |
| 3149 } | |
| 3150 return LSS_NAME(ppoll) (fds, nfds, timeout_ts_p, NULL, 0); | |
| 3151 } | |
| 3152 #else | |
| 3153 LSS_INLINE _syscall3(int, poll, struct kernel_pollfd*, u, | |
| 3154 unsigned int, n, int, t) | |
| 3155 #endif | |
| 2825 LSS_INLINE _syscall5(int, prctl, int, option, | 3156 LSS_INLINE _syscall5(int, prctl, int, option, |
| 2826 unsigned long, arg2, | 3157 unsigned long, arg2, |
| 2827 unsigned long, arg3, | 3158 unsigned long, arg3, |
| 2828 unsigned long, arg4, | 3159 unsigned long, arg4, |
| 2829 unsigned long, arg5) | 3160 unsigned long, arg5) |
| 2830 LSS_INLINE _syscall4(long, ptrace, int, r, | 3161 LSS_INLINE _syscall4(long, ptrace, int, r, |
| 2831 pid_t, p, void *, a, void *, d) | 3162 pid_t, p, void *, a, void *, d) |
| 2832 #if defined(__NR_quotactl) | 3163 #if defined(__NR_quotactl) |
| 2833 // Defined on x86_64 / i386 only | 3164 // Defined on x86_64 / i386 only |
| 2834 LSS_INLINE _syscall4(int, quotactl, int, cmd, const char *, special, | 3165 LSS_INLINE _syscall4(int, quotactl, int, cmd, const char *, special, |
| 2835 int, id, caddr_t, addr) | 3166 int, id, caddr_t, addr) |
| 2836 #endif | 3167 #endif |
| 2837 LSS_INLINE _syscall3(ssize_t, read, int, f, | 3168 LSS_INLINE _syscall3(ssize_t, read, int, f, |
| 2838 void *, b, size_t, c) | 3169 void *, b, size_t, c) |
| 2839 LSS_INLINE _syscall3(int, readlink, const char*, p, | |
| 2840 char*, b, size_t, s) | |
| 2841 LSS_INLINE _syscall4(int, rt_sigaction, int, s, | 3170 LSS_INLINE _syscall4(int, rt_sigaction, int, s, |
| 2842 const struct kernel_sigaction*, a, | 3171 const struct kernel_sigaction*, a, |
| 2843 struct kernel_sigaction*, o, size_t, c) | 3172 struct kernel_sigaction*, o, size_t, c) |
| 2844 LSS_INLINE _syscall2(int, rt_sigpending, struct kernel_sigset_t *, s, | 3173 LSS_INLINE _syscall2(int, rt_sigpending, struct kernel_sigset_t *, s, |
| 2845 size_t, c) | 3174 size_t, c) |
| 2846 LSS_INLINE _syscall4(int, rt_sigprocmask, int, h, | 3175 LSS_INLINE _syscall4(int, rt_sigprocmask, int, h, |
| 2847 const struct kernel_sigset_t*, s, | 3176 const struct kernel_sigset_t*, s, |
| 2848 struct kernel_sigset_t*, o, size_t, c) | 3177 struct kernel_sigset_t*, o, size_t, c) |
| 2849 LSS_INLINE _syscall2(int, rt_sigsuspend, | 3178 LSS_INLINE _syscall2(int, rt_sigsuspend, |
| 2850 const struct kernel_sigset_t*, s, size_t, c) | 3179 const struct kernel_sigset_t*, s, size_t, c) |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 2865 LSS_INLINE _syscall3(int, setresgid, gid_t, r, | 3194 LSS_INLINE _syscall3(int, setresgid, gid_t, r, |
| 2866 gid_t, e, gid_t, s) | 3195 gid_t, e, gid_t, s) |
| 2867 LSS_INLINE _syscall3(int, setresuid, uid_t, r, | 3196 LSS_INLINE _syscall3(int, setresuid, uid_t, r, |
| 2868 uid_t, e, uid_t, s) | 3197 uid_t, e, uid_t, s) |
| 2869 LSS_INLINE _syscall2(int, setrlimit, int, r, | 3198 LSS_INLINE _syscall2(int, setrlimit, int, r, |
| 2870 const struct kernel_rlimit*, l) | 3199 const struct kernel_rlimit*, l) |
| 2871 LSS_INLINE _syscall0(pid_t, setsid) | 3200 LSS_INLINE _syscall0(pid_t, setsid) |
| 2872 LSS_INLINE _syscall2(int, sigaltstack, const stack_t*, s, | 3201 LSS_INLINE _syscall2(int, sigaltstack, const stack_t*, s, |
| 2873 const stack_t*, o) | 3202 const stack_t*, o) |
| 2874 #if defined(__NR_sigreturn) | 3203 #if defined(__NR_sigreturn) |
| 2875 LSS_INLINE _syscall1(int, sigreturn, unsigned long, u) | 3204 LSS_INLINE _syscall1(int, sigreturn, unsigned long, u) |
| 2876 #endif | 3205 #endif |
| 2877 LSS_INLINE _syscall2(int, stat, const char*, f, | 3206 #if defined(__aarch64__) |
| 2878 struct kernel_stat*, b) | 3207 // The stat syscall has been deprecated on aarch64. We implement it using |
| 3208 // the newfstatat syscall. | |
| 3209 LSS_INLINE _syscall4(int, newfstatat, int, dirfd, const char*, pathname, | |
| 3210 struct kernel_stat*, buf, int, flags) | |
| 3211 | |
| 3212 LSS_INLINE int LSS_NAME(stat) (const char *pathname, | |
| 3213 struct kernel_stat *buf) { | |
| 3214 return LSS_NAME(newfstatat) (AT_FDCWD, pathname, buf, 0); | |
| 3215 } | |
| 3216 #else | |
| 3217 LSS_INLINE _syscall2(int, stat, const char*, f, | |
| 3218 struct kernel_stat*, b) | |
| 3219 #endif | |
| 2879 LSS_INLINE _syscall2(int, statfs, const char*, f, | 3220 LSS_INLINE _syscall2(int, statfs, const char*, f, |
| 2880 struct kernel_statfs*, b) | 3221 struct kernel_statfs*, b) |
| 2881 LSS_INLINE _syscall3(int, tgkill, pid_t, p, | 3222 LSS_INLINE _syscall3(int, tgkill, pid_t, p, |
| 2882 pid_t, t, int, s) | 3223 pid_t, t, int, s) |
| 2883 LSS_INLINE _syscall2(int, tkill, pid_t, p, | 3224 LSS_INLINE _syscall2(int, tkill, pid_t, p, |
| 2884 int, s) | 3225 int, s) |
| 2885 LSS_INLINE _syscall1(int, unlink, const char*, f) | |
| 2886 LSS_INLINE _syscall3(ssize_t, write, int, f, | 3226 LSS_INLINE _syscall3(ssize_t, write, int, f, |
| 2887 const void *, b, size_t, c) | 3227 const void *, b, size_t, c) |
| 2888 LSS_INLINE _syscall3(ssize_t, writev, int, f, | 3228 LSS_INLINE _syscall3(ssize_t, writev, int, f, |
| 2889 const struct kernel_iovec*, v, size_t, c) | 3229 const struct kernel_iovec*, v, size_t, c) |
| 2890 #if defined(__NR_getcpu) | 3230 #if defined(__NR_getcpu) |
| 2891 LSS_INLINE _syscall3(long, getcpu, unsigned *, cpu, | 3231 LSS_INLINE _syscall3(long, getcpu, unsigned *, cpu, |
| 2892 unsigned *, node, void *, unused) | 3232 unsigned *, node, void *, unused) |
| 2893 #endif | 3233 #endif |
| 2894 #if defined(__x86_64__) || \ | |
|
Mark Seaborn
2014/04/03 21:44:22
Could you possibly commit small cleanup refactorin
rmcilroy
2014/04/04 13:57:04
Done.
| |
| 2895 (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI32) | |
| 2896 LSS_INLINE _syscall3(int, recvmsg, int, s, | |
| 2897 struct kernel_msghdr*, m, int, f) | |
| 2898 LSS_INLINE _syscall3(int, sendmsg, int, s, | |
| 2899 const struct kernel_msghdr*, m, int, f) | |
| 2900 LSS_INLINE _syscall6(int, sendto, int, s, | |
| 2901 const void*, m, size_t, l, | |
| 2902 int, f, | |
| 2903 const struct kernel_sockaddr*, a, int, t) | |
| 2904 LSS_INLINE _syscall2(int, shutdown, int, s, | |
| 2905 int, h) | |
| 2906 LSS_INLINE _syscall3(int, socket, int, d, | |
| 2907 int, t, int, p) | |
| 2908 LSS_INLINE _syscall4(int, socketpair, int, d, | |
| 2909 int, t, int, p, int*, s) | |
| 2910 #endif | |
| 2911 #if defined(__x86_64__) | 3234 #if defined(__x86_64__) |
| 2912 /* Need to make sure loff_t isn't truncated to 32-bits under x32. */ | 3235 /* Need to make sure loff_t isn't truncated to 32-bits under x32. */ |
| 2913 LSS_INLINE int LSS_NAME(fallocate)(int f, int mode, loff_t offset, | 3236 LSS_INLINE int LSS_NAME(fallocate)(int f, int mode, loff_t offset, |
| 2914 loff_t len) { | 3237 loff_t len) { |
| 2915 LSS_BODY(4, int, fallocate, LSS_SYSCALL_ARG(f), LSS_SYSCALL_ARG(mode), | 3238 LSS_BODY(4, int, fallocate, LSS_SYSCALL_ARG(f), LSS_SYSCALL_ARG(mode), |
| 2916 (uint64_t)(offset), (uint64_t)(len)); | 3239 (uint64_t)(offset), (uint64_t)(len)); |
| 2917 } | 3240 } |
| 2918 | 3241 |
| 2919 LSS_INLINE int LSS_NAME(getresgid32)(gid_t *rgid, | 3242 LSS_INLINE int LSS_NAME(getresgid32)(gid_t *rgid, |
| 2920 gid_t *egid, | 3243 gid_t *egid, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2984 const struct kernel_sigset_t *set, | 3307 const struct kernel_sigset_t *set, |
| 2985 struct kernel_sigset_t *oldset) { | 3308 struct kernel_sigset_t *oldset) { |
| 2986 return LSS_NAME(rt_sigprocmask)(how, set, oldset, (KERNEL_NSIG+7)/8); | 3309 return LSS_NAME(rt_sigprocmask)(how, set, oldset, (KERNEL_NSIG+7)/8); |
| 2987 } | 3310 } |
| 2988 | 3311 |
| 2989 LSS_INLINE int LSS_NAME(sigsuspend)(const struct kernel_sigset_t *set) { | 3312 LSS_INLINE int LSS_NAME(sigsuspend)(const struct kernel_sigset_t *set) { |
| 2990 return LSS_NAME(rt_sigsuspend)(set, (KERNEL_NSIG+7)/8); | 3313 return LSS_NAME(rt_sigsuspend)(set, (KERNEL_NSIG+7)/8); |
| 2991 } | 3314 } |
| 2992 #endif | 3315 #endif |
| 2993 #if defined(__x86_64__) || defined(__ARM_ARCH_3__) || \ | 3316 #if defined(__x86_64__) || defined(__ARM_ARCH_3__) || \ |
| 2994 defined(__ARM_EABI__) || \ | 3317 defined(__ARM_EABI__) || defined(__aarch64__) || \ |
| 2995 (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI32) | 3318 (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI32) |
| 2996 LSS_INLINE _syscall4(pid_t, wait4, pid_t, p, | 3319 LSS_INLINE _syscall4(pid_t, wait4, pid_t, p, |
| 2997 int*, s, int, o, | 3320 int*, s, int, o, |
| 2998 struct kernel_rusage*, r) | 3321 struct kernel_rusage*, r) |
| 2999 | 3322 |
| 3000 LSS_INLINE pid_t LSS_NAME(waitpid)(pid_t pid, int *status, int options){ | 3323 LSS_INLINE pid_t LSS_NAME(waitpid)(pid_t pid, int *status, int options){ |
| 3001 return LSS_NAME(wait4)(pid, status, options, 0); | 3324 return LSS_NAME(wait4)(pid, status, options, 0); |
| 3002 } | 3325 } |
| 3003 #endif | 3326 #endif |
| 3004 #if defined(__i386__) || defined(__x86_64__) | |
| 3005 LSS_INLINE _syscall4(int, openat, int, d, const char *, p, int, f, int, m) | |
| 3006 LSS_INLINE _syscall3(int, unlinkat, int, d, const char *, p, int, f) | |
| 3007 #endif | |
| 3008 #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) | 3327 #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) |
| 3009 #define __NR__getresgid32 __NR_getresgid32 | 3328 #define __NR__getresgid32 __NR_getresgid32 |
| 3010 #define __NR__getresuid32 __NR_getresuid32 | 3329 #define __NR__getresuid32 __NR_getresuid32 |
| 3011 #define __NR__setfsgid32 __NR_setfsgid32 | 3330 #define __NR__setfsgid32 __NR_setfsgid32 |
| 3012 #define __NR__setfsuid32 __NR_setfsuid32 | 3331 #define __NR__setfsuid32 __NR_setfsuid32 |
| 3013 #define __NR__setresgid32 __NR_setresgid32 | 3332 #define __NR__setresgid32 __NR_setresgid32 |
| 3014 #define __NR__setresuid32 __NR_setresuid32 | 3333 #define __NR__setresuid32 __NR_setresuid32 |
| 3015 #if defined(__ARM_EABI__) | 3334 #if defined(__ARM_EABI__) |
| 3016 LSS_INLINE _syscall2(int, ugetrlimit, int, r, | 3335 LSS_INLINE _syscall2(int, ugetrlimit, int, r, |
| 3017 struct kernel_rlimit*, l) | 3336 struct kernel_rlimit*, l) |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3292 if (rc < 0 && LSS_ERRNO == ENOSYS) { | 3611 if (rc < 0 && LSS_ERRNO == ENOSYS) { |
| 3293 LSS_ERRNO = olderrno; | 3612 LSS_ERRNO = olderrno; |
| 3294 rc = LSS_NAME(_sigsuspend)( | 3613 rc = LSS_NAME(_sigsuspend)( |
| 3295 #ifndef __PPC__ | 3614 #ifndef __PPC__ |
| 3296 set, 0, | 3615 set, 0, |
| 3297 #endif | 3616 #endif |
| 3298 set->sig[0]); | 3617 set->sig[0]); |
| 3299 } | 3618 } |
| 3300 return rc; | 3619 return rc; |
| 3301 } | 3620 } |
| 3621 #elif defined(__aarch64__) | |
| 3622 LSS_INLINE _syscall6(void*, mmap, void*, addr, size_t, length, int, prot, | |
| 3623 int, flags, int, fd, off64_t, offset) | |
| 3302 #endif | 3624 #endif |
| 3303 #if defined(__PPC__) | 3625 #if defined(__PPC__) |
| 3304 #undef LSS_SC_LOADARGS_0 | 3626 #undef LSS_SC_LOADARGS_0 |
| 3305 #define LSS_SC_LOADARGS_0(dummy...) | 3627 #define LSS_SC_LOADARGS_0(dummy...) |
| 3306 #undef LSS_SC_LOADARGS_1 | 3628 #undef LSS_SC_LOADARGS_1 |
| 3307 #define LSS_SC_LOADARGS_1(arg1) \ | 3629 #define LSS_SC_LOADARGS_1(arg1) \ |
| 3308 __sc_4 = (unsigned long) (arg1) | 3630 __sc_4 = (unsigned long) (arg1) |
| 3309 #undef LSS_SC_LOADARGS_2 | 3631 #undef LSS_SC_LOADARGS_2 |
| 3310 #define LSS_SC_LOADARGS_2(arg1, arg2) \ | 3632 #define LSS_SC_LOADARGS_2(arg1, arg2) \ |
| 3311 LSS_SC_LOADARGS_1(arg1); \ | 3633 LSS_SC_LOADARGS_1(arg1); \ |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3382 | 3704 |
| 3383 LSS_INLINE int LSS_NAME(socket)(int domain, int type, int protocol) { | 3705 LSS_INLINE int LSS_NAME(socket)(int domain, int type, int protocol) { |
| 3384 LSS_SC_BODY(3, int, 1, domain, type, protocol); | 3706 LSS_SC_BODY(3, int, 1, domain, type, protocol); |
| 3385 } | 3707 } |
| 3386 | 3708 |
| 3387 LSS_INLINE int LSS_NAME(socketpair)(int d, int type, int protocol, | 3709 LSS_INLINE int LSS_NAME(socketpair)(int d, int type, int protocol, |
| 3388 int sv[2]) { | 3710 int sv[2]) { |
| 3389 LSS_SC_BODY(4, int, 8, d, type, protocol, sv); | 3711 LSS_SC_BODY(4, int, 8, d, type, protocol, sv); |
| 3390 } | 3712 } |
| 3391 #endif | 3713 #endif |
| 3392 #if defined(__ARM_EABI__) | 3714 #if defined(__ARM_EABI__) || defined (__aarch64__) || defined(__x86_64__) || \ |
|
Mark Seaborn
2014/04/03 21:44:22
Line is >80 chars
rmcilroy
2014/04/04 13:57:04
Done.
| |
| 3715 (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI32) | |
| 3393 LSS_INLINE _syscall3(ssize_t, recvmsg, int, s, struct kernel_msghdr*, msg, | 3716 LSS_INLINE _syscall3(ssize_t, recvmsg, int, s, struct kernel_msghdr*, msg, |
| 3394 int, flags) | 3717 int, flags) |
| 3395 LSS_INLINE _syscall3(ssize_t, sendmsg, int, s, const struct kernel_msghdr*, | 3718 LSS_INLINE _syscall3(ssize_t, sendmsg, int, s, const struct kernel_msghdr*, |
| 3396 msg, int, flags) | 3719 msg, int, flags) |
| 3397 LSS_INLINE _syscall6(ssize_t, sendto, int, s, const void*, buf, size_t,len, | 3720 LSS_INLINE _syscall6(ssize_t, sendto, int, s, const void*, buf, size_t,len, |
| 3398 int, flags, const struct kernel_sockaddr*, to, | 3721 int, flags, const struct kernel_sockaddr*, to, |
| 3399 unsigned int, tolen) | 3722 unsigned int, tolen) |
| 3400 LSS_INLINE _syscall2(int, shutdown, int, s, int, how) | 3723 LSS_INLINE _syscall2(int, shutdown, int, s, int, how) |
| 3401 LSS_INLINE _syscall3(int, socket, int, domain, int, type, int, protocol) | 3724 LSS_INLINE _syscall3(int, socket, int, domain, int, type, int, protocol) |
| 3402 LSS_INLINE _syscall4(int, socketpair, int, d, int, type, int, protocol, | 3725 LSS_INLINE _syscall4(int, socketpair, int, d, int, type, int, protocol, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3473 if (__r7) { | 3796 if (__r7) { |
| 3474 unsigned long __errnovalue = __v0; | 3797 unsigned long __errnovalue = __v0; |
| 3475 LSS_ERRNO = __errnovalue; | 3798 LSS_ERRNO = __errnovalue; |
| 3476 return -1; | 3799 return -1; |
| 3477 } else { | 3800 } else { |
| 3478 p[0] = __v0; | 3801 p[0] = __v0; |
| 3479 p[1] = __v1; | 3802 p[1] = __v1; |
| 3480 return 0; | 3803 return 0; |
| 3481 } | 3804 } |
| 3482 } | 3805 } |
| 3806 | |
| 3807 #elif defined(__aarch64__) | |
| 3808 LSS_INLINE _syscall2(int, pipe2, int *, pipefd, int, flags) | |
| 3809 LSS_INLINE pid_t LSS_NAME(pipe)(int* pipefd) { | |
| 3810 return LSS_NAME(pipe2)(pipefd, 0); | |
| 3811 } | |
| 3483 #else | 3812 #else |
| 3484 LSS_INLINE _syscall1(int, pipe, int *, p) | 3813 LSS_INLINE _syscall1(int, pipe, int *, p) |
| 3485 #endif | 3814 #endif |
| 3486 /* TODO(csilvers): see if ppc can/should support this as well */ | 3815 /* TODO(csilvers): see if ppc can/should support this as well */ |
| 3487 #if defined(__i386__) || defined(__ARM_ARCH_3__) || \ | 3816 #if defined(__i386__) || defined(__ARM_ARCH_3__) || \ |
| 3488 defined(__ARM_EABI__) || \ | 3817 defined(__ARM_EABI__) || \ |
| 3489 (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI64) | 3818 (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI64) |
| 3490 #define __NR__statfs64 __NR_statfs64 | 3819 #define __NR__statfs64 __NR_statfs64 |
| 3491 #define __NR__fstatfs64 __NR_fstatfs64 | 3820 #define __NR__fstatfs64 __NR_fstatfs64 |
| 3492 LSS_INLINE _syscall3(int, _statfs64, const char*, p, | 3821 LSS_INLINE _syscall3(int, _statfs64, const char*, p, |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3665 # pragma pop_macro("fstat64") | 3994 # pragma pop_macro("fstat64") |
| 3666 # pragma pop_macro("lstat64") | 3995 # pragma pop_macro("lstat64") |
| 3667 #endif | 3996 #endif |
| 3668 | 3997 |
| 3669 #if defined(__cplusplus) && !defined(SYS_CPLUSPLUS) | 3998 #if defined(__cplusplus) && !defined(SYS_CPLUSPLUS) |
| 3670 } | 3999 } |
| 3671 #endif | 4000 #endif |
| 3672 | 4001 |
| 3673 #endif | 4002 #endif |
| 3674 #endif | 4003 #endif |
| OLD | NEW |