]>
| Commit | Line | Data |
|---|---|---|
| 03f77315 JM |
1 | /* Set flags signalling availability of kernel features based on given |
| 2 | kernel version number. SPARC version. | |
| 26420023 | 3 | Copyright (C) 1999-2025 Free Software Foundation, Inc. |
| 03f77315 JM |
4 | This file is part of the GNU C Library. |
| 5 | ||
| 6 | The GNU C Library is free software; you can redistribute it and/or | |
| 7 | modify it under the terms of the GNU Lesser General Public | |
| 8 | License as published by the Free Software Foundation; either | |
| 9 | version 2.1 of the License, or (at your option) any later version. | |
| 10 | ||
| 11 | The GNU C Library is distributed in the hope that it will be useful, | |
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 14 | Lesser General Public License for more details. | |
| 15 | ||
| 16 | You should have received a copy of the GNU Lesser General Public | |
| 17 | License along with the GNU C Library; if not, see | |
| 5a82c748 | 18 | <https://www.gnu.org/licenses/>. */ |
| 03f77315 | 19 | |
| 03f77315 JM |
20 | #include_next <kernel-features.h> |
| 21 | ||
| 22 | /* 32-bit SPARC kernels do not support | |
| 23 | futex_atomic_cmpxchg_inatomic. */ | |
| 24 | #if !defined __arch64__ && !defined __sparc_v9__ | |
| 03f77315 JM |
25 | # undef __ASSUME_SET_ROBUST_LIST |
| 26 | #endif | |
| 63719cf1 | 27 | |
| daea71c2 JM |
28 | /* These syscalls were added for 32-bit in 4.4 (but present for 64-bit |
| 29 | in all supported kernel versions); the architecture-independent | |
| 30 | kernel-features.h assumes some of them to be present by default. | |
| 31 | getpeername and getsockname syscalls were also added for 32-bit in | |
| 32 | 4.4, but only for 32-bit kernels, not in the compat syscall table | |
| 33 | for 64-bit kernels. */ | |
| 34 | #if !defined __arch64__ && __LINUX_KERNEL_VERSION < 0x040400 | |
| 35 | # undef __ASSUME_SENDMSG_SYSCALL | |
| 36 | # undef __ASSUME_RECVMSG_SYSCALL | |
| 01061a7c | 37 | # undef __ASSUME_ACCEPT_SYSCALL |
| 3e9ff426 | 38 | # undef __ASSUME_CONNECT_SYSCALL |
| 1f8161a8 | 39 | # undef __ASSUME_RECVFROM_SYSCALL |
| daea71c2 | 40 | # undef __ASSUME_SENDTO_SYSCALL |
| 1c46663a | 41 | # undef __ASSUME_GETSOCKOPT_SYSCALL |
| 4b93a93e | 42 | # undef __ASSUME_SETSOCKOPT_SYSCALL |
| daea71c2 JM |
43 | #endif |
| 44 | ||
| a7bf5f4e AZ |
45 | /* There syscalls were added for 32-bit in compat syscall table only |
| 46 | in 4.20 (but present for 64-bit in all supported kernel versions). */ | |
| 47 | #if !defined __arch64__ && __LINUX_KERNEL_VERSION < 0x041400 | |
| 48 | # undef __ASSUME_GETSOCKNAME_SYSCALL | |
| 48d256de | 49 | # undef __ASSUME_GETPEERNAME_SYSCALL |
| a7bf5f4e AZ |
50 | #endif |
| 51 | ||
| daea71c2 | 52 | /* These syscalls were added for both 32-bit and 64-bit in 4.4. */ |
| 215bf993 AZN |
53 | #if __LINUX_KERNEL_VERSION < 0x040400 |
| 54 | # undef __ASSUME_BIND_SYSCALL | |
| 377a14a2 | 55 | # undef __ASSUME_LISTEN_SYSCALL |
| 215bf993 AZN |
56 | #endif |
| 57 | ||
| daea71c2 | 58 | #ifdef __arch64__ |
| 88499a87 AZ |
59 | /* sparc64 defines __NR_pause, however it is not supported (ENOSYS). |
| 60 | Undefine so pause.c can use a correct alternative. */ | |
| 61 | # undef __NR_pause | |
| 01061a7c AZ |
62 | #endif |
| 63 | ||
| 720e9541 AZ |
64 | /* sparc only supports ipc syscall before 5.1. */ |
| 65 | #if __LINUX_KERNEL_VERSION < 0x050100 | |
| 66 | # undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS | |
| 67 | # if !defined __arch64__ | |
| 68 | # undef __ASSUME_SYSVIPC_DEFAULT_IPC_64 | |
| 69 | # endif | |
| 06436acf | 70 | #endif |
| d39c0a45 | 71 | |
| d6da5cb6 FW |
72 | /* Support for the renameat2 syscall was added in 3.16. */ |
| 73 | #if __LINUX_KERNEL_VERSION < 0x031000 | |
| 74 | # undef __ASSUME_RENAMEAT2 | |
| 75 | #endif | |
| 76 | ||
| d39c0a45 AZ |
77 | /* SPARC kernel Kconfig does not define CONFIG_CLONE_BACKWARDS, however it |
| 78 | has the same ABI as if it did, implemented by sparc-specific code | |
| 79 | (sparc_do_fork). | |
| 80 | ||
| 81 | It also has a unique return value convention: | |
| 82 | ||
| 83 | Parent --> %o0 == child's pid, %o1 == 0 | |
| 84 | Child --> %o0 == parent's pid, %o1 == 1 | |
| 85 | ||
| 86 | Which required a special macro to correct issue the syscall | |
| 87 | (INLINE_CLONE_SYSCALL). */ | |
| 88 | #undef __ASSUME_CLONE_DEFAULT | |
| 89 | #define __ASSUME_CLONE_BACKWARDS 1 | |
| ad77b1bc AZN |
90 | |
| 91 | /* sparc does not provide clone3. */ | |
| 92 | #undef __ASSUME_CLONE3 | |
| 93 | #define __ASSUME_CLONE3 0 |