| author | |
| committer | |
| log | 58f669dc8c4fa9f78d73d014e805a506009f3d30 |
| tree | 4343603e48044a8c1123ef5ad495a88bb164788d |
| parent | 877a1f2a2986e02269c64a05456dff521da27ac1 |
| parent | 9257669cd4ecb10c51baea2bccee993e0c82bd20 |
| signature | Signed by PGP key 4AEE18F83AFDEB23 |
update glibc to 2.34888 files changed, 26311 insertions(+), 19677 deletions(-)
lib/libc/glibc/abilists| Binary files a/lib/libc/glibc/abilists and b/lib/libc/glibc/abilists differ |
lib/libc/glibc/bits/byteswap.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Macros and inline functions to swap the order of bytes in integer values. |
| 2 | Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/bits/floatn-common.h+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Macros to control TS 18661-3 glibc features where the same |
| 2 | 2 | definitions are appropriate for all platforms. |
| 3 | Copyright (C) 2017-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/bits/libc-header-start.h+27-3| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Handle feature test macros at the start of a header. |
| 2 | Copyright (C) 2016-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2016-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -44,8 +44,26 @@ |
| 44 | 44 | |
| 45 | 45 | /* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__ |
| 46 | 46 | macro. Most but not all symbols enabled by that macro in TS |
| 47 | 18661-1 are enabled unconditionally in C2X; the symbols in Annex F | |
| 48 | still require that macro in C2X. */ | |
| 47 | 18661-1 are enabled unconditionally in C2X. In C2X, the symbols in | |
| 48 | Annex F still require a new feature test macro | |
| 49 | __STDC_WANT_IEC_60559_EXT__ instead (C2X does not define | |
| 50 | __STDC_WANT_IEC_60559_BFP_EXT__), while a few features from TS | |
| 51 | 18661-1 are not included in C2X (and thus should depend on | |
| 52 | __STDC_WANT_IEC_60559_BFP_EXT__ even when C2X features are | |
| 53 | enabled). | |
| 54 | ||
| 55 | __GLIBC_USE (IEC_60559_BFP_EXT) controls those features from TS | |
| 56 | 18661-1 not included in C2X. | |
| 57 | ||
| 58 | __GLIBC_USE (IEC_60559_BFP_EXT_C2X) controls those features from TS | |
| 59 | 18661-1 that are also included in C2X (with no feature test macro | |
| 60 | required in C2X). | |
| 61 | ||
| 62 | __GLIBC_USE (IEC_60559_EXT) controls those features from TS 18661-1 | |
| 63 | that are included in C2X but conditional on | |
| 64 | __STDC_WANT_IEC_60559_EXT__. (There are currently no features | |
| 65 | conditional on __STDC_WANT_IEC_60559_EXT__ that are not in TS | |
| 66 | 18661-1.) */ | |
| 49 | 67 | #undef __GLIBC_USE_IEC_60559_BFP_EXT |
| 50 | 68 | #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_BFP_EXT__ |
| 51 | 69 | # define __GLIBC_USE_IEC_60559_BFP_EXT 1 |
| ... | ... | @@ -58,6 +76,12 @@ |
| 58 | 76 | #else |
| 59 | 77 | # define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0 |
| 60 | 78 | #endif |
| 79 | #undef __GLIBC_USE_IEC_60559_EXT | |
| 80 | #if __GLIBC_USE (IEC_60559_BFP_EXT) || defined __STDC_WANT_IEC_60559_EXT__ | |
| 81 | # define __GLIBC_USE_IEC_60559_EXT 1 | |
| 82 | #else | |
| 83 | # define __GLIBC_USE_IEC_60559_EXT 0 | |
| 84 | #endif | |
| 61 | 85 | |
| 62 | 86 | /* ISO/IEC TS 18661-4:2015 defines the |
| 63 | 87 | __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction |
lib/libc/glibc/bits/long-double.h+15-2| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Properties of long double type. |
| 2 | Copyright (C) 2016-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2016-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -37,4 +37,17 @@ |
| 37 | 37 | #ifndef __NO_LONG_DOUBLE_MATH |
| 38 | 38 | # define __NO_LONG_DOUBLE_MATH	1 |
| 39 | 39 | #endif |
| 40 | #define __LONG_DOUBLE_USES_FLOAT128 0 | |
| 40 | ||
| 41 | /* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the | |
| 42 | choice of the underlying ABI of long double. It will always assume | |
| 43 | a constant value for each translation unit. | |
| 44 | ||
| 45 | If the value is non-zero, any API which is parameterized by the long | |
| 46 | double type (i.e the scanf/printf family of functions or the explicitly | |
| 47 | parameterized math.h functions) will be redirected to a compatible | |
| 48 | implementation using _Float128 ABI via symbols suffixed with ieee128. | |
| 49 | ||
| 50 | The mechanism this macro uses to acquire may be a function | |
| 51 | of architecture, or target specific options used to invoke the | |
| 52 | compiler. */ | |
| 53 | #define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 |
lib/libc/glibc/bits/select.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/bits/signum-generic.h+4-25| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Signal number constants. Generic template. |
| 2 | Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -57,31 +57,9 @@ |
| 57 | 57 | #define	SIGQUIT		3	/* Quit. */ |
| 58 | 58 | #define	SIGTRAP		5	/* Trace/breakpoint trap. */ |
| 59 | 59 | #define	SIGKILL		9	/* Killed. */ |
| 60 | #define SIGBUS		10	/* Bus error. */ | |
| 61 | #define	SIGSYS		12	/* Bad system call. */ | |
| 62 | 60 | #define	SIGPIPE		13	/* Broken pipe. */ |
| 63 | 61 | #define	SIGALRM		14	/* Alarm clock. */ |
| 64 | 62 | |
| 65 | /* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ | |
| 66 | #define	SIGURG		16	/* Urgent data is available at a socket. */ | |
| 67 | #define	SIGSTOP		17	/* Stop, unblockable. */ | |
| 68 | #define	SIGTSTP		18	/* Keyboard stop. */ | |
| 69 | #define	SIGCONT		19	/* Continue. */ | |
| 70 | #define	SIGCHLD		20	/* Child terminated or stopped. */ | |
| 71 | #define	SIGTTIN		21	/* Background read from control terminal. */ | |
| 72 | #define	SIGTTOU		22	/* Background write to control terminal. */ | |
| 73 | #define	SIGPOLL		23	/* Pollable event occurred (System V). */ | |
| 74 | #define	SIGXCPU		24	/* CPU time limit exceeded. */ | |
| 75 | #define	SIGXFSZ		25	/* File size limit exceeded. */ | |
| 76 | #define	SIGVTALRM	26	/* Virtual timer expired. */ | |
| 77 | #define	SIGPROF		27	/* Profiling timer expired. */ | |
| 78 | #define	SIGUSR1		30	/* User-defined signal 1. */ | |
| 79 | #define	SIGUSR2		31	/* User-defined signal 2. */ | |
| 80 | ||
| 81 | /* Nonstandard signals found in all modern POSIX systems | |
| 82 | (including both BSD and Linux). */ | |
| 83 | #define	SIGWINCH	28	/* Window size change (4.3 BSD, Sun). */ | |
| 84 | ||
| 85 | 63 | /* Archaic names for compatibility. */ |
| 86 | 64 | #define	SIGIO		SIGPOLL	/* I/O now possible (4.2 BSD). */ |
| 87 | 65 | #define	SIGIOT		SIGABRT	/* IOT instruction, abort() on a PDP-11. */ |
| ... | ... | @@ -93,8 +71,9 @@ |
| 93 | 71 | but some real-time signals may be used internally by glibc. Do not |
| 94 | 72 | use these constants in application code; use SIGRTMIN and SIGRTMAX |
| 95 | 73 | (defined in signal.h) instead. */ |
| 96 | #define __SIGRTMIN	32 | |
| 97 | #define __SIGRTMAX	__SIGRTMIN | |
| 74 | ||
| 75 | /* Include system specific bits. */ | |
| 76 | #include <bits/signum-arch.h> | |
| 98 | 77 | |
| 99 | 78 | /* Biggest signal number + 1 (including real-time signals). */ |
| 100 | 79 | #define _NSIG		(__SIGRTMAX + 1) |
lib/libc/glibc/bits/stat.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/bits/stdint-intn.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Define intN_t types. |
| 2 | Copyright (C) 2017-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/bits/stdlib-bsearch.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Perform binary search - inline version. |
| 2 | Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/bits/time64.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* bits/time64.h -- underlying types for __time64_t. Generic version. |
| 2 | Copyright (C) 2018-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2018-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/bits/timesize.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Bit size of the time_t type at glibc build time, general case. |
| 2 | Copyright (C) 2018-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2018-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/bits/types/struct_sched_param.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Sched parameter structure. Generic version. |
| 2 | Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/bits/typesizes.h+8-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* bits/typesizes.h -- underlying types for *_t. Generic version. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -50,6 +50,7 @@ |
| 50 | 50 | #define __TIME_T_TYPE		__SLONGWORD_TYPE |
| 51 | 51 | #define __USECONDS_T_TYPE	__U32_TYPE |
| 52 | 52 | #define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE |
| 53 | #define __SUSECONDS64_T_TYPE	__SQUAD_TYPE | |
| 53 | 54 | #define __DADDR_T_TYPE		__S32_TYPE |
| 54 | 55 | #define __KEY_T_TYPE		__S32_TYPE |
| 55 | 56 | #define __CLOCKID_T_TYPE	__S32_TYPE |
| ... | ... | @@ -75,10 +76,16 @@ |
| 75 | 76 | |
| 76 | 77 | /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ |
| 77 | 78 | # define __STATFS_MATCHES_STATFS64 1 |
| 79 | ||
| 80 | /* And for getitimer, setitimer and rusage */ | |
| 81 | # define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 | |
| 78 | 82 | #else |
| 79 | 83 | # define __RLIM_T_MATCHES_RLIM64_T	0 |
| 80 | 84 | |
| 81 | 85 | # define __STATFS_MATCHES_STATFS64 0 |
| 86 | ||
| 87 | /* And for getitimer, setitimer and rusage */ | |
| 88 | # define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 | |
| 82 | 89 | #endif |
| 83 | 90 | |
| 84 | 91 | /* Number of descriptors that can fit in an `fd_set'. */ |
lib/libc/glibc/bits/uintn-identity.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Inline functions to return unsigned integer values unchanged. |
| 2 | Copyright (C) 2017-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/bits/waitflags.h+9-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Definitions of flag bits for `waitpid' et al. |
| 2 | Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -24,3 +24,11 @@ |
| 24 | 24 | /* Bits in the third argument to `waitpid'. */ |
| 25 | 25 | #define	WNOHANG		1	/* Don't block waiting. */ |
| 26 | 26 | #define	WUNTRACED	2	/* Report status of stopped children. */ |
| 27 | ||
| 28 | /* Bits in the fourth argument to `waitid'. */ | |
| 29 | #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 | |
| 30 | # define WSTOPPED	WUNTRACED	/* Report stopped child. */ | |
| 31 | # define WCONTINUED	4		/* Report continued child. */ | |
| 32 | # define WNOWAIT	8		/* Don't reap, just poll status. */ | |
| 33 | # define WEXITED	16		/* Report dead child. */ | |
| 34 | #endif |
lib/libc/glibc/bits/waitstatus.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Definitions of status bits for `wait' et al. |
| 2 | Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/csu/elf-init.c deleted-106| ... | ... | @@ -1,106 +0,0 @@ |
| 1 | /* Startup support for ELF initializers/finalizers in the main executable. | |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | In addition to the permissions in the GNU Lesser General Public | |
| 11 | License, the Free Software Foundation gives you unlimited | |
| 12 | permission to link the compiled version of this file with other | |
| 13 | programs, and to distribute those programs without any restriction | |
| 14 | coming from the use of this file. (The GNU Lesser General Public | |
| 15 | License restrictions do apply in other respects; for example, they | |
| 16 | cover modification of the file, and distribution when not linked | |
| 17 | into another program.) | |
| 18 | ||
| 19 | Note that people who make modified versions of this file are not | |
| 20 | obligated to grant this special exception for their modified | |
| 21 | versions; it is their choice whether to do so. The GNU Lesser | |
| 22 | General Public License gives permission to release a modified | |
| 23 | version without this exception; this exception also makes it | |
| 24 | possible to release a modified version which carries forward this | |
| 25 | exception. | |
| 26 | ||
| 27 | The GNU C Library is distributed in the hope that it will be useful, | |
| 28 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 29 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 30 | Lesser General Public License for more details. | |
| 31 | ||
| 32 | You should have received a copy of the GNU Lesser General Public | |
| 33 | License along with the GNU C Library; if not, see | |
| 34 | <https://www.gnu.org/licenses/>. */ | |
| 35 | ||
| 36 | #include <stddef.h> | |
| 37 | ||
| 38 | ||
| 39 | /* These magic symbols are provided by the linker. */ | |
| 40 | extern void (*__preinit_array_start []) (int, char **, char **) | |
| 41 | attribute_hidden; | |
| 42 | extern void (*__preinit_array_end []) (int, char **, char **) | |
| 43 | attribute_hidden; | |
| 44 | extern void (*__init_array_start []) (int, char **, char **) | |
| 45 | attribute_hidden; | |
| 46 | extern void (*__init_array_end []) (int, char **, char **) | |
| 47 | attribute_hidden; | |
| 48 | extern void (*__fini_array_start []) (void) attribute_hidden; | |
| 49 | extern void (*__fini_array_end []) (void) attribute_hidden; | |
| 50 | ||
| 51 | ||
| 52 | #ifndef NO_INITFINI | |
| 53 | /* These function symbols are provided for the .init/.fini section entry | |
| 54 | points automagically by the linker. */ | |
| 55 | extern void _init (void); | |
| 56 | extern void _fini (void); | |
| 57 | #endif | |
| 58 | ||
| 59 | ||
| 60 | /* These functions are passed to __libc_start_main by the startup code. | |
| 61 | These get statically linked into each program. For dynamically linked | |
| 62 | programs, this module will come from libc_nonshared.a and differs from | |
| 63 | the libc.a module in that it doesn't call the preinit array. */ | |
| 64 | ||
| 65 | ||
| 66 | void | |
| 67 | __libc_csu_init (int argc, char **argv, char **envp) | |
| 68 | { | |
| 69 | /* For dynamically linked executables the preinit array is executed by | |
| 70 | the dynamic linker (before initializing any shared object). */ | |
| 71 | ||
| 72 | #ifndef LIBC_NONSHARED | |
| 73 | /* For static executables, preinit happens right before init. */ | |
| 74 | { | |
| 75 | const size_t size = __preinit_array_end - __preinit_array_start; | |
| 76 | size_t i; | |
| 77 | for (i = 0; i < size; i++) | |
| 78 | (*__preinit_array_start [i]) (argc, argv, envp); | |
| 79 | } | |
| 80 | #endif | |
| 81 | ||
| 82 | #ifndef NO_INITFINI | |
| 83 | _init (); | |
| 84 | #endif | |
| 85 | ||
| 86 | const size_t size = __init_array_end - __init_array_start; | |
| 87 | for (size_t i = 0; i < size; i++) | |
| 88 | (*__init_array_start [i]) (argc, argv, envp); | |
| 89 | } | |
| 90 | ||
| 91 | /* This function should not be used anymore. We run the executable's | |
| 92 | destructor now just like any other. We cannot remove the function, | |
| 93 | though. */ | |
| 94 | void | |
| 95 | __libc_csu_fini (void) | |
| 96 | { | |
| 97 | #ifndef LIBC_NONSHARED | |
| 98 | size_t i = __fini_array_end - __fini_array_start; | |
| 99 | while (i-- > 0) | |
| 100 | (*__fini_array_start [i]) (); | |
| 101 | ||
| 102 | # ifndef NO_INITFINI | |
| 103 | _fini (); | |
| 104 | # endif | |
| 105 | #endif | |
| 106 | } |
lib/libc/glibc/csu/errno.c created+35| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | /* Definition of `errno' variable. Canonical version. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <errno.h> | |
| 20 | #include <tls.h> | |
| 21 | #include <dl-sysdep.h> | |
| 22 | #undef errno | |
| 23 | ||
| 24 | #if RTLD_PRIVATE_ERRNO | |
| 25 | ||
| 26 | /* Code compiled for rtld refers only to this name. */ | |
| 27 | int rtld_errno attribute_hidden; | |
| 28 | ||
| 29 | #else | |
| 30 | ||
| 31 | __thread int errno; | |
| 32 | extern __thread int __libc_errno __attribute__ ((alias ("errno"))) | |
| 33 | attribute_hidden; | |
| 34 | ||
| 35 | #endif |
lib/libc/glibc/debug/stack_chk_fail_local.c+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2005-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/elf/elf.h+108-35| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* This file defines standard ELF types, structures, and macros. |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -19,10 +19,6 @@ |
| 19 | 19 | #ifndef _ELF_H |
| 20 | 20 | #define	_ELF_H 1 |
| 21 | 21 | |
| 22 | #include <features.h> | |
| 23 | ||
| 24 | __BEGIN_DECLS | |
| 25 | ||
| 26 | 22 | /* Standard ELF types. */ |
| 27 | 23 | |
| 28 | 24 | #include <stdint.h> |
| ... | ... | @@ -322,7 +318,7 @@ typedef struct |
| 322 | 318 | 				/* reserved 184 */ |
| 323 | 319 | #define EM_AVR32	185	/* Amtel 32-bit microprocessor */ |
| 324 | 320 | #define EM_STM8		186	/* STMicroelectronics STM8 */ |
| 325 | #define EM_TILE64	187	/* Tileta TILE64 */ | |
| 321 | #define EM_TILE64	187	/* Tilera TILE64 */ | |
| 326 | 322 | #define EM_TILEPRO	188	/* Tilera TILEPro */ |
| 327 | 323 | #define EM_MICROBLAZE	189	/* Xilinx MicroBlaze */ |
| 328 | 324 | #define EM_CUDA		190	/* NVIDIA CUDA */ |
| ... | ... | @@ -330,7 +326,7 @@ typedef struct |
| 330 | 326 | #define EM_CLOUDSHIELD	192	/* CloudShield */ |
| 331 | 327 | #define EM_COREA_1ST	193	/* KIPO-KAIST Core-A 1st gen. */ |
| 332 | 328 | #define EM_COREA_2ND	194	/* KIPO-KAIST Core-A 2nd gen. */ |
| 333 | #define EM_ARC_COMPACT2	195	/* Synopsys ARCompact V2 */ | |
| 329 | #define EM_ARCV2	195	/* Synopsys ARCv2 ISA. */ | |
| 334 | 330 | #define EM_OPEN8	196	/* Open8 RISC */ |
| 335 | 331 | #define EM_RL78		197	/* Renesas RL78 */ |
| 336 | 332 | #define EM_VIDEOCORE5	198	/* Broadcom VideoCore V */ |
| ... | ... | @@ -340,7 +336,8 @@ typedef struct |
| 340 | 336 | #define EM_BA2		202	/* Beyond BA2 */ |
| 341 | 337 | #define EM_XCORE	203	/* XMOS xCORE */ |
| 342 | 338 | #define EM_MCHP_PIC	204	/* Microchip 8-bit PIC(r) */ |
| 343 | 				/* reserved 205-209 */ | |
| 339 | #define EM_INTELGT	205	/* Intel Graphics Technology */ | |
| 340 | 				/* reserved 206-209 */ | |
| 344 | 341 | #define EM_KM32		210	/* KM211 KM32 */ |
| 345 | 342 | #define EM_KMX32	211	/* KM211 KMX32 */ |
| 346 | 343 | #define EM_EMX16	212	/* KM211 KMX16 */ |
| ... | ... | @@ -445,7 +442,7 @@ typedef struct |
| 445 | 442 | #define SHT_FINI_ARRAY	 15		/* Array of destructors */ |
| 446 | 443 | #define SHT_PREINIT_ARRAY 16		/* Array of pre-constructors */ |
| 447 | 444 | #define SHT_GROUP	 17		/* Section group */ |
| 448 | #define SHT_SYMTAB_SHNDX 18		/* Extended section indeces */ | |
| 445 | #define SHT_SYMTAB_SHNDX 18		/* Extended section indices */ | |
| 449 | 446 | #define	SHT_NUM		 19		/* Number of defined types. */ |
| 450 | 447 | #define SHT_LOOS	 0x60000000	/* Start OS-specific. */ |
| 451 | 448 | #define SHT_GNU_ATTRIBUTES 0x6ffffff5	/* Object attributes. */ |
| ... | ... | @@ -482,6 +479,7 @@ typedef struct |
| 482 | 479 | #define SHF_COMPRESSED	 (1 << 11)	/* Section with compressed data. */ |
| 483 | 480 | #define SHF_MASKOS	 0x0ff00000	/* OS-specific. */ |
| 484 | 481 | #define SHF_MASKPROC	 0xf0000000	/* Processor-specific */ |
| 482 | #define SHF_GNU_RETAIN	 (1 << 21) /* Not to be GCed by linker. */ | |
| 485 | 483 | #define SHF_ORDERED	 (1 << 30)	/* Special ordering requirement |
| 486 | 484 | 					 (Solaris). */ |
| 487 | 485 | #define SHF_EXCLUDE	 (1U << 31)	/* Section is excluded unless |
| ... | ... | @@ -721,6 +719,7 @@ typedef struct |
| 721 | 719 | #define PT_GNU_EH_FRAME	0x6474e550	/* GCC .eh_frame_hdr segment */ |
| 722 | 720 | #define PT_GNU_STACK	0x6474e551	/* Indicates stack executability */ |
| 723 | 721 | #define PT_GNU_RELRO	0x6474e552	/* Read-only after relocation */ |
| 722 | #define PT_GNU_PROPERTY	0x6474e553	/* GNU property */ | |
| 724 | 723 | #define PT_LOSUNW	0x6ffffffa |
| 725 | 724 | #define PT_SUNWBSS	0x6ffffffa	/* Sun Specific segment */ |
| 726 | 725 | #define PT_SUNWSTACK	0x6ffffffb	/* Stack segment */ |
| ... | ... | @@ -815,6 +814,10 @@ typedef struct |
| 815 | 814 | 					 address keys. */ |
| 816 | 815 | #define NT_ARM_PACG_KEYS	0x408	/* ARM pointer authentication |
| 817 | 816 | 					 generic key. */ |
| 817 | #define NT_ARM_TAGGED_ADDR_CTRL	0x409	/* AArch64 tagged address | |
| 818 | 					 control. */ | |
| 819 | #define NT_ARM_PAC_ENABLED_KEYS	0x40a	/* AArch64 pointer authentication | |
| 820 | 					 enabled keys. */ | |
| 818 | 821 | #define NT_VMCOREDD	0x700		/* Vmcore Device Dump Note. */ |
| 819 | 822 | #define NT_MIPS_DSP	0x800		/* MIPS DSP ASE registers. */ |
| 820 | 823 | #define NT_MIPS_FP_MODE	0x801		/* MIPS floating-point mode. */ |
| ... | ... | @@ -1049,7 +1052,7 @@ typedef struct |
| 1049 | 1052 | #define	VER_NDX_LORESERVE	0xff00	/* Beginning of reserved entries. */ |
| 1050 | 1053 | #define	VER_NDX_ELIMINATE	0xff01	/* Symbol is to be eliminated. */ |
| 1051 | 1054 | |
| 1052 | /* Auxialiary version information. */ | |
| 1055 | /* Auxiliary version information. */ | |
| 1053 | 1056 | |
| 1054 | 1057 | typedef struct |
| 1055 | 1058 | { |
| ... | ... | @@ -1318,33 +1321,34 @@ typedef struct |
| 1318 | 1321 | /* Application-specific semantics, hi */ |
| 1319 | 1322 | #define GNU_PROPERTY_HIUSER			0xffffffff |
| 1320 | 1323 | |
| 1324 | /* AArch64 specific GNU properties. */ | |
| 1325 | #define GNU_PROPERTY_AARCH64_FEATURE_1_AND	0xc0000000 | |
| 1326 | ||
| 1327 | #define GNU_PROPERTY_AARCH64_FEATURE_1_BTI	(1U << 0) | |
| 1328 | #define GNU_PROPERTY_AARCH64_FEATURE_1_PAC	(1U << 1) | |
| 1329 | ||
| 1321 | 1330 | /* The x86 instruction sets indicated by the corresponding bits are |
| 1322 | 1331 | used in program. Their support in the hardware is optional. */ |
| 1323 | #define GNU_PROPERTY_X86_ISA_1_USED		0xc0000000 | |
| 1332 | #define GNU_PROPERTY_X86_ISA_1_USED		0xc0010002 | |
| 1324 | 1333 | /* The x86 instruction sets indicated by the corresponding bits are |
| 1325 | 1334 | used in program and they must be supported by the hardware. */ |
| 1326 | #define GNU_PROPERTY_X86_ISA_1_NEEDED		0xc0000001 | |
| 1335 | #define GNU_PROPERTY_X86_ISA_1_NEEDED		0xc0008002 | |
| 1327 | 1336 | /* X86 processor-specific features used in program. */ |
| 1328 | 1337 | #define GNU_PROPERTY_X86_FEATURE_1_AND		0xc0000002 |
| 1329 | 1338 | |
| 1330 | #define GNU_PROPERTY_X86_ISA_1_486		(1U << 0) | |
| 1331 | #define GNU_PROPERTY_X86_ISA_1_586		(1U << 1) | |
| 1332 | #define GNU_PROPERTY_X86_ISA_1_686		(1U << 2) | |
| 1333 | #define GNU_PROPERTY_X86_ISA_1_SSE		(1U << 3) | |
| 1334 | #define GNU_PROPERTY_X86_ISA_1_SSE2		(1U << 4) | |
| 1335 | #define GNU_PROPERTY_X86_ISA_1_SSE3		(1U << 5) | |
| 1336 | #define GNU_PROPERTY_X86_ISA_1_SSSE3		(1U << 6) | |
| 1337 | #define GNU_PROPERTY_X86_ISA_1_SSE4_1		(1U << 7) | |
| 1338 | #define GNU_PROPERTY_X86_ISA_1_SSE4_2		(1U << 8) | |
| 1339 | #define GNU_PROPERTY_X86_ISA_1_AVX		(1U << 9) | |
| 1340 | #define GNU_PROPERTY_X86_ISA_1_AVX2		(1U << 10) | |
| 1341 | #define GNU_PROPERTY_X86_ISA_1_AVX512F		(1U << 11) | |
| 1342 | #define GNU_PROPERTY_X86_ISA_1_AVX512CD		(1U << 12) | |
| 1343 | #define GNU_PROPERTY_X86_ISA_1_AVX512ER		(1U << 13) | |
| 1344 | #define GNU_PROPERTY_X86_ISA_1_AVX512PF		(1U << 14) | |
| 1345 | #define GNU_PROPERTY_X86_ISA_1_AVX512VL		(1U << 15) | |
| 1346 | #define GNU_PROPERTY_X86_ISA_1_AVX512DQ		(1U << 16) | |
| 1347 | #define GNU_PROPERTY_X86_ISA_1_AVX512BW		(1U << 17) | |
| 1339 | /* GNU_PROPERTY_X86_ISA_1_BASELINE: CMOV, CX8 (cmpxchg8b), FPU (fld), | |
| 1340 | MMX, OSFXSR (fxsave), SCE (syscall), SSE and SSE2. */ | |
| 1341 | #define GNU_PROPERTY_X86_ISA_1_BASELINE		(1U << 0) | |
| 1342 | /* GNU_PROPERTY_X86_ISA_1_V2: GNU_PROPERTY_X86_ISA_1_BASELINE, | |
| 1343 | CMPXCHG16B (cmpxchg16b), LAHF-SAHF (lahf), POPCNT (popcnt), SSE3, | |
| 1344 | SSSE3, SSE4.1 and SSE4.2. */ | |
| 1345 | #define GNU_PROPERTY_X86_ISA_1_V2		(1U << 1) | |
| 1346 | /* GNU_PROPERTY_X86_ISA_1_V3: GNU_PROPERTY_X86_ISA_1_V2, AVX, AVX2, BMI1, | |
| 1347 | BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE. */ | |
| 1348 | #define GNU_PROPERTY_X86_ISA_1_V3		(1U << 2) | |
| 1349 | /* GNU_PROPERTY_X86_ISA_1_V4: GNU_PROPERTY_X86_ISA_1_V3, AVX512F, | |
| 1350 | AVX512BW, AVX512CD, AVX512DQ and AVX512VL. */ | |
| 1351 | #define GNU_PROPERTY_X86_ISA_1_V4		(1U << 3) | |
| 1348 | 1352 | |
| 1349 | 1353 | /* This indicates that all executable sections are compatible with |
| 1350 | 1354 | IBT. */ |
| ... | ... | @@ -2136,9 +2140,9 @@ enum |
| 2136 | 2140 | #define EFA_PARISC_1_1		 0x0210 /* PA-RISC 1.1 big-endian. */ |
| 2137 | 2141 | #define EFA_PARISC_2_0		 0x0214 /* PA-RISC 2.0 big-endian. */ |
| 2138 | 2142 | |
| 2139 | /* Additional section indeces. */ | |
| 2143 | /* Additional section indices. */ | |
| 2140 | 2144 | |
| 2141 | #define SHN_PARISC_ANSI_COMMON	0xff00	 /* Section for tenatively declared | |
| 2145 | #define SHN_PARISC_ANSI_COMMON	0xff00	 /* Section for tentatively declared | |
| 2142 | 2146 | 					 symbols in ANSI C. */ |
| 2143 | 2147 | #define SHN_PARISC_HUGE_COMMON	0xff01	 /* Common blocks in huge model. */ |
| 2144 | 2148 | |
| ... | ... | @@ -2868,6 +2872,8 @@ enum |
| 2868 | 2872 | #define R_AARCH64_IRELATIVE	1032	/* STT_GNU_IFUNC relocation. */ |
| 2869 | 2873 | |
| 2870 | 2874 | /* AArch64 specific values for the Dyn d_tag field. */ |
| 2875 | #define DT_AARCH64_BTI_PLT	(DT_LOPROC + 1) | |
| 2876 | #define DT_AARCH64_PAC_PLT	(DT_LOPROC + 3) | |
| 2871 | 2877 | #define DT_AARCH64_VARIANT_PCS	(DT_LOPROC + 5) |
| 2872 | 2878 | #define DT_AARCH64_NUM		6 |
| 2873 | 2879 | |
| ... | ... | @@ -3946,8 +3952,9 @@ enum |
| 3946 | 3952 | #define R_RISCV_SET16		55 |
| 3947 | 3953 | #define R_RISCV_SET32		56 |
| 3948 | 3954 | #define R_RISCV_32_PCREL	57 |
| 3955 | #define R_RISCV_IRELATIVE	58 | |
| 3949 | 3956 | |
| 3950 | #define R_RISCV_NUM		58 | |
| 3957 | #define R_RISCV_NUM		59 | |
| 3951 | 3958 | |
| 3952 | 3959 | /* BPF specific declarations. */ |
| 3953 | 3960 | |
| ... | ... | @@ -3964,7 +3971,7 @@ enum |
| 3964 | 3971 | #define R_METAG_RELBRANCH	4 |
| 3965 | 3972 | #define R_METAG_GETSETOFF	5 |
| 3966 | 3973 | |
| 3967 | /* Backward compatability */ | |
| 3974 | /* Backward compatibility */ | |
| 3968 | 3975 | #define R_METAG_REG32OP1	6 |
| 3969 | 3976 | #define R_METAG_REG32OP2	7 |
| 3970 | 3977 | #define R_METAG_REG32OP3	8 |
| ... | ... | @@ -4027,6 +4034,72 @@ enum |
| 4027 | 4034 | #define R_NDS32_TLS_TPOFF	102 |
| 4028 | 4035 | #define R_NDS32_TLS_DESC	119 |
| 4029 | 4036 | |
| 4030 | __END_DECLS | |
| 4037 | /* ARCompact/ARCv2 specific relocs. */ | |
| 4038 | #define R_ARC_NONE		0x0 | |
| 4039 | #define R_ARC_8			0x1 | |
| 4040 | #define R_ARC_16		0x2 | |
| 4041 | #define R_ARC_24		0x3 | |
| 4042 | #define R_ARC_32		0x4 | |
| 4043 | #define R_ARC_B26		0x5 | |
| 4044 | #define R_ARC_B22_PCREL		0x6 | |
| 4045 | #define R_ARC_H30		0x7 | |
| 4046 | #define R_ARC_N8		0x8 | |
| 4047 | #define R_ARC_N16		0x9 | |
| 4048 | #define R_ARC_N24		0xA | |
| 4049 | #define R_ARC_N32		0xB | |
| 4050 | #define R_ARC_SDA		0xC | |
| 4051 | #define R_ARC_SECTOFF		0xD | |
| 4052 | #define R_ARC_S21H_PCREL	0xE | |
| 4053 | #define R_ARC_S21W_PCREL	0xF | |
| 4054 | #define R_ARC_S25H_PCREL	0x10 | |
| 4055 | #define R_ARC_S25W_PCREL	0x11 | |
| 4056 | #define R_ARC_SDA32		0x12 | |
| 4057 | #define R_ARC_SDA_LDST		0x13 | |
| 4058 | #define R_ARC_SDA_LDST1		0x14 | |
| 4059 | #define R_ARC_SDA_LDST2		0x15 | |
| 4060 | #define R_ARC_SDA16_LD		0x16 | |
| 4061 | #define R_ARC_SDA16_LD1		0x17 | |
| 4062 | #define R_ARC_SDA16_LD2		0x18 | |
| 4063 | #define R_ARC_S13_PCREL		0x19 | |
| 4064 | #define R_ARC_W			0x1A | |
| 4065 | #define R_ARC_32_ME		0x1B | |
| 4066 | #define R_ARC_N32_ME		0x1C | |
| 4067 | #define R_ARC_SECTOFF_ME	0x1D | |
| 4068 | #define R_ARC_SDA32_ME		0x1E | |
| 4069 | #define R_ARC_W_ME		0x1F | |
| 4070 | #define R_ARC_H30_ME		0x20 | |
| 4071 | #define R_ARC_SECTOFF_U8	0x21 | |
| 4072 | #define R_ARC_SECTOFF_S9	0x22 | |
| 4073 | #define R_AC_SECTOFF_U8		0x23 | |
| 4074 | #define R_AC_SECTOFF_U8_1	0x24 | |
| 4075 | #define R_AC_SECTOFF_U8_2	0x25 | |
| 4076 | #define R_AC_SECTOFF_S9		0x26 | |
| 4077 | #define R_AC_SECTOFF_S9_1	0x27 | |
| 4078 | #define R_AC_SECTOFF_S9_2	0x28 | |
| 4079 | #define R_ARC_SECTOFF_ME_1	0x29 | |
| 4080 | #define R_ARC_SECTOFF_ME_2	0x2A | |
| 4081 | #define R_ARC_SECTOFF_1		0x2B | |
| 4082 | #define R_ARC_SECTOFF_2		0x2C | |
| 4083 | #define R_ARC_PC32		0x32 | |
| 4084 | #define R_ARC_GOTPC32		0x33 | |
| 4085 | #define R_ARC_PLT32		0x34 | |
| 4086 | #define R_ARC_COPY		0x35 | |
| 4087 | #define R_ARC_GLOB_DAT		0x36 | |
| 4088 | #define R_ARC_JUMP_SLOT		0x37 | |
| 4089 | #define R_ARC_RELATIVE		0x38 | |
| 4090 | #define R_ARC_GOTOFF		0x39 | |
| 4091 | #define R_ARC_GOTPC		0x3A | |
| 4092 | #define R_ARC_GOT32		0x3B | |
| 4093 | ||
| 4094 | #define R_ARC_TLS_DTPMOD	0x42 | |
| 4095 | #define R_ARC_TLS_DTPOFF	0x43 | |
| 4096 | #define R_ARC_TLS_TPOFF		0x44 | |
| 4097 | #define R_ARC_TLS_GD_GOT	0x45 | |
| 4098 | #define R_ARC_TLS_GD_LD	 0x46 | |
| 4099 | #define R_ARC_TLS_GD_CALL	0x47 | |
| 4100 | #define R_ARC_TLS_IE_GOT	0x48 | |
| 4101 | #define R_ARC_TLS_DTPOFF_S9	0x4a | |
| 4102 | #define R_ARC_TLS_LE_S9		0x4a | |
| 4103 | #define R_ARC_TLS_LE_32		0x4b | |
| 4031 | 4104 | |
| 4032 | 4105 | #endif	/* elf.h */ |
lib/libc/glibc/include/bits/cpu-set.h+8| ... | ... | @@ -1 +1,9 @@ |
| 1 | #ifndef _BITS_CPU_SET_H | |
| 1 | 2 | #include <posix/bits/cpu-set.h> |
| 3 | ||
| 4 | #ifndef _ISOMAC | |
| 5 | int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp); | |
| 6 | libc_hidden_proto (__sched_cpucount) | |
| 7 | #endif | |
| 8 | ||
| 9 | #endif /* _BITS_CPU_SET_H */ |
lib/libc/glibc/include/errno.h created+45| ... | ... | @@ -0,0 +1,45 @@ |
| 1 | #ifndef _ERRNO_H | |
| 2 | #include <stdlib/errno.h> | |
| 3 | #if !defined _ISOMAC && !defined __ASSEMBLER__ | |
| 4 | ||
| 5 | # if IS_IN (rtld) | |
| 6 | # include <dl-sysdep.h> | |
| 7 | # ifndef RTLD_PRIVATE_ERRNO | |
| 8 | # error "dl-sysdep.h must define RTLD_PRIVATE_ERRNO!" | |
| 9 | # endif | |
| 10 | # else | |
| 11 | # define RTLD_PRIVATE_ERRNO	0 | |
| 12 | # endif | |
| 13 | ||
| 14 | # if RTLD_PRIVATE_ERRNO | |
| 15 | /* The dynamic linker uses its own private errno variable. | |
| 16 | All access to errno inside the dynamic linker is serialized, | |
| 17 | so a single (hidden) global variable is all it needs. */ | |
| 18 | ||
| 19 | # undef errno | |
| 20 | # define errno rtld_errno | |
| 21 | extern int rtld_errno attribute_hidden; | |
| 22 | ||
| 23 | # elif IS_IN_LIB && !IS_IN (rtld) | |
| 24 | ||
| 25 | # undef errno | |
| 26 | # if IS_IN (libc) | |
| 27 | # define errno __libc_errno | |
| 28 | # else | |
| 29 | # define errno errno		/* For #ifndef errno tests. */ | |
| 30 | # endif | |
| 31 | extern __thread int errno attribute_tls_model_ie; | |
| 32 | ||
| 33 | # endif	/* IS_IN_LIB */ | |
| 34 | ||
| 35 | # define __set_errno(val) (errno = (val)) | |
| 36 | ||
| 37 | extern int *__errno_location (void) __THROW __attribute_const__ | |
| 38 | # if RTLD_PRIVATE_ERRNO | |
| 39 | attribute_hidden | |
| 40 | # endif | |
| 41 | ; | |
| 42 | libc_hidden_proto (__errno_location) | |
| 43 | ||
| 44 | #endif /* !_ISOMAC && !__ASSEMBLER__ */ | |
| 45 | #endif /* !_ERRNO_H */ |
lib/libc/glibc/include/features.h deleted-492| ... | ... | @@ -1,492 +0,0 @@ |
| 1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_FEATURES_H | |
| 19 | #define	_FEATURES_H	1 | |
| 20 | ||
| 21 | /* These are defined by the user (or the compiler) | |
| 22 | to specify the desired environment: | |
| 23 | ||
| 24 | __STRICT_ANSI__	ISO Standard C. | |
| 25 | _ISOC99_SOURCE	Extensions to ISO C89 from ISO C99. | |
| 26 | _ISOC11_SOURCE	Extensions to ISO C99 from ISO C11. | |
| 27 | _ISOC2X_SOURCE	Extensions to ISO C99 from ISO C2X. | |
| 28 | __STDC_WANT_LIB_EXT2__ | |
| 29 | 			Extensions to ISO C99 from TR 27431-2:2010. | |
| 30 | __STDC_WANT_IEC_60559_BFP_EXT__ | |
| 31 | 			Extensions to ISO C11 from TS 18661-1:2014. | |
| 32 | __STDC_WANT_IEC_60559_FUNCS_EXT__ | |
| 33 | 			Extensions to ISO C11 from TS 18661-4:2015. | |
| 34 | __STDC_WANT_IEC_60559_TYPES_EXT__ | |
| 35 | 			Extensions to ISO C11 from TS 18661-3:2015. | |
| 36 | ||
| 37 | _POSIX_SOURCE	IEEE Std 1003.1. | |
| 38 | _POSIX_C_SOURCE	If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; | |
| 39 | 			if >=199309L, add IEEE Std 1003.1b-1993; | |
| 40 | 			if >=199506L, add IEEE Std 1003.1c-1995; | |
| 41 | 			if >=200112L, all of IEEE 1003.1-2004 | |
| 42 | 			if >=200809L, all of IEEE 1003.1-2008 | |
| 43 | _XOPEN_SOURCE	Includes POSIX and XPG things. Set to 500 if | |
| 44 | 			Single Unix conformance is wanted, to 600 for the | |
| 45 | 			sixth revision, to 700 for the seventh revision. | |
| 46 | _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions. | |
| 47 | _LARGEFILE_SOURCE	Some more functions for correct standard I/O. | |
| 48 | _LARGEFILE64_SOURCE	Additional functionality from LFS for large files. | |
| 49 | _FILE_OFFSET_BITS=N	Select default filesystem interface. | |
| 50 | _ATFILE_SOURCE	Additional *at interfaces. | |
| 51 | _GNU_SOURCE		All of the above, plus GNU extensions. | |
| 52 | _DEFAULT_SOURCE	The default set of features (taking precedence over | |
| 53 | 			__STRICT_ANSI__). | |
| 54 | ||
| 55 | _FORTIFY_SOURCE	Add security hardening to many library functions. | |
| 56 | 			Set to 1 or 2; 2 performs stricter checks than 1. | |
| 57 | ||
| 58 | _REENTRANT, _THREAD_SAFE | |
| 59 | 			Obsolete; equivalent to _POSIX_C_SOURCE=199506L. | |
| 60 | ||
| 61 | The `-ansi' switch to the GNU C compiler, and standards conformance | |
| 62 | options such as `-std=c99', define __STRICT_ANSI__. If none of | |
| 63 | these are defined, or if _DEFAULT_SOURCE is defined, the default is | |
| 64 | to have _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to | |
| 65 | 200809L, as well as enabling miscellaneous functions from BSD and | |
| 66 | SVID. If more than one of these are defined, they accumulate. For | |
| 67 | example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE together | |
| 68 | give you ISO C, 1003.1, and 1003.2, but nothing else. | |
| 69 | ||
| 70 | These are defined by this file and are used by the | |
| 71 | header files to decide what to declare or define: | |
| 72 | ||
| 73 | __GLIBC_USE (F)	Define things from feature set F. This is defined | |
| 74 | 			to 1 or 0; the subsequent macros are either defined | |
| 75 | 			or undefined, and those tests should be moved to | |
| 76 | 			__GLIBC_USE. | |
| 77 | __USE_ISOC11		Define ISO C11 things. | |
| 78 | __USE_ISOC99		Define ISO C99 things. | |
| 79 | __USE_ISOC95		Define ISO C90 AMD1 (C95) things. | |
| 80 | __USE_ISOCXX11	Define ISO C++11 things. | |
| 81 | __USE_POSIX		Define IEEE Std 1003.1 things. | |
| 82 | __USE_POSIX2		Define IEEE Std 1003.2 things. | |
| 83 | __USE_POSIX199309	Define IEEE Std 1003.1, and .1b things. | |
| 84 | __USE_POSIX199506	Define IEEE Std 1003.1, .1b, .1c and .1i things. | |
| 85 | __USE_XOPEN		Define XPG things. | |
| 86 | __USE_XOPEN_EXTENDED	Define X/Open Unix things. | |
| 87 | __USE_UNIX98		Define Single Unix V2 things. | |
| 88 | __USE_XOPEN2K Define XPG6 things. | |
| 89 | __USE_XOPEN2KXSI Define XPG6 XSI things. | |
| 90 | __USE_XOPEN2K8 Define XPG7 things. | |
| 91 | __USE_XOPEN2K8XSI Define XPG7 XSI things. | |
| 92 | __USE_LARGEFILE	Define correct standard I/O things. | |
| 93 | __USE_LARGEFILE64	Define LFS things with separate names. | |
| 94 | __USE_FILE_OFFSET64	Define 64bit interface as default. | |
| 95 | __USE_MISC		Define things from 4.3BSD or System V Unix. | |
| 96 | __USE_ATFILE		Define *at interfaces and AT_* constants for them. | |
| 97 | __USE_GNU		Define GNU extensions. | |
| 98 | __USE_FORTIFY_LEVEL	Additional security measures used, according to level. | |
| 99 | ||
| 100 | The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are | |
| 101 | defined by this file unconditionally. `__GNU_LIBRARY__' is provided | |
| 102 | only for compatibility. All new code should use the other symbols | |
| 103 | to test for features. | |
| 104 | ||
| 105 | All macros listed above as possibly being defined by this file are | |
| 106 | explicitly undefined if they are not explicitly defined. | |
| 107 | Feature-test macros that are not defined by the user or compiler | |
| 108 | but are implied by the other feature-test macros defined (or by the | |
| 109 | lack of any definitions) are defined by the file. | |
| 110 | ||
| 111 | ISO C feature test macros depend on the definition of the macro | |
| 112 | when an affected header is included, not when the first system | |
| 113 | header is included, and so they are handled in | |
| 114 | <bits/libc-header-start.h>, which does not have a multiple include | |
| 115 | guard. Feature test macros that can be handled from the first | |
| 116 | system header included are handled here. */ | |
| 117 | ||
| 118 | ||
| 119 | /* Undefine everything, so we get a clean slate. */ | |
| 120 | #undef	__USE_ISOC11 | |
| 121 | #undef	__USE_ISOC99 | |
| 122 | #undef	__USE_ISOC95 | |
| 123 | #undef	__USE_ISOCXX11 | |
| 124 | #undef	__USE_POSIX | |
| 125 | #undef	__USE_POSIX2 | |
| 126 | #undef	__USE_POSIX199309 | |
| 127 | #undef	__USE_POSIX199506 | |
| 128 | #undef	__USE_XOPEN | |
| 129 | #undef	__USE_XOPEN_EXTENDED | |
| 130 | #undef	__USE_UNIX98 | |
| 131 | #undef	__USE_XOPEN2K | |
| 132 | #undef	__USE_XOPEN2KXSI | |
| 133 | #undef	__USE_XOPEN2K8 | |
| 134 | #undef	__USE_XOPEN2K8XSI | |
| 135 | #undef	__USE_LARGEFILE | |
| 136 | #undef	__USE_LARGEFILE64 | |
| 137 | #undef	__USE_FILE_OFFSET64 | |
| 138 | #undef	__USE_MISC | |
| 139 | #undef	__USE_ATFILE | |
| 140 | #undef	__USE_GNU | |
| 141 | #undef	__USE_FORTIFY_LEVEL | |
| 142 | #undef	__KERNEL_STRICT_NAMES | |
| 143 | #undef	__GLIBC_USE_ISOC2X | |
| 144 | #undef	__GLIBC_USE_DEPRECATED_GETS | |
| 145 | #undef	__GLIBC_USE_DEPRECATED_SCANF | |
| 146 | ||
| 147 | /* Suppress kernel-name space pollution unless user expressedly asks | |
| 148 | for it. */ | |
| 149 | #ifndef _LOOSE_KERNEL_NAMES | |
| 150 | # define __KERNEL_STRICT_NAMES | |
| 151 | #endif | |
| 152 | ||
| 153 | /* Convenience macro to test the version of gcc. | |
| 154 | Use like this: | |
| 155 | #if __GNUC_PREREQ (2,8) | |
| 156 | ... code requiring gcc 2.8 or later ... | |
| 157 | #endif | |
| 158 | Note: only works for GCC 2.0 and later, because __GNUC_MINOR__ was | |
| 159 | added in 2.0. */ | |
| 160 | #if defined __GNUC__ && defined __GNUC_MINOR__ | |
| 161 | # define __GNUC_PREREQ(maj, min) \ | |
| 162 | 	((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) | |
| 163 | #else | |
| 164 | # define __GNUC_PREREQ(maj, min) 0 | |
| 165 | #endif | |
| 166 | ||
| 167 | /* Similarly for clang. Features added to GCC after version 4.2 may | |
| 168 | or may not also be available in clang, and clang's definitions of | |
| 169 | __GNUC(_MINOR)__ are fixed at 4 and 2 respectively. Not all such | |
| 170 | features can be queried via __has_extension/__has_feature. */ | |
| 171 | #if defined __clang_major__ && defined __clang_minor__ | |
| 172 | # define __glibc_clang_prereq(maj, min) \ | |
| 173 | ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min)) | |
| 174 | #else | |
| 175 | # define __glibc_clang_prereq(maj, min) 0 | |
| 176 | #endif | |
| 177 | ||
| 178 | /* Whether to use feature set F. */ | |
| 179 | #define __GLIBC_USE(F)	__GLIBC_USE_ ## F | |
| 180 | ||
| 181 | /* _BSD_SOURCE and _SVID_SOURCE are deprecated aliases for | |
| 182 | _DEFAULT_SOURCE. If _DEFAULT_SOURCE is present we do not | |
| 183 | issue a warning; the expectation is that the source is being | |
| 184 | transitioned to use the new macro. */ | |
| 185 | #if (defined _BSD_SOURCE || defined _SVID_SOURCE) \ | |
| 186 | && !defined _DEFAULT_SOURCE | |
| 187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" | |
| 188 | # undef _DEFAULT_SOURCE | |
| 189 | # define _DEFAULT_SOURCE	1 | |
| 190 | #endif | |
| 191 | ||
| 192 | /* If _GNU_SOURCE was defined by the user, turn on all the other features. */ | |
| 193 | #ifdef _GNU_SOURCE | |
| 194 | # undef _ISOC95_SOURCE | |
| 195 | # define _ISOC95_SOURCE	1 | |
| 196 | # undef _ISOC99_SOURCE | |
| 197 | # define _ISOC99_SOURCE	1 | |
| 198 | # undef _ISOC11_SOURCE | |
| 199 | # define _ISOC11_SOURCE	1 | |
| 200 | # undef _ISOC2X_SOURCE | |
| 201 | # define _ISOC2X_SOURCE	1 | |
| 202 | # undef _POSIX_SOURCE | |
| 203 | # define _POSIX_SOURCE	1 | |
| 204 | # undef _POSIX_C_SOURCE | |
| 205 | # define _POSIX_C_SOURCE	200809L | |
| 206 | # undef _XOPEN_SOURCE | |
| 207 | # define _XOPEN_SOURCE	700 | |
| 208 | # undef _XOPEN_SOURCE_EXTENDED | |
| 209 | # define _XOPEN_SOURCE_EXTENDED	1 | |
| 210 | # undef	 _LARGEFILE64_SOURCE | |
| 211 | # define _LARGEFILE64_SOURCE	1 | |
| 212 | # undef _DEFAULT_SOURCE | |
| 213 | # define _DEFAULT_SOURCE	1 | |
| 214 | # undef _ATFILE_SOURCE | |
| 215 | # define _ATFILE_SOURCE	1 | |
| 216 | #endif | |
| 217 | ||
| 218 | /* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined, | |
| 219 | define _DEFAULT_SOURCE. */ | |
| 220 | #if (defined _DEFAULT_SOURCE					\ | |
| 221 | || (!defined __STRICT_ANSI__				\ | |
| 222 | 	 && !defined _ISOC99_SOURCE && !defined _ISOC11_SOURCE	\ | |
| 223 | 	 && !defined _ISOC2X_SOURCE				\ | |
| 224 | 	 && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE	\ | |
| 225 | 	 && !defined _XOPEN_SOURCE)) | |
| 226 | # undef _DEFAULT_SOURCE | |
| 227 | # define _DEFAULT_SOURCE	1 | |
| 228 | #endif | |
| 229 | ||
| 230 | /* This is to enable the ISO C2X extension. */ | |
| 231 | #if (defined _ISOC2X_SOURCE \ | |
| 232 | || (defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L)) | |
| 233 | # define __GLIBC_USE_ISOC2X	1 | |
| 234 | #else | |
| 235 | # define __GLIBC_USE_ISOC2X	0 | |
| 236 | #endif | |
| 237 | ||
| 238 | /* This is to enable the ISO C11 extension. */ | |
| 239 | #if (defined _ISOC11_SOURCE || defined _ISOC2X_SOURCE \ | |
| 240 | || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) | |
| 241 | # define __USE_ISOC11	1 | |
| 242 | #endif | |
| 243 | ||
| 244 | /* This is to enable the ISO C99 extension. */ | |
| 245 | #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE			\ | |
| 246 | || defined _ISOC2X_SOURCE						\ | |
| 247 | || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) | |
| 248 | # define __USE_ISOC99	1 | |
| 249 | #endif | |
| 250 | ||
| 251 | /* This is to enable the ISO C90 Amendment 1:1995 extension. */ | |
| 252 | #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE			\ | |
| 253 | || defined _ISOC2X_SOURCE						\ | |
| 254 | || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L)) | |
| 255 | # define __USE_ISOC95	1 | |
| 256 | #endif | |
| 257 | ||
| 258 | #ifdef __cplusplus | |
| 259 | /* This is to enable compatibility for ISO C++17. */ | |
| 260 | # if __cplusplus >= 201703L | |
| 261 | # define __USE_ISOC11	1 | |
| 262 | # endif | |
| 263 | /* This is to enable compatibility for ISO C++11. | |
| 264 | Check the temporary macro for now, too. */ | |
| 265 | # if __cplusplus >= 201103L || defined __GXX_EXPERIMENTAL_CXX0X__ | |
| 266 | # define __USE_ISOCXX11	1 | |
| 267 | # define __USE_ISOC99	1 | |
| 268 | # endif | |
| 269 | #endif | |
| 270 | ||
| 271 | /* If none of the ANSI/POSIX macros are defined, or if _DEFAULT_SOURCE | |
| 272 | is defined, use POSIX.1-2008 (or another version depending on | |
| 273 | _XOPEN_SOURCE). */ | |
| 274 | #ifdef _DEFAULT_SOURCE | |
| 275 | # if !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE | |
| 276 | # define __USE_POSIX_IMPLICITLY	1 | |
| 277 | # endif | |
| 278 | # undef _POSIX_SOURCE | |
| 279 | # define _POSIX_SOURCE	1 | |
| 280 | # undef _POSIX_C_SOURCE | |
| 281 | # define _POSIX_C_SOURCE	200809L | |
| 282 | #endif | |
| 283 | ||
| 284 | #if ((!defined __STRICT_ANSI__					\ | |
| 285 | || (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 500))	\ | |
| 286 | && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE) | |
| 287 | # define _POSIX_SOURCE	1 | |
| 288 | # if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500 | |
| 289 | # define _POSIX_C_SOURCE	2 | |
| 290 | # elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 600 | |
| 291 | # define _POSIX_C_SOURCE	199506L | |
| 292 | # elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 700 | |
| 293 | # define _POSIX_C_SOURCE	200112L | |
| 294 | # else | |
| 295 | # define _POSIX_C_SOURCE	200809L | |
| 296 | # endif | |
| 297 | # define __USE_POSIX_IMPLICITLY	1 | |
| 298 | #endif | |
| 299 | ||
| 300 | /* Some C libraries once required _REENTRANT and/or _THREAD_SAFE to be | |
| 301 | defined in all multithreaded code. GNU libc has not required this | |
| 302 | for many years. We now treat them as compatibility synonyms for | |
| 303 | _POSIX_C_SOURCE=199506L, which is the earliest level of POSIX with | |
| 304 | comprehensive support for multithreaded code. Using them never | |
| 305 | lowers the selected level of POSIX conformance, only raises it. */ | |
| 306 | #if ((!defined _POSIX_C_SOURCE || (_POSIX_C_SOURCE - 0) < 199506L) \ | |
| 307 | && (defined _REENTRANT || defined _THREAD_SAFE)) | |
| 308 | # define _POSIX_SOURCE 1 | |
| 309 | # undef _POSIX_C_SOURCE | |
| 310 | # define _POSIX_C_SOURCE 199506L | |
| 311 | #endif | |
| 312 | ||
| 313 | #if (defined _POSIX_SOURCE					\ | |
| 314 | || (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 1)	\ | |
| 315 | || defined _XOPEN_SOURCE) | |
| 316 | # define __USE_POSIX	1 | |
| 317 | #endif | |
| 318 | ||
| 319 | #if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE | |
| 320 | # define __USE_POSIX2	1 | |
| 321 | #endif | |
| 322 | ||
| 323 | #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199309L | |
| 324 | # define __USE_POSIX199309	1 | |
| 325 | #endif | |
| 326 | ||
| 327 | #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199506L | |
| 328 | # define __USE_POSIX199506	1 | |
| 329 | #endif | |
| 330 | ||
| 331 | #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200112L | |
| 332 | # define __USE_XOPEN2K		1 | |
| 333 | # undef __USE_ISOC95 | |
| 334 | # define __USE_ISOC95		1 | |
| 335 | # undef __USE_ISOC99 | |
| 336 | # define __USE_ISOC99		1 | |
| 337 | #endif | |
| 338 | ||
| 339 | #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200809L | |
| 340 | # define __USE_XOPEN2K8		1 | |
| 341 | # undef _ATFILE_SOURCE | |
| 342 | # define _ATFILE_SOURCE	1 | |
| 343 | #endif | |
| 344 | ||
| 345 | #ifdef	_XOPEN_SOURCE | |
| 346 | # define __USE_XOPEN	1 | |
| 347 | # if (_XOPEN_SOURCE - 0) >= 500 | |
| 348 | # define __USE_XOPEN_EXTENDED	1 | |
| 349 | # define __USE_UNIX98	1 | |
| 350 | # undef _LARGEFILE_SOURCE | |
| 351 | # define _LARGEFILE_SOURCE	1 | |
| 352 | # if (_XOPEN_SOURCE - 0) >= 600 | |
| 353 | # if (_XOPEN_SOURCE - 0) >= 700 | |
| 354 | # define __USE_XOPEN2K8	1 | |
| 355 | # define __USE_XOPEN2K8XSI	1 | |
| 356 | # endif | |
| 357 | # define __USE_XOPEN2K	1 | |
| 358 | # define __USE_XOPEN2KXSI	1 | |
| 359 | # undef __USE_ISOC95 | |
| 360 | # define __USE_ISOC95		1 | |
| 361 | # undef __USE_ISOC99 | |
| 362 | # define __USE_ISOC99		1 | |
| 363 | # endif | |
| 364 | # else | |
| 365 | # ifdef _XOPEN_SOURCE_EXTENDED | |
| 366 | # define __USE_XOPEN_EXTENDED	1 | |
| 367 | # endif | |
| 368 | # endif | |
| 369 | #endif | |
| 370 | ||
| 371 | #ifdef _LARGEFILE_SOURCE | |
| 372 | # define __USE_LARGEFILE	1 | |
| 373 | #endif | |
| 374 | ||
| 375 | #ifdef _LARGEFILE64_SOURCE | |
| 376 | # define __USE_LARGEFILE64	1 | |
| 377 | #endif | |
| 378 | ||
| 379 | #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 | |
| 380 | # define __USE_FILE_OFFSET64	1 | |
| 381 | #endif | |
| 382 | ||
| 383 | #if defined _DEFAULT_SOURCE | |
| 384 | # define __USE_MISC	1 | |
| 385 | #endif | |
| 386 | ||
| 387 | #ifdef	_ATFILE_SOURCE | |
| 388 | # define __USE_ATFILE	1 | |
| 389 | #endif | |
| 390 | ||
| 391 | #ifdef	_GNU_SOURCE | |
| 392 | # define __USE_GNU	1 | |
| 393 | #endif | |
| 394 | ||
| 395 | #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 | |
| 396 | # if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0 | |
| 397 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O) | |
| 398 | # elif !__GNUC_PREREQ (4, 1) | |
| 399 | # warning _FORTIFY_SOURCE requires GCC 4.1 or later | |
| 400 | # elif _FORTIFY_SOURCE > 1 | |
| 401 | # define __USE_FORTIFY_LEVEL 2 | |
| 402 | # else | |
| 403 | # define __USE_FORTIFY_LEVEL 1 | |
| 404 | # endif | |
| 405 | #endif | |
| 406 | #ifndef __USE_FORTIFY_LEVEL | |
| 407 | # define __USE_FORTIFY_LEVEL 0 | |
| 408 | #endif | |
| 409 | ||
| 410 | /* The function 'gets' existed in C89, but is impossible to use | |
| 411 | safely. It has been removed from ISO C11 and ISO C++14. Note: for | |
| 412 | compatibility with various implementations of <cstdio>, this test | |
| 413 | must consider only the value of __cplusplus when compiling C++. */ | |
| 414 | #if defined __cplusplus ? __cplusplus >= 201402L : defined __USE_ISOC11 | |
| 415 | # define __GLIBC_USE_DEPRECATED_GETS 0 | |
| 416 | #else | |
| 417 | # define __GLIBC_USE_DEPRECATED_GETS 1 | |
| 418 | #endif | |
| 419 | ||
| 420 | /* GNU formerly extended the scanf functions with modified format | |
| 421 | specifiers %as, %aS, and %a[...] that allocate a buffer for the | |
| 422 | input using malloc. This extension conflicts with ISO C99, which | |
| 423 | defines %a as a standalone format specifier that reads a floating- | |
| 424 | point number; moreover, POSIX.1-2008 provides the same feature | |
| 425 | using the modifier letter 'm' instead (%ms, %mS, %m[...]). | |
| 426 | ||
| 427 | We now follow C99 unless GNU extensions are active and the compiler | |
| 428 | is specifically in C89 or C++98 mode (strict or not). For | |
| 429 | instance, with GCC, -std=gnu11 will have C99-compliant scanf with | |
| 430 | or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the | |
| 431 | old extension. */ | |
| 432 | #if (defined __USE_GNU							\ | |
| 433 | && (defined __cplusplus						\ | |
| 434 | 	 ? (__cplusplus < 201103L && !defined __GXX_EXPERIMENTAL_CXX0X__) \ | |
| 435 | 	 : (!defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L))) | |
| 436 | # define __GLIBC_USE_DEPRECATED_SCANF 1 | |
| 437 | #else | |
| 438 | # define __GLIBC_USE_DEPRECATED_SCANF 0 | |
| 439 | #endif | |
| 440 | ||
| 441 | /* Get definitions of __STDC_* predefined macros, if the compiler has | |
| 442 | not preincluded this header automatically. */ | |
| 443 | #include <stdc-predef.h> | |
| 444 | ||
| 445 | /* This macro indicates that the installed library is the GNU C Library. | |
| 446 | For historic reasons the value now is 6 and this will stay from now | |
| 447 | on. The use of this variable is deprecated. Use __GLIBC__ and | |
| 448 | __GLIBC_MINOR__ now (see below) when you want to test for a specific | |
| 449 | GNU C library version and use the values in <gnu/lib-names.h> to get | |
| 450 | the sonames of the shared libraries. */ | |
| 451 | #undef __GNU_LIBRARY__ | |
| 452 | #define __GNU_LIBRARY__ 6 | |
| 453 | ||
| 454 | /* Major and minor version number of the GNU C library package. Use | |
| 455 | these macros to test for features in specific releases. */ | |
| 456 | #define	__GLIBC__	2 | |
| 457 | #define	__GLIBC_MINOR__	31 | |
| 458 | ||
| 459 | #define __GLIBC_PREREQ(maj, min) \ | |
| 460 | 	((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) | |
| 461 | ||
| 462 | /* This is here only because every header file already includes this one. */ | |
| 463 | #ifndef __ASSEMBLER__ | |
| 464 | # ifndef _SYS_CDEFS_H | |
| 465 | # include <sys/cdefs.h> | |
| 466 | # endif | |
| 467 | ||
| 468 | /* If we don't have __REDIRECT, prototypes will be missing if | |
| 469 | __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */ | |
| 470 | # if defined __USE_FILE_OFFSET64 && !defined __REDIRECT | |
| 471 | # define __USE_LARGEFILE	1 | |
| 472 | # define __USE_LARGEFILE64	1 | |
| 473 | # endif | |
| 474 | ||
| 475 | #endif	/* !ASSEMBLER */ | |
| 476 | ||
| 477 | /* Decide whether we can define 'extern inline' functions in headers. */ | |
| 478 | #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \ | |
| 479 | && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \ | |
| 480 | && defined __extern_inline | |
| 481 | # define __USE_EXTERN_INLINES	1 | |
| 482 | #endif | |
| 483 | ||
| 484 | ||
| 485 | /* This is here only because every header file already includes this one. | |
| 486 | Get the definitions of all the appropriate `__stub_FUNCTION' symbols. | |
| 487 | <gnu/stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub | |
| 488 | that will always return failure (and set errno to ENOSYS). */ | |
| 489 | #include <gnu/stubs.h> | |
| 490 | ||
| 491 | ||
| 492 | #endif	/* features.h */ |
lib/libc/glibc/include/libc-modules.h+22-23| ... | ... | @@ -19,26 +19,25 @@ |
| 19 | 19 | #define MODULE_LIBS_BEGIN 17 |
| 20 | 20 | #define MODULE_rtld 18 |
| 21 | 21 | #define MODULE_libc 19 |
| 22 | #define MODULE_libnss_nis 20 | |
| 23 | #define MODULE_libBrokenLocale 21 | |
| 24 | #define MODULE_libpthread 22 | |
| 25 | #define MODULE_libthread_db 23 | |
| 26 | #define MODULE_libnss_nisplus 24 | |
| 27 | #define MODULE_libcrypt 25 | |
| 28 | #define MODULE_libdl 26 | |
| 29 | #define MODULE_libgcc_s 27 | |
| 30 | #define MODULE_libnss_test1 28 | |
| 31 | #define MODULE_libnsl 29 | |
| 32 | #define MODULE_libutil 30 | |
| 33 | #define MODULE_libnss_ldap 31 | |
| 34 | #define MODULE_libnss_test2 32 | |
| 35 | #define MODULE_libnss_dns 33 | |
| 36 | #define MODULE_libnss_compat 34 | |
| 37 | #define MODULE_libmvec 35 | |
| 38 | #define MODULE_libresolv 36 | |
| 39 | #define MODULE_libnss_db 37 | |
| 40 | #define MODULE_libm 38 | |
| 41 | #define MODULE_libnss_files 39 | |
| 42 | #define MODULE_librt 40 | |
| 43 | #define MODULE_libnss_hesiod 41 | |
| 44 | #define MODULE_libanl 42 | |
| 22 | #define MODULE_libBrokenLocale 20 | |
| 23 | #define MODULE_libpthread 21 | |
| 24 | #define MODULE_libthread_db 22 | |
| 25 | #define MODULE_libcrypt 23 | |
| 26 | #define MODULE_libdl 24 | |
| 27 | #define MODULE_libgcc_s 25 | |
| 28 | #define MODULE_libnss_test1 26 | |
| 29 | #define MODULE_libnsl 27 | |
| 30 | #define MODULE_libc_malloc_debug 28 | |
| 31 | #define MODULE_libutil 29 | |
| 32 | #define MODULE_libnss_ldap 30 | |
| 33 | #define MODULE_libnss_test2 31 | |
| 34 | #define MODULE_libnss_dns 32 | |
| 35 | #define MODULE_libnss_compat 33 | |
| 36 | #define MODULE_libmvec 34 | |
| 37 | #define MODULE_libresolv 35 | |
| 38 | #define MODULE_libnss_db 36 | |
| 39 | #define MODULE_libm 37 | |
| 40 | #define MODULE_libnss_files 38 | |
| 41 | #define MODULE_librt 39 | |
| 42 | #define MODULE_libnss_hesiod 40 | |
| 43 | #define MODULE_libanl 41 |
lib/libc/glibc/include/libc-pointer-arith.h+4-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Helper macros for pointer arithmetic. |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -37,6 +37,9 @@ |
| 37 | 37 | /* Cast an integer or a pointer VAL to integer with proper type. */ |
| 38 | 38 | # define cast_to_integer(val) ((__integer_if_pointer_type (val)) (val)) |
| 39 | 39 | |
| 40 | /* Cast an integer VAL to void * pointer. */ | |
| 41 | # define cast_to_pointer(val) ((void *) (uintptr_t) (val)) | |
| 42 | ||
| 40 | 43 | /* Align a value by rounding down to closest size. |
| 41 | 44 | e.g. Using size of 4096, we get this behavior: |
| 42 | 45 | 	{4095, 4096, 4097} = {0, 4096, 4096}. */ |
lib/libc/glibc/include/libc-symbols.h+62-83| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Support macros for making weak and strong aliases for symbols, |
| 2 | 2 | and for using symbol sets and linker warnings with GNU ld. |
| 3 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -84,6 +84,9 @@ |
| 84 | 84 | |
| 85 | 85 | #include <config.h> |
| 86 | 86 | |
| 87 | /* Obtain the definition of symbol_version_reference. */ | |
| 88 | #include <libc-symver.h> | |
| 89 | ||
| 87 | 90 | /* When PIC is defined and SHARED isn't defined, we are building PIE |
| 88 | 91 | by default. */ |
| 89 | 92 | #if defined PIC && !defined SHARED |
| ... | ... | @@ -307,7 +310,7 @@ for linking") |
| 307 | 310 | |
| 308 | 311 | /* Resource freeing functions from libc.so go in this section. */ |
| 309 | 312 | #define __libc_freeres_fn_section \ |
| 310 | __attribute__ ((section ("__libc_freeres_fn"))) | |
| 313 | __attribute__ ((__used__, section ("__libc_freeres_fn"))) | |
| 311 | 314 | |
| 312 | 315 | /* Resource freeing functions for libc.so. */ |
| 313 | 316 | #define libc_freeres_fn(name) \ |
| ... | ... | @@ -349,6 +352,12 @@ for linking") |
| 349 | 352 | |
| 350 | 353 | */ |
| 351 | 354 | |
| 355 | #ifdef HAVE_GNU_RETAIN | |
| 356 | # define attribute_used_retain __attribute__ ((__used__, __retain__)) | |
| 357 | #else | |
| 358 | # define attribute_used_retain __attribute__ ((__used__)) | |
| 359 | #endif | |
| 360 | ||
| 352 | 361 | /* Symbol set support macros. */ |
| 353 | 362 | |
| 354 | 363 | /* Make SYMBOL, which is in the text segment, an element of SET. */ |
| ... | ... | @@ -364,12 +373,12 @@ for linking") |
| 364 | 373 | /* When building a shared library, make the set section writable, |
| 365 | 374 | because it will need to be relocated at run time anyway. */ |
| 366 | 375 | # define _elf_set_element(set, symbol) \ |
| 367 | static const void *__elf_set_##set##_element_##symbol##__ \ | |
| 368 | __attribute__ ((used, section (#set))) = &(symbol) | |
| 376 | static const void *__elf_set_##set##_element_##symbol##__ \ | |
| 377 | attribute_used_retain __attribute__ ((section (#set))) = &(symbol) | |
| 369 | 378 | #else |
| 370 | 379 | # define _elf_set_element(set, symbol) \ |
| 371 | static const void *const __elf_set_##set##_element_##symbol##__ \ | |
| 372 | __attribute__ ((used, section (#set))) = &(symbol) | |
| 380 | static const void *const __elf_set_##set##_element_##symbol##__ \ | |
| 381 | attribute_used_retain __attribute__ ((section (#set))) = &(symbol) | |
| 373 | 382 | #endif |
| 374 | 383 | |
| 375 | 384 | /* Define SET as a symbol set. This may be required (it is in a.out) to |
| ... | ... | @@ -396,32 +405,27 @@ for linking") |
| 396 | 405 | past the last element in SET. */ |
| 397 | 406 | #define symbol_set_end_p(set, ptr) ((ptr) >= (void *const *) &__stop_##set) |
| 398 | 407 | |
| 399 | /* Use symbol_version_reference to specify the version a symbol | |
| 400 | reference should link to. Use symbol_version or | |
| 401 | default_symbol_version for the definition of a versioned symbol. | |
| 402 | The difference is that the latter is a no-op in non-shared | |
| 403 | builds. */ | |
| 404 | #ifdef __ASSEMBLER__ | |
| 405 | # define symbol_version_reference(real, name, version) \ | |
| 406 | .symver real, name##@##version | |
| 407 | #else /* !__ASSEMBLER__ */ | |
| 408 | # define symbol_version_reference(real, name, version) \ | |
| 409 | __asm__ (".symver " #real "," #name "@" #version) | |
| 410 | #endif | |
| 411 | ||
| 412 | 408 | #ifdef SHARED |
| 413 | 409 | # define symbol_version(real, name, version) \ |
| 414 | 410 | symbol_version_reference(real, name, version) |
| 415 | 411 | # define default_symbol_version(real, name, version) \ |
| 416 | 412 | _default_symbol_version(real, name, version) |
| 413 | /* See <libc-symver.h>. */ | |
| 417 | 414 | # ifdef __ASSEMBLER__ |
| 418 | 415 | # define _default_symbol_version(real, name, version) \ |
| 419 | .symver real, name##@##@##version | |
| 416 | _set_symbol_version (real, name@@version) | |
| 420 | 417 | # else |
| 421 | 418 | # define _default_symbol_version(real, name, version) \ |
| 422 | __asm__ (".symver " #real "," #name "@@" #version) | |
| 419 | _set_symbol_version (real, #name "@@" #version) | |
| 423 | 420 | # endif |
| 424 | #else | |
| 421 | ||
| 422 | /* Evalutes to a string literal for VERSION in LIB. */ | |
| 423 | # define symbol_version_string(lib, version) \ | |
| 424 | _symbol_version_stringify_1 (VERSION_##lib##_##version) | |
| 425 | # define _symbol_version_stringify_1(arg) _symbol_version_stringify_2 (arg) | |
| 426 | # define _symbol_version_stringify_2(arg) #arg | |
| 427 | ||
| 428 | #else /* !SHARED */ | |
| 425 | 429 | # define symbol_version(real, name, version) |
| 426 | 430 | # define default_symbol_version(real, name, version) \ |
| 427 | 431 | strong_alias(real, name) |
| ... | ... | @@ -618,12 +622,7 @@ for linking") |
| 618 | 622 | # define libc_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs) |
| 619 | 623 | # define libc_hidden_def(name) hidden_def (name) |
| 620 | 624 | # define libc_hidden_weak(name) hidden_weak (name) |
| 621 | # ifdef LINK_OBSOLETE_RPC | |
| 622 | /* libc_hidden_nolink_sunrpc should only get used in sunrpc code. */ | |
| 623 | # define libc_hidden_nolink_sunrpc(name, version) hidden_def (name) | |
| 624 | # else | |
| 625 | # define libc_hidden_nolink_sunrpc(name, version) hidden_nolink (name, libc, version) | |
| 626 | # endif | |
| 625 | # define libc_hidden_nolink_sunrpc(name, version) hidden_nolink (name, libc, version) | |
| 627 | 626 | # define libc_hidden_ver(local, name) hidden_ver (local, name) |
| 628 | 627 | # define libc_hidden_data_def(name) hidden_data_def (name) |
| 629 | 628 | # define libc_hidden_tls_def(name) hidden_tls_def (name) |
| ... | ... | @@ -641,7 +640,7 @@ for linking") |
| 641 | 640 | # define libc_hidden_data_ver(local, name) |
| 642 | 641 | #endif |
| 643 | 642 | |
| 644 | #if IS_IN (rtld) && !defined NO_RTLD_HIDDEN | |
| 643 | #if IS_IN (rtld) | |
| 645 | 644 | # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) |
| 646 | 645 | # define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs) |
| 647 | 646 | # define rtld_hidden_def(name) hidden_def (name) |
| ... | ... | @@ -730,6 +729,29 @@ for linking") |
| 730 | 729 | # define libresolv_hidden_data_ver(local, name) |
| 731 | 730 | #endif |
| 732 | 731 | |
| 732 | #if IS_IN (libpthread) | |
| 733 | # define libpthread_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) | |
| 734 | # define libpthread_hidden_tls_proto(name, attrs...) \ | |
| 735 | hidden_tls_proto (name, ##attrs) | |
| 736 | # define libpthread_hidden_def(name) hidden_def (name) | |
| 737 | # define libpthread_hidden_weak(name) hidden_weak (name) | |
| 738 | # define libpthread_hidden_ver(local, name) hidden_ver (local, name) | |
| 739 | # define libpthread_hidden_data_def(name) hidden_data_def (name) | |
| 740 | # define libpthread_hidden_tls_def(name) hidden_tls_def (name) | |
| 741 | # define libpthread_hidden_data_weak(name) hidden_data_weak (name) | |
| 742 | # define libpthread_hidden_data_ver(local, name) hidden_data_ver (local, name) | |
| 743 | #else | |
| 744 | # define libpthread_hidden_proto(name, attrs...) | |
| 745 | # define libpthread_hidden_tls_proto(name, attrs...) | |
| 746 | # define libpthread_hidden_def(name) | |
| 747 | # define libpthread_hidden_weak(name) | |
| 748 | # define libpthread_hidden_ver(local, name) | |
| 749 | # define libpthread_hidden_data_def(name) | |
| 750 | # define libpthread_hidden_tls_def(name) | |
| 751 | # define libpthread_hidden_data_weak(name) | |
| 752 | # define libpthread_hidden_data_ver(local, name) | |
| 753 | #endif | |
| 754 | ||
| 733 | 755 | #if IS_IN (librt) |
| 734 | 756 | # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) |
| 735 | 757 | # define librt_hidden_tls_proto(name, attrs...) \ |
| ... | ... | @@ -776,40 +798,11 @@ for linking") |
| 776 | 798 | # define libdl_hidden_data_ver(local, name) |
| 777 | 799 | #endif |
| 778 | 800 | |
| 779 | #if IS_IN (libnss_files) | |
| 780 | # define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) | |
| 781 | # define libnss_files_hidden_tls_proto(name, attrs...) \ | |
| 782 | hidden_tls_proto (name, ##attrs) | |
| 783 | # define libnss_files_hidden_def(name) hidden_def (name) | |
| 784 | # define libnss_files_hidden_weak(name) hidden_weak (name) | |
| 785 | # define libnss_files_hidden_ver(local, name) hidden_ver (local, name) | |
| 786 | # define libnss_files_hidden_data_def(name) hidden_data_def (name) | |
| 787 | # define libnss_files_hidden_tls_def(name) hidden_tls_def (name) | |
| 788 | # define libnss_files_hidden_data_weak(name) hidden_data_weak (name) | |
| 789 | # define libnss_files_hidden_data_ver(local, name) hidden_data_ver(local, name) | |
| 790 | #else | |
| 791 | # define libnss_files_hidden_proto(name, attrs...) | |
| 792 | # define libnss_files_hidden_tls_proto(name, attrs...) | |
| 793 | # define libnss_files_hidden_def(name) | |
| 794 | # define libnss_files_hidden_weak(name) | |
| 795 | # define libnss_files_hidden_ver(local, name) | |
| 796 | # define libnss_files_hidden_data_def(name) | |
| 797 | # define libnss_files_hidden_tls_def(name) | |
| 798 | # define libnss_files_hidden_data_weak(name) | |
| 799 | # define libnss_files_hidden_data_ver(local, name) | |
| 800 | #endif | |
| 801 | ||
| 802 | 801 | #if IS_IN (libnsl) |
| 803 | 802 | # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) |
| 804 | 803 | # define libnsl_hidden_tls_proto(name, attrs...) \ |
| 805 | 804 | hidden_tls_proto (name, ##attrs) |
| 806 | # ifdef LINK_OBSOLETE_NSL | |
| 807 | /* libnsl_hidden_nolink should only get used in libnsl code. */ | |
| 808 | # define libnsl_hidden_nolink_def(name, version) libnsl_hidden_def (name) | |
| 809 | # else | |
| 810 | # define libnsl_hidden_nolink_def(name, version) hidden_nolink (name, libnsl, version) | |
| 811 | # endif | |
| 812 | # define libnsl_hidden_def(name) hidden_def (name) | |
| 805 | # define libnsl_hidden_nolink_def(name, version) hidden_nolink (name, libnsl, version) | |
| 813 | 806 | # define libnsl_hidden_weak(name) hidden_weak (name) |
| 814 | 807 | # define libnsl_hidden_ver(local, name) hidden_ver (local, name) |
| 815 | 808 | # define libnsl_hidden_data_def(name) hidden_data_def (name) |
| ... | ... | @@ -819,7 +812,6 @@ for linking") |
| 819 | 812 | #else |
| 820 | 813 | # define libnsl_hidden_proto(name, attrs...) |
| 821 | 814 | # define libnsl_hidden_tls_proto(name, attrs...) |
| 822 | # define libnsl_hidden_def(name) | |
| 823 | 815 | # define libnsl_hidden_weak(name) |
| 824 | 816 | # define libnsl_hidden_ver(local, name) |
| 825 | 817 | # define libnsl_hidden_data_def(name) |
| ... | ... | @@ -828,33 +820,12 @@ for linking") |
| 828 | 820 | # define libnsl_hidden_data_ver(local, name) |
| 829 | 821 | #endif |
| 830 | 822 | |
| 831 | #if IS_IN (libnss_nisplus) | |
| 832 | # define libnss_nisplus_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) | |
| 833 | # define libnss_nisplus_hidden_tls_proto(name, attrs...) \ | |
| 834 | hidden_tls_proto (name, ##attrs) | |
| 835 | # define libnss_nisplus_hidden_def(name) hidden_def (name) | |
| 836 | # define libnss_nisplus_hidden_weak(name) hidden_weak (name) | |
| 837 | # define libnss_nisplus_hidden_ver(local, name) hidden_ver (local, name) | |
| 838 | # define libnss_nisplus_hidden_data_def(name) hidden_data_def (name) | |
| 839 | # define libnss_nisplus_hidden_tls_def(name) hidden_tls_def (name) | |
| 840 | # define libnss_nisplus_hidden_data_weak(name) hidden_data_weak (name) | |
| 841 | # define libnss_nisplus_hidden_data_ver(local, name) hidden_data_ver (local, name) | |
| 842 | #else | |
| 843 | # define libnss_nisplus_hidden_proto(name, attrs...) | |
| 844 | # define libnss_nisplus_hidden_tls_proto(name, attrs...) | |
| 845 | # define libnss_nisplus_hidden_def(name) | |
| 846 | # define libnss_nisplus_hidden_weak(name) | |
| 847 | # define libnss_nisplus_hidden_ver(local, name) | |
| 848 | # define libnss_nisplus_hidden_data_def(name) | |
| 849 | # define libnss_nisplus_hidden_tls_def(name) | |
| 850 | # define libnss_nisplus_hidden_data_weak(name) | |
| 851 | # define libnss_nisplus_hidden_data_ver(local, name) | |
| 852 | #endif | |
| 853 | ||
| 854 | 823 | #define libc_hidden_builtin_proto(name, attrs...) libc_hidden_proto (name, ##attrs) |
| 855 | 824 | #define libc_hidden_builtin_def(name) libc_hidden_def (name) |
| 856 | 825 | #define libc_hidden_builtin_weak(name) libc_hidden_weak (name) |
| 857 | 826 | #define libc_hidden_builtin_ver(local, name) libc_hidden_ver (local, name) |
| 827 | ||
| 828 | #define libc_hidden_ldbl_proto(name, attrs...) libc_hidden_proto (name, ##attrs) | |
| 858 | 829 | #ifdef __ASSEMBLER__ |
| 859 | 830 | # define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name) |
| 860 | 831 | #endif |
| ... | ... | @@ -882,6 +853,14 @@ for linking") |
| 882 | 853 | # define libutil_hidden_data_ver(local, name) |
| 883 | 854 | #endif |
| 884 | 855 | |
| 856 | #if IS_IN (libanl) | |
| 857 | # define libanl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) | |
| 858 | # define libanl_hidden_def(name) hidden_def (name) | |
| 859 | #else | |
| 860 | # define libanl_hidden_proto(name, attrs...) | |
| 861 | # define libanl_hidden_def(name) | |
| 862 | #endif | |
| 863 | ||
| 885 | 864 | /* Get some dirty hacks. */ |
| 886 | 865 | #include <symbol-hacks.h> |
| 887 | 866 |
lib/libc/glibc/include/pthread.h+11| ... | ... | @@ -8,9 +8,20 @@ extern int __pthread_barrier_init (pthread_barrier_t *__restrict __barrier, |
| 8 | 8 | 				 const pthread_barrierattr_t *__restrict |
| 9 | 9 | 				 __attr, unsigned int __count) |
| 10 | 10 | __THROW __nonnull ((1)); |
| 11 | #if PTHREAD_IN_LIBC | |
| 12 | libc_hidden_proto (__pthread_barrier_init) | |
| 13 | #endif | |
| 11 | 14 | extern int __pthread_barrier_wait (pthread_barrier_t *__barrier) |
| 12 | 15 | __THROWNL __nonnull ((1)); |
| 16 | #if PTHREAD_IN_LIBC | |
| 17 | libc_hidden_proto (__pthread_barrier_wait) | |
| 18 | #endif | |
| 13 | 19 | |
| 14 | 20 | /* This function is called to initialize the pthread library. */ |
| 15 | 21 | extern void __pthread_initialize (void) __attribute__ ((weak)); |
| 22 | ||
| 23 | extern int __pthread_kill (pthread_t threadid, int signo); | |
| 24 | ||
| 25 | extern pthread_t __pthread_self (void); | |
| 26 | ||
| 16 | 27 | #endif |
lib/libc/glibc/include/signal.h+15-2| ... | ... | @@ -2,6 +2,8 @@ |
| 2 | 2 | # include <signal/signal.h> |
| 3 | 3 | |
| 4 | 4 | # ifndef _ISOMAC |
| 5 | # include <sigsetops.h> | |
| 6 | ||
| 5 | 7 | libc_hidden_proto (sigemptyset) |
| 6 | 8 | libc_hidden_proto (sigfillset) |
| 7 | 9 | libc_hidden_proto (sigaddset) |
| ... | ... | @@ -12,7 +14,10 @@ libc_hidden_proto (__sigpause) |
| 12 | 14 | libc_hidden_proto (raise) |
| 13 | 15 | libc_hidden_proto (__libc_current_sigrtmin) |
| 14 | 16 | libc_hidden_proto (__libc_current_sigrtmax) |
| 15 | libc_hidden_proto (_sys_siglist) | |
| 17 | extern const char * const __sys_siglist[_NSIG]; | |
| 18 | libc_hidden_proto (__sys_siglist) | |
| 19 | extern const char * const __sys_sigabbrev[_NSIG]; | |
| 20 | libc_hidden_proto (__sys_sigabbrev) | |
| 16 | 21 | |
| 17 | 22 | /* Now define the internal interfaces. */ |
| 18 | 23 | extern __sighandler_t __bsd_signal (int __sig, __sighandler_t __handler); |
| ... | ... | @@ -33,6 +38,14 @@ extern int __sigwait (const sigset_t *__set, int *__sig); |
| 33 | 38 | libc_hidden_proto (__sigwait) |
| 34 | 39 | extern int __sigwaitinfo (const sigset_t *__set, siginfo_t *__info); |
| 35 | 40 | libc_hidden_proto (__sigwaitinfo) |
| 41 | #if __TIMESIZE == 64 | |
| 42 | # define __sigtimedwait64 __sigtimedwait | |
| 43 | #else | |
| 44 | # include <struct___timespec64.h> | |
| 45 | extern int __sigtimedwait64 (const sigset_t *__set, siginfo_t *__info, | |
| 46 | 			 const struct __timespec64 *__timeout); | |
| 47 | libc_hidden_proto (__sigtimedwait64) | |
| 48 | #endif | |
| 36 | 49 | extern int __sigtimedwait (const sigset_t *__set, siginfo_t *__info, |
| 37 | 50 | 			 const struct timespec *__timeout); |
| 38 | 51 | libc_hidden_proto (__sigtimedwait) |
| ... | ... | @@ -54,7 +67,7 @@ extern int __xpg_sigpause (int sig); |
| 54 | 67 | /* Allocate real-time signal with highest/lowest available priority. */ |
| 55 | 68 | extern int __libc_allocate_rtsig (int __high); |
| 56 | 69 | |
| 57 | # if IS_IN (rtld) && !defined NO_RTLD_HIDDEN | |
| 70 | # if IS_IN (rtld) | |
| 58 | 71 | extern __typeof (__sigaction) __sigaction attribute_hidden; |
| 59 | 72 | extern __typeof (__libc_sigaction) __libc_sigaction attribute_hidden; |
| 60 | 73 | # endif |
lib/libc/glibc/include/stap-probe.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Macros for defining Systemtap <sys/sdt.h> static probe points. |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/include/stdc-predef.h deleted-60| ... | ... | @@ -1,60 +0,0 @@ |
| 1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_STDC_PREDEF_H | |
| 19 | #define	_STDC_PREDEF_H	1 | |
| 20 | ||
| 21 | /* This header is separate from features.h so that the compiler can | |
| 22 | include it implicitly at the start of every compilation. It must | |
| 23 | not itself include <features.h> or any other header that includes | |
| 24 | <features.h> because the implicit include comes before any feature | |
| 25 | test macros that may be defined in a source file before it first | |
| 26 | explicitly includes a system header. GCC knows the name of this | |
| 27 | header in order to preinclude it. */ | |
| 28 | ||
| 29 | /* glibc's intent is to support the IEC 559 math functionality, real | |
| 30 | and complex. If the GCC (4.9 and later) predefined macros | |
| 31 | specifying compiler intent are available, use them to determine | |
| 32 | whether the overall intent is to support these features; otherwise, | |
| 33 | presume an older compiler has intent to support these features and | |
| 34 | define these macros by default. */ | |
| 35 | ||
| 36 | #ifdef __GCC_IEC_559 | |
| 37 | # if __GCC_IEC_559 > 0 | |
| 38 | # define __STDC_IEC_559__		1 | |
| 39 | # endif | |
| 40 | #else | |
| 41 | # define __STDC_IEC_559__		1 | |
| 42 | #endif | |
| 43 | ||
| 44 | #ifdef __GCC_IEC_559_COMPLEX | |
| 45 | # if __GCC_IEC_559_COMPLEX > 0 | |
| 46 | # define __STDC_IEC_559_COMPLEX__	1 | |
| 47 | # endif | |
| 48 | #else | |
| 49 | # define __STDC_IEC_559_COMPLEX__	1 | |
| 50 | #endif | |
| 51 | ||
| 52 | /* wchar_t uses Unicode 10.0.0. Version 10.0 of the Unicode Standard is | |
| 53 | synchronized with ISO/IEC 10646:2017, fifth edition, plus | |
| 54 | the following additions from Amendment 1 to the fifth edition: | |
| 55 | - 56 emoji characters | |
| 56 | - 285 hentaigana | |
| 57 | - 3 additional Zanabazar Square characters */ | |
| 58 | #define __STDC_ISO_10646__		201706L | |
| 59 | ||
| 60 | #endif |
lib/libc/glibc/include/stdlib.h+20-5| ... | ... | @@ -3,12 +3,23 @@ |
| 3 | 3 | #ifndef _ISOMAC |
| 4 | 4 | # include <stddef.h> |
| 5 | 5 | #endif |
| 6 | ||
| 7 | /* Workaround PR90731 with GCC 9 when using ldbl redirects in C++. */ | |
| 8 | #include <bits/floatn.h> | |
| 9 | #if defined __cplusplus && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 | |
| 10 | # if __GNUC_PREREQ (9, 0) && !__GNUC_PREREQ (9, 3) | |
| 11 | # pragma GCC system_header | |
| 12 | # endif | |
| 13 | #endif | |
| 14 | ||
| 6 | 15 | #include <stdlib/stdlib.h> |
| 7 | 16 | |
| 8 | 17 | /* Now define the internal interfaces. */ |
| 9 | 18 | #if !defined _ISOMAC |
| 10 | 19 | # include <sys/stat.h> |
| 11 | 20 | |
| 21 | # include <rtld-malloc.h> | |
| 22 | ||
| 12 | 23 | extern __typeof (strtol_l) __strtol_l; |
| 13 | 24 | extern __typeof (strtoul_l) __strtoul_l; |
| 14 | 25 | extern __typeof (strtoll_l) __strtoll_l; |
| ... | ... | @@ -80,6 +91,7 @@ extern int __setenv (const char *__name, const char *__value, int __replace) |
| 80 | 91 | extern int __unsetenv (const char *__name) attribute_hidden; |
| 81 | 92 | extern int __clearenv (void) attribute_hidden; |
| 82 | 93 | extern char *__mktemp (char *__template) __THROW __nonnull ((1)); |
| 94 | libc_hidden_proto (__mktemp) | |
| 83 | 95 | extern char *__canonicalize_file_name (const char *__name); |
| 84 | 96 | extern char *__realpath (const char *__name, char *__resolved); |
| 85 | 97 | libc_hidden_proto (__realpath) |
| ... | ... | @@ -125,6 +137,12 @@ libc_hidden_proto (__libc_reallocarray) |
| 125 | 137 | |
| 126 | 138 | extern int __libc_system (const char *line); |
| 127 | 139 | |
| 140 | extern __typeof (getpt) __getpt; | |
| 141 | extern __typeof (ptsname_r) __ptsname_r; | |
| 142 | libc_hidden_proto (__getpt) | |
| 143 | libc_hidden_proto (__ptsname_r) | |
| 144 | libc_hidden_proto (grantpt) | |
| 145 | libc_hidden_proto (unlockpt) | |
| 128 | 146 | |
| 129 | 147 | extern double __strtod_internal (const char *__restrict __nptr, |
| 130 | 148 | 				 char **__restrict __endptr, int __group) |
| ... | ... | @@ -205,7 +223,7 @@ libc_hidden_proto (____strtoull_l_internal) |
| 205 | 223 | #include <bits/floatn.h> |
| 206 | 224 | libc_hidden_proto (strtof) |
| 207 | 225 | libc_hidden_proto (strtod) |
| 208 | #if __LONG_DOUBLE_USES_FLOAT128 == 0 | |
| 226 | #if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 | |
| 209 | 227 | libc_hidden_proto (strtold) |
| 210 | 228 | #endif |
| 211 | 229 | libc_hidden_proto (strtol) |
| ... | ... | @@ -288,9 +306,6 @@ libc_hidden_proto (__qfcvt_r) |
| 288 | 306 | # define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX)) |
| 289 | 307 | # endif |
| 290 | 308 | |
| 291 | extern void *__default_morecore (ptrdiff_t) __THROW; | |
| 292 | libc_hidden_proto (__default_morecore) | |
| 293 | ||
| 294 | 309 | struct abort_msg_s |
| 295 | 310 | { |
| 296 | 311 | unsigned int size; |
| ... | ... | @@ -299,7 +314,7 @@ struct abort_msg_s |
| 299 | 314 | extern struct abort_msg_s *__abort_msg; |
| 300 | 315 | libc_hidden_proto (__abort_msg) |
| 301 | 316 | |
| 302 | # if IS_IN (rtld) && !defined NO_RTLD_HIDDEN | |
| 317 | # if IS_IN (rtld) | |
| 303 | 318 | extern __typeof (unsetenv) unsetenv attribute_hidden; |
| 304 | 319 | extern __typeof (__strtoul_internal) __strtoul_internal attribute_hidden; |
| 305 | 320 | # endif |
lib/libc/glibc/include/struct___timespec64.h created+27| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | #ifndef _STRUCT_TIMESPEC64_H | |
| 2 | #define _STRUCT_TIMESPEC64_H | |
| 3 | ||
| 4 | #if __TIMESIZE == 64 | |
| 5 | # define __timespec64 timespec | |
| 6 | #else | |
| 7 | #include <endian.h> | |
| 8 | /* The glibc Y2038-proof struct __timespec64 structure for a time value. | |
| 9 | To keep things Posix-ish, we keep the nanoseconds field a 32-bit | |
| 10 | signed long, but since the Linux field is a 64-bit signed int, we | |
| 11 | pad our tv_nsec with a 32-bit unnamed bit-field padding. | |
| 12 | ||
| 13 | As a general rule the Linux kernel is ignoring upper 32 bits of | |
| 14 | tv_nsec field. */ | |
| 15 | struct __timespec64 | |
| 16 | { | |
| 17 | __time64_t tv_sec; /* Seconds */ | |
| 18 | # if BYTE_ORDER == BIG_ENDIAN | |
| 19 | __int32_t :32; /* Padding */ | |
| 20 | __int32_t tv_nsec; /* Nanoseconds */ | |
| 21 | # else | |
| 22 | __int32_t tv_nsec; /* Nanoseconds */ | |
| 23 | __int32_t :32; /* Padding */ | |
| 24 | # endif | |
| 25 | }; | |
| 26 | #endif | |
| 27 | #endif /* _STRUCT_TIMESPEC64_H */ |
lib/libc/glibc/include/struct___timeval64.h created+17| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | #ifndef _STRUCT_TIMEVAL64_H | |
| 2 | #define _STRUCT_TIMEVAL64_H | |
| 3 | ||
| 4 | #if __TIMESIZE == 64 | |
| 5 | # define __timeval64 timeval | |
| 6 | #else | |
| 7 | /* The glibc Y2038-proof struct __timeval64 structure for a time value. | |
| 8 | This structure is NOT supposed to be passed to the Linux kernel. | |
| 9 | Instead, it shall be converted to struct __timespec64 and time shall | |
| 10 | be [sg]et via clock_[sg]ettime (which are now Y2038 safe). */ | |
| 11 | struct __timeval64 | |
| 12 | { | |
| 13 | __time64_t tv_sec; /* Seconds */ | |
| 14 | __suseconds64_t tv_usec; /* Microseconds */ | |
| 15 | }; | |
| 16 | #endif | |
| 17 | #endif /* _STRUCT_TIMEVAL64_H */ |
lib/libc/glibc/include/sys/cdefs.h+20| ... | ... | @@ -13,6 +13,26 @@ extern void __chk_fail (void) __attribute__ ((__noreturn__)); |
| 13 | 13 | libc_hidden_proto (__chk_fail) |
| 14 | 14 | rtld_hidden_proto (__chk_fail) |
| 15 | 15 | |
| 16 | /* If we are using redirects internally to support long double, | |
| 17 | we need to tweak some macros to ensure the PLT bypass tricks | |
| 18 | continue to work in libc. */ | |
| 19 | #if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && IS_IN (libc) && defined SHARED | |
| 20 | ||
| 21 | # undef __LDBL_REDIR_DECL | |
| 22 | # define __LDBL_REDIR_DECL(func) \ | |
| 23 | extern __typeof(func) func __asm (__ASMNAME ("__GI____ieee128_" #func)); | |
| 24 | ||
| 25 | # undef libc_hidden_ldbl_proto | |
| 26 | # define libc_hidden_ldbl_proto(func, attrs...) \ | |
| 27 | extern __typeof(func) ___ieee128_ ## func; \ | |
| 28 | libc_hidden_proto (___ieee128_ ## func, ##attrs); | |
| 29 | ||
| 30 | # undef __LDBL_REDIR2_DECL | |
| 31 | # define __LDBL_REDIR2_DECL(func) \ | |
| 32 | extern __typeof(__ ## func) __ ## func __asm (__ASMNAME ("__GI____ieee128___" #func)); | |
| 33 | ||
| 16 | 34 | #endif |
| 17 | 35 | |
| 36 | #endif /* !defined _ISOMAC */ | |
| 37 | ||
| 18 | 38 | #endif |
lib/libc/glibc/include/sys/select.h+29| ... | ... | @@ -3,6 +3,35 @@ |
| 3 | 3 | |
| 4 | 4 | #ifndef _ISOMAC |
| 5 | 5 | /* Now define the internal interfaces. */ |
| 6 | # if __TIMESIZE == 64 | |
| 7 | # define __pselect64 __pselect | |
| 8 | # define __select64 __select | |
| 9 | #else | |
| 10 | # include <struct___timespec64.h> | |
| 11 | # include <struct___timeval64.h> | |
| 12 | ||
| 13 | extern int __pselect64 (int __nfds, fd_set *__readfds, | |
| 14 | 			fd_set *__writefds, fd_set *__exceptfds, | |
| 15 | 			const struct __timespec64 *__timeout, | |
| 16 | 			const __sigset_t *__sigmask); | |
| 17 | libc_hidden_proto (__pselect64) | |
| 18 | ||
| 19 | extern int __pselect32 (int __nfds, fd_set *__readfds, | |
| 20 | 			fd_set *__writefds, fd_set *__exceptfds, | |
| 21 | 			const struct __timespec64 *__timeout, | |
| 22 | 			const __sigset_t *__sigmask) | |
| 23 | attribute_hidden; | |
| 24 | extern int __select32 (int __nfds, fd_set *__readfds, | |
| 25 | 		 fd_set *__writefds, fd_set *__exceptfds, | |
| 26 | 		 const struct __timespec64 *ts64, | |
| 27 | 		 struct __timeval64 *timeout) | |
| 28 | attribute_hidden; | |
| 29 | ||
| 30 | extern int __select64 (int __nfds, fd_set *__readfds, | |
| 31 | 		 fd_set *__writefds, fd_set *__exceptfds, | |
| 32 | 		 struct __timeval64 *__timeout); | |
| 33 | libc_hidden_proto (__select64) | |
| 34 | #endif | |
| 6 | 35 | extern int __pselect (int __nfds, fd_set *__readfds, |
| 7 | 36 | 		 fd_set *__writefds, fd_set *__exceptfds, |
| 8 | 37 | 		 const struct timespec *__timeout, |
lib/libc/glibc/include/sys/stat.h+77-43| ... | ... | @@ -2,63 +2,97 @@ |
| 2 | 2 | #include <io/sys/stat.h> |
| 3 | 3 | |
| 4 | 4 | #ifndef _ISOMAC |
| 5 | # include <xstatver.h> | |
| 6 | # include <struct___timespec64.h> | |
| 7 | # include <struct_stat_time64.h> | |
| 8 | # include <stdbool.h> | |
| 9 | ||
| 10 | static inline bool | |
| 11 | in_ino_t_range (__ino64_t v) | |
| 12 | { | |
| 13 | __ino_t s = v; | |
| 14 | return s == v; | |
| 15 | } | |
| 16 | ||
| 17 | static inline bool | |
| 18 | in_off_t_range (__off64_t v) | |
| 19 | { | |
| 20 | __off_t s = v; | |
| 21 | return s == v; | |
| 22 | } | |
| 23 | ||
| 24 | static inline bool | |
| 25 | in_blkcnt_t_range (__blkcnt64_t v) | |
| 26 | { | |
| 27 | __blkcnt_t s = v; | |
| 28 | return s == v; | |
| 29 | } | |
| 30 | ||
| 5 | 31 | /* Now define the internal interfaces. */ |
| 6 | 32 | extern int __stat (const char *__file, struct stat *__buf); |
| 33 | extern int __stat64 (const char *__file, struct stat64 *__buf); | |
| 7 | 34 | extern int __fstat (int __fd, struct stat *__buf); |
| 35 | extern int __fstat64 (int __fd, struct stat64 *__buf); | |
| 8 | 36 | extern int __lstat (const char *__file, struct stat *__buf); |
| 37 | extern int __lstat64 (const char *__file, struct stat64 *__buf); | |
| 38 | extern int __fstatat (int dirfd, const char *pathname, struct stat *buf, | |
| 39 | 		 int flags); | |
| 40 | extern int __fstatat64 (int dirfd, const char *pathname, struct stat64 *buf, | |
| 41 | 			int flags); | |
| 42 | # if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN) | |
| 43 | hidden_proto (__stat64) | |
| 44 | hidden_proto (__fstat64) | |
| 45 | hidden_proto (__lstat64) | |
| 46 | hidden_proto (__fstatat64) | |
| 47 | # endif | |
| 48 | ||
| 49 | # if __TIMESIZE == 64 || defined NO_RTLD_HIDDEN | |
| 50 | # define __stat64_time64 __stat64 | |
| 51 | # define __fstat64_time64 __fstat64 | |
| 52 | # define __lstat64_time64 __lstat64 | |
| 53 | # define __fstatat64_time64 __fstatat64 | |
| 54 | # else | |
| 55 | extern int __stat64_time64 (const char *file, struct __stat64_t64 *buf); | |
| 56 | hidden_proto (__stat64_time64); | |
| 57 | extern int __lstat64_time64 (const char *file, struct __stat64_t64 *buf); | |
| 58 | hidden_proto (__lstat64_time64); | |
| 59 | extern int __fstat64_time64 (int fd, struct __stat64_t64 *buf); | |
| 60 | hidden_proto (__fstat64_time64); | |
| 61 | extern int __fstatat64_time64 (int dirfd, const char *pathname, | |
| 62 | 			 struct __stat64_t64 *buf, int flags); | |
| 63 | hidden_proto (__fstatat64_time64); | |
| 64 | # endif | |
| 65 | ||
| 9 | 66 | extern int __chmod (const char *__file, __mode_t __mode); |
| 10 | 67 | libc_hidden_proto (__chmod) |
| 11 | 68 | extern int __fchmod (int __fd, __mode_t __mode); |
| 69 | libc_hidden_proto (fchmodat) | |
| 12 | 70 | extern __mode_t __umask (__mode_t __mask); |
| 13 | 71 | extern int __mkdir (const char *__path, __mode_t __mode); |
| 14 | 72 | libc_hidden_proto (__mkdir) |
| 73 | ||
| 74 | extern int __mknodat (int fd, const char *path, mode_t mode, dev_t dev); | |
| 75 | libc_hidden_proto (__mknodat); | |
| 15 | 76 | extern int __mknod (const char *__path, |
| 16 | 77 | 		 __mode_t __mode, __dev_t __dev); |
| 17 | #if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN) | |
| 18 | hidden_proto (__fxstat) | |
| 19 | hidden_proto (__fxstat64) | |
| 20 | hidden_proto (__lxstat) | |
| 21 | hidden_proto (__lxstat64) | |
| 22 | hidden_proto (__xstat) | |
| 23 | hidden_proto (__xstat64) | |
| 24 | #endif | |
| 25 | extern __inline__ int __stat (const char *__path, struct stat *__statbuf) | |
| 26 | { | |
| 27 | return __xstat (_STAT_VER, __path, __statbuf); | |
| 28 | } | |
| 29 | libc_hidden_proto (__xmknod) | |
| 30 | extern __inline__ int __mknod (const char *__path, __mode_t __mode, | |
| 31 | 			 __dev_t __dev) | |
| 32 | { | |
| 33 | return __xmknod (_MKNOD_VER, __path, __mode, &__dev); | |
| 34 | } | |
| 35 | libc_hidden_proto (__xmknodat) | |
| 78 | libc_hidden_proto (__mknod); | |
| 36 | 79 | |
| 37 | libc_hidden_proto (__fxstatat) | |
| 38 | libc_hidden_proto (__fxstatat64) | |
| 80 | extern int __xmknod (int __ver, const char *__path, __mode_t __mode, | |
| 81 | 		 __dev_t *__dev); | |
| 82 | extern int __xmknodat (int __ver, int __fd, const char *__path, | |
| 83 | 		 __mode_t __mode, __dev_t *__dev); | |
| 39 | 84 | |
| 40 | # if IS_IN (rtld) && !defined NO_RTLD_HIDDEN | |
| 41 | extern __typeof (__fxstatat64) __fxstatat64 attribute_hidden; | |
| 42 | # endif | |
| 85 | int __fxstat (int __ver, int __fildes, struct stat *__stat_buf); | |
| 86 | int __xstat (int __ver, const char *__filename, | |
| 87 | 	 struct stat *__stat_buf); | |
| 88 | int __lxstat (int __ver, const char *__filename, struct stat *__stat_buf); | |
| 89 | int __fxstatat (int __ver, int __fildes, const char *__filename, | |
| 90 | 		struct stat *__stat_buf, int __flag); | |
| 91 | int __fxstat64 (int ver, int __fildes, struct stat64 *__stat_buf); | |
| 92 | int __xstat64 (int ver, const char *__filename, struct stat64 *__stat_buf); | |
| 93 | int __lxstat64 (int ver, const char *__filename, struct stat64 *__stat_buf); | |
| 94 | int __fxstatat64 (int ver, int __fildes, const char *__filename, | |
| 95 | 		 struct stat64 *__stat_buf, int __flag); | |
| 43 | 96 | |
| 44 | /* The `stat', `fstat', `lstat' functions have to be handled special since | |
| 45 | even while not compiling the library with optimization calls to these | |
| 46 | functions in the shared library must reference the `xstat' etc functions. | |
| 47 | We have to use macros but we cannot define them in the normal headers | |
| 48 | since on user level we must use real functions. */ | |
| 49 | #define stat(fname, buf) __xstat (_STAT_VER, fname, buf) | |
| 50 | #define lstat(fname, buf) __lxstat (_STAT_VER, fname, buf) | |
| 51 | #define __lstat(fname, buf) __lxstat (_STAT_VER, fname, buf) | |
| 52 | #define lstat64(fname, buf) __lxstat64 (_STAT_VER, fname, buf) | |
| 53 | #define __lstat64(fname, buf) __lxstat64 (_STAT_VER, fname, buf) | |
| 54 | #define stat64(fname, buf) __xstat64 (_STAT_VER, fname, buf) | |
| 55 | #define fstat64(fd, buf) __fxstat64 (_STAT_VER, fd, buf) | |
| 56 | #define __fstat64(fd, buf) __fxstat64 (_STAT_VER, fd, buf) | |
| 57 | #define fstat(fd, buf) __fxstat (_STAT_VER, fd, buf) | |
| 58 | #define __fstat(fd, buf) __fxstat (_STAT_VER, fd, buf) | |
| 59 | #define __fstatat(dfd, fname, buf, flag) \ | |
| 60 | __fxstatat (_STAT_VER, dfd, fname, buf, flag) | |
| 61 | #define __fstatat64(dfd, fname, buf, flag) \ | |
| 62 | __fxstatat64 (_STAT_VER, dfd, fname, buf, flag) | |
| 63 | 97 | #endif |
| 64 | 98 | #endif |
lib/libc/glibc/io/bits/statx.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* statx-related definitions and declarations. Generic version. |
| 2 | Copyright (C) 2018-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2018-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/io/fcntl.h created+347| ... | ... | @@ -0,0 +1,347 @@ |
| 1 | /* Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | /* | |
| 19 | *	POSIX Standard: 6.5 File Control Operations	<fcntl.h> | |
| 20 | */ | |
| 21 | ||
| 22 | #ifndef	_FCNTL_H | |
| 23 | #define	_FCNTL_H	1 | |
| 24 | ||
| 25 | #include <features.h> | |
| 26 | ||
| 27 | /* This must be early so <bits/fcntl.h> can define types winningly. */ | |
| 28 | __BEGIN_DECLS | |
| 29 | ||
| 30 | /* Get __mode_t, __dev_t and __off_t .*/ | |
| 31 | #include <bits/types.h> | |
| 32 | ||
| 33 | /* Get the definitions of O_*, F_*, FD_*: all the | |
| 34 | numbers and flag bits for `open', `fcntl', et al. */ | |
| 35 | #include <bits/fcntl.h> | |
| 36 | ||
| 37 | /* Detect if open needs mode as a third argument (or for openat as a fourth | |
| 38 | argument). */ | |
| 39 | #ifdef __O_TMPFILE | |
| 40 | # define __OPEN_NEEDS_MODE(oflag) \ | |
| 41 | (((oflag) & O_CREAT) != 0 || ((oflag) & __O_TMPFILE) == __O_TMPFILE) | |
| 42 | #else | |
| 43 | # define __OPEN_NEEDS_MODE(oflag) (((oflag) & O_CREAT) != 0) | |
| 44 | #endif | |
| 45 | ||
| 46 | /* POSIX.1-2001 specifies that these types are defined by <fcntl.h>. | |
| 47 | Earlier POSIX standards permitted any type ending in `_t' to be defined | |
| 48 | by any POSIX header, so we don't conditionalize the definitions here. */ | |
| 49 | #ifndef __mode_t_defined | |
| 50 | typedef __mode_t mode_t; | |
| 51 | # define __mode_t_defined | |
| 52 | #endif | |
| 53 | ||
| 54 | #ifndef __off_t_defined | |
| 55 | # ifndef __USE_FILE_OFFSET64 | |
| 56 | typedef __off_t off_t; | |
| 57 | # else | |
| 58 | typedef __off64_t off_t; | |
| 59 | # endif | |
| 60 | # define __off_t_defined | |
| 61 | #endif | |
| 62 | ||
| 63 | #if defined __USE_LARGEFILE64 && !defined __off64_t_defined | |
| 64 | typedef __off64_t off64_t; | |
| 65 | # define __off64_t_defined | |
| 66 | #endif | |
| 67 | ||
| 68 | #ifndef __pid_t_defined | |
| 69 | typedef __pid_t pid_t; | |
| 70 | # define __pid_t_defined | |
| 71 | #endif | |
| 72 | ||
| 73 | /* For XPG all symbols from <sys/stat.h> should also be available. */ | |
| 74 | #ifdef __USE_XOPEN2K8 | |
| 75 | # include <bits/types/struct_timespec.h> | |
| 76 | #endif | |
| 77 | #if defined __USE_XOPEN || defined __USE_XOPEN2K8 | |
| 78 | # include <bits/stat.h> | |
| 79 | ||
| 80 | # define S_IFMT		__S_IFMT | |
| 81 | # define S_IFDIR	__S_IFDIR | |
| 82 | # define S_IFCHR	__S_IFCHR | |
| 83 | # define S_IFBLK	__S_IFBLK | |
| 84 | # define S_IFREG	__S_IFREG | |
| 85 | # ifdef __S_IFIFO | |
| 86 | # define S_IFIFO	__S_IFIFO | |
| 87 | # endif | |
| 88 | # ifdef __S_IFLNK | |
| 89 | # define S_IFLNK	__S_IFLNK | |
| 90 | # endif | |
| 91 | # if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) && defined __S_IFSOCK | |
| 92 | # define S_IFSOCK	__S_IFSOCK | |
| 93 | # endif | |
| 94 | ||
| 95 | /* Protection bits. */ | |
| 96 | ||
| 97 | # define S_ISUID	__S_ISUID /* Set user ID on execution. */ | |
| 98 | # define S_ISGID	__S_ISGID /* Set group ID on execution. */ | |
| 99 | ||
| 100 | # if defined __USE_MISC || defined __USE_XOPEN | |
| 101 | /* Save swapped text after use (sticky bit). This is pretty well obsolete. */ | |
| 102 | # define S_ISVTX	__S_ISVTX | |
| 103 | # endif | |
| 104 | ||
| 105 | # define S_IRUSR	__S_IREAD /* Read by owner. */ | |
| 106 | # define S_IWUSR	__S_IWRITE /* Write by owner. */ | |
| 107 | # define S_IXUSR	__S_IEXEC /* Execute by owner. */ | |
| 108 | /* Read, write, and execute by owner. */ | |
| 109 | # define S_IRWXU	(__S_IREAD|__S_IWRITE|__S_IEXEC) | |
| 110 | ||
| 111 | # define S_IRGRP	(S_IRUSR >> 3) /* Read by group. */ | |
| 112 | # define S_IWGRP	(S_IWUSR >> 3) /* Write by group. */ | |
| 113 | # define S_IXGRP	(S_IXUSR >> 3) /* Execute by group. */ | |
| 114 | /* Read, write, and execute by group. */ | |
| 115 | # define S_IRWXG	(S_IRWXU >> 3) | |
| 116 | ||
| 117 | # define S_IROTH	(S_IRGRP >> 3) /* Read by others. */ | |
| 118 | # define S_IWOTH	(S_IWGRP >> 3) /* Write by others. */ | |
| 119 | # define S_IXOTH	(S_IXGRP >> 3) /* Execute by others. */ | |
| 120 | /* Read, write, and execute by others. */ | |
| 121 | # define S_IRWXO	(S_IRWXG >> 3) | |
| 122 | #endif | |
| 123 | ||
| 124 | #ifdef	__USE_MISC | |
| 125 | # ifndef R_OK			/* Verbatim from <unistd.h>. Ugh. */ | |
| 126 | /* Values for the second argument to access. | |
| 127 | These may be OR'd together. */ | |
| 128 | # define R_OK	4		/* Test for read permission. */ | |
| 129 | # define W_OK	2		/* Test for write permission. */ | |
| 130 | # define X_OK	1		/* Test for execute permission. */ | |
| 131 | # define F_OK	0		/* Test for existence. */ | |
| 132 | # endif | |
| 133 | #endif /* Use misc. */ | |
| 134 | ||
| 135 | /* XPG wants the following symbols. <stdio.h> has the same definitions. */ | |
| 136 | #if defined __USE_XOPEN || defined __USE_XOPEN2K8 | |
| 137 | # define SEEK_SET	0	/* Seek from beginning of file. */ | |
| 138 | # define SEEK_CUR	1	/* Seek from current position. */ | |
| 139 | # define SEEK_END	2	/* Seek from end of file. */ | |
| 140 | #endif	/* XPG */ | |
| 141 | ||
| 142 | /* The constants AT_REMOVEDIR and AT_EACCESS have the same value. AT_EACCESS | |
| 143 | is meaningful only to faccessat, while AT_REMOVEDIR is meaningful only to | |
| 144 | unlinkat. The two functions do completely different things and therefore, | |
| 145 | the flags can be allowed to overlap. For example, passing AT_REMOVEDIR to | |
| 146 | faccessat would be undefined behavior and thus treating it equivalent to | |
| 147 | AT_EACCESS is valid undefined behavior. */ | |
| 148 | #ifdef __USE_ATFILE | |
| 149 | # define AT_FDCWD		-100	/* Special value used to indicate | |
| 150 | 					 the *at functions should use the | |
| 151 | 					 current working directory. */ | |
| 152 | # define AT_SYMLINK_NOFOLLOW	0x100	/* Do not follow symbolic links. */ | |
| 153 | # define AT_REMOVEDIR		0x200	/* Remove directory instead of | |
| 154 | 					 unlinking file. */ | |
| 155 | # define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links. */ | |
| 156 | # ifdef __USE_GNU | |
| 157 | # define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount | |
| 158 | 					 traversal. */ | |
| 159 | # define AT_EMPTY_PATH		0x1000	/* Allow empty relative pathname. */ | |
| 160 | # define AT_STATX_SYNC_TYPE	0x6000 | |
| 161 | # define AT_STATX_SYNC_AS_STAT	0x0000 | |
| 162 | # define AT_STATX_FORCE_SYNC	0x2000 | |
| 163 | # define AT_STATX_DONT_SYNC	0x4000 | |
| 164 | # define AT_RECURSIVE		0x8000	/* Apply to the entire subtree. */ | |
| 165 | # endif | |
| 166 | # define AT_EACCESS		0x200	/* Test access permitted for | |
| 167 | 					 effective IDs, not real IDs. */ | |
| 168 | #endif | |
| 169 | ||
| 170 | /* Do the file control operation described by CMD on FD. | |
| 171 | The remaining arguments are interpreted depending on CMD. | |
| 172 | ||
| 173 | This function is a cancellation point and therefore not marked with | |
| 174 | __THROW. */ | |
| 175 | #ifndef __USE_TIME_BITS64 | |
| 176 | # ifndef __USE_FILE_OFFSET64 | |
| 177 | extern int fcntl (int __fd, int __cmd, ...); | |
| 178 | # else | |
| 179 | # ifdef __REDIRECT | |
| 180 | extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64); | |
| 181 | # else | |
| 182 | # define fcntl fcntl64 | |
| 183 | # endif | |
| 184 | # endif | |
| 185 | # ifdef __USE_LARGEFILE64 | |
| 186 | extern int fcntl64 (int __fd, int __cmd, ...); | |
| 187 | # endif | |
| 188 | #else /* __USE_TIME_BITS64 */ | |
| 189 | # ifdef __REDIRECT | |
| 190 | extern int __REDIRECT (fcntl, (int __fd, int __request, ...), | |
| 191 | 		 __fcntl_time64) __THROW; | |
| 192 | extern int __REDIRECT (fcntl64, (int __fd, int __request, ...), | |
| 193 | 		 __fcntl_time64) __THROW; | |
| 194 | # else | |
| 195 | extern int __fcntl_time64 (int __fd, int __request, ...) __THROW; | |
| 196 | # define fcntl64 __fcntl_time64 | |
| 197 | # define fcntl __fcntl_time64 | |
| 198 | # endif | |
| 199 | #endif | |
| 200 | ||
| 201 | /* Open FILE and return a new file descriptor for it, or -1 on error. | |
| 202 | OFLAG determines the type of access used. If O_CREAT or O_TMPFILE is set | |
| 203 | in OFLAG, the third argument is taken as a `mode_t', the mode of the | |
| 204 | created file. | |
| 205 | ||
| 206 | This function is a cancellation point and therefore not marked with | |
| 207 | __THROW. */ | |
| 208 | #ifndef __USE_FILE_OFFSET64 | |
| 209 | extern int open (const char *__file, int __oflag, ...) __nonnull ((1)); | |
| 210 | #else | |
| 211 | # ifdef __REDIRECT | |
| 212 | extern int __REDIRECT (open, (const char *__file, int __oflag, ...), open64) | |
| 213 | __nonnull ((1)); | |
| 214 | # else | |
| 215 | # define open open64 | |
| 216 | # endif | |
| 217 | #endif | |
| 218 | #ifdef __USE_LARGEFILE64 | |
| 219 | extern int open64 (const char *__file, int __oflag, ...) __nonnull ((1)); | |
| 220 | #endif | |
| 221 | ||
| 222 | #ifdef __USE_ATFILE | |
| 223 | /* Similar to `open' but a relative path name is interpreted relative to | |
| 224 | the directory for which FD is a descriptor. | |
| 225 | ||
| 226 | NOTE: some other `openat' implementation support additional functionality | |
| 227 | through this interface, especially using the O_XATTR flag. This is not | |
| 228 | yet supported here. | |
| 229 | ||
| 230 | This function is a cancellation point and therefore not marked with | |
| 231 | __THROW. */ | |
| 232 | # ifndef __USE_FILE_OFFSET64 | |
| 233 | extern int openat (int __fd, const char *__file, int __oflag, ...) | |
| 234 | __nonnull ((2)); | |
| 235 | # else | |
| 236 | # ifdef __REDIRECT | |
| 237 | extern int __REDIRECT (openat, (int __fd, const char *__file, int __oflag, | |
| 238 | 				...), openat64) __nonnull ((2)); | |
| 239 | # else | |
| 240 | # define openat openat64 | |
| 241 | # endif | |
| 242 | # endif | |
| 243 | # ifdef __USE_LARGEFILE64 | |
| 244 | extern int openat64 (int __fd, const char *__file, int __oflag, ...) | |
| 245 | __nonnull ((2)); | |
| 246 | # endif | |
| 247 | #endif | |
| 248 | ||
| 249 | /* Create and open FILE, with mode MODE. This takes an `int' MODE | |
| 250 | argument because that is what `mode_t' will be widened to. | |
| 251 | ||
| 252 | This function is a cancellation point and therefore not marked with | |
| 253 | __THROW. */ | |
| 254 | #ifndef __USE_FILE_OFFSET64 | |
| 255 | extern int creat (const char *__file, mode_t __mode) __nonnull ((1)); | |
| 256 | #else | |
| 257 | # ifdef __REDIRECT | |
| 258 | extern int __REDIRECT (creat, (const char *__file, mode_t __mode), | |
| 259 | 		 creat64) __nonnull ((1)); | |
| 260 | # else | |
| 261 | # define creat creat64 | |
| 262 | # endif | |
| 263 | #endif | |
| 264 | #ifdef __USE_LARGEFILE64 | |
| 265 | extern int creat64 (const char *__file, mode_t __mode) __nonnull ((1)); | |
| 266 | #endif | |
| 267 | ||
| 268 | #if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \ | |
| 269 | 					 && !defined __USE_POSIX)) | |
| 270 | /* NOTE: These declarations also appear in <unistd.h>; be sure to keep both | |
| 271 | files consistent. Some systems have them there and some here, and some | |
| 272 | software depends on the macros being defined without including both. */ | |
| 273 | ||
| 274 | /* `lockf' is a simpler interface to the locking facilities of `fcntl'. | |
| 275 | LEN is always relative to the current file position. | |
| 276 | The CMD argument is one of the following. */ | |
| 277 | ||
| 278 | # define F_ULOCK 0	/* Unlock a previously locked region. */ | |
| 279 | # define F_LOCK 1	/* Lock a region for exclusive use. */ | |
| 280 | # define F_TLOCK 2	/* Test and lock a region for exclusive use. */ | |
| 281 | # define F_TEST 3	/* Test a region for other processes locks. */ | |
| 282 | ||
| 283 | # ifndef __USE_FILE_OFFSET64 | |
| 284 | extern int lockf (int __fd, int __cmd, off_t __len); | |
| 285 | # else | |
| 286 | # ifdef __REDIRECT | |
| 287 | extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), lockf64); | |
| 288 | # else | |
| 289 | # define lockf lockf64 | |
| 290 | # endif | |
| 291 | # endif | |
| 292 | # ifdef __USE_LARGEFILE64 | |
| 293 | extern int lockf64 (int __fd, int __cmd, off64_t __len); | |
| 294 | # endif | |
| 295 | #endif | |
| 296 | ||
| 297 | #ifdef __USE_XOPEN2K | |
| 298 | /* Advice the system about the expected behaviour of the application with | |
| 299 | respect to the file associated with FD. */ | |
| 300 | # ifndef __USE_FILE_OFFSET64 | |
| 301 | extern int posix_fadvise (int __fd, off_t __offset, off_t __len, | |
| 302 | 			 int __advise) __THROW; | |
| 303 | # else | |
| 304 | # ifdef __REDIRECT_NTH | |
| 305 | extern int __REDIRECT_NTH (posix_fadvise, (int __fd, __off64_t __offset, | |
| 306 | 					 __off64_t __len, int __advise), | |
| 307 | 			 posix_fadvise64); | |
| 308 | # else | |
| 309 | # define posix_fadvise posix_fadvise64 | |
| 310 | # endif | |
| 311 | # endif | |
| 312 | # ifdef __USE_LARGEFILE64 | |
| 313 | extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len, | |
| 314 | 			 int __advise) __THROW; | |
| 315 | # endif | |
| 316 | ||
| 317 | ||
| 318 | /* Reserve storage for the data of the file associated with FD. | |
| 319 | ||
| 320 | This function is a possible cancellation point and therefore not | |
| 321 | marked with __THROW. */ | |
| 322 | # ifndef __USE_FILE_OFFSET64 | |
| 323 | extern int posix_fallocate (int __fd, off_t __offset, off_t __len); | |
| 324 | # else | |
| 325 | # ifdef __REDIRECT | |
| 326 | extern int __REDIRECT (posix_fallocate, (int __fd, __off64_t __offset, | |
| 327 | 					 __off64_t __len), | |
| 328 | 		 posix_fallocate64); | |
| 329 | # else | |
| 330 | # define posix_fallocate posix_fallocate64 | |
| 331 | # endif | |
| 332 | # endif | |
| 333 | # ifdef __USE_LARGEFILE64 | |
| 334 | extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len); | |
| 335 | # endif | |
| 336 | #endif | |
| 337 | ||
| 338 | ||
| 339 | /* Define some inlines helping to catch common problems. */ | |
| 340 | #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function \ | |
| 341 | && defined __va_arg_pack_len | |
| 342 | # include <bits/fcntl2.h> | |
| 343 | #endif | |
| 344 | ||
| 345 | __END_DECLS | |
| 346 | ||
| 347 | #endif /* fcntl.h */ |
lib/libc/glibc/io/fstat.c deleted-55| ... | ... | @@ -1,55 +0,0 @@ |
| 1 | /* Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | In addition to the permissions in the GNU Lesser General Public | |
| 10 | License, the Free Software Foundation gives you unlimited | |
| 11 | permission to link the compiled version of this file with other | |
| 12 | programs, and to distribute those programs without any restriction | |
| 13 | coming from the use of this file. (The GNU Lesser General Public | |
| 14 | License restrictions do apply in other respects; for example, they | |
| 15 | cover modification of the file, and distribution when not linked | |
| 16 | into another program.) | |
| 17 | ||
| 18 | Note that people who make modified versions of this file are not | |
| 19 | obligated to grant this special exception for their modified | |
| 20 | versions; it is their choice whether to do so. The GNU Lesser | |
| 21 | General Public License gives permission to release a modified | |
| 22 | version without this exception; this exception also makes it | |
| 23 | possible to release a modified version which carries forward this | |
| 24 | exception. | |
| 25 | ||
| 26 | The GNU C Library is distributed in the hope that it will be useful, | |
| 27 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 28 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 29 | Lesser General Public License for more details. | |
| 30 | ||
| 31 | You should have received a copy of the GNU Lesser General Public | |
| 32 | License along with the GNU C Library; if not, see | |
| 33 | <https://www.gnu.org/licenses/>. */ | |
| 34 | ||
| 35 | #include <sys/stat.h> | |
| 36 | ||
| 37 | /* This definition is only used if inlining fails for this function; see | |
| 38 | the last page of <sys/stat.h>. The real work is done by the `x' | |
| 39 | function which is passed a version number argument. We arrange in the | |
| 40 | makefile that when not inlined this function is always statically | |
| 41 | linked; that way a dynamically-linked executable always encodes the | |
| 42 | version number corresponding to the data structures it uses, so the `x' | |
| 43 | functions in the shared library can adapt without needing to recompile | |
| 44 | all callers. */ | |
| 45 | ||
| 46 | #undef fstat | |
| 47 | #undef __fstat | |
| 48 | int | |
| 49 | attribute_hidden | |
| 50 | __fstat (int fd, struct stat *buf) | |
| 51 | { | |
| 52 | return __fxstat (_STAT_VER, fd, buf); | |
| 53 | } | |
| 54 | ||
| 55 | weak_hidden_alias (__fstat, fstat) |
lib/libc/glibc/io/fstat64.c deleted-52| ... | ... | @@ -1,52 +0,0 @@ |
| 1 | /* Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | In addition to the permissions in the GNU Lesser General Public | |
| 10 | License, the Free Software Foundation gives you unlimited | |
| 11 | permission to link the compiled version of this file with other | |
| 12 | programs, and to distribute those programs without any restriction | |
| 13 | coming from the use of this file. (The GNU Lesser General Public | |
| 14 | License restrictions do apply in other respects; for example, they | |
| 15 | cover modification of the file, and distribution when not linked | |
| 16 | into another program.) | |
| 17 | ||
| 18 | Note that people who make modified versions of this file are not | |
| 19 | obligated to grant this special exception for their modified | |
| 20 | versions; it is their choice whether to do so. The GNU Lesser | |
| 21 | General Public License gives permission to release a modified | |
| 22 | version without this exception; this exception also makes it | |
| 23 | possible to release a modified version which carries forward this | |
| 24 | exception. | |
| 25 | ||
| 26 | The GNU C Library is distributed in the hope that it will be useful, | |
| 27 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 28 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 29 | Lesser General Public License for more details. | |
| 30 | ||
| 31 | You should have received a copy of the GNU Lesser General Public | |
| 32 | License along with the GNU C Library; if not, see | |
| 33 | <https://www.gnu.org/licenses/>. */ | |
| 34 | ||
| 35 | #include <sys/stat.h> | |
| 36 | ||
| 37 | /* This definition is only used if inlining fails for this function; see | |
| 38 | the last page of <sys/stat.h>. The real work is done by the `x' | |
| 39 | function which is passed a version number argument. We arrange in the | |
| 40 | makefile that when not inlined this function is always statically | |
| 41 | linked; that way a dynamically-linked executable always encodes the | |
| 42 | version number corresponding to the data structures it uses, so the `x' | |
| 43 | functions in the shared library can adapt without needing to recompile | |
| 44 | all callers. */ | |
| 45 | ||
| 46 | #undef fstat64 | |
| 47 | int | |
| 48 | attribute_hidden | |
| 49 | fstat64 (int fd, struct stat64 *buf) | |
| 50 | { | |
| 51 | return __fxstat64 (_STAT_VER, fd, buf); | |
| 52 | } |
lib/libc/glibc/io/fstatat.c deleted-52| ... | ... | @@ -1,52 +0,0 @@ |
| 1 | /* Copyright (C) 2005-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | In addition to the permissions in the GNU Lesser General Public | |
| 10 | License, the Free Software Foundation gives you unlimited | |
| 11 | permission to link the compiled version of this file with other | |
| 12 | programs, and to distribute those programs without any restriction | |
| 13 | coming from the use of this file. (The GNU Lesser General Public | |
| 14 | License restrictions do apply in other respects; for example, they | |
| 15 | cover modification of the file, and distribution when not linked | |
| 16 | into another program.) | |
| 17 | ||
| 18 | Note that people who make modified versions of this file are not | |
| 19 | obligated to grant this special exception for their modified | |
| 20 | versions; it is their choice whether to do so. The GNU Lesser | |
| 21 | General Public License gives permission to release a modified | |
| 22 | version without this exception; this exception also makes it | |
| 23 | possible to release a modified version which carries forward this | |
| 24 | exception. | |
| 25 | ||
| 26 | The GNU C Library is distributed in the hope that it will be useful, | |
| 27 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 28 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 29 | Lesser General Public License for more details. | |
| 30 | ||
| 31 | You should have received a copy of the GNU Lesser General Public | |
| 32 | License along with the GNU C Library; if not, see | |
| 33 | <https://www.gnu.org/licenses/>. */ | |
| 34 | ||
| 35 | #include <sys/stat.h> | |
| 36 | ||
| 37 | /* This definition is only used if inlining fails for this function; see | |
| 38 | the last page of <sys/stat.h>. The real work is done by the `x' | |
| 39 | function which is passed a version number argument. We arrange in the | |
| 40 | makefile that when not inlined this function is always statically | |
| 41 | linked; that way a dynamically-linked executable always encodes the | |
| 42 | version number corresponding to the data structures it uses, so the `x' | |
| 43 | functions in the shared library can adapt without needing to recompile | |
| 44 | all callers. */ | |
| 45 | ||
| 46 | #undef fstatat | |
| 47 | int | |
| 48 | attribute_hidden | |
| 49 | fstatat (int fd, const char *file, struct stat *buf, int flag) | |
| 50 | { | |
| 51 | return __fxstatat (_STAT_VER, fd, file, buf, flag); | |
| 52 | } |
lib/libc/glibc/io/fstatat64.c deleted-52| ... | ... | @@ -1,52 +0,0 @@ |
| 1 | /* Copyright (C) 2005-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | In addition to the permissions in the GNU Lesser General Public | |
| 10 | License, the Free Software Foundation gives you unlimited | |
| 11 | permission to link the compiled version of this file with other | |
| 12 | programs, and to distribute those programs without any restriction | |
| 13 | coming from the use of this file. (The GNU Lesser General Public | |
| 14 | License restrictions do apply in other respects; for example, they | |
| 15 | cover modification of the file, and distribution when not linked | |
| 16 | into another program.) | |
| 17 | ||
| 18 | Note that people who make modified versions of this file are not | |
| 19 | obligated to grant this special exception for their modified | |
| 20 | versions; it is their choice whether to do so. The GNU Lesser | |
| 21 | General Public License gives permission to release a modified | |
| 22 | version without this exception; this exception also makes it | |
| 23 | possible to release a modified version which carries forward this | |
| 24 | exception. | |
| 25 | ||
| 26 | The GNU C Library is distributed in the hope that it will be useful, | |
| 27 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 28 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 29 | Lesser General Public License for more details. | |
| 30 | ||
| 31 | You should have received a copy of the GNU Lesser General Public | |
| 32 | License along with the GNU C Library; if not, see | |
| 33 | <https://www.gnu.org/licenses/>. */ | |
| 34 | ||
| 35 | #include <sys/stat.h> | |
| 36 | ||
| 37 | /* This definition is only used if inlining fails for this function; see | |
| 38 | the last page of <sys/stat.h>. The real work is done by the `x' | |
| 39 | function which is passed a version number argument. We arrange in the | |
| 40 | makefile that when not inlined this function is always statically | |
| 41 | linked; that way a dynamically-linked executable always encodes the | |
| 42 | version number corresponding to the data structures it uses, so the `x' | |
| 43 | functions in the shared library can adapt without needing to recompile | |
| 44 | all callers. */ | |
| 45 | ||
| 46 | #undef fstatat64 | |
| 47 | int | |
| 48 | attribute_hidden | |
| 49 | fstatat64 (int fd, const char *file, struct stat64 *buf, int flag) | |
| 50 | { | |
| 51 | return __fxstatat64 (_STAT_VER, fd, file, buf, flag); | |
| 52 | } |
lib/libc/glibc/io/lstat.c deleted-55| ... | ... | @@ -1,55 +0,0 @@ |
| 1 | /* Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | In addition to the permissions in the GNU Lesser General Public | |
| 10 | License, the Free Software Foundation gives you unlimited | |
| 11 | permission to link the compiled version of this file with other | |
| 12 | programs, and to distribute those programs without any restriction | |
| 13 | coming from the use of this file. (The GNU Lesser General Public | |
| 14 | License restrictions do apply in other respects; for example, they | |
| 15 | cover modification of the file, and distribution when not linked | |
| 16 | into another program.) | |
| 17 | ||
| 18 | Note that people who make modified versions of this file are not | |
| 19 | obligated to grant this special exception for their modified | |
| 20 | versions; it is their choice whether to do so. The GNU Lesser | |
| 21 | General Public License gives permission to release a modified | |
| 22 | version without this exception; this exception also makes it | |
| 23 | possible to release a modified version which carries forward this | |
| 24 | exception. | |
| 25 | ||
| 26 | The GNU C Library is distributed in the hope that it will be useful, | |
| 27 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 28 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 29 | Lesser General Public License for more details. | |
| 30 | ||
| 31 | You should have received a copy of the GNU Lesser General Public | |
| 32 | License along with the GNU C Library; if not, see | |
| 33 | <https://www.gnu.org/licenses/>. */ | |
| 34 | ||
| 35 | #include <sys/stat.h> | |
| 36 | ||
| 37 | /* This definition is only used if inlining fails for this function; see | |
| 38 | the last page of <sys/stat.h>. The real work is done by the `x' | |
| 39 | function which is passed a version number argument. We arrange in the | |
| 40 | makefile that when not inlined this function is always statically | |
| 41 | linked; that way a dynamically-linked executable always encodes the | |
| 42 | version number corresponding to the data structures it uses, so the `x' | |
| 43 | functions in the shared library can adapt without needing to recompile | |
| 44 | all callers. */ | |
| 45 | ||
| 46 | #undef lstat | |
| 47 | #undef __lstat | |
| 48 | int | |
| 49 | attribute_hidden | |
| 50 | __lstat (const char *file, struct stat *buf) | |
| 51 | { | |
| 52 | return __lxstat (_STAT_VER, file, buf); | |
| 53 | } | |
| 54 | ||
| 55 | weak_hidden_alias (__lstat, lstat) |
lib/libc/glibc/io/lstat64.c deleted-52| ... | ... | @@ -1,52 +0,0 @@ |
| 1 | /* Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | In addition to the permissions in the GNU Lesser General Public | |
| 10 | License, the Free Software Foundation gives you unlimited | |
| 11 | permission to link the compiled version of this file with other | |
| 12 | programs, and to distribute those programs without any restriction | |
| 13 | coming from the use of this file. (The GNU Lesser General Public | |
| 14 | License restrictions do apply in other respects; for example, they | |
| 15 | cover modification of the file, and distribution when not linked | |
| 16 | into another program.) | |
| 17 | ||
| 18 | Note that people who make modified versions of this file are not | |
| 19 | obligated to grant this special exception for their modified | |
| 20 | versions; it is their choice whether to do so. The GNU Lesser | |
| 21 | General Public License gives permission to release a modified | |
| 22 | version without this exception; this exception also makes it | |
| 23 | possible to release a modified version which carries forward this | |
| 24 | exception. | |
| 25 | ||
| 26 | The GNU C Library is distributed in the hope that it will be useful, | |
| 27 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 28 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 29 | Lesser General Public License for more details. | |
| 30 | ||
| 31 | You should have received a copy of the GNU Lesser General Public | |
| 32 | License along with the GNU C Library; if not, see | |
| 33 | <https://www.gnu.org/licenses/>. */ | |
| 34 | ||
| 35 | #include <sys/stat.h> | |
| 36 | ||
| 37 | /* This definition is only used if inlining fails for this function; see | |
| 38 | the last page of <sys/stat.h>. The real work is done by the `x' | |
| 39 | function which is passed a version number argument. We arrange in the | |
| 40 | makefile that when not inlined this function is always statically | |
| 41 | linked; that way a dynamically-linked executable always encodes the | |
| 42 | version number corresponding to the data structures it uses, so the `x' | |
| 43 | functions in the shared library can adapt without needing to recompile | |
| 44 | all callers. */ | |
| 45 | ||
| 46 | #undef lstat64 | |
| 47 | int | |
| 48 | attribute_hidden | |
| 49 | lstat64 (const char *file, struct stat64 *buf) | |
| 50 | { | |
| 51 | return __lxstat64 (_STAT_VER, file, buf); | |
| 52 | } |
lib/libc/glibc/io/mknod.c+5-33| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -6,23 +6,6 @@ |
| 6 | 6 | License as published by the Free Software Foundation; either |
| 7 | 7 | version 2.1 of the License, or (at your option) any later version. |
| 8 | 8 | |
| 9 | In addition to the permissions in the GNU Lesser General Public | |
| 10 | License, the Free Software Foundation gives you unlimited | |
| 11 | permission to link the compiled version of this file with other | |
| 12 | programs, and to distribute those programs without any restriction | |
| 13 | coming from the use of this file. (The GNU Lesser General Public | |
| 14 | License restrictions do apply in other respects; for example, they | |
| 15 | cover modification of the file, and distribution when not linked | |
| 16 | into another program.) | |
| 17 | ||
| 18 | Note that people who make modified versions of this file are not | |
| 19 | obligated to grant this special exception for their modified | |
| 20 | versions; it is their choice whether to do so. The GNU Lesser | |
| 21 | General Public License gives permission to release a modified | |
| 22 | version without this exception; this exception also makes it | |
| 23 | possible to release a modified version which carries forward this | |
| 24 | exception. | |
| 25 | ||
| 26 | 9 | The GNU C Library is distributed in the hope that it will be useful, |
| 27 | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 28 | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| ... | ... | @@ -32,24 +15,13 @@ |
| 32 | 15 | License along with the GNU C Library; if not, see |
| 33 | 16 | <https://www.gnu.org/licenses/>. */ |
| 34 | 17 | |
| 35 | ||
| 36 | #include <sys/types.h> | |
| 37 | 18 | #include <sys/stat.h> |
| 38 | ||
| 39 | /* This definition is only used if inlining fails for this function; see | |
| 40 | the last page of <sys/stat.h>. The real work is done by the `x' | |
| 41 | function which is passed a version number argument. We arrange in the | |
| 42 | makefile that when not inlined this function is always statically | |
| 43 | linked; that way a dynamically-linked executable always encodes the | |
| 44 | version number corresponding to the data structures it uses, so the `x' | |
| 45 | functions in the shared library can adapt without needing to recompile | |
| 46 | all callers. */ | |
| 19 | #include <fcntl.h> | |
| 47 | 20 | |
| 48 | 21 | int |
| 49 | attribute_hidden | |
| 50 | 22 | __mknod (const char *path, mode_t mode, dev_t dev) |
| 51 | 23 | { |
| 52 | return __xmknod (_MKNOD_VER, path, mode, &dev); | |
| 24 | return __mknodat (AT_FDCWD, path, mode, dev); | |
| 53 | 25 | } |
| 54 | ||
| 55 | weak_hidden_alias (__mknod, mknod) | |
| 26 | libc_hidden_def (__mknod) | |
| 27 | weak_alias (__mknod, mknod) |
lib/libc/glibc/io/mknodat.c deleted-53| ... | ... | @@ -1,53 +0,0 @@ |
| 1 | /* Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | In addition to the permissions in the GNU Lesser General Public | |
| 10 | License, the Free Software Foundation gives you unlimited | |
| 11 | permission to link the compiled version of this file with other | |
| 12 | programs, and to distribute those programs without any restriction | |
| 13 | coming from the use of this file. (The GNU Lesser General Public | |
| 14 | License restrictions do apply in other respects; for example, they | |
| 15 | cover modification of the file, and distribution when not linked | |
| 16 | into another program.) | |
| 17 | ||
| 18 | Note that people who make modified versions of this file are not | |
| 19 | obligated to grant this special exception for their modified | |
| 20 | versions; it is their choice whether to do so. The GNU Lesser | |
| 21 | General Public License gives permission to release a modified | |
| 22 | version without this exception; this exception also makes it | |
| 23 | possible to release a modified version which carries forward this | |
| 24 | exception. | |
| 25 | ||
| 26 | The GNU C Library is distributed in the hope that it will be useful, | |
| 27 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 28 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 29 | Lesser General Public License for more details. | |
| 30 | ||
| 31 | You should have received a copy of the GNU Lesser General Public | |
| 32 | License along with the GNU C Library; if not, see | |
| 33 | <https://www.gnu.org/licenses/>. */ | |
| 34 | ||
| 35 | ||
| 36 | #include <sys/types.h> | |
| 37 | #include <sys/stat.h> | |
| 38 | ||
| 39 | /* This definition is only used if inlining fails for this function; see | |
| 40 | the last page of <sys/stat.h>. The real work is done by the `x' | |
| 41 | function which is passed a version number argument. We arrange in the | |
| 42 | makefile that when not inlined this function is always statically | |
| 43 | linked; that way a dynamically-linked executable always encodes the | |
| 44 | version number corresponding to the data structures it uses, so the `x' | |
| 45 | functions in the shared library can adapt without needing to recompile | |
| 46 | all callers. */ | |
| 47 | ||
| 48 | int | |
| 49 | attribute_hidden | |
| 50 | mknodat (int fd, const char *path, mode_t mode, dev_t dev) | |
| 51 | { | |
| 52 | return __xmknodat (_MKNOD_VER, fd, path, mode, &dev); | |
| 53 | } |
lib/libc/glibc/io/stat.c deleted-54| ... | ... | @@ -1,54 +0,0 @@ |
| 1 | /* Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | In addition to the permissions in the GNU Lesser General Public | |
| 10 | License, the Free Software Foundation gives you unlimited | |
| 11 | permission to link the compiled version of this file with other | |
| 12 | programs, and to distribute those programs without any restriction | |
| 13 | coming from the use of this file. (The GNU Lesser General Public | |
| 14 | License restrictions do apply in other respects; for example, they | |
| 15 | cover modification of the file, and distribution when not linked | |
| 16 | into another program.) | |
| 17 | ||
| 18 | Note that people who make modified versions of this file are not | |
| 19 | obligated to grant this special exception for their modified | |
| 20 | versions; it is their choice whether to do so. The GNU Lesser | |
| 21 | General Public License gives permission to release a modified | |
| 22 | version without this exception; this exception also makes it | |
| 23 | possible to release a modified version which carries forward this | |
| 24 | exception. | |
| 25 | ||
| 26 | The GNU C Library is distributed in the hope that it will be useful, | |
| 27 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 28 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 29 | Lesser General Public License for more details. | |
| 30 | ||
| 31 | You should have received a copy of the GNU Lesser General Public | |
| 32 | License along with the GNU C Library; if not, see | |
| 33 | <https://www.gnu.org/licenses/>. */ | |
| 34 | ||
| 35 | #include <sys/stat.h> | |
| 36 | ||
| 37 | /* This definition is only used if inlining fails for this function; see | |
| 38 | the last page of <sys/stat.h>. The real work is done by the `x' | |
| 39 | function which is passed a version number argument. We arrange in the | |
| 40 | makefile that when not inlined this function is always statically | |
| 41 | linked; that way a dynamically-linked executable always encodes the | |
| 42 | version number corresponding to the data structures it uses, so the `x' | |
| 43 | functions in the shared library can adapt without needing to recompile | |
| 44 | all callers. */ | |
| 45 | ||
| 46 | #undef stat | |
| 47 | int | |
| 48 | attribute_hidden | |
| 49 | __stat (const char *file, struct stat *buf) | |
| 50 | { | |
| 51 | return __xstat (_STAT_VER, file, buf); | |
| 52 | } | |
| 53 | ||
| 54 | weak_hidden_alias (__stat, stat) |
lib/libc/glibc/io/stat64.c deleted-52| ... | ... | @@ -1,52 +0,0 @@ |
| 1 | /* Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | In addition to the permissions in the GNU Lesser General Public | |
| 10 | License, the Free Software Foundation gives you unlimited | |
| 11 | permission to link the compiled version of this file with other | |
| 12 | programs, and to distribute those programs without any restriction | |
| 13 | coming from the use of this file. (The GNU Lesser General Public | |
| 14 | License restrictions do apply in other respects; for example, they | |
| 15 | cover modification of the file, and distribution when not linked | |
| 16 | into another program.) | |
| 17 | ||
| 18 | Note that people who make modified versions of this file are not | |
| 19 | obligated to grant this special exception for their modified | |
| 20 | versions; it is their choice whether to do so. The GNU Lesser | |
| 21 | General Public License gives permission to release a modified | |
| 22 | version without this exception; this exception also makes it | |
| 23 | possible to release a modified version which carries forward this | |
| 24 | exception. | |
| 25 | ||
| 26 | The GNU C Library is distributed in the hope that it will be useful, | |
| 27 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 28 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 29 | Lesser General Public License for more details. | |
| 30 | ||
| 31 | You should have received a copy of the GNU Lesser General Public | |
| 32 | License along with the GNU C Library; if not, see | |
| 33 | <https://www.gnu.org/licenses/>. */ | |
| 34 | ||
| 35 | #include <sys/stat.h> | |
| 36 | ||
| 37 | /* This definition is only used if inlining fails for this function; see | |
| 38 | the last page of <sys/stat.h>. The real work is done by the `x' | |
| 39 | function which is passed a version number argument. We arrange in the | |
| 40 | makefile that when not inlined this function is always statically | |
| 41 | linked; that way a dynamically-linked executable always encodes the | |
| 42 | version number corresponding to the data structures it uses, so the `x' | |
| 43 | functions in the shared library can adapt without needing to recompile | |
| 44 | all callers. */ | |
| 45 | ||
| 46 | #undef stat64 | |
| 47 | int | |
| 48 | attribute_hidden | |
| 49 | stat64 (const char *file, struct stat64 *buf) | |
| 50 | { | |
| 51 | return __xstat64 (_STAT_VER, file, buf); | |
| 52 | } |
lib/libc/glibc/io/sys/stat.h+101-167| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -209,21 +209,51 @@ extern int stat (const char *__restrict __file, |
| 209 | 209 | that file descriptor FD is open on and put them in BUF. */ |
| 210 | 210 | extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2)); |
| 211 | 211 | #else |
| 212 | # ifdef __REDIRECT_NTH | |
| 212 | # ifdef __USE_TIME_BITS64 | |
| 213 | # ifdef __REDIRECT_NTH | |
| 214 | extern int __REDIRECT_NTH (stat, (const char *__restrict __file, | |
| 215 | 				 struct stat *__restrict __buf), | |
| 216 | 				 __stat64_time64) | |
| 217 | __nonnull ((1, 2)); | |
| 218 | extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), | |
| 219 | 				 __fstat64_time64) | |
| 220 | __nonnull ((2)); | |
| 221 | # else | |
| 222 | # define stat __stat64_time64 | |
| 223 | # define fstat __fstat64_time64 | |
| 224 | # endif | |
| 225 | # else | |
| 226 | # ifdef __REDIRECT_NTH | |
| 213 | 227 | extern int __REDIRECT_NTH (stat, (const char *__restrict __file, |
| 214 | 228 | 				 struct stat *__restrict __buf), stat64) |
| 215 | 229 | __nonnull ((1, 2)); |
| 216 | 230 | extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64) |
| 217 | 231 | __nonnull ((2)); |
| 218 | # else | |
| 219 | # define stat stat64 | |
| 220 | # define fstat fstat64 | |
| 232 | # else | |
| 233 | # define stat stat64 | |
| 234 | # define fstat fstat64 | |
| 235 | # endif | |
| 221 | 236 | # endif |
| 222 | 237 | #endif |
| 223 | 238 | #ifdef __USE_LARGEFILE64 |
| 239 | # ifndef __USE_TIME_BITS64 | |
| 224 | 240 | extern int stat64 (const char *__restrict __file, |
| 225 | 241 | 		 struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); |
| 226 | 242 | extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2)); |
| 243 | # else | |
| 244 | # ifdef __REDIRECT_NTH | |
| 245 | extern int __REDIRECT_NTH (stat64, (const char *__restrict __file, | |
| 246 | 				 struct stat64 *__restrict __buf), | |
| 247 | 			 __stat64_time64) | |
| 248 | __nonnull ((1, 2)); | |
| 249 | extern int __REDIRECT_NTH (fstat64, (int __fd, struct stat64 *__buf), | |
| 250 | 			 __fstat64_time64) | |
| 251 | __nonnull ((2)); | |
| 252 | # else | |
| 253 | # define stat64 __stat64_time64 | |
| 254 | # define fstat64 __fstat64_time | |
| 255 | # endif | |
| 256 | # endif | |
| 227 | 257 | #endif |
| 228 | 258 | |
| 229 | 259 | #ifdef __USE_ATFILE |
| ... | ... | @@ -235,20 +265,44 @@ extern int fstatat (int __fd, const char *__restrict __file, |
| 235 | 265 | 		 struct stat *__restrict __buf, int __flag) |
| 236 | 266 | __THROW __nonnull ((2, 3)); |
| 237 | 267 | # else |
| 238 | # ifdef __REDIRECT_NTH | |
| 268 | # ifdef __USE_TIME_BITS64 | |
| 269 | # ifdef __REDIRECT_NTH | |
| 239 | 270 | extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, |
| 240 | 271 | 				 struct stat *__restrict __buf, |
| 241 | 272 | 				 int __flag), |
| 242 | 			 fstatat64) __nonnull ((2, 3)); | |
| 273 | 			 __fstatat64_time64) __nonnull ((2, 3)); | |
| 274 | # else | |
| 275 | # define fstatat __fstatat64_time64 | |
| 276 | # endif | |
| 243 | 277 | # else |
| 244 | # define fstatat fstatat64 | |
| 278 | # ifdef __REDIRECT_NTH | |
| 279 | extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, | |
| 280 | 				 struct stat *__restrict __buf, | |
| 281 | 				 int __flag), | |
| 282 | 			 fstatat64) __nonnull ((2, 3)); | |
| 283 | # else | |
| 284 | # define fstatat fstatat64 | |
| 285 | # endif | |
| 245 | 286 | # endif |
| 246 | 287 | # endif |
| 247 | 288 | |
| 248 | 289 | # ifdef __USE_LARGEFILE64 |
| 290 | # ifndef __USE_TIME_BITS64 | |
| 249 | 291 | extern int fstatat64 (int __fd, const char *__restrict __file, |
| 250 | 292 | 		 struct stat64 *__restrict __buf, int __flag) |
| 251 | 293 | __THROW __nonnull ((2, 3)); |
| 294 | # else | |
| 295 | # ifdef __REDIRECT_NTH | |
| 296 | extern int __REDIRECT_NTH (fstatat64, (int __fd, | |
| 297 | 				 const char *__restrict __file, | |
| 298 | 				 struct stat64 *__restrict __buf, | |
| 299 | 				 int __flag), | |
| 300 | 			 __fstatat64_time64) | |
| 301 | __nonnull ((2, 3)); | |
| 302 | # else | |
| 303 | # define fstatat64 __fstatat64_time64 | |
| 304 | # endif | |
| 305 | # endif | |
| 252 | 306 | # endif |
| 253 | 307 | #endif |
| 254 | 308 | |
| ... | ... | @@ -259,19 +313,37 @@ extern int fstatat64 (int __fd, const char *__restrict __file, |
| 259 | 313 | extern int lstat (const char *__restrict __file, |
| 260 | 314 | 		 struct stat *__restrict __buf) __THROW __nonnull ((1, 2)); |
| 261 | 315 | # else |
| 262 | # ifdef __REDIRECT_NTH | |
| 316 | # ifdef __USE_TIME_BITS64 | |
| 317 | # ifdef __REDIRECT_NTH | |
| 263 | 318 | extern int __REDIRECT_NTH (lstat, |
| 264 | 319 | 			 (const char *__restrict __file, |
| 265 | 			 struct stat *__restrict __buf), lstat64) | |
| 320 | 			 struct stat *__restrict __buf), __lstat64_time64) | |
| 266 | 321 | __nonnull ((1, 2)); |
| 322 | # else | |
| 323 | # define lstat __lstat64_time64 | |
| 324 | # endif | |
| 267 | 325 | # else |
| 268 | # define lstat lstat64 | |
| 326 | # ifdef __REDIRECT_NTH | |
| 327 | extern int __REDIRECT_NTH (lstat, | |
| 328 | 			 (const char *__restrict __file, | |
| 329 | 			 struct stat *__restrict __buf), lstat64) | |
| 330 | __nonnull ((1, 2)); | |
| 331 | # else | |
| 332 | # define lstat lstat64 | |
| 333 | # endif | |
| 269 | 334 | # endif |
| 270 | 335 | # endif |
| 271 | 336 | # ifdef __USE_LARGEFILE64 |
| 337 | # ifndef __USE_TIME_BITS64 | |
| 272 | 338 | extern int lstat64 (const char *__restrict __file, |
| 273 | 339 | 		 struct stat64 *__restrict __buf) |
| 274 | 340 | __THROW __nonnull ((1, 2)); |
| 341 | # else | |
| 342 | extern int __REDIRECT_NTH (lstat64, (const char *__restrict __file, | |
| 343 | 				 struct stat64 *__restrict __buf), | |
| 344 | 			 __lstat64_time64) | |
| 345 | __nonnull ((1, 2)); | |
| 346 | # endif | |
| 275 | 347 | # endif |
| 276 | 348 | #endif |
| 277 | 349 | |
| ... | ... | @@ -355,182 +427,44 @@ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode) |
| 355 | 427 | #endif |
| 356 | 428 | |
| 357 | 429 | #ifdef __USE_ATFILE |
| 430 | # ifndef __USE_TIME_BITS64 | |
| 358 | 431 | /* Set file access and modification times relative to directory file |
| 359 | 432 | descriptor. */ |
| 360 | 433 | extern int utimensat (int __fd, const char *__path, |
| 361 | 434 | 		 const struct timespec __times[2], |
| 362 | 435 | 		 int __flags) |
| 363 | 436 | __THROW __nonnull ((2)); |
| 437 | # else | |
| 438 | # ifdef __REDIRECT_NTH | |
| 439 | extern int __REDIRECT_NTH (utimensat, (int fd, const char *__path, | |
| 440 | const struct timespec __times[2], | |
| 441 | int flags), | |
| 442 | __utimensat64) __nonnull ((2)); | |
| 443 | # else | |
| 444 | # define utimensat __utimensat64 | |
| 445 | # endif | |
| 446 | # endif | |
| 364 | 447 | #endif |
| 365 | 448 | |
| 366 | 449 | #ifdef __USE_XOPEN2K8 |
| 450 | # ifndef __USE_TIME_BITS64 | |
| 367 | 451 | /* Set file access and modification times of the file associated with FD. */ |
| 368 | 452 | extern int futimens (int __fd, const struct timespec __times[2]) __THROW; |
| 369 | #endif | |
| 370 | ||
| 371 | /* To allow the `struct stat' structure and the file type `mode_t' | |
| 372 | bits to vary without changing shared library major version number, | |
| 373 | the `stat' family of functions and `mknod' are in fact inline | |
| 374 | wrappers around calls to `xstat', `fxstat', `lxstat', and `xmknod', | |
| 375 | which all take a leading version-number argument designating the | |
| 376 | data structure and bits used. <bits/stat.h> defines _STAT_VER with | |
| 377 | the version number corresponding to `struct stat' as defined in | |
| 378 | that file; and _MKNOD_VER with the version number corresponding to | |
| 379 | the S_IF* macros defined therein. It is arranged that when not | |
| 380 | inlined these function are always statically linked; that way a | |
| 381 | dynamically-linked executable always encodes the version number | |
| 382 | corresponding to the data structures it uses, so the `x' functions | |
| 383 | in the shared library can adapt without needing to recompile all | |
| 384 | callers. */ | |
| 385 | ||
| 386 | #ifndef _STAT_VER | |
| 387 | # define _STAT_VER	0 | |
| 388 | #endif | |
| 389 | #ifndef _MKNOD_VER | |
| 390 | # define _MKNOD_VER	0 | |
| 391 | #endif | |
| 392 | ||
| 393 | /* Wrappers for stat and mknod system calls. */ | |
| 394 | #ifndef __USE_FILE_OFFSET64 | |
| 395 | extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) | |
| 396 | __THROW __nonnull ((3)); | |
| 397 | extern int __xstat (int __ver, const char *__filename, | |
| 398 | 		 struct stat *__stat_buf) __THROW __nonnull ((2, 3)); | |
| 399 | extern int __lxstat (int __ver, const char *__filename, | |
| 400 | 		 struct stat *__stat_buf) __THROW __nonnull ((2, 3)); | |
| 401 | extern int __fxstatat (int __ver, int __fildes, const char *__filename, | |
| 402 | 		 struct stat *__stat_buf, int __flag) | |
| 403 | __THROW __nonnull ((3, 4)); | |
| 404 | #else | |
| 405 | # ifdef __REDIRECT_NTH | |
| 406 | extern int __REDIRECT_NTH (__fxstat, (int __ver, int __fildes, | |
| 407 | 				 struct stat *__stat_buf), __fxstat64) | |
| 408 | __nonnull ((3)); | |
| 409 | extern int __REDIRECT_NTH (__xstat, (int __ver, const char *__filename, | |
| 410 | 				 struct stat *__stat_buf), __xstat64) | |
| 411 | __nonnull ((2, 3)); | |
| 412 | extern int __REDIRECT_NTH (__lxstat, (int __ver, const char *__filename, | |
| 413 | 				 struct stat *__stat_buf), __lxstat64) | |
| 414 | __nonnull ((2, 3)); | |
| 415 | extern int __REDIRECT_NTH (__fxstatat, (int __ver, int __fildes, | |
| 416 | 					const char *__filename, | |
| 417 | 					struct stat *__stat_buf, int __flag), | |
| 418 | 			 __fxstatat64) __nonnull ((3, 4)); | |
| 419 | 453 | |
| 420 | 454 | # else |
| 421 | # define __fxstat __fxstat64 | |
| 422 | # define __xstat __xstat64 | |
| 423 | # define __lxstat __lxstat64 | |
| 455 | # ifdef __REDIRECT_NTH | |
| 456 | extern int __REDIRECT_NTH (futimens, (int fd, const struct timespec __times[2]), | |
| 457 | __futimens64); | |
| 458 | # else | |
| 459 | # define futimens __futimens64 | |
| 460 | # endif | |
| 424 | 461 | # endif |
| 425 | 462 | #endif |
| 426 | 463 | |
| 427 | #ifdef __USE_LARGEFILE64 | |
| 428 | extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf) | |
| 429 | __THROW __nonnull ((3)); | |
| 430 | extern int __xstat64 (int __ver, const char *__filename, | |
| 431 | 		 struct stat64 *__stat_buf) __THROW __nonnull ((2, 3)); | |
| 432 | extern int __lxstat64 (int __ver, const char *__filename, | |
| 433 | 		 struct stat64 *__stat_buf) __THROW __nonnull ((2, 3)); | |
| 434 | extern int __fxstatat64 (int __ver, int __fildes, const char *__filename, | |
| 435 | 			 struct stat64 *__stat_buf, int __flag) | |
| 436 | __THROW __nonnull ((3, 4)); | |
| 437 | #endif | |
| 438 | extern int __xmknod (int __ver, const char *__path, __mode_t __mode, | |
| 439 | 		 __dev_t *__dev) __THROW __nonnull ((2, 4)); | |
| 440 | ||
| 441 | extern int __xmknodat (int __ver, int __fd, const char *__path, | |
| 442 | 		 __mode_t __mode, __dev_t *__dev) | |
| 443 | __THROW __nonnull ((3, 5)); | |
| 444 | ||
| 445 | 464 | #ifdef __USE_GNU |
| 446 | 465 | # include <bits/statx.h> |
| 447 | 466 | #endif |
| 448 | 467 | |
| 449 | #ifdef __USE_EXTERN_INLINES | |
| 450 | /* Inlined versions of the real stat and mknod functions. */ | |
| 451 | ||
| 452 | __extern_inline int | |
| 453 | __NTH (stat (const char *__path, struct stat *__statbuf)) | |
| 454 | { | |
| 455 | return __xstat (_STAT_VER, __path, __statbuf); | |
| 456 | } | |
| 457 | ||
| 458 | # if defined __USE_MISC || defined __USE_XOPEN_EXTENDED | |
| 459 | __extern_inline int | |
| 460 | __NTH (lstat (const char *__path, struct stat *__statbuf)) | |
| 461 | { | |
| 462 | return __lxstat (_STAT_VER, __path, __statbuf); | |
| 463 | } | |
| 464 | # endif | |
| 465 | ||
| 466 | __extern_inline int | |
| 467 | __NTH (fstat (int __fd, struct stat *__statbuf)) | |
| 468 | { | |
| 469 | return __fxstat (_STAT_VER, __fd, __statbuf); | |
| 470 | } | |
| 471 | ||
| 472 | # ifdef __USE_ATFILE | |
| 473 | __extern_inline int | |
| 474 | __NTH (fstatat (int __fd, const char *__filename, struct stat *__statbuf, | |
| 475 | 		int __flag)) | |
| 476 | { | |
| 477 | return __fxstatat (_STAT_VER, __fd, __filename, __statbuf, __flag); | |
| 478 | } | |
| 479 | # endif | |
| 480 | ||
| 481 | # ifdef __USE_MISC | |
| 482 | __extern_inline int | |
| 483 | __NTH (mknod (const char *__path, __mode_t __mode, __dev_t __dev)) | |
| 484 | { | |
| 485 | return __xmknod (_MKNOD_VER, __path, __mode, &__dev); | |
| 486 | } | |
| 487 | # endif | |
| 488 | ||
| 489 | # ifdef __USE_ATFILE | |
| 490 | __extern_inline int | |
| 491 | __NTH (mknodat (int __fd, const char *__path, __mode_t __mode, | |
| 492 | 		__dev_t __dev)) | |
| 493 | { | |
| 494 | return __xmknodat (_MKNOD_VER, __fd, __path, __mode, &__dev); | |
| 495 | } | |
| 496 | # endif | |
| 497 | ||
| 498 | # if defined __USE_LARGEFILE64 \ | |
| 499 | && (! defined __USE_FILE_OFFSET64 \ | |
| 500 | || (defined __REDIRECT_NTH && defined __OPTIMIZE__)) | |
| 501 | __extern_inline int | |
| 502 | __NTH (stat64 (const char *__path, struct stat64 *__statbuf)) | |
| 503 | { | |
| 504 | return __xstat64 (_STAT_VER, __path, __statbuf); | |
| 505 | } | |
| 506 | ||
| 507 | # if defined __USE_MISC || defined __USE_XOPEN_EXTENDED | |
| 508 | __extern_inline int | |
| 509 | __NTH (lstat64 (const char *__path, struct stat64 *__statbuf)) | |
| 510 | { | |
| 511 | return __lxstat64 (_STAT_VER, __path, __statbuf); | |
| 512 | } | |
| 513 | # endif | |
| 514 | ||
| 515 | __extern_inline int | |
| 516 | __NTH (fstat64 (int __fd, struct stat64 *__statbuf)) | |
| 517 | { | |
| 518 | return __fxstat64 (_STAT_VER, __fd, __statbuf); | |
| 519 | } | |
| 520 | ||
| 521 | # ifdef __USE_ATFILE | |
| 522 | __extern_inline int | |
| 523 | __NTH (fstatat64 (int __fd, const char *__filename, struct stat64 *__statbuf, | |
| 524 | 		 int __flag)) | |
| 525 | { | |
| 526 | return __fxstatat64 (_STAT_VER, __fd, __filename, __statbuf, __flag); | |
| 527 | } | |
| 528 | # endif | |
| 529 | ||
| 530 | # endif | |
| 531 | ||
| 532 | #endif | |
| 533 | ||
| 534 | 468 | __END_DECLS |
| 535 | 469 | |
| 536 | 470 |
lib/libc/glibc/locale/bits/types/__locale_t.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Definition of struct __locale_struct and __locale_t. |
| 2 | Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. |
| 5 | 5 |
lib/libc/glibc/locale/bits/types/locale_t.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Definition of locale_t. |
| 2 | Copyright (C) 2017-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/misc/sys/cdefs.h+187-69| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -25,7 +25,7 @@ |
| 25 | 25 | |
| 26 | 26 | /* The GNU libc does not support any K&R compilers or the traditional mode |
| 27 | 27 | of ISO C compilers anymore. Check for some of the combinations not |
| 28 | anymore supported. */ | |
| 28 | supported anymore. */ | |
| 29 | 29 | #if defined __GNUC__ && !defined __STDC__ |
| 30 | 30 | # error "You need a ISO C conforming compiler to use the glibc headers" |
| 31 | 31 | #endif |
| ... | ... | @@ -34,7 +34,29 @@ |
| 34 | 34 | #undef	__P |
| 35 | 35 | #undef	__PMT |
| 36 | 36 | |
| 37 | #ifdef __GNUC__ | |
| 37 | /* Compilers that lack __has_attribute may object to | |
| 38 | #if defined __has_attribute && __has_attribute (...) | |
| 39 | even though they do not need to evaluate the right-hand side of the &&. | |
| 40 | Similarly for __has_builtin, etc. */ | |
| 41 | #if (defined __has_attribute \ | |
| 42 | && (!defined __clang_minor__ \ | |
| 43 | || 3 < __clang_major__ + (5 <= __clang_minor__))) | |
| 44 | # define __glibc_has_attribute(attr) __has_attribute (attr) | |
| 45 | #else | |
| 46 | # define __glibc_has_attribute(attr) 0 | |
| 47 | #endif | |
| 48 | #ifdef __has_builtin | |
| 49 | # define __glibc_has_builtin(name) __has_builtin (name) | |
| 50 | #else | |
| 51 | # define __glibc_has_builtin(name) 0 | |
| 52 | #endif | |
| 53 | #ifdef __has_extension | |
| 54 | # define __glibc_has_extension(ext) __has_extension (ext) | |
| 55 | #else | |
| 56 | # define __glibc_has_extension(ext) 0 | |
| 57 | #endif | |
| 58 | ||
| 59 | #if defined __GNUC__ || defined __clang__ | |
| 38 | 60 | |
| 39 | 61 | /* All functions, except those with callbacks or those that |
| 40 | 62 | synchronize memory, are leaf functions. */ |
| ... | ... | @@ -47,21 +69,26 @@ |
| 47 | 69 | # endif |
| 48 | 70 | |
| 49 | 71 | /* GCC can always grok prototypes. For C++ programs we add throw() |
| 50 | to help it optimize the function calls. But this works only with | |
| 51 | gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions | |
| 72 | to help it optimize the function calls. But this only works with | |
| 73 | gcc 2.8.x and egcs. For gcc 3.4 and up we even mark C functions | |
| 52 | 74 | as non-throwing using a function attribute since programs can use |
| 53 | 75 | the -fexceptions options for C code as well. */ |
| 54 | # if !defined __cplusplus && __GNUC_PREREQ (3, 3) | |
| 76 | # if !defined __cplusplus \ | |
| 77 | && (__GNUC_PREREQ (3, 4) || __glibc_has_attribute (__nothrow__)) | |
| 55 | 78 | # define __THROW	__attribute__ ((__nothrow__ __LEAF)) |
| 56 | 79 | # define __THROWNL	__attribute__ ((__nothrow__)) |
| 57 | 80 | # define __NTH(fct)	__attribute__ ((__nothrow__ __LEAF)) fct |
| 58 | 81 | # define __NTHNL(fct) __attribute__ ((__nothrow__)) fct |
| 59 | 82 | # else |
| 60 | # if defined __cplusplus && __GNUC_PREREQ (2,8) | |
| 61 | # define __THROW	throw () | |
| 62 | # define __THROWNL	throw () | |
| 63 | # define __NTH(fct)	__LEAF_ATTR fct throw () | |
| 64 | # define __NTHNL(fct) fct throw () | |
| 83 | # if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4) | |
| 84 | # if __cplusplus >= 201103L | |
| 85 | # define __THROW	noexcept (true) | |
| 86 | # else | |
| 87 | # define __THROW	throw () | |
| 88 | # endif | |
| 89 | # define __THROWNL	__THROW | |
| 90 | # define __NTH(fct)	__LEAF_ATTR fct __THROW | |
| 91 | # define __NTHNL(fct) fct __THROW | |
| 65 | 92 | # else |
| 66 | 93 | # define __THROW |
| 67 | 94 | # define __THROWNL |
| ... | ... | @@ -70,7 +97,7 @@ |
| 70 | 97 | # endif |
| 71 | 98 | # endif |
| 72 | 99 | |
| 73 | #else	/* Not GCC. */ | |
| 100 | #else	/* Not GCC or clang. */ | |
| 74 | 101 | |
| 75 | 102 | # if (defined __cplusplus						\ |
| 76 | 103 | || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) |
| ... | ... | @@ -83,16 +110,7 @@ |
| 83 | 110 | # define __THROWNL |
| 84 | 111 | # define __NTH(fct)	fct |
| 85 | 112 | |
| 86 | #endif	/* GCC. */ | |
| 87 | ||
| 88 | /* Compilers that are not clang may object to | |
| 89 | #if defined __clang__ && __has_extension(...) | |
| 90 | even though they do not need to evaluate the right-hand side of the &&. */ | |
| 91 | #if defined __clang__ && defined __has_extension | |
| 92 | # define __glibc_clang_has_extension(ext) __has_extension (ext) | |
| 93 | #else | |
| 94 | # define __glibc_clang_has_extension(ext) 0 | |
| 95 | #endif | |
| 113 | #endif	/* GCC || clang. */ | |
| 96 | 114 | |
| 97 | 115 | /* These two macros are not used in glibc anymore. They are kept here |
| 98 | 116 | only because some other projects expect the macros to be defined. */ |
| ... | ... | @@ -123,14 +141,20 @@ |
| 123 | 141 | #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) |
| 124 | 142 | #define __bos0(ptr) __builtin_object_size (ptr, 0) |
| 125 | 143 | |
| 144 | /* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */ | |
| 145 | #if __USE_FORTIFY_LEVEL == 3 && __glibc_clang_prereq (9, 0) | |
| 146 | # define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0) | |
| 147 | # define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1) | |
| 148 | #else | |
| 149 | # define __glibc_objsize0(__o) __bos0 (__o) | |
| 150 | # define __glibc_objsize(__o) __bos (__o) | |
| 151 | #endif | |
| 152 | ||
| 126 | 153 | #if __GNUC_PREREQ (4,3) |
| 127 | # define __warndecl(name, msg) \ | |
| 128 | extern void name (void) __attribute__((__warning__ (msg))) | |
| 129 | 154 | # define __warnattr(msg) __attribute__((__warning__ (msg))) |
| 130 | 155 | # define __errordecl(name, msg) \ |
| 131 | 156 | extern void name (void) __attribute__((__error__ (msg))) |
| 132 | 157 | #else |
| 133 | # define __warndecl(name, msg) extern void name (void) | |
| 134 | 158 | # define __warnattr(msg) |
| 135 | 159 | # define __errordecl(name, msg) extern void name (void) |
| 136 | 160 | #endif |
| ... | ... | @@ -139,11 +163,11 @@ |
| 139 | 163 | Headers that should use flexible arrays only if they're "real" |
| 140 | 164 | (e.g. only if they won't affect sizeof()) should test |
| 141 | 165 | #if __glibc_c99_flexarr_available. */ |
| 142 | #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L | |
| 166 | #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc | |
| 143 | 167 | # define __flexarr	[] |
| 144 | 168 | # define __glibc_c99_flexarr_available 1 |
| 145 | #elif __GNUC_PREREQ (2,97) | |
| 146 | /* GCC 2.97 supports C99 flexible array members as an extension, | |
| 169 | #elif __GNUC_PREREQ (2,97) || defined __clang__ | |
| 170 | /* GCC 2.97 and clang support C99 flexible array members as an extension, | |
| 147 | 171 | even when in C89 mode or compiling C++ (any version). */ |
| 148 | 172 | # define __flexarr	[] |
| 149 | 173 | # define __glibc_c99_flexarr_available 1 |
| ... | ... | @@ -169,7 +193,7 @@ |
| 169 | 193 | Example: |
| 170 | 194 | int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ |
| 171 | 195 | |
| 172 | #if defined __GNUC__ && __GNUC__ >= 2 | |
| 196 | #if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4) | |
| 173 | 197 | |
| 174 | 198 | # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) |
| 175 | 199 | # ifdef __cplusplus |
| ... | ... | @@ -194,17 +218,17 @@ |
| 194 | 218 | */ |
| 195 | 219 | #endif |
| 196 | 220 | |
| 197 | /* GCC has various useful declarations that can be made with the | |
| 198 | `__attribute__' syntax. All of the ways we use this do fine if | |
| 199 | they are omitted for compilers that don't understand it. */ | |
| 200 | #if !defined __GNUC__ || __GNUC__ < 2 | |
| 221 | /* GCC and clang have various useful declarations that can be made with | |
| 222 | the '__attribute__' syntax. All of the ways we use this do fine if | |
| 223 | they are omitted for compilers that don't understand it. */ | |
| 224 | #if !(defined __GNUC__ || defined __clang__) | |
| 201 | 225 | # define __attribute__(xyz)	/* Ignore */ |
| 202 | 226 | #endif |
| 203 | 227 | |
| 204 | 228 | /* At some point during the gcc 2.96 development the `malloc' attribute |
| 205 | 229 | for functions was introduced. We don't want to use it unconditionally |
| 206 | 230 | (although this would be possible) since it generates warnings. */ |
| 207 | #if __GNUC_PREREQ (2,96) | |
| 231 | #if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__malloc__) | |
| 208 | 232 | # define __attribute_malloc__ __attribute__ ((__malloc__)) |
| 209 | 233 | #else |
| 210 | 234 | # define __attribute_malloc__ /* Ignore */ |
| ... | ... | @@ -222,23 +246,29 @@ |
| 222 | 246 | /* At some point during the gcc 2.96 development the `pure' attribute |
| 223 | 247 | for functions was introduced. We don't want to use it unconditionally |
| 224 | 248 | (although this would be possible) since it generates warnings. */ |
| 225 | #if __GNUC_PREREQ (2,96) | |
| 249 | #if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__pure__) | |
| 226 | 250 | # define __attribute_pure__ __attribute__ ((__pure__)) |
| 227 | 251 | #else |
| 228 | 252 | # define __attribute_pure__ /* Ignore */ |
| 229 | 253 | #endif |
| 230 | 254 | |
| 231 | 255 | /* This declaration tells the compiler that the value is constant. */ |
| 232 | #if __GNUC_PREREQ (2,5) | |
| 256 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__) | |
| 233 | 257 | # define __attribute_const__ __attribute__ ((__const__)) |
| 234 | 258 | #else |
| 235 | 259 | # define __attribute_const__ /* Ignore */ |
| 236 | 260 | #endif |
| 237 | 261 | |
| 262 | #if __GNUC_PREREQ (2,7) || __glibc_has_attribute (__unused__) | |
| 263 | # define __attribute_maybe_unused__ __attribute__ ((__unused__)) | |
| 264 | #else | |
| 265 | # define __attribute_maybe_unused__ /* Ignore */ | |
| 266 | #endif | |
| 267 | ||
| 238 | 268 | /* At some point during the gcc 3.1 development the `used' attribute |
| 239 | 269 | for functions was introduced. We don't want to use it unconditionally |
| 240 | 270 | (although this would be possible) since it generates warnings. */ |
| 241 | #if __GNUC_PREREQ (3,1) | |
| 271 | #if __GNUC_PREREQ (3,1) || __glibc_has_attribute (__used__) | |
| 242 | 272 | # define __attribute_used__ __attribute__ ((__used__)) |
| 243 | 273 | # define __attribute_noinline__ __attribute__ ((__noinline__)) |
| 244 | 274 | #else |
| ... | ... | @@ -247,7 +277,7 @@ |
| 247 | 277 | #endif |
| 248 | 278 | |
| 249 | 279 | /* Since version 3.2, gcc allows marking deprecated functions. */ |
| 250 | #if __GNUC_PREREQ (3,2) | |
| 280 | #if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__deprecated__) | |
| 251 | 281 | # define __attribute_deprecated__ __attribute__ ((__deprecated__)) |
| 252 | 282 | #else |
| 253 | 283 | # define __attribute_deprecated__ /* Ignore */ |
| ... | ... | @@ -257,7 +287,7 @@ |
| 257 | 287 | when a deprecated function is used. clang claims to be gcc 4.2, but |
| 258 | 288 | may also support this feature. */ |
| 259 | 289 | #if __GNUC_PREREQ (4,5) \ |
| 260 | || __glibc_clang_has_extension (__attribute_deprecated_with_message__) | |
| 290 | || __glibc_has_extension (__attribute_deprecated_with_message__) | |
| 261 | 291 | # define __attribute_deprecated_msg__(msg) \ |
| 262 | 292 | 	 __attribute__ ((__deprecated__ (msg))) |
| 263 | 293 | #else |
| ... | ... | @@ -270,7 +300,7 @@ |
| 270 | 300 | If several `format_arg' attributes are given for the same function, in |
| 271 | 301 | gcc-3.0 and older, all but the last one are ignored. In newer gccs, |
| 272 | 302 | all designated arguments are considered. */ |
| 273 | #if __GNUC_PREREQ (2,8) | |
| 303 | #if __GNUC_PREREQ (2,8) || __glibc_has_attribute (__format_arg__) | |
| 274 | 304 | # define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) |
| 275 | 305 | #else |
| 276 | 306 | # define __attribute_format_arg__(x) /* Ignore */ |
| ... | ... | @@ -280,27 +310,42 @@ |
| 280 | 310 | attribute for functions was introduced. We don't want to use it |
| 281 | 311 | unconditionally (although this would be possible) since it |
| 282 | 312 | generates warnings. */ |
| 283 | #if __GNUC_PREREQ (2,97) | |
| 313 | #if __GNUC_PREREQ (2,97) || __glibc_has_attribute (__format__) | |
| 284 | 314 | # define __attribute_format_strfmon__(a,b) \ |
| 285 | 315 | __attribute__ ((__format__ (__strfmon__, a, b))) |
| 286 | 316 | #else |
| 287 | 317 | # define __attribute_format_strfmon__(a,b) /* Ignore */ |
| 288 | 318 | #endif |
| 289 | 319 | |
| 290 | /* The nonull function attribute allows to mark pointer parameters which | |
| 320 | /* The nonnull function attribute marks pointer parameters that | |
| 291 | 321 | must not be NULL. */ |
| 292 | #if __GNUC_PREREQ (3,3) | |
| 293 | # define __nonnull(params) __attribute__ ((__nonnull__ params)) | |
| 294 | #else | |
| 295 | # define __nonnull(params) | |
| 322 | #ifndef __nonnull | |
| 323 | # if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__) | |
| 324 | # define __nonnull(params) __attribute__ ((__nonnull__ params)) | |
| 325 | # else | |
| 326 | # define __nonnull(params) | |
| 327 | # endif | |
| 328 | #elif !defined __GLIBC__ | |
| 329 | # undef __nonnull | |
| 330 | # define __nonnull(params) _GL_ATTRIBUTE_NONNULL (params) | |
| 331 | #endif | |
| 332 | ||
| 333 | /* The returns_nonnull function attribute marks the return type of the function | |
| 334 | as always being non-null. */ | |
| 335 | #ifndef __returns_nonnull | |
| 336 | # if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__returns_nonnull__) | |
| 337 | # define __returns_nonnull __attribute__ ((__returns_nonnull__)) | |
| 338 | # else | |
| 339 | # define __returns_nonnull | |
| 340 | # endif | |
| 296 | 341 | #endif |
| 297 | 342 | |
| 298 | 343 | /* If fortification mode, we warn about unused results of certain |
| 299 | 344 | function calls which can lead to problems. */ |
| 300 | #if __GNUC_PREREQ (3,4) | |
| 345 | #if __GNUC_PREREQ (3,4) || __glibc_has_attribute (__warn_unused_result__) | |
| 301 | 346 | # define __attribute_warn_unused_result__ \ |
| 302 | 347 | __attribute__ ((__warn_unused_result__)) |
| 303 | # if __USE_FORTIFY_LEVEL > 0 | |
| 348 | # if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0 | |
| 304 | 349 | # define __wur __attribute_warn_unused_result__ |
| 305 | 350 | # endif |
| 306 | 351 | #else |
| ... | ... | @@ -311,7 +356,7 @@ |
| 311 | 356 | #endif |
| 312 | 357 | |
| 313 | 358 | /* Forces a function to be always inlined. */ |
| 314 | #if __GNUC_PREREQ (3,2) | |
| 359 | #if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__always_inline__) | |
| 315 | 360 | /* The Linux kernel defines __always_inline in stddef.h (283d7573), and |
| 316 | 361 | it conflicts with this definition. Therefore undefine it first to |
| 317 | 362 | allow either header to be included first. */ |
| ... | ... | @@ -324,7 +369,7 @@ |
| 324 | 369 | |
| 325 | 370 | /* Associate error messages with the source location of the call site rather |
| 326 | 371 | than with the source location inside the function. */ |
| 327 | #if __GNUC_PREREQ (4,3) | |
| 372 | #if __GNUC_PREREQ (4,3) || __glibc_has_attribute (__artificial__) | |
| 328 | 373 | # define __attribute_artificial__ __attribute__ ((__artificial__)) |
| 329 | 374 | #else |
| 330 | 375 | # define __attribute_artificial__ /* Ignore */ |
| ... | ... | @@ -367,12 +412,14 @@ |
| 367 | 412 | run in pedantic mode if the uses are carefully marked using the |
| 368 | 413 | `__extension__' keyword. But this is not generally available before |
| 369 | 414 | version 2.8. */ |
| 370 | #if !__GNUC_PREREQ (2,8) | |
| 415 | #if !(__GNUC_PREREQ (2,8) || defined __clang__) | |
| 371 | 416 | # define __extension__		/* Ignore */ |
| 372 | 417 | #endif |
| 373 | 418 | |
| 374 | /* __restrict is known in EGCS 1.2 and above. */ | |
| 375 | #if !__GNUC_PREREQ (2,92) | |
| 419 | /* __restrict is known in EGCS 1.2 and above, and in clang. | |
| 420 | It works also in C++ mode (outside of arrays), but only when spelled | |
| 421 | as '__restrict', not 'restrict'. */ | |
| 422 | #if !(__GNUC_PREREQ (2,92) || __clang_major__ >= 3) | |
| 376 | 423 | # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L |
| 377 | 424 | # define __restrict	restrict |
| 378 | 425 | # else |
| ... | ... | @@ -382,8 +429,9 @@ |
| 382 | 429 | |
| 383 | 430 | /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is |
| 384 | 431 | array_name[restrict] |
| 385 | GCC 3.1 supports this. */ | |
| 386 | #if __GNUC_PREREQ (3,1) && !defined __GNUG__ | |
| 432 | GCC 3.1 and clang support this. | |
| 433 | This syntax is not usable in C++ mode. */ | |
| 434 | #if (__GNUC_PREREQ (3,1) || __clang_major__ >= 3) && !defined __cplusplus | |
| 387 | 435 | # define __restrict_arr	__restrict |
| 388 | 436 | #else |
| 389 | 437 | # ifdef __GNUC__ |
| ... | ... | @@ -398,7 +446,7 @@ |
| 398 | 446 | # endif |
| 399 | 447 | #endif |
| 400 | 448 | |
| 401 | #if __GNUC__ >= 3 | |
| 449 | #if (__GNUC__ >= 3) || __glibc_has_builtin (__builtin_expect) | |
| 402 | 450 | # define __glibc_unlikely(cond)	__builtin_expect ((cond), 0) |
| 403 | 451 | # define __glibc_likely(cond)	__builtin_expect ((cond), 1) |
| 404 | 452 | #else |
| ... | ... | @@ -406,15 +454,10 @@ |
| 406 | 454 | # define __glibc_likely(cond)	(cond) |
| 407 | 455 | #endif |
| 408 | 456 | |
| 409 | #ifdef __has_attribute | |
| 410 | # define __glibc_has_attribute(attr)	__has_attribute (attr) | |
| 411 | #else | |
| 412 | # define __glibc_has_attribute(attr)	0 | |
| 413 | #endif | |
| 414 | ||
| 415 | 457 | #if (!defined _Noreturn \ |
| 416 | 458 | && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ |
| 417 | && !__GNUC_PREREQ (4,7)) | |
| 459 | && !(__GNUC_PREREQ (4,7) \ | |
| 460 | || (3 < __clang_major__ + (5 <= __clang_minor__)))) | |
| 418 | 461 | # if __GNUC_PREREQ (2,8) |
| 419 | 462 | # define _Noreturn __attribute__ ((__noreturn__)) |
| 420 | 463 | # else |
| ... | ... | @@ -443,16 +486,51 @@ |
| 443 | 486 | |
| 444 | 487 | #if (!defined _Static_assert && !defined __cplusplus \ |
| 445 | 488 | && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ |
| 446 | && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__)) | |
| 489 | && (!(__GNUC_PREREQ (4, 6) || __clang_major__ >= 4) \ | |
| 490 | || defined __STRICT_ANSI__)) | |
| 447 | 491 | # define _Static_assert(expr, diagnostic) \ |
| 448 | 492 | extern int (*__Static_assert_function (void)) \ |
| 449 | 493 | [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] |
| 450 | 494 | #endif |
| 451 | 495 | |
| 452 | #include <bits/wordsize.h> | |
| 453 | #include <bits/long-double.h> | |
| 496 | /* The #ifndef lets Gnulib avoid including these on non-glibc | |
| 497 | platforms, where the includes typically do not exist. */ | |
| 498 | #ifdef __GLIBC__ | |
| 499 | # include <bits/wordsize.h> | |
| 500 | # include <bits/long-double.h> | |
| 501 | #endif | |
| 502 | ||
| 503 | #if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 | |
| 504 | # ifdef __REDIRECT | |
| 505 | ||
| 506 | /* Alias name defined automatically. */ | |
| 507 | # define __LDBL_REDIR(name, proto) ... unused__ldbl_redir | |
| 508 | # define __LDBL_REDIR_DECL(name) \ | |
| 509 | extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128")); | |
| 510 | ||
| 511 | /* Alias name defined automatically, with leading underscores. */ | |
| 512 | # define __LDBL_REDIR2_DECL(name) \ | |
| 513 | extern __typeof (__##name) __##name \ | |
| 514 | __asm (__ASMNAME ("__" #name "ieee128")); | |
| 515 | ||
| 516 | /* Alias name defined manually. */ | |
| 517 | # define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1 | |
| 518 | # define __LDBL_REDIR1_DECL(name, alias) \ | |
| 519 | extern __typeof (name) name __asm (__ASMNAME (#alias)); | |
| 520 | ||
| 521 | # define __LDBL_REDIR1_NTH(name, proto, alias) \ | |
| 522 | __REDIRECT_NTH (name, proto, alias) | |
| 523 | # define __REDIRECT_NTH_LDBL(name, proto, alias) \ | |
| 524 | __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128) | |
| 525 | ||
| 526 | /* Unused. */ | |
| 527 | # define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl | |
| 528 | # define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth | |
| 454 | 529 | |
| 455 | #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH | |
| 530 | # else | |
| 531 | _Static_assert (0, "IEEE 128-bits long double requires redirection on this platform"); | |
| 532 | # endif | |
| 533 | #elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH | |
| 456 | 534 | # define __LDBL_COMPAT 1 |
| 457 | 535 | # ifdef __REDIRECT |
| 458 | 536 | # define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) |
| ... | ... | @@ -461,6 +539,8 @@ |
| 461 | 539 | # define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) |
| 462 | 540 | # define __LDBL_REDIR_NTH(name, proto) \ |
| 463 | 541 | __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) |
| 542 | # define __LDBL_REDIR2_DECL(name) \ | |
| 543 | extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name)); | |
| 464 | 544 | # define __LDBL_REDIR1_DECL(name, alias) \ |
| 465 | 545 | extern __typeof (name) name __asm (__ASMNAME (#alias)); |
| 466 | 546 | # define __LDBL_REDIR_DECL(name) \ |
| ... | ... | @@ -471,11 +551,13 @@ |
| 471 | 551 | __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) |
| 472 | 552 | # endif |
| 473 | 553 | #endif |
| 474 | #if !defined __LDBL_COMPAT || !defined __REDIRECT | |
| 554 | #if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \ | |
| 555 | || !defined __REDIRECT | |
| 475 | 556 | # define __LDBL_REDIR1(name, proto, alias) name proto |
| 476 | 557 | # define __LDBL_REDIR(name, proto) name proto |
| 477 | 558 | # define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW |
| 478 | 559 | # define __LDBL_REDIR_NTH(name, proto) name proto __THROW |
| 560 | # define __LDBL_REDIR2_DECL(name) | |
| 479 | 561 | # define __LDBL_REDIR_DECL(name) |
| 480 | 562 | # ifdef __REDIRECT |
| 481 | 563 | # define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) |
| ... | ... | @@ -506,7 +588,7 @@ |
| 506 | 588 | check is required to enable the use of generic selection. */ |
| 507 | 589 | #if !defined __cplusplus \ |
| 508 | 590 | && (__GNUC_PREREQ (4, 9) \ |
| 509 | 	|| __glibc_clang_has_extension (c_generic_selections) \ | |
| 591 | 	|| __glibc_has_extension (c_generic_selections) \ | |
| 510 | 592 | 	|| (!defined __GNUC__ && defined __STDC_VERSION__ \ |
| 511 | 593 | 	 && __STDC_VERSION__ >= 201112L)) |
| 512 | 594 | # define __HAVE_GENERIC_SELECTION 1 |
| ... | ... | @@ -514,4 +596,40 @@ |
| 514 | 596 | # define __HAVE_GENERIC_SELECTION 0 |
| 515 | 597 | #endif |
| 516 | 598 | |
| 599 | #if __GNUC_PREREQ (10, 0) | |
| 600 | /* Designates a 1-based positional argument ref-index of pointer type | |
| 601 | that can be used to access size-index elements of the pointed-to | |
| 602 | array according to access mode, or at least one element when | |
| 603 | size-index is not provided: | |
| 604 | access (access-mode, <ref-index> [, <size-index>]) */ | |
| 605 | # define __attr_access(x) __attribute__ ((__access__ x)) | |
| 606 | # if __GNUC_PREREQ (11, 0) | |
| 607 | # define __attr_access_none(argno) __attribute__ ((__access__ (__none__, argno))) | |
| 608 | # else | |
| 609 | # define __attr_access_none(argno) | |
| 610 | # endif | |
| 611 | #else | |
| 612 | # define __attr_access(x) | |
| 613 | # define __attr_access_none(argno) | |
| 614 | #endif | |
| 615 | ||
| 616 | #if __GNUC_PREREQ (11, 0) | |
| 617 | /* Designates dealloc as a function to call to deallocate objects | |
| 618 | allocated by the declared function. */ | |
| 619 | # define __attr_dealloc(dealloc, argno) \ | |
| 620 | __attribute__ ((__malloc__ (dealloc, argno))) | |
| 621 | # define __attr_dealloc_free __attr_dealloc (__builtin_free, 1) | |
| 622 | #else | |
| 623 | # define __attr_dealloc(dealloc, argno) | |
| 624 | # define __attr_dealloc_free | |
| 625 | #endif | |
| 626 | ||
| 627 | /* Specify that a function such as setjmp or vfork may return | |
| 628 | twice. */ | |
| 629 | #if __GNUC_PREREQ (4, 1) | |
| 630 | # define __attribute_returns_twice__ __attribute__ ((__returns_twice__)) | |
| 631 | #else | |
| 632 | # define __attribute_returns_twice__ /* Ignore. */ | |
| 633 | #endif | |
| 634 | ||
| 517 | 635 | #endif	 /* sys/cdefs.h */ |
lib/libc/glibc/misc/sys/select.h+28-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* `fd_set' type and related macros, and `select'/`pselect' declarations. |
| 2 | Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -98,10 +98,23 @@ __BEGIN_DECLS |
| 98 | 98 | |
| 99 | 99 | This function is a cancellation point and therefore not marked with |
| 100 | 100 | __THROW. */ |
| 101 | #ifndef __USE_TIME_BITS64 | |
| 101 | 102 | extern int select (int __nfds, fd_set *__restrict __readfds, |
| 102 | 103 | 		 fd_set *__restrict __writefds, |
| 103 | 104 | 		 fd_set *__restrict __exceptfds, |
| 104 | 105 | 		 struct timeval *__restrict __timeout); |
| 106 | #else | |
| 107 | # ifdef __REDIRECT | |
| 108 | extern int __REDIRECT (select, | |
| 109 | (int __nfds, fd_set *__restrict __readfds, | |
| 110 | fd_set *__restrict __writefds, | |
| 111 | fd_set *__restrict __exceptfds, | |
| 112 | struct timeval *__restrict __timeout), | |
| 113 | __select64); | |
| 114 | # else | |
| 115 | # define select __select64 | |
| 116 | # endif | |
| 117 | #endif | |
| 105 | 118 | |
| 106 | 119 | #ifdef __USE_XOPEN2K |
| 107 | 120 | /* Same as above only that the TIMEOUT value is given with higher |
| ... | ... | @@ -110,11 +123,25 @@ extern int select (int __nfds, fd_set *__restrict __readfds, |
| 110 | 123 | |
| 111 | 124 | This function is a cancellation point and therefore not marked with |
| 112 | 125 | __THROW. */ |
| 126 | # ifndef __USE_TIME_BITS64 | |
| 113 | 127 | extern int pselect (int __nfds, fd_set *__restrict __readfds, |
| 114 | 128 | 		 fd_set *__restrict __writefds, |
| 115 | 129 | 		 fd_set *__restrict __exceptfds, |
| 116 | 130 | 		 const struct timespec *__restrict __timeout, |
| 117 | 131 | 		 const __sigset_t *__restrict __sigmask); |
| 132 | # else | |
| 133 | # ifdef __REDIRECT | |
| 134 | extern int __REDIRECT (pselect, | |
| 135 | (int __nfds, fd_set *__restrict __readfds, | |
| 136 | fd_set *__restrict __writefds, | |
| 137 | fd_set *__restrict __exceptfds, | |
| 138 | const struct timespec *__restrict __timeout, | |
| 139 | const __sigset_t *__restrict __sigmask), | |
| 140 | __pselect64); | |
| 141 | # else | |
| 142 | # define pselect __pselect64 | |
| 143 | # endif | |
| 144 | # endif | |
| 118 | 145 | #endif |
| 119 | 146 | |
| 120 | 147 |
lib/libc/glibc/nptl/pthread_atfork.c deleted-61| ... | ... | @@ -1,61 +0,0 @@ |
| 1 | /* Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | In addition to the permissions in the GNU Lesser General Public | |
| 11 | License, the Free Software Foundation gives you unlimited | |
| 12 | permission to link the compiled version of this file with other | |
| 13 | programs, and to distribute those programs without any restriction | |
| 14 | coming from the use of this file. (The GNU Lesser General Public | |
| 15 | License restrictions do apply in other respects; for example, they | |
| 16 | cover modification of the file, and distribution when not linked | |
| 17 | into another program.) | |
| 18 | ||
| 19 | Note that people who make modified versions of this file are not | |
| 20 | obligated to grant this special exception for their modified | |
| 21 | versions; it is their choice whether to do so. The GNU Lesser | |
| 22 | General Public License gives permission to release a modified | |
| 23 | version without this exception; this exception also makes it | |
| 24 | possible to release a modified version which carries forward this | |
| 25 | exception. | |
| 26 | ||
| 27 | The GNU C Library is distributed in the hope that it will be useful, | |
| 28 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 29 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 30 | Lesser General Public License for more details. | |
| 31 | ||
| 32 | You should have received a copy of the GNU Lesser General Public | |
| 33 | License along with the GNU C Library; if not, see | |
| 34 | <https://www.gnu.org/licenses/>. */ | |
| 35 | ||
| 36 | extern int __pthread_atfork (void (*prepare) (void), void (*parent) (void), | |
| 37 | void (*child) (void)); | |
| 38 | extern int __register_atfork (void (*__prepare) (void), | |
| 39 | void (*__parent) (void), | |
| 40 | void (*__child) (void), | |
| 41 | void *dso_handle); | |
| 42 | libc_hidden_proto (__register_atfork) | |
| 43 | extern void *__dso_handle __attribute__ ((__visibility__ ("hidden"))); | |
| 44 | ||
| 45 | /* Hide the symbol so that no definition but the one locally in the | |
| 46 | executable or DSO is used. */ | |
| 47 | int | |
| 48 | #ifndef __pthread_atfork | |
| 49 | /* Don't mark the compatibility function as hidden. */ | |
| 50 | attribute_hidden | |
| 51 | #endif | |
| 52 | __pthread_atfork (void (*prepare) (void), void (*parent) (void), | |
| 53 | 		 void (*child) (void)) | |
| 54 | { | |
| 55 | return __register_atfork (prepare, parent, child, __dso_handle); | |
| 56 | } | |
| 57 | #ifndef __pthread_atfork | |
| 58 | extern int pthread_atfork (void (*prepare) (void), void (*parent) (void), | |
| 59 | 			 void (*child) (void)) attribute_hidden; | |
| 60 | weak_alias (__pthread_atfork, pthread_atfork) | |
| 61 | #endif |
lib/libc/glibc/posix/bits/cpu-set.h+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993 |
| 2 | 2 | scheduling interface. |
| 3 | Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/posix/bits/types.h+2-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* bits/types.h -- definitions of __*_t types underlying *_t types. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -160,6 +160,7 @@ __STD_TYPE __ID_T_TYPE __id_t;		/* General type for IDs. */ |
| 160 | 160 | __STD_TYPE __TIME_T_TYPE __time_t;	/* Seconds since the Epoch. */ |
| 161 | 161 | __STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ |
| 162 | 162 | __STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ |
| 163 | __STD_TYPE __SUSECONDS64_T_TYPE __suseconds64_t; | |
| 163 | 164 | |
| 164 | 165 | __STD_TYPE __DADDR_T_TYPE __daddr_t;	/* The type of a disk address. */ |
| 165 | 166 | __STD_TYPE __KEY_T_TYPE __key_t;	/* Type of an IPC key. */ |
lib/libc/glibc/posix/sys/types.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/signal/signal.h+32-15| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | __BEGIN_DECLS |
| 28 | 28 | |
| 29 | 29 | #include <bits/types.h> |
| 30 | #include <bits/signum.h> | |
| 30 | #include <bits/signum-generic.h> | |
| 31 | 31 | |
| 32 | 32 | #include <bits/types/sig_atomic_t.h> |
| 33 | 33 | |
| ... | ... | @@ -148,7 +148,8 @@ extern void psiginfo (const siginfo_t *__pinfo, const char *__s); |
| 148 | 148 | |
| 149 | 149 | #ifdef __USE_XOPEN_EXTENDED |
| 150 | 150 | # ifdef __GNUC__ |
| 151 | extern int sigpause (int __sig) __asm__ ("__xpg_sigpause"); | |
| 151 | extern int sigpause (int __sig) __asm__ ("__xpg_sigpause") | |
| 152 | __attribute_deprecated_msg__ ("Use the sigsuspend function instead"); | |
| 152 | 153 | # else |
| 153 | 154 | extern int __sigpause (int __sig_or_mask, int __is_sig); |
| 154 | 155 | /* Remove a signal from the signal mask and suspend the process. */ |
| ... | ... | @@ -164,7 +165,9 @@ extern int __sigpause (int __sig_or_mask, int __is_sig); |
| 164 | 165 | simply do not work in many situations. Use `sigprocmask' instead. */ |
| 165 | 166 | |
| 166 | 167 | /* Compute mask for signal SIG. */ |
| 167 | # define sigmask(sig) ((int)(1u << ((sig) - 1))) | |
| 168 | # define sigmask(sig) \ | |
| 169 | __glibc_macro_warning ("sigmask is deprecated") \ | |
| 170 | ((int)(1u << ((sig) - 1))) | |
| 168 | 171 | |
| 169 | 172 | /* Block signals in MASK, returning the old mask. */ |
| 170 | 173 | extern int sigblock (int __mask) __THROW __attribute_deprecated__; |
| ... | ... | @@ -266,10 +269,23 @@ extern int sigwaitinfo (const sigset_t *__restrict __set, |
| 266 | 269 | |
| 267 | 270 | This function is a cancellation point and therefore not marked with |
| 268 | 271 | __THROW. */ |
| 272 | # ifndef __USE_TIME_BITS64 | |
| 269 | 273 | extern int sigtimedwait (const sigset_t *__restrict __set, |
| 270 | 274 | 			 siginfo_t *__restrict __info, |
| 271 | 275 | 			 const struct timespec *__restrict __timeout) |
| 272 | 276 | __nonnull ((1)); |
| 277 | # else | |
| 278 | # ifdef __REDIRECT | |
| 279 | extern int __REDIRECT (sigtimedwait, | |
| 280 | (const sigset_t *__restrict __set, | |
| 281 | siginfo_t *__restrict __info, | |
| 282 | const struct timespec *__restrict __timeout), | |
| 283 | __sigtimedwait64) | |
| 284 | __nonnull ((1)); | |
| 285 | # else | |
| 286 | # define sigtimedwait __sigtimedwait64 | |
| 287 | # endif | |
| 288 | # endif | |
| 273 | 289 | |
| 274 | 290 | /* Send signal SIG to the process PID. Associate data in VAL with the |
| 275 | 291 | signal. */ |
| ... | ... | @@ -281,12 +297,6 @@ extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val) |
| 281 | 297 | |
| 282 | 298 | #ifdef __USE_MISC |
| 283 | 299 | |
| 284 | /* Names of the signals. This variable exists only for compatibility. | |
| 285 | Use `strsignal' instead (see <string.h>). */ | |
| 286 | extern const char *const _sys_siglist[_NSIG]; | |
| 287 | extern const char *const sys_siglist[_NSIG]; | |
| 288 | ||
| 289 | ||
| 290 | 300 | /* Get machine-dependent `struct sigcontext' and signal subcodes. */ |
| 291 | 301 | # include <bits/sigcontext.h> |
| 292 | 302 | |
| ... | ... | @@ -311,9 +321,11 @@ extern int sigreturn (struct sigcontext *__scp) __THROW; |
| 311 | 321 | /* If INTERRUPT is nonzero, make signal SIG interrupt system calls |
| 312 | 322 | (causing them to fail with EINTR); if INTERRUPT is zero, make system |
| 313 | 323 | calls be restarted after signal SIG. */ |
| 314 | extern int siginterrupt (int __sig, int __interrupt) __THROW; | |
| 324 | extern int siginterrupt (int __sig, int __interrupt) __THROW | |
| 325 | __attribute_deprecated_msg__ ("Use sigaction with SA_RESTART instead"); | |
| 315 | 326 | |
| 316 | 327 | # include <bits/sigstack.h> |
| 328 | # include <bits/sigstksz.h> | |
| 317 | 329 | # include <bits/ss_flags.h> |
| 318 | 330 | |
| 319 | 331 | /* Alternate signal handler stack interface. |
| ... | ... | @@ -340,16 +352,21 @@ extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) |
| 340 | 352 | /* Simplified interface for signal management. */ |
| 341 | 353 | |
| 342 | 354 | /* Add SIG to the calling process' signal mask. */ |
| 343 | extern int sighold (int __sig) __THROW; | |
| 355 | extern int sighold (int __sig) __THROW | |
| 356 | __attribute_deprecated_msg__ ("Use the sigprocmask function instead"); | |
| 344 | 357 | |
| 345 | 358 | /* Remove SIG from the calling process' signal mask. */ |
| 346 | extern int sigrelse (int __sig) __THROW; | |
| 359 | extern int sigrelse (int __sig) __THROW | |
| 360 | __attribute_deprecated_msg__ ("Use the sigprocmask function instead"); | |
| 347 | 361 | |
| 348 | 362 | /* Set the disposition of SIG to SIG_IGN. */ |
| 349 | extern int sigignore (int __sig) __THROW; | |
| 363 | extern int sigignore (int __sig) __THROW | |
| 364 | __attribute_deprecated_msg__ ("Use the signal function instead"); | |
| 350 | 365 | |
| 351 | 366 | /* Set the disposition of SIG. */ |
| 352 | extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW; | |
| 367 | extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW | |
| 368 | __attribute_deprecated_msg__ | |
| 369 | ("Use the signal and sigprocmask functions instead"); | |
| 353 | 370 | #endif |
| 354 | 371 | |
| 355 | 372 | #if defined __USE_POSIX199506 || defined __USE_UNIX98 |
lib/libc/glibc/stdlib/alloca.h+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -25,7 +25,7 @@ |
| 25 | 25 | |
| 26 | 26 | __BEGIN_DECLS |
| 27 | 27 | |
| 28 | /* Remove any previous definitions. */ | |
| 28 | /* Remove any previous definition. */ | |
| 29 | 29 | #undef	alloca |
| 30 | 30 | |
| 31 | 31 | /* Allocate a block that will be freed when the calling function exits. */ |
lib/libc/glibc/stdlib/at_quick_exit.c+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/stdlib/atexit.c+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/stdlib/bits/stdlib-float.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Floating-point inline functions for stdlib.h. |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/stdlib/errno.h created+55| ... | ... | @@ -0,0 +1,55 @@ |
| 1 | /* Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | /* | |
| 19 | *	ISO C99 Standard: 7.5 Errors	<errno.h> | |
| 20 | */ | |
| 21 | ||
| 22 | #ifndef	_ERRNO_H | |
| 23 | #define	_ERRNO_H 1 | |
| 24 | ||
| 25 | #include <features.h> | |
| 26 | ||
| 27 | /* The system-specific definitions of the E* constants, as macros. */ | |
| 28 | #include <bits/errno.h> | |
| 29 | ||
| 30 | /* When included from assembly language, this header only provides the | |
| 31 | E* constants. */ | |
| 32 | #ifndef __ASSEMBLER__ | |
| 33 | ||
| 34 | __BEGIN_DECLS | |
| 35 | ||
| 36 | /* The error code set by various library functions. */ | |
| 37 | extern int *__errno_location (void) __THROW __attribute_const__; | |
| 38 | # define errno (*__errno_location ()) | |
| 39 | ||
| 40 | # ifdef __USE_GNU | |
| 41 | ||
| 42 | /* The full and simple forms of the name with which the program was | |
| 43 | invoked. These variables are set up automatically at startup based on | |
| 44 | the value of argv[0]. */ | |
| 45 | extern char *program_invocation_name; | |
| 46 | extern char *program_invocation_short_name; | |
| 47 | ||
| 48 | #include <bits/types/error_t.h> | |
| 49 | ||
| 50 | # endif /* __USE_GNU */ | |
| 51 | ||
| 52 | __END_DECLS | |
| 53 | ||
| 54 | #endif /* !__ASSEMBLER__ */ | |
| 55 | #endif /* errno.h */ |
lib/libc/glibc/stdlib/exit.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/stdlib/stdlib.h+21-12| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -397,7 +397,7 @@ extern long int a64l (const char *__s) |
| 397 | 397 | `initstate' and `setstate' functions are those from BSD Unices. |
| 398 | 398 | The `rand' and `srand' functions are required by the ANSI standard. |
| 399 | 399 | We provide both interfaces to the same random number generator. */ |
| 400 | /* Return a random long integer between 0 and RAND_MAX inclusive. */ | |
| 400 | /* Return a random long integer between 0 and 2^31-1 inclusive. */ | |
| 401 | 401 | extern long int random (void) __THROW; |
| 402 | 402 | |
| 403 | 403 | /* Seed the random number generator with the given number. */ |
| ... | ... | @@ -550,6 +550,9 @@ extern void *calloc (size_t __nmemb, size_t __size) |
| 550 | 550 | extern void *realloc (void *__ptr, size_t __size) |
| 551 | 551 | __THROW __attribute_warn_unused_result__ __attribute_alloc_size__ ((2)); |
| 552 | 552 | |
| 553 | /* Free a block allocated by `malloc', `realloc' or `calloc'. */ | |
| 554 | extern void free (void *__ptr) __THROW; | |
| 555 | ||
| 553 | 556 | #ifdef __USE_MISC |
| 554 | 557 | /* Re-allocate the previously allocated block in PTR, making the new |
| 555 | 558 | block large enough for NMEMB elements of SIZE bytes each. */ |
| ... | ... | @@ -558,11 +561,13 @@ extern void *realloc (void *__ptr, size_t __size) |
| 558 | 561 | between objects pointed by the old and new pointers. */ |
| 559 | 562 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) |
| 560 | 563 | __THROW __attribute_warn_unused_result__ |
| 561 | __attribute_alloc_size__ ((2, 3)); | |
| 562 | #endif | |
| 564 | __attribute_alloc_size__ ((2, 3)) | |
| 565 | __attr_dealloc_free; | |
| 563 | 566 | |
| 564 | /* Free a block allocated by `malloc', `realloc' or `calloc'. */ | |
| 565 | extern void free (void *__ptr) __THROW; | |
| 567 | /* Add reallocarray as its own deallocator. */ | |
| 568 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | |
| 569 | __THROW __attr_dealloc (reallocarray, 1); | |
| 570 | #endif | |
| 566 | 571 | |
| 567 | 572 | #ifdef __USE_MISC |
| 568 | 573 | # include <alloca.h> |
| ... | ... | @@ -788,7 +793,8 @@ extern int system (const char *__command) __wur; |
| 788 | 793 | /* Return a malloc'd string containing the canonical absolute name of the |
| 789 | 794 | existing named file. */ |
| 790 | 795 | extern char *canonicalize_file_name (const char *__name) |
| 791 | __THROW __nonnull ((1)) __wur; | |
| 796 | __THROW __nonnull ((1)) __attribute_malloc__ | |
| 797 | __attr_dealloc_free __wur; | |
| 792 | 798 | #endif |
| 793 | 799 | |
| 794 | 800 | #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED |
| ... | ... | @@ -931,12 +937,13 @@ extern int wctomb (char *__s, wchar_t __wchar) __THROW; |
| 931 | 937 | |
| 932 | 938 | /* Convert a multibyte string to a wide char string. */ |
| 933 | 939 | extern size_t mbstowcs (wchar_t *__restrict __pwcs, |
| 934 | 			const char *__restrict __s, size_t __n) __THROW; | |
| 940 | 			const char *__restrict __s, size_t __n) __THROW | |
| 941 | __attr_access ((__read_only__, 2)); | |
| 935 | 942 | /* Convert a wide char string to multibyte string. */ |
| 936 | 943 | extern size_t wcstombs (char *__restrict __s, |
| 937 | 944 | 			const wchar_t *__restrict __pwcs, size_t __n) |
| 938 | __THROW; | |
| 939 | ||
| 945 | __THROW | |
| 946 | __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); | |
| 940 | 947 | |
| 941 | 948 | #ifdef __USE_MISC |
| 942 | 949 | /* Determine whether the string value of RESPONSE matches the affirmation |
| ... | ... | @@ -990,7 +997,7 @@ extern char *ptsname (int __fd) __THROW __wur; |
| 990 | 997 | terminal associated with the master FD is open on in BUF. |
| 991 | 998 | Return 0 on success, otherwise an error number. */ |
| 992 | 999 | extern int ptsname_r (int __fd, char *__buf, size_t __buflen) |
| 993 | __THROW __nonnull ((2)); | |
| 1000 | __THROW __nonnull ((2)) __attr_access ((__write_only__, 2, 3)); | |
| 994 | 1001 | |
| 995 | 1002 | /* Open a master pseudo terminal and return its file descriptor. */ |
| 996 | 1003 | extern int getpt (void); |
| ... | ... | @@ -1016,7 +1023,9 @@ extern int ttyslot (void) __THROW; |
| 1016 | 1023 | #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function |
| 1017 | 1024 | # include <bits/stdlib.h> |
| 1018 | 1025 | #endif |
| 1019 | #ifdef __LDBL_COMPAT | |
| 1026 | ||
| 1027 | #include <bits/floatn.h> | |
| 1028 | #if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 | |
| 1020 | 1029 | # include <bits/stdlib-ldbl.h> |
| 1021 | 1030 | #endif |
| 1022 | 1031 |
lib/libc/glibc/string/bits/endian.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Endian macros for string.h functions |
| 2 | Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/string/endian.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/aarch64/crti.S+11-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for AArch64. |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| ... | ... | @@ -75,6 +75,11 @@ call_weak_fn: |
| 75 | 75 | 	.hidden	_init |
| 76 | 76 | 	.type	_init, %function |
| 77 | 77 | _init: |
| 78 | #if HAVE_AARCH64_PAC_RET | |
| 79 | 	PACIASP | |
| 80 | #else | |
| 81 | 	BTI_C | |
| 82 | #endif | |
| 78 | 83 | 	stp	x29, x30, [sp, -16]! |
| 79 | 84 | 	mov	x29, sp |
| 80 | 85 | #if PREINIT_FUNCTION_WEAK |
| ... | ... | @@ -89,5 +94,10 @@ _init: |
| 89 | 94 | 	.hidden	_fini |
| 90 | 95 | 	.type	_fini, %function |
| 91 | 96 | _fini: |
| 97 | #if HAVE_AARCH64_PAC_RET | |
| 98 | 	PACIASP | |
| 99 | #else | |
| 100 | 	BTI_C | |
| 101 | #endif | |
| 92 | 102 | 	stp	x29, x30, [sp, -16]! |
| 93 | 103 | 	mov	x29, sp |
lib/libc/glibc/sysdeps/aarch64/crtn.S+9-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for AArch64. |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| ... | ... | @@ -37,10 +37,18 @@ |
| 37 | 37 | /* crtn.S puts function epilogues in the .init and .fini sections |
| 38 | 38 | corresponding to the prologues in crti.S. */ |
| 39 | 39 | |
| 40 | #include <sysdep.h> | |
| 41 | ||
| 40 | 42 | 	.section .init,"ax",%progbits |
| 41 | 43 | 	ldp	x29, x30, [sp], 16 |
| 44 | #if HAVE_AARCH64_PAC_RET | |
| 45 | 	AUTIASP | |
| 46 | #endif | |
| 42 | 47 | 	RET |
| 43 | 48 | |
| 44 | 49 | 	.section .fini,"ax",%progbits |
| 45 | 50 | 	ldp	x29, x30, [sp], 16 |
| 51 | #if HAVE_AARCH64_PAC_RET | |
| 52 | 	AUTIASP | |
| 53 | #endif | |
| 46 | 54 | 	RET |
lib/libc/glibc/sysdeps/aarch64/dl-sysdep.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | 2 | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 |
lib/libc/glibc/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | 2 | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 |
lib/libc/glibc/sysdeps/aarch64/start.S+7-16| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 2 | 2 | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| ... | ... | @@ -43,10 +43,9 @@ |
| 43 | 43 | */ |
| 44 | 44 | |
| 45 | 45 | 	.text |
| 46 | 	.globl _start | |
| 47 | 	.type _start,#function | |
| 48 | _start: | |
| 46 | ENTRY(_start) | |
| 49 | 47 | 	/* Create an initial frame with 0 LR and FP */ |
| 48 | 	cfi_undefined (x30) | |
| 50 | 49 | 	mov	x29, #0 |
| 51 | 50 | 	mov	x30, #0 |
| 52 | 51 | |
| ... | ... | @@ -64,26 +63,16 @@ _start: |
| 64 | 63 | # ifdef SHARED |
| 65 | 64 | adrp x0, :got:main |
| 66 | 65 | 	ldr PTR_REG (0), [x0, #:got_lo12:main] |
| 67 | ||
| 68 | adrp x3, :got:__libc_csu_init | |
| 69 | 	ldr PTR_REG (3), [x3, #:got_lo12:__libc_csu_init] | |
| 70 | ||
| 71 | adrp x4, :got:__libc_csu_fini | |
| 72 | 	ldr PTR_REG (4), [x4, #:got_lo12:__libc_csu_fini] | |
| 73 | 66 | # else |
| 74 | 67 | 	adrp	x0, __wrap_main |
| 75 | 68 | 	add	x0, x0, :lo12:__wrap_main |
| 76 | 	adrp	x3, __libc_csu_init | |
| 77 | 	add	x3, x3, :lo12:__libc_csu_init | |
| 78 | 	adrp	x4, __libc_csu_fini | |
| 79 | 	add	x4, x4, :lo12:__libc_csu_fini | |
| 80 | 69 | # endif |
| 81 | 70 | #else |
| 82 | 71 | 	/* Set up the other arguments in registers */ |
| 83 | 72 | 	MOVL (0, main) |
| 84 | 	MOVL (3, __libc_csu_init) | |
| 85 | 	MOVL (4, __libc_csu_fini) | |
| 86 | 73 | #endif |
| 74 | 	mov	x3, #0		/* Used to be init. */ | |
| 75 | 	mov	x4, #0		/* Used to be fini. */ | |
| 87 | 76 | |
| 88 | 77 | 	/* __libc_start_main (main, argc, argv, init, fini, rtld_fini, |
| 89 | 78 | 			 stack_end) */ |
| ... | ... | @@ -100,8 +89,10 @@ _start: |
| 100 | 89 | 	 because crt1.o and rcrt1.o share code and the later must avoid the |
| 101 | 90 | 	 use of GOT relocations before __libc_start_main is called. */ |
| 102 | 91 | __wrap_main: |
| 92 | 	BTI_C | |
| 103 | 93 | 	b	main |
| 104 | 94 | #endif |
| 95 | END(_start) | |
| 105 | 96 | |
| 106 | 97 | 	/* Define a symbol for the first piece of initialized data. */ |
| 107 | 98 | 	.data |
lib/libc/glibc/sysdeps/aarch64/sysdep.h+68-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | 2 | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| ... | ... | @@ -25,29 +25,90 @@ |
| 25 | 25 | # define AARCH64_R(NAME)	R_AARCH64_ ## NAME |
| 26 | 26 | # define PTR_REG(n)		x##n |
| 27 | 27 | # define PTR_LOG_SIZE		3 |
| 28 | # define DELOUSE(n) | |
| 28 | # define PTR_ARG(n) | |
| 29 | # define SIZE_ARG(n) | |
| 29 | 30 | #else |
| 30 | 31 | # define AARCH64_R(NAME)	R_AARCH64_P32_ ## NAME |
| 31 | 32 | # define PTR_REG(n)		w##n |
| 32 | 33 | # define PTR_LOG_SIZE		2 |
| 33 | # define DELOUSE(n)		mov w##n, w##n | |
| 34 | # define PTR_ARG(n)		mov w##n, w##n | |
| 35 | # define SIZE_ARG(n)		mov w##n, w##n | |
| 34 | 36 | #endif |
| 35 | 37 | |
| 36 | 38 | #define PTR_SIZE	(1<<PTR_LOG_SIZE) |
| 37 | 39 | |
| 40 | #ifndef __ASSEMBLER__ | |
| 41 | /* Strip pointer authentication code from pointer p. */ | |
| 42 | static inline void * | |
| 43 | strip_pac (void *p) | |
| 44 | { | |
| 45 | register void *ra asm ("x30") = (p); | |
| 46 | asm ("hint 7 // xpaclri" : "+r"(ra)); | |
| 47 | return ra; | |
| 48 | } | |
| 49 | ||
| 50 | /* This is needed when glibc is built with -mbranch-protection=pac-ret | |
| 51 | with a gcc that is affected by PR target/94891. */ | |
| 52 | # if HAVE_AARCH64_PAC_RET | |
| 53 | # undef RETURN_ADDRESS | |
| 54 | # define RETURN_ADDRESS(n) strip_pac (__builtin_return_address (n)) | |
| 55 | # endif | |
| 56 | #endif | |
| 57 | ||
| 38 | 58 | #ifdef	__ASSEMBLER__ |
| 39 | 59 | |
| 40 | 60 | /* Syntactic details of assembler. */ |
| 41 | 61 | |
| 42 | 62 | #define ASM_SIZE_DIRECTIVE(name) .size name,.-name |
| 43 | 63 | |
| 64 | /* Branch Target Identitication support. */ | |
| 65 | #if HAVE_AARCH64_BTI | |
| 66 | # define BTI_C		hint	34 | |
| 67 | # define BTI_J		hint	36 | |
| 68 | #else | |
| 69 | # define BTI_C		nop | |
| 70 | # define BTI_J		nop | |
| 71 | #endif | |
| 72 | ||
| 73 | /* Return address signing support (pac-ret). */ | |
| 74 | #define PACIASP		hint	25 | |
| 75 | #define AUTIASP		hint	29 | |
| 76 | ||
| 77 | /* GNU_PROPERTY_AARCH64_* macros from elf.h for use in asm code. */ | |
| 78 | #define FEATURE_1_AND 0xc0000000 | |
| 79 | #define FEATURE_1_BTI 1 | |
| 80 | #define FEATURE_1_PAC 2 | |
| 81 | ||
| 82 | /* Add a NT_GNU_PROPERTY_TYPE_0 note. */ | |
| 83 | #define GNU_PROPERTY(type, value)	\ | |
| 84 | .section .note.gnu.property, "a";	\ | |
| 85 | .p2align 3;				\ | |
| 86 | .word 4;				\ | |
| 87 | .word 16;				\ | |
| 88 | .word 5;				\ | |
| 89 | .asciz "GNU";				\ | |
| 90 | .word type;				\ | |
| 91 | .word 4;				\ | |
| 92 | .word value;				\ | |
| 93 | .word 0;				\ | |
| 94 | .text | |
| 95 | ||
| 96 | /* Add GNU property note with the supported features to all asm code | |
| 97 | where sysdep.h is included. */ | |
| 98 | #if HAVE_AARCH64_BTI && HAVE_AARCH64_PAC_RET | |
| 99 | GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC) | |
| 100 | #elif HAVE_AARCH64_BTI | |
| 101 | GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI) | |
| 102 | #endif | |
| 103 | ||
| 44 | 104 | /* Define an entry point visible from C. */ |
| 45 | 105 | #define ENTRY(name)						\ |
| 46 | 106 | .globl C_SYMBOL_NAME(name);					\ |
| 47 | 107 | .type C_SYMBOL_NAME(name),%function;				\ |
| 48 | .align 4;							\ | |
| 108 | .p2align 6;							\ | |
| 49 | 109 | C_LABEL(name)							\ |
| 50 | 110 | cfi_startproc;						\ |
| 111 | BTI_C;							\ | |
| 51 | 112 | CALL_MCOUNT |
| 52 | 113 | |
| 53 | 114 | /* Define an entry point visible from C. */ |
| ... | ... | @@ -57,6 +118,7 @@ |
| 57 | 118 | .p2align align;						\ |
| 58 | 119 | C_LABEL(name)							\ |
| 59 | 120 | cfi_startproc;						\ |
| 121 | BTI_C;							\ | |
| 60 | 122 | CALL_MCOUNT |
| 61 | 123 | |
| 62 | 124 | /* Define an entry point visible from C with a specified alignment and |
| ... | ... | @@ -68,11 +130,12 @@ |
| 68 | 130 | .globl C_SYMBOL_NAME(name);					\ |
| 69 | 131 | .type C_SYMBOL_NAME(name),%function;				\ |
| 70 | 132 | .p2align align;						\ |
| 71 | .rep padding;							\ | |
| 133 | .rep padding - 1; /* -1 for bti c. */			\ | |
| 72 | 134 | nop;								\ |
| 73 | 135 | .endr;							\ |
| 74 | 136 | C_LABEL(name)							\ |
| 75 | 137 | cfi_startproc;						\ |
| 138 | BTI_C;							\ | |
| 76 | 139 | CALL_MCOUNT |
| 77 | 140 | |
| 78 | 141 | #undef	END |
lib/libc/glibc/sysdeps/alpha/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for Alpha. |
| 2 | Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2001-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/alpha/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for Alpha. |
| 2 | Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2001-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/alpha/dl-sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* System-specific settings for dynamic linker code. Alpha version. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/alpha/nptl/bits/pthreadtypes-arch.h deleted-61| ... | ... | @@ -1,61 +0,0 @@ |
| 1 | /* Machine-specific pthread type layouts. Alpha version. | |
| 2 | Copyright (C) 2003-2019 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_PTHREADTYPES_ARCH_H | |
| 20 | #define _BITS_PTHREADTYPES_ARCH_H	1 | |
| 21 | ||
| 22 | #define __SIZEOF_PTHREAD_ATTR_T		56 | |
| 23 | #define __SIZEOF_PTHREAD_MUTEX_T	40 | |
| 24 | #define __SIZEOF_PTHREAD_MUTEXATTR_T	4 | |
| 25 | #define __SIZEOF_PTHREAD_COND_T		48 | |
| 26 | #define __SIZEOF_PTHREAD_CONDATTR_T	4 | |
| 27 | #define __SIZEOF_PTHREAD_RWLOCK_T	56 | |
| 28 | #define __SIZEOF_PTHREAD_RWLOCKATTR_T	8 | |
| 29 | #define __SIZEOF_PTHREAD_BARRIER_T	32 | |
| 30 | #define __SIZEOF_PTHREAD_BARRIERATTR_T	4 | |
| 31 | ||
| 32 | /* Definitions for internal mutex struct. */ | |
| 33 | #define __PTHREAD_COMPAT_PADDING_MID | |
| 34 | #define __PTHREAD_COMPAT_PADDING_END | |
| 35 | #define __PTHREAD_MUTEX_LOCK_ELISION 0 | |
| 36 | #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0 | |
| 37 | #define __PTHREAD_MUTEX_USE_UNION 0 | |
| 38 | ||
| 39 | #define __LOCK_ALIGNMENT | |
| 40 | #define __ONCE_ALIGNMENT | |
| 41 | ||
| 42 | struct __pthread_rwlock_arch_t | |
| 43 | { | |
| 44 | unsigned int __readers; | |
| 45 | unsigned int __writers; | |
| 46 | unsigned int __wrphase_futex; | |
| 47 | unsigned int __writers_futex; | |
| 48 | unsigned int __pad3; | |
| 49 | unsigned int __pad4; | |
| 50 | int __cur_writer; | |
| 51 | int __shared; | |
| 52 | unsigned long int __pad1; | |
| 53 | unsigned long int __pad2; | |
| 54 | /* FLAGS must stay at this position in the structure to maintain | |
| 55 | binary compatibility. */ | |
| 56 | unsigned int __flags; | |
| 57 | }; | |
| 58 | ||
| 59 | #define __PTHREAD_RWLOCK_ELISION_EXTRA 0 | |
| 60 | ||
| 61 | #endif	/* bits/pthreadtypes.h */ |
lib/libc/glibc/sysdeps/alpha/start.S+3-4| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Startup code for Alpha/ELF. |
| 2 | Copyright (C) 1993-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | Contributed by Richard Henderson <rth@tamu.edu> |
| 5 | 5 | |
| ... | ... | @@ -55,9 +55,8 @@ _start: |
| 55 | 55 | 	ldl	a1, 16(sp)	/* get argc */ |
| 56 | 56 | 	lda	a2, 24(sp)	/* get argv */ |
| 57 | 57 | |
| 58 | /* Load address of our own entry points to .fini and .init. */ | |
| 59 | 	lda	a3, __libc_csu_init | |
| 60 | 	lda	a4, __libc_csu_fini | |
| 58 | 	mov	$r31, a3 	/* Used to be init. */ | |
| 59 | 	mov	$r31, a4 	/* Used to be fini. */ | |
| 61 | 60 | |
| 62 | 61 | /* Store address of the shared library termination function. */ |
| 63 | 62 | 	mov	v0, a5 |
lib/libc/glibc/sysdeps/arc/sysdep.h created+53| ... | ... | @@ -0,0 +1,53 @@ |
| 1 | /* Assembler macros for ARC. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <sysdeps/generic/sysdep.h> | |
| 20 | ||
| 21 | #ifdef	__ASSEMBLER__ | |
| 22 | ||
| 23 | /* Syntactic details of assembler. | |
| 24 | ; is not newline but comment, # is also for comment. */ | |
| 25 | # define ASM_SIZE_DIRECTIVE(name) .size name,.-name | |
| 26 | ||
| 27 | # define ENTRY(name)						\ | |
| 28 | 	.align 4				ASM_LINE_SEP	\ | |
| 29 | 	.globl C_SYMBOL_NAME(name)		ASM_LINE_SEP	\ | |
| 30 | 	.type C_SYMBOL_NAME(name),%function	ASM_LINE_SEP	\ | |
| 31 | 	C_LABEL(name)				ASM_LINE_SEP	\ | |
| 32 | 	cfi_startproc				ASM_LINE_SEP	\ | |
| 33 | 	CALL_MCOUNT | |
| 34 | ||
| 35 | # undef END | |
| 36 | # define END(name)						\ | |
| 37 | 	cfi_endproc				ASM_LINE_SEP	\ | |
| 38 | 	ASM_SIZE_DIRECTIVE(name) | |
| 39 | ||
| 40 | # ifdef SHARED | |
| 41 | # define PLTJMP(_x)	_x##@plt | |
| 42 | # else | |
| 43 | # define PLTJMP(_x)	_x | |
| 44 | # endif | |
| 45 | ||
| 46 | # define L(label) .L##label | |
| 47 | ||
| 48 | # define CALL_MCOUNT		/* Do nothing for now. */ | |
| 49 | ||
| 50 | # define STR(reg, rbase, off)	st reg, [rbase, off * 4] | |
| 51 | # define LDR(reg, rbase, off)	ld reg, [rbase, off * 4] | |
| 52 | ||
| 53 | #endif	/* __ASSEMBLER__ */ |
lib/libc/glibc/sysdeps/arm/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for ARM. |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/arm/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for ARM. |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/arm/dl-sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* System-specific settings for dynamic linker code. Alpha version. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/arm/nptl/bits/pthreadtypes-arch.h deleted-71| ... | ... | @@ -1,71 +0,0 @@ |
| 1 | /* Copyright (C) 2002-2019 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <http://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _BITS_PTHREADTYPES_ARCH_H | |
| 19 | #define _BITS_PTHREADTYPES_ARCH_H	1 | |
| 20 | ||
| 21 | #include <endian.h> | |
| 22 | ||
| 23 | #define __SIZEOF_PTHREAD_ATTR_T 36 | |
| 24 | #define __SIZEOF_PTHREAD_MUTEX_T 24 | |
| 25 | #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 | |
| 26 | #define __SIZEOF_PTHREAD_COND_T 48 | |
| 27 | #define __SIZEOF_PTHREAD_CONDATTR_T 4 | |
| 28 | #define __SIZEOF_PTHREAD_RWLOCK_T 32 | |
| 29 | #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 | |
| 30 | #define __SIZEOF_PTHREAD_BARRIER_T 20 | |
| 31 | #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 | |
| 32 | ||
| 33 | /* Data structure for mutex handling. */ | |
| 34 | #define __PTHREAD_COMPAT_PADDING_MID | |
| 35 | #define __PTHREAD_COMPAT_PADDING_END | |
| 36 | #define __PTHREAD_MUTEX_LOCK_ELISION 0 | |
| 37 | #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1 | |
| 38 | #define __PTHREAD_MUTEX_USE_UNION 1 | |
| 39 | ||
| 40 | #define __LOCK_ALIGNMENT | |
| 41 | #define __ONCE_ALIGNMENT | |
| 42 | ||
| 43 | struct __pthread_rwlock_arch_t | |
| 44 | { | |
| 45 | unsigned int __readers; | |
| 46 | unsigned int __writers; | |
| 47 | unsigned int __wrphase_futex; | |
| 48 | unsigned int __writers_futex; | |
| 49 | unsigned int __pad3; | |
| 50 | unsigned int __pad4; | |
| 51 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 52 | unsigned char __pad1; | |
| 53 | unsigned char __pad2; | |
| 54 | unsigned char __shared; | |
| 55 | /* FLAGS must stay at this position in the structure to maintain | |
| 56 | binary compatibility. */ | |
| 57 | unsigned char __flags; | |
| 58 | #else | |
| 59 | /* FLAGS must stay at this position in the structure to maintain | |
| 60 | binary compatibility. */ | |
| 61 | unsigned char __flags; | |
| 62 | unsigned char __shared; | |
| 63 | unsigned char __pad1; | |
| 64 | unsigned char __pad2; | |
| 65 | #endif | |
| 66 | int __cur_writer; | |
| 67 | }; | |
| 68 | ||
| 69 | #define __PTHREAD_RWLOCK_ELISION_EXTRA 0 | |
| 70 | ||
| 71 | #endif	/* bits/pthreadtypes.h */ |
lib/libc/glibc/sysdeps/arm/start.S+6-18| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Startup code for ARM & ELF |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -94,30 +94,20 @@ _start: |
| 94 | 94 | 	adr a4, .L_GOT |
| 95 | 95 | 	add sl, sl, a4 |
| 96 | 96 | |
| 97 | 	ldr ip, .L_GOT+4	/* __libc_csu_fini */ | |
| 98 | 	ldr ip, [sl, ip] | |
| 97 | 	mov a4, #0		/* Used to be init. */ | |
| 98 | 	push { a4 }		/* Used to be fini. */ | |
| 99 | 99 | |
| 100 | 	push { ip }		/* Push __libc_csu_fini */ | |
| 101 | ||
| 102 | 	ldr a4, .L_GOT+8	/* __libc_csu_init */ | |
| 103 | 	ldr a4, [sl, a4] | |
| 104 | ||
| 105 | 	ldr a1, .L_GOT+12	/* main */ | |
| 100 | 	ldr a1, .L_GOT+4	/* main */ | |
| 106 | 101 | 	ldr a1, [sl, a1] |
| 107 | 102 | |
| 108 | 103 | 	/* __libc_start_main (main, argc, argv, init, fini, rtld_fini, stack_end) */ |
| 109 | 104 | 	/* Let the libc call main and exit with its return code. */ |
| 110 | 105 | 	bl __libc_start_main(PLT) |
| 111 | 106 | #else |
| 112 | 	/* Fetch address of __libc_csu_fini */ | |
| 113 | 	ldr ip, =__libc_csu_fini | |
| 114 | ||
| 115 | 	/* Push __libc_csu_fini */ | |
| 116 | 	push { ip } | |
| 117 | 107 | |
| 118 | 	/* Set up the other arguments in registers */ | |
| 108 | 	mov a4, #0		/* Used to init. */ | |
| 109 | 	push { a4 }		/* Used to fini. */ | |
| 119 | 110 | 	ldr a1, =main |
| 120 | 	ldr a4, =__libc_csu_init | |
| 121 | 111 | |
| 122 | 112 | 	/* __libc_start_main (main, argc, argv, init, fini, rtld_fini, stack_end) */ |
| 123 | 113 | 	/* Let the libc call main and exit with its return code. */ |
| ... | ... | @@ -131,8 +121,6 @@ _start: |
| 131 | 121 | 	.align 2 |
| 132 | 122 | .L_GOT: |
| 133 | 123 | 	.word _GLOBAL_OFFSET_TABLE_ - .L_GOT |
| 134 | 	.word __libc_csu_fini(GOT) | |
| 135 | 	.word __libc_csu_init(GOT) | |
| 136 | 124 | 	.word main(GOT) |
| 137 | 125 | #endif |
| 138 | 126 |
lib/libc/glibc/sysdeps/arm/sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembler macros for ARM. |
| 2 | Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/csky/sysdep.h created+84| ... | ... | @@ -0,0 +1,84 @@ |
| 1 | /* Assembler macros for C-SKY. | |
| 2 | Copyright (C) 2018-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <sysdeps/generic/sysdep.h> | |
| 20 | #include <features.h> | |
| 21 | ||
| 22 | #ifdef __ASSEMBLER__ | |
| 23 | ||
| 24 | # define ASM_SIZE_DIRECTIVE(name) .size name,.-name | |
| 25 | ||
| 26 | /* Define an entry point visible from C. */ | |
| 27 | # define ENTRY(name)		\ | |
| 28 | 	.globl name;		\ | |
| 29 | 	.type name,@function;	\ | |
| 30 | 	.align 4;		\ | |
| 31 | 	name##:;		\ | |
| 32 | 	cfi_startproc;		\ | |
| 33 | 	CALL_MCOUNT | |
| 34 | ||
| 35 | # undef END | |
| 36 | # define END(name)		\ | |
| 37 | 	cfi_endproc;		\ | |
| 38 | 	ASM_SIZE_DIRECTIVE(name) | |
| 39 | ||
| 40 | /* If compiled for profiling, call `mcount' at the start of each function. */ | |
| 41 | # ifdef PROF | |
| 42 | # ifdef __PIC__ | |
| 43 | # define CALL_MCOUNT				\ | |
| 44 | 	subi	sp, 4;				\ | |
| 45 | 	stw	lr, (sp, 0);			\ | |
| 46 | 	grs	t0, .Lgetpc;			\ | |
| 47 | .Lgetpc:					\ | |
| 48 | 	lrw	gb, .Lgetpc@GOTPC;		\ | |
| 49 | 	addu	gb, t0;				\ | |
| 50 | 	lrw	t1, _mcount@PLT;		\ | |
| 51 | 	ldr.w	t0, (gb, t1 << 0);		\ | |
| 52 | 	jmp	t0; | |
| 53 | # else | |
| 54 | # define CALL_MCOUNT				\ | |
| 55 | 	subi	sp, 4;				\ | |
| 56 | 	stw	lr, (sp, 0);			\ | |
| 57 | 	jbsr	_mcount; | |
| 58 | # endif | |
| 59 | # else | |
| 60 | # define CALL_MCOUNT	/* Do nothing. */ | |
| 61 | # endif | |
| 62 | ||
| 63 | # if defined (__CK860__) | |
| 64 | /* Instruction fetch will be faster when the label is 16 bytes aligned. | |
| 65 | Filling with nop instruction to avoid extra jump. */ | |
| 66 | # define LABLE_ALIGN	\ | |
| 67 | 	.balignw 16, 0x6c03 | |
| 68 | ||
| 69 | # define PRE_BNEZAD(R) | |
| 70 | ||
| 71 | # define BNEZAD(R, L)	\ | |
| 72 | 	bnezad	R, L | |
| 73 | # else | |
| 74 | # define LABLE_ALIGN	\ | |
| 75 | 	.balignw 8, 0x6c03 | |
| 76 | ||
| 77 | # define PRE_BNEZAD(R)	\ | |
| 78 | 	subi	R, 1 | |
| 79 | ||
| 80 | # define BNEZAD(R, L)	\ | |
| 81 | 	bnez	R, L | |
| 82 | # endif | |
| 83 | ||
| 84 | #endif |
lib/libc/glibc/sysdeps/generic/dl-dtprocnum.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Configuration of lookup functions. |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/generic/dl-sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* System-specific settings for dynamic linker code. Generic version. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/generic/dwarf2.h+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Declarations and definitions of codes relating to the DWARF2 symbolic |
| 2 | 2 | debugging information format. |
| 3 | Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 4 | 4 | Contributed by Gary Funck (gary@intrepid.com). Derived from the |
| 5 | 5 | DWARF 1 implementation written by Ron Guilmette (rfg@monkeys.com). |
| 6 | 6 |
lib/libc/glibc/sysdeps/generic/entry.h created+5| ... | ... | @@ -0,0 +1,5 @@ |
| 1 | #ifndef __ASSEMBLY__ | |
| 2 | extern void _start (void) attribute_hidden; | |
| 3 | #endif | |
| 4 | ||
| 5 | #define ENTRY_POINT _start |
lib/libc/glibc/sysdeps/generic/libc-lock.h+1-13| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* libc-internal interface for mutex locks. Stub version. |
| 2 | Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -125,16 +125,4 @@ |
| 125 | 125 | /* We need portable names for some of the functions. */ |
| 126 | 126 | #define __libc_mutex_unlock |
| 127 | 127 | |
| 128 | /* Type for key of thread specific data. */ | |
| 129 | typedef int __libc_key_t; | |
| 130 | ||
| 131 | /* Create key for thread specific data. */ | |
| 132 | #define __libc_key_create(KEY,DEST)	((void) (KEY), (void) (DEST), -1) | |
| 133 | ||
| 134 | /* Set thread-specific data associated with KEY to VAL. */ | |
| 135 | #define __libc_setspecific(KEY,VAL)	((void) (KEY), (void) (VAL)) | |
| 136 | ||
| 137 | /* Get thread-specific data associated with KEY. */ | |
| 138 | #define __libc_getspecific(KEY)		((void) (KEY), (void *) 0) | |
| 139 | ||
| 140 | 128 | #endif	/* libc-lock.h */ |
lib/libc/glibc/sysdeps/generic/libc-symver.h created+88| ... | ... | @@ -0,0 +1,88 @@ |
| 1 | /* Symbol version management. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* This file is included from <libc-symbols.h> for !_ISOMAC, and | |
| 20 | unconditionally from <shlib-compat.h>. */ | |
| 21 | ||
| 22 | #ifndef _LIBC_SYMVER_H | |
| 23 | #define _LIBC_SYMVER_H 1 | |
| 24 | ||
| 25 | #include <config.h> | |
| 26 | ||
| 27 | /* Use symbol_version_reference to specify the version a symbol | |
| 28 | reference should link to. Use symbol_version or | |
| 29 | default_symbol_version for the definition of a versioned symbol. | |
| 30 | The difference is that the latter is a no-op in non-shared | |
| 31 | builds. | |
| 32 | ||
| 33 | _set_symbol_version is similar to symbol_version_reference, except | |
| 34 | that this macro expects the name and symbol version as a single | |
| 35 | string or token sequence, with an @ or @@ separator. (A string is | |
| 36 | used in C mode and a token sequence in assembler mode.) | |
| 37 | _set_symbol_version only be used for definitions because it may | |
| 38 | introduce an alias symbol that would not be globally unique for | |
| 39 | mere references. The _set_symbol_version macro is used to define | |
| 40 | default_symbol_version and compat_symbol. */ | |
| 41 | ||
| 42 | #ifdef __ASSEMBLER__ | |
| 43 | # define symbol_version_reference(real, name, version) \ | |
| 44 | .symver real, name##@##version | |
| 45 | #else | |
| 46 | # define symbol_version_reference(real, name, version) \ | |
| 47 | __asm__ (".symver " #real "," #name "@" #version) | |
| 48 | #endif /* !__ASSEMBLER__ */ | |
| 49 | ||
| 50 | #if SYMVER_NEEDS_ALIAS | |
| 51 | /* If the assembler cannot support multiple versions for the same | |
| 52 | symbol, introduce __SInnn_ aliases to which the symbol version is | |
| 53 | attached. */ | |
| 54 | # define __symbol_version_unique_concat(x, y) __SI ## x ## _ ## y | |
| 55 | # define _symbol_version_unique_concat(x, y) \ | |
| 56 | __symbol_version_unique_concat (x, y) | |
| 57 | # define _symbol_version_unique_alias(name) \ | |
| 58 | _symbol_version_unique_concat (name, __COUNTER__) | |
| 59 | # ifdef __ASSEMBLER__ | |
| 60 | # define _set_symbol_version_2(real, alias, name_version) \ | |
| 61 | .globl alias ASM_LINE_SEP \ | |
| 62 | .equiv alias, real ASM_LINE_SEP \ | |
| 63 | .symver alias, name_version | |
| 64 | # else | |
| 65 | # define _set_symbol_version_2(real, alias, name_version) \ | |
| 66 | __asm__ (".globl " #alias "\n\t" \ | |
| 67 | ".equiv " #alias ", " #real "\n\t" \ | |
| 68 | ".symver " #alias "," name_version) | |
| 69 | # endif | |
| 70 | # define _set_symbol_version_1(real, alias, name_version) \ | |
| 71 | _set_symbol_version_2 (real, alias, name_version) | |
| 72 | /* REAL must be globally unique, so that the counter also produces | |
| 73 | globally unique symbols. */ | |
| 74 | # define _set_symbol_version(real, name_version) \ | |
| 75 | _set_symbol_version_1 (real, _symbol_version_unique_alias (real), \ | |
| 76 | name_version) | |
| 77 | # else /* !SYMVER_NEEDS_ALIAS */ | |
| 78 | # ifdef __ASSEMBLER__ | |
| 79 | # define _set_symbol_version(real, name_version) \ | |
| 80 | .symver real, name_version | |
| 81 | # else | |
| 82 | # define _set_symbol_version(real, name_version) \ | |
| 83 | __asm__ (".symver " #real "," name_version) | |
| 84 | # endif | |
| 85 | #endif /* !SYMVER_NEEDS_ALIAS */ | |
| 86 | ||
| 87 | ||
| 88 | #endif /* _LIBC_SYMVER_H */ |
lib/libc/glibc/sysdeps/generic/single-thread.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Single thread optimization, generic version. |
| 2 | Copyright (C) 2019-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/generic/struct_stat_time64.h created+6| ... | ... | @@ -0,0 +1,6 @@ |
| 1 | #ifndef _BITS_STRUCT_STAT_TIME64_H | |
| 2 | #define _BITS_STRUCT_STAT_TIME64_H 1 | |
| 3 | ||
| 4 | #define __stat64_t64 stat64 | |
| 5 | ||
| 6 | #endif |
lib/libc/glibc/sysdeps/generic/sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Generic asm macros used on many machines. |
| 2 | Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/generic/tls.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Definition for thread-local data handling. Generic version. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/generic/xstatver.h created+4| ... | ... | @@ -0,0 +1,4 @@ |
| 1 | /* Versions of the 'struct stat' data structure used in compatibility xstat | |
| 2 | functions. */ | |
| 3 | #define _STAT_VER 0 | |
| 4 | #define _MKNOD_VER 0 |
lib/libc/glibc/sysdeps/hppa/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for HPPA |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/hppa/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for HPPA |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/hppa/entry.h created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | #ifndef __ASSEMBLY__ | |
| 2 | extern void _start (void); | |
| 3 | #endif | |
| 4 | ||
| 5 | /* Lives in libgcc.so and canonicalizes function pointers for comparison. */ | |
| 6 | extern unsigned int __canonicalize_funcptr_for_compare (unsigned int fptr); | |
| 7 | ||
| 8 | /* The function's entry point is stored in the first word of the | |
| 9 | function descriptor (plabel) of _start(). */ | |
| 10 | #define ENTRY_POINT __canonicalize_funcptr_for_compare((unsigned int)_start) | |
| 11 | ||
| 12 | /* We have to provide a special declaration. */ | |
| 13 | #define ENTRY_POINT_DECL(class) class void _start (void); |
lib/libc/glibc/sysdeps/hppa/nptl/bits/pthreadtypes-arch.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2005-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/hppa/start.S+5-23| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* ELF startup code for HPPA. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -36,8 +36,6 @@ |
| 36 | 36 | 	.import main, code |
| 37 | 37 | 	.import $global$, data |
| 38 | 38 | 	.import __libc_start_main, code |
| 39 | 	.import __libc_csu_fini, code | |
| 40 | 	.import __libc_csu_init, code | |
| 41 | 39 | |
| 42 | 40 | 	/* Have the linker create plabel words so we get PLABEL32 |
| 43 | 41 | 	 relocs and not 21/14. The use of 21/14 relocs is only |
| ... | ... | @@ -52,10 +50,6 @@ |
| 52 | 50 | 	.word P%main |
| 53 | 51 | .Lp__libc_start_main: |
| 54 | 52 | 	.word P%__libc_start_main |
| 55 | .Lp__libc_csu_fini: | |
| 56 | 	.word P%__libc_csu_fini | |
| 57 | .Lp__libc_csu_init: | |
| 58 | 	.word P%__libc_csu_init | |
| 59 | 53 | |
| 60 | 54 | 	.text |
| 61 | 55 | 	.align 4 |
| ... | ... | @@ -77,8 +71,8 @@ _start: |
| 77 | 71 | 		1. r26 - Application main |
| 78 | 72 | 		2. r25 - argc |
| 79 | 73 | 		3. r24 - argv |
| 80 | 		4. r23 - __libc_csu_init | |
| 81 | 		5. sp-52 - __libc_csu_fini | |
| 74 | 		4. r23 - init (unused) | |
| 75 | 		5. sp-52 - fini (unused) | |
| 82 | 76 | 		6. sp-56 - rtld_fini |
| 83 | 77 | 		7. sp-60 - stackend */ |
| 84 | 78 | |
| ... | ... | @@ -108,14 +102,6 @@ _start: |
| 108 | 102 | 	addil	LT'.Lpmain, %r19 |
| 109 | 103 | 	ldw	RT'.Lpmain(%r1), %r26 |
| 110 | 104 | 	ldw	0(%r26),%r26 |
| 111 | 	/* void (*init) (void) (4th argument) */ | |
| 112 | 	addil	LT'.Lp__libc_csu_init, %r19 | |
| 113 | 	ldw	RT'.Lp__libc_csu_init(%r1), %r23 | |
| 114 | 	ldw	0(%r23), %r23 | |
| 115 | 	/* void (*fini) (void) (5th argument) */ | |
| 116 | 	addil	LT'.Lp__libc_csu_fini, %r19 | |
| 117 | 	ldw	RT'.Lp__libc_csu_fini(%r1), %r22 | |
| 118 | 	ldw	0(%r22), %r22 | |
| 119 | 105 | #else |
| 120 | 106 | 	/* Load $global$ address into %dp */ |
| 121 | 107 | 	ldil	L%$global$, %dp |
| ... | ... | @@ -124,13 +110,9 @@ _start: |
| 124 | 110 | 	/* load main (1st argument) */ |
| 125 | 111 | 	ldil	LR'.Lpmain, %r26 |
| 126 | 112 | 	ldw	RR'.Lpmain(%r26), %r26 |
| 127 | 	/* void (*init) (void) (4th argument) */ | |
| 128 | 	ldil	LR'.Lp__libc_csu_init, %r23 | |
| 129 | 	ldw	RR'.Lp__libc_csu_init(%r23), %r23 | |
| 130 | 	/* void (*fini) (void) (5th argument) */ | |
| 131 | 	ldil	LR'.Lp__libc_csu_fini, %r22 | |
| 132 | 	ldw	RR'.Lp__libc_csu_fini(%r22), %r22 | |
| 133 | 113 | #endif |
| 114 | 	ldi	0,%r23		/* Used to be init. */ | |
| 115 | 	ldi	0,%r22		/* Used to be fini. */ | |
| 134 | 116 | 	/* Store 5th argument */ |
| 135 | 117 | 	stw	%r22, -52(%sp) |
| 136 | 118 | 	/* void *stack_end (7th argument) */ |
lib/libc/glibc/sysdeps/hppa/sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembler macros for HP/PA. |
| 2 | Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999. |
| 5 | 5 |
lib/libc/glibc/sysdeps/htl/bits/pthread.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Pthread data structures. Generic version. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/htl/bits/thread-shared-types.h+14-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Common threading primitives definitions for both POSIX and C11. |
| 2 | Copyright (C) 2017-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -20,5 +20,18 @@ |
| 20 | 20 | #define _THREAD_SHARED_TYPES_H 1 |
| 21 | 21 | |
| 22 | 22 | #include <bits/pthreadtypes-arch.h> |
| 23 | #include <bits/types/struct___pthread_once.h> | |
| 24 | ||
| 25 | typedef int __tss_t; | |
| 26 | typedef int __thrd_t; | |
| 27 | ||
| 28 | typedef union | |
| 29 | { | |
| 30 | struct __pthread_once __data; | |
| 31 | int __align __ONCE_ALIGNMENT; | |
| 32 | char __size[__SIZEOF_PTHREAD_ONCE_T]; | |
| 33 | } __once_flag; | |
| 34 | ||
| 35 | #define __ONCE_FLAG_INIT { { __PTHREAD_ONCE_INIT } } | |
| 23 | 36 | |
| 24 | 37 | #endif /* _THREAD_SHARED_TYPES_H */ |
lib/libc/glibc/sysdeps/htl/libc-lockP.h+1-14| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Private libc-internal interface for mutex locks. |
| 2 | Copyright (C) 2015-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2015-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -22,9 +22,6 @@ |
| 22 | 22 | #include <pthread.h> |
| 23 | 23 | #include <pthread-functions.h> |
| 24 | 24 | |
| 25 | /* Type for key to thread-specific data. */ | |
| 26 | typedef pthread_key_t __libc_key_t; | |
| 27 | ||
| 28 | 25 | /* If we check for a weakly referenced symbol and then perform a |
| 29 | 26 | normal jump to it te code generated for some platforms in case of |
| 30 | 27 | PIC is unnecessarily slow. What would happen is that the function |
| ... | ... | @@ -109,16 +106,6 @@ extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock); |
| 109 | 106 | |
| 110 | 107 | extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock); |
| 111 | 108 | |
| 112 | extern int __pthread_key_create (pthread_key_t *__key, | |
| 113 | 				 void (*__destr_function) (void *)); | |
| 114 | ||
| 115 | extern int __pthread_key_delete (pthread_key_t __key); | |
| 116 | ||
| 117 | extern int __pthread_setspecific (pthread_key_t __key, | |
| 118 | 				 const void *__pointer); | |
| 119 | ||
| 120 | extern void *__pthread_getspecific (pthread_key_t __key); | |
| 121 | ||
| 122 | 109 | extern int __pthread_once (pthread_once_t *__once_control, |
| 123 | 110 | 			 void (*__init_routine) (void)); |
| 124 | 111 |
lib/libc/glibc/sysdeps/htl/pthread.h+66-39| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Posix threads. Hurd version. |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -222,6 +222,32 @@ extern void pthread_exit (void *__status) __attribute__ ((__noreturn__)); |
| 222 | 222 | the exit status of the thread in *STATUS. */ |
| 223 | 223 | extern int pthread_join (pthread_t __threadp, void **__status); |
| 224 | 224 | |
| 225 | #ifdef __USE_GNU | |
| 226 | /* Check whether thread TH has terminated. If yes return the status of | |
| 227 | the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */ | |
| 228 | extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW; | |
| 229 | ||
| 230 | /* Make calling thread wait for termination of the thread TH, but only | |
| 231 | until TIMEOUT. The exit status of the thread is stored in | |
| 232 | *THREAD_RETURN, if THREAD_RETURN is not NULL. | |
| 233 | ||
| 234 | This function is a cancellation point and therefore not marked with | |
| 235 | __THROW. */ | |
| 236 | extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return, | |
| 237 | 				 const struct timespec *__abstime); | |
| 238 | ||
| 239 | /* Make calling thread wait for termination of the thread TH, but only | |
| 240 | until TIMEOUT measured against the clock specified by CLOCKID. The | |
| 241 | exit status of the thread is stored in *THREAD_RETURN, if | |
| 242 | THREAD_RETURN is not NULL. | |
| 243 | ||
| 244 | This function is a cancellation point and therefore not marked with | |
| 245 | __THROW. */ | |
| 246 | extern int pthread_clockjoin_np (pthread_t __th, void **__thread_return, | |
| 247 | clockid_t __clockid, | |
| 248 | 				 const struct timespec *__abstime); | |
| 249 | #endif | |
| 250 | ||
| 225 | 251 | /* Indicate that the storage for THREAD can be reclaimed when it |
| 226 | 252 | terminates. */ |
| 227 | 253 | extern int pthread_detach (pthread_t __threadp); |
| ... | ... | @@ -273,6 +299,7 @@ extern pthread_t pthread_self (void) __THROW; |
| 273 | 299 | #ifdef __USE_XOPEN2K |
| 274 | 300 | # define PTHREAD_MUTEX_STALLED __PTHREAD_MUTEX_STALLED |
| 275 | 301 | # define PTHREAD_MUTEX_ROBUST __PTHREAD_MUTEX_ROBUST |
| 302 | # define PTHREAD_MUTEX_ROBUST_NP __PTHREAD_MUTEX_ROBUST | |
| 276 | 303 | #endif |
| 277 | 304 | |
| 278 | 305 | #include <bits/types/struct___pthread_mutexattr.h> |
| ... | ... | @@ -400,6 +427,13 @@ extern int pthread_mutex_timedlock (struct __pthread_mutex *__restrict __mutex, |
| 400 | 427 | 	__THROWNL __nonnull ((1, 2)); |
| 401 | 428 | #endif |
| 402 | 429 | |
| 430 | #ifdef __USE_GNU | |
| 431 | extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex, | |
| 432 | 				 clockid_t __clockid, | |
| 433 | 				 const struct timespec *__restrict | |
| 434 | 				 __abstime) __THROWNL __nonnull ((1, 3)); | |
| 435 | #endif | |
| 436 | ||
| 403 | 437 | /* Unlock MUTEX. */ |
| 404 | 438 | extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) |
| 405 | 439 | 	__THROWNL __nonnull ((1)); |
| ... | ... | @@ -516,6 +550,21 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, |
| 516 | 550 | 				 pthread_mutex_t *__restrict __mutex, |
| 517 | 551 | 				 __const struct timespec *__restrict __abstime) |
| 518 | 552 | 	 __nonnull ((1, 2, 3)); |
| 553 | ||
| 554 | # ifdef __USE_GNU | |
| 555 | /* Wait for condition variable COND to be signaled or broadcast until | |
| 556 | ABSTIME measured by the specified clock. MUTEX is assumed to be | |
| 557 | locked before. CLOCK is the clock to use. ABSTIME is an absolute | |
| 558 | time specification against CLOCK's epoch. | |
| 559 | ||
| 560 | This function is a cancellation point and therefore not marked with | |
| 561 | __THROW. */ | |
| 562 | extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond, | |
| 563 | 				 pthread_mutex_t *__restrict __mutex, | |
| 564 | 				 __clockid_t __clock_id, | |
| 565 | 				 const struct timespec *__restrict __abstime) | |
| 566 | __nonnull ((1, 2, 4)); | |
| 567 | # endif | |
| 519 | 568 | |
| 520 | 569 | |
| 521 | 570 | /* Spin locks. */ |
| ... | ... | @@ -549,42 +598,6 @@ extern int pthread_spin_trylock (pthread_spinlock_t *__lock) |
| 549 | 598 | extern int pthread_spin_unlock (pthread_spinlock_t *__lock) |
| 550 | 599 | 	__nonnull ((1)); |
| 551 | 600 | |
| 552 | # if defined __USE_EXTERN_INLINES && defined _LIBC | |
| 553 | ||
| 554 | # include <bits/spin-lock-inline.h> | |
| 555 | ||
| 556 | __extern_inline int | |
| 557 | pthread_spin_destroy (pthread_spinlock_t *__lock) | |
| 558 | { | |
| 559 | return __pthread_spin_destroy (__lock); | |
| 560 | } | |
| 561 | ||
| 562 | __extern_inline int | |
| 563 | pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) | |
| 564 | { | |
| 565 | return __pthread_spin_init (__lock, __pshared); | |
| 566 | } | |
| 567 | ||
| 568 | __extern_inline int | |
| 569 | pthread_spin_lock (pthread_spinlock_t *__lock) | |
| 570 | { | |
| 571 | return __pthread_spin_lock (__lock); | |
| 572 | } | |
| 573 | ||
| 574 | __extern_inline int | |
| 575 | pthread_spin_trylock (pthread_spinlock_t *__lock) | |
| 576 | { | |
| 577 | return __pthread_spin_trylock (__lock); | |
| 578 | } | |
| 579 | ||
| 580 | __extern_inline int | |
| 581 | pthread_spin_unlock (pthread_spinlock_t *__lock) | |
| 582 | { | |
| 583 | return __pthread_spin_unlock (__lock); | |
| 584 | } | |
| 585 | ||
| 586 | # endif /* Use extern inlines. */ | |
| 587 | ||
| 588 | 601 | #endif /* XPG6. */ |
| 589 | 602 | |
| 590 | 603 | |
| ... | ... | @@ -658,6 +671,13 @@ extern int pthread_rwlock_timedrdlock (struct __pthread_rwlock *__restrict __rwl |
| 658 | 671 | 	__THROWNL __nonnull ((1, 2)); |
| 659 | 672 | # endif |
| 660 | 673 | |
| 674 | # ifdef __USE_GNU | |
| 675 | extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock, | |
| 676 | 				 clockid_t __clockid, | |
| 677 | 				 const struct timespec *__restrict | |
| 678 | 				 __abstime) __THROWNL __nonnull ((1, 3)); | |
| 679 | # endif | |
| 680 | ||
| 661 | 681 | /* Acquire the rwlock *RWLOCK for writing. */ |
| 662 | 682 | extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) |
| 663 | 683 | 	__THROWNL __nonnull ((1)); |
| ... | ... | @@ -674,6 +694,13 @@ extern int pthread_rwlock_timedwrlock (struct __pthread_rwlock *__restrict __rwl |
| 674 | 694 | 	__THROWNL __nonnull ((1, 2)); |
| 675 | 695 | # endif |
| 676 | 696 | |
| 697 | # ifdef __USE_GNU | |
| 698 | extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock, | |
| 699 | 				 clockid_t __clockid, | |
| 700 | 				 const struct timespec *__restrict | |
| 701 | 				 __abstime) __THROWNL __nonnull ((1, 3)); | |
| 702 | # endif | |
| 703 | ||
| 677 | 704 | /* Release the lock held by the current thread on *RWLOCK. */ |
| 678 | 705 | extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) |
| 679 | 706 | 	__THROWNL __nonnull ((1)); |
| ... | ... | @@ -795,14 +822,14 @@ extern void *pthread_getspecific (pthread_key_t __key) __THROW; |
| 795 | 822 | |
| 796 | 823 | /* Set the caller thread's thread specific value of KEY to VALUE. */ |
| 797 | 824 | extern int pthread_setspecific (pthread_key_t __key, const void *__value) |
| 798 | 	__THROW; | |
| 825 | 	__THROW __attr_access_none (2); | |
| 799 | 826 | |
| 800 | 827 | |
| 801 | 828 | /* Dynamic package initialization. */ |
| 802 | 829 | |
| 803 | 830 | #include <bits/types/struct___pthread_once.h> |
| 804 | 831 | |
| 805 | #define PTHREAD_ONCE_INIT __PTHREAD_ONCE_INIT | |
| 832 | #define PTHREAD_ONCE_INIT (struct __pthread_once) { __PTHREAD_ONCE_INIT } | |
| 806 | 833 | |
| 807 | 834 | /* Call INIT_ROUTINE if this function has never been called with |
| 808 | 835 | *ONCE_CONTROL, otherwise do nothing. */ |
lib/libc/glibc/sysdeps/i386/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for x86. |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/i386/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for x86. |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/i386/htl/bits/pthreadtypes-arch.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Machine-specific pthread type layouts. Hurd i386 version. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/i386/start.S+7-9| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Startup code compliant to the ELF i386 ABI. |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -87,11 +87,9 @@ ENTRY (_start) |
| 87 | 87 | 	call 1f |
| 88 | 88 | 	addl $_GLOBAL_OFFSET_TABLE_, %ebx |
| 89 | 89 | |
| 90 | 	/* Push address of our own entry points to .fini and .init. */ | |
| 91 | 	leal __libc_csu_fini@GOTOFF(%ebx), %eax | |
| 92 | 	pushl %eax | |
| 93 | 	leal __libc_csu_init@GOTOFF(%ebx), %eax | |
| 94 | 	pushl %eax | |
| 90 | 	/* This used to be the addresses of .fini and .init. */ | |
| 91 | 	pushl $0 | |
| 92 | 	pushl $0 | |
| 95 | 93 | |
| 96 | 94 | 	pushl %ecx		/* Push second argument: argv. */ |
| 97 | 95 | 	pushl %esi		/* Push first argument: argc. */ |
| ... | ... | @@ -112,9 +110,9 @@ ENTRY (_start) |
| 112 | 110 | 	 But let the libc call main. */ |
| 113 | 111 | 	call __libc_start_main@PLT |
| 114 | 112 | #else |
| 115 | 	/* Push address of our own entry points to .fini and .init. */ | |
| 116 | 	pushl $__libc_csu_fini | |
| 117 | 	pushl $__libc_csu_init | |
| 113 | 	/* This used to be the addresses of .fini and .init. */ | |
| 114 | 	pushl $0 | |
| 115 | 	pushl $0 | |
| 118 | 116 | |
| 119 | 117 | 	pushl %ecx		/* Push second argument: argv. */ |
| 120 | 118 | 	pushl %esi		/* Push first argument: argc. */ |
lib/libc/glibc/sysdeps/i386/symbol-hacks.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Hacks needed for symbol manipulation. i386 version. |
| 2 | Copyright (C) 2017-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/i386/sysdep.h+3-5| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembler macros for i386. |
| 2 | Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -18,8 +18,6 @@ |
| 18 | 18 | |
| 19 | 19 | #include <sysdeps/x86/sysdep.h> |
| 20 | 20 | |
| 21 | #include <features.h> /* For __GNUC_PREREQ. */ | |
| 22 | ||
| 23 | 21 | /* It is desirable that the names of PIC thunks match those used by |
| 24 | 22 | GCC so that multiple copies are eliminated by the linker. Because |
| 25 | 23 | GCC 4.6 and earlier use __i686 in the names, it is necessary to |
| ... | ... | @@ -97,9 +95,9 @@ GET_PC_THUNK(reg):							 \ |
| 97 | 95 | |
| 98 | 96 | # define SETUP_PIC_REG_STR(reg)						\ |
| 99 | 97 | ".ifndef " GET_PC_THUNK_STR (reg) "\n"				\ |
| 100 | "section .text." GET_PC_THUNK_STR (reg) ",\"axG\",@progbits," 	\ | |
| 98 | ".section .text." GET_PC_THUNK_STR (reg) ",\"axG\",@progbits,"	\ | |
| 99 | GET_PC_THUNK_STR (reg) ",comdat\n"					\ | |
| 101 | 100 | ".globl " GET_PC_THUNK_STR (reg) "\n"					\ |
| 102 | GET_PC_THUNK_STR (reg) ",comdat\n" \ | |
| 103 | 101 | ".hidden " GET_PC_THUNK_STR (reg) "\n"				\ |
| 104 | 102 | ".p2align 4\n"							\ |
| 105 | 103 | ".type " GET_PC_THUNK_STR (reg) ",@function\n"			\ |
lib/libc/glibc/sysdeps/ia64/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for IA64. |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/ia64/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for ARM. |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/ia64/dl-dtprocnum.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Configuration of lookup functions. IA-64 version. |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/ia64/dl-sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* System-specific settings for dynamic linker code. IA-64 version. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/ia64/entry.h created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | #include <link.h> | |
| 2 | #include <dl-fptr.h> | |
| 3 | ||
| 4 | #ifndef __ASSEMBLY__ | |
| 5 | extern void _start (void); | |
| 6 | #endif | |
| 7 | ||
| 8 | /* The function's entry point is stored in the first word of the | |
| 9 | function descriptor (plabel) of _start(). */ | |
| 10 | #define ENTRY_POINT ELF_PTR_TO_FDESC (_start)->ip | |
| 11 | ||
| 12 | /* We have to provide a special declaration. */ | |
| 13 | #define ENTRY_POINT_DECL(class) class void _start (void); |
lib/libc/glibc/sysdeps/ia64/nptl/bits/pthreadtypes-arch.h deleted-63| ... | ... | @@ -1,63 +0,0 @@ |
| 1 | /* Copyright (C) 2003-2019 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_PTHREADTYPES_ARCH_H | |
| 20 | #define _BITS_PTHREADTYPES_ARCH_H	1 | |
| 21 | ||
| 22 | #define __SIZEOF_PTHREAD_ATTR_T 56 | |
| 23 | #define __SIZEOF_PTHREAD_MUTEX_T 40 | |
| 24 | #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 | |
| 25 | #define __SIZEOF_PTHREAD_COND_T 48 | |
| 26 | #define __SIZEOF_PTHREAD_CONDATTR_T 4 | |
| 27 | #define __SIZEOF_PTHREAD_RWLOCK_T 56 | |
| 28 | #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 | |
| 29 | #define __SIZEOF_PTHREAD_BARRIER_T 32 | |
| 30 | #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 | |
| 31 | ||
| 32 | /* Definitions for internal mutex struct. */ | |
| 33 | #define __PTHREAD_COMPAT_PADDING_MID | |
| 34 | #define __PTHREAD_COMPAT_PADDING_END | |
| 35 | #define __PTHREAD_MUTEX_LOCK_ELISION 0 | |
| 36 | #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0 | |
| 37 | #define __PTHREAD_MUTEX_USE_UNION 0 | |
| 38 | ||
| 39 | #define __LOCK_ALIGNMENT | |
| 40 | #define __ONCE_ALIGNMENT | |
| 41 | ||
| 42 | /* Data structure for reader-write lock variable handling. The | |
| 43 | structure of the attribute type is not exposed on purpose. */ | |
| 44 | struct __pthread_rwlock_arch_t | |
| 45 | { | |
| 46 | unsigned int __readers; | |
| 47 | unsigned int __writers; | |
| 48 | unsigned int __wrphase_futex; | |
| 49 | unsigned int __writers_futex; | |
| 50 | unsigned int __pad3; | |
| 51 | unsigned int __pad4; | |
| 52 | int __cur_writer; | |
| 53 | int __shared; | |
| 54 | unsigned long int __pad1; | |
| 55 | unsigned long int __pad2; | |
| 56 | /* FLAGS must stay at this position in the structure to maintain | |
| 57 | binary compatibility. */ | |
| 58 | unsigned int __flags; | |
| 59 | }; | |
| 60 | ||
| 61 | #define __PTHREAD_RWLOCK_ELISION_EXTRA 0 | |
| 62 | ||
| 63 | #endif	/* bits/pthreadtypes.h */ |
lib/libc/glibc/sysdeps/ia64/start.S+3-8| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999. |
| 4 | 4 | |
| ... | ... | @@ -82,20 +82,15 @@ _start: |
| 82 | 82 | 	{ |
| 83 | 83 | 	 addl r11 = @ltoff(__libc_ia64_register_backing_store_base), gp |
| 84 | 84 | 	 addl out0 = @ltoff(@fptr(main)), gp |
| 85 | 	 addl out3 = @ltoff(@fptr(__libc_csu_init)), gp | |
| 85 | 	 mov out3 = r0		/* Used to be init. */ | |
| 86 | 86 | 	 ;; |
| 87 | 87 | 	} |
| 88 | 88 | 	{ .mmi |
| 89 | 89 | 	 ld8 r3 = [r11]	/* pointer to __libc_ia64_register_backing_store_base */ |
| 90 | 90 | 	 ld8 out0 = [out0]	/* pointer to `main' function descriptor */ |
| 91 | 	 addl out4 = @ltoff(@fptr(__libc_csu_fini)), gp | |
| 91 | 	 mov out4 = r0		/* Used to be fini. */ | |
| 92 | 92 | 	 ;; |
| 93 | 93 | 	} |
| 94 | 	{ .mmi | |
| 95 | 	 ld8 out3 = [out3]	/* pointer to `init' function descriptor */ | |
| 96 | 	 ld8 out4 = [out4]	/* pointer to `fini' function descriptor */ | |
| 97 | 	 nop 0 | |
| 98 | 	} | |
| 99 | 94 | 	.body |
| 100 | 95 | 	{ .mib |
| 101 | 96 | 	 st8 [r3] = r10 |
lib/libc/glibc/sysdeps/ia64/sysdep.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Contributed by David Mosberger-Tang <davidm@hpl.hp.com> |
| 4 | 4 |
lib/libc/glibc/sysdeps/init_array/crti.S deleted-27| ... | ... | @@ -1,27 +0,0 @@ |
| 1 | /* Dummy crti file. | |
| 2 | ||
| 3 | In this configuration, crti.o and crtn.o are both empty because the | |
| 4 | .init_array/.fini_array sections are used exclusively. | |
| 5 | ||
| 6 | Older ports cannot use this because even if the linker used to | |
| 7 | build libc itself has .init_array support, we don't want to produce | |
| 8 | a crt[in].o that presume a linker that new will be used to link | |
| 9 | other things later. | |
| 10 | ||
| 11 | But new configurations without compatibility concerns for | |
| 12 | toolchains without .init_array support can use this to avoid the | |
| 13 | superfluous .init and .fini boilerplate code. */ | |
| 14 | ||
| 15 | #ifdef PREINIT_FUNCTION | |
| 16 | ||
| 17 | #if PREINIT_FUNCTION_WEAK | |
| 18 | # error PREINIT_FUNCTION_WEAK is unsupported | |
| 19 | #endif | |
| 20 | ||
| 21 | /* This arranges for PREINIT_FUNCTION to be called upon loading a library that | |
| 22 | contains crti.o. */ | |
| 23 | ||
| 24 | 	.section .init_array,"a",%init_array | |
| 25 | 	.dc.a PREINIT_FUNCTION | |
| 26 | ||
| 27 | #endif |
lib/libc/glibc/sysdeps/init_array/crtn.S deleted-13| ... | ... | @@ -1,13 +0,0 @@ |
| 1 | /* Dummy crtn file. | |
| 2 | ||
| 3 | In this configuration, crti.o and crtn.o are both empty because the | |
| 4 | .init_array/.fini_array sections are used exclusively. | |
| 5 | ||
| 6 | Older ports cannot use this because even if the linker used to | |
| 7 | build libc itself has .init_array support, we don't want to produce | |
| 8 | a crt[in].o that presume a linker that new will be used to link | |
| 9 | other things later. | |
| 10 | ||
| 11 | But new configurations without compatibility concerns for | |
| 12 | toolchains without .init_array support can use this to avoid the | |
| 13 | superfluous .init and .fini boilerplate code. */ |
lib/libc/glibc/sysdeps/m68k/coldfire/sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembler macros for Coldfire. |
| 2 | Copyright (C) 1998-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/m68k/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for m68k. |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/m68k/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for m68k. |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/m68k/m680x0/sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembler macros for m680x0. |
| 2 | Copyright (C) 2010-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2010-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2010-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2010-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. |
| 4 | 4 |
lib/libc/glibc/sysdeps/m68k/start.S+5-10| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Startup code compliant to the ELF m68k ABI. |
| 2 | Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -76,15 +76,14 @@ _start: |
| 76 | 76 | 	pea (%a1)		/* Push address of the shared library |
| 77 | 77 | 				 termination function. */ |
| 78 | 78 | |
| 79 | 	/* These used to be addresses of the .fini and .init entry points. */ | |
| 80 | 	clr.l -(%sp) | |
| 81 | 	clr.l -(%sp) | |
| 82 | ||
| 79 | 83 | #ifdef PIC |
| 80 | 84 | 	/* Load PIC register. */ |
| 81 | 85 | 	LOAD_GOT (%a5) |
| 82 | 86 | |
| 83 | 	/* Push the address of our own entry points to `.fini' and | |
| 84 | 	 `.init'. */ | |
| 85 | 	move.l __libc_csu_fini@GOT(%a5), -(%sp) | |
| 86 | 	move.l __libc_csu_init@GOT(%a5), -(%sp) | |
| 87 | ||
| 88 | 87 | 	pea (%a0)		/* Push second argument: argv. */ |
| 89 | 88 | 	move.l %d0, -(%sp)	/* Push first argument: argc. */ |
| 90 | 89 | |
| ... | ... | @@ -94,10 +93,6 @@ _start: |
| 94 | 93 | 	 let the libc call main. */ |
| 95 | 94 | 	jbsr __libc_start_main@PLTPC |
| 96 | 95 | #else |
| 97 | 	/* Push the address of our own entry points to `.fini' and | |
| 98 | 	 `.init'. */ | |
| 99 | 	pea __libc_csu_fini | |
| 100 | 	pea __libc_csu_init | |
| 101 | 96 | |
| 102 | 97 | 	pea (%a0)		/* Push second argument: argv. */ |
| 103 | 98 | 	move.l %d0, -(%sp)	/* Push first argument: argc. */ |
lib/libc/glibc/sysdeps/m68k/symbol-hacks.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Hacks needed for symbol manipulation. m68k version. |
| 2 | Copyright (C) 2017-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/m68k/sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembler macros for m68k. |
| 2 | Copyright (C) 1998-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/mach/hurd/bits/stat.h deleted-263| ... | ... | @@ -1,263 +0,0 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #if !defined _SYS_STAT_H && !defined _FCNTL_H | |
| 19 | # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #ifndef _BITS_STAT_H | |
| 23 | #define _BITS_STAT_H	1 | |
| 24 | ||
| 25 | #include <bits/types.h> | |
| 26 | ||
| 27 | /* NOTE: The size of this structure (32 ints) is known in | |
| 28 | <hurd/hurd_types.defs>, since it is used in the `io_stat' RPC. MiG | |
| 29 | does not cope at all well with the passed C structure not being of | |
| 30 | the expected size. There are some filler words at the end to allow | |
| 31 | for future expansion. To increase the size of the structure used | |
| 32 | in the RPC and retain binary compatibility, we would need to assign | |
| 33 | a new message number. */ | |
| 34 | ||
| 35 | struct stat | |
| 36 | { | |
| 37 | int st_fstype;		/* File system type. */ | |
| 38 | __fsid_t st_fsid;		/* File system ID. */ | |
| 39 | #define	st_dev	st_fsid | |
| 40 | ||
| 41 | #ifndef __USE_FILE_OFFSET64 | |
| 42 | __ino_t st_ino;		/* File number. */ | |
| 43 | #else | |
| 44 | __ino64_t st_ino;		/* File number. */ | |
| 45 | #endif | |
| 46 | unsigned int st_gen;	/* To detect reuse of file numbers. */ | |
| 47 | __dev_t st_rdev;		/* Device if special file. */ | |
| 48 | __mode_t st_mode;		/* File mode. */ | |
| 49 | __nlink_t st_nlink;		/* Number of links. */ | |
| 50 | ||
| 51 | __uid_t st_uid;		/* Owner. */ | |
| 52 | __gid_t st_gid;		/* Owning group. */ | |
| 53 | ||
| 54 | #ifndef __USE_FILE_OFFSET64 | |
| 55 | __off_t st_size;		/* Size in bytes. */ | |
| 56 | #else | |
| 57 | __off64_t st_size;		/* Size in bytes. */ | |
| 58 | #endif | |
| 59 | ||
| 60 | #ifdef __USE_XOPEN2K8 | |
| 61 | /* Nanosecond resolution timestamps are stored in a format | |
| 62 | equivalent to 'struct timespec'. This is the type used | |
| 63 | whenever possible but the Unix namespace rules do not allow the | |
| 64 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 65 | Therefore we have to handle the use of this header in strictly | |
| 66 | standard-compliant sources special. */ | |
| 67 | struct timespec st_atim;		/* Time of last access. */ | |
| 68 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 69 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 70 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 71 | # define st_mtime st_mtim.tv_sec | |
| 72 | # define st_ctime st_ctim.tv_sec | |
| 73 | #else | |
| 74 | __time_t st_atime;			/* Time of last access. */ | |
| 75 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 76 | __time_t st_mtime;			/* Time of last modification. */ | |
| 77 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 78 | __time_t st_ctime;			/* Time of last status change. */ | |
| 79 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 80 | #endif | |
| 81 | ||
| 82 | __blksize_t st_blksize;	/* Optimal size for I/O. */ | |
| 83 | ||
| 84 | #ifndef __USE_FILE_OFFSET64 | |
| 85 | __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated. | |
| 86 | 				 Not related to `st_blksize'. */ | |
| 87 | #else | |
| 88 | __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated. | |
| 89 | 				 Not related to `st_blksize'. */ | |
| 90 | #endif | |
| 91 | ||
| 92 | __uid_t st_author;		/* File author. */ | |
| 93 | ||
| 94 | unsigned int st_flags;	/* User-defined flags. | |
| 95 | 				 High 16 bits can be set only by root. */ | |
| 96 | ||
| 97 | #ifndef __USE_FILE_OFFSET64 | |
| 98 | # define _SPARE_SIZE	((sizeof (__fsid_t) == sizeof (int)) ? 12 : 11) | |
| 99 | #else | |
| 100 | # define _SPARE_SIZE	((sizeof (__fsid_t) == sizeof (int)) ? 9 : 8) | |
| 101 | #endif | |
| 102 | int st_spare[_SPARE_SIZE];	/* Room for future expansion. */ | |
| 103 | #undef _SPARE_SIZE | |
| 104 | }; | |
| 105 | ||
| 106 | #ifdef __USE_LARGEFILE64 | |
| 107 | struct stat64 | |
| 108 | { | |
| 109 | int st_fstype;		/* File system type. */ | |
| 110 | __fsid_t st_fsid;		/* File system ID. */ | |
| 111 | # define st_dev	st_fsid | |
| 112 | ||
| 113 | __ino64_t st_ino;		/* File number. */ | |
| 114 | unsigned int st_gen;	/* To detect reuse of file numbers. */ | |
| 115 | __dev_t st_rdev;		/* Device if special file. */ | |
| 116 | __mode_t st_mode;		/* File mode. */ | |
| 117 | __nlink_t st_nlink;		/* Number of links. */ | |
| 118 | ||
| 119 | __uid_t st_uid;		/* Owner. */ | |
| 120 | __gid_t st_gid;		/* Owning group. */ | |
| 121 | ||
| 122 | __off64_t st_size;		/* Size in bytes. */ | |
| 123 | ||
| 124 | #ifdef __USE_XOPEN2K8 | |
| 125 | /* Nanosecond resolution timestamps are stored in a format | |
| 126 | equivalent to 'struct timespec'. This is the type used | |
| 127 | whenever possible but the Unix namespace rules do not allow the | |
| 128 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 129 | Therefore we have to handle the use of this header in strictly | |
| 130 | standard-compliant sources special. */ | |
| 131 | struct timespec st_atim;		/* Time of last access. */ | |
| 132 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 133 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 134 | #else | |
| 135 | __time_t st_atime;			/* Time of last access. */ | |
| 136 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 137 | __time_t st_mtime;			/* Time of last modification. */ | |
| 138 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 139 | __time_t st_ctime;			/* Time of last status change. */ | |
| 140 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 141 | #endif | |
| 142 | ||
| 143 | __blksize_t st_blksize;	/* Optimal size for I/O. */ | |
| 144 | ||
| 145 | __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated. | |
| 146 | 				 Not related to `st_blksize'. */ | |
| 147 | ||
| 148 | __uid_t st_author;		/* File author. */ | |
| 149 | ||
| 150 | unsigned int st_flags;	/* User-defined flags. | |
| 151 | 				 High 16 bits can be set only by root. */ | |
| 152 | ||
| 153 | #define _SPARE_SIZE	((sizeof (__fsid_t) == sizeof (int)) ? 9 : 8) | |
| 154 | int st_spare[_SPARE_SIZE];	/* Room for future expansion. */ | |
| 155 | #undef _SPARE_SIZE | |
| 156 | }; | |
| 157 | #endif | |
| 158 | ||
| 159 | /* Tell code we have these members. */ | |
| 160 | #define	_STATBUF_ST_BLKSIZE | |
| 161 | /* Nanosecond resolution time values are supported. */ | |
| 162 | #define _STATBUF_ST_NSEC | |
| 163 | ||
| 164 | /* Encoding of the file mode. */ | |
| 165 | ||
| 166 | #define	__S_IFMT	0170000	/* These bits determine file type. */ | |
| 167 | ||
| 168 | /* File types. */ | |
| 169 | #define	__S_IFDIR	0040000	/* Directory. */ | |
| 170 | #define	__S_IFCHR	0020000	/* Character device. */ | |
| 171 | #define	__S_IFBLK	0060000	/* Block device. */ | |
| 172 | #define	__S_IFREG	0100000	/* Regular file. */ | |
| 173 | #define	__S_IFLNK	0120000	/* Symbolic link. */ | |
| 174 | #define	__S_IFSOCK	0140000	/* Socket. */ | |
| 175 | #define	__S_IFIFO	0010000	/* FIFO. */ | |
| 176 | ||
| 177 | /* POSIX.1b objects. */ | |
| 178 | #define __S_TYPEISMQ(buf) (0) | |
| 179 | #define __S_TYPEISSEM(buf) (0) | |
| 180 | #define __S_TYPEISSHM(buf) (0) | |
| 181 | ||
| 182 | /* Protection bits. */ | |
| 183 | ||
| 184 | #define	__S_ISUID	04000	/* Set user ID on execution. */ | |
| 185 | #define	__S_ISGID	02000	/* Set group ID on execution. */ | |
| 186 | #define	__S_ISVTX	01000	/* Save swapped text after use (sticky). */ | |
| 187 | #define	__S_IREAD	00400	/* Read by owner. */ | |
| 188 | #define	__S_IWRITE	00200	/* Write by owner. */ | |
| 189 | #define	__S_IEXEC	00100	/* Execute by owner. */ | |
| 190 | ||
| 191 | ||
| 192 | #ifdef	__USE_GNU | |
| 193 | /* If set, there is no benefit in caching the contents of this file. */ | |
| 194 | #define S_INOCACHE	000000200000 | |
| 195 | ||
| 196 | /* If the S_IUSEUNK bit is set, then the S_IUNKNOWN bits (see below) | |
| 197 | control access for unknown users. If S_IUSEUNK is clear, then unknown | |
| 198 | users are treated as "others" for purposes of access control. */ | |
| 199 | #define S_IUSEUNK	000000400000 | |
| 200 | /* Mask of protection bits for unknown users (no effective IDs at all). */ | |
| 201 | #define S_IUNKNOWN 000007000000 | |
| 202 | /* Shift S_IREAD, S_IWRITE, S_IEXEC left this many bits to produce the | |
| 203 | protection bits for unknown users. */ | |
| 204 | #define S_IUNKSHIFT	12 | |
| 205 | ||
| 206 | /* Read only bits: */ | |
| 207 | ||
| 208 | /* There is a passive translator set for this file */ | |
| 209 | #define S_IPTRANS	000010000000 | |
| 210 | /* There is an active translator running on this file */ | |
| 211 | #define S_IATRANS	000020000000 | |
| 212 | /* This is the root of a filesystem (or single node translator) */ | |
| 213 | #define S_IROOT		000040000000 | |
| 214 | /* All the bits relevant to translators */ | |
| 215 | #define S_ITRANS	000070000000 | |
| 216 | ||
| 217 | /* Definitely no mmaps to this. */ | |
| 218 | #define S_IMMAP0	000100000000 | |
| 219 | ||
| 220 | /* ALL the unused bits. */ | |
| 221 | #define	S_ISPARE	(~(S_IFMT|S_ITRANS|S_INOCACHE|S_IMMAP0 \ | |
| 222 | 			 |S_IUSEUNK|S_IUNKNOWN|07777)) | |
| 223 | #endif | |
| 224 | ||
| 225 | #ifdef	__USE_MISC | |
| 226 | /* Default file creation mask (umask). */ | |
| 227 | # define CMASK		0022 | |
| 228 | ||
| 229 | /* Definitions of flags stored in file flags word. */ | |
| 230 | ||
| 231 | /* Super-user and owner changeable flags. */ | |
| 232 | # define UF_SETTABLE	0x0000ffff	/* mask of owner changeable flags */ | |
| 233 | # define UF_NODUMP	0x00000001	/* do not dump file */ | |
| 234 | # define UF_IMMUTABLE	0x00000002	/* file may not be changed */ | |
| 235 | # define UF_APPEND	0x00000004	/* writes to file may only append */ | |
| 236 | # define UF_OPAQUE	0x00000008	/* directory is opaque wrt. union */ | |
| 237 | # define UF_NOUNLINK	0x00000010	/* file may not be removed or renamed */ | |
| 238 | ||
| 239 | /* Super-user changeable flags. */ | |
| 240 | # define SF_SETTABLE	0xffff0000	/* mask of superuser changeable flags */ | |
| 241 | # define SF_ARCHIVED	0x00010000	/* file is archived */ | |
| 242 | # define SF_IMMUTABLE	0x00020000	/* file may not be changed */ | |
| 243 | # define SF_APPEND	0x00040000	/* writes to file may only append */ | |
| 244 | # define SF_NOUNLINK	0x00100000	/* file may not be removed or renamed */ | |
| 245 | # define SF_SNAPSHOT	0x00200000	/* snapshot inode */ | |
| 246 | ||
| 247 | __BEGIN_DECLS | |
| 248 | ||
| 249 | /* Set file flags for FILE to FLAGS. */ | |
| 250 | extern int chflags (__const char *__file, unsigned long int __flags) __THROW; | |
| 251 | ||
| 252 | /* Set file flags of the file referred to by FD to FLAGS. */ | |
| 253 | extern int fchflags (int __fd, unsigned long int __flags) __THROW; | |
| 254 | ||
| 255 | __END_DECLS | |
| 256 | #endif | |
| 257 | ||
| 258 | #ifdef __USE_ATFILE | |
| 259 | # define UTIME_NOW -1 /* corresponds to the current time */ | |
| 260 | # define UTIME_OMIT -2 /* target time is omitted */ | |
| 261 | #endif | |
| 262 | ||
| 263 | #endif	/* bits/stat.h */ |
lib/libc/glibc/sysdeps/mach/hurd/bits/typesizes.h deleted-72| ... | ... | @@ -1,72 +0,0 @@ |
| 1 | /* bits/typesizes.h -- underlying types for *_t. Hurd version. | |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_TYPES_H | |
| 20 | # error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifndef	_BITS_TYPESIZES_H | |
| 24 | #define	_BITS_TYPESIZES_H	1 | |
| 25 | ||
| 26 | /* See <bits/types.h> for the meaning of these macros. This file exists so | |
| 27 | that <bits/types.h> need not vary across different GNU platforms. */ | |
| 28 | ||
| 29 | #define __DEV_T_TYPE		__U32_TYPE | |
| 30 | #define __UID_T_TYPE		__U32_TYPE | |
| 31 | #define __GID_T_TYPE		__U32_TYPE | |
| 32 | #define __INO_T_TYPE		__ULONGWORD_TYPE | |
| 33 | #define __INO64_T_TYPE		__UQUAD_TYPE | |
| 34 | #define __MODE_T_TYPE		__U32_TYPE | |
| 35 | #define __NLINK_T_TYPE		__UWORD_TYPE | |
| 36 | #define __OFF_T_TYPE		__SLONGWORD_TYPE | |
| 37 | #define __OFF64_T_TYPE		__SQUAD_TYPE | |
| 38 | #define __PID_T_TYPE		__S32_TYPE | |
| 39 | #define __RLIM_T_TYPE		__ULONGWORD_TYPE | |
| 40 | #define __RLIM64_T_TYPE		__UQUAD_TYPE | |
| 41 | #define	__BLKCNT_T_TYPE		__SLONGWORD_TYPE | |
| 42 | #define	__BLKCNT64_T_TYPE	__SQUAD_TYPE | |
| 43 | #define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE | |
| 44 | #define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE | |
| 45 | #define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE | |
| 46 | #define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE | |
| 47 | #define	__FSWORD_T_TYPE		__SWORD_TYPE | |
| 48 | #define	__ID_T_TYPE		__U32_TYPE | |
| 49 | #define __CLOCK_T_TYPE		__SLONGWORD_TYPE | |
| 50 | #define __TIME_T_TYPE		__SLONGWORD_TYPE | |
| 51 | #define __USECONDS_T_TYPE	__U32_TYPE | |
| 52 | #define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE | |
| 53 | #define __DADDR_T_TYPE		__S32_TYPE | |
| 54 | #define __KEY_T_TYPE		__S32_TYPE | |
| 55 | #define __CLOCKID_T_TYPE	__S32_TYPE | |
| 56 | #define __TIMER_T_TYPE		__S32_TYPE | |
| 57 | #define __BLKSIZE_T_TYPE	__SLONGWORD_TYPE | |
| 58 | #define __FSID_T_TYPE		__UQUAD_TYPE | |
| 59 | #define __SSIZE_T_TYPE		__SWORD_TYPE | |
| 60 | #define __SYSCALL_SLONG_TYPE	__SLONGWORD_TYPE | |
| 61 | #define __SYSCALL_ULONG_TYPE	__ULONGWORD_TYPE | |
| 62 | #define __CPU_MASK_TYPE 	__ULONGWORD_TYPE | |
| 63 | ||
| 64 | /* Number of descriptors that can fit in an `fd_set'. */ | |
| 65 | #define	__FD_SETSIZE		256 | |
| 66 | ||
| 67 | /* Tell the libc code that fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and | |
| 68 | fsfilcnt64_t are not the same type for all ABI purposes. */ | |
| 69 | # define __STATFS_MATCHES_STATFS64 0 | |
| 70 | ||
| 71 | ||
| 72 | #endif /* bits/typesizes.h */ |
lib/libc/glibc/sysdeps/mach/hurd/dl-sysdep.h deleted-31| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | /* System-specific settings for dynamic linker code. Hurd version. | |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* The private errno doesn't make sense on the Hurd. errno is always the | |
| 20 | thread-local slot shared with libc, and it matters to share the cell | |
| 21 | with libc because after startup we use libc functions that set errno | |
| 22 | (open, mmap, etc). */ | |
| 23 | ||
| 24 | #define RTLD_PRIVATE_ERRNO 0 | |
| 25 | ||
| 26 | #ifdef SHARED | |
| 27 | /* _dl_argv and __libc_stack_end cannot be attribute_relro, because the stack-switching | |
| 28 | libc initializer for using cthreads might write into it. */ | |
| 29 | # define DL_ARGV_NOT_RELRO 1 | |
| 30 | # define LIBC_STACK_END_NOT_RELRO 1 | |
| 31 | #endif |
lib/libc/glibc/sysdeps/mach/hurd/kernel-features.h deleted-21| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | /* Set flags signalling availability of certain operating system features. | |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* This file can define __ASSUME_* macros checked by certain source files. | |
| 20 | Almost none of these are used outside of sysdeps/unix/sysv/linux code. | |
| 21 | But those referring to POSIX-level features like O_* flags can be. */ |
lib/libc/glibc/sysdeps/mach/i386/sysdep.h+1-11| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 2 | 2 | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| ... | ... | @@ -39,16 +39,6 @@ |
| 39 | 39 | envp = p;							 \ |
| 40 | 40 | } while (0) |
| 41 | 41 | |
| 42 | #define CALL_WITH_SP(fn, info, sp) \ | |
| 43 | do {									 \ | |
| 44 | 	void **ptr = (void **) sp;					 \ | |
| 45 | 	*--(__typeof (info) *) ptr = info;				 \ | |
| 46 | 	ptr[-1] = ptr;							 \ | |
| 47 | 	--ptr;								 \ | |
| 48 | asm volatile ("movl %0, %%esp; call %1" : : 			 \ | |
| 49 | 		 "g" (ptr), "m" (*(long int *) (fn)) : "%esp"); 	 \ | |
| 50 | } while (0) | |
| 51 | ||
| 52 | 42 | #define RETURN_TO(sp, pc, retval) \ |
| 53 | 43 | asm volatile ("movl %0, %%esp; jmp %*%1 # %2" \ |
| 54 | 44 | 		: : "g" (sp), "r" (pc), "a" (retval)) |
lib/libc/glibc/sysdeps/mach/libc-lock.h+11-14| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* libc-internal interface for mutex locks. Mach cthreads version. |
| 2 | Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -24,9 +24,6 @@ |
| 24 | 24 | #include <tls.h> |
| 25 | 25 | #include <lowlevellock.h> |
| 26 | 26 | |
| 27 | /* The locking here is very inexpensive, even for inlining. */ | |
| 28 | #define _IO_lock_inexpensive 1 | |
| 29 | ||
| 30 | 27 | typedef unsigned int __libc_lock_t; |
| 31 | 28 | typedef struct |
| 32 | 29 | { |
| ... | ... | @@ -57,13 +54,13 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t; |
| 57 | 54 | CLASS __libc_lock_t NAME; |
| 58 | 55 | |
| 59 | 56 | /* Define an initialized lock variable NAME with storage class CLASS. */ |
| 60 | #define _LIBC_LOCK_INITIALIZER LLL_INITIALIZER | |
| 57 | #define _LIBC_LOCK_INITIALIZER LLL_LOCK_INITIALIZER | |
| 61 | 58 | #define __libc_lock_define_initialized(CLASS,NAME) \ |
| 62 | CLASS __libc_lock_t NAME = LLL_INITIALIZER; | |
| 59 | CLASS __libc_lock_t NAME = LLL_LOCK_INITIALIZER; | |
| 63 | 60 | |
| 64 | 61 | /* Initialize the named lock variable, leaving it in a consistent, unlocked |
| 65 | 62 | state. */ |
| 66 | #define __libc_lock_init(NAME) (NAME) = LLL_INITIALIZER | |
| 63 | #define __libc_lock_init(NAME) (NAME) = LLL_LOCK_INITIALIZER | |
| 67 | 64 | |
| 68 | 65 | /* Finalize the named lock variable, which must be locked. It cannot be |
| 69 | 66 | used again until __libc_lock_init is called again on it. This must be |
| ... | ... | @@ -74,19 +71,19 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t; |
| 74 | 71 | |
| 75 | 72 | /* Lock the named lock variable. */ |
| 76 | 73 | #define __libc_lock_lock(NAME) \ |
| 77 | ({ lll_lock (&(NAME), 0); 0; }) | |
| 74 | ({ lll_lock ((NAME), 0); 0; }) | |
| 78 | 75 | |
| 79 | 76 | /* Lock the named lock variable. */ |
| 80 | #define __libc_lock_trylock(NAME) lll_trylock (&(NAME)) | |
| 77 | #define __libc_lock_trylock(NAME) lll_trylock (NAME) | |
| 81 | 78 | |
| 82 | 79 | /* Unlock the named lock variable. */ |
| 83 | 80 | #define __libc_lock_unlock(NAME) \ |
| 84 | ({ lll_unlock (&(NAME), 0); 0; }) | |
| 81 | ({ lll_unlock ((NAME), 0); 0; }) | |
| 85 | 82 | |
| 86 | 83 | #define __libc_lock_define_recursive(CLASS,NAME) \ |
| 87 | 84 | CLASS __libc_lock_recursive_t NAME; |
| 88 | 85 | |
| 89 | #define _LIBC_LOCK_RECURSIVE_INITIALIZER { LLL_INITIALIZER, 0, 0 } | |
| 86 | #define _LIBC_LOCK_RECURSIVE_INITIALIZER { LLL_LOCK_INITIALIZER, 0, 0 } | |
| 90 | 87 | |
| 91 | 88 | #define __libc_lock_define_initialized_recursive(CLASS,NAME) \ |
| 92 | 89 | CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER; |
| ... | ... | @@ -111,7 +108,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t; |
| 111 | 108 | int __r = 0; \ |
| 112 | 109 | if (__self == __lock->owner) \ |
| 113 | 110 | ++__lock->cnt; \ |
| 114 | else if ((__r = lll_trylock (&__lock->lock)) == 0) \ | |
| 111 | else if ((__r = lll_trylock (__lock->lock)) == 0) \ | |
| 115 | 112 | __lock->owner = __self, __lock->cnt = 1; \ |
| 116 | 113 | __r; \ |
| 117 | 114 | }) |
| ... | ... | @@ -122,7 +119,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t; |
| 122 | 119 | void *__self = __libc_lock_owner_self (); \ |
| 123 | 120 | if (__self != __lock->owner) \ |
| 124 | 121 | { \ |
| 125 | lll_lock (&__lock->lock, 0); \ | |
| 122 | lll_lock (__lock->lock, 0); \ | |
| 126 | 123 | __lock->owner = __self; \ |
| 127 | 124 | } \ |
| 128 | 125 | ++__lock->cnt; \ |
| ... | ... | @@ -135,7 +132,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t; |
| 135 | 132 | if (--__lock->cnt == 0) \ |
| 136 | 133 | { \ |
| 137 | 134 | __lock->owner = 0; \ |
| 138 | lll_unlock (&__lock->lock, 0); \ | |
| 135 | lll_unlock (__lock->lock, 0); \ | |
| 139 | 136 | } \ |
| 140 | 137 | }) |
| 141 | 138 |
lib/libc/glibc/sysdeps/mach/sysdep.h+1-9| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1994-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1994-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -62,14 +62,6 @@ |
| 62 | 62 | #error SNARF_ARGS not defined by sysdeps/mach/MACHINE/sysdep.h |
| 63 | 63 | #endif |
| 64 | 64 | |
| 65 | /* Call the C function FN with no arguments, | |
| 66 | on a stack starting at SP (as returned by *_cthread_init_routine). | |
| 67 | You don't need to deal with FN returning; it shouldn't. */ | |
| 68 | #ifndef	CALL_WITH_SP | |
| 69 | #define CALL_WITH_SP(fn, sp) | |
| 70 | #error CALL_WITH_SP not defined by sysdeps/mach/MACHINE/sysdep.h | |
| 71 | #endif | |
| 72 | ||
| 73 | 65 | /* LOSE can be defined as the `halt' instruction or something |
| 74 | 66 | similar which will cause the process to die in a characteristic |
| 75 | 67 | way suggesting a bug. */ |
lib/libc/glibc/sysdeps/microblaze/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for MicroBlaze. |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/microblaze/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for MicroBlaze. |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h deleted-72| ... | ... | @@ -1,72 +0,0 @@ |
| 1 | /* Copyright (C) 2002-2019 Free Software Foundation, Inc. | |
| 2 | ||
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_PTHREADTYPES_ARCH_H | |
| 20 | # define _BITS_PTHREADTYPES_ARCH_H	1 | |
| 21 | ||
| 22 | # include <endian.h> | |
| 23 | ||
| 24 | # define __SIZEOF_PTHREAD_ATTR_T 36 | |
| 25 | # define __SIZEOF_PTHREAD_MUTEX_T 24 | |
| 26 | # define __SIZEOF_PTHREAD_MUTEXATTR_T 4 | |
| 27 | # define __SIZEOF_PTHREAD_COND_T 48 | |
| 28 | # define __SIZEOF_PTHREAD_CONDATTR_T 4 | |
| 29 | # define __SIZEOF_PTHREAD_RWLOCK_T 32 | |
| 30 | # define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 | |
| 31 | # define __SIZEOF_PTHREAD_BARRIER_T 20 | |
| 32 | # define __SIZEOF_PTHREAD_BARRIERATTR_T 4 | |
| 33 | ||
| 34 | /* Definitions for internal mutex struct. */ | |
| 35 | #define __PTHREAD_COMPAT_PADDING_MID | |
| 36 | #define __PTHREAD_COMPAT_PADDING_END | |
| 37 | #define __PTHREAD_MUTEX_LOCK_ELISION 0 | |
| 38 | #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1 | |
| 39 | #define __PTHREAD_MUTEX_USE_UNION 1 | |
| 40 | ||
| 41 | #define __LOCK_ALIGNMENT | |
| 42 | #define __ONCE_ALIGNMENT | |
| 43 | ||
| 44 | struct __pthread_rwlock_arch_t | |
| 45 | { | |
| 46 | unsigned int __readers; | |
| 47 | unsigned int __writers; | |
| 48 | unsigned int __wrphase_futex; | |
| 49 | unsigned int __writers_futex; | |
| 50 | unsigned int __pad3; | |
| 51 | unsigned int __pad4; | |
| 52 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 53 | unsigned char __pad1; | |
| 54 | unsigned char __pad2; | |
| 55 | unsigned char __shared; | |
| 56 | /* FLAGS must stay at this position in the structure to maintain | |
| 57 | binary compatibility. */ | |
| 58 | unsigned char __flags; | |
| 59 | # else | |
| 60 | /* FLAGS must stay at this position in the structure to maintain | |
| 61 | binary compatibility. */ | |
| 62 | unsigned char __flags; | |
| 63 | unsigned char __shared; | |
| 64 | unsigned char __pad1; | |
| 65 | unsigned char __pad2; | |
| 66 | # endif | |
| 67 | int __cur_writer; | |
| 68 | }; | |
| 69 | ||
| 70 | # define __PTHREAD_RWLOCK_ELISION_EXTRA 0 | |
| 71 | ||
| 72 | #endif	/* bits/pthreadtypes.h. */ |
lib/libc/glibc/sysdeps/microblaze/start.S+5-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 2 | 2 | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| ... | ... | @@ -63,14 +63,14 @@ _start: |
| 63 | 63 | mfs r20,rpc |
| 64 | 64 | addik r20,r20,_GLOBAL_OFFSET_TABLE_+8 |
| 65 | 65 | lwi r5,r20,main@GOT |
| 66 | lwi r8,r20,__libc_csu_init@GOT | |
| 67 | lwi r9,r20,__libc_csu_fini@GOT | |
| 66 | addk r8,r0,r0		/* Used to be init. */ | |
| 67 | addk r9,r0,r0		/* Used to be fini. */ | |
| 68 | 68 | brid __libc_start_main@PLT |
| 69 | 69 | addk r10,r0,r0 |
| 70 | 70 | #else |
| 71 | 71 | addik r5,r0,main |
| 72 | addik r8,r0,__libc_csu_init | |
| 73 | addik r9,r0,__libc_csu_fini | |
| 72 | addk r8,r0,r0		/* Used to be init. */ | |
| 73 | addk r9,r0,r0		/* Used to be fini. */ | |
| 74 | 74 | brid __libc_start_main |
| 75 | 75 | addk r10,r0,r0 |
| 76 | 76 | #endif |
lib/libc/glibc/sysdeps/microblaze/sysdep.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | 2 | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 |
lib/libc/glibc/sysdeps/mips/dl-dtprocnum.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Configuration of lookup functions. MIPS version. |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/mips/mips32/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for MIPS (o32). |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/mips/mips32/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for MIPS (o32). |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/mips/mips64/n32/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for MIPS (n32). |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/mips/mips64/n32/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for MIPS (n32). |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/mips/mips64/n64/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for MIPS (n64). |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/mips/mips64/n64/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for MIPS (n64). |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/mips/nptl/bits/pthreadtypes-arch.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Machine-specific pthread type layouts. MIPS version. |
| 2 | Copyright (C) 2005-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/mips/start.S+8-12| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Startup code compliant to the ELF Mips ABI. |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -96,13 +96,13 @@ ENTRY_POINT: |
| 96 | 96 | # if _MIPS_SIM == _ABIO32 |
| 97 | 97 | 	PTR_SUBIU $29, 32 |
| 98 | 98 | # endif |
| 99 | 	PTR_LA $7, __libc_csu_init		/* init */ | |
| 100 | 	PTR_LA $8, __libc_csu_fini | |
| 99 | 	move $7, $0			/* Used to be init. */ | |
| 101 | 100 | # if _MIPS_SIM == _ABIO32 |
| 102 | 	PTR_S $8, 16($29)		/* fini */ | |
| 101 | 	PTR_S $0, 16($29)		/* Used to be fini. */ | |
| 103 | 102 | 	PTR_S $2, 20($29)		/* rtld_fini */ |
| 104 | 103 | 	PTR_S $29, 24($29)		/* stack_end */ |
| 105 | 104 | # else |
| 105 | 	move $8, $0		/* Used to be fini. */ | |
| 106 | 106 | 	move $9, $2		/* rtld_fini */ |
| 107 | 107 | 	move $10, $29		/* stack_end */ |
| 108 | 108 | # endif |
| ... | ... | @@ -143,19 +143,17 @@ ENTRY_POINT: |
| 143 | 143 | 	/* Lay out last arguments, and call __libc_start_main(). */ |
| 144 | 144 | # ifdef __PIC__ |
| 145 | 145 | 	sw	$7, 24($sp)			/* stack_end */ |
| 146 | 	lw	$4, %got(__libc_csu_fini)($3) | |
| 147 | 	lw	$7, %got(__libc_csu_init)($3)	/* init */ | |
| 148 | 	sw	$4, 16($sp)			/* fini */ | |
| 146 | 	move	$4, $0				/* Used to be ini. */ | |
| 147 | 	sw	$0, 16($sp)			/* Used to be fini. */ | |
| 149 | 148 | 	lw	$4, %got(main)($3)		/* main */ |
| 150 | 149 | 	lw	$3, %call16(__libc_start_main)($3) |
| 151 | 150 | 	sw	$2, 20($sp)			/* rtld_fini */ |
| 152 | 151 | 	move	$25, $3 |
| 153 | 152 | 	jalr	$3 |
| 154 | 153 | # else |
| 155 | 	lw	$4, 1f | |
| 156 | 154 | 	sw	$7, 24($sp)			/* stack_end */ |
| 157 | 	lw	$7, 2f				/* init */ | |
| 158 | 	sw	$4, 16($sp)			/* fini */ | |
| 155 | 	move	$7, $0				/* Used to be init. */ | |
| 156 | 	sw	$0, 16($sp)			/* Used to be fini. */ | |
| 159 | 157 | 	lw	$4, 3f				/* main */ |
| 160 | 158 | 	sw	$2, 20($sp)			/* rtld_fini */ |
| 161 | 159 | 	/* Load and call __libc_start_main(). */ |
| ... | ... | @@ -165,8 +163,6 @@ ENTRY_POINT: |
| 165 | 163 | hlt:	b	hlt		/* Crash if somehow it does return. */ |
| 166 | 164 | # ifndef __PIC__ |
| 167 | 165 | 	.align	2 |
| 168 | 1:	.word	__libc_csu_fini | |
| 169 | 2:	.word	__libc_csu_init | |
| 170 | 166 | 3:	.word	main |
| 171 | 167 | 4:	.word	__libc_start_main |
| 172 | 168 | # endif |
lib/libc/glibc/sysdeps/nios2/sysdep.h created+65| ... | ... | @@ -0,0 +1,65 @@ |
| 1 | /* Assembler macros for Nios II. | |
| 2 | Copyright (C) 2015-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <sysdeps/generic/sysdep.h> | |
| 20 | ||
| 21 | #ifdef	__ASSEMBLER__ | |
| 22 | ||
| 23 | /* Syntactic details of assembler. */ | |
| 24 | ||
| 25 | #define ASM_SIZE_DIRECTIVE(name) .size name,.-name | |
| 26 | ||
| 27 | #define ENTRY(name)						 \ | |
| 28 | .globl C_SYMBOL_NAME(name);					 \ | |
| 29 | .type C_SYMBOL_NAME(name),%function;				 \ | |
| 30 | C_LABEL(name)							 \ | |
| 31 | cfi_startproc;						 \ | |
| 32 | CALL_MCOUNT; | |
| 33 | ||
| 34 | #undef END | |
| 35 | #define END(name)				\ | |
| 36 | cfi_endproc;					\ | |
| 37 | ASM_SIZE_DIRECTIVE(name) | |
| 38 | ||
| 39 | #ifdef PROF | |
| 40 | ||
| 41 | # ifdef __PIC__ | |
| 42 | # define CALL_MCOUNT				\ | |
| 43 | mov r8, ra;					\ | |
| 44 | nextpc r2;					\ | |
| 45 | 1:						\ | |
| 46 | movhi r3, %hiadj(_gp_got - 1b);		\ | |
| 47 | addi r3, r3, %lo(_gp_got - 1b);		\ | |
| 48 | add r2, r2, r3;				\ | |
| 49 | ldw r2, %call(_mcount)(r2);			\ | |
| 50 | callr r2;					\ | |
| 51 | mov ra, r8;					\ | |
| 52 | ret; | |
| 53 | # else | |
| 54 | # define CALL_MCOUNT				\ | |
| 55 | mov r8, ra;					\ | |
| 56 | call _mount;					\ | |
| 57 | mov ra, r8;					\ | |
| 58 | ret; | |
| 59 | # endif | |
| 60 | ||
| 61 | #else | |
| 62 | # define CALL_MCOUNT		/* Do nothing. */ | |
| 63 | #endif | |
| 64 | ||
| 65 | #endif	/* __ASSEMBLER__ */ |
lib/libc/glibc/sysdeps/nptl/bits/pthreadtypes.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Declaration of common pthread types for all architectures. |
| 2 | Copyright (C) 2017-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/nptl/bits/thread-shared-types.h+11-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Common threading primitives definitions for both POSIX and C11. |
| 2 | Copyright (C) 2017-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -116,4 +116,14 @@ struct __pthread_cond_s |
| 116 | 116 | unsigned int __g_signals[2]; |
| 117 | 117 | }; |
| 118 | 118 | |
| 119 | typedef unsigned int __tss_t; | |
| 120 | typedef unsigned long int __thrd_t; | |
| 121 | ||
| 122 | typedef struct | |
| 123 | { | |
| 124 | int __data __ONCE_ALIGNMENT; | |
| 125 | } __once_flag; | |
| 126 | ||
| 127 | #define __ONCE_FLAG_INIT { 0 } | |
| 128 | ||
| 119 | 129 | #endif /* _THREAD_SHARED_TYPES_H */ |
lib/libc/glibc/sysdeps/nptl/libc-lock.h+31-30| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* libc-internal interface for mutex locks. NPTL version. |
| 2 | Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -143,39 +143,40 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t; |
| 143 | 143 | __libc_maybe_call (__pthread_mutex_unlock, (&(NAME).mutex), 0) |
| 144 | 144 | #endif |
| 145 | 145 | |
| 146 | /* Note that for I/O cleanup handling we are using the old-style | |
| 147 | cancel handling. It does not have to be integrated with C++ since | |
| 148 | no C++ code is called in the middle. The old-style handling is | |
| 149 | faster and the support is not going away. */ | |
| 150 | extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer, | |
| 151 | 					 void (*routine) (void *), void *arg); | |
| 152 | extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer, | |
| 153 | 					 int execute); | |
| 146 | /* Put the unwind buffer BUFFER on the per-thread callback stack. The | |
| 147 | caller must fill BUFFER->__routine and BUFFER->__arg before calling | |
| 148 | this function. */ | |
| 149 | void __libc_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer); | |
| 150 | libc_hidden_proto (__libc_cleanup_push_defer) | |
| 151 | /* Remove BUFFER from the unwind callback stack. The caller must invoke | |
| 152 | the callback if desired. */ | |
| 153 | void __libc_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer); | |
| 154 | libc_hidden_proto (__libc_cleanup_pop_restore) | |
| 154 | 155 | |
| 155 | 156 | /* Start critical region with cleanup. */ |
| 156 | #define __libc_cleanup_region_start(DOIT, FCT, ARG) \ | |
| 157 | { struct _pthread_cleanup_buffer _buffer;				 \ | |
| 158 | int _avail;								 \ | |
| 159 | if (DOIT) {								 \ | |
| 160 | _avail = PTFAVAIL (_pthread_cleanup_push_defer);			 \ | |
| 161 | if (_avail) {							 \ | |
| 162 | 	__libc_ptf_call_always (_pthread_cleanup_push_defer, (&_buffer, FCT, \ | |
| 163 | 							 ARG));	 \ | |
| 164 | } else {								 \ | |
| 165 | 	_buffer.__routine = (FCT);					 \ | |
| 166 | 	_buffer.__arg = (ARG);						 \ | |
| 167 | }									 \ | |
| 168 | } else {								 \ | |
| 169 | _avail = 0;							 \ | |
| 170 | } | |
| 157 | #define __libc_cleanup_region_start(DOIT, FCT, ARG)			\ | |
| 158 | { bool _cleanup_start_doit;						\ | |
| 159 | struct _pthread_cleanup_buffer _buffer;				\ | |
| 160 | /* Non-addressable copy of FCT, so that we avoid indirect calls on	\ | |
| 161 | the non-unwinding path. */					\ | |
| 162 | void (*_cleanup_routine) (void *) = (FCT);				\ | |
| 163 | _buffer.__arg = (ARG);						\ | |
| 164 | if (DOIT)								\ | |
| 165 | {									\ | |
| 166 | _cleanup_start_doit = true;					\ | |
| 167 | _buffer.__routine = _cleanup_routine;				\ | |
| 168 | __libc_cleanup_push_defer (&_buffer);				\ | |
| 169 | }									\ | |
| 170 | else									\ | |
| 171 | _cleanup_start_doit = false; | |
| 171 | 172 | |
| 172 | 173 | /* End critical region with cleanup. */ |
| 173 | #define __libc_cleanup_region_end(DOIT) \ | |
| 174 | if (_avail) {							 \ | |
| 175 | __libc_ptf_call_always (_pthread_cleanup_pop_restore, (&_buffer, DOIT));\ | |
| 176 | } else if (DOIT)							 \ | |
| 177 | _buffer.__routine (_buffer.__arg);				 \ | |
| 178 | } | |
| 174 | #define __libc_cleanup_region_end(DOIT)		\ | |
| 175 | if (_cleanup_start_doit)			\ | |
| 176 | __libc_cleanup_pop_restore (&_buffer);	\ | |
| 177 | if (DOIT)					\ | |
| 178 | _cleanup_routine (_buffer.__arg);		\ | |
| 179 | } /* matches __libc_cleanup_region_start */ | |
| 179 | 180 | |
| 180 | 181 | |
| 181 | 182 | /* Hide the definitions which are only supposed to be used inside libc in |
lib/libc/glibc/sysdeps/nptl/libc-lockP.h+49-224| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Private libc-internal interface for mutex locks. NPTL version. |
| 2 | Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -32,26 +32,12 @@ |
| 32 | 32 | ld.so might be used on old kernels with a different libc.so. */ |
| 33 | 33 | #include <lowlevellock.h> |
| 34 | 34 | #include <tls.h> |
| 35 | #include <pthread-functions.h> | |
| 36 | ||
| 37 | #if IS_IN (libpthread) | |
| 38 | /* This gets us the declarations of the __pthread_* internal names, | |
| 39 | and hidden_proto for them. */ | |
| 40 | # include <nptl/pthreadP.h> | |
| 41 | #endif | |
| 42 | 35 | |
| 43 | 36 | /* Mutex type. */ |
| 44 | #if !IS_IN (libc) && !IS_IN (libpthread) | |
| 45 | typedef pthread_mutex_t __libc_lock_t; | |
| 46 | #else | |
| 47 | 37 | typedef int __libc_lock_t; |
| 48 | #endif | |
| 49 | 38 | typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t; |
| 50 | 39 | typedef pthread_rwlock_t __libc_rwlock_t; |
| 51 | 40 | |
| 52 | /* Type for key to thread-specific data. */ | |
| 53 | typedef pthread_key_t __libc_key_t; | |
| 54 | ||
| 55 | 41 | /* Define a lock variable NAME with storage class CLASS. The lock must be |
| 56 | 42 | initialized with __libc_lock_init before it can be used (or define it |
| 57 | 43 | with __libc_lock_define_initialized, below). Use `extern' for CLASS to |
| ... | ... | @@ -103,126 +89,48 @@ _Static_assert (LLL_LOCK_INITIALIZER == 0, "LLL_LOCK_INITIALIZER != 0"); |
| 103 | 89 | (FUNC != NULL ? FUNC ARGS : ELSE) |
| 104 | 90 | #endif |
| 105 | 91 | |
| 106 | /* Call thread functions through the function pointer table. */ | |
| 107 | #if defined SHARED && IS_IN (libc) | |
| 108 | # define PTFAVAIL(NAME) __libc_pthread_functions_init | |
| 109 | # define __libc_ptf_call(FUNC, ARGS, ELSE) \ | |
| 110 | (__libc_pthread_functions_init ? PTHFCT_CALL (ptr_##FUNC, ARGS) : ELSE) | |
| 111 | # define __libc_ptf_call_always(FUNC, ARGS) \ | |
| 112 | PTHFCT_CALL (ptr_##FUNC, ARGS) | |
| 113 | #elif IS_IN (libpthread) | |
| 114 | # define PTFAVAIL(NAME) 1 | |
| 115 | # define __libc_ptf_call(FUNC, ARGS, ELSE) \ | |
| 116 | FUNC ARGS | |
| 117 | # define __libc_ptf_call_always(FUNC, ARGS) \ | |
| 118 | FUNC ARGS | |
| 119 | #else | |
| 120 | # define PTFAVAIL(NAME) (NAME != NULL) | |
| 121 | # define __libc_ptf_call(FUNC, ARGS, ELSE) \ | |
| 122 | __libc_maybe_call (FUNC, ARGS, ELSE) | |
| 123 | # define __libc_ptf_call_always(FUNC, ARGS) \ | |
| 124 | FUNC ARGS | |
| 125 | #endif | |
| 126 | ||
| 92 | /* All previously forwarded functions are now called directly (either | |
| 93 | via local call in libc, or through a __export), but __libc_ptf_call | |
| 94 | is still used in generic code shared with Hurd. */ | |
| 95 | #define PTFAVAIL(NAME) 1 | |
| 96 | #define __libc_ptf_call(FUNC, ARGS, ELSE) FUNC ARGS | |
| 97 | #define __libc_ptf_call_always(FUNC, ARGS) FUNC ARGS | |
| 127 | 98 | |
| 128 | 99 | /* Initialize the named lock variable, leaving it in a consistent, unlocked |
| 129 | 100 | state. */ |
| 130 | #if IS_IN (libc) || IS_IN (libpthread) | |
| 131 | # define __libc_lock_init(NAME) \ | |
| 132 | ((void) ((NAME) = LLL_LOCK_INITIALIZER)) | |
| 133 | #else | |
| 134 | # define __libc_lock_init(NAME) \ | |
| 135 | __libc_maybe_call (__pthread_mutex_init, (&(NAME), NULL), 0) | |
| 136 | #endif | |
| 137 | #if defined SHARED && IS_IN (libc) | |
| 138 | /* ((NAME) = (__libc_rwlock_t) PTHREAD_RWLOCK_INITIALIZER) is inefficient. */ | |
| 139 | # define __libc_rwlock_init(NAME) \ | |
| 140 | ((void) __builtin_memset (&(NAME), '\0', sizeof (NAME))) | |
| 141 | #else | |
| 142 | # define __libc_rwlock_init(NAME) \ | |
| 143 | __libc_maybe_call (__pthread_rwlock_init, (&(NAME), NULL), 0) | |
| 144 | #endif | |
| 101 | #define __libc_lock_init(NAME) ((void) ((NAME) = LLL_LOCK_INITIALIZER)) | |
| 102 | #define __libc_rwlock_init(NAME) __pthread_rwlock_init (&(NAME), NULL) | |
| 145 | 103 | |
| 146 | 104 | /* Finalize the named lock variable, which must be locked. It cannot be |
| 147 | 105 | used again until __libc_lock_init is called again on it. This must be |
| 148 | 106 | called on a lock variable before the containing storage is reused. */ |
| 149 | #if IS_IN (libc) || IS_IN (libpthread) | |
| 150 | # define __libc_lock_fini(NAME) ((void) 0) | |
| 151 | #else | |
| 152 | # define __libc_lock_fini(NAME) \ | |
| 153 | __libc_maybe_call (__pthread_mutex_destroy, (&(NAME)), 0) | |
| 154 | #endif | |
| 155 | #if defined SHARED && IS_IN (libc) | |
| 156 | # define __libc_rwlock_fini(NAME) ((void) 0) | |
| 157 | #else | |
| 158 | # define __libc_rwlock_fini(NAME) \ | |
| 159 | __libc_maybe_call (__pthread_rwlock_destroy, (&(NAME)), 0) | |
| 160 | #endif | |
| 107 | #define __libc_lock_fini(NAME) ((void) 0) | |
| 108 | #define __libc_rwlock_fini(NAME) ((void) 0) | |
| 161 | 109 | |
| 162 | 110 | /* Lock the named lock variable. */ |
| 163 | #if IS_IN (libc) || IS_IN (libpthread) | |
| 164 | # ifndef __libc_lock_lock | |
| 165 | # define __libc_lock_lock(NAME) \ | |
| 166 | ({ lll_lock (NAME, LLL_PRIVATE); 0; }) | |
| 167 | # endif | |
| 168 | #else | |
| 169 | # undef __libc_lock_lock | |
| 170 | # define __libc_lock_lock(NAME) \ | |
| 171 | __libc_maybe_call (__pthread_mutex_lock, (&(NAME)), 0) | |
| 172 | #endif | |
| 173 | #define __libc_rwlock_rdlock(NAME) \ | |
| 174 | __libc_ptf_call (__pthread_rwlock_rdlock, (&(NAME)), 0) | |
| 175 | #define __libc_rwlock_wrlock(NAME) \ | |
| 176 | __libc_ptf_call (__pthread_rwlock_wrlock, (&(NAME)), 0) | |
| 111 | #define __libc_lock_lock(NAME) ({ lll_lock (NAME, LLL_PRIVATE); 0; }) | |
| 112 | #define __libc_rwlock_rdlock(NAME) __pthread_rwlock_rdlock (&(NAME)) | |
| 113 | #define __libc_rwlock_wrlock(NAME) __pthread_rwlock_wrlock (&(NAME)) | |
| 177 | 114 | |
| 178 | 115 | /* Try to lock the named lock variable. */ |
| 179 | #if IS_IN (libc) || IS_IN (libpthread) | |
| 180 | # ifndef __libc_lock_trylock | |
| 181 | # define __libc_lock_trylock(NAME) \ | |
| 182 | lll_trylock (NAME) | |
| 183 | # endif | |
| 184 | #else | |
| 185 | # undef __libc_lock_trylock | |
| 186 | # define __libc_lock_trylock(NAME) \ | |
| 187 | __libc_maybe_call (__pthread_mutex_trylock, (&(NAME)), 0) | |
| 188 | #endif | |
| 189 | #define __libc_rwlock_tryrdlock(NAME) \ | |
| 190 | __libc_maybe_call (__pthread_rwlock_tryrdlock, (&(NAME)), 0) | |
| 191 | #define __libc_rwlock_trywrlock(NAME) \ | |
| 192 | __libc_maybe_call (__pthread_rwlock_trywrlock, (&(NAME)), 0) | |
| 193 | ||
| 194 | #define __rtld_lock_trylock_recursive(NAME) \ | |
| 195 | __libc_maybe_call (__pthread_mutex_trylock, (&(NAME).mutex), 0) | |
| 116 | #define __libc_lock_trylock(NAME) lll_trylock (NAME) | |
| 196 | 117 | |
| 197 | 118 | /* Unlock the named lock variable. */ |
| 198 | #if IS_IN (libc) || IS_IN (libpthread) | |
| 199 | # define __libc_lock_unlock(NAME) \ | |
| 200 | lll_unlock (NAME, LLL_PRIVATE) | |
| 201 | #else | |
| 202 | # define __libc_lock_unlock(NAME) \ | |
| 203 | __libc_maybe_call (__pthread_mutex_unlock, (&(NAME)), 0) | |
| 204 | #endif | |
| 205 | #define __libc_rwlock_unlock(NAME) \ | |
| 206 | __libc_ptf_call (__pthread_rwlock_unlock, (&(NAME)), 0) | |
| 207 | ||
| 208 | #ifdef SHARED | |
| 209 | # define __rtld_lock_default_lock_recursive(lock) \ | |
| 210 | ++((pthread_mutex_t *)(lock))->__data.__count; | |
| 211 | ||
| 212 | # define __rtld_lock_default_unlock_recursive(lock) \ | |
| 213 | --((pthread_mutex_t *)(lock))->__data.__count; | |
| 119 | #define __libc_lock_unlock(NAME) lll_unlock (NAME, LLL_PRIVATE) | |
| 120 | #define __libc_rwlock_unlock(NAME) __pthread_rwlock_unlock (&(NAME)) | |
| 214 | 121 | |
| 122 | #if IS_IN (rtld) | |
| 215 | 123 | # define __rtld_lock_lock_recursive(NAME) \ |
| 216 | GL(dl_rtld_lock_recursive) (&(NAME).mutex) | |
| 124 | ___rtld_mutex_lock (&(NAME).mutex) | |
| 217 | 125 | |
| 218 | 126 | # define __rtld_lock_unlock_recursive(NAME) \ |
| 219 | GL(dl_rtld_unlock_recursive) (&(NAME).mutex) | |
| 220 | #else | |
| 127 | ___rtld_mutex_unlock (&(NAME).mutex) | |
| 128 | #else /* Not in the dynamic loader. */ | |
| 221 | 129 | # define __rtld_lock_lock_recursive(NAME) \ |
| 222 | __libc_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0) | |
| 130 | __pthread_mutex_lock (&(NAME).mutex) | |
| 223 | 131 | |
| 224 | 132 | # define __rtld_lock_unlock_recursive(NAME) \ |
| 225 | __libc_maybe_call (__pthread_mutex_unlock, (&(NAME).mutex), 0) | |
| 133 | __pthread_mutex_unlock (&(NAME).mutex) | |
| 226 | 134 | #endif |
| 227 | 135 | |
| 228 | 136 | /* Define once control variable. */ |
| ... | ... | @@ -236,74 +144,42 @@ _Static_assert (LLL_LOCK_INITIALIZER == 0, "LLL_LOCK_INITIALIZER != 0"); |
| 236 | 144 | CLASS pthread_once_t NAME = PTHREAD_ONCE_INIT |
| 237 | 145 | #endif |
| 238 | 146 | |
| 239 | /* Call handler iff the first call. */ | |
| 240 | #define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \ | |
| 241 | do {									 \ | |
| 242 | if (PTFAVAIL (__pthread_once))					 \ | |
| 243 | __libc_ptf_call_always (__pthread_once, (&(ONCE_CONTROL),		 \ | |
| 244 | 					 INIT_FUNCTION));		 \ | |
| 245 | else if ((ONCE_CONTROL) == PTHREAD_ONCE_INIT) {			 \ | |
| 246 | INIT_FUNCTION ();							 \ | |
| 247 | (ONCE_CONTROL) |= 2;						 \ | |
| 248 | }									 \ | |
| 249 | } while (0) | |
| 147 | /* Call handler iff the first call. Use a local call in libc, but the | |
| 148 | global pthread_once symbol elsewhere. */ | |
| 149 | #if IS_IN (libc) | |
| 150 | # define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \ | |
| 151 | __pthread_once (&(ONCE_CONTROL), INIT_FUNCTION) | |
| 152 | #else | |
| 153 | # define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \ | |
| 154 | pthread_once (&(ONCE_CONTROL), INIT_FUNCTION) | |
| 155 | #endif | |
| 250 | 156 | |
| 251 | 157 | /* Get once control variable. */ |
| 252 | 158 | #define __libc_once_get(ONCE_CONTROL)	((ONCE_CONTROL) != PTHREAD_ONCE_INIT) |
| 253 | 159 | |
| 254 | /* Note that for I/O cleanup handling we are using the old-style | |
| 255 | cancel handling. It does not have to be integrated with C++ snce | |
| 256 | no C++ code is called in the middle. The old-style handling is | |
| 257 | faster and the support is not going away. */ | |
| 258 | extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer, | |
| 259 | 				 void (*routine) (void *), void *arg); | |
| 260 | extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *buffer, | |
| 261 | 				 int execute); | |
| 262 | extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer, | |
| 263 | 					 void (*routine) (void *), void *arg); | |
| 264 | extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer, | |
| 265 | 					 int execute); | |
| 266 | ||
| 267 | /* Sometimes we have to exit the block in the middle. */ | |
| 268 | #define __libc_cleanup_end(DOIT) \ | |
| 269 | if (_avail) {							 \ | |
| 270 | __libc_ptf_call_always (_pthread_cleanup_pop_restore, (&_buffer, DOIT));\ | |
| 271 | } else if (DOIT)							 \ | |
| 272 | _buffer.__routine (_buffer.__arg) | |
| 273 | ||
| 160 | /* __libc_cleanup_push and __libc_cleanup_pop depend on exception | |
| 161 | handling and stack unwinding. */ | |
| 162 | #ifdef __EXCEPTIONS | |
| 274 | 163 | |
| 275 | 164 | /* Normal cleanup handling, based on C cleanup attribute. */ |
| 276 | __extern_inline void | |
| 165 | static __always_inline void | |
| 277 | 166 | __libc_cleanup_routine (struct __pthread_cleanup_frame *f) |
| 278 | 167 | { |
| 279 | 168 | if (f->__do_it) |
| 280 | 169 | f->__cancel_routine (f->__cancel_arg); |
| 281 | 170 | } |
| 282 | 171 | |
| 283 | #define __libc_cleanup_push(fct, arg) \ | |
| 172 | # define __libc_cleanup_push(fct, arg) \ | |
| 284 | 173 | do {									 \ |
| 285 | 174 | struct __pthread_cleanup_frame __clframe				 \ |
| 286 | 175 | __attribute__ ((__cleanup__ (__libc_cleanup_routine)))		 \ |
| 287 | 176 | = { .__cancel_routine = (fct), .__cancel_arg = (arg),		 \ |
| 288 | 177 | 	 .__do_it = 1 }; |
| 289 | 178 | |
| 290 | #define __libc_cleanup_pop(execute) \ | |
| 179 | # define __libc_cleanup_pop(execute) \ | |
| 291 | 180 | __clframe.__do_it = (execute);					 \ |
| 292 | 181 | } while (0) |
| 293 | ||
| 294 | ||
| 295 | /* Create thread-specific key. */ | |
| 296 | #define __libc_key_create(KEY, DESTRUCTOR) \ | |
| 297 | __libc_ptf_call (__pthread_key_create, (KEY, DESTRUCTOR), 1) | |
| 298 | ||
| 299 | /* Get thread-specific data. */ | |
| 300 | #define __libc_getspecific(KEY) \ | |
| 301 | __libc_ptf_call (__pthread_getspecific, (KEY), NULL) | |
| 302 | ||
| 303 | /* Set thread-specific data. */ | |
| 304 | #define __libc_setspecific(KEY, VALUE) \ | |
| 305 | __libc_ptf_call (__pthread_setspecific, (KEY, VALUE), 0) | |
| 306 | ||
| 182 | #endif /* __EXCEPTIONS */ | |
| 307 | 183 | |
| 308 | 184 | /* Register handlers to execute before and after `fork'. Note that the |
| 309 | 185 | last parameter is NULL. The handlers registered by the libc are |
| ... | ... | @@ -318,107 +194,56 @@ extern int __register_atfork (void (*__prepare) (void), |
| 318 | 194 | |
| 319 | 195 | extern int __pthread_mutex_init (pthread_mutex_t *__mutex, |
| 320 | 196 | 				 const pthread_mutexattr_t *__mutex_attr); |
| 321 | ||
| 197 | libc_hidden_proto (__pthread_mutex_init) | |
| 322 | 198 | extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex); |
| 323 | ||
| 199 | libc_hidden_proto (__pthread_mutex_destroy) | |
| 324 | 200 | extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex); |
| 325 | 201 | |
| 326 | 202 | extern int __pthread_mutex_lock (pthread_mutex_t *__mutex); |
| 327 | ||
| 203 | libc_hidden_proto (__pthread_mutex_lock) | |
| 328 | 204 | extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex); |
| 329 | ||
| 330 | extern int __pthread_mutexattr_init (pthread_mutexattr_t *__attr); | |
| 205 | libc_hidden_proto (__pthread_mutex_unlock) | |
| 331 | 206 | |
| 332 | 207 | extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr); |
| 333 | 208 | |
| 334 | extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr, | |
| 335 | 					int __kind); | |
| 336 | ||
| 337 | 209 | extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock, |
| 338 | 210 | 				 const pthread_rwlockattr_t *__attr); |
| 211 | libc_hidden_proto (__pthread_rwlock_init) | |
| 339 | 212 | |
| 340 | 213 | extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock); |
| 341 | 214 | |
| 342 | 215 | extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock); |
| 343 | ||
| 344 | extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock); | |
| 216 | libc_hidden_proto (__pthread_rwlock_rdlock) | |
| 345 | 217 | |
| 346 | 218 | extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock); |
| 347 | ||
| 348 | extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock); | |
| 219 | libc_hidden_proto (__pthread_rwlock_wrlock) | |
| 349 | 220 | |
| 350 | 221 | extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock); |
| 351 | ||
| 352 | extern int __pthread_key_create (pthread_key_t *__key, | |
| 353 | 				 void (*__destr_function) (void *)); | |
| 354 | ||
| 355 | extern int __pthread_setspecific (pthread_key_t __key, | |
| 356 | 				 const void *__pointer); | |
| 357 | ||
| 358 | extern void *__pthread_getspecific (pthread_key_t __key); | |
| 359 | ||
| 222 | libc_hidden_proto (__pthread_rwlock_unlock) | |
| 360 | 223 | extern int __pthread_once (pthread_once_t *__once_control, |
| 361 | 224 | 			 void (*__init_routine) (void)); |
| 225 | libc_hidden_proto (__pthread_once) | |
| 362 | 226 | |
| 363 | 227 | extern int __pthread_atfork (void (*__prepare) (void), |
| 364 | 228 | 			 void (*__parent) (void), |
| 365 | 229 | 			 void (*__child) (void)); |
| 366 | 230 | |
| 367 | 231 | extern int __pthread_setcancelstate (int state, int *oldstate); |
| 368 | ||
| 232 | libc_hidden_proto (__pthread_setcancelstate) | |
| 369 | 233 | |
| 370 | 234 | /* Make the pthread functions weak so that we can elide them from |
| 371 | 235 | single-threaded processes. */ |
| 372 | 236 | #ifndef __NO_WEAK_PTHREAD_ALIASES |
| 373 | 237 | # ifdef weak_extern |
| 374 | weak_extern (__pthread_mutex_init) | |
| 375 | weak_extern (__pthread_mutex_destroy) | |
| 376 | weak_extern (__pthread_mutex_lock) | |
| 377 | 238 | weak_extern (__pthread_mutex_trylock) |
| 378 | weak_extern (__pthread_mutex_unlock) | |
| 379 | weak_extern (__pthread_mutexattr_init) | |
| 380 | 239 | weak_extern (__pthread_mutexattr_destroy) |
| 381 | weak_extern (__pthread_mutexattr_settype) | |
| 382 | weak_extern (__pthread_rwlock_init) | |
| 383 | weak_extern (__pthread_rwlock_destroy) | |
| 384 | weak_extern (__pthread_rwlock_rdlock) | |
| 385 | weak_extern (__pthread_rwlock_tryrdlock) | |
| 386 | weak_extern (__pthread_rwlock_wrlock) | |
| 387 | weak_extern (__pthread_rwlock_trywrlock) | |
| 388 | weak_extern (__pthread_rwlock_unlock) | |
| 389 | weak_extern (__pthread_key_create) | |
| 390 | weak_extern (__pthread_setspecific) | |
| 391 | weak_extern (__pthread_getspecific) | |
| 392 | weak_extern (__pthread_once) | |
| 393 | 240 | weak_extern (__pthread_initialize) |
| 394 | 241 | weak_extern (__pthread_atfork) |
| 395 | weak_extern (__pthread_setcancelstate) | |
| 396 | weak_extern (_pthread_cleanup_push_defer) | |
| 397 | weak_extern (_pthread_cleanup_pop_restore) | |
| 398 | 242 | # else |
| 399 | # pragma weak __pthread_mutex_init | |
| 400 | # pragma weak __pthread_mutex_destroy | |
| 401 | # pragma weak __pthread_mutex_lock | |
| 402 | 243 | # pragma weak __pthread_mutex_trylock |
| 403 | # pragma weak __pthread_mutex_unlock | |
| 404 | # pragma weak __pthread_mutexattr_init | |
| 405 | 244 | # pragma weak __pthread_mutexattr_destroy |
| 406 | # pragma weak __pthread_mutexattr_settype | |
| 407 | # pragma weak __pthread_rwlock_destroy | |
| 408 | # pragma weak __pthread_rwlock_rdlock | |
| 409 | # pragma weak __pthread_rwlock_tryrdlock | |
| 410 | # pragma weak __pthread_rwlock_wrlock | |
| 411 | # pragma weak __pthread_rwlock_trywrlock | |
| 412 | # pragma weak __pthread_rwlock_unlock | |
| 413 | # pragma weak __pthread_key_create | |
| 414 | # pragma weak __pthread_setspecific | |
| 415 | # pragma weak __pthread_getspecific | |
| 416 | # pragma weak __pthread_once | |
| 417 | 245 | # pragma weak __pthread_initialize |
| 418 | 246 | # pragma weak __pthread_atfork |
| 419 | # pragma weak __pthread_setcancelstate | |
| 420 | # pragma weak _pthread_cleanup_push_defer | |
| 421 | # pragma weak _pthread_cleanup_pop_restore | |
| 422 | 247 | # endif |
| 423 | 248 | #endif |
| 424 | 249 |
lib/libc/glibc/sysdeps/nptl/pthread.h+203-28| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -27,7 +27,11 @@ |
| 27 | 27 | #include <bits/setjmp.h> |
| 28 | 28 | #include <bits/wordsize.h> |
| 29 | 29 | #include <bits/types/struct_timespec.h> |
| 30 | ||
| 30 | #include <bits/types/__sigset_t.h> | |
| 31 | #include <bits/types/struct___jmp_buf_tag.h> | |
| 32 | #ifdef __USE_MISC | |
| 33 | # include <bits/pthread_stack_min-dynamic.h> | |
| 34 | #endif | |
| 31 | 35 | |
| 32 | 36 | /* Detach state. */ |
| 33 | 37 | enum |
| ... | ... | @@ -219,6 +223,7 @@ extern int pthread_join (pthread_t __th, void **__thread_return); |
| 219 | 223 | the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */ |
| 220 | 224 | extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW; |
| 221 | 225 | |
| 226 | # ifndef __USE_TIME_BITS64 | |
| 222 | 227 | /* Make calling thread wait for termination of the thread TH, but only |
| 223 | 228 | until TIMEOUT. The exit status of the thread is stored in |
| 224 | 229 | *THREAD_RETURN, if THREAD_RETURN is not NULL. |
| ... | ... | @@ -238,6 +243,23 @@ extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return, |
| 238 | 243 | extern int pthread_clockjoin_np (pthread_t __th, void **__thread_return, |
| 239 | 244 | clockid_t __clockid, |
| 240 | 245 | 				 const struct timespec *__abstime); |
| 246 | # else | |
| 247 | # ifdef __REDIRECT | |
| 248 | extern int __REDIRECT (pthread_timedjoin_np, | |
| 249 | (pthread_t __th, void **__thread_return, | |
| 250 | const struct timespec *__abstime), | |
| 251 | __pthread_timedjoin_np64); | |
| 252 | ||
| 253 | extern int __REDIRECT (pthread_clockjoin_np, | |
| 254 | (pthread_t __th, void **__thread_return, | |
| 255 | clockid_t __clockid, | |
| 256 | const struct timespec *__abstime), | |
| 257 | __pthread_clockjoin_np64); | |
| 258 | # else | |
| 259 | # define pthread_timedjoin_np __pthread_timedjoin_np64 | |
| 260 | # define pthread_clockjoin_np __pthread_clockjoin_np64 | |
| 261 | # endif | |
| 262 | # endif | |
| 241 | 263 | #endif |
| 242 | 264 | |
| 243 | 265 | /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN. |
| ... | ... | @@ -385,6 +407,20 @@ extern int pthread_attr_getaffinity_np (const pthread_attr_t *__attr, |
| 385 | 407 | extern int pthread_getattr_default_np (pthread_attr_t *__attr) |
| 386 | 408 | __THROW __nonnull ((1)); |
| 387 | 409 | |
| 410 | /* Store *SIGMASK as the signal mask for the new thread in *ATTR. */ | |
| 411 | extern int pthread_attr_setsigmask_np (pthread_attr_t *__attr, | |
| 412 | 				 const __sigset_t *sigmask); | |
| 413 | ||
| 414 | /* Store the signal mask of *ATTR in *SIGMASK. If there is no signal | |
| 415 | mask stored, return PTHREAD_ATTR_NOSIGMASK_NP. Return zero on | |
| 416 | success. */ | |
| 417 | extern int pthread_attr_getsigmask_np (const pthread_attr_t *__attr, | |
| 418 | 				 __sigset_t *sigmask); | |
| 419 | ||
| 420 | /* Special return value from pthread_attr_getsigmask_np if the signal | |
| 421 | mask has not been set. */ | |
| 422 | #define PTHREAD_ATTR_NO_SIGMASK_NP (-1) | |
| 423 | ||
| 388 | 424 | /* Set the default attributes to be used by pthread_create in this |
| 389 | 425 | process. */ |
| 390 | 426 | extern int pthread_setattr_default_np (const pthread_attr_t *__attr) |
| ... | ... | @@ -438,11 +474,14 @@ extern int pthread_setconcurrency (int __level) __THROW; |
| 438 | 474 | #endif |
| 439 | 475 | |
| 440 | 476 | #ifdef __USE_GNU |
| 441 | /* Yield the processor to another thread or process. | |
| 442 | This function is similar to the POSIX `sched_yield' function but | |
| 443 | might be differently implemented in the case of a m-on-n thread | |
| 444 | implementation. */ | |
| 445 | 477 | extern int pthread_yield (void) __THROW; |
| 478 | # ifdef __REDIRECT_NTH | |
| 479 | extern int __REDIRECT_NTH (pthread_yield, (void), sched_yield) | |
| 480 | __attribute_deprecated_msg__ ("\ | |
| 481 | pthread_yield is deprecated, use sched_yield instead"); | |
| 482 | # else | |
| 483 | # define pthread_yield sched_yield | |
| 484 | # endif | |
| 446 | 485 | |
| 447 | 486 | |
| 448 | 487 | /* Limit specified thread TH to run only on the processors represented |
| ... | ... | @@ -496,13 +535,15 @@ extern void pthread_testcancel (void); |
| 496 | 535 | |
| 497 | 536 | /* Cancellation handling with integration into exception handling. */ |
| 498 | 537 | |
| 538 | struct __cancel_jmp_buf_tag | |
| 539 | { | |
| 540 | __jmp_buf __cancel_jmp_buf; | |
| 541 | int __mask_was_saved; | |
| 542 | }; | |
| 543 | ||
| 499 | 544 | typedef struct |
| 500 | 545 | { |
| 501 | struct | |
| 502 | { | |
| 503 | __jmp_buf __cancel_jmp_buf; | |
| 504 | int __mask_was_saved; | |
| 505 | } __cancel_jmp_buf[1]; | |
| 546 | struct __cancel_jmp_buf_tag __cancel_jmp_buf[1]; | |
| 506 | 547 | void *__pad[4]; |
| 507 | 548 | } __pthread_unwind_buf_t __attribute__ ((__aligned__)); |
| 508 | 549 | |
| ... | ... | @@ -642,8 +683,8 @@ __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame) |
| 642 | 683 | __pthread_unwind_buf_t __cancel_buf;				 \ |
| 643 | 684 | void (*__cancel_routine) (void *) = (routine);			 \ |
| 644 | 685 | void *__cancel_arg = (arg);						 \ |
| 645 | int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ | |
| 646 | 					__cancel_buf.__cancel_jmp_buf, 0); \ | |
| 686 | int __not_first_call = __sigsetjmp_cancel (__cancel_buf.__cancel_jmp_buf, \ | |
| 687 | 					 0);			 \ | |
| 647 | 688 | if (__glibc_unlikely (__not_first_call))				 \ |
| 648 | 689 | {									 \ |
| 649 | 690 | 	__cancel_routine (__cancel_arg);				 \ |
| ... | ... | @@ -677,8 +718,8 @@ extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf) |
| 677 | 718 | __pthread_unwind_buf_t __cancel_buf;				 \ |
| 678 | 719 | void (*__cancel_routine) (void *) = (routine);			 \ |
| 679 | 720 | void *__cancel_arg = (arg);						 \ |
| 680 | int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ | |
| 681 | 					__cancel_buf.__cancel_jmp_buf, 0); \ | |
| 721 | int __not_first_call = __sigsetjmp_cancel (__cancel_buf.__cancel_jmp_buf, \ | |
| 722 | 					 0);			 \ | |
| 682 | 723 | if (__glibc_unlikely (__not_first_call))				 \ |
| 683 | 724 | {									 \ |
| 684 | 725 | 	__cancel_routine (__cancel_arg);				 \ |
| ... | ... | @@ -714,9 +755,24 @@ extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf) |
| 714 | 755 | ; |
| 715 | 756 | #endif |
| 716 | 757 | |
| 717 | /* Function used in the macros. */ | |
| 718 | struct __jmp_buf_tag; | |
| 719 | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL; | |
| 758 | /* Function used in the macros. Calling __sigsetjmp, with its first | |
| 759 | argument declared as an array, results in a -Wstringop-overflow | |
| 760 | warning from GCC 11 because struct pthread_unwind_buf is smaller | |
| 761 | than jmp_buf. The calls from the macros have __SAVEMASK set to 0, | |
| 762 | so nothing beyond the common prefix is used and this warning is a | |
| 763 | false positive. Use an alias with its first argument declared to | |
| 764 | use the type in the macros if possible to avoid this warning. */ | |
| 765 | #if __GNUC_PREREQ (11, 0) | |
| 766 | extern int __REDIRECT_NTHNL (__sigsetjmp_cancel, | |
| 767 | 			 (struct __cancel_jmp_buf_tag __env[1], | |
| 768 | 			 int __savemask), | |
| 769 | 			 __sigsetjmp) __attribute_returns_twice__; | |
| 770 | #else | |
| 771 | # define __sigsetjmp_cancel(env, savemask) \ | |
| 772 | __sigsetjmp ((struct __jmp_buf_tag *) (void *) (env), (savemask)) | |
| 773 | extern int __sigsetjmp (struct __jmp_buf_tag __env[1], | |
| 774 | 			int __savemask) __THROWNL; | |
| 775 | #endif | |
| 720 | 776 | |
| 721 | 777 | |
| 722 | 778 | /* Mutex handling. */ |
| ... | ... | @@ -740,16 +796,39 @@ extern int pthread_mutex_lock (pthread_mutex_t *__mutex) |
| 740 | 796 | |
| 741 | 797 | #ifdef __USE_XOPEN2K |
| 742 | 798 | /* Wait until lock becomes available, or specified time passes. */ |
| 799 | # ifndef __USE_TIME_BITS64 | |
| 743 | 800 | extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, |
| 744 | 801 | 				 const struct timespec *__restrict |
| 745 | 802 | 				 __abstime) __THROWNL __nonnull ((1, 2)); |
| 803 | # else | |
| 804 | # ifdef __REDIRECT_NTHNL | |
| 805 | extern int __REDIRECT_NTHNL (pthread_mutex_timedlock, | |
| 806 | (pthread_mutex_t *__restrict __mutex, | |
| 807 | const struct timespec *__restrict __abstime), | |
| 808 | __pthread_mutex_timedlock64) __nonnull ((1, 2)); | |
| 809 | # else | |
| 810 | # define pthread_mutex_timedlock __pthread_mutex_timedlock64 | |
| 811 | # endif | |
| 812 | # endif | |
| 746 | 813 | #endif |
| 747 | 814 | |
| 748 | 815 | #ifdef __USE_GNU |
| 816 | # ifndef __USE_TIME_BITS64 | |
| 749 | 817 | extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex, |
| 750 | 818 | 				 clockid_t __clockid, |
| 751 | 819 | 				 const struct timespec *__restrict |
| 752 | 820 | 				 __abstime) __THROWNL __nonnull ((1, 3)); |
| 821 | # else | |
| 822 | # ifdef __REDIRECT_NTHNL | |
| 823 | extern int __REDIRECT_NTHNL (pthread_mutex_clocklock, | |
| 824 | (pthread_mutex_t *__restrict __mutex, | |
| 825 | clockid_t __clockid, | |
| 826 | const struct timespec *__restrict __abstime), | |
| 827 | __pthread_mutex_clocklock64) __nonnull ((1, 3)); | |
| 828 | # else | |
| 829 | # define pthread_mutex_clocklock __pthread_mutex_clocklock64 | |
| 830 | # endif | |
| 831 | # endif | |
| 753 | 832 | #endif |
| 754 | 833 | |
| 755 | 834 | /* Unlock a mutex. */ |
| ... | ... | @@ -776,8 +855,14 @@ extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, |
| 776 | 855 | extern int pthread_mutex_consistent (pthread_mutex_t *__mutex) |
| 777 | 856 | __THROW __nonnull ((1)); |
| 778 | 857 | # ifdef __USE_GNU |
| 779 | extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) | |
| 780 | __THROW __nonnull ((1)); | |
| 858 | # ifdef __REDIRECT_NTH | |
| 859 | extern int __REDIRECT_NTH (pthread_mutex_consistent_np, (pthread_mutex_t *), | |
| 860 | 			 pthread_mutex_consistent) __nonnull ((1)) | |
| 861 | __attribute_deprecated_msg__ ("\ | |
| 862 | pthread_mutex_consistent_np is deprecated, use pthread_mutex_consistent"); | |
| 863 | # else | |
| 864 | # define pthread_mutex_consistent_np pthread_mutex_consistent | |
| 865 | # endif | |
| 781 | 866 | # endif |
| 782 | 867 | #endif |
| 783 | 868 | |
| ... | ... | @@ -846,9 +931,15 @@ extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr, |
| 846 | 931 | 					int *__robustness) |
| 847 | 932 | __THROW __nonnull ((1, 2)); |
| 848 | 933 | # ifdef __USE_GNU |
| 849 | extern int pthread_mutexattr_getrobust_np (const pthread_mutexattr_t *__attr, | |
| 850 | 					 int *__robustness) | |
| 851 | __THROW __nonnull ((1, 2)); | |
| 934 | # ifdef __REDIRECT_NTH | |
| 935 | extern int __REDIRECT_NTH (pthread_mutexattr_getrobust_np, | |
| 936 | 			 (pthread_mutex_t *, int *), | |
| 937 | 			 pthread_mutexattr_getrobust) __nonnull ((1)) | |
| 938 | __attribute_deprecated_msg__ ("\ | |
| 939 | pthread_mutexattr_getrobust_np is deprecated, use pthread_mutexattr_getrobust"); | |
| 940 | # else | |
| 941 | # define pthread_mutexattr_getrobust_np pthread_mutexattr_getrobust | |
| 942 | # endif | |
| 852 | 943 | # endif |
| 853 | 944 | |
| 854 | 945 | /* Set the robustness flag of the mutex attribute ATTR. */ |
| ... | ... | @@ -856,13 +947,18 @@ extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr, |
| 856 | 947 | 					int __robustness) |
| 857 | 948 | __THROW __nonnull ((1)); |
| 858 | 949 | # ifdef __USE_GNU |
| 859 | extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr, | |
| 860 | 					 int __robustness) | |
| 861 | __THROW __nonnull ((1)); | |
| 950 | # ifdef __REDIRECT_NTH | |
| 951 | extern int __REDIRECT_NTH (pthread_mutexattr_setrobust_np, | |
| 952 | 			 (pthread_mutex_t *, int), | |
| 953 | 			 pthread_mutexattr_setrobust) __nonnull ((1)) | |
| 954 | __attribute_deprecated_msg__ ("\ | |
| 955 | pthread_mutexattr_setrobust_np is deprecated, use pthread_mutexattr_setrobust"); | |
| 956 | # else | |
| 957 | # define pthread_mutexattr_setrobust_np pthread_mutexattr_setrobust | |
| 958 | # endif | |
| 862 | 959 | # endif |
| 863 | 960 | #endif |
| 864 | 961 | |
| 865 | ||
| 866 | 962 | #if defined __USE_UNIX98 || defined __USE_XOPEN2K |
| 867 | 963 | /* Functions for handling read-write locks. */ |
| 868 | 964 | |
| ... | ... | @@ -886,16 +982,41 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) |
| 886 | 982 | |
| 887 | 983 | # ifdef __USE_XOPEN2K |
| 888 | 984 | /* Try to acquire read lock for RWLOCK or return after specfied time. */ |
| 985 | # ifndef __USE_TIME_BITS64 | |
| 889 | 986 | extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, |
| 890 | 987 | 				 const struct timespec *__restrict |
| 891 | 988 | 				 __abstime) __THROWNL __nonnull ((1, 2)); |
| 989 | # else | |
| 990 | # ifdef __REDIRECT_NTHNL | |
| 991 | extern int __REDIRECT_NTHNL (pthread_rwlock_timedrdlock, | |
| 992 | (pthread_rwlock_t *__restrict __rwlock, | |
| 993 | const struct timespec *__restrict __abstime), | |
| 994 | __pthread_rwlock_timedrdlock64) | |
| 995 | __nonnull ((1, 2)); | |
| 996 | # else | |
| 997 | # define pthread_rwlock_timedrdlock __pthread_rwlock_timedrdlock64 | |
| 998 | # endif | |
| 999 | # endif | |
| 892 | 1000 | # endif |
| 893 | 1001 | |
| 894 | 1002 | # ifdef __USE_GNU |
| 1003 | # ifndef __USE_TIME_BITS64 | |
| 895 | 1004 | extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock, |
| 896 | 1005 | 				 clockid_t __clockid, |
| 897 | 1006 | 				 const struct timespec *__restrict |
| 898 | 1007 | 				 __abstime) __THROWNL __nonnull ((1, 3)); |
| 1008 | # else | |
| 1009 | # ifdef __REDIRECT_NTHNL | |
| 1010 | extern int __REDIRECT_NTHNL (pthread_rwlock_clockrdlock, | |
| 1011 | (pthread_rwlock_t *__restrict __rwlock, | |
| 1012 | clockid_t __clockid, | |
| 1013 | const struct timespec *__restrict __abstime), | |
| 1014 | __pthread_rwlock_clockrdlock64) | |
| 1015 | __nonnull ((1, 3)); | |
| 1016 | # else | |
| 1017 | # define pthread_rwlock_clockrdlock __pthread_rwlock_clockrdlock64 | |
| 1018 | # endif | |
| 1019 | # endif | |
| 899 | 1020 | # endif |
| 900 | 1021 | |
| 901 | 1022 | /* Acquire write lock for RWLOCK. */ |
| ... | ... | @@ -908,16 +1029,42 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) |
| 908 | 1029 | |
| 909 | 1030 | # ifdef __USE_XOPEN2K |
| 910 | 1031 | /* Try to acquire write lock for RWLOCK or return after specfied time. */ |
| 1032 | # ifndef __USE_TIME_BITS64 | |
| 911 | 1033 | extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, |
| 912 | 1034 | 				 const struct timespec *__restrict |
| 913 | 1035 | 				 __abstime) __THROWNL __nonnull ((1, 2)); |
| 1036 | # else | |
| 1037 | # ifdef __REDIRECT_NTHNL | |
| 1038 | extern int __REDIRECT_NTHNL (pthread_rwlock_timedwrlock, | |
| 1039 | (pthread_rwlock_t *__restrict __rwlock, | |
| 1040 | const struct timespec *__restrict __abstime), | |
| 1041 | __pthread_rwlock_timedwrlock64) | |
| 1042 | __nonnull ((1, 2)); | |
| 1043 | # else | |
| 1044 | # define pthread_rwlock_timedwrlock __pthread_rwlock_timedwrlock64 | |
| 1045 | # endif | |
| 1046 | # endif | |
| 914 | 1047 | # endif |
| 915 | 1048 | |
| 916 | 1049 | # ifdef __USE_GNU |
| 1050 | # ifndef __USE_TIME_BITS64 | |
| 917 | 1051 | extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock, |
| 918 | 1052 | 				 clockid_t __clockid, |
| 919 | 1053 | 				 const struct timespec *__restrict |
| 920 | 1054 | 				 __abstime) __THROWNL __nonnull ((1, 3)); |
| 1055 | ||
| 1056 | # else | |
| 1057 | # ifdef __REDIRECT_NTHNL | |
| 1058 | extern int __REDIRECT_NTHNL (pthread_rwlock_clockwrlock, | |
| 1059 | (pthread_rwlock_t *__restrict __rwlock, | |
| 1060 | clockid_t __clockid, | |
| 1061 | const struct timespec *__restrict __abstime), | |
| 1062 | __pthread_rwlock_clockwrlock64) | |
| 1063 | __nonnull ((1, 3)); | |
| 1064 | # else | |
| 1065 | # define pthread_rwlock_clockwrlock __pthread_rwlock_clockwrlock64 | |
| 1066 | # endif | |
| 1067 | # endif | |
| 921 | 1068 | # endif |
| 922 | 1069 | |
| 923 | 1070 | /* Unlock RWLOCK. */ |
| ... | ... | @@ -994,10 +1141,23 @@ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, |
| 994 | 1141 | |
| 995 | 1142 | This function is a cancellation point and therefore not marked with |
| 996 | 1143 | __THROW. */ |
| 1144 | # ifndef __USE_TIME_BITS64 | |
| 997 | 1145 | extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, |
| 998 | 1146 | 				 pthread_mutex_t *__restrict __mutex, |
| 999 | 1147 | 				 const struct timespec *__restrict __abstime) |
| 1000 | 1148 | __nonnull ((1, 2, 3)); |
| 1149 | # else | |
| 1150 | # ifdef __REDIRECT | |
| 1151 | extern int __REDIRECT (pthread_cond_timedwait, | |
| 1152 | (pthread_cond_t *__restrict __cond, | |
| 1153 | pthread_mutex_t *__restrict __mutex, | |
| 1154 | const struct timespec *__restrict __abstime), | |
| 1155 | __pthread_cond_timedwait64) | |
| 1156 | __nonnull ((1, 2, 3)); | |
| 1157 | # else | |
| 1158 | # define pthread_cond_timedwait __pthread_cond_timedwait64 | |
| 1159 | # endif | |
| 1160 | # endif | |
| 1001 | 1161 | |
| 1002 | 1162 | # ifdef __USE_GNU |
| 1003 | 1163 | /* Wait for condition variable COND to be signaled or broadcast until |
| ... | ... | @@ -1007,11 +1167,25 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, |
| 1007 | 1167 | |
| 1008 | 1168 | This function is a cancellation point and therefore not marked with |
| 1009 | 1169 | __THROW. */ |
| 1170 | # ifndef __USE_TIME_BITS64 | |
| 1010 | 1171 | extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond, |
| 1011 | 1172 | 				 pthread_mutex_t *__restrict __mutex, |
| 1012 | 1173 | 				 __clockid_t __clock_id, |
| 1013 | 1174 | 				 const struct timespec *__restrict __abstime) |
| 1014 | 1175 | __nonnull ((1, 2, 4)); |
| 1176 | # else | |
| 1177 | # ifdef __REDIRECT | |
| 1178 | extern int __REDIRECT (pthread_cond_clockwait, | |
| 1179 | (pthread_cond_t *__restrict __cond, | |
| 1180 | pthread_mutex_t *__restrict __mutex, | |
| 1181 | __clockid_t __clock_id, | |
| 1182 | const struct timespec *__restrict __abstime), | |
| 1183 | __pthread_cond_clockwait64) | |
| 1184 | __nonnull ((1, 2, 4)); | |
| 1185 | # else | |
| 1186 | # define pthread_cond_clockwait __pthread_cond_clockwait64 | |
| 1187 | # endif | |
| 1188 | # endif | |
| 1015 | 1189 | # endif |
| 1016 | 1190 | |
| 1017 | 1191 | /* Functions for handling condition variable attributes. */ |
| ... | ... | @@ -1132,7 +1306,8 @@ extern void *pthread_getspecific (pthread_key_t __key) __THROW; |
| 1132 | 1306 | |
| 1133 | 1307 | /* Store POINTER in the thread-specific data slot identified by KEY. */ |
| 1134 | 1308 | extern int pthread_setspecific (pthread_key_t __key, |
| 1135 | 				const void *__pointer) __THROW ; | |
| 1309 | 				const void *__pointer) | |
| 1310 | __THROW __attr_access_none (2); | |
| 1136 | 1311 | |
| 1137 | 1312 | |
| 1138 | 1313 | #ifdef __USE_XOPEN2K |
lib/libc/glibc/sysdeps/powerpc/nptl/bits/pthreadtypes-arch.h deleted-81| ... | ... | @@ -1,81 +0,0 @@ |
| 1 | /* Machine-specific pthread type layouts. PowerPC version. | |
| 2 | Copyright (C) 2003-2019 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_PTHREADTYPES_ARCH_H | |
| 20 | #define _BITS_PTHREADTYPES_ARCH_H	1 | |
| 21 | ||
| 22 | #include <bits/wordsize.h> | |
| 23 | ||
| 24 | #if __WORDSIZE == 64 | |
| 25 | # define __SIZEOF_PTHREAD_MUTEX_T 40 | |
| 26 | # define __SIZEOF_PTHREAD_ATTR_T 56 | |
| 27 | # define __SIZEOF_PTHREAD_RWLOCK_T 56 | |
| 28 | # define __SIZEOF_PTHREAD_BARRIER_T 32 | |
| 29 | #else | |
| 30 | # define __SIZEOF_PTHREAD_MUTEX_T 24 | |
| 31 | # define __SIZEOF_PTHREAD_ATTR_T 36 | |
| 32 | # define __SIZEOF_PTHREAD_RWLOCK_T 32 | |
| 33 | # define __SIZEOF_PTHREAD_BARRIER_T 20 | |
| 34 | #endif | |
| 35 | #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 | |
| 36 | #define __SIZEOF_PTHREAD_COND_T 48 | |
| 37 | #define __SIZEOF_PTHREAD_CONDATTR_T 4 | |
| 38 | #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 | |
| 39 | #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 | |
| 40 | ||
| 41 | /* Definitions for internal mutex struct. */ | |
| 42 | #define __PTHREAD_COMPAT_PADDING_MID | |
| 43 | #define __PTHREAD_COMPAT_PADDING_END | |
| 44 | #define __PTHREAD_MUTEX_LOCK_ELISION 1 | |
| 45 | #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND (__WORDSIZE != 64) | |
| 46 | #define __PTHREAD_MUTEX_USE_UNION (__WORDSIZE != 64) | |
| 47 | ||
| 48 | #define __LOCK_ALIGNMENT | |
| 49 | #define __ONCE_ALIGNMENT | |
| 50 | ||
| 51 | struct __pthread_rwlock_arch_t | |
| 52 | { | |
| 53 | unsigned int __readers; | |
| 54 | unsigned int __writers; | |
| 55 | unsigned int __wrphase_futex; | |
| 56 | unsigned int __writers_futex; | |
| 57 | unsigned int __pad3; | |
| 58 | unsigned int __pad4; | |
| 59 | #if __WORDSIZE == 64 | |
| 60 | int __cur_writer; | |
| 61 | int __shared; | |
| 62 | unsigned char __rwelision; | |
| 63 | unsigned char __pad1[7]; | |
| 64 | unsigned long int __pad2; | |
| 65 | /* FLAGS must stay at this position in the structure to maintain | |
| 66 | binary compatibility. */ | |
| 67 | unsigned int __flags; | |
| 68 | # define __PTHREAD_RWLOCK_ELISION_EXTRA 0, {0, 0, 0, 0, 0, 0, 0 } | |
| 69 | #else | |
| 70 | unsigned char __rwelision; | |
| 71 | unsigned char __pad2; | |
| 72 | unsigned char __shared; | |
| 73 | /* FLAGS must stay at this position in the structure to maintain | |
| 74 | binary compatibility. */ | |
| 75 | unsigned char __flags; | |
| 76 | int __cur_writer; | |
| 77 | # define __PTHREAD_RWLOCK_ELISION_EXTRA 0 | |
| 78 | #endif | |
| 79 | }; | |
| 80 | ||
| 81 | #endif	/* bits/pthreadtypes.h */ |
lib/libc/glibc/sysdeps/powerpc/powerpc32/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for PowerPC. |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/powerpc/powerpc32/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for PowerPC. |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/powerpc/powerpc32/start.S+3-3| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Startup code for programs linked with GNU libc. |
| 2 | Copyright (C) 1998-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -52,8 +52,8 @@ |
| 52 | 52 | L(start_addresses): |
| 53 | 53 | 	.long	_SDA_BASE_ |
| 54 | 54 | 	.long	main |
| 55 | 	.long 	__libc_csu_init | |
| 56 | 	.long 	__libc_csu_fini | |
| 55 | 	.long 	0 /* Used to be init. */ | |
| 56 | 	.long 	0 /* Used to be fini. */ | |
| 57 | 57 | 	ASM_SIZE_DIRECTIVE(L(start_addresses)) |
| 58 | 58 | |
| 59 | 59 | 	.section ".text" |
lib/libc/glibc/sysdeps/powerpc/powerpc32/symbol-hacks.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Hacks needed for symbol manipulation. powerpc version. |
| 2 | Copyright (C) 2017-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/powerpc/powerpc32/sysdep.h+15-6| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembly macros for 32-bit PowerPC. |
| 2 | Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -92,7 +92,10 @@ GOT_LABEL:			;					 \ |
| 92 | 92 | |
| 93 | 93 | #define DO_CALL(syscall)						 \ |
| 94 | 94 | li 0,syscall;							 \ |
| 95 | sc | |
| 95 | DO_CALL_SC | |
| 96 | ||
| 97 | #define DO_CALL_SC \ | |
| 98 | 	sc | |
| 96 | 99 | |
| 97 | 100 | #undef JUMPTARGET |
| 98 | 101 | #ifdef PIC |
| ... | ... | @@ -106,14 +109,20 @@ GOT_LABEL:			;					 \ |
| 106 | 109 | # define HIDDEN_JUMPTARGET(name) __GI_##name##@local |
| 107 | 110 | #endif |
| 108 | 111 | |
| 112 | #define TAIL_CALL_SYSCALL_ERROR \ | |
| 113 | b __syscall_error@local | |
| 114 | ||
| 109 | 115 | #define PSEUDO(name, syscall_name, args)				 \ |
| 110 | 116 | .section ".text";							 \ |
| 111 | 117 | ENTRY (name)								 \ |
| 112 | 118 | DO_CALL (SYS_ify (syscall_name)); |
| 113 | 119 | |
| 120 | #define RET_SC \ | |
| 121 | bnslr+; | |
| 122 | ||
| 114 | 123 | #define PSEUDO_RET							 \ |
| 115 | bnslr+;								 \ | |
| 116 | b __syscall_error@local | |
| 124 | RET_SC;								 \ | |
| 125 | TAIL_CALL_SYSCALL_ERROR | |
| 117 | 126 | #define ret PSEUDO_RET |
| 118 | 127 | |
| 119 | 128 | #undef	PSEUDO_END |
| ... | ... | @@ -179,8 +188,8 @@ GOT_LABEL:			;					 \ |
| 179 | 188 | #else |
| 180 | 189 | /* Position-dependent code does not require access to the GOT. */ |
| 181 | 190 | # define __GLRO(rOUT, rGOT, member, offset)				\ |
| 182 | 	lis rOUT,(member+LOWORD)@ha;					\ | |
| 183 | 	lwz rOUT,(member+LOWORD)@l(rOUT) | |
| 191 | 	lis rOUT,(member)@ha;					\ | |
| 192 | 	lwz rOUT,(member)@l(rOUT) | |
| 184 | 193 | #endif	/* PIC */ |
| 185 | 194 | |
| 186 | 195 | #endif	/* __ASSEMBLER__ */ |
lib/libc/glibc/sysdeps/powerpc/powerpc64/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for PowerPC64. |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/powerpc/powerpc64/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for PowerPC64. |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/powerpc/powerpc64/dl-dtprocnum.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Configuration of lookup functions. PowerPC64 version. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/powerpc/powerpc64/entry.h created+37| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | /* Finding the entry point and start of text. PowerPC64 version. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | ||
| 20 | #ifndef __ASSEMBLY__ | |
| 21 | extern void _start (void); | |
| 22 | #endif | |
| 23 | ||
| 24 | #define ENTRY_POINT _start | |
| 25 | ||
| 26 | #if _CALL_ELF != 2 | |
| 27 | /* We have to provide a special declaration. */ | |
| 28 | #define ENTRY_POINT_DECL(class) class void _start (void); | |
| 29 | ||
| 30 | /* Use the address of ._start as the lowest address for which we need | |
| 31 | to keep profiling records. We can't copy the ia64 scheme as our | |
| 32 | entry poiny address is really the address of the function | |
| 33 | descriptor, not the actual function entry. */ | |
| 34 | #define TEXT_START \ | |
| 35 | ({ extern unsigned long int _start_as_data[] asm ("_start"); \ | |
| 36 | _start_as_data[0]; }) | |
| 37 | #endif |
lib/libc/glibc/sysdeps/powerpc/powerpc64/start.S+3-3| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Startup code for programs linked with GNU libc. PowerPC64 version. |
| 2 | Copyright (C) 1998-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -53,8 +53,8 @@ L(start_addresses): |
| 53 | 53 | 	.quad	0 /* was _SDA_BASE_ but not in 64-bit ABI*/ |
| 54 | 54 | /* function descriptors so don't need JUMPTARGET */ |
| 55 | 55 | 	.quad	main |
| 56 | 	.quad 	__libc_csu_init | |
| 57 | 	.quad 	__libc_csu_fini | |
| 56 | 	.quad 	0 /* Used to be init. */ | |
| 57 | 	.quad 	0 /* Used to be fini. */ | |
| 58 | 58 | |
| 59 | 59 | 	ASM_SIZE_DIRECTIVE(L(start_addresses)) |
| 60 | 60 |
lib/libc/glibc/sysdeps/powerpc/powerpc64/sysdep.h+126-8| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembly macros for 64-bit PowerPC. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -17,6 +17,7 @@ |
| 17 | 17 | <https://www.gnu.org/licenses/>. */ |
| 18 | 18 | |
| 19 | 19 | #include <sysdeps/powerpc/sysdep.h> |
| 20 | #include <tls.h> | |
| 20 | 21 | |
| 21 | 22 | #ifdef __ASSEMBLER__ |
| 22 | 23 | |
| ... | ... | @@ -263,10 +264,83 @@ LT_LABELSUFFIX(name,_name_end): ; \ |
| 263 | 264 | TRACEBACK_MASK(name,mask);	\ |
| 264 | 265 | END_2(name) |
| 265 | 266 | |
| 266 | #define DO_CALL(syscall) \ | |
| 267 | li 0,syscall; \ | |
| 267 | /* We will allocate a new frame to save LR and the non-volatile register used to | |
| 268 | read the TCB when checking for scv support on syscall code. We actually just | |
| 269 | need the minimum frame size plus room for 1 reg (8 bytes). But the ABI | |
| 270 | mandates stack frames should be aligned at 16 Bytes, so we end up allocating | |
| 271 | a bit more space then what will actually be used. */ | |
| 272 | #define SCV_FRAME_SIZE (FRAME_MIN_SIZE+16) | |
| 273 | #define SCV_FRAME_NVOLREG_SAVE FRAME_MIN_SIZE | |
| 274 | ||
| 275 | /* Allocate frame and save register */ | |
| 276 | #define NVOLREG_SAVE \ | |
| 277 | stdu r1,-SCV_FRAME_SIZE(r1); \ | |
| 278 | std r31,SCV_FRAME_NVOLREG_SAVE(r1); \ | |
| 279 | cfi_adjust_cfa_offset(SCV_FRAME_SIZE); | |
| 280 | ||
| 281 | /* Restore register and destroy frame */ | |
| 282 | #define NVOLREG_RESTORE	\ | |
| 283 | ld r31,SCV_FRAME_NVOLREG_SAVE(r1); \ | |
| 284 | addi r1,r1,SCV_FRAME_SIZE; \ | |
| 285 | cfi_adjust_cfa_offset(-SCV_FRAME_SIZE); | |
| 286 | ||
| 287 | /* Check PPC_FEATURE2_SCV bit from hwcap2 in the TCB. If it is not set, scv is | |
| 288 | not available, then go to JUMPFALSE (label given by the macro's caller). We | |
| 289 | save the value we read from the TCB in a non-volatile register so we can | |
| 290 | reuse it later when exiting from the syscall in PSEUDO_RET. Note that for | |
| 291 | the static case we need an extra check to guarantee the thread pointer has | |
| 292 | already been initialized, otherwise we may try to access an invalid address | |
| 293 | if a syscall is called before the TLS has been setup. */ | |
| 294 | .macro CHECK_SCV_SUPPORT REG JUMPFALSE | |
| 295 | ||
| 296 | #ifndef SHARED | |
| 297 | /* Check if thread pointer has already been setup. */ | |
| 298 | cmpdi r13,0 | |
| 299 | beq \JUMPFALSE | |
| 300 | #endif | |
| 301 | ||
| 302 | /* Read PPC_FEATURE2_SCV from TCB and store it in REG */ | |
| 303 | ld \REG,TCB_HWCAP(PT_THREAD_POINTER) | |
| 304 | andis. \REG,\REG,PPC_FEATURE2_SCV>>16 | |
| 305 | ||
| 306 | beq \JUMPFALSE | |
| 307 | .endm | |
| 308 | ||
| 309 | #if !defined(USE_PPC_SCV) || IS_IN(rtld) | |
| 310 | # define DO_CALL(syscall) \ | |
| 311 | li r0,syscall; \ | |
| 312 | DO_CALL_SC | |
| 313 | #else | |
| 314 | /* Before doing the syscall, check if we can use scv. scv is supported by P9 | |
| 315 | and later with Linux v5.9 and later. If so, use it. Otherwise, fallback to | |
| 316 | sc. We use a non-volatile register to save hwcap2 from the TCB, so we need | |
| 317 | to save its content beforehand. */ | |
| 318 | # define DO_CALL(syscall) \ | |
| 319 | li r0,syscall; \ | |
| 320 | NVOLREG_SAVE; \ | |
| 321 | CHECK_SCV_SUPPORT r31 0f; \ | |
| 322 | DO_CALL_SCV; \ | |
| 323 | b 1f; \ | |
| 324 | 0: DO_CALL_SC; \ | |
| 325 | 1: | |
| 326 | #endif /* !defined(USE_PPC_SCV) || IS_IN(rtld) */ | |
| 327 | ||
| 328 | /* DO_CALL_SC and DO_CALL_SCV expect the syscall number to be in r0. */ | |
| 329 | #define DO_CALL_SC \ | |
| 268 | 330 | sc |
| 269 | 331 | |
| 332 | #define DO_CALL_SCV \ | |
| 333 | mflr r9; \ | |
| 334 | std r9,FRAME_LR_SAVE(r1); \ | |
| 335 | cfi_offset(lr,FRAME_LR_SAVE); \ | |
| 336 | .machine "push"; \ | |
| 337 | .machine "power9"; \ | |
| 338 | scv 0; \ | |
| 339 | .machine "pop"; \ | |
| 340 | ld r9,FRAME_LR_SAVE(r1); \ | |
| 341 | mtlr r9; \ | |
| 342 | cfi_restore(lr); | |
| 343 | ||
| 270 | 344 | /* ppc64 is always PIC */ |
| 271 | 345 | #undef JUMPTARGET |
| 272 | 346 | #define JUMPTARGET(name) FUNC_LABEL(name) |
| ... | ... | @@ -278,7 +352,7 @@ LT_LABELSUFFIX(name,_name_end): ; \ |
| 278 | 352 | |
| 279 | 353 | #ifdef SHARED |
| 280 | 354 | #define TAIL_CALL_SYSCALL_ERROR \ |
| 281 | b JUMPTARGET(__syscall_error) | |
| 355 | b JUMPTARGET (NOTOC (__syscall_error)) | |
| 282 | 356 | #else |
| 283 | 357 | /* Static version might be linked into a large app with a toc exceeding |
| 284 | 358 | 64k. We can't put a toc adjusting stub on a plain branch, so can't |
| ... | ... | @@ -304,9 +378,33 @@ LT_LABELSUFFIX(name,_name_end): ; \ |
| 304 | 378 | .endif |
| 305 | 379 | #endif |
| 306 | 380 | |
| 307 | #define PSEUDO_RET \ | |
| 308 | bnslr+; \ | |
| 381 | #if !defined(USE_PPC_SCV) || IS_IN(rtld) | |
| 382 | # define PSEUDO_RET \ | |
| 383 | RET_SC; \ | |
| 309 | 384 | TAIL_CALL_SYSCALL_ERROR |
| 385 | #else | |
| 386 | /* This should only be called after a DO_CALL. In such cases, r31 contains the | |
| 387 | value of PPC_FEATURE2_SCV read from hwcap2 by CHECK_SCV_SUPPORT. If it is | |
| 388 | set, we know we have entered the kernel using scv, so handle the return code | |
| 389 | accordingly. */ | |
| 390 | # define PSEUDO_RET \ | |
| 391 | cmpdi cr5,r31,0; \ | |
| 392 | NVOLREG_RESTORE; \ | |
| 393 | beq cr5,0f; \ | |
| 394 | RET_SCV; \ | |
| 395 | b 1f; \ | |
| 396 | 0: RET_SC; \ | |
| 397 | 1: TAIL_CALL_SYSCALL_ERROR | |
| 398 | #endif /* !defined(USE_PPC_SCV) || IS_IN(rtld) */ | |
| 399 | ||
| 400 | #define RET_SCV \ | |
| 401 | li r9,-4095; \ | |
| 402 | cmpld r3,r9; \ | |
| 403 | bltlr+; \ | |
| 404 | neg r3,r3; | |
| 405 | ||
| 406 | #define RET_SC \ | |
| 407 | bnslr+; | |
| 310 | 408 | |
| 311 | 409 | #define ret PSEUDO_RET |
| 312 | 410 | |
| ... | ... | @@ -319,8 +417,15 @@ LT_LABELSUFFIX(name,_name_end): ; \ |
| 319 | 417 | ENTRY (name);						\ |
| 320 | 418 | DO_CALL (SYS_ify (syscall_name)) |
| 321 | 419 | |
| 322 | #define PSEUDO_RET_NOERRNO \ | |
| 420 | #if !defined(USE_PPC_SCV) || IS_IN(rtld) | |
| 421 | # define PSEUDO_RET_NOERRNO \ | |
| 422 | blr | |
| 423 | #else | |
| 424 | /* This should only be called after a DO_CALL. */ | |
| 425 | # define PSEUDO_RET_NOERRNO \ | |
| 426 | NVOLREG_RESTORE; \ | |
| 323 | 427 | blr |
| 428 | #endif /* !defined(USE_PPC_SCV) || IS_IN(rtld) */ | |
| 324 | 429 | |
| 325 | 430 | #define ret_NOERRNO PSEUDO_RET_NOERRNO |
| 326 | 431 | |
| ... | ... | @@ -333,8 +438,15 @@ LT_LABELSUFFIX(name,_name_end): ; \ |
| 333 | 438 | ENTRY (name);						\ |
| 334 | 439 | DO_CALL (SYS_ify (syscall_name)) |
| 335 | 440 | |
| 336 | #define PSEUDO_RET_ERRVAL \ | |
| 441 | #if !defined(USE_PPC_SCV) || IS_IN(rtld) | |
| 442 | # define PSEUDO_RET_ERRVAL \ | |
| 443 | blr | |
| 444 | #else | |
| 445 | /* This should only be called after a DO_CALL. */ | |
| 446 | # define PSEUDO_RET_ERRVAL \ | |
| 447 | NVOLREG_RESTORE; \ | |
| 337 | 448 | blr |
| 449 | #endif /* !defined(USE_PPC_SCV) || IS_IN(rtld) */ | |
| 338 | 450 | |
| 339 | 451 | #define ret_ERRVAL PSEUDO_RET_ERRVAL |
| 340 | 452 | |
| ... | ... | @@ -366,6 +478,12 @@ LT_LABELSUFFIX(name,_name_end): ; \ |
| 366 | 478 | 	lwz	rOUT,0(rOUT) |
| 367 | 479 | #endif |
| 368 | 480 | |
| 481 | #ifdef USE_PPC64_NOTOC | |
| 482 | # define NOTOC(l) l@notoc | |
| 483 | #else | |
| 484 | # define NOTOC(l) l | |
| 485 | #endif | |
| 486 | ||
| 369 | 487 | #else /* !__ASSEMBLER__ */ |
| 370 | 488 | |
| 371 | 489 | #if _CALL_ELF != 2 |
lib/libc/glibc/sysdeps/powerpc/sysdep.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/pthread/pthread_atfork.c created+61| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | In addition to the permissions in the GNU Lesser General Public | |
| 11 | License, the Free Software Foundation gives you unlimited | |
| 12 | permission to link the compiled version of this file with other | |
| 13 | programs, and to distribute those programs without any restriction | |
| 14 | coming from the use of this file. (The GNU Lesser General Public | |
| 15 | License restrictions do apply in other respects; for example, they | |
| 16 | cover modification of the file, and distribution when not linked | |
| 17 | into another program.) | |
| 18 | ||
| 19 | Note that people who make modified versions of this file are not | |
| 20 | obligated to grant this special exception for their modified | |
| 21 | versions; it is their choice whether to do so. The GNU Lesser | |
| 22 | General Public License gives permission to release a modified | |
| 23 | version without this exception; this exception also makes it | |
| 24 | possible to release a modified version which carries forward this | |
| 25 | exception. | |
| 26 | ||
| 27 | The GNU C Library is distributed in the hope that it will be useful, | |
| 28 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 29 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 30 | Lesser General Public License for more details. | |
| 31 | ||
| 32 | You should have received a copy of the GNU Lesser General Public | |
| 33 | License along with the GNU C Library; if not, see | |
| 34 | <https://www.gnu.org/licenses/>. */ | |
| 35 | ||
| 36 | extern int __pthread_atfork (void (*prepare) (void), void (*parent) (void), | |
| 37 | void (*child) (void)); | |
| 38 | extern int __register_atfork (void (*__prepare) (void), | |
| 39 | void (*__parent) (void), | |
| 40 | void (*__child) (void), | |
| 41 | void *dso_handle); | |
| 42 | libc_hidden_proto (__register_atfork) | |
| 43 | extern void *__dso_handle __attribute__ ((__visibility__ ("hidden"))); | |
| 44 | ||
| 45 | /* Hide the symbol so that no definition but the one locally in the | |
| 46 | executable or DSO is used. */ | |
| 47 | int | |
| 48 | #ifndef __pthread_atfork | |
| 49 | /* Don't mark the compatibility function as hidden. */ | |
| 50 | attribute_hidden | |
| 51 | #endif | |
| 52 | __pthread_atfork (void (*prepare) (void), void (*parent) (void), | |
| 53 | 		 void (*child) (void)) | |
| 54 | { | |
| 55 | return __register_atfork (prepare, parent, child, __dso_handle); | |
| 56 | } | |
| 57 | #ifndef __pthread_atfork | |
| 58 | extern int pthread_atfork (void (*prepare) (void), void (*parent) (void), | |
| 59 | 			 void (*child) (void)) attribute_hidden; | |
| 60 | weak_alias (__pthread_atfork, pthread_atfork) | |
| 61 | #endif |
lib/libc/glibc/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h+16-12| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Machine-specific pthread type layouts. RISC-V version. |
| 2 | Copyright (C) 2011-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2011-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -21,18 +21,22 @@ |
| 21 | 21 | |
| 22 | 22 | #include <bits/endian.h> |
| 23 | 23 | |
| 24 | #if __riscv_xlen == 64 | |
| 25 | # define __SIZEOF_PTHREAD_ATTR_T 		56 | |
| 26 | # define __SIZEOF_PTHREAD_MUTEX_T 		40 | |
| 27 | # define __SIZEOF_PTHREAD_MUTEXATTR_T 		 4 | |
| 28 | # define __SIZEOF_PTHREAD_COND_T 		48 | |
| 29 | # define __SIZEOF_PTHREAD_CONDATTR_T 		 4 | |
| 30 | # define __SIZEOF_PTHREAD_RWLOCK_T 		56 | |
| 31 | # define __SIZEOF_PTHREAD_RWLOCKATTR_T 		 8 | |
| 32 | # define __SIZEOF_PTHREAD_BARRIER_T 		32 | |
| 33 | # define __SIZEOF_PTHREAD_BARRIERATTR_T 	 4 | |
| 24 | #define __SIZEOF_PTHREAD_MUTEXATTR_T		4 | |
| 25 | #define __SIZEOF_PTHREAD_COND_T			48 | |
| 26 | #define __SIZEOF_PTHREAD_CONDATTR_T		4 | |
| 27 | #define __SIZEOF_PTHREAD_RWLOCKATTR_T		8 | |
| 28 | #define __SIZEOF_PTHREAD_BARRIERATTR_T		4 | |
| 29 | ||
| 30 | #if __WORDSIZE == 64 | |
| 31 | # define __SIZEOF_PTHREAD_ATTR_T		56 | |
| 32 | # define __SIZEOF_PTHREAD_MUTEX_T		40 | |
| 33 | # define __SIZEOF_PTHREAD_RWLOCK_T		56 | |
| 34 | # define __SIZEOF_PTHREAD_BARRIER_T		32 | |
| 34 | 35 | #else |
| 35 | # error "rv32i-based systems are not supported" | |
| 36 | # define __SIZEOF_PTHREAD_ATTR_T		32 | |
| 37 | # define __SIZEOF_PTHREAD_MUTEX_T		32 | |
| 38 | # define __SIZEOF_PTHREAD_RWLOCK_T		48 | |
| 39 | # define __SIZEOF_PTHREAD_BARRIER_T		20 | |
| 36 | 40 | #endif |
| 37 | 41 | |
| 38 | 42 | #define __LOCK_ALIGNMENT |
lib/libc/glibc/sysdeps/riscv/start.S+3-3| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Startup code compliant to the ELF RISC-V ABI. |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -54,8 +54,8 @@ ENTRY (ENTRY_POINT) |
| 54 | 54 | 	REG_L a1, 0(sp) /* argc. */ |
| 55 | 55 | 	addi a2, sp, SZREG /* argv. */ |
| 56 | 56 | 	andi sp, sp, ALMASK /* Align stack. */ |
| 57 | 	lla a3, __libc_csu_init | |
| 58 | 	lla a4, __libc_csu_fini | |
| 57 | 	li a3, 0	 /* Used to be init. */ | |
| 58 | 	li a4, 0	 /* Used to be fini. */ | |
| 59 | 59 | 	mv a6, sp /* stack_end. */ |
| 60 | 60 | |
| 61 | 61 | 	call __libc_start_main@plt |
lib/libc/glibc/sysdeps/s390/nptl/bits/pthreadtypes-arch.h deleted-79| ... | ... | @@ -1,79 +0,0 @@ |
| 1 | /* Copyright (C) 2003-2019 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <http://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _BITS_PTHREADTYPES_ARCH_H | |
| 19 | #define _BITS_PTHREADTYPES_ARCH_H	1 | |
| 20 | ||
| 21 | #include <bits/wordsize.h> | |
| 22 | ||
| 23 | #if __WORDSIZE == 64 | |
| 24 | # define __SIZEOF_PTHREAD_ATTR_T 56 | |
| 25 | # define __SIZEOF_PTHREAD_MUTEX_T 40 | |
| 26 | # define __SIZEOF_PTHREAD_RWLOCK_T 56 | |
| 27 | # define __SIZEOF_PTHREAD_BARRIER_T 32 | |
| 28 | #else | |
| 29 | # define __SIZEOF_PTHREAD_ATTR_T 36 | |
| 30 | # define __SIZEOF_PTHREAD_MUTEX_T 24 | |
| 31 | # define __SIZEOF_PTHREAD_RWLOCK_T 32 | |
| 32 | # define __SIZEOF_PTHREAD_BARRIER_T 20 | |
| 33 | #endif | |
| 34 | #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 | |
| 35 | #define __SIZEOF_PTHREAD_CONDATTR_T 4 | |
| 36 | #define __SIZEOF_PTHREAD_COND_T 48 | |
| 37 | #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 | |
| 38 | #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 | |
| 39 | ||
| 40 | /* Definitions for internal mutex struct. */ | |
| 41 | #define __PTHREAD_COMPAT_PADDING_MID | |
| 42 | #define __PTHREAD_COMPAT_PADDING_END | |
| 43 | #define __PTHREAD_MUTEX_LOCK_ELISION 1 | |
| 44 | #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND (__WORDSIZE != 64) | |
| 45 | #define __PTHREAD_MUTEX_USE_UNION (__WORDSIZE != 64) | |
| 46 | ||
| 47 | #define __LOCK_ALIGNMENT | |
| 48 | #define __ONCE_ALIGNMENT | |
| 49 | ||
| 50 | struct __pthread_rwlock_arch_t | |
| 51 | { | |
| 52 | unsigned int __readers; | |
| 53 | unsigned int __writers; | |
| 54 | unsigned int __wrphase_futex; | |
| 55 | unsigned int __writers_futex; | |
| 56 | unsigned int __pad3; | |
| 57 | unsigned int __pad4; | |
| 58 | #if __WORDSIZE == 64 | |
| 59 | int __cur_writer; | |
| 60 | int __shared; | |
| 61 | unsigned long int __pad1; | |
| 62 | unsigned long int __pad2; | |
| 63 | /* FLAGS must stay at this position in the structure to maintain | |
| 64 | binary compatibility. */ | |
| 65 | unsigned int __flags; | |
| 66 | # else | |
| 67 | unsigned char __pad1; | |
| 68 | unsigned char __pad2; | |
| 69 | unsigned char __shared; | |
| 70 | /* FLAGS must stay at this position in the structure to maintain | |
| 71 | binary compatibility. */ | |
| 72 | unsigned char __flags; | |
| 73 | int __cur_writer; | |
| 74 | #endif | |
| 75 | }; | |
| 76 | ||
| 77 | #define __PTHREAD_RWLOCK_ELISION_EXTRA 0 | |
| 78 | ||
| 79 | #endif	/* bits/pthreadtypes.h */ |
lib/libc/glibc/sysdeps/s390/s390-32/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for S/390. |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/s390/s390-32/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for S/390. |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/s390/s390-32/dl-sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* System-specific settings for dynamic linker code. S/390 version. |
| 2 | Copyright (C) 2014-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2014-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/s390/s390-32/start.S+3-9| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Startup code compliant to the ELF s390 ABI. |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| ... | ... | @@ -175,18 +175,16 @@ _start: |
| 175 | 175 | 	 */ |
| 176 | 176 | 	stm %r14,%r15,96(%r15) # store rtld_fini/stack_end to parameter area |
| 177 | 177 | 	la %r7,96(%r15) |
| 178 | 	l %r6,.L2-.Llit(%r13) # load pointer to __libc_csu_fini | |
| 179 | 	l %r5,.L1-.Llit(%r13) # load pointer to __libc_csu_init | |
| 180 | 178 | 	l %r2,.L3-.Llit(%r13) # load pointer to main |
| 181 | 179 | 	l %r1,.L4-.Llit(%r13)	# load pointer to __libc_start_main |
| 182 | 180 | #ifdef PIC |
| 183 | 181 | 	l %r12,.L5-.Llit(%r13) # load .got pointer |
| 184 | 	la	%r6,0(%r13,%r6) | |
| 185 | 	la	%r5,0(%r13,%r5) | |
| 186 | 182 | 	la	%r12,0(%r13,%r12) |
| 187 | 183 | 	l	%r2,0(%r12,%r2) |
| 188 | 184 | 	la	%r1,0(%r13,%r1) |
| 189 | 185 | #endif |
| 186 | 	lhi	%r6, 0			# Used to fini. | |
| 187 | 	lhi	%r5, 0			# Used to init. | |
| 190 | 188 | |
| 191 | 189 | 	/* ok, now branch to the libc main routine */ |
| 192 | 190 | 	basr %r14,%r1 |
| ... | ... | @@ -197,13 +195,9 @@ _start: |
| 197 | 195 | 	cfi_endproc |
| 198 | 196 | .Llit: |
| 199 | 197 | #ifndef PIC |
| 200 | .L1: .long __libc_csu_init | |
| 201 | .L2: .long __libc_csu_fini | |
| 202 | 198 | .L3: .long main |
| 203 | 199 | .L4: .long __libc_start_main |
| 204 | 200 | #else |
| 205 | .L1: .long __libc_csu_init-.Llit | |
| 206 | .L2: .long __libc_csu_fini-.Llit | |
| 207 | 201 | .L3: .long main@GOT |
| 208 | 202 | .L4: .long __libc_start_main@plt-.Llit |
| 209 | 203 | .L5: .long _GLOBAL_OFFSET_TABLE_-.Llit |
lib/libc/glibc/sysdeps/s390/s390-32/symbol-hacks.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Hacks needed for symbol manipulation. s390 version. |
| 2 | Copyright (C) 2017-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/s390/s390-32/sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembler macros for s390. |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 |
lib/libc/glibc/sysdeps/s390/s390-64/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for 64 bit S/390. |
| 2 | Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2001-2021 Free Software Foundation, Inc. | |
| 3 | 3 | Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 |
lib/libc/glibc/sysdeps/s390/s390-64/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for 64 bit S/390. |
| 2 | Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2001-2021 Free Software Foundation, Inc. | |
| 3 | 3 | Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 |
lib/libc/glibc/sysdeps/s390/s390-64/start.S+3-3| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Startup code compliant to the 64 bit S/390 ELF ABI. |
| 2 | Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2001-2021 Free Software Foundation, Inc. | |
| 3 | 3 | Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| ... | ... | @@ -80,8 +80,8 @@ _start: |
| 80 | 80 | 	 */ |
| 81 | 81 | 	stmg	%r14,%r15,160(%r15)	# store rtld_fini/stack_end to parameter area |
| 82 | 82 | 	la	%r7,160(%r15) |
| 83 | 	larl	%r6,__libc_csu_fini	# load pointer to __libc_csu_fini | |
| 84 | 	larl	%r5,__libc_csu_init	# load pointer to __libc_csu_init | |
| 83 | 	lghi	%r6,0			# Used to be fini. | |
| 84 | 	lghi	%r5,0			# Used to be init. | |
| 85 | 85 | |
| 86 | 86 | 	/* Ok, now branch to the libc main routine. */ |
| 87 | 87 | #ifdef PIC |
lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembler macros for 64 bit S/390. |
| 2 | Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2001-2021 Free Software Foundation, Inc. | |
| 3 | 3 | Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 |
lib/libc/glibc/sysdeps/sh/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for SH. |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/sh/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for SH. |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/sh/nptl/bits/pthreadtypes-arch.h deleted-71| ... | ... | @@ -1,71 +0,0 @@ |
| 1 | /* Copyright (C) 2002-2019 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <http://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _BITS_PTHREADTYPES_ARCH_H | |
| 19 | #define _BITS_PTHREADTYPES_ARCH_H	1 | |
| 20 | ||
| 21 | #include <endian.h> | |
| 22 | ||
| 23 | #define __SIZEOF_PTHREAD_ATTR_T 36 | |
| 24 | #define __SIZEOF_PTHREAD_MUTEX_T 24 | |
| 25 | #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 | |
| 26 | #define __SIZEOF_PTHREAD_COND_T 48 | |
| 27 | #define __SIZEOF_PTHREAD_CONDATTR_T 4 | |
| 28 | #define __SIZEOF_PTHREAD_RWLOCK_T 32 | |
| 29 | #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 | |
| 30 | #define __SIZEOF_PTHREAD_BARRIER_T 20 | |
| 31 | #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 | |
| 32 | ||
| 33 | /* Definitions for internal mutex struct. */ | |
| 34 | #define __PTHREAD_COMPAT_PADDING_MID | |
| 35 | #define __PTHREAD_COMPAT_PADDING_END | |
| 36 | #define __PTHREAD_MUTEX_LOCK_ELISION 0 | |
| 37 | #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1 | |
| 38 | #define __PTHREAD_MUTEX_USE_UNION 1 | |
| 39 | ||
| 40 | #define __LOCK_ALIGNMENT | |
| 41 | #define __ONCE_ALIGNMENT | |
| 42 | ||
| 43 | struct __pthread_rwlock_arch_t | |
| 44 | { | |
| 45 | unsigned int __readers; | |
| 46 | unsigned int __writers; | |
| 47 | unsigned int __wrphase_futex; | |
| 48 | unsigned int __writers_futex; | |
| 49 | unsigned int __pad3; | |
| 50 | unsigned int __pad4; | |
| 51 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 52 | unsigned char __pad1; | |
| 53 | unsigned char __pad2; | |
| 54 | unsigned char __shared; | |
| 55 | /* FLAGS must stay at this position in the structure to maintain | |
| 56 | binary compatibility. */ | |
| 57 | unsigned char __flags; | |
| 58 | #else | |
| 59 | /* FLAGS must stay at this position in the structure to maintain | |
| 60 | binary compatibility. */ | |
| 61 | unsigned char __flags; | |
| 62 | unsigned char __shared; | |
| 63 | unsigned char __pad1; | |
| 64 | unsigned char __pad2; | |
| 65 | #endif | |
| 66 | unsigned long int __cur_writer; | |
| 67 | }; | |
| 68 | ||
| 69 | #define __PTHREAD_RWLOCK_ELISION_EXTRA 0 | |
| 70 | ||
| 71 | #endif	/* bits/pthreadtypes.h */ |
lib/libc/glibc/sysdeps/sh/start.S+3-8| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Startup code for SH & ELF. |
| 2 | Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -70,12 +70,11 @@ _start: |
| 70 | 70 | |
| 71 | 71 | 	/* Push the last arguments to main() onto the stack */ |
| 72 | 72 | 	mov.l r4,@-r15 |
| 73 | 	mov.l L_fini,r0 | |
| 74 | 	mov.l r0,@-r15 | |
| 73 | 	mov.l r14,@-r15		/* Used to be fini. */ | |
| 75 | 74 | |
| 76 | 75 | 	/* Set up the other arguments for main() that go in registers */ |
| 77 | 76 | 	mov.l L_main,r4 |
| 78 | 	mov.l L_init,r7 | |
| 77 | 	mov #0,r7		/* Used to be init. */ | |
| 79 | 78 | |
| 80 | 79 | 	/* __libc_start_main (main, argc, argv, init, fini, rtld_fini) */ |
| 81 | 80 | |
| ... | ... | @@ -90,10 +89,6 @@ _start: |
| 90 | 89 | 	.align	2 |
| 91 | 90 | L_main: |
| 92 | 91 | 	.long	main |
| 93 | L_init: | |
| 94 | 	.long	__libc_csu_init | |
| 95 | L_fini: | |
| 96 | 	.long	__libc_csu_fini | |
| 97 | 92 | L_libc_start_main: |
| 98 | 93 | 	.long	__libc_start_main |
| 99 | 94 | L_abort: |
lib/libc/glibc/sysdeps/sh/sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembler macros for SH. |
| 2 | Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/sparc/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for sparc. |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/sparc/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for sparc. |
| 2 | Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/sparc/dl-dtprocnum.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Configuration of lookup functions. SPARC version. |
| 2 | Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/sparc/dl-sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* System-specific settings for dynamic linker code. SPARC version. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/sparc/sparc32/start.S+3-11| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Startup code for elf32-sparc |
| 2 | Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997. |
| 5 | 5 | |
| ... | ... | @@ -59,22 +59,14 @@ _start: |
| 59 | 59 | /* Load the addresses of the user entry points. */ |
| 60 | 60 | #ifndef PIC |
| 61 | 61 | 	sethi	%hi(main), %o0 |
| 62 | 	sethi	%hi(__libc_csu_init), %o3 | |
| 63 | 	sethi	%hi(__libc_csu_fini), %o4 | |
| 64 | 62 | 	or	%o0, %lo(main), %o0 |
| 65 | 	or	%o3, %lo(__libc_csu_init), %o3 | |
| 66 | 	or	%o4, %lo(__libc_csu_fini), %o4 | |
| 67 | 63 | #else |
| 68 | 64 | 	sethi	%gdop_hix22(main), %o0 |
| 69 | 	sethi	%gdop_hix22(__libc_csu_init), %o3 | |
| 70 | 	sethi	%gdop_hix22(__libc_csu_fini), %o4 | |
| 71 | 65 | 	xor	%o0, %gdop_lox10(main), %o0 |
| 72 | 	xor	%o3, %gdop_lox10(__libc_csu_init), %o3 | |
| 73 | 	xor	%o4, %gdop_lox10(__libc_csu_fini), %o4 | |
| 74 | 66 | 	ld	[%l7 + %o0], %o0, %gdop(main) |
| 75 | 	ld	[%l7 + %o3], %o3, %gdop(__libc_csu_init) | |
| 76 | 	ld	[%l7 + %o4], %o4, %gdop(__libc_csu_fini) | |
| 77 | 67 | #endif |
| 68 | 	mov	0, %o3		/* Used to be init. */ | |
| 69 | 	mov	0, %o4		/* Used to be fini. */ | |
| 78 | 70 | |
| 79 | 71 | /* When starting a binary via the dynamic linker, %g1 contains the |
| 80 | 72 | address of the shared library termination function, which will be |
lib/libc/glibc/sysdeps/sparc/sparc64/start.S+3-11| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Startup code for elf64-sparc |
| 2 | Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997. |
| 5 | 5 | |
| ... | ... | @@ -60,22 +60,14 @@ _start: |
| 60 | 60 | /* Load the addresses of the user entry points. */ |
| 61 | 61 | #ifndef PIC |
| 62 | 62 | 	sethi	%hi(main), %o0 |
| 63 | 	sethi	%hi(__libc_csu_init), %o3 | |
| 64 | 	sethi	%hi(__libc_csu_fini), %o4 | |
| 65 | 63 | 	or	%o0, %lo(main), %o0 |
| 66 | 	or	%o3, %lo(__libc_csu_init), %o3 | |
| 67 | 	or	%o4, %lo(__libc_csu_fini), %o4 | |
| 68 | 64 | #else |
| 69 | 65 | 	sethi	%gdop_hix22(main), %o0 |
| 70 | 	sethi	%gdop_hix22(__libc_csu_init), %o3 | |
| 71 | 	sethi	%gdop_hix22(__libc_csu_fini), %o4 | |
| 72 | 66 | 	xor	%o0, %gdop_lox10(main), %o0 |
| 73 | 	xor	%o3, %gdop_lox10(__libc_csu_init), %o3 | |
| 74 | 	xor	%o4, %gdop_lox10(__libc_csu_fini), %o4 | |
| 75 | 67 | 	ldx	[%l7 + %o0], %o0, %gdop(main) |
| 76 | 	ldx	[%l7 + %o3], %o3, %gdop(__libc_csu_init) | |
| 77 | 	ldx	[%l7 + %o4], %o4, %gdop(__libc_csu_fini) | |
| 78 | 68 | #endif |
| 69 | 	mov	0, %o3		/* Used to be init. */ | |
| 70 | 	mov	0, %o4		/* Used to be fini. */ | |
| 79 | 71 | |
| 80 | 72 | /* When starting a binary via the dynamic linker, %g1 contains the |
| 81 | 73 | address of the shared library termination function, which will be |
lib/libc/glibc/sysdeps/sparc/sysdep.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2011-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2011-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/alpha/sysdep.h deleted-382| ... | ... | @@ -1,382 +0,0 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | Contributed by Brendan Kehoe (brendan@zen.org). | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <sysdeps/unix/sysdep.h> | |
| 20 | #include <dl-sysdep.h> /* Defines RTLD_PRIVATE_ERRNO. */ | |
| 21 | ||
| 22 | #ifdef __ASSEMBLER__ | |
| 23 | ||
| 24 | #ifdef __linux__ | |
| 25 | # include <alpha/regdef.h> | |
| 26 | #else | |
| 27 | # include <regdef.h> | |
| 28 | #endif | |
| 29 | ||
| 30 | #define __LABEL(x)	x##: | |
| 31 | ||
| 32 | #define LEAF(name, framesize)			\ | |
| 33 | .globl name;					\ | |
| 34 | .align 4;					\ | |
| 35 | .ent name, 0;					\ | |
| 36 | __LABEL(name)					\ | |
| 37 | .frame sp, framesize, ra | |
| 38 | ||
| 39 | #define ENTRY(name)				\ | |
| 40 | .globl name;					\ | |
| 41 | .align 4;					\ | |
| 42 | .ent name, 0;					\ | |
| 43 | __LABEL(name)					\ | |
| 44 | .frame sp, 0, ra | |
| 45 | ||
| 46 | /* Mark the end of function SYM. */ | |
| 47 | #undef END | |
| 48 | #define END(sym)	.end sym | |
| 49 | ||
| 50 | #ifdef PROF | |
| 51 | # define PSEUDO_PROF				\ | |
| 52 | 	.set noat;				\ | |
| 53 | 	lda	AT, _mcount;			\ | |
| 54 | 	jsr	AT, (AT), _mcount;		\ | |
| 55 | 	.set at | |
| 56 | #else | |
| 57 | # define PSEUDO_PROF | |
| 58 | #endif | |
| 59 | ||
| 60 | #ifdef PROF | |
| 61 | # define PSEUDO_PROLOGUE			\ | |
| 62 | 	.frame sp, 0, ra;			\ | |
| 63 | 	ldgp	gp,0(pv);			\ | |
| 64 | 	PSEUDO_PROF;				\ | |
| 65 | 	.prologue 1 | |
| 66 | #elif defined PIC | |
| 67 | # define PSEUDO_PROLOGUE			\ | |
| 68 | 	.frame sp, 0, ra;			\ | |
| 69 | 	.prologue 0 | |
| 70 | #else | |
| 71 | # define PSEUDO_PROLOGUE			\ | |
| 72 | 	.frame sp, 0, ra;			\ | |
| 73 | 	ldgp	gp,0(pv);			\ | |
| 74 | 	.prologue 1 | |
| 75 | #endif /* PROF */ | |
| 76 | ||
| 77 | #ifdef PROF | |
| 78 | # define USEPV_PROF	std | |
| 79 | #else | |
| 80 | # define USEPV_PROF	no | |
| 81 | #endif | |
| 82 | ||
| 83 | #if RTLD_PRIVATE_ERRNO | |
| 84 | # define SYSCALL_ERROR_LABEL	$syscall_error | |
| 85 | # define SYSCALL_ERROR_HANDLER			\ | |
| 86 | $syscall_error:					\ | |
| 87 | 	stl	v0, rtld_errno(gp)	!gprel;	\ | |
| 88 | 	lda	v0, -1;				\ | |
| 89 | 	ret | |
| 90 | # define SYSCALL_ERROR_FALLTHRU | |
| 91 | #elif defined(PIC) | |
| 92 | # define SYSCALL_ERROR_LABEL		__syscall_error !samegp | |
| 93 | # define SYSCALL_ERROR_HANDLER | |
| 94 | # define SYSCALL_ERROR_FALLTHRU		br SYSCALL_ERROR_LABEL | |
| 95 | #else | |
| 96 | # define SYSCALL_ERROR_LABEL		$syscall_error | |
| 97 | # define SYSCALL_ERROR_HANDLER			\ | |
| 98 | $syscall_error:					\ | |
| 99 | 	jmp $31, __syscall_error | |
| 100 | # define SYSCALL_ERROR_FALLTHRU | |
| 101 | #endif /* RTLD_PRIVATE_ERRNO */ | |
| 102 | ||
| 103 | /* Overridden by specific syscalls. */ | |
| 104 | #undef PSEUDO_PREPARE_ARGS | |
| 105 | #define PSEUDO_PREPARE_ARGS	/* Nothing. */ | |
| 106 | ||
| 107 | #define PSEUDO(name, syscall_name, args)	\ | |
| 108 | 	.globl name;				\ | |
| 109 | 	.align 4;				\ | |
| 110 | 	.ent name,0;				\ | |
| 111 | __LABEL(name)					\ | |
| 112 | 	PSEUDO_PROLOGUE;			\ | |
| 113 | 	PSEUDO_PREPARE_ARGS			\ | |
| 114 | 	lda	v0, SYS_ify(syscall_name);	\ | |
| 115 | 	call_pal PAL_callsys;			\ | |
| 116 | 	bne	a3, SYSCALL_ERROR_LABEL | |
| 117 | ||
| 118 | #undef PSEUDO_END | |
| 119 | #define PSEUDO_END(sym)				\ | |
| 120 | 	SYSCALL_ERROR_HANDLER;			\ | |
| 121 | 	END(sym) | |
| 122 | ||
| 123 | #define PSEUDO_NOERRNO(name, syscall_name, args)	\ | |
| 124 | 	.globl name;					\ | |
| 125 | 	.align 4;					\ | |
| 126 | 	.ent name,0;					\ | |
| 127 | __LABEL(name)						\ | |
| 128 | 	PSEUDO_PROLOGUE;				\ | |
| 129 | 	PSEUDO_PREPARE_ARGS				\ | |
| 130 | 	lda	v0, SYS_ify(syscall_name);		\ | |
| 131 | 	call_pal PAL_callsys; | |
| 132 | ||
| 133 | #undef PSEUDO_END_NOERRNO | |
| 134 | #define PSEUDO_END_NOERRNO(sym) END(sym) | |
| 135 | ||
| 136 | #define ret_NOERRNO ret | |
| 137 | ||
| 138 | #define PSEUDO_ERRVAL(name, syscall_name, args)	\ | |
| 139 | 	.globl name;					\ | |
| 140 | 	.align 4;					\ | |
| 141 | 	.ent name,0;					\ | |
| 142 | __LABEL(name)						\ | |
| 143 | 	PSEUDO_PROLOGUE;				\ | |
| 144 | 	PSEUDO_PREPARE_ARGS				\ | |
| 145 | 	lda	v0, SYS_ify(syscall_name);		\ | |
| 146 | 	call_pal PAL_callsys; | |
| 147 | ||
| 148 | #undef PSEUDO_END_ERRVAL | |
| 149 | #define PSEUDO_END_ERRVAL(sym) END(sym) | |
| 150 | ||
| 151 | #define ret_ERRVAL ret | |
| 152 | ||
| 153 | #define r0	v0 | |
| 154 | #define r1	a4 | |
| 155 | ||
| 156 | #define MOVE(x,y)	mov x,y | |
| 157 | ||
| 158 | #else /* !ASSEMBLER */ | |
| 159 | ||
| 160 | /* In order to get __set_errno() definition in INLINE_SYSCALL. */ | |
| 161 | #include <errno.h> | |
| 162 | ||
| 163 | /* ??? Linux needs to be able to override INLINE_SYSCALL for one | |
| 164 | particular special case. Make this easy. */ | |
| 165 | ||
| 166 | #undef INLINE_SYSCALL | |
| 167 | #define INLINE_SYSCALL(name, nr, args...) \ | |
| 168 | 	INLINE_SYSCALL1(name, nr, args) | |
| 169 | ||
| 170 | #define INLINE_SYSCALL1(name, nr, args...)	\ | |
| 171 | ({						\ | |
| 172 | 	long _sc_ret, _sc_err;			\ | |
| 173 | 	inline_syscall##nr(__NR_##name, args);	\ | |
| 174 | 	if (__builtin_expect (_sc_err, 0))	\ | |
| 175 | 	 {					\ | |
| 176 | 	 __set_errno (_sc_ret);		\ | |
| 177 | 	 _sc_ret = -1L;			\ | |
| 178 | 	 }					\ | |
| 179 | 	_sc_ret;				\ | |
| 180 | }) | |
| 181 | ||
| 182 | #define INTERNAL_SYSCALL(name, err_out, nr, args...) \ | |
| 183 | 	INTERNAL_SYSCALL1(name, err_out, nr, args) | |
| 184 | ||
| 185 | #define INTERNAL_SYSCALL1(name, err_out, nr, args...)	\ | |
| 186 | 	INTERNAL_SYSCALL_NCS(__NR_##name, err_out, nr, args) | |
| 187 | ||
| 188 | #define INTERNAL_SYSCALL_NCS(name, err_out, nr, args...) \ | |
| 189 | ({							\ | |
| 190 | 	long _sc_ret, _sc_err;				\ | |
| 191 | 	inline_syscall##nr(name, args);			\ | |
| 192 | 	err_out = _sc_err;				\ | |
| 193 | 	_sc_ret;					\ | |
| 194 | }) | |
| 195 | ||
| 196 | #define INTERNAL_SYSCALL_DECL(err) \ | |
| 197 | 	long int err __attribute__((unused)) | |
| 198 | ||
| 199 | /* The normal Alpha calling convention sign-extends 32-bit quantties | |
| 200 | no matter what the "real" sign of the 32-bit type. We want to | |
| 201 | preserve that when filling in values for the kernel. */ | |
| 202 | #define syscall_promote(arg) \ | |
| 203 | (sizeof (arg) == 4 ? (long)(int)(long)(arg) : (long)(arg)) | |
| 204 | ||
| 205 | /* Make sure and "use" the variable that we're not returning, | |
| 206 | in order to suppress unused variable warnings. */ | |
| 207 | #define INTERNAL_SYSCALL_ERROR_P(val, err)	((void)val, err) | |
| 208 | #define INTERNAL_SYSCALL_ERRNO(val, err)	((void)err, val) | |
| 209 | ||
| 210 | #define inline_syscall_clobbers				\ | |
| 211 | 	"$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8",	\ | |
| 212 | 	"$22", "$23", "$24", "$25", "$27", "$28", "memory" | |
| 213 | ||
| 214 | /* It is moderately important optimization-wise to limit the lifetime | |
| 215 | of the hard-register variables as much as possible. Thus we copy | |
| 216 | in/out as close to the asm as possible. */ | |
| 217 | ||
| 218 | #define inline_syscall0(name, args...)				\ | |
| 219 | {								\ | |
| 220 | 	register long _sc_19 __asm__("$19");			\ | |
| 221 | 	register long _sc_0 = name;				\ | |
| 222 | 	__asm__ __volatile__					\ | |
| 223 | 	 ("callsys # %0 %1 <= %2"				\ | |
| 224 | 	 : "+v"(_sc_0), "=r"(_sc_19)				\ | |
| 225 | 	 : : inline_syscall_clobbers,				\ | |
| 226 | 	 "$16", "$17", "$18", "$20", "$21");		\ | |
| 227 | 	_sc_ret = _sc_0, _sc_err = _sc_19;			\ | |
| 228 | } | |
| 229 | ||
| 230 | #define inline_syscall1(name,arg1)				\ | |
| 231 | {								\ | |
| 232 | 	register long _tmp_16 = syscall_promote (arg1);		\ | |
| 233 | 	register long _sc_0 = name;				\ | |
| 234 | 	register long _sc_16 __asm__("$16") = _tmp_16;		\ | |
| 235 | 	register long _sc_19 __asm__("$19");			\ | |
| 236 | 	__asm__ __volatile__					\ | |
| 237 | 	 ("callsys # %0 %1 <= %2 %3"				\ | |
| 238 | 	 : "+v"(_sc_0), "=r"(_sc_19), "+r"(_sc_16)		\ | |
| 239 | 	 : : inline_syscall_clobbers,				\ | |
| 240 | 	 "$17", "$18", "$20", "$21");			\ | |
| 241 | 	_sc_ret = _sc_0, _sc_err = _sc_19;			\ | |
| 242 | } | |
| 243 | ||
| 244 | #define inline_syscall2(name,arg1,arg2)				\ | |
| 245 | {								\ | |
| 246 | 	register long _tmp_16 = syscall_promote (arg1);		\ | |
| 247 | 	register long _tmp_17 = syscall_promote (arg2);		\ | |
| 248 | 	register long _sc_0 = name;				\ | |
| 249 | 	register long _sc_16 __asm__("$16") = _tmp_16;		\ | |
| 250 | 	register long _sc_17 __asm__("$17") = _tmp_17;		\ | |
| 251 | 	register long _sc_19 __asm__("$19");			\ | |
| 252 | 	__asm__ __volatile__					\ | |
| 253 | 	 ("callsys # %0 %1 <= %2 %3 %4"			\ | |
| 254 | 	 : "+v"(_sc_0), "=r"(_sc_19),				\ | |
| 255 | 	 "+r"(_sc_16), "+r"(_sc_17)				\ | |
| 256 | 	 : : inline_syscall_clobbers,				\ | |
| 257 | 	 "$18", "$20", "$21");				\ | |
| 258 | 	_sc_ret = _sc_0, _sc_err = _sc_19;			\ | |
| 259 | } | |
| 260 | ||
| 261 | #define inline_syscall3(name,arg1,arg2,arg3)			\ | |
| 262 | {								\ | |
| 263 | 	register long _tmp_16 = syscall_promote (arg1);		\ | |
| 264 | 	register long _tmp_17 = syscall_promote (arg2);		\ | |
| 265 | 	register long _tmp_18 = syscall_promote (arg3);		\ | |
| 266 | 	register long _sc_0 = name;				\ | |
| 267 | 	register long _sc_16 __asm__("$16") = _tmp_16;		\ | |
| 268 | 	register long _sc_17 __asm__("$17") = _tmp_17;		\ | |
| 269 | 	register long _sc_18 __asm__("$18") = _tmp_18;		\ | |
| 270 | 	register long _sc_19 __asm__("$19");			\ | |
| 271 | 	__asm__ __volatile__					\ | |
| 272 | 	 ("callsys # %0 %1 <= %2 %3 %4 %5"			\ | |
| 273 | 	 : "+v"(_sc_0), "=r"(_sc_19), "+r"(_sc_16),		\ | |
| 274 | 	 "+r"(_sc_17), "+r"(_sc_18)				\ | |
| 275 | 	 : : inline_syscall_clobbers, "$20", "$21");		\ | |
| 276 | 	_sc_ret = _sc_0, _sc_err = _sc_19;			\ | |
| 277 | } | |
| 278 | ||
| 279 | #define inline_syscall4(name,arg1,arg2,arg3,arg4)		\ | |
| 280 | {								\ | |
| 281 | 	register long _tmp_16 = syscall_promote (arg1);		\ | |
| 282 | 	register long _tmp_17 = syscall_promote (arg2);		\ | |
| 283 | 	register long _tmp_18 = syscall_promote (arg3);		\ | |
| 284 | 	register long _tmp_19 = syscall_promote (arg4);		\ | |
| 285 | 	register long _sc_0 = name;				\ | |
| 286 | 	register long _sc_16 __asm__("$16") = _tmp_16;		\ | |
| 287 | 	register long _sc_17 __asm__("$17") = _tmp_17;		\ | |
| 288 | 	register long _sc_18 __asm__("$18") = _tmp_18;		\ | |
| 289 | 	register long _sc_19 __asm__("$19") = _tmp_19;		\ | |
| 290 | 	__asm__ __volatile__					\ | |
| 291 | 	 ("callsys # %0 %1 <= %2 %3 %4 %5 %6"			\ | |
| 292 | 	 : "+v"(_sc_0), "+r"(_sc_19), "+r"(_sc_16),		\ | |
| 293 | 	 "+r"(_sc_17), "+r"(_sc_18)				\ | |
| 294 | 	 : : inline_syscall_clobbers, "$20", "$21");		\ | |
| 295 | 	_sc_ret = _sc_0, _sc_err = _sc_19;			\ | |
| 296 | } | |
| 297 | ||
| 298 | #define inline_syscall5(name,arg1,arg2,arg3,arg4,arg5)		\ | |
| 299 | {								\ | |
| 300 | 	register long _tmp_16 = syscall_promote (arg1);		\ | |
| 301 | 	register long _tmp_17 = syscall_promote (arg2);		\ | |
| 302 | 	register long _tmp_18 = syscall_promote (arg3);		\ | |
| 303 | 	register long _tmp_19 = syscall_promote (arg4);		\ | |
| 304 | 	register long _tmp_20 = syscall_promote (arg5);		\ | |
| 305 | 	register long _sc_0 = name;				\ | |
| 306 | 	register long _sc_16 __asm__("$16") = _tmp_16;		\ | |
| 307 | 	register long _sc_17 __asm__("$17") = _tmp_17;		\ | |
| 308 | 	register long _sc_18 __asm__("$18") = _tmp_18;		\ | |
| 309 | 	register long _sc_19 __asm__("$19") = _tmp_19;		\ | |
| 310 | 	register long _sc_20 __asm__("$20") = _tmp_20;		\ | |
| 311 | 	__asm__ __volatile__					\ | |
| 312 | 	 ("callsys # %0 %1 <= %2 %3 %4 %5 %6 %7"		\ | |
| 313 | 	 : "+v"(_sc_0), "+r"(_sc_19), "+r"(_sc_16),		\ | |
| 314 | 	 "+r"(_sc_17), "+r"(_sc_18), "+r"(_sc_20)		\ | |
| 315 | 	 : : inline_syscall_clobbers, "$21");			\ | |
| 316 | 	_sc_ret = _sc_0, _sc_err = _sc_19;			\ | |
| 317 | } | |
| 318 | ||
| 319 | #define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6)	\ | |
| 320 | {								\ | |
| 321 | 	register long _tmp_16 = syscall_promote (arg1);		\ | |
| 322 | 	register long _tmp_17 = syscall_promote (arg2);		\ | |
| 323 | 	register long _tmp_18 = syscall_promote (arg3);		\ | |
| 324 | 	register long _tmp_19 = syscall_promote (arg4);		\ | |
| 325 | 	register long _tmp_20 = syscall_promote (arg5);		\ | |
| 326 | 	register long _tmp_21 = syscall_promote (arg6);		\ | |
| 327 | 	register long _sc_0 = name;				\ | |
| 328 | 	register long _sc_16 __asm__("$16") = _tmp_16;		\ | |
| 329 | 	register long _sc_17 __asm__("$17") = _tmp_17;		\ | |
| 330 | 	register long _sc_18 __asm__("$18") = _tmp_18;		\ | |
| 331 | 	register long _sc_19 __asm__("$19") = _tmp_19;		\ | |
| 332 | 	register long _sc_20 __asm__("$20") = _tmp_20;		\ | |
| 333 | 	register long _sc_21 __asm__("$21") = _tmp_21;		\ | |
| 334 | 	__asm__ __volatile__					\ | |
| 335 | 	 ("callsys # %0 %1 <= %2 %3 %4 %5 %6 %7 %8"		\ | |
| 336 | 	 : "+v"(_sc_0), "+r"(_sc_19), "+r"(_sc_16),		\ | |
| 337 | 	 "+r"(_sc_17), "+r"(_sc_18), "+r"(_sc_20),		\ | |
| 338 | 	 "+r"(_sc_21)					\ | |
| 339 | 	 : : inline_syscall_clobbers);			\ | |
| 340 | 	_sc_ret = _sc_0, _sc_err = _sc_19;			\ | |
| 341 | } | |
| 342 | #endif /* ASSEMBLER */ | |
| 343 | ||
| 344 | /* Pointer mangling support. Note that tls access is slow enough that | |
| 345 | we don't deoptimize things by placing the pointer check value there. */ | |
| 346 | ||
| 347 | #ifdef __ASSEMBLER__ | |
| 348 | # if IS_IN (rtld) | |
| 349 | # define PTR_MANGLE(dst, src, tmp)				\ | |
| 350 | 	ldah	tmp, __pointer_chk_guard_local($29) !gprelhigh;	\ | |
| 351 | 	ldq	tmp, __pointer_chk_guard_local(tmp) !gprellow;	\ | |
| 352 | 	xor	src, tmp, dst | |
| 353 | # define PTR_MANGLE2(dst, src, tmp)				\ | |
| 354 | 	xor	src, tmp, dst | |
| 355 | # elif defined SHARED | |
| 356 | # define PTR_MANGLE(dst, src, tmp)		\ | |
| 357 | 	ldq	tmp, __pointer_chk_guard;	\ | |
| 358 | 	xor	src, tmp, dst | |
| 359 | # else | |
| 360 | # define PTR_MANGLE(dst, src, tmp)		\ | |
| 361 | 	ldq	tmp, __pointer_chk_guard_local;	\ | |
| 362 | 	xor	src, tmp, dst | |
| 363 | # endif | |
| 364 | # define PTR_MANGLE2(dst, src, tmp)		\ | |
| 365 | 	xor	src, tmp, dst | |
| 366 | # define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp) | |
| 367 | # define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp) | |
| 368 | #else | |
| 369 | # include <stdint.h> | |
| 370 | # if (IS_IN (rtld) \ | |
| 371 | || (!defined SHARED && (IS_IN (libc) \ | |
| 372 | 			 || IS_IN (libpthread)))) | |
| 373 | extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden; | |
| 374 | # define PTR_MANGLE(var) \ | |
| 375 | 	(var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local) | |
| 376 | # else | |
| 377 | extern uintptr_t __pointer_chk_guard attribute_relro; | |
| 378 | # define PTR_MANGLE(var) \ | |
| 379 | 	(var) = (__typeof(var)) ((uintptr_t) (var) ^ __pointer_chk_guard) | |
| 380 | # endif | |
| 381 | # define PTR_DEMANGLE(var) PTR_MANGLE(var) | |
| 382 | #endif /* ASSEMBLER */ |
lib/libc/glibc/sysdeps/unix/arm/sysdep.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/i386/sysdep.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/mips/entry.h created+5| ... | ... | @@ -0,0 +1,5 @@ |
| 1 | #ifndef __ASSEMBLY__ | |
| 2 | extern void __start (void); | |
| 3 | #endif | |
| 4 | ||
| 5 | #define ENTRY_POINT __start |
lib/libc/glibc/sysdeps/unix/mips/mips32/sysdep.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Contributed by Brendan Kehoe (brendan@zen.org). |
| 4 | 4 |
lib/libc/glibc/sysdeps/unix/mips/mips64/n32/sysdep.h deleted-64| ... | ... | @@ -1,64 +0,0 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | Contributed by Alexandre Oliva <aoliva@redhat.com>. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <sysdeps/unix/mips/sysdep.h> | |
| 20 | ||
| 21 | #ifdef __ASSEMBLER__ | |
| 22 | ||
| 23 | /* Note that while it's better structurally, going back to call __syscall_error | |
| 24 | can make things confusing if you're debugging---it looks like it's jumping | |
| 25 | backwards into the previous fn. */ | |
| 26 | #ifdef __PIC__ | |
| 27 | #define PSEUDO(name, syscall_name, args) \ | |
| 28 | .align 2;								 \ | |
| 29 | .set nomips16;							 \ | |
| 30 | cfi_startproc;							 \ | |
| 31 | 99:;									 \ | |
| 32 | .set noat;								 \ | |
| 33 | .cpsetup t9, $1, name;						 \ | |
| 34 | cfi_register (gp, $1);						 \ | |
| 35 | .set at;								 \ | |
| 36 | la t9,__syscall_error;						 \ | |
| 37 | .cpreturn;								 \ | |
| 38 | cfi_restore (gp);							 \ | |
| 39 | jr t9;								 \ | |
| 40 | cfi_endproc;								 \ | |
| 41 | ENTRY(name)								 \ | |
| 42 | li v0, SYS_ify(syscall_name);						 \ | |
| 43 | syscall;								 \ | |
| 44 | bne a3, zero, 99b;							 \ | |
| 45 | L(syse1): | |
| 46 | #else | |
| 47 | #define PSEUDO(name, syscall_name, args) \ | |
| 48 | .set noreorder;							 \ | |
| 49 | .align 2;								 \ | |
| 50 | .set nomips16;							 \ | |
| 51 | cfi_startproc;							 \ | |
| 52 | 99: j __syscall_error;						 \ | |
| 53 | nop; \ | |
| 54 | cfi_endproc;								 \ | |
| 55 | ENTRY(name)								 \ | |
| 56 | .set noreorder;							 \ | |
| 57 | li v0, SYS_ify(syscall_name);						 \ | |
| 58 | syscall;								 \ | |
| 59 | .set reorder;								 \ | |
| 60 | bne a3, zero, 99b;							 \ | |
| 61 | L(syse1): | |
| 62 | #endif | |
| 63 | ||
| 64 | #endif |
lib/libc/glibc/sysdeps/unix/mips/mips64/n64/sysdep.h deleted-64| ... | ... | @@ -1,64 +0,0 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | Contributed by Alexandre Oliva <aoliva@redhat.com>. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <sysdeps/unix/mips/sysdep.h> | |
| 20 | ||
| 21 | #ifdef __ASSEMBLER__ | |
| 22 | ||
| 23 | /* Note that while it's better structurally, going back to call __syscall_error | |
| 24 | can make things confusing if you're debugging---it looks like it's jumping | |
| 25 | backwards into the previous fn. */ | |
| 26 | #ifdef __PIC__ | |
| 27 | #define PSEUDO(name, syscall_name, args) \ | |
| 28 | .align 2;								 \ | |
| 29 | .set nomips16;							 \ | |
| 30 | cfi_startproc;							 \ | |
| 31 | 99:;									 \ | |
| 32 | .set noat;								 \ | |
| 33 | .cpsetup t9, $1, name;						 \ | |
| 34 | cfi_register (gp, $1);						 \ | |
| 35 | .set at;								 \ | |
| 36 | dla t9,__syscall_error;						 \ | |
| 37 | .cpreturn;								 \ | |
| 38 | cfi_restore (gp);							 \ | |
| 39 | jr t9;								 \ | |
| 40 | cfi_endproc;								 \ | |
| 41 | ENTRY(name)								 \ | |
| 42 | li v0, SYS_ify(syscall_name);						 \ | |
| 43 | syscall;								 \ | |
| 44 | bne a3, zero, 99b;							 \ | |
| 45 | L(syse1): | |
| 46 | #else | |
| 47 | #define PSEUDO(name, syscall_name, args) \ | |
| 48 | .set noreorder;							 \ | |
| 49 | .align 2;								 \ | |
| 50 | .set nomips16;							 \ | |
| 51 | cfi_startproc;							 \ | |
| 52 | 99: j __syscall_error;						 \ | |
| 53 | nop; \ | |
| 54 | cfi_endproc;								 \ | |
| 55 | ENTRY(name)								 \ | |
| 56 | .set noreorder;							 \ | |
| 57 | li v0, SYS_ify(syscall_name);						 \ | |
| 58 | syscall;								 \ | |
| 59 | .set reorder;								 \ | |
| 60 | bne a3, zero, 99b;							 \ | |
| 61 | L(syse1): | |
| 62 | #endif | |
| 63 | ||
| 64 | #endif |
lib/libc/glibc/sysdeps/unix/mips/mips64/sysdep.h created+65| ... | ... | @@ -0,0 +1,65 @@ |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | Contributed by Alexandre Oliva <aoliva@redhat.com>. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <sysdeps/unix/mips/sysdep.h> | |
| 20 | ||
| 21 | #ifdef __ASSEMBLER__ | |
| 22 | #include <sys/asm.h> | |
| 23 | ||
| 24 | /* Note that while it's better structurally, going back to call __syscall_error | |
| 25 | can make things confusing if you're debugging---it looks like it's jumping | |
| 26 | backwards into the previous fn. */ | |
| 27 | #ifdef __PIC__ | |
| 28 | #define PSEUDO(name, syscall_name, args) \ | |
| 29 | .align 2;								 \ | |
| 30 | .set nomips16;							 \ | |
| 31 | cfi_startproc;							 \ | |
| 32 | 99:;									 \ | |
| 33 | .set noat;								 \ | |
| 34 | .cpsetup t9, $1, name;						 \ | |
| 35 | cfi_register (gp, $1);						 \ | |
| 36 | .set at;								 \ | |
| 37 | PTR_LA t9,__syscall_error;						 \ | |
| 38 | .cpreturn;								 \ | |
| 39 | cfi_restore (gp);							 \ | |
| 40 | jr t9;								 \ | |
| 41 | cfi_endproc;								 \ | |
| 42 | ENTRY(name)								 \ | |
| 43 | li v0, SYS_ify(syscall_name);						 \ | |
| 44 | syscall;								 \ | |
| 45 | bne a3, zero, 99b;							 \ | |
| 46 | L(syse1): | |
| 47 | #else | |
| 48 | #define PSEUDO(name, syscall_name, args) \ | |
| 49 | .set noreorder;							 \ | |
| 50 | .align 2;								 \ | |
| 51 | .set nomips16;							 \ | |
| 52 | cfi_startproc;							 \ | |
| 53 | 99: j __syscall_error;						 \ | |
| 54 | nop; \ | |
| 55 | cfi_endproc;								 \ | |
| 56 | ENTRY(name)								 \ | |
| 57 | .set noreorder;							 \ | |
| 58 | li v0, SYS_ify(syscall_name);						 \ | |
| 59 | syscall;								 \ | |
| 60 | .set reorder;								 \ | |
| 61 | bne a3, zero, 99b;							 \ | |
| 62 | L(syse1): | |
| 63 | #endif | |
| 64 | ||
| 65 | #endif |
lib/libc/glibc/sysdeps/unix/mips/sysdep.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Contributed by Brendan Kehoe (brendan@zen.org). |
| 4 | 4 |
lib/libc/glibc/sysdeps/unix/powerpc/sysdep.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sh/sysdep.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysdep.h+28-21| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -28,24 +28,24 @@ |
| 28 | 28 | #define __SYSCALL_CONCAT(a,b) __SYSCALL_CONCAT_X (a, b) |
| 29 | 29 | |
| 30 | 30 | |
| 31 | #define __INTERNAL_SYSCALL0(name, err) \ | |
| 32 | INTERNAL_SYSCALL (name, err, 0) | |
| 33 | #define __INTERNAL_SYSCALL1(name, err, a1) \ | |
| 34 | INTERNAL_SYSCALL (name, err, 1, a1) | |
| 35 | #define __INTERNAL_SYSCALL2(name, err, a1, a2) \ | |
| 36 | INTERNAL_SYSCALL (name, err, 2, a1, a2) | |
| 37 | #define __INTERNAL_SYSCALL3(name, err, a1, a2, a3) \ | |
| 38 | INTERNAL_SYSCALL (name, err, 3, a1, a2, a3) | |
| 39 | #define __INTERNAL_SYSCALL4(name, err, a1, a2, a3, a4) \ | |
| 40 | INTERNAL_SYSCALL (name, err, 4, a1, a2, a3, a4) | |
| 41 | #define __INTERNAL_SYSCALL5(name, err, a1, a2, a3, a4, a5) \ | |
| 42 | INTERNAL_SYSCALL (name, err, 5, a1, a2, a3, a4, a5) | |
| 43 | #define __INTERNAL_SYSCALL6(name, err, a1, a2, a3, a4, a5, a6) \ | |
| 44 | INTERNAL_SYSCALL (name, err, 6, a1, a2, a3, a4, a5, a6) | |
| 45 | #define __INTERNAL_SYSCALL7(name, err, a1, a2, a3, a4, a5, a6, a7) \ | |
| 46 | INTERNAL_SYSCALL (name, err, 7, a1, a2, a3, a4, a5, a6, a7) | |
| 47 | ||
| 48 | #define __INTERNAL_SYSCALL_NARGS_X(a,b,c,d,e,f,g,h,n,o,...) o | |
| 31 | #define __INTERNAL_SYSCALL0(name) \ | |
| 32 | INTERNAL_SYSCALL (name, 0) | |
| 33 | #define __INTERNAL_SYSCALL1(name, a1) \ | |
| 34 | INTERNAL_SYSCALL (name, 1, a1) | |
| 35 | #define __INTERNAL_SYSCALL2(name, a1, a2) \ | |
| 36 | INTERNAL_SYSCALL (name, 2, a1, a2) | |
| 37 | #define __INTERNAL_SYSCALL3(name, a1, a2, a3) \ | |
| 38 | INTERNAL_SYSCALL (name, 3, a1, a2, a3) | |
| 39 | #define __INTERNAL_SYSCALL4(name, a1, a2, a3, a4) \ | |
| 40 | INTERNAL_SYSCALL (name, 4, a1, a2, a3, a4) | |
| 41 | #define __INTERNAL_SYSCALL5(name, a1, a2, a3, a4, a5) \ | |
| 42 | INTERNAL_SYSCALL (name, 5, a1, a2, a3, a4, a5) | |
| 43 | #define __INTERNAL_SYSCALL6(name, a1, a2, a3, a4, a5, a6) \ | |
| 44 | INTERNAL_SYSCALL (name, 6, a1, a2, a3, a4, a5, a6) | |
| 45 | #define __INTERNAL_SYSCALL7(name, a1, a2, a3, a4, a5, a6, a7) \ | |
| 46 | INTERNAL_SYSCALL (name, 7, a1, a2, a3, a4, a5, a6, a7) | |
| 47 | ||
| 48 | #define __INTERNAL_SYSCALL_NARGS_X(a,b,c,d,e,f,g,h,n,...) n | |
| 49 | 49 | #define __INTERNAL_SYSCALL_NARGS(...) \ |
| 50 | 50 | __INTERNAL_SYSCALL_NARGS_X (__VA_ARGS__,7,6,5,4,3,2,1,0,) |
| 51 | 51 | #define __INTERNAL_SYSCALL_DISP(b,...) \ |
| ... | ... | @@ -88,10 +88,17 @@ |
| 88 | 88 | #define INLINE_SYSCALL_CALL(...) \ |
| 89 | 89 | __INLINE_SYSCALL_DISP (__INLINE_SYSCALL, __VA_ARGS__) |
| 90 | 90 | |
| 91 | #if IS_IN (rtld) | |
| 92 | /* All cancellation points are compiled out in the dynamic loader. */ | |
| 93 | # define NO_SYSCALL_CANCEL_CHECKING 1 | |
| 94 | #else | |
| 95 | # define NO_SYSCALL_CANCEL_CHECKING SINGLE_THREAD_P | |
| 96 | #endif | |
| 97 | ||
| 91 | 98 | #define SYSCALL_CANCEL(...) \ |
| 92 | 99 | ({									 \ |
| 93 | 100 | long int sc_ret;							 \ |
| 94 | if (SINGLE_THREAD_P) 						 \ | |
| 101 | if (NO_SYSCALL_CANCEL_CHECKING)					 \ | |
| 95 | 102 | sc_ret = INLINE_SYSCALL_CALL (__VA_ARGS__); 			 \ |
| 96 | 103 | else								 \ |
| 97 | 104 | {									 \ |
| ... | ... | @@ -107,7 +114,7 @@ |
| 107 | 114 | #define INTERNAL_SYSCALL_CANCEL(...) \ |
| 108 | 115 | ({									 \ |
| 109 | 116 | long int sc_ret;							 \ |
| 110 | if (SINGLE_THREAD_P) 						 \ | |
| 117 | if (NO_SYSCALL_CANCEL_CHECKING) 					 \ | |
| 111 | 118 | sc_ret = INTERNAL_SYSCALL_CALL (__VA_ARGS__); 			 \ |
| 112 | 119 | else								 \ |
| 113 | 120 | {									 \ |
lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/kernel-features.h+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. AArch64 version. |
| 3 | Copyright (C) 2018-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 2018-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sys/elf.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 2 | 2 | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 |
lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sysdep.h+11-34| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2005-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 2 | 2 | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| ... | ... | @@ -164,29 +164,10 @@ |
| 164 | 164 | # define HAVE_CLOCK_GETTIME64_VSYSCALL	"__kernel_clock_gettime" |
| 165 | 165 | # define HAVE_GETTIMEOFDAY_VSYSCALL	"__kernel_gettimeofday" |
| 166 | 166 | |
| 167 | /* Previously AArch64 used the generic version without the libc_hidden_def | |
| 168 | which lead in a non existent __send symbol in libc.so. */ | |
| 169 | # undef HAVE_INTERNAL_SEND_SYMBOL | |
| 170 | ||
| 171 | 167 | # define SINGLE_THREAD_BY_GLOBAL		1 |
| 172 | 168 | |
| 173 | /* Define a macro which expands into the inline wrapper code for a system | |
| 174 | call. */ | |
| 175 | # undef INLINE_SYSCALL | |
| 176 | # define INLINE_SYSCALL(name, nr, args...)				\ | |
| 177 | ({ unsigned long _sys_result = INTERNAL_SYSCALL (name, , nr, args);	\ | |
| 178 | if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_sys_result, ), 0))\ | |
| 179 | {								\ | |
| 180 | 	 __set_errno (INTERNAL_SYSCALL_ERRNO (_sys_result, ));		\ | |
| 181 | 	 _sys_result = (unsigned long) -1;				\ | |
| 182 | }								\ | |
| 183 | (long) _sys_result; }) | |
| 184 | ||
| 185 | # undef INTERNAL_SYSCALL_DECL | |
| 186 | # define INTERNAL_SYSCALL_DECL(err) do { } while (0) | |
| 187 | ||
| 188 | 169 | # undef INTERNAL_SYSCALL_RAW |
| 189 | # define INTERNAL_SYSCALL_RAW(name, err, nr, args...)		\ | |
| 170 | # define INTERNAL_SYSCALL_RAW(name, nr, args...)		\ | |
| 190 | 171 | ({ long _sys_result;						\ |
| 191 | 172 | {								\ |
| 192 | 173 | LOAD_ARGS_##nr (args)					\ |
| ... | ... | @@ -198,19 +179,12 @@ |
| 198 | 179 | _sys_result; }) |
| 199 | 180 | |
| 200 | 181 | # undef INTERNAL_SYSCALL |
| 201 | # define INTERNAL_SYSCALL(name, err, nr, args...)		\ | |
| 202 | 	INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args) | |
| 182 | # define INTERNAL_SYSCALL(name, nr, args...)			\ | |
| 183 | 	INTERNAL_SYSCALL_RAW(SYS_ify(name), nr, args) | |
| 203 | 184 | |
| 204 | 185 | # undef INTERNAL_SYSCALL_AARCH64 |
| 205 | # define INTERNAL_SYSCALL_AARCH64(name, err, nr, args...)	\ | |
| 206 | 	INTERNAL_SYSCALL_RAW(__ARM_NR_##name, err, nr, args) | |
| 207 | ||
| 208 | # undef INTERNAL_SYSCALL_ERROR_P | |
| 209 | # define INTERNAL_SYSCALL_ERROR_P(val, err) \ | |
| 210 | ((unsigned long) (val) >= (unsigned long) -4095) | |
| 211 | ||
| 212 | # undef INTERNAL_SYSCALL_ERRNO | |
| 213 | # define INTERNAL_SYSCALL_ERRNO(val, err)	(-(val)) | |
| 186 | # define INTERNAL_SYSCALL_AARCH64(name, nr, args...)		\ | |
| 187 | 	INTERNAL_SYSCALL_RAW(__ARM_NR_##name, nr, args) | |
| 214 | 188 | |
| 215 | 189 | # define LOAD_ARGS_0()				\ |
| 216 | 190 | register long _x0 asm ("x0"); |
| ... | ... | @@ -253,8 +227,11 @@ |
| 253 | 227 | # define ASM_ARGS_7	ASM_ARGS_6, "r" (_x6) |
| 254 | 228 | |
| 255 | 229 | # undef INTERNAL_SYSCALL_NCS |
| 256 | # define INTERNAL_SYSCALL_NCS(number, err, nr, args...)	\ | |
| 257 | 	INTERNAL_SYSCALL_RAW (number, err, nr, args) | |
| 230 | # define INTERNAL_SYSCALL_NCS(number, nr, args...)	\ | |
| 231 | 	INTERNAL_SYSCALL_RAW (number, nr, args) | |
| 232 | ||
| 233 | #undef HAVE_INTERNAL_BRK_ADDR_SYMBOL | |
| 234 | #define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 | |
| 258 | 235 | |
| 259 | 236 | #endif	/* __ASSEMBLER__ */ |
| 260 | 237 |
lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/bits/stat.h deleted-160| ... | ... | @@ -1,160 +0,0 @@ |
| 1 | /* Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #if !defined _SYS_STAT_H && !defined _FCNTL_H | |
| 19 | # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #ifndef _BITS_STAT_H | |
| 23 | #define _BITS_STAT_H	1 | |
| 24 | ||
| 25 | /* Versions of the `struct stat' data structure. */ | |
| 26 | #define _STAT_VER_KERNEL	0 | |
| 27 | #define _STAT_VER_GLIBC2	1 | |
| 28 | #define _STAT_VER_GLIBC2_1	2 | |
| 29 | #define _STAT_VER_KERNEL64	3 | |
| 30 | #define _STAT_VER_GLIBC2_3_4	3 | |
| 31 | #define _STAT_VER_LINUX		3 | |
| 32 | #define _STAT_VER		_STAT_VER_LINUX | |
| 33 | ||
| 34 | /* Versions of the `xmknod' interface. */ | |
| 35 | #define _MKNOD_VER_LINUX	0 | |
| 36 | ||
| 37 | ||
| 38 | /* Nanosecond resolution timestamps are stored in a format equivalent to | |
| 39 | 'struct timespec'. This is the type used whenever possible but the | |
| 40 | Unix namespace rules do not allow the identifier 'timespec' to appear | |
| 41 | in the <sys/stat.h> header. Therefore we have to handle the use of | |
| 42 | this header in strictly standard-compliant sources special. | |
| 43 | ||
| 44 | Use neat tidy anonymous unions and structures when possible. */ | |
| 45 | ||
| 46 | #ifdef __USE_XOPEN2K8 | |
| 47 | # if __GNUC_PREREQ(3,3) | |
| 48 | # define __ST_TIME(X)				\ | |
| 49 | 	__extension__ union {			\ | |
| 50 | 	 struct timespec st_##X##tim;	\ | |
| 51 | 	 struct {				\ | |
| 52 | 		__time_t st_##X##time;		\ | |
| 53 | 		unsigned long st_##X##timensec;	\ | |
| 54 | 	 };					\ | |
| 55 | 	} | |
| 56 | # else | |
| 57 | # define __ST_TIME(X) struct timespec st_##X##tim | |
| 58 | # define st_atime st_atim.tv_sec | |
| 59 | # define st_mtime st_mtim.tv_sec | |
| 60 | # define st_ctime st_ctim.tv_sec | |
| 61 | # endif | |
| 62 | #else | |
| 63 | # define __ST_TIME(X)				\ | |
| 64 | 	__time_t st_##X##time;			\ | |
| 65 | 	unsigned long st_##X##timensec | |
| 66 | #endif | |
| 67 | ||
| 68 | ||
| 69 | struct stat | |
| 70 | { | |
| 71 | __dev_t st_dev;		/* Device. */ | |
| 72 | #ifdef __USE_FILE_OFFSET64 | |
| 73 | __ino64_t st_ino;		/* File serial number. */ | |
| 74 | #else | |
| 75 | __ino_t st_ino;		/* File serial number.	*/ | |
| 76 | int __pad0;			/* 64-bit st_ino. */ | |
| 77 | #endif | |
| 78 | __dev_t st_rdev;		/* Device number, if device. */ | |
| 79 | __off_t st_size;		/* Size of file, in bytes. */ | |
| 80 | #ifdef __USE_FILE_OFFSET64 | |
| 81 | __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated. */ | |
| 82 | #else | |
| 83 | __blkcnt_t st_blocks;	/* Nr. 512-byte blocks allocated. */ | |
| 84 | int __pad1;			/* 64-bit st_blocks. */ | |
| 85 | #endif | |
| 86 | __mode_t st_mode;		/* File mode. */ | |
| 87 | __uid_t st_uid;		/* User ID of the file's owner.	*/ | |
| 88 | __gid_t st_gid;		/* Group ID of the file's group.*/ | |
| 89 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ | |
| 90 | __nlink_t st_nlink;		/* Link count. */ | |
| 91 | int __pad2;			/* Real padding. */ | |
| 92 | __ST_TIME(a);		/* Time of last access. */ | |
| 93 | __ST_TIME(m);		/* Time of last modification. */ | |
| 94 | __ST_TIME(c);		/* Time of last status change. */ | |
| 95 | long __glibc_reserved[3]; | |
| 96 | }; | |
| 97 | ||
| 98 | #ifdef __USE_LARGEFILE64 | |
| 99 | /* Note stat64 is the same shape as stat. */ | |
| 100 | struct stat64 | |
| 101 | { | |
| 102 | __dev_t st_dev;		/* Device. */ | |
| 103 | __ino64_t st_ino;		/* File serial number. */ | |
| 104 | __dev_t st_rdev;		/* Device number, if device. */ | |
| 105 | __off_t st_size;		/* Size of file, in bytes. */ | |
| 106 | __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated. */ | |
| 107 | __mode_t st_mode;		/* File mode. */ | |
| 108 | __uid_t st_uid;		/* User ID of the file's owner.	*/ | |
| 109 | __gid_t st_gid;		/* Group ID of the file's group.*/ | |
| 110 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ | |
| 111 | __nlink_t st_nlink;		/* Link count. */ | |
| 112 | int __pad0;			/* Real padding. */ | |
| 113 | __ST_TIME(a);		/* Time of last access. */ | |
| 114 | __ST_TIME(m);		/* Time of last modification. */ | |
| 115 | __ST_TIME(c);		/* Time of last status change. */ | |
| 116 | long __glibc_reserved[3]; | |
| 117 | }; | |
| 118 | #endif | |
| 119 | ||
| 120 | #undef __ST_TIME | |
| 121 | ||
| 122 | /* Tell code we have these members. */ | |
| 123 | #define	_STATBUF_ST_BLKSIZE | |
| 124 | #define _STATBUF_ST_RDEV | |
| 125 | #define _STATBUF_ST_NSEC | |
| 126 | ||
| 127 | /* Encoding of the file mode. */ | |
| 128 | ||
| 129 | #define	__S_IFMT	0170000	/* These bits determine file type. */ | |
| 130 | ||
| 131 | /* File types. */ | |
| 132 | #define	__S_IFDIR	0040000	/* Directory. */ | |
| 133 | #define	__S_IFCHR	0020000	/* Character device. */ | |
| 134 | #define	__S_IFBLK	0060000	/* Block device. */ | |
| 135 | #define	__S_IFREG	0100000	/* Regular file. */ | |
| 136 | #define	__S_IFIFO	0010000	/* FIFO. */ | |
| 137 | #define	__S_IFLNK	0120000	/* Symbolic link. */ | |
| 138 | #define	__S_IFSOCK	0140000	/* Socket. */ | |
| 139 | ||
| 140 | /* POSIX.1b objects. Note that these macros always evaluate to zero. But | |
| 141 | they do it by enforcing the correct use of the macros. */ | |
| 142 | #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 143 | #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 144 | #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 145 | ||
| 146 | /* Protection bits. */ | |
| 147 | ||
| 148 | #define	__S_ISUID	04000	/* Set user ID on execution. */ | |
| 149 | #define	__S_ISGID	02000	/* Set group ID on execution. */ | |
| 150 | #define	__S_ISVTX	01000	/* Save swapped text after use (sticky). */ | |
| 151 | #define	__S_IREAD	0400	/* Read by owner. */ | |
| 152 | #define	__S_IWRITE	0200	/* Write by owner. */ | |
| 153 | #define	__S_IEXEC	0100	/* Execute by owner. */ | |
| 154 | ||
| 155 | #ifdef __USE_ATFILE | |
| 156 | # define UTIME_NOW	((1l << 30) - 1l) | |
| 157 | # define UTIME_OMIT	((1l << 30) - 2l) | |
| 158 | #endif | |
| 159 | ||
| 160 | #endif /* bits/stat.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h+5-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* bits/typesizes.h -- underlying types for *_t. Linux/Alpha version. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -49,6 +49,7 @@ |
| 49 | 49 | #define __TIME_T_TYPE		__SLONGWORD_TYPE |
| 50 | 50 | #define __USECONDS_T_TYPE	__U32_TYPE |
| 51 | 51 | #define __SUSECONDS_T_TYPE	__S64_TYPE |
| 52 | #define __SUSECONDS64_T_TYPE	__S64_TYPE | |
| 52 | 53 | #define __DADDR_T_TYPE		__S32_TYPE |
| 53 | 54 | #define __KEY_T_TYPE		__S32_TYPE |
| 54 | 55 | #define __CLOCKID_T_TYPE	__S32_TYPE |
| ... | ... | @@ -72,6 +73,9 @@ |
| 72 | 73 | /* Not for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ |
| 73 | 74 | # define __STATFS_MATCHES_STATFS64 0 |
| 74 | 75 | |
| 76 | /* And for getitimer, setitimer and rusage */ | |
| 77 | #define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 | |
| 78 | ||
| 75 | 79 | /* Number of descriptors that can fit in an `fd_set'. */ |
| 76 | 80 | #define	__FD_SETSIZE		1024 |
| 77 | 81 |
lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/kernel-features.h+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. |
| 3 | Copyright (C) 2010-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 2010-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/kernel_stat.h created+91| ... | ... | @@ -0,0 +1,91 @@ |
| 1 | /* Definition of `struct stat' used in the kernel. */ | |
| 2 | struct kernel_stat | |
| 3 | { | |
| 4 | unsigned int st_dev; | |
| 5 | unsigned int st_ino; | |
| 6 | unsigned int st_mode; | |
| 7 | unsigned int st_nlink; | |
| 8 | unsigned int st_uid; | |
| 9 | unsigned int st_gid; | |
| 10 | unsigned int st_rdev; | |
| 11 | long int st_size; | |
| 12 | unsigned long int st_atime_sec; | |
| 13 | unsigned long int st_mtime_sec; | |
| 14 | unsigned long int st_ctime_sec; | |
| 15 | unsigned int st_blksize; | |
| 16 | int st_blocks; | |
| 17 | unsigned int st_flags; | |
| 18 | unsigned int st_gen; | |
| 19 | }; | |
| 20 | ||
| 21 | /* Definition of `struct stat64' used in the kernel. */ | |
| 22 | struct kernel_stat64 | |
| 23 | { | |
| 24 | unsigned long st_dev; | |
| 25 | unsigned long st_ino; | |
| 26 | unsigned long st_rdev; | |
| 27 | long st_size; | |
| 28 | unsigned long st_blocks; | |
| 29 | ||
| 30 | unsigned int st_mode; | |
| 31 | unsigned int st_uid; | |
| 32 | unsigned int st_gid; | |
| 33 | unsigned int st_blksize; | |
| 34 | unsigned int st_nlink; | |
| 35 | unsigned int __pad0; | |
| 36 | ||
| 37 | unsigned long st_atime_sec; | |
| 38 | unsigned long st_atimensec; | |
| 39 | unsigned long st_mtime_sec; | |
| 40 | unsigned long st_mtimensec; | |
| 41 | unsigned long st_ctime_sec; | |
| 42 | unsigned long st_ctimensec; | |
| 43 | long __glibc_reserved[3]; | |
| 44 | }; | |
| 45 | ||
| 46 | /* Definition of `struct stat' used by glibc 2.0. */ | |
| 47 | struct glibc2_stat | |
| 48 | { | |
| 49 | __dev_t st_dev; | |
| 50 | __ino_t st_ino; | |
| 51 | __mode_t st_mode; | |
| 52 | __nlink_t st_nlink; | |
| 53 | __uid_t st_uid; | |
| 54 | __gid_t st_gid; | |
| 55 | __dev_t st_rdev; | |
| 56 | __off_t st_size; | |
| 57 | __time_t st_atime_sec; | |
| 58 | __time_t st_mtime_sec; | |
| 59 | __time_t st_ctime_sec; | |
| 60 | unsigned int st_blksize; | |
| 61 | int st_blocks; | |
| 62 | unsigned int st_flags; | |
| 63 | unsigned int st_gen; | |
| 64 | }; | |
| 65 | ||
| 66 | /* Definition of `struct stat' used by glibc 2.1. */ | |
| 67 | struct glibc21_stat | |
| 68 | { | |
| 69 | __dev_t st_dev; | |
| 70 | __ino64_t st_ino; | |
| 71 | __mode_t st_mode; | |
| 72 | __nlink_t st_nlink; | |
| 73 | __uid_t st_uid; | |
| 74 | __gid_t st_gid; | |
| 75 | __dev_t st_rdev; | |
| 76 | __off_t st_size; | |
| 77 | __time_t st_atime_sec; | |
| 78 | __time_t st_mtime_sec; | |
| 79 | __time_t st_ctime_sec; | |
| 80 | __blkcnt64_t st_blocks; | |
| 81 | __blksize_t st_blksize; | |
| 82 | unsigned int st_flags; | |
| 83 | unsigned int st_gen; | |
| 84 | int __pad3; | |
| 85 | long __glibc_reserved[4]; | |
| 86 | }; | |
| 87 | ||
| 88 | #define STAT_IS_KERNEL_STAT 0 | |
| 89 | #define STAT64_IS_KERNEL_STAT64 1 | |
| 90 | #define XSTAT_IS_XSTAT64 1 | |
| 91 | #define STATFS_IS_STATFS64 0 |
lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/sysdep.h+325-8| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995. |
| 4 | 4 | |
| ... | ... | @@ -19,14 +19,10 @@ |
| 19 | 19 | #ifndef _LINUX_ALPHA_SYSDEP_H |
| 20 | 20 | #define _LINUX_ALPHA_SYSDEP_H 1 |
| 21 | 21 | |
| 22 | #ifdef __ASSEMBLER__ | |
| 23 | #include <asm/pal.h> | |
| 24 | #include <alpha/regdef.h> | |
| 25 | #endif | |
| 26 | ||
| 27 | 22 | /* There is some commonality. */ |
| 28 | 23 | #include <sysdeps/unix/sysv/linux/sysdep.h> |
| 29 | #include <sysdeps/unix/alpha/sysdep.h> | |
| 24 | #include <sysdeps/unix/sysdep.h> | |
| 25 | #include <dl-sysdep.h> /* Defines RTLD_PRIVATE_ERRNO. */ | |
| 30 | 26 | |
| 31 | 27 | #include <tls.h> |
| 32 | 28 | |
| ... | ... | @@ -39,4 +35,325 @@ |
| 39 | 35 | |
| 40 | 36 | #define SINGLE_THREAD_BY_GLOBAL 1 |
| 41 | 37 | |
| 42 | #endif /* _LINUX_ALPHA_SYSDEP_H */ | |
| 38 | #ifdef __ASSEMBLER__ | |
| 39 | #include <asm/pal.h> | |
| 40 | #include <alpha/regdef.h> | |
| 41 | ||
| 42 | #define __LABEL(x)	x##: | |
| 43 | ||
| 44 | #define LEAF(name, framesize)			\ | |
| 45 | .globl name;					\ | |
| 46 | .align 4;					\ | |
| 47 | .ent name, 0;					\ | |
| 48 | __LABEL(name)					\ | |
| 49 | .frame sp, framesize, ra | |
| 50 | ||
| 51 | #define ENTRY(name)				\ | |
| 52 | .globl name;					\ | |
| 53 | .align 4;					\ | |
| 54 | .ent name, 0;					\ | |
| 55 | __LABEL(name)					\ | |
| 56 | .frame sp, 0, ra | |
| 57 | ||
| 58 | /* Mark the end of function SYM. */ | |
| 59 | #undef END | |
| 60 | #define END(sym)	.end sym | |
| 61 | ||
| 62 | #ifdef PROF | |
| 63 | # define PSEUDO_PROF				\ | |
| 64 | 	.set noat;				\ | |
| 65 | 	lda	AT, _mcount;			\ | |
| 66 | 	jsr	AT, (AT), _mcount;		\ | |
| 67 | 	.set at | |
| 68 | #else | |
| 69 | # define PSEUDO_PROF | |
| 70 | #endif | |
| 71 | ||
| 72 | #ifdef PROF | |
| 73 | # define PSEUDO_PROLOGUE			\ | |
| 74 | 	.frame sp, 0, ra;			\ | |
| 75 | 	ldgp	gp,0(pv);			\ | |
| 76 | 	PSEUDO_PROF;				\ | |
| 77 | 	.prologue 1 | |
| 78 | #elif defined PIC | |
| 79 | # define PSEUDO_PROLOGUE			\ | |
| 80 | 	.frame sp, 0, ra;			\ | |
| 81 | 	.prologue 0 | |
| 82 | #else | |
| 83 | # define PSEUDO_PROLOGUE			\ | |
| 84 | 	.frame sp, 0, ra;			\ | |
| 85 | 	ldgp	gp,0(pv);			\ | |
| 86 | 	.prologue 1 | |
| 87 | #endif /* PROF */ | |
| 88 | ||
| 89 | #ifdef PROF | |
| 90 | # define USEPV_PROF	std | |
| 91 | #else | |
| 92 | # define USEPV_PROF	no | |
| 93 | #endif | |
| 94 | ||
| 95 | #undef SYSCALL_ERROR_LABEL | |
| 96 | #if RTLD_PRIVATE_ERRNO | |
| 97 | # define SYSCALL_ERROR_LABEL	$syscall_error | |
| 98 | # define SYSCALL_ERROR_HANDLER			\ | |
| 99 | $syscall_error:					\ | |
| 100 | 	stl	v0, rtld_errno(gp)	!gprel;	\ | |
| 101 | 	lda	v0, -1;				\ | |
| 102 | 	ret | |
| 103 | # define SYSCALL_ERROR_FALLTHRU | |
| 104 | #elif defined(PIC) | |
| 105 | # define SYSCALL_ERROR_LABEL		__syscall_error !samegp | |
| 106 | # define SYSCALL_ERROR_HANDLER | |
| 107 | # define SYSCALL_ERROR_FALLTHRU		br SYSCALL_ERROR_LABEL | |
| 108 | #else | |
| 109 | # define SYSCALL_ERROR_LABEL		$syscall_error | |
| 110 | # define SYSCALL_ERROR_HANDLER			\ | |
| 111 | $syscall_error:					\ | |
| 112 | 	jmp $31, __syscall_error | |
| 113 | # define SYSCALL_ERROR_FALLTHRU | |
| 114 | #endif /* RTLD_PRIVATE_ERRNO */ | |
| 115 | ||
| 116 | /* Overridden by specific syscalls. */ | |
| 117 | #undef PSEUDO_PREPARE_ARGS | |
| 118 | #define PSEUDO_PREPARE_ARGS	/* Nothing. */ | |
| 119 | ||
| 120 | #define PSEUDO(name, syscall_name, args)	\ | |
| 121 | 	.globl name;				\ | |
| 122 | 	.align 4;				\ | |
| 123 | 	.ent name,0;				\ | |
| 124 | __LABEL(name)					\ | |
| 125 | 	PSEUDO_PROLOGUE;			\ | |
| 126 | 	PSEUDO_PREPARE_ARGS			\ | |
| 127 | 	lda	v0, SYS_ify(syscall_name);	\ | |
| 128 | 	call_pal PAL_callsys;			\ | |
| 129 | 	bne	a3, SYSCALL_ERROR_LABEL | |
| 130 | ||
| 131 | #undef PSEUDO_END | |
| 132 | #define PSEUDO_END(sym)				\ | |
| 133 | 	SYSCALL_ERROR_HANDLER;			\ | |
| 134 | 	END(sym) | |
| 135 | ||
| 136 | #define PSEUDO_NOERRNO(name, syscall_name, args)	\ | |
| 137 | 	.globl name;					\ | |
| 138 | 	.align 4;					\ | |
| 139 | 	.ent name,0;					\ | |
| 140 | __LABEL(name)						\ | |
| 141 | 	PSEUDO_PROLOGUE;				\ | |
| 142 | 	PSEUDO_PREPARE_ARGS				\ | |
| 143 | 	lda	v0, SYS_ify(syscall_name);		\ | |
| 144 | 	call_pal PAL_callsys; | |
| 145 | ||
| 146 | #undef PSEUDO_END_NOERRNO | |
| 147 | #define PSEUDO_END_NOERRNO(sym) END(sym) | |
| 148 | ||
| 149 | #define ret_NOERRNO ret | |
| 150 | ||
| 151 | #define PSEUDO_ERRVAL(name, syscall_name, args)	\ | |
| 152 | 	.globl name;					\ | |
| 153 | 	.align 4;					\ | |
| 154 | 	.ent name,0;					\ | |
| 155 | __LABEL(name)						\ | |
| 156 | 	PSEUDO_PROLOGUE;				\ | |
| 157 | 	PSEUDO_PREPARE_ARGS				\ | |
| 158 | 	lda	v0, SYS_ify(syscall_name);		\ | |
| 159 | 	call_pal PAL_callsys; | |
| 160 | ||
| 161 | #undef PSEUDO_END_ERRVAL | |
| 162 | #define PSEUDO_END_ERRVAL(sym) END(sym) | |
| 163 | ||
| 164 | #define ret_ERRVAL ret | |
| 165 | ||
| 166 | #define r0	v0 | |
| 167 | #define r1	a4 | |
| 168 | ||
| 169 | #define MOVE(x,y)	mov x,y | |
| 170 | ||
| 171 | #else /* !ASSEMBLER */ | |
| 172 | ||
| 173 | #define INTERNAL_SYSCALL(name, nr, args...) \ | |
| 174 | 	internal_syscall##nr(__NR_##name, args) | |
| 175 | ||
| 176 | #define INTERNAL_SYSCALL_NCS(name, nr, args...) \ | |
| 177 | 	internal_syscall##nr(name, args) | |
| 178 | ||
| 179 | /* The normal Alpha calling convention sign-extends 32-bit quantties | |
| 180 | no matter what the "real" sign of the 32-bit type. We want to | |
| 181 | preserve that when filling in values for the kernel. */ | |
| 182 | #define syscall_promote(arg) \ | |
| 183 | (sizeof (arg) == 4 ? (long int)(int)(long int)(arg) : (long int)(arg)) | |
| 184 | ||
| 185 | #define internal_syscall_clobbers				\ | |
| 186 | 	"$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8",	\ | |
| 187 | 	"$22", "$23", "$24", "$25", "$27", "$28", "memory" | |
| 188 | ||
| 189 | /* It is moderately important optimization-wise to limit the lifetime | |
| 190 | of the hard-register variables as much as possible. Thus we copy | |
| 191 | in/out as close to the asm as possible. */ | |
| 192 | ||
| 193 | #define internal_syscall0(name, args...)			\ | |
| 194 | ({								\ | |
| 195 | 	register long int _sc_19 __asm__("$19");		\ | |
| 196 | 	register long int _sc_0 = name;				\ | |
| 197 | 	__asm__ __volatile__					\ | |
| 198 | 	 ("callsys # %0 %1 <= %2"				\ | |
| 199 | 	 : "+v"(_sc_0), "=r"(_sc_19)				\ | |
| 200 | 	 : : internal_syscall_clobbers,			\ | |
| 201 | 	 "$16", "$17", "$18", "$20", "$21");		\ | |
| 202 | 	_sc_19 != 0 ? -_sc_0 : _sc_0;				\ | |
| 203 | }) | |
| 204 | ||
| 205 | #define internal_syscall1(name,arg1)				\ | |
| 206 | ({								\ | |
| 207 | 	register long int _tmp_16 = syscall_promote (arg1);	\ | |
| 208 | 	register long int _sc_0 = name;				\ | |
| 209 | 	register long int _sc_16 __asm__("$16") = _tmp_16;	\ | |
| 210 | 	register long int _sc_19 __asm__("$19");		\ | |
| 211 | 	__asm__ __volatile__					\ | |
| 212 | 	 ("callsys # %0 %1 <= %2 %3"				\ | |
| 213 | 	 : "+v"(_sc_0), "=r"(_sc_19), "+r"(_sc_16)		\ | |
| 214 | 	 : : internal_syscall_clobbers,			\ | |
| 215 | 	 "$17", "$18", "$20", "$21");			\ | |
| 216 | 	_sc_19 != 0 ? -_sc_0 : _sc_0;				\ | |
| 217 | }) | |
| 218 | ||
| 219 | #define internal_syscall2(name,arg1,arg2)			\ | |
| 220 | ({								\ | |
| 221 | 	register long int _tmp_16 = syscall_promote (arg1);	\ | |
| 222 | 	register long int _tmp_17 = syscall_promote (arg2);	\ | |
| 223 | 	register long int _sc_0 = name;				\ | |
| 224 | 	register long int _sc_16 __asm__("$16") = _tmp_16;	\ | |
| 225 | 	register long int _sc_17 __asm__("$17") = _tmp_17;	\ | |
| 226 | 	register long int _sc_19 __asm__("$19");		\ | |
| 227 | 	__asm__ __volatile__					\ | |
| 228 | 	 ("callsys # %0 %1 <= %2 %3 %4"			\ | |
| 229 | 	 : "+v"(_sc_0), "=r"(_sc_19),				\ | |
| 230 | 	 "+r"(_sc_16), "+r"(_sc_17)				\ | |
| 231 | 	 : : internal_syscall_clobbers,			\ | |
| 232 | 	 "$18", "$20", "$21");				\ | |
| 233 | 	_sc_19 != 0 ? -_sc_0 : _sc_0;				\ | |
| 234 | }) | |
| 235 | ||
| 236 | #define internal_syscall3(name,arg1,arg2,arg3)			\ | |
| 237 | ({								\ | |
| 238 | 	register long int _tmp_16 = syscall_promote (arg1);	\ | |
| 239 | 	register long int _tmp_17 = syscall_promote (arg2);	\ | |
| 240 | 	register long int _tmp_18 = syscall_promote (arg3);	\ | |
| 241 | 	register long int _sc_0 = name;				\ | |
| 242 | 	register long int _sc_16 __asm__("$16") = _tmp_16;	\ | |
| 243 | 	register long int _sc_17 __asm__("$17") = _tmp_17;	\ | |
| 244 | 	register long int _sc_18 __asm__("$18") = _tmp_18;	\ | |
| 245 | 	register long int _sc_19 __asm__("$19");		\ | |
| 246 | 	__asm__ __volatile__					\ | |
| 247 | 	 ("callsys # %0 %1 <= %2 %3 %4 %5"			\ | |
| 248 | 	 : "+v"(_sc_0), "=r"(_sc_19), "+r"(_sc_16),		\ | |
| 249 | 	 "+r"(_sc_17), "+r"(_sc_18)				\ | |
| 250 | 	 : : internal_syscall_clobbers, "$20", "$21");	\ | |
| 251 | 	_sc_19 != 0 ? -_sc_0 : _sc_0;				\ | |
| 252 | }) | |
| 253 | ||
| 254 | #define internal_syscall4(name,arg1,arg2,arg3,arg4)		\ | |
| 255 | ({								\ | |
| 256 | 	register long int _tmp_16 = syscall_promote (arg1);	\ | |
| 257 | 	register long int _tmp_17 = syscall_promote (arg2);	\ | |
| 258 | 	register long int _tmp_18 = syscall_promote (arg3);	\ | |
| 259 | 	register long int _tmp_19 = syscall_promote (arg4);	\ | |
| 260 | 	register long int _sc_0 = name;				\ | |
| 261 | 	register long int _sc_16 __asm__("$16") = _tmp_16;	\ | |
| 262 | 	register long int _sc_17 __asm__("$17") = _tmp_17;	\ | |
| 263 | 	register long int _sc_18 __asm__("$18") = _tmp_18;	\ | |
| 264 | 	register long int _sc_19 __asm__("$19") = _tmp_19;	\ | |
| 265 | 	__asm__ __volatile__					\ | |
| 266 | 	 ("callsys # %0 %1 <= %2 %3 %4 %5 %6"			\ | |
| 267 | 	 : "+v"(_sc_0), "+r"(_sc_19), "+r"(_sc_16),		\ | |
| 268 | 	 "+r"(_sc_17), "+r"(_sc_18)				\ | |
| 269 | 	 : : internal_syscall_clobbers, "$20", "$21");	\ | |
| 270 | 	_sc_19 != 0 ? -_sc_0 : _sc_0;				\ | |
| 271 | }) | |
| 272 | ||
| 273 | #define internal_syscall5(name,arg1,arg2,arg3,arg4,arg5)	\ | |
| 274 | ({								\ | |
| 275 | 	register long int _tmp_16 = syscall_promote (arg1);	\ | |
| 276 | 	register long int _tmp_17 = syscall_promote (arg2);	\ | |
| 277 | 	register long int _tmp_18 = syscall_promote (arg3);	\ | |
| 278 | 	register long int _tmp_19 = syscall_promote (arg4);	\ | |
| 279 | 	register long int _tmp_20 = syscall_promote (arg5);	\ | |
| 280 | 	register long int _sc_0 = name;				\ | |
| 281 | 	register long int _sc_16 __asm__("$16") = _tmp_16;	\ | |
| 282 | 	register long int _sc_17 __asm__("$17") = _tmp_17;	\ | |
| 283 | 	register long int _sc_18 __asm__("$18") = _tmp_18;	\ | |
| 284 | 	register long int _sc_19 __asm__("$19") = _tmp_19;	\ | |
| 285 | 	register long int _sc_20 __asm__("$20") = _tmp_20;	\ | |
| 286 | 	__asm__ __volatile__					\ | |
| 287 | 	 ("callsys # %0 %1 <= %2 %3 %4 %5 %6 %7"		\ | |
| 288 | 	 : "+v"(_sc_0), "+r"(_sc_19), "+r"(_sc_16),		\ | |
| 289 | 	 "+r"(_sc_17), "+r"(_sc_18), "+r"(_sc_20)		\ | |
| 290 | 	 : : internal_syscall_clobbers, "$21");		\ | |
| 291 | 	_sc_19 != 0 ? -_sc_0 : _sc_0;				\ | |
| 292 | }) | |
| 293 | ||
| 294 | #define internal_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6)	\ | |
| 295 | ({								\ | |
| 296 | 	register long int _tmp_16 = syscall_promote (arg1);	\ | |
| 297 | 	register long int _tmp_17 = syscall_promote (arg2);	\ | |
| 298 | 	register long int _tmp_18 = syscall_promote (arg3);	\ | |
| 299 | 	register long int _tmp_19 = syscall_promote (arg4);	\ | |
| 300 | 	register long int _tmp_20 = syscall_promote (arg5);	\ | |
| 301 | 	register long int _tmp_21 = syscall_promote (arg6);	\ | |
| 302 | 	register long int _sc_0 = name;				\ | |
| 303 | 	register long int _sc_16 __asm__("$16") = _tmp_16;	\ | |
| 304 | 	register long int _sc_17 __asm__("$17") = _tmp_17;	\ | |
| 305 | 	register long int _sc_18 __asm__("$18") = _tmp_18;	\ | |
| 306 | 	register long int _sc_19 __asm__("$19") = _tmp_19;	\ | |
| 307 | 	register long int _sc_20 __asm__("$20") = _tmp_20;	\ | |
| 308 | 	register long int _sc_21 __asm__("$21") = _tmp_21;	\ | |
| 309 | 	__asm__ __volatile__					\ | |
| 310 | 	 ("callsys # %0 %1 <= %2 %3 %4 %5 %6 %7 %8"		\ | |
| 311 | 	 : "+v"(_sc_0), "+r"(_sc_19), "+r"(_sc_16),		\ | |
| 312 | 	 "+r"(_sc_17), "+r"(_sc_18), "+r"(_sc_20),		\ | |
| 313 | 	 "+r"(_sc_21)					\ | |
| 314 | 	 : : internal_syscall_clobbers);			\ | |
| 315 | 	_sc_19 != 0 ? -_sc_0 : _sc_0;				\ | |
| 316 | }) | |
| 317 | #endif /* ASSEMBLER */ | |
| 318 | ||
| 319 | /* Pointer mangling support. Note that tls access is slow enough that | |
| 320 | we don't deoptimize things by placing the pointer check value there. */ | |
| 321 | ||
| 322 | #ifdef __ASSEMBLER__ | |
| 323 | # if IS_IN (rtld) | |
| 324 | # define PTR_MANGLE(dst, src, tmp)				\ | |
| 325 | 	ldah	tmp, __pointer_chk_guard_local($29) !gprelhigh;	\ | |
| 326 | 	ldq	tmp, __pointer_chk_guard_local(tmp) !gprellow;	\ | |
| 327 | 	xor	src, tmp, dst | |
| 328 | # define PTR_MANGLE2(dst, src, tmp)				\ | |
| 329 | 	xor	src, tmp, dst | |
| 330 | # elif defined SHARED | |
| 331 | # define PTR_MANGLE(dst, src, tmp)		\ | |
| 332 | 	ldq	tmp, __pointer_chk_guard;	\ | |
| 333 | 	xor	src, tmp, dst | |
| 334 | # else | |
| 335 | # define PTR_MANGLE(dst, src, tmp)		\ | |
| 336 | 	ldq	tmp, __pointer_chk_guard_local;	\ | |
| 337 | 	xor	src, tmp, dst | |
| 338 | # endif | |
| 339 | # define PTR_MANGLE2(dst, src, tmp)		\ | |
| 340 | 	xor	src, tmp, dst | |
| 341 | # define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp) | |
| 342 | # define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp) | |
| 343 | #else | |
| 344 | # include <stdint.h> | |
| 345 | # if (IS_IN (rtld) \ | |
| 346 | || (!defined SHARED && (IS_IN (libc) \ | |
| 347 | 			 || IS_IN (libpthread)))) | |
| 348 | extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden; | |
| 349 | # define PTR_MANGLE(var) \ | |
| 350 | 	(var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local) | |
| 351 | # else | |
| 352 | extern uintptr_t __pointer_chk_guard attribute_relro; | |
| 353 | # define PTR_MANGLE(var) \ | |
| 354 | 	(var) = (__typeof(var)) ((uintptr_t) (var) ^ __pointer_chk_guard) | |
| 355 | # endif | |
| 356 | # define PTR_DEMANGLE(var) PTR_MANGLE(var) | |
| 357 | #endif /* ASSEMBLER */ | |
| 358 | ||
| 359 | #endif /* _LINUX_ALPHA_SYSDEP_H */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/arc/sysdep.h created+229| ... | ... | @@ -0,0 +1,229 @@ |
| 1 | /* Assembler macros for ARC. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _LINUX_ARC_SYSDEP_H | |
| 20 | #define _LINUX_ARC_SYSDEP_H 1 | |
| 21 | ||
| 22 | #include <sysdeps/arc/sysdep.h> | |
| 23 | #include <sysdeps/unix/sysv/linux/generic/sysdep.h> | |
| 24 | ||
| 25 | /* "workarounds" for generic code needing to handle 64-bit time_t. */ | |
| 26 | ||
| 27 | /* Fix sysdeps/unix/sysv/linux/clock_getcpuclockid.c. */ | |
| 28 | #define __NR_clock_getres	__NR_clock_getres_time64 | |
| 29 | /* Fix sysdeps/nptl/lowlevellock-futex.h. */ | |
| 30 | #define __NR_futex		__NR_futex_time64 | |
| 31 | /* Fix sysdeps/unix/sysv/linux/pause.c. */ | |
| 32 | #define __NR_ppoll		__NR_ppoll_time64 | |
| 33 | /* Fix sysdeps/unix/sysv/linux/select.c. */ | |
| 34 | #define __NR_pselect6		__NR_pselect6_time64 | |
| 35 | /* Fix sysdeps/unix/sysv/linux/recvmmsg.c. */ | |
| 36 | #define __NR_recvmmsg		__NR_recvmmsg_time64 | |
| 37 | /* Fix sysdeps/unix/sysv/linux/sigtimedwait.c. */ | |
| 38 | #define __NR_rt_sigtimedwait	__NR_rt_sigtimedwait_time64 | |
| 39 | /* Fix sysdeps/unix/sysv/linux/semtimedop.c. */ | |
| 40 | #define __NR_semtimedop		__NR_semtimedop_time64 | |
| 41 | /* Hack sysdeps/unix/sysv/linux/generic/utimes.c. */ | |
| 42 | #define __NR_utimensat		__NR_utimensat_time64 | |
| 43 | ||
| 44 | /* For RTLD_PRIVATE_ERRNO. */ | |
| 45 | #include <dl-sysdep.h> | |
| 46 | ||
| 47 | #include <tls.h> | |
| 48 | ||
| 49 | #undef SYS_ify | |
| 50 | #define SYS_ify(syscall_name) __NR_##syscall_name | |
| 51 | ||
| 52 | #ifdef __ASSEMBLER__ | |
| 53 | ||
| 54 | /* This is a "normal" system call stub: if there is an error, | |
| 55 | it returns -1 and sets errno. */ | |
| 56 | ||
| 57 | # undef PSEUDO | |
| 58 | # define PSEUDO(name, syscall_name, args)			\ | |
| 59 | PSEUDO_NOERRNO(name, syscall_name, args)	ASM_LINE_SEP	\ | |
| 60 | brhi r0, -4096, L (call_syscall_err)	ASM_LINE_SEP | |
| 61 | ||
| 62 | # define ret	j_s [blink] | |
| 63 | ||
| 64 | # undef PSEUDO_END | |
| 65 | # define PSEUDO_END(name)					\ | |
| 66 | SYSCALL_ERROR_HANDLER				ASM_LINE_SEP	\ | |
| 67 | END (name) | |
| 68 | ||
| 69 | /* --------- Helper for SYSCALL_NOERRNO ----------- | |
| 70 | This kind of system call stub never returns an error. | |
| 71 | We return the return value register to the caller unexamined. */ | |
| 72 | ||
| 73 | # undef PSEUDO_NOERRNO | |
| 74 | # define PSEUDO_NOERRNO(name, syscall_name, args)		\ | |
| 75 | .text						ASM_LINE_SEP	\ | |
| 76 | ENTRY (name)					ASM_LINE_SEP	\ | |
| 77 | DO_CALL (syscall_name, args)		ASM_LINE_SEP	\ | |
| 78 | ||
| 79 | /* Return the return value register unexamined. Since r0 is both | |
| 80 | syscall return reg and function return reg, no work needed. */ | |
| 81 | # define ret_NOERRNO						\ | |
| 82 | j_s [blink]		ASM_LINE_SEP | |
| 83 | ||
| 84 | # undef PSEUDO_END_NOERRNO | |
| 85 | # define PSEUDO_END_NOERRNO(name)				\ | |
| 86 | END (name) | |
| 87 | ||
| 88 | /* --------- Helper for SYSCALL_ERRVAL ----------- | |
| 89 | This kind of system call stub returns the errno code as its return | |
| 90 | value, or zero for success. We may massage the kernel's return value | |
| 91 | to meet that ABI, but we never set errno here. */ | |
| 92 | ||
| 93 | # undef PSEUDO_ERRVAL | |
| 94 | # define PSEUDO_ERRVAL(name, syscall_name, args)		\ | |
| 95 | PSEUDO_NOERRNO(name, syscall_name, args)	ASM_LINE_SEP | |
| 96 | ||
| 97 | /* Don't set errno, return kernel error (in errno form) or zero. */ | |
| 98 | # define ret_ERRVAL						\ | |
| 99 | rsub r0, r0, 0				ASM_LINE_SEP	\ | |
| 100 | ret_NOERRNO | |
| 101 | ||
| 102 | # undef PSEUDO_END_ERRVAL | |
| 103 | # define PSEUDO_END_ERRVAL(name)				\ | |
| 104 | END (name) | |
| 105 | ||
| 106 | ||
| 107 | /* To reduce the code footprint, we confine the actual errno access | |
| 108 | to single place in __syscall_error(). | |
| 109 | This takes raw kernel error value, sets errno and returns -1. */ | |
| 110 | # if IS_IN (libc) | |
| 111 | # define CALL_ERRNO_SETTER_C	bl PLTJMP(HIDDEN_JUMPTARGET(__syscall_error)) | |
| 112 | # else | |
| 113 | # define CALL_ERRNO_SETTER_C	bl PLTJMP(__syscall_error) | |
| 114 | # endif | |
| 115 | ||
| 116 | # define SYSCALL_ERROR_HANDLER				\ | |
| 117 | L (call_syscall_err):			ASM_LINE_SEP	\ | |
| 118 | push_s blink			ASM_LINE_SEP	\ | |
| 119 | cfi_adjust_cfa_offset (4)		ASM_LINE_SEP	\ | |
| 120 | cfi_rel_offset (blink, 0)		ASM_LINE_SEP	\ | |
| 121 | CALL_ERRNO_SETTER_C			ASM_LINE_SEP	\ | |
| 122 | pop_s blink			ASM_LINE_SEP	\ | |
| 123 | cfi_adjust_cfa_offset (-4)		ASM_LINE_SEP	\ | |
| 124 | cfi_restore (blink)			ASM_LINE_SEP	\ | |
| 125 | j_s [blink] | |
| 126 | ||
| 127 | # define DO_CALL(syscall_name, args)			\ | |
| 128 | mov r8, __NR_##syscall_name	ASM_LINE_SEP	\ | |
| 129 | ARC_TRAP_INSN			ASM_LINE_SEP | |
| 130 | ||
| 131 | # define ARC_TRAP_INSN	trap_s 0 | |
| 132 | ||
| 133 | #else /* !__ASSEMBLER__ */ | |
| 134 | ||
| 135 | # define SINGLE_THREAD_BY_GLOBAL		1 | |
| 136 | ||
| 137 | # if IS_IN (libc) | |
| 138 | extern long int __syscall_error (long int); | |
| 139 | hidden_proto (__syscall_error) | |
| 140 | # endif | |
| 141 | ||
| 142 | # define ARC_TRAP_INSN	"trap_s 0	\n\t" | |
| 143 | ||
| 144 | # undef INTERNAL_SYSCALL_NCS | |
| 145 | # define INTERNAL_SYSCALL_NCS(number, nr_args, args...)	\ | |
| 146 | ({								\ | |
| 147 | /* Per ABI, r0 is 1st arg and return reg. */		\ | |
| 148 | register long int __ret __asm__("r0");			\ | |
| 149 | register long int _sys_num __asm__("r8");			\ | |
| 150 | 								\ | |
| 151 | LOAD_ARGS_##nr_args (number, args)				\ | |
| 152 | 								\ | |
| 153 | __asm__ volatile (						\ | |
| 154 | ARC_TRAP_INSN				\ | |
| 155 | : "+r" (__ret)				\ | |
| 156 | : "r"(_sys_num) ASM_ARGS_##nr_args	\ | |
| 157 | : "memory");				\ | |
| 158 | \ | |
| 159 | __ret; }) | |
| 160 | ||
| 161 | # undef INTERNAL_SYSCALL | |
| 162 | # define INTERNAL_SYSCALL(name, nr, args...) 	\ | |
| 163 | INTERNAL_SYSCALL_NCS(__NR_##name, nr, args) | |
| 164 | ||
| 165 | /* Macros for setting up inline __asm__ input regs. */ | |
| 166 | # define ASM_ARGS_0 | |
| 167 | # define ASM_ARGS_1	ASM_ARGS_0, "r" (__ret) | |
| 168 | # define ASM_ARGS_2	ASM_ARGS_1, "r" (_arg2) | |
| 169 | # define ASM_ARGS_3	ASM_ARGS_2, "r" (_arg3) | |
| 170 | # define ASM_ARGS_4	ASM_ARGS_3, "r" (_arg4) | |
| 171 | # define ASM_ARGS_5	ASM_ARGS_4, "r" (_arg5) | |
| 172 | # define ASM_ARGS_6	ASM_ARGS_5, "r" (_arg6) | |
| 173 | # define ASM_ARGS_7	ASM_ARGS_6, "r" (_arg7) | |
| 174 | ||
| 175 | /* Macros for converting sys-call wrapper args into sys call args. */ | |
| 176 | # define LOAD_ARGS_0(nm, arg)				\ | |
| 177 | _sys_num = (long int) (nm); | |
| 178 | ||
| 179 | # define LOAD_ARGS_1(nm, arg1)				\ | |
| 180 | __ret = (long int) (arg1);					\ | |
| 181 | LOAD_ARGS_0 (nm, arg1) | |
| 182 | ||
| 183 | /* Note that the use of _tmpX might look superflous, however it is needed | |
| 184 | to ensure that register variables are not clobbered if arg happens to be | |
| 185 | a function call itself. e.g. sched_setaffinity() calling getpid() for arg2 | |
| 186 | Also this specific order of recursive calling is important to segregate | |
| 187 | the tmp args evaluation (function call case described above) and assigment | |
| 188 | of register variables. */ | |
| 189 | ||
| 190 | # define LOAD_ARGS_2(nm, arg1, arg2)			\ | |
| 191 | long int _tmp2 = (long int) (arg2);			\ | |
| 192 | LOAD_ARGS_1 (nm, arg1)				\ | |
| 193 | register long int _arg2 __asm__ ("r1") = _tmp2; | |
| 194 | ||
| 195 | # define LOAD_ARGS_3(nm, arg1, arg2, arg3)		\ | |
| 196 | long int _tmp3 = (long int) (arg3);			\ | |
| 197 | LOAD_ARGS_2 (nm, arg1, arg2)				\ | |
| 198 | register long int _arg3 __asm__ ("r2") = _tmp3; | |
| 199 | ||
| 200 | #define LOAD_ARGS_4(nm, arg1, arg2, arg3, arg4)		\ | |
| 201 | long int _tmp4 = (long int) (arg4);			\ | |
| 202 | LOAD_ARGS_3 (nm, arg1, arg2, arg3)			\ | |
| 203 | register long int _arg4 __asm__ ("r3") = _tmp4; | |
| 204 | ||
| 205 | # define LOAD_ARGS_5(nm, arg1, arg2, arg3, arg4, arg5)	\ | |
| 206 | long int _tmp5 = (long int) (arg5);			\ | |
| 207 | LOAD_ARGS_4 (nm, arg1, arg2, arg3, arg4)		\ | |
| 208 | register long int _arg5 __asm__ ("r4") = _tmp5; | |
| 209 | ||
| 210 | # define LOAD_ARGS_6(nm, arg1, arg2, arg3, arg4, arg5, arg6)\ | |
| 211 | long int _tmp6 = (long int) (arg6);			\ | |
| 212 | LOAD_ARGS_5 (nm, arg1, arg2, arg3, arg4, arg5)	\ | |
| 213 | register long int _arg6 __asm__ ("r5") = _tmp6; | |
| 214 | ||
| 215 | # define LOAD_ARGS_7(nm, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\ | |
| 216 | long int _tmp7 = (int) (arg7);				\ | |
| 217 | LOAD_ARGS_6 (nm, arg1, arg2, arg3, arg4, arg5, arg6)	\ | |
| 218 | register long int _arg7 __asm__ ("r6") = _tmp7; | |
| 219 | ||
| 220 | /* Pointer mangling not yet supported. */ | |
| 221 | # define PTR_MANGLE(var) (void) (var) | |
| 222 | # define PTR_DEMANGLE(var) (void) (var) | |
| 223 | ||
| 224 | # undef HAVE_INTERNAL_BRK_ADDR_SYMBOL | |
| 225 | # define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 | |
| 226 | ||
| 227 | #endif /* !__ASSEMBLER__ */ | |
| 228 | ||
| 229 | #endif /* linux/arc/sysdep.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/arm/kernel-features.h+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. |
| 3 | Copyright (C) 2006-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 2006-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/arm/kernel_stat.h created+40| ... | ... | @@ -0,0 +1,40 @@ |
| 1 | /* Definition of `struct stat' used in the kernel.. */ | |
| 2 | struct kernel_stat | |
| 3 | { | |
| 4 | unsigned short int st_dev; | |
| 5 | unsigned short int __pad1; | |
| 6 | #define _HAVE___PAD1 | |
| 7 | unsigned long int st_ino; | |
| 8 | unsigned short int st_mode; | |
| 9 | unsigned short int st_nlink; | |
| 10 | unsigned short int st_uid; | |
| 11 | unsigned short int st_gid; | |
| 12 | unsigned short int st_rdev; | |
| 13 | unsigned short int __pad2; | |
| 14 | #define _HAVE___PAD2 | |
| 15 | unsigned long int st_size; | |
| 16 | unsigned long int st_blksize; | |
| 17 | unsigned long int st_blocks; | |
| 18 | struct timespec st_atim; | |
| 19 | struct timespec st_mtim; | |
| 20 | struct timespec st_ctim; | |
| 21 | unsigned long int __glibc_reserved4; | |
| 22 | #define _HAVE___UNUSED4 | |
| 23 | unsigned long int __glibc_reserved5; | |
| 24 | #define _HAVE___UNUSED5 | |
| 25 | }; | |
| 26 | ||
| 27 | #define _HAVE_STAT___UNUSED4 | |
| 28 | #define _HAVE_STAT___UNUSED5 | |
| 29 | #define _HAVE_STAT___PAD1 | |
| 30 | #define _HAVE_STAT___PAD2 | |
| 31 | #define _HAVE_STAT_NSEC | |
| 32 | #define _HAVE_STAT64___PAD1 | |
| 33 | #define _HAVE_STAT64___PAD2 | |
| 34 | #define _HAVE_STAT64___ST_INO | |
| 35 | #define _HAVE_STAT64_NSEC | |
| 36 | ||
| 37 | #define STAT_IS_KERNEL_STAT 0 | |
| 38 | #define STAT64_IS_KERNEL_STAT64 1 | |
| 39 | #define XSTAT_IS_XSTAT64 0 | |
| 40 | #define STATFS_IS_STATFS64 0 |
lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sys/elf.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sysdep.h+7-34| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995. |
| 4 | 4 | ARM changes by Philip Blundell, <pjb27@cam.ac.uk>, May 1997. |
| ... | ... | @@ -29,11 +29,6 @@ |
| 29 | 29 | |
| 30 | 30 | #include <tls.h> |
| 31 | 31 | |
| 32 | /* In order to get __set_errno() definition in INLINE_SYSCALL. */ | |
| 33 | #ifndef __ASSEMBLER__ | |
| 34 | #include <errno.h> | |
| 35 | #endif | |
| 36 | ||
| 37 | 32 | /* For Linux we can use the system call table in the header file |
| 38 | 33 | 	/usr/include/asm/unistd.h |
| 39 | 34 | of the kernel. But these symbols do not follow the SYS_* syntax |
| ... | ... | @@ -317,21 +312,6 @@ __local_syscall_error:						\ |
| 317 | 312 | |
| 318 | 313 | #else /* not __ASSEMBLER__ */ |
| 319 | 314 | |
| 320 | /* Define a macro which expands into the inline wrapper code for a system | |
| 321 | call. */ | |
| 322 | #undef INLINE_SYSCALL | |
| 323 | #define INLINE_SYSCALL(name, nr, args...)				\ | |
| 324 | ({ unsigned int _sys_result = INTERNAL_SYSCALL (name, , nr, args);	\ | |
| 325 | if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_sys_result, ), 0))	\ | |
| 326 | {								\ | |
| 327 | 	 __set_errno (INTERNAL_SYSCALL_ERRNO (_sys_result, ));		\ | |
| 328 | 	 _sys_result = (unsigned int) -1;				\ | |
| 329 | }								\ | |
| 330 | (int) _sys_result; }) | |
| 331 | ||
| 332 | #undef INTERNAL_SYSCALL_DECL | |
| 333 | #define INTERNAL_SYSCALL_DECL(err) do { } while (0) | |
| 334 | ||
| 335 | 315 | #if defined(__thumb__) |
| 336 | 316 | /* We can not expose the use of r7 to the compiler. GCC (as |
| 337 | 317 | of 4.5) uses r7 as the hard frame pointer for Thumb - although |
| ... | ... | @@ -348,7 +328,7 @@ __local_syscall_error:						\ |
| 348 | 328 | then unwinding will fail higher up the stack. So we move the |
| 349 | 329 | syscall out of line and provide its own unwind information. */ |
| 350 | 330 | # undef INTERNAL_SYSCALL_RAW |
| 351 | # define INTERNAL_SYSCALL_RAW(name, err, nr, args...)		\ | |
| 331 | # define INTERNAL_SYSCALL_RAW(name, nr, args...)		\ | |
| 352 | 332 | ({								\ |
| 353 | 333 | register int _a1 asm ("a1");				\ |
| 354 | 334 | int _nametmp = name;					\ |
| ... | ... | @@ -361,7 +341,7 @@ __local_syscall_error:						\ |
| 361 | 341 | _a1; }) |
| 362 | 342 | #else /* ARM */ |
| 363 | 343 | # undef INTERNAL_SYSCALL_RAW |
| 364 | # define INTERNAL_SYSCALL_RAW(name, err, nr, args...)		\ | |
| 344 | # define INTERNAL_SYSCALL_RAW(name, nr, args...)		\ | |
| 365 | 345 | ({								\ |
| 366 | 346 | register int _a1 asm ("r0"), _nr asm ("r7");		\ |
| 367 | 347 | LOAD_ARGS_##nr (args)					\ |
| ... | ... | @@ -374,15 +354,8 @@ __local_syscall_error:						\ |
| 374 | 354 | #endif |
| 375 | 355 | |
| 376 | 356 | #undef INTERNAL_SYSCALL |
| 377 | #define INTERNAL_SYSCALL(name, err, nr, args...)		\ | |
| 378 | 	INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args) | |
| 379 | ||
| 380 | #undef INTERNAL_SYSCALL_ERROR_P | |
| 381 | #define INTERNAL_SYSCALL_ERROR_P(val, err) \ | |
| 382 | ((unsigned int) (val) >= 0xfffff001u) | |
| 383 | ||
| 384 | #undef INTERNAL_SYSCALL_ERRNO | |
| 385 | #define INTERNAL_SYSCALL_ERRNO(val, err)	(-(val)) | |
| 357 | #define INTERNAL_SYSCALL(name, nr, args...)			\ | |
| 358 | 	INTERNAL_SYSCALL_RAW(SYS_ify(name), nr, args) | |
| 386 | 359 | |
| 387 | 360 | #define VDSO_NAME "LINUX_2.6" |
| 388 | 361 | #define VDSO_HASH 61765110 |
| ... | ... | @@ -434,8 +407,8 @@ __local_syscall_error:						\ |
| 434 | 407 | |
| 435 | 408 | /* For EABI, non-constant syscalls are actually pretty easy... */ |
| 436 | 409 | #undef INTERNAL_SYSCALL_NCS |
| 437 | #define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ | |
| 438 | INTERNAL_SYSCALL_RAW (number, err, nr, args) | |
| 410 | #define INTERNAL_SYSCALL_NCS(number, nr, args...) \ | |
| 411 | INTERNAL_SYSCALL_RAW (number, nr, args) | |
| 439 | 412 | |
| 440 | 413 | #define SINGLE_THREAD_BY_GLOBAL	1 |
| 441 | 414 |
lib/libc/glibc/sysdeps/unix/sysv/linux/bits/stat.h+2-114| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -22,119 +22,7 @@ |
| 22 | 22 | #ifndef _BITS_STAT_H |
| 23 | 23 | #define _BITS_STAT_H	1 |
| 24 | 24 | |
| 25 | /* Versions of the `struct stat' data structure. */ | |
| 26 | #define _STAT_VER_LINUX_OLD	1 | |
| 27 | #define _STAT_VER_KERNEL	1 | |
| 28 | #define _STAT_VER_SVR4		2 | |
| 29 | #define _STAT_VER_LINUX		3 | |
| 30 | #define _STAT_VER		_STAT_VER_LINUX	/* The one defined below. */ | |
| 31 | ||
| 32 | /* Versions of the `xmknod' interface. */ | |
| 33 | #define _MKNOD_VER_LINUX	1 | |
| 34 | #define _MKNOD_VER_SVR4		2 | |
| 35 | #define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below. */ | |
| 36 | ||
| 37 | ||
| 38 | struct stat | |
| 39 | { | |
| 40 | __dev_t st_dev;			/* Device. */ | |
| 41 | unsigned short int __pad1; | |
| 42 | #ifndef __USE_FILE_OFFSET64 | |
| 43 | __ino_t st_ino;			/* File serial number.	*/ | |
| 44 | #else | |
| 45 | __ino_t __st_ino;			/* 32bit file serial number.	*/ | |
| 46 | #endif | |
| 47 | __mode_t st_mode;			/* File mode. */ | |
| 48 | __nlink_t st_nlink;			/* Link count. */ | |
| 49 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 50 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 51 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 52 | unsigned short int __pad2; | |
| 53 | #ifndef __USE_FILE_OFFSET64 | |
| 54 | __off_t st_size;			/* Size of file, in bytes. */ | |
| 55 | #else | |
| 56 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 57 | #endif | |
| 58 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 59 | ||
| 60 | #ifndef __USE_FILE_OFFSET64 | |
| 61 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 62 | #else | |
| 63 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 64 | #endif | |
| 65 | #ifdef __USE_XOPEN2K8 | |
| 66 | /* Nanosecond resolution timestamps are stored in a format | |
| 67 | equivalent to 'struct timespec'. This is the type used | |
| 68 | whenever possible but the Unix namespace rules do not allow the | |
| 69 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 70 | Therefore we have to handle the use of this header in strictly | |
| 71 | standard-compliant sources special. */ | |
| 72 | struct timespec st_atim;		/* Time of last access. */ | |
| 73 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 74 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 75 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 76 | # define st_mtime st_mtim.tv_sec | |
| 77 | # define st_ctime st_ctim.tv_sec | |
| 78 | #else | |
| 79 | __time_t st_atime;			/* Time of last access. */ | |
| 80 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 81 | __time_t st_mtime;			/* Time of last modification. */ | |
| 82 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 83 | __time_t st_ctime;			/* Time of last status change. */ | |
| 84 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 85 | #endif | |
| 86 | #ifndef __USE_FILE_OFFSET64 | |
| 87 | unsigned long int __glibc_reserved4; | |
| 88 | unsigned long int __glibc_reserved5; | |
| 89 | #else | |
| 90 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 91 | #endif | |
| 92 | }; | |
| 93 | ||
| 94 | #ifdef __USE_LARGEFILE64 | |
| 95 | struct stat64 | |
| 96 | { | |
| 97 | __dev_t st_dev;			/* Device. */ | |
| 98 | unsigned int __pad1; | |
| 99 | ||
| 100 | __ino_t __st_ino;			/* 32bit file serial number.	*/ | |
| 101 | __mode_t st_mode;			/* File mode. */ | |
| 102 | __nlink_t st_nlink;			/* Link count. */ | |
| 103 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 104 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 105 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 106 | unsigned int __pad2; | |
| 107 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 108 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 109 | ||
| 110 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 111 | # ifdef __USE_XOPEN2K8 | |
| 112 | /* Nanosecond resolution timestamps are stored in a format | |
| 113 | equivalent to 'struct timespec'. This is the type used | |
| 114 | whenever possible but the Unix namespace rules do not allow the | |
| 115 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 116 | Therefore we have to handle the use of this header in strictly | |
| 117 | standard-compliant sources special. */ | |
| 118 | struct timespec st_atim;		/* Time of last access. */ | |
| 119 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 120 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 121 | # else | |
| 122 | __time_t st_atime;			/* Time of last access. */ | |
| 123 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 124 | __time_t st_mtime;			/* Time of last modification. */ | |
| 125 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 126 | __time_t st_ctime;			/* Time of last status change. */ | |
| 127 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 128 | # endif | |
| 129 | __ino64_t st_ino;			/* File serial number.		*/ | |
| 130 | }; | |
| 131 | #endif | |
| 132 | ||
| 133 | /* Tell code we have these members. */ | |
| 134 | #define	_STATBUF_ST_BLKSIZE | |
| 135 | #define _STATBUF_ST_RDEV | |
| 136 | /* Nanosecond resolution time values are supported. */ | |
| 137 | #define _STATBUF_ST_NSEC | |
| 25 | #include <bits/struct_stat.h> | |
| 138 | 26 | |
| 139 | 27 | /* Encoding of the file mode. */ |
| 140 | 28 |
lib/libc/glibc/sysdeps/unix/sysv/linux/bits/timex.h+32-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -25,6 +25,36 @@ |
| 25 | 25 | |
| 26 | 26 | struct timex |
| 27 | 27 | { |
| 28 | # ifdef __USE_TIME_BITS64 | |
| 29 | unsigned int modes; /* mode selector */ | |
| 30 | int :32; /* pad */ | |
| 31 | long long offset; /* time offset (usec) */ | |
| 32 | long long freq; /* frequency offset (scaled ppm) */ | |
| 33 | long long maxerror; /* maximum error (usec) */ | |
| 34 | long long esterror; /* estimated error (usec) */ | |
| 35 | int status; /* clock command/status */ | |
| 36 | int :32; /* pad */ | |
| 37 | long long constant; /* pll time constant */ | |
| 38 | long long precision; /* clock precision (usec) (read only) */ | |
| 39 | long long tolerance; /* clock frequency tolerance (ppm) (ro) */ | |
| 40 | struct timeval time; /* (read only, except for ADJ_SETOFFSET) */ | |
| 41 | long long tick; /* (modified) usecs between clock ticks */ | |
| 42 | long long ppsfreq; /* pps frequency (scaled ppm) (ro) */ | |
| 43 | long long jitter; /* pps jitter (us) (ro) */ | |
| 44 | int shift; /* interval duration (s) (shift) (ro) */ | |
| 45 | int :32; /* pad */ | |
| 46 | long long stabil; /* pps stability (scaled ppm) (ro) */ | |
| 47 | long long jitcnt; /* jitter limit exceeded (ro) */ | |
| 48 | long long calcnt; /* calibration intervals (ro) */ | |
| 49 | long long errcnt; /* calibration errors (ro) */ | |
| 50 | long long stbcnt; /* stability limit exceeded (ro) */ | |
| 51 | ||
| 52 | int tai; /* TAI offset (ro) */ | |
| 53 | ||
| 54 | int :32; int :32; int :32; int :32; | |
| 55 | int :32; int :32; int :32; int :32; | |
| 56 | int :32; int :32; int :32; | |
| 57 | # else | |
| 28 | 58 | unsigned int modes;		/* mode selector */ |
| 29 | 59 | __syscall_slong_t offset;	/* time offset (usec) */ |
| 30 | 60 | __syscall_slong_t freq;	/* frequency offset (scaled ppm) */ |
| ... | ... | @@ -51,6 +81,7 @@ struct timex |
| 51 | 81 | int :32; int :32; int :32; int :32; |
| 52 | 82 | int :32; int :32; int :32; int :32; |
| 53 | 83 | int :32; int :32; int :32; |
| 84 | # endif | |
| 54 | 85 | }; |
| 55 | 86 | |
| 56 | 87 | /* Mode codes (timex.mode) */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/csky/kernel_stat.h created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | /* Internal definitions for stat functions. Linux/csky. | |
| 2 | Copyright (C) 2011-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #define STAT_IS_KERNEL_STAT 1 | |
| 20 | #define XSTAT_IS_XSTAT64 0 | |
| 21 | #define STATFS_IS_STATFS64 0 |
lib/libc/glibc/sysdeps/unix/sysv/linux/csky/sysdep.h created+515| ... | ... | @@ -0,0 +1,515 @@ |
| 1 | /* Assembly macros for C-SKY. | |
| 2 | Copyright (C) 2018-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _LINUX_CSKY_SYSDEP_H | |
| 20 | #define _LINUX_CSKY_SYSDEP_H 1 | |
| 21 | ||
| 22 | /* There is some commonality. */ | |
| 23 | #include <sysdeps/unix/sysv/linux/generic/sysdep.h> | |
| 24 | #include <sysdeps/unix/sysv/linux/sysdep.h> | |
| 25 | #include <sysdeps/csky/sysdep.h> | |
| 26 | ||
| 27 | /* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */ | |
| 28 | #include <dl-sysdep.h> | |
| 29 | ||
| 30 | #include <tls.h> | |
| 31 | ||
| 32 | /* In order to get __set_errno() definition in INLINE_SYSCALL. */ | |
| 33 | #ifndef __ASSEMBLER__ | |
| 34 | # include <errno.h> | |
| 35 | #endif | |
| 36 | ||
| 37 | #undef SYS_ify | |
| 38 | #define SYS_ify(syscall_name) (__NR_##syscall_name) | |
| 39 | ||
| 40 | #ifdef __ASSEMBLER__ | |
| 41 | /* Linux uses a negative return value to indicate syscall errors, | |
| 42 | unlike most Unices, which use the condition codes' carry flag. | |
| 43 | ||
| 44 | Since version 2.1 the return value of a system call might be | |
| 45 | negative even if the call succeeded. E.g., the `lseek' system call | |
| 46 | might return a large offset. Therefore we must not anymore test | |
| 47 | for < 0, but test for a real error by making sure the value in R0 | |
| 48 | is a real error number. Linus said he will make sure the no syscall | |
| 49 | returns a value in -1 .. -4095 as a valid result so we can safely | |
| 50 | test with -4095. */ | |
| 51 | ||
| 52 | # undef PSEUDO | |
| 53 | # define PSEUDO(name, syscall_name, args)	\ | |
| 54 | .text;					\ | |
| 55 | ENTRY (name);					\ | |
| 56 | DO_CALL (syscall_name, args); | |
| 57 | ||
| 58 | # define GETGB				\ | |
| 59 | 	grs	t0, .Lgetpc;		\ | |
| 60 | .Lgetpc:				\ | |
| 61 | 	lrw	gb, .Lgetpc@GOTPC;	\ | |
| 62 | 	addu	gb, t0; | |
| 63 | ||
| 64 | # if IS_IN (libc) | |
| 65 | # ifdef __PIC__ | |
| 66 | # define PSEUDO_RET			\ | |
| 67 | 	btsti	a0, 31;			\ | |
| 68 | 	bf	1f;			\ | |
| 69 | 	subi	sp, 8;			\ | |
| 70 | 	st.w	lr, (sp);		\ | |
| 71 | 	st.w	gb, (sp, 4);		\ | |
| 72 | 	GETGB;				\ | |
| 73 | 	lrw	a2, SYSCALL_ERROR@PLT;	\ | |
| 74 | 	add	a2, gb;			\ | |
| 75 | 	ld.w	a2, (a2);		\ | |
| 76 | 	jsr	a2;			\ | |
| 77 | 	ld.w	lr, (sp);		\ | |
| 78 | 	ld.w	gb, (sp, 4);		\ | |
| 79 | 	addi	sp, 8;			\ | |
| 80 | 1:					\ | |
| 81 | 	rts | |
| 82 | # else | |
| 83 | # define PSEUDO_RET			\ | |
| 84 | 	btsti	a0, 31;			\ | |
| 85 | 	bf	1f;			\ | |
| 86 | 	jmpi	SYSCALL_ERROR;		\ | |
| 87 | 1:					\ | |
| 88 | 	rts | |
| 89 | # endif | |
| 90 | # else | |
| 91 | # ifdef __PIC__ | |
| 92 | # define PSEUDO_RET			\ | |
| 93 | 	btsti	a0, 31;			\ | |
| 94 | 	bf	1f;			\ | |
| 95 | 	subi	sp, 8;			\ | |
| 96 | 	st.w	lr, (sp);		\ | |
| 97 | 	st.w	gb, (sp, 4);		\ | |
| 98 | 	GETGB;				\ | |
| 99 | 	bsr	SYSCALL_ERROR;		\ | |
| 100 | 	ld.w	lr, (sp);		\ | |
| 101 | 	ld.w	gb, (sp, 4);		\ | |
| 102 | 	addi	sp, 8;			\ | |
| 103 | 1:					\ | |
| 104 | 	rts | |
| 105 | # else | |
| 106 | # define PSEUDO_RET			\ | |
| 107 | 	btsti	a0, 31;			\ | |
| 108 | 	bt	SYSCALL_ERROR;		\ | |
| 109 | 	rts | |
| 110 | # endif | |
| 111 | # endif | |
| 112 | ||
| 113 | # undef ret | |
| 114 | # define ret PSEUDO_RET | |
| 115 | ||
| 116 | # undef PSEUDO_END | |
| 117 | # define PSEUDO_END(name)		\ | |
| 118 | .align 4;				\ | |
| 119 | SYSCALL_ERROR_HANDLER;		\ | |
| 120 | END (name) | |
| 121 | ||
| 122 | # undef PSEUDO_NOERRNO | |
| 123 | # define PSEUDO_NOERRNO(name, syscall_name, args)	\ | |
| 124 | .text;						\ | |
| 125 | ENTRY (name);						\ | |
| 126 | DO_CALL (syscall_name, args) | |
| 127 | ||
| 128 | # define PSEUDO_RET_NOERRNO rts | |
| 129 | ||
| 130 | # undef ret_NOERRNO | |
| 131 | # define ret_NOERRNO PSEUDO_RET_NOERRNO | |
| 132 | ||
| 133 | # undef PSEUDO_END_NOERRNO | |
| 134 | # define PSEUDO_END_NOERRNO(name) END (name) | |
| 135 | ||
| 136 | /* The function has to return the error code. */ | |
| 137 | # undef PSEUDO_ERRVAL | |
| 138 | # define PSEUDO_ERRVAL(name, syscall_name, args)	\ | |
| 139 | .text;						\ | |
| 140 | ENTRY (name)						\ | |
| 141 | DO_CALL (syscall_name, args);				\ | |
| 142 | not	a0;						\ | |
| 143 | addi	a0, 1 | |
| 144 | ||
| 145 | # undef PSEUDO_END_ERRVAL | |
| 146 | # define PSEUDO_END_ERRVAL(name) END (name) | |
| 147 | ||
| 148 | # define ret_ERRVAL rts | |
| 149 | ||
| 150 | # if !IS_IN (libc) | |
| 151 | # define SYSCALL_ERROR __local_syscall_error | |
| 152 | # if RTLD_PRIVATE_ERRNO | |
| 153 | # ifdef __PIC__ | |
| 154 | # define SYSCALL_ERROR_HANDLER	\ | |
| 155 | __local_syscall_error:			\ | |
| 156 | 	lrw	a1, rtld_errno@PLT; 	\ | |
| 157 | 	addu	a1, gb;			\ | |
| 158 | 	ldw	a1, (a1);		\ | |
| 159 | 	rsubi	a0, 0;			\ | |
| 160 | 	stw	a0, (a1);		\ | |
| 161 | 	bmaski	a0, 0;			\ | |
| 162 | 	rts | |
| 163 | # else /* __PIC__ */ | |
| 164 | # define SYSCALL_ERROR_HANDLER	\ | |
| 165 | __local_syscall_error:			\ | |
| 166 | 	lrw	a1, rtld_errno;		\ | |
| 167 | 	rsubi	a0, 0;			\ | |
| 168 | 	stw	a0, (a1);		\ | |
| 169 | 	bmaski	a0, 0;			\ | |
| 170 | 	rts | |
| 171 | # endif /* __PIC__ */ | |
| 172 | # else /* !RTLD_PRIVATE_ERRNO */ | |
| 173 | # ifdef __PIC__ | |
| 174 | # define SYSCALL_ERROR_HANDLER		\ | |
| 175 | __local_syscall_error:				\ | |
| 176 | 	subi	sp, 8;				\ | |
| 177 | 	stw	a0, (sp, 0);			\ | |
| 178 | 	stw	r15, (sp, 4);			\ | |
| 179 | 	lrw	a1, __errno_location@PLT;	\ | |
| 180 | 	add	a1, gb;				\ | |
| 181 | 	ldw	a1, (a1);			\ | |
| 182 | 	jsr	a1;				\ | |
| 183 | 	ldw	a1, (sp, 0); /* load errno*/	\ | |
| 184 | 	ldw	r15, (sp, 4);			\ | |
| 185 | 	addi	sp, 8;				\ | |
| 186 | 	movi	a2, 0;				\ | |
| 187 | 	rsub	a1, a1, a2;			\ | |
| 188 | 	stw	a1, (a0);			\ | |
| 189 | 	bmaski	a0, 0;				\ | |
| 190 | 	rts | |
| 191 | # else | |
| 192 | # define SYSCALL_ERROR_HANDLER 		\ | |
| 193 | __local_syscall_error:				\ | |
| 194 | 	subi	sp, 8;				\ | |
| 195 | 	stw	a0, (sp, 0);			\ | |
| 196 | 	stw	r15, (sp, 4);			\ | |
| 197 | 	lrw	a1, __errno_location;		\ | |
| 198 | 	jsr	a1;				\ | |
| 199 | 	ldw	a1, (sp, 0); /* load errno */	\ | |
| 200 | 	ldw	r15, (sp, 4);			\ | |
| 201 | 	addi	sp, 8;				\ | |
| 202 | 	movi	a2, 0;				\ | |
| 203 | 	rsub	a1, a1, a2;			\ | |
| 204 | 	stw	a1, (a0);			\ | |
| 205 | 	bmaski	a0, 0;				\ | |
| 206 | 	rts | |
| 207 | # endif /* __PIC__ */ | |
| 208 | # endif/* RTLD_PRIVATE_ERROR */ | |
| 209 | # else | |
| 210 | # define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */ | |
| 211 | # define SYSCALL_ERROR __syscall_error | |
| 212 | # endif/* IS_IN (libc) */ | |
| 213 | ||
| 214 | /* define DO_CALL */ | |
| 215 | # undef DO_CALL | |
| 216 | # define DO_CALL(syscall_name, args)	\ | |
| 217 | DOARGS_##args;			\ | |
| 218 | lrw	r7, SYS_ify(syscall_name);	\ | |
| 219 | trap	0;				\ | |
| 220 | UNDOARGS_##args | |
| 221 | ||
| 222 | # undef DOARGS_0 | |
| 223 | # define DOARGS_0			\ | |
| 224 | 	subi	sp, 8;			\ | |
| 225 | 	cfi_adjust_cfa_offset (8);	\ | |
| 226 | 	stw	r7, (sp, 0);		\ | |
| 227 | 	cfi_rel_offset (r7, 0); | |
| 228 | ||
| 229 | # undef DOARGS_1 | |
| 230 | # define DOARGS_1 DOARGS_0 | |
| 231 | # undef DOARGS_2 | |
| 232 | # define DOARGS_2 DOARGS_0 | |
| 233 | # undef DOARGS_3 | |
| 234 | # define DOARGS_3 DOARGS_0 | |
| 235 | # undef DOARGS_4 | |
| 236 | # define DOARGS_4 DOARGS_0 | |
| 237 | # undef DOARGS_5 | |
| 238 | # define DOARGS_5			\ | |
| 239 | 	subi	sp, 8;			\ | |
| 240 | 	cfi_adjust_cfa_offset (8);	\ | |
| 241 | 	stw	r7, (sp, 0);		\ | |
| 242 | 	cfi_rel_offset (7, 0);		\ | |
| 243 | 	stw	r4, (sp, 4);		\ | |
| 244 | 	cfi_rel_offset (4, 4);		\ | |
| 245 | 	ldw	r4, (sp, 8) | |
| 246 | # undef DOARGS_6 | |
| 247 | # define DOARGS_6			\ | |
| 248 | 	subi	sp, 16;			\ | |
| 249 | 	cfi_adjust_cfa_offset (16);	\ | |
| 250 | 	stw	r7, (sp, 0);		\ | |
| 251 | 	cfi_rel_offset (7, 0);		\ | |
| 252 | 	stw	r4, (sp, 4);		\ | |
| 253 | 	cfi_rel_offset (4, 4);		\ | |
| 254 | 	stw	r5, (sp, 8);		\ | |
| 255 | 	cfi_rel_offset (5, 8);		\ | |
| 256 | 	ldw	r4, (sp, 16);		\ | |
| 257 | 	ldw	r5, (sp, 20) | |
| 258 | ||
| 259 | # undef UNDOARGS_0 | |
| 260 | # define UNDOARGS_0 \ | |
| 261 | ldw r7, (sp, 0); \ | |
| 262 | cfi_restore (r7); \ | |
| 263 | addi sp, 8; \ | |
| 264 | cfi_adjust_cfa_offset (-8); | |
| 265 | ||
| 266 | # undef UNDOARGS_1 | |
| 267 | # define UNDOARGS_1 UNDOARGS_0 | |
| 268 | # undef UNDOARGS_2 | |
| 269 | # define UNDOARGS_2 UNDOARGS_0 | |
| 270 | # undef UNDOARGS_3 | |
| 271 | # define UNDOARGS_3 UNDOARGS_0 | |
| 272 | # undef UNDOARGS_4 | |
| 273 | # define UNDOARGS_4 UNDOARGS_0 | |
| 274 | # undef UNDOARGS_5 | |
| 275 | # define UNDOARGS_5			\ | |
| 276 | 	ldw	r7, (sp, 0);		\ | |
| 277 | 	cfi_restore (r4);		\ | |
| 278 | 	ldw	r4, (sp, 4);		\ | |
| 279 | 	cfi_restore (r4);		\ | |
| 280 | 	addi	sp, 8;			\ | |
| 281 | 	cfi_adjust_cfa_offset (-8); | |
| 282 | ||
| 283 | # undef UNDOARGS_6 | |
| 284 | # define UNDOARGS_6			\ | |
| 285 | 	ldw	r7, (sp, 0);		\ | |
| 286 | 	cfi_restore (r7);		\ | |
| 287 | 	ldw	r4, (sp, 4);		\ | |
| 288 | 	cfi_restore (r4);		\ | |
| 289 | 	ldw	r5, (sp, 8);		\ | |
| 290 | 	cfi_restore (r5);		\ | |
| 291 | 	addi	sp, 16;			\ | |
| 292 | 	cfi_adjust_cfa_offset (-16); | |
| 293 | ||
| 294 | #else /* not __ASSEMBLER__ */ | |
| 295 | ||
| 296 | # undef INTERNAL_SYSCALL_RAW | |
| 297 | # define INTERNAL_SYSCALL_RAW0(name, dummy...)				\ | |
| 298 | ({unsigned int __sys_result;						\ | |
| 299 | {									\ | |
| 300 | register int _a1 __asm__ ("a0"), _nr __asm__ ("r7");		\ | |
| 301 | _nr = name;							\ | |
| 302 | __asm__ __volatile__ ("trap 0 \n\t"				\ | |
| 303 | 			 : "=r" (_a1)				\ | |
| 304 | 			 : "r" (_nr)				\ | |
| 305 | 			 : "memory");				\ | |
| 306 | 	 __sys_result = _a1;					\ | |
| 307 | }									\ | |
| 308 | (int) __sys_result; }) | |
| 309 | ||
| 310 | # define INTERNAL_SYSCALL_RAW1(name, arg1)				\ | |
| 311 | ({unsigned int __sys_result;						\ | |
| 312 | register int _tmp_arg1 = (int)(arg1);				\ | |
| 313 | {									\ | |
| 314 | register int _a1 __asm__ ("a0"), _nr __asm__ ("r7");		\ | |
| 315 | _a1 = _tmp_arg1;							\ | |
| 316 | _nr = name;							\ | |
| 317 | __asm__ __volatile__ ("trap 0 \n\t"				\ | |
| 318 | 			 : "=r" (_a1)				\ | |
| 319 | 			 : "r" (_nr), "r" (_a1)			\ | |
| 320 | 			 : "memory");				\ | |
| 321 | 	 __sys_result = _a1;					\ | |
| 322 | }									\ | |
| 323 | (int) __sys_result; }) | |
| 324 | ||
| 325 | # define INTERNAL_SYSCALL_RAW2(name, arg1, arg2)			\ | |
| 326 | ({unsigned int __sys_result;						\ | |
| 327 | register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2);	\ | |
| 328 | {									\ | |
| 329 | register int _nr __asm__ ("r7");					\ | |
| 330 | register int _a1 __asm__ ("a0"), _a2 __asm__ ("a1");		\ | |
| 331 | _a1 = _tmp_arg1, _a2 = _tmp_arg2;				\ | |
| 332 | _nr = name;							\ | |
| 333 | __asm__ __volatile__ ("trap 0 \n\t"				\ | |
| 334 | 			 : "=r" (_a1)				\ | |
| 335 | 			 : "r" (_nr), "r" (_a1), "r" (_a2)		\ | |
| 336 | 			 : "memory");				\ | |
| 337 | 	 __sys_result = _a1;					\ | |
| 338 | }									\ | |
| 339 | (int) __sys_result; }) | |
| 340 | ||
| 341 | # define INTERNAL_SYSCALL_RAW3(name, arg1, arg2, arg3)			\ | |
| 342 | ({unsigned int __sys_result;						\ | |
| 343 | register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2);	\ | |
| 344 | register int _tmp_arg3 = (int)(arg3);				\ | |
| 345 | {									\ | |
| 346 | register int _nr __asm__ ("r7");					\ | |
| 347 | register int _a1 __asm__ ("a0"), _a2 __asm__ ("a1");		\ | |
| 348 | register int _a3 __asm__ ("a2");					\ | |
| 349 | _a1 = _tmp_arg1;							\ | |
| 350 | _a2 = _tmp_arg2;							\ | |
| 351 | _a3 = _tmp_arg3;							\ | |
| 352 | _nr = name;							\ | |
| 353 | __asm__ __volatile__ ("trap 0 \n\t"				\ | |
| 354 | 			 : "=r" (_a1)				\ | |
| 355 | 			 : "r" (_nr), "r" (_a1), "r" (_a2),		\ | |
| 356 | 			 "r" (_a3)				\ | |
| 357 | 			 : "memory");				\ | |
| 358 | 	 __sys_result = _a1;					\ | |
| 359 | }									\ | |
| 360 | (int) __sys_result; }) | |
| 361 | ||
| 362 | # define INTERNAL_SYSCALL_RAW4(name, arg1, arg2, arg3, arg4)		\ | |
| 363 | ({unsigned int __sys_result;						\ | |
| 364 | register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2);	\ | |
| 365 | register int _tmp_arg3 = (int)(arg3), _tmp_arg4 = (int)(arg4);	\ | |
| 366 | {									\ | |
| 367 | register int _nr __asm__ ("r7");					\ | |
| 368 | register int _a1 __asm__ ("a0"), _a2 __asm__ ("a1");		\ | |
| 369 | register int _a3 __asm__ ("a2"), _a4 __asm__ ("a3");		\ | |
| 370 | _a1 = _tmp_arg1, _a2 = _tmp_arg2, _a3 = _tmp_arg3;		\ | |
| 371 | _a4 = _tmp_arg4;							\ | |
| 372 | _nr = name;							\ | |
| 373 | __asm__ __volatile__ ("trap 0 \n\t"				\ | |
| 374 | 			 : "=r" (_a1)				\ | |
| 375 | 			 : "r" (_nr), "r" (_a1), "r" (_a2),		\ | |
| 376 | 			 "r" (_a3), "r" (_a4)			\ | |
| 377 | 			 : "memory");				\ | |
| 378 | 	 __sys_result = _a1;					\ | |
| 379 | }									\ | |
| 380 | (int) __sys_result; }) | |
| 381 | ||
| 382 | # define INTERNAL_SYSCALL_RAW5(name, arg1, arg2, arg3, arg4,		\ | |
| 383 | 			 arg5)					\ | |
| 384 | ({unsigned int __sys_result;						\ | |
| 385 | register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2);	\ | |
| 386 | register int _tmp_arg3 = (int)(arg3), _tmp_arg4 = (int)(arg4);	\ | |
| 387 | register int _tmp_arg5 = (int)(arg5);				\ | |
| 388 | {									\ | |
| 389 | register int _nr __asm__ ("r7");					\ | |
| 390 | register int _a1 __asm__ ("a0"), _a2 __asm__ ("a1");		\ | |
| 391 | register int _a3 __asm__ ("a2"), _a4 __asm__ ("a3");		\ | |
| 392 | register int _a5 __asm__ ("r4");					\ | |
| 393 | _a1 = _tmp_arg1, _a2 = _tmp_arg2, _a3 = _tmp_arg3;		\ | |
| 394 | _a4 = _tmp_arg4, _a5 = _tmp_arg5;				\ | |
| 395 | _nr = name;							\ | |
| 396 | __asm__ __volatile__ ("trap 0 \n\t"				\ | |
| 397 | 			 : "=r" (_a1)				\ | |
| 398 | 			 : "r" (_nr), "r" (_a1), "r" (_a2),		\ | |
| 399 | 			 "r" (_a3), "r" (_a4), "r" (_a5)		\ | |
| 400 | 			 : "memory");				\ | |
| 401 | 	 __sys_result = _a1;					\ | |
| 402 | }									\ | |
| 403 | (int) __sys_result; }) | |
| 404 | ||
| 405 | # define INTERNAL_SYSCALL_RAW6(name, arg1, arg2, arg3, arg4,		\ | |
| 406 | 			 arg5, arg6)				\ | |
| 407 | ({unsigned int __sys_result;						\ | |
| 408 | register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2);	\ | |
| 409 | register int _tmp_arg3 = (int)(arg3), _tmp_arg4 = (int)(arg4);	\ | |
| 410 | register int _tmp_arg5 = (int)(arg5), _tmp_arg6 = (int)(arg6);	\ | |
| 411 | {									\ | |
| 412 | register int _nr __asm__ ("r7");					\ | |
| 413 | register int _a1 __asm__ ("a0"), _a2 __asm__ ("a1");		\ | |
| 414 | register int _a3 __asm__ ("a2"), _a4 __asm__ ("a3");		\ | |
| 415 | register int _a5 __asm__ ("r4"), _a6 __asm__ ("r5");		\ | |
| 416 | _a1 = _tmp_arg1, _a2 = _tmp_arg2, _a3 = _tmp_arg3;		\ | |
| 417 | _a4 = _tmp_arg4, _a5 = _tmp_arg5, _a6 = _tmp_arg6;		\ | |
| 418 | _nr = name;							\ | |
| 419 | __asm__ __volatile__ ("trap 0 \n\t"				\ | |
| 420 | 			 : "=r" (_a1)				\ | |
| 421 | 			 : "r" (_nr), "r" (_a1), "r" (_a2),		\ | |
| 422 | 			 "r" (_a3), "r" (_a4), "r" (_a5),		\ | |
| 423 | 			 "r" (_a6)				\ | |
| 424 | 			 : "memory");				\ | |
| 425 | 	 __sys_result = _a1;					\ | |
| 426 | }									\ | |
| 427 | (int) __sys_result; }) | |
| 428 | ||
| 429 | # define INTERNAL_SYSCALL_RAW7(name, arg1, arg2, arg3, arg4,		\ | |
| 430 | 			 arg5, arg6, arg7)				\ | |
| 431 | ({unsigned int __sys_result;						\ | |
| 432 | register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2);	\ | |
| 433 | register int _tmp_arg3 = (int)(arg3), _tmp_arg4 = (int)(arg4);	\ | |
| 434 | register int _tmp_arg5 = (int)(arg5), _tmp_arg6 = (int)(arg6);	\ | |
| 435 | register int _tmp_arg7 = (int)(arg7);				\ | |
| 436 | {									\ | |
| 437 | register int _nr __asm__ ("r7");					\ | |
| 438 | register int _a1 __asm__ ("a0"), _a2 __asm__ ("a1");		\ | |
| 439 | register int _a3 __asm__ ("a2"), _a4 __asm__ ("a3");		\ | |
| 440 | register int _a5 __asm__ ("r4"), _a6 __asm__ ("r5");		\ | |
| 441 | register int _a7 __asm__ ("r6");					\ | |
| 442 | _a1 = _tmp_arg1, _a2 = _tmp_arg2, _a3 = _tmp_arg3;		\ | |
| 443 | _a4 = _tmp_arg4, _a5 = _tmp_arg5, _a6 = _tmp_arg6;		\ | |
| 444 | _a7 = _tmp_arg7;							\ | |
| 445 | _nr = name;							\ | |
| 446 | __asm__ __volatile__ ("trap 0 \n\t"				\ | |
| 447 | 			 : "=r" (_a1)				\ | |
| 448 | 			 : "r" (_nr), "r" (_a1), "r" (_a2),		\ | |
| 449 | 			 "r" (_a3), "r" (_a4), "r" (_a5),		\ | |
| 450 | 			 "r" (_a6), "r" (_a7)			\ | |
| 451 | 			 : "memory");				\ | |
| 452 | 	 __sys_result = _a1;					\ | |
| 453 | }									\ | |
| 454 | (int) __sys_result; }) | |
| 455 | ||
| 456 | # undef INTERNAL_SYSCALL | |
| 457 | # define INTERNAL_SYSCALL(name, nr, args...)			\ | |
| 458 | INTERNAL_SYSCALL_RAW##nr(SYS_ify(name), args) | |
| 459 | ||
| 460 | # undef INTERNAL_SYSCALL_NCS | |
| 461 | # define INTERNAL_SYSCALL_NCS(number, nr, args...)		\ | |
| 462 | INTERNAL_SYSCALL_RAW##nr (number, args) | |
| 463 | ||
| 464 | #undef HAVE_INTERNAL_BRK_ADDR_SYMBOL | |
| 465 | #define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 | |
| 466 | ||
| 467 | #endif /* __ASSEMBLER__ */ | |
| 468 | ||
| 469 | /* Pointer mangling support. */ | |
| 470 | #if (IS_IN (rtld) \ | |
| 471 | || (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread)))) | |
| 472 | # ifdef __ASSEMBLER__ | |
| 473 | # define PTR_MANGLE(dst, src, guard)			\ | |
| 474 | 	grs	t0, 1f;					\ | |
| 475 | 1:							\ | |
| 476 | 	lrw	guard, 1b@GOTPC;			\ | |
| 477 | 	addu	t0, guard;				\ | |
| 478 | 	lrw	guard, __pointer_chk_guard_local@GOT;	\ | |
| 479 | 	ldr.w	guard, (t0, guard << 0);		\ | |
| 480 | 	ldw	guard, (guard, 0);			\ | |
| 481 | 	xor	dst, src, guard; | |
| 482 | # define PTR_DEMANGLE(dst, src, guard) PTR_MANGLE (dst, src, guard) | |
| 483 | # define PTR_MANGLE2(dst, src, guard) \ | |
| 484 | 	xor	dst, src, guard | |
| 485 | # define PTR_DEMANGLE2(dst, src, guard) PTR_MANGLE2 (dst, src, guard) | |
| 486 | # else | |
| 487 | extern uintptr_t __pointer_chk_guard_local; | |
| 488 | # define PTR_MANGLE(var) \ | |
| 489 | (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local) | |
| 490 | # define PTR_DEMANGLE(var) PTR_MANGLE (var) | |
| 491 | # endif | |
| 492 | #else | |
| 493 | # ifdef __ASSEMBLER__ | |
| 494 | # define PTR_MANGLE(dst, src, guard)		\ | |
| 495 | 	grs	t0, 1f;				\ | |
| 496 | 1:						\ | |
| 497 | 	lrw	guard, 1b@GOTPC;		\ | |
| 498 | 	addu	t0, guard;			\ | |
| 499 | 	lrw	guard, __pointer_chk_guard@GOT;	\ | |
| 500 | 	ldr.w	guard, (t0, guard << 0);	\ | |
| 501 | 	ldw	guard, (guard, 0);		\ | |
| 502 | 	xor	dst, src, guard; | |
| 503 | # define PTR_DEMANGLE(dst, src, guard) PTR_MANGLE (dst, src, guard) | |
| 504 | # define PTR_MANGLE2(dst, src, guard) \ | |
| 505 | 	xor	dst, src, guard | |
| 506 | # define PTR_DEMANGLE2(dst, src, guard) PTR_MANGLE2 (dst, src, guard) | |
| 507 | # else | |
| 508 | extern uintptr_t __pointer_chk_guard; | |
| 509 | # define PTR_MANGLE(var) \ | |
| 510 | (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard) | |
| 511 | # define PTR_DEMANGLE(var) PTR_MANGLE (var) | |
| 512 | # endif | |
| 513 | #endif | |
| 514 | ||
| 515 | #endif /* linux/csky/sysdep.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/dl-sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* System-specific settings for dynamic linker code. Linux version. |
| 2 | Copyright (C) 2005-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/fstat.c created+37| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | /* Get file status. Linux version. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <sys/stat.h> | |
| 20 | #include <kernel_stat.h> | |
| 21 | #include <fcntl.h> | |
| 22 | #include <errno.h> | |
| 23 | ||
| 24 | #if !XSTAT_IS_XSTAT64 | |
| 25 | int | |
| 26 | __fstat (int fd, struct stat *buf) | |
| 27 | { | |
| 28 | if (fd < 0) | |
| 29 | { | |
| 30 | __set_errno (EBADF); | |
| 31 | return -1; | |
| 32 | } | |
| 33 | return __fstatat (fd, "", buf, AT_EMPTY_PATH); | |
| 34 | } | |
| 35 | ||
| 36 | weak_alias (__fstat, fstat) | |
| 37 | #endif |
lib/libc/glibc/sysdeps/unix/sysv/linux/fstat64.c created+64| ... | ... | @@ -0,0 +1,64 @@ |
| 1 | /* Get file status. Linux version. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #define __fstat __redirect___fstat | |
| 20 | #define fstat __redirect_fstat | |
| 21 | #include <sys/stat.h> | |
| 22 | #include <fcntl.h> | |
| 23 | #include <kernel_stat.h> | |
| 24 | #include <stat_t64_cp.h> | |
| 25 | #include <errno.h> | |
| 26 | ||
| 27 | int | |
| 28 | __fstat64_time64 (int fd, struct __stat64_t64 *buf) | |
| 29 | { | |
| 30 | if (fd < 0) | |
| 31 | { | |
| 32 | __set_errno (EBADF); | |
| 33 | return -1; | |
| 34 | } | |
| 35 | return __fstatat64_time64 (fd, "", buf, AT_EMPTY_PATH); | |
| 36 | } | |
| 37 | #if __TIMESIZE != 64 | |
| 38 | hidden_def (__fstat64_time64) | |
| 39 | ||
| 40 | int | |
| 41 | __fstat64 (int fd, struct stat64 *buf) | |
| 42 | { | |
| 43 | if (fd < 0) | |
| 44 | { | |
| 45 | __set_errno (EBADF); | |
| 46 | return -1; | |
| 47 | } | |
| 48 | ||
| 49 | struct __stat64_t64 st_t64; | |
| 50 | return __fstat64_time64 (fd, &st_t64) | |
| 51 | 	 ?: __cp_stat64_t64_stat64 (&st_t64, buf); | |
| 52 | } | |
| 53 | #endif | |
| 54 | ||
| 55 | #undef __fstat | |
| 56 | #undef fstat | |
| 57 | ||
| 58 | hidden_def (__fstat64) | |
| 59 | weak_alias (__fstat64, fstat64) | |
| 60 | ||
| 61 | #if XSTAT_IS_XSTAT64 | |
| 62 | strong_alias (__fstat64, __fstat) | |
| 63 | weak_alias (__fstat64, fstat) | |
| 64 | #endif |
lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat.c created+82| ... | ... | @@ -0,0 +1,82 @@ |
| 1 | /* Get file status. Linux version. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <inttypes.h> | |
| 20 | #include <sys/stat.h> | |
| 21 | #include <kernel_stat.h> | |
| 22 | #include <sysdep.h> | |
| 23 | #include <string.h> | |
| 24 | ||
| 25 | #if !XSTAT_IS_XSTAT64 | |
| 26 | # include <kstat_cp.h> | |
| 27 | ||
| 28 | static inline bool | |
| 29 | in_time_t_range (__time64_t t) | |
| 30 | { | |
| 31 | time_t s = t; | |
| 32 | return s == t; | |
| 33 | } | |
| 34 | ||
| 35 | static inline struct timespec | |
| 36 | valid_timespec64_to_timespec (const struct __timespec64 ts64) | |
| 37 | { | |
| 38 | struct timespec ts; | |
| 39 | ||
| 40 | ts.tv_sec = (time_t) ts64.tv_sec; | |
| 41 | ts.tv_nsec = ts64.tv_nsec; | |
| 42 | ||
| 43 | return ts; | |
| 44 | } | |
| 45 | ||
| 46 | int | |
| 47 | __fstatat (int fd, const char *file, struct stat *buf, int flag) | |
| 48 | { | |
| 49 | struct __stat64_t64 st64; | |
| 50 | int r = __fstatat64_time64 (fd, file, &st64, flag); | |
| 51 | if (r == 0) | |
| 52 | { | |
| 53 | if (! in_ino_t_range (st64.st_ino) | |
| 54 | 	 || ! in_off_t_range (st64.st_size) | |
| 55 | 	 || ! in_blkcnt_t_range (st64.st_blocks) | |
| 56 | 	 || ! in_time_t_range (st64.st_atim.tv_sec) | |
| 57 | 	 || ! in_time_t_range (st64.st_mtim.tv_sec) | |
| 58 | 	 || ! in_time_t_range (st64.st_ctim.tv_sec)) | |
| 59 | 	return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW); | |
| 60 | ||
| 61 | /* Clear internal pad and reserved fields. */ | |
| 62 | memset (buf, 0, sizeof (*buf)); | |
| 63 | ||
| 64 | buf->st_dev = st64.st_dev; | |
| 65 | buf->st_ino = st64.st_ino; | |
| 66 | buf->st_mode = st64.st_mode; | |
| 67 | buf->st_nlink = st64.st_nlink; | |
| 68 | buf->st_uid = st64.st_uid; | |
| 69 | buf->st_gid = st64.st_gid; | |
| 70 | buf->st_rdev = st64.st_rdev; | |
| 71 | buf->st_size = st64.st_size; | |
| 72 | buf->st_blksize = st64.st_blksize; | |
| 73 | buf->st_blocks = st64.st_blocks; | |
| 74 | buf->st_atim = valid_timespec64_to_timespec (st64.st_atim); | |
| 75 | buf->st_mtim = valid_timespec64_to_timespec (st64.st_mtim); | |
| 76 | buf->st_ctim = valid_timespec64_to_timespec (st64.st_ctim); | |
| 77 | } | |
| 78 | return r; | |
| 79 | } | |
| 80 | ||
| 81 | weak_alias (__fstatat, fstatat) | |
| 82 | #endif |
lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat64.c created+200| ... | ... | @@ -0,0 +1,200 @@ |
| 1 | /* Get file status. Linux version. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #define __fstatat __redirect___fstatat | |
| 20 | #define fstatat __redirect_fstatat | |
| 21 | #include <inttypes.h> | |
| 22 | #include <sys/stat.h> | |
| 23 | #include <fcntl.h> | |
| 24 | #include <string.h> | |
| 25 | #include <kernel_stat.h> | |
| 26 | #include <sysdep.h> | |
| 27 | #include <time.h> | |
| 28 | #include <kstat_cp.h> | |
| 29 | #include <stat_t64_cp.h> | |
| 30 | #include <sys/sysmacros.h> | |
| 31 | ||
| 32 | #if __TIMESIZE == 64 \ | |
| 33 | && (__WORDSIZE == 32 \ | |
| 34 | && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) | |
| 35 | /* Sanity check to avoid newer 32-bit ABI to support non-LFS calls. */ | |
| 36 | _Static_assert (sizeof (__off_t) == sizeof (__off64_t), | |
| 37 | "__blkcnt_t and __blkcnt64_t must match"); | |
| 38 | _Static_assert (sizeof (__ino_t) == sizeof (__ino64_t), | |
| 39 | "__blkcnt_t and __blkcnt64_t must match"); | |
| 40 | _Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t), | |
| 41 | "__blkcnt_t and __blkcnt64_t must match"); | |
| 42 | #endif | |
| 43 | ||
| 44 | static inline int | |
| 45 | fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf, | |
| 46 | 			int flag) | |
| 47 | { | |
| 48 | /* 32-bit kABI with default 64-bit time_t, e.g. arc, riscv32. Also | |
| 49 | 64-bit time_t support is done through statx syscall. */ | |
| 50 | struct statx tmp; | |
| 51 | int r = INTERNAL_SYSCALL_CALL (statx, fd, file, AT_NO_AUTOMOUNT | flag, | |
| 52 | 				 STATX_BASIC_STATS, &tmp); | |
| 53 | if (r != 0) | |
| 54 | return r; | |
| 55 | ||
| 56 | *buf = (struct __stat64_t64) { | |
| 57 | .st_dev = gnu_dev_makedev (tmp.stx_dev_major, tmp.stx_dev_minor), | |
| 58 | .st_rdev = gnu_dev_makedev (tmp.stx_rdev_major, tmp.stx_rdev_minor), | |
| 59 | .st_ino = tmp.stx_ino, | |
| 60 | .st_mode = tmp.stx_mode, | |
| 61 | .st_nlink = tmp.stx_nlink, | |
| 62 | .st_uid = tmp.stx_uid, | |
| 63 | .st_gid = tmp.stx_gid, | |
| 64 | .st_atime = tmp.stx_atime.tv_sec, | |
| 65 | .st_atim.tv_nsec = tmp.stx_atime.tv_nsec, | |
| 66 | .st_mtime = tmp.stx_mtime.tv_sec, | |
| 67 | .st_mtim.tv_nsec = tmp.stx_mtime.tv_nsec, | |
| 68 | .st_ctime = tmp.stx_ctime.tv_sec, | |
| 69 | .st_ctim.tv_nsec = tmp.stx_ctime.tv_nsec, | |
| 70 | .st_size = tmp.stx_size, | |
| 71 | .st_blocks = tmp.stx_blocks, | |
| 72 | .st_blksize = tmp.stx_blksize, | |
| 73 | }; | |
| 74 | ||
| 75 | return r; | |
| 76 | } | |
| 77 | ||
| 78 | static inline struct __timespec64 | |
| 79 | valid_timespec_to_timespec64 (const struct timespec ts) | |
| 80 | { | |
| 81 | struct __timespec64 ts64; | |
| 82 | ||
| 83 | ts64.tv_sec = ts.tv_sec; | |
| 84 | ts64.tv_nsec = ts.tv_nsec; | |
| 85 | ||
| 86 | return ts64; | |
| 87 | } | |
| 88 | ||
| 89 | static inline int | |
| 90 | fstatat64_time64_stat (int fd, const char *file, struct __stat64_t64 *buf, | |
| 91 | 		 int flag) | |
| 92 | { | |
| 93 | int r; | |
| 94 | ||
| 95 | #if XSTAT_IS_XSTAT64 | |
| 96 | # ifdef __NR_newfstatat | |
| 97 | /* 64-bit kABI, e.g. aarch64, ia64, powerpc64*, s390x, riscv64, and | |
| 98 | x86_64. */ | |
| 99 | r = INTERNAL_SYSCALL_CALL (newfstatat, fd, file, buf, flag); | |
| 100 | # elif defined __NR_fstatat64 | |
| 101 | # if STAT64_IS_KERNEL_STAT64 | |
| 102 | /* 64-bit kABI outlier, e.g. alpha */ | |
| 103 | r = INTERNAL_SYSCALL_CALL (fstatat64, fd, file, buf, flag); | |
| 104 | # else | |
| 105 | /* 64-bit kABI outlier, e.g. sparc64. */ | |
| 106 | struct kernel_stat64 kst64; | |
| 107 | r = INTERNAL_SYSCALL_CALL (fstatat64, fd, file, &kst64, flag); | |
| 108 | if (r == 0) | |
| 109 | __cp_stat64_kstat64 (buf, &kst64); | |
| 110 | # endif | |
| 111 | # endif | |
| 112 | #else | |
| 113 | # ifdef __NR_fstatat64 | |
| 114 | /* All kABIs with non-LFS support and with old 32-bit time_t support | |
| 115 | e.g. arm, csky, i386, hppa, m68k, microblaze, nios2, sh, powerpc32, | |
| 116 | and sparc32. */ | |
| 117 | struct stat64 st64; | |
| 118 | r = INTERNAL_SYSCALL_CALL (fstatat64, fd, file, &st64, flag); | |
| 119 | if (r == 0) | |
| 120 | { | |
| 121 | /* Clear both pad and reserved fields. */ | |
| 122 | memset (buf, 0, sizeof (*buf)); | |
| 123 | ||
| 124 | buf->st_dev = st64.st_dev, | |
| 125 | buf->st_ino = st64.st_ino; | |
| 126 | buf->st_mode = st64.st_mode; | |
| 127 | buf->st_nlink = st64.st_nlink; | |
| 128 | buf->st_uid = st64.st_uid; | |
| 129 | buf->st_gid = st64.st_gid; | |
| 130 | buf->st_rdev = st64.st_rdev; | |
| 131 | buf->st_size = st64.st_size; | |
| 132 | buf->st_blksize = st64.st_blksize; | |
| 133 | buf->st_blocks = st64.st_blocks; | |
| 134 | buf->st_atim = valid_timespec_to_timespec64 (st64.st_atim); | |
| 135 | buf->st_mtim = valid_timespec_to_timespec64 (st64.st_mtim); | |
| 136 | buf->st_ctim = valid_timespec_to_timespec64 (st64.st_ctim); | |
| 137 | } | |
| 138 | # else | |
| 139 | /* 64-bit kabi outlier, e.g. mips64 and mips64-n32. */ | |
| 140 | struct kernel_stat kst; | |
| 141 | r = INTERNAL_SYSCALL_CALL (newfstatat, fd, file, &kst, flag); | |
| 142 | if (r == 0) | |
| 143 | __cp_kstat_stat64_t64 (&kst, buf); | |
| 144 | # endif | |
| 145 | #endif | |
| 146 | ||
| 147 | return r; | |
| 148 | } | |
| 149 | ||
| 150 | #if (__WORDSIZE == 32 \ | |
| 151 | && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \ | |
| 152 | || defined STAT_HAS_TIME32 | |
| 153 | # define FSTATAT_USE_STATX 1 | |
| 154 | #else | |
| 155 | # define FSTATAT_USE_STATX 0 | |
| 156 | #endif | |
| 157 | ||
| 158 | int | |
| 159 | __fstatat64_time64 (int fd, const char *file, struct __stat64_t64 *buf, | |
| 160 | 		 int flag) | |
| 161 | { | |
| 162 | int r; | |
| 163 | ||
| 164 | #if FSTATAT_USE_STATX | |
| 165 | r = fstatat64_time64_statx (fd, file, buf, flag); | |
| 166 | # ifndef __ASSUME_STATX | |
| 167 | if (r == -ENOSYS) | |
| 168 | r = fstatat64_time64_stat (fd, file, buf, flag); | |
| 169 | # endif | |
| 170 | #else | |
| 171 | r = fstatat64_time64_stat (fd, file, buf, flag); | |
| 172 | #endif | |
| 173 | ||
| 174 | return INTERNAL_SYSCALL_ERROR_P (r) | |
| 175 | 	 ? INLINE_SYSCALL_ERROR_RETURN_VALUE (-r) | |
| 176 | 	 : 0; | |
| 177 | } | |
| 178 | #if __TIMESIZE != 64 | |
| 179 | hidden_def (__fstatat64_time64) | |
| 180 | ||
| 181 | int | |
| 182 | __fstatat64 (int fd, const char *file, struct stat64 *buf, int flags) | |
| 183 | { | |
| 184 | struct __stat64_t64 st_t64; | |
| 185 | return __fstatat64_time64 (fd, file, &st_t64, flags) | |
| 186 | 	 ?: __cp_stat64_t64_stat64 (&st_t64, buf); | |
| 187 | } | |
| 188 | #endif | |
| 189 | ||
| 190 | #undef __fstatat | |
| 191 | #undef fstatat | |
| 192 | ||
| 193 | hidden_def (__fstatat64) | |
| 194 | weak_alias (__fstatat64, fstatat64) | |
| 195 | ||
| 196 | #if XSTAT_IS_XSTAT64 | |
| 197 | strong_alias (__fstatat64, __fstatat) | |
| 198 | weak_alias (__fstatat64, fstatat) | |
| 199 | strong_alias (__fstatat64, __GI___fstatat); | |
| 200 | #endif |
lib/libc/glibc/sysdeps/unix/sysv/linux/generic/bits/stat.h deleted-174| ... | ... | @@ -1,174 +0,0 @@ |
| 1 | /* Copyright (C) 2011-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #if !defined _SYS_STAT_H && !defined _FCNTL_H | |
| 20 | # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifndef _BITS_STAT_H | |
| 24 | #define _BITS_STAT_H	1 | |
| 25 | ||
| 26 | #include <bits/endian.h> | |
| 27 | #include <bits/wordsize.h> | |
| 28 | ||
| 29 | /* 64-bit libc uses the kernel's 'struct stat', accessed via the | |
| 30 | stat() syscall; 32-bit libc uses the kernel's 'struct stat64' | |
| 31 | and accesses it via the stat64() syscall. All the various | |
| 32 | APIs offered by libc use the kernel shape for their struct stat | |
| 33 | structure; the only difference is that 32-bit programs not | |
| 34 | using __USE_FILE_OFFSET64 only see the low 32 bits of some | |
| 35 | of the fields (specifically st_ino, st_size, and st_blocks). */ | |
| 36 | #define _STAT_VER_KERNEL	0 | |
| 37 | #define _STAT_VER_LINUX		0 | |
| 38 | #define _STAT_VER		_STAT_VER_KERNEL | |
| 39 | ||
| 40 | /* Versions of the `xmknod' interface. */ | |
| 41 | #define _MKNOD_VER_LINUX	0 | |
| 42 | ||
| 43 | #if defined __USE_FILE_OFFSET64 | |
| 44 | # define __field64(type, type64, name) type64 name | |
| 45 | #elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T | |
| 46 | # if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T | |
| 47 | # error "ino_t and off_t must both be the same type" | |
| 48 | # endif | |
| 49 | # define __field64(type, type64, name) type name | |
| 50 | #elif __BYTE_ORDER == __LITTLE_ENDIAN | |
| 51 | # define __field64(type, type64, name) \ | |
| 52 | type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad | |
| 53 | #else | |
| 54 | # define __field64(type, type64, name) \ | |
| 55 | int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name | |
| 56 | #endif | |
| 57 | ||
| 58 | struct stat | |
| 59 | { | |
| 60 | __dev_t st_dev;		/* Device. */ | |
| 61 | __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */ | |
| 62 | __mode_t st_mode;		/* File mode. */ | |
| 63 | __nlink_t st_nlink;		/* Link count. */ | |
| 64 | __uid_t st_uid;		/* User ID of the file's owner.	*/ | |
| 65 | __gid_t st_gid;		/* Group ID of the file's group.*/ | |
| 66 | __dev_t st_rdev;		/* Device number, if device. */ | |
| 67 | __dev_t __pad1; | |
| 68 | __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */ | |
| 69 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ | |
| 70 | int __pad2; | |
| 71 | __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */ | |
| 72 | #ifdef __USE_XOPEN2K8 | |
| 73 | /* Nanosecond resolution timestamps are stored in a format | |
| 74 | equivalent to 'struct timespec'. This is the type used | |
| 75 | whenever possible but the Unix namespace rules do not allow the | |
| 76 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 77 | Therefore we have to handle the use of this header in strictly | |
| 78 | standard-compliant sources special. */ | |
| 79 | struct timespec st_atim;		/* Time of last access. */ | |
| 80 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 81 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 82 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 83 | # define st_mtime st_mtim.tv_sec | |
| 84 | # define st_ctime st_ctim.tv_sec | |
| 85 | #else | |
| 86 | __time_t st_atime;			/* Time of last access. */ | |
| 87 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 88 | __time_t st_mtime;			/* Time of last modification. */ | |
| 89 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 90 | __time_t st_ctime;			/* Time of last status change. */ | |
| 91 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 92 | #endif | |
| 93 | int __glibc_reserved[2]; | |
| 94 | }; | |
| 95 | ||
| 96 | #undef __field64 | |
| 97 | ||
| 98 | #ifdef __USE_LARGEFILE64 | |
| 99 | struct stat64 | |
| 100 | { | |
| 101 | __dev_t st_dev;		/* Device. */ | |
| 102 | __ino64_t st_ino;		/* File serial number.	*/ | |
| 103 | __mode_t st_mode;		/* File mode. */ | |
| 104 | __nlink_t st_nlink;		/* Link count. */ | |
| 105 | __uid_t st_uid;		/* User ID of the file's owner.	*/ | |
| 106 | __gid_t st_gid;		/* Group ID of the file's group.*/ | |
| 107 | __dev_t st_rdev;		/* Device number, if device. */ | |
| 108 | __dev_t __pad1; | |
| 109 | __off64_t st_size;		/* Size of file, in bytes. */ | |
| 110 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ | |
| 111 | int __pad2; | |
| 112 | __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated. */ | |
| 113 | #ifdef __USE_XOPEN2K8 | |
| 114 | /* Nanosecond resolution timestamps are stored in a format | |
| 115 | equivalent to 'struct timespec'. This is the type used | |
| 116 | whenever possible but the Unix namespace rules do not allow the | |
| 117 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 118 | Therefore we have to handle the use of this header in strictly | |
| 119 | standard-compliant sources special. */ | |
| 120 | struct timespec st_atim;		/* Time of last access. */ | |
| 121 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 122 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 123 | #else | |
| 124 | __time_t st_atime;			/* Time of last access. */ | |
| 125 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 126 | __time_t st_mtime;			/* Time of last modification. */ | |
| 127 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 128 | __time_t st_ctime;			/* Time of last status change. */ | |
| 129 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 130 | #endif | |
| 131 | int __glibc_reserved[2]; | |
| 132 | }; | |
| 133 | #endif | |
| 134 | ||
| 135 | /* Tell code we have these members. */ | |
| 136 | #define	_STATBUF_ST_BLKSIZE | |
| 137 | #define _STATBUF_ST_RDEV | |
| 138 | /* Nanosecond resolution time values are supported. */ | |
| 139 | #define _STATBUF_ST_NSEC | |
| 140 | ||
| 141 | /* Encoding of the file mode. */ | |
| 142 | ||
| 143 | #define	__S_IFMT	0170000	/* These bits determine file type. */ | |
| 144 | ||
| 145 | /* File types. */ | |
| 146 | #define	__S_IFDIR	0040000	/* Directory. */ | |
| 147 | #define	__S_IFCHR	0020000	/* Character device. */ | |
| 148 | #define	__S_IFBLK	0060000	/* Block device. */ | |
| 149 | #define	__S_IFREG	0100000	/* Regular file. */ | |
| 150 | #define	__S_IFIFO	0010000	/* FIFO. */ | |
| 151 | #define	__S_IFLNK	0120000	/* Symbolic link. */ | |
| 152 | #define	__S_IFSOCK	0140000	/* Socket. */ | |
| 153 | ||
| 154 | /* POSIX.1b objects. Note that these macros always evaluate to zero. But | |
| 155 | they do it by enforcing the correct use of the macros. */ | |
| 156 | #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 157 | #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 158 | #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 159 | ||
| 160 | /* Protection bits. */ | |
| 161 | ||
| 162 | #define	__S_ISUID	04000	/* Set user ID on execution. */ | |
| 163 | #define	__S_ISGID	02000	/* Set group ID on execution. */ | |
| 164 | #define	__S_ISVTX	01000	/* Save swapped text after use (sticky). */ | |
| 165 | #define	__S_IREAD	0400	/* Read by owner. */ | |
| 166 | #define	__S_IWRITE	0200	/* Write by owner. */ | |
| 167 | #define	__S_IEXEC	0100	/* Execute by owner. */ | |
| 168 | ||
| 169 | #ifdef __USE_ATFILE | |
| 170 | # define UTIME_NOW	((1l << 30) - 1l) | |
| 171 | # define UTIME_OMIT	((1l << 30) - 2l) | |
| 172 | #endif | |
| 173 | ||
| 174 | #endif /* bits/stat.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/generic/bits/typesizes.h+30-10| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI. |
| 2 | Copyright (C) 2011-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2011-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. |
| 5 | 5 | |
| ... | ... | @@ -26,31 +26,45 @@ |
| 26 | 26 | |
| 27 | 27 | /* See <bits/types.h> for the meaning of these macros. This file exists so |
| 28 | 28 | that <bits/types.h> need not vary across different GNU platforms. */ |
| 29 | #if __TIMESIZE == 64 && __WORDSIZE == 32 | |
| 30 | /* These are the "new" y2038 types defined for architectures added after | |
| 31 | the 5.1 kernel. */ | |
| 32 | # define __INO_T_TYPE		__UQUAD_TYPE | |
| 33 | # define __OFF_T_TYPE		__SQUAD_TYPE | |
| 34 | # define __RLIM_T_TYPE		__UQUAD_TYPE | |
| 35 | # define __BLKCNT_T_TYPE	__SQUAD_TYPE | |
| 36 | # define __FSBLKCNT_T_TYPE	__UQUAD_TYPE | |
| 37 | # define __FSFILCNT_T_TYPE	__UQUAD_TYPE | |
| 38 | # define __TIME_T_TYPE		__SQUAD_TYPE | |
| 39 | # define __SUSECONDS_T_TYPE	__SQUAD_TYPE | |
| 40 | #else | |
| 41 | # define __INO_T_TYPE		__ULONGWORD_TYPE | |
| 42 | # define __OFF_T_TYPE		__SLONGWORD_TYPE | |
| 43 | # define __RLIM_T_TYPE		__ULONGWORD_TYPE | |
| 44 | # define __BLKCNT_T_TYPE	__SLONGWORD_TYPE | |
| 45 | # define __FSBLKCNT_T_TYPE	__ULONGWORD_TYPE | |
| 46 | # define __FSFILCNT_T_TYPE	__ULONGWORD_TYPE | |
| 47 | # define __TIME_T_TYPE		__SLONGWORD_TYPE | |
| 48 | # define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE | |
| 49 | #endif | |
| 29 | 50 | |
| 30 | 51 | #define __DEV_T_TYPE		__UQUAD_TYPE |
| 31 | 52 | #define __UID_T_TYPE		__U32_TYPE |
| 32 | 53 | #define __GID_T_TYPE		__U32_TYPE |
| 33 | #define __INO_T_TYPE		__ULONGWORD_TYPE | |
| 34 | 54 | #define __INO64_T_TYPE		__UQUAD_TYPE |
| 35 | 55 | #define __MODE_T_TYPE		__U32_TYPE |
| 36 | 56 | #define __NLINK_T_TYPE		__U32_TYPE |
| 37 | #define __OFF_T_TYPE		__SLONGWORD_TYPE | |
| 38 | 57 | #define __OFF64_T_TYPE		__SQUAD_TYPE |
| 39 | 58 | #define __PID_T_TYPE		__S32_TYPE |
| 40 | #define __RLIM_T_TYPE		__ULONGWORD_TYPE | |
| 41 | 59 | #define __RLIM64_T_TYPE		__UQUAD_TYPE |
| 42 | #define	__BLKCNT_T_TYPE		__SLONGWORD_TYPE | |
| 43 | 60 | #define	__BLKCNT64_T_TYPE	__SQUAD_TYPE |
| 44 | #define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE | |
| 45 | 61 | #define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE |
| 46 | #define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE | |
| 47 | 62 | #define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE |
| 48 | 63 | #define	__FSWORD_T_TYPE		__SWORD_TYPE |
| 49 | 64 | #define	__ID_T_TYPE		__U32_TYPE |
| 50 | 65 | #define __CLOCK_T_TYPE		__SLONGWORD_TYPE |
| 51 | #define __TIME_T_TYPE		__SLONGWORD_TYPE | |
| 52 | 66 | #define __USECONDS_T_TYPE	__U32_TYPE |
| 53 | #define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE | |
| 67 | #define __SUSECONDS64_T_TYPE	__SQUAD_TYPE | |
| 54 | 68 | #define __DADDR_T_TYPE		__S32_TYPE |
| 55 | 69 | #define __KEY_T_TYPE		__S32_TYPE |
| 56 | 70 | #define __CLOCKID_T_TYPE	__S32_TYPE |
| ... | ... | @@ -62,7 +76,7 @@ |
| 62 | 76 | #define __SYSCALL_ULONG_TYPE	__ULONGWORD_TYPE |
| 63 | 77 | #define __CPU_MASK_TYPE 	__ULONGWORD_TYPE |
| 64 | 78 | |
| 65 | #ifdef __LP64__ | |
| 79 | #if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) | |
| 66 | 80 | /* Tell the libc code that off_t and off64_t are actually the same type |
| 67 | 81 | for all ABI purposes, even if possibly expressed as different base types |
| 68 | 82 | for C type-checking purposes. */ |
| ... | ... | @@ -76,11 +90,17 @@ |
| 76 | 90 | |
| 77 | 91 | /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ |
| 78 | 92 | # define __STATFS_MATCHES_STATFS64 1 |
| 93 | ||
| 94 | /* And for getitimer, setitimer and rusage */ | |
| 95 | # define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64) | |
| 79 | 96 | #else |
| 80 | 97 | # define __RLIM_T_MATCHES_RLIM64_T	0 |
| 81 | 98 | |
| 82 | 99 | # define __STATFS_MATCHES_STATFS64 0 |
| 100 | ||
| 101 | # define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 | |
| 83 | 102 | #endif |
| 103 | ||
| 84 | 104 | /* Number of descriptors that can fit in an `fd_set'. */ |
| 85 | 105 | #define	__FD_SETSIZE		1024 |
| 86 | 106 |
lib/libc/glibc/sysdeps/unix/sysv/linux/generic/sysdep.h+1-9| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2011-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2011-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. |
| 4 | 4 | |
| ... | ... | @@ -25,11 +25,3 @@ |
| 25 | 25 | #ifdef __NR_llseek |
| 26 | 26 | # define __NR__llseek __NR_llseek |
| 27 | 27 | #endif |
| 28 | ||
| 29 | #if __WORDSIZE == 64 | |
| 30 | /* By defining the older names, glibc will build syscall wrappers for | |
| 31 | both pread and pread64; sysdeps/unix/sysv/linux/wordsize-64/pread64.c | |
| 32 | will suppress generating any separate code for pread64.c. */ | |
| 33 | #define __NR_pread __NR_pread64 | |
| 34 | #define __NR_pwrite __NR_pwrite64 | |
| 35 | #endif |
lib/libc/glibc/sysdeps/unix/sysv/linux/generic/xstatver.h created+10| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | /* Versions of the 'struct stat' data structure used in compatibility xstat | |
| 2 | functions. */ | |
| 3 | #define _STAT_VER_KERNEL	0 | |
| 4 | #define _STAT_VER_LINUX		0 | |
| 5 | #define _STAT_VER		_STAT_VER_KERNEL | |
| 6 | ||
| 7 | /* Versions of the 'xmknod' interface used in compatibility xmknod | |
| 8 | functions. */ | |
| 9 | #define _MKNOD_VER_LINUX	0 | |
| 10 | #define _MKNOD_VER		_MKNOD_VER_LINUX |
lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/kernel-features.h+1-6| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. |
| 3 | Copyright (C) 2006-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 2006-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -18,11 +18,6 @@ |
| 18 | 18 | <https://www.gnu.org/licenses/>. */ |
| 19 | 19 | |
| 20 | 20 | |
| 21 | /* Support for the utimes syscall was added in 3.14. */ | |
| 22 | #if __LINUX_KERNEL_VERSION >= 0x030e00 | |
| 23 | # define __ASSUME_UTIMES		1 | |
| 24 | #endif | |
| 25 | ||
| 26 | 21 | #include_next <kernel-features.h> |
| 27 | 22 | |
| 28 | 23 | #define __ASSUME_RECV_SYSCALL 1 |
lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/kernel_stat.h created+36| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | /* definition of "struct stat" from the kernel */ | |
| 2 | struct kernel_stat { | |
| 3 | 	unsigned long	st_dev;		/* dev_t is 32 bits on parisc */ | |
| 4 | 	unsigned long	st_ino;		/* 32 bits */ | |
| 5 | 	unsigned short	st_mode;	/* 16 bits */ | |
| 6 | 	unsigned short	st_nlink;	/* 16 bits */ | |
| 7 | 	unsigned short	st_reserved1;	/* old st_uid */ | |
| 8 | 	unsigned short	st_reserved2;	/* old st_gid */ | |
| 9 | 	unsigned long	st_rdev; | |
| 10 | 	unsigned long st_size; | |
| 11 | 	struct timespec st_atim; | |
| 12 | 	struct timespec st_mtim; | |
| 13 | 	struct timespec st_ctim; | |
| 14 | 	long		st_blksize; | |
| 15 | 	long		st_blocks; | |
| 16 | 	unsigned long	__glibc_reserved1;	/* ACL stuff */ | |
| 17 | 	unsigned long	__glibc_reserved2;	/* network */ | |
| 18 | 	unsigned long	__glibc_reserved3;	/* network */ | |
| 19 | 	unsigned long	__glibc_reserved4;	/* cnodes */ | |
| 20 | 	unsigned short	__glibc_reserved5;	/* netsite */ | |
| 21 | 	short		st_fstype; | |
| 22 | 	unsigned long	st_realdev; | |
| 23 | 	unsigned short	st_basemode; | |
| 24 | 	unsigned short	st_spareshort; | |
| 25 | 	unsigned long	st_uid; | |
| 26 | 	unsigned long st_gid; | |
| 27 | 	unsigned long	st_spare4[3]; | |
| 28 | }; | |
| 29 | ||
| 30 | #define _HAVE_STAT_NSEC | |
| 31 | #define _HAVE_STAT64_NSEC | |
| 32 | ||
| 33 | #define STAT_IS_KERNEL_STAT 0 | |
| 34 | #define STAT64_IS_KERNEL_STAT64 1 | |
| 35 | #define XSTAT_IS_XSTAT64 0 | |
| 36 | #define STATFS_IS_STATFS64 0 |
lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/pthread.h deleted-1174| ... | ... | @@ -1,1174 +0,0 @@ |
| 1 | /* Copyright (C) 2002-2019 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <http://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _PTHREAD_H | |
| 19 | #define _PTHREAD_H	1 | |
| 20 | ||
| 21 | #include <features.h> | |
| 22 | #include <endian.h> | |
| 23 | #include <sched.h> | |
| 24 | #include <time.h> | |
| 25 | ||
| 26 | #include <bits/pthreadtypes.h> | |
| 27 | #include <bits/setjmp.h> | |
| 28 | #include <bits/wordsize.h> | |
| 29 | #include <bits/types/struct_timespec.h> | |
| 30 | ||
| 31 | ||
| 32 | /* Detach state. */ | |
| 33 | enum | |
| 34 | { | |
| 35 | PTHREAD_CREATE_JOINABLE, | |
| 36 | #define PTHREAD_CREATE_JOINABLE	PTHREAD_CREATE_JOINABLE | |
| 37 | PTHREAD_CREATE_DETACHED | |
| 38 | #define PTHREAD_CREATE_DETACHED	PTHREAD_CREATE_DETACHED | |
| 39 | }; | |
| 40 | ||
| 41 | ||
| 42 | /* Mutex types. */ | |
| 43 | enum | |
| 44 | { | |
| 45 | PTHREAD_MUTEX_TIMED_NP, | |
| 46 | PTHREAD_MUTEX_RECURSIVE_NP, | |
| 47 | PTHREAD_MUTEX_ERRORCHECK_NP, | |
| 48 | PTHREAD_MUTEX_ADAPTIVE_NP | |
| 49 | #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 | |
| 50 | , | |
| 51 | PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, | |
| 52 | PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, | |
| 53 | PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, | |
| 54 | PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL | |
| 55 | #endif | |
| 56 | #ifdef __USE_GNU | |
| 57 | /* For compatibility. */ | |
| 58 | , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP | |
| 59 | #endif | |
| 60 | }; | |
| 61 | ||
| 62 | ||
| 63 | #ifdef __USE_XOPEN2K | |
| 64 | /* Robust mutex or not flags. */ | |
| 65 | enum | |
| 66 | { | |
| 67 | PTHREAD_MUTEX_STALLED, | |
| 68 | PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED, | |
| 69 | PTHREAD_MUTEX_ROBUST, | |
| 70 | PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST | |
| 71 | }; | |
| 72 | #endif | |
| 73 | ||
| 74 | ||
| 75 | #if defined __USE_POSIX199506 || defined __USE_UNIX98 | |
| 76 | /* Mutex protocols. */ | |
| 77 | enum | |
| 78 | { | |
| 79 | PTHREAD_PRIO_NONE, | |
| 80 | PTHREAD_PRIO_INHERIT, | |
| 81 | PTHREAD_PRIO_PROTECT | |
| 82 | }; | |
| 83 | #endif | |
| 84 | ||
| 85 | ||
| 86 | #define PTHREAD_MUTEX_INITIALIZER \ | |
| 87 | { { 0, 0, 0, 0, { 0, 0, 0, 0 }, 0, { __PTHREAD_SPINS }, { 0, 0 } } } | |
| 88 | #ifdef __USE_GNU | |
| 89 | # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ | |
| 90 | { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, { 0, 0, 0, 0 }, 0, \ | |
| 91 | { __PTHREAD_SPINS }, { 0, 0 } } } | |
| 92 | # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ | |
| 93 | { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, { 0, 0, 0, 0 }, 0, \ | |
| 94 | { __PTHREAD_SPINS }, { 0, 0 } } } | |
| 95 | # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ | |
| 96 | { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, { 0, 0, 0, 0 }, 0, \ | |
| 97 | { __PTHREAD_SPINS }, { 0, 0 } } } | |
| 98 | #endif | |
| 99 | ||
| 100 | ||
| 101 | /* Read-write lock types. */ | |
| 102 | #if defined __USE_UNIX98 || defined __USE_XOPEN2K | |
| 103 | enum | |
| 104 | { | |
| 105 | PTHREAD_RWLOCK_PREFER_READER_NP, | |
| 106 | PTHREAD_RWLOCK_PREFER_WRITER_NP, | |
| 107 | PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, | |
| 108 | PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP | |
| 109 | }; | |
| 110 | ||
| 111 | /* Define __PTHREAD_RWLOCK_INT_FLAGS_SHARED to 1 if pthread_rwlock_t | |
| 112 | has the shared field. All 64-bit architectures have the shared field | |
| 113 | in pthread_rwlock_t. */ | |
| 114 | #ifndef __PTHREAD_RWLOCK_INT_FLAGS_SHARED | |
| 115 | # if __WORDSIZE == 64 | |
| 116 | # define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 | |
| 117 | # endif | |
| 118 | #endif | |
| 119 | ||
| 120 | ||
| 121 | /* Read-write lock initializers. */ | |
| 122 | # define PTHREAD_RWLOCK_INITIALIZER \ | |
| 123 | { { { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } | |
| 124 | # ifdef __USE_GNU | |
| 125 | # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ | |
| 126 | { { { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | |
| 127 | PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, 0, 0, 0 } } | |
| 128 | # endif | |
| 129 | #endif /* Unix98 or XOpen2K */ | |
| 130 | ||
| 131 | ||
| 132 | /* Scheduler inheritance. */ | |
| 133 | enum | |
| 134 | { | |
| 135 | PTHREAD_INHERIT_SCHED, | |
| 136 | #define PTHREAD_INHERIT_SCHED PTHREAD_INHERIT_SCHED | |
| 137 | PTHREAD_EXPLICIT_SCHED | |
| 138 | #define PTHREAD_EXPLICIT_SCHED PTHREAD_EXPLICIT_SCHED | |
| 139 | }; | |
| 140 | ||
| 141 | ||
| 142 | /* Scope handling. */ | |
| 143 | enum | |
| 144 | { | |
| 145 | PTHREAD_SCOPE_SYSTEM, | |
| 146 | #define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM | |
| 147 | PTHREAD_SCOPE_PROCESS | |
| 148 | #define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS | |
| 149 | }; | |
| 150 | ||
| 151 | ||
| 152 | /* Process shared or private flag. */ | |
| 153 | enum | |
| 154 | { | |
| 155 | PTHREAD_PROCESS_PRIVATE, | |
| 156 | #define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE | |
| 157 | PTHREAD_PROCESS_SHARED | |
| 158 | #define PTHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED | |
| 159 | }; | |
| 160 | ||
| 161 | ||
| 162 | /* Conditional variable handling. */ | |
| 163 | #define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, {0, 0}, 0, 0, {0, 0} } } | |
| 164 | ||
| 165 | ||
| 166 | /* Cleanup buffers */ | |
| 167 | struct _pthread_cleanup_buffer | |
| 168 | { | |
| 169 | void (*__routine) (void *); /* Function to call. */ | |
| 170 | void *__arg; /* Its argument. */ | |
| 171 | int __canceltype; /* Saved cancellation type. */ | |
| 172 | struct _pthread_cleanup_buffer *__prev; /* Chaining of cleanup functions. */ | |
| 173 | }; | |
| 174 | ||
| 175 | /* Cancellation */ | |
| 176 | enum | |
| 177 | { | |
| 178 | PTHREAD_CANCEL_ENABLE, | |
| 179 | #define PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE | |
| 180 | PTHREAD_CANCEL_DISABLE | |
| 181 | #define PTHREAD_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE | |
| 182 | }; | |
| 183 | enum | |
| 184 | { | |
| 185 | PTHREAD_CANCEL_DEFERRED, | |
| 186 | #define PTHREAD_CANCEL_DEFERRED	PTHREAD_CANCEL_DEFERRED | |
| 187 | PTHREAD_CANCEL_ASYNCHRONOUS | |
| 188 | #define PTHREAD_CANCEL_ASYNCHRONOUS	PTHREAD_CANCEL_ASYNCHRONOUS | |
| 189 | }; | |
| 190 | #define PTHREAD_CANCELED ((void *) -1) | |
| 191 | ||
| 192 | ||
| 193 | /* Single execution handling. */ | |
| 194 | #define PTHREAD_ONCE_INIT 0 | |
| 195 | ||
| 196 | ||
| 197 | #ifdef __USE_XOPEN2K | |
| 198 | /* Value returned by 'pthread_barrier_wait' for one of the threads after | |
| 199 | the required number of threads have called this function. | |
| 200 | -1 is distinct from 0 and all errno constants */ | |
| 201 | # define PTHREAD_BARRIER_SERIAL_THREAD -1 | |
| 202 | #endif | |
| 203 | ||
| 204 | ||
| 205 | __BEGIN_DECLS | |
| 206 | ||
| 207 | /* Create a new thread, starting with execution of START-ROUTINE | |
| 208 | getting passed ARG. Creation attributed come from ATTR. The new | |
| 209 | handle is stored in *NEWTHREAD. */ | |
| 210 | extern int pthread_create (pthread_t *__restrict __newthread, | |
| 211 | 			 const pthread_attr_t *__restrict __attr, | |
| 212 | 			 void *(*__start_routine) (void *), | |
| 213 | 			 void *__restrict __arg) __THROWNL __nonnull ((1, 3)); | |
| 214 | ||
| 215 | /* Terminate calling thread. | |
| 216 | ||
| 217 | The registered cleanup handlers are called via exception handling | |
| 218 | so we cannot mark this function with __THROW.*/ | |
| 219 | extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__)); | |
| 220 | ||
| 221 | /* Make calling thread wait for termination of the thread TH. The | |
| 222 | exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN | |
| 223 | is not NULL. | |
| 224 | ||
| 225 | This function is a cancellation point and therefore not marked with | |
| 226 | __THROW. */ | |
| 227 | extern int pthread_join (pthread_t __th, void **__thread_return); | |
| 228 | ||
| 229 | #ifdef __USE_GNU | |
| 230 | /* Check whether thread TH has terminated. If yes return the status of | |
| 231 | the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */ | |
| 232 | extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW; | |
| 233 | ||
| 234 | /* Make calling thread wait for termination of the thread TH, but only | |
| 235 | until TIMEOUT. The exit status of the thread is stored in | |
| 236 | *THREAD_RETURN, if THREAD_RETURN is not NULL. | |
| 237 | ||
| 238 | This function is a cancellation point and therefore not marked with | |
| 239 | __THROW. */ | |
| 240 | extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return, | |
| 241 | 				 const struct timespec *__abstime); | |
| 242 | #endif | |
| 243 | ||
| 244 | /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN. | |
| 245 | The resources of TH will therefore be freed immediately when it | |
| 246 | terminates, instead of waiting for another thread to perform PTHREAD_JOIN | |
| 247 | on it. */ | |
| 248 | extern int pthread_detach (pthread_t __th) __THROW; | |
| 249 | ||
| 250 | ||
| 251 | /* Obtain the identifier of the current thread. */ | |
| 252 | extern pthread_t pthread_self (void) __THROW __attribute__ ((__const__)); | |
| 253 | ||
| 254 | /* Compare two thread identifiers. */ | |
| 255 | extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) | |
| 256 | __THROW __attribute__ ((__const__)); | |
| 257 | ||
| 258 | ||
| 259 | /* Thread attribute handling. */ | |
| 260 | ||
| 261 | /* Initialize thread attribute *ATTR with default attributes | |
| 262 | (detachstate is PTHREAD_JOINABLE, scheduling policy is SCHED_OTHER, | |
| 263 | no user-provided stack). */ | |
| 264 | extern int pthread_attr_init (pthread_attr_t *__attr) __THROW __nonnull ((1)); | |
| 265 | ||
| 266 | /* Destroy thread attribute *ATTR. */ | |
| 267 | extern int pthread_attr_destroy (pthread_attr_t *__attr) | |
| 268 | __THROW __nonnull ((1)); | |
| 269 | ||
| 270 | /* Get detach state attribute. */ | |
| 271 | extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr, | |
| 272 | 					int *__detachstate) | |
| 273 | __THROW __nonnull ((1, 2)); | |
| 274 | ||
| 275 | /* Set detach state attribute. */ | |
| 276 | extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, | |
| 277 | 					int __detachstate) | |
| 278 | __THROW __nonnull ((1)); | |
| 279 | ||
| 280 | ||
| 281 | /* Get the size of the guard area created for stack overflow protection. */ | |
| 282 | extern int pthread_attr_getguardsize (const pthread_attr_t *__attr, | |
| 283 | 				 size_t *__guardsize) | |
| 284 | __THROW __nonnull ((1, 2)); | |
| 285 | ||
| 286 | /* Set the size of the guard area created for stack overflow protection. */ | |
| 287 | extern int pthread_attr_setguardsize (pthread_attr_t *__attr, | |
| 288 | 				 size_t __guardsize) | |
| 289 | __THROW __nonnull ((1)); | |
| 290 | ||
| 291 | ||
| 292 | /* Return in *PARAM the scheduling parameters of *ATTR. */ | |
| 293 | extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, | |
| 294 | 				 struct sched_param *__restrict __param) | |
| 295 | __THROW __nonnull ((1, 2)); | |
| 296 | ||
| 297 | /* Set scheduling parameters (priority, etc) in *ATTR according to PARAM. */ | |
| 298 | extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, | |
| 299 | 				 const struct sched_param *__restrict | |
| 300 | 				 __param) __THROW __nonnull ((1, 2)); | |
| 301 | ||
| 302 | /* Return in *POLICY the scheduling policy of *ATTR. */ | |
| 303 | extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict | |
| 304 | 					__attr, int *__restrict __policy) | |
| 305 | __THROW __nonnull ((1, 2)); | |
| 306 | ||
| 307 | /* Set scheduling policy in *ATTR according to POLICY. */ | |
| 308 | extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) | |
| 309 | __THROW __nonnull ((1)); | |
| 310 | ||
| 311 | /* Return in *INHERIT the scheduling inheritance mode of *ATTR. */ | |
| 312 | extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict | |
| 313 | 					 __attr, int *__restrict __inherit) | |
| 314 | __THROW __nonnull ((1, 2)); | |
| 315 | ||
| 316 | /* Set scheduling inheritance mode in *ATTR according to INHERIT. */ | |
| 317 | extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, | |
| 318 | 					 int __inherit) | |
| 319 | __THROW __nonnull ((1)); | |
| 320 | ||
| 321 | ||
| 322 | /* Return in *SCOPE the scheduling contention scope of *ATTR. */ | |
| 323 | extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, | |
| 324 | 				 int *__restrict __scope) | |
| 325 | __THROW __nonnull ((1, 2)); | |
| 326 | ||
| 327 | /* Set scheduling contention scope in *ATTR according to SCOPE. */ | |
| 328 | extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) | |
| 329 | __THROW __nonnull ((1)); | |
| 330 | ||
| 331 | /* Return the previously set address for the stack. */ | |
| 332 | extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict | |
| 333 | 				 __attr, void **__restrict __stackaddr) | |
| 334 | __THROW __nonnull ((1, 2)) __attribute_deprecated__; | |
| 335 | ||
| 336 | /* Set the starting address of the stack of the thread to be created. | |
| 337 | Depending on whether the stack grows up or down the value must either | |
| 338 | be higher or lower than all the address in the memory block. The | |
| 339 | minimal size of the block must be PTHREAD_STACK_MIN. */ | |
| 340 | extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, | |
| 341 | 				 void *__stackaddr) | |
| 342 | __THROW __nonnull ((1)) __attribute_deprecated__; | |
| 343 | ||
| 344 | /* Return the currently used minimal stack size. */ | |
| 345 | extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict | |
| 346 | 				 __attr, size_t *__restrict __stacksize) | |
| 347 | __THROW __nonnull ((1, 2)); | |
| 348 | ||
| 349 | /* Add information about the minimum stack size needed for the thread | |
| 350 | to be started. This size must never be less than PTHREAD_STACK_MIN | |
| 351 | and must also not exceed the system limits. */ | |
| 352 | extern int pthread_attr_setstacksize (pthread_attr_t *__attr, | |
| 353 | 				 size_t __stacksize) | |
| 354 | __THROW __nonnull ((1)); | |
| 355 | ||
| 356 | #ifdef __USE_XOPEN2K | |
| 357 | /* Return the previously set address for the stack. */ | |
| 358 | extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr, | |
| 359 | 				 void **__restrict __stackaddr, | |
| 360 | 				 size_t *__restrict __stacksize) | |
| 361 | __THROW __nonnull ((1, 2, 3)); | |
| 362 | ||
| 363 | /* The following two interfaces are intended to replace the last two. They | |
| 364 | require setting the address as well as the size since only setting the | |
| 365 | address will make the implementation on some architectures impossible. */ | |
| 366 | extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, | |
| 367 | 				 size_t __stacksize) __THROW __nonnull ((1)); | |
| 368 | #endif | |
| 369 | ||
| 370 | #ifdef __USE_GNU | |
| 371 | /* Thread created with attribute ATTR will be limited to run only on | |
| 372 | the processors represented in CPUSET. */ | |
| 373 | extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr, | |
| 374 | 					size_t __cpusetsize, | |
| 375 | 					const cpu_set_t *__cpuset) | |
| 376 | __THROW __nonnull ((1, 3)); | |
| 377 | ||
| 378 | /* Get bit set in CPUSET representing the processors threads created with | |
| 379 | ATTR can run on. */ | |
| 380 | extern int pthread_attr_getaffinity_np (const pthread_attr_t *__attr, | |
| 381 | 					size_t __cpusetsize, | |
| 382 | 					cpu_set_t *__cpuset) | |
| 383 | __THROW __nonnull ((1, 3)); | |
| 384 | ||
| 385 | /* Get the default attributes used by pthread_create in this process. */ | |
| 386 | extern int pthread_getattr_default_np (pthread_attr_t *__attr) | |
| 387 | __THROW __nonnull ((1)); | |
| 388 | ||
| 389 | /* Set the default attributes to be used by pthread_create in this | |
| 390 | process. */ | |
| 391 | extern int pthread_setattr_default_np (const pthread_attr_t *__attr) | |
| 392 | __THROW __nonnull ((1)); | |
| 393 | ||
| 394 | /* Initialize thread attribute *ATTR with attributes corresponding to the | |
| 395 | already running thread TH. It shall be called on uninitialized ATTR | |
| 396 | and destroyed with pthread_attr_destroy when no longer needed. */ | |
| 397 | extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) | |
| 398 | __THROW __nonnull ((2)); | |
| 399 | #endif | |
| 400 | ||
| 401 | ||
| 402 | /* Functions for scheduling control. */ | |
| 403 | ||
| 404 | /* Set the scheduling parameters for TARGET_THREAD according to POLICY | |
| 405 | and *PARAM. */ | |
| 406 | extern int pthread_setschedparam (pthread_t __target_thread, int __policy, | |
| 407 | 				 const struct sched_param *__param) | |
| 408 | __THROW __nonnull ((3)); | |
| 409 | ||
| 410 | /* Return in *POLICY and *PARAM the scheduling parameters for TARGET_THREAD. */ | |
| 411 | extern int pthread_getschedparam (pthread_t __target_thread, | |
| 412 | 				 int *__restrict __policy, | |
| 413 | 				 struct sched_param *__restrict __param) | |
| 414 | __THROW __nonnull ((2, 3)); | |
| 415 | ||
| 416 | /* Set the scheduling priority for TARGET_THREAD. */ | |
| 417 | extern int pthread_setschedprio (pthread_t __target_thread, int __prio) | |
| 418 | __THROW; | |
| 419 | ||
| 420 | ||
| 421 | #ifdef __USE_GNU | |
| 422 | /* Get thread name visible in the kernel and its interfaces. */ | |
| 423 | extern int pthread_getname_np (pthread_t __target_thread, char *__buf, | |
| 424 | 			 size_t __buflen) | |
| 425 | __THROW __nonnull ((2)); | |
| 426 | ||
| 427 | /* Set thread name visible in the kernel and its interfaces. */ | |
| 428 | extern int pthread_setname_np (pthread_t __target_thread, const char *__name) | |
| 429 | __THROW __nonnull ((2)); | |
| 430 | #endif | |
| 431 | ||
| 432 | ||
| 433 | #ifdef __USE_UNIX98 | |
| 434 | /* Determine level of concurrency. */ | |
| 435 | extern int pthread_getconcurrency (void) __THROW; | |
| 436 | ||
| 437 | /* Set new concurrency level to LEVEL. */ | |
| 438 | extern int pthread_setconcurrency (int __level) __THROW; | |
| 439 | #endif | |
| 440 | ||
| 441 | #ifdef __USE_GNU | |
| 442 | /* Yield the processor to another thread or process. | |
| 443 | This function is similar to the POSIX `sched_yield' function but | |
| 444 | might be differently implemented in the case of a m-on-n thread | |
| 445 | implementation. */ | |
| 446 | extern int pthread_yield (void) __THROW; | |
| 447 | ||
| 448 | ||
| 449 | /* Limit specified thread TH to run only on the processors represented | |
| 450 | in CPUSET. */ | |
| 451 | extern int pthread_setaffinity_np (pthread_t __th, size_t __cpusetsize, | |
| 452 | 				 const cpu_set_t *__cpuset) | |
| 453 | __THROW __nonnull ((3)); | |
| 454 | ||
| 455 | /* Get bit set in CPUSET representing the processors TH can run on. */ | |
| 456 | extern int pthread_getaffinity_np (pthread_t __th, size_t __cpusetsize, | |
| 457 | 				 cpu_set_t *__cpuset) | |
| 458 | __THROW __nonnull ((3)); | |
| 459 | #endif | |
| 460 | ||
| 461 | ||
| 462 | /* Functions for handling initialization. */ | |
| 463 | ||
| 464 | /* Guarantee that the initialization function INIT_ROUTINE will be called | |
| 465 | only once, even if pthread_once is executed several times with the | |
| 466 | same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or | |
| 467 | extern variable initialized to PTHREAD_ONCE_INIT. | |
| 468 | ||
| 469 | The initialization functions might throw exception which is why | |
| 470 | this function is not marked with __THROW. */ | |
| 471 | extern int pthread_once (pthread_once_t *__once_control, | |
| 472 | 			 void (*__init_routine) (void)) __nonnull ((1, 2)); | |
| 473 | ||
| 474 | ||
| 475 | /* Functions for handling cancellation. | |
| 476 | ||
| 477 | Note that these functions are explicitly not marked to not throw an | |
| 478 | exception in C++ code. If cancellation is implemented by unwinding | |
| 479 | this is necessary to have the compiler generate the unwind information. */ | |
| 480 | ||
| 481 | /* Set cancelability state of current thread to STATE, returning old | |
| 482 | state in *OLDSTATE if OLDSTATE is not NULL. */ | |
| 483 | extern int pthread_setcancelstate (int __state, int *__oldstate); | |
| 484 | ||
| 485 | /* Set cancellation state of current thread to TYPE, returning the old | |
| 486 | type in *OLDTYPE if OLDTYPE is not NULL. */ | |
| 487 | extern int pthread_setcanceltype (int __type, int *__oldtype); | |
| 488 | ||
| 489 | /* Cancel THREAD immediately or at the next possibility. */ | |
| 490 | extern int pthread_cancel (pthread_t __th); | |
| 491 | ||
| 492 | /* Test for pending cancellation for the current thread and terminate | |
| 493 | the thread as per pthread_exit(PTHREAD_CANCELED) if it has been | |
| 494 | cancelled. */ | |
| 495 | extern void pthread_testcancel (void); | |
| 496 | ||
| 497 | ||
| 498 | /* Cancellation handling with integration into exception handling. */ | |
| 499 | ||
| 500 | typedef struct | |
| 501 | { | |
| 502 | struct | |
| 503 | { | |
| 504 | __jmp_buf __cancel_jmp_buf; | |
| 505 | int __mask_was_saved; | |
| 506 | } __cancel_jmp_buf[1]; | |
| 507 | void *__pad[4]; | |
| 508 | } __pthread_unwind_buf_t __attribute__ ((__aligned__)); | |
| 509 | ||
| 510 | /* No special attributes by default. */ | |
| 511 | #ifndef __cleanup_fct_attribute | |
| 512 | # define __cleanup_fct_attribute | |
| 513 | #endif | |
| 514 | ||
| 515 | ||
| 516 | /* Structure to hold the cleanup handler information. */ | |
| 517 | struct __pthread_cleanup_frame | |
| 518 | { | |
| 519 | void (*__cancel_routine) (void *); | |
| 520 | void *__cancel_arg; | |
| 521 | int __do_it; | |
| 522 | int __cancel_type; | |
| 523 | }; | |
| 524 | ||
| 525 | #if defined __GNUC__ && defined __EXCEPTIONS | |
| 526 | # ifdef __cplusplus | |
| 527 | /* Class to handle cancellation handler invocation. */ | |
| 528 | class __pthread_cleanup_class | |
| 529 | { | |
| 530 | void (*__cancel_routine) (void *); | |
| 531 | void *__cancel_arg; | |
| 532 | int __do_it; | |
| 533 | int __cancel_type; | |
| 534 | ||
| 535 | public: | |
| 536 | __pthread_cleanup_class (void (*__fct) (void *), void *__arg) | |
| 537 | : __cancel_routine (__fct), __cancel_arg (__arg), __do_it (1) { } | |
| 538 | ~__pthread_cleanup_class () { if (__do_it) __cancel_routine (__cancel_arg); } | |
| 539 | void __setdoit (int __newval) { __do_it = __newval; } | |
| 540 | void __defer () { pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, | |
| 541 | 					 &__cancel_type); } | |
| 542 | void __restore () const { pthread_setcanceltype (__cancel_type, 0); } | |
| 543 | }; | |
| 544 | ||
| 545 | /* Install a cleanup handler: ROUTINE will be called with arguments ARG | |
| 546 | when the thread is canceled or calls pthread_exit. ROUTINE will also | |
| 547 | be called with arguments ARG when the matching pthread_cleanup_pop | |
| 548 | is executed with non-zero EXECUTE argument. | |
| 549 | ||
| 550 | pthread_cleanup_push and pthread_cleanup_pop are macros and must always | |
| 551 | be used in matching pairs at the same nesting level of braces. */ | |
| 552 | # define pthread_cleanup_push(routine, arg) \ | |
| 553 | do {									 \ | |
| 554 | __pthread_cleanup_class __clframe (routine, arg) | |
| 555 | ||
| 556 | /* Remove a cleanup handler installed by the matching pthread_cleanup_push. | |
| 557 | If EXECUTE is non-zero, the handler function is called. */ | |
| 558 | # define pthread_cleanup_pop(execute) \ | |
| 559 | __clframe.__setdoit (execute);					 \ | |
| 560 | } while (0) | |
| 561 | ||
| 562 | # ifdef __USE_GNU | |
| 563 | /* Install a cleanup handler as pthread_cleanup_push does, but also | |
| 564 | saves the current cancellation type and sets it to deferred | |
| 565 | cancellation. */ | |
| 566 | # define pthread_cleanup_push_defer_np(routine, arg) \ | |
| 567 | do {									 \ | |
| 568 | __pthread_cleanup_class __clframe (routine, arg);			 \ | |
| 569 | __clframe.__defer () | |
| 570 | ||
| 571 | /* Remove a cleanup handler as pthread_cleanup_pop does, but also | |
| 572 | restores the cancellation type that was in effect when the matching | |
| 573 | pthread_cleanup_push_defer was called. */ | |
| 574 | # define pthread_cleanup_pop_restore_np(execute) \ | |
| 575 | __clframe.__restore ();						 \ | |
| 576 | __clframe.__setdoit (execute);					 \ | |
| 577 | } while (0) | |
| 578 | # endif | |
| 579 | # else | |
| 580 | /* Function called to call the cleanup handler. As an extern inline | |
| 581 | function the compiler is free to decide inlining the change when | |
| 582 | needed or fall back on the copy which must exist somewhere | |
| 583 | else. */ | |
| 584 | __extern_inline void | |
| 585 | __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame) | |
| 586 | { | |
| 587 | if (__frame->__do_it) | |
| 588 | __frame->__cancel_routine (__frame->__cancel_arg); | |
| 589 | } | |
| 590 | ||
| 591 | /* Install a cleanup handler: ROUTINE will be called with arguments ARG | |
| 592 | when the thread is canceled or calls pthread_exit. ROUTINE will also | |
| 593 | be called with arguments ARG when the matching pthread_cleanup_pop | |
| 594 | is executed with non-zero EXECUTE argument. | |
| 595 | ||
| 596 | pthread_cleanup_push and pthread_cleanup_pop are macros and must always | |
| 597 | be used in matching pairs at the same nesting level of braces. */ | |
| 598 | # define pthread_cleanup_push(routine, arg) \ | |
| 599 | do {									 \ | |
| 600 | struct __pthread_cleanup_frame __clframe				 \ | |
| 601 | __attribute__ ((__cleanup__ (__pthread_cleanup_routine)))		 \ | |
| 602 | = { .__cancel_routine = (routine), .__cancel_arg = (arg),	 	 \ | |
| 603 | 	 .__do_it = 1 }; | |
| 604 | ||
| 605 | /* Remove a cleanup handler installed by the matching pthread_cleanup_push. | |
| 606 | If EXECUTE is non-zero, the handler function is called. */ | |
| 607 | # define pthread_cleanup_pop(execute) \ | |
| 608 | __clframe.__do_it = (execute);					 \ | |
| 609 | } while (0) | |
| 610 | ||
| 611 | # ifdef __USE_GNU | |
| 612 | /* Install a cleanup handler as pthread_cleanup_push does, but also | |
| 613 | saves the current cancellation type and sets it to deferred | |
| 614 | cancellation. */ | |
| 615 | # define pthread_cleanup_push_defer_np(routine, arg) \ | |
| 616 | do {									 \ | |
| 617 | struct __pthread_cleanup_frame __clframe				 \ | |
| 618 | __attribute__ ((__cleanup__ (__pthread_cleanup_routine)))		 \ | |
| 619 | = { .__cancel_routine = (routine), .__cancel_arg = (arg),		 \ | |
| 620 | 	 .__do_it = 1 };						 \ | |
| 621 | (void) pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED,		 \ | |
| 622 | 				 &__clframe.__cancel_type) | |
| 623 | ||
| 624 | /* Remove a cleanup handler as pthread_cleanup_pop does, but also | |
| 625 | restores the cancellation type that was in effect when the matching | |
| 626 | pthread_cleanup_push_defer was called. */ | |
| 627 | # define pthread_cleanup_pop_restore_np(execute) \ | |
| 628 | (void) pthread_setcanceltype (__clframe.__cancel_type, NULL);	 \ | |
| 629 | __clframe.__do_it = (execute);					 \ | |
| 630 | } while (0) | |
| 631 | # endif | |
| 632 | # endif | |
| 633 | #else | |
| 634 | /* Install a cleanup handler: ROUTINE will be called with arguments ARG | |
| 635 | when the thread is canceled or calls pthread_exit. ROUTINE will also | |
| 636 | be called with arguments ARG when the matching pthread_cleanup_pop | |
| 637 | is executed with non-zero EXECUTE argument. | |
| 638 | ||
| 639 | pthread_cleanup_push and pthread_cleanup_pop are macros and must always | |
| 640 | be used in matching pairs at the same nesting level of braces. */ | |
| 641 | # define pthread_cleanup_push(routine, arg) \ | |
| 642 | do {									 \ | |
| 643 | __pthread_unwind_buf_t __cancel_buf;				 \ | |
| 644 | void (*__cancel_routine) (void *) = (routine);			 \ | |
| 645 | void *__cancel_arg = (arg);						 \ | |
| 646 | int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ | |
| 647 | 					__cancel_buf.__cancel_jmp_buf, 0); \ | |
| 648 | if (__glibc_unlikely (__not_first_call))				 \ | |
| 649 | {									 \ | |
| 650 | 	__cancel_routine (__cancel_arg);				 \ | |
| 651 | 	__pthread_unwind_next (&__cancel_buf);				 \ | |
| 652 | 	/* NOTREACHED */						 \ | |
| 653 | }									 \ | |
| 654 | 									 \ | |
| 655 | __pthread_register_cancel (&__cancel_buf);				 \ | |
| 656 | do { | |
| 657 | extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf) | |
| 658 | __cleanup_fct_attribute; | |
| 659 | ||
| 660 | /* Remove a cleanup handler installed by the matching pthread_cleanup_push. | |
| 661 | If EXECUTE is non-zero, the handler function is called. */ | |
| 662 | # define pthread_cleanup_pop(execute) \ | |
| 663 | do { } while (0);/* Empty to allow label before pthread_cleanup_pop. */\ | |
| 664 | } while (0);							 \ | |
| 665 | __pthread_unregister_cancel (&__cancel_buf);			 \ | |
| 666 | if (execute)							 \ | |
| 667 | __cancel_routine (__cancel_arg);					 \ | |
| 668 | } while (0) | |
| 669 | extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf) | |
| 670 | __cleanup_fct_attribute; | |
| 671 | ||
| 672 | # ifdef __USE_GNU | |
| 673 | /* Install a cleanup handler as pthread_cleanup_push does, but also | |
| 674 | saves the current cancellation type and sets it to deferred | |
| 675 | cancellation. */ | |
| 676 | # define pthread_cleanup_push_defer_np(routine, arg) \ | |
| 677 | do {									 \ | |
| 678 | __pthread_unwind_buf_t __cancel_buf;				 \ | |
| 679 | void (*__cancel_routine) (void *) = (routine);			 \ | |
| 680 | void *__cancel_arg = (arg);						 \ | |
| 681 | int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ | |
| 682 | 					__cancel_buf.__cancel_jmp_buf, 0); \ | |
| 683 | if (__glibc_unlikely (__not_first_call))				 \ | |
| 684 | {									 \ | |
| 685 | 	__cancel_routine (__cancel_arg);				 \ | |
| 686 | 	__pthread_unwind_next (&__cancel_buf);				 \ | |
| 687 | 	/* NOTREACHED */						 \ | |
| 688 | }									 \ | |
| 689 | 									 \ | |
| 690 | __pthread_register_cancel_defer (&__cancel_buf);			 \ | |
| 691 | do { | |
| 692 | extern void __pthread_register_cancel_defer (__pthread_unwind_buf_t *__buf) | |
| 693 | __cleanup_fct_attribute; | |
| 694 | ||
| 695 | /* Remove a cleanup handler as pthread_cleanup_pop does, but also | |
| 696 | restores the cancellation type that was in effect when the matching | |
| 697 | pthread_cleanup_push_defer was called. */ | |
| 698 | # define pthread_cleanup_pop_restore_np(execute) \ | |
| 699 | do { } while (0);/* Empty to allow label before pthread_cleanup_pop. */\ | |
| 700 | } while (0);							 \ | |
| 701 | __pthread_unregister_cancel_restore (&__cancel_buf);		 \ | |
| 702 | if (execute)							 \ | |
| 703 | __cancel_routine (__cancel_arg);					 \ | |
| 704 | } while (0) | |
| 705 | extern void __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *__buf) | |
| 706 | __cleanup_fct_attribute; | |
| 707 | # endif | |
| 708 | ||
| 709 | /* Internal interface to initiate cleanup. */ | |
| 710 | extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf) | |
| 711 | __cleanup_fct_attribute __attribute__ ((__noreturn__)) | |
| 712 | # ifndef SHARED | |
| 713 | __attribute__ ((__weak__)) | |
| 714 | # endif | |
| 715 | ; | |
| 716 | #endif | |
| 717 | ||
| 718 | /* Function used in the macros. */ | |
| 719 | struct __jmp_buf_tag; | |
| 720 | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL; | |
| 721 | ||
| 722 | ||
| 723 | /* Mutex handling. */ | |
| 724 | ||
| 725 | /* Initialize a mutex. */ | |
| 726 | extern int pthread_mutex_init (pthread_mutex_t *__mutex, | |
| 727 | 			 const pthread_mutexattr_t *__mutexattr) | |
| 728 | __THROW __nonnull ((1)); | |
| 729 | ||
| 730 | /* Destroy a mutex. */ | |
| 731 | extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) | |
| 732 | __THROW __nonnull ((1)); | |
| 733 | ||
| 734 | /* Try locking a mutex. */ | |
| 735 | extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) | |
| 736 | __THROWNL __nonnull ((1)); | |
| 737 | ||
| 738 | /* Lock a mutex. */ | |
| 739 | extern int pthread_mutex_lock (pthread_mutex_t *__mutex) | |
| 740 | __THROWNL __nonnull ((1)); | |
| 741 | ||
| 742 | #ifdef __USE_XOPEN2K | |
| 743 | /* Wait until lock becomes available, or specified time passes. */ | |
| 744 | extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, | |
| 745 | 				 const struct timespec *__restrict | |
| 746 | 				 __abstime) __THROWNL __nonnull ((1, 2)); | |
| 747 | #endif | |
| 748 | ||
| 749 | #ifdef __USE_GNU | |
| 750 | extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex, | |
| 751 | 				 clockid_t __clockid, | |
| 752 | 				 const struct timespec *__restrict | |
| 753 | 				 __abstime) __THROWNL __nonnull ((1, 3)); | |
| 754 | #endif | |
| 755 | ||
| 756 | /* Unlock a mutex. */ | |
| 757 | extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) | |
| 758 | __THROWNL __nonnull ((1)); | |
| 759 | ||
| 760 | ||
| 761 | /* Get the priority ceiling of MUTEX. */ | |
| 762 | extern int pthread_mutex_getprioceiling (const pthread_mutex_t * | |
| 763 | 					 __restrict __mutex, | |
| 764 | 					 int *__restrict __prioceiling) | |
| 765 | __THROW __nonnull ((1, 2)); | |
| 766 | ||
| 767 | /* Set the priority ceiling of MUTEX to PRIOCEILING, return old | |
| 768 | priority ceiling value in *OLD_CEILING. */ | |
| 769 | extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, | |
| 770 | 					 int __prioceiling, | |
| 771 | 					 int *__restrict __old_ceiling) | |
| 772 | __THROW __nonnull ((1, 3)); | |
| 773 | ||
| 774 | ||
| 775 | #ifdef __USE_XOPEN2K8 | |
| 776 | /* Declare the state protected by MUTEX as consistent. */ | |
| 777 | extern int pthread_mutex_consistent (pthread_mutex_t *__mutex) | |
| 778 | __THROW __nonnull ((1)); | |
| 779 | # ifdef __USE_GNU | |
| 780 | extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) | |
| 781 | __THROW __nonnull ((1)); | |
| 782 | # endif | |
| 783 | #endif | |
| 784 | ||
| 785 | ||
| 786 | /* Functions for handling mutex attributes. */ | |
| 787 | ||
| 788 | /* Initialize mutex attribute object ATTR with default attributes | |
| 789 | (kind is PTHREAD_MUTEX_TIMED_NP). */ | |
| 790 | extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) | |
| 791 | __THROW __nonnull ((1)); | |
| 792 | ||
| 793 | /* Destroy mutex attribute object ATTR. */ | |
| 794 | extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) | |
| 795 | __THROW __nonnull ((1)); | |
| 796 | ||
| 797 | /* Get the process-shared flag of the mutex attribute ATTR. */ | |
| 798 | extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t * | |
| 799 | 					 __restrict __attr, | |
| 800 | 					 int *__restrict __pshared) | |
| 801 | __THROW __nonnull ((1, 2)); | |
| 802 | ||
| 803 | /* Set the process-shared flag of the mutex attribute ATTR. */ | |
| 804 | extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, | |
| 805 | 					 int __pshared) | |
| 806 | __THROW __nonnull ((1)); | |
| 807 | ||
| 808 | #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 | |
| 809 | /* Return in *KIND the mutex kind attribute in *ATTR. */ | |
| 810 | extern int pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict | |
| 811 | 				 __attr, int *__restrict __kind) | |
| 812 | __THROW __nonnull ((1, 2)); | |
| 813 | ||
| 814 | /* Set the mutex kind attribute in *ATTR to KIND (either PTHREAD_MUTEX_NORMAL, | |
| 815 | PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, or | |
| 816 | PTHREAD_MUTEX_DEFAULT). */ | |
| 817 | extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) | |
| 818 | __THROW __nonnull ((1)); | |
| 819 | #endif | |
| 820 | ||
| 821 | /* Return in *PROTOCOL the mutex protocol attribute in *ATTR. */ | |
| 822 | extern int pthread_mutexattr_getprotocol (const pthread_mutexattr_t * | |
| 823 | 					 __restrict __attr, | |
| 824 | 					 int *__restrict __protocol) | |
| 825 | __THROW __nonnull ((1, 2)); | |
| 826 | ||
| 827 | /* Set the mutex protocol attribute in *ATTR to PROTOCOL (either | |
| 828 | PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, or PTHREAD_PRIO_PROTECT). */ | |
| 829 | extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr, | |
| 830 | 					 int __protocol) | |
| 831 | __THROW __nonnull ((1)); | |
| 832 | ||
| 833 | /* Return in *PRIOCEILING the mutex prioceiling attribute in *ATTR. */ | |
| 834 | extern int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t * | |
| 835 | 					 __restrict __attr, | |
| 836 | 					 int *__restrict __prioceiling) | |
| 837 | __THROW __nonnull ((1, 2)); | |
| 838 | ||
| 839 | /* Set the mutex prioceiling attribute in *ATTR to PRIOCEILING. */ | |
| 840 | extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr, | |
| 841 | 					 int __prioceiling) | |
| 842 | __THROW __nonnull ((1)); | |
| 843 | ||
| 844 | #ifdef __USE_XOPEN2K | |
| 845 | /* Get the robustness flag of the mutex attribute ATTR. */ | |
| 846 | extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr, | |
| 847 | 					int *__robustness) | |
| 848 | __THROW __nonnull ((1, 2)); | |
| 849 | # ifdef __USE_GNU | |
| 850 | extern int pthread_mutexattr_getrobust_np (const pthread_mutexattr_t *__attr, | |
| 851 | 					 int *__robustness) | |
| 852 | __THROW __nonnull ((1, 2)); | |
| 853 | # endif | |
| 854 | ||
| 855 | /* Set the robustness flag of the mutex attribute ATTR. */ | |
| 856 | extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr, | |
| 857 | 					int __robustness) | |
| 858 | __THROW __nonnull ((1)); | |
| 859 | # ifdef __USE_GNU | |
| 860 | extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr, | |
| 861 | 					 int __robustness) | |
| 862 | __THROW __nonnull ((1)); | |
| 863 | # endif | |
| 864 | #endif | |
| 865 | ||
| 866 | ||
| 867 | #if defined __USE_UNIX98 || defined __USE_XOPEN2K | |
| 868 | /* Functions for handling read-write locks. */ | |
| 869 | ||
| 870 | /* Initialize read-write lock RWLOCK using attributes ATTR, or use | |
| 871 | the default values if later is NULL. */ | |
| 872 | extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, | |
| 873 | 				const pthread_rwlockattr_t *__restrict | |
| 874 | 				__attr) __THROW __nonnull ((1)); | |
| 875 | ||
| 876 | /* Destroy read-write lock RWLOCK. */ | |
| 877 | extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) | |
| 878 | __THROW __nonnull ((1)); | |
| 879 | ||
| 880 | /* Acquire read lock for RWLOCK. */ | |
| 881 | extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) | |
| 882 | __THROWNL __nonnull ((1)); | |
| 883 | ||
| 884 | /* Try to acquire read lock for RWLOCK. */ | |
| 885 | extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) | |
| 886 | __THROWNL __nonnull ((1)); | |
| 887 | ||
| 888 | # ifdef __USE_XOPEN2K | |
| 889 | /* Try to acquire read lock for RWLOCK or return after specfied time. */ | |
| 890 | extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, | |
| 891 | 				 const struct timespec *__restrict | |
| 892 | 				 __abstime) __THROWNL __nonnull ((1, 2)); | |
| 893 | # endif | |
| 894 | ||
| 895 | # ifdef __USE_GNU | |
| 896 | extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock, | |
| 897 | 				 clockid_t __clockid, | |
| 898 | 				 const struct timespec *__restrict | |
| 899 | 				 __abstime) __THROWNL __nonnull ((1, 3)); | |
| 900 | # endif | |
| 901 | ||
| 902 | /* Acquire write lock for RWLOCK. */ | |
| 903 | extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) | |
| 904 | __THROWNL __nonnull ((1)); | |
| 905 | ||
| 906 | /* Try to acquire write lock for RWLOCK. */ | |
| 907 | extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) | |
| 908 | __THROWNL __nonnull ((1)); | |
| 909 | ||
| 910 | # ifdef __USE_XOPEN2K | |
| 911 | /* Try to acquire write lock for RWLOCK or return after specfied time. */ | |
| 912 | extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, | |
| 913 | 				 const struct timespec *__restrict | |
| 914 | 				 __abstime) __THROWNL __nonnull ((1, 2)); | |
| 915 | # endif | |
| 916 | ||
| 917 | # ifdef __USE_GNU | |
| 918 | extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock, | |
| 919 | 				 clockid_t __clockid, | |
| 920 | 				 const struct timespec *__restrict | |
| 921 | 				 __abstime) __THROWNL __nonnull ((1, 3)); | |
| 922 | # endif | |
| 923 | ||
| 924 | /* Unlock RWLOCK. */ | |
| 925 | extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) | |
| 926 | __THROWNL __nonnull ((1)); | |
| 927 | ||
| 928 | ||
| 929 | /* Functions for handling read-write lock attributes. */ | |
| 930 | ||
| 931 | /* Initialize attribute object ATTR with default values. */ | |
| 932 | extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) | |
| 933 | __THROW __nonnull ((1)); | |
| 934 | ||
| 935 | /* Destroy attribute object ATTR. */ | |
| 936 | extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) | |
| 937 | __THROW __nonnull ((1)); | |
| 938 | ||
| 939 | /* Return current setting of process-shared attribute of ATTR in PSHARED. */ | |
| 940 | extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * | |
| 941 | 					 __restrict __attr, | |
| 942 | 					 int *__restrict __pshared) | |
| 943 | __THROW __nonnull ((1, 2)); | |
| 944 | ||
| 945 | /* Set process-shared attribute of ATTR to PSHARED. */ | |
| 946 | extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, | |
| 947 | 					 int __pshared) | |
| 948 | __THROW __nonnull ((1)); | |
| 949 | ||
| 950 | /* Return current setting of reader/writer preference. */ | |
| 951 | extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t * | |
| 952 | 					 __restrict __attr, | |
| 953 | 					 int *__restrict __pref) | |
| 954 | __THROW __nonnull ((1, 2)); | |
| 955 | ||
| 956 | /* Set reader/write preference. */ | |
| 957 | extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr, | |
| 958 | 					 int __pref) __THROW __nonnull ((1)); | |
| 959 | #endif | |
| 960 | ||
| 961 | ||
| 962 | /* Functions for handling conditional variables. */ | |
| 963 | ||
| 964 | /* Initialize condition variable COND using attributes ATTR, or use | |
| 965 | the default values if later is NULL. */ | |
| 966 | extern int pthread_cond_init (pthread_cond_t *__restrict __cond, | |
| 967 | 			 const pthread_condattr_t *__restrict __cond_attr) | |
| 968 | __THROW __nonnull ((1)); | |
| 969 | ||
| 970 | /* Destroy condition variable COND. */ | |
| 971 | extern int pthread_cond_destroy (pthread_cond_t *__cond) | |
| 972 | __THROW __nonnull ((1)); | |
| 973 | ||
| 974 | /* Wake up one thread waiting for condition variable COND. */ | |
| 975 | extern int pthread_cond_signal (pthread_cond_t *__cond) | |
| 976 | __THROWNL __nonnull ((1)); | |
| 977 | ||
| 978 | /* Wake up all threads waiting for condition variables COND. */ | |
| 979 | extern int pthread_cond_broadcast (pthread_cond_t *__cond) | |
| 980 | __THROWNL __nonnull ((1)); | |
| 981 | ||
| 982 | /* Wait for condition variable COND to be signaled or broadcast. | |
| 983 | MUTEX is assumed to be locked before. | |
| 984 | ||
| 985 | This function is a cancellation point and therefore not marked with | |
| 986 | __THROW. */ | |
| 987 | extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, | |
| 988 | 			 pthread_mutex_t *__restrict __mutex) | |
| 989 | __nonnull ((1, 2)); | |
| 990 | ||
| 991 | /* Wait for condition variable COND to be signaled or broadcast until | |
| 992 | ABSTIME. MUTEX is assumed to be locked before. ABSTIME is an | |
| 993 | absolute time specification; zero is the beginning of the epoch | |
| 994 | (00:00:00 GMT, January 1, 1970). | |
| 995 | ||
| 996 | This function is a cancellation point and therefore not marked with | |
| 997 | __THROW. */ | |
| 998 | extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, | |
| 999 | 				 pthread_mutex_t *__restrict __mutex, | |
| 1000 | 				 const struct timespec *__restrict __abstime) | |
| 1001 | __nonnull ((1, 2, 3)); | |
| 1002 | ||
| 1003 | # ifdef __USE_GNU | |
| 1004 | /* Wait for condition variable COND to be signaled or broadcast until | |
| 1005 | ABSTIME measured by the specified clock. MUTEX is assumed to be | |
| 1006 | locked before. CLOCK is the clock to use. ABSTIME is an absolute | |
| 1007 | time specification against CLOCK's epoch. | |
| 1008 | ||
| 1009 | This function is a cancellation point and therefore not marked with | |
| 1010 | __THROW. */ | |
| 1011 | extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond, | |
| 1012 | 				 pthread_mutex_t *__restrict __mutex, | |
| 1013 | 				 __clockid_t __clock_id, | |
| 1014 | 				 const struct timespec *__restrict __abstime) | |
| 1015 | __nonnull ((1, 2, 4)); | |
| 1016 | # endif | |
| 1017 | ||
| 1018 | /* Functions for handling condition variable attributes. */ | |
| 1019 | ||
| 1020 | /* Initialize condition variable attribute ATTR. */ | |
| 1021 | extern int pthread_condattr_init (pthread_condattr_t *__attr) | |
| 1022 | __THROW __nonnull ((1)); | |
| 1023 | ||
| 1024 | /* Destroy condition variable attribute ATTR. */ | |
| 1025 | extern int pthread_condattr_destroy (pthread_condattr_t *__attr) | |
| 1026 | __THROW __nonnull ((1)); | |
| 1027 | ||
| 1028 | /* Get the process-shared flag of the condition variable attribute ATTR. */ | |
| 1029 | extern int pthread_condattr_getpshared (const pthread_condattr_t * | |
| 1030 | 					__restrict __attr, | |
| 1031 | 					int *__restrict __pshared) | |
| 1032 | __THROW __nonnull ((1, 2)); | |
| 1033 | ||
| 1034 | /* Set the process-shared flag of the condition variable attribute ATTR. */ | |
| 1035 | extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, | |
| 1036 | 					int __pshared) __THROW __nonnull ((1)); | |
| 1037 | ||
| 1038 | #ifdef __USE_XOPEN2K | |
| 1039 | /* Get the clock selected for the condition variable attribute ATTR. */ | |
| 1040 | extern int pthread_condattr_getclock (const pthread_condattr_t * | |
| 1041 | 				 __restrict __attr, | |
| 1042 | 				 __clockid_t *__restrict __clock_id) | |
| 1043 | __THROW __nonnull ((1, 2)); | |
| 1044 | ||
| 1045 | /* Set the clock selected for the condition variable attribute ATTR. */ | |
| 1046 | extern int pthread_condattr_setclock (pthread_condattr_t *__attr, | |
| 1047 | 				 __clockid_t __clock_id) | |
| 1048 | __THROW __nonnull ((1)); | |
| 1049 | #endif | |
| 1050 | ||
| 1051 | ||
| 1052 | #ifdef __USE_XOPEN2K | |
| 1053 | /* Functions to handle spinlocks. */ | |
| 1054 | ||
| 1055 | /* Initialize the spinlock LOCK. If PSHARED is nonzero the spinlock can | |
| 1056 | be shared between different processes. */ | |
| 1057 | extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) | |
| 1058 | __THROW __nonnull ((1)); | |
| 1059 | ||
| 1060 | /* Destroy the spinlock LOCK. */ | |
| 1061 | extern int pthread_spin_destroy (pthread_spinlock_t *__lock) | |
| 1062 | __THROW __nonnull ((1)); | |
| 1063 | ||
| 1064 | /* Wait until spinlock LOCK is retrieved. */ | |
| 1065 | extern int pthread_spin_lock (pthread_spinlock_t *__lock) | |
| 1066 | __THROWNL __nonnull ((1)); | |
| 1067 | ||
| 1068 | /* Try to lock spinlock LOCK. */ | |
| 1069 | extern int pthread_spin_trylock (pthread_spinlock_t *__lock) | |
| 1070 | __THROWNL __nonnull ((1)); | |
| 1071 | ||
| 1072 | /* Release spinlock LOCK. */ | |
| 1073 | extern int pthread_spin_unlock (pthread_spinlock_t *__lock) | |
| 1074 | __THROWNL __nonnull ((1)); | |
| 1075 | ||
| 1076 | ||
| 1077 | /* Functions to handle barriers. */ | |
| 1078 | ||
| 1079 | /* Initialize BARRIER with the attributes in ATTR. The barrier is | |
| 1080 | opened when COUNT waiters arrived. */ | |
| 1081 | extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, | |
| 1082 | 				 const pthread_barrierattr_t *__restrict | |
| 1083 | 				 __attr, unsigned int __count) | |
| 1084 | __THROW __nonnull ((1)); | |
| 1085 | ||
| 1086 | /* Destroy a previously dynamically initialized barrier BARRIER. */ | |
| 1087 | extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) | |
| 1088 | __THROW __nonnull ((1)); | |
| 1089 | ||
| 1090 | /* Wait on barrier BARRIER. */ | |
| 1091 | extern int pthread_barrier_wait (pthread_barrier_t *__barrier) | |
| 1092 | __THROWNL __nonnull ((1)); | |
| 1093 | ||
| 1094 | ||
| 1095 | /* Initialize barrier attribute ATTR. */ | |
| 1096 | extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) | |
| 1097 | __THROW __nonnull ((1)); | |
| 1098 | ||
| 1099 | /* Destroy previously dynamically initialized barrier attribute ATTR. */ | |
| 1100 | extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) | |
| 1101 | __THROW __nonnull ((1)); | |
| 1102 | ||
| 1103 | /* Get the process-shared flag of the barrier attribute ATTR. */ | |
| 1104 | extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t * | |
| 1105 | 					 __restrict __attr, | |
| 1106 | 					 int *__restrict __pshared) | |
| 1107 | __THROW __nonnull ((1, 2)); | |
| 1108 | ||
| 1109 | /* Set the process-shared flag of the barrier attribute ATTR. */ | |
| 1110 | extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, | |
| 1111 | 					 int __pshared) | |
| 1112 | __THROW __nonnull ((1)); | |
| 1113 | #endif | |
| 1114 | ||
| 1115 | ||
| 1116 | /* Functions for handling thread-specific data. */ | |
| 1117 | ||
| 1118 | /* Create a key value identifying a location in the thread-specific | |
| 1119 | data area. Each thread maintains a distinct thread-specific data | |
| 1120 | area. DESTR_FUNCTION, if non-NULL, is called with the value | |
| 1121 | associated to that key when the key is destroyed. | |
| 1122 | DESTR_FUNCTION is not called if the value associated is NULL when | |
| 1123 | the key is destroyed. */ | |
| 1124 | extern int pthread_key_create (pthread_key_t *__key, | |
| 1125 | 			 void (*__destr_function) (void *)) | |
| 1126 | __THROW __nonnull ((1)); | |
| 1127 | ||
| 1128 | /* Destroy KEY. */ | |
| 1129 | extern int pthread_key_delete (pthread_key_t __key) __THROW; | |
| 1130 | ||
| 1131 | /* Return current value of the thread-specific data slot identified by KEY. */ | |
| 1132 | extern void *pthread_getspecific (pthread_key_t __key) __THROW; | |
| 1133 | ||
| 1134 | /* Store POINTER in the thread-specific data slot identified by KEY. */ | |
| 1135 | extern int pthread_setspecific (pthread_key_t __key, | |
| 1136 | 				const void *__pointer) __THROW ; | |
| 1137 | ||
| 1138 | ||
| 1139 | #ifdef __USE_XOPEN2K | |
| 1140 | /* Get ID of CPU-time clock for thread THREAD_ID. */ | |
| 1141 | extern int pthread_getcpuclockid (pthread_t __thread_id, | |
| 1142 | 				 __clockid_t *__clock_id) | |
| 1143 | __THROW __nonnull ((2)); | |
| 1144 | #endif | |
| 1145 | ||
| 1146 | ||
| 1147 | /* Install handlers to be called when a new process is created with FORK. | |
| 1148 | The PREPARE handler is called in the parent process just before performing | |
| 1149 | FORK. The PARENT handler is called in the parent process just after FORK. | |
| 1150 | The CHILD handler is called in the child process. Each of the three | |
| 1151 | handlers can be NULL, meaning that no handler needs to be called at that | |
| 1152 | point. | |
| 1153 | PTHREAD_ATFORK can be called several times, in which case the PREPARE | |
| 1154 | handlers are called in LIFO order (last added with PTHREAD_ATFORK, | |
| 1155 | first called before FORK), and the PARENT and CHILD handlers are called | |
| 1156 | in FIFO (first added, first called). */ | |
| 1157 | ||
| 1158 | extern int pthread_atfork (void (*__prepare) (void), | |
| 1159 | 			 void (*__parent) (void), | |
| 1160 | 			 void (*__child) (void)) __THROW; | |
| 1161 | ||
| 1162 | ||
| 1163 | #ifdef __USE_EXTERN_INLINES | |
| 1164 | /* Optimizations. */ | |
| 1165 | __extern_inline int | |
| 1166 | __NTH (pthread_equal (pthread_t __thread1, pthread_t __thread2)) | |
| 1167 | { | |
| 1168 | return __thread1 == __thread2; | |
| 1169 | } | |
| 1170 | #endif | |
| 1171 | ||
| 1172 | __END_DECLS | |
| 1173 | ||
| 1174 | #endif	/* pthread.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/sysdep.h+5-33| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembler macros for PA-RISC. |
| 2 | Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999. |
| 5 | 5 | Linux/PA-RISC changes by Philipp Rumpf, <prumpf@tux.org>, March 2000. |
| ... | ... | @@ -28,6 +28,8 @@ |
| 28 | 28 | /* Defines RTLD_PRIVATE_ERRNO. */ |
| 29 | 29 | #include <dl-sysdep.h> |
| 30 | 30 | |
| 31 | #include <tls.h> | |
| 32 | ||
| 31 | 33 | /* In order to get __set_errno() definition in INLINE_SYSCALL. */ |
| 32 | 34 | #ifndef __ASSEMBLER__ |
| 33 | 35 | #include <errno.h> |
| ... | ... | @@ -360,39 +362,9 @@ L(pre_end):					ASM_LINE_SEP	\ |
| 360 | 362 | #define CALL_CLOB_REGS	"%r1", "%r2", CLOB_TREG \ |
| 361 | 363 | 			"%r20", "%r29", "%r31" |
| 362 | 364 | |
| 363 | #undef INLINE_SYSCALL | |
| 364 | #define INLINE_SYSCALL(name, nr, args...)				\ | |
| 365 | ({									\ | |
| 366 | long __sys_res = INTERNAL_SYSCALL (name, , nr, args);		\ | |
| 367 | if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (__sys_res, )))	\ | |
| 368 | {									\ | |
| 369 | 	__set_errno (INTERNAL_SYSCALL_ERRNO (__sys_res, ));		\ | |
| 370 | 	__sys_res = -1;							\ | |
| 371 | }									\ | |
| 372 | __sys_res;								\ | |
| 373 | }) | |
| 374 | ||
| 375 | /* INTERNAL_SYSCALL_DECL - Allows us to setup some function static | |
| 376 | value to use within the context of the syscall | |
| 377 | INTERNAL_SYSCALL_ERROR_P - Returns 0 if it wasn't an error, 1 otherwise | |
| 378 | You are allowed to use the syscall result (val) and the DECL error | |
| 379 | variable to determine what went wrong. | |
| 380 | INTERLAL_SYSCALL_ERRNO - Munges the val/err pair into the error number. | |
| 381 | In our case we just flip the sign. */ | |
| 382 | ||
| 383 | #undef INTERNAL_SYSCALL_DECL | |
| 384 | #define INTERNAL_SYSCALL_DECL(err) | |
| 385 | ||
| 386 | #undef INTERNAL_SYSCALL_ERROR_P | |
| 387 | #define INTERNAL_SYSCALL_ERROR_P(val, err) \ | |
| 388 | 	((val < 0) && (val > -4095)) | |
| 389 | ||
| 390 | #undef INTERNAL_SYSCALL_ERRNO | |
| 391 | #define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) | |
| 392 | ||
| 393 | 365 | /* Similar to INLINE_SYSCALL but we don't set errno */ |
| 394 | 366 | #undef INTERNAL_SYSCALL |
| 395 | #define INTERNAL_SYSCALL(name, err, nr, args...)			\ | |
| 367 | #define INTERNAL_SYSCALL(name, nr, args...)				\ | |
| 396 | 368 | ({									\ |
| 397 | 369 | 	long __sys_res;							\ |
| 398 | 370 | 	{								\ |
| ... | ... | @@ -418,7 +390,7 @@ L(pre_end):					ASM_LINE_SEP	\ |
| 418 | 390 | |
| 419 | 391 | /* The _NCS variant allows non-constant syscall numbers. */ |
| 420 | 392 | #undef INTERNAL_SYSCALL_NCS |
| 421 | #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			\ | |
| 393 | #define INTERNAL_SYSCALL_NCS(name, nr, args...)				\ | |
| 422 | 394 | ({									\ |
| 423 | 395 | 	long __sys_res;							\ |
| 424 | 396 | 	{								\ |
lib/libc/glibc/sysdeps/unix/sysv/linux/i386/dl-sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* System-specific settings for dynamic linker code. i386 version. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/i386/kernel-features.h+3-3| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. i386 version. |
| 3 | Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -23,8 +23,6 @@ |
| 23 | 23 | # define __ASSUME_SOCKETPAIR_SYSCALL 1 |
| 24 | 24 | # define __ASSUME_BIND_SYSCALL 1 |
| 25 | 25 | # define __ASSUME_LISTEN_SYSCALL 1 |
| 26 | # define __ASSUME_GETSOCKOPT_SYSCALL 1 | |
| 27 | # define __ASSUME_SETSOCKOPT_SYSCALL 1 | |
| 28 | 26 | # define __ASSUME_GETSOCKNAME_SYSCALL 1 |
| 29 | 27 | # define __ASSUME_GETPEERNAME_SYSCALL 1 |
| 30 | 28 | # define __ASSUME_SHUTDOWN_SYSCALL 1 |
| ... | ... | @@ -41,6 +39,8 @@ |
| 41 | 39 | # undef __ASSUME_CONNECT_SYSCALL |
| 42 | 40 | # undef __ASSUME_RECVFROM_SYSCALL |
| 43 | 41 | # undef __ASSUME_SENDTO_SYSCALL |
| 42 | # undef __ASSUME_GETSOCKOPT_SYSCALL | |
| 43 | # undef __ASSUME_SETSOCKOPT_SYSCALL | |
| 44 | 44 | #endif |
| 45 | 45 | |
| 46 | 46 | /* i686 only supports ipc syscall before 5.1. */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/i386/kernel_stat.h created+40| ... | ... | @@ -0,0 +1,40 @@ |
| 1 | /* Definition of `struct stat' used in the kernel.. */ | |
| 2 | struct kernel_stat | |
| 3 | { | |
| 4 | unsigned short int st_dev; | |
| 5 | unsigned short int __pad1; | |
| 6 | #define _HAVE___PAD1 | |
| 7 | unsigned long int st_ino; | |
| 8 | unsigned short int st_mode; | |
| 9 | unsigned short int st_nlink; | |
| 10 | unsigned short int st_uid; | |
| 11 | unsigned short int st_gid; | |
| 12 | unsigned short int st_rdev; | |
| 13 | unsigned short int __pad2; | |
| 14 | #define _HAVE___PAD2 | |
| 15 | unsigned long int st_size; | |
| 16 | unsigned long int st_blksize; | |
| 17 | unsigned long int st_blocks; | |
| 18 | struct timespec st_atim; | |
| 19 | struct timespec st_mtim; | |
| 20 | struct timespec st_ctim; | |
| 21 | unsigned long int __glibc_reserved4; | |
| 22 | #define _HAVE___UNUSED4 | |
| 23 | unsigned long int __glibc_reserved5; | |
| 24 | #define _HAVE___UNUSED5 | |
| 25 | }; | |
| 26 | ||
| 27 | #define _HAVE_STAT___UNUSED4 | |
| 28 | #define _HAVE_STAT___UNUSED5 | |
| 29 | #define _HAVE_STAT___PAD1 | |
| 30 | #define _HAVE_STAT___PAD2 | |
| 31 | #define _HAVE_STAT_NSEC | |
| 32 | #define _HAVE_STAT64___PAD1 | |
| 33 | #define _HAVE_STAT64___PAD2 | |
| 34 | #define _HAVE_STAT64___ST_INO | |
| 35 | #define _HAVE_STAT64_NSEC | |
| 36 | ||
| 37 | #define STAT_IS_KERNEL_STAT 0 | |
| 38 | #define STAT64_IS_KERNEL_STAT64 1 | |
| 39 | #define XSTAT_IS_XSTAT64 0 | |
| 40 | #define STATFS_IS_STATFS64 0 |
lib/libc/glibc/sysdeps/unix/sysv/linux/i386/sysdep.h+85-108| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Contributed by Ulrich Drepper, <drepper@gnu.org>, August 1995. |
| 4 | 4 | |
| ... | ... | @@ -48,7 +48,7 @@ |
| 48 | 48 | to compile glibc. Disable GCC 5 optimization when compiling for |
| 49 | 49 | profiling or when -fno-omit-frame-pointer is used since asm ("ebp") |
| 50 | 50 | can't be used to put the 6th argument in %ebp for syscall. */ |
| 51 | #if __GNUC_PREREQ (5,0) && !defined PROF && CAN_USE_REGISTER_ASM_EBP | |
| 51 | #if !defined PROF && CAN_USE_REGISTER_ASM_EBP | |
| 52 | 52 | # define OPTIMIZE_FOR_GCC_5 |
| 53 | 53 | #endif |
| 54 | 54 | |
| ... | ... | @@ -67,6 +67,7 @@ |
| 67 | 67 | |
| 68 | 68 | /* We don't want the label for the error handle to be global when we define |
| 69 | 69 | it here. */ |
| 70 | #undef SYSCALL_ERROR_LABEL | |
| 70 | 71 | #define SYSCALL_ERROR_LABEL __syscall_error |
| 71 | 72 | |
| 72 | 73 | #undef	PSEUDO |
| ... | ... | @@ -280,35 +281,6 @@ struct libc_do_syscall_args |
| 280 | 281 | }; |
| 281 | 282 | #endif |
| 282 | 283 | |
| 283 | /* Define a macro which expands inline into the wrapper code for a system | |
| 284 | call. */ | |
| 285 | #undef INLINE_SYSCALL | |
| 286 | #if IS_IN (libc) | |
| 287 | # define INLINE_SYSCALL(name, nr, args...) \ | |
| 288 | ({									 \ | |
| 289 | unsigned int resultvar = INTERNAL_SYSCALL (name, , nr, args);	 \ | |
| 290 | __glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (resultvar, ))		 \ | |
| 291 | ? __syscall_error (-INTERNAL_SYSCALL_ERRNO (resultvar, ))		 \ | |
| 292 | : (int) resultvar; }) | |
| 293 | #else | |
| 294 | # define INLINE_SYSCALL(name, nr, args...) \ | |
| 295 | ({									 \ | |
| 296 | unsigned int resultvar = INTERNAL_SYSCALL (name, , nr, args);	 \ | |
| 297 | if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (resultvar, )))	 \ | |
| 298 | {									 \ | |
| 299 | 	__set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, ));		 \ | |
| 300 | 	resultvar = 0xffffffff;						 \ | |
| 301 | }									 \ | |
| 302 | (int) resultvar; }) | |
| 303 | #endif | |
| 304 | ||
| 305 | /* Set error number and return -1. Return the internal function, | |
| 306 | __syscall_error, which sets errno from the negative error number | |
| 307 | and returns -1, to avoid PIC. */ | |
| 308 | #undef INLINE_SYSCALL_ERROR_RETURN_VALUE | |
| 309 | #define INLINE_SYSCALL_ERROR_RETURN_VALUE(resultvar) \ | |
| 310 | __syscall_error (-(resultvar)) | |
| 311 | ||
| 312 | 284 | # define VDSO_NAME "LINUX_2.6" |
| 313 | 285 | # define VDSO_HASH 61765110 |
| 314 | 286 | |
| ... | ... | @@ -319,6 +291,11 @@ struct libc_do_syscall_args |
| 319 | 291 | # define HAVE_TIME_VSYSCALL "__vdso_time" |
| 320 | 292 | # define HAVE_CLOCK_GETRES_VSYSCALL "__vdso_clock_getres" |
| 321 | 293 | |
| 294 | # define HAVE_CLONE3_WRAPPER		1 | |
| 295 | ||
| 296 | # undef HAVE_INTERNAL_BRK_ADDR_SYMBOL | |
| 297 | # define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 | |
| 298 | ||
| 322 | 299 | /* Define a macro which expands inline into the wrapper code for a system |
| 323 | 300 | call. This use is for internal calls that do not need to handle errors |
| 324 | 301 | normally. It will never touch errno. This returns just what the kernel |
| ... | ... | @@ -327,25 +304,41 @@ struct libc_do_syscall_args |
| 327 | 304 | The _NCS variant allows non-constant syscall numbers but it is not |
| 328 | 305 | possible to use more than four parameters. */ |
| 329 | 306 | #undef INTERNAL_SYSCALL |
| 330 | #define INTERNAL_SYSCALL_MAIN_0(name, err, args...) \ | |
| 331 | INTERNAL_SYSCALL_MAIN_INLINE(name, err, 0, args) | |
| 332 | #define INTERNAL_SYSCALL_MAIN_1(name, err, args...) \ | |
| 333 | INTERNAL_SYSCALL_MAIN_INLINE(name, err, 1, args) | |
| 334 | #define INTERNAL_SYSCALL_MAIN_2(name, err, args...) \ | |
| 335 | INTERNAL_SYSCALL_MAIN_INLINE(name, err, 2, args) | |
| 336 | #define INTERNAL_SYSCALL_MAIN_3(name, err, args...) \ | |
| 337 | INTERNAL_SYSCALL_MAIN_INLINE(name, err, 3, args) | |
| 338 | #define INTERNAL_SYSCALL_MAIN_4(name, err, args...) \ | |
| 339 | INTERNAL_SYSCALL_MAIN_INLINE(name, err, 4, args) | |
| 340 | #define INTERNAL_SYSCALL_MAIN_5(name, err, args...) \ | |
| 341 | INTERNAL_SYSCALL_MAIN_INLINE(name, err, 5, args) | |
| 307 | #define INTERNAL_SYSCALL_MAIN_0(name, args...) \ | |
| 308 | INTERNAL_SYSCALL_MAIN_INLINE(name, 0, args) | |
| 309 | #define INTERNAL_SYSCALL_MAIN_1(name, args...) \ | |
| 310 | INTERNAL_SYSCALL_MAIN_INLINE(name, 1, args) | |
| 311 | #define INTERNAL_SYSCALL_MAIN_2(name, args...) \ | |
| 312 | INTERNAL_SYSCALL_MAIN_INLINE(name, 2, args) | |
| 313 | #define INTERNAL_SYSCALL_MAIN_3(name, args...) \ | |
| 314 | INTERNAL_SYSCALL_MAIN_INLINE(name, 3, args) | |
| 315 | #define INTERNAL_SYSCALL_MAIN_4(name, args...) \ | |
| 316 | INTERNAL_SYSCALL_MAIN_INLINE(name, 4, args) | |
| 317 | #define INTERNAL_SYSCALL_MAIN_5(name, args...) \ | |
| 318 | INTERNAL_SYSCALL_MAIN_INLINE(name, 5, args) | |
| 319 | ||
| 320 | #define INTERNAL_SYSCALL_MAIN_NCS_0(name, args...) \ | |
| 321 | INTERNAL_SYSCALL_MAIN_NCS(name, 0, args) | |
| 322 | #define INTERNAL_SYSCALL_MAIN_NCS_1(name, args...) \ | |
| 323 | INTERNAL_SYSCALL_MAIN_NCS(name, 1, args) | |
| 324 | #define INTERNAL_SYSCALL_MAIN_NCS_2(name, args...) \ | |
| 325 | INTERNAL_SYSCALL_MAIN_NCS(name, 2, args) | |
| 326 | #define INTERNAL_SYSCALL_MAIN_NCS_3(name, args...) \ | |
| 327 | INTERNAL_SYSCALL_MAIN_NCS(name, 3, args) | |
| 328 | #define INTERNAL_SYSCALL_MAIN_NCS_4(name, args...) \ | |
| 329 | INTERNAL_SYSCALL_MAIN_NCS(name, 4, args) | |
| 330 | #define INTERNAL_SYSCALL_MAIN_NCS_5(name, args...) \ | |
| 331 | INTERNAL_SYSCALL_MAIN_NCS(name, 5, args) | |
| 332 | ||
| 342 | 333 | /* Each object using 6-argument inline syscalls must include a |
| 343 | 334 | definition of __libc_do_syscall. */ |
| 344 | 335 | #ifdef OPTIMIZE_FOR_GCC_5 |
| 345 | # define INTERNAL_SYSCALL_MAIN_6(name, err, args...) \ | |
| 346 | INTERNAL_SYSCALL_MAIN_INLINE(name, err, 6, args) | |
| 336 | # define INTERNAL_SYSCALL_MAIN_6(name, args...) \ | |
| 337 | INTERNAL_SYSCALL_MAIN_INLINE(name, 6, args) | |
| 338 | # define INTERNAL_SYSCALL_MAIN_NCS_6(name, args...) \ | |
| 339 | INTERNAL_SYSCALL_MAIN_NCS(name, 6, args) | |
| 347 | 340 | #else /* GCC 5 */ |
| 348 | # define INTERNAL_SYSCALL_MAIN_6(name, err, arg1, arg2, arg3,		\ | |
| 341 | # define INTERNAL_SYSCALL_MAIN_6(name, arg1, arg2, arg3,		\ | |
| 349 | 342 | 				 arg4, arg5, arg6)			\ |
| 350 | 343 | struct libc_do_syscall_args _xv =					\ |
| 351 | 344 | {									\ |
| ... | ... | @@ -359,52 +352,67 @@ struct libc_do_syscall_args |
| 359 | 352 | : "=a" (resultvar)							\ |
| 360 | 353 | : "i" (__NR_##name), "c" (arg2), "d" (arg3), "S" (arg4), "D" (&_xv) \ |
| 361 | 354 | : "memory", "cc") |
| 355 | # define INTERNAL_SYSCALL_MAIN_NCS_6(name, arg1, arg2, arg3,		\ | |
| 356 | 				 arg4, arg5, arg6)			\ | |
| 357 | struct libc_do_syscall_args _xv =					\ | |
| 358 | {									\ | |
| 359 | (int) (arg1),							\ | |
| 360 | (int) (arg5),							\ | |
| 361 | (int) (arg6)							\ | |
| 362 | };									\ | |
| 363 | asm volatile (							\ | |
| 364 | "movl %1, %%eax\n\t"						\ | |
| 365 | "call __libc_do_syscall"						\ | |
| 366 | : "=a" (resultvar)							\ | |
| 367 | : "a" (name), "c" (arg2), "d" (arg3), "S" (arg4), "D" (&_xv)	\ | |
| 368 | : "memory", "cc") | |
| 362 | 369 | #endif /* GCC 5 */ |
| 363 | #define INTERNAL_SYSCALL(name, err, nr, args...) \ | |
| 370 | ||
| 371 | #define INTERNAL_SYSCALL(name, nr, args...) \ | |
| 364 | 372 | ({									 \ |
| 365 | 373 | register unsigned int resultvar;					 \ |
| 366 | INTERNAL_SYSCALL_MAIN_##nr (name, err, args);			 \ | |
| 374 | INTERNAL_SYSCALL_MAIN_##nr (name, args);			 	 \ | |
| 367 | 375 | (int) resultvar; }) |
| 376 | #define INTERNAL_SYSCALL_NCS(name, nr, args...) \ | |
| 377 | ({									 \ | |
| 378 | register unsigned int resultvar;					 \ | |
| 379 | INTERNAL_SYSCALL_MAIN_NCS_##nr (name, args);		 	 \ | |
| 380 | (int) resultvar; }) | |
| 381 | ||
| 368 | 382 | #if I386_USE_SYSENTER |
| 369 | 383 | # ifdef OPTIMIZE_FOR_GCC_5 |
| 370 | 384 | # ifdef PIC |
| 371 | # define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ | |
| 385 | # define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ | |
| 372 | 386 | LOADREGS_##nr(args)							\ |
| 373 | 387 | asm volatile (							\ |
| 374 | 388 | "call *%%gs:%P2"							\ |
| 375 | 389 | : "=a" (resultvar)							\ |
| 376 | 390 | : "a" (__NR_##name), "i" (offsetof (tcbhead_t, sysinfo))		\ |
| 377 | 391 | ASMARGS_##nr(args) : "memory", "cc") |
| 378 | # define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ | |
| 379 | ({									\ | |
| 380 | register unsigned int resultvar;					\ | |
| 392 | # define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ | |
| 381 | 393 | LOADREGS_##nr(args)							\ |
| 382 | 394 | asm volatile (							\ |
| 383 | 395 | "call *%%gs:%P2"							\ |
| 384 | 396 | : "=a" (resultvar)							\ |
| 385 | 397 | : "a" (name), "i" (offsetof (tcbhead_t, sysinfo))			\ |
| 386 | ASMARGS_##nr(args) : "memory", "cc");				\ | |
| 387 | (int) resultvar; }) | |
| 398 | ASMARGS_##nr(args) : "memory", "cc") | |
| 388 | 399 | # else |
| 389 | # define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ | |
| 400 | # define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ | |
| 390 | 401 | LOADREGS_##nr(args)							\ |
| 391 | 402 | asm volatile (							\ |
| 392 | 403 | "call *_dl_sysinfo"							\ |
| 393 | 404 | : "=a" (resultvar)							\ |
| 394 | 405 | : "a" (__NR_##name) ASMARGS_##nr(args) : "memory", "cc") |
| 395 | # define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ | |
| 396 | ({									\ | |
| 397 | register unsigned int resultvar;					\ | |
| 406 | # define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ | |
| 398 | 407 | LOADREGS_##nr(args)							\ |
| 399 | 408 | asm volatile (							\ |
| 400 | 409 | "call *_dl_sysinfo"							\ |
| 401 | 410 | : "=a" (resultvar)							\ |
| 402 | : "a" (name) ASMARGS_##nr(args) : "memory", "cc");			\ | |
| 403 | (int) resultvar; }) | |
| 411 | : "a" (name) ASMARGS_##nr(args) : "memory", "cc") | |
| 404 | 412 | # endif |
| 405 | 413 | # else /* GCC 5 */ |
| 406 | 414 | # ifdef PIC |
| 407 | # define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ | |
| 415 | # define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ | |
| 408 | 416 | EXTRAVAR_##nr							 \ |
| 409 | 417 | asm volatile (							 \ |
| 410 | 418 | LOADARGS_##nr							 \ |
| ... | ... | @@ -414,9 +422,7 @@ struct libc_do_syscall_args |
| 414 | 422 | : "=a" (resultvar)							 \ |
| 415 | 423 | : "i" (__NR_##name), "i" (offsetof (tcbhead_t, sysinfo))		 \ |
| 416 | 424 | ASMFMT_##nr(args) : "memory", "cc") |
| 417 | # define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ | |
| 418 | ({									 \ | |
| 419 | register unsigned int resultvar;					 \ | |
| 425 | # define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ | |
| 420 | 426 | EXTRAVAR_##nr							 \ |
| 421 | 427 | asm volatile (							 \ |
| 422 | 428 | LOADARGS_##nr							 \ |
| ... | ... | @@ -424,10 +430,9 @@ struct libc_do_syscall_args |
| 424 | 430 | RESTOREARGS_##nr							 \ |
| 425 | 431 | : "=a" (resultvar)							 \ |
| 426 | 432 | : "0" (name), "i" (offsetof (tcbhead_t, sysinfo))			 \ |
| 427 | ASMFMT_##nr(args) : "memory", "cc");				 \ | |
| 428 | (int) resultvar; }) | |
| 433 | ASMFMT_##nr(args) : "memory", "cc") | |
| 429 | 434 | # else |
| 430 | # define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ | |
| 435 | # define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ | |
| 431 | 436 | EXTRAVAR_##nr							 \ |
| 432 | 437 | asm volatile (							 \ |
| 433 | 438 | LOADARGS_##nr							 \ |
| ... | ... | @@ -436,38 +441,32 @@ struct libc_do_syscall_args |
| 436 | 441 | RESTOREARGS_##nr							 \ |
| 437 | 442 | : "=a" (resultvar)							 \ |
| 438 | 443 | : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc") |
| 439 | # define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ | |
| 440 | ({									 \ | |
| 441 | register unsigned int resultvar;					 \ | |
| 444 | # define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ | |
| 442 | 445 | EXTRAVAR_##nr							 \ |
| 443 | 446 | asm volatile (							 \ |
| 444 | 447 | LOADARGS_##nr							 \ |
| 445 | 448 | "call *_dl_sysinfo\n\t"						 \ |
| 446 | 449 | RESTOREARGS_##nr							 \ |
| 447 | 450 | : "=a" (resultvar)							 \ |
| 448 | : "0" (name) ASMFMT_##nr(args) : "memory", "cc");			 \ | |
| 449 | (int) resultvar; }) | |
| 451 | : "0" (name) ASMFMT_##nr(args) : "memory", "cc") | |
| 450 | 452 | # endif |
| 451 | 453 | # endif /* GCC 5 */ |
| 452 | 454 | #else |
| 453 | 455 | # ifdef OPTIMIZE_FOR_GCC_5 |
| 454 | # define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ | |
| 456 | # define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ | |
| 455 | 457 | LOADREGS_##nr(args)							\ |
| 456 | 458 | asm volatile (							\ |
| 457 | 459 | "int $0x80"								\ |
| 458 | 460 | : "=a" (resultvar)							\ |
| 459 | 461 | : "a" (__NR_##name) ASMARGS_##nr(args) : "memory", "cc") |
| 460 | # define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ | |
| 461 | ({									\ | |
| 462 | register unsigned int resultvar;					\ | |
| 462 | # define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ | |
| 463 | 463 | LOADREGS_##nr(args)							\ |
| 464 | 464 | asm volatile (							\ |
| 465 | 465 | "int $0x80"								\ |
| 466 | 466 | : "=a" (resultvar)							\ |
| 467 | : "a" (name) ASMARGS_##nr(args) : "memory", "cc");			\ | |
| 468 | (int) resultvar; }) | |
| 467 | : "a" (name) ASMARGS_##nr(args) : "memory", "cc") | |
| 469 | 468 | # else /* GCC 5 */ |
| 470 | # define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ | |
| 469 | # define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ | |
| 471 | 470 | EXTRAVAR_##nr							 \ |
| 472 | 471 | asm volatile (							 \ |
| 473 | 472 | LOADARGS_##nr							 \ |
| ... | ... | @@ -476,30 +475,17 @@ struct libc_do_syscall_args |
| 476 | 475 | RESTOREARGS_##nr							 \ |
| 477 | 476 | : "=a" (resultvar)							 \ |
| 478 | 477 | : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc") |
| 479 | # define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ | |
| 480 | ({									 \ | |
| 481 | register unsigned int resultvar;					 \ | |
| 478 | # define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \ | |
| 482 | 479 | EXTRAVAR_##nr							 \ |
| 483 | 480 | asm volatile (							 \ |
| 484 | 481 | LOADARGS_##nr							 \ |
| 485 | 482 | "int $0x80\n\t"							 \ |
| 486 | 483 | RESTOREARGS_##nr							 \ |
| 487 | 484 | : "=a" (resultvar)							 \ |
| 488 | : "0" (name) ASMFMT_##nr(args) : "memory", "cc");			 \ | |
| 489 | (int) resultvar; }) | |
| 485 | : "0" (name) ASMFMT_##nr(args) : "memory", "cc") | |
| 490 | 486 | # endif /* GCC 5 */ |
| 491 | 487 | #endif |
| 492 | 488 | |
| 493 | #undef INTERNAL_SYSCALL_DECL | |
| 494 | #define INTERNAL_SYSCALL_DECL(err) do { } while (0) | |
| 495 | ||
| 496 | #undef INTERNAL_SYSCALL_ERROR_P | |
| 497 | #define INTERNAL_SYSCALL_ERROR_P(val, err) \ | |
| 498 | ((unsigned int) (val) >= 0xfffff001u) | |
| 499 | ||
| 500 | #undef INTERNAL_SYSCALL_ERRNO | |
| 501 | #define INTERNAL_SYSCALL_ERRNO(val, err)	(-(val)) | |
| 502 | ||
| 503 | 489 | #define LOADARGS_0 |
| 504 | 490 | #ifdef __PIC__ |
| 505 | 491 | # if I386_USE_SYSENTER && defined PIC |
| ... | ... | @@ -618,20 +604,6 @@ struct libc_do_syscall_args |
| 618 | 604 | # define EXTRAVAR_5 |
| 619 | 605 | #endif |
| 620 | 606 | |
| 621 | /* Consistency check for position-independent code. */ | |
| 622 | #if defined __PIC__ && !defined OPTIMIZE_FOR_GCC_5 | |
| 623 | # define check_consistency()						 \ | |
| 624 | ({ int __res;								 \ | |
| 625 | __asm__ __volatile__						 \ | |
| 626 | (LOAD_PIC_REG_STR (cx) ";"					 \ | |
| 627 | 	"subl %%ebx, %%ecx;"						 \ | |
| 628 | 	"je 1f;"							 \ | |
| 629 | 	"ud2;"								 \ | |
| 630 | 	"1:\n"								 \ | |
| 631 | 	: "=c" (__res));						 \ | |
| 632 | __res; }) | |
| 633 | #endif | |
| 634 | ||
| 635 | 607 | #endif	/* __ASSEMBLER__ */ |
| 636 | 608 | |
| 637 | 609 | |
| ... | ... | @@ -662,4 +634,9 @@ struct libc_do_syscall_args |
| 662 | 634 | # endif |
| 663 | 635 | #endif |
| 664 | 636 | |
| 637 | /* Each shadow stack slot takes 4 bytes. Assuming that each stack | |
| 638 | frame takes 128 bytes, this is used to compute shadow stack size | |
| 639 | from stack size. */ | |
| 640 | #define STACK_SIZE_TO_SHADOW_STACK_SIZE_SHIFT 5 | |
| 641 | ||
| 665 | 642 | #endif /* linux/i386/sysdep.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/bits/stat.h deleted-149| ... | ... | @@ -1,149 +0,0 @@ |
| 1 | /* Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #if !defined _SYS_STAT_H && !defined _FCNTL_H | |
| 19 | # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #ifndef _BITS_STAT_H | |
| 23 | #define _BITS_STAT_H	1 | |
| 24 | ||
| 25 | /* Versions of the `struct stat' data structure. */ | |
| 26 | #define _STAT_VER_KERNEL	0 | |
| 27 | #define _STAT_VER_LINUX		1 | |
| 28 | #define _STAT_VER		_STAT_VER_LINUX | |
| 29 | ||
| 30 | /* Versions of the `xmknod' interface. */ | |
| 31 | #define _MKNOD_VER_LINUX	0 | |
| 32 | ||
| 33 | struct stat | |
| 34 | { | |
| 35 | __dev_t st_dev;		/* Device. */ | |
| 36 | __ino_t st_ino;		/* File serial number.	*/ | |
| 37 | __nlink_t st_nlink;		/* Link count. */ | |
| 38 | __mode_t st_mode;		/* File mode. */ | |
| 39 | __uid_t st_uid;		/* User ID of the file's owner.	*/ | |
| 40 | __gid_t st_gid;		/* Group ID of the file's group.*/ | |
| 41 | int __glibc_reserved0; | |
| 42 | __dev_t st_rdev;		/* Device number, if device. */ | |
| 43 | __off_t st_size;		/* Size of file, in bytes. */ | |
| 44 | #ifdef __USE_XOPEN2K8 | |
| 45 | /* Nanosecond resolution timestamps are stored in a format | |
| 46 | equivalent to 'struct timespec'. This is the type used | |
| 47 | whenever possible but the Unix namespace rules do not allow the | |
| 48 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 49 | Therefore we have to handle the use of this header in strictly | |
| 50 | standard-compliant sources special. */ | |
| 51 | struct timespec st_atim;		/* Time of last access. */ | |
| 52 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 53 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 54 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 55 | # define st_mtime st_mtim.tv_sec | |
| 56 | # define st_ctime st_ctim.tv_sec | |
| 57 | #else | |
| 58 | __time_t st_atime;			/* Time of last access. */ | |
| 59 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 60 | __time_t st_mtime;			/* Time of last modification. */ | |
| 61 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 62 | __time_t st_ctime;			/* Time of last status change. */ | |
| 63 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 64 | #endif | |
| 65 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ | |
| 66 | __blkcnt_t st_blocks;	/* Nr. 512-byte blocks allocated. */ | |
| 67 | long int __glibc_reserved[3]; | |
| 68 | }; | |
| 69 | ||
| 70 | #ifdef __USE_LARGEFILE64 | |
| 71 | /* Note stat64 is the same shape as stat. */ | |
| 72 | struct stat64 | |
| 73 | { | |
| 74 | __dev_t st_dev;		/* Device. */ | |
| 75 | __ino64_t st_ino;		/* File serial number. */ | |
| 76 | __nlink_t st_nlink;		/* Link count. */ | |
| 77 | __mode_t st_mode;		/* File mode. */ | |
| 78 | __uid_t st_uid;		/* User ID of the file's owner.	*/ | |
| 79 | __gid_t st_gid;		/* Group ID of the file's group.*/ | |
| 80 | int __glibc_reserved0; | |
| 81 | __dev_t st_rdev;		/* Device number, if device. */ | |
| 82 | __off_t st_size;		/* Size of file, in bytes. */ | |
| 83 | #ifdef __USE_XOPEN2K8 | |
| 84 | /* Nanosecond resolution timestamps are stored in a format | |
| 85 | equivalent to 'struct timespec'. This is the type used | |
| 86 | whenever possible but the Unix namespace rules do not allow the | |
| 87 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 88 | Therefore we have to handle the use of this header in strictly | |
| 89 | standard-compliant sources special. */ | |
| 90 | struct timespec st_atim;		/* Time of last access. */ | |
| 91 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 92 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 93 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 94 | # define st_mtime st_mtim.tv_sec | |
| 95 | # define st_ctime st_ctim.tv_sec | |
| 96 | #else | |
| 97 | __time_t st_atime;			/* Time of last access. */ | |
| 98 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 99 | __time_t st_mtime;			/* Time of last modification. */ | |
| 100 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 101 | __time_t st_ctime;			/* Time of last status change. */ | |
| 102 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 103 | #endif | |
| 104 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ | |
| 105 | __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated. */ | |
| 106 | long int __glibc_reserved[3]; | |
| 107 | }; | |
| 108 | #endif | |
| 109 | ||
| 110 | /* Tell code we have these members. */ | |
| 111 | #define	_STATBUF_ST_BLKSIZE | |
| 112 | #define _STATBUF_ST_RDEV | |
| 113 | /* Nanosecond resolution time values are supported. */ | |
| 114 | #define _STATBUF_ST_NSEC | |
| 115 | ||
| 116 | /* Encoding of the file mode. */ | |
| 117 | ||
| 118 | #define	__S_IFMT	0170000	/* These bits determine file type. */ | |
| 119 | ||
| 120 | /* File types. */ | |
| 121 | #define	__S_IFDIR	0040000	/* Directory. */ | |
| 122 | #define	__S_IFCHR	0020000	/* Character device. */ | |
| 123 | #define	__S_IFBLK	0060000	/* Block device. */ | |
| 124 | #define	__S_IFREG	0100000	/* Regular file. */ | |
| 125 | #define	__S_IFIFO	0010000	/* FIFO. */ | |
| 126 | #define	__S_IFLNK	0120000	/* Symbolic link. */ | |
| 127 | #define	__S_IFSOCK	0140000	/* Socket. */ | |
| 128 | ||
| 129 | /* POSIX.1b objects. Note that these macros always evaluate to zero. But | |
| 130 | they do it by enforcing the correct use of the macros. */ | |
| 131 | #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 132 | #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 133 | #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 134 | ||
| 135 | /* Protection bits. */ | |
| 136 | ||
| 137 | #define	__S_ISUID	04000	/* Set user ID on execution. */ | |
| 138 | #define	__S_ISGID	02000	/* Set group ID on execution. */ | |
| 139 | #define	__S_ISVTX	01000	/* Save swapped text after use (sticky). */ | |
| 140 | #define	__S_IREAD	0400	/* Read by owner. */ | |
| 141 | #define	__S_IWRITE	0200	/* Write by owner. */ | |
| 142 | #define	__S_IEXEC	0100	/* Execute by owner. */ | |
| 143 | ||
| 144 | #ifdef __USE_ATFILE | |
| 145 | # define UTIME_NOW	((1l << 30) - 1l) | |
| 146 | # define UTIME_OMIT	((1l << 30) - 2l) | |
| 147 | #endif | |
| 148 | ||
| 149 | #endif	/* bits//stat.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* System-specific settings for dynamic linker code. IA-64 version. |
| 2 | Copyright (C) 2003-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2003-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/kernel-features.h+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. |
| 3 | Copyright (C) 2010-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 2010-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/sysdep.h+15-47| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999. |
| 4 | 4 | Based on code originally written by David Mosberger-Tang |
| ... | ... | @@ -46,12 +46,6 @@ |
| 46 | 46 | #undef SYS_ify |
| 47 | 47 | #define SYS_ify(syscall_name)	__NR_##syscall_name |
| 48 | 48 | |
| 49 | /* This is to help the old kernel headers where __NR_semtimedop is not | |
| 50 | available. */ | |
| 51 | #ifndef __NR_semtimedop | |
| 52 | # define __NR_semtimedop 1247 | |
| 53 | #endif | |
| 54 | ||
| 55 | 49 | #if defined USE_DL_SYSINFO \ |
| 56 | 50 | 	&& (IS_IN (libc) \ |
| 57 | 51 | 	 || IS_IN (libpthread) || IS_IN (librt)) |
| ... | ... | @@ -95,6 +89,7 @@ |
| 95 | 89 | |
| 96 | 90 | /* We don't want the label for the error handler to be visible in the symbol |
| 97 | 91 | table when we define it here. */ |
| 92 | #undef SYSCALL_ERROR_LABEL | |
| 98 | 93 | #define SYSCALL_ERROR_LABEL __syscall_error |
| 99 | 94 | |
| 100 | 95 | #undef PSEUDO |
| ... | ... | @@ -177,6 +172,9 @@ |
| 177 | 172 | |
| 178 | 173 | #else /* not __ASSEMBLER__ */ |
| 179 | 174 | |
| 175 | #undef HAVE_INTERNAL_BRK_ADDR_SYMBOL | |
| 176 | #define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 | |
| 177 | ||
| 180 | 178 | #define BREAK_INSN_1(num) "break " #num ";;\n\t" |
| 181 | 179 | #define BREAK_INSN(num) BREAK_INSN_1(num) |
| 182 | 180 | |
| ... | ... | @@ -191,13 +189,13 @@ |
| 191 | 189 | |
| 192 | 190 | #ifdef IA64_USE_NEW_STUB |
| 193 | 191 | |
| 194 | # define DO_INLINE_SYSCALL_NCS(name, nr, args...)			 \ | |
| 192 | # define INTERNAL_SYSCALL_NCS(name, nr, args...)			 \ | |
| 193 | ({									 \ | |
| 195 | 194 | LOAD_ARGS_##nr (args)						 \ |
| 196 | 195 | register long _r8 __asm ("r8");					 \ |
| 197 | 196 | register long _r10 __asm ("r10");					 \ |
| 198 | 197 | register long _r15 __asm ("r15") = name;				 \ |
| 199 | 198 | register void *_b7 __asm ("b7") = ((tcbhead_t *)__thread_self)->__private;\ |
| 200 | long _retval;							 \ | |
| 201 | 199 | LOAD_REGS_##nr							 \ |
| 202 | 200 | /*									 \ |
| 203 | 201 | * Don't specify any unwind info here. We mark ar.pfs as		 \ |
| ... | ... | @@ -209,60 +207,30 @@ |
| 209 | 207 | 			ASM_OUTARGS_##nr				 \ |
| 210 | 208 | 		 : "0" (_b7), "3" (_r15) ASM_ARGS_##nr		 \ |
| 211 | 209 | 		 : "memory", "ar.pfs" ASM_CLOBBERS_##nr);		 \ |
| 212 | _retval = _r8; | |
| 210 | _r10 == -1 ? -_r8 : _r8;						 \ | |
| 211 | }) | |
| 213 | 212 | |
| 214 | 213 | #else /* !IA64_USE_NEW_STUB */ |
| 215 | 214 | |
| 216 | # define DO_INLINE_SYSCALL_NCS(name, nr, args...)		\ | |
| 215 | # define INTERNAL_SYSCALL_NCS(name, nr, args...)		\ | |
| 216 | ({								\ | |
| 217 | 217 | LOAD_ARGS_##nr (args)					\ |
| 218 | 218 | register long _r8 asm ("r8");				\ |
| 219 | 219 | register long _r10 asm ("r10");				\ |
| 220 | 220 | register long _r15 asm ("r15") = name;			\ |
| 221 | long _retval;						\ | |
| 222 | 221 | LOAD_REGS_##nr						\ |
| 223 | 222 | __asm __volatile (BREAK_INSN (__IA64_BREAK_SYSCALL)		\ |
| 224 | 223 | 		 : "=r" (_r8), "=r" (_r10), "=r" (_r15)	\ |
| 225 | 224 | 			ASM_OUTARGS_##nr			\ |
| 226 | 225 | 		 : "2" (_r15) ASM_ARGS_##nr		\ |
| 227 | 226 | 		 : "memory" ASM_CLOBBERS_##nr);		\ |
| 228 | _retval = _r8; | |
| 227 | _r10 == -1 ? -_r8 : _r8;					\ | |
| 228 | }) | |
| 229 | 229 | |
| 230 | 230 | #endif /* !IA64_USE_NEW_STUB */ |
| 231 | 231 | |
| 232 | #define DO_INLINE_SYSCALL(name, nr, args...)	\ | |
| 233 | DO_INLINE_SYSCALL_NCS (__NR_##name, nr, ##args) | |
| 234 | ||
| 235 | #undef INLINE_SYSCALL | |
| 236 | #define INLINE_SYSCALL(name, nr, args...)		\ | |
| 237 | ({							\ | |
| 238 | DO_INLINE_SYSCALL_NCS (__NR_##name, nr, args)	\ | |
| 239 | if (_r10 == -1)					\ | |
| 240 | {							\ | |
| 241 | 	__set_errno (_retval);				\ | |
| 242 | 	_retval = -1;					\ | |
| 243 | }							\ | |
| 244 | _retval; }) | |
| 245 | ||
| 246 | #undef INTERNAL_SYSCALL_DECL | |
| 247 | #define INTERNAL_SYSCALL_DECL(err) long int err __attribute__ ((unused)) | |
| 248 | ||
| 249 | #undef INTERNAL_SYSCALL | |
| 250 | #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)	\ | |
| 251 | ({							\ | |
| 252 | DO_INLINE_SYSCALL_NCS (name, nr, args)		\ | |
| 253 | err = _r10;						\ | |
| 254 | _retval; }) | |
| 255 | #define INTERNAL_SYSCALL(name, err, nr, args...)	\ | |
| 256 | INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) | |
| 257 | ||
| 258 | #undef INTERNAL_SYSCALL_ERROR_P | |
| 259 | #define INTERNAL_SYSCALL_ERROR_P(val, err)		\ | |
| 260 | ({ (void) (val);					\ | |
| 261 | (err == -1);					\ | |
| 262 | }) | |
| 263 | ||
| 264 | #undef INTERNAL_SYSCALL_ERRNO | |
| 265 | #define INTERNAL_SYSCALL_ERRNO(val, err)	(val) | |
| 232 | #define INTERNAL_SYSCALL(name, nr, args...)	\ | |
| 233 | INTERNAL_SYSCALL_NCS (__NR_##name, nr, ##args) | |
| 266 | 234 | |
| 267 | 235 | #define LOAD_ARGS_0() |
| 268 | 236 | #define LOAD_REGS_0 |
lib/libc/glibc/sysdeps/unix/sysv/linux/include/sys/timex.h+172-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Internal declarations for sys/timex.h. |
| 2 | Copyright (C) 2014-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2014-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -23,7 +23,178 @@ |
| 23 | 23 | |
| 24 | 24 | # ifndef _ISOMAC |
| 25 | 25 | |
| 26 | extern int __adjtimex (struct timex *__ntx); | |
| 26 | 27 | libc_hidden_proto (__adjtimex) |
| 27 | 28 | |
| 29 | # include <time.h> | |
| 30 | # include <struct___timeval64.h> | |
| 31 | /* Local definition of 64 bit time supporting timex struct */ | |
| 32 | # if __TIMESIZE == 64 | |
| 33 | # define __timex64 timex | |
| 34 | # define __clock_adjtime64 __clock_adjtime | |
| 35 | # define ___adjtimex64 ___adjtimex | |
| 36 | # define __ntptimeval64 ntptimeval | |
| 37 | # define __ntp_gettime64 __ntp_gettime | |
| 38 | # define __ntp_gettimex64 __ntp_gettimex | |
| 39 | # else | |
| 40 | ||
| 41 | struct __timex64 | |
| 42 | { | |
| 43 | unsigned int modes; /* mode selector */ | |
| 44 | int :32; /* pad */ | |
| 45 | long long int offset; /* time offset (usec) */ | |
| 46 | long long int freq; /* frequency offset (scaled ppm) */ | |
| 47 | long long int maxerror; /* maximum error (usec) */ | |
| 48 | long long int esterror; /* estimated error (usec) */ | |
| 49 | int status; /* clock command/status */ | |
| 50 | int :32; /* pad */ | |
| 51 | long long int constant; /* pll time constant */ | |
| 52 | long long int precision; /* clock precision (usec) (read only) */ | |
| 53 | long long int tolerance; /* clock frequency tolerance (ppm) (ro) */ | |
| 54 | struct __timeval64 time; /* (read only, except for ADJ_SETOFFSET) */ | |
| 55 | long long int tick; /* (modified) usecs between clock ticks */ | |
| 56 | long long int ppsfreq; /* pps frequency (scaled ppm) (ro) */ | |
| 57 | long long int jitter; /* pps jitter (us) (ro) */ | |
| 58 | int shift; /* interval duration (s) (shift) (ro) */ | |
| 59 | int :32; /* pad */ | |
| 60 | long long int stabil; /* pps stability (scaled ppm) (ro) */ | |
| 61 | long long int jitcnt; /* jitter limit exceeded (ro) */ | |
| 62 | long long int calcnt; /* calibration intervals (ro) */ | |
| 63 | long long int errcnt; /* calibration errors (ro) */ | |
| 64 | long long int stbcnt; /* stability limit exceeded (ro) */ | |
| 65 | ||
| 66 | int tai; /* TAI offset (ro) */ | |
| 67 | ||
| 68 | int :32; | |
| 69 | int :32; | |
| 70 | int :32; | |
| 71 | int :32; | |
| 72 | int :32; | |
| 73 | int :32; | |
| 74 | int :32; | |
| 75 | int :32; | |
| 76 | int :32; | |
| 77 | int :32; | |
| 78 | int :32; | |
| 79 | }; | |
| 80 | extern int __clock_adjtime64 (const clockid_t clock_id, struct __timex64 *tx64); | |
| 81 | libc_hidden_proto (__clock_adjtime64); | |
| 82 | extern int ___adjtimex64 (struct __timex64 *tx64); | |
| 83 | libc_hidden_proto (___adjtimex64) | |
| 84 | ||
| 85 | struct __ntptimeval64 | |
| 86 | { | |
| 87 | struct __timeval64 time;	/* current time (ro) */ | |
| 88 | long int maxerror;	/* maximum error (us) (ro) */ | |
| 89 | long int esterror;	/* estimated error (us) (ro) */ | |
| 90 | long int tai;		/* TAI offset (ro) */ | |
| 91 | ||
| 92 | long int __glibc_reserved1; | |
| 93 | long int __glibc_reserved2; | |
| 94 | long int __glibc_reserved3; | |
| 95 | long int __glibc_reserved4; | |
| 96 | }; | |
| 97 | extern int __ntp_gettime64 (struct __ntptimeval64 *ntv); | |
| 98 | libc_hidden_proto (__ntp_gettime64) | |
| 99 | extern int __ntp_gettimex64 (struct __ntptimeval64 *ntv); | |
| 100 | libc_hidden_proto (__ntp_gettimex64) | |
| 101 | ||
| 102 | # endif | |
| 103 | ||
| 104 | /* Convert a known valid struct timex into a struct __timex64. */ | |
| 105 | static inline struct __timex64 | |
| 106 | valid_timex_to_timex64 (const struct timex tx) | |
| 107 | { | |
| 108 | struct __timex64 tx64; | |
| 109 | ||
| 110 | tx64.modes = tx.modes; | |
| 111 | tx64.offset = tx.offset; | |
| 112 | tx64.freq = tx.freq; | |
| 113 | tx64.maxerror = tx.maxerror; | |
| 114 | tx64.esterror = tx.esterror; | |
| 115 | tx64.status = tx.status; | |
| 116 | tx64.constant = tx.constant; | |
| 117 | tx64.precision = tx.precision; | |
| 118 | tx64.tolerance = tx.tolerance; | |
| 119 | tx64.time = valid_timeval_to_timeval64 (tx.time); | |
| 120 | tx64.tick = tx.tick; | |
| 121 | tx64.ppsfreq = tx.ppsfreq; | |
| 122 | tx64.jitter = tx.jitter; | |
| 123 | tx64.shift = tx.shift; | |
| 124 | tx64.stabil = tx.stabil; | |
| 125 | tx64.jitcnt = tx.jitcnt; | |
| 126 | tx64.calcnt = tx.calcnt; | |
| 127 | tx64.errcnt = tx.errcnt; | |
| 128 | tx64.stbcnt = tx.stbcnt; | |
| 129 | tx64.tai = tx.tai; | |
| 130 | ||
| 131 | return tx64; | |
| 132 | } | |
| 133 | ||
| 134 | /* Convert a known valid struct __timex64 into a struct timex. */ | |
| 135 | static inline struct timex | |
| 136 | valid_timex64_to_timex (const struct __timex64 tx64) | |
| 137 | { | |
| 138 | struct timex tx; | |
| 139 | ||
| 140 | tx.modes = tx64.modes; | |
| 141 | tx.offset = tx64.offset; | |
| 142 | tx.freq = tx64.freq; | |
| 143 | tx.maxerror = tx64.maxerror; | |
| 144 | tx.esterror = tx64.esterror; | |
| 145 | tx.status = tx64.status; | |
| 146 | tx.constant = tx64.constant; | |
| 147 | tx.precision = tx64.precision; | |
| 148 | tx.tolerance = tx64.tolerance; | |
| 149 | tx.time = valid_timeval64_to_timeval (tx64.time); | |
| 150 | tx.tick = tx64.tick; | |
| 151 | tx.ppsfreq = tx64.ppsfreq; | |
| 152 | tx.jitter = tx64.jitter; | |
| 153 | tx.shift = tx64.shift; | |
| 154 | tx.stabil = tx64.stabil; | |
| 155 | tx.jitcnt = tx64.jitcnt; | |
| 156 | tx.calcnt = tx64.calcnt; | |
| 157 | tx.errcnt = tx64.errcnt; | |
| 158 | tx.stbcnt = tx64.stbcnt; | |
| 159 | tx.tai = tx64.tai; | |
| 160 | ||
| 161 | return tx; | |
| 162 | } | |
| 163 | ||
| 164 | /* Convert a known valid struct ntptimeval into a struct __ntptimeval64. */ | |
| 165 | static inline struct __ntptimeval64 | |
| 166 | valid_ntptimeval_to_ntptimeval64 (const struct ntptimeval ntv) | |
| 167 | { | |
| 168 | struct __ntptimeval64 ntv64; | |
| 169 | ||
| 170 | ntv64.time = valid_timeval_to_timeval64 (ntv.time); | |
| 171 | ntv64.maxerror = ntv.maxerror; | |
| 172 | ntv64.esterror = ntv.esterror; | |
| 173 | ntv64.tai = ntv.tai; | |
| 174 | ntv64.__glibc_reserved1 = 0; | |
| 175 | ntv64.__glibc_reserved2 = 0; | |
| 176 | ntv64.__glibc_reserved3 = 0; | |
| 177 | ntv64.__glibc_reserved4 = 0; | |
| 178 | ||
| 179 | return ntv64; | |
| 180 | } | |
| 181 | ||
| 182 | /* Convert a known valid struct __ntptimeval64 into a struct ntptimeval. */ | |
| 183 | static inline struct ntptimeval | |
| 184 | valid_ntptimeval64_to_ntptimeval (const struct __ntptimeval64 ntp64) | |
| 185 | { | |
| 186 | struct ntptimeval ntp; | |
| 187 | ||
| 188 | ntp.time = valid_timeval64_to_timeval (ntp64.time); | |
| 189 | ntp.maxerror = ntp64.maxerror; | |
| 190 | ntp.esterror = ntp64.esterror; | |
| 191 | ntp.tai = ntp64.tai; | |
| 192 | ntp.__glibc_reserved1 = 0; | |
| 193 | ntp.__glibc_reserved2 = 0; | |
| 194 | ntp.__glibc_reserved3 = 0; | |
| 195 | ntp.__glibc_reserved4 = 0; | |
| 196 | ||
| 197 | return ntp; | |
| 198 | } | |
| 28 | 199 | # endif /* _ISOMAC */ |
| 29 | 200 | #endif /* sys/timex.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h+11-5| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. |
| 3 | Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -49,10 +49,6 @@ |
| 49 | 49 | SH this appeared first in 2.6.19-rc1, on ia64 in 2.6.22-rc1. */ |
| 50 | 50 | #define __ASSUME_PSELECT	1 |
| 51 | 51 | |
| 52 | /* The *at syscalls were introduced just after 2.6.16-rc1. On PPC | |
| 53 | they were introduced in 2.6.17-rc1, on SH in 2.6.19-rc1. */ | |
| 54 | #define __ASSUME_ATFCTS	1 | |
| 55 | ||
| 56 | 52 | /* Support for inter-process robust mutexes was added in 2.6.17 (but |
| 57 | 53 | some architectures lack futex_atomic_cmpxchg_inatomic in some |
| 58 | 54 | configurations). */ |
| ... | ... | @@ -81,6 +77,8 @@ |
| 81 | 77 | #define __ASSUME_ACCEPT4_SYSCALL	1 |
| 82 | 78 | #define __ASSUME_RECVMMSG_SYSCALL	1 |
| 83 | 79 | #define __ASSUME_SENDMMSG_SYSCALL	1 |
| 80 | #define __ASSUME_GETSOCKOPT_SYSCALL	1 | |
| 81 | #define __ASSUME_SETSOCKOPT_SYSCALL	1 | |
| 84 | 82 | |
| 85 | 83 | /* Support for SysV IPC through wired syscalls. All supported architectures |
| 86 | 84 | either support ipc syscall and/or all the ipc correspondent syscalls. */ |
| ... | ... | @@ -214,4 +212,12 @@ |
| 214 | 212 | # define __ASSUME_WAITID_PID0_P_PGID |
| 215 | 213 | #endif |
| 216 | 214 | |
| 215 | /* The faccessat2 system call was introduced across all architectures | |
| 216 | in Linux 5.8. */ | |
| 217 | #if __LINUX_KERNEL_VERSION >= 0x050800 | |
| 218 | # define __ASSUME_FACCESSAT2 1 | |
| 219 | #else | |
| 220 | # define __ASSUME_FACCESSAT2 0 | |
| 221 | #endif | |
| 222 | ||
| 217 | 223 | #endif /* kernel-features.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/kernel_stat.h created+22| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | /* Internal definitions for stat functions. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* The default Linux ABI assumes only LFS support. */ | |
| 20 | #define XSTAT_IS_XSTAT64 1 | |
| 21 | #define STATFS_IS_STATFS64 __STATFS_MATCHES_STATFS64 | |
| 22 | #define STAT_IS_KERNEL_STAT 1 |
lib/libc/glibc/sysdeps/unix/sysv/linux/kstat_cp.h created+2| ... | ... | @@ -0,0 +1,2 @@ |
| 1 | /* Empty, it is overridden by an architecture which might require copy to or | |
| 2 | from a kernel_stat stat struct to glibc export stat{64}. */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/lstat.c created+31| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | /* Get file status. Linux version. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <sys/stat.h> | |
| 20 | #include <fcntl.h> | |
| 21 | #include <kernel_stat.h> | |
| 22 | ||
| 23 | #if !XSTAT_IS_XSTAT64 | |
| 24 | int | |
| 25 | __lstat (const char *file, struct stat *buf) | |
| 26 | { | |
| 27 | return __fstatat (AT_FDCWD, file, buf, AT_SYMLINK_NOFOLLOW); | |
| 28 | } | |
| 29 | ||
| 30 | weak_alias (__lstat, lstat) | |
| 31 | #endif |
lib/libc/glibc/sysdeps/unix/sysv/linux/lstat64.c created+51| ... | ... | @@ -0,0 +1,51 @@ |
| 1 | /* Get file status. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #define __lstat __redirect___lstat | |
| 20 | #define lstat __redirect_lstat | |
| 21 | #include <sys/stat.h> | |
| 22 | #include <fcntl.h> | |
| 23 | #include <kernel_stat.h> | |
| 24 | #include <stat_t64_cp.h> | |
| 25 | ||
| 26 | int | |
| 27 | __lstat64_time64 (const char *file, struct __stat64_t64 *buf) | |
| 28 | { | |
| 29 | return __fstatat64_time64 (AT_FDCWD, file, buf, AT_SYMLINK_NOFOLLOW); | |
| 30 | } | |
| 31 | #if __TIMESIZE != 64 | |
| 32 | hidden_def (__lstat64_time64) | |
| 33 | ||
| 34 | int | |
| 35 | __lstat64 (const char *file, struct stat64 *buf) | |
| 36 | { | |
| 37 | struct __stat64_t64 st_t64; | |
| 38 | return __lstat64_time64 (file, &st_t64) | |
| 39 | 	 ?: __cp_stat64_t64_stat64 (&st_t64, buf); | |
| 40 | } | |
| 41 | #endif | |
| 42 | hidden_def (__lstat64) | |
| 43 | weak_alias (__lstat64, lstat64) | |
| 44 | ||
| 45 | #undef __lstat | |
| 46 | #undef lstat | |
| 47 | ||
| 48 | #if XSTAT_IS_XSTAT64 | |
| 49 | strong_alias (__lstat64, __lstat) | |
| 50 | weak_alias (__lstat64, lstat) | |
| 51 | #endif |
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/bits/stat.h deleted-172| ... | ... | @@ -1,172 +0,0 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #if !defined _SYS_STAT_H && !defined _FCNTL_H | |
| 19 | # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #ifndef _BITS_STAT_H | |
| 23 | #define _BITS_STAT_H	1 | |
| 24 | ||
| 25 | /* Versions of the `struct stat' data structure. */ | |
| 26 | #define _STAT_VER_LINUX_OLD	1 | |
| 27 | #define _STAT_VER_KERNEL	1 | |
| 28 | #define _STAT_VER_SVR4		2 | |
| 29 | #define _STAT_VER_LINUX		3 | |
| 30 | #define _STAT_VER		_STAT_VER_LINUX	/* The one defined below. */ | |
| 31 | ||
| 32 | /* Versions of the `xmknod' interface. */ | |
| 33 | #define _MKNOD_VER_LINUX	1 | |
| 34 | #define _MKNOD_VER_SVR4		2 | |
| 35 | #define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below. */ | |
| 36 | ||
| 37 | ||
| 38 | struct stat | |
| 39 | { | |
| 40 | __dev_t st_dev;			/* Device. */ | |
| 41 | unsigned short int __pad1; | |
| 42 | #ifndef __USE_FILE_OFFSET64 | |
| 43 | __ino_t st_ino;			/* File serial number.	*/ | |
| 44 | #else | |
| 45 | __ino_t __st_ino;			/* 32bit file serial number.	*/ | |
| 46 | #endif | |
| 47 | __mode_t st_mode;			/* File mode. */ | |
| 48 | __nlink_t st_nlink;			/* Link count. */ | |
| 49 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 50 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 51 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 52 | unsigned short int __pad2; | |
| 53 | #ifndef __USE_FILE_OFFSET64 | |
| 54 | __off_t st_size;			/* Size of file, in bytes. */ | |
| 55 | #else | |
| 56 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 57 | #endif | |
| 58 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 59 | ||
| 60 | #ifndef __USE_FILE_OFFSET64 | |
| 61 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 62 | #else | |
| 63 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 64 | #endif | |
| 65 | #ifdef __USE_XOPEN2K8 | |
| 66 | /* Nanosecond resolution timestamps are stored in a format | |
| 67 | equivalent to 'struct timespec'. This is the type used | |
| 68 | whenever possible but the Unix namespace rules do not allow the | |
| 69 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 70 | Therefore we have to handle the use of this header in strictly | |
| 71 | standard-compliant sources special. */ | |
| 72 | struct timespec st_atim;		/* Time of last access. */ | |
| 73 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 74 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 75 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 76 | # define st_mtime st_mtim.tv_sec | |
| 77 | # define st_ctime st_ctim.tv_sec | |
| 78 | #else | |
| 79 | __time_t st_atime;			/* Time of last access. */ | |
| 80 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 81 | __time_t st_mtime;			/* Time of last modification. */ | |
| 82 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 83 | __time_t st_ctime;			/* Time of last status change. */ | |
| 84 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 85 | #endif | |
| 86 | #ifndef __USE_FILE_OFFSET64 | |
| 87 | unsigned long int __glibc_reserved4; | |
| 88 | unsigned long int __glibc_reserved5; | |
| 89 | #else | |
| 90 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 91 | #endif | |
| 92 | }; | |
| 93 | ||
| 94 | #ifdef __USE_LARGEFILE64 | |
| 95 | struct stat64 | |
| 96 | { | |
| 97 | __dev_t st_dev;			/* Device. */ | |
| 98 | unsigned short int __pad1; | |
| 99 | ||
| 100 | __ino_t __st_ino;			/* 32bit file serial number.	*/ | |
| 101 | __mode_t st_mode;			/* File mode. */ | |
| 102 | __nlink_t st_nlink;			/* Link count. */ | |
| 103 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 104 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 105 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 106 | unsigned short int __pad2; | |
| 107 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 108 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 109 | ||
| 110 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 111 | # ifdef __USE_XOPEN2K8 | |
| 112 | /* Nanosecond resolution timestamps are stored in a format | |
| 113 | equivalent to 'struct timespec'. This is the type used | |
| 114 | whenever possible but the Unix namespace rules do not allow the | |
| 115 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 116 | Therefore we have to handle the use of this header in strictly | |
| 117 | standard-compliant sources special. */ | |
| 118 | struct timespec st_atim;		/* Time of last access. */ | |
| 119 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 120 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 121 | # else | |
| 122 | __time_t st_atime;			/* Time of last access. */ | |
| 123 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 124 | __time_t st_mtime;			/* Time of last modification. */ | |
| 125 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 126 | __time_t st_ctime;			/* Time of last status change. */ | |
| 127 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 128 | # endif | |
| 129 | __ino64_t st_ino;			/* File serial number.		*/ | |
| 130 | }; | |
| 131 | #endif | |
| 132 | ||
| 133 | /* Tell code we have these members. */ | |
| 134 | #define	_STATBUF_ST_BLKSIZE | |
| 135 | #define _STATBUF_ST_RDEV | |
| 136 | /* Nanosecond resolution time values are supported. */ | |
| 137 | #define _STATBUF_ST_NSEC | |
| 138 | ||
| 139 | /* Encoding of the file mode. */ | |
| 140 | ||
| 141 | #define	__S_IFMT	0170000	/* These bits determine file type. */ | |
| 142 | ||
| 143 | /* File types. */ | |
| 144 | #define	__S_IFDIR	0040000	/* Directory. */ | |
| 145 | #define	__S_IFCHR	0020000	/* Character device. */ | |
| 146 | #define	__S_IFBLK	0060000	/* Block device. */ | |
| 147 | #define	__S_IFREG	0100000	/* Regular file. */ | |
| 148 | #define	__S_IFIFO	0010000	/* FIFO. */ | |
| 149 | #define	__S_IFLNK	0120000	/* Symbolic link. */ | |
| 150 | #define	__S_IFSOCK	0140000	/* Socket. */ | |
| 151 | ||
| 152 | /* POSIX.1b objects. Note that these macros always evaluate to zero. But | |
| 153 | they do it by enforcing the correct use of the macros. */ | |
| 154 | #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 155 | #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 156 | #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 157 | ||
| 158 | /* Protection bits. */ | |
| 159 | ||
| 160 | #define	__S_ISUID	04000	/* Set user ID on execution. */ | |
| 161 | #define	__S_ISGID	02000	/* Set group ID on execution. */ | |
| 162 | #define	__S_ISVTX	01000	/* Save swapped text after use (sticky). */ | |
| 163 | #define	__S_IREAD	0400	/* Read by owner. */ | |
| 164 | #define	__S_IWRITE	0200	/* Write by owner. */ | |
| 165 | #define	__S_IEXEC	0100	/* Execute by owner. */ | |
| 166 | ||
| 167 | #ifdef __USE_ATFILE | |
| 168 | # define UTIME_NOW	((1l << 30) - 1l) | |
| 169 | # define UTIME_OMIT	((1l << 30) - 2l) | |
| 170 | #endif | |
| 171 | ||
| 172 | #endif	/* bits/stat.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2010-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2010-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/kernel-features.h+3-3| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. |
| 3 | Copyright (C) 2008-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 2008-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -23,8 +23,6 @@ |
| 23 | 23 | # define __ASSUME_SOCKETPAIR_SYSCALL 1 |
| 24 | 24 | # define __ASSUME_BIND_SYSCALL 1 |
| 25 | 25 | # define __ASSUME_LISTEN_SYSCALL 1 |
| 26 | # define __ASSUME_GETSOCKOPT_SYSCALL 1 | |
| 27 | # define __ASSUME_SETSOCKOPT_SYSCALL 1 | |
| 28 | 26 | # define __ASSUME_GETSOCKNAME_SYSCALL 1 |
| 29 | 27 | # define __ASSUME_GETPEERNAME_SYSCALL 1 |
| 30 | 28 | # define __ASSUME_SHUTDOWN_SYSCALL 1 |
| ... | ... | @@ -43,6 +41,8 @@ |
| 43 | 41 | # undef __ASSUME_CONNECT_SYSCALL |
| 44 | 42 | # undef __ASSUME_RECVFROM_SYSCALL |
| 45 | 43 | # undef __ASSUME_SENDTO_SYSCALL |
| 44 | # undef __ASSUME_GETSOCKOPT_SYSCALL | |
| 45 | # undef __ASSUME_SETSOCKOPT_SYSCALL | |
| 46 | 46 | #endif |
| 47 | 47 | |
| 48 | 48 | /* No support for PI futexes or robust mutexes before 3.10 for m68k. */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/kernel_stat.h created+40| ... | ... | @@ -0,0 +1,40 @@ |
| 1 | /* Definition of `struct stat' used in the kernel.. */ | |
| 2 | struct kernel_stat | |
| 3 | { | |
| 4 | unsigned short int st_dev; | |
| 5 | unsigned short int __pad1; | |
| 6 | #define _HAVE___PAD1 | |
| 7 | unsigned long int st_ino; | |
| 8 | unsigned short int st_mode; | |
| 9 | unsigned short int st_nlink; | |
| 10 | unsigned short int st_uid; | |
| 11 | unsigned short int st_gid; | |
| 12 | unsigned short int st_rdev; | |
| 13 | unsigned short int __pad2; | |
| 14 | #define _HAVE___PAD2 | |
| 15 | unsigned long int st_size; | |
| 16 | unsigned long int st_blksize; | |
| 17 | unsigned long int st_blocks; | |
| 18 | struct timespec st_atim; | |
| 19 | struct timespec st_mtim; | |
| 20 | struct timespec st_ctim; | |
| 21 | unsigned long int __glibc_reserved4; | |
| 22 | #define _HAVE___UNUSED4 | |
| 23 | unsigned long int __glibc_reserved5; | |
| 24 | #define _HAVE___UNUSED5 | |
| 25 | }; | |
| 26 | ||
| 27 | #define _HAVE_STAT___UNUSED4 | |
| 28 | #define _HAVE_STAT___UNUSED5 | |
| 29 | #define _HAVE_STAT___PAD1 | |
| 30 | #define _HAVE_STAT___PAD2 | |
| 31 | #define _HAVE_STAT_NSEC | |
| 32 | #define _HAVE_STAT64___PAD1 | |
| 33 | #define _HAVE_STAT64___PAD2 | |
| 34 | #define _HAVE_STAT64___ST_INO | |
| 35 | #define _HAVE_STAT64_NSEC | |
| 36 | ||
| 37 | #define STAT_IS_KERNEL_STAT 0 | |
| 38 | #define STAT64_IS_KERNEL_STAT64 1 | |
| 39 | #define XSTAT_IS_XSTAT64 0 | |
| 40 | #define STATFS_IS_STATFS64 0 |
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2010-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2010-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/sysdep.h+8-26| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Written by Andreas Schwab, <schwab@issan.informatik.uni-dortmund.de>, |
| 4 | 4 | December 1995. |
| ... | ... | @@ -44,6 +44,7 @@ |
| 44 | 44 | |
| 45 | 45 | /* We don't want the label for the error handler to be visible in the symbol |
| 46 | 46 | table when we define it here. */ |
| 47 | #undef SYSCALL_ERROR_LABEL | |
| 47 | 48 | #ifdef PIC |
| 48 | 49 | #define SYSCALL_ERROR_LABEL .Lsyscall_error |
| 49 | 50 | #else |
| ... | ... | @@ -221,27 +222,12 @@ SYSCALL_ERROR_LABEL:							 \ |
| 221 | 222 | |
| 222 | 223 | #else /* not __ASSEMBLER__ */ |
| 223 | 224 | |
| 224 | /* Define a macro which expands into the inline wrapper code for a system | |
| 225 | call. */ | |
| 226 | #undef INLINE_SYSCALL | |
| 227 | #define INLINE_SYSCALL(name, nr, args...)				\ | |
| 228 | ({ unsigned int _sys_result = INTERNAL_SYSCALL (name, , nr, args);	\ | |
| 229 | if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_sys_result, ), 0))\ | |
| 230 | {								\ | |
| 231 | 	 __set_errno (INTERNAL_SYSCALL_ERRNO (_sys_result, ));		\ | |
| 232 | 	 _sys_result = (unsigned int) -1;				\ | |
| 233 | }								\ | |
| 234 | (int) _sys_result; }) | |
| 235 | ||
| 236 | #undef INTERNAL_SYSCALL_DECL | |
| 237 | #define INTERNAL_SYSCALL_DECL(err) do { } while (0) | |
| 238 | ||
| 239 | 225 | /* Define a macro which expands inline into the wrapper code for a system |
| 240 | 226 | call. This use is for internal calls that do not need to handle errors |
| 241 | 227 | normally. It will never touch errno. This returns just what the kernel |
| 242 | 228 | gave back. */ |
| 243 | 229 | #undef INTERNAL_SYSCALL |
| 244 | #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)	\ | |
| 230 | #define INTERNAL_SYSCALL_NCS(name, nr, args...)	\ | |
| 245 | 231 | ({ unsigned int _sys_result;				\ |
| 246 | 232 | {							\ |
| 247 | 233 | /* Load argument values in temporary variables |
| ... | ... | @@ -257,15 +243,8 @@ SYSCALL_ERROR_LABEL:							 \ |
| 257 | 243 | _sys_result = _d0;				\ |
| 258 | 244 | }							\ |
| 259 | 245 | (int) _sys_result; }) |
| 260 | #define INTERNAL_SYSCALL(name, err, nr, args...)	\ | |
| 261 | INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) | |
| 262 | ||
| 263 | #undef INTERNAL_SYSCALL_ERROR_P | |
| 264 | #define INTERNAL_SYSCALL_ERROR_P(val, err)		\ | |
| 265 | ((unsigned int) (val) >= -4095U) | |
| 266 | ||
| 267 | #undef INTERNAL_SYSCALL_ERRNO | |
| 268 | #define INTERNAL_SYSCALL_ERRNO(val, err)	(-(val)) | |
| 246 | #define INTERNAL_SYSCALL(name, nr, args...)	\ | |
| 247 | INTERNAL_SYSCALL_NCS (__NR_##name, nr, ##args) | |
| 269 | 248 | |
| 270 | 249 | #define LOAD_ARGS_0() |
| 271 | 250 | #define LOAD_REGS_0 |
| ... | ... | @@ -313,6 +292,9 @@ SYSCALL_ERROR_LABEL:							 \ |
| 313 | 292 | LOAD_REGS_5 |
| 314 | 293 | #define ASM_ARGS_6	ASM_ARGS_5, "a" (_a0) |
| 315 | 294 | |
| 295 | #undef HAVE_INTERNAL_BRK_ADDR_SYMBOL | |
| 296 | #define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 | |
| 297 | ||
| 316 | 298 | #endif /* not __ASSEMBLER__ */ |
| 317 | 299 | |
| 318 | 300 | /* Pointer mangling is not yet supported for M68K. */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/xstatver.h created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | /* Versions of the 'struct stat' data structure used in compatibility xstat | |
| 2 | functions. */ | |
| 3 | #define _STAT_VER_LINUX_OLD	1 | |
| 4 | #define _STAT_VER_KERNEL	1 | |
| 5 | #define _STAT_VER_SVR4		2 | |
| 6 | #define _STAT_VER_LINUX		3 | |
| 7 | #define _STAT_VER		_STAT_VER_LINUX | |
| 8 | ||
| 9 | /* Versions of the 'xmknod' interface used in compatibility xmknod | |
| 10 | functions. */ | |
| 11 | #define _MKNOD_VER_LINUX	1 | |
| 12 | #define _MKNOD_VER_SVR4		2 | |
| 13 | #define _MKNOD_VER		_MKNOD_VER_LINUX |
lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/bits/stat.h deleted-203| ... | ... | @@ -1,203 +0,0 @@ |
| 1 | /* Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
| 2 | ||
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #if !defined _SYS_STAT_H && !defined _FCNTL_H | |
| 20 | # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifndef _BITS_STAT_H | |
| 24 | #define _BITS_STAT_H	1 | |
| 25 | ||
| 26 | /* Versions of the `struct stat' data structure. */ | |
| 27 | #define _STAT_VER_LINUX_OLD 1 | |
| 28 | #define _STAT_VER_KERNEL 1 | |
| 29 | #define _STAT_VER_SVR4 2 | |
| 30 | #define _STAT_VER_LINUX 3 | |
| 31 | #define _STAT_VER _STAT_VER_LINUX /* The one defined below. */ | |
| 32 | ||
| 33 | /* Versions of the `xmknod' interface. */ | |
| 34 | #define _MKNOD_VER_LINUX 1 | |
| 35 | #define _MKNOD_VER_SVR4 2 | |
| 36 | #define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ | |
| 37 | ||
| 38 | #ifndef __USE_FILE_OFFSET64 | |
| 39 | struct stat | |
| 40 | { | |
| 41 | __dev_t st_dev; /* Device. */ | |
| 42 | __ino_t st_ino; /* File serial number. */ | |
| 43 | __mode_t st_mode; /* File mode. */ | |
| 44 | __nlink_t st_nlink; /* Link count. */ | |
| 45 | __uid_t st_uid; /* User ID of the file's owner. */ | |
| 46 | __gid_t st_gid; /* Group ID of the file's group. */ | |
| 47 | __dev_t st_rdev; /* Device number, if device. */ | |
| 48 | unsigned long __pad2; | |
| 49 | __off_t st_size; /* Size of file, in bytes. */ | |
| 50 | __blksize_t st_blksize; /* Optimal block size for I/O. */ | |
| 51 | int __pad3; | |
| 52 | __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ | |
| 53 | #ifdef __USE_XOPEN2K8 | |
| 54 | /* Nanosecond resolution timestamps are stored in a format | |
| 55 | * equivalent to 'struct timespec'. This is the type used | |
| 56 | * whenever possible but the Unix namespace rules do not allow the | |
| 57 | * identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 58 | * Therefore we have to handle the use of this header in strictly | |
| 59 | * standard-compliant sources special. */ | |
| 60 | struct timespec st_atim; /* Time of last access. */ | |
| 61 | struct timespec st_mtim; /* Time of last modification. */ | |
| 62 | struct timespec st_ctim; /* Time of last status change. */ | |
| 63 | # define st_atime st_atim.tv_sec /* Backward compatibility. */ | |
| 64 | # define st_mtime st_mtim.tv_sec | |
| 65 | # define st_ctime st_ctim.tv_sec | |
| 66 | #else | |
| 67 | __time_t st_atime; /* Time of last access. */ | |
| 68 | unsigned long int st_atimensec; /* Nscecs of last access. */ | |
| 69 | __time_t st_mtime; /* Time of last modification. */ | |
| 70 | unsigned long int st_mtimensec; /* Nsecs of last modification. */ | |
| 71 | __time_t st_ctime; /* Time of last status change. */ | |
| 72 | unsigned long int st_ctimensec; /* Nsecs of last status change. */ | |
| 73 | #endif | |
| 74 | unsigned int __glibc_reserved4; | |
| 75 | unsigned int __glibc_reserved5; | |
| 76 | }; | |
| 77 | #else /* __USE_FILE_OFFSET64 */ | |
| 78 | /* MS: If __USE_FILE_OFFSET64 is setup then struct stat should match stat64 | |
| 79 | * structure. Glibc has no type __dev64_t that's why I had to use standard | |
| 80 | * type for st_dev and st_rdev. Several architectures uses pads after st_dev | |
| 81 | * but this approach covers BIG and LITTLE endian. I think it is better to | |
| 82 | * create one ifdef to separate stats structures. */ | |
| 83 | struct stat | |
| 84 | { | |
| 85 | unsigned long long st_dev; /* Device. */ | |
| 86 | __ino64_t st_ino; /* 32bit file serial number. */ | |
| 87 | __mode_t st_mode; /* File mode. */ | |
| 88 | __nlink_t st_nlink; /* Link count. */ | |
| 89 | __uid_t st_uid; /* User ID of the file's owner. */ | |
| 90 | __gid_t st_gid; /* Group ID of the file's group. */ | |
| 91 | unsigned long long st_rdev; /* Device number, if device. */ | |
| 92 | unsigned long long __pad2; | |
| 93 | __off64_t st_size; /* Size of file, in bytes. */ | |
| 94 | __blksize_t st_blksize; /* Optimal block size for I/O. */ | |
| 95 | int __pad3; | |
| 96 | __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ | |
| 97 | #ifdef __USE_MISC | |
| 98 | /* Nanosecond resolution timestamps are stored in a format | |
| 99 | * equivalent to 'struct timespec'. This is the type used | |
| 100 | * whenever possible but the Unix namespace rules do not allow the | |
| 101 | * identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 102 | * Therefore we have to handle the use of this header in strictly | |
| 103 | * standard-compliant sources special. */ | |
| 104 | struct timespec st_atim; /* Time of last access. */ | |
| 105 | struct timespec st_mtim; /* Time of last modification. */ | |
| 106 | struct timespec st_ctim; /* Time of last status change. */ | |
| 107 | # define st_atime st_atim.tv_sec /* Backward compatibility. */ | |
| 108 | # define st_mtime st_mtim.tv_sec | |
| 109 | # define st_ctime st_ctim.tv_sec | |
| 110 | #else | |
| 111 | __time_t st_atime; /* Time of last access. */ | |
| 112 | unsigned long int st_atimensec; /* Nscecs of last access. */ | |
| 113 | __time_t st_mtime; /* Time of last modification. */ | |
| 114 | unsigned long int st_mtimensec; /* Nsecs of last modification. */ | |
| 115 | __time_t st_ctime; /* Time of last status change. */ | |
| 116 | unsigned long int st_ctimensec; /* Nsecs of last status change. */ | |
| 117 | #endif | |
| 118 | unsigned int __glibc_reserved4; | |
| 119 | unsigned int __glibc_reserved5; | |
| 120 | }; | |
| 121 | #endif /* __USE_FILE_OFFSET64 */ | |
| 122 | ||
| 123 | #ifdef __USE_LARGEFILE64 | |
| 124 | struct stat64 | |
| 125 | { | |
| 126 | unsigned long long st_dev; /* Device. */ | |
| 127 | __ino64_t st_ino; /* 32bit file serial number. */ | |
| 128 | __mode_t st_mode; /* File mode. */ | |
| 129 | __nlink_t st_nlink; /* Link count. */ | |
| 130 | __uid_t st_uid; /* User ID of the file's owner. */ | |
| 131 | __gid_t st_gid; /* Group ID of the file's group. */ | |
| 132 | unsigned long long st_rdev; /* Device number, if device. */ | |
| 133 | unsigned long long __pad2; | |
| 134 | __off64_t st_size; /* Size of file, in bytes. */ | |
| 135 | __blksize_t st_blksize; /* Optimal block size for I/O. */ | |
| 136 | int __pad3; | |
| 137 | __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ | |
| 138 | #ifdef __USE_XOPEN2K8 | |
| 139 | /* Nanosecond resolution timestamps are stored in a format | |
| 140 | * equivalent to 'struct timespec'. This is the type used | |
| 141 | * whenever possible but the Unix namespace rules do not allow the | |
| 142 | * identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 143 | * Therefore we have to handle the use of this header in strictly | |
| 144 | * standard-compliant sources special. */ | |
| 145 | struct timespec st_atim; /* Time of last access. */ | |
| 146 | struct timespec st_mtim; /* Time of last modification. */ | |
| 147 | struct timespec st_ctim; /* Time of last status change. */ | |
| 148 | # define st_atime st_atim.tv_sec /* Backward compatibility. */ | |
| 149 | # define st_mtime st_mtim.tv_sec | |
| 150 | # define st_ctime st_ctim.tv_sec | |
| 151 | #else | |
| 152 | __time_t st_atime; /* Time of last access. */ | |
| 153 | unsigned long int st_atimensec; /* Nscecs of last access. */ | |
| 154 | __time_t st_mtime; /* Time of last modification. */ | |
| 155 | unsigned long int st_mtimensec; /* Nsecs of last modification. */ | |
| 156 | __time_t st_ctime; /* Time of last status change. */ | |
| 157 | unsigned long int st_ctimensec; /* Nsecs of last status change. */ | |
| 158 | #endif | |
| 159 | unsigned int __glibc_reserved4; | |
| 160 | unsigned int __glibc_reserved5; | |
| 161 | }; | |
| 162 | #endif | |
| 163 | ||
| 164 | /* Tell code we have these members. */ | |
| 165 | #define _STATBUF_ST_BLKSIZE | |
| 166 | #define _STATBUF_ST_RDEV | |
| 167 | /* Nanosecond resolution time values are supported. */ | |
| 168 | #define _STATBUF_ST_NSEC | |
| 169 | ||
| 170 | /* Encoding of the file mode. */ | |
| 171 | ||
| 172 | #define __S_IFMT 0170000 /* These bits determine file type. */ | |
| 173 | ||
| 174 | /* File types. */ | |
| 175 | #define __S_IFDIR 0040000 /* Directory. */ | |
| 176 | #define __S_IFCHR 0020000 /* Character device. */ | |
| 177 | #define __S_IFBLK 0060000 /* Block device. */ | |
| 178 | #define __S_IFREG 0100000 /* Regular file. */ | |
| 179 | #define __S_IFIFO 0010000 /* FIFO. */ | |
| 180 | #define __S_IFLNK 0120000 /* Symbolic link. */ | |
| 181 | #define __S_IFSOCK 0140000 /* Socket. */ | |
| 182 | ||
| 183 | /* POSIX.1b objects. Note that these macros always evaluate to zero. But | |
| 184 | they do it by enforcing the correct use of the macros. */ | |
| 185 | #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 186 | #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 187 | #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 188 | ||
| 189 | /* Protection bits. */ | |
| 190 | ||
| 191 | #define __S_ISUID 04000 /* Set user ID on execution. */ | |
| 192 | #define __S_ISGID 02000 /* Set group ID on execution. */ | |
| 193 | #define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ | |
| 194 | #define __S_IREAD 0400 /* Read by owner. */ | |
| 195 | #define __S_IWRITE 0200 /* Write by owner. */ | |
| 196 | #define __S_IEXEC 0100 /* Execute by owner. */ | |
| 197 | ||
| 198 | #ifdef __USE_ATFILE | |
| 199 | # define UTIME_NOW	((1l << 30) - 1l) | |
| 200 | # define UTIME_OMIT	((1l << 30) - 2l) | |
| 201 | #endif | |
| 202 | ||
| 203 | #endif	/* bits/stat.h. */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/kernel-features.h+1-3| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2011-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2011-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -28,8 +28,6 @@ |
| 28 | 28 | #define __ASSUME_SEND_SYSCALL		1 |
| 29 | 29 | #define __ASSUME_RECV_SYSCALL		1 |
| 30 | 30 | #define __ASSUME_SHUTDOWN_SYSCALL	1 |
| 31 | #define __ASSUME_GETSOCKOPT_SYSCALL	1 | |
| 32 | #define __ASSUME_SETSOCKOPT_SYSCALL	1 | |
| 33 | 31 | |
| 34 | 32 | #include_next <kernel-features.h> |
| 35 | 33 |
lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h created+54| ... | ... | @@ -0,0 +1,54 @@ |
| 1 | /* Definition of `struct stat' used in the kernel | |
| 2 | Copyright (C) 2013-2021 Free Software Foundation, Inc. | |
| 3 | ||
| 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 License as | |
| 8 | published by the Free Software Foundation; either version 2.1 of the | |
| 9 | 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 | struct kernel_stat | |
| 21 | { | |
| 22 | unsigned long st_dev; /* Device. */ | |
| 23 | unsigned long st_ino; /* File serial number. */ | |
| 24 | unsigned int st_mode; /* File mode. */ | |
| 25 | unsigned int st_nlink; /* Link count. */ | |
| 26 | unsigned int st_uid; /* User ID of the file's owner. */ | |
| 27 | unsigned int st_gid; /* Group ID of the file's group. */ | |
| 28 | unsigned long st_rdev; /* Device number, if device. */ | |
| 29 | unsigned long __pad2; | |
| 30 | #define _HAVE_STAT___PAD2 | |
| 31 | #define _HAVE_STAT64___PAD2 | |
| 32 | long st_size; /* Size of file, in bytes. */ | |
| 33 | int st_blksize; /* Optimal block size for I/O. */ | |
| 34 | int __pad3; | |
| 35 | #define _HAVE_STAT___PAD3 | |
| 36 | #define _HAVE_STAT64___PAD3 | |
| 37 | long st_blocks; /* Number 512-byte blocks allocated. */ | |
| 38 | struct timespec st_atim; | |
| 39 | struct timespec st_mtim; | |
| 40 | struct timespec st_ctim; | |
| 41 | #define _HAVE_STAT_NSEC | |
| 42 | #define _HAVE_STAT64_NSEC | |
| 43 | unsigned int __glibc_reserved4; | |
| 44 | #define _HAVE_STAT___UNUSED4 | |
| 45 | #define _HAVE_STAT64___UNUSED4 | |
| 46 | unsigned int __glibc_reserved5; | |
| 47 | #define _HAVE_STAT___UNUSED5 | |
| 48 | #define _HAVE_STAT64___UNUSED5 | |
| 49 | }; | |
| 50 | ||
| 51 | #define STAT_IS_KERNEL_STAT 0 | |
| 52 | #define STAT64_IS_KERNEL_STAT64 1 | |
| 53 | #define XSTAT_IS_XSTAT64 0 | |
| 54 | #define STATFS_IS_STATFS64 0 |
lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/sysdep.h+65-62| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 2 | 2 | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| ... | ... | @@ -26,6 +26,8 @@ |
| 26 | 26 | /* Defines RTLD_PRIVATE_ERRNO. */ |
| 27 | 27 | #include <dl-sysdep.h> |
| 28 | 28 | |
| 29 | #include <tls.h> | |
| 30 | ||
| 29 | 31 | /* In order to get __set_errno() definition in INLINE_SYSCALL. */ |
| 30 | 32 | #ifndef __ASSEMBLER__ |
| 31 | 33 | # include <errno.h> |
| ... | ... | @@ -60,6 +62,7 @@ |
| 60 | 62 | |
| 61 | 63 | /* We don't want the label for the error handler to be visible in the symbol |
| 62 | 64 | table when we define it here. */ |
| 65 | # undef SYSCALL_ERROR_LABEL | |
| 63 | 66 | # ifdef PIC |
| 64 | 67 | # define SYSCALL_ERROR_LABEL 0f |
| 65 | 68 | # else |
| ... | ... | @@ -163,42 +166,18 @@ SYSCALL_ERROR_LABEL_DCL: \ |
| 163 | 166 | |
| 164 | 167 | #else /* not __ASSEMBLER__ */ |
| 165 | 168 | |
| 166 | /* Define a macro which expands into the inline wrapper code for a system | |
| 167 | call. */ | |
| 168 | # undef INLINE_SYSCALL | |
| 169 | # define INLINE_SYSCALL(name, nr, args...) \ | |
| 170 | ({ INTERNAL_SYSCALL_DECL(err); \ | |
| 171 | unsigned long resultvar = INTERNAL_SYSCALL(name, err, nr, args); \ | |
| 172 | if (INTERNAL_SYSCALL_ERROR_P (resultvar, err)) \ | |
| 173 | { \ | |
| 174 | __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, err)); \ | |
| 175 | resultvar = (unsigned long) -1; \ | |
| 176 | } \ | |
| 177 | (long) resultvar; \ | |
| 178 | }) | |
| 179 | ||
| 180 | # undef INTERNAL_SYSCALL_DECL | |
| 181 | # define INTERNAL_SYSCALL_DECL(err) do { } while (0) | |
| 182 | ||
| 183 | 169 | /* Define a macro which expands inline into the wrapper code for a system |
| 184 | 170 | call. This use is for internal calls that do not need to handle errors |
| 185 | 171 | normally. It will never touch errno. This returns just what the kernel |
| 186 | 172 | gave back. */ |
| 187 | 173 | # undef INTERNAL_SYSCALL |
| 188 | # define INTERNAL_SYSCALL(name, err, nr, args...) \ | |
| 174 | # define INTERNAL_SYSCALL(name, nr, args...) \ | |
| 189 | 175 | inline_syscall##nr(SYS_ify(name), args) |
| 190 | 176 | |
| 191 | 177 | # undef INTERNAL_SYSCALL_NCS |
| 192 | # define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ | |
| 178 | # define INTERNAL_SYSCALL_NCS(name, nr, args...) \ | |
| 193 | 179 | inline_syscall##nr(name, args) |
| 194 | 180 | |
| 195 | # undef INTERNAL_SYSCALL_ERROR_P | |
| 196 | # define INTERNAL_SYSCALL_ERROR_P(val, err) \ | |
| 197 | ((unsigned int) (val) >= -4095U) | |
| 198 | ||
| 199 | # undef INTERNAL_SYSCALL_ERRNO | |
| 200 | # define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) | |
| 201 | ||
| 202 | 181 | # define SYSCALL_CLOBBERS_6 "r11", "r4", "memory" |
| 203 | 182 | # define SYSCALL_CLOBBERS_5 "r10", SYSCALL_CLOBBERS_6 |
| 204 | 183 | # define SYSCALL_CLOBBERS_4 "r9", SYSCALL_CLOBBERS_5 |
| ... | ... | @@ -209,8 +188,8 @@ SYSCALL_ERROR_LABEL_DCL: \ |
| 209 | 188 | |
| 210 | 189 | # define inline_syscall0(name,dummy) \ |
| 211 | 190 | ({ \ |
| 212 | register long __ret __asm__("r3"); \ | |
| 213 | register long __r12 __asm__("r12") = name; \ | |
| 191 | register long int __ret __asm__("r3"); \ | |
| 192 | register long int __r12 __asm__("r12") = name; \ | |
| 214 | 193 | __asm__ __volatile__( "brki r14,8; nop;" \ |
| 215 | 194 | : "=r"(__ret) \ |
| 216 | 195 | : "r"(__r12) \ |
| ... | ... | @@ -219,9 +198,10 @@ SYSCALL_ERROR_LABEL_DCL: \ |
| 219 | 198 | |
| 220 | 199 | # define inline_syscall1(name,arg1) \ |
| 221 | 200 | ({ \ |
| 222 | register long __ret __asm__("r3"); \ | |
| 223 | register long __r12 __asm__("r12") = name; \ | |
| 224 | register long __r5 __asm__("r5") = (long)(arg1); \ | |
| 201 | long int __arg1 = (long int) (arg1); \ | |
| 202 | register long int __ret __asm__("r3"); \ | |
| 203 | register long int __r12 __asm__("r12") = name; \ | |
| 204 | register long int __r5 __asm__("r5") = __arg1; \ | |
| 225 | 205 | __asm__ __volatile__( "brki r14,8; nop;" \ |
| 226 | 206 | : "=r"(__ret) \ |
| 227 | 207 | : "r"(__r5), "r"(__r12) \ |
| ... | ... | @@ -230,10 +210,12 @@ SYSCALL_ERROR_LABEL_DCL: \ |
| 230 | 210 | |
| 231 | 211 | # define inline_syscall2(name,arg1,arg2) \ |
| 232 | 212 | ({ \ |
| 233 | register long __ret __asm__("r3"); \ | |
| 234 | register long __r12 __asm__("r12") = name; \ | |
| 235 | register long __r5 __asm__("r5") = (long)(arg1); \ | |
| 236 | register long __r6 __asm__("r6") = (long)(arg2); \ | |
| 213 | long int __arg1 = (long int) (arg1); \ | |
| 214 | long int __arg2 = (long int) (arg2); \ | |
| 215 | register long int __ret __asm__("r3"); \ | |
| 216 | register long int __r12 __asm__("r12") = name; \ | |
| 217 | register long int __r5 __asm__("r5") = __arg1; \ | |
| 218 | register long int __r6 __asm__("r6") = __arg2; \ | |
| 237 | 219 | __asm__ __volatile__( "brki r14,8; nop;" \ |
| 238 | 220 | : "=r"(__ret) \ |
| 239 | 221 | : "r"(__r5), "r"(__r6), "r"(__r12) \ |
| ... | ... | @@ -243,11 +225,14 @@ SYSCALL_ERROR_LABEL_DCL: \ |
| 243 | 225 | |
| 244 | 226 | # define inline_syscall3(name,arg1,arg2,arg3) \ |
| 245 | 227 | ({ \ |
| 246 | register long __ret __asm__("r3"); \ | |
| 247 | register long __r12 __asm__("r12") = name; \ | |
| 248 | register long __r5 __asm__("r5") = (long)(arg1); \ | |
| 249 | register long __r6 __asm__("r6") = (long)(arg2); \ | |
| 250 | register long __r7 __asm__("r7") = (long)(arg3); \ | |
| 228 | long int __arg1 = (long int) (arg1); \ | |
| 229 | long int __arg2 = (long int) (arg2); \ | |
| 230 | long int __arg3 = (long int) (arg3); \ | |
| 231 | register long int __ret __asm__("r3"); \ | |
| 232 | register long int __r12 __asm__("r12") = name; \ | |
| 233 | register long int __r5 __asm__("r5") = __arg1; \ | |
| 234 | register long int __r6 __asm__("r6") = __arg2; \ | |
| 235 | register long int __r7 __asm__("r7") = __arg3; \ | |
| 251 | 236 | __asm__ __volatile__( "brki r14,8; nop;" \ |
| 252 | 237 | : "=r"(__ret) \ |
| 253 | 238 | : "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r12) \ |
| ... | ... | @@ -257,12 +242,16 @@ SYSCALL_ERROR_LABEL_DCL: \ |
| 257 | 242 | |
| 258 | 243 | # define inline_syscall4(name,arg1,arg2,arg3,arg4) \ |
| 259 | 244 | ({ \ |
| 260 | register long __ret __asm__("r3"); \ | |
| 261 | register long __r12 __asm__("r12") = name; \ | |
| 262 | register long __r5 __asm__("r5") = (long)(arg1); \ | |
| 263 | register long __r6 __asm__("r6") = (long)(arg2); \ | |
| 264 | register long __r7 __asm__("r7") = (long)(arg3); \ | |
| 265 | register long __r8 __asm__("r8") = (long)(arg4); \ | |
| 245 | long int __arg1 = (long int) (arg1); \ | |
| 246 | long int __arg2 = (long int) (arg2); \ | |
| 247 | long int __arg3 = (long int) (arg3); \ | |
| 248 | long int __arg4 = (long int) (arg4); \ | |
| 249 | register long int __ret __asm__("r3"); \ | |
| 250 | register long int __r12 __asm__("r12") = name; \ | |
| 251 | register long int __r5 __asm__("r5") = __arg1; \ | |
| 252 | register long int __r6 __asm__("r6") = __arg2; \ | |
| 253 | register long int __r7 __asm__("r7") = __arg3; \ | |
| 254 | register long int __r8 __asm__("r8") = __arg4; \ | |
| 266 | 255 | __asm__ __volatile__( "brki r14,8; nop;" \ |
| 267 | 256 | : "=r"(__ret) \ |
| 268 | 257 | : "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r8),"r"(__r12) \ |
| ... | ... | @@ -272,13 +261,18 @@ SYSCALL_ERROR_LABEL_DCL: \ |
| 272 | 261 | |
| 273 | 262 | # define inline_syscall5(name,arg1,arg2,arg3,arg4,arg5) \ |
| 274 | 263 | ({ \ |
| 275 | register long __ret __asm__("r3"); \ | |
| 276 | register long __r12 __asm__("r12") = name; \ | |
| 277 | register long __r5 __asm__("r5") = (long)(arg1); \ | |
| 278 | register long __r6 __asm__("r6") = (long)(arg2); \ | |
| 279 | register long __r7 __asm__("r7") = (long)(arg3); \ | |
| 280 | register long __r8 __asm__("r8") = (long)(arg4); \ | |
| 281 | register long __r9 __asm__("r9") = (long)(arg5); \ | |
| 264 | long int __arg1 = (long int) (arg1); \ | |
| 265 | long int __arg2 = (long int) (arg2); \ | |
| 266 | long int __arg3 = (long int) (arg3); \ | |
| 267 | long int __arg4 = (long int) (arg4); \ | |
| 268 | long int __arg5 = (long int) (arg5); \ | |
| 269 | register long int __ret __asm__("r3"); \ | |
| 270 | register long int __r12 __asm__("r12") = name; \ | |
| 271 | register long int __r5 __asm__("r5") = __arg1; \ | |
| 272 | register long int __r6 __asm__("r6") = __arg2; \ | |
| 273 | register long int __r7 __asm__("r7") = __arg3; \ | |
| 274 | register long int __r8 __asm__("r8") = __arg4; \ | |
| 275 | register long int __r9 __asm__("r9") = __arg5; \ | |
| 282 | 276 | __asm__ __volatile__( "brki r14,8; nop;" \ |
| 283 | 277 | : "=r"(__ret) \ |
| 284 | 278 | : "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r8),"r"(__r9), "r"(__r12) \ |
| ... | ... | @@ -288,14 +282,20 @@ SYSCALL_ERROR_LABEL_DCL: \ |
| 288 | 282 | |
| 289 | 283 | # define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6) \ |
| 290 | 284 | ({ \ |
| 291 | register long __ret __asm__("r3"); \ | |
| 292 | register long __r12 __asm__("r12") = name; \ | |
| 293 | register long __r5 __asm__("r5") = (long)(arg1); \ | |
| 294 | register long __r6 __asm__("r6") = (long)(arg2); \ | |
| 295 | register long __r7 __asm__("r7") = (long)(arg3); \ | |
| 296 | register long __r8 __asm__("r8") = (long)(arg4); \ | |
| 297 | register long __r9 __asm__("r9") = (long)(arg5); \ | |
| 298 | register long __r10 __asm__("r10") = (long)(arg6); \ | |
| 285 | long int __arg1 = (long int) (arg1); \ | |
| 286 | long int __arg2 = (long int) (arg2); \ | |
| 287 | long int __arg3 = (long int) (arg3); \ | |
| 288 | long int __arg4 = (long int) (arg4); \ | |
| 289 | long int __arg5 = (long int) (arg5); \ | |
| 290 | long int __arg6 = (long int) (arg6); \ | |
| 291 | register long int __ret __asm__("r3"); \ | |
| 292 | register long int __r12 __asm__("r12") = name; \ | |
| 293 | register long int __r5 __asm__("r5") = __arg1; \ | |
| 294 | register long int __r6 __asm__("r6") = __arg2; \ | |
| 295 | register long int __r7 __asm__("r7") = __arg3; \ | |
| 296 | register long int __r8 __asm__("r8") = __arg4; \ | |
| 297 | register long int __r9 __asm__("r9") = __arg5; \ | |
| 298 | register long int __r10 __asm__("r10") = __arg6; \ | |
| 299 | 299 | __asm__ __volatile__( "brki r14,8; nop;" \ |
| 300 | 300 | : "=r"(__ret) \ |
| 301 | 301 | : "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r8),"r"(__r9), "r"(__r10), \ |
| ... | ... | @@ -310,6 +310,9 @@ SYSCALL_ERROR_LABEL_DCL: \ |
| 310 | 310 | |
| 311 | 311 | # define SINGLE_THREAD_BY_GLOBAL	1 |
| 312 | 312 | |
| 313 | #undef HAVE_INTERNAL_BRK_ADDR_SYMBOL | |
| 314 | #define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 | |
| 315 | ||
| 313 | 316 | #endif /* not __ASSEMBLER__ */ |
| 314 | 317 | |
| 315 | 318 | #endif /* _LINUX_MICROBLAZE_SYSDEP_H */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/bits/stat.h deleted-263| ... | ... | @@ -1,263 +0,0 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #if !defined _SYS_STAT_H && !defined _FCNTL_H | |
| 19 | # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #ifndef _BITS_STAT_H | |
| 23 | #define _BITS_STAT_H	1 | |
| 24 | ||
| 25 | #include <sgidefs.h> | |
| 26 | ||
| 27 | /* Versions of the `struct stat' data structure. */ | |
| 28 | #define _STAT_VER_LINUX_OLD	1 | |
| 29 | #define _STAT_VER_KERNEL	1 | |
| 30 | #define _STAT_VER_SVR4		2 | |
| 31 | #define _STAT_VER_LINUX		3 | |
| 32 | #define _STAT_VER		_STAT_VER_LINUX /* The one defined below. */ | |
| 33 | ||
| 34 | /* Versions of the `xmknod' interface. */ | |
| 35 | #define _MKNOD_VER_LINUX	1 | |
| 36 | #define _MKNOD_VER_SVR4		2 | |
| 37 | #define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below. */ | |
| 38 | ||
| 39 | ||
| 40 | #if _MIPS_SIM == _ABIO32 | |
| 41 | /* Structure describing file characteristics. */ | |
| 42 | struct stat | |
| 43 | { | |
| 44 | unsigned long int st_dev; | |
| 45 | long int st_pad1[3]; | |
| 46 | #ifndef __USE_FILE_OFFSET64 | |
| 47 | __ino_t st_ino;		/* File serial number.		*/ | |
| 48 | #else | |
| 49 | __ino64_t st_ino;		/* File serial number.		*/ | |
| 50 | #endif | |
| 51 | __mode_t st_mode;		/* File mode. */ | |
| 52 | __nlink_t st_nlink;		/* Link count. */ | |
| 53 | __uid_t st_uid;		/* User ID of the file's owner.	*/ | |
| 54 | __gid_t st_gid;		/* Group ID of the file's group.*/ | |
| 55 | unsigned long int st_rdev;	/* Device number, if device. */ | |
| 56 | #ifndef __USE_FILE_OFFSET64 | |
| 57 | long int st_pad2[2]; | |
| 58 | __off_t st_size;		/* Size of file, in bytes. */ | |
| 59 | /* SVR4 added this extra long to allow for expansion of off_t. */ | |
| 60 | long int st_pad3; | |
| 61 | #else | |
| 62 | long int st_pad2[3]; | |
| 63 | __off64_t st_size;		/* Size of file, in bytes. */ | |
| 64 | #endif | |
| 65 | #ifdef __USE_XOPEN2K8 | |
| 66 | /* Nanosecond resolution timestamps are stored in a format | |
| 67 | equivalent to 'struct timespec'. This is the type used | |
| 68 | whenever possible but the Unix namespace rules do not allow the | |
| 69 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 70 | Therefore we have to handle the use of this header in strictly | |
| 71 | standard-compliant sources special. */ | |
| 72 | struct timespec st_atim; /* Time of last access. */ | |
| 73 | struct timespec st_mtim; /* Time of last modification. */ | |
| 74 | struct timespec st_ctim; /* Time of last status change. */ | |
| 75 | # define st_atime st_atim.tv_sec /* Backward compatibility. */ | |
| 76 | # define st_mtime st_mtim.tv_sec | |
| 77 | # define st_ctime st_ctim.tv_sec | |
| 78 | #else | |
| 79 | __time_t st_atime;			/* Time of last access. */ | |
| 80 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 81 | __time_t st_mtime;			/* Time of last modification. */ | |
| 82 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 83 | __time_t st_ctime;			/* Time of last status change. */ | |
| 84 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 85 | #endif | |
| 86 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ | |
| 87 | #ifndef __USE_FILE_OFFSET64 | |
| 88 | __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated. */ | |
| 89 | #else | |
| 90 | long int st_pad4; | |
| 91 | __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated. */ | |
| 92 | #endif | |
| 93 | long int st_pad5[14]; | |
| 94 | }; | |
| 95 | ||
| 96 | #ifdef __USE_LARGEFILE64 | |
| 97 | struct stat64 | |
| 98 | { | |
| 99 | unsigned long int st_dev; | |
| 100 | long int st_pad1[3]; | |
| 101 | __ino64_t st_ino;		/* File serial number.		*/ | |
| 102 | __mode_t st_mode;		/* File mode. */ | |
| 103 | __nlink_t st_nlink;		/* Link count. */ | |
| 104 | __uid_t st_uid;		/* User ID of the file's owner.	*/ | |
| 105 | __gid_t st_gid;		/* Group ID of the file's group.*/ | |
| 106 | unsigned long int st_rdev;	/* Device number, if device. */ | |
| 107 | long int st_pad2[3]; | |
| 108 | __off64_t st_size;		/* Size of file, in bytes. */ | |
| 109 | # ifdef __USE_XOPEN2K8 | |
| 110 | /* Nanosecond resolution timestamps are stored in a format | |
| 111 | equivalent to 'struct timespec'. This is the type used | |
| 112 | whenever possible but the Unix namespace rules do not allow the | |
| 113 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 114 | Therefore we have to handle the use of this header in strictly | |
| 115 | standard-compliant sources special. */ | |
| 116 | struct timespec st_atim; /* Time of last access. */ | |
| 117 | struct timespec st_mtim; /* Time of last modification. */ | |
| 118 | struct timespec st_ctim; /* Time of last status change. */ | |
| 119 | # else | |
| 120 | __time_t st_atime;			/* Time of last access. */ | |
| 121 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 122 | __time_t st_mtime;			/* Time of last modification. */ | |
| 123 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 124 | __time_t st_ctime;			/* Time of last status change. */ | |
| 125 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 126 | # endif | |
| 127 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ | |
| 128 | long int st_pad3; | |
| 129 | __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated. */ | |
| 130 | long int st_pad4[14]; | |
| 131 | }; | |
| 132 | #endif | |
| 133 | #else | |
| 134 | struct stat | |
| 135 | { | |
| 136 | __dev_t st_dev; | |
| 137 | int	st_pad1[3];		/* Reserved for st_dev expansion */ | |
| 138 | #ifndef __USE_FILE_OFFSET64 | |
| 139 | __ino_t st_ino; | |
| 140 | #else | |
| 141 | __ino64_t st_ino; | |
| 142 | #endif | |
| 143 | __mode_t st_mode; | |
| 144 | __nlink_t st_nlink; | |
| 145 | __uid_t st_uid; | |
| 146 | __gid_t st_gid; | |
| 147 | __dev_t st_rdev; | |
| 148 | #if !defined __USE_FILE_OFFSET64 | |
| 149 | unsigned int st_pad2[2];	/* Reserved for st_rdev expansion */ | |
| 150 | __off_t st_size; | |
| 151 | int st_pad3; | |
| 152 | #else | |
| 153 | unsigned int st_pad2[3];	/* Reserved for st_rdev expansion */ | |
| 154 | __off64_t st_size; | |
| 155 | #endif | |
| 156 | #ifdef __USE_XOPEN2K8 | |
| 157 | /* Nanosecond resolution timestamps are stored in a format | |
| 158 | equivalent to 'struct timespec'. This is the type used | |
| 159 | whenever possible but the Unix namespace rules do not allow the | |
| 160 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 161 | Therefore we have to handle the use of this header in strictly | |
| 162 | standard-compliant sources special. */ | |
| 163 | struct timespec st_atim; /* Time of last access. */ | |
| 164 | struct timespec st_mtim; /* Time of last modification. */ | |
| 165 | struct timespec st_ctim; /* Time of last status change. */ | |
| 166 | # define st_atime st_atim.tv_sec /* Backward compatibility. */ | |
| 167 | # define st_mtime st_mtim.tv_sec | |
| 168 | # define st_ctime st_ctim.tv_sec | |
| 169 | #else | |
| 170 | __time_t st_atime;			/* Time of last access. */ | |
| 171 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 172 | __time_t st_mtime;			/* Time of last modification. */ | |
| 173 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 174 | __time_t st_ctime;			/* Time of last status change. */ | |
| 175 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 176 | #endif | |
| 177 | __blksize_t st_blksize; | |
| 178 | unsigned int st_pad4; | |
| 179 | #ifndef __USE_FILE_OFFSET64 | |
| 180 | __blkcnt_t st_blocks; | |
| 181 | #else | |
| 182 | __blkcnt64_t st_blocks; | |
| 183 | #endif | |
| 184 | int st_pad5[14]; | |
| 185 | }; | |
| 186 | ||
| 187 | #ifdef __USE_LARGEFILE64 | |
| 188 | struct stat64 | |
| 189 | { | |
| 190 | __dev_t st_dev; | |
| 191 | unsigned int st_pad1[3];	/* Reserved for st_dev expansion */ | |
| 192 | __ino64_t st_ino; | |
| 193 | __mode_t st_mode; | |
| 194 | __nlink_t st_nlink; | |
| 195 | __uid_t st_uid; | |
| 196 | __gid_t st_gid; | |
| 197 | __dev_t st_rdev; | |
| 198 | unsigned int st_pad2[3];	/* Reserved for st_rdev expansion */ | |
| 199 | __off64_t st_size; | |
| 200 | # ifdef __USE_XOPEN2K8 | |
| 201 | /* Nanosecond resolution timestamps are stored in a format | |
| 202 | equivalent to 'struct timespec'. This is the type used | |
| 203 | whenever possible but the Unix namespace rules do not allow the | |
| 204 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 205 | Therefore we have to handle the use of this header in strictly | |
| 206 | standard-compliant sources special. */ | |
| 207 | struct timespec st_atim; /* Time of last access. */ | |
| 208 | struct timespec st_mtim; /* Time of last modification. */ | |
| 209 | struct timespec st_ctim; /* Time of last status change. */ | |
| 210 | # else | |
| 211 | __time_t st_atime;			/* Time of last access. */ | |
| 212 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 213 | __time_t st_mtime;			/* Time of last modification. */ | |
| 214 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 215 | __time_t st_ctime;			/* Time of last status change. */ | |
| 216 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 217 | # endif | |
| 218 | __blksize_t st_blksize; | |
| 219 | unsigned int st_pad3; | |
| 220 | __blkcnt64_t st_blocks; | |
| 221 | int st_pad4[14]; | |
| 222 | }; | |
| 223 | #endif | |
| 224 | #endif | |
| 225 | ||
| 226 | /* Tell code we have these members. */ | |
| 227 | #define	_STATBUF_ST_BLKSIZE | |
| 228 | #define	_STATBUF_ST_RDEV | |
| 229 | ||
| 230 | /* Encoding of the file mode. */ | |
| 231 | ||
| 232 | #define	__S_IFMT	0170000	/* These bits determine file type. */ | |
| 233 | ||
| 234 | /* File types. */ | |
| 235 | #define	__S_IFDIR	0040000	/* Directory. */ | |
| 236 | #define	__S_IFCHR	0020000	/* Character device. */ | |
| 237 | #define	__S_IFBLK	0060000	/* Block device. */ | |
| 238 | #define	__S_IFREG	0100000	/* Regular file. */ | |
| 239 | #define	__S_IFIFO	0010000	/* FIFO. */ | |
| 240 | #define	__S_IFLNK	0120000	/* Symbolic link. */ | |
| 241 | #define	__S_IFSOCK	0140000	/* Socket. */ | |
| 242 | ||
| 243 | /* POSIX.1b objects. Note that these macros always evaluate to zero. But | |
| 244 | they do it by enforcing the correct use of the macros. */ | |
| 245 | #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 246 | #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 247 | #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 248 | ||
| 249 | /* Protection bits. */ | |
| 250 | ||
| 251 | #define	__S_ISUID	04000	/* Set user ID on execution. */ | |
| 252 | #define	__S_ISGID	02000	/* Set group ID on execution. */ | |
| 253 | #define	__S_ISVTX	01000	/* Save swapped text after use (sticky). */ | |
| 254 | #define	__S_IREAD	0400	/* Read by owner. */ | |
| 255 | #define	__S_IWRITE	0200	/* Write by owner. */ | |
| 256 | #define	__S_IEXEC	0100	/* Execute by owner. */ | |
| 257 | ||
| 258 | #ifdef __USE_ATFILE | |
| 259 | # define UTIME_NOW	((1l << 30) - 1l) | |
| 260 | # define UTIME_OMIT	((1l << 30) - 2l) | |
| 261 | #endif | |
| 262 | ||
| 263 | #endif	/* bits/stat.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/kernel-features.h+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. |
| 3 | Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/kernel_stat.h created+75| ... | ... | @@ -0,0 +1,75 @@ |
| 1 | #ifndef _KERNEL_STAT_H | |
| 2 | #define _KERNEL_STAT_H | |
| 3 | ||
| 4 | #include <sgidefs.h> | |
| 5 | /* As tempting as it is to define XSTAT_IS_XSTAT64 for n64, the | |
| 6 | userland data structures are not identical, because of different | |
| 7 | padding. */ | |
| 8 | /* Definition of `struct stat' used in the kernel. */ | |
| 9 | #if _MIPS_SIM != _ABIO32 | |
| 10 | struct kernel_stat | |
| 11 | { | |
| 12 | unsigned int st_dev; | |
| 13 | unsigned int __pad1[3]; | |
| 14 | unsigned long long st_ino; | |
| 15 | unsigned int st_mode; | |
| 16 | unsigned int st_nlink; | |
| 17 | int st_uid; | |
| 18 | int st_gid; | |
| 19 | unsigned int st_rdev; | |
| 20 | unsigned int __pad2[3]; | |
| 21 | long long st_size; | |
| 22 | unsigned int st_atime_sec; | |
| 23 | unsigned int st_atime_nsec; | |
| 24 | unsigned int st_mtime_sec; | |
| 25 | unsigned int st_mtime_nsec; | |
| 26 | unsigned int st_ctime_sec; | |
| 27 | unsigned int st_ctime_nsec; | |
| 28 | unsigned int st_blksize; | |
| 29 | unsigned int __pad3; | |
| 30 | unsigned long long st_blocks; | |
| 31 | }; | |
| 32 | #else | |
| 33 | struct kernel_stat | |
| 34 | { | |
| 35 | unsigned long int st_dev; | |
| 36 | long int __pad1[3];			/* Reserved for network id */ | |
| 37 | unsigned long int st_ino; | |
| 38 | unsigned long int st_mode; | |
| 39 | unsigned long int st_nlink; | |
| 40 | long int st_uid; | |
| 41 | long int st_gid; | |
| 42 | unsigned long int st_rdev; | |
| 43 | long int __pad2[2]; | |
| 44 | long int st_size; | |
| 45 | long int __pad3; | |
| 46 | unsigned int st_atime_sec; | |
| 47 | unsigned int st_atime_nsec; | |
| 48 | unsigned int st_mtime_sec; | |
| 49 | unsigned int st_mtime_nsec; | |
| 50 | unsigned int st_ctime_sec; | |
| 51 | unsigned int st_ctime_nsec; | |
| 52 | long int st_blksize; | |
| 53 | long int st_blocks; | |
| 54 | char st_fstype[16];			/* Filesystem type name, unsupported */ | |
| 55 | long st_pad4[8]; | |
| 56 | /* Linux specific fields */ | |
| 57 | unsigned int st_flags; | |
| 58 | unsigned int st_gen; | |
| 59 | }; | |
| 60 | #endif | |
| 61 | ||
| 62 | #define STAT_IS_KERNEL_STAT 0 | |
| 63 | #define STAT64_IS_KERNEL_STAT64 0 | |
| 64 | #define XSTAT_IS_XSTAT64 0 | |
| 65 | #if _MIPS_SIM == _ABI64 | |
| 66 | # define STATFS_IS_STATFS64 1 | |
| 67 | #else | |
| 68 | # define STATFS_IS_STATFS64 0 | |
| 69 | #endif | |
| 70 | /* MIPS64 has unsigned 32 bit timestamps fields, so use statx as well. */ | |
| 71 | #if _MIPS_SIM == _ABI64 | |
| 72 | # define STAT_HAS_TIME32 | |
| 73 | #endif | |
| 74 | ||
| 75 | #endif |
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h+93-112| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -25,11 +25,6 @@ |
| 25 | 25 | |
| 26 | 26 | #include <tls.h> |
| 27 | 27 | |
| 28 | /* In order to get __set_errno() definition in INLINE_SYSCALL. */ | |
| 29 | #ifndef __ASSEMBLER__ | |
| 30 | #include <errno.h> | |
| 31 | #endif | |
| 32 | ||
| 33 | 28 | /* For Linux we can use the system call table in the header file |
| 34 | 29 | 	/usr/include/asm/unistd.h |
| 35 | 30 | of the kernel. But these symbols do not follow the SYS_* syntax |
| ... | ... | @@ -42,32 +37,14 @@ |
| 42 | 37 | /* We don't want the label for the error handler to be visible in the symbol |
| 43 | 38 | table when we define it here. */ |
| 44 | 39 | #ifdef __PIC__ |
| 40 | # undef SYSCALL_ERROR_LABEL | |
| 45 | 41 | # define SYSCALL_ERROR_LABEL 99b |
| 46 | 42 | #endif |
| 47 | 43 | |
| 48 | 44 | #else /* ! __ASSEMBLER__ */ |
| 49 | 45 | |
| 50 | /* Define a macro which expands into the inline wrapper code for a system | |
| 51 | call. */ | |
| 52 | #undef INLINE_SYSCALL | |
| 53 | #define INLINE_SYSCALL(name, nr, args...) \ | |
| 54 | ({ INTERNAL_SYSCALL_DECL (_sc_err);					\ | |
| 55 | long result_var = INTERNAL_SYSCALL (name, _sc_err, nr, args);	\ | |
| 56 | if ( INTERNAL_SYSCALL_ERROR_P (result_var, _sc_err) )		\ | |
| 57 | {								\ | |
| 58 | 	 __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, _sc_err));	\ | |
| 59 | 	 result_var = -1L;						\ | |
| 60 | }								\ | |
| 61 | result_var; }) | |
| 62 | ||
| 63 | #undef INTERNAL_SYSCALL_DECL | |
| 64 | #define INTERNAL_SYSCALL_DECL(err) long err __attribute__ ((unused)) | |
| 65 | ||
| 66 | #undef INTERNAL_SYSCALL_ERROR_P | |
| 67 | #define INTERNAL_SYSCALL_ERROR_P(val, err) ((void) (val), (long) (err)) | |
| 68 | ||
| 69 | #undef INTERNAL_SYSCALL_ERRNO | |
| 70 | #define INTERNAL_SYSCALL_ERRNO(val, err) ((void) (err), val) | |
| 46 | #undef HAVE_INTERNAL_BRK_ADDR_SYMBOL | |
| 47 | #define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 | |
| 71 | 48 | |
| 72 | 49 | /* Note that the original Linux syscall restart convention required the |
| 73 | 50 | instruction immediately preceding SYSCALL to initialize $v0 with the |
| ... | ... | @@ -103,11 +80,11 @@ |
| 103 | 80 | |
| 104 | 81 | union __mips_syscall_return |
| 105 | 82 | { |
| 106 | long long val; | |
| 83 | long long int val; | |
| 107 | 84 | struct |
| 108 | 85 | { |
| 109 | 	long v0; | |
| 110 | 	long v1; | |
| 86 | 	long int v0; | |
| 87 | 	long int v1; | |
| 111 | 88 | } |
| 112 | 89 | reg; |
| 113 | 90 | }; |
| ... | ... | @@ -121,14 +98,13 @@ union __mips_syscall_return |
| 121 | 98 | |
| 122 | 99 | # include <mips16-syscall.h> |
| 123 | 100 | |
| 124 | # define INTERNAL_SYSCALL(name, err, nr, args...)			\ | |
| 125 | 	INTERNAL_SYSCALL_NCS (SYS_ify (name), err, nr, args) | |
| 101 | # define INTERNAL_SYSCALL(name, nr, args...)				\ | |
| 102 | 	INTERNAL_SYSCALL_NCS (SYS_ify (name), nr, args) | |
| 126 | 103 | |
| 127 | # define INTERNAL_SYSCALL_NCS(number, err, nr, args...)			\ | |
| 104 | # define INTERNAL_SYSCALL_NCS(number, nr, args...)			\ | |
| 128 | 105 | ({									\ |
| 129 | 106 | 	union __mips_syscall_return _sc_ret;				\ |
| 130 | 107 | 	_sc_ret.val = __mips16_syscall##nr (args, number);		\ |
| 131 | 	err = _sc_ret.reg.v1;						\ | |
| 132 | 108 | 	_sc_ret.reg.v0;							\ |
| 133 | 109 | }) |
| 134 | 110 | |
| ... | ... | @@ -138,12 +114,12 @@ union __mips_syscall_return |
| 138 | 114 | 			 number, err, args) |
| 139 | 115 | |
| 140 | 116 | #else /* !__mips16 */ |
| 141 | # define INTERNAL_SYSCALL(name, err, nr, args...)			\ | |
| 117 | # define INTERNAL_SYSCALL(name, nr, args...)				\ | |
| 142 | 118 | 	internal_syscall##nr ("li\t%0, %2\t\t\t# " #name "\n\t",	\ |
| 143 | 119 | 			 "IK" (SYS_ify (name)),			\ |
| 144 | 120 | 			 SYS_ify (name), err, args) |
| 145 | 121 | |
| 146 | # define INTERNAL_SYSCALL_NCS(number, err, nr, args...)			\ | |
| 122 | # define INTERNAL_SYSCALL_NCS(number, nr, args...)			\ | |
| 147 | 123 | 	internal_syscall##nr (MOVE32 "\t%0, %2\n\t",			\ |
| 148 | 124 | 			 "r" (__s0),				\ |
| 149 | 125 | 			 number, err, args) |
| ... | ... | @@ -152,13 +128,13 @@ union __mips_syscall_return |
| 152 | 128 | |
| 153 | 129 | #define internal_syscall0(v0_init, input, number, err, dummy...)	\ |
| 154 | 130 | ({									\ |
| 155 | 	long _sys_result;						\ | |
| 131 | 	long int _sys_result;						\ | |
| 156 | 132 | 									\ |
| 157 | 133 | 	{								\ |
| 158 | 	register long __s0 asm ("$16") __attribute__ ((unused))		\ | |
| 134 | 	register long int __s0 asm ("$16") __attribute__ ((unused))	\ | |
| 159 | 135 | 	 = (number);							\ |
| 160 | 	register long __v0 asm ("$2");					\ | |
| 161 | 	register long __a3 asm ("$7");					\ | |
| 136 | 	register long int __v0 asm ("$2");				\ | |
| 137 | 	register long int __a3 asm ("$7");				\ | |
| 162 | 138 | 	__asm__ volatile (						\ |
| 163 | 139 | 	".set\tnoreorder\n\t"						\ |
| 164 | 140 | 	v0_init								\ |
| ... | ... | @@ -167,22 +143,22 @@ union __mips_syscall_return |
| 167 | 143 | 	: "=r" (__v0), "=r" (__a3)					\ |
| 168 | 144 | 	: input								\ |
| 169 | 145 | 	: __SYSCALL_CLOBBERS);						\ |
| 170 | 	err = __a3;							\ | |
| 171 | 	_sys_result = __v0;						\ | |
| 146 | 	_sys_result = __a3 != 0 ? -__v0 : __v0;				\ | |
| 172 | 147 | 	}								\ |
| 173 | 148 | 	_sys_result;							\ |
| 174 | 149 | }) |
| 175 | 150 | |
| 176 | 151 | #define internal_syscall1(v0_init, input, number, err, arg1)		\ |
| 177 | 152 | ({									\ |
| 178 | 	long _sys_result;						\ | |
| 153 | 	long int _sys_result;						\ | |
| 179 | 154 | 									\ |
| 180 | 155 | 	{								\ |
| 181 | 	register long __s0 asm ("$16") __attribute__ ((unused))		\ | |
| 156 | 	long int _arg1 = (long int) (arg1);				\ | |
| 157 | 	register long int __s0 asm ("$16") __attribute__ ((unused))	\ | |
| 182 | 158 | 	 = (number);							\ |
| 183 | 	register long __v0 asm ("$2");					\ | |
| 184 | 	register long __a0 asm ("$4") = (long) (arg1);			\ | |
| 185 | 	register long __a3 asm ("$7");					\ | |
| 159 | 	register long int __v0 asm ("$2");				\ | |
| 160 | 	register long int __a0 asm ("$4") = _arg1;			\ | |
| 161 | 	register long int __a3 asm ("$7");				\ | |
| 186 | 162 | 	__asm__ volatile (						\ |
| 187 | 163 | 	".set\tnoreorder\n\t"						\ |
| 188 | 164 | 	v0_init								\ |
| ... | ... | @@ -191,23 +167,24 @@ union __mips_syscall_return |
| 191 | 167 | 	: "=r" (__v0), "=r" (__a3)					\ |
| 192 | 168 | 	: input, "r" (__a0)						\ |
| 193 | 169 | 	: __SYSCALL_CLOBBERS);						\ |
| 194 | 	err = __a3;							\ | |
| 195 | 	_sys_result = __v0;						\ | |
| 170 | 	_sys_result = __a3 != 0 ? -__v0 : __v0;				\ | |
| 196 | 171 | 	}								\ |
| 197 | 172 | 	_sys_result;							\ |
| 198 | 173 | }) |
| 199 | 174 | |
| 200 | 175 | #define internal_syscall2(v0_init, input, number, err, arg1, arg2)	\ |
| 201 | 176 | ({									\ |
| 202 | 	long _sys_result;						\ | |
| 177 | 	long int _sys_result;						\ | |
| 203 | 178 | 									\ |
| 204 | 179 | 	{								\ |
| 205 | 	register long __s0 asm ("$16") __attribute__ ((unused))		\ | |
| 180 | 	long int _arg1 = (long int) (arg1);				\ | |
| 181 | 	long int _arg2 = (long int) (arg2);				\ | |
| 182 | 	register long int __s0 asm ("$16") __attribute__ ((unused))	\ | |
| 206 | 183 | 	 = (number);							\ |
| 207 | 	register long __v0 asm ("$2");					\ | |
| 208 | 	register long __a0 asm ("$4") = (long) (arg1);			\ | |
| 209 | 	register long __a1 asm ("$5") = (long) (arg2);			\ | |
| 210 | 	register long __a3 asm ("$7");					\ | |
| 184 | 	register long int __v0 asm ("$2");				\ | |
| 185 | 	register long int __a0 asm ("$4") = _arg1;			\ | |
| 186 | 	register long int __a1 asm ("$5") = _arg2;			\ | |
| 187 | 	register long int __a3 asm ("$7");				\ | |
| 211 | 188 | 	__asm__ volatile (						\ |
| 212 | 189 | 	".set\tnoreorder\n\t"						\ |
| 213 | 190 | 	v0_init								\ |
| ... | ... | @@ -216,8 +193,7 @@ union __mips_syscall_return |
| 216 | 193 | 	: "=r" (__v0), "=r" (__a3)					\ |
| 217 | 194 | 	: input, "r" (__a0), "r" (__a1)					\ |
| 218 | 195 | 	: __SYSCALL_CLOBBERS);						\ |
| 219 | 	err = __a3;							\ | |
| 220 | 	_sys_result = __v0;						\ | |
| 196 | 	_sys_result = __a3 != 0 ? -__v0 : __v0;				\ | |
| 221 | 197 | 	}								\ |
| 222 | 198 | 	_sys_result;							\ |
| 223 | 199 | }) |
| ... | ... | @@ -225,16 +201,19 @@ union __mips_syscall_return |
| 225 | 201 | #define internal_syscall3(v0_init, input, number, err,			\ |
| 226 | 202 | 			 arg1, arg2, arg3)				\ |
| 227 | 203 | ({									\ |
| 228 | 	long _sys_result;						\ | |
| 204 | 	long int _sys_result;						\ | |
| 229 | 205 | 									\ |
| 230 | 206 | 	{								\ |
| 231 | 	register long __s0 asm ("$16") __attribute__ ((unused))		\ | |
| 207 | 	long int _arg1 = (long int) (arg1);				\ | |
| 208 | 	long int _arg2 = (long int) (arg2);				\ | |
| 209 | 	long int _arg3 = (long int) (arg3);				\ | |
| 210 | 	register long int __s0 asm ("$16") __attribute__ ((unused))	\ | |
| 232 | 211 | 	 = (number);							\ |
| 233 | 	register long __v0 asm ("$2");					\ | |
| 234 | 	register long __a0 asm ("$4") = (long) (arg1);			\ | |
| 235 | 	register long __a1 asm ("$5") = (long) (arg2);			\ | |
| 236 | 	register long __a2 asm ("$6") = (long) (arg3);			\ | |
| 237 | 	register long __a3 asm ("$7");					\ | |
| 212 | 	register long int __v0 asm ("$2");				\ | |
| 213 | 	register long int __a0 asm ("$4") = _arg1;			\ | |
| 214 | 	register long int __a1 asm ("$5") = _arg2;			\ | |
| 215 | 	register long int __a2 asm ("$6") = _arg3;			\ | |
| 216 | 	register long int __a3 asm ("$7");				\ | |
| 238 | 217 | 	__asm__ volatile (						\ |
| 239 | 218 | 	".set\tnoreorder\n\t"						\ |
| 240 | 219 | 	v0_init								\ |
| ... | ... | @@ -243,8 +222,7 @@ union __mips_syscall_return |
| 243 | 222 | 	: "=r" (__v0), "=r" (__a3)					\ |
| 244 | 223 | 	: input, "r" (__a0), "r" (__a1), "r" (__a2)			\ |
| 245 | 224 | 	: __SYSCALL_CLOBBERS);						\ |
| 246 | 	err = __a3;							\ | |
| 247 | 	_sys_result = __v0;						\ | |
| 225 | 	_sys_result = __a3 != 0 ? -__v0 : __v0;				\ | |
| 248 | 226 | 	}								\ |
| 249 | 227 | 	_sys_result;							\ |
| 250 | 228 | }) |
| ... | ... | @@ -252,16 +230,20 @@ union __mips_syscall_return |
| 252 | 230 | #define internal_syscall4(v0_init, input, number, err,			\ |
| 253 | 231 | 			 arg1, arg2, arg3, arg4)			\ |
| 254 | 232 | ({									\ |
| 255 | 	long _sys_result;						\ | |
| 233 | 	long int _sys_result;						\ | |
| 256 | 234 | 									\ |
| 257 | 235 | 	{								\ |
| 258 | 	register long __s0 asm ("$16") __attribute__ ((unused))		\ | |
| 236 | 	long int _arg1 = (long int) (arg1);				\ | |
| 237 | 	long int _arg2 = (long int) (arg2);				\ | |
| 238 | 	long int _arg3 = (long int) (arg3);				\ | |
| 239 | 	long int _arg4 = (long int) (arg4);				\ | |
| 240 | 	register long int __s0 asm ("$16") __attribute__ ((unused))	\ | |
| 259 | 241 | 	 = (number);							\ |
| 260 | 	register long __v0 asm ("$2");					\ | |
| 261 | 	register long __a0 asm ("$4") = (long) (arg1);			\ | |
| 262 | 	register long __a1 asm ("$5") = (long) (arg2);			\ | |
| 263 | 	register long __a2 asm ("$6") = (long) (arg3);			\ | |
| 264 | 	register long __a3 asm ("$7") = (long) (arg4);			\ | |
| 242 | 	register long int __v0 asm ("$2");				\ | |
| 243 | 	register long int __a0 asm ("$4") = _arg1;			\ | |
| 244 | 	register long int __a1 asm ("$5") = _arg2;			\ | |
| 245 | 	register long int __a2 asm ("$6") = _arg3;			\ | |
| 246 | 	register long int __a3 asm ("$7") = _arg4;			\ | |
| 265 | 247 | 	__asm__ volatile (						\ |
| 266 | 248 | 	".set\tnoreorder\n\t"						\ |
| 267 | 249 | 	v0_init								\ |
| ... | ... | @@ -270,8 +252,7 @@ union __mips_syscall_return |
| 270 | 252 | 	: "=r" (__v0), "+r" (__a3)					\ |
| 271 | 253 | 	: input, "r" (__a0), "r" (__a1), "r" (__a2)			\ |
| 272 | 254 | 	: __SYSCALL_CLOBBERS);						\ |
| 273 | 	err = __a3;							\ | |
| 274 | 	_sys_result = __v0;						\ | |
| 255 | 	_sys_result = __a3 != 0 ? -__v0 : __v0;				\ | |
| 275 | 256 | 	}								\ |
| 276 | 257 | 	_sys_result;							\ |
| 277 | 258 | }) |
| ... | ... | @@ -285,65 +266,65 @@ union __mips_syscall_return |
| 285 | 266 | compiler specifics required for the stack arguments to be pushed, |
| 286 | 267 | which would be the case if these syscalls were inlined. */ |
| 287 | 268 | |
| 288 | long long __nomips16 __mips_syscall5 (long arg1, long arg2, long arg3, | |
| 289 | 				 long arg4, long arg5, | |
| 290 | 				 long number); | |
| 269 | long long int __nomips16 __mips_syscall5 (long int arg1, long int arg2, | |
| 270 | 					 long int arg3, long int arg4, | |
| 271 | 					 long int arg5, | |
| 272 | 					 long int number); | |
| 291 | 273 | libc_hidden_proto (__mips_syscall5, nomips16) |
| 292 | 274 | |
| 293 | 275 | #define internal_syscall5(v0_init, input, number, err,			\ |
| 294 | 276 | 			 arg1, arg2, arg3, arg4, arg5)			\ |
| 295 | 277 | ({									\ |
| 296 | 278 | 	union __mips_syscall_return _sc_ret;				\ |
| 297 | 	_sc_ret.val = __mips_syscall5 ((long) (arg1),			\ | |
| 298 | 				 (long) (arg2),			\ | |
| 299 | 				 (long) (arg3),			\ | |
| 300 | 				 (long) (arg4),			\ | |
| 301 | 				 (long) (arg5),			\ | |
| 302 | 				 (long) (number));		\ | |
| 303 | 	err = _sc_ret.reg.v1;						\ | |
| 304 | 	_sc_ret.reg.v0;							\ | |
| 279 | 	_sc_ret.val = __mips_syscall5 ((long int) (arg1),		\ | |
| 280 | 				 (long int) (arg2),		\ | |
| 281 | 				 (long int) (arg3),		\ | |
| 282 | 				 (long int) (arg4),		\ | |
| 283 | 				 (long int) (arg5),		\ | |
| 284 | 				 (long int) (number));		\ | |
| 285 | 	_sc_ret.reg.v1 != 0 ? -_sc_ret.reg.v0 : _sc_ret.reg.v0;		\ | |
| 305 | 286 | }) |
| 306 | 287 | |
| 307 | long long __nomips16 __mips_syscall6 (long arg1, long arg2, long arg3, | |
| 308 | 				 long arg4, long arg5, long arg6, | |
| 309 | 				 long number); | |
| 288 | long long int __nomips16 __mips_syscall6 (long int arg1, long int arg2, | |
| 289 | 					 long int arg3, long int arg4, | |
| 290 | 					 long int arg5, long int arg6, | |
| 291 | 					 long int number); | |
| 310 | 292 | libc_hidden_proto (__mips_syscall6, nomips16) |
| 311 | 293 | |
| 312 | 294 | #define internal_syscall6(v0_init, input, number, err,			\ |
| 313 | 295 | 			 arg1, arg2, arg3, arg4, arg5, arg6)		\ |
| 314 | 296 | ({									\ |
| 315 | 297 | 	union __mips_syscall_return _sc_ret;				\ |
| 316 | 	_sc_ret.val = __mips_syscall6 ((long) (arg1),			\ | |
| 317 | 				 (long) (arg2),			\ | |
| 318 | 				 (long) (arg3),			\ | |
| 319 | 				 (long) (arg4),			\ | |
| 320 | 				 (long) (arg5),			\ | |
| 321 | 				 (long) (arg6),			\ | |
| 322 | 				 (long) (number));		\ | |
| 323 | 	err = _sc_ret.reg.v1;						\ | |
| 324 | 	_sc_ret.reg.v0;							\ | |
| 298 | 	_sc_ret.val = __mips_syscall6 ((long int) (arg1),		\ | |
| 299 | 				 (long int) (arg2),		\ | |
| 300 | 				 (long int) (arg3),		\ | |
| 301 | 				 (long int) (arg4),		\ | |
| 302 | 				 (long int) (arg5),		\ | |
| 303 | 				 (long int) (arg6),		\ | |
| 304 | 				 (long int) (number));		\ | |
| 305 | 	_sc_ret.reg.v1 != 0 ? -_sc_ret.reg.v0 : _sc_ret.reg.v0;		\ | |
| 325 | 306 | }) |
| 326 | 307 | |
| 327 | long long __nomips16 __mips_syscall7 (long arg1, long arg2, long arg3, | |
| 328 | 				 long arg4, long arg5, long arg6, | |
| 329 | 				 long arg7, | |
| 330 | 				 long number); | |
| 308 | long long int __nomips16 __mips_syscall7 (long int arg1, long int arg2, | |
| 309 | 					 long int arg3, long int arg4, | |
| 310 | 					 long int arg5, long int arg6, | |
| 311 | 					 long int arg7, | |
| 312 | 					 long int number); | |
| 331 | 313 | libc_hidden_proto (__mips_syscall7, nomips16) |
| 332 | 314 | |
| 333 | 315 | #define internal_syscall7(v0_init, input, number, err,			\ |
| 334 | 316 | 			 arg1, arg2, arg3, arg4, arg5, arg6, arg7)	\ |
| 335 | 317 | ({									\ |
| 336 | 318 | 	union __mips_syscall_return _sc_ret;				\ |
| 337 | 	_sc_ret.val = __mips_syscall7 ((long) (arg1),			\ | |
| 338 | 				 (long) (arg2),			\ | |
| 339 | 				 (long) (arg3),			\ | |
| 340 | 				 (long) (arg4),			\ | |
| 341 | 				 (long) (arg5),			\ | |
| 342 | 				 (long) (arg6),			\ | |
| 343 | 				 (long) (arg7),			\ | |
| 344 | 				 (long) (number));		\ | |
| 345 | 	err = _sc_ret.reg.v1;						\ | |
| 346 | 	_sc_ret.reg.v0;							\ | |
| 319 | 	_sc_ret.val = __mips_syscall7 ((long int) (arg1),		\ | |
| 320 | 				 (long int) (arg2),		\ | |
| 321 | 				 (long int) (arg3),		\ | |
| 322 | 				 (long int) (arg4),		\ | |
| 323 | 				 (long int) (arg5),		\ | |
| 324 | 				 (long int) (arg6),		\ | |
| 325 | 				 (long int) (arg7),		\ | |
| 326 | 				 (long int) (number));		\ | |
| 327 | 	_sc_ret.reg.v1 != 0 ? -_sc_ret.reg.v0 : _sc_ret.reg.v0;		\ | |
| 347 | 328 | }) |
| 348 | 329 | |
| 349 | 330 | #if __mips_isa_rev >= 6 |
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h created+73| ... | ... | @@ -0,0 +1,73 @@ |
| 1 | /* Struct stat/stat64 to stat/stat64 conversion for Linux. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <sys/stat.h> | |
| 20 | #include <kernel_stat.h> | |
| 21 | ||
| 22 | static inline long int | |
| 23 | __cp_kstat_stat (const struct kernel_stat *kst, struct stat *st) | |
| 24 | { | |
| 25 | if (! in_ino_t_range (kst->st_ino) | |
| 26 | || ! in_off_t_range (kst->st_size) | |
| 27 | || ! in_blkcnt_t_range (kst->st_blocks)) | |
| 28 | return -EOVERFLOW; | |
| 29 | ||
| 30 | st->st_dev = kst->st_dev; | |
| 31 | memset (&st->st_pad1, 0, sizeof (st->st_pad1)); | |
| 32 | st->st_ino = kst->st_ino; | |
| 33 | st->st_mode = kst->st_mode; | |
| 34 | st->st_nlink = kst->st_nlink; | |
| 35 | st->st_uid = kst->st_uid; | |
| 36 | st->st_gid = kst->st_gid; | |
| 37 | st->st_rdev = kst->st_rdev; | |
| 38 | memset (&st->st_pad2, 0, sizeof (st->st_pad2)); | |
| 39 | st->st_size = kst->st_size; | |
| 40 | st->st_pad3 = 0; | |
| 41 | st->st_atim.tv_sec = kst->st_atime_sec; | |
| 42 | st->st_atim.tv_nsec = kst->st_atime_nsec; | |
| 43 | st->st_mtim.tv_sec = kst->st_mtime_sec; | |
| 44 | st->st_mtim.tv_nsec = kst->st_mtime_nsec; | |
| 45 | st->st_ctim.tv_sec = kst->st_ctime_sec; | |
| 46 | st->st_ctim.tv_nsec = kst->st_ctime_nsec; | |
| 47 | st->st_blksize = kst->st_blksize; | |
| 48 | st->st_blocks = kst->st_blocks; | |
| 49 | memset (&st->st_pad5, 0, sizeof (st->st_pad5)); | |
| 50 | ||
| 51 | return 0; | |
| 52 | } | |
| 53 | ||
| 54 | static inline void | |
| 55 | __cp_kstat_stat64_t64 (const struct kernel_stat *kst, struct __stat64_t64 *st) | |
| 56 | { | |
| 57 | st->st_dev = kst->st_dev; | |
| 58 | st->st_ino = kst->st_ino; | |
| 59 | st->st_mode = kst->st_mode; | |
| 60 | st->st_nlink = kst->st_nlink; | |
| 61 | st->st_uid = kst->st_uid; | |
| 62 | st->st_gid = kst->st_gid; | |
| 63 | st->st_rdev = kst->st_rdev; | |
| 64 | st->st_size = kst->st_size; | |
| 65 | st->st_blksize = kst->st_blksize; | |
| 66 | st->st_blocks = kst->st_blocks; | |
| 67 | st->st_atim.tv_sec = kst->st_atime_sec; | |
| 68 | st->st_atim.tv_nsec = kst->st_atime_nsec; | |
| 69 | st->st_mtim.tv_sec = kst->st_mtime_sec; | |
| 70 | st->st_mtim.tv_nsec = kst->st_mtime_nsec; | |
| 71 | st->st_ctim.tv_sec = kst->st_ctime_sec; | |
| 72 | st->st_ctim.tv_nsec = kst->st_ctime_nsec; | |
| 73 | } |
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h deleted-311| ... | ... | @@ -1,311 +0,0 @@ |
| 1 | /* Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _LINUX_MIPS_SYSDEP_H | |
| 19 | #define _LINUX_MIPS_SYSDEP_H 1 | |
| 20 | ||
| 21 | /* There is some commonality. */ | |
| 22 | #include <sysdeps/unix/sysv/linux/mips/sysdep.h> | |
| 23 | #include <sysdeps/unix/sysv/linux/sysdep.h> | |
| 24 | #include <sysdeps/unix/mips/mips64/n32/sysdep.h> | |
| 25 | ||
| 26 | #include <tls.h> | |
| 27 | ||
| 28 | /* In order to get __set_errno() definition in INLINE_SYSCALL. */ | |
| 29 | #ifndef __ASSEMBLER__ | |
| 30 | #include <errno.h> | |
| 31 | #endif | |
| 32 | ||
| 33 | /* For Linux we can use the system call table in the header file | |
| 34 | 	/usr/include/asm/unistd.h | |
| 35 | of the kernel. But these symbols do not follow the SYS_* syntax | |
| 36 | so we have to redefine the `SYS_ify' macro here. */ | |
| 37 | #undef SYS_ify | |
| 38 | #define SYS_ify(syscall_name)	__NR_##syscall_name | |
| 39 | ||
| 40 | #ifdef __ASSEMBLER__ | |
| 41 | ||
| 42 | /* We don't want the label for the error handler to be visible in the symbol | |
| 43 | table when we define it here. */ | |
| 44 | # define SYSCALL_ERROR_LABEL 99b | |
| 45 | ||
| 46 | #else /* ! __ASSEMBLER__ */ | |
| 47 | ||
| 48 | /* Convert X to a long long, without losing any bits if it is one | |
| 49 | already or warning if it is a 32-bit pointer. */ | |
| 50 | #define ARGIFY(X) ((long long) (__typeof__ ((X) - (X))) (X)) | |
| 51 | ||
| 52 | /* Define a macro which expands into the inline wrapper code for a system | |
| 53 | call. */ | |
| 54 | #undef INLINE_SYSCALL | |
| 55 | #define INLINE_SYSCALL(name, nr, args...)				\ | |
| 56 | ({ INTERNAL_SYSCALL_DECL (_sc_err);					\ | |
| 57 | long result_var = INTERNAL_SYSCALL (name, _sc_err, nr, args);	\ | |
| 58 | if ( INTERNAL_SYSCALL_ERROR_P (result_var, _sc_err) )		\ | |
| 59 | {								\ | |
| 60 | 	 __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, _sc_err));	\ | |
| 61 | 	 result_var = -1L;						\ | |
| 62 | }								\ | |
| 63 | result_var; }) | |
| 64 | ||
| 65 | #undef INTERNAL_SYSCALL_DECL | |
| 66 | #define INTERNAL_SYSCALL_DECL(err) long err __attribute__ ((unused)) | |
| 67 | ||
| 68 | #undef INTERNAL_SYSCALL_ERROR_P | |
| 69 | #define INTERNAL_SYSCALL_ERROR_P(val, err) ((void) (val), (long) (err)) | |
| 70 | ||
| 71 | #undef INTERNAL_SYSCALL_ERRNO | |
| 72 | #define INTERNAL_SYSCALL_ERRNO(val, err) ((void) (err), val) | |
| 73 | ||
| 74 | /* Note that the original Linux syscall restart convention required the | |
| 75 | instruction immediately preceding SYSCALL to initialize $v0 with the | |
| 76 | syscall number. Then if a restart triggered, $v0 would have been | |
| 77 | clobbered by the syscall interrupted, and needed to be reinititalized. | |
| 78 | The kernel would decrement the PC by 4 before switching back to the | |
| 79 | user mode so that $v0 had been reloaded before SYSCALL was executed | |
| 80 | again. This implied the place $v0 was loaded from must have been | |
| 81 | preserved across a syscall, e.g. an immediate, static register, stack | |
| 82 | slot, etc. | |
| 83 | ||
| 84 | The convention was relaxed in Linux with a change applied to the kernel | |
| 85 | GIT repository as commit 96187fb0bc30cd7919759d371d810e928048249d, that | |
| 86 | first appeared in the 2.6.36 release. Since then the kernel has had | |
| 87 | code that reloads $v0 upon syscall restart and resumes right at the | |
| 88 | SYSCALL instruction, so no special arrangement is needed anymore. | |
| 89 | ||
| 90 | For backwards compatibility with existing kernel binaries we support | |
| 91 | the old convention by choosing the instruction preceding SYSCALL | |
| 92 | carefully. This also means we have to force a 32-bit encoding of the | |
| 93 | microMIPS MOVE instruction if one is used. */ | |
| 94 | ||
| 95 | #ifdef __mips_micromips | |
| 96 | # define MOVE32 "move32" | |
| 97 | #else | |
| 98 | # define MOVE32 "move" | |
| 99 | #endif | |
| 100 | ||
| 101 | #undef INTERNAL_SYSCALL | |
| 102 | #define INTERNAL_SYSCALL(name, err, nr, args...)			\ | |
| 103 | 	internal_syscall##nr ("li\t%0, %2\t\t\t# " #name "\n\t",	\ | |
| 104 | 			 "IK" (SYS_ify (name)),			\ | |
| 105 | 			 0, err, args) | |
| 106 | ||
| 107 | #undef INTERNAL_SYSCALL_NCS | |
| 108 | #define INTERNAL_SYSCALL_NCS(number, err, nr, args...)			\ | |
| 109 | 	internal_syscall##nr (MOVE32 "\t%0, %2\n\t",			\ | |
| 110 | 			 "r" (__s0),				\ | |
| 111 | 			 number, err, args) | |
| 112 | ||
| 113 | #define internal_syscall0(v0_init, input, number, err, dummy...)	\ | |
| 114 | ({									\ | |
| 115 | 	long _sys_result;						\ | |
| 116 | 									\ | |
| 117 | 	{								\ | |
| 118 | 	register long long __s0 asm ("$16") __attribute__ ((unused))	\ | |
| 119 | 	 = (number);							\ | |
| 120 | 	register long long __v0 asm ("$2");				\ | |
| 121 | 	register long long __a3 asm ("$7");				\ | |
| 122 | 	__asm__ volatile (						\ | |
| 123 | 	".set\tnoreorder\n\t"						\ | |
| 124 | 	v0_init								\ | |
| 125 | 	"syscall\n\t"							\ | |
| 126 | 	".set reorder"							\ | |
| 127 | 	: "=r" (__v0), "=r" (__a3)					\ | |
| 128 | 	: input								\ | |
| 129 | 	: __SYSCALL_CLOBBERS);						\ | |
| 130 | 	err = __a3;							\ | |
| 131 | 	_sys_result = __v0;						\ | |
| 132 | 	}								\ | |
| 133 | 	_sys_result;							\ | |
| 134 | }) | |
| 135 | ||
| 136 | #define internal_syscall1(v0_init, input, number, err, arg1)		\ | |
| 137 | ({									\ | |
| 138 | 	long _sys_result;						\ | |
| 139 | 									\ | |
| 140 | 	{								\ | |
| 141 | 	register long long __s0 asm ("$16") __attribute__ ((unused))	\ | |
| 142 | 	 = (number);							\ | |
| 143 | 	register long long __v0 asm ("$2");				\ | |
| 144 | 	register long long __a0 asm ("$4") = ARGIFY (arg1);		\ | |
| 145 | 	register long long __a3 asm ("$7");				\ | |
| 146 | 	__asm__ volatile (						\ | |
| 147 | 	".set\tnoreorder\n\t"						\ | |
| 148 | 	v0_init								\ | |
| 149 | 	"syscall\n\t"							\ | |
| 150 | 	".set reorder"							\ | |
| 151 | 	: "=r" (__v0), "=r" (__a3)					\ | |
| 152 | 	: input, "r" (__a0)						\ | |
| 153 | 	: __SYSCALL_CLOBBERS);						\ | |
| 154 | 	err = __a3;							\ | |
| 155 | 	_sys_result = __v0;						\ | |
| 156 | 	}								\ | |
| 157 | 	_sys_result;							\ | |
| 158 | }) | |
| 159 | ||
| 160 | #define internal_syscall2(v0_init, input, number, err, arg1, arg2)	\ | |
| 161 | ({									\ | |
| 162 | 	long _sys_result;						\ | |
| 163 | 									\ | |
| 164 | 	{								\ | |
| 165 | 	register long long __s0 asm ("$16") __attribute__ ((unused))	\ | |
| 166 | 	 = (number);							\ | |
| 167 | 	register long long __v0 asm ("$2");				\ | |
| 168 | 	register long long __a0 asm ("$4") = ARGIFY (arg1);		\ | |
| 169 | 	register long long __a1 asm ("$5") = ARGIFY (arg2);		\ | |
| 170 | 	register long long __a3 asm ("$7");				\ | |
| 171 | 	__asm__ volatile (						\ | |
| 172 | 	".set\tnoreorder\n\t"						\ | |
| 173 | 	v0_init								\ | |
| 174 | 	"syscall\n\t"							\ | |
| 175 | 	".set\treorder"							\ | |
| 176 | 	: "=r" (__v0), "=r" (__a3)					\ | |
| 177 | 	: input, "r" (__a0), "r" (__a1)					\ | |
| 178 | 	: __SYSCALL_CLOBBERS);						\ | |
| 179 | 	err = __a3;							\ | |
| 180 | 	_sys_result = __v0;						\ | |
| 181 | 	}								\ | |
| 182 | 	_sys_result;							\ | |
| 183 | }) | |
| 184 | ||
| 185 | #define internal_syscall3(v0_init, input, number, err,			\ | |
| 186 | 			 arg1, arg2, arg3)				\ | |
| 187 | ({									\ | |
| 188 | 	long _sys_result;						\ | |
| 189 | 									\ | |
| 190 | 	{								\ | |
| 191 | 	register long long __s0 asm ("$16") __attribute__ ((unused))	\ | |
| 192 | 	 = (number);							\ | |
| 193 | 	register long long __v0 asm ("$2");				\ | |
| 194 | 	register long long __a0 asm ("$4") = ARGIFY (arg1);		\ | |
| 195 | 	register long long __a1 asm ("$5") = ARGIFY (arg2);		\ | |
| 196 | 	register long long __a2 asm ("$6") = ARGIFY (arg3);		\ | |
| 197 | 	register long long __a3 asm ("$7");				\ | |
| 198 | 	__asm__ volatile (						\ | |
| 199 | 	".set\tnoreorder\n\t"						\ | |
| 200 | 	v0_init								\ | |
| 201 | 	"syscall\n\t"							\ | |
| 202 | 	".set\treorder"							\ | |
| 203 | 	: "=r" (__v0), "=r" (__a3)					\ | |
| 204 | 	: input, "r" (__a0), "r" (__a1), "r" (__a2)			\ | |
| 205 | 	: __SYSCALL_CLOBBERS);						\ | |
| 206 | 	err = __a3;							\ | |
| 207 | 	_sys_result = __v0;						\ | |
| 208 | 	}								\ | |
| 209 | 	_sys_result;							\ | |
| 210 | }) | |
| 211 | ||
| 212 | #define internal_syscall4(v0_init, input, number, err,			\ | |
| 213 | 			 arg1, arg2, arg3, arg4)			\ | |
| 214 | ({									\ | |
| 215 | 	long _sys_result;						\ | |
| 216 | 									\ | |
| 217 | 	{								\ | |
| 218 | 	register long long __s0 asm ("$16") __attribute__ ((unused))	\ | |
| 219 | 	 = (number);							\ | |
| 220 | 	register long long __v0 asm ("$2");				\ | |
| 221 | 	register long long __a0 asm ("$4") = ARGIFY (arg1);		\ | |
| 222 | 	register long long __a1 asm ("$5") = ARGIFY (arg2);		\ | |
| 223 | 	register long long __a2 asm ("$6") = ARGIFY (arg3);		\ | |
| 224 | 	register long long __a3 asm ("$7") = ARGIFY (arg4);		\ | |
| 225 | 	__asm__ volatile (						\ | |
| 226 | 	".set\tnoreorder\n\t"						\ | |
| 227 | 	v0_init								\ | |
| 228 | 	"syscall\n\t"							\ | |
| 229 | 	".set\treorder"							\ | |
| 230 | 	: "=r" (__v0), "+r" (__a3)					\ | |
| 231 | 	: input, "r" (__a0), "r" (__a1), "r" (__a2)			\ | |
| 232 | 	: __SYSCALL_CLOBBERS);						\ | |
| 233 | 	err = __a3;							\ | |
| 234 | 	_sys_result = __v0;						\ | |
| 235 | 	}								\ | |
| 236 | 	_sys_result;							\ | |
| 237 | }) | |
| 238 | ||
| 239 | #define internal_syscall5(v0_init, input, number, err,			\ | |
| 240 | 			 arg1, arg2, arg3, arg4, arg5)			\ | |
| 241 | ({									\ | |
| 242 | 	long _sys_result;						\ | |
| 243 | 									\ | |
| 244 | 	{								\ | |
| 245 | 	register long long __s0 asm ("$16") __attribute__ ((unused))	\ | |
| 246 | 	 = (number);							\ | |
| 247 | 	register long long __v0 asm ("$2");				\ | |
| 248 | 	register long long __a0 asm ("$4") = ARGIFY (arg1);		\ | |
| 249 | 	register long long __a1 asm ("$5") = ARGIFY (arg2);		\ | |
| 250 | 	register long long __a2 asm ("$6") = ARGIFY (arg3);		\ | |
| 251 | 	register long long __a3 asm ("$7") = ARGIFY (arg4);		\ | |
| 252 | 	register long long __a4 asm ("$8") = ARGIFY (arg5);		\ | |
| 253 | 	__asm__ volatile (						\ | |
| 254 | 	".set\tnoreorder\n\t"						\ | |
| 255 | 	v0_init								\ | |
| 256 | 	"syscall\n\t"							\ | |
| 257 | 	".set\treorder"							\ | |
| 258 | 	: "=r" (__v0), "+r" (__a3)					\ | |
| 259 | 	: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4)		\ | |
| 260 | 	: __SYSCALL_CLOBBERS);						\ | |
| 261 | 	err = __a3;							\ | |
| 262 | 	_sys_result = __v0;						\ | |
| 263 | 	}								\ | |
| 264 | 	_sys_result;							\ | |
| 265 | }) | |
| 266 | ||
| 267 | #define internal_syscall6(v0_init, input, number, err,			\ | |
| 268 | 			 arg1, arg2, arg3, arg4, arg5, arg6)		\ | |
| 269 | ({									\ | |
| 270 | 	long _sys_result;						\ | |
| 271 | 									\ | |
| 272 | 	{								\ | |
| 273 | 	register long long __s0 asm ("$16") __attribute__ ((unused))	\ | |
| 274 | 	 = (number);							\ | |
| 275 | 	register long long __v0 asm ("$2");				\ | |
| 276 | 	register long long __a0 asm ("$4") = ARGIFY (arg1);		\ | |
| 277 | 	register long long __a1 asm ("$5") = ARGIFY (arg2);		\ | |
| 278 | 	register long long __a2 asm ("$6") = ARGIFY (arg3);		\ | |
| 279 | 	register long long __a3 asm ("$7") = ARGIFY (arg4);		\ | |
| 280 | 	register long long __a4 asm ("$8") = ARGIFY (arg5);		\ | |
| 281 | 	register long long __a5 asm ("$9") = ARGIFY (arg6);		\ | |
| 282 | 	__asm__ volatile (						\ | |
| 283 | 	".set\tnoreorder\n\t"						\ | |
| 284 | 	v0_init								\ | |
| 285 | 	"syscall\n\t"							\ | |
| 286 | 	".set\treorder"							\ | |
| 287 | 	: "=r" (__v0), "+r" (__a3)					\ | |
| 288 | 	: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4),	\ | |
| 289 | 	 "r" (__a5)							\ | |
| 290 | 	: __SYSCALL_CLOBBERS);						\ | |
| 291 | 	err = __a3;							\ | |
| 292 | 	_sys_result = __v0;						\ | |
| 293 | 	}								\ | |
| 294 | 	_sys_result;							\ | |
| 295 | }) | |
| 296 | ||
| 297 | #if __mips_isa_rev >= 6 | |
| 298 | # define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \ | |
| 299 | 	 "$14", "$15", "$24", "$25", "memory" | |
| 300 | #else | |
| 301 | # define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \ | |
| 302 | 	 "$14", "$15", "$24", "$25", "hi", "lo", "memory" | |
| 303 | #endif | |
| 304 | ||
| 305 | #endif /* __ASSEMBLER__ */ | |
| 306 | ||
| 307 | /* Pointer mangling is not yet supported for MIPS. */ | |
| 308 | #define PTR_MANGLE(var) (void) (var) | |
| 309 | #define PTR_DEMANGLE(var) (void) (var) | |
| 310 | ||
| 311 | #endif /* linux/mips/sysdep.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h deleted-307| ... | ... | @@ -1,307 +0,0 @@ |
| 1 | /* Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _LINUX_MIPS_SYSDEP_H | |
| 19 | #define _LINUX_MIPS_SYSDEP_H 1 | |
| 20 | ||
| 21 | /* There is some commonality. */ | |
| 22 | #include <sysdeps/unix/sysv/linux/mips/sysdep.h> | |
| 23 | #include <sysdeps/unix/sysv/linux/sysdep.h> | |
| 24 | #include <sysdeps/unix/mips/mips64/n64/sysdep.h> | |
| 25 | ||
| 26 | #include <tls.h> | |
| 27 | ||
| 28 | /* In order to get __set_errno() definition in INLINE_SYSCALL. */ | |
| 29 | #ifndef __ASSEMBLER__ | |
| 30 | #include <errno.h> | |
| 31 | #endif | |
| 32 | ||
| 33 | /* For Linux we can use the system call table in the header file | |
| 34 | 	/usr/include/asm/unistd.h | |
| 35 | of the kernel. But these symbols do not follow the SYS_* syntax | |
| 36 | so we have to redefine the `SYS_ify' macro here. */ | |
| 37 | #undef SYS_ify | |
| 38 | #define SYS_ify(syscall_name)	__NR_##syscall_name | |
| 39 | ||
| 40 | #ifdef __ASSEMBLER__ | |
| 41 | ||
| 42 | /* We don't want the label for the error handler to be visible in the symbol | |
| 43 | table when we define it here. */ | |
| 44 | # define SYSCALL_ERROR_LABEL 99b | |
| 45 | ||
| 46 | #else /* ! __ASSEMBLER__ */ | |
| 47 | ||
| 48 | /* Define a macro which expands into the inline wrapper code for a system | |
| 49 | call. */ | |
| 50 | #undef INLINE_SYSCALL | |
| 51 | #define INLINE_SYSCALL(name, nr, args...)				\ | |
| 52 | ({ INTERNAL_SYSCALL_DECL (_sc_err);					\ | |
| 53 | long result_var = INTERNAL_SYSCALL (name, _sc_err, nr, args);	\ | |
| 54 | if ( INTERNAL_SYSCALL_ERROR_P (result_var, _sc_err) )		\ | |
| 55 | {								\ | |
| 56 | 	 __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, _sc_err));	\ | |
| 57 | 	 result_var = -1L;						\ | |
| 58 | }								\ | |
| 59 | result_var; }) | |
| 60 | ||
| 61 | #undef INTERNAL_SYSCALL_DECL | |
| 62 | #define INTERNAL_SYSCALL_DECL(err) long err __attribute__ ((unused)) | |
| 63 | ||
| 64 | #undef INTERNAL_SYSCALL_ERROR_P | |
| 65 | #define INTERNAL_SYSCALL_ERROR_P(val, err) ((void) (val), (long) (err)) | |
| 66 | ||
| 67 | #undef INTERNAL_SYSCALL_ERRNO | |
| 68 | #define INTERNAL_SYSCALL_ERRNO(val, err) ((void) (err), val) | |
| 69 | ||
| 70 | /* Note that the original Linux syscall restart convention required the | |
| 71 | instruction immediately preceding SYSCALL to initialize $v0 with the | |
| 72 | syscall number. Then if a restart triggered, $v0 would have been | |
| 73 | clobbered by the syscall interrupted, and needed to be reinititalized. | |
| 74 | The kernel would decrement the PC by 4 before switching back to the | |
| 75 | user mode so that $v0 had been reloaded before SYSCALL was executed | |
| 76 | again. This implied the place $v0 was loaded from must have been | |
| 77 | preserved across a syscall, e.g. an immediate, static register, stack | |
| 78 | slot, etc. | |
| 79 | ||
| 80 | The convention was relaxed in Linux with a change applied to the kernel | |
| 81 | GIT repository as commit 96187fb0bc30cd7919759d371d810e928048249d, that | |
| 82 | first appeared in the 2.6.36 release. Since then the kernel has had | |
| 83 | code that reloads $v0 upon syscall restart and resumes right at the | |
| 84 | SYSCALL instruction, so no special arrangement is needed anymore. | |
| 85 | ||
| 86 | For backwards compatibility with existing kernel binaries we support | |
| 87 | the old convention by choosing the instruction preceding SYSCALL | |
| 88 | carefully. This also means we have to force a 32-bit encoding of the | |
| 89 | microMIPS MOVE instruction if one is used. */ | |
| 90 | ||
| 91 | #ifdef __mips_micromips | |
| 92 | # define MOVE32 "move32" | |
| 93 | #else | |
| 94 | # define MOVE32 "move" | |
| 95 | #endif | |
| 96 | ||
| 97 | #undef INTERNAL_SYSCALL | |
| 98 | #define INTERNAL_SYSCALL(name, err, nr, args...)			\ | |
| 99 | 	internal_syscall##nr ("li\t%0, %2\t\t\t# " #name "\n\t",	\ | |
| 100 | 			 "IK" (SYS_ify (name)),			\ | |
| 101 | 			 0, err, args) | |
| 102 | ||
| 103 | #undef INTERNAL_SYSCALL_NCS | |
| 104 | #define INTERNAL_SYSCALL_NCS(number, err, nr, args...)			\ | |
| 105 | 	internal_syscall##nr (MOVE32 "\t%0, %2\n\t",			\ | |
| 106 | 			 "r" (__s0),				\ | |
| 107 | 			 number, err, args) | |
| 108 | ||
| 109 | #define internal_syscall0(v0_init, input, number, err, dummy...)	\ | |
| 110 | ({									\ | |
| 111 | 	long _sys_result;						\ | |
| 112 | 									\ | |
| 113 | 	{								\ | |
| 114 | 	register long __s0 asm ("$16") __attribute__ ((unused))		\ | |
| 115 | 	 = (number);							\ | |
| 116 | 	register long __v0 asm ("$2");					\ | |
| 117 | 	register long __a3 asm ("$7");					\ | |
| 118 | 	__asm__ volatile (						\ | |
| 119 | 	".set\tnoreorder\n\t"						\ | |
| 120 | 	v0_init								\ | |
| 121 | 	"syscall\n\t"							\ | |
| 122 | 	".set reorder"							\ | |
| 123 | 	: "=r" (__v0), "=r" (__a3)					\ | |
| 124 | 	: input								\ | |
| 125 | 	: __SYSCALL_CLOBBERS);						\ | |
| 126 | 	err = __a3;							\ | |
| 127 | 	_sys_result = __v0;						\ | |
| 128 | 	}								\ | |
| 129 | 	_sys_result;							\ | |
| 130 | }) | |
| 131 | ||
| 132 | #define internal_syscall1(v0_init, input, number, err, arg1)		\ | |
| 133 | ({									\ | |
| 134 | 	long _sys_result;						\ | |
| 135 | 									\ | |
| 136 | 	{								\ | |
| 137 | 	register long __s0 asm ("$16") __attribute__ ((unused))		\ | |
| 138 | 	 = (number);							\ | |
| 139 | 	register long __v0 asm ("$2");					\ | |
| 140 | 	register long __a0 asm ("$4") = (long) (arg1);			\ | |
| 141 | 	register long __a3 asm ("$7");					\ | |
| 142 | 	__asm__ volatile (						\ | |
| 143 | 	".set\tnoreorder\n\t"						\ | |
| 144 | 	v0_init								\ | |
| 145 | 	"syscall\n\t"							\ | |
| 146 | 	".set reorder"							\ | |
| 147 | 	: "=r" (__v0), "=r" (__a3)					\ | |
| 148 | 	: input, "r" (__a0)						\ | |
| 149 | 	: __SYSCALL_CLOBBERS);						\ | |
| 150 | 	err = __a3;							\ | |
| 151 | 	_sys_result = __v0;						\ | |
| 152 | 	}								\ | |
| 153 | 	_sys_result;							\ | |
| 154 | }) | |
| 155 | ||
| 156 | #define internal_syscall2(v0_init, input, number, err, arg1, arg2)	\ | |
| 157 | ({									\ | |
| 158 | 	long _sys_result;						\ | |
| 159 | 									\ | |
| 160 | 	{								\ | |
| 161 | 	register long __s0 asm ("$16") __attribute__ ((unused))		\ | |
| 162 | 	 = (number);							\ | |
| 163 | 	register long __v0 asm ("$2");					\ | |
| 164 | 	register long __a0 asm ("$4") = (long) (arg1);			\ | |
| 165 | 	register long __a1 asm ("$5") = (long) (arg2);			\ | |
| 166 | 	register long __a3 asm ("$7");					\ | |
| 167 | 	__asm__ volatile (						\ | |
| 168 | 	".set\tnoreorder\n\t"						\ | |
| 169 | 	v0_init								\ | |
| 170 | 	"syscall\n\t"							\ | |
| 171 | 	".set\treorder"							\ | |
| 172 | 	: "=r" (__v0), "=r" (__a3)					\ | |
| 173 | 	: input, "r" (__a0), "r" (__a1)					\ | |
| 174 | 	: __SYSCALL_CLOBBERS);						\ | |
| 175 | 	err = __a3;							\ | |
| 176 | 	_sys_result = __v0;						\ | |
| 177 | 	}								\ | |
| 178 | 	_sys_result;							\ | |
| 179 | }) | |
| 180 | ||
| 181 | #define internal_syscall3(v0_init, input, number, err,			\ | |
| 182 | 			 arg1, arg2, arg3)				\ | |
| 183 | ({									\ | |
| 184 | 	long _sys_result;						\ | |
| 185 | 									\ | |
| 186 | 	{								\ | |
| 187 | 	register long __s0 asm ("$16") __attribute__ ((unused))		\ | |
| 188 | 	 = (number);							\ | |
| 189 | 	register long __v0 asm ("$2");					\ | |
| 190 | 	register long __a0 asm ("$4") = (long) (arg1);			\ | |
| 191 | 	register long __a1 asm ("$5") = (long) (arg2);			\ | |
| 192 | 	register long __a2 asm ("$6") = (long) (arg3);			\ | |
| 193 | 	register long __a3 asm ("$7");					\ | |
| 194 | 	__asm__ volatile (						\ | |
| 195 | 	".set\tnoreorder\n\t"						\ | |
| 196 | 	v0_init								\ | |
| 197 | 	"syscall\n\t"							\ | |
| 198 | 	".set\treorder"							\ | |
| 199 | 	: "=r" (__v0), "=r" (__a3)					\ | |
| 200 | 	: input, "r" (__a0), "r" (__a1), "r" (__a2)			\ | |
| 201 | 	: __SYSCALL_CLOBBERS);						\ | |
| 202 | 	err = __a3;							\ | |
| 203 | 	_sys_result = __v0;						\ | |
| 204 | 	}								\ | |
| 205 | 	_sys_result;							\ | |
| 206 | }) | |
| 207 | ||
| 208 | #define internal_syscall4(v0_init, input, number, err,			\ | |
| 209 | 			 arg1, arg2, arg3, arg4)			\ | |
| 210 | ({									\ | |
| 211 | 	long _sys_result;						\ | |
| 212 | 									\ | |
| 213 | 	{								\ | |
| 214 | 	register long __s0 asm ("$16") __attribute__ ((unused))		\ | |
| 215 | 	 = (number);							\ | |
| 216 | 	register long __v0 asm ("$2");					\ | |
| 217 | 	register long __a0 asm ("$4") = (long) (arg1);			\ | |
| 218 | 	register long __a1 asm ("$5") = (long) (arg2);			\ | |
| 219 | 	register long __a2 asm ("$6") = (long) (arg3);			\ | |
| 220 | 	register long __a3 asm ("$7") = (long) (arg4);			\ | |
| 221 | 	__asm__ volatile (						\ | |
| 222 | 	".set\tnoreorder\n\t"						\ | |
| 223 | 	v0_init								\ | |
| 224 | 	"syscall\n\t"							\ | |
| 225 | 	".set\treorder"							\ | |
| 226 | 	: "=r" (__v0), "+r" (__a3)					\ | |
| 227 | 	: input, "r" (__a0), "r" (__a1), "r" (__a2)			\ | |
| 228 | 	: __SYSCALL_CLOBBERS);						\ | |
| 229 | 	err = __a3;							\ | |
| 230 | 	_sys_result = __v0;						\ | |
| 231 | 	}								\ | |
| 232 | 	_sys_result;							\ | |
| 233 | }) | |
| 234 | ||
| 235 | #define internal_syscall5(v0_init, input, number, err,			\ | |
| 236 | 			 arg1, arg2, arg3, arg4, arg5)			\ | |
| 237 | ({									\ | |
| 238 | 	long _sys_result;						\ | |
| 239 | 									\ | |
| 240 | 	{								\ | |
| 241 | 	register long __s0 asm ("$16") __attribute__ ((unused))		\ | |
| 242 | 	 = (number);							\ | |
| 243 | 	register long __v0 asm ("$2");					\ | |
| 244 | 	register long __a0 asm ("$4") = (long) (arg1);			\ | |
| 245 | 	register long __a1 asm ("$5") = (long) (arg2);			\ | |
| 246 | 	register long __a2 asm ("$6") = (long) (arg3);			\ | |
| 247 | 	register long __a3 asm ("$7") = (long) (arg4);			\ | |
| 248 | 	register long __a4 asm ("$8") = (long) (arg5);			\ | |
| 249 | 	__asm__ volatile (						\ | |
| 250 | 	".set\tnoreorder\n\t"						\ | |
| 251 | 	v0_init								\ | |
| 252 | 	"syscall\n\t"							\ | |
| 253 | 	".set\treorder"							\ | |
| 254 | 	: "=r" (__v0), "+r" (__a3)					\ | |
| 255 | 	: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4)		\ | |
| 256 | 	: __SYSCALL_CLOBBERS);						\ | |
| 257 | 	err = __a3;							\ | |
| 258 | 	_sys_result = __v0;						\ | |
| 259 | 	}								\ | |
| 260 | 	_sys_result;							\ | |
| 261 | }) | |
| 262 | ||
| 263 | #define internal_syscall6(v0_init, input, number, err,			\ | |
| 264 | 			 arg1, arg2, arg3, arg4, arg5, arg6)		\ | |
| 265 | ({									\ | |
| 266 | 	long _sys_result;						\ | |
| 267 | 									\ | |
| 268 | 	{								\ | |
| 269 | 	register long __s0 asm ("$16") __attribute__ ((unused))		\ | |
| 270 | 	 = (number);							\ | |
| 271 | 	register long __v0 asm ("$2");					\ | |
| 272 | 	register long __a0 asm ("$4") = (long) (arg1);			\ | |
| 273 | 	register long __a1 asm ("$5") = (long) (arg2);			\ | |
| 274 | 	register long __a2 asm ("$6") = (long) (arg3);			\ | |
| 275 | 	register long __a3 asm ("$7") = (long) (arg4);			\ | |
| 276 | 	register long __a4 asm ("$8") = (long) (arg5);			\ | |
| 277 | 	register long __a5 asm ("$9") = (long) (arg6);			\ | |
| 278 | 	__asm__ volatile (						\ | |
| 279 | 	".set\tnoreorder\n\t"						\ | |
| 280 | 	v0_init								\ | |
| 281 | 	"syscall\n\t"							\ | |
| 282 | 	".set\treorder"							\ | |
| 283 | 	: "=r" (__v0), "+r" (__a3)					\ | |
| 284 | 	: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4),	\ | |
| 285 | 	 "r" (__a5)							\ | |
| 286 | 	: __SYSCALL_CLOBBERS);						\ | |
| 287 | 	err = __a3;							\ | |
| 288 | 	_sys_result = __v0;						\ | |
| 289 | 	}								\ | |
| 290 | 	_sys_result;							\ | |
| 291 | }) | |
| 292 | ||
| 293 | #if __mips_isa_rev >= 6 | |
| 294 | # define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \ | |
| 295 | 	 "$14", "$15", "$24", "$25", "memory" | |
| 296 | #else | |
| 297 | # define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \ | |
| 298 | 	 "$14", "$15", "$24", "$25", "hi", "lo", "memory" | |
| 299 | #endif | |
| 300 | ||
| 301 | #endif /* __ASSEMBLER__ */ | |
| 302 | ||
| 303 | /* Pointer mangling is not yet supported for MIPS. */ | |
| 304 | #define PTR_MANGLE(var) (void) (var) | |
| 305 | #define PTR_DEMANGLE(var) (void) (var) | |
| 306 | ||
| 307 | #endif /* linux/mips/sysdep.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h created+307| ... | ... | @@ -0,0 +1,307 @@ |
| 1 | /* Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _LINUX_MIPS_SYSDEP_H | |
| 19 | #define _LINUX_MIPS_SYSDEP_H 1 | |
| 20 | ||
| 21 | /* There is some commonality. */ | |
| 22 | #include <sysdeps/unix/sysv/linux/mips/sysdep.h> | |
| 23 | #include <sysdeps/unix/sysv/linux/sysdep.h> | |
| 24 | #include <sysdeps/unix/mips/mips64/sysdep.h> | |
| 25 | ||
| 26 | #include <tls.h> | |
| 27 | ||
| 28 | /* For Linux we can use the system call table in the header file | |
| 29 | 	/usr/include/asm/unistd.h | |
| 30 | of the kernel. But these symbols do not follow the SYS_* syntax | |
| 31 | so we have to redefine the `SYS_ify' macro here. */ | |
| 32 | #undef SYS_ify | |
| 33 | #define SYS_ify(syscall_name)	__NR_##syscall_name | |
| 34 | ||
| 35 | #ifdef __ASSEMBLER__ | |
| 36 | ||
| 37 | /* We don't want the label for the error handler to be visible in the symbol | |
| 38 | table when we define it here. */ | |
| 39 | # undef SYSCALL_ERROR_LABEL | |
| 40 | # define SYSCALL_ERROR_LABEL 99b | |
| 41 | ||
| 42 | #else /* ! __ASSEMBLER__ */ | |
| 43 | ||
| 44 | #undef HAVE_INTERNAL_BRK_ADDR_SYMBOL | |
| 45 | #define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 | |
| 46 | ||
| 47 | #if _MIPS_SIM == _ABIN32 | |
| 48 | /* Convert X to a long long, without losing any bits if it is one | |
| 49 | already or warning if it is a 32-bit pointer. */ | |
| 50 | # define ARGIFY(X) ((long long int) (__typeof__ ((X) - (X))) (X)) | |
| 51 | typedef long long int __syscall_arg_t; | |
| 52 | #else | |
| 53 | # define ARGIFY(X) ((long int) (X)) | |
| 54 | typedef long int __syscall_arg_t; | |
| 55 | #endif | |
| 56 | ||
| 57 | /* Note that the original Linux syscall restart convention required the | |
| 58 | instruction immediately preceding SYSCALL to initialize $v0 with the | |
| 59 | syscall number. Then if a restart triggered, $v0 would have been | |
| 60 | clobbered by the syscall interrupted, and needed to be reinititalized. | |
| 61 | The kernel would decrement the PC by 4 before switching back to the | |
| 62 | user mode so that $v0 had been reloaded before SYSCALL was executed | |
| 63 | again. This implied the place $v0 was loaded from must have been | |
| 64 | preserved across a syscall, e.g. an immediate, static register, stack | |
| 65 | slot, etc. | |
| 66 | ||
| 67 | The convention was relaxed in Linux with a change applied to the kernel | |
| 68 | GIT repository as commit 96187fb0bc30cd7919759d371d810e928048249d, that | |
| 69 | first appeared in the 2.6.36 release. Since then the kernel has had | |
| 70 | code that reloads $v0 upon syscall restart and resumes right at the | |
| 71 | SYSCALL instruction, so no special arrangement is needed anymore. | |
| 72 | ||
| 73 | For backwards compatibility with existing kernel binaries we support | |
| 74 | the old convention by choosing the instruction preceding SYSCALL | |
| 75 | carefully. This also means we have to force a 32-bit encoding of the | |
| 76 | microMIPS MOVE instruction if one is used. */ | |
| 77 | ||
| 78 | #ifdef __mips_micromips | |
| 79 | # define MOVE32 "move32" | |
| 80 | #else | |
| 81 | # define MOVE32 "move" | |
| 82 | #endif | |
| 83 | ||
| 84 | #undef INTERNAL_SYSCALL | |
| 85 | #define INTERNAL_SYSCALL(name, nr, args...)			\ | |
| 86 | 	internal_syscall##nr ("li\t%0, %2\t\t\t# " #name "\n\t",	\ | |
| 87 | 			 "IK" (SYS_ify (name)),			\ | |
| 88 | 			 0, args) | |
| 89 | ||
| 90 | #undef INTERNAL_SYSCALL_NCS | |
| 91 | #define INTERNAL_SYSCALL_NCS(number, nr, args...)			\ | |
| 92 | 	internal_syscall##nr (MOVE32 "\t%0, %2\n\t",			\ | |
| 93 | 			 "r" (__s0),				\ | |
| 94 | 			 number, args) | |
| 95 | ||
| 96 | #define internal_syscall0(v0_init, input, number, dummy...)	\ | |
| 97 | ({									\ | |
| 98 | 	long int _sys_result;						\ | |
| 99 | 									\ | |
| 100 | 	{								\ | |
| 101 | 	register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\ | |
| 102 | 	 = (number);							\ | |
| 103 | 	register __syscall_arg_t __v0 asm ("$2");			\ | |
| 104 | 	register __syscall_arg_t __a3 asm ("$7");			\ | |
| 105 | 	__asm__ volatile (						\ | |
| 106 | 	".set\tnoreorder\n\t"						\ | |
| 107 | 	v0_init								\ | |
| 108 | 	"syscall\n\t"							\ | |
| 109 | 	".set reorder"							\ | |
| 110 | 	: "=r" (__v0), "=r" (__a3)					\ | |
| 111 | 	: input								\ | |
| 112 | 	: __SYSCALL_CLOBBERS);						\ | |
| 113 | 	_sys_result = __a3 != 0 ? -__v0 : __v0;				\ | |
| 114 | 	}								\ | |
| 115 | 	_sys_result;							\ | |
| 116 | }) | |
| 117 | ||
| 118 | #define internal_syscall1(v0_init, input, number, arg1)		\ | |
| 119 | ({									\ | |
| 120 | 	long int _sys_result;						\ | |
| 121 | 									\ | |
| 122 | 	{								\ | |
| 123 | 	__syscall_arg_t _arg1 = ARGIFY (arg1);				\ | |
| 124 | 	register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\ | |
| 125 | 	 = (number);							\ | |
| 126 | 	register __syscall_arg_t __v0 asm ("$2");			\ | |
| 127 | 	register __syscall_arg_t __a0 asm ("$4") = _arg1;		\ | |
| 128 | 	register __syscall_arg_t __a3 asm ("$7");			\ | |
| 129 | 	__asm__ volatile (						\ | |
| 130 | 	".set\tnoreorder\n\t"						\ | |
| 131 | 	v0_init								\ | |
| 132 | 	"syscall\n\t"							\ | |
| 133 | 	".set reorder"							\ | |
| 134 | 	: "=r" (__v0), "=r" (__a3)					\ | |
| 135 | 	: input, "r" (__a0)						\ | |
| 136 | 	: __SYSCALL_CLOBBERS);						\ | |
| 137 | 	_sys_result = __a3 != 0 ? -__v0 : __v0;				\ | |
| 138 | 	}								\ | |
| 139 | 	_sys_result;							\ | |
| 140 | }) | |
| 141 | ||
| 142 | #define internal_syscall2(v0_init, input, number, arg1, arg2)	\ | |
| 143 | ({									\ | |
| 144 | 	long int _sys_result;						\ | |
| 145 | 									\ | |
| 146 | 	{								\ | |
| 147 | 	__syscall_arg_t _arg1 = ARGIFY (arg1);				\ | |
| 148 | 	__syscall_arg_t _arg2 = ARGIFY (arg2);				\ | |
| 149 | 	register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\ | |
| 150 | 	 = (number);							\ | |
| 151 | 	register __syscall_arg_t __v0 asm ("$2");			\ | |
| 152 | 	register __syscall_arg_t __a0 asm ("$4") = _arg1;		\ | |
| 153 | 	register __syscall_arg_t __a1 asm ("$5") = _arg2;		\ | |
| 154 | 	register __syscall_arg_t __a3 asm ("$7");			\ | |
| 155 | 	__asm__ volatile (						\ | |
| 156 | 	".set\tnoreorder\n\t"						\ | |
| 157 | 	v0_init								\ | |
| 158 | 	"syscall\n\t"							\ | |
| 159 | 	".set\treorder"							\ | |
| 160 | 	: "=r" (__v0), "=r" (__a3)					\ | |
| 161 | 	: input, "r" (__a0), "r" (__a1)					\ | |
| 162 | 	: __SYSCALL_CLOBBERS);						\ | |
| 163 | 	_sys_result = __a3 != 0 ? -__v0 : __v0;				\ | |
| 164 | 	}								\ | |
| 165 | 	_sys_result;							\ | |
| 166 | }) | |
| 167 | ||
| 168 | #define internal_syscall3(v0_init, input, number, arg1, arg2, arg3)	\ | |
| 169 | ({									\ | |
| 170 | 	long int _sys_result;						\ | |
| 171 | 									\ | |
| 172 | 	{								\ | |
| 173 | 	__syscall_arg_t _arg1 = ARGIFY (arg1);				\ | |
| 174 | 	__syscall_arg_t _arg2 = ARGIFY (arg2);				\ | |
| 175 | 	__syscall_arg_t _arg3 = ARGIFY (arg3);				\ | |
| 176 | 	register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\ | |
| 177 | 	 = (number);							\ | |
| 178 | 	register __syscall_arg_t __v0 asm ("$2");			\ | |
| 179 | 	register __syscall_arg_t __a0 asm ("$4") = _arg1;		\ | |
| 180 | 	register __syscall_arg_t __a1 asm ("$5") = _arg2;		\ | |
| 181 | 	register __syscall_arg_t __a2 asm ("$6") = _arg3;		\ | |
| 182 | 	register __syscall_arg_t __a3 asm ("$7");			\ | |
| 183 | 	__asm__ volatile (						\ | |
| 184 | 	".set\tnoreorder\n\t"						\ | |
| 185 | 	v0_init								\ | |
| 186 | 	"syscall\n\t"							\ | |
| 187 | 	".set\treorder"							\ | |
| 188 | 	: "=r" (__v0), "=r" (__a3)					\ | |
| 189 | 	: input, "r" (__a0), "r" (__a1), "r" (__a2)			\ | |
| 190 | 	: __SYSCALL_CLOBBERS);						\ | |
| 191 | 	_sys_result = __a3 != 0 ? -__v0 : __v0;				\ | |
| 192 | 	}								\ | |
| 193 | 	_sys_result;							\ | |
| 194 | }) | |
| 195 | ||
| 196 | #define internal_syscall4(v0_init, input, number, arg1, arg2, arg3, 	\ | |
| 197 | 			 arg4)						\ | |
| 198 | ({									\ | |
| 199 | 	long int _sys_result;						\ | |
| 200 | 									\ | |
| 201 | 	{								\ | |
| 202 | 	__syscall_arg_t _arg1 = ARGIFY (arg1);				\ | |
| 203 | 	__syscall_arg_t _arg2 = ARGIFY (arg2);				\ | |
| 204 | 	__syscall_arg_t _arg3 = ARGIFY (arg3);				\ | |
| 205 | 	__syscall_arg_t _arg4 = ARGIFY (arg4);				\ | |
| 206 | 	register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\ | |
| 207 | 	 = (number);							\ | |
| 208 | 	register __syscall_arg_t __v0 asm ("$2");			\ | |
| 209 | 	register __syscall_arg_t __a0 asm ("$4") = _arg1;		\ | |
| 210 | 	register __syscall_arg_t __a1 asm ("$5") = _arg2;		\ | |
| 211 | 	register __syscall_arg_t __a2 asm ("$6") = _arg3;		\ | |
| 212 | 	register __syscall_arg_t __a3 asm ("$7") = _arg4;		\ | |
| 213 | 	__asm__ volatile (						\ | |
| 214 | 	".set\tnoreorder\n\t"						\ | |
| 215 | 	v0_init								\ | |
| 216 | 	"syscall\n\t"							\ | |
| 217 | 	".set\treorder"							\ | |
| 218 | 	: "=r" (__v0), "+r" (__a3)					\ | |
| 219 | 	: input, "r" (__a0), "r" (__a1), "r" (__a2)			\ | |
| 220 | 	: __SYSCALL_CLOBBERS);						\ | |
| 221 | 	_sys_result = __a3 != 0 ? -__v0 : __v0;				\ | |
| 222 | 	}								\ | |
| 223 | 	_sys_result;							\ | |
| 224 | }) | |
| 225 | ||
| 226 | #define internal_syscall5(v0_init, input, number, arg1, arg2, arg3, 	\ | |
| 227 | 			 arg4, arg5)					\ | |
| 228 | ({									\ | |
| 229 | 	long int _sys_result;						\ | |
| 230 | 									\ | |
| 231 | 	{								\ | |
| 232 | 	__syscall_arg_t _arg1 = ARGIFY (arg1);				\ | |
| 233 | 	__syscall_arg_t _arg2 = ARGIFY (arg2);				\ | |
| 234 | 	__syscall_arg_t _arg3 = ARGIFY (arg3);				\ | |
| 235 | 	__syscall_arg_t _arg4 = ARGIFY (arg4);				\ | |
| 236 | 	__syscall_arg_t _arg5 = ARGIFY (arg5);				\ | |
| 237 | 	register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\ | |
| 238 | 	 = (number);							\ | |
| 239 | 	register __syscall_arg_t __v0 asm ("$2");			\ | |
| 240 | 	register __syscall_arg_t __a0 asm ("$4") = _arg1;		\ | |
| 241 | 	register __syscall_arg_t __a1 asm ("$5") = _arg2;		\ | |
| 242 | 	register __syscall_arg_t __a2 asm ("$6") = _arg3;		\ | |
| 243 | 	register __syscall_arg_t __a3 asm ("$7") = _arg4;		\ | |
| 244 | 	register __syscall_arg_t __a4 asm ("$8") = _arg5;		\ | |
| 245 | 	__asm__ volatile (						\ | |
| 246 | 	".set\tnoreorder\n\t"						\ | |
| 247 | 	v0_init								\ | |
| 248 | 	"syscall\n\t"							\ | |
| 249 | 	".set\treorder"							\ | |
| 250 | 	: "=r" (__v0), "+r" (__a3)					\ | |
| 251 | 	: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4)		\ | |
| 252 | 	: __SYSCALL_CLOBBERS);						\ | |
| 253 | 	_sys_result = __a3 != 0 ? -__v0 : __v0;				\ | |
| 254 | 	}								\ | |
| 255 | 	_sys_result;							\ | |
| 256 | }) | |
| 257 | ||
| 258 | #define internal_syscall6(v0_init, input, number, arg1, arg2, arg3, 	\ | |
| 259 | 			 arg4, arg5, arg6)				\ | |
| 260 | ({									\ | |
| 261 | 	long int _sys_result;						\ | |
| 262 | 									\ | |
| 263 | 	{								\ | |
| 264 | 	__syscall_arg_t _arg1 = ARGIFY (arg1);				\ | |
| 265 | 	__syscall_arg_t _arg2 = ARGIFY (arg2);				\ | |
| 266 | 	__syscall_arg_t _arg3 = ARGIFY (arg3);				\ | |
| 267 | 	__syscall_arg_t _arg4 = ARGIFY (arg4);				\ | |
| 268 | 	__syscall_arg_t _arg5 = ARGIFY (arg5);				\ | |
| 269 | 	__syscall_arg_t _arg6 = ARGIFY (arg6);				\ | |
| 270 | 	register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\ | |
| 271 | 	 = (number);							\ | |
| 272 | 	register __syscall_arg_t __v0 asm ("$2");			\ | |
| 273 | 	register __syscall_arg_t __a0 asm ("$4") = _arg1;		\ | |
| 274 | 	register __syscall_arg_t __a1 asm ("$5") = _arg2;		\ | |
| 275 | 	register __syscall_arg_t __a2 asm ("$6") = _arg3;		\ | |
| 276 | 	register __syscall_arg_t __a3 asm ("$7") = _arg4;		\ | |
| 277 | 	register __syscall_arg_t __a4 asm ("$8") = _arg5;		\ | |
| 278 | 	register __syscall_arg_t __a5 asm ("$9") = _arg6;		\ | |
| 279 | 	__asm__ volatile (						\ | |
| 280 | 	".set\tnoreorder\n\t"						\ | |
| 281 | 	v0_init								\ | |
| 282 | 	"syscall\n\t"							\ | |
| 283 | 	".set\treorder"							\ | |
| 284 | 	: "=r" (__v0), "+r" (__a3)					\ | |
| 285 | 	: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4),	\ | |
| 286 | 	 "r" (__a5)							\ | |
| 287 | 	: __SYSCALL_CLOBBERS);						\ | |
| 288 | 	_sys_result = __a3 != 0 ? -__v0 : __v0;				\ | |
| 289 | 	}								\ | |
| 290 | 	_sys_result;							\ | |
| 291 | }) | |
| 292 | ||
| 293 | #if __mips_isa_rev >= 6 | |
| 294 | # define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \ | |
| 295 | 	 "$14", "$15", "$24", "$25", "memory" | |
| 296 | #else | |
| 297 | # define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \ | |
| 298 | 	 "$14", "$15", "$24", "$25", "hi", "lo", "memory" | |
| 299 | #endif | |
| 300 | ||
| 301 | #endif /* __ASSEMBLER__ */ | |
| 302 | ||
| 303 | /* Pointer mangling is not yet supported for MIPS. */ | |
| 304 | #define PTR_MANGLE(var) (void) (var) | |
| 305 | #define PTR_DEMANGLE(var) (void) (var) | |
| 306 | ||
| 307 | #endif /* linux/mips/sysdep.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/sysdep.h created+30| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | /* Syscall definitions, Linux MIPS generic version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <sgidefs.h> | |
| 20 | ||
| 21 | #define VDSO_NAME "LINUX_2.6" | |
| 22 | #define VDSO_HASH 61765110 | |
| 23 | ||
| 24 | /* List of system calls which are supported as vsyscalls. */ | |
| 25 | #define HAVE_CLOCK_GETTIME_VSYSCALL "__vdso_clock_gettime" | |
| 26 | #if _MIPS_SIM != _ABI64 | |
| 27 | # define HAVE_CLOCK_GETTIME64_VSYSCALL "__vdso_clock_gettime64" | |
| 28 | #endif | |
| 29 | #define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday" | |
| 30 | #define HAVE_CLOCK_GETRES_VSYSCALL "__vdso_clock_getres" |
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/xstatver.h created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | /* Versions of the 'struct stat' data structure used in compatibility xstat | |
| 2 | functions. */ | |
| 3 | #define _STAT_VER_LINUX_OLD	1 | |
| 4 | #define _STAT_VER_KERNEL	1 | |
| 5 | #define _STAT_VER_SVR4		2 | |
| 6 | #define _STAT_VER_LINUX		3 | |
| 7 | #define _STAT_VER		_STAT_VER_LINUX | |
| 8 | ||
| 9 | /* Versions of the 'xmknod' interface used in compatibility xmknod | |
| 10 | functions. */ | |
| 11 | #define _MKNOD_VER_LINUX	1 | |
| 12 | #define _MKNOD_VER_SVR4		2 | |
| 13 | #define _MKNOD_VER		_MKNOD_VER_LINUX |
lib/libc/glibc/sysdeps/unix/sysv/linux/mknodat.c created+37| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | /* Create a special or ordinary file. Linux version. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <inttypes.h> | |
| 20 | #include <sys/types.h> | |
| 21 | #include <sys/stat.h> | |
| 22 | #include <errno.h> | |
| 23 | #include <sysdep.h> | |
| 24 | ||
| 25 | int | |
| 26 | __mknodat (int fd, const char *path, mode_t mode, dev_t dev) | |
| 27 | { | |
| 28 | /* The user-exported dev_t is 64-bit while the kernel interface is | |
| 29 | 32-bit. */ | |
| 30 | unsigned int k_dev = dev; | |
| 31 | if (k_dev != dev) | |
| 32 | return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); | |
| 33 | ||
| 34 | return INLINE_SYSCALL_CALL (mknodat, fd, path, mode, k_dev); | |
| 35 | } | |
| 36 | libc_hidden_def (__mknodat) | |
| 37 | weak_alias (__mknodat, mknodat) |
lib/libc/glibc/sysdeps/unix/sysv/linux/nios2/kernel_stat.h created+22| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | /* Internal definitions for stat functions. Linux/nios2. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. | |
| 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 | #define STAT_IS_KERNEL_STAT 1 | |
| 21 | #define XSTAT_IS_XSTAT64 0 | |
| 22 | #define STATFS_IS_STATFS64 0 |
lib/libc/glibc/sysdeps/unix/sysv/linux/nios2/sysdep.h created+240| ... | ... | @@ -0,0 +1,240 @@ |
| 1 | /* Assembler macros for Nios II. | |
| 2 | Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _LINUX_NIOS2_SYSDEP_H | |
| 20 | #define _LINUX_NIOS2_SYSDEP_H 1 | |
| 21 | ||
| 22 | #include <sysdeps/unix/sysdep.h> | |
| 23 | #include <sysdeps/nios2/sysdep.h> | |
| 24 | #include <sysdeps/unix/sysv/linux/generic/sysdep.h> | |
| 25 | ||
| 26 | /* For RTLD_PRIVATE_ERRNO. */ | |
| 27 | #include <dl-sysdep.h> | |
| 28 | ||
| 29 | #include <tls.h> | |
| 30 | ||
| 31 | /* For Linux we can use the system call table in the header file | |
| 32 | /usr/include/asm/unistd.h | |
| 33 | of the kernel. But these symbols do not follow the SYS_* syntax | |
| 34 | so we have to redefine the `SYS_ify' macro here. */ | |
| 35 | #undef SYS_ify | |
| 36 | #define SYS_ify(syscall_name) __NR_##syscall_name | |
| 37 | ||
| 38 | #ifdef __ASSEMBLER__ | |
| 39 | ||
| 40 | #undef SYSCALL_ERROR_LABEL | |
| 41 | #define SYSCALL_ERROR_LABEL __local_syscall_error | |
| 42 | ||
| 43 | #undef PSEUDO | |
| 44 | #define PSEUDO(name, syscall_name, args) \ | |
| 45 | ENTRY (name) \ | |
| 46 | DO_CALL (syscall_name, args) \ | |
| 47 | bne r7, zero, SYSCALL_ERROR_LABEL; \ | |
| 48 | ||
| 49 | #undef PSEUDO_END | |
| 50 | #define PSEUDO_END(name) \ | |
| 51 | SYSCALL_ERROR_HANDLER \ | |
| 52 | END (name) | |
| 53 | ||
| 54 | #undef PSEUDO_NOERRNO | |
| 55 | #define PSEUDO_NOERRNO(name, syscall_name, args) \ | |
| 56 | ENTRY (name) \ | |
| 57 | DO_CALL (syscall_name, args) | |
| 58 | ||
| 59 | #undef PSEUDO_END_NOERRNO | |
| 60 | #define PSEUDO_END_NOERRNO(name) \ | |
| 61 | END (name) | |
| 62 | ||
| 63 | #undef ret_NOERRNO | |
| 64 | #define ret_NOERRNO ret | |
| 65 | ||
| 66 | #undef DO_CALL | |
| 67 | #define DO_CALL(syscall_name, args) \ | |
| 68 | DOARGS_##args \ | |
| 69 | movi r2, SYS_ify(syscall_name); \ | |
| 70 | trap; | |
| 71 | ||
| 72 | #if defined(__PIC__) || defined(PIC) | |
| 73 | ||
| 74 | # if RTLD_PRIVATE_ERRNO | |
| 75 | ||
| 76 | # define SYSCALL_ERROR_HANDLER			\ | |
| 77 | SYSCALL_ERROR_LABEL:				\ | |
| 78 | nextpc r3;					\ | |
| 79 | 1:						\ | |
| 80 | movhi r8, %hiadj(rtld_errno - 1b);		\ | |
| 81 | addi r8, r8, %lo(rtld_errno - 1b);		\ | |
| 82 | add r3, r3, r8;				\ | |
| 83 | stw r2, 0(r3);				\ | |
| 84 | movi r2, -1;					\ | |
| 85 | ret; | |
| 86 | ||
| 87 | # else | |
| 88 | ||
| 89 | # if IS_IN (libc) | |
| 90 | # define SYSCALL_ERROR_ERRNO __libc_errno | |
| 91 | # else | |
| 92 | # define SYSCALL_ERROR_ERRNO errno | |
| 93 | # endif | |
| 94 | # define SYSCALL_ERROR_HANDLER			\ | |
| 95 | SYSCALL_ERROR_LABEL:				\ | |
| 96 | nextpc r3;					\ | |
| 97 | 1:						\ | |
| 98 | movhi r8, %hiadj(_gp_got - 1b);		\ | |
| 99 | addi r8, r8, %lo(_gp_got - 1b);		\ | |
| 100 | add r3, r3, r8;				\ | |
| 101 | ldw r3, %tls_ie(SYSCALL_ERROR_ERRNO)(r3);	\ | |
| 102 | add r3, r23, r3;				\ | |
| 103 | stw r2, 0(r3);				\ | |
| 104 | movi r2, -1;					\ | |
| 105 | ret; | |
| 106 | ||
| 107 | # endif | |
| 108 | ||
| 109 | #else | |
| 110 | ||
| 111 | /* We can use a single error handler in the static library. */ | |
| 112 | #define SYSCALL_ERROR_HANDLER			\ | |
| 113 | SYSCALL_ERROR_LABEL:				\ | |
| 114 | jmpi __syscall_error; | |
| 115 | ||
| 116 | #endif | |
| 117 | ||
| 118 | #define DOARGS_0 /* nothing */ | |
| 119 | #define DOARGS_1 /* nothing */ | |
| 120 | #define DOARGS_2 /* nothing */ | |
| 121 | #define DOARGS_3 /* nothing */ | |
| 122 | #define DOARGS_4 /* nothing */ | |
| 123 | #define DOARGS_5 ldw r8, 0(sp); | |
| 124 | #define DOARGS_6 ldw r9, 4(sp); ldw r8, 0(sp); | |
| 125 | ||
| 126 | /* The function has to return the error code. */ | |
| 127 | #undef PSEUDO_ERRVAL | |
| 128 | #define PSEUDO_ERRVAL(name, syscall_name, args) \ | |
| 129 | ENTRY (name) \ | |
| 130 | DO_CALL (syscall_name, args) | |
| 131 | ||
| 132 | #undef PSEUDO_END_ERRVAL | |
| 133 | #define PSEUDO_END_ERRVAL(name) \ | |
| 134 | END (name) | |
| 135 | ||
| 136 | #define ret_ERRVAL ret | |
| 137 | ||
| 138 | #else /* __ASSEMBLER__ */ | |
| 139 | ||
| 140 | /* In order to get __set_errno() definition in INLINE_SYSCALL. */ | |
| 141 | #include <errno.h> | |
| 142 | ||
| 143 | #undef INTERNAL_SYSCALL_RAW | |
| 144 | #define INTERNAL_SYSCALL_RAW(name, nr, args...) \ | |
| 145 | ({ unsigned int _sys_result; \ | |
| 146 | { \ | |
| 147 | /* Load argument values in temporary variables | |
| 148 | 	 to perform side effects like function calls | |
| 149 | 	 before the call-used registers are set. */		\ | |
| 150 | LOAD_ARGS_##nr (args)					\ | |
| 151 | LOAD_REGS_##nr						\ | |
| 152 | register int _r2 asm ("r2") = (int)(name); \ | |
| 153 | register int _err asm ("r7"); \ | |
| 154 | asm volatile ("trap" \ | |
| 155 | : "+r" (_r2), "=r" (_err) \ | |
| 156 | : ASM_ARGS_##nr				\ | |
| 157 | : __SYSCALL_CLOBBERS); \ | |
| 158 | _sys_result = _err != 0 ? -_r2 : _r2; \ | |
| 159 | } \ | |
| 160 | (int) _sys_result; }) | |
| 161 | ||
| 162 | #undef INTERNAL_SYSCALL | |
| 163 | #define INTERNAL_SYSCALL(name, nr, args...) \ | |
| 164 | 	INTERNAL_SYSCALL_RAW(SYS_ify(name), nr, args) | |
| 165 | ||
| 166 | #undef INTERNAL_SYSCALL_NCS | |
| 167 | #define INTERNAL_SYSCALL_NCS(number, nr, args...) \ | |
| 168 | 	INTERNAL_SYSCALL_RAW(number, nr, args) | |
| 169 | ||
| 170 | #define LOAD_ARGS_0() | |
| 171 | #define LOAD_REGS_0 | |
| 172 | #define ASM_ARGS_0 | |
| 173 | #define LOAD_ARGS_1(a1)				\ | |
| 174 | LOAD_ARGS_0 ()				\ | |
| 175 | int __arg1 = (int) (a1); | |
| 176 | #define LOAD_REGS_1				\ | |
| 177 | register int _r4 asm ("r4") = __arg1;		\ | |
| 178 | LOAD_REGS_0 | |
| 179 | #define ASM_ARGS_1 "r" (_r4) | |
| 180 | #define LOAD_ARGS_2(a1, a2)			\ | |
| 181 | LOAD_ARGS_1 (a1)				\ | |
| 182 | int __arg2 = (int) (a2); | |
| 183 | #define LOAD_REGS_2				\ | |
| 184 | register int _r5 asm ("r5") = __arg2;		\ | |
| 185 | LOAD_REGS_1 | |
| 186 | #define ASM_ARGS_2 ASM_ARGS_1, "r" (_r5) | |
| 187 | #define LOAD_ARGS_3(a1, a2, a3)			\ | |
| 188 | LOAD_ARGS_2 (a1, a2)				\ | |
| 189 | int __arg3 = (int) (a3); | |
| 190 | #define LOAD_REGS_3				\ | |
| 191 | register int _r6 asm ("r6") = __arg3;		\ | |
| 192 | LOAD_REGS_2 | |
| 193 | #define ASM_ARGS_3 ASM_ARGS_2, "r" (_r6) | |
| 194 | #define LOAD_ARGS_4(a1, a2, a3, a4)		\ | |
| 195 | LOAD_ARGS_3 (a1, a2, a3)			\ | |
| 196 | int __arg4 = (int) (a4); | |
| 197 | #define LOAD_REGS_4				\ | |
| 198 | register int _r7 asm ("r7") = __arg4;		\ | |
| 199 | LOAD_REGS_3 | |
| 200 | #define ASM_ARGS_4 ASM_ARGS_3, "r" (_r7) | |
| 201 | #define LOAD_ARGS_5(a1, a2, a3, a4, a5)		\ | |
| 202 | LOAD_ARGS_4 (a1, a2, a3, a4)			\ | |
| 203 | int __arg5 = (int) (a5); | |
| 204 | #define LOAD_REGS_5				\ | |
| 205 | register int _r8 asm ("r8") = __arg5;		\ | |
| 206 | LOAD_REGS_4 | |
| 207 | #define ASM_ARGS_5 ASM_ARGS_4, "r" (_r8) | |
| 208 | #define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6)	\ | |
| 209 | LOAD_ARGS_5 (a1, a2, a3, a4, a5)		\ | |
| 210 | int __arg6 = (int) (a6); | |
| 211 | #define LOAD_REGS_6			 \ | |
| 212 | register int _r9 asm ("r9") = __arg6; \ | |
| 213 | LOAD_REGS_5 | |
| 214 | #define ASM_ARGS_6 ASM_ARGS_5, "r" (_r9) | |
| 215 | ||
| 216 | #define __SYSCALL_CLOBBERS "memory" | |
| 217 | ||
| 218 | #undef HAVE_INTERNAL_BRK_ADDR_SYMBOL | |
| 219 | #define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 | |
| 220 | ||
| 221 | #endif /* __ASSEMBLER__ */ | |
| 222 | ||
| 223 | /* Pointer mangling support. */ | |
| 224 | #if IS_IN (rtld) | |
| 225 | /* We cannot use the thread descriptor because in ld.so we use setjmp | |
| 226 | earlier than the descriptor is initialized. */ | |
| 227 | #else | |
| 228 | # ifdef __ASSEMBLER__ | |
| 229 | # define PTR_MANGLE_GUARD(guard) ldw guard, POINTER_GUARD(r23) | |
| 230 | # define PTR_MANGLE(dst, src, guard) xor dst, src, guard | |
| 231 | # define PTR_DEMANGLE(dst, src, guard) PTR_MANGLE (dst, src, guard) | |
| 232 | # else | |
| 233 | # define PTR_MANGLE(var) \ | |
| 234 | (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) | |
| 235 | # define PTR_DEMANGLE(var)	PTR_MANGLE (var) | |
| 236 | # endif | |
| 237 | #endif | |
| 238 | ||
| 239 | ||
| 240 | #endif /* linux/nios2/sysdep.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/bits/stat.h deleted-275| ... | ... | @@ -1,275 +0,0 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #if !defined _SYS_STAT_H && !defined _FCNTL_H | |
| 19 | # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #ifndef _BITS_STAT_H | |
| 23 | #define _BITS_STAT_H	1 | |
| 24 | ||
| 25 | #include <bits/wordsize.h> | |
| 26 | ||
| 27 | /* Versions of the `struct stat' data structure. */ | |
| 28 | #define _STAT_VER_LINUX_OLD	1 | |
| 29 | #define _STAT_VER_KERNEL	1 | |
| 30 | #define _STAT_VER_SVR4		2 | |
| 31 | #define _STAT_VER_LINUX	 3 | |
| 32 | #if __WORDSIZE == 32 | |
| 33 | # define _STAT_VER		_STAT_VER_LINUX | |
| 34 | #else | |
| 35 | # define _STAT_VER		_STAT_VER_KERNEL | |
| 36 | #endif | |
| 37 | ||
| 38 | /* Versions of the `xmknod' interface. */ | |
| 39 | #define _MKNOD_VER_LINUX	1 | |
| 40 | #define _MKNOD_VER_SVR4		2 | |
| 41 | #define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below. */ | |
| 42 | ||
| 43 | ||
| 44 | #if __WORDSIZE == 32 | |
| 45 | ||
| 46 | struct stat | |
| 47 | { | |
| 48 | __dev_t st_dev;			/* Device. */ | |
| 49 | # ifndef __USE_FILE_OFFSET64 | |
| 50 | unsigned short int __pad1; | |
| 51 | __ino_t st_ino;			/* File serial number.	*/ | |
| 52 | # else | |
| 53 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 54 | # endif | |
| 55 | __mode_t st_mode;			/* File mode. */ | |
| 56 | __nlink_t st_nlink;			/* Link count. */ | |
| 57 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 58 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 59 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 60 | unsigned short int __pad2; | |
| 61 | # ifndef __USE_FILE_OFFSET64 | |
| 62 | __off_t st_size;			/* Size of file, in bytes. */ | |
| 63 | # else | |
| 64 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 65 | # endif | |
| 66 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 67 | ||
| 68 | # ifndef __USE_FILE_OFFSET64 | |
| 69 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 70 | # else | |
| 71 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 72 | # endif | |
| 73 | # ifdef __USE_XOPEN2K8 | |
| 74 | /* Nanosecond resolution timestamps are stored in a format | |
| 75 | equivalent to 'struct timespec'. This is the type used | |
| 76 | whenever possible but the Unix namespace rules do not allow the | |
| 77 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 78 | Therefore we have to handle the use of this header in strictly | |
| 79 | standard-compliant sources special. */ | |
| 80 | struct timespec st_atim;		/* Time of last access. */ | |
| 81 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 82 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 83 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 84 | # define st_mtime st_mtim.tv_sec | |
| 85 | # define st_ctime st_ctim.tv_sec | |
| 86 | # else | |
| 87 | __time_t st_atime;			/* Time of last access. */ | |
| 88 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 89 | __time_t st_mtime;			/* Time of last modification. */ | |
| 90 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 91 | __time_t st_ctime;			/* Time of last status change. */ | |
| 92 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 93 | # endif | |
| 94 | unsigned long int __glibc_reserved4; | |
| 95 | unsigned long int __glibc_reserved5; | |
| 96 | }; | |
| 97 | ||
| 98 | ||
| 99 | # ifdef __USE_LARGEFILE64 | |
| 100 | struct stat64 | |
| 101 | { | |
| 102 | __dev_t st_dev;			/* Device. */ | |
| 103 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 104 | __mode_t st_mode;			/* File mode. */ | |
| 105 | __nlink_t st_nlink;			/* Link count. */ | |
| 106 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 107 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 108 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 109 | unsigned short int __pad2; | |
| 110 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 111 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 112 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 113 | # ifdef __USE_XOPEN2K8 | |
| 114 | /* Nanosecond resolution timestamps are stored in a format | |
| 115 | equivalent to 'struct timespec'. This is the type used | |
| 116 | whenever possible but the Unix namespace rules do not allow the | |
| 117 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 118 | Therefore we have to handle the use of this header in strictly | |
| 119 | standard-compliant sources special. */ | |
| 120 | struct timespec st_atim;		/* Time of last access. */ | |
| 121 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 122 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 123 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 124 | # define st_mtime st_mtim.tv_sec | |
| 125 | # define st_ctime st_ctim.tv_sec | |
| 126 | # else | |
| 127 | __time_t st_atime;			/* Time of last access. */ | |
| 128 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 129 | __time_t st_mtime;			/* Time of last modification. */ | |
| 130 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 131 | __time_t st_ctime;			/* Time of last status change. */ | |
| 132 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 133 | # endif | |
| 134 | unsigned long int __glibc_reserved4; | |
| 135 | unsigned long int __glibc_reserved5; | |
| 136 | }; | |
| 137 | # endif /* __USE_LARGEFILE64 */ | |
| 138 | ||
| 139 | #else /* __WORDSIZE == 32 */ | |
| 140 | ||
| 141 | struct stat | |
| 142 | { | |
| 143 | __dev_t st_dev;			/* Device. */ | |
| 144 | # ifndef __USE_FILE_OFFSET64 | |
| 145 | __ino_t st_ino;			/* File serial number.	*/ | |
| 146 | # else | |
| 147 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 148 | # endif | |
| 149 | __nlink_t st_nlink;			/* Link count. */ | |
| 150 | __mode_t st_mode;			/* File mode. */ | |
| 151 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 152 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 153 | int __pad2; | |
| 154 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 155 | # ifndef __USE_FILE_OFFSET64 | |
| 156 | __off_t st_size;			/* Size of file, in bytes. */ | |
| 157 | # else | |
| 158 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 159 | # endif | |
| 160 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 161 | ||
| 162 | # ifndef __USE_FILE_OFFSET64 | |
| 163 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 164 | # else | |
| 165 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 166 | # endif | |
| 167 | # ifdef __USE_XOPEN2K8 | |
| 168 | /* Nanosecond resolution timestamps are stored in a format | |
| 169 | equivalent to 'struct timespec'. This is the type used | |
| 170 | whenever possible but the Unix namespace rules do not allow the | |
| 171 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 172 | Therefore we have to handle the use of this header in strictly | |
| 173 | standard-compliant sources special. */ | |
| 174 | struct timespec st_atim;		/* Time of last access. */ | |
| 175 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 176 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 177 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 178 | # define st_mtime st_mtim.tv_sec | |
| 179 | # define st_ctime st_ctim.tv_sec | |
| 180 | # else | |
| 181 | __time_t st_atime;			/* Time of last access. */ | |
| 182 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 183 | __time_t st_mtime;			/* Time of last modification. */ | |
| 184 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 185 | __time_t st_ctime;			/* Time of last status change. */ | |
| 186 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 187 | # endif | |
| 188 | unsigned long int __glibc_reserved4; | |
| 189 | unsigned long int __glibc_reserved5; | |
| 190 | unsigned long int __glibc_reserved6; | |
| 191 | }; | |
| 192 | ||
| 193 | # ifdef __USE_LARGEFILE64 | |
| 194 | struct stat64 | |
| 195 | { | |
| 196 | __dev_t st_dev;			/* Device. */ | |
| 197 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 198 | __nlink_t st_nlink;			/* Link count. */ | |
| 199 | __mode_t st_mode;			/* File mode. */ | |
| 200 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 201 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 202 | int __pad2; | |
| 203 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 204 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 205 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 206 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 207 | # ifdef __USE_XOPEN2K8 | |
| 208 | /* Nanosecond resolution timestamps are stored in a format | |
| 209 | equivalent to 'struct timespec'. This is the type used | |
| 210 | whenever possible but the Unix namespace rules do not allow the | |
| 211 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 212 | Therefore we have to handle the use of this header in strictly | |
| 213 | standard-compliant sources special. */ | |
| 214 | struct timespec st_atim;		/* Time of last access. */ | |
| 215 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 216 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 217 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 218 | # define st_mtime st_mtim.tv_sec | |
| 219 | # define st_ctime st_ctim.tv_sec | |
| 220 | # else | |
| 221 | __time_t st_atime;			/* Time of last access. */ | |
| 222 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 223 | __time_t st_mtime;			/* Time of last modification. */ | |
| 224 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 225 | __time_t st_ctime;			/* Time of last status change. */ | |
| 226 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 227 | # endif | |
| 228 | unsigned long int __glibc_reserved4; | |
| 229 | unsigned long int __glibc_reserved5; | |
| 230 | unsigned long int __glibc_reserved6; | |
| 231 | }; | |
| 232 | # endif /* __USE_LARGEFILE64 */ | |
| 233 | #endif | |
| 234 | ||
| 235 | ||
| 236 | /* Tell code we have these members. */ | |
| 237 | #define	_STATBUF_ST_BLKSIZE | |
| 238 | #define _STATBUF_ST_RDEV | |
| 239 | /* Nanosecond resolution time values are supported. */ | |
| 240 | #define _STATBUF_ST_NSEC | |
| 241 | ||
| 242 | /* Encoding of the file mode. */ | |
| 243 | ||
| 244 | #define	__S_IFMT	0170000	/* These bits determine file type. */ | |
| 245 | ||
| 246 | /* File types. */ | |
| 247 | #define	__S_IFDIR	0040000	/* Directory. */ | |
| 248 | #define	__S_IFCHR	0020000	/* Character device. */ | |
| 249 | #define	__S_IFBLK	0060000	/* Block device. */ | |
| 250 | #define	__S_IFREG	0100000	/* Regular file. */ | |
| 251 | #define	__S_IFIFO	0010000	/* FIFO. */ | |
| 252 | #define	__S_IFLNK	0120000	/* Symbolic link. */ | |
| 253 | #define	__S_IFSOCK	0140000	/* Socket. */ | |
| 254 | ||
| 255 | /* POSIX.1b objects. Note that these macros always evaluate to zero. But | |
| 256 | they do it by enforcing the correct use of the macros. */ | |
| 257 | #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 258 | #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 259 | #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 260 | ||
| 261 | /* Protection bits. */ | |
| 262 | ||
| 263 | #define	__S_ISUID	04000	/* Set user ID on execution. */ | |
| 264 | #define	__S_ISGID	02000	/* Set group ID on execution. */ | |
| 265 | #define	__S_ISVTX	01000	/* Save swapped text after use (sticky). */ | |
| 266 | #define	__S_IREAD	0400	/* Read by owner. */ | |
| 267 | #define	__S_IWRITE	0200	/* Write by owner. */ | |
| 268 | #define	__S_IEXEC	0100	/* Execute by owner. */ | |
| 269 | ||
| 270 | #ifdef __USE_ATFILE | |
| 271 | # define UTIME_NOW	((1l << 30) - 1l) | |
| 272 | # define UTIME_OMIT	((1l << 30) - 2l) | |
| 273 | #endif | |
| 274 | ||
| 275 | #endif	/* bits/stat.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/kernel-features.h+1-3| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. PowerPC version. |
| 3 | Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -28,8 +28,6 @@ |
| 28 | 28 | #define __ASSUME_SEND_SYSCALL		1 |
| 29 | 29 | #define __ASSUME_RECV_SYSCALL		1 |
| 30 | 30 | #define __ASSUME_SHUTDOWN_SYSCALL	1 |
| 31 | #define __ASSUME_GETSOCKOPT_SYSCALL	1 | |
| 32 | #define __ASSUME_SETSOCKOPT_SYSCALL	1 | |
| 33 | 31 | |
| 34 | 32 | /* Define this if your 32-bit syscall API requires 64-bit register |
| 35 | 33 | pairs to start with an even-number register. */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h created+53| ... | ... | @@ -0,0 +1,53 @@ |
| 1 | /* Definition of `struct stat' used in the kernel. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | struct kernel_stat | |
| 20 | { | |
| 21 | unsigned int st_dev; | |
| 22 | unsigned int st_ino; | |
| 23 | unsigned int st_mode; | |
| 24 | unsigned short st_nlink; | |
| 25 | unsigned int st_uid; | |
| 26 | unsigned int st_gid; | |
| 27 | unsigned int st_rdev; | |
| 28 | unsigned long int st_size; | |
| 29 | unsigned long int st_blksize; | |
| 30 | unsigned long int st_blocks; | |
| 31 | struct timespec st_atim; | |
| 32 | struct timespec st_mtim; | |
| 33 | struct timespec st_ctim; | |
| 34 | unsigned long int __glibc_reserved4; | |
| 35 | #define _HAVE___UNUSED4 | |
| 36 | unsigned long int __glibc_reserved5; | |
| 37 | #define _HAVE___UNUSED5 | |
| 38 | }; | |
| 39 | ||
| 40 | #define _HAVE_STAT___UNUSED4 | |
| 41 | #define _HAVE_STAT___UNUSED5 | |
| 42 | #define _HAVE_STAT___PAD1 | |
| 43 | #define _HAVE_STAT___PAD2 | |
| 44 | #define _HAVE_STAT_NSEC | |
| 45 | #define _HAVE_STAT64___UNUSED4 | |
| 46 | #define _HAVE_STAT64___UNUSED5 | |
| 47 | #define _HAVE_STAT64___PAD2 | |
| 48 | #define _HAVE_STAT64_NSEC | |
| 49 | ||
| 50 | #define STAT_IS_KERNEL_STAT 0 | |
| 51 | #define STAT64_IS_KERNEL_STAT64 1 | |
| 52 | #define XSTAT_IS_XSTAT64 0 | |
| 53 | #define STATFS_IS_STATFS64 0 |
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h deleted-214| ... | ... | @@ -1,214 +0,0 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _LINUX_POWERPC_SYSDEP_H | |
| 19 | #define _LINUX_POWERPC_SYSDEP_H 1 | |
| 20 | ||
| 21 | #include <sysdeps/unix/sysv/linux/powerpc/sysdep.h> | |
| 22 | #include <sysdeps/unix/sysv/linux/sysdep.h> | |
| 23 | #include <sysdeps/unix/powerpc/sysdep.h> | |
| 24 | #include <tls.h> | |
| 25 | ||
| 26 | /* For Linux we can use the system call table in the header file | |
| 27 | 	/usr/include/asm/unistd.h | |
| 28 | of the kernel. But these symbols do not follow the SYS_* syntax | |
| 29 | so we have to redefine the `SYS_ify' macro here. */ | |
| 30 | #undef SYS_ify | |
| 31 | #define SYS_ify(syscall_name)	__NR_##syscall_name | |
| 32 | ||
| 33 | #ifndef __ASSEMBLER__ | |
| 34 | ||
| 35 | # include <errno.h> | |
| 36 | ||
| 37 | /* Define a macro which expands inline into the wrapper code for a VDSO | |
| 38 | call. This use is for internal calls that do not need to handle errors | |
| 39 | normally. It will never touch errno. | |
| 40 | On powerpc a system call basically clobbers the same registers like a | |
| 41 | function call, with the exception of LR (which is needed for the | |
| 42 | "sc; bnslr+" sequence) and CR (where only CR0.SO is clobbered to signal | |
| 43 | an error return status). */ | |
| 44 | # define INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, type, nr, args...)	 \ | |
| 45 | ({									 \ | |
| 46 | register void *r0 __asm__ ("r0");					 \ | |
| 47 | register long int r3 __asm__ ("r3");				 \ | |
| 48 | register long int r4 __asm__ ("r4");				 \ | |
| 49 | register long int r5 __asm__ ("r5");				 \ | |
| 50 | register long int r6 __asm__ ("r6");				 \ | |
| 51 | register long int r7 __asm__ ("r7");				 \ | |
| 52 | register long int r8 __asm__ ("r8");				 \ | |
| 53 | register long int r9 __asm__ ("r9");				 \ | |
| 54 | register long int r10 __asm__ ("r10");				 \ | |
| 55 | register long int r11 __asm__ ("r11");				 \ | |
| 56 | register long int r12 __asm__ ("r12");				 \ | |
| 57 | register type rval __asm__ ("r3");					 \ | |
| 58 | LOADARGS_##nr (funcptr, args);					 \ | |
| 59 | __asm__ __volatile__						 \ | |
| 60 | ("mtctr %0\n\t"							 \ | |
| 61 | "bctrl\n\t"							 \ | |
| 62 | "mfcr %0"							 \ | |
| 63 | : "+r" (r0), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7), \ | |
| 64 | 	 "+r" (r8), "+r" (r9), "+r" (r10), "+r" (r11), "+r" (r12)	 \ | |
| 65 | : : "cr0", "ctr", "lr", "memory");				 \ | |
| 66 | err = (long int) r0;						 \ | |
| 67 | __asm__ __volatile__ ("" : "=r" (rval) : "r" (r3), "r" (r4));	 \ | |
| 68 | rval;								 \ | |
| 69 | }) | |
| 70 | ||
| 71 | #define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ | |
| 72 | INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, long int, nr, args) | |
| 73 | ||
| 74 | # undef INLINE_SYSCALL | |
| 75 | # define INLINE_SYSCALL(name, nr, args...)				\ | |
| 76 | ({									\ | |
| 77 | INTERNAL_SYSCALL_DECL (sc_err);					\ | |
| 78 | long int sc_ret = INTERNAL_SYSCALL (name, sc_err, nr, args);	\ | |
| 79 | if (INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err))			\ | |
| 80 | {									\ | |
| 81 | 	__set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err));		\ | |
| 82 | 	sc_ret = -1L;							\ | |
| 83 | }									\ | |
| 84 | sc_ret;								\ | |
| 85 | }) | |
| 86 | ||
| 87 | /* Define a macro which expands inline into the wrapper code for a system | |
| 88 | call. This use is for internal calls that do not need to handle errors | |
| 89 | normally. It will never touch errno. | |
| 90 | On powerpc a system call basically clobbers the same registers like a | |
| 91 | function call, with the exception of LR (which is needed for the | |
| 92 | "sc; bnslr+" sequence) and CR (where only CR0.SO is clobbered to signal | |
| 93 | an error return status). */ | |
| 94 | ||
| 95 | # undef INTERNAL_SYSCALL_DECL | |
| 96 | # define INTERNAL_SYSCALL_DECL(err) long int err __attribute__ ((unused)) | |
| 97 | ||
| 98 | # undef INTERNAL_SYSCALL | |
| 99 | # define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			\ | |
| 100 | ({									\ | |
| 101 | register long int r0 __asm__ ("r0");				\ | |
| 102 | register long int r3 __asm__ ("r3");				\ | |
| 103 | register long int r4 __asm__ ("r4");				\ | |
| 104 | register long int r5 __asm__ ("r5");				\ | |
| 105 | register long int r6 __asm__ ("r6");				\ | |
| 106 | register long int r7 __asm__ ("r7");				\ | |
| 107 | register long int r8 __asm__ ("r8");				\ | |
| 108 | register long int r9 __asm__ ("r9");				\ | |
| 109 | register long int r10 __asm__ ("r10");				\ | |
| 110 | register long int r11 __asm__ ("r11");				\ | |
| 111 | register long int r12 __asm__ ("r12");				\ | |
| 112 | LOADARGS_##nr(name, args);						\ | |
| 113 | __asm__ __volatile__						\ | |
| 114 | ("sc \n\t"							\ | |
| 115 | "mfcr %0"							\ | |
| 116 | : "=&r" (r0),							\ | |
| 117 | 	 "=&r" (r3), "=&r" (r4), "=&r" (r5), "=&r" (r6), "=&r" (r7),	\ | |
| 118 | 	 "=&r" (r8), "=&r" (r9), "=&r" (r10), "=&r" (r11), "=&r" (r12)	\ | |
| 119 | : ASM_INPUT_##nr							\ | |
| 120 | : "cr0", "ctr", "memory");					\ | |
| 121 | err = r0;								\ | |
| 122 | (int) r3;								\ | |
| 123 | }) | |
| 124 | # define INTERNAL_SYSCALL(name, err, nr, args...) \ | |
| 125 | INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) | |
| 126 | ||
| 127 | # undef INTERNAL_SYSCALL_ERROR_P | |
| 128 | # define INTERNAL_SYSCALL_ERROR_P(val, err) \ | |
| 129 | ((void) (val), __builtin_expect ((err) & (1 << 28), 0)) | |
| 130 | ||
| 131 | # undef INTERNAL_SYSCALL_ERRNO | |
| 132 | # define INTERNAL_SYSCALL_ERRNO(val, err) (val) | |
| 133 | ||
| 134 | # define LOADARGS_0(name, dummy)					 \ | |
| 135 | 	r0 = name | |
| 136 | # define LOADARGS_1(name, __arg1) \ | |
| 137 | 	long int arg1 = (long int) (__arg1);	\ | |
| 138 | LOADARGS_0(name, 0);					 \ | |
| 139 | 	extern void __illegally_sized_syscall_arg1 (void); \ | |
| 140 | 	if (__builtin_classify_type (__arg1) != 5 && sizeof (__arg1) > 4) \ | |
| 141 | 	 __illegally_sized_syscall_arg1 (); \ | |
| 142 | 	r3 = arg1 | |
| 143 | # define LOADARGS_2(name, __arg1, __arg2) \ | |
| 144 | 	long int arg2 = (long int) (__arg2); \ | |
| 145 | 	LOADARGS_1(name, __arg1); \ | |
| 146 | 	extern void __illegally_sized_syscall_arg2 (void); \ | |
| 147 | 	if (__builtin_classify_type (__arg2) != 5 && sizeof (__arg2) > 4) \ | |
| 148 | 	 __illegally_sized_syscall_arg2 (); \ | |
| 149 | 	r4 = arg2 | |
| 150 | # define LOADARGS_3(name, __arg1, __arg2, __arg3) \ | |
| 151 | 	long int arg3 = (long int) (__arg3); \ | |
| 152 | 	LOADARGS_2(name, __arg1, __arg2); \ | |
| 153 | 	extern void __illegally_sized_syscall_arg3 (void); \ | |
| 154 | 	if (__builtin_classify_type (__arg3) != 5 && sizeof (__arg3) > 4) \ | |
| 155 | 	 __illegally_sized_syscall_arg3 (); \ | |
| 156 | 	r5 = arg3 | |
| 157 | # define LOADARGS_4(name, __arg1, __arg2, __arg3, __arg4) \ | |
| 158 | 	long int arg4 = (long int) (__arg4); \ | |
| 159 | 	LOADARGS_3(name, __arg1, __arg2, __arg3); \ | |
| 160 | 	extern void __illegally_sized_syscall_arg4 (void); \ | |
| 161 | 	if (__builtin_classify_type (__arg4) != 5 && sizeof (__arg4) > 4) \ | |
| 162 | 	 __illegally_sized_syscall_arg4 (); \ | |
| 163 | 	r6 = arg4 | |
| 164 | # define LOADARGS_5(name, __arg1, __arg2, __arg3, __arg4, __arg5) \ | |
| 165 | 	long int arg5 = (long int) (__arg5); \ | |
| 166 | 	LOADARGS_4(name, __arg1, __arg2, __arg3, __arg4); \ | |
| 167 | 	extern void __illegally_sized_syscall_arg5 (void); \ | |
| 168 | 	if (__builtin_classify_type (__arg5) != 5 && sizeof (__arg5) > 4) \ | |
| 169 | 	 __illegally_sized_syscall_arg5 (); \ | |
| 170 | 	r7 = arg5 | |
| 171 | # define LOADARGS_6(name, __arg1, __arg2, __arg3, __arg4, __arg5, __arg6) \ | |
| 172 | 	long int arg6 = (long int) (__arg6); \ | |
| 173 | 	LOADARGS_5(name, __arg1, __arg2, __arg3, __arg4, __arg5); \ | |
| 174 | 	extern void __illegally_sized_syscall_arg6 (void); \ | |
| 175 | 	if (__builtin_classify_type (__arg6) != 5 && sizeof (__arg6) > 4) \ | |
| 176 | 	 __illegally_sized_syscall_arg6 (); \ | |
| 177 | 	r8 = arg6 | |
| 178 | ||
| 179 | # define ASM_INPUT_0 "0" (r0) | |
| 180 | # define ASM_INPUT_1 ASM_INPUT_0, "1" (r3) | |
| 181 | # define ASM_INPUT_2 ASM_INPUT_1, "2" (r4) | |
| 182 | # define ASM_INPUT_3 ASM_INPUT_2, "3" (r5) | |
| 183 | # define ASM_INPUT_4 ASM_INPUT_3, "4" (r6) | |
| 184 | # define ASM_INPUT_5 ASM_INPUT_4, "5" (r7) | |
| 185 | # define ASM_INPUT_6 ASM_INPUT_5, "6" (r8) | |
| 186 | ||
| 187 | #endif /* __ASSEMBLER__ */ | |
| 188 | ||
| 189 | ||
| 190 | /* Pointer mangling support. */ | |
| 191 | #if IS_IN (rtld) | |
| 192 | /* We cannot use the thread descriptor because in ld.so we use setjmp | |
| 193 | earlier than the descriptor is initialized. */ | |
| 194 | #else | |
| 195 | # ifdef __ASSEMBLER__ | |
| 196 | # define PTR_MANGLE(reg, tmpreg) \ | |
| 197 | 	lwz	tmpreg,POINTER_GUARD(r2); \ | |
| 198 | 	xor	reg,tmpreg,reg | |
| 199 | # define PTR_MANGLE2(reg, tmpreg) \ | |
| 200 | 	xor	reg,tmpreg,reg | |
| 201 | # define PTR_MANGLE3(destreg, reg, tmpreg) \ | |
| 202 | 	lwz	tmpreg,POINTER_GUARD(r2); \ | |
| 203 | 	xor	destreg,tmpreg,reg | |
| 204 | # define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) | |
| 205 | # define PTR_DEMANGLE2(reg, tmpreg) PTR_MANGLE2 (reg, tmpreg) | |
| 206 | # define PTR_DEMANGLE3(destreg, reg, tmpreg) PTR_MANGLE3 (destreg, reg, tmpreg) | |
| 207 | # else | |
| 208 | # define PTR_MANGLE(var) \ | |
| 209 | (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) | |
| 210 | # define PTR_DEMANGLE(var)	PTR_MANGLE (var) | |
| 211 | # endif | |
| 212 | #endif | |
| 213 | ||
| 214 | #endif /* linux/powerpc/powerpc32/sysdep.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h+3-195| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -17,202 +17,10 @@ |
| 17 | 17 | |
| 18 | 18 | /* Alan Modra <amodra@bigpond.net.au> rewrote the INLINE_SYSCALL macro */ |
| 19 | 19 | |
| 20 | #ifndef _LINUX_POWERPC_SYSDEP_H | |
| 21 | #define _LINUX_POWERPC_SYSDEP_H 1 | |
| 20 | #ifndef _LINUX_POWERPC64_SYSDEP_H | |
| 21 | #define _LINUX_POWERPC64_SYSDEP_H 1 | |
| 22 | 22 | |
| 23 | 23 | #include <sysdeps/unix/sysv/linux/powerpc/sysdep.h> |
| 24 | #include <sysdeps/unix/sysv/linux/sysdep.h> | |
| 25 | #include <sysdeps/unix/powerpc/sysdep.h> | |
| 26 | #include <tls.h> | |
| 27 | ||
| 28 | /* Define __set_errno() for INLINE_SYSCALL macro below. */ | |
| 29 | #ifndef __ASSEMBLER__ | |
| 30 | #include <errno.h> | |
| 31 | #endif | |
| 32 | ||
| 33 | /* For Linux we can use the system call table in the header file | |
| 34 | 	/usr/include/asm/unistd.h | |
| 35 | of the kernel. But these symbols do not follow the SYS_* syntax | |
| 36 | so we have to redefine the `SYS_ify' macro here. */ | |
| 37 | #undef SYS_ify | |
| 38 | #define SYS_ify(syscall_name)	__NR_##syscall_name | |
| 39 | ||
| 40 | #ifdef __ASSEMBLER__ | |
| 41 | ||
| 42 | /* This seems to always be the case on PPC. */ | |
| 43 | # define ALIGNARG(log2) log2 | |
| 44 | # define ASM_SIZE_DIRECTIVE(name) .size name,.-name | |
| 45 | ||
| 46 | #endif /* __ASSEMBLER__ */ | |
| 47 | ||
| 48 | /* Define a macro which expands inline into the wrapper code for a system | |
| 49 | call. This use is for internal calls that do not need to handle errors | |
| 50 | normally. It will never touch errno. This returns just what the kernel | |
| 51 | gave back in the non-error (CR0.SO cleared) case, otherwise (CR0.SO set) | |
| 52 | the negation of the return value in the kernel gets reverted. */ | |
| 53 | ||
| 54 | #define INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, type, nr, args...) \ | |
| 55 | ({									\ | |
| 56 | register void *r0 __asm__ ("r0");					\ | |
| 57 | register long int r3 __asm__ ("r3");				\ | |
| 58 | register long int r4 __asm__ ("r4");				\ | |
| 59 | register long int r5 __asm__ ("r5");				\ | |
| 60 | register long int r6 __asm__ ("r6");				\ | |
| 61 | register long int r7 __asm__ ("r7");				\ | |
| 62 | register long int r8 __asm__ ("r8");				\ | |
| 63 | register type rval __asm__ ("r3");				 \ | |
| 64 | LOADARGS_##nr (funcptr, args);					\ | |
| 65 | __asm__ __volatile__						\ | |
| 66 | ("mtctr %0\n\t"							\ | |
| 67 | "bctrl\n\t"							\ | |
| 68 | "mfcr %0\n\t"							\ | |
| 69 | "0:"								\ | |
| 70 | : "+r" (r0), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), \ | |
| 71 | "+r" (r7), "+r" (r8)						\ | |
| 72 | : : "r9", "r10", "r11", "r12", "cr0", "ctr", "lr", "memory");	\ | |
| 73 | err = (long int) r0;						\ | |
| 74 | __asm__ __volatile__ ("" : "=r" (rval) : "r" (r3));		 \ | |
| 75 | rval;								\ | |
| 76 | }) | |
| 77 | ||
| 78 | #define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...)		\ | |
| 79 | INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, long int, nr, args) | |
| 80 | ||
| 81 | /* This version is for kernels that implement system calls that | |
| 82 | behave like function calls as far as register saving. */ | |
| 83 | #undef INLINE_SYSCALL | |
| 84 | #define INLINE_SYSCALL(name, nr, args...)				\ | |
| 85 | ({									\ | |
| 86 | INTERNAL_SYSCALL_DECL (sc_err);					\ | |
| 87 | long int sc_ret = INTERNAL_SYSCALL (name, sc_err, nr, args);	\ | |
| 88 | if (INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err))			\ | |
| 89 | {									\ | |
| 90 | __set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err));		\ | |
| 91 | sc_ret = -1L;							\ | |
| 92 | }									\ | |
| 93 | sc_ret;								\ | |
| 94 | }) | |
| 95 | ||
| 96 | /* Define a macro which expands inline into the wrapper code for a system | |
| 97 | call. This use is for internal calls that do not need to handle errors | |
| 98 | normally. It will never touch errno. This returns just what the kernel | |
| 99 | gave back in the non-error (CR0.SO cleared) case, otherwise (CR0.SO set) | |
| 100 | the negation of the return value in the kernel gets reverted. */ | |
| 101 | ||
| 102 | #undef INTERNAL_SYSCALL | |
| 103 | #define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ | |
| 104 | ({									\ | |
| 105 | register long int r0 __asm__ ("r0");				\ | |
| 106 | register long int r3 __asm__ ("r3");				\ | |
| 107 | register long int r4 __asm__ ("r4");				\ | |
| 108 | register long int r5 __asm__ ("r5");				\ | |
| 109 | register long int r6 __asm__ ("r6");				\ | |
| 110 | register long int r7 __asm__ ("r7");				\ | |
| 111 | register long int r8 __asm__ ("r8");				\ | |
| 112 | LOADARGS_##nr (name, ##args);					\ | |
| 113 | __asm__ __volatile__						\ | |
| 114 | ("sc\n\t"								\ | |
| 115 | "mfcr %0\n\t"							\ | |
| 116 | "0:"								\ | |
| 117 | : "=&r" (r0),							\ | |
| 118 | "=&r" (r3), "=&r" (r4), "=&r" (r5),				\ | |
| 119 | "=&r" (r6), "=&r" (r7), "=&r" (r8)				\ | |
| 120 | : ASM_INPUT_##nr							\ | |
| 121 | : "r9", "r10", "r11", "r12",					\ | |
| 122 | "cr0", "ctr", "memory");					\ | |
| 123 | 	 err = r0; \ | |
| 124 | r3; \ | |
| 125 | }) | |
| 126 | #define INTERNAL_SYSCALL(name, err, nr, args...)			\ | |
| 127 | INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, args) | |
| 128 | ||
| 129 | #undef INTERNAL_SYSCALL_DECL | |
| 130 | #define INTERNAL_SYSCALL_DECL(err) long int err __attribute__ ((unused)) | |
| 131 | ||
| 132 | #undef INTERNAL_SYSCALL_ERROR_P | |
| 133 | #define INTERNAL_SYSCALL_ERROR_P(val, err) \ | |
| 134 | ((void) (val), __builtin_expect ((err) & (1 << 28), 0)) | |
| 135 | ||
| 136 | #undef INTERNAL_SYSCALL_ERRNO | |
| 137 | #define INTERNAL_SYSCALL_ERRNO(val, err) (val) | |
| 138 | ||
| 139 | #define LOADARGS_0(name, dummy) \ | |
| 140 | 	r0 = name | |
| 141 | #define LOADARGS_1(name, __arg1) \ | |
| 142 | 	long int arg1 = (long int) (__arg1); \ | |
| 143 | 	LOADARGS_0(name, 0); \ | |
| 144 | 	extern void __illegally_sized_syscall_arg1 (void); \ | |
| 145 | 	if (__builtin_classify_type (__arg1) != 5 && sizeof (__arg1) > 8) \ | |
| 146 | 	 __illegally_sized_syscall_arg1 (); \ | |
| 147 | 	r3 = arg1 | |
| 148 | #define LOADARGS_2(name, __arg1, __arg2) \ | |
| 149 | 	long int arg2 = (long int) (__arg2); \ | |
| 150 | 	LOADARGS_1(name, __arg1); \ | |
| 151 | 	extern void __illegally_sized_syscall_arg2 (void); \ | |
| 152 | 	if (__builtin_classify_type (__arg2) != 5 && sizeof (__arg2) > 8) \ | |
| 153 | 	 __illegally_sized_syscall_arg2 (); \ | |
| 154 | 	r4 = arg2 | |
| 155 | #define LOADARGS_3(name, __arg1, __arg2, __arg3) \ | |
| 156 | 	long int arg3 = (long int) (__arg3); \ | |
| 157 | 	LOADARGS_2(name, __arg1, __arg2); \ | |
| 158 | 	extern void __illegally_sized_syscall_arg3 (void); \ | |
| 159 | 	if (__builtin_classify_type (__arg3) != 5 && sizeof (__arg3) > 8) \ | |
| 160 | 	 __illegally_sized_syscall_arg3 (); \ | |
| 161 | 	r5 = arg3 | |
| 162 | #define LOADARGS_4(name, __arg1, __arg2, __arg3, __arg4) \ | |
| 163 | 	long int arg4 = (long int) (__arg4); \ | |
| 164 | 	LOADARGS_3(name, __arg1, __arg2, __arg3); \ | |
| 165 | 	extern void __illegally_sized_syscall_arg4 (void); \ | |
| 166 | 	if (__builtin_classify_type (__arg4) != 5 && sizeof (__arg4) > 8) \ | |
| 167 | 	 __illegally_sized_syscall_arg4 (); \ | |
| 168 | 	r6 = arg4 | |
| 169 | #define LOADARGS_5(name, __arg1, __arg2, __arg3, __arg4, __arg5) \ | |
| 170 | 	long int arg5 = (long int) (__arg5); \ | |
| 171 | 	LOADARGS_4(name, __arg1, __arg2, __arg3, __arg4); \ | |
| 172 | 	extern void __illegally_sized_syscall_arg5 (void); \ | |
| 173 | 	if (__builtin_classify_type (__arg5) != 5 && sizeof (__arg5) > 8) \ | |
| 174 | 	 __illegally_sized_syscall_arg5 (); \ | |
| 175 | 	r7 = arg5 | |
| 176 | #define LOADARGS_6(name, __arg1, __arg2, __arg3, __arg4, __arg5, __arg6) \ | |
| 177 | 	long int arg6 = (long int) (__arg6); \ | |
| 178 | 	LOADARGS_5(name, __arg1, __arg2, __arg3, __arg4, __arg5); \ | |
| 179 | 	extern void __illegally_sized_syscall_arg6 (void); \ | |
| 180 | 	if (__builtin_classify_type (__arg6) != 5 && sizeof (__arg6) > 8) \ | |
| 181 | 	 __illegally_sized_syscall_arg6 (); \ | |
| 182 | 	r8 = arg6 | |
| 183 | ||
| 184 | #define ASM_INPUT_0 "0" (r0) | |
| 185 | #define ASM_INPUT_1 ASM_INPUT_0, "1" (r3) | |
| 186 | #define ASM_INPUT_2 ASM_INPUT_1, "2" (r4) | |
| 187 | #define ASM_INPUT_3 ASM_INPUT_2, "3" (r5) | |
| 188 | #define ASM_INPUT_4 ASM_INPUT_3, "4" (r6) | |
| 189 | #define ASM_INPUT_5 ASM_INPUT_4, "5" (r7) | |
| 190 | #define ASM_INPUT_6 ASM_INPUT_5, "6" (r8) | |
| 191 | ||
| 192 | ||
| 193 | /* Pointer mangling support. */ | |
| 194 | #if IS_IN (rtld) | |
| 195 | /* We cannot use the thread descriptor because in ld.so we use setjmp | |
| 196 | earlier than the descriptor is initialized. */ | |
| 197 | #else | |
| 198 | # ifdef __ASSEMBLER__ | |
| 199 | # define PTR_MANGLE(reg, tmpreg) \ | |
| 200 | 	ld	tmpreg,POINTER_GUARD(r13); \ | |
| 201 | 	xor	reg,tmpreg,reg | |
| 202 | # define PTR_MANGLE2(reg, tmpreg) \ | |
| 203 | 	xor	reg,tmpreg,reg | |
| 204 | # define PTR_MANGLE3(destreg, reg, tmpreg) \ | |
| 205 | 	ld	tmpreg,POINTER_GUARD(r13); \ | |
| 206 | 	xor	destreg,tmpreg,reg | |
| 207 | # define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) | |
| 208 | # define PTR_DEMANGLE2(reg, tmpreg) PTR_MANGLE2 (reg, tmpreg) | |
| 209 | # define PTR_DEMANGLE3(destreg, reg, tmpreg) PTR_MANGLE3 (destreg, reg, tmpreg) | |
| 210 | # else | |
| 211 | # define PTR_MANGLE(var) \ | |
| 212 | (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) | |
| 213 | # define PTR_DEMANGLE(var)	PTR_MANGLE (var) | |
| 214 | # endif | |
| 215 | #endif | |
| 216 | 24 | |
| 217 | 25 | /* In the PowerPC64 ABI, the unadorned F_GETLK* opcodes should be used |
| 218 | 26 | even by largefile64 code. */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/sysdep.h created+265| ... | ... | @@ -0,0 +1,265 @@ |
| 1 | /* Syscall definitions, Linux PowerPC generic version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _LINUX_POWERPC_SYSDEP_H | |
| 20 | #define _LINUX_POWERPC_SYSDEP_H 1 | |
| 21 | ||
| 22 | #include <sysdeps/unix/sysv/linux/sysdep.h> | |
| 23 | #include <sysdeps/unix/powerpc/sysdep.h> | |
| 24 | #include <tls.h> | |
| 25 | /* Define __set_errno() for INLINE_SYSCALL macro below. */ | |
| 26 | #include <errno.h> | |
| 27 | ||
| 28 | /* For Linux we can use the system call table in the header file | |
| 29 | /usr/include/asm/unistd.h | |
| 30 | of the kernel. But these symbols do not follow the SYS_* syntax | |
| 31 | so we have to redefine the `SYS_ify' macro here. */ | |
| 32 | #undef SYS_ify | |
| 33 | #define SYS_ify(syscall_name) __NR_##syscall_name | |
| 34 | ||
| 35 | /* Define a macro which expands inline into the wrapper code for a system | |
| 36 | call. This use is for internal calls that do not need to handle errors | |
| 37 | normally. It will never touch errno. This returns just what the kernel | |
| 38 | gave back in the non-error (CR0.SO cleared) case, otherwise (CR0.SO set) | |
| 39 | the negation of the return value in the kernel gets reverted. */ | |
| 40 | ||
| 41 | #define INTERNAL_VSYSCALL_CALL_TYPE(funcptr, type, nr, args...) \ | |
| 42 | ({									\ | |
| 43 | register void *r0 __asm__ ("r0");					\ | |
| 44 | register long int r3 __asm__ ("r3");				\ | |
| 45 | register long int r4 __asm__ ("r4");				\ | |
| 46 | register long int r5 __asm__ ("r5");				\ | |
| 47 | register long int r6 __asm__ ("r6");				\ | |
| 48 | register long int r7 __asm__ ("r7");				\ | |
| 49 | register long int r8 __asm__ ("r8");				\ | |
| 50 | register type rval __asm__ ("r3");				 \ | |
| 51 | LOADARGS_##nr (funcptr, args);					\ | |
| 52 | __asm__ __volatile__						\ | |
| 53 | ("mtctr %0\n\t"							\ | |
| 54 | "bctrl\n\t"							\ | |
| 55 | "mfcr %0\n\t"							\ | |
| 56 | "0:"								\ | |
| 57 | : "+r" (r0), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), \ | |
| 58 | "+r" (r7), "+r" (r8)						\ | |
| 59 | : : "r9", "r10", "r11", "r12",					\ | |
| 60 | "cr0", "cr1", "cr5", "cr6", "cr7",				\ | |
| 61 | "xer", "lr", "ctr", "memory");				\ | |
| 62 | __asm__ __volatile__ ("" : "=r" (rval) : "r" (r3));		 \ | |
| 63 | (long int) r0 & (1 << 28) ? -rval : rval;				\ | |
| 64 | }) | |
| 65 | ||
| 66 | #define INTERNAL_VSYSCALL_CALL(funcptr, nr, args...)			\ | |
| 67 | INTERNAL_VSYSCALL_CALL_TYPE(funcptr, long int, nr, args) | |
| 68 | ||
| 69 | #define DECLARE_REGS				\ | |
| 70 | register long int r0 __asm__ ("r0");		\ | |
| 71 | register long int r3 __asm__ ("r3");		\ | |
| 72 | register long int r4 __asm__ ("r4");		\ | |
| 73 | register long int r5 __asm__ ("r5");		\ | |
| 74 | register long int r6 __asm__ ("r6");		\ | |
| 75 | register long int r7 __asm__ ("r7");		\ | |
| 76 | register long int r8 __asm__ ("r8"); | |
| 77 | ||
| 78 | #define SYSCALL_SCV(nr)				\ | |
| 79 | ({						\ | |
| 80 | __asm__ __volatile__			\ | |
| 81 | (".machine \"push\"\n\t"			\ | |
| 82 | ".machine \"power9\"\n\t"		\ | |
| 83 | "scv 0\n\t"				\ | |
| 84 | ".machine \"pop\"\n\t"			\ | |
| 85 | "0:"					\ | |
| 86 | : "=&r" (r0),				\ | |
| 87 | 	 "=&r" (r3), "=&r" (r4), "=&r" (r5),	\ | |
| 88 | 	 "=&r" (r6), "=&r" (r7), "=&r" (r8)	\ | |
| 89 | : ASM_INPUT_##nr			\ | |
| 90 | : "r9", "r10", "r11", "r12",		\ | |
| 91 | 	 "cr0", "cr1", "cr5", "cr6", "cr7",	\ | |
| 92 | 	 "xer", "lr", "ctr", "memory"); 	\ | |
| 93 | r3;					\ | |
| 94 | }) | |
| 95 | ||
| 96 | #define SYSCALL_SC(nr)				\ | |
| 97 | ({						\ | |
| 98 | __asm__ __volatile__			\ | |
| 99 | ("sc\n\t"				\ | |
| 100 | "mfcr %0\n\t"				\ | |
| 101 | "0:"					\ | |
| 102 | : "=&r" (r0),				\ | |
| 103 | 	 "=&r" (r3), "=&r" (r4), "=&r" (r5),	\ | |
| 104 | 	 "=&r" (r6), "=&r" (r7), "=&r" (r8)	\ | |
| 105 | : ASM_INPUT_##nr			\ | |
| 106 | : "r9", "r10", "r11", "r12",		\ | |
| 107 | 	 "xer", "cr0", "ctr", "memory");	\ | |
| 108 | r0 & (1 << 28) ? -r3 : r3;			\ | |
| 109 | }) | |
| 110 | ||
| 111 | /* This will only be non-empty for 64-bit systems, see below. */ | |
| 112 | #define TRY_SYSCALL_SCV(nr) | |
| 113 | ||
| 114 | #if defined(__PPC64__) || defined(__powerpc64__) | |
| 115 | # define SYSCALL_ARG_SIZE 8 | |
| 116 | ||
| 117 | /* For the static case, unlike the dynamic loader, there is no compile-time way | |
| 118 | to check if we are inside startup code. So we need to check if the thread | |
| 119 | pointer has already been setup before trying to access the TLS. */ | |
| 120 | # ifndef SHARED | |
| 121 | # define CHECK_THREAD_POINTER (__thread_register != 0) | |
| 122 | # else | |
| 123 | # define CHECK_THREAD_POINTER (1) | |
| 124 | # endif | |
| 125 | ||
| 126 | /* When inside the dynamic loader, the thread pointer may not have been | |
| 127 | initialized yet, so don't check for scv support in that case. */ | |
| 128 | # if defined(USE_PPC_SCV) && !IS_IN(rtld) | |
| 129 | # undef TRY_SYSCALL_SCV | |
| 130 | # define TRY_SYSCALL_SCV(nr)						\ | |
| 131 | CHECK_THREAD_POINTER && THREAD_GET_HWCAP() & PPC_FEATURE2_SCV ?	\ | |
| 132 | SYSCALL_SCV(nr) : | |
| 133 | # endif | |
| 134 | ||
| 135 | #else | |
| 136 | # define SYSCALL_ARG_SIZE 4 | |
| 137 | #endif | |
| 138 | ||
| 139 | # define INTERNAL_SYSCALL_NCS(name, nr, args...)	\ | |
| 140 | ({							\ | |
| 141 | DECLARE_REGS;					\ | |
| 142 | LOADARGS_##nr (name, ##args);			\ | |
| 143 | TRY_SYSCALL_SCV(nr)					\ | |
| 144 | SYSCALL_SC(nr);					\ | |
| 145 | }) | |
| 146 | ||
| 147 | #undef INTERNAL_SYSCALL | |
| 148 | #define INTERNAL_SYSCALL(name, nr, args...)				\ | |
| 149 | INTERNAL_SYSCALL_NCS (__NR_##name, nr, args) | |
| 150 | ||
| 151 | #define LOADARGS_0(name, dummy) \ | |
| 152 | 	r0 = name | |
| 153 | #define LOADARGS_1(name, __arg1) \ | |
| 154 | 	long int _arg1 = (long int) (__arg1); \ | |
| 155 | 	LOADARGS_0(name, 0); \ | |
| 156 | 	extern void __illegally_sized_syscall_arg1 (void); \ | |
| 157 | 	if (__builtin_classify_type (__arg1) != 5 \ | |
| 158 | 	 && sizeof (__arg1) > SYSCALL_ARG_SIZE) \ | |
| 159 | 	 __illegally_sized_syscall_arg1 (); \ | |
| 160 | 	r3 = _arg1 | |
| 161 | #define LOADARGS_2(name, __arg1, __arg2) \ | |
| 162 | 	long int _arg2 = (long int) (__arg2); \ | |
| 163 | 	LOADARGS_1(name, __arg1); \ | |
| 164 | 	extern void __illegally_sized_syscall_arg2 (void); \ | |
| 165 | 	if (__builtin_classify_type (__arg2) != 5 \ | |
| 166 | 	 && sizeof (__arg2) > SYSCALL_ARG_SIZE) \ | |
| 167 | 	 __illegally_sized_syscall_arg2 (); \ | |
| 168 | 	r4 = _arg2 | |
| 169 | #define LOADARGS_3(name, __arg1, __arg2, __arg3) \ | |
| 170 | 	long int _arg3 = (long int) (__arg3); \ | |
| 171 | 	LOADARGS_2(name, __arg1, __arg2); \ | |
| 172 | 	extern void __illegally_sized_syscall_arg3 (void); \ | |
| 173 | 	if (__builtin_classify_type (__arg3) != 5 \ | |
| 174 | 	 && sizeof (__arg3) > SYSCALL_ARG_SIZE) \ | |
| 175 | 	 __illegally_sized_syscall_arg3 (); \ | |
| 176 | 	r5 = _arg3 | |
| 177 | #define LOADARGS_4(name, __arg1, __arg2, __arg3, __arg4) \ | |
| 178 | 	long int _arg4 = (long int) (__arg4); \ | |
| 179 | 	LOADARGS_3(name, __arg1, __arg2, __arg3); \ | |
| 180 | 	extern void __illegally_sized_syscall_arg4 (void); \ | |
| 181 | 	if (__builtin_classify_type (__arg4) != 5 \ | |
| 182 | 	 && sizeof (__arg4) > SYSCALL_ARG_SIZE) \ | |
| 183 | 	 __illegally_sized_syscall_arg4 (); \ | |
| 184 | 	r6 = _arg4 | |
| 185 | #define LOADARGS_5(name, __arg1, __arg2, __arg3, __arg4, __arg5) \ | |
| 186 | 	long int _arg5 = (long int) (__arg5); \ | |
| 187 | 	LOADARGS_4(name, __arg1, __arg2, __arg3, __arg4); \ | |
| 188 | 	extern void __illegally_sized_syscall_arg5 (void); \ | |
| 189 | 	if (__builtin_classify_type (__arg5) != 5 \ | |
| 190 | 	 && sizeof (__arg5) > SYSCALL_ARG_SIZE) \ | |
| 191 | 	 __illegally_sized_syscall_arg5 (); \ | |
| 192 | 	r7 = _arg5 | |
| 193 | #define LOADARGS_6(name, __arg1, __arg2, __arg3, __arg4, __arg5, __arg6) \ | |
| 194 | 	long int _arg6 = (long int) (__arg6); \ | |
| 195 | 	LOADARGS_5(name, __arg1, __arg2, __arg3, __arg4, __arg5); \ | |
| 196 | 	extern void __illegally_sized_syscall_arg6 (void); \ | |
| 197 | 	if (__builtin_classify_type (__arg6) != 5 \ | |
| 198 | 	 && sizeof (__arg6) > SYSCALL_ARG_SIZE) \ | |
| 199 | 	 __illegally_sized_syscall_arg6 (); \ | |
| 200 | 	r8 = _arg6 | |
| 201 | ||
| 202 | #define ASM_INPUT_0 "0" (r0) | |
| 203 | #define ASM_INPUT_1 ASM_INPUT_0, "1" (r3) | |
| 204 | #define ASM_INPUT_2 ASM_INPUT_1, "2" (r4) | |
| 205 | #define ASM_INPUT_3 ASM_INPUT_2, "3" (r5) | |
| 206 | #define ASM_INPUT_4 ASM_INPUT_3, "4" (r6) | |
| 207 | #define ASM_INPUT_5 ASM_INPUT_4, "5" (r7) | |
| 208 | #define ASM_INPUT_6 ASM_INPUT_5, "6" (r8) | |
| 209 | ||
| 210 | ||
| 211 | /* Pointer mangling support. */ | |
| 212 | #if IS_IN (rtld) | |
| 213 | /* We cannot use the thread descriptor because in ld.so we use setjmp | |
| 214 | earlier than the descriptor is initialized. */ | |
| 215 | #else | |
| 216 | # ifdef __ASSEMBLER__ | |
| 217 | # if defined(__PPC64__) || defined(__powerpc64__) | |
| 218 | # define LOAD ld | |
| 219 | # define TPREG r13 | |
| 220 | # else | |
| 221 | # define LOAD lwz | |
| 222 | # define TPREG r2 | |
| 223 | # endif | |
| 224 | # define PTR_MANGLE(reg, tmpreg) \ | |
| 225 | 	LOAD	tmpreg,POINTER_GUARD(TPREG); \ | |
| 226 | 	xor	reg,tmpreg,reg | |
| 227 | # define PTR_MANGLE2(reg, tmpreg) \ | |
| 228 | 	xor	reg,tmpreg,reg | |
| 229 | # define PTR_MANGLE3(destreg, reg, tmpreg) \ | |
| 230 | 	LOAD	tmpreg,POINTER_GUARD(TPREG); \ | |
| 231 | 	xor	destreg,tmpreg,reg | |
| 232 | # define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) | |
| 233 | # define PTR_DEMANGLE2(reg, tmpreg) PTR_MANGLE2 (reg, tmpreg) | |
| 234 | # define PTR_DEMANGLE3(destreg, reg, tmpreg) PTR_MANGLE3 (destreg, reg, tmpreg) | |
| 235 | # else | |
| 236 | # define PTR_MANGLE(var) \ | |
| 237 | (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) | |
| 238 | # define PTR_DEMANGLE(var)	PTR_MANGLE (var) | |
| 239 | # endif | |
| 240 | #endif | |
| 241 | ||
| 242 | /* List of system calls which are supported as vsyscalls. */ | |
| 243 | #define VDSO_NAME "LINUX_2.6.15" | |
| 244 | #define VDSO_HASH 123718565 | |
| 245 | ||
| 246 | #if defined(__PPC64__) || defined(__powerpc64__) | |
| 247 | #define HAVE_CLOCK_GETRES64_VSYSCALL	"__kernel_clock_getres" | |
| 248 | #define HAVE_CLOCK_GETTIME64_VSYSCALL	"__kernel_clock_gettime" | |
| 249 | #else | |
| 250 | #define HAVE_CLOCK_GETRES_VSYSCALL	"__kernel_clock_getres" | |
| 251 | #define HAVE_CLOCK_GETTIME_VSYSCALL	"__kernel_clock_gettime" | |
| 252 | #endif | |
| 253 | #define HAVE_GETCPU_VSYSCALL		"__kernel_getcpu" | |
| 254 | #define HAVE_TIME_VSYSCALL		"__kernel_time" | |
| 255 | #define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday" | |
| 256 | #define HAVE_GET_TBFREQ "__kernel_get_tbfreq" | |
| 257 | ||
| 258 | #if defined(__PPC64__) || defined(__powerpc64__) | |
| 259 | # define HAVE_SIGTRAMP_RT64		"__kernel_sigtramp_rt64" | |
| 260 | #else | |
| 261 | # define HAVE_SIGTRAMP_32		"__kernel_sigtramp32" | |
| 262 | # define HAVE_SIGTRAMP_RT32		"__kernel_sigtramp_rt32" | |
| 263 | #endif | |
| 264 | ||
| 265 | #endif /* _LINUX_POWERPC_SYSDEP_H */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/xstatver.h created+17| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | /* Versions of the 'struct stat' data structure used in compatibility xstat | |
| 2 | functions. */ | |
| 3 | #define _STAT_VER_LINUX_OLD	1 | |
| 4 | #define _STAT_VER_KERNEL	1 | |
| 5 | #define _STAT_VER_SVR4		2 | |
| 6 | #define _STAT_VER_LINUX	 3 | |
| 7 | #if __WORDSIZE == 32 | |
| 8 | # define _STAT_VER		_STAT_VER_LINUX | |
| 9 | #else | |
| 10 | # define _STAT_VER		_STAT_VER_KERNEL | |
| 11 | #endif | |
| 12 | ||
| 13 | /* Versions of the 'xmknod' interface used in compatibility xmknod | |
| 14 | functions. */ | |
| 15 | #define _MKNOD_VER_LINUX	1 | |
| 16 | #define _MKNOD_VER_SVR4		2 | |
| 17 | #define _MKNOD_VER		_MKNOD_VER_LINUX |
lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/kernel-features.h+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. RISC-V version. |
| 3 | Copyright (C) 2018-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 2018-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/sysdep.h+112-76| ... | ... | @@ -22,6 +22,32 @@ |
| 22 | 22 | #include <sysdeps/unix/sysv/linux/generic/sysdep.h> |
| 23 | 23 | #include <tls.h> |
| 24 | 24 | |
| 25 | #undef SYS_ify | |
| 26 | #define SYS_ify(syscall_name)	__NR_##syscall_name | |
| 27 | ||
| 28 | #if __WORDSIZE == 32 | |
| 29 | ||
| 30 | /* Workarounds for generic code needing to handle 64-bit time_t. */ | |
| 31 | ||
| 32 | /* Fix sysdeps/unix/sysv/linux/clock_getcpuclockid.c. */ | |
| 33 | #define __NR_clock_getres	__NR_clock_getres_time64 | |
| 34 | /* Fix sysdeps/nptl/lowlevellock-futex.h. */ | |
| 35 | #define __NR_futex		__NR_futex_time64 | |
| 36 | /* Fix sysdeps/unix/sysv/linux/pause.c. */ | |
| 37 | #define __NR_ppoll		__NR_ppoll_time64 | |
| 38 | /* Fix sysdeps/unix/sysv/linux/select.c. */ | |
| 39 | #define __NR_pselect6		__NR_pselect6_time64 | |
| 40 | /* Fix sysdeps/unix/sysv/linux/recvmmsg.c. */ | |
| 41 | #define __NR_recvmmsg		__NR_recvmmsg_time64 | |
| 42 | /* Fix sysdeps/unix/sysv/linux/sigtimedwait.c. */ | |
| 43 | #define __NR_rt_sigtimedwait	__NR_rt_sigtimedwait_time64 | |
| 44 | /* Fix sysdeps/unix/sysv/linux/semtimedop.c. */ | |
| 45 | #define __NR_semtimedop		__NR_semtimedop_time64 | |
| 46 | /* Hack sysdeps/unix/sysv/linux/generic/utimes.c. */ | |
| 47 | #define __NR_utimensat		__NR_utimensat_time64 | |
| 48 | ||
| 49 | #endif /* __WORDSIZE == 32 */ | |
| 50 | ||
| 25 | 51 | #ifdef __ASSEMBLER__ |
| 26 | 52 | |
| 27 | 53 | # include <sys/asm.h> |
| ... | ... | @@ -107,56 +133,38 @@ |
| 107 | 133 | # undef ret_ERRVAL |
| 108 | 134 | # define ret_ERRVAL ret |
| 109 | 135 | |
| 110 | #endif /* __ASSEMBLER__ */ | |
| 136 | #else /* !__ASSEMBLER__ */ | |
| 111 | 137 | |
| 112 | /* In order to get __set_errno() definition in INLINE_SYSCALL. */ | |
| 113 | #ifndef __ASSEMBLER__ | |
| 114 | # include <errno.h> | |
| 115 | #endif | |
| 138 | # if __WORDSIZE == 64 | |
| 139 | # define VDSO_NAME	"LINUX_4.15" | |
| 140 | # define VDSO_HASH	182943605 | |
| 116 | 141 | |
| 117 | #include <sysdeps/unix/sysdep.h> | |
| 118 | ||
| 119 | #undef SYS_ify | |
| 120 | #define SYS_ify(syscall_name)	__NR_##syscall_name | |
| 121 | ||
| 122 | #ifndef __ASSEMBLER__ | |
| 142 | /* List of system calls which are supported as vsyscalls only | |
| 143 | for RV64. */ | |
| 144 | # define HAVE_CLOCK_GETRES64_VSYSCALL	"__vdso_clock_getres" | |
| 145 | # define HAVE_CLOCK_GETTIME64_VSYSCALL	"__vdso_clock_gettime" | |
| 146 | # define HAVE_GETTIMEOFDAY_VSYSCALL	"__vdso_gettimeofday" | |
| 147 | # else | |
| 148 | # define VDSO_NAME	"LINUX_5.4" | |
| 149 | # define VDSO_HASH	61765876 | |
| 123 | 150 | |
| 124 | # define VDSO_NAME "LINUX_4.15" | |
| 125 | # define VDSO_HASH 182943605 | |
| 151 | /* RV32 does not support the gettime VDSO syscalls. */ | |
| 152 | # endif | |
| 126 | 153 | |
| 127 | /* List of system calls which are supported as vsyscalls. */ | |
| 128 | # define HAVE_CLOCK_GETRES64_VSYSCALL	"__vdso_clock_getres" | |
| 129 | # define HAVE_CLOCK_GETTIME64_VSYSCALL	"__vdso_clock_gettime" | |
| 130 | # define HAVE_GETTIMEOFDAY_VSYSCALL	"__vdso_gettimeofday" | |
| 154 | /* List of system calls which are supported as vsyscalls (for RV32 and | |
| 155 | RV64). */ | |
| 131 | 156 | # define HAVE_GETCPU_VSYSCALL		"__vdso_getcpu" |
| 132 | 157 | |
| 133 | /* Define a macro which expands into the inline wrapper code for a system | |
| 134 | call. */ | |
| 135 | # undef INLINE_SYSCALL | |
| 136 | # define INLINE_SYSCALL(name, nr, args...)				\ | |
| 137 | ({ INTERNAL_SYSCALL_DECL (err);					\ | |
| 138 | long int __sys_result = INTERNAL_SYSCALL (name, err, nr, args);	\ | |
| 139 | if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (__sys_result, ))) \ | |
| 140 | {								\ | |
| 141 | __set_errno (INTERNAL_SYSCALL_ERRNO (__sys_result, ));		\ | |
| 142 | 	 __sys_result = (unsigned long) -1;				\ | |
| 143 | }								\ | |
| 144 | __sys_result; }) | |
| 145 | ||
| 146 | # define INTERNAL_SYSCALL_DECL(err) do { } while (0) | |
| 147 | ||
| 148 | # define INTERNAL_SYSCALL_ERROR_P(val, err) \ | |
| 149 | ((unsigned long int) (val) > -4096UL) | |
| 150 | ||
| 151 | # define INTERNAL_SYSCALL_ERRNO(val, err) (-val) | |
| 158 | # undef HAVE_INTERNAL_BRK_ADDR_SYMBOL | |
| 159 | # define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 | |
| 152 | 160 | |
| 153 | # define INTERNAL_SYSCALL(name, err, nr, args...) \ | |
| 154 | 	internal_syscall##nr (SYS_ify (name), err, args) | |
| 161 | # define INTERNAL_SYSCALL(name, nr, args...) \ | |
| 162 | 	internal_syscall##nr (SYS_ify (name), args) | |
| 155 | 163 | |
| 156 | # define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ | |
| 157 | 	internal_syscall##nr (number, err, args) | |
| 164 | # define INTERNAL_SYSCALL_NCS(number, nr, args...) \ | |
| 165 | 	internal_syscall##nr (number, args) | |
| 158 | 166 | |
| 159 | # define internal_syscall0(number, err, dummy...)			\ | |
| 167 | # define internal_syscall0(number, dummy...)			\ | |
| 160 | 168 | ({ 									\ |
| 161 | 169 | 	long int _sys_result;						\ |
| 162 | 170 | 									\ |
| ... | ... | @@ -173,13 +181,14 @@ |
| 173 | 181 | 	_sys_result;							\ |
| 174 | 182 | }) |
| 175 | 183 | |
| 176 | # define internal_syscall1(number, err, arg0)				\ | |
| 184 | # define internal_syscall1(number, arg0)				\ | |
| 177 | 185 | ({ 									\ |
| 178 | 186 | 	long int _sys_result;						\ |
| 187 | 	long int _arg0 = (long int) (arg0);				\ | |
| 179 | 188 | 									\ |
| 180 | 189 | 	{								\ |
| 181 | 190 | 	register long int __a7 asm ("a7") = number;			\ |
| 182 | 	register long int __a0 asm ("a0") = (long int) (arg0);		\ | |
| 191 | 	register long int __a0 asm ("a0") = _arg0;			\ | |
| 183 | 192 | 	__asm__ volatile ( 						\ |
| 184 | 193 | 	"scall\n\t" 							\ |
| 185 | 194 | 	: "+r" (__a0)							\ |
| ... | ... | @@ -190,14 +199,16 @@ |
| 190 | 199 | 	_sys_result;							\ |
| 191 | 200 | }) |
| 192 | 201 | |
| 193 | # define internal_syscall2(number, err, arg0, arg1)	 		\ | |
| 202 | # define internal_syscall2(number, arg0, arg1)	 		\ | |
| 194 | 203 | ({ 									\ |
| 195 | 204 | 	long int _sys_result;						\ |
| 205 | 	long int _arg0 = (long int) (arg0);				\ | |
| 206 | 	long int _arg1 = (long int) (arg1);				\ | |
| 196 | 207 | 									\ |
| 197 | 208 | 	{								\ |
| 198 | 209 | 	register long int __a7 asm ("a7") = number;			\ |
| 199 | 	register long int __a0 asm ("a0") = (long int) (arg0);		\ | |
| 200 | 	register long int __a1 asm ("a1") = (long int) (arg1);		\ | |
| 210 | 	register long int __a0 asm ("a0") = _arg0;			\ | |
| 211 | 	register long int __a1 asm ("a1") = _arg1;			\ | |
| 201 | 212 | 	__asm__ volatile ( 						\ |
| 202 | 213 | 	"scall\n\t" 							\ |
| 203 | 214 | 	: "+r" (__a0)							\ |
| ... | ... | @@ -208,15 +219,18 @@ |
| 208 | 219 | 	_sys_result;							\ |
| 209 | 220 | }) |
| 210 | 221 | |
| 211 | # define internal_syscall3(number, err, arg0, arg1, arg2) 		\ | |
| 222 | # define internal_syscall3(number, arg0, arg1, arg2) 		\ | |
| 212 | 223 | ({ 									\ |
| 213 | 224 | 	long int _sys_result;						\ |
| 225 | 	long int _arg0 = (long int) (arg0);				\ | |
| 226 | 	long int _arg1 = (long int) (arg1);				\ | |
| 227 | 	long int _arg2 = (long int) (arg2);				\ | |
| 214 | 228 | 									\ |
| 215 | 229 | 	{								\ |
| 216 | 230 | 	register long int __a7 asm ("a7") = number;			\ |
| 217 | 	register long int __a0 asm ("a0") = (long int) (arg0);		\ | |
| 218 | 	register long int __a1 asm ("a1") = (long int) (arg1);		\ | |
| 219 | 	register long int __a2 asm ("a2") = (long int) (arg2);		\ | |
| 231 | 	register long int __a0 asm ("a0") = _arg0;			\ | |
| 232 | 	register long int __a1 asm ("a1") = _arg1;			\ | |
| 233 | 	register long int __a2 asm ("a2") = _arg2;			\ | |
| 220 | 234 | 	__asm__ volatile ( 						\ |
| 221 | 235 | 	"scall\n\t" 							\ |
| 222 | 236 | 	: "+r" (__a0)							\ |
| ... | ... | @@ -227,16 +241,20 @@ |
| 227 | 241 | 	_sys_result;							\ |
| 228 | 242 | }) |
| 229 | 243 | |
| 230 | # define internal_syscall4(number, err, arg0, arg1, arg2, arg3)	 \ | |
| 244 | # define internal_syscall4(number, arg0, arg1, arg2, arg3)	 \ | |
| 231 | 245 | ({ 									\ |
| 232 | 246 | 	long int _sys_result;						\ |
| 247 | 	long int _arg0 = (long int) (arg0);				\ | |
| 248 | 	long int _arg1 = (long int) (arg1);				\ | |
| 249 | 	long int _arg2 = (long int) (arg2);				\ | |
| 250 | 	long int _arg3 = (long int) (arg3);				\ | |
| 233 | 251 | 									\ |
| 234 | 252 | 	{								\ |
| 235 | 253 | 	register long int __a7 asm ("a7") = number;			\ |
| 236 | 	register long int __a0 asm ("a0") = (long int) (arg0);		\ | |
| 237 | 	register long int __a1 asm ("a1") = (long int) (arg1);		\ | |
| 238 | 	register long int __a2 asm ("a2") = (long int) (arg2);		\ | |
| 239 | 	register long int __a3 asm ("a3") = (long int) (arg3);		\ | |
| 254 | 	register long int __a0 asm ("a0") = _arg0;			\ | |
| 255 | 	register long int __a1 asm ("a1") = _arg1;			\ | |
| 256 | 	register long int __a2 asm ("a2") = _arg2;			\ | |
| 257 | 	register long int __a3 asm ("a3") = _arg3;			\ | |
| 240 | 258 | 	__asm__ volatile ( 						\ |
| 241 | 259 | 	"scall\n\t" 							\ |
| 242 | 260 | 	: "+r" (__a0)							\ |
| ... | ... | @@ -247,17 +265,22 @@ |
| 247 | 265 | 	_sys_result;							\ |
| 248 | 266 | }) |
| 249 | 267 | |
| 250 | # define internal_syscall5(number, err, arg0, arg1, arg2, arg3, arg4) \ | |
| 268 | # define internal_syscall5(number, arg0, arg1, arg2, arg3, arg4) \ | |
| 251 | 269 | ({ 									\ |
| 252 | 270 | 	long int _sys_result;						\ |
| 271 | 	long int _arg0 = (long int) (arg0);				\ | |
| 272 | 	long int _arg1 = (long int) (arg1);				\ | |
| 273 | 	long int _arg2 = (long int) (arg2);				\ | |
| 274 | 	long int _arg3 = (long int) (arg3);				\ | |
| 275 | 	long int _arg4 = (long int) (arg4);				\ | |
| 253 | 276 | 									\ |
| 254 | 277 | 	{								\ |
| 255 | 278 | 	register long int __a7 asm ("a7") = number;			\ |
| 256 | 	register long int __a0 asm ("a0") = (long int) (arg0);		\ | |
| 257 | 	register long int __a1 asm ("a1") = (long int) (arg1);		\ | |
| 258 | 	register long int __a2 asm ("a2") = (long int) (arg2);		\ | |
| 259 | 	register long int __a3 asm ("a3") = (long int) (arg3);		\ | |
| 260 | 	register long int __a4 asm ("a4") = (long int) (arg4);		\ | |
| 279 | 	register long int __a0 asm ("a0") = _arg0;			\ | |
| 280 | 	register long int __a1 asm ("a1") = _arg1;			\ | |
| 281 | 	register long int __a2 asm ("a2") = _arg2;			\ | |
| 282 | 	register long int __a3 asm ("a3") = _arg3;			\ | |
| 283 | 	register long int __a4 asm ("a4") = _arg4;			\ | |
| 261 | 284 | 	__asm__ volatile ( 						\ |
| 262 | 285 | 	"scall\n\t" 							\ |
| 263 | 286 | 	: "+r" (__a0)							\ |
| ... | ... | @@ -268,18 +291,24 @@ |
| 268 | 291 | 	_sys_result;							\ |
| 269 | 292 | }) |
| 270 | 293 | |
| 271 | # define internal_syscall6(number, err, arg0, arg1, arg2, arg3, arg4, arg5) \ | |
| 294 | # define internal_syscall6(number, arg0, arg1, arg2, arg3, arg4, arg5) \ | |
| 272 | 295 | ({ 									\ |
| 273 | 296 | 	long int _sys_result;						\ |
| 297 | 	long int _arg0 = (long int) (arg0);				\ | |
| 298 | 	long int _arg1 = (long int) (arg1);				\ | |
| 299 | 	long int _arg2 = (long int) (arg2);				\ | |
| 300 | 	long int _arg3 = (long int) (arg3);				\ | |
| 301 | 	long int _arg4 = (long int) (arg4);				\ | |
| 302 | 	long int _arg5 = (long int) (arg5);				\ | |
| 274 | 303 | 									\ |
| 275 | 304 | 	{								\ |
| 276 | 305 | 	register long int __a7 asm ("a7") = number;			\ |
| 277 | 	register long int __a0 asm ("a0") = (long int) (arg0);		\ | |
| 278 | 	register long int __a1 asm ("a1") = (long int) (arg1);		\ | |
| 279 | 	register long int __a2 asm ("a2") = (long int) (arg2);		\ | |
| 280 | 	register long int __a3 asm ("a3") = (long int) (arg3);		\ | |
| 281 | 	register long int __a4 asm ("a4") = (long int) (arg4);		\ | |
| 282 | 	register long int __a5 asm ("a5") = (long int) (arg5);		\ | |
| 306 | 	register long int __a0 asm ("a0") = _arg0;			\ | |
| 307 | 	register long int __a1 asm ("a1") = _arg1;			\ | |
| 308 | 	register long int __a2 asm ("a2") = _arg2;			\ | |
| 309 | 	register long int __a3 asm ("a3") = _arg3;			\ | |
| 310 | 	register long int __a4 asm ("a4") = _arg4;			\ | |
| 311 | 	register long int __a5 asm ("a5") = _arg5;			\ | |
| 283 | 312 | 	__asm__ volatile ( 						\ |
| 284 | 313 | 	"scall\n\t" 							\ |
| 285 | 314 | 	: "+r" (__a0)							\ |
| ... | ... | @@ -291,19 +320,26 @@ |
| 291 | 320 | 	_sys_result;							\ |
| 292 | 321 | }) |
| 293 | 322 | |
| 294 | # define internal_syscall7(number, err, arg0, arg1, arg2, arg3, arg4, arg5, arg6) \ | |
| 323 | # define internal_syscall7(number, arg0, arg1, arg2, arg3, arg4, arg5, arg6) \ | |
| 295 | 324 | ({ 									\ |
| 296 | 325 | 	long int _sys_result;						\ |
| 326 | 	long int _arg0 = (long int) (arg0);				\ | |
| 327 | 	long int _arg1 = (long int) (arg1);				\ | |
| 328 | 	long int _arg2 = (long int) (arg2);				\ | |
| 329 | 	long int _arg3 = (long int) (arg3);				\ | |
| 330 | 	long int _arg4 = (long int) (arg4);				\ | |
| 331 | 	long int _arg5 = (long int) (arg5);				\ | |
| 332 | 	long int _arg6 = (long int) (arg6);				\ | |
| 297 | 333 | 									\ |
| 298 | 334 | 	{								\ |
| 299 | 335 | 	register long int __a7 asm ("a7") = number;			\ |
| 300 | 	register long int __a0 asm ("a0") = (long int) (arg0);		\ | |
| 301 | 	register long int __a1 asm ("a1") = (long int) (arg1);		\ | |
| 302 | 	register long int __a2 asm ("a2") = (long int) (arg2);		\ | |
| 303 | 	register long int __a3 asm ("a3") = (long int) (arg3);		\ | |
| 304 | 	register long int __a4 asm ("a4") = (long int) (arg4);		\ | |
| 305 | 	register long int __a5 asm ("a5") = (long int) (arg5);		\ | |
| 306 | 	register long int __a6 asm ("a6") = (long int) (arg6);		\ | |
| 336 | 	register long int __a0 asm ("a0") = _arg0;			\ | |
| 337 | 	register long int __a1 asm ("a1") = _arg1;			\ | |
| 338 | 	register long int __a2 asm ("a2") = _arg2;			\ | |
| 339 | 	register long int __a3 asm ("a3") = _arg3;			\ | |
| 340 | 	register long int __a4 asm ("a4") = _arg4;			\ | |
| 341 | 	register long int __a5 asm ("a5") = _arg5;			\ | |
| 342 | 	register long int __a6 asm ("a6") = _arg6;			\ | |
| 307 | 343 | 	__asm__ volatile ( 						\ |
| 308 | 344 | 	"scall\n\t" 							\ |
| 309 | 345 | 	: "+r" (__a0)							\ |
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/bits/stat.h deleted-265| ... | ... | @@ -1,265 +0,0 @@ |
| 1 | /* Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #if !defined _SYS_STAT_H && !defined _FCNTL_H | |
| 19 | # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #ifndef _BITS_STAT_H | |
| 23 | #define _BITS_STAT_H	1 | |
| 24 | ||
| 25 | #include <bits/wordsize.h> | |
| 26 | ||
| 27 | #if __WORDSIZE == 64 | |
| 28 | /* Versions of the `struct stat' data structure. */ | |
| 29 | # define _STAT_VER_KERNEL	0 | |
| 30 | # define _STAT_VER_LINUX	1 | |
| 31 | # define _STAT_VER		_STAT_VER_LINUX | |
| 32 | ||
| 33 | /* Versions of the `xmknod' interface.	*/ | |
| 34 | #define _MKNOD_VER_LINUX	0 | |
| 35 | #else | |
| 36 | /* Versions of the `struct stat' data structure. */ | |
| 37 | # define _STAT_VER_LINUX_OLD	1 | |
| 38 | # define _STAT_VER_KERNEL	1 | |
| 39 | # define _STAT_VER_SVR4		2 | |
| 40 | # define _STAT_VER_LINUX	3 | |
| 41 | # define _STAT_VER		_STAT_VER_LINUX | |
| 42 | ||
| 43 | /* Versions of the `xmknod' interface. */ | |
| 44 | # define _MKNOD_VER_LINUX	1 | |
| 45 | # define _MKNOD_VER_SVR4	2 | |
| 46 | # define _MKNOD_VER		_MKNOD_VER_LINUX | |
| 47 | #endif | |
| 48 | ||
| 49 | #if __WORDSIZE == 64 | |
| 50 | struct stat | |
| 51 | { | |
| 52 | __dev_t st_dev;		/* Device. */ | |
| 53 | __ino_t st_ino;		/* File serial number.	*/ | |
| 54 | __nlink_t st_nlink;		/* Link count.	*/ | |
| 55 | __mode_t st_mode;		/* File mode. */ | |
| 56 | __uid_t st_uid;		/* User ID of the file's owner.	*/ | |
| 57 | __gid_t st_gid;		/* Group ID of the file's group.*/ | |
| 58 | int __glibc_reserved0; | |
| 59 | __dev_t st_rdev;		/* Device number, if device. */ | |
| 60 | __off_t st_size;		/* Size of file, in bytes. */ | |
| 61 | #ifdef __USE_XOPEN2K8 | |
| 62 | /* Nanosecond resolution timestamps are stored in a format | |
| 63 | equivalent to 'struct timespec'. This is the type used | |
| 64 | whenever possible but the Unix namespace rules do not allow the | |
| 65 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 66 | Therefore we have to handle the use of this header in strictly | |
| 67 | standard-compliant sources special. */ | |
| 68 | struct timespec st_atim;		/* Time of last access. */ | |
| 69 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 70 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 71 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 72 | # define st_mtime st_mtim.tv_sec | |
| 73 | # define st_ctime st_ctim.tv_sec | |
| 74 | #else | |
| 75 | __time_t st_atime;			/* Time of last access. */ | |
| 76 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 77 | __time_t st_mtime;			/* Time of last modification. */ | |
| 78 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 79 | __time_t st_ctime;			/* Time of last status change. */ | |
| 80 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 81 | #endif | |
| 82 | __blksize_t st_blksize;	/* Optimal block size for I/O.	*/ | |
| 83 | __blkcnt_t st_blocks;	/* Nr. 512-byte blocks allocated. */ | |
| 84 | long int __glibc_reserved[3]; | |
| 85 | }; | |
| 86 | #else | |
| 87 | struct stat | |
| 88 | { | |
| 89 | __dev_t st_dev;			/* Device. */ | |
| 90 | unsigned int __pad1; | |
| 91 | # ifndef __USE_FILE_OFFSET64 | |
| 92 | __ino_t st_ino;			/* File serial number.	*/ | |
| 93 | # else | |
| 94 | __ino_t __st_ino;			/* 32bit file serial number.	*/ | |
| 95 | # endif | |
| 96 | __mode_t st_mode;			/* File mode. */ | |
| 97 | __nlink_t st_nlink;			/* Link count. */ | |
| 98 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 99 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 100 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 101 | unsigned int __pad2; | |
| 102 | # ifndef __USE_FILE_OFFSET64 | |
| 103 | __off_t st_size;			/* Size of file, in bytes. */ | |
| 104 | # else | |
| 105 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 106 | # endif | |
| 107 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 108 | ||
| 109 | # ifndef __USE_FILE_OFFSET64 | |
| 110 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 111 | # else | |
| 112 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 113 | # endif | |
| 114 | # ifdef __USE_XOPEN2K8 | |
| 115 | /* Nanosecond resolution timestamps are stored in a format | |
| 116 | equivalent to 'struct timespec'. This is the type used | |
| 117 | whenever possible but the Unix namespace rules do not allow the | |
| 118 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 119 | Therefore we have to handle the use of this header in strictly | |
| 120 | standard-compliant sources special. */ | |
| 121 | struct timespec st_atim;		/* Time of last access. */ | |
| 122 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 123 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 124 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 125 | # define st_mtime st_mtim.tv_sec | |
| 126 | # define st_ctime st_ctim.tv_sec | |
| 127 | # else | |
| 128 | __time_t st_atime;			/* Time of last access. */ | |
| 129 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 130 | __time_t st_mtime;			/* Time of last modification. */ | |
| 131 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 132 | __time_t st_ctime;			/* Time of last status change. */ | |
| 133 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 134 | # endif | |
| 135 | # ifndef __USE_FILE_OFFSET64 | |
| 136 | unsigned long int __glibc_reserved4; | |
| 137 | unsigned long int __glibc_reserved5; | |
| 138 | # else | |
| 139 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 140 | # endif | |
| 141 | }; | |
| 142 | #endif | |
| 143 | ||
| 144 | #ifdef __USE_LARGEFILE64 | |
| 145 | # if __WORDSIZE == 64 | |
| 146 | /* Note stat64 is the same shape as stat. */ | |
| 147 | struct stat64 | |
| 148 | { | |
| 149 | __dev_t st_dev;		/* Device. */ | |
| 150 | __ino64_t st_ino;		/* File serial number.	*/ | |
| 151 | __nlink_t st_nlink;		/* Link count.	*/ | |
| 152 | __mode_t st_mode;		/* File mode. */ | |
| 153 | __uid_t st_uid;		/* User ID of the file's owner.	*/ | |
| 154 | __gid_t st_gid;		/* Group ID of the file's group.*/ | |
| 155 | int __glibc_reserved0; | |
| 156 | __dev_t st_rdev;		/* Device number, if device. */ | |
| 157 | __off_t st_size;		/* Size of file, in bytes. */ | |
| 158 | # ifdef __USE_XOPEN2K8 | |
| 159 | /* Nanosecond resolution timestamps are stored in a format | |
| 160 | equivalent to 'struct timespec'. This is the type used | |
| 161 | whenever possible but the Unix namespace rules do not allow the | |
| 162 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 163 | Therefore we have to handle the use of this header in strictly | |
| 164 | standard-compliant sources special. */ | |
| 165 | struct timespec st_atim;		/* Time of last access. */ | |
| 166 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 167 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 168 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 169 | # define st_mtime st_mtim.tv_sec | |
| 170 | # define st_ctime st_ctim.tv_sec | |
| 171 | # else | |
| 172 | __time_t st_atime;			/* Time of last access. */ | |
| 173 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 174 | __time_t st_mtime;			/* Time of last modification. */ | |
| 175 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 176 | __time_t st_ctime;			/* Time of last status change. */ | |
| 177 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 178 | # endif | |
| 179 | __blksize_t st_blksize;	/* Optimal block size for I/O.	*/ | |
| 180 | __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated. */ | |
| 181 | long int __glibc_reserved[3]; | |
| 182 | }; | |
| 183 | # else | |
| 184 | struct stat64 | |
| 185 | { | |
| 186 | __dev_t st_dev;			/* Device. */ | |
| 187 | unsigned int __pad1; | |
| 188 | ||
| 189 | __ino_t __st_ino;			/* 32bit file serial number.	*/ | |
| 190 | __mode_t st_mode;			/* File mode. */ | |
| 191 | __nlink_t st_nlink;			/* Link count. */ | |
| 192 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 193 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 194 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 195 | unsigned int __pad2; | |
| 196 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 197 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 198 | ||
| 199 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 200 | # ifdef __USE_XOPEN2K8 | |
| 201 | /* Nanosecond resolution timestamps are stored in a format | |
| 202 | equivalent to 'struct timespec'. This is the type used | |
| 203 | whenever possible but the Unix namespace rules do not allow the | |
| 204 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 205 | Therefore we have to handle the use of this header in strictly | |
| 206 | standard-compliant sources special. */ | |
| 207 | struct timespec st_atim;		/* Time of last access. */ | |
| 208 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 209 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 210 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 211 | # define st_mtime st_mtim.tv_sec | |
| 212 | # define st_ctime st_ctim.tv_sec | |
| 213 | # else | |
| 214 | __time_t st_atime;			/* Time of last access. */ | |
| 215 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 216 | __time_t st_mtime;			/* Time of last modification. */ | |
| 217 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 218 | __time_t st_ctime;			/* Time of last status change. */ | |
| 219 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 220 | # endif | |
| 221 | __ino64_t st_ino;			/* File serial number.		*/ | |
| 222 | }; | |
| 223 | # endif | |
| 224 | #endif | |
| 225 | ||
| 226 | /* Tell code we have these members. */ | |
| 227 | #define	_STATBUF_ST_BLKSIZE | |
| 228 | #define _STATBUF_ST_RDEV | |
| 229 | /* Nanosecond resolution time values are supported. */ | |
| 230 | #define _STATBUF_ST_NSEC | |
| 231 | ||
| 232 | /* Encoding of the file mode. */ | |
| 233 | ||
| 234 | #define	__S_IFMT	0170000	/* These bits determine file type. */ | |
| 235 | ||
| 236 | /* File types. */ | |
| 237 | #define	__S_IFDIR	0040000	/* Directory. */ | |
| 238 | #define	__S_IFCHR	0020000	/* Character device. */ | |
| 239 | #define	__S_IFBLK	0060000	/* Block device. */ | |
| 240 | #define	__S_IFREG	0100000	/* Regular file. */ | |
| 241 | #define	__S_IFIFO	0010000	/* FIFO. */ | |
| 242 | #define	__S_IFLNK	0120000	/* Symbolic link. */ | |
| 243 | #define	__S_IFSOCK	0140000	/* Socket. */ | |
| 244 | ||
| 245 | /* POSIX.1b objects. Note that these macros always evaluate to zero. But | |
| 246 | they do it by enforcing the correct use of the macros. */ | |
| 247 | #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 248 | #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 249 | #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 250 | ||
| 251 | /* Protection bits. */ | |
| 252 | ||
| 253 | #define	__S_ISUID	04000	/* Set user ID on execution. */ | |
| 254 | #define	__S_ISGID	02000	/* Set group ID on execution. */ | |
| 255 | #define	__S_ISVTX	01000	/* Save swapped text after use (sticky). */ | |
| 256 | #define	__S_IREAD	0400	/* Read by owner. */ | |
| 257 | #define	__S_IWRITE	0200	/* Write by owner. */ | |
| 258 | #define	__S_IEXEC	0100	/* Execute by owner. */ | |
| 259 | ||
| 260 | #ifdef __USE_ATFILE | |
| 261 | # define UTIME_NOW	((1l << 30) - 1l) | |
| 262 | # define UTIME_OMIT	((1l << 30) - 2l) | |
| 263 | #endif | |
| 264 | ||
| 265 | #endif	/* bits/stat.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h+8-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* bits/typesizes.h -- underlying types for *_t. Linux/s390 version. |
| 2 | Copyright (C) 2003-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2003-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -50,6 +50,7 @@ |
| 50 | 50 | #define __TIME_T_TYPE		__SLONGWORD_TYPE |
| 51 | 51 | #define __USECONDS_T_TYPE	__U32_TYPE |
| 52 | 52 | #define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE |
| 53 | #define __SUSECONDS64_T_TYPE	__SQUAD_TYPE | |
| 53 | 54 | #define __DADDR_T_TYPE		__S32_TYPE |
| 54 | 55 | #define __KEY_T_TYPE		__S32_TYPE |
| 55 | 56 | #define __CLOCKID_T_TYPE	__S32_TYPE |
| ... | ... | @@ -81,10 +82,16 @@ |
| 81 | 82 | |
| 82 | 83 | /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ |
| 83 | 84 | # define __STATFS_MATCHES_STATFS64 1 |
| 85 | ||
| 86 | /* And for getitimer, setitimer and rusage */ | |
| 87 | # define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 | |
| 84 | 88 | #else |
| 85 | 89 | # define __RLIM_T_MATCHES_RLIM64_T	0 |
| 86 | 90 | |
| 87 | 91 | # define __STATFS_MATCHES_STATFS64 0 |
| 92 | ||
| 93 | /* And for getitimer, setitimer and rusage */ | |
| 94 | # define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 | |
| 88 | 95 | #endif |
| 89 | 96 | |
| 90 | 97 | /* Number of descriptors that can fit in an `fd_set'. */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/kernel-features.h+3-3| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. S/390 version. |
| 3 | Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -23,8 +23,6 @@ |
| 23 | 23 | # define __ASSUME_SOCKETPAIR_SYSCALL 1 |
| 24 | 24 | # define __ASSUME_BIND_SYSCALL 1 |
| 25 | 25 | # define __ASSUME_LISTEN_SYSCALL 1 |
| 26 | # define __ASSUME_GETSOCKOPT_SYSCALL 1 | |
| 27 | # define __ASSUME_SETSOCKOPT_SYSCALL 1 | |
| 28 | 26 | # define __ASSUME_GETSOCKNAME_SYSCALL 1 |
| 29 | 27 | # define __ASSUME_GETPEERNAME_SYSCALL 1 |
| 30 | 28 | # define __ASSUME_SHUTDOWN_SYSCALL 1 |
| ... | ... | @@ -43,6 +41,8 @@ |
| 43 | 41 | # undef __ASSUME_CONNECT_SYSCALL |
| 44 | 42 | # undef __ASSUME_RECVFROM_SYSCALL |
| 45 | 43 | # undef __ASSUME_SENDTO_SYSCALL |
| 44 | # undef __ASSUME_GETSOCKOPT_SYSCALL | |
| 45 | # undef __ASSUME_SETSOCKOPT_SYSCALL | |
| 46 | 46 | #endif |
| 47 | 47 | |
| 48 | 48 | /* s390 only supports ipc syscall before 5.1. */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-32/kernel_stat.h created+40| ... | ... | @@ -0,0 +1,40 @@ |
| 1 | /* Definition of `struct stat' used in the kernel.. */ | |
| 2 | struct kernel_stat | |
| 3 | { | |
| 4 | unsigned short int st_dev; | |
| 5 | unsigned short int __pad1; | |
| 6 | #define _HAVE___PAD1 | |
| 7 | unsigned long int st_ino; | |
| 8 | unsigned short int st_mode; | |
| 9 | unsigned short int st_nlink; | |
| 10 | unsigned short int st_uid; | |
| 11 | unsigned short int st_gid; | |
| 12 | unsigned short int st_rdev; | |
| 13 | unsigned short int __pad2; | |
| 14 | #define _HAVE___PAD2 | |
| 15 | unsigned long int st_size; | |
| 16 | unsigned long int st_blksize; | |
| 17 | unsigned long int st_blocks; | |
| 18 | struct timespec st_atim; | |
| 19 | struct timespec st_mtim; | |
| 20 | struct timespec st_ctim; | |
| 21 | unsigned long int __glibc_reserved4; | |
| 22 | #define _HAVE___UNUSED4 | |
| 23 | unsigned long int __glibc_reserved5; | |
| 24 | #define _HAVE___UNUSED5 | |
| 25 | }; | |
| 26 | ||
| 27 | #define _HAVE_STAT___UNUSED4 | |
| 28 | #define _HAVE_STAT___UNUSED5 | |
| 29 | #define _HAVE_STAT___PAD1 | |
| 30 | #define _HAVE_STAT___PAD2 | |
| 31 | #define _HAVE_STAT_NSEC | |
| 32 | #define _HAVE_STAT64___PAD1 | |
| 33 | #define _HAVE_STAT64___PAD2 | |
| 34 | #define _HAVE_STAT64___ST_INO | |
| 35 | #define _HAVE_STAT64_NSEC | |
| 36 | ||
| 37 | #define STAT_IS_KERNEL_STAT 0 | |
| 38 | #define STAT64_IS_KERNEL_STAT64 1 | |
| 39 | #define XSTAT_IS_XSTAT64 0 | |
| 40 | #define STATFS_IS_STATFS64 0 |
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h+10-100| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 2 | 2 | Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| ... | ... | @@ -26,11 +26,6 @@ |
| 26 | 26 | #include <dl-sysdep.h>	/* For RTLD_PRIVATE_ERRNO. */ |
| 27 | 27 | #include <tls.h> |
| 28 | 28 | |
| 29 | /* Define __set_errno() for INLINE_SYSCALL macro below. */ | |
| 30 | #ifndef __ASSEMBLER__ | |
| 31 | #include <errno.h> | |
| 32 | #endif | |
| 33 | ||
| 34 | 29 | /* For Linux we can use the system call table in the header file |
| 35 | 30 | 	/usr/include/asm/unistd.h |
| 36 | 31 | of the kernel. But these symbols do not follow the SYS_* syntax |
| ... | ... | @@ -38,9 +33,6 @@ |
| 38 | 33 | /* in newer 2.1 kernels __NR_syscall is missing so we define it here */ |
| 39 | 34 | #define __NR_syscall 0 |
| 40 | 35 | |
| 41 | #undef SYS_ify | |
| 42 | #define SYS_ify(syscall_name)	__NR_##syscall_name | |
| 43 | ||
| 44 | 36 | #ifdef __ASSEMBLER__ |
| 45 | 37 | |
| 46 | 38 | /* Linux uses a negative return value to indicate syscall errors, unlike |
| ... | ... | @@ -88,7 +80,9 @@ |
| 88 | 80 | #define PSEUDO_END_ERRVAL(name)						 \ |
| 89 | 81 | END (name) |
| 90 | 82 | |
| 83 | #undef SYSCALL_ERROR_LABEL | |
| 91 | 84 | #ifndef PIC |
| 85 | # undef SYSCALL_ERROR_LABEL | |
| 92 | 86 | # define SYSCALL_ERROR_LABEL 0f |
| 93 | 87 | # define SYSCALL_ERROR_HANDLER \ |
| 94 | 88 | 0: basr %r1,0;							 \ |
| ... | ... | @@ -97,6 +91,7 @@ |
| 97 | 91 | 2: .long syscall_error |
| 98 | 92 | #else |
| 99 | 93 | # if RTLD_PRIVATE_ERRNO |
| 94 | # undef SYSCALL_ERROR_LABEL | |
| 100 | 95 | # define SYSCALL_ERROR_LABEL 0f |
| 101 | 96 | # define SYSCALL_ERROR_HANDLER \ |
| 102 | 97 | 0: basr %r1,0;							 \ |
| ... | ... | @@ -112,6 +107,7 @@ |
| 112 | 107 | # else |
| 113 | 108 | # define SYSCALL_ERROR_ERRNO errno |
| 114 | 109 | # endif |
| 110 | # undef SYSCALL_ERROR_LABEL | |
| 115 | 111 | # define SYSCALL_ERROR_LABEL 0f |
| 116 | 112 | # define SYSCALL_ERROR_HANDLER \ |
| 117 | 113 | 0: lcr %r0,%r2;							 \ |
| ... | ... | @@ -124,6 +120,7 @@ |
| 124 | 120 | br %r14;								 \ |
| 125 | 121 | 2: .long _GLOBAL_OFFSET_TABLE_-1b |
| 126 | 122 | # else |
| 123 | # undef SYSCALL_ERROR_LABEL | |
| 127 | 124 | # define SYSCALL_ERROR_LABEL 0f |
| 128 | 125 | # define SYSCALL_ERROR_HANDLER \ |
| 129 | 126 | 0: basr %r1,0;							 \ |
| ... | ... | @@ -178,99 +175,12 @@ |
| 178 | 175 | #define ret_ERRVAL							 \ |
| 179 | 176 | br 14 |
| 180 | 177 | |
| 181 | #endif /* __ASSEMBLER__ */ | |
| 182 | ||
| 183 | #undef INLINE_SYSCALL | |
| 184 | #define INLINE_SYSCALL(name, nr, args...)				 \ | |
| 185 | ({									 \ | |
| 186 | unsigned int _ret = INTERNAL_SYSCALL (name, , nr, args);		 \ | |
| 187 | if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (_ret, )))		 \ | |
| 188 | {									 \ | |
| 189 | __set_errno (INTERNAL_SYSCALL_ERRNO (_ret, ));			 \ | |
| 190 | _ret = 0xffffffff;						 \ | |
| 191 | }									 \ | |
| 192 | (int) _ret; }) | |
| 193 | ||
| 194 | #undef INTERNAL_SYSCALL_DECL | |
| 195 | #define INTERNAL_SYSCALL_DECL(err) do { } while (0) | |
| 196 | ||
| 197 | #undef INTERNAL_SYSCALL_DIRECT | |
| 198 | #define INTERNAL_SYSCALL_DIRECT(name, err, nr, args...)			 \ | |
| 199 | ({									 \ | |
| 200 | DECLARGS_##nr(args)							 \ | |
| 201 | register int _ret __asm__("2");					 \ | |
| 202 | __asm__ __volatile__ (						 \ | |
| 203 | 			 "svc %b1\n\t"				 \ | |
| 204 | 			 : "=d" (_ret)					 \ | |
| 205 | 			 : "i" (__NR_##name) ASMFMT_##nr		 \ | |
| 206 | 			 : "memory" );					 \ | |
| 207 | _ret; }) | |
| 208 | ||
| 209 | #undef INTERNAL_SYSCALL_SVC0 | |
| 210 | #define INTERNAL_SYSCALL_SVC0(name, err, nr, args...)			 \ | |
| 211 | ({									 \ | |
| 212 | DECLARGS_##nr(args)							 \ | |
| 213 | register unsigned long _nr __asm__("1") = (unsigned long)(__NR_##name); \ | |
| 214 | register int _ret __asm__("2");					 \ | |
| 215 | __asm__ __volatile__ (						 \ | |
| 216 | 			 "svc 0\n\t"				 \ | |
| 217 | 			 : "=d" (_ret)					 \ | |
| 218 | 			 : "d" (_nr) ASMFMT_##nr			 \ | |
| 219 | 			 : "memory" );					 \ | |
| 220 | _ret; }) | |
| 221 | ||
| 222 | #undef INTERNAL_SYSCALL_NCS | |
| 223 | #define INTERNAL_SYSCALL_NCS(no, err, nr, args...)			 \ | |
| 224 | ({									 \ | |
| 225 | DECLARGS_##nr(args)							 \ | |
| 226 | register unsigned long _nr __asm__("1") = (unsigned long)(no);	 \ | |
| 227 | register int _ret __asm__("2");					 \ | |
| 228 | __asm__ __volatile__ (						 \ | |
| 229 | 			 "svc 0\n\t"				 \ | |
| 230 | 			 : "=d" (_ret)					 \ | |
| 231 | 			 : "d" (_nr) ASMFMT_##nr			 \ | |
| 232 | 			 : "memory" );					 \ | |
| 233 | _ret; }) | |
| 234 | ||
| 235 | #undef INTERNAL_SYSCALL | |
| 236 | #define INTERNAL_SYSCALL(name, err, nr, args...)			 \ | |
| 237 | (((__NR_##name) < 256)						 \ | |
| 238 | ? INTERNAL_SYSCALL_DIRECT(name, err, nr, args)			 \ | |
| 239 | : INTERNAL_SYSCALL_SVC0(name, err,nr, args)) | |
| 240 | ||
| 241 | #undef INTERNAL_SYSCALL_ERROR_P | |
| 242 | #define INTERNAL_SYSCALL_ERROR_P(val, err)				 \ | |
| 243 | ((unsigned int) (val) >= 0xfffff001u) | |
| 244 | ||
| 245 | #undef INTERNAL_SYSCALL_ERRNO | |
| 246 | #define INTERNAL_SYSCALL_ERRNO(val, err)	(-(val)) | |
| 178 | #else | |
| 247 | 179 | |
| 248 | #define DECLARGS_0() | |
| 249 | #define DECLARGS_1(arg1) \ | |
| 250 | 	register unsigned long gpr2 __asm__ ("2") = (unsigned long)(arg1); | |
| 251 | #define DECLARGS_2(arg1, arg2) \ | |
| 252 | 	DECLARGS_1(arg1) \ | |
| 253 | 	register unsigned long gpr3 __asm__ ("3") = (unsigned long)(arg2); | |
| 254 | #define DECLARGS_3(arg1, arg2, arg3) \ | |
| 255 | 	DECLARGS_2(arg1, arg2) \ | |
| 256 | 	register unsigned long gpr4 __asm__ ("4") = (unsigned long)(arg3); | |
| 257 | #define DECLARGS_4(arg1, arg2, arg3, arg4) \ | |
| 258 | 	DECLARGS_3(arg1, arg2, arg3) \ | |
| 259 | 	register unsigned long gpr5 __asm__ ("5") = (unsigned long)(arg4); | |
| 260 | #define DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \ | |
| 261 | 	DECLARGS_4(arg1, arg2, arg3, arg4) \ | |
| 262 | 	register unsigned long gpr6 __asm__ ("6") = (unsigned long)(arg5); | |
| 263 | #define DECLARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \ | |
| 264 | 	DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \ | |
| 265 | 	register unsigned long gpr7 __asm__ ("7") = (unsigned long)(arg6); | |
| 180 | # undef HAVE_INTERNAL_BRK_ADDR_SYMBOL | |
| 181 | # define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 | |
| 266 | 182 | |
| 267 | #define ASMFMT_0 | |
| 268 | #define ASMFMT_1 , "0" (gpr2) | |
| 269 | #define ASMFMT_2 , "0" (gpr2), "d" (gpr3) | |
| 270 | #define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4) | |
| 271 | #define ASMFMT_4 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5) | |
| 272 | #define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6) | |
| 273 | #define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7) | |
| 183 | #endif /* __ASSEMBLER__ */ | |
| 274 | 184 | |
| 275 | 185 | /* Pointer mangling support. */ |
| 276 | 186 | #if IS_IN (rtld) |
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h+10-110| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembler macros for 64 bit S/390. |
| 2 | Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2001-2021 Free Software Foundation, Inc. | |
| 3 | 3 | Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| ... | ... | @@ -27,11 +27,6 @@ |
| 27 | 27 | #include <dl-sysdep.h>	/* For RTLD_PRIVATE_ERRNO. */ |
| 28 | 28 | #include <tls.h> |
| 29 | 29 | |
| 30 | /* Define __set_errno() for INLINE_SYSCALL macro below. */ | |
| 31 | #ifndef __ASSEMBLER__ | |
| 32 | #include <errno.h> | |
| 33 | #endif | |
| 34 | ||
| 35 | 30 | /* For Linux we can use the system call table in the header file |
| 36 | 31 | 	/usr/include/asm/unistd.h |
| 37 | 32 | of the kernel. But these symbols do not follow the SYS_* syntax |
| ... | ... | @@ -39,17 +34,6 @@ |
| 39 | 34 | /* In newer 2.1 kernels __NR_syscall is missing so we define it here. */ |
| 40 | 35 | #define __NR_syscall 0 |
| 41 | 36 | |
| 42 | /* | |
| 43 | * Newer kernel versions redefined __NR_pread and __NR_pwrite to | |
| 44 | * __NR_pread64 and __NR_pwrite64. | |
| 45 | */ | |
| 46 | #ifndef __NR_pread | |
| 47 | # define __NR_pread __NR_pread64 | |
| 48 | #endif | |
| 49 | #ifndef __NR_pwrite | |
| 50 | # define __NR_pwrite __NR_pwrite64 | |
| 51 | #endif | |
| 52 | ||
| 53 | 37 | #undef SYS_ify |
| 54 | 38 | #define SYS_ify(syscall_name)	__NR_##syscall_name |
| 55 | 39 | |
| ... | ... | @@ -102,11 +86,14 @@ |
| 102 | 86 | SYSCALL_ERROR_HANDLER;						 \ |
| 103 | 87 | END (name) |
| 104 | 88 | |
| 89 | #undef SYSCALL_ERROR_LABEL | |
| 105 | 90 | #ifndef PIC |
| 91 | # undef SYSCALL_ERROR_LABEL | |
| 106 | 92 | # define SYSCALL_ERROR_LABEL syscall_error |
| 107 | 93 | # define SYSCALL_ERROR_HANDLER |
| 108 | 94 | #else |
| 109 | 95 | # if RTLD_PRIVATE_ERRNO |
| 96 | # undef SYSCALL_ERROR_LABEL | |
| 110 | 97 | # define SYSCALL_ERROR_LABEL 0f |
| 111 | 98 | # define SYSCALL_ERROR_HANDLER \ |
| 112 | 99 | 0: larl %r1,rtld_errno;						 \ |
| ... | ... | @@ -120,6 +107,7 @@ |
| 120 | 107 | # else |
| 121 | 108 | # define SYSCALL_ERROR_ERRNO errno |
| 122 | 109 | # endif |
| 110 | # undef SYSCALL_ERROR_LABEL | |
| 123 | 111 | # define SYSCALL_ERROR_LABEL 0f |
| 124 | 112 | # define SYSCALL_ERROR_HANDLER \ |
| 125 | 113 | 0: lcr %r0,%r2;							 \ |
| ... | ... | @@ -132,6 +120,7 @@ |
| 132 | 120 | lghi %r2,-1;							 \ |
| 133 | 121 | br %r14 |
| 134 | 122 | # else |
| 123 | # undef SYSCALL_ERROR_LABEL | |
| 135 | 124 | # define SYSCALL_ERROR_LABEL 0f |
| 136 | 125 | # define SYSCALL_ERROR_HANDLER \ |
| 137 | 126 | 0: larl %r1,_GLOBAL_OFFSET_TABLE_;					 \ |
| ... | ... | @@ -184,101 +173,12 @@ |
| 184 | 173 | #define ret_ERRVAL							 \ |
| 185 | 174 | br	 14 |
| 186 | 175 | |
| 187 | #endif /* __ASSEMBLER__ */ | |
| 188 | ||
| 189 | #undef INLINE_SYSCALL | |
| 190 | #define INLINE_SYSCALL(name, nr, args...)				 \ | |
| 191 | ({									 \ | |
| 192 | long _ret = INTERNAL_SYSCALL (name, , nr, args);			 \ | |
| 193 | if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (_ret, )))		 \ | |
| 194 | {									 \ | |
| 195 | __set_errno (INTERNAL_SYSCALL_ERRNO (_ret, ));			 \ | |
| 196 | _ret = -1;							 \ | |
| 197 | }									 \ | |
| 198 | _ret; }) | |
| 199 | ||
| 200 | #undef INTERNAL_SYSCALL_DECL | |
| 201 | #define INTERNAL_SYSCALL_DECL(err) do { } while (0) | |
| 202 | ||
| 203 | #undef INTERNAL_SYSCALL_DIRECT | |
| 204 | #define INTERNAL_SYSCALL_DIRECT(name, err, nr, args...)			 \ | |
| 205 | ({									 \ | |
| 206 | DECLARGS_##nr(args)							 \ | |
| 207 | register long _ret __asm__("2");					 \ | |
| 208 | __asm__ __volatile__ (						 \ | |
| 209 | 			 "svc %b1\n\t"				 \ | |
| 210 | 			 : "=d" (_ret)					 \ | |
| 211 | 			 : "i" (__NR_##name) ASMFMT_##nr		 \ | |
| 212 | 			 : "memory" );					 \ | |
| 213 | _ret; }) | |
| 214 | ||
| 215 | #undef INTERNAL_SYSCALL_SVC0 | |
| 216 | #define INTERNAL_SYSCALL_SVC0(name, err, nr, args...)			 \ | |
| 217 | ({									 \ | |
| 218 | DECLARGS_##nr(args)							 \ | |
| 219 | register unsigned long _nr __asm__("1") = (unsigned long)(__NR_##name); \ | |
| 220 | register long _ret __asm__("2");					 \ | |
| 221 | __asm__ __volatile__ (						 \ | |
| 222 | 			 "svc 0\n\t"				 \ | |
| 223 | 			 : "=d" (_ret)					 \ | |
| 224 | 			 : "d" (_nr) ASMFMT_##nr			 \ | |
| 225 | 			 : "memory" );					 \ | |
| 226 | _ret; }) | |
| 227 | ||
| 228 | #undef INTERNAL_SYSCALL_NCS | |
| 229 | #define INTERNAL_SYSCALL_NCS(no, err, nr, args...)			 \ | |
| 230 | ({									 \ | |
| 231 | DECLARGS_##nr(args)							 \ | |
| 232 | register unsigned long _nr __asm__("1") = (unsigned long)(no);	 \ | |
| 233 | register long _ret __asm__("2");					 \ | |
| 234 | __asm__ __volatile__ (						 \ | |
| 235 | 			 "svc 0\n\t"				 \ | |
| 236 | 			 : "=d" (_ret)					 \ | |
| 237 | 			 : "d" (_nr) ASMFMT_##nr			 \ | |
| 238 | 			 : "memory" );					 \ | |
| 239 | _ret; }) | |
| 240 | ||
| 241 | #undef INTERNAL_SYSCALL | |
| 242 | #define INTERNAL_SYSCALL(name, err, nr, args...)			 \ | |
| 243 | (((__NR_##name) < 256)						 \ | |
| 244 | ? INTERNAL_SYSCALL_DIRECT(name, err, nr, args)			 \ | |
| 245 | : INTERNAL_SYSCALL_SVC0(name, err,nr, args)) | |
| 246 | ||
| 247 | #undef INTERNAL_SYSCALL_ERROR_P | |
| 248 | #define INTERNAL_SYSCALL_ERROR_P(val, err)				 \ | |
| 249 | ((unsigned long) (val) >= -4095UL) | |
| 250 | ||
| 251 | #undef INTERNAL_SYSCALL_ERRNO | |
| 252 | #define INTERNAL_SYSCALL_ERRNO(val, err)	(-(val)) | |
| 253 | ||
| 254 | #define DECLARGS_0() | |
| 255 | #define DECLARGS_1(arg1) \ | |
| 256 | 	register unsigned long gpr2 __asm__ ("2") = (unsigned long)(arg1); | |
| 257 | #define DECLARGS_2(arg1, arg2) \ | |
| 258 | 	DECLARGS_1(arg1) \ | |
| 259 | 	register unsigned long gpr3 __asm__ ("3") = (unsigned long)(arg2); | |
| 260 | #define DECLARGS_3(arg1, arg2, arg3) \ | |
| 261 | 	DECLARGS_2(arg1, arg2) \ | |
| 262 | 	register unsigned long gpr4 __asm__ ("4") = (unsigned long)(arg3); | |
| 263 | #define DECLARGS_4(arg1, arg2, arg3, arg4) \ | |
| 264 | 	DECLARGS_3(arg1, arg2, arg3) \ | |
| 265 | 	register unsigned long gpr5 __asm__ ("5") = (unsigned long)(arg4); | |
| 266 | #define DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \ | |
| 267 | 	DECLARGS_4(arg1, arg2, arg3, arg4) \ | |
| 268 | 	register unsigned long gpr6 __asm__ ("6") = (unsigned long)(arg5); | |
| 269 | #define DECLARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \ | |
| 270 | 	DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \ | |
| 271 | 	register unsigned long gpr7 __asm__ ("7") = (unsigned long)(arg6); | |
| 176 | #else | |
| 272 | 177 | |
| 273 | #define ASMFMT_0 | |
| 274 | #define ASMFMT_1 , "0" (gpr2) | |
| 275 | #define ASMFMT_2 , "0" (gpr2), "d" (gpr3) | |
| 276 | #define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4) | |
| 277 | #define ASMFMT_4 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5) | |
| 278 | #define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6) | |
| 279 | #define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7) | |
| 178 | # undef HAVE_INTERNAL_BRK_ADDR_SYMBOL | |
| 179 | # define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 | |
| 280 | 180 | |
| 281 | #define SINGLE_THREAD_BY_GLOBAL		1 | |
| 181 | #endif /* __ASSEMBLER__ */ | |
| 282 | 182 | |
| 283 | 183 | /* Pointer mangling support. */ |
| 284 | 184 | #if IS_IN (rtld) |
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sys/elf.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sysdep.h created+113| ... | ... | @@ -0,0 +1,113 @@ |
| 1 | /* Syscall definitions, Linux s390 version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __ASSEMBLY__ | |
| 20 | ||
| 21 | #undef SYS_ify | |
| 22 | #define SYS_ify(syscall_name)	__NR_##syscall_name | |
| 23 | ||
| 24 | #undef INTERNAL_SYSCALL_DIRECT | |
| 25 | #define INTERNAL_SYSCALL_DIRECT(name, nr, args...)			 \ | |
| 26 | ({									 \ | |
| 27 | DECLARGS_##nr(args)							 \ | |
| 28 | register long int _ret __asm__("2");				 \ | |
| 29 | __asm__ __volatile__ (						 \ | |
| 30 | 			 "svc %b1\n\t"				 \ | |
| 31 | 			 : "=d" (_ret)					 \ | |
| 32 | 			 : "i" (__NR_##name) ASMFMT_##nr		 \ | |
| 33 | 			 : "memory" );					 \ | |
| 34 | _ret; }) | |
| 35 | ||
| 36 | #undef INTERNAL_SYSCALL_SVC0 | |
| 37 | #define INTERNAL_SYSCALL_SVC0(name, nr, args...)			 \ | |
| 38 | ({									 \ | |
| 39 | DECLARGS_##nr(args)							 \ | |
| 40 | register unsigned long int _nr __asm__("1") =			 \ | |
| 41 | (unsigned long int)(__NR_##name);					 \ | |
| 42 | register long int _ret __asm__("2");				 \ | |
| 43 | __asm__ __volatile__ (						 \ | |
| 44 | 			 "svc 0\n\t"				 \ | |
| 45 | 			 : "=d" (_ret)					 \ | |
| 46 | 			 : "d" (_nr) ASMFMT_##nr			 \ | |
| 47 | 			 : "memory" );					 \ | |
| 48 | _ret; }) | |
| 49 | ||
| 50 | #undef INTERNAL_SYSCALL_NCS | |
| 51 | #define INTERNAL_SYSCALL_NCS(no, nr, args...)				 \ | |
| 52 | ({									 \ | |
| 53 | DECLARGS_##nr(args)							 \ | |
| 54 | register unsigned long int _nr __asm__("1") = (unsigned long int)(no); \ | |
| 55 | register long int _ret __asm__("2");				 \ | |
| 56 | __asm__ __volatile__ (						 \ | |
| 57 | 			 "svc 0\n\t"				 \ | |
| 58 | 			 : "=d" (_ret)					 \ | |
| 59 | 			 : "d" (_nr) ASMFMT_##nr			 \ | |
| 60 | 			 : "memory" );					 \ | |
| 61 | _ret; }) | |
| 62 | ||
| 63 | #undef INTERNAL_SYSCALL | |
| 64 | #define INTERNAL_SYSCALL(name, nr, args...)				 \ | |
| 65 | (((__NR_##name) < 256)						 \ | |
| 66 | ? INTERNAL_SYSCALL_DIRECT(name, nr, args)				 \ | |
| 67 | : INTERNAL_SYSCALL_SVC0(name, nr, args)) | |
| 68 | ||
| 69 | #define DECLARGS_0() | |
| 70 | #define DECLARGS_1(arg1) \ | |
| 71 | register unsigned long int gpr2 __asm__ ("2") = (unsigned long int)(arg1); | |
| 72 | #define DECLARGS_2(arg1, arg2) \ | |
| 73 | DECLARGS_1(arg1) \ | |
| 74 | register unsigned long int gpr3 __asm__ ("3") = (unsigned long int)(arg2); | |
| 75 | #define DECLARGS_3(arg1, arg2, arg3) \ | |
| 76 | DECLARGS_2(arg1, arg2) \ | |
| 77 | register unsigned long int gpr4 __asm__ ("4") = (unsigned long int)(arg3); | |
| 78 | #define DECLARGS_4(arg1, arg2, arg3, arg4) \ | |
| 79 | DECLARGS_3(arg1, arg2, arg3) \ | |
| 80 | register unsigned long int gpr5 __asm__ ("5") = (unsigned long int)(arg4); | |
| 81 | #define DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \ | |
| 82 | DECLARGS_4(arg1, arg2, arg3, arg4) \ | |
| 83 | register unsigned long int gpr6 __asm__ ("6") = (unsigned long int)(arg5); | |
| 84 | #define DECLARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \ | |
| 85 | DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \ | |
| 86 | register unsigned long int gpr7 __asm__ ("7") = (unsigned long int)(arg6); | |
| 87 | ||
| 88 | #define ASMFMT_0 | |
| 89 | #define ASMFMT_1 , "0" (gpr2) | |
| 90 | #define ASMFMT_2 , "0" (gpr2), "d" (gpr3) | |
| 91 | #define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4) | |
| 92 | #define ASMFMT_4 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5) | |
| 93 | #define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6) | |
| 94 | #define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7) | |
| 95 | ||
| 96 | #define SINGLE_THREAD_BY_GLOBAL		1 | |
| 97 | ||
| 98 | ||
| 99 | #define VDSO_NAME "LINUX_2.6.29" | |
| 100 | #define VDSO_HASH 123718585 | |
| 101 | ||
| 102 | /* List of system calls which are supported as vsyscalls. */ | |
| 103 | #ifdef __s390x__ | |
| 104 | #define HAVE_CLOCK_GETRES64_VSYSCALL	"__kernel_clock_getres" | |
| 105 | #define HAVE_CLOCK_GETTIME64_VSYSCALL	"__kernel_clock_gettime" | |
| 106 | #else | |
| 107 | #define HAVE_CLOCK_GETRES_VSYSCALL	"__kernel_clock_getres" | |
| 108 | #define HAVE_CLOCK_GETTIME_VSYSCALL	"__kernel_clock_gettime" | |
| 109 | #endif | |
| 110 | #define HAVE_GETTIMEOFDAY_VSYSCALL	"__kernel_gettimeofday" | |
| 111 | #define HAVE_GETCPU_VSYSCALL		"__kernel_getcpu" | |
| 112 | ||
| 113 | #endif |
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/xstatver.h created+19| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | /* Versions of the 'struct stat' data structure used in compatibility xstat | |
| 2 | functions. */ | |
| 3 | ||
| 4 | #include <bits/wordsize.h> | |
| 5 | ||
| 6 | #if __WORDSIZE == 64 | |
| 7 | # define _STAT_VER_KERNEL	0 | |
| 8 | # define _STAT_VER_LINUX	1 | |
| 9 | # define _MKNOD_VER_LINUX	0 | |
| 10 | #else | |
| 11 | # define _STAT_VER_LINUX_OLD	1 | |
| 12 | # define _STAT_VER_KERNEL	1 | |
| 13 | # define _STAT_VER_SVR4		2 | |
| 14 | # define _STAT_VER_LINUX	3 | |
| 15 | # define _MKNOD_VER_LINUX	1 | |
| 16 | # define _MKNOD_VER_SVR4	2 | |
| 17 | #endif | |
| 18 | #define _STAT_VER		_STAT_VER_LINUX | |
| 19 | #define _MKNOD_VER		_MKNOD_VER_LINUX |
lib/libc/glibc/sysdeps/unix/sysv/linux/sh/kernel-features.h+1-3| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. SH version. |
| 3 | Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -33,8 +33,6 @@ |
| 33 | 33 | #define __ASSUME_SEND_SYSCALL		1 |
| 34 | 34 | #define __ASSUME_RECV_SYSCALL		1 |
| 35 | 35 | #define __ASSUME_SHUTDOWN_SYSCALL	1 |
| 36 | #define __ASSUME_GETSOCKOPT_SYSCALL	1 | |
| 37 | #define __ASSUME_SETSOCKOPT_SYSCALL	1 | |
| 38 | 36 | |
| 39 | 37 | #include_next <kernel-features.h> |
| 40 | 38 |
lib/libc/glibc/sysdeps/unix/sysv/linux/sh/kernel_stat.h created+40| ... | ... | @@ -0,0 +1,40 @@ |
| 1 | /* Definition of `struct stat' used in the kernel.. */ | |
| 2 | struct kernel_stat | |
| 3 | { | |
| 4 | unsigned short int st_dev; | |
| 5 | unsigned short int __pad1; | |
| 6 | #define _HAVE___PAD1 | |
| 7 | unsigned long int st_ino; | |
| 8 | unsigned short int st_mode; | |
| 9 | unsigned short int st_nlink; | |
| 10 | unsigned short int st_uid; | |
| 11 | unsigned short int st_gid; | |
| 12 | unsigned short int st_rdev; | |
| 13 | unsigned short int __pad2; | |
| 14 | #define _HAVE___PAD2 | |
| 15 | unsigned long int st_size; | |
| 16 | unsigned long int st_blksize; | |
| 17 | unsigned long int st_blocks; | |
| 18 | struct timespec st_atim; | |
| 19 | struct timespec st_mtim; | |
| 20 | struct timespec st_ctim; | |
| 21 | unsigned long int __glibc_reserved4; | |
| 22 | #define _HAVE___UNUSED4 | |
| 23 | unsigned long int __glibc_reserved5; | |
| 24 | #define _HAVE___UNUSED5 | |
| 25 | }; | |
| 26 | ||
| 27 | #define _HAVE_STAT___UNUSED4 | |
| 28 | #define _HAVE_STAT___UNUSED5 | |
| 29 | #define _HAVE_STAT___PAD1 | |
| 30 | #define _HAVE_STAT___PAD2 | |
| 31 | #define _HAVE_STAT_NSEC | |
| 32 | #define _HAVE_STAT64___PAD1 | |
| 33 | #define _HAVE_STAT64___PAD2 | |
| 34 | #define _HAVE_STAT64___ST_INO | |
| 35 | #define _HAVE_STAT64_NSEC | |
| 36 | ||
| 37 | #define STAT_IS_KERNEL_STAT 0 | |
| 38 | #define STAT64_IS_KERNEL_STAT64 1 | |
| 39 | #define XSTAT_IS_XSTAT64 0 | |
| 40 | #define STATFS_IS_STATFS64 0 |
lib/libc/glibc/sysdeps/unix/sysv/linux/sh/sysdep.h+3-24| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995. |
| 4 | 4 | Changed by Kaz Kojima, <kkojima@rr.iij4u.or.jp>. |
| ... | ... | @@ -287,19 +287,8 @@ |
| 287 | 287 | 	register long int r1 asm ("%r1") = (long int) (_arg6);		 \ |
| 288 | 288 | 	register long int r2 asm ("%r2") = (long int) (_arg7) |
| 289 | 289 | |
| 290 | #undef INLINE_SYSCALL | |
| 291 | #define INLINE_SYSCALL(name, nr, args...) \ | |
| 292 | ({ \ | |
| 293 | unsigned int resultvar = INTERNAL_SYSCALL (name, , nr, args); \ | |
| 294 | if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0)) \ | |
| 295 | { \ | |
| 296 | 	__set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, )); \ | |
| 297 | 	resultvar = 0xffffffff; \ | |
| 298 | } \ | |
| 299 | (int) resultvar; }) | |
| 300 | ||
| 301 | 290 | #undef INTERNAL_SYSCALL |
| 302 | #define INTERNAL_SYSCALL(name, err, nr, args...) \ | |
| 291 | #define INTERNAL_SYSCALL(name, nr, args...) \ | |
| 303 | 292 | ({									 \ |
| 304 | 293 | unsigned long int resultvar;					 \ |
| 305 | 294 | register long int r3 asm ("%r3") = SYS_ify (name);			 \ |
| ... | ... | @@ -313,7 +302,7 @@ |
| 313 | 302 | (int) resultvar; }) |
| 314 | 303 | |
| 315 | 304 | /* The _NCS variant allows non-constant syscall numbers. */ |
| 316 | #define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ | |
| 305 | #define INTERNAL_SYSCALL_NCS(name, nr, args...) \ | |
| 317 | 306 | ({									 \ |
| 318 | 307 | unsigned long int resultvar;					 \ |
| 319 | 308 | register long int r3 asm ("%r3") = (name);				 \ |
| ... | ... | @@ -326,16 +315,6 @@ |
| 326 | 315 | 									 \ |
| 327 | 316 | (int) resultvar; }) |
| 328 | 317 | |
| 329 | #undef INTERNAL_SYSCALL_DECL | |
| 330 | #define INTERNAL_SYSCALL_DECL(err) do { } while (0) | |
| 331 | ||
| 332 | #undef INTERNAL_SYSCALL_ERROR_P | |
| 333 | #define INTERNAL_SYSCALL_ERROR_P(val, err) \ | |
| 334 | ((unsigned int) (val) >= 0xfffff001u) | |
| 335 | ||
| 336 | #undef INTERNAL_SYSCALL_ERRNO | |
| 337 | #define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) | |
| 338 | ||
| 339 | 318 | #endif	/* __ASSEMBLER__ */ |
| 340 | 319 | |
| 341 | 320 | /* Pointer mangling support. */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/single-thread.h+13-31| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Single thread optimization, Linux version. |
| 2 | Copyright (C) 2019-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -27,36 +27,18 @@ |
| 27 | 27 | The ABI might define SINGLE_THREAD_BY_GLOBAL to enable the single thread |
| 28 | 28 | check to use global variables instead of the pthread_t field. */ |
| 29 | 29 | |
| 30 | #ifdef SINGLE_THREAD_BY_GLOBAL | |
| 31 | # if IS_IN (libc) | |
| 30 | #ifndef __ASSEMBLER__ | |
| 32 | 31 | extern int __libc_multiple_threads; |
| 33 | # define SINGLE_THREAD_P \ | |
| 34 | __glibc_likely (__libc_multiple_threads == 0) | |
| 35 | # elif IS_IN (libpthread) | |
| 36 | extern int __pthread_multiple_threads; | |
| 37 | # define SINGLE_THREAD_P \ | |
| 38 | __glibc_likely (__pthread_multiple_threads == 0) | |
| 39 | # elif IS_IN (librt) | |
| 40 | # define SINGLE_THREAD_P					\ | |
| 41 | __glibc_likely (THREAD_GETMEM (THREAD_SELF,			\ | |
| 42 | 				 header.multiple_threads) == 0) | |
| 43 | # else | |
| 44 | /* For rtld, et cetera. */ | |
| 45 | # define SINGLE_THREAD_P (1) | |
| 46 | # endif | |
| 47 | #else /* SINGLE_THREAD_BY_GLOBAL */ | |
| 48 | # if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) | |
| 49 | # define SINGLE_THREAD_P					\ | |
| 50 | __glibc_likely (THREAD_GETMEM (THREAD_SELF,			\ | |
| 51 | 				 header.multiple_threads) == 0) | |
| 52 | # else | |
| 53 | /* For rtld, et cetera. */ | |
| 54 | # define SINGLE_THREAD_P (1) | |
| 55 | # endif | |
| 56 | #endif /* SINGLE_THREAD_BY_GLOBAL */ | |
| 57 | ||
| 58 | #define RTLD_SINGLE_THREAD_P \ | |
| 59 | __glibc_likely (THREAD_GETMEM (THREAD_SELF, \ | |
| 60 | 				 header.multiple_threads) == 0) | |
| 32 | libc_hidden_proto (__libc_multiple_threads) | |
| 33 | #endif | |
| 34 | ||
| 35 | #if !defined SINGLE_THREAD_BY_GLOBAL || IS_IN (rtld) | |
| 36 | # define SINGLE_THREAD_P \ | |
| 37 | (THREAD_GETMEM (THREAD_SELF, header.multiple_threads) == 0) | |
| 38 | #else | |
| 39 | # define SINGLE_THREAD_P (__libc_multiple_threads == 0) | |
| 40 | #endif | |
| 41 | ||
| 42 | #define RTLD_SINGLE_THREAD_P SINGLE_THREAD_P | |
| 61 | 43 | |
| 62 | 44 | #endif /* _SINGLE_THREAD_H */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/bits/stat.h deleted-173| ... | ... | @@ -1,173 +0,0 @@ |
| 1 | /* Copyright (C) 1992-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #if !defined _SYS_STAT_H && !defined _FCNTL_H | |
| 19 | # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #ifndef _BITS_STAT_H | |
| 23 | #define _BITS_STAT_H	1 | |
| 24 | ||
| 25 | /* Versions of the `struct stat' data structure. */ | |
| 26 | #define _STAT_VER_LINUX_OLD	1 | |
| 27 | #define _STAT_VER_KERNEL	1 | |
| 28 | #define _STAT_VER_SVR4		2 | |
| 29 | #define _STAT_VER_LINUX		3 | |
| 30 | #define _STAT_VER		_STAT_VER_LINUX	/* The one defined below. */ | |
| 31 | ||
| 32 | /* Versions of the `xmknod' interface. */ | |
| 33 | #define _MKNOD_VER_LINUX	1 | |
| 34 | #define _MKNOD_VER_SVR4		2 | |
| 35 | #define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below. */ | |
| 36 | ||
| 37 | ||
| 38 | struct stat | |
| 39 | { | |
| 40 | __dev_t st_dev;			/* Device. */ | |
| 41 | #if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64 | |
| 42 | unsigned short int __pad1; | |
| 43 | __ino_t st_ino;			/* File serial number.	*/ | |
| 44 | #else | |
| 45 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 46 | #endif | |
| 47 | __mode_t st_mode;			/* File mode. */ | |
| 48 | __nlink_t st_nlink;			/* Link count. */ | |
| 49 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 50 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 51 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 52 | unsigned short int __pad2; | |
| 53 | #ifndef __USE_FILE_OFFSET64 | |
| 54 | __off_t st_size;			/* Size of file, in bytes. */ | |
| 55 | #else | |
| 56 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 57 | #endif | |
| 58 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 59 | ||
| 60 | #ifndef __USE_FILE_OFFSET64 | |
| 61 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 62 | #else | |
| 63 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 64 | #endif | |
| 65 | #ifdef __USE_XOPEN2K8 | |
| 66 | /* Nanosecond resolution timestamps are stored in a format | |
| 67 | equivalent to 'struct timespec'. This is the type used | |
| 68 | whenever possible but the Unix namespace rules do not allow the | |
| 69 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 70 | Therefore we have to handle the use of this header in strictly | |
| 71 | standard-compliant sources special. */ | |
| 72 | struct timespec st_atim;		/* Time of last access. */ | |
| 73 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 74 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 75 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 76 | # define st_mtime st_mtim.tv_sec | |
| 77 | # define st_ctime st_ctim.tv_sec | |
| 78 | #else | |
| 79 | __time_t st_atime;			/* Time of last access. */ | |
| 80 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 81 | __time_t st_mtime;			/* Time of last modification. */ | |
| 82 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 83 | __time_t st_ctime;			/* Time of last status change. */ | |
| 84 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 85 | #endif | |
| 86 | unsigned long int __glibc_reserved4; | |
| 87 | unsigned long int __glibc_reserved5; | |
| 88 | }; | |
| 89 | ||
| 90 | #ifdef __USE_LARGEFILE64 | |
| 91 | struct stat64 | |
| 92 | { | |
| 93 | __dev_t st_dev;			/* Device. */ | |
| 94 | # if __WORDSIZE == 64 | |
| 95 | unsigned short int __pad1; | |
| 96 | # endif | |
| 97 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 98 | __mode_t st_mode;			/* File mode. */ | |
| 99 | __nlink_t st_nlink;			/* Link count. */ | |
| 100 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 101 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 102 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 103 | unsigned short int __pad2; | |
| 104 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 105 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 106 | ||
| 107 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 108 | # ifdef __USE_XOPEN2K8 | |
| 109 | /* Nanosecond resolution timestamps are stored in a format | |
| 110 | equivalent to 'struct timespec'. This is the type used | |
| 111 | whenever possible but the Unix namespace rules do not allow the | |
| 112 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 113 | Therefore we have to handle the use of this header in strictly | |
| 114 | standard-compliant sources special. */ | |
| 115 | struct timespec st_atim;		/* Time of last access. */ | |
| 116 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 117 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 118 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 119 | # define st_mtime st_mtim.tv_sec | |
| 120 | # define st_ctime st_ctim.tv_sec | |
| 121 | # else | |
| 122 | __time_t st_atime;			/* Time of last access. */ | |
| 123 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 124 | __time_t st_mtime;			/* Time of last modification. */ | |
| 125 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 126 | __time_t st_ctime;			/* Time of last status change. */ | |
| 127 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 128 | # endif | |
| 129 | unsigned long int __glibc_reserved4; | |
| 130 | unsigned long int __glibc_reserved5; | |
| 131 | }; | |
| 132 | #endif | |
| 133 | ||
| 134 | /* Tell code we have these members. */ | |
| 135 | #define	_STATBUF_ST_BLKSIZE | |
| 136 | #define _STATBUF_ST_RDEV | |
| 137 | /* Nanosecond resolution time values are supported. */ | |
| 138 | #define _STATBUF_ST_NSEC | |
| 139 | ||
| 140 | /* Encoding of the file mode. */ | |
| 141 | ||
| 142 | #define	__S_IFMT	0170000	/* These bits determine file type. */ | |
| 143 | ||
| 144 | /* File types. */ | |
| 145 | #define	__S_IFDIR	0040000	/* Directory. */ | |
| 146 | #define	__S_IFCHR	0020000	/* Character device. */ | |
| 147 | #define	__S_IFBLK	0060000	/* Block device. */ | |
| 148 | #define	__S_IFREG	0100000	/* Regular file. */ | |
| 149 | #define	__S_IFIFO	0010000	/* FIFO. */ | |
| 150 | #define	__S_IFLNK	0120000	/* Symbolic link. */ | |
| 151 | #define	__S_IFSOCK	0140000	/* Socket. */ | |
| 152 | ||
| 153 | /* POSIX.1b objects. Note that these macros always evaluate to zero. But | |
| 154 | they do it by enforcing the correct use of the macros. */ | |
| 155 | #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 156 | #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 157 | #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 158 | ||
| 159 | /* Protection bits. */ | |
| 160 | ||
| 161 | #define	__S_ISUID	04000	/* Set user ID on execution. */ | |
| 162 | #define	__S_ISGID	02000	/* Set group ID on execution. */ | |
| 163 | #define	__S_ISVTX	01000	/* Save swapped text after use (sticky). */ | |
| 164 | #define	__S_IREAD	0400	/* Read by owner. */ | |
| 165 | #define	__S_IWRITE	0200	/* Write by owner. */ | |
| 166 | #define	__S_IEXEC	0100	/* Execute by owner. */ | |
| 167 | ||
| 168 | #ifdef __USE_ATFILE | |
| 169 | # define UTIME_NOW	((1l << 30) - 1l) | |
| 170 | # define UTIME_OMIT	((1l << 30) - 2l) | |
| 171 | #endif | |
| 172 | ||
| 173 | #endif	/* bits/stat.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h+8-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* bits/typesizes.h -- underlying types for *_t. Linux/SPARC version. |
| 2 | Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -50,6 +50,7 @@ |
| 50 | 50 | #define __TIME_T_TYPE		__SLONGWORD_TYPE |
| 51 | 51 | #define __USECONDS_T_TYPE	__U32_TYPE |
| 52 | 52 | #define __SUSECONDS_T_TYPE	__S32_TYPE |
| 53 | #define __SUSECONDS64_T_TYPE	__SQUAD_TYPE | |
| 53 | 54 | #define __DADDR_T_TYPE		__S32_TYPE |
| 54 | 55 | #define __KEY_T_TYPE		__S32_TYPE |
| 55 | 56 | #define __CLOCKID_T_TYPE	__S32_TYPE |
| ... | ... | @@ -75,10 +76,16 @@ |
| 75 | 76 | |
| 76 | 77 | /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ |
| 77 | 78 | # define __STATFS_MATCHES_STATFS64 1 |
| 79 | ||
| 80 | /* And for getitimer, setitimer and rusage */ | |
| 81 | # define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 | |
| 78 | 82 | #else |
| 79 | 83 | # define __RLIM_T_MATCHES_RLIM64_T	0 |
| 80 | 84 | |
| 81 | 85 | # define __STATFS_MATCHES_STATFS64 0 |
| 86 | ||
| 87 | /* And for getitimer, setitimer and rusage */ | |
| 88 | # define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 | |
| 82 | 89 | #endif |
| 83 | 90 | |
| 84 | 91 | /* Number of descriptors that can fit in an `fd_set'. */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/kernel-features.h+3-3| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. SPARC version. |
| 3 | Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -38,10 +38,11 @@ |
| 38 | 38 | # undef __ASSUME_CONNECT_SYSCALL |
| 39 | 39 | # undef __ASSUME_RECVFROM_SYSCALL |
| 40 | 40 | # undef __ASSUME_SENDTO_SYSCALL |
| 41 | # undef __ASSUME_GETSOCKOPT_SYSCALL | |
| 42 | # undef __ASSUME_SETSOCKOPT_SYSCALL | |
| 41 | 43 | #else |
| 42 | 44 | # define __ASSUME_SOCKET_SYSCALL 1 |
| 43 | 45 | # define __ASSUME_SOCKETPAIR_SYSCALL 1 |
| 44 | # define __ASSUME_GETSOCKOPT_SYSCALL 1 | |
| 45 | 46 | # define __ASSUME_SHUTDOWN_SYSCALL 1 |
| 46 | 47 | #endif |
| 47 | 48 | |
| ... | ... | @@ -49,7 +50,6 @@ |
| 49 | 50 | #if __LINUX_KERNEL_VERSION >= 0x040400 |
| 50 | 51 | # define __ASSUME_BIND_SYSCALL 1 |
| 51 | 52 | # define __ASSUME_LISTEN_SYSCALL 1 |
| 52 | # define __ASSUME_SETSOCKOPT_SYSCALL 1 | |
| 53 | 53 | #endif |
| 54 | 54 | |
| 55 | 55 | #ifdef __arch64__ |
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h created+37| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | /* Definition of `struct stat' used in the kernel */ | |
| 2 | struct kernel_stat | |
| 3 | { | |
| 4 | unsigned short int st_dev; | |
| 5 | unsigned long int st_ino; | |
| 6 | unsigned short int st_mode; | |
| 7 | short int st_nlink; | |
| 8 | unsigned short int st_uid; | |
| 9 | unsigned short int st_gid; | |
| 10 | unsigned short int st_rdev; | |
| 11 | long int st_size; | |
| 12 | struct timespec st_atim; | |
| 13 | struct timespec st_mtim; | |
| 14 | struct timespec st_ctim; | |
| 15 | long int st_blksize; | |
| 16 | long int st_blocks; | |
| 17 | unsigned long int __glibc_reserved4; | |
| 18 | unsigned long int __glibc_reserved5; | |
| 19 | }; | |
| 20 | ||
| 21 | #define _HAVE___UNUSED4 | |
| 22 | #define _HAVE___UNUSED5 | |
| 23 | ||
| 24 | #define _HAVE_STAT___UNUSED4 | |
| 25 | #define _HAVE_STAT___UNUSED5 | |
| 26 | #define _HAVE_STAT___PAD1 | |
| 27 | #define _HAVE_STAT___PAD2 | |
| 28 | #define _HAVE_STAT64___UNUSED4 | |
| 29 | #define _HAVE_STAT64___UNUSED5 | |
| 30 | #define _HAVE_STAT64___PAD2 | |
| 31 | #define _HAVE_STAT_NSEC | |
| 32 | #define _HAVE_STAT64_NSEC | |
| 33 | ||
| 34 | #define STAT_IS_KERNEL_STAT 0 | |
| 35 | #define STAT64_IS_KERNEL_STAT64 1 | |
| 36 | #define XSTAT_IS_XSTAT64 0 | |
| 37 | #define STATFS_IS_STATFS64 0 |
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h+5-3| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, January 1997. |
| 4 | 4 | |
| ... | ... | @@ -110,9 +110,8 @@ ENTRY(name);					\ |
| 110 | 110 | #define __SYSCALL_STRING						\ |
| 111 | 111 | 	"ta	0x10;"							\ |
| 112 | 112 | 	"bcc	1f;"							\ |
| 113 | 	" mov	0, %%g1;"						\ | |
| 113 | 	" nop;"								\ | |
| 114 | 114 | 	"sub	%%g0, %%o0, %%o0;"					\ |
| 115 | 	"mov	1, %%g1;"						\ | |
| 116 | 115 | 	"1:" |
| 117 | 116 | |
| 118 | 117 | #define __SYSCALL_CLOBBERS						\ |
| ... | ... | @@ -122,6 +121,9 @@ ENTRY(name);					\ |
| 122 | 121 | 	"f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",		\ |
| 123 | 122 | 	"cc", "memory" |
| 124 | 123 | |
| 124 | #undef HAVE_INTERNAL_BRK_ADDR_SYMBOL | |
| 125 | #define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 | |
| 126 | ||
| 125 | 127 | #endif	/* __ASSEMBLER__ */ |
| 126 | 128 | |
| 127 | 129 | /* Pointer mangling support. */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h created+58| ... | ... | @@ -0,0 +1,58 @@ |
| 1 | #ifndef _KERNEL_STAT_H | |
| 2 | #define _KERNEL_STAT_H | |
| 3 | ||
| 4 | /* Definition of `struct stat' used in the kernel */ | |
| 5 | struct kernel_stat | |
| 6 | { | |
| 7 | unsigned int st_dev; | |
| 8 | unsigned long int st_ino; | |
| 9 | unsigned int st_mode; | |
| 10 | short int st_nlink; | |
| 11 | unsigned int st_uid; | |
| 12 | unsigned int st_gid; | |
| 13 | unsigned int st_rdev; | |
| 14 | long int st_size; | |
| 15 | long int st_atime_sec; | |
| 16 | long int st_mtime_sec; | |
| 17 | long int st_ctime_sec; | |
| 18 | long int st_blksize; | |
| 19 | long int st_blocks; | |
| 20 | unsigned long int __glibc_reserved1; | |
| 21 | unsigned long int __glibc_reserved2; | |
| 22 | }; | |
| 23 | ||
| 24 | /* Definition of `struct stat64' used in the kernel. */ | |
| 25 | struct kernel_stat64 | |
| 26 | { | |
| 27 | unsigned long int st_dev; | |
| 28 | unsigned long int st_ino; | |
| 29 | unsigned long int st_nlink; | |
| 30 | ||
| 31 | unsigned int st_mode; | |
| 32 | unsigned int st_uid; | |
| 33 | unsigned int st_gid; | |
| 34 | unsigned int __pad0; | |
| 35 | ||
| 36 | unsigned long int st_rdev; | |
| 37 | long int st_size; | |
| 38 | long int st_blksize; | |
| 39 | long int st_blocks; | |
| 40 | ||
| 41 | unsigned long int st_atime_sec; | |
| 42 | unsigned long int st_atime_nsec; | |
| 43 | unsigned long int st_mtime_sec; | |
| 44 | unsigned long int st_mtime_nsec; | |
| 45 | unsigned long int st_ctime_sec; | |
| 46 | unsigned long int st_ctime_nsec; | |
| 47 | long int __glibc_reserved[3]; | |
| 48 | }; | |
| 49 | ||
| 50 | #define STAT_IS_KERNEL_STAT 0 | |
| 51 | #define STAT64_IS_KERNEL_STAT64 0 | |
| 52 | #define XSTAT_IS_XSTAT64 1 | |
| 53 | #ifdef __arch64__ | |
| 54 | # define STATFS_IS_STATFS64 1 | |
| 55 | #else | |
| 56 | # define STATFS_IS_STATFS64 0 | |
| 57 | #endif | |
| 58 | #endif /* _KERNEL_STAT_H */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h created+44| ... | ... | @@ -0,0 +1,44 @@ |
| 1 | /* Struct kernel_stat64 to stat64. Linux/SPARC version. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <errno.h> | |
| 20 | ||
| 21 | static inline void | |
| 22 | __cp_stat64_kstat64 (struct stat64 *st64, const struct kernel_stat64 *kst64) | |
| 23 | { | |
| 24 | st64->st_dev = kst64->st_dev; | |
| 25 | st64->__pad1 = 0; | |
| 26 | st64->st_ino = kst64->st_ino; | |
| 27 | st64->st_mode = kst64->st_mode; | |
| 28 | st64->st_nlink = kst64->st_nlink; | |
| 29 | st64->st_uid = kst64->st_uid; | |
| 30 | st64->st_gid = kst64->st_gid; | |
| 31 | st64->st_rdev = kst64->st_rdev; | |
| 32 | st64->__pad2 = 0; | |
| 33 | st64->st_size = kst64->st_size; | |
| 34 | st64->st_blksize = kst64->st_blksize; | |
| 35 | st64->st_blocks = kst64->st_blocks; | |
| 36 | st64->st_atim.tv_sec = kst64->st_atime_sec; | |
| 37 | st64->st_atim.tv_nsec = kst64->st_atime_nsec; | |
| 38 | st64->st_mtim.tv_sec = kst64->st_mtime_sec; | |
| 39 | st64->st_mtim.tv_nsec = kst64->st_mtime_nsec; | |
| 40 | st64->st_ctim.tv_sec = kst64->st_ctime_sec; | |
| 41 | st64->st_ctim.tv_nsec = kst64->st_ctime_nsec; | |
| 42 | st64->__glibc_reserved4 = 0; | |
| 43 | st64->__glibc_reserved5 = 0; | |
| 44 | } |
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h+2-3| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997. |
| 4 | 4 | |
| ... | ... | @@ -109,9 +109,8 @@ ENTRY(name);					\ |
| 109 | 109 | #define __SYSCALL_STRING						\ |
| 110 | 110 | 	"ta	0x6d;"							\ |
| 111 | 111 | 	"bcc,pt	%%xcc, 1f;"						\ |
| 112 | 	" mov	0, %%g1;"						\ | |
| 112 | 	" nop;"								\ | |
| 113 | 113 | 	"sub	%%g0, %%o0, %%o0;"					\ |
| 114 | 	"mov	1, %%g1;"						\ | |
| 115 | 114 | 	"1:" |
| 116 | 115 | |
| 117 | 116 | #define __SYSCALL_CLOBBERS						\ |
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sysdep.h+90-94| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2000-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2000-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | Contributed by Jakub Jelinek <jakub@redhat.com>, 2000. |
| 4 | 4 | |
| ... | ... | @@ -34,13 +34,6 @@ |
| 34 | 34 | |
| 35 | 35 | #else	/* __ASSEMBLER__ */ |
| 36 | 36 | |
| 37 | #define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...)		\ | |
| 38 | ({									\ | |
| 39 | long _ret = funcptr (args);						\ | |
| 40 | err = ((unsigned long) (_ret) >= (unsigned long) -4095L);		\ | |
| 41 | _ret;								\ | |
| 42 | }) | |
| 43 | ||
| 44 | 37 | # define VDSO_NAME "LINUX_2.6" |
| 45 | 38 | # define VDSO_HASH 61765110 |
| 46 | 39 | |
| ... | ... | @@ -52,121 +45,119 @@ |
| 52 | 45 | # endif |
| 53 | 46 | # define HAVE_GETTIMEOFDAY_VSYSCALL	"__vdso_gettimeofday" |
| 54 | 47 | |
| 55 | #undef INLINE_SYSCALL | |
| 56 | #define INLINE_SYSCALL(name, nr, args...) 				\ | |
| 57 | ({	INTERNAL_SYSCALL_DECL(err); 					\ | |
| 58 | 	unsigned long resultvar = INTERNAL_SYSCALL(name, err, nr, args);\ | |
| 59 | 	if (INTERNAL_SYSCALL_ERROR_P (resultvar, err))			\ | |
| 60 | 	 {		 			 		 	\ | |
| 61 | 	 __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, err));	\ | |
| 62 | 	 resultvar = (unsigned long) -1;				\ | |
| 63 | 	 } 	 							\ | |
| 64 | 	(long) resultvar;						\ | |
| 65 | }) | |
| 66 | ||
| 67 | #undef INTERNAL_SYSCALL_DECL | |
| 68 | #define INTERNAL_SYSCALL_DECL(err) \ | |
| 69 | 	register long err __asm__("g1"); | |
| 70 | ||
| 71 | 48 | #undef INTERNAL_SYSCALL |
| 72 | #define INTERNAL_SYSCALL(name, err, nr, args...) \ | |
| 73 | inline_syscall##nr(__SYSCALL_STRING, err, __NR_##name, args) | |
| 49 | #define INTERNAL_SYSCALL(name, nr, args...) \ | |
| 50 | internal_syscall##nr(__SYSCALL_STRING, __NR_##name, args) | |
| 74 | 51 | |
| 75 | 52 | #undef INTERNAL_SYSCALL_NCS |
| 76 | #define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ | |
| 77 | inline_syscall##nr(__SYSCALL_STRING, err, name, args) | |
| 78 | ||
| 79 | #undef INTERNAL_SYSCALL_ERROR_P | |
| 80 | #define INTERNAL_SYSCALL_ERROR_P(val, err) \ | |
| 81 | ((void) (val), __builtin_expect((err) != 0, 0)) | |
| 82 | ||
| 83 | #undef INTERNAL_SYSCALL_ERRNO | |
| 84 | #define INTERNAL_SYSCALL_ERRNO(val, err)	(-(val)) | |
| 53 | #define INTERNAL_SYSCALL_NCS(name, nr, args...) \ | |
| 54 | internal_syscall##nr(__SYSCALL_STRING, name, args) | |
| 85 | 55 | |
| 86 | #define inline_syscall0(string,err,name,dummy...)			\ | |
| 56 | #define internal_syscall0(string,name,dummy...)			\ | |
| 87 | 57 | ({									\ |
| 58 | 	register long int __g1 __asm__ ("g1") = (name);			\ | |
| 88 | 59 | 	register long __o0 __asm__ ("o0");				\ |
| 89 | 	err = name;							\ | |
| 90 | 	__asm __volatile (string : "=r" (err), "=r" (__o0) :		\ | |
| 91 | 			 "0" (err) :					\ | |
| 60 | 	__asm __volatile (string : "=r" (__o0) :			\ | |
| 61 | 			 "r" (__g1) :					\ | |
| 92 | 62 | 			 __SYSCALL_CLOBBERS);				\ |
| 93 | 63 | 	__o0;								\ |
| 94 | 64 | }) |
| 95 | 65 | |
| 96 | #define inline_syscall1(string,err,name,arg1)				\ | |
| 66 | #define internal_syscall1(string,name,arg1)				\ | |
| 97 | 67 | ({									\ |
| 98 | 	register long __o0 __asm__ ("o0") = (long)(arg1);		\ | |
| 99 | 	err = name;							\ | |
| 100 | 	__asm __volatile (string : "=r" (err), "=r" (__o0) :		\ | |
| 101 | 			 "0" (err), "1" (__o0) :			\ | |
| 68 | 	long int _arg1 = (long int) (arg1);				\ | |
| 69 | 	register long int __g1 __asm__("g1") = (name);			\ | |
| 70 | 	register long int __o0 __asm__ ("o0") = _arg1;			\ | |
| 71 | 	__asm __volatile (string : "=r" (__o0) :			\ | |
| 72 | 			 "r" (__g1), "0" (__o0) :			\ | |
| 102 | 73 | 			 __SYSCALL_CLOBBERS);				\ |
| 103 | 74 | 	__o0;								\ |
| 104 | 75 | }) |
| 105 | 76 | |
| 106 | #define inline_syscall2(string,err,name,arg1,arg2)			\ | |
| 77 | #define internal_syscall2(string,name,arg1,arg2)			\ | |
| 107 | 78 | ({									\ |
| 108 | 	register long __o0 __asm__ ("o0") = (long)(arg1);		\ | |
| 109 | 	register long __o1 __asm__ ("o1") = (long)(arg2);		\ | |
| 110 | 	err = name;							\ | |
| 111 | 	__asm __volatile (string : "=r" (err), "=r" (__o0) :		\ | |
| 112 | 			 "0" (err), "1" (__o0), "r" (__o1) :		\ | |
| 79 | 	long int _arg1 = (long int) (arg1);				\ | |
| 80 | 	long int _arg2 = (long int) (arg2);				\ | |
| 81 | 	register long int __g1 __asm__("g1") = (name);			\ | |
| 82 | 	register long int __o0 __asm__ ("o0") = _arg1;			\ | |
| 83 | 	register long int __o1 __asm__ ("o1") = _arg2;			\ | |
| 84 | 	__asm __volatile (string : "=r" (__o0) :			\ | |
| 85 | 			 "r" (__g1), "0" (__o0), "r" (__o1) :		\ | |
| 113 | 86 | 			 __SYSCALL_CLOBBERS);				\ |
| 114 | 87 | 	__o0;								\ |
| 115 | 88 | }) |
| 116 | 89 | |
| 117 | #define inline_syscall3(string,err,name,arg1,arg2,arg3)			\ | |
| 90 | #define internal_syscall3(string,name,arg1,arg2,arg3)			\ | |
| 118 | 91 | ({									\ |
| 119 | 	register long __o0 __asm__ ("o0") = (long)(arg1);		\ | |
| 120 | 	register long __o1 __asm__ ("o1") = (long)(arg2);		\ | |
| 121 | 	register long __o2 __asm__ ("o2") = (long)(arg3);		\ | |
| 122 | 	err = name;							\ | |
| 123 | 	__asm __volatile (string : "=r" (err), "=r" (__o0) :		\ | |
| 124 | 			 "0" (err), "1" (__o0), "r" (__o1),		\ | |
| 92 | 	long int _arg1 = (long int) (arg1);				\ | |
| 93 | 	long int _arg2 = (long int) (arg2);				\ | |
| 94 | 	long int _arg3 = (long int) (arg3);				\ | |
| 95 | 	register long int __g1 __asm__("g1") = (name);			\ | |
| 96 | 	register long int __o0 __asm__ ("o0") = _arg1;			\ | |
| 97 | 	register long int __o1 __asm__ ("o1") = _arg2;			\ | |
| 98 | 	register long int __o2 __asm__ ("o2") = _arg3;			\ | |
| 99 | 	__asm __volatile (string : "=r" (__o0) :			\ | |
| 100 | 			 "r" (__g1), "0" (__o0), "r" (__o1),		\ | |
| 125 | 101 | 			 "r" (__o2) :					\ |
| 126 | 102 | 			 __SYSCALL_CLOBBERS);				\ |
| 127 | 103 | 	__o0;								\ |
| 128 | 104 | }) |
| 129 | 105 | |
| 130 | #define inline_syscall4(string,err,name,arg1,arg2,arg3,arg4)		\ | |
| 106 | #define internal_syscall4(string,name,arg1,arg2,arg3,arg4)		\ | |
| 131 | 107 | ({									\ |
| 132 | 	register long __o0 __asm__ ("o0") = (long)(arg1);		\ | |
| 133 | 	register long __o1 __asm__ ("o1") = (long)(arg2);		\ | |
| 134 | 	register long __o2 __asm__ ("o2") = (long)(arg3);		\ | |
| 135 | 	register long __o3 __asm__ ("o3") = (long)(arg4);		\ | |
| 136 | 	err = name;							\ | |
| 137 | 	__asm __volatile (string : "=r" (err), "=r" (__o0) :		\ | |
| 138 | 			 "0" (err), "1" (__o0), "r" (__o1),		\ | |
| 108 | 	long int _arg1 = (long int) (arg1);				\ | |
| 109 | 	long int _arg2 = (long int) (arg2);				\ | |
| 110 | 	long int _arg3 = (long int) (arg3);				\ | |
| 111 | 	long int _arg4 = (long int) (arg4);				\ | |
| 112 | 	register long int __g1 __asm__("g1") = (name);			\ | |
| 113 | 	register long int __o0 __asm__ ("o0") = _arg1;			\ | |
| 114 | 	register long int __o1 __asm__ ("o1") = _arg2;			\ | |
| 115 | 	register long int __o2 __asm__ ("o2") = _arg3;			\ | |
| 116 | 	register long int __o3 __asm__ ("o3") = _arg4;			\ | |
| 117 | 	__asm __volatile (string : "=r" (__o0) :			\ | |
| 118 | 			 "r" (__g1), "0" (__o0), "r" (__o1),		\ | |
| 139 | 119 | 			 "r" (__o2), "r" (__o3) :			\ |
| 140 | 120 | 			 __SYSCALL_CLOBBERS);				\ |
| 141 | 121 | 	__o0;								\ |
| 142 | 122 | }) |
| 143 | 123 | |
| 144 | #define inline_syscall5(string,err,name,arg1,arg2,arg3,arg4,arg5)	\ | |
| 124 | #define internal_syscall5(string,name,arg1,arg2,arg3,arg4,arg5)		\ | |
| 145 | 125 | ({									\ |
| 146 | 	register long __o0 __asm__ ("o0") = (long)(arg1);		\ | |
| 147 | 	register long __o1 __asm__ ("o1") = (long)(arg2);		\ | |
| 148 | 	register long __o2 __asm__ ("o2") = (long)(arg3);		\ | |
| 149 | 	register long __o3 __asm__ ("o3") = (long)(arg4);		\ | |
| 150 | 	register long __o4 __asm__ ("o4") = (long)(arg5);		\ | |
| 151 | 	err = name;							\ | |
| 152 | 	__asm __volatile (string : "=r" (err), "=r" (__o0) :		\ | |
| 153 | 			 "0" (err), "1" (__o0), "r" (__o1),		\ | |
| 126 | 	long int _arg1 = (long int) (arg1);				\ | |
| 127 | 	long int _arg2 = (long int) (arg2);				\ | |
| 128 | 	long int _arg3 = (long int) (arg3);				\ | |
| 129 | 	long int _arg4 = (long int) (arg4);				\ | |
| 130 | 	long int _arg5 = (long int) (arg5);				\ | |
| 131 | 	register long int __g1 __asm__("g1") = (name);			\ | |
| 132 | 	register long int __o0 __asm__ ("o0") = _arg1;			\ | |
| 133 | 	register long int __o1 __asm__ ("o1") = _arg2;			\ | |
| 134 | 	register long int __o2 __asm__ ("o2") = _arg3;			\ | |
| 135 | 	register long int __o3 __asm__ ("o3") = _arg4;			\ | |
| 136 | 	register long int __o4 __asm__ ("o4") = _arg5;			\ | |
| 137 | 	__asm __volatile (string : "=r" (__o0) :			\ | |
| 138 | 			 "r" (__g1), "0" (__o0), "r" (__o1),		\ | |
| 154 | 139 | 			 "r" (__o2), "r" (__o3), "r" (__o4) :		\ |
| 155 | 140 | 			 __SYSCALL_CLOBBERS);				\ |
| 156 | 141 | 	__o0;								\ |
| 157 | 142 | }) |
| 158 | 143 | |
| 159 | #define inline_syscall6(string,err,name,arg1,arg2,arg3,arg4,arg5,arg6)	\ | |
| 144 | #define internal_syscall6(string,name,arg1,arg2,arg3,arg4,arg5,arg6)	\ | |
| 160 | 145 | ({									\ |
| 161 | 	register long __o0 __asm__ ("o0") = (long)(arg1);		\ | |
| 162 | 	register long __o1 __asm__ ("o1") = (long)(arg2);		\ | |
| 163 | 	register long __o2 __asm__ ("o2") = (long)(arg3);		\ | |
| 164 | 	register long __o3 __asm__ ("o3") = (long)(arg4);		\ | |
| 165 | 	register long __o4 __asm__ ("o4") = (long)(arg5);		\ | |
| 166 | 	register long __o5 __asm__ ("o5") = (long)(arg6);		\ | |
| 167 | 	err = name;							\ | |
| 168 | 	__asm __volatile (string : "=r" (err), "=r" (__o0) :		\ | |
| 169 | 			 "0" (err), "1" (__o0), "r" (__o1),		\ | |
| 146 | 	long int _arg1 = (long int) (arg1);				\ | |
| 147 | 	long int _arg2 = (long int) (arg2);				\ | |
| 148 | 	long int _arg3 = (long int) (arg3);				\ | |
| 149 | 	long int _arg4 = (long int) (arg4);				\ | |
| 150 | 	long int _arg5 = (long int) (arg5);				\ | |
| 151 | 	long int _arg6 = (long int) (arg6);				\ | |
| 152 | 	register long int __g1 __asm__("g1") = (name);			\ | |
| 153 | 	register long int __o0 __asm__ ("o0") = _arg1;			\ | |
| 154 | 	register long int __o1 __asm__ ("o1") = _arg2;			\ | |
| 155 | 	register long int __o2 __asm__ ("o2") = _arg3;			\ | |
| 156 | 	register long int __o3 __asm__ ("o3") = _arg4;			\ | |
| 157 | 	register long int __o4 __asm__ ("o4") = _arg5;			\ | |
| 158 | 	register long int __o5 __asm__ ("o5") = _arg6;			\ | |
| 159 | 	__asm __volatile (string : "=r" (__o0) :			\ | |
| 160 | 			 "r" (__g1), "0" (__o0), "r" (__o1),		\ | |
| 170 | 161 | 			 "r" (__o2), "r" (__o3), "r" (__o4),		\ |
| 171 | 162 | 			 "r" (__o5) :					\ |
| 172 | 163 | 			 __SYSCALL_CLOBBERS);				\ |
| ... | ... | @@ -175,20 +166,25 @@ |
| 175 | 166 | |
| 176 | 167 | #define INLINE_CLONE_SYSCALL(arg1,arg2,arg3,arg4,arg5)			\ |
| 177 | 168 | ({									\ |
| 178 | 	register long __o0 __asm__ ("o0") = (long)(arg1);		\ | |
| 179 | 	register long __o1 __asm__ ("o1") = (long)(arg2);		\ | |
| 180 | 	register long __o2 __asm__ ("o2") = (long)(arg3);		\ | |
| 181 | 	register long __o3 __asm__ ("o3") = (long)(arg4);		\ | |
| 182 | 	register long __o4 __asm__ ("o4") = (long)(arg5);		\ | |
| 183 | 	register long __g1 __asm__ ("g1") = __NR_clone;			\ | |
| 169 | 	long int _arg1 = (long int) (arg1);				\ | |
| 170 | 	long int _arg2 = (long int) (arg2);				\ | |
| 171 | 	long int _arg3 = (long int) (arg3);				\ | |
| 172 | 	long int _arg4 = (long int) (arg4);				\ | |
| 173 | 	long int _arg5 = (long int) (arg5);				\ | |
| 174 | 	register long int __o0 __asm__ ("o0") = _arg1;			\ | |
| 175 | 	register long int __o1 __asm__ ("o1") = _arg2;			\ | |
| 176 | 	register long int __o2 __asm__ ("o2") = _arg3;			\ | |
| 177 | 	register long int __o3 __asm__ ("o3") = _arg4;			\ | |
| 178 | 	register long int __o4 __asm__ ("o4") = _arg5;			\ | |
| 179 | 	register long int __g1 __asm__ ("g1") = __NR_clone;		\ | |
| 184 | 180 | 	__asm __volatile (__SYSCALL_STRING :				\ |
| 185 | 			 "=r" (__g1), "=r" (__o0), "=r" (__o1)	:	\ | |
| 186 | 			 "0" (__g1), "1" (__o0), "2" (__o1),		\ | |
| 181 | 			 "=r" (__o0), "=r" (__o1) :			\ | |
| 182 | 			 "r" (__g1), "0" (__o0), "1" (__o1),		\ | |
| 187 | 183 | 			 "r" (__o2), "r" (__o3), "r" (__o4) :		\ |
| 188 | 184 | 			 __SYSCALL_CLOBBERS);				\ |
| 189 | 	if (INTERNAL_SYSCALL_ERROR_P (__o0, __g1))			\ | |
| 185 | 	if (__glibc_unlikely ((unsigned long int) (__o0) > -4096UL))	\ | |
| 190 | 186 | 	 {		 			 		 	\ |
| 191 | 	 __set_errno (INTERNAL_SYSCALL_ERRNO (__o0, __g1));		\ | |
| 187 | 	 __set_errno (-__o0);					\ | |
| 192 | 188 | 	 __o0 = -1L;			 				\ |
| 193 | 189 | 	 } 	 							\ |
| 194 | 190 | 	else								\ |
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/xstatver.h created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | /* Versions of the 'struct stat' data structure used in compatibility xstat | |
| 2 | functions. */ | |
| 3 | #define _STAT_VER_LINUX_OLD	1 | |
| 4 | #define _STAT_VER_KERNEL	1 | |
| 5 | #define _STAT_VER_SVR4		2 | |
| 6 | #define _STAT_VER_LINUX		3 | |
| 7 | #define _STAT_VER		_STAT_VER_LINUX	/* The one defined below. */ | |
| 8 | ||
| 9 | /* Versions of the 'xmknod' interface used in compatibility xmknod | |
| 10 | functions. */ | |
| 11 | #define _MKNOD_VER_LINUX	1 | |
| 12 | #define _MKNOD_VER_SVR4		2 | |
| 13 | #define _MKNOD_VER		_MKNOD_VER_LINUX |
lib/libc/glibc/sysdeps/unix/sysv/linux/stat.c created+31| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | /* Get file status. Linux version. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <sys/stat.h> | |
| 20 | #include <fcntl.h> | |
| 21 | #include <kernel_stat.h> | |
| 22 | ||
| 23 | #if !XSTAT_IS_XSTAT64 | |
| 24 | int | |
| 25 | __stat (const char *file, struct stat *buf) | |
| 26 | { | |
| 27 | return __fstatat (AT_FDCWD, file, buf, 0); | |
| 28 | } | |
| 29 | ||
| 30 | weak_alias (__stat, stat) | |
| 31 | #endif |
lib/libc/glibc/sysdeps/unix/sysv/linux/stat64.c created+52| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | /* Get file status. Linux version. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #define __stat __redirect___stat | |
| 20 | #define stat __redirect_stat | |
| 21 | #include <sys/stat.h> | |
| 22 | #include <fcntl.h> | |
| 23 | #include <kernel_stat.h> | |
| 24 | #include <stat_t64_cp.h> | |
| 25 | ||
| 26 | int | |
| 27 | __stat64_time64 (const char *file, struct __stat64_t64 *buf) | |
| 28 | { | |
| 29 | return __fstatat64_time64 (AT_FDCWD, file, buf, 0); | |
| 30 | } | |
| 31 | #if __TIMESIZE != 64 | |
| 32 | hidden_def (__stat64_time64) | |
| 33 | ||
| 34 | int | |
| 35 | __stat64 (const char *file, struct stat64 *buf) | |
| 36 | { | |
| 37 | struct __stat64_t64 st_t64; | |
| 38 | return __stat64_time64 (file, &st_t64) | |
| 39 | 	 ?: __cp_stat64_t64_stat64 (&st_t64, buf); | |
| 40 | } | |
| 41 | #endif | |
| 42 | ||
| 43 | #undef __stat | |
| 44 | #undef stat | |
| 45 | ||
| 46 | hidden_def (__stat64) | |
| 47 | weak_alias (__stat64, stat64) | |
| 48 | ||
| 49 | #if XSTAT_IS_XSTAT64 | |
| 50 | strong_alias (__stat64, __stat) | |
| 51 | weak_alias (__stat64, stat) | |
| 52 | #endif |
lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.c created+75| ... | ... | @@ -0,0 +1,75 @@ |
| 1 | /* Struct stat/stat64 to stat/stat64 conversion for Linux. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <stat_t64_cp.h> | |
| 20 | #include <string.h> | |
| 21 | #include <errno.h> | |
| 22 | #include <time.h> | |
| 23 | ||
| 24 | #if __TIMESIZE != 64 | |
| 25 | ||
| 26 | static inline bool | |
| 27 | in_time_t_range (__time64_t t) | |
| 28 | { | |
| 29 | time_t s = t; | |
| 30 | return s == t; | |
| 31 | } | |
| 32 | ||
| 33 | static inline struct timespec | |
| 34 | valid_timespec64_to_timespec (const struct __timespec64 ts64) | |
| 35 | { | |
| 36 | struct timespec ts; | |
| 37 | ||
| 38 | ts.tv_sec = (time_t) ts64.tv_sec; | |
| 39 | ts.tv_nsec = ts64.tv_nsec; | |
| 40 | ||
| 41 | return ts; | |
| 42 | } | |
| 43 | ||
| 44 | int | |
| 45 | __cp_stat64_t64_stat64 (const struct __stat64_t64 *st64_t64, | |
| 46 | 			struct stat64 *st64) | |
| 47 | { | |
| 48 | if (! in_time_t_range (st64_t64->st_atim.tv_sec) | |
| 49 | || ! in_time_t_range (st64_t64->st_mtim.tv_sec) | |
| 50 | || ! in_time_t_range (st64_t64->st_ctim.tv_sec)) | |
| 51 | { | |
| 52 | __set_errno (EOVERFLOW); | |
| 53 | return -1; | |
| 54 | } | |
| 55 | ||
| 56 | /* Clear both pad and reserved fields. */ | |
| 57 | memset (st64, 0, sizeof (*st64)); | |
| 58 | ||
| 59 | st64->st_dev = st64_t64->st_dev, | |
| 60 | st64->st_ino = st64_t64->st_ino; | |
| 61 | st64->st_mode = st64_t64->st_mode; | |
| 62 | st64->st_nlink = st64_t64->st_nlink; | |
| 63 | st64->st_uid = st64_t64->st_uid; | |
| 64 | st64->st_gid = st64_t64->st_gid; | |
| 65 | st64->st_rdev = st64_t64->st_rdev; | |
| 66 | st64->st_size = st64_t64->st_size; | |
| 67 | st64->st_blksize = st64_t64->st_blksize; | |
| 68 | st64->st_blocks = st64_t64->st_blocks; | |
| 69 | st64->st_atim = valid_timespec64_to_timespec (st64_t64->st_atim); | |
| 70 | st64->st_mtim = valid_timespec64_to_timespec (st64_t64->st_mtim); | |
| 71 | st64->st_ctim = valid_timespec64_to_timespec (st64_t64->st_ctim); | |
| 72 | ||
| 73 | return 0; | |
| 74 | } | |
| 75 | #endif |
lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.h created+25| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | /* Copy to/from struct stat with and without 64-bit time_t support. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #include <sys/stat.h> | |
| 20 | ||
| 21 | #if __TIMESIZE != 64 | |
| 22 | extern int __cp_stat64_t64_stat64 (const struct __stat64_t64 *st64_t64, | |
| 23 | 				 struct stat64 *st64) | |
| 24 | attribute_hidden; | |
| 25 | #endif |
lib/libc/glibc/sysdeps/unix/sysv/linux/struct_stat_time64.h created+34| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | /* Struct stat with 64-bit time support. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_STRUCT_STAT_TIME64_H | |
| 20 | #define _BITS_STRUCT_STAT_TIME64_H 1 | |
| 21 | ||
| 22 | #if __TIMESIZE == 64 | |
| 23 | # define __stat64_t64 stat64 | |
| 24 | #else | |
| 25 | # include <struct___timespec64.h> | |
| 26 | ||
| 27 | struct __stat64_t64 | |
| 28 | { | |
| 29 | # define __struct_timespec struct __timespec64 | |
| 30 | # include <bits/struct_stat_time64_helper.h> | |
| 31 | }; | |
| 32 | #endif /* __TIMESIZE == 64 */ | |
| 33 | ||
| 34 | #endif /* _BITS_STRUCT_STAT_TIME64_H */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/sys/syscall.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/sys/timex.h+24-7| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1995-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -54,17 +54,34 @@ struct ntptimeval |
| 54 | 54 | |
| 55 | 55 | __BEGIN_DECLS |
| 56 | 56 | |
| 57 | extern int __adjtimex (struct timex *__ntx) __THROW; | |
| 57 | #ifndef __USE_TIME_BITS64 | |
| 58 | 58 | extern int adjtimex (struct timex *__ntx) __THROW; |
| 59 | extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW; | |
| 59 | 60 | |
| 60 | #ifdef __REDIRECT_NTH | |
| 61 | # ifdef __REDIRECT_NTH | |
| 61 | 62 | extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv), |
| 62 | 			 ntp_gettimex); | |
| 63 | ntp_gettimex); | |
| 64 | # else | |
| 65 | # define ntp_gettime ntp_gettimex | |
| 66 | # endif | |
| 67 | extern int ntp_adjtime (struct timex *__tntx) __THROW; | |
| 63 | 68 | #else |
| 64 | extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW; | |
| 65 | # define ntp_gettime ntp_gettimex | |
| 69 | # ifdef __REDIRECT_NTH | |
| 70 | extern int __REDIRECT_NTH (adjtimex, (struct timex *__ntx), | |
| 71 | ___adjtimex64); | |
| 72 | extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv), | |
| 73 | __ntp_gettime64); | |
| 74 | extern int __REDIRECT_NTH (ntp_gettimex, (struct ntptimeval *__ntv), | |
| 75 | __ntp_gettimex64); | |
| 76 | extern int __REDIRECT_NTH (ntp_adjtime, (struct timex *__ntx), | |
| 77 | ___adjtimex64); | |
| 78 | # else | |
| 79 | # define adjtimex ___adjtimex64 | |
| 80 | # define ntp_adjtime ___adjtimex64 | |
| 81 | # define ntp_gettime __ntp_gettime64 | |
| 82 | # define ntp_gettimex __ntp_gettimex64 | |
| 83 | # endif | |
| 66 | 84 | #endif |
| 67 | extern int ntp_adjtime (struct timex *__tntx) __THROW; | |
| 68 | 85 | |
| 69 | 86 | __END_DECLS |
| 70 | 87 |
lib/libc/glibc/sysdeps/unix/sysv/linux/sysdep.h+38-4| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2015-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2015-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -15,8 +15,40 @@ |
| 15 | 15 | License along with the GNU C Library; if not, see |
| 16 | 16 | <https://www.gnu.org/licenses/>. */ |
| 17 | 17 | |
| 18 | #ifndef _SYSDEP_LINUX_H | |
| 19 | #define _SYSDEP_LINUX_H | |
| 20 | ||
| 18 | 21 | #include <bits/wordsize.h> |
| 19 | 22 | #include <kernel-features.h> |
| 23 | #include <endian.h> | |
| 24 | #include <errno.h> | |
| 25 | ||
| 26 | #undef INTERNAL_SYSCALL_ERROR_P | |
| 27 | #define INTERNAL_SYSCALL_ERROR_P(val) \ | |
| 28 | ((unsigned long int) (val) > -4096UL) | |
| 29 | ||
| 30 | #ifndef SYSCALL_ERROR_LABEL | |
| 31 | # define SYSCALL_ERROR_LABEL(sc_err)					\ | |
| 32 | ({									\ | |
| 33 | __set_errno (sc_err);						\ | |
| 34 | -1L;								\ | |
| 35 | }) | |
| 36 | #endif | |
| 37 | ||
| 38 | /* Define a macro which expands into the inline wrapper code for a system | |
| 39 | call. It sets the errno and returns -1 on a failure, or the syscall | |
| 40 | return value otherwise. */ | |
| 41 | #undef INLINE_SYSCALL | |
| 42 | #define INLINE_SYSCALL(name, nr, args...)				\ | |
| 43 | ({									\ | |
| 44 | long int sc_ret = INTERNAL_SYSCALL (name, nr, args);		\ | |
| 45 | __glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (sc_ret))		\ | |
| 46 | ? SYSCALL_ERROR_LABEL (INTERNAL_SYSCALL_ERRNO (sc_ret))		\ | |
| 47 | : sc_ret;								\ | |
| 48 | }) | |
| 49 | ||
| 50 | #undef INTERNAL_SYSCALL_ERRNO | |
| 51 | #define INTERNAL_SYSCALL_ERRNO(val) (-(val)) | |
| 20 | 52 | |
| 21 | 53 | /* Set error number and return -1. A target may choose to return the |
| 22 | 54 | internal function, __syscall_error, which sets errno and returns -1. |
| ... | ... | @@ -63,6 +95,8 @@ |
| 63 | 95 | (long) (val), \ |
| 64 | 96 | (long) (((uint64_t) (val)) >> 32) |
| 65 | 97 | |
| 66 | /* Exports the __send symbol on send.c linux implementation (some ABI have | |
| 67 | it missing due the usage of a old generic version without it). */ | |
| 68 | #define HAVE_INTERNAL_SEND_SYMBOL	1 | |
| 98 | /* Export the ___brk_addr symbol on brk.c implementation (some ABIs export | |
| 99 | it due and old crtstuff.c code). */ | |
| 100 | #define HAVE_INTERNAL_BRK_ADDR_SYMBOL 0 | |
| 101 | ||
| 102 | #endif /* _SYSDEP_LINUX_H */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/x86/bits/stat.h deleted-210| ... | ... | @@ -1,210 +0,0 @@ |
| 1 | /* Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #if !defined _SYS_STAT_H && !defined _FCNTL_H | |
| 19 | # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #ifndef _BITS_STAT_H | |
| 23 | #define _BITS_STAT_H	1 | |
| 24 | ||
| 25 | /* Versions of the `struct stat' data structure. */ | |
| 26 | #ifndef __x86_64__ | |
| 27 | # define _STAT_VER_LINUX_OLD	1 | |
| 28 | # define _STAT_VER_KERNEL	1 | |
| 29 | # define _STAT_VER_SVR4		2 | |
| 30 | # define _STAT_VER_LINUX	3 | |
| 31 | ||
| 32 | /* i386 versions of the `xmknod' interface. */ | |
| 33 | # define _MKNOD_VER_LINUX	1 | |
| 34 | # define _MKNOD_VER_SVR4	2 | |
| 35 | # define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below. */ | |
| 36 | #else | |
| 37 | # define _STAT_VER_KERNEL	0 | |
| 38 | # define _STAT_VER_LINUX	1 | |
| 39 | ||
| 40 | /* x86-64 versions of the `xmknod' interface. */ | |
| 41 | # define _MKNOD_VER_LINUX	0 | |
| 42 | #endif | |
| 43 | ||
| 44 | #define _STAT_VER		_STAT_VER_LINUX | |
| 45 | ||
| 46 | struct stat | |
| 47 | { | |
| 48 | __dev_t st_dev;		/* Device. */ | |
| 49 | #ifndef __x86_64__ | |
| 50 | unsigned short int __pad1; | |
| 51 | #endif | |
| 52 | #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 53 | __ino_t st_ino;		/* File serial number.	*/ | |
| 54 | #else | |
| 55 | __ino_t __st_ino;			/* 32bit file serial number.	*/ | |
| 56 | #endif | |
| 57 | #ifndef __x86_64__ | |
| 58 | __mode_t st_mode;			/* File mode. */ | |
| 59 | __nlink_t st_nlink;			/* Link count. */ | |
| 60 | #else | |
| 61 | __nlink_t st_nlink;		/* Link count. */ | |
| 62 | __mode_t st_mode;		/* File mode. */ | |
| 63 | #endif | |
| 64 | __uid_t st_uid;		/* User ID of the file's owner.	*/ | |
| 65 | __gid_t st_gid;		/* Group ID of the file's group.*/ | |
| 66 | #ifdef __x86_64__ | |
| 67 | int __pad0; | |
| 68 | #endif | |
| 69 | __dev_t st_rdev;		/* Device number, if device. */ | |
| 70 | #ifndef __x86_64__ | |
| 71 | unsigned short int __pad2; | |
| 72 | #endif | |
| 73 | #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 74 | __off_t st_size;			/* Size of file, in bytes. */ | |
| 75 | #else | |
| 76 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 77 | #endif | |
| 78 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ | |
| 79 | #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 80 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 81 | #else | |
| 82 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 83 | #endif | |
| 84 | #ifdef __USE_XOPEN2K8 | |
| 85 | /* Nanosecond resolution timestamps are stored in a format | |
| 86 | equivalent to 'struct timespec'. This is the type used | |
| 87 | whenever possible but the Unix namespace rules do not allow the | |
| 88 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 89 | Therefore we have to handle the use of this header in strictly | |
| 90 | standard-compliant sources special. */ | |
| 91 | struct timespec st_atim;		/* Time of last access. */ | |
| 92 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 93 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 94 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 95 | # define st_mtime st_mtim.tv_sec | |
| 96 | # define st_ctime st_ctim.tv_sec | |
| 97 | #else | |
| 98 | __time_t st_atime;			/* Time of last access. */ | |
| 99 | __syscall_ulong_t st_atimensec;	/* Nscecs of last access. */ | |
| 100 | __time_t st_mtime;			/* Time of last modification. */ | |
| 101 | __syscall_ulong_t st_mtimensec;	/* Nsecs of last modification. */ | |
| 102 | __time_t st_ctime;			/* Time of last status change. */ | |
| 103 | __syscall_ulong_t st_ctimensec;	/* Nsecs of last status change. */ | |
| 104 | #endif | |
| 105 | #ifdef __x86_64__ | |
| 106 | __syscall_slong_t __glibc_reserved[3]; | |
| 107 | #else | |
| 108 | # ifndef __USE_FILE_OFFSET64 | |
| 109 | unsigned long int __glibc_reserved4; | |
| 110 | unsigned long int __glibc_reserved5; | |
| 111 | # else | |
| 112 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 113 | # endif | |
| 114 | #endif | |
| 115 | }; | |
| 116 | ||
| 117 | #ifdef __USE_LARGEFILE64 | |
| 118 | /* Note stat64 has the same shape as stat for x86-64. */ | |
| 119 | struct stat64 | |
| 120 | { | |
| 121 | __dev_t st_dev;		/* Device. */ | |
| 122 | # ifdef __x86_64__ | |
| 123 | __ino64_t st_ino;		/* File serial number. */ | |
| 124 | __nlink_t st_nlink;		/* Link count. */ | |
| 125 | __mode_t st_mode;		/* File mode. */ | |
| 126 | # else | |
| 127 | unsigned int __pad1; | |
| 128 | __ino_t __st_ino;			/* 32bit file serial number.	*/ | |
| 129 | __mode_t st_mode;			/* File mode. */ | |
| 130 | __nlink_t st_nlink;			/* Link count. */ | |
| 131 | # endif | |
| 132 | __uid_t st_uid;		/* User ID of the file's owner.	*/ | |
| 133 | __gid_t st_gid;		/* Group ID of the file's group.*/ | |
| 134 | # ifdef __x86_64__ | |
| 135 | int __pad0; | |
| 136 | __dev_t st_rdev;		/* Device number, if device. */ | |
| 137 | __off_t st_size;		/* Size of file, in bytes. */ | |
| 138 | # else | |
| 139 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 140 | unsigned int __pad2; | |
| 141 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 142 | # endif | |
| 143 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ | |
| 144 | __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated. */ | |
| 145 | # ifdef __USE_XOPEN2K8 | |
| 146 | /* Nanosecond resolution timestamps are stored in a format | |
| 147 | equivalent to 'struct timespec'. This is the type used | |
| 148 | whenever possible but the Unix namespace rules do not allow the | |
| 149 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 150 | Therefore we have to handle the use of this header in strictly | |
| 151 | standard-compliant sources special. */ | |
| 152 | struct timespec st_atim;		/* Time of last access. */ | |
| 153 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 154 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 155 | # else | |
| 156 | __time_t st_atime;			/* Time of last access. */ | |
| 157 | __syscall_ulong_t st_atimensec;	/* Nscecs of last access. */ | |
| 158 | __time_t st_mtime;			/* Time of last modification. */ | |
| 159 | __syscall_ulong_t st_mtimensec;	/* Nsecs of last modification. */ | |
| 160 | __time_t st_ctime;			/* Time of last status change. */ | |
| 161 | __syscall_ulong_t st_ctimensec;	/* Nsecs of last status change. */ | |
| 162 | # endif | |
| 163 | # ifdef __x86_64__ | |
| 164 | __syscall_slong_t __glibc_reserved[3]; | |
| 165 | # else | |
| 166 | __ino64_t st_ino;			/* File serial number.		*/ | |
| 167 | # endif | |
| 168 | }; | |
| 169 | #endif | |
| 170 | ||
| 171 | /* Tell code we have these members. */ | |
| 172 | #define	_STATBUF_ST_BLKSIZE | |
| 173 | #define _STATBUF_ST_RDEV | |
| 174 | /* Nanosecond resolution time values are supported. */ | |
| 175 | #define _STATBUF_ST_NSEC | |
| 176 | ||
| 177 | /* Encoding of the file mode. */ | |
| 178 | ||
| 179 | #define	__S_IFMT	0170000	/* These bits determine file type. */ | |
| 180 | ||
| 181 | /* File types. */ | |
| 182 | #define	__S_IFDIR	0040000	/* Directory. */ | |
| 183 | #define	__S_IFCHR	0020000	/* Character device. */ | |
| 184 | #define	__S_IFBLK	0060000	/* Block device. */ | |
| 185 | #define	__S_IFREG	0100000	/* Regular file. */ | |
| 186 | #define	__S_IFIFO	0010000	/* FIFO. */ | |
| 187 | #define	__S_IFLNK	0120000	/* Symbolic link. */ | |
| 188 | #define	__S_IFSOCK	0140000	/* Socket. */ | |
| 189 | ||
| 190 | /* POSIX.1b objects. Note that these macros always evaluate to zero. But | |
| 191 | they do it by enforcing the correct use of the macros. */ | |
| 192 | #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 193 | #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 194 | #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) | |
| 195 | ||
| 196 | /* Protection bits. */ | |
| 197 | ||
| 198 | #define	__S_ISUID	04000	/* Set user ID on execution. */ | |
| 199 | #define	__S_ISGID	02000	/* Set group ID on execution. */ | |
| 200 | #define	__S_ISVTX	01000	/* Save swapped text after use (sticky). */ | |
| 201 | #define	__S_IREAD	0400	/* Read by owner. */ | |
| 202 | #define	__S_IWRITE	0200	/* Write by owner. */ | |
| 203 | #define	__S_IEXEC	0100	/* Execute by owner. */ | |
| 204 | ||
| 205 | #ifdef __USE_ATFILE | |
| 206 | # define UTIME_NOW	((1l << 30) - 1l) | |
| 207 | # define UTIME_OMIT	((1l << 30) - 2l) | |
| 208 | #endif | |
| 209 | ||
| 210 | #endif	/* bits/stat.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h+7-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version. |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -64,6 +64,7 @@ |
| 64 | 64 | #define __TIME_T_TYPE		__SYSCALL_SLONG_TYPE |
| 65 | 65 | #define __USECONDS_T_TYPE	__U32_TYPE |
| 66 | 66 | #define __SUSECONDS_T_TYPE	__SYSCALL_SLONG_TYPE |
| 67 | #define __SUSECONDS64_T_TYPE	__SQUAD_TYPE | |
| 67 | 68 | #define __DADDR_T_TYPE		__S32_TYPE |
| 68 | 69 | #define __KEY_T_TYPE		__S32_TYPE |
| 69 | 70 | #define __CLOCKID_T_TYPE	__S32_TYPE |
| ... | ... | @@ -87,10 +88,15 @@ |
| 87 | 88 | |
| 88 | 89 | /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ |
| 89 | 90 | # define __STATFS_MATCHES_STATFS64 1 |
| 91 | ||
| 92 | /* And for getitimer, setitimer and rusage */ | |
| 93 | # define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 | |
| 90 | 94 | #else |
| 91 | 95 | # define __RLIM_T_MATCHES_RLIM64_T	0 |
| 92 | 96 | |
| 93 | 97 | # define __STATFS_MATCHES_STATFS64 0 |
| 98 | ||
| 99 | # define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 | |
| 94 | 100 | #endif |
| 95 | 101 | |
| 96 | 102 | /* Number of descriptors that can fit in an `fd_set'. */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/x86/sys/elf.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1998-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/x86/xstatver.h created+16| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | /* Versions of the 'struct stat' data structure used in compatibility xstat | |
| 2 | functions. */ | |
| 3 | #ifndef __x86_64__ | |
| 4 | # define _STAT_VER_LINUX_OLD	1 | |
| 5 | # define _STAT_VER_KERNEL	1 | |
| 6 | # define _STAT_VER_SVR4		2 | |
| 7 | # define _STAT_VER_LINUX	3 | |
| 8 | # define _MKNOD_VER_LINUX	1 | |
| 9 | # define _MKNOD_VER_SVR4	2 | |
| 10 | #else | |
| 11 | # define _STAT_VER_KERNEL	0 | |
| 12 | # define _STAT_VER_LINUX	1 | |
| 13 | # define _MKNOD_VER_LINUX	0 | |
| 14 | #endif | |
| 15 | #define _STAT_VER		_STAT_VER_LINUX | |
| 16 | #define _MKNOD_VER		_MKNOD_VER_LINUX |
lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/kernel-features.h+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | /* Set flags signalling availability of kernel features based on given |
| 2 | 2 | kernel version number. x86-64 version. |
| 3 | Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
| 3 | Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 4 | 4 | This file is part of the GNU C Library. |
| 5 | 5 | |
| 6 | 6 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/sysdep.h+83-74| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2001-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -33,13 +33,6 @@ |
| 33 | 33 | #undef SYS_ify |
| 34 | 34 | #define SYS_ify(syscall_name)	__NR_##syscall_name |
| 35 | 35 | |
| 36 | /* This is to help the old kernel headers where __NR_semtimedop is not | |
| 37 | available. */ | |
| 38 | #ifndef __NR_semtimedop | |
| 39 | # define __NR_semtimedop 220 | |
| 40 | #endif | |
| 41 | ||
| 42 | ||
| 43 | 36 | #ifdef __ASSEMBLER__ |
| 44 | 37 | |
| 45 | 38 | /* Linux uses a negative return value to indicate syscall errors, |
| ... | ... | @@ -55,19 +48,40 @@ |
| 55 | 48 | |
| 56 | 49 | /* We don't want the label for the error handle to be global when we define |
| 57 | 50 | it here. */ |
| 51 | # undef SYSCALL_ERROR_LABEL | |
| 58 | 52 | # ifdef PIC |
| 53 | # undef SYSCALL_ERROR_LABEL | |
| 59 | 54 | # define SYSCALL_ERROR_LABEL 0f |
| 60 | 55 | # else |
| 56 | # undef SYSCALL_ERROR_LABEL | |
| 61 | 57 | # define SYSCALL_ERROR_LABEL syscall_error |
| 62 | 58 | # endif |
| 63 | 59 | |
| 60 | /* PSEUDO and T_PSEUDO macros have 2 extra arguments for unsigned long | |
| 61 | int arguments. */ | |
| 62 | # define PSEUDOS_HAVE_ULONG_INDICES 1 | |
| 63 | ||
| 64 | # ifndef SYSCALL_ULONG_ARG_1 | |
| 65 | # define SYSCALL_ULONG_ARG_1 0 | |
| 66 | # define SYSCALL_ULONG_ARG_2 0 | |
| 67 | # endif | |
| 68 | ||
| 64 | 69 | # undef	PSEUDO |
| 65 | # define PSEUDO(name, syscall_name, args)				 \ | |
| 66 | .text;								 \ | |
| 67 | ENTRY (name)								 \ | |
| 68 | DO_CALL (syscall_name, args);					 \ | |
| 69 | cmpq $-4095, %rax;							 \ | |
| 70 | # if SYSCALL_ULONG_ARG_1 | |
| 71 | # define PSEUDO(name, syscall_name, args, ulong_arg_1, ulong_arg_2) \ | |
| 72 | .text;							 \ | |
| 73 | ENTRY (name)							 \ | |
| 74 | DO_CALL (syscall_name, args, ulong_arg_1, ulong_arg_2);	 \ | |
| 75 | cmpq $-4095, %rax;						 \ | |
| 76 | jae SYSCALL_ERROR_LABEL | |
| 77 | # else | |
| 78 | # define PSEUDO(name, syscall_name, args) \ | |
| 79 | .text;							 \ | |
| 80 | ENTRY (name)							 \ | |
| 81 | DO_CALL (syscall_name, args, 0, 0);				 \ | |
| 82 | cmpq $-4095, %rax;						 \ | |
| 70 | 83 | jae SYSCALL_ERROR_LABEL |
| 84 | # endif | |
| 71 | 85 | |
| 72 | 86 | # undef	PSEUDO_END |
| 73 | 87 | # define PSEUDO_END(name)						 \ |
| ... | ... | @@ -75,10 +89,17 @@ |
| 75 | 89 | END (name) |
| 76 | 90 | |
| 77 | 91 | # undef	PSEUDO_NOERRNO |
| 78 | # define PSEUDO_NOERRNO(name, syscall_name, args) \ | |
| 79 | .text;								 \ | |
| 80 | ENTRY (name)								 \ | |
| 81 | DO_CALL (syscall_name, args) | |
| 92 | # if SYSCALL_ULONG_ARG_1 | |
| 93 | # define PSEUDO_NOERRNO(name, syscall_name, args, ulong_arg_1, ulong_arg_2) \ | |
| 94 | .text;							 \ | |
| 95 | ENTRY (name)							 \ | |
| 96 | DO_CALL (syscall_name, args, ulong_arg_1, ulong_arg_2) | |
| 97 | # else | |
| 98 | # define PSEUDO_NOERRNO(name, syscall_name, args) \ | |
| 99 | .text;							 \ | |
| 100 | ENTRY (name)							 \ | |
| 101 | DO_CALL (syscall_name, args, 0, 0) | |
| 102 | # endif | |
| 82 | 103 | |
| 83 | 104 | # undef	PSEUDO_END_NOERRNO |
| 84 | 105 | # define PSEUDO_END_NOERRNO(name) \ |
| ... | ... | @@ -87,11 +108,19 @@ |
| 87 | 108 | # define ret_NOERRNO ret |
| 88 | 109 | |
| 89 | 110 | # undef	PSEUDO_ERRVAL |
| 90 | # define PSEUDO_ERRVAL(name, syscall_name, args) \ | |
| 91 | .text;								 \ | |
| 92 | ENTRY (name)								 \ | |
| 93 | DO_CALL (syscall_name, args);					 \ | |
| 111 | # if SYSCALL_ULONG_ARG_1 | |
| 112 | # define PSEUDO_ERRVAL(name, syscall_name, args, ulong_arg_1, ulong_arg_2) \ | |
| 113 | .text;							\ | |
| 114 | ENTRY (name)							\ | |
| 115 | DO_CALL (syscall_name, args, ulong_arg_1, ulong_arg_2);	\ | |
| 116 | negq %rax | |
| 117 | # else | |
| 118 | # define PSEUDO_ERRVAL(name, syscall_name, args) \ | |
| 119 | .text;							\ | |
| 120 | ENTRY (name)							\ | |
| 121 | DO_CALL (syscall_name, args, 0, 0);				\ | |
| 94 | 122 | negq %rax |
| 123 | # endif | |
| 95 | 124 | |
| 96 | 125 | # undef	PSEUDO_END_ERRVAL |
| 97 | 126 | # define PSEUDO_END_ERRVAL(name) \ |
| ... | ... | @@ -163,8 +192,10 @@ |
| 163 | 192 | Syscalls of more than 6 arguments are not supported. */ |
| 164 | 193 | |
| 165 | 194 | # undef	DO_CALL |
| 166 | # define DO_CALL(syscall_name, args)		\ | |
| 195 | # define DO_CALL(syscall_name, args, ulong_arg_1, ulong_arg_2) \ | |
| 167 | 196 | DOARGS_##args				\ |
| 197 | ZERO_EXTEND_##ulong_arg_1			\ | |
| 198 | ZERO_EXTEND_##ulong_arg_2			\ | |
| 168 | 199 | movl $SYS_ify (syscall_name), %eax;		\ |
| 169 | 200 | syscall; |
| 170 | 201 | |
| ... | ... | @@ -176,57 +207,39 @@ |
| 176 | 207 | # define DOARGS_5 DOARGS_4 |
| 177 | 208 | # define DOARGS_6 DOARGS_5 |
| 178 | 209 | |
| 210 | # define ZERO_EXTEND_0 /* nothing */ | |
| 211 | # define ZERO_EXTEND_1 /* nothing */ | |
| 212 | # define ZERO_EXTEND_2 /* nothing */ | |
| 213 | # define ZERO_EXTEND_3 /* nothing */ | |
| 214 | # define ZERO_EXTEND_4 /* nothing */ | |
| 215 | # define ZERO_EXTEND_5 /* nothing */ | |
| 216 | # define ZERO_EXTEND_6 /* nothing */ | |
| 217 | ||
| 179 | 218 | #else	/* !__ASSEMBLER__ */ |
| 180 | /* Define a macro which expands inline into the wrapper code for a system | |
| 181 | call. */ | |
| 182 | # undef INLINE_SYSCALL | |
| 183 | # define INLINE_SYSCALL(name, nr, args...) \ | |
| 184 | ({									 \ | |
| 185 | unsigned long int resultvar = INTERNAL_SYSCALL (name, , nr, args);	 \ | |
| 186 | if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (resultvar, )))	 \ | |
| 187 | {									 \ | |
| 188 | 	__set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, ));		 \ | |
| 189 | 	resultvar = (unsigned long int) -1;				 \ | |
| 190 | }									 \ | |
| 191 | (long int) resultvar; }) | |
| 192 | ||
| 193 | /* Define a macro with explicit types for arguments, which expands inline | |
| 194 | into the wrapper code for a system call. It should be used when size | |
| 195 | of any argument > size of long int. */ | |
| 196 | # undef INLINE_SYSCALL_TYPES | |
| 197 | # define INLINE_SYSCALL_TYPES(name, nr, args...) \ | |
| 198 | ({									 \ | |
| 199 | unsigned long int resultvar = INTERNAL_SYSCALL_TYPES (name, , nr, args); \ | |
| 200 | if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (resultvar, )))	 \ | |
| 201 | {									 \ | |
| 202 | 	__set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, ));		 \ | |
| 203 | 	resultvar = (unsigned long int) -1;				 \ | |
| 204 | }									 \ | |
| 205 | (long int) resultvar; }) | |
| 206 | ||
| 207 | # undef INTERNAL_SYSCALL_DECL | |
| 208 | # define INTERNAL_SYSCALL_DECL(err) do { } while (0) | |
| 209 | 219 | |
| 210 | 220 | /* Registers clobbered by syscall. */ |
| 211 | 221 | # define REGISTERS_CLOBBERED_BY_SYSCALL "cc", "r11", "cx" |
| 212 | 222 | |
| 213 | /* Create a variable 'name' based on type 'X' to avoid explicit types. | |
| 214 | This is mainly used set use 64-bits arguments in x32. */ | |
| 215 | #define TYPEFY(X, name) __typeof__ ((X) - (X)) name | |
| 216 | /* Explicit cast the argument to avoid integer from pointer warning on | |
| 217 | x32. */ | |
| 218 | #define ARGIFY(X) ((__typeof__ ((X) - (X))) (X)) | |
| 223 | /* NB: This also works when X is an array. For an array X, type of | |
| 224 | (X) - (X) is ptrdiff_t, which is signed, since size of ptrdiff_t | |
| 225 | == size of pointer, cast is a NOP. */ | |
| 226 | #define TYPEFY1(X) __typeof__ ((X) - (X)) | |
| 227 | /* Explicit cast the argument. */ | |
| 228 | #define ARGIFY(X) ((TYPEFY1 (X)) (X)) | |
| 229 | /* Create a variable 'name' based on type of variable 'X' to avoid | |
| 230 | explicit types. */ | |
| 231 | #define TYPEFY(X, name) __typeof__ (ARGIFY (X)) name | |
| 219 | 232 | |
| 220 | 233 | #undef INTERNAL_SYSCALL |
| 221 | #define INTERNAL_SYSCALL(name, err, nr, args...)			\ | |
| 222 | 	internal_syscall##nr (SYS_ify (name), err, args) | |
| 234 | #define INTERNAL_SYSCALL(name, nr, args...)				\ | |
| 235 | 	internal_syscall##nr (SYS_ify (name), args) | |
| 223 | 236 | |
| 224 | 237 | #undef INTERNAL_SYSCALL_NCS |
| 225 | #define INTERNAL_SYSCALL_NCS(number, err, nr, args...)			\ | |
| 226 | 	internal_syscall##nr (number, err, args) | |
| 238 | #define INTERNAL_SYSCALL_NCS(number, nr, args...)			\ | |
| 239 | 	internal_syscall##nr (number, args) | |
| 227 | 240 | |
| 228 | 241 | #undef internal_syscall0 |
| 229 | #define internal_syscall0(number, err, dummy...)			\ | |
| 242 | #define internal_syscall0(number, dummy...)				\ | |
| 230 | 243 | ({									\ |
| 231 | 244 | unsigned long int resultvar;					\ |
| 232 | 245 | asm volatile (							\ |
| ... | ... | @@ -238,7 +251,7 @@ |
| 238 | 251 | }) |
| 239 | 252 | |
| 240 | 253 | #undef internal_syscall1 |
| 241 | #define internal_syscall1(number, err, arg1)				\ | |
| 254 | #define internal_syscall1(number, arg1)					\ | |
| 242 | 255 | ({									\ |
| 243 | 256 | unsigned long int resultvar;					\ |
| 244 | 257 | TYPEFY (arg1, __arg1) = ARGIFY (arg1);			 	\ |
| ... | ... | @@ -252,7 +265,7 @@ |
| 252 | 265 | }) |
| 253 | 266 | |
| 254 | 267 | #undef internal_syscall2 |
| 255 | #define internal_syscall2(number, err, arg1, arg2)			\ | |
| 268 | #define internal_syscall2(number, arg1, arg2)				\ | |
| 256 | 269 | ({									\ |
| 257 | 270 | unsigned long int resultvar;					\ |
| 258 | 271 | TYPEFY (arg2, __arg2) = ARGIFY (arg2);			 	\ |
| ... | ... | @@ -268,7 +281,7 @@ |
| 268 | 281 | }) |
| 269 | 282 | |
| 270 | 283 | #undef internal_syscall3 |
| 271 | #define internal_syscall3(number, err, arg1, arg2, arg3)		\ | |
| 284 | #define internal_syscall3(number, arg1, arg2, arg3)			\ | |
| 272 | 285 | ({									\ |
| 273 | 286 | unsigned long int resultvar;					\ |
| 274 | 287 | TYPEFY (arg3, __arg3) = ARGIFY (arg3);			 	\ |
| ... | ... | @@ -286,7 +299,7 @@ |
| 286 | 299 | }) |
| 287 | 300 | |
| 288 | 301 | #undef internal_syscall4 |
| 289 | #define internal_syscall4(number, err, arg1, arg2, arg3, arg4)		\ | |
| 302 | #define internal_syscall4(number, arg1, arg2, arg3, arg4)		\ | |
| 290 | 303 | ({									\ |
| 291 | 304 | unsigned long int resultvar;					\ |
| 292 | 305 | TYPEFY (arg4, __arg4) = ARGIFY (arg4);			 	\ |
| ... | ... | @@ -306,7 +319,7 @@ |
| 306 | 319 | }) |
| 307 | 320 | |
| 308 | 321 | #undef internal_syscall5 |
| 309 | #define internal_syscall5(number, err, arg1, arg2, arg3, arg4, arg5)	\ | |
| 322 | #define internal_syscall5(number, arg1, arg2, arg3, arg4, arg5)	\ | |
| 310 | 323 | ({									\ |
| 311 | 324 | unsigned long int resultvar;					\ |
| 312 | 325 | TYPEFY (arg5, __arg5) = ARGIFY (arg5);			 	\ |
| ... | ... | @@ -329,7 +342,7 @@ |
| 329 | 342 | }) |
| 330 | 343 | |
| 331 | 344 | #undef internal_syscall6 |
| 332 | #define internal_syscall6(number, err, arg1, arg2, arg3, arg4, arg5, arg6) \ | |
| 345 | #define internal_syscall6(number, arg1, arg2, arg3, arg4, arg5, arg6) \ | |
| 333 | 346 | ({									\ |
| 334 | 347 | unsigned long int resultvar;					\ |
| 335 | 348 | TYPEFY (arg6, __arg6) = ARGIFY (arg6);			 	\ |
| ... | ... | @@ -353,12 +366,6 @@ |
| 353 | 366 | (long int) resultvar;						\ |
| 354 | 367 | }) |
| 355 | 368 | |
| 356 | # undef INTERNAL_SYSCALL_ERROR_P | |
| 357 | # define INTERNAL_SYSCALL_ERROR_P(val, err) \ | |
| 358 | ((unsigned long int) (long int) (val) >= -4095L) | |
| 359 | ||
| 360 | # undef INTERNAL_SYSCALL_ERRNO | |
| 361 | # define INTERNAL_SYSCALL_ERRNO(val, err)	(-(val)) | |
| 362 | 369 | |
| 363 | 370 | # define VDSO_NAME "LINUX_2.6" |
| 364 | 371 | # define VDSO_HASH 61765110 |
| ... | ... | @@ -370,6 +377,8 @@ |
| 370 | 377 | # define HAVE_GETCPU_VSYSCALL		"__vdso_getcpu" |
| 371 | 378 | # define HAVE_CLOCK_GETRES64_VSYSCALL "__vdso_clock_getres" |
| 372 | 379 | |
| 380 | # define HAVE_CLONE3_WRAPPER			1 | |
| 381 | ||
| 373 | 382 | # define SINGLE_THREAD_BY_GLOBAL		1 |
| 374 | 383 | |
| 375 | 384 | #endif	/* __ASSEMBLER__ */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h+36-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -26,4 +26,39 @@ |
| 26 | 26 | #undef LO_HI_LONG |
| 27 | 27 | #define LO_HI_LONG(val) (val) |
| 28 | 28 | |
| 29 | #ifdef __ASSEMBLER__ | |
| 30 | /* Zero-extend 32-bit unsigned long int arguments to 64 bits. */ | |
| 31 | # undef ZERO_EXTEND_1 | |
| 32 | # define ZERO_EXTEND_1 movl %edi, %edi; | |
| 33 | # undef ZERO_EXTEND_2 | |
| 34 | # define ZERO_EXTEND_2 movl %esi, %esi; | |
| 35 | # undef ZERO_EXTEND_3 | |
| 36 | # define ZERO_EXTEND_3 movl %edx, %edx; | |
| 37 | # if SYSCALL_ULONG_ARG_1 == 4 || SYSCALL_ULONG_ARG_2 == 4 | |
| 38 | # undef DOARGS_4 | |
| 39 | # define DOARGS_4 movl %ecx, %r10d; | |
| 40 | # else | |
| 41 | # undef ZERO_EXTEND_4 | |
| 42 | # define ZERO_EXTEND_4 movl %r10d, %r10d; | |
| 43 | # endif | |
| 44 | # undef ZERO_EXTEND_5 | |
| 45 | # define ZERO_EXTEND_5 movl %r8d, %r8d; | |
| 46 | # undef ZERO_EXTEND_6 | |
| 47 | # define ZERO_EXTEND_6 movl %r9d, %r9d; | |
| 48 | #else /* !__ASSEMBLER__ */ | |
| 49 | # undef ARGIFY | |
| 50 | /* Enforce zero-extension for pointers and array system call arguments. | |
| 51 | For integer types, extend to int64_t (the full register) using a | |
| 52 | regular cast, resulting in zero or sign extension based on the | |
| 53 | signedness of the original type. */ | |
| 54 | # define ARGIFY(X) \ | |
| 55 | ({									\ | |
| 56 | _Pragma ("GCC diagnostic push");					\ | |
| 57 | _Pragma ("GCC diagnostic ignored \"-Wpointer-to-int-cast\"");	\ | |
| 58 | (__builtin_classify_type (X) == 5					\ | |
| 59 | ? (uintptr_t) (X) : (int64_t) (X));				\ | |
| 60 | _Pragma ("GCC diagnostic pop");					\ | |
| 61 | }) | |
| 62 | #endif	/* __ASSEMBLER__ */ | |
| 63 | ||
| 29 | 64 | #endif /* linux/x86_64/x32/sysdep.h */ |
lib/libc/glibc/sysdeps/unix/sysv/linux/xstatver.h created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | /* Versions of the 'struct stat' data structure used in compatibility xstat | |
| 2 | functions. */ | |
| 3 | #define _STAT_VER_LINUX_OLD	1 | |
| 4 | #define _STAT_VER_KERNEL	1 | |
| 5 | #define _STAT_VER_SVR4		2 | |
| 6 | #define _STAT_VER_LINUX		3 | |
| 7 | #define _STAT_VER		_STAT_VER_LINUX | |
| 8 | ||
| 9 | /* Versions of the 'xmknod' interface used in compatibility xmknod | |
| 10 | functions. */ | |
| 11 | #define _MKNOD_VER_LINUX	1 | |
| 12 | #define _MKNOD_VER_SVR4		2 | |
| 13 | #define _MKNOD_VER		_MKNOD_VER_LINUX |
lib/libc/glibc/sysdeps/unix/x86_64/sysdep.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1991-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/wordsize-32/divdi3-symbol-hacks.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Hacks needed for divdi3 symbol manipulation. |
| 2 | Copyright (C) 2004-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2004-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/x86/bits/select.h deleted-63| ... | ... | @@ -1,63 +0,0 @@ |
| 1 | /* Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_SELECT_H | |
| 19 | # error "Never use <bits/select.h> directly; include <sys/select.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #include <bits/wordsize.h> | |
| 23 | ||
| 24 | ||
| 25 | #if defined __GNUC__ && __GNUC__ >= 2 | |
| 26 | ||
| 27 | # if __WORDSIZE == 64 | |
| 28 | # define __FD_ZERO_STOS "stosq" | |
| 29 | # else | |
| 30 | # define __FD_ZERO_STOS "stosl" | |
| 31 | # endif | |
| 32 | ||
| 33 | # define __FD_ZERO(fdsp) \ | |
| 34 | do {									 \ | |
| 35 | int __d0, __d1;							 \ | |
| 36 | __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS			 \ | |
| 37 | 			 : "=c" (__d0), "=D" (__d1)			 \ | |
| 38 | 			 : "a" (0), "0" (sizeof (fd_set)		 \ | |
| 39 | 					 / sizeof (__fd_mask)),	 \ | |
| 40 | 			 "1" (&__FDS_BITS (fdsp)[0])			 \ | |
| 41 | 			 : "memory");					 \ | |
| 42 | } while (0) | |
| 43 | ||
| 44 | #else	/* ! GNU CC */ | |
| 45 | ||
| 46 | /* We don't use `memset' because this would require a prototype and | |
| 47 | the array isn't too big. */ | |
| 48 | # define __FD_ZERO(set) \ | |
| 49 | do {									 \ | |
| 50 | unsigned int __i;							 \ | |
| 51 | fd_set *__arr = (set);						 \ | |
| 52 | for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i)	 \ | |
| 53 | __FDS_BITS (__arr)[__i] = 0;					 \ | |
| 54 | } while (0) | |
| 55 | ||
| 56 | #endif	/* GNU CC */ | |
| 57 | ||
| 58 | #define __FD_SET(d, set) \ | |
| 59 | ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d))) | |
| 60 | #define __FD_CLR(d, set) \ | |
| 61 | ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d))) | |
| 62 | #define __FD_ISSET(d, set) \ | |
| 63 | ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0) |
lib/libc/glibc/sysdeps/x86/nptl/bits/pthreadtypes-arch.h+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/x86/sysdep.h+6-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembler macros for x86. |
| 2 | Copyright (C) 2017-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -57,6 +57,11 @@ enum cf_protection_level |
| 57 | 57 | #define STATE_SAVE_MASK \ |
| 58 | 58 | ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 5) | (1 << 6) | (1 << 7)) |
| 59 | 59 | |
| 60 | /* Constants for bits in __x86_string_control: */ | |
| 61 | ||
| 62 | /* Avoid short distance REP MOVSB. */ | |
| 63 | #define X86_STRING_CONTROL_AVOID_SHORT_DISTANCE_REP_MOVSB	(1 << 0) | |
| 64 | ||
| 60 | 65 | #ifdef	__ASSEMBLER__ |
| 61 | 66 | |
| 62 | 67 | /* Syntactic details of assembler. */ |
lib/libc/glibc/sysdeps/x86_64/crti.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for x86-64. |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/x86_64/crtn.S+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Special .init and .fini section support for x86-64. |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/sysdeps/x86_64/start.S+5-9| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Startup code compliant to the ELF x86-64 ABI. |
| 2 | Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2001-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | Contributed by Andreas Jaeger <aj@suse.de>, 2001. |
| 5 | 5 | |
| ... | ... | @@ -96,17 +96,13 @@ ENTRY (_start) |
| 96 | 96 | 	 which grow downwards). */ |
| 97 | 97 | 	pushq %rsp |
| 98 | 98 | |
| 99 | #ifdef PIC | |
| 100 | 	/* Pass address of our own entry points to .fini and .init. */ | |
| 101 | 	mov __libc_csu_fini@GOTPCREL(%rip), %R8_LP | |
| 102 | 	mov __libc_csu_init@GOTPCREL(%rip), %RCX_LP | |
| 99 | 	/* These used to be the addresses of .fini and .init. */ | |
| 100 | 	xorl %r8d, %r8d | |
| 101 | 	xorl %ecx, %ecx | |
| 103 | 102 | |
| 103 | #ifdef PIC | |
| 104 | 104 | 	mov main@GOTPCREL(%rip), %RDI_LP |
| 105 | 105 | #else |
| 106 | 	/* Pass address of our own entry points to .fini and .init. */ | |
| 107 | 	mov $__libc_csu_fini, %R8_LP | |
| 108 | 	mov $__libc_csu_init, %RCX_LP | |
| 109 | ||
| 110 | 106 | 	mov $main, %RDI_LP |
| 111 | 107 | #endif |
| 112 | 108 |
lib/libc/glibc/sysdeps/x86_64/sysdep.h+23-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembler macros for x86-64. |
| 2 | Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2001-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -95,6 +95,28 @@ lose:									 \ |
| 95 | 95 | #define R14_LP	r14 |
| 96 | 96 | #define R15_LP	r15 |
| 97 | 97 | |
| 98 | /* Zero upper vector registers and return with xtest. NB: Use VZEROALL | |
| 99 | to avoid RTM abort triggered by VZEROUPPER inside transactionally. */ | |
| 100 | #define ZERO_UPPER_VEC_REGISTERS_RETURN_XTEST \ | |
| 101 | 	xtest;							\ | |
| 102 | 	jz	1f;						\ | |
| 103 | 	vzeroall;						\ | |
| 104 | 	ret;							\ | |
| 105 | 1:								\ | |
| 106 | 	vzeroupper;						\ | |
| 107 | 	ret | |
| 108 | ||
| 109 | /* Zero upper vector registers and return. */ | |
| 110 | #ifndef ZERO_UPPER_VEC_REGISTERS_RETURN | |
| 111 | # define ZERO_UPPER_VEC_REGISTERS_RETURN \ | |
| 112 | 	VZEROUPPER;						\ | |
| 113 | 	ret | |
| 114 | #endif | |
| 115 | ||
| 116 | #ifndef VZEROUPPER_RETURN | |
| 117 | # define VZEROUPPER_RETURN	VZEROUPPER; ret | |
| 118 | #endif | |
| 119 | ||
| 98 | 120 | #else	/* __ASSEMBLER__ */ |
| 99 | 121 | |
| 100 | 122 | /* Long and pointer size in bytes. */ |
lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | /* Assembler macros for x32. |
| 2 | Copyright (C) 2012-2020 Free Software Foundation, Inc. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| 5 | 5 | The GNU C Library is free software; you can redistribute it and/or |
lib/libc/glibc/time/bits/types/struct_timespec.h+6-1| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | |
| 5 | 5 | #include <bits/types.h> |
| 6 | 6 | #include <bits/endian.h> |
| 7 | #include <bits/types/time_t.h> | |
| 7 | 8 | |
| 8 | 9 | /* POSIX.1b structure for a time value. This is like a `struct timeval' but |
| 9 | 10 | has nanoseconds instead of microseconds. */ |
| 10 | 11 | struct timespec |
| 11 | 12 | { |
| 13 | #ifdef __USE_TIME_BITS64 | |
| 14 | __time64_t tv_sec;		/* Seconds. */ | |
| 15 | #else | |
| 12 | 16 | __time_t tv_sec;		/* Seconds. */ |
| 17 | #endif | |
| 13 | 18 | #if __WORDSIZE == 64 \ |
| 14 | 19 | || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \ |
| 15 | || __TIMESIZE == 32 | |
| 20 | || (__TIMESIZE == 32 && !defined __USE_TIME_BITS64) | |
| 16 | 21 | __syscall_slong_t tv_nsec;	/* Nanoseconds. */ |
| 17 | 22 | #else |
| 18 | 23 | # if __BYTE_ORDER == __BIG_ENDIAN |
lib/libc/glibc/time/bits/types/struct_timeval.h+5| ... | ... | @@ -7,7 +7,12 @@ |
| 7 | 7 | microsecond but also has a range of years. */ |
| 8 | 8 | struct timeval |
| 9 | 9 | { |
| 10 | #ifdef __USE_TIME_BITS64 | |
| 11 | __time64_t tv_sec;		/* Seconds. */ | |
| 12 | __suseconds64_t tv_usec;	/* Microseconds. */ | |
| 13 | #else | |
| 10 | 14 | __time_t tv_sec;		/* Seconds. */ |
| 11 | 15 | __suseconds_t tv_usec;	/* Microseconds. */ |
| 16 | #endif | |
| 12 | 17 | }; |
| 13 | 18 | #endif |
lib/libc/glibc/time/bits/types/time_t.h+4| ... | ... | @@ -4,6 +4,10 @@ |
| 4 | 4 | #include <bits/types.h> |
| 5 | 5 | |
| 6 | 6 | /* Returned by `time'. */ |
| 7 | #ifdef __USE_TIME_BITS64 | |
| 8 | typedef __time64_t time_t; | |
| 9 | #else | |
| 7 | 10 | typedef __time_t time_t; |
| 11 | #endif | |
| 8 | 12 | |
| 9 | 13 | #endif |
lib/libc/include/aarch64-linux-gnu/bits/local_lim.h deleted-101| ... | ... | @@ -1,101 +0,0 @@ |
| 1 | /* Minimum guaranteed maximum values for system limits. Linux version. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | ||
| 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 License as | |
| 8 | published by the Free Software Foundation; either version 2.1 of the | |
| 9 | 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 | /* The kernel header pollutes the namespace with the NR_OPEN symbol | |
| 21 | and defines LINK_MAX although filesystems have different maxima. A | |
| 22 | similar thing is true for OPEN_MAX: the limit can be changed at | |
| 23 | runtime and therefore the macro must not be defined. Remove this | |
| 24 | after including the header if necessary. */ | |
| 25 | #ifndef NR_OPEN | |
| 26 | # define __undef_NR_OPEN | |
| 27 | #endif | |
| 28 | #ifndef LINK_MAX | |
| 29 | # define __undef_LINK_MAX | |
| 30 | #endif | |
| 31 | #ifndef OPEN_MAX | |
| 32 | # define __undef_OPEN_MAX | |
| 33 | #endif | |
| 34 | #ifndef ARG_MAX | |
| 35 | # define __undef_ARG_MAX | |
| 36 | #endif | |
| 37 | ||
| 38 | /* The kernel sources contain a file with all the needed information. */ | |
| 39 | #include <linux/limits.h> | |
| 40 | ||
| 41 | /* Have to remove NR_OPEN? */ | |
| 42 | #ifdef __undef_NR_OPEN | |
| 43 | # undef NR_OPEN | |
| 44 | # undef __undef_NR_OPEN | |
| 45 | #endif | |
| 46 | /* Have to remove LINK_MAX? */ | |
| 47 | #ifdef __undef_LINK_MAX | |
| 48 | # undef LINK_MAX | |
| 49 | # undef __undef_LINK_MAX | |
| 50 | #endif | |
| 51 | /* Have to remove OPEN_MAX? */ | |
| 52 | #ifdef __undef_OPEN_MAX | |
| 53 | # undef OPEN_MAX | |
| 54 | # undef __undef_OPEN_MAX | |
| 55 | #endif | |
| 56 | /* Have to remove ARG_MAX? */ | |
| 57 | #ifdef __undef_ARG_MAX | |
| 58 | # undef ARG_MAX | |
| 59 | # undef __undef_ARG_MAX | |
| 60 | #endif | |
| 61 | ||
| 62 | /* The number of data keys per process. */ | |
| 63 | #define _POSIX_THREAD_KEYS_MAX	128 | |
| 64 | /* This is the value this implementation supports. */ | |
| 65 | #define PTHREAD_KEYS_MAX	1024 | |
| 66 | ||
| 67 | /* Controlling the iterations of destructors for thread-specific data. */ | |
| 68 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4 | |
| 69 | /* Number of iterations this implementation does. */ | |
| 70 | #define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS | |
| 71 | ||
| 72 | /* The number of threads per process. */ | |
| 73 | #define _POSIX_THREAD_THREADS_MAX	64 | |
| 74 | /* We have no predefined limit on the number of threads. */ | |
| 75 | #undef PTHREAD_THREADS_MAX | |
| 76 | ||
| 77 | /* Maximum amount by which a process can descrease its asynchronous I/O | |
| 78 | priority level. */ | |
| 79 | #define AIO_PRIO_DELTA_MAX	20 | |
| 80 | ||
| 81 | /* Minimum size for a thread. At least two pages for systems with 64k | |
| 82 | pages. */ | |
| 83 | #define PTHREAD_STACK_MIN	131072 | |
| 84 | ||
| 85 | /* Maximum number of timer expiration overruns. */ | |
| 86 | #define DELAYTIMER_MAX	2147483647 | |
| 87 | ||
| 88 | /* Maximum tty name length. */ | |
| 89 | #define TTY_NAME_MAX		32 | |
| 90 | ||
| 91 | /* Maximum login name length. This is arbitrary. */ | |
| 92 | #define LOGIN_NAME_MAX		256 | |
| 93 | ||
| 94 | /* Maximum host name length. */ | |
| 95 | #define HOST_NAME_MAX		64 | |
| 96 | ||
| 97 | /* Maximum message queue priority level. */ | |
| 98 | #define MQ_PRIO_MAX		32768 | |
| 99 | ||
| 100 | /* Maximum value the semaphore can have. */ | |
| 101 | #define SEM_VALUE_MAX (2147483647) | |
| \ No newline at end of file |
lib/libc/include/aarch64-linux-gnu/bits/pthread_stack_min.h created+22| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. Linux/aarch64 version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | ||
| 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 License as | |
| 8 | published by the Free Software Foundation; either version 2.1 of the | |
| 9 | 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 | /* Minimum size for a thread. At least two pages for systems with 64k | |
| 21 | pages. */ | |
| 22 | #define PTHREAD_STACK_MIN	131072 | |
| \ No newline at end of file |
lib/libc/include/aarch64-linux-gnu/bits/statfs.h deleted-86| ... | ... | @@ -1,86 +0,0 @@ |
| 1 | /* Copyright (C) 2011-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_STATFS_H | |
| 20 | # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/endian.h> | |
| 24 | #include <bits/types.h> | |
| 25 | #include <bits/wordsize.h> | |
| 26 | ||
| 27 | /* 64-bit libc uses the kernel's 'struct statfs', accessed via the | |
| 28 | statfs() syscall; 32-bit libc uses the kernel's 'struct statfs64' | |
| 29 | and accesses it via the statfs64() syscall. All the various | |
| 30 | APIs offered by libc use the kernel shape for their struct statfs | |
| 31 | structure; the only difference is that 32-bit programs not | |
| 32 | using __USE_FILE_OFFSET64 only see the low 32 bits of some | |
| 33 | of the fields (the __fsblkcnt_t and __fsfilcnt_t fields). */ | |
| 34 | ||
| 35 | #if defined __USE_FILE_OFFSET64 | |
| 36 | # define __field64(type, type64, name) type64 name | |
| 37 | #elif __WORDSIZE == 64 || __STATFS_MATCHES_STATFS64 | |
| 38 | # define __field64(type, type64, name) type name | |
| 39 | #elif __BYTE_ORDER == __LITTLE_ENDIAN | |
| 40 | # define __field64(type, type64, name) \ | |
| 41 | type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad | |
| 42 | #else | |
| 43 | # define __field64(type, type64, name) \ | |
| 44 | int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name | |
| 45 | #endif | |
| 46 | ||
| 47 | struct statfs | |
| 48 | { | |
| 49 | __SWORD_TYPE f_type; | |
| 50 | __SWORD_TYPE f_bsize; | |
| 51 | __field64(__fsblkcnt_t, __fsblkcnt64_t, f_blocks); | |
| 52 | __field64(__fsblkcnt_t, __fsblkcnt64_t, f_bfree); | |
| 53 | __field64(__fsblkcnt_t, __fsblkcnt64_t, f_bavail); | |
| 54 | __field64(__fsfilcnt_t, __fsfilcnt64_t, f_files); | |
| 55 | __field64(__fsfilcnt_t, __fsfilcnt64_t, f_ffree); | |
| 56 | __fsid_t f_fsid; | |
| 57 | __SWORD_TYPE f_namelen; | |
| 58 | __SWORD_TYPE f_frsize; | |
| 59 | __SWORD_TYPE f_flags; | |
| 60 | __SWORD_TYPE f_spare[4]; | |
| 61 | }; | |
| 62 | ||
| 63 | #undef __field64 | |
| 64 | ||
| 65 | #ifdef __USE_LARGEFILE64 | |
| 66 | struct statfs64 | |
| 67 | { | |
| 68 | __SWORD_TYPE f_type; | |
| 69 | __SWORD_TYPE f_bsize; | |
| 70 | __fsblkcnt64_t f_blocks; | |
| 71 | __fsblkcnt64_t f_bfree; | |
| 72 | __fsblkcnt64_t f_bavail; | |
| 73 | __fsfilcnt64_t f_files; | |
| 74 | __fsfilcnt64_t f_ffree; | |
| 75 | __fsid_t f_fsid; | |
| 76 | __SWORD_TYPE f_namelen; | |
| 77 | __SWORD_TYPE f_frsize; | |
| 78 | __SWORD_TYPE f_flags; | |
| 79 | __SWORD_TYPE f_spare[4]; | |
| 80 | }; | |
| 81 | #endif | |
| 82 | ||
| 83 | /* Tell code we have these members. */ | |
| 84 | #define _STATFS_F_NAMELEN | |
| 85 | #define _STATFS_F_FRSIZE | |
| 86 | #define _STATFS_F_FLAGS | |
| \ No newline at end of file |
lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | #define LIBANL_SO "libanl.so.1" |
| 9 | 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 10 | 10 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | 12 | #define LIBC_SO "libc.so.6" |
| 12 | 13 | #define LIBDL_SO "libdl.so.2" |
| 13 | 14 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/aarch64-linux-gnu/sys/ptrace.h+50| ... | ... | @@ -25,6 +25,40 @@ |
| 25 | 25 | |
| 26 | 26 | __BEGIN_DECLS |
| 27 | 27 | |
| 28 | /* Avoid collision if the linux ptrace header is already included. */ | |
| 29 | #undef PTRACE_TRACEME | |
| 30 | #undef PTRACE_PEEKTEXT | |
| 31 | #undef PTRACE_PEEKDATA | |
| 32 | #undef PTRACE_PEEKUSER | |
| 33 | #undef PTRACE_POKETEXT | |
| 34 | #undef PTRACE_POKEDATA | |
| 35 | #undef PTRACE_POKEUSER | |
| 36 | #undef PTRACE_CONT | |
| 37 | #undef PTRACE_KILL | |
| 38 | #undef PTRACE_SINGLESTEP | |
| 39 | #undef PTRACE_ATTACH | |
| 40 | #undef PTRACE_DETACH | |
| 41 | #undef PTRACE_SYSCALL | |
| 42 | #undef PTRACE_SYSEMU | |
| 43 | #undef PTRACE_SYSEMU_SINGLESTEP | |
| 44 | #undef PTRACE_PEEKMTETAGS | |
| 45 | #undef PTRACE_POKEMTETAGS | |
| 46 | #undef PTRACE_SETOPTIONS | |
| 47 | #undef PTRACE_GETEVENTMSG | |
| 48 | #undef PTRACE_GETSIGINFO | |
| 49 | #undef PTRACE_SETSIGINFO | |
| 50 | #undef PTRACE_GETREGSET | |
| 51 | #undef PTRACE_SETREGSET | |
| 52 | #undef PTRACE_SEIZE | |
| 53 | #undef PTRACE_INTERRUPT | |
| 54 | #undef PTRACE_LISTEN | |
| 55 | #undef PTRACE_PEEKSIGINFO | |
| 56 | #undef PTRACE_GETSIGMASK | |
| 57 | #undef PTRACE_SETSIGMASK | |
| 58 | #undef PTRACE_SECCOMP_GET_FILTER | |
| 59 | #undef PTRACE_SECCOMP_GET_METADATA | |
| 60 | #undef PTRACE_GET_SYSCALL_INFO | |
| 61 | ||
| 28 | 62 | /* Type of the REQUEST argument to `ptrace.' */ |
| 29 | 63 | enum __ptrace_request |
| 30 | 64 | { |
| ... | ... | @@ -82,6 +116,22 @@ enum __ptrace_request |
| 82 | 116 | PTRACE_SYSCALL = 24, |
| 83 | 117 | #define PT_SYSCALL PTRACE_SYSCALL |
| 84 | 118 | |
| 119 | /* Continue and stop at the next syscall, it will not be executed. */ | |
| 120 | PTRACE_SYSEMU = 31, | |
| 121 | #define PT_SYSEMU PTRACE_SYSEMU | |
| 122 | ||
| 123 | /* Single step the process, the next syscall will not be executed. */ | |
| 124 | PTRACE_SYSEMU_SINGLESTEP = 32, | |
| 125 | #define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP | |
| 126 | ||
| 127 | /* Read MTE tags. */ | |
| 128 | PTRACE_PEEKMTETAGS = 33, | |
| 129 | #define PT_PEEKMTETAGS PTRACE_PEEKMTETAGS | |
| 130 | ||
| 131 | /* Write MTE tags. */ | |
| 132 | PTRACE_POKEMTETAGS = 34, | |
| 133 | #define PT_POKEMTETAGS PTRACE_POKEMTETAGS | |
| 134 | ||
| 85 | 135 | /* Set ptrace filter options. */ |
| 86 | 136 | PTRACE_SETOPTIONS = 0x4200, |
| 87 | 137 | #define PT_SETOPTIONS PTRACE_SETOPTIONS |
lib/libc/include/aarch64_be-linux-gnu/bits/local_lim.h deleted-101| ... | ... | @@ -1,101 +0,0 @@ |
| 1 | /* Minimum guaranteed maximum values for system limits. Linux version. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | ||
| 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 License as | |
| 8 | published by the Free Software Foundation; either version 2.1 of the | |
| 9 | 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 | /* The kernel header pollutes the namespace with the NR_OPEN symbol | |
| 21 | and defines LINK_MAX although filesystems have different maxima. A | |
| 22 | similar thing is true for OPEN_MAX: the limit can be changed at | |
| 23 | runtime and therefore the macro must not be defined. Remove this | |
| 24 | after including the header if necessary. */ | |
| 25 | #ifndef NR_OPEN | |
| 26 | # define __undef_NR_OPEN | |
| 27 | #endif | |
| 28 | #ifndef LINK_MAX | |
| 29 | # define __undef_LINK_MAX | |
| 30 | #endif | |
| 31 | #ifndef OPEN_MAX | |
| 32 | # define __undef_OPEN_MAX | |
| 33 | #endif | |
| 34 | #ifndef ARG_MAX | |
| 35 | # define __undef_ARG_MAX | |
| 36 | #endif | |
| 37 | ||
| 38 | /* The kernel sources contain a file with all the needed information. */ | |
| 39 | #include <linux/limits.h> | |
| 40 | ||
| 41 | /* Have to remove NR_OPEN? */ | |
| 42 | #ifdef __undef_NR_OPEN | |
| 43 | # undef NR_OPEN | |
| 44 | # undef __undef_NR_OPEN | |
| 45 | #endif | |
| 46 | /* Have to remove LINK_MAX? */ | |
| 47 | #ifdef __undef_LINK_MAX | |
| 48 | # undef LINK_MAX | |
| 49 | # undef __undef_LINK_MAX | |
| 50 | #endif | |
| 51 | /* Have to remove OPEN_MAX? */ | |
| 52 | #ifdef __undef_OPEN_MAX | |
| 53 | # undef OPEN_MAX | |
| 54 | # undef __undef_OPEN_MAX | |
| 55 | #endif | |
| 56 | /* Have to remove ARG_MAX? */ | |
| 57 | #ifdef __undef_ARG_MAX | |
| 58 | # undef ARG_MAX | |
| 59 | # undef __undef_ARG_MAX | |
| 60 | #endif | |
| 61 | ||
| 62 | /* The number of data keys per process. */ | |
| 63 | #define _POSIX_THREAD_KEYS_MAX	128 | |
| 64 | /* This is the value this implementation supports. */ | |
| 65 | #define PTHREAD_KEYS_MAX	1024 | |
| 66 | ||
| 67 | /* Controlling the iterations of destructors for thread-specific data. */ | |
| 68 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4 | |
| 69 | /* Number of iterations this implementation does. */ | |
| 70 | #define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS | |
| 71 | ||
| 72 | /* The number of threads per process. */ | |
| 73 | #define _POSIX_THREAD_THREADS_MAX	64 | |
| 74 | /* We have no predefined limit on the number of threads. */ | |
| 75 | #undef PTHREAD_THREADS_MAX | |
| 76 | ||
| 77 | /* Maximum amount by which a process can descrease its asynchronous I/O | |
| 78 | priority level. */ | |
| 79 | #define AIO_PRIO_DELTA_MAX	20 | |
| 80 | ||
| 81 | /* Minimum size for a thread. At least two pages for systems with 64k | |
| 82 | pages. */ | |
| 83 | #define PTHREAD_STACK_MIN	131072 | |
| 84 | ||
| 85 | /* Maximum number of timer expiration overruns. */ | |
| 86 | #define DELAYTIMER_MAX	2147483647 | |
| 87 | ||
| 88 | /* Maximum tty name length. */ | |
| 89 | #define TTY_NAME_MAX		32 | |
| 90 | ||
| 91 | /* Maximum login name length. This is arbitrary. */ | |
| 92 | #define LOGIN_NAME_MAX		256 | |
| 93 | ||
| 94 | /* Maximum host name length. */ | |
| 95 | #define HOST_NAME_MAX		64 | |
| 96 | ||
| 97 | /* Maximum message queue priority level. */ | |
| 98 | #define MQ_PRIO_MAX		32768 | |
| 99 | ||
| 100 | /* Maximum value the semaphore can have. */ | |
| 101 | #define SEM_VALUE_MAX (2147483647) | |
| \ No newline at end of file |
lib/libc/include/aarch64_be-linux-gnu/bits/pthread_stack_min.h created+22| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. Linux/aarch64 version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | ||
| 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 License as | |
| 8 | published by the Free Software Foundation; either version 2.1 of the | |
| 9 | 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 | /* Minimum size for a thread. At least two pages for systems with 64k | |
| 21 | pages. */ | |
| 22 | #define PTHREAD_STACK_MIN	131072 | |
| \ No newline at end of file |
lib/libc/include/aarch64_be-linux-gnu/bits/statfs.h deleted-86| ... | ... | @@ -1,86 +0,0 @@ |
| 1 | /* Copyright (C) 2011-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_STATFS_H | |
| 20 | # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/endian.h> | |
| 24 | #include <bits/types.h> | |
| 25 | #include <bits/wordsize.h> | |
| 26 | ||
| 27 | /* 64-bit libc uses the kernel's 'struct statfs', accessed via the | |
| 28 | statfs() syscall; 32-bit libc uses the kernel's 'struct statfs64' | |
| 29 | and accesses it via the statfs64() syscall. All the various | |
| 30 | APIs offered by libc use the kernel shape for their struct statfs | |
| 31 | structure; the only difference is that 32-bit programs not | |
| 32 | using __USE_FILE_OFFSET64 only see the low 32 bits of some | |
| 33 | of the fields (the __fsblkcnt_t and __fsfilcnt_t fields). */ | |
| 34 | ||
| 35 | #if defined __USE_FILE_OFFSET64 | |
| 36 | # define __field64(type, type64, name) type64 name | |
| 37 | #elif __WORDSIZE == 64 || __STATFS_MATCHES_STATFS64 | |
| 38 | # define __field64(type, type64, name) type name | |
| 39 | #elif __BYTE_ORDER == __LITTLE_ENDIAN | |
| 40 | # define __field64(type, type64, name) \ | |
| 41 | type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad | |
| 42 | #else | |
| 43 | # define __field64(type, type64, name) \ | |
| 44 | int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name | |
| 45 | #endif | |
| 46 | ||
| 47 | struct statfs | |
| 48 | { | |
| 49 | __SWORD_TYPE f_type; | |
| 50 | __SWORD_TYPE f_bsize; | |
| 51 | __field64(__fsblkcnt_t, __fsblkcnt64_t, f_blocks); | |
| 52 | __field64(__fsblkcnt_t, __fsblkcnt64_t, f_bfree); | |
| 53 | __field64(__fsblkcnt_t, __fsblkcnt64_t, f_bavail); | |
| 54 | __field64(__fsfilcnt_t, __fsfilcnt64_t, f_files); | |
| 55 | __field64(__fsfilcnt_t, __fsfilcnt64_t, f_ffree); | |
| 56 | __fsid_t f_fsid; | |
| 57 | __SWORD_TYPE f_namelen; | |
| 58 | __SWORD_TYPE f_frsize; | |
| 59 | __SWORD_TYPE f_flags; | |
| 60 | __SWORD_TYPE f_spare[4]; | |
| 61 | }; | |
| 62 | ||
| 63 | #undef __field64 | |
| 64 | ||
| 65 | #ifdef __USE_LARGEFILE64 | |
| 66 | struct statfs64 | |
| 67 | { | |
| 68 | __SWORD_TYPE f_type; | |
| 69 | __SWORD_TYPE f_bsize; | |
| 70 | __fsblkcnt64_t f_blocks; | |
| 71 | __fsblkcnt64_t f_bfree; | |
| 72 | __fsblkcnt64_t f_bavail; | |
| 73 | __fsfilcnt64_t f_files; | |
| 74 | __fsfilcnt64_t f_ffree; | |
| 75 | __fsid_t f_fsid; | |
| 76 | __SWORD_TYPE f_namelen; | |
| 77 | __SWORD_TYPE f_frsize; | |
| 78 | __SWORD_TYPE f_flags; | |
| 79 | __SWORD_TYPE f_spare[4]; | |
| 80 | }; | |
| 81 | #endif | |
| 82 | ||
| 83 | /* Tell code we have these members. */ | |
| 84 | #define _STATFS_F_NAMELEN | |
| 85 | #define _STATFS_F_FRSIZE | |
| 86 | #define _STATFS_F_FLAGS | |
| \ No newline at end of file |
lib/libc/include/aarch64_be-linux-gnu/gnu/lib-names-lp64_be.h+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | #define LIBANL_SO "libanl.so.1" |
| 9 | 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 10 | 10 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | 12 | #define LIBC_SO "libc.so.6" |
| 12 | 13 | #define LIBDL_SO "libdl.so.2" |
| 13 | 14 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/aarch64_be-linux-gnu/sys/ptrace.h+50| ... | ... | @@ -25,6 +25,40 @@ |
| 25 | 25 | |
| 26 | 26 | __BEGIN_DECLS |
| 27 | 27 | |
| 28 | /* Avoid collision if the linux ptrace header is already included. */ | |
| 29 | #undef PTRACE_TRACEME | |
| 30 | #undef PTRACE_PEEKTEXT | |
| 31 | #undef PTRACE_PEEKDATA | |
| 32 | #undef PTRACE_PEEKUSER | |
| 33 | #undef PTRACE_POKETEXT | |
| 34 | #undef PTRACE_POKEDATA | |
| 35 | #undef PTRACE_POKEUSER | |
| 36 | #undef PTRACE_CONT | |
| 37 | #undef PTRACE_KILL | |
| 38 | #undef PTRACE_SINGLESTEP | |
| 39 | #undef PTRACE_ATTACH | |
| 40 | #undef PTRACE_DETACH | |
| 41 | #undef PTRACE_SYSCALL | |
| 42 | #undef PTRACE_SYSEMU | |
| 43 | #undef PTRACE_SYSEMU_SINGLESTEP | |
| 44 | #undef PTRACE_PEEKMTETAGS | |
| 45 | #undef PTRACE_POKEMTETAGS | |
| 46 | #undef PTRACE_SETOPTIONS | |
| 47 | #undef PTRACE_GETEVENTMSG | |
| 48 | #undef PTRACE_GETSIGINFO | |
| 49 | #undef PTRACE_SETSIGINFO | |
| 50 | #undef PTRACE_GETREGSET | |
| 51 | #undef PTRACE_SETREGSET | |
| 52 | #undef PTRACE_SEIZE | |
| 53 | #undef PTRACE_INTERRUPT | |
| 54 | #undef PTRACE_LISTEN | |
| 55 | #undef PTRACE_PEEKSIGINFO | |
| 56 | #undef PTRACE_GETSIGMASK | |
| 57 | #undef PTRACE_SETSIGMASK | |
| 58 | #undef PTRACE_SECCOMP_GET_FILTER | |
| 59 | #undef PTRACE_SECCOMP_GET_METADATA | |
| 60 | #undef PTRACE_GET_SYSCALL_INFO | |
| 61 | ||
| 28 | 62 | /* Type of the REQUEST argument to `ptrace.' */ |
| 29 | 63 | enum __ptrace_request |
| 30 | 64 | { |
| ... | ... | @@ -82,6 +116,22 @@ enum __ptrace_request |
| 82 | 116 | PTRACE_SYSCALL = 24, |
| 83 | 117 | #define PT_SYSCALL PTRACE_SYSCALL |
| 84 | 118 | |
| 119 | /* Continue and stop at the next syscall, it will not be executed. */ | |
| 120 | PTRACE_SYSEMU = 31, | |
| 121 | #define PT_SYSEMU PTRACE_SYSEMU | |
| 122 | ||
| 123 | /* Single step the process, the next syscall will not be executed. */ | |
| 124 | PTRACE_SYSEMU_SINGLESTEP = 32, | |
| 125 | #define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP | |
| 126 | ||
| 127 | /* Read MTE tags. */ | |
| 128 | PTRACE_PEEKMTETAGS = 33, | |
| 129 | #define PT_PEEKMTETAGS PTRACE_PEEKMTETAGS | |
| 130 | ||
| 131 | /* Write MTE tags. */ | |
| 132 | PTRACE_POKEMTETAGS = 34, | |
| 133 | #define PT_POKEMTETAGS PTRACE_POKEMTETAGS | |
| 134 | ||
| 85 | 135 | /* Set ptrace filter options. */ |
| 86 | 136 | PTRACE_SETOPTIONS = 0x4200, |
| 87 | 137 | #define PT_SETOPTIONS PTRACE_SETOPTIONS |
lib/libc/include/arm-linux-gnueabi/bits/floatn.h created+52| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Defined to 1 if the current compiler invocation provides a | |
| 20 | floating-point type with the IEEE 754 binary128 format, and this glibc | |
| 21 | includes corresponding *f128 interfaces for it. */ | |
| 22 | #define __HAVE_FLOAT128 0 | |
| 23 | ||
| 24 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 25 | from the default float, double and long double types in this glibc. */ | |
| 26 | #define __HAVE_DISTINCT_FLOAT128 0 | |
| 27 | ||
| 28 | /* Defined to 1 if the current compiler invocation provides a | |
| 29 | floating-point type with the right format for _Float64x, and this | |
| 30 | glibc includes corresponding *f64x interfaces for it. */ | |
| 31 | #define __HAVE_FLOAT64X 0 | |
| 32 | ||
| 33 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 34 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 35 | the format of _Float128, which must be different from that of long | |
| 36 | double. */ | |
| 37 | #define __HAVE_FLOAT64X_LONG_DOUBLE 0 | |
| 38 | ||
| 39 | #ifndef __ASSEMBLER__ | |
| 40 | ||
| 41 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 42 | types, if __HAVE_FLOAT128 is 1. | |
| 43 | E.g.: #define __f128(x) x##f128. */ | |
| 44 | # undef __f128 | |
| 45 | ||
| 46 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. | |
| 47 | E.g.: #define __CFLOAT128 _Complex _Float128. */ | |
| 48 | # undef __CFLOAT128 | |
| 49 | ||
| 50 | #endif /* !__ASSEMBLER__. */ | |
| 51 | ||
| 52 | #include <bits/floatn-common.h> | |
| \ No newline at end of file |
lib/libc/include/arm-linux-gnueabi/bits/struct_rwlock.h created+61| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | /* Default read-write lock implementation struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __RWLOCK_INTERNAL_H | |
| 20 | #define __RWLOCK_INTERNAL_H | |
| 21 | ||
| 22 | #include <bits/endian.h> | |
| 23 | ||
| 24 | /* Generic struct for both POSIX read-write lock. New ports are expected | |
| 25 | to use the default layout, however archictetures can redefine it to add | |
| 26 | arch-specific extensions (such as lock-elision). The struct have a size | |
| 27 | of 32 bytes on both LP32 and LP64 architectures. */ | |
| 28 | ||
| 29 | struct __pthread_rwlock_arch_t | |
| 30 | { | |
| 31 | unsigned int __readers; | |
| 32 | unsigned int __writers; | |
| 33 | unsigned int __wrphase_futex; | |
| 34 | unsigned int __writers_futex; | |
| 35 | unsigned int __pad3; | |
| 36 | unsigned int __pad4; | |
| 37 | /* FLAGS must stay at its position in the structure to maintain | |
| 38 | binary compatibility. */ | |
| 39 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 40 | unsigned char __pad1; | |
| 41 | unsigned char __pad2; | |
| 42 | unsigned char __shared; | |
| 43 | unsigned char __flags; | |
| 44 | #else | |
| 45 | unsigned char __flags; | |
| 46 | unsigned char __shared; | |
| 47 | unsigned char __pad1; | |
| 48 | unsigned char __pad2; | |
| 49 | #endif | |
| 50 | int __cur_writer; | |
| 51 | }; | |
| 52 | ||
| 53 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 54 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 55 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 56 | #else | |
| 57 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 58 | 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 | |
| 59 | #endif | |
| 60 | ||
| 61 | #endif | |
| \ No newline at end of file |
lib/libc/include/arm-linux-gnueabi/bits/struct_stat.h+29-21| ... | ... | @@ -28,32 +28,35 @@ |
| 28 | 28 | |
| 29 | 29 | struct stat |
| 30 | 30 | { |
| 31 | #ifdef __USE_TIME_BITS64 | |
| 32 | # include <bits/struct_stat_time64_helper.h> | |
| 33 | #else | |
| 31 | 34 | __dev_t st_dev;			/* Device. */ |
| 32 | 35 | unsigned short int __pad1; |
| 33 | #ifndef __USE_FILE_OFFSET64 | |
| 36 | # ifndef __USE_FILE_OFFSET64 | |
| 34 | 37 | __ino_t st_ino;			/* File serial number.	*/ |
| 35 | #else | |
| 38 | # else | |
| 36 | 39 | __ino_t __st_ino;			/* 32bit file serial number.	*/ |
| 37 | #endif | |
| 40 | # endif | |
| 38 | 41 | __mode_t st_mode;			/* File mode. */ |
| 39 | 42 | __nlink_t st_nlink;			/* Link count. */ |
| 40 | 43 | __uid_t st_uid;			/* User ID of the file's owner.	*/ |
| 41 | 44 | __gid_t st_gid;			/* Group ID of the file's group.*/ |
| 42 | 45 | __dev_t st_rdev;			/* Device number, if device. */ |
| 43 | 46 | unsigned short int __pad2; |
| 44 | #ifndef __USE_FILE_OFFSET64 | |
| 47 | # ifndef __USE_FILE_OFFSET64 | |
| 45 | 48 | __off_t st_size;			/* Size of file, in bytes. */ |
| 46 | #else | |
| 49 | # else | |
| 47 | 50 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 48 | #endif | |
| 51 | # endif | |
| 49 | 52 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 50 | 53 | |
| 51 | #ifndef __USE_FILE_OFFSET64 | |
| 54 | # ifndef __USE_FILE_OFFSET64 | |
| 52 | 55 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 53 | #else | |
| 56 | # else | |
| 54 | 57 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 55 | #endif | |
| 56 | #ifdef __USE_XOPEN2K8 | |
| 58 | # endif | |
| 59 | # ifdef __USE_XOPEN2K8 | |
| 57 | 60 | /* Nanosecond resolution timestamps are stored in a format |
| 58 | 61 | equivalent to 'struct timespec'. This is the type used |
| 59 | 62 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -63,28 +66,32 @@ struct stat |
| 63 | 66 | struct timespec st_atim;		/* Time of last access. */ |
| 64 | 67 | struct timespec st_mtim;		/* Time of last modification. */ |
| 65 | 68 | struct timespec st_ctim;		/* Time of last status change. */ |
| 66 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 67 | # define st_mtime st_mtim.tv_sec | |
| 68 | # define st_ctime st_ctim.tv_sec | |
| 69 | #else | |
| 69 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 70 | # define st_mtime st_mtim.tv_sec | |
| 71 | # define st_ctime st_ctim.tv_sec | |
| 72 | # else | |
| 70 | 73 | __time_t st_atime;			/* Time of last access. */ |
| 71 | 74 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 72 | 75 | __time_t st_mtime;			/* Time of last modification. */ |
| 73 | 76 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 74 | 77 | __time_t st_ctime;			/* Time of last status change. */ |
| 75 | 78 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 76 | #endif | |
| 77 | #ifndef __USE_FILE_OFFSET64 | |
| 79 | # endif | |
| 80 | # ifndef __USE_FILE_OFFSET64 | |
| 78 | 81 | unsigned long int __glibc_reserved4; |
| 79 | 82 | unsigned long int __glibc_reserved5; |
| 80 | #else | |
| 83 | # else | |
| 81 | 84 | __ino64_t st_ino;			/* File serial number.	*/ |
| 82 | #endif | |
| 85 | # endif | |
| 86 | #endif /* __USE_TIME_BITS64 */ | |
| 83 | 87 | }; |
| 84 | 88 | |
| 85 | 89 | #ifdef __USE_LARGEFILE64 |
| 86 | 90 | struct stat64 |
| 87 | 91 | { |
| 92 | # ifdef __USE_TIME_BITS64 | |
| 93 | # include <bits/struct_stat_time64_helper.h> | |
| 94 | # else | |
| 88 | 95 | __dev_t st_dev;			/* Device. */ |
| 89 | 96 | unsigned int __pad1; |
| 90 | 97 | |
| ... | ... | @@ -99,7 +106,7 @@ struct stat64 |
| 99 | 106 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 100 | 107 | |
| 101 | 108 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 102 | # ifdef __USE_XOPEN2K8 | |
| 109 | # ifdef __USE_XOPEN2K8 | |
| 103 | 110 | /* Nanosecond resolution timestamps are stored in a format |
| 104 | 111 | equivalent to 'struct timespec'. This is the type used |
| 105 | 112 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -109,15 +116,16 @@ struct stat64 |
| 109 | 116 | struct timespec st_atim;		/* Time of last access. */ |
| 110 | 117 | struct timespec st_mtim;		/* Time of last modification. */ |
| 111 | 118 | struct timespec st_ctim;		/* Time of last status change. */ |
| 112 | # else | |
| 119 | # else | |
| 113 | 120 | __time_t st_atime;			/* Time of last access. */ |
| 114 | 121 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 115 | 122 | __time_t st_mtime;			/* Time of last modification. */ |
| 116 | 123 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 117 | 124 | __time_t st_ctime;			/* Time of last status change. */ |
| 118 | 125 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 119 | # endif | |
| 126 | # endif | |
| 120 | 127 | __ino64_t st_ino;			/* File serial number.		*/ |
| 128 | # endif /* __USE_TIME_BITS64 */ | |
| 121 | 129 | }; |
| 122 | 130 | #endif |
| 123 | 131 |
lib/libc/include/arm-linux-gnueabi/bits/wordsize.h created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #define __WORDSIZE			32 | |
| 19 | #define __WORDSIZE_TIME64_COMPAT32	0 | |
| 20 | #define __WORDSIZE32_SIZE_ULONG		0 | |
| 21 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| \ No newline at end of file |
lib/libc/include/arm-linux-gnueabihf/bits/floatn.h created+52| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Defined to 1 if the current compiler invocation provides a | |
| 20 | floating-point type with the IEEE 754 binary128 format, and this glibc | |
| 21 | includes corresponding *f128 interfaces for it. */ | |
| 22 | #define __HAVE_FLOAT128 0 | |
| 23 | ||
| 24 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 25 | from the default float, double and long double types in this glibc. */ | |
| 26 | #define __HAVE_DISTINCT_FLOAT128 0 | |
| 27 | ||
| 28 | /* Defined to 1 if the current compiler invocation provides a | |
| 29 | floating-point type with the right format for _Float64x, and this | |
| 30 | glibc includes corresponding *f64x interfaces for it. */ | |
| 31 | #define __HAVE_FLOAT64X 0 | |
| 32 | ||
| 33 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 34 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 35 | the format of _Float128, which must be different from that of long | |
| 36 | double. */ | |
| 37 | #define __HAVE_FLOAT64X_LONG_DOUBLE 0 | |
| 38 | ||
| 39 | #ifndef __ASSEMBLER__ | |
| 40 | ||
| 41 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 42 | types, if __HAVE_FLOAT128 is 1. | |
| 43 | E.g.: #define __f128(x) x##f128. */ | |
| 44 | # undef __f128 | |
| 45 | ||
| 46 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. | |
| 47 | E.g.: #define __CFLOAT128 _Complex _Float128. */ | |
| 48 | # undef __CFLOAT128 | |
| 49 | ||
| 50 | #endif /* !__ASSEMBLER__. */ | |
| 51 | ||
| 52 | #include <bits/floatn-common.h> | |
| \ No newline at end of file |
lib/libc/include/arm-linux-gnueabihf/bits/struct_rwlock.h created+61| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | /* Default read-write lock implementation struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __RWLOCK_INTERNAL_H | |
| 20 | #define __RWLOCK_INTERNAL_H | |
| 21 | ||
| 22 | #include <bits/endian.h> | |
| 23 | ||
| 24 | /* Generic struct for both POSIX read-write lock. New ports are expected | |
| 25 | to use the default layout, however archictetures can redefine it to add | |
| 26 | arch-specific extensions (such as lock-elision). The struct have a size | |
| 27 | of 32 bytes on both LP32 and LP64 architectures. */ | |
| 28 | ||
| 29 | struct __pthread_rwlock_arch_t | |
| 30 | { | |
| 31 | unsigned int __readers; | |
| 32 | unsigned int __writers; | |
| 33 | unsigned int __wrphase_futex; | |
| 34 | unsigned int __writers_futex; | |
| 35 | unsigned int __pad3; | |
| 36 | unsigned int __pad4; | |
| 37 | /* FLAGS must stay at its position in the structure to maintain | |
| 38 | binary compatibility. */ | |
| 39 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 40 | unsigned char __pad1; | |
| 41 | unsigned char __pad2; | |
| 42 | unsigned char __shared; | |
| 43 | unsigned char __flags; | |
| 44 | #else | |
| 45 | unsigned char __flags; | |
| 46 | unsigned char __shared; | |
| 47 | unsigned char __pad1; | |
| 48 | unsigned char __pad2; | |
| 49 | #endif | |
| 50 | int __cur_writer; | |
| 51 | }; | |
| 52 | ||
| 53 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 54 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 55 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 56 | #else | |
| 57 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 58 | 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 | |
| 59 | #endif | |
| 60 | ||
| 61 | #endif | |
| \ No newline at end of file |
lib/libc/include/arm-linux-gnueabihf/bits/struct_stat.h+29-21| ... | ... | @@ -28,32 +28,35 @@ |
| 28 | 28 | |
| 29 | 29 | struct stat |
| 30 | 30 | { |
| 31 | #ifdef __USE_TIME_BITS64 | |
| 32 | # include <bits/struct_stat_time64_helper.h> | |
| 33 | #else | |
| 31 | 34 | __dev_t st_dev;			/* Device. */ |
| 32 | 35 | unsigned short int __pad1; |
| 33 | #ifndef __USE_FILE_OFFSET64 | |
| 36 | # ifndef __USE_FILE_OFFSET64 | |
| 34 | 37 | __ino_t st_ino;			/* File serial number.	*/ |
| 35 | #else | |
| 38 | # else | |
| 36 | 39 | __ino_t __st_ino;			/* 32bit file serial number.	*/ |
| 37 | #endif | |
| 40 | # endif | |
| 38 | 41 | __mode_t st_mode;			/* File mode. */ |
| 39 | 42 | __nlink_t st_nlink;			/* Link count. */ |
| 40 | 43 | __uid_t st_uid;			/* User ID of the file's owner.	*/ |
| 41 | 44 | __gid_t st_gid;			/* Group ID of the file's group.*/ |
| 42 | 45 | __dev_t st_rdev;			/* Device number, if device. */ |
| 43 | 46 | unsigned short int __pad2; |
| 44 | #ifndef __USE_FILE_OFFSET64 | |
| 47 | # ifndef __USE_FILE_OFFSET64 | |
| 45 | 48 | __off_t st_size;			/* Size of file, in bytes. */ |
| 46 | #else | |
| 49 | # else | |
| 47 | 50 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 48 | #endif | |
| 51 | # endif | |
| 49 | 52 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 50 | 53 | |
| 51 | #ifndef __USE_FILE_OFFSET64 | |
| 54 | # ifndef __USE_FILE_OFFSET64 | |
| 52 | 55 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 53 | #else | |
| 56 | # else | |
| 54 | 57 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 55 | #endif | |
| 56 | #ifdef __USE_XOPEN2K8 | |
| 58 | # endif | |
| 59 | # ifdef __USE_XOPEN2K8 | |
| 57 | 60 | /* Nanosecond resolution timestamps are stored in a format |
| 58 | 61 | equivalent to 'struct timespec'. This is the type used |
| 59 | 62 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -63,28 +66,32 @@ struct stat |
| 63 | 66 | struct timespec st_atim;		/* Time of last access. */ |
| 64 | 67 | struct timespec st_mtim;		/* Time of last modification. */ |
| 65 | 68 | struct timespec st_ctim;		/* Time of last status change. */ |
| 66 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 67 | # define st_mtime st_mtim.tv_sec | |
| 68 | # define st_ctime st_ctim.tv_sec | |
| 69 | #else | |
| 69 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 70 | # define st_mtime st_mtim.tv_sec | |
| 71 | # define st_ctime st_ctim.tv_sec | |
| 72 | # else | |
| 70 | 73 | __time_t st_atime;			/* Time of last access. */ |
| 71 | 74 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 72 | 75 | __time_t st_mtime;			/* Time of last modification. */ |
| 73 | 76 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 74 | 77 | __time_t st_ctime;			/* Time of last status change. */ |
| 75 | 78 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 76 | #endif | |
| 77 | #ifndef __USE_FILE_OFFSET64 | |
| 79 | # endif | |
| 80 | # ifndef __USE_FILE_OFFSET64 | |
| 78 | 81 | unsigned long int __glibc_reserved4; |
| 79 | 82 | unsigned long int __glibc_reserved5; |
| 80 | #else | |
| 83 | # else | |
| 81 | 84 | __ino64_t st_ino;			/* File serial number.	*/ |
| 82 | #endif | |
| 85 | # endif | |
| 86 | #endif /* __USE_TIME_BITS64 */ | |
| 83 | 87 | }; |
| 84 | 88 | |
| 85 | 89 | #ifdef __USE_LARGEFILE64 |
| 86 | 90 | struct stat64 |
| 87 | 91 | { |
| 92 | # ifdef __USE_TIME_BITS64 | |
| 93 | # include <bits/struct_stat_time64_helper.h> | |
| 94 | # else | |
| 88 | 95 | __dev_t st_dev;			/* Device. */ |
| 89 | 96 | unsigned int __pad1; |
| 90 | 97 | |
| ... | ... | @@ -99,7 +106,7 @@ struct stat64 |
| 99 | 106 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 100 | 107 | |
| 101 | 108 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 102 | # ifdef __USE_XOPEN2K8 | |
| 109 | # ifdef __USE_XOPEN2K8 | |
| 103 | 110 | /* Nanosecond resolution timestamps are stored in a format |
| 104 | 111 | equivalent to 'struct timespec'. This is the type used |
| 105 | 112 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -109,15 +116,16 @@ struct stat64 |
| 109 | 116 | struct timespec st_atim;		/* Time of last access. */ |
| 110 | 117 | struct timespec st_mtim;		/* Time of last modification. */ |
| 111 | 118 | struct timespec st_ctim;		/* Time of last status change. */ |
| 112 | # else | |
| 119 | # else | |
| 113 | 120 | __time_t st_atime;			/* Time of last access. */ |
| 114 | 121 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 115 | 122 | __time_t st_mtime;			/* Time of last modification. */ |
| 116 | 123 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 117 | 124 | __time_t st_ctime;			/* Time of last status change. */ |
| 118 | 125 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 119 | # endif | |
| 126 | # endif | |
| 120 | 127 | __ino64_t st_ino;			/* File serial number.		*/ |
| 128 | # endif /* __USE_TIME_BITS64 */ | |
| 121 | 129 | }; |
| 122 | 130 | #endif |
| 123 | 131 |
lib/libc/include/arm-linux-gnueabihf/bits/wordsize.h created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #define __WORDSIZE			32 | |
| 19 | #define __WORDSIZE_TIME64_COMPAT32	0 | |
| 20 | #define __WORDSIZE32_SIZE_ULONG		0 | |
| 21 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| \ No newline at end of file |
lib/libc/include/armeb-linux-gnueabi/bits/floatn.h created+52| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Defined to 1 if the current compiler invocation provides a | |
| 20 | floating-point type with the IEEE 754 binary128 format, and this glibc | |
| 21 | includes corresponding *f128 interfaces for it. */ | |
| 22 | #define __HAVE_FLOAT128 0 | |
| 23 | ||
| 24 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 25 | from the default float, double and long double types in this glibc. */ | |
| 26 | #define __HAVE_DISTINCT_FLOAT128 0 | |
| 27 | ||
| 28 | /* Defined to 1 if the current compiler invocation provides a | |
| 29 | floating-point type with the right format for _Float64x, and this | |
| 30 | glibc includes corresponding *f64x interfaces for it. */ | |
| 31 | #define __HAVE_FLOAT64X 0 | |
| 32 | ||
| 33 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 34 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 35 | the format of _Float128, which must be different from that of long | |
| 36 | double. */ | |
| 37 | #define __HAVE_FLOAT64X_LONG_DOUBLE 0 | |
| 38 | ||
| 39 | #ifndef __ASSEMBLER__ | |
| 40 | ||
| 41 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 42 | types, if __HAVE_FLOAT128 is 1. | |
| 43 | E.g.: #define __f128(x) x##f128. */ | |
| 44 | # undef __f128 | |
| 45 | ||
| 46 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. | |
| 47 | E.g.: #define __CFLOAT128 _Complex _Float128. */ | |
| 48 | # undef __CFLOAT128 | |
| 49 | ||
| 50 | #endif /* !__ASSEMBLER__. */ | |
| 51 | ||
| 52 | #include <bits/floatn-common.h> | |
| \ No newline at end of file |
lib/libc/include/armeb-linux-gnueabi/bits/struct_rwlock.h created+61| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | /* Default read-write lock implementation struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __RWLOCK_INTERNAL_H | |
| 20 | #define __RWLOCK_INTERNAL_H | |
| 21 | ||
| 22 | #include <bits/endian.h> | |
| 23 | ||
| 24 | /* Generic struct for both POSIX read-write lock. New ports are expected | |
| 25 | to use the default layout, however archictetures can redefine it to add | |
| 26 | arch-specific extensions (such as lock-elision). The struct have a size | |
| 27 | of 32 bytes on both LP32 and LP64 architectures. */ | |
| 28 | ||
| 29 | struct __pthread_rwlock_arch_t | |
| 30 | { | |
| 31 | unsigned int __readers; | |
| 32 | unsigned int __writers; | |
| 33 | unsigned int __wrphase_futex; | |
| 34 | unsigned int __writers_futex; | |
| 35 | unsigned int __pad3; | |
| 36 | unsigned int __pad4; | |
| 37 | /* FLAGS must stay at its position in the structure to maintain | |
| 38 | binary compatibility. */ | |
| 39 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 40 | unsigned char __pad1; | |
| 41 | unsigned char __pad2; | |
| 42 | unsigned char __shared; | |
| 43 | unsigned char __flags; | |
| 44 | #else | |
| 45 | unsigned char __flags; | |
| 46 | unsigned char __shared; | |
| 47 | unsigned char __pad1; | |
| 48 | unsigned char __pad2; | |
| 49 | #endif | |
| 50 | int __cur_writer; | |
| 51 | }; | |
| 52 | ||
| 53 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 54 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 55 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 56 | #else | |
| 57 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 58 | 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 | |
| 59 | #endif | |
| 60 | ||
| 61 | #endif | |
| \ No newline at end of file |
lib/libc/include/armeb-linux-gnueabi/bits/struct_stat.h+29-21| ... | ... | @@ -28,32 +28,35 @@ |
| 28 | 28 | |
| 29 | 29 | struct stat |
| 30 | 30 | { |
| 31 | #ifdef __USE_TIME_BITS64 | |
| 32 | # include <bits/struct_stat_time64_helper.h> | |
| 33 | #else | |
| 31 | 34 | __dev_t st_dev;			/* Device. */ |
| 32 | 35 | unsigned short int __pad1; |
| 33 | #ifndef __USE_FILE_OFFSET64 | |
| 36 | # ifndef __USE_FILE_OFFSET64 | |
| 34 | 37 | __ino_t st_ino;			/* File serial number.	*/ |
| 35 | #else | |
| 38 | # else | |
| 36 | 39 | __ino_t __st_ino;			/* 32bit file serial number.	*/ |
| 37 | #endif | |
| 40 | # endif | |
| 38 | 41 | __mode_t st_mode;			/* File mode. */ |
| 39 | 42 | __nlink_t st_nlink;			/* Link count. */ |
| 40 | 43 | __uid_t st_uid;			/* User ID of the file's owner.	*/ |
| 41 | 44 | __gid_t st_gid;			/* Group ID of the file's group.*/ |
| 42 | 45 | __dev_t st_rdev;			/* Device number, if device. */ |
| 43 | 46 | unsigned short int __pad2; |
| 44 | #ifndef __USE_FILE_OFFSET64 | |
| 47 | # ifndef __USE_FILE_OFFSET64 | |
| 45 | 48 | __off_t st_size;			/* Size of file, in bytes. */ |
| 46 | #else | |
| 49 | # else | |
| 47 | 50 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 48 | #endif | |
| 51 | # endif | |
| 49 | 52 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 50 | 53 | |
| 51 | #ifndef __USE_FILE_OFFSET64 | |
| 54 | # ifndef __USE_FILE_OFFSET64 | |
| 52 | 55 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 53 | #else | |
| 56 | # else | |
| 54 | 57 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 55 | #endif | |
| 56 | #ifdef __USE_XOPEN2K8 | |
| 58 | # endif | |
| 59 | # ifdef __USE_XOPEN2K8 | |
| 57 | 60 | /* Nanosecond resolution timestamps are stored in a format |
| 58 | 61 | equivalent to 'struct timespec'. This is the type used |
| 59 | 62 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -63,28 +66,32 @@ struct stat |
| 63 | 66 | struct timespec st_atim;		/* Time of last access. */ |
| 64 | 67 | struct timespec st_mtim;		/* Time of last modification. */ |
| 65 | 68 | struct timespec st_ctim;		/* Time of last status change. */ |
| 66 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 67 | # define st_mtime st_mtim.tv_sec | |
| 68 | # define st_ctime st_ctim.tv_sec | |
| 69 | #else | |
| 69 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 70 | # define st_mtime st_mtim.tv_sec | |
| 71 | # define st_ctime st_ctim.tv_sec | |
| 72 | # else | |
| 70 | 73 | __time_t st_atime;			/* Time of last access. */ |
| 71 | 74 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 72 | 75 | __time_t st_mtime;			/* Time of last modification. */ |
| 73 | 76 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 74 | 77 | __time_t st_ctime;			/* Time of last status change. */ |
| 75 | 78 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 76 | #endif | |
| 77 | #ifndef __USE_FILE_OFFSET64 | |
| 79 | # endif | |
| 80 | # ifndef __USE_FILE_OFFSET64 | |
| 78 | 81 | unsigned long int __glibc_reserved4; |
| 79 | 82 | unsigned long int __glibc_reserved5; |
| 80 | #else | |
| 83 | # else | |
| 81 | 84 | __ino64_t st_ino;			/* File serial number.	*/ |
| 82 | #endif | |
| 85 | # endif | |
| 86 | #endif /* __USE_TIME_BITS64 */ | |
| 83 | 87 | }; |
| 84 | 88 | |
| 85 | 89 | #ifdef __USE_LARGEFILE64 |
| 86 | 90 | struct stat64 |
| 87 | 91 | { |
| 92 | # ifdef __USE_TIME_BITS64 | |
| 93 | # include <bits/struct_stat_time64_helper.h> | |
| 94 | # else | |
| 88 | 95 | __dev_t st_dev;			/* Device. */ |
| 89 | 96 | unsigned int __pad1; |
| 90 | 97 | |
| ... | ... | @@ -99,7 +106,7 @@ struct stat64 |
| 99 | 106 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 100 | 107 | |
| 101 | 108 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 102 | # ifdef __USE_XOPEN2K8 | |
| 109 | # ifdef __USE_XOPEN2K8 | |
| 103 | 110 | /* Nanosecond resolution timestamps are stored in a format |
| 104 | 111 | equivalent to 'struct timespec'. This is the type used |
| 105 | 112 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -109,15 +116,16 @@ struct stat64 |
| 109 | 116 | struct timespec st_atim;		/* Time of last access. */ |
| 110 | 117 | struct timespec st_mtim;		/* Time of last modification. */ |
| 111 | 118 | struct timespec st_ctim;		/* Time of last status change. */ |
| 112 | # else | |
| 119 | # else | |
| 113 | 120 | __time_t st_atime;			/* Time of last access. */ |
| 114 | 121 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 115 | 122 | __time_t st_mtime;			/* Time of last modification. */ |
| 116 | 123 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 117 | 124 | __time_t st_ctime;			/* Time of last status change. */ |
| 118 | 125 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 119 | # endif | |
| 126 | # endif | |
| 120 | 127 | __ino64_t st_ino;			/* File serial number.		*/ |
| 128 | # endif /* __USE_TIME_BITS64 */ | |
| 121 | 129 | }; |
| 122 | 130 | #endif |
| 123 | 131 |
lib/libc/include/armeb-linux-gnueabi/bits/wordsize.h created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #define __WORDSIZE			32 | |
| 19 | #define __WORDSIZE_TIME64_COMPAT32	0 | |
| 20 | #define __WORDSIZE32_SIZE_ULONG		0 | |
| 21 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| \ No newline at end of file |
lib/libc/include/armeb-linux-gnueabihf/bits/floatn.h created+52| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Defined to 1 if the current compiler invocation provides a | |
| 20 | floating-point type with the IEEE 754 binary128 format, and this glibc | |
| 21 | includes corresponding *f128 interfaces for it. */ | |
| 22 | #define __HAVE_FLOAT128 0 | |
| 23 | ||
| 24 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 25 | from the default float, double and long double types in this glibc. */ | |
| 26 | #define __HAVE_DISTINCT_FLOAT128 0 | |
| 27 | ||
| 28 | /* Defined to 1 if the current compiler invocation provides a | |
| 29 | floating-point type with the right format for _Float64x, and this | |
| 30 | glibc includes corresponding *f64x interfaces for it. */ | |
| 31 | #define __HAVE_FLOAT64X 0 | |
| 32 | ||
| 33 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 34 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 35 | the format of _Float128, which must be different from that of long | |
| 36 | double. */ | |
| 37 | #define __HAVE_FLOAT64X_LONG_DOUBLE 0 | |
| 38 | ||
| 39 | #ifndef __ASSEMBLER__ | |
| 40 | ||
| 41 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 42 | types, if __HAVE_FLOAT128 is 1. | |
| 43 | E.g.: #define __f128(x) x##f128. */ | |
| 44 | # undef __f128 | |
| 45 | ||
| 46 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. | |
| 47 | E.g.: #define __CFLOAT128 _Complex _Float128. */ | |
| 48 | # undef __CFLOAT128 | |
| 49 | ||
| 50 | #endif /* !__ASSEMBLER__. */ | |
| 51 | ||
| 52 | #include <bits/floatn-common.h> | |
| \ No newline at end of file |
lib/libc/include/armeb-linux-gnueabihf/bits/struct_rwlock.h created+61| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | /* Default read-write lock implementation struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __RWLOCK_INTERNAL_H | |
| 20 | #define __RWLOCK_INTERNAL_H | |
| 21 | ||
| 22 | #include <bits/endian.h> | |
| 23 | ||
| 24 | /* Generic struct for both POSIX read-write lock. New ports are expected | |
| 25 | to use the default layout, however archictetures can redefine it to add | |
| 26 | arch-specific extensions (such as lock-elision). The struct have a size | |
| 27 | of 32 bytes on both LP32 and LP64 architectures. */ | |
| 28 | ||
| 29 | struct __pthread_rwlock_arch_t | |
| 30 | { | |
| 31 | unsigned int __readers; | |
| 32 | unsigned int __writers; | |
| 33 | unsigned int __wrphase_futex; | |
| 34 | unsigned int __writers_futex; | |
| 35 | unsigned int __pad3; | |
| 36 | unsigned int __pad4; | |
| 37 | /* FLAGS must stay at its position in the structure to maintain | |
| 38 | binary compatibility. */ | |
| 39 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 40 | unsigned char __pad1; | |
| 41 | unsigned char __pad2; | |
| 42 | unsigned char __shared; | |
| 43 | unsigned char __flags; | |
| 44 | #else | |
| 45 | unsigned char __flags; | |
| 46 | unsigned char __shared; | |
| 47 | unsigned char __pad1; | |
| 48 | unsigned char __pad2; | |
| 49 | #endif | |
| 50 | int __cur_writer; | |
| 51 | }; | |
| 52 | ||
| 53 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 54 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 55 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 56 | #else | |
| 57 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 58 | 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 | |
| 59 | #endif | |
| 60 | ||
| 61 | #endif | |
| \ No newline at end of file |
lib/libc/include/armeb-linux-gnueabihf/bits/struct_stat.h+29-21| ... | ... | @@ -28,32 +28,35 @@ |
| 28 | 28 | |
| 29 | 29 | struct stat |
| 30 | 30 | { |
| 31 | #ifdef __USE_TIME_BITS64 | |
| 32 | # include <bits/struct_stat_time64_helper.h> | |
| 33 | #else | |
| 31 | 34 | __dev_t st_dev;			/* Device. */ |
| 32 | 35 | unsigned short int __pad1; |
| 33 | #ifndef __USE_FILE_OFFSET64 | |
| 36 | # ifndef __USE_FILE_OFFSET64 | |
| 34 | 37 | __ino_t st_ino;			/* File serial number.	*/ |
| 35 | #else | |
| 38 | # else | |
| 36 | 39 | __ino_t __st_ino;			/* 32bit file serial number.	*/ |
| 37 | #endif | |
| 40 | # endif | |
| 38 | 41 | __mode_t st_mode;			/* File mode. */ |
| 39 | 42 | __nlink_t st_nlink;			/* Link count. */ |
| 40 | 43 | __uid_t st_uid;			/* User ID of the file's owner.	*/ |
| 41 | 44 | __gid_t st_gid;			/* Group ID of the file's group.*/ |
| 42 | 45 | __dev_t st_rdev;			/* Device number, if device. */ |
| 43 | 46 | unsigned short int __pad2; |
| 44 | #ifndef __USE_FILE_OFFSET64 | |
| 47 | # ifndef __USE_FILE_OFFSET64 | |
| 45 | 48 | __off_t st_size;			/* Size of file, in bytes. */ |
| 46 | #else | |
| 49 | # else | |
| 47 | 50 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 48 | #endif | |
| 51 | # endif | |
| 49 | 52 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 50 | 53 | |
| 51 | #ifndef __USE_FILE_OFFSET64 | |
| 54 | # ifndef __USE_FILE_OFFSET64 | |
| 52 | 55 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 53 | #else | |
| 56 | # else | |
| 54 | 57 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 55 | #endif | |
| 56 | #ifdef __USE_XOPEN2K8 | |
| 58 | # endif | |
| 59 | # ifdef __USE_XOPEN2K8 | |
| 57 | 60 | /* Nanosecond resolution timestamps are stored in a format |
| 58 | 61 | equivalent to 'struct timespec'. This is the type used |
| 59 | 62 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -63,28 +66,32 @@ struct stat |
| 63 | 66 | struct timespec st_atim;		/* Time of last access. */ |
| 64 | 67 | struct timespec st_mtim;		/* Time of last modification. */ |
| 65 | 68 | struct timespec st_ctim;		/* Time of last status change. */ |
| 66 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 67 | # define st_mtime st_mtim.tv_sec | |
| 68 | # define st_ctime st_ctim.tv_sec | |
| 69 | #else | |
| 69 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 70 | # define st_mtime st_mtim.tv_sec | |
| 71 | # define st_ctime st_ctim.tv_sec | |
| 72 | # else | |
| 70 | 73 | __time_t st_atime;			/* Time of last access. */ |
| 71 | 74 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 72 | 75 | __time_t st_mtime;			/* Time of last modification. */ |
| 73 | 76 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 74 | 77 | __time_t st_ctime;			/* Time of last status change. */ |
| 75 | 78 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 76 | #endif | |
| 77 | #ifndef __USE_FILE_OFFSET64 | |
| 79 | # endif | |
| 80 | # ifndef __USE_FILE_OFFSET64 | |
| 78 | 81 | unsigned long int __glibc_reserved4; |
| 79 | 82 | unsigned long int __glibc_reserved5; |
| 80 | #else | |
| 83 | # else | |
| 81 | 84 | __ino64_t st_ino;			/* File serial number.	*/ |
| 82 | #endif | |
| 85 | # endif | |
| 86 | #endif /* __USE_TIME_BITS64 */ | |
| 83 | 87 | }; |
| 84 | 88 | |
| 85 | 89 | #ifdef __USE_LARGEFILE64 |
| 86 | 90 | struct stat64 |
| 87 | 91 | { |
| 92 | # ifdef __USE_TIME_BITS64 | |
| 93 | # include <bits/struct_stat_time64_helper.h> | |
| 94 | # else | |
| 88 | 95 | __dev_t st_dev;			/* Device. */ |
| 89 | 96 | unsigned int __pad1; |
| 90 | 97 | |
| ... | ... | @@ -99,7 +106,7 @@ struct stat64 |
| 99 | 106 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 100 | 107 | |
| 101 | 108 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 102 | # ifdef __USE_XOPEN2K8 | |
| 109 | # ifdef __USE_XOPEN2K8 | |
| 103 | 110 | /* Nanosecond resolution timestamps are stored in a format |
| 104 | 111 | equivalent to 'struct timespec'. This is the type used |
| 105 | 112 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -109,15 +116,16 @@ struct stat64 |
| 109 | 116 | struct timespec st_atim;		/* Time of last access. */ |
| 110 | 117 | struct timespec st_mtim;		/* Time of last modification. */ |
| 111 | 118 | struct timespec st_ctim;		/* Time of last status change. */ |
| 112 | # else | |
| 119 | # else | |
| 113 | 120 | __time_t st_atime;			/* Time of last access. */ |
| 114 | 121 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 115 | 122 | __time_t st_mtime;			/* Time of last modification. */ |
| 116 | 123 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 117 | 124 | __time_t st_ctime;			/* Time of last status change. */ |
| 118 | 125 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 119 | # endif | |
| 126 | # endif | |
| 120 | 127 | __ino64_t st_ino;			/* File serial number.		*/ |
| 128 | # endif /* __USE_TIME_BITS64 */ | |
| 121 | 129 | }; |
| 122 | 130 | #endif |
| 123 | 131 |
lib/libc/include/armeb-linux-gnueabihf/bits/wordsize.h created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #define __WORDSIZE			32 | |
| 19 | #define __WORDSIZE_TIME64_COMPAT32	0 | |
| 20 | #define __WORDSIZE32_SIZE_ULONG		0 | |
| 21 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| \ No newline at end of file |
lib/libc/include/csky-linux-gnueabi/bits/floatn.h created+52| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Defined to 1 if the current compiler invocation provides a | |
| 20 | floating-point type with the IEEE 754 binary128 format, and this glibc | |
| 21 | includes corresponding *f128 interfaces for it. */ | |
| 22 | #define __HAVE_FLOAT128 0 | |
| 23 | ||
| 24 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 25 | from the default float, double and long double types in this glibc. */ | |
| 26 | #define __HAVE_DISTINCT_FLOAT128 0 | |
| 27 | ||
| 28 | /* Defined to 1 if the current compiler invocation provides a | |
| 29 | floating-point type with the right format for _Float64x, and this | |
| 30 | glibc includes corresponding *f64x interfaces for it. */ | |
| 31 | #define __HAVE_FLOAT64X 0 | |
| 32 | ||
| 33 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 34 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 35 | the format of _Float128, which must be different from that of long | |
| 36 | double. */ | |
| 37 | #define __HAVE_FLOAT64X_LONG_DOUBLE 0 | |
| 38 | ||
| 39 | #ifndef __ASSEMBLER__ | |
| 40 | ||
| 41 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 42 | types, if __HAVE_FLOAT128 is 1. | |
| 43 | E.g.: #define __f128(x) x##f128. */ | |
| 44 | # undef __f128 | |
| 45 | ||
| 46 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. | |
| 47 | E.g.: #define __CFLOAT128 _Complex _Float128. */ | |
| 48 | # undef __CFLOAT128 | |
| 49 | ||
| 50 | #endif /* !__ASSEMBLER__. */ | |
| 51 | ||
| 52 | #include <bits/floatn-common.h> | |
| \ No newline at end of file |
lib/libc/include/csky-linux-gnueabi/bits/statfs.h-11| ... | ... | @@ -1,6 +1,5 @@ |
| 1 | 1 | /* Copyright (C) 2011-2021 Free Software Foundation, Inc. |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. | |
| 4 | 3 | |
| 5 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| 6 | 5 | modify it under the terms of the GNU Lesser General Public |
| ... | ... | @@ -24,18 +23,8 @@ |
| 24 | 23 | #include <bits/types.h> |
| 25 | 24 | #include <bits/wordsize.h> |
| 26 | 25 | |
| 27 | /* 64-bit libc uses the kernel's 'struct statfs', accessed via the | |
| 28 | statfs() syscall; 32-bit libc uses the kernel's 'struct statfs64' | |
| 29 | and accesses it via the statfs64() syscall. All the various | |
| 30 | APIs offered by libc use the kernel shape for their struct statfs | |
| 31 | structure; the only difference is that 32-bit programs not | |
| 32 | using __USE_FILE_OFFSET64 only see the low 32 bits of some | |
| 33 | of the fields (the __fsblkcnt_t and __fsfilcnt_t fields). */ | |
| 34 | ||
| 35 | 26 | #if defined __USE_FILE_OFFSET64 |
| 36 | 27 | # define __field64(type, type64, name) type64 name |
| 37 | #elif __WORDSIZE == 64 || __STATFS_MATCHES_STATFS64 | |
| 38 | # define __field64(type, type64, name) type name | |
| 39 | 28 | #elif __BYTE_ORDER == __LITTLE_ENDIAN |
| 40 | 29 | # define __field64(type, type64, name) \ |
| 41 | 30 | type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad |
lib/libc/include/csky-linux-gnueabi/bits/struct_rwlock.h created+61| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | /* Default read-write lock implementation struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __RWLOCK_INTERNAL_H | |
| 20 | #define __RWLOCK_INTERNAL_H | |
| 21 | ||
| 22 | #include <bits/endian.h> | |
| 23 | ||
| 24 | /* Generic struct for both POSIX read-write lock. New ports are expected | |
| 25 | to use the default layout, however archictetures can redefine it to add | |
| 26 | arch-specific extensions (such as lock-elision). The struct have a size | |
| 27 | of 32 bytes on both LP32 and LP64 architectures. */ | |
| 28 | ||
| 29 | struct __pthread_rwlock_arch_t | |
| 30 | { | |
| 31 | unsigned int __readers; | |
| 32 | unsigned int __writers; | |
| 33 | unsigned int __wrphase_futex; | |
| 34 | unsigned int __writers_futex; | |
| 35 | unsigned int __pad3; | |
| 36 | unsigned int __pad4; | |
| 37 | /* FLAGS must stay at its position in the structure to maintain | |
| 38 | binary compatibility. */ | |
| 39 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 40 | unsigned char __pad1; | |
| 41 | unsigned char __pad2; | |
| 42 | unsigned char __shared; | |
| 43 | unsigned char __flags; | |
| 44 | #else | |
| 45 | unsigned char __flags; | |
| 46 | unsigned char __shared; | |
| 47 | unsigned char __pad1; | |
| 48 | unsigned char __pad2; | |
| 49 | #endif | |
| 50 | int __cur_writer; | |
| 51 | }; | |
| 52 | ||
| 53 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 54 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 55 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 56 | #else | |
| 57 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 58 | 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 | |
| 59 | #endif | |
| 60 | ||
| 61 | #endif | |
| \ No newline at end of file |
lib/libc/include/csky-linux-gnueabi/bits/wordsize.h created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #define __WORDSIZE			32 | |
| 19 | #define __WORDSIZE_TIME64_COMPAT32	0 | |
| 20 | #define __WORDSIZE32_SIZE_ULONG		0 | |
| 21 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| \ No newline at end of file |
lib/libc/include/csky-linux-gnueabi/gnu/lib-names.h+1| ... | ... | @@ -9,6 +9,7 @@ |
| 9 | 9 | #define LIBANL_SO "libanl.so.1" |
| 10 | 10 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 11 | 11 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 12 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 12 | 13 | #define LIBC_SO "libc.so.6" |
| 13 | 14 | #define LIBDL_SO "libdl.so.2" |
| 14 | 15 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/csky-linux-gnueabihf/bits/floatn.h created+52| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Defined to 1 if the current compiler invocation provides a | |
| 20 | floating-point type with the IEEE 754 binary128 format, and this glibc | |
| 21 | includes corresponding *f128 interfaces for it. */ | |
| 22 | #define __HAVE_FLOAT128 0 | |
| 23 | ||
| 24 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 25 | from the default float, double and long double types in this glibc. */ | |
| 26 | #define __HAVE_DISTINCT_FLOAT128 0 | |
| 27 | ||
| 28 | /* Defined to 1 if the current compiler invocation provides a | |
| 29 | floating-point type with the right format for _Float64x, and this | |
| 30 | glibc includes corresponding *f64x interfaces for it. */ | |
| 31 | #define __HAVE_FLOAT64X 0 | |
| 32 | ||
| 33 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 34 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 35 | the format of _Float128, which must be different from that of long | |
| 36 | double. */ | |
| 37 | #define __HAVE_FLOAT64X_LONG_DOUBLE 0 | |
| 38 | ||
| 39 | #ifndef __ASSEMBLER__ | |
| 40 | ||
| 41 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 42 | types, if __HAVE_FLOAT128 is 1. | |
| 43 | E.g.: #define __f128(x) x##f128. */ | |
| 44 | # undef __f128 | |
| 45 | ||
| 46 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. | |
| 47 | E.g.: #define __CFLOAT128 _Complex _Float128. */ | |
| 48 | # undef __CFLOAT128 | |
| 49 | ||
| 50 | #endif /* !__ASSEMBLER__. */ | |
| 51 | ||
| 52 | #include <bits/floatn-common.h> | |
| \ No newline at end of file |
lib/libc/include/csky-linux-gnueabihf/bits/statfs.h-11| ... | ... | @@ -1,6 +1,5 @@ |
| 1 | 1 | /* Copyright (C) 2011-2021 Free Software Foundation, Inc. |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. | |
| 4 | 3 | |
| 5 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| 6 | 5 | modify it under the terms of the GNU Lesser General Public |
| ... | ... | @@ -24,18 +23,8 @@ |
| 24 | 23 | #include <bits/types.h> |
| 25 | 24 | #include <bits/wordsize.h> |
| 26 | 25 | |
| 27 | /* 64-bit libc uses the kernel's 'struct statfs', accessed via the | |
| 28 | statfs() syscall; 32-bit libc uses the kernel's 'struct statfs64' | |
| 29 | and accesses it via the statfs64() syscall. All the various | |
| 30 | APIs offered by libc use the kernel shape for their struct statfs | |
| 31 | structure; the only difference is that 32-bit programs not | |
| 32 | using __USE_FILE_OFFSET64 only see the low 32 bits of some | |
| 33 | of the fields (the __fsblkcnt_t and __fsfilcnt_t fields). */ | |
| 34 | ||
| 35 | 26 | #if defined __USE_FILE_OFFSET64 |
| 36 | 27 | # define __field64(type, type64, name) type64 name |
| 37 | #elif __WORDSIZE == 64 || __STATFS_MATCHES_STATFS64 | |
| 38 | # define __field64(type, type64, name) type name | |
| 39 | 28 | #elif __BYTE_ORDER == __LITTLE_ENDIAN |
| 40 | 29 | # define __field64(type, type64, name) \ |
| 41 | 30 | type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad |
lib/libc/include/csky-linux-gnueabihf/bits/struct_rwlock.h created+61| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | /* Default read-write lock implementation struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __RWLOCK_INTERNAL_H | |
| 20 | #define __RWLOCK_INTERNAL_H | |
| 21 | ||
| 22 | #include <bits/endian.h> | |
| 23 | ||
| 24 | /* Generic struct for both POSIX read-write lock. New ports are expected | |
| 25 | to use the default layout, however archictetures can redefine it to add | |
| 26 | arch-specific extensions (such as lock-elision). The struct have a size | |
| 27 | of 32 bytes on both LP32 and LP64 architectures. */ | |
| 28 | ||
| 29 | struct __pthread_rwlock_arch_t | |
| 30 | { | |
| 31 | unsigned int __readers; | |
| 32 | unsigned int __writers; | |
| 33 | unsigned int __wrphase_futex; | |
| 34 | unsigned int __writers_futex; | |
| 35 | unsigned int __pad3; | |
| 36 | unsigned int __pad4; | |
| 37 | /* FLAGS must stay at its position in the structure to maintain | |
| 38 | binary compatibility. */ | |
| 39 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 40 | unsigned char __pad1; | |
| 41 | unsigned char __pad2; | |
| 42 | unsigned char __shared; | |
| 43 | unsigned char __flags; | |
| 44 | #else | |
| 45 | unsigned char __flags; | |
| 46 | unsigned char __shared; | |
| 47 | unsigned char __pad1; | |
| 48 | unsigned char __pad2; | |
| 49 | #endif | |
| 50 | int __cur_writer; | |
| 51 | }; | |
| 52 | ||
| 53 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 54 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 55 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 56 | #else | |
| 57 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 58 | 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 | |
| 59 | #endif | |
| 60 | ||
| 61 | #endif | |
| \ No newline at end of file |
lib/libc/include/csky-linux-gnueabihf/bits/wordsize.h created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #define __WORDSIZE			32 | |
| 19 | #define __WORDSIZE_TIME64_COMPAT32	0 | |
| 20 | #define __WORDSIZE32_SIZE_ULONG		0 | |
| 21 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| \ No newline at end of file |
lib/libc/include/csky-linux-gnueabihf/gnu/lib-names.h+1| ... | ... | @@ -9,6 +9,7 @@ |
| 9 | 9 | #define LIBANL_SO "libanl.so.1" |
| 10 | 10 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 11 | 11 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 12 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 12 | 13 | #define LIBC_SO "libc.so.6" |
| 13 | 14 | #define LIBDL_SO "libdl.so.2" |
| 14 | 15 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/generic-glibc/aio.h+12-3| ... | ... | @@ -193,12 +193,17 @@ extern __ssize_t __REDIRECT_NTH (aio_return, (struct aiocb *__aiocbp), |
| 193 | 193 | extern int __REDIRECT_NTH (aio_cancel, |
| 194 | 194 | 			 (int __fildes, struct aiocb *__aiocbp), |
| 195 | 195 | 			 aio_cancel64); |
| 196 | ||
| 196 | # ifdef __USE_TIME_BITS64 | |
| 197 | extern int __REDIRECT_NTH (aio_suspend, | |
| 198 | 			 (const struct aiocb *const __list[], int __nent, | |
| 199 | 			 const struct timespec *__restrict __timeout), | |
| 200 | 			 __aio_suspend_time64) __nonnull ((1)); | |
| 201 | # else | |
| 197 | 202 | extern int __REDIRECT_NTH (aio_suspend, |
| 198 | 203 | 			 (const struct aiocb *const __list[], int __nent, |
| 199 | 204 | 			 const struct timespec *__restrict __timeout), |
| 200 | 205 | 			 aio_suspend64) __nonnull ((1)); |
| 201 | ||
| 206 | # endif | |
| 202 | 207 | extern int __REDIRECT_NTH (aio_fsync, |
| 203 | 208 | 			 (int __operation, struct aiocb *__aiocbp), |
| 204 | 209 | 			 aio_fsync64) __nonnull ((2)); |
| ... | ... | @@ -210,7 +215,11 @@ extern int __REDIRECT_NTH (aio_fsync, |
| 210 | 215 | # define aio_error aio_error64 |
| 211 | 216 | # define aio_return aio_return64 |
| 212 | 217 | # define aio_cancel aio_cancel64 |
| 213 | # define aio_suspend aio_suspend64 | |
| 218 | # ifdef __USE_TIME_BITS64 | |
| 219 | # define aio_suspend __aio_suspend_time64 | |
| 220 | # else | |
| 221 | # define aio_suspend aio_suspend64 | |
| 222 | # endif | |
| 214 | 223 | # define aio_fsync aio_fsync64 |
| 215 | 224 | # endif |
| 216 | 225 | #endif |
lib/libc/include/generic-glibc/arpa/inet.h+2-1| ... | ... | @@ -74,7 +74,8 @@ extern int inet_aton (const char *__cp, struct in_addr *__inp) __THROW; |
| 74 | 74 | |
| 75 | 75 | /* Format a network number NET into presentation format and place result |
| 76 | 76 | in buffer starting at BUF with length of LEN bytes. */ |
| 77 | extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW; | |
| 77 | extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW | |
| 78 | __attribute_deprecated_msg__ ("Use inet_ntop instead"); | |
| 78 | 79 | |
| 79 | 80 | /* Convert network number for interface type AF in buffer starting at |
| 80 | 81 | CP to presentation format. The result will specifiy BITS bits of |
lib/libc/include/generic-glibc/arpa/nameser.h+24-9| ... | ... | @@ -52,6 +52,12 @@ |
| 52 | 52 | #include <sys/types.h> |
| 53 | 53 | #include <stdint.h> |
| 54 | 54 | |
| 55 | #ifdef _LIBC | |
| 56 | # define __NAMESER_DEPRECATED | |
| 57 | #else | |
| 58 | # define __NAMESER_DEPRECATED __attribute_deprecated__ | |
| 59 | #endif | |
| 60 | ||
| 55 | 61 | /* |
| 56 | 62 | * Define constants based on RFC 883, RFC 1034, RFC 1035 |
| 57 | 63 | */ |
| ... | ... | @@ -401,14 +407,18 @@ int		ns_skiprr (const unsigned char *, const unsigned char *, |
| 401 | 407 | int		ns_parserr (ns_msg *, ns_sect, int, ns_rr *) __THROW; |
| 402 | 408 | int		ns_sprintrr (const ns_msg *, const ns_rr *, |
| 403 | 409 | 			 const char *, const char *, char *, size_t) |
| 404 | __THROW; | |
| 410 | __THROW __NAMESER_DEPRECATED; | |
| 405 | 411 | int		ns_sprintrrf (const unsigned char *, size_t, const char *, |
| 406 | 412 | 			 ns_class, ns_type, unsigned long, |
| 407 | 413 | 			 const unsigned char *, size_t, const char *, |
| 408 | 			 const char *, char *, size_t) __THROW; | |
| 409 | int		ns_format_ttl (unsigned long, char *, size_t) __THROW; | |
| 410 | int		ns_parse_ttl (const char *, unsigned long *) __THROW; | |
| 411 | uint32_t	ns_datetosecs (const char *, int *) __THROW; | |
| 414 | 			 const char *, char *, size_t) | |
| 415 | __THROW __NAMESER_DEPRECATED; | |
| 416 | int		ns_format_ttl (unsigned long, char *, size_t) | |
| 417 | __THROW __NAMESER_DEPRECATED; | |
| 418 | int		ns_parse_ttl (const char *, unsigned long *) | |
| 419 | __THROW __NAMESER_DEPRECATED; | |
| 420 | uint32_t	ns_datetosecs (const char *, int *) | |
| 421 | __THROW __NAMESER_DEPRECATED; | |
| 412 | 422 | int		ns_name_ntol (const unsigned char *, unsigned char *, size_t) |
| 413 | 423 | __THROW; |
| 414 | 424 | int		ns_name_ntop (const unsigned char *, char *, size_t) __THROW; |
| ... | ... | @@ -431,10 +441,15 @@ int		ns_name_skip (const unsigned char **, const unsigned char *) |
| 431 | 441 | void		ns_name_rollback (const unsigned char *, |
| 432 | 442 | 				 const unsigned char **, |
| 433 | 443 | 				 const unsigned char **) __THROW; |
| 434 | int		ns_samedomain (const char *, const char *) __THROW; | |
| 435 | int		ns_subdomain (const char *, const char *) __THROW; | |
| 436 | int		ns_makecanon (const char *, char *, size_t) __THROW; | |
| 437 | int		ns_samename (const char *, const char *) __THROW; | |
| 444 | ||
| 445 | int		ns_samedomain (const char *, const char *) __THROW | |
| 446 | __NAMESER_DEPRECATED; | |
| 447 | int		ns_subdomain (const char *, const char *) __THROW | |
| 448 | __NAMESER_DEPRECATED; | |
| 449 | int		ns_makecanon (const char *, char *, size_t) __THROW | |
| 450 | __NAMESER_DEPRECATED; | |
| 451 | int		ns_samename (const char *, const char *) __THROW | |
| 452 | __NAMESER_DEPRECATED; | |
| 438 | 453 | __END_DECLS |
| 439 | 454 | |
| 440 | 455 | #include <arpa/nameser_compat.h> |
lib/libc/include/generic-glibc/bits/confname.h+7-1| ... | ... | @@ -525,8 +525,14 @@ enum |
| 525 | 525 | |
| 526 | 526 | _SC_THREAD_ROBUST_PRIO_INHERIT, |
| 527 | 527 | #define _SC_THREAD_ROBUST_PRIO_INHERIT	_SC_THREAD_ROBUST_PRIO_INHERIT |
| 528 | _SC_THREAD_ROBUST_PRIO_PROTECT | |
| 528 | _SC_THREAD_ROBUST_PRIO_PROTECT, | |
| 529 | 529 | #define _SC_THREAD_ROBUST_PRIO_PROTECT	_SC_THREAD_ROBUST_PRIO_PROTECT |
| 530 | ||
| 531 | _SC_MINSIGSTKSZ, | |
| 532 | #define	_SC_MINSIGSTKSZ			_SC_MINSIGSTKSZ | |
| 533 | ||
| 534 | _SC_SIGSTKSZ | |
| 535 | #define	_SC_SIGSTKSZ			_SC_SIGSTKSZ | |
| 530 | 536 | }; |
| 531 | 537 | |
| 532 | 538 | /* Values for the NAME argument to `confstr'. */ |
lib/libc/include/generic-glibc/bits/floatn.h+58-13| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features. | |
| 1 | /* Macros to control TS 18661-3 glibc features on MIPS platforms. | |
| 2 | 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| ... | ... | @@ -16,10 +16,24 @@ |
| 16 | 16 | License along with the GNU C Library; if not, see |
| 17 | 17 | <https://www.gnu.org/licenses/>. */ |
| 18 | 18 | |
| 19 | #ifndef _BITS_FLOATN_H | |
| 20 | #define _BITS_FLOATN_H | |
| 21 | ||
| 22 | #include <features.h> | |
| 23 | #include <bits/long-double.h> | |
| 24 | ||
| 19 | 25 | /* Defined to 1 if the current compiler invocation provides a |
| 20 | floating-point type with the IEEE 754 binary128 format, and this glibc | |
| 21 | includes corresponding *f128 interfaces for it. */ | |
| 22 | #define __HAVE_FLOAT128 0 | |
| 26 | floating-point type with the IEEE 754 binary128 format, and this | |
| 27 | glibc includes corresponding *f128 interfaces for it. */ | |
| 28 | #ifndef __NO_LONG_DOUBLE_MATH | |
| 29 | # define __HAVE_FLOAT128 1 | |
| 30 | #else | |
| 31 | /* glibc does not support _Float128 for platforms where long double is | |
| 32 | normally binary128 when building with long double as binary64. | |
| 33 | GCC's default for supported scalar modes does not support it either | |
| 34 | in that case. */ | |
| 35 | # define __HAVE_FLOAT128 0 | |
| 36 | #endif | |
| 23 | 37 | |
| 24 | 38 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct |
| 25 | 39 | from the default float, double and long double types in this glibc. */ |
| ... | ... | @@ -28,25 +42,56 @@ |
| 28 | 42 | /* Defined to 1 if the current compiler invocation provides a |
| 29 | 43 | floating-point type with the right format for _Float64x, and this |
| 30 | 44 | glibc includes corresponding *f64x interfaces for it. */ |
| 31 | #define __HAVE_FLOAT64X 0 | |
| 45 | #define __HAVE_FLOAT64X __HAVE_FLOAT128 | |
| 32 | 46 | |
| 33 | 47 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format |
| 34 | 48 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has |
| 35 | 49 | the format of _Float128, which must be different from that of long |
| 36 | 50 | double. */ |
| 37 | #define __HAVE_FLOAT64X_LONG_DOUBLE 0 | |
| 51 | #define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128 | |
| 38 | 52 | |
| 39 | 53 | #ifndef __ASSEMBLER__ |
| 40 | 54 | |
| 41 | 55 | /* Defined to concatenate the literal suffix to be used with _Float128 |
| 42 | types, if __HAVE_FLOAT128 is 1. | |
| 43 | E.g.: #define __f128(x) x##f128. */ | |
| 44 | # undef __f128 | |
| 56 | types, if __HAVE_FLOAT128 is 1. */ | |
| 57 | # if __HAVE_FLOAT128 | |
| 58 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 59 | /* The literal suffix f128 exists only since GCC 7.0. */ | |
| 60 | # define __f128(x) x##l | |
| 61 | # else | |
| 62 | # define __f128(x) x##f128 | |
| 63 | # endif | |
| 64 | # endif | |
| 65 | ||
| 66 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ | |
| 67 | # if __HAVE_FLOAT128 | |
| 68 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 69 | # define __CFLOAT128 _Complex long double | |
| 70 | # else | |
| 71 | # define __CFLOAT128 _Complex _Float128 | |
| 72 | # endif | |
| 73 | # endif | |
| 74 | ||
| 75 | /* The remaining of this file provides support for older compilers. */ | |
| 76 | # if __HAVE_FLOAT128 | |
| 45 | 77 | |
| 46 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. | |
| 47 | E.g.: #define __CFLOAT128 _Complex _Float128. */ | |
| 48 | # undef __CFLOAT128 | |
| 78 | /* The type _Float128 exists only since GCC 7.0. */ | |
| 79 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 80 | typedef long double _Float128; | |
| 81 | # endif | |
| 82 | ||
| 83 | /* Various built-in functions do not exist before GCC 7.0. */ | |
| 84 | # if !__GNUC_PREREQ (7, 0) | |
| 85 | # define __builtin_huge_valf128() (__builtin_huge_vall ()) | |
| 86 | # define __builtin_inff128() (__builtin_infl ()) | |
| 87 | # define __builtin_nanf128(x) (__builtin_nanl (x)) | |
| 88 | # define __builtin_nansf128(x) (__builtin_nansl (x)) | |
| 89 | # endif | |
| 90 | ||
| 91 | # endif | |
| 49 | 92 | |
| 50 | 93 | #endif /* !__ASSEMBLER__. */ |
| 51 | 94 | |
| 52 | #include <bits/floatn-common.h> | |
| \ No newline at end of file | ||
| 95 | #include <bits/floatn-common.h> | |
| 96 | ||
| 97 | #endif /* _BITS_FLOATN_H */ | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/libc-header-start.h+26-2| ... | ... | @@ -44,8 +44,26 @@ |
| 44 | 44 | |
| 45 | 45 | /* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__ |
| 46 | 46 | macro. Most but not all symbols enabled by that macro in TS |
| 47 | 18661-1 are enabled unconditionally in C2X; the symbols in Annex F | |
| 48 | still require that macro in C2X. */ | |
| 47 | 18661-1 are enabled unconditionally in C2X. In C2X, the symbols in | |
| 48 | Annex F still require a new feature test macro | |
| 49 | __STDC_WANT_IEC_60559_EXT__ instead (C2X does not define | |
| 50 | __STDC_WANT_IEC_60559_BFP_EXT__), while a few features from TS | |
| 51 | 18661-1 are not included in C2X (and thus should depend on | |
| 52 | __STDC_WANT_IEC_60559_BFP_EXT__ even when C2X features are | |
| 53 | enabled). | |
| 54 | ||
| 55 | __GLIBC_USE (IEC_60559_BFP_EXT) controls those features from TS | |
| 56 | 18661-1 not included in C2X. | |
| 57 | ||
| 58 | __GLIBC_USE (IEC_60559_BFP_EXT_C2X) controls those features from TS | |
| 59 | 18661-1 that are also included in C2X (with no feature test macro | |
| 60 | required in C2X). | |
| 61 | ||
| 62 | __GLIBC_USE (IEC_60559_EXT) controls those features from TS 18661-1 | |
| 63 | that are included in C2X but conditional on | |
| 64 | __STDC_WANT_IEC_60559_EXT__. (There are currently no features | |
| 65 | conditional on __STDC_WANT_IEC_60559_EXT__ that are not in TS | |
| 66 | 18661-1.) */ | |
| 49 | 67 | #undef __GLIBC_USE_IEC_60559_BFP_EXT |
| 50 | 68 | #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_BFP_EXT__ |
| 51 | 69 | # define __GLIBC_USE_IEC_60559_BFP_EXT 1 |
| ... | ... | @@ -58,6 +76,12 @@ |
| 58 | 76 | #else |
| 59 | 77 | # define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0 |
| 60 | 78 | #endif |
| 79 | #undef __GLIBC_USE_IEC_60559_EXT | |
| 80 | #if __GLIBC_USE (IEC_60559_BFP_EXT) || defined __STDC_WANT_IEC_60559_EXT__ | |
| 81 | # define __GLIBC_USE_IEC_60559_EXT 1 | |
| 82 | #else | |
| 83 | # define __GLIBC_USE_IEC_60559_EXT 0 | |
| 84 | #endif | |
| 61 | 85 | |
| 62 | 86 | /* ISO/IEC TS 18661-4:2015 defines the |
| 63 | 87 | __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction |
lib/libc/include/generic-glibc/bits/local_lim.h+2-2| ... | ... | @@ -77,8 +77,8 @@ |
| 77 | 77 | priority level. */ |
| 78 | 78 | #define AIO_PRIO_DELTA_MAX	20 |
| 79 | 79 | |
| 80 | /* Minimum size for a thread. We are free to choose a reasonable value. */ | |
| 81 | #define PTHREAD_STACK_MIN	16384 | |
| 80 | /* Arrange for the definition of PTHREAD_STACK_MIN. */ | |
| 81 | #include <bits/pthread_stack_min-dynamic.h> | |
| 82 | 82 | |
| 83 | 83 | /* Maximum number of timer expiration overruns. */ |
| 84 | 84 | #define DELAYTIMER_MAX	2147483647 |
lib/libc/include/generic-glibc/bits/mathcalls.h+8-4| ... | ... | @@ -364,17 +364,21 @@ __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round, |
| 364 | 364 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round, |
| 365 | 365 | 				 unsigned int __width)); |
| 366 | 366 | |
| 367 | /* Canonicalize floating-point representation. */ | |
| 368 | __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x)); | |
| 369 | #endif | |
| 370 | ||
| 371 | #if (__GLIBC_USE (IEC_60559_BFP_EXT)				\ | |
| 372 | || (__MATH_DECLARING_FLOATN				\ | |
| 373 | 	 && (defined __USE_GNU || !__GLIBC_USE (ISOC2X)))) | |
| 367 | 374 | /* Return value with maximum magnitude. */ |
| 368 | 375 | __MATHCALLX (fmaxmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); |
| 369 | 376 | |
| 370 | 377 | /* Return value with minimum magnitude. */ |
| 371 | 378 | __MATHCALLX (fminmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); |
| 372 | ||
| 373 | /* Canonicalize floating-point representation. */ | |
| 374 | __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x)); | |
| 375 | 379 | #endif |
| 376 | 380 | |
| 377 | #if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN | |
| 381 | #if __GLIBC_USE (IEC_60559_EXT) || __MATH_DECLARING_FLOATN | |
| 378 | 382 | /* Total order operation. */ |
| 379 | 383 | __MATHDECL_1 (int, totalorder,, (const _Mdouble_ *__x, |
| 380 | 384 | 				 const _Mdouble_ *__y)) |
lib/libc/include/generic-glibc/bits/msq.h+1| ... | ... | @@ -26,6 +26,7 @@ typedef __syscall_ulong_t msgqnum_t; |
| 26 | 26 | typedef __syscall_ulong_t msglen_t; |
| 27 | 27 | |
| 28 | 28 | #include <bits/types/struct_msqid_ds.h> |
| 29 | #include <bits/types/struct_msqid64_ds.h> | |
| 29 | 30 | |
| 30 | 31 | /* Define options for message queue functions. */ |
| 31 | 32 | #define MSG_NOERROR	010000	/* no error if message is too big */ |
lib/libc/include/generic-glibc/bits/platform/x86.h created+311| ... | ... | @@ -0,0 +1,311 @@ |
| 1 | /* Constants and data structures for x86 CPU features. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | Copyright (C) 2008-2020 Free Software Foundation, Inc. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_PLATFORM_X86_H | |
| 20 | # error "Never include <bits/platform/x86.h> directly; use <sys/platform/x86.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | enum | |
| 24 | { | |
| 25 | CPUID_INDEX_1 = 0, | |
| 26 | CPUID_INDEX_7, | |
| 27 | CPUID_INDEX_80000001, | |
| 28 | CPUID_INDEX_D_ECX_1, | |
| 29 | CPUID_INDEX_80000007, | |
| 30 | CPUID_INDEX_80000008, | |
| 31 | CPUID_INDEX_7_ECX_1, | |
| 32 | CPUID_INDEX_19, | |
| 33 | CPUID_INDEX_14_ECX_0 | |
| 34 | }; | |
| 35 | ||
| 36 | struct cpuid_feature | |
| 37 | { | |
| 38 | unsigned int cpuid_array[4]; | |
| 39 | unsigned int active_array[4]; | |
| 40 | }; | |
| 41 | ||
| 42 | enum cpuid_register_index | |
| 43 | { | |
| 44 | cpuid_register_index_eax = 0, | |
| 45 | cpuid_register_index_ebx, | |
| 46 | cpuid_register_index_ecx, | |
| 47 | cpuid_register_index_edx | |
| 48 | }; | |
| 49 | ||
| 50 | /* CPU features. */ | |
| 51 | ||
| 52 | enum | |
| 53 | { | |
| 54 | x86_cpu_index_1_ecx | |
| 55 | = (CPUID_INDEX_1 * 8 * 4 * sizeof (unsigned int) | |
| 56 | + cpuid_register_index_ecx * 8 * sizeof (unsigned int)), | |
| 57 | ||
| 58 | x86_cpu_SSE3			= x86_cpu_index_1_ecx, | |
| 59 | x86_cpu_PCLMULQDQ		= x86_cpu_index_1_ecx + 1, | |
| 60 | x86_cpu_DTES64		= x86_cpu_index_1_ecx + 2, | |
| 61 | x86_cpu_MONITOR		= x86_cpu_index_1_ecx + 3, | |
| 62 | x86_cpu_DS_CPL		= x86_cpu_index_1_ecx + 4, | |
| 63 | x86_cpu_VMX			= x86_cpu_index_1_ecx + 5, | |
| 64 | x86_cpu_SMX			= x86_cpu_index_1_ecx + 6, | |
| 65 | x86_cpu_EIST			= x86_cpu_index_1_ecx + 7, | |
| 66 | x86_cpu_TM2			= x86_cpu_index_1_ecx + 8, | |
| 67 | x86_cpu_SSSE3			= x86_cpu_index_1_ecx + 9, | |
| 68 | x86_cpu_CNXT_ID		= x86_cpu_index_1_ecx + 10, | |
| 69 | x86_cpu_SDBG			= x86_cpu_index_1_ecx + 11, | |
| 70 | x86_cpu_FMA			= x86_cpu_index_1_ecx + 12, | |
| 71 | x86_cpu_CMPXCHG16B		= x86_cpu_index_1_ecx + 13, | |
| 72 | x86_cpu_XTPRUPDCTRL		= x86_cpu_index_1_ecx + 14, | |
| 73 | x86_cpu_PDCM			= x86_cpu_index_1_ecx + 15, | |
| 74 | x86_cpu_INDEX_1_ECX_16	= x86_cpu_index_1_ecx + 16, | |
| 75 | x86_cpu_PCID			= x86_cpu_index_1_ecx + 17, | |
| 76 | x86_cpu_DCA			= x86_cpu_index_1_ecx + 18, | |
| 77 | x86_cpu_SSE4_1		= x86_cpu_index_1_ecx + 19, | |
| 78 | x86_cpu_SSE4_2		= x86_cpu_index_1_ecx + 20, | |
| 79 | x86_cpu_X2APIC		= x86_cpu_index_1_ecx + 21, | |
| 80 | x86_cpu_MOVBE			= x86_cpu_index_1_ecx + 22, | |
| 81 | x86_cpu_POPCNT		= x86_cpu_index_1_ecx + 23, | |
| 82 | x86_cpu_TSC_DEADLINE		= x86_cpu_index_1_ecx + 24, | |
| 83 | x86_cpu_AES			= x86_cpu_index_1_ecx + 25, | |
| 84 | x86_cpu_XSAVE			= x86_cpu_index_1_ecx + 26, | |
| 85 | x86_cpu_OSXSAVE		= x86_cpu_index_1_ecx + 27, | |
| 86 | x86_cpu_AVX			= x86_cpu_index_1_ecx + 28, | |
| 87 | x86_cpu_F16C			= x86_cpu_index_1_ecx + 29, | |
| 88 | x86_cpu_RDRAND		= x86_cpu_index_1_ecx + 30, | |
| 89 | x86_cpu_INDEX_1_ECX_31	= x86_cpu_index_1_ecx + 31, | |
| 90 | ||
| 91 | x86_cpu_index_1_edx | |
| 92 | = (CPUID_INDEX_1 * 8 * 4 * sizeof (unsigned int) | |
| 93 | + cpuid_register_index_edx * 8 * sizeof (unsigned int)), | |
| 94 | ||
| 95 | x86_cpu_FPU			= x86_cpu_index_1_edx, | |
| 96 | x86_cpu_VME			= x86_cpu_index_1_edx + 1, | |
| 97 | x86_cpu_DE			= x86_cpu_index_1_edx + 2, | |
| 98 | x86_cpu_PSE			= x86_cpu_index_1_edx + 3, | |
| 99 | x86_cpu_TSC			= x86_cpu_index_1_edx + 4, | |
| 100 | x86_cpu_MSR			= x86_cpu_index_1_edx + 5, | |
| 101 | x86_cpu_PAE			= x86_cpu_index_1_edx + 6, | |
| 102 | x86_cpu_MCE			= x86_cpu_index_1_edx + 7, | |
| 103 | x86_cpu_CX8			= x86_cpu_index_1_edx + 8, | |
| 104 | x86_cpu_APIC			= x86_cpu_index_1_edx + 9, | |
| 105 | x86_cpu_INDEX_1_EDX_10	= x86_cpu_index_1_edx + 10, | |
| 106 | x86_cpu_SEP			= x86_cpu_index_1_edx + 11, | |
| 107 | x86_cpu_MTRR			= x86_cpu_index_1_edx + 12, | |
| 108 | x86_cpu_PGE			= x86_cpu_index_1_edx + 13, | |
| 109 | x86_cpu_MCA			= x86_cpu_index_1_edx + 14, | |
| 110 | x86_cpu_CMOV			= x86_cpu_index_1_edx + 15, | |
| 111 | x86_cpu_PAT			= x86_cpu_index_1_edx + 16, | |
| 112 | x86_cpu_PSE_36		= x86_cpu_index_1_edx + 17, | |
| 113 | x86_cpu_PSN			= x86_cpu_index_1_edx + 18, | |
| 114 | x86_cpu_CLFSH			= x86_cpu_index_1_edx + 19, | |
| 115 | x86_cpu_INDEX_1_EDX_20	= x86_cpu_index_1_edx + 20, | |
| 116 | x86_cpu_DS			= x86_cpu_index_1_edx + 21, | |
| 117 | x86_cpu_ACPI			= x86_cpu_index_1_edx + 22, | |
| 118 | x86_cpu_MMX			= x86_cpu_index_1_edx + 23, | |
| 119 | x86_cpu_FXSR			= x86_cpu_index_1_edx + 24, | |
| 120 | x86_cpu_SSE			= x86_cpu_index_1_edx + 25, | |
| 121 | x86_cpu_SSE2			= x86_cpu_index_1_edx + 26, | |
| 122 | x86_cpu_SS			= x86_cpu_index_1_edx + 27, | |
| 123 | x86_cpu_HTT			= x86_cpu_index_1_edx + 28, | |
| 124 | x86_cpu_TM			= x86_cpu_index_1_edx + 29, | |
| 125 | x86_cpu_INDEX_1_EDX_30	= x86_cpu_index_1_edx + 30, | |
| 126 | x86_cpu_PBE			= x86_cpu_index_1_edx + 31, | |
| 127 | ||
| 128 | x86_cpu_index_7_ebx | |
| 129 | = (CPUID_INDEX_7 * 8 * 4 * sizeof (unsigned int) | |
| 130 | + cpuid_register_index_ebx * 8 * sizeof (unsigned int)), | |
| 131 | ||
| 132 | x86_cpu_FSGSBASE		= x86_cpu_index_7_ebx, | |
| 133 | x86_cpu_TSC_ADJUST		= x86_cpu_index_7_ebx + 1, | |
| 134 | x86_cpu_SGX			= x86_cpu_index_7_ebx + 2, | |
| 135 | x86_cpu_BMI1			= x86_cpu_index_7_ebx + 3, | |
| 136 | x86_cpu_HLE			= x86_cpu_index_7_ebx + 4, | |
| 137 | x86_cpu_AVX2			= x86_cpu_index_7_ebx + 5, | |
| 138 | x86_cpu_INDEX_7_EBX_6		= x86_cpu_index_7_ebx + 6, | |
| 139 | x86_cpu_SMEP			= x86_cpu_index_7_ebx + 7, | |
| 140 | x86_cpu_BMI2			= x86_cpu_index_7_ebx + 8, | |
| 141 | x86_cpu_ERMS			= x86_cpu_index_7_ebx + 9, | |
| 142 | x86_cpu_INVPCID		= x86_cpu_index_7_ebx + 10, | |
| 143 | x86_cpu_RTM			= x86_cpu_index_7_ebx + 11, | |
| 144 | x86_cpu_RDT_M			= x86_cpu_index_7_ebx + 12, | |
| 145 | x86_cpu_DEPR_FPU_CS_DS	= x86_cpu_index_7_ebx + 13, | |
| 146 | x86_cpu_MPX			= x86_cpu_index_7_ebx + 14, | |
| 147 | x86_cpu_RDT_A			= x86_cpu_index_7_ebx + 15, | |
| 148 | x86_cpu_AVX512F		= x86_cpu_index_7_ebx + 16, | |
| 149 | x86_cpu_AVX512DQ		= x86_cpu_index_7_ebx + 17, | |
| 150 | x86_cpu_RDSEED		= x86_cpu_index_7_ebx + 18, | |
| 151 | x86_cpu_ADX			= x86_cpu_index_7_ebx + 19, | |
| 152 | x86_cpu_SMAP			= x86_cpu_index_7_ebx + 20, | |
| 153 | x86_cpu_AVX512_IFMA		= x86_cpu_index_7_ebx + 21, | |
| 154 | x86_cpu_INDEX_7_EBX_22	= x86_cpu_index_7_ebx + 22, | |
| 155 | x86_cpu_CLFLUSHOPT		= x86_cpu_index_7_ebx + 23, | |
| 156 | x86_cpu_CLWB			= x86_cpu_index_7_ebx + 24, | |
| 157 | x86_cpu_TRACE			= x86_cpu_index_7_ebx + 25, | |
| 158 | x86_cpu_AVX512PF		= x86_cpu_index_7_ebx + 26, | |
| 159 | x86_cpu_AVX512ER		= x86_cpu_index_7_ebx + 27, | |
| 160 | x86_cpu_AVX512CD		= x86_cpu_index_7_ebx + 28, | |
| 161 | x86_cpu_SHA			= x86_cpu_index_7_ebx + 29, | |
| 162 | x86_cpu_AVX512BW		= x86_cpu_index_7_ebx + 30, | |
| 163 | x86_cpu_AVX512VL		= x86_cpu_index_7_ebx + 31, | |
| 164 | ||
| 165 | x86_cpu_index_7_ecx | |
| 166 | = (CPUID_INDEX_7 * 8 * 4 * sizeof (unsigned int) | |
| 167 | + cpuid_register_index_ecx * 8 * sizeof (unsigned int)), | |
| 168 | ||
| 169 | x86_cpu_PREFETCHWT1		= x86_cpu_index_7_ecx, | |
| 170 | x86_cpu_AVX512_VBMI		= x86_cpu_index_7_ecx + 1, | |
| 171 | x86_cpu_UMIP			= x86_cpu_index_7_ecx + 2, | |
| 172 | x86_cpu_PKU			= x86_cpu_index_7_ecx + 3, | |
| 173 | x86_cpu_OSPKE			= x86_cpu_index_7_ecx + 4, | |
| 174 | x86_cpu_WAITPKG		= x86_cpu_index_7_ecx + 5, | |
| 175 | x86_cpu_AVX512_VBMI2		= x86_cpu_index_7_ecx + 6, | |
| 176 | x86_cpu_SHSTK			= x86_cpu_index_7_ecx + 7, | |
| 177 | x86_cpu_GFNI			= x86_cpu_index_7_ecx + 8, | |
| 178 | x86_cpu_VAES			= x86_cpu_index_7_ecx + 9, | |
| 179 | x86_cpu_VPCLMULQDQ		= x86_cpu_index_7_ecx + 10, | |
| 180 | x86_cpu_AVX512_VNNI		= x86_cpu_index_7_ecx + 11, | |
| 181 | x86_cpu_AVX512_BITALG		= x86_cpu_index_7_ecx + 12, | |
| 182 | x86_cpu_INDEX_7_ECX_13	= x86_cpu_index_7_ecx + 13, | |
| 183 | x86_cpu_AVX512_VPOPCNTDQ	= x86_cpu_index_7_ecx + 14, | |
| 184 | x86_cpu_INDEX_7_ECX_1		= x86_cpu_index_7_ecx + 15, | |
| 185 | x86_cpu_INDEX_7_ECX_16	= x86_cpu_index_7_ecx + 16, | |
| 186 | /* Note: Bits 17-21: The value of MAWAU used by the BNDLDX and BNDSTX | |
| 187 | instructions in 64-bit mode. */ | |
| 188 | x86_cpu_RDPID			= x86_cpu_index_7_ecx + 22, | |
| 189 | x86_cpu_KL			= x86_cpu_index_7_ecx + 23, | |
| 190 | x86_cpu_INDEX_7_ECX_24	= x86_cpu_index_7_ecx + 24, | |
| 191 | x86_cpu_CLDEMOTE		= x86_cpu_index_7_ecx + 25, | |
| 192 | x86_cpu_INDEX_7_ECX_26	= x86_cpu_index_7_ecx + 26, | |
| 193 | x86_cpu_MOVDIRI		= x86_cpu_index_7_ecx + 27, | |
| 194 | x86_cpu_MOVDIR64B		= x86_cpu_index_7_ecx + 28, | |
| 195 | x86_cpu_ENQCMD		= x86_cpu_index_7_ecx + 29, | |
| 196 | x86_cpu_SGX_LC		= x86_cpu_index_7_ecx + 30, | |
| 197 | x86_cpu_PKS			= x86_cpu_index_7_ecx + 31, | |
| 198 | ||
| 199 | x86_cpu_index_7_edx | |
| 200 | = (CPUID_INDEX_7 * 8 * 4 * sizeof (unsigned int) | |
| 201 | + cpuid_register_index_edx * 8 * sizeof (unsigned int)), | |
| 202 | ||
| 203 | x86_cpu_INDEX_7_EDX_0		= x86_cpu_index_7_edx, | |
| 204 | x86_cpu_INDEX_7_EDX_1		= x86_cpu_index_7_edx + 1, | |
| 205 | x86_cpu_AVX512_4VNNIW		= x86_cpu_index_7_edx + 2, | |
| 206 | x86_cpu_AVX512_4FMAPS		= x86_cpu_index_7_edx + 3, | |
| 207 | x86_cpu_FSRM			= x86_cpu_index_7_edx + 4, | |
| 208 | x86_cpu_UINTR			= x86_cpu_index_7_edx + 5, | |
| 209 | x86_cpu_INDEX_7_EDX_6		= x86_cpu_index_7_edx + 6, | |
| 210 | x86_cpu_INDEX_7_EDX_7		= x86_cpu_index_7_edx + 7, | |
| 211 | x86_cpu_AVX512_VP2INTERSECT	= x86_cpu_index_7_edx + 8, | |
| 212 | x86_cpu_INDEX_7_EDX_9		= x86_cpu_index_7_edx + 9, | |
| 213 | x86_cpu_MD_CLEAR		= x86_cpu_index_7_edx + 10, | |
| 214 | x86_cpu_RTM_ALWAYS_ABORT	= x86_cpu_index_7_edx + 11, | |
| 215 | x86_cpu_INDEX_7_EDX_12	= x86_cpu_index_7_edx + 12, | |
| 216 | x86_cpu_INDEX_7_EDX_13	= x86_cpu_index_7_edx + 13, | |
| 217 | x86_cpu_SERIALIZE		= x86_cpu_index_7_edx + 14, | |
| 218 | x86_cpu_HYBRID		= x86_cpu_index_7_edx + 15, | |
| 219 | x86_cpu_TSXLDTRK		= x86_cpu_index_7_edx + 16, | |
| 220 | x86_cpu_INDEX_7_EDX_17	= x86_cpu_index_7_edx + 17, | |
| 221 | x86_cpu_PCONFIG		= x86_cpu_index_7_edx + 18, | |
| 222 | x86_cpu_INDEX_7_EDX_19	= x86_cpu_index_7_edx + 19, | |
| 223 | x86_cpu_IBT			= x86_cpu_index_7_edx + 20, | |
| 224 | x86_cpu_INDEX_7_EDX_21	= x86_cpu_index_7_edx + 21, | |
| 225 | x86_cpu_AMX_BF16		= x86_cpu_index_7_edx + 22, | |
| 226 | x86_cpu_AVX512_FP16		= x86_cpu_index_7_edx + 23, | |
| 227 | x86_cpu_AMX_TILE		= x86_cpu_index_7_edx + 24, | |
| 228 | x86_cpu_AMX_INT8		= x86_cpu_index_7_edx + 25, | |
| 229 | x86_cpu_IBRS_IBPB		= x86_cpu_index_7_edx + 26, | |
| 230 | x86_cpu_STIBP			= x86_cpu_index_7_edx + 27, | |
| 231 | x86_cpu_L1D_FLUSH		= x86_cpu_index_7_edx + 28, | |
| 232 | x86_cpu_ARCH_CAPABILITIES	= x86_cpu_index_7_edx + 29, | |
| 233 | x86_cpu_CORE_CAPABILITIES	= x86_cpu_index_7_edx + 30, | |
| 234 | x86_cpu_SSBD			= x86_cpu_index_7_edx + 31, | |
| 235 | ||
| 236 | x86_cpu_index_80000001_ecx | |
| 237 | = (CPUID_INDEX_80000001 * 8 * 4 * sizeof (unsigned int) | |
| 238 | + cpuid_register_index_ecx * 8 * sizeof (unsigned int)), | |
| 239 | ||
| 240 | x86_cpu_LAHF64_SAHF64		= x86_cpu_index_80000001_ecx, | |
| 241 | x86_cpu_SVM			= x86_cpu_index_80000001_ecx + 2, | |
| 242 | x86_cpu_LZCNT			= x86_cpu_index_80000001_ecx + 5, | |
| 243 | x86_cpu_SSE4A			= x86_cpu_index_80000001_ecx + 6, | |
| 244 | x86_cpu_PREFETCHW		= x86_cpu_index_80000001_ecx + 8, | |
| 245 | x86_cpu_XOP			= x86_cpu_index_80000001_ecx + 11, | |
| 246 | x86_cpu_LWP			= x86_cpu_index_80000001_ecx + 15, | |
| 247 | x86_cpu_FMA4			= x86_cpu_index_80000001_ecx + 16, | |
| 248 | x86_cpu_TBM			= x86_cpu_index_80000001_ecx + 21, | |
| 249 | ||
| 250 | x86_cpu_index_80000001_edx | |
| 251 | = (CPUID_INDEX_80000001 * 8 * 4 * sizeof (unsigned int) | |
| 252 | + cpuid_register_index_edx * 8 * sizeof (unsigned int)), | |
| 253 | ||
| 254 | x86_cpu_SYSCALL_SYSRET	= x86_cpu_index_80000001_edx + 11, | |
| 255 | x86_cpu_NX			= x86_cpu_index_80000001_edx + 20, | |
| 256 | x86_cpu_PAGE1GB		= x86_cpu_index_80000001_edx + 26, | |
| 257 | x86_cpu_RDTSCP		= x86_cpu_index_80000001_edx + 27, | |
| 258 | x86_cpu_LM			= x86_cpu_index_80000001_edx + 29, | |
| 259 | ||
| 260 | x86_cpu_index_d_ecx_1_eax | |
| 261 | = (CPUID_INDEX_D_ECX_1 * 8 * 4 * sizeof (unsigned int) | |
| 262 | + cpuid_register_index_eax * 8 * sizeof (unsigned int)), | |
| 263 | ||
| 264 | x86_cpu_XSAVEOPT		= x86_cpu_index_d_ecx_1_eax, | |
| 265 | x86_cpu_XSAVEC		= x86_cpu_index_d_ecx_1_eax + 1, | |
| 266 | x86_cpu_XGETBV_ECX_1		= x86_cpu_index_d_ecx_1_eax + 2, | |
| 267 | x86_cpu_XSAVES		= x86_cpu_index_d_ecx_1_eax + 3, | |
| 268 | x86_cpu_XFD			= x86_cpu_index_d_ecx_1_eax + 4, | |
| 269 | ||
| 270 | x86_cpu_index_80000007_edx | |
| 271 | = (CPUID_INDEX_80000007 * 8 * 4 * sizeof (unsigned int) | |
| 272 | + cpuid_register_index_edx * 8 * sizeof (unsigned int)), | |
| 273 | ||
| 274 | x86_cpu_INVARIANT_TSC		= x86_cpu_index_80000007_edx + 8, | |
| 275 | ||
| 276 | x86_cpu_index_80000008_ebx | |
| 277 | = (CPUID_INDEX_80000008 * 8 * 4 * sizeof (unsigned int) | |
| 278 | + cpuid_register_index_ebx * 8 * sizeof (unsigned int)), | |
| 279 | ||
| 280 | x86_cpu_WBNOINVD		= x86_cpu_index_80000008_ebx + 9, | |
| 281 | x86_cpu_AMD_IBPB	 = x86_cpu_index_80000008_ebx + 12, | |
| 282 | x86_cpu_AMD_IBRS	 = x86_cpu_index_80000008_ebx + 14, | |
| 283 | x86_cpu_AMD_STIBP	 = x86_cpu_index_80000008_ebx + 15, | |
| 284 | x86_cpu_AMD_SSBD	 = x86_cpu_index_80000008_ebx + 24, | |
| 285 | x86_cpu_AMD_VIRT_SSBD	 = x86_cpu_index_80000008_ebx + 25, | |
| 286 | ||
| 287 | x86_cpu_index_7_ecx_1_eax | |
| 288 | = (CPUID_INDEX_7_ECX_1 * 8 * 4 * sizeof (unsigned int) | |
| 289 | + cpuid_register_index_eax * 8 * sizeof (unsigned int)), | |
| 290 | ||
| 291 | x86_cpu_AVX_VNNI		= x86_cpu_index_7_ecx_1_eax + 4, | |
| 292 | x86_cpu_AVX512_BF16		= x86_cpu_index_7_ecx_1_eax + 5, | |
| 293 | x86_cpu_FZLRM			= x86_cpu_index_7_ecx_1_eax + 10, | |
| 294 | x86_cpu_FSRS			= x86_cpu_index_7_ecx_1_eax + 11, | |
| 295 | x86_cpu_FSRCS			= x86_cpu_index_7_ecx_1_eax + 12, | |
| 296 | x86_cpu_HRESET		= x86_cpu_index_7_ecx_1_eax + 22, | |
| 297 | x86_cpu_LAM			= x86_cpu_index_7_ecx_1_eax + 26, | |
| 298 | ||
| 299 | x86_cpu_index_19_ebx | |
| 300 | = (CPUID_INDEX_19 * 8 * 4 * sizeof (unsigned int) | |
| 301 | + cpuid_register_index_ebx * 8 * sizeof (unsigned int)), | |
| 302 | ||
| 303 | x86_cpu_AESKLE		= x86_cpu_index_19_ebx, | |
| 304 | x86_cpu_WIDE_KL		= x86_cpu_index_19_ebx + 2, | |
| 305 | ||
| 306 | x86_cpu_index_14_ecx_0_ebx | |
| 307 | = (CPUID_INDEX_14_ECX_0 * 8 * 4 * sizeof (unsigned int) | |
| 308 | + cpuid_register_index_ebx * 8 * sizeof (unsigned int)), | |
| 309 | ||
| 310 | x86_cpu_PTWRITE		= x86_cpu_index_14_ecx_0_ebx + 4 | |
| 311 | }; | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/poll2.h+6-4| ... | ... | @@ -26,13 +26,14 @@ __BEGIN_DECLS |
| 26 | 26 | extern int __REDIRECT (__poll_alias, (struct pollfd *__fds, nfds_t __nfds, |
| 27 | 27 | 				 int __timeout), poll); |
| 28 | 28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout, |
| 29 | 		 __SIZE_TYPE__ __fdslen); | |
| 29 | 		 __SIZE_TYPE__ __fdslen) | |
| 30 | __attr_access ((__write_only__, 1, 2)); | |
| 30 | 31 | extern int __REDIRECT (__poll_chk_warn, (struct pollfd *__fds, nfds_t __nfds, |
| 31 | 32 | 					 int __timeout, __SIZE_TYPE__ __fdslen), |
| 32 | 33 | 		 __poll_chk) |
| 33 | 34 | __warnattr ("poll called with fds buffer too small file nfds entries"); |
| 34 | 35 | |
| 35 | __fortify_function int | |
| 36 | __fortify_function __attr_access ((__write_only__, 1, 2)) int | |
| 36 | 37 | poll (struct pollfd *__fds, nfds_t __nfds, int __timeout) |
| 37 | 38 | { |
| 38 | 39 | if (__glibc_objsize (__fds) != (__SIZE_TYPE__) -1) |
| ... | ... | @@ -54,7 +55,8 @@ extern int __REDIRECT (__ppoll_alias, (struct pollfd *__fds, nfds_t __nfds, |
| 54 | 55 | 				 const __sigset_t *__ss), ppoll); |
| 55 | 56 | extern int __ppoll_chk (struct pollfd *__fds, nfds_t __nfds, |
| 56 | 57 | 			const struct timespec *__timeout, |
| 57 | 			const __sigset_t *__ss, __SIZE_TYPE__ __fdslen); | |
| 58 | 			const __sigset_t *__ss, __SIZE_TYPE__ __fdslen) | |
| 59 | __attr_access ((__write_only__, 1, 2)); | |
| 58 | 60 | extern int __REDIRECT (__ppoll_chk_warn, (struct pollfd *__fds, nfds_t __nfds, |
| 59 | 61 | 					 const struct timespec *__timeout, |
| 60 | 62 | 					 const __sigset_t *__ss, |
| ... | ... | @@ -62,7 +64,7 @@ extern int __REDIRECT (__ppoll_chk_warn, (struct pollfd *__fds, nfds_t __nfds, |
| 62 | 64 | 		 __ppoll_chk) |
| 63 | 65 | __warnattr ("ppoll called with fds buffer too small file nfds entries"); |
| 64 | 66 | |
| 65 | __fortify_function int | |
| 67 | __fortify_function __attr_access ((__write_only__, 1, 2)) int | |
| 66 | 68 | ppoll (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout, |
| 67 | 69 | const __sigset_t *__ss) |
| 68 | 70 | { |
lib/libc/include/generic-glibc/bits/pthread_stack_min-dynamic.h created+31| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN, possibly dynamic. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef PTHREAD_STACK_MIN | |
| 20 | # if defined __USE_DYNAMIC_STACK_SIZE && __USE_DYNAMIC_STACK_SIZE | |
| 21 | # ifndef __ASSEMBLER__ | |
| 22 | # define __SC_THREAD_STACK_MIN_VALUE 75 | |
| 23 | __BEGIN_DECLS | |
| 24 | extern long int __sysconf (int __name) __THROW; | |
| 25 | __END_DECLS | |
| 26 | # define PTHREAD_STACK_MIN __sysconf (__SC_THREAD_STACK_MIN_VALUE) | |
| 27 | # endif | |
| 28 | # else | |
| 29 | # include <bits/pthread_stack_min.h> | |
| 30 | # endif | |
| 31 | #endif | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/pthread_stack_min.h created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. Linux version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. We are free to choose a reasonable value. */ | |
| 20 | #define PTHREAD_STACK_MIN	16384 | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/sem.h+1| ... | ... | @@ -22,6 +22,7 @@ |
| 22 | 22 | #include <sys/types.h> |
| 23 | 23 | #include <bits/timesize.h> |
| 24 | 24 | #include <bits/types/struct_semid_ds.h> |
| 25 | #include <bits/types/struct_semid64_ds.h> | |
| 25 | 26 | |
| 26 | 27 | /* Flags for `semop'. */ |
| 27 | 28 | #define SEM_UNDO	0x1000		/* undo the operation on exit */ |
lib/libc/include/generic-glibc/bits/shm.h+1| ... | ... | @@ -43,6 +43,7 @@ __BEGIN_DECLS |
| 43 | 43 | typedef __syscall_ulong_t shmatt_t; |
| 44 | 44 | |
| 45 | 45 | #include <bits/types/struct_shmid_ds.h> |
| 46 | #include <bits/types/struct_shmid64_ds.h> | |
| 46 | 47 | |
| 47 | 48 | #ifdef __USE_MISC |
| 48 | 49 |
lib/libc/include/generic-glibc/bits/sigstksz.h created+33| ... | ... | @@ -0,0 +1,33 @@ |
| 1 | /* Definition of MINSIGSTKSZ and SIGSTKSZ. Linux version. | |
| 2 | Copyright (C) 2020 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SIGNAL_H | |
| 20 | # error "Never include <bits/sigstksz.h> directly; use <signal.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #if defined __USE_DYNAMIC_STACK_SIZE && __USE_DYNAMIC_STACK_SIZE | |
| 24 | # include <unistd.h> | |
| 25 | ||
| 26 | /* Default stack size for a signal handler: sysconf (SC_SIGSTKSZ). */ | |
| 27 | # undef SIGSTKSZ | |
| 28 | # define SIGSTKSZ sysconf (_SC_SIGSTKSZ) | |
| 29 | ||
| 30 | /* Minimum stack size for a signal handler: SIGSTKSZ. */ | |
| 31 | # undef MINSIGSTKSZ | |
| 32 | # define MINSIGSTKSZ SIGSTKSZ | |
| 33 | #endif | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/socket-constants.h+40-9| ... | ... | @@ -32,19 +32,50 @@ |
| 32 | 32 | #define SO_OOBINLINE 10 |
| 33 | 33 | #define SO_RCVBUF 8 |
| 34 | 34 | #define SO_RCVLOWAT 18 |
| 35 | #if (__TIMESIZE == 64 && __WORDSIZE == 32 \ | |
| 36 | && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) | |
| 37 | # define SO_RCVTIMEO 66 | |
| 38 | #else | |
| 39 | # define SO_RCVTIMEO 20 | |
| 40 | #endif | |
| 41 | 35 | #define SO_REUSEADDR 2 |
| 42 | 36 | #define SO_SNDBUF 7 |
| 43 | 37 | #define SO_SNDLOWAT 19 |
| 38 | #define SO_TYPE 3 | |
| 39 | ||
| 44 | 40 | #if (__TIMESIZE == 64 && __WORDSIZE == 32 \ |
| 45 | 41 | && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) |
| 42 | # define SO_RCVTIMEO 66 | |
| 46 | 43 | # define SO_SNDTIMEO 67 |
| 44 | # define SO_TIMESTAMP 63 | |
| 45 | # define SO_TIMESTAMPNS 64 | |
| 46 | # define SO_TIMESTAMPING 65 | |
| 47 | 47 | #else |
| 48 | # define SO_SNDTIMEO 21 | |
| 49 | #endif | |
| 50 | #define SO_TYPE 3 | |
| \ No newline at end of file | ||
| 48 | # if __TIMESIZE == 64 | |
| 49 | # define SO_RCVTIMEO 20 | |
| 50 | # define SO_SNDTIMEO 21 | |
| 51 | # define SO_TIMESTAMP 29 | |
| 52 | # define SO_TIMESTAMPNS 35 | |
| 53 | # define SO_TIMESTAMPING 37 | |
| 54 | # else | |
| 55 | # define SO_RCVTIMEO_OLD 20 | |
| 56 | # define SO_SNDTIMEO_OLD 21 | |
| 57 | # define SO_RCVTIMEO_NEW 66 | |
| 58 | # define SO_SNDTIMEO_NEW 67 | |
| 59 | ||
| 60 | # define SO_TIMESTAMP_OLD 29 | |
| 61 | # define SO_TIMESTAMPNS_OLD 35 | |
| 62 | # define SO_TIMESTAMPING_OLD 37 | |
| 63 | # define SO_TIMESTAMP_NEW 63 | |
| 64 | # define SO_TIMESTAMPNS_NEW 64 | |
| 65 | # define SO_TIMESTAMPING_NEW 65 | |
| 66 | ||
| 67 | # ifdef __USE_TIME_BITS64 | |
| 68 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 69 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 70 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 71 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 72 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 73 | # else | |
| 74 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 75 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 76 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 77 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 78 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 79 | # endif | |
| 80 | # endif | |
| 81 | #endif | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/struct_rwlock.h+27-17| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Default read-write lock implementation struct definitions. | |
| 1 | /* MIPS internal rwlock struct definitions. | |
| 2 | 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. |
| 3 | 3 | This file is part of the GNU C Library. |
| 4 | 4 | |
| ... | ... | @@ -16,15 +16,8 @@ |
| 16 | 16 | License along with the GNU C Library; if not, see |
| 17 | 17 | <http://www.gnu.org/licenses/>. */ |
| 18 | 18 | |
| 19 | #ifndef __RWLOCK_INTERNAL_H | |
| 20 | #define __RWLOCK_INTERNAL_H | |
| 21 | ||
| 22 | #include <bits/endian.h> | |
| 23 | ||
| 24 | /* Generic struct for both POSIX read-write lock. New ports are expected | |
| 25 | to use the default layout, however archictetures can redefine it to add | |
| 26 | arch-specific extensions (such as lock-elision). The struct have a size | |
| 27 | of 32 bytes on both LP32 and LP64 architectures. */ | |
| 19 | #ifndef _RWLOCK_INTERNAL_H | |
| 20 | #define _RWLOCK_INTERNAL_H | |
| 28 | 21 | |
| 29 | 22 | struct __pthread_rwlock_arch_t |
| 30 | 23 | { |
| ... | ... | @@ -34,28 +27,45 @@ struct __pthread_rwlock_arch_t |
| 34 | 27 | unsigned int __writers_futex; |
| 35 | 28 | unsigned int __pad3; |
| 36 | 29 | unsigned int __pad4; |
| 37 | /* FLAGS must stay at its position in the structure to maintain | |
| 30 | #if _MIPS_SIM == _ABI64 | |
| 31 | int __cur_writer; | |
| 32 | int __shared; | |
| 33 | unsigned long int __pad1; | |
| 34 | unsigned long int __pad2; | |
| 35 | /* FLAGS must stay at this position in the structure to maintain | |
| 38 | 36 | binary compatibility. */ |
| 39 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 37 | unsigned int __flags; | |
| 38 | # else | |
| 39 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 40 | 40 | unsigned char __pad1; |
| 41 | 41 | unsigned char __pad2; |
| 42 | 42 | unsigned char __shared; |
| 43 | /* FLAGS must stay at this position in the structure to maintain | |
| 44 | binary compatibility. */ | |
| 43 | 45 | unsigned char __flags; |
| 44 | #else | |
| 46 | # else | |
| 47 | /* FLAGS must stay at this position in the structure to maintain | |
| 48 | binary compatibility. */ | |
| 45 | 49 | unsigned char __flags; |
| 46 | 50 | unsigned char __shared; |
| 47 | 51 | unsigned char __pad1; |
| 48 | 52 | unsigned char __pad2; |
| 49 | #endif | |
| 53 | # endif | |
| 50 | 54 | int __cur_writer; |
| 55 | #endif | |
| 51 | 56 | }; |
| 52 | 57 | |
| 53 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 58 | #if _MIPS_SIM == _ABI64 | |
| 54 | 59 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ |
| 55 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 60 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags | |
| 56 | 61 | #else |
| 57 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 62 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 63 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 64 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 65 | # else | |
| 66 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 58 | 67 | 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 |
| 68 | # endif | |
| 59 | 69 | #endif |
| 60 | 70 | |
| 61 | 71 | #endif |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/struct_stat.h+50-39| ... | ... | @@ -29,28 +29,31 @@ |
| 29 | 29 | /* Structure describing file characteristics. */ |
| 30 | 30 | struct stat |
| 31 | 31 | { |
| 32 | # ifdef __USE_TIME_BITS64 | |
| 33 | # include <bits/struct_stat_time64_helper.h> | |
| 34 | # else | |
| 32 | 35 | unsigned long int st_dev; |
| 33 | 36 | long int st_pad1[3]; |
| 34 | #ifndef __USE_FILE_OFFSET64 | |
| 37 | # ifndef __USE_FILE_OFFSET64 | |
| 35 | 38 | __ino_t st_ino;		/* File serial number.		*/ |
| 36 | #else | |
| 39 | # else | |
| 37 | 40 | __ino64_t st_ino;		/* File serial number.		*/ |
| 38 | #endif | |
| 41 | # endif | |
| 39 | 42 | __mode_t st_mode;		/* File mode. */ |
| 40 | 43 | __nlink_t st_nlink;		/* Link count. */ |
| 41 | 44 | __uid_t st_uid;		/* User ID of the file's owner.	*/ |
| 42 | 45 | __gid_t st_gid;		/* Group ID of the file's group.*/ |
| 43 | 46 | unsigned long int st_rdev;	/* Device number, if device. */ |
| 44 | #ifndef __USE_FILE_OFFSET64 | |
| 47 | # ifndef __USE_FILE_OFFSET64 | |
| 45 | 48 | long int st_pad2[2]; |
| 46 | 49 | __off_t st_size;		/* Size of file, in bytes. */ |
| 47 | 50 | /* SVR4 added this extra long to allow for expansion of off_t. */ |
| 48 | 51 | long int st_pad3; |
| 49 | #else | |
| 52 | # else | |
| 50 | 53 | long int st_pad2[3]; |
| 51 | 54 | __off64_t st_size;		/* Size of file, in bytes. */ |
| 52 | #endif | |
| 53 | #ifdef __USE_XOPEN2K8 | |
| 55 | # endif | |
| 56 | # ifdef __USE_XOPEN2K8 | |
| 54 | 57 | /* Nanosecond resolution timestamps are stored in a format |
| 55 | 58 | equivalent to 'struct timespec'. This is the type used |
| 56 | 59 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -60,30 +63,34 @@ struct stat |
| 60 | 63 | struct timespec st_atim; /* Time of last access. */ |
| 61 | 64 | struct timespec st_mtim; /* Time of last modification. */ |
| 62 | 65 | struct timespec st_ctim; /* Time of last status change. */ |
| 63 | # define st_atime st_atim.tv_sec /* Backward compatibility. */ | |
| 64 | # define st_mtime st_mtim.tv_sec | |
| 65 | # define st_ctime st_ctim.tv_sec | |
| 66 | #else | |
| 66 | # define st_atime st_atim.tv_sec /* Backward compatibility. */ | |
| 67 | # define st_mtime st_mtim.tv_sec | |
| 68 | # define st_ctime st_ctim.tv_sec | |
| 69 | # else | |
| 67 | 70 | __time_t st_atime;			/* Time of last access. */ |
| 68 | 71 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 69 | 72 | __time_t st_mtime;			/* Time of last modification. */ |
| 70 | 73 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 71 | 74 | __time_t st_ctime;			/* Time of last status change. */ |
| 72 | 75 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 73 | #endif | |
| 76 | # endif | |
| 74 | 77 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ |
| 75 | #ifndef __USE_FILE_OFFSET64 | |
| 78 | # ifndef __USE_FILE_OFFSET64 | |
| 76 | 79 | __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated. */ |
| 77 | #else | |
| 80 | # else | |
| 78 | 81 | long int st_pad4; |
| 79 | 82 | __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated. */ |
| 80 | #endif | |
| 83 | # endif | |
| 81 | 84 | long int st_pad5[14]; |
| 85 | # endif /* __USE_TIME_BITS64 */ | |
| 82 | 86 | }; |
| 83 | 87 | |
| 84 | #ifdef __USE_LARGEFILE64 | |
| 88 | # ifdef __USE_LARGEFILE64 | |
| 85 | 89 | struct stat64 |
| 86 | 90 | { |
| 91 | # ifdef __USE_TIME_BITS64 | |
| 92 | # include <bits/struct_stat_time64_helper.h> | |
| 93 | # else | |
| 87 | 94 | unsigned long int st_dev; |
| 88 | 95 | long int st_pad1[3]; |
| 89 | 96 | __ino64_t st_ino;		/* File serial number.		*/ |
| ... | ... | @@ -94,7 +101,7 @@ struct stat64 |
| 94 | 101 | unsigned long int st_rdev;	/* Device number, if device. */ |
| 95 | 102 | long int st_pad2[3]; |
| 96 | 103 | __off64_t st_size;		/* Size of file, in bytes. */ |
| 97 | # ifdef __USE_XOPEN2K8 | |
| 104 | # ifdef __USE_XOPEN2K8 | |
| 98 | 105 | /* Nanosecond resolution timestamps are stored in a format |
| 99 | 106 | equivalent to 'struct timespec'. This is the type used |
| 100 | 107 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -104,44 +111,47 @@ struct stat64 |
| 104 | 111 | struct timespec st_atim; /* Time of last access. */ |
| 105 | 112 | struct timespec st_mtim; /* Time of last modification. */ |
| 106 | 113 | struct timespec st_ctim; /* Time of last status change. */ |
| 107 | # else | |
| 114 | # else | |
| 108 | 115 | __time_t st_atime;			/* Time of last access. */ |
| 109 | 116 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 110 | 117 | __time_t st_mtime;			/* Time of last modification. */ |
| 111 | 118 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 112 | 119 | __time_t st_ctime;			/* Time of last status change. */ |
| 113 | 120 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 114 | # endif | |
| 121 | # endif | |
| 115 | 122 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ |
| 116 | 123 | long int st_pad3; |
| 117 | 124 | __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated. */ |
| 118 | 125 | long int st_pad4[14]; |
| 126 | # endif /* __USE_TIME_BITS64 */ | |
| 119 | 127 | }; |
| 120 | #endif | |
| 121 | #else | |
| 128 | # endif /* __USE_LARGEFILE64 */ | |
| 129 | ||
| 130 | #else /* _MIPS_SIM != _ABIO32 */ | |
| 131 | ||
| 122 | 132 | struct stat |
| 123 | 133 | { |
| 124 | 134 | __dev_t st_dev; |
| 125 | 135 | int	st_pad1[3];		/* Reserved for st_dev expansion */ |
| 126 | #ifndef __USE_FILE_OFFSET64 | |
| 136 | # ifndef __USE_FILE_OFFSET64 | |
| 127 | 137 | __ino_t st_ino; |
| 128 | #else | |
| 138 | # else | |
| 129 | 139 | __ino64_t st_ino; |
| 130 | #endif | |
| 140 | # endif | |
| 131 | 141 | __mode_t st_mode; |
| 132 | 142 | __nlink_t st_nlink; |
| 133 | 143 | __uid_t st_uid; |
| 134 | 144 | __gid_t st_gid; |
| 135 | 145 | __dev_t st_rdev; |
| 136 | #if !defined __USE_FILE_OFFSET64 | |
| 146 | # if !defined __USE_FILE_OFFSET64 | |
| 137 | 147 | unsigned int st_pad2[2];	/* Reserved for st_rdev expansion */ |
| 138 | 148 | __off_t st_size; |
| 139 | 149 | int st_pad3; |
| 140 | #else | |
| 150 | # else | |
| 141 | 151 | unsigned int st_pad2[3];	/* Reserved for st_rdev expansion */ |
| 142 | 152 | __off64_t st_size; |
| 143 | #endif | |
| 144 | #ifdef __USE_XOPEN2K8 | |
| 153 | # endif | |
| 154 | # ifdef __USE_XOPEN2K8 | |
| 145 | 155 | /* Nanosecond resolution timestamps are stored in a format |
| 146 | 156 | equivalent to 'struct timespec'. This is the type used |
| 147 | 157 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -151,24 +161,24 @@ struct stat |
| 151 | 161 | struct timespec st_atim; /* Time of last access. */ |
| 152 | 162 | struct timespec st_mtim; /* Time of last modification. */ |
| 153 | 163 | struct timespec st_ctim; /* Time of last status change. */ |
| 154 | # define st_atime st_atim.tv_sec /* Backward compatibility. */ | |
| 155 | # define st_mtime st_mtim.tv_sec | |
| 156 | # define st_ctime st_ctim.tv_sec | |
| 157 | #else | |
| 164 | # define st_atime st_atim.tv_sec /* Backward compatibility. */ | |
| 165 | # define st_mtime st_mtim.tv_sec | |
| 166 | # define st_ctime st_ctim.tv_sec | |
| 167 | # else | |
| 158 | 168 | __time_t st_atime;			/* Time of last access. */ |
| 159 | 169 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 160 | 170 | __time_t st_mtime;			/* Time of last modification. */ |
| 161 | 171 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 162 | 172 | __time_t st_ctime;			/* Time of last status change. */ |
| 163 | 173 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 164 | #endif | |
| 174 | # endif | |
| 165 | 175 | __blksize_t st_blksize; |
| 166 | 176 | unsigned int st_pad4; |
| 167 | #ifndef __USE_FILE_OFFSET64 | |
| 177 | # ifndef __USE_FILE_OFFSET64 | |
| 168 | 178 | __blkcnt_t st_blocks; |
| 169 | #else | |
| 179 | # else | |
| 170 | 180 | __blkcnt64_t st_blocks; |
| 171 | #endif | |
| 181 | # endif | |
| 172 | 182 | int st_pad5[14]; |
| 173 | 183 | }; |
| 174 | 184 | |
| ... | ... | @@ -185,7 +195,7 @@ struct stat64 |
| 185 | 195 | __dev_t st_rdev; |
| 186 | 196 | unsigned int st_pad2[3];	/* Reserved for st_rdev expansion */ |
| 187 | 197 | __off64_t st_size; |
| 188 | # ifdef __USE_XOPEN2K8 | |
| 198 | # ifdef __USE_XOPEN2K8 | |
| 189 | 199 | /* Nanosecond resolution timestamps are stored in a format |
| 190 | 200 | equivalent to 'struct timespec'. This is the type used |
| 191 | 201 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -195,20 +205,21 @@ struct stat64 |
| 195 | 205 | struct timespec st_atim; /* Time of last access. */ |
| 196 | 206 | struct timespec st_mtim; /* Time of last modification. */ |
| 197 | 207 | struct timespec st_ctim; /* Time of last status change. */ |
| 198 | # else | |
| 208 | # else | |
| 199 | 209 | __time_t st_atime;			/* Time of last access. */ |
| 200 | 210 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 201 | 211 | __time_t st_mtime;			/* Time of last modification. */ |
| 202 | 212 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 203 | 213 | __time_t st_ctime;			/* Time of last status change. */ |
| 204 | 214 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 205 | # endif | |
| 215 | # endif | |
| 206 | 216 | __blksize_t st_blksize; |
| 207 | 217 | unsigned int st_pad3; |
| 208 | 218 | __blkcnt64_t st_blocks; |
| 209 | 219 | int st_pad4[14]; |
| 210 | 220 | }; |
| 211 | 221 | #endif |
| 222 | ||
| 212 | 223 | #endif |
| 213 | 224 | |
| 214 | 225 | /* Tell code we have these members. */ |
lib/libc/include/generic-glibc/bits/struct_stat_time64_helper.h created+66| ... | ... | @@ -0,0 +1,66 @@ |
| 1 | /* Definition for helper to define struct stat with 64-bit time. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Content of internal __stat64_t64 struct. */ | |
| 20 | __dev_t st_dev;		/* Device. */ | |
| 21 | __ino64_t st_ino;		/* file serial number.	*/ | |
| 22 | __mode_t st_mode;		/* File mode. */ | |
| 23 | __nlink_t st_nlink;		/* Link count. */ | |
| 24 | __uid_t st_uid;		/* User ID of the file's owner. */ | |
| 25 | __gid_t st_gid;		/* Group ID of the file's group. */ | |
| 26 | __dev_t st_rdev;		/* Device number, if device. */ | |
| 27 | __off64_t st_size;		/* Size of file, in bytes. */ | |
| 28 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ | |
| 29 | __blkcnt64_t st_blocks;	/* Number 512-byte blocks allocated. */ | |
| 30 | #ifdef __USE_XOPEN2K8 | |
| 31 | # ifndef __struct_timespec | |
| 32 | # define __struct_timespec struct timespec | |
| 33 | # endif | |
| 34 | /* Nanosecond resolution timestamps are stored in a format | |
| 35 | equivalent to 'struct timespec'. This is the type used | |
| 36 | whenever possible but the Unix namespace rules do not allow the | |
| 37 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 38 | Therefore we have to handle the use of this header in strictly | |
| 39 | standard-compliant sources special. */ | |
| 40 | __struct_timespec st_atim; | |
| 41 | __struct_timespec st_mtim; | |
| 42 | __struct_timespec st_ctim; | |
| 43 | # define st_atime st_atim.tv_sec | |
| 44 | # define st_mtime st_mtim.tv_sec | |
| 45 | # define st_ctime st_ctim.tv_sec | |
| 46 | # undef __struct_timespec | |
| 47 | #else | |
| 48 | /* The definition should be equal to the 'struct __timespec64' internal | |
| 49 | layout. */ | |
| 50 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 51 | # define __fieldts64(name)					\ | |
| 52 | __time64_t name; __int32_t :32; __int32_t name ## nsec | |
| 53 | # else | |
| 54 | # define __fieldts64(name)					\ | |
| 55 | __time64_t name; __int32_t name ## nsec; __int32_t :32 | |
| 56 | # endif | |
| 57 | ||
| 58 | __fieldts64 (st_atime); | |
| 59 | __fieldts64 (st_mtime); | |
| 60 | __fieldts64 (st_ctime); | |
| 61 | ||
| 62 | unsigned long int __glibc_reserved4; | |
| 63 | unsigned long int __glibc_reserved5; | |
| 64 | ||
| 65 | # undef __fieldts64 | |
| 66 | #endif | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/syscall.h+22-2| ... | ... | @@ -1,11 +1,11 @@ |
| 1 | 1 | /* Generated at libc build time from syscall list. */ |
| 2 | /* The system call list corresponds to kernel 5.10. */ | |
| 2 | /* The system call list corresponds to kernel 5.13. */ | |
| 3 | 3 | |
| 4 | 4 | #ifndef _SYSCALL_H |
| 5 | 5 | # error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead." |
| 6 | 6 | #endif |
| 7 | 7 | |
| 8 | #define __GLIBC_LINUX_VERSION_CODE 330240 | |
| 8 | #define __GLIBC_LINUX_VERSION_CODE 331008 | |
| 9 | 9 | |
| 10 | 10 | #ifdef __NR_FAST_atomic_update |
| 11 | 11 | # define SYS_FAST_atomic_update __NR_FAST_atomic_update |
| ... | ... | @@ -291,6 +291,10 @@ |
| 291 | 291 | # define SYS_epoll_pwait __NR_epoll_pwait |
| 292 | 292 | #endif |
| 293 | 293 | |
| 294 | #ifdef __NR_epoll_pwait2 | |
| 295 | # define SYS_epoll_pwait2 __NR_epoll_pwait2 | |
| 296 | #endif | |
| 297 | ||
| 294 | 298 | #ifdef __NR_epoll_wait |
| 295 | 299 | # define SYS_epoll_wait __NR_epoll_wait |
| 296 | 300 | #endif |
| ... | ... | @@ -803,6 +807,18 @@ |
| 803 | 807 | # define SYS_kill __NR_kill |
| 804 | 808 | #endif |
| 805 | 809 | |
| 810 | #ifdef __NR_landlock_add_rule | |
| 811 | # define SYS_landlock_add_rule __NR_landlock_add_rule | |
| 812 | #endif | |
| 813 | ||
| 814 | #ifdef __NR_landlock_create_ruleset | |
| 815 | # define SYS_landlock_create_ruleset __NR_landlock_create_ruleset | |
| 816 | #endif | |
| 817 | ||
| 818 | #ifdef __NR_landlock_restrict_self | |
| 819 | # define SYS_landlock_restrict_self __NR_landlock_restrict_self | |
| 820 | #endif | |
| 821 | ||
| 806 | 822 | #ifdef __NR_lchown |
| 807 | 823 | # define SYS_lchown __NR_lchown |
| 808 | 824 | #endif |
| ... | ... | @@ -939,6 +955,10 @@ |
| 939 | 955 | # define SYS_mount __NR_mount |
| 940 | 956 | #endif |
| 941 | 957 | |
| 958 | #ifdef __NR_mount_setattr | |
| 959 | # define SYS_mount_setattr __NR_mount_setattr | |
| 960 | #endif | |
| 961 | ||
| 942 | 962 | #ifdef __NR_move_mount |
| 943 | 963 | # define SYS_move_mount __NR_move_mount |
| 944 | 964 | #endif |
lib/libc/include/generic-glibc/bits/time.h+10| ... | ... | @@ -77,6 +77,16 @@ __BEGIN_DECLS |
| 77 | 77 | /* Tune a POSIX clock. */ |
| 78 | 78 | extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW; |
| 79 | 79 | |
| 80 | #ifdef __USE_TIME_BITS64 | |
| 81 | # if defined(__REDIRECT_NTH) | |
| 82 | extern int __REDIRECT_NTH (clock_adjtime, (__clockid_t __clock_id, | |
| 83 | struct timex *__utx), | |
| 84 | __clock_adjtime64); | |
| 85 | # else | |
| 86 | # define clock_adjtime __clock_adjtime64 | |
| 87 | # endif | |
| 88 | #endif | |
| 89 | ||
| 80 | 90 | __END_DECLS |
| 81 | 91 | #endif /* use GNU */ |
| 82 | 92 |
lib/libc/include/generic-glibc/bits/timex.h+31| ... | ... | @@ -25,6 +25,36 @@ |
| 25 | 25 | |
| 26 | 26 | struct timex |
| 27 | 27 | { |
| 28 | # ifdef __USE_TIME_BITS64 | |
| 29 | unsigned int modes; /* mode selector */ | |
| 30 | int :32; /* pad */ | |
| 31 | long long offset; /* time offset (usec) */ | |
| 32 | long long freq; /* frequency offset (scaled ppm) */ | |
| 33 | long long maxerror; /* maximum error (usec) */ | |
| 34 | long long esterror; /* estimated error (usec) */ | |
| 35 | int status; /* clock command/status */ | |
| 36 | int :32; /* pad */ | |
| 37 | long long constant; /* pll time constant */ | |
| 38 | long long precision; /* clock precision (usec) (read only) */ | |
| 39 | long long tolerance; /* clock frequency tolerance (ppm) (ro) */ | |
| 40 | struct timeval time; /* (read only, except for ADJ_SETOFFSET) */ | |
| 41 | long long tick; /* (modified) usecs between clock ticks */ | |
| 42 | long long ppsfreq; /* pps frequency (scaled ppm) (ro) */ | |
| 43 | long long jitter; /* pps jitter (us) (ro) */ | |
| 44 | int shift; /* interval duration (s) (shift) (ro) */ | |
| 45 | int :32; /* pad */ | |
| 46 | long long stabil; /* pps stability (scaled ppm) (ro) */ | |
| 47 | long long jitcnt; /* jitter limit exceeded (ro) */ | |
| 48 | long long calcnt; /* calibration intervals (ro) */ | |
| 49 | long long errcnt; /* calibration errors (ro) */ | |
| 50 | long long stbcnt; /* stability limit exceeded (ro) */ | |
| 51 | ||
| 52 | int tai; /* TAI offset (ro) */ | |
| 53 | ||
| 54 | int :32; int :32; int :32; int :32; | |
| 55 | int :32; int :32; int :32; int :32; | |
| 56 | int :32; int :32; int :32; | |
| 57 | # else | |
| 28 | 58 | unsigned int modes;		/* mode selector */ |
| 29 | 59 | __syscall_slong_t offset;	/* time offset (usec) */ |
| 30 | 60 | __syscall_slong_t freq;	/* frequency offset (scaled ppm) */ |
| ... | ... | @@ -51,6 +81,7 @@ struct timex |
| 51 | 81 | int :32; int :32; int :32; int :32; |
| 52 | 82 | int :32; int :32; int :32; int :32; |
| 53 | 83 | int :32; int :32; int :32; |
| 84 | # endif | |
| 54 | 85 | }; |
| 55 | 86 | |
| 56 | 87 | /* Mode codes (timex.mode) */ |
lib/libc/include/generic-glibc/bits/types/struct_msqid64_ds.h created+30| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | /* Generic implementation of the SysV message struct msqid64_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MSG_H | |
| 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #if __TIMESIZE == 64 | |
| 24 | # define __msqid64_ds msqid_ds | |
| 25 | #else | |
| 26 | struct __msqid64_ds | |
| 27 | { | |
| 28 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 29 | }; | |
| 30 | #endif | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/types/struct_msqid64_ds_helper.h created+30| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | /* Common definitions for struct msqid_ds with 64-bit time. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Content of internal __msqid64_ds. */ | |
| 20 | struct ipc_perm msg_perm;	/* structure describing operation permission */ | |
| 21 | __time64_t msg_stime;		/* time of last msgsnd command */ | |
| 22 | __time64_t msg_rtime;		/* time of last msgsnd command */ | |
| 23 | __time64_t msg_ctime;		/* time of last change */ | |
| 24 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ | |
| 25 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ | |
| 26 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ | |
| 27 | __pid_t msg_lspid;		/* pid of last msgsnd() */ | |
| 28 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ | |
| 29 | unsigned long int __glibc_reserved4; | |
| 30 | unsigned long int __glibc_reserved5; | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/types/struct_msqid_ds.h+9-3| ... | ... | @@ -20,23 +20,28 @@ |
| 20 | 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." |
| 21 | 21 | #endif |
| 22 | 22 | |
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 23 | 25 | /* Structure of record for one message inside the kernel. |
| 24 | 26 | The type `struct msg' is opaque. */ |
| 25 | 27 | struct msqid_ds |
| 26 | 28 | { |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 27 | 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ |
| 28 | #if __TIMESIZE == 32 | |
| 33 | # if __TIMESIZE == 32 | |
| 29 | 34 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 30 | 35 | unsigned long int __msg_stime_high; |
| 31 | 36 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 32 | 37 | unsigned long int __msg_rtime_high; |
| 33 | 38 | __time_t msg_ctime;		/* time of last change */ |
| 34 | 39 | unsigned long int __msg_ctime_high; |
| 35 | #else | |
| 40 | # else | |
| 36 | 41 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 37 | 42 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 38 | 43 | __time_t msg_ctime;		/* time of last change */ |
| 39 | #endif | |
| 44 | # endif | |
| 40 | 45 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ |
| 41 | 46 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ |
| 42 | 47 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ |
| ... | ... | @@ -44,4 +49,5 @@ struct msqid_ds |
| 44 | 49 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ |
| 45 | 50 | __syscall_ulong_t __glibc_reserved4; |
| 46 | 51 | __syscall_ulong_t __glibc_reserved5; |
| 52 | #endif | |
| 47 | 53 | }; |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/types/struct_semid64_ds.h created+30| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | /* Generic implementation of the semaphore struct semid64_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SEM_H | |
| 20 | # error "Never include <bits/types/struct_semid_ds.h> directly; use <sys/sem.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #if __TIMESIZE == 64 | |
| 24 | # define __semid64_ds semid_ds | |
| 25 | #else | |
| 26 | struct __semid64_ds | |
| 27 | { | |
| 28 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 29 | }; | |
| 30 | #endif | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/types/struct_semid64_ds_helper.h created+25| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | /* Common definitions for struct semid_ds with 64-bit time. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Content of internal __semid64_ds. */ | |
| 20 | struct ipc_perm sem_perm;		/* operation permission struct */ | |
| 21 | __time64_t sem_otime;			/* last semop() time */ | |
| 22 | __time64_t sem_ctime;			/* last time changed by semctl() */ | |
| 23 | __syscall_ulong_t sem_nsems;		/* number of semaphores in set */ | |
| 24 | unsigned long int __glibc_reserved3; | |
| 25 | unsigned long int __glibc_reserved4; | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/types/struct_semid_ds.h+7-3| ... | ... | @@ -23,17 +23,21 @@ |
| 23 | 23 | /* Data structure describing a set of semaphores. */ |
| 24 | 24 | struct semid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm sem_perm; /* operation permission struct */ |
| 27 | #if __TIMESIZE == 32 | |
| 30 | # if __TIMESIZE == 32 | |
| 28 | 31 | __time_t sem_otime; /* last semop() time */ |
| 29 | 32 | __syscall_ulong_t __sem_otime_high; |
| 30 | 33 | __time_t sem_ctime; /* last time changed by semctl() */ |
| 31 | 34 | __syscall_ulong_t __sem_ctime_high; |
| 32 | #else | |
| 35 | # else | |
| 33 | 36 | __time_t sem_otime; |
| 34 | 37 | __time_t sem_ctime; |
| 35 | #endif | |
| 38 | # endif | |
| 36 | 39 | __syscall_ulong_t sem_nsems; /* number of semaphores in set */ |
| 37 | 40 | __syscall_ulong_t __glibc_reserved3; |
| 38 | 41 | __syscall_ulong_t __glibc_reserved4; |
| 42 | #endif | |
| 39 | 43 | }; |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/types/struct_shmid64_ds.h created+30| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | /* Generic implementation of the shared memory struct shmid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never include <bits/types/struct_shmid_ds.h> directly; use <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #if __TIMESIZE == 64 | |
| 24 | # define __shmid64_ds shmid_ds | |
| 25 | #else | |
| 26 | struct __shmid64_ds | |
| 27 | { | |
| 28 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 29 | }; | |
| 30 | #endif | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/types/struct_shmid64_ds_helper.h created+28| ... | ... | @@ -0,0 +1,28 @@ |
| 1 | /* Common definitions for struct semid_ds with 64-bit time. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | struct ipc_perm shm_perm;	/* operation permission struct */ | |
| 20 | size_t shm_segsz;		/* size of segment in bytes */ | |
| 21 | __time64_t shm_atime;		/* time of last shmat() */ | |
| 22 | __time64_t shm_dtime;		/* time of last shmdt() */ | |
| 23 | __time64_t shm_ctime;		/* time of last change by shmctl() */ | |
| 24 | __pid_t shm_cpid;		/* pid of creator */ | |
| 25 | __pid_t shm_lpid;		/* pid of last shmop */ | |
| 26 | shmatt_t shm_nattch;		/* number of current attaches */ | |
| 27 | unsigned long int __glibc_reserved5; | |
| 28 | unsigned long int __glibc_reserved6; | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/types/struct_shmid_ds.h+7-3| ... | ... | @@ -23,23 +23,27 @@ |
| 23 | 23 | /* Data structure describing a shared memory segment. */ |
| 24 | 24 | struct shmid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm shm_perm;		/* operation permission struct */ |
| 27 | 30 | size_t shm_segsz;			/* size of segment in bytes */ |
| 28 | #if __TIMESIZE == 32 | |
| 31 | # if __TIMESIZE == 32 | |
| 29 | 32 | __time_t shm_atime;			/* time of last shmat() */ |
| 30 | 33 | unsigned long int __shm_atime_high; |
| 31 | 34 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 32 | 35 | unsigned long int __shm_dtime_high; |
| 33 | 36 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 34 | 37 | unsigned long int __shm_ctime_high; |
| 35 | #else | |
| 38 | # else | |
| 36 | 39 | __time_t shm_atime;			/* time of last shmat() */ |
| 37 | 40 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 38 | 41 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 39 | #endif | |
| 42 | # endif | |
| 40 | 43 | __pid_t shm_cpid;			/* pid of creator */ |
| 41 | 44 | __pid_t shm_lpid;			/* pid of last shmop */ |
| 42 | 45 | shmatt_t shm_nattch;		/* number of current attaches */ |
| 43 | 46 | __syscall_ulong_t __glibc_reserved5; |
| 44 | 47 | __syscall_ulong_t __glibc_reserved6; |
| 48 | #endif | |
| 45 | 49 | }; |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/types/struct_timespec.h+6-1| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | |
| 5 | 5 | #include <bits/types.h> |
| 6 | 6 | #include <bits/endian.h> |
| 7 | #include <bits/types/time_t.h> | |
| 7 | 8 | |
| 8 | 9 | /* POSIX.1b structure for a time value. This is like a `struct timeval' but |
| 9 | 10 | has nanoseconds instead of microseconds. */ |
| 10 | 11 | struct timespec |
| 11 | 12 | { |
| 13 | #ifdef __USE_TIME_BITS64 | |
| 14 | __time64_t tv_sec;		/* Seconds. */ | |
| 15 | #else | |
| 12 | 16 | __time_t tv_sec;		/* Seconds. */ |
| 17 | #endif | |
| 13 | 18 | #if __WORDSIZE == 64 \ |
| 14 | 19 | || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \ |
| 15 | || __TIMESIZE == 32 | |
| 20 | || (__TIMESIZE == 32 && !defined __USE_TIME_BITS64) | |
| 16 | 21 | __syscall_slong_t tv_nsec;	/* Nanoseconds. */ |
| 17 | 22 | #else |
| 18 | 23 | # if __BYTE_ORDER == __BIG_ENDIAN |
lib/libc/include/generic-glibc/bits/types/struct_timeval.h+5| ... | ... | @@ -7,7 +7,12 @@ |
| 7 | 7 | microsecond but also has a range of years. */ |
| 8 | 8 | struct timeval |
| 9 | 9 | { |
| 10 | #ifdef __USE_TIME_BITS64 | |
| 11 | __time64_t tv_sec;		/* Seconds. */ | |
| 12 | __suseconds64_t tv_usec;	/* Microseconds. */ | |
| 13 | #else | |
| 10 | 14 | __time_t tv_sec;		/* Seconds. */ |
| 11 | 15 | __suseconds_t tv_usec;	/* Microseconds. */ |
| 16 | #endif | |
| 12 | 17 | }; |
| 13 | 18 | #endif |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/types/time_t.h+4| ... | ... | @@ -4,6 +4,10 @@ |
| 4 | 4 | #include <bits/types.h> |
| 5 | 5 | |
| 6 | 6 | /* Returned by `time'. */ |
| 7 | #ifdef __USE_TIME_BITS64 | |
| 8 | typedef __time64_t time_t; | |
| 9 | #else | |
| 7 | 10 | typedef __time_t time_t; |
| 11 | #endif | |
| 8 | 12 | |
| 9 | 13 | #endif |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/unistd_ext.h+24-1| ... | ... | @@ -33,4 +33,27 @@ |
| 33 | 33 | not detached and has not been joined. */ |
| 34 | 34 | extern __pid_t gettid (void) __THROW; |
| 35 | 35 | |
| 36 | #endif | |
| \ No newline at end of file | ||
| 36 | #ifdef __has_include | |
| 37 | # if __has_include ("linux/close_range.h") | |
| 38 | # include "linux/close_range.h" | |
| 39 | # endif | |
| 40 | #endif | |
| 41 | /* Unshare the file descriptor table before closing file descriptors. */ | |
| 42 | #ifndef CLOSE_RANGE_UNSHARE | |
| 43 | # define CLOSE_RANGE_UNSHARE (1U << 1) | |
| 44 | #endif | |
| 45 | /* Set the FD_CLOEXEC bit instead of closing the file descriptor. */ | |
| 46 | #ifndef CLOSE_RANGE_CLOEXEC | |
| 47 | # define CLOSE_RANGE_CLOEXEC (1U << 2) | |
| 48 | #endif | |
| 49 | ||
| 50 | /* Close all file descriptors in the range FD up to MAX_FD. The flag FLAGS | |
| 51 | are define by the CLOSE_RANGE prefix. This function behaves like close | |
| 52 | on the range, but in a fail-safe where it will either fail and not close | |
| 53 | any file descriptor or close all of them. Gaps where the file descriptor | |
| 54 | is invalid are ignored. Returns 0 on successor or -1 for failure (and | |
| 55 | sets errno accordingly). */ | |
| 56 | extern int close_range (unsigned int __fd, unsigned int __max_fd, | |
| 57 | 			int __flags) __THROW; | |
| 58 | ||
| 59 | #endif /* __USE_GNU */ | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/bits/wordsize.h+15-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | 2 | This file is part of the GNU C Library. |
| 3 | 3 | |
| 4 | 4 | The GNU C Library is free software; you can redistribute it and/or |
| ... | ... | @@ -12,10 +12,20 @@ |
| 12 | 12 | Lesser General Public License for more details. |
| 13 | 13 | |
| 14 | 14 | You should have received a copy of the GNU Lesser General Public |
| 15 | License along with the GNU C Library; if not, see | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | 16 | <https://www.gnu.org/licenses/>. */ |
| 17 | 17 | |
| 18 | #define __WORDSIZE			32 | |
| 19 | #define __WORDSIZE_TIME64_COMPAT32	0 | |
| 18 | #include <sgidefs.h> | |
| 19 | ||
| 20 | #define __WORDSIZE			_MIPS_SZPTR | |
| 21 | ||
| 22 | #if _MIPS_SIM == _ABI64 | |
| 23 | # define __WORDSIZE_TIME64_COMPAT32	1 | |
| 24 | #else | |
| 25 | # define __WORDSIZE_TIME64_COMPAT32	0 | |
| 26 | #endif | |
| 27 | ||
| 28 | #if __WORDSIZE == 32 | |
| 20 | 29 | #define __WORDSIZE32_SIZE_ULONG		0 |
| 21 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| \ No newline at end of file | ||
| 30 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| 31 | #endif | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/elf.h+6-1| ... | ... | @@ -336,7 +336,8 @@ typedef struct |
| 336 | 336 | #define EM_BA2		202	/* Beyond BA2 */ |
| 337 | 337 | #define EM_XCORE	203	/* XMOS xCORE */ |
| 338 | 338 | #define EM_MCHP_PIC	204	/* Microchip 8-bit PIC(r) */ |
| 339 | 				/* reserved 205-209 */ | |
| 339 | #define EM_INTELGT	205	/* Intel Graphics Technology */ | |
| 340 | 				/* reserved 206-209 */ | |
| 340 | 341 | #define EM_KM32		210	/* KM211 KM32 */ |
| 341 | 342 | #define EM_KMX32	211	/* KM211 KMX32 */ |
| 342 | 343 | #define EM_EMX16	212	/* KM211 KMX16 */ |
| ... | ... | @@ -813,6 +814,10 @@ typedef struct |
| 813 | 814 | 					 address keys. */ |
| 814 | 815 | #define NT_ARM_PACG_KEYS	0x408	/* ARM pointer authentication |
| 815 | 816 | 					 generic key. */ |
| 817 | #define NT_ARM_TAGGED_ADDR_CTRL	0x409	/* AArch64 tagged address | |
| 818 | 					 control. */ | |
| 819 | #define NT_ARM_PAC_ENABLED_KEYS	0x40a	/* AArch64 pointer authentication | |
| 820 | 					 enabled keys. */ | |
| 816 | 821 | #define NT_VMCOREDD	0x700		/* Vmcore Device Dump Note. */ |
| 817 | 822 | #define NT_MIPS_DSP	0x800		/* MIPS DSP ASE registers. */ |
| 818 | 823 | #define NT_MIPS_FP_MODE	0x801		/* MIPS floating-point mode. */ |
lib/libc/include/generic-glibc/fcntl.h+20-7| ... | ... | @@ -172,17 +172,30 @@ typedef __pid_t pid_t; |
| 172 | 172 | |
| 173 | 173 | This function is a cancellation point and therefore not marked with |
| 174 | 174 | __THROW. */ |
| 175 | #ifndef __USE_FILE_OFFSET64 | |
| 175 | #ifndef __USE_TIME_BITS64 | |
| 176 | # ifndef __USE_FILE_OFFSET64 | |
| 176 | 177 | extern int fcntl (int __fd, int __cmd, ...); |
| 177 | #else | |
| 178 | # ifdef __REDIRECT | |
| 179 | extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64); | |
| 180 | 178 | # else |
| 181 | # define fcntl fcntl64 | |
| 179 | # ifdef __REDIRECT | |
| 180 | extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64); | |
| 181 | # else | |
| 182 | # define fcntl fcntl64 | |
| 183 | # endif | |
| 182 | 184 | # endif |
| 183 | #endif | |
| 184 | #ifdef __USE_LARGEFILE64 | |
| 185 | # ifdef __USE_LARGEFILE64 | |
| 185 | 186 | extern int fcntl64 (int __fd, int __cmd, ...); |
| 187 | # endif | |
| 188 | #else /* __USE_TIME_BITS64 */ | |
| 189 | # ifdef __REDIRECT | |
| 190 | extern int __REDIRECT (fcntl, (int __fd, int __request, ...), | |
| 191 | 		 __fcntl_time64) __THROW; | |
| 192 | extern int __REDIRECT (fcntl64, (int __fd, int __request, ...), | |
| 193 | 		 __fcntl_time64) __THROW; | |
| 194 | # else | |
| 195 | extern int __fcntl_time64 (int __fd, int __request, ...) __THROW; | |
| 196 | # define fcntl64 __fcntl_time64 | |
| 197 | # define fcntl __fcntl_time64 | |
| 198 | # endif | |
| 186 | 199 | #endif |
| 187 | 200 | |
| 188 | 201 | /* Open FILE and return a new file descriptor for it, or -1 on error. |
lib/libc/include/generic-glibc/features-time64.h created+37| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | /* Features part to handle 64-bit time_t support. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* We need to know the word size in order to check the time size. */ | |
| 20 | #include <bits/wordsize.h> | |
| 21 | #include <bits/timesize.h> | |
| 22 | ||
| 23 | #if defined _TIME_BITS | |
| 24 | # if _TIME_BITS == 64 | |
| 25 | # if ! defined (_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64 | |
| 26 | # error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64" | |
| 27 | # elif __TIMESIZE == 32 | |
| 28 | # define __USE_TIME_BITS64	1 | |
| 29 | # endif | |
| 30 | # elif _TIME_BITS == 32 | |
| 31 | # if __TIMESIZE > 32 | |
| 32 | # error "_TIME_BITS=32 is not compatible with __TIMESIZE > 32" | |
| 33 | # endif | |
| 34 | # else | |
| 35 | # error Invalid _TIME_BITS value (can only be 32 or 64-bit) | |
| 36 | # endif | |
| 37 | #endif | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/features.h+16-1| ... | ... | @@ -33,6 +33,8 @@ |
| 33 | 33 | 			Extensions to ISO C11 from TS 18661-4:2015. |
| 34 | 34 | __STDC_WANT_IEC_60559_TYPES_EXT__ |
| 35 | 35 | 			Extensions to ISO C11 from TS 18661-3:2015. |
| 36 | __STDC_WANT_IEC_60559_EXT__ | |
| 37 | 			ISO C2X interfaces defined only in Annex F. | |
| 36 | 38 | |
| 37 | 39 | _POSIX_SOURCE	IEEE Std 1003.1. |
| 38 | 40 | _POSIX_C_SOURCE	If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; |
| ... | ... | @@ -48,6 +50,8 @@ |
| 48 | 50 | _LARGEFILE64_SOURCE	Additional functionality from LFS for large files. |
| 49 | 51 | _FILE_OFFSET_BITS=N	Select default filesystem interface. |
| 50 | 52 | _ATFILE_SOURCE	Additional *at interfaces. |
| 53 | _DYNAMIC_STACK_SIZE_SOURCE Select correct (but non compile-time constant) | |
| 54 | 			MINSIGSTKSZ, SIGSTKSZ and PTHREAD_STACK_MIN. | |
| 51 | 55 | _GNU_SOURCE		All of the above, plus GNU extensions. |
| 52 | 56 | _DEFAULT_SOURCE	The default set of features (taking precedence over |
| 53 | 57 | 			__STRICT_ANSI__). |
| ... | ... | @@ -94,6 +98,8 @@ |
| 94 | 98 | __USE_FILE_OFFSET64	Define 64bit interface as default. |
| 95 | 99 | __USE_MISC		Define things from 4.3BSD or System V Unix. |
| 96 | 100 | __USE_ATFILE		Define *at interfaces and AT_* constants for them. |
| 101 | __USE_DYNAMIC_STACK_SIZE Define correct (but non compile-time constant) | |
| 102 | 			MINSIGSTKSZ, SIGSTKSZ and PTHREAD_STACK_MIN. | |
| 97 | 103 | __USE_GNU		Define GNU extensions. |
| 98 | 104 | __USE_FORTIFY_LEVEL	Additional security measures used, according to level. |
| 99 | 105 | |
| ... | ... | @@ -137,6 +143,7 @@ |
| 137 | 143 | #undef	__USE_FILE_OFFSET64 |
| 138 | 144 | #undef	__USE_MISC |
| 139 | 145 | #undef	__USE_ATFILE |
| 146 | #undef	__USE_DYNAMIC_STACK_SIZE | |
| 140 | 147 | #undef	__USE_GNU |
| 141 | 148 | #undef	__USE_FORTIFY_LEVEL |
| 142 | 149 | #undef	__KERNEL_STRICT_NAMES |
| ... | ... | @@ -213,6 +220,8 @@ |
| 213 | 220 | # define _DEFAULT_SOURCE	1 |
| 214 | 221 | # undef _ATFILE_SOURCE |
| 215 | 222 | # define _ATFILE_SOURCE	1 |
| 223 | # undef _DYNAMIC_STACK_SIZE_SOURCE | |
| 224 | # define _DYNAMIC_STACK_SIZE_SOURCE 1 | |
| 216 | 225 | #endif |
| 217 | 226 | |
| 218 | 227 | /* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined, |
| ... | ... | @@ -380,6 +389,8 @@ |
| 380 | 389 | # define __USE_FILE_OFFSET64	1 |
| 381 | 390 | #endif |
| 382 | 391 | |
| 392 | #include <features-time64.h> | |
| 393 | ||
| 383 | 394 | #if defined _DEFAULT_SOURCE |
| 384 | 395 | # define __USE_MISC	1 |
| 385 | 396 | #endif |
| ... | ... | @@ -388,6 +399,10 @@ |
| 388 | 399 | # define __USE_ATFILE	1 |
| 389 | 400 | #endif |
| 390 | 401 | |
| 402 | #ifdef	_DYNAMIC_STACK_SIZE_SOURCE | |
| 403 | # define __USE_DYNAMIC_STACK_SIZE	1 | |
| 404 | #endif | |
| 405 | ||
| 391 | 406 | #ifdef	_GNU_SOURCE |
| 392 | 407 | # define __USE_GNU	1 |
| 393 | 408 | #endif |
| ... | ... | @@ -462,7 +477,7 @@ |
| 462 | 477 | /* Major and minor version number of the GNU C library package. Use |
| 463 | 478 | these macros to test for features in specific releases. */ |
| 464 | 479 | #define	__GLIBC__	2 |
| 465 | #define	__GLIBC_MINOR__	33 | |
| 480 | #define	__GLIBC_MINOR__	34 | |
| 466 | 481 | |
| 467 | 482 | #define __GLIBC_PREREQ(maj, min) \ |
| 468 | 483 | 	((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) |
lib/libc/include/generic-glibc/fts.h+38-5| ... | ... | @@ -187,6 +187,7 @@ FTSENT	*fts_read (FTS *); |
| 187 | 187 | int	 fts_set (FTS *, FTSENT *, int) __THROW; |
| 188 | 188 | #else |
| 189 | 189 | # ifdef __REDIRECT |
| 190 | # ifndef __USE_TIME_BITS64 | |
| 190 | 191 | FTSENT	*__REDIRECT (fts_children, (FTS *, int), fts64_children); |
| 191 | 192 | int	 __REDIRECT (fts_close, (FTS *), fts64_close); |
| 192 | 193 | FTS	*__REDIRECT (fts_open, (char * const *, int, |
| ... | ... | @@ -194,21 +195,53 @@ FTS	*__REDIRECT (fts_open, (char * const *, int, |
| 194 | 195 | 		 fts64_open); |
| 195 | 196 | FTSENT	*__REDIRECT (fts_read, (FTS *), fts64_read); |
| 196 | 197 | int	 __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int), fts64_set); |
| 198 | # else | |
| 199 | FTSENT	*__REDIRECT (fts_children, (FTS *, int), __fts64_children_time64); | |
| 200 | int	 __REDIRECT (fts_close, (FTS *), __fts64_close_time64); | |
| 201 | FTS	*__REDIRECT (fts_open, (char * const *, int, | |
| 202 | 				int (*)(const FTSENT **, const FTSENT **)), | |
| 203 | 		 __fts64_open_time64); | |
| 204 | FTSENT	*__REDIRECT (fts_read, (FTS *), __fts64_read_time64); | |
| 205 | int	 __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int), | |
| 206 | 			 __fts64_set_time64); | |
| 207 | # endif | |
| 197 | 208 | # else |
| 198 | # define fts_children fts64_children | |
| 199 | # define fts_close fts64_close | |
| 200 | # define fts_open fts64_open | |
| 201 | # define fts_read fts64_read | |
| 202 | # define fts_set fts64_set | |
| 209 | # ifndef __USE_TIME_BITS64 | |
| 210 | # define fts_children fts64_children | |
| 211 | # define fts_close fts64_close | |
| 212 | # define fts_open fts64_open | |
| 213 | # define fts_read fts64_read | |
| 214 | # define fts_set fts64_set | |
| 215 | # else | |
| 216 | # endif | |
| 203 | 217 | # endif |
| 204 | 218 | #endif |
| 205 | 219 | #ifdef __USE_LARGEFILE64 |
| 220 | # ifndef __USE_TIME_BITS64 | |
| 206 | 221 | FTSENT64 *fts64_children (FTS64 *, int); |
| 207 | 222 | int	 fts64_close (FTS64 *); |
| 208 | 223 | FTS64	 *fts64_open (char * const *, int, |
| 209 | 224 | 		 int (*)(const FTSENT64 **, const FTSENT64 **)); |
| 210 | 225 | FTSENT64 *fts64_read (FTS64 *); |
| 211 | 226 | int	 fts64_set (FTS64 *, FTSENT64 *, int) __THROW; |
| 227 | # else | |
| 228 | # ifdef __REDIRECT | |
| 229 | FTSENT	*__REDIRECT (fts64_children, (FTS64 *, int), __fts64_children_time64); | |
| 230 | int	 __REDIRECT (fts64_close, (FTS64 *), __fts64_close_time64); | |
| 231 | FTS	*__REDIRECT (fts64_open, (char * const *, int, | |
| 232 | 				int (*)(const FTSENT64 **, const FTSENT64 **)), | |
| 233 | 		 __fts64_open_time64); | |
| 234 | FTSENT	*__REDIRECT (fts64_read, (FTS64 *), __fts64_read_time64); | |
| 235 | int	 __REDIRECT_NTH (fts64_set, (FTS64 *, FTSENT64 *, int), | |
| 236 | 			 __fts64_set_time64); | |
| 237 | # else | |
| 238 | # define fts_children __fts64_children_time64 | |
| 239 | # define fts_close __fts64_close_time64 | |
| 240 | # define fts_open __fts64_open_time64 | |
| 241 | # define fts_read __fts64_read_time64 | |
| 242 | # define fts_set __fts64_set_time64 | |
| 243 | # endif | |
| 244 | # endif | |
| 212 | 245 | #endif |
| 213 | 246 | __END_DECLS |
| 214 | 247 |
lib/libc/include/generic-glibc/ftw.h+44-2| ... | ... | @@ -137,15 +137,36 @@ extern int ftw (const char *__dir, __ftw_func_t __func, int __descriptors) |
| 137 | 137 | __nonnull ((1, 2)); |
| 138 | 138 | #else |
| 139 | 139 | # ifdef __REDIRECT |
| 140 | # ifndef __USE_TIME_BITS64 | |
| 140 | 141 | extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func, |
| 141 | 142 | 			 int __descriptors), ftw64) __nonnull ((1, 2)); |
| 143 | # else | |
| 144 | extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func, | |
| 145 | 			 int __descriptors), __ftw64_time64) | |
| 146 | __nonnull ((1, 2)); | |
| 147 | # endif | |
| 142 | 148 | # else |
| 143 | # define ftw ftw64 | |
| 149 | # ifndef __USE_TIME_BITS64 | |
| 150 | # define ftw ftw64 | |
| 151 | # else | |
| 152 | # define ftw __ftw64_time64 | |
| 153 | # endif | |
| 144 | 154 | # endif |
| 145 | 155 | #endif |
| 146 | 156 | #ifdef __USE_LARGEFILE64 |
| 157 | # ifndef __USE_TIME_BITS64 | |
| 147 | 158 | extern int ftw64 (const char *__dir, __ftw64_func_t __func, |
| 148 | 159 | 		 int __descriptors) __nonnull ((1, 2)); |
| 160 | # else | |
| 161 | # ifdef __REDIRECT | |
| 162 | extern int __REDIRECT (ftw64, (const char *__dir, __ftw64_func_t __func, | |
| 163 | 			 int __descriptors), | |
| 164 | 		 __ftw64_time64) | |
| 165 | __nonnull ((1, 2)); | |
| 166 | # else | |
| 167 | # define nftw64 __nftw64_time64 | |
| 168 | # endif | |
| 169 | # endif | |
| 149 | 170 | #endif |
| 150 | 171 | |
| 151 | 172 | #ifdef __USE_XOPEN_EXTENDED |
| ... | ... | @@ -159,16 +180,37 @@ extern int nftw (const char *__dir, __nftw_func_t __func, int __descriptors, |
| 159 | 180 | 		 int __flag) __nonnull ((1, 2)); |
| 160 | 181 | # else |
| 161 | 182 | # ifdef __REDIRECT |
| 183 | # ifndef __USE_TIME_BITS64 | |
| 162 | 184 | extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func, |
| 163 | 185 | 			 int __descriptors, int __flag), nftw64) |
| 164 | 186 | __nonnull ((1, 2)); |
| 187 | # else | |
| 188 | extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func, | |
| 189 | 			 int __descriptors, int __flag), __nftw64_time64) | |
| 190 | __nonnull ((1, 2)); | |
| 191 | # endif | |
| 165 | 192 | # else |
| 166 | # define nftw nftw64 | |
| 193 | # ifndef __USE_TIME_BITS64 | |
| 194 | # define nftw nftw64 | |
| 195 | # else | |
| 196 | # define nftw __nftw64_time64 | |
| 197 | # endif | |
| 167 | 198 | # endif |
| 168 | 199 | # endif |
| 169 | 200 | # ifdef __USE_LARGEFILE64 |
| 201 | # ifndef __USE_TIME_BITS64 | |
| 170 | 202 | extern int nftw64 (const char *__dir, __nftw64_func_t __func, |
| 171 | 203 | 		 int __descriptors, int __flag) __nonnull ((1, 2)); |
| 204 | # else | |
| 205 | # ifdef __REDIRECT | |
| 206 | extern int __REDIRECT (nftw64, (const char *__dir, __nftw64_func_t __func, | |
| 207 | 				int __descriptors, int __flag), | |
| 208 | 		 __nftw64_time64) | |
| 209 | __nonnull ((1, 2)); | |
| 210 | # else | |
| 211 | # define nftw64 __nftw64_time64 | |
| 212 | # endif | |
| 213 | # endif | |
| 172 | 214 | # endif |
| 173 | 215 | #endif |
| 174 | 216 |
lib/libc/include/generic-glibc/glob.h+28-6| ... | ... | @@ -145,25 +145,47 @@ typedef struct |
| 145 | 145 | #if !defined __USE_FILE_OFFSET64 |
| 146 | 146 | extern int glob (const char *__restrict __pattern, int __flags, |
| 147 | 147 | 		 int (*__errfunc) (const char *, int), |
| 148 | 		 glob_t *__restrict __pglob) __THROW; | |
| 148 | 		 glob_t *__restrict __pglob) __THROWNL; | |
| 149 | 149 | |
| 150 | 150 | /* Free storage allocated in PGLOB by a previous `glob' call. */ |
| 151 | 151 | extern void globfree (glob_t *__pglob) __THROW; |
| 152 | 152 | #else |
| 153 | extern int __REDIRECT_NTH (glob, (const char *__restrict __pattern, | |
| 154 | 				 int __flags, | |
| 155 | 				 int (*__errfunc) (const char *, int), | |
| 156 | 				 glob_t *__restrict __pglob), glob64); | |
| 153 | # ifdef __USE_TIME_BITS64 | |
| 154 | extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern, | |
| 155 | 				 int __flags, | |
| 156 | 				 int (*__errfunc) (const char *, int), | |
| 157 | 				 glob_t *__restrict __pglob), | |
| 158 | 			 __glob64_time64); | |
| 159 | ||
| 160 | extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), | |
| 161 | 			 __globfree64_time64); | |
| 162 | # else | |
| 163 | extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern, | |
| 164 | 				 int __flags, | |
| 165 | 				 int (*__errfunc) (const char *, int), | |
| 166 | 				 glob_t *__restrict __pglob), glob64); | |
| 157 | 167 | |
| 158 | 168 | extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64); |
| 169 | # endif | |
| 159 | 170 | #endif |
| 160 | 171 | |
| 161 | 172 | #ifdef __USE_LARGEFILE64 |
| 173 | # ifdef __USE_TIME_BITS64 | |
| 174 | extern int __REDIRECT_NTHNL (glob64, (const char *__restrict __pattern, | |
| 175 | 				 int __flags, | |
| 176 | 				 int (*__errfunc) (const char *, int), | |
| 177 | 				 glob64_t *__restrict __pglob), | |
| 178 | 			 __glob64_time64); | |
| 179 | ||
| 180 | extern void __REDIRECT_NTH (globfree64, (glob64_t *__pglob), | |
| 181 | 			 __globfree64_time64); | |
| 182 | # else | |
| 162 | 183 | extern int glob64 (const char *__restrict __pattern, int __flags, |
| 163 | 184 | 		 int (*__errfunc) (const char *, int), |
| 164 | 		 glob64_t *__restrict __pglob) __THROW; | |
| 185 | 		 glob64_t *__restrict __pglob) __THROWNL; | |
| 165 | 186 | |
| 166 | 187 | extern void globfree64 (glob64_t *__pglob) __THROW; |
| 188 | # endif | |
| 167 | 189 | #endif |
| 168 | 190 | |
| 169 | 191 |
lib/libc/include/generic-glibc/gnu/lib-names-32.h+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | #define LIBANL_SO "libanl.so.1" |
| 9 | 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 10 | 10 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | 12 | #define LIBC_SO "libc.so.6" |
| 12 | 13 | #define LIBDL_SO "libdl.so.2" |
| 13 | 14 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/generic-glibc/gnu/lib-names-hard.h+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | #define LIBANL_SO "libanl.so.1" |
| 9 | 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 10 | 10 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | 12 | #define LIBC_SO "libc.so.6" |
| 12 | 13 | #define LIBDL_SO "libdl.so.2" |
| 13 | 14 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/generic-glibc/gnu/lib-names-ilp32d.h created+30| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | /* This file is automatically generated. */ | |
| 2 | #ifndef __GNU_LIB_NAMES_H | |
| 3 | # error "Never use <gnu/lib-names-ilp32d.h> directly; include <gnu/lib-names.h> instead." | |
| 4 | #endif | |
| 5 | ||
| 6 | #define LD_LINUX_RISCV32_ILP32D_SO "ld-linux-riscv32-ilp32d.so.1" | |
| 7 | #define LD_SO "ld-linux-riscv32-ilp32d.so.1" | |
| 8 | #define LIBANL_SO "libanl.so.1" | |
| 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" | |
| 10 | #define LIBCRYPT_SO "libcrypt.so.1" | |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 12 | #define LIBC_SO "libc.so.6" | |
| 13 | #define LIBDL_SO "libdl.so.2" | |
| 14 | #define LIBGCC_S_SO "libgcc_s.so.1" | |
| 15 | #define LIBMVEC_SO "libmvec.so.1" | |
| 16 | #define LIBM_SO "libm.so.6" | |
| 17 | #define LIBNSL_SO "libnsl.so.1" | |
| 18 | #define LIBNSS_COMPAT_SO "libnss_compat.so.2" | |
| 19 | #define LIBNSS_DB_SO "libnss_db.so.2" | |
| 20 | #define LIBNSS_DNS_SO "libnss_dns.so.2" | |
| 21 | #define LIBNSS_FILES_SO "libnss_files.so.2" | |
| 22 | #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" | |
| 23 | #define LIBNSS_LDAP_SO "libnss_ldap.so.2" | |
| 24 | #define LIBNSS_TEST1_SO "libnss_test1.so.2" | |
| 25 | #define LIBNSS_TEST2_SO "libnss_test2.so.2" | |
| 26 | #define LIBPTHREAD_SO "libpthread.so.0" | |
| 27 | #define LIBRESOLV_SO "libresolv.so.2" | |
| 28 | #define LIBRT_SO "librt.so.1" | |
| 29 | #define LIBTHREAD_DB_SO "libthread_db.so.1" | |
| 30 | #define LIBUTIL_SO "libutil.so.1" |
lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h+1| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | #define LIBANL_SO "libanl.so.1" |
| 8 | 8 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 9 | 9 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 10 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 10 | 11 | #define LIBC_SO "libc.so.6" |
| 11 | 12 | #define LIBDL_SO "libdl.so.2" |
| 12 | 13 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h+1| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | #define LIBANL_SO "libanl.so.1" |
| 8 | 8 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 9 | 9 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 10 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 10 | 11 | #define LIBC_SO "libc.so.6" |
| 11 | 12 | #define LIBDL_SO "libdl.so.2" |
| 12 | 13 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h+1| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | #define LIBANL_SO "libanl.so.1" |
| 8 | 8 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 9 | 9 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 10 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 10 | 11 | #define LIBC_SO "libc.so.6" |
| 11 | 12 | #define LIBDL_SO "libdl.so.2" |
| 12 | 13 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/generic-glibc/gnu/lib-names-o32_soft.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* This file is automatically generated. */ | |
| 2 | #ifndef __GNU_LIB_NAMES_H | |
| 3 | # error "Never use <gnu/lib-names-o32_soft.h> directly; include <gnu/lib-names.h> instead." | |
| 4 | #endif | |
| 5 | ||
| 6 | #define LD_SO "ld.so.1" | |
| 7 | #define LIBANL_SO "libanl.so.1" | |
| 8 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" | |
| 9 | #define LIBCRYPT_SO "libcrypt.so.1" | |
| 10 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | #define LIBC_SO "libc.so.6" | |
| 12 | #define LIBDL_SO "libdl.so.2" | |
| 13 | #define LIBGCC_S_SO "libgcc_s.so.1" | |
| 14 | #define LIBMVEC_SO "libmvec.so.1" | |
| 15 | #define LIBM_SO "libm.so.6" | |
| 16 | #define LIBNSL_SO "libnsl.so.1" | |
| 17 | #define LIBNSS_COMPAT_SO "libnss_compat.so.2" | |
| 18 | #define LIBNSS_DB_SO "libnss_db.so.2" | |
| 19 | #define LIBNSS_DNS_SO "libnss_dns.so.2" | |
| 20 | #define LIBNSS_FILES_SO "libnss_files.so.2" | |
| 21 | #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" | |
| 22 | #define LIBNSS_LDAP_SO "libnss_ldap.so.2" | |
| 23 | #define LIBNSS_TEST1_SO "libnss_test1.so.2" | |
| 24 | #define LIBNSS_TEST2_SO "libnss_test2.so.2" | |
| 25 | #define LIBPTHREAD_SO "libpthread.so.0" | |
| 26 | #define LIBRESOLV_SO "libresolv.so.2" | |
| 27 | #define LIBRT_SO "librt.so.1" | |
| 28 | #define LIBTHREAD_DB_SO "libthread_db.so.1" | |
| 29 | #define LIBUTIL_SO "libutil.so.1" | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/gnu/lib-names-soft.h+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | #define LIBANL_SO "libanl.so.1" |
| 9 | 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 10 | 10 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | 12 | #define LIBC_SO "libc.so.6" |
| 12 | 13 | #define LIBDL_SO "libdl.so.2" |
| 13 | 14 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/generic-glibc/gnu/stubs-ilp32.h created+38| ... | ... | @@ -0,0 +1,38 @@ |
| 1 | /* This file is automatically generated. | |
| 2 | It defines a symbol `__stub_FUNCTION' for each function | |
| 3 | in the C library which is a stub, meaning it will fail | |
| 4 | every time called, usually setting errno to ENOSYS. */ | |
| 5 | ||
| 6 | #ifdef _LIBC | |
| 7 | #error Applications may not define the macro _LIBC | |
| 8 | #endif | |
| 9 | ||
| 10 | #define __stub___compat_bdflush | |
| 11 | #define __stub___compat_create_module | |
| 12 | #define __stub___compat_get_kernel_syms | |
| 13 | #define __stub___compat_query_module | |
| 14 | #define __stub___compat_uselib | |
| 15 | #define __stub_chflags | |
| 16 | #define __stub_fchflags | |
| 17 | #define __stub_feclearexcept | |
| 18 | #define __stub_fedisableexcept | |
| 19 | #define __stub_feenableexcept | |
| 20 | #define __stub_fegetenv | |
| 21 | #define __stub_fegetexcept | |
| 22 | #define __stub_fegetexceptflag | |
| 23 | #define __stub_fegetmode | |
| 24 | #define __stub_fegetround | |
| 25 | #define __stub_feholdexcept | |
| 26 | #define __stub_feraiseexcept | |
| 27 | #define __stub_fesetenv | |
| 28 | #define __stub_fesetexcept | |
| 29 | #define __stub_fesetexceptflag | |
| 30 | #define __stub_fesetmode | |
| 31 | #define __stub_fesetround | |
| 32 | #define __stub_fetestexcept | |
| 33 | #define __stub_feupdateenv | |
| 34 | #define __stub_gtty | |
| 35 | #define __stub_revoke | |
| 36 | #define __stub_setlogin | |
| 37 | #define __stub_sigreturn | |
| 38 | #define __stub_stty |
lib/libc/include/generic-glibc/gnu/stubs-ilp32d.h created+24| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | /* This file is automatically generated. | |
| 2 | It defines a symbol `__stub_FUNCTION' for each function | |
| 3 | in the C library which is a stub, meaning it will fail | |
| 4 | every time called, usually setting errno to ENOSYS. */ | |
| 5 | ||
| 6 | #ifdef _LIBC | |
| 7 | #error Applications may not define the macro _LIBC | |
| 8 | #endif | |
| 9 | ||
| 10 | #define __stub___compat_bdflush | |
| 11 | #define __stub___compat_create_module | |
| 12 | #define __stub___compat_get_kernel_syms | |
| 13 | #define __stub___compat_query_module | |
| 14 | #define __stub___compat_uselib | |
| 15 | #define __stub_chflags | |
| 16 | #define __stub_fchflags | |
| 17 | #define __stub_fedisableexcept | |
| 18 | #define __stub_feenableexcept | |
| 19 | #define __stub_fegetexcept | |
| 20 | #define __stub_gtty | |
| 21 | #define __stub_revoke | |
| 22 | #define __stub_setlogin | |
| 23 | #define __stub_sigreturn | |
| 24 | #define __stub_stty |
lib/libc/include/generic-glibc/gnu/stubs-o32_soft.h created+33| ... | ... | @@ -0,0 +1,33 @@ |
| 1 | /* This file is automatically generated. | |
| 2 | It defines a symbol `__stub_FUNCTION' for each function | |
| 3 | in the C library which is a stub, meaning it will fail | |
| 4 | every time called, usually setting errno to ENOSYS. */ | |
| 5 | ||
| 6 | #ifdef _LIBC | |
| 7 | #error Applications may not define the macro _LIBC | |
| 8 | #endif | |
| 9 | ||
| 10 | #define __stub_chflags | |
| 11 | #define __stub_fchflags | |
| 12 | #define __stub_feclearexcept | |
| 13 | #define __stub_fedisableexcept | |
| 14 | #define __stub_feenableexcept | |
| 15 | #define __stub_fegetenv | |
| 16 | #define __stub_fegetexcept | |
| 17 | #define __stub_fegetexceptflag | |
| 18 | #define __stub_fegetmode | |
| 19 | #define __stub_fegetround | |
| 20 | #define __stub_feholdexcept | |
| 21 | #define __stub_feraiseexcept | |
| 22 | #define __stub_fesetenv | |
| 23 | #define __stub_fesetexcept | |
| 24 | #define __stub_fesetexceptflag | |
| 25 | #define __stub_fesetmode | |
| 26 | #define __stub_fesetround | |
| 27 | #define __stub_fetestexcept | |
| 28 | #define __stub_feupdateenv | |
| 29 | #define __stub_gtty | |
| 30 | #define __stub_revoke | |
| 31 | #define __stub_setlogin | |
| 32 | #define __stub_sigreturn | |
| 33 | #define __stub_stty | |
| \ No newline at end of file |
lib/libc/include/generic-glibc/malloc.h+7-31| ... | ... | @@ -56,30 +56,25 @@ __THROW __attribute_warn_unused_result__ __attribute_alloc_size__ ((2)); |
| 56 | 56 | the same pointer that was passed to it, aliasing needs to be allowed |
| 57 | 57 | between objects pointed by the old and new pointers. */ |
| 58 | 58 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) |
| 59 | __THROW __attribute_warn_unused_result__ __attribute_alloc_size__ ((2, 3)); | |
| 59 | __THROW __attribute_warn_unused_result__ __attribute_alloc_size__ ((2, 3)) | |
| 60 | __attr_dealloc_free; | |
| 60 | 61 | |
| 61 | 62 | /* Free a block allocated by `malloc', `realloc' or `calloc'. */ |
| 62 | 63 | extern void free (void *__ptr) __THROW; |
| 63 | 64 | |
| 64 | 65 | /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ |
| 65 | 66 | extern void *memalign (size_t __alignment, size_t __size) |
| 66 | __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur; | |
| 67 | __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur | |
| 68 | __attr_dealloc_free; | |
| 67 | 69 | |
| 68 | 70 | /* Allocate SIZE bytes on a page boundary. */ |
| 69 | 71 | extern void *valloc (size_t __size) __THROW __attribute_malloc__ |
| 70 | __attribute_alloc_size__ ((1)) __wur; | |
| 72 | __attribute_alloc_size__ ((1)) __wur __attr_dealloc_free; | |
| 71 | 73 | |
| 72 | 74 | /* Equivalent to valloc(minimum-page-that-holds(n)), that is, round up |
| 73 | 75 | __size to nearest pagesize. */ |
| 74 | extern void *pvalloc (size_t __size) __THROW __attribute_malloc__ __wur; | |
| 75 | ||
| 76 | /* Underlying allocation function; successive calls should return | |
| 77 | contiguous pieces of memory. */ | |
| 78 | extern void *(*__morecore) (ptrdiff_t __size) __MALLOC_DEPRECATED; | |
| 79 | ||
| 80 | /* Default value of `__morecore'. */ | |
| 81 | extern void *__default_morecore (ptrdiff_t __size) | |
| 82 | __THROW __attribute_malloc__ __MALLOC_DEPRECATED; | |
| 76 | extern void *pvalloc (size_t __size) __THROW __attribute_malloc__ | |
| 77 | __wur __attr_dealloc_free; | |
| 83 | 78 | |
| 84 | 79 | /* SVID2/XPG mallinfo structure */ |
| 85 | 80 | |
| ... | ... | @@ -161,24 +156,5 @@ extern void malloc_stats (void) __THROW; |
| 161 | 156 | /* Output information about state of allocator to stream FP. */ |
| 162 | 157 | extern int malloc_info (int __options, FILE *__fp) __THROW; |
| 163 | 158 | |
| 164 | /* Hooks for debugging and user-defined versions. */ | |
| 165 | extern void (*__MALLOC_HOOK_VOLATILE __free_hook) (void *__ptr, | |
| 166 | const void *) | |
| 167 | __MALLOC_DEPRECATED; | |
| 168 | extern void *(*__MALLOC_HOOK_VOLATILE __malloc_hook)(size_t __size, | |
| 169 | const void *) | |
| 170 | __MALLOC_DEPRECATED; | |
| 171 | extern void *(*__MALLOC_HOOK_VOLATILE __realloc_hook)(void *__ptr, | |
| 172 | size_t __size, | |
| 173 | const void *) | |
| 174 | __MALLOC_DEPRECATED; | |
| 175 | extern void *(*__MALLOC_HOOK_VOLATILE __memalign_hook)(size_t __alignment, | |
| 176 | size_t __size, | |
| 177 | const void *) | |
| 178 | __MALLOC_DEPRECATED; | |
| 179 | extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void) | |
| 180 | __MALLOC_DEPRECATED; | |
| 181 | ||
| 182 | ||
| 183 | 159 | __END_DECLS |
| 184 | 160 | #endif /* malloc.h */ |
| \ No newline at end of file |
lib/libc/include/generic-glibc/math.h+22-8| ... | ... | @@ -104,7 +104,7 @@ __BEGIN_DECLS |
| 104 | 104 | # endif |
| 105 | 105 | #endif /* __USE_ISOC99 */ |
| 106 | 106 | |
| 107 | #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) | |
| 107 | #if __GLIBC_USE (IEC_60559_BFP_EXT) | |
| 108 | 108 | /* Signaling NaN macros, if supported. */ |
| 109 | 109 | # if __GNUC_PREREQ (3, 3) |
| 110 | 110 | # define SNANF (__builtin_nansf ("")) |
| ... | ... | @@ -112,25 +112,39 @@ __BEGIN_DECLS |
| 112 | 112 | # define SNANL (__builtin_nansl ("")) |
| 113 | 113 | # endif |
| 114 | 114 | #endif |
| 115 | #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT) | |
| 115 | #if (__HAVE_FLOAT16					\ | |
| 116 | && __GLIBC_USE (IEC_60559_TYPES_EXT)		\ | |
| 117 | && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) | |
| 116 | 118 | # define SNANF16 (__builtin_nansf16 ("")) |
| 117 | 119 | #endif |
| 118 | #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT) | |
| 120 | #if (__HAVE_FLOAT32					\ | |
| 121 | && __GLIBC_USE (IEC_60559_TYPES_EXT)		\ | |
| 122 | && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) | |
| 119 | 123 | # define SNANF32 (__builtin_nansf32 ("")) |
| 120 | 124 | #endif |
| 121 | #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT) | |
| 125 | #if (__HAVE_FLOAT64					\ | |
| 126 | && __GLIBC_USE (IEC_60559_TYPES_EXT)		\ | |
| 127 | && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) | |
| 122 | 128 | # define SNANF64 (__builtin_nansf64 ("")) |
| 123 | 129 | #endif |
| 124 | #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT) | |
| 130 | #if (__HAVE_FLOAT128					\ | |
| 131 | && __GLIBC_USE (IEC_60559_TYPES_EXT)		\ | |
| 132 | && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) | |
| 125 | 133 | # define SNANF128 (__builtin_nansf128 ("")) |
| 126 | 134 | #endif |
| 127 | #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT) | |
| 135 | #if (__HAVE_FLOAT32X					\ | |
| 136 | && __GLIBC_USE (IEC_60559_TYPES_EXT)		\ | |
| 137 | && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) | |
| 128 | 138 | # define SNANF32X (__builtin_nansf32x ("")) |
| 129 | 139 | #endif |
| 130 | #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT) | |
| 140 | #if (__HAVE_FLOAT64X					\ | |
| 141 | && __GLIBC_USE (IEC_60559_TYPES_EXT)		\ | |
| 142 | && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) | |
| 131 | 143 | # define SNANF64X (__builtin_nansf64x ("")) |
| 132 | 144 | #endif |
| 133 | #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT) | |
| 145 | #if (__HAVE_FLOAT128X					\ | |
| 146 | && __GLIBC_USE (IEC_60559_TYPES_EXT)		\ | |
| 147 | && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) | |
| 134 | 148 | # define SNANF128X (__builtin_nansf128x ("")) |
| 135 | 149 | #endif |
| 136 | 150 |
lib/libc/include/generic-glibc/monetary.h+4-2| ... | ... | @@ -37,7 +37,8 @@ __BEGIN_DECLS |
| 37 | 37 | /* Formatting a monetary value according to the current locale. */ |
| 38 | 38 | extern ssize_t strfmon (char *__restrict __s, size_t __maxsize, |
| 39 | 39 | 			const char *__restrict __format, ...) |
| 40 | __THROW __attribute_format_strfmon__ (3, 4); | |
| 40 | __THROW __attribute_format_strfmon__ (3, 4) | |
| 41 | __attr_access ((__write_only__, 1, 2)); | |
| 41 | 42 | |
| 42 | 43 | #ifdef __USE_XOPEN2K8 |
| 43 | 44 | /* POSIX.1-2008 extended locale interface (see locale.h). */ |
| ... | ... | @@ -47,7 +48,8 @@ extern ssize_t strfmon (char *__restrict __s, size_t __maxsize, |
| 47 | 48 | extern ssize_t strfmon_l (char *__restrict __s, size_t __maxsize, |
| 48 | 49 | 			 locale_t __loc, |
| 49 | 50 | 			 const char *__restrict __format, ...) |
| 50 | __THROW __attribute_format_strfmon__ (4, 5); | |
| 51 | __THROW __attribute_format_strfmon__ (4, 5) | |
| 52 | __attr_access ((__write_only__, 1, 2)); | |
| 51 | 53 | #endif |
| 52 | 54 | |
| 53 | 55 | #include <bits/floatn.h> |
lib/libc/include/generic-glibc/mqueue.h+22| ... | ... | @@ -71,6 +71,7 @@ extern int mq_send (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, |
| 71 | 71 | 		 unsigned int __msg_prio) __nonnull ((2)); |
| 72 | 72 | |
| 73 | 73 | #ifdef __USE_XOPEN2K |
| 74 | # ifndef __USE_TIME_BITS64 | |
| 74 | 75 | /* Receive the oldest from highest priority messages in message queue |
| 75 | 76 | MQDES, stop waiting if ABS_TIMEOUT expires. */ |
| 76 | 77 | extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict __msg_ptr, |
| ... | ... | @@ -85,6 +86,27 @@ extern int mq_timedsend (mqd_t __mqdes, const char *__msg_ptr, |
| 85 | 86 | 			 size_t __msg_len, unsigned int __msg_prio, |
| 86 | 87 | 			 const struct timespec *__abs_timeout) |
| 87 | 88 | __nonnull ((2, 5)); |
| 89 | # else | |
| 90 | # ifdef __REDIRECT | |
| 91 | extern int __REDIRECT (mq_timedreceive, (mqd_t __mqdes, | |
| 92 | char *__restrict __msg_ptr, | |
| 93 | size_t __msg_len, | |
| 94 | unsigned int *__restrict __msg_prio, | |
| 95 | const struct timespec *__restrict __abs_timeout), | |
| 96 | __mq_timedreceive_time64) | |
| 97 | __nonnull ((2, 5)); | |
| 98 | ||
| 99 | extern int __REDIRECT (mq_timedsend, (mqd_t __mqdes, | |
| 100 | const char *__msg_ptr, size_t __msg_len, | |
| 101 | unsigned int __msg_prio, | |
| 102 | const struct timespec *__abs_timeout), | |
| 103 | 		 __mq_timedsend_time64) | |
| 104 | __nonnull ((2, 5)); | |
| 105 | # else | |
| 106 | # define mq_timedreceive __mq_timedreceive_time64 | |
| 107 | # define mq_timedsend __mq_timedsend_time64 | |
| 108 | # endif | |
| 109 | # endif | |
| 88 | 110 | #endif |
| 89 | 111 | |
| 90 | 112 | /* Define some inlines helping to catch common problems. */ |
lib/libc/include/generic-glibc/net/if.h+3-1| ... | ... | @@ -191,7 +191,9 @@ __BEGIN_DECLS |
| 191 | 191 | |
| 192 | 192 | /* Convert an interface name to an index, and vice versa. */ |
| 193 | 193 | extern unsigned int if_nametoindex (const char *__ifname) __THROW; |
| 194 | extern char *if_indextoname (unsigned int __ifindex, char *__ifname) __THROW; | |
| 194 | extern char *if_indextoname (unsigned int __ifindex, | |
| 195 | 			 char __ifname[IF_NAMESIZE]) __THROW | |
| 196 | __attr_access ((__write_only__, 2)); | |
| 195 | 197 | |
| 196 | 198 | /* Return a list of all interfaces and their indices. */ |
| 197 | 199 | extern struct if_nameindex *if_nameindex (void) __THROW; |
lib/libc/include/generic-glibc/netdb.h+11| ... | ... | @@ -701,6 +701,17 @@ extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr], |
| 701 | 701 | extern int gai_suspend (const struct gaicb *const __list[], int __ent, |
| 702 | 702 | 			const struct timespec *__timeout); |
| 703 | 703 | |
| 704 | # ifdef __USE_TIME_BITS64 | |
| 705 | # if defined(__REDIRECT) | |
| 706 | extern int __REDIRECT (gai_suspend, (const struct gaicb *const __list[], | |
| 707 | int __ent, | |
| 708 | const struct timespec *__timeout), | |
| 709 | __gai_suspend_time64); | |
| 710 | # else | |
| 711 | # define gai_suspend __gai_suspend_time64 | |
| 712 | # endif | |
| 713 | # endif | |
| 714 | ||
| 704 | 715 | /* Get the error status of the request REQ. */ |
| 705 | 716 | extern int gai_error (struct gaicb *__req) __THROW; |
| 706 | 717 |
lib/libc/include/generic-glibc/netinet/icmp6.h+2| ... | ... | @@ -69,6 +69,8 @@ struct icmp6_hdr |
| 69 | 69 | #define MLD_LISTENER_QUERY 130 |
| 70 | 70 | #define MLD_LISTENER_REPORT 131 |
| 71 | 71 | #define MLD_LISTENER_REDUCTION 132 |
| 72 | #define ICMPV6_EXT_ECHO_REQUEST	 160 | |
| 73 | #define ICMPV6_EXT_ECHO_REPLY	 161 | |
| 72 | 74 | |
| 73 | 75 | #define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */ |
| 74 | 76 | #define ICMP6_DST_UNREACH_ADMIN 1 /* communication with destination */ |
lib/libc/include/generic-glibc/netinet/ip_icmp.h+18| ... | ... | @@ -89,6 +89,24 @@ struct icmphdr |
| 89 | 89 | #define ICMP_EXC_TTL		0	/* TTL count exceeded		*/ |
| 90 | 90 | #define ICMP_EXC_FRAGTIME	1	/* Fragment Reass time exceeded	*/ |
| 91 | 91 | |
| 92 | /* Codes for ICMP_EXT_ECHO (PROBE) */ | |
| 93 | #define ICMP_EXT_ECHO		42 | |
| 94 | #define ICMP_EXT_ECHOREPLY	43 | |
| 95 | #define ICMP_EXT_CODE_MAL_QUERY	1	/* Malformed Query */ | |
| 96 | #define ICMP_EXT_CODE_NO_IF	2	/* No such Interface */ | |
| 97 | #define ICMP_EXT_CODE_NO_TABLE_ENT	3	/* No table entry */ | |
| 98 | #define ICMP_EXT_CODE_MULT_IFS	4	/* Multiple Interfaces Satisfy Query */ | |
| 99 | ||
| 100 | /* Constants for EXT_ECHO (PROBE) */ | |
| 101 | #define ICMP_EXT_ECHOREPLY_ACTIVE	(1 << 2)/* active bit in reply */ | |
| 102 | #define ICMP_EXT_ECHOREPLY_IPV4		(1 << 1)/* ipv4 bit in reply */ | |
| 103 | #define ICMP_EXT_ECHOREPLY_IPV6		1	/* ipv6 bit in reply */ | |
| 104 | #define ICMP_EXT_ECHO_CTYPE_NAME	1 | |
| 105 | #define ICMP_EXT_ECHO_CTYPE_INDEX	2 | |
| 106 | #define ICMP_EXT_ECHO_CTYPE_ADDR	3 | |
| 107 | #define ICMP_AFI_IP			1	/* Address Family Identifier for IPV4 */ | |
| 108 | #define ICMP_AFI_IP6			2	/* Address Family Identifier for IPV6 */ | |
| 109 | ||
| 92 | 110 | |
| 93 | 111 | #ifdef __USE_MISC |
| 94 | 112 | /* |
lib/libc/include/generic-glibc/nss.h+1-1| ... | ... | @@ -196,7 +196,7 @@ typedef enum nss_status nss_setspent (int); |
| 196 | 196 | extern nss_endgrent _nss_##module##_endgrent; \ |
| 197 | 197 | extern nss_endhostent _nss_##module##_endhostent; \ |
| 198 | 198 | extern nss_endnetent _nss_##module##_endnetent; \ |
| 199 | extern nss_endnetgrent _nss_##module##__endnetgrent; \ | |
| 199 | extern nss_endnetgrent _nss_##module##_endnetgrent; \ | |
| 200 | 200 | extern nss_endprotoent _nss_##module##_endprotoent; \ |
| 201 | 201 | extern nss_endpwent _nss_##module##_endpwent; \ |
| 202 | 202 | extern nss_endrpcent _nss_##module##_endrpcent; \ |
lib/libc/include/generic-glibc/pthread.h+157-15| ... | ... | @@ -29,7 +29,9 @@ |
| 29 | 29 | #include <bits/types/struct_timespec.h> |
| 30 | 30 | #include <bits/types/__sigset_t.h> |
| 31 | 31 | #include <bits/types/struct___jmp_buf_tag.h> |
| 32 | ||
| 32 | #ifdef __USE_MISC | |
| 33 | # include <bits/pthread_stack_min-dynamic.h> | |
| 34 | #endif | |
| 33 | 35 | |
| 34 | 36 | /* Detach state. */ |
| 35 | 37 | enum |
| ... | ... | @@ -221,6 +223,7 @@ extern int pthread_join (pthread_t __th, void **__thread_return); |
| 221 | 223 | the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */ |
| 222 | 224 | extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW; |
| 223 | 225 | |
| 226 | # ifndef __USE_TIME_BITS64 | |
| 224 | 227 | /* Make calling thread wait for termination of the thread TH, but only |
| 225 | 228 | until TIMEOUT. The exit status of the thread is stored in |
| 226 | 229 | *THREAD_RETURN, if THREAD_RETURN is not NULL. |
| ... | ... | @@ -240,6 +243,23 @@ extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return, |
| 240 | 243 | extern int pthread_clockjoin_np (pthread_t __th, void **__thread_return, |
| 241 | 244 | clockid_t __clockid, |
| 242 | 245 | 				 const struct timespec *__abstime); |
| 246 | # else | |
| 247 | # ifdef __REDIRECT | |
| 248 | extern int __REDIRECT (pthread_timedjoin_np, | |
| 249 | (pthread_t __th, void **__thread_return, | |
| 250 | const struct timespec *__abstime), | |
| 251 | __pthread_timedjoin_np64); | |
| 252 | ||
| 253 | extern int __REDIRECT (pthread_clockjoin_np, | |
| 254 | (pthread_t __th, void **__thread_return, | |
| 255 | clockid_t __clockid, | |
| 256 | const struct timespec *__abstime), | |
| 257 | __pthread_clockjoin_np64); | |
| 258 | # else | |
| 259 | # define pthread_timedjoin_np __pthread_timedjoin_np64 | |
| 260 | # define pthread_clockjoin_np __pthread_clockjoin_np64 | |
| 261 | # endif | |
| 262 | # endif | |
| 243 | 263 | #endif |
| 244 | 264 | |
| 245 | 265 | /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN. |
| ... | ... | @@ -454,11 +474,14 @@ extern int pthread_setconcurrency (int __level) __THROW; |
| 454 | 474 | #endif |
| 455 | 475 | |
| 456 | 476 | #ifdef __USE_GNU |
| 457 | /* Yield the processor to another thread or process. | |
| 458 | This function is similar to the POSIX `sched_yield' function but | |
| 459 | might be differently implemented in the case of a m-on-n thread | |
| 460 | implementation. */ | |
| 461 | 477 | extern int pthread_yield (void) __THROW; |
| 478 | # ifdef __REDIRECT_NTH | |
| 479 | extern int __REDIRECT_NTH (pthread_yield, (void), sched_yield) | |
| 480 | __attribute_deprecated_msg__ ("\ | |
| 481 | pthread_yield is deprecated, use sched_yield instead"); | |
| 482 | # else | |
| 483 | # define pthread_yield sched_yield | |
| 484 | # endif | |
| 462 | 485 | |
| 463 | 486 | |
| 464 | 487 | /* Limit specified thread TH to run only on the processors represented |
| ... | ... | @@ -773,16 +796,39 @@ extern int pthread_mutex_lock (pthread_mutex_t *__mutex) |
| 773 | 796 | |
| 774 | 797 | #ifdef __USE_XOPEN2K |
| 775 | 798 | /* Wait until lock becomes available, or specified time passes. */ |
| 799 | # ifndef __USE_TIME_BITS64 | |
| 776 | 800 | extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, |
| 777 | 801 | 				 const struct timespec *__restrict |
| 778 | 802 | 				 __abstime) __THROWNL __nonnull ((1, 2)); |
| 803 | # else | |
| 804 | # ifdef __REDIRECT_NTHNL | |
| 805 | extern int __REDIRECT_NTHNL (pthread_mutex_timedlock, | |
| 806 | (pthread_mutex_t *__restrict __mutex, | |
| 807 | const struct timespec *__restrict __abstime), | |
| 808 | __pthread_mutex_timedlock64) __nonnull ((1, 2)); | |
| 809 | # else | |
| 810 | # define pthread_mutex_timedlock __pthread_mutex_timedlock64 | |
| 811 | # endif | |
| 812 | # endif | |
| 779 | 813 | #endif |
| 780 | 814 | |
| 781 | 815 | #ifdef __USE_GNU |
| 816 | # ifndef __USE_TIME_BITS64 | |
| 782 | 817 | extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex, |
| 783 | 818 | 				 clockid_t __clockid, |
| 784 | 819 | 				 const struct timespec *__restrict |
| 785 | 820 | 				 __abstime) __THROWNL __nonnull ((1, 3)); |
| 821 | # else | |
| 822 | # ifdef __REDIRECT_NTHNL | |
| 823 | extern int __REDIRECT_NTHNL (pthread_mutex_clocklock, | |
| 824 | (pthread_mutex_t *__restrict __mutex, | |
| 825 | clockid_t __clockid, | |
| 826 | const struct timespec *__restrict __abstime), | |
| 827 | __pthread_mutex_clocklock64) __nonnull ((1, 3)); | |
| 828 | # else | |
| 829 | # define pthread_mutex_clocklock __pthread_mutex_clocklock64 | |
| 830 | # endif | |
| 831 | # endif | |
| 786 | 832 | #endif |
| 787 | 833 | |
| 788 | 834 | /* Unlock a mutex. */ |
| ... | ... | @@ -809,8 +855,14 @@ extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, |
| 809 | 855 | extern int pthread_mutex_consistent (pthread_mutex_t *__mutex) |
| 810 | 856 | __THROW __nonnull ((1)); |
| 811 | 857 | # ifdef __USE_GNU |
| 812 | extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) | |
| 813 | __THROW __nonnull ((1)); | |
| 858 | # ifdef __REDIRECT_NTH | |
| 859 | extern int __REDIRECT_NTH (pthread_mutex_consistent_np, (pthread_mutex_t *), | |
| 860 | 			 pthread_mutex_consistent) __nonnull ((1)) | |
| 861 | __attribute_deprecated_msg__ ("\ | |
| 862 | pthread_mutex_consistent_np is deprecated, use pthread_mutex_consistent"); | |
| 863 | # else | |
| 864 | # define pthread_mutex_consistent_np pthread_mutex_consistent | |
| 865 | # endif | |
| 814 | 866 | # endif |
| 815 | 867 | #endif |
| 816 | 868 | |
| ... | ... | @@ -879,9 +931,15 @@ extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr, |
| 879 | 931 | 					int *__robustness) |
| 880 | 932 | __THROW __nonnull ((1, 2)); |
| 881 | 933 | # ifdef __USE_GNU |
| 882 | extern int pthread_mutexattr_getrobust_np (const pthread_mutexattr_t *__attr, | |
| 883 | 					 int *__robustness) | |
| 884 | __THROW __nonnull ((1, 2)); | |
| 934 | # ifdef __REDIRECT_NTH | |
| 935 | extern int __REDIRECT_NTH (pthread_mutexattr_getrobust_np, | |
| 936 | 			 (pthread_mutex_t *, int *), | |
| 937 | 			 pthread_mutexattr_getrobust) __nonnull ((1)) | |
| 938 | __attribute_deprecated_msg__ ("\ | |
| 939 | pthread_mutexattr_getrobust_np is deprecated, use pthread_mutexattr_getrobust"); | |
| 940 | # else | |
| 941 | # define pthread_mutexattr_getrobust_np pthread_mutexattr_getrobust | |
| 942 | # endif | |
| 885 | 943 | # endif |
| 886 | 944 | |
| 887 | 945 | /* Set the robustness flag of the mutex attribute ATTR. */ |
| ... | ... | @@ -889,13 +947,18 @@ extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr, |
| 889 | 947 | 					int __robustness) |
| 890 | 948 | __THROW __nonnull ((1)); |
| 891 | 949 | # ifdef __USE_GNU |
| 892 | extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr, | |
| 893 | 					 int __robustness) | |
| 894 | __THROW __nonnull ((1)); | |
| 950 | # ifdef __REDIRECT_NTH | |
| 951 | extern int __REDIRECT_NTH (pthread_mutexattr_setrobust_np, | |
| 952 | 			 (pthread_mutex_t *, int), | |
| 953 | 			 pthread_mutexattr_setrobust) __nonnull ((1)) | |
| 954 | __attribute_deprecated_msg__ ("\ | |
| 955 | pthread_mutexattr_setrobust_np is deprecated, use pthread_mutexattr_setrobust"); | |
| 956 | # else | |
| 957 | # define pthread_mutexattr_setrobust_np pthread_mutexattr_setrobust | |
| 958 | # endif | |
| 895 | 959 | # endif |
| 896 | 960 | #endif |
| 897 | 961 | |
| 898 | ||
| 899 | 962 | #if defined __USE_UNIX98 || defined __USE_XOPEN2K |
| 900 | 963 | /* Functions for handling read-write locks. */ |
| 901 | 964 | |
| ... | ... | @@ -919,16 +982,41 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) |
| 919 | 982 | |
| 920 | 983 | # ifdef __USE_XOPEN2K |
| 921 | 984 | /* Try to acquire read lock for RWLOCK or return after specfied time. */ |
| 985 | # ifndef __USE_TIME_BITS64 | |
| 922 | 986 | extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, |
| 923 | 987 | 				 const struct timespec *__restrict |
| 924 | 988 | 				 __abstime) __THROWNL __nonnull ((1, 2)); |
| 989 | # else | |
| 990 | # ifdef __REDIRECT_NTHNL | |
| 991 | extern int __REDIRECT_NTHNL (pthread_rwlock_timedrdlock, | |
| 992 | (pthread_rwlock_t *__restrict __rwlock, | |
| 993 | const struct timespec *__restrict __abstime), | |
| 994 | __pthread_rwlock_timedrdlock64) | |
| 995 | __nonnull ((1, 2)); | |
| 996 | # else | |
| 997 | # define pthread_rwlock_timedrdlock __pthread_rwlock_timedrdlock64 | |
| 998 | # endif | |
| 999 | # endif | |
| 925 | 1000 | # endif |
| 926 | 1001 | |
| 927 | 1002 | # ifdef __USE_GNU |
| 1003 | # ifndef __USE_TIME_BITS64 | |
| 928 | 1004 | extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock, |
| 929 | 1005 | 				 clockid_t __clockid, |
| 930 | 1006 | 				 const struct timespec *__restrict |
| 931 | 1007 | 				 __abstime) __THROWNL __nonnull ((1, 3)); |
| 1008 | # else | |
| 1009 | # ifdef __REDIRECT_NTHNL | |
| 1010 | extern int __REDIRECT_NTHNL (pthread_rwlock_clockrdlock, | |
| 1011 | (pthread_rwlock_t *__restrict __rwlock, | |
| 1012 | clockid_t __clockid, | |
| 1013 | const struct timespec *__restrict __abstime), | |
| 1014 | __pthread_rwlock_clockrdlock64) | |
| 1015 | __nonnull ((1, 3)); | |
| 1016 | # else | |
| 1017 | # define pthread_rwlock_clockrdlock __pthread_rwlock_clockrdlock64 | |
| 1018 | # endif | |
| 1019 | # endif | |
| 932 | 1020 | # endif |
| 933 | 1021 | |
| 934 | 1022 | /* Acquire write lock for RWLOCK. */ |
| ... | ... | @@ -941,16 +1029,42 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) |
| 941 | 1029 | |
| 942 | 1030 | # ifdef __USE_XOPEN2K |
| 943 | 1031 | /* Try to acquire write lock for RWLOCK or return after specfied time. */ |
| 1032 | # ifndef __USE_TIME_BITS64 | |
| 944 | 1033 | extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, |
| 945 | 1034 | 				 const struct timespec *__restrict |
| 946 | 1035 | 				 __abstime) __THROWNL __nonnull ((1, 2)); |
| 1036 | # else | |
| 1037 | # ifdef __REDIRECT_NTHNL | |
| 1038 | extern int __REDIRECT_NTHNL (pthread_rwlock_timedwrlock, | |
| 1039 | (pthread_rwlock_t *__restrict __rwlock, | |
| 1040 | const struct timespec *__restrict __abstime), | |
| 1041 | __pthread_rwlock_timedwrlock64) | |
| 1042 | __nonnull ((1, 2)); | |
| 1043 | # else | |
| 1044 | # define pthread_rwlock_timedwrlock __pthread_rwlock_timedwrlock64 | |
| 1045 | # endif | |
| 1046 | # endif | |
| 947 | 1047 | # endif |
| 948 | 1048 | |
| 949 | 1049 | # ifdef __USE_GNU |
| 1050 | # ifndef __USE_TIME_BITS64 | |
| 950 | 1051 | extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock, |
| 951 | 1052 | 				 clockid_t __clockid, |
| 952 | 1053 | 				 const struct timespec *__restrict |
| 953 | 1054 | 				 __abstime) __THROWNL __nonnull ((1, 3)); |
| 1055 | ||
| 1056 | # else | |
| 1057 | # ifdef __REDIRECT_NTHNL | |
| 1058 | extern int __REDIRECT_NTHNL (pthread_rwlock_clockwrlock, | |
| 1059 | (pthread_rwlock_t *__restrict __rwlock, | |
| 1060 | clockid_t __clockid, | |
| 1061 | const struct timespec *__restrict __abstime), | |
| 1062 | __pthread_rwlock_clockwrlock64) | |
| 1063 | __nonnull ((1, 3)); | |
| 1064 | # else | |
| 1065 | # define pthread_rwlock_clockwrlock __pthread_rwlock_clockwrlock64 | |
| 1066 | # endif | |
| 1067 | # endif | |
| 954 | 1068 | # endif |
| 955 | 1069 | |
| 956 | 1070 | /* Unlock RWLOCK. */ |
| ... | ... | @@ -1027,10 +1141,23 @@ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, |
| 1027 | 1141 | |
| 1028 | 1142 | This function is a cancellation point and therefore not marked with |
| 1029 | 1143 | __THROW. */ |
| 1144 | # ifndef __USE_TIME_BITS64 | |
| 1030 | 1145 | extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, |
| 1031 | 1146 | 				 pthread_mutex_t *__restrict __mutex, |
| 1032 | 1147 | 				 const struct timespec *__restrict __abstime) |
| 1033 | 1148 | __nonnull ((1, 2, 3)); |
| 1149 | # else | |
| 1150 | # ifdef __REDIRECT | |
| 1151 | extern int __REDIRECT (pthread_cond_timedwait, | |
| 1152 | (pthread_cond_t *__restrict __cond, | |
| 1153 | pthread_mutex_t *__restrict __mutex, | |
| 1154 | const struct timespec *__restrict __abstime), | |
| 1155 | __pthread_cond_timedwait64) | |
| 1156 | __nonnull ((1, 2, 3)); | |
| 1157 | # else | |
| 1158 | # define pthread_cond_timedwait __pthread_cond_timedwait64 | |
| 1159 | # endif | |
| 1160 | # endif | |
| 1034 | 1161 | |
| 1035 | 1162 | # ifdef __USE_GNU |
| 1036 | 1163 | /* Wait for condition variable COND to be signaled or broadcast until |
| ... | ... | @@ -1040,11 +1167,25 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, |
| 1040 | 1167 | |
| 1041 | 1168 | This function is a cancellation point and therefore not marked with |
| 1042 | 1169 | __THROW. */ |
| 1170 | # ifndef __USE_TIME_BITS64 | |
| 1043 | 1171 | extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond, |
| 1044 | 1172 | 				 pthread_mutex_t *__restrict __mutex, |
| 1045 | 1173 | 				 __clockid_t __clock_id, |
| 1046 | 1174 | 				 const struct timespec *__restrict __abstime) |
| 1047 | 1175 | __nonnull ((1, 2, 4)); |
| 1176 | # else | |
| 1177 | # ifdef __REDIRECT | |
| 1178 | extern int __REDIRECT (pthread_cond_clockwait, | |
| 1179 | (pthread_cond_t *__restrict __cond, | |
| 1180 | pthread_mutex_t *__restrict __mutex, | |
| 1181 | __clockid_t __clock_id, | |
| 1182 | const struct timespec *__restrict __abstime), | |
| 1183 | __pthread_cond_clockwait64) | |
| 1184 | __nonnull ((1, 2, 4)); | |
| 1185 | # else | |
| 1186 | # define pthread_cond_clockwait __pthread_cond_clockwait64 | |
| 1187 | # endif | |
| 1188 | # endif | |
| 1048 | 1189 | # endif |
| 1049 | 1190 | |
| 1050 | 1191 | /* Functions for handling condition variable attributes. */ |
| ... | ... | @@ -1165,7 +1306,8 @@ extern void *pthread_getspecific (pthread_key_t __key) __THROW; |
| 1165 | 1306 | |
| 1166 | 1307 | /* Store POINTER in the thread-specific data slot identified by KEY. */ |
| 1167 | 1308 | extern int pthread_setspecific (pthread_key_t __key, |
| 1168 | 				const void *__pointer) __THROW ; | |
| 1309 | 				const void *__pointer) | |
| 1310 | __THROW __attr_access_none (2); | |
| 1169 | 1311 | |
| 1170 | 1312 | |
| 1171 | 1313 | #ifdef __USE_XOPEN2K |
lib/libc/include/generic-glibc/pwd.h+8-4| ... | ... | @@ -139,20 +139,23 @@ extern struct passwd *getpwnam (const char *__name) __nonnull ((1)); |
| 139 | 139 | extern int getpwent_r (struct passwd *__restrict __resultbuf, |
| 140 | 140 | 		 char *__restrict __buffer, size_t __buflen, |
| 141 | 141 | 		 struct passwd **__restrict __result) |
| 142 | 		 __nonnull ((1, 2, 4)); | |
| 142 | __nonnull ((1, 2, 4)) | |
| 143 | __attr_access ((__write_only__, 2, 3)); | |
| 143 | 144 | # endif |
| 144 | 145 | |
| 145 | 146 | extern int getpwuid_r (__uid_t __uid, |
| 146 | 147 | 		 struct passwd *__restrict __resultbuf, |
| 147 | 148 | 		 char *__restrict __buffer, size_t __buflen, |
| 148 | 149 | 		 struct passwd **__restrict __result) |
| 149 | 		 __nonnull ((2, 3, 5)); | |
| 150 | __nonnull ((2, 3, 5)) | |
| 151 | __attr_access ((__write_only__, 3, 4)); | |
| 150 | 152 | |
| 151 | 153 | extern int getpwnam_r (const char *__restrict __name, |
| 152 | 154 | 		 struct passwd *__restrict __resultbuf, |
| 153 | 155 | 		 char *__restrict __buffer, size_t __buflen, |
| 154 | 156 | 		 struct passwd **__restrict __result) |
| 155 | 		 __nonnull ((1, 2, 3, 5)); | |
| 157 | __nonnull ((1, 2, 3, 5)) | |
| 158 | __attr_access ((__write_only__, 3, 4)); | |
| 156 | 159 | |
| 157 | 160 | |
| 158 | 161 | # ifdef	__USE_MISC |
| ... | ... | @@ -167,7 +170,8 @@ extern int fgetpwent_r (FILE *__restrict __stream, |
| 167 | 170 | 			struct passwd *__restrict __resultbuf, |
| 168 | 171 | 			char *__restrict __buffer, size_t __buflen, |
| 169 | 172 | 			struct passwd **__restrict __result) |
| 170 | 			__nonnull ((1, 2, 3, 5)); | |
| 173 | __nonnull ((1, 2, 3, 5)) | |
| 174 | __attr_access ((__write_only__, 3, 4)); | |
| 171 | 175 | # endif |
| 172 | 176 | |
| 173 | 177 | #endif	/* POSIX or reentrant */ |
lib/libc/include/generic-glibc/regex.h+16-7| ... | ... | @@ -536,7 +536,8 @@ extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax); |
| 536 | 536 | 'regcomp', with a malloc'ed value, or set to NULL before calling |
| 537 | 537 | 'regfree'. */ |
| 538 | 538 | extern const char *re_compile_pattern (const char *__pattern, size_t __length, |
| 539 | 				 struct re_pattern_buffer *__buffer); | |
| 539 | 				 struct re_pattern_buffer *__buffer) | |
| 540 | __attr_access ((__read_only__, 1, 2)); | |
| 540 | 541 | |
| 541 | 542 | |
| 542 | 543 | /* Compile a fastmap for the compiled pattern in BUFFER; used to |
| ... | ... | @@ -553,7 +554,8 @@ extern int re_compile_fastmap (struct re_pattern_buffer *__buffer); |
| 553 | 554 | extern regoff_t re_search (struct re_pattern_buffer *__buffer, |
| 554 | 555 | 			 const char *__String, regoff_t __length, |
| 555 | 556 | 			 regoff_t __start, regoff_t __range, |
| 556 | 			 struct re_registers *__regs); | |
| 557 | 			 struct re_registers *__regs) | |
| 558 | __attr_access ((__read_only__, 2, 3)); | |
| 557 | 559 | |
| 558 | 560 | |
| 559 | 561 | /* Like 're_search', but search in the concatenation of STRING1 and |
| ... | ... | @@ -563,14 +565,17 @@ extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer, |
| 563 | 565 | 			 const char *__string2, regoff_t __length2, |
| 564 | 566 | 			 regoff_t __start, regoff_t __range, |
| 565 | 567 | 			 struct re_registers *__regs, |
| 566 | 			 regoff_t __stop); | |
| 568 | 			 regoff_t __stop) | |
| 569 | __attr_access ((__read_only__, 2, 3)) | |
| 570 | __attr_access ((__read_only__, 4, 5)); | |
| 567 | 571 | |
| 568 | 572 | |
| 569 | 573 | /* Like 're_search', but return how many characters in STRING the regexp |
| 570 | 574 | in BUFFER matched, starting at position START. */ |
| 571 | 575 | extern regoff_t re_match (struct re_pattern_buffer *__buffer, |
| 572 | 576 | 			 const char *__String, regoff_t __length, |
| 573 | 			 regoff_t __start, struct re_registers *__regs); | |
| 577 | 			 regoff_t __start, struct re_registers *__regs) | |
| 578 | __attr_access ((__read_only__, 2, 3)); | |
| 574 | 579 | |
| 575 | 580 | |
| 576 | 581 | /* Relates to 're_match' as 're_search_2' relates to 're_search'. */ |
| ... | ... | @@ -578,7 +583,9 @@ extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer, |
| 578 | 583 | 			 const char *__string1, regoff_t __length1, |
| 579 | 584 | 			 const char *__string2, regoff_t __length2, |
| 580 | 585 | 			 regoff_t __start, struct re_registers *__regs, |
| 581 | 			 regoff_t __stop); | |
| 586 | 			 regoff_t __stop) | |
| 587 | __attr_access ((__read_only__, 2, 3)) | |
| 588 | __attr_access ((__read_only__, 4, 5)); | |
| 582 | 589 | |
| 583 | 590 | |
| 584 | 591 | /* Set REGS to hold NUM_REGS registers, storing them in STARTS and |
| ... | ... | @@ -648,10 +655,12 @@ extern int regcomp (regex_t *_Restrict_ __preg, |
| 648 | 655 | extern int regexec (const regex_t *_Restrict_ __preg, |
| 649 | 656 | 		 const char *_Restrict_ __String, size_t __nmatch, |
| 650 | 657 | 		 regmatch_t __pmatch[_Restrict_arr_], |
| 651 | 		 int __eflags); | |
| 658 | 		 int __eflags) | |
| 659 | __attr_access ((__write_only__, 4, 3)); | |
| 652 | 660 | |
| 653 | 661 | extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg, |
| 654 | 			char *_Restrict_ __errbuf, size_t __errbuf_size); | |
| 662 | 			char *_Restrict_ __errbuf, size_t __errbuf_size) | |
| 663 | __attr_access ((__write_only__, 3, 4)); | |
| 655 | 664 | |
| 656 | 665 | extern void regfree (regex_t *__preg); |
| 657 | 666 |
lib/libc/include/generic-glibc/resolv.h+55-48| ... | ... | @@ -168,20 +168,28 @@ __END_DECLS |
| 168 | 168 | #define res_close		__res_close |
| 169 | 169 | #define res_init		__res_init |
| 170 | 170 | #define res_isourserver		__res_isourserver |
| 171 | #define res_mkquery		__res_mkquery | |
| 172 | #define res_query		__res_query | |
| 173 | #define res_querydomain		__res_querydomain | |
| 174 | #define res_search		__res_search | |
| 175 | #define res_send		__res_send | |
| 171 | ||
| 172 | #ifdef _LIBC | |
| 173 | # define __RESOLV_DEPRECATED | |
| 174 | # define __RESOLV_DEPRECATED_MSG(msg) | |
| 175 | #else | |
| 176 | # define __RESOLV_DEPRECATED __attribute_deprecated__ | |
| 177 | # define __RESOLV_DEPRECATED_MSG(msg) __attribute_deprecated_msg__ (msg) | |
| 178 | #endif | |
| 176 | 179 | |
| 177 | 180 | __BEGIN_DECLS |
| 178 | void		fp_nquery (const unsigned char *, int, FILE *) __THROW; | |
| 179 | void		fp_query (const unsigned char *, FILE *) __THROW; | |
| 180 | const char *	hostalias (const char *) __THROW; | |
| 181 | void		p_query (const unsigned char *) __THROW; | |
| 181 | void		fp_nquery (const unsigned char *, int, FILE *) __THROW | |
| 182 | __RESOLV_DEPRECATED; | |
| 183 | void		fp_query (const unsigned char *, FILE *) __THROW | |
| 184 | __RESOLV_DEPRECATED; | |
| 185 | const char *	hostalias (const char *) __THROW | |
| 186 | __RESOLV_DEPRECATED_MSG ("use getaddrinfo instead"); | |
| 187 | void		p_query (const unsigned char *) __THROW | |
| 188 | __RESOLV_DEPRECATED; | |
| 182 | 189 | void		res_close (void) __THROW; |
| 183 | 190 | int		res_init (void) __THROW; |
| 184 | int		res_isourserver (const struct sockaddr_in *) __THROW; | |
| 191 | int		res_isourserver (const struct sockaddr_in *) __THROW | |
| 192 | __RESOLV_DEPRECATED; | |
| 185 | 193 | int		res_mkquery (int, const char *, int, int, |
| 186 | 194 | 			 const unsigned char *, int, const unsigned char *, |
| 187 | 195 | 			 unsigned char *, int) __THROW; |
| ... | ... | @@ -197,10 +205,7 @@ __END_DECLS |
| 197 | 205 | |
| 198 | 206 | #define b64_ntop		__b64_ntop |
| 199 | 207 | #define b64_pton		__b64_pton |
| 200 | #define dn_comp			__dn_comp | |
| 201 | 208 | #define dn_count_labels		__dn_count_labels |
| 202 | #define dn_expand		__dn_expand | |
| 203 | #define dn_skipname		__dn_skipname | |
| 204 | 209 | #define fp_resstat		__fp_resstat |
| 205 | 210 | #define loc_aton		__loc_aton |
| 206 | 211 | #define loc_ntoa		__loc_ntoa |
| ... | ... | @@ -215,19 +220,10 @@ __END_DECLS |
| 215 | 220 | #define p_rcode			__p_rcode |
| 216 | 221 | #define putlong			__putlong |
| 217 | 222 | #define putshort		__putshort |
| 218 | #define res_dnok		__res_dnok | |
| 219 | #define res_hnok		__res_hnok | |
| 220 | 223 | #define res_hostalias		__res_hostalias |
| 221 | #define res_mailok		__res_mailok | |
| 222 | 224 | #define res_nameinquery		__res_nameinquery |
| 223 | 225 | #define res_nclose		__res_nclose |
| 224 | 226 | #define res_ninit		__res_ninit |
| 225 | #define res_nmkquery		__res_nmkquery | |
| 226 | #define res_nquery		__res_nquery | |
| 227 | #define res_nquerydomain	__res_nquerydomain | |
| 228 | #define res_nsearch		__res_nsearch | |
| 229 | #define res_nsend		__res_nsend | |
| 230 | #define res_ownok		__res_ownok | |
| 231 | 227 | #define res_queriesmatch	__res_queriesmatch |
| 232 | 228 | #define res_randomid		__res_randomid |
| 233 | 229 | #define sym_ntop		__sym_ntop |
| ... | ... | @@ -238,50 +234,61 @@ int		res_hnok (const char *) __THROW; |
| 238 | 234 | int		res_ownok (const char *) __THROW; |
| 239 | 235 | int		res_mailok (const char *) __THROW; |
| 240 | 236 | int		res_dnok (const char *) __THROW; |
| 241 | int		sym_ston (const struct res_sym *, const char *, int *) __THROW; | |
| 242 | const char *	sym_ntos (const struct res_sym *, int, int *) __THROW; | |
| 243 | const char *	sym_ntop (const struct res_sym *, int, int *) __THROW; | |
| 237 | int		sym_ston (const struct res_sym *, const char *, int *) __THROW | |
| 238 | __RESOLV_DEPRECATED; | |
| 239 | const char *	sym_ntos (const struct res_sym *, int, int *) __THROW | |
| 240 | __RESOLV_DEPRECATED; | |
| 241 | const char *	sym_ntop (const struct res_sym *, int, int *) __THROW | |
| 242 | __RESOLV_DEPRECATED; | |
| 244 | 243 | int		b64_ntop (const unsigned char *, size_t, char *, size_t) |
| 245 | __THROW; | |
| 244 | __THROW; | |
| 246 | 245 | int		b64_pton (char const *, unsigned char *, size_t) __THROW; |
| 247 | int		loc_aton (const char *__ascii, unsigned char *__binary) __THROW; | |
| 248 | const char *	loc_ntoa (const unsigned char *__binary, char *__ascii) __THROW; | |
| 246 | int		loc_aton (const char *__ascii, unsigned char *__binary) __THROW | |
| 247 | __RESOLV_DEPRECATED; | |
| 248 | const char *	loc_ntoa (const unsigned char *__binary, char *__ascii) __THROW | |
| 249 | __RESOLV_DEPRECATED; | |
| 249 | 250 | int		dn_skipname (const unsigned char *, const unsigned char *) |
| 250 | __THROW; | |
| 251 | void		putlong (uint32_t, unsigned char *) __THROW; | |
| 252 | void		putshort (uint16_t, unsigned char *) __THROW; | |
| 253 | const char *	p_class (int) __THROW; | |
| 254 | const char *	p_time (uint32_t) __THROW; | |
| 255 | const char *	p_type (int) __THROW; | |
| 256 | const char *	p_rcode (int) __THROW; | |
| 257 | const unsigned char * p_cdnname (const unsigned char *, | |
| 258 | 				 const unsigned char *, int, FILE *) __THROW; | |
| 251 | __THROW; | |
| 252 | void		putlong (uint32_t, unsigned char *) __THROW | |
| 253 | __RESOLV_DEPRECATED_MSG ("use NS_PUT16 instead"); | |
| 254 | void		putshort (uint16_t, unsigned char *) __THROW | |
| 255 | __RESOLV_DEPRECATED_MSG ("use NS_PUT32 instead"); | |
| 256 | const char *	p_class (int) __THROW __RESOLV_DEPRECATED; | |
| 257 | const char *	p_time (uint32_t) __THROW __RESOLV_DEPRECATED; | |
| 258 | const char *	p_type (int) __THROW __RESOLV_DEPRECATED; | |
| 259 | const char *	p_rcode (int) __THROW __RESOLV_DEPRECATED; | |
| 260 | const unsigned char * p_cdnname (const unsigned char *, const unsigned char *, | |
| 261 | 				 int, FILE *) __THROW __RESOLV_DEPRECATED; | |
| 259 | 262 | const unsigned char * p_cdname (const unsigned char *, const unsigned char *, |
| 260 | 				FILE *) __THROW; | |
| 263 | 				FILE *) __THROW __RESOLV_DEPRECATED; | |
| 261 | 264 | const unsigned char * p_fqnname (const unsigned char *__cp, |
| 262 | 265 | 				 const unsigned char *__msg, |
| 263 | 				 int, char *, int) __THROW; | |
| 264 | const unsigned char * p_fqname (const unsigned char *, | |
| 265 | 				const unsigned char *, FILE *) __THROW; | |
| 266 | const char *	p_option (unsigned long __option) __THROW; | |
| 267 | int		dn_count_labels (const char *) __THROW; | |
| 266 | 				 int, char *, int) __THROW __RESOLV_DEPRECATED; | |
| 267 | const unsigned char * p_fqname (const unsigned char *, const unsigned char *, | |
| 268 | 				FILE *) __THROW __RESOLV_DEPRECATED; | |
| 269 | const char *	p_option (unsigned long __option) __THROW __RESOLV_DEPRECATED; | |
| 270 | int		dn_count_labels (const char *) __THROW __RESOLV_DEPRECATED; | |
| 268 | 271 | int		dn_comp (const char *, unsigned char *, int, unsigned char **, |
| 269 | 272 | 			 unsigned char **) __THROW; |
| 270 | 273 | int		dn_expand (const unsigned char *, const unsigned char *, |
| 271 | 274 | 			 const unsigned char *, char *, int) __THROW; |
| 272 | unsigned int	res_randomid (void) __THROW; | |
| 275 | unsigned int	res_randomid (void) __THROW | |
| 276 | __RESOLV_DEPRECATED_MSG ("use getentropy instead"); | |
| 273 | 277 | int		res_nameinquery (const char *, int, int, |
| 274 | 278 | 				 const unsigned char *, |
| 275 | 				 const unsigned char *) __THROW; | |
| 279 | 				 const unsigned char *) __THROW | |
| 280 | __RESOLV_DEPRECATED; | |
| 276 | 281 | int		res_queriesmatch (const unsigned char *, |
| 277 | 282 | 				 const unsigned char *, |
| 278 | 283 | 				 const unsigned char *, |
| 279 | 				 const unsigned char *) __THROW; | |
| 284 | 				 const unsigned char *) __THROW | |
| 285 | __RESOLV_DEPRECATED; | |
| 280 | 286 | /* Things involving a resolver context. */ |
| 281 | 287 | int		res_ninit (res_state) __THROW; |
| 282 | void		fp_resstat (const res_state, FILE *) __THROW; | |
| 288 | void		fp_resstat (const res_state, FILE *) __THROW | |
| 289 | __RESOLV_DEPRECATED; | |
| 283 | 290 | const char *	res_hostalias (const res_state, const char *, char *, size_t) |
| 284 | __THROW; | |
| 291 | __THROW __RESOLV_DEPRECATED_MSG ("use getaddrinfo instead"); | |
| 285 | 292 | int		res_nquery (res_state, const char *, int, int, |
| 286 | 293 | 			 unsigned char *, int) __THROW; |
| 287 | 294 | int		res_nsearch (res_state, const char *, int, int, |
lib/libc/include/generic-glibc/sched.h+10-1| ... | ... | @@ -74,8 +74,17 @@ extern int sched_get_priority_max (int __algorithm) __THROW; |
| 74 | 74 | extern int sched_get_priority_min (int __algorithm) __THROW; |
| 75 | 75 | |
| 76 | 76 | /* Get the SCHED_RR interval for the named process. */ |
| 77 | #ifndef __USE_TIME_BITS64 | |
| 77 | 78 | extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW; |
| 78 | ||
| 79 | #else | |
| 80 | # ifdef __REDIRECT_NTH | |
| 81 | extern int __REDIRECT_NTH (sched_rr_get_interval, | |
| 82 | (__pid_t __pid, struct timespec *__t), | |
| 83 | __sched_rr_get_interval64); | |
| 84 | # else | |
| 85 | # define sched_rr_get_interval __sched_rr_get_interval64 | |
| 86 | # endif | |
| 87 | #endif | |
| 79 | 88 | |
| 80 | 89 | #ifdef __USE_GNU |
| 81 | 90 | /* Access macros for `cpu_set'. */ |
lib/libc/include/generic-glibc/semaphore.h+25| ... | ... | @@ -59,16 +59,41 @@ extern int sem_wait (sem_t *__sem) __nonnull ((1)); |
| 59 | 59 | |
| 60 | 60 | This function is a cancellation point and therefore not marked with |
| 61 | 61 | __THROW. */ |
| 62 | # ifndef __USE_TIME_BITS64 | |
| 62 | 63 | extern int sem_timedwait (sem_t *__restrict __sem, |
| 63 | 64 | 			 const struct timespec *__restrict __abstime) |
| 64 | 65 | __nonnull ((1, 2)); |
| 66 | # else | |
| 67 | # ifdef __REDIRECT | |
| 68 | extern int __REDIRECT (sem_timedwait, | |
| 69 | (sem_t *__restrict __sem, | |
| 70 | const struct timespec *__restrict __abstime), | |
| 71 | __sem_timedwait64) | |
| 72 | __nonnull ((1, 2)); | |
| 73 | # else | |
| 74 | # define sem_timedwait __sem_timedwait64 | |
| 75 | # endif | |
| 76 | # endif | |
| 65 | 77 | #endif |
| 66 | 78 | |
| 67 | 79 | #ifdef __USE_GNU |
| 80 | # ifndef __USE_TIME_BITS64 | |
| 68 | 81 | extern int sem_clockwait (sem_t *__restrict __sem, |
| 69 | 82 | 			 clockid_t clock, |
| 70 | 83 | 			 const struct timespec *__restrict __abstime) |
| 71 | 84 | __nonnull ((1, 3)); |
| 85 | # else | |
| 86 | # ifdef __REDIRECT | |
| 87 | extern int __REDIRECT (sem_clockwait, | |
| 88 | (sem_t *__restrict __sem, | |
| 89 | clockid_t clock, | |
| 90 | const struct timespec *__restrict __abstime), | |
| 91 | __sem_clockwait64) | |
| 92 | __nonnull ((1, 3)); | |
| 93 | # else | |
| 94 | # define sem_clockwait __sem_clockwait64 | |
| 95 | # endif | |
| 96 | # endif | |
| 72 | 97 | #endif |
| 73 | 98 | |
| 74 | 99 | /* Test whether SEM is posted. */ |
lib/libc/include/generic-glibc/signal.h+14| ... | ... | @@ -269,10 +269,23 @@ extern int sigwaitinfo (const sigset_t *__restrict __set, |
| 269 | 269 | |
| 270 | 270 | This function is a cancellation point and therefore not marked with |
| 271 | 271 | __THROW. */ |
| 272 | # ifndef __USE_TIME_BITS64 | |
| 272 | 273 | extern int sigtimedwait (const sigset_t *__restrict __set, |
| 273 | 274 | 			 siginfo_t *__restrict __info, |
| 274 | 275 | 			 const struct timespec *__restrict __timeout) |
| 275 | 276 | __nonnull ((1)); |
| 277 | # else | |
| 278 | # ifdef __REDIRECT | |
| 279 | extern int __REDIRECT (sigtimedwait, | |
| 280 | (const sigset_t *__restrict __set, | |
| 281 | siginfo_t *__restrict __info, | |
| 282 | const struct timespec *__restrict __timeout), | |
| 283 | __sigtimedwait64) | |
| 284 | __nonnull ((1)); | |
| 285 | # else | |
| 286 | # define sigtimedwait __sigtimedwait64 | |
| 287 | # endif | |
| 288 | # endif | |
| 276 | 289 | |
| 277 | 290 | /* Send signal SIG to the process PID. Associate data in VAL with the |
| 278 | 291 | signal. */ |
| ... | ... | @@ -312,6 +325,7 @@ extern int siginterrupt (int __sig, int __interrupt) __THROW |
| 312 | 325 | __attribute_deprecated_msg__ ("Use sigaction with SA_RESTART instead"); |
| 313 | 326 | |
| 314 | 327 | # include <bits/sigstack.h> |
| 328 | # include <bits/sigstksz.h> | |
| 315 | 329 | # include <bits/ss_flags.h> |
| 316 | 330 | |
| 317 | 331 | /* Alternate signal handler stack interface. |
lib/libc/include/generic-glibc/spawn.h+8| ... | ... | @@ -213,6 +213,14 @@ extern int posix_spawn_file_actions_addchdir_np (posix_spawn_file_actions_t * |
| 213 | 213 | extern int posix_spawn_file_actions_addfchdir_np (posix_spawn_file_actions_t *, |
| 214 | 214 | 						 int __fd) |
| 215 | 215 | __THROW __nonnull ((1)); |
| 216 | ||
| 217 | /* Add an action to close all file descriptor greater than or equal to FROM | |
| 218 | during spawn. This affects the subsequent file actions. */ | |
| 219 | extern int | |
| 220 | posix_spawn_file_actions_addclosefrom_np (posix_spawn_file_actions_t *, | |
| 221 | 					 int __from) | |
| 222 | __THROW __nonnull ((1)); | |
| 223 | ||
| 216 | 224 | #endif |
| 217 | 225 | |
| 218 | 226 | __END_DECLS |
lib/libc/include/generic-glibc/stdio.h+48-26| ... | ... | @@ -165,31 +165,43 @@ extern int renameat2 (int __oldfd, const char *__old, int __newfd, |
| 165 | 165 | 		 const char *__new, unsigned int __flags) __THROW; |
| 166 | 166 | #endif |
| 167 | 167 | |
| 168 | /* Close STREAM. | |
| 169 | ||
| 170 | This function is a possible cancellation point and therefore not | |
| 171 | marked with __THROW. */ | |
| 172 | extern int fclose (FILE *__stream); | |
| 173 | ||
| 174 | #undef __attr_dealloc_fclose | |
| 175 | #define __attr_dealloc_fclose __attr_dealloc (fclose, 1) | |
| 176 | ||
| 168 | 177 | /* Create a temporary file and open it read/write. |
| 169 | 178 | |
| 170 | 179 | This function is a possible cancellation point and therefore not |
| 171 | 180 | marked with __THROW. */ |
| 172 | 181 | #ifndef __USE_FILE_OFFSET64 |
| 173 | extern FILE *tmpfile (void) __wur; | |
| 182 | extern FILE *tmpfile (void) | |
| 183 | __attribute_malloc__ __attr_dealloc_fclose __wur; | |
| 174 | 184 | #else |
| 175 | 185 | # ifdef __REDIRECT |
| 176 | extern FILE *__REDIRECT (tmpfile, (void), tmpfile64) __wur; | |
| 186 | extern FILE *__REDIRECT (tmpfile, (void), tmpfile64) | |
| 187 | __attribute_malloc__ __attr_dealloc_fclose __wur; | |
| 177 | 188 | # else |
| 178 | 189 | # define tmpfile tmpfile64 |
| 179 | 190 | # endif |
| 180 | 191 | #endif |
| 181 | 192 | |
| 182 | 193 | #ifdef __USE_LARGEFILE64 |
| 183 | extern FILE *tmpfile64 (void) __wur; | |
| 194 | extern FILE *tmpfile64 (void) | |
| 195 | __attribute_malloc__ __attr_dealloc_fclose __wur; | |
| 184 | 196 | #endif |
| 185 | 197 | |
| 186 | 198 | /* Generate a temporary filename. */ |
| 187 | extern char *tmpnam (char *__s) __THROW __wur; | |
| 199 | extern char *tmpnam (char[L_tmpnam]) __THROW __wur; | |
| 188 | 200 | |
| 189 | 201 | #ifdef __USE_MISC |
| 190 | 202 | /* This is the reentrant variant of `tmpnam'. The only difference is |
| 191 | 203 | that it does not allow S to be NULL. */ |
| 192 | extern char *tmpnam_r (char *__s) __THROW __wur; | |
| 204 | extern char *tmpnam_r (char __s[L_tmpnam]) __THROW __wur; | |
| 193 | 205 | #endif |
| 194 | 206 | |
| 195 | 207 | |
| ... | ... | @@ -202,15 +214,9 @@ extern char *tmpnam_r (char *__s) __THROW __wur; |
| 202 | 214 | P_tmpdir is tried and finally "/tmp". The storage for the filename |
| 203 | 215 | is allocated by `malloc'. */ |
| 204 | 216 | extern char *tempnam (const char *__dir, const char *__pfx) |
| 205 | __THROW __attribute_malloc__ __wur; | |
| 217 | __THROW __attribute_malloc__ __wur __attr_dealloc_free; | |
| 206 | 218 | #endif |
| 207 | 219 | |
| 208 | ||
| 209 | /* Close STREAM. | |
| 210 | ||
| 211 | This function is a possible cancellation point and therefore not | |
| 212 | marked with __THROW. */ | |
| 213 | extern int fclose (FILE *__stream); | |
| 214 | 220 | /* Flush STREAM, or all streams if STREAM is NULL. |
| 215 | 221 | |
| 216 | 222 | This function is a possible cancellation point and therefore not |
| ... | ... | @@ -244,7 +250,8 @@ extern int fcloseall (void); |
| 244 | 250 | This function is a possible cancellation point and therefore not |
| 245 | 251 | marked with __THROW. */ |
| 246 | 252 | extern FILE *fopen (const char *__restrict __filename, |
| 247 | 		 const char *__restrict __modes) __wur; | |
| 253 | 		 const char *__restrict __modes) | |
| 254 | __attribute_malloc__ __attr_dealloc_fclose __wur; | |
| 248 | 255 | /* Open a file, replacing an existing stream with it. |
| 249 | 256 | |
| 250 | 257 | This function is a possible cancellation point and therefore not |
| ... | ... | @@ -256,7 +263,7 @@ extern FILE *freopen (const char *__restrict __filename, |
| 256 | 263 | # ifdef __REDIRECT |
| 257 | 264 | extern FILE *__REDIRECT (fopen, (const char *__restrict __filename, |
| 258 | 265 | 				 const char *__restrict __modes), fopen64) |
| 259 | __wur; | |
| 266 | __attribute_malloc__ __attr_dealloc_fclose __wur; | |
| 260 | 267 | extern FILE *__REDIRECT (freopen, (const char *__restrict __filename, |
| 261 | 268 | 				 const char *__restrict __modes, |
| 262 | 269 | 				 FILE *__restrict __stream), freopen64) |
| ... | ... | @@ -268,7 +275,8 @@ extern FILE *__REDIRECT (freopen, (const char *__restrict __filename, |
| 268 | 275 | #endif |
| 269 | 276 | #ifdef __USE_LARGEFILE64 |
| 270 | 277 | extern FILE *fopen64 (const char *__restrict __filename, |
| 271 | 		 const char *__restrict __modes) __wur; | |
| 278 | 		 const char *__restrict __modes) | |
| 279 | __attribute_malloc__ __attr_dealloc_fclose __wur; | |
| 272 | 280 | extern FILE *freopen64 (const char *__restrict __filename, |
| 273 | 281 | 			const char *__restrict __modes, |
| 274 | 282 | 			FILE *__restrict __stream) __wur; |
| ... | ... | @@ -276,7 +284,8 @@ extern FILE *freopen64 (const char *__restrict __filename, |
| 276 | 284 | |
| 277 | 285 | #ifdef	__USE_POSIX |
| 278 | 286 | /* Create a new stream that refers to an existing system file descriptor. */ |
| 279 | extern FILE *fdopen (int __fd, const char *__modes) __THROW __wur; | |
| 287 | extern FILE *fdopen (int __fd, const char *__modes) __THROW | |
| 288 | __attribute_malloc__ __attr_dealloc_fclose __wur; | |
| 280 | 289 | #endif |
| 281 | 290 | |
| 282 | 291 | #ifdef	__USE_GNU |
| ... | ... | @@ -284,21 +293,30 @@ extern FILE *fdopen (int __fd, const char *__modes) __THROW __wur; |
| 284 | 293 | and uses the given functions for input and output. */ |
| 285 | 294 | extern FILE *fopencookie (void *__restrict __magic_cookie, |
| 286 | 295 | 			 const char *__restrict __modes, |
| 287 | 			 cookie_io_functions_t __io_funcs) __THROW __wur; | |
| 296 | 			 cookie_io_functions_t __io_funcs) __THROW | |
| 297 | __attribute_malloc__ __attr_dealloc_fclose __wur; | |
| 288 | 298 | #endif |
| 289 | 299 | |
| 290 | 300 | #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) |
| 291 | 301 | /* Create a new stream that refers to a memory buffer. */ |
| 292 | 302 | extern FILE *fmemopen (void *__s, size_t __len, const char *__modes) |
| 293 | __THROW __wur; | |
| 303 | __THROW __attribute_malloc__ __attr_dealloc_fclose __wur; | |
| 294 | 304 | |
| 295 | 305 | /* Open a stream that writes into a malloc'd buffer that is expanded as |
| 296 | 306 | necessary. *BUFLOC and *SIZELOC are updated with the buffer's location |
| 297 | 307 | and the number of characters written on fflush or fclose. */ |
| 298 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW __wur; | |
| 308 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW | |
| 309 | __attribute_malloc__ __attr_dealloc_fclose __wur; | |
| 310 | ||
| 311 | #ifdef _WCHAR_H | |
| 312 | /* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces | |
| 313 | a wide character string. Declared here only to add attribute malloc | |
| 314 | and only if <wchar.h> has been previously #included. */ | |
| 315 | extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW | |
| 316 | __attribute_malloc__ __attr_dealloc_fclose; | |
| 317 | # endif | |
| 299 | 318 | #endif |
| 300 | 319 | |
| 301 | ||
| 302 | 320 | /* If BUF is NULL, make STREAM unbuffered. |
| 303 | 321 | Else make it use buffer BUF, of size BUFSIZ. */ |
| 304 | 322 | extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __THROW; |
| ... | ... | @@ -792,29 +810,33 @@ extern int fileno_unlocked (FILE *__stream) __THROW __wur; |
| 792 | 810 | |
| 793 | 811 | |
| 794 | 812 | #ifdef __USE_POSIX2 |
| 795 | /* Create a new stream connected to a pipe running the given command. | |
| 813 | /* Close a stream opened by popen and return the status of its child. | |
| 796 | 814 | |
| 797 | 815 | This function is a possible cancellation point and therefore not |
| 798 | 816 | marked with __THROW. */ |
| 799 | extern FILE *popen (const char *__command, const char *__modes) __wur; | |
| 817 | extern int pclose (FILE *__stream); | |
| 800 | 818 | |
| 801 | /* Close a stream opened by popen and return the status of its child. | |
| 819 | /* Create a new stream connected to a pipe running the given command. | |
| 802 | 820 | |
| 803 | 821 | This function is a possible cancellation point and therefore not |
| 804 | 822 | marked with __THROW. */ |
| 805 | extern int pclose (FILE *__stream); | |
| 823 | extern FILE *popen (const char *__command, const char *__modes) | |
| 824 | __attribute_malloc__ __attr_dealloc (pclose, 1) __wur; | |
| 825 | ||
| 806 | 826 | #endif |
| 807 | 827 | |
| 808 | 828 | |
| 809 | 829 | #ifdef	__USE_POSIX |
| 810 | 830 | /* Return the name of the controlling terminal. */ |
| 811 | extern char *ctermid (char *__s) __THROW; | |
| 831 | extern char *ctermid (char *__s) __THROW | |
| 832 | __attr_access ((__write_only__, 1)); | |
| 812 | 833 | #endif /* Use POSIX. */ |
| 813 | 834 | |
| 814 | 835 | |
| 815 | 836 | #if (defined __USE_XOPEN && !defined __USE_XOPEN2K) || defined __USE_GNU |
| 816 | 837 | /* Return the name of the current user. */ |
| 817 | extern char *cuserid (char *__s); | |
| 838 | extern char *cuserid (char *__s) | |
| 839 | __attr_access ((__write_only__, 1)); | |
| 818 | 840 | #endif /* Use X/Open, but not issue 6. */ |
| 819 | 841 | |
| 820 | 842 |
lib/libc/include/generic-glibc/stdlib.h+11-5| ... | ... | @@ -550,6 +550,9 @@ extern void *calloc (size_t __nmemb, size_t __size) |
| 550 | 550 | extern void *realloc (void *__ptr, size_t __size) |
| 551 | 551 | __THROW __attribute_warn_unused_result__ __attribute_alloc_size__ ((2)); |
| 552 | 552 | |
| 553 | /* Free a block allocated by `malloc', `realloc' or `calloc'. */ | |
| 554 | extern void free (void *__ptr) __THROW; | |
| 555 | ||
| 553 | 556 | #ifdef __USE_MISC |
| 554 | 557 | /* Re-allocate the previously allocated block in PTR, making the new |
| 555 | 558 | block large enough for NMEMB elements of SIZE bytes each. */ |
| ... | ... | @@ -558,11 +561,13 @@ extern void *realloc (void *__ptr, size_t __size) |
| 558 | 561 | between objects pointed by the old and new pointers. */ |
| 559 | 562 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) |
| 560 | 563 | __THROW __attribute_warn_unused_result__ |
| 561 | __attribute_alloc_size__ ((2, 3)); | |
| 562 | #endif | |
| 564 | __attribute_alloc_size__ ((2, 3)) | |
| 565 | __attr_dealloc_free; | |
| 563 | 566 | |
| 564 | /* Free a block allocated by `malloc', `realloc' or `calloc'. */ | |
| 565 | extern void free (void *__ptr) __THROW; | |
| 567 | /* Add reallocarray as its own deallocator. */ | |
| 568 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | |
| 569 | __THROW __attr_dealloc (reallocarray, 1); | |
| 570 | #endif | |
| 566 | 571 | |
| 567 | 572 | #ifdef __USE_MISC |
| 568 | 573 | # include <alloca.h> |
| ... | ... | @@ -788,7 +793,8 @@ extern int system (const char *__command) __wur; |
| 788 | 793 | /* Return a malloc'd string containing the canonical absolute name of the |
| 789 | 794 | existing named file. */ |
| 790 | 795 | extern char *canonicalize_file_name (const char *__name) |
| 791 | __THROW __nonnull ((1)) __wur; | |
| 796 | __THROW __nonnull ((1)) __attribute_malloc__ | |
| 797 | __attr_dealloc_free __wur; | |
| 792 | 798 | #endif |
| 793 | 799 | |
| 794 | 800 | #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED |
lib/libc/include/generic-glibc/sys/cdefs.h+113-58| ... | ... | @@ -34,7 +34,29 @@ |
| 34 | 34 | #undef	__P |
| 35 | 35 | #undef	__PMT |
| 36 | 36 | |
| 37 | #ifdef __GNUC__ | |
| 37 | /* Compilers that lack __has_attribute may object to | |
| 38 | #if defined __has_attribute && __has_attribute (...) | |
| 39 | even though they do not need to evaluate the right-hand side of the &&. | |
| 40 | Similarly for __has_builtin, etc. */ | |
| 41 | #if (defined __has_attribute \ | |
| 42 | && (!defined __clang_minor__ \ | |
| 43 | || 3 < __clang_major__ + (5 <= __clang_minor__))) | |
| 44 | # define __glibc_has_attribute(attr) __has_attribute (attr) | |
| 45 | #else | |
| 46 | # define __glibc_has_attribute(attr) 0 | |
| 47 | #endif | |
| 48 | #ifdef __has_builtin | |
| 49 | # define __glibc_has_builtin(name) __has_builtin (name) | |
| 50 | #else | |
| 51 | # define __glibc_has_builtin(name) 0 | |
| 52 | #endif | |
| 53 | #ifdef __has_extension | |
| 54 | # define __glibc_has_extension(ext) __has_extension (ext) | |
| 55 | #else | |
| 56 | # define __glibc_has_extension(ext) 0 | |
| 57 | #endif | |
| 58 | ||
| 59 | #if defined __GNUC__ || defined __clang__ | |
| 38 | 60 | |
| 39 | 61 | /* All functions, except those with callbacks or those that |
| 40 | 62 | synchronize memory, are leaf functions. */ |
| ... | ... | @@ -48,16 +70,17 @@ |
| 48 | 70 | |
| 49 | 71 | /* GCC can always grok prototypes. For C++ programs we add throw() |
| 50 | 72 | to help it optimize the function calls. But this only works with |
| 51 | gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions | |
| 73 | gcc 2.8.x and egcs. For gcc 3.4 and up we even mark C functions | |
| 52 | 74 | as non-throwing using a function attribute since programs can use |
| 53 | 75 | the -fexceptions options for C code as well. */ |
| 54 | # if !defined __cplusplus && __GNUC_PREREQ (3, 3) | |
| 76 | # if !defined __cplusplus \ | |
| 77 | && (__GNUC_PREREQ (3, 4) || __glibc_has_attribute (__nothrow__)) | |
| 55 | 78 | # define __THROW	__attribute__ ((__nothrow__ __LEAF)) |
| 56 | 79 | # define __THROWNL	__attribute__ ((__nothrow__)) |
| 57 | 80 | # define __NTH(fct)	__attribute__ ((__nothrow__ __LEAF)) fct |
| 58 | 81 | # define __NTHNL(fct) __attribute__ ((__nothrow__)) fct |
| 59 | 82 | # else |
| 60 | # if defined __cplusplus && __GNUC_PREREQ (2,8) | |
| 83 | # if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4) | |
| 61 | 84 | # if __cplusplus >= 201103L |
| 62 | 85 | # define __THROW	noexcept (true) |
| 63 | 86 | # else |
| ... | ... | @@ -74,7 +97,7 @@ |
| 74 | 97 | # endif |
| 75 | 98 | # endif |
| 76 | 99 | |
| 77 | #else	/* Not GCC. */ | |
| 100 | #else	/* Not GCC or clang. */ | |
| 78 | 101 | |
| 79 | 102 | # if (defined __cplusplus						\ |
| 80 | 103 | || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) |
| ... | ... | @@ -87,16 +110,7 @@ |
| 87 | 110 | # define __THROWNL |
| 88 | 111 | # define __NTH(fct)	fct |
| 89 | 112 | |
| 90 | #endif	/* GCC. */ | |
| 91 | ||
| 92 | /* Compilers that are not clang may object to | |
| 93 | #if defined __clang__ && __has_extension(...) | |
| 94 | even though they do not need to evaluate the right-hand side of the &&. */ | |
| 95 | #if defined __clang__ && defined __has_extension | |
| 96 | # define __glibc_clang_has_extension(ext) __has_extension (ext) | |
| 97 | #else | |
| 98 | # define __glibc_clang_has_extension(ext) 0 | |
| 99 | #endif | |
| 113 | #endif	/* GCC || clang. */ | |
| 100 | 114 | |
| 101 | 115 | /* These two macros are not used in glibc anymore. They are kept here |
| 102 | 116 | only because some other projects expect the macros to be defined. */ |
| ... | ... | @@ -149,11 +163,11 @@ |
| 149 | 163 | Headers that should use flexible arrays only if they're "real" |
| 150 | 164 | (e.g. only if they won't affect sizeof()) should test |
| 151 | 165 | #if __glibc_c99_flexarr_available. */ |
| 152 | #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L | |
| 166 | #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc | |
| 153 | 167 | # define __flexarr	[] |
| 154 | 168 | # define __glibc_c99_flexarr_available 1 |
| 155 | #elif __GNUC_PREREQ (2,97) | |
| 156 | /* GCC 2.97 supports C99 flexible array members as an extension, | |
| 169 | #elif __GNUC_PREREQ (2,97) || defined __clang__ | |
| 170 | /* GCC 2.97 and clang support C99 flexible array members as an extension, | |
| 157 | 171 | even when in C89 mode or compiling C++ (any version). */ |
| 158 | 172 | # define __flexarr	[] |
| 159 | 173 | # define __glibc_c99_flexarr_available 1 |
| ... | ... | @@ -179,7 +193,7 @@ |
| 179 | 193 | Example: |
| 180 | 194 | int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ |
| 181 | 195 | |
| 182 | #if defined __GNUC__ && __GNUC__ >= 2 | |
| 196 | #if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4) | |
| 183 | 197 | |
| 184 | 198 | # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) |
| 185 | 199 | # ifdef __cplusplus |
| ... | ... | @@ -204,17 +218,17 @@ |
| 204 | 218 | */ |
| 205 | 219 | #endif |
| 206 | 220 | |
| 207 | /* GCC has various useful declarations that can be made with the | |
| 208 | `__attribute__' syntax. All of the ways we use this do fine if | |
| 209 | they are omitted for compilers that don't understand it. */ | |
| 210 | #if !defined __GNUC__ || __GNUC__ < 2 | |
| 221 | /* GCC and clang have various useful declarations that can be made with | |
| 222 | the '__attribute__' syntax. All of the ways we use this do fine if | |
| 223 | they are omitted for compilers that don't understand it. */ | |
| 224 | #if !(defined __GNUC__ || defined __clang__) | |
| 211 | 225 | # define __attribute__(xyz)	/* Ignore */ |
| 212 | 226 | #endif |
| 213 | 227 | |
| 214 | 228 | /* At some point during the gcc 2.96 development the `malloc' attribute |
| 215 | 229 | for functions was introduced. We don't want to use it unconditionally |
| 216 | 230 | (although this would be possible) since it generates warnings. */ |
| 217 | #if __GNUC_PREREQ (2,96) | |
| 231 | #if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__malloc__) | |
| 218 | 232 | # define __attribute_malloc__ __attribute__ ((__malloc__)) |
| 219 | 233 | #else |
| 220 | 234 | # define __attribute_malloc__ /* Ignore */ |
| ... | ... | @@ -232,23 +246,29 @@ |
| 232 | 246 | /* At some point during the gcc 2.96 development the `pure' attribute |
| 233 | 247 | for functions was introduced. We don't want to use it unconditionally |
| 234 | 248 | (although this would be possible) since it generates warnings. */ |
| 235 | #if __GNUC_PREREQ (2,96) | |
| 249 | #if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__pure__) | |
| 236 | 250 | # define __attribute_pure__ __attribute__ ((__pure__)) |
| 237 | 251 | #else |
| 238 | 252 | # define __attribute_pure__ /* Ignore */ |
| 239 | 253 | #endif |
| 240 | 254 | |
| 241 | 255 | /* This declaration tells the compiler that the value is constant. */ |
| 242 | #if __GNUC_PREREQ (2,5) | |
| 256 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__) | |
| 243 | 257 | # define __attribute_const__ __attribute__ ((__const__)) |
| 244 | 258 | #else |
| 245 | 259 | # define __attribute_const__ /* Ignore */ |
| 246 | 260 | #endif |
| 247 | 261 | |
| 262 | #if __GNUC_PREREQ (2,7) || __glibc_has_attribute (__unused__) | |
| 263 | # define __attribute_maybe_unused__ __attribute__ ((__unused__)) | |
| 264 | #else | |
| 265 | # define __attribute_maybe_unused__ /* Ignore */ | |
| 266 | #endif | |
| 267 | ||
| 248 | 268 | /* At some point during the gcc 3.1 development the `used' attribute |
| 249 | 269 | for functions was introduced. We don't want to use it unconditionally |
| 250 | 270 | (although this would be possible) since it generates warnings. */ |
| 251 | #if __GNUC_PREREQ (3,1) | |
| 271 | #if __GNUC_PREREQ (3,1) || __glibc_has_attribute (__used__) | |
| 252 | 272 | # define __attribute_used__ __attribute__ ((__used__)) |
| 253 | 273 | # define __attribute_noinline__ __attribute__ ((__noinline__)) |
| 254 | 274 | #else |
| ... | ... | @@ -257,7 +277,7 @@ |
| 257 | 277 | #endif |
| 258 | 278 | |
| 259 | 279 | /* Since version 3.2, gcc allows marking deprecated functions. */ |
| 260 | #if __GNUC_PREREQ (3,2) | |
| 280 | #if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__deprecated__) | |
| 261 | 281 | # define __attribute_deprecated__ __attribute__ ((__deprecated__)) |
| 262 | 282 | #else |
| 263 | 283 | # define __attribute_deprecated__ /* Ignore */ |
| ... | ... | @@ -267,7 +287,7 @@ |
| 267 | 287 | when a deprecated function is used. clang claims to be gcc 4.2, but |
| 268 | 288 | may also support this feature. */ |
| 269 | 289 | #if __GNUC_PREREQ (4,5) \ |
| 270 | || __glibc_clang_has_extension (__attribute_deprecated_with_message__) | |
| 290 | || __glibc_has_extension (__attribute_deprecated_with_message__) | |
| 271 | 291 | # define __attribute_deprecated_msg__(msg) \ |
| 272 | 292 | 	 __attribute__ ((__deprecated__ (msg))) |
| 273 | 293 | #else |
| ... | ... | @@ -280,7 +300,7 @@ |
| 280 | 300 | If several `format_arg' attributes are given for the same function, in |
| 281 | 301 | gcc-3.0 and older, all but the last one are ignored. In newer gccs, |
| 282 | 302 | all designated arguments are considered. */ |
| 283 | #if __GNUC_PREREQ (2,8) | |
| 303 | #if __GNUC_PREREQ (2,8) || __glibc_has_attribute (__format_arg__) | |
| 284 | 304 | # define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) |
| 285 | 305 | #else |
| 286 | 306 | # define __attribute_format_arg__(x) /* Ignore */ |
| ... | ... | @@ -290,27 +310,42 @@ |
| 290 | 310 | attribute for functions was introduced. We don't want to use it |
| 291 | 311 | unconditionally (although this would be possible) since it |
| 292 | 312 | generates warnings. */ |
| 293 | #if __GNUC_PREREQ (2,97) | |
| 313 | #if __GNUC_PREREQ (2,97) || __glibc_has_attribute (__format__) | |
| 294 | 314 | # define __attribute_format_strfmon__(a,b) \ |
| 295 | 315 | __attribute__ ((__format__ (__strfmon__, a, b))) |
| 296 | 316 | #else |
| 297 | 317 | # define __attribute_format_strfmon__(a,b) /* Ignore */ |
| 298 | 318 | #endif |
| 299 | 319 | |
| 300 | /* The nonull function attribute allows to mark pointer parameters which | |
| 320 | /* The nonnull function attribute marks pointer parameters that | |
| 301 | 321 | must not be NULL. */ |
| 302 | #if __GNUC_PREREQ (3,3) | |
| 303 | # define __nonnull(params) __attribute__ ((__nonnull__ params)) | |
| 304 | #else | |
| 305 | # define __nonnull(params) | |
| 322 | #ifndef __nonnull | |
| 323 | # if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__) | |
| 324 | # define __nonnull(params) __attribute__ ((__nonnull__ params)) | |
| 325 | # else | |
| 326 | # define __nonnull(params) | |
| 327 | # endif | |
| 328 | #elif !defined __GLIBC__ | |
| 329 | # undef __nonnull | |
| 330 | # define __nonnull(params) _GL_ATTRIBUTE_NONNULL (params) | |
| 331 | #endif | |
| 332 | ||
| 333 | /* The returns_nonnull function attribute marks the return type of the function | |
| 334 | as always being non-null. */ | |
| 335 | #ifndef __returns_nonnull | |
| 336 | # if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__returns_nonnull__) | |
| 337 | # define __returns_nonnull __attribute__ ((__returns_nonnull__)) | |
| 338 | # else | |
| 339 | # define __returns_nonnull | |
| 340 | # endif | |
| 306 | 341 | #endif |
| 307 | 342 | |
| 308 | 343 | /* If fortification mode, we warn about unused results of certain |
| 309 | 344 | function calls which can lead to problems. */ |
| 310 | #if __GNUC_PREREQ (3,4) | |
| 345 | #if __GNUC_PREREQ (3,4) || __glibc_has_attribute (__warn_unused_result__) | |
| 311 | 346 | # define __attribute_warn_unused_result__ \ |
| 312 | 347 | __attribute__ ((__warn_unused_result__)) |
| 313 | # if __USE_FORTIFY_LEVEL > 0 | |
| 348 | # if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0 | |
| 314 | 349 | # define __wur __attribute_warn_unused_result__ |
| 315 | 350 | # endif |
| 316 | 351 | #else |
| ... | ... | @@ -321,7 +356,7 @@ |
| 321 | 356 | #endif |
| 322 | 357 | |
| 323 | 358 | /* Forces a function to be always inlined. */ |
| 324 | #if __GNUC_PREREQ (3,2) | |
| 359 | #if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__always_inline__) | |
| 325 | 360 | /* The Linux kernel defines __always_inline in stddef.h (283d7573), and |
| 326 | 361 | it conflicts with this definition. Therefore undefine it first to |
| 327 | 362 | allow either header to be included first. */ |
| ... | ... | @@ -334,7 +369,7 @@ |
| 334 | 369 | |
| 335 | 370 | /* Associate error messages with the source location of the call site rather |
| 336 | 371 | than with the source location inside the function. */ |
| 337 | #if __GNUC_PREREQ (4,3) | |
| 372 | #if __GNUC_PREREQ (4,3) || __glibc_has_attribute (__artificial__) | |
| 338 | 373 | # define __attribute_artificial__ __attribute__ ((__artificial__)) |
| 339 | 374 | #else |
| 340 | 375 | # define __attribute_artificial__ /* Ignore */ |
| ... | ... | @@ -377,12 +412,14 @@ |
| 377 | 412 | run in pedantic mode if the uses are carefully marked using the |
| 378 | 413 | `__extension__' keyword. But this is not generally available before |
| 379 | 414 | version 2.8. */ |
| 380 | #if !__GNUC_PREREQ (2,8) | |
| 415 | #if !(__GNUC_PREREQ (2,8) || defined __clang__) | |
| 381 | 416 | # define __extension__		/* Ignore */ |
| 382 | 417 | #endif |
| 383 | 418 | |
| 384 | /* __restrict is known in EGCS 1.2 and above. */ | |
| 385 | #if !__GNUC_PREREQ (2,92) | |
| 419 | /* __restrict is known in EGCS 1.2 and above, and in clang. | |
| 420 | It works also in C++ mode (outside of arrays), but only when spelled | |
| 421 | as '__restrict', not 'restrict'. */ | |
| 422 | #if !(__GNUC_PREREQ (2,92) || __clang_major__ >= 3) | |
| 386 | 423 | # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L |
| 387 | 424 | # define __restrict	restrict |
| 388 | 425 | # else |
| ... | ... | @@ -392,8 +429,9 @@ |
| 392 | 429 | |
| 393 | 430 | /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is |
| 394 | 431 | array_name[restrict] |
| 395 | GCC 3.1 supports this. */ | |
| 396 | #if __GNUC_PREREQ (3,1) && !defined __GNUG__ | |
| 432 | GCC 3.1 and clang support this. | |
| 433 | This syntax is not usable in C++ mode. */ | |
| 434 | #if (__GNUC_PREREQ (3,1) || __clang_major__ >= 3) && !defined __cplusplus | |
| 397 | 435 | # define __restrict_arr	__restrict |
| 398 | 436 | #else |
| 399 | 437 | # ifdef __GNUC__ |
| ... | ... | @@ -408,7 +446,7 @@ |
| 408 | 446 | # endif |
| 409 | 447 | #endif |
| 410 | 448 | |
| 411 | #if __GNUC__ >= 3 | |
| 449 | #if (__GNUC__ >= 3) || __glibc_has_builtin (__builtin_expect) | |
| 412 | 450 | # define __glibc_unlikely(cond)	__builtin_expect ((cond), 0) |
| 413 | 451 | # define __glibc_likely(cond)	__builtin_expect ((cond), 1) |
| 414 | 452 | #else |
| ... | ... | @@ -416,15 +454,10 @@ |
| 416 | 454 | # define __glibc_likely(cond)	(cond) |
| 417 | 455 | #endif |
| 418 | 456 | |
| 419 | #ifdef __has_attribute | |
| 420 | # define __glibc_has_attribute(attr)	__has_attribute (attr) | |
| 421 | #else | |
| 422 | # define __glibc_has_attribute(attr)	0 | |
| 423 | #endif | |
| 424 | ||
| 425 | 457 | #if (!defined _Noreturn \ |
| 426 | 458 | && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ |
| 427 | && !__GNUC_PREREQ (4,7)) | |
| 459 | && !(__GNUC_PREREQ (4,7) \ | |
| 460 | || (3 < __clang_major__ + (5 <= __clang_minor__)))) | |
| 428 | 461 | # if __GNUC_PREREQ (2,8) |
| 429 | 462 | # define _Noreturn __attribute__ ((__noreturn__)) |
| 430 | 463 | # else |
| ... | ... | @@ -453,14 +486,19 @@ |
| 453 | 486 | |
| 454 | 487 | #if (!defined _Static_assert && !defined __cplusplus \ |
| 455 | 488 | && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ |
| 456 | && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__)) | |
| 489 | && (!(__GNUC_PREREQ (4, 6) || __clang_major__ >= 4) \ | |
| 490 | || defined __STRICT_ANSI__)) | |
| 457 | 491 | # define _Static_assert(expr, diagnostic) \ |
| 458 | 492 | extern int (*__Static_assert_function (void)) \ |
| 459 | 493 | [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] |
| 460 | 494 | #endif |
| 461 | 495 | |
| 462 | #include <bits/wordsize.h> | |
| 463 | #include <bits/long-double.h> | |
| 496 | /* The #ifndef lets Gnulib avoid including these on non-glibc | |
| 497 | platforms, where the includes typically do not exist. */ | |
| 498 | #ifdef __GLIBC__ | |
| 499 | # include <bits/wordsize.h> | |
| 500 | # include <bits/long-double.h> | |
| 501 | #endif | |
| 464 | 502 | |
| 465 | 503 | #if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 |
| 466 | 504 | # ifdef __REDIRECT |
| ... | ... | @@ -550,7 +588,7 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf |
| 550 | 588 | check is required to enable the use of generic selection. */ |
| 551 | 589 | #if !defined __cplusplus \ |
| 552 | 590 | && (__GNUC_PREREQ (4, 9) \ |
| 553 | 	|| __glibc_clang_has_extension (c_generic_selections) \ | |
| 591 | 	|| __glibc_has_extension (c_generic_selections) \ | |
| 554 | 592 | 	|| (!defined __GNUC__ && defined __STDC_VERSION__ \ |
| 555 | 593 | 	 && __STDC_VERSION__ >= 201112L)) |
| 556 | 594 | # define __HAVE_GENERIC_SELECTION 1 |
| ... | ... | @@ -564,9 +602,26 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf |
| 564 | 602 | array according to access mode, or at least one element when |
| 565 | 603 | size-index is not provided: |
| 566 | 604 | access (access-mode, <ref-index> [, <size-index>]) */ |
| 567 | #define __attr_access(x) __attribute__ ((__access__ x)) | |
| 605 | # define __attr_access(x) __attribute__ ((__access__ x)) | |
| 606 | # if __GNUC_PREREQ (11, 0) | |
| 607 | # define __attr_access_none(argno) __attribute__ ((__access__ (__none__, argno))) | |
| 608 | # else | |
| 609 | # define __attr_access_none(argno) | |
| 610 | # endif | |
| 568 | 611 | #else |
| 569 | 612 | # define __attr_access(x) |
| 613 | # define __attr_access_none(argno) | |
| 614 | #endif | |
| 615 | ||
| 616 | #if __GNUC_PREREQ (11, 0) | |
| 617 | /* Designates dealloc as a function to call to deallocate objects | |
| 618 | allocated by the declared function. */ | |
| 619 | # define __attr_dealloc(dealloc, argno) \ | |
| 620 | __attribute__ ((__malloc__ (dealloc, argno))) | |
| 621 | # define __attr_dealloc_free __attr_dealloc (__builtin_free, 1) | |
| 622 | #else | |
| 623 | # define __attr_dealloc(dealloc, argno) | |
| 624 | # define __attr_dealloc_free | |
| 570 | 625 | #endif |
| 571 | 626 | |
| 572 | 627 | /* Specify that a function such as setjmp or vfork may return |
lib/libc/include/generic-glibc/sys/ioctl.h+10| ... | ... | @@ -38,7 +38,17 @@ __BEGIN_DECLS |
| 38 | 38 | /* Perform the I/O control operation specified by REQUEST on FD. |
| 39 | 39 | One argument may follow; its presence and type depend on REQUEST. |
| 40 | 40 | Return value depends on REQUEST. Usually -1 indicates error. */ |
| 41 | #ifndef __USE_TIME_BITS64 | |
| 41 | 42 | extern int ioctl (int __fd, unsigned long int __request, ...) __THROW; |
| 43 | #else | |
| 44 | # ifdef __REDIRECT | |
| 45 | extern int __REDIRECT (ioctl, (int __fd, unsigned long int __request, ...), | |
| 46 | 		 __ioctl_time64) __THROW; | |
| 47 | # else | |
| 48 | extern int __ioctl_time64 (int __fd, unsigned long int __request, ...) __THROW; | |
| 49 | # define ioctl __ioctl_time64 | |
| 50 | # endif | |
| 51 | #endif | |
| 42 | 52 | |
| 43 | 53 | __END_DECLS |
| 44 | 54 |
lib/libc/include/generic-glibc/sys/mount.h+2| ... | ... | @@ -48,6 +48,8 @@ enum |
| 48 | 48 | #define MS_MANDLOCK	MS_MANDLOCK |
| 49 | 49 | MS_DIRSYNC = 128,		/* Directory modifications are synchronous. */ |
| 50 | 50 | #define MS_DIRSYNC	MS_DIRSYNC |
| 51 | MS_NOSYMFOLLOW = 256,		/* Do not follow symlinks. */ | |
| 52 | #define MS_NOSYMFOLLOW	MS_NOSYMFOLLOW | |
| 51 | 53 | MS_NOATIME = 1024,		/* Do not update access times. */ |
| 52 | 54 | #define MS_NOATIME	MS_NOATIME |
| 53 | 55 | MS_NODIRATIME = 2048,		/* Do not update directory access times. */ |
lib/libc/include/generic-glibc/sys/msg.h+10| ... | ... | @@ -58,7 +58,17 @@ struct msgbuf |
| 58 | 58 | __BEGIN_DECLS |
| 59 | 59 | |
| 60 | 60 | /* Message queue control operation. */ |
| 61 | #ifndef __USE_TIME_BITS64 | |
| 61 | 62 | extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW; |
| 63 | #else | |
| 64 | # ifdef __REDIRECT_NTH | |
| 65 | extern int __REDIRECT_NTH (msgctl, | |
| 66 | (int __msqid, int __cmd, struct msqid_ds *__buf), | |
| 67 | __msgctl64); | |
| 68 | # else | |
| 69 | # define msgctl __msgctl64 | |
| 70 | # endif | |
| 71 | #endif | |
| 62 | 72 | |
| 63 | 73 | /* Get messages queue. */ |
| 64 | 74 | extern int msgget (key_t __key, int __msgflg) __THROW; |
lib/libc/include/generic-glibc/sys/platform/x86.h+7-7| ... | ... | @@ -30,7 +30,7 @@ extern const struct cpuid_feature *__x86_get_cpuid_feature_leaf (unsigned int) |
| 30 | 30 | __attribute__ ((pure)); |
| 31 | 31 | |
| 32 | 32 | static __inline__ _Bool |
| 33 | x86_cpu_has_feature (unsigned int __index) | |
| 33 | x86_cpu_present (unsigned int __index) | |
| 34 | 34 | { |
| 35 | 35 | const struct cpuid_feature *__ptr = __x86_get_cpuid_feature_leaf |
| 36 | 36 | (__index / (8 * sizeof (unsigned int) * 4)); |
| ... | ... | @@ -43,7 +43,7 @@ x86_cpu_has_feature (unsigned int __index) |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | static __inline__ _Bool |
| 46 | x86_cpu_is_usable (unsigned int __index) | |
| 46 | x86_cpu_active (unsigned int __index) | |
| 47 | 47 | { |
| 48 | 48 | const struct cpuid_feature *__ptr = __x86_get_cpuid_feature_leaf |
| 49 | 49 | (__index / (8 * sizeof (unsigned int) * 4)); |
| ... | ... | @@ -52,13 +52,13 @@ x86_cpu_is_usable (unsigned int __index) |
| 52 | 52 | unsigned int __bit = __reg & (8 * sizeof (unsigned int) - 1); |
| 53 | 53 | __reg /= 8 * sizeof (unsigned int); |
| 54 | 54 | |
| 55 | return __ptr->usable_array[__reg] & (1 << __bit); | |
| 55 | return __ptr->active_array[__reg] & (1 << __bit); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | /* HAS_CPU_FEATURE evaluates to true if CPU supports the feature. */ | |
| 59 | #define HAS_CPU_FEATURE(name) x86_cpu_has_feature (x86_cpu_##name) | |
| 60 | /* CPU_FEATURE_USABLE evaluates to true if the feature is usable. */ | |
| 61 | #define CPU_FEATURE_USABLE(name) x86_cpu_is_usable (x86_cpu_##name) | |
| 58 | /* CPU_FEATURE_PRESENT evaluates to true if CPU supports the feature. */ | |
| 59 | #define CPU_FEATURE_PRESENT(name) x86_cpu_present (x86_cpu_##name) | |
| 60 | /* CPU_FEATURE_ACTIVE evaluates to true if the feature is active. */ | |
| 61 | #define CPU_FEATURE_ACTIVE(name) x86_cpu_active (x86_cpu_##name) | |
| 62 | 62 | |
| 63 | 63 | __END_DECLS |
| 64 | 64 |
lib/libc/include/generic-glibc/sys/poll.h+16-2| ... | ... | @@ -51,7 +51,8 @@ __BEGIN_DECLS |
| 51 | 51 | |
| 52 | 52 | This function is a cancellation point and therefore not marked with |
| 53 | 53 | __THROW. */ |
| 54 | extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout); | |
| 54 | extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout) | |
| 55 | __attr_access ((__write_only__, 1, 2)); | |
| 55 | 56 | |
| 56 | 57 | #ifdef __USE_GNU |
| 57 | 58 | /* Like poll, but before waiting the threads signal mask is replaced |
| ... | ... | @@ -62,7 +63,20 @@ extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout); |
| 62 | 63 | __THROW. */ |
| 63 | 64 | extern int ppoll (struct pollfd *__fds, nfds_t __nfds, |
| 64 | 65 | 		 const struct timespec *__timeout, |
| 65 | 		 const __sigset_t *__ss); | |
| 66 | 		 const __sigset_t *__ss) | |
| 67 | __attr_access ((__write_only__, 1, 2)); | |
| 68 | ||
| 69 | # ifdef __USE_TIME_BITS64 | |
| 70 | # ifdef __REDIRECT | |
| 71 | extern int __REDIRECT (ppoll, (struct pollfd *__fds, nfds_t __nfds, | |
| 72 | const struct timespec *__timeout, | |
| 73 | const __sigset_t *__ss), | |
| 74 | __ppoll64) | |
| 75 | __attr_access ((__write_only__, 1, 2)); | |
| 76 | # else | |
| 77 | # define ppoll __ppoll64 | |
| 78 | # endif | |
| 79 | # endif | |
| 66 | 80 | #endif |
| 67 | 81 | |
| 68 | 82 | __END_DECLS |
lib/libc/include/generic-glibc/sys/prctl.h+10-4| ... | ... | @@ -25,10 +25,6 @@ |
| 25 | 25 | we're picking up... */ |
| 26 | 26 | |
| 27 | 27 | /* Memory tagging control operations (for AArch64). */ |
| 28 | #ifndef PR_TAGGED_ADDR_ENABLE | |
| 29 | # define PR_TAGGED_ADDR_ENABLE	(1UL << 8) | |
| 30 | #endif | |
| 31 | ||
| 32 | 28 | #ifndef PR_MTE_TCF_SHIFT |
| 33 | 29 | # define PR_MTE_TCF_SHIFT	1 |
| 34 | 30 | # define PR_MTE_TCF_NONE	(0UL << PR_MTE_TCF_SHIFT) |
| ... | ... | @@ -42,7 +38,17 @@ |
| 42 | 38 | __BEGIN_DECLS |
| 43 | 39 | |
| 44 | 40 | /* Control process execution. */ |
| 41 | #ifndef __USE_TIME_BITS64 | |
| 45 | 42 | extern int prctl (int __option, ...) __THROW; |
| 43 | #else | |
| 44 | # ifdef __REDIRECT | |
| 45 | extern int __REDIRECT (prctl, (int __option, ...), __prctl_time64) __THROW; | |
| 46 | # else | |
| 47 | extern int __prctl_time64 (int __option,d ...) __THROW; | |
| 48 | # define ioctl __prctl_time64 | |
| 49 | # endif | |
| 50 | #endif | |
| 51 | ||
| 46 | 52 | |
| 47 | 53 | __END_DECLS |
| 48 | 54 |
lib/libc/include/generic-glibc/sys/resource.h+18-6| ... | ... | @@ -48,18 +48,19 @@ typedef int __priority_which_t; |
| 48 | 48 | Returns 0 if successful, -1 if not (and sets errno). */ |
| 49 | 49 | #ifndef __USE_FILE_OFFSET64 |
| 50 | 50 | extern int getrlimit (__rlimit_resource_t __resource, |
| 51 | 		 struct rlimit *__rlimits) __THROW; | |
| 51 | 		 struct rlimit *__rlimits) __THROW __nonnull ((2)); | |
| 52 | 52 | #else |
| 53 | 53 | # ifdef __REDIRECT_NTH |
| 54 | 54 | extern int __REDIRECT_NTH (getrlimit, (__rlimit_resource_t __resource, |
| 55 | 				 struct rlimit *__rlimits), getrlimit64); | |
| 55 | 				 struct rlimit *__rlimits), getrlimit64) | |
| 56 | 				 __nonnull ((2)); | |
| 56 | 57 | # else |
| 57 | 58 | # define getrlimit getrlimit64 |
| 58 | 59 | # endif |
| 59 | 60 | #endif |
| 60 | 61 | #ifdef __USE_LARGEFILE64 |
| 61 | 62 | extern int getrlimit64 (__rlimit_resource_t __resource, |
| 62 | 			struct rlimit64 *__rlimits) __THROW; | |
| 63 | 			struct rlimit64 *__rlimits) __THROW __nonnull ((2)); | |
| 63 | 64 | #endif |
| 64 | 65 | |
| 65 | 66 | /* Set the soft and hard limits for RESOURCE to *RLIMITS. |
| ... | ... | @@ -67,25 +68,36 @@ extern int getrlimit64 (__rlimit_resource_t __resource, |
| 67 | 68 | Return 0 if successful, -1 if not (and sets errno). */ |
| 68 | 69 | #ifndef __USE_FILE_OFFSET64 |
| 69 | 70 | extern int setrlimit (__rlimit_resource_t __resource, |
| 70 | 		 const struct rlimit *__rlimits) __THROW; | |
| 71 | 		 const struct rlimit *__rlimits) __THROW __nonnull ((2)); | |
| 71 | 72 | #else |
| 72 | 73 | # ifdef __REDIRECT_NTH |
| 73 | 74 | extern int __REDIRECT_NTH (setrlimit, (__rlimit_resource_t __resource, |
| 74 | 75 | 				 const struct rlimit *__rlimits), |
| 75 | 			 setrlimit64); | |
| 76 | 			 setrlimit64) __nonnull ((2)); | |
| 76 | 77 | # else |
| 77 | 78 | # define setrlimit setrlimit64 |
| 78 | 79 | # endif |
| 79 | 80 | #endif |
| 80 | 81 | #ifdef __USE_LARGEFILE64 |
| 81 | 82 | extern int setrlimit64 (__rlimit_resource_t __resource, |
| 82 | 			const struct rlimit64 *__rlimits) __THROW; | |
| 83 | 			const struct rlimit64 *__rlimits) __THROW | |
| 84 | 			__nonnull ((2)); | |
| 83 | 85 | #endif |
| 84 | 86 | |
| 85 | 87 | /* Return resource usage information on process indicated by WHO |
| 86 | 88 | and put it in *USAGE. Returns 0 for success, -1 for failure. */ |
| 87 | 89 | extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW; |
| 88 | 90 | |
| 91 | #ifdef __USE_TIME_BITS64 | |
| 92 | # if defined(__REDIRECT_NTH) | |
| 93 | extern int __REDIRECT_NTH (getrusage, (__rusage_who_t __who, | |
| 94 | struct rusage *__usage), | |
| 95 | __getrusage64); | |
| 96 | # else | |
| 97 | # define getrusage __getrusage64 | |
| 98 | # endif | |
| 99 | #endif | |
| 100 | ||
| 89 | 101 | /* Return the highest priority of any process specified by WHICH and WHO |
| 90 | 102 | (see above); if WHO is zero, the current process, process group, or user |
| 91 | 103 | (as specified by WHO) is used. A lower priority number means higher |
lib/libc/include/generic-glibc/sys/select.h+27| ... | ... | @@ -98,10 +98,23 @@ __BEGIN_DECLS |
| 98 | 98 | |
| 99 | 99 | This function is a cancellation point and therefore not marked with |
| 100 | 100 | __THROW. */ |
| 101 | #ifndef __USE_TIME_BITS64 | |
| 101 | 102 | extern int select (int __nfds, fd_set *__restrict __readfds, |
| 102 | 103 | 		 fd_set *__restrict __writefds, |
| 103 | 104 | 		 fd_set *__restrict __exceptfds, |
| 104 | 105 | 		 struct timeval *__restrict __timeout); |
| 106 | #else | |
| 107 | # ifdef __REDIRECT | |
| 108 | extern int __REDIRECT (select, | |
| 109 | (int __nfds, fd_set *__restrict __readfds, | |
| 110 | fd_set *__restrict __writefds, | |
| 111 | fd_set *__restrict __exceptfds, | |
| 112 | struct timeval *__restrict __timeout), | |
| 113 | __select64); | |
| 114 | # else | |
| 115 | # define select __select64 | |
| 116 | # endif | |
| 117 | #endif | |
| 105 | 118 | |
| 106 | 119 | #ifdef __USE_XOPEN2K |
| 107 | 120 | /* Same as above only that the TIMEOUT value is given with higher |
| ... | ... | @@ -110,11 +123,25 @@ extern int select (int __nfds, fd_set *__restrict __readfds, |
| 110 | 123 | |
| 111 | 124 | This function is a cancellation point and therefore not marked with |
| 112 | 125 | __THROW. */ |
| 126 | # ifndef __USE_TIME_BITS64 | |
| 113 | 127 | extern int pselect (int __nfds, fd_set *__restrict __readfds, |
| 114 | 128 | 		 fd_set *__restrict __writefds, |
| 115 | 129 | 		 fd_set *__restrict __exceptfds, |
| 116 | 130 | 		 const struct timespec *__restrict __timeout, |
| 117 | 131 | 		 const __sigset_t *__restrict __sigmask); |
| 132 | # else | |
| 133 | # ifdef __REDIRECT | |
| 134 | extern int __REDIRECT (pselect, | |
| 135 | (int __nfds, fd_set *__restrict __readfds, | |
| 136 | fd_set *__restrict __writefds, | |
| 137 | fd_set *__restrict __exceptfds, | |
| 138 | const struct timespec *__restrict __timeout, | |
| 139 | const __sigset_t *__restrict __sigmask), | |
| 140 | __pselect64); | |
| 141 | # else | |
| 142 | # define pselect __pselect64 | |
| 143 | # endif | |
| 144 | # endif | |
| 118 | 145 | #endif |
| 119 | 146 | |
| 120 | 147 |
lib/libc/include/generic-glibc/sys/sem.h+21| ... | ... | @@ -48,7 +48,17 @@ struct sembuf |
| 48 | 48 | __BEGIN_DECLS |
| 49 | 49 | |
| 50 | 50 | /* Semaphore control operation. */ |
| 51 | #ifndef __USE_TIME_BITS64 | |
| 51 | 52 | extern int semctl (int __semid, int __semnum, int __cmd, ...) __THROW; |
| 53 | #else | |
| 54 | # ifdef __REDIRECT_NTH | |
| 55 | extern int __REDIRECT_NTH (semctl, | |
| 56 | (int __semid, int __semnum, int __cmd, ...), | |
| 57 | __semctl64); | |
| 58 | # else | |
| 59 | # define semctl __semctl64 | |
| 60 | # endif | |
| 61 | #endif | |
| 52 | 62 | |
| 53 | 63 | /* Get semaphore. */ |
| 54 | 64 | extern int semget (key_t __key, int __nsems, int __semflg) __THROW; |
| ... | ... | @@ -58,8 +68,19 @@ extern int semop (int __semid, struct sembuf *__sops, size_t __nsops) __THROW; |
| 58 | 68 | |
| 59 | 69 | #ifdef __USE_GNU |
| 60 | 70 | /* Operate on semaphore with timeout. */ |
| 71 | # ifndef __USE_TIME_BITS64 | |
| 61 | 72 | extern int semtimedop (int __semid, struct sembuf *__sops, size_t __nsops, |
| 62 | 73 | 		 const struct timespec *__timeout) __THROW; |
| 74 | # else | |
| 75 | # ifdef __REDIRECT_NTH | |
| 76 | extern int __REDIRECT_NTH (semtimedop, (int __semid, struct sembuf *__sops, | |
| 77 | size_t __nsops, | |
| 78 | const struct timespec *__timeout), | |
| 79 | __semtimedop64); | |
| 80 | # else | |
| 81 | # define semtimedop __semtimedop64 | |
| 82 | # endif | |
| 83 | # endif | |
| 63 | 84 | #endif |
| 64 | 85 | |
| 65 | 86 | __END_DECLS |
lib/libc/include/generic-glibc/sys/shm.h+10| ... | ... | @@ -46,7 +46,17 @@ __BEGIN_DECLS |
| 46 | 46 | facility. The definition is found in XPG4.2. */ |
| 47 | 47 | |
| 48 | 48 | /* Shared memory control operation. */ |
| 49 | #ifndef __USE_TIME_BITS64 | |
| 49 | 50 | extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW; |
| 51 | #else | |
| 52 | # ifdef __REDIRECT_NTH | |
| 53 | extern int __REDIRECT_NTH (shmctl, | |
| 54 | (int __shmid, int __cmd, struct shmid_ds *__buf), | |
| 55 | __shmctl64); | |
| 56 | # else | |
| 57 | # define shmctl __shmctl64 | |
| 58 | # endif | |
| 59 | #endif | |
| 50 | 60 | |
| 51 | 61 | /* Get shared memory segment. */ |
| 52 | 62 | extern int shmget (key_t __key, size_t __size, int __shmflg) __THROW; |
lib/libc/include/generic-glibc/sys/socket.h+75-1| ... | ... | @@ -170,8 +170,20 @@ extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n, |
| 170 | 170 | |
| 171 | 171 | This function is a cancellation point and therefore not marked with |
| 172 | 172 | __THROW. */ |
| 173 | #ifndef __USE_TIME_BITS64 | |
| 173 | 174 | extern ssize_t sendmsg (int __fd, const struct msghdr *__message, |
| 174 | 175 | 			int __flags); |
| 176 | #else | |
| 177 | # ifdef __REDIRECT | |
| 178 | extern ssize_t __REDIRECT (sendmsg, (int __fd, const struct msghdr *__message, | |
| 179 | 				 int __flags), | |
| 180 | 			 __sendmsg64); | |
| 181 | # else | |
| 182 | extern ssize_t __sendmsg64 (int __fd, const struct msghdr *__message, | |
| 183 | 			 int __flags); | |
| 184 | # defien sendmsg __sendmsg64 | |
| 185 | # endif | |
| 186 | #endif | |
| 175 | 187 | |
| 176 | 188 | #ifdef __USE_GNU |
| 177 | 189 | /* Send a VLEN messages as described by VMESSAGES to socket FD. |
| ... | ... | @@ -179,16 +191,39 @@ extern ssize_t sendmsg (int __fd, const struct msghdr *__message, |
| 179 | 191 | |
| 180 | 192 | This function is a cancellation point and therefore not marked with |
| 181 | 193 | __THROW. */ |
| 194 | # ifndef __USE_TIME_BITS64 | |
| 182 | 195 | extern int sendmmsg (int __fd, struct mmsghdr *__vmessages, |
| 183 | 196 | 		 unsigned int __vlen, int __flags); |
| 184 | #endif | |
| 197 | # else | |
| 198 | # ifdef __REDIRECT | |
| 199 | extern int __REDIRECT (sendmmsg, (int __fd, struct mmsghdr *__vmessages, | |
| 200 | 				 unsigned int __vlen, int __flags), | |
| 201 | 		 __sendmmsg64); | |
| 202 | # else | |
| 203 | extern int __sendmmsg64 (int __fd, struct mmsghdr *__vmessages, | |
| 204 | 			 unsigned int __vlen, int __flags); | |
| 205 | # define sendmmsg __sendmmsg64 | |
| 206 | # endif | |
| 207 | # endif	 /* __USE_TIME_BITS64 */ | |
| 208 | #endif /* __USE_GNU */ | |
| 185 | 209 | |
| 186 | 210 | /* Receive a message as described by MESSAGE from socket FD. |
| 187 | 211 | Returns the number of bytes read or -1 for errors. |
| 188 | 212 | |
| 189 | 213 | This function is a cancellation point and therefore not marked with |
| 190 | 214 | __THROW. */ |
| 215 | #ifndef __USE_TIME_BITS64 | |
| 191 | 216 | extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags); |
| 217 | #else | |
| 218 | # ifdef __REDIRECT | |
| 219 | extern ssize_t __REDIRECT (recvmsg, | |
| 220 | 			 (int __fd, struct msghdr *__message, int __flags), | |
| 221 | 			 __recvmsg64); | |
| 222 | # else | |
| 223 | extern ssize_t __recvmsg64 (int __fd, struct msghdr *__message, int __flags); | |
| 224 | # define recvmsg __recvmsg64 | |
| 225 | # endif | |
| 226 | #endif | |
| 192 | 227 | |
| 193 | 228 | #ifdef __USE_GNU |
| 194 | 229 | /* Receive up to VLEN messages as described by VMESSAGES from socket FD. |
| ... | ... | @@ -196,24 +231,63 @@ extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags); |
| 196 | 231 | |
| 197 | 232 | This function is a cancellation point and therefore not marked with |
| 198 | 233 | __THROW. */ |
| 234 | # ifndef __USE_TIME_BITS64 | |
| 199 | 235 | extern int recvmmsg (int __fd, struct mmsghdr *__vmessages, |
| 200 | 236 | 		 unsigned int __vlen, int __flags, |
| 201 | 237 | 		 struct timespec *__tmo); |
| 238 | # else | |
| 239 | # ifdef __REDIRECT | |
| 240 | extern int __REDIRECT (recvmmsg, (int __fd, struct mmsghdr *__vmessages, | |
| 241 | unsigned int __vlen, int __flags, | |
| 242 | struct timespec *__tmo), | |
| 243 | __recvmmsg64); | |
| 244 | # else | |
| 245 | # define recvmmsg __recvmmsg64 | |
| 246 | # endif | |
| 247 | # endif | |
| 202 | 248 | #endif |
| 203 | 249 | |
| 204 | 250 | |
| 205 | 251 | /* Put the current value for socket FD's option OPTNAME at protocol level LEVEL |
| 206 | 252 | into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's |
| 207 | 253 | actual length. Returns 0 on success, -1 for errors. */ |
| 254 | #ifndef __USE_TIME_BITS64 | |
| 208 | 255 | extern int getsockopt (int __fd, int __level, int __optname, |
| 209 | 256 | 		 void *__restrict __optval, |
| 210 | 257 | 		 socklen_t *__restrict __optlen) __THROW; |
| 258 | #else | |
| 259 | # ifdef __REDIRECT | |
| 260 | extern int __REDIRECT_NTH (getsockopt, | |
| 261 | 			 (int __fd, int __level, int __optname, | |
| 262 | 			 void *__restrict __optval, | |
| 263 | 			 socklen_t *__restrict __optlen), | |
| 264 | 			 __getsockopt64); | |
| 265 | # else | |
| 266 | extern int __getsockopt64 (int __fd, int __level, int __optname, | |
| 267 | 			 void *__restrict __optval, | |
| 268 | 			 socklen_t *__restrict __optlen) __THROW; | |
| 269 | # define getsockopt __getsockopt64 | |
| 270 | # endif | |
| 271 | #endif | |
| 211 | 272 | |
| 212 | 273 | /* Set socket FD's option OPTNAME at protocol level LEVEL |
| 213 | 274 | to *OPTVAL (which is OPTLEN bytes long). |
| 214 | 275 | Returns 0 on success, -1 for errors. */ |
| 276 | #ifndef __USE_TIME_BITS64 | |
| 215 | 277 | extern int setsockopt (int __fd, int __level, int __optname, |
| 216 | 278 | 		 const void *__optval, socklen_t __optlen) __THROW; |
| 279 | #else | |
| 280 | # ifdef __REDIRECT | |
| 281 | extern int __REDIRECT_NTH (setsockopt, | |
| 282 | 			 (int __fd, int __level, int __optname, | |
| 283 | 			 const void *__optval, socklen_t __optlen), | |
| 284 | 			 __setsockopt64); | |
| 285 | # else | |
| 286 | extern int __setsockopt64 (int __fd, int __level, int __optname, | |
| 287 | 			 const void *__optval, socklen_t __optlen) __THROW; | |
| 288 | # define setsockopt __setsockopt64 | |
| 289 | # endif | |
| 290 | #endif | |
| 217 | 291 | |
| 218 | 292 | |
| 219 | 293 | /* Prepare to accept connections on socket FD. |
lib/libc/include/generic-glibc/sys/stat.h+103-10| ... | ... | @@ -209,21 +209,51 @@ extern int stat (const char *__restrict __file, |
| 209 | 209 | that file descriptor FD is open on and put them in BUF. */ |
| 210 | 210 | extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2)); |
| 211 | 211 | #else |
| 212 | # ifdef __REDIRECT_NTH | |
| 212 | # ifdef __USE_TIME_BITS64 | |
| 213 | # ifdef __REDIRECT_NTH | |
| 214 | extern int __REDIRECT_NTH (stat, (const char *__restrict __file, | |
| 215 | 				 struct stat *__restrict __buf), | |
| 216 | 				 __stat64_time64) | |
| 217 | __nonnull ((1, 2)); | |
| 218 | extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), | |
| 219 | 				 __fstat64_time64) | |
| 220 | __nonnull ((2)); | |
| 221 | # else | |
| 222 | # define stat __stat64_time64 | |
| 223 | # define fstat __fstat64_time64 | |
| 224 | # endif | |
| 225 | # else | |
| 226 | # ifdef __REDIRECT_NTH | |
| 213 | 227 | extern int __REDIRECT_NTH (stat, (const char *__restrict __file, |
| 214 | 228 | 				 struct stat *__restrict __buf), stat64) |
| 215 | 229 | __nonnull ((1, 2)); |
| 216 | 230 | extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64) |
| 217 | 231 | __nonnull ((2)); |
| 218 | # else | |
| 219 | # define stat stat64 | |
| 220 | # define fstat fstat64 | |
| 232 | # else | |
| 233 | # define stat stat64 | |
| 234 | # define fstat fstat64 | |
| 235 | # endif | |
| 221 | 236 | # endif |
| 222 | 237 | #endif |
| 223 | 238 | #ifdef __USE_LARGEFILE64 |
| 239 | # ifndef __USE_TIME_BITS64 | |
| 224 | 240 | extern int stat64 (const char *__restrict __file, |
| 225 | 241 | 		 struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); |
| 226 | 242 | extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2)); |
| 243 | # else | |
| 244 | # ifdef __REDIRECT_NTH | |
| 245 | extern int __REDIRECT_NTH (stat64, (const char *__restrict __file, | |
| 246 | 				 struct stat64 *__restrict __buf), | |
| 247 | 			 __stat64_time64) | |
| 248 | __nonnull ((1, 2)); | |
| 249 | extern int __REDIRECT_NTH (fstat64, (int __fd, struct stat64 *__buf), | |
| 250 | 			 __fstat64_time64) | |
| 251 | __nonnull ((2)); | |
| 252 | # else | |
| 253 | # define stat64 __stat64_time64 | |
| 254 | # define fstat64 __fstat64_time | |
| 255 | # endif | |
| 256 | # endif | |
| 227 | 257 | #endif |
| 228 | 258 | |
| 229 | 259 | #ifdef __USE_ATFILE |
| ... | ... | @@ -235,20 +265,44 @@ extern int fstatat (int __fd, const char *__restrict __file, |
| 235 | 265 | 		 struct stat *__restrict __buf, int __flag) |
| 236 | 266 | __THROW __nonnull ((2, 3)); |
| 237 | 267 | # else |
| 238 | # ifdef __REDIRECT_NTH | |
| 268 | # ifdef __USE_TIME_BITS64 | |
| 269 | # ifdef __REDIRECT_NTH | |
| 239 | 270 | extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, |
| 240 | 271 | 				 struct stat *__restrict __buf, |
| 241 | 272 | 				 int __flag), |
| 242 | 			 fstatat64) __nonnull ((2, 3)); | |
| 273 | 			 __fstatat64_time64) __nonnull ((2, 3)); | |
| 274 | # else | |
| 275 | # define fstatat __fstatat64_time64 | |
| 276 | # endif | |
| 243 | 277 | # else |
| 244 | # define fstatat fstatat64 | |
| 278 | # ifdef __REDIRECT_NTH | |
| 279 | extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, | |
| 280 | 				 struct stat *__restrict __buf, | |
| 281 | 				 int __flag), | |
| 282 | 			 fstatat64) __nonnull ((2, 3)); | |
| 283 | # else | |
| 284 | # define fstatat fstatat64 | |
| 285 | # endif | |
| 245 | 286 | # endif |
| 246 | 287 | # endif |
| 247 | 288 | |
| 248 | 289 | # ifdef __USE_LARGEFILE64 |
| 290 | # ifndef __USE_TIME_BITS64 | |
| 249 | 291 | extern int fstatat64 (int __fd, const char *__restrict __file, |
| 250 | 292 | 		 struct stat64 *__restrict __buf, int __flag) |
| 251 | 293 | __THROW __nonnull ((2, 3)); |
| 294 | # else | |
| 295 | # ifdef __REDIRECT_NTH | |
| 296 | extern int __REDIRECT_NTH (fstatat64, (int __fd, | |
| 297 | 				 const char *__restrict __file, | |
| 298 | 				 struct stat64 *__restrict __buf, | |
| 299 | 				 int __flag), | |
| 300 | 			 __fstatat64_time64) | |
| 301 | __nonnull ((2, 3)); | |
| 302 | # else | |
| 303 | # define fstatat64 __fstatat64_time64 | |
| 304 | # endif | |
| 305 | # endif | |
| 252 | 306 | # endif |
| 253 | 307 | #endif |
| 254 | 308 | |
| ... | ... | @@ -259,19 +313,37 @@ extern int fstatat64 (int __fd, const char *__restrict __file, |
| 259 | 313 | extern int lstat (const char *__restrict __file, |
| 260 | 314 | 		 struct stat *__restrict __buf) __THROW __nonnull ((1, 2)); |
| 261 | 315 | # else |
| 262 | # ifdef __REDIRECT_NTH | |
| 316 | # ifdef __USE_TIME_BITS64 | |
| 317 | # ifdef __REDIRECT_NTH | |
| 263 | 318 | extern int __REDIRECT_NTH (lstat, |
| 264 | 319 | 			 (const char *__restrict __file, |
| 265 | 			 struct stat *__restrict __buf), lstat64) | |
| 320 | 			 struct stat *__restrict __buf), __lstat64_time64) | |
| 266 | 321 | __nonnull ((1, 2)); |
| 322 | # else | |
| 323 | # define lstat __lstat64_time64 | |
| 324 | # endif | |
| 267 | 325 | # else |
| 268 | # define lstat lstat64 | |
| 326 | # ifdef __REDIRECT_NTH | |
| 327 | extern int __REDIRECT_NTH (lstat, | |
| 328 | 			 (const char *__restrict __file, | |
| 329 | 			 struct stat *__restrict __buf), lstat64) | |
| 330 | __nonnull ((1, 2)); | |
| 331 | # else | |
| 332 | # define lstat lstat64 | |
| 333 | # endif | |
| 269 | 334 | # endif |
| 270 | 335 | # endif |
| 271 | 336 | # ifdef __USE_LARGEFILE64 |
| 337 | # ifndef __USE_TIME_BITS64 | |
| 272 | 338 | extern int lstat64 (const char *__restrict __file, |
| 273 | 339 | 		 struct stat64 *__restrict __buf) |
| 274 | 340 | __THROW __nonnull ((1, 2)); |
| 341 | # else | |
| 342 | extern int __REDIRECT_NTH (lstat64, (const char *__restrict __file, | |
| 343 | 				 struct stat64 *__restrict __buf), | |
| 344 | 			 __lstat64_time64) | |
| 345 | __nonnull ((1, 2)); | |
| 346 | # endif | |
| 275 | 347 | # endif |
| 276 | 348 | #endif |
| 277 | 349 | |
| ... | ... | @@ -355,17 +427,38 @@ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode) |
| 355 | 427 | #endif |
| 356 | 428 | |
| 357 | 429 | #ifdef __USE_ATFILE |
| 430 | # ifndef __USE_TIME_BITS64 | |
| 358 | 431 | /* Set file access and modification times relative to directory file |
| 359 | 432 | descriptor. */ |
| 360 | 433 | extern int utimensat (int __fd, const char *__path, |
| 361 | 434 | 		 const struct timespec __times[2], |
| 362 | 435 | 		 int __flags) |
| 363 | 436 | __THROW __nonnull ((2)); |
| 437 | # else | |
| 438 | # ifdef __REDIRECT_NTH | |
| 439 | extern int __REDIRECT_NTH (utimensat, (int fd, const char *__path, | |
| 440 | const struct timespec __times[2], | |
| 441 | int flags), | |
| 442 | __utimensat64) __nonnull ((2)); | |
| 443 | # else | |
| 444 | # define utimensat __utimensat64 | |
| 445 | # endif | |
| 446 | # endif | |
| 364 | 447 | #endif |
| 365 | 448 | |
| 366 | 449 | #ifdef __USE_XOPEN2K8 |
| 450 | # ifndef __USE_TIME_BITS64 | |
| 367 | 451 | /* Set file access and modification times of the file associated with FD. */ |
| 368 | 452 | extern int futimens (int __fd, const struct timespec __times[2]) __THROW; |
| 453 | ||
| 454 | # else | |
| 455 | # ifdef __REDIRECT_NTH | |
| 456 | extern int __REDIRECT_NTH (futimens, (int fd, const struct timespec __times[2]), | |
| 457 | __futimens64); | |
| 458 | # else | |
| 459 | # define futimens __futimens64 | |
| 460 | # endif | |
| 461 | # endif | |
| 369 | 462 | #endif |
| 370 | 463 | |
| 371 | 464 | #ifdef __USE_GNU |
lib/libc/include/generic-glibc/sys/statvfs.h+1-1| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | |
| 22 | 22 | #include <features.h> |
| 23 | 23 | |
| 24 | /* Get the system-specific definition of `struct statfs'. */ | |
| 24 | /* Get the system-specific definition of `struct statvfs'. */ | |
| 25 | 25 | #include <bits/statvfs.h> |
| 26 | 26 | |
| 27 | 27 | #ifndef __USE_FILE_OFFSET64 |
lib/libc/include/generic-glibc/sys/time.h+71| ... | ... | @@ -63,10 +63,21 @@ struct timezone |
| 63 | 63 | use localtime etc. instead. |
| 64 | 64 | This function itself is semi-obsolete; |
| 65 | 65 | most callers should use time or clock_gettime instead. */ |
| 66 | #ifndef __USE_TIME_BITS64 | |
| 66 | 67 | extern int gettimeofday (struct timeval *__restrict __tv, |
| 67 | 68 | 			 void *__restrict __tz) __THROW __nonnull ((1)); |
| 69 | #else | |
| 70 | # ifdef __REDIRECT_NTH | |
| 71 | extern int __REDIRECT_NTH (gettimeofday, (struct timeval *__restrict __tv, | |
| 72 | void *__restrict __tz), | |
| 73 | __gettimeofday64) __nonnull ((1)); | |
| 74 | # else | |
| 75 | # define gettimeofday __gettimeofday64 | |
| 76 | # endif | |
| 77 | #endif | |
| 68 | 78 | |
| 69 | 79 | #ifdef __USE_MISC |
| 80 | # ifndef __USE_TIME_BITS64 | |
| 70 | 81 | /* Set the current time of day and timezone information. |
| 71 | 82 | This call is restricted to the super-user. |
| 72 | 83 | Setting the timezone in this way is obsolete, but we don't yet |
| ... | ... | @@ -82,6 +93,20 @@ extern int settimeofday (const struct timeval *__tv, |
| 82 | 93 | This call is restricted to the super-user. */ |
| 83 | 94 | extern int adjtime (const struct timeval *__delta, |
| 84 | 95 | 		 struct timeval *__olddelta) __THROW; |
| 96 | # else | |
| 97 | # ifdef __REDIRECT_NTH | |
| 98 | extern int __REDIRECT_NTH (settimeofday, (const struct timeval *__tv, | |
| 99 | const struct timezone *__tz), | |
| 100 | __settimeofday64); | |
| 101 | ||
| 102 | extern int __REDIRECT_NTH (adjtime, (const struct timeval *__delta, | |
| 103 | struct timeval *__olddelta), | |
| 104 | __adjtime64); | |
| 105 | # else | |
| 106 | # define settimeofday __settimeofday64 | |
| 107 | # define adjtime __adjtime64 | |
| 108 | # endif | |
| 109 | # endif | |
| 85 | 110 | #endif |
| 86 | 111 | |
| 87 | 112 | |
| ... | ... | @@ -118,6 +143,7 @@ typedef enum __itimer_which __itimer_which_t; |
| 118 | 143 | typedef int __itimer_which_t; |
| 119 | 144 | #endif |
| 120 | 145 | |
| 146 | #ifndef __USE_TIME_BITS64 | |
| 121 | 147 | /* Set *VALUE to the current setting of timer WHICH. |
| 122 | 148 | Return 0 on success, -1 on errors. */ |
| 123 | 149 | extern int getitimer (__itimer_which_t __which, |
| ... | ... | @@ -136,21 +162,66 @@ extern int setitimer (__itimer_which_t __which, |
| 136 | 162 | extern int utimes (const char *__file, const struct timeval __tvp[2]) |
| 137 | 163 | __THROW __nonnull ((1)); |
| 138 | 164 | |
| 165 | #else | |
| 166 | # ifdef __REDIRECT_NTH | |
| 167 | extern int __REDIRECT_NTH (getitimer, (__itimer_which_t __which, | |
| 168 | struct itimerval *__value), | |
| 169 | __getitimer64); | |
| 170 | ||
| 171 | extern int __REDIRECT_NTH (setitimer, (__itimer_which_t __which, | |
| 172 | const struct itimerval *__restrict __new, | |
| 173 | struct itimerval *__restrict __old), | |
| 174 | __setitimer64); | |
| 175 | ||
| 176 | extern int __REDIRECT_NTH (utimes, (const char *__file, | |
| 177 | const struct timeval __tvp[2]), | |
| 178 | __utimes64) __nonnull ((1)); | |
| 179 | # else | |
| 180 | # define getitimer __getitimer64 | |
| 181 | # define setitimer __setitimer64 | |
| 182 | # define utimes __utimes64 | |
| 183 | # endif | |
| 184 | #endif | |
| 185 | ||
| 139 | 186 | #ifdef __USE_MISC |
| 187 | # ifndef __USE_TIME_BITS64 | |
| 140 | 188 | /* Same as `utimes', but does not follow symbolic links. */ |
| 141 | 189 | extern int lutimes (const char *__file, const struct timeval __tvp[2]) |
| 142 | 190 | __THROW __nonnull ((1)); |
| 143 | 191 | |
| 144 | 192 | /* Same as `utimes', but takes an open file descriptor instead of a name. */ |
| 145 | 193 | extern int futimes (int __fd, const struct timeval __tvp[2]) __THROW; |
| 194 | # else | |
| 195 | # ifdef __REDIRECT_NTH | |
| 196 | extern int __REDIRECT_NTH (lutimes, (const char *__file, | |
| 197 | const struct timeval __tvp[2]), | |
| 198 | __lutimes64) __nonnull ((1)); | |
| 199 | ||
| 200 | extern int __REDIRECT_NTH (futimes, (int __fd, const struct timeval __tvp[2]), | |
| 201 | __futimes64); | |
| 202 | # else | |
| 203 | # define lutimes __lutimes64 | |
| 204 | # define futimes __futimes64 | |
| 205 | # endif | |
| 206 | # endif | |
| 146 | 207 | #endif |
| 147 | 208 | |
| 148 | 209 | #ifdef __USE_GNU |
| 210 | # ifndef __USE_TIME_BITS64 | |
| 149 | 211 | /* Change the access time of FILE relative to FD to TVP[0] and the |
| 150 | 212 | modification time of FILE to TVP[1]. If TVP is a null pointer, use |
| 151 | 213 | the current time instead. Returns 0 on success, -1 on errors. */ |
| 152 | 214 | extern int futimesat (int __fd, const char *__file, |
| 153 | 215 | 		 const struct timeval __tvp[2]) __THROW; |
| 216 | # else | |
| 217 | # ifdef __REDIRECT_NTH | |
| 218 | extern int __REDIRECT_NTH (futimesat, (int __fd, const char *__file, | |
| 219 | const struct timeval __tvp[2]), | |
| 220 | __futimesat64); | |
| 221 | # else | |
| 222 | # define futimesat __futimesat64 | |
| 223 | # endif | |
| 224 | # endif | |
| 154 | 225 | #endif |
| 155 | 226 | |
| 156 | 227 |
lib/libc/include/generic-glibc/sys/timerfd.h+22| ... | ... | @@ -47,9 +47,31 @@ extern int timerfd_settime (int __ufd, int __flags, |
| 47 | 47 | 			 const struct itimerspec *__utmr, |
| 48 | 48 | 			 struct itimerspec *__otmr) __THROW; |
| 49 | 49 | |
| 50 | #ifdef __USE_TIME_BITS64 | |
| 51 | # if defined(__REDIRECT_NTH) | |
| 52 | extern int __REDIRECT_NTH (timerfd_settime, | |
| 53 | (int __ufd, int __flags, | |
| 54 | const struct itimerspec *__restrict __value, | |
| 55 | struct itimerspec *__restrict __ovalue), | |
| 56 | __timerfd_settime64); | |
| 57 | # else | |
| 58 | # define timerfd_settime __timerfd_settime64 | |
| 59 | # endif | |
| 60 | #endif | |
| 61 | ||
| 50 | 62 | /* Return the next expiration time of UFD. */ |
| 51 | 63 | extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW; |
| 52 | 64 | |
| 65 | #ifdef __USE_TIME_BITS64 | |
| 66 | # if defined(__REDIRECT_NTH) | |
| 67 | extern int __REDIRECT_NTH (timerfd_gettime, (int __ufd, | |
| 68 | struct itimerspec *__otmr), | |
| 69 | __timerfd_gettime64); | |
| 70 | # else | |
| 71 | # define timerfd_gettime __timerfd_gettime64 | |
| 72 | # endif | |
| 73 | #endif | |
| 74 | ||
| 53 | 75 | __END_DECLS |
| 54 | 76 | |
| 55 | 77 | #endif /* sys/timerfd.h */ |
| \ No newline at end of file |
lib/libc/include/generic-glibc/sys/timex.h+23-6| ... | ... | @@ -54,17 +54,34 @@ struct ntptimeval |
| 54 | 54 | |
| 55 | 55 | __BEGIN_DECLS |
| 56 | 56 | |
| 57 | extern int __adjtimex (struct timex *__ntx) __THROW; | |
| 57 | #ifndef __USE_TIME_BITS64 | |
| 58 | 58 | extern int adjtimex (struct timex *__ntx) __THROW; |
| 59 | extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW; | |
| 59 | 60 | |
| 60 | #ifdef __REDIRECT_NTH | |
| 61 | # ifdef __REDIRECT_NTH | |
| 61 | 62 | extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv), |
| 62 | 			 ntp_gettimex); | |
| 63 | ntp_gettimex); | |
| 64 | # else | |
| 65 | # define ntp_gettime ntp_gettimex | |
| 66 | # endif | |
| 67 | extern int ntp_adjtime (struct timex *__tntx) __THROW; | |
| 63 | 68 | #else |
| 64 | extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW; | |
| 65 | # define ntp_gettime ntp_gettimex | |
| 69 | # ifdef __REDIRECT_NTH | |
| 70 | extern int __REDIRECT_NTH (adjtimex, (struct timex *__ntx), | |
| 71 | ___adjtimex64); | |
| 72 | extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv), | |
| 73 | __ntp_gettime64); | |
| 74 | extern int __REDIRECT_NTH (ntp_gettimex, (struct ntptimeval *__ntv), | |
| 75 | __ntp_gettimex64); | |
| 76 | extern int __REDIRECT_NTH (ntp_adjtime, (struct timex *__ntx), | |
| 77 | ___adjtimex64); | |
| 78 | # else | |
| 79 | # define adjtimex ___adjtimex64 | |
| 80 | # define ntp_adjtime ___adjtimex64 | |
| 81 | # define ntp_gettime __ntp_gettime64 | |
| 82 | # define ntp_gettimex __ntp_gettimex64 | |
| 83 | # endif | |
| 66 | 84 | #endif |
| 67 | extern int ntp_adjtime (struct timex *__tntx) __THROW; | |
| 68 | 85 | |
| 69 | 86 | __END_DECLS |
| 70 | 87 |
lib/libc/include/generic-glibc/sys/uio.h+24-13| ... | ... | @@ -39,7 +39,7 @@ __BEGIN_DECLS |
| 39 | 39 | This function is a cancellation point and therefore not marked with |
| 40 | 40 | __THROW. */ |
| 41 | 41 | extern ssize_t readv (int __fd, const struct iovec *__iovec, int __count) |
| 42 | __wur; | |
| 42 | __wur __attr_access ((__read_only__, 2, 3)); | |
| 43 | 43 | |
| 44 | 44 | /* Write data pointed by the buffers described by IOVEC, which |
| 45 | 45 | is a vector of COUNT 'struct iovec's, to file descriptor FD. |
| ... | ... | @@ -50,7 +50,7 @@ extern ssize_t readv (int __fd, const struct iovec *__iovec, int __count) |
| 50 | 50 | This function is a cancellation point and therefore not marked with |
| 51 | 51 | __THROW. */ |
| 52 | 52 | extern ssize_t writev (int __fd, const struct iovec *__iovec, int __count) |
| 53 | __wur; | |
| 53 | __wur __attr_access ((__read_only__, 2, 3)); | |
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | #ifdef __USE_MISC |
| ... | ... | @@ -65,7 +65,8 @@ extern ssize_t writev (int __fd, const struct iovec *__iovec, int __count) |
| 65 | 65 | This function is a cancellation point and therefore not marked with |
| 66 | 66 | __THROW. */ |
| 67 | 67 | extern ssize_t preadv (int __fd, const struct iovec *__iovec, int __count, |
| 68 | 		 __off_t __offset) __wur; | |
| 68 | 		 __off_t __offset) | |
| 69 | __wur __attr_access ((__read_only__, 2, 3)); | |
| 69 | 70 | |
| 70 | 71 | /* Write data pointed by the buffers described by IOVEC, which is a |
| 71 | 72 | vector of COUNT 'struct iovec's, to file descriptor FD at the given |
| ... | ... | @@ -77,16 +78,19 @@ extern ssize_t preadv (int __fd, const struct iovec *__iovec, int __count, |
| 77 | 78 | This function is a cancellation point and therefore not marked with |
| 78 | 79 | __THROW. */ |
| 79 | 80 | extern ssize_t pwritev (int __fd, const struct iovec *__iovec, int __count, |
| 80 | 			__off_t __offset) __wur; | |
| 81 | 			__off_t __offset) | |
| 82 | __wur __attr_access ((__read_only__, 2, 3)); | |
| 81 | 83 | |
| 82 | 84 | # else |
| 83 | 85 | # ifdef __REDIRECT |
| 84 | 86 | extern ssize_t __REDIRECT (preadv, (int __fd, const struct iovec *__iovec, |
| 85 | 87 | 				 int __count, __off64_t __offset), |
| 86 | 			 preadv64) __wur; | |
| 88 | 			 preadv64) | |
| 89 | __wur __attr_access ((__read_only__, 2, 3)); | |
| 87 | 90 | extern ssize_t __REDIRECT (pwritev, (int __fd, const struct iovec *__iovec, |
| 88 | 91 | 				 int __count, __off64_t __offset), |
| 89 | 			 pwritev64) __wur; | |
| 92 | 			 pwritev64) | |
| 93 | __wur __attr_access ((__read_only__, 2, 3)); | |
| 90 | 94 | # else |
| 91 | 95 | # define preadv preadv64 |
| 92 | 96 | # define pwritev pwritev64 |
| ... | ... | @@ -104,7 +108,8 @@ extern ssize_t __REDIRECT (pwritev, (int __fd, const struct iovec *__iovec, |
| 104 | 108 | This function is a cancellation point and therefore not marked with |
| 105 | 109 | __THROW. */ |
| 106 | 110 | extern ssize_t preadv64 (int __fd, const struct iovec *__iovec, int __count, |
| 107 | 			 __off64_t __offset) __wur; | |
| 111 | 			 __off64_t __offset) | |
| 112 | __wur __attr_access ((__read_only__, 2, 3)); | |
| 108 | 113 | |
| 109 | 114 | /* Write data pointed by the buffers described by IOVEC, which is a |
| 110 | 115 | vector of COUNT 'struct iovec's, to file descriptor FD at the given |
| ... | ... | @@ -116,7 +121,8 @@ extern ssize_t preadv64 (int __fd, const struct iovec *__iovec, int __count, |
| 116 | 121 | This function is a cancellation point and therefore not marked with |
| 117 | 122 | __THROW. */ |
| 118 | 123 | extern ssize_t pwritev64 (int __fd, const struct iovec *__iovec, int __count, |
| 119 | 			 __off64_t __offset) __wur; | |
| 124 | 			 __off64_t __offset) | |
| 125 | __wur __attr_access ((__read_only__, 2, 3)); | |
| 120 | 126 | # endif |
| 121 | 127 | #endif	/* Use misc. */ |
| 122 | 128 | |
| ... | ... | @@ -125,7 +131,8 @@ extern ssize_t pwritev64 (int __fd, const struct iovec *__iovec, int __count, |
| 125 | 131 | # ifndef __USE_FILE_OFFSET64 |
| 126 | 132 | /* Same as preadv but with an additional flag argumenti defined at uio.h. */ |
| 127 | 133 | extern ssize_t preadv2 (int __fp, const struct iovec *__iovec, int __count, |
| 128 | 			__off_t __offset, int ___flags) __wur; | |
| 134 | 			__off_t __offset, int ___flags) | |
| 135 | __wur __attr_access ((__read_only__, 2, 3)); | |
| 129 | 136 | |
| 130 | 137 | /* Same as preadv but with an additional flag argument defined at uio.h. */ |
| 131 | 138 | extern ssize_t pwritev2 (int __fd, const struct iovec *__iodev, int __count, |
| ... | ... | @@ -136,11 +143,13 @@ extern ssize_t pwritev2 (int __fd, const struct iovec *__iodev, int __count, |
| 136 | 143 | extern ssize_t __REDIRECT (pwritev2, (int __fd, const struct iovec *__iovec, |
| 137 | 144 | 				 int __count, __off64_t __offset, |
| 138 | 145 | 				 int __flags), |
| 139 | 			 pwritev64v2) __wur; | |
| 146 | 			 pwritev64v2) | |
| 147 | __wur __attr_access ((__read_only__, 2, 3)); | |
| 140 | 148 | extern ssize_t __REDIRECT (preadv2, (int __fd, const struct iovec *__iovec, |
| 141 | 149 | 				 int __count, __off64_t __offset, |
| 142 | 150 | 				 int __flags), |
| 143 | 			 preadv64v2) __wur; | |
| 151 | 			 preadv64v2) | |
| 152 | __wur __attr_access ((__read_only__, 2, 3)); | |
| 144 | 153 | # else |
| 145 | 154 | # define preadv2 preadv64v2 |
| 146 | 155 | # define pwritev2 pwritev64v2 |
| ... | ... | @@ -151,12 +160,14 @@ extern ssize_t __REDIRECT (preadv2, (int __fd, const struct iovec *__iovec, |
| 151 | 160 | /* Same as preadv but with an additional flag argumenti defined at uio.h. */ |
| 152 | 161 | extern ssize_t preadv64v2 (int __fp, const struct iovec *__iovec, |
| 153 | 162 | 			 int __count, __off64_t __offset, |
| 154 | 			 int ___flags) __wur; | |
| 163 | 			 int ___flags) | |
| 164 | __wur __attr_access ((__read_only__, 2, 3)); | |
| 155 | 165 | |
| 156 | 166 | /* Same as preadv but with an additional flag argument defined at uio.h. */ |
| 157 | 167 | extern ssize_t pwritev64v2 (int __fd, const struct iovec *__iodev, |
| 158 | 168 | 			 int __count, __off64_t __offset, |
| 159 | 			 int __flags) __wur; | |
| 169 | 			 int __flags) | |
| 170 | __wur __attr_access ((__read_only__, 2, 3)); | |
| 160 | 171 | # endif |
| 161 | 172 | #endif /* Use GNU. */ |
| 162 | 173 |
lib/libc/include/generic-glibc/sys/wait.h+20| ... | ... | @@ -144,14 +144,34 @@ struct rusage; |
| 144 | 144 | nil, store information about the child's resource usage there. If the |
| 145 | 145 | WUNTRACED bit is set in OPTIONS, return status for stopped children; |
| 146 | 146 | otherwise don't. */ |
| 147 | # ifndef __USE_TIME_BITS64 | |
| 147 | 148 | extern __pid_t wait3 (int *__stat_loc, int __options, |
| 148 | 149 | 		 struct rusage * __usage) __THROWNL; |
| 150 | # else | |
| 151 | # ifdef __REDIRECT_NTHNL | |
| 152 | extern __pid_t __REDIRECT_NTHNL (wait3, (int *__stat_loc, int __options, | |
| 153 | struct rusage * __usage), | |
| 154 | __wait3_time64); | |
| 155 | # else | |
| 156 | # define wait3 __wait3_time64 | |
| 157 | # endif | |
| 158 | # endif | |
| 149 | 159 | #endif |
| 150 | 160 | |
| 151 | 161 | #ifdef __USE_MISC |
| 162 | # ifndef __USE_TIME_BITS64 | |
| 152 | 163 | /* PID is like waitpid. Other args are like wait3. */ |
| 153 | 164 | extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options, |
| 154 | 165 | 		 struct rusage *__usage) __THROWNL; |
| 166 | # else | |
| 167 | # ifdef __REDIRECT_NTHNL | |
| 168 | extern __pid_t __REDIRECT_NTHNL (wait4, (__pid_t __pid, int *__stat_loc, | |
| 169 | int __options, struct rusage *__usage), | |
| 170 | __wait4_time64); | |
| 171 | # else | |
| 172 | # define wait4 __wait4_time64 | |
| 173 | # endif | |
| 174 | # endif | |
| 155 | 175 | #endif /* Use misc. */ |
| 156 | 176 | |
| 157 | 177 |
lib/libc/include/generic-glibc/threads.h+33| ... | ... | @@ -88,8 +88,18 @@ extern thrd_t thrd_current (void); |
| 88 | 88 | __TIME_POINT. The current thread may resume if receives a signal. In |
| 89 | 89 | that case, if __REMAINING is not NULL, the remaining time is stored in |
| 90 | 90 | the object pointed by it. */ |
| 91 | #ifndef __USE_TIME_BITS64 | |
| 91 | 92 | extern int thrd_sleep (const struct timespec *__time_point, |
| 92 | 93 | 		 struct timespec *__remaining); |
| 94 | #else | |
| 95 | # ifdef __REDIRECT | |
| 96 | extern int __REDIRECT (thrd_sleep, (const struct timespec *__time_point, | |
| 97 | struct timespec *__remaining), | |
| 98 | __thrd_sleep64); | |
| 99 | # else | |
| 100 | # define thrd_sleep __thrd_sleep64 | |
| 101 | # endif | |
| 102 | #endif | |
| 93 | 103 | |
| 94 | 104 | /* Terminate current thread execution, cleaning up any thread local |
| 95 | 105 | storage and freeing resources. Returns the value specified in __RES. */ |
| ... | ... | @@ -131,8 +141,19 @@ extern int mtx_lock (mtx_t *__mutex); |
| 131 | 141 | /* Block the current thread until the mutex pointed by __MUTEX is unlocked |
| 132 | 142 | or time pointed by __TIME_POINT is reached. In case the mutex is unlock, |
| 133 | 143 | the current thread will not be blocked. */ |
| 144 | #ifndef __USE_TIME_BITS64 | |
| 134 | 145 | extern int mtx_timedlock (mtx_t *__restrict __mutex, |
| 135 | 146 | 			 const struct timespec *__restrict __time_point); |
| 147 | #else | |
| 148 | # ifdef __REDIRECT | |
| 149 | extern int __REDIRECT (mtx_timedlock, (mtx_t *__restrict __mutex, | |
| 150 | const struct timespec *__restrict | |
| 151 | __time_point), | |
| 152 | __mtx_timedlock64); | |
| 153 | # else | |
| 154 | # define mtx_timedlock __mtx_timedlock64 | |
| 155 | # endif | |
| 156 | #endif | |
| 136 | 157 | |
| 137 | 158 | /* Try to lock the mutex pointed by __MUTEX without blocking. If the mutex |
| 138 | 159 | is free the current threads takes control of it, otherwise it returns |
| ... | ... | @@ -171,9 +192,21 @@ extern int cnd_wait (cnd_t *__cond, mtx_t *__mutex); |
| 171 | 192 | /* Block current thread on the condition variable until condition variable |
| 172 | 193 | pointed by __COND is signaled or time pointed by __TIME_POINT is |
| 173 | 194 | reached. */ |
| 195 | #ifndef __USE_TIME_BITS64 | |
| 174 | 196 | extern int cnd_timedwait (cnd_t *__restrict __cond, |
| 175 | 197 | 			 mtx_t *__restrict __mutex, |
| 176 | 198 | 			 const struct timespec *__restrict __time_point); |
| 199 | #else | |
| 200 | # ifdef __REDIRECT | |
| 201 | extern int __REDIRECT (cnd_timedwait, (cnd_t *__restrict __cond, | |
| 202 | mtx_t *__restrict __mutex, | |
| 203 | const struct timespec *__restrict | |
| 204 | __time_point), | |
| 205 | __cnd_timedwait64); | |
| 206 | # else | |
| 207 | # define cnd_timedwait __cnd_timedwait64 | |
| 208 | # endif | |
| 209 | #endif | |
| 177 | 210 | |
| 178 | 211 | /* Destroy condition variable pointed by __cond and free all of its |
| 179 | 212 | resources. */ |
lib/libc/include/generic-glibc/time.h+144-5| ... | ... | @@ -71,6 +71,7 @@ __BEGIN_DECLS |
| 71 | 71 | The result / CLOCKS_PER_SEC is program time in seconds. */ |
| 72 | 72 | extern clock_t clock (void) __THROW; |
| 73 | 73 | |
| 74 | #ifndef __USE_TIME_BITS64 | |
| 74 | 75 | /* Return the current time and put it in *TIMER if TIMER is not NULL. */ |
| 75 | 76 | extern time_t time (time_t *__timer) __THROW; |
| 76 | 77 | |
| ... | ... | @@ -80,7 +81,18 @@ extern double difftime (time_t __time1, time_t __time0) |
| 80 | 81 | |
| 81 | 82 | /* Return the `time_t' representation of TP and normalize TP. */ |
| 82 | 83 | extern time_t mktime (struct tm *__tp) __THROW; |
| 83 | ||
| 84 | #else | |
| 85 | # ifdef __REDIRECT_NTH | |
| 86 | extern time_t __REDIRECT_NTH (time, (time_t *__timer), __time64); | |
| 87 | extern double __REDIRECT_NTH (difftime, (time_t __time1, time_t __time0), | |
| 88 | __difftime64) __attribute__ ((__const__)); | |
| 89 | extern time_t __REDIRECT_NTH (mktime, (struct tm *__tp), __mktime64); | |
| 90 | # else | |
| 91 | # define time __time64 | |
| 92 | # define difftime __difftime64 | |
| 93 | # define mktime __mktime64 | |
| 94 | # endif | |
| 95 | #endif | |
| 84 | 96 | |
| 85 | 97 | /* Format TP into S according to FORMAT. |
| 86 | 98 | Write no more than MAXSIZE characters and return the number |
| ... | ... | @@ -114,6 +126,7 @@ extern char *strptime_l (const char *__restrict __s, |
| 114 | 126 | #endif |
| 115 | 127 | |
| 116 | 128 | |
| 129 | #ifndef __USE_TIME_BITS64 | |
| 117 | 130 | /* Return the `struct tm' representation of *TIMER |
| 118 | 131 | in Universal Coordinated Time (aka Greenwich Mean Time). */ |
| 119 | 132 | extern struct tm *gmtime (const time_t *__timer) __THROW; |
| ... | ... | @@ -122,7 +135,20 @@ extern struct tm *gmtime (const time_t *__timer) __THROW; |
| 122 | 135 | of *TIMER in the local timezone. */ |
| 123 | 136 | extern struct tm *localtime (const time_t *__timer) __THROW; |
| 124 | 137 | |
| 138 | #else | |
| 139 | # ifdef __REDIRECT_NTH | |
| 140 | extern struct tm*__REDIRECT_NTH (gmtime, (const time_t *__timer), __gmtime64); | |
| 141 | extern struct tm *__REDIRECT_NTH (localtime, (const time_t *__timer), | |
| 142 | 				 __localtime64); | |
| 143 | # else | |
| 144 | # define gmtime __gmtime64 | |
| 145 | # define localtime __localtime64 | |
| 146 | # endif | |
| 147 | #endif | |
| 148 | ||
| 149 | ||
| 125 | 150 | #if defined __USE_POSIX || __GLIBC_USE (ISOC2X) |
| 151 | # ifndef __USE_TIME_BITS64 | |
| 126 | 152 | /* Return the `struct tm' representation of *TIMER in UTC, |
| 127 | 153 | using *TP to store the result. */ |
| 128 | 154 | extern struct tm *gmtime_r (const time_t *__restrict __timer, |
| ... | ... | @@ -132,6 +158,20 @@ extern struct tm *gmtime_r (const time_t *__restrict __timer, |
| 132 | 158 | using *TP to store the result. */ |
| 133 | 159 | extern struct tm *localtime_r (const time_t *__restrict __timer, |
| 134 | 160 | 			 struct tm *__restrict __tp) __THROW; |
| 161 | # else | |
| 162 | # ifdef __REDIRECT_NTH | |
| 163 | extern struct tm*__REDIRECT_NTH (gmtime_r, (const time_t *__restrict __timer, | |
| 164 | struct tm *__restrict __tp), | |
| 165 | __gmtime64_r); | |
| 166 | ||
| 167 | extern struct tm*__REDIRECT_NTH (localtime_r, (const time_t *__restrict __t, | |
| 168 | struct tm *__restrict __tp), | |
| 169 | __localtime64_r); | |
| 170 | # else | |
| 171 | # define gmtime_r __gmtime64_r | |
| 172 | # define localtime_r __localtime_r | |
| 173 | # endif | |
| 174 | # endif | |
| 135 | 175 | #endif	/* POSIX || C2X */ |
| 136 | 176 | |
| 137 | 177 | /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" |
| ... | ... | @@ -139,9 +179,17 @@ extern struct tm *localtime_r (const time_t *__restrict __timer, |
| 139 | 179 | extern char *asctime (const struct tm *__tp) __THROW; |
| 140 | 180 | |
| 141 | 181 | /* Equivalent to `asctime (localtime (timer))'. */ |
| 182 | #ifndef __USE_TIME_BITS64 | |
| 142 | 183 | extern char *ctime (const time_t *__timer) __THROW; |
| 184 | #else | |
| 185 | # ifdef __REDIRECT_NTH | |
| 186 | extern char *__REDIRECT_NTH (ctime, (const time_t *__timer), __ctime64); | |
| 187 | # else | |
| 188 | # define ctime __ctime64 | |
| 189 | # endif | |
| 190 | #endif | |
| 143 | 191 | |
| 144 | #if defined __USE_POSIX || __GLIBC_USE (ISOC2X) | |
| 192 | #ifdef __USE_POSIX | |
| 145 | 193 | /* Reentrant versions of the above functions. */ |
| 146 | 194 | |
| 147 | 195 | /* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n" |
| ... | ... | @@ -150,9 +198,19 @@ extern char *asctime_r (const struct tm *__restrict __tp, |
| 150 | 198 | 			char *__restrict __buf) __THROW; |
| 151 | 199 | |
| 152 | 200 | /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */ |
| 201 | #ifndef __USE_TIME_BITS64 | |
| 153 | 202 | extern char *ctime_r (const time_t *__restrict __timer, |
| 154 | 203 | 		 char *__restrict __buf) __THROW; |
| 155 | #endif	/* POSIX || C2X */ | |
| 204 | #else | |
| 205 | # ifdef __REDIRECT_NTH | |
| 206 | extern char *__REDIRECT_NTH (ctime_r, (const time_t *__restrict __timer, | |
| 207 | char *__restrict __buf), __ctime64_r); | |
| 208 | # else | |
| 209 | # define ctime_r __ctime64_r | |
| 210 | # endif | |
| 211 | #endif | |
| 212 | ||
| 213 | #endif	/* POSIX */ | |
| 156 | 214 | |
| 157 | 215 | |
| 158 | 216 | /* Defined in localtime.c. */ |
| ... | ... | @@ -186,11 +244,19 @@ extern long int timezone; |
| 186 | 244 | /* Miscellaneous functions many Unices inherited from the public domain |
| 187 | 245 | localtime package. These are included only for compatibility. */ |
| 188 | 246 | |
| 247 | #ifndef __USE_TIME_BITS64 | |
| 189 | 248 | /* Like `mktime', but for TP represents Universal Time, not local time. */ |
| 190 | 249 | extern time_t timegm (struct tm *__tp) __THROW; |
| 191 | ||
| 192 | 250 | /* Another name for `mktime'. */ |
| 193 | 251 | extern time_t timelocal (struct tm *__tp) __THROW; |
| 252 | #else | |
| 253 | # ifdef __REDIRECT_NTH | |
| 254 | extern time_t __REDIRECT_NTH (timegm, (struct tm *__tp), __timegm64); | |
| 255 | extern time_t __REDIRECT_NTH (timelocal, (struct tm *__tp), __mktime64); | |
| 256 | # else | |
| 257 | # define timegm __timegm64 | |
| 258 | # endif | |
| 259 | #endif | |
| 194 | 260 | |
| 195 | 261 | /* Return the number of days in YEAR. */ |
| 196 | 262 | extern int dysize (int __year) __THROW __attribute__ ((__const__)); |
| ... | ... | @@ -198,6 +264,7 @@ extern int dysize (int __year) __THROW __attribute__ ((__const__)); |
| 198 | 264 | |
| 199 | 265 | |
| 200 | 266 | #ifdef __USE_POSIX199309 |
| 267 | # ifndef __USE_TIME_BITS64 | |
| 201 | 268 | /* Pause execution for a number of nanoseconds. |
| 202 | 269 | |
| 203 | 270 | This function is a cancellation point and therefore not marked with |
| ... | ... | @@ -205,7 +272,6 @@ extern int dysize (int __year) __THROW __attribute__ ((__const__)); |
| 205 | 272 | extern int nanosleep (const struct timespec *__requested_time, |
| 206 | 273 | 		 struct timespec *__remaining); |
| 207 | 274 | |
| 208 | ||
| 209 | 275 | /* Get resolution of clock CLOCK_ID. */ |
| 210 | 276 | extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW; |
| 211 | 277 | |
| ... | ... | @@ -215,15 +281,46 @@ extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW; |
| 215 | 281 | /* Set clock CLOCK_ID to value TP. */ |
| 216 | 282 | extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp) |
| 217 | 283 | __THROW; |
| 284 | # else | |
| 285 | # ifdef __REDIRECT | |
| 286 | extern int __REDIRECT (nanosleep, (const struct timespec *__requested_time, | |
| 287 | struct timespec *__remaining), | |
| 288 | __nanosleep64); | |
| 289 | extern int __REDIRECT_NTH (clock_getres, (clockid_t __clock_id, | |
| 290 | struct timespec *__res), | |
| 291 | __clock_getres64); | |
| 292 | extern int __REDIRECT_NTH (clock_gettime, (clockid_t __clock_id, struct | |
| 293 | timespec *__tp), __clock_gettime64); | |
| 294 | extern int __REDIRECT_NTH (clock_settime, (clockid_t __clock_id, const struct | |
| 295 | timespec *__tp), __clock_settime64); | |
| 296 | # else | |
| 297 | # define nanosleep __nanosleep64 | |
| 298 | # define clock_getres __clock_getres64 | |
| 299 | # define clock_gettime __clock_gettime64 | |
| 300 | # define clock_settime __clock_settime64 | |
| 301 | # endif | |
| 302 | # endif | |
| 303 | ||
| 218 | 304 | |
| 219 | 305 | # ifdef __USE_XOPEN2K |
| 220 | 306 | /* High-resolution sleep with the specified clock. |
| 221 | 307 | |
| 222 | 308 | This function is a cancellation point and therefore not marked with |
| 223 | 309 | __THROW. */ |
| 310 | # ifndef __USE_TIME_BITS64 | |
| 224 | 311 | extern int clock_nanosleep (clockid_t __clock_id, int __flags, |
| 225 | 312 | 			 const struct timespec *__req, |
| 226 | 313 | 			 struct timespec *__rem); |
| 314 | # else | |
| 315 | # ifdef __REDIRECT | |
| 316 | extern int __REDIRECT (clock_nanosleep, (clockid_t __clock_id, int __flags, | |
| 317 | const struct timespec *__req, | |
| 318 | struct timespec *__rem), | |
| 319 | __clock_nanosleep_time64); | |
| 320 | # else | |
| 321 | # define clock_nanosleep __clock_nanosleep_time64 | |
| 322 | # endif | |
| 323 | # endif | |
| 227 | 324 | |
| 228 | 325 | /* Return clock ID for CPU-time clock. */ |
| 229 | 326 | extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW; |
| ... | ... | @@ -239,6 +336,7 @@ extern int timer_create (clockid_t __clock_id, |
| 239 | 336 | extern int timer_delete (timer_t __timerid) __THROW; |
| 240 | 337 | |
| 241 | 338 | /* Set timer TIMERID to VALUE, returning old value in OVALUE. */ |
| 339 | # ifndef __USE_TIME_BITS64 | |
| 242 | 340 | extern int timer_settime (timer_t __timerid, int __flags, |
| 243 | 341 | 			 const struct itimerspec *__restrict __value, |
| 244 | 342 | 			 struct itimerspec *__restrict __ovalue) __THROW; |
| ... | ... | @@ -246,6 +344,21 @@ extern int timer_settime (timer_t __timerid, int __flags, |
| 246 | 344 | /* Get current value of timer TIMERID and store it in VALUE. */ |
| 247 | 345 | extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) |
| 248 | 346 | __THROW; |
| 347 | # else | |
| 348 | # ifdef __REDIRECT_NTH | |
| 349 | extern int __REDIRECT_NTH (timer_settime, (timer_t __timerid, int __flags, | |
| 350 | const struct itimerspec *__restrict __value, | |
| 351 | struct itimerspec *__restrict __ovalue), | |
| 352 | __timer_settime64); | |
| 353 | ||
| 354 | extern int __REDIRECT_NTH (timer_gettime, (timer_t __timerid, | |
| 355 | struct itimerspec *__value), | |
| 356 | __timer_gettime64); | |
| 357 | # else | |
| 358 | # define timer_settime __timer_settime64 | |
| 359 | # define timer_gettime __timer_gettime64 | |
| 360 | # endif | |
| 361 | # endif | |
| 249 | 362 | |
| 250 | 363 | /* Get expiration overrun for timer TIMERID. */ |
| 251 | 364 | extern int timer_getoverrun (timer_t __timerid) __THROW; |
| ... | ... | @@ -253,9 +366,35 @@ extern int timer_getoverrun (timer_t __timerid) __THROW; |
| 253 | 366 | |
| 254 | 367 | |
| 255 | 368 | #ifdef __USE_ISOC11 |
| 369 | # ifndef __USE_TIME_BITS64 | |
| 256 | 370 | /* Set TS to calendar time based in time base BASE. */ |
| 257 | 371 | extern int timespec_get (struct timespec *__ts, int __base) |
| 258 | 372 | __THROW __nonnull ((1)); |
| 373 | # else | |
| 374 | # ifdef __REDIRECT_NTH | |
| 375 | extern int __REDIRECT_NTH (timespec_get, (struct timespec *__ts, int __base), | |
| 376 | __timespec_get64) __nonnull ((1)); | |
| 377 | # else | |
| 378 | # define timespec_get __timespec_get64 | |
| 379 | # endif | |
| 380 | # endif | |
| 381 | #endif | |
| 382 | ||
| 383 | ||
| 384 | #if __GLIBC_USE (ISOC2X) | |
| 385 | # ifndef __USE_TIME_BITS64 | |
| 386 | /* Set TS to resolution of time base BASE. */ | |
| 387 | extern int timespec_getres (struct timespec *__ts, int __base) | |
| 388 | __THROW; | |
| 389 | # else | |
| 390 | # ifdef __REDIRECT_NTH | |
| 391 | extern int __REDIRECT_NTH (timespec_getres, (struct timespec *__ts, | |
| 392 | int __base), | |
| 393 | __timespec_getres64); | |
| 394 | # else | |
| 395 | # define timespec_getres __timespec_getres64 | |
| 396 | # endif | |
| 397 | # endif | |
| 259 | 398 | #endif |
| 260 | 399 | |
| 261 | 400 |
lib/libc/include/generic-glibc/unistd.h+18| ... | ... | @@ -295,6 +295,11 @@ extern int euidaccess (const char *__name, int __type) |
| 295 | 295 | /* An alias for `euidaccess', used by some other systems. */ |
| 296 | 296 | extern int eaccess (const char *__name, int __type) |
| 297 | 297 | __THROW __nonnull ((1)); |
| 298 | ||
| 299 | /* Execute program relative to a directory file descriptor. */ | |
| 300 | extern int execveat (int __fd, const char *__path, char *const __argv[], | |
| 301 | char *const __envp[], int __flags) | |
| 302 | __THROW __nonnull ((2, 3)); | |
| 298 | 303 | #endif |
| 299 | 304 | |
| 300 | 305 | #ifdef __USE_ATFILE |
| ... | ... | @@ -352,6 +357,12 @@ extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence) |
| 352 | 357 | __THROW. */ |
| 353 | 358 | extern int close (int __fd); |
| 354 | 359 | |
| 360 | #ifdef __USE_MISC | |
| 361 | /* Close all open file descriptors greater than or equal to LOWFD. | |
| 362 | Negative LOWFD is clamped to 0. */ | |
| 363 | extern void closefrom (int __lowfd) __THROW; | |
| 364 | #endif | |
| 365 | ||
| 355 | 366 | /* Read NBYTES into BUF from FD. Return the |
| 356 | 367 | number read, -1 for errors or 0 for EOF. |
| 357 | 368 | |
| ... | ... | @@ -776,6 +787,13 @@ extern __pid_t fork (void) __THROWNL; |
| 776 | 787 | extern __pid_t vfork (void) __THROW; |
| 777 | 788 | #endif /* Use misc or XPG < 7. */ |
| 778 | 789 | |
| 790 | #ifdef __USE_GNU | |
| 791 | /* This is similar to fork, however it does not run the atfork handlers | |
| 792 | neither reinitialize any internal locks in multithread case. | |
| 793 | Different than fork, _Fork is async-signal-safe. */ | |
| 794 | extern __pid_t _Fork (void) __THROW; | |
| 795 | #endif | |
| 796 | ||
| 779 | 797 | |
| 780 | 798 | /* Return the pathname of the terminal FD is open on, or NULL on errors. |
| 781 | 799 | The returned storage is good only until the next call to this function. */ |
lib/libc/include/generic-glibc/utime.h+16| ... | ... | @@ -35,16 +35,32 @@ __BEGIN_DECLS |
| 35 | 35 | /* Structure describing file times. */ |
| 36 | 36 | struct utimbuf |
| 37 | 37 | { |
| 38 | #ifdef __USE_TIME_BITS64 | |
| 39 | __time64_t actime;		/* Access time. */ | |
| 40 | __time64_t modtime;		/* Modification time. */ | |
| 41 | #else | |
| 38 | 42 | __time_t actime;		/* Access time. */ |
| 39 | 43 | __time_t modtime;		/* Modification time. */ |
| 44 | #endif | |
| 40 | 45 | }; |
| 41 | 46 | |
| 42 | 47 | /* Set the access and modification times of FILE to those given in |
| 43 | 48 | *FILE_TIMES. If FILE_TIMES is NULL, set them to the current time. */ |
| 49 | #ifndef __USE_TIME_BITS64 | |
| 44 | 50 | extern int utime (const char *__file, |
| 45 | 51 | 		 const struct utimbuf *__file_times) |
| 46 | 52 | __THROW __nonnull ((1)); |
| 47 | 53 | |
| 54 | #else | |
| 55 | # ifdef __REDIRECT_NTH | |
| 56 | extern int __REDIRECT_NTH (utime, (const char *__file, | |
| 57 | const struct utimbuf *__file_times), | |
| 58 | __utime64); | |
| 59 | # else | |
| 60 | # define utime __utime64 | |
| 61 | # endif | |
| 62 | #endif | |
| 63 | ||
| 48 | 64 | __END_DECLS |
| 49 | 65 | |
| 50 | 66 | #endif /* utime.h */ |
| \ No newline at end of file |
lib/libc/include/generic-glibc/wchar.h+17-2| ... | ... | @@ -151,7 +151,8 @@ extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2, |
| 151 | 151 | 			 size_t __n, locale_t __loc) __THROW; |
| 152 | 152 | |
| 153 | 153 | /* Duplicate S, returning an identical malloc'd string. */ |
| 154 | extern wchar_t *wcsdup (const wchar_t *__s) __THROW __attribute_malloc__; | |
| 154 | extern wchar_t *wcsdup (const wchar_t *__s) __THROW | |
| 155 | __attribute_malloc__ __attr_dealloc_free; | |
| 155 | 156 | #endif |
| 156 | 157 | |
| 157 | 158 | /* Find the first occurrence of WC in WCS. */ |
| ... | ... | @@ -562,9 +563,23 @@ extern wchar_t *wcpncpy (wchar_t *__restrict __dest, |
| 562 | 563 | /* Wide character I/O functions. */ |
| 563 | 564 | |
| 564 | 565 | #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) |
| 566 | # ifndef __attr_dealloc_fclose | |
| 567 | # if defined __has_builtin | |
| 568 | # if __has_builtin (__builtin_fclose) | |
| 569 | /* If the attribute macro hasn't been defined yet (by <stdio.h>) and | |
| 570 | fclose is a built-in, use it. */ | |
| 571 | # define __attr_dealloc_fclose __attr_dealloc (__builtin_fclose, 1) | |
| 572 | # endif | |
| 573 | # endif | |
| 574 | # endif | |
| 575 | # ifndef __attr_dealloc_fclose | |
| 576 | # define __attr_dealloc_fclose /* empty */ | |
| 577 | # endif | |
| 578 | ||
| 565 | 579 | /* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces |
| 566 | 580 | a wide character string. */ |
| 567 | extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW; | |
| 581 | extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW | |
| 582 | __attribute_malloc__ __attr_dealloc_fclose; | |
| 568 | 583 | #endif |
| 569 | 584 | |
| 570 | 585 | #if defined __USE_ISOC95 || defined __USE_UNIX98 |
lib/libc/include/i386-linux-gnu/bits/struct_stat.h+49-41| ... | ... | @@ -25,43 +25,46 @@ |
| 25 | 25 | |
| 26 | 26 | struct stat |
| 27 | 27 | { |
| 28 | #ifdef __USE_TIME_BITS64 | |
| 29 | # include <bits/struct_stat_time64_helper.h> | |
| 30 | #else | |
| 28 | 31 | __dev_t st_dev;		/* Device. */ |
| 29 | #ifndef __x86_64__ | |
| 32 | # ifndef __x86_64__ | |
| 30 | 33 | unsigned short int __pad1; |
| 31 | #endif | |
| 32 | #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 34 | # endif | |
| 35 | # if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 33 | 36 | __ino_t st_ino;		/* File serial number.	*/ |
| 34 | #else | |
| 37 | # else | |
| 35 | 38 | __ino_t __st_ino;			/* 32bit file serial number.	*/ |
| 36 | #endif | |
| 37 | #ifndef __x86_64__ | |
| 39 | # endif | |
| 40 | # ifndef __x86_64__ | |
| 38 | 41 | __mode_t st_mode;			/* File mode. */ |
| 39 | 42 | __nlink_t st_nlink;			/* Link count. */ |
| 40 | #else | |
| 43 | # else | |
| 41 | 44 | __nlink_t st_nlink;		/* Link count. */ |
| 42 | 45 | __mode_t st_mode;		/* File mode. */ |
| 43 | #endif | |
| 46 | # endif | |
| 44 | 47 | __uid_t st_uid;		/* User ID of the file's owner.	*/ |
| 45 | 48 | __gid_t st_gid;		/* Group ID of the file's group.*/ |
| 46 | #ifdef __x86_64__ | |
| 49 | # ifdef __x86_64__ | |
| 47 | 50 | int __pad0; |
| 48 | #endif | |
| 51 | # endif | |
| 49 | 52 | __dev_t st_rdev;		/* Device number, if device. */ |
| 50 | #ifndef __x86_64__ | |
| 53 | # ifndef __x86_64__ | |
| 51 | 54 | unsigned short int __pad2; |
| 52 | #endif | |
| 53 | #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 55 | # endif | |
| 56 | # if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 54 | 57 | __off_t st_size;			/* Size of file, in bytes. */ |
| 55 | #else | |
| 58 | # else | |
| 56 | 59 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 57 | #endif | |
| 60 | # endif | |
| 58 | 61 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ |
| 59 | #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 62 | # if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 60 | 63 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 61 | #else | |
| 64 | # else | |
| 62 | 65 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 63 | #endif | |
| 64 | #ifdef __USE_XOPEN2K8 | |
| 66 | # endif | |
| 67 | # ifdef __USE_XOPEN2K8 | |
| 65 | 68 | /* Nanosecond resolution timestamps are stored in a format |
| 66 | 69 | equivalent to 'struct timespec'. This is the type used |
| 67 | 70 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -71,58 +74,62 @@ struct stat |
| 71 | 74 | struct timespec st_atim;		/* Time of last access. */ |
| 72 | 75 | struct timespec st_mtim;		/* Time of last modification. */ |
| 73 | 76 | struct timespec st_ctim;		/* Time of last status change. */ |
| 74 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 75 | # define st_mtime st_mtim.tv_sec | |
| 76 | # define st_ctime st_ctim.tv_sec | |
| 77 | #else | |
| 77 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 78 | # define st_mtime st_mtim.tv_sec | |
| 79 | # define st_ctime st_ctim.tv_sec | |
| 80 | # else | |
| 78 | 81 | __time_t st_atime;			/* Time of last access. */ |
| 79 | 82 | __syscall_ulong_t st_atimensec;	/* Nscecs of last access. */ |
| 80 | 83 | __time_t st_mtime;			/* Time of last modification. */ |
| 81 | 84 | __syscall_ulong_t st_mtimensec;	/* Nsecs of last modification. */ |
| 82 | 85 | __time_t st_ctime;			/* Time of last status change. */ |
| 83 | 86 | __syscall_ulong_t st_ctimensec;	/* Nsecs of last status change. */ |
| 84 | #endif | |
| 85 | #ifdef __x86_64__ | |
| 87 | # endif | |
| 88 | # ifdef __x86_64__ | |
| 86 | 89 | __syscall_slong_t __glibc_reserved[3]; |
| 87 | #else | |
| 88 | # ifndef __USE_FILE_OFFSET64 | |
| 90 | # else | |
| 91 | # ifndef __USE_FILE_OFFSET64 | |
| 89 | 92 | unsigned long int __glibc_reserved4; |
| 90 | 93 | unsigned long int __glibc_reserved5; |
| 91 | # else | |
| 94 | # else | |
| 92 | 95 | __ino64_t st_ino;			/* File serial number.	*/ |
| 96 | # endif | |
| 93 | 97 | # endif |
| 94 | #endif | |
| 98 | #endif /* __USE_TIME_BITS64 */ | |
| 95 | 99 | }; |
| 96 | 100 | |
| 97 | 101 | #ifdef __USE_LARGEFILE64 |
| 98 | 102 | /* Note stat64 has the same shape as stat for x86-64. */ |
| 99 | 103 | struct stat64 |
| 100 | 104 | { |
| 105 | # ifdef __USE_TIME_BITS64 | |
| 106 | # include <bits/struct_stat_time64_helper.h> | |
| 107 | # else | |
| 101 | 108 | __dev_t st_dev;		/* Device. */ |
| 102 | # ifdef __x86_64__ | |
| 109 | # ifdef __x86_64__ | |
| 103 | 110 | __ino64_t st_ino;		/* File serial number. */ |
| 104 | 111 | __nlink_t st_nlink;		/* Link count. */ |
| 105 | 112 | __mode_t st_mode;		/* File mode. */ |
| 106 | # else | |
| 113 | # else | |
| 107 | 114 | unsigned int __pad1; |
| 108 | 115 | __ino_t __st_ino;			/* 32bit file serial number.	*/ |
| 109 | 116 | __mode_t st_mode;			/* File mode. */ |
| 110 | 117 | __nlink_t st_nlink;			/* Link count. */ |
| 111 | # endif | |
| 118 | # endif | |
| 112 | 119 | __uid_t st_uid;		/* User ID of the file's owner.	*/ |
| 113 | 120 | __gid_t st_gid;		/* Group ID of the file's group.*/ |
| 114 | # ifdef __x86_64__ | |
| 121 | # ifdef __x86_64__ | |
| 115 | 122 | int __pad0; |
| 116 | 123 | __dev_t st_rdev;		/* Device number, if device. */ |
| 117 | 124 | __off_t st_size;		/* Size of file, in bytes. */ |
| 118 | # else | |
| 125 | # else | |
| 119 | 126 | __dev_t st_rdev;			/* Device number, if device. */ |
| 120 | 127 | unsigned int __pad2; |
| 121 | 128 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 122 | # endif | |
| 129 | # endif | |
| 123 | 130 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ |
| 124 | 131 | __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated. */ |
| 125 | # ifdef __USE_XOPEN2K8 | |
| 132 | # ifdef __USE_XOPEN2K8 | |
| 126 | 133 | /* Nanosecond resolution timestamps are stored in a format |
| 127 | 134 | equivalent to 'struct timespec'. This is the type used |
| 128 | 135 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -132,19 +139,20 @@ struct stat64 |
| 132 | 139 | struct timespec st_atim;		/* Time of last access. */ |
| 133 | 140 | struct timespec st_mtim;		/* Time of last modification. */ |
| 134 | 141 | struct timespec st_ctim;		/* Time of last status change. */ |
| 135 | # else | |
| 142 | # else | |
| 136 | 143 | __time_t st_atime;			/* Time of last access. */ |
| 137 | 144 | __syscall_ulong_t st_atimensec;	/* Nscecs of last access. */ |
| 138 | 145 | __time_t st_mtime;			/* Time of last modification. */ |
| 139 | 146 | __syscall_ulong_t st_mtimensec;	/* Nsecs of last modification. */ |
| 140 | 147 | __time_t st_ctime;			/* Time of last status change. */ |
| 141 | 148 | __syscall_ulong_t st_ctimensec;	/* Nsecs of last status change. */ |
| 142 | # endif | |
| 143 | # ifdef __x86_64__ | |
| 149 | # endif | |
| 150 | # ifdef __x86_64__ | |
| 144 | 151 | __syscall_slong_t __glibc_reserved[3]; |
| 145 | # else | |
| 152 | # else | |
| 146 | 153 | __ino64_t st_ino;			/* File serial number.		*/ |
| 147 | # endif | |
| 154 | # endif | |
| 155 | # endif /* __USE_TIME_BITS64 */ | |
| 148 | 156 | }; |
| 149 | 157 | #endif |
| 150 | 158 |
lib/libc/include/i386-linux-gnu/bits/types/struct_semid_ds.h+4| ... | ... | @@ -23,6 +23,9 @@ |
| 23 | 23 | /* Data structure describing a set of semaphores. */ |
| 24 | 24 | struct semid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm sem_perm; /* operation permission struct */ |
| 27 | 30 | __time_t sem_otime; /* last semop() time */ |
| 28 | 31 | __syscall_ulong_t __sem_otime_high; |
| ... | ... | @@ -31,4 +34,5 @@ struct semid_ds |
| 31 | 34 | __syscall_ulong_t sem_nsems; /* number of semaphores in set */ |
| 32 | 35 | __syscall_ulong_t __glibc_reserved3; |
| 33 | 36 | __syscall_ulong_t __glibc_reserved4; |
| 37 | #endif | |
| 34 | 38 | }; |
| \ No newline at end of file |
lib/libc/include/m68k-linux-gnu/bits/floatn.h created+52| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Defined to 1 if the current compiler invocation provides a | |
| 20 | floating-point type with the IEEE 754 binary128 format, and this glibc | |
| 21 | includes corresponding *f128 interfaces for it. */ | |
| 22 | #define __HAVE_FLOAT128 0 | |
| 23 | ||
| 24 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 25 | from the default float, double and long double types in this glibc. */ | |
| 26 | #define __HAVE_DISTINCT_FLOAT128 0 | |
| 27 | ||
| 28 | /* Defined to 1 if the current compiler invocation provides a | |
| 29 | floating-point type with the right format for _Float64x, and this | |
| 30 | glibc includes corresponding *f64x interfaces for it. */ | |
| 31 | #define __HAVE_FLOAT64X 0 | |
| 32 | ||
| 33 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 34 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 35 | the format of _Float128, which must be different from that of long | |
| 36 | double. */ | |
| 37 | #define __HAVE_FLOAT64X_LONG_DOUBLE 0 | |
| 38 | ||
| 39 | #ifndef __ASSEMBLER__ | |
| 40 | ||
| 41 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 42 | types, if __HAVE_FLOAT128 is 1. | |
| 43 | E.g.: #define __f128(x) x##f128. */ | |
| 44 | # undef __f128 | |
| 45 | ||
| 46 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. | |
| 47 | E.g.: #define __CFLOAT128 _Complex _Float128. */ | |
| 48 | # undef __CFLOAT128 | |
| 49 | ||
| 50 | #endif /* !__ASSEMBLER__. */ | |
| 51 | ||
| 52 | #include <bits/floatn-common.h> | |
| \ No newline at end of file |
lib/libc/include/m68k-linux-gnu/bits/struct_rwlock.h created+61| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | /* Default read-write lock implementation struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __RWLOCK_INTERNAL_H | |
| 20 | #define __RWLOCK_INTERNAL_H | |
| 21 | ||
| 22 | #include <bits/endian.h> | |
| 23 | ||
| 24 | /* Generic struct for both POSIX read-write lock. New ports are expected | |
| 25 | to use the default layout, however archictetures can redefine it to add | |
| 26 | arch-specific extensions (such as lock-elision). The struct have a size | |
| 27 | of 32 bytes on both LP32 and LP64 architectures. */ | |
| 28 | ||
| 29 | struct __pthread_rwlock_arch_t | |
| 30 | { | |
| 31 | unsigned int __readers; | |
| 32 | unsigned int __writers; | |
| 33 | unsigned int __wrphase_futex; | |
| 34 | unsigned int __writers_futex; | |
| 35 | unsigned int __pad3; | |
| 36 | unsigned int __pad4; | |
| 37 | /* FLAGS must stay at its position in the structure to maintain | |
| 38 | binary compatibility. */ | |
| 39 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 40 | unsigned char __pad1; | |
| 41 | unsigned char __pad2; | |
| 42 | unsigned char __shared; | |
| 43 | unsigned char __flags; | |
| 44 | #else | |
| 45 | unsigned char __flags; | |
| 46 | unsigned char __shared; | |
| 47 | unsigned char __pad1; | |
| 48 | unsigned char __pad2; | |
| 49 | #endif | |
| 50 | int __cur_writer; | |
| 51 | }; | |
| 52 | ||
| 53 | #if __BYTE_ORDER == __BIG_ENDIAN | |
| 54 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 55 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 56 | #else | |
| 57 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 58 | 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 | |
| 59 | #endif | |
| 60 | ||
| 61 | #endif | |
| \ No newline at end of file |
lib/libc/include/m68k-linux-gnu/bits/struct_stat.h+29-21| ... | ... | @@ -25,32 +25,35 @@ |
| 25 | 25 | |
| 26 | 26 | struct stat |
| 27 | 27 | { |
| 28 | #ifdef __USE_TIME_BITS64 | |
| 29 | # include <bits/struct_stat_time64_helper.h> | |
| 30 | #else | |
| 28 | 31 | __dev_t st_dev;			/* Device. */ |
| 29 | 32 | unsigned short int __pad1; |
| 30 | #ifndef __USE_FILE_OFFSET64 | |
| 33 | # ifndef __USE_FILE_OFFSET64 | |
| 31 | 34 | __ino_t st_ino;			/* File serial number.	*/ |
| 32 | #else | |
| 35 | # else | |
| 33 | 36 | __ino_t __st_ino;			/* 32bit file serial number.	*/ |
| 34 | #endif | |
| 37 | # endif | |
| 35 | 38 | __mode_t st_mode;			/* File mode. */ |
| 36 | 39 | __nlink_t st_nlink;			/* Link count. */ |
| 37 | 40 | __uid_t st_uid;			/* User ID of the file's owner.	*/ |
| 38 | 41 | __gid_t st_gid;			/* Group ID of the file's group.*/ |
| 39 | 42 | __dev_t st_rdev;			/* Device number, if device. */ |
| 40 | 43 | unsigned short int __pad2; |
| 41 | #ifndef __USE_FILE_OFFSET64 | |
| 44 | # ifndef __USE_FILE_OFFSET64 | |
| 42 | 45 | __off_t st_size;			/* Size of file, in bytes. */ |
| 43 | #else | |
| 46 | # else | |
| 44 | 47 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 45 | #endif | |
| 48 | # endif | |
| 46 | 49 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 47 | 50 | |
| 48 | #ifndef __USE_FILE_OFFSET64 | |
| 51 | # ifndef __USE_FILE_OFFSET64 | |
| 49 | 52 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 50 | #else | |
| 53 | # else | |
| 51 | 54 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 52 | #endif | |
| 53 | #ifdef __USE_XOPEN2K8 | |
| 55 | # endif | |
| 56 | # ifdef __USE_XOPEN2K8 | |
| 54 | 57 | /* Nanosecond resolution timestamps are stored in a format |
| 55 | 58 | equivalent to 'struct timespec'. This is the type used |
| 56 | 59 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -60,28 +63,32 @@ struct stat |
| 60 | 63 | struct timespec st_atim;		/* Time of last access. */ |
| 61 | 64 | struct timespec st_mtim;		/* Time of last modification. */ |
| 62 | 65 | struct timespec st_ctim;		/* Time of last status change. */ |
| 63 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 64 | # define st_mtime st_mtim.tv_sec | |
| 65 | # define st_ctime st_ctim.tv_sec | |
| 66 | #else | |
| 66 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 67 | # define st_mtime st_mtim.tv_sec | |
| 68 | # define st_ctime st_ctim.tv_sec | |
| 69 | # else | |
| 67 | 70 | __time_t st_atime;			/* Time of last access. */ |
| 68 | 71 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 69 | 72 | __time_t st_mtime;			/* Time of last modification. */ |
| 70 | 73 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 71 | 74 | __time_t st_ctime;			/* Time of last status change. */ |
| 72 | 75 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 73 | #endif | |
| 74 | #ifndef __USE_FILE_OFFSET64 | |
| 76 | # endif | |
| 77 | # ifndef __USE_FILE_OFFSET64 | |
| 75 | 78 | unsigned long int __glibc_reserved4; |
| 76 | 79 | unsigned long int __glibc_reserved5; |
| 77 | #else | |
| 80 | # else | |
| 78 | 81 | __ino64_t st_ino;			/* File serial number.	*/ |
| 79 | #endif | |
| 82 | # endif | |
| 83 | #endif /* __USE_TIME_BITS64 */ | |
| 80 | 84 | }; |
| 81 | 85 | |
| 82 | 86 | #ifdef __USE_LARGEFILE64 |
| 83 | 87 | struct stat64 |
| 84 | 88 | { |
| 89 | # ifdef __USE_TIME_BITS64 | |
| 90 | # include <bits/struct_stat_time64_helper.h> | |
| 91 | # else | |
| 85 | 92 | __dev_t st_dev;			/* Device. */ |
| 86 | 93 | unsigned short int __pad1; |
| 87 | 94 | |
| ... | ... | @@ -96,7 +103,7 @@ struct stat64 |
| 96 | 103 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 97 | 104 | |
| 98 | 105 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 99 | # ifdef __USE_XOPEN2K8 | |
| 106 | # ifdef __USE_XOPEN2K8 | |
| 100 | 107 | /* Nanosecond resolution timestamps are stored in a format |
| 101 | 108 | equivalent to 'struct timespec'. This is the type used |
| 102 | 109 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -106,15 +113,16 @@ struct stat64 |
| 106 | 113 | struct timespec st_atim;		/* Time of last access. */ |
| 107 | 114 | struct timespec st_mtim;		/* Time of last modification. */ |
| 108 | 115 | struct timespec st_ctim;		/* Time of last status change. */ |
| 109 | # else | |
| 116 | # else | |
| 110 | 117 | __time_t st_atime;			/* Time of last access. */ |
| 111 | 118 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 112 | 119 | __time_t st_mtime;			/* Time of last modification. */ |
| 113 | 120 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 114 | 121 | __time_t st_ctime;			/* Time of last status change. */ |
| 115 | 122 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 116 | # endif | |
| 123 | # endif | |
| 117 | 124 | __ino64_t st_ino;			/* File serial number.		*/ |
| 125 | # endif /* __USE_TIME_BITS64 */ | |
| 118 | 126 | }; |
| 119 | 127 | #endif |
| 120 | 128 |
lib/libc/include/m68k-linux-gnu/bits/wordsize.h created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #define __WORDSIZE			32 | |
| 19 | #define __WORDSIZE_TIME64_COMPAT32	0 | |
| 20 | #define __WORDSIZE32_SIZE_ULONG		0 | |
| 21 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| \ No newline at end of file |
lib/libc/include/m68k-linux-gnu/gnu/lib-names.h+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | #define LIBANL_SO "libanl.so.1" |
| 9 | 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 10 | 10 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | 12 | #define LIBC_SO "libc.so.6" |
| 12 | 13 | #define LIBDL_SO "libdl.so.2" |
| 13 | 14 | #define LIBGCC_S_SO "libgcc_s.so.2" |
lib/libc/include/mips-linux-gnu/bits/dlfcn.h deleted-64| ... | ... | @@ -1,64 +0,0 @@ |
| 1 | /* System dependent definitions for run-time dynamic loading. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _DLFCN_H | |
| 20 | # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The MODE argument to `dlopen' contains one of the following: */ | |
| 24 | #define RTLD_LAZY	0x0001	/* Lazy function call binding. */ | |
| 25 | #define RTLD_NOW	0x0002	/* Immediate function call binding. */ | |
| 26 | #define RTLD_BINDING_MASK 0x3	/* Mask of binding time value. */ | |
| 27 | #define RTLD_NOLOAD	0x00008	/* Do not load the object. */ | |
| 28 | #define RTLD_DEEPBIND	0x00010	/* Use deep binding. */ | |
| 29 | ||
| 30 | /* If the following bit is set in the MODE argument to `dlopen', | |
| 31 | the symbols of the loaded object and its dependencies are made | |
| 32 | visible as if the object were linked directly into the program. */ | |
| 33 | #define RTLD_GLOBAL	0x0004 | |
| 34 | ||
| 35 | /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. | |
| 36 | The implementation does this by default and so we can define the | |
| 37 | value to zero. */ | |
| 38 | #define RTLD_LOCAL 0 | |
| 39 | ||
| 40 | /* Do not delete object when closed. */ | |
| 41 | #define RTLD_NODELETE	0x01000 | |
| 42 | ||
| 43 | #ifdef __USE_GNU | |
| 44 | /* To support profiling of shared objects it is a good idea to call | |
| 45 | the function found using `dlsym' using the following macro since | |
| 46 | these calls do not use the PLT. But this would mean the dynamic | |
| 47 | loader has no chance to find out when the function is called. The | |
| 48 | macro applies the necessary magic so that profiling is possible. | |
| 49 | Rewrite | |
| 50 | 	foo = (*fctp) (arg1, arg2); | |
| 51 | into | |
| 52 | foo = DL_CALL_FCT (fctp, (arg1, arg2)); | |
| 53 | */ | |
| 54 | # define DL_CALL_FCT(fctp, args) \ | |
| 55 | (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args) | |
| 56 | ||
| 57 | __BEGIN_DECLS | |
| 58 | ||
| 59 | /* This function calls the profiling functions. */ | |
| 60 | extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW; | |
| 61 | ||
| 62 | __END_DECLS | |
| 63 | ||
| 64 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/errno.h deleted-52| ... | ... | @@ -1,52 +0,0 @@ |
| 1 | /* Error constants. MIPS/Linux specific version. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_ERRNO_H | |
| 20 | ||
| 21 | #if !defined _ERRNO_H | |
| 22 | # error "Never include <bits/errno.h> directly; use <errno.h> instead." | |
| 23 | #endif | |
| 24 | ||
| 25 | # include <linux/errno.h> | |
| 26 | ||
| 27 | /* Older Linux headers do not define these constants. */ | |
| 28 | # ifndef ENOTSUP | |
| 29 | # define ENOTSUP		EOPNOTSUPP | |
| 30 | # endif | |
| 31 | ||
| 32 | # ifndef ECANCELED | |
| 33 | # define ECANCELED		158 | |
| 34 | # endif | |
| 35 | ||
| 36 | # ifndef EOWNERDEAD | |
| 37 | # define EOWNERDEAD		165 | |
| 38 | # endif | |
| 39 | ||
| 40 | # ifndef ENOTRECOVERABLE | |
| 41 | # define ENOTRECOVERABLE	166 | |
| 42 | # endif | |
| 43 | ||
| 44 | # ifndef ERFKILL | |
| 45 | # define ERFKILL		167 | |
| 46 | # endif | |
| 47 | ||
| 48 | # ifndef EHWPOISON | |
| 49 | # define EHWPOISON		168 | |
| 50 | # endif | |
| 51 | ||
| 52 | #endif /* bits/errno.h. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/eventfd.h deleted-31| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | /* Copyright (C) 2007-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_EVENTFD_H | |
| 19 | # error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for eventfd. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | EFD_SEMAPHORE = 00000001, | |
| 26 | #define EFD_SEMAPHORE EFD_SEMAPHORE | |
| 27 | EFD_CLOEXEC = 02000000, | |
| 28 | #define EFD_CLOEXEC EFD_CLOEXEC | |
| 29 | EFD_NONBLOCK = 00000200 | |
| 30 | #define EFD_NONBLOCK EFD_NONBLOCK | |
| 31 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/floatn.h deleted-97| ... | ... | @@ -1,97 +0,0 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features on MIPS platforms. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_FLOATN_H | |
| 20 | #define _BITS_FLOATN_H | |
| 21 | ||
| 22 | #include <features.h> | |
| 23 | #include <bits/long-double.h> | |
| 24 | ||
| 25 | /* Defined to 1 if the current compiler invocation provides a | |
| 26 | floating-point type with the IEEE 754 binary128 format, and this | |
| 27 | glibc includes corresponding *f128 interfaces for it. */ | |
| 28 | #ifndef __NO_LONG_DOUBLE_MATH | |
| 29 | # define __HAVE_FLOAT128 1 | |
| 30 | #else | |
| 31 | /* glibc does not support _Float128 for platforms where long double is | |
| 32 | normally binary128 when building with long double as binary64. | |
| 33 | GCC's default for supported scalar modes does not support it either | |
| 34 | in that case. */ | |
| 35 | # define __HAVE_FLOAT128 0 | |
| 36 | #endif | |
| 37 | ||
| 38 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 39 | from the default float, double and long double types in this glibc. */ | |
| 40 | #define __HAVE_DISTINCT_FLOAT128 0 | |
| 41 | ||
| 42 | /* Defined to 1 if the current compiler invocation provides a | |
| 43 | floating-point type with the right format for _Float64x, and this | |
| 44 | glibc includes corresponding *f64x interfaces for it. */ | |
| 45 | #define __HAVE_FLOAT64X __HAVE_FLOAT128 | |
| 46 | ||
| 47 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 48 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 49 | the format of _Float128, which must be different from that of long | |
| 50 | double. */ | |
| 51 | #define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128 | |
| 52 | ||
| 53 | #ifndef __ASSEMBLER__ | |
| 54 | ||
| 55 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 56 | types, if __HAVE_FLOAT128 is 1. */ | |
| 57 | # if __HAVE_FLOAT128 | |
| 58 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 59 | /* The literal suffix f128 exists only since GCC 7.0. */ | |
| 60 | # define __f128(x) x##l | |
| 61 | # else | |
| 62 | # define __f128(x) x##f128 | |
| 63 | # endif | |
| 64 | # endif | |
| 65 | ||
| 66 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ | |
| 67 | # if __HAVE_FLOAT128 | |
| 68 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 69 | # define __CFLOAT128 _Complex long double | |
| 70 | # else | |
| 71 | # define __CFLOAT128 _Complex _Float128 | |
| 72 | # endif | |
| 73 | # endif | |
| 74 | ||
| 75 | /* The remaining of this file provides support for older compilers. */ | |
| 76 | # if __HAVE_FLOAT128 | |
| 77 | ||
| 78 | /* The type _Float128 exists only since GCC 7.0. */ | |
| 79 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 80 | typedef long double _Float128; | |
| 81 | # endif | |
| 82 | ||
| 83 | /* Various built-in functions do not exist before GCC 7.0. */ | |
| 84 | # if !__GNUC_PREREQ (7, 0) | |
| 85 | # define __builtin_huge_valf128() (__builtin_huge_vall ()) | |
| 86 | # define __builtin_inff128() (__builtin_infl ()) | |
| 87 | # define __builtin_nanf128(x) (__builtin_nanl (x)) | |
| 88 | # define __builtin_nansf128(x) (__builtin_nansl (x)) | |
| 89 | # endif | |
| 90 | ||
| 91 | # endif | |
| 92 | ||
| 93 | #endif /* !__ASSEMBLER__. */ | |
| 94 | ||
| 95 | #include <bits/floatn-common.h> | |
| 96 | ||
| 97 | #endif /* _BITS_FLOATN_H */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/inotify.h deleted-29| ... | ... | @@ -1,29 +0,0 @@ |
| 1 | /* Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_INOTIFY_H | |
| 19 | # error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for the parameter of inotify_init1. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | IN_CLOEXEC = 02000000, | |
| 26 | #define IN_CLOEXEC IN_CLOEXEC | |
| 27 | IN_NONBLOCK = 00000200 | |
| 28 | #define IN_NONBLOCK IN_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/ioctl-types.h deleted-75| ... | ... | @@ -1,75 +0,0 @@ |
| 1 | /* Structure types for pre-termios terminal ioctls. Linux/MIPS version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_IOCTL_H | |
| 20 | # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Get definition of constants for use with `ioctl'. */ | |
| 24 | #include <asm/ioctls.h> | |
| 25 | ||
| 26 | struct winsize | |
| 27 | { | |
| 28 | unsigned short int ws_row; | |
| 29 | unsigned short int ws_col; | |
| 30 | unsigned short int ws_xpixel; | |
| 31 | unsigned short int ws_ypixel; | |
| 32 | }; | |
| 33 | ||
| 34 | #define NCC	8 | |
| 35 | struct termio | |
| 36 | { | |
| 37 | unsigned short int c_iflag;		/* input mode flags */ | |
| 38 | unsigned short int c_oflag;		/* output mode flags */ | |
| 39 | unsigned short int c_cflag;		/* control mode flags */ | |
| 40 | unsigned short int c_lflag;		/* local mode flags */ | |
| 41 | char c_line;			/* line discipline */ | |
| 42 | /* Yes, this is really NCCS. */ | |
| 43 | unsigned char c_cc[32 /* NCCS */]; /* control characters */ | |
| 44 | }; | |
| 45 | ||
| 46 | /* modem lines */ | |
| 47 | #define TIOCM_LE	0x001		/* line enable */ | |
| 48 | #define TIOCM_DTR	0x002		/* data terminal ready */ | |
| 49 | #define TIOCM_RTS	0x004		/* request to send */ | |
| 50 | #define TIOCM_ST	0x010		/* secondary transmit */ | |
| 51 | #define TIOCM_SR	0x020		/* secondary receive */ | |
| 52 | #define TIOCM_CTS	0x040		/* clear to send */ | |
| 53 | #define TIOCM_CAR	0x100		/* carrier detect */ | |
| 54 | #define TIOCM_CD	TIOCM_CAR | |
| 55 | #define TIOCM_RNG	0x200		/* ring */ | |
| 56 | #define TIOCM_RI	TIOCM_RNG | |
| 57 | #define TIOCM_DSR	0x400		/* data set ready */ | |
| 58 | ||
| 59 | /* line disciplines */ | |
| 60 | #define N_TTY		0 | |
| 61 | #define N_SLIP		1 | |
| 62 | #define N_MOUSE		2 | |
| 63 | #define N_PPP		3 | |
| 64 | #define N_STRIP		4 | |
| 65 | #define N_AX25		5 | |
| 66 | #define N_X25		6	/* X.25 async */ | |
| 67 | #define N_6PACK		7 | |
| 68 | #define N_MASC		8	/* Mobitex module */ | |
| 69 | #define N_R3964		9	/* Simatic R3964 module */ | |
| 70 | #define N_PROFIBUS_FDL	10	/* Profibus */ | |
| 71 | #define N_IRDA		11	/* Linux IR */ | |
| 72 | #define N_SMSBLOCK	12	/* SMS block mode */ | |
| 73 | #define N_HDLC		13	/* synchronous HDLC */ | |
| 74 | #define N_SYNC_PPP	14	/* synchronous PPP */ | |
| 75 | #define	N_HCI		15	/* Bluetooth HCI UART */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/ipctypes.h deleted-31| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | /* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. MIPS version | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* | |
| 20 | * Never include <bits/ipctypes.h> directly. | |
| 21 | */ | |
| 22 | ||
| 23 | #ifndef _BITS_IPCTYPES_H | |
| 24 | #define _BITS_IPCTYPES_H	1 | |
| 25 | ||
| 26 | #include <bits/types.h> | |
| 27 | ||
| 28 | typedef __SLONG32_TYPE __ipc_pid_t; | |
| 29 | ||
| 30 | ||
| 31 | #endif /* bits/ipctypes.h */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/local_lim.h deleted-99| ... | ... | @@ -1,99 +0,0 @@ |
| 1 | /* Minimum guaranteed maximum values for system limits. MIPS Linux version. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* The kernel header pollutes the namespace with the NR_OPEN symbol | |
| 20 | and defines LINK_MAX although filesystems have different maxima. A | |
| 21 | similar thing is true for OPEN_MAX: the limit can be changed at | |
| 22 | runtime and therefore the macro must not be defined. Remove this | |
| 23 | after including the header if necessary. */ | |
| 24 | #ifndef NR_OPEN | |
| 25 | # define __undef_NR_OPEN | |
| 26 | #endif | |
| 27 | #ifndef LINK_MAX | |
| 28 | # define __undef_LINK_MAX | |
| 29 | #endif | |
| 30 | #ifndef OPEN_MAX | |
| 31 | # define __undef_OPEN_MAX | |
| 32 | #endif | |
| 33 | #ifndef ARG_MAX | |
| 34 | # define __undef_ARG_MAX | |
| 35 | #endif | |
| 36 | ||
| 37 | /* The kernel sources contain a file with all the needed information. */ | |
| 38 | #include <linux/limits.h> | |
| 39 | ||
| 40 | /* Have to remove NR_OPEN? */ | |
| 41 | #ifdef __undef_NR_OPEN | |
| 42 | # undef NR_OPEN | |
| 43 | # undef __undef_NR_OPEN | |
| 44 | #endif | |
| 45 | /* Have to remove LINK_MAX? */ | |
| 46 | #ifdef __undef_LINK_MAX | |
| 47 | # undef LINK_MAX | |
| 48 | # undef __undef_LINK_MAX | |
| 49 | #endif | |
| 50 | /* Have to remove OPEN_MAX? */ | |
| 51 | #ifdef __undef_OPEN_MAX | |
| 52 | # undef OPEN_MAX | |
| 53 | # undef __undef_OPEN_MAX | |
| 54 | #endif | |
| 55 | /* Have to remove ARG_MAX? */ | |
| 56 | #ifdef __undef_ARG_MAX | |
| 57 | # undef ARG_MAX | |
| 58 | # undef __undef_ARG_MAX | |
| 59 | #endif | |
| 60 | ||
| 61 | /* The number of data keys per process. */ | |
| 62 | #define _POSIX_THREAD_KEYS_MAX	128 | |
| 63 | /* This is the value this implementation supports. */ | |
| 64 | #define PTHREAD_KEYS_MAX	1024 | |
| 65 | ||
| 66 | /* Controlling the iterations of destructors for thread-specific data. */ | |
| 67 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4 | |
| 68 | /* Number of iterations this implementation does. */ | |
| 69 | #define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS | |
| 70 | ||
| 71 | /* The number of threads per process. */ | |
| 72 | #define _POSIX_THREAD_THREADS_MAX	64 | |
| 73 | /* We have no predefined limit on the number of threads. */ | |
| 74 | #undef PTHREAD_THREADS_MAX | |
| 75 | ||
| 76 | /* Maximum amount by which a process can descrease its asynchronous I/O | |
| 77 | priority level. */ | |
| 78 | #define AIO_PRIO_DELTA_MAX	20 | |
| 79 | ||
| 80 | /* Minimum size for a thread. At least two pages with 64k pages. */ | |
| 81 | #define PTHREAD_STACK_MIN	131072 | |
| 82 | ||
| 83 | /* Maximum number of timer expiration overruns. */ | |
| 84 | #define DELAYTIMER_MAX	2147483647 | |
| 85 | ||
| 86 | /* Maximum tty name length. */ | |
| 87 | #define TTY_NAME_MAX		32 | |
| 88 | ||
| 89 | /* Maximum login name length. This is arbitrary. */ | |
| 90 | #define LOGIN_NAME_MAX		256 | |
| 91 | ||
| 92 | /* Maximum host name length. */ | |
| 93 | #define HOST_NAME_MAX		64 | |
| 94 | ||
| 95 | /* Maximum message queue priority level. */ | |
| 96 | #define MQ_PRIO_MAX		32768 | |
| 97 | ||
| 98 | /* Maximum value the semaphore can have. */ | |
| 99 | #define SEM_VALUE_MAX (2147483647) | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/mman.h deleted-48| ... | ... | @@ -1,48 +0,0 @@ |
| 1 | /* Definitions for POSIX memory map interface. Linux/MIPS version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MMAN_H | |
| 20 | # error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The following definitions basically come from the kernel headers. | |
| 24 | But the kernel header is not namespace clean. */ | |
| 25 | ||
| 26 | /* These are Linux-specific. */ | |
| 27 | #ifdef __USE_MISC | |
| 28 | # define MAP_NORESERVE	0x0400		/* don't check for reservations */ | |
| 29 | # define MAP_GROWSDOWN	0x1000		/* stack-like segment */ | |
| 30 | # define MAP_DENYWRITE	0x2000		/* ETXTBSY */ | |
| 31 | # define MAP_EXECUTABLE	0x4000		/* mark it as an executable */ | |
| 32 | # define MAP_LOCKED	0x8000		/* pages are locked */ | |
| 33 | # define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ | |
| 34 | # define MAP_NONBLOCK 0x20000 /* do not block on IO */ | |
| 35 | # define MAP_STACK	0x40000		/* Allocation is for a stack. */ | |
| 36 | # define MAP_HUGETLB	0x80000		/* Create huge page mapping. */ | |
| 37 | # define MAP_FIXED_NOREPLACE 0x100000	/* MAP_FIXED but do not unmap | |
| 38 | 					 underlying mapping. */ | |
| 39 | #endif | |
| 40 | ||
| 41 | #define __MAP_ANONYMOUS 0x0800 | |
| 42 | ||
| 43 | /* Include generic Linux declarations. */ | |
| 44 | #include <bits/mman-linux.h> | |
| 45 | ||
| 46 | #ifdef __USE_MISC | |
| 47 | # define MAP_RENAME	MAP_ANONYMOUS | |
| 48 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/poll.h deleted-49| ... | ... | @@ -1,49 +0,0 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_POLL_H | |
| 19 | # error "Never use <bits/poll.h> directly; include <sys/poll.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Event types that can be polled for. These bits may be set in `events' | |
| 23 | to indicate the interesting event types; they will appear in `revents' | |
| 24 | to indicate the status of the file descriptor. */ | |
| 25 | #define POLLIN		0x001		/* There is data to read. */ | |
| 26 | #define POLLPRI		0x002		/* There is urgent data to read. */ | |
| 27 | #define POLLOUT		0x004		/* Writing now will not block. */ | |
| 28 | ||
| 29 | #if defined __USE_XOPEN || defined __USE_XOPEN2K8 | |
| 30 | /* These values are defined in XPG4.2. */ | |
| 31 | # define POLLRDNORM	0x040		/* Normal data may be read. */ | |
| 32 | # define POLLRDBAND	0x080		/* Priority data may be read. */ | |
| 33 | # define POLLWRNORM	POLLOUT		/* Writing now will not block. */ | |
| 34 | # define POLLWRBAND	0x100		/* Priority data may be written. */ | |
| 35 | #endif | |
| 36 | ||
| 37 | #ifdef __USE_GNU | |
| 38 | /* These are extensions for Linux. */ | |
| 39 | # define POLLMSG	0x400 | |
| 40 | # define POLLREMOVE	0x1000 | |
| 41 | # define POLLRDHUP	0x2000 | |
| 42 | #endif | |
| 43 | ||
| 44 | /* Event types always implicitly polled for. These bits need not be set in | |
| 45 | `events', but they will appear in `revents' to indicate the status of | |
| 46 | the file descriptor. */ | |
| 47 | #define POLLERR		0x008		/* Error condition. */ | |
| 48 | #define POLLHUP		0x010		/* Hung up. */ | |
| 49 | #define POLLNVAL	0x020		/* Invalid polling request. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/pthreadtypes-arch.h deleted-44| ... | ... | @@ -1,44 +0,0 @@ |
| 1 | /* Machine-specific pthread type layouts. MIPS version. | |
| 2 | Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_PTHREADTYPES_ARCH_H | |
| 20 | #define _BITS_PTHREADTYPES_ARCH_H	1 | |
| 21 | ||
| 22 | #include <bits/endian.h> | |
| 23 | ||
| 24 | #if _MIPS_SIM == _ABI64 | |
| 25 | # define __SIZEOF_PTHREAD_ATTR_T 56 | |
| 26 | # define __SIZEOF_PTHREAD_MUTEX_T 40 | |
| 27 | # define __SIZEOF_PTHREAD_RWLOCK_T 56 | |
| 28 | # define __SIZEOF_PTHREAD_BARRIER_T 32 | |
| 29 | #else | |
| 30 | # define __SIZEOF_PTHREAD_ATTR_T 36 | |
| 31 | # define __SIZEOF_PTHREAD_MUTEX_T 24 | |
| 32 | # define __SIZEOF_PTHREAD_RWLOCK_T 32 | |
| 33 | # define __SIZEOF_PTHREAD_BARRIER_T 20 | |
| 34 | #endif | |
| 35 | #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 | |
| 36 | #define __SIZEOF_PTHREAD_COND_T 48 | |
| 37 | #define __SIZEOF_PTHREAD_CONDATTR_T 4 | |
| 38 | #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 | |
| 39 | #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 | |
| 40 | ||
| 41 | #define __LOCK_ALIGNMENT | |
| 42 | #define __ONCE_ALIGNMENT | |
| 43 | ||
| 44 | #endif	/* bits/pthreadtypes.h */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/resource.h deleted-231| ... | ... | @@ -1,231 +0,0 @@ |
| 1 | /* Bit values & structures for resource limits. Linux/MIPS version. | |
| 2 | Copyright (C) 1994-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_RESOURCE_H | |
| 20 | # error "Never use <bits/resource.h> directly; include <sys/resource.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/types.h> | |
| 24 | ||
| 25 | /* Transmute defines to enumerations. The macro re-definitions are | |
| 26 | necessary because some programs want to test for operating system | |
| 27 | features with #ifdef RUSAGE_SELF. In ISO C the reflexive | |
| 28 | definition is a no-op. */ | |
| 29 | ||
| 30 | /* Kinds of resource limit. */ | |
| 31 | enum __rlimit_resource | |
| 32 | { | |
| 33 | /* Per-process CPU limit, in seconds. */ | |
| 34 | RLIMIT_CPU = 0, | |
| 35 | #define RLIMIT_CPU RLIMIT_CPU | |
| 36 | ||
| 37 | /* Largest file that can be created, in bytes. */ | |
| 38 | RLIMIT_FSIZE = 1, | |
| 39 | #define	RLIMIT_FSIZE RLIMIT_FSIZE | |
| 40 | ||
| 41 | /* Maximum size of data segment, in bytes. */ | |
| 42 | RLIMIT_DATA = 2, | |
| 43 | #define	RLIMIT_DATA RLIMIT_DATA | |
| 44 | ||
| 45 | /* Maximum size of stack segment, in bytes. */ | |
| 46 | RLIMIT_STACK = 3, | |
| 47 | #define	RLIMIT_STACK RLIMIT_STACK | |
| 48 | ||
| 49 | /* Largest core file that can be created, in bytes. */ | |
| 50 | RLIMIT_CORE = 4, | |
| 51 | #define	RLIMIT_CORE RLIMIT_CORE | |
| 52 | ||
| 53 | /* Largest resident set size, in bytes. | |
| 54 | This affects swapping; processes that are exceeding their | |
| 55 | resident set size will be more likely to have physical memory | |
| 56 | taken from them. */ | |
| 57 | __RLIMIT_RSS = 7, | |
| 58 | #define	RLIMIT_RSS __RLIMIT_RSS | |
| 59 | ||
| 60 | /* Number of open files. */ | |
| 61 | RLIMIT_NOFILE = 5, | |
| 62 | __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ | |
| 63 | #define RLIMIT_NOFILE RLIMIT_NOFILE | |
| 64 | #define RLIMIT_OFILE __RLIMIT_OFILE | |
| 65 | ||
| 66 | /* Address space limit (?) */ | |
| 67 | RLIMIT_AS = 6, | |
| 68 | #define RLIMIT_AS RLIMIT_AS | |
| 69 | ||
| 70 | /* Number of processes. */ | |
| 71 | __RLIMIT_NPROC = 8, | |
| 72 | #define RLIMIT_NPROC __RLIMIT_NPROC | |
| 73 | ||
| 74 | /* Locked-in-memory address space. */ | |
| 75 | __RLIMIT_MEMLOCK = 9, | |
| 76 | #define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK | |
| 77 | ||
| 78 | /* Maximum number of file locks. */ | |
| 79 | __RLIMIT_LOCKS = 10, | |
| 80 | #define RLIMIT_LOCKS __RLIMIT_LOCKS | |
| 81 | ||
| 82 | /* Maximum number of pending signals. */ | |
| 83 | __RLIMIT_SIGPENDING = 11, | |
| 84 | #define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING | |
| 85 | ||
| 86 | /* Maximum bytes in POSIX message queues. */ | |
| 87 | __RLIMIT_MSGQUEUE = 12, | |
| 88 | #define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE | |
| 89 | ||
| 90 | /* Maximum nice priority allowed to raise to. | |
| 91 | Nice levels 19 .. -20 correspond to 0 .. 39 | |
| 92 | values of this resource limit. */ | |
| 93 | __RLIMIT_NICE = 13, | |
| 94 | #define RLIMIT_NICE __RLIMIT_NICE | |
| 95 | ||
| 96 | /* Maximum realtime priority allowed for non-priviledged | |
| 97 | processes. */ | |
| 98 | __RLIMIT_RTPRIO = 14, | |
| 99 | #define RLIMIT_RTPRIO __RLIMIT_RTPRIO | |
| 100 | ||
| 101 | /* Maximum CPU time in microseconds that a process scheduled under a real-time | |
| 102 | scheduling policy may consume without making a blocking system | |
| 103 | call before being forcibly descheduled. */ | |
| 104 | __RLIMIT_RTTIME = 15, | |
| 105 | #define RLIMIT_RTTIME __RLIMIT_RTTIME | |
| 106 | ||
| 107 | __RLIMIT_NLIMITS = 16, | |
| 108 | __RLIM_NLIMITS = __RLIMIT_NLIMITS | |
| 109 | #define RLIMIT_NLIMITS __RLIMIT_NLIMITS | |
| 110 | #define RLIM_NLIMITS __RLIM_NLIMITS | |
| 111 | }; | |
| 112 | ||
| 113 | /* Value to indicate that there is no limit. */ | |
| 114 | #if _MIPS_SIM == _ABI64 | |
| 115 | /* The N64 syscall uses this value. */ | |
| 116 | # define RLIM_INFINITY 0xffffffffffffffffUL | |
| 117 | # ifdef __USE_LARGEFILE64 | |
| 118 | # define RLIM64_INFINITY 0xffffffffffffffffUL | |
| 119 | # endif | |
| 120 | #else | |
| 121 | /* The O32 and N32 syscalls use 0x7fffffff. */ | |
| 122 | # ifndef __USE_FILE_OFFSET64 | |
| 123 | # define RLIM_INFINITY ((long int)(~0UL >> 1)) | |
| 124 | # else | |
| 125 | # define RLIM_INFINITY 0xffffffffffffffffULL | |
| 126 | # endif | |
| 127 | # ifdef __USE_LARGEFILE64 | |
| 128 | # define RLIM64_INFINITY 0xffffffffffffffffULL | |
| 129 | # endif | |
| 130 | #endif | |
| 131 | ||
| 132 | /* We can represent all limits. */ | |
| 133 | #define RLIM_SAVED_MAX	RLIM_INFINITY | |
| 134 | #define RLIM_SAVED_CUR	RLIM_INFINITY | |
| 135 | ||
| 136 | ||
| 137 | /* Type for resource quantity measurement. */ | |
| 138 | #ifndef __USE_FILE_OFFSET64 | |
| 139 | typedef __rlim_t rlim_t; | |
| 140 | #else | |
| 141 | typedef __rlim64_t rlim_t; | |
| 142 | #endif | |
| 143 | #ifdef __USE_LARGEFILE64 | |
| 144 | typedef __rlim64_t rlim64_t; | |
| 145 | #endif | |
| 146 | ||
| 147 | struct rlimit | |
| 148 | { | |
| 149 | /* The current (soft) limit. */ | |
| 150 | rlim_t rlim_cur; | |
| 151 | /* The hard limit. */ | |
| 152 | rlim_t rlim_max; | |
| 153 | }; | |
| 154 | ||
| 155 | #ifdef __USE_LARGEFILE64 | |
| 156 | struct rlimit64 | |
| 157 | { | |
| 158 | /* The current (soft) limit. */ | |
| 159 | rlim64_t rlim_cur; | |
| 160 | /* The hard limit. */ | |
| 161 | rlim64_t rlim_max; | |
| 162 | }; | |
| 163 | #endif | |
| 164 | ||
| 165 | /* Whose usage statistics do you want? */ | |
| 166 | enum __rusage_who | |
| 167 | { | |
| 168 | /* The calling process. */ | |
| 169 | RUSAGE_SELF = 0, | |
| 170 | #define RUSAGE_SELF RUSAGE_SELF | |
| 171 | ||
| 172 | /* All of its terminated child processes. */ | |
| 173 | RUSAGE_CHILDREN = -1 | |
| 174 | #define RUSAGE_CHILDREN RUSAGE_CHILDREN | |
| 175 | ||
| 176 | #ifdef __USE_GNU | |
| 177 | , | |
| 178 | /* The calling thread. */ | |
| 179 | RUSAGE_THREAD = 1 | |
| 180 | # define RUSAGE_THREAD RUSAGE_THREAD | |
| 181 | /* Name for the same functionality on Solaris. */ | |
| 182 | # define RUSAGE_LWP RUSAGE_THREAD | |
| 183 | #endif | |
| 184 | }; | |
| 185 | ||
| 186 | #include <bits/types/struct_timeval.h> | |
| 187 | #include <bits/types/struct_rusage.h> | |
| 188 | ||
| 189 | /* Priority limits. */ | |
| 190 | #define PRIO_MIN	-20	/* Minimum priority a process can have. */ | |
| 191 | #define PRIO_MAX	20	/* Maximum priority a process can have. */ | |
| 192 | ||
| 193 | /* The type of the WHICH argument to `getpriority' and `setpriority', | |
| 194 | indicating what flavor of entity the WHO argument specifies. */ | |
| 195 | enum __priority_which | |
| 196 | { | |
| 197 | PRIO_PROCESS = 0,		/* WHO is a process ID. */ | |
| 198 | #define PRIO_PROCESS PRIO_PROCESS | |
| 199 | PRIO_PGRP = 1,		/* WHO is a process group ID. */ | |
| 200 | #define PRIO_PGRP PRIO_PGRP | |
| 201 | PRIO_USER = 2			/* WHO is a user ID. */ | |
| 202 | #define PRIO_USER PRIO_USER | |
| 203 | }; | |
| 204 | ||
| 205 | ||
| 206 | __BEGIN_DECLS | |
| 207 | ||
| 208 | #ifdef __USE_GNU | |
| 209 | /* Modify and return resource limits of a process atomically. */ | |
| 210 | # ifndef __USE_FILE_OFFSET64 | |
| 211 | extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, | |
| 212 | 		 const struct rlimit *__new_limit, | |
| 213 | 		 struct rlimit *__old_limit) __THROW; | |
| 214 | # else | |
| 215 | # ifdef __REDIRECT_NTH | |
| 216 | extern int __REDIRECT_NTH (prlimit, (__pid_t __pid, | |
| 217 | 				 enum __rlimit_resource __resource, | |
| 218 | 				 const struct rlimit *__new_limit, | |
| 219 | 				 struct rlimit *__old_limit), prlimit64); | |
| 220 | # else | |
| 221 | # define prlimit prlimit64 | |
| 222 | # endif | |
| 223 | # endif | |
| 224 | # ifdef __USE_LARGEFILE64 | |
| 225 | extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource, | |
| 226 | 		 const struct rlimit64 *__new_limit, | |
| 227 | 		 struct rlimit64 *__old_limit) __THROW; | |
| 228 | # endif | |
| 229 | #endif | |
| 230 | ||
| 231 | __END_DECLS | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/semaphore.h deleted-36| ... | ... | @@ -1,36 +0,0 @@ |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SEMAPHORE_H | |
| 19 | # error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #if _MIPS_SIM == _ABI64 | |
| 23 | # define __SIZEOF_SEM_T	32 | |
| 24 | #else | |
| 25 | # define __SIZEOF_SEM_T	16 | |
| 26 | #endif | |
| 27 | ||
| 28 | /* Value returned if `sem_open' failed. */ | |
| 29 | #define SEM_FAILED ((sem_t *) 0) | |
| 30 | ||
| 31 | ||
| 32 | typedef union | |
| 33 | { | |
| 34 | char __size[__SIZEOF_SEM_T]; | |
| 35 | long int __align; | |
| 36 | } sem_t; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/shmlba.h deleted-24| ... | ... | @@ -1,24 +0,0 @@ |
| 1 | /* Define SHMLBA. MIPS version. | |
| 2 | Copyright (C) 2018-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never use <bits/shmlba.h> directly; include <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Segment low boundary address multiple. */ | |
| 24 | #define SHMLBA		0x40000 | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/sigaction.h deleted-94| ... | ... | @@ -1,94 +0,0 @@ |
| 1 | /* The proper definitions for Linux/MIPS's sigaction. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGACTION_H | |
| 20 | #define _BITS_SIGACTION_H 1 | |
| 21 | ||
| 22 | #ifndef _SIGNAL_H | |
| 23 | # error "Never include <bits/sigaction.h> directly; use <signal.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Structure describing the action to be taken when a signal arrives. */ | |
| 27 | struct sigaction | |
| 28 | { | |
| 29 | /* Special flags. */ | |
| 30 | int sa_flags; | |
| 31 | ||
| 32 | /* Signal handler. */ | |
| 33 | #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED | |
| 34 | union | |
| 35 | { | |
| 36 | 	/* Used if SA_SIGINFO is not set. */ | |
| 37 | 	__sighandler_t sa_handler; | |
| 38 | 	/* Used if SA_SIGINFO is set. */ | |
| 39 | 	void (*sa_sigaction) (int, siginfo_t *, void *); | |
| 40 | } | |
| 41 | __sigaction_handler; | |
| 42 | # define sa_handler __sigaction_handler.sa_handler | |
| 43 | # define sa_sigaction __sigaction_handler.sa_sigaction | |
| 44 | #else | |
| 45 | __sighandler_t sa_handler; | |
| 46 | #endif | |
| 47 | /* Additional set of signals to be blocked. */ | |
| 48 | __sigset_t sa_mask; | |
| 49 | ||
| 50 | /* The ABI says here are two unused ints following. */ | |
| 51 | /* Restore handler. */ | |
| 52 | void (*sa_restorer) (void); | |
| 53 | ||
| 54 | #if _MIPS_SZPTR < 64 | |
| 55 | int sa_resv[1]; | |
| 56 | #endif | |
| 57 | }; | |
| 58 | ||
| 59 | /* Bits in `sa_flags'. */ | |
| 60 | /* Please note that some Linux kernels versions use different values for these | |
| 61 | flags which is a bug in those kernel versions. */ | |
| 62 | #define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */ | |
| 63 | #define SA_NOCLDWAIT 0x00010000 /* Don't create zombie on child death. */ | |
| 64 | #define SA_SIGINFO 0x00000008 /* Invoke signal-catching function with | |
| 65 | 				 three arguments instead of one. */ | |
| 66 | #if defined __USE_XOPEN_EXTENDED || defined __USE_MISC | |
| 67 | # define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ | |
| 68 | #endif | |
| 69 | #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 | |
| 70 | # define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ | |
| 71 | # define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ | |
| 72 | # define SA_NODEFER 0x40000000 /* Don't automatically block the signal when | |
| 73 | 				 its handler is being executed. */ | |
| 74 | #endif | |
| 75 | #ifdef __USE_MISC | |
| 76 | # define SA_INTERRUPT 0x20000000 /* Historical no-op. */ | |
| 77 | ||
| 78 | /* Some aliases for the SA_ constants. */ | |
| 79 | # define SA_NOMASK SA_NODEFER | |
| 80 | # define SA_ONESHOT SA_RESETHAND | |
| 81 | # define SA_STACK SA_ONSTACK | |
| 82 | #endif | |
| 83 | ||
| 84 | /* Values for the HOW argument to `sigprocmask'. */ | |
| 85 | #define SIG_NOP	 0		/* 0 is unused to catch errors */ | |
| 86 | #define	SIG_BLOCK 1		/* Block signals. */ | |
| 87 | #define	SIG_UNBLOCK 2		/* Unblock signals. */ | |
| 88 | #define	SIG_SETMASK 3		/* Set the set of blocked signals. */ | |
| 89 | #ifdef __USE_MISC | |
| 90 | # define SIG_SETMASK32 256	/* Goodie from SGI for BSD compatibility: | |
| 91 | 				 set only the low 32 bit of the sigset. */ | |
| 92 | #endif | |
| 93 | ||
| 94 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/sigcontext.h deleted-82| ... | ... | @@ -1,82 +0,0 @@ |
| 1 | /* Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. | |
| 2 | ||
| 3 | The GNU C Library is free software; you can redistribute it and/or | |
| 4 | modify it under the terms of the GNU Lesser General Public | |
| 5 | License as published by the Free Software Foundation; either | |
| 6 | version 2.1 of the License, or (at your option) any later version. | |
| 7 | ||
| 8 | The GNU C Library is distributed in the hope that it will be useful, | |
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 11 | Lesser General Public License for more details. | |
| 12 | ||
| 13 | You should have received a copy of the GNU Lesser General Public | |
| 14 | License along with the GNU C Library. If not, see | |
| 15 | <https://www.gnu.org/licenses/>. */ | |
| 16 | ||
| 17 | #ifndef _BITS_SIGCONTEXT_H | |
| 18 | #define _BITS_SIGCONTEXT_H 1 | |
| 19 | ||
| 20 | #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H | |
| 21 | # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." | |
| 22 | #endif | |
| 23 | ||
| 24 | #include <sgidefs.h> | |
| 25 | ||
| 26 | #if _MIPS_SIM == _ABIO32 | |
| 27 | ||
| 28 | /* Certain unused fields were replaced with new ones in 2.6.12-rc4. | |
| 29 | The changes were as follows: | |
| 30 | ||
| 31 | sc_cause -> sc_hi1 | |
| 32 | sc_badvaddr -> sc_lo1 | |
| 33 | sc_sigset[0] -> sc_hi2 | |
| 34 | sc_sigset[1] -> sc_lo2 | |
| 35 | sc_sigset[2] -> sc_hi3 | |
| 36 | sc_sigset[3] -> sc_lo3 | |
| 37 | ||
| 38 | sc_regmask, sc_ownedfp and sc_fpc_eir are not used. */ | |
| 39 | struct sigcontext { | |
| 40 | unsigned int sc_regmask; | |
| 41 | unsigned int sc_status; | |
| 42 | __extension__ unsigned long long sc_pc; | |
| 43 | __extension__ unsigned long long sc_regs[32]; | |
| 44 | __extension__ unsigned long long sc_fpregs[32]; | |
| 45 | unsigned int sc_ownedfp; | |
| 46 | unsigned int sc_fpc_csr; | |
| 47 | unsigned int sc_fpc_eir; | |
| 48 | unsigned int sc_used_math; | |
| 49 | unsigned int sc_dsp; | |
| 50 | __extension__ unsigned long long sc_mdhi; | |
| 51 | __extension__ unsigned long long sc_mdlo; | |
| 52 | unsigned long sc_hi1; | |
| 53 | unsigned long sc_lo1; | |
| 54 | unsigned long sc_hi2; | |
| 55 | unsigned long sc_lo2; | |
| 56 | unsigned long sc_hi3; | |
| 57 | unsigned long sc_lo3; | |
| 58 | }; | |
| 59 | ||
| 60 | #else | |
| 61 | ||
| 62 | /* This structure changed in 2.6.12-rc4 when DSP support was added. */ | |
| 63 | struct sigcontext { | |
| 64 | __extension__ unsigned long long sc_regs[32]; | |
| 65 | __extension__ unsigned long long sc_fpregs[32]; | |
| 66 | __extension__ unsigned long long sc_mdhi; | |
| 67 | __extension__ unsigned long long sc_hi1; | |
| 68 | __extension__ unsigned long long sc_hi2; | |
| 69 | __extension__ unsigned long long sc_hi3; | |
| 70 | __extension__ unsigned long long sc_mdlo; | |
| 71 | __extension__ unsigned long long sc_lo1; | |
| 72 | __extension__ unsigned long long sc_lo2; | |
| 73 | __extension__ unsigned long long sc_lo3; | |
| 74 | __extension__ unsigned long long sc_pc; | |
| 75 | unsigned int sc_fpc_csr; | |
| 76 | unsigned int sc_used_math; | |
| 77 | unsigned int sc_dsp; | |
| 78 | unsigned int sc_reserved; | |
| 79 | }; | |
| 80 | ||
| 81 | #endif /* _MIPS_SIM != _ABIO32 */ | |
| 82 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/siginfo-arch.h deleted-13| ... | ... | @@ -1,13 +0,0 @@ |
| 1 | /* Architecture-specific adjustments to siginfo_t. MIPS version. */ | |
| 2 | #ifndef _BITS_SIGINFO_ARCH_H | |
| 3 | #define _BITS_SIGINFO_ARCH_H 1 | |
| 4 | ||
| 5 | /* MIPS has the si_code and si_errno fields in the opposite order from | |
| 6 | all other architectures. */ | |
| 7 | #define __SI_ERRNO_THEN_CODE 0 | |
| 8 | ||
| 9 | /* MIPS also has different values for SI_ASYNCIO, SI_MESGQ, and SI_TIMER | |
| 10 | than all other architectures. */ | |
| 11 | #define __SI_ASYNCIO_AFTER_SIGIO 0 | |
| 12 | ||
| 13 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/signalfd.h deleted-29| ... | ... | @@ -1,29 +0,0 @@ |
| 1 | /* Copyright (C) 2007-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_SIGNALFD_H | |
| 19 | # error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for signalfd. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | SFD_CLOEXEC = 02000000, | |
| 26 | #define SFD_CLOEXEC SFD_CLOEXEC | |
| 27 | SFD_NONBLOCK = 00000200 | |
| 28 | #define SFD_NONBLOCK SFD_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/signum-arch.h deleted-65| ... | ... | @@ -1,65 +0,0 @@ |
| 1 | /* Signal number definitions. Linux/MIPS version. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGNUM_H | |
| 20 | #define _BITS_SIGNUM_H 1 | |
| 21 | ||
| 22 | #ifndef _SIGNAL_H | |
| 23 | #error "Never include <bits/signum.h> directly; use <signal.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Adjustments and additions to the signal number constants for | |
| 27 | Linux/MIPS. */ | |
| 28 | ||
| 29 | #define SIGEMT		 7	/* Emulator trap. */ | |
| 30 | #define SIGPWR		19	/* Power failure imminent. */ | |
| 31 | ||
| 32 | /* Historical signals specified by POSIX. */ | |
| 33 | #define SIGBUS 	10	/* Bus error. */ | |
| 34 | #define SIGSYS		12	/* Bad system call. */ | |
| 35 | ||
| 36 | /* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ | |
| 37 | #define SIGURG		21	/* Urgent data is available at a socket. */ | |
| 38 | #define SIGSTOP		23	/* Stop, unblockable. */ | |
| 39 | #define SIGTSTP		24	/* Keyboard stop. */ | |
| 40 | #define SIGCONT		25	/* Continue. */ | |
| 41 | #define SIGCHLD		18	/* Child terminated or stopped. */ | |
| 42 | #define SIGTTIN		26	/* Background read from control terminal. */ | |
| 43 | #define SIGTTOU		27	/* Background write to control terminal. */ | |
| 44 | #define SIGPOLL		22	/* Pollable event occurred (System V). */ | |
| 45 | #define SIGXCPU		30	/* CPU time limit exceeded. */ | |
| 46 | #define SIGVTALRM	28	/* Virtual timer expired. */ | |
| 47 | #define SIGPROF		29	/* Profiling timer expired. */ | |
| 48 | #define SIGXFSZ		31	/* File size limit exceeded. */ | |
| 49 | #define SIGUSR1		16	/* User-defined signal 1. */ | |
| 50 | #define SIGUSR2		17	/* User-defined signal 2. */ | |
| 51 | ||
| 52 | /* Nonstandard signals found in all modern POSIX systems | |
| 53 | (including both BSD and Linux). */ | |
| 54 | #define SIGWINCH	20	/* Window size change (4.3 BSD, Sun). */ | |
| 55 | ||
| 56 | /* Archaic names for compatibility. */ | |
| 57 | #define SIGIO		SIGPOLL	/* I/O now possible (4.2 BSD). */ | |
| 58 | #define SIGIOT		SIGABRT	/* IOT instruction, abort() on a PDP-11. */ | |
| 59 | #define SIGCLD		SIGCHLD /* Old System V name */ | |
| 60 | ||
| 61 | /* By default no real-time signals are supported. */ | |
| 62 | #define __SIGRTMIN	32 | |
| 63 | #define __SIGRTMAX	127 | |
| 64 | ||
| 65 | #endif	/* <signal.h> included. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/socket-constants.h deleted-38| ... | ... | @@ -1,38 +0,0 @@ |
| 1 | /* Socket constants which vary among Linux architectures. Version for MIPS. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define SOL_SOCKET 65535 | |
| 24 | #define SO_ACCEPTCONN 4105 | |
| 25 | #define SO_BROADCAST 32 | |
| 26 | #define SO_DONTROUTE 16 | |
| 27 | #define SO_ERROR 4103 | |
| 28 | #define SO_KEEPALIVE 8 | |
| 29 | #define SO_LINGER 128 | |
| 30 | #define SO_OOBINLINE 256 | |
| 31 | #define SO_RCVBUF 4098 | |
| 32 | #define SO_RCVLOWAT 4100 | |
| 33 | #define SO_RCVTIMEO 4102 | |
| 34 | #define SO_REUSEADDR 4 | |
| 35 | #define SO_SNDBUF 4097 | |
| 36 | #define SO_SNDLOWAT 4099 | |
| 37 | #define SO_SNDTIMEO 4101 | |
| 38 | #define SO_TYPE 4104 | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/socket_type.h deleted-55| ... | ... | @@ -1,55 +0,0 @@ |
| 1 | /* Define enum __socket_type for Linux/MIPS. | |
| 2 | Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Types of sockets. */ | |
| 24 | enum __socket_type | |
| 25 | { | |
| 26 | SOCK_DGRAM = 1,		/* Connectionless, unreliable datagrams | |
| 27 | 				 of fixed maximum length. */ | |
| 28 | #define SOCK_DGRAM SOCK_DGRAM | |
| 29 | SOCK_STREAM = 2,		/* Sequenced, reliable, connection-based | |
| 30 | 				 byte streams. */ | |
| 31 | #define SOCK_STREAM SOCK_STREAM | |
| 32 | SOCK_RAW = 3,			/* Raw protocol interface. */ | |
| 33 | #define SOCK_RAW SOCK_RAW | |
| 34 | SOCK_RDM = 4,			/* Reliably-delivered messages. */ | |
| 35 | #define SOCK_RDM SOCK_RDM | |
| 36 | SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based, | |
| 37 | 				 datagrams of fixed maximum length. */ | |
| 38 | #define SOCK_SEQPACKET SOCK_SEQPACKET | |
| 39 | SOCK_DCCP = 6, | |
| 40 | #define SOCK_DCCP SOCK_DCCP	/* Datagram Congestion Control Protocol. */ | |
| 41 | SOCK_PACKET = 10,		/* Linux specific way of getting packets | |
| 42 | 				 at the dev level. For writing rarp and | |
| 43 | 				 other similar things on the user level. */ | |
| 44 | #define SOCK_PACKET SOCK_PACKET | |
| 45 | ||
| 46 | /* Flags to be ORed into the type parameter of socket and socketpair and | |
| 47 | used for the flags parameter of paccept. */ | |
| 48 | ||
| 49 | SOCK_CLOEXEC = 02000000,	/* Atomically set close-on-exec flag for the | |
| 50 | 				 new descriptor(s). */ | |
| 51 | #define SOCK_CLOEXEC SOCK_CLOEXEC | |
| 52 | SOCK_NONBLOCK = 00000200	/* Atomically mark descriptor(s) as | |
| 53 | 				 non-blocking. */ | |
| 54 | #define SOCK_NONBLOCK SOCK_NONBLOCK | |
| 55 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/statfs.h deleted-73| ... | ... | @@ -1,73 +0,0 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_STATFS_H | |
| 19 | # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #include <bits/types.h> /* for __fsid_t and __fsblkcnt_t*/ | |
| 23 | ||
| 24 | struct statfs | |
| 25 | { | |
| 26 | long int f_type; | |
| 27 | #define f_fstyp f_type | |
| 28 | long int f_bsize; | |
| 29 | long int f_frsize;	/* Fragment size - unsupported */ | |
| 30 | #ifndef __USE_FILE_OFFSET64 | |
| 31 | __fsblkcnt_t f_blocks; | |
| 32 | __fsblkcnt_t f_bfree; | |
| 33 | __fsblkcnt_t f_files; | |
| 34 | __fsblkcnt_t f_ffree; | |
| 35 | __fsblkcnt_t f_bavail; | |
| 36 | #else | |
| 37 | __fsblkcnt64_t f_blocks; | |
| 38 | __fsblkcnt64_t f_bfree; | |
| 39 | __fsblkcnt64_t f_files; | |
| 40 | __fsblkcnt64_t f_ffree; | |
| 41 | __fsblkcnt64_t f_bavail; | |
| 42 | #endif | |
| 43 | ||
| 44 | 	/* Linux specials */ | |
| 45 | __fsid_t f_fsid; | |
| 46 | long int f_namelen; | |
| 47 | long int f_flags; | |
| 48 | long int f_spare[5]; | |
| 49 | }; | |
| 50 | ||
| 51 | #ifdef __USE_LARGEFILE64 | |
| 52 | struct statfs64 | |
| 53 | { | |
| 54 | long int f_type; | |
| 55 | #define f_fstyp f_type | |
| 56 | long int f_bsize; | |
| 57 | long int f_frsize;	/* Fragment size - unsupported */ | |
| 58 | __fsblkcnt64_t f_blocks; | |
| 59 | __fsblkcnt64_t f_bfree; | |
| 60 | __fsblkcnt64_t f_files; | |
| 61 | __fsblkcnt64_t f_ffree; | |
| 62 | __fsblkcnt64_t f_bavail; | |
| 63 | ||
| 64 | 	/* Linux specials */ | |
| 65 | __fsid_t f_fsid; | |
| 66 | long int f_namelen; | |
| 67 | long int f_flags; | |
| 68 | long int f_spare[5]; | |
| 69 | }; | |
| 70 | #endif | |
| 71 | ||
| 72 | /* Tell code we have these members. */ | |
| 73 | #define _STATFS_F_NAMELEN | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/struct_mutex.h deleted-56| ... | ... | @@ -1,56 +0,0 @@ |
| 1 | /* MIPS internal mutex struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _THREAD_MUTEX_INTERNAL_H | |
| 20 | #define _THREAD_MUTEX_INTERNAL_H 1 | |
| 21 | ||
| 22 | struct __pthread_mutex_s | |
| 23 | { | |
| 24 | int __lock; | |
| 25 | unsigned int __count; | |
| 26 | int __owner; | |
| 27 | #if _MIPS_SIM == _ABI64 | |
| 28 | unsigned int __nusers; | |
| 29 | #endif | |
| 30 | /* KIND must stay at this position in the structure to maintain | |
| 31 | binary compatibility with static initializers. */ | |
| 32 | int __kind; | |
| 33 | #if _MIPS_SIM == _ABI64 | |
| 34 | int __spins; | |
| 35 | __pthread_list_t __list; | |
| 36 | # define __PTHREAD_MUTEX_HAVE_PREV 1 | |
| 37 | #else | |
| 38 | unsigned int __nusers; | |
| 39 | __extension__ union | |
| 40 | { | |
| 41 | int __spins; | |
| 42 | __pthread_slist_t __list; | |
| 43 | }; | |
| 44 | # define __PTHREAD_MUTEX_HAVE_PREV 0 | |
| 45 | #endif | |
| 46 | }; | |
| 47 | ||
| 48 | #if _MIPS_SIM == _ABI64 | |
| 49 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 50 | 0, 0, 0, 0, __kind, 0, { 0, 0 } | |
| 51 | #else | |
| 52 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 53 | 0, 0, 0, __kind, 0, { 0 } | |
| 54 | #endif | |
| 55 | ||
| 56 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/struct_rwlock.h deleted-71| ... | ... | @@ -1,71 +0,0 @@ |
| 1 | /* MIPS internal rwlock struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _RWLOCK_INTERNAL_H | |
| 20 | #define _RWLOCK_INTERNAL_H | |
| 21 | ||
| 22 | struct __pthread_rwlock_arch_t | |
| 23 | { | |
| 24 | unsigned int __readers; | |
| 25 | unsigned int __writers; | |
| 26 | unsigned int __wrphase_futex; | |
| 27 | unsigned int __writers_futex; | |
| 28 | unsigned int __pad3; | |
| 29 | unsigned int __pad4; | |
| 30 | #if _MIPS_SIM == _ABI64 | |
| 31 | int __cur_writer; | |
| 32 | int __shared; | |
| 33 | unsigned long int __pad1; | |
| 34 | unsigned long int __pad2; | |
| 35 | /* FLAGS must stay at this position in the structure to maintain | |
| 36 | binary compatibility. */ | |
| 37 | unsigned int __flags; | |
| 38 | # else | |
| 39 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 40 | unsigned char __pad1; | |
| 41 | unsigned char __pad2; | |
| 42 | unsigned char __shared; | |
| 43 | /* FLAGS must stay at this position in the structure to maintain | |
| 44 | binary compatibility. */ | |
| 45 | unsigned char __flags; | |
| 46 | # else | |
| 47 | /* FLAGS must stay at this position in the structure to maintain | |
| 48 | binary compatibility. */ | |
| 49 | unsigned char __flags; | |
| 50 | unsigned char __shared; | |
| 51 | unsigned char __pad1; | |
| 52 | unsigned char __pad2; | |
| 53 | # endif | |
| 54 | int __cur_writer; | |
| 55 | #endif | |
| 56 | }; | |
| 57 | ||
| 58 | #if _MIPS_SIM == _ABI64 | |
| 59 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 60 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags | |
| 61 | #else | |
| 62 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 63 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 64 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 65 | # else | |
| 66 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 67 | 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 | |
| 68 | # endif | |
| 69 | #endif | |
| 70 | ||
| 71 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/termios-c_cc.h deleted-43| ... | ... | @@ -1,43 +0,0 @@ |
| 1 | /* termios c_cc symbolic constant definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_cc.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_cc characters */ | |
| 24 | #define VINTR		0	/* Interrupt character [ISIG]. */ | |
| 25 | #define VQUIT		1	/* Quit character [ISIG]. */ | |
| 26 | #define VERASE		2	/* Erase character [ICANON]. */ | |
| 27 | #define VKILL		3	/* Kill-line character [ICANON]. */ | |
| 28 | #define VMIN		4	/* Minimum number of bytes read at once [!ICANON]. */ | |
| 29 | #define VTIME		5	/* Time-out value (tenths of a second) [!ICANON]. */ | |
| 30 | #define VEOL2		6	/* Second EOL character [ICANON]. */ | |
| 31 | #define VSWTC		7 | |
| 32 | #define VSWTCH		VSWTC | |
| 33 | #define VSTART		8	/* Start (X-ON) character [IXON, IXOFF]. */ | |
| 34 | #define VSTOP		9	/* Stop (X-OFF) character [IXON, IXOFF]. */ | |
| 35 | #define VSUSP		10	/* Suspend character [ISIG]. */ | |
| 36 | 				/* VDSUSP is not supported on Linux. */ | |
| 37 | /* #define VDSUSP	11	/ * Delayed suspend character [ISIG]. */ | |
| 38 | #define VREPRINT	12	/* Reprint-line character [ICANON]. */ | |
| 39 | #define VDISCARD	13	/* Discard character [IEXTEN]. */ | |
| 40 | #define VWERASE		14	/* Word-erase character [ICANON]. */ | |
| 41 | #define VLNEXT		15	/* Literal-next character [IEXTEN]. */ | |
| 42 | #define VEOF		16	/* End-of-file character [ICANON]. */ | |
| 43 | #define VEOL		17	/* End-of-line character [ICANON]. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/termios-c_lflag.h deleted-46| ... | ... | @@ -1,46 +0,0 @@ |
| 1 | /* termios local mode definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_lflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_lflag bits */ | |
| 24 | #define ISIG	0000001		/* Enable signals. */ | |
| 25 | #define ICANON	0000002		/* Do erase and kill processing. */ | |
| 26 | #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) | |
| 27 | # define XCASE	0000004 | |
| 28 | #endif | |
| 29 | #define ECHO	0000010		/* Enable echo. */ | |
| 30 | #define ECHOE	0000020		/* Visual erase for ERASE. */ | |
| 31 | #define ECHOK	0000040		/* Echo NL after KILL. */ | |
| 32 | #define ECHONL	0000100		/* Echo NL even if ECHO is off. */ | |
| 33 | #define NOFLSH	0000200		/* Disable flush after interrupt. */ | |
| 34 | #define IEXTEN	0000400		/* Enable DISCARD and LNEXT. */ | |
| 35 | #ifdef __USE_MISC | |
| 36 | # define ECHOCTL 0001000	/* Echo control characters as ^X. */ | |
| 37 | # define ECHOPRT 0002000	/* Hardcopy visual erase. */ | |
| 38 | # define ECHOKE	 0004000	/* Visual erase for KILL. */ | |
| 39 | # define FLUSHO	0020000 | |
| 40 | # define PENDIN	0040000		/* Retype pending input (state). */ | |
| 41 | #endif | |
| 42 | #define TOSTOP	0100000		/* Send SIGTTOU for background output. */ | |
| 43 | #define ITOSTOP	TOSTOP | |
| 44 | #ifdef __USE_MISC | |
| 45 | # define EXTPROC 0200000 | |
| 46 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/termios-struct.h deleted-34| ... | ... | @@ -1,34 +0,0 @@ |
| 1 | /* struct termios definition. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-struct.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define NCCS 32 | |
| 24 | struct termios | |
| 25 | { | |
| 26 | tcflag_t c_iflag;		/* input mode flags */ | |
| 27 | tcflag_t c_oflag;		/* output mode flags */ | |
| 28 | tcflag_t c_cflag;		/* control mode flags */ | |
| 29 | tcflag_t c_lflag;		/* local mode flags */ | |
| 30 | cc_t c_line;		/* line discipline */ | |
| 31 | cc_t c_cc[NCCS];		/* control characters */ | |
| 32 | #define _HAVE_STRUCT_TERMIOS_C_ISPEED 0 | |
| 33 | #define _HAVE_STRUCT_TERMIOS_C_OSPEED 0 | |
| 34 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/termios-tcflow.h deleted-26| ... | ... | @@ -1,26 +0,0 @@ |
| 1 | /* termios local mode definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-tcflow.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* tcsetattr uses these */ | |
| 24 | #define	TCSANOW		0x540e	/* Same as TCSETS; change immediately. */ | |
| 25 | #define	TCSADRAIN	0x540f	/* Same as TCSETSW; change when pending output is written. */ | |
| 26 | #define	TCSAFLUSH	0x5410	/* Same as TCSETSF; flush pending input before changing. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/timerfd.h deleted-29| ... | ... | @@ -1,29 +0,0 @@ |
| 1 | /* Copyright (C) 2008-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_TIMERFD_H | |
| 19 | # error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Bits to be set in the FLAGS parameter of `timerfd_create'. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | TFD_CLOEXEC = 02000000, | |
| 26 | #define TFD_CLOEXEC TFD_CLOEXEC | |
| 27 | TFD_NONBLOCK = 00000200 | |
| 28 | #define TFD_NONBLOCK TFD_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/types/stack_t.h deleted-33| ... | ... | @@ -1,33 +0,0 @@ |
| 1 | /* Define stack_t. MIPS Linux version. | |
| 2 | Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __stack_t_defined | |
| 20 | #define __stack_t_defined 1 | |
| 21 | ||
| 22 | #define __need_size_t | |
| 23 | #include <stddef.h> | |
| 24 | ||
| 25 | /* Structure describing a signal stack. */ | |
| 26 | typedef struct | |
| 27 | { | |
| 28 | void *ss_sp; | |
| 29 | size_t ss_size; | |
| 30 | int ss_flags; | |
| 31 | } stack_t; | |
| 32 | ||
| 33 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/types/struct_msqid_ds.h deleted-56| ... | ... | @@ -1,56 +0,0 @@ |
| 1 | /* Linux/MIPS implementation of the SysV message struct msqid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MSG_H | |
| 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Structure of record for one message inside the kernel. | |
| 24 | The type `struct msg' is opaque. */ | |
| 25 | struct msqid_ds | |
| 26 | { | |
| 27 | struct ipc_perm msg_perm;	/* structure describing operation permission */ | |
| 28 | #if __TIMESIZE == 32 | |
| 29 | # ifdef __MIPSEL__ | |
| 30 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 31 | unsigned long int __msg_stime_high; | |
| 32 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 33 | unsigned long int __msg_rtime_high; | |
| 34 | __time_t msg_ctime;		/* time of last change */ | |
| 35 | unsigned long int __msg_ctime_high; | |
| 36 | # else | |
| 37 | unsigned long int __msg_stime_high; | |
| 38 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 39 | unsigned long int __msg_rtime_high; | |
| 40 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 41 | unsigned long int __msg_ctime_high; | |
| 42 | __time_t msg_ctime;		/* time of last change */ | |
| 43 | # endif | |
| 44 | #else | |
| 45 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 46 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 47 | __time_t msg_ctime;		/* time of last change */ | |
| 48 | #endif | |
| 49 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ | |
| 50 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ | |
| 51 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ | |
| 52 | __pid_t msg_lspid;		/* pid of last msgsnd() */ | |
| 53 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ | |
| 54 | __syscall_ulong_t __glibc_reserved4; | |
| 55 | __syscall_ulong_t __glibc_reserved5; | |
| 56 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/types/struct_semid_ds.h deleted-32| ... | ... | @@ -1,32 +0,0 @@ |
| 1 | /* MIPS implementation of the semaphore struct semid_ds | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SEM_H | |
| 20 | # error "Never include <bits/types/struct_semid_ds.h> directly; use <sys/sem.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a set of semaphores. */ | |
| 24 | struct semid_ds | |
| 25 | { | |
| 26 | struct ipc_perm sem_perm;		/* operation permission struct */ | |
| 27 | __time_t sem_otime;	/* last semop() time */ | |
| 28 | __time_t sem_ctime;	/* last time changed by semctl() */ | |
| 29 | __syscall_ulong_t sem_nsems;		/* number of semaphores in set */ | |
| 30 | __syscall_ulong_t __sem_otime_high; | |
| 31 | __syscall_ulong_t __sem_ctime_high; | |
| 32 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/types/struct_shmid_ds.h deleted-49| ... | ... | @@ -1,49 +0,0 @@ |
| 1 | /* Linux/MIPS implementation of the shared memory struct shmid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never include <bits/types/struct_shmid_ds.h> directly; use <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a shared memory segment. */ | |
| 24 | struct shmid_ds | |
| 25 | { | |
| 26 | struct ipc_perm shm_perm;		/* operation permission struct */ | |
| 27 | size_t shm_segsz;			/* size of segment in bytes */ | |
| 28 | #if __TIMESIZE == 32 | |
| 29 | __time_t shm_atime;			/* time of last shmat() */ | |
| 30 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 31 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 32 | #else | |
| 33 | __time_t shm_atime;			/* time of last shmat() */ | |
| 34 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 35 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 36 | #endif | |
| 37 | __pid_t shm_cpid;			/* pid of creator */ | |
| 38 | __pid_t shm_lpid;			/* pid of last shmop */ | |
| 39 | shmatt_t shm_nattch;		/* number of current attaches */ | |
| 40 | #if __TIMESIZE == 32 | |
| 41 | unsigned short int __shm_atime_high; | |
| 42 | unsigned short int __shm_dtime_high; | |
| 43 | unsigned short int __shm_ctime_high; | |
| 44 | unsigned short int __glibc_reserved4; | |
| 45 | #else | |
| 46 | __syscall_ulong_t __glibc_reserved5; | |
| 47 | __syscall_ulong_t __glibc_reserved6; | |
| 48 | #endif | |
| 49 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/bits/wordsize.h deleted-31| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #include <sgidefs.h> | |
| 19 | ||
| 20 | #define __WORDSIZE			_MIPS_SZPTR | |
| 21 | ||
| 22 | #if _MIPS_SIM == _ABI64 | |
| 23 | # define __WORDSIZE_TIME64_COMPAT32	1 | |
| 24 | #else | |
| 25 | # define __WORDSIZE_TIME64_COMPAT32	0 | |
| 26 | #endif | |
| 27 | ||
| 28 | #if __WORDSIZE == 32 | |
| 29 | #define __WORDSIZE32_SIZE_ULONG		0 | |
| 30 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| 31 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnu/ieee754.h deleted-326| ... | ... | @@ -1,326 +0,0 @@ |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _IEEE754_H | |
| 19 | #define _IEEE754_H 1 | |
| 20 | ||
| 21 | #include <features.h> | |
| 22 | ||
| 23 | #include <bits/endian.h> | |
| 24 | ||
| 25 | #ifndef __LDBL_MANT_DIG__ | |
| 26 | # include <float.h> | |
| 27 | # define __LDBL_MANT_DIG__ LDBL_MANT_DIG | |
| 28 | #endif | |
| 29 | ||
| 30 | __BEGIN_DECLS | |
| 31 | ||
| 32 | union ieee754_float | |
| 33 | { | |
| 34 | float f; | |
| 35 | ||
| 36 | /* This is the IEEE 754 single-precision format. */ | |
| 37 | struct | |
| 38 | { | |
| 39 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 40 | 	unsigned int negative:1; | |
| 41 | 	unsigned int exponent:8; | |
| 42 | 	unsigned int mantissa:23; | |
| 43 | #endif				/* Big endian. */ | |
| 44 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 45 | 	unsigned int mantissa:23; | |
| 46 | 	unsigned int exponent:8; | |
| 47 | 	unsigned int negative:1; | |
| 48 | #endif				/* Little endian. */ | |
| 49 | } ieee; | |
| 50 | ||
| 51 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 52 | struct | |
| 53 | { | |
| 54 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 55 | 	unsigned int negative:1; | |
| 56 | 	unsigned int exponent:8; | |
| 57 | 	unsigned int quiet_nan:1; | |
| 58 | 	unsigned int mantissa:22; | |
| 59 | #endif				/* Big endian. */ | |
| 60 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 61 | 	unsigned int mantissa:22; | |
| 62 | 	unsigned int quiet_nan:1; | |
| 63 | 	unsigned int exponent:8; | |
| 64 | 	unsigned int negative:1; | |
| 65 | #endif				/* Little endian. */ | |
| 66 | } ieee_nan; | |
| 67 | }; | |
| 68 | ||
| 69 | #define IEEE754_FLOAT_BIAS	0x7f /* Added to exponent. */ | |
| 70 | ||
| 71 | ||
| 72 | union ieee754_double | |
| 73 | { | |
| 74 | double d; | |
| 75 | ||
| 76 | /* This is the IEEE 754 double-precision format. */ | |
| 77 | struct | |
| 78 | { | |
| 79 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 80 | 	unsigned int negative:1; | |
| 81 | 	unsigned int exponent:11; | |
| 82 | 	/* Together these comprise the mantissa. */ | |
| 83 | 	unsigned int mantissa0:20; | |
| 84 | 	unsigned int mantissa1:32; | |
| 85 | #endif				/* Big endian. */ | |
| 86 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 87 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 88 | 	unsigned int mantissa0:20; | |
| 89 | 	unsigned int exponent:11; | |
| 90 | 	unsigned int negative:1; | |
| 91 | 	unsigned int mantissa1:32; | |
| 92 | # else | |
| 93 | 	/* Together these comprise the mantissa. */ | |
| 94 | 	unsigned int mantissa1:32; | |
| 95 | 	unsigned int mantissa0:20; | |
| 96 | 	unsigned int exponent:11; | |
| 97 | 	unsigned int negative:1; | |
| 98 | # endif | |
| 99 | #endif				/* Little endian. */ | |
| 100 | } ieee; | |
| 101 | ||
| 102 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 103 | struct | |
| 104 | { | |
| 105 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 106 | 	unsigned int negative:1; | |
| 107 | 	unsigned int exponent:11; | |
| 108 | 	unsigned int quiet_nan:1; | |
| 109 | 	/* Together these comprise the mantissa. */ | |
| 110 | 	unsigned int mantissa0:19; | |
| 111 | 	unsigned int mantissa1:32; | |
| 112 | #else | |
| 113 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 114 | 	unsigned int mantissa0:19; | |
| 115 | 	unsigned int quiet_nan:1; | |
| 116 | 	unsigned int exponent:11; | |
| 117 | 	unsigned int negative:1; | |
| 118 | 	unsigned int mantissa1:32; | |
| 119 | # else | |
| 120 | 	/* Together these comprise the mantissa. */ | |
| 121 | 	unsigned int mantissa1:32; | |
| 122 | 	unsigned int mantissa0:19; | |
| 123 | 	unsigned int quiet_nan:1; | |
| 124 | 	unsigned int exponent:11; | |
| 125 | 	unsigned int negative:1; | |
| 126 | # endif | |
| 127 | #endif | |
| 128 | } ieee_nan; | |
| 129 | }; | |
| 130 | ||
| 131 | #define IEEE754_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 132 | ||
| 133 | #if __LDBL_MANT_DIG__ == 113 | |
| 134 | ||
| 135 | union ieee854_long_double | |
| 136 | { | |
| 137 | long double d; | |
| 138 | ||
| 139 | /* This is the IEEE 854 quad-precision format. */ | |
| 140 | struct | |
| 141 | { | |
| 142 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 143 | 	unsigned int negative:1; | |
| 144 | 	unsigned int exponent:15; | |
| 145 | 	/* Together these comprise the mantissa. */ | |
| 146 | 	unsigned int mantissa0:16; | |
| 147 | 	unsigned int mantissa1:32; | |
| 148 | 	unsigned int mantissa2:32; | |
| 149 | 	unsigned int mantissa3:32; | |
| 150 | #endif				/* Big endian. */ | |
| 151 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 152 | 	/* Together these comprise the mantissa. */ | |
| 153 | 	unsigned int mantissa3:32; | |
| 154 | 	unsigned int mantissa2:32; | |
| 155 | 	unsigned int mantissa1:32; | |
| 156 | 	unsigned int mantissa0:16; | |
| 157 | 	unsigned int exponent:15; | |
| 158 | 	unsigned int negative:1; | |
| 159 | #endif				/* Little endian. */ | |
| 160 | } ieee; | |
| 161 | ||
| 162 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 163 | struct | |
| 164 | { | |
| 165 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 166 | 	unsigned int negative:1; | |
| 167 | 	unsigned int exponent:15; | |
| 168 | 	unsigned int quiet_nan:1; | |
| 169 | 	/* Together these comprise the mantissa. */ | |
| 170 | 	unsigned int mantissa0:15; | |
| 171 | 	unsigned int mantissa1:32; | |
| 172 | 	unsigned int mantissa2:32; | |
| 173 | 	unsigned int mantissa3:32; | |
| 174 | #endif				/* Big endian. */ | |
| 175 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 176 | 	/* Together these comprise the mantissa. */ | |
| 177 | 	unsigned int mantissa3:32; | |
| 178 | 	unsigned int mantissa2:32; | |
| 179 | 	unsigned int mantissa1:32; | |
| 180 | 	unsigned int mantissa0:15; | |
| 181 | 	unsigned int quiet_nan:1; | |
| 182 | 	unsigned int exponent:15; | |
| 183 | 	unsigned int negative:1; | |
| 184 | #endif				/* Little endian. */ | |
| 185 | } ieee_nan; | |
| 186 | }; | |
| 187 | ||
| 188 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ | |
| 189 | ||
| 190 | #elif __LDBL_MANT_DIG__ == 64 | |
| 191 | ||
| 192 | union ieee854_long_double | |
| 193 | { | |
| 194 | long double d; | |
| 195 | ||
| 196 | /* This is the IEEE 854 double-extended-precision format. */ | |
| 197 | struct | |
| 198 | { | |
| 199 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 200 | 	unsigned int negative:1; | |
| 201 | 	unsigned int exponent:15; | |
| 202 | 	unsigned int empty:16; | |
| 203 | 	unsigned int mantissa0:32; | |
| 204 | 	unsigned int mantissa1:32; | |
| 205 | #endif | |
| 206 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 207 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 208 | 	unsigned int exponent:15; | |
| 209 | 	unsigned int negative:1; | |
| 210 | 	unsigned int empty:16; | |
| 211 | 	unsigned int mantissa0:32; | |
| 212 | 	unsigned int mantissa1:32; | |
| 213 | # else | |
| 214 | 	unsigned int mantissa1:32; | |
| 215 | 	unsigned int mantissa0:32; | |
| 216 | 	unsigned int exponent:15; | |
| 217 | 	unsigned int negative:1; | |
| 218 | 	unsigned int empty:16; | |
| 219 | # endif | |
| 220 | #endif | |
| 221 | } ieee; | |
| 222 | ||
| 223 | /* This is for NaNs in the IEEE 854 double-extended-precision format. */ | |
| 224 | struct | |
| 225 | { | |
| 226 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 227 | 	unsigned int negative:1; | |
| 228 | 	unsigned int exponent:15; | |
| 229 | 	unsigned int empty:16; | |
| 230 | 	unsigned int one:1; | |
| 231 | 	unsigned int quiet_nan:1; | |
| 232 | 	unsigned int mantissa0:30; | |
| 233 | 	unsigned int mantissa1:32; | |
| 234 | #endif | |
| 235 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 236 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 237 | 	unsigned int exponent:15; | |
| 238 | 	unsigned int negative:1; | |
| 239 | 	unsigned int empty:16; | |
| 240 | 	unsigned int mantissa0:30; | |
| 241 | 	unsigned int quiet_nan:1; | |
| 242 | 	unsigned int one:1; | |
| 243 | 	unsigned int mantissa1:32; | |
| 244 | # else | |
| 245 | 	unsigned int mantissa1:32; | |
| 246 | 	unsigned int mantissa0:30; | |
| 247 | 	unsigned int quiet_nan:1; | |
| 248 | 	unsigned int one:1; | |
| 249 | 	unsigned int exponent:15; | |
| 250 | 	unsigned int negative:1; | |
| 251 | 	unsigned int empty:16; | |
| 252 | # endif | |
| 253 | #endif | |
| 254 | } ieee_nan; | |
| 255 | }; | |
| 256 | ||
| 257 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff | |
| 258 | ||
| 259 | #elif __LDBL_MANT_DIG__ == 53 | |
| 260 | ||
| 261 | union ieee854_long_double | |
| 262 | { | |
| 263 | long double d; | |
| 264 | ||
| 265 | /* This is the IEEE 754 double-precision format. */ | |
| 266 | struct | |
| 267 | { | |
| 268 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 269 | 	unsigned int negative:1; | |
| 270 | 	unsigned int exponent:11; | |
| 271 | 	/* Together these comprise the mantissa. */ | |
| 272 | 	unsigned int mantissa0:20; | |
| 273 | 	unsigned int mantissa1:32; | |
| 274 | #endif				/* Big endian. */ | |
| 275 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 276 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 277 | 	unsigned int mantissa0:20; | |
| 278 | 	unsigned int exponent:11; | |
| 279 | 	unsigned int negative:1; | |
| 280 | 	unsigned int mantissa1:32; | |
| 281 | # else | |
| 282 | 	/* Together these comprise the mantissa. */ | |
| 283 | 	unsigned int mantissa1:32; | |
| 284 | 	unsigned int mantissa0:20; | |
| 285 | 	unsigned int exponent:11; | |
| 286 | 	unsigned int negative:1; | |
| 287 | # endif | |
| 288 | #endif				/* Little endian. */ | |
| 289 | } ieee; | |
| 290 | ||
| 291 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 292 | struct | |
| 293 | { | |
| 294 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 295 | 	unsigned int negative:1; | |
| 296 | 	unsigned int exponent:11; | |
| 297 | 	unsigned int quiet_nan:1; | |
| 298 | 	/* Together these comprise the mantissa. */ | |
| 299 | 	unsigned int mantissa0:19; | |
| 300 | 	unsigned int mantissa1:32; | |
| 301 | #else | |
| 302 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 303 | 	unsigned int mantissa0:19; | |
| 304 | 	unsigned int quiet_nan:1; | |
| 305 | 	unsigned int exponent:11; | |
| 306 | 	unsigned int negative:1; | |
| 307 | 	unsigned int mantissa1:32; | |
| 308 | # else | |
| 309 | 	/* Together these comprise the mantissa. */ | |
| 310 | 	unsigned int mantissa1:32; | |
| 311 | 	unsigned int mantissa0:19; | |
| 312 | 	unsigned int quiet_nan:1; | |
| 313 | 	unsigned int exponent:11; | |
| 314 | 	unsigned int negative:1; | |
| 315 | # endif | |
| 316 | #endif | |
| 317 | } ieee_nan; | |
| 318 | }; | |
| 319 | ||
| 320 | #define IEEE854_LONG_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 321 | ||
| 322 | #endif /* __LDBL_MANT_DIG__ == 53 */ | |
| 323 | ||
| 324 | __END_DECLS | |
| 325 | ||
| 326 | #endif /* ieee754.h */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/dlfcn.h created+64| ... | ... | @@ -0,0 +1,64 @@ |
| 1 | /* System dependent definitions for run-time dynamic loading. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _DLFCN_H | |
| 20 | # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The MODE argument to `dlopen' contains one of the following: */ | |
| 24 | #define RTLD_LAZY	0x0001	/* Lazy function call binding. */ | |
| 25 | #define RTLD_NOW	0x0002	/* Immediate function call binding. */ | |
| 26 | #define RTLD_BINDING_MASK 0x3	/* Mask of binding time value. */ | |
| 27 | #define RTLD_NOLOAD	0x00008	/* Do not load the object. */ | |
| 28 | #define RTLD_DEEPBIND	0x00010	/* Use deep binding. */ | |
| 29 | ||
| 30 | /* If the following bit is set in the MODE argument to `dlopen', | |
| 31 | the symbols of the loaded object and its dependencies are made | |
| 32 | visible as if the object were linked directly into the program. */ | |
| 33 | #define RTLD_GLOBAL	0x0004 | |
| 34 | ||
| 35 | /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. | |
| 36 | The implementation does this by default and so we can define the | |
| 37 | value to zero. */ | |
| 38 | #define RTLD_LOCAL 0 | |
| 39 | ||
| 40 | /* Do not delete object when closed. */ | |
| 41 | #define RTLD_NODELETE	0x01000 | |
| 42 | ||
| 43 | #ifdef __USE_GNU | |
| 44 | /* To support profiling of shared objects it is a good idea to call | |
| 45 | the function found using `dlsym' using the following macro since | |
| 46 | these calls do not use the PLT. But this would mean the dynamic | |
| 47 | loader has no chance to find out when the function is called. The | |
| 48 | macro applies the necessary magic so that profiling is possible. | |
| 49 | Rewrite | |
| 50 | 	foo = (*fctp) (arg1, arg2); | |
| 51 | into | |
| 52 | foo = DL_CALL_FCT (fctp, (arg1, arg2)); | |
| 53 | */ | |
| 54 | # define DL_CALL_FCT(fctp, args) \ | |
| 55 | (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args) | |
| 56 | ||
| 57 | __BEGIN_DECLS | |
| 58 | ||
| 59 | /* This function calls the profiling functions. */ | |
| 60 | extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW; | |
| 61 | ||
| 62 | __END_DECLS | |
| 63 | ||
| 64 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/errno.h created+52| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | /* Error constants. MIPS/Linux specific version. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_ERRNO_H | |
| 20 | ||
| 21 | #if !defined _ERRNO_H | |
| 22 | # error "Never include <bits/errno.h> directly; use <errno.h> instead." | |
| 23 | #endif | |
| 24 | ||
| 25 | # include <linux/errno.h> | |
| 26 | ||
| 27 | /* Older Linux headers do not define these constants. */ | |
| 28 | # ifndef ENOTSUP | |
| 29 | # define ENOTSUP		EOPNOTSUPP | |
| 30 | # endif | |
| 31 | ||
| 32 | # ifndef ECANCELED | |
| 33 | # define ECANCELED		158 | |
| 34 | # endif | |
| 35 | ||
| 36 | # ifndef EOWNERDEAD | |
| 37 | # define EOWNERDEAD		165 | |
| 38 | # endif | |
| 39 | ||
| 40 | # ifndef ENOTRECOVERABLE | |
| 41 | # define ENOTRECOVERABLE	166 | |
| 42 | # endif | |
| 43 | ||
| 44 | # ifndef ERFKILL | |
| 45 | # define ERFKILL		167 | |
| 46 | # endif | |
| 47 | ||
| 48 | # ifndef EHWPOISON | |
| 49 | # define EHWPOISON		168 | |
| 50 | # endif | |
| 51 | ||
| 52 | #endif /* bits/errno.h. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/eventfd.h created+31| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | /* Copyright (C) 2007-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_EVENTFD_H | |
| 19 | # error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for eventfd. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | EFD_SEMAPHORE = 00000001, | |
| 26 | #define EFD_SEMAPHORE EFD_SEMAPHORE | |
| 27 | EFD_CLOEXEC = 02000000, | |
| 28 | #define EFD_CLOEXEC EFD_CLOEXEC | |
| 29 | EFD_NONBLOCK = 00000200 | |
| 30 | #define EFD_NONBLOCK EFD_NONBLOCK | |
| 31 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/inotify.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_INOTIFY_H | |
| 19 | # error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for the parameter of inotify_init1. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | IN_CLOEXEC = 02000000, | |
| 26 | #define IN_CLOEXEC IN_CLOEXEC | |
| 27 | IN_NONBLOCK = 00000200 | |
| 28 | #define IN_NONBLOCK IN_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/ioctl-types.h created+75| ... | ... | @@ -0,0 +1,75 @@ |
| 1 | /* Structure types for pre-termios terminal ioctls. Linux/MIPS version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_IOCTL_H | |
| 20 | # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Get definition of constants for use with `ioctl'. */ | |
| 24 | #include <asm/ioctls.h> | |
| 25 | ||
| 26 | struct winsize | |
| 27 | { | |
| 28 | unsigned short int ws_row; | |
| 29 | unsigned short int ws_col; | |
| 30 | unsigned short int ws_xpixel; | |
| 31 | unsigned short int ws_ypixel; | |
| 32 | }; | |
| 33 | ||
| 34 | #define NCC	8 | |
| 35 | struct termio | |
| 36 | { | |
| 37 | unsigned short int c_iflag;		/* input mode flags */ | |
| 38 | unsigned short int c_oflag;		/* output mode flags */ | |
| 39 | unsigned short int c_cflag;		/* control mode flags */ | |
| 40 | unsigned short int c_lflag;		/* local mode flags */ | |
| 41 | char c_line;			/* line discipline */ | |
| 42 | /* Yes, this is really NCCS. */ | |
| 43 | unsigned char c_cc[32 /* NCCS */]; /* control characters */ | |
| 44 | }; | |
| 45 | ||
| 46 | /* modem lines */ | |
| 47 | #define TIOCM_LE	0x001		/* line enable */ | |
| 48 | #define TIOCM_DTR	0x002		/* data terminal ready */ | |
| 49 | #define TIOCM_RTS	0x004		/* request to send */ | |
| 50 | #define TIOCM_ST	0x010		/* secondary transmit */ | |
| 51 | #define TIOCM_SR	0x020		/* secondary receive */ | |
| 52 | #define TIOCM_CTS	0x040		/* clear to send */ | |
| 53 | #define TIOCM_CAR	0x100		/* carrier detect */ | |
| 54 | #define TIOCM_CD	TIOCM_CAR | |
| 55 | #define TIOCM_RNG	0x200		/* ring */ | |
| 56 | #define TIOCM_RI	TIOCM_RNG | |
| 57 | #define TIOCM_DSR	0x400		/* data set ready */ | |
| 58 | ||
| 59 | /* line disciplines */ | |
| 60 | #define N_TTY		0 | |
| 61 | #define N_SLIP		1 | |
| 62 | #define N_MOUSE		2 | |
| 63 | #define N_PPP		3 | |
| 64 | #define N_STRIP		4 | |
| 65 | #define N_AX25		5 | |
| 66 | #define N_X25		6	/* X.25 async */ | |
| 67 | #define N_6PACK		7 | |
| 68 | #define N_MASC		8	/* Mobitex module */ | |
| 69 | #define N_R3964		9	/* Simatic R3964 module */ | |
| 70 | #define N_PROFIBUS_FDL	10	/* Profibus */ | |
| 71 | #define N_IRDA		11	/* Linux IR */ | |
| 72 | #define N_SMSBLOCK	12	/* SMS block mode */ | |
| 73 | #define N_HDLC		13	/* synchronous HDLC */ | |
| 74 | #define N_SYNC_PPP	14	/* synchronous PPP */ | |
| 75 | #define	N_HCI		15	/* Bluetooth HCI UART */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/ipctypes.h created+31| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | /* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. MIPS version | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* | |
| 20 | * Never include <bits/ipctypes.h> directly. | |
| 21 | */ | |
| 22 | ||
| 23 | #ifndef _BITS_IPCTYPES_H | |
| 24 | #define _BITS_IPCTYPES_H	1 | |
| 25 | ||
| 26 | #include <bits/types.h> | |
| 27 | ||
| 28 | typedef __SLONG32_TYPE __ipc_pid_t; | |
| 29 | ||
| 30 | ||
| 31 | #endif /* bits/ipctypes.h */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/mman.h created+48| ... | ... | @@ -0,0 +1,48 @@ |
| 1 | /* Definitions for POSIX memory map interface. Linux/MIPS version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MMAN_H | |
| 20 | # error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The following definitions basically come from the kernel headers. | |
| 24 | But the kernel header is not namespace clean. */ | |
| 25 | ||
| 26 | /* These are Linux-specific. */ | |
| 27 | #ifdef __USE_MISC | |
| 28 | # define MAP_NORESERVE	0x0400		/* don't check for reservations */ | |
| 29 | # define MAP_GROWSDOWN	0x1000		/* stack-like segment */ | |
| 30 | # define MAP_DENYWRITE	0x2000		/* ETXTBSY */ | |
| 31 | # define MAP_EXECUTABLE	0x4000		/* mark it as an executable */ | |
| 32 | # define MAP_LOCKED	0x8000		/* pages are locked */ | |
| 33 | # define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ | |
| 34 | # define MAP_NONBLOCK 0x20000 /* do not block on IO */ | |
| 35 | # define MAP_STACK	0x40000		/* Allocation is for a stack. */ | |
| 36 | # define MAP_HUGETLB	0x80000		/* Create huge page mapping. */ | |
| 37 | # define MAP_FIXED_NOREPLACE 0x100000	/* MAP_FIXED but do not unmap | |
| 38 | 					 underlying mapping. */ | |
| 39 | #endif | |
| 40 | ||
| 41 | #define __MAP_ANONYMOUS 0x0800 | |
| 42 | ||
| 43 | /* Include generic Linux declarations. */ | |
| 44 | #include <bits/mman-linux.h> | |
| 45 | ||
| 46 | #ifdef __USE_MISC | |
| 47 | # define MAP_RENAME	MAP_ANONYMOUS | |
| 48 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/poll.h created+49| ... | ... | @@ -0,0 +1,49 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_POLL_H | |
| 19 | # error "Never use <bits/poll.h> directly; include <sys/poll.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Event types that can be polled for. These bits may be set in `events' | |
| 23 | to indicate the interesting event types; they will appear in `revents' | |
| 24 | to indicate the status of the file descriptor. */ | |
| 25 | #define POLLIN		0x001		/* There is data to read. */ | |
| 26 | #define POLLPRI		0x002		/* There is urgent data to read. */ | |
| 27 | #define POLLOUT		0x004		/* Writing now will not block. */ | |
| 28 | ||
| 29 | #if defined __USE_XOPEN || defined __USE_XOPEN2K8 | |
| 30 | /* These values are defined in XPG4.2. */ | |
| 31 | # define POLLRDNORM	0x040		/* Normal data may be read. */ | |
| 32 | # define POLLRDBAND	0x080		/* Priority data may be read. */ | |
| 33 | # define POLLWRNORM	POLLOUT		/* Writing now will not block. */ | |
| 34 | # define POLLWRBAND	0x100		/* Priority data may be written. */ | |
| 35 | #endif | |
| 36 | ||
| 37 | #ifdef __USE_GNU | |
| 38 | /* These are extensions for Linux. */ | |
| 39 | # define POLLMSG	0x400 | |
| 40 | # define POLLREMOVE	0x1000 | |
| 41 | # define POLLRDHUP	0x2000 | |
| 42 | #endif | |
| 43 | ||
| 44 | /* Event types always implicitly polled for. These bits need not be set in | |
| 45 | `events', but they will appear in `revents' to indicate the status of | |
| 46 | the file descriptor. */ | |
| 47 | #define POLLERR		0x008		/* Error condition. */ | |
| 48 | #define POLLHUP		0x010		/* Hung up. */ | |
| 49 | #define POLLNVAL	0x020		/* Invalid polling request. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/pthread_stack_min.h created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. MIPS Linux version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. At least two pages with 64k pages. */ | |
| 20 | #define PTHREAD_STACK_MIN	131072 | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/pthreadtypes-arch.h created+44| ... | ... | @@ -0,0 +1,44 @@ |
| 1 | /* Machine-specific pthread type layouts. MIPS version. | |
| 2 | Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_PTHREADTYPES_ARCH_H | |
| 20 | #define _BITS_PTHREADTYPES_ARCH_H	1 | |
| 21 | ||
| 22 | #include <bits/endian.h> | |
| 23 | ||
| 24 | #if _MIPS_SIM == _ABI64 | |
| 25 | # define __SIZEOF_PTHREAD_ATTR_T 56 | |
| 26 | # define __SIZEOF_PTHREAD_MUTEX_T 40 | |
| 27 | # define __SIZEOF_PTHREAD_RWLOCK_T 56 | |
| 28 | # define __SIZEOF_PTHREAD_BARRIER_T 32 | |
| 29 | #else | |
| 30 | # define __SIZEOF_PTHREAD_ATTR_T 36 | |
| 31 | # define __SIZEOF_PTHREAD_MUTEX_T 24 | |
| 32 | # define __SIZEOF_PTHREAD_RWLOCK_T 32 | |
| 33 | # define __SIZEOF_PTHREAD_BARRIER_T 20 | |
| 34 | #endif | |
| 35 | #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 | |
| 36 | #define __SIZEOF_PTHREAD_COND_T 48 | |
| 37 | #define __SIZEOF_PTHREAD_CONDATTR_T 4 | |
| 38 | #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 | |
| 39 | #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 | |
| 40 | ||
| 41 | #define __LOCK_ALIGNMENT | |
| 42 | #define __ONCE_ALIGNMENT | |
| 43 | ||
| 44 | #endif	/* bits/pthreadtypes.h */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/resource.h created+231| ... | ... | @@ -0,0 +1,231 @@ |
| 1 | /* Bit values & structures for resource limits. Linux/MIPS version. | |
| 2 | Copyright (C) 1994-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_RESOURCE_H | |
| 20 | # error "Never use <bits/resource.h> directly; include <sys/resource.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/types.h> | |
| 24 | ||
| 25 | /* Transmute defines to enumerations. The macro re-definitions are | |
| 26 | necessary because some programs want to test for operating system | |
| 27 | features with #ifdef RUSAGE_SELF. In ISO C the reflexive | |
| 28 | definition is a no-op. */ | |
| 29 | ||
| 30 | /* Kinds of resource limit. */ | |
| 31 | enum __rlimit_resource | |
| 32 | { | |
| 33 | /* Per-process CPU limit, in seconds. */ | |
| 34 | RLIMIT_CPU = 0, | |
| 35 | #define RLIMIT_CPU RLIMIT_CPU | |
| 36 | ||
| 37 | /* Largest file that can be created, in bytes. */ | |
| 38 | RLIMIT_FSIZE = 1, | |
| 39 | #define	RLIMIT_FSIZE RLIMIT_FSIZE | |
| 40 | ||
| 41 | /* Maximum size of data segment, in bytes. */ | |
| 42 | RLIMIT_DATA = 2, | |
| 43 | #define	RLIMIT_DATA RLIMIT_DATA | |
| 44 | ||
| 45 | /* Maximum size of stack segment, in bytes. */ | |
| 46 | RLIMIT_STACK = 3, | |
| 47 | #define	RLIMIT_STACK RLIMIT_STACK | |
| 48 | ||
| 49 | /* Largest core file that can be created, in bytes. */ | |
| 50 | RLIMIT_CORE = 4, | |
| 51 | #define	RLIMIT_CORE RLIMIT_CORE | |
| 52 | ||
| 53 | /* Largest resident set size, in bytes. | |
| 54 | This affects swapping; processes that are exceeding their | |
| 55 | resident set size will be more likely to have physical memory | |
| 56 | taken from them. */ | |
| 57 | __RLIMIT_RSS = 7, | |
| 58 | #define	RLIMIT_RSS __RLIMIT_RSS | |
| 59 | ||
| 60 | /* Number of open files. */ | |
| 61 | RLIMIT_NOFILE = 5, | |
| 62 | __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ | |
| 63 | #define RLIMIT_NOFILE RLIMIT_NOFILE | |
| 64 | #define RLIMIT_OFILE __RLIMIT_OFILE | |
| 65 | ||
| 66 | /* Address space limit (?) */ | |
| 67 | RLIMIT_AS = 6, | |
| 68 | #define RLIMIT_AS RLIMIT_AS | |
| 69 | ||
| 70 | /* Number of processes. */ | |
| 71 | __RLIMIT_NPROC = 8, | |
| 72 | #define RLIMIT_NPROC __RLIMIT_NPROC | |
| 73 | ||
| 74 | /* Locked-in-memory address space. */ | |
| 75 | __RLIMIT_MEMLOCK = 9, | |
| 76 | #define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK | |
| 77 | ||
| 78 | /* Maximum number of file locks. */ | |
| 79 | __RLIMIT_LOCKS = 10, | |
| 80 | #define RLIMIT_LOCKS __RLIMIT_LOCKS | |
| 81 | ||
| 82 | /* Maximum number of pending signals. */ | |
| 83 | __RLIMIT_SIGPENDING = 11, | |
| 84 | #define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING | |
| 85 | ||
| 86 | /* Maximum bytes in POSIX message queues. */ | |
| 87 | __RLIMIT_MSGQUEUE = 12, | |
| 88 | #define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE | |
| 89 | ||
| 90 | /* Maximum nice priority allowed to raise to. | |
| 91 | Nice levels 19 .. -20 correspond to 0 .. 39 | |
| 92 | values of this resource limit. */ | |
| 93 | __RLIMIT_NICE = 13, | |
| 94 | #define RLIMIT_NICE __RLIMIT_NICE | |
| 95 | ||
| 96 | /* Maximum realtime priority allowed for non-priviledged | |
| 97 | processes. */ | |
| 98 | __RLIMIT_RTPRIO = 14, | |
| 99 | #define RLIMIT_RTPRIO __RLIMIT_RTPRIO | |
| 100 | ||
| 101 | /* Maximum CPU time in microseconds that a process scheduled under a real-time | |
| 102 | scheduling policy may consume without making a blocking system | |
| 103 | call before being forcibly descheduled. */ | |
| 104 | __RLIMIT_RTTIME = 15, | |
| 105 | #define RLIMIT_RTTIME __RLIMIT_RTTIME | |
| 106 | ||
| 107 | __RLIMIT_NLIMITS = 16, | |
| 108 | __RLIM_NLIMITS = __RLIMIT_NLIMITS | |
| 109 | #define RLIMIT_NLIMITS __RLIMIT_NLIMITS | |
| 110 | #define RLIM_NLIMITS __RLIM_NLIMITS | |
| 111 | }; | |
| 112 | ||
| 113 | /* Value to indicate that there is no limit. */ | |
| 114 | #if _MIPS_SIM == _ABI64 | |
| 115 | /* The N64 syscall uses this value. */ | |
| 116 | # define RLIM_INFINITY 0xffffffffffffffffUL | |
| 117 | # ifdef __USE_LARGEFILE64 | |
| 118 | # define RLIM64_INFINITY 0xffffffffffffffffUL | |
| 119 | # endif | |
| 120 | #else | |
| 121 | /* The O32 and N32 syscalls use 0x7fffffff. */ | |
| 122 | # ifndef __USE_FILE_OFFSET64 | |
| 123 | # define RLIM_INFINITY ((long int)(~0UL >> 1)) | |
| 124 | # else | |
| 125 | # define RLIM_INFINITY 0xffffffffffffffffULL | |
| 126 | # endif | |
| 127 | # ifdef __USE_LARGEFILE64 | |
| 128 | # define RLIM64_INFINITY 0xffffffffffffffffULL | |
| 129 | # endif | |
| 130 | #endif | |
| 131 | ||
| 132 | /* We can represent all limits. */ | |
| 133 | #define RLIM_SAVED_MAX	RLIM_INFINITY | |
| 134 | #define RLIM_SAVED_CUR	RLIM_INFINITY | |
| 135 | ||
| 136 | ||
| 137 | /* Type for resource quantity measurement. */ | |
| 138 | #ifndef __USE_FILE_OFFSET64 | |
| 139 | typedef __rlim_t rlim_t; | |
| 140 | #else | |
| 141 | typedef __rlim64_t rlim_t; | |
| 142 | #endif | |
| 143 | #ifdef __USE_LARGEFILE64 | |
| 144 | typedef __rlim64_t rlim64_t; | |
| 145 | #endif | |
| 146 | ||
| 147 | struct rlimit | |
| 148 | { | |
| 149 | /* The current (soft) limit. */ | |
| 150 | rlim_t rlim_cur; | |
| 151 | /* The hard limit. */ | |
| 152 | rlim_t rlim_max; | |
| 153 | }; | |
| 154 | ||
| 155 | #ifdef __USE_LARGEFILE64 | |
| 156 | struct rlimit64 | |
| 157 | { | |
| 158 | /* The current (soft) limit. */ | |
| 159 | rlim64_t rlim_cur; | |
| 160 | /* The hard limit. */ | |
| 161 | rlim64_t rlim_max; | |
| 162 | }; | |
| 163 | #endif | |
| 164 | ||
| 165 | /* Whose usage statistics do you want? */ | |
| 166 | enum __rusage_who | |
| 167 | { | |
| 168 | /* The calling process. */ | |
| 169 | RUSAGE_SELF = 0, | |
| 170 | #define RUSAGE_SELF RUSAGE_SELF | |
| 171 | ||
| 172 | /* All of its terminated child processes. */ | |
| 173 | RUSAGE_CHILDREN = -1 | |
| 174 | #define RUSAGE_CHILDREN RUSAGE_CHILDREN | |
| 175 | ||
| 176 | #ifdef __USE_GNU | |
| 177 | , | |
| 178 | /* The calling thread. */ | |
| 179 | RUSAGE_THREAD = 1 | |
| 180 | # define RUSAGE_THREAD RUSAGE_THREAD | |
| 181 | /* Name for the same functionality on Solaris. */ | |
| 182 | # define RUSAGE_LWP RUSAGE_THREAD | |
| 183 | #endif | |
| 184 | }; | |
| 185 | ||
| 186 | #include <bits/types/struct_timeval.h> | |
| 187 | #include <bits/types/struct_rusage.h> | |
| 188 | ||
| 189 | /* Priority limits. */ | |
| 190 | #define PRIO_MIN	-20	/* Minimum priority a process can have. */ | |
| 191 | #define PRIO_MAX	20	/* Maximum priority a process can have. */ | |
| 192 | ||
| 193 | /* The type of the WHICH argument to `getpriority' and `setpriority', | |
| 194 | indicating what flavor of entity the WHO argument specifies. */ | |
| 195 | enum __priority_which | |
| 196 | { | |
| 197 | PRIO_PROCESS = 0,		/* WHO is a process ID. */ | |
| 198 | #define PRIO_PROCESS PRIO_PROCESS | |
| 199 | PRIO_PGRP = 1,		/* WHO is a process group ID. */ | |
| 200 | #define PRIO_PGRP PRIO_PGRP | |
| 201 | PRIO_USER = 2			/* WHO is a user ID. */ | |
| 202 | #define PRIO_USER PRIO_USER | |
| 203 | }; | |
| 204 | ||
| 205 | ||
| 206 | __BEGIN_DECLS | |
| 207 | ||
| 208 | #ifdef __USE_GNU | |
| 209 | /* Modify and return resource limits of a process atomically. */ | |
| 210 | # ifndef __USE_FILE_OFFSET64 | |
| 211 | extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, | |
| 212 | 		 const struct rlimit *__new_limit, | |
| 213 | 		 struct rlimit *__old_limit) __THROW; | |
| 214 | # else | |
| 215 | # ifdef __REDIRECT_NTH | |
| 216 | extern int __REDIRECT_NTH (prlimit, (__pid_t __pid, | |
| 217 | 				 enum __rlimit_resource __resource, | |
| 218 | 				 const struct rlimit *__new_limit, | |
| 219 | 				 struct rlimit *__old_limit), prlimit64); | |
| 220 | # else | |
| 221 | # define prlimit prlimit64 | |
| 222 | # endif | |
| 223 | # endif | |
| 224 | # ifdef __USE_LARGEFILE64 | |
| 225 | extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource, | |
| 226 | 		 const struct rlimit64 *__new_limit, | |
| 227 | 		 struct rlimit64 *__old_limit) __THROW; | |
| 228 | # endif | |
| 229 | #endif | |
| 230 | ||
| 231 | __END_DECLS | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/semaphore.h created+36| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SEMAPHORE_H | |
| 19 | # error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #if _MIPS_SIM == _ABI64 | |
| 23 | # define __SIZEOF_SEM_T	32 | |
| 24 | #else | |
| 25 | # define __SIZEOF_SEM_T	16 | |
| 26 | #endif | |
| 27 | ||
| 28 | /* Value returned if `sem_open' failed. */ | |
| 29 | #define SEM_FAILED ((sem_t *) 0) | |
| 30 | ||
| 31 | ||
| 32 | typedef union | |
| 33 | { | |
| 34 | char __size[__SIZEOF_SEM_T]; | |
| 35 | long int __align; | |
| 36 | } sem_t; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/shmlba.h created+24| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | /* Define SHMLBA. MIPS version. | |
| 2 | Copyright (C) 2018-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never use <bits/shmlba.h> directly; include <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Segment low boundary address multiple. */ | |
| 24 | #define SHMLBA		0x40000 | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/sigaction.h created+94| ... | ... | @@ -0,0 +1,94 @@ |
| 1 | /* The proper definitions for Linux/MIPS's sigaction. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGACTION_H | |
| 20 | #define _BITS_SIGACTION_H 1 | |
| 21 | ||
| 22 | #ifndef _SIGNAL_H | |
| 23 | # error "Never include <bits/sigaction.h> directly; use <signal.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Structure describing the action to be taken when a signal arrives. */ | |
| 27 | struct sigaction | |
| 28 | { | |
| 29 | /* Special flags. */ | |
| 30 | int sa_flags; | |
| 31 | ||
| 32 | /* Signal handler. */ | |
| 33 | #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED | |
| 34 | union | |
| 35 | { | |
| 36 | 	/* Used if SA_SIGINFO is not set. */ | |
| 37 | 	__sighandler_t sa_handler; | |
| 38 | 	/* Used if SA_SIGINFO is set. */ | |
| 39 | 	void (*sa_sigaction) (int, siginfo_t *, void *); | |
| 40 | } | |
| 41 | __sigaction_handler; | |
| 42 | # define sa_handler __sigaction_handler.sa_handler | |
| 43 | # define sa_sigaction __sigaction_handler.sa_sigaction | |
| 44 | #else | |
| 45 | __sighandler_t sa_handler; | |
| 46 | #endif | |
| 47 | /* Additional set of signals to be blocked. */ | |
| 48 | __sigset_t sa_mask; | |
| 49 | ||
| 50 | /* The ABI says here are two unused ints following. */ | |
| 51 | /* Restore handler. */ | |
| 52 | void (*sa_restorer) (void); | |
| 53 | ||
| 54 | #if _MIPS_SZPTR < 64 | |
| 55 | int sa_resv[1]; | |
| 56 | #endif | |
| 57 | }; | |
| 58 | ||
| 59 | /* Bits in `sa_flags'. */ | |
| 60 | /* Please note that some Linux kernels versions use different values for these | |
| 61 | flags which is a bug in those kernel versions. */ | |
| 62 | #define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */ | |
| 63 | #define SA_NOCLDWAIT 0x00010000 /* Don't create zombie on child death. */ | |
| 64 | #define SA_SIGINFO 0x00000008 /* Invoke signal-catching function with | |
| 65 | 				 three arguments instead of one. */ | |
| 66 | #if defined __USE_XOPEN_EXTENDED || defined __USE_MISC | |
| 67 | # define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ | |
| 68 | #endif | |
| 69 | #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 | |
| 70 | # define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ | |
| 71 | # define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ | |
| 72 | # define SA_NODEFER 0x40000000 /* Don't automatically block the signal when | |
| 73 | 				 its handler is being executed. */ | |
| 74 | #endif | |
| 75 | #ifdef __USE_MISC | |
| 76 | # define SA_INTERRUPT 0x20000000 /* Historical no-op. */ | |
| 77 | ||
| 78 | /* Some aliases for the SA_ constants. */ | |
| 79 | # define SA_NOMASK SA_NODEFER | |
| 80 | # define SA_ONESHOT SA_RESETHAND | |
| 81 | # define SA_STACK SA_ONSTACK | |
| 82 | #endif | |
| 83 | ||
| 84 | /* Values for the HOW argument to `sigprocmask'. */ | |
| 85 | #define SIG_NOP	 0		/* 0 is unused to catch errors */ | |
| 86 | #define	SIG_BLOCK 1		/* Block signals. */ | |
| 87 | #define	SIG_UNBLOCK 2		/* Unblock signals. */ | |
| 88 | #define	SIG_SETMASK 3		/* Set the set of blocked signals. */ | |
| 89 | #ifdef __USE_MISC | |
| 90 | # define SIG_SETMASK32 256	/* Goodie from SGI for BSD compatibility: | |
| 91 | 				 set only the low 32 bit of the sigset. */ | |
| 92 | #endif | |
| 93 | ||
| 94 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/sigcontext.h created+82| ... | ... | @@ -0,0 +1,82 @@ |
| 1 | /* Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. | |
| 2 | ||
| 3 | The GNU C Library is free software; you can redistribute it and/or | |
| 4 | modify it under the terms of the GNU Lesser General Public | |
| 5 | License as published by the Free Software Foundation; either | |
| 6 | version 2.1 of the License, or (at your option) any later version. | |
| 7 | ||
| 8 | The GNU C Library is distributed in the hope that it will be useful, | |
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 11 | Lesser General Public License for more details. | |
| 12 | ||
| 13 | You should have received a copy of the GNU Lesser General Public | |
| 14 | License along with the GNU C Library. If not, see | |
| 15 | <https://www.gnu.org/licenses/>. */ | |
| 16 | ||
| 17 | #ifndef _BITS_SIGCONTEXT_H | |
| 18 | #define _BITS_SIGCONTEXT_H 1 | |
| 19 | ||
| 20 | #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H | |
| 21 | # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." | |
| 22 | #endif | |
| 23 | ||
| 24 | #include <sgidefs.h> | |
| 25 | ||
| 26 | #if _MIPS_SIM == _ABIO32 | |
| 27 | ||
| 28 | /* Certain unused fields were replaced with new ones in 2.6.12-rc4. | |
| 29 | The changes were as follows: | |
| 30 | ||
| 31 | sc_cause -> sc_hi1 | |
| 32 | sc_badvaddr -> sc_lo1 | |
| 33 | sc_sigset[0] -> sc_hi2 | |
| 34 | sc_sigset[1] -> sc_lo2 | |
| 35 | sc_sigset[2] -> sc_hi3 | |
| 36 | sc_sigset[3] -> sc_lo3 | |
| 37 | ||
| 38 | sc_regmask, sc_ownedfp and sc_fpc_eir are not used. */ | |
| 39 | struct sigcontext { | |
| 40 | unsigned int sc_regmask; | |
| 41 | unsigned int sc_status; | |
| 42 | __extension__ unsigned long long sc_pc; | |
| 43 | __extension__ unsigned long long sc_regs[32]; | |
| 44 | __extension__ unsigned long long sc_fpregs[32]; | |
| 45 | unsigned int sc_ownedfp; | |
| 46 | unsigned int sc_fpc_csr; | |
| 47 | unsigned int sc_fpc_eir; | |
| 48 | unsigned int sc_used_math; | |
| 49 | unsigned int sc_dsp; | |
| 50 | __extension__ unsigned long long sc_mdhi; | |
| 51 | __extension__ unsigned long long sc_mdlo; | |
| 52 | unsigned long sc_hi1; | |
| 53 | unsigned long sc_lo1; | |
| 54 | unsigned long sc_hi2; | |
| 55 | unsigned long sc_lo2; | |
| 56 | unsigned long sc_hi3; | |
| 57 | unsigned long sc_lo3; | |
| 58 | }; | |
| 59 | ||
| 60 | #else | |
| 61 | ||
| 62 | /* This structure changed in 2.6.12-rc4 when DSP support was added. */ | |
| 63 | struct sigcontext { | |
| 64 | __extension__ unsigned long long sc_regs[32]; | |
| 65 | __extension__ unsigned long long sc_fpregs[32]; | |
| 66 | __extension__ unsigned long long sc_mdhi; | |
| 67 | __extension__ unsigned long long sc_hi1; | |
| 68 | __extension__ unsigned long long sc_hi2; | |
| 69 | __extension__ unsigned long long sc_hi3; | |
| 70 | __extension__ unsigned long long sc_mdlo; | |
| 71 | __extension__ unsigned long long sc_lo1; | |
| 72 | __extension__ unsigned long long sc_lo2; | |
| 73 | __extension__ unsigned long long sc_lo3; | |
| 74 | __extension__ unsigned long long sc_pc; | |
| 75 | unsigned int sc_fpc_csr; | |
| 76 | unsigned int sc_used_math; | |
| 77 | unsigned int sc_dsp; | |
| 78 | unsigned int sc_reserved; | |
| 79 | }; | |
| 80 | ||
| 81 | #endif /* _MIPS_SIM != _ABIO32 */ | |
| 82 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/siginfo-arch.h created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | /* Architecture-specific adjustments to siginfo_t. MIPS version. */ | |
| 2 | #ifndef _BITS_SIGINFO_ARCH_H | |
| 3 | #define _BITS_SIGINFO_ARCH_H 1 | |
| 4 | ||
| 5 | /* MIPS has the si_code and si_errno fields in the opposite order from | |
| 6 | all other architectures. */ | |
| 7 | #define __SI_ERRNO_THEN_CODE 0 | |
| 8 | ||
| 9 | /* MIPS also has different values for SI_ASYNCIO, SI_MESGQ, and SI_TIMER | |
| 10 | than all other architectures. */ | |
| 11 | #define __SI_ASYNCIO_AFTER_SIGIO 0 | |
| 12 | ||
| 13 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/signalfd.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* Copyright (C) 2007-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_SIGNALFD_H | |
| 19 | # error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for signalfd. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | SFD_CLOEXEC = 02000000, | |
| 26 | #define SFD_CLOEXEC SFD_CLOEXEC | |
| 27 | SFD_NONBLOCK = 00000200 | |
| 28 | #define SFD_NONBLOCK SFD_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/signum-arch.h created+65| ... | ... | @@ -0,0 +1,65 @@ |
| 1 | /* Signal number definitions. Linux/MIPS version. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGNUM_H | |
| 20 | #define _BITS_SIGNUM_H 1 | |
| 21 | ||
| 22 | #ifndef _SIGNAL_H | |
| 23 | #error "Never include <bits/signum.h> directly; use <signal.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Adjustments and additions to the signal number constants for | |
| 27 | Linux/MIPS. */ | |
| 28 | ||
| 29 | #define SIGEMT		 7	/* Emulator trap. */ | |
| 30 | #define SIGPWR		19	/* Power failure imminent. */ | |
| 31 | ||
| 32 | /* Historical signals specified by POSIX. */ | |
| 33 | #define SIGBUS 	10	/* Bus error. */ | |
| 34 | #define SIGSYS		12	/* Bad system call. */ | |
| 35 | ||
| 36 | /* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ | |
| 37 | #define SIGURG		21	/* Urgent data is available at a socket. */ | |
| 38 | #define SIGSTOP		23	/* Stop, unblockable. */ | |
| 39 | #define SIGTSTP		24	/* Keyboard stop. */ | |
| 40 | #define SIGCONT		25	/* Continue. */ | |
| 41 | #define SIGCHLD		18	/* Child terminated or stopped. */ | |
| 42 | #define SIGTTIN		26	/* Background read from control terminal. */ | |
| 43 | #define SIGTTOU		27	/* Background write to control terminal. */ | |
| 44 | #define SIGPOLL		22	/* Pollable event occurred (System V). */ | |
| 45 | #define SIGXCPU		30	/* CPU time limit exceeded. */ | |
| 46 | #define SIGVTALRM	28	/* Virtual timer expired. */ | |
| 47 | #define SIGPROF		29	/* Profiling timer expired. */ | |
| 48 | #define SIGXFSZ		31	/* File size limit exceeded. */ | |
| 49 | #define SIGUSR1		16	/* User-defined signal 1. */ | |
| 50 | #define SIGUSR2		17	/* User-defined signal 2. */ | |
| 51 | ||
| 52 | /* Nonstandard signals found in all modern POSIX systems | |
| 53 | (including both BSD and Linux). */ | |
| 54 | #define SIGWINCH	20	/* Window size change (4.3 BSD, Sun). */ | |
| 55 | ||
| 56 | /* Archaic names for compatibility. */ | |
| 57 | #define SIGIO		SIGPOLL	/* I/O now possible (4.2 BSD). */ | |
| 58 | #define SIGIOT		SIGABRT	/* IOT instruction, abort() on a PDP-11. */ | |
| 59 | #define SIGCLD		SIGCHLD /* Old System V name */ | |
| 60 | ||
| 61 | /* By default no real-time signals are supported. */ | |
| 62 | #define __SIGRTMIN	32 | |
| 63 | #define __SIGRTMAX	127 | |
| 64 | ||
| 65 | #endif	/* <signal.h> included. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/socket-constants.h created+70| ... | ... | @@ -0,0 +1,70 @@ |
| 1 | /* Socket constants which vary among Linux architectures. Version for MIPS. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define SOL_SOCKET 65535 | |
| 24 | #define SO_ACCEPTCONN 4105 | |
| 25 | #define SO_BROADCAST 32 | |
| 26 | #define SO_DONTROUTE 16 | |
| 27 | #define SO_ERROR 4103 | |
| 28 | #define SO_KEEPALIVE 8 | |
| 29 | #define SO_LINGER 128 | |
| 30 | #define SO_OOBINLINE 256 | |
| 31 | #define SO_RCVBUF 4098 | |
| 32 | #define SO_RCVLOWAT 4100 | |
| 33 | #define SO_REUSEADDR 4 | |
| 34 | #define SO_SNDBUF 4097 | |
| 35 | #define SO_SNDLOWAT 4099 | |
| 36 | #define SO_TYPE 4104 | |
| 37 | ||
| 38 | #if __TIMESIZE == 64 | |
| 39 | # define SO_RCVTIMEO 4102 | |
| 40 | # define SO_SNDTIMEO 4101 | |
| 41 | # define SO_TIMESTAMP 29 | |
| 42 | # define SO_TIMESTAMPNS 35 | |
| 43 | # define SO_TIMESTAMPING 37 | |
| 44 | #else | |
| 45 | # define SO_RCVTIMEO_OLD 4102 | |
| 46 | # define SO_SNDTIMEO_OLD 4101 | |
| 47 | # define SO_RCVTIMEO_NEW 66 | |
| 48 | # define SO_SNDTIMEO_NEW 67 | |
| 49 | ||
| 50 | # define SO_TIMESTAMP_OLD 29 | |
| 51 | # define SO_TIMESTAMPNS_OLD 35 | |
| 52 | # define SO_TIMESTAMPING_OLD 37 | |
| 53 | # define SO_TIMESTAMP_NEW 63 | |
| 54 | # define SO_TIMESTAMPNS_NEW 64 | |
| 55 | # define SO_TIMESTAMPING_NEW 65 | |
| 56 | ||
| 57 | # ifdef __USE_TIME_BITS64 | |
| 58 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 59 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 60 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 61 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 62 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 63 | # else | |
| 64 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 65 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 66 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 67 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 68 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 69 | # endif | |
| 70 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/socket_type.h created+55| ... | ... | @@ -0,0 +1,55 @@ |
| 1 | /* Define enum __socket_type for Linux/MIPS. | |
| 2 | Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Types of sockets. */ | |
| 24 | enum __socket_type | |
| 25 | { | |
| 26 | SOCK_DGRAM = 1,		/* Connectionless, unreliable datagrams | |
| 27 | 				 of fixed maximum length. */ | |
| 28 | #define SOCK_DGRAM SOCK_DGRAM | |
| 29 | SOCK_STREAM = 2,		/* Sequenced, reliable, connection-based | |
| 30 | 				 byte streams. */ | |
| 31 | #define SOCK_STREAM SOCK_STREAM | |
| 32 | SOCK_RAW = 3,			/* Raw protocol interface. */ | |
| 33 | #define SOCK_RAW SOCK_RAW | |
| 34 | SOCK_RDM = 4,			/* Reliably-delivered messages. */ | |
| 35 | #define SOCK_RDM SOCK_RDM | |
| 36 | SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based, | |
| 37 | 				 datagrams of fixed maximum length. */ | |
| 38 | #define SOCK_SEQPACKET SOCK_SEQPACKET | |
| 39 | SOCK_DCCP = 6, | |
| 40 | #define SOCK_DCCP SOCK_DCCP	/* Datagram Congestion Control Protocol. */ | |
| 41 | SOCK_PACKET = 10,		/* Linux specific way of getting packets | |
| 42 | 				 at the dev level. For writing rarp and | |
| 43 | 				 other similar things on the user level. */ | |
| 44 | #define SOCK_PACKET SOCK_PACKET | |
| 45 | ||
| 46 | /* Flags to be ORed into the type parameter of socket and socketpair and | |
| 47 | used for the flags parameter of paccept. */ | |
| 48 | ||
| 49 | SOCK_CLOEXEC = 02000000,	/* Atomically set close-on-exec flag for the | |
| 50 | 				 new descriptor(s). */ | |
| 51 | #define SOCK_CLOEXEC SOCK_CLOEXEC | |
| 52 | SOCK_NONBLOCK = 00000200	/* Atomically mark descriptor(s) as | |
| 53 | 				 non-blocking. */ | |
| 54 | #define SOCK_NONBLOCK SOCK_NONBLOCK | |
| 55 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/statfs.h created+73| ... | ... | @@ -0,0 +1,73 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_STATFS_H | |
| 19 | # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #include <bits/types.h> /* for __fsid_t and __fsblkcnt_t*/ | |
| 23 | ||
| 24 | struct statfs | |
| 25 | { | |
| 26 | long int f_type; | |
| 27 | #define f_fstyp f_type | |
| 28 | long int f_bsize; | |
| 29 | long int f_frsize;	/* Fragment size - unsupported */ | |
| 30 | #ifndef __USE_FILE_OFFSET64 | |
| 31 | __fsblkcnt_t f_blocks; | |
| 32 | __fsblkcnt_t f_bfree; | |
| 33 | __fsblkcnt_t f_files; | |
| 34 | __fsblkcnt_t f_ffree; | |
| 35 | __fsblkcnt_t f_bavail; | |
| 36 | #else | |
| 37 | __fsblkcnt64_t f_blocks; | |
| 38 | __fsblkcnt64_t f_bfree; | |
| 39 | __fsblkcnt64_t f_files; | |
| 40 | __fsblkcnt64_t f_ffree; | |
| 41 | __fsblkcnt64_t f_bavail; | |
| 42 | #endif | |
| 43 | ||
| 44 | 	/* Linux specials */ | |
| 45 | __fsid_t f_fsid; | |
| 46 | long int f_namelen; | |
| 47 | long int f_flags; | |
| 48 | long int f_spare[5]; | |
| 49 | }; | |
| 50 | ||
| 51 | #ifdef __USE_LARGEFILE64 | |
| 52 | struct statfs64 | |
| 53 | { | |
| 54 | long int f_type; | |
| 55 | #define f_fstyp f_type | |
| 56 | long int f_bsize; | |
| 57 | long int f_frsize;	/* Fragment size - unsupported */ | |
| 58 | __fsblkcnt64_t f_blocks; | |
| 59 | __fsblkcnt64_t f_bfree; | |
| 60 | __fsblkcnt64_t f_files; | |
| 61 | __fsblkcnt64_t f_ffree; | |
| 62 | __fsblkcnt64_t f_bavail; | |
| 63 | ||
| 64 | 	/* Linux specials */ | |
| 65 | __fsid_t f_fsid; | |
| 66 | long int f_namelen; | |
| 67 | long int f_flags; | |
| 68 | long int f_spare[5]; | |
| 69 | }; | |
| 70 | #endif | |
| 71 | ||
| 72 | /* Tell code we have these members. */ | |
| 73 | #define _STATFS_F_NAMELEN | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/struct_mutex.h created+56| ... | ... | @@ -0,0 +1,56 @@ |
| 1 | /* MIPS internal mutex struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _THREAD_MUTEX_INTERNAL_H | |
| 20 | #define _THREAD_MUTEX_INTERNAL_H 1 | |
| 21 | ||
| 22 | struct __pthread_mutex_s | |
| 23 | { | |
| 24 | int __lock; | |
| 25 | unsigned int __count; | |
| 26 | int __owner; | |
| 27 | #if _MIPS_SIM == _ABI64 | |
| 28 | unsigned int __nusers; | |
| 29 | #endif | |
| 30 | /* KIND must stay at this position in the structure to maintain | |
| 31 | binary compatibility with static initializers. */ | |
| 32 | int __kind; | |
| 33 | #if _MIPS_SIM == _ABI64 | |
| 34 | int __spins; | |
| 35 | __pthread_list_t __list; | |
| 36 | # define __PTHREAD_MUTEX_HAVE_PREV 1 | |
| 37 | #else | |
| 38 | unsigned int __nusers; | |
| 39 | __extension__ union | |
| 40 | { | |
| 41 | int __spins; | |
| 42 | __pthread_slist_t __list; | |
| 43 | }; | |
| 44 | # define __PTHREAD_MUTEX_HAVE_PREV 0 | |
| 45 | #endif | |
| 46 | }; | |
| 47 | ||
| 48 | #if _MIPS_SIM == _ABI64 | |
| 49 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 50 | 0, 0, 0, 0, __kind, 0, { 0, 0 } | |
| 51 | #else | |
| 52 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 53 | 0, 0, 0, __kind, 0, { 0 } | |
| 54 | #endif | |
| 55 | ||
| 56 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/termios-c_cc.h created+43| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | /* termios c_cc symbolic constant definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_cc.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_cc characters */ | |
| 24 | #define VINTR		0	/* Interrupt character [ISIG]. */ | |
| 25 | #define VQUIT		1	/* Quit character [ISIG]. */ | |
| 26 | #define VERASE		2	/* Erase character [ICANON]. */ | |
| 27 | #define VKILL		3	/* Kill-line character [ICANON]. */ | |
| 28 | #define VMIN		4	/* Minimum number of bytes read at once [!ICANON]. */ | |
| 29 | #define VTIME		5	/* Time-out value (tenths of a second) [!ICANON]. */ | |
| 30 | #define VEOL2		6	/* Second EOL character [ICANON]. */ | |
| 31 | #define VSWTC		7 | |
| 32 | #define VSWTCH		VSWTC | |
| 33 | #define VSTART		8	/* Start (X-ON) character [IXON, IXOFF]. */ | |
| 34 | #define VSTOP		9	/* Stop (X-OFF) character [IXON, IXOFF]. */ | |
| 35 | #define VSUSP		10	/* Suspend character [ISIG]. */ | |
| 36 | 				/* VDSUSP is not supported on Linux. */ | |
| 37 | /* #define VDSUSP	11	/ * Delayed suspend character [ISIG]. */ | |
| 38 | #define VREPRINT	12	/* Reprint-line character [ICANON]. */ | |
| 39 | #define VDISCARD	13	/* Discard character [IEXTEN]. */ | |
| 40 | #define VWERASE		14	/* Word-erase character [ICANON]. */ | |
| 41 | #define VLNEXT		15	/* Literal-next character [IEXTEN]. */ | |
| 42 | #define VEOF		16	/* End-of-file character [ICANON]. */ | |
| 43 | #define VEOL		17	/* End-of-line character [ICANON]. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/termios-c_lflag.h created+46| ... | ... | @@ -0,0 +1,46 @@ |
| 1 | /* termios local mode definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_lflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_lflag bits */ | |
| 24 | #define ISIG	0000001		/* Enable signals. */ | |
| 25 | #define ICANON	0000002		/* Do erase and kill processing. */ | |
| 26 | #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) | |
| 27 | # define XCASE	0000004 | |
| 28 | #endif | |
| 29 | #define ECHO	0000010		/* Enable echo. */ | |
| 30 | #define ECHOE	0000020		/* Visual erase for ERASE. */ | |
| 31 | #define ECHOK	0000040		/* Echo NL after KILL. */ | |
| 32 | #define ECHONL	0000100		/* Echo NL even if ECHO is off. */ | |
| 33 | #define NOFLSH	0000200		/* Disable flush after interrupt. */ | |
| 34 | #define IEXTEN	0000400		/* Enable DISCARD and LNEXT. */ | |
| 35 | #ifdef __USE_MISC | |
| 36 | # define ECHOCTL 0001000	/* Echo control characters as ^X. */ | |
| 37 | # define ECHOPRT 0002000	/* Hardcopy visual erase. */ | |
| 38 | # define ECHOKE	 0004000	/* Visual erase for KILL. */ | |
| 39 | # define FLUSHO	0020000 | |
| 40 | # define PENDIN	0040000		/* Retype pending input (state). */ | |
| 41 | #endif | |
| 42 | #define TOSTOP	0100000		/* Send SIGTTOU for background output. */ | |
| 43 | #define ITOSTOP	TOSTOP | |
| 44 | #ifdef __USE_MISC | |
| 45 | # define EXTPROC 0200000 | |
| 46 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/termios-struct.h created+34| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | /* struct termios definition. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-struct.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define NCCS 32 | |
| 24 | struct termios | |
| 25 | { | |
| 26 | tcflag_t c_iflag;		/* input mode flags */ | |
| 27 | tcflag_t c_oflag;		/* output mode flags */ | |
| 28 | tcflag_t c_cflag;		/* control mode flags */ | |
| 29 | tcflag_t c_lflag;		/* local mode flags */ | |
| 30 | cc_t c_line;		/* line discipline */ | |
| 31 | cc_t c_cc[NCCS];		/* control characters */ | |
| 32 | #define _HAVE_STRUCT_TERMIOS_C_ISPEED 0 | |
| 33 | #define _HAVE_STRUCT_TERMIOS_C_OSPEED 0 | |
| 34 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/termios-tcflow.h created+26| ... | ... | @@ -0,0 +1,26 @@ |
| 1 | /* termios local mode definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-tcflow.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* tcsetattr uses these */ | |
| 24 | #define	TCSANOW		0x540e	/* Same as TCSETS; change immediately. */ | |
| 25 | #define	TCSADRAIN	0x540f	/* Same as TCSETSW; change when pending output is written. */ | |
| 26 | #define	TCSAFLUSH	0x5410	/* Same as TCSETSF; flush pending input before changing. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/timerfd.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* Copyright (C) 2008-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_TIMERFD_H | |
| 19 | # error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Bits to be set in the FLAGS parameter of `timerfd_create'. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | TFD_CLOEXEC = 02000000, | |
| 26 | #define TFD_CLOEXEC TFD_CLOEXEC | |
| 27 | TFD_NONBLOCK = 00000200 | |
| 28 | #define TFD_NONBLOCK TFD_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/types/stack_t.h created+33| ... | ... | @@ -0,0 +1,33 @@ |
| 1 | /* Define stack_t. MIPS Linux version. | |
| 2 | Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __stack_t_defined | |
| 20 | #define __stack_t_defined 1 | |
| 21 | ||
| 22 | #define __need_size_t | |
| 23 | #include <stddef.h> | |
| 24 | ||
| 25 | /* Structure describing a signal stack. */ | |
| 26 | typedef struct | |
| 27 | { | |
| 28 | void *ss_sp; | |
| 29 | size_t ss_size; | |
| 30 | int ss_flags; | |
| 31 | } stack_t; | |
| 32 | ||
| 33 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/types/struct_msqid_ds.h created+62| ... | ... | @@ -0,0 +1,62 @@ |
| 1 | /* Linux/MIPS implementation of the SysV message struct msqid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MSG_H | |
| 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 25 | /* Structure of record for one message inside the kernel. | |
| 26 | The type `struct msg' is opaque. */ | |
| 27 | struct msqid_ds | |
| 28 | { | |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ | |
| 33 | # if __TIMESIZE == 32 | |
| 34 | # ifdef __MIPSEL__ | |
| 35 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 36 | unsigned long int __msg_stime_high; | |
| 37 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 38 | unsigned long int __msg_rtime_high; | |
| 39 | __time_t msg_ctime;		/* time of last change */ | |
| 40 | unsigned long int __msg_ctime_high; | |
| 41 | # else | |
| 42 | unsigned long int __msg_stime_high; | |
| 43 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 44 | unsigned long int __msg_rtime_high; | |
| 45 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 46 | unsigned long int __msg_ctime_high; | |
| 47 | __time_t msg_ctime;		/* time of last change */ | |
| 48 | # endif | |
| 49 | # else | |
| 50 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 51 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 52 | __time_t msg_ctime;		/* time of last change */ | |
| 53 | # endif | |
| 54 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ | |
| 55 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ | |
| 56 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ | |
| 57 | __pid_t msg_lspid;		/* pid of last msgsnd() */ | |
| 58 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ | |
| 59 | __syscall_ulong_t __glibc_reserved4; | |
| 60 | __syscall_ulong_t __glibc_reserved5; | |
| 61 | #endif | |
| 62 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/types/struct_semid_ds.h created+36| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | /* MIPS implementation of the semaphore struct semid_ds | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SEM_H | |
| 20 | # error "Never include <bits/types/struct_semid_ds.h> directly; use <sys/sem.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a set of semaphores. */ | |
| 24 | struct semid_ds | |
| 25 | { | |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 29 | struct ipc_perm sem_perm;		/* operation permission struct */ | |
| 30 | __time_t sem_otime;	/* last semop() time */ | |
| 31 | __time_t sem_ctime;	/* last time changed by semctl() */ | |
| 32 | __syscall_ulong_t sem_nsems;		/* number of semaphores in set */ | |
| 33 | __syscall_ulong_t __sem_otime_high; | |
| 34 | __syscall_ulong_t __sem_ctime_high; | |
| 35 | #endif | |
| 36 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/bits/types/struct_shmid_ds.h created+53| ... | ... | @@ -0,0 +1,53 @@ |
| 1 | /* Linux/MIPS implementation of the shared memory struct shmid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never include <bits/types/struct_shmid_ds.h> directly; use <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a shared memory segment. */ | |
| 24 | struct shmid_ds | |
| 25 | { | |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 29 | struct ipc_perm shm_perm;		/* operation permission struct */ | |
| 30 | size_t shm_segsz;			/* size of segment in bytes */ | |
| 31 | # if __TIMESIZE == 32 | |
| 32 | __time_t shm_atime;			/* time of last shmat() */ | |
| 33 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 34 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 35 | # else | |
| 36 | __time_t shm_atime;			/* time of last shmat() */ | |
| 37 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 38 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 39 | # endif | |
| 40 | __pid_t shm_cpid;			/* pid of creator */ | |
| 41 | __pid_t shm_lpid;			/* pid of last shmop */ | |
| 42 | shmatt_t shm_nattch;		/* number of current attaches */ | |
| 43 | # if __TIMESIZE == 32 | |
| 44 | unsigned short int __shm_atime_high; | |
| 45 | unsigned short int __shm_dtime_high; | |
| 46 | unsigned short int __shm_ctime_high; | |
| 47 | unsigned short int __glibc_reserved4; | |
| 48 | # else | |
| 49 | __syscall_ulong_t __glibc_reserved5; | |
| 50 | __syscall_ulong_t __glibc_reserved6; | |
| 51 | # endif | |
| 52 | #endif | |
| 53 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabi/ieee754.h created+326| ... | ... | @@ -0,0 +1,326 @@ |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _IEEE754_H | |
| 19 | #define _IEEE754_H 1 | |
| 20 | ||
| 21 | #include <features.h> | |
| 22 | ||
| 23 | #include <bits/endian.h> | |
| 24 | ||
| 25 | #ifndef __LDBL_MANT_DIG__ | |
| 26 | # include <float.h> | |
| 27 | # define __LDBL_MANT_DIG__ LDBL_MANT_DIG | |
| 28 | #endif | |
| 29 | ||
| 30 | __BEGIN_DECLS | |
| 31 | ||
| 32 | union ieee754_float | |
| 33 | { | |
| 34 | float f; | |
| 35 | ||
| 36 | /* This is the IEEE 754 single-precision format. */ | |
| 37 | struct | |
| 38 | { | |
| 39 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 40 | 	unsigned int negative:1; | |
| 41 | 	unsigned int exponent:8; | |
| 42 | 	unsigned int mantissa:23; | |
| 43 | #endif				/* Big endian. */ | |
| 44 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 45 | 	unsigned int mantissa:23; | |
| 46 | 	unsigned int exponent:8; | |
| 47 | 	unsigned int negative:1; | |
| 48 | #endif				/* Little endian. */ | |
| 49 | } ieee; | |
| 50 | ||
| 51 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 52 | struct | |
| 53 | { | |
| 54 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 55 | 	unsigned int negative:1; | |
| 56 | 	unsigned int exponent:8; | |
| 57 | 	unsigned int quiet_nan:1; | |
| 58 | 	unsigned int mantissa:22; | |
| 59 | #endif				/* Big endian. */ | |
| 60 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 61 | 	unsigned int mantissa:22; | |
| 62 | 	unsigned int quiet_nan:1; | |
| 63 | 	unsigned int exponent:8; | |
| 64 | 	unsigned int negative:1; | |
| 65 | #endif				/* Little endian. */ | |
| 66 | } ieee_nan; | |
| 67 | }; | |
| 68 | ||
| 69 | #define IEEE754_FLOAT_BIAS	0x7f /* Added to exponent. */ | |
| 70 | ||
| 71 | ||
| 72 | union ieee754_double | |
| 73 | { | |
| 74 | double d; | |
| 75 | ||
| 76 | /* This is the IEEE 754 double-precision format. */ | |
| 77 | struct | |
| 78 | { | |
| 79 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 80 | 	unsigned int negative:1; | |
| 81 | 	unsigned int exponent:11; | |
| 82 | 	/* Together these comprise the mantissa. */ | |
| 83 | 	unsigned int mantissa0:20; | |
| 84 | 	unsigned int mantissa1:32; | |
| 85 | #endif				/* Big endian. */ | |
| 86 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 87 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 88 | 	unsigned int mantissa0:20; | |
| 89 | 	unsigned int exponent:11; | |
| 90 | 	unsigned int negative:1; | |
| 91 | 	unsigned int mantissa1:32; | |
| 92 | # else | |
| 93 | 	/* Together these comprise the mantissa. */ | |
| 94 | 	unsigned int mantissa1:32; | |
| 95 | 	unsigned int mantissa0:20; | |
| 96 | 	unsigned int exponent:11; | |
| 97 | 	unsigned int negative:1; | |
| 98 | # endif | |
| 99 | #endif				/* Little endian. */ | |
| 100 | } ieee; | |
| 101 | ||
| 102 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 103 | struct | |
| 104 | { | |
| 105 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 106 | 	unsigned int negative:1; | |
| 107 | 	unsigned int exponent:11; | |
| 108 | 	unsigned int quiet_nan:1; | |
| 109 | 	/* Together these comprise the mantissa. */ | |
| 110 | 	unsigned int mantissa0:19; | |
| 111 | 	unsigned int mantissa1:32; | |
| 112 | #else | |
| 113 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 114 | 	unsigned int mantissa0:19; | |
| 115 | 	unsigned int quiet_nan:1; | |
| 116 | 	unsigned int exponent:11; | |
| 117 | 	unsigned int negative:1; | |
| 118 | 	unsigned int mantissa1:32; | |
| 119 | # else | |
| 120 | 	/* Together these comprise the mantissa. */ | |
| 121 | 	unsigned int mantissa1:32; | |
| 122 | 	unsigned int mantissa0:19; | |
| 123 | 	unsigned int quiet_nan:1; | |
| 124 | 	unsigned int exponent:11; | |
| 125 | 	unsigned int negative:1; | |
| 126 | # endif | |
| 127 | #endif | |
| 128 | } ieee_nan; | |
| 129 | }; | |
| 130 | ||
| 131 | #define IEEE754_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 132 | ||
| 133 | #if __LDBL_MANT_DIG__ == 113 | |
| 134 | ||
| 135 | union ieee854_long_double | |
| 136 | { | |
| 137 | long double d; | |
| 138 | ||
| 139 | /* This is the IEEE 854 quad-precision format. */ | |
| 140 | struct | |
| 141 | { | |
| 142 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 143 | 	unsigned int negative:1; | |
| 144 | 	unsigned int exponent:15; | |
| 145 | 	/* Together these comprise the mantissa. */ | |
| 146 | 	unsigned int mantissa0:16; | |
| 147 | 	unsigned int mantissa1:32; | |
| 148 | 	unsigned int mantissa2:32; | |
| 149 | 	unsigned int mantissa3:32; | |
| 150 | #endif				/* Big endian. */ | |
| 151 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 152 | 	/* Together these comprise the mantissa. */ | |
| 153 | 	unsigned int mantissa3:32; | |
| 154 | 	unsigned int mantissa2:32; | |
| 155 | 	unsigned int mantissa1:32; | |
| 156 | 	unsigned int mantissa0:16; | |
| 157 | 	unsigned int exponent:15; | |
| 158 | 	unsigned int negative:1; | |
| 159 | #endif				/* Little endian. */ | |
| 160 | } ieee; | |
| 161 | ||
| 162 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 163 | struct | |
| 164 | { | |
| 165 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 166 | 	unsigned int negative:1; | |
| 167 | 	unsigned int exponent:15; | |
| 168 | 	unsigned int quiet_nan:1; | |
| 169 | 	/* Together these comprise the mantissa. */ | |
| 170 | 	unsigned int mantissa0:15; | |
| 171 | 	unsigned int mantissa1:32; | |
| 172 | 	unsigned int mantissa2:32; | |
| 173 | 	unsigned int mantissa3:32; | |
| 174 | #endif				/* Big endian. */ | |
| 175 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 176 | 	/* Together these comprise the mantissa. */ | |
| 177 | 	unsigned int mantissa3:32; | |
| 178 | 	unsigned int mantissa2:32; | |
| 179 | 	unsigned int mantissa1:32; | |
| 180 | 	unsigned int mantissa0:15; | |
| 181 | 	unsigned int quiet_nan:1; | |
| 182 | 	unsigned int exponent:15; | |
| 183 | 	unsigned int negative:1; | |
| 184 | #endif				/* Little endian. */ | |
| 185 | } ieee_nan; | |
| 186 | }; | |
| 187 | ||
| 188 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ | |
| 189 | ||
| 190 | #elif __LDBL_MANT_DIG__ == 64 | |
| 191 | ||
| 192 | union ieee854_long_double | |
| 193 | { | |
| 194 | long double d; | |
| 195 | ||
| 196 | /* This is the IEEE 854 double-extended-precision format. */ | |
| 197 | struct | |
| 198 | { | |
| 199 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 200 | 	unsigned int negative:1; | |
| 201 | 	unsigned int exponent:15; | |
| 202 | 	unsigned int empty:16; | |
| 203 | 	unsigned int mantissa0:32; | |
| 204 | 	unsigned int mantissa1:32; | |
| 205 | #endif | |
| 206 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 207 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 208 | 	unsigned int exponent:15; | |
| 209 | 	unsigned int negative:1; | |
| 210 | 	unsigned int empty:16; | |
| 211 | 	unsigned int mantissa0:32; | |
| 212 | 	unsigned int mantissa1:32; | |
| 213 | # else | |
| 214 | 	unsigned int mantissa1:32; | |
| 215 | 	unsigned int mantissa0:32; | |
| 216 | 	unsigned int exponent:15; | |
| 217 | 	unsigned int negative:1; | |
| 218 | 	unsigned int empty:16; | |
| 219 | # endif | |
| 220 | #endif | |
| 221 | } ieee; | |
| 222 | ||
| 223 | /* This is for NaNs in the IEEE 854 double-extended-precision format. */ | |
| 224 | struct | |
| 225 | { | |
| 226 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 227 | 	unsigned int negative:1; | |
| 228 | 	unsigned int exponent:15; | |
| 229 | 	unsigned int empty:16; | |
| 230 | 	unsigned int one:1; | |
| 231 | 	unsigned int quiet_nan:1; | |
| 232 | 	unsigned int mantissa0:30; | |
| 233 | 	unsigned int mantissa1:32; | |
| 234 | #endif | |
| 235 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 236 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 237 | 	unsigned int exponent:15; | |
| 238 | 	unsigned int negative:1; | |
| 239 | 	unsigned int empty:16; | |
| 240 | 	unsigned int mantissa0:30; | |
| 241 | 	unsigned int quiet_nan:1; | |
| 242 | 	unsigned int one:1; | |
| 243 | 	unsigned int mantissa1:32; | |
| 244 | # else | |
| 245 | 	unsigned int mantissa1:32; | |
| 246 | 	unsigned int mantissa0:30; | |
| 247 | 	unsigned int quiet_nan:1; | |
| 248 | 	unsigned int one:1; | |
| 249 | 	unsigned int exponent:15; | |
| 250 | 	unsigned int negative:1; | |
| 251 | 	unsigned int empty:16; | |
| 252 | # endif | |
| 253 | #endif | |
| 254 | } ieee_nan; | |
| 255 | }; | |
| 256 | ||
| 257 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff | |
| 258 | ||
| 259 | #elif __LDBL_MANT_DIG__ == 53 | |
| 260 | ||
| 261 | union ieee854_long_double | |
| 262 | { | |
| 263 | long double d; | |
| 264 | ||
| 265 | /* This is the IEEE 754 double-precision format. */ | |
| 266 | struct | |
| 267 | { | |
| 268 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 269 | 	unsigned int negative:1; | |
| 270 | 	unsigned int exponent:11; | |
| 271 | 	/* Together these comprise the mantissa. */ | |
| 272 | 	unsigned int mantissa0:20; | |
| 273 | 	unsigned int mantissa1:32; | |
| 274 | #endif				/* Big endian. */ | |
| 275 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 276 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 277 | 	unsigned int mantissa0:20; | |
| 278 | 	unsigned int exponent:11; | |
| 279 | 	unsigned int negative:1; | |
| 280 | 	unsigned int mantissa1:32; | |
| 281 | # else | |
| 282 | 	/* Together these comprise the mantissa. */ | |
| 283 | 	unsigned int mantissa1:32; | |
| 284 | 	unsigned int mantissa0:20; | |
| 285 | 	unsigned int exponent:11; | |
| 286 | 	unsigned int negative:1; | |
| 287 | # endif | |
| 288 | #endif				/* Little endian. */ | |
| 289 | } ieee; | |
| 290 | ||
| 291 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 292 | struct | |
| 293 | { | |
| 294 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 295 | 	unsigned int negative:1; | |
| 296 | 	unsigned int exponent:11; | |
| 297 | 	unsigned int quiet_nan:1; | |
| 298 | 	/* Together these comprise the mantissa. */ | |
| 299 | 	unsigned int mantissa0:19; | |
| 300 | 	unsigned int mantissa1:32; | |
| 301 | #else | |
| 302 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 303 | 	unsigned int mantissa0:19; | |
| 304 | 	unsigned int quiet_nan:1; | |
| 305 | 	unsigned int exponent:11; | |
| 306 | 	unsigned int negative:1; | |
| 307 | 	unsigned int mantissa1:32; | |
| 308 | # else | |
| 309 | 	/* Together these comprise the mantissa. */ | |
| 310 | 	unsigned int mantissa1:32; | |
| 311 | 	unsigned int mantissa0:19; | |
| 312 | 	unsigned int quiet_nan:1; | |
| 313 | 	unsigned int exponent:11; | |
| 314 | 	unsigned int negative:1; | |
| 315 | # endif | |
| 316 | #endif | |
| 317 | } ieee_nan; | |
| 318 | }; | |
| 319 | ||
| 320 | #define IEEE854_LONG_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 321 | ||
| 322 | #endif /* __LDBL_MANT_DIG__ == 53 */ | |
| 323 | ||
| 324 | __END_DECLS | |
| 325 | ||
| 326 | #endif /* ieee754.h */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/dlfcn.h created+64| ... | ... | @@ -0,0 +1,64 @@ |
| 1 | /* System dependent definitions for run-time dynamic loading. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _DLFCN_H | |
| 20 | # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The MODE argument to `dlopen' contains one of the following: */ | |
| 24 | #define RTLD_LAZY	0x0001	/* Lazy function call binding. */ | |
| 25 | #define RTLD_NOW	0x0002	/* Immediate function call binding. */ | |
| 26 | #define RTLD_BINDING_MASK 0x3	/* Mask of binding time value. */ | |
| 27 | #define RTLD_NOLOAD	0x00008	/* Do not load the object. */ | |
| 28 | #define RTLD_DEEPBIND	0x00010	/* Use deep binding. */ | |
| 29 | ||
| 30 | /* If the following bit is set in the MODE argument to `dlopen', | |
| 31 | the symbols of the loaded object and its dependencies are made | |
| 32 | visible as if the object were linked directly into the program. */ | |
| 33 | #define RTLD_GLOBAL	0x0004 | |
| 34 | ||
| 35 | /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. | |
| 36 | The implementation does this by default and so we can define the | |
| 37 | value to zero. */ | |
| 38 | #define RTLD_LOCAL 0 | |
| 39 | ||
| 40 | /* Do not delete object when closed. */ | |
| 41 | #define RTLD_NODELETE	0x01000 | |
| 42 | ||
| 43 | #ifdef __USE_GNU | |
| 44 | /* To support profiling of shared objects it is a good idea to call | |
| 45 | the function found using `dlsym' using the following macro since | |
| 46 | these calls do not use the PLT. But this would mean the dynamic | |
| 47 | loader has no chance to find out when the function is called. The | |
| 48 | macro applies the necessary magic so that profiling is possible. | |
| 49 | Rewrite | |
| 50 | 	foo = (*fctp) (arg1, arg2); | |
| 51 | into | |
| 52 | foo = DL_CALL_FCT (fctp, (arg1, arg2)); | |
| 53 | */ | |
| 54 | # define DL_CALL_FCT(fctp, args) \ | |
| 55 | (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args) | |
| 56 | ||
| 57 | __BEGIN_DECLS | |
| 58 | ||
| 59 | /* This function calls the profiling functions. */ | |
| 60 | extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW; | |
| 61 | ||
| 62 | __END_DECLS | |
| 63 | ||
| 64 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/errno.h created+52| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | /* Error constants. MIPS/Linux specific version. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_ERRNO_H | |
| 20 | ||
| 21 | #if !defined _ERRNO_H | |
| 22 | # error "Never include <bits/errno.h> directly; use <errno.h> instead." | |
| 23 | #endif | |
| 24 | ||
| 25 | # include <linux/errno.h> | |
| 26 | ||
| 27 | /* Older Linux headers do not define these constants. */ | |
| 28 | # ifndef ENOTSUP | |
| 29 | # define ENOTSUP		EOPNOTSUPP | |
| 30 | # endif | |
| 31 | ||
| 32 | # ifndef ECANCELED | |
| 33 | # define ECANCELED		158 | |
| 34 | # endif | |
| 35 | ||
| 36 | # ifndef EOWNERDEAD | |
| 37 | # define EOWNERDEAD		165 | |
| 38 | # endif | |
| 39 | ||
| 40 | # ifndef ENOTRECOVERABLE | |
| 41 | # define ENOTRECOVERABLE	166 | |
| 42 | # endif | |
| 43 | ||
| 44 | # ifndef ERFKILL | |
| 45 | # define ERFKILL		167 | |
| 46 | # endif | |
| 47 | ||
| 48 | # ifndef EHWPOISON | |
| 49 | # define EHWPOISON		168 | |
| 50 | # endif | |
| 51 | ||
| 52 | #endif /* bits/errno.h. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/eventfd.h created+31| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | /* Copyright (C) 2007-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_EVENTFD_H | |
| 19 | # error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for eventfd. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | EFD_SEMAPHORE = 00000001, | |
| 26 | #define EFD_SEMAPHORE EFD_SEMAPHORE | |
| 27 | EFD_CLOEXEC = 02000000, | |
| 28 | #define EFD_CLOEXEC EFD_CLOEXEC | |
| 29 | EFD_NONBLOCK = 00000200 | |
| 30 | #define EFD_NONBLOCK EFD_NONBLOCK | |
| 31 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/inotify.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_INOTIFY_H | |
| 19 | # error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for the parameter of inotify_init1. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | IN_CLOEXEC = 02000000, | |
| 26 | #define IN_CLOEXEC IN_CLOEXEC | |
| 27 | IN_NONBLOCK = 00000200 | |
| 28 | #define IN_NONBLOCK IN_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/ioctl-types.h created+75| ... | ... | @@ -0,0 +1,75 @@ |
| 1 | /* Structure types for pre-termios terminal ioctls. Linux/MIPS version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_IOCTL_H | |
| 20 | # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Get definition of constants for use with `ioctl'. */ | |
| 24 | #include <asm/ioctls.h> | |
| 25 | ||
| 26 | struct winsize | |
| 27 | { | |
| 28 | unsigned short int ws_row; | |
| 29 | unsigned short int ws_col; | |
| 30 | unsigned short int ws_xpixel; | |
| 31 | unsigned short int ws_ypixel; | |
| 32 | }; | |
| 33 | ||
| 34 | #define NCC	8 | |
| 35 | struct termio | |
| 36 | { | |
| 37 | unsigned short int c_iflag;		/* input mode flags */ | |
| 38 | unsigned short int c_oflag;		/* output mode flags */ | |
| 39 | unsigned short int c_cflag;		/* control mode flags */ | |
| 40 | unsigned short int c_lflag;		/* local mode flags */ | |
| 41 | char c_line;			/* line discipline */ | |
| 42 | /* Yes, this is really NCCS. */ | |
| 43 | unsigned char c_cc[32 /* NCCS */]; /* control characters */ | |
| 44 | }; | |
| 45 | ||
| 46 | /* modem lines */ | |
| 47 | #define TIOCM_LE	0x001		/* line enable */ | |
| 48 | #define TIOCM_DTR	0x002		/* data terminal ready */ | |
| 49 | #define TIOCM_RTS	0x004		/* request to send */ | |
| 50 | #define TIOCM_ST	0x010		/* secondary transmit */ | |
| 51 | #define TIOCM_SR	0x020		/* secondary receive */ | |
| 52 | #define TIOCM_CTS	0x040		/* clear to send */ | |
| 53 | #define TIOCM_CAR	0x100		/* carrier detect */ | |
| 54 | #define TIOCM_CD	TIOCM_CAR | |
| 55 | #define TIOCM_RNG	0x200		/* ring */ | |
| 56 | #define TIOCM_RI	TIOCM_RNG | |
| 57 | #define TIOCM_DSR	0x400		/* data set ready */ | |
| 58 | ||
| 59 | /* line disciplines */ | |
| 60 | #define N_TTY		0 | |
| 61 | #define N_SLIP		1 | |
| 62 | #define N_MOUSE		2 | |
| 63 | #define N_PPP		3 | |
| 64 | #define N_STRIP		4 | |
| 65 | #define N_AX25		5 | |
| 66 | #define N_X25		6	/* X.25 async */ | |
| 67 | #define N_6PACK		7 | |
| 68 | #define N_MASC		8	/* Mobitex module */ | |
| 69 | #define N_R3964		9	/* Simatic R3964 module */ | |
| 70 | #define N_PROFIBUS_FDL	10	/* Profibus */ | |
| 71 | #define N_IRDA		11	/* Linux IR */ | |
| 72 | #define N_SMSBLOCK	12	/* SMS block mode */ | |
| 73 | #define N_HDLC		13	/* synchronous HDLC */ | |
| 74 | #define N_SYNC_PPP	14	/* synchronous PPP */ | |
| 75 | #define	N_HCI		15	/* Bluetooth HCI UART */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/ipctypes.h created+31| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | /* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. MIPS version | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* | |
| 20 | * Never include <bits/ipctypes.h> directly. | |
| 21 | */ | |
| 22 | ||
| 23 | #ifndef _BITS_IPCTYPES_H | |
| 24 | #define _BITS_IPCTYPES_H	1 | |
| 25 | ||
| 26 | #include <bits/types.h> | |
| 27 | ||
| 28 | typedef __SLONG32_TYPE __ipc_pid_t; | |
| 29 | ||
| 30 | ||
| 31 | #endif /* bits/ipctypes.h */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/mman.h created+48| ... | ... | @@ -0,0 +1,48 @@ |
| 1 | /* Definitions for POSIX memory map interface. Linux/MIPS version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MMAN_H | |
| 20 | # error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The following definitions basically come from the kernel headers. | |
| 24 | But the kernel header is not namespace clean. */ | |
| 25 | ||
| 26 | /* These are Linux-specific. */ | |
| 27 | #ifdef __USE_MISC | |
| 28 | # define MAP_NORESERVE	0x0400		/* don't check for reservations */ | |
| 29 | # define MAP_GROWSDOWN	0x1000		/* stack-like segment */ | |
| 30 | # define MAP_DENYWRITE	0x2000		/* ETXTBSY */ | |
| 31 | # define MAP_EXECUTABLE	0x4000		/* mark it as an executable */ | |
| 32 | # define MAP_LOCKED	0x8000		/* pages are locked */ | |
| 33 | # define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ | |
| 34 | # define MAP_NONBLOCK 0x20000 /* do not block on IO */ | |
| 35 | # define MAP_STACK	0x40000		/* Allocation is for a stack. */ | |
| 36 | # define MAP_HUGETLB	0x80000		/* Create huge page mapping. */ | |
| 37 | # define MAP_FIXED_NOREPLACE 0x100000	/* MAP_FIXED but do not unmap | |
| 38 | 					 underlying mapping. */ | |
| 39 | #endif | |
| 40 | ||
| 41 | #define __MAP_ANONYMOUS 0x0800 | |
| 42 | ||
| 43 | /* Include generic Linux declarations. */ | |
| 44 | #include <bits/mman-linux.h> | |
| 45 | ||
| 46 | #ifdef __USE_MISC | |
| 47 | # define MAP_RENAME	MAP_ANONYMOUS | |
| 48 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/poll.h created+49| ... | ... | @@ -0,0 +1,49 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_POLL_H | |
| 19 | # error "Never use <bits/poll.h> directly; include <sys/poll.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Event types that can be polled for. These bits may be set in `events' | |
| 23 | to indicate the interesting event types; they will appear in `revents' | |
| 24 | to indicate the status of the file descriptor. */ | |
| 25 | #define POLLIN		0x001		/* There is data to read. */ | |
| 26 | #define POLLPRI		0x002		/* There is urgent data to read. */ | |
| 27 | #define POLLOUT		0x004		/* Writing now will not block. */ | |
| 28 | ||
| 29 | #if defined __USE_XOPEN || defined __USE_XOPEN2K8 | |
| 30 | /* These values are defined in XPG4.2. */ | |
| 31 | # define POLLRDNORM	0x040		/* Normal data may be read. */ | |
| 32 | # define POLLRDBAND	0x080		/* Priority data may be read. */ | |
| 33 | # define POLLWRNORM	POLLOUT		/* Writing now will not block. */ | |
| 34 | # define POLLWRBAND	0x100		/* Priority data may be written. */ | |
| 35 | #endif | |
| 36 | ||
| 37 | #ifdef __USE_GNU | |
| 38 | /* These are extensions for Linux. */ | |
| 39 | # define POLLMSG	0x400 | |
| 40 | # define POLLREMOVE	0x1000 | |
| 41 | # define POLLRDHUP	0x2000 | |
| 42 | #endif | |
| 43 | ||
| 44 | /* Event types always implicitly polled for. These bits need not be set in | |
| 45 | `events', but they will appear in `revents' to indicate the status of | |
| 46 | the file descriptor. */ | |
| 47 | #define POLLERR		0x008		/* Error condition. */ | |
| 48 | #define POLLHUP		0x010		/* Hung up. */ | |
| 49 | #define POLLNVAL	0x020		/* Invalid polling request. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/pthread_stack_min.h created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. MIPS Linux version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. At least two pages with 64k pages. */ | |
| 20 | #define PTHREAD_STACK_MIN	131072 | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/pthreadtypes-arch.h created+44| ... | ... | @@ -0,0 +1,44 @@ |
| 1 | /* Machine-specific pthread type layouts. MIPS version. | |
| 2 | Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_PTHREADTYPES_ARCH_H | |
| 20 | #define _BITS_PTHREADTYPES_ARCH_H	1 | |
| 21 | ||
| 22 | #include <bits/endian.h> | |
| 23 | ||
| 24 | #if _MIPS_SIM == _ABI64 | |
| 25 | # define __SIZEOF_PTHREAD_ATTR_T 56 | |
| 26 | # define __SIZEOF_PTHREAD_MUTEX_T 40 | |
| 27 | # define __SIZEOF_PTHREAD_RWLOCK_T 56 | |
| 28 | # define __SIZEOF_PTHREAD_BARRIER_T 32 | |
| 29 | #else | |
| 30 | # define __SIZEOF_PTHREAD_ATTR_T 36 | |
| 31 | # define __SIZEOF_PTHREAD_MUTEX_T 24 | |
| 32 | # define __SIZEOF_PTHREAD_RWLOCK_T 32 | |
| 33 | # define __SIZEOF_PTHREAD_BARRIER_T 20 | |
| 34 | #endif | |
| 35 | #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 | |
| 36 | #define __SIZEOF_PTHREAD_COND_T 48 | |
| 37 | #define __SIZEOF_PTHREAD_CONDATTR_T 4 | |
| 38 | #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 | |
| 39 | #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 | |
| 40 | ||
| 41 | #define __LOCK_ALIGNMENT | |
| 42 | #define __ONCE_ALIGNMENT | |
| 43 | ||
| 44 | #endif	/* bits/pthreadtypes.h */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/resource.h created+231| ... | ... | @@ -0,0 +1,231 @@ |
| 1 | /* Bit values & structures for resource limits. Linux/MIPS version. | |
| 2 | Copyright (C) 1994-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_RESOURCE_H | |
| 20 | # error "Never use <bits/resource.h> directly; include <sys/resource.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/types.h> | |
| 24 | ||
| 25 | /* Transmute defines to enumerations. The macro re-definitions are | |
| 26 | necessary because some programs want to test for operating system | |
| 27 | features with #ifdef RUSAGE_SELF. In ISO C the reflexive | |
| 28 | definition is a no-op. */ | |
| 29 | ||
| 30 | /* Kinds of resource limit. */ | |
| 31 | enum __rlimit_resource | |
| 32 | { | |
| 33 | /* Per-process CPU limit, in seconds. */ | |
| 34 | RLIMIT_CPU = 0, | |
| 35 | #define RLIMIT_CPU RLIMIT_CPU | |
| 36 | ||
| 37 | /* Largest file that can be created, in bytes. */ | |
| 38 | RLIMIT_FSIZE = 1, | |
| 39 | #define	RLIMIT_FSIZE RLIMIT_FSIZE | |
| 40 | ||
| 41 | /* Maximum size of data segment, in bytes. */ | |
| 42 | RLIMIT_DATA = 2, | |
| 43 | #define	RLIMIT_DATA RLIMIT_DATA | |
| 44 | ||
| 45 | /* Maximum size of stack segment, in bytes. */ | |
| 46 | RLIMIT_STACK = 3, | |
| 47 | #define	RLIMIT_STACK RLIMIT_STACK | |
| 48 | ||
| 49 | /* Largest core file that can be created, in bytes. */ | |
| 50 | RLIMIT_CORE = 4, | |
| 51 | #define	RLIMIT_CORE RLIMIT_CORE | |
| 52 | ||
| 53 | /* Largest resident set size, in bytes. | |
| 54 | This affects swapping; processes that are exceeding their | |
| 55 | resident set size will be more likely to have physical memory | |
| 56 | taken from them. */ | |
| 57 | __RLIMIT_RSS = 7, | |
| 58 | #define	RLIMIT_RSS __RLIMIT_RSS | |
| 59 | ||
| 60 | /* Number of open files. */ | |
| 61 | RLIMIT_NOFILE = 5, | |
| 62 | __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ | |
| 63 | #define RLIMIT_NOFILE RLIMIT_NOFILE | |
| 64 | #define RLIMIT_OFILE __RLIMIT_OFILE | |
| 65 | ||
| 66 | /* Address space limit (?) */ | |
| 67 | RLIMIT_AS = 6, | |
| 68 | #define RLIMIT_AS RLIMIT_AS | |
| 69 | ||
| 70 | /* Number of processes. */ | |
| 71 | __RLIMIT_NPROC = 8, | |
| 72 | #define RLIMIT_NPROC __RLIMIT_NPROC | |
| 73 | ||
| 74 | /* Locked-in-memory address space. */ | |
| 75 | __RLIMIT_MEMLOCK = 9, | |
| 76 | #define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK | |
| 77 | ||
| 78 | /* Maximum number of file locks. */ | |
| 79 | __RLIMIT_LOCKS = 10, | |
| 80 | #define RLIMIT_LOCKS __RLIMIT_LOCKS | |
| 81 | ||
| 82 | /* Maximum number of pending signals. */ | |
| 83 | __RLIMIT_SIGPENDING = 11, | |
| 84 | #define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING | |
| 85 | ||
| 86 | /* Maximum bytes in POSIX message queues. */ | |
| 87 | __RLIMIT_MSGQUEUE = 12, | |
| 88 | #define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE | |
| 89 | ||
| 90 | /* Maximum nice priority allowed to raise to. | |
| 91 | Nice levels 19 .. -20 correspond to 0 .. 39 | |
| 92 | values of this resource limit. */ | |
| 93 | __RLIMIT_NICE = 13, | |
| 94 | #define RLIMIT_NICE __RLIMIT_NICE | |
| 95 | ||
| 96 | /* Maximum realtime priority allowed for non-priviledged | |
| 97 | processes. */ | |
| 98 | __RLIMIT_RTPRIO = 14, | |
| 99 | #define RLIMIT_RTPRIO __RLIMIT_RTPRIO | |
| 100 | ||
| 101 | /* Maximum CPU time in microseconds that a process scheduled under a real-time | |
| 102 | scheduling policy may consume without making a blocking system | |
| 103 | call before being forcibly descheduled. */ | |
| 104 | __RLIMIT_RTTIME = 15, | |
| 105 | #define RLIMIT_RTTIME __RLIMIT_RTTIME | |
| 106 | ||
| 107 | __RLIMIT_NLIMITS = 16, | |
| 108 | __RLIM_NLIMITS = __RLIMIT_NLIMITS | |
| 109 | #define RLIMIT_NLIMITS __RLIMIT_NLIMITS | |
| 110 | #define RLIM_NLIMITS __RLIM_NLIMITS | |
| 111 | }; | |
| 112 | ||
| 113 | /* Value to indicate that there is no limit. */ | |
| 114 | #if _MIPS_SIM == _ABI64 | |
| 115 | /* The N64 syscall uses this value. */ | |
| 116 | # define RLIM_INFINITY 0xffffffffffffffffUL | |
| 117 | # ifdef __USE_LARGEFILE64 | |
| 118 | # define RLIM64_INFINITY 0xffffffffffffffffUL | |
| 119 | # endif | |
| 120 | #else | |
| 121 | /* The O32 and N32 syscalls use 0x7fffffff. */ | |
| 122 | # ifndef __USE_FILE_OFFSET64 | |
| 123 | # define RLIM_INFINITY ((long int)(~0UL >> 1)) | |
| 124 | # else | |
| 125 | # define RLIM_INFINITY 0xffffffffffffffffULL | |
| 126 | # endif | |
| 127 | # ifdef __USE_LARGEFILE64 | |
| 128 | # define RLIM64_INFINITY 0xffffffffffffffffULL | |
| 129 | # endif | |
| 130 | #endif | |
| 131 | ||
| 132 | /* We can represent all limits. */ | |
| 133 | #define RLIM_SAVED_MAX	RLIM_INFINITY | |
| 134 | #define RLIM_SAVED_CUR	RLIM_INFINITY | |
| 135 | ||
| 136 | ||
| 137 | /* Type for resource quantity measurement. */ | |
| 138 | #ifndef __USE_FILE_OFFSET64 | |
| 139 | typedef __rlim_t rlim_t; | |
| 140 | #else | |
| 141 | typedef __rlim64_t rlim_t; | |
| 142 | #endif | |
| 143 | #ifdef __USE_LARGEFILE64 | |
| 144 | typedef __rlim64_t rlim64_t; | |
| 145 | #endif | |
| 146 | ||
| 147 | struct rlimit | |
| 148 | { | |
| 149 | /* The current (soft) limit. */ | |
| 150 | rlim_t rlim_cur; | |
| 151 | /* The hard limit. */ | |
| 152 | rlim_t rlim_max; | |
| 153 | }; | |
| 154 | ||
| 155 | #ifdef __USE_LARGEFILE64 | |
| 156 | struct rlimit64 | |
| 157 | { | |
| 158 | /* The current (soft) limit. */ | |
| 159 | rlim64_t rlim_cur; | |
| 160 | /* The hard limit. */ | |
| 161 | rlim64_t rlim_max; | |
| 162 | }; | |
| 163 | #endif | |
| 164 | ||
| 165 | /* Whose usage statistics do you want? */ | |
| 166 | enum __rusage_who | |
| 167 | { | |
| 168 | /* The calling process. */ | |
| 169 | RUSAGE_SELF = 0, | |
| 170 | #define RUSAGE_SELF RUSAGE_SELF | |
| 171 | ||
| 172 | /* All of its terminated child processes. */ | |
| 173 | RUSAGE_CHILDREN = -1 | |
| 174 | #define RUSAGE_CHILDREN RUSAGE_CHILDREN | |
| 175 | ||
| 176 | #ifdef __USE_GNU | |
| 177 | , | |
| 178 | /* The calling thread. */ | |
| 179 | RUSAGE_THREAD = 1 | |
| 180 | # define RUSAGE_THREAD RUSAGE_THREAD | |
| 181 | /* Name for the same functionality on Solaris. */ | |
| 182 | # define RUSAGE_LWP RUSAGE_THREAD | |
| 183 | #endif | |
| 184 | }; | |
| 185 | ||
| 186 | #include <bits/types/struct_timeval.h> | |
| 187 | #include <bits/types/struct_rusage.h> | |
| 188 | ||
| 189 | /* Priority limits. */ | |
| 190 | #define PRIO_MIN	-20	/* Minimum priority a process can have. */ | |
| 191 | #define PRIO_MAX	20	/* Maximum priority a process can have. */ | |
| 192 | ||
| 193 | /* The type of the WHICH argument to `getpriority' and `setpriority', | |
| 194 | indicating what flavor of entity the WHO argument specifies. */ | |
| 195 | enum __priority_which | |
| 196 | { | |
| 197 | PRIO_PROCESS = 0,		/* WHO is a process ID. */ | |
| 198 | #define PRIO_PROCESS PRIO_PROCESS | |
| 199 | PRIO_PGRP = 1,		/* WHO is a process group ID. */ | |
| 200 | #define PRIO_PGRP PRIO_PGRP | |
| 201 | PRIO_USER = 2			/* WHO is a user ID. */ | |
| 202 | #define PRIO_USER PRIO_USER | |
| 203 | }; | |
| 204 | ||
| 205 | ||
| 206 | __BEGIN_DECLS | |
| 207 | ||
| 208 | #ifdef __USE_GNU | |
| 209 | /* Modify and return resource limits of a process atomically. */ | |
| 210 | # ifndef __USE_FILE_OFFSET64 | |
| 211 | extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, | |
| 212 | 		 const struct rlimit *__new_limit, | |
| 213 | 		 struct rlimit *__old_limit) __THROW; | |
| 214 | # else | |
| 215 | # ifdef __REDIRECT_NTH | |
| 216 | extern int __REDIRECT_NTH (prlimit, (__pid_t __pid, | |
| 217 | 				 enum __rlimit_resource __resource, | |
| 218 | 				 const struct rlimit *__new_limit, | |
| 219 | 				 struct rlimit *__old_limit), prlimit64); | |
| 220 | # else | |
| 221 | # define prlimit prlimit64 | |
| 222 | # endif | |
| 223 | # endif | |
| 224 | # ifdef __USE_LARGEFILE64 | |
| 225 | extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource, | |
| 226 | 		 const struct rlimit64 *__new_limit, | |
| 227 | 		 struct rlimit64 *__old_limit) __THROW; | |
| 228 | # endif | |
| 229 | #endif | |
| 230 | ||
| 231 | __END_DECLS | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/semaphore.h created+36| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SEMAPHORE_H | |
| 19 | # error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #if _MIPS_SIM == _ABI64 | |
| 23 | # define __SIZEOF_SEM_T	32 | |
| 24 | #else | |
| 25 | # define __SIZEOF_SEM_T	16 | |
| 26 | #endif | |
| 27 | ||
| 28 | /* Value returned if `sem_open' failed. */ | |
| 29 | #define SEM_FAILED ((sem_t *) 0) | |
| 30 | ||
| 31 | ||
| 32 | typedef union | |
| 33 | { | |
| 34 | char __size[__SIZEOF_SEM_T]; | |
| 35 | long int __align; | |
| 36 | } sem_t; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/shmlba.h created+24| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | /* Define SHMLBA. MIPS version. | |
| 2 | Copyright (C) 2018-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never use <bits/shmlba.h> directly; include <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Segment low boundary address multiple. */ | |
| 24 | #define SHMLBA		0x40000 | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/sigaction.h created+94| ... | ... | @@ -0,0 +1,94 @@ |
| 1 | /* The proper definitions for Linux/MIPS's sigaction. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGACTION_H | |
| 20 | #define _BITS_SIGACTION_H 1 | |
| 21 | ||
| 22 | #ifndef _SIGNAL_H | |
| 23 | # error "Never include <bits/sigaction.h> directly; use <signal.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Structure describing the action to be taken when a signal arrives. */ | |
| 27 | struct sigaction | |
| 28 | { | |
| 29 | /* Special flags. */ | |
| 30 | int sa_flags; | |
| 31 | ||
| 32 | /* Signal handler. */ | |
| 33 | #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED | |
| 34 | union | |
| 35 | { | |
| 36 | 	/* Used if SA_SIGINFO is not set. */ | |
| 37 | 	__sighandler_t sa_handler; | |
| 38 | 	/* Used if SA_SIGINFO is set. */ | |
| 39 | 	void (*sa_sigaction) (int, siginfo_t *, void *); | |
| 40 | } | |
| 41 | __sigaction_handler; | |
| 42 | # define sa_handler __sigaction_handler.sa_handler | |
| 43 | # define sa_sigaction __sigaction_handler.sa_sigaction | |
| 44 | #else | |
| 45 | __sighandler_t sa_handler; | |
| 46 | #endif | |
| 47 | /* Additional set of signals to be blocked. */ | |
| 48 | __sigset_t sa_mask; | |
| 49 | ||
| 50 | /* The ABI says here are two unused ints following. */ | |
| 51 | /* Restore handler. */ | |
| 52 | void (*sa_restorer) (void); | |
| 53 | ||
| 54 | #if _MIPS_SZPTR < 64 | |
| 55 | int sa_resv[1]; | |
| 56 | #endif | |
| 57 | }; | |
| 58 | ||
| 59 | /* Bits in `sa_flags'. */ | |
| 60 | /* Please note that some Linux kernels versions use different values for these | |
| 61 | flags which is a bug in those kernel versions. */ | |
| 62 | #define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */ | |
| 63 | #define SA_NOCLDWAIT 0x00010000 /* Don't create zombie on child death. */ | |
| 64 | #define SA_SIGINFO 0x00000008 /* Invoke signal-catching function with | |
| 65 | 				 three arguments instead of one. */ | |
| 66 | #if defined __USE_XOPEN_EXTENDED || defined __USE_MISC | |
| 67 | # define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ | |
| 68 | #endif | |
| 69 | #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 | |
| 70 | # define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ | |
| 71 | # define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ | |
| 72 | # define SA_NODEFER 0x40000000 /* Don't automatically block the signal when | |
| 73 | 				 its handler is being executed. */ | |
| 74 | #endif | |
| 75 | #ifdef __USE_MISC | |
| 76 | # define SA_INTERRUPT 0x20000000 /* Historical no-op. */ | |
| 77 | ||
| 78 | /* Some aliases for the SA_ constants. */ | |
| 79 | # define SA_NOMASK SA_NODEFER | |
| 80 | # define SA_ONESHOT SA_RESETHAND | |
| 81 | # define SA_STACK SA_ONSTACK | |
| 82 | #endif | |
| 83 | ||
| 84 | /* Values for the HOW argument to `sigprocmask'. */ | |
| 85 | #define SIG_NOP	 0		/* 0 is unused to catch errors */ | |
| 86 | #define	SIG_BLOCK 1		/* Block signals. */ | |
| 87 | #define	SIG_UNBLOCK 2		/* Unblock signals. */ | |
| 88 | #define	SIG_SETMASK 3		/* Set the set of blocked signals. */ | |
| 89 | #ifdef __USE_MISC | |
| 90 | # define SIG_SETMASK32 256	/* Goodie from SGI for BSD compatibility: | |
| 91 | 				 set only the low 32 bit of the sigset. */ | |
| 92 | #endif | |
| 93 | ||
| 94 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/sigcontext.h created+82| ... | ... | @@ -0,0 +1,82 @@ |
| 1 | /* Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. | |
| 2 | ||
| 3 | The GNU C Library is free software; you can redistribute it and/or | |
| 4 | modify it under the terms of the GNU Lesser General Public | |
| 5 | License as published by the Free Software Foundation; either | |
| 6 | version 2.1 of the License, or (at your option) any later version. | |
| 7 | ||
| 8 | The GNU C Library is distributed in the hope that it will be useful, | |
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 11 | Lesser General Public License for more details. | |
| 12 | ||
| 13 | You should have received a copy of the GNU Lesser General Public | |
| 14 | License along with the GNU C Library. If not, see | |
| 15 | <https://www.gnu.org/licenses/>. */ | |
| 16 | ||
| 17 | #ifndef _BITS_SIGCONTEXT_H | |
| 18 | #define _BITS_SIGCONTEXT_H 1 | |
| 19 | ||
| 20 | #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H | |
| 21 | # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." | |
| 22 | #endif | |
| 23 | ||
| 24 | #include <sgidefs.h> | |
| 25 | ||
| 26 | #if _MIPS_SIM == _ABIO32 | |
| 27 | ||
| 28 | /* Certain unused fields were replaced with new ones in 2.6.12-rc4. | |
| 29 | The changes were as follows: | |
| 30 | ||
| 31 | sc_cause -> sc_hi1 | |
| 32 | sc_badvaddr -> sc_lo1 | |
| 33 | sc_sigset[0] -> sc_hi2 | |
| 34 | sc_sigset[1] -> sc_lo2 | |
| 35 | sc_sigset[2] -> sc_hi3 | |
| 36 | sc_sigset[3] -> sc_lo3 | |
| 37 | ||
| 38 | sc_regmask, sc_ownedfp and sc_fpc_eir are not used. */ | |
| 39 | struct sigcontext { | |
| 40 | unsigned int sc_regmask; | |
| 41 | unsigned int sc_status; | |
| 42 | __extension__ unsigned long long sc_pc; | |
| 43 | __extension__ unsigned long long sc_regs[32]; | |
| 44 | __extension__ unsigned long long sc_fpregs[32]; | |
| 45 | unsigned int sc_ownedfp; | |
| 46 | unsigned int sc_fpc_csr; | |
| 47 | unsigned int sc_fpc_eir; | |
| 48 | unsigned int sc_used_math; | |
| 49 | unsigned int sc_dsp; | |
| 50 | __extension__ unsigned long long sc_mdhi; | |
| 51 | __extension__ unsigned long long sc_mdlo; | |
| 52 | unsigned long sc_hi1; | |
| 53 | unsigned long sc_lo1; | |
| 54 | unsigned long sc_hi2; | |
| 55 | unsigned long sc_lo2; | |
| 56 | unsigned long sc_hi3; | |
| 57 | unsigned long sc_lo3; | |
| 58 | }; | |
| 59 | ||
| 60 | #else | |
| 61 | ||
| 62 | /* This structure changed in 2.6.12-rc4 when DSP support was added. */ | |
| 63 | struct sigcontext { | |
| 64 | __extension__ unsigned long long sc_regs[32]; | |
| 65 | __extension__ unsigned long long sc_fpregs[32]; | |
| 66 | __extension__ unsigned long long sc_mdhi; | |
| 67 | __extension__ unsigned long long sc_hi1; | |
| 68 | __extension__ unsigned long long sc_hi2; | |
| 69 | __extension__ unsigned long long sc_hi3; | |
| 70 | __extension__ unsigned long long sc_mdlo; | |
| 71 | __extension__ unsigned long long sc_lo1; | |
| 72 | __extension__ unsigned long long sc_lo2; | |
| 73 | __extension__ unsigned long long sc_lo3; | |
| 74 | __extension__ unsigned long long sc_pc; | |
| 75 | unsigned int sc_fpc_csr; | |
| 76 | unsigned int sc_used_math; | |
| 77 | unsigned int sc_dsp; | |
| 78 | unsigned int sc_reserved; | |
| 79 | }; | |
| 80 | ||
| 81 | #endif /* _MIPS_SIM != _ABIO32 */ | |
| 82 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/siginfo-arch.h created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | /* Architecture-specific adjustments to siginfo_t. MIPS version. */ | |
| 2 | #ifndef _BITS_SIGINFO_ARCH_H | |
| 3 | #define _BITS_SIGINFO_ARCH_H 1 | |
| 4 | ||
| 5 | /* MIPS has the si_code and si_errno fields in the opposite order from | |
| 6 | all other architectures. */ | |
| 7 | #define __SI_ERRNO_THEN_CODE 0 | |
| 8 | ||
| 9 | /* MIPS also has different values for SI_ASYNCIO, SI_MESGQ, and SI_TIMER | |
| 10 | than all other architectures. */ | |
| 11 | #define __SI_ASYNCIO_AFTER_SIGIO 0 | |
| 12 | ||
| 13 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/signalfd.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* Copyright (C) 2007-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_SIGNALFD_H | |
| 19 | # error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for signalfd. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | SFD_CLOEXEC = 02000000, | |
| 26 | #define SFD_CLOEXEC SFD_CLOEXEC | |
| 27 | SFD_NONBLOCK = 00000200 | |
| 28 | #define SFD_NONBLOCK SFD_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/signum-arch.h created+65| ... | ... | @@ -0,0 +1,65 @@ |
| 1 | /* Signal number definitions. Linux/MIPS version. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGNUM_H | |
| 20 | #define _BITS_SIGNUM_H 1 | |
| 21 | ||
| 22 | #ifndef _SIGNAL_H | |
| 23 | #error "Never include <bits/signum.h> directly; use <signal.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Adjustments and additions to the signal number constants for | |
| 27 | Linux/MIPS. */ | |
| 28 | ||
| 29 | #define SIGEMT		 7	/* Emulator trap. */ | |
| 30 | #define SIGPWR		19	/* Power failure imminent. */ | |
| 31 | ||
| 32 | /* Historical signals specified by POSIX. */ | |
| 33 | #define SIGBUS 	10	/* Bus error. */ | |
| 34 | #define SIGSYS		12	/* Bad system call. */ | |
| 35 | ||
| 36 | /* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ | |
| 37 | #define SIGURG		21	/* Urgent data is available at a socket. */ | |
| 38 | #define SIGSTOP		23	/* Stop, unblockable. */ | |
| 39 | #define SIGTSTP		24	/* Keyboard stop. */ | |
| 40 | #define SIGCONT		25	/* Continue. */ | |
| 41 | #define SIGCHLD		18	/* Child terminated or stopped. */ | |
| 42 | #define SIGTTIN		26	/* Background read from control terminal. */ | |
| 43 | #define SIGTTOU		27	/* Background write to control terminal. */ | |
| 44 | #define SIGPOLL		22	/* Pollable event occurred (System V). */ | |
| 45 | #define SIGXCPU		30	/* CPU time limit exceeded. */ | |
| 46 | #define SIGVTALRM	28	/* Virtual timer expired. */ | |
| 47 | #define SIGPROF		29	/* Profiling timer expired. */ | |
| 48 | #define SIGXFSZ		31	/* File size limit exceeded. */ | |
| 49 | #define SIGUSR1		16	/* User-defined signal 1. */ | |
| 50 | #define SIGUSR2		17	/* User-defined signal 2. */ | |
| 51 | ||
| 52 | /* Nonstandard signals found in all modern POSIX systems | |
| 53 | (including both BSD and Linux). */ | |
| 54 | #define SIGWINCH	20	/* Window size change (4.3 BSD, Sun). */ | |
| 55 | ||
| 56 | /* Archaic names for compatibility. */ | |
| 57 | #define SIGIO		SIGPOLL	/* I/O now possible (4.2 BSD). */ | |
| 58 | #define SIGIOT		SIGABRT	/* IOT instruction, abort() on a PDP-11. */ | |
| 59 | #define SIGCLD		SIGCHLD /* Old System V name */ | |
| 60 | ||
| 61 | /* By default no real-time signals are supported. */ | |
| 62 | #define __SIGRTMIN	32 | |
| 63 | #define __SIGRTMAX	127 | |
| 64 | ||
| 65 | #endif	/* <signal.h> included. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/socket-constants.h created+70| ... | ... | @@ -0,0 +1,70 @@ |
| 1 | /* Socket constants which vary among Linux architectures. Version for MIPS. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define SOL_SOCKET 65535 | |
| 24 | #define SO_ACCEPTCONN 4105 | |
| 25 | #define SO_BROADCAST 32 | |
| 26 | #define SO_DONTROUTE 16 | |
| 27 | #define SO_ERROR 4103 | |
| 28 | #define SO_KEEPALIVE 8 | |
| 29 | #define SO_LINGER 128 | |
| 30 | #define SO_OOBINLINE 256 | |
| 31 | #define SO_RCVBUF 4098 | |
| 32 | #define SO_RCVLOWAT 4100 | |
| 33 | #define SO_REUSEADDR 4 | |
| 34 | #define SO_SNDBUF 4097 | |
| 35 | #define SO_SNDLOWAT 4099 | |
| 36 | #define SO_TYPE 4104 | |
| 37 | ||
| 38 | #if __TIMESIZE == 64 | |
| 39 | # define SO_RCVTIMEO 4102 | |
| 40 | # define SO_SNDTIMEO 4101 | |
| 41 | # define SO_TIMESTAMP 29 | |
| 42 | # define SO_TIMESTAMPNS 35 | |
| 43 | # define SO_TIMESTAMPING 37 | |
| 44 | #else | |
| 45 | # define SO_RCVTIMEO_OLD 4102 | |
| 46 | # define SO_SNDTIMEO_OLD 4101 | |
| 47 | # define SO_RCVTIMEO_NEW 66 | |
| 48 | # define SO_SNDTIMEO_NEW 67 | |
| 49 | ||
| 50 | # define SO_TIMESTAMP_OLD 29 | |
| 51 | # define SO_TIMESTAMPNS_OLD 35 | |
| 52 | # define SO_TIMESTAMPING_OLD 37 | |
| 53 | # define SO_TIMESTAMP_NEW 63 | |
| 54 | # define SO_TIMESTAMPNS_NEW 64 | |
| 55 | # define SO_TIMESTAMPING_NEW 65 | |
| 56 | ||
| 57 | # ifdef __USE_TIME_BITS64 | |
| 58 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 59 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 60 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 61 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 62 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 63 | # else | |
| 64 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 65 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 66 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 67 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 68 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 69 | # endif | |
| 70 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/socket_type.h created+55| ... | ... | @@ -0,0 +1,55 @@ |
| 1 | /* Define enum __socket_type for Linux/MIPS. | |
| 2 | Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Types of sockets. */ | |
| 24 | enum __socket_type | |
| 25 | { | |
| 26 | SOCK_DGRAM = 1,		/* Connectionless, unreliable datagrams | |
| 27 | 				 of fixed maximum length. */ | |
| 28 | #define SOCK_DGRAM SOCK_DGRAM | |
| 29 | SOCK_STREAM = 2,		/* Sequenced, reliable, connection-based | |
| 30 | 				 byte streams. */ | |
| 31 | #define SOCK_STREAM SOCK_STREAM | |
| 32 | SOCK_RAW = 3,			/* Raw protocol interface. */ | |
| 33 | #define SOCK_RAW SOCK_RAW | |
| 34 | SOCK_RDM = 4,			/* Reliably-delivered messages. */ | |
| 35 | #define SOCK_RDM SOCK_RDM | |
| 36 | SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based, | |
| 37 | 				 datagrams of fixed maximum length. */ | |
| 38 | #define SOCK_SEQPACKET SOCK_SEQPACKET | |
| 39 | SOCK_DCCP = 6, | |
| 40 | #define SOCK_DCCP SOCK_DCCP	/* Datagram Congestion Control Protocol. */ | |
| 41 | SOCK_PACKET = 10,		/* Linux specific way of getting packets | |
| 42 | 				 at the dev level. For writing rarp and | |
| 43 | 				 other similar things on the user level. */ | |
| 44 | #define SOCK_PACKET SOCK_PACKET | |
| 45 | ||
| 46 | /* Flags to be ORed into the type parameter of socket and socketpair and | |
| 47 | used for the flags parameter of paccept. */ | |
| 48 | ||
| 49 | SOCK_CLOEXEC = 02000000,	/* Atomically set close-on-exec flag for the | |
| 50 | 				 new descriptor(s). */ | |
| 51 | #define SOCK_CLOEXEC SOCK_CLOEXEC | |
| 52 | SOCK_NONBLOCK = 00000200	/* Atomically mark descriptor(s) as | |
| 53 | 				 non-blocking. */ | |
| 54 | #define SOCK_NONBLOCK SOCK_NONBLOCK | |
| 55 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/statfs.h created+73| ... | ... | @@ -0,0 +1,73 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_STATFS_H | |
| 19 | # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #include <bits/types.h> /* for __fsid_t and __fsblkcnt_t*/ | |
| 23 | ||
| 24 | struct statfs | |
| 25 | { | |
| 26 | long int f_type; | |
| 27 | #define f_fstyp f_type | |
| 28 | long int f_bsize; | |
| 29 | long int f_frsize;	/* Fragment size - unsupported */ | |
| 30 | #ifndef __USE_FILE_OFFSET64 | |
| 31 | __fsblkcnt_t f_blocks; | |
| 32 | __fsblkcnt_t f_bfree; | |
| 33 | __fsblkcnt_t f_files; | |
| 34 | __fsblkcnt_t f_ffree; | |
| 35 | __fsblkcnt_t f_bavail; | |
| 36 | #else | |
| 37 | __fsblkcnt64_t f_blocks; | |
| 38 | __fsblkcnt64_t f_bfree; | |
| 39 | __fsblkcnt64_t f_files; | |
| 40 | __fsblkcnt64_t f_ffree; | |
| 41 | __fsblkcnt64_t f_bavail; | |
| 42 | #endif | |
| 43 | ||
| 44 | 	/* Linux specials */ | |
| 45 | __fsid_t f_fsid; | |
| 46 | long int f_namelen; | |
| 47 | long int f_flags; | |
| 48 | long int f_spare[5]; | |
| 49 | }; | |
| 50 | ||
| 51 | #ifdef __USE_LARGEFILE64 | |
| 52 | struct statfs64 | |
| 53 | { | |
| 54 | long int f_type; | |
| 55 | #define f_fstyp f_type | |
| 56 | long int f_bsize; | |
| 57 | long int f_frsize;	/* Fragment size - unsupported */ | |
| 58 | __fsblkcnt64_t f_blocks; | |
| 59 | __fsblkcnt64_t f_bfree; | |
| 60 | __fsblkcnt64_t f_files; | |
| 61 | __fsblkcnt64_t f_ffree; | |
| 62 | __fsblkcnt64_t f_bavail; | |
| 63 | ||
| 64 | 	/* Linux specials */ | |
| 65 | __fsid_t f_fsid; | |
| 66 | long int f_namelen; | |
| 67 | long int f_flags; | |
| 68 | long int f_spare[5]; | |
| 69 | }; | |
| 70 | #endif | |
| 71 | ||
| 72 | /* Tell code we have these members. */ | |
| 73 | #define _STATFS_F_NAMELEN | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/struct_mutex.h created+56| ... | ... | @@ -0,0 +1,56 @@ |
| 1 | /* MIPS internal mutex struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _THREAD_MUTEX_INTERNAL_H | |
| 20 | #define _THREAD_MUTEX_INTERNAL_H 1 | |
| 21 | ||
| 22 | struct __pthread_mutex_s | |
| 23 | { | |
| 24 | int __lock; | |
| 25 | unsigned int __count; | |
| 26 | int __owner; | |
| 27 | #if _MIPS_SIM == _ABI64 | |
| 28 | unsigned int __nusers; | |
| 29 | #endif | |
| 30 | /* KIND must stay at this position in the structure to maintain | |
| 31 | binary compatibility with static initializers. */ | |
| 32 | int __kind; | |
| 33 | #if _MIPS_SIM == _ABI64 | |
| 34 | int __spins; | |
| 35 | __pthread_list_t __list; | |
| 36 | # define __PTHREAD_MUTEX_HAVE_PREV 1 | |
| 37 | #else | |
| 38 | unsigned int __nusers; | |
| 39 | __extension__ union | |
| 40 | { | |
| 41 | int __spins; | |
| 42 | __pthread_slist_t __list; | |
| 43 | }; | |
| 44 | # define __PTHREAD_MUTEX_HAVE_PREV 0 | |
| 45 | #endif | |
| 46 | }; | |
| 47 | ||
| 48 | #if _MIPS_SIM == _ABI64 | |
| 49 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 50 | 0, 0, 0, 0, __kind, 0, { 0, 0 } | |
| 51 | #else | |
| 52 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 53 | 0, 0, 0, __kind, 0, { 0 } | |
| 54 | #endif | |
| 55 | ||
| 56 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/termios-c_cc.h created+43| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | /* termios c_cc symbolic constant definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_cc.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_cc characters */ | |
| 24 | #define VINTR		0	/* Interrupt character [ISIG]. */ | |
| 25 | #define VQUIT		1	/* Quit character [ISIG]. */ | |
| 26 | #define VERASE		2	/* Erase character [ICANON]. */ | |
| 27 | #define VKILL		3	/* Kill-line character [ICANON]. */ | |
| 28 | #define VMIN		4	/* Minimum number of bytes read at once [!ICANON]. */ | |
| 29 | #define VTIME		5	/* Time-out value (tenths of a second) [!ICANON]. */ | |
| 30 | #define VEOL2		6	/* Second EOL character [ICANON]. */ | |
| 31 | #define VSWTC		7 | |
| 32 | #define VSWTCH		VSWTC | |
| 33 | #define VSTART		8	/* Start (X-ON) character [IXON, IXOFF]. */ | |
| 34 | #define VSTOP		9	/* Stop (X-OFF) character [IXON, IXOFF]. */ | |
| 35 | #define VSUSP		10	/* Suspend character [ISIG]. */ | |
| 36 | 				/* VDSUSP is not supported on Linux. */ | |
| 37 | /* #define VDSUSP	11	/ * Delayed suspend character [ISIG]. */ | |
| 38 | #define VREPRINT	12	/* Reprint-line character [ICANON]. */ | |
| 39 | #define VDISCARD	13	/* Discard character [IEXTEN]. */ | |
| 40 | #define VWERASE		14	/* Word-erase character [ICANON]. */ | |
| 41 | #define VLNEXT		15	/* Literal-next character [IEXTEN]. */ | |
| 42 | #define VEOF		16	/* End-of-file character [ICANON]. */ | |
| 43 | #define VEOL		17	/* End-of-line character [ICANON]. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/termios-c_lflag.h created+46| ... | ... | @@ -0,0 +1,46 @@ |
| 1 | /* termios local mode definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_lflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_lflag bits */ | |
| 24 | #define ISIG	0000001		/* Enable signals. */ | |
| 25 | #define ICANON	0000002		/* Do erase and kill processing. */ | |
| 26 | #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) | |
| 27 | # define XCASE	0000004 | |
| 28 | #endif | |
| 29 | #define ECHO	0000010		/* Enable echo. */ | |
| 30 | #define ECHOE	0000020		/* Visual erase for ERASE. */ | |
| 31 | #define ECHOK	0000040		/* Echo NL after KILL. */ | |
| 32 | #define ECHONL	0000100		/* Echo NL even if ECHO is off. */ | |
| 33 | #define NOFLSH	0000200		/* Disable flush after interrupt. */ | |
| 34 | #define IEXTEN	0000400		/* Enable DISCARD and LNEXT. */ | |
| 35 | #ifdef __USE_MISC | |
| 36 | # define ECHOCTL 0001000	/* Echo control characters as ^X. */ | |
| 37 | # define ECHOPRT 0002000	/* Hardcopy visual erase. */ | |
| 38 | # define ECHOKE	 0004000	/* Visual erase for KILL. */ | |
| 39 | # define FLUSHO	0020000 | |
| 40 | # define PENDIN	0040000		/* Retype pending input (state). */ | |
| 41 | #endif | |
| 42 | #define TOSTOP	0100000		/* Send SIGTTOU for background output. */ | |
| 43 | #define ITOSTOP	TOSTOP | |
| 44 | #ifdef __USE_MISC | |
| 45 | # define EXTPROC 0200000 | |
| 46 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/termios-struct.h created+34| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | /* struct termios definition. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-struct.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define NCCS 32 | |
| 24 | struct termios | |
| 25 | { | |
| 26 | tcflag_t c_iflag;		/* input mode flags */ | |
| 27 | tcflag_t c_oflag;		/* output mode flags */ | |
| 28 | tcflag_t c_cflag;		/* control mode flags */ | |
| 29 | tcflag_t c_lflag;		/* local mode flags */ | |
| 30 | cc_t c_line;		/* line discipline */ | |
| 31 | cc_t c_cc[NCCS];		/* control characters */ | |
| 32 | #define _HAVE_STRUCT_TERMIOS_C_ISPEED 0 | |
| 33 | #define _HAVE_STRUCT_TERMIOS_C_OSPEED 0 | |
| 34 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/termios-tcflow.h created+26| ... | ... | @@ -0,0 +1,26 @@ |
| 1 | /* termios local mode definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-tcflow.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* tcsetattr uses these */ | |
| 24 | #define	TCSANOW		0x540e	/* Same as TCSETS; change immediately. */ | |
| 25 | #define	TCSADRAIN	0x540f	/* Same as TCSETSW; change when pending output is written. */ | |
| 26 | #define	TCSAFLUSH	0x5410	/* Same as TCSETSF; flush pending input before changing. */ | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/timerfd.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* Copyright (C) 2008-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_TIMERFD_H | |
| 19 | # error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Bits to be set in the FLAGS parameter of `timerfd_create'. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | TFD_CLOEXEC = 02000000, | |
| 26 | #define TFD_CLOEXEC TFD_CLOEXEC | |
| 27 | TFD_NONBLOCK = 00000200 | |
| 28 | #define TFD_NONBLOCK TFD_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/types/stack_t.h created+33| ... | ... | @@ -0,0 +1,33 @@ |
| 1 | /* Define stack_t. MIPS Linux version. | |
| 2 | Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __stack_t_defined | |
| 20 | #define __stack_t_defined 1 | |
| 21 | ||
| 22 | #define __need_size_t | |
| 23 | #include <stddef.h> | |
| 24 | ||
| 25 | /* Structure describing a signal stack. */ | |
| 26 | typedef struct | |
| 27 | { | |
| 28 | void *ss_sp; | |
| 29 | size_t ss_size; | |
| 30 | int ss_flags; | |
| 31 | } stack_t; | |
| 32 | ||
| 33 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/types/struct_msqid_ds.h created+62| ... | ... | @@ -0,0 +1,62 @@ |
| 1 | /* Linux/MIPS implementation of the SysV message struct msqid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MSG_H | |
| 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 25 | /* Structure of record for one message inside the kernel. | |
| 26 | The type `struct msg' is opaque. */ | |
| 27 | struct msqid_ds | |
| 28 | { | |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ | |
| 33 | # if __TIMESIZE == 32 | |
| 34 | # ifdef __MIPSEL__ | |
| 35 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 36 | unsigned long int __msg_stime_high; | |
| 37 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 38 | unsigned long int __msg_rtime_high; | |
| 39 | __time_t msg_ctime;		/* time of last change */ | |
| 40 | unsigned long int __msg_ctime_high; | |
| 41 | # else | |
| 42 | unsigned long int __msg_stime_high; | |
| 43 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 44 | unsigned long int __msg_rtime_high; | |
| 45 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 46 | unsigned long int __msg_ctime_high; | |
| 47 | __time_t msg_ctime;		/* time of last change */ | |
| 48 | # endif | |
| 49 | # else | |
| 50 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 51 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 52 | __time_t msg_ctime;		/* time of last change */ | |
| 53 | # endif | |
| 54 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ | |
| 55 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ | |
| 56 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ | |
| 57 | __pid_t msg_lspid;		/* pid of last msgsnd() */ | |
| 58 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ | |
| 59 | __syscall_ulong_t __glibc_reserved4; | |
| 60 | __syscall_ulong_t __glibc_reserved5; | |
| 61 | #endif | |
| 62 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/types/struct_semid_ds.h created+36| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | /* MIPS implementation of the semaphore struct semid_ds | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SEM_H | |
| 20 | # error "Never include <bits/types/struct_semid_ds.h> directly; use <sys/sem.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a set of semaphores. */ | |
| 24 | struct semid_ds | |
| 25 | { | |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 29 | struct ipc_perm sem_perm;		/* operation permission struct */ | |
| 30 | __time_t sem_otime;	/* last semop() time */ | |
| 31 | __time_t sem_ctime;	/* last time changed by semctl() */ | |
| 32 | __syscall_ulong_t sem_nsems;		/* number of semaphores in set */ | |
| 33 | __syscall_ulong_t __sem_otime_high; | |
| 34 | __syscall_ulong_t __sem_ctime_high; | |
| 35 | #endif | |
| 36 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/bits/types/struct_shmid_ds.h created+53| ... | ... | @@ -0,0 +1,53 @@ |
| 1 | /* Linux/MIPS implementation of the shared memory struct shmid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never include <bits/types/struct_shmid_ds.h> directly; use <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a shared memory segment. */ | |
| 24 | struct shmid_ds | |
| 25 | { | |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 29 | struct ipc_perm shm_perm;		/* operation permission struct */ | |
| 30 | size_t shm_segsz;			/* size of segment in bytes */ | |
| 31 | # if __TIMESIZE == 32 | |
| 32 | __time_t shm_atime;			/* time of last shmat() */ | |
| 33 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 34 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 35 | # else | |
| 36 | __time_t shm_atime;			/* time of last shmat() */ | |
| 37 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 38 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 39 | # endif | |
| 40 | __pid_t shm_cpid;			/* pid of creator */ | |
| 41 | __pid_t shm_lpid;			/* pid of last shmop */ | |
| 42 | shmatt_t shm_nattch;		/* number of current attaches */ | |
| 43 | # if __TIMESIZE == 32 | |
| 44 | unsigned short int __shm_atime_high; | |
| 45 | unsigned short int __shm_dtime_high; | |
| 46 | unsigned short int __shm_ctime_high; | |
| 47 | unsigned short int __glibc_reserved4; | |
| 48 | # else | |
| 49 | __syscall_ulong_t __glibc_reserved5; | |
| 50 | __syscall_ulong_t __glibc_reserved6; | |
| 51 | # endif | |
| 52 | #endif | |
| 53 | }; | |
| \ No newline at end of file |
lib/libc/include/mips-linux-gnueabihf/ieee754.h created+326| ... | ... | @@ -0,0 +1,326 @@ |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _IEEE754_H | |
| 19 | #define _IEEE754_H 1 | |
| 20 | ||
| 21 | #include <features.h> | |
| 22 | ||
| 23 | #include <bits/endian.h> | |
| 24 | ||
| 25 | #ifndef __LDBL_MANT_DIG__ | |
| 26 | # include <float.h> | |
| 27 | # define __LDBL_MANT_DIG__ LDBL_MANT_DIG | |
| 28 | #endif | |
| 29 | ||
| 30 | __BEGIN_DECLS | |
| 31 | ||
| 32 | union ieee754_float | |
| 33 | { | |
| 34 | float f; | |
| 35 | ||
| 36 | /* This is the IEEE 754 single-precision format. */ | |
| 37 | struct | |
| 38 | { | |
| 39 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 40 | 	unsigned int negative:1; | |
| 41 | 	unsigned int exponent:8; | |
| 42 | 	unsigned int mantissa:23; | |
| 43 | #endif				/* Big endian. */ | |
| 44 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 45 | 	unsigned int mantissa:23; | |
| 46 | 	unsigned int exponent:8; | |
| 47 | 	unsigned int negative:1; | |
| 48 | #endif				/* Little endian. */ | |
| 49 | } ieee; | |
| 50 | ||
| 51 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 52 | struct | |
| 53 | { | |
| 54 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 55 | 	unsigned int negative:1; | |
| 56 | 	unsigned int exponent:8; | |
| 57 | 	unsigned int quiet_nan:1; | |
| 58 | 	unsigned int mantissa:22; | |
| 59 | #endif				/* Big endian. */ | |
| 60 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 61 | 	unsigned int mantissa:22; | |
| 62 | 	unsigned int quiet_nan:1; | |
| 63 | 	unsigned int exponent:8; | |
| 64 | 	unsigned int negative:1; | |
| 65 | #endif				/* Little endian. */ | |
| 66 | } ieee_nan; | |
| 67 | }; | |
| 68 | ||
| 69 | #define IEEE754_FLOAT_BIAS	0x7f /* Added to exponent. */ | |
| 70 | ||
| 71 | ||
| 72 | union ieee754_double | |
| 73 | { | |
| 74 | double d; | |
| 75 | ||
| 76 | /* This is the IEEE 754 double-precision format. */ | |
| 77 | struct | |
| 78 | { | |
| 79 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 80 | 	unsigned int negative:1; | |
| 81 | 	unsigned int exponent:11; | |
| 82 | 	/* Together these comprise the mantissa. */ | |
| 83 | 	unsigned int mantissa0:20; | |
| 84 | 	unsigned int mantissa1:32; | |
| 85 | #endif				/* Big endian. */ | |
| 86 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 87 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 88 | 	unsigned int mantissa0:20; | |
| 89 | 	unsigned int exponent:11; | |
| 90 | 	unsigned int negative:1; | |
| 91 | 	unsigned int mantissa1:32; | |
| 92 | # else | |
| 93 | 	/* Together these comprise the mantissa. */ | |
| 94 | 	unsigned int mantissa1:32; | |
| 95 | 	unsigned int mantissa0:20; | |
| 96 | 	unsigned int exponent:11; | |
| 97 | 	unsigned int negative:1; | |
| 98 | # endif | |
| 99 | #endif				/* Little endian. */ | |
| 100 | } ieee; | |
| 101 | ||
| 102 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 103 | struct | |
| 104 | { | |
| 105 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 106 | 	unsigned int negative:1; | |
| 107 | 	unsigned int exponent:11; | |
| 108 | 	unsigned int quiet_nan:1; | |
| 109 | 	/* Together these comprise the mantissa. */ | |
| 110 | 	unsigned int mantissa0:19; | |
| 111 | 	unsigned int mantissa1:32; | |
| 112 | #else | |
| 113 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 114 | 	unsigned int mantissa0:19; | |
| 115 | 	unsigned int quiet_nan:1; | |
| 116 | 	unsigned int exponent:11; | |
| 117 | 	unsigned int negative:1; | |
| 118 | 	unsigned int mantissa1:32; | |
| 119 | # else | |
| 120 | 	/* Together these comprise the mantissa. */ | |
| 121 | 	unsigned int mantissa1:32; | |
| 122 | 	unsigned int mantissa0:19; | |
| 123 | 	unsigned int quiet_nan:1; | |
| 124 | 	unsigned int exponent:11; | |
| 125 | 	unsigned int negative:1; | |
| 126 | # endif | |
| 127 | #endif | |
| 128 | } ieee_nan; | |
| 129 | }; | |
| 130 | ||
| 131 | #define IEEE754_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 132 | ||
| 133 | #if __LDBL_MANT_DIG__ == 113 | |
| 134 | ||
| 135 | union ieee854_long_double | |
| 136 | { | |
| 137 | long double d; | |
| 138 | ||
| 139 | /* This is the IEEE 854 quad-precision format. */ | |
| 140 | struct | |
| 141 | { | |
| 142 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 143 | 	unsigned int negative:1; | |
| 144 | 	unsigned int exponent:15; | |
| 145 | 	/* Together these comprise the mantissa. */ | |
| 146 | 	unsigned int mantissa0:16; | |
| 147 | 	unsigned int mantissa1:32; | |
| 148 | 	unsigned int mantissa2:32; | |
| 149 | 	unsigned int mantissa3:32; | |
| 150 | #endif				/* Big endian. */ | |
| 151 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 152 | 	/* Together these comprise the mantissa. */ | |
| 153 | 	unsigned int mantissa3:32; | |
| 154 | 	unsigned int mantissa2:32; | |
| 155 | 	unsigned int mantissa1:32; | |
| 156 | 	unsigned int mantissa0:16; | |
| 157 | 	unsigned int exponent:15; | |
| 158 | 	unsigned int negative:1; | |
| 159 | #endif				/* Little endian. */ | |
| 160 | } ieee; | |
| 161 | ||
| 162 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 163 | struct | |
| 164 | { | |
| 165 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 166 | 	unsigned int negative:1; | |
| 167 | 	unsigned int exponent:15; | |
| 168 | 	unsigned int quiet_nan:1; | |
| 169 | 	/* Together these comprise the mantissa. */ | |
| 170 | 	unsigned int mantissa0:15; | |
| 171 | 	unsigned int mantissa1:32; | |
| 172 | 	unsigned int mantissa2:32; | |
| 173 | 	unsigned int mantissa3:32; | |
| 174 | #endif				/* Big endian. */ | |
| 175 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 176 | 	/* Together these comprise the mantissa. */ | |
| 177 | 	unsigned int mantissa3:32; | |
| 178 | 	unsigned int mantissa2:32; | |
| 179 | 	unsigned int mantissa1:32; | |
| 180 | 	unsigned int mantissa0:15; | |
| 181 | 	unsigned int quiet_nan:1; | |
| 182 | 	unsigned int exponent:15; | |
| 183 | 	unsigned int negative:1; | |
| 184 | #endif				/* Little endian. */ | |
| 185 | } ieee_nan; | |
| 186 | }; | |
| 187 | ||
| 188 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ | |
| 189 | ||
| 190 | #elif __LDBL_MANT_DIG__ == 64 | |
| 191 | ||
| 192 | union ieee854_long_double | |
| 193 | { | |
| 194 | long double d; | |
| 195 | ||
| 196 | /* This is the IEEE 854 double-extended-precision format. */ | |
| 197 | struct | |
| 198 | { | |
| 199 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 200 | 	unsigned int negative:1; | |
| 201 | 	unsigned int exponent:15; | |
| 202 | 	unsigned int empty:16; | |
| 203 | 	unsigned int mantissa0:32; | |
| 204 | 	unsigned int mantissa1:32; | |
| 205 | #endif | |
| 206 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 207 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 208 | 	unsigned int exponent:15; | |
| 209 | 	unsigned int negative:1; | |
| 210 | 	unsigned int empty:16; | |
| 211 | 	unsigned int mantissa0:32; | |
| 212 | 	unsigned int mantissa1:32; | |
| 213 | # else | |
| 214 | 	unsigned int mantissa1:32; | |
| 215 | 	unsigned int mantissa0:32; | |
| 216 | 	unsigned int exponent:15; | |
| 217 | 	unsigned int negative:1; | |
| 218 | 	unsigned int empty:16; | |
| 219 | # endif | |
| 220 | #endif | |
| 221 | } ieee; | |
| 222 | ||
| 223 | /* This is for NaNs in the IEEE 854 double-extended-precision format. */ | |
| 224 | struct | |
| 225 | { | |
| 226 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 227 | 	unsigned int negative:1; | |
| 228 | 	unsigned int exponent:15; | |
| 229 | 	unsigned int empty:16; | |
| 230 | 	unsigned int one:1; | |
| 231 | 	unsigned int quiet_nan:1; | |
| 232 | 	unsigned int mantissa0:30; | |
| 233 | 	unsigned int mantissa1:32; | |
| 234 | #endif | |
| 235 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 236 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 237 | 	unsigned int exponent:15; | |
| 238 | 	unsigned int negative:1; | |
| 239 | 	unsigned int empty:16; | |
| 240 | 	unsigned int mantissa0:30; | |
| 241 | 	unsigned int quiet_nan:1; | |
| 242 | 	unsigned int one:1; | |
| 243 | 	unsigned int mantissa1:32; | |
| 244 | # else | |
| 245 | 	unsigned int mantissa1:32; | |
| 246 | 	unsigned int mantissa0:30; | |
| 247 | 	unsigned int quiet_nan:1; | |
| 248 | 	unsigned int one:1; | |
| 249 | 	unsigned int exponent:15; | |
| 250 | 	unsigned int negative:1; | |
| 251 | 	unsigned int empty:16; | |
| 252 | # endif | |
| 253 | #endif | |
| 254 | } ieee_nan; | |
| 255 | }; | |
| 256 | ||
| 257 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff | |
| 258 | ||
| 259 | #elif __LDBL_MANT_DIG__ == 53 | |
| 260 | ||
| 261 | union ieee854_long_double | |
| 262 | { | |
| 263 | long double d; | |
| 264 | ||
| 265 | /* This is the IEEE 754 double-precision format. */ | |
| 266 | struct | |
| 267 | { | |
| 268 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 269 | 	unsigned int negative:1; | |
| 270 | 	unsigned int exponent:11; | |
| 271 | 	/* Together these comprise the mantissa. */ | |
| 272 | 	unsigned int mantissa0:20; | |
| 273 | 	unsigned int mantissa1:32; | |
| 274 | #endif				/* Big endian. */ | |
| 275 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 276 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 277 | 	unsigned int mantissa0:20; | |
| 278 | 	unsigned int exponent:11; | |
| 279 | 	unsigned int negative:1; | |
| 280 | 	unsigned int mantissa1:32; | |
| 281 | # else | |
| 282 | 	/* Together these comprise the mantissa. */ | |
| 283 | 	unsigned int mantissa1:32; | |
| 284 | 	unsigned int mantissa0:20; | |
| 285 | 	unsigned int exponent:11; | |
| 286 | 	unsigned int negative:1; | |
| 287 | # endif | |
| 288 | #endif				/* Little endian. */ | |
| 289 | } ieee; | |
| 290 | ||
| 291 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 292 | struct | |
| 293 | { | |
| 294 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 295 | 	unsigned int negative:1; | |
| 296 | 	unsigned int exponent:11; | |
| 297 | 	unsigned int quiet_nan:1; | |
| 298 | 	/* Together these comprise the mantissa. */ | |
| 299 | 	unsigned int mantissa0:19; | |
| 300 | 	unsigned int mantissa1:32; | |
| 301 | #else | |
| 302 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 303 | 	unsigned int mantissa0:19; | |
| 304 | 	unsigned int quiet_nan:1; | |
| 305 | 	unsigned int exponent:11; | |
| 306 | 	unsigned int negative:1; | |
| 307 | 	unsigned int mantissa1:32; | |
| 308 | # else | |
| 309 | 	/* Together these comprise the mantissa. */ | |
| 310 | 	unsigned int mantissa1:32; | |
| 311 | 	unsigned int mantissa0:19; | |
| 312 | 	unsigned int quiet_nan:1; | |
| 313 | 	unsigned int exponent:11; | |
| 314 | 	unsigned int negative:1; | |
| 315 | # endif | |
| 316 | #endif | |
| 317 | } ieee_nan; | |
| 318 | }; | |
| 319 | ||
| 320 | #define IEEE854_LONG_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 321 | ||
| 322 | #endif /* __LDBL_MANT_DIG__ == 53 */ | |
| 323 | ||
| 324 | __END_DECLS | |
| 325 | ||
| 326 | #endif /* ieee754.h */ | |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabi64/bits/floatn.h deleted-97| ... | ... | @@ -1,97 +0,0 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features on MIPS platforms. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_FLOATN_H | |
| 20 | #define _BITS_FLOATN_H | |
| 21 | ||
| 22 | #include <features.h> | |
| 23 | #include <bits/long-double.h> | |
| 24 | ||
| 25 | /* Defined to 1 if the current compiler invocation provides a | |
| 26 | floating-point type with the IEEE 754 binary128 format, and this | |
| 27 | glibc includes corresponding *f128 interfaces for it. */ | |
| 28 | #ifndef __NO_LONG_DOUBLE_MATH | |
| 29 | # define __HAVE_FLOAT128 1 | |
| 30 | #else | |
| 31 | /* glibc does not support _Float128 for platforms where long double is | |
| 32 | normally binary128 when building with long double as binary64. | |
| 33 | GCC's default for supported scalar modes does not support it either | |
| 34 | in that case. */ | |
| 35 | # define __HAVE_FLOAT128 0 | |
| 36 | #endif | |
| 37 | ||
| 38 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 39 | from the default float, double and long double types in this glibc. */ | |
| 40 | #define __HAVE_DISTINCT_FLOAT128 0 | |
| 41 | ||
| 42 | /* Defined to 1 if the current compiler invocation provides a | |
| 43 | floating-point type with the right format for _Float64x, and this | |
| 44 | glibc includes corresponding *f64x interfaces for it. */ | |
| 45 | #define __HAVE_FLOAT64X __HAVE_FLOAT128 | |
| 46 | ||
| 47 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 48 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 49 | the format of _Float128, which must be different from that of long | |
| 50 | double. */ | |
| 51 | #define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128 | |
| 52 | ||
| 53 | #ifndef __ASSEMBLER__ | |
| 54 | ||
| 55 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 56 | types, if __HAVE_FLOAT128 is 1. */ | |
| 57 | # if __HAVE_FLOAT128 | |
| 58 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 59 | /* The literal suffix f128 exists only since GCC 7.0. */ | |
| 60 | # define __f128(x) x##l | |
| 61 | # else | |
| 62 | # define __f128(x) x##f128 | |
| 63 | # endif | |
| 64 | # endif | |
| 65 | ||
| 66 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ | |
| 67 | # if __HAVE_FLOAT128 | |
| 68 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 69 | # define __CFLOAT128 _Complex long double | |
| 70 | # else | |
| 71 | # define __CFLOAT128 _Complex _Float128 | |
| 72 | # endif | |
| 73 | # endif | |
| 74 | ||
| 75 | /* The remaining of this file provides support for older compilers. */ | |
| 76 | # if __HAVE_FLOAT128 | |
| 77 | ||
| 78 | /* The type _Float128 exists only since GCC 7.0. */ | |
| 79 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 80 | typedef long double _Float128; | |
| 81 | # endif | |
| 82 | ||
| 83 | /* Various built-in functions do not exist before GCC 7.0. */ | |
| 84 | # if !__GNUC_PREREQ (7, 0) | |
| 85 | # define __builtin_huge_valf128() (__builtin_huge_vall ()) | |
| 86 | # define __builtin_inff128() (__builtin_infl ()) | |
| 87 | # define __builtin_nanf128(x) (__builtin_nanl (x)) | |
| 88 | # define __builtin_nansf128(x) (__builtin_nansl (x)) | |
| 89 | # endif | |
| 90 | ||
| 91 | # endif | |
| 92 | ||
| 93 | #endif /* !__ASSEMBLER__. */ | |
| 94 | ||
| 95 | #include <bits/floatn-common.h> | |
| 96 | ||
| 97 | #endif /* _BITS_FLOATN_H */ | |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabi64/bits/local_lim.h deleted-99| ... | ... | @@ -1,99 +0,0 @@ |
| 1 | /* Minimum guaranteed maximum values for system limits. MIPS Linux version. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* The kernel header pollutes the namespace with the NR_OPEN symbol | |
| 20 | and defines LINK_MAX although filesystems have different maxima. A | |
| 21 | similar thing is true for OPEN_MAX: the limit can be changed at | |
| 22 | runtime and therefore the macro must not be defined. Remove this | |
| 23 | after including the header if necessary. */ | |
| 24 | #ifndef NR_OPEN | |
| 25 | # define __undef_NR_OPEN | |
| 26 | #endif | |
| 27 | #ifndef LINK_MAX | |
| 28 | # define __undef_LINK_MAX | |
| 29 | #endif | |
| 30 | #ifndef OPEN_MAX | |
| 31 | # define __undef_OPEN_MAX | |
| 32 | #endif | |
| 33 | #ifndef ARG_MAX | |
| 34 | # define __undef_ARG_MAX | |
| 35 | #endif | |
| 36 | ||
| 37 | /* The kernel sources contain a file with all the needed information. */ | |
| 38 | #include <linux/limits.h> | |
| 39 | ||
| 40 | /* Have to remove NR_OPEN? */ | |
| 41 | #ifdef __undef_NR_OPEN | |
| 42 | # undef NR_OPEN | |
| 43 | # undef __undef_NR_OPEN | |
| 44 | #endif | |
| 45 | /* Have to remove LINK_MAX? */ | |
| 46 | #ifdef __undef_LINK_MAX | |
| 47 | # undef LINK_MAX | |
| 48 | # undef __undef_LINK_MAX | |
| 49 | #endif | |
| 50 | /* Have to remove OPEN_MAX? */ | |
| 51 | #ifdef __undef_OPEN_MAX | |
| 52 | # undef OPEN_MAX | |
| 53 | # undef __undef_OPEN_MAX | |
| 54 | #endif | |
| 55 | /* Have to remove ARG_MAX? */ | |
| 56 | #ifdef __undef_ARG_MAX | |
| 57 | # undef ARG_MAX | |
| 58 | # undef __undef_ARG_MAX | |
| 59 | #endif | |
| 60 | ||
| 61 | /* The number of data keys per process. */ | |
| 62 | #define _POSIX_THREAD_KEYS_MAX	128 | |
| 63 | /* This is the value this implementation supports. */ | |
| 64 | #define PTHREAD_KEYS_MAX	1024 | |
| 65 | ||
| 66 | /* Controlling the iterations of destructors for thread-specific data. */ | |
| 67 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4 | |
| 68 | /* Number of iterations this implementation does. */ | |
| 69 | #define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS | |
| 70 | ||
| 71 | /* The number of threads per process. */ | |
| 72 | #define _POSIX_THREAD_THREADS_MAX	64 | |
| 73 | /* We have no predefined limit on the number of threads. */ | |
| 74 | #undef PTHREAD_THREADS_MAX | |
| 75 | ||
| 76 | /* Maximum amount by which a process can descrease its asynchronous I/O | |
| 77 | priority level. */ | |
| 78 | #define AIO_PRIO_DELTA_MAX	20 | |
| 79 | ||
| 80 | /* Minimum size for a thread. At least two pages with 64k pages. */ | |
| 81 | #define PTHREAD_STACK_MIN	131072 | |
| 82 | ||
| 83 | /* Maximum number of timer expiration overruns. */ | |
| 84 | #define DELAYTIMER_MAX	2147483647 | |
| 85 | ||
| 86 | /* Maximum tty name length. */ | |
| 87 | #define TTY_NAME_MAX		32 | |
| 88 | ||
| 89 | /* Maximum login name length. This is arbitrary. */ | |
| 90 | #define LOGIN_NAME_MAX		256 | |
| 91 | ||
| 92 | /* Maximum host name length. */ | |
| 93 | #define HOST_NAME_MAX		64 | |
| 94 | ||
| 95 | /* Maximum message queue priority level. */ | |
| 96 | #define MQ_PRIO_MAX		32768 | |
| 97 | ||
| 98 | /* Maximum value the semaphore can have. */ | |
| 99 | #define SEM_VALUE_MAX (2147483647) | |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabi64/bits/pthread_stack_min.h created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. MIPS Linux version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. At least two pages with 64k pages. */ | |
| 20 | #define PTHREAD_STACK_MIN	131072 | |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabi64/bits/socket-constants.h+35-3| ... | ... | @@ -30,9 +30,41 @@ |
| 30 | 30 | #define SO_OOBINLINE 256 |
| 31 | 31 | #define SO_RCVBUF 4098 |
| 32 | 32 | #define SO_RCVLOWAT 4100 |
| 33 | #define SO_RCVTIMEO 4102 | |
| 34 | 33 | #define SO_REUSEADDR 4 |
| 35 | 34 | #define SO_SNDBUF 4097 |
| 36 | 35 | #define SO_SNDLOWAT 4099 |
| 37 | #define SO_SNDTIMEO 4101 | |
| 38 | #define SO_TYPE 4104 | |
| \ No newline at end of file | ||
| 36 | #define SO_TYPE 4104 | |
| 37 | ||
| 38 | #if __TIMESIZE == 64 | |
| 39 | # define SO_RCVTIMEO 4102 | |
| 40 | # define SO_SNDTIMEO 4101 | |
| 41 | # define SO_TIMESTAMP 29 | |
| 42 | # define SO_TIMESTAMPNS 35 | |
| 43 | # define SO_TIMESTAMPING 37 | |
| 44 | #else | |
| 45 | # define SO_RCVTIMEO_OLD 4102 | |
| 46 | # define SO_SNDTIMEO_OLD 4101 | |
| 47 | # define SO_RCVTIMEO_NEW 66 | |
| 48 | # define SO_SNDTIMEO_NEW 67 | |
| 49 | ||
| 50 | # define SO_TIMESTAMP_OLD 29 | |
| 51 | # define SO_TIMESTAMPNS_OLD 35 | |
| 52 | # define SO_TIMESTAMPING_OLD 37 | |
| 53 | # define SO_TIMESTAMP_NEW 63 | |
| 54 | # define SO_TIMESTAMPNS_NEW 64 | |
| 55 | # define SO_TIMESTAMPING_NEW 65 | |
| 56 | ||
| 57 | # ifdef __USE_TIME_BITS64 | |
| 58 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 59 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 60 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 61 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 62 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 63 | # else | |
| 64 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 65 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 66 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 67 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 68 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 69 | # endif | |
| 70 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabi64/bits/struct_rwlock.h deleted-71| ... | ... | @@ -1,71 +0,0 @@ |
| 1 | /* MIPS internal rwlock struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _RWLOCK_INTERNAL_H | |
| 20 | #define _RWLOCK_INTERNAL_H | |
| 21 | ||
| 22 | struct __pthread_rwlock_arch_t | |
| 23 | { | |
| 24 | unsigned int __readers; | |
| 25 | unsigned int __writers; | |
| 26 | unsigned int __wrphase_futex; | |
| 27 | unsigned int __writers_futex; | |
| 28 | unsigned int __pad3; | |
| 29 | unsigned int __pad4; | |
| 30 | #if _MIPS_SIM == _ABI64 | |
| 31 | int __cur_writer; | |
| 32 | int __shared; | |
| 33 | unsigned long int __pad1; | |
| 34 | unsigned long int __pad2; | |
| 35 | /* FLAGS must stay at this position in the structure to maintain | |
| 36 | binary compatibility. */ | |
| 37 | unsigned int __flags; | |
| 38 | # else | |
| 39 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 40 | unsigned char __pad1; | |
| 41 | unsigned char __pad2; | |
| 42 | unsigned char __shared; | |
| 43 | /* FLAGS must stay at this position in the structure to maintain | |
| 44 | binary compatibility. */ | |
| 45 | unsigned char __flags; | |
| 46 | # else | |
| 47 | /* FLAGS must stay at this position in the structure to maintain | |
| 48 | binary compatibility. */ | |
| 49 | unsigned char __flags; | |
| 50 | unsigned char __shared; | |
| 51 | unsigned char __pad1; | |
| 52 | unsigned char __pad2; | |
| 53 | # endif | |
| 54 | int __cur_writer; | |
| 55 | #endif | |
| 56 | }; | |
| 57 | ||
| 58 | #if _MIPS_SIM == _ABI64 | |
| 59 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 60 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags | |
| 61 | #else | |
| 62 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 63 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 64 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 65 | # else | |
| 66 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 67 | 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 | |
| 68 | # endif | |
| 69 | #endif | |
| 70 | ||
| 71 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_msqid_ds.h+12-6| ... | ... | @@ -20,32 +20,37 @@ |
| 20 | 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." |
| 21 | 21 | #endif |
| 22 | 22 | |
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 23 | 25 | /* Structure of record for one message inside the kernel. |
| 24 | 26 | The type `struct msg' is opaque. */ |
| 25 | 27 | struct msqid_ds |
| 26 | 28 | { |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 27 | 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ |
| 28 | #if __TIMESIZE == 32 | |
| 29 | # ifdef __MIPSEL__ | |
| 33 | # if __TIMESIZE == 32 | |
| 34 | # ifdef __MIPSEL__ | |
| 30 | 35 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 31 | 36 | unsigned long int __msg_stime_high; |
| 32 | 37 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 33 | 38 | unsigned long int __msg_rtime_high; |
| 34 | 39 | __time_t msg_ctime;		/* time of last change */ |
| 35 | 40 | unsigned long int __msg_ctime_high; |
| 36 | # else | |
| 41 | # else | |
| 37 | 42 | unsigned long int __msg_stime_high; |
| 38 | 43 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 39 | 44 | unsigned long int __msg_rtime_high; |
| 40 | 45 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 41 | 46 | unsigned long int __msg_ctime_high; |
| 42 | 47 | __time_t msg_ctime;		/* time of last change */ |
| 43 | # endif | |
| 44 | #else | |
| 48 | # endif | |
| 49 | # else | |
| 45 | 50 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 46 | 51 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 47 | 52 | __time_t msg_ctime;		/* time of last change */ |
| 48 | #endif | |
| 53 | # endif | |
| 49 | 54 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ |
| 50 | 55 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ |
| 51 | 56 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ |
| ... | ... | @@ -53,4 +58,5 @@ struct msqid_ds |
| 53 | 58 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ |
| 54 | 59 | __syscall_ulong_t __glibc_reserved4; |
| 55 | 60 | __syscall_ulong_t __glibc_reserved5; |
| 61 | #endif | |
| 56 | 62 | }; |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_semid_ds.h+4| ... | ... | @@ -23,10 +23,14 @@ |
| 23 | 23 | /* Data structure describing a set of semaphores. */ |
| 24 | 24 | struct semid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm sem_perm;		/* operation permission struct */ |
| 27 | 30 | __time_t sem_otime;	/* last semop() time */ |
| 28 | 31 | __time_t sem_ctime;	/* last time changed by semctl() */ |
| 29 | 32 | __syscall_ulong_t sem_nsems;		/* number of semaphores in set */ |
| 30 | 33 | __syscall_ulong_t __sem_otime_high; |
| 31 | 34 | __syscall_ulong_t __sem_ctime_high; |
| 35 | #endif | |
| 32 | 36 | }; |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_shmid_ds.h+9-5| ... | ... | @@ -23,27 +23,31 @@ |
| 23 | 23 | /* Data structure describing a shared memory segment. */ |
| 24 | 24 | struct shmid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm shm_perm;		/* operation permission struct */ |
| 27 | 30 | size_t shm_segsz;			/* size of segment in bytes */ |
| 28 | #if __TIMESIZE == 32 | |
| 31 | # if __TIMESIZE == 32 | |
| 29 | 32 | __time_t shm_atime;			/* time of last shmat() */ |
| 30 | 33 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 31 | 34 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 32 | #else | |
| 35 | # else | |
| 33 | 36 | __time_t shm_atime;			/* time of last shmat() */ |
| 34 | 37 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 35 | 38 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 36 | #endif | |
| 39 | # endif | |
| 37 | 40 | __pid_t shm_cpid;			/* pid of creator */ |
| 38 | 41 | __pid_t shm_lpid;			/* pid of last shmop */ |
| 39 | 42 | shmatt_t shm_nattch;		/* number of current attaches */ |
| 40 | #if __TIMESIZE == 32 | |
| 43 | # if __TIMESIZE == 32 | |
| 41 | 44 | unsigned short int __shm_atime_high; |
| 42 | 45 | unsigned short int __shm_dtime_high; |
| 43 | 46 | unsigned short int __shm_ctime_high; |
| 44 | 47 | unsigned short int __glibc_reserved4; |
| 45 | #else | |
| 48 | # else | |
| 46 | 49 | __syscall_ulong_t __glibc_reserved5; |
| 47 | 50 | __syscall_ulong_t __glibc_reserved6; |
| 51 | # endif | |
| 48 | 52 | #endif |
| 49 | 53 | }; |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabi64/bits/wordsize.h deleted-31| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #include <sgidefs.h> | |
| 19 | ||
| 20 | #define __WORDSIZE			_MIPS_SZPTR | |
| 21 | ||
| 22 | #if _MIPS_SIM == _ABI64 | |
| 23 | # define __WORDSIZE_TIME64_COMPAT32	1 | |
| 24 | #else | |
| 25 | # define __WORDSIZE_TIME64_COMPAT32	0 | |
| 26 | #endif | |
| 27 | ||
| 28 | #if __WORDSIZE == 32 | |
| 29 | #define __WORDSIZE32_SIZE_ULONG		0 | |
| 30 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| 31 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabin32/bits/floatn.h deleted-97| ... | ... | @@ -1,97 +0,0 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features on MIPS platforms. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_FLOATN_H | |
| 20 | #define _BITS_FLOATN_H | |
| 21 | ||
| 22 | #include <features.h> | |
| 23 | #include <bits/long-double.h> | |
| 24 | ||
| 25 | /* Defined to 1 if the current compiler invocation provides a | |
| 26 | floating-point type with the IEEE 754 binary128 format, and this | |
| 27 | glibc includes corresponding *f128 interfaces for it. */ | |
| 28 | #ifndef __NO_LONG_DOUBLE_MATH | |
| 29 | # define __HAVE_FLOAT128 1 | |
| 30 | #else | |
| 31 | /* glibc does not support _Float128 for platforms where long double is | |
| 32 | normally binary128 when building with long double as binary64. | |
| 33 | GCC's default for supported scalar modes does not support it either | |
| 34 | in that case. */ | |
| 35 | # define __HAVE_FLOAT128 0 | |
| 36 | #endif | |
| 37 | ||
| 38 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 39 | from the default float, double and long double types in this glibc. */ | |
| 40 | #define __HAVE_DISTINCT_FLOAT128 0 | |
| 41 | ||
| 42 | /* Defined to 1 if the current compiler invocation provides a | |
| 43 | floating-point type with the right format for _Float64x, and this | |
| 44 | glibc includes corresponding *f64x interfaces for it. */ | |
| 45 | #define __HAVE_FLOAT64X __HAVE_FLOAT128 | |
| 46 | ||
| 47 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 48 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 49 | the format of _Float128, which must be different from that of long | |
| 50 | double. */ | |
| 51 | #define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128 | |
| 52 | ||
| 53 | #ifndef __ASSEMBLER__ | |
| 54 | ||
| 55 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 56 | types, if __HAVE_FLOAT128 is 1. */ | |
| 57 | # if __HAVE_FLOAT128 | |
| 58 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 59 | /* The literal suffix f128 exists only since GCC 7.0. */ | |
| 60 | # define __f128(x) x##l | |
| 61 | # else | |
| 62 | # define __f128(x) x##f128 | |
| 63 | # endif | |
| 64 | # endif | |
| 65 | ||
| 66 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ | |
| 67 | # if __HAVE_FLOAT128 | |
| 68 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 69 | # define __CFLOAT128 _Complex long double | |
| 70 | # else | |
| 71 | # define __CFLOAT128 _Complex _Float128 | |
| 72 | # endif | |
| 73 | # endif | |
| 74 | ||
| 75 | /* The remaining of this file provides support for older compilers. */ | |
| 76 | # if __HAVE_FLOAT128 | |
| 77 | ||
| 78 | /* The type _Float128 exists only since GCC 7.0. */ | |
| 79 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 80 | typedef long double _Float128; | |
| 81 | # endif | |
| 82 | ||
| 83 | /* Various built-in functions do not exist before GCC 7.0. */ | |
| 84 | # if !__GNUC_PREREQ (7, 0) | |
| 85 | # define __builtin_huge_valf128() (__builtin_huge_vall ()) | |
| 86 | # define __builtin_inff128() (__builtin_infl ()) | |
| 87 | # define __builtin_nanf128(x) (__builtin_nanl (x)) | |
| 88 | # define __builtin_nansf128(x) (__builtin_nansl (x)) | |
| 89 | # endif | |
| 90 | ||
| 91 | # endif | |
| 92 | ||
| 93 | #endif /* !__ASSEMBLER__. */ | |
| 94 | ||
| 95 | #include <bits/floatn-common.h> | |
| 96 | ||
| 97 | #endif /* _BITS_FLOATN_H */ | |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabin32/bits/local_lim.h deleted-99| ... | ... | @@ -1,99 +0,0 @@ |
| 1 | /* Minimum guaranteed maximum values for system limits. MIPS Linux version. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* The kernel header pollutes the namespace with the NR_OPEN symbol | |
| 20 | and defines LINK_MAX although filesystems have different maxima. A | |
| 21 | similar thing is true for OPEN_MAX: the limit can be changed at | |
| 22 | runtime and therefore the macro must not be defined. Remove this | |
| 23 | after including the header if necessary. */ | |
| 24 | #ifndef NR_OPEN | |
| 25 | # define __undef_NR_OPEN | |
| 26 | #endif | |
| 27 | #ifndef LINK_MAX | |
| 28 | # define __undef_LINK_MAX | |
| 29 | #endif | |
| 30 | #ifndef OPEN_MAX | |
| 31 | # define __undef_OPEN_MAX | |
| 32 | #endif | |
| 33 | #ifndef ARG_MAX | |
| 34 | # define __undef_ARG_MAX | |
| 35 | #endif | |
| 36 | ||
| 37 | /* The kernel sources contain a file with all the needed information. */ | |
| 38 | #include <linux/limits.h> | |
| 39 | ||
| 40 | /* Have to remove NR_OPEN? */ | |
| 41 | #ifdef __undef_NR_OPEN | |
| 42 | # undef NR_OPEN | |
| 43 | # undef __undef_NR_OPEN | |
| 44 | #endif | |
| 45 | /* Have to remove LINK_MAX? */ | |
| 46 | #ifdef __undef_LINK_MAX | |
| 47 | # undef LINK_MAX | |
| 48 | # undef __undef_LINK_MAX | |
| 49 | #endif | |
| 50 | /* Have to remove OPEN_MAX? */ | |
| 51 | #ifdef __undef_OPEN_MAX | |
| 52 | # undef OPEN_MAX | |
| 53 | # undef __undef_OPEN_MAX | |
| 54 | #endif | |
| 55 | /* Have to remove ARG_MAX? */ | |
| 56 | #ifdef __undef_ARG_MAX | |
| 57 | # undef ARG_MAX | |
| 58 | # undef __undef_ARG_MAX | |
| 59 | #endif | |
| 60 | ||
| 61 | /* The number of data keys per process. */ | |
| 62 | #define _POSIX_THREAD_KEYS_MAX	128 | |
| 63 | /* This is the value this implementation supports. */ | |
| 64 | #define PTHREAD_KEYS_MAX	1024 | |
| 65 | ||
| 66 | /* Controlling the iterations of destructors for thread-specific data. */ | |
| 67 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4 | |
| 68 | /* Number of iterations this implementation does. */ | |
| 69 | #define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS | |
| 70 | ||
| 71 | /* The number of threads per process. */ | |
| 72 | #define _POSIX_THREAD_THREADS_MAX	64 | |
| 73 | /* We have no predefined limit on the number of threads. */ | |
| 74 | #undef PTHREAD_THREADS_MAX | |
| 75 | ||
| 76 | /* Maximum amount by which a process can descrease its asynchronous I/O | |
| 77 | priority level. */ | |
| 78 | #define AIO_PRIO_DELTA_MAX	20 | |
| 79 | ||
| 80 | /* Minimum size for a thread. At least two pages with 64k pages. */ | |
| 81 | #define PTHREAD_STACK_MIN	131072 | |
| 82 | ||
| 83 | /* Maximum number of timer expiration overruns. */ | |
| 84 | #define DELAYTIMER_MAX	2147483647 | |
| 85 | ||
| 86 | /* Maximum tty name length. */ | |
| 87 | #define TTY_NAME_MAX		32 | |
| 88 | ||
| 89 | /* Maximum login name length. This is arbitrary. */ | |
| 90 | #define LOGIN_NAME_MAX		256 | |
| 91 | ||
| 92 | /* Maximum host name length. */ | |
| 93 | #define HOST_NAME_MAX		64 | |
| 94 | ||
| 95 | /* Maximum message queue priority level. */ | |
| 96 | #define MQ_PRIO_MAX		32768 | |
| 97 | ||
| 98 | /* Maximum value the semaphore can have. */ | |
| 99 | #define SEM_VALUE_MAX (2147483647) | |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabin32/bits/pthread_stack_min.h created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. MIPS Linux version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. At least two pages with 64k pages. */ | |
| 20 | #define PTHREAD_STACK_MIN	131072 | |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabin32/bits/socket-constants.h+35-3| ... | ... | @@ -30,9 +30,41 @@ |
| 30 | 30 | #define SO_OOBINLINE 256 |
| 31 | 31 | #define SO_RCVBUF 4098 |
| 32 | 32 | #define SO_RCVLOWAT 4100 |
| 33 | #define SO_RCVTIMEO 4102 | |
| 34 | 33 | #define SO_REUSEADDR 4 |
| 35 | 34 | #define SO_SNDBUF 4097 |
| 36 | 35 | #define SO_SNDLOWAT 4099 |
| 37 | #define SO_SNDTIMEO 4101 | |
| 38 | #define SO_TYPE 4104 | |
| \ No newline at end of file | ||
| 36 | #define SO_TYPE 4104 | |
| 37 | ||
| 38 | #if __TIMESIZE == 64 | |
| 39 | # define SO_RCVTIMEO 4102 | |
| 40 | # define SO_SNDTIMEO 4101 | |
| 41 | # define SO_TIMESTAMP 29 | |
| 42 | # define SO_TIMESTAMPNS 35 | |
| 43 | # define SO_TIMESTAMPING 37 | |
| 44 | #else | |
| 45 | # define SO_RCVTIMEO_OLD 4102 | |
| 46 | # define SO_SNDTIMEO_OLD 4101 | |
| 47 | # define SO_RCVTIMEO_NEW 66 | |
| 48 | # define SO_SNDTIMEO_NEW 67 | |
| 49 | ||
| 50 | # define SO_TIMESTAMP_OLD 29 | |
| 51 | # define SO_TIMESTAMPNS_OLD 35 | |
| 52 | # define SO_TIMESTAMPING_OLD 37 | |
| 53 | # define SO_TIMESTAMP_NEW 63 | |
| 54 | # define SO_TIMESTAMPNS_NEW 64 | |
| 55 | # define SO_TIMESTAMPING_NEW 65 | |
| 56 | ||
| 57 | # ifdef __USE_TIME_BITS64 | |
| 58 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 59 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 60 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 61 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 62 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 63 | # else | |
| 64 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 65 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 66 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 67 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 68 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 69 | # endif | |
| 70 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabin32/bits/struct_rwlock.h deleted-71| ... | ... | @@ -1,71 +0,0 @@ |
| 1 | /* MIPS internal rwlock struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _RWLOCK_INTERNAL_H | |
| 20 | #define _RWLOCK_INTERNAL_H | |
| 21 | ||
| 22 | struct __pthread_rwlock_arch_t | |
| 23 | { | |
| 24 | unsigned int __readers; | |
| 25 | unsigned int __writers; | |
| 26 | unsigned int __wrphase_futex; | |
| 27 | unsigned int __writers_futex; | |
| 28 | unsigned int __pad3; | |
| 29 | unsigned int __pad4; | |
| 30 | #if _MIPS_SIM == _ABI64 | |
| 31 | int __cur_writer; | |
| 32 | int __shared; | |
| 33 | unsigned long int __pad1; | |
| 34 | unsigned long int __pad2; | |
| 35 | /* FLAGS must stay at this position in the structure to maintain | |
| 36 | binary compatibility. */ | |
| 37 | unsigned int __flags; | |
| 38 | # else | |
| 39 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 40 | unsigned char __pad1; | |
| 41 | unsigned char __pad2; | |
| 42 | unsigned char __shared; | |
| 43 | /* FLAGS must stay at this position in the structure to maintain | |
| 44 | binary compatibility. */ | |
| 45 | unsigned char __flags; | |
| 46 | # else | |
| 47 | /* FLAGS must stay at this position in the structure to maintain | |
| 48 | binary compatibility. */ | |
| 49 | unsigned char __flags; | |
| 50 | unsigned char __shared; | |
| 51 | unsigned char __pad1; | |
| 52 | unsigned char __pad2; | |
| 53 | # endif | |
| 54 | int __cur_writer; | |
| 55 | #endif | |
| 56 | }; | |
| 57 | ||
| 58 | #if _MIPS_SIM == _ABI64 | |
| 59 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 60 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags | |
| 61 | #else | |
| 62 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 63 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 64 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 65 | # else | |
| 66 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 67 | 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 | |
| 68 | # endif | |
| 69 | #endif | |
| 70 | ||
| 71 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_msqid_ds.h+12-6| ... | ... | @@ -20,32 +20,37 @@ |
| 20 | 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." |
| 21 | 21 | #endif |
| 22 | 22 | |
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 23 | 25 | /* Structure of record for one message inside the kernel. |
| 24 | 26 | The type `struct msg' is opaque. */ |
| 25 | 27 | struct msqid_ds |
| 26 | 28 | { |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 27 | 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ |
| 28 | #if __TIMESIZE == 32 | |
| 29 | # ifdef __MIPSEL__ | |
| 33 | # if __TIMESIZE == 32 | |
| 34 | # ifdef __MIPSEL__ | |
| 30 | 35 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 31 | 36 | unsigned long int __msg_stime_high; |
| 32 | 37 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 33 | 38 | unsigned long int __msg_rtime_high; |
| 34 | 39 | __time_t msg_ctime;		/* time of last change */ |
| 35 | 40 | unsigned long int __msg_ctime_high; |
| 36 | # else | |
| 41 | # else | |
| 37 | 42 | unsigned long int __msg_stime_high; |
| 38 | 43 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 39 | 44 | unsigned long int __msg_rtime_high; |
| 40 | 45 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 41 | 46 | unsigned long int __msg_ctime_high; |
| 42 | 47 | __time_t msg_ctime;		/* time of last change */ |
| 43 | # endif | |
| 44 | #else | |
| 48 | # endif | |
| 49 | # else | |
| 45 | 50 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 46 | 51 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 47 | 52 | __time_t msg_ctime;		/* time of last change */ |
| 48 | #endif | |
| 53 | # endif | |
| 49 | 54 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ |
| 50 | 55 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ |
| 51 | 56 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ |
| ... | ... | @@ -53,4 +58,5 @@ struct msqid_ds |
| 53 | 58 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ |
| 54 | 59 | __syscall_ulong_t __glibc_reserved4; |
| 55 | 60 | __syscall_ulong_t __glibc_reserved5; |
| 61 | #endif | |
| 56 | 62 | }; |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_semid_ds.h+4| ... | ... | @@ -23,10 +23,14 @@ |
| 23 | 23 | /* Data structure describing a set of semaphores. */ |
| 24 | 24 | struct semid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm sem_perm;		/* operation permission struct */ |
| 27 | 30 | __time_t sem_otime;	/* last semop() time */ |
| 28 | 31 | __time_t sem_ctime;	/* last time changed by semctl() */ |
| 29 | 32 | __syscall_ulong_t sem_nsems;		/* number of semaphores in set */ |
| 30 | 33 | __syscall_ulong_t __sem_otime_high; |
| 31 | 34 | __syscall_ulong_t __sem_ctime_high; |
| 35 | #endif | |
| 32 | 36 | }; |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_shmid_ds.h+9-5| ... | ... | @@ -23,27 +23,31 @@ |
| 23 | 23 | /* Data structure describing a shared memory segment. */ |
| 24 | 24 | struct shmid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm shm_perm;		/* operation permission struct */ |
| 27 | 30 | size_t shm_segsz;			/* size of segment in bytes */ |
| 28 | #if __TIMESIZE == 32 | |
| 31 | # if __TIMESIZE == 32 | |
| 29 | 32 | __time_t shm_atime;			/* time of last shmat() */ |
| 30 | 33 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 31 | 34 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 32 | #else | |
| 35 | # else | |
| 33 | 36 | __time_t shm_atime;			/* time of last shmat() */ |
| 34 | 37 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 35 | 38 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 36 | #endif | |
| 39 | # endif | |
| 37 | 40 | __pid_t shm_cpid;			/* pid of creator */ |
| 38 | 41 | __pid_t shm_lpid;			/* pid of last shmop */ |
| 39 | 42 | shmatt_t shm_nattch;		/* number of current attaches */ |
| 40 | #if __TIMESIZE == 32 | |
| 43 | # if __TIMESIZE == 32 | |
| 41 | 44 | unsigned short int __shm_atime_high; |
| 42 | 45 | unsigned short int __shm_dtime_high; |
| 43 | 46 | unsigned short int __shm_ctime_high; |
| 44 | 47 | unsigned short int __glibc_reserved4; |
| 45 | #else | |
| 48 | # else | |
| 46 | 49 | __syscall_ulong_t __glibc_reserved5; |
| 47 | 50 | __syscall_ulong_t __glibc_reserved6; |
| 51 | # endif | |
| 48 | 52 | #endif |
| 49 | 53 | }; |
| \ No newline at end of file |
lib/libc/include/mips64-linux-gnuabin32/bits/wordsize.h deleted-31| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #include <sgidefs.h> | |
| 19 | ||
| 20 | #define __WORDSIZE			_MIPS_SZPTR | |
| 21 | ||
| 22 | #if _MIPS_SIM == _ABI64 | |
| 23 | # define __WORDSIZE_TIME64_COMPAT32	1 | |
| 24 | #else | |
| 25 | # define __WORDSIZE_TIME64_COMPAT32	0 | |
| 26 | #endif | |
| 27 | ||
| 28 | #if __WORDSIZE == 32 | |
| 29 | #define __WORDSIZE32_SIZE_ULONG		0 | |
| 30 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| 31 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabi64/bits/floatn.h deleted-97| ... | ... | @@ -1,97 +0,0 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features on MIPS platforms. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_FLOATN_H | |
| 20 | #define _BITS_FLOATN_H | |
| 21 | ||
| 22 | #include <features.h> | |
| 23 | #include <bits/long-double.h> | |
| 24 | ||
| 25 | /* Defined to 1 if the current compiler invocation provides a | |
| 26 | floating-point type with the IEEE 754 binary128 format, and this | |
| 27 | glibc includes corresponding *f128 interfaces for it. */ | |
| 28 | #ifndef __NO_LONG_DOUBLE_MATH | |
| 29 | # define __HAVE_FLOAT128 1 | |
| 30 | #else | |
| 31 | /* glibc does not support _Float128 for platforms where long double is | |
| 32 | normally binary128 when building with long double as binary64. | |
| 33 | GCC's default for supported scalar modes does not support it either | |
| 34 | in that case. */ | |
| 35 | # define __HAVE_FLOAT128 0 | |
| 36 | #endif | |
| 37 | ||
| 38 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 39 | from the default float, double and long double types in this glibc. */ | |
| 40 | #define __HAVE_DISTINCT_FLOAT128 0 | |
| 41 | ||
| 42 | /* Defined to 1 if the current compiler invocation provides a | |
| 43 | floating-point type with the right format for _Float64x, and this | |
| 44 | glibc includes corresponding *f64x interfaces for it. */ | |
| 45 | #define __HAVE_FLOAT64X __HAVE_FLOAT128 | |
| 46 | ||
| 47 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 48 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 49 | the format of _Float128, which must be different from that of long | |
| 50 | double. */ | |
| 51 | #define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128 | |
| 52 | ||
| 53 | #ifndef __ASSEMBLER__ | |
| 54 | ||
| 55 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 56 | types, if __HAVE_FLOAT128 is 1. */ | |
| 57 | # if __HAVE_FLOAT128 | |
| 58 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 59 | /* The literal suffix f128 exists only since GCC 7.0. */ | |
| 60 | # define __f128(x) x##l | |
| 61 | # else | |
| 62 | # define __f128(x) x##f128 | |
| 63 | # endif | |
| 64 | # endif | |
| 65 | ||
| 66 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ | |
| 67 | # if __HAVE_FLOAT128 | |
| 68 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 69 | # define __CFLOAT128 _Complex long double | |
| 70 | # else | |
| 71 | # define __CFLOAT128 _Complex _Float128 | |
| 72 | # endif | |
| 73 | # endif | |
| 74 | ||
| 75 | /* The remaining of this file provides support for older compilers. */ | |
| 76 | # if __HAVE_FLOAT128 | |
| 77 | ||
| 78 | /* The type _Float128 exists only since GCC 7.0. */ | |
| 79 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 80 | typedef long double _Float128; | |
| 81 | # endif | |
| 82 | ||
| 83 | /* Various built-in functions do not exist before GCC 7.0. */ | |
| 84 | # if !__GNUC_PREREQ (7, 0) | |
| 85 | # define __builtin_huge_valf128() (__builtin_huge_vall ()) | |
| 86 | # define __builtin_inff128() (__builtin_infl ()) | |
| 87 | # define __builtin_nanf128(x) (__builtin_nanl (x)) | |
| 88 | # define __builtin_nansf128(x) (__builtin_nansl (x)) | |
| 89 | # endif | |
| 90 | ||
| 91 | # endif | |
| 92 | ||
| 93 | #endif /* !__ASSEMBLER__. */ | |
| 94 | ||
| 95 | #include <bits/floatn-common.h> | |
| 96 | ||
| 97 | #endif /* _BITS_FLOATN_H */ | |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabi64/bits/local_lim.h deleted-99| ... | ... | @@ -1,99 +0,0 @@ |
| 1 | /* Minimum guaranteed maximum values for system limits. MIPS Linux version. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* The kernel header pollutes the namespace with the NR_OPEN symbol | |
| 20 | and defines LINK_MAX although filesystems have different maxima. A | |
| 21 | similar thing is true for OPEN_MAX: the limit can be changed at | |
| 22 | runtime and therefore the macro must not be defined. Remove this | |
| 23 | after including the header if necessary. */ | |
| 24 | #ifndef NR_OPEN | |
| 25 | # define __undef_NR_OPEN | |
| 26 | #endif | |
| 27 | #ifndef LINK_MAX | |
| 28 | # define __undef_LINK_MAX | |
| 29 | #endif | |
| 30 | #ifndef OPEN_MAX | |
| 31 | # define __undef_OPEN_MAX | |
| 32 | #endif | |
| 33 | #ifndef ARG_MAX | |
| 34 | # define __undef_ARG_MAX | |
| 35 | #endif | |
| 36 | ||
| 37 | /* The kernel sources contain a file with all the needed information. */ | |
| 38 | #include <linux/limits.h> | |
| 39 | ||
| 40 | /* Have to remove NR_OPEN? */ | |
| 41 | #ifdef __undef_NR_OPEN | |
| 42 | # undef NR_OPEN | |
| 43 | # undef __undef_NR_OPEN | |
| 44 | #endif | |
| 45 | /* Have to remove LINK_MAX? */ | |
| 46 | #ifdef __undef_LINK_MAX | |
| 47 | # undef LINK_MAX | |
| 48 | # undef __undef_LINK_MAX | |
| 49 | #endif | |
| 50 | /* Have to remove OPEN_MAX? */ | |
| 51 | #ifdef __undef_OPEN_MAX | |
| 52 | # undef OPEN_MAX | |
| 53 | # undef __undef_OPEN_MAX | |
| 54 | #endif | |
| 55 | /* Have to remove ARG_MAX? */ | |
| 56 | #ifdef __undef_ARG_MAX | |
| 57 | # undef ARG_MAX | |
| 58 | # undef __undef_ARG_MAX | |
| 59 | #endif | |
| 60 | ||
| 61 | /* The number of data keys per process. */ | |
| 62 | #define _POSIX_THREAD_KEYS_MAX	128 | |
| 63 | /* This is the value this implementation supports. */ | |
| 64 | #define PTHREAD_KEYS_MAX	1024 | |
| 65 | ||
| 66 | /* Controlling the iterations of destructors for thread-specific data. */ | |
| 67 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4 | |
| 68 | /* Number of iterations this implementation does. */ | |
| 69 | #define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS | |
| 70 | ||
| 71 | /* The number of threads per process. */ | |
| 72 | #define _POSIX_THREAD_THREADS_MAX	64 | |
| 73 | /* We have no predefined limit on the number of threads. */ | |
| 74 | #undef PTHREAD_THREADS_MAX | |
| 75 | ||
| 76 | /* Maximum amount by which a process can descrease its asynchronous I/O | |
| 77 | priority level. */ | |
| 78 | #define AIO_PRIO_DELTA_MAX	20 | |
| 79 | ||
| 80 | /* Minimum size for a thread. At least two pages with 64k pages. */ | |
| 81 | #define PTHREAD_STACK_MIN	131072 | |
| 82 | ||
| 83 | /* Maximum number of timer expiration overruns. */ | |
| 84 | #define DELAYTIMER_MAX	2147483647 | |
| 85 | ||
| 86 | /* Maximum tty name length. */ | |
| 87 | #define TTY_NAME_MAX		32 | |
| 88 | ||
| 89 | /* Maximum login name length. This is arbitrary. */ | |
| 90 | #define LOGIN_NAME_MAX		256 | |
| 91 | ||
| 92 | /* Maximum host name length. */ | |
| 93 | #define HOST_NAME_MAX		64 | |
| 94 | ||
| 95 | /* Maximum message queue priority level. */ | |
| 96 | #define MQ_PRIO_MAX		32768 | |
| 97 | ||
| 98 | /* Maximum value the semaphore can have. */ | |
| 99 | #define SEM_VALUE_MAX (2147483647) | |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabi64/bits/pthread_stack_min.h created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. MIPS Linux version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. At least two pages with 64k pages. */ | |
| 20 | #define PTHREAD_STACK_MIN	131072 | |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabi64/bits/socket-constants.h+35-3| ... | ... | @@ -30,9 +30,41 @@ |
| 30 | 30 | #define SO_OOBINLINE 256 |
| 31 | 31 | #define SO_RCVBUF 4098 |
| 32 | 32 | #define SO_RCVLOWAT 4100 |
| 33 | #define SO_RCVTIMEO 4102 | |
| 34 | 33 | #define SO_REUSEADDR 4 |
| 35 | 34 | #define SO_SNDBUF 4097 |
| 36 | 35 | #define SO_SNDLOWAT 4099 |
| 37 | #define SO_SNDTIMEO 4101 | |
| 38 | #define SO_TYPE 4104 | |
| \ No newline at end of file | ||
| 36 | #define SO_TYPE 4104 | |
| 37 | ||
| 38 | #if __TIMESIZE == 64 | |
| 39 | # define SO_RCVTIMEO 4102 | |
| 40 | # define SO_SNDTIMEO 4101 | |
| 41 | # define SO_TIMESTAMP 29 | |
| 42 | # define SO_TIMESTAMPNS 35 | |
| 43 | # define SO_TIMESTAMPING 37 | |
| 44 | #else | |
| 45 | # define SO_RCVTIMEO_OLD 4102 | |
| 46 | # define SO_SNDTIMEO_OLD 4101 | |
| 47 | # define SO_RCVTIMEO_NEW 66 | |
| 48 | # define SO_SNDTIMEO_NEW 67 | |
| 49 | ||
| 50 | # define SO_TIMESTAMP_OLD 29 | |
| 51 | # define SO_TIMESTAMPNS_OLD 35 | |
| 52 | # define SO_TIMESTAMPING_OLD 37 | |
| 53 | # define SO_TIMESTAMP_NEW 63 | |
| 54 | # define SO_TIMESTAMPNS_NEW 64 | |
| 55 | # define SO_TIMESTAMPING_NEW 65 | |
| 56 | ||
| 57 | # ifdef __USE_TIME_BITS64 | |
| 58 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 59 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 60 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 61 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 62 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 63 | # else | |
| 64 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 65 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 66 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 67 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 68 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 69 | # endif | |
| 70 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabi64/bits/struct_rwlock.h deleted-71| ... | ... | @@ -1,71 +0,0 @@ |
| 1 | /* MIPS internal rwlock struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _RWLOCK_INTERNAL_H | |
| 20 | #define _RWLOCK_INTERNAL_H | |
| 21 | ||
| 22 | struct __pthread_rwlock_arch_t | |
| 23 | { | |
| 24 | unsigned int __readers; | |
| 25 | unsigned int __writers; | |
| 26 | unsigned int __wrphase_futex; | |
| 27 | unsigned int __writers_futex; | |
| 28 | unsigned int __pad3; | |
| 29 | unsigned int __pad4; | |
| 30 | #if _MIPS_SIM == _ABI64 | |
| 31 | int __cur_writer; | |
| 32 | int __shared; | |
| 33 | unsigned long int __pad1; | |
| 34 | unsigned long int __pad2; | |
| 35 | /* FLAGS must stay at this position in the structure to maintain | |
| 36 | binary compatibility. */ | |
| 37 | unsigned int __flags; | |
| 38 | # else | |
| 39 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 40 | unsigned char __pad1; | |
| 41 | unsigned char __pad2; | |
| 42 | unsigned char __shared; | |
| 43 | /* FLAGS must stay at this position in the structure to maintain | |
| 44 | binary compatibility. */ | |
| 45 | unsigned char __flags; | |
| 46 | # else | |
| 47 | /* FLAGS must stay at this position in the structure to maintain | |
| 48 | binary compatibility. */ | |
| 49 | unsigned char __flags; | |
| 50 | unsigned char __shared; | |
| 51 | unsigned char __pad1; | |
| 52 | unsigned char __pad2; | |
| 53 | # endif | |
| 54 | int __cur_writer; | |
| 55 | #endif | |
| 56 | }; | |
| 57 | ||
| 58 | #if _MIPS_SIM == _ABI64 | |
| 59 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 60 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags | |
| 61 | #else | |
| 62 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 63 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 64 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 65 | # else | |
| 66 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 67 | 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 | |
| 68 | # endif | |
| 69 | #endif | |
| 70 | ||
| 71 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_msqid_ds.h+12-6| ... | ... | @@ -20,32 +20,37 @@ |
| 20 | 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." |
| 21 | 21 | #endif |
| 22 | 22 | |
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 23 | 25 | /* Structure of record for one message inside the kernel. |
| 24 | 26 | The type `struct msg' is opaque. */ |
| 25 | 27 | struct msqid_ds |
| 26 | 28 | { |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 27 | 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ |
| 28 | #if __TIMESIZE == 32 | |
| 29 | # ifdef __MIPSEL__ | |
| 33 | # if __TIMESIZE == 32 | |
| 34 | # ifdef __MIPSEL__ | |
| 30 | 35 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 31 | 36 | unsigned long int __msg_stime_high; |
| 32 | 37 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 33 | 38 | unsigned long int __msg_rtime_high; |
| 34 | 39 | __time_t msg_ctime;		/* time of last change */ |
| 35 | 40 | unsigned long int __msg_ctime_high; |
| 36 | # else | |
| 41 | # else | |
| 37 | 42 | unsigned long int __msg_stime_high; |
| 38 | 43 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 39 | 44 | unsigned long int __msg_rtime_high; |
| 40 | 45 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 41 | 46 | unsigned long int __msg_ctime_high; |
| 42 | 47 | __time_t msg_ctime;		/* time of last change */ |
| 43 | # endif | |
| 44 | #else | |
| 48 | # endif | |
| 49 | # else | |
| 45 | 50 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 46 | 51 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 47 | 52 | __time_t msg_ctime;		/* time of last change */ |
| 48 | #endif | |
| 53 | # endif | |
| 49 | 54 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ |
| 50 | 55 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ |
| 51 | 56 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ |
| ... | ... | @@ -53,4 +58,5 @@ struct msqid_ds |
| 53 | 58 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ |
| 54 | 59 | __syscall_ulong_t __glibc_reserved4; |
| 55 | 60 | __syscall_ulong_t __glibc_reserved5; |
| 61 | #endif | |
| 56 | 62 | }; |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_semid_ds.h+4| ... | ... | @@ -23,10 +23,14 @@ |
| 23 | 23 | /* Data structure describing a set of semaphores. */ |
| 24 | 24 | struct semid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm sem_perm;		/* operation permission struct */ |
| 27 | 30 | __time_t sem_otime;	/* last semop() time */ |
| 28 | 31 | __time_t sem_ctime;	/* last time changed by semctl() */ |
| 29 | 32 | __syscall_ulong_t sem_nsems;		/* number of semaphores in set */ |
| 30 | 33 | __syscall_ulong_t __sem_otime_high; |
| 31 | 34 | __syscall_ulong_t __sem_ctime_high; |
| 35 | #endif | |
| 32 | 36 | }; |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_shmid_ds.h+9-5| ... | ... | @@ -23,27 +23,31 @@ |
| 23 | 23 | /* Data structure describing a shared memory segment. */ |
| 24 | 24 | struct shmid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm shm_perm;		/* operation permission struct */ |
| 27 | 30 | size_t shm_segsz;			/* size of segment in bytes */ |
| 28 | #if __TIMESIZE == 32 | |
| 31 | # if __TIMESIZE == 32 | |
| 29 | 32 | __time_t shm_atime;			/* time of last shmat() */ |
| 30 | 33 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 31 | 34 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 32 | #else | |
| 35 | # else | |
| 33 | 36 | __time_t shm_atime;			/* time of last shmat() */ |
| 34 | 37 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 35 | 38 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 36 | #endif | |
| 39 | # endif | |
| 37 | 40 | __pid_t shm_cpid;			/* pid of creator */ |
| 38 | 41 | __pid_t shm_lpid;			/* pid of last shmop */ |
| 39 | 42 | shmatt_t shm_nattch;		/* number of current attaches */ |
| 40 | #if __TIMESIZE == 32 | |
| 43 | # if __TIMESIZE == 32 | |
| 41 | 44 | unsigned short int __shm_atime_high; |
| 42 | 45 | unsigned short int __shm_dtime_high; |
| 43 | 46 | unsigned short int __shm_ctime_high; |
| 44 | 47 | unsigned short int __glibc_reserved4; |
| 45 | #else | |
| 48 | # else | |
| 46 | 49 | __syscall_ulong_t __glibc_reserved5; |
| 47 | 50 | __syscall_ulong_t __glibc_reserved6; |
| 51 | # endif | |
| 48 | 52 | #endif |
| 49 | 53 | }; |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabi64/bits/wordsize.h deleted-31| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #include <sgidefs.h> | |
| 19 | ||
| 20 | #define __WORDSIZE			_MIPS_SZPTR | |
| 21 | ||
| 22 | #if _MIPS_SIM == _ABI64 | |
| 23 | # define __WORDSIZE_TIME64_COMPAT32	1 | |
| 24 | #else | |
| 25 | # define __WORDSIZE_TIME64_COMPAT32	0 | |
| 26 | #endif | |
| 27 | ||
| 28 | #if __WORDSIZE == 32 | |
| 29 | #define __WORDSIZE32_SIZE_ULONG		0 | |
| 30 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| 31 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabin32/bits/floatn.h deleted-97| ... | ... | @@ -1,97 +0,0 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features on MIPS platforms. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_FLOATN_H | |
| 20 | #define _BITS_FLOATN_H | |
| 21 | ||
| 22 | #include <features.h> | |
| 23 | #include <bits/long-double.h> | |
| 24 | ||
| 25 | /* Defined to 1 if the current compiler invocation provides a | |
| 26 | floating-point type with the IEEE 754 binary128 format, and this | |
| 27 | glibc includes corresponding *f128 interfaces for it. */ | |
| 28 | #ifndef __NO_LONG_DOUBLE_MATH | |
| 29 | # define __HAVE_FLOAT128 1 | |
| 30 | #else | |
| 31 | /* glibc does not support _Float128 for platforms where long double is | |
| 32 | normally binary128 when building with long double as binary64. | |
| 33 | GCC's default for supported scalar modes does not support it either | |
| 34 | in that case. */ | |
| 35 | # define __HAVE_FLOAT128 0 | |
| 36 | #endif | |
| 37 | ||
| 38 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 39 | from the default float, double and long double types in this glibc. */ | |
| 40 | #define __HAVE_DISTINCT_FLOAT128 0 | |
| 41 | ||
| 42 | /* Defined to 1 if the current compiler invocation provides a | |
| 43 | floating-point type with the right format for _Float64x, and this | |
| 44 | glibc includes corresponding *f64x interfaces for it. */ | |
| 45 | #define __HAVE_FLOAT64X __HAVE_FLOAT128 | |
| 46 | ||
| 47 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 48 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 49 | the format of _Float128, which must be different from that of long | |
| 50 | double. */ | |
| 51 | #define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128 | |
| 52 | ||
| 53 | #ifndef __ASSEMBLER__ | |
| 54 | ||
| 55 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 56 | types, if __HAVE_FLOAT128 is 1. */ | |
| 57 | # if __HAVE_FLOAT128 | |
| 58 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 59 | /* The literal suffix f128 exists only since GCC 7.0. */ | |
| 60 | # define __f128(x) x##l | |
| 61 | # else | |
| 62 | # define __f128(x) x##f128 | |
| 63 | # endif | |
| 64 | # endif | |
| 65 | ||
| 66 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ | |
| 67 | # if __HAVE_FLOAT128 | |
| 68 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 69 | # define __CFLOAT128 _Complex long double | |
| 70 | # else | |
| 71 | # define __CFLOAT128 _Complex _Float128 | |
| 72 | # endif | |
| 73 | # endif | |
| 74 | ||
| 75 | /* The remaining of this file provides support for older compilers. */ | |
| 76 | # if __HAVE_FLOAT128 | |
| 77 | ||
| 78 | /* The type _Float128 exists only since GCC 7.0. */ | |
| 79 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 80 | typedef long double _Float128; | |
| 81 | # endif | |
| 82 | ||
| 83 | /* Various built-in functions do not exist before GCC 7.0. */ | |
| 84 | # if !__GNUC_PREREQ (7, 0) | |
| 85 | # define __builtin_huge_valf128() (__builtin_huge_vall ()) | |
| 86 | # define __builtin_inff128() (__builtin_infl ()) | |
| 87 | # define __builtin_nanf128(x) (__builtin_nanl (x)) | |
| 88 | # define __builtin_nansf128(x) (__builtin_nansl (x)) | |
| 89 | # endif | |
| 90 | ||
| 91 | # endif | |
| 92 | ||
| 93 | #endif /* !__ASSEMBLER__. */ | |
| 94 | ||
| 95 | #include <bits/floatn-common.h> | |
| 96 | ||
| 97 | #endif /* _BITS_FLOATN_H */ | |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabin32/bits/local_lim.h deleted-99| ... | ... | @@ -1,99 +0,0 @@ |
| 1 | /* Minimum guaranteed maximum values for system limits. MIPS Linux version. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* The kernel header pollutes the namespace with the NR_OPEN symbol | |
| 20 | and defines LINK_MAX although filesystems have different maxima. A | |
| 21 | similar thing is true for OPEN_MAX: the limit can be changed at | |
| 22 | runtime and therefore the macro must not be defined. Remove this | |
| 23 | after including the header if necessary. */ | |
| 24 | #ifndef NR_OPEN | |
| 25 | # define __undef_NR_OPEN | |
| 26 | #endif | |
| 27 | #ifndef LINK_MAX | |
| 28 | # define __undef_LINK_MAX | |
| 29 | #endif | |
| 30 | #ifndef OPEN_MAX | |
| 31 | # define __undef_OPEN_MAX | |
| 32 | #endif | |
| 33 | #ifndef ARG_MAX | |
| 34 | # define __undef_ARG_MAX | |
| 35 | #endif | |
| 36 | ||
| 37 | /* The kernel sources contain a file with all the needed information. */ | |
| 38 | #include <linux/limits.h> | |
| 39 | ||
| 40 | /* Have to remove NR_OPEN? */ | |
| 41 | #ifdef __undef_NR_OPEN | |
| 42 | # undef NR_OPEN | |
| 43 | # undef __undef_NR_OPEN | |
| 44 | #endif | |
| 45 | /* Have to remove LINK_MAX? */ | |
| 46 | #ifdef __undef_LINK_MAX | |
| 47 | # undef LINK_MAX | |
| 48 | # undef __undef_LINK_MAX | |
| 49 | #endif | |
| 50 | /* Have to remove OPEN_MAX? */ | |
| 51 | #ifdef __undef_OPEN_MAX | |
| 52 | # undef OPEN_MAX | |
| 53 | # undef __undef_OPEN_MAX | |
| 54 | #endif | |
| 55 | /* Have to remove ARG_MAX? */ | |
| 56 | #ifdef __undef_ARG_MAX | |
| 57 | # undef ARG_MAX | |
| 58 | # undef __undef_ARG_MAX | |
| 59 | #endif | |
| 60 | ||
| 61 | /* The number of data keys per process. */ | |
| 62 | #define _POSIX_THREAD_KEYS_MAX	128 | |
| 63 | /* This is the value this implementation supports. */ | |
| 64 | #define PTHREAD_KEYS_MAX	1024 | |
| 65 | ||
| 66 | /* Controlling the iterations of destructors for thread-specific data. */ | |
| 67 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4 | |
| 68 | /* Number of iterations this implementation does. */ | |
| 69 | #define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS | |
| 70 | ||
| 71 | /* The number of threads per process. */ | |
| 72 | #define _POSIX_THREAD_THREADS_MAX	64 | |
| 73 | /* We have no predefined limit on the number of threads. */ | |
| 74 | #undef PTHREAD_THREADS_MAX | |
| 75 | ||
| 76 | /* Maximum amount by which a process can descrease its asynchronous I/O | |
| 77 | priority level. */ | |
| 78 | #define AIO_PRIO_DELTA_MAX	20 | |
| 79 | ||
| 80 | /* Minimum size for a thread. At least two pages with 64k pages. */ | |
| 81 | #define PTHREAD_STACK_MIN	131072 | |
| 82 | ||
| 83 | /* Maximum number of timer expiration overruns. */ | |
| 84 | #define DELAYTIMER_MAX	2147483647 | |
| 85 | ||
| 86 | /* Maximum tty name length. */ | |
| 87 | #define TTY_NAME_MAX		32 | |
| 88 | ||
| 89 | /* Maximum login name length. This is arbitrary. */ | |
| 90 | #define LOGIN_NAME_MAX		256 | |
| 91 | ||
| 92 | /* Maximum host name length. */ | |
| 93 | #define HOST_NAME_MAX		64 | |
| 94 | ||
| 95 | /* Maximum message queue priority level. */ | |
| 96 | #define MQ_PRIO_MAX		32768 | |
| 97 | ||
| 98 | /* Maximum value the semaphore can have. */ | |
| 99 | #define SEM_VALUE_MAX (2147483647) | |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabin32/bits/pthread_stack_min.h created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. MIPS Linux version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. At least two pages with 64k pages. */ | |
| 20 | #define PTHREAD_STACK_MIN	131072 | |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabin32/bits/socket-constants.h+35-3| ... | ... | @@ -30,9 +30,41 @@ |
| 30 | 30 | #define SO_OOBINLINE 256 |
| 31 | 31 | #define SO_RCVBUF 4098 |
| 32 | 32 | #define SO_RCVLOWAT 4100 |
| 33 | #define SO_RCVTIMEO 4102 | |
| 34 | 33 | #define SO_REUSEADDR 4 |
| 35 | 34 | #define SO_SNDBUF 4097 |
| 36 | 35 | #define SO_SNDLOWAT 4099 |
| 37 | #define SO_SNDTIMEO 4101 | |
| 38 | #define SO_TYPE 4104 | |
| \ No newline at end of file | ||
| 36 | #define SO_TYPE 4104 | |
| 37 | ||
| 38 | #if __TIMESIZE == 64 | |
| 39 | # define SO_RCVTIMEO 4102 | |
| 40 | # define SO_SNDTIMEO 4101 | |
| 41 | # define SO_TIMESTAMP 29 | |
| 42 | # define SO_TIMESTAMPNS 35 | |
| 43 | # define SO_TIMESTAMPING 37 | |
| 44 | #else | |
| 45 | # define SO_RCVTIMEO_OLD 4102 | |
| 46 | # define SO_SNDTIMEO_OLD 4101 | |
| 47 | # define SO_RCVTIMEO_NEW 66 | |
| 48 | # define SO_SNDTIMEO_NEW 67 | |
| 49 | ||
| 50 | # define SO_TIMESTAMP_OLD 29 | |
| 51 | # define SO_TIMESTAMPNS_OLD 35 | |
| 52 | # define SO_TIMESTAMPING_OLD 37 | |
| 53 | # define SO_TIMESTAMP_NEW 63 | |
| 54 | # define SO_TIMESTAMPNS_NEW 64 | |
| 55 | # define SO_TIMESTAMPING_NEW 65 | |
| 56 | ||
| 57 | # ifdef __USE_TIME_BITS64 | |
| 58 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 59 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 60 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 61 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 62 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 63 | # else | |
| 64 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 65 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 66 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 67 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 68 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 69 | # endif | |
| 70 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabin32/bits/struct_rwlock.h deleted-71| ... | ... | @@ -1,71 +0,0 @@ |
| 1 | /* MIPS internal rwlock struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _RWLOCK_INTERNAL_H | |
| 20 | #define _RWLOCK_INTERNAL_H | |
| 21 | ||
| 22 | struct __pthread_rwlock_arch_t | |
| 23 | { | |
| 24 | unsigned int __readers; | |
| 25 | unsigned int __writers; | |
| 26 | unsigned int __wrphase_futex; | |
| 27 | unsigned int __writers_futex; | |
| 28 | unsigned int __pad3; | |
| 29 | unsigned int __pad4; | |
| 30 | #if _MIPS_SIM == _ABI64 | |
| 31 | int __cur_writer; | |
| 32 | int __shared; | |
| 33 | unsigned long int __pad1; | |
| 34 | unsigned long int __pad2; | |
| 35 | /* FLAGS must stay at this position in the structure to maintain | |
| 36 | binary compatibility. */ | |
| 37 | unsigned int __flags; | |
| 38 | # else | |
| 39 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 40 | unsigned char __pad1; | |
| 41 | unsigned char __pad2; | |
| 42 | unsigned char __shared; | |
| 43 | /* FLAGS must stay at this position in the structure to maintain | |
| 44 | binary compatibility. */ | |
| 45 | unsigned char __flags; | |
| 46 | # else | |
| 47 | /* FLAGS must stay at this position in the structure to maintain | |
| 48 | binary compatibility. */ | |
| 49 | unsigned char __flags; | |
| 50 | unsigned char __shared; | |
| 51 | unsigned char __pad1; | |
| 52 | unsigned char __pad2; | |
| 53 | # endif | |
| 54 | int __cur_writer; | |
| 55 | #endif | |
| 56 | }; | |
| 57 | ||
| 58 | #if _MIPS_SIM == _ABI64 | |
| 59 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 60 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags | |
| 61 | #else | |
| 62 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 63 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 64 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 65 | # else | |
| 66 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 67 | 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 | |
| 68 | # endif | |
| 69 | #endif | |
| 70 | ||
| 71 | #endif | |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_msqid_ds.h+12-6| ... | ... | @@ -20,32 +20,37 @@ |
| 20 | 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." |
| 21 | 21 | #endif |
| 22 | 22 | |
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 23 | 25 | /* Structure of record for one message inside the kernel. |
| 24 | 26 | The type `struct msg' is opaque. */ |
| 25 | 27 | struct msqid_ds |
| 26 | 28 | { |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 27 | 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ |
| 28 | #if __TIMESIZE == 32 | |
| 29 | # ifdef __MIPSEL__ | |
| 33 | # if __TIMESIZE == 32 | |
| 34 | # ifdef __MIPSEL__ | |
| 30 | 35 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 31 | 36 | unsigned long int __msg_stime_high; |
| 32 | 37 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 33 | 38 | unsigned long int __msg_rtime_high; |
| 34 | 39 | __time_t msg_ctime;		/* time of last change */ |
| 35 | 40 | unsigned long int __msg_ctime_high; |
| 36 | # else | |
| 41 | # else | |
| 37 | 42 | unsigned long int __msg_stime_high; |
| 38 | 43 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 39 | 44 | unsigned long int __msg_rtime_high; |
| 40 | 45 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 41 | 46 | unsigned long int __msg_ctime_high; |
| 42 | 47 | __time_t msg_ctime;		/* time of last change */ |
| 43 | # endif | |
| 44 | #else | |
| 48 | # endif | |
| 49 | # else | |
| 45 | 50 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 46 | 51 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 47 | 52 | __time_t msg_ctime;		/* time of last change */ |
| 48 | #endif | |
| 53 | # endif | |
| 49 | 54 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ |
| 50 | 55 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ |
| 51 | 56 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ |
| ... | ... | @@ -53,4 +58,5 @@ struct msqid_ds |
| 53 | 58 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ |
| 54 | 59 | __syscall_ulong_t __glibc_reserved4; |
| 55 | 60 | __syscall_ulong_t __glibc_reserved5; |
| 61 | #endif | |
| 56 | 62 | }; |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_semid_ds.h+4| ... | ... | @@ -23,10 +23,14 @@ |
| 23 | 23 | /* Data structure describing a set of semaphores. */ |
| 24 | 24 | struct semid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm sem_perm;		/* operation permission struct */ |
| 27 | 30 | __time_t sem_otime;	/* last semop() time */ |
| 28 | 31 | __time_t sem_ctime;	/* last time changed by semctl() */ |
| 29 | 32 | __syscall_ulong_t sem_nsems;		/* number of semaphores in set */ |
| 30 | 33 | __syscall_ulong_t __sem_otime_high; |
| 31 | 34 | __syscall_ulong_t __sem_ctime_high; |
| 35 | #endif | |
| 32 | 36 | }; |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_shmid_ds.h+9-5| ... | ... | @@ -23,27 +23,31 @@ |
| 23 | 23 | /* Data structure describing a shared memory segment. */ |
| 24 | 24 | struct shmid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm shm_perm;		/* operation permission struct */ |
| 27 | 30 | size_t shm_segsz;			/* size of segment in bytes */ |
| 28 | #if __TIMESIZE == 32 | |
| 31 | # if __TIMESIZE == 32 | |
| 29 | 32 | __time_t shm_atime;			/* time of last shmat() */ |
| 30 | 33 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 31 | 34 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 32 | #else | |
| 35 | # else | |
| 33 | 36 | __time_t shm_atime;			/* time of last shmat() */ |
| 34 | 37 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 35 | 38 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 36 | #endif | |
| 39 | # endif | |
| 37 | 40 | __pid_t shm_cpid;			/* pid of creator */ |
| 38 | 41 | __pid_t shm_lpid;			/* pid of last shmop */ |
| 39 | 42 | shmatt_t shm_nattch;		/* number of current attaches */ |
| 40 | #if __TIMESIZE == 32 | |
| 43 | # if __TIMESIZE == 32 | |
| 41 | 44 | unsigned short int __shm_atime_high; |
| 42 | 45 | unsigned short int __shm_dtime_high; |
| 43 | 46 | unsigned short int __shm_ctime_high; |
| 44 | 47 | unsigned short int __glibc_reserved4; |
| 45 | #else | |
| 48 | # else | |
| 46 | 49 | __syscall_ulong_t __glibc_reserved5; |
| 47 | 50 | __syscall_ulong_t __glibc_reserved6; |
| 51 | # endif | |
| 48 | 52 | #endif |
| 49 | 53 | }; |
| \ No newline at end of file |
lib/libc/include/mips64el-linux-gnuabin32/bits/wordsize.h deleted-31| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #include <sgidefs.h> | |
| 19 | ||
| 20 | #define __WORDSIZE			_MIPS_SZPTR | |
| 21 | ||
| 22 | #if _MIPS_SIM == _ABI64 | |
| 23 | # define __WORDSIZE_TIME64_COMPAT32	1 | |
| 24 | #else | |
| 25 | # define __WORDSIZE_TIME64_COMPAT32	0 | |
| 26 | #endif | |
| 27 | ||
| 28 | #if __WORDSIZE == 32 | |
| 29 | #define __WORDSIZE32_SIZE_ULONG		0 | |
| 30 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| 31 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/dlfcn.h deleted-64| ... | ... | @@ -1,64 +0,0 @@ |
| 1 | /* System dependent definitions for run-time dynamic loading. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _DLFCN_H | |
| 20 | # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The MODE argument to `dlopen' contains one of the following: */ | |
| 24 | #define RTLD_LAZY	0x0001	/* Lazy function call binding. */ | |
| 25 | #define RTLD_NOW	0x0002	/* Immediate function call binding. */ | |
| 26 | #define RTLD_BINDING_MASK 0x3	/* Mask of binding time value. */ | |
| 27 | #define RTLD_NOLOAD	0x00008	/* Do not load the object. */ | |
| 28 | #define RTLD_DEEPBIND	0x00010	/* Use deep binding. */ | |
| 29 | ||
| 30 | /* If the following bit is set in the MODE argument to `dlopen', | |
| 31 | the symbols of the loaded object and its dependencies are made | |
| 32 | visible as if the object were linked directly into the program. */ | |
| 33 | #define RTLD_GLOBAL	0x0004 | |
| 34 | ||
| 35 | /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. | |
| 36 | The implementation does this by default and so we can define the | |
| 37 | value to zero. */ | |
| 38 | #define RTLD_LOCAL 0 | |
| 39 | ||
| 40 | /* Do not delete object when closed. */ | |
| 41 | #define RTLD_NODELETE	0x01000 | |
| 42 | ||
| 43 | #ifdef __USE_GNU | |
| 44 | /* To support profiling of shared objects it is a good idea to call | |
| 45 | the function found using `dlsym' using the following macro since | |
| 46 | these calls do not use the PLT. But this would mean the dynamic | |
| 47 | loader has no chance to find out when the function is called. The | |
| 48 | macro applies the necessary magic so that profiling is possible. | |
| 49 | Rewrite | |
| 50 | 	foo = (*fctp) (arg1, arg2); | |
| 51 | into | |
| 52 | foo = DL_CALL_FCT (fctp, (arg1, arg2)); | |
| 53 | */ | |
| 54 | # define DL_CALL_FCT(fctp, args) \ | |
| 55 | (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args) | |
| 56 | ||
| 57 | __BEGIN_DECLS | |
| 58 | ||
| 59 | /* This function calls the profiling functions. */ | |
| 60 | extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW; | |
| 61 | ||
| 62 | __END_DECLS | |
| 63 | ||
| 64 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/errno.h deleted-52| ... | ... | @@ -1,52 +0,0 @@ |
| 1 | /* Error constants. MIPS/Linux specific version. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_ERRNO_H | |
| 20 | ||
| 21 | #if !defined _ERRNO_H | |
| 22 | # error "Never include <bits/errno.h> directly; use <errno.h> instead." | |
| 23 | #endif | |
| 24 | ||
| 25 | # include <linux/errno.h> | |
| 26 | ||
| 27 | /* Older Linux headers do not define these constants. */ | |
| 28 | # ifndef ENOTSUP | |
| 29 | # define ENOTSUP		EOPNOTSUPP | |
| 30 | # endif | |
| 31 | ||
| 32 | # ifndef ECANCELED | |
| 33 | # define ECANCELED		158 | |
| 34 | # endif | |
| 35 | ||
| 36 | # ifndef EOWNERDEAD | |
| 37 | # define EOWNERDEAD		165 | |
| 38 | # endif | |
| 39 | ||
| 40 | # ifndef ENOTRECOVERABLE | |
| 41 | # define ENOTRECOVERABLE	166 | |
| 42 | # endif | |
| 43 | ||
| 44 | # ifndef ERFKILL | |
| 45 | # define ERFKILL		167 | |
| 46 | # endif | |
| 47 | ||
| 48 | # ifndef EHWPOISON | |
| 49 | # define EHWPOISON		168 | |
| 50 | # endif | |
| 51 | ||
| 52 | #endif /* bits/errno.h. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/eventfd.h deleted-31| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | /* Copyright (C) 2007-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_EVENTFD_H | |
| 19 | # error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for eventfd. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | EFD_SEMAPHORE = 00000001, | |
| 26 | #define EFD_SEMAPHORE EFD_SEMAPHORE | |
| 27 | EFD_CLOEXEC = 02000000, | |
| 28 | #define EFD_CLOEXEC EFD_CLOEXEC | |
| 29 | EFD_NONBLOCK = 00000200 | |
| 30 | #define EFD_NONBLOCK EFD_NONBLOCK | |
| 31 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/floatn.h deleted-97| ... | ... | @@ -1,97 +0,0 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features on MIPS platforms. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_FLOATN_H | |
| 20 | #define _BITS_FLOATN_H | |
| 21 | ||
| 22 | #include <features.h> | |
| 23 | #include <bits/long-double.h> | |
| 24 | ||
| 25 | /* Defined to 1 if the current compiler invocation provides a | |
| 26 | floating-point type with the IEEE 754 binary128 format, and this | |
| 27 | glibc includes corresponding *f128 interfaces for it. */ | |
| 28 | #ifndef __NO_LONG_DOUBLE_MATH | |
| 29 | # define __HAVE_FLOAT128 1 | |
| 30 | #else | |
| 31 | /* glibc does not support _Float128 for platforms where long double is | |
| 32 | normally binary128 when building with long double as binary64. | |
| 33 | GCC's default for supported scalar modes does not support it either | |
| 34 | in that case. */ | |
| 35 | # define __HAVE_FLOAT128 0 | |
| 36 | #endif | |
| 37 | ||
| 38 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 39 | from the default float, double and long double types in this glibc. */ | |
| 40 | #define __HAVE_DISTINCT_FLOAT128 0 | |
| 41 | ||
| 42 | /* Defined to 1 if the current compiler invocation provides a | |
| 43 | floating-point type with the right format for _Float64x, and this | |
| 44 | glibc includes corresponding *f64x interfaces for it. */ | |
| 45 | #define __HAVE_FLOAT64X __HAVE_FLOAT128 | |
| 46 | ||
| 47 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 48 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 49 | the format of _Float128, which must be different from that of long | |
| 50 | double. */ | |
| 51 | #define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128 | |
| 52 | ||
| 53 | #ifndef __ASSEMBLER__ | |
| 54 | ||
| 55 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 56 | types, if __HAVE_FLOAT128 is 1. */ | |
| 57 | # if __HAVE_FLOAT128 | |
| 58 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 59 | /* The literal suffix f128 exists only since GCC 7.0. */ | |
| 60 | # define __f128(x) x##l | |
| 61 | # else | |
| 62 | # define __f128(x) x##f128 | |
| 63 | # endif | |
| 64 | # endif | |
| 65 | ||
| 66 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ | |
| 67 | # if __HAVE_FLOAT128 | |
| 68 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 69 | # define __CFLOAT128 _Complex long double | |
| 70 | # else | |
| 71 | # define __CFLOAT128 _Complex _Float128 | |
| 72 | # endif | |
| 73 | # endif | |
| 74 | ||
| 75 | /* The remaining of this file provides support for older compilers. */ | |
| 76 | # if __HAVE_FLOAT128 | |
| 77 | ||
| 78 | /* The type _Float128 exists only since GCC 7.0. */ | |
| 79 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 80 | typedef long double _Float128; | |
| 81 | # endif | |
| 82 | ||
| 83 | /* Various built-in functions do not exist before GCC 7.0. */ | |
| 84 | # if !__GNUC_PREREQ (7, 0) | |
| 85 | # define __builtin_huge_valf128() (__builtin_huge_vall ()) | |
| 86 | # define __builtin_inff128() (__builtin_infl ()) | |
| 87 | # define __builtin_nanf128(x) (__builtin_nanl (x)) | |
| 88 | # define __builtin_nansf128(x) (__builtin_nansl (x)) | |
| 89 | # endif | |
| 90 | ||
| 91 | # endif | |
| 92 | ||
| 93 | #endif /* !__ASSEMBLER__. */ | |
| 94 | ||
| 95 | #include <bits/floatn-common.h> | |
| 96 | ||
| 97 | #endif /* _BITS_FLOATN_H */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/inotify.h deleted-29| ... | ... | @@ -1,29 +0,0 @@ |
| 1 | /* Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_INOTIFY_H | |
| 19 | # error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for the parameter of inotify_init1. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | IN_CLOEXEC = 02000000, | |
| 26 | #define IN_CLOEXEC IN_CLOEXEC | |
| 27 | IN_NONBLOCK = 00000200 | |
| 28 | #define IN_NONBLOCK IN_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/ioctl-types.h deleted-75| ... | ... | @@ -1,75 +0,0 @@ |
| 1 | /* Structure types for pre-termios terminal ioctls. Linux/MIPS version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_IOCTL_H | |
| 20 | # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Get definition of constants for use with `ioctl'. */ | |
| 24 | #include <asm/ioctls.h> | |
| 25 | ||
| 26 | struct winsize | |
| 27 | { | |
| 28 | unsigned short int ws_row; | |
| 29 | unsigned short int ws_col; | |
| 30 | unsigned short int ws_xpixel; | |
| 31 | unsigned short int ws_ypixel; | |
| 32 | }; | |
| 33 | ||
| 34 | #define NCC	8 | |
| 35 | struct termio | |
| 36 | { | |
| 37 | unsigned short int c_iflag;		/* input mode flags */ | |
| 38 | unsigned short int c_oflag;		/* output mode flags */ | |
| 39 | unsigned short int c_cflag;		/* control mode flags */ | |
| 40 | unsigned short int c_lflag;		/* local mode flags */ | |
| 41 | char c_line;			/* line discipline */ | |
| 42 | /* Yes, this is really NCCS. */ | |
| 43 | unsigned char c_cc[32 /* NCCS */]; /* control characters */ | |
| 44 | }; | |
| 45 | ||
| 46 | /* modem lines */ | |
| 47 | #define TIOCM_LE	0x001		/* line enable */ | |
| 48 | #define TIOCM_DTR	0x002		/* data terminal ready */ | |
| 49 | #define TIOCM_RTS	0x004		/* request to send */ | |
| 50 | #define TIOCM_ST	0x010		/* secondary transmit */ | |
| 51 | #define TIOCM_SR	0x020		/* secondary receive */ | |
| 52 | #define TIOCM_CTS	0x040		/* clear to send */ | |
| 53 | #define TIOCM_CAR	0x100		/* carrier detect */ | |
| 54 | #define TIOCM_CD	TIOCM_CAR | |
| 55 | #define TIOCM_RNG	0x200		/* ring */ | |
| 56 | #define TIOCM_RI	TIOCM_RNG | |
| 57 | #define TIOCM_DSR	0x400		/* data set ready */ | |
| 58 | ||
| 59 | /* line disciplines */ | |
| 60 | #define N_TTY		0 | |
| 61 | #define N_SLIP		1 | |
| 62 | #define N_MOUSE		2 | |
| 63 | #define N_PPP		3 | |
| 64 | #define N_STRIP		4 | |
| 65 | #define N_AX25		5 | |
| 66 | #define N_X25		6	/* X.25 async */ | |
| 67 | #define N_6PACK		7 | |
| 68 | #define N_MASC		8	/* Mobitex module */ | |
| 69 | #define N_R3964		9	/* Simatic R3964 module */ | |
| 70 | #define N_PROFIBUS_FDL	10	/* Profibus */ | |
| 71 | #define N_IRDA		11	/* Linux IR */ | |
| 72 | #define N_SMSBLOCK	12	/* SMS block mode */ | |
| 73 | #define N_HDLC		13	/* synchronous HDLC */ | |
| 74 | #define N_SYNC_PPP	14	/* synchronous PPP */ | |
| 75 | #define	N_HCI		15	/* Bluetooth HCI UART */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/ipctypes.h deleted-31| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | /* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. MIPS version | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* | |
| 20 | * Never include <bits/ipctypes.h> directly. | |
| 21 | */ | |
| 22 | ||
| 23 | #ifndef _BITS_IPCTYPES_H | |
| 24 | #define _BITS_IPCTYPES_H	1 | |
| 25 | ||
| 26 | #include <bits/types.h> | |
| 27 | ||
| 28 | typedef __SLONG32_TYPE __ipc_pid_t; | |
| 29 | ||
| 30 | ||
| 31 | #endif /* bits/ipctypes.h */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/local_lim.h deleted-99| ... | ... | @@ -1,99 +0,0 @@ |
| 1 | /* Minimum guaranteed maximum values for system limits. MIPS Linux version. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* The kernel header pollutes the namespace with the NR_OPEN symbol | |
| 20 | and defines LINK_MAX although filesystems have different maxima. A | |
| 21 | similar thing is true for OPEN_MAX: the limit can be changed at | |
| 22 | runtime and therefore the macro must not be defined. Remove this | |
| 23 | after including the header if necessary. */ | |
| 24 | #ifndef NR_OPEN | |
| 25 | # define __undef_NR_OPEN | |
| 26 | #endif | |
| 27 | #ifndef LINK_MAX | |
| 28 | # define __undef_LINK_MAX | |
| 29 | #endif | |
| 30 | #ifndef OPEN_MAX | |
| 31 | # define __undef_OPEN_MAX | |
| 32 | #endif | |
| 33 | #ifndef ARG_MAX | |
| 34 | # define __undef_ARG_MAX | |
| 35 | #endif | |
| 36 | ||
| 37 | /* The kernel sources contain a file with all the needed information. */ | |
| 38 | #include <linux/limits.h> | |
| 39 | ||
| 40 | /* Have to remove NR_OPEN? */ | |
| 41 | #ifdef __undef_NR_OPEN | |
| 42 | # undef NR_OPEN | |
| 43 | # undef __undef_NR_OPEN | |
| 44 | #endif | |
| 45 | /* Have to remove LINK_MAX? */ | |
| 46 | #ifdef __undef_LINK_MAX | |
| 47 | # undef LINK_MAX | |
| 48 | # undef __undef_LINK_MAX | |
| 49 | #endif | |
| 50 | /* Have to remove OPEN_MAX? */ | |
| 51 | #ifdef __undef_OPEN_MAX | |
| 52 | # undef OPEN_MAX | |
| 53 | # undef __undef_OPEN_MAX | |
| 54 | #endif | |
| 55 | /* Have to remove ARG_MAX? */ | |
| 56 | #ifdef __undef_ARG_MAX | |
| 57 | # undef ARG_MAX | |
| 58 | # undef __undef_ARG_MAX | |
| 59 | #endif | |
| 60 | ||
| 61 | /* The number of data keys per process. */ | |
| 62 | #define _POSIX_THREAD_KEYS_MAX	128 | |
| 63 | /* This is the value this implementation supports. */ | |
| 64 | #define PTHREAD_KEYS_MAX	1024 | |
| 65 | ||
| 66 | /* Controlling the iterations of destructors for thread-specific data. */ | |
| 67 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4 | |
| 68 | /* Number of iterations this implementation does. */ | |
| 69 | #define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS | |
| 70 | ||
| 71 | /* The number of threads per process. */ | |
| 72 | #define _POSIX_THREAD_THREADS_MAX	64 | |
| 73 | /* We have no predefined limit on the number of threads. */ | |
| 74 | #undef PTHREAD_THREADS_MAX | |
| 75 | ||
| 76 | /* Maximum amount by which a process can descrease its asynchronous I/O | |
| 77 | priority level. */ | |
| 78 | #define AIO_PRIO_DELTA_MAX	20 | |
| 79 | ||
| 80 | /* Minimum size for a thread. At least two pages with 64k pages. */ | |
| 81 | #define PTHREAD_STACK_MIN	131072 | |
| 82 | ||
| 83 | /* Maximum number of timer expiration overruns. */ | |
| 84 | #define DELAYTIMER_MAX	2147483647 | |
| 85 | ||
| 86 | /* Maximum tty name length. */ | |
| 87 | #define TTY_NAME_MAX		32 | |
| 88 | ||
| 89 | /* Maximum login name length. This is arbitrary. */ | |
| 90 | #define LOGIN_NAME_MAX		256 | |
| 91 | ||
| 92 | /* Maximum host name length. */ | |
| 93 | #define HOST_NAME_MAX		64 | |
| 94 | ||
| 95 | /* Maximum message queue priority level. */ | |
| 96 | #define MQ_PRIO_MAX		32768 | |
| 97 | ||
| 98 | /* Maximum value the semaphore can have. */ | |
| 99 | #define SEM_VALUE_MAX (2147483647) | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/mman.h deleted-48| ... | ... | @@ -1,48 +0,0 @@ |
| 1 | /* Definitions for POSIX memory map interface. Linux/MIPS version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MMAN_H | |
| 20 | # error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The following definitions basically come from the kernel headers. | |
| 24 | But the kernel header is not namespace clean. */ | |
| 25 | ||
| 26 | /* These are Linux-specific. */ | |
| 27 | #ifdef __USE_MISC | |
| 28 | # define MAP_NORESERVE	0x0400		/* don't check for reservations */ | |
| 29 | # define MAP_GROWSDOWN	0x1000		/* stack-like segment */ | |
| 30 | # define MAP_DENYWRITE	0x2000		/* ETXTBSY */ | |
| 31 | # define MAP_EXECUTABLE	0x4000		/* mark it as an executable */ | |
| 32 | # define MAP_LOCKED	0x8000		/* pages are locked */ | |
| 33 | # define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ | |
| 34 | # define MAP_NONBLOCK 0x20000 /* do not block on IO */ | |
| 35 | # define MAP_STACK	0x40000		/* Allocation is for a stack. */ | |
| 36 | # define MAP_HUGETLB	0x80000		/* Create huge page mapping. */ | |
| 37 | # define MAP_FIXED_NOREPLACE 0x100000	/* MAP_FIXED but do not unmap | |
| 38 | 					 underlying mapping. */ | |
| 39 | #endif | |
| 40 | ||
| 41 | #define __MAP_ANONYMOUS 0x0800 | |
| 42 | ||
| 43 | /* Include generic Linux declarations. */ | |
| 44 | #include <bits/mman-linux.h> | |
| 45 | ||
| 46 | #ifdef __USE_MISC | |
| 47 | # define MAP_RENAME	MAP_ANONYMOUS | |
| 48 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/poll.h deleted-49| ... | ... | @@ -1,49 +0,0 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_POLL_H | |
| 19 | # error "Never use <bits/poll.h> directly; include <sys/poll.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Event types that can be polled for. These bits may be set in `events' | |
| 23 | to indicate the interesting event types; they will appear in `revents' | |
| 24 | to indicate the status of the file descriptor. */ | |
| 25 | #define POLLIN		0x001		/* There is data to read. */ | |
| 26 | #define POLLPRI		0x002		/* There is urgent data to read. */ | |
| 27 | #define POLLOUT		0x004		/* Writing now will not block. */ | |
| 28 | ||
| 29 | #if defined __USE_XOPEN || defined __USE_XOPEN2K8 | |
| 30 | /* These values are defined in XPG4.2. */ | |
| 31 | # define POLLRDNORM	0x040		/* Normal data may be read. */ | |
| 32 | # define POLLRDBAND	0x080		/* Priority data may be read. */ | |
| 33 | # define POLLWRNORM	POLLOUT		/* Writing now will not block. */ | |
| 34 | # define POLLWRBAND	0x100		/* Priority data may be written. */ | |
| 35 | #endif | |
| 36 | ||
| 37 | #ifdef __USE_GNU | |
| 38 | /* These are extensions for Linux. */ | |
| 39 | # define POLLMSG	0x400 | |
| 40 | # define POLLREMOVE	0x1000 | |
| 41 | # define POLLRDHUP	0x2000 | |
| 42 | #endif | |
| 43 | ||
| 44 | /* Event types always implicitly polled for. These bits need not be set in | |
| 45 | `events', but they will appear in `revents' to indicate the status of | |
| 46 | the file descriptor. */ | |
| 47 | #define POLLERR		0x008		/* Error condition. */ | |
| 48 | #define POLLHUP		0x010		/* Hung up. */ | |
| 49 | #define POLLNVAL	0x020		/* Invalid polling request. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/pthreadtypes-arch.h deleted-44| ... | ... | @@ -1,44 +0,0 @@ |
| 1 | /* Machine-specific pthread type layouts. MIPS version. | |
| 2 | Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_PTHREADTYPES_ARCH_H | |
| 20 | #define _BITS_PTHREADTYPES_ARCH_H	1 | |
| 21 | ||
| 22 | #include <bits/endian.h> | |
| 23 | ||
| 24 | #if _MIPS_SIM == _ABI64 | |
| 25 | # define __SIZEOF_PTHREAD_ATTR_T 56 | |
| 26 | # define __SIZEOF_PTHREAD_MUTEX_T 40 | |
| 27 | # define __SIZEOF_PTHREAD_RWLOCK_T 56 | |
| 28 | # define __SIZEOF_PTHREAD_BARRIER_T 32 | |
| 29 | #else | |
| 30 | # define __SIZEOF_PTHREAD_ATTR_T 36 | |
| 31 | # define __SIZEOF_PTHREAD_MUTEX_T 24 | |
| 32 | # define __SIZEOF_PTHREAD_RWLOCK_T 32 | |
| 33 | # define __SIZEOF_PTHREAD_BARRIER_T 20 | |
| 34 | #endif | |
| 35 | #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 | |
| 36 | #define __SIZEOF_PTHREAD_COND_T 48 | |
| 37 | #define __SIZEOF_PTHREAD_CONDATTR_T 4 | |
| 38 | #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 | |
| 39 | #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 | |
| 40 | ||
| 41 | #define __LOCK_ALIGNMENT | |
| 42 | #define __ONCE_ALIGNMENT | |
| 43 | ||
| 44 | #endif	/* bits/pthreadtypes.h */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/resource.h deleted-231| ... | ... | @@ -1,231 +0,0 @@ |
| 1 | /* Bit values & structures for resource limits. Linux/MIPS version. | |
| 2 | Copyright (C) 1994-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_RESOURCE_H | |
| 20 | # error "Never use <bits/resource.h> directly; include <sys/resource.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/types.h> | |
| 24 | ||
| 25 | /* Transmute defines to enumerations. The macro re-definitions are | |
| 26 | necessary because some programs want to test for operating system | |
| 27 | features with #ifdef RUSAGE_SELF. In ISO C the reflexive | |
| 28 | definition is a no-op. */ | |
| 29 | ||
| 30 | /* Kinds of resource limit. */ | |
| 31 | enum __rlimit_resource | |
| 32 | { | |
| 33 | /* Per-process CPU limit, in seconds. */ | |
| 34 | RLIMIT_CPU = 0, | |
| 35 | #define RLIMIT_CPU RLIMIT_CPU | |
| 36 | ||
| 37 | /* Largest file that can be created, in bytes. */ | |
| 38 | RLIMIT_FSIZE = 1, | |
| 39 | #define	RLIMIT_FSIZE RLIMIT_FSIZE | |
| 40 | ||
| 41 | /* Maximum size of data segment, in bytes. */ | |
| 42 | RLIMIT_DATA = 2, | |
| 43 | #define	RLIMIT_DATA RLIMIT_DATA | |
| 44 | ||
| 45 | /* Maximum size of stack segment, in bytes. */ | |
| 46 | RLIMIT_STACK = 3, | |
| 47 | #define	RLIMIT_STACK RLIMIT_STACK | |
| 48 | ||
| 49 | /* Largest core file that can be created, in bytes. */ | |
| 50 | RLIMIT_CORE = 4, | |
| 51 | #define	RLIMIT_CORE RLIMIT_CORE | |
| 52 | ||
| 53 | /* Largest resident set size, in bytes. | |
| 54 | This affects swapping; processes that are exceeding their | |
| 55 | resident set size will be more likely to have physical memory | |
| 56 | taken from them. */ | |
| 57 | __RLIMIT_RSS = 7, | |
| 58 | #define	RLIMIT_RSS __RLIMIT_RSS | |
| 59 | ||
| 60 | /* Number of open files. */ | |
| 61 | RLIMIT_NOFILE = 5, | |
| 62 | __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ | |
| 63 | #define RLIMIT_NOFILE RLIMIT_NOFILE | |
| 64 | #define RLIMIT_OFILE __RLIMIT_OFILE | |
| 65 | ||
| 66 | /* Address space limit (?) */ | |
| 67 | RLIMIT_AS = 6, | |
| 68 | #define RLIMIT_AS RLIMIT_AS | |
| 69 | ||
| 70 | /* Number of processes. */ | |
| 71 | __RLIMIT_NPROC = 8, | |
| 72 | #define RLIMIT_NPROC __RLIMIT_NPROC | |
| 73 | ||
| 74 | /* Locked-in-memory address space. */ | |
| 75 | __RLIMIT_MEMLOCK = 9, | |
| 76 | #define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK | |
| 77 | ||
| 78 | /* Maximum number of file locks. */ | |
| 79 | __RLIMIT_LOCKS = 10, | |
| 80 | #define RLIMIT_LOCKS __RLIMIT_LOCKS | |
| 81 | ||
| 82 | /* Maximum number of pending signals. */ | |
| 83 | __RLIMIT_SIGPENDING = 11, | |
| 84 | #define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING | |
| 85 | ||
| 86 | /* Maximum bytes in POSIX message queues. */ | |
| 87 | __RLIMIT_MSGQUEUE = 12, | |
| 88 | #define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE | |
| 89 | ||
| 90 | /* Maximum nice priority allowed to raise to. | |
| 91 | Nice levels 19 .. -20 correspond to 0 .. 39 | |
| 92 | values of this resource limit. */ | |
| 93 | __RLIMIT_NICE = 13, | |
| 94 | #define RLIMIT_NICE __RLIMIT_NICE | |
| 95 | ||
| 96 | /* Maximum realtime priority allowed for non-priviledged | |
| 97 | processes. */ | |
| 98 | __RLIMIT_RTPRIO = 14, | |
| 99 | #define RLIMIT_RTPRIO __RLIMIT_RTPRIO | |
| 100 | ||
| 101 | /* Maximum CPU time in microseconds that a process scheduled under a real-time | |
| 102 | scheduling policy may consume without making a blocking system | |
| 103 | call before being forcibly descheduled. */ | |
| 104 | __RLIMIT_RTTIME = 15, | |
| 105 | #define RLIMIT_RTTIME __RLIMIT_RTTIME | |
| 106 | ||
| 107 | __RLIMIT_NLIMITS = 16, | |
| 108 | __RLIM_NLIMITS = __RLIMIT_NLIMITS | |
| 109 | #define RLIMIT_NLIMITS __RLIMIT_NLIMITS | |
| 110 | #define RLIM_NLIMITS __RLIM_NLIMITS | |
| 111 | }; | |
| 112 | ||
| 113 | /* Value to indicate that there is no limit. */ | |
| 114 | #if _MIPS_SIM == _ABI64 | |
| 115 | /* The N64 syscall uses this value. */ | |
| 116 | # define RLIM_INFINITY 0xffffffffffffffffUL | |
| 117 | # ifdef __USE_LARGEFILE64 | |
| 118 | # define RLIM64_INFINITY 0xffffffffffffffffUL | |
| 119 | # endif | |
| 120 | #else | |
| 121 | /* The O32 and N32 syscalls use 0x7fffffff. */ | |
| 122 | # ifndef __USE_FILE_OFFSET64 | |
| 123 | # define RLIM_INFINITY ((long int)(~0UL >> 1)) | |
| 124 | # else | |
| 125 | # define RLIM_INFINITY 0xffffffffffffffffULL | |
| 126 | # endif | |
| 127 | # ifdef __USE_LARGEFILE64 | |
| 128 | # define RLIM64_INFINITY 0xffffffffffffffffULL | |
| 129 | # endif | |
| 130 | #endif | |
| 131 | ||
| 132 | /* We can represent all limits. */ | |
| 133 | #define RLIM_SAVED_MAX	RLIM_INFINITY | |
| 134 | #define RLIM_SAVED_CUR	RLIM_INFINITY | |
| 135 | ||
| 136 | ||
| 137 | /* Type for resource quantity measurement. */ | |
| 138 | #ifndef __USE_FILE_OFFSET64 | |
| 139 | typedef __rlim_t rlim_t; | |
| 140 | #else | |
| 141 | typedef __rlim64_t rlim_t; | |
| 142 | #endif | |
| 143 | #ifdef __USE_LARGEFILE64 | |
| 144 | typedef __rlim64_t rlim64_t; | |
| 145 | #endif | |
| 146 | ||
| 147 | struct rlimit | |
| 148 | { | |
| 149 | /* The current (soft) limit. */ | |
| 150 | rlim_t rlim_cur; | |
| 151 | /* The hard limit. */ | |
| 152 | rlim_t rlim_max; | |
| 153 | }; | |
| 154 | ||
| 155 | #ifdef __USE_LARGEFILE64 | |
| 156 | struct rlimit64 | |
| 157 | { | |
| 158 | /* The current (soft) limit. */ | |
| 159 | rlim64_t rlim_cur; | |
| 160 | /* The hard limit. */ | |
| 161 | rlim64_t rlim_max; | |
| 162 | }; | |
| 163 | #endif | |
| 164 | ||
| 165 | /* Whose usage statistics do you want? */ | |
| 166 | enum __rusage_who | |
| 167 | { | |
| 168 | /* The calling process. */ | |
| 169 | RUSAGE_SELF = 0, | |
| 170 | #define RUSAGE_SELF RUSAGE_SELF | |
| 171 | ||
| 172 | /* All of its terminated child processes. */ | |
| 173 | RUSAGE_CHILDREN = -1 | |
| 174 | #define RUSAGE_CHILDREN RUSAGE_CHILDREN | |
| 175 | ||
| 176 | #ifdef __USE_GNU | |
| 177 | , | |
| 178 | /* The calling thread. */ | |
| 179 | RUSAGE_THREAD = 1 | |
| 180 | # define RUSAGE_THREAD RUSAGE_THREAD | |
| 181 | /* Name for the same functionality on Solaris. */ | |
| 182 | # define RUSAGE_LWP RUSAGE_THREAD | |
| 183 | #endif | |
| 184 | }; | |
| 185 | ||
| 186 | #include <bits/types/struct_timeval.h> | |
| 187 | #include <bits/types/struct_rusage.h> | |
| 188 | ||
| 189 | /* Priority limits. */ | |
| 190 | #define PRIO_MIN	-20	/* Minimum priority a process can have. */ | |
| 191 | #define PRIO_MAX	20	/* Maximum priority a process can have. */ | |
| 192 | ||
| 193 | /* The type of the WHICH argument to `getpriority' and `setpriority', | |
| 194 | indicating what flavor of entity the WHO argument specifies. */ | |
| 195 | enum __priority_which | |
| 196 | { | |
| 197 | PRIO_PROCESS = 0,		/* WHO is a process ID. */ | |
| 198 | #define PRIO_PROCESS PRIO_PROCESS | |
| 199 | PRIO_PGRP = 1,		/* WHO is a process group ID. */ | |
| 200 | #define PRIO_PGRP PRIO_PGRP | |
| 201 | PRIO_USER = 2			/* WHO is a user ID. */ | |
| 202 | #define PRIO_USER PRIO_USER | |
| 203 | }; | |
| 204 | ||
| 205 | ||
| 206 | __BEGIN_DECLS | |
| 207 | ||
| 208 | #ifdef __USE_GNU | |
| 209 | /* Modify and return resource limits of a process atomically. */ | |
| 210 | # ifndef __USE_FILE_OFFSET64 | |
| 211 | extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, | |
| 212 | 		 const struct rlimit *__new_limit, | |
| 213 | 		 struct rlimit *__old_limit) __THROW; | |
| 214 | # else | |
| 215 | # ifdef __REDIRECT_NTH | |
| 216 | extern int __REDIRECT_NTH (prlimit, (__pid_t __pid, | |
| 217 | 				 enum __rlimit_resource __resource, | |
| 218 | 				 const struct rlimit *__new_limit, | |
| 219 | 				 struct rlimit *__old_limit), prlimit64); | |
| 220 | # else | |
| 221 | # define prlimit prlimit64 | |
| 222 | # endif | |
| 223 | # endif | |
| 224 | # ifdef __USE_LARGEFILE64 | |
| 225 | extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource, | |
| 226 | 		 const struct rlimit64 *__new_limit, | |
| 227 | 		 struct rlimit64 *__old_limit) __THROW; | |
| 228 | # endif | |
| 229 | #endif | |
| 230 | ||
| 231 | __END_DECLS | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/semaphore.h deleted-36| ... | ... | @@ -1,36 +0,0 @@ |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SEMAPHORE_H | |
| 19 | # error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #if _MIPS_SIM == _ABI64 | |
| 23 | # define __SIZEOF_SEM_T	32 | |
| 24 | #else | |
| 25 | # define __SIZEOF_SEM_T	16 | |
| 26 | #endif | |
| 27 | ||
| 28 | /* Value returned if `sem_open' failed. */ | |
| 29 | #define SEM_FAILED ((sem_t *) 0) | |
| 30 | ||
| 31 | ||
| 32 | typedef union | |
| 33 | { | |
| 34 | char __size[__SIZEOF_SEM_T]; | |
| 35 | long int __align; | |
| 36 | } sem_t; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/shmlba.h deleted-24| ... | ... | @@ -1,24 +0,0 @@ |
| 1 | /* Define SHMLBA. MIPS version. | |
| 2 | Copyright (C) 2018-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never use <bits/shmlba.h> directly; include <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Segment low boundary address multiple. */ | |
| 24 | #define SHMLBA		0x40000 | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/sigaction.h deleted-94| ... | ... | @@ -1,94 +0,0 @@ |
| 1 | /* The proper definitions for Linux/MIPS's sigaction. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGACTION_H | |
| 20 | #define _BITS_SIGACTION_H 1 | |
| 21 | ||
| 22 | #ifndef _SIGNAL_H | |
| 23 | # error "Never include <bits/sigaction.h> directly; use <signal.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Structure describing the action to be taken when a signal arrives. */ | |
| 27 | struct sigaction | |
| 28 | { | |
| 29 | /* Special flags. */ | |
| 30 | int sa_flags; | |
| 31 | ||
| 32 | /* Signal handler. */ | |
| 33 | #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED | |
| 34 | union | |
| 35 | { | |
| 36 | 	/* Used if SA_SIGINFO is not set. */ | |
| 37 | 	__sighandler_t sa_handler; | |
| 38 | 	/* Used if SA_SIGINFO is set. */ | |
| 39 | 	void (*sa_sigaction) (int, siginfo_t *, void *); | |
| 40 | } | |
| 41 | __sigaction_handler; | |
| 42 | # define sa_handler __sigaction_handler.sa_handler | |
| 43 | # define sa_sigaction __sigaction_handler.sa_sigaction | |
| 44 | #else | |
| 45 | __sighandler_t sa_handler; | |
| 46 | #endif | |
| 47 | /* Additional set of signals to be blocked. */ | |
| 48 | __sigset_t sa_mask; | |
| 49 | ||
| 50 | /* The ABI says here are two unused ints following. */ | |
| 51 | /* Restore handler. */ | |
| 52 | void (*sa_restorer) (void); | |
| 53 | ||
| 54 | #if _MIPS_SZPTR < 64 | |
| 55 | int sa_resv[1]; | |
| 56 | #endif | |
| 57 | }; | |
| 58 | ||
| 59 | /* Bits in `sa_flags'. */ | |
| 60 | /* Please note that some Linux kernels versions use different values for these | |
| 61 | flags which is a bug in those kernel versions. */ | |
| 62 | #define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */ | |
| 63 | #define SA_NOCLDWAIT 0x00010000 /* Don't create zombie on child death. */ | |
| 64 | #define SA_SIGINFO 0x00000008 /* Invoke signal-catching function with | |
| 65 | 				 three arguments instead of one. */ | |
| 66 | #if defined __USE_XOPEN_EXTENDED || defined __USE_MISC | |
| 67 | # define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ | |
| 68 | #endif | |
| 69 | #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 | |
| 70 | # define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ | |
| 71 | # define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ | |
| 72 | # define SA_NODEFER 0x40000000 /* Don't automatically block the signal when | |
| 73 | 				 its handler is being executed. */ | |
| 74 | #endif | |
| 75 | #ifdef __USE_MISC | |
| 76 | # define SA_INTERRUPT 0x20000000 /* Historical no-op. */ | |
| 77 | ||
| 78 | /* Some aliases for the SA_ constants. */ | |
| 79 | # define SA_NOMASK SA_NODEFER | |
| 80 | # define SA_ONESHOT SA_RESETHAND | |
| 81 | # define SA_STACK SA_ONSTACK | |
| 82 | #endif | |
| 83 | ||
| 84 | /* Values for the HOW argument to `sigprocmask'. */ | |
| 85 | #define SIG_NOP	 0		/* 0 is unused to catch errors */ | |
| 86 | #define	SIG_BLOCK 1		/* Block signals. */ | |
| 87 | #define	SIG_UNBLOCK 2		/* Unblock signals. */ | |
| 88 | #define	SIG_SETMASK 3		/* Set the set of blocked signals. */ | |
| 89 | #ifdef __USE_MISC | |
| 90 | # define SIG_SETMASK32 256	/* Goodie from SGI for BSD compatibility: | |
| 91 | 				 set only the low 32 bit of the sigset. */ | |
| 92 | #endif | |
| 93 | ||
| 94 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/sigcontext.h deleted-82| ... | ... | @@ -1,82 +0,0 @@ |
| 1 | /* Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. | |
| 2 | ||
| 3 | The GNU C Library is free software; you can redistribute it and/or | |
| 4 | modify it under the terms of the GNU Lesser General Public | |
| 5 | License as published by the Free Software Foundation; either | |
| 6 | version 2.1 of the License, or (at your option) any later version. | |
| 7 | ||
| 8 | The GNU C Library is distributed in the hope that it will be useful, | |
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 11 | Lesser General Public License for more details. | |
| 12 | ||
| 13 | You should have received a copy of the GNU Lesser General Public | |
| 14 | License along with the GNU C Library. If not, see | |
| 15 | <https://www.gnu.org/licenses/>. */ | |
| 16 | ||
| 17 | #ifndef _BITS_SIGCONTEXT_H | |
| 18 | #define _BITS_SIGCONTEXT_H 1 | |
| 19 | ||
| 20 | #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H | |
| 21 | # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." | |
| 22 | #endif | |
| 23 | ||
| 24 | #include <sgidefs.h> | |
| 25 | ||
| 26 | #if _MIPS_SIM == _ABIO32 | |
| 27 | ||
| 28 | /* Certain unused fields were replaced with new ones in 2.6.12-rc4. | |
| 29 | The changes were as follows: | |
| 30 | ||
| 31 | sc_cause -> sc_hi1 | |
| 32 | sc_badvaddr -> sc_lo1 | |
| 33 | sc_sigset[0] -> sc_hi2 | |
| 34 | sc_sigset[1] -> sc_lo2 | |
| 35 | sc_sigset[2] -> sc_hi3 | |
| 36 | sc_sigset[3] -> sc_lo3 | |
| 37 | ||
| 38 | sc_regmask, sc_ownedfp and sc_fpc_eir are not used. */ | |
| 39 | struct sigcontext { | |
| 40 | unsigned int sc_regmask; | |
| 41 | unsigned int sc_status; | |
| 42 | __extension__ unsigned long long sc_pc; | |
| 43 | __extension__ unsigned long long sc_regs[32]; | |
| 44 | __extension__ unsigned long long sc_fpregs[32]; | |
| 45 | unsigned int sc_ownedfp; | |
| 46 | unsigned int sc_fpc_csr; | |
| 47 | unsigned int sc_fpc_eir; | |
| 48 | unsigned int sc_used_math; | |
| 49 | unsigned int sc_dsp; | |
| 50 | __extension__ unsigned long long sc_mdhi; | |
| 51 | __extension__ unsigned long long sc_mdlo; | |
| 52 | unsigned long sc_hi1; | |
| 53 | unsigned long sc_lo1; | |
| 54 | unsigned long sc_hi2; | |
| 55 | unsigned long sc_lo2; | |
| 56 | unsigned long sc_hi3; | |
| 57 | unsigned long sc_lo3; | |
| 58 | }; | |
| 59 | ||
| 60 | #else | |
| 61 | ||
| 62 | /* This structure changed in 2.6.12-rc4 when DSP support was added. */ | |
| 63 | struct sigcontext { | |
| 64 | __extension__ unsigned long long sc_regs[32]; | |
| 65 | __extension__ unsigned long long sc_fpregs[32]; | |
| 66 | __extension__ unsigned long long sc_mdhi; | |
| 67 | __extension__ unsigned long long sc_hi1; | |
| 68 | __extension__ unsigned long long sc_hi2; | |
| 69 | __extension__ unsigned long long sc_hi3; | |
| 70 | __extension__ unsigned long long sc_mdlo; | |
| 71 | __extension__ unsigned long long sc_lo1; | |
| 72 | __extension__ unsigned long long sc_lo2; | |
| 73 | __extension__ unsigned long long sc_lo3; | |
| 74 | __extension__ unsigned long long sc_pc; | |
| 75 | unsigned int sc_fpc_csr; | |
| 76 | unsigned int sc_used_math; | |
| 77 | unsigned int sc_dsp; | |
| 78 | unsigned int sc_reserved; | |
| 79 | }; | |
| 80 | ||
| 81 | #endif /* _MIPS_SIM != _ABIO32 */ | |
| 82 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/siginfo-arch.h deleted-13| ... | ... | @@ -1,13 +0,0 @@ |
| 1 | /* Architecture-specific adjustments to siginfo_t. MIPS version. */ | |
| 2 | #ifndef _BITS_SIGINFO_ARCH_H | |
| 3 | #define _BITS_SIGINFO_ARCH_H 1 | |
| 4 | ||
| 5 | /* MIPS has the si_code and si_errno fields in the opposite order from | |
| 6 | all other architectures. */ | |
| 7 | #define __SI_ERRNO_THEN_CODE 0 | |
| 8 | ||
| 9 | /* MIPS also has different values for SI_ASYNCIO, SI_MESGQ, and SI_TIMER | |
| 10 | than all other architectures. */ | |
| 11 | #define __SI_ASYNCIO_AFTER_SIGIO 0 | |
| 12 | ||
| 13 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/signalfd.h deleted-29| ... | ... | @@ -1,29 +0,0 @@ |
| 1 | /* Copyright (C) 2007-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_SIGNALFD_H | |
| 19 | # error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for signalfd. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | SFD_CLOEXEC = 02000000, | |
| 26 | #define SFD_CLOEXEC SFD_CLOEXEC | |
| 27 | SFD_NONBLOCK = 00000200 | |
| 28 | #define SFD_NONBLOCK SFD_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/signum-arch.h deleted-65| ... | ... | @@ -1,65 +0,0 @@ |
| 1 | /* Signal number definitions. Linux/MIPS version. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGNUM_H | |
| 20 | #define _BITS_SIGNUM_H 1 | |
| 21 | ||
| 22 | #ifndef _SIGNAL_H | |
| 23 | #error "Never include <bits/signum.h> directly; use <signal.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Adjustments and additions to the signal number constants for | |
| 27 | Linux/MIPS. */ | |
| 28 | ||
| 29 | #define SIGEMT		 7	/* Emulator trap. */ | |
| 30 | #define SIGPWR		19	/* Power failure imminent. */ | |
| 31 | ||
| 32 | /* Historical signals specified by POSIX. */ | |
| 33 | #define SIGBUS 	10	/* Bus error. */ | |
| 34 | #define SIGSYS		12	/* Bad system call. */ | |
| 35 | ||
| 36 | /* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ | |
| 37 | #define SIGURG		21	/* Urgent data is available at a socket. */ | |
| 38 | #define SIGSTOP		23	/* Stop, unblockable. */ | |
| 39 | #define SIGTSTP		24	/* Keyboard stop. */ | |
| 40 | #define SIGCONT		25	/* Continue. */ | |
| 41 | #define SIGCHLD		18	/* Child terminated or stopped. */ | |
| 42 | #define SIGTTIN		26	/* Background read from control terminal. */ | |
| 43 | #define SIGTTOU		27	/* Background write to control terminal. */ | |
| 44 | #define SIGPOLL		22	/* Pollable event occurred (System V). */ | |
| 45 | #define SIGXCPU		30	/* CPU time limit exceeded. */ | |
| 46 | #define SIGVTALRM	28	/* Virtual timer expired. */ | |
| 47 | #define SIGPROF		29	/* Profiling timer expired. */ | |
| 48 | #define SIGXFSZ		31	/* File size limit exceeded. */ | |
| 49 | #define SIGUSR1		16	/* User-defined signal 1. */ | |
| 50 | #define SIGUSR2		17	/* User-defined signal 2. */ | |
| 51 | ||
| 52 | /* Nonstandard signals found in all modern POSIX systems | |
| 53 | (including both BSD and Linux). */ | |
| 54 | #define SIGWINCH	20	/* Window size change (4.3 BSD, Sun). */ | |
| 55 | ||
| 56 | /* Archaic names for compatibility. */ | |
| 57 | #define SIGIO		SIGPOLL	/* I/O now possible (4.2 BSD). */ | |
| 58 | #define SIGIOT		SIGABRT	/* IOT instruction, abort() on a PDP-11. */ | |
| 59 | #define SIGCLD		SIGCHLD /* Old System V name */ | |
| 60 | ||
| 61 | /* By default no real-time signals are supported. */ | |
| 62 | #define __SIGRTMIN	32 | |
| 63 | #define __SIGRTMAX	127 | |
| 64 | ||
| 65 | #endif	/* <signal.h> included. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/socket-constants.h deleted-38| ... | ... | @@ -1,38 +0,0 @@ |
| 1 | /* Socket constants which vary among Linux architectures. Version for MIPS. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define SOL_SOCKET 65535 | |
| 24 | #define SO_ACCEPTCONN 4105 | |
| 25 | #define SO_BROADCAST 32 | |
| 26 | #define SO_DONTROUTE 16 | |
| 27 | #define SO_ERROR 4103 | |
| 28 | #define SO_KEEPALIVE 8 | |
| 29 | #define SO_LINGER 128 | |
| 30 | #define SO_OOBINLINE 256 | |
| 31 | #define SO_RCVBUF 4098 | |
| 32 | #define SO_RCVLOWAT 4100 | |
| 33 | #define SO_RCVTIMEO 4102 | |
| 34 | #define SO_REUSEADDR 4 | |
| 35 | #define SO_SNDBUF 4097 | |
| 36 | #define SO_SNDLOWAT 4099 | |
| 37 | #define SO_SNDTIMEO 4101 | |
| 38 | #define SO_TYPE 4104 | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/socket_type.h deleted-55| ... | ... | @@ -1,55 +0,0 @@ |
| 1 | /* Define enum __socket_type for Linux/MIPS. | |
| 2 | Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Types of sockets. */ | |
| 24 | enum __socket_type | |
| 25 | { | |
| 26 | SOCK_DGRAM = 1,		/* Connectionless, unreliable datagrams | |
| 27 | 				 of fixed maximum length. */ | |
| 28 | #define SOCK_DGRAM SOCK_DGRAM | |
| 29 | SOCK_STREAM = 2,		/* Sequenced, reliable, connection-based | |
| 30 | 				 byte streams. */ | |
| 31 | #define SOCK_STREAM SOCK_STREAM | |
| 32 | SOCK_RAW = 3,			/* Raw protocol interface. */ | |
| 33 | #define SOCK_RAW SOCK_RAW | |
| 34 | SOCK_RDM = 4,			/* Reliably-delivered messages. */ | |
| 35 | #define SOCK_RDM SOCK_RDM | |
| 36 | SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based, | |
| 37 | 				 datagrams of fixed maximum length. */ | |
| 38 | #define SOCK_SEQPACKET SOCK_SEQPACKET | |
| 39 | SOCK_DCCP = 6, | |
| 40 | #define SOCK_DCCP SOCK_DCCP	/* Datagram Congestion Control Protocol. */ | |
| 41 | SOCK_PACKET = 10,		/* Linux specific way of getting packets | |
| 42 | 				 at the dev level. For writing rarp and | |
| 43 | 				 other similar things on the user level. */ | |
| 44 | #define SOCK_PACKET SOCK_PACKET | |
| 45 | ||
| 46 | /* Flags to be ORed into the type parameter of socket and socketpair and | |
| 47 | used for the flags parameter of paccept. */ | |
| 48 | ||
| 49 | SOCK_CLOEXEC = 02000000,	/* Atomically set close-on-exec flag for the | |
| 50 | 				 new descriptor(s). */ | |
| 51 | #define SOCK_CLOEXEC SOCK_CLOEXEC | |
| 52 | SOCK_NONBLOCK = 00000200	/* Atomically mark descriptor(s) as | |
| 53 | 				 non-blocking. */ | |
| 54 | #define SOCK_NONBLOCK SOCK_NONBLOCK | |
| 55 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/statfs.h deleted-73| ... | ... | @@ -1,73 +0,0 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_STATFS_H | |
| 19 | # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #include <bits/types.h> /* for __fsid_t and __fsblkcnt_t*/ | |
| 23 | ||
| 24 | struct statfs | |
| 25 | { | |
| 26 | long int f_type; | |
| 27 | #define f_fstyp f_type | |
| 28 | long int f_bsize; | |
| 29 | long int f_frsize;	/* Fragment size - unsupported */ | |
| 30 | #ifndef __USE_FILE_OFFSET64 | |
| 31 | __fsblkcnt_t f_blocks; | |
| 32 | __fsblkcnt_t f_bfree; | |
| 33 | __fsblkcnt_t f_files; | |
| 34 | __fsblkcnt_t f_ffree; | |
| 35 | __fsblkcnt_t f_bavail; | |
| 36 | #else | |
| 37 | __fsblkcnt64_t f_blocks; | |
| 38 | __fsblkcnt64_t f_bfree; | |
| 39 | __fsblkcnt64_t f_files; | |
| 40 | __fsblkcnt64_t f_ffree; | |
| 41 | __fsblkcnt64_t f_bavail; | |
| 42 | #endif | |
| 43 | ||
| 44 | 	/* Linux specials */ | |
| 45 | __fsid_t f_fsid; | |
| 46 | long int f_namelen; | |
| 47 | long int f_flags; | |
| 48 | long int f_spare[5]; | |
| 49 | }; | |
| 50 | ||
| 51 | #ifdef __USE_LARGEFILE64 | |
| 52 | struct statfs64 | |
| 53 | { | |
| 54 | long int f_type; | |
| 55 | #define f_fstyp f_type | |
| 56 | long int f_bsize; | |
| 57 | long int f_frsize;	/* Fragment size - unsupported */ | |
| 58 | __fsblkcnt64_t f_blocks; | |
| 59 | __fsblkcnt64_t f_bfree; | |
| 60 | __fsblkcnt64_t f_files; | |
| 61 | __fsblkcnt64_t f_ffree; | |
| 62 | __fsblkcnt64_t f_bavail; | |
| 63 | ||
| 64 | 	/* Linux specials */ | |
| 65 | __fsid_t f_fsid; | |
| 66 | long int f_namelen; | |
| 67 | long int f_flags; | |
| 68 | long int f_spare[5]; | |
| 69 | }; | |
| 70 | #endif | |
| 71 | ||
| 72 | /* Tell code we have these members. */ | |
| 73 | #define _STATFS_F_NAMELEN | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/struct_mutex.h deleted-56| ... | ... | @@ -1,56 +0,0 @@ |
| 1 | /* MIPS internal mutex struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _THREAD_MUTEX_INTERNAL_H | |
| 20 | #define _THREAD_MUTEX_INTERNAL_H 1 | |
| 21 | ||
| 22 | struct __pthread_mutex_s | |
| 23 | { | |
| 24 | int __lock; | |
| 25 | unsigned int __count; | |
| 26 | int __owner; | |
| 27 | #if _MIPS_SIM == _ABI64 | |
| 28 | unsigned int __nusers; | |
| 29 | #endif | |
| 30 | /* KIND must stay at this position in the structure to maintain | |
| 31 | binary compatibility with static initializers. */ | |
| 32 | int __kind; | |
| 33 | #if _MIPS_SIM == _ABI64 | |
| 34 | int __spins; | |
| 35 | __pthread_list_t __list; | |
| 36 | # define __PTHREAD_MUTEX_HAVE_PREV 1 | |
| 37 | #else | |
| 38 | unsigned int __nusers; | |
| 39 | __extension__ union | |
| 40 | { | |
| 41 | int __spins; | |
| 42 | __pthread_slist_t __list; | |
| 43 | }; | |
| 44 | # define __PTHREAD_MUTEX_HAVE_PREV 0 | |
| 45 | #endif | |
| 46 | }; | |
| 47 | ||
| 48 | #if _MIPS_SIM == _ABI64 | |
| 49 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 50 | 0, 0, 0, 0, __kind, 0, { 0, 0 } | |
| 51 | #else | |
| 52 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 53 | 0, 0, 0, __kind, 0, { 0 } | |
| 54 | #endif | |
| 55 | ||
| 56 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/struct_rwlock.h deleted-71| ... | ... | @@ -1,71 +0,0 @@ |
| 1 | /* MIPS internal rwlock struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _RWLOCK_INTERNAL_H | |
| 20 | #define _RWLOCK_INTERNAL_H | |
| 21 | ||
| 22 | struct __pthread_rwlock_arch_t | |
| 23 | { | |
| 24 | unsigned int __readers; | |
| 25 | unsigned int __writers; | |
| 26 | unsigned int __wrphase_futex; | |
| 27 | unsigned int __writers_futex; | |
| 28 | unsigned int __pad3; | |
| 29 | unsigned int __pad4; | |
| 30 | #if _MIPS_SIM == _ABI64 | |
| 31 | int __cur_writer; | |
| 32 | int __shared; | |
| 33 | unsigned long int __pad1; | |
| 34 | unsigned long int __pad2; | |
| 35 | /* FLAGS must stay at this position in the structure to maintain | |
| 36 | binary compatibility. */ | |
| 37 | unsigned int __flags; | |
| 38 | # else | |
| 39 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 40 | unsigned char __pad1; | |
| 41 | unsigned char __pad2; | |
| 42 | unsigned char __shared; | |
| 43 | /* FLAGS must stay at this position in the structure to maintain | |
| 44 | binary compatibility. */ | |
| 45 | unsigned char __flags; | |
| 46 | # else | |
| 47 | /* FLAGS must stay at this position in the structure to maintain | |
| 48 | binary compatibility. */ | |
| 49 | unsigned char __flags; | |
| 50 | unsigned char __shared; | |
| 51 | unsigned char __pad1; | |
| 52 | unsigned char __pad2; | |
| 53 | # endif | |
| 54 | int __cur_writer; | |
| 55 | #endif | |
| 56 | }; | |
| 57 | ||
| 58 | #if _MIPS_SIM == _ABI64 | |
| 59 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 60 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags | |
| 61 | #else | |
| 62 | # if __BYTE_ORDER == __BIG_ENDIAN | |
| 63 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 64 | 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 | |
| 65 | # else | |
| 66 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 67 | 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 | |
| 68 | # endif | |
| 69 | #endif | |
| 70 | ||
| 71 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/termios-c_cc.h deleted-43| ... | ... | @@ -1,43 +0,0 @@ |
| 1 | /* termios c_cc symbolic constant definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_cc.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_cc characters */ | |
| 24 | #define VINTR		0	/* Interrupt character [ISIG]. */ | |
| 25 | #define VQUIT		1	/* Quit character [ISIG]. */ | |
| 26 | #define VERASE		2	/* Erase character [ICANON]. */ | |
| 27 | #define VKILL		3	/* Kill-line character [ICANON]. */ | |
| 28 | #define VMIN		4	/* Minimum number of bytes read at once [!ICANON]. */ | |
| 29 | #define VTIME		5	/* Time-out value (tenths of a second) [!ICANON]. */ | |
| 30 | #define VEOL2		6	/* Second EOL character [ICANON]. */ | |
| 31 | #define VSWTC		7 | |
| 32 | #define VSWTCH		VSWTC | |
| 33 | #define VSTART		8	/* Start (X-ON) character [IXON, IXOFF]. */ | |
| 34 | #define VSTOP		9	/* Stop (X-OFF) character [IXON, IXOFF]. */ | |
| 35 | #define VSUSP		10	/* Suspend character [ISIG]. */ | |
| 36 | 				/* VDSUSP is not supported on Linux. */ | |
| 37 | /* #define VDSUSP	11	/ * Delayed suspend character [ISIG]. */ | |
| 38 | #define VREPRINT	12	/* Reprint-line character [ICANON]. */ | |
| 39 | #define VDISCARD	13	/* Discard character [IEXTEN]. */ | |
| 40 | #define VWERASE		14	/* Word-erase character [ICANON]. */ | |
| 41 | #define VLNEXT		15	/* Literal-next character [IEXTEN]. */ | |
| 42 | #define VEOF		16	/* End-of-file character [ICANON]. */ | |
| 43 | #define VEOL		17	/* End-of-line character [ICANON]. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/termios-c_lflag.h deleted-46| ... | ... | @@ -1,46 +0,0 @@ |
| 1 | /* termios local mode definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_lflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_lflag bits */ | |
| 24 | #define ISIG	0000001		/* Enable signals. */ | |
| 25 | #define ICANON	0000002		/* Do erase and kill processing. */ | |
| 26 | #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) | |
| 27 | # define XCASE	0000004 | |
| 28 | #endif | |
| 29 | #define ECHO	0000010		/* Enable echo. */ | |
| 30 | #define ECHOE	0000020		/* Visual erase for ERASE. */ | |
| 31 | #define ECHOK	0000040		/* Echo NL after KILL. */ | |
| 32 | #define ECHONL	0000100		/* Echo NL even if ECHO is off. */ | |
| 33 | #define NOFLSH	0000200		/* Disable flush after interrupt. */ | |
| 34 | #define IEXTEN	0000400		/* Enable DISCARD and LNEXT. */ | |
| 35 | #ifdef __USE_MISC | |
| 36 | # define ECHOCTL 0001000	/* Echo control characters as ^X. */ | |
| 37 | # define ECHOPRT 0002000	/* Hardcopy visual erase. */ | |
| 38 | # define ECHOKE	 0004000	/* Visual erase for KILL. */ | |
| 39 | # define FLUSHO	0020000 | |
| 40 | # define PENDIN	0040000		/* Retype pending input (state). */ | |
| 41 | #endif | |
| 42 | #define TOSTOP	0100000		/* Send SIGTTOU for background output. */ | |
| 43 | #define ITOSTOP	TOSTOP | |
| 44 | #ifdef __USE_MISC | |
| 45 | # define EXTPROC 0200000 | |
| 46 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/termios-struct.h deleted-34| ... | ... | @@ -1,34 +0,0 @@ |
| 1 | /* struct termios definition. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-struct.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define NCCS 32 | |
| 24 | struct termios | |
| 25 | { | |
| 26 | tcflag_t c_iflag;		/* input mode flags */ | |
| 27 | tcflag_t c_oflag;		/* output mode flags */ | |
| 28 | tcflag_t c_cflag;		/* control mode flags */ | |
| 29 | tcflag_t c_lflag;		/* local mode flags */ | |
| 30 | cc_t c_line;		/* line discipline */ | |
| 31 | cc_t c_cc[NCCS];		/* control characters */ | |
| 32 | #define _HAVE_STRUCT_TERMIOS_C_ISPEED 0 | |
| 33 | #define _HAVE_STRUCT_TERMIOS_C_OSPEED 0 | |
| 34 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/termios-tcflow.h deleted-26| ... | ... | @@ -1,26 +0,0 @@ |
| 1 | /* termios local mode definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-tcflow.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* tcsetattr uses these */ | |
| 24 | #define	TCSANOW		0x540e	/* Same as TCSETS; change immediately. */ | |
| 25 | #define	TCSADRAIN	0x540f	/* Same as TCSETSW; change when pending output is written. */ | |
| 26 | #define	TCSAFLUSH	0x5410	/* Same as TCSETSF; flush pending input before changing. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/timerfd.h deleted-29| ... | ... | @@ -1,29 +0,0 @@ |
| 1 | /* Copyright (C) 2008-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_TIMERFD_H | |
| 19 | # error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Bits to be set in the FLAGS parameter of `timerfd_create'. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | TFD_CLOEXEC = 02000000, | |
| 26 | #define TFD_CLOEXEC TFD_CLOEXEC | |
| 27 | TFD_NONBLOCK = 00000200 | |
| 28 | #define TFD_NONBLOCK TFD_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/types/stack_t.h deleted-33| ... | ... | @@ -1,33 +0,0 @@ |
| 1 | /* Define stack_t. MIPS Linux version. | |
| 2 | Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __stack_t_defined | |
| 20 | #define __stack_t_defined 1 | |
| 21 | ||
| 22 | #define __need_size_t | |
| 23 | #include <stddef.h> | |
| 24 | ||
| 25 | /* Structure describing a signal stack. */ | |
| 26 | typedef struct | |
| 27 | { | |
| 28 | void *ss_sp; | |
| 29 | size_t ss_size; | |
| 30 | int ss_flags; | |
| 31 | } stack_t; | |
| 32 | ||
| 33 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/types/struct_msqid_ds.h deleted-56| ... | ... | @@ -1,56 +0,0 @@ |
| 1 | /* Linux/MIPS implementation of the SysV message struct msqid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MSG_H | |
| 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Structure of record for one message inside the kernel. | |
| 24 | The type `struct msg' is opaque. */ | |
| 25 | struct msqid_ds | |
| 26 | { | |
| 27 | struct ipc_perm msg_perm;	/* structure describing operation permission */ | |
| 28 | #if __TIMESIZE == 32 | |
| 29 | # ifdef __MIPSEL__ | |
| 30 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 31 | unsigned long int __msg_stime_high; | |
| 32 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 33 | unsigned long int __msg_rtime_high; | |
| 34 | __time_t msg_ctime;		/* time of last change */ | |
| 35 | unsigned long int __msg_ctime_high; | |
| 36 | # else | |
| 37 | unsigned long int __msg_stime_high; | |
| 38 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 39 | unsigned long int __msg_rtime_high; | |
| 40 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 41 | unsigned long int __msg_ctime_high; | |
| 42 | __time_t msg_ctime;		/* time of last change */ | |
| 43 | # endif | |
| 44 | #else | |
| 45 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 46 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 47 | __time_t msg_ctime;		/* time of last change */ | |
| 48 | #endif | |
| 49 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ | |
| 50 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ | |
| 51 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ | |
| 52 | __pid_t msg_lspid;		/* pid of last msgsnd() */ | |
| 53 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ | |
| 54 | __syscall_ulong_t __glibc_reserved4; | |
| 55 | __syscall_ulong_t __glibc_reserved5; | |
| 56 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/types/struct_semid_ds.h deleted-32| ... | ... | @@ -1,32 +0,0 @@ |
| 1 | /* MIPS implementation of the semaphore struct semid_ds | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SEM_H | |
| 20 | # error "Never include <bits/types/struct_semid_ds.h> directly; use <sys/sem.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a set of semaphores. */ | |
| 24 | struct semid_ds | |
| 25 | { | |
| 26 | struct ipc_perm sem_perm;		/* operation permission struct */ | |
| 27 | __time_t sem_otime;	/* last semop() time */ | |
| 28 | __time_t sem_ctime;	/* last time changed by semctl() */ | |
| 29 | __syscall_ulong_t sem_nsems;		/* number of semaphores in set */ | |
| 30 | __syscall_ulong_t __sem_otime_high; | |
| 31 | __syscall_ulong_t __sem_ctime_high; | |
| 32 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/types/struct_shmid_ds.h deleted-49| ... | ... | @@ -1,49 +0,0 @@ |
| 1 | /* Linux/MIPS implementation of the shared memory struct shmid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never include <bits/types/struct_shmid_ds.h> directly; use <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a shared memory segment. */ | |
| 24 | struct shmid_ds | |
| 25 | { | |
| 26 | struct ipc_perm shm_perm;		/* operation permission struct */ | |
| 27 | size_t shm_segsz;			/* size of segment in bytes */ | |
| 28 | #if __TIMESIZE == 32 | |
| 29 | __time_t shm_atime;			/* time of last shmat() */ | |
| 30 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 31 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 32 | #else | |
| 33 | __time_t shm_atime;			/* time of last shmat() */ | |
| 34 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 35 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 36 | #endif | |
| 37 | __pid_t shm_cpid;			/* pid of creator */ | |
| 38 | __pid_t shm_lpid;			/* pid of last shmop */ | |
| 39 | shmatt_t shm_nattch;		/* number of current attaches */ | |
| 40 | #if __TIMESIZE == 32 | |
| 41 | unsigned short int __shm_atime_high; | |
| 42 | unsigned short int __shm_dtime_high; | |
| 43 | unsigned short int __shm_ctime_high; | |
| 44 | unsigned short int __glibc_reserved4; | |
| 45 | #else | |
| 46 | __syscall_ulong_t __glibc_reserved5; | |
| 47 | __syscall_ulong_t __glibc_reserved6; | |
| 48 | #endif | |
| 49 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/bits/wordsize.h deleted-31| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #include <sgidefs.h> | |
| 19 | ||
| 20 | #define __WORDSIZE			_MIPS_SZPTR | |
| 21 | ||
| 22 | #if _MIPS_SIM == _ABI64 | |
| 23 | # define __WORDSIZE_TIME64_COMPAT32	1 | |
| 24 | #else | |
| 25 | # define __WORDSIZE_TIME64_COMPAT32	0 | |
| 26 | #endif | |
| 27 | ||
| 28 | #if __WORDSIZE == 32 | |
| 29 | #define __WORDSIZE32_SIZE_ULONG		0 | |
| 30 | #define __WORDSIZE32_PTRDIFF_LONG	0 | |
| 31 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnu/ieee754.h deleted-326| ... | ... | @@ -1,326 +0,0 @@ |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _IEEE754_H | |
| 19 | #define _IEEE754_H 1 | |
| 20 | ||
| 21 | #include <features.h> | |
| 22 | ||
| 23 | #include <bits/endian.h> | |
| 24 | ||
| 25 | #ifndef __LDBL_MANT_DIG__ | |
| 26 | # include <float.h> | |
| 27 | # define __LDBL_MANT_DIG__ LDBL_MANT_DIG | |
| 28 | #endif | |
| 29 | ||
| 30 | __BEGIN_DECLS | |
| 31 | ||
| 32 | union ieee754_float | |
| 33 | { | |
| 34 | float f; | |
| 35 | ||
| 36 | /* This is the IEEE 754 single-precision format. */ | |
| 37 | struct | |
| 38 | { | |
| 39 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 40 | 	unsigned int negative:1; | |
| 41 | 	unsigned int exponent:8; | |
| 42 | 	unsigned int mantissa:23; | |
| 43 | #endif				/* Big endian. */ | |
| 44 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 45 | 	unsigned int mantissa:23; | |
| 46 | 	unsigned int exponent:8; | |
| 47 | 	unsigned int negative:1; | |
| 48 | #endif				/* Little endian. */ | |
| 49 | } ieee; | |
| 50 | ||
| 51 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 52 | struct | |
| 53 | { | |
| 54 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 55 | 	unsigned int negative:1; | |
| 56 | 	unsigned int exponent:8; | |
| 57 | 	unsigned int quiet_nan:1; | |
| 58 | 	unsigned int mantissa:22; | |
| 59 | #endif				/* Big endian. */ | |
| 60 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 61 | 	unsigned int mantissa:22; | |
| 62 | 	unsigned int quiet_nan:1; | |
| 63 | 	unsigned int exponent:8; | |
| 64 | 	unsigned int negative:1; | |
| 65 | #endif				/* Little endian. */ | |
| 66 | } ieee_nan; | |
| 67 | }; | |
| 68 | ||
| 69 | #define IEEE754_FLOAT_BIAS	0x7f /* Added to exponent. */ | |
| 70 | ||
| 71 | ||
| 72 | union ieee754_double | |
| 73 | { | |
| 74 | double d; | |
| 75 | ||
| 76 | /* This is the IEEE 754 double-precision format. */ | |
| 77 | struct | |
| 78 | { | |
| 79 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 80 | 	unsigned int negative:1; | |
| 81 | 	unsigned int exponent:11; | |
| 82 | 	/* Together these comprise the mantissa. */ | |
| 83 | 	unsigned int mantissa0:20; | |
| 84 | 	unsigned int mantissa1:32; | |
| 85 | #endif				/* Big endian. */ | |
| 86 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 87 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 88 | 	unsigned int mantissa0:20; | |
| 89 | 	unsigned int exponent:11; | |
| 90 | 	unsigned int negative:1; | |
| 91 | 	unsigned int mantissa1:32; | |
| 92 | # else | |
| 93 | 	/* Together these comprise the mantissa. */ | |
| 94 | 	unsigned int mantissa1:32; | |
| 95 | 	unsigned int mantissa0:20; | |
| 96 | 	unsigned int exponent:11; | |
| 97 | 	unsigned int negative:1; | |
| 98 | # endif | |
| 99 | #endif				/* Little endian. */ | |
| 100 | } ieee; | |
| 101 | ||
| 102 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 103 | struct | |
| 104 | { | |
| 105 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 106 | 	unsigned int negative:1; | |
| 107 | 	unsigned int exponent:11; | |
| 108 | 	unsigned int quiet_nan:1; | |
| 109 | 	/* Together these comprise the mantissa. */ | |
| 110 | 	unsigned int mantissa0:19; | |
| 111 | 	unsigned int mantissa1:32; | |
| 112 | #else | |
| 113 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 114 | 	unsigned int mantissa0:19; | |
| 115 | 	unsigned int quiet_nan:1; | |
| 116 | 	unsigned int exponent:11; | |
| 117 | 	unsigned int negative:1; | |
| 118 | 	unsigned int mantissa1:32; | |
| 119 | # else | |
| 120 | 	/* Together these comprise the mantissa. */ | |
| 121 | 	unsigned int mantissa1:32; | |
| 122 | 	unsigned int mantissa0:19; | |
| 123 | 	unsigned int quiet_nan:1; | |
| 124 | 	unsigned int exponent:11; | |
| 125 | 	unsigned int negative:1; | |
| 126 | # endif | |
| 127 | #endif | |
| 128 | } ieee_nan; | |
| 129 | }; | |
| 130 | ||
| 131 | #define IEEE754_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 132 | ||
| 133 | #if __LDBL_MANT_DIG__ == 113 | |
| 134 | ||
| 135 | union ieee854_long_double | |
| 136 | { | |
| 137 | long double d; | |
| 138 | ||
| 139 | /* This is the IEEE 854 quad-precision format. */ | |
| 140 | struct | |
| 141 | { | |
| 142 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 143 | 	unsigned int negative:1; | |
| 144 | 	unsigned int exponent:15; | |
| 145 | 	/* Together these comprise the mantissa. */ | |
| 146 | 	unsigned int mantissa0:16; | |
| 147 | 	unsigned int mantissa1:32; | |
| 148 | 	unsigned int mantissa2:32; | |
| 149 | 	unsigned int mantissa3:32; | |
| 150 | #endif				/* Big endian. */ | |
| 151 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 152 | 	/* Together these comprise the mantissa. */ | |
| 153 | 	unsigned int mantissa3:32; | |
| 154 | 	unsigned int mantissa2:32; | |
| 155 | 	unsigned int mantissa1:32; | |
| 156 | 	unsigned int mantissa0:16; | |
| 157 | 	unsigned int exponent:15; | |
| 158 | 	unsigned int negative:1; | |
| 159 | #endif				/* Little endian. */ | |
| 160 | } ieee; | |
| 161 | ||
| 162 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 163 | struct | |
| 164 | { | |
| 165 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 166 | 	unsigned int negative:1; | |
| 167 | 	unsigned int exponent:15; | |
| 168 | 	unsigned int quiet_nan:1; | |
| 169 | 	/* Together these comprise the mantissa. */ | |
| 170 | 	unsigned int mantissa0:15; | |
| 171 | 	unsigned int mantissa1:32; | |
| 172 | 	unsigned int mantissa2:32; | |
| 173 | 	unsigned int mantissa3:32; | |
| 174 | #endif				/* Big endian. */ | |
| 175 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 176 | 	/* Together these comprise the mantissa. */ | |
| 177 | 	unsigned int mantissa3:32; | |
| 178 | 	unsigned int mantissa2:32; | |
| 179 | 	unsigned int mantissa1:32; | |
| 180 | 	unsigned int mantissa0:15; | |
| 181 | 	unsigned int quiet_nan:1; | |
| 182 | 	unsigned int exponent:15; | |
| 183 | 	unsigned int negative:1; | |
| 184 | #endif				/* Little endian. */ | |
| 185 | } ieee_nan; | |
| 186 | }; | |
| 187 | ||
| 188 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ | |
| 189 | ||
| 190 | #elif __LDBL_MANT_DIG__ == 64 | |
| 191 | ||
| 192 | union ieee854_long_double | |
| 193 | { | |
| 194 | long double d; | |
| 195 | ||
| 196 | /* This is the IEEE 854 double-extended-precision format. */ | |
| 197 | struct | |
| 198 | { | |
| 199 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 200 | 	unsigned int negative:1; | |
| 201 | 	unsigned int exponent:15; | |
| 202 | 	unsigned int empty:16; | |
| 203 | 	unsigned int mantissa0:32; | |
| 204 | 	unsigned int mantissa1:32; | |
| 205 | #endif | |
| 206 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 207 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 208 | 	unsigned int exponent:15; | |
| 209 | 	unsigned int negative:1; | |
| 210 | 	unsigned int empty:16; | |
| 211 | 	unsigned int mantissa0:32; | |
| 212 | 	unsigned int mantissa1:32; | |
| 213 | # else | |
| 214 | 	unsigned int mantissa1:32; | |
| 215 | 	unsigned int mantissa0:32; | |
| 216 | 	unsigned int exponent:15; | |
| 217 | 	unsigned int negative:1; | |
| 218 | 	unsigned int empty:16; | |
| 219 | # endif | |
| 220 | #endif | |
| 221 | } ieee; | |
| 222 | ||
| 223 | /* This is for NaNs in the IEEE 854 double-extended-precision format. */ | |
| 224 | struct | |
| 225 | { | |
| 226 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 227 | 	unsigned int negative:1; | |
| 228 | 	unsigned int exponent:15; | |
| 229 | 	unsigned int empty:16; | |
| 230 | 	unsigned int one:1; | |
| 231 | 	unsigned int quiet_nan:1; | |
| 232 | 	unsigned int mantissa0:30; | |
| 233 | 	unsigned int mantissa1:32; | |
| 234 | #endif | |
| 235 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 236 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 237 | 	unsigned int exponent:15; | |
| 238 | 	unsigned int negative:1; | |
| 239 | 	unsigned int empty:16; | |
| 240 | 	unsigned int mantissa0:30; | |
| 241 | 	unsigned int quiet_nan:1; | |
| 242 | 	unsigned int one:1; | |
| 243 | 	unsigned int mantissa1:32; | |
| 244 | # else | |
| 245 | 	unsigned int mantissa1:32; | |
| 246 | 	unsigned int mantissa0:30; | |
| 247 | 	unsigned int quiet_nan:1; | |
| 248 | 	unsigned int one:1; | |
| 249 | 	unsigned int exponent:15; | |
| 250 | 	unsigned int negative:1; | |
| 251 | 	unsigned int empty:16; | |
| 252 | # endif | |
| 253 | #endif | |
| 254 | } ieee_nan; | |
| 255 | }; | |
| 256 | ||
| 257 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff | |
| 258 | ||
| 259 | #elif __LDBL_MANT_DIG__ == 53 | |
| 260 | ||
| 261 | union ieee854_long_double | |
| 262 | { | |
| 263 | long double d; | |
| 264 | ||
| 265 | /* This is the IEEE 754 double-precision format. */ | |
| 266 | struct | |
| 267 | { | |
| 268 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 269 | 	unsigned int negative:1; | |
| 270 | 	unsigned int exponent:11; | |
| 271 | 	/* Together these comprise the mantissa. */ | |
| 272 | 	unsigned int mantissa0:20; | |
| 273 | 	unsigned int mantissa1:32; | |
| 274 | #endif				/* Big endian. */ | |
| 275 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 276 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 277 | 	unsigned int mantissa0:20; | |
| 278 | 	unsigned int exponent:11; | |
| 279 | 	unsigned int negative:1; | |
| 280 | 	unsigned int mantissa1:32; | |
| 281 | # else | |
| 282 | 	/* Together these comprise the mantissa. */ | |
| 283 | 	unsigned int mantissa1:32; | |
| 284 | 	unsigned int mantissa0:20; | |
| 285 | 	unsigned int exponent:11; | |
| 286 | 	unsigned int negative:1; | |
| 287 | # endif | |
| 288 | #endif				/* Little endian. */ | |
| 289 | } ieee; | |
| 290 | ||
| 291 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 292 | struct | |
| 293 | { | |
| 294 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 295 | 	unsigned int negative:1; | |
| 296 | 	unsigned int exponent:11; | |
| 297 | 	unsigned int quiet_nan:1; | |
| 298 | 	/* Together these comprise the mantissa. */ | |
| 299 | 	unsigned int mantissa0:19; | |
| 300 | 	unsigned int mantissa1:32; | |
| 301 | #else | |
| 302 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 303 | 	unsigned int mantissa0:19; | |
| 304 | 	unsigned int quiet_nan:1; | |
| 305 | 	unsigned int exponent:11; | |
| 306 | 	unsigned int negative:1; | |
| 307 | 	unsigned int mantissa1:32; | |
| 308 | # else | |
| 309 | 	/* Together these comprise the mantissa. */ | |
| 310 | 	unsigned int mantissa1:32; | |
| 311 | 	unsigned int mantissa0:19; | |
| 312 | 	unsigned int quiet_nan:1; | |
| 313 | 	unsigned int exponent:11; | |
| 314 | 	unsigned int negative:1; | |
| 315 | # endif | |
| 316 | #endif | |
| 317 | } ieee_nan; | |
| 318 | }; | |
| 319 | ||
| 320 | #define IEEE854_LONG_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 321 | ||
| 322 | #endif /* __LDBL_MANT_DIG__ == 53 */ | |
| 323 | ||
| 324 | __END_DECLS | |
| 325 | ||
| 326 | #endif /* ieee754.h */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/dlfcn.h created+64| ... | ... | @@ -0,0 +1,64 @@ |
| 1 | /* System dependent definitions for run-time dynamic loading. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _DLFCN_H | |
| 20 | # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The MODE argument to `dlopen' contains one of the following: */ | |
| 24 | #define RTLD_LAZY	0x0001	/* Lazy function call binding. */ | |
| 25 | #define RTLD_NOW	0x0002	/* Immediate function call binding. */ | |
| 26 | #define RTLD_BINDING_MASK 0x3	/* Mask of binding time value. */ | |
| 27 | #define RTLD_NOLOAD	0x00008	/* Do not load the object. */ | |
| 28 | #define RTLD_DEEPBIND	0x00010	/* Use deep binding. */ | |
| 29 | ||
| 30 | /* If the following bit is set in the MODE argument to `dlopen', | |
| 31 | the symbols of the loaded object and its dependencies are made | |
| 32 | visible as if the object were linked directly into the program. */ | |
| 33 | #define RTLD_GLOBAL	0x0004 | |
| 34 | ||
| 35 | /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. | |
| 36 | The implementation does this by default and so we can define the | |
| 37 | value to zero. */ | |
| 38 | #define RTLD_LOCAL 0 | |
| 39 | ||
| 40 | /* Do not delete object when closed. */ | |
| 41 | #define RTLD_NODELETE	0x01000 | |
| 42 | ||
| 43 | #ifdef __USE_GNU | |
| 44 | /* To support profiling of shared objects it is a good idea to call | |
| 45 | the function found using `dlsym' using the following macro since | |
| 46 | these calls do not use the PLT. But this would mean the dynamic | |
| 47 | loader has no chance to find out when the function is called. The | |
| 48 | macro applies the necessary magic so that profiling is possible. | |
| 49 | Rewrite | |
| 50 | 	foo = (*fctp) (arg1, arg2); | |
| 51 | into | |
| 52 | foo = DL_CALL_FCT (fctp, (arg1, arg2)); | |
| 53 | */ | |
| 54 | # define DL_CALL_FCT(fctp, args) \ | |
| 55 | (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args) | |
| 56 | ||
| 57 | __BEGIN_DECLS | |
| 58 | ||
| 59 | /* This function calls the profiling functions. */ | |
| 60 | extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW; | |
| 61 | ||
| 62 | __END_DECLS | |
| 63 | ||
| 64 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/errno.h created+52| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | /* Error constants. MIPS/Linux specific version. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_ERRNO_H | |
| 20 | ||
| 21 | #if !defined _ERRNO_H | |
| 22 | # error "Never include <bits/errno.h> directly; use <errno.h> instead." | |
| 23 | #endif | |
| 24 | ||
| 25 | # include <linux/errno.h> | |
| 26 | ||
| 27 | /* Older Linux headers do not define these constants. */ | |
| 28 | # ifndef ENOTSUP | |
| 29 | # define ENOTSUP		EOPNOTSUPP | |
| 30 | # endif | |
| 31 | ||
| 32 | # ifndef ECANCELED | |
| 33 | # define ECANCELED		158 | |
| 34 | # endif | |
| 35 | ||
| 36 | # ifndef EOWNERDEAD | |
| 37 | # define EOWNERDEAD		165 | |
| 38 | # endif | |
| 39 | ||
| 40 | # ifndef ENOTRECOVERABLE | |
| 41 | # define ENOTRECOVERABLE	166 | |
| 42 | # endif | |
| 43 | ||
| 44 | # ifndef ERFKILL | |
| 45 | # define ERFKILL		167 | |
| 46 | # endif | |
| 47 | ||
| 48 | # ifndef EHWPOISON | |
| 49 | # define EHWPOISON		168 | |
| 50 | # endif | |
| 51 | ||
| 52 | #endif /* bits/errno.h. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/eventfd.h created+31| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | /* Copyright (C) 2007-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_EVENTFD_H | |
| 19 | # error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for eventfd. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | EFD_SEMAPHORE = 00000001, | |
| 26 | #define EFD_SEMAPHORE EFD_SEMAPHORE | |
| 27 | EFD_CLOEXEC = 02000000, | |
| 28 | #define EFD_CLOEXEC EFD_CLOEXEC | |
| 29 | EFD_NONBLOCK = 00000200 | |
| 30 | #define EFD_NONBLOCK EFD_NONBLOCK | |
| 31 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/inotify.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_INOTIFY_H | |
| 19 | # error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for the parameter of inotify_init1. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | IN_CLOEXEC = 02000000, | |
| 26 | #define IN_CLOEXEC IN_CLOEXEC | |
| 27 | IN_NONBLOCK = 00000200 | |
| 28 | #define IN_NONBLOCK IN_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/ioctl-types.h created+75| ... | ... | @@ -0,0 +1,75 @@ |
| 1 | /* Structure types for pre-termios terminal ioctls. Linux/MIPS version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_IOCTL_H | |
| 20 | # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Get definition of constants for use with `ioctl'. */ | |
| 24 | #include <asm/ioctls.h> | |
| 25 | ||
| 26 | struct winsize | |
| 27 | { | |
| 28 | unsigned short int ws_row; | |
| 29 | unsigned short int ws_col; | |
| 30 | unsigned short int ws_xpixel; | |
| 31 | unsigned short int ws_ypixel; | |
| 32 | }; | |
| 33 | ||
| 34 | #define NCC	8 | |
| 35 | struct termio | |
| 36 | { | |
| 37 | unsigned short int c_iflag;		/* input mode flags */ | |
| 38 | unsigned short int c_oflag;		/* output mode flags */ | |
| 39 | unsigned short int c_cflag;		/* control mode flags */ | |
| 40 | unsigned short int c_lflag;		/* local mode flags */ | |
| 41 | char c_line;			/* line discipline */ | |
| 42 | /* Yes, this is really NCCS. */ | |
| 43 | unsigned char c_cc[32 /* NCCS */]; /* control characters */ | |
| 44 | }; | |
| 45 | ||
| 46 | /* modem lines */ | |
| 47 | #define TIOCM_LE	0x001		/* line enable */ | |
| 48 | #define TIOCM_DTR	0x002		/* data terminal ready */ | |
| 49 | #define TIOCM_RTS	0x004		/* request to send */ | |
| 50 | #define TIOCM_ST	0x010		/* secondary transmit */ | |
| 51 | #define TIOCM_SR	0x020		/* secondary receive */ | |
| 52 | #define TIOCM_CTS	0x040		/* clear to send */ | |
| 53 | #define TIOCM_CAR	0x100		/* carrier detect */ | |
| 54 | #define TIOCM_CD	TIOCM_CAR | |
| 55 | #define TIOCM_RNG	0x200		/* ring */ | |
| 56 | #define TIOCM_RI	TIOCM_RNG | |
| 57 | #define TIOCM_DSR	0x400		/* data set ready */ | |
| 58 | ||
| 59 | /* line disciplines */ | |
| 60 | #define N_TTY		0 | |
| 61 | #define N_SLIP		1 | |
| 62 | #define N_MOUSE		2 | |
| 63 | #define N_PPP		3 | |
| 64 | #define N_STRIP		4 | |
| 65 | #define N_AX25		5 | |
| 66 | #define N_X25		6	/* X.25 async */ | |
| 67 | #define N_6PACK		7 | |
| 68 | #define N_MASC		8	/* Mobitex module */ | |
| 69 | #define N_R3964		9	/* Simatic R3964 module */ | |
| 70 | #define N_PROFIBUS_FDL	10	/* Profibus */ | |
| 71 | #define N_IRDA		11	/* Linux IR */ | |
| 72 | #define N_SMSBLOCK	12	/* SMS block mode */ | |
| 73 | #define N_HDLC		13	/* synchronous HDLC */ | |
| 74 | #define N_SYNC_PPP	14	/* synchronous PPP */ | |
| 75 | #define	N_HCI		15	/* Bluetooth HCI UART */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/ipctypes.h created+31| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | /* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. MIPS version | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* | |
| 20 | * Never include <bits/ipctypes.h> directly. | |
| 21 | */ | |
| 22 | ||
| 23 | #ifndef _BITS_IPCTYPES_H | |
| 24 | #define _BITS_IPCTYPES_H	1 | |
| 25 | ||
| 26 | #include <bits/types.h> | |
| 27 | ||
| 28 | typedef __SLONG32_TYPE __ipc_pid_t; | |
| 29 | ||
| 30 | ||
| 31 | #endif /* bits/ipctypes.h */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/mman.h created+48| ... | ... | @@ -0,0 +1,48 @@ |
| 1 | /* Definitions for POSIX memory map interface. Linux/MIPS version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MMAN_H | |
| 20 | # error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The following definitions basically come from the kernel headers. | |
| 24 | But the kernel header is not namespace clean. */ | |
| 25 | ||
| 26 | /* These are Linux-specific. */ | |
| 27 | #ifdef __USE_MISC | |
| 28 | # define MAP_NORESERVE	0x0400		/* don't check for reservations */ | |
| 29 | # define MAP_GROWSDOWN	0x1000		/* stack-like segment */ | |
| 30 | # define MAP_DENYWRITE	0x2000		/* ETXTBSY */ | |
| 31 | # define MAP_EXECUTABLE	0x4000		/* mark it as an executable */ | |
| 32 | # define MAP_LOCKED	0x8000		/* pages are locked */ | |
| 33 | # define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ | |
| 34 | # define MAP_NONBLOCK 0x20000 /* do not block on IO */ | |
| 35 | # define MAP_STACK	0x40000		/* Allocation is for a stack. */ | |
| 36 | # define MAP_HUGETLB	0x80000		/* Create huge page mapping. */ | |
| 37 | # define MAP_FIXED_NOREPLACE 0x100000	/* MAP_FIXED but do not unmap | |
| 38 | 					 underlying mapping. */ | |
| 39 | #endif | |
| 40 | ||
| 41 | #define __MAP_ANONYMOUS 0x0800 | |
| 42 | ||
| 43 | /* Include generic Linux declarations. */ | |
| 44 | #include <bits/mman-linux.h> | |
| 45 | ||
| 46 | #ifdef __USE_MISC | |
| 47 | # define MAP_RENAME	MAP_ANONYMOUS | |
| 48 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/poll.h created+49| ... | ... | @@ -0,0 +1,49 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_POLL_H | |
| 19 | # error "Never use <bits/poll.h> directly; include <sys/poll.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Event types that can be polled for. These bits may be set in `events' | |
| 23 | to indicate the interesting event types; they will appear in `revents' | |
| 24 | to indicate the status of the file descriptor. */ | |
| 25 | #define POLLIN		0x001		/* There is data to read. */ | |
| 26 | #define POLLPRI		0x002		/* There is urgent data to read. */ | |
| 27 | #define POLLOUT		0x004		/* Writing now will not block. */ | |
| 28 | ||
| 29 | #if defined __USE_XOPEN || defined __USE_XOPEN2K8 | |
| 30 | /* These values are defined in XPG4.2. */ | |
| 31 | # define POLLRDNORM	0x040		/* Normal data may be read. */ | |
| 32 | # define POLLRDBAND	0x080		/* Priority data may be read. */ | |
| 33 | # define POLLWRNORM	POLLOUT		/* Writing now will not block. */ | |
| 34 | # define POLLWRBAND	0x100		/* Priority data may be written. */ | |
| 35 | #endif | |
| 36 | ||
| 37 | #ifdef __USE_GNU | |
| 38 | /* These are extensions for Linux. */ | |
| 39 | # define POLLMSG	0x400 | |
| 40 | # define POLLREMOVE	0x1000 | |
| 41 | # define POLLRDHUP	0x2000 | |
| 42 | #endif | |
| 43 | ||
| 44 | /* Event types always implicitly polled for. These bits need not be set in | |
| 45 | `events', but they will appear in `revents' to indicate the status of | |
| 46 | the file descriptor. */ | |
| 47 | #define POLLERR		0x008		/* Error condition. */ | |
| 48 | #define POLLHUP		0x010		/* Hung up. */ | |
| 49 | #define POLLNVAL	0x020		/* Invalid polling request. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/pthread_stack_min.h created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. MIPS Linux version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. At least two pages with 64k pages. */ | |
| 20 | #define PTHREAD_STACK_MIN	131072 | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/pthreadtypes-arch.h created+44| ... | ... | @@ -0,0 +1,44 @@ |
| 1 | /* Machine-specific pthread type layouts. MIPS version. | |
| 2 | Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_PTHREADTYPES_ARCH_H | |
| 20 | #define _BITS_PTHREADTYPES_ARCH_H	1 | |
| 21 | ||
| 22 | #include <bits/endian.h> | |
| 23 | ||
| 24 | #if _MIPS_SIM == _ABI64 | |
| 25 | # define __SIZEOF_PTHREAD_ATTR_T 56 | |
| 26 | # define __SIZEOF_PTHREAD_MUTEX_T 40 | |
| 27 | # define __SIZEOF_PTHREAD_RWLOCK_T 56 | |
| 28 | # define __SIZEOF_PTHREAD_BARRIER_T 32 | |
| 29 | #else | |
| 30 | # define __SIZEOF_PTHREAD_ATTR_T 36 | |
| 31 | # define __SIZEOF_PTHREAD_MUTEX_T 24 | |
| 32 | # define __SIZEOF_PTHREAD_RWLOCK_T 32 | |
| 33 | # define __SIZEOF_PTHREAD_BARRIER_T 20 | |
| 34 | #endif | |
| 35 | #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 | |
| 36 | #define __SIZEOF_PTHREAD_COND_T 48 | |
| 37 | #define __SIZEOF_PTHREAD_CONDATTR_T 4 | |
| 38 | #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 | |
| 39 | #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 | |
| 40 | ||
| 41 | #define __LOCK_ALIGNMENT | |
| 42 | #define __ONCE_ALIGNMENT | |
| 43 | ||
| 44 | #endif	/* bits/pthreadtypes.h */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/resource.h created+231| ... | ... | @@ -0,0 +1,231 @@ |
| 1 | /* Bit values & structures for resource limits. Linux/MIPS version. | |
| 2 | Copyright (C) 1994-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_RESOURCE_H | |
| 20 | # error "Never use <bits/resource.h> directly; include <sys/resource.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/types.h> | |
| 24 | ||
| 25 | /* Transmute defines to enumerations. The macro re-definitions are | |
| 26 | necessary because some programs want to test for operating system | |
| 27 | features with #ifdef RUSAGE_SELF. In ISO C the reflexive | |
| 28 | definition is a no-op. */ | |
| 29 | ||
| 30 | /* Kinds of resource limit. */ | |
| 31 | enum __rlimit_resource | |
| 32 | { | |
| 33 | /* Per-process CPU limit, in seconds. */ | |
| 34 | RLIMIT_CPU = 0, | |
| 35 | #define RLIMIT_CPU RLIMIT_CPU | |
| 36 | ||
| 37 | /* Largest file that can be created, in bytes. */ | |
| 38 | RLIMIT_FSIZE = 1, | |
| 39 | #define	RLIMIT_FSIZE RLIMIT_FSIZE | |
| 40 | ||
| 41 | /* Maximum size of data segment, in bytes. */ | |
| 42 | RLIMIT_DATA = 2, | |
| 43 | #define	RLIMIT_DATA RLIMIT_DATA | |
| 44 | ||
| 45 | /* Maximum size of stack segment, in bytes. */ | |
| 46 | RLIMIT_STACK = 3, | |
| 47 | #define	RLIMIT_STACK RLIMIT_STACK | |
| 48 | ||
| 49 | /* Largest core file that can be created, in bytes. */ | |
| 50 | RLIMIT_CORE = 4, | |
| 51 | #define	RLIMIT_CORE RLIMIT_CORE | |
| 52 | ||
| 53 | /* Largest resident set size, in bytes. | |
| 54 | This affects swapping; processes that are exceeding their | |
| 55 | resident set size will be more likely to have physical memory | |
| 56 | taken from them. */ | |
| 57 | __RLIMIT_RSS = 7, | |
| 58 | #define	RLIMIT_RSS __RLIMIT_RSS | |
| 59 | ||
| 60 | /* Number of open files. */ | |
| 61 | RLIMIT_NOFILE = 5, | |
| 62 | __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ | |
| 63 | #define RLIMIT_NOFILE RLIMIT_NOFILE | |
| 64 | #define RLIMIT_OFILE __RLIMIT_OFILE | |
| 65 | ||
| 66 | /* Address space limit (?) */ | |
| 67 | RLIMIT_AS = 6, | |
| 68 | #define RLIMIT_AS RLIMIT_AS | |
| 69 | ||
| 70 | /* Number of processes. */ | |
| 71 | __RLIMIT_NPROC = 8, | |
| 72 | #define RLIMIT_NPROC __RLIMIT_NPROC | |
| 73 | ||
| 74 | /* Locked-in-memory address space. */ | |
| 75 | __RLIMIT_MEMLOCK = 9, | |
| 76 | #define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK | |
| 77 | ||
| 78 | /* Maximum number of file locks. */ | |
| 79 | __RLIMIT_LOCKS = 10, | |
| 80 | #define RLIMIT_LOCKS __RLIMIT_LOCKS | |
| 81 | ||
| 82 | /* Maximum number of pending signals. */ | |
| 83 | __RLIMIT_SIGPENDING = 11, | |
| 84 | #define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING | |
| 85 | ||
| 86 | /* Maximum bytes in POSIX message queues. */ | |
| 87 | __RLIMIT_MSGQUEUE = 12, | |
| 88 | #define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE | |
| 89 | ||
| 90 | /* Maximum nice priority allowed to raise to. | |
| 91 | Nice levels 19 .. -20 correspond to 0 .. 39 | |
| 92 | values of this resource limit. */ | |
| 93 | __RLIMIT_NICE = 13, | |
| 94 | #define RLIMIT_NICE __RLIMIT_NICE | |
| 95 | ||
| 96 | /* Maximum realtime priority allowed for non-priviledged | |
| 97 | processes. */ | |
| 98 | __RLIMIT_RTPRIO = 14, | |
| 99 | #define RLIMIT_RTPRIO __RLIMIT_RTPRIO | |
| 100 | ||
| 101 | /* Maximum CPU time in microseconds that a process scheduled under a real-time | |
| 102 | scheduling policy may consume without making a blocking system | |
| 103 | call before being forcibly descheduled. */ | |
| 104 | __RLIMIT_RTTIME = 15, | |
| 105 | #define RLIMIT_RTTIME __RLIMIT_RTTIME | |
| 106 | ||
| 107 | __RLIMIT_NLIMITS = 16, | |
| 108 | __RLIM_NLIMITS = __RLIMIT_NLIMITS | |
| 109 | #define RLIMIT_NLIMITS __RLIMIT_NLIMITS | |
| 110 | #define RLIM_NLIMITS __RLIM_NLIMITS | |
| 111 | }; | |
| 112 | ||
| 113 | /* Value to indicate that there is no limit. */ | |
| 114 | #if _MIPS_SIM == _ABI64 | |
| 115 | /* The N64 syscall uses this value. */ | |
| 116 | # define RLIM_INFINITY 0xffffffffffffffffUL | |
| 117 | # ifdef __USE_LARGEFILE64 | |
| 118 | # define RLIM64_INFINITY 0xffffffffffffffffUL | |
| 119 | # endif | |
| 120 | #else | |
| 121 | /* The O32 and N32 syscalls use 0x7fffffff. */ | |
| 122 | # ifndef __USE_FILE_OFFSET64 | |
| 123 | # define RLIM_INFINITY ((long int)(~0UL >> 1)) | |
| 124 | # else | |
| 125 | # define RLIM_INFINITY 0xffffffffffffffffULL | |
| 126 | # endif | |
| 127 | # ifdef __USE_LARGEFILE64 | |
| 128 | # define RLIM64_INFINITY 0xffffffffffffffffULL | |
| 129 | # endif | |
| 130 | #endif | |
| 131 | ||
| 132 | /* We can represent all limits. */ | |
| 133 | #define RLIM_SAVED_MAX	RLIM_INFINITY | |
| 134 | #define RLIM_SAVED_CUR	RLIM_INFINITY | |
| 135 | ||
| 136 | ||
| 137 | /* Type for resource quantity measurement. */ | |
| 138 | #ifndef __USE_FILE_OFFSET64 | |
| 139 | typedef __rlim_t rlim_t; | |
| 140 | #else | |
| 141 | typedef __rlim64_t rlim_t; | |
| 142 | #endif | |
| 143 | #ifdef __USE_LARGEFILE64 | |
| 144 | typedef __rlim64_t rlim64_t; | |
| 145 | #endif | |
| 146 | ||
| 147 | struct rlimit | |
| 148 | { | |
| 149 | /* The current (soft) limit. */ | |
| 150 | rlim_t rlim_cur; | |
| 151 | /* The hard limit. */ | |
| 152 | rlim_t rlim_max; | |
| 153 | }; | |
| 154 | ||
| 155 | #ifdef __USE_LARGEFILE64 | |
| 156 | struct rlimit64 | |
| 157 | { | |
| 158 | /* The current (soft) limit. */ | |
| 159 | rlim64_t rlim_cur; | |
| 160 | /* The hard limit. */ | |
| 161 | rlim64_t rlim_max; | |
| 162 | }; | |
| 163 | #endif | |
| 164 | ||
| 165 | /* Whose usage statistics do you want? */ | |
| 166 | enum __rusage_who | |
| 167 | { | |
| 168 | /* The calling process. */ | |
| 169 | RUSAGE_SELF = 0, | |
| 170 | #define RUSAGE_SELF RUSAGE_SELF | |
| 171 | ||
| 172 | /* All of its terminated child processes. */ | |
| 173 | RUSAGE_CHILDREN = -1 | |
| 174 | #define RUSAGE_CHILDREN RUSAGE_CHILDREN | |
| 175 | ||
| 176 | #ifdef __USE_GNU | |
| 177 | , | |
| 178 | /* The calling thread. */ | |
| 179 | RUSAGE_THREAD = 1 | |
| 180 | # define RUSAGE_THREAD RUSAGE_THREAD | |
| 181 | /* Name for the same functionality on Solaris. */ | |
| 182 | # define RUSAGE_LWP RUSAGE_THREAD | |
| 183 | #endif | |
| 184 | }; | |
| 185 | ||
| 186 | #include <bits/types/struct_timeval.h> | |
| 187 | #include <bits/types/struct_rusage.h> | |
| 188 | ||
| 189 | /* Priority limits. */ | |
| 190 | #define PRIO_MIN	-20	/* Minimum priority a process can have. */ | |
| 191 | #define PRIO_MAX	20	/* Maximum priority a process can have. */ | |
| 192 | ||
| 193 | /* The type of the WHICH argument to `getpriority' and `setpriority', | |
| 194 | indicating what flavor of entity the WHO argument specifies. */ | |
| 195 | enum __priority_which | |
| 196 | { | |
| 197 | PRIO_PROCESS = 0,		/* WHO is a process ID. */ | |
| 198 | #define PRIO_PROCESS PRIO_PROCESS | |
| 199 | PRIO_PGRP = 1,		/* WHO is a process group ID. */ | |
| 200 | #define PRIO_PGRP PRIO_PGRP | |
| 201 | PRIO_USER = 2			/* WHO is a user ID. */ | |
| 202 | #define PRIO_USER PRIO_USER | |
| 203 | }; | |
| 204 | ||
| 205 | ||
| 206 | __BEGIN_DECLS | |
| 207 | ||
| 208 | #ifdef __USE_GNU | |
| 209 | /* Modify and return resource limits of a process atomically. */ | |
| 210 | # ifndef __USE_FILE_OFFSET64 | |
| 211 | extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, | |
| 212 | 		 const struct rlimit *__new_limit, | |
| 213 | 		 struct rlimit *__old_limit) __THROW; | |
| 214 | # else | |
| 215 | # ifdef __REDIRECT_NTH | |
| 216 | extern int __REDIRECT_NTH (prlimit, (__pid_t __pid, | |
| 217 | 				 enum __rlimit_resource __resource, | |
| 218 | 				 const struct rlimit *__new_limit, | |
| 219 | 				 struct rlimit *__old_limit), prlimit64); | |
| 220 | # else | |
| 221 | # define prlimit prlimit64 | |
| 222 | # endif | |
| 223 | # endif | |
| 224 | # ifdef __USE_LARGEFILE64 | |
| 225 | extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource, | |
| 226 | 		 const struct rlimit64 *__new_limit, | |
| 227 | 		 struct rlimit64 *__old_limit) __THROW; | |
| 228 | # endif | |
| 229 | #endif | |
| 230 | ||
| 231 | __END_DECLS | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/semaphore.h created+36| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SEMAPHORE_H | |
| 19 | # error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #if _MIPS_SIM == _ABI64 | |
| 23 | # define __SIZEOF_SEM_T	32 | |
| 24 | #else | |
| 25 | # define __SIZEOF_SEM_T	16 | |
| 26 | #endif | |
| 27 | ||
| 28 | /* Value returned if `sem_open' failed. */ | |
| 29 | #define SEM_FAILED ((sem_t *) 0) | |
| 30 | ||
| 31 | ||
| 32 | typedef union | |
| 33 | { | |
| 34 | char __size[__SIZEOF_SEM_T]; | |
| 35 | long int __align; | |
| 36 | } sem_t; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/shmlba.h created+24| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | /* Define SHMLBA. MIPS version. | |
| 2 | Copyright (C) 2018-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never use <bits/shmlba.h> directly; include <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Segment low boundary address multiple. */ | |
| 24 | #define SHMLBA		0x40000 | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/sigaction.h created+94| ... | ... | @@ -0,0 +1,94 @@ |
| 1 | /* The proper definitions for Linux/MIPS's sigaction. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGACTION_H | |
| 20 | #define _BITS_SIGACTION_H 1 | |
| 21 | ||
| 22 | #ifndef _SIGNAL_H | |
| 23 | # error "Never include <bits/sigaction.h> directly; use <signal.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Structure describing the action to be taken when a signal arrives. */ | |
| 27 | struct sigaction | |
| 28 | { | |
| 29 | /* Special flags. */ | |
| 30 | int sa_flags; | |
| 31 | ||
| 32 | /* Signal handler. */ | |
| 33 | #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED | |
| 34 | union | |
| 35 | { | |
| 36 | 	/* Used if SA_SIGINFO is not set. */ | |
| 37 | 	__sighandler_t sa_handler; | |
| 38 | 	/* Used if SA_SIGINFO is set. */ | |
| 39 | 	void (*sa_sigaction) (int, siginfo_t *, void *); | |
| 40 | } | |
| 41 | __sigaction_handler; | |
| 42 | # define sa_handler __sigaction_handler.sa_handler | |
| 43 | # define sa_sigaction __sigaction_handler.sa_sigaction | |
| 44 | #else | |
| 45 | __sighandler_t sa_handler; | |
| 46 | #endif | |
| 47 | /* Additional set of signals to be blocked. */ | |
| 48 | __sigset_t sa_mask; | |
| 49 | ||
| 50 | /* The ABI says here are two unused ints following. */ | |
| 51 | /* Restore handler. */ | |
| 52 | void (*sa_restorer) (void); | |
| 53 | ||
| 54 | #if _MIPS_SZPTR < 64 | |
| 55 | int sa_resv[1]; | |
| 56 | #endif | |
| 57 | }; | |
| 58 | ||
| 59 | /* Bits in `sa_flags'. */ | |
| 60 | /* Please note that some Linux kernels versions use different values for these | |
| 61 | flags which is a bug in those kernel versions. */ | |
| 62 | #define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */ | |
| 63 | #define SA_NOCLDWAIT 0x00010000 /* Don't create zombie on child death. */ | |
| 64 | #define SA_SIGINFO 0x00000008 /* Invoke signal-catching function with | |
| 65 | 				 three arguments instead of one. */ | |
| 66 | #if defined __USE_XOPEN_EXTENDED || defined __USE_MISC | |
| 67 | # define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ | |
| 68 | #endif | |
| 69 | #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 | |
| 70 | # define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ | |
| 71 | # define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ | |
| 72 | # define SA_NODEFER 0x40000000 /* Don't automatically block the signal when | |
| 73 | 				 its handler is being executed. */ | |
| 74 | #endif | |
| 75 | #ifdef __USE_MISC | |
| 76 | # define SA_INTERRUPT 0x20000000 /* Historical no-op. */ | |
| 77 | ||
| 78 | /* Some aliases for the SA_ constants. */ | |
| 79 | # define SA_NOMASK SA_NODEFER | |
| 80 | # define SA_ONESHOT SA_RESETHAND | |
| 81 | # define SA_STACK SA_ONSTACK | |
| 82 | #endif | |
| 83 | ||
| 84 | /* Values for the HOW argument to `sigprocmask'. */ | |
| 85 | #define SIG_NOP	 0		/* 0 is unused to catch errors */ | |
| 86 | #define	SIG_BLOCK 1		/* Block signals. */ | |
| 87 | #define	SIG_UNBLOCK 2		/* Unblock signals. */ | |
| 88 | #define	SIG_SETMASK 3		/* Set the set of blocked signals. */ | |
| 89 | #ifdef __USE_MISC | |
| 90 | # define SIG_SETMASK32 256	/* Goodie from SGI for BSD compatibility: | |
| 91 | 				 set only the low 32 bit of the sigset. */ | |
| 92 | #endif | |
| 93 | ||
| 94 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/sigcontext.h created+82| ... | ... | @@ -0,0 +1,82 @@ |
| 1 | /* Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. | |
| 2 | ||
| 3 | The GNU C Library is free software; you can redistribute it and/or | |
| 4 | modify it under the terms of the GNU Lesser General Public | |
| 5 | License as published by the Free Software Foundation; either | |
| 6 | version 2.1 of the License, or (at your option) any later version. | |
| 7 | ||
| 8 | The GNU C Library is distributed in the hope that it will be useful, | |
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 11 | Lesser General Public License for more details. | |
| 12 | ||
| 13 | You should have received a copy of the GNU Lesser General Public | |
| 14 | License along with the GNU C Library. If not, see | |
| 15 | <https://www.gnu.org/licenses/>. */ | |
| 16 | ||
| 17 | #ifndef _BITS_SIGCONTEXT_H | |
| 18 | #define _BITS_SIGCONTEXT_H 1 | |
| 19 | ||
| 20 | #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H | |
| 21 | # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." | |
| 22 | #endif | |
| 23 | ||
| 24 | #include <sgidefs.h> | |
| 25 | ||
| 26 | #if _MIPS_SIM == _ABIO32 | |
| 27 | ||
| 28 | /* Certain unused fields were replaced with new ones in 2.6.12-rc4. | |
| 29 | The changes were as follows: | |
| 30 | ||
| 31 | sc_cause -> sc_hi1 | |
| 32 | sc_badvaddr -> sc_lo1 | |
| 33 | sc_sigset[0] -> sc_hi2 | |
| 34 | sc_sigset[1] -> sc_lo2 | |
| 35 | sc_sigset[2] -> sc_hi3 | |
| 36 | sc_sigset[3] -> sc_lo3 | |
| 37 | ||
| 38 | sc_regmask, sc_ownedfp and sc_fpc_eir are not used. */ | |
| 39 | struct sigcontext { | |
| 40 | unsigned int sc_regmask; | |
| 41 | unsigned int sc_status; | |
| 42 | __extension__ unsigned long long sc_pc; | |
| 43 | __extension__ unsigned long long sc_regs[32]; | |
| 44 | __extension__ unsigned long long sc_fpregs[32]; | |
| 45 | unsigned int sc_ownedfp; | |
| 46 | unsigned int sc_fpc_csr; | |
| 47 | unsigned int sc_fpc_eir; | |
| 48 | unsigned int sc_used_math; | |
| 49 | unsigned int sc_dsp; | |
| 50 | __extension__ unsigned long long sc_mdhi; | |
| 51 | __extension__ unsigned long long sc_mdlo; | |
| 52 | unsigned long sc_hi1; | |
| 53 | unsigned long sc_lo1; | |
| 54 | unsigned long sc_hi2; | |
| 55 | unsigned long sc_lo2; | |
| 56 | unsigned long sc_hi3; | |
| 57 | unsigned long sc_lo3; | |
| 58 | }; | |
| 59 | ||
| 60 | #else | |
| 61 | ||
| 62 | /* This structure changed in 2.6.12-rc4 when DSP support was added. */ | |
| 63 | struct sigcontext { | |
| 64 | __extension__ unsigned long long sc_regs[32]; | |
| 65 | __extension__ unsigned long long sc_fpregs[32]; | |
| 66 | __extension__ unsigned long long sc_mdhi; | |
| 67 | __extension__ unsigned long long sc_hi1; | |
| 68 | __extension__ unsigned long long sc_hi2; | |
| 69 | __extension__ unsigned long long sc_hi3; | |
| 70 | __extension__ unsigned long long sc_mdlo; | |
| 71 | __extension__ unsigned long long sc_lo1; | |
| 72 | __extension__ unsigned long long sc_lo2; | |
| 73 | __extension__ unsigned long long sc_lo3; | |
| 74 | __extension__ unsigned long long sc_pc; | |
| 75 | unsigned int sc_fpc_csr; | |
| 76 | unsigned int sc_used_math; | |
| 77 | unsigned int sc_dsp; | |
| 78 | unsigned int sc_reserved; | |
| 79 | }; | |
| 80 | ||
| 81 | #endif /* _MIPS_SIM != _ABIO32 */ | |
| 82 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/siginfo-arch.h created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | /* Architecture-specific adjustments to siginfo_t. MIPS version. */ | |
| 2 | #ifndef _BITS_SIGINFO_ARCH_H | |
| 3 | #define _BITS_SIGINFO_ARCH_H 1 | |
| 4 | ||
| 5 | /* MIPS has the si_code and si_errno fields in the opposite order from | |
| 6 | all other architectures. */ | |
| 7 | #define __SI_ERRNO_THEN_CODE 0 | |
| 8 | ||
| 9 | /* MIPS also has different values for SI_ASYNCIO, SI_MESGQ, and SI_TIMER | |
| 10 | than all other architectures. */ | |
| 11 | #define __SI_ASYNCIO_AFTER_SIGIO 0 | |
| 12 | ||
| 13 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/signalfd.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* Copyright (C) 2007-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_SIGNALFD_H | |
| 19 | # error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for signalfd. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | SFD_CLOEXEC = 02000000, | |
| 26 | #define SFD_CLOEXEC SFD_CLOEXEC | |
| 27 | SFD_NONBLOCK = 00000200 | |
| 28 | #define SFD_NONBLOCK SFD_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/signum-arch.h created+65| ... | ... | @@ -0,0 +1,65 @@ |
| 1 | /* Signal number definitions. Linux/MIPS version. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGNUM_H | |
| 20 | #define _BITS_SIGNUM_H 1 | |
| 21 | ||
| 22 | #ifndef _SIGNAL_H | |
| 23 | #error "Never include <bits/signum.h> directly; use <signal.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Adjustments and additions to the signal number constants for | |
| 27 | Linux/MIPS. */ | |
| 28 | ||
| 29 | #define SIGEMT		 7	/* Emulator trap. */ | |
| 30 | #define SIGPWR		19	/* Power failure imminent. */ | |
| 31 | ||
| 32 | /* Historical signals specified by POSIX. */ | |
| 33 | #define SIGBUS 	10	/* Bus error. */ | |
| 34 | #define SIGSYS		12	/* Bad system call. */ | |
| 35 | ||
| 36 | /* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ | |
| 37 | #define SIGURG		21	/* Urgent data is available at a socket. */ | |
| 38 | #define SIGSTOP		23	/* Stop, unblockable. */ | |
| 39 | #define SIGTSTP		24	/* Keyboard stop. */ | |
| 40 | #define SIGCONT		25	/* Continue. */ | |
| 41 | #define SIGCHLD		18	/* Child terminated or stopped. */ | |
| 42 | #define SIGTTIN		26	/* Background read from control terminal. */ | |
| 43 | #define SIGTTOU		27	/* Background write to control terminal. */ | |
| 44 | #define SIGPOLL		22	/* Pollable event occurred (System V). */ | |
| 45 | #define SIGXCPU		30	/* CPU time limit exceeded. */ | |
| 46 | #define SIGVTALRM	28	/* Virtual timer expired. */ | |
| 47 | #define SIGPROF		29	/* Profiling timer expired. */ | |
| 48 | #define SIGXFSZ		31	/* File size limit exceeded. */ | |
| 49 | #define SIGUSR1		16	/* User-defined signal 1. */ | |
| 50 | #define SIGUSR2		17	/* User-defined signal 2. */ | |
| 51 | ||
| 52 | /* Nonstandard signals found in all modern POSIX systems | |
| 53 | (including both BSD and Linux). */ | |
| 54 | #define SIGWINCH	20	/* Window size change (4.3 BSD, Sun). */ | |
| 55 | ||
| 56 | /* Archaic names for compatibility. */ | |
| 57 | #define SIGIO		SIGPOLL	/* I/O now possible (4.2 BSD). */ | |
| 58 | #define SIGIOT		SIGABRT	/* IOT instruction, abort() on a PDP-11. */ | |
| 59 | #define SIGCLD		SIGCHLD /* Old System V name */ | |
| 60 | ||
| 61 | /* By default no real-time signals are supported. */ | |
| 62 | #define __SIGRTMIN	32 | |
| 63 | #define __SIGRTMAX	127 | |
| 64 | ||
| 65 | #endif	/* <signal.h> included. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/socket-constants.h created+70| ... | ... | @@ -0,0 +1,70 @@ |
| 1 | /* Socket constants which vary among Linux architectures. Version for MIPS. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define SOL_SOCKET 65535 | |
| 24 | #define SO_ACCEPTCONN 4105 | |
| 25 | #define SO_BROADCAST 32 | |
| 26 | #define SO_DONTROUTE 16 | |
| 27 | #define SO_ERROR 4103 | |
| 28 | #define SO_KEEPALIVE 8 | |
| 29 | #define SO_LINGER 128 | |
| 30 | #define SO_OOBINLINE 256 | |
| 31 | #define SO_RCVBUF 4098 | |
| 32 | #define SO_RCVLOWAT 4100 | |
| 33 | #define SO_REUSEADDR 4 | |
| 34 | #define SO_SNDBUF 4097 | |
| 35 | #define SO_SNDLOWAT 4099 | |
| 36 | #define SO_TYPE 4104 | |
| 37 | ||
| 38 | #if __TIMESIZE == 64 | |
| 39 | # define SO_RCVTIMEO 4102 | |
| 40 | # define SO_SNDTIMEO 4101 | |
| 41 | # define SO_TIMESTAMP 29 | |
| 42 | # define SO_TIMESTAMPNS 35 | |
| 43 | # define SO_TIMESTAMPING 37 | |
| 44 | #else | |
| 45 | # define SO_RCVTIMEO_OLD 4102 | |
| 46 | # define SO_SNDTIMEO_OLD 4101 | |
| 47 | # define SO_RCVTIMEO_NEW 66 | |
| 48 | # define SO_SNDTIMEO_NEW 67 | |
| 49 | ||
| 50 | # define SO_TIMESTAMP_OLD 29 | |
| 51 | # define SO_TIMESTAMPNS_OLD 35 | |
| 52 | # define SO_TIMESTAMPING_OLD 37 | |
| 53 | # define SO_TIMESTAMP_NEW 63 | |
| 54 | # define SO_TIMESTAMPNS_NEW 64 | |
| 55 | # define SO_TIMESTAMPING_NEW 65 | |
| 56 | ||
| 57 | # ifdef __USE_TIME_BITS64 | |
| 58 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 59 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 60 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 61 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 62 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 63 | # else | |
| 64 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 65 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 66 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 67 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 68 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 69 | # endif | |
| 70 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/socket_type.h created+55| ... | ... | @@ -0,0 +1,55 @@ |
| 1 | /* Define enum __socket_type for Linux/MIPS. | |
| 2 | Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Types of sockets. */ | |
| 24 | enum __socket_type | |
| 25 | { | |
| 26 | SOCK_DGRAM = 1,		/* Connectionless, unreliable datagrams | |
| 27 | 				 of fixed maximum length. */ | |
| 28 | #define SOCK_DGRAM SOCK_DGRAM | |
| 29 | SOCK_STREAM = 2,		/* Sequenced, reliable, connection-based | |
| 30 | 				 byte streams. */ | |
| 31 | #define SOCK_STREAM SOCK_STREAM | |
| 32 | SOCK_RAW = 3,			/* Raw protocol interface. */ | |
| 33 | #define SOCK_RAW SOCK_RAW | |
| 34 | SOCK_RDM = 4,			/* Reliably-delivered messages. */ | |
| 35 | #define SOCK_RDM SOCK_RDM | |
| 36 | SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based, | |
| 37 | 				 datagrams of fixed maximum length. */ | |
| 38 | #define SOCK_SEQPACKET SOCK_SEQPACKET | |
| 39 | SOCK_DCCP = 6, | |
| 40 | #define SOCK_DCCP SOCK_DCCP	/* Datagram Congestion Control Protocol. */ | |
| 41 | SOCK_PACKET = 10,		/* Linux specific way of getting packets | |
| 42 | 				 at the dev level. For writing rarp and | |
| 43 | 				 other similar things on the user level. */ | |
| 44 | #define SOCK_PACKET SOCK_PACKET | |
| 45 | ||
| 46 | /* Flags to be ORed into the type parameter of socket and socketpair and | |
| 47 | used for the flags parameter of paccept. */ | |
| 48 | ||
| 49 | SOCK_CLOEXEC = 02000000,	/* Atomically set close-on-exec flag for the | |
| 50 | 				 new descriptor(s). */ | |
| 51 | #define SOCK_CLOEXEC SOCK_CLOEXEC | |
| 52 | SOCK_NONBLOCK = 00000200	/* Atomically mark descriptor(s) as | |
| 53 | 				 non-blocking. */ | |
| 54 | #define SOCK_NONBLOCK SOCK_NONBLOCK | |
| 55 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/statfs.h created+73| ... | ... | @@ -0,0 +1,73 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_STATFS_H | |
| 19 | # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #include <bits/types.h> /* for __fsid_t and __fsblkcnt_t*/ | |
| 23 | ||
| 24 | struct statfs | |
| 25 | { | |
| 26 | long int f_type; | |
| 27 | #define f_fstyp f_type | |
| 28 | long int f_bsize; | |
| 29 | long int f_frsize;	/* Fragment size - unsupported */ | |
| 30 | #ifndef __USE_FILE_OFFSET64 | |
| 31 | __fsblkcnt_t f_blocks; | |
| 32 | __fsblkcnt_t f_bfree; | |
| 33 | __fsblkcnt_t f_files; | |
| 34 | __fsblkcnt_t f_ffree; | |
| 35 | __fsblkcnt_t f_bavail; | |
| 36 | #else | |
| 37 | __fsblkcnt64_t f_blocks; | |
| 38 | __fsblkcnt64_t f_bfree; | |
| 39 | __fsblkcnt64_t f_files; | |
| 40 | __fsblkcnt64_t f_ffree; | |
| 41 | __fsblkcnt64_t f_bavail; | |
| 42 | #endif | |
| 43 | ||
| 44 | 	/* Linux specials */ | |
| 45 | __fsid_t f_fsid; | |
| 46 | long int f_namelen; | |
| 47 | long int f_flags; | |
| 48 | long int f_spare[5]; | |
| 49 | }; | |
| 50 | ||
| 51 | #ifdef __USE_LARGEFILE64 | |
| 52 | struct statfs64 | |
| 53 | { | |
| 54 | long int f_type; | |
| 55 | #define f_fstyp f_type | |
| 56 | long int f_bsize; | |
| 57 | long int f_frsize;	/* Fragment size - unsupported */ | |
| 58 | __fsblkcnt64_t f_blocks; | |
| 59 | __fsblkcnt64_t f_bfree; | |
| 60 | __fsblkcnt64_t f_files; | |
| 61 | __fsblkcnt64_t f_ffree; | |
| 62 | __fsblkcnt64_t f_bavail; | |
| 63 | ||
| 64 | 	/* Linux specials */ | |
| 65 | __fsid_t f_fsid; | |
| 66 | long int f_namelen; | |
| 67 | long int f_flags; | |
| 68 | long int f_spare[5]; | |
| 69 | }; | |
| 70 | #endif | |
| 71 | ||
| 72 | /* Tell code we have these members. */ | |
| 73 | #define _STATFS_F_NAMELEN | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/struct_mutex.h created+56| ... | ... | @@ -0,0 +1,56 @@ |
| 1 | /* MIPS internal mutex struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _THREAD_MUTEX_INTERNAL_H | |
| 20 | #define _THREAD_MUTEX_INTERNAL_H 1 | |
| 21 | ||
| 22 | struct __pthread_mutex_s | |
| 23 | { | |
| 24 | int __lock; | |
| 25 | unsigned int __count; | |
| 26 | int __owner; | |
| 27 | #if _MIPS_SIM == _ABI64 | |
| 28 | unsigned int __nusers; | |
| 29 | #endif | |
| 30 | /* KIND must stay at this position in the structure to maintain | |
| 31 | binary compatibility with static initializers. */ | |
| 32 | int __kind; | |
| 33 | #if _MIPS_SIM == _ABI64 | |
| 34 | int __spins; | |
| 35 | __pthread_list_t __list; | |
| 36 | # define __PTHREAD_MUTEX_HAVE_PREV 1 | |
| 37 | #else | |
| 38 | unsigned int __nusers; | |
| 39 | __extension__ union | |
| 40 | { | |
| 41 | int __spins; | |
| 42 | __pthread_slist_t __list; | |
| 43 | }; | |
| 44 | # define __PTHREAD_MUTEX_HAVE_PREV 0 | |
| 45 | #endif | |
| 46 | }; | |
| 47 | ||
| 48 | #if _MIPS_SIM == _ABI64 | |
| 49 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 50 | 0, 0, 0, 0, __kind, 0, { 0, 0 } | |
| 51 | #else | |
| 52 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 53 | 0, 0, 0, __kind, 0, { 0 } | |
| 54 | #endif | |
| 55 | ||
| 56 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/termios-c_cc.h created+43| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | /* termios c_cc symbolic constant definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_cc.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_cc characters */ | |
| 24 | #define VINTR		0	/* Interrupt character [ISIG]. */ | |
| 25 | #define VQUIT		1	/* Quit character [ISIG]. */ | |
| 26 | #define VERASE		2	/* Erase character [ICANON]. */ | |
| 27 | #define VKILL		3	/* Kill-line character [ICANON]. */ | |
| 28 | #define VMIN		4	/* Minimum number of bytes read at once [!ICANON]. */ | |
| 29 | #define VTIME		5	/* Time-out value (tenths of a second) [!ICANON]. */ | |
| 30 | #define VEOL2		6	/* Second EOL character [ICANON]. */ | |
| 31 | #define VSWTC		7 | |
| 32 | #define VSWTCH		VSWTC | |
| 33 | #define VSTART		8	/* Start (X-ON) character [IXON, IXOFF]. */ | |
| 34 | #define VSTOP		9	/* Stop (X-OFF) character [IXON, IXOFF]. */ | |
| 35 | #define VSUSP		10	/* Suspend character [ISIG]. */ | |
| 36 | 				/* VDSUSP is not supported on Linux. */ | |
| 37 | /* #define VDSUSP	11	/ * Delayed suspend character [ISIG]. */ | |
| 38 | #define VREPRINT	12	/* Reprint-line character [ICANON]. */ | |
| 39 | #define VDISCARD	13	/* Discard character [IEXTEN]. */ | |
| 40 | #define VWERASE		14	/* Word-erase character [ICANON]. */ | |
| 41 | #define VLNEXT		15	/* Literal-next character [IEXTEN]. */ | |
| 42 | #define VEOF		16	/* End-of-file character [ICANON]. */ | |
| 43 | #define VEOL		17	/* End-of-line character [ICANON]. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/termios-c_lflag.h created+46| ... | ... | @@ -0,0 +1,46 @@ |
| 1 | /* termios local mode definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_lflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_lflag bits */ | |
| 24 | #define ISIG	0000001		/* Enable signals. */ | |
| 25 | #define ICANON	0000002		/* Do erase and kill processing. */ | |
| 26 | #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) | |
| 27 | # define XCASE	0000004 | |
| 28 | #endif | |
| 29 | #define ECHO	0000010		/* Enable echo. */ | |
| 30 | #define ECHOE	0000020		/* Visual erase for ERASE. */ | |
| 31 | #define ECHOK	0000040		/* Echo NL after KILL. */ | |
| 32 | #define ECHONL	0000100		/* Echo NL even if ECHO is off. */ | |
| 33 | #define NOFLSH	0000200		/* Disable flush after interrupt. */ | |
| 34 | #define IEXTEN	0000400		/* Enable DISCARD and LNEXT. */ | |
| 35 | #ifdef __USE_MISC | |
| 36 | # define ECHOCTL 0001000	/* Echo control characters as ^X. */ | |
| 37 | # define ECHOPRT 0002000	/* Hardcopy visual erase. */ | |
| 38 | # define ECHOKE	 0004000	/* Visual erase for KILL. */ | |
| 39 | # define FLUSHO	0020000 | |
| 40 | # define PENDIN	0040000		/* Retype pending input (state). */ | |
| 41 | #endif | |
| 42 | #define TOSTOP	0100000		/* Send SIGTTOU for background output. */ | |
| 43 | #define ITOSTOP	TOSTOP | |
| 44 | #ifdef __USE_MISC | |
| 45 | # define EXTPROC 0200000 | |
| 46 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/termios-struct.h created+34| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | /* struct termios definition. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-struct.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define NCCS 32 | |
| 24 | struct termios | |
| 25 | { | |
| 26 | tcflag_t c_iflag;		/* input mode flags */ | |
| 27 | tcflag_t c_oflag;		/* output mode flags */ | |
| 28 | tcflag_t c_cflag;		/* control mode flags */ | |
| 29 | tcflag_t c_lflag;		/* local mode flags */ | |
| 30 | cc_t c_line;		/* line discipline */ | |
| 31 | cc_t c_cc[NCCS];		/* control characters */ | |
| 32 | #define _HAVE_STRUCT_TERMIOS_C_ISPEED 0 | |
| 33 | #define _HAVE_STRUCT_TERMIOS_C_OSPEED 0 | |
| 34 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/termios-tcflow.h created+26| ... | ... | @@ -0,0 +1,26 @@ |
| 1 | /* termios local mode definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-tcflow.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* tcsetattr uses these */ | |
| 24 | #define	TCSANOW		0x540e	/* Same as TCSETS; change immediately. */ | |
| 25 | #define	TCSADRAIN	0x540f	/* Same as TCSETSW; change when pending output is written. */ | |
| 26 | #define	TCSAFLUSH	0x5410	/* Same as TCSETSF; flush pending input before changing. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/timerfd.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* Copyright (C) 2008-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_TIMERFD_H | |
| 19 | # error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Bits to be set in the FLAGS parameter of `timerfd_create'. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | TFD_CLOEXEC = 02000000, | |
| 26 | #define TFD_CLOEXEC TFD_CLOEXEC | |
| 27 | TFD_NONBLOCK = 00000200 | |
| 28 | #define TFD_NONBLOCK TFD_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/types/stack_t.h created+33| ... | ... | @@ -0,0 +1,33 @@ |
| 1 | /* Define stack_t. MIPS Linux version. | |
| 2 | Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __stack_t_defined | |
| 20 | #define __stack_t_defined 1 | |
| 21 | ||
| 22 | #define __need_size_t | |
| 23 | #include <stddef.h> | |
| 24 | ||
| 25 | /* Structure describing a signal stack. */ | |
| 26 | typedef struct | |
| 27 | { | |
| 28 | void *ss_sp; | |
| 29 | size_t ss_size; | |
| 30 | int ss_flags; | |
| 31 | } stack_t; | |
| 32 | ||
| 33 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_msqid_ds.h created+62| ... | ... | @@ -0,0 +1,62 @@ |
| 1 | /* Linux/MIPS implementation of the SysV message struct msqid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MSG_H | |
| 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 25 | /* Structure of record for one message inside the kernel. | |
| 26 | The type `struct msg' is opaque. */ | |
| 27 | struct msqid_ds | |
| 28 | { | |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ | |
| 33 | # if __TIMESIZE == 32 | |
| 34 | # ifdef __MIPSEL__ | |
| 35 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 36 | unsigned long int __msg_stime_high; | |
| 37 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 38 | unsigned long int __msg_rtime_high; | |
| 39 | __time_t msg_ctime;		/* time of last change */ | |
| 40 | unsigned long int __msg_ctime_high; | |
| 41 | # else | |
| 42 | unsigned long int __msg_stime_high; | |
| 43 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 44 | unsigned long int __msg_rtime_high; | |
| 45 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 46 | unsigned long int __msg_ctime_high; | |
| 47 | __time_t msg_ctime;		/* time of last change */ | |
| 48 | # endif | |
| 49 | # else | |
| 50 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 51 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 52 | __time_t msg_ctime;		/* time of last change */ | |
| 53 | # endif | |
| 54 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ | |
| 55 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ | |
| 56 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ | |
| 57 | __pid_t msg_lspid;		/* pid of last msgsnd() */ | |
| 58 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ | |
| 59 | __syscall_ulong_t __glibc_reserved4; | |
| 60 | __syscall_ulong_t __glibc_reserved5; | |
| 61 | #endif | |
| 62 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_semid_ds.h created+36| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | /* MIPS implementation of the semaphore struct semid_ds | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SEM_H | |
| 20 | # error "Never include <bits/types/struct_semid_ds.h> directly; use <sys/sem.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a set of semaphores. */ | |
| 24 | struct semid_ds | |
| 25 | { | |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 29 | struct ipc_perm sem_perm;		/* operation permission struct */ | |
| 30 | __time_t sem_otime;	/* last semop() time */ | |
| 31 | __time_t sem_ctime;	/* last time changed by semctl() */ | |
| 32 | __syscall_ulong_t sem_nsems;		/* number of semaphores in set */ | |
| 33 | __syscall_ulong_t __sem_otime_high; | |
| 34 | __syscall_ulong_t __sem_ctime_high; | |
| 35 | #endif | |
| 36 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_shmid_ds.h created+53| ... | ... | @@ -0,0 +1,53 @@ |
| 1 | /* Linux/MIPS implementation of the shared memory struct shmid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never include <bits/types/struct_shmid_ds.h> directly; use <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a shared memory segment. */ | |
| 24 | struct shmid_ds | |
| 25 | { | |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 29 | struct ipc_perm shm_perm;		/* operation permission struct */ | |
| 30 | size_t shm_segsz;			/* size of segment in bytes */ | |
| 31 | # if __TIMESIZE == 32 | |
| 32 | __time_t shm_atime;			/* time of last shmat() */ | |
| 33 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 34 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 35 | # else | |
| 36 | __time_t shm_atime;			/* time of last shmat() */ | |
| 37 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 38 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 39 | # endif | |
| 40 | __pid_t shm_cpid;			/* pid of creator */ | |
| 41 | __pid_t shm_lpid;			/* pid of last shmop */ | |
| 42 | shmatt_t shm_nattch;		/* number of current attaches */ | |
| 43 | # if __TIMESIZE == 32 | |
| 44 | unsigned short int __shm_atime_high; | |
| 45 | unsigned short int __shm_dtime_high; | |
| 46 | unsigned short int __shm_ctime_high; | |
| 47 | unsigned short int __glibc_reserved4; | |
| 48 | # else | |
| 49 | __syscall_ulong_t __glibc_reserved5; | |
| 50 | __syscall_ulong_t __glibc_reserved6; | |
| 51 | # endif | |
| 52 | #endif | |
| 53 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabi/ieee754.h created+326| ... | ... | @@ -0,0 +1,326 @@ |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _IEEE754_H | |
| 19 | #define _IEEE754_H 1 | |
| 20 | ||
| 21 | #include <features.h> | |
| 22 | ||
| 23 | #include <bits/endian.h> | |
| 24 | ||
| 25 | #ifndef __LDBL_MANT_DIG__ | |
| 26 | # include <float.h> | |
| 27 | # define __LDBL_MANT_DIG__ LDBL_MANT_DIG | |
| 28 | #endif | |
| 29 | ||
| 30 | __BEGIN_DECLS | |
| 31 | ||
| 32 | union ieee754_float | |
| 33 | { | |
| 34 | float f; | |
| 35 | ||
| 36 | /* This is the IEEE 754 single-precision format. */ | |
| 37 | struct | |
| 38 | { | |
| 39 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 40 | 	unsigned int negative:1; | |
| 41 | 	unsigned int exponent:8; | |
| 42 | 	unsigned int mantissa:23; | |
| 43 | #endif				/* Big endian. */ | |
| 44 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 45 | 	unsigned int mantissa:23; | |
| 46 | 	unsigned int exponent:8; | |
| 47 | 	unsigned int negative:1; | |
| 48 | #endif				/* Little endian. */ | |
| 49 | } ieee; | |
| 50 | ||
| 51 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 52 | struct | |
| 53 | { | |
| 54 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 55 | 	unsigned int negative:1; | |
| 56 | 	unsigned int exponent:8; | |
| 57 | 	unsigned int quiet_nan:1; | |
| 58 | 	unsigned int mantissa:22; | |
| 59 | #endif				/* Big endian. */ | |
| 60 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 61 | 	unsigned int mantissa:22; | |
| 62 | 	unsigned int quiet_nan:1; | |
| 63 | 	unsigned int exponent:8; | |
| 64 | 	unsigned int negative:1; | |
| 65 | #endif				/* Little endian. */ | |
| 66 | } ieee_nan; | |
| 67 | }; | |
| 68 | ||
| 69 | #define IEEE754_FLOAT_BIAS	0x7f /* Added to exponent. */ | |
| 70 | ||
| 71 | ||
| 72 | union ieee754_double | |
| 73 | { | |
| 74 | double d; | |
| 75 | ||
| 76 | /* This is the IEEE 754 double-precision format. */ | |
| 77 | struct | |
| 78 | { | |
| 79 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 80 | 	unsigned int negative:1; | |
| 81 | 	unsigned int exponent:11; | |
| 82 | 	/* Together these comprise the mantissa. */ | |
| 83 | 	unsigned int mantissa0:20; | |
| 84 | 	unsigned int mantissa1:32; | |
| 85 | #endif				/* Big endian. */ | |
| 86 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 87 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 88 | 	unsigned int mantissa0:20; | |
| 89 | 	unsigned int exponent:11; | |
| 90 | 	unsigned int negative:1; | |
| 91 | 	unsigned int mantissa1:32; | |
| 92 | # else | |
| 93 | 	/* Together these comprise the mantissa. */ | |
| 94 | 	unsigned int mantissa1:32; | |
| 95 | 	unsigned int mantissa0:20; | |
| 96 | 	unsigned int exponent:11; | |
| 97 | 	unsigned int negative:1; | |
| 98 | # endif | |
| 99 | #endif				/* Little endian. */ | |
| 100 | } ieee; | |
| 101 | ||
| 102 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 103 | struct | |
| 104 | { | |
| 105 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 106 | 	unsigned int negative:1; | |
| 107 | 	unsigned int exponent:11; | |
| 108 | 	unsigned int quiet_nan:1; | |
| 109 | 	/* Together these comprise the mantissa. */ | |
| 110 | 	unsigned int mantissa0:19; | |
| 111 | 	unsigned int mantissa1:32; | |
| 112 | #else | |
| 113 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 114 | 	unsigned int mantissa0:19; | |
| 115 | 	unsigned int quiet_nan:1; | |
| 116 | 	unsigned int exponent:11; | |
| 117 | 	unsigned int negative:1; | |
| 118 | 	unsigned int mantissa1:32; | |
| 119 | # else | |
| 120 | 	/* Together these comprise the mantissa. */ | |
| 121 | 	unsigned int mantissa1:32; | |
| 122 | 	unsigned int mantissa0:19; | |
| 123 | 	unsigned int quiet_nan:1; | |
| 124 | 	unsigned int exponent:11; | |
| 125 | 	unsigned int negative:1; | |
| 126 | # endif | |
| 127 | #endif | |
| 128 | } ieee_nan; | |
| 129 | }; | |
| 130 | ||
| 131 | #define IEEE754_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 132 | ||
| 133 | #if __LDBL_MANT_DIG__ == 113 | |
| 134 | ||
| 135 | union ieee854_long_double | |
| 136 | { | |
| 137 | long double d; | |
| 138 | ||
| 139 | /* This is the IEEE 854 quad-precision format. */ | |
| 140 | struct | |
| 141 | { | |
| 142 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 143 | 	unsigned int negative:1; | |
| 144 | 	unsigned int exponent:15; | |
| 145 | 	/* Together these comprise the mantissa. */ | |
| 146 | 	unsigned int mantissa0:16; | |
| 147 | 	unsigned int mantissa1:32; | |
| 148 | 	unsigned int mantissa2:32; | |
| 149 | 	unsigned int mantissa3:32; | |
| 150 | #endif				/* Big endian. */ | |
| 151 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 152 | 	/* Together these comprise the mantissa. */ | |
| 153 | 	unsigned int mantissa3:32; | |
| 154 | 	unsigned int mantissa2:32; | |
| 155 | 	unsigned int mantissa1:32; | |
| 156 | 	unsigned int mantissa0:16; | |
| 157 | 	unsigned int exponent:15; | |
| 158 | 	unsigned int negative:1; | |
| 159 | #endif				/* Little endian. */ | |
| 160 | } ieee; | |
| 161 | ||
| 162 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 163 | struct | |
| 164 | { | |
| 165 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 166 | 	unsigned int negative:1; | |
| 167 | 	unsigned int exponent:15; | |
| 168 | 	unsigned int quiet_nan:1; | |
| 169 | 	/* Together these comprise the mantissa. */ | |
| 170 | 	unsigned int mantissa0:15; | |
| 171 | 	unsigned int mantissa1:32; | |
| 172 | 	unsigned int mantissa2:32; | |
| 173 | 	unsigned int mantissa3:32; | |
| 174 | #endif				/* Big endian. */ | |
| 175 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 176 | 	/* Together these comprise the mantissa. */ | |
| 177 | 	unsigned int mantissa3:32; | |
| 178 | 	unsigned int mantissa2:32; | |
| 179 | 	unsigned int mantissa1:32; | |
| 180 | 	unsigned int mantissa0:15; | |
| 181 | 	unsigned int quiet_nan:1; | |
| 182 | 	unsigned int exponent:15; | |
| 183 | 	unsigned int negative:1; | |
| 184 | #endif				/* Little endian. */ | |
| 185 | } ieee_nan; | |
| 186 | }; | |
| 187 | ||
| 188 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ | |
| 189 | ||
| 190 | #elif __LDBL_MANT_DIG__ == 64 | |
| 191 | ||
| 192 | union ieee854_long_double | |
| 193 | { | |
| 194 | long double d; | |
| 195 | ||
| 196 | /* This is the IEEE 854 double-extended-precision format. */ | |
| 197 | struct | |
| 198 | { | |
| 199 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 200 | 	unsigned int negative:1; | |
| 201 | 	unsigned int exponent:15; | |
| 202 | 	unsigned int empty:16; | |
| 203 | 	unsigned int mantissa0:32; | |
| 204 | 	unsigned int mantissa1:32; | |
| 205 | #endif | |
| 206 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 207 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 208 | 	unsigned int exponent:15; | |
| 209 | 	unsigned int negative:1; | |
| 210 | 	unsigned int empty:16; | |
| 211 | 	unsigned int mantissa0:32; | |
| 212 | 	unsigned int mantissa1:32; | |
| 213 | # else | |
| 214 | 	unsigned int mantissa1:32; | |
| 215 | 	unsigned int mantissa0:32; | |
| 216 | 	unsigned int exponent:15; | |
| 217 | 	unsigned int negative:1; | |
| 218 | 	unsigned int empty:16; | |
| 219 | # endif | |
| 220 | #endif | |
| 221 | } ieee; | |
| 222 | ||
| 223 | /* This is for NaNs in the IEEE 854 double-extended-precision format. */ | |
| 224 | struct | |
| 225 | { | |
| 226 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 227 | 	unsigned int negative:1; | |
| 228 | 	unsigned int exponent:15; | |
| 229 | 	unsigned int empty:16; | |
| 230 | 	unsigned int one:1; | |
| 231 | 	unsigned int quiet_nan:1; | |
| 232 | 	unsigned int mantissa0:30; | |
| 233 | 	unsigned int mantissa1:32; | |
| 234 | #endif | |
| 235 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 236 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 237 | 	unsigned int exponent:15; | |
| 238 | 	unsigned int negative:1; | |
| 239 | 	unsigned int empty:16; | |
| 240 | 	unsigned int mantissa0:30; | |
| 241 | 	unsigned int quiet_nan:1; | |
| 242 | 	unsigned int one:1; | |
| 243 | 	unsigned int mantissa1:32; | |
| 244 | # else | |
| 245 | 	unsigned int mantissa1:32; | |
| 246 | 	unsigned int mantissa0:30; | |
| 247 | 	unsigned int quiet_nan:1; | |
| 248 | 	unsigned int one:1; | |
| 249 | 	unsigned int exponent:15; | |
| 250 | 	unsigned int negative:1; | |
| 251 | 	unsigned int empty:16; | |
| 252 | # endif | |
| 253 | #endif | |
| 254 | } ieee_nan; | |
| 255 | }; | |
| 256 | ||
| 257 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff | |
| 258 | ||
| 259 | #elif __LDBL_MANT_DIG__ == 53 | |
| 260 | ||
| 261 | union ieee854_long_double | |
| 262 | { | |
| 263 | long double d; | |
| 264 | ||
| 265 | /* This is the IEEE 754 double-precision format. */ | |
| 266 | struct | |
| 267 | { | |
| 268 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 269 | 	unsigned int negative:1; | |
| 270 | 	unsigned int exponent:11; | |
| 271 | 	/* Together these comprise the mantissa. */ | |
| 272 | 	unsigned int mantissa0:20; | |
| 273 | 	unsigned int mantissa1:32; | |
| 274 | #endif				/* Big endian. */ | |
| 275 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 276 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 277 | 	unsigned int mantissa0:20; | |
| 278 | 	unsigned int exponent:11; | |
| 279 | 	unsigned int negative:1; | |
| 280 | 	unsigned int mantissa1:32; | |
| 281 | # else | |
| 282 | 	/* Together these comprise the mantissa. */ | |
| 283 | 	unsigned int mantissa1:32; | |
| 284 | 	unsigned int mantissa0:20; | |
| 285 | 	unsigned int exponent:11; | |
| 286 | 	unsigned int negative:1; | |
| 287 | # endif | |
| 288 | #endif				/* Little endian. */ | |
| 289 | } ieee; | |
| 290 | ||
| 291 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 292 | struct | |
| 293 | { | |
| 294 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 295 | 	unsigned int negative:1; | |
| 296 | 	unsigned int exponent:11; | |
| 297 | 	unsigned int quiet_nan:1; | |
| 298 | 	/* Together these comprise the mantissa. */ | |
| 299 | 	unsigned int mantissa0:19; | |
| 300 | 	unsigned int mantissa1:32; | |
| 301 | #else | |
| 302 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 303 | 	unsigned int mantissa0:19; | |
| 304 | 	unsigned int quiet_nan:1; | |
| 305 | 	unsigned int exponent:11; | |
| 306 | 	unsigned int negative:1; | |
| 307 | 	unsigned int mantissa1:32; | |
| 308 | # else | |
| 309 | 	/* Together these comprise the mantissa. */ | |
| 310 | 	unsigned int mantissa1:32; | |
| 311 | 	unsigned int mantissa0:19; | |
| 312 | 	unsigned int quiet_nan:1; | |
| 313 | 	unsigned int exponent:11; | |
| 314 | 	unsigned int negative:1; | |
| 315 | # endif | |
| 316 | #endif | |
| 317 | } ieee_nan; | |
| 318 | }; | |
| 319 | ||
| 320 | #define IEEE854_LONG_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 321 | ||
| 322 | #endif /* __LDBL_MANT_DIG__ == 53 */ | |
| 323 | ||
| 324 | __END_DECLS | |
| 325 | ||
| 326 | #endif /* ieee754.h */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/dlfcn.h created+64| ... | ... | @@ -0,0 +1,64 @@ |
| 1 | /* System dependent definitions for run-time dynamic loading. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _DLFCN_H | |
| 20 | # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The MODE argument to `dlopen' contains one of the following: */ | |
| 24 | #define RTLD_LAZY	0x0001	/* Lazy function call binding. */ | |
| 25 | #define RTLD_NOW	0x0002	/* Immediate function call binding. */ | |
| 26 | #define RTLD_BINDING_MASK 0x3	/* Mask of binding time value. */ | |
| 27 | #define RTLD_NOLOAD	0x00008	/* Do not load the object. */ | |
| 28 | #define RTLD_DEEPBIND	0x00010	/* Use deep binding. */ | |
| 29 | ||
| 30 | /* If the following bit is set in the MODE argument to `dlopen', | |
| 31 | the symbols of the loaded object and its dependencies are made | |
| 32 | visible as if the object were linked directly into the program. */ | |
| 33 | #define RTLD_GLOBAL	0x0004 | |
| 34 | ||
| 35 | /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. | |
| 36 | The implementation does this by default and so we can define the | |
| 37 | value to zero. */ | |
| 38 | #define RTLD_LOCAL 0 | |
| 39 | ||
| 40 | /* Do not delete object when closed. */ | |
| 41 | #define RTLD_NODELETE	0x01000 | |
| 42 | ||
| 43 | #ifdef __USE_GNU | |
| 44 | /* To support profiling of shared objects it is a good idea to call | |
| 45 | the function found using `dlsym' using the following macro since | |
| 46 | these calls do not use the PLT. But this would mean the dynamic | |
| 47 | loader has no chance to find out when the function is called. The | |
| 48 | macro applies the necessary magic so that profiling is possible. | |
| 49 | Rewrite | |
| 50 | 	foo = (*fctp) (arg1, arg2); | |
| 51 | into | |
| 52 | foo = DL_CALL_FCT (fctp, (arg1, arg2)); | |
| 53 | */ | |
| 54 | # define DL_CALL_FCT(fctp, args) \ | |
| 55 | (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args) | |
| 56 | ||
| 57 | __BEGIN_DECLS | |
| 58 | ||
| 59 | /* This function calls the profiling functions. */ | |
| 60 | extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW; | |
| 61 | ||
| 62 | __END_DECLS | |
| 63 | ||
| 64 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/errno.h created+52| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | /* Error constants. MIPS/Linux specific version. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_ERRNO_H | |
| 20 | ||
| 21 | #if !defined _ERRNO_H | |
| 22 | # error "Never include <bits/errno.h> directly; use <errno.h> instead." | |
| 23 | #endif | |
| 24 | ||
| 25 | # include <linux/errno.h> | |
| 26 | ||
| 27 | /* Older Linux headers do not define these constants. */ | |
| 28 | # ifndef ENOTSUP | |
| 29 | # define ENOTSUP		EOPNOTSUPP | |
| 30 | # endif | |
| 31 | ||
| 32 | # ifndef ECANCELED | |
| 33 | # define ECANCELED		158 | |
| 34 | # endif | |
| 35 | ||
| 36 | # ifndef EOWNERDEAD | |
| 37 | # define EOWNERDEAD		165 | |
| 38 | # endif | |
| 39 | ||
| 40 | # ifndef ENOTRECOVERABLE | |
| 41 | # define ENOTRECOVERABLE	166 | |
| 42 | # endif | |
| 43 | ||
| 44 | # ifndef ERFKILL | |
| 45 | # define ERFKILL		167 | |
| 46 | # endif | |
| 47 | ||
| 48 | # ifndef EHWPOISON | |
| 49 | # define EHWPOISON		168 | |
| 50 | # endif | |
| 51 | ||
| 52 | #endif /* bits/errno.h. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/eventfd.h created+31| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | /* Copyright (C) 2007-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_EVENTFD_H | |
| 19 | # error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for eventfd. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | EFD_SEMAPHORE = 00000001, | |
| 26 | #define EFD_SEMAPHORE EFD_SEMAPHORE | |
| 27 | EFD_CLOEXEC = 02000000, | |
| 28 | #define EFD_CLOEXEC EFD_CLOEXEC | |
| 29 | EFD_NONBLOCK = 00000200 | |
| 30 | #define EFD_NONBLOCK EFD_NONBLOCK | |
| 31 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/inotify.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_INOTIFY_H | |
| 19 | # error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for the parameter of inotify_init1. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | IN_CLOEXEC = 02000000, | |
| 26 | #define IN_CLOEXEC IN_CLOEXEC | |
| 27 | IN_NONBLOCK = 00000200 | |
| 28 | #define IN_NONBLOCK IN_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/ioctl-types.h created+75| ... | ... | @@ -0,0 +1,75 @@ |
| 1 | /* Structure types for pre-termios terminal ioctls. Linux/MIPS version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_IOCTL_H | |
| 20 | # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Get definition of constants for use with `ioctl'. */ | |
| 24 | #include <asm/ioctls.h> | |
| 25 | ||
| 26 | struct winsize | |
| 27 | { | |
| 28 | unsigned short int ws_row; | |
| 29 | unsigned short int ws_col; | |
| 30 | unsigned short int ws_xpixel; | |
| 31 | unsigned short int ws_ypixel; | |
| 32 | }; | |
| 33 | ||
| 34 | #define NCC	8 | |
| 35 | struct termio | |
| 36 | { | |
| 37 | unsigned short int c_iflag;		/* input mode flags */ | |
| 38 | unsigned short int c_oflag;		/* output mode flags */ | |
| 39 | unsigned short int c_cflag;		/* control mode flags */ | |
| 40 | unsigned short int c_lflag;		/* local mode flags */ | |
| 41 | char c_line;			/* line discipline */ | |
| 42 | /* Yes, this is really NCCS. */ | |
| 43 | unsigned char c_cc[32 /* NCCS */]; /* control characters */ | |
| 44 | }; | |
| 45 | ||
| 46 | /* modem lines */ | |
| 47 | #define TIOCM_LE	0x001		/* line enable */ | |
| 48 | #define TIOCM_DTR	0x002		/* data terminal ready */ | |
| 49 | #define TIOCM_RTS	0x004		/* request to send */ | |
| 50 | #define TIOCM_ST	0x010		/* secondary transmit */ | |
| 51 | #define TIOCM_SR	0x020		/* secondary receive */ | |
| 52 | #define TIOCM_CTS	0x040		/* clear to send */ | |
| 53 | #define TIOCM_CAR	0x100		/* carrier detect */ | |
| 54 | #define TIOCM_CD	TIOCM_CAR | |
| 55 | #define TIOCM_RNG	0x200		/* ring */ | |
| 56 | #define TIOCM_RI	TIOCM_RNG | |
| 57 | #define TIOCM_DSR	0x400		/* data set ready */ | |
| 58 | ||
| 59 | /* line disciplines */ | |
| 60 | #define N_TTY		0 | |
| 61 | #define N_SLIP		1 | |
| 62 | #define N_MOUSE		2 | |
| 63 | #define N_PPP		3 | |
| 64 | #define N_STRIP		4 | |
| 65 | #define N_AX25		5 | |
| 66 | #define N_X25		6	/* X.25 async */ | |
| 67 | #define N_6PACK		7 | |
| 68 | #define N_MASC		8	/* Mobitex module */ | |
| 69 | #define N_R3964		9	/* Simatic R3964 module */ | |
| 70 | #define N_PROFIBUS_FDL	10	/* Profibus */ | |
| 71 | #define N_IRDA		11	/* Linux IR */ | |
| 72 | #define N_SMSBLOCK	12	/* SMS block mode */ | |
| 73 | #define N_HDLC		13	/* synchronous HDLC */ | |
| 74 | #define N_SYNC_PPP	14	/* synchronous PPP */ | |
| 75 | #define	N_HCI		15	/* Bluetooth HCI UART */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/ipctypes.h created+31| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | /* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. MIPS version | |
| 2 | Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* | |
| 20 | * Never include <bits/ipctypes.h> directly. | |
| 21 | */ | |
| 22 | ||
| 23 | #ifndef _BITS_IPCTYPES_H | |
| 24 | #define _BITS_IPCTYPES_H	1 | |
| 25 | ||
| 26 | #include <bits/types.h> | |
| 27 | ||
| 28 | typedef __SLONG32_TYPE __ipc_pid_t; | |
| 29 | ||
| 30 | ||
| 31 | #endif /* bits/ipctypes.h */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/mman.h created+48| ... | ... | @@ -0,0 +1,48 @@ |
| 1 | /* Definitions for POSIX memory map interface. Linux/MIPS version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MMAN_H | |
| 20 | # error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The following definitions basically come from the kernel headers. | |
| 24 | But the kernel header is not namespace clean. */ | |
| 25 | ||
| 26 | /* These are Linux-specific. */ | |
| 27 | #ifdef __USE_MISC | |
| 28 | # define MAP_NORESERVE	0x0400		/* don't check for reservations */ | |
| 29 | # define MAP_GROWSDOWN	0x1000		/* stack-like segment */ | |
| 30 | # define MAP_DENYWRITE	0x2000		/* ETXTBSY */ | |
| 31 | # define MAP_EXECUTABLE	0x4000		/* mark it as an executable */ | |
| 32 | # define MAP_LOCKED	0x8000		/* pages are locked */ | |
| 33 | # define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ | |
| 34 | # define MAP_NONBLOCK 0x20000 /* do not block on IO */ | |
| 35 | # define MAP_STACK	0x40000		/* Allocation is for a stack. */ | |
| 36 | # define MAP_HUGETLB	0x80000		/* Create huge page mapping. */ | |
| 37 | # define MAP_FIXED_NOREPLACE 0x100000	/* MAP_FIXED but do not unmap | |
| 38 | 					 underlying mapping. */ | |
| 39 | #endif | |
| 40 | ||
| 41 | #define __MAP_ANONYMOUS 0x0800 | |
| 42 | ||
| 43 | /* Include generic Linux declarations. */ | |
| 44 | #include <bits/mman-linux.h> | |
| 45 | ||
| 46 | #ifdef __USE_MISC | |
| 47 | # define MAP_RENAME	MAP_ANONYMOUS | |
| 48 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/poll.h created+49| ... | ... | @@ -0,0 +1,49 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_POLL_H | |
| 19 | # error "Never use <bits/poll.h> directly; include <sys/poll.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Event types that can be polled for. These bits may be set in `events' | |
| 23 | to indicate the interesting event types; they will appear in `revents' | |
| 24 | to indicate the status of the file descriptor. */ | |
| 25 | #define POLLIN		0x001		/* There is data to read. */ | |
| 26 | #define POLLPRI		0x002		/* There is urgent data to read. */ | |
| 27 | #define POLLOUT		0x004		/* Writing now will not block. */ | |
| 28 | ||
| 29 | #if defined __USE_XOPEN || defined __USE_XOPEN2K8 | |
| 30 | /* These values are defined in XPG4.2. */ | |
| 31 | # define POLLRDNORM	0x040		/* Normal data may be read. */ | |
| 32 | # define POLLRDBAND	0x080		/* Priority data may be read. */ | |
| 33 | # define POLLWRNORM	POLLOUT		/* Writing now will not block. */ | |
| 34 | # define POLLWRBAND	0x100		/* Priority data may be written. */ | |
| 35 | #endif | |
| 36 | ||
| 37 | #ifdef __USE_GNU | |
| 38 | /* These are extensions for Linux. */ | |
| 39 | # define POLLMSG	0x400 | |
| 40 | # define POLLREMOVE	0x1000 | |
| 41 | # define POLLRDHUP	0x2000 | |
| 42 | #endif | |
| 43 | ||
| 44 | /* Event types always implicitly polled for. These bits need not be set in | |
| 45 | `events', but they will appear in `revents' to indicate the status of | |
| 46 | the file descriptor. */ | |
| 47 | #define POLLERR		0x008		/* Error condition. */ | |
| 48 | #define POLLHUP		0x010		/* Hung up. */ | |
| 49 | #define POLLNVAL	0x020		/* Invalid polling request. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/pthread_stack_min.h created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. MIPS Linux version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. At least two pages with 64k pages. */ | |
| 20 | #define PTHREAD_STACK_MIN	131072 | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/pthreadtypes-arch.h created+44| ... | ... | @@ -0,0 +1,44 @@ |
| 1 | /* Machine-specific pthread type layouts. MIPS version. | |
| 2 | Copyright (C) 2005-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_PTHREADTYPES_ARCH_H | |
| 20 | #define _BITS_PTHREADTYPES_ARCH_H	1 | |
| 21 | ||
| 22 | #include <bits/endian.h> | |
| 23 | ||
| 24 | #if _MIPS_SIM == _ABI64 | |
| 25 | # define __SIZEOF_PTHREAD_ATTR_T 56 | |
| 26 | # define __SIZEOF_PTHREAD_MUTEX_T 40 | |
| 27 | # define __SIZEOF_PTHREAD_RWLOCK_T 56 | |
| 28 | # define __SIZEOF_PTHREAD_BARRIER_T 32 | |
| 29 | #else | |
| 30 | # define __SIZEOF_PTHREAD_ATTR_T 36 | |
| 31 | # define __SIZEOF_PTHREAD_MUTEX_T 24 | |
| 32 | # define __SIZEOF_PTHREAD_RWLOCK_T 32 | |
| 33 | # define __SIZEOF_PTHREAD_BARRIER_T 20 | |
| 34 | #endif | |
| 35 | #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 | |
| 36 | #define __SIZEOF_PTHREAD_COND_T 48 | |
| 37 | #define __SIZEOF_PTHREAD_CONDATTR_T 4 | |
| 38 | #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 | |
| 39 | #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 | |
| 40 | ||
| 41 | #define __LOCK_ALIGNMENT | |
| 42 | #define __ONCE_ALIGNMENT | |
| 43 | ||
| 44 | #endif	/* bits/pthreadtypes.h */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/resource.h created+231| ... | ... | @@ -0,0 +1,231 @@ |
| 1 | /* Bit values & structures for resource limits. Linux/MIPS version. | |
| 2 | Copyright (C) 1994-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_RESOURCE_H | |
| 20 | # error "Never use <bits/resource.h> directly; include <sys/resource.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/types.h> | |
| 24 | ||
| 25 | /* Transmute defines to enumerations. The macro re-definitions are | |
| 26 | necessary because some programs want to test for operating system | |
| 27 | features with #ifdef RUSAGE_SELF. In ISO C the reflexive | |
| 28 | definition is a no-op. */ | |
| 29 | ||
| 30 | /* Kinds of resource limit. */ | |
| 31 | enum __rlimit_resource | |
| 32 | { | |
| 33 | /* Per-process CPU limit, in seconds. */ | |
| 34 | RLIMIT_CPU = 0, | |
| 35 | #define RLIMIT_CPU RLIMIT_CPU | |
| 36 | ||
| 37 | /* Largest file that can be created, in bytes. */ | |
| 38 | RLIMIT_FSIZE = 1, | |
| 39 | #define	RLIMIT_FSIZE RLIMIT_FSIZE | |
| 40 | ||
| 41 | /* Maximum size of data segment, in bytes. */ | |
| 42 | RLIMIT_DATA = 2, | |
| 43 | #define	RLIMIT_DATA RLIMIT_DATA | |
| 44 | ||
| 45 | /* Maximum size of stack segment, in bytes. */ | |
| 46 | RLIMIT_STACK = 3, | |
| 47 | #define	RLIMIT_STACK RLIMIT_STACK | |
| 48 | ||
| 49 | /* Largest core file that can be created, in bytes. */ | |
| 50 | RLIMIT_CORE = 4, | |
| 51 | #define	RLIMIT_CORE RLIMIT_CORE | |
| 52 | ||
| 53 | /* Largest resident set size, in bytes. | |
| 54 | This affects swapping; processes that are exceeding their | |
| 55 | resident set size will be more likely to have physical memory | |
| 56 | taken from them. */ | |
| 57 | __RLIMIT_RSS = 7, | |
| 58 | #define	RLIMIT_RSS __RLIMIT_RSS | |
| 59 | ||
| 60 | /* Number of open files. */ | |
| 61 | RLIMIT_NOFILE = 5, | |
| 62 | __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ | |
| 63 | #define RLIMIT_NOFILE RLIMIT_NOFILE | |
| 64 | #define RLIMIT_OFILE __RLIMIT_OFILE | |
| 65 | ||
| 66 | /* Address space limit (?) */ | |
| 67 | RLIMIT_AS = 6, | |
| 68 | #define RLIMIT_AS RLIMIT_AS | |
| 69 | ||
| 70 | /* Number of processes. */ | |
| 71 | __RLIMIT_NPROC = 8, | |
| 72 | #define RLIMIT_NPROC __RLIMIT_NPROC | |
| 73 | ||
| 74 | /* Locked-in-memory address space. */ | |
| 75 | __RLIMIT_MEMLOCK = 9, | |
| 76 | #define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK | |
| 77 | ||
| 78 | /* Maximum number of file locks. */ | |
| 79 | __RLIMIT_LOCKS = 10, | |
| 80 | #define RLIMIT_LOCKS __RLIMIT_LOCKS | |
| 81 | ||
| 82 | /* Maximum number of pending signals. */ | |
| 83 | __RLIMIT_SIGPENDING = 11, | |
| 84 | #define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING | |
| 85 | ||
| 86 | /* Maximum bytes in POSIX message queues. */ | |
| 87 | __RLIMIT_MSGQUEUE = 12, | |
| 88 | #define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE | |
| 89 | ||
| 90 | /* Maximum nice priority allowed to raise to. | |
| 91 | Nice levels 19 .. -20 correspond to 0 .. 39 | |
| 92 | values of this resource limit. */ | |
| 93 | __RLIMIT_NICE = 13, | |
| 94 | #define RLIMIT_NICE __RLIMIT_NICE | |
| 95 | ||
| 96 | /* Maximum realtime priority allowed for non-priviledged | |
| 97 | processes. */ | |
| 98 | __RLIMIT_RTPRIO = 14, | |
| 99 | #define RLIMIT_RTPRIO __RLIMIT_RTPRIO | |
| 100 | ||
| 101 | /* Maximum CPU time in microseconds that a process scheduled under a real-time | |
| 102 | scheduling policy may consume without making a blocking system | |
| 103 | call before being forcibly descheduled. */ | |
| 104 | __RLIMIT_RTTIME = 15, | |
| 105 | #define RLIMIT_RTTIME __RLIMIT_RTTIME | |
| 106 | ||
| 107 | __RLIMIT_NLIMITS = 16, | |
| 108 | __RLIM_NLIMITS = __RLIMIT_NLIMITS | |
| 109 | #define RLIMIT_NLIMITS __RLIMIT_NLIMITS | |
| 110 | #define RLIM_NLIMITS __RLIM_NLIMITS | |
| 111 | }; | |
| 112 | ||
| 113 | /* Value to indicate that there is no limit. */ | |
| 114 | #if _MIPS_SIM == _ABI64 | |
| 115 | /* The N64 syscall uses this value. */ | |
| 116 | # define RLIM_INFINITY 0xffffffffffffffffUL | |
| 117 | # ifdef __USE_LARGEFILE64 | |
| 118 | # define RLIM64_INFINITY 0xffffffffffffffffUL | |
| 119 | # endif | |
| 120 | #else | |
| 121 | /* The O32 and N32 syscalls use 0x7fffffff. */ | |
| 122 | # ifndef __USE_FILE_OFFSET64 | |
| 123 | # define RLIM_INFINITY ((long int)(~0UL >> 1)) | |
| 124 | # else | |
| 125 | # define RLIM_INFINITY 0xffffffffffffffffULL | |
| 126 | # endif | |
| 127 | # ifdef __USE_LARGEFILE64 | |
| 128 | # define RLIM64_INFINITY 0xffffffffffffffffULL | |
| 129 | # endif | |
| 130 | #endif | |
| 131 | ||
| 132 | /* We can represent all limits. */ | |
| 133 | #define RLIM_SAVED_MAX	RLIM_INFINITY | |
| 134 | #define RLIM_SAVED_CUR	RLIM_INFINITY | |
| 135 | ||
| 136 | ||
| 137 | /* Type for resource quantity measurement. */ | |
| 138 | #ifndef __USE_FILE_OFFSET64 | |
| 139 | typedef __rlim_t rlim_t; | |
| 140 | #else | |
| 141 | typedef __rlim64_t rlim_t; | |
| 142 | #endif | |
| 143 | #ifdef __USE_LARGEFILE64 | |
| 144 | typedef __rlim64_t rlim64_t; | |
| 145 | #endif | |
| 146 | ||
| 147 | struct rlimit | |
| 148 | { | |
| 149 | /* The current (soft) limit. */ | |
| 150 | rlim_t rlim_cur; | |
| 151 | /* The hard limit. */ | |
| 152 | rlim_t rlim_max; | |
| 153 | }; | |
| 154 | ||
| 155 | #ifdef __USE_LARGEFILE64 | |
| 156 | struct rlimit64 | |
| 157 | { | |
| 158 | /* The current (soft) limit. */ | |
| 159 | rlim64_t rlim_cur; | |
| 160 | /* The hard limit. */ | |
| 161 | rlim64_t rlim_max; | |
| 162 | }; | |
| 163 | #endif | |
| 164 | ||
| 165 | /* Whose usage statistics do you want? */ | |
| 166 | enum __rusage_who | |
| 167 | { | |
| 168 | /* The calling process. */ | |
| 169 | RUSAGE_SELF = 0, | |
| 170 | #define RUSAGE_SELF RUSAGE_SELF | |
| 171 | ||
| 172 | /* All of its terminated child processes. */ | |
| 173 | RUSAGE_CHILDREN = -1 | |
| 174 | #define RUSAGE_CHILDREN RUSAGE_CHILDREN | |
| 175 | ||
| 176 | #ifdef __USE_GNU | |
| 177 | , | |
| 178 | /* The calling thread. */ | |
| 179 | RUSAGE_THREAD = 1 | |
| 180 | # define RUSAGE_THREAD RUSAGE_THREAD | |
| 181 | /* Name for the same functionality on Solaris. */ | |
| 182 | # define RUSAGE_LWP RUSAGE_THREAD | |
| 183 | #endif | |
| 184 | }; | |
| 185 | ||
| 186 | #include <bits/types/struct_timeval.h> | |
| 187 | #include <bits/types/struct_rusage.h> | |
| 188 | ||
| 189 | /* Priority limits. */ | |
| 190 | #define PRIO_MIN	-20	/* Minimum priority a process can have. */ | |
| 191 | #define PRIO_MAX	20	/* Maximum priority a process can have. */ | |
| 192 | ||
| 193 | /* The type of the WHICH argument to `getpriority' and `setpriority', | |
| 194 | indicating what flavor of entity the WHO argument specifies. */ | |
| 195 | enum __priority_which | |
| 196 | { | |
| 197 | PRIO_PROCESS = 0,		/* WHO is a process ID. */ | |
| 198 | #define PRIO_PROCESS PRIO_PROCESS | |
| 199 | PRIO_PGRP = 1,		/* WHO is a process group ID. */ | |
| 200 | #define PRIO_PGRP PRIO_PGRP | |
| 201 | PRIO_USER = 2			/* WHO is a user ID. */ | |
| 202 | #define PRIO_USER PRIO_USER | |
| 203 | }; | |
| 204 | ||
| 205 | ||
| 206 | __BEGIN_DECLS | |
| 207 | ||
| 208 | #ifdef __USE_GNU | |
| 209 | /* Modify and return resource limits of a process atomically. */ | |
| 210 | # ifndef __USE_FILE_OFFSET64 | |
| 211 | extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, | |
| 212 | 		 const struct rlimit *__new_limit, | |
| 213 | 		 struct rlimit *__old_limit) __THROW; | |
| 214 | # else | |
| 215 | # ifdef __REDIRECT_NTH | |
| 216 | extern int __REDIRECT_NTH (prlimit, (__pid_t __pid, | |
| 217 | 				 enum __rlimit_resource __resource, | |
| 218 | 				 const struct rlimit *__new_limit, | |
| 219 | 				 struct rlimit *__old_limit), prlimit64); | |
| 220 | # else | |
| 221 | # define prlimit prlimit64 | |
| 222 | # endif | |
| 223 | # endif | |
| 224 | # ifdef __USE_LARGEFILE64 | |
| 225 | extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource, | |
| 226 | 		 const struct rlimit64 *__new_limit, | |
| 227 | 		 struct rlimit64 *__old_limit) __THROW; | |
| 228 | # endif | |
| 229 | #endif | |
| 230 | ||
| 231 | __END_DECLS | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/semaphore.h created+36| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | /* Copyright (C) 2002-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SEMAPHORE_H | |
| 19 | # error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #if _MIPS_SIM == _ABI64 | |
| 23 | # define __SIZEOF_SEM_T	32 | |
| 24 | #else | |
| 25 | # define __SIZEOF_SEM_T	16 | |
| 26 | #endif | |
| 27 | ||
| 28 | /* Value returned if `sem_open' failed. */ | |
| 29 | #define SEM_FAILED ((sem_t *) 0) | |
| 30 | ||
| 31 | ||
| 32 | typedef union | |
| 33 | { | |
| 34 | char __size[__SIZEOF_SEM_T]; | |
| 35 | long int __align; | |
| 36 | } sem_t; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/shmlba.h created+24| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | /* Define SHMLBA. MIPS version. | |
| 2 | Copyright (C) 2018-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never use <bits/shmlba.h> directly; include <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Segment low boundary address multiple. */ | |
| 24 | #define SHMLBA		0x40000 | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/sigaction.h created+94| ... | ... | @@ -0,0 +1,94 @@ |
| 1 | /* The proper definitions for Linux/MIPS's sigaction. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGACTION_H | |
| 20 | #define _BITS_SIGACTION_H 1 | |
| 21 | ||
| 22 | #ifndef _SIGNAL_H | |
| 23 | # error "Never include <bits/sigaction.h> directly; use <signal.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Structure describing the action to be taken when a signal arrives. */ | |
| 27 | struct sigaction | |
| 28 | { | |
| 29 | /* Special flags. */ | |
| 30 | int sa_flags; | |
| 31 | ||
| 32 | /* Signal handler. */ | |
| 33 | #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED | |
| 34 | union | |
| 35 | { | |
| 36 | 	/* Used if SA_SIGINFO is not set. */ | |
| 37 | 	__sighandler_t sa_handler; | |
| 38 | 	/* Used if SA_SIGINFO is set. */ | |
| 39 | 	void (*sa_sigaction) (int, siginfo_t *, void *); | |
| 40 | } | |
| 41 | __sigaction_handler; | |
| 42 | # define sa_handler __sigaction_handler.sa_handler | |
| 43 | # define sa_sigaction __sigaction_handler.sa_sigaction | |
| 44 | #else | |
| 45 | __sighandler_t sa_handler; | |
| 46 | #endif | |
| 47 | /* Additional set of signals to be blocked. */ | |
| 48 | __sigset_t sa_mask; | |
| 49 | ||
| 50 | /* The ABI says here are two unused ints following. */ | |
| 51 | /* Restore handler. */ | |
| 52 | void (*sa_restorer) (void); | |
| 53 | ||
| 54 | #if _MIPS_SZPTR < 64 | |
| 55 | int sa_resv[1]; | |
| 56 | #endif | |
| 57 | }; | |
| 58 | ||
| 59 | /* Bits in `sa_flags'. */ | |
| 60 | /* Please note that some Linux kernels versions use different values for these | |
| 61 | flags which is a bug in those kernel versions. */ | |
| 62 | #define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */ | |
| 63 | #define SA_NOCLDWAIT 0x00010000 /* Don't create zombie on child death. */ | |
| 64 | #define SA_SIGINFO 0x00000008 /* Invoke signal-catching function with | |
| 65 | 				 three arguments instead of one. */ | |
| 66 | #if defined __USE_XOPEN_EXTENDED || defined __USE_MISC | |
| 67 | # define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ | |
| 68 | #endif | |
| 69 | #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 | |
| 70 | # define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ | |
| 71 | # define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ | |
| 72 | # define SA_NODEFER 0x40000000 /* Don't automatically block the signal when | |
| 73 | 				 its handler is being executed. */ | |
| 74 | #endif | |
| 75 | #ifdef __USE_MISC | |
| 76 | # define SA_INTERRUPT 0x20000000 /* Historical no-op. */ | |
| 77 | ||
| 78 | /* Some aliases for the SA_ constants. */ | |
| 79 | # define SA_NOMASK SA_NODEFER | |
| 80 | # define SA_ONESHOT SA_RESETHAND | |
| 81 | # define SA_STACK SA_ONSTACK | |
| 82 | #endif | |
| 83 | ||
| 84 | /* Values for the HOW argument to `sigprocmask'. */ | |
| 85 | #define SIG_NOP	 0		/* 0 is unused to catch errors */ | |
| 86 | #define	SIG_BLOCK 1		/* Block signals. */ | |
| 87 | #define	SIG_UNBLOCK 2		/* Unblock signals. */ | |
| 88 | #define	SIG_SETMASK 3		/* Set the set of blocked signals. */ | |
| 89 | #ifdef __USE_MISC | |
| 90 | # define SIG_SETMASK32 256	/* Goodie from SGI for BSD compatibility: | |
| 91 | 				 set only the low 32 bit of the sigset. */ | |
| 92 | #endif | |
| 93 | ||
| 94 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/sigcontext.h created+82| ... | ... | @@ -0,0 +1,82 @@ |
| 1 | /* Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. | |
| 2 | ||
| 3 | The GNU C Library is free software; you can redistribute it and/or | |
| 4 | modify it under the terms of the GNU Lesser General Public | |
| 5 | License as published by the Free Software Foundation; either | |
| 6 | version 2.1 of the License, or (at your option) any later version. | |
| 7 | ||
| 8 | The GNU C Library is distributed in the hope that it will be useful, | |
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 11 | Lesser General Public License for more details. | |
| 12 | ||
| 13 | You should have received a copy of the GNU Lesser General Public | |
| 14 | License along with the GNU C Library. If not, see | |
| 15 | <https://www.gnu.org/licenses/>. */ | |
| 16 | ||
| 17 | #ifndef _BITS_SIGCONTEXT_H | |
| 18 | #define _BITS_SIGCONTEXT_H 1 | |
| 19 | ||
| 20 | #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H | |
| 21 | # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." | |
| 22 | #endif | |
| 23 | ||
| 24 | #include <sgidefs.h> | |
| 25 | ||
| 26 | #if _MIPS_SIM == _ABIO32 | |
| 27 | ||
| 28 | /* Certain unused fields were replaced with new ones in 2.6.12-rc4. | |
| 29 | The changes were as follows: | |
| 30 | ||
| 31 | sc_cause -> sc_hi1 | |
| 32 | sc_badvaddr -> sc_lo1 | |
| 33 | sc_sigset[0] -> sc_hi2 | |
| 34 | sc_sigset[1] -> sc_lo2 | |
| 35 | sc_sigset[2] -> sc_hi3 | |
| 36 | sc_sigset[3] -> sc_lo3 | |
| 37 | ||
| 38 | sc_regmask, sc_ownedfp and sc_fpc_eir are not used. */ | |
| 39 | struct sigcontext { | |
| 40 | unsigned int sc_regmask; | |
| 41 | unsigned int sc_status; | |
| 42 | __extension__ unsigned long long sc_pc; | |
| 43 | __extension__ unsigned long long sc_regs[32]; | |
| 44 | __extension__ unsigned long long sc_fpregs[32]; | |
| 45 | unsigned int sc_ownedfp; | |
| 46 | unsigned int sc_fpc_csr; | |
| 47 | unsigned int sc_fpc_eir; | |
| 48 | unsigned int sc_used_math; | |
| 49 | unsigned int sc_dsp; | |
| 50 | __extension__ unsigned long long sc_mdhi; | |
| 51 | __extension__ unsigned long long sc_mdlo; | |
| 52 | unsigned long sc_hi1; | |
| 53 | unsigned long sc_lo1; | |
| 54 | unsigned long sc_hi2; | |
| 55 | unsigned long sc_lo2; | |
| 56 | unsigned long sc_hi3; | |
| 57 | unsigned long sc_lo3; | |
| 58 | }; | |
| 59 | ||
| 60 | #else | |
| 61 | ||
| 62 | /* This structure changed in 2.6.12-rc4 when DSP support was added. */ | |
| 63 | struct sigcontext { | |
| 64 | __extension__ unsigned long long sc_regs[32]; | |
| 65 | __extension__ unsigned long long sc_fpregs[32]; | |
| 66 | __extension__ unsigned long long sc_mdhi; | |
| 67 | __extension__ unsigned long long sc_hi1; | |
| 68 | __extension__ unsigned long long sc_hi2; | |
| 69 | __extension__ unsigned long long sc_hi3; | |
| 70 | __extension__ unsigned long long sc_mdlo; | |
| 71 | __extension__ unsigned long long sc_lo1; | |
| 72 | __extension__ unsigned long long sc_lo2; | |
| 73 | __extension__ unsigned long long sc_lo3; | |
| 74 | __extension__ unsigned long long sc_pc; | |
| 75 | unsigned int sc_fpc_csr; | |
| 76 | unsigned int sc_used_math; | |
| 77 | unsigned int sc_dsp; | |
| 78 | unsigned int sc_reserved; | |
| 79 | }; | |
| 80 | ||
| 81 | #endif /* _MIPS_SIM != _ABIO32 */ | |
| 82 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/siginfo-arch.h created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | /* Architecture-specific adjustments to siginfo_t. MIPS version. */ | |
| 2 | #ifndef _BITS_SIGINFO_ARCH_H | |
| 3 | #define _BITS_SIGINFO_ARCH_H 1 | |
| 4 | ||
| 5 | /* MIPS has the si_code and si_errno fields in the opposite order from | |
| 6 | all other architectures. */ | |
| 7 | #define __SI_ERRNO_THEN_CODE 0 | |
| 8 | ||
| 9 | /* MIPS also has different values for SI_ASYNCIO, SI_MESGQ, and SI_TIMER | |
| 10 | than all other architectures. */ | |
| 11 | #define __SI_ASYNCIO_AFTER_SIGIO 0 | |
| 12 | ||
| 13 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/signalfd.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* Copyright (C) 2007-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_SIGNALFD_H | |
| 19 | # error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Flags for signalfd. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | SFD_CLOEXEC = 02000000, | |
| 26 | #define SFD_CLOEXEC SFD_CLOEXEC | |
| 27 | SFD_NONBLOCK = 00000200 | |
| 28 | #define SFD_NONBLOCK SFD_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/signum-arch.h created+65| ... | ... | @@ -0,0 +1,65 @@ |
| 1 | /* Signal number definitions. Linux/MIPS version. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGNUM_H | |
| 20 | #define _BITS_SIGNUM_H 1 | |
| 21 | ||
| 22 | #ifndef _SIGNAL_H | |
| 23 | #error "Never include <bits/signum.h> directly; use <signal.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Adjustments and additions to the signal number constants for | |
| 27 | Linux/MIPS. */ | |
| 28 | ||
| 29 | #define SIGEMT		 7	/* Emulator trap. */ | |
| 30 | #define SIGPWR		19	/* Power failure imminent. */ | |
| 31 | ||
| 32 | /* Historical signals specified by POSIX. */ | |
| 33 | #define SIGBUS 	10	/* Bus error. */ | |
| 34 | #define SIGSYS		12	/* Bad system call. */ | |
| 35 | ||
| 36 | /* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ | |
| 37 | #define SIGURG		21	/* Urgent data is available at a socket. */ | |
| 38 | #define SIGSTOP		23	/* Stop, unblockable. */ | |
| 39 | #define SIGTSTP		24	/* Keyboard stop. */ | |
| 40 | #define SIGCONT		25	/* Continue. */ | |
| 41 | #define SIGCHLD		18	/* Child terminated or stopped. */ | |
| 42 | #define SIGTTIN		26	/* Background read from control terminal. */ | |
| 43 | #define SIGTTOU		27	/* Background write to control terminal. */ | |
| 44 | #define SIGPOLL		22	/* Pollable event occurred (System V). */ | |
| 45 | #define SIGXCPU		30	/* CPU time limit exceeded. */ | |
| 46 | #define SIGVTALRM	28	/* Virtual timer expired. */ | |
| 47 | #define SIGPROF		29	/* Profiling timer expired. */ | |
| 48 | #define SIGXFSZ		31	/* File size limit exceeded. */ | |
| 49 | #define SIGUSR1		16	/* User-defined signal 1. */ | |
| 50 | #define SIGUSR2		17	/* User-defined signal 2. */ | |
| 51 | ||
| 52 | /* Nonstandard signals found in all modern POSIX systems | |
| 53 | (including both BSD and Linux). */ | |
| 54 | #define SIGWINCH	20	/* Window size change (4.3 BSD, Sun). */ | |
| 55 | ||
| 56 | /* Archaic names for compatibility. */ | |
| 57 | #define SIGIO		SIGPOLL	/* I/O now possible (4.2 BSD). */ | |
| 58 | #define SIGIOT		SIGABRT	/* IOT instruction, abort() on a PDP-11. */ | |
| 59 | #define SIGCLD		SIGCHLD /* Old System V name */ | |
| 60 | ||
| 61 | /* By default no real-time signals are supported. */ | |
| 62 | #define __SIGRTMIN	32 | |
| 63 | #define __SIGRTMAX	127 | |
| 64 | ||
| 65 | #endif	/* <signal.h> included. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/socket-constants.h created+70| ... | ... | @@ -0,0 +1,70 @@ |
| 1 | /* Socket constants which vary among Linux architectures. Version for MIPS. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define SOL_SOCKET 65535 | |
| 24 | #define SO_ACCEPTCONN 4105 | |
| 25 | #define SO_BROADCAST 32 | |
| 26 | #define SO_DONTROUTE 16 | |
| 27 | #define SO_ERROR 4103 | |
| 28 | #define SO_KEEPALIVE 8 | |
| 29 | #define SO_LINGER 128 | |
| 30 | #define SO_OOBINLINE 256 | |
| 31 | #define SO_RCVBUF 4098 | |
| 32 | #define SO_RCVLOWAT 4100 | |
| 33 | #define SO_REUSEADDR 4 | |
| 34 | #define SO_SNDBUF 4097 | |
| 35 | #define SO_SNDLOWAT 4099 | |
| 36 | #define SO_TYPE 4104 | |
| 37 | ||
| 38 | #if __TIMESIZE == 64 | |
| 39 | # define SO_RCVTIMEO 4102 | |
| 40 | # define SO_SNDTIMEO 4101 | |
| 41 | # define SO_TIMESTAMP 29 | |
| 42 | # define SO_TIMESTAMPNS 35 | |
| 43 | # define SO_TIMESTAMPING 37 | |
| 44 | #else | |
| 45 | # define SO_RCVTIMEO_OLD 4102 | |
| 46 | # define SO_SNDTIMEO_OLD 4101 | |
| 47 | # define SO_RCVTIMEO_NEW 66 | |
| 48 | # define SO_SNDTIMEO_NEW 67 | |
| 49 | ||
| 50 | # define SO_TIMESTAMP_OLD 29 | |
| 51 | # define SO_TIMESTAMPNS_OLD 35 | |
| 52 | # define SO_TIMESTAMPING_OLD 37 | |
| 53 | # define SO_TIMESTAMP_NEW 63 | |
| 54 | # define SO_TIMESTAMPNS_NEW 64 | |
| 55 | # define SO_TIMESTAMPING_NEW 65 | |
| 56 | ||
| 57 | # ifdef __USE_TIME_BITS64 | |
| 58 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 59 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 60 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 61 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 62 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 63 | # else | |
| 64 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 65 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 66 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 67 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 68 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 69 | # endif | |
| 70 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/socket_type.h created+55| ... | ... | @@ -0,0 +1,55 @@ |
| 1 | /* Define enum __socket_type for Linux/MIPS. | |
| 2 | Copyright (C) 1991-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Types of sockets. */ | |
| 24 | enum __socket_type | |
| 25 | { | |
| 26 | SOCK_DGRAM = 1,		/* Connectionless, unreliable datagrams | |
| 27 | 				 of fixed maximum length. */ | |
| 28 | #define SOCK_DGRAM SOCK_DGRAM | |
| 29 | SOCK_STREAM = 2,		/* Sequenced, reliable, connection-based | |
| 30 | 				 byte streams. */ | |
| 31 | #define SOCK_STREAM SOCK_STREAM | |
| 32 | SOCK_RAW = 3,			/* Raw protocol interface. */ | |
| 33 | #define SOCK_RAW SOCK_RAW | |
| 34 | SOCK_RDM = 4,			/* Reliably-delivered messages. */ | |
| 35 | #define SOCK_RDM SOCK_RDM | |
| 36 | SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based, | |
| 37 | 				 datagrams of fixed maximum length. */ | |
| 38 | #define SOCK_SEQPACKET SOCK_SEQPACKET | |
| 39 | SOCK_DCCP = 6, | |
| 40 | #define SOCK_DCCP SOCK_DCCP	/* Datagram Congestion Control Protocol. */ | |
| 41 | SOCK_PACKET = 10,		/* Linux specific way of getting packets | |
| 42 | 				 at the dev level. For writing rarp and | |
| 43 | 				 other similar things on the user level. */ | |
| 44 | #define SOCK_PACKET SOCK_PACKET | |
| 45 | ||
| 46 | /* Flags to be ORed into the type parameter of socket and socketpair and | |
| 47 | used for the flags parameter of paccept. */ | |
| 48 | ||
| 49 | SOCK_CLOEXEC = 02000000,	/* Atomically set close-on-exec flag for the | |
| 50 | 				 new descriptor(s). */ | |
| 51 | #define SOCK_CLOEXEC SOCK_CLOEXEC | |
| 52 | SOCK_NONBLOCK = 00000200	/* Atomically mark descriptor(s) as | |
| 53 | 				 non-blocking. */ | |
| 54 | #define SOCK_NONBLOCK SOCK_NONBLOCK | |
| 55 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/statfs.h created+73| ... | ... | @@ -0,0 +1,73 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_STATFS_H | |
| 19 | # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | #include <bits/types.h> /* for __fsid_t and __fsblkcnt_t*/ | |
| 23 | ||
| 24 | struct statfs | |
| 25 | { | |
| 26 | long int f_type; | |
| 27 | #define f_fstyp f_type | |
| 28 | long int f_bsize; | |
| 29 | long int f_frsize;	/* Fragment size - unsupported */ | |
| 30 | #ifndef __USE_FILE_OFFSET64 | |
| 31 | __fsblkcnt_t f_blocks; | |
| 32 | __fsblkcnt_t f_bfree; | |
| 33 | __fsblkcnt_t f_files; | |
| 34 | __fsblkcnt_t f_ffree; | |
| 35 | __fsblkcnt_t f_bavail; | |
| 36 | #else | |
| 37 | __fsblkcnt64_t f_blocks; | |
| 38 | __fsblkcnt64_t f_bfree; | |
| 39 | __fsblkcnt64_t f_files; | |
| 40 | __fsblkcnt64_t f_ffree; | |
| 41 | __fsblkcnt64_t f_bavail; | |
| 42 | #endif | |
| 43 | ||
| 44 | 	/* Linux specials */ | |
| 45 | __fsid_t f_fsid; | |
| 46 | long int f_namelen; | |
| 47 | long int f_flags; | |
| 48 | long int f_spare[5]; | |
| 49 | }; | |
| 50 | ||
| 51 | #ifdef __USE_LARGEFILE64 | |
| 52 | struct statfs64 | |
| 53 | { | |
| 54 | long int f_type; | |
| 55 | #define f_fstyp f_type | |
| 56 | long int f_bsize; | |
| 57 | long int f_frsize;	/* Fragment size - unsupported */ | |
| 58 | __fsblkcnt64_t f_blocks; | |
| 59 | __fsblkcnt64_t f_bfree; | |
| 60 | __fsblkcnt64_t f_files; | |
| 61 | __fsblkcnt64_t f_ffree; | |
| 62 | __fsblkcnt64_t f_bavail; | |
| 63 | ||
| 64 | 	/* Linux specials */ | |
| 65 | __fsid_t f_fsid; | |
| 66 | long int f_namelen; | |
| 67 | long int f_flags; | |
| 68 | long int f_spare[5]; | |
| 69 | }; | |
| 70 | #endif | |
| 71 | ||
| 72 | /* Tell code we have these members. */ | |
| 73 | #define _STATFS_F_NAMELEN | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/struct_mutex.h created+56| ... | ... | @@ -0,0 +1,56 @@ |
| 1 | /* MIPS internal mutex struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _THREAD_MUTEX_INTERNAL_H | |
| 20 | #define _THREAD_MUTEX_INTERNAL_H 1 | |
| 21 | ||
| 22 | struct __pthread_mutex_s | |
| 23 | { | |
| 24 | int __lock; | |
| 25 | unsigned int __count; | |
| 26 | int __owner; | |
| 27 | #if _MIPS_SIM == _ABI64 | |
| 28 | unsigned int __nusers; | |
| 29 | #endif | |
| 30 | /* KIND must stay at this position in the structure to maintain | |
| 31 | binary compatibility with static initializers. */ | |
| 32 | int __kind; | |
| 33 | #if _MIPS_SIM == _ABI64 | |
| 34 | int __spins; | |
| 35 | __pthread_list_t __list; | |
| 36 | # define __PTHREAD_MUTEX_HAVE_PREV 1 | |
| 37 | #else | |
| 38 | unsigned int __nusers; | |
| 39 | __extension__ union | |
| 40 | { | |
| 41 | int __spins; | |
| 42 | __pthread_slist_t __list; | |
| 43 | }; | |
| 44 | # define __PTHREAD_MUTEX_HAVE_PREV 0 | |
| 45 | #endif | |
| 46 | }; | |
| 47 | ||
| 48 | #if _MIPS_SIM == _ABI64 | |
| 49 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 50 | 0, 0, 0, 0, __kind, 0, { 0, 0 } | |
| 51 | #else | |
| 52 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 53 | 0, 0, 0, __kind, 0, { 0 } | |
| 54 | #endif | |
| 55 | ||
| 56 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/termios-c_cc.h created+43| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | /* termios c_cc symbolic constant definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_cc.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_cc characters */ | |
| 24 | #define VINTR		0	/* Interrupt character [ISIG]. */ | |
| 25 | #define VQUIT		1	/* Quit character [ISIG]. */ | |
| 26 | #define VERASE		2	/* Erase character [ICANON]. */ | |
| 27 | #define VKILL		3	/* Kill-line character [ICANON]. */ | |
| 28 | #define VMIN		4	/* Minimum number of bytes read at once [!ICANON]. */ | |
| 29 | #define VTIME		5	/* Time-out value (tenths of a second) [!ICANON]. */ | |
| 30 | #define VEOL2		6	/* Second EOL character [ICANON]. */ | |
| 31 | #define VSWTC		7 | |
| 32 | #define VSWTCH		VSWTC | |
| 33 | #define VSTART		8	/* Start (X-ON) character [IXON, IXOFF]. */ | |
| 34 | #define VSTOP		9	/* Stop (X-OFF) character [IXON, IXOFF]. */ | |
| 35 | #define VSUSP		10	/* Suspend character [ISIG]. */ | |
| 36 | 				/* VDSUSP is not supported on Linux. */ | |
| 37 | /* #define VDSUSP	11	/ * Delayed suspend character [ISIG]. */ | |
| 38 | #define VREPRINT	12	/* Reprint-line character [ICANON]. */ | |
| 39 | #define VDISCARD	13	/* Discard character [IEXTEN]. */ | |
| 40 | #define VWERASE		14	/* Word-erase character [ICANON]. */ | |
| 41 | #define VLNEXT		15	/* Literal-next character [IEXTEN]. */ | |
| 42 | #define VEOF		16	/* End-of-file character [ICANON]. */ | |
| 43 | #define VEOL		17	/* End-of-line character [ICANON]. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/termios-c_lflag.h created+46| ... | ... | @@ -0,0 +1,46 @@ |
| 1 | /* termios local mode definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_lflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_lflag bits */ | |
| 24 | #define ISIG	0000001		/* Enable signals. */ | |
| 25 | #define ICANON	0000002		/* Do erase and kill processing. */ | |
| 26 | #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) | |
| 27 | # define XCASE	0000004 | |
| 28 | #endif | |
| 29 | #define ECHO	0000010		/* Enable echo. */ | |
| 30 | #define ECHOE	0000020		/* Visual erase for ERASE. */ | |
| 31 | #define ECHOK	0000040		/* Echo NL after KILL. */ | |
| 32 | #define ECHONL	0000100		/* Echo NL even if ECHO is off. */ | |
| 33 | #define NOFLSH	0000200		/* Disable flush after interrupt. */ | |
| 34 | #define IEXTEN	0000400		/* Enable DISCARD and LNEXT. */ | |
| 35 | #ifdef __USE_MISC | |
| 36 | # define ECHOCTL 0001000	/* Echo control characters as ^X. */ | |
| 37 | # define ECHOPRT 0002000	/* Hardcopy visual erase. */ | |
| 38 | # define ECHOKE	 0004000	/* Visual erase for KILL. */ | |
| 39 | # define FLUSHO	0020000 | |
| 40 | # define PENDIN	0040000		/* Retype pending input (state). */ | |
| 41 | #endif | |
| 42 | #define TOSTOP	0100000		/* Send SIGTTOU for background output. */ | |
| 43 | #define ITOSTOP	TOSTOP | |
| 44 | #ifdef __USE_MISC | |
| 45 | # define EXTPROC 0200000 | |
| 46 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/termios-struct.h created+34| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | /* struct termios definition. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-struct.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define NCCS 32 | |
| 24 | struct termios | |
| 25 | { | |
| 26 | tcflag_t c_iflag;		/* input mode flags */ | |
| 27 | tcflag_t c_oflag;		/* output mode flags */ | |
| 28 | tcflag_t c_cflag;		/* control mode flags */ | |
| 29 | tcflag_t c_lflag;		/* local mode flags */ | |
| 30 | cc_t c_line;		/* line discipline */ | |
| 31 | cc_t c_cc[NCCS];		/* control characters */ | |
| 32 | #define _HAVE_STRUCT_TERMIOS_C_ISPEED 0 | |
| 33 | #define _HAVE_STRUCT_TERMIOS_C_OSPEED 0 | |
| 34 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/termios-tcflow.h created+26| ... | ... | @@ -0,0 +1,26 @@ |
| 1 | /* termios local mode definitions. Linux/mips version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-tcflow.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* tcsetattr uses these */ | |
| 24 | #define	TCSANOW		0x540e	/* Same as TCSETS; change immediately. */ | |
| 25 | #define	TCSADRAIN	0x540f	/* Same as TCSETSW; change when pending output is written. */ | |
| 26 | #define	TCSAFLUSH	0x5410	/* Same as TCSETSF; flush pending input before changing. */ | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/timerfd.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* Copyright (C) 2008-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef	_SYS_TIMERFD_H | |
| 19 | # error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | /* Bits to be set in the FLAGS parameter of `timerfd_create'. */ | |
| 23 | enum | |
| 24 | { | |
| 25 | TFD_CLOEXEC = 02000000, | |
| 26 | #define TFD_CLOEXEC TFD_CLOEXEC | |
| 27 | TFD_NONBLOCK = 00000200 | |
| 28 | #define TFD_NONBLOCK TFD_NONBLOCK | |
| 29 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/types/stack_t.h created+33| ... | ... | @@ -0,0 +1,33 @@ |
| 1 | /* Define stack_t. MIPS Linux version. | |
| 2 | Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __stack_t_defined | |
| 20 | #define __stack_t_defined 1 | |
| 21 | ||
| 22 | #define __need_size_t | |
| 23 | #include <stddef.h> | |
| 24 | ||
| 25 | /* Structure describing a signal stack. */ | |
| 26 | typedef struct | |
| 27 | { | |
| 28 | void *ss_sp; | |
| 29 | size_t ss_size; | |
| 30 | int ss_flags; | |
| 31 | } stack_t; | |
| 32 | ||
| 33 | #endif | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_msqid_ds.h created+62| ... | ... | @@ -0,0 +1,62 @@ |
| 1 | /* Linux/MIPS implementation of the SysV message struct msqid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MSG_H | |
| 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 25 | /* Structure of record for one message inside the kernel. | |
| 26 | The type `struct msg' is opaque. */ | |
| 27 | struct msqid_ds | |
| 28 | { | |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ | |
| 33 | # if __TIMESIZE == 32 | |
| 34 | # ifdef __MIPSEL__ | |
| 35 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 36 | unsigned long int __msg_stime_high; | |
| 37 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 38 | unsigned long int __msg_rtime_high; | |
| 39 | __time_t msg_ctime;		/* time of last change */ | |
| 40 | unsigned long int __msg_ctime_high; | |
| 41 | # else | |
| 42 | unsigned long int __msg_stime_high; | |
| 43 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 44 | unsigned long int __msg_rtime_high; | |
| 45 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 46 | unsigned long int __msg_ctime_high; | |
| 47 | __time_t msg_ctime;		/* time of last change */ | |
| 48 | # endif | |
| 49 | # else | |
| 50 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 51 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 52 | __time_t msg_ctime;		/* time of last change */ | |
| 53 | # endif | |
| 54 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ | |
| 55 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ | |
| 56 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ | |
| 57 | __pid_t msg_lspid;		/* pid of last msgsnd() */ | |
| 58 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ | |
| 59 | __syscall_ulong_t __glibc_reserved4; | |
| 60 | __syscall_ulong_t __glibc_reserved5; | |
| 61 | #endif | |
| 62 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_semid_ds.h created+36| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | /* MIPS implementation of the semaphore struct semid_ds | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SEM_H | |
| 20 | # error "Never include <bits/types/struct_semid_ds.h> directly; use <sys/sem.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a set of semaphores. */ | |
| 24 | struct semid_ds | |
| 25 | { | |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 29 | struct ipc_perm sem_perm;		/* operation permission struct */ | |
| 30 | __time_t sem_otime;	/* last semop() time */ | |
| 31 | __time_t sem_ctime;	/* last time changed by semctl() */ | |
| 32 | __syscall_ulong_t sem_nsems;		/* number of semaphores in set */ | |
| 33 | __syscall_ulong_t __sem_otime_high; | |
| 34 | __syscall_ulong_t __sem_ctime_high; | |
| 35 | #endif | |
| 36 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_shmid_ds.h created+53| ... | ... | @@ -0,0 +1,53 @@ |
| 1 | /* Linux/MIPS implementation of the shared memory struct shmid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never include <bits/types/struct_shmid_ds.h> directly; use <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a shared memory segment. */ | |
| 24 | struct shmid_ds | |
| 25 | { | |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 29 | struct ipc_perm shm_perm;		/* operation permission struct */ | |
| 30 | size_t shm_segsz;			/* size of segment in bytes */ | |
| 31 | # if __TIMESIZE == 32 | |
| 32 | __time_t shm_atime;			/* time of last shmat() */ | |
| 33 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 34 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 35 | # else | |
| 36 | __time_t shm_atime;			/* time of last shmat() */ | |
| 37 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 38 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 39 | # endif | |
| 40 | __pid_t shm_cpid;			/* pid of creator */ | |
| 41 | __pid_t shm_lpid;			/* pid of last shmop */ | |
| 42 | shmatt_t shm_nattch;		/* number of current attaches */ | |
| 43 | # if __TIMESIZE == 32 | |
| 44 | unsigned short int __shm_atime_high; | |
| 45 | unsigned short int __shm_dtime_high; | |
| 46 | unsigned short int __shm_ctime_high; | |
| 47 | unsigned short int __glibc_reserved4; | |
| 48 | # else | |
| 49 | __syscall_ulong_t __glibc_reserved5; | |
| 50 | __syscall_ulong_t __glibc_reserved6; | |
| 51 | # endif | |
| 52 | #endif | |
| 53 | }; | |
| \ No newline at end of file |
lib/libc/include/mipsel-linux-gnueabihf/ieee754.h created+326| ... | ... | @@ -0,0 +1,326 @@ |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library. If not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _IEEE754_H | |
| 19 | #define _IEEE754_H 1 | |
| 20 | ||
| 21 | #include <features.h> | |
| 22 | ||
| 23 | #include <bits/endian.h> | |
| 24 | ||
| 25 | #ifndef __LDBL_MANT_DIG__ | |
| 26 | # include <float.h> | |
| 27 | # define __LDBL_MANT_DIG__ LDBL_MANT_DIG | |
| 28 | #endif | |
| 29 | ||
| 30 | __BEGIN_DECLS | |
| 31 | ||
| 32 | union ieee754_float | |
| 33 | { | |
| 34 | float f; | |
| 35 | ||
| 36 | /* This is the IEEE 754 single-precision format. */ | |
| 37 | struct | |
| 38 | { | |
| 39 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 40 | 	unsigned int negative:1; | |
| 41 | 	unsigned int exponent:8; | |
| 42 | 	unsigned int mantissa:23; | |
| 43 | #endif				/* Big endian. */ | |
| 44 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 45 | 	unsigned int mantissa:23; | |
| 46 | 	unsigned int exponent:8; | |
| 47 | 	unsigned int negative:1; | |
| 48 | #endif				/* Little endian. */ | |
| 49 | } ieee; | |
| 50 | ||
| 51 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 52 | struct | |
| 53 | { | |
| 54 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 55 | 	unsigned int negative:1; | |
| 56 | 	unsigned int exponent:8; | |
| 57 | 	unsigned int quiet_nan:1; | |
| 58 | 	unsigned int mantissa:22; | |
| 59 | #endif				/* Big endian. */ | |
| 60 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 61 | 	unsigned int mantissa:22; | |
| 62 | 	unsigned int quiet_nan:1; | |
| 63 | 	unsigned int exponent:8; | |
| 64 | 	unsigned int negative:1; | |
| 65 | #endif				/* Little endian. */ | |
| 66 | } ieee_nan; | |
| 67 | }; | |
| 68 | ||
| 69 | #define IEEE754_FLOAT_BIAS	0x7f /* Added to exponent. */ | |
| 70 | ||
| 71 | ||
| 72 | union ieee754_double | |
| 73 | { | |
| 74 | double d; | |
| 75 | ||
| 76 | /* This is the IEEE 754 double-precision format. */ | |
| 77 | struct | |
| 78 | { | |
| 79 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 80 | 	unsigned int negative:1; | |
| 81 | 	unsigned int exponent:11; | |
| 82 | 	/* Together these comprise the mantissa. */ | |
| 83 | 	unsigned int mantissa0:20; | |
| 84 | 	unsigned int mantissa1:32; | |
| 85 | #endif				/* Big endian. */ | |
| 86 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 87 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 88 | 	unsigned int mantissa0:20; | |
| 89 | 	unsigned int exponent:11; | |
| 90 | 	unsigned int negative:1; | |
| 91 | 	unsigned int mantissa1:32; | |
| 92 | # else | |
| 93 | 	/* Together these comprise the mantissa. */ | |
| 94 | 	unsigned int mantissa1:32; | |
| 95 | 	unsigned int mantissa0:20; | |
| 96 | 	unsigned int exponent:11; | |
| 97 | 	unsigned int negative:1; | |
| 98 | # endif | |
| 99 | #endif				/* Little endian. */ | |
| 100 | } ieee; | |
| 101 | ||
| 102 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 103 | struct | |
| 104 | { | |
| 105 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 106 | 	unsigned int negative:1; | |
| 107 | 	unsigned int exponent:11; | |
| 108 | 	unsigned int quiet_nan:1; | |
| 109 | 	/* Together these comprise the mantissa. */ | |
| 110 | 	unsigned int mantissa0:19; | |
| 111 | 	unsigned int mantissa1:32; | |
| 112 | #else | |
| 113 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 114 | 	unsigned int mantissa0:19; | |
| 115 | 	unsigned int quiet_nan:1; | |
| 116 | 	unsigned int exponent:11; | |
| 117 | 	unsigned int negative:1; | |
| 118 | 	unsigned int mantissa1:32; | |
| 119 | # else | |
| 120 | 	/* Together these comprise the mantissa. */ | |
| 121 | 	unsigned int mantissa1:32; | |
| 122 | 	unsigned int mantissa0:19; | |
| 123 | 	unsigned int quiet_nan:1; | |
| 124 | 	unsigned int exponent:11; | |
| 125 | 	unsigned int negative:1; | |
| 126 | # endif | |
| 127 | #endif | |
| 128 | } ieee_nan; | |
| 129 | }; | |
| 130 | ||
| 131 | #define IEEE754_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 132 | ||
| 133 | #if __LDBL_MANT_DIG__ == 113 | |
| 134 | ||
| 135 | union ieee854_long_double | |
| 136 | { | |
| 137 | long double d; | |
| 138 | ||
| 139 | /* This is the IEEE 854 quad-precision format. */ | |
| 140 | struct | |
| 141 | { | |
| 142 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 143 | 	unsigned int negative:1; | |
| 144 | 	unsigned int exponent:15; | |
| 145 | 	/* Together these comprise the mantissa. */ | |
| 146 | 	unsigned int mantissa0:16; | |
| 147 | 	unsigned int mantissa1:32; | |
| 148 | 	unsigned int mantissa2:32; | |
| 149 | 	unsigned int mantissa3:32; | |
| 150 | #endif				/* Big endian. */ | |
| 151 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 152 | 	/* Together these comprise the mantissa. */ | |
| 153 | 	unsigned int mantissa3:32; | |
| 154 | 	unsigned int mantissa2:32; | |
| 155 | 	unsigned int mantissa1:32; | |
| 156 | 	unsigned int mantissa0:16; | |
| 157 | 	unsigned int exponent:15; | |
| 158 | 	unsigned int negative:1; | |
| 159 | #endif				/* Little endian. */ | |
| 160 | } ieee; | |
| 161 | ||
| 162 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 163 | struct | |
| 164 | { | |
| 165 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 166 | 	unsigned int negative:1; | |
| 167 | 	unsigned int exponent:15; | |
| 168 | 	unsigned int quiet_nan:1; | |
| 169 | 	/* Together these comprise the mantissa. */ | |
| 170 | 	unsigned int mantissa0:15; | |
| 171 | 	unsigned int mantissa1:32; | |
| 172 | 	unsigned int mantissa2:32; | |
| 173 | 	unsigned int mantissa3:32; | |
| 174 | #endif				/* Big endian. */ | |
| 175 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 176 | 	/* Together these comprise the mantissa. */ | |
| 177 | 	unsigned int mantissa3:32; | |
| 178 | 	unsigned int mantissa2:32; | |
| 179 | 	unsigned int mantissa1:32; | |
| 180 | 	unsigned int mantissa0:15; | |
| 181 | 	unsigned int quiet_nan:1; | |
| 182 | 	unsigned int exponent:15; | |
| 183 | 	unsigned int negative:1; | |
| 184 | #endif				/* Little endian. */ | |
| 185 | } ieee_nan; | |
| 186 | }; | |
| 187 | ||
| 188 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ | |
| 189 | ||
| 190 | #elif __LDBL_MANT_DIG__ == 64 | |
| 191 | ||
| 192 | union ieee854_long_double | |
| 193 | { | |
| 194 | long double d; | |
| 195 | ||
| 196 | /* This is the IEEE 854 double-extended-precision format. */ | |
| 197 | struct | |
| 198 | { | |
| 199 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 200 | 	unsigned int negative:1; | |
| 201 | 	unsigned int exponent:15; | |
| 202 | 	unsigned int empty:16; | |
| 203 | 	unsigned int mantissa0:32; | |
| 204 | 	unsigned int mantissa1:32; | |
| 205 | #endif | |
| 206 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 207 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 208 | 	unsigned int exponent:15; | |
| 209 | 	unsigned int negative:1; | |
| 210 | 	unsigned int empty:16; | |
| 211 | 	unsigned int mantissa0:32; | |
| 212 | 	unsigned int mantissa1:32; | |
| 213 | # else | |
| 214 | 	unsigned int mantissa1:32; | |
| 215 | 	unsigned int mantissa0:32; | |
| 216 | 	unsigned int exponent:15; | |
| 217 | 	unsigned int negative:1; | |
| 218 | 	unsigned int empty:16; | |
| 219 | # endif | |
| 220 | #endif | |
| 221 | } ieee; | |
| 222 | ||
| 223 | /* This is for NaNs in the IEEE 854 double-extended-precision format. */ | |
| 224 | struct | |
| 225 | { | |
| 226 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 227 | 	unsigned int negative:1; | |
| 228 | 	unsigned int exponent:15; | |
| 229 | 	unsigned int empty:16; | |
| 230 | 	unsigned int one:1; | |
| 231 | 	unsigned int quiet_nan:1; | |
| 232 | 	unsigned int mantissa0:30; | |
| 233 | 	unsigned int mantissa1:32; | |
| 234 | #endif | |
| 235 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 236 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 237 | 	unsigned int exponent:15; | |
| 238 | 	unsigned int negative:1; | |
| 239 | 	unsigned int empty:16; | |
| 240 | 	unsigned int mantissa0:30; | |
| 241 | 	unsigned int quiet_nan:1; | |
| 242 | 	unsigned int one:1; | |
| 243 | 	unsigned int mantissa1:32; | |
| 244 | # else | |
| 245 | 	unsigned int mantissa1:32; | |
| 246 | 	unsigned int mantissa0:30; | |
| 247 | 	unsigned int quiet_nan:1; | |
| 248 | 	unsigned int one:1; | |
| 249 | 	unsigned int exponent:15; | |
| 250 | 	unsigned int negative:1; | |
| 251 | 	unsigned int empty:16; | |
| 252 | # endif | |
| 253 | #endif | |
| 254 | } ieee_nan; | |
| 255 | }; | |
| 256 | ||
| 257 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff | |
| 258 | ||
| 259 | #elif __LDBL_MANT_DIG__ == 53 | |
| 260 | ||
| 261 | union ieee854_long_double | |
| 262 | { | |
| 263 | long double d; | |
| 264 | ||
| 265 | /* This is the IEEE 754 double-precision format. */ | |
| 266 | struct | |
| 267 | { | |
| 268 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 269 | 	unsigned int negative:1; | |
| 270 | 	unsigned int exponent:11; | |
| 271 | 	/* Together these comprise the mantissa. */ | |
| 272 | 	unsigned int mantissa0:20; | |
| 273 | 	unsigned int mantissa1:32; | |
| 274 | #endif				/* Big endian. */ | |
| 275 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 276 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 277 | 	unsigned int mantissa0:20; | |
| 278 | 	unsigned int exponent:11; | |
| 279 | 	unsigned int negative:1; | |
| 280 | 	unsigned int mantissa1:32; | |
| 281 | # else | |
| 282 | 	/* Together these comprise the mantissa. */ | |
| 283 | 	unsigned int mantissa1:32; | |
| 284 | 	unsigned int mantissa0:20; | |
| 285 | 	unsigned int exponent:11; | |
| 286 | 	unsigned int negative:1; | |
| 287 | # endif | |
| 288 | #endif				/* Little endian. */ | |
| 289 | } ieee; | |
| 290 | ||
| 291 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 292 | struct | |
| 293 | { | |
| 294 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 295 | 	unsigned int negative:1; | |
| 296 | 	unsigned int exponent:11; | |
| 297 | 	unsigned int quiet_nan:1; | |
| 298 | 	/* Together these comprise the mantissa. */ | |
| 299 | 	unsigned int mantissa0:19; | |
| 300 | 	unsigned int mantissa1:32; | |
| 301 | #else | |
| 302 | # if	__FLOAT_WORD_ORDER == __BIG_ENDIAN | |
| 303 | 	unsigned int mantissa0:19; | |
| 304 | 	unsigned int quiet_nan:1; | |
| 305 | 	unsigned int exponent:11; | |
| 306 | 	unsigned int negative:1; | |
| 307 | 	unsigned int mantissa1:32; | |
| 308 | # else | |
| 309 | 	/* Together these comprise the mantissa. */ | |
| 310 | 	unsigned int mantissa1:32; | |
| 311 | 	unsigned int mantissa0:19; | |
| 312 | 	unsigned int quiet_nan:1; | |
| 313 | 	unsigned int exponent:11; | |
| 314 | 	unsigned int negative:1; | |
| 315 | # endif | |
| 316 | #endif | |
| 317 | } ieee_nan; | |
| 318 | }; | |
| 319 | ||
| 320 | #define IEEE854_LONG_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 321 | ||
| 322 | #endif /* __LDBL_MANT_DIG__ == 53 */ | |
| 323 | ||
| 324 | __END_DECLS | |
| 325 | ||
| 326 | #endif /* ieee754.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/endianness.h deleted-16| ... | ... | @@ -1,16 +0,0 @@ |
| 1 | #ifndef _BITS_ENDIANNESS_H | |
| 2 | #define _BITS_ENDIANNESS_H 1 | |
| 3 | ||
| 4 | #ifndef _BITS_ENDIAN_H | |
| 5 | # error "Never use <bits/endianness.h> directly; include <endian.h> instead." | |
| 6 | #endif | |
| 7 | ||
| 8 | /* PowerPC has selectable endianness. */ | |
| 9 | #if defined __BIG_ENDIAN__ || defined _BIG_ENDIAN | |
| 10 | # define __BYTE_ORDER __BIG_ENDIAN | |
| 11 | #endif | |
| 12 | #if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN | |
| 13 | # define __BYTE_ORDER __LITTLE_ENDIAN | |
| 14 | #endif | |
| 15 | ||
| 16 | #endif /* bits/endianness.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/environments.h deleted-96| ... | ... | @@ -1,96 +0,0 @@ |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _UNISTD_H | |
| 19 | # error "Never include this file directly. Use <unistd.h> instead" | |
| 20 | #endif | |
| 21 | ||
| 22 | #include <bits/wordsize.h> | |
| 23 | ||
| 24 | /* This header should define the following symbols under the described | |
| 25 | situations. A value `1' means that the model is always supported, | |
| 26 | `-1' means it is never supported. Undefined means it cannot be | |
| 27 | statically decided. | |
| 28 | ||
| 29 | _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type | |
| 30 | _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type | |
| 31 | ||
| 32 | _POSIX_V7_LP64_OFF32	 64bit long and pointers and 32bit off_t type | |
| 33 | _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type | |
| 34 | ||
| 35 | The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, | |
| 36 | _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, | |
| 37 | _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were | |
| 38 | used in previous versions of the Unix standard and are available | |
| 39 | only for compatibility. | |
| 40 | */ | |
| 41 | ||
| 42 | #if __WORDSIZE == 64 | |
| 43 | ||
| 44 | /* Environments with 32-bit wide pointers are optionally provided. | |
| 45 | Therefore following macros aren't defined: | |
| 46 | # undef _POSIX_V7_ILP32_OFF32 | |
| 47 | # undef _POSIX_V7_ILP32_OFFBIG | |
| 48 | # undef _POSIX_V6_ILP32_OFF32 | |
| 49 | # undef _POSIX_V6_ILP32_OFFBIG | |
| 50 | # undef _XBS5_ILP32_OFF32 | |
| 51 | # undef _XBS5_ILP32_OFFBIG | |
| 52 | and users need to check at runtime. */ | |
| 53 | ||
| 54 | /* We also have no use (for now) for an environment with bigger pointers | |
| 55 | and offsets. */ | |
| 56 | # define _POSIX_V7_LPBIG_OFFBIG	-1 | |
| 57 | # define _POSIX_V6_LPBIG_OFFBIG	-1 | |
| 58 | # define _XBS5_LPBIG_OFFBIG	-1 | |
| 59 | ||
| 60 | /* By default we have 64-bit wide `long int', pointers and `off_t'. */ | |
| 61 | # define _POSIX_V7_LP64_OFF64	1 | |
| 62 | # define _POSIX_V6_LP64_OFF64	1 | |
| 63 | # define _XBS5_LP64_OFF64	1 | |
| 64 | ||
| 65 | #else /* __WORDSIZE == 32 */ | |
| 66 | ||
| 67 | /* By default we have 32-bit wide `int', `long int', pointers and `off_t' | |
| 68 | and all platforms support LFS. */ | |
| 69 | # define _POSIX_V7_ILP32_OFF32	1 | |
| 70 | # define _POSIX_V7_ILP32_OFFBIG	1 | |
| 71 | # define _POSIX_V6_ILP32_OFF32	1 | |
| 72 | # define _POSIX_V6_ILP32_OFFBIG	1 | |
| 73 | # define _XBS5_ILP32_OFF32	1 | |
| 74 | # define _XBS5_ILP32_OFFBIG	1 | |
| 75 | ||
| 76 | /* We optionally provide an environment with the above size but an 64-bit | |
| 77 | side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ | |
| 78 | ||
| 79 | /* Environments with 64-bit wide pointers can be provided, | |
| 80 | so these macros aren't defined: | |
| 81 | # undef _POSIX_V7_LP64_OFF64 | |
| 82 | # undef _POSIX_V7_LPBIG_OFFBIG | |
| 83 | # undef _POSIX_V6_LP64_OFF64 | |
| 84 | # undef _POSIX_V6_LPBIG_OFFBIG | |
| 85 | # undef _XBS5_LP64_OFF64 | |
| 86 | # undef _XBS5_LPBIG_OFFBIG | |
| 87 | and sysconf tests for it at runtime. */ | |
| 88 | ||
| 89 | #endif /* __WORDSIZE == 32 */ | |
| 90 | ||
| 91 | #define __ILP32_OFF32_CFLAGS	"-m32" | |
| 92 | #define __ILP32_OFFBIG_CFLAGS	"-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" | |
| 93 | #define __ILP32_OFF32_LDFLAGS	"-m32" | |
| 94 | #define __ILP32_OFFBIG_LDFLAGS	"-m32" | |
| 95 | #define __LP64_OFF64_CFLAGS	"-m64" | |
| 96 | #define __LP64_OFF64_LDFLAGS	"-m64" | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/fcntl.h deleted-62| ... | ... | @@ -1,62 +0,0 @@ |
| 1 | /* O_*, F_*, FD_* bit values for Linux/PowerPC. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef	_FCNTL_H | |
| 20 | # error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/wordsize.h> | |
| 24 | ||
| 25 | #define __O_DIRECTORY	 040000	/* Must be a directory.	 */ | |
| 26 | #define __O_NOFOLLOW	0100000	/* Do not follow links.	 */ | |
| 27 | #define __O_DIRECT	0400000	/* Direct disk access.	*/ | |
| 28 | ||
| 29 | #if __WORDSIZE == 64 | |
| 30 | /* Not necessary, files are always with 64bit off_t. */ | |
| 31 | # define __O_LARGEFILE 0 | |
| 32 | #else | |
| 33 | # define __O_LARGEFILE	0200000 | |
| 34 | #endif | |
| 35 | ||
| 36 | struct flock | |
| 37 | { | |
| 38 | short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.	*/ | |
| 39 | short int l_whence;	/* Where `l_start' is relative to (like `lseek'). */ | |
| 40 | #ifndef __USE_FILE_OFFSET64 | |
| 41 | __off_t l_start;	/* Offset where the lock begins. */ | |
| 42 | __off_t l_len;	/* Size of the locked area; zero means until EOF. */ | |
| 43 | #else | |
| 44 | __off64_t l_start;	/* Offset where the lock begins. */ | |
| 45 | __off64_t l_len;	/* Size of the locked area; zero means until EOF. */ | |
| 46 | #endif | |
| 47 | __pid_t l_pid;	/* Process holding the lock. */ | |
| 48 | }; | |
| 49 | ||
| 50 | #ifdef __USE_LARGEFILE64 | |
| 51 | struct flock64 | |
| 52 | { | |
| 53 | short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.	*/ | |
| 54 | short int l_whence;	/* Where `l_start' is relative to (like `lseek'). */ | |
| 55 | __off64_t l_start;	/* Offset where the lock begins. */ | |
| 56 | __off64_t l_len;	/* Size of the locked area; zero means until EOF. */ | |
| 57 | __pid_t l_pid;	/* Process holding the lock. */ | |
| 58 | }; | |
| 59 | #endif | |
| 60 | ||
| 61 | /* Include generic Linux declarations. */ | |
| 62 | #include <bits/fcntl-linux.h> | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/fenv.h deleted-180| ... | ... | @@ -1,180 +0,0 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _FENV_H | |
| 19 | # error "Never use <bits/fenv.h> directly; include <fenv.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | ||
| 23 | /* Define bits representing the exception. We use the bit positions of | |
| 24 | the appropriate bits in the FPSCR... */ | |
| 25 | enum | |
| 26 | { | |
| 27 | FE_INEXACT = | |
| 28 | #define FE_INEXACT	(1 << (31 - 6)) | |
| 29 | FE_INEXACT, | |
| 30 | FE_DIVBYZERO = | |
| 31 | #define FE_DIVBYZERO	(1 << (31 - 5)) | |
| 32 | FE_DIVBYZERO, | |
| 33 | FE_UNDERFLOW = | |
| 34 | #define FE_UNDERFLOW	(1 << (31 - 4)) | |
| 35 | FE_UNDERFLOW, | |
| 36 | FE_OVERFLOW = | |
| 37 | #define FE_OVERFLOW	(1 << (31 - 3)) | |
| 38 | FE_OVERFLOW, | |
| 39 | ||
| 40 | /* ... except for FE_INVALID, for which we use bit 31. FE_INVALID | |
| 41 | actually corresponds to bits 7 through 12 and 21 through 23 | |
| 42 | in the FPSCR, but we can't use that because the current draft | |
| 43 | says that it must be a power of 2. Instead we use bit 2 which | |
| 44 | is the summary bit for all the FE_INVALID exceptions, which | |
| 45 | kind of makes sense. */ | |
| 46 | FE_INVALID = | |
| 47 | #define FE_INVALID	(1 << (31 - 2)) | |
| 48 | FE_INVALID, | |
| 49 | ||
| 50 | #ifdef __USE_GNU | |
| 51 | /* Breakdown of the FE_INVALID bits. Setting FE_INVALID on an | |
| 52 | input to a routine is equivalent to setting all of these bits; | |
| 53 | FE_INVALID will be set on output from a routine iff one of | |
| 54 | these bits is set. Note, though, that you can't disable or | |
| 55 | enable these exceptions individually. */ | |
| 56 | ||
| 57 | /* Operation with a sNaN. */ | |
| 58 | FE_INVALID_SNAN = | |
| 59 | # define FE_INVALID_SNAN	(1 << (31 - 7)) | |
| 60 | FE_INVALID_SNAN, | |
| 61 | ||
| 62 | /* Inf - Inf */ | |
| 63 | FE_INVALID_ISI = | |
| 64 | # define FE_INVALID_ISI	(1 << (31 - 8)) | |
| 65 | FE_INVALID_ISI, | |
| 66 | ||
| 67 | /* Inf / Inf */ | |
| 68 | FE_INVALID_IDI = | |
| 69 | # define FE_INVALID_IDI	(1 << (31 - 9)) | |
| 70 | FE_INVALID_IDI, | |
| 71 | ||
| 72 | /* 0 / 0 */ | |
| 73 | FE_INVALID_ZDZ = | |
| 74 | # define FE_INVALID_ZDZ	(1 << (31 - 10)) | |
| 75 | FE_INVALID_ZDZ, | |
| 76 | ||
| 77 | /* Inf * 0 */ | |
| 78 | FE_INVALID_IMZ = | |
| 79 | # define FE_INVALID_IMZ	(1 << (31 - 11)) | |
| 80 | FE_INVALID_IMZ, | |
| 81 | ||
| 82 | /* Comparison with a NaN. */ | |
| 83 | FE_INVALID_COMPARE = | |
| 84 | # define FE_INVALID_COMPARE	(1 << (31 - 12)) | |
| 85 | FE_INVALID_COMPARE, | |
| 86 | ||
| 87 | /* Invalid operation flag for software (not set by hardware). */ | |
| 88 | /* Note that some chips don't have this implemented, presumably | |
| 89 | because no-one expected anyone to write software for them %-). */ | |
| 90 | FE_INVALID_SOFTWARE = | |
| 91 | # define FE_INVALID_SOFTWARE	(1 << (31 - 21)) | |
| 92 | FE_INVALID_SOFTWARE, | |
| 93 | ||
| 94 | /* Square root of negative number (including -Inf). */ | |
| 95 | /* Note that some chips don't have this implemented. */ | |
| 96 | FE_INVALID_SQRT = | |
| 97 | # define FE_INVALID_SQRT	(1 << (31 - 22)) | |
| 98 | FE_INVALID_SQRT, | |
| 99 | ||
| 100 | /* Conversion-to-integer of a NaN or a number too large or too small. */ | |
| 101 | FE_INVALID_INTEGER_CONVERSION = | |
| 102 | # define FE_INVALID_INTEGER_CONVERSION	(1 << (31 - 23)) | |
| 103 | FE_INVALID_INTEGER_CONVERSION | |
| 104 | ||
| 105 | # define FE_ALL_INVALID \ | |
| 106 | (FE_INVALID_SNAN | FE_INVALID_ISI | FE_INVALID_IDI | FE_INVALID_ZDZ \ | |
| 107 | 	 | FE_INVALID_IMZ | FE_INVALID_COMPARE | FE_INVALID_SOFTWARE \ | |
| 108 | 	 | FE_INVALID_SQRT | FE_INVALID_INTEGER_CONVERSION) | |
| 109 | #endif | |
| 110 | }; | |
| 111 | ||
| 112 | #define FE_ALL_EXCEPT \ | |
| 113 | 	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) | |
| 114 | ||
| 115 | /* PowerPC chips support all of the four defined rounding modes. We | |
| 116 | use the bit pattern in the FPSCR as the values for the | |
| 117 | appropriate macros. */ | |
| 118 | enum | |
| 119 | { | |
| 120 | FE_TONEAREST = | |
| 121 | #define FE_TONEAREST	0 | |
| 122 | FE_TONEAREST, | |
| 123 | FE_TOWARDZERO = | |
| 124 | #define FE_TOWARDZERO	1 | |
| 125 | FE_TOWARDZERO, | |
| 126 | FE_UPWARD = | |
| 127 | #define FE_UPWARD	2 | |
| 128 | FE_UPWARD, | |
| 129 | FE_DOWNWARD = | |
| 130 | #define FE_DOWNWARD	3 | |
| 131 | FE_DOWNWARD | |
| 132 | }; | |
| 133 | ||
| 134 | /* Type representing exception flags. */ | |
| 135 | typedef unsigned int fexcept_t; | |
| 136 | ||
| 137 | /* Type representing floating-point environment. We leave it as 'double' | |
| 138 | for efficiency reasons (rather than writing it to a 32-bit integer). */ | |
| 139 | typedef double fenv_t; | |
| 140 | ||
| 141 | /* If the default argument is used we use this value. */ | |
| 142 | extern const fenv_t __fe_dfl_env; | |
| 143 | #define FE_DFL_ENV	(&__fe_dfl_env) | |
| 144 | ||
| 145 | #ifdef __USE_GNU | |
| 146 | /* Floating-point environment where all exceptions are enabled. Note that | |
| 147 | this is not sufficient to give you SIGFPE. */ | |
| 148 | extern const fenv_t __fe_enabled_env; | |
| 149 | # define FE_ENABLED_ENV	(&__fe_enabled_env) | |
| 150 | ||
| 151 | /* Floating-point environment with (processor-dependent) non-IEEE floating | |
| 152 | point. */ | |
| 153 | extern const fenv_t __fe_nonieee_env; | |
| 154 | # define FE_NONIEEE_ENV	(&__fe_nonieee_env) | |
| 155 | ||
| 156 | /* Floating-point environment with all exceptions enabled. Note that | |
| 157 | just evaluating this value does not change the processor exception mode. | |
| 158 | Passing this mask to fesetenv will result in a prctl syscall to change | |
| 159 | the MSR FE0/FE1 bits to "Precise Mode". On some processors this will | |
| 160 | result in slower floating point execution. This will last until an | |
| 161 | fenv or exception mask is installed that disables all FP exceptions. */ | |
| 162 | # define FE_NOMASK_ENV	FE_ENABLED_ENV | |
| 163 | ||
| 164 | /* Floating-point environment with all exceptions disabled. Note that | |
| 165 | just evaluating this value does not change the processor exception mode. | |
| 166 | Passing this mask to fesetenv will result in a prctl syscall to change | |
| 167 | the MSR FE0/FE1 bits to "Ignore Exceptions Mode". On most processors | |
| 168 | this allows the fastest possible floating point execution.*/ | |
| 169 | # define FE_MASK_ENV	FE_DFL_ENV | |
| 170 | ||
| 171 | #endif | |
| 172 | ||
| 173 | #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) | |
| 174 | /* Type representing floating-point control modes. */ | |
| 175 | typedef double femode_t; | |
| 176 | ||
| 177 | /* Default floating-point control modes. */ | |
| 178 | extern const femode_t __fe_dfl_mode; | |
| 179 | # define FE_DFL_MODE	(&__fe_dfl_mode) | |
| 180 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/floatn.h deleted-122| ... | ... | @@ -1,122 +0,0 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features on powerpc. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_FLOATN_H | |
| 20 | #define _BITS_FLOATN_H | |
| 21 | ||
| 22 | #include <features.h> | |
| 23 | #include <bits/long-double.h> | |
| 24 | ||
| 25 | /* Defined to 1 if the current compiler invocation provides a | |
| 26 | floating-point type with the IEEE 754 binary128 format, and this glibc | |
| 27 | includes corresponding *f128 interfaces for it. */ | |
| 28 | #if defined _ARCH_PWR8 && defined __LITTLE_ENDIAN__ && (_CALL_ELF == 2) \ | |
| 29 | && defined __FLOAT128__ && !defined __NO_LONG_DOUBLE_MATH | |
| 30 | # define __HAVE_FLOAT128 1 | |
| 31 | #else | |
| 32 | # define __HAVE_FLOAT128 0 | |
| 33 | #endif | |
| 34 | ||
| 35 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 36 | from the default float, double and long double types in this glibc, i.e. | |
| 37 | calls to the binary128 functions go to *f128 symbols instead of *l. */ | |
| 38 | #if __HAVE_FLOAT128 | |
| 39 | # define __HAVE_DISTINCT_FLOAT128 1 | |
| 40 | #else | |
| 41 | # define __HAVE_DISTINCT_FLOAT128 0 | |
| 42 | #endif | |
| 43 | ||
| 44 | /* Defined to 1 if the current compiler invocation provides a | |
| 45 | floating-point type with the right format for _Float64x, and this | |
| 46 | glibc includes corresponding *f64x interfaces for it. */ | |
| 47 | #define __HAVE_FLOAT64X __HAVE_FLOAT128 | |
| 48 | ||
| 49 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 50 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 51 | the format of _Float128, which must be different from that of long | |
| 52 | double. */ | |
| 53 | #define __HAVE_FLOAT64X_LONG_DOUBLE 0 | |
| 54 | ||
| 55 | #ifndef __ASSEMBLER__ | |
| 56 | ||
| 57 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 58 | types, if __HAVE_FLOAT128 is 1. */ | |
| 59 | # if __HAVE_FLOAT128 | |
| 60 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 61 | /* The literal suffix (f128) exist for powerpc only since GCC 7.0. */ | |
| 62 | # if __LDBL_MANT_DIG__ == 113 | |
| 63 | # define __f128(x) x##l | |
| 64 | # else | |
| 65 | # define __f128(x) x##q | |
| 66 | # endif | |
| 67 | # else | |
| 68 | # define __f128(x) x##f128 | |
| 69 | # endif | |
| 70 | # endif | |
| 71 | ||
| 72 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ | |
| 73 | # if __HAVE_FLOAT128 | |
| 74 | # if __LDBL_MANT_DIG__ == 113 && defined __cplusplus | |
| 75 | typedef long double _Float128; | |
| 76 | # define __CFLOAT128 _Complex long double | |
| 77 | # elif !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 78 | /* The type _Float128 exist for powerpc only since GCC 7.0. */ | |
| 79 | typedef __float128 _Float128; | |
| 80 | /* Add a typedef for older GCC and C++ compilers which don't natively support | |
| 81 | _Complex _Float128. */ | |
| 82 | typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__KC__))); | |
| 83 | # define __CFLOAT128 __cfloat128 | |
| 84 | # else | |
| 85 | # define __CFLOAT128 _Complex _Float128 | |
| 86 | # endif | |
| 87 | # endif | |
| 88 | ||
| 89 | /* The remaining of this file provides support for older compilers. */ | |
| 90 | # if __HAVE_FLOAT128 | |
| 91 | /* Builtin __builtin_huge_valf128 doesn't exist before GCC 7.0. */ | |
| 92 | # if !__GNUC_PREREQ (7, 0) | |
| 93 | # define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ()) | |
| 94 | # endif | |
| 95 | ||
| 96 | /* The following builtins (suffixed with 'q') are available in GCC >= 6.2, | |
| 97 | which is the minimum version required for float128 support on powerpc64le. | |
| 98 | Since GCC 7.0 the builtins suffixed with f128 are also available, then | |
| 99 | there is no need to redefined them. */ | |
| 100 | # if !__GNUC_PREREQ (7, 0) | |
| 101 | # define __builtin_copysignf128 __builtin_copysignq | |
| 102 | # define __builtin_fabsf128 __builtin_fabsq | |
| 103 | # define __builtin_inff128 __builtin_infq | |
| 104 | # define __builtin_nanf128 __builtin_nanq | |
| 105 | # define __builtin_nansf128 __builtin_nansq | |
| 106 | # endif | |
| 107 | ||
| 108 | /* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*, | |
| 109 | e.g.: __builtin_signbitf128, before GCC 6. However, there has never | |
| 110 | been a __builtin_signbitf128 in GCC and the type-generic builtin is | |
| 111 | only available since GCC 6. */ | |
| 112 | # if !__GNUC_PREREQ (6, 0) | |
| 113 | # define __builtin_signbitf128 __signbitf128 | |
| 114 | # endif | |
| 115 | ||
| 116 | # endif | |
| 117 | ||
| 118 | #endif /* !__ASSEMBLER__. */ | |
| 119 | ||
| 120 | #include <bits/floatn-common.h> | |
| 121 | ||
| 122 | #endif /* _BITS_FLOATN_H */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/fp-fast.h deleted-39| ... | ... | @@ -1,39 +0,0 @@ |
| 1 | /* Define FP_FAST_* macros. PowerPC version. | |
| 2 | Copyright (C) 2016-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _MATH_H | |
| 20 | # error "Never use <bits/fp-fast.h> directly; include <math.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifdef __USE_ISOC99 | |
| 24 | ||
| 25 | /* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l} | |
| 26 | builtins are supported. */ | |
| 27 | # if (!defined _SOFT_FLOAT && !defined __NO_FPRS__) || defined __FP_FAST_FMA | |
| 28 | # define FP_FAST_FMA 1 | |
| 29 | # endif | |
| 30 | ||
| 31 | # if (!defined _SOFT_FLOAT && !defined __NO_FPRS__) || defined __FP_FAST_FMAF | |
| 32 | # define FP_FAST_FMAF 1 | |
| 33 | # endif | |
| 34 | ||
| 35 | # ifdef __FP_FAST_FMAL | |
| 36 | # define FP_FAST_FMAL 1 | |
| 37 | # endif | |
| 38 | ||
| 39 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/hwcap.h deleted-78| ... | ... | @@ -1,78 +0,0 @@ |
| 1 | /* Defines for bits in AT_HWCAP and AT_HWCAP2. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #if !defined(_SYS_AUXV_H) && !defined(_SYSDEPS_SYSDEP_H) | |
| 20 | # error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The bit numbers must match those in the kernel's asm/cputable.h. */ | |
| 24 | ||
| 25 | /* Feature definitions in AT_HWCAP. */ | |
| 26 | #define PPC_FEATURE_32		 0x80000000 /* 32-bit mode. */ | |
| 27 | #define PPC_FEATURE_64		 0x40000000 /* 64-bit mode. */ | |
| 28 | #define PPC_FEATURE_601_INSTR	 0x20000000 /* 601 chip, Old POWER ISA. */ | |
| 29 | #define PPC_FEATURE_HAS_ALTIVEC	 0x10000000 /* SIMD/Vector Unit. */ | |
| 30 | #define PPC_FEATURE_HAS_FPU	 0x08000000 /* Floating Point Unit. */ | |
| 31 | #define PPC_FEATURE_HAS_MMU	 0x04000000 /* Memory Management Unit. */ | |
| 32 | #define PPC_FEATURE_HAS_4xxMAC	 0x02000000 /* 4xx Multiply Accumulator. */ | |
| 33 | #define PPC_FEATURE_UNIFIED_CACHE 0x01000000 /* Unified I/D cache. */ | |
| 34 | #define PPC_FEATURE_HAS_SPE	 0x00800000 /* Signal Processing ext. */ | |
| 35 | #define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000 /* SPE Float. */ | |
| 36 | #define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 /* SPE Double. */ | |
| 37 | #define PPC_FEATURE_NO_TB	 0x00100000 /* 601/403gx have no timebase */ | |
| 38 | #define PPC_FEATURE_POWER4	 0x00080000 /* POWER4 ISA 2.00 */ | |
| 39 | #define PPC_FEATURE_POWER5	 0x00040000 /* POWER5 ISA 2.02 */ | |
| 40 | #define PPC_FEATURE_POWER5_PLUS	 0x00020000 /* POWER5+ ISA 2.03 */ | |
| 41 | #define PPC_FEATURE_CELL_BE	 0x00010000 /* CELL Broadband Engine */ | |
| 42 | #define PPC_FEATURE_BOOKE	 0x00008000 /* ISA Category Embedded */ | |
| 43 | #define PPC_FEATURE_SMT		 0x00004000 /* Simultaneous | |
| 44 | 						 Multi-Threading */ | |
| 45 | #define PPC_FEATURE_ICACHE_SNOOP 0x00002000 | |
| 46 | #define PPC_FEATURE_ARCH_2_05	 0x00001000 /* ISA 2.05 */ | |
| 47 | #define PPC_FEATURE_PA6T	 0x00000800 /* PA Semi 6T Core */ | |
| 48 | #define PPC_FEATURE_HAS_DFP	 0x00000400 /* Decimal FP Unit */ | |
| 49 | #define PPC_FEATURE_POWER6_EXT	 0x00000200 /* P6 + mffgpr/mftgpr */ | |
| 50 | #define PPC_FEATURE_ARCH_2_06	 0x00000100 /* ISA 2.06 */ | |
| 51 | #define PPC_FEATURE_HAS_VSX	 0x00000080 /* P7 Vector Extension. */ | |
| 52 | #define PPC_FEATURE_PSERIES_PERFMON_COMPAT 0x00000040 | |
| 53 | /* Reserved by the kernel.	 0x00000004 Do not use. */ | |
| 54 | #define PPC_FEATURE_TRUE_LE	 0x00000002 | |
| 55 | #define PPC_FEATURE_PPC_LE	 0x00000001 | |
| 56 | ||
| 57 | /* Feature definitions in AT_HWCAP2. */ | |
| 58 | #define PPC_FEATURE2_ARCH_2_07 0x80000000 /* ISA 2.07 */ | |
| 59 | #define PPC_FEATURE2_HAS_HTM 0x40000000 /* Hardware Transactional | |
| 60 | 						 Memory */ | |
| 61 | #define PPC_FEATURE2_HAS_DSCR 0x20000000 /* Data Stream Control | |
| 62 | 						 Register */ | |
| 63 | #define PPC_FEATURE2_HAS_EBB 0x10000000 /* Event Base Branching */ | |
| 64 | #define PPC_FEATURE2_HAS_ISEL 0x08000000 /* Integer Select */ | |
| 65 | #define PPC_FEATURE2_HAS_TAR 0x04000000 /* Target Address Register */ | |
| 66 | #define PPC_FEATURE2_HAS_VEC_CRYPTO 0x02000000 /* Target supports vector | |
| 67 | 						 instruction. */ | |
| 68 | #define PPC_FEATURE2_HTM_NOSC	 0x01000000 /* Kernel aborts transaction | |
| 69 | 						 when a syscall is made. */ | |
| 70 | #define PPC_FEATURE2_ARCH_3_00	 0x00800000 /* ISA 3.0 */ | |
| 71 | #define PPC_FEATURE2_HAS_IEEE128 0x00400000 /* VSX IEEE Binary Float | |
| 72 | 						 128-bit */ | |
| 73 | #define PPC_FEATURE2_DARN	 0x00200000 /* darn instruction. */ | |
| 74 | #define PPC_FEATURE2_SCV	 0x00100000 /* scv syscall. */ | |
| 75 | #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM without suspended | |
| 76 | 						 state. */ | |
| 77 | #define PPC_FEATURE2_ARCH_3_1	 0x00040000 /* ISA 3.1. */ | |
| 78 | #define PPC_FEATURE2_MMA	 0x00020000 /* Matrix-Multiply Assist. */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/ioctl-types.h deleted-77| ... | ... | @@ -1,77 +0,0 @@ |
| 1 | /* Structure types for pre-termios terminal ioctls. Linux/powerpc version. | |
| 2 | Copyright (C) 2014-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_IOCTL_H | |
| 20 | # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Get definition of constants for use with `ioctl'. */ | |
| 24 | #include <asm/ioctls.h> | |
| 25 | ||
| 26 | ||
| 27 | struct winsize | |
| 28 | { | |
| 29 | unsigned short int ws_row; | |
| 30 | unsigned short int ws_col; | |
| 31 | unsigned short int ws_xpixel; | |
| 32 | unsigned short int ws_ypixel; | |
| 33 | }; | |
| 34 | ||
| 35 | #define NCC 10 | |
| 36 | struct termio | |
| 37 | { | |
| 38 | unsigned short int c_iflag;		/* input mode flags */ | |
| 39 | unsigned short int c_oflag;		/* output mode flags */ | |
| 40 | unsigned short int c_cflag;		/* control mode flags */ | |
| 41 | unsigned short int c_lflag;		/* local mode flags */ | |
| 42 | unsigned char c_line;		/* line discipline */ | |
| 43 | unsigned char c_cc[NCC];		/* control characters */ | |
| 44 | }; | |
| 45 | ||
| 46 | /* modem lines */ | |
| 47 | #define TIOCM_LE	0x001 | |
| 48 | #define TIOCM_DTR	0x002 | |
| 49 | #define TIOCM_RTS	0x004 | |
| 50 | #define TIOCM_ST	0x008 | |
| 51 | #define TIOCM_SR	0x010 | |
| 52 | #define TIOCM_CTS	0x020 | |
| 53 | #define TIOCM_CAR	0x040 | |
| 54 | #define TIOCM_RNG	0x080 | |
| 55 | #define TIOCM_DSR	0x100 | |
| 56 | #define TIOCM_CD	TIOCM_CAR | |
| 57 | #define TIOCM_RI	TIOCM_RNG | |
| 58 | ||
| 59 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | |
| 60 | ||
| 61 | /* line disciplines */ | |
| 62 | #define N_TTY		0 | |
| 63 | #define N_SLIP		1 | |
| 64 | #define N_MOUSE		2 | |
| 65 | #define N_PPP		3 | |
| 66 | #define N_STRIP		4 | |
| 67 | #define N_AX25		5 | |
| 68 | #define N_X25		6	/* X.25 async */ | |
| 69 | #define N_6PACK		7 | |
| 70 | #define N_MASC		8	/* Mobitex module */ | |
| 71 | #define N_R3964		9	/* Simatic R3964 module */ | |
| 72 | #define N_PROFIBUS_FDL	10	/* Profibus */ | |
| 73 | #define N_IRDA		11	/* Linux IR */ | |
| 74 | #define N_SMSBLOCK	12	/* SMS block mode */ | |
| 75 | #define N_HDLC		13	/* synchronous HDLC */ | |
| 76 | #define N_SYNC_PPP	14	/* synchronous PPP */ | |
| 77 | #define	N_HCI		15	/* Bluetooth HCI UART */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/ipc-perm.h deleted-36| ... | ... | @@ -1,36 +0,0 @@ |
| 1 | /* struct ipc_perm definition. Linux/powerpc version. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_IPC_H | |
| 20 | # error "Never use <bits/ipc-perm.h> directly; include <sys/ipc.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure used to pass permission information to IPC operations. */ | |
| 24 | struct ipc_perm | |
| 25 | { | |
| 26 | __key_t __key;		/* Key. */ | |
| 27 | __uid_t uid;		/* Owner's user ID. */ | |
| 28 | __gid_t gid;		/* Owner's group ID. */ | |
| 29 | __uid_t cuid;		/* Creator's user ID. */ | |
| 30 | __gid_t cgid;		/* Creator's group ID. */ | |
| 31 | __mode_t mode;		/* Read/write permission. */ | |
| 32 | __uint32_t __seq;		/* Sequence number. */ | |
| 33 | __uint32_t __pad1; | |
| 34 | __uint64_t __glibc_reserved1; | |
| 35 | __uint64_t __glibc_reserved2; | |
| 36 | }; | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/iscanonical.h deleted-58| ... | ... | @@ -1,58 +0,0 @@ |
| 1 | /* Define iscanonical macro. ldbl-128ibm version. | |
| 2 | Copyright (C) 2016-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _MATH_H | |
| 20 | # error "Never use <bits/iscanonical.h> directly; include <math.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #if defined (__NO_LONG_DOUBLE_MATH) || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 | |
| 24 | # define iscanonical(x) ((void) (__typeof (x)) (x), 1) | |
| 25 | #else | |
| 26 | extern int __iscanonicall (long double __x) | |
| 27 | __THROW __attribute__ ((__const__)); | |
| 28 | # define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1) | |
| 29 | # define __iscanonical(x) ((void) (__typeof (x)) (x), 1) | |
| 30 | # if __HAVE_DISTINCT_FLOAT128 | |
| 31 | # define __iscanonicalf128(x) ((void) (__typeof (x)) (x), 1) | |
| 32 | # endif | |
| 33 | ||
| 34 | /* Return nonzero value if X is canonical. In IEEE interchange binary | |
| 35 | formats, all values are canonical, but the argument must still be | |
| 36 | converted to its semantic type for any exceptions arising from the | |
| 37 | conversion, before being discarded; in IBM long double, there are | |
| 38 | encodings that are not consistently handled as corresponding to any | |
| 39 | particular value of the type, and we return 0 for those. */ | |
| 40 | # ifndef __cplusplus | |
| 41 | # define iscanonical(x) __MATH_TG ((x), __iscanonical, (x)) | |
| 42 | # else | |
| 43 | /* In C++ mode, __MATH_TG cannot be used, because it relies on | |
| 44 | __builtin_types_compatible_p, which is a C-only builtin. On the | |
| 45 | other hand, overloading provides the means to distinguish between | |
| 46 | the floating-point types. The overloading resolution will match | |
| 47 | the correct parameter (regardless of type qualifiers (i.e.: const | |
| 48 | and volatile)). */ | |
| 49 | extern "C++" { | |
| 50 | inline int iscanonical (float __val) { return __iscanonicalf (__val); } | |
| 51 | inline int iscanonical (double __val) { return __iscanonical (__val); } | |
| 52 | inline int iscanonical (long double __val) { return __iscanonicall (__val); } | |
| 53 | # if __HAVE_DISTINCT_FLOAT128 | |
| 54 | inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); } | |
| 55 | # endif | |
| 56 | } | |
| 57 | # endif /* __cplusplus */ | |
| 58 | #endif /* __NO_LONG_DOUBLE_MATH */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/link.h deleted-156| ... | ... | @@ -1,156 +0,0 @@ |
| 1 | /* Machine-specific declarations for dynamic linker interface. PowerPC version | |
| 2 | Copyright (C) 2004-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef	_LINK_H | |
| 20 | # error "Never include <bits/link.h> directly; use <link.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | ||
| 24 | #if __ELF_NATIVE_CLASS == 32 | |
| 25 | ||
| 26 | /* Registers for entry into PLT on PPC32. */ | |
| 27 | typedef struct La_ppc32_regs | |
| 28 | { | |
| 29 | uint32_t lr_reg[8]; | |
| 30 | double lr_fp[8]; | |
| 31 | uint32_t lr_vreg[12][4]; | |
| 32 | uint32_t lr_r1; | |
| 33 | uint32_t lr_lr; | |
| 34 | } La_ppc32_regs; | |
| 35 | ||
| 36 | /* Return values for calls from PLT on PPC32. */ | |
| 37 | typedef struct La_ppc32_retval | |
| 38 | { | |
| 39 | uint32_t lrv_r3; | |
| 40 | uint32_t lrv_r4; | |
| 41 | double lrv_fp[8]; | |
| 42 | uint32_t lrv_v2[4]; | |
| 43 | } La_ppc32_retval; | |
| 44 | ||
| 45 | ||
| 46 | __BEGIN_DECLS | |
| 47 | ||
| 48 | extern Elf32_Addr la_ppc32_gnu_pltenter (Elf32_Sym *__sym, | |
| 49 | 					 unsigned int __ndx, | |
| 50 | 					 uintptr_t *__refcook, | |
| 51 | 					 uintptr_t *__defcook, | |
| 52 | 					 La_ppc32_regs *__regs, | |
| 53 | 					 unsigned int *__flags, | |
| 54 | 					 const char *__symname, | |
| 55 | 					 long int *__framesizep); | |
| 56 | extern unsigned int la_ppc32_gnu_pltexit (Elf32_Sym *__sym, | |
| 57 | 					 unsigned int __ndx, | |
| 58 | 					 uintptr_t *__refcook, | |
| 59 | 					 uintptr_t *__defcook, | |
| 60 | 					 const La_ppc32_regs *__inregs, | |
| 61 | 					 La_ppc32_retval *__outregs, | |
| 62 | 					 const char *__symname); | |
| 63 | ||
| 64 | __END_DECLS | |
| 65 | ||
| 66 | #elif __ELF_NATIVE_CLASS == 64 | |
| 67 | # if _CALL_ELF != 2 | |
| 68 | ||
| 69 | /* Registers for entry into PLT on PPC64. */ | |
| 70 | typedef struct La_ppc64_regs | |
| 71 | { | |
| 72 | uint64_t lr_reg[8]; | |
| 73 | double lr_fp[13]; | |
| 74 | uint32_t __padding; | |
| 75 | uint32_t lr_vrsave; | |
| 76 | uint32_t lr_vreg[12][4]; | |
| 77 | uint64_t lr_r1; | |
| 78 | uint64_t lr_lr; | |
| 79 | } La_ppc64_regs; | |
| 80 | ||
| 81 | /* Return values for calls from PLT on PPC64. */ | |
| 82 | typedef struct La_ppc64_retval | |
| 83 | { | |
| 84 | uint64_t lrv_r3; | |
| 85 | uint64_t lrv_r4; | |
| 86 | double lrv_fp[4];	/* f1-f4, float - complex long double. */ | |
| 87 | uint32_t lrv_v2[4];	/* v2. */ | |
| 88 | } La_ppc64_retval; | |
| 89 | ||
| 90 | ||
| 91 | __BEGIN_DECLS | |
| 92 | ||
| 93 | extern Elf64_Addr la_ppc64_gnu_pltenter (Elf64_Sym *__sym, | |
| 94 | 					 unsigned int __ndx, | |
| 95 | 					 uintptr_t *__refcook, | |
| 96 | 					 uintptr_t *__defcook, | |
| 97 | 					 La_ppc64_regs *__regs, | |
| 98 | 					 unsigned int *__flags, | |
| 99 | 					 const char *__symname, | |
| 100 | 					 long int *__framesizep); | |
| 101 | extern unsigned int la_ppc64_gnu_pltexit (Elf64_Sym *__sym, | |
| 102 | 					 unsigned int __ndx, | |
| 103 | 					 uintptr_t *__refcook, | |
| 104 | 					 uintptr_t *__defcook, | |
| 105 | 					 const La_ppc64_regs *__inregs, | |
| 106 | 					 La_ppc64_retval *__outregs, | |
| 107 | 					 const char *__symname); | |
| 108 | ||
| 109 | __END_DECLS | |
| 110 | ||
| 111 | # else | |
| 112 | ||
| 113 | /* Registers for entry into PLT on PPC64 in the ELFv2 ABI. */ | |
| 114 | typedef struct La_ppc64v2_regs | |
| 115 | { | |
| 116 | uint64_t lr_reg[8]; | |
| 117 | double lr_fp[13]; | |
| 118 | uint32_t __padding; | |
| 119 | uint32_t lr_vrsave; | |
| 120 | uint32_t lr_vreg[12][4] __attribute__ ((aligned (16))); | |
| 121 | uint64_t lr_r1; | |
| 122 | uint64_t lr_lr; | |
| 123 | } La_ppc64v2_regs; | |
| 124 | ||
| 125 | /* Return values for calls from PLT on PPC64 in the ELFv2 ABI. */ | |
| 126 | typedef struct La_ppc64v2_retval | |
| 127 | { | |
| 128 | uint64_t lrv_r3; | |
| 129 | uint64_t lrv_r4; | |
| 130 | double lrv_fp[10]; | |
| 131 | uint32_t lrv_vreg[8][4] __attribute__ ((aligned (16))); | |
| 132 | } La_ppc64v2_retval; | |
| 133 | ||
| 134 | ||
| 135 | __BEGIN_DECLS | |
| 136 | ||
| 137 | extern Elf64_Addr la_ppc64v2_gnu_pltenter (Elf64_Sym *__sym, | |
| 138 | 					 unsigned int __ndx, | |
| 139 | 					 uintptr_t *__refcook, | |
| 140 | 					 uintptr_t *__defcook, | |
| 141 | 					 La_ppc64v2_regs *__regs, | |
| 142 | 					 unsigned int *__flags, | |
| 143 | 					 const char *__symname, | |
| 144 | 					 long int *__framesizep); | |
| 145 | extern unsigned int la_ppc64v2_gnu_pltexit (Elf64_Sym *__sym, | |
| 146 | 					 unsigned int __ndx, | |
| 147 | 					 uintptr_t *__refcook, | |
| 148 | 					 uintptr_t *__defcook, | |
| 149 | 					 const La_ppc64v2_regs *__inregs, | |
| 150 | 					 La_ppc64v2_retval *__outregs, | |
| 151 | 					 const char *__symname); | |
| 152 | ||
| 153 | __END_DECLS | |
| 154 | ||
| 155 | # endif | |
| 156 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/local_lim.h deleted-100| ... | ... | @@ -1,100 +0,0 @@ |
| 1 | /* Minimum guaranteed maximum values for system limits. Linux/PPC version. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; see the file COPYING.LIB. If | |
| 17 | not, see <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* The kernel header pollutes the namespace with the NR_OPEN symbol | |
| 20 | and defines LINK_MAX although filesystems have different maxima. A | |
| 21 | similar thing is true for OPEN_MAX: the limit can be changed at | |
| 22 | runtime and therefore the macro must not be defined. Remove this | |
| 23 | after including the header if necessary. */ | |
| 24 | #ifndef NR_OPEN | |
| 25 | # define __undef_NR_OPEN | |
| 26 | #endif | |
| 27 | #ifndef LINK_MAX | |
| 28 | # define __undef_LINK_MAX | |
| 29 | #endif | |
| 30 | #ifndef OPEN_MAX | |
| 31 | # define __undef_OPEN_MAX | |
| 32 | #endif | |
| 33 | #ifndef ARG_MAX | |
| 34 | # define __undef_ARG_MAX | |
| 35 | #endif | |
| 36 | ||
| 37 | /* The kernel sources contain a file with all the needed information. */ | |
| 38 | #include <linux/limits.h> | |
| 39 | ||
| 40 | /* Have to remove NR_OPEN? */ | |
| 41 | #ifdef __undef_NR_OPEN | |
| 42 | # undef NR_OPEN | |
| 43 | # undef __undef_NR_OPEN | |
| 44 | #endif | |
| 45 | /* Have to remove LINK_MAX? */ | |
| 46 | #ifdef __undef_LINK_MAX | |
| 47 | # undef LINK_MAX | |
| 48 | # undef __undef_LINK_MAX | |
| 49 | #endif | |
| 50 | /* Have to remove OPEN_MAX? */ | |
| 51 | #ifdef __undef_OPEN_MAX | |
| 52 | # undef OPEN_MAX | |
| 53 | # undef __undef_OPEN_MAX | |
| 54 | #endif | |
| 55 | /* Have to remove ARG_MAX? */ | |
| 56 | #ifdef __undef_ARG_MAX | |
| 57 | # undef ARG_MAX | |
| 58 | # undef __undef_ARG_MAX | |
| 59 | #endif | |
| 60 | ||
| 61 | /* The number of data keys per process. */ | |
| 62 | #define _POSIX_THREAD_KEYS_MAX	128 | |
| 63 | /* This is the value this implementation supports. */ | |
| 64 | #define PTHREAD_KEYS_MAX	1024 | |
| 65 | ||
| 66 | /* Controlling the iterations of destructors for thread-specific data. */ | |
| 67 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4 | |
| 68 | /* Number of iterations this implementation does. */ | |
| 69 | #define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS | |
| 70 | ||
| 71 | /* The number of threads per process. */ | |
| 72 | #define _POSIX_THREAD_THREADS_MAX	64 | |
| 73 | /* We have no predefined limit on the number of threads. */ | |
| 74 | #undef PTHREAD_THREADS_MAX | |
| 75 | ||
| 76 | /* Maximum amount by which a process can descrease its asynchronous I/O | |
| 77 | priority level. */ | |
| 78 | #define AIO_PRIO_DELTA_MAX	20 | |
| 79 | ||
| 80 | /* Minimum size for a thread. At least two pages for systems with 64k | |
| 81 | pages. */ | |
| 82 | #define PTHREAD_STACK_MIN	131072 | |
| 83 | ||
| 84 | /* Maximum number of timer expiration overruns. */ | |
| 85 | #define DELAYTIMER_MAX	2147483647 | |
| 86 | ||
| 87 | /* Maximum tty name length. */ | |
| 88 | #define TTY_NAME_MAX		32 | |
| 89 | ||
| 90 | /* Maximum login name length. This is arbitrary. */ | |
| 91 | #define LOGIN_NAME_MAX		256 | |
| 92 | ||
| 93 | /* Maximum host name length. */ | |
| 94 | #define HOST_NAME_MAX		64 | |
| 95 | ||
| 96 | /* Maximum message queue priority level. */ | |
| 97 | #define MQ_PRIO_MAX		32768 | |
| 98 | ||
| 99 | /* Maximum value the semaphore can have. */ | |
| 100 | #define SEM_VALUE_MAX (2147483647) | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/long-double.h deleted-25| ... | ... | @@ -1,25 +0,0 @@ |
| 1 | /* Properties of long double type. ldbl-opt version. | |
| 2 | Copyright (C) 2016-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __NO_LONG_DOUBLE_MATH | |
| 20 | # define __LONG_DOUBLE_MATH_OPTIONAL	1 | |
| 21 | # ifndef __LONG_DOUBLE_128__ | |
| 22 | # define __NO_LONG_DOUBLE_MATH		1 | |
| 23 | # endif | |
| 24 | #endif | |
| 25 | #define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/mman.h deleted-53| ... | ... | @@ -1,53 +0,0 @@ |
| 1 | /* Definitions for POSIX memory map interface. Linux/PowerPC version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MMAN_H | |
| 20 | # error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The following definitions basically come from the kernel headers. | |
| 24 | But the kernel header is not namespace clean. */ | |
| 25 | ||
| 26 | #define PROT_SAO	0x10		/* Strong Access Ordering. */ | |
| 27 | ||
| 28 | /* These are Linux-specific. */ | |
| 29 | #ifdef __USE_MISC | |
| 30 | # define MAP_GROWSDOWN	0x00100		/* Stack-like segment. */ | |
| 31 | # define MAP_DENYWRITE	0x00800		/* ETXTBSY */ | |
| 32 | # define MAP_EXECUTABLE	0x01000		/* Mark it as an executable. */ | |
| 33 | # define MAP_LOCKED	0x00080		/* Lock the mapping. */ | |
| 34 | # define MAP_NORESERVE	0x00040		/* Don't check for reservations. */ | |
| 35 | # define MAP_POPULATE	0x08000		/* Populate (prefault) pagetables. */ | |
| 36 | # define MAP_NONBLOCK	0x10000		/* Do not block on IO. */ | |
| 37 | # define MAP_STACK	0x20000		/* Allocation is for a stack. */ | |
| 38 | # define MAP_HUGETLB	0x40000		/* Create huge page mapping. */ | |
| 39 | # define MAP_SYNC	0x80000		/* Perform synchronous page | |
| 40 | 					 faults for the mapping. */ | |
| 41 | # define MAP_FIXED_NOREPLACE 0x100000	/* MAP_FIXED but do not unmap | |
| 42 | 					 underlying mapping. */ | |
| 43 | #endif | |
| 44 | ||
| 45 | /* Flags for `mlockall'. */ | |
| 46 | #define MCL_CURRENT	0x2000		/* Lock all currently mapped pages. */ | |
| 47 | #define MCL_FUTURE	0x4000		/* Lock all additions to address | |
| 48 | 					 space. */ | |
| 49 | #define MCL_ONFAULT	0x8000		/* Lock all pages that are | |
| 50 | 					 faulted in. */ | |
| 51 | ||
| 52 | /* Include generic Linux declarations. */ | |
| 53 | #include <bits/mman-linux.h> | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/procfs.h deleted-49| ... | ... | @@ -1,49 +0,0 @@ |
| 1 | /* Types for registers for sys/procfs.h. PowerPC version. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_PROCFS_H | |
| 20 | # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <signal.h> | |
| 24 | #include <sys/ucontext.h> | |
| 25 | ||
| 26 | /* These definitions are normally provided by ucontext.h via | |
| 27 | asm/sigcontext.h, asm/ptrace.h, and asm/elf.h. Otherwise we define | |
| 28 | them here. */ | |
| 29 | #if !defined __PPC64_ELF_H && !defined _ASM_POWERPC_ELF_H | |
| 30 | #define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ | |
| 31 | #define ELF_NFPREG 33 /* includes fpscr */ | |
| 32 | #if __WORDSIZE == 32 | |
| 33 | # define ELF_NVRREG 33 /* includes vscr */ | |
| 34 | #else | |
| 35 | # define ELF_NVRREG 34 /* includes vscr */ | |
| 36 | #endif | |
| 37 | ||
| 38 | typedef unsigned long elf_greg_t; | |
| 39 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | |
| 40 | ||
| 41 | typedef double elf_fpreg_t; | |
| 42 | typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | |
| 43 | ||
| 44 | /* Altivec registers */ | |
| 45 | typedef struct { | |
| 46 | unsigned int u[4]; | |
| 47 | } __attribute__ ((__aligned__ (16))) elf_vrreg_t; | |
| 48 | typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG]; | |
| 49 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/setjmp.h deleted-50| ... | ... | @@ -1,50 +0,0 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | /* Define the machine-dependent type `jmp_buf'. PowerPC version. */ | |
| 19 | #ifndef _BITS_SETJMP_H | |
| 20 | #define _BITS_SETJMP_H 1 | |
| 21 | ||
| 22 | #if !defined _SETJMP_H && !defined _PTHREAD_H | |
| 23 | # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* The previous bits/setjmp.h had __jmp_buf defined as a structure. | |
| 27 | We use an array of 'long int' instead, to make writing the | |
| 28 | assembler easier. Naturally, user code should not depend on | |
| 29 | either representation. */ | |
| 30 | ||
| 31 | #include <bits/wordsize.h> | |
| 32 | ||
| 33 | /* The current powerpc 32-bit Altivec ABI specifies for SVR4 ABI and EABI | |
| 34 | the vrsave must be at byte 248 & v20 at byte 256. So we must pad this | |
| 35 | correctly on 32 bit. It also insists that vecregs are only gauranteed | |
| 36 | 4 byte alignment so we need to use vperm in the setjmp/longjmp routines. | |
| 37 | We have to version the code because members like int __mask_was_saved | |
| 38 | in the jmp_buf will move as jmp_buf is now larger than 248 bytes. We | |
| 39 | cannot keep the altivec jmp_buf backward compatible with the jmp_buf. */ | |
| 40 | #ifndef	_ASM | |
| 41 | # if __WORDSIZE == 64 | |
| 42 | typedef long int __jmp_buf[64] __attribute__ ((__aligned__ (16))); | |
| 43 | # else | |
| 44 | /* The alignment is not essential, i.e.the buffer can be copied to a 4 byte | |
| 45 | aligned buffer as per the ABI it is just added for performance reasons. */ | |
| 46 | typedef long int __jmp_buf[64 + (12 * 4)] __attribute__ ((__aligned__ (16))); | |
| 47 | # endif | |
| 48 | #endif | |
| 49 | ||
| 50 | #endif /* bits/setjmp.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/sigstack.h deleted-32| ... | ... | @@ -1,32 +0,0 @@ |
| 1 | /* sigstack, sigaltstack definitions. | |
| 2 | Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGSTACK_H | |
| 20 | #define _BITS_SIGSTACK_H 1 | |
| 21 | ||
| 22 | #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H | |
| 23 | # error "Never include this file directly. Use <signal.h> instead" | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Minimum stack size for a signal handler. */ | |
| 27 | #define MINSIGSTKSZ	4096 | |
| 28 | ||
| 29 | /* System default stack size. */ | |
| 30 | #define SIGSTKSZ	16384 | |
| 31 | ||
| 32 | #endif /* bits/sigstack.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/socket-constants.h deleted-38| ... | ... | @@ -1,38 +0,0 @@ |
| 1 | /* Socket constants which vary among Linux architectures. Version for POWER. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define SOL_SOCKET 1 | |
| 24 | #define SO_ACCEPTCONN 30 | |
| 25 | #define SO_BROADCAST 6 | |
| 26 | #define SO_DONTROUTE 5 | |
| 27 | #define SO_ERROR 4 | |
| 28 | #define SO_KEEPALIVE 9 | |
| 29 | #define SO_LINGER 13 | |
| 30 | #define SO_OOBINLINE 10 | |
| 31 | #define SO_RCVBUF 8 | |
| 32 | #define SO_RCVLOWAT 16 | |
| 33 | #define SO_RCVTIMEO 18 | |
| 34 | #define SO_REUSEADDR 2 | |
| 35 | #define SO_SNDBUF 7 | |
| 36 | #define SO_SNDLOWAT 17 | |
| 37 | #define SO_SNDTIMEO 19 | |
| 38 | #define SO_TYPE 3 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/struct_mutex.h deleted-63| ... | ... | @@ -1,63 +0,0 @@ |
| 1 | /* PowerPC internal mutex struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _THREAD_MUTEX_INTERNAL_H | |
| 20 | #define _THREAD_MUTEX_INTERNAL_H 1 | |
| 21 | ||
| 22 | struct __pthread_mutex_s | |
| 23 | { | |
| 24 | int __lock; | |
| 25 | unsigned int __count; | |
| 26 | int __owner; | |
| 27 | #if __WORDSIZE == 64 | |
| 28 | unsigned int __nusers; | |
| 29 | #endif | |
| 30 | /* KIND must stay at this position in the structure to maintain | |
| 31 | binary compatibility with static initializers. */ | |
| 32 | int __kind; | |
| 33 | #if __WORDSIZE == 64 | |
| 34 | short __spins; | |
| 35 | short __elision; | |
| 36 | __pthread_list_t __list; | |
| 37 | # define __PTHREAD_MUTEX_HAVE_PREV 1 | |
| 38 | #else | |
| 39 | unsigned int __nusers; | |
| 40 | __extension__ union | |
| 41 | { | |
| 42 | struct | |
| 43 | { | |
| 44 | short __espins; | |
| 45 | short __elision; | |
| 46 | # define __spins __elision_data.__espins | |
| 47 | # define __elision __elision_data.__elision | |
| 48 | } __elision_data; | |
| 49 | __pthread_slist_t __list; | |
| 50 | }; | |
| 51 | # define __PTHREAD_MUTEX_HAVE_PREV 0 | |
| 52 | #endif | |
| 53 | }; | |
| 54 | ||
| 55 | #if __WORDSIZE == 64 | |
| 56 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 57 | 0, 0, 0, 0, __kind, 0, 0, { 0, 0 } | |
| 58 | #else | |
| 59 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 60 | 0, 0, 0, __kind, 0, { { 0, 0 } } | |
| 61 | #endif | |
| 62 | ||
| 63 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/struct_rwlock.h deleted-61| ... | ... | @@ -1,61 +0,0 @@ |
| 1 | /* PowerPC internal rwlock struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | ||
| 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 | <http://www.gnu.org/licenses/>. */ | |
| 19 | ||
| 20 | #ifndef _RWLOCK_INTERNAL_H | |
| 21 | #define _RWLOCK_INTERNAL_H | |
| 22 | ||
| 23 | struct __pthread_rwlock_arch_t | |
| 24 | { | |
| 25 | unsigned int __readers; | |
| 26 | unsigned int __writers; | |
| 27 | unsigned int __wrphase_futex; | |
| 28 | unsigned int __writers_futex; | |
| 29 | unsigned int __pad3; | |
| 30 | unsigned int __pad4; | |
| 31 | #if __WORDSIZE == 64 | |
| 32 | int __cur_writer; | |
| 33 | int __shared; | |
| 34 | unsigned char __rwelision; | |
| 35 | unsigned char __pad1[7]; | |
| 36 | unsigned long int __pad2; | |
| 37 | /* FLAGS must stay at this position in the structure to maintain | |
| 38 | binary compatibility. */ | |
| 39 | unsigned int __flags; | |
| 40 | # define __PTHREAD_RWLOCK_ELISION_EXTRA 0, {0, 0, 0, 0, 0, 0, 0 } | |
| 41 | #else | |
| 42 | unsigned char __rwelision; | |
| 43 | unsigned char __pad2; | |
| 44 | unsigned char __shared; | |
| 45 | /* FLAGS must stay at this position in the structure to maintain | |
| 46 | binary compatibility. */ | |
| 47 | unsigned char __flags; | |
| 48 | int __cur_writer; | |
| 49 | # define __PTHREAD_RWLOCK_ELISION_EXTRA 0 | |
| 50 | #endif | |
| 51 | }; | |
| 52 | ||
| 53 | #if __WORDSIZE == 64 | |
| 54 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 55 | 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, __flags | |
| 56 | #else | |
| 57 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 58 | 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0, __flags, 0 | |
| 59 | #endif | |
| 60 | ||
| 61 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/struct_stat.h deleted-225| ... | ... | @@ -1,225 +0,0 @@ |
| 1 | /* Definition for struct stat. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #if !defined _SYS_STAT_H && !defined _FCNTL_H | |
| 20 | # error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifndef _BITS_STRUCT_STAT_H | |
| 24 | #define _BITS_STRUCT_STAT_H	1 | |
| 25 | ||
| 26 | #include <bits/wordsize.h> | |
| 27 | ||
| 28 | #if __WORDSIZE == 32 | |
| 29 | ||
| 30 | struct stat | |
| 31 | { | |
| 32 | __dev_t st_dev;			/* Device. */ | |
| 33 | # ifndef __USE_FILE_OFFSET64 | |
| 34 | unsigned short int __pad1; | |
| 35 | __ino_t st_ino;			/* File serial number.	*/ | |
| 36 | # else | |
| 37 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 38 | # endif | |
| 39 | __mode_t st_mode;			/* File mode. */ | |
| 40 | __nlink_t st_nlink;			/* Link count. */ | |
| 41 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 42 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 43 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 44 | unsigned short int __pad2; | |
| 45 | # ifndef __USE_FILE_OFFSET64 | |
| 46 | __off_t st_size;			/* Size of file, in bytes. */ | |
| 47 | # else | |
| 48 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 49 | # endif | |
| 50 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 51 | ||
| 52 | # ifndef __USE_FILE_OFFSET64 | |
| 53 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 54 | # else | |
| 55 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 56 | # endif | |
| 57 | # ifdef __USE_XOPEN2K8 | |
| 58 | /* Nanosecond resolution timestamps are stored in a format | |
| 59 | equivalent to 'struct timespec'. This is the type used | |
| 60 | whenever possible but the Unix namespace rules do not allow the | |
| 61 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 62 | Therefore we have to handle the use of this header in strictly | |
| 63 | standard-compliant sources special. */ | |
| 64 | struct timespec st_atim;		/* Time of last access. */ | |
| 65 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 66 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 67 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 68 | # define st_mtime st_mtim.tv_sec | |
| 69 | # define st_ctime st_ctim.tv_sec | |
| 70 | # else | |
| 71 | __time_t st_atime;			/* Time of last access. */ | |
| 72 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 73 | __time_t st_mtime;			/* Time of last modification. */ | |
| 74 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 75 | __time_t st_ctime;			/* Time of last status change. */ | |
| 76 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 77 | # endif | |
| 78 | unsigned long int __glibc_reserved4; | |
| 79 | unsigned long int __glibc_reserved5; | |
| 80 | }; | |
| 81 | ||
| 82 | ||
| 83 | # ifdef __USE_LARGEFILE64 | |
| 84 | struct stat64 | |
| 85 | { | |
| 86 | __dev_t st_dev;			/* Device. */ | |
| 87 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 88 | __mode_t st_mode;			/* File mode. */ | |
| 89 | __nlink_t st_nlink;			/* Link count. */ | |
| 90 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 91 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 92 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 93 | unsigned short int __pad2; | |
| 94 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 95 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 96 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 97 | # ifdef __USE_XOPEN2K8 | |
| 98 | /* Nanosecond resolution timestamps are stored in a format | |
| 99 | equivalent to 'struct timespec'. This is the type used | |
| 100 | whenever possible but the Unix namespace rules do not allow the | |
| 101 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 102 | Therefore we have to handle the use of this header in strictly | |
| 103 | standard-compliant sources special. */ | |
| 104 | struct timespec st_atim;		/* Time of last access. */ | |
| 105 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 106 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 107 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 108 | # define st_mtime st_mtim.tv_sec | |
| 109 | # define st_ctime st_ctim.tv_sec | |
| 110 | # else | |
| 111 | __time_t st_atime;			/* Time of last access. */ | |
| 112 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 113 | __time_t st_mtime;			/* Time of last modification. */ | |
| 114 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 115 | __time_t st_ctime;			/* Time of last status change. */ | |
| 116 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 117 | # endif | |
| 118 | unsigned long int __glibc_reserved4; | |
| 119 | unsigned long int __glibc_reserved5; | |
| 120 | }; | |
| 121 | # endif /* __USE_LARGEFILE64 */ | |
| 122 | ||
| 123 | #else /* __WORDSIZE == 32 */ | |
| 124 | ||
| 125 | struct stat | |
| 126 | { | |
| 127 | __dev_t st_dev;			/* Device. */ | |
| 128 | # ifndef __USE_FILE_OFFSET64 | |
| 129 | __ino_t st_ino;			/* File serial number.	*/ | |
| 130 | # else | |
| 131 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 132 | # endif | |
| 133 | __nlink_t st_nlink;			/* Link count. */ | |
| 134 | __mode_t st_mode;			/* File mode. */ | |
| 135 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 136 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 137 | int __pad2; | |
| 138 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 139 | # ifndef __USE_FILE_OFFSET64 | |
| 140 | __off_t st_size;			/* Size of file, in bytes. */ | |
| 141 | # else | |
| 142 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 143 | # endif | |
| 144 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 145 | ||
| 146 | # ifndef __USE_FILE_OFFSET64 | |
| 147 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 148 | # else | |
| 149 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 150 | # endif | |
| 151 | # ifdef __USE_XOPEN2K8 | |
| 152 | /* Nanosecond resolution timestamps are stored in a format | |
| 153 | equivalent to 'struct timespec'. This is the type used | |
| 154 | whenever possible but the Unix namespace rules do not allow the | |
| 155 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 156 | Therefore we have to handle the use of this header in strictly | |
| 157 | standard-compliant sources special. */ | |
| 158 | struct timespec st_atim;		/* Time of last access. */ | |
| 159 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 160 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 161 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 162 | # define st_mtime st_mtim.tv_sec | |
| 163 | # define st_ctime st_ctim.tv_sec | |
| 164 | # else | |
| 165 | __time_t st_atime;			/* Time of last access. */ | |
| 166 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 167 | __time_t st_mtime;			/* Time of last modification. */ | |
| 168 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 169 | __time_t st_ctime;			/* Time of last status change. */ | |
| 170 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 171 | # endif | |
| 172 | unsigned long int __glibc_reserved4; | |
| 173 | unsigned long int __glibc_reserved5; | |
| 174 | unsigned long int __glibc_reserved6; | |
| 175 | }; | |
| 176 | ||
| 177 | # ifdef __USE_LARGEFILE64 | |
| 178 | struct stat64 | |
| 179 | { | |
| 180 | __dev_t st_dev;			/* Device. */ | |
| 181 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 182 | __nlink_t st_nlink;			/* Link count. */ | |
| 183 | __mode_t st_mode;			/* File mode. */ | |
| 184 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 185 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 186 | int __pad2; | |
| 187 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 188 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 189 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 190 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 191 | # ifdef __USE_XOPEN2K8 | |
| 192 | /* Nanosecond resolution timestamps are stored in a format | |
| 193 | equivalent to 'struct timespec'. This is the type used | |
| 194 | whenever possible but the Unix namespace rules do not allow the | |
| 195 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 196 | Therefore we have to handle the use of this header in strictly | |
| 197 | standard-compliant sources special. */ | |
| 198 | struct timespec st_atim;		/* Time of last access. */ | |
| 199 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 200 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 201 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 202 | # define st_mtime st_mtim.tv_sec | |
| 203 | # define st_ctime st_ctim.tv_sec | |
| 204 | # else | |
| 205 | __time_t st_atime;			/* Time of last access. */ | |
| 206 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 207 | __time_t st_mtime;			/* Time of last modification. */ | |
| 208 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 209 | __time_t st_ctime;			/* Time of last status change. */ | |
| 210 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 211 | # endif | |
| 212 | unsigned long int __glibc_reserved4; | |
| 213 | unsigned long int __glibc_reserved5; | |
| 214 | unsigned long int __glibc_reserved6; | |
| 215 | }; | |
| 216 | # endif /* __USE_LARGEFILE64 */ | |
| 217 | #endif | |
| 218 | ||
| 219 | /* Tell code we have these members. */ | |
| 220 | #define	_STATBUF_ST_BLKSIZE | |
| 221 | #define _STATBUF_ST_RDEV | |
| 222 | /* Nanosecond resolution time values are supported. */ | |
| 223 | #define _STATBUF_ST_NSEC | |
| 224 | ||
| 225 | #endif /* _BITS_STRUCT_STAT_H */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/termios-baud.h deleted-45| ... | ... | @@ -1,45 +0,0 @@ |
| 1 | /* termios baud rate selection definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-baud.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifdef __USE_MISC | |
| 24 | # define CBAUD	0000377 | |
| 25 | # define CBAUDEX 0000020 | |
| 26 | # define CMSPAR 010000000000		/* mark or space (stick) parity */ | |
| 27 | # define CRTSCTS 020000000000		/* flow control */ | |
| 28 | #endif | |
| 29 | ||
| 30 | #define B57600 00020 | |
| 31 | #define B115200 00021 | |
| 32 | #define B230400 00022 | |
| 33 | #define B460800 00023 | |
| 34 | #define B500000 00024 | |
| 35 | #define B576000 00025 | |
| 36 | #define B921600 00026 | |
| 37 | #define B1000000 00027 | |
| 38 | #define B1152000 00030 | |
| 39 | #define B1500000 00031 | |
| 40 | #define B2000000 00032 | |
| 41 | #define B2500000 00033 | |
| 42 | #define B3000000 00034 | |
| 43 | #define B3500000 00035 | |
| 44 | #define B4000000 00036 | |
| 45 | #define __MAX_BAUD B4000000 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/termios-c_cc.h deleted-41| ... | ... | @@ -1,41 +0,0 @@ |
| 1 | /* termios c_cc symbolic constant definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_cc.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_cc characters */ | |
| 24 | #define VINTR	0 | |
| 25 | #define VQUIT	1 | |
| 26 | #define VERASE	2 | |
| 27 | #define VKILL	3 | |
| 28 | #define VEOF	4 | |
| 29 | #define VMIN	5 | |
| 30 | #define VEOL	6 | |
| 31 | #define VTIME	7 | |
| 32 | #define VEOL2	8 | |
| 33 | #define VSWTC	9 | |
| 34 | ||
| 35 | #define VWERASE	10 | |
| 36 | #define VREPRINT	11 | |
| 37 | #define VSUSP		12 | |
| 38 | #define VSTART		13 | |
| 39 | #define VSTOP		14 | |
| 40 | #define VLNEXT		15 | |
| 41 | #define VDISCARD	16 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/termios-c_cflag.h deleted-35| ... | ... | @@ -1,35 +0,0 @@ |
| 1 | /* termios control mode definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_cflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define CSIZE	00001400 | |
| 24 | #define CS5	00000000 | |
| 25 | #define CS6	00000400 | |
| 26 | #define CS7	00001000 | |
| 27 | #define CS8	00001400 | |
| 28 | ||
| 29 | #define CSTOPB	00002000 | |
| 30 | #define CREAD	00004000 | |
| 31 | #define PARENB	00010000 | |
| 32 | #define PARODD	00020000 | |
| 33 | #define HUPCL	00040000 | |
| 34 | ||
| 35 | #define CLOCAL	00100000 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/termios-c_iflag.h deleted-38| ... | ... | @@ -1,38 +0,0 @@ |
| 1 | /* termios input mode definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_iflags.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_iflag bits */ | |
| 24 | #define IGNBRK	0000001 | |
| 25 | #define BRKINT	0000002 | |
| 26 | #define IGNPAR	0000004 | |
| 27 | #define PARMRK	0000010 | |
| 28 | #define INPCK	0000020 | |
| 29 | #define ISTRIP	0000040 | |
| 30 | #define INLCR	0000100 | |
| 31 | #define IGNCR	0000200 | |
| 32 | #define ICRNL	0000400 | |
| 33 | #define IXON	0001000 | |
| 34 | #define IXOFF	0002000 | |
| 35 | #define IXANY	0004000 | |
| 36 | #define IUCLC	0010000 | |
| 37 | #define IMAXBEL	0020000 | |
| 38 | #define IUTF8	0040000 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/termios-c_lflag.h deleted-45| ... | ... | @@ -1,45 +0,0 @@ |
| 1 | /* termios local mode definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_lflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_lflag bits */ | |
| 24 | #define ISIG	0x00000080 | |
| 25 | #define ICANON	0x00000100 | |
| 26 | #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) | |
| 27 | # define XCASE	0x00004000 | |
| 28 | #endif | |
| 29 | #define ECHO	0x00000008 | |
| 30 | #define ECHOE	0x00000002 | |
| 31 | #define ECHOK	0x00000004 | |
| 32 | #define ECHONL	0x00000010 | |
| 33 | #define NOFLSH	0x80000000 | |
| 34 | #define TOSTOP	0x00400000 | |
| 35 | #ifdef __USE_MISC | |
| 36 | # define ECHOCTL	0x00000040 | |
| 37 | # define ECHOPRT	0x00000020 | |
| 38 | # define ECHOKE	0x00000001 | |
| 39 | # define FLUSHO	0x00800000 | |
| 40 | # define PENDIN	0x20000000 | |
| 41 | #endif | |
| 42 | #define IEXTEN	0x00000400 | |
| 43 | #ifdef __USE_MISC | |
| 44 | # define EXTPROC 0x10000000 | |
| 45 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/termios-c_oflag.h deleted-65| ... | ... | @@ -1,65 +0,0 @@ |
| 1 | /* termios output mode definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_oflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_oflag bits */ | |
| 24 | #define OPOST	0000001 | |
| 25 | #define ONLCR	0000002 | |
| 26 | #define OLCUC	0000004 | |
| 27 | ||
| 28 | #define OCRNL	0000010 | |
| 29 | #define ONOCR	0000020 | |
| 30 | #define ONLRET	0000040 | |
| 31 | ||
| 32 | #define OFILL	00000100 | |
| 33 | #define OFDEL	00000200 | |
| 34 | #if defined __USE_MISC || defined __USE_XOPEN | |
| 35 | # define NLDLY	00001400 | |
| 36 | # define NL0	00000000 | |
| 37 | # define NL1	00000400 | |
| 38 | # if defined __USE_MISC | |
| 39 | # define NL2	00001000 | |
| 40 | # define NL3	00001400 | |
| 41 | # endif | |
| 42 | # define TABDLY	00006000 | |
| 43 | # define TAB0	00000000 | |
| 44 | # define TAB1	00002000 | |
| 45 | # define TAB2	00004000 | |
| 46 | # define TAB3	00006000 | |
| 47 | # define CRDLY	00030000 | |
| 48 | # define CR0	00000000 | |
| 49 | # define CR1	00010000 | |
| 50 | # define CR2	00020000 | |
| 51 | # define CR3	00030000 | |
| 52 | # define FFDLY	00040000 | |
| 53 | # define FF0	00000000 | |
| 54 | # define FF1	00040000 | |
| 55 | # define BSDLY	00100000 | |
| 56 | # define BS0	00000000 | |
| 57 | # define BS1	00100000 | |
| 58 | #endif | |
| 59 | #define VTDLY	00200000 | |
| 60 | #define VT0	00000000 | |
| 61 | #define VT1	00200000 | |
| 62 | ||
| 63 | #ifdef __USE_MISC | |
| 64 | # define XTABS	00006000 | |
| 65 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/termios-misc.h deleted-72| ... | ... | @@ -1,72 +0,0 @@ |
| 1 | /* termios baud platform specific definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-misc.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifdef __USE_MISC | |
| 24 | ||
| 25 | struct sgttyb { | |
| 26 | 	char	sg_ispeed; | |
| 27 | 	char	sg_ospeed; | |
| 28 | 	char	sg_erase; | |
| 29 | 	char	sg_kill; | |
| 30 | 	short	sg_flags; | |
| 31 | }; | |
| 32 | ||
| 33 | struct tchars { | |
| 34 | 	char	t_intrc; | |
| 35 | 	char	t_quitc; | |
| 36 | 	char	t_startc; | |
| 37 | 	char	t_stopc; | |
| 38 | 	char	t_eofc; | |
| 39 | 	char	t_brkc; | |
| 40 | }; | |
| 41 | ||
| 42 | struct ltchars { | |
| 43 | 	char	t_suspc; | |
| 44 | 	char	t_dsuspc; | |
| 45 | 	char	t_rprntc; | |
| 46 | 	char	t_flushc; | |
| 47 | 	char	t_werasc; | |
| 48 | 	char	t_lnextc; | |
| 49 | }; | |
| 50 | ||
| 51 | /* Used for packet mode */ | |
| 52 | #define TIOCPKT_DATA		 0 | |
| 53 | #define TIOCPKT_FLUSHREAD	 1 | |
| 54 | #define TIOCPKT_FLUSHWRITE	 2 | |
| 55 | #define TIOCPKT_STOP		 4 | |
| 56 | #define TIOCPKT_START		 8 | |
| 57 | #define TIOCPKT_NOSTOP		16 | |
| 58 | #define TIOCPKT_DOSTOP		32 | |
| 59 | ||
| 60 | /* c_cc characters */ | |
| 61 | #define _VINTR	0 | |
| 62 | #define _VQUIT	1 | |
| 63 | #define _VERASE	2 | |
| 64 | #define _VKILL	3 | |
| 65 | #define _VEOF	4 | |
| 66 | #define _VMIN	5 | |
| 67 | #define _VEOL	6 | |
| 68 | #define _VTIME	7 | |
| 69 | #define _VEOL2	8 | |
| 70 | #define _VSWTC	9 | |
| 71 | ||
| 72 | #endif /* __USE_MISC */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/types/struct_msqid_ds.h deleted-47| ... | ... | @@ -1,47 +0,0 @@ |
| 1 | /* Linux/PowerPC implementation of the SysV message struct msqid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MSG_H | |
| 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Structure of record for one message inside the kernel. | |
| 24 | The type `struct msg' is opaque. */ | |
| 25 | struct msqid_ds | |
| 26 | { | |
| 27 | struct ipc_perm msg_perm;	/* structure describing operation permission */ | |
| 28 | #if __TIMESIZE == 32 | |
| 29 | unsigned long int __msg_stime_high; | |
| 30 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 31 | unsigned long int __msg_rtime_high; | |
| 32 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 33 | unsigned long int __msg_ctime_high; | |
| 34 | __time_t msg_ctime;		/* time of last change */ | |
| 35 | #else | |
| 36 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 37 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 38 | __time_t msg_ctime;		/* time of last change */ | |
| 39 | #endif | |
| 40 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ | |
| 41 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ | |
| 42 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ | |
| 43 | __pid_t msg_lspid;		/* pid of last msgsnd() */ | |
| 44 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ | |
| 45 | __syscall_ulong_t __glibc_reserved4; | |
| 46 | __syscall_ulong_t __glibc_reserved5; | |
| 47 | }; | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/types/struct_semid_ds.h deleted-39| ... | ... | @@ -1,39 +0,0 @@ |
| 1 | /* PowerPC implementation of the semaphore struct semid_ds. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SEM_H | |
| 20 | # error "Never include <bits/types/struct_semid_ds.h> directly; use <sys/sem.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a set of semaphores. */ | |
| 24 | struct semid_ds | |
| 25 | { | |
| 26 | struct ipc_perm sem_perm; /* operation permission struct */ | |
| 27 | #if __TIMESIZE == 32 | |
| 28 | __syscall_ulong_t __sem_otime_high; | |
| 29 | __time_t sem_otime; /* last semop() time */ | |
| 30 | __syscall_ulong_t __sem_ctime_high; | |
| 31 | __time_t sem_ctime; /* last time changed by semctl() */ | |
| 32 | #else | |
| 33 | __time_t sem_otime; /* last semop() time */ | |
| 34 | __time_t sem_ctime; /* last time changed by semctl() */ | |
| 35 | #endif | |
| 36 | __syscall_ulong_t sem_nsems; /* number of semaphores in set */ | |
| 37 | __syscall_ulong_t __glibc_reserved3; | |
| 38 | __syscall_ulong_t __glibc_reserved4; | |
| 39 | }; | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/types/struct_shmid_ds.h deleted-46| ... | ... | @@ -1,46 +0,0 @@ |
| 1 | /* Linux/PowerPC implementation of the shared memory struct shmid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never include <bits/types/struct_shmid_ds.h> directly; use <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a shared memory segment. */ | |
| 24 | struct shmid_ds | |
| 25 | { | |
| 26 | struct ipc_perm shm_perm;		/* operation permission struct */ | |
| 27 | #if __TIMESIZE == 32 | |
| 28 | unsigned long int __shm_atime_high; | |
| 29 | __time_t shm_atime;			/* time of last shmat() */ | |
| 30 | unsigned long int __shm_dtime_high; | |
| 31 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 32 | unsigned long int __shm_ctime_high; | |
| 33 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 34 | unsigned long int __glibc_reserved4; | |
| 35 | #else | |
| 36 | __time_t shm_atime;			/* time of last shmat() */ | |
| 37 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 38 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 39 | #endif | |
| 40 | size_t shm_segsz;			/* size of segment in bytes */ | |
| 41 | __pid_t shm_cpid;			/* pid of creator */ | |
| 42 | __pid_t shm_lpid;			/* pid of last shmop */ | |
| 43 | shmatt_t shm_nattch;		/* number of current attaches */ | |
| 44 | __syscall_ulong_t __glibc_reserved5; | |
| 45 | __syscall_ulong_t __glibc_reserved6; | |
| 46 | }; | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/bits/wordsize.h deleted-11| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | /* Determine the wordsize from the preprocessor defines. */ | |
| 2 | ||
| 3 | #if defined __powerpc64__ | |
| 4 | # define __WORDSIZE	64 | |
| 5 | # define __WORDSIZE_TIME64_COMPAT32	1 | |
| 6 | #else | |
| 7 | # define __WORDSIZE	32 | |
| 8 | # define __WORDSIZE_TIME64_COMPAT32	0 | |
| 9 | # define __WORDSIZE32_SIZE_ULONG	0 | |
| 10 | # define __WORDSIZE32_PTRDIFF_LONG	0 | |
| 11 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/fpu_control.h deleted-114| ... | ... | @@ -1,114 +0,0 @@ |
| 1 | /* FPU control word definitions. PowerPC version. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _FPU_CONTROL_H | |
| 20 | #define _FPU_CONTROL_H | |
| 21 | ||
| 22 | #if defined __SPE__ || (defined __NO_FPRS__ && !defined _SOFT_FLOAT) | |
| 23 | # error "SPE/e500 is no longer supported" | |
| 24 | #endif | |
| 25 | ||
| 26 | #ifdef _SOFT_FLOAT | |
| 27 | ||
| 28 | # define _FPU_RESERVED 0xffffffff | |
| 29 | # define _FPU_DEFAULT 0x00000000 /* Default value. */ | |
| 30 | typedef unsigned int fpu_control_t; | |
| 31 | # define _FPU_GETCW(cw) (cw) = 0 | |
| 32 | # define _FPU_SETCW(cw) (void) (cw) | |
| 33 | extern fpu_control_t __fpu_control; | |
| 34 | ||
| 35 | #else /* PowerPC 6xx floating-point. */ | |
| 36 | ||
| 37 | /* rounding control */ | |
| 38 | # define _FPU_RC_NEAREST 0x00 /* RECOMMENDED */ | |
| 39 | # define _FPU_RC_DOWN 0x03 | |
| 40 | # define _FPU_RC_UP 0x02 | |
| 41 | # define _FPU_RC_ZERO 0x01 | |
| 42 | ||
| 43 | # define _FPU_MASK_RC (_FPU_RC_NEAREST|_FPU_RC_DOWN|_FPU_RC_UP|_FPU_RC_ZERO) | |
| 44 | ||
| 45 | # define _FPU_MASK_NI 0x04 /* non-ieee mode */ | |
| 46 | ||
| 47 | /* masking of interrupts */ | |
| 48 | # define _FPU_MASK_ZM 0x10 /* zero divide */ | |
| 49 | # define _FPU_MASK_OM 0x40 /* overflow */ | |
| 50 | # define _FPU_MASK_UM 0x20 /* underflow */ | |
| 51 | # define _FPU_MASK_XM 0x08 /* inexact */ | |
| 52 | # define _FPU_MASK_IM 0x80 /* invalid operation */ | |
| 53 | ||
| 54 | # define _FPU_RESERVED 0xffffff00 /* These bits are reserved are not changed. */ | |
| 55 | ||
| 56 | /* The fdlibm code requires no interrupts for exceptions. */ | |
| 57 | # define _FPU_DEFAULT 0x00000000 /* Default value. */ | |
| 58 | ||
| 59 | /* IEEE: same as above, but (some) exceptions; | |
| 60 | we leave the 'inexact' exception off. | |
| 61 | */ | |
| 62 | # define _FPU_IEEE 0x000000f0 | |
| 63 | ||
| 64 | /* Type of the control word. */ | |
| 65 | typedef unsigned int fpu_control_t; | |
| 66 | ||
| 67 | /* Macros for accessing the hardware control word. */ | |
| 68 | # define _FPU_GETCW(cw)						\ | |
| 69 | ({union { double __d; unsigned long long __ll; } __u;		\ | |
| 70 | __asm__ __volatile__("mffs %0" : "=f" (__u.__d));		\ | |
| 71 | (cw) = (fpu_control_t) __u.__ll;				\ | |
| 72 | (fpu_control_t) __u.__ll;					\ | |
| 73 | }) | |
| 74 | ||
| 75 | # define _FPU_GET_RC_ISA300()						\ | |
| 76 | ({union { double __d; unsigned long long __ll; } __u;			\ | |
| 77 | __asm__ __volatile__(						\ | |
| 78 | ".machine push; .machine \"power9\"; mffsl %0; .machine pop" 	\ | |
| 79 | : "=f" (__u.__d));						\ | |
| 80 | (fpu_control_t) (__u.__ll & _FPU_MASK_RC);				\ | |
| 81 | }) | |
| 82 | ||
| 83 | # ifdef _ARCH_PWR9 | |
| 84 | # define _FPU_GET_RC() _FPU_GET_RC_ISA300() | |
| 85 | # elif defined __BUILTIN_CPU_SUPPORTS__ | |
| 86 | # define _FPU_GET_RC()							\ | |
| 87 | ({fpu_control_t __rc;							\ | |
| 88 | __rc = __glibc_likely (__builtin_cpu_supports ("arch_3_00"))	\ | |
| 89 | ? _FPU_GET_RC_ISA300 ()						\ | |
| 90 | : _FPU_GETCW (__rc) & _FPU_MASK_RC;				\ | |
| 91 | __rc;								\ | |
| 92 | }) | |
| 93 | # else | |
| 94 | # define _FPU_GET_RC()						\ | |
| 95 | ({fpu_control_t __rc = _FPU_GETCW (__rc) & _FPU_MASK_RC;	\ | |
| 96 | __rc;							\ | |
| 97 | }) | |
| 98 | # endif | |
| 99 | ||
| 100 | # define _FPU_SETCW(cw)						\ | |
| 101 | { union { double __d; unsigned long long __ll; } __u;		\ | |
| 102 | register double __fr;					\ | |
| 103 | __u.__ll = 0xfff80000LL << 32; /* This is a QNaN. */	\ | |
| 104 | __u.__ll |= (cw) & 0xffffffffLL;				\ | |
| 105 | __fr = __u.__d;						\ | |
| 106 | __asm__ __volatile__("mtfsf 255,%0" : : "f" (__fr));	\ | |
| 107 | } | |
| 108 | ||
| 109 | /* Default control word set at startup. */ | |
| 110 | extern fpu_control_t __fpu_control; | |
| 111 | ||
| 112 | #endif /* PowerPC 6xx floating-point. */ | |
| 113 | ||
| 114 | #endif /* _FPU_CONTROL_H */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h deleted-28| ... | ... | @@ -1,28 +0,0 @@ |
| 1 | /* This file is automatically generated. */ | |
| 2 | #ifndef __GNU_LIB_NAMES_H | |
| 3 | # error "Never use <gnu/lib-names-32.h> directly; include <gnu/lib-names.h> instead." | |
| 4 | #endif | |
| 5 | ||
| 6 | #define LD_SO "ld.so.1" | |
| 7 | #define LIBANL_SO "libanl.so.1" | |
| 8 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" | |
| 9 | #define LIBCRYPT_SO "libcrypt.so.1" | |
| 10 | #define LIBC_SO "libc.so.6" | |
| 11 | #define LIBDL_SO "libdl.so.2" | |
| 12 | #define LIBGCC_S_SO "libgcc_s.so.1" | |
| 13 | #define LIBMVEC_SO "libmvec.so.1" | |
| 14 | #define LIBM_SO "libm.so.6" | |
| 15 | #define LIBNSL_SO "libnsl.so.1" | |
| 16 | #define LIBNSS_COMPAT_SO "libnss_compat.so.2" | |
| 17 | #define LIBNSS_DB_SO "libnss_db.so.2" | |
| 18 | #define LIBNSS_DNS_SO "libnss_dns.so.2" | |
| 19 | #define LIBNSS_FILES_SO "libnss_files.so.2" | |
| 20 | #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" | |
| 21 | #define LIBNSS_LDAP_SO "libnss_ldap.so.2" | |
| 22 | #define LIBNSS_TEST1_SO "libnss_test1.so.2" | |
| 23 | #define LIBNSS_TEST2_SO "libnss_test2.so.2" | |
| 24 | #define LIBPTHREAD_SO "libpthread.so.0" | |
| 25 | #define LIBRESOLV_SO "libresolv.so.2" | |
| 26 | #define LIBRT_SO "librt.so.1" | |
| 27 | #define LIBTHREAD_DB_SO "libthread_db.so.1" | |
| 28 | #define LIBUTIL_SO "libutil.so.1" | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/gnu/lib-names.h deleted-19| ... | ... | @@ -1,19 +0,0 @@ |
| 1 | /* This file is automatically generated. | |
| 2 | It defines macros to allow user program to find the shared | |
| 3 | library files which come as part of GNU libc. */ | |
| 4 | #ifndef __GNU_LIB_NAMES_H | |
| 5 | #define __GNU_LIB_NAMES_H	1 | |
| 6 | ||
| 7 | #include <bits/wordsize.h> | |
| 8 | ||
| 9 | #if __WORDSIZE == 32 | |
| 10 | # include <gnu/lib-names-32.h> | |
| 11 | #endif | |
| 12 | #if __WORDSIZE == 64 && _CALL_ELF != 2 | |
| 13 | # include <gnu/lib-names-64-v1.h> | |
| 14 | #endif | |
| 15 | #if __WORDSIZE == 64 && _CALL_ELF == 2 | |
| 16 | # include <gnu/lib-names-64-v2.h> | |
| 17 | #endif | |
| 18 | ||
| 19 | #endif	/* gnu/lib-names.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/gnu/stubs.h deleted-15| ... | ... | @@ -1,15 +0,0 @@ |
| 1 | /* This file is automatically generated. | |
| 2 | This file selects the right generated file of `__stub_FUNCTION' macros | |
| 3 | based on the architecture being compiled for. */ | |
| 4 | ||
| 5 | #include <bits/wordsize.h> | |
| 6 | ||
| 7 | #if __WORDSIZE == 32 | |
| 8 | # include <gnu/stubs-32.h> | |
| 9 | #endif | |
| 10 | #if __WORDSIZE == 64 && _CALL_ELF != 2 | |
| 11 | # include <gnu/stubs-64-v1.h> | |
| 12 | #endif | |
| 13 | #if __WORDSIZE == 64 && _CALL_ELF == 2 | |
| 14 | # include <gnu/stubs-64-v2.h> | |
| 15 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/ieee754.h deleted-197| ... | ... | @@ -1,197 +0,0 @@ |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _IEEE754_H | |
| 19 | #define _IEEE754_H 1 | |
| 20 | ||
| 21 | #include <features.h> | |
| 22 | ||
| 23 | #include <bits/endian.h> | |
| 24 | #include <bits/floatn.h> | |
| 25 | ||
| 26 | __BEGIN_DECLS | |
| 27 | ||
| 28 | union ieee754_float | |
| 29 | { | |
| 30 | float f; | |
| 31 | ||
| 32 | /* This is the IEEE 754 single-precision format. */ | |
| 33 | struct | |
| 34 | { | |
| 35 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 36 | 	unsigned int negative:1; | |
| 37 | 	unsigned int exponent:8; | |
| 38 | 	unsigned int mantissa:23; | |
| 39 | #endif				/* Big endian. */ | |
| 40 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 41 | 	unsigned int mantissa:23; | |
| 42 | 	unsigned int exponent:8; | |
| 43 | 	unsigned int negative:1; | |
| 44 | #endif				/* Little endian. */ | |
| 45 | } ieee; | |
| 46 | ||
| 47 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 48 | struct | |
| 49 | { | |
| 50 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 51 | 	unsigned int negative:1; | |
| 52 | 	unsigned int exponent:8; | |
| 53 | 	unsigned int quiet_nan:1; | |
| 54 | 	unsigned int mantissa:22; | |
| 55 | #endif				/* Big endian. */ | |
| 56 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 57 | 	unsigned int mantissa:22; | |
| 58 | 	unsigned int quiet_nan:1; | |
| 59 | 	unsigned int exponent:8; | |
| 60 | 	unsigned int negative:1; | |
| 61 | #endif				/* Little endian. */ | |
| 62 | } ieee_nan; | |
| 63 | }; | |
| 64 | ||
| 65 | #define IEEE754_FLOAT_BIAS	0x7f /* Added to exponent. */ | |
| 66 | ||
| 67 | ||
| 68 | union ieee754_double | |
| 69 | { | |
| 70 | double d; | |
| 71 | ||
| 72 | /* This is the IEEE 754 double-precision format. */ | |
| 73 | struct | |
| 74 | { | |
| 75 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 76 | 	unsigned int negative:1; | |
| 77 | 	unsigned int exponent:11; | |
| 78 | 	/* Together these comprise the mantissa. */ | |
| 79 | 	unsigned int mantissa0:20; | |
| 80 | 	unsigned int mantissa1:32; | |
| 81 | #endif				/* Big endian. */ | |
| 82 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 83 | 	/* Together these comprise the mantissa. */ | |
| 84 | 	unsigned int mantissa1:32; | |
| 85 | 	unsigned int mantissa0:20; | |
| 86 | 	unsigned int exponent:11; | |
| 87 | 	unsigned int negative:1; | |
| 88 | #endif				/* Little endian. */ | |
| 89 | } ieee; | |
| 90 | ||
| 91 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 92 | struct | |
| 93 | { | |
| 94 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 95 | 	unsigned int negative:1; | |
| 96 | 	unsigned int exponent:11; | |
| 97 | 	unsigned int quiet_nan:1; | |
| 98 | 	/* Together these comprise the mantissa. */ | |
| 99 | 	unsigned int mantissa0:19; | |
| 100 | 	unsigned int mantissa1:32; | |
| 101 | #else | |
| 102 | 	/* Together these comprise the mantissa. */ | |
| 103 | 	unsigned int mantissa1:32; | |
| 104 | 	unsigned int mantissa0:19; | |
| 105 | 	unsigned int quiet_nan:1; | |
| 106 | 	unsigned int exponent:11; | |
| 107 | 	unsigned int negative:1; | |
| 108 | #endif | |
| 109 | } ieee_nan; | |
| 110 | }; | |
| 111 | ||
| 112 | #define IEEE754_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 113 | ||
| 114 | ||
| 115 | #if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 | |
| 116 | /* long double is IEEE 128 bit */ | |
| 117 | union ieee854_long_double | |
| 118 | { | |
| 119 | long double d; | |
| 120 | ||
| 121 | /* This is the IEEE 854 quad-precision format. */ | |
| 122 | struct | |
| 123 | { | |
| 124 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 125 | 	unsigned int negative:1; | |
| 126 | 	unsigned int exponent:15; | |
| 127 | 	/* Together these comprise the mantissa. */ | |
| 128 | 	unsigned int mantissa0:16; | |
| 129 | 	unsigned int mantissa1:32; | |
| 130 | 	unsigned int mantissa2:32; | |
| 131 | 	unsigned int mantissa3:32; | |
| 132 | #endif				/* Big endian. */ | |
| 133 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 134 | 	/* Together these comprise the mantissa. */ | |
| 135 | 	unsigned int mantissa3:32; | |
| 136 | 	unsigned int mantissa2:32; | |
| 137 | 	unsigned int mantissa1:32; | |
| 138 | 	unsigned int mantissa0:16; | |
| 139 | 	unsigned int exponent:15; | |
| 140 | 	unsigned int negative:1; | |
| 141 | #endif				/* Little endian. */ | |
| 142 | } ieee; | |
| 143 | ||
| 144 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 145 | struct | |
| 146 | { | |
| 147 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 148 | 	unsigned int negative:1; | |
| 149 | 	unsigned int exponent:15; | |
| 150 | 	unsigned int quiet_nan:1; | |
| 151 | 	/* Together these comprise the mantissa. */ | |
| 152 | 	unsigned int mantissa0:15; | |
| 153 | 	unsigned int mantissa1:32; | |
| 154 | 	unsigned int mantissa2:32; | |
| 155 | 	unsigned int mantissa3:32; | |
| 156 | #else | |
| 157 | 	/* Together these comprise the mantissa. */ | |
| 158 | 	unsigned int mantissa3:32; | |
| 159 | 	unsigned int mantissa2:32; | |
| 160 | 	unsigned int mantissa1:32; | |
| 161 | 	unsigned int mantissa0:15; | |
| 162 | 	unsigned int quiet_nan:1; | |
| 163 | 	unsigned int exponent:15; | |
| 164 | 	unsigned int negative:1; | |
| 165 | #endif | |
| 166 | } ieee_nan; | |
| 167 | }; | |
| 168 | ||
| 169 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ | |
| 170 | #endif | |
| 171 | ||
| 172 | ||
| 173 | #if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 || __GNUC_PREREQ (7, 0) | |
| 174 | /* IBM extended format for long double. | |
| 175 | ||
| 176 | Each long double is made up of two IEEE doubles. The value of the | |
| 177 | long double is the sum of the values of the two parts. The most | |
| 178 | significant part is required to be the value of the long double | |
| 179 | rounded to the nearest double, as specified by IEEE. For Inf | |
| 180 | values, the least significant part is required to be one of +0.0 or | |
| 181 | -0.0. No other requirements are made; so, for example, 1.0 may be | |
| 182 | represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a | |
| 183 | NaN is don't-care. */ | |
| 184 | union ibm_extended_long_double | |
| 185 | { | |
| 186 | # if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && __GNUC_PREREQ (7, 0) | |
| 187 | __ibm128 ld; | |
| 188 | # else | |
| 189 | long double ld; | |
| 190 | # endif | |
| 191 | union ieee754_double d[2]; | |
| 192 | }; | |
| 193 | #endif | |
| 194 | ||
| 195 | __END_DECLS | |
| 196 | ||
| 197 | #endif /* ieee754.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/sys/ptrace.h deleted-262| ... | ... | @@ -1,262 +0,0 @@ |
| 1 | /* `ptrace' debugger support interface. Linux/PowerPC version. | |
| 2 | Copyright (C) 2001-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_PTRACE_H | |
| 20 | #define _SYS_PTRACE_H	1 | |
| 21 | ||
| 22 | #include <features.h> | |
| 23 | #include <bits/types.h> | |
| 24 | ||
| 25 | __BEGIN_DECLS | |
| 26 | ||
| 27 | #if defined _LINUX_PTRACE_H || defined _ASM_POWERPC_PTRACE_H | |
| 28 | /* Do not let Linux headers macros interfere with enum __ptrace_request. */ | |
| 29 | # undef PTRACE_ATTACH | |
| 30 | # undef PTRACE_CONT | |
| 31 | # undef PTRACE_DETACH | |
| 32 | # undef PTRACE_GET_DEBUGREG | |
| 33 | # undef PTRACE_GETEVENTMSG | |
| 34 | # undef PTRACE_GETEVRREGS | |
| 35 | # undef PTRACE_GETFPREGS | |
| 36 | # undef PTRACE_GETREGS | |
| 37 | # undef PTRACE_GETREGS64 | |
| 38 | # undef PTRACE_GETREGSET | |
| 39 | # undef PTRACE_GETSIGINFO | |
| 40 | # undef PTRACE_GETSIGMASK | |
| 41 | # undef PTRACE_GET_SYSCALL_INFO | |
| 42 | # undef PTRACE_GETVRREGS | |
| 43 | # undef PTRACE_GETVSRREGS | |
| 44 | # undef PTRACE_INTERRUPT | |
| 45 | # undef PTRACE_KILL | |
| 46 | # undef PTRACE_LISTEN | |
| 47 | # undef PTRACE_PEEKDATA | |
| 48 | # undef PTRACE_PEEKSIGINFO | |
| 49 | # undef PTRACE_PEEKTEXT | |
| 50 | # undef PTRACE_POKEDATA | |
| 51 | # undef PTRACE_POKETEXT | |
| 52 | # undef PTRACE_SECCOMP_GET_FILTER | |
| 53 | # undef PTRACE_SECCOMP_GET_METADATA | |
| 54 | # undef PTRACE_SEIZE | |
| 55 | # undef PTRACE_SET_DEBUGREG | |
| 56 | # undef PTRACE_SETEVRREGS | |
| 57 | # undef PTRACE_SETFPREGS | |
| 58 | # undef PTRACE_SETOPTIONS | |
| 59 | # undef PTRACE_SETREGS | |
| 60 | # undef PTRACE_SETREGS64 | |
| 61 | # undef PTRACE_SETREGSET | |
| 62 | # undef PTRACE_SETSIGINFO | |
| 63 | # undef PTRACE_SETSIGMASK | |
| 64 | # undef PTRACE_SETVRREGS | |
| 65 | # undef PTRACE_SETVSRREGS | |
| 66 | # undef PTRACE_SINGLEBLOCK | |
| 67 | # undef PTRACE_SINGLESTEP | |
| 68 | # undef PTRACE_SYSCALL | |
| 69 | # undef PTRACE_SYSCALL_INFO_NONE | |
| 70 | # undef PTRACE_SYSCALL_INFO_ENTRY | |
| 71 | # undef PTRACE_SYSCALL_INFO_EXIT | |
| 72 | # undef PTRACE_SYSCALL_INFO_SECCOMP | |
| 73 | # undef PTRACE_TRACEME | |
| 74 | #endif | |
| 75 | ||
| 76 | /* Type of the REQUEST argument to `ptrace.' */ | |
| 77 | enum __ptrace_request | |
| 78 | { | |
| 79 | /* Indicate that the process making this request should be traced. | |
| 80 | All signals received by this process can be intercepted by its | |
| 81 | parent, and its parent can use the other `ptrace' requests. */ | |
| 82 | PTRACE_TRACEME = 0, | |
| 83 | #define PT_TRACE_ME PTRACE_TRACEME | |
| 84 | ||
| 85 | /* Return the word in the process's text space at address ADDR. */ | |
| 86 | PTRACE_PEEKTEXT = 1, | |
| 87 | #define PT_READ_I PTRACE_PEEKTEXT | |
| 88 | ||
| 89 | /* Return the word in the process's data space at address ADDR. */ | |
| 90 | PTRACE_PEEKDATA = 2, | |
| 91 | #define PT_READ_D PTRACE_PEEKDATA | |
| 92 | ||
| 93 | /* Return the word in the process's user area at offset ADDR. */ | |
| 94 | PTRACE_PEEKUSER = 3, | |
| 95 | #define PT_READ_U PTRACE_PEEKUSER | |
| 96 | ||
| 97 | /* Write the word DATA into the process's text space at address ADDR. */ | |
| 98 | PTRACE_POKETEXT = 4, | |
| 99 | #define PT_WRITE_I PTRACE_POKETEXT | |
| 100 | ||
| 101 | /* Write the word DATA into the process's data space at address ADDR. */ | |
| 102 | PTRACE_POKEDATA = 5, | |
| 103 | #define PT_WRITE_D PTRACE_POKEDATA | |
| 104 | ||
| 105 | /* Write the word DATA into the process's user area at offset ADDR. */ | |
| 106 | PTRACE_POKEUSER = 6, | |
| 107 | #define PT_WRITE_U PTRACE_POKEUSER | |
| 108 | ||
| 109 | /* Continue the process. */ | |
| 110 | PTRACE_CONT = 7, | |
| 111 | #define PT_CONTINUE PTRACE_CONT | |
| 112 | ||
| 113 | /* Kill the process. */ | |
| 114 | PTRACE_KILL = 8, | |
| 115 | #define PT_KILL PTRACE_KILL | |
| 116 | ||
| 117 | /* Single step the process. */ | |
| 118 | PTRACE_SINGLESTEP = 9, | |
| 119 | #define PT_STEP PTRACE_SINGLESTEP | |
| 120 | ||
| 121 | /* Get all general purpose registers used by a process. */ | |
| 122 | PTRACE_GETREGS = 12, | |
| 123 | #define PT_GETREGS PTRACE_GETREGS | |
| 124 | ||
| 125 | /* Set all general purpose registers used by a process. */ | |
| 126 | PTRACE_SETREGS = 13, | |
| 127 | #define PT_SETREGS PTRACE_SETREGS | |
| 128 | ||
| 129 | /* Get all floating point registers used by a process. */ | |
| 130 | PTRACE_GETFPREGS = 14, | |
| 131 | #define PT_GETFPREGS PTRACE_GETFPREGS | |
| 132 | ||
| 133 | /* Set all floating point registers used by a process. */ | |
| 134 | PTRACE_SETFPREGS = 15, | |
| 135 | #define PT_SETFPREGS PTRACE_SETFPREGS | |
| 136 | ||
| 137 | /* Attach to a process that is already running. */ | |
| 138 | PTRACE_ATTACH = 16, | |
| 139 | #define PT_ATTACH PTRACE_ATTACH | |
| 140 | ||
| 141 | /* Detach from a process attached to with PTRACE_ATTACH. */ | |
| 142 | PTRACE_DETACH = 17, | |
| 143 | #define PT_DETACH PTRACE_DETACH | |
| 144 | ||
| 145 | /* Get all altivec registers used by a process. */ | |
| 146 | PTRACE_GETVRREGS = 18, | |
| 147 | #define PT_GETVRREGS PTRACE_GETVRREGS | |
| 148 | ||
| 149 | /* Set all altivec registers used by a process. */ | |
| 150 | PTRACE_SETVRREGS = 19, | |
| 151 | #define PT_SETVRREGS PTRACE_SETVRREGS | |
| 152 | ||
| 153 | /* Get all SPE registers used by a process. */ | |
| 154 | PTRACE_GETEVRREGS = 20, | |
| 155 | #define PT_GETEVRREGS PTRACE_GETEVRREGS | |
| 156 | ||
| 157 | /* Set all SPE registers used by a process. */ | |
| 158 | PTRACE_SETEVRREGS = 21, | |
| 159 | #define PT_SETEVRREGS PTRACE_SETEVRREGS | |
| 160 | ||
| 161 | /* Same as PTRACE_GETREGS except a 32-bit process will obtain | |
| 162 | the full 64-bit registers. Implemented by 64-bit kernels only. */ | |
| 163 | PTRACE_GETREGS64 = 22, | |
| 164 | #define PT_GETREGS64 PTRACE_GETREGS64 | |
| 165 | ||
| 166 | /* Same as PTRACE_SETREGS except a 32-bit process will set | |
| 167 | the full 64-bit registers. Implemented by 64-bit kernels only. */ | |
| 168 | PTRACE_SETREGS64 = 23, | |
| 169 | #define PT_SETREGS64 PTRACE_SETREGS64 | |
| 170 | ||
| 171 | /* Continue and stop at the next entry to or return from syscall. */ | |
| 172 | PTRACE_SYSCALL = 24, | |
| 173 | #define PT_SYSCALL PTRACE_SYSCALL | |
| 174 | ||
| 175 | /* Get a debug register of a process. */ | |
| 176 | PTRACE_GET_DEBUGREG = 25, | |
| 177 | #define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG | |
| 178 | ||
| 179 | /* Set a debug register of a process. */ | |
| 180 | PTRACE_SET_DEBUGREG = 26, | |
| 181 | #define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG | |
| 182 | ||
| 183 | /* Get the first 32 VSX registers of a process. */ | |
| 184 | PTRACE_GETVSRREGS = 27, | |
| 185 | #define PT_GETVSRREGS PTRACE_GETVSRREGS | |
| 186 | ||
| 187 | /* Set the first 32 VSX registers of a process. */ | |
| 188 | PTRACE_SETVSRREGS = 28, | |
| 189 | #define PT_SETVSRREGS PTRACE_SETVSRREGS | |
| 190 | ||
| 191 | /* Execute process until next taken branch. */ | |
| 192 | PTRACE_SINGLEBLOCK = 256, | |
| 193 | #define PT_STEPBLOCK PTRACE_SINGLEBLOCK | |
| 194 | ||
| 195 | /* Set ptrace filter options. */ | |
| 196 | PTRACE_SETOPTIONS = 0x4200, | |
| 197 | #define PT_SETOPTIONS PTRACE_SETOPTIONS | |
| 198 | ||
| 199 | /* Get last ptrace message. */ | |
| 200 | PTRACE_GETEVENTMSG = 0x4201, | |
| 201 | #define PT_GETEVENTMSG PTRACE_GETEVENTMSG | |
| 202 | ||
| 203 | /* Get siginfo for process. */ | |
| 204 | PTRACE_GETSIGINFO = 0x4202, | |
| 205 | #define PT_GETSIGINFO PTRACE_GETSIGINFO | |
| 206 | ||
| 207 | /* Set new siginfo for process. */ | |
| 208 | PTRACE_SETSIGINFO = 0x4203, | |
| 209 | #define PT_SETSIGINFO PTRACE_SETSIGINFO | |
| 210 | ||
| 211 | /* Get register content. */ | |
| 212 | PTRACE_GETREGSET = 0x4204, | |
| 213 | #define PTRACE_GETREGSET PTRACE_GETREGSET | |
| 214 | ||
| 215 | /* Set register content. */ | |
| 216 | PTRACE_SETREGSET = 0x4205, | |
| 217 | #define PTRACE_SETREGSET PTRACE_SETREGSET | |
| 218 | ||
| 219 | /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect | |
| 220 | signal or group stop state. */ | |
| 221 | PTRACE_SEIZE = 0x4206, | |
| 222 | #define PTRACE_SEIZE PTRACE_SEIZE | |
| 223 | ||
| 224 | /* Trap seized tracee. */ | |
| 225 | PTRACE_INTERRUPT = 0x4207, | |
| 226 | #define PTRACE_INTERRUPT PTRACE_INTERRUPT | |
| 227 | ||
| 228 | /* Wait for next group event. */ | |
| 229 | PTRACE_LISTEN = 0x4208, | |
| 230 | #define PTRACE_LISTEN PTRACE_LISTEN | |
| 231 | ||
| 232 | /* Retrieve siginfo_t structures without removing signals from a queue. */ | |
| 233 | PTRACE_PEEKSIGINFO = 0x4209, | |
| 234 | #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO | |
| 235 | ||
| 236 | /* Get the mask of blocked signals. */ | |
| 237 | PTRACE_GETSIGMASK = 0x420a, | |
| 238 | #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK | |
| 239 | ||
| 240 | /* Change the mask of blocked signals. */ | |
| 241 | PTRACE_SETSIGMASK = 0x420b, | |
| 242 | #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK | |
| 243 | ||
| 244 | /* Get seccomp BPF filters. */ | |
| 245 | PTRACE_SECCOMP_GET_FILTER = 0x420c, | |
| 246 | #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER | |
| 247 | ||
| 248 | /* Get seccomp BPF filter metadata. */ | |
| 249 | PTRACE_SECCOMP_GET_METADATA = 0x420d, | |
| 250 | #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA | |
| 251 | ||
| 252 | /* Get information about system call. */ | |
| 253 | PTRACE_GET_SYSCALL_INFO = 0x420e | |
| 254 | #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO | |
| 255 | }; | |
| 256 | ||
| 257 | ||
| 258 | #include <bits/ptrace-shared.h> | |
| 259 | ||
| 260 | __END_DECLS | |
| 261 | ||
| 262 | #endif /* _SYS_PTRACE_H */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/sys/ucontext.h deleted-200| ... | ... | @@ -1,200 +0,0 @@ |
| 1 | /* Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_UCONTEXT_H | |
| 19 | #define _SYS_UCONTEXT_H	1 | |
| 20 | ||
| 21 | #include <features.h> | |
| 22 | ||
| 23 | #include <bits/types/sigset_t.h> | |
| 24 | #include <bits/types/stack_t.h> | |
| 25 | ||
| 26 | ||
| 27 | #ifdef __USE_MISC | |
| 28 | # define __ctx(fld) fld | |
| 29 | #else | |
| 30 | # define __ctx(fld) __ ## fld | |
| 31 | #endif | |
| 32 | ||
| 33 | struct __ctx(pt_regs); | |
| 34 | ||
| 35 | #if __WORDSIZE == 32 | |
| 36 | ||
| 37 | /* Number of general registers. */ | |
| 38 | # define __NGREG	48 | |
| 39 | # ifdef __USE_MISC | |
| 40 | # define NGREG	__NGREG | |
| 41 | # endif | |
| 42 | ||
| 43 | /* Container for all general registers. */ | |
| 44 | typedef unsigned long gregset_t[__NGREG]; | |
| 45 | ||
| 46 | /* Container for floating-point registers and status */ | |
| 47 | typedef struct _libc_fpstate | |
| 48 | { | |
| 49 | 	double __ctx(fpregs)[32]; | |
| 50 | 	double __ctx(fpscr); | |
| 51 | 	unsigned int _pad[2]; | |
| 52 | } fpregset_t; | |
| 53 | ||
| 54 | /* Container for Altivec/VMX registers and status. | |
| 55 | Needs to be aligned on a 16-byte boundary. */ | |
| 56 | typedef struct _libc_vrstate | |
| 57 | { | |
| 58 | 	unsigned int __ctx(vrregs)[32][4]; | |
| 59 | 	unsigned int __ctx(vrsave); | |
| 60 | 	unsigned int _pad[2]; | |
| 61 | 	unsigned int __ctx(vscr); | |
| 62 | } vrregset_t; | |
| 63 | ||
| 64 | /* Context to describe whole processor state. */ | |
| 65 | typedef struct | |
| 66 | { | |
| 67 | 	gregset_t __ctx(gregs); | |
| 68 | 	fpregset_t __ctx(fpregs); | |
| 69 | 	vrregset_t __ctx(vrregs) __attribute__((__aligned__(16))); | |
| 70 | } mcontext_t; | |
| 71 | ||
| 72 | #else | |
| 73 | ||
| 74 | /* For 64-bit kernels with Altivec support, a machine context is exactly | |
| 75 | * a sigcontext. For older kernel (without Altivec) the sigcontext matches | |
| 76 | * the mcontext upto but not including the v_regs field. For kernels that | |
| 77 | * don't set AT_HWCAP or return AT_HWCAP without PPC_FEATURE_HAS_ALTIVEC the | |
| 78 | * v_regs field may not exist and should not be referenced. The v_regs field | |
| 79 | * can be referenced safely only after verifying that PPC_FEATURE_HAS_ALTIVEC | |
| 80 | * is set in AT_HWCAP. */ | |
| 81 | ||
| 82 | /* Number of general registers. */ | |
| 83 | # define __NGREG	48	/* includes r0-r31, nip, msr, lr, etc. */ | |
| 84 | # define __NFPREG	33	/* includes fp0-fp31 &fpscr. */ | |
| 85 | # define __NVRREG	34	/* includes v0-v31, vscr, & vrsave in | |
| 86 | 				 split vectors */ | |
| 87 | # ifdef __USE_MISC | |
| 88 | # define NGREG	__NGREG | |
| 89 | # define NFPREG	__NFPREG | |
| 90 | # define NVRREG	__NVRREG | |
| 91 | # endif | |
| 92 | ||
| 93 | typedef unsigned long gregset_t[__NGREG]; | |
| 94 | typedef double fpregset_t[__NFPREG]; | |
| 95 | ||
| 96 | /* Container for Altivec/VMX Vector Status and Control Register. Only 32-bits | |
| 97 | but can only be copied to/from a 128-bit vector register. So we allocated | |
| 98 | a whole quadword speedup save/restore. */ | |
| 99 | typedef struct _libc_vscr | |
| 100 | { | |
| 101 | #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ | |
| 102 | 	unsigned int __pad[3]; | |
| 103 | 	unsigned int __ctx(vscr_word); | |
| 104 | #else | |
| 105 | 	unsigned int __ctx(vscr_word); | |
| 106 | 	unsigned int __pad[3]; | |
| 107 | #endif | |
| 108 | } vscr_t; | |
| 109 | ||
| 110 | /* Container for Altivec/VMX registers and status. | |
| 111 | Must to be aligned on a 16-byte boundary. */ | |
| 112 | typedef struct _libc_vrstate | |
| 113 | { | |
| 114 | 	unsigned int	__ctx(vrregs)[32][4]; | |
| 115 | 	vscr_t		__ctx(vscr); | |
| 116 | 	unsigned int	__ctx(vrsave); | |
| 117 | 	unsigned int	__pad[3]; | |
| 118 | } vrregset_t __attribute__((__aligned__(16))); | |
| 119 | ||
| 120 | typedef struct { | |
| 121 | 	unsigned long	__glibc_reserved[4]; | |
| 122 | 	int		__ctx(signal); | |
| 123 | 	int		__pad0; | |
| 124 | 	unsigned long	__ctx(handler); | |
| 125 | 	unsigned long	__ctx(oldmask); | |
| 126 | 	struct __ctx(pt_regs)	*__ctx(regs); | |
| 127 | 	gregset_t	__ctx(gp_regs); | |
| 128 | 	fpregset_t	__ctx(fp_regs); | |
| 129 | /* | |
| 130 | * To maintain compatibility with current implementations the sigcontext is | |
| 131 | * extended by appending a pointer (v_regs) to a quadword type (elf_vrreg_t) | |
| 132 | * followed by an unstructured (vmx_reserve) field of 69 doublewords. This | |
| 133 | * allows the array of vector registers to be quadword aligned independent of | |
| 134 | * the alignment of the containing sigcontext or ucontext. It is the | |
| 135 | * responsibility of the code setting the sigcontext to set this pointer to | |
| 136 | * either NULL (if this processor does not support the VMX feature) or the | |
| 137 | * address of the first quadword within the allocated (vmx_reserve) area. | |
| 138 | * | |
| 139 | * The pointer (v_regs) of vector type (elf_vrreg_t) is essentially | |
| 140 | * an array of 34 quadword entries. The entries with | |
| 141 | * indexes 0-31 contain the corresponding vector registers. The entry with | |
| 142 | * index 32 contains the vscr as the last word (offset 12) within the | |
| 143 | * quadword. This allows the vscr to be stored as either a quadword (since | |
| 144 | * it must be copied via a vector register to/from storage) or as a word. | |
| 145 | * The entry with index 33 contains the vrsave as the first word (offset 0) | |
| 146 | * within the quadword. | |
| 147 | */ | |
| 148 | 	vrregset_t	*__ctx(v_regs); | |
| 149 | 	long		__ctx(vmx_reserve)[__NVRREG+__NVRREG+1]; | |
| 150 | } mcontext_t; | |
| 151 | ||
| 152 | #endif | |
| 153 | ||
| 154 | /* Userlevel context. */ | |
| 155 | typedef struct ucontext_t | |
| 156 | { | |
| 157 | unsigned long int __ctx(uc_flags); | |
| 158 | struct ucontext_t *uc_link; | |
| 159 | stack_t uc_stack; | |
| 160 | #if __WORDSIZE == 32 | |
| 161 | /* | |
| 162 | * These fields are set up this way to maximize source and | |
| 163 | * binary compatibility with code written for the old | |
| 164 | * ucontext_t definition, which didn't include space for the | |
| 165 | * registers. | |
| 166 | * | |
| 167 | * Different versions of the kernel have stored the registers on | |
| 168 | * signal delivery at different offsets from the ucontext struct. | |
| 169 | * Programs should thus use the uc_mcontext.uc_regs pointer to | |
| 170 | * find where the registers are actually stored. The registers | |
| 171 | * will be stored within the ucontext_t struct but not necessarily | |
| 172 | * at a fixed address. As a side-effect, this lets us achieve | |
| 173 | * 16-byte alignment for the register storage space if the | |
| 174 | * Altivec registers are to be saved, without requiring 16-byte | |
| 175 | * alignment on the whole ucontext_t. | |
| 176 | * | |
| 177 | * The uc_mcontext.regs field is included for source compatibility | |
| 178 | * with programs written against the older ucontext_t definition, | |
| 179 | * and its name should therefore not change. The uc_pad field | |
| 180 | * is for binary compatibility with programs compiled against the | |
| 181 | * old ucontext_t; it ensures that uc_mcontext.regs and uc_sigmask | |
| 182 | * are at the same offset as previously. | |
| 183 | */ | |
| 184 | int __glibc_reserved1[7]; | |
| 185 | union __ctx(uc_regs_ptr) { | |
| 186 | struct __ctx(pt_regs) *__ctx(regs); | |
| 187 | mcontext_t *__ctx(uc_regs); | |
| 188 | } uc_mcontext; | |
| 189 | sigset_t uc_sigmask; | |
| 190 | /* last for extensibility */ | |
| 191 | char __ctx(uc_reg_space)[sizeof (mcontext_t) + 12]; | |
| 192 | #else /* 64-bit */ | |
| 193 | sigset_t uc_sigmask; | |
| 194 | mcontext_t uc_mcontext; /* last for extensibility */ | |
| 195 | #endif | |
| 196 | } ucontext_t; | |
| 197 | ||
| 198 | #undef __ctx | |
| 199 | ||
| 200 | #endif /* sys/ucontext.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnu/sys/user.h deleted-40| ... | ... | @@ -1,40 +0,0 @@ |
| 1 | /* Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_USER_H | |
| 19 | ||
| 20 | #define _SYS_USER_H	1 | |
| 21 | #include <stddef.h> | |
| 22 | #include <features.h> | |
| 23 | ||
| 24 | #include <asm/ptrace.h> | |
| 25 | ||
| 26 | struct user { | |
| 27 | 	struct pt_regs	regs;			/* entire machine state */ | |
| 28 | 	size_t		u_tsize;		/* text size (pages) */ | |
| 29 | 	size_t		u_dsize;		/* data size (pages) */ | |
| 30 | 	size_t		u_ssize;		/* stack size (pages) */ | |
| 31 | 	unsigned long	start_code;		/* text starting address */ | |
| 32 | 	unsigned long	start_data;		/* data starting address */ | |
| 33 | 	unsigned long	start_stack;		/* stack starting address */ | |
| 34 | 	long int	signal;			/* signal causing core dump */ | |
| 35 | 	struct regs *	u_ar0;			/* help gdb find registers */ | |
| 36 | 	unsigned long	magic;			/* identifies a core file */ | |
| 37 | 	char		u_comm[32];		/* user command name */ | |
| 38 | }; | |
| 39 | ||
| 40 | #endif /* sys/user.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/endianness.h created+16| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | #ifndef _BITS_ENDIANNESS_H | |
| 2 | #define _BITS_ENDIANNESS_H 1 | |
| 3 | ||
| 4 | #ifndef _BITS_ENDIAN_H | |
| 5 | # error "Never use <bits/endianness.h> directly; include <endian.h> instead." | |
| 6 | #endif | |
| 7 | ||
| 8 | /* PowerPC has selectable endianness. */ | |
| 9 | #if defined __BIG_ENDIAN__ || defined _BIG_ENDIAN | |
| 10 | # define __BYTE_ORDER __BIG_ENDIAN | |
| 11 | #endif | |
| 12 | #if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN | |
| 13 | # define __BYTE_ORDER __LITTLE_ENDIAN | |
| 14 | #endif | |
| 15 | ||
| 16 | #endif /* bits/endianness.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/environments.h created+96| ... | ... | @@ -0,0 +1,96 @@ |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _UNISTD_H | |
| 19 | # error "Never include this file directly. Use <unistd.h> instead" | |
| 20 | #endif | |
| 21 | ||
| 22 | #include <bits/wordsize.h> | |
| 23 | ||
| 24 | /* This header should define the following symbols under the described | |
| 25 | situations. A value `1' means that the model is always supported, | |
| 26 | `-1' means it is never supported. Undefined means it cannot be | |
| 27 | statically decided. | |
| 28 | ||
| 29 | _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type | |
| 30 | _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type | |
| 31 | ||
| 32 | _POSIX_V7_LP64_OFF32	 64bit long and pointers and 32bit off_t type | |
| 33 | _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type | |
| 34 | ||
| 35 | The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, | |
| 36 | _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, | |
| 37 | _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were | |
| 38 | used in previous versions of the Unix standard and are available | |
| 39 | only for compatibility. | |
| 40 | */ | |
| 41 | ||
| 42 | #if __WORDSIZE == 64 | |
| 43 | ||
| 44 | /* Environments with 32-bit wide pointers are optionally provided. | |
| 45 | Therefore following macros aren't defined: | |
| 46 | # undef _POSIX_V7_ILP32_OFF32 | |
| 47 | # undef _POSIX_V7_ILP32_OFFBIG | |
| 48 | # undef _POSIX_V6_ILP32_OFF32 | |
| 49 | # undef _POSIX_V6_ILP32_OFFBIG | |
| 50 | # undef _XBS5_ILP32_OFF32 | |
| 51 | # undef _XBS5_ILP32_OFFBIG | |
| 52 | and users need to check at runtime. */ | |
| 53 | ||
| 54 | /* We also have no use (for now) for an environment with bigger pointers | |
| 55 | and offsets. */ | |
| 56 | # define _POSIX_V7_LPBIG_OFFBIG	-1 | |
| 57 | # define _POSIX_V6_LPBIG_OFFBIG	-1 | |
| 58 | # define _XBS5_LPBIG_OFFBIG	-1 | |
| 59 | ||
| 60 | /* By default we have 64-bit wide `long int', pointers and `off_t'. */ | |
| 61 | # define _POSIX_V7_LP64_OFF64	1 | |
| 62 | # define _POSIX_V6_LP64_OFF64	1 | |
| 63 | # define _XBS5_LP64_OFF64	1 | |
| 64 | ||
| 65 | #else /* __WORDSIZE == 32 */ | |
| 66 | ||
| 67 | /* By default we have 32-bit wide `int', `long int', pointers and `off_t' | |
| 68 | and all platforms support LFS. */ | |
| 69 | # define _POSIX_V7_ILP32_OFF32	1 | |
| 70 | # define _POSIX_V7_ILP32_OFFBIG	1 | |
| 71 | # define _POSIX_V6_ILP32_OFF32	1 | |
| 72 | # define _POSIX_V6_ILP32_OFFBIG	1 | |
| 73 | # define _XBS5_ILP32_OFF32	1 | |
| 74 | # define _XBS5_ILP32_OFFBIG	1 | |
| 75 | ||
| 76 | /* We optionally provide an environment with the above size but an 64-bit | |
| 77 | side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ | |
| 78 | ||
| 79 | /* Environments with 64-bit wide pointers can be provided, | |
| 80 | so these macros aren't defined: | |
| 81 | # undef _POSIX_V7_LP64_OFF64 | |
| 82 | # undef _POSIX_V7_LPBIG_OFFBIG | |
| 83 | # undef _POSIX_V6_LP64_OFF64 | |
| 84 | # undef _POSIX_V6_LPBIG_OFFBIG | |
| 85 | # undef _XBS5_LP64_OFF64 | |
| 86 | # undef _XBS5_LPBIG_OFFBIG | |
| 87 | and sysconf tests for it at runtime. */ | |
| 88 | ||
| 89 | #endif /* __WORDSIZE == 32 */ | |
| 90 | ||
| 91 | #define __ILP32_OFF32_CFLAGS	"-m32" | |
| 92 | #define __ILP32_OFFBIG_CFLAGS	"-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" | |
| 93 | #define __ILP32_OFF32_LDFLAGS	"-m32" | |
| 94 | #define __ILP32_OFFBIG_LDFLAGS	"-m32" | |
| 95 | #define __LP64_OFF64_CFLAGS	"-m64" | |
| 96 | #define __LP64_OFF64_LDFLAGS	"-m64" | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/fcntl.h created+62| ... | ... | @@ -0,0 +1,62 @@ |
| 1 | /* O_*, F_*, FD_* bit values for Linux/PowerPC. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef	_FCNTL_H | |
| 20 | # error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/wordsize.h> | |
| 24 | ||
| 25 | #define __O_DIRECTORY	 040000	/* Must be a directory.	 */ | |
| 26 | #define __O_NOFOLLOW	0100000	/* Do not follow links.	 */ | |
| 27 | #define __O_DIRECT	0400000	/* Direct disk access.	*/ | |
| 28 | ||
| 29 | #if __WORDSIZE == 64 | |
| 30 | /* Not necessary, files are always with 64bit off_t. */ | |
| 31 | # define __O_LARGEFILE 0 | |
| 32 | #else | |
| 33 | # define __O_LARGEFILE	0200000 | |
| 34 | #endif | |
| 35 | ||
| 36 | struct flock | |
| 37 | { | |
| 38 | short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.	*/ | |
| 39 | short int l_whence;	/* Where `l_start' is relative to (like `lseek'). */ | |
| 40 | #ifndef __USE_FILE_OFFSET64 | |
| 41 | __off_t l_start;	/* Offset where the lock begins. */ | |
| 42 | __off_t l_len;	/* Size of the locked area; zero means until EOF. */ | |
| 43 | #else | |
| 44 | __off64_t l_start;	/* Offset where the lock begins. */ | |
| 45 | __off64_t l_len;	/* Size of the locked area; zero means until EOF. */ | |
| 46 | #endif | |
| 47 | __pid_t l_pid;	/* Process holding the lock. */ | |
| 48 | }; | |
| 49 | ||
| 50 | #ifdef __USE_LARGEFILE64 | |
| 51 | struct flock64 | |
| 52 | { | |
| 53 | short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.	*/ | |
| 54 | short int l_whence;	/* Where `l_start' is relative to (like `lseek'). */ | |
| 55 | __off64_t l_start;	/* Offset where the lock begins. */ | |
| 56 | __off64_t l_len;	/* Size of the locked area; zero means until EOF. */ | |
| 57 | __pid_t l_pid;	/* Process holding the lock. */ | |
| 58 | }; | |
| 59 | #endif | |
| 60 | ||
| 61 | /* Include generic Linux declarations. */ | |
| 62 | #include <bits/fcntl-linux.h> | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/fenv.h created+180| ... | ... | @@ -0,0 +1,180 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _FENV_H | |
| 19 | # error "Never use <bits/fenv.h> directly; include <fenv.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | ||
| 23 | /* Define bits representing the exception. We use the bit positions of | |
| 24 | the appropriate bits in the FPSCR... */ | |
| 25 | enum | |
| 26 | { | |
| 27 | FE_INEXACT = | |
| 28 | #define FE_INEXACT	(1 << (31 - 6)) | |
| 29 | FE_INEXACT, | |
| 30 | FE_DIVBYZERO = | |
| 31 | #define FE_DIVBYZERO	(1 << (31 - 5)) | |
| 32 | FE_DIVBYZERO, | |
| 33 | FE_UNDERFLOW = | |
| 34 | #define FE_UNDERFLOW	(1 << (31 - 4)) | |
| 35 | FE_UNDERFLOW, | |
| 36 | FE_OVERFLOW = | |
| 37 | #define FE_OVERFLOW	(1 << (31 - 3)) | |
| 38 | FE_OVERFLOW, | |
| 39 | ||
| 40 | /* ... except for FE_INVALID, for which we use bit 31. FE_INVALID | |
| 41 | actually corresponds to bits 7 through 12 and 21 through 23 | |
| 42 | in the FPSCR, but we can't use that because the current draft | |
| 43 | says that it must be a power of 2. Instead we use bit 2 which | |
| 44 | is the summary bit for all the FE_INVALID exceptions, which | |
| 45 | kind of makes sense. */ | |
| 46 | FE_INVALID = | |
| 47 | #define FE_INVALID	(1 << (31 - 2)) | |
| 48 | FE_INVALID, | |
| 49 | ||
| 50 | #ifdef __USE_GNU | |
| 51 | /* Breakdown of the FE_INVALID bits. Setting FE_INVALID on an | |
| 52 | input to a routine is equivalent to setting all of these bits; | |
| 53 | FE_INVALID will be set on output from a routine iff one of | |
| 54 | these bits is set. Note, though, that you can't disable or | |
| 55 | enable these exceptions individually. */ | |
| 56 | ||
| 57 | /* Operation with a sNaN. */ | |
| 58 | FE_INVALID_SNAN = | |
| 59 | # define FE_INVALID_SNAN	(1 << (31 - 7)) | |
| 60 | FE_INVALID_SNAN, | |
| 61 | ||
| 62 | /* Inf - Inf */ | |
| 63 | FE_INVALID_ISI = | |
| 64 | # define FE_INVALID_ISI	(1 << (31 - 8)) | |
| 65 | FE_INVALID_ISI, | |
| 66 | ||
| 67 | /* Inf / Inf */ | |
| 68 | FE_INVALID_IDI = | |
| 69 | # define FE_INVALID_IDI	(1 << (31 - 9)) | |
| 70 | FE_INVALID_IDI, | |
| 71 | ||
| 72 | /* 0 / 0 */ | |
| 73 | FE_INVALID_ZDZ = | |
| 74 | # define FE_INVALID_ZDZ	(1 << (31 - 10)) | |
| 75 | FE_INVALID_ZDZ, | |
| 76 | ||
| 77 | /* Inf * 0 */ | |
| 78 | FE_INVALID_IMZ = | |
| 79 | # define FE_INVALID_IMZ	(1 << (31 - 11)) | |
| 80 | FE_INVALID_IMZ, | |
| 81 | ||
| 82 | /* Comparison with a NaN. */ | |
| 83 | FE_INVALID_COMPARE = | |
| 84 | # define FE_INVALID_COMPARE	(1 << (31 - 12)) | |
| 85 | FE_INVALID_COMPARE, | |
| 86 | ||
| 87 | /* Invalid operation flag for software (not set by hardware). */ | |
| 88 | /* Note that some chips don't have this implemented, presumably | |
| 89 | because no-one expected anyone to write software for them %-). */ | |
| 90 | FE_INVALID_SOFTWARE = | |
| 91 | # define FE_INVALID_SOFTWARE	(1 << (31 - 21)) | |
| 92 | FE_INVALID_SOFTWARE, | |
| 93 | ||
| 94 | /* Square root of negative number (including -Inf). */ | |
| 95 | /* Note that some chips don't have this implemented. */ | |
| 96 | FE_INVALID_SQRT = | |
| 97 | # define FE_INVALID_SQRT	(1 << (31 - 22)) | |
| 98 | FE_INVALID_SQRT, | |
| 99 | ||
| 100 | /* Conversion-to-integer of a NaN or a number too large or too small. */ | |
| 101 | FE_INVALID_INTEGER_CONVERSION = | |
| 102 | # define FE_INVALID_INTEGER_CONVERSION	(1 << (31 - 23)) | |
| 103 | FE_INVALID_INTEGER_CONVERSION | |
| 104 | ||
| 105 | # define FE_ALL_INVALID \ | |
| 106 | (FE_INVALID_SNAN | FE_INVALID_ISI | FE_INVALID_IDI | FE_INVALID_ZDZ \ | |
| 107 | 	 | FE_INVALID_IMZ | FE_INVALID_COMPARE | FE_INVALID_SOFTWARE \ | |
| 108 | 	 | FE_INVALID_SQRT | FE_INVALID_INTEGER_CONVERSION) | |
| 109 | #endif | |
| 110 | }; | |
| 111 | ||
| 112 | #define FE_ALL_EXCEPT \ | |
| 113 | 	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) | |
| 114 | ||
| 115 | /* PowerPC chips support all of the four defined rounding modes. We | |
| 116 | use the bit pattern in the FPSCR as the values for the | |
| 117 | appropriate macros. */ | |
| 118 | enum | |
| 119 | { | |
| 120 | FE_TONEAREST = | |
| 121 | #define FE_TONEAREST	0 | |
| 122 | FE_TONEAREST, | |
| 123 | FE_TOWARDZERO = | |
| 124 | #define FE_TOWARDZERO	1 | |
| 125 | FE_TOWARDZERO, | |
| 126 | FE_UPWARD = | |
| 127 | #define FE_UPWARD	2 | |
| 128 | FE_UPWARD, | |
| 129 | FE_DOWNWARD = | |
| 130 | #define FE_DOWNWARD	3 | |
| 131 | FE_DOWNWARD | |
| 132 | }; | |
| 133 | ||
| 134 | /* Type representing exception flags. */ | |
| 135 | typedef unsigned int fexcept_t; | |
| 136 | ||
| 137 | /* Type representing floating-point environment. We leave it as 'double' | |
| 138 | for efficiency reasons (rather than writing it to a 32-bit integer). */ | |
| 139 | typedef double fenv_t; | |
| 140 | ||
| 141 | /* If the default argument is used we use this value. */ | |
| 142 | extern const fenv_t __fe_dfl_env; | |
| 143 | #define FE_DFL_ENV	(&__fe_dfl_env) | |
| 144 | ||
| 145 | #ifdef __USE_GNU | |
| 146 | /* Floating-point environment where all exceptions are enabled. Note that | |
| 147 | this is not sufficient to give you SIGFPE. */ | |
| 148 | extern const fenv_t __fe_enabled_env; | |
| 149 | # define FE_ENABLED_ENV	(&__fe_enabled_env) | |
| 150 | ||
| 151 | /* Floating-point environment with (processor-dependent) non-IEEE floating | |
| 152 | point. */ | |
| 153 | extern const fenv_t __fe_nonieee_env; | |
| 154 | # define FE_NONIEEE_ENV	(&__fe_nonieee_env) | |
| 155 | ||
| 156 | /* Floating-point environment with all exceptions enabled. Note that | |
| 157 | just evaluating this value does not change the processor exception mode. | |
| 158 | Passing this mask to fesetenv will result in a prctl syscall to change | |
| 159 | the MSR FE0/FE1 bits to "Precise Mode". On some processors this will | |
| 160 | result in slower floating point execution. This will last until an | |
| 161 | fenv or exception mask is installed that disables all FP exceptions. */ | |
| 162 | # define FE_NOMASK_ENV	FE_ENABLED_ENV | |
| 163 | ||
| 164 | /* Floating-point environment with all exceptions disabled. Note that | |
| 165 | just evaluating this value does not change the processor exception mode. | |
| 166 | Passing this mask to fesetenv will result in a prctl syscall to change | |
| 167 | the MSR FE0/FE1 bits to "Ignore Exceptions Mode". On most processors | |
| 168 | this allows the fastest possible floating point execution.*/ | |
| 169 | # define FE_MASK_ENV	FE_DFL_ENV | |
| 170 | ||
| 171 | #endif | |
| 172 | ||
| 173 | #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) | |
| 174 | /* Type representing floating-point control modes. */ | |
| 175 | typedef double femode_t; | |
| 176 | ||
| 177 | /* Default floating-point control modes. */ | |
| 178 | extern const femode_t __fe_dfl_mode; | |
| 179 | # define FE_DFL_MODE	(&__fe_dfl_mode) | |
| 180 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/floatn.h created+122| ... | ... | @@ -0,0 +1,122 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features on powerpc. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_FLOATN_H | |
| 20 | #define _BITS_FLOATN_H | |
| 21 | ||
| 22 | #include <features.h> | |
| 23 | #include <bits/long-double.h> | |
| 24 | ||
| 25 | /* Defined to 1 if the current compiler invocation provides a | |
| 26 | floating-point type with the IEEE 754 binary128 format, and this glibc | |
| 27 | includes corresponding *f128 interfaces for it. */ | |
| 28 | #if defined _ARCH_PWR8 && defined __LITTLE_ENDIAN__ && (_CALL_ELF == 2) \ | |
| 29 | && defined __FLOAT128__ && !defined __NO_LONG_DOUBLE_MATH | |
| 30 | # define __HAVE_FLOAT128 1 | |
| 31 | #else | |
| 32 | # define __HAVE_FLOAT128 0 | |
| 33 | #endif | |
| 34 | ||
| 35 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 36 | from the default float, double and long double types in this glibc, i.e. | |
| 37 | calls to the binary128 functions go to *f128 symbols instead of *l. */ | |
| 38 | #if __HAVE_FLOAT128 | |
| 39 | # define __HAVE_DISTINCT_FLOAT128 1 | |
| 40 | #else | |
| 41 | # define __HAVE_DISTINCT_FLOAT128 0 | |
| 42 | #endif | |
| 43 | ||
| 44 | /* Defined to 1 if the current compiler invocation provides a | |
| 45 | floating-point type with the right format for _Float64x, and this | |
| 46 | glibc includes corresponding *f64x interfaces for it. */ | |
| 47 | #define __HAVE_FLOAT64X __HAVE_FLOAT128 | |
| 48 | ||
| 49 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 50 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 51 | the format of _Float128, which must be different from that of long | |
| 52 | double. */ | |
| 53 | #define __HAVE_FLOAT64X_LONG_DOUBLE 0 | |
| 54 | ||
| 55 | #ifndef __ASSEMBLER__ | |
| 56 | ||
| 57 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 58 | types, if __HAVE_FLOAT128 is 1. */ | |
| 59 | # if __HAVE_FLOAT128 | |
| 60 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 61 | /* The literal suffix (f128) exist for powerpc only since GCC 7.0. */ | |
| 62 | # if __LDBL_MANT_DIG__ == 113 | |
| 63 | # define __f128(x) x##l | |
| 64 | # else | |
| 65 | # define __f128(x) x##q | |
| 66 | # endif | |
| 67 | # else | |
| 68 | # define __f128(x) x##f128 | |
| 69 | # endif | |
| 70 | # endif | |
| 71 | ||
| 72 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ | |
| 73 | # if __HAVE_FLOAT128 | |
| 74 | # if __LDBL_MANT_DIG__ == 113 && defined __cplusplus | |
| 75 | typedef long double _Float128; | |
| 76 | # define __CFLOAT128 _Complex long double | |
| 77 | # elif !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 78 | /* The type _Float128 exist for powerpc only since GCC 7.0. */ | |
| 79 | typedef __float128 _Float128; | |
| 80 | /* Add a typedef for older GCC and C++ compilers which don't natively support | |
| 81 | _Complex _Float128. */ | |
| 82 | typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__KC__))); | |
| 83 | # define __CFLOAT128 __cfloat128 | |
| 84 | # else | |
| 85 | # define __CFLOAT128 _Complex _Float128 | |
| 86 | # endif | |
| 87 | # endif | |
| 88 | ||
| 89 | /* The remaining of this file provides support for older compilers. */ | |
| 90 | # if __HAVE_FLOAT128 | |
| 91 | /* Builtin __builtin_huge_valf128 doesn't exist before GCC 7.0. */ | |
| 92 | # if !__GNUC_PREREQ (7, 0) | |
| 93 | # define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ()) | |
| 94 | # endif | |
| 95 | ||
| 96 | /* The following builtins (suffixed with 'q') are available in GCC >= 6.2, | |
| 97 | which is the minimum version required for float128 support on powerpc64le. | |
| 98 | Since GCC 7.0 the builtins suffixed with f128 are also available, then | |
| 99 | there is no need to redefined them. */ | |
| 100 | # if !__GNUC_PREREQ (7, 0) | |
| 101 | # define __builtin_copysignf128 __builtin_copysignq | |
| 102 | # define __builtin_fabsf128 __builtin_fabsq | |
| 103 | # define __builtin_inff128 __builtin_infq | |
| 104 | # define __builtin_nanf128 __builtin_nanq | |
| 105 | # define __builtin_nansf128 __builtin_nansq | |
| 106 | # endif | |
| 107 | ||
| 108 | /* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*, | |
| 109 | e.g.: __builtin_signbitf128, before GCC 6. However, there has never | |
| 110 | been a __builtin_signbitf128 in GCC and the type-generic builtin is | |
| 111 | only available since GCC 6. */ | |
| 112 | # if !__GNUC_PREREQ (6, 0) | |
| 113 | # define __builtin_signbitf128 __signbitf128 | |
| 114 | # endif | |
| 115 | ||
| 116 | # endif | |
| 117 | ||
| 118 | #endif /* !__ASSEMBLER__. */ | |
| 119 | ||
| 120 | #include <bits/floatn-common.h> | |
| 121 | ||
| 122 | #endif /* _BITS_FLOATN_H */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/fp-fast.h created+39| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | /* Define FP_FAST_* macros. PowerPC version. | |
| 2 | Copyright (C) 2016-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _MATH_H | |
| 20 | # error "Never use <bits/fp-fast.h> directly; include <math.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifdef __USE_ISOC99 | |
| 24 | ||
| 25 | /* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l} | |
| 26 | builtins are supported. */ | |
| 27 | # if (!defined _SOFT_FLOAT && !defined __NO_FPRS__) || defined __FP_FAST_FMA | |
| 28 | # define FP_FAST_FMA 1 | |
| 29 | # endif | |
| 30 | ||
| 31 | # if (!defined _SOFT_FLOAT && !defined __NO_FPRS__) || defined __FP_FAST_FMAF | |
| 32 | # define FP_FAST_FMAF 1 | |
| 33 | # endif | |
| 34 | ||
| 35 | # ifdef __FP_FAST_FMAL | |
| 36 | # define FP_FAST_FMAL 1 | |
| 37 | # endif | |
| 38 | ||
| 39 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/hwcap.h created+78| ... | ... | @@ -0,0 +1,78 @@ |
| 1 | /* Defines for bits in AT_HWCAP and AT_HWCAP2. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #if !defined(_SYS_AUXV_H) && !defined(_SYSDEPS_SYSDEP_H) | |
| 20 | # error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The bit numbers must match those in the kernel's asm/cputable.h. */ | |
| 24 | ||
| 25 | /* Feature definitions in AT_HWCAP. */ | |
| 26 | #define PPC_FEATURE_32		 0x80000000 /* 32-bit mode. */ | |
| 27 | #define PPC_FEATURE_64		 0x40000000 /* 64-bit mode. */ | |
| 28 | #define PPC_FEATURE_601_INSTR	 0x20000000 /* 601 chip, Old POWER ISA. */ | |
| 29 | #define PPC_FEATURE_HAS_ALTIVEC	 0x10000000 /* SIMD/Vector Unit. */ | |
| 30 | #define PPC_FEATURE_HAS_FPU	 0x08000000 /* Floating Point Unit. */ | |
| 31 | #define PPC_FEATURE_HAS_MMU	 0x04000000 /* Memory Management Unit. */ | |
| 32 | #define PPC_FEATURE_HAS_4xxMAC	 0x02000000 /* 4xx Multiply Accumulator. */ | |
| 33 | #define PPC_FEATURE_UNIFIED_CACHE 0x01000000 /* Unified I/D cache. */ | |
| 34 | #define PPC_FEATURE_HAS_SPE	 0x00800000 /* Signal Processing ext. */ | |
| 35 | #define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000 /* SPE Float. */ | |
| 36 | #define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 /* SPE Double. */ | |
| 37 | #define PPC_FEATURE_NO_TB	 0x00100000 /* 601/403gx have no timebase */ | |
| 38 | #define PPC_FEATURE_POWER4	 0x00080000 /* POWER4 ISA 2.00 */ | |
| 39 | #define PPC_FEATURE_POWER5	 0x00040000 /* POWER5 ISA 2.02 */ | |
| 40 | #define PPC_FEATURE_POWER5_PLUS	 0x00020000 /* POWER5+ ISA 2.03 */ | |
| 41 | #define PPC_FEATURE_CELL_BE	 0x00010000 /* CELL Broadband Engine */ | |
| 42 | #define PPC_FEATURE_BOOKE	 0x00008000 /* ISA Category Embedded */ | |
| 43 | #define PPC_FEATURE_SMT		 0x00004000 /* Simultaneous | |
| 44 | 						 Multi-Threading */ | |
| 45 | #define PPC_FEATURE_ICACHE_SNOOP 0x00002000 | |
| 46 | #define PPC_FEATURE_ARCH_2_05	 0x00001000 /* ISA 2.05 */ | |
| 47 | #define PPC_FEATURE_PA6T	 0x00000800 /* PA Semi 6T Core */ | |
| 48 | #define PPC_FEATURE_HAS_DFP	 0x00000400 /* Decimal FP Unit */ | |
| 49 | #define PPC_FEATURE_POWER6_EXT	 0x00000200 /* P6 + mffgpr/mftgpr */ | |
| 50 | #define PPC_FEATURE_ARCH_2_06	 0x00000100 /* ISA 2.06 */ | |
| 51 | #define PPC_FEATURE_HAS_VSX	 0x00000080 /* P7 Vector Extension. */ | |
| 52 | #define PPC_FEATURE_PSERIES_PERFMON_COMPAT 0x00000040 | |
| 53 | /* Reserved by the kernel.	 0x00000004 Do not use. */ | |
| 54 | #define PPC_FEATURE_TRUE_LE	 0x00000002 | |
| 55 | #define PPC_FEATURE_PPC_LE	 0x00000001 | |
| 56 | ||
| 57 | /* Feature definitions in AT_HWCAP2. */ | |
| 58 | #define PPC_FEATURE2_ARCH_2_07 0x80000000 /* ISA 2.07 */ | |
| 59 | #define PPC_FEATURE2_HAS_HTM 0x40000000 /* Hardware Transactional | |
| 60 | 						 Memory */ | |
| 61 | #define PPC_FEATURE2_HAS_DSCR 0x20000000 /* Data Stream Control | |
| 62 | 						 Register */ | |
| 63 | #define PPC_FEATURE2_HAS_EBB 0x10000000 /* Event Base Branching */ | |
| 64 | #define PPC_FEATURE2_HAS_ISEL 0x08000000 /* Integer Select */ | |
| 65 | #define PPC_FEATURE2_HAS_TAR 0x04000000 /* Target Address Register */ | |
| 66 | #define PPC_FEATURE2_HAS_VEC_CRYPTO 0x02000000 /* Target supports vector | |
| 67 | 						 instruction. */ | |
| 68 | #define PPC_FEATURE2_HTM_NOSC	 0x01000000 /* Kernel aborts transaction | |
| 69 | 						 when a syscall is made. */ | |
| 70 | #define PPC_FEATURE2_ARCH_3_00	 0x00800000 /* ISA 3.0 */ | |
| 71 | #define PPC_FEATURE2_HAS_IEEE128 0x00400000 /* VSX IEEE Binary Float | |
| 72 | 						 128-bit */ | |
| 73 | #define PPC_FEATURE2_DARN	 0x00200000 /* darn instruction. */ | |
| 74 | #define PPC_FEATURE2_SCV	 0x00100000 /* scv syscall. */ | |
| 75 | #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM without suspended | |
| 76 | 						 state. */ | |
| 77 | #define PPC_FEATURE2_ARCH_3_1	 0x00040000 /* ISA 3.1. */ | |
| 78 | #define PPC_FEATURE2_MMA	 0x00020000 /* Matrix-Multiply Assist. */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/ioctl-types.h created+77| ... | ... | @@ -0,0 +1,77 @@ |
| 1 | /* Structure types for pre-termios terminal ioctls. Linux/powerpc version. | |
| 2 | Copyright (C) 2014-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_IOCTL_H | |
| 20 | # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Get definition of constants for use with `ioctl'. */ | |
| 24 | #include <asm/ioctls.h> | |
| 25 | ||
| 26 | ||
| 27 | struct winsize | |
| 28 | { | |
| 29 | unsigned short int ws_row; | |
| 30 | unsigned short int ws_col; | |
| 31 | unsigned short int ws_xpixel; | |
| 32 | unsigned short int ws_ypixel; | |
| 33 | }; | |
| 34 | ||
| 35 | #define NCC 10 | |
| 36 | struct termio | |
| 37 | { | |
| 38 | unsigned short int c_iflag;		/* input mode flags */ | |
| 39 | unsigned short int c_oflag;		/* output mode flags */ | |
| 40 | unsigned short int c_cflag;		/* control mode flags */ | |
| 41 | unsigned short int c_lflag;		/* local mode flags */ | |
| 42 | unsigned char c_line;		/* line discipline */ | |
| 43 | unsigned char c_cc[NCC];		/* control characters */ | |
| 44 | }; | |
| 45 | ||
| 46 | /* modem lines */ | |
| 47 | #define TIOCM_LE	0x001 | |
| 48 | #define TIOCM_DTR	0x002 | |
| 49 | #define TIOCM_RTS	0x004 | |
| 50 | #define TIOCM_ST	0x008 | |
| 51 | #define TIOCM_SR	0x010 | |
| 52 | #define TIOCM_CTS	0x020 | |
| 53 | #define TIOCM_CAR	0x040 | |
| 54 | #define TIOCM_RNG	0x080 | |
| 55 | #define TIOCM_DSR	0x100 | |
| 56 | #define TIOCM_CD	TIOCM_CAR | |
| 57 | #define TIOCM_RI	TIOCM_RNG | |
| 58 | ||
| 59 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | |
| 60 | ||
| 61 | /* line disciplines */ | |
| 62 | #define N_TTY		0 | |
| 63 | #define N_SLIP		1 | |
| 64 | #define N_MOUSE		2 | |
| 65 | #define N_PPP		3 | |
| 66 | #define N_STRIP		4 | |
| 67 | #define N_AX25		5 | |
| 68 | #define N_X25		6	/* X.25 async */ | |
| 69 | #define N_6PACK		7 | |
| 70 | #define N_MASC		8	/* Mobitex module */ | |
| 71 | #define N_R3964		9	/* Simatic R3964 module */ | |
| 72 | #define N_PROFIBUS_FDL	10	/* Profibus */ | |
| 73 | #define N_IRDA		11	/* Linux IR */ | |
| 74 | #define N_SMSBLOCK	12	/* SMS block mode */ | |
| 75 | #define N_HDLC		13	/* synchronous HDLC */ | |
| 76 | #define N_SYNC_PPP	14	/* synchronous PPP */ | |
| 77 | #define	N_HCI		15	/* Bluetooth HCI UART */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/ipc-perm.h created+36| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | /* struct ipc_perm definition. Linux/powerpc version. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_IPC_H | |
| 20 | # error "Never use <bits/ipc-perm.h> directly; include <sys/ipc.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure used to pass permission information to IPC operations. */ | |
| 24 | struct ipc_perm | |
| 25 | { | |
| 26 | __key_t __key;		/* Key. */ | |
| 27 | __uid_t uid;		/* Owner's user ID. */ | |
| 28 | __gid_t gid;		/* Owner's group ID. */ | |
| 29 | __uid_t cuid;		/* Creator's user ID. */ | |
| 30 | __gid_t cgid;		/* Creator's group ID. */ | |
| 31 | __mode_t mode;		/* Read/write permission. */ | |
| 32 | __uint32_t __seq;		/* Sequence number. */ | |
| 33 | __uint32_t __pad1; | |
| 34 | __uint64_t __glibc_reserved1; | |
| 35 | __uint64_t __glibc_reserved2; | |
| 36 | }; | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/iscanonical.h created+58| ... | ... | @@ -0,0 +1,58 @@ |
| 1 | /* Define iscanonical macro. ldbl-128ibm version. | |
| 2 | Copyright (C) 2016-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _MATH_H | |
| 20 | # error "Never use <bits/iscanonical.h> directly; include <math.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #if defined (__NO_LONG_DOUBLE_MATH) || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 | |
| 24 | # define iscanonical(x) ((void) (__typeof (x)) (x), 1) | |
| 25 | #else | |
| 26 | extern int __iscanonicall (long double __x) | |
| 27 | __THROW __attribute__ ((__const__)); | |
| 28 | # define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1) | |
| 29 | # define __iscanonical(x) ((void) (__typeof (x)) (x), 1) | |
| 30 | # if __HAVE_DISTINCT_FLOAT128 | |
| 31 | # define __iscanonicalf128(x) ((void) (__typeof (x)) (x), 1) | |
| 32 | # endif | |
| 33 | ||
| 34 | /* Return nonzero value if X is canonical. In IEEE interchange binary | |
| 35 | formats, all values are canonical, but the argument must still be | |
| 36 | converted to its semantic type for any exceptions arising from the | |
| 37 | conversion, before being discarded; in IBM long double, there are | |
| 38 | encodings that are not consistently handled as corresponding to any | |
| 39 | particular value of the type, and we return 0 for those. */ | |
| 40 | # ifndef __cplusplus | |
| 41 | # define iscanonical(x) __MATH_TG ((x), __iscanonical, (x)) | |
| 42 | # else | |
| 43 | /* In C++ mode, __MATH_TG cannot be used, because it relies on | |
| 44 | __builtin_types_compatible_p, which is a C-only builtin. On the | |
| 45 | other hand, overloading provides the means to distinguish between | |
| 46 | the floating-point types. The overloading resolution will match | |
| 47 | the correct parameter (regardless of type qualifiers (i.e.: const | |
| 48 | and volatile)). */ | |
| 49 | extern "C++" { | |
| 50 | inline int iscanonical (float __val) { return __iscanonicalf (__val); } | |
| 51 | inline int iscanonical (double __val) { return __iscanonical (__val); } | |
| 52 | inline int iscanonical (long double __val) { return __iscanonicall (__val); } | |
| 53 | # if __HAVE_DISTINCT_FLOAT128 | |
| 54 | inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); } | |
| 55 | # endif | |
| 56 | } | |
| 57 | # endif /* __cplusplus */ | |
| 58 | #endif /* __NO_LONG_DOUBLE_MATH */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/link.h created+156| ... | ... | @@ -0,0 +1,156 @@ |
| 1 | /* Machine-specific declarations for dynamic linker interface. PowerPC version | |
| 2 | Copyright (C) 2004-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef	_LINK_H | |
| 20 | # error "Never include <bits/link.h> directly; use <link.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | ||
| 24 | #if __ELF_NATIVE_CLASS == 32 | |
| 25 | ||
| 26 | /* Registers for entry into PLT on PPC32. */ | |
| 27 | typedef struct La_ppc32_regs | |
| 28 | { | |
| 29 | uint32_t lr_reg[8]; | |
| 30 | double lr_fp[8]; | |
| 31 | uint32_t lr_vreg[12][4]; | |
| 32 | uint32_t lr_r1; | |
| 33 | uint32_t lr_lr; | |
| 34 | } La_ppc32_regs; | |
| 35 | ||
| 36 | /* Return values for calls from PLT on PPC32. */ | |
| 37 | typedef struct La_ppc32_retval | |
| 38 | { | |
| 39 | uint32_t lrv_r3; | |
| 40 | uint32_t lrv_r4; | |
| 41 | double lrv_fp[8]; | |
| 42 | uint32_t lrv_v2[4]; | |
| 43 | } La_ppc32_retval; | |
| 44 | ||
| 45 | ||
| 46 | __BEGIN_DECLS | |
| 47 | ||
| 48 | extern Elf32_Addr la_ppc32_gnu_pltenter (Elf32_Sym *__sym, | |
| 49 | 					 unsigned int __ndx, | |
| 50 | 					 uintptr_t *__refcook, | |
| 51 | 					 uintptr_t *__defcook, | |
| 52 | 					 La_ppc32_regs *__regs, | |
| 53 | 					 unsigned int *__flags, | |
| 54 | 					 const char *__symname, | |
| 55 | 					 long int *__framesizep); | |
| 56 | extern unsigned int la_ppc32_gnu_pltexit (Elf32_Sym *__sym, | |
| 57 | 					 unsigned int __ndx, | |
| 58 | 					 uintptr_t *__refcook, | |
| 59 | 					 uintptr_t *__defcook, | |
| 60 | 					 const La_ppc32_regs *__inregs, | |
| 61 | 					 La_ppc32_retval *__outregs, | |
| 62 | 					 const char *__symname); | |
| 63 | ||
| 64 | __END_DECLS | |
| 65 | ||
| 66 | #elif __ELF_NATIVE_CLASS == 64 | |
| 67 | # if _CALL_ELF != 2 | |
| 68 | ||
| 69 | /* Registers for entry into PLT on PPC64. */ | |
| 70 | typedef struct La_ppc64_regs | |
| 71 | { | |
| 72 | uint64_t lr_reg[8]; | |
| 73 | double lr_fp[13]; | |
| 74 | uint32_t __padding; | |
| 75 | uint32_t lr_vrsave; | |
| 76 | uint32_t lr_vreg[12][4]; | |
| 77 | uint64_t lr_r1; | |
| 78 | uint64_t lr_lr; | |
| 79 | } La_ppc64_regs; | |
| 80 | ||
| 81 | /* Return values for calls from PLT on PPC64. */ | |
| 82 | typedef struct La_ppc64_retval | |
| 83 | { | |
| 84 | uint64_t lrv_r3; | |
| 85 | uint64_t lrv_r4; | |
| 86 | double lrv_fp[4];	/* f1-f4, float - complex long double. */ | |
| 87 | uint32_t lrv_v2[4];	/* v2. */ | |
| 88 | } La_ppc64_retval; | |
| 89 | ||
| 90 | ||
| 91 | __BEGIN_DECLS | |
| 92 | ||
| 93 | extern Elf64_Addr la_ppc64_gnu_pltenter (Elf64_Sym *__sym, | |
| 94 | 					 unsigned int __ndx, | |
| 95 | 					 uintptr_t *__refcook, | |
| 96 | 					 uintptr_t *__defcook, | |
| 97 | 					 La_ppc64_regs *__regs, | |
| 98 | 					 unsigned int *__flags, | |
| 99 | 					 const char *__symname, | |
| 100 | 					 long int *__framesizep); | |
| 101 | extern unsigned int la_ppc64_gnu_pltexit (Elf64_Sym *__sym, | |
| 102 | 					 unsigned int __ndx, | |
| 103 | 					 uintptr_t *__refcook, | |
| 104 | 					 uintptr_t *__defcook, | |
| 105 | 					 const La_ppc64_regs *__inregs, | |
| 106 | 					 La_ppc64_retval *__outregs, | |
| 107 | 					 const char *__symname); | |
| 108 | ||
| 109 | __END_DECLS | |
| 110 | ||
| 111 | # else | |
| 112 | ||
| 113 | /* Registers for entry into PLT on PPC64 in the ELFv2 ABI. */ | |
| 114 | typedef struct La_ppc64v2_regs | |
| 115 | { | |
| 116 | uint64_t lr_reg[8]; | |
| 117 | double lr_fp[13]; | |
| 118 | uint32_t __padding; | |
| 119 | uint32_t lr_vrsave; | |
| 120 | uint32_t lr_vreg[12][4] __attribute__ ((aligned (16))); | |
| 121 | uint64_t lr_r1; | |
| 122 | uint64_t lr_lr; | |
| 123 | } La_ppc64v2_regs; | |
| 124 | ||
| 125 | /* Return values for calls from PLT on PPC64 in the ELFv2 ABI. */ | |
| 126 | typedef struct La_ppc64v2_retval | |
| 127 | { | |
| 128 | uint64_t lrv_r3; | |
| 129 | uint64_t lrv_r4; | |
| 130 | double lrv_fp[10]; | |
| 131 | uint32_t lrv_vreg[8][4] __attribute__ ((aligned (16))); | |
| 132 | } La_ppc64v2_retval; | |
| 133 | ||
| 134 | ||
| 135 | __BEGIN_DECLS | |
| 136 | ||
| 137 | extern Elf64_Addr la_ppc64v2_gnu_pltenter (Elf64_Sym *__sym, | |
| 138 | 					 unsigned int __ndx, | |
| 139 | 					 uintptr_t *__refcook, | |
| 140 | 					 uintptr_t *__defcook, | |
| 141 | 					 La_ppc64v2_regs *__regs, | |
| 142 | 					 unsigned int *__flags, | |
| 143 | 					 const char *__symname, | |
| 144 | 					 long int *__framesizep); | |
| 145 | extern unsigned int la_ppc64v2_gnu_pltexit (Elf64_Sym *__sym, | |
| 146 | 					 unsigned int __ndx, | |
| 147 | 					 uintptr_t *__refcook, | |
| 148 | 					 uintptr_t *__defcook, | |
| 149 | 					 const La_ppc64v2_regs *__inregs, | |
| 150 | 					 La_ppc64v2_retval *__outregs, | |
| 151 | 					 const char *__symname); | |
| 152 | ||
| 153 | __END_DECLS | |
| 154 | ||
| 155 | # endif | |
| 156 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/long-double.h created+25| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | /* Properties of long double type. ldbl-opt version. | |
| 2 | Copyright (C) 2016-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __NO_LONG_DOUBLE_MATH | |
| 20 | # define __LONG_DOUBLE_MATH_OPTIONAL	1 | |
| 21 | # ifndef __LONG_DOUBLE_128__ | |
| 22 | # define __NO_LONG_DOUBLE_MATH		1 | |
| 23 | # endif | |
| 24 | #endif | |
| 25 | #define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/mman.h created+53| ... | ... | @@ -0,0 +1,53 @@ |
| 1 | /* Definitions for POSIX memory map interface. Linux/PowerPC version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MMAN_H | |
| 20 | # error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The following definitions basically come from the kernel headers. | |
| 24 | But the kernel header is not namespace clean. */ | |
| 25 | ||
| 26 | #define PROT_SAO	0x10		/* Strong Access Ordering. */ | |
| 27 | ||
| 28 | /* These are Linux-specific. */ | |
| 29 | #ifdef __USE_MISC | |
| 30 | # define MAP_GROWSDOWN	0x00100		/* Stack-like segment. */ | |
| 31 | # define MAP_DENYWRITE	0x00800		/* ETXTBSY */ | |
| 32 | # define MAP_EXECUTABLE	0x01000		/* Mark it as an executable. */ | |
| 33 | # define MAP_LOCKED	0x00080		/* Lock the mapping. */ | |
| 34 | # define MAP_NORESERVE	0x00040		/* Don't check for reservations. */ | |
| 35 | # define MAP_POPULATE	0x08000		/* Populate (prefault) pagetables. */ | |
| 36 | # define MAP_NONBLOCK	0x10000		/* Do not block on IO. */ | |
| 37 | # define MAP_STACK	0x20000		/* Allocation is for a stack. */ | |
| 38 | # define MAP_HUGETLB	0x40000		/* Create huge page mapping. */ | |
| 39 | # define MAP_SYNC	0x80000		/* Perform synchronous page | |
| 40 | 					 faults for the mapping. */ | |
| 41 | # define MAP_FIXED_NOREPLACE 0x100000	/* MAP_FIXED but do not unmap | |
| 42 | 					 underlying mapping. */ | |
| 43 | #endif | |
| 44 | ||
| 45 | /* Flags for `mlockall'. */ | |
| 46 | #define MCL_CURRENT	0x2000		/* Lock all currently mapped pages. */ | |
| 47 | #define MCL_FUTURE	0x4000		/* Lock all additions to address | |
| 48 | 					 space. */ | |
| 49 | #define MCL_ONFAULT	0x8000		/* Lock all pages that are | |
| 50 | 					 faulted in. */ | |
| 51 | ||
| 52 | /* Include generic Linux declarations. */ | |
| 53 | #include <bits/mman-linux.h> | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/procfs.h created+49| ... | ... | @@ -0,0 +1,49 @@ |
| 1 | /* Types for registers for sys/procfs.h. PowerPC version. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_PROCFS_H | |
| 20 | # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <signal.h> | |
| 24 | #include <sys/ucontext.h> | |
| 25 | ||
| 26 | /* These definitions are normally provided by ucontext.h via | |
| 27 | asm/sigcontext.h, asm/ptrace.h, and asm/elf.h. Otherwise we define | |
| 28 | them here. */ | |
| 29 | #if !defined __PPC64_ELF_H && !defined _ASM_POWERPC_ELF_H | |
| 30 | #define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ | |
| 31 | #define ELF_NFPREG 33 /* includes fpscr */ | |
| 32 | #if __WORDSIZE == 32 | |
| 33 | # define ELF_NVRREG 33 /* includes vscr */ | |
| 34 | #else | |
| 35 | # define ELF_NVRREG 34 /* includes vscr */ | |
| 36 | #endif | |
| 37 | ||
| 38 | typedef unsigned long elf_greg_t; | |
| 39 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | |
| 40 | ||
| 41 | typedef double elf_fpreg_t; | |
| 42 | typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | |
| 43 | ||
| 44 | /* Altivec registers */ | |
| 45 | typedef struct { | |
| 46 | unsigned int u[4]; | |
| 47 | } __attribute__ ((__aligned__ (16))) elf_vrreg_t; | |
| 48 | typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG]; | |
| 49 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/pthread_stack_min.h created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. Linux/PPC version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; see the file COPYING.LIB. If | |
| 17 | not, see <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. At least two pages for systems with 64k | |
| 20 | pages. */ | |
| 21 | #define PTHREAD_STACK_MIN	131072 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/setjmp.h created+50| ... | ... | @@ -0,0 +1,50 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | /* Define the machine-dependent type `jmp_buf'. PowerPC version. */ | |
| 19 | #ifndef _BITS_SETJMP_H | |
| 20 | #define _BITS_SETJMP_H 1 | |
| 21 | ||
| 22 | #if !defined _SETJMP_H && !defined _PTHREAD_H | |
| 23 | # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* The previous bits/setjmp.h had __jmp_buf defined as a structure. | |
| 27 | We use an array of 'long int' instead, to make writing the | |
| 28 | assembler easier. Naturally, user code should not depend on | |
| 29 | either representation. */ | |
| 30 | ||
| 31 | #include <bits/wordsize.h> | |
| 32 | ||
| 33 | /* The current powerpc 32-bit Altivec ABI specifies for SVR4 ABI and EABI | |
| 34 | the vrsave must be at byte 248 & v20 at byte 256. So we must pad this | |
| 35 | correctly on 32 bit. It also insists that vecregs are only gauranteed | |
| 36 | 4 byte alignment so we need to use vperm in the setjmp/longjmp routines. | |
| 37 | We have to version the code because members like int __mask_was_saved | |
| 38 | in the jmp_buf will move as jmp_buf is now larger than 248 bytes. We | |
| 39 | cannot keep the altivec jmp_buf backward compatible with the jmp_buf. */ | |
| 40 | #ifndef	_ASM | |
| 41 | # if __WORDSIZE == 64 | |
| 42 | typedef long int __jmp_buf[64] __attribute__ ((__aligned__ (16))); | |
| 43 | # else | |
| 44 | /* The alignment is not essential, i.e.the buffer can be copied to a 4 byte | |
| 45 | aligned buffer as per the ABI it is just added for performance reasons. */ | |
| 46 | typedef long int __jmp_buf[64 + (12 * 4)] __attribute__ ((__aligned__ (16))); | |
| 47 | # endif | |
| 48 | #endif | |
| 49 | ||
| 50 | #endif /* bits/setjmp.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/sigstack.h created+32| ... | ... | @@ -0,0 +1,32 @@ |
| 1 | /* sigstack, sigaltstack definitions. | |
| 2 | Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGSTACK_H | |
| 20 | #define _BITS_SIGSTACK_H 1 | |
| 21 | ||
| 22 | #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H | |
| 23 | # error "Never include this file directly. Use <signal.h> instead" | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Minimum stack size for a signal handler. */ | |
| 27 | #define MINSIGSTKSZ	4096 | |
| 28 | ||
| 29 | /* System default stack size. */ | |
| 30 | #define SIGSTKSZ	16384 | |
| 31 | ||
| 32 | #endif /* bits/sigstack.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/socket-constants.h created+70| ... | ... | @@ -0,0 +1,70 @@ |
| 1 | /* Socket constants which vary among Linux architectures. Version for POWER. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define SOL_SOCKET 1 | |
| 24 | #define SO_ACCEPTCONN 30 | |
| 25 | #define SO_BROADCAST 6 | |
| 26 | #define SO_DONTROUTE 5 | |
| 27 | #define SO_ERROR 4 | |
| 28 | #define SO_KEEPALIVE 9 | |
| 29 | #define SO_LINGER 13 | |
| 30 | #define SO_OOBINLINE 10 | |
| 31 | #define SO_RCVBUF 8 | |
| 32 | #define SO_RCVLOWAT 16 | |
| 33 | #define SO_REUSEADDR 2 | |
| 34 | #define SO_SNDBUF 7 | |
| 35 | #define SO_SNDLOWAT 17 | |
| 36 | #define SO_TYPE 3 | |
| 37 | ||
| 38 | #if __TIMESIZE == 64 | |
| 39 | # define SO_RCVTIMEO 18 | |
| 40 | # define SO_SNDTIMEO 19 | |
| 41 | # define SO_TIMESTAMP 29 | |
| 42 | # define SO_TIMESTAMPNS 35 | |
| 43 | # define SO_TIMESTAMPING 37 | |
| 44 | #else | |
| 45 | # define SO_RCVTIMEO_OLD 18 | |
| 46 | # define SO_SNDTIMEO_OLD 19 | |
| 47 | # define SO_RCVTIMEO_NEW 66 | |
| 48 | # define SO_SNDTIMEO_NEW 67 | |
| 49 | ||
| 50 | # define SO_TIMESTAMP_OLD 29 | |
| 51 | # define SO_TIMESTAMPNS_OLD 35 | |
| 52 | # define SO_TIMESTAMPING_OLD 37 | |
| 53 | # define SO_TIMESTAMP_NEW 63 | |
| 54 | # define SO_TIMESTAMPNS_NEW 64 | |
| 55 | # define SO_TIMESTAMPING_NEW 65 | |
| 56 | ||
| 57 | # ifdef __USE_TIME_BITS64 | |
| 58 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 59 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 60 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 61 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 62 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 63 | # else | |
| 64 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 65 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 66 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 67 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 68 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 69 | # endif | |
| 70 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/struct_mutex.h created+63| ... | ... | @@ -0,0 +1,63 @@ |
| 1 | /* PowerPC internal mutex struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _THREAD_MUTEX_INTERNAL_H | |
| 20 | #define _THREAD_MUTEX_INTERNAL_H 1 | |
| 21 | ||
| 22 | struct __pthread_mutex_s | |
| 23 | { | |
| 24 | int __lock; | |
| 25 | unsigned int __count; | |
| 26 | int __owner; | |
| 27 | #if __WORDSIZE == 64 | |
| 28 | unsigned int __nusers; | |
| 29 | #endif | |
| 30 | /* KIND must stay at this position in the structure to maintain | |
| 31 | binary compatibility with static initializers. */ | |
| 32 | int __kind; | |
| 33 | #if __WORDSIZE == 64 | |
| 34 | short __spins; | |
| 35 | short __elision; | |
| 36 | __pthread_list_t __list; | |
| 37 | # define __PTHREAD_MUTEX_HAVE_PREV 1 | |
| 38 | #else | |
| 39 | unsigned int __nusers; | |
| 40 | __extension__ union | |
| 41 | { | |
| 42 | struct | |
| 43 | { | |
| 44 | short __espins; | |
| 45 | short __elision; | |
| 46 | # define __spins __elision_data.__espins | |
| 47 | # define __elision __elision_data.__elision | |
| 48 | } __elision_data; | |
| 49 | __pthread_slist_t __list; | |
| 50 | }; | |
| 51 | # define __PTHREAD_MUTEX_HAVE_PREV 0 | |
| 52 | #endif | |
| 53 | }; | |
| 54 | ||
| 55 | #if __WORDSIZE == 64 | |
| 56 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 57 | 0, 0, 0, 0, __kind, 0, 0, { 0, 0 } | |
| 58 | #else | |
| 59 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 60 | 0, 0, 0, __kind, 0, { { 0, 0 } } | |
| 61 | #endif | |
| 62 | ||
| 63 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/struct_rwlock.h created+61| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | /* PowerPC internal rwlock struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | ||
| 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 | <http://www.gnu.org/licenses/>. */ | |
| 19 | ||
| 20 | #ifndef _RWLOCK_INTERNAL_H | |
| 21 | #define _RWLOCK_INTERNAL_H | |
| 22 | ||
| 23 | struct __pthread_rwlock_arch_t | |
| 24 | { | |
| 25 | unsigned int __readers; | |
| 26 | unsigned int __writers; | |
| 27 | unsigned int __wrphase_futex; | |
| 28 | unsigned int __writers_futex; | |
| 29 | unsigned int __pad3; | |
| 30 | unsigned int __pad4; | |
| 31 | #if __WORDSIZE == 64 | |
| 32 | int __cur_writer; | |
| 33 | int __shared; | |
| 34 | unsigned char __rwelision; | |
| 35 | unsigned char __pad1[7]; | |
| 36 | unsigned long int __pad2; | |
| 37 | /* FLAGS must stay at this position in the structure to maintain | |
| 38 | binary compatibility. */ | |
| 39 | unsigned int __flags; | |
| 40 | # define __PTHREAD_RWLOCK_ELISION_EXTRA 0, {0, 0, 0, 0, 0, 0, 0 } | |
| 41 | #else | |
| 42 | unsigned char __rwelision; | |
| 43 | unsigned char __pad2; | |
| 44 | unsigned char __shared; | |
| 45 | /* FLAGS must stay at this position in the structure to maintain | |
| 46 | binary compatibility. */ | |
| 47 | unsigned char __flags; | |
| 48 | int __cur_writer; | |
| 49 | # define __PTHREAD_RWLOCK_ELISION_EXTRA 0 | |
| 50 | #endif | |
| 51 | }; | |
| 52 | ||
| 53 | #if __WORDSIZE == 64 | |
| 54 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 55 | 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, __flags | |
| 56 | #else | |
| 57 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 58 | 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0, __flags, 0 | |
| 59 | #endif | |
| 60 | ||
| 61 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/struct_stat.h created+231| ... | ... | @@ -0,0 +1,231 @@ |
| 1 | /* Definition for struct stat. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #if !defined _SYS_STAT_H && !defined _FCNTL_H | |
| 20 | # error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifndef _BITS_STRUCT_STAT_H | |
| 24 | #define _BITS_STRUCT_STAT_H	1 | |
| 25 | ||
| 26 | #include <bits/wordsize.h> | |
| 27 | ||
| 28 | #if __WORDSIZE == 32 | |
| 29 | struct stat | |
| 30 | { | |
| 31 | # ifdef __USE_TIME_BITS64 | |
| 32 | # include <bits/struct_stat_time64_helper.h> | |
| 33 | # else | |
| 34 | __dev_t st_dev;			/* Device. */ | |
| 35 | # ifndef __USE_FILE_OFFSET64 | |
| 36 | unsigned short int __pad1; | |
| 37 | __ino_t st_ino;			/* File serial number.	*/ | |
| 38 | # else | |
| 39 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 40 | # endif | |
| 41 | __mode_t st_mode;			/* File mode. */ | |
| 42 | __nlink_t st_nlink;			/* Link count. */ | |
| 43 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 44 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 45 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 46 | unsigned short int __pad2; | |
| 47 | # ifndef __USE_FILE_OFFSET64 | |
| 48 | __off_t st_size;			/* Size of file, in bytes. */ | |
| 49 | # else | |
| 50 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 51 | # endif | |
| 52 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 53 | ||
| 54 | # ifndef __USE_FILE_OFFSET64 | |
| 55 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 56 | # else | |
| 57 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 58 | # endif | |
| 59 | # ifdef __USE_XOPEN2K8 | |
| 60 | /* Nanosecond resolution timestamps are stored in a format | |
| 61 | equivalent to 'struct timespec'. This is the type used | |
| 62 | whenever possible but the Unix namespace rules do not allow the | |
| 63 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 64 | Therefore we have to handle the use of this header in strictly | |
| 65 | standard-compliant sources special. */ | |
| 66 | struct timespec st_atim;		/* Time of last access. */ | |
| 67 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 68 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 69 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 70 | # define st_mtime st_mtim.tv_sec | |
| 71 | # define st_ctime st_ctim.tv_sec | |
| 72 | # else | |
| 73 | __time_t st_atime;			/* Time of last access. */ | |
| 74 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 75 | __time_t st_mtime;			/* Time of last modification. */ | |
| 76 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 77 | __time_t st_ctime;			/* Time of last status change. */ | |
| 78 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 79 | # endif | |
| 80 | unsigned long int __glibc_reserved4; | |
| 81 | unsigned long int __glibc_reserved5; | |
| 82 | # endif /* __USE_TIME_BITS64 */ | |
| 83 | }; | |
| 84 | ||
| 85 | # ifdef __USE_LARGEFILE64 | |
| 86 | struct stat64 | |
| 87 | { | |
| 88 | # ifdef __USE_TIME_BITS64 | |
| 89 | # include <bits/struct_stat_time64_helper.h> | |
| 90 | # else | |
| 91 | __dev_t st_dev;			/* Device. */ | |
| 92 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 93 | __mode_t st_mode;			/* File mode. */ | |
| 94 | __nlink_t st_nlink;			/* Link count. */ | |
| 95 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 96 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 97 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 98 | unsigned short int __pad2; | |
| 99 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 100 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 101 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 102 | # ifdef __USE_XOPEN2K8 | |
| 103 | /* Nanosecond resolution timestamps are stored in a format | |
| 104 | equivalent to 'struct timespec'. This is the type used | |
| 105 | whenever possible but the Unix namespace rules do not allow the | |
| 106 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 107 | Therefore we have to handle the use of this header in strictly | |
| 108 | standard-compliant sources special. */ | |
| 109 | struct timespec st_atim;		/* Time of last access. */ | |
| 110 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 111 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 112 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 113 | # define st_mtime st_mtim.tv_sec | |
| 114 | # define st_ctime st_ctim.tv_sec | |
| 115 | # else | |
| 116 | __time_t st_atime;			/* Time of last access. */ | |
| 117 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 118 | __time_t st_mtime;			/* Time of last modification. */ | |
| 119 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 120 | __time_t st_ctime;			/* Time of last status change. */ | |
| 121 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 122 | # endif | |
| 123 | unsigned long int __glibc_reserved4; | |
| 124 | unsigned long int __glibc_reserved5; | |
| 125 | # endif /* __USE_TIME_BITS64 */ | |
| 126 | }; | |
| 127 | # endif /* __USE_LARGEFILE64 */ | |
| 128 | ||
| 129 | #else /* __WORDSIZE == 32 */ | |
| 130 | ||
| 131 | struct stat | |
| 132 | { | |
| 133 | __dev_t st_dev;			/* Device. */ | |
| 134 | # ifndef __USE_FILE_OFFSET64 | |
| 135 | __ino_t st_ino;			/* File serial number.	*/ | |
| 136 | # else | |
| 137 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 138 | # endif | |
| 139 | __nlink_t st_nlink;			/* Link count. */ | |
| 140 | __mode_t st_mode;			/* File mode. */ | |
| 141 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 142 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 143 | int __pad2; | |
| 144 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 145 | # ifndef __USE_FILE_OFFSET64 | |
| 146 | __off_t st_size;			/* Size of file, in bytes. */ | |
| 147 | # else | |
| 148 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 149 | # endif | |
| 150 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 151 | ||
| 152 | # ifndef __USE_FILE_OFFSET64 | |
| 153 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 154 | # else | |
| 155 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 156 | # endif | |
| 157 | # ifdef __USE_XOPEN2K8 | |
| 158 | /* Nanosecond resolution timestamps are stored in a format | |
| 159 | equivalent to 'struct timespec'. This is the type used | |
| 160 | whenever possible but the Unix namespace rules do not allow the | |
| 161 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 162 | Therefore we have to handle the use of this header in strictly | |
| 163 | standard-compliant sources special. */ | |
| 164 | struct timespec st_atim;		/* Time of last access. */ | |
| 165 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 166 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 167 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 168 | # define st_mtime st_mtim.tv_sec | |
| 169 | # define st_ctime st_ctim.tv_sec | |
| 170 | # else | |
| 171 | __time_t st_atime;			/* Time of last access. */ | |
| 172 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 173 | __time_t st_mtime;			/* Time of last modification. */ | |
| 174 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 175 | __time_t st_ctime;			/* Time of last status change. */ | |
| 176 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 177 | # endif | |
| 178 | unsigned long int __glibc_reserved4; | |
| 179 | unsigned long int __glibc_reserved5; | |
| 180 | unsigned long int __glibc_reserved6; | |
| 181 | }; | |
| 182 | ||
| 183 | # ifdef __USE_LARGEFILE64 | |
| 184 | struct stat64 | |
| 185 | { | |
| 186 | __dev_t st_dev;			/* Device. */ | |
| 187 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 188 | __nlink_t st_nlink;			/* Link count. */ | |
| 189 | __mode_t st_mode;			/* File mode. */ | |
| 190 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 191 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 192 | int __pad2; | |
| 193 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 194 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 195 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 196 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 197 | # ifdef __USE_XOPEN2K8 | |
| 198 | /* Nanosecond resolution timestamps are stored in a format | |
| 199 | equivalent to 'struct timespec'. This is the type used | |
| 200 | whenever possible but the Unix namespace rules do not allow the | |
| 201 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 202 | Therefore we have to handle the use of this header in strictly | |
| 203 | standard-compliant sources special. */ | |
| 204 | struct timespec st_atim;		/* Time of last access. */ | |
| 205 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 206 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 207 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 208 | # define st_mtime st_mtim.tv_sec | |
| 209 | # define st_ctime st_ctim.tv_sec | |
| 210 | # else | |
| 211 | __time_t st_atime;			/* Time of last access. */ | |
| 212 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 213 | __time_t st_mtime;			/* Time of last modification. */ | |
| 214 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 215 | __time_t st_ctime;			/* Time of last status change. */ | |
| 216 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 217 | # endif | |
| 218 | unsigned long int __glibc_reserved4; | |
| 219 | unsigned long int __glibc_reserved5; | |
| 220 | unsigned long int __glibc_reserved6; | |
| 221 | }; | |
| 222 | # endif /* __USE_LARGEFILE64 */ | |
| 223 | #endif | |
| 224 | ||
| 225 | /* Tell code we have these members. */ | |
| 226 | #define	_STATBUF_ST_BLKSIZE | |
| 227 | #define _STATBUF_ST_RDEV | |
| 228 | /* Nanosecond resolution time values are supported. */ | |
| 229 | #define _STATBUF_ST_NSEC | |
| 230 | ||
| 231 | #endif /* _BITS_STRUCT_STAT_H */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/termios-baud.h created+45| ... | ... | @@ -0,0 +1,45 @@ |
| 1 | /* termios baud rate selection definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-baud.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifdef __USE_MISC | |
| 24 | # define CBAUD	0000377 | |
| 25 | # define CBAUDEX 0000020 | |
| 26 | # define CMSPAR 010000000000		/* mark or space (stick) parity */ | |
| 27 | # define CRTSCTS 020000000000		/* flow control */ | |
| 28 | #endif | |
| 29 | ||
| 30 | #define B57600 00020 | |
| 31 | #define B115200 00021 | |
| 32 | #define B230400 00022 | |
| 33 | #define B460800 00023 | |
| 34 | #define B500000 00024 | |
| 35 | #define B576000 00025 | |
| 36 | #define B921600 00026 | |
| 37 | #define B1000000 00027 | |
| 38 | #define B1152000 00030 | |
| 39 | #define B1500000 00031 | |
| 40 | #define B2000000 00032 | |
| 41 | #define B2500000 00033 | |
| 42 | #define B3000000 00034 | |
| 43 | #define B3500000 00035 | |
| 44 | #define B4000000 00036 | |
| 45 | #define __MAX_BAUD B4000000 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/termios-c_cc.h created+41| ... | ... | @@ -0,0 +1,41 @@ |
| 1 | /* termios c_cc symbolic constant definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_cc.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_cc characters */ | |
| 24 | #define VINTR	0 | |
| 25 | #define VQUIT	1 | |
| 26 | #define VERASE	2 | |
| 27 | #define VKILL	3 | |
| 28 | #define VEOF	4 | |
| 29 | #define VMIN	5 | |
| 30 | #define VEOL	6 | |
| 31 | #define VTIME	7 | |
| 32 | #define VEOL2	8 | |
| 33 | #define VSWTC	9 | |
| 34 | ||
| 35 | #define VWERASE	10 | |
| 36 | #define VREPRINT	11 | |
| 37 | #define VSUSP		12 | |
| 38 | #define VSTART		13 | |
| 39 | #define VSTOP		14 | |
| 40 | #define VLNEXT		15 | |
| 41 | #define VDISCARD	16 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/termios-c_cflag.h created+35| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | /* termios control mode definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_cflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define CSIZE	00001400 | |
| 24 | #define CS5	00000000 | |
| 25 | #define CS6	00000400 | |
| 26 | #define CS7	00001000 | |
| 27 | #define CS8	00001400 | |
| 28 | ||
| 29 | #define CSTOPB	00002000 | |
| 30 | #define CREAD	00004000 | |
| 31 | #define PARENB	00010000 | |
| 32 | #define PARODD	00020000 | |
| 33 | #define HUPCL	00040000 | |
| 34 | ||
| 35 | #define CLOCAL	00100000 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/termios-c_iflag.h created+38| ... | ... | @@ -0,0 +1,38 @@ |
| 1 | /* termios input mode definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_iflags.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_iflag bits */ | |
| 24 | #define IGNBRK	0000001 | |
| 25 | #define BRKINT	0000002 | |
| 26 | #define IGNPAR	0000004 | |
| 27 | #define PARMRK	0000010 | |
| 28 | #define INPCK	0000020 | |
| 29 | #define ISTRIP	0000040 | |
| 30 | #define INLCR	0000100 | |
| 31 | #define IGNCR	0000200 | |
| 32 | #define ICRNL	0000400 | |
| 33 | #define IXON	0001000 | |
| 34 | #define IXOFF	0002000 | |
| 35 | #define IXANY	0004000 | |
| 36 | #define IUCLC	0010000 | |
| 37 | #define IMAXBEL	0020000 | |
| 38 | #define IUTF8	0040000 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/termios-c_lflag.h created+45| ... | ... | @@ -0,0 +1,45 @@ |
| 1 | /* termios local mode definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_lflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_lflag bits */ | |
| 24 | #define ISIG	0x00000080 | |
| 25 | #define ICANON	0x00000100 | |
| 26 | #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) | |
| 27 | # define XCASE	0x00004000 | |
| 28 | #endif | |
| 29 | #define ECHO	0x00000008 | |
| 30 | #define ECHOE	0x00000002 | |
| 31 | #define ECHOK	0x00000004 | |
| 32 | #define ECHONL	0x00000010 | |
| 33 | #define NOFLSH	0x80000000 | |
| 34 | #define TOSTOP	0x00400000 | |
| 35 | #ifdef __USE_MISC | |
| 36 | # define ECHOCTL	0x00000040 | |
| 37 | # define ECHOPRT	0x00000020 | |
| 38 | # define ECHOKE	0x00000001 | |
| 39 | # define FLUSHO	0x00800000 | |
| 40 | # define PENDIN	0x20000000 | |
| 41 | #endif | |
| 42 | #define IEXTEN	0x00000400 | |
| 43 | #ifdef __USE_MISC | |
| 44 | # define EXTPROC 0x10000000 | |
| 45 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/termios-c_oflag.h created+65| ... | ... | @@ -0,0 +1,65 @@ |
| 1 | /* termios output mode definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_oflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_oflag bits */ | |
| 24 | #define OPOST	0000001 | |
| 25 | #define ONLCR	0000002 | |
| 26 | #define OLCUC	0000004 | |
| 27 | ||
| 28 | #define OCRNL	0000010 | |
| 29 | #define ONOCR	0000020 | |
| 30 | #define ONLRET	0000040 | |
| 31 | ||
| 32 | #define OFILL	00000100 | |
| 33 | #define OFDEL	00000200 | |
| 34 | #if defined __USE_MISC || defined __USE_XOPEN | |
| 35 | # define NLDLY	00001400 | |
| 36 | # define NL0	00000000 | |
| 37 | # define NL1	00000400 | |
| 38 | # if defined __USE_MISC | |
| 39 | # define NL2	00001000 | |
| 40 | # define NL3	00001400 | |
| 41 | # endif | |
| 42 | # define TABDLY	00006000 | |
| 43 | # define TAB0	00000000 | |
| 44 | # define TAB1	00002000 | |
| 45 | # define TAB2	00004000 | |
| 46 | # define TAB3	00006000 | |
| 47 | # define CRDLY	00030000 | |
| 48 | # define CR0	00000000 | |
| 49 | # define CR1	00010000 | |
| 50 | # define CR2	00020000 | |
| 51 | # define CR3	00030000 | |
| 52 | # define FFDLY	00040000 | |
| 53 | # define FF0	00000000 | |
| 54 | # define FF1	00040000 | |
| 55 | # define BSDLY	00100000 | |
| 56 | # define BS0	00000000 | |
| 57 | # define BS1	00100000 | |
| 58 | #endif | |
| 59 | #define VTDLY	00200000 | |
| 60 | #define VT0	00000000 | |
| 61 | #define VT1	00200000 | |
| 62 | ||
| 63 | #ifdef __USE_MISC | |
| 64 | # define XTABS	00006000 | |
| 65 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/termios-misc.h created+72| ... | ... | @@ -0,0 +1,72 @@ |
| 1 | /* termios baud platform specific definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-misc.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifdef __USE_MISC | |
| 24 | ||
| 25 | struct sgttyb { | |
| 26 | 	char	sg_ispeed; | |
| 27 | 	char	sg_ospeed; | |
| 28 | 	char	sg_erase; | |
| 29 | 	char	sg_kill; | |
| 30 | 	short	sg_flags; | |
| 31 | }; | |
| 32 | ||
| 33 | struct tchars { | |
| 34 | 	char	t_intrc; | |
| 35 | 	char	t_quitc; | |
| 36 | 	char	t_startc; | |
| 37 | 	char	t_stopc; | |
| 38 | 	char	t_eofc; | |
| 39 | 	char	t_brkc; | |
| 40 | }; | |
| 41 | ||
| 42 | struct ltchars { | |
| 43 | 	char	t_suspc; | |
| 44 | 	char	t_dsuspc; | |
| 45 | 	char	t_rprntc; | |
| 46 | 	char	t_flushc; | |
| 47 | 	char	t_werasc; | |
| 48 | 	char	t_lnextc; | |
| 49 | }; | |
| 50 | ||
| 51 | /* Used for packet mode */ | |
| 52 | #define TIOCPKT_DATA		 0 | |
| 53 | #define TIOCPKT_FLUSHREAD	 1 | |
| 54 | #define TIOCPKT_FLUSHWRITE	 2 | |
| 55 | #define TIOCPKT_STOP		 4 | |
| 56 | #define TIOCPKT_START		 8 | |
| 57 | #define TIOCPKT_NOSTOP		16 | |
| 58 | #define TIOCPKT_DOSTOP		32 | |
| 59 | ||
| 60 | /* c_cc characters */ | |
| 61 | #define _VINTR	0 | |
| 62 | #define _VQUIT	1 | |
| 63 | #define _VERASE	2 | |
| 64 | #define _VKILL	3 | |
| 65 | #define _VEOF	4 | |
| 66 | #define _VMIN	5 | |
| 67 | #define _VEOL	6 | |
| 68 | #define _VTIME	7 | |
| 69 | #define _VEOL2	8 | |
| 70 | #define _VSWTC	9 | |
| 71 | ||
| 72 | #endif /* __USE_MISC */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_msqid_ds.h created+53| ... | ... | @@ -0,0 +1,53 @@ |
| 1 | /* Linux/PowerPC implementation of the SysV message struct msqid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MSG_H | |
| 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 25 | /* Structure of record for one message inside the kernel. | |
| 26 | The type `struct msg' is opaque. */ | |
| 27 | struct msqid_ds | |
| 28 | { | |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ | |
| 33 | # if __TIMESIZE == 32 | |
| 34 | unsigned long int __msg_stime_high; | |
| 35 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 36 | unsigned long int __msg_rtime_high; | |
| 37 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 38 | unsigned long int __msg_ctime_high; | |
| 39 | __time_t msg_ctime;		/* time of last change */ | |
| 40 | # else | |
| 41 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 42 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 43 | __time_t msg_ctime;		/* time of last change */ | |
| 44 | # endif | |
| 45 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ | |
| 46 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ | |
| 47 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ | |
| 48 | __pid_t msg_lspid;		/* pid of last msgsnd() */ | |
| 49 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ | |
| 50 | __syscall_ulong_t __glibc_reserved4; | |
| 51 | __syscall_ulong_t __glibc_reserved5; | |
| 52 | #endif | |
| 53 | }; | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_semid_ds.h created+43| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | /* PowerPC implementation of the semaphore struct semid_ds. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SEM_H | |
| 20 | # error "Never include <bits/types/struct_semid_ds.h> directly; use <sys/sem.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a set of semaphores. */ | |
| 24 | struct semid_ds | |
| 25 | { | |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 29 | struct ipc_perm sem_perm; /* operation permission struct */ | |
| 30 | # if __TIMESIZE == 32 | |
| 31 | __syscall_ulong_t __sem_otime_high; | |
| 32 | __time_t sem_otime; /* last semop() time */ | |
| 33 | __syscall_ulong_t __sem_ctime_high; | |
| 34 | __time_t sem_ctime; /* last time changed by semctl() */ | |
| 35 | # else | |
| 36 | __time_t sem_otime; /* last semop() time */ | |
| 37 | __time_t sem_ctime; /* last time changed by semctl() */ | |
| 38 | # endif | |
| 39 | __syscall_ulong_t sem_nsems; /* number of semaphores in set */ | |
| 40 | __syscall_ulong_t __glibc_reserved3; | |
| 41 | __syscall_ulong_t __glibc_reserved4; | |
| 42 | #endif | |
| 43 | }; | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_shmid_ds.h created+50| ... | ... | @@ -0,0 +1,50 @@ |
| 1 | /* Linux/PowerPC implementation of the shared memory struct shmid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never include <bits/types/struct_shmid_ds.h> directly; use <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a shared memory segment. */ | |
| 24 | struct shmid_ds | |
| 25 | { | |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 29 | struct ipc_perm shm_perm;		/* operation permission struct */ | |
| 30 | # if __TIMESIZE == 32 | |
| 31 | unsigned long int __shm_atime_high; | |
| 32 | __time_t shm_atime;			/* time of last shmat() */ | |
| 33 | unsigned long int __shm_dtime_high; | |
| 34 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 35 | unsigned long int __shm_ctime_high; | |
| 36 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 37 | unsigned long int __glibc_reserved4; | |
| 38 | # else | |
| 39 | __time_t shm_atime;			/* time of last shmat() */ | |
| 40 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 41 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 42 | # endif | |
| 43 | size_t shm_segsz;			/* size of segment in bytes */ | |
| 44 | __pid_t shm_cpid;			/* pid of creator */ | |
| 45 | __pid_t shm_lpid;			/* pid of last shmop */ | |
| 46 | shmatt_t shm_nattch;		/* number of current attaches */ | |
| 47 | __syscall_ulong_t __glibc_reserved5; | |
| 48 | __syscall_ulong_t __glibc_reserved6; | |
| 49 | #endif | |
| 50 | }; | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/bits/wordsize.h created+11| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | /* Determine the wordsize from the preprocessor defines. */ | |
| 2 | ||
| 3 | #if defined __powerpc64__ | |
| 4 | # define __WORDSIZE	64 | |
| 5 | # define __WORDSIZE_TIME64_COMPAT32	1 | |
| 6 | #else | |
| 7 | # define __WORDSIZE	32 | |
| 8 | # define __WORDSIZE_TIME64_COMPAT32	0 | |
| 9 | # define __WORDSIZE32_SIZE_ULONG	0 | |
| 10 | # define __WORDSIZE32_PTRDIFF_LONG	0 | |
| 11 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/fpu_control.h created+114| ... | ... | @@ -0,0 +1,114 @@ |
| 1 | /* FPU control word definitions. PowerPC version. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _FPU_CONTROL_H | |
| 20 | #define _FPU_CONTROL_H | |
| 21 | ||
| 22 | #if defined __SPE__ || (defined __NO_FPRS__ && !defined _SOFT_FLOAT) | |
| 23 | # error "SPE/e500 is no longer supported" | |
| 24 | #endif | |
| 25 | ||
| 26 | #ifdef _SOFT_FLOAT | |
| 27 | ||
| 28 | # define _FPU_RESERVED 0xffffffff | |
| 29 | # define _FPU_DEFAULT 0x00000000 /* Default value. */ | |
| 30 | typedef unsigned int fpu_control_t; | |
| 31 | # define _FPU_GETCW(cw) (cw) = 0 | |
| 32 | # define _FPU_SETCW(cw) (void) (cw) | |
| 33 | extern fpu_control_t __fpu_control; | |
| 34 | ||
| 35 | #else /* PowerPC 6xx floating-point. */ | |
| 36 | ||
| 37 | /* rounding control */ | |
| 38 | # define _FPU_RC_NEAREST 0x00 /* RECOMMENDED */ | |
| 39 | # define _FPU_RC_DOWN 0x03 | |
| 40 | # define _FPU_RC_UP 0x02 | |
| 41 | # define _FPU_RC_ZERO 0x01 | |
| 42 | ||
| 43 | # define _FPU_MASK_RC (_FPU_RC_NEAREST|_FPU_RC_DOWN|_FPU_RC_UP|_FPU_RC_ZERO) | |
| 44 | ||
| 45 | # define _FPU_MASK_NI 0x04 /* non-ieee mode */ | |
| 46 | ||
| 47 | /* masking of interrupts */ | |
| 48 | # define _FPU_MASK_ZM 0x10 /* zero divide */ | |
| 49 | # define _FPU_MASK_OM 0x40 /* overflow */ | |
| 50 | # define _FPU_MASK_UM 0x20 /* underflow */ | |
| 51 | # define _FPU_MASK_XM 0x08 /* inexact */ | |
| 52 | # define _FPU_MASK_IM 0x80 /* invalid operation */ | |
| 53 | ||
| 54 | # define _FPU_RESERVED 0xffffff00 /* These bits are reserved are not changed. */ | |
| 55 | ||
| 56 | /* The fdlibm code requires no interrupts for exceptions. */ | |
| 57 | # define _FPU_DEFAULT 0x00000000 /* Default value. */ | |
| 58 | ||
| 59 | /* IEEE: same as above, but (some) exceptions; | |
| 60 | we leave the 'inexact' exception off. | |
| 61 | */ | |
| 62 | # define _FPU_IEEE 0x000000f0 | |
| 63 | ||
| 64 | /* Type of the control word. */ | |
| 65 | typedef unsigned int fpu_control_t; | |
| 66 | ||
| 67 | /* Macros for accessing the hardware control word. */ | |
| 68 | # define _FPU_GETCW(cw)						\ | |
| 69 | ({union { double __d; unsigned long long __ll; } __u;		\ | |
| 70 | __asm__ __volatile__("mffs %0" : "=f" (__u.__d));		\ | |
| 71 | (cw) = (fpu_control_t) __u.__ll;				\ | |
| 72 | (fpu_control_t) __u.__ll;					\ | |
| 73 | }) | |
| 74 | ||
| 75 | # define _FPU_GET_RC_ISA300()						\ | |
| 76 | ({union { double __d; unsigned long long __ll; } __u;			\ | |
| 77 | __asm__ __volatile__(						\ | |
| 78 | ".machine push; .machine \"power9\"; mffsl %0; .machine pop" 	\ | |
| 79 | : "=f" (__u.__d));						\ | |
| 80 | (fpu_control_t) (__u.__ll & _FPU_MASK_RC);				\ | |
| 81 | }) | |
| 82 | ||
| 83 | # ifdef _ARCH_PWR9 | |
| 84 | # define _FPU_GET_RC() _FPU_GET_RC_ISA300() | |
| 85 | # elif defined __BUILTIN_CPU_SUPPORTS__ | |
| 86 | # define _FPU_GET_RC()							\ | |
| 87 | ({fpu_control_t __rc;							\ | |
| 88 | __rc = __glibc_likely (__builtin_cpu_supports ("arch_3_00"))	\ | |
| 89 | ? _FPU_GET_RC_ISA300 ()						\ | |
| 90 | : _FPU_GETCW (__rc) & _FPU_MASK_RC;				\ | |
| 91 | __rc;								\ | |
| 92 | }) | |
| 93 | # else | |
| 94 | # define _FPU_GET_RC()						\ | |
| 95 | ({fpu_control_t __rc = _FPU_GETCW (__rc) & _FPU_MASK_RC;	\ | |
| 96 | __rc;							\ | |
| 97 | }) | |
| 98 | # endif | |
| 99 | ||
| 100 | # define _FPU_SETCW(cw)						\ | |
| 101 | { union { double __d; unsigned long long __ll; } __u;		\ | |
| 102 | register double __fr;					\ | |
| 103 | __u.__ll = 0xfff80000LL << 32; /* This is a QNaN. */	\ | |
| 104 | __u.__ll |= (cw) & 0xffffffffLL;				\ | |
| 105 | __fr = __u.__d;						\ | |
| 106 | __asm__ __volatile__("mtfsf 255,%0" : : "f" (__fr));	\ | |
| 107 | } | |
| 108 | ||
| 109 | /* Default control word set at startup. */ | |
| 110 | extern fpu_control_t __fpu_control; | |
| 111 | ||
| 112 | #endif /* PowerPC 6xx floating-point. */ | |
| 113 | ||
| 114 | #endif /* _FPU_CONTROL_H */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/gnu/lib-names-32.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* This file is automatically generated. */ | |
| 2 | #ifndef __GNU_LIB_NAMES_H | |
| 3 | # error "Never use <gnu/lib-names-32.h> directly; include <gnu/lib-names.h> instead." | |
| 4 | #endif | |
| 5 | ||
| 6 | #define LD_SO "ld.so.1" | |
| 7 | #define LIBANL_SO "libanl.so.1" | |
| 8 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" | |
| 9 | #define LIBCRYPT_SO "libcrypt.so.1" | |
| 10 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | #define LIBC_SO "libc.so.6" | |
| 12 | #define LIBDL_SO "libdl.so.2" | |
| 13 | #define LIBGCC_S_SO "libgcc_s.so.1" | |
| 14 | #define LIBMVEC_SO "libmvec.so.1" | |
| 15 | #define LIBM_SO "libm.so.6" | |
| 16 | #define LIBNSL_SO "libnsl.so.1" | |
| 17 | #define LIBNSS_COMPAT_SO "libnss_compat.so.2" | |
| 18 | #define LIBNSS_DB_SO "libnss_db.so.2" | |
| 19 | #define LIBNSS_DNS_SO "libnss_dns.so.2" | |
| 20 | #define LIBNSS_FILES_SO "libnss_files.so.2" | |
| 21 | #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" | |
| 22 | #define LIBNSS_LDAP_SO "libnss_ldap.so.2" | |
| 23 | #define LIBNSS_TEST1_SO "libnss_test1.so.2" | |
| 24 | #define LIBNSS_TEST2_SO "libnss_test2.so.2" | |
| 25 | #define LIBPTHREAD_SO "libpthread.so.0" | |
| 26 | #define LIBRESOLV_SO "libresolv.so.2" | |
| 27 | #define LIBRT_SO "librt.so.1" | |
| 28 | #define LIBTHREAD_DB_SO "libthread_db.so.1" | |
| 29 | #define LIBUTIL_SO "libutil.so.1" | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/gnu/lib-names.h created+19| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | /* This file is automatically generated. | |
| 2 | It defines macros to allow user program to find the shared | |
| 3 | library files which come as part of GNU libc. */ | |
| 4 | #ifndef __GNU_LIB_NAMES_H | |
| 5 | #define __GNU_LIB_NAMES_H	1 | |
| 6 | ||
| 7 | #include <bits/wordsize.h> | |
| 8 | ||
| 9 | #if __WORDSIZE == 32 | |
| 10 | # include <gnu/lib-names-32.h> | |
| 11 | #endif | |
| 12 | #if __WORDSIZE == 64 && _CALL_ELF != 2 | |
| 13 | # include <gnu/lib-names-64-v1.h> | |
| 14 | #endif | |
| 15 | #if __WORDSIZE == 64 && _CALL_ELF == 2 | |
| 16 | # include <gnu/lib-names-64-v2.h> | |
| 17 | #endif | |
| 18 | ||
| 19 | #endif	/* gnu/lib-names.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/gnu/stubs.h created+15| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | /* This file is automatically generated. | |
| 2 | This file selects the right generated file of `__stub_FUNCTION' macros | |
| 3 | based on the architecture being compiled for. */ | |
| 4 | ||
| 5 | #include <bits/wordsize.h> | |
| 6 | ||
| 7 | #if __WORDSIZE == 32 | |
| 8 | # include <gnu/stubs-32.h> | |
| 9 | #endif | |
| 10 | #if __WORDSIZE == 64 && _CALL_ELF != 2 | |
| 11 | # include <gnu/stubs-64-v1.h> | |
| 12 | #endif | |
| 13 | #if __WORDSIZE == 64 && _CALL_ELF == 2 | |
| 14 | # include <gnu/stubs-64-v2.h> | |
| 15 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/ieee754.h created+197| ... | ... | @@ -0,0 +1,197 @@ |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _IEEE754_H | |
| 19 | #define _IEEE754_H 1 | |
| 20 | ||
| 21 | #include <features.h> | |
| 22 | ||
| 23 | #include <bits/endian.h> | |
| 24 | #include <bits/floatn.h> | |
| 25 | ||
| 26 | __BEGIN_DECLS | |
| 27 | ||
| 28 | union ieee754_float | |
| 29 | { | |
| 30 | float f; | |
| 31 | ||
| 32 | /* This is the IEEE 754 single-precision format. */ | |
| 33 | struct | |
| 34 | { | |
| 35 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 36 | 	unsigned int negative:1; | |
| 37 | 	unsigned int exponent:8; | |
| 38 | 	unsigned int mantissa:23; | |
| 39 | #endif				/* Big endian. */ | |
| 40 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 41 | 	unsigned int mantissa:23; | |
| 42 | 	unsigned int exponent:8; | |
| 43 | 	unsigned int negative:1; | |
| 44 | #endif				/* Little endian. */ | |
| 45 | } ieee; | |
| 46 | ||
| 47 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 48 | struct | |
| 49 | { | |
| 50 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 51 | 	unsigned int negative:1; | |
| 52 | 	unsigned int exponent:8; | |
| 53 | 	unsigned int quiet_nan:1; | |
| 54 | 	unsigned int mantissa:22; | |
| 55 | #endif				/* Big endian. */ | |
| 56 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 57 | 	unsigned int mantissa:22; | |
| 58 | 	unsigned int quiet_nan:1; | |
| 59 | 	unsigned int exponent:8; | |
| 60 | 	unsigned int negative:1; | |
| 61 | #endif				/* Little endian. */ | |
| 62 | } ieee_nan; | |
| 63 | }; | |
| 64 | ||
| 65 | #define IEEE754_FLOAT_BIAS	0x7f /* Added to exponent. */ | |
| 66 | ||
| 67 | ||
| 68 | union ieee754_double | |
| 69 | { | |
| 70 | double d; | |
| 71 | ||
| 72 | /* This is the IEEE 754 double-precision format. */ | |
| 73 | struct | |
| 74 | { | |
| 75 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 76 | 	unsigned int negative:1; | |
| 77 | 	unsigned int exponent:11; | |
| 78 | 	/* Together these comprise the mantissa. */ | |
| 79 | 	unsigned int mantissa0:20; | |
| 80 | 	unsigned int mantissa1:32; | |
| 81 | #endif				/* Big endian. */ | |
| 82 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 83 | 	/* Together these comprise the mantissa. */ | |
| 84 | 	unsigned int mantissa1:32; | |
| 85 | 	unsigned int mantissa0:20; | |
| 86 | 	unsigned int exponent:11; | |
| 87 | 	unsigned int negative:1; | |
| 88 | #endif				/* Little endian. */ | |
| 89 | } ieee; | |
| 90 | ||
| 91 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 92 | struct | |
| 93 | { | |
| 94 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 95 | 	unsigned int negative:1; | |
| 96 | 	unsigned int exponent:11; | |
| 97 | 	unsigned int quiet_nan:1; | |
| 98 | 	/* Together these comprise the mantissa. */ | |
| 99 | 	unsigned int mantissa0:19; | |
| 100 | 	unsigned int mantissa1:32; | |
| 101 | #else | |
| 102 | 	/* Together these comprise the mantissa. */ | |
| 103 | 	unsigned int mantissa1:32; | |
| 104 | 	unsigned int mantissa0:19; | |
| 105 | 	unsigned int quiet_nan:1; | |
| 106 | 	unsigned int exponent:11; | |
| 107 | 	unsigned int negative:1; | |
| 108 | #endif | |
| 109 | } ieee_nan; | |
| 110 | }; | |
| 111 | ||
| 112 | #define IEEE754_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 113 | ||
| 114 | ||
| 115 | #if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 | |
| 116 | /* long double is IEEE 128 bit */ | |
| 117 | union ieee854_long_double | |
| 118 | { | |
| 119 | long double d; | |
| 120 | ||
| 121 | /* This is the IEEE 854 quad-precision format. */ | |
| 122 | struct | |
| 123 | { | |
| 124 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 125 | 	unsigned int negative:1; | |
| 126 | 	unsigned int exponent:15; | |
| 127 | 	/* Together these comprise the mantissa. */ | |
| 128 | 	unsigned int mantissa0:16; | |
| 129 | 	unsigned int mantissa1:32; | |
| 130 | 	unsigned int mantissa2:32; | |
| 131 | 	unsigned int mantissa3:32; | |
| 132 | #endif				/* Big endian. */ | |
| 133 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 134 | 	/* Together these comprise the mantissa. */ | |
| 135 | 	unsigned int mantissa3:32; | |
| 136 | 	unsigned int mantissa2:32; | |
| 137 | 	unsigned int mantissa1:32; | |
| 138 | 	unsigned int mantissa0:16; | |
| 139 | 	unsigned int exponent:15; | |
| 140 | 	unsigned int negative:1; | |
| 141 | #endif				/* Little endian. */ | |
| 142 | } ieee; | |
| 143 | ||
| 144 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 145 | struct | |
| 146 | { | |
| 147 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 148 | 	unsigned int negative:1; | |
| 149 | 	unsigned int exponent:15; | |
| 150 | 	unsigned int quiet_nan:1; | |
| 151 | 	/* Together these comprise the mantissa. */ | |
| 152 | 	unsigned int mantissa0:15; | |
| 153 | 	unsigned int mantissa1:32; | |
| 154 | 	unsigned int mantissa2:32; | |
| 155 | 	unsigned int mantissa3:32; | |
| 156 | #else | |
| 157 | 	/* Together these comprise the mantissa. */ | |
| 158 | 	unsigned int mantissa3:32; | |
| 159 | 	unsigned int mantissa2:32; | |
| 160 | 	unsigned int mantissa1:32; | |
| 161 | 	unsigned int mantissa0:15; | |
| 162 | 	unsigned int quiet_nan:1; | |
| 163 | 	unsigned int exponent:15; | |
| 164 | 	unsigned int negative:1; | |
| 165 | #endif | |
| 166 | } ieee_nan; | |
| 167 | }; | |
| 168 | ||
| 169 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ | |
| 170 | #endif | |
| 171 | ||
| 172 | ||
| 173 | #if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 || __GNUC_PREREQ (7, 0) | |
| 174 | /* IBM extended format for long double. | |
| 175 | ||
| 176 | Each long double is made up of two IEEE doubles. The value of the | |
| 177 | long double is the sum of the values of the two parts. The most | |
| 178 | significant part is required to be the value of the long double | |
| 179 | rounded to the nearest double, as specified by IEEE. For Inf | |
| 180 | values, the least significant part is required to be one of +0.0 or | |
| 181 | -0.0. No other requirements are made; so, for example, 1.0 may be | |
| 182 | represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a | |
| 183 | NaN is don't-care. */ | |
| 184 | union ibm_extended_long_double | |
| 185 | { | |
| 186 | # if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && __GNUC_PREREQ (7, 0) | |
| 187 | __ibm128 ld; | |
| 188 | # else | |
| 189 | long double ld; | |
| 190 | # endif | |
| 191 | union ieee754_double d[2]; | |
| 192 | }; | |
| 193 | #endif | |
| 194 | ||
| 195 | __END_DECLS | |
| 196 | ||
| 197 | #endif /* ieee754.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/sys/ptrace.h created+272| ... | ... | @@ -0,0 +1,272 @@ |
| 1 | /* `ptrace' debugger support interface. Linux/PowerPC version. | |
| 2 | Copyright (C) 2001-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_PTRACE_H | |
| 20 | #define _SYS_PTRACE_H	1 | |
| 21 | ||
| 22 | #include <features.h> | |
| 23 | #include <bits/types.h> | |
| 24 | ||
| 25 | __BEGIN_DECLS | |
| 26 | ||
| 27 | #if defined _LINUX_PTRACE_H || defined _ASM_POWERPC_PTRACE_H | |
| 28 | /* Do not let Linux headers macros interfere with enum __ptrace_request. */ | |
| 29 | # undef PTRACE_ATTACH | |
| 30 | # undef PTRACE_CONT | |
| 31 | # undef PTRACE_DETACH | |
| 32 | # undef PTRACE_GET_DEBUGREG | |
| 33 | # undef PTRACE_GETEVENTMSG | |
| 34 | # undef PTRACE_GETEVRREGS | |
| 35 | # undef PTRACE_GETFPREGS | |
| 36 | # undef PTRACE_GETREGS | |
| 37 | # undef PTRACE_GETREGS64 | |
| 38 | # undef PTRACE_GETREGSET | |
| 39 | # undef PTRACE_GETSIGINFO | |
| 40 | # undef PTRACE_GETSIGMASK | |
| 41 | # undef PTRACE_GET_SYSCALL_INFO | |
| 42 | # undef PTRACE_GETVRREGS | |
| 43 | # undef PTRACE_GETVSRREGS | |
| 44 | # undef PTRACE_INTERRUPT | |
| 45 | # undef PTRACE_KILL | |
| 46 | # undef PTRACE_LISTEN | |
| 47 | # undef PTRACE_PEEKDATA | |
| 48 | # undef PTRACE_PEEKSIGINFO | |
| 49 | # undef PTRACE_PEEKTEXT | |
| 50 | # undef PTRACE_POKEDATA | |
| 51 | # undef PTRACE_POKETEXT | |
| 52 | # undef PTRACE_SECCOMP_GET_FILTER | |
| 53 | # undef PTRACE_SECCOMP_GET_METADATA | |
| 54 | # undef PTRACE_SEIZE | |
| 55 | # undef PTRACE_SET_DEBUGREG | |
| 56 | # undef PTRACE_SETEVRREGS | |
| 57 | # undef PTRACE_SETFPREGS | |
| 58 | # undef PTRACE_SETOPTIONS | |
| 59 | # undef PTRACE_SETREGS | |
| 60 | # undef PTRACE_SETREGS64 | |
| 61 | # undef PTRACE_SETREGSET | |
| 62 | # undef PTRACE_SETSIGINFO | |
| 63 | # undef PTRACE_SETSIGMASK | |
| 64 | # undef PTRACE_SETVRREGS | |
| 65 | # undef PTRACE_SETVSRREGS | |
| 66 | # undef PTRACE_SINGLEBLOCK | |
| 67 | # undef PTRACE_SINGLESTEP | |
| 68 | # undef PTRACE_SYSCALL | |
| 69 | # undef PTRACE_SYSCALL_INFO_NONE | |
| 70 | # undef PTRACE_SYSCALL_INFO_ENTRY | |
| 71 | # undef PTRACE_SYSCALL_INFO_EXIT | |
| 72 | # undef PTRACE_SYSCALL_INFO_SECCOMP | |
| 73 | # undef PTRACE_SYSEMU | |
| 74 | # undef PTRACE_SYSEMU_SINGLESTEP | |
| 75 | # undef PTRACE_TRACEME | |
| 76 | #endif | |
| 77 | ||
| 78 | /* Type of the REQUEST argument to `ptrace.' */ | |
| 79 | enum __ptrace_request | |
| 80 | { | |
| 81 | /* Indicate that the process making this request should be traced. | |
| 82 | All signals received by this process can be intercepted by its | |
| 83 | parent, and its parent can use the other `ptrace' requests. */ | |
| 84 | PTRACE_TRACEME = 0, | |
| 85 | #define PT_TRACE_ME PTRACE_TRACEME | |
| 86 | ||
| 87 | /* Return the word in the process's text space at address ADDR. */ | |
| 88 | PTRACE_PEEKTEXT = 1, | |
| 89 | #define PT_READ_I PTRACE_PEEKTEXT | |
| 90 | ||
| 91 | /* Return the word in the process's data space at address ADDR. */ | |
| 92 | PTRACE_PEEKDATA = 2, | |
| 93 | #define PT_READ_D PTRACE_PEEKDATA | |
| 94 | ||
| 95 | /* Return the word in the process's user area at offset ADDR. */ | |
| 96 | PTRACE_PEEKUSER = 3, | |
| 97 | #define PT_READ_U PTRACE_PEEKUSER | |
| 98 | ||
| 99 | /* Write the word DATA into the process's text space at address ADDR. */ | |
| 100 | PTRACE_POKETEXT = 4, | |
| 101 | #define PT_WRITE_I PTRACE_POKETEXT | |
| 102 | ||
| 103 | /* Write the word DATA into the process's data space at address ADDR. */ | |
| 104 | PTRACE_POKEDATA = 5, | |
| 105 | #define PT_WRITE_D PTRACE_POKEDATA | |
| 106 | ||
| 107 | /* Write the word DATA into the process's user area at offset ADDR. */ | |
| 108 | PTRACE_POKEUSER = 6, | |
| 109 | #define PT_WRITE_U PTRACE_POKEUSER | |
| 110 | ||
| 111 | /* Continue the process. */ | |
| 112 | PTRACE_CONT = 7, | |
| 113 | #define PT_CONTINUE PTRACE_CONT | |
| 114 | ||
| 115 | /* Kill the process. */ | |
| 116 | PTRACE_KILL = 8, | |
| 117 | #define PT_KILL PTRACE_KILL | |
| 118 | ||
| 119 | /* Single step the process. */ | |
| 120 | PTRACE_SINGLESTEP = 9, | |
| 121 | #define PT_STEP PTRACE_SINGLESTEP | |
| 122 | ||
| 123 | /* Get all general purpose registers used by a process. */ | |
| 124 | PTRACE_GETREGS = 12, | |
| 125 | #define PT_GETREGS PTRACE_GETREGS | |
| 126 | ||
| 127 | /* Set all general purpose registers used by a process. */ | |
| 128 | PTRACE_SETREGS = 13, | |
| 129 | #define PT_SETREGS PTRACE_SETREGS | |
| 130 | ||
| 131 | /* Get all floating point registers used by a process. */ | |
| 132 | PTRACE_GETFPREGS = 14, | |
| 133 | #define PT_GETFPREGS PTRACE_GETFPREGS | |
| 134 | ||
| 135 | /* Set all floating point registers used by a process. */ | |
| 136 | PTRACE_SETFPREGS = 15, | |
| 137 | #define PT_SETFPREGS PTRACE_SETFPREGS | |
| 138 | ||
| 139 | /* Attach to a process that is already running. */ | |
| 140 | PTRACE_ATTACH = 16, | |
| 141 | #define PT_ATTACH PTRACE_ATTACH | |
| 142 | ||
| 143 | /* Detach from a process attached to with PTRACE_ATTACH. */ | |
| 144 | PTRACE_DETACH = 17, | |
| 145 | #define PT_DETACH PTRACE_DETACH | |
| 146 | ||
| 147 | /* Get all altivec registers used by a process. */ | |
| 148 | PTRACE_GETVRREGS = 18, | |
| 149 | #define PT_GETVRREGS PTRACE_GETVRREGS | |
| 150 | ||
| 151 | /* Set all altivec registers used by a process. */ | |
| 152 | PTRACE_SETVRREGS = 19, | |
| 153 | #define PT_SETVRREGS PTRACE_SETVRREGS | |
| 154 | ||
| 155 | /* Get all SPE registers used by a process. */ | |
| 156 | PTRACE_GETEVRREGS = 20, | |
| 157 | #define PT_GETEVRREGS PTRACE_GETEVRREGS | |
| 158 | ||
| 159 | /* Set all SPE registers used by a process. */ | |
| 160 | PTRACE_SETEVRREGS = 21, | |
| 161 | #define PT_SETEVRREGS PTRACE_SETEVRREGS | |
| 162 | ||
| 163 | /* Same as PTRACE_GETREGS except a 32-bit process will obtain | |
| 164 | the full 64-bit registers. Implemented by 64-bit kernels only. */ | |
| 165 | PTRACE_GETREGS64 = 22, | |
| 166 | #define PT_GETREGS64 PTRACE_GETREGS64 | |
| 167 | ||
| 168 | /* Same as PTRACE_SETREGS except a 32-bit process will set | |
| 169 | the full 64-bit registers. Implemented by 64-bit kernels only. */ | |
| 170 | PTRACE_SETREGS64 = 23, | |
| 171 | #define PT_SETREGS64 PTRACE_SETREGS64 | |
| 172 | ||
| 173 | /* Continue and stop at the next entry to or return from syscall. */ | |
| 174 | PTRACE_SYSCALL = 24, | |
| 175 | #define PT_SYSCALL PTRACE_SYSCALL | |
| 176 | ||
| 177 | /* Get a debug register of a process. */ | |
| 178 | PTRACE_GET_DEBUGREG = 25, | |
| 179 | #define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG | |
| 180 | ||
| 181 | /* Set a debug register of a process. */ | |
| 182 | PTRACE_SET_DEBUGREG = 26, | |
| 183 | #define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG | |
| 184 | ||
| 185 | /* Get the first 32 VSX registers of a process. */ | |
| 186 | PTRACE_GETVSRREGS = 27, | |
| 187 | #define PT_GETVSRREGS PTRACE_GETVSRREGS | |
| 188 | ||
| 189 | /* Set the first 32 VSX registers of a process. */ | |
| 190 | PTRACE_SETVSRREGS = 28, | |
| 191 | #define PT_SETVSRREGS PTRACE_SETVSRREGS | |
| 192 | ||
| 193 | /* Continue and stop at the next syscall, it will not be executed. */ | |
| 194 | PTRACE_SYSEMU = 29, | |
| 195 | #define PT_SYSEMU PTRACE_SYSEMU | |
| 196 | ||
| 197 | /* Single step the process, the next syscall will not be executed. */ | |
| 198 | PTRACE_SYSEMU_SINGLESTEP = 30, | |
| 199 | #define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP | |
| 200 | ||
| 201 | /* Execute process until next taken branch. */ | |
| 202 | PTRACE_SINGLEBLOCK = 256, | |
| 203 | #define PT_STEPBLOCK PTRACE_SINGLEBLOCK | |
| 204 | ||
| 205 | /* Set ptrace filter options. */ | |
| 206 | PTRACE_SETOPTIONS = 0x4200, | |
| 207 | #define PT_SETOPTIONS PTRACE_SETOPTIONS | |
| 208 | ||
| 209 | /* Get last ptrace message. */ | |
| 210 | PTRACE_GETEVENTMSG = 0x4201, | |
| 211 | #define PT_GETEVENTMSG PTRACE_GETEVENTMSG | |
| 212 | ||
| 213 | /* Get siginfo for process. */ | |
| 214 | PTRACE_GETSIGINFO = 0x4202, | |
| 215 | #define PT_GETSIGINFO PTRACE_GETSIGINFO | |
| 216 | ||
| 217 | /* Set new siginfo for process. */ | |
| 218 | PTRACE_SETSIGINFO = 0x4203, | |
| 219 | #define PT_SETSIGINFO PTRACE_SETSIGINFO | |
| 220 | ||
| 221 | /* Get register content. */ | |
| 222 | PTRACE_GETREGSET = 0x4204, | |
| 223 | #define PTRACE_GETREGSET PTRACE_GETREGSET | |
| 224 | ||
| 225 | /* Set register content. */ | |
| 226 | PTRACE_SETREGSET = 0x4205, | |
| 227 | #define PTRACE_SETREGSET PTRACE_SETREGSET | |
| 228 | ||
| 229 | /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect | |
| 230 | signal or group stop state. */ | |
| 231 | PTRACE_SEIZE = 0x4206, | |
| 232 | #define PTRACE_SEIZE PTRACE_SEIZE | |
| 233 | ||
| 234 | /* Trap seized tracee. */ | |
| 235 | PTRACE_INTERRUPT = 0x4207, | |
| 236 | #define PTRACE_INTERRUPT PTRACE_INTERRUPT | |
| 237 | ||
| 238 | /* Wait for next group event. */ | |
| 239 | PTRACE_LISTEN = 0x4208, | |
| 240 | #define PTRACE_LISTEN PTRACE_LISTEN | |
| 241 | ||
| 242 | /* Retrieve siginfo_t structures without removing signals from a queue. */ | |
| 243 | PTRACE_PEEKSIGINFO = 0x4209, | |
| 244 | #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO | |
| 245 | ||
| 246 | /* Get the mask of blocked signals. */ | |
| 247 | PTRACE_GETSIGMASK = 0x420a, | |
| 248 | #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK | |
| 249 | ||
| 250 | /* Change the mask of blocked signals. */ | |
| 251 | PTRACE_SETSIGMASK = 0x420b, | |
| 252 | #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK | |
| 253 | ||
| 254 | /* Get seccomp BPF filters. */ | |
| 255 | PTRACE_SECCOMP_GET_FILTER = 0x420c, | |
| 256 | #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER | |
| 257 | ||
| 258 | /* Get seccomp BPF filter metadata. */ | |
| 259 | PTRACE_SECCOMP_GET_METADATA = 0x420d, | |
| 260 | #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA | |
| 261 | ||
| 262 | /* Get information about system call. */ | |
| 263 | PTRACE_GET_SYSCALL_INFO = 0x420e | |
| 264 | #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO | |
| 265 | }; | |
| 266 | ||
| 267 | ||
| 268 | #include <bits/ptrace-shared.h> | |
| 269 | ||
| 270 | __END_DECLS | |
| 271 | ||
| 272 | #endif /* _SYS_PTRACE_H */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/sys/ucontext.h created+200| ... | ... | @@ -0,0 +1,200 @@ |
| 1 | /* Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_UCONTEXT_H | |
| 19 | #define _SYS_UCONTEXT_H	1 | |
| 20 | ||
| 21 | #include <features.h> | |
| 22 | ||
| 23 | #include <bits/types/sigset_t.h> | |
| 24 | #include <bits/types/stack_t.h> | |
| 25 | ||
| 26 | ||
| 27 | #ifdef __USE_MISC | |
| 28 | # define __ctx(fld) fld | |
| 29 | #else | |
| 30 | # define __ctx(fld) __ ## fld | |
| 31 | #endif | |
| 32 | ||
| 33 | struct __ctx(pt_regs); | |
| 34 | ||
| 35 | #if __WORDSIZE == 32 | |
| 36 | ||
| 37 | /* Number of general registers. */ | |
| 38 | # define __NGREG	48 | |
| 39 | # ifdef __USE_MISC | |
| 40 | # define NGREG	__NGREG | |
| 41 | # endif | |
| 42 | ||
| 43 | /* Container for all general registers. */ | |
| 44 | typedef unsigned long gregset_t[__NGREG]; | |
| 45 | ||
| 46 | /* Container for floating-point registers and status */ | |
| 47 | typedef struct _libc_fpstate | |
| 48 | { | |
| 49 | 	double __ctx(fpregs)[32]; | |
| 50 | 	double __ctx(fpscr); | |
| 51 | 	unsigned int _pad[2]; | |
| 52 | } fpregset_t; | |
| 53 | ||
| 54 | /* Container for Altivec/VMX registers and status. | |
| 55 | Needs to be aligned on a 16-byte boundary. */ | |
| 56 | typedef struct _libc_vrstate | |
| 57 | { | |
| 58 | 	unsigned int __ctx(vrregs)[32][4]; | |
| 59 | 	unsigned int __ctx(vrsave); | |
| 60 | 	unsigned int _pad[2]; | |
| 61 | 	unsigned int __ctx(vscr); | |
| 62 | } vrregset_t; | |
| 63 | ||
| 64 | /* Context to describe whole processor state. */ | |
| 65 | typedef struct | |
| 66 | { | |
| 67 | 	gregset_t __ctx(gregs); | |
| 68 | 	fpregset_t __ctx(fpregs); | |
| 69 | 	vrregset_t __ctx(vrregs) __attribute__((__aligned__(16))); | |
| 70 | } mcontext_t; | |
| 71 | ||
| 72 | #else | |
| 73 | ||
| 74 | /* For 64-bit kernels with Altivec support, a machine context is exactly | |
| 75 | * a sigcontext. For older kernel (without Altivec) the sigcontext matches | |
| 76 | * the mcontext upto but not including the v_regs field. For kernels that | |
| 77 | * don't set AT_HWCAP or return AT_HWCAP without PPC_FEATURE_HAS_ALTIVEC the | |
| 78 | * v_regs field may not exist and should not be referenced. The v_regs field | |
| 79 | * can be referenced safely only after verifying that PPC_FEATURE_HAS_ALTIVEC | |
| 80 | * is set in AT_HWCAP. */ | |
| 81 | ||
| 82 | /* Number of general registers. */ | |
| 83 | # define __NGREG	48	/* includes r0-r31, nip, msr, lr, etc. */ | |
| 84 | # define __NFPREG	33	/* includes fp0-fp31 &fpscr. */ | |
| 85 | # define __NVRREG	34	/* includes v0-v31, vscr, & vrsave in | |
| 86 | 				 split vectors */ | |
| 87 | # ifdef __USE_MISC | |
| 88 | # define NGREG	__NGREG | |
| 89 | # define NFPREG	__NFPREG | |
| 90 | # define NVRREG	__NVRREG | |
| 91 | # endif | |
| 92 | ||
| 93 | typedef unsigned long gregset_t[__NGREG]; | |
| 94 | typedef double fpregset_t[__NFPREG]; | |
| 95 | ||
| 96 | /* Container for Altivec/VMX Vector Status and Control Register. Only 32-bits | |
| 97 | but can only be copied to/from a 128-bit vector register. So we allocated | |
| 98 | a whole quadword speedup save/restore. */ | |
| 99 | typedef struct _libc_vscr | |
| 100 | { | |
| 101 | #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ | |
| 102 | 	unsigned int __pad[3]; | |
| 103 | 	unsigned int __ctx(vscr_word); | |
| 104 | #else | |
| 105 | 	unsigned int __ctx(vscr_word); | |
| 106 | 	unsigned int __pad[3]; | |
| 107 | #endif | |
| 108 | } vscr_t; | |
| 109 | ||
| 110 | /* Container for Altivec/VMX registers and status. | |
| 111 | Must to be aligned on a 16-byte boundary. */ | |
| 112 | typedef struct _libc_vrstate | |
| 113 | { | |
| 114 | 	unsigned int	__ctx(vrregs)[32][4]; | |
| 115 | 	vscr_t		__ctx(vscr); | |
| 116 | 	unsigned int	__ctx(vrsave); | |
| 117 | 	unsigned int	__pad[3]; | |
| 118 | } vrregset_t __attribute__((__aligned__(16))); | |
| 119 | ||
| 120 | typedef struct { | |
| 121 | 	unsigned long	__glibc_reserved[4]; | |
| 122 | 	int		__ctx(signal); | |
| 123 | 	int		__pad0; | |
| 124 | 	unsigned long	__ctx(handler); | |
| 125 | 	unsigned long	__ctx(oldmask); | |
| 126 | 	struct __ctx(pt_regs)	*__ctx(regs); | |
| 127 | 	gregset_t	__ctx(gp_regs); | |
| 128 | 	fpregset_t	__ctx(fp_regs); | |
| 129 | /* | |
| 130 | * To maintain compatibility with current implementations the sigcontext is | |
| 131 | * extended by appending a pointer (v_regs) to a quadword type (elf_vrreg_t) | |
| 132 | * followed by an unstructured (vmx_reserve) field of 69 doublewords. This | |
| 133 | * allows the array of vector registers to be quadword aligned independent of | |
| 134 | * the alignment of the containing sigcontext or ucontext. It is the | |
| 135 | * responsibility of the code setting the sigcontext to set this pointer to | |
| 136 | * either NULL (if this processor does not support the VMX feature) or the | |
| 137 | * address of the first quadword within the allocated (vmx_reserve) area. | |
| 138 | * | |
| 139 | * The pointer (v_regs) of vector type (elf_vrreg_t) is essentially | |
| 140 | * an array of 34 quadword entries. The entries with | |
| 141 | * indexes 0-31 contain the corresponding vector registers. The entry with | |
| 142 | * index 32 contains the vscr as the last word (offset 12) within the | |
| 143 | * quadword. This allows the vscr to be stored as either a quadword (since | |
| 144 | * it must be copied via a vector register to/from storage) or as a word. | |
| 145 | * The entry with index 33 contains the vrsave as the first word (offset 0) | |
| 146 | * within the quadword. | |
| 147 | */ | |
| 148 | 	vrregset_t	*__ctx(v_regs); | |
| 149 | 	long		__ctx(vmx_reserve)[__NVRREG+__NVRREG+1]; | |
| 150 | } mcontext_t; | |
| 151 | ||
| 152 | #endif | |
| 153 | ||
| 154 | /* Userlevel context. */ | |
| 155 | typedef struct ucontext_t | |
| 156 | { | |
| 157 | unsigned long int __ctx(uc_flags); | |
| 158 | struct ucontext_t *uc_link; | |
| 159 | stack_t uc_stack; | |
| 160 | #if __WORDSIZE == 32 | |
| 161 | /* | |
| 162 | * These fields are set up this way to maximize source and | |
| 163 | * binary compatibility with code written for the old | |
| 164 | * ucontext_t definition, which didn't include space for the | |
| 165 | * registers. | |
| 166 | * | |
| 167 | * Different versions of the kernel have stored the registers on | |
| 168 | * signal delivery at different offsets from the ucontext struct. | |
| 169 | * Programs should thus use the uc_mcontext.uc_regs pointer to | |
| 170 | * find where the registers are actually stored. The registers | |
| 171 | * will be stored within the ucontext_t struct but not necessarily | |
| 172 | * at a fixed address. As a side-effect, this lets us achieve | |
| 173 | * 16-byte alignment for the register storage space if the | |
| 174 | * Altivec registers are to be saved, without requiring 16-byte | |
| 175 | * alignment on the whole ucontext_t. | |
| 176 | * | |
| 177 | * The uc_mcontext.regs field is included for source compatibility | |
| 178 | * with programs written against the older ucontext_t definition, | |
| 179 | * and its name should therefore not change. The uc_pad field | |
| 180 | * is for binary compatibility with programs compiled against the | |
| 181 | * old ucontext_t; it ensures that uc_mcontext.regs and uc_sigmask | |
| 182 | * are at the same offset as previously. | |
| 183 | */ | |
| 184 | int __glibc_reserved1[7]; | |
| 185 | union __ctx(uc_regs_ptr) { | |
| 186 | struct __ctx(pt_regs) *__ctx(regs); | |
| 187 | mcontext_t *__ctx(uc_regs); | |
| 188 | } uc_mcontext; | |
| 189 | sigset_t uc_sigmask; | |
| 190 | /* last for extensibility */ | |
| 191 | char __ctx(uc_reg_space)[sizeof (mcontext_t) + 12]; | |
| 192 | #else /* 64-bit */ | |
| 193 | sigset_t uc_sigmask; | |
| 194 | mcontext_t uc_mcontext; /* last for extensibility */ | |
| 195 | #endif | |
| 196 | } ucontext_t; | |
| 197 | ||
| 198 | #undef __ctx | |
| 199 | ||
| 200 | #endif /* sys/ucontext.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabi/sys/user.h created+40| ... | ... | @@ -0,0 +1,40 @@ |
| 1 | /* Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_USER_H | |
| 19 | ||
| 20 | #define _SYS_USER_H	1 | |
| 21 | #include <stddef.h> | |
| 22 | #include <features.h> | |
| 23 | ||
| 24 | #include <asm/ptrace.h> | |
| 25 | ||
| 26 | struct user { | |
| 27 | 	struct pt_regs	regs;			/* entire machine state */ | |
| 28 | 	size_t		u_tsize;		/* text size (pages) */ | |
| 29 | 	size_t		u_dsize;		/* data size (pages) */ | |
| 30 | 	size_t		u_ssize;		/* stack size (pages) */ | |
| 31 | 	unsigned long	start_code;		/* text starting address */ | |
| 32 | 	unsigned long	start_data;		/* data starting address */ | |
| 33 | 	unsigned long	start_stack;		/* stack starting address */ | |
| 34 | 	long int	signal;			/* signal causing core dump */ | |
| 35 | 	struct regs *	u_ar0;			/* help gdb find registers */ | |
| 36 | 	unsigned long	magic;			/* identifies a core file */ | |
| 37 | 	char		u_comm[32];		/* user command name */ | |
| 38 | }; | |
| 39 | ||
| 40 | #endif /* sys/user.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/endianness.h created+16| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | #ifndef _BITS_ENDIANNESS_H | |
| 2 | #define _BITS_ENDIANNESS_H 1 | |
| 3 | ||
| 4 | #ifndef _BITS_ENDIAN_H | |
| 5 | # error "Never use <bits/endianness.h> directly; include <endian.h> instead." | |
| 6 | #endif | |
| 7 | ||
| 8 | /* PowerPC has selectable endianness. */ | |
| 9 | #if defined __BIG_ENDIAN__ || defined _BIG_ENDIAN | |
| 10 | # define __BYTE_ORDER __BIG_ENDIAN | |
| 11 | #endif | |
| 12 | #if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN | |
| 13 | # define __BYTE_ORDER __LITTLE_ENDIAN | |
| 14 | #endif | |
| 15 | ||
| 16 | #endif /* bits/endianness.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/environments.h created+96| ... | ... | @@ -0,0 +1,96 @@ |
| 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _UNISTD_H | |
| 19 | # error "Never include this file directly. Use <unistd.h> instead" | |
| 20 | #endif | |
| 21 | ||
| 22 | #include <bits/wordsize.h> | |
| 23 | ||
| 24 | /* This header should define the following symbols under the described | |
| 25 | situations. A value `1' means that the model is always supported, | |
| 26 | `-1' means it is never supported. Undefined means it cannot be | |
| 27 | statically decided. | |
| 28 | ||
| 29 | _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type | |
| 30 | _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type | |
| 31 | ||
| 32 | _POSIX_V7_LP64_OFF32	 64bit long and pointers and 32bit off_t type | |
| 33 | _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type | |
| 34 | ||
| 35 | The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, | |
| 36 | _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, | |
| 37 | _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were | |
| 38 | used in previous versions of the Unix standard and are available | |
| 39 | only for compatibility. | |
| 40 | */ | |
| 41 | ||
| 42 | #if __WORDSIZE == 64 | |
| 43 | ||
| 44 | /* Environments with 32-bit wide pointers are optionally provided. | |
| 45 | Therefore following macros aren't defined: | |
| 46 | # undef _POSIX_V7_ILP32_OFF32 | |
| 47 | # undef _POSIX_V7_ILP32_OFFBIG | |
| 48 | # undef _POSIX_V6_ILP32_OFF32 | |
| 49 | # undef _POSIX_V6_ILP32_OFFBIG | |
| 50 | # undef _XBS5_ILP32_OFF32 | |
| 51 | # undef _XBS5_ILP32_OFFBIG | |
| 52 | and users need to check at runtime. */ | |
| 53 | ||
| 54 | /* We also have no use (for now) for an environment with bigger pointers | |
| 55 | and offsets. */ | |
| 56 | # define _POSIX_V7_LPBIG_OFFBIG	-1 | |
| 57 | # define _POSIX_V6_LPBIG_OFFBIG	-1 | |
| 58 | # define _XBS5_LPBIG_OFFBIG	-1 | |
| 59 | ||
| 60 | /* By default we have 64-bit wide `long int', pointers and `off_t'. */ | |
| 61 | # define _POSIX_V7_LP64_OFF64	1 | |
| 62 | # define _POSIX_V6_LP64_OFF64	1 | |
| 63 | # define _XBS5_LP64_OFF64	1 | |
| 64 | ||
| 65 | #else /* __WORDSIZE == 32 */ | |
| 66 | ||
| 67 | /* By default we have 32-bit wide `int', `long int', pointers and `off_t' | |
| 68 | and all platforms support LFS. */ | |
| 69 | # define _POSIX_V7_ILP32_OFF32	1 | |
| 70 | # define _POSIX_V7_ILP32_OFFBIG	1 | |
| 71 | # define _POSIX_V6_ILP32_OFF32	1 | |
| 72 | # define _POSIX_V6_ILP32_OFFBIG	1 | |
| 73 | # define _XBS5_ILP32_OFF32	1 | |
| 74 | # define _XBS5_ILP32_OFFBIG	1 | |
| 75 | ||
| 76 | /* We optionally provide an environment with the above size but an 64-bit | |
| 77 | side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ | |
| 78 | ||
| 79 | /* Environments with 64-bit wide pointers can be provided, | |
| 80 | so these macros aren't defined: | |
| 81 | # undef _POSIX_V7_LP64_OFF64 | |
| 82 | # undef _POSIX_V7_LPBIG_OFFBIG | |
| 83 | # undef _POSIX_V6_LP64_OFF64 | |
| 84 | # undef _POSIX_V6_LPBIG_OFFBIG | |
| 85 | # undef _XBS5_LP64_OFF64 | |
| 86 | # undef _XBS5_LPBIG_OFFBIG | |
| 87 | and sysconf tests for it at runtime. */ | |
| 88 | ||
| 89 | #endif /* __WORDSIZE == 32 */ | |
| 90 | ||
| 91 | #define __ILP32_OFF32_CFLAGS	"-m32" | |
| 92 | #define __ILP32_OFFBIG_CFLAGS	"-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" | |
| 93 | #define __ILP32_OFF32_LDFLAGS	"-m32" | |
| 94 | #define __ILP32_OFFBIG_LDFLAGS	"-m32" | |
| 95 | #define __LP64_OFF64_CFLAGS	"-m64" | |
| 96 | #define __LP64_OFF64_LDFLAGS	"-m64" | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/fcntl.h created+62| ... | ... | @@ -0,0 +1,62 @@ |
| 1 | /* O_*, F_*, FD_* bit values for Linux/PowerPC. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef	_FCNTL_H | |
| 20 | # error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/wordsize.h> | |
| 24 | ||
| 25 | #define __O_DIRECTORY	 040000	/* Must be a directory.	 */ | |
| 26 | #define __O_NOFOLLOW	0100000	/* Do not follow links.	 */ | |
| 27 | #define __O_DIRECT	0400000	/* Direct disk access.	*/ | |
| 28 | ||
| 29 | #if __WORDSIZE == 64 | |
| 30 | /* Not necessary, files are always with 64bit off_t. */ | |
| 31 | # define __O_LARGEFILE 0 | |
| 32 | #else | |
| 33 | # define __O_LARGEFILE	0200000 | |
| 34 | #endif | |
| 35 | ||
| 36 | struct flock | |
| 37 | { | |
| 38 | short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.	*/ | |
| 39 | short int l_whence;	/* Where `l_start' is relative to (like `lseek'). */ | |
| 40 | #ifndef __USE_FILE_OFFSET64 | |
| 41 | __off_t l_start;	/* Offset where the lock begins. */ | |
| 42 | __off_t l_len;	/* Size of the locked area; zero means until EOF. */ | |
| 43 | #else | |
| 44 | __off64_t l_start;	/* Offset where the lock begins. */ | |
| 45 | __off64_t l_len;	/* Size of the locked area; zero means until EOF. */ | |
| 46 | #endif | |
| 47 | __pid_t l_pid;	/* Process holding the lock. */ | |
| 48 | }; | |
| 49 | ||
| 50 | #ifdef __USE_LARGEFILE64 | |
| 51 | struct flock64 | |
| 52 | { | |
| 53 | short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.	*/ | |
| 54 | short int l_whence;	/* Where `l_start' is relative to (like `lseek'). */ | |
| 55 | __off64_t l_start;	/* Offset where the lock begins. */ | |
| 56 | __off64_t l_len;	/* Size of the locked area; zero means until EOF. */ | |
| 57 | __pid_t l_pid;	/* Process holding the lock. */ | |
| 58 | }; | |
| 59 | #endif | |
| 60 | ||
| 61 | /* Include generic Linux declarations. */ | |
| 62 | #include <bits/fcntl-linux.h> | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/fenv.h created+180| ... | ... | @@ -0,0 +1,180 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _FENV_H | |
| 19 | # error "Never use <bits/fenv.h> directly; include <fenv.h> instead." | |
| 20 | #endif | |
| 21 | ||
| 22 | ||
| 23 | /* Define bits representing the exception. We use the bit positions of | |
| 24 | the appropriate bits in the FPSCR... */ | |
| 25 | enum | |
| 26 | { | |
| 27 | FE_INEXACT = | |
| 28 | #define FE_INEXACT	(1 << (31 - 6)) | |
| 29 | FE_INEXACT, | |
| 30 | FE_DIVBYZERO = | |
| 31 | #define FE_DIVBYZERO	(1 << (31 - 5)) | |
| 32 | FE_DIVBYZERO, | |
| 33 | FE_UNDERFLOW = | |
| 34 | #define FE_UNDERFLOW	(1 << (31 - 4)) | |
| 35 | FE_UNDERFLOW, | |
| 36 | FE_OVERFLOW = | |
| 37 | #define FE_OVERFLOW	(1 << (31 - 3)) | |
| 38 | FE_OVERFLOW, | |
| 39 | ||
| 40 | /* ... except for FE_INVALID, for which we use bit 31. FE_INVALID | |
| 41 | actually corresponds to bits 7 through 12 and 21 through 23 | |
| 42 | in the FPSCR, but we can't use that because the current draft | |
| 43 | says that it must be a power of 2. Instead we use bit 2 which | |
| 44 | is the summary bit for all the FE_INVALID exceptions, which | |
| 45 | kind of makes sense. */ | |
| 46 | FE_INVALID = | |
| 47 | #define FE_INVALID	(1 << (31 - 2)) | |
| 48 | FE_INVALID, | |
| 49 | ||
| 50 | #ifdef __USE_GNU | |
| 51 | /* Breakdown of the FE_INVALID bits. Setting FE_INVALID on an | |
| 52 | input to a routine is equivalent to setting all of these bits; | |
| 53 | FE_INVALID will be set on output from a routine iff one of | |
| 54 | these bits is set. Note, though, that you can't disable or | |
| 55 | enable these exceptions individually. */ | |
| 56 | ||
| 57 | /* Operation with a sNaN. */ | |
| 58 | FE_INVALID_SNAN = | |
| 59 | # define FE_INVALID_SNAN	(1 << (31 - 7)) | |
| 60 | FE_INVALID_SNAN, | |
| 61 | ||
| 62 | /* Inf - Inf */ | |
| 63 | FE_INVALID_ISI = | |
| 64 | # define FE_INVALID_ISI	(1 << (31 - 8)) | |
| 65 | FE_INVALID_ISI, | |
| 66 | ||
| 67 | /* Inf / Inf */ | |
| 68 | FE_INVALID_IDI = | |
| 69 | # define FE_INVALID_IDI	(1 << (31 - 9)) | |
| 70 | FE_INVALID_IDI, | |
| 71 | ||
| 72 | /* 0 / 0 */ | |
| 73 | FE_INVALID_ZDZ = | |
| 74 | # define FE_INVALID_ZDZ	(1 << (31 - 10)) | |
| 75 | FE_INVALID_ZDZ, | |
| 76 | ||
| 77 | /* Inf * 0 */ | |
| 78 | FE_INVALID_IMZ = | |
| 79 | # define FE_INVALID_IMZ	(1 << (31 - 11)) | |
| 80 | FE_INVALID_IMZ, | |
| 81 | ||
| 82 | /* Comparison with a NaN. */ | |
| 83 | FE_INVALID_COMPARE = | |
| 84 | # define FE_INVALID_COMPARE	(1 << (31 - 12)) | |
| 85 | FE_INVALID_COMPARE, | |
| 86 | ||
| 87 | /* Invalid operation flag for software (not set by hardware). */ | |
| 88 | /* Note that some chips don't have this implemented, presumably | |
| 89 | because no-one expected anyone to write software for them %-). */ | |
| 90 | FE_INVALID_SOFTWARE = | |
| 91 | # define FE_INVALID_SOFTWARE	(1 << (31 - 21)) | |
| 92 | FE_INVALID_SOFTWARE, | |
| 93 | ||
| 94 | /* Square root of negative number (including -Inf). */ | |
| 95 | /* Note that some chips don't have this implemented. */ | |
| 96 | FE_INVALID_SQRT = | |
| 97 | # define FE_INVALID_SQRT	(1 << (31 - 22)) | |
| 98 | FE_INVALID_SQRT, | |
| 99 | ||
| 100 | /* Conversion-to-integer of a NaN or a number too large or too small. */ | |
| 101 | FE_INVALID_INTEGER_CONVERSION = | |
| 102 | # define FE_INVALID_INTEGER_CONVERSION	(1 << (31 - 23)) | |
| 103 | FE_INVALID_INTEGER_CONVERSION | |
| 104 | ||
| 105 | # define FE_ALL_INVALID \ | |
| 106 | (FE_INVALID_SNAN | FE_INVALID_ISI | FE_INVALID_IDI | FE_INVALID_ZDZ \ | |
| 107 | 	 | FE_INVALID_IMZ | FE_INVALID_COMPARE | FE_INVALID_SOFTWARE \ | |
| 108 | 	 | FE_INVALID_SQRT | FE_INVALID_INTEGER_CONVERSION) | |
| 109 | #endif | |
| 110 | }; | |
| 111 | ||
| 112 | #define FE_ALL_EXCEPT \ | |
| 113 | 	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) | |
| 114 | ||
| 115 | /* PowerPC chips support all of the four defined rounding modes. We | |
| 116 | use the bit pattern in the FPSCR as the values for the | |
| 117 | appropriate macros. */ | |
| 118 | enum | |
| 119 | { | |
| 120 | FE_TONEAREST = | |
| 121 | #define FE_TONEAREST	0 | |
| 122 | FE_TONEAREST, | |
| 123 | FE_TOWARDZERO = | |
| 124 | #define FE_TOWARDZERO	1 | |
| 125 | FE_TOWARDZERO, | |
| 126 | FE_UPWARD = | |
| 127 | #define FE_UPWARD	2 | |
| 128 | FE_UPWARD, | |
| 129 | FE_DOWNWARD = | |
| 130 | #define FE_DOWNWARD	3 | |
| 131 | FE_DOWNWARD | |
| 132 | }; | |
| 133 | ||
| 134 | /* Type representing exception flags. */ | |
| 135 | typedef unsigned int fexcept_t; | |
| 136 | ||
| 137 | /* Type representing floating-point environment. We leave it as 'double' | |
| 138 | for efficiency reasons (rather than writing it to a 32-bit integer). */ | |
| 139 | typedef double fenv_t; | |
| 140 | ||
| 141 | /* If the default argument is used we use this value. */ | |
| 142 | extern const fenv_t __fe_dfl_env; | |
| 143 | #define FE_DFL_ENV	(&__fe_dfl_env) | |
| 144 | ||
| 145 | #ifdef __USE_GNU | |
| 146 | /* Floating-point environment where all exceptions are enabled. Note that | |
| 147 | this is not sufficient to give you SIGFPE. */ | |
| 148 | extern const fenv_t __fe_enabled_env; | |
| 149 | # define FE_ENABLED_ENV	(&__fe_enabled_env) | |
| 150 | ||
| 151 | /* Floating-point environment with (processor-dependent) non-IEEE floating | |
| 152 | point. */ | |
| 153 | extern const fenv_t __fe_nonieee_env; | |
| 154 | # define FE_NONIEEE_ENV	(&__fe_nonieee_env) | |
| 155 | ||
| 156 | /* Floating-point environment with all exceptions enabled. Note that | |
| 157 | just evaluating this value does not change the processor exception mode. | |
| 158 | Passing this mask to fesetenv will result in a prctl syscall to change | |
| 159 | the MSR FE0/FE1 bits to "Precise Mode". On some processors this will | |
| 160 | result in slower floating point execution. This will last until an | |
| 161 | fenv or exception mask is installed that disables all FP exceptions. */ | |
| 162 | # define FE_NOMASK_ENV	FE_ENABLED_ENV | |
| 163 | ||
| 164 | /* Floating-point environment with all exceptions disabled. Note that | |
| 165 | just evaluating this value does not change the processor exception mode. | |
| 166 | Passing this mask to fesetenv will result in a prctl syscall to change | |
| 167 | the MSR FE0/FE1 bits to "Ignore Exceptions Mode". On most processors | |
| 168 | this allows the fastest possible floating point execution.*/ | |
| 169 | # define FE_MASK_ENV	FE_DFL_ENV | |
| 170 | ||
| 171 | #endif | |
| 172 | ||
| 173 | #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) | |
| 174 | /* Type representing floating-point control modes. */ | |
| 175 | typedef double femode_t; | |
| 176 | ||
| 177 | /* Default floating-point control modes. */ | |
| 178 | extern const femode_t __fe_dfl_mode; | |
| 179 | # define FE_DFL_MODE	(&__fe_dfl_mode) | |
| 180 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/floatn.h created+122| ... | ... | @@ -0,0 +1,122 @@ |
| 1 | /* Macros to control TS 18661-3 glibc features on powerpc. | |
| 2 | Copyright (C) 2017-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_FLOATN_H | |
| 20 | #define _BITS_FLOATN_H | |
| 21 | ||
| 22 | #include <features.h> | |
| 23 | #include <bits/long-double.h> | |
| 24 | ||
| 25 | /* Defined to 1 if the current compiler invocation provides a | |
| 26 | floating-point type with the IEEE 754 binary128 format, and this glibc | |
| 27 | includes corresponding *f128 interfaces for it. */ | |
| 28 | #if defined _ARCH_PWR8 && defined __LITTLE_ENDIAN__ && (_CALL_ELF == 2) \ | |
| 29 | && defined __FLOAT128__ && !defined __NO_LONG_DOUBLE_MATH | |
| 30 | # define __HAVE_FLOAT128 1 | |
| 31 | #else | |
| 32 | # define __HAVE_FLOAT128 0 | |
| 33 | #endif | |
| 34 | ||
| 35 | /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct | |
| 36 | from the default float, double and long double types in this glibc, i.e. | |
| 37 | calls to the binary128 functions go to *f128 symbols instead of *l. */ | |
| 38 | #if __HAVE_FLOAT128 | |
| 39 | # define __HAVE_DISTINCT_FLOAT128 1 | |
| 40 | #else | |
| 41 | # define __HAVE_DISTINCT_FLOAT128 0 | |
| 42 | #endif | |
| 43 | ||
| 44 | /* Defined to 1 if the current compiler invocation provides a | |
| 45 | floating-point type with the right format for _Float64x, and this | |
| 46 | glibc includes corresponding *f64x interfaces for it. */ | |
| 47 | #define __HAVE_FLOAT64X __HAVE_FLOAT128 | |
| 48 | ||
| 49 | /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format | |
| 50 | of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has | |
| 51 | the format of _Float128, which must be different from that of long | |
| 52 | double. */ | |
| 53 | #define __HAVE_FLOAT64X_LONG_DOUBLE 0 | |
| 54 | ||
| 55 | #ifndef __ASSEMBLER__ | |
| 56 | ||
| 57 | /* Defined to concatenate the literal suffix to be used with _Float128 | |
| 58 | types, if __HAVE_FLOAT128 is 1. */ | |
| 59 | # if __HAVE_FLOAT128 | |
| 60 | # if !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 61 | /* The literal suffix (f128) exist for powerpc only since GCC 7.0. */ | |
| 62 | # if __LDBL_MANT_DIG__ == 113 | |
| 63 | # define __f128(x) x##l | |
| 64 | # else | |
| 65 | # define __f128(x) x##q | |
| 66 | # endif | |
| 67 | # else | |
| 68 | # define __f128(x) x##f128 | |
| 69 | # endif | |
| 70 | # endif | |
| 71 | ||
| 72 | /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ | |
| 73 | # if __HAVE_FLOAT128 | |
| 74 | # if __LDBL_MANT_DIG__ == 113 && defined __cplusplus | |
| 75 | typedef long double _Float128; | |
| 76 | # define __CFLOAT128 _Complex long double | |
| 77 | # elif !__GNUC_PREREQ (7, 0) || defined __cplusplus | |
| 78 | /* The type _Float128 exist for powerpc only since GCC 7.0. */ | |
| 79 | typedef __float128 _Float128; | |
| 80 | /* Add a typedef for older GCC and C++ compilers which don't natively support | |
| 81 | _Complex _Float128. */ | |
| 82 | typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__KC__))); | |
| 83 | # define __CFLOAT128 __cfloat128 | |
| 84 | # else | |
| 85 | # define __CFLOAT128 _Complex _Float128 | |
| 86 | # endif | |
| 87 | # endif | |
| 88 | ||
| 89 | /* The remaining of this file provides support for older compilers. */ | |
| 90 | # if __HAVE_FLOAT128 | |
| 91 | /* Builtin __builtin_huge_valf128 doesn't exist before GCC 7.0. */ | |
| 92 | # if !__GNUC_PREREQ (7, 0) | |
| 93 | # define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ()) | |
| 94 | # endif | |
| 95 | ||
| 96 | /* The following builtins (suffixed with 'q') are available in GCC >= 6.2, | |
| 97 | which is the minimum version required for float128 support on powerpc64le. | |
| 98 | Since GCC 7.0 the builtins suffixed with f128 are also available, then | |
| 99 | there is no need to redefined them. */ | |
| 100 | # if !__GNUC_PREREQ (7, 0) | |
| 101 | # define __builtin_copysignf128 __builtin_copysignq | |
| 102 | # define __builtin_fabsf128 __builtin_fabsq | |
| 103 | # define __builtin_inff128 __builtin_infq | |
| 104 | # define __builtin_nanf128 __builtin_nanq | |
| 105 | # define __builtin_nansf128 __builtin_nansq | |
| 106 | # endif | |
| 107 | ||
| 108 | /* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*, | |
| 109 | e.g.: __builtin_signbitf128, before GCC 6. However, there has never | |
| 110 | been a __builtin_signbitf128 in GCC and the type-generic builtin is | |
| 111 | only available since GCC 6. */ | |
| 112 | # if !__GNUC_PREREQ (6, 0) | |
| 113 | # define __builtin_signbitf128 __signbitf128 | |
| 114 | # endif | |
| 115 | ||
| 116 | # endif | |
| 117 | ||
| 118 | #endif /* !__ASSEMBLER__. */ | |
| 119 | ||
| 120 | #include <bits/floatn-common.h> | |
| 121 | ||
| 122 | #endif /* _BITS_FLOATN_H */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/fp-fast.h created+39| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | /* Define FP_FAST_* macros. PowerPC version. | |
| 2 | Copyright (C) 2016-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _MATH_H | |
| 20 | # error "Never use <bits/fp-fast.h> directly; include <math.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifdef __USE_ISOC99 | |
| 24 | ||
| 25 | /* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l} | |
| 26 | builtins are supported. */ | |
| 27 | # if (!defined _SOFT_FLOAT && !defined __NO_FPRS__) || defined __FP_FAST_FMA | |
| 28 | # define FP_FAST_FMA 1 | |
| 29 | # endif | |
| 30 | ||
| 31 | # if (!defined _SOFT_FLOAT && !defined __NO_FPRS__) || defined __FP_FAST_FMAF | |
| 32 | # define FP_FAST_FMAF 1 | |
| 33 | # endif | |
| 34 | ||
| 35 | # ifdef __FP_FAST_FMAL | |
| 36 | # define FP_FAST_FMAL 1 | |
| 37 | # endif | |
| 38 | ||
| 39 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/hwcap.h created+78| ... | ... | @@ -0,0 +1,78 @@ |
| 1 | /* Defines for bits in AT_HWCAP and AT_HWCAP2. | |
| 2 | Copyright (C) 2012-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #if !defined(_SYS_AUXV_H) && !defined(_SYSDEPS_SYSDEP_H) | |
| 20 | # error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The bit numbers must match those in the kernel's asm/cputable.h. */ | |
| 24 | ||
| 25 | /* Feature definitions in AT_HWCAP. */ | |
| 26 | #define PPC_FEATURE_32		 0x80000000 /* 32-bit mode. */ | |
| 27 | #define PPC_FEATURE_64		 0x40000000 /* 64-bit mode. */ | |
| 28 | #define PPC_FEATURE_601_INSTR	 0x20000000 /* 601 chip, Old POWER ISA. */ | |
| 29 | #define PPC_FEATURE_HAS_ALTIVEC	 0x10000000 /* SIMD/Vector Unit. */ | |
| 30 | #define PPC_FEATURE_HAS_FPU	 0x08000000 /* Floating Point Unit. */ | |
| 31 | #define PPC_FEATURE_HAS_MMU	 0x04000000 /* Memory Management Unit. */ | |
| 32 | #define PPC_FEATURE_HAS_4xxMAC	 0x02000000 /* 4xx Multiply Accumulator. */ | |
| 33 | #define PPC_FEATURE_UNIFIED_CACHE 0x01000000 /* Unified I/D cache. */ | |
| 34 | #define PPC_FEATURE_HAS_SPE	 0x00800000 /* Signal Processing ext. */ | |
| 35 | #define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000 /* SPE Float. */ | |
| 36 | #define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 /* SPE Double. */ | |
| 37 | #define PPC_FEATURE_NO_TB	 0x00100000 /* 601/403gx have no timebase */ | |
| 38 | #define PPC_FEATURE_POWER4	 0x00080000 /* POWER4 ISA 2.00 */ | |
| 39 | #define PPC_FEATURE_POWER5	 0x00040000 /* POWER5 ISA 2.02 */ | |
| 40 | #define PPC_FEATURE_POWER5_PLUS	 0x00020000 /* POWER5+ ISA 2.03 */ | |
| 41 | #define PPC_FEATURE_CELL_BE	 0x00010000 /* CELL Broadband Engine */ | |
| 42 | #define PPC_FEATURE_BOOKE	 0x00008000 /* ISA Category Embedded */ | |
| 43 | #define PPC_FEATURE_SMT		 0x00004000 /* Simultaneous | |
| 44 | 						 Multi-Threading */ | |
| 45 | #define PPC_FEATURE_ICACHE_SNOOP 0x00002000 | |
| 46 | #define PPC_FEATURE_ARCH_2_05	 0x00001000 /* ISA 2.05 */ | |
| 47 | #define PPC_FEATURE_PA6T	 0x00000800 /* PA Semi 6T Core */ | |
| 48 | #define PPC_FEATURE_HAS_DFP	 0x00000400 /* Decimal FP Unit */ | |
| 49 | #define PPC_FEATURE_POWER6_EXT	 0x00000200 /* P6 + mffgpr/mftgpr */ | |
| 50 | #define PPC_FEATURE_ARCH_2_06	 0x00000100 /* ISA 2.06 */ | |
| 51 | #define PPC_FEATURE_HAS_VSX	 0x00000080 /* P7 Vector Extension. */ | |
| 52 | #define PPC_FEATURE_PSERIES_PERFMON_COMPAT 0x00000040 | |
| 53 | /* Reserved by the kernel.	 0x00000004 Do not use. */ | |
| 54 | #define PPC_FEATURE_TRUE_LE	 0x00000002 | |
| 55 | #define PPC_FEATURE_PPC_LE	 0x00000001 | |
| 56 | ||
| 57 | /* Feature definitions in AT_HWCAP2. */ | |
| 58 | #define PPC_FEATURE2_ARCH_2_07 0x80000000 /* ISA 2.07 */ | |
| 59 | #define PPC_FEATURE2_HAS_HTM 0x40000000 /* Hardware Transactional | |
| 60 | 						 Memory */ | |
| 61 | #define PPC_FEATURE2_HAS_DSCR 0x20000000 /* Data Stream Control | |
| 62 | 						 Register */ | |
| 63 | #define PPC_FEATURE2_HAS_EBB 0x10000000 /* Event Base Branching */ | |
| 64 | #define PPC_FEATURE2_HAS_ISEL 0x08000000 /* Integer Select */ | |
| 65 | #define PPC_FEATURE2_HAS_TAR 0x04000000 /* Target Address Register */ | |
| 66 | #define PPC_FEATURE2_HAS_VEC_CRYPTO 0x02000000 /* Target supports vector | |
| 67 | 						 instruction. */ | |
| 68 | #define PPC_FEATURE2_HTM_NOSC	 0x01000000 /* Kernel aborts transaction | |
| 69 | 						 when a syscall is made. */ | |
| 70 | #define PPC_FEATURE2_ARCH_3_00	 0x00800000 /* ISA 3.0 */ | |
| 71 | #define PPC_FEATURE2_HAS_IEEE128 0x00400000 /* VSX IEEE Binary Float | |
| 72 | 						 128-bit */ | |
| 73 | #define PPC_FEATURE2_DARN	 0x00200000 /* darn instruction. */ | |
| 74 | #define PPC_FEATURE2_SCV	 0x00100000 /* scv syscall. */ | |
| 75 | #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM without suspended | |
| 76 | 						 state. */ | |
| 77 | #define PPC_FEATURE2_ARCH_3_1	 0x00040000 /* ISA 3.1. */ | |
| 78 | #define PPC_FEATURE2_MMA	 0x00020000 /* Matrix-Multiply Assist. */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/ioctl-types.h created+77| ... | ... | @@ -0,0 +1,77 @@ |
| 1 | /* Structure types for pre-termios terminal ioctls. Linux/powerpc version. | |
| 2 | Copyright (C) 2014-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_IOCTL_H | |
| 20 | # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Get definition of constants for use with `ioctl'. */ | |
| 24 | #include <asm/ioctls.h> | |
| 25 | ||
| 26 | ||
| 27 | struct winsize | |
| 28 | { | |
| 29 | unsigned short int ws_row; | |
| 30 | unsigned short int ws_col; | |
| 31 | unsigned short int ws_xpixel; | |
| 32 | unsigned short int ws_ypixel; | |
| 33 | }; | |
| 34 | ||
| 35 | #define NCC 10 | |
| 36 | struct termio | |
| 37 | { | |
| 38 | unsigned short int c_iflag;		/* input mode flags */ | |
| 39 | unsigned short int c_oflag;		/* output mode flags */ | |
| 40 | unsigned short int c_cflag;		/* control mode flags */ | |
| 41 | unsigned short int c_lflag;		/* local mode flags */ | |
| 42 | unsigned char c_line;		/* line discipline */ | |
| 43 | unsigned char c_cc[NCC];		/* control characters */ | |
| 44 | }; | |
| 45 | ||
| 46 | /* modem lines */ | |
| 47 | #define TIOCM_LE	0x001 | |
| 48 | #define TIOCM_DTR	0x002 | |
| 49 | #define TIOCM_RTS	0x004 | |
| 50 | #define TIOCM_ST	0x008 | |
| 51 | #define TIOCM_SR	0x010 | |
| 52 | #define TIOCM_CTS	0x020 | |
| 53 | #define TIOCM_CAR	0x040 | |
| 54 | #define TIOCM_RNG	0x080 | |
| 55 | #define TIOCM_DSR	0x100 | |
| 56 | #define TIOCM_CD	TIOCM_CAR | |
| 57 | #define TIOCM_RI	TIOCM_RNG | |
| 58 | ||
| 59 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | |
| 60 | ||
| 61 | /* line disciplines */ | |
| 62 | #define N_TTY		0 | |
| 63 | #define N_SLIP		1 | |
| 64 | #define N_MOUSE		2 | |
| 65 | #define N_PPP		3 | |
| 66 | #define N_STRIP		4 | |
| 67 | #define N_AX25		5 | |
| 68 | #define N_X25		6	/* X.25 async */ | |
| 69 | #define N_6PACK		7 | |
| 70 | #define N_MASC		8	/* Mobitex module */ | |
| 71 | #define N_R3964		9	/* Simatic R3964 module */ | |
| 72 | #define N_PROFIBUS_FDL	10	/* Profibus */ | |
| 73 | #define N_IRDA		11	/* Linux IR */ | |
| 74 | #define N_SMSBLOCK	12	/* SMS block mode */ | |
| 75 | #define N_HDLC		13	/* synchronous HDLC */ | |
| 76 | #define N_SYNC_PPP	14	/* synchronous PPP */ | |
| 77 | #define	N_HCI		15	/* Bluetooth HCI UART */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/ipc-perm.h created+36| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | /* struct ipc_perm definition. Linux/powerpc version. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_IPC_H | |
| 20 | # error "Never use <bits/ipc-perm.h> directly; include <sys/ipc.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure used to pass permission information to IPC operations. */ | |
| 24 | struct ipc_perm | |
| 25 | { | |
| 26 | __key_t __key;		/* Key. */ | |
| 27 | __uid_t uid;		/* Owner's user ID. */ | |
| 28 | __gid_t gid;		/* Owner's group ID. */ | |
| 29 | __uid_t cuid;		/* Creator's user ID. */ | |
| 30 | __gid_t cgid;		/* Creator's group ID. */ | |
| 31 | __mode_t mode;		/* Read/write permission. */ | |
| 32 | __uint32_t __seq;		/* Sequence number. */ | |
| 33 | __uint32_t __pad1; | |
| 34 | __uint64_t __glibc_reserved1; | |
| 35 | __uint64_t __glibc_reserved2; | |
| 36 | }; | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/iscanonical.h created+58| ... | ... | @@ -0,0 +1,58 @@ |
| 1 | /* Define iscanonical macro. ldbl-128ibm version. | |
| 2 | Copyright (C) 2016-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _MATH_H | |
| 20 | # error "Never use <bits/iscanonical.h> directly; include <math.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #if defined (__NO_LONG_DOUBLE_MATH) || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 | |
| 24 | # define iscanonical(x) ((void) (__typeof (x)) (x), 1) | |
| 25 | #else | |
| 26 | extern int __iscanonicall (long double __x) | |
| 27 | __THROW __attribute__ ((__const__)); | |
| 28 | # define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1) | |
| 29 | # define __iscanonical(x) ((void) (__typeof (x)) (x), 1) | |
| 30 | # if __HAVE_DISTINCT_FLOAT128 | |
| 31 | # define __iscanonicalf128(x) ((void) (__typeof (x)) (x), 1) | |
| 32 | # endif | |
| 33 | ||
| 34 | /* Return nonzero value if X is canonical. In IEEE interchange binary | |
| 35 | formats, all values are canonical, but the argument must still be | |
| 36 | converted to its semantic type for any exceptions arising from the | |
| 37 | conversion, before being discarded; in IBM long double, there are | |
| 38 | encodings that are not consistently handled as corresponding to any | |
| 39 | particular value of the type, and we return 0 for those. */ | |
| 40 | # ifndef __cplusplus | |
| 41 | # define iscanonical(x) __MATH_TG ((x), __iscanonical, (x)) | |
| 42 | # else | |
| 43 | /* In C++ mode, __MATH_TG cannot be used, because it relies on | |
| 44 | __builtin_types_compatible_p, which is a C-only builtin. On the | |
| 45 | other hand, overloading provides the means to distinguish between | |
| 46 | the floating-point types. The overloading resolution will match | |
| 47 | the correct parameter (regardless of type qualifiers (i.e.: const | |
| 48 | and volatile)). */ | |
| 49 | extern "C++" { | |
| 50 | inline int iscanonical (float __val) { return __iscanonicalf (__val); } | |
| 51 | inline int iscanonical (double __val) { return __iscanonical (__val); } | |
| 52 | inline int iscanonical (long double __val) { return __iscanonicall (__val); } | |
| 53 | # if __HAVE_DISTINCT_FLOAT128 | |
| 54 | inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); } | |
| 55 | # endif | |
| 56 | } | |
| 57 | # endif /* __cplusplus */ | |
| 58 | #endif /* __NO_LONG_DOUBLE_MATH */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/link.h created+156| ... | ... | @@ -0,0 +1,156 @@ |
| 1 | /* Machine-specific declarations for dynamic linker interface. PowerPC version | |
| 2 | Copyright (C) 2004-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef	_LINK_H | |
| 20 | # error "Never include <bits/link.h> directly; use <link.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | ||
| 24 | #if __ELF_NATIVE_CLASS == 32 | |
| 25 | ||
| 26 | /* Registers for entry into PLT on PPC32. */ | |
| 27 | typedef struct La_ppc32_regs | |
| 28 | { | |
| 29 | uint32_t lr_reg[8]; | |
| 30 | double lr_fp[8]; | |
| 31 | uint32_t lr_vreg[12][4]; | |
| 32 | uint32_t lr_r1; | |
| 33 | uint32_t lr_lr; | |
| 34 | } La_ppc32_regs; | |
| 35 | ||
| 36 | /* Return values for calls from PLT on PPC32. */ | |
| 37 | typedef struct La_ppc32_retval | |
| 38 | { | |
| 39 | uint32_t lrv_r3; | |
| 40 | uint32_t lrv_r4; | |
| 41 | double lrv_fp[8]; | |
| 42 | uint32_t lrv_v2[4]; | |
| 43 | } La_ppc32_retval; | |
| 44 | ||
| 45 | ||
| 46 | __BEGIN_DECLS | |
| 47 | ||
| 48 | extern Elf32_Addr la_ppc32_gnu_pltenter (Elf32_Sym *__sym, | |
| 49 | 					 unsigned int __ndx, | |
| 50 | 					 uintptr_t *__refcook, | |
| 51 | 					 uintptr_t *__defcook, | |
| 52 | 					 La_ppc32_regs *__regs, | |
| 53 | 					 unsigned int *__flags, | |
| 54 | 					 const char *__symname, | |
| 55 | 					 long int *__framesizep); | |
| 56 | extern unsigned int la_ppc32_gnu_pltexit (Elf32_Sym *__sym, | |
| 57 | 					 unsigned int __ndx, | |
| 58 | 					 uintptr_t *__refcook, | |
| 59 | 					 uintptr_t *__defcook, | |
| 60 | 					 const La_ppc32_regs *__inregs, | |
| 61 | 					 La_ppc32_retval *__outregs, | |
| 62 | 					 const char *__symname); | |
| 63 | ||
| 64 | __END_DECLS | |
| 65 | ||
| 66 | #elif __ELF_NATIVE_CLASS == 64 | |
| 67 | # if _CALL_ELF != 2 | |
| 68 | ||
| 69 | /* Registers for entry into PLT on PPC64. */ | |
| 70 | typedef struct La_ppc64_regs | |
| 71 | { | |
| 72 | uint64_t lr_reg[8]; | |
| 73 | double lr_fp[13]; | |
| 74 | uint32_t __padding; | |
| 75 | uint32_t lr_vrsave; | |
| 76 | uint32_t lr_vreg[12][4]; | |
| 77 | uint64_t lr_r1; | |
| 78 | uint64_t lr_lr; | |
| 79 | } La_ppc64_regs; | |
| 80 | ||
| 81 | /* Return values for calls from PLT on PPC64. */ | |
| 82 | typedef struct La_ppc64_retval | |
| 83 | { | |
| 84 | uint64_t lrv_r3; | |
| 85 | uint64_t lrv_r4; | |
| 86 | double lrv_fp[4];	/* f1-f4, float - complex long double. */ | |
| 87 | uint32_t lrv_v2[4];	/* v2. */ | |
| 88 | } La_ppc64_retval; | |
| 89 | ||
| 90 | ||
| 91 | __BEGIN_DECLS | |
| 92 | ||
| 93 | extern Elf64_Addr la_ppc64_gnu_pltenter (Elf64_Sym *__sym, | |
| 94 | 					 unsigned int __ndx, | |
| 95 | 					 uintptr_t *__refcook, | |
| 96 | 					 uintptr_t *__defcook, | |
| 97 | 					 La_ppc64_regs *__regs, | |
| 98 | 					 unsigned int *__flags, | |
| 99 | 					 const char *__symname, | |
| 100 | 					 long int *__framesizep); | |
| 101 | extern unsigned int la_ppc64_gnu_pltexit (Elf64_Sym *__sym, | |
| 102 | 					 unsigned int __ndx, | |
| 103 | 					 uintptr_t *__refcook, | |
| 104 | 					 uintptr_t *__defcook, | |
| 105 | 					 const La_ppc64_regs *__inregs, | |
| 106 | 					 La_ppc64_retval *__outregs, | |
| 107 | 					 const char *__symname); | |
| 108 | ||
| 109 | __END_DECLS | |
| 110 | ||
| 111 | # else | |
| 112 | ||
| 113 | /* Registers for entry into PLT on PPC64 in the ELFv2 ABI. */ | |
| 114 | typedef struct La_ppc64v2_regs | |
| 115 | { | |
| 116 | uint64_t lr_reg[8]; | |
| 117 | double lr_fp[13]; | |
| 118 | uint32_t __padding; | |
| 119 | uint32_t lr_vrsave; | |
| 120 | uint32_t lr_vreg[12][4] __attribute__ ((aligned (16))); | |
| 121 | uint64_t lr_r1; | |
| 122 | uint64_t lr_lr; | |
| 123 | } La_ppc64v2_regs; | |
| 124 | ||
| 125 | /* Return values for calls from PLT on PPC64 in the ELFv2 ABI. */ | |
| 126 | typedef struct La_ppc64v2_retval | |
| 127 | { | |
| 128 | uint64_t lrv_r3; | |
| 129 | uint64_t lrv_r4; | |
| 130 | double lrv_fp[10]; | |
| 131 | uint32_t lrv_vreg[8][4] __attribute__ ((aligned (16))); | |
| 132 | } La_ppc64v2_retval; | |
| 133 | ||
| 134 | ||
| 135 | __BEGIN_DECLS | |
| 136 | ||
| 137 | extern Elf64_Addr la_ppc64v2_gnu_pltenter (Elf64_Sym *__sym, | |
| 138 | 					 unsigned int __ndx, | |
| 139 | 					 uintptr_t *__refcook, | |
| 140 | 					 uintptr_t *__defcook, | |
| 141 | 					 La_ppc64v2_regs *__regs, | |
| 142 | 					 unsigned int *__flags, | |
| 143 | 					 const char *__symname, | |
| 144 | 					 long int *__framesizep); | |
| 145 | extern unsigned int la_ppc64v2_gnu_pltexit (Elf64_Sym *__sym, | |
| 146 | 					 unsigned int __ndx, | |
| 147 | 					 uintptr_t *__refcook, | |
| 148 | 					 uintptr_t *__defcook, | |
| 149 | 					 const La_ppc64v2_regs *__inregs, | |
| 150 | 					 La_ppc64v2_retval *__outregs, | |
| 151 | 					 const char *__symname); | |
| 152 | ||
| 153 | __END_DECLS | |
| 154 | ||
| 155 | # endif | |
| 156 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/long-double.h created+25| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | /* Properties of long double type. ldbl-opt version. | |
| 2 | Copyright (C) 2016-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef __NO_LONG_DOUBLE_MATH | |
| 20 | # define __LONG_DOUBLE_MATH_OPTIONAL	1 | |
| 21 | # ifndef __LONG_DOUBLE_128__ | |
| 22 | # define __NO_LONG_DOUBLE_MATH		1 | |
| 23 | # endif | |
| 24 | #endif | |
| 25 | #define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/mman.h created+53| ... | ... | @@ -0,0 +1,53 @@ |
| 1 | /* Definitions for POSIX memory map interface. Linux/PowerPC version. | |
| 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MMAN_H | |
| 20 | # error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* The following definitions basically come from the kernel headers. | |
| 24 | But the kernel header is not namespace clean. */ | |
| 25 | ||
| 26 | #define PROT_SAO	0x10		/* Strong Access Ordering. */ | |
| 27 | ||
| 28 | /* These are Linux-specific. */ | |
| 29 | #ifdef __USE_MISC | |
| 30 | # define MAP_GROWSDOWN	0x00100		/* Stack-like segment. */ | |
| 31 | # define MAP_DENYWRITE	0x00800		/* ETXTBSY */ | |
| 32 | # define MAP_EXECUTABLE	0x01000		/* Mark it as an executable. */ | |
| 33 | # define MAP_LOCKED	0x00080		/* Lock the mapping. */ | |
| 34 | # define MAP_NORESERVE	0x00040		/* Don't check for reservations. */ | |
| 35 | # define MAP_POPULATE	0x08000		/* Populate (prefault) pagetables. */ | |
| 36 | # define MAP_NONBLOCK	0x10000		/* Do not block on IO. */ | |
| 37 | # define MAP_STACK	0x20000		/* Allocation is for a stack. */ | |
| 38 | # define MAP_HUGETLB	0x40000		/* Create huge page mapping. */ | |
| 39 | # define MAP_SYNC	0x80000		/* Perform synchronous page | |
| 40 | 					 faults for the mapping. */ | |
| 41 | # define MAP_FIXED_NOREPLACE 0x100000	/* MAP_FIXED but do not unmap | |
| 42 | 					 underlying mapping. */ | |
| 43 | #endif | |
| 44 | ||
| 45 | /* Flags for `mlockall'. */ | |
| 46 | #define MCL_CURRENT	0x2000		/* Lock all currently mapped pages. */ | |
| 47 | #define MCL_FUTURE	0x4000		/* Lock all additions to address | |
| 48 | 					 space. */ | |
| 49 | #define MCL_ONFAULT	0x8000		/* Lock all pages that are | |
| 50 | 					 faulted in. */ | |
| 51 | ||
| 52 | /* Include generic Linux declarations. */ | |
| 53 | #include <bits/mman-linux.h> | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/procfs.h created+49| ... | ... | @@ -0,0 +1,49 @@ |
| 1 | /* Types for registers for sys/procfs.h. PowerPC version. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_PROCFS_H | |
| 20 | # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <signal.h> | |
| 24 | #include <sys/ucontext.h> | |
| 25 | ||
| 26 | /* These definitions are normally provided by ucontext.h via | |
| 27 | asm/sigcontext.h, asm/ptrace.h, and asm/elf.h. Otherwise we define | |
| 28 | them here. */ | |
| 29 | #if !defined __PPC64_ELF_H && !defined _ASM_POWERPC_ELF_H | |
| 30 | #define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ | |
| 31 | #define ELF_NFPREG 33 /* includes fpscr */ | |
| 32 | #if __WORDSIZE == 32 | |
| 33 | # define ELF_NVRREG 33 /* includes vscr */ | |
| 34 | #else | |
| 35 | # define ELF_NVRREG 34 /* includes vscr */ | |
| 36 | #endif | |
| 37 | ||
| 38 | typedef unsigned long elf_greg_t; | |
| 39 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | |
| 40 | ||
| 41 | typedef double elf_fpreg_t; | |
| 42 | typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | |
| 43 | ||
| 44 | /* Altivec registers */ | |
| 45 | typedef struct { | |
| 46 | unsigned int u[4]; | |
| 47 | } __attribute__ ((__aligned__ (16))) elf_vrreg_t; | |
| 48 | typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG]; | |
| 49 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/pthread_stack_min.h created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. Linux/PPC version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; see the file COPYING.LIB. If | |
| 17 | not, see <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. At least two pages for systems with 64k | |
| 20 | pages. */ | |
| 21 | #define PTHREAD_STACK_MIN	131072 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/setjmp.h created+50| ... | ... | @@ -0,0 +1,50 @@ |
| 1 | /* Copyright (C) 1997-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | /* Define the machine-dependent type `jmp_buf'. PowerPC version. */ | |
| 19 | #ifndef _BITS_SETJMP_H | |
| 20 | #define _BITS_SETJMP_H 1 | |
| 21 | ||
| 22 | #if !defined _SETJMP_H && !defined _PTHREAD_H | |
| 23 | # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead." | |
| 24 | #endif | |
| 25 | ||
| 26 | /* The previous bits/setjmp.h had __jmp_buf defined as a structure. | |
| 27 | We use an array of 'long int' instead, to make writing the | |
| 28 | assembler easier. Naturally, user code should not depend on | |
| 29 | either representation. */ | |
| 30 | ||
| 31 | #include <bits/wordsize.h> | |
| 32 | ||
| 33 | /* The current powerpc 32-bit Altivec ABI specifies for SVR4 ABI and EABI | |
| 34 | the vrsave must be at byte 248 & v20 at byte 256. So we must pad this | |
| 35 | correctly on 32 bit. It also insists that vecregs are only gauranteed | |
| 36 | 4 byte alignment so we need to use vperm in the setjmp/longjmp routines. | |
| 37 | We have to version the code because members like int __mask_was_saved | |
| 38 | in the jmp_buf will move as jmp_buf is now larger than 248 bytes. We | |
| 39 | cannot keep the altivec jmp_buf backward compatible with the jmp_buf. */ | |
| 40 | #ifndef	_ASM | |
| 41 | # if __WORDSIZE == 64 | |
| 42 | typedef long int __jmp_buf[64] __attribute__ ((__aligned__ (16))); | |
| 43 | # else | |
| 44 | /* The alignment is not essential, i.e.the buffer can be copied to a 4 byte | |
| 45 | aligned buffer as per the ABI it is just added for performance reasons. */ | |
| 46 | typedef long int __jmp_buf[64 + (12 * 4)] __attribute__ ((__aligned__ (16))); | |
| 47 | # endif | |
| 48 | #endif | |
| 49 | ||
| 50 | #endif /* bits/setjmp.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/sigstack.h created+32| ... | ... | @@ -0,0 +1,32 @@ |
| 1 | /* sigstack, sigaltstack definitions. | |
| 2 | Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _BITS_SIGSTACK_H | |
| 20 | #define _BITS_SIGSTACK_H 1 | |
| 21 | ||
| 22 | #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H | |
| 23 | # error "Never include this file directly. Use <signal.h> instead" | |
| 24 | #endif | |
| 25 | ||
| 26 | /* Minimum stack size for a signal handler. */ | |
| 27 | #define MINSIGSTKSZ	4096 | |
| 28 | ||
| 29 | /* System default stack size. */ | |
| 30 | #define SIGSTKSZ	16384 | |
| 31 | ||
| 32 | #endif /* bits/sigstack.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/socket-constants.h created+70| ... | ... | @@ -0,0 +1,70 @@ |
| 1 | /* Socket constants which vary among Linux architectures. Version for POWER. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SOCKET_H | |
| 20 | # error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define SOL_SOCKET 1 | |
| 24 | #define SO_ACCEPTCONN 30 | |
| 25 | #define SO_BROADCAST 6 | |
| 26 | #define SO_DONTROUTE 5 | |
| 27 | #define SO_ERROR 4 | |
| 28 | #define SO_KEEPALIVE 9 | |
| 29 | #define SO_LINGER 13 | |
| 30 | #define SO_OOBINLINE 10 | |
| 31 | #define SO_RCVBUF 8 | |
| 32 | #define SO_RCVLOWAT 16 | |
| 33 | #define SO_REUSEADDR 2 | |
| 34 | #define SO_SNDBUF 7 | |
| 35 | #define SO_SNDLOWAT 17 | |
| 36 | #define SO_TYPE 3 | |
| 37 | ||
| 38 | #if __TIMESIZE == 64 | |
| 39 | # define SO_RCVTIMEO 18 | |
| 40 | # define SO_SNDTIMEO 19 | |
| 41 | # define SO_TIMESTAMP 29 | |
| 42 | # define SO_TIMESTAMPNS 35 | |
| 43 | # define SO_TIMESTAMPING 37 | |
| 44 | #else | |
| 45 | # define SO_RCVTIMEO_OLD 18 | |
| 46 | # define SO_SNDTIMEO_OLD 19 | |
| 47 | # define SO_RCVTIMEO_NEW 66 | |
| 48 | # define SO_SNDTIMEO_NEW 67 | |
| 49 | ||
| 50 | # define SO_TIMESTAMP_OLD 29 | |
| 51 | # define SO_TIMESTAMPNS_OLD 35 | |
| 52 | # define SO_TIMESTAMPING_OLD 37 | |
| 53 | # define SO_TIMESTAMP_NEW 63 | |
| 54 | # define SO_TIMESTAMPNS_NEW 64 | |
| 55 | # define SO_TIMESTAMPING_NEW 65 | |
| 56 | ||
| 57 | # ifdef __USE_TIME_BITS64 | |
| 58 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 59 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 60 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 61 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 62 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 63 | # else | |
| 64 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 65 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 66 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 67 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 68 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 69 | # endif | |
| 70 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/struct_mutex.h created+63| ... | ... | @@ -0,0 +1,63 @@ |
| 1 | /* PowerPC internal mutex struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <http://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _THREAD_MUTEX_INTERNAL_H | |
| 20 | #define _THREAD_MUTEX_INTERNAL_H 1 | |
| 21 | ||
| 22 | struct __pthread_mutex_s | |
| 23 | { | |
| 24 | int __lock; | |
| 25 | unsigned int __count; | |
| 26 | int __owner; | |
| 27 | #if __WORDSIZE == 64 | |
| 28 | unsigned int __nusers; | |
| 29 | #endif | |
| 30 | /* KIND must stay at this position in the structure to maintain | |
| 31 | binary compatibility with static initializers. */ | |
| 32 | int __kind; | |
| 33 | #if __WORDSIZE == 64 | |
| 34 | short __spins; | |
| 35 | short __elision; | |
| 36 | __pthread_list_t __list; | |
| 37 | # define __PTHREAD_MUTEX_HAVE_PREV 1 | |
| 38 | #else | |
| 39 | unsigned int __nusers; | |
| 40 | __extension__ union | |
| 41 | { | |
| 42 | struct | |
| 43 | { | |
| 44 | short __espins; | |
| 45 | short __elision; | |
| 46 | # define __spins __elision_data.__espins | |
| 47 | # define __elision __elision_data.__elision | |
| 48 | } __elision_data; | |
| 49 | __pthread_slist_t __list; | |
| 50 | }; | |
| 51 | # define __PTHREAD_MUTEX_HAVE_PREV 0 | |
| 52 | #endif | |
| 53 | }; | |
| 54 | ||
| 55 | #if __WORDSIZE == 64 | |
| 56 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 57 | 0, 0, 0, 0, __kind, 0, 0, { 0, 0 } | |
| 58 | #else | |
| 59 | # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ | |
| 60 | 0, 0, 0, __kind, 0, { { 0, 0 } } | |
| 61 | #endif | |
| 62 | ||
| 63 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/struct_rwlock.h created+61| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | /* PowerPC internal rwlock struct definitions. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | ||
| 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 | <http://www.gnu.org/licenses/>. */ | |
| 19 | ||
| 20 | #ifndef _RWLOCK_INTERNAL_H | |
| 21 | #define _RWLOCK_INTERNAL_H | |
| 22 | ||
| 23 | struct __pthread_rwlock_arch_t | |
| 24 | { | |
| 25 | unsigned int __readers; | |
| 26 | unsigned int __writers; | |
| 27 | unsigned int __wrphase_futex; | |
| 28 | unsigned int __writers_futex; | |
| 29 | unsigned int __pad3; | |
| 30 | unsigned int __pad4; | |
| 31 | #if __WORDSIZE == 64 | |
| 32 | int __cur_writer; | |
| 33 | int __shared; | |
| 34 | unsigned char __rwelision; | |
| 35 | unsigned char __pad1[7]; | |
| 36 | unsigned long int __pad2; | |
| 37 | /* FLAGS must stay at this position in the structure to maintain | |
| 38 | binary compatibility. */ | |
| 39 | unsigned int __flags; | |
| 40 | # define __PTHREAD_RWLOCK_ELISION_EXTRA 0, {0, 0, 0, 0, 0, 0, 0 } | |
| 41 | #else | |
| 42 | unsigned char __rwelision; | |
| 43 | unsigned char __pad2; | |
| 44 | unsigned char __shared; | |
| 45 | /* FLAGS must stay at this position in the structure to maintain | |
| 46 | binary compatibility. */ | |
| 47 | unsigned char __flags; | |
| 48 | int __cur_writer; | |
| 49 | # define __PTHREAD_RWLOCK_ELISION_EXTRA 0 | |
| 50 | #endif | |
| 51 | }; | |
| 52 | ||
| 53 | #if __WORDSIZE == 64 | |
| 54 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 55 | 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, __flags | |
| 56 | #else | |
| 57 | # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ | |
| 58 | 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0, __flags, 0 | |
| 59 | #endif | |
| 60 | ||
| 61 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/struct_stat.h created+231| ... | ... | @@ -0,0 +1,231 @@ |
| 1 | /* Definition for struct stat. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #if !defined _SYS_STAT_H && !defined _FCNTL_H | |
| 20 | # error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifndef _BITS_STRUCT_STAT_H | |
| 24 | #define _BITS_STRUCT_STAT_H	1 | |
| 25 | ||
| 26 | #include <bits/wordsize.h> | |
| 27 | ||
| 28 | #if __WORDSIZE == 32 | |
| 29 | struct stat | |
| 30 | { | |
| 31 | # ifdef __USE_TIME_BITS64 | |
| 32 | # include <bits/struct_stat_time64_helper.h> | |
| 33 | # else | |
| 34 | __dev_t st_dev;			/* Device. */ | |
| 35 | # ifndef __USE_FILE_OFFSET64 | |
| 36 | unsigned short int __pad1; | |
| 37 | __ino_t st_ino;			/* File serial number.	*/ | |
| 38 | # else | |
| 39 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 40 | # endif | |
| 41 | __mode_t st_mode;			/* File mode. */ | |
| 42 | __nlink_t st_nlink;			/* Link count. */ | |
| 43 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 44 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 45 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 46 | unsigned short int __pad2; | |
| 47 | # ifndef __USE_FILE_OFFSET64 | |
| 48 | __off_t st_size;			/* Size of file, in bytes. */ | |
| 49 | # else | |
| 50 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 51 | # endif | |
| 52 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 53 | ||
| 54 | # ifndef __USE_FILE_OFFSET64 | |
| 55 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 56 | # else | |
| 57 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 58 | # endif | |
| 59 | # ifdef __USE_XOPEN2K8 | |
| 60 | /* Nanosecond resolution timestamps are stored in a format | |
| 61 | equivalent to 'struct timespec'. This is the type used | |
| 62 | whenever possible but the Unix namespace rules do not allow the | |
| 63 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 64 | Therefore we have to handle the use of this header in strictly | |
| 65 | standard-compliant sources special. */ | |
| 66 | struct timespec st_atim;		/* Time of last access. */ | |
| 67 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 68 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 69 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 70 | # define st_mtime st_mtim.tv_sec | |
| 71 | # define st_ctime st_ctim.tv_sec | |
| 72 | # else | |
| 73 | __time_t st_atime;			/* Time of last access. */ | |
| 74 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 75 | __time_t st_mtime;			/* Time of last modification. */ | |
| 76 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 77 | __time_t st_ctime;			/* Time of last status change. */ | |
| 78 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 79 | # endif | |
| 80 | unsigned long int __glibc_reserved4; | |
| 81 | unsigned long int __glibc_reserved5; | |
| 82 | # endif /* __USE_TIME_BITS64 */ | |
| 83 | }; | |
| 84 | ||
| 85 | # ifdef __USE_LARGEFILE64 | |
| 86 | struct stat64 | |
| 87 | { | |
| 88 | # ifdef __USE_TIME_BITS64 | |
| 89 | # include <bits/struct_stat_time64_helper.h> | |
| 90 | # else | |
| 91 | __dev_t st_dev;			/* Device. */ | |
| 92 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 93 | __mode_t st_mode;			/* File mode. */ | |
| 94 | __nlink_t st_nlink;			/* Link count. */ | |
| 95 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 96 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 97 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 98 | unsigned short int __pad2; | |
| 99 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 100 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 101 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 102 | # ifdef __USE_XOPEN2K8 | |
| 103 | /* Nanosecond resolution timestamps are stored in a format | |
| 104 | equivalent to 'struct timespec'. This is the type used | |
| 105 | whenever possible but the Unix namespace rules do not allow the | |
| 106 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 107 | Therefore we have to handle the use of this header in strictly | |
| 108 | standard-compliant sources special. */ | |
| 109 | struct timespec st_atim;		/* Time of last access. */ | |
| 110 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 111 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 112 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 113 | # define st_mtime st_mtim.tv_sec | |
| 114 | # define st_ctime st_ctim.tv_sec | |
| 115 | # else | |
| 116 | __time_t st_atime;			/* Time of last access. */ | |
| 117 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 118 | __time_t st_mtime;			/* Time of last modification. */ | |
| 119 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 120 | __time_t st_ctime;			/* Time of last status change. */ | |
| 121 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 122 | # endif | |
| 123 | unsigned long int __glibc_reserved4; | |
| 124 | unsigned long int __glibc_reserved5; | |
| 125 | # endif /* __USE_TIME_BITS64 */ | |
| 126 | }; | |
| 127 | # endif /* __USE_LARGEFILE64 */ | |
| 128 | ||
| 129 | #else /* __WORDSIZE == 32 */ | |
| 130 | ||
| 131 | struct stat | |
| 132 | { | |
| 133 | __dev_t st_dev;			/* Device. */ | |
| 134 | # ifndef __USE_FILE_OFFSET64 | |
| 135 | __ino_t st_ino;			/* File serial number.	*/ | |
| 136 | # else | |
| 137 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 138 | # endif | |
| 139 | __nlink_t st_nlink;			/* Link count. */ | |
| 140 | __mode_t st_mode;			/* File mode. */ | |
| 141 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 142 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 143 | int __pad2; | |
| 144 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 145 | # ifndef __USE_FILE_OFFSET64 | |
| 146 | __off_t st_size;			/* Size of file, in bytes. */ | |
| 147 | # else | |
| 148 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 149 | # endif | |
| 150 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 151 | ||
| 152 | # ifndef __USE_FILE_OFFSET64 | |
| 153 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 154 | # else | |
| 155 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 156 | # endif | |
| 157 | # ifdef __USE_XOPEN2K8 | |
| 158 | /* Nanosecond resolution timestamps are stored in a format | |
| 159 | equivalent to 'struct timespec'. This is the type used | |
| 160 | whenever possible but the Unix namespace rules do not allow the | |
| 161 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 162 | Therefore we have to handle the use of this header in strictly | |
| 163 | standard-compliant sources special. */ | |
| 164 | struct timespec st_atim;		/* Time of last access. */ | |
| 165 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 166 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 167 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 168 | # define st_mtime st_mtim.tv_sec | |
| 169 | # define st_ctime st_ctim.tv_sec | |
| 170 | # else | |
| 171 | __time_t st_atime;			/* Time of last access. */ | |
| 172 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 173 | __time_t st_mtime;			/* Time of last modification. */ | |
| 174 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 175 | __time_t st_ctime;			/* Time of last status change. */ | |
| 176 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 177 | # endif | |
| 178 | unsigned long int __glibc_reserved4; | |
| 179 | unsigned long int __glibc_reserved5; | |
| 180 | unsigned long int __glibc_reserved6; | |
| 181 | }; | |
| 182 | ||
| 183 | # ifdef __USE_LARGEFILE64 | |
| 184 | struct stat64 | |
| 185 | { | |
| 186 | __dev_t st_dev;			/* Device. */ | |
| 187 | __ino64_t st_ino;			/* File serial number.	*/ | |
| 188 | __nlink_t st_nlink;			/* Link count. */ | |
| 189 | __mode_t st_mode;			/* File mode. */ | |
| 190 | __uid_t st_uid;			/* User ID of the file's owner.	*/ | |
| 191 | __gid_t st_gid;			/* Group ID of the file's group.*/ | |
| 192 | int __pad2; | |
| 193 | __dev_t st_rdev;			/* Device number, if device. */ | |
| 194 | __off64_t st_size;			/* Size of file, in bytes. */ | |
| 195 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ | |
| 196 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ | |
| 197 | # ifdef __USE_XOPEN2K8 | |
| 198 | /* Nanosecond resolution timestamps are stored in a format | |
| 199 | equivalent to 'struct timespec'. This is the type used | |
| 200 | whenever possible but the Unix namespace rules do not allow the | |
| 201 | identifier 'timespec' to appear in the <sys/stat.h> header. | |
| 202 | Therefore we have to handle the use of this header in strictly | |
| 203 | standard-compliant sources special. */ | |
| 204 | struct timespec st_atim;		/* Time of last access. */ | |
| 205 | struct timespec st_mtim;		/* Time of last modification. */ | |
| 206 | struct timespec st_ctim;		/* Time of last status change. */ | |
| 207 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 208 | # define st_mtime st_mtim.tv_sec | |
| 209 | # define st_ctime st_ctim.tv_sec | |
| 210 | # else | |
| 211 | __time_t st_atime;			/* Time of last access. */ | |
| 212 | unsigned long int st_atimensec;	/* Nscecs of last access. */ | |
| 213 | __time_t st_mtime;			/* Time of last modification. */ | |
| 214 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ | |
| 215 | __time_t st_ctime;			/* Time of last status change. */ | |
| 216 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ | |
| 217 | # endif | |
| 218 | unsigned long int __glibc_reserved4; | |
| 219 | unsigned long int __glibc_reserved5; | |
| 220 | unsigned long int __glibc_reserved6; | |
| 221 | }; | |
| 222 | # endif /* __USE_LARGEFILE64 */ | |
| 223 | #endif | |
| 224 | ||
| 225 | /* Tell code we have these members. */ | |
| 226 | #define	_STATBUF_ST_BLKSIZE | |
| 227 | #define _STATBUF_ST_RDEV | |
| 228 | /* Nanosecond resolution time values are supported. */ | |
| 229 | #define _STATBUF_ST_NSEC | |
| 230 | ||
| 231 | #endif /* _BITS_STRUCT_STAT_H */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/termios-baud.h created+45| ... | ... | @@ -0,0 +1,45 @@ |
| 1 | /* termios baud rate selection definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-baud.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifdef __USE_MISC | |
| 24 | # define CBAUD	0000377 | |
| 25 | # define CBAUDEX 0000020 | |
| 26 | # define CMSPAR 010000000000		/* mark or space (stick) parity */ | |
| 27 | # define CRTSCTS 020000000000		/* flow control */ | |
| 28 | #endif | |
| 29 | ||
| 30 | #define B57600 00020 | |
| 31 | #define B115200 00021 | |
| 32 | #define B230400 00022 | |
| 33 | #define B460800 00023 | |
| 34 | #define B500000 00024 | |
| 35 | #define B576000 00025 | |
| 36 | #define B921600 00026 | |
| 37 | #define B1000000 00027 | |
| 38 | #define B1152000 00030 | |
| 39 | #define B1500000 00031 | |
| 40 | #define B2000000 00032 | |
| 41 | #define B2500000 00033 | |
| 42 | #define B3000000 00034 | |
| 43 | #define B3500000 00035 | |
| 44 | #define B4000000 00036 | |
| 45 | #define __MAX_BAUD B4000000 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/termios-c_cc.h created+41| ... | ... | @@ -0,0 +1,41 @@ |
| 1 | /* termios c_cc symbolic constant definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_cc.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_cc characters */ | |
| 24 | #define VINTR	0 | |
| 25 | #define VQUIT	1 | |
| 26 | #define VERASE	2 | |
| 27 | #define VKILL	3 | |
| 28 | #define VEOF	4 | |
| 29 | #define VMIN	5 | |
| 30 | #define VEOL	6 | |
| 31 | #define VTIME	7 | |
| 32 | #define VEOL2	8 | |
| 33 | #define VSWTC	9 | |
| 34 | ||
| 35 | #define VWERASE	10 | |
| 36 | #define VREPRINT	11 | |
| 37 | #define VSUSP		12 | |
| 38 | #define VSTART		13 | |
| 39 | #define VSTOP		14 | |
| 40 | #define VLNEXT		15 | |
| 41 | #define VDISCARD	16 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/termios-c_cflag.h created+35| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | /* termios control mode definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_cflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #define CSIZE	00001400 | |
| 24 | #define CS5	00000000 | |
| 25 | #define CS6	00000400 | |
| 26 | #define CS7	00001000 | |
| 27 | #define CS8	00001400 | |
| 28 | ||
| 29 | #define CSTOPB	00002000 | |
| 30 | #define CREAD	00004000 | |
| 31 | #define PARENB	00010000 | |
| 32 | #define PARODD	00020000 | |
| 33 | #define HUPCL	00040000 | |
| 34 | ||
| 35 | #define CLOCAL	00100000 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/termios-c_iflag.h created+38| ... | ... | @@ -0,0 +1,38 @@ |
| 1 | /* termios input mode definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_iflags.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_iflag bits */ | |
| 24 | #define IGNBRK	0000001 | |
| 25 | #define BRKINT	0000002 | |
| 26 | #define IGNPAR	0000004 | |
| 27 | #define PARMRK	0000010 | |
| 28 | #define INPCK	0000020 | |
| 29 | #define ISTRIP	0000040 | |
| 30 | #define INLCR	0000100 | |
| 31 | #define IGNCR	0000200 | |
| 32 | #define ICRNL	0000400 | |
| 33 | #define IXON	0001000 | |
| 34 | #define IXOFF	0002000 | |
| 35 | #define IXANY	0004000 | |
| 36 | #define IUCLC	0010000 | |
| 37 | #define IMAXBEL	0020000 | |
| 38 | #define IUTF8	0040000 | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/termios-c_lflag.h created+45| ... | ... | @@ -0,0 +1,45 @@ |
| 1 | /* termios local mode definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_lflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_lflag bits */ | |
| 24 | #define ISIG	0x00000080 | |
| 25 | #define ICANON	0x00000100 | |
| 26 | #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) | |
| 27 | # define XCASE	0x00004000 | |
| 28 | #endif | |
| 29 | #define ECHO	0x00000008 | |
| 30 | #define ECHOE	0x00000002 | |
| 31 | #define ECHOK	0x00000004 | |
| 32 | #define ECHONL	0x00000010 | |
| 33 | #define NOFLSH	0x80000000 | |
| 34 | #define TOSTOP	0x00400000 | |
| 35 | #ifdef __USE_MISC | |
| 36 | # define ECHOCTL	0x00000040 | |
| 37 | # define ECHOPRT	0x00000020 | |
| 38 | # define ECHOKE	0x00000001 | |
| 39 | # define FLUSHO	0x00800000 | |
| 40 | # define PENDIN	0x20000000 | |
| 41 | #endif | |
| 42 | #define IEXTEN	0x00000400 | |
| 43 | #ifdef __USE_MISC | |
| 44 | # define EXTPROC 0x10000000 | |
| 45 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/termios-c_oflag.h created+65| ... | ... | @@ -0,0 +1,65 @@ |
| 1 | /* termios output mode definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-c_oflag.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* c_oflag bits */ | |
| 24 | #define OPOST	0000001 | |
| 25 | #define ONLCR	0000002 | |
| 26 | #define OLCUC	0000004 | |
| 27 | ||
| 28 | #define OCRNL	0000010 | |
| 29 | #define ONOCR	0000020 | |
| 30 | #define ONLRET	0000040 | |
| 31 | ||
| 32 | #define OFILL	00000100 | |
| 33 | #define OFDEL	00000200 | |
| 34 | #if defined __USE_MISC || defined __USE_XOPEN | |
| 35 | # define NLDLY	00001400 | |
| 36 | # define NL0	00000000 | |
| 37 | # define NL1	00000400 | |
| 38 | # if defined __USE_MISC | |
| 39 | # define NL2	00001000 | |
| 40 | # define NL3	00001400 | |
| 41 | # endif | |
| 42 | # define TABDLY	00006000 | |
| 43 | # define TAB0	00000000 | |
| 44 | # define TAB1	00002000 | |
| 45 | # define TAB2	00004000 | |
| 46 | # define TAB3	00006000 | |
| 47 | # define CRDLY	00030000 | |
| 48 | # define CR0	00000000 | |
| 49 | # define CR1	00010000 | |
| 50 | # define CR2	00020000 | |
| 51 | # define CR3	00030000 | |
| 52 | # define FFDLY	00040000 | |
| 53 | # define FF0	00000000 | |
| 54 | # define FF1	00040000 | |
| 55 | # define BSDLY	00100000 | |
| 56 | # define BS0	00000000 | |
| 57 | # define BS1	00100000 | |
| 58 | #endif | |
| 59 | #define VTDLY	00200000 | |
| 60 | #define VT0	00000000 | |
| 61 | #define VT1	00200000 | |
| 62 | ||
| 63 | #ifdef __USE_MISC | |
| 64 | # define XTABS	00006000 | |
| 65 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/termios-misc.h created+72| ... | ... | @@ -0,0 +1,72 @@ |
| 1 | /* termios baud platform specific definitions. Linux/powerpc version. | |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _TERMIOS_H | |
| 20 | # error "Never include <bits/termios-misc.h> directly; use <termios.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #ifdef __USE_MISC | |
| 24 | ||
| 25 | struct sgttyb { | |
| 26 | 	char	sg_ispeed; | |
| 27 | 	char	sg_ospeed; | |
| 28 | 	char	sg_erase; | |
| 29 | 	char	sg_kill; | |
| 30 | 	short	sg_flags; | |
| 31 | }; | |
| 32 | ||
| 33 | struct tchars { | |
| 34 | 	char	t_intrc; | |
| 35 | 	char	t_quitc; | |
| 36 | 	char	t_startc; | |
| 37 | 	char	t_stopc; | |
| 38 | 	char	t_eofc; | |
| 39 | 	char	t_brkc; | |
| 40 | }; | |
| 41 | ||
| 42 | struct ltchars { | |
| 43 | 	char	t_suspc; | |
| 44 | 	char	t_dsuspc; | |
| 45 | 	char	t_rprntc; | |
| 46 | 	char	t_flushc; | |
| 47 | 	char	t_werasc; | |
| 48 | 	char	t_lnextc; | |
| 49 | }; | |
| 50 | ||
| 51 | /* Used for packet mode */ | |
| 52 | #define TIOCPKT_DATA		 0 | |
| 53 | #define TIOCPKT_FLUSHREAD	 1 | |
| 54 | #define TIOCPKT_FLUSHWRITE	 2 | |
| 55 | #define TIOCPKT_STOP		 4 | |
| 56 | #define TIOCPKT_START		 8 | |
| 57 | #define TIOCPKT_NOSTOP		16 | |
| 58 | #define TIOCPKT_DOSTOP		32 | |
| 59 | ||
| 60 | /* c_cc characters */ | |
| 61 | #define _VINTR	0 | |
| 62 | #define _VQUIT	1 | |
| 63 | #define _VERASE	2 | |
| 64 | #define _VKILL	3 | |
| 65 | #define _VEOF	4 | |
| 66 | #define _VMIN	5 | |
| 67 | #define _VEOL	6 | |
| 68 | #define _VTIME	7 | |
| 69 | #define _VEOL2	8 | |
| 70 | #define _VSWTC	9 | |
| 71 | ||
| 72 | #endif /* __USE_MISC */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_msqid_ds.h created+53| ... | ... | @@ -0,0 +1,53 @@ |
| 1 | /* Linux/PowerPC implementation of the SysV message struct msqid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_MSG_H | |
| 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 25 | /* Structure of record for one message inside the kernel. | |
| 26 | The type `struct msg' is opaque. */ | |
| 27 | struct msqid_ds | |
| 28 | { | |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ | |
| 33 | # if __TIMESIZE == 32 | |
| 34 | unsigned long int __msg_stime_high; | |
| 35 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 36 | unsigned long int __msg_rtime_high; | |
| 37 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 38 | unsigned long int __msg_ctime_high; | |
| 39 | __time_t msg_ctime;		/* time of last change */ | |
| 40 | # else | |
| 41 | __time_t msg_stime;		/* time of last msgsnd command */ | |
| 42 | __time_t msg_rtime;		/* time of last msgsnd command */ | |
| 43 | __time_t msg_ctime;		/* time of last change */ | |
| 44 | # endif | |
| 45 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ | |
| 46 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ | |
| 47 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ | |
| 48 | __pid_t msg_lspid;		/* pid of last msgsnd() */ | |
| 49 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ | |
| 50 | __syscall_ulong_t __glibc_reserved4; | |
| 51 | __syscall_ulong_t __glibc_reserved5; | |
| 52 | #endif | |
| 53 | }; | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_semid_ds.h created+43| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | /* PowerPC implementation of the semaphore struct semid_ds. | |
| 2 | Copyright (C) 1995-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SEM_H | |
| 20 | # error "Never include <bits/types/struct_semid_ds.h> directly; use <sys/sem.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a set of semaphores. */ | |
| 24 | struct semid_ds | |
| 25 | { | |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 29 | struct ipc_perm sem_perm; /* operation permission struct */ | |
| 30 | # if __TIMESIZE == 32 | |
| 31 | __syscall_ulong_t __sem_otime_high; | |
| 32 | __time_t sem_otime; /* last semop() time */ | |
| 33 | __syscall_ulong_t __sem_ctime_high; | |
| 34 | __time_t sem_ctime; /* last time changed by semctl() */ | |
| 35 | # else | |
| 36 | __time_t sem_otime; /* last semop() time */ | |
| 37 | __time_t sem_ctime; /* last time changed by semctl() */ | |
| 38 | # endif | |
| 39 | __syscall_ulong_t sem_nsems; /* number of semaphores in set */ | |
| 40 | __syscall_ulong_t __glibc_reserved3; | |
| 41 | __syscall_ulong_t __glibc_reserved4; | |
| 42 | #endif | |
| 43 | }; | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_shmid_ds.h created+50| ... | ... | @@ -0,0 +1,50 @@ |
| 1 | /* Linux/PowerPC implementation of the shared memory struct shmid_ds. | |
| 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_SHM_H | |
| 20 | # error "Never include <bits/types/struct_shmid_ds.h> directly; use <sys/shm.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | /* Data structure describing a shared memory segment. */ | |
| 24 | struct shmid_ds | |
| 25 | { | |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 29 | struct ipc_perm shm_perm;		/* operation permission struct */ | |
| 30 | # if __TIMESIZE == 32 | |
| 31 | unsigned long int __shm_atime_high; | |
| 32 | __time_t shm_atime;			/* time of last shmat() */ | |
| 33 | unsigned long int __shm_dtime_high; | |
| 34 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 35 | unsigned long int __shm_ctime_high; | |
| 36 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 37 | unsigned long int __glibc_reserved4; | |
| 38 | # else | |
| 39 | __time_t shm_atime;			/* time of last shmat() */ | |
| 40 | __time_t shm_dtime;			/* time of last shmdt() */ | |
| 41 | __time_t shm_ctime;			/* time of last change by shmctl() */ | |
| 42 | # endif | |
| 43 | size_t shm_segsz;			/* size of segment in bytes */ | |
| 44 | __pid_t shm_cpid;			/* pid of creator */ | |
| 45 | __pid_t shm_lpid;			/* pid of last shmop */ | |
| 46 | shmatt_t shm_nattch;		/* number of current attaches */ | |
| 47 | __syscall_ulong_t __glibc_reserved5; | |
| 48 | __syscall_ulong_t __glibc_reserved6; | |
| 49 | #endif | |
| 50 | }; | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/bits/wordsize.h created+11| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | /* Determine the wordsize from the preprocessor defines. */ | |
| 2 | ||
| 3 | #if defined __powerpc64__ | |
| 4 | # define __WORDSIZE	64 | |
| 5 | # define __WORDSIZE_TIME64_COMPAT32	1 | |
| 6 | #else | |
| 7 | # define __WORDSIZE	32 | |
| 8 | # define __WORDSIZE_TIME64_COMPAT32	0 | |
| 9 | # define __WORDSIZE32_SIZE_ULONG	0 | |
| 10 | # define __WORDSIZE32_PTRDIFF_LONG	0 | |
| 11 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/fpu_control.h created+114| ... | ... | @@ -0,0 +1,114 @@ |
| 1 | /* FPU control word definitions. PowerPC version. | |
| 2 | Copyright (C) 1996-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _FPU_CONTROL_H | |
| 20 | #define _FPU_CONTROL_H | |
| 21 | ||
| 22 | #if defined __SPE__ || (defined __NO_FPRS__ && !defined _SOFT_FLOAT) | |
| 23 | # error "SPE/e500 is no longer supported" | |
| 24 | #endif | |
| 25 | ||
| 26 | #ifdef _SOFT_FLOAT | |
| 27 | ||
| 28 | # define _FPU_RESERVED 0xffffffff | |
| 29 | # define _FPU_DEFAULT 0x00000000 /* Default value. */ | |
| 30 | typedef unsigned int fpu_control_t; | |
| 31 | # define _FPU_GETCW(cw) (cw) = 0 | |
| 32 | # define _FPU_SETCW(cw) (void) (cw) | |
| 33 | extern fpu_control_t __fpu_control; | |
| 34 | ||
| 35 | #else /* PowerPC 6xx floating-point. */ | |
| 36 | ||
| 37 | /* rounding control */ | |
| 38 | # define _FPU_RC_NEAREST 0x00 /* RECOMMENDED */ | |
| 39 | # define _FPU_RC_DOWN 0x03 | |
| 40 | # define _FPU_RC_UP 0x02 | |
| 41 | # define _FPU_RC_ZERO 0x01 | |
| 42 | ||
| 43 | # define _FPU_MASK_RC (_FPU_RC_NEAREST|_FPU_RC_DOWN|_FPU_RC_UP|_FPU_RC_ZERO) | |
| 44 | ||
| 45 | # define _FPU_MASK_NI 0x04 /* non-ieee mode */ | |
| 46 | ||
| 47 | /* masking of interrupts */ | |
| 48 | # define _FPU_MASK_ZM 0x10 /* zero divide */ | |
| 49 | # define _FPU_MASK_OM 0x40 /* overflow */ | |
| 50 | # define _FPU_MASK_UM 0x20 /* underflow */ | |
| 51 | # define _FPU_MASK_XM 0x08 /* inexact */ | |
| 52 | # define _FPU_MASK_IM 0x80 /* invalid operation */ | |
| 53 | ||
| 54 | # define _FPU_RESERVED 0xffffff00 /* These bits are reserved are not changed. */ | |
| 55 | ||
| 56 | /* The fdlibm code requires no interrupts for exceptions. */ | |
| 57 | # define _FPU_DEFAULT 0x00000000 /* Default value. */ | |
| 58 | ||
| 59 | /* IEEE: same as above, but (some) exceptions; | |
| 60 | we leave the 'inexact' exception off. | |
| 61 | */ | |
| 62 | # define _FPU_IEEE 0x000000f0 | |
| 63 | ||
| 64 | /* Type of the control word. */ | |
| 65 | typedef unsigned int fpu_control_t; | |
| 66 | ||
| 67 | /* Macros for accessing the hardware control word. */ | |
| 68 | # define _FPU_GETCW(cw)						\ | |
| 69 | ({union { double __d; unsigned long long __ll; } __u;		\ | |
| 70 | __asm__ __volatile__("mffs %0" : "=f" (__u.__d));		\ | |
| 71 | (cw) = (fpu_control_t) __u.__ll;				\ | |
| 72 | (fpu_control_t) __u.__ll;					\ | |
| 73 | }) | |
| 74 | ||
| 75 | # define _FPU_GET_RC_ISA300()						\ | |
| 76 | ({union { double __d; unsigned long long __ll; } __u;			\ | |
| 77 | __asm__ __volatile__(						\ | |
| 78 | ".machine push; .machine \"power9\"; mffsl %0; .machine pop" 	\ | |
| 79 | : "=f" (__u.__d));						\ | |
| 80 | (fpu_control_t) (__u.__ll & _FPU_MASK_RC);				\ | |
| 81 | }) | |
| 82 | ||
| 83 | # ifdef _ARCH_PWR9 | |
| 84 | # define _FPU_GET_RC() _FPU_GET_RC_ISA300() | |
| 85 | # elif defined __BUILTIN_CPU_SUPPORTS__ | |
| 86 | # define _FPU_GET_RC()							\ | |
| 87 | ({fpu_control_t __rc;							\ | |
| 88 | __rc = __glibc_likely (__builtin_cpu_supports ("arch_3_00"))	\ | |
| 89 | ? _FPU_GET_RC_ISA300 ()						\ | |
| 90 | : _FPU_GETCW (__rc) & _FPU_MASK_RC;				\ | |
| 91 | __rc;								\ | |
| 92 | }) | |
| 93 | # else | |
| 94 | # define _FPU_GET_RC()						\ | |
| 95 | ({fpu_control_t __rc = _FPU_GETCW (__rc) & _FPU_MASK_RC;	\ | |
| 96 | __rc;							\ | |
| 97 | }) | |
| 98 | # endif | |
| 99 | ||
| 100 | # define _FPU_SETCW(cw)						\ | |
| 101 | { union { double __d; unsigned long long __ll; } __u;		\ | |
| 102 | register double __fr;					\ | |
| 103 | __u.__ll = 0xfff80000LL << 32; /* This is a QNaN. */	\ | |
| 104 | __u.__ll |= (cw) & 0xffffffffLL;				\ | |
| 105 | __fr = __u.__d;						\ | |
| 106 | __asm__ __volatile__("mtfsf 255,%0" : : "f" (__fr));	\ | |
| 107 | } | |
| 108 | ||
| 109 | /* Default control word set at startup. */ | |
| 110 | extern fpu_control_t __fpu_control; | |
| 111 | ||
| 112 | #endif /* PowerPC 6xx floating-point. */ | |
| 113 | ||
| 114 | #endif /* _FPU_CONTROL_H */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/gnu/lib-names-32.h created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | /* This file is automatically generated. */ | |
| 2 | #ifndef __GNU_LIB_NAMES_H | |
| 3 | # error "Never use <gnu/lib-names-32.h> directly; include <gnu/lib-names.h> instead." | |
| 4 | #endif | |
| 5 | ||
| 6 | #define LD_SO "ld.so.1" | |
| 7 | #define LIBANL_SO "libanl.so.1" | |
| 8 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" | |
| 9 | #define LIBCRYPT_SO "libcrypt.so.1" | |
| 10 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | #define LIBC_SO "libc.so.6" | |
| 12 | #define LIBDL_SO "libdl.so.2" | |
| 13 | #define LIBGCC_S_SO "libgcc_s.so.1" | |
| 14 | #define LIBMVEC_SO "libmvec.so.1" | |
| 15 | #define LIBM_SO "libm.so.6" | |
| 16 | #define LIBNSL_SO "libnsl.so.1" | |
| 17 | #define LIBNSS_COMPAT_SO "libnss_compat.so.2" | |
| 18 | #define LIBNSS_DB_SO "libnss_db.so.2" | |
| 19 | #define LIBNSS_DNS_SO "libnss_dns.so.2" | |
| 20 | #define LIBNSS_FILES_SO "libnss_files.so.2" | |
| 21 | #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" | |
| 22 | #define LIBNSS_LDAP_SO "libnss_ldap.so.2" | |
| 23 | #define LIBNSS_TEST1_SO "libnss_test1.so.2" | |
| 24 | #define LIBNSS_TEST2_SO "libnss_test2.so.2" | |
| 25 | #define LIBPTHREAD_SO "libpthread.so.0" | |
| 26 | #define LIBRESOLV_SO "libresolv.so.2" | |
| 27 | #define LIBRT_SO "librt.so.1" | |
| 28 | #define LIBTHREAD_DB_SO "libthread_db.so.1" | |
| 29 | #define LIBUTIL_SO "libutil.so.1" | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/gnu/lib-names.h created+19| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | /* This file is automatically generated. | |
| 2 | It defines macros to allow user program to find the shared | |
| 3 | library files which come as part of GNU libc. */ | |
| 4 | #ifndef __GNU_LIB_NAMES_H | |
| 5 | #define __GNU_LIB_NAMES_H	1 | |
| 6 | ||
| 7 | #include <bits/wordsize.h> | |
| 8 | ||
| 9 | #if __WORDSIZE == 32 | |
| 10 | # include <gnu/lib-names-32.h> | |
| 11 | #endif | |
| 12 | #if __WORDSIZE == 64 && _CALL_ELF != 2 | |
| 13 | # include <gnu/lib-names-64-v1.h> | |
| 14 | #endif | |
| 15 | #if __WORDSIZE == 64 && _CALL_ELF == 2 | |
| 16 | # include <gnu/lib-names-64-v2.h> | |
| 17 | #endif | |
| 18 | ||
| 19 | #endif	/* gnu/lib-names.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/gnu/stubs.h created+15| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | /* This file is automatically generated. | |
| 2 | This file selects the right generated file of `__stub_FUNCTION' macros | |
| 3 | based on the architecture being compiled for. */ | |
| 4 | ||
| 5 | #include <bits/wordsize.h> | |
| 6 | ||
| 7 | #if __WORDSIZE == 32 | |
| 8 | # include <gnu/stubs-32.h> | |
| 9 | #endif | |
| 10 | #if __WORDSIZE == 64 && _CALL_ELF != 2 | |
| 11 | # include <gnu/stubs-64-v1.h> | |
| 12 | #endif | |
| 13 | #if __WORDSIZE == 64 && _CALL_ELF == 2 | |
| 14 | # include <gnu/stubs-64-v2.h> | |
| 15 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/ieee754.h created+197| ... | ... | @@ -0,0 +1,197 @@ |
| 1 | /* Copyright (C) 1992-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _IEEE754_H | |
| 19 | #define _IEEE754_H 1 | |
| 20 | ||
| 21 | #include <features.h> | |
| 22 | ||
| 23 | #include <bits/endian.h> | |
| 24 | #include <bits/floatn.h> | |
| 25 | ||
| 26 | __BEGIN_DECLS | |
| 27 | ||
| 28 | union ieee754_float | |
| 29 | { | |
| 30 | float f; | |
| 31 | ||
| 32 | /* This is the IEEE 754 single-precision format. */ | |
| 33 | struct | |
| 34 | { | |
| 35 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 36 | 	unsigned int negative:1; | |
| 37 | 	unsigned int exponent:8; | |
| 38 | 	unsigned int mantissa:23; | |
| 39 | #endif				/* Big endian. */ | |
| 40 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 41 | 	unsigned int mantissa:23; | |
| 42 | 	unsigned int exponent:8; | |
| 43 | 	unsigned int negative:1; | |
| 44 | #endif				/* Little endian. */ | |
| 45 | } ieee; | |
| 46 | ||
| 47 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 48 | struct | |
| 49 | { | |
| 50 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 51 | 	unsigned int negative:1; | |
| 52 | 	unsigned int exponent:8; | |
| 53 | 	unsigned int quiet_nan:1; | |
| 54 | 	unsigned int mantissa:22; | |
| 55 | #endif				/* Big endian. */ | |
| 56 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 57 | 	unsigned int mantissa:22; | |
| 58 | 	unsigned int quiet_nan:1; | |
| 59 | 	unsigned int exponent:8; | |
| 60 | 	unsigned int negative:1; | |
| 61 | #endif				/* Little endian. */ | |
| 62 | } ieee_nan; | |
| 63 | }; | |
| 64 | ||
| 65 | #define IEEE754_FLOAT_BIAS	0x7f /* Added to exponent. */ | |
| 66 | ||
| 67 | ||
| 68 | union ieee754_double | |
| 69 | { | |
| 70 | double d; | |
| 71 | ||
| 72 | /* This is the IEEE 754 double-precision format. */ | |
| 73 | struct | |
| 74 | { | |
| 75 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 76 | 	unsigned int negative:1; | |
| 77 | 	unsigned int exponent:11; | |
| 78 | 	/* Together these comprise the mantissa. */ | |
| 79 | 	unsigned int mantissa0:20; | |
| 80 | 	unsigned int mantissa1:32; | |
| 81 | #endif				/* Big endian. */ | |
| 82 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 83 | 	/* Together these comprise the mantissa. */ | |
| 84 | 	unsigned int mantissa1:32; | |
| 85 | 	unsigned int mantissa0:20; | |
| 86 | 	unsigned int exponent:11; | |
| 87 | 	unsigned int negative:1; | |
| 88 | #endif				/* Little endian. */ | |
| 89 | } ieee; | |
| 90 | ||
| 91 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 92 | struct | |
| 93 | { | |
| 94 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 95 | 	unsigned int negative:1; | |
| 96 | 	unsigned int exponent:11; | |
| 97 | 	unsigned int quiet_nan:1; | |
| 98 | 	/* Together these comprise the mantissa. */ | |
| 99 | 	unsigned int mantissa0:19; | |
| 100 | 	unsigned int mantissa1:32; | |
| 101 | #else | |
| 102 | 	/* Together these comprise the mantissa. */ | |
| 103 | 	unsigned int mantissa1:32; | |
| 104 | 	unsigned int mantissa0:19; | |
| 105 | 	unsigned int quiet_nan:1; | |
| 106 | 	unsigned int exponent:11; | |
| 107 | 	unsigned int negative:1; | |
| 108 | #endif | |
| 109 | } ieee_nan; | |
| 110 | }; | |
| 111 | ||
| 112 | #define IEEE754_DOUBLE_BIAS	0x3ff /* Added to exponent. */ | |
| 113 | ||
| 114 | ||
| 115 | #if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 | |
| 116 | /* long double is IEEE 128 bit */ | |
| 117 | union ieee854_long_double | |
| 118 | { | |
| 119 | long double d; | |
| 120 | ||
| 121 | /* This is the IEEE 854 quad-precision format. */ | |
| 122 | struct | |
| 123 | { | |
| 124 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 125 | 	unsigned int negative:1; | |
| 126 | 	unsigned int exponent:15; | |
| 127 | 	/* Together these comprise the mantissa. */ | |
| 128 | 	unsigned int mantissa0:16; | |
| 129 | 	unsigned int mantissa1:32; | |
| 130 | 	unsigned int mantissa2:32; | |
| 131 | 	unsigned int mantissa3:32; | |
| 132 | #endif				/* Big endian. */ | |
| 133 | #if	__BYTE_ORDER == __LITTLE_ENDIAN | |
| 134 | 	/* Together these comprise the mantissa. */ | |
| 135 | 	unsigned int mantissa3:32; | |
| 136 | 	unsigned int mantissa2:32; | |
| 137 | 	unsigned int mantissa1:32; | |
| 138 | 	unsigned int mantissa0:16; | |
| 139 | 	unsigned int exponent:15; | |
| 140 | 	unsigned int negative:1; | |
| 141 | #endif				/* Little endian. */ | |
| 142 | } ieee; | |
| 143 | ||
| 144 | /* This format makes it easier to see if a NaN is a signalling NaN. */ | |
| 145 | struct | |
| 146 | { | |
| 147 | #if	__BYTE_ORDER == __BIG_ENDIAN | |
| 148 | 	unsigned int negative:1; | |
| 149 | 	unsigned int exponent:15; | |
| 150 | 	unsigned int quiet_nan:1; | |
| 151 | 	/* Together these comprise the mantissa. */ | |
| 152 | 	unsigned int mantissa0:15; | |
| 153 | 	unsigned int mantissa1:32; | |
| 154 | 	unsigned int mantissa2:32; | |
| 155 | 	unsigned int mantissa3:32; | |
| 156 | #else | |
| 157 | 	/* Together these comprise the mantissa. */ | |
| 158 | 	unsigned int mantissa3:32; | |
| 159 | 	unsigned int mantissa2:32; | |
| 160 | 	unsigned int mantissa1:32; | |
| 161 | 	unsigned int mantissa0:15; | |
| 162 | 	unsigned int quiet_nan:1; | |
| 163 | 	unsigned int exponent:15; | |
| 164 | 	unsigned int negative:1; | |
| 165 | #endif | |
| 166 | } ieee_nan; | |
| 167 | }; | |
| 168 | ||
| 169 | #define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ | |
| 170 | #endif | |
| 171 | ||
| 172 | ||
| 173 | #if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 || __GNUC_PREREQ (7, 0) | |
| 174 | /* IBM extended format for long double. | |
| 175 | ||
| 176 | Each long double is made up of two IEEE doubles. The value of the | |
| 177 | long double is the sum of the values of the two parts. The most | |
| 178 | significant part is required to be the value of the long double | |
| 179 | rounded to the nearest double, as specified by IEEE. For Inf | |
| 180 | values, the least significant part is required to be one of +0.0 or | |
| 181 | -0.0. No other requirements are made; so, for example, 1.0 may be | |
| 182 | represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a | |
| 183 | NaN is don't-care. */ | |
| 184 | union ibm_extended_long_double | |
| 185 | { | |
| 186 | # if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && __GNUC_PREREQ (7, 0) | |
| 187 | __ibm128 ld; | |
| 188 | # else | |
| 189 | long double ld; | |
| 190 | # endif | |
| 191 | union ieee754_double d[2]; | |
| 192 | }; | |
| 193 | #endif | |
| 194 | ||
| 195 | __END_DECLS | |
| 196 | ||
| 197 | #endif /* ieee754.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/sys/ptrace.h created+272| ... | ... | @@ -0,0 +1,272 @@ |
| 1 | /* `ptrace' debugger support interface. Linux/PowerPC version. | |
| 2 | Copyright (C) 2001-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; if not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_PTRACE_H | |
| 20 | #define _SYS_PTRACE_H	1 | |
| 21 | ||
| 22 | #include <features.h> | |
| 23 | #include <bits/types.h> | |
| 24 | ||
| 25 | __BEGIN_DECLS | |
| 26 | ||
| 27 | #if defined _LINUX_PTRACE_H || defined _ASM_POWERPC_PTRACE_H | |
| 28 | /* Do not let Linux headers macros interfere with enum __ptrace_request. */ | |
| 29 | # undef PTRACE_ATTACH | |
| 30 | # undef PTRACE_CONT | |
| 31 | # undef PTRACE_DETACH | |
| 32 | # undef PTRACE_GET_DEBUGREG | |
| 33 | # undef PTRACE_GETEVENTMSG | |
| 34 | # undef PTRACE_GETEVRREGS | |
| 35 | # undef PTRACE_GETFPREGS | |
| 36 | # undef PTRACE_GETREGS | |
| 37 | # undef PTRACE_GETREGS64 | |
| 38 | # undef PTRACE_GETREGSET | |
| 39 | # undef PTRACE_GETSIGINFO | |
| 40 | # undef PTRACE_GETSIGMASK | |
| 41 | # undef PTRACE_GET_SYSCALL_INFO | |
| 42 | # undef PTRACE_GETVRREGS | |
| 43 | # undef PTRACE_GETVSRREGS | |
| 44 | # undef PTRACE_INTERRUPT | |
| 45 | # undef PTRACE_KILL | |
| 46 | # undef PTRACE_LISTEN | |
| 47 | # undef PTRACE_PEEKDATA | |
| 48 | # undef PTRACE_PEEKSIGINFO | |
| 49 | # undef PTRACE_PEEKTEXT | |
| 50 | # undef PTRACE_POKEDATA | |
| 51 | # undef PTRACE_POKETEXT | |
| 52 | # undef PTRACE_SECCOMP_GET_FILTER | |
| 53 | # undef PTRACE_SECCOMP_GET_METADATA | |
| 54 | # undef PTRACE_SEIZE | |
| 55 | # undef PTRACE_SET_DEBUGREG | |
| 56 | # undef PTRACE_SETEVRREGS | |
| 57 | # undef PTRACE_SETFPREGS | |
| 58 | # undef PTRACE_SETOPTIONS | |
| 59 | # undef PTRACE_SETREGS | |
| 60 | # undef PTRACE_SETREGS64 | |
| 61 | # undef PTRACE_SETREGSET | |
| 62 | # undef PTRACE_SETSIGINFO | |
| 63 | # undef PTRACE_SETSIGMASK | |
| 64 | # undef PTRACE_SETVRREGS | |
| 65 | # undef PTRACE_SETVSRREGS | |
| 66 | # undef PTRACE_SINGLEBLOCK | |
| 67 | # undef PTRACE_SINGLESTEP | |
| 68 | # undef PTRACE_SYSCALL | |
| 69 | # undef PTRACE_SYSCALL_INFO_NONE | |
| 70 | # undef PTRACE_SYSCALL_INFO_ENTRY | |
| 71 | # undef PTRACE_SYSCALL_INFO_EXIT | |
| 72 | # undef PTRACE_SYSCALL_INFO_SECCOMP | |
| 73 | # undef PTRACE_SYSEMU | |
| 74 | # undef PTRACE_SYSEMU_SINGLESTEP | |
| 75 | # undef PTRACE_TRACEME | |
| 76 | #endif | |
| 77 | ||
| 78 | /* Type of the REQUEST argument to `ptrace.' */ | |
| 79 | enum __ptrace_request | |
| 80 | { | |
| 81 | /* Indicate that the process making this request should be traced. | |
| 82 | All signals received by this process can be intercepted by its | |
| 83 | parent, and its parent can use the other `ptrace' requests. */ | |
| 84 | PTRACE_TRACEME = 0, | |
| 85 | #define PT_TRACE_ME PTRACE_TRACEME | |
| 86 | ||
| 87 | /* Return the word in the process's text space at address ADDR. */ | |
| 88 | PTRACE_PEEKTEXT = 1, | |
| 89 | #define PT_READ_I PTRACE_PEEKTEXT | |
| 90 | ||
| 91 | /* Return the word in the process's data space at address ADDR. */ | |
| 92 | PTRACE_PEEKDATA = 2, | |
| 93 | #define PT_READ_D PTRACE_PEEKDATA | |
| 94 | ||
| 95 | /* Return the word in the process's user area at offset ADDR. */ | |
| 96 | PTRACE_PEEKUSER = 3, | |
| 97 | #define PT_READ_U PTRACE_PEEKUSER | |
| 98 | ||
| 99 | /* Write the word DATA into the process's text space at address ADDR. */ | |
| 100 | PTRACE_POKETEXT = 4, | |
| 101 | #define PT_WRITE_I PTRACE_POKETEXT | |
| 102 | ||
| 103 | /* Write the word DATA into the process's data space at address ADDR. */ | |
| 104 | PTRACE_POKEDATA = 5, | |
| 105 | #define PT_WRITE_D PTRACE_POKEDATA | |
| 106 | ||
| 107 | /* Write the word DATA into the process's user area at offset ADDR. */ | |
| 108 | PTRACE_POKEUSER = 6, | |
| 109 | #define PT_WRITE_U PTRACE_POKEUSER | |
| 110 | ||
| 111 | /* Continue the process. */ | |
| 112 | PTRACE_CONT = 7, | |
| 113 | #define PT_CONTINUE PTRACE_CONT | |
| 114 | ||
| 115 | /* Kill the process. */ | |
| 116 | PTRACE_KILL = 8, | |
| 117 | #define PT_KILL PTRACE_KILL | |
| 118 | ||
| 119 | /* Single step the process. */ | |
| 120 | PTRACE_SINGLESTEP = 9, | |
| 121 | #define PT_STEP PTRACE_SINGLESTEP | |
| 122 | ||
| 123 | /* Get all general purpose registers used by a process. */ | |
| 124 | PTRACE_GETREGS = 12, | |
| 125 | #define PT_GETREGS PTRACE_GETREGS | |
| 126 | ||
| 127 | /* Set all general purpose registers used by a process. */ | |
| 128 | PTRACE_SETREGS = 13, | |
| 129 | #define PT_SETREGS PTRACE_SETREGS | |
| 130 | ||
| 131 | /* Get all floating point registers used by a process. */ | |
| 132 | PTRACE_GETFPREGS = 14, | |
| 133 | #define PT_GETFPREGS PTRACE_GETFPREGS | |
| 134 | ||
| 135 | /* Set all floating point registers used by a process. */ | |
| 136 | PTRACE_SETFPREGS = 15, | |
| 137 | #define PT_SETFPREGS PTRACE_SETFPREGS | |
| 138 | ||
| 139 | /* Attach to a process that is already running. */ | |
| 140 | PTRACE_ATTACH = 16, | |
| 141 | #define PT_ATTACH PTRACE_ATTACH | |
| 142 | ||
| 143 | /* Detach from a process attached to with PTRACE_ATTACH. */ | |
| 144 | PTRACE_DETACH = 17, | |
| 145 | #define PT_DETACH PTRACE_DETACH | |
| 146 | ||
| 147 | /* Get all altivec registers used by a process. */ | |
| 148 | PTRACE_GETVRREGS = 18, | |
| 149 | #define PT_GETVRREGS PTRACE_GETVRREGS | |
| 150 | ||
| 151 | /* Set all altivec registers used by a process. */ | |
| 152 | PTRACE_SETVRREGS = 19, | |
| 153 | #define PT_SETVRREGS PTRACE_SETVRREGS | |
| 154 | ||
| 155 | /* Get all SPE registers used by a process. */ | |
| 156 | PTRACE_GETEVRREGS = 20, | |
| 157 | #define PT_GETEVRREGS PTRACE_GETEVRREGS | |
| 158 | ||
| 159 | /* Set all SPE registers used by a process. */ | |
| 160 | PTRACE_SETEVRREGS = 21, | |
| 161 | #define PT_SETEVRREGS PTRACE_SETEVRREGS | |
| 162 | ||
| 163 | /* Same as PTRACE_GETREGS except a 32-bit process will obtain | |
| 164 | the full 64-bit registers. Implemented by 64-bit kernels only. */ | |
| 165 | PTRACE_GETREGS64 = 22, | |
| 166 | #define PT_GETREGS64 PTRACE_GETREGS64 | |
| 167 | ||
| 168 | /* Same as PTRACE_SETREGS except a 32-bit process will set | |
| 169 | the full 64-bit registers. Implemented by 64-bit kernels only. */ | |
| 170 | PTRACE_SETREGS64 = 23, | |
| 171 | #define PT_SETREGS64 PTRACE_SETREGS64 | |
| 172 | ||
| 173 | /* Continue and stop at the next entry to or return from syscall. */ | |
| 174 | PTRACE_SYSCALL = 24, | |
| 175 | #define PT_SYSCALL PTRACE_SYSCALL | |
| 176 | ||
| 177 | /* Get a debug register of a process. */ | |
| 178 | PTRACE_GET_DEBUGREG = 25, | |
| 179 | #define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG | |
| 180 | ||
| 181 | /* Set a debug register of a process. */ | |
| 182 | PTRACE_SET_DEBUGREG = 26, | |
| 183 | #define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG | |
| 184 | ||
| 185 | /* Get the first 32 VSX registers of a process. */ | |
| 186 | PTRACE_GETVSRREGS = 27, | |
| 187 | #define PT_GETVSRREGS PTRACE_GETVSRREGS | |
| 188 | ||
| 189 | /* Set the first 32 VSX registers of a process. */ | |
| 190 | PTRACE_SETVSRREGS = 28, | |
| 191 | #define PT_SETVSRREGS PTRACE_SETVSRREGS | |
| 192 | ||
| 193 | /* Continue and stop at the next syscall, it will not be executed. */ | |
| 194 | PTRACE_SYSEMU = 29, | |
| 195 | #define PT_SYSEMU PTRACE_SYSEMU | |
| 196 | ||
| 197 | /* Single step the process, the next syscall will not be executed. */ | |
| 198 | PTRACE_SYSEMU_SINGLESTEP = 30, | |
| 199 | #define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP | |
| 200 | ||
| 201 | /* Execute process until next taken branch. */ | |
| 202 | PTRACE_SINGLEBLOCK = 256, | |
| 203 | #define PT_STEPBLOCK PTRACE_SINGLEBLOCK | |
| 204 | ||
| 205 | /* Set ptrace filter options. */ | |
| 206 | PTRACE_SETOPTIONS = 0x4200, | |
| 207 | #define PT_SETOPTIONS PTRACE_SETOPTIONS | |
| 208 | ||
| 209 | /* Get last ptrace message. */ | |
| 210 | PTRACE_GETEVENTMSG = 0x4201, | |
| 211 | #define PT_GETEVENTMSG PTRACE_GETEVENTMSG | |
| 212 | ||
| 213 | /* Get siginfo for process. */ | |
| 214 | PTRACE_GETSIGINFO = 0x4202, | |
| 215 | #define PT_GETSIGINFO PTRACE_GETSIGINFO | |
| 216 | ||
| 217 | /* Set new siginfo for process. */ | |
| 218 | PTRACE_SETSIGINFO = 0x4203, | |
| 219 | #define PT_SETSIGINFO PTRACE_SETSIGINFO | |
| 220 | ||
| 221 | /* Get register content. */ | |
| 222 | PTRACE_GETREGSET = 0x4204, | |
| 223 | #define PTRACE_GETREGSET PTRACE_GETREGSET | |
| 224 | ||
| 225 | /* Set register content. */ | |
| 226 | PTRACE_SETREGSET = 0x4205, | |
| 227 | #define PTRACE_SETREGSET PTRACE_SETREGSET | |
| 228 | ||
| 229 | /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect | |
| 230 | signal or group stop state. */ | |
| 231 | PTRACE_SEIZE = 0x4206, | |
| 232 | #define PTRACE_SEIZE PTRACE_SEIZE | |
| 233 | ||
| 234 | /* Trap seized tracee. */ | |
| 235 | PTRACE_INTERRUPT = 0x4207, | |
| 236 | #define PTRACE_INTERRUPT PTRACE_INTERRUPT | |
| 237 | ||
| 238 | /* Wait for next group event. */ | |
| 239 | PTRACE_LISTEN = 0x4208, | |
| 240 | #define PTRACE_LISTEN PTRACE_LISTEN | |
| 241 | ||
| 242 | /* Retrieve siginfo_t structures without removing signals from a queue. */ | |
| 243 | PTRACE_PEEKSIGINFO = 0x4209, | |
| 244 | #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO | |
| 245 | ||
| 246 | /* Get the mask of blocked signals. */ | |
| 247 | PTRACE_GETSIGMASK = 0x420a, | |
| 248 | #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK | |
| 249 | ||
| 250 | /* Change the mask of blocked signals. */ | |
| 251 | PTRACE_SETSIGMASK = 0x420b, | |
| 252 | #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK | |
| 253 | ||
| 254 | /* Get seccomp BPF filters. */ | |
| 255 | PTRACE_SECCOMP_GET_FILTER = 0x420c, | |
| 256 | #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER | |
| 257 | ||
| 258 | /* Get seccomp BPF filter metadata. */ | |
| 259 | PTRACE_SECCOMP_GET_METADATA = 0x420d, | |
| 260 | #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA | |
| 261 | ||
| 262 | /* Get information about system call. */ | |
| 263 | PTRACE_GET_SYSCALL_INFO = 0x420e | |
| 264 | #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO | |
| 265 | }; | |
| 266 | ||
| 267 | ||
| 268 | #include <bits/ptrace-shared.h> | |
| 269 | ||
| 270 | __END_DECLS | |
| 271 | ||
| 272 | #endif /* _SYS_PTRACE_H */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/sys/ucontext.h created+200| ... | ... | @@ -0,0 +1,200 @@ |
| 1 | /* Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_UCONTEXT_H | |
| 19 | #define _SYS_UCONTEXT_H	1 | |
| 20 | ||
| 21 | #include <features.h> | |
| 22 | ||
| 23 | #include <bits/types/sigset_t.h> | |
| 24 | #include <bits/types/stack_t.h> | |
| 25 | ||
| 26 | ||
| 27 | #ifdef __USE_MISC | |
| 28 | # define __ctx(fld) fld | |
| 29 | #else | |
| 30 | # define __ctx(fld) __ ## fld | |
| 31 | #endif | |
| 32 | ||
| 33 | struct __ctx(pt_regs); | |
| 34 | ||
| 35 | #if __WORDSIZE == 32 | |
| 36 | ||
| 37 | /* Number of general registers. */ | |
| 38 | # define __NGREG	48 | |
| 39 | # ifdef __USE_MISC | |
| 40 | # define NGREG	__NGREG | |
| 41 | # endif | |
| 42 | ||
| 43 | /* Container for all general registers. */ | |
| 44 | typedef unsigned long gregset_t[__NGREG]; | |
| 45 | ||
| 46 | /* Container for floating-point registers and status */ | |
| 47 | typedef struct _libc_fpstate | |
| 48 | { | |
| 49 | 	double __ctx(fpregs)[32]; | |
| 50 | 	double __ctx(fpscr); | |
| 51 | 	unsigned int _pad[2]; | |
| 52 | } fpregset_t; | |
| 53 | ||
| 54 | /* Container for Altivec/VMX registers and status. | |
| 55 | Needs to be aligned on a 16-byte boundary. */ | |
| 56 | typedef struct _libc_vrstate | |
| 57 | { | |
| 58 | 	unsigned int __ctx(vrregs)[32][4]; | |
| 59 | 	unsigned int __ctx(vrsave); | |
| 60 | 	unsigned int _pad[2]; | |
| 61 | 	unsigned int __ctx(vscr); | |
| 62 | } vrregset_t; | |
| 63 | ||
| 64 | /* Context to describe whole processor state. */ | |
| 65 | typedef struct | |
| 66 | { | |
| 67 | 	gregset_t __ctx(gregs); | |
| 68 | 	fpregset_t __ctx(fpregs); | |
| 69 | 	vrregset_t __ctx(vrregs) __attribute__((__aligned__(16))); | |
| 70 | } mcontext_t; | |
| 71 | ||
| 72 | #else | |
| 73 | ||
| 74 | /* For 64-bit kernels with Altivec support, a machine context is exactly | |
| 75 | * a sigcontext. For older kernel (without Altivec) the sigcontext matches | |
| 76 | * the mcontext upto but not including the v_regs field. For kernels that | |
| 77 | * don't set AT_HWCAP or return AT_HWCAP without PPC_FEATURE_HAS_ALTIVEC the | |
| 78 | * v_regs field may not exist and should not be referenced. The v_regs field | |
| 79 | * can be referenced safely only after verifying that PPC_FEATURE_HAS_ALTIVEC | |
| 80 | * is set in AT_HWCAP. */ | |
| 81 | ||
| 82 | /* Number of general registers. */ | |
| 83 | # define __NGREG	48	/* includes r0-r31, nip, msr, lr, etc. */ | |
| 84 | # define __NFPREG	33	/* includes fp0-fp31 &fpscr. */ | |
| 85 | # define __NVRREG	34	/* includes v0-v31, vscr, & vrsave in | |
| 86 | 				 split vectors */ | |
| 87 | # ifdef __USE_MISC | |
| 88 | # define NGREG	__NGREG | |
| 89 | # define NFPREG	__NFPREG | |
| 90 | # define NVRREG	__NVRREG | |
| 91 | # endif | |
| 92 | ||
| 93 | typedef unsigned long gregset_t[__NGREG]; | |
| 94 | typedef double fpregset_t[__NFPREG]; | |
| 95 | ||
| 96 | /* Container for Altivec/VMX Vector Status and Control Register. Only 32-bits | |
| 97 | but can only be copied to/from a 128-bit vector register. So we allocated | |
| 98 | a whole quadword speedup save/restore. */ | |
| 99 | typedef struct _libc_vscr | |
| 100 | { | |
| 101 | #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ | |
| 102 | 	unsigned int __pad[3]; | |
| 103 | 	unsigned int __ctx(vscr_word); | |
| 104 | #else | |
| 105 | 	unsigned int __ctx(vscr_word); | |
| 106 | 	unsigned int __pad[3]; | |
| 107 | #endif | |
| 108 | } vscr_t; | |
| 109 | ||
| 110 | /* Container for Altivec/VMX registers and status. | |
| 111 | Must to be aligned on a 16-byte boundary. */ | |
| 112 | typedef struct _libc_vrstate | |
| 113 | { | |
| 114 | 	unsigned int	__ctx(vrregs)[32][4]; | |
| 115 | 	vscr_t		__ctx(vscr); | |
| 116 | 	unsigned int	__ctx(vrsave); | |
| 117 | 	unsigned int	__pad[3]; | |
| 118 | } vrregset_t __attribute__((__aligned__(16))); | |
| 119 | ||
| 120 | typedef struct { | |
| 121 | 	unsigned long	__glibc_reserved[4]; | |
| 122 | 	int		__ctx(signal); | |
| 123 | 	int		__pad0; | |
| 124 | 	unsigned long	__ctx(handler); | |
| 125 | 	unsigned long	__ctx(oldmask); | |
| 126 | 	struct __ctx(pt_regs)	*__ctx(regs); | |
| 127 | 	gregset_t	__ctx(gp_regs); | |
| 128 | 	fpregset_t	__ctx(fp_regs); | |
| 129 | /* | |
| 130 | * To maintain compatibility with current implementations the sigcontext is | |
| 131 | * extended by appending a pointer (v_regs) to a quadword type (elf_vrreg_t) | |
| 132 | * followed by an unstructured (vmx_reserve) field of 69 doublewords. This | |
| 133 | * allows the array of vector registers to be quadword aligned independent of | |
| 134 | * the alignment of the containing sigcontext or ucontext. It is the | |
| 135 | * responsibility of the code setting the sigcontext to set this pointer to | |
| 136 | * either NULL (if this processor does not support the VMX feature) or the | |
| 137 | * address of the first quadword within the allocated (vmx_reserve) area. | |
| 138 | * | |
| 139 | * The pointer (v_regs) of vector type (elf_vrreg_t) is essentially | |
| 140 | * an array of 34 quadword entries. The entries with | |
| 141 | * indexes 0-31 contain the corresponding vector registers. The entry with | |
| 142 | * index 32 contains the vscr as the last word (offset 12) within the | |
| 143 | * quadword. This allows the vscr to be stored as either a quadword (since | |
| 144 | * it must be copied via a vector register to/from storage) or as a word. | |
| 145 | * The entry with index 33 contains the vrsave as the first word (offset 0) | |
| 146 | * within the quadword. | |
| 147 | */ | |
| 148 | 	vrregset_t	*__ctx(v_regs); | |
| 149 | 	long		__ctx(vmx_reserve)[__NVRREG+__NVRREG+1]; | |
| 150 | } mcontext_t; | |
| 151 | ||
| 152 | #endif | |
| 153 | ||
| 154 | /* Userlevel context. */ | |
| 155 | typedef struct ucontext_t | |
| 156 | { | |
| 157 | unsigned long int __ctx(uc_flags); | |
| 158 | struct ucontext_t *uc_link; | |
| 159 | stack_t uc_stack; | |
| 160 | #if __WORDSIZE == 32 | |
| 161 | /* | |
| 162 | * These fields are set up this way to maximize source and | |
| 163 | * binary compatibility with code written for the old | |
| 164 | * ucontext_t definition, which didn't include space for the | |
| 165 | * registers. | |
| 166 | * | |
| 167 | * Different versions of the kernel have stored the registers on | |
| 168 | * signal delivery at different offsets from the ucontext struct. | |
| 169 | * Programs should thus use the uc_mcontext.uc_regs pointer to | |
| 170 | * find where the registers are actually stored. The registers | |
| 171 | * will be stored within the ucontext_t struct but not necessarily | |
| 172 | * at a fixed address. As a side-effect, this lets us achieve | |
| 173 | * 16-byte alignment for the register storage space if the | |
| 174 | * Altivec registers are to be saved, without requiring 16-byte | |
| 175 | * alignment on the whole ucontext_t. | |
| 176 | * | |
| 177 | * The uc_mcontext.regs field is included for source compatibility | |
| 178 | * with programs written against the older ucontext_t definition, | |
| 179 | * and its name should therefore not change. The uc_pad field | |
| 180 | * is for binary compatibility with programs compiled against the | |
| 181 | * old ucontext_t; it ensures that uc_mcontext.regs and uc_sigmask | |
| 182 | * are at the same offset as previously. | |
| 183 | */ | |
| 184 | int __glibc_reserved1[7]; | |
| 185 | union __ctx(uc_regs_ptr) { | |
| 186 | struct __ctx(pt_regs) *__ctx(regs); | |
| 187 | mcontext_t *__ctx(uc_regs); | |
| 188 | } uc_mcontext; | |
| 189 | sigset_t uc_sigmask; | |
| 190 | /* last for extensibility */ | |
| 191 | char __ctx(uc_reg_space)[sizeof (mcontext_t) + 12]; | |
| 192 | #else /* 64-bit */ | |
| 193 | sigset_t uc_sigmask; | |
| 194 | mcontext_t uc_mcontext; /* last for extensibility */ | |
| 195 | #endif | |
| 196 | } ucontext_t; | |
| 197 | ||
| 198 | #undef __ctx | |
| 199 | ||
| 200 | #endif /* sys/ucontext.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc-linux-gnueabihf/sys/user.h created+40| ... | ... | @@ -0,0 +1,40 @@ |
| 1 | /* Copyright (C) 1998-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | ||
| 4 | The GNU C Library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | The GNU C Library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with the GNU C Library; if not, see | |
| 16 | <https://www.gnu.org/licenses/>. */ | |
| 17 | ||
| 18 | #ifndef _SYS_USER_H | |
| 19 | ||
| 20 | #define _SYS_USER_H	1 | |
| 21 | #include <stddef.h> | |
| 22 | #include <features.h> | |
| 23 | ||
| 24 | #include <asm/ptrace.h> | |
| 25 | ||
| 26 | struct user { | |
| 27 | 	struct pt_regs	regs;			/* entire machine state */ | |
| 28 | 	size_t		u_tsize;		/* text size (pages) */ | |
| 29 | 	size_t		u_dsize;		/* data size (pages) */ | |
| 30 | 	size_t		u_ssize;		/* stack size (pages) */ | |
| 31 | 	unsigned long	start_code;		/* text starting address */ | |
| 32 | 	unsigned long	start_data;		/* data starting address */ | |
| 33 | 	unsigned long	start_stack;		/* stack starting address */ | |
| 34 | 	long int	signal;			/* signal causing core dump */ | |
| 35 | 	struct regs *	u_ar0;			/* help gdb find registers */ | |
| 36 | 	unsigned long	magic;			/* identifies a core file */ | |
| 37 | 	char		u_comm[32];		/* user command name */ | |
| 38 | }; | |
| 39 | ||
| 40 | #endif /* sys/user.h */ | |
| \ No newline at end of file |
lib/libc/include/powerpc64-linux-gnu/bits/local_lim.h deleted-100| ... | ... | @@ -1,100 +0,0 @@ |
| 1 | /* Minimum guaranteed maximum values for system limits. Linux/PPC version. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; see the file COPYING.LIB. If | |
| 17 | not, see <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* The kernel header pollutes the namespace with the NR_OPEN symbol | |
| 20 | and defines LINK_MAX although filesystems have different maxima. A | |
| 21 | similar thing is true for OPEN_MAX: the limit can be changed at | |
| 22 | runtime and therefore the macro must not be defined. Remove this | |
| 23 | after including the header if necessary. */ | |
| 24 | #ifndef NR_OPEN | |
| 25 | # define __undef_NR_OPEN | |
| 26 | #endif | |
| 27 | #ifndef LINK_MAX | |
| 28 | # define __undef_LINK_MAX | |
| 29 | #endif | |
| 30 | #ifndef OPEN_MAX | |
| 31 | # define __undef_OPEN_MAX | |
| 32 | #endif | |
| 33 | #ifndef ARG_MAX | |
| 34 | # define __undef_ARG_MAX | |
| 35 | #endif | |
| 36 | ||
| 37 | /* The kernel sources contain a file with all the needed information. */ | |
| 38 | #include <linux/limits.h> | |
| 39 | ||
| 40 | /* Have to remove NR_OPEN? */ | |
| 41 | #ifdef __undef_NR_OPEN | |
| 42 | # undef NR_OPEN | |
| 43 | # undef __undef_NR_OPEN | |
| 44 | #endif | |
| 45 | /* Have to remove LINK_MAX? */ | |
| 46 | #ifdef __undef_LINK_MAX | |
| 47 | # undef LINK_MAX | |
| 48 | # undef __undef_LINK_MAX | |
| 49 | #endif | |
| 50 | /* Have to remove OPEN_MAX? */ | |
| 51 | #ifdef __undef_OPEN_MAX | |
| 52 | # undef OPEN_MAX | |
| 53 | # undef __undef_OPEN_MAX | |
| 54 | #endif | |
| 55 | /* Have to remove ARG_MAX? */ | |
| 56 | #ifdef __undef_ARG_MAX | |
| 57 | # undef ARG_MAX | |
| 58 | # undef __undef_ARG_MAX | |
| 59 | #endif | |
| 60 | ||
| 61 | /* The number of data keys per process. */ | |
| 62 | #define _POSIX_THREAD_KEYS_MAX	128 | |
| 63 | /* This is the value this implementation supports. */ | |
| 64 | #define PTHREAD_KEYS_MAX	1024 | |
| 65 | ||
| 66 | /* Controlling the iterations of destructors for thread-specific data. */ | |
| 67 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4 | |
| 68 | /* Number of iterations this implementation does. */ | |
| 69 | #define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS | |
| 70 | ||
| 71 | /* The number of threads per process. */ | |
| 72 | #define _POSIX_THREAD_THREADS_MAX	64 | |
| 73 | /* We have no predefined limit on the number of threads. */ | |
| 74 | #undef PTHREAD_THREADS_MAX | |
| 75 | ||
| 76 | /* Maximum amount by which a process can descrease its asynchronous I/O | |
| 77 | priority level. */ | |
| 78 | #define AIO_PRIO_DELTA_MAX	20 | |
| 79 | ||
| 80 | /* Minimum size for a thread. At least two pages for systems with 64k | |
| 81 | pages. */ | |
| 82 | #define PTHREAD_STACK_MIN	131072 | |
| 83 | ||
| 84 | /* Maximum number of timer expiration overruns. */ | |
| 85 | #define DELAYTIMER_MAX	2147483647 | |
| 86 | ||
| 87 | /* Maximum tty name length. */ | |
| 88 | #define TTY_NAME_MAX		32 | |
| 89 | ||
| 90 | /* Maximum login name length. This is arbitrary. */ | |
| 91 | #define LOGIN_NAME_MAX		256 | |
| 92 | ||
| 93 | /* Maximum host name length. */ | |
| 94 | #define HOST_NAME_MAX		64 | |
| 95 | ||
| 96 | /* Maximum message queue priority level. */ | |
| 97 | #define MQ_PRIO_MAX		32768 | |
| 98 | ||
| 99 | /* Maximum value the semaphore can have. */ | |
| 100 | #define SEM_VALUE_MAX (2147483647) | |
| \ No newline at end of file |
lib/libc/include/powerpc64-linux-gnu/bits/pthread_stack_min.h created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. Linux/PPC version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; see the file COPYING.LIB. If | |
| 17 | not, see <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. At least two pages for systems with 64k | |
| 20 | pages. */ | |
| 21 | #define PTHREAD_STACK_MIN	131072 | |
| \ No newline at end of file |
lib/libc/include/powerpc64-linux-gnu/bits/socket-constants.h+35-3| ... | ... | @@ -30,9 +30,41 @@ |
| 30 | 30 | #define SO_OOBINLINE 10 |
| 31 | 31 | #define SO_RCVBUF 8 |
| 32 | 32 | #define SO_RCVLOWAT 16 |
| 33 | #define SO_RCVTIMEO 18 | |
| 34 | 33 | #define SO_REUSEADDR 2 |
| 35 | 34 | #define SO_SNDBUF 7 |
| 36 | 35 | #define SO_SNDLOWAT 17 |
| 37 | #define SO_SNDTIMEO 19 | |
| 38 | #define SO_TYPE 3 | |
| \ No newline at end of file | ||
| 36 | #define SO_TYPE 3 | |
| 37 | ||
| 38 | #if __TIMESIZE == 64 | |
| 39 | # define SO_RCVTIMEO 18 | |
| 40 | # define SO_SNDTIMEO 19 | |
| 41 | # define SO_TIMESTAMP 29 | |
| 42 | # define SO_TIMESTAMPNS 35 | |
| 43 | # define SO_TIMESTAMPING 37 | |
| 44 | #else | |
| 45 | # define SO_RCVTIMEO_OLD 18 | |
| 46 | # define SO_SNDTIMEO_OLD 19 | |
| 47 | # define SO_RCVTIMEO_NEW 66 | |
| 48 | # define SO_SNDTIMEO_NEW 67 | |
| 49 | ||
| 50 | # define SO_TIMESTAMP_OLD 29 | |
| 51 | # define SO_TIMESTAMPNS_OLD 35 | |
| 52 | # define SO_TIMESTAMPING_OLD 37 | |
| 53 | # define SO_TIMESTAMP_NEW 63 | |
| 54 | # define SO_TIMESTAMPNS_NEW 64 | |
| 55 | # define SO_TIMESTAMPING_NEW 65 | |
| 56 | ||
| 57 | # ifdef __USE_TIME_BITS64 | |
| 58 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 59 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 60 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 61 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 62 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 63 | # else | |
| 64 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 65 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 66 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 67 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 68 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 69 | # endif | |
| 70 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc64-linux-gnu/bits/struct_stat.h+29-23| ... | ... | @@ -26,35 +26,37 @@ |
| 26 | 26 | #include <bits/wordsize.h> |
| 27 | 27 | |
| 28 | 28 | #if __WORDSIZE == 32 |
| 29 | ||
| 30 | 29 | struct stat |
| 31 | 30 | { |
| 31 | # ifdef __USE_TIME_BITS64 | |
| 32 | # include <bits/struct_stat_time64_helper.h> | |
| 33 | # else | |
| 32 | 34 | __dev_t st_dev;			/* Device. */ |
| 33 | # ifndef __USE_FILE_OFFSET64 | |
| 35 | # ifndef __USE_FILE_OFFSET64 | |
| 34 | 36 | unsigned short int __pad1; |
| 35 | 37 | __ino_t st_ino;			/* File serial number.	*/ |
| 36 | # else | |
| 38 | # else | |
| 37 | 39 | __ino64_t st_ino;			/* File serial number.	*/ |
| 38 | # endif | |
| 40 | # endif | |
| 39 | 41 | __mode_t st_mode;			/* File mode. */ |
| 40 | 42 | __nlink_t st_nlink;			/* Link count. */ |
| 41 | 43 | __uid_t st_uid;			/* User ID of the file's owner.	*/ |
| 42 | 44 | __gid_t st_gid;			/* Group ID of the file's group.*/ |
| 43 | 45 | __dev_t st_rdev;			/* Device number, if device. */ |
| 44 | 46 | unsigned short int __pad2; |
| 45 | # ifndef __USE_FILE_OFFSET64 | |
| 47 | # ifndef __USE_FILE_OFFSET64 | |
| 46 | 48 | __off_t st_size;			/* Size of file, in bytes. */ |
| 47 | # else | |
| 49 | # else | |
| 48 | 50 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 49 | # endif | |
| 51 | # endif | |
| 50 | 52 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 51 | 53 | |
| 52 | # ifndef __USE_FILE_OFFSET64 | |
| 54 | # ifndef __USE_FILE_OFFSET64 | |
| 53 | 55 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 54 | # else | |
| 56 | # else | |
| 55 | 57 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 56 | # endif | |
| 57 | # ifdef __USE_XOPEN2K8 | |
| 58 | # endif | |
| 59 | # ifdef __USE_XOPEN2K8 | |
| 58 | 60 | /* Nanosecond resolution timestamps are stored in a format |
| 59 | 61 | equivalent to 'struct timespec'. This is the type used |
| 60 | 62 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -64,25 +66,28 @@ struct stat |
| 64 | 66 | struct timespec st_atim;		/* Time of last access. */ |
| 65 | 67 | struct timespec st_mtim;		/* Time of last modification. */ |
| 66 | 68 | struct timespec st_ctim;		/* Time of last status change. */ |
| 67 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 68 | # define st_mtime st_mtim.tv_sec | |
| 69 | # define st_ctime st_ctim.tv_sec | |
| 70 | # else | |
| 69 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 70 | # define st_mtime st_mtim.tv_sec | |
| 71 | # define st_ctime st_ctim.tv_sec | |
| 72 | # else | |
| 71 | 73 | __time_t st_atime;			/* Time of last access. */ |
| 72 | 74 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 73 | 75 | __time_t st_mtime;			/* Time of last modification. */ |
| 74 | 76 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 75 | 77 | __time_t st_ctime;			/* Time of last status change. */ |
| 76 | 78 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 77 | # endif | |
| 79 | # endif | |
| 78 | 80 | unsigned long int __glibc_reserved4; |
| 79 | 81 | unsigned long int __glibc_reserved5; |
| 82 | # endif /* __USE_TIME_BITS64 */ | |
| 80 | 83 | }; |
| 81 | 84 | |
| 82 | ||
| 83 | 85 | # ifdef __USE_LARGEFILE64 |
| 84 | 86 | struct stat64 |
| 85 | 87 | { |
| 88 | # ifdef __USE_TIME_BITS64 | |
| 89 | # include <bits/struct_stat_time64_helper.h> | |
| 90 | # else | |
| 86 | 91 | __dev_t st_dev;			/* Device. */ |
| 87 | 92 | __ino64_t st_ino;			/* File serial number.	*/ |
| 88 | 93 | __mode_t st_mode;			/* File mode. */ |
| ... | ... | @@ -94,7 +99,7 @@ struct stat64 |
| 94 | 99 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 95 | 100 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 96 | 101 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 97 | # ifdef __USE_XOPEN2K8 | |
| 102 | # ifdef __USE_XOPEN2K8 | |
| 98 | 103 | /* Nanosecond resolution timestamps are stored in a format |
| 99 | 104 | equivalent to 'struct timespec'. This is the type used |
| 100 | 105 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -104,19 +109,20 @@ struct stat64 |
| 104 | 109 | struct timespec st_atim;		/* Time of last access. */ |
| 105 | 110 | struct timespec st_mtim;		/* Time of last modification. */ |
| 106 | 111 | struct timespec st_ctim;		/* Time of last status change. */ |
| 107 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 108 | # define st_mtime st_mtim.tv_sec | |
| 109 | # define st_ctime st_ctim.tv_sec | |
| 110 | # else | |
| 112 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 113 | # define st_mtime st_mtim.tv_sec | |
| 114 | # define st_ctime st_ctim.tv_sec | |
| 115 | # else | |
| 111 | 116 | __time_t st_atime;			/* Time of last access. */ |
| 112 | 117 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 113 | 118 | __time_t st_mtime;			/* Time of last modification. */ |
| 114 | 119 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 115 | 120 | __time_t st_ctime;			/* Time of last status change. */ |
| 116 | 121 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 117 | # endif | |
| 122 | # endif | |
| 118 | 123 | unsigned long int __glibc_reserved4; |
| 119 | 124 | unsigned long int __glibc_reserved5; |
| 125 | # endif /* __USE_TIME_BITS64 */ | |
| 120 | 126 | }; |
| 121 | 127 | # endif /* __USE_LARGEFILE64 */ |
| 122 | 128 |
lib/libc/include/powerpc64-linux-gnu/bits/types/struct_msqid_ds.h+9-3| ... | ... | @@ -20,23 +20,28 @@ |
| 20 | 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." |
| 21 | 21 | #endif |
| 22 | 22 | |
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 23 | 25 | /* Structure of record for one message inside the kernel. |
| 24 | 26 | The type `struct msg' is opaque. */ |
| 25 | 27 | struct msqid_ds |
| 26 | 28 | { |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 27 | 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ |
| 28 | #if __TIMESIZE == 32 | |
| 33 | # if __TIMESIZE == 32 | |
| 29 | 34 | unsigned long int __msg_stime_high; |
| 30 | 35 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 31 | 36 | unsigned long int __msg_rtime_high; |
| 32 | 37 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 33 | 38 | unsigned long int __msg_ctime_high; |
| 34 | 39 | __time_t msg_ctime;		/* time of last change */ |
| 35 | #else | |
| 40 | # else | |
| 36 | 41 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 37 | 42 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 38 | 43 | __time_t msg_ctime;		/* time of last change */ |
| 39 | #endif | |
| 44 | # endif | |
| 40 | 45 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ |
| 41 | 46 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ |
| 42 | 47 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ |
| ... | ... | @@ -44,4 +49,5 @@ struct msqid_ds |
| 44 | 49 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ |
| 45 | 50 | __syscall_ulong_t __glibc_reserved4; |
| 46 | 51 | __syscall_ulong_t __glibc_reserved5; |
| 52 | #endif | |
| 47 | 53 | }; |
| \ No newline at end of file |
lib/libc/include/powerpc64-linux-gnu/bits/types/struct_semid_ds.h+7-3| ... | ... | @@ -23,17 +23,21 @@ |
| 23 | 23 | /* Data structure describing a set of semaphores. */ |
| 24 | 24 | struct semid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm sem_perm; /* operation permission struct */ |
| 27 | #if __TIMESIZE == 32 | |
| 30 | # if __TIMESIZE == 32 | |
| 28 | 31 | __syscall_ulong_t __sem_otime_high; |
| 29 | 32 | __time_t sem_otime; /* last semop() time */ |
| 30 | 33 | __syscall_ulong_t __sem_ctime_high; |
| 31 | 34 | __time_t sem_ctime; /* last time changed by semctl() */ |
| 32 | #else | |
| 35 | # else | |
| 33 | 36 | __time_t sem_otime; /* last semop() time */ |
| 34 | 37 | __time_t sem_ctime; /* last time changed by semctl() */ |
| 35 | #endif | |
| 38 | # endif | |
| 36 | 39 | __syscall_ulong_t sem_nsems; /* number of semaphores in set */ |
| 37 | 40 | __syscall_ulong_t __glibc_reserved3; |
| 38 | 41 | __syscall_ulong_t __glibc_reserved4; |
| 42 | #endif | |
| 39 | 43 | }; |
| \ No newline at end of file |
lib/libc/include/powerpc64-linux-gnu/bits/types/struct_shmid_ds.h+7-3| ... | ... | @@ -23,8 +23,11 @@ |
| 23 | 23 | /* Data structure describing a shared memory segment. */ |
| 24 | 24 | struct shmid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm shm_perm;		/* operation permission struct */ |
| 27 | #if __TIMESIZE == 32 | |
| 30 | # if __TIMESIZE == 32 | |
| 28 | 31 | unsigned long int __shm_atime_high; |
| 29 | 32 | __time_t shm_atime;			/* time of last shmat() */ |
| 30 | 33 | unsigned long int __shm_dtime_high; |
| ... | ... | @@ -32,15 +35,16 @@ struct shmid_ds |
| 32 | 35 | unsigned long int __shm_ctime_high; |
| 33 | 36 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 34 | 37 | unsigned long int __glibc_reserved4; |
| 35 | #else | |
| 38 | # else | |
| 36 | 39 | __time_t shm_atime;			/* time of last shmat() */ |
| 37 | 40 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 38 | 41 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 39 | #endif | |
| 42 | # endif | |
| 40 | 43 | size_t shm_segsz;			/* size of segment in bytes */ |
| 41 | 44 | __pid_t shm_cpid;			/* pid of creator */ |
| 42 | 45 | __pid_t shm_lpid;			/* pid of last shmop */ |
| 43 | 46 | shmatt_t shm_nattch;		/* number of current attaches */ |
| 44 | 47 | __syscall_ulong_t __glibc_reserved5; |
| 45 | 48 | __syscall_ulong_t __glibc_reserved6; |
| 49 | #endif | |
| 46 | 50 | }; |
| \ No newline at end of file |
lib/libc/include/powerpc64-linux-gnu/gnu/lib-names-64-v1.h+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | #define LIBANL_SO "libanl.so.1" |
| 9 | 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 10 | 10 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | 12 | #define LIBC_SO "libc.so.6" |
| 12 | 13 | #define LIBDL_SO "libdl.so.2" |
| 13 | 14 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/powerpc64-linux-gnu/sys/ptrace.h+10| ... | ... | @@ -70,6 +70,8 @@ __BEGIN_DECLS |
| 70 | 70 | # undef PTRACE_SYSCALL_INFO_ENTRY |
| 71 | 71 | # undef PTRACE_SYSCALL_INFO_EXIT |
| 72 | 72 | # undef PTRACE_SYSCALL_INFO_SECCOMP |
| 73 | # undef PTRACE_SYSEMU | |
| 74 | # undef PTRACE_SYSEMU_SINGLESTEP | |
| 73 | 75 | # undef PTRACE_TRACEME |
| 74 | 76 | #endif |
| 75 | 77 | |
| ... | ... | @@ -188,6 +190,14 @@ enum __ptrace_request |
| 188 | 190 | PTRACE_SETVSRREGS = 28, |
| 189 | 191 | #define PT_SETVSRREGS PTRACE_SETVSRREGS |
| 190 | 192 | |
| 193 | /* Continue and stop at the next syscall, it will not be executed. */ | |
| 194 | PTRACE_SYSEMU = 29, | |
| 195 | #define PT_SYSEMU PTRACE_SYSEMU | |
| 196 | ||
| 197 | /* Single step the process, the next syscall will not be executed. */ | |
| 198 | PTRACE_SYSEMU_SINGLESTEP = 30, | |
| 199 | #define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP | |
| 200 | ||
| 191 | 201 | /* Execute process until next taken branch. */ |
| 192 | 202 | PTRACE_SINGLEBLOCK = 256, |
| 193 | 203 | #define PT_STEPBLOCK PTRACE_SINGLEBLOCK |
lib/libc/include/powerpc64le-linux-gnu/bits/local_lim.h deleted-100| ... | ... | @@ -1,100 +0,0 @@ |
| 1 | /* Minimum guaranteed maximum values for system limits. Linux/PPC version. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; see the file COPYING.LIB. If | |
| 17 | not, see <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* The kernel header pollutes the namespace with the NR_OPEN symbol | |
| 20 | and defines LINK_MAX although filesystems have different maxima. A | |
| 21 | similar thing is true for OPEN_MAX: the limit can be changed at | |
| 22 | runtime and therefore the macro must not be defined. Remove this | |
| 23 | after including the header if necessary. */ | |
| 24 | #ifndef NR_OPEN | |
| 25 | # define __undef_NR_OPEN | |
| 26 | #endif | |
| 27 | #ifndef LINK_MAX | |
| 28 | # define __undef_LINK_MAX | |
| 29 | #endif | |
| 30 | #ifndef OPEN_MAX | |
| 31 | # define __undef_OPEN_MAX | |
| 32 | #endif | |
| 33 | #ifndef ARG_MAX | |
| 34 | # define __undef_ARG_MAX | |
| 35 | #endif | |
| 36 | ||
| 37 | /* The kernel sources contain a file with all the needed information. */ | |
| 38 | #include <linux/limits.h> | |
| 39 | ||
| 40 | /* Have to remove NR_OPEN? */ | |
| 41 | #ifdef __undef_NR_OPEN | |
| 42 | # undef NR_OPEN | |
| 43 | # undef __undef_NR_OPEN | |
| 44 | #endif | |
| 45 | /* Have to remove LINK_MAX? */ | |
| 46 | #ifdef __undef_LINK_MAX | |
| 47 | # undef LINK_MAX | |
| 48 | # undef __undef_LINK_MAX | |
| 49 | #endif | |
| 50 | /* Have to remove OPEN_MAX? */ | |
| 51 | #ifdef __undef_OPEN_MAX | |
| 52 | # undef OPEN_MAX | |
| 53 | # undef __undef_OPEN_MAX | |
| 54 | #endif | |
| 55 | /* Have to remove ARG_MAX? */ | |
| 56 | #ifdef __undef_ARG_MAX | |
| 57 | # undef ARG_MAX | |
| 58 | # undef __undef_ARG_MAX | |
| 59 | #endif | |
| 60 | ||
| 61 | /* The number of data keys per process. */ | |
| 62 | #define _POSIX_THREAD_KEYS_MAX	128 | |
| 63 | /* This is the value this implementation supports. */ | |
| 64 | #define PTHREAD_KEYS_MAX	1024 | |
| 65 | ||
| 66 | /* Controlling the iterations of destructors for thread-specific data. */ | |
| 67 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4 | |
| 68 | /* Number of iterations this implementation does. */ | |
| 69 | #define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS | |
| 70 | ||
| 71 | /* The number of threads per process. */ | |
| 72 | #define _POSIX_THREAD_THREADS_MAX	64 | |
| 73 | /* We have no predefined limit on the number of threads. */ | |
| 74 | #undef PTHREAD_THREADS_MAX | |
| 75 | ||
| 76 | /* Maximum amount by which a process can descrease its asynchronous I/O | |
| 77 | priority level. */ | |
| 78 | #define AIO_PRIO_DELTA_MAX	20 | |
| 79 | ||
| 80 | /* Minimum size for a thread. At least two pages for systems with 64k | |
| 81 | pages. */ | |
| 82 | #define PTHREAD_STACK_MIN	131072 | |
| 83 | ||
| 84 | /* Maximum number of timer expiration overruns. */ | |
| 85 | #define DELAYTIMER_MAX	2147483647 | |
| 86 | ||
| 87 | /* Maximum tty name length. */ | |
| 88 | #define TTY_NAME_MAX		32 | |
| 89 | ||
| 90 | /* Maximum login name length. This is arbitrary. */ | |
| 91 | #define LOGIN_NAME_MAX		256 | |
| 92 | ||
| 93 | /* Maximum host name length. */ | |
| 94 | #define HOST_NAME_MAX		64 | |
| 95 | ||
| 96 | /* Maximum message queue priority level. */ | |
| 97 | #define MQ_PRIO_MAX		32768 | |
| 98 | ||
| 99 | /* Maximum value the semaphore can have. */ | |
| 100 | #define SEM_VALUE_MAX (2147483647) | |
| \ No newline at end of file |
lib/libc/include/powerpc64le-linux-gnu/bits/pthread_stack_min.h created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. Linux/PPC version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public License as | |
| 7 | published by the Free Software Foundation; either version 2.1 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library; see the file COPYING.LIB. If | |
| 17 | not, see <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. At least two pages for systems with 64k | |
| 20 | pages. */ | |
| 21 | #define PTHREAD_STACK_MIN	131072 | |
| \ No newline at end of file |
lib/libc/include/powerpc64le-linux-gnu/bits/socket-constants.h+35-3| ... | ... | @@ -30,9 +30,41 @@ |
| 30 | 30 | #define SO_OOBINLINE 10 |
| 31 | 31 | #define SO_RCVBUF 8 |
| 32 | 32 | #define SO_RCVLOWAT 16 |
| 33 | #define SO_RCVTIMEO 18 | |
| 34 | 33 | #define SO_REUSEADDR 2 |
| 35 | 34 | #define SO_SNDBUF 7 |
| 36 | 35 | #define SO_SNDLOWAT 17 |
| 37 | #define SO_SNDTIMEO 19 | |
| 38 | #define SO_TYPE 3 | |
| \ No newline at end of file | ||
| 36 | #define SO_TYPE 3 | |
| 37 | ||
| 38 | #if __TIMESIZE == 64 | |
| 39 | # define SO_RCVTIMEO 18 | |
| 40 | # define SO_SNDTIMEO 19 | |
| 41 | # define SO_TIMESTAMP 29 | |
| 42 | # define SO_TIMESTAMPNS 35 | |
| 43 | # define SO_TIMESTAMPING 37 | |
| 44 | #else | |
| 45 | # define SO_RCVTIMEO_OLD 18 | |
| 46 | # define SO_SNDTIMEO_OLD 19 | |
| 47 | # define SO_RCVTIMEO_NEW 66 | |
| 48 | # define SO_SNDTIMEO_NEW 67 | |
| 49 | ||
| 50 | # define SO_TIMESTAMP_OLD 29 | |
| 51 | # define SO_TIMESTAMPNS_OLD 35 | |
| 52 | # define SO_TIMESTAMPING_OLD 37 | |
| 53 | # define SO_TIMESTAMP_NEW 63 | |
| 54 | # define SO_TIMESTAMPNS_NEW 64 | |
| 55 | # define SO_TIMESTAMPING_NEW 65 | |
| 56 | ||
| 57 | # ifdef __USE_TIME_BITS64 | |
| 58 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 59 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 60 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 61 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 62 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 63 | # else | |
| 64 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 65 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 66 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 67 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 68 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 69 | # endif | |
| 70 | #endif | |
| \ No newline at end of file |
lib/libc/include/powerpc64le-linux-gnu/bits/struct_stat.h+29-23| ... | ... | @@ -26,35 +26,37 @@ |
| 26 | 26 | #include <bits/wordsize.h> |
| 27 | 27 | |
| 28 | 28 | #if __WORDSIZE == 32 |
| 29 | ||
| 30 | 29 | struct stat |
| 31 | 30 | { |
| 31 | # ifdef __USE_TIME_BITS64 | |
| 32 | # include <bits/struct_stat_time64_helper.h> | |
| 33 | # else | |
| 32 | 34 | __dev_t st_dev;			/* Device. */ |
| 33 | # ifndef __USE_FILE_OFFSET64 | |
| 35 | # ifndef __USE_FILE_OFFSET64 | |
| 34 | 36 | unsigned short int __pad1; |
| 35 | 37 | __ino_t st_ino;			/* File serial number.	*/ |
| 36 | # else | |
| 38 | # else | |
| 37 | 39 | __ino64_t st_ino;			/* File serial number.	*/ |
| 38 | # endif | |
| 40 | # endif | |
| 39 | 41 | __mode_t st_mode;			/* File mode. */ |
| 40 | 42 | __nlink_t st_nlink;			/* Link count. */ |
| 41 | 43 | __uid_t st_uid;			/* User ID of the file's owner.	*/ |
| 42 | 44 | __gid_t st_gid;			/* Group ID of the file's group.*/ |
| 43 | 45 | __dev_t st_rdev;			/* Device number, if device. */ |
| 44 | 46 | unsigned short int __pad2; |
| 45 | # ifndef __USE_FILE_OFFSET64 | |
| 47 | # ifndef __USE_FILE_OFFSET64 | |
| 46 | 48 | __off_t st_size;			/* Size of file, in bytes. */ |
| 47 | # else | |
| 49 | # else | |
| 48 | 50 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 49 | # endif | |
| 51 | # endif | |
| 50 | 52 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 51 | 53 | |
| 52 | # ifndef __USE_FILE_OFFSET64 | |
| 54 | # ifndef __USE_FILE_OFFSET64 | |
| 53 | 55 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 54 | # else | |
| 56 | # else | |
| 55 | 57 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 56 | # endif | |
| 57 | # ifdef __USE_XOPEN2K8 | |
| 58 | # endif | |
| 59 | # ifdef __USE_XOPEN2K8 | |
| 58 | 60 | /* Nanosecond resolution timestamps are stored in a format |
| 59 | 61 | equivalent to 'struct timespec'. This is the type used |
| 60 | 62 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -64,25 +66,28 @@ struct stat |
| 64 | 66 | struct timespec st_atim;		/* Time of last access. */ |
| 65 | 67 | struct timespec st_mtim;		/* Time of last modification. */ |
| 66 | 68 | struct timespec st_ctim;		/* Time of last status change. */ |
| 67 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 68 | # define st_mtime st_mtim.tv_sec | |
| 69 | # define st_ctime st_ctim.tv_sec | |
| 70 | # else | |
| 69 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 70 | # define st_mtime st_mtim.tv_sec | |
| 71 | # define st_ctime st_ctim.tv_sec | |
| 72 | # else | |
| 71 | 73 | __time_t st_atime;			/* Time of last access. */ |
| 72 | 74 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 73 | 75 | __time_t st_mtime;			/* Time of last modification. */ |
| 74 | 76 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 75 | 77 | __time_t st_ctime;			/* Time of last status change. */ |
| 76 | 78 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 77 | # endif | |
| 79 | # endif | |
| 78 | 80 | unsigned long int __glibc_reserved4; |
| 79 | 81 | unsigned long int __glibc_reserved5; |
| 82 | # endif /* __USE_TIME_BITS64 */ | |
| 80 | 83 | }; |
| 81 | 84 | |
| 82 | ||
| 83 | 85 | # ifdef __USE_LARGEFILE64 |
| 84 | 86 | struct stat64 |
| 85 | 87 | { |
| 88 | # ifdef __USE_TIME_BITS64 | |
| 89 | # include <bits/struct_stat_time64_helper.h> | |
| 90 | # else | |
| 86 | 91 | __dev_t st_dev;			/* Device. */ |
| 87 | 92 | __ino64_t st_ino;			/* File serial number.	*/ |
| 88 | 93 | __mode_t st_mode;			/* File mode. */ |
| ... | ... | @@ -94,7 +99,7 @@ struct stat64 |
| 94 | 99 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 95 | 100 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 96 | 101 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 97 | # ifdef __USE_XOPEN2K8 | |
| 102 | # ifdef __USE_XOPEN2K8 | |
| 98 | 103 | /* Nanosecond resolution timestamps are stored in a format |
| 99 | 104 | equivalent to 'struct timespec'. This is the type used |
| 100 | 105 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -104,19 +109,20 @@ struct stat64 |
| 104 | 109 | struct timespec st_atim;		/* Time of last access. */ |
| 105 | 110 | struct timespec st_mtim;		/* Time of last modification. */ |
| 106 | 111 | struct timespec st_ctim;		/* Time of last status change. */ |
| 107 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 108 | # define st_mtime st_mtim.tv_sec | |
| 109 | # define st_ctime st_ctim.tv_sec | |
| 110 | # else | |
| 112 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 113 | # define st_mtime st_mtim.tv_sec | |
| 114 | # define st_ctime st_ctim.tv_sec | |
| 115 | # else | |
| 111 | 116 | __time_t st_atime;			/* Time of last access. */ |
| 112 | 117 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 113 | 118 | __time_t st_mtime;			/* Time of last modification. */ |
| 114 | 119 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 115 | 120 | __time_t st_ctime;			/* Time of last status change. */ |
| 116 | 121 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 117 | # endif | |
| 122 | # endif | |
| 118 | 123 | unsigned long int __glibc_reserved4; |
| 119 | 124 | unsigned long int __glibc_reserved5; |
| 125 | # endif /* __USE_TIME_BITS64 */ | |
| 120 | 126 | }; |
| 121 | 127 | # endif /* __USE_LARGEFILE64 */ |
| 122 | 128 |
lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_msqid_ds.h+9-3| ... | ... | @@ -20,23 +20,28 @@ |
| 20 | 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." |
| 21 | 21 | #endif |
| 22 | 22 | |
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 23 | 25 | /* Structure of record for one message inside the kernel. |
| 24 | 26 | The type `struct msg' is opaque. */ |
| 25 | 27 | struct msqid_ds |
| 26 | 28 | { |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 27 | 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ |
| 28 | #if __TIMESIZE == 32 | |
| 33 | # if __TIMESIZE == 32 | |
| 29 | 34 | unsigned long int __msg_stime_high; |
| 30 | 35 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 31 | 36 | unsigned long int __msg_rtime_high; |
| 32 | 37 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 33 | 38 | unsigned long int __msg_ctime_high; |
| 34 | 39 | __time_t msg_ctime;		/* time of last change */ |
| 35 | #else | |
| 40 | # else | |
| 36 | 41 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 37 | 42 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 38 | 43 | __time_t msg_ctime;		/* time of last change */ |
| 39 | #endif | |
| 44 | # endif | |
| 40 | 45 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ |
| 41 | 46 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ |
| 42 | 47 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ |
| ... | ... | @@ -44,4 +49,5 @@ struct msqid_ds |
| 44 | 49 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ |
| 45 | 50 | __syscall_ulong_t __glibc_reserved4; |
| 46 | 51 | __syscall_ulong_t __glibc_reserved5; |
| 52 | #endif | |
| 47 | 53 | }; |
| \ No newline at end of file |
lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_semid_ds.h+7-3| ... | ... | @@ -23,17 +23,21 @@ |
| 23 | 23 | /* Data structure describing a set of semaphores. */ |
| 24 | 24 | struct semid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm sem_perm; /* operation permission struct */ |
| 27 | #if __TIMESIZE == 32 | |
| 30 | # if __TIMESIZE == 32 | |
| 28 | 31 | __syscall_ulong_t __sem_otime_high; |
| 29 | 32 | __time_t sem_otime; /* last semop() time */ |
| 30 | 33 | __syscall_ulong_t __sem_ctime_high; |
| 31 | 34 | __time_t sem_ctime; /* last time changed by semctl() */ |
| 32 | #else | |
| 35 | # else | |
| 33 | 36 | __time_t sem_otime; /* last semop() time */ |
| 34 | 37 | __time_t sem_ctime; /* last time changed by semctl() */ |
| 35 | #endif | |
| 38 | # endif | |
| 36 | 39 | __syscall_ulong_t sem_nsems; /* number of semaphores in set */ |
| 37 | 40 | __syscall_ulong_t __glibc_reserved3; |
| 38 | 41 | __syscall_ulong_t __glibc_reserved4; |
| 42 | #endif | |
| 39 | 43 | }; |
| \ No newline at end of file |
lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_shmid_ds.h+7-3| ... | ... | @@ -23,8 +23,11 @@ |
| 23 | 23 | /* Data structure describing a shared memory segment. */ |
| 24 | 24 | struct shmid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm shm_perm;		/* operation permission struct */ |
| 27 | #if __TIMESIZE == 32 | |
| 30 | # if __TIMESIZE == 32 | |
| 28 | 31 | unsigned long int __shm_atime_high; |
| 29 | 32 | __time_t shm_atime;			/* time of last shmat() */ |
| 30 | 33 | unsigned long int __shm_dtime_high; |
| ... | ... | @@ -32,15 +35,16 @@ struct shmid_ds |
| 32 | 35 | unsigned long int __shm_ctime_high; |
| 33 | 36 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 34 | 37 | unsigned long int __glibc_reserved4; |
| 35 | #else | |
| 38 | # else | |
| 36 | 39 | __time_t shm_atime;			/* time of last shmat() */ |
| 37 | 40 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 38 | 41 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 39 | #endif | |
| 42 | # endif | |
| 40 | 43 | size_t shm_segsz;			/* size of segment in bytes */ |
| 41 | 44 | __pid_t shm_cpid;			/* pid of creator */ |
| 42 | 45 | __pid_t shm_lpid;			/* pid of last shmop */ |
| 43 | 46 | shmatt_t shm_nattch;		/* number of current attaches */ |
| 44 | 47 | __syscall_ulong_t __glibc_reserved5; |
| 45 | 48 | __syscall_ulong_t __glibc_reserved6; |
| 49 | #endif | |
| 46 | 50 | }; |
| \ No newline at end of file |
lib/libc/include/powerpc64le-linux-gnu/gnu/lib-names-64-v2.h+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | #define LIBANL_SO "libanl.so.1" |
| 9 | 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 10 | 10 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | 12 | #define LIBC_SO "libc.so.6" |
| 12 | 13 | #define LIBDL_SO "libdl.so.2" |
| 13 | 14 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/powerpc64le-linux-gnu/sys/ptrace.h+10| ... | ... | @@ -70,6 +70,8 @@ __BEGIN_DECLS |
| 70 | 70 | # undef PTRACE_SYSCALL_INFO_ENTRY |
| 71 | 71 | # undef PTRACE_SYSCALL_INFO_EXIT |
| 72 | 72 | # undef PTRACE_SYSCALL_INFO_SECCOMP |
| 73 | # undef PTRACE_SYSEMU | |
| 74 | # undef PTRACE_SYSEMU_SINGLESTEP | |
| 73 | 75 | # undef PTRACE_TRACEME |
| 74 | 76 | #endif |
| 75 | 77 | |
| ... | ... | @@ -188,6 +190,14 @@ enum __ptrace_request |
| 188 | 190 | PTRACE_SETVSRREGS = 28, |
| 189 | 191 | #define PT_SETVSRREGS PTRACE_SETVSRREGS |
| 190 | 192 | |
| 193 | /* Continue and stop at the next syscall, it will not be executed. */ | |
| 194 | PTRACE_SYSEMU = 29, | |
| 195 | #define PT_SYSEMU PTRACE_SYSEMU | |
| 196 | ||
| 197 | /* Single step the process, the next syscall will not be executed. */ | |
| 198 | PTRACE_SYSEMU_SINGLESTEP = 30, | |
| 199 | #define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP | |
| 200 | ||
| 191 | 201 | /* Execute process until next taken branch. */ |
| 192 | 202 | PTRACE_SINGLEBLOCK = 256, |
| 193 | 203 | #define PT_STEPBLOCK PTRACE_SINGLEBLOCK |
lib/libc/include/riscv64-linux-gnu/bits/statfs.h deleted-86| ... | ... | @@ -1,86 +0,0 @@ |
| 1 | /* Copyright (C) 2011-2021 Free Software Foundation, Inc. | |
| 2 | This file is part of the GNU C Library. | |
| 3 | Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Lesser General Public | |
| 7 | License as published by the Free Software Foundation; either | |
| 8 | version 2.1 of the License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Lesser General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Lesser General Public | |
| 16 | License along with the GNU C Library. If not, see | |
| 17 | <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | #ifndef _SYS_STATFS_H | |
| 20 | # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." | |
| 21 | #endif | |
| 22 | ||
| 23 | #include <bits/endian.h> | |
| 24 | #include <bits/types.h> | |
| 25 | #include <bits/wordsize.h> | |
| 26 | ||
| 27 | /* 64-bit libc uses the kernel's 'struct statfs', accessed via the | |
| 28 | statfs() syscall; 32-bit libc uses the kernel's 'struct statfs64' | |
| 29 | and accesses it via the statfs64() syscall. All the various | |
| 30 | APIs offered by libc use the kernel shape for their struct statfs | |
| 31 | structure; the only difference is that 32-bit programs not | |
| 32 | using __USE_FILE_OFFSET64 only see the low 32 bits of some | |
| 33 | of the fields (the __fsblkcnt_t and __fsfilcnt_t fields). */ | |
| 34 | ||
| 35 | #if defined __USE_FILE_OFFSET64 | |
| 36 | # define __field64(type, type64, name) type64 name | |
| 37 | #elif __WORDSIZE == 64 || __STATFS_MATCHES_STATFS64 | |
| 38 | # define __field64(type, type64, name) type name | |
| 39 | #elif __BYTE_ORDER == __LITTLE_ENDIAN | |
| 40 | # define __field64(type, type64, name) \ | |
| 41 | type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad | |
| 42 | #else | |
| 43 | # define __field64(type, type64, name) \ | |
| 44 | int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name | |
| 45 | #endif | |
| 46 | ||
| 47 | struct statfs | |
| 48 | { | |
| 49 | __SWORD_TYPE f_type; | |
| 50 | __SWORD_TYPE f_bsize; | |
| 51 | __field64(__fsblkcnt_t, __fsblkcnt64_t, f_blocks); | |
| 52 | __field64(__fsblkcnt_t, __fsblkcnt64_t, f_bfree); | |
| 53 | __field64(__fsblkcnt_t, __fsblkcnt64_t, f_bavail); | |
| 54 | __field64(__fsfilcnt_t, __fsfilcnt64_t, f_files); | |
| 55 | __field64(__fsfilcnt_t, __fsfilcnt64_t, f_ffree); | |
| 56 | __fsid_t f_fsid; | |
| 57 | __SWORD_TYPE f_namelen; | |
| 58 | __SWORD_TYPE f_frsize; | |
| 59 | __SWORD_TYPE f_flags; | |
| 60 | __SWORD_TYPE f_spare[4]; | |
| 61 | }; | |
| 62 | ||
| 63 | #undef __field64 | |
| 64 | ||
| 65 | #ifdef __USE_LARGEFILE64 | |
| 66 | struct statfs64 | |
| 67 | { | |
| 68 | __SWORD_TYPE f_type; | |
| 69 | __SWORD_TYPE f_bsize; | |
| 70 | __fsblkcnt64_t f_blocks; | |
| 71 | __fsblkcnt64_t f_bfree; | |
| 72 | __fsblkcnt64_t f_bavail; | |
| 73 | __fsfilcnt64_t f_files; | |
| 74 | __fsfilcnt64_t f_ffree; | |
| 75 | __fsid_t f_fsid; | |
| 76 | __SWORD_TYPE f_namelen; | |
| 77 | __SWORD_TYPE f_frsize; | |
| 78 | __SWORD_TYPE f_flags; | |
| 79 | __SWORD_TYPE f_spare[4]; | |
| 80 | }; | |
| 81 | #endif | |
| 82 | ||
| 83 | /* Tell code we have these members. */ | |
| 84 | #define _STATFS_F_NAMELEN | |
| 85 | #define _STATFS_F_FRSIZE | |
| 86 | #define _STATFS_F_FLAGS | |
| \ No newline at end of file |
lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64.h+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | #define LIBANL_SO "libanl.so.1" |
| 9 | 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 10 | 10 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | 12 | #define LIBC_SO "libc.so.6" |
| 12 | 13 | #define LIBDL_SO "libdl.so.2" |
| 13 | 14 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64d.h created+30| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | /* This file is automatically generated. */ | |
| 2 | #ifndef __GNU_LIB_NAMES_H | |
| 3 | # error "Never use <gnu/lib-names-lp64d.h> directly; include <gnu/lib-names.h> instead." | |
| 4 | #endif | |
| 5 | ||
| 6 | #define LD_LINUX_RISCV64_LP64D_SO "ld-linux-riscv64-lp64d.so.1" | |
| 7 | #define LD_SO "ld-linux-riscv64-lp64d.so.1" | |
| 8 | #define LIBANL_SO "libanl.so.1" | |
| 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" | |
| 10 | #define LIBCRYPT_SO "libcrypt.so.1" | |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 12 | #define LIBC_SO "libc.so.6" | |
| 13 | #define LIBDL_SO "libdl.so.2" | |
| 14 | #define LIBGCC_S_SO "libgcc_s.so.1" | |
| 15 | #define LIBMVEC_SO "libmvec.so.1" | |
| 16 | #define LIBM_SO "libm.so.6" | |
| 17 | #define LIBNSL_SO "libnsl.so.1" | |
| 18 | #define LIBNSS_COMPAT_SO "libnss_compat.so.2" | |
| 19 | #define LIBNSS_DB_SO "libnss_db.so.2" | |
| 20 | #define LIBNSS_DNS_SO "libnss_dns.so.2" | |
| 21 | #define LIBNSS_FILES_SO "libnss_files.so.2" | |
| 22 | #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" | |
| 23 | #define LIBNSS_LDAP_SO "libnss_ldap.so.2" | |
| 24 | #define LIBNSS_TEST1_SO "libnss_test1.so.2" | |
| 25 | #define LIBNSS_TEST2_SO "libnss_test2.so.2" | |
| 26 | #define LIBPTHREAD_SO "libpthread.so.0" | |
| 27 | #define LIBRESOLV_SO "libresolv.so.2" | |
| 28 | #define LIBRT_SO "librt.so.1" | |
| 29 | #define LIBTHREAD_DB_SO "libthread_db.so.1" | |
| 30 | #define LIBUTIL_SO "libutil.so.1" |
lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64d.h created+24| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | /* This file is automatically generated. | |
| 2 | It defines a symbol `__stub_FUNCTION' for each function | |
| 3 | in the C library which is a stub, meaning it will fail | |
| 4 | every time called, usually setting errno to ENOSYS. */ | |
| 5 | ||
| 6 | #ifdef _LIBC | |
| 7 | #error Applications may not define the macro _LIBC | |
| 8 | #endif | |
| 9 | ||
| 10 | #define __stub___compat_bdflush | |
| 11 | #define __stub___compat_create_module | |
| 12 | #define __stub___compat_get_kernel_syms | |
| 13 | #define __stub___compat_query_module | |
| 14 | #define __stub___compat_uselib | |
| 15 | #define __stub_chflags | |
| 16 | #define __stub_fchflags | |
| 17 | #define __stub_fedisableexcept | |
| 18 | #define __stub_feenableexcept | |
| 19 | #define __stub_fegetexcept | |
| 20 | #define __stub_gtty | |
| 21 | #define __stub_revoke | |
| 22 | #define __stub_setlogin | |
| 23 | #define __stub_sigreturn | |
| 24 | #define __stub_stty |
lib/libc/include/s390x-linux-gnu/bits/hwcap.h+3-1| ... | ... | @@ -45,4 +45,6 @@ |
| 45 | 45 | #define HWCAP_S390_VXRS_EXT2 32768 |
| 46 | 46 | #define HWCAP_S390_VXRS_PDE 65536 |
| 47 | 47 | #define HWCAP_S390_SORT 131072 |
| 48 | #define HWCAP_S390_DFLT 262144 | |
| \ No newline at end of file | ||
| 48 | #define HWCAP_S390_DFLT 262144 | |
| 49 | #define HWCAP_S390_VXRS_PDE2 524288 | |
| 50 | #define HWCAP_S390_NNPA 1048576 | |
| \ No newline at end of file |
lib/libc/include/s390x-linux-gnu/bits/struct_stat.h+32-24| ... | ... | @@ -65,32 +65,35 @@ struct stat |
| 65 | 65 | #else |
| 66 | 66 | struct stat |
| 67 | 67 | { |
| 68 | # ifdef __USE_TIME_BITS64 | |
| 69 | # include <bits/struct_stat_time64_helper.h> | |
| 70 | # else | |
| 68 | 71 | __dev_t st_dev;			/* Device. */ |
| 69 | 72 | unsigned int __pad1; |
| 70 | # ifndef __USE_FILE_OFFSET64 | |
| 73 | # ifndef __USE_FILE_OFFSET64 | |
| 71 | 74 | __ino_t st_ino;			/* File serial number.	*/ |
| 72 | # else | |
| 75 | # else | |
| 73 | 76 | __ino_t __st_ino;			/* 32bit file serial number.	*/ |
| 74 | # endif | |
| 77 | # endif | |
| 75 | 78 | __mode_t st_mode;			/* File mode. */ |
| 76 | 79 | __nlink_t st_nlink;			/* Link count. */ |
| 77 | 80 | __uid_t st_uid;			/* User ID of the file's owner.	*/ |
| 78 | 81 | __gid_t st_gid;			/* Group ID of the file's group.*/ |
| 79 | 82 | __dev_t st_rdev;			/* Device number, if device. */ |
| 80 | 83 | unsigned int __pad2; |
| 81 | # ifndef __USE_FILE_OFFSET64 | |
| 84 | # ifndef __USE_FILE_OFFSET64 | |
| 82 | 85 | __off_t st_size;			/* Size of file, in bytes. */ |
| 83 | # else | |
| 86 | # else | |
| 84 | 87 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 85 | # endif | |
| 88 | # endif | |
| 86 | 89 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 87 | 90 | |
| 88 | # ifndef __USE_FILE_OFFSET64 | |
| 91 | # ifndef __USE_FILE_OFFSET64 | |
| 89 | 92 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 90 | # else | |
| 93 | # else | |
| 91 | 94 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 92 | # endif | |
| 93 | # ifdef __USE_XOPEN2K8 | |
| 95 | # endif | |
| 96 | # ifdef __USE_XOPEN2K8 | |
| 94 | 97 | /* Nanosecond resolution timestamps are stored in a format |
| 95 | 98 | equivalent to 'struct timespec'. This is the type used |
| 96 | 99 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -100,25 +103,26 @@ struct stat |
| 100 | 103 | struct timespec st_atim;		/* Time of last access. */ |
| 101 | 104 | struct timespec st_mtim;		/* Time of last modification. */ |
| 102 | 105 | struct timespec st_ctim;		/* Time of last status change. */ |
| 103 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 104 | # define st_mtime st_mtim.tv_sec | |
| 105 | # define st_ctime st_ctim.tv_sec | |
| 106 | # else | |
| 106 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 107 | # define st_mtime st_mtim.tv_sec | |
| 108 | # define st_ctime st_ctim.tv_sec | |
| 109 | # else | |
| 107 | 110 | __time_t st_atime;			/* Time of last access. */ |
| 108 | 111 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 109 | 112 | __time_t st_mtime;			/* Time of last modification. */ |
| 110 | 113 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 111 | 114 | __time_t st_ctime;			/* Time of last status change. */ |
| 112 | 115 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 113 | # endif | |
| 114 | # ifndef __USE_FILE_OFFSET64 | |
| 116 | # endif | |
| 117 | # ifndef __USE_FILE_OFFSET64 | |
| 115 | 118 | unsigned long int __glibc_reserved4; |
| 116 | 119 | unsigned long int __glibc_reserved5; |
| 117 | # else | |
| 120 | # else | |
| 118 | 121 | __ino64_t st_ino;			/* File serial number.	*/ |
| 122 | # endif | |
| 119 | 123 | # endif |
| 120 | 124 | }; |
| 121 | #endif | |
| 125 | # endif | |
| 122 | 126 | |
| 123 | 127 | #ifdef __USE_LARGEFILE64 |
| 124 | 128 | # if __WORDSIZE == 64 |
| ... | ... | @@ -162,6 +166,9 @@ struct stat64 |
| 162 | 166 | # else |
| 163 | 167 | struct stat64 |
| 164 | 168 | { |
| 169 | # ifdef __USE_TIME_BITS64 | |
| 170 | # include <bits/struct_stat_time64_helper.h> | |
| 171 | # else | |
| 165 | 172 | __dev_t st_dev;			/* Device. */ |
| 166 | 173 | unsigned int __pad1; |
| 167 | 174 | |
| ... | ... | @@ -176,7 +183,7 @@ struct stat64 |
| 176 | 183 | __blksize_t st_blksize;		/* Optimal block size for I/O. */ |
| 177 | 184 | |
| 178 | 185 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 179 | # ifdef __USE_XOPEN2K8 | |
| 186 | # ifdef __USE_XOPEN2K8 | |
| 180 | 187 | /* Nanosecond resolution timestamps are stored in a format |
| 181 | 188 | equivalent to 'struct timespec'. This is the type used |
| 182 | 189 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -186,18 +193,19 @@ struct stat64 |
| 186 | 193 | struct timespec st_atim;		/* Time of last access. */ |
| 187 | 194 | struct timespec st_mtim;		/* Time of last modification. */ |
| 188 | 195 | struct timespec st_ctim;		/* Time of last status change. */ |
| 189 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 190 | # define st_mtime st_mtim.tv_sec | |
| 191 | # define st_ctime st_ctim.tv_sec | |
| 192 | # else | |
| 196 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 197 | # define st_mtime st_mtim.tv_sec | |
| 198 | # define st_ctime st_ctim.tv_sec | |
| 199 | # else | |
| 193 | 200 | __time_t st_atime;			/* Time of last access. */ |
| 194 | 201 | unsigned long int st_atimensec;	/* Nscecs of last access. */ |
| 195 | 202 | __time_t st_mtime;			/* Time of last modification. */ |
| 196 | 203 | unsigned long int st_mtimensec;	/* Nsecs of last modification. */ |
| 197 | 204 | __time_t st_ctime;			/* Time of last status change. */ |
| 198 | 205 | unsigned long int st_ctimensec;	/* Nsecs of last status change. */ |
| 199 | # endif | |
| 206 | # endif | |
| 200 | 207 | __ino64_t st_ino;			/* File serial number.		*/ |
| 208 | # endif | |
| 201 | 209 | }; |
| 202 | 210 | # endif |
| 203 | 211 | #endif |
lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | #define LIBANL_SO "libanl.so.1" |
| 9 | 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 10 | 10 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | 12 | #define LIBC_SO "libc.so.6" |
| 12 | 13 | #define LIBDL_SO "libdl.so.2" |
| 13 | 14 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/s390x-linux-gnu/sys/ptrace.h+10| ... | ... | @@ -39,6 +39,8 @@ __BEGIN_DECLS |
| 39 | 39 | # undef PTRACE_ATTACH |
| 40 | 40 | # undef PTRACE_DETACH |
| 41 | 41 | # undef PTRACE_SYSCALL |
| 42 | # undef PTRACE_SYSEMU | |
| 43 | # undef PTRACE_SYSEMU_SINGLESTEP | |
| 42 | 44 | # undef PTRACE_SETOPTIONS |
| 43 | 45 | # undef PTRACE_GETEVENTMSG |
| 44 | 46 | # undef PTRACE_GETSIGINFO |
| ... | ... | @@ -146,6 +148,14 @@ enum __ptrace_request |
| 146 | 148 | PTRACE_SYSCALL = 24, |
| 147 | 149 | #define PT_SYSCALL PTRACE_SYSCALL |
| 148 | 150 | |
| 151 | /* Continue and stop at the next syscall, it will not be executed. */ | |
| 152 | PTRACE_SYSEMU = 31, | |
| 153 | #define PT_SYSEMU PTRACE_SYSEMU | |
| 154 | ||
| 155 | /* Single step the process, the next syscall will not be executed. */ | |
| 156 | PTRACE_SYSEMU_SINGLESTEP = 32, | |
| 157 | #define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP | |
| 158 | ||
| 149 | 159 | /* Set ptrace filter options. */ |
| 150 | 160 | PTRACE_SETOPTIONS = 0x4200, |
| 151 | 161 | #define PT_SETOPTIONS PTRACE_SETOPTIONS |
lib/libc/include/sparc-linux-gnu/bits/local_lim.h deleted-99| ... | ... | @@ -1,99 +0,0 @@ |
| 1 | /* Minimum guaranteed maximum values for system limits. Linux/SPARC version. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Library General Public License as | |
| 7 | published by the Free Software Foundation; either version 2 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Library General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Library General Public | |
| 16 | License along with the GNU C Library; see the file COPYING.LIB. If | |
| 17 | not, see <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* The kernel header pollutes the namespace with the NR_OPEN symbol | |
| 20 | and defines LINK_MAX although filesystems have different maxima. A | |
| 21 | similar thing is true for OPEN_MAX: the limit can be changed at | |
| 22 | runtime and therefore the macro must not be defined. Remove this | |
| 23 | after including the header if necessary. */ | |
| 24 | #ifndef NR_OPEN | |
| 25 | # define __undef_NR_OPEN | |
| 26 | #endif | |
| 27 | #ifndef LINK_MAX | |
| 28 | # define __undef_LINK_MAX | |
| 29 | #endif | |
| 30 | #ifndef OPEN_MAX | |
| 31 | # define __undef_OPEN_MAX | |
| 32 | #endif | |
| 33 | #ifndef ARG_MAX | |
| 34 | # define __undef_ARG_MAX | |
| 35 | #endif | |
| 36 | ||
| 37 | /* The kernel sources contain a file with all the needed information. */ | |
| 38 | #include <linux/limits.h> | |
| 39 | ||
| 40 | /* Have to remove NR_OPEN? */ | |
| 41 | #ifdef __undef_NR_OPEN | |
| 42 | # undef NR_OPEN | |
| 43 | # undef __undef_NR_OPEN | |
| 44 | #endif | |
| 45 | /* Have to remove LINK_MAX? */ | |
| 46 | #ifdef __undef_LINK_MAX | |
| 47 | # undef LINK_MAX | |
| 48 | # undef __undef_LINK_MAX | |
| 49 | #endif | |
| 50 | /* Have to remove OPEN_MAX? */ | |
| 51 | #ifdef __undef_OPEN_MAX | |
| 52 | # undef OPEN_MAX | |
| 53 | # undef __undef_OPEN_MAX | |
| 54 | #endif | |
| 55 | /* Have to remove ARG_MAX? */ | |
| 56 | #ifdef __undef_ARG_MAX | |
| 57 | # undef ARG_MAX | |
| 58 | # undef __undef_ARG_MAX | |
| 59 | #endif | |
| 60 | ||
| 61 | /* The number of data keys per process. */ | |
| 62 | #define _POSIX_THREAD_KEYS_MAX	128 | |
| 63 | /* This is the value this implementation supports. */ | |
| 64 | #define PTHREAD_KEYS_MAX	1024 | |
| 65 | ||
| 66 | /* Controlling the iterations of destructors for thread-specific data. */ | |
| 67 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4 | |
| 68 | /* Number of iterations this implementation does. */ | |
| 69 | #define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS | |
| 70 | ||
| 71 | /* The number of threads per process. */ | |
| 72 | #define _POSIX_THREAD_THREADS_MAX	64 | |
| 73 | /* We have no predefined limit on the number of threads. */ | |
| 74 | #undef PTHREAD_THREADS_MAX | |
| 75 | ||
| 76 | /* Maximum amount by which a process can descrease its asynchronous I/O | |
| 77 | priority level. */ | |
| 78 | #define AIO_PRIO_DELTA_MAX	20 | |
| 79 | ||
| 80 | /* Minimum size for a thread. We are free to choose a reasonable value. */ | |
| 81 | #define PTHREAD_STACK_MIN	24576 | |
| 82 | ||
| 83 | /* Maximum number of timer expiration overruns. */ | |
| 84 | #define DELAYTIMER_MAX	2147483647 | |
| 85 | ||
| 86 | /* Maximum tty name length. */ | |
| 87 | #define TTY_NAME_MAX		32 | |
| 88 | ||
| 89 | /* Maximum login name length. This is arbitrary. */ | |
| 90 | #define LOGIN_NAME_MAX		256 | |
| 91 | ||
| 92 | /* Maximum host name length. */ | |
| 93 | #define HOST_NAME_MAX		64 | |
| 94 | ||
| 95 | /* Maximum message queue priority level. */ | |
| 96 | #define MQ_PRIO_MAX		32768 | |
| 97 | ||
| 98 | /* Maximum value the semaphore can have. */ | |
| 99 | #define SEM_VALUE_MAX (2147483647) | |
| \ No newline at end of file |
lib/libc/include/sparc-linux-gnu/bits/pthread_stack_min.h created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. Linux/SPARC version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Library General Public License as | |
| 7 | published by the Free Software Foundation; either version 2 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Library General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Library General Public | |
| 16 | License along with the GNU C Library; see the file COPYING.LIB. If | |
| 17 | not, see <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. We are free to choose a reasonable value. */ | |
| 20 | #define PTHREAD_STACK_MIN	24576 | |
| \ No newline at end of file |
lib/libc/include/sparc-linux-gnu/bits/socket-constants.h+35-3| ... | ... | @@ -30,9 +30,41 @@ |
| 30 | 30 | #define SO_OOBINLINE 256 |
| 31 | 31 | #define SO_RCVBUF 4098 |
| 32 | 32 | #define SO_RCVLOWAT 2048 |
| 33 | #define SO_RCVTIMEO 8192 | |
| 34 | 33 | #define SO_REUSEADDR 4 |
| 35 | 34 | #define SO_SNDBUF 4097 |
| 36 | 35 | #define SO_SNDLOWAT 4096 |
| 37 | #define SO_SNDTIMEO 16384 | |
| 38 | #define SO_TYPE 4104 | |
| \ No newline at end of file | ||
| 36 | #define SO_TYPE 4104 | |
| 37 | ||
| 38 | #if __TIMESIZE == 64 | |
| 39 | # define SO_RCVTIMEO 8192 | |
| 40 | # define SO_SNDTIMEO 16384 | |
| 41 | # define SO_TIMESTAMP 29 | |
| 42 | # define SO_TIMESTAMPNS 33 | |
| 43 | # define SO_TIMESTAMPING 35 | |
| 44 | #else | |
| 45 | # define SO_RCVTIMEO_OLD 8192 | |
| 46 | # define SO_SNDTIMEO_OLD 16384 | |
| 47 | # define SO_RCVTIMEO_NEW 68 | |
| 48 | # define SO_SNDTIMEO_NEW 69 | |
| 49 | ||
| 50 | # define SO_TIMESTAMP_OLD 0x001d | |
| 51 | # define SO_TIMESTAMPNS_OLD 0x0021 | |
| 52 | # define SO_TIMESTAMPING_OLD 0x0023 | |
| 53 | # define SO_TIMESTAMP_NEW 0x0046 | |
| 54 | # define SO_TIMESTAMPNS_NEW 0x0042 | |
| 55 | # define SO_TIMESTAMPING_NEW 0x0043 | |
| 56 | ||
| 57 | # ifdef __USE_TIME_BITS64 | |
| 58 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 59 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 60 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 61 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 62 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 63 | # else | |
| 64 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 65 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 66 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 67 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 68 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 69 | # endif | |
| 70 | #endif | |
| \ No newline at end of file |
lib/libc/include/sparc-linux-gnu/bits/types/struct_msqid_ds.h+9-3| ... | ... | @@ -20,23 +20,28 @@ |
| 20 | 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." |
| 21 | 21 | #endif |
| 22 | 22 | |
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 23 | 25 | /* Structure of record for one message inside the kernel. |
| 24 | 26 | The type `struct msg' is opaque. */ |
| 25 | 27 | struct msqid_ds |
| 26 | 28 | { |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 27 | 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ |
| 28 | #if __TIMESIZE == 32 | |
| 33 | # if __TIMESIZE == 32 | |
| 29 | 34 | unsigned long int __msg_stime_high; |
| 30 | 35 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 31 | 36 | unsigned long int __msg_rtime_high; |
| 32 | 37 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 33 | 38 | unsigned long int __msg_ctime_high; |
| 34 | 39 | __time_t msg_ctime;		/* time of last change */ |
| 35 | #else | |
| 40 | # else | |
| 36 | 41 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 37 | 42 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 38 | 43 | __time_t msg_ctime;		/* time of last change */ |
| 39 | #endif | |
| 44 | # endif | |
| 40 | 45 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ |
| 41 | 46 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ |
| 42 | 47 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ |
| ... | ... | @@ -44,4 +49,5 @@ struct msqid_ds |
| 44 | 49 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ |
| 45 | 50 | __syscall_ulong_t __glibc_reserved4; |
| 46 | 51 | __syscall_ulong_t __glibc_reserved5; |
| 52 | #endif | |
| 47 | 53 | }; |
| \ No newline at end of file |
lib/libc/include/sparc-linux-gnu/bits/types/struct_semid_ds.h+7-3| ... | ... | @@ -23,17 +23,21 @@ |
| 23 | 23 | /* Data structure describing a set of semaphores. */ |
| 24 | 24 | struct semid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm sem_perm; /* operation permission struct */ |
| 27 | #if __TIMESIZE == 32 | |
| 30 | # if __TIMESIZE == 32 | |
| 28 | 31 | __syscall_ulong_t __sem_otime_high; |
| 29 | 32 | __time_t sem_otime; /* last semop() time */ |
| 30 | 33 | __syscall_ulong_t __sem_ctime_high; |
| 31 | 34 | __time_t sem_ctime; /* last time changed by semctl() */ |
| 32 | #else | |
| 35 | # else | |
| 33 | 36 | __time_t sem_otime; /* last semop() time */ |
| 34 | 37 | __time_t sem_ctime; /* last time changed by semctl() */ |
| 35 | #endif | |
| 38 | # endif | |
| 36 | 39 | __syscall_ulong_t sem_nsems; /* number of semaphores in set */ |
| 37 | 40 | __syscall_ulong_t __glibc_reserved3; |
| 38 | 41 | __syscall_ulong_t __glibc_reserved4; |
| 42 | #endif | |
| 39 | 43 | }; |
| \ No newline at end of file |
lib/libc/include/sparc-linux-gnu/bits/types/struct_shmid_ds.h+7-3| ... | ... | @@ -23,23 +23,27 @@ |
| 23 | 23 | /* Data structure describing a shared memory segment. */ |
| 24 | 24 | struct shmid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm shm_perm;		/* operation permission struct */ |
| 27 | #if __TIMESIZE == 32 | |
| 30 | # if __TIMESIZE == 32 | |
| 28 | 31 | unsigned long int __shm_atime_high; |
| 29 | 32 | __time_t shm_atime;			/* time of last shmat() */ |
| 30 | 33 | unsigned long int __shm_dtime_high; |
| 31 | 34 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 32 | 35 | unsigned long int __shm_ctime_high; |
| 33 | 36 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 34 | #else | |
| 37 | # else | |
| 35 | 38 | __time_t shm_atime;			/* time of last shmat() */ |
| 36 | 39 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 37 | 40 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 38 | #endif | |
| 41 | # endif | |
| 39 | 42 | size_t shm_segsz;			/* size of segment in bytes */ |
| 40 | 43 | __pid_t shm_cpid;			/* pid of creator */ |
| 41 | 44 | __pid_t shm_lpid;			/* pid of last shmop */ |
| 42 | 45 | shmatt_t shm_nattch;		/* number of current attaches */ |
| 43 | 46 | __syscall_ulong_t __glibc_reserved5; |
| 44 | 47 | __syscall_ulong_t __glibc_reserved6; |
| 48 | #endif | |
| 45 | 49 | }; |
| \ No newline at end of file |
lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | #define LIBANL_SO "libanl.so.1" |
| 9 | 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 10 | 10 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | 12 | #define LIBC_SO "libc.so.6" |
| 12 | 13 | #define LIBDL_SO "libdl.so.2" |
| 13 | 14 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/sparcv9-linux-gnu/bits/local_lim.h deleted-99| ... | ... | @@ -1,99 +0,0 @@ |
| 1 | /* Minimum guaranteed maximum values for system limits. Linux/SPARC version. | |
| 2 | Copyright (C) 1993-2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Library General Public License as | |
| 7 | published by the Free Software Foundation; either version 2 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Library General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Library General Public | |
| 16 | License along with the GNU C Library; see the file COPYING.LIB. If | |
| 17 | not, see <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* The kernel header pollutes the namespace with the NR_OPEN symbol | |
| 20 | and defines LINK_MAX although filesystems have different maxima. A | |
| 21 | similar thing is true for OPEN_MAX: the limit can be changed at | |
| 22 | runtime and therefore the macro must not be defined. Remove this | |
| 23 | after including the header if necessary. */ | |
| 24 | #ifndef NR_OPEN | |
| 25 | # define __undef_NR_OPEN | |
| 26 | #endif | |
| 27 | #ifndef LINK_MAX | |
| 28 | # define __undef_LINK_MAX | |
| 29 | #endif | |
| 30 | #ifndef OPEN_MAX | |
| 31 | # define __undef_OPEN_MAX | |
| 32 | #endif | |
| 33 | #ifndef ARG_MAX | |
| 34 | # define __undef_ARG_MAX | |
| 35 | #endif | |
| 36 | ||
| 37 | /* The kernel sources contain a file with all the needed information. */ | |
| 38 | #include <linux/limits.h> | |
| 39 | ||
| 40 | /* Have to remove NR_OPEN? */ | |
| 41 | #ifdef __undef_NR_OPEN | |
| 42 | # undef NR_OPEN | |
| 43 | # undef __undef_NR_OPEN | |
| 44 | #endif | |
| 45 | /* Have to remove LINK_MAX? */ | |
| 46 | #ifdef __undef_LINK_MAX | |
| 47 | # undef LINK_MAX | |
| 48 | # undef __undef_LINK_MAX | |
| 49 | #endif | |
| 50 | /* Have to remove OPEN_MAX? */ | |
| 51 | #ifdef __undef_OPEN_MAX | |
| 52 | # undef OPEN_MAX | |
| 53 | # undef __undef_OPEN_MAX | |
| 54 | #endif | |
| 55 | /* Have to remove ARG_MAX? */ | |
| 56 | #ifdef __undef_ARG_MAX | |
| 57 | # undef ARG_MAX | |
| 58 | # undef __undef_ARG_MAX | |
| 59 | #endif | |
| 60 | ||
| 61 | /* The number of data keys per process. */ | |
| 62 | #define _POSIX_THREAD_KEYS_MAX	128 | |
| 63 | /* This is the value this implementation supports. */ | |
| 64 | #define PTHREAD_KEYS_MAX	1024 | |
| 65 | ||
| 66 | /* Controlling the iterations of destructors for thread-specific data. */ | |
| 67 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4 | |
| 68 | /* Number of iterations this implementation does. */ | |
| 69 | #define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS | |
| 70 | ||
| 71 | /* The number of threads per process. */ | |
| 72 | #define _POSIX_THREAD_THREADS_MAX	64 | |
| 73 | /* We have no predefined limit on the number of threads. */ | |
| 74 | #undef PTHREAD_THREADS_MAX | |
| 75 | ||
| 76 | /* Maximum amount by which a process can descrease its asynchronous I/O | |
| 77 | priority level. */ | |
| 78 | #define AIO_PRIO_DELTA_MAX	20 | |
| 79 | ||
| 80 | /* Minimum size for a thread. We are free to choose a reasonable value. */ | |
| 81 | #define PTHREAD_STACK_MIN	24576 | |
| 82 | ||
| 83 | /* Maximum number of timer expiration overruns. */ | |
| 84 | #define DELAYTIMER_MAX	2147483647 | |
| 85 | ||
| 86 | /* Maximum tty name length. */ | |
| 87 | #define TTY_NAME_MAX		32 | |
| 88 | ||
| 89 | /* Maximum login name length. This is arbitrary. */ | |
| 90 | #define LOGIN_NAME_MAX		256 | |
| 91 | ||
| 92 | /* Maximum host name length. */ | |
| 93 | #define HOST_NAME_MAX		64 | |
| 94 | ||
| 95 | /* Maximum message queue priority level. */ | |
| 96 | #define MQ_PRIO_MAX		32768 | |
| 97 | ||
| 98 | /* Maximum value the semaphore can have. */ | |
| 99 | #define SEM_VALUE_MAX (2147483647) | |
| \ No newline at end of file |
lib/libc/include/sparcv9-linux-gnu/bits/pthread_stack_min.h created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | /* Definition of PTHREAD_STACK_MIN. Linux/SPARC version. | |
| 2 | Copyright (C) 2021 Free Software Foundation, Inc. | |
| 3 | This file is part of the GNU C Library. | |
| 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | |
| 6 | modify it under the terms of the GNU Library General Public License as | |
| 7 | published by the Free Software Foundation; either version 2 of the | |
| 8 | License, or (at your option) any later version. | |
| 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | Library General Public License for more details. | |
| 14 | ||
| 15 | You should have received a copy of the GNU Library General Public | |
| 16 | License along with the GNU C Library; see the file COPYING.LIB. If | |
| 17 | not, see <https://www.gnu.org/licenses/>. */ | |
| 18 | ||
| 19 | /* Minimum size for a thread. We are free to choose a reasonable value. */ | |
| 20 | #define PTHREAD_STACK_MIN	24576 | |
| \ No newline at end of file |
lib/libc/include/sparcv9-linux-gnu/bits/socket-constants.h+35-3| ... | ... | @@ -30,9 +30,41 @@ |
| 30 | 30 | #define SO_OOBINLINE 256 |
| 31 | 31 | #define SO_RCVBUF 4098 |
| 32 | 32 | #define SO_RCVLOWAT 2048 |
| 33 | #define SO_RCVTIMEO 8192 | |
| 34 | 33 | #define SO_REUSEADDR 4 |
| 35 | 34 | #define SO_SNDBUF 4097 |
| 36 | 35 | #define SO_SNDLOWAT 4096 |
| 37 | #define SO_SNDTIMEO 16384 | |
| 38 | #define SO_TYPE 4104 | |
| \ No newline at end of file | ||
| 36 | #define SO_TYPE 4104 | |
| 37 | ||
| 38 | #if __TIMESIZE == 64 | |
| 39 | # define SO_RCVTIMEO 8192 | |
| 40 | # define SO_SNDTIMEO 16384 | |
| 41 | # define SO_TIMESTAMP 29 | |
| 42 | # define SO_TIMESTAMPNS 33 | |
| 43 | # define SO_TIMESTAMPING 35 | |
| 44 | #else | |
| 45 | # define SO_RCVTIMEO_OLD 8192 | |
| 46 | # define SO_SNDTIMEO_OLD 16384 | |
| 47 | # define SO_RCVTIMEO_NEW 68 | |
| 48 | # define SO_SNDTIMEO_NEW 69 | |
| 49 | ||
| 50 | # define SO_TIMESTAMP_OLD 0x001d | |
| 51 | # define SO_TIMESTAMPNS_OLD 0x0021 | |
| 52 | # define SO_TIMESTAMPING_OLD 0x0023 | |
| 53 | # define SO_TIMESTAMP_NEW 0x0046 | |
| 54 | # define SO_TIMESTAMPNS_NEW 0x0042 | |
| 55 | # define SO_TIMESTAMPING_NEW 0x0043 | |
| 56 | ||
| 57 | # ifdef __USE_TIME_BITS64 | |
| 58 | # define SO_RCVTIMEO SO_RCVTIMEO_NEW | |
| 59 | # define SO_SNDTIMEO SO_SNDTIMEO_NEW | |
| 60 | # define SO_TIMESTAMP SO_TIMESTAMP_NEW | |
| 61 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW | |
| 62 | # define SO_TIMESTAMPING SO_TIMESTAMPING_NEW | |
| 63 | # else | |
| 64 | # define SO_RCVTIMEO SO_RCVTIMEO_OLD | |
| 65 | # define SO_SNDTIMEO SO_SNDTIMEO_OLD | |
| 66 | # define SO_TIMESTAMP SO_TIMESTAMP_OLD | |
| 67 | # define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD | |
| 68 | # define SO_TIMESTAMPING SO_TIMESTAMPING_OLD | |
| 69 | # endif | |
| 70 | #endif | |
| \ No newline at end of file |
lib/libc/include/sparcv9-linux-gnu/bits/types/struct_msqid_ds.h+9-3| ... | ... | @@ -20,23 +20,28 @@ |
| 20 | 20 | # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." |
| 21 | 21 | #endif |
| 22 | 22 | |
| 23 | #include <bits/types/time_t.h> | |
| 24 | ||
| 23 | 25 | /* Structure of record for one message inside the kernel. |
| 24 | 26 | The type `struct msg' is opaque. */ |
| 25 | 27 | struct msqid_ds |
| 26 | 28 | { |
| 29 | #ifdef __USE_TIME_BITS64 | |
| 30 | # include <bits/types/struct_msqid64_ds_helper.h> | |
| 31 | #else | |
| 27 | 32 | struct ipc_perm msg_perm;	/* structure describing operation permission */ |
| 28 | #if __TIMESIZE == 32 | |
| 33 | # if __TIMESIZE == 32 | |
| 29 | 34 | unsigned long int __msg_stime_high; |
| 30 | 35 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 31 | 36 | unsigned long int __msg_rtime_high; |
| 32 | 37 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 33 | 38 | unsigned long int __msg_ctime_high; |
| 34 | 39 | __time_t msg_ctime;		/* time of last change */ |
| 35 | #else | |
| 40 | # else | |
| 36 | 41 | __time_t msg_stime;		/* time of last msgsnd command */ |
| 37 | 42 | __time_t msg_rtime;		/* time of last msgsnd command */ |
| 38 | 43 | __time_t msg_ctime;		/* time of last change */ |
| 39 | #endif | |
| 44 | # endif | |
| 40 | 45 | __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ |
| 41 | 46 | msgqnum_t msg_qnum;		/* number of messages currently on queue */ |
| 42 | 47 | msglen_t msg_qbytes;		/* max number of bytes allowed on queue */ |
| ... | ... | @@ -44,4 +49,5 @@ struct msqid_ds |
| 44 | 49 | __pid_t msg_lrpid;		/* pid of last msgrcv() */ |
| 45 | 50 | __syscall_ulong_t __glibc_reserved4; |
| 46 | 51 | __syscall_ulong_t __glibc_reserved5; |
| 52 | #endif | |
| 47 | 53 | }; |
| \ No newline at end of file |
lib/libc/include/sparcv9-linux-gnu/bits/types/struct_semid_ds.h+7-3| ... | ... | @@ -23,17 +23,21 @@ |
| 23 | 23 | /* Data structure describing a set of semaphores. */ |
| 24 | 24 | struct semid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm sem_perm; /* operation permission struct */ |
| 27 | #if __TIMESIZE == 32 | |
| 30 | # if __TIMESIZE == 32 | |
| 28 | 31 | __syscall_ulong_t __sem_otime_high; |
| 29 | 32 | __time_t sem_otime; /* last semop() time */ |
| 30 | 33 | __syscall_ulong_t __sem_ctime_high; |
| 31 | 34 | __time_t sem_ctime; /* last time changed by semctl() */ |
| 32 | #else | |
| 35 | # else | |
| 33 | 36 | __time_t sem_otime; /* last semop() time */ |
| 34 | 37 | __time_t sem_ctime; /* last time changed by semctl() */ |
| 35 | #endif | |
| 38 | # endif | |
| 36 | 39 | __syscall_ulong_t sem_nsems; /* number of semaphores in set */ |
| 37 | 40 | __syscall_ulong_t __glibc_reserved3; |
| 38 | 41 | __syscall_ulong_t __glibc_reserved4; |
| 42 | #endif | |
| 39 | 43 | }; |
| \ No newline at end of file |
lib/libc/include/sparcv9-linux-gnu/bits/types/struct_shmid_ds.h+7-3| ... | ... | @@ -23,23 +23,27 @@ |
| 23 | 23 | /* Data structure describing a shared memory segment. */ |
| 24 | 24 | struct shmid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_shmid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm shm_perm;		/* operation permission struct */ |
| 27 | #if __TIMESIZE == 32 | |
| 30 | # if __TIMESIZE == 32 | |
| 28 | 31 | unsigned long int __shm_atime_high; |
| 29 | 32 | __time_t shm_atime;			/* time of last shmat() */ |
| 30 | 33 | unsigned long int __shm_dtime_high; |
| 31 | 34 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 32 | 35 | unsigned long int __shm_ctime_high; |
| 33 | 36 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 34 | #else | |
| 37 | # else | |
| 35 | 38 | __time_t shm_atime;			/* time of last shmat() */ |
| 36 | 39 | __time_t shm_dtime;			/* time of last shmdt() */ |
| 37 | 40 | __time_t shm_ctime;			/* time of last change by shmctl() */ |
| 38 | #endif | |
| 41 | # endif | |
| 39 | 42 | size_t shm_segsz;			/* size of segment in bytes */ |
| 40 | 43 | __pid_t shm_cpid;			/* pid of creator */ |
| 41 | 44 | __pid_t shm_lpid;			/* pid of last shmop */ |
| 42 | 45 | shmatt_t shm_nattch;		/* number of current attaches */ |
| 43 | 46 | __syscall_ulong_t __glibc_reserved5; |
| 44 | 47 | __syscall_ulong_t __glibc_reserved6; |
| 48 | #endif | |
| 45 | 49 | }; |
| \ No newline at end of file |
lib/libc/include/x86_64-linux-gnu/bits/struct_stat.h+49-41| ... | ... | @@ -25,43 +25,46 @@ |
| 25 | 25 | |
| 26 | 26 | struct stat |
| 27 | 27 | { |
| 28 | #ifdef __USE_TIME_BITS64 | |
| 29 | # include <bits/struct_stat_time64_helper.h> | |
| 30 | #else | |
| 28 | 31 | __dev_t st_dev;		/* Device. */ |
| 29 | #ifndef __x86_64__ | |
| 32 | # ifndef __x86_64__ | |
| 30 | 33 | unsigned short int __pad1; |
| 31 | #endif | |
| 32 | #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 34 | # endif | |
| 35 | # if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 33 | 36 | __ino_t st_ino;		/* File serial number.	*/ |
| 34 | #else | |
| 37 | # else | |
| 35 | 38 | __ino_t __st_ino;			/* 32bit file serial number.	*/ |
| 36 | #endif | |
| 37 | #ifndef __x86_64__ | |
| 39 | # endif | |
| 40 | # ifndef __x86_64__ | |
| 38 | 41 | __mode_t st_mode;			/* File mode. */ |
| 39 | 42 | __nlink_t st_nlink;			/* Link count. */ |
| 40 | #else | |
| 43 | # else | |
| 41 | 44 | __nlink_t st_nlink;		/* Link count. */ |
| 42 | 45 | __mode_t st_mode;		/* File mode. */ |
| 43 | #endif | |
| 46 | # endif | |
| 44 | 47 | __uid_t st_uid;		/* User ID of the file's owner.	*/ |
| 45 | 48 | __gid_t st_gid;		/* Group ID of the file's group.*/ |
| 46 | #ifdef __x86_64__ | |
| 49 | # ifdef __x86_64__ | |
| 47 | 50 | int __pad0; |
| 48 | #endif | |
| 51 | # endif | |
| 49 | 52 | __dev_t st_rdev;		/* Device number, if device. */ |
| 50 | #ifndef __x86_64__ | |
| 53 | # ifndef __x86_64__ | |
| 51 | 54 | unsigned short int __pad2; |
| 52 | #endif | |
| 53 | #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 55 | # endif | |
| 56 | # if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 54 | 57 | __off_t st_size;			/* Size of file, in bytes. */ |
| 55 | #else | |
| 58 | # else | |
| 56 | 59 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 57 | #endif | |
| 60 | # endif | |
| 58 | 61 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ |
| 59 | #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 62 | # if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 60 | 63 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 61 | #else | |
| 64 | # else | |
| 62 | 65 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 63 | #endif | |
| 64 | #ifdef __USE_XOPEN2K8 | |
| 66 | # endif | |
| 67 | # ifdef __USE_XOPEN2K8 | |
| 65 | 68 | /* Nanosecond resolution timestamps are stored in a format |
| 66 | 69 | equivalent to 'struct timespec'. This is the type used |
| 67 | 70 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -71,58 +74,62 @@ struct stat |
| 71 | 74 | struct timespec st_atim;		/* Time of last access. */ |
| 72 | 75 | struct timespec st_mtim;		/* Time of last modification. */ |
| 73 | 76 | struct timespec st_ctim;		/* Time of last status change. */ |
| 74 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 75 | # define st_mtime st_mtim.tv_sec | |
| 76 | # define st_ctime st_ctim.tv_sec | |
| 77 | #else | |
| 77 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 78 | # define st_mtime st_mtim.tv_sec | |
| 79 | # define st_ctime st_ctim.tv_sec | |
| 80 | # else | |
| 78 | 81 | __time_t st_atime;			/* Time of last access. */ |
| 79 | 82 | __syscall_ulong_t st_atimensec;	/* Nscecs of last access. */ |
| 80 | 83 | __time_t st_mtime;			/* Time of last modification. */ |
| 81 | 84 | __syscall_ulong_t st_mtimensec;	/* Nsecs of last modification. */ |
| 82 | 85 | __time_t st_ctime;			/* Time of last status change. */ |
| 83 | 86 | __syscall_ulong_t st_ctimensec;	/* Nsecs of last status change. */ |
| 84 | #endif | |
| 85 | #ifdef __x86_64__ | |
| 87 | # endif | |
| 88 | # ifdef __x86_64__ | |
| 86 | 89 | __syscall_slong_t __glibc_reserved[3]; |
| 87 | #else | |
| 88 | # ifndef __USE_FILE_OFFSET64 | |
| 90 | # else | |
| 91 | # ifndef __USE_FILE_OFFSET64 | |
| 89 | 92 | unsigned long int __glibc_reserved4; |
| 90 | 93 | unsigned long int __glibc_reserved5; |
| 91 | # else | |
| 94 | # else | |
| 92 | 95 | __ino64_t st_ino;			/* File serial number.	*/ |
| 96 | # endif | |
| 93 | 97 | # endif |
| 94 | #endif | |
| 98 | #endif /* __USE_TIME_BITS64 */ | |
| 95 | 99 | }; |
| 96 | 100 | |
| 97 | 101 | #ifdef __USE_LARGEFILE64 |
| 98 | 102 | /* Note stat64 has the same shape as stat for x86-64. */ |
| 99 | 103 | struct stat64 |
| 100 | 104 | { |
| 105 | # ifdef __USE_TIME_BITS64 | |
| 106 | # include <bits/struct_stat_time64_helper.h> | |
| 107 | # else | |
| 101 | 108 | __dev_t st_dev;		/* Device. */ |
| 102 | # ifdef __x86_64__ | |
| 109 | # ifdef __x86_64__ | |
| 103 | 110 | __ino64_t st_ino;		/* File serial number. */ |
| 104 | 111 | __nlink_t st_nlink;		/* Link count. */ |
| 105 | 112 | __mode_t st_mode;		/* File mode. */ |
| 106 | # else | |
| 113 | # else | |
| 107 | 114 | unsigned int __pad1; |
| 108 | 115 | __ino_t __st_ino;			/* 32bit file serial number.	*/ |
| 109 | 116 | __mode_t st_mode;			/* File mode. */ |
| 110 | 117 | __nlink_t st_nlink;			/* Link count. */ |
| 111 | # endif | |
| 118 | # endif | |
| 112 | 119 | __uid_t st_uid;		/* User ID of the file's owner.	*/ |
| 113 | 120 | __gid_t st_gid;		/* Group ID of the file's group.*/ |
| 114 | # ifdef __x86_64__ | |
| 121 | # ifdef __x86_64__ | |
| 115 | 122 | int __pad0; |
| 116 | 123 | __dev_t st_rdev;		/* Device number, if device. */ |
| 117 | 124 | __off_t st_size;		/* Size of file, in bytes. */ |
| 118 | # else | |
| 125 | # else | |
| 119 | 126 | __dev_t st_rdev;			/* Device number, if device. */ |
| 120 | 127 | unsigned int __pad2; |
| 121 | 128 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 122 | # endif | |
| 129 | # endif | |
| 123 | 130 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ |
| 124 | 131 | __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated. */ |
| 125 | # ifdef __USE_XOPEN2K8 | |
| 132 | # ifdef __USE_XOPEN2K8 | |
| 126 | 133 | /* Nanosecond resolution timestamps are stored in a format |
| 127 | 134 | equivalent to 'struct timespec'. This is the type used |
| 128 | 135 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -132,19 +139,20 @@ struct stat64 |
| 132 | 139 | struct timespec st_atim;		/* Time of last access. */ |
| 133 | 140 | struct timespec st_mtim;		/* Time of last modification. */ |
| 134 | 141 | struct timespec st_ctim;		/* Time of last status change. */ |
| 135 | # else | |
| 142 | # else | |
| 136 | 143 | __time_t st_atime;			/* Time of last access. */ |
| 137 | 144 | __syscall_ulong_t st_atimensec;	/* Nscecs of last access. */ |
| 138 | 145 | __time_t st_mtime;			/* Time of last modification. */ |
| 139 | 146 | __syscall_ulong_t st_mtimensec;	/* Nsecs of last modification. */ |
| 140 | 147 | __time_t st_ctime;			/* Time of last status change. */ |
| 141 | 148 | __syscall_ulong_t st_ctimensec;	/* Nsecs of last status change. */ |
| 142 | # endif | |
| 143 | # ifdef __x86_64__ | |
| 149 | # endif | |
| 150 | # ifdef __x86_64__ | |
| 144 | 151 | __syscall_slong_t __glibc_reserved[3]; |
| 145 | # else | |
| 152 | # else | |
| 146 | 153 | __ino64_t st_ino;			/* File serial number.		*/ |
| 147 | # endif | |
| 154 | # endif | |
| 155 | # endif /* __USE_TIME_BITS64 */ | |
| 148 | 156 | }; |
| 149 | 157 | #endif |
| 150 | 158 |
lib/libc/include/x86_64-linux-gnu/bits/types/struct_semid_ds.h+4| ... | ... | @@ -23,6 +23,9 @@ |
| 23 | 23 | /* Data structure describing a set of semaphores. */ |
| 24 | 24 | struct semid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm sem_perm; /* operation permission struct */ |
| 27 | 30 | __time_t sem_otime; /* last semop() time */ |
| 28 | 31 | __syscall_ulong_t __sem_otime_high; |
| ... | ... | @@ -31,4 +34,5 @@ struct semid_ds |
| 31 | 34 | __syscall_ulong_t sem_nsems; /* number of semaphores in set */ |
| 32 | 35 | __syscall_ulong_t __glibc_reserved3; |
| 33 | 36 | __syscall_ulong_t __glibc_reserved4; |
| 37 | #endif | |
| 34 | 38 | }; |
| \ No newline at end of file |
lib/libc/include/x86_64-linux-gnu/gnu/lib-names-64.h+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | #define LIBANL_SO "libanl.so.1" |
| 9 | 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 10 | 10 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | 12 | #define LIBC_SO "libc.so.6" |
| 12 | 13 | #define LIBDL_SO "libdl.so.2" |
| 13 | 14 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/libc/include/x86_64-linux-gnux32/bits/struct_stat.h+49-41| ... | ... | @@ -25,43 +25,46 @@ |
| 25 | 25 | |
| 26 | 26 | struct stat |
| 27 | 27 | { |
| 28 | #ifdef __USE_TIME_BITS64 | |
| 29 | # include <bits/struct_stat_time64_helper.h> | |
| 30 | #else | |
| 28 | 31 | __dev_t st_dev;		/* Device. */ |
| 29 | #ifndef __x86_64__ | |
| 32 | # ifndef __x86_64__ | |
| 30 | 33 | unsigned short int __pad1; |
| 31 | #endif | |
| 32 | #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 34 | # endif | |
| 35 | # if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 33 | 36 | __ino_t st_ino;		/* File serial number.	*/ |
| 34 | #else | |
| 37 | # else | |
| 35 | 38 | __ino_t __st_ino;			/* 32bit file serial number.	*/ |
| 36 | #endif | |
| 37 | #ifndef __x86_64__ | |
| 39 | # endif | |
| 40 | # ifndef __x86_64__ | |
| 38 | 41 | __mode_t st_mode;			/* File mode. */ |
| 39 | 42 | __nlink_t st_nlink;			/* Link count. */ |
| 40 | #else | |
| 43 | # else | |
| 41 | 44 | __nlink_t st_nlink;		/* Link count. */ |
| 42 | 45 | __mode_t st_mode;		/* File mode. */ |
| 43 | #endif | |
| 46 | # endif | |
| 44 | 47 | __uid_t st_uid;		/* User ID of the file's owner.	*/ |
| 45 | 48 | __gid_t st_gid;		/* Group ID of the file's group.*/ |
| 46 | #ifdef __x86_64__ | |
| 49 | # ifdef __x86_64__ | |
| 47 | 50 | int __pad0; |
| 48 | #endif | |
| 51 | # endif | |
| 49 | 52 | __dev_t st_rdev;		/* Device number, if device. */ |
| 50 | #ifndef __x86_64__ | |
| 53 | # ifndef __x86_64__ | |
| 51 | 54 | unsigned short int __pad2; |
| 52 | #endif | |
| 53 | #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 55 | # endif | |
| 56 | # if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 54 | 57 | __off_t st_size;			/* Size of file, in bytes. */ |
| 55 | #else | |
| 58 | # else | |
| 56 | 59 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 57 | #endif | |
| 60 | # endif | |
| 58 | 61 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ |
| 59 | #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 62 | # if defined __x86_64__ || !defined __USE_FILE_OFFSET64 | |
| 60 | 63 | __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 61 | #else | |
| 64 | # else | |
| 62 | 65 | __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */ |
| 63 | #endif | |
| 64 | #ifdef __USE_XOPEN2K8 | |
| 66 | # endif | |
| 67 | # ifdef __USE_XOPEN2K8 | |
| 65 | 68 | /* Nanosecond resolution timestamps are stored in a format |
| 66 | 69 | equivalent to 'struct timespec'. This is the type used |
| 67 | 70 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -71,58 +74,62 @@ struct stat |
| 71 | 74 | struct timespec st_atim;		/* Time of last access. */ |
| 72 | 75 | struct timespec st_mtim;		/* Time of last modification. */ |
| 73 | 76 | struct timespec st_ctim;		/* Time of last status change. */ |
| 74 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 75 | # define st_mtime st_mtim.tv_sec | |
| 76 | # define st_ctime st_ctim.tv_sec | |
| 77 | #else | |
| 77 | # define st_atime st_atim.tv_sec	/* Backward compatibility. */ | |
| 78 | # define st_mtime st_mtim.tv_sec | |
| 79 | # define st_ctime st_ctim.tv_sec | |
| 80 | # else | |
| 78 | 81 | __time_t st_atime;			/* Time of last access. */ |
| 79 | 82 | __syscall_ulong_t st_atimensec;	/* Nscecs of last access. */ |
| 80 | 83 | __time_t st_mtime;			/* Time of last modification. */ |
| 81 | 84 | __syscall_ulong_t st_mtimensec;	/* Nsecs of last modification. */ |
| 82 | 85 | __time_t st_ctime;			/* Time of last status change. */ |
| 83 | 86 | __syscall_ulong_t st_ctimensec;	/* Nsecs of last status change. */ |
| 84 | #endif | |
| 85 | #ifdef __x86_64__ | |
| 87 | # endif | |
| 88 | # ifdef __x86_64__ | |
| 86 | 89 | __syscall_slong_t __glibc_reserved[3]; |
| 87 | #else | |
| 88 | # ifndef __USE_FILE_OFFSET64 | |
| 90 | # else | |
| 91 | # ifndef __USE_FILE_OFFSET64 | |
| 89 | 92 | unsigned long int __glibc_reserved4; |
| 90 | 93 | unsigned long int __glibc_reserved5; |
| 91 | # else | |
| 94 | # else | |
| 92 | 95 | __ino64_t st_ino;			/* File serial number.	*/ |
| 96 | # endif | |
| 93 | 97 | # endif |
| 94 | #endif | |
| 98 | #endif /* __USE_TIME_BITS64 */ | |
| 95 | 99 | }; |
| 96 | 100 | |
| 97 | 101 | #ifdef __USE_LARGEFILE64 |
| 98 | 102 | /* Note stat64 has the same shape as stat for x86-64. */ |
| 99 | 103 | struct stat64 |
| 100 | 104 | { |
| 105 | # ifdef __USE_TIME_BITS64 | |
| 106 | # include <bits/struct_stat_time64_helper.h> | |
| 107 | # else | |
| 101 | 108 | __dev_t st_dev;		/* Device. */ |
| 102 | # ifdef __x86_64__ | |
| 109 | # ifdef __x86_64__ | |
| 103 | 110 | __ino64_t st_ino;		/* File serial number. */ |
| 104 | 111 | __nlink_t st_nlink;		/* Link count. */ |
| 105 | 112 | __mode_t st_mode;		/* File mode. */ |
| 106 | # else | |
| 113 | # else | |
| 107 | 114 | unsigned int __pad1; |
| 108 | 115 | __ino_t __st_ino;			/* 32bit file serial number.	*/ |
| 109 | 116 | __mode_t st_mode;			/* File mode. */ |
| 110 | 117 | __nlink_t st_nlink;			/* Link count. */ |
| 111 | # endif | |
| 118 | # endif | |
| 112 | 119 | __uid_t st_uid;		/* User ID of the file's owner.	*/ |
| 113 | 120 | __gid_t st_gid;		/* Group ID of the file's group.*/ |
| 114 | # ifdef __x86_64__ | |
| 121 | # ifdef __x86_64__ | |
| 115 | 122 | int __pad0; |
| 116 | 123 | __dev_t st_rdev;		/* Device number, if device. */ |
| 117 | 124 | __off_t st_size;		/* Size of file, in bytes. */ |
| 118 | # else | |
| 125 | # else | |
| 119 | 126 | __dev_t st_rdev;			/* Device number, if device. */ |
| 120 | 127 | unsigned int __pad2; |
| 121 | 128 | __off64_t st_size;			/* Size of file, in bytes. */ |
| 122 | # endif | |
| 129 | # endif | |
| 123 | 130 | __blksize_t st_blksize;	/* Optimal block size for I/O. */ |
| 124 | 131 | __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated. */ |
| 125 | # ifdef __USE_XOPEN2K8 | |
| 132 | # ifdef __USE_XOPEN2K8 | |
| 126 | 133 | /* Nanosecond resolution timestamps are stored in a format |
| 127 | 134 | equivalent to 'struct timespec'. This is the type used |
| 128 | 135 | whenever possible but the Unix namespace rules do not allow the |
| ... | ... | @@ -132,19 +139,20 @@ struct stat64 |
| 132 | 139 | struct timespec st_atim;		/* Time of last access. */ |
| 133 | 140 | struct timespec st_mtim;		/* Time of last modification. */ |
| 134 | 141 | struct timespec st_ctim;		/* Time of last status change. */ |
| 135 | # else | |
| 142 | # else | |
| 136 | 143 | __time_t st_atime;			/* Time of last access. */ |
| 137 | 144 | __syscall_ulong_t st_atimensec;	/* Nscecs of last access. */ |
| 138 | 145 | __time_t st_mtime;			/* Time of last modification. */ |
| 139 | 146 | __syscall_ulong_t st_mtimensec;	/* Nsecs of last modification. */ |
| 140 | 147 | __time_t st_ctime;			/* Time of last status change. */ |
| 141 | 148 | __syscall_ulong_t st_ctimensec;	/* Nsecs of last status change. */ |
| 142 | # endif | |
| 143 | # ifdef __x86_64__ | |
| 149 | # endif | |
| 150 | # ifdef __x86_64__ | |
| 144 | 151 | __syscall_slong_t __glibc_reserved[3]; |
| 145 | # else | |
| 152 | # else | |
| 146 | 153 | __ino64_t st_ino;			/* File serial number.		*/ |
| 147 | # endif | |
| 154 | # endif | |
| 155 | # endif /* __USE_TIME_BITS64 */ | |
| 148 | 156 | }; |
| 149 | 157 | #endif |
| 150 | 158 |
lib/libc/include/x86_64-linux-gnux32/bits/types/struct_semid_ds.h+4| ... | ... | @@ -23,6 +23,9 @@ |
| 23 | 23 | /* Data structure describing a set of semaphores. */ |
| 24 | 24 | struct semid_ds |
| 25 | 25 | { |
| 26 | #ifdef __USE_TIME_BITS64 | |
| 27 | # include <bits/types/struct_semid64_ds_helper.h> | |
| 28 | #else | |
| 26 | 29 | struct ipc_perm sem_perm; /* operation permission struct */ |
| 27 | 30 | __time_t sem_otime; /* last semop() time */ |
| 28 | 31 | __syscall_ulong_t __sem_otime_high; |
| ... | ... | @@ -31,4 +34,5 @@ struct semid_ds |
| 31 | 34 | __syscall_ulong_t sem_nsems; /* number of semaphores in set */ |
| 32 | 35 | __syscall_ulong_t __glibc_reserved3; |
| 33 | 36 | __syscall_ulong_t __glibc_reserved4; |
| 37 | #endif | |
| 34 | 38 | }; |
| \ No newline at end of file |
lib/libc/include/x86_64-linux-gnux32/gnu/lib-names-x32.h+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | #define LIBANL_SO "libanl.so.1" |
| 9 | 9 | #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" |
| 10 | 10 | #define LIBCRYPT_SO "libcrypt.so.1" |
| 11 | #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" | |
| 11 | 12 | #define LIBC_SO "libc.so.6" |
| 12 | 13 | #define LIBDL_SO "libdl.so.2" |
| 13 | 14 | #define LIBGCC_S_SO "libgcc_s.so.1" |
lib/std/target.zig+2-2| ... | ... | @@ -329,9 +329,9 @@ pub const Target = struct { |
| 329 | 329 | .linux = .{ |
| 330 | 330 | .range = .{ |
| 331 | 331 | .min = .{ .major = 3, .minor = 16 }, |
| 332 | .max = .{ .major = 5, .minor = 5, .patch = 5 }, | |
| 332 | .max = .{ .major = 5, .minor = 10, .patch = 81 }, | |
| 333 | 333 | }, |
| 334 | .glibc = .{ .major = 2, .minor = 17 }, | |
| 334 | .glibc = .{ .major = 2, .minor = 19 }, | |
| 335 | 335 | }, |
| 336 | 336 | }, |
| 337 | 337 |
src/Compilation.zig+27-11| ... | ... | @@ -1586,9 +1586,23 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1586 | 1586 | // If we need to build glibc for the target, add work items for it. |
| 1587 | 1587 | // We go through the work queue so that building can be done in parallel. |
| 1588 | 1588 | if (comp.wantBuildGLibCFromSource()) { |
| 1589 | try comp.addBuildingGLibCJobs(); | |
| 1589 | if (!target_util.canBuildLibC(comp.getTarget())) return error.LibCUnavailable; | |
| 1590 | ||
| 1591 | if (glibc.needsCrtiCrtn(comp.getTarget())) { | |
| 1592 | try comp.work_queue.write(&[_]Job{ | |
| 1593 | .{ .glibc_crt_file = .crti_o }, | |
| 1594 | .{ .glibc_crt_file = .crtn_o }, | |
| 1595 | }); | |
| 1596 | } | |
| 1597 | try comp.work_queue.write(&[_]Job{ | |
| 1598 | .{ .glibc_crt_file = .scrt1_o }, | |
| 1599 | .{ .glibc_crt_file = .libc_nonshared_a }, | |
| 1600 | .{ .glibc_shared_objects = {} }, | |
| 1601 | }); | |
| 1590 | 1602 | } |
| 1591 | 1603 | if (comp.wantBuildMuslFromSource()) { |
| 1604 | if (!target_util.canBuildLibC(comp.getTarget())) return error.LibCUnavailable; | |
| 1605 | ||
| 1592 | 1606 | try comp.work_queue.ensureUnusedCapacity(6); |
| 1593 | 1607 | if (musl.needsCrtiCrtn(comp.getTarget())) { |
| 1594 | 1608 | comp.work_queue.writeAssumeCapacity(&[_]Job{ |
| ... | ... | @@ -1607,6 +1621,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1607 | 1621 | }); |
| 1608 | 1622 | } |
| 1609 | 1623 | if (comp.wantBuildWasiLibcFromSource()) { |
| 1624 | if (!target_util.canBuildLibC(comp.getTarget())) return error.LibCUnavailable; | |
| 1625 | ||
| 1610 | 1626 | const wasi_emulated_libs = comp.bin_file.options.wasi_emulated_libs; |
| 1611 | 1627 | try comp.work_queue.ensureUnusedCapacity(wasi_emulated_libs.len + 2); // worst-case we need all components |
| 1612 | 1628 | for (wasi_emulated_libs) |crt_file| { |
| ... | ... | @@ -1620,6 +1636,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1620 | 1636 | }); |
| 1621 | 1637 | } |
| 1622 | 1638 | if (comp.wantBuildMinGWFromSource()) { |
| 1639 | if (!target_util.canBuildLibC(comp.getTarget())) return error.LibCUnavailable; | |
| 1640 | ||
| 1623 | 1641 | const static_lib_jobs = [_]Job{ |
| 1624 | 1642 | .{ .mingw_crt_file = .mingw32_lib }, |
| 1625 | 1643 | .{ .mingw_crt_file = .msvcrt_os_lib }, |
| ... | ... | @@ -3397,6 +3415,14 @@ pub fn addCCArgs( |
| 3397 | 3415 | try argv.append(libunwind_include_path); |
| 3398 | 3416 | } |
| 3399 | 3417 | |
| 3418 | if (comp.bin_file.options.link_libc and target.isGnuLibC()) { | |
| 3419 | const target_version = target.os.version_range.linux.glibc; | |
| 3420 | const glibc_minor_define = try std.fmt.allocPrint(arena, "-D__GLIBC_MINOR__={d}", .{ | |
| 3421 | target_version.minor, | |
| 3422 | }); | |
| 3423 | try argv.append(glibc_minor_define); | |
| 3424 | } | |
| 3425 | ||
| 3400 | 3426 | const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target); |
| 3401 | 3427 | try argv.appendSlice(&[_][]const u8{ "-target", llvm_triple }); |
| 3402 | 3428 | |
| ... | ... | @@ -4038,16 +4064,6 @@ pub fn get_libc_crt_file(comp: *Compilation, arena: Allocator, basename: []const |
| 4038 | 4064 | return full_path; |
| 4039 | 4065 | } |
| 4040 | 4066 | |
| 4041 | fn addBuildingGLibCJobs(comp: *Compilation) !void { | |
| 4042 | try comp.work_queue.write(&[_]Job{ | |
| 4043 | .{ .glibc_crt_file = .crti_o }, | |
| 4044 | .{ .glibc_crt_file = .crtn_o }, | |
| 4045 | .{ .glibc_crt_file = .scrt1_o }, | |
| 4046 | .{ .glibc_crt_file = .libc_nonshared_a }, | |
| 4047 | .{ .glibc_shared_objects = {} }, | |
| 4048 | }); | |
| 4049 | } | |
| 4050 | ||
| 4051 | 4067 | fn wantBuildLibCFromSource(comp: Compilation) bool { |
| 4052 | 4068 | const is_exe_or_dyn_lib = switch (comp.bin_file.options.output_mode) { |
| 4053 | 4069 | .Obj => false, |
src/glibc.zig+68-54| ... | ... | @@ -269,72 +269,78 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { |
| 269 | 269 | return comp.build_crt_file("Scrt1", .Obj, &[_]Compilation.CSourceFile{ start_os, abi_note_o }); |
| 270 | 270 | }, |
| 271 | 271 | .libc_nonshared_a => { |
| 272 | const deps = [_][]const u8{ | |
| 273 | lib_libc_glibc ++ "stdlib" ++ path.sep_str ++ "atexit.c", | |
| 274 | lib_libc_glibc ++ "stdlib" ++ path.sep_str ++ "at_quick_exit.c", | |
| 275 | lib_libc_glibc ++ "io" ++ path.sep_str ++ "stat.c", | |
| 276 | lib_libc_glibc ++ "io" ++ path.sep_str ++ "fstat.c", | |
| 277 | lib_libc_glibc ++ "io" ++ path.sep_str ++ "lstat.c", | |
| 278 | lib_libc_glibc ++ "io" ++ path.sep_str ++ "stat64.c", | |
| 279 | lib_libc_glibc ++ "io" ++ path.sep_str ++ "fstat64.c", | |
| 280 | lib_libc_glibc ++ "io" ++ path.sep_str ++ "lstat64.c", | |
| 281 | lib_libc_glibc ++ "io" ++ path.sep_str ++ "fstatat.c", | |
| 282 | lib_libc_glibc ++ "io" ++ path.sep_str ++ "fstatat64.c", | |
| 283 | lib_libc_glibc ++ "io" ++ path.sep_str ++ "mknod.c", | |
| 284 | lib_libc_glibc ++ "io" ++ path.sep_str ++ "mknodat.c", | |
| 285 | lib_libc_glibc ++ "nptl" ++ path.sep_str ++ "pthread_atfork.c", | |
| 286 | lib_libc_glibc ++ "debug" ++ path.sep_str ++ "stack_chk_fail_local.c", | |
| 272 | const target = comp.getTarget(); | |
| 273 | const s = path.sep_str; | |
| 274 | const linux_prefix = lib_libc_glibc ++ | |
| 275 | "sysdeps" ++ s ++ "unix" ++ s ++ "sysv" ++ s ++ "linux" ++ s; | |
| 276 | const Flavor = enum { nonshared, shared }; | |
| 277 | const Dep = struct { | |
| 278 | path: []const u8, | |
| 279 | flavor: Flavor = .shared, | |
| 287 | 280 | }; |
| 288 | ||
| 289 | var c_source_files: [deps.len + 1]Compilation.CSourceFile = undefined; | |
| 290 | ||
| 291 | c_source_files[0] = blk: { | |
| 292 | var args = std.ArrayList([]const u8).init(arena); | |
| 293 | try args.appendSlice(&[_][]const u8{ | |
| 294 | "-std=gnu11", | |
| 295 | "-fgnu89-inline", | |
| 296 | "-fmerge-all-constants", | |
| 297 | "-fno-stack-protector", | |
| 298 | "-fmath-errno", | |
| 299 | "-fno-stack-protector", | |
| 300 | "-I", | |
| 301 | try lib_path(comp, arena, lib_libc_glibc ++ "csu"), | |
| 302 | }); | |
| 303 | try add_include_dirs(comp, arena, &args); | |
| 304 | try args.appendSlice(&[_][]const u8{ | |
| 305 | "-DSTACK_PROTECTOR_LEVEL=0", | |
| 306 | "-fPIC", | |
| 307 | "-fno-stack-protector", | |
| 308 | "-ftls-model=initial-exec", | |
| 309 | "-D_LIBC_REENTRANT", | |
| 310 | "-include", | |
| 311 | try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-modules.h"), | |
| 312 | "-DMODULE_NAME=libc", | |
| 313 | "-Wno-nonportable-include-path", | |
| 314 | "-include", | |
| 315 | try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"), | |
| 316 | "-DPIC", | |
| 317 | "-DLIBC_NONSHARED=1", | |
| 318 | "-DTOP_NAMESPACE=glibc", | |
| 319 | }); | |
| 320 | break :blk .{ | |
| 321 | .src_path = try lib_path(comp, arena, lib_libc_glibc ++ "csu" ++ path.sep_str ++ "elf-init.c"), | |
| 322 | .extra_flags = args.items, | |
| 323 | }; | |
| 281 | const deps = [_]Dep{ | |
| 282 | .{ | |
| 283 | .path = lib_libc_glibc ++ "stdlib" ++ s ++ "atexit.c", | |
| 284 | .flavor = .nonshared, | |
| 285 | }, | |
| 286 | .{ | |
| 287 | .path = lib_libc_glibc ++ "stdlib" ++ s ++ "at_quick_exit.c", | |
| 288 | .flavor = .nonshared, | |
| 289 | }, | |
| 290 | .{ | |
| 291 | .path = lib_libc_glibc ++ "sysdeps" ++ s ++ "pthread" ++ s ++ "pthread_atfork.c", | |
| 292 | .flavor = .nonshared, | |
| 293 | }, | |
| 294 | .{ | |
| 295 | .path = lib_libc_glibc ++ "debug" ++ s ++ "stack_chk_fail_local.c", | |
| 296 | .flavor = .nonshared, | |
| 297 | }, | |
| 298 | .{ .path = lib_libc_glibc ++ "csu" ++ s ++ "errno.c" }, | |
| 299 | .{ .path = linux_prefix ++ "stat.c" }, | |
| 300 | .{ .path = linux_prefix ++ "fstat.c" }, | |
| 301 | .{ .path = linux_prefix ++ "lstat.c" }, | |
| 302 | .{ .path = linux_prefix ++ "stat64.c" }, | |
| 303 | .{ .path = linux_prefix ++ "fstat64.c" }, | |
| 304 | .{ .path = linux_prefix ++ "lstat64.c" }, | |
| 305 | .{ .path = linux_prefix ++ "fstatat.c" }, | |
| 306 | .{ .path = linux_prefix ++ "fstatat64.c" }, | |
| 307 | .{ .path = linux_prefix ++ "mknodat.c" }, | |
| 308 | .{ .path = lib_libc_glibc ++ "io" ++ s ++ "mknod.c" }, | |
| 309 | .{ .path = linux_prefix ++ "stat_t64_cp.c" }, | |
| 324 | 310 | }; |
| 325 | 311 | |
| 312 | var c_source_files: [deps.len]Compilation.CSourceFile = undefined; | |
| 313 | ||
| 326 | 314 | for (deps) |dep, i| { |
| 327 | 315 | var args = std.ArrayList([]const u8).init(arena); |
| 328 | 316 | try args.appendSlice(&[_][]const u8{ |
| 329 | 317 | "-std=gnu11", |
| 330 | 318 | "-fgnu89-inline", |
| 331 | 319 | "-fmerge-all-constants", |
| 320 | // glibc sets this flag but clang does not support it. | |
| 321 | // "-frounding-math", | |
| 332 | 322 | "-fno-stack-protector", |
| 323 | "-fno-common", | |
| 333 | 324 | "-fmath-errno", |
| 334 | 325 | "-ftls-model=initial-exec", |
| 335 | 326 | "-Wno-ignored-attributes", |
| 336 | 327 | }); |
| 337 | 328 | try add_include_dirs(comp, arena, &args); |
| 329 | ||
| 330 | if (target.cpu.arch == .i386) { | |
| 331 | // This prevents i386/sysdep.h from trying to do some | |
| 332 | // silly and unnecessary inline asm hack that uses weird | |
| 333 | // syntax that clang does not support. | |
| 334 | try args.append("-DCAN_USE_REGISTER_ASM_EBP"); | |
| 335 | } | |
| 336 | ||
| 337 | const shared_def = switch (dep.flavor) { | |
| 338 | .nonshared => "-DLIBC_NONSHARED=1", | |
| 339 | // glibc passes `-DSHARED` for these. However, empirically if | |
| 340 | // we do that here we will see undefined symbols such as `__GI_memcpy`. | |
| 341 | // So we pass the same thing as for nonshared. | |
| 342 | .shared => "-DLIBC_NONSHARED=1", | |
| 343 | }; | |
| 338 | 344 | try args.appendSlice(&[_][]const u8{ |
| 339 | 345 | "-D_LIBC_REENTRANT", |
| 340 | 346 | "-include", |
| ... | ... | @@ -344,11 +350,11 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { |
| 344 | 350 | "-include", |
| 345 | 351 | try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"), |
| 346 | 352 | "-DPIC", |
| 347 | "-DLIBC_NONSHARED=1", | |
| 353 | shared_def, | |
| 348 | 354 | "-DTOP_NAMESPACE=glibc", |
| 349 | 355 | }); |
| 350 | c_source_files[i + 1] = .{ | |
| 351 | .src_path = try lib_path(comp, arena, dep), | |
| 356 | c_source_files[i] = .{ | |
| 357 | .src_path = try lib_path(comp, arena, dep.path), | |
| 352 | 358 | .extra_flags = args.items, |
| 353 | 359 | }; |
| 354 | 360 | } |
| ... | ... | @@ -1093,3 +1099,11 @@ fn buildSharedLib( |
| 1093 | 1099 | |
| 1094 | 1100 | try sub_compilation.updateSubCompilation(); |
| 1095 | 1101 | } |
| 1102 | ||
| 1103 | // Return true if glibc has crti/crtn sources for that architecture. | |
| 1104 | pub fn needsCrtiCrtn(target: std.Target) bool { | |
| 1105 | return switch (target.cpu.arch) { | |
| 1106 | .riscv32, .riscv64 => false, | |
| 1107 | else => true, | |
| 1108 | }; | |
| 1109 | } |
src/main.zig+22-2| ... | ... | @@ -2495,8 +2495,28 @@ fn buildOutputType( |
| 2495 | 2495 | .debug_compile_errors = debug_compile_errors, |
| 2496 | 2496 | .enable_link_snapshots = enable_link_snapshots, |
| 2497 | 2497 | .native_darwin_sdk = native_darwin_sdk, |
| 2498 | }) catch |err| { | |
| 2499 | fatal("unable to create compilation: {s}", .{@errorName(err)}); | |
| 2498 | }) catch |err| switch (err) { | |
| 2499 | error.LibCUnavailable => { | |
| 2500 | const target = target_info.target; | |
| 2501 | const triple_name = try target.zigTriple(arena); | |
| 2502 | std.log.err("unable to find or provide libc for target '{s}'", .{triple_name}); | |
| 2503 | ||
| 2504 | for (target_util.available_libcs) |t| { | |
| 2505 | if (t.arch == target.cpu.arch and t.os == target.os.tag) { | |
| 2506 | if (t.os_ver) |os_ver| { | |
| 2507 | std.log.info("zig can provide libc for related target {s}-{s}.{d}-{s}", .{ | |
| 2508 | @tagName(t.arch), @tagName(t.os), os_ver.major, @tagName(t.abi), | |
| 2509 | }); | |
| 2510 | } else { | |
| 2511 | std.log.info("zig can provide libc for related target {s}-{s}-{s}", .{ | |
| 2512 | @tagName(t.arch), @tagName(t.os), @tagName(t.abi), | |
| 2513 | }); | |
| 2514 | } | |
| 2515 | } | |
| 2516 | } | |
| 2517 | process.exit(1); | |
| 2518 | }, | |
| 2519 | else => fatal("unable to create compilation: {s}", .{@errorName(err)}), | |
| 2500 | 2520 | }; |
| 2501 | 2521 | var comp_destroyed = false; |
| 2502 | 2522 | defer if (!comp_destroyed) comp.destroy(); |
src/target.zig+6-3| ... | ... | @@ -44,15 +44,18 @@ pub const available_libcs = [_]ArchOsAbi{ |
| 44 | 44 | .{ .arch = .mips64, .os = .linux, .abi = .gnuabi64 }, |
| 45 | 45 | .{ .arch = .mips64, .os = .linux, .abi = .gnuabin32 }, |
| 46 | 46 | .{ .arch = .mips64, .os = .linux, .abi = .musl }, |
| 47 | .{ .arch = .mipsel, .os = .linux, .abi = .gnu }, | |
| 47 | .{ .arch = .mipsel, .os = .linux, .abi = .gnueabi }, | |
| 48 | .{ .arch = .mipsel, .os = .linux, .abi = .gnueabihf }, | |
| 48 | 49 | .{ .arch = .mipsel, .os = .linux, .abi = .musl }, |
| 49 | .{ .arch = .mips, .os = .linux, .abi = .gnu }, | |
| 50 | .{ .arch = .mips, .os = .linux, .abi = .gnueabi }, | |
| 51 | .{ .arch = .mips, .os = .linux, .abi = .gnueabihf }, | |
| 50 | 52 | .{ .arch = .mips, .os = .linux, .abi = .musl }, |
| 51 | 53 | .{ .arch = .powerpc64le, .os = .linux, .abi = .gnu }, |
| 52 | 54 | .{ .arch = .powerpc64le, .os = .linux, .abi = .musl }, |
| 53 | 55 | .{ .arch = .powerpc64, .os = .linux, .abi = .gnu }, |
| 54 | 56 | .{ .arch = .powerpc64, .os = .linux, .abi = .musl }, |
| 55 | .{ .arch = .powerpc, .os = .linux, .abi = .gnu }, | |
| 57 | .{ .arch = .powerpc, .os = .linux, .abi = .gnueabi }, | |
| 58 | .{ .arch = .powerpc, .os = .linux, .abi = .gnueabihf }, | |
| 56 | 59 | .{ .arch = .powerpc, .os = .linux, .abi = .musl }, |
| 57 | 60 | .{ .arch = .riscv64, .os = .linux, .abi = .gnu }, |
| 58 | 61 | .{ .arch = .riscv64, .os = .linux, .abi = .musl }, |
test/standalone.zig+1| ... | ... | @@ -84,5 +84,6 @@ pub fn addCases(cases: *tests.StandaloneContext) void { |
| 84 | 84 | cases.add("tools/gen_stubs.zig"); |
| 85 | 85 | cases.add("tools/update_clang_options.zig"); |
| 86 | 86 | cases.add("tools/update_cpu_features.zig"); |
| 87 | cases.add("tools/update_glibc.zig"); | |
| 87 | 88 | cases.add("tools/update_spirv_features.zig"); |
| 88 | 89 | } |
test/tests.zig+11-2| ... | ... | @@ -189,7 +189,7 @@ const test_targets = blk: { |
| 189 | 189 | // .target = .{ |
| 190 | 190 | // .cpu_arch = .mips, |
| 191 | 191 | // .os_tag = .linux, |
| 192 | // .abi = .gnu, | |
| 192 | // .abi = .gnueabihf, | |
| 193 | 193 | // }, |
| 194 | 194 | // .link_libc = true, |
| 195 | 195 | //}, |
| ... | ... | @@ -216,7 +216,7 @@ const test_targets = blk: { |
| 216 | 216 | // .target = .{ |
| 217 | 217 | // .cpu_arch = .mipsel, |
| 218 | 218 | // .os_tag = .linux, |
| 219 | // .abi = .gnu, | |
| 219 | // .abi = .gnueabihf, | |
| 220 | 220 | // }, |
| 221 | 221 | // .link_libc = true, |
| 222 | 222 | //}, |
| ... | ... | @@ -236,6 +236,15 @@ const test_targets = blk: { |
| 236 | 236 | }, |
| 237 | 237 | .link_libc = true, |
| 238 | 238 | }, |
| 239 | // https://github.com/ziglang/zig/issues/2256 | |
| 240 | //TestTarget{ | |
| 241 | // .target = .{ | |
| 242 | // .cpu_arch = .powerpc, | |
| 243 | // .os_tag = .linux, | |
| 244 | // .abi = .gnueabihf, | |
| 245 | // }, | |
| 246 | // .link_libc = true, | |
| 247 | //}, | |
| 239 | 248 | |
| 240 | 249 | TestTarget{ |
| 241 | 250 | .target = .{ |
tools/process_headers.zig+18-3| ... | ... | @@ -122,12 +122,22 @@ const glibc_targets = [_]LibCTarget{ |
| 122 | 122 | LibCTarget{ |
| 123 | 123 | .name = "mipsel-linux-gnu", |
| 124 | 124 | .arch = MultiArch{ .specific = Arch.mipsel }, |
| 125 | .abi = MultiAbi{ .specific = Abi.gnu }, | |
| 125 | .abi = MultiAbi{ .specific = Abi.gnueabihf }, | |
| 126 | }, | |
| 127 | LibCTarget{ | |
| 128 | .name = "mipsel-linux-gnu-soft", | |
| 129 | .arch = MultiArch{ .specific = Arch.mipsel }, | |
| 130 | .abi = MultiAbi{ .specific = Abi.gnueabi }, | |
| 126 | 131 | }, |
| 127 | 132 | LibCTarget{ |
| 128 | 133 | .name = "mips-linux-gnu", |
| 129 | 134 | .arch = MultiArch{ .specific = Arch.mips }, |
| 130 | .abi = MultiAbi{ .specific = Abi.gnu }, | |
| 135 | .abi = MultiAbi{ .specific = Abi.gnueabihf }, | |
| 136 | }, | |
| 137 | LibCTarget{ | |
| 138 | .name = "mips-linux-gnu-soft", | |
| 139 | .arch = MultiArch{ .specific = Arch.mips }, | |
| 140 | .abi = MultiAbi{ .specific = Abi.gnueabi }, | |
| 131 | 141 | }, |
| 132 | 142 | LibCTarget{ |
| 133 | 143 | .name = "powerpc64le-linux-gnu", |
| ... | ... | @@ -142,7 +152,12 @@ const glibc_targets = [_]LibCTarget{ |
| 142 | 152 | LibCTarget{ |
| 143 | 153 | .name = "powerpc-linux-gnu", |
| 144 | 154 | .arch = MultiArch{ .specific = Arch.powerpc }, |
| 145 | .abi = MultiAbi{ .specific = Abi.gnu }, | |
| 155 | .abi = MultiAbi{ .specific = Abi.gnueabihf }, | |
| 156 | }, | |
| 157 | LibCTarget{ | |
| 158 | .name = "powerpc-linux-gnu-soft", | |
| 159 | .arch = MultiArch{ .specific = Arch.powerpc }, | |
| 160 | .abi = MultiAbi{ .specific = Abi.gnueabi }, | |
| 146 | 161 | }, |
| 147 | 162 | LibCTarget{ |
| 148 | 163 | .name = "riscv64-linux-gnu-rv64imac-lp64", |
tools/update_glibc.zig created+144| ... | ... | @@ -0,0 +1,144 @@ |
| 1 | //! This script updates the .c, .h, .s, and .S files that make up the start | |
| 2 | //! files such as crt1.o. Not to be confused with | |
| 3 | //! https://github.com/ziglang/glibc-abi-tool/ which updates the `abilists` | |
| 4 | //! file. | |
| 5 | //! | |
| 6 | //! Example usage: | |
| 7 | //! `zig run ../tools/update_glibc.zig -- ~/Downloads/glibc ..` | |
| 8 | ||
| 9 | const std = @import("std"); | |
| 10 | const mem = std.mem; | |
| 11 | const log = std.log; | |
| 12 | const fs = std.fs; | |
| 13 | ||
| 14 | const exempt_files = [_][]const u8{ | |
| 15 | // This file is maintained by a separate project and does not come from glibc. | |
| 16 | "abilists", | |
| 17 | ||
| 18 | // Generated files. | |
| 19 | "include/libc-modules.h", | |
| 20 | "include/config.h", | |
| 21 | ||
| 22 | // These are easier to maintain like this, without updating to the abi-note.c | |
| 23 | // that glibc did upstream. | |
| 24 | "csu/abi-tag.h", | |
| 25 | "csu/abi-note.S", | |
| 26 | ||
| 27 | // We have patched these files to require fewer includes. | |
| 28 | "stdlib/at_quick_exit.c", | |
| 29 | "stdlib/atexit.c", | |
| 30 | "sysdeps/pthread/pthread_atfork.c", | |
| 31 | }; | |
| 32 | ||
| 33 | pub fn main() !void { | |
| 34 | var arena_instance = std.heap.ArenaAllocator.init(std.heap.page_allocator); | |
| 35 | defer arena_instance.deinit(); | |
| 36 | const arena = arena_instance.allocator(); | |
| 37 | ||
| 38 | const args = try std.process.argsAlloc(arena); | |
| 39 | const glibc_src_path = args[1]; | |
| 40 | const zig_src_path = args[2]; | |
| 41 | ||
| 42 | const dest_dir_path = try std.fmt.allocPrint(arena, "{s}/lib/libc/glibc", .{zig_src_path}); | |
| 43 | ||
| 44 | var dest_dir = fs.cwd().openDir(dest_dir_path, .{ .iterate = true }) catch |err| { | |
| 45 | fatal("unable to open destination directory '{s}': {s}", .{ | |
| 46 | dest_dir_path, @errorName(err), | |
| 47 | }); | |
| 48 | }; | |
| 49 | defer dest_dir.close(); | |
| 50 | ||
| 51 | var glibc_src_dir = try fs.cwd().openDir(glibc_src_path, .{}); | |
| 52 | defer glibc_src_dir.close(); | |
| 53 | ||
| 54 | // Copy updated files from upstream. | |
| 55 | { | |
| 56 | var walker = try dest_dir.walk(arena); | |
| 57 | defer walker.deinit(); | |
| 58 | ||
| 59 | walk: while (try walker.next()) |entry| { | |
| 60 | if (entry.kind != .File) continue; | |
| 61 | if (mem.startsWith(u8, entry.basename, ".")) continue; | |
| 62 | for (exempt_files) |p| { | |
| 63 | if (mem.eql(u8, entry.path, p)) continue :walk; | |
| 64 | } | |
| 65 | ||
| 66 | glibc_src_dir.copyFile(entry.path, dest_dir, entry.path, .{}) catch |err| { | |
| 67 | log.warn("unable to copy '{s}/{s}' to '{s}/{s}': {s}", .{ | |
| 68 | glibc_src_path, entry.path, | |
| 69 | dest_dir_path, entry.path, | |
| 70 | @errorName(err), | |
| 71 | }); | |
| 72 | if (err == error.FileNotFound) { | |
| 73 | try dest_dir.deleteFile(entry.path); | |
| 74 | } | |
| 75 | }; | |
| 76 | } | |
| 77 | } | |
| 78 | ||
| 79 | // Warn about duplicated files inside glibc/include/* that can be omitted | |
| 80 | // because they are already in generic-glibc/*. | |
| 81 | ||
| 82 | var include_dir = dest_dir.openDir("include", .{ .iterate = true }) catch |err| { | |
| 83 | fatal("unable to open directory '{s}/include': {s}", .{ | |
| 84 | dest_dir_path, @errorName(err), | |
| 85 | }); | |
| 86 | }; | |
| 87 | defer include_dir.close(); | |
| 88 | ||
| 89 | const generic_glibc_path = try std.fmt.allocPrint( | |
| 90 | arena, | |
| 91 | "{s}/lib/libc/include/generic-glibc", | |
| 92 | .{zig_src_path}, | |
| 93 | ); | |
| 94 | var generic_glibc_dir = try fs.cwd().openDir(generic_glibc_path, .{}); | |
| 95 | defer generic_glibc_dir.close(); | |
| 96 | ||
| 97 | var walker = try include_dir.walk(arena); | |
| 98 | defer walker.deinit(); | |
| 99 | ||
| 100 | walk: while (try walker.next()) |entry| { | |
| 101 | if (entry.kind != .File) continue; | |
| 102 | if (mem.startsWith(u8, entry.basename, ".")) continue; | |
| 103 | for (exempt_files) |p| { | |
| 104 | if (mem.eql(u8, entry.path, p)) continue :walk; | |
| 105 | } | |
| 106 | ||
| 107 | const max_file_size = 10 * 1024 * 1024; | |
| 108 | ||
| 109 | const generic_glibc_contents = generic_glibc_dir.readFileAlloc( | |
| 110 | arena, | |
| 111 | entry.path, | |
| 112 | max_file_size, | |
| 113 | ) catch |err| switch (err) { | |
| 114 | error.FileNotFound => continue, | |
| 115 | else => |e| fatal("unable to load '{s}/include/{s}': {s}", .{ | |
| 116 | generic_glibc_path, entry.path, @errorName(e), | |
| 117 | }), | |
| 118 | }; | |
| 119 | const glibc_include_contents = include_dir.readFileAlloc( | |
| 120 | arena, | |
| 121 | entry.path, | |
| 122 | max_file_size, | |
| 123 | ) catch |err| { | |
| 124 | fatal("unable to load '{s}/include/{s}': {s}", .{ | |
| 125 | dest_dir_path, entry.path, @errorName(err), | |
| 126 | }); | |
| 127 | }; | |
| 128 | ||
| 129 | const whitespace = " \r\n\t"; | |
| 130 | const generic_glibc_trimmed = mem.trim(u8, generic_glibc_contents, whitespace); | |
| 131 | const glibc_include_trimmed = mem.trim(u8, glibc_include_contents, whitespace); | |
| 132 | if (mem.eql(u8, generic_glibc_trimmed, glibc_include_trimmed)) { | |
| 133 | log.warn("same contents: '{s}/include/{s}' and '{s}/include/{s}'", .{ | |
| 134 | generic_glibc_path, entry.path, | |
| 135 | dest_dir_path, entry.path, | |
| 136 | }); | |
| 137 | } | |
| 138 | } | |
| 139 | } | |
| 140 | ||
| 141 | fn fatal(comptime format: []const u8, args: anytype) noreturn { | |
| 142 | log.err(format, args); | |
| 143 | std.process.exit(1); | |
| 144 | } |