]>
Commit | Line | Data |
---|---|---|
1 | /* Set flags signalling availability of kernel features based on given | |
2 | kernel version number. SPARC version. | |
3 | Copyright (C) 1999-2019 Free Software Foundation, Inc. | |
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 | |
18 | <https://www.gnu.org/licenses/>. */ | |
19 | ||
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__ | |
25 | # undef __ASSUME_SET_ROBUST_LIST | |
26 | #endif | |
27 | ||
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 | |
37 | # undef __ASSUME_ACCEPT_SYSCALL | |
38 | # undef __ASSUME_CONNECT_SYSCALL | |
39 | # undef __ASSUME_RECVFROM_SYSCALL | |
40 | # undef __ASSUME_SENDTO_SYSCALL | |
41 | #else | |
42 | # define __ASSUME_SOCKET_SYSCALL 1 | |
43 | # define __ASSUME_SOCKETPAIR_SYSCALL 1 | |
44 | # define __ASSUME_GETSOCKOPT_SYSCALL 1 | |
45 | # define __ASSUME_SHUTDOWN_SYSCALL 1 | |
46 | #endif | |
47 | ||
48 | /* These syscalls were added for both 32-bit and 64-bit in 4.4. */ | |
49 | #if __LINUX_KERNEL_VERSION >= 0x040400 | |
50 | # define __ASSUME_BIND_SYSCALL 1 | |
51 | # define __ASSUME_LISTEN_SYSCALL 1 | |
52 | # define __ASSUME_SETSOCKOPT_SYSCALL 1 | |
53 | #endif | |
54 | ||
55 | #ifdef __arch64__ | |
56 | /* sparc64 defines __NR_pause, however it is not supported (ENOSYS). | |
57 | Undefine so pause.c can use a correct alternative. */ | |
58 | # undef __NR_pause | |
59 | #endif | |
60 | ||
61 | /* sparc only supports ipc syscall. */ | |
62 | #undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS | |
63 | ||
64 | /* Support for the renameat2 syscall was added in 3.16. */ | |
65 | #if __LINUX_KERNEL_VERSION < 0x031000 | |
66 | # undef __ASSUME_RENAMEAT2 | |
67 | #endif | |
68 | ||
69 | /* SPARC kernel Kconfig does not define CONFIG_CLONE_BACKWARDS, however it | |
70 | has the same ABI as if it did, implemented by sparc-specific code | |
71 | (sparc_do_fork). | |
72 | ||
73 | It also has a unique return value convention: | |
74 | ||
75 | Parent --> %o0 == child's pid, %o1 == 0 | |
76 | Child --> %o0 == parent's pid, %o1 == 1 | |
77 | ||
78 | Which required a special macro to correct issue the syscall | |
79 | (INLINE_CLONE_SYSCALL). */ | |
80 | #undef __ASSUME_CLONE_DEFAULT | |
81 | #define __ASSUME_CLONE_BACKWARDS 1 |