authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-12-16 13:16:14-08:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2021-12-16 13:16:14-08:00
log58f669dc8c4fa9f78d73d014e805a506009f3d30
tree4343603e48044a8c1123ef5ad495a88bb164788d
parent877a1f2a2986e02269c64a05456dff521da27ac1
parent9257669cd4ecb10c51baea2bccee993e0c82bd20
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #10339 from ziglang/update-glibc

update glibc to 2.34

888 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Macros to control TS 18661-3 glibc features where the same
22 definitions are appropriate for all platforms.
3 Copyright (C) 2017-2020 Free Software Foundation, Inc.
3 Copyright (C) 2017-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -44,8 +44,26 @@
4444
4545/* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__
4646 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.) */
4967#undef __GLIBC_USE_IEC_60559_BFP_EXT
5068#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_BFP_EXT__
5169# define __GLIBC_USE_IEC_60559_BFP_EXT 1
......@@ -58,6 +76,12 @@
5876#else
5977# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0
6078#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
6185
6286/* ISO/IEC TS 18661-4:2015 defines the
6387 __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction
lib/libc/glibc/bits/long-double.h+15-2
......@@ -1,5 +1,5 @@
11/* Properties of long double type.
2 Copyright (C) 2016-2020 Free Software Foundation, Inc.
2 Copyright (C) 2016-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -37,4 +37,17 @@
3737#ifndef __NO_LONG_DOUBLE_MATH
3838# define __NO_LONG_DOUBLE_MATH 1
3939#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.
22 This file is part of the GNU C Library.
33
44 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 @@
11/* Signal number constants. Generic template.
2 Copyright (C) 1991-2020 Free Software Foundation, Inc.
2 Copyright (C) 1991-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -57,31 +57,9 @@
5757#define SIGQUIT 3 /* Quit. */
5858#define SIGTRAP 5 /* Trace/breakpoint trap. */
5959#define SIGKILL 9 /* Killed. */
60#define SIGBUS 10 /* Bus error. */
61#define SIGSYS 12 /* Bad system call. */
6260#define SIGPIPE 13 /* Broken pipe. */
6361#define SIGALRM 14 /* Alarm clock. */
6462
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
8563/* Archaic names for compatibility. */
8664#define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */
8765#define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP-11. */
......@@ -93,8 +71,9 @@
9371 but some real-time signals may be used internally by glibc. Do not
9472 use these constants in application code; use SIGRTMIN and SIGRTMAX
9573 (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>
9877
9978/* Biggest signal number + 1 (including real-time signals). */
10079#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.
22 This file is part of the GNU C Library.
33
44 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 @@
11/* Define intN_t types.
2 Copyright (C) 2017-2020 Free Software Foundation, Inc.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Perform binary search - inline version.
2 Copyright (C) 1991-2020 Free Software Foundation, Inc.
2 Copyright (C) 1991-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Sched parameter structure. Generic version.
2 Copyright (C) 1996-2020 Free Software Foundation, Inc.
2 Copyright (C) 1996-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -50,6 +50,7 @@
5050#define __TIME_T_TYPE __SLONGWORD_TYPE
5151#define __USECONDS_T_TYPE __U32_TYPE
5252#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
53#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
5354#define __DADDR_T_TYPE __S32_TYPE
5455#define __KEY_T_TYPE __S32_TYPE
5556#define __CLOCKID_T_TYPE __S32_TYPE
......@@ -75,10 +76,16 @@
7576
7677/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
7778# define __STATFS_MATCHES_STATFS64 1
79
80/* And for getitimer, setitimer and rusage */
81# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
7882#else
7983# define __RLIM_T_MATCHES_RLIM64_T 0
8084
8185# define __STATFS_MATCHES_STATFS64 0
86
87/* And for getitimer, setitimer and rusage */
88# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
8289#endif
8390
8491/* Number of descriptors that can fit in an `fd_set'. */
lib/libc/glibc/bits/uintn-identity.h+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -24,3 +24,11 @@
2424/* Bits in the third argument to `waitpid'. */
2525#define WNOHANG 1 /* Don't block waiting. */
2626#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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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. */
40extern void (*__preinit_array_start []) (int, char **, char **)
41 attribute_hidden;
42extern void (*__preinit_array_end []) (int, char **, char **)
43 attribute_hidden;
44extern void (*__init_array_start []) (int, char **, char **)
45 attribute_hidden;
46extern void (*__init_array_end []) (int, char **, char **)
47 attribute_hidden;
48extern void (*__fini_array_start []) (void) attribute_hidden;
49extern 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. */
55extern void _init (void);
56extern 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
66void
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. */
94void
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. */
27int rtld_errno attribute_hidden;
28
29#else
30
31__thread int errno;
32extern __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.
22 This file is part of the GNU C Library.
33
44 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -19,10 +19,6 @@
1919#ifndef _ELF_H
2020#define _ELF_H 1
2121
22#include <features.h>
23
24__BEGIN_DECLS
25
2622/* Standard ELF types. */
2723
2824#include <stdint.h>
......@@ -322,7 +318,7 @@ typedef struct
322318 /* reserved 184 */
323319#define EM_AVR32 185 /* Amtel 32-bit microprocessor */
324320#define EM_STM8 186 /* STMicroelectronics STM8 */
325#define EM_TILE64 187 /* Tileta TILE64 */
321#define EM_TILE64 187 /* Tilera TILE64 */
326322#define EM_TILEPRO 188 /* Tilera TILEPro */
327323#define EM_MICROBLAZE 189 /* Xilinx MicroBlaze */
328324#define EM_CUDA 190 /* NVIDIA CUDA */
......@@ -330,7 +326,7 @@ typedef struct
330326#define EM_CLOUDSHIELD 192 /* CloudShield */
331327#define EM_COREA_1ST 193 /* KIPO-KAIST Core-A 1st gen. */
332328#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. */
334330#define EM_OPEN8 196 /* Open8 RISC */
335331#define EM_RL78 197 /* Renesas RL78 */
336332#define EM_VIDEOCORE5 198 /* Broadcom VideoCore V */
......@@ -340,7 +336,8 @@ typedef struct
340336#define EM_BA2 202 /* Beyond BA2 */
341337#define EM_XCORE 203 /* XMOS xCORE */
342338#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 */
344341#define EM_KM32 210 /* KM211 KM32 */
345342#define EM_KMX32 211 /* KM211 KMX32 */
346343#define EM_EMX16 212 /* KM211 KMX16 */
......@@ -445,7 +442,7 @@ typedef struct
445442#define SHT_FINI_ARRAY 15 /* Array of destructors */
446443#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */
447444#define SHT_GROUP 17 /* Section group */
448#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */
445#define SHT_SYMTAB_SHNDX 18 /* Extended section indices */
449446#define SHT_NUM 19 /* Number of defined types. */
450447#define SHT_LOOS 0x60000000 /* Start OS-specific. */
451448#define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* Object attributes. */
......@@ -482,6 +479,7 @@ typedef struct
482479#define SHF_COMPRESSED (1 << 11) /* Section with compressed data. */
483480#define SHF_MASKOS 0x0ff00000 /* OS-specific. */
484481#define SHF_MASKPROC 0xf0000000 /* Processor-specific */
482#define SHF_GNU_RETAIN (1 << 21) /* Not to be GCed by linker. */
485483#define SHF_ORDERED (1 << 30) /* Special ordering requirement
486484 (Solaris). */
487485#define SHF_EXCLUDE (1U << 31) /* Section is excluded unless
......@@ -721,6 +719,7 @@ typedef struct
721719#define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
722720#define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */
723721#define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
722#define PT_GNU_PROPERTY 0x6474e553 /* GNU property */
724723#define PT_LOSUNW 0x6ffffffa
725724#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
726725#define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
......@@ -815,6 +814,10 @@ typedef struct
815814 address keys. */
816815#define NT_ARM_PACG_KEYS 0x408 /* ARM pointer authentication
817816 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. */
818821#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */
819822#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */
820823#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */
......@@ -1049,7 +1052,7 @@ typedef struct
10491052#define VER_NDX_LORESERVE 0xff00 /* Beginning of reserved entries. */
10501053#define VER_NDX_ELIMINATE 0xff01 /* Symbol is to be eliminated. */
10511054
1052/* Auxialiary version information. */
1055/* Auxiliary version information. */
10531056
10541057typedef struct
10551058{
......@@ -1318,33 +1321,34 @@ typedef struct
13181321/* Application-specific semantics, hi */
13191322#define GNU_PROPERTY_HIUSER 0xffffffff
13201323
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
13211330/* The x86 instruction sets indicated by the corresponding bits are
13221331 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
13241333/* The x86 instruction sets indicated by the corresponding bits are
13251334 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
13271336/* X86 processor-specific features used in program. */
13281337#define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002
13291338
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)
13481352
13491353/* This indicates that all executable sections are compatible with
13501354 IBT. */
......@@ -2136,9 +2140,9 @@ enum
21362140#define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */
21372141#define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */
21382142
2139/* Additional section indeces. */
2143/* Additional section indices. */
21402144
2141#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared
2145#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tentatively declared
21422146 symbols in ANSI C. */
21432147#define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */
21442148
......@@ -2868,6 +2872,8 @@ enum
28682872#define R_AARCH64_IRELATIVE 1032 /* STT_GNU_IFUNC relocation. */
28692873
28702874/* 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)
28712877#define DT_AARCH64_VARIANT_PCS (DT_LOPROC + 5)
28722878#define DT_AARCH64_NUM 6
28732879
......@@ -3946,8 +3952,9 @@ enum
39463952#define R_RISCV_SET16 55
39473953#define R_RISCV_SET32 56
39483954#define R_RISCV_32_PCREL 57
3955#define R_RISCV_IRELATIVE 58
39493956
3950#define R_RISCV_NUM 58
3957#define R_RISCV_NUM 59
39513958
39523959/* BPF specific declarations. */
39533960
......@@ -3964,7 +3971,7 @@ enum
39643971#define R_METAG_RELBRANCH 4
39653972#define R_METAG_GETSETOFF 5
39663973
3967/* Backward compatability */
3974/* Backward compatibility */
39683975#define R_METAG_REG32OP1 6
39693976#define R_METAG_REG32OP2 7
39703977#define R_METAG_REG32OP3 8
......@@ -4027,6 +4034,72 @@ enum
40274034#define R_NDS32_TLS_TPOFF 102
40284035#define R_NDS32_TLS_DESC 119
40294036
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
40314104
40324105#endif /* elf.h */
lib/libc/glibc/include/bits/cpu-set.h+8
......@@ -1 +1,9 @@
1#ifndef _BITS_CPU_SET_H
12#include <posix/bits/cpu-set.h>
3
4#ifndef _ISOMAC
5int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp);
6libc_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
21extern 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
31extern __thread int errno attribute_tls_model_ie;
32
33# endif /* IS_IN_LIB */
34
35# define __set_errno(val) (errno = (val))
36
37extern int *__errno_location (void) __THROW __attribute_const__
38# if RTLD_PRIVATE_ERRNO
39 attribute_hidden
40# endif
41;
42libc_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 @@
1919#define MODULE_LIBS_BEGIN 17
2020#define MODULE_rtld 18
2121#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 @@
11/* Helper macros for pointer arithmetic.
2 Copyright (C) 2012-2020 Free Software Foundation, Inc.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -37,6 +37,9 @@
3737/* Cast an integer or a pointer VAL to integer with proper type. */
3838# define cast_to_integer(val) ((__integer_if_pointer_type (val)) (val))
3939
40/* Cast an integer VAL to void * pointer. */
41# define cast_to_pointer(val) ((void *) (uintptr_t) (val))
42
4043/* Align a value by rounding down to closest size.
4144 e.g. Using size of 4096, we get this behavior:
4245 {4095, 4096, 4097} = {0, 4096, 4096}. */
lib/libc/glibc/include/libc-symbols.h+62-83
......@@ -1,6 +1,6 @@
11/* Support macros for making weak and strong aliases for symbols,
22 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.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -84,6 +84,9 @@
8484
8585#include <config.h>
8686
87/* Obtain the definition of symbol_version_reference. */
88#include <libc-symver.h>
89
8790/* When PIC is defined and SHARED isn't defined, we are building PIE
8891 by default. */
8992#if defined PIC && !defined SHARED
......@@ -307,7 +310,7 @@ for linking")
307310
308311/* Resource freeing functions from libc.so go in this section. */
309312#define __libc_freeres_fn_section \
310 __attribute__ ((section ("__libc_freeres_fn")))
313 __attribute__ ((__used__, section ("__libc_freeres_fn")))
311314
312315/* Resource freeing functions for libc.so. */
313316#define libc_freeres_fn(name) \
......@@ -349,6 +352,12 @@ for linking")
349352
350353*/
351354
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
352361/* Symbol set support macros. */
353362
354363/* Make SYMBOL, which is in the text segment, an element of SET. */
......@@ -364,12 +373,12 @@ for linking")
364373/* When building a shared library, make the set section writable,
365374 because it will need to be relocated at run time anyway. */
366375# 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)
369378#else
370379# 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)
373382#endif
374383
375384/* Define SET as a symbol set. This may be required (it is in a.out) to
......@@ -396,32 +405,27 @@ for linking")
396405 past the last element in SET. */
397406#define symbol_set_end_p(set, ptr) ((ptr) >= (void *const *) &__stop_##set)
398407
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
412408#ifdef SHARED
413409# define symbol_version(real, name, version) \
414410 symbol_version_reference(real, name, version)
415411# define default_symbol_version(real, name, version) \
416412 _default_symbol_version(real, name, version)
413/* See <libc-symver.h>. */
417414# ifdef __ASSEMBLER__
418415# define _default_symbol_version(real, name, version) \
419 .symver real, name##@##@##version
416 _set_symbol_version (real, name@@version)
420417# else
421418# define _default_symbol_version(real, name, version) \
422 __asm__ (".symver " #real "," #name "@@" #version)
419 _set_symbol_version (real, #name "@@" #version)
423420# 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 */
425429# define symbol_version(real, name, version)
426430# define default_symbol_version(real, name, version) \
427431 strong_alias(real, name)
......@@ -618,12 +622,7 @@ for linking")
618622# define libc_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
619623# define libc_hidden_def(name) hidden_def (name)
620624# 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)
627626# define libc_hidden_ver(local, name) hidden_ver (local, name)
628627# define libc_hidden_data_def(name) hidden_data_def (name)
629628# define libc_hidden_tls_def(name) hidden_tls_def (name)
......@@ -641,7 +640,7 @@ for linking")
641640# define libc_hidden_data_ver(local, name)
642641#endif
643642
644#if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
643#if IS_IN (rtld)
645644# define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
646645# define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
647646# define rtld_hidden_def(name) hidden_def (name)
......@@ -730,6 +729,29 @@ for linking")
730729# define libresolv_hidden_data_ver(local, name)
731730#endif
732731
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
733755#if IS_IN (librt)
734756# define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
735757# define librt_hidden_tls_proto(name, attrs...) \
......@@ -776,40 +798,11 @@ for linking")
776798# define libdl_hidden_data_ver(local, name)
777799#endif
778800
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
802801#if IS_IN (libnsl)
803802# define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
804803# define libnsl_hidden_tls_proto(name, attrs...) \
805804 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)
813806# define libnsl_hidden_weak(name) hidden_weak (name)
814807# define libnsl_hidden_ver(local, name) hidden_ver (local, name)
815808# define libnsl_hidden_data_def(name) hidden_data_def (name)
......@@ -819,7 +812,6 @@ for linking")
819812#else
820813# define libnsl_hidden_proto(name, attrs...)
821814# define libnsl_hidden_tls_proto(name, attrs...)
822# define libnsl_hidden_def(name)
823815# define libnsl_hidden_weak(name)
824816# define libnsl_hidden_ver(local, name)
825817# define libnsl_hidden_data_def(name)
......@@ -828,33 +820,12 @@ for linking")
828820# define libnsl_hidden_data_ver(local, name)
829821#endif
830822
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
854823#define libc_hidden_builtin_proto(name, attrs...) libc_hidden_proto (name, ##attrs)
855824#define libc_hidden_builtin_def(name) libc_hidden_def (name)
856825#define libc_hidden_builtin_weak(name) libc_hidden_weak (name)
857826#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)
858829#ifdef __ASSEMBLER__
859830# define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name)
860831#endif
......@@ -882,6 +853,14 @@ for linking")
882853# define libutil_hidden_data_ver(local, name)
883854#endif
884855
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
885864/* Get some dirty hacks. */
886865#include <symbol-hacks.h>
887866
lib/libc/glibc/include/pthread.h+11
......@@ -8,9 +8,20 @@ extern int __pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
88 const pthread_barrierattr_t *__restrict
99 __attr, unsigned int __count)
1010 __THROW __nonnull ((1));
11#if PTHREAD_IN_LIBC
12libc_hidden_proto (__pthread_barrier_init)
13#endif
1114extern int __pthread_barrier_wait (pthread_barrier_t *__barrier)
1215 __THROWNL __nonnull ((1));
16#if PTHREAD_IN_LIBC
17libc_hidden_proto (__pthread_barrier_wait)
18#endif
1319
1420/* This function is called to initialize the pthread library. */
1521extern void __pthread_initialize (void) __attribute__ ((weak));
22
23extern int __pthread_kill (pthread_t threadid, int signo);
24
25extern pthread_t __pthread_self (void);
26
1627#endif
lib/libc/glibc/include/signal.h+15-2
......@@ -2,6 +2,8 @@
22# include <signal/signal.h>
33
44# ifndef _ISOMAC
5# include <sigsetops.h>
6
57libc_hidden_proto (sigemptyset)
68libc_hidden_proto (sigfillset)
79libc_hidden_proto (sigaddset)
......@@ -12,7 +14,10 @@ libc_hidden_proto (__sigpause)
1214libc_hidden_proto (raise)
1315libc_hidden_proto (__libc_current_sigrtmin)
1416libc_hidden_proto (__libc_current_sigrtmax)
15libc_hidden_proto (_sys_siglist)
17extern const char * const __sys_siglist[_NSIG];
18libc_hidden_proto (__sys_siglist)
19extern const char * const __sys_sigabbrev[_NSIG];
20libc_hidden_proto (__sys_sigabbrev)
1621
1722/* Now define the internal interfaces. */
1823extern __sighandler_t __bsd_signal (int __sig, __sighandler_t __handler);
......@@ -33,6 +38,14 @@ extern int __sigwait (const sigset_t *__set, int *__sig);
3338libc_hidden_proto (__sigwait)
3439extern int __sigwaitinfo (const sigset_t *__set, siginfo_t *__info);
3540libc_hidden_proto (__sigwaitinfo)
41#if __TIMESIZE == 64
42# define __sigtimedwait64 __sigtimedwait
43#else
44# include <struct___timespec64.h>
45extern int __sigtimedwait64 (const sigset_t *__set, siginfo_t *__info,
46 const struct __timespec64 *__timeout);
47libc_hidden_proto (__sigtimedwait64)
48#endif
3649extern int __sigtimedwait (const sigset_t *__set, siginfo_t *__info,
3750 const struct timespec *__timeout);
3851libc_hidden_proto (__sigtimedwait)
......@@ -54,7 +67,7 @@ extern int __xpg_sigpause (int sig);
5467/* Allocate real-time signal with highest/lowest available priority. */
5568extern int __libc_allocate_rtsig (int __high);
5669
57# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
70# if IS_IN (rtld)
5871extern __typeof (__sigaction) __sigaction attribute_hidden;
5972extern __typeof (__libc_sigaction) __libc_sigaction attribute_hidden;
6073# endif
lib/libc/glibc/include/stap-probe.h+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
33#ifndef _ISOMAC
44# include <stddef.h>
55#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
615#include <stdlib/stdlib.h>
716
817/* Now define the internal interfaces. */
918#if !defined _ISOMAC
1019# include <sys/stat.h>
1120
21# include <rtld-malloc.h>
22
1223extern __typeof (strtol_l) __strtol_l;
1324extern __typeof (strtoul_l) __strtoul_l;
1425extern __typeof (strtoll_l) __strtoll_l;
......@@ -80,6 +91,7 @@ extern int __setenv (const char *__name, const char *__value, int __replace)
8091extern int __unsetenv (const char *__name) attribute_hidden;
8192extern int __clearenv (void) attribute_hidden;
8293extern char *__mktemp (char *__template) __THROW __nonnull ((1));
94libc_hidden_proto (__mktemp)
8395extern char *__canonicalize_file_name (const char *__name);
8496extern char *__realpath (const char *__name, char *__resolved);
8597libc_hidden_proto (__realpath)
......@@ -125,6 +137,12 @@ libc_hidden_proto (__libc_reallocarray)
125137
126138extern int __libc_system (const char *line);
127139
140extern __typeof (getpt) __getpt;
141extern __typeof (ptsname_r) __ptsname_r;
142libc_hidden_proto (__getpt)
143libc_hidden_proto (__ptsname_r)
144libc_hidden_proto (grantpt)
145libc_hidden_proto (unlockpt)
128146
129147extern double __strtod_internal (const char *__restrict __nptr,
130148 char **__restrict __endptr, int __group)
......@@ -205,7 +223,7 @@ libc_hidden_proto (____strtoull_l_internal)
205223#include <bits/floatn.h>
206224libc_hidden_proto (strtof)
207225libc_hidden_proto (strtod)
208#if __LONG_DOUBLE_USES_FLOAT128 == 0
226#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0
209227libc_hidden_proto (strtold)
210228#endif
211229libc_hidden_proto (strtol)
......@@ -288,9 +306,6 @@ libc_hidden_proto (__qfcvt_r)
288306# define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX))
289307# endif
290308
291extern void *__default_morecore (ptrdiff_t) __THROW;
292libc_hidden_proto (__default_morecore)
293
294309struct abort_msg_s
295310{
296311 unsigned int size;
......@@ -299,7 +314,7 @@ struct abort_msg_s
299314extern struct abort_msg_s *__abort_msg;
300315libc_hidden_proto (__abort_msg)
301316
302# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
317# if IS_IN (rtld)
303318extern __typeof (unsetenv) unsetenv attribute_hidden;
304319extern __typeof (__strtoul_internal) __strtoul_internal attribute_hidden;
305320# 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. */
15struct __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). */
11struct __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__));
1313libc_hidden_proto (__chk_fail)
1414rtld_hidden_proto (__chk_fail)
1515
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
1634#endif
1735
36#endif /* !defined _ISOMAC */
37
1838#endif
lib/libc/glibc/include/sys/select.h+29
......@@ -3,6 +3,35 @@
33
44#ifndef _ISOMAC
55/* 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
13extern int __pselect64 (int __nfds, fd_set *__readfds,
14 fd_set *__writefds, fd_set *__exceptfds,
15 const struct __timespec64 *__timeout,
16 const __sigset_t *__sigmask);
17libc_hidden_proto (__pselect64)
18
19extern 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;
24extern 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
30extern int __select64 (int __nfds, fd_set *__readfds,
31 fd_set *__writefds, fd_set *__exceptfds,
32 struct __timeval64 *__timeout);
33libc_hidden_proto (__select64)
34#endif
635extern int __pselect (int __nfds, fd_set *__readfds,
736 fd_set *__writefds, fd_set *__exceptfds,
837 const struct timespec *__timeout,
lib/libc/glibc/include/sys/stat.h+77-43
......@@ -2,63 +2,97 @@
22#include <io/sys/stat.h>
33
44#ifndef _ISOMAC
5# include <xstatver.h>
6# include <struct___timespec64.h>
7# include <struct_stat_time64.h>
8# include <stdbool.h>
9
10static inline bool
11in_ino_t_range (__ino64_t v)
12{
13 __ino_t s = v;
14 return s == v;
15}
16
17static inline bool
18in_off_t_range (__off64_t v)
19{
20 __off_t s = v;
21 return s == v;
22}
23
24static inline bool
25in_blkcnt_t_range (__blkcnt64_t v)
26{
27 __blkcnt_t s = v;
28 return s == v;
29}
30
531/* Now define the internal interfaces. */
632extern int __stat (const char *__file, struct stat *__buf);
33extern int __stat64 (const char *__file, struct stat64 *__buf);
734extern int __fstat (int __fd, struct stat *__buf);
35extern int __fstat64 (int __fd, struct stat64 *__buf);
836extern int __lstat (const char *__file, struct stat *__buf);
37extern int __lstat64 (const char *__file, struct stat64 *__buf);
38extern int __fstatat (int dirfd, const char *pathname, struct stat *buf,
39 int flags);
40extern 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)
43hidden_proto (__stat64)
44hidden_proto (__fstat64)
45hidden_proto (__lstat64)
46hidden_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
55extern int __stat64_time64 (const char *file, struct __stat64_t64 *buf);
56hidden_proto (__stat64_time64);
57extern int __lstat64_time64 (const char *file, struct __stat64_t64 *buf);
58hidden_proto (__lstat64_time64);
59extern int __fstat64_time64 (int fd, struct __stat64_t64 *buf);
60hidden_proto (__fstat64_time64);
61extern int __fstatat64_time64 (int dirfd, const char *pathname,
62 struct __stat64_t64 *buf, int flags);
63hidden_proto (__fstatat64_time64);
64# endif
65
966extern int __chmod (const char *__file, __mode_t __mode);
1067libc_hidden_proto (__chmod)
1168extern int __fchmod (int __fd, __mode_t __mode);
69libc_hidden_proto (fchmodat)
1270extern __mode_t __umask (__mode_t __mask);
1371extern int __mkdir (const char *__path, __mode_t __mode);
1472libc_hidden_proto (__mkdir)
73
74extern int __mknodat (int fd, const char *path, mode_t mode, dev_t dev);
75libc_hidden_proto (__mknodat);
1576extern int __mknod (const char *__path,
1677 __mode_t __mode, __dev_t __dev);
17#if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN)
18hidden_proto (__fxstat)
19hidden_proto (__fxstat64)
20hidden_proto (__lxstat)
21hidden_proto (__lxstat64)
22hidden_proto (__xstat)
23hidden_proto (__xstat64)
24#endif
25extern __inline__ int __stat (const char *__path, struct stat *__statbuf)
26{
27 return __xstat (_STAT_VER, __path, __statbuf);
28}
29libc_hidden_proto (__xmknod)
30extern __inline__ int __mknod (const char *__path, __mode_t __mode,
31 __dev_t __dev)
32{
33 return __xmknod (_MKNOD_VER, __path, __mode, &__dev);
34}
35libc_hidden_proto (__xmknodat)
78libc_hidden_proto (__mknod);
3679
37libc_hidden_proto (__fxstatat)
38libc_hidden_proto (__fxstatat64)
80extern int __xmknod (int __ver, const char *__path, __mode_t __mode,
81 __dev_t *__dev);
82extern int __xmknodat (int __ver, int __fd, const char *__path,
83 __mode_t __mode, __dev_t *__dev);
3984
40# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
41extern __typeof (__fxstatat64) __fxstatat64 attribute_hidden;
42# endif
85int __fxstat (int __ver, int __fildes, struct stat *__stat_buf);
86int __xstat (int __ver, const char *__filename,
87 struct stat *__stat_buf);
88int __lxstat (int __ver, const char *__filename, struct stat *__stat_buf);
89int __fxstatat (int __ver, int __fildes, const char *__filename,
90 struct stat *__stat_buf, int __flag);
91int __fxstat64 (int ver, int __fildes, struct stat64 *__stat_buf);
92int __xstat64 (int ver, const char *__filename, struct stat64 *__stat_buf);
93int __lxstat64 (int ver, const char *__filename, struct stat64 *__stat_buf);
94int __fxstatat64 (int ver, int __fildes, const char *__filename,
95 struct stat64 *__stat_buf, int __flag);
4396
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)
6397#endif
6498#endif
lib/libc/glibc/io/bits/statx.h+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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
50typedef __mode_t mode_t;
51# define __mode_t_defined
52#endif
53
54#ifndef __off_t_defined
55# ifndef __USE_FILE_OFFSET64
56typedef __off_t off_t;
57# else
58typedef __off64_t off_t;
59# endif
60# define __off_t_defined
61#endif
62
63#if defined __USE_LARGEFILE64 && !defined __off64_t_defined
64typedef __off64_t off64_t;
65# define __off64_t_defined
66#endif
67
68#ifndef __pid_t_defined
69typedef __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
177extern int fcntl (int __fd, int __cmd, ...);
178# else
179# ifdef __REDIRECT
180extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64);
181# else
182# define fcntl fcntl64
183# endif
184# endif
185# ifdef __USE_LARGEFILE64
186extern int fcntl64 (int __fd, int __cmd, ...);
187# endif
188#else /* __USE_TIME_BITS64 */
189# ifdef __REDIRECT
190extern int __REDIRECT (fcntl, (int __fd, int __request, ...),
191 __fcntl_time64) __THROW;
192extern int __REDIRECT (fcntl64, (int __fd, int __request, ...),
193 __fcntl_time64) __THROW;
194# else
195extern 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
209extern int open (const char *__file, int __oflag, ...) __nonnull ((1));
210#else
211# ifdef __REDIRECT
212extern 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
219extern 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
233extern int openat (int __fd, const char *__file, int __oflag, ...)
234 __nonnull ((2));
235# else
236# ifdef __REDIRECT
237extern 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
244extern 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
255extern int creat (const char *__file, mode_t __mode) __nonnull ((1));
256#else
257# ifdef __REDIRECT
258extern 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
265extern 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
284extern int lockf (int __fd, int __cmd, off_t __len);
285# else
286# ifdef __REDIRECT
287extern 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
293extern 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
301extern int posix_fadvise (int __fd, off_t __offset, off_t __len,
302 int __advise) __THROW;
303# else
304 # ifdef __REDIRECT_NTH
305extern 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
313extern 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
323extern int posix_fallocate (int __fd, off_t __offset, off_t __len);
324# else
325 # ifdef __REDIRECT
326extern 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
334extern 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
48int
49attribute_hidden
50__fstat (int fd, struct stat *buf)
51{
52 return __fxstat (_STAT_VER, fd, buf);
53}
54
55weak_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
47int
48attribute_hidden
49fstat64 (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
47int
48attribute_hidden
49fstatat (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
47int
48attribute_hidden
49fstatat64 (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
48int
49attribute_hidden
50__lstat (const char *file, struct stat *buf)
51{
52 return __lxstat (_STAT_VER, file, buf);
53}
54
55weak_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
47int
48attribute_hidden
49lstat64 (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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -6,23 +6,6 @@
66 License as published by the Free Software Foundation; either
77 version 2.1 of the License, or (at your option) any later version.
88
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
269 The GNU C Library is distributed in the hope that it will be useful,
2710 but WITHOUT ANY WARRANTY; without even the implied warranty of
2811 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
......@@ -32,24 +15,13 @@
3215 License along with the GNU C Library; if not, see
3316 <https://www.gnu.org/licenses/>. */
3417
35
36#include <sys/types.h>
3718#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>
4720
4821int
49attribute_hidden
5022__mknod (const char *path, mode_t mode, dev_t dev)
5123{
52 return __xmknod (_MKNOD_VER, path, mode, &dev);
24 return __mknodat (AT_FDCWD, path, mode, dev);
5325}
54
55weak_hidden_alias (__mknod, mknod)
26libc_hidden_def (__mknod)
27weak_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
48int
49attribute_hidden
50mknodat (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
47int
48attribute_hidden
49__stat (const char *file, struct stat *buf)
50{
51 return __xstat (_STAT_VER, file, buf);
52}
53
54weak_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
47int
48attribute_hidden
49stat64 (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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -209,21 +209,51 @@ extern int stat (const char *__restrict __file,
209209 that file descriptor FD is open on and put them in BUF. */
210210extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2));
211211#else
212# ifdef __REDIRECT_NTH
212# ifdef __USE_TIME_BITS64
213# ifdef __REDIRECT_NTH
214extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
215 struct stat *__restrict __buf),
216 __stat64_time64)
217 __nonnull ((1, 2));
218extern 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
213227extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
214228 struct stat *__restrict __buf), stat64)
215229 __nonnull ((1, 2));
216230extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64)
217231 __nonnull ((2));
218# else
219# define stat stat64
220# define fstat fstat64
232# else
233# define stat stat64
234# define fstat fstat64
235# endif
221236# endif
222237#endif
223238#ifdef __USE_LARGEFILE64
239# ifndef __USE_TIME_BITS64
224240extern int stat64 (const char *__restrict __file,
225241 struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2));
226242extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
243# else
244# ifdef __REDIRECT_NTH
245extern int __REDIRECT_NTH (stat64, (const char *__restrict __file,
246 struct stat64 *__restrict __buf),
247 __stat64_time64)
248 __nonnull ((1, 2));
249extern 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
227257#endif
228258
229259#ifdef __USE_ATFILE
......@@ -235,20 +265,44 @@ extern int fstatat (int __fd, const char *__restrict __file,
235265 struct stat *__restrict __buf, int __flag)
236266 __THROW __nonnull ((2, 3));
237267# else
238# ifdef __REDIRECT_NTH
268# ifdef __USE_TIME_BITS64
269# ifdef __REDIRECT_NTH
239270extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
240271 struct stat *__restrict __buf,
241272 int __flag),
242 fstatat64) __nonnull ((2, 3));
273 __fstatat64_time64) __nonnull ((2, 3));
274# else
275# define fstatat __fstatat64_time64
276# endif
243277# else
244# define fstatat fstatat64
278# ifdef __REDIRECT_NTH
279extern 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
245286# endif
246287# endif
247288
248289# ifdef __USE_LARGEFILE64
290# ifndef __USE_TIME_BITS64
249291extern int fstatat64 (int __fd, const char *__restrict __file,
250292 struct stat64 *__restrict __buf, int __flag)
251293 __THROW __nonnull ((2, 3));
294# else
295# ifdef __REDIRECT_NTH
296extern 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
252306# endif
253307#endif
254308
......@@ -259,19 +313,37 @@ extern int fstatat64 (int __fd, const char *__restrict __file,
259313extern int lstat (const char *__restrict __file,
260314 struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
261315# else
262# ifdef __REDIRECT_NTH
316# ifdef __USE_TIME_BITS64
317# ifdef __REDIRECT_NTH
263318extern int __REDIRECT_NTH (lstat,
264319 (const char *__restrict __file,
265 struct stat *__restrict __buf), lstat64)
320 struct stat *__restrict __buf), __lstat64_time64)
266321 __nonnull ((1, 2));
322# else
323# define lstat __lstat64_time64
324# endif
267325# else
268# define lstat lstat64
326# ifdef __REDIRECT_NTH
327extern 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
269334# endif
270335# endif
271336# ifdef __USE_LARGEFILE64
337# ifndef __USE_TIME_BITS64
272338extern int lstat64 (const char *__restrict __file,
273339 struct stat64 *__restrict __buf)
274340 __THROW __nonnull ((1, 2));
341# else
342extern int __REDIRECT_NTH (lstat64, (const char *__restrict __file,
343 struct stat64 *__restrict __buf),
344 __lstat64_time64)
345 __nonnull ((1, 2));
346# endif
275347# endif
276348#endif
277349
......@@ -355,182 +427,44 @@ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
355427#endif
356428
357429#ifdef __USE_ATFILE
430# ifndef __USE_TIME_BITS64
358431/* Set file access and modification times relative to directory file
359432 descriptor. */
360433extern int utimensat (int __fd, const char *__path,
361434 const struct timespec __times[2],
362435 int __flags)
363436 __THROW __nonnull ((2));
437# else
438# ifdef __REDIRECT_NTH
439extern 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
364447#endif
365448
366449#ifdef __USE_XOPEN2K8
450# ifndef __USE_TIME_BITS64
367451/* Set file access and modification times of the file associated with FD. */
368452extern 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
395extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf)
396 __THROW __nonnull ((3));
397extern int __xstat (int __ver, const char *__filename,
398 struct stat *__stat_buf) __THROW __nonnull ((2, 3));
399extern int __lxstat (int __ver, const char *__filename,
400 struct stat *__stat_buf) __THROW __nonnull ((2, 3));
401extern 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
406extern int __REDIRECT_NTH (__fxstat, (int __ver, int __fildes,
407 struct stat *__stat_buf), __fxstat64)
408 __nonnull ((3));
409extern int __REDIRECT_NTH (__xstat, (int __ver, const char *__filename,
410 struct stat *__stat_buf), __xstat64)
411 __nonnull ((2, 3));
412extern int __REDIRECT_NTH (__lxstat, (int __ver, const char *__filename,
413 struct stat *__stat_buf), __lxstat64)
414 __nonnull ((2, 3));
415extern int __REDIRECT_NTH (__fxstatat, (int __ver, int __fildes,
416 const char *__filename,
417 struct stat *__stat_buf, int __flag),
418 __fxstatat64) __nonnull ((3, 4));
419453
420454# else
421# define __fxstat __fxstat64
422# define __xstat __xstat64
423# define __lxstat __lxstat64
455# ifdef __REDIRECT_NTH
456extern int __REDIRECT_NTH (futimens, (int fd, const struct timespec __times[2]),
457 __futimens64);
458# else
459# define futimens __futimens64
460# endif
424461# endif
425462#endif
426463
427#ifdef __USE_LARGEFILE64
428extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf)
429 __THROW __nonnull ((3));
430extern int __xstat64 (int __ver, const char *__filename,
431 struct stat64 *__stat_buf) __THROW __nonnull ((2, 3));
432extern int __lxstat64 (int __ver, const char *__filename,
433 struct stat64 *__stat_buf) __THROW __nonnull ((2, 3));
434extern int __fxstatat64 (int __ver, int __fildes, const char *__filename,
435 struct stat64 *__stat_buf, int __flag)
436 __THROW __nonnull ((3, 4));
437#endif
438extern int __xmknod (int __ver, const char *__path, __mode_t __mode,
439 __dev_t *__dev) __THROW __nonnull ((2, 4));
440
441extern int __xmknodat (int __ver, int __fd, const char *__path,
442 __mode_t __mode, __dev_t *__dev)
443 __THROW __nonnull ((3, 5));
444
445464#ifdef __USE_GNU
446465# include <bits/statx.h>
447466#endif
448467
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
534468__END_DECLS
535469
536470
lib/libc/glibc/locale/bits/types/__locale_t.h+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
55
lib/libc/glibc/locale/bits/types/locale_t.h+1-1
......@@ -1,5 +1,5 @@
11/* Definition of locale_t.
2 Copyright (C) 2017-2020 Free Software Foundation, Inc.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -25,7 +25,7 @@
2525
2626/* The GNU libc does not support any K&R compilers or the traditional mode
2727 of ISO C compilers anymore. Check for some of the combinations not
28 anymore supported. */
28 supported anymore. */
2929#if defined __GNUC__ && !defined __STDC__
3030# error "You need a ISO C conforming compiler to use the glibc headers"
3131#endif
......@@ -34,7 +34,29 @@
3434#undef __P
3535#undef __PMT
3636
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__
3860
3961/* All functions, except those with callbacks or those that
4062 synchronize memory, are leaf functions. */
......@@ -47,21 +69,26 @@
4769# endif
4870
4971/* 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
5274 as non-throwing using a function attribute since programs can use
5375 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__))
5578# define __THROW __attribute__ ((__nothrow__ __LEAF))
5679# define __THROWNL __attribute__ ((__nothrow__))
5780# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
5881# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct
5982# 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
6592# else
6693# define __THROW
6794# define __THROWNL
......@@ -70,7 +97,7 @@
7097# endif
7198# endif
7299
73#else /* Not GCC. */
100#else /* Not GCC or clang. */
74101
75102# if (defined __cplusplus \
76103 || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
......@@ -83,16 +110,7 @@
83110# define __THROWNL
84111# define __NTH(fct) fct
85112
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. */
96114
97115/* These two macros are not used in glibc anymore. They are kept here
98116 only because some other projects expect the macros to be defined. */
......@@ -123,14 +141,20 @@
123141#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
124142#define __bos0(ptr) __builtin_object_size (ptr, 0)
125143
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
126153#if __GNUC_PREREQ (4,3)
127# define __warndecl(name, msg) \
128 extern void name (void) __attribute__((__warning__ (msg)))
129154# define __warnattr(msg) __attribute__((__warning__ (msg)))
130155# define __errordecl(name, msg) \
131156 extern void name (void) __attribute__((__error__ (msg)))
132157#else
133# define __warndecl(name, msg) extern void name (void)
134158# define __warnattr(msg)
135159# define __errordecl(name, msg) extern void name (void)
136160#endif
......@@ -139,11 +163,11 @@
139163 Headers that should use flexible arrays only if they're "real"
140164 (e.g. only if they won't affect sizeof()) should test
141165 #if __glibc_c99_flexarr_available. */
142#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
166#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc
143167# define __flexarr []
144168# 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,
147171 even when in C89 mode or compiling C++ (any version). */
148172# define __flexarr []
149173# define __glibc_c99_flexarr_available 1
......@@ -169,7 +193,7 @@
169193 Example:
170194 int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
171195
172#if defined __GNUC__ && __GNUC__ >= 2
196#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4)
173197
174198# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
175199# ifdef __cplusplus
......@@ -194,17 +218,17 @@
194218*/
195219#endif
196220
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__)
201225# define __attribute__(xyz) /* Ignore */
202226#endif
203227
204228/* At some point during the gcc 2.96 development the `malloc' attribute
205229 for functions was introduced. We don't want to use it unconditionally
206230 (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__)
208232# define __attribute_malloc__ __attribute__ ((__malloc__))
209233#else
210234# define __attribute_malloc__ /* Ignore */
......@@ -222,23 +246,29 @@
222246/* At some point during the gcc 2.96 development the `pure' attribute
223247 for functions was introduced. We don't want to use it unconditionally
224248 (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__)
226250# define __attribute_pure__ __attribute__ ((__pure__))
227251#else
228252# define __attribute_pure__ /* Ignore */
229253#endif
230254
231255/* 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__)
233257# define __attribute_const__ __attribute__ ((__const__))
234258#else
235259# define __attribute_const__ /* Ignore */
236260#endif
237261
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
238268/* At some point during the gcc 3.1 development the `used' attribute
239269 for functions was introduced. We don't want to use it unconditionally
240270 (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__)
242272# define __attribute_used__ __attribute__ ((__used__))
243273# define __attribute_noinline__ __attribute__ ((__noinline__))
244274#else
......@@ -247,7 +277,7 @@
247277#endif
248278
249279/* 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__)
251281# define __attribute_deprecated__ __attribute__ ((__deprecated__))
252282#else
253283# define __attribute_deprecated__ /* Ignore */
......@@ -257,7 +287,7 @@
257287 when a deprecated function is used. clang claims to be gcc 4.2, but
258288 may also support this feature. */
259289#if __GNUC_PREREQ (4,5) \
260 || __glibc_clang_has_extension (__attribute_deprecated_with_message__)
290 || __glibc_has_extension (__attribute_deprecated_with_message__)
261291# define __attribute_deprecated_msg__(msg) \
262292 __attribute__ ((__deprecated__ (msg)))
263293#else
......@@ -270,7 +300,7 @@
270300 If several `format_arg' attributes are given for the same function, in
271301 gcc-3.0 and older, all but the last one are ignored. In newer gccs,
272302 all designated arguments are considered. */
273#if __GNUC_PREREQ (2,8)
303#if __GNUC_PREREQ (2,8) || __glibc_has_attribute (__format_arg__)
274304# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
275305#else
276306# define __attribute_format_arg__(x) /* Ignore */
......@@ -280,27 +310,42 @@
280310 attribute for functions was introduced. We don't want to use it
281311 unconditionally (although this would be possible) since it
282312 generates warnings. */
283#if __GNUC_PREREQ (2,97)
313#if __GNUC_PREREQ (2,97) || __glibc_has_attribute (__format__)
284314# define __attribute_format_strfmon__(a,b) \
285315 __attribute__ ((__format__ (__strfmon__, a, b)))
286316#else
287317# define __attribute_format_strfmon__(a,b) /* Ignore */
288318#endif
289319
290/* The nonull function attribute allows to mark pointer parameters which
320/* The nonnull function attribute marks pointer parameters that
291321 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
296341#endif
297342
298343/* If fortification mode, we warn about unused results of certain
299344 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__)
301346# define __attribute_warn_unused_result__ \
302347 __attribute__ ((__warn_unused_result__))
303# if __USE_FORTIFY_LEVEL > 0
348# if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0
304349# define __wur __attribute_warn_unused_result__
305350# endif
306351#else
......@@ -311,7 +356,7 @@
311356#endif
312357
313358/* Forces a function to be always inlined. */
314#if __GNUC_PREREQ (3,2)
359#if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__always_inline__)
315360/* The Linux kernel defines __always_inline in stddef.h (283d7573), and
316361 it conflicts with this definition. Therefore undefine it first to
317362 allow either header to be included first. */
......@@ -324,7 +369,7 @@
324369
325370/* Associate error messages with the source location of the call site rather
326371 than with the source location inside the function. */
327#if __GNUC_PREREQ (4,3)
372#if __GNUC_PREREQ (4,3) || __glibc_has_attribute (__artificial__)
328373# define __attribute_artificial__ __attribute__ ((__artificial__))
329374#else
330375# define __attribute_artificial__ /* Ignore */
......@@ -367,12 +412,14 @@
367412 run in pedantic mode if the uses are carefully marked using the
368413 `__extension__' keyword. But this is not generally available before
369414 version 2.8. */
370#if !__GNUC_PREREQ (2,8)
415#if !(__GNUC_PREREQ (2,8) || defined __clang__)
371416# define __extension__ /* Ignore */
372417#endif
373418
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)
376423# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
377424# define __restrict restrict
378425# else
......@@ -382,8 +429,9 @@
382429
383430/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
384431 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
387435# define __restrict_arr __restrict
388436#else
389437# ifdef __GNUC__
......@@ -398,7 +446,7 @@
398446# endif
399447#endif
400448
401#if __GNUC__ >= 3
449#if (__GNUC__ >= 3) || __glibc_has_builtin (__builtin_expect)
402450# define __glibc_unlikely(cond) __builtin_expect ((cond), 0)
403451# define __glibc_likely(cond) __builtin_expect ((cond), 1)
404452#else
......@@ -406,15 +454,10 @@
406454# define __glibc_likely(cond) (cond)
407455#endif
408456
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
415457#if (!defined _Noreturn \
416458 && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
417 && !__GNUC_PREREQ (4,7))
459 && !(__GNUC_PREREQ (4,7) \
460 || (3 < __clang_major__ + (5 <= __clang_minor__))))
418461# if __GNUC_PREREQ (2,8)
419462# define _Noreturn __attribute__ ((__noreturn__))
420463# else
......@@ -443,16 +486,51 @@
443486
444487#if (!defined _Static_assert && !defined __cplusplus \
445488 && (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__))
447491# define _Static_assert(expr, diagnostic) \
448492 extern int (*__Static_assert_function (void)) \
449493 [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
450494#endif
451495
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
454529
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
456534# define __LDBL_COMPAT 1
457535# ifdef __REDIRECT
458536# define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
......@@ -461,6 +539,8 @@
461539# define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias)
462540# define __LDBL_REDIR_NTH(name, proto) \
463541 __LDBL_REDIR1_NTH (name, proto, __nldbl_##name)
542# define __LDBL_REDIR2_DECL(name) \
543 extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name));
464544# define __LDBL_REDIR1_DECL(name, alias) \
465545 extern __typeof (name) name __asm (__ASMNAME (#alias));
466546# define __LDBL_REDIR_DECL(name) \
......@@ -471,11 +551,13 @@
471551 __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias)
472552# endif
473553#endif
474#if !defined __LDBL_COMPAT || !defined __REDIRECT
554#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \
555 || !defined __REDIRECT
475556# define __LDBL_REDIR1(name, proto, alias) name proto
476557# define __LDBL_REDIR(name, proto) name proto
477558# define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW
478559# define __LDBL_REDIR_NTH(name, proto) name proto __THROW
560# define __LDBL_REDIR2_DECL(name)
479561# define __LDBL_REDIR_DECL(name)
480562# ifdef __REDIRECT
481563# define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias)
......@@ -506,7 +588,7 @@
506588 check is required to enable the use of generic selection. */
507589#if !defined __cplusplus \
508590 && (__GNUC_PREREQ (4, 9) \
509 || __glibc_clang_has_extension (c_generic_selections) \
591 || __glibc_has_extension (c_generic_selections) \
510592 || (!defined __GNUC__ && defined __STDC_VERSION__ \
511593 && __STDC_VERSION__ >= 201112L))
512594# define __HAVE_GENERIC_SELECTION 1
......@@ -514,4 +596,40 @@
514596# define __HAVE_GENERIC_SELECTION 0
515597#endif
516598
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
517635#endif /* sys/cdefs.h */
lib/libc/glibc/misc/sys/select.h+28-1
......@@ -1,5 +1,5 @@
11/* `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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -98,10 +98,23 @@ __BEGIN_DECLS
9898
9999 This function is a cancellation point and therefore not marked with
100100 __THROW. */
101#ifndef __USE_TIME_BITS64
101102extern int select (int __nfds, fd_set *__restrict __readfds,
102103 fd_set *__restrict __writefds,
103104 fd_set *__restrict __exceptfds,
104105 struct timeval *__restrict __timeout);
106#else
107# ifdef __REDIRECT
108extern 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
105118
106119#ifdef __USE_XOPEN2K
107120/* 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,
110123
111124 This function is a cancellation point and therefore not marked with
112125 __THROW. */
126# ifndef __USE_TIME_BITS64
113127extern int pselect (int __nfds, fd_set *__restrict __readfds,
114128 fd_set *__restrict __writefds,
115129 fd_set *__restrict __exceptfds,
116130 const struct timespec *__restrict __timeout,
117131 const __sigset_t *__restrict __sigmask);
132# else
133# ifdef __REDIRECT
134extern 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
118145#endif
119146
120147
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
36extern int __pthread_atfork (void (*prepare) (void), void (*parent) (void),
37 void (*child) (void));
38extern int __register_atfork (void (*__prepare) (void),
39 void (*__parent) (void),
40 void (*__child) (void),
41 void *dso_handle);
42libc_hidden_proto (__register_atfork)
43extern 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. */
47int
48#ifndef __pthread_atfork
49/* Don't mark the compatibility function as hidden. */
50attribute_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
58extern int pthread_atfork (void (*prepare) (void), void (*parent) (void),
59 void (*child) (void)) attribute_hidden;
60weak_alias (__pthread_atfork, pthread_atfork)
61#endif
lib/libc/glibc/posix/bits/cpu-set.h+1-1
......@@ -1,6 +1,6 @@
11/* Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993
22 scheduling interface.
3 Copyright (C) 1996-2020 Free Software Foundation, Inc.
3 Copyright (C) 1996-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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. */
160160__STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */
161161__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */
162162__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */
163__STD_TYPE __SUSECONDS64_T_TYPE __suseconds64_t;
163164
164165__STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */
165166__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.
22 This file is part of the GNU C Library.
33
44 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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -27,7 +27,7 @@
2727__BEGIN_DECLS
2828
2929#include <bits/types.h>
30#include <bits/signum.h>
30#include <bits/signum-generic.h>
3131
3232#include <bits/types/sig_atomic_t.h>
3333
......@@ -148,7 +148,8 @@ extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
148148
149149#ifdef __USE_XOPEN_EXTENDED
150150# ifdef __GNUC__
151extern int sigpause (int __sig) __asm__ ("__xpg_sigpause");
151extern int sigpause (int __sig) __asm__ ("__xpg_sigpause")
152 __attribute_deprecated_msg__ ("Use the sigsuspend function instead");
152153# else
153154extern int __sigpause (int __sig_or_mask, int __is_sig);
154155/* 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);
164165 simply do not work in many situations. Use `sigprocmask' instead. */
165166
166167/* 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)))
168171
169172/* Block signals in MASK, returning the old mask. */
170173extern int sigblock (int __mask) __THROW __attribute_deprecated__;
......@@ -266,10 +269,23 @@ extern int sigwaitinfo (const sigset_t *__restrict __set,
266269
267270 This function is a cancellation point and therefore not marked with
268271 __THROW. */
272# ifndef __USE_TIME_BITS64
269273extern int sigtimedwait (const sigset_t *__restrict __set,
270274 siginfo_t *__restrict __info,
271275 const struct timespec *__restrict __timeout)
272276 __nonnull ((1));
277# else
278# ifdef __REDIRECT
279extern 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
273289
274290/* Send signal SIG to the process PID. Associate data in VAL with the
275291 signal. */
......@@ -281,12 +297,6 @@ extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val)
281297
282298#ifdef __USE_MISC
283299
284/* Names of the signals. This variable exists only for compatibility.
285 Use `strsignal' instead (see <string.h>). */
286extern const char *const _sys_siglist[_NSIG];
287extern const char *const sys_siglist[_NSIG];
288
289
290300/* Get machine-dependent `struct sigcontext' and signal subcodes. */
291301# include <bits/sigcontext.h>
292302
......@@ -311,9 +321,11 @@ extern int sigreturn (struct sigcontext *__scp) __THROW;
311321/* If INTERRUPT is nonzero, make signal SIG interrupt system calls
312322 (causing them to fail with EINTR); if INTERRUPT is zero, make system
313323 calls be restarted after signal SIG. */
314extern int siginterrupt (int __sig, int __interrupt) __THROW;
324extern int siginterrupt (int __sig, int __interrupt) __THROW
325 __attribute_deprecated_msg__ ("Use sigaction with SA_RESTART instead");
315326
316327# include <bits/sigstack.h>
328# include <bits/sigstksz.h>
317329# include <bits/ss_flags.h>
318330
319331/* Alternate signal handler stack interface.
......@@ -340,16 +352,21 @@ extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
340352/* Simplified interface for signal management. */
341353
342354/* Add SIG to the calling process' signal mask. */
343extern int sighold (int __sig) __THROW;
355extern int sighold (int __sig) __THROW
356 __attribute_deprecated_msg__ ("Use the sigprocmask function instead");
344357
345358/* Remove SIG from the calling process' signal mask. */
346extern int sigrelse (int __sig) __THROW;
359extern int sigrelse (int __sig) __THROW
360 __attribute_deprecated_msg__ ("Use the sigprocmask function instead");
347361
348362/* Set the disposition of SIG to SIG_IGN. */
349extern int sigignore (int __sig) __THROW;
363extern int sigignore (int __sig) __THROW
364 __attribute_deprecated_msg__ ("Use the signal function instead");
350365
351366/* Set the disposition of SIG. */
352extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW;
367extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW
368 __attribute_deprecated_msg__
369 ("Use the signal and sigprocmask functions instead");
353370#endif
354371
355372#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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -25,7 +25,7 @@
2525
2626__BEGIN_DECLS
2727
28/* Remove any previous definitions. */
28/* Remove any previous definition. */
2929#undef alloca
3030
3131/* 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.
22 This file is part of the GNU C Library.
33
44 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.
22 This file is part of the GNU C Library.
33
44 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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. */
37extern 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]. */
45extern char *program_invocation_name;
46extern 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.
22 This file is part of the GNU C Library.
33
44 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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -397,7 +397,7 @@ extern long int a64l (const char *__s)
397397 `initstate' and `setstate' functions are those from BSD Unices.
398398 The `rand' and `srand' functions are required by the ANSI standard.
399399 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. */
401401extern long int random (void) __THROW;
402402
403403/* Seed the random number generator with the given number. */
......@@ -550,6 +550,9 @@ extern void *calloc (size_t __nmemb, size_t __size)
550550extern void *realloc (void *__ptr, size_t __size)
551551 __THROW __attribute_warn_unused_result__ __attribute_alloc_size__ ((2));
552552
553/* Free a block allocated by `malloc', `realloc' or `calloc'. */
554extern void free (void *__ptr) __THROW;
555
553556#ifdef __USE_MISC
554557/* Re-allocate the previously allocated block in PTR, making the new
555558 block large enough for NMEMB elements of SIZE bytes each. */
......@@ -558,11 +561,13 @@ extern void *realloc (void *__ptr, size_t __size)
558561 between objects pointed by the old and new pointers. */
559562extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
560563 __THROW __attribute_warn_unused_result__
561 __attribute_alloc_size__ ((2, 3));
562#endif
564 __attribute_alloc_size__ ((2, 3))
565 __attr_dealloc_free;
563566
564/* Free a block allocated by `malloc', `realloc' or `calloc'. */
565extern void free (void *__ptr) __THROW;
567/* Add reallocarray as its own deallocator. */
568extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
569 __THROW __attr_dealloc (reallocarray, 1);
570#endif
566571
567572#ifdef __USE_MISC
568573# include <alloca.h>
......@@ -788,7 +793,8 @@ extern int system (const char *__command) __wur;
788793/* Return a malloc'd string containing the canonical absolute name of the
789794 existing named file. */
790795extern char *canonicalize_file_name (const char *__name)
791 __THROW __nonnull ((1)) __wur;
796 __THROW __nonnull ((1)) __attribute_malloc__
797 __attr_dealloc_free __wur;
792798#endif
793799
794800#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
......@@ -931,12 +937,13 @@ extern int wctomb (char *__s, wchar_t __wchar) __THROW;
931937
932938/* Convert a multibyte string to a wide char string. */
933939extern 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));
935942/* Convert a wide char string to multibyte string. */
936943extern size_t wcstombs (char *__restrict __s,
937944 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));
940947
941948#ifdef __USE_MISC
942949/* Determine whether the string value of RESPONSE matches the affirmation
......@@ -990,7 +997,7 @@ extern char *ptsname (int __fd) __THROW __wur;
990997 terminal associated with the master FD is open on in BUF.
991998 Return 0 on success, otherwise an error number. */
992999extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
993 __THROW __nonnull ((2));
1000 __THROW __nonnull ((2)) __attr_access ((__write_only__, 2, 3));
9941001
9951002/* Open a master pseudo terminal and return its file descriptor. */
9961003extern int getpt (void);
......@@ -1016,7 +1023,9 @@ extern int ttyslot (void) __THROW;
10161023#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
10171024# include <bits/stdlib.h>
10181025#endif
1019#ifdef __LDBL_COMPAT
1026
1027#include <bits/floatn.h>
1028#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
10201029# include <bits/stdlib-ldbl.h>
10211030#endif
10221031
lib/libc/glibc/string/bits/endian.h+1-1
......@@ -1,5 +1,5 @@
11/* Endian macros for string.h functions
2 Copyright (C) 1992-2020 Free Software Foundation, Inc.
2 Copyright (C) 1992-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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.
22 This file is part of the GNU C Library.
33
44 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 @@
11/* 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.
33
44 This file is part of the GNU C Library.
55
......@@ -75,6 +75,11 @@ call_weak_fn:
7575 .hidden _init
7676 .type _init, %function
7777_init:
78#if HAVE_AARCH64_PAC_RET
79 PACIASP
80#else
81 BTI_C
82#endif
7883 stp x29, x30, [sp, -16]!
7984 mov x29, sp
8085#if PREINIT_FUNCTION_WEAK
......@@ -89,5 +94,10 @@ _init:
8994 .hidden _fini
9095 .type _fini, %function
9196_fini:
97#if HAVE_AARCH64_PAC_RET
98 PACIASP
99#else
100 BTI_C
101#endif
92102 stp x29, x30, [sp, -16]!
93103 mov x29, sp
lib/libc/glibc/sysdeps/aarch64/crtn.S+9-1
......@@ -1,5 +1,5 @@
11/* 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.
33
44 This file is part of the GNU C Library.
55
......@@ -37,10 +37,18 @@
3737/* crtn.S puts function epilogues in the .init and .fini sections
3838 corresponding to the prologues in crti.S. */
3939
40#include <sysdep.h>
41
4042 .section .init,"ax",%progbits
4143 ldp x29, x30, [sp], 16
44#if HAVE_AARCH64_PAC_RET
45 AUTIASP
46#endif
4247 RET
4348
4449 .section .fini,"ax",%progbits
4550 ldp x29, x30, [sp], 16
51#if HAVE_AARCH64_PAC_RET
52 AUTIASP
53#endif
4654 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.
22
33 This file is part of the GNU C Library.
44
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.
22
33 This file is part of the GNU C Library.
44
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.
22
33 This file is part of the GNU C Library.
44
......@@ -43,10 +43,9 @@
4343 */
4444
4545 .text
46 .globl _start
47 .type _start,#function
48_start:
46ENTRY(_start)
4947 /* Create an initial frame with 0 LR and FP */
48 cfi_undefined (x30)
5049 mov x29, #0
5150 mov x30, #0
5251
......@@ -64,26 +63,16 @@ _start:
6463# ifdef SHARED
6564 adrp x0, :got:main
6665 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]
7366# else
7467 adrp x0, __wrap_main
7568 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
8069# endif
8170#else
8271 /* Set up the other arguments in registers */
8372 MOVL (0, main)
84 MOVL (3, __libc_csu_init)
85 MOVL (4, __libc_csu_fini)
8673#endif
74 mov x3, #0 /* Used to be init. */
75 mov x4, #0 /* Used to be fini. */
8776
8877 /* __libc_start_main (main, argc, argv, init, fini, rtld_fini,
8978 stack_end) */
......@@ -100,8 +89,10 @@ _start:
10089 because crt1.o and rcrt1.o share code and the later must avoid the
10190 use of GOT relocations before __libc_start_main is called. */
10291__wrap_main:
92 BTI_C
10393 b main
10494#endif
95END(_start)
10596
10697 /* Define a symbol for the first piece of initialized data. */
10798 .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.
22
33 This file is part of the GNU C Library.
44
......@@ -25,29 +25,90 @@
2525# define AARCH64_R(NAME) R_AARCH64_ ## NAME
2626# define PTR_REG(n) x##n
2727# define PTR_LOG_SIZE 3
28# define DELOUSE(n)
28# define PTR_ARG(n)
29# define SIZE_ARG(n)
2930#else
3031# define AARCH64_R(NAME) R_AARCH64_P32_ ## NAME
3132# define PTR_REG(n) w##n
3233# 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
3436#endif
3537
3638#define PTR_SIZE (1<<PTR_LOG_SIZE)
3739
40#ifndef __ASSEMBLER__
41/* Strip pointer authentication code from pointer p. */
42static inline void *
43strip_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
3858#ifdef __ASSEMBLER__
3959
4060/* Syntactic details of assembler. */
4161
4262#define ASM_SIZE_DIRECTIVE(name) .size name,.-name
4363
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
99GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC)
100#elif HAVE_AARCH64_BTI
101GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI)
102#endif
103
44104/* Define an entry point visible from C. */
45105#define ENTRY(name) \
46106 .globl C_SYMBOL_NAME(name); \
47107 .type C_SYMBOL_NAME(name),%function; \
48 .align 4; \
108 .p2align 6; \
49109 C_LABEL(name) \
50110 cfi_startproc; \
111 BTI_C; \
51112 CALL_MCOUNT
52113
53114/* Define an entry point visible from C. */
......@@ -57,6 +118,7 @@
57118 .p2align align; \
58119 C_LABEL(name) \
59120 cfi_startproc; \
121 BTI_C; \
60122 CALL_MCOUNT
61123
62124/* Define an entry point visible from C with a specified alignment and
......@@ -68,11 +130,12 @@
68130 .globl C_SYMBOL_NAME(name); \
69131 .type C_SYMBOL_NAME(name),%function; \
70132 .p2align align; \
71 .rep padding; \
133 .rep padding - 1; /* -1 for bti c. */ \
72134 nop; \
73135 .endr; \
74136 C_LABEL(name) \
75137 cfi_startproc; \
138 BTI_C; \
76139 CALL_MCOUNT
77140
78141#undef END
lib/libc/glibc/sysdeps/alpha/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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
42struct __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 @@
11/* Startup code for Alpha/ELF.
2 Copyright (C) 1993-2020 Free Software Foundation, Inc.
2 Copyright (C) 1993-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44 Contributed by Richard Henderson <rth@tamu.edu>
55
......@@ -55,9 +55,8 @@ _start:
5555 ldl a1, 16(sp) /* get argc */
5656 lda a2, 24(sp) /* get argv */
5757
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. */
6160
6261 /* Store address of the shared library termination function. */
6362 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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
43struct __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 @@
11/* Startup code for ARM & ELF
2 Copyright (C) 1995-2020 Free Software Foundation, Inc.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -94,30 +94,20 @@ _start:
9494 adr a4, .L_GOT
9595 add sl, sl, a4
9696
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. */
9999
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 */
106101 ldr a1, [sl, a1]
107102
108103 /* __libc_start_main (main, argc, argv, init, fini, rtld_fini, stack_end) */
109104 /* Let the libc call main and exit with its return code. */
110105 bl __libc_start_main(PLT)
111106#else
112 /* Fetch address of __libc_csu_fini */
113 ldr ip, =__libc_csu_fini
114
115 /* Push __libc_csu_fini */
116 push { ip }
117107
118 /* Set up the other arguments in registers */
108 mov a4, #0 /* Used to init. */
109 push { a4 } /* Used to fini. */
119110 ldr a1, =main
120 ldr a4, =__libc_csu_init
121111
122112 /* __libc_start_main (main, argc, argv, init, fini, rtld_fini, stack_end) */
123113 /* Let the libc call main and exit with its return code. */
......@@ -131,8 +121,6 @@ _start:
131121 .align 2
132122.L_GOT:
133123 .word _GLOBAL_OFFSET_TABLE_ - .L_GOT
134 .word __libc_csu_fini(GOT)
135 .word __libc_csu_init(GOT)
136124 .word main(GOT)
137125#endif
138126
lib/libc/glibc/sysdeps/arm/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* Assembler macros for ARM.
2 Copyright (C) 1997-2020 Free Software Foundation, Inc.
2 Copyright (C) 1997-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Configuration of lookup functions.
2 Copyright (C) 2000-2020 Free Software Foundation, Inc.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Declarations and definitions of codes relating to the DWARF2 symbolic
22 debugging information format.
3 Copyright (C) 1992-2020 Free Software Foundation, Inc.
3 Copyright (C) 1992-2021 Free Software Foundation, Inc.
44 Contributed by Gary Funck (gary@intrepid.com). Derived from the
55 DWARF 1 implementation written by Ron Guilmette (rfg@monkeys.com).
66
lib/libc/glibc/sysdeps/generic/entry.h created+5
......@@ -0,0 +1,5 @@
1#ifndef __ASSEMBLY__
2extern 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -125,16 +125,4 @@
125125/* We need portable names for some of the functions. */
126126#define __libc_mutex_unlock
127127
128/* Type for key of thread specific data. */
129typedef 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
140128#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 @@
11/* Single thread optimization, generic version.
2 Copyright (C) 2019-2020 Free Software Foundation, Inc.
2 Copyright (C) 2019-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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__
2extern void _start (void);
3#endif
4
5/* Lives in libgcc.so and canonicalizes function pointers for comparison. */
6extern 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.
22 This file is part of the GNU C Library.
33
44 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 @@
11/* ELF startup code for HPPA.
2 Copyright (C) 2002-2020 Free Software Foundation, Inc.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -36,8 +36,6 @@
3636 .import main, code
3737 .import $global$, data
3838 .import __libc_start_main, code
39 .import __libc_csu_fini, code
40 .import __libc_csu_init, code
4139
4240 /* Have the linker create plabel words so we get PLABEL32
4341 relocs and not 21/14. The use of 21/14 relocs is only
......@@ -52,10 +50,6 @@
5250 .word P%main
5351.Lp__libc_start_main:
5452 .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
5953
6054 .text
6155 .align 4
......@@ -77,8 +71,8 @@ _start:
7771 1. r26 - Application main
7872 2. r25 - argc
7973 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)
8276 6. sp-56 - rtld_fini
8377 7. sp-60 - stackend */
8478
......@@ -108,14 +102,6 @@ _start:
108102 addil LT'.Lpmain, %r19
109103 ldw RT'.Lpmain(%r1), %r26
110104 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
119105#else
120106 /* Load $global$ address into %dp */
121107 ldil L%$global$, %dp
......@@ -124,13 +110,9 @@ _start:
124110 /* load main (1st argument) */
125111 ldil LR'.Lpmain, %r26
126112 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
133113#endif
114 ldi 0,%r23 /* Used to be init. */
115 ldi 0,%r22 /* Used to be fini. */
134116 /* Store 5th argument */
135117 stw %r22, -52(%sp)
136118 /* void *stack_end (7th argument) */
lib/libc/glibc/sysdeps/hppa/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* Assembler macros for HP/PA.
2 Copyright (C) 1999-2020 Free Software Foundation, Inc.
2 Copyright (C) 1999-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44 Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999.
55
lib/libc/glibc/sysdeps/htl/bits/pthread.h+1-1
......@@ -1,5 +1,5 @@
11/* Pthread data structures. Generic version.
2 Copyright (C) 2002-2020 Free Software Foundation, Inc.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -20,5 +20,18 @@
2020#define _THREAD_SHARED_TYPES_H 1
2121
2222#include <bits/pthreadtypes-arch.h>
23#include <bits/types/struct___pthread_once.h>
24
25typedef int __tss_t;
26typedef int __thrd_t;
27
28typedef 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 } }
2336
2437#endif /* _THREAD_SHARED_TYPES_H */
lib/libc/glibc/sysdeps/htl/libc-lockP.h+1-14
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -22,9 +22,6 @@
2222#include <pthread.h>
2323#include <pthread-functions.h>
2424
25/* Type for key to thread-specific data. */
26typedef pthread_key_t __libc_key_t;
27
2825/* If we check for a weakly referenced symbol and then perform a
2926 normal jump to it te code generated for some platforms in case of
3027 PIC is unnecessarily slow. What would happen is that the function
......@@ -109,16 +106,6 @@ extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock);
109106
110107extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock);
111108
112extern int __pthread_key_create (pthread_key_t *__key,
113 void (*__destr_function) (void *));
114
115extern int __pthread_key_delete (pthread_key_t __key);
116
117extern int __pthread_setspecific (pthread_key_t __key,
118 const void *__pointer);
119
120extern void *__pthread_getspecific (pthread_key_t __key);
121
122109extern int __pthread_once (pthread_once_t *__once_control,
123110 void (*__init_routine) (void));
124111
lib/libc/glibc/sysdeps/htl/pthread.h+66-39
......@@ -1,5 +1,5 @@
11/* Posix threads. Hurd version.
2 Copyright (C) 2000-2020 Free Software Foundation, Inc.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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__));
222222 the exit status of the thread in *STATUS. */
223223extern int pthread_join (pthread_t __threadp, void **__status);
224224
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. */
228extern 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. */
236extern 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. */
246extern int pthread_clockjoin_np (pthread_t __th, void **__thread_return,
247 clockid_t __clockid,
248 const struct timespec *__abstime);
249#endif
250
225251/* Indicate that the storage for THREAD can be reclaimed when it
226252 terminates. */
227253extern int pthread_detach (pthread_t __threadp);
......@@ -273,6 +299,7 @@ extern pthread_t pthread_self (void) __THROW;
273299#ifdef __USE_XOPEN2K
274300# define PTHREAD_MUTEX_STALLED __PTHREAD_MUTEX_STALLED
275301# define PTHREAD_MUTEX_ROBUST __PTHREAD_MUTEX_ROBUST
302# define PTHREAD_MUTEX_ROBUST_NP __PTHREAD_MUTEX_ROBUST
276303#endif
277304
278305#include <bits/types/struct___pthread_mutexattr.h>
......@@ -400,6 +427,13 @@ extern int pthread_mutex_timedlock (struct __pthread_mutex *__restrict __mutex,
400427 __THROWNL __nonnull ((1, 2));
401428#endif
402429
430#ifdef __USE_GNU
431extern 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
403437/* Unlock MUTEX. */
404438extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
405439 __THROWNL __nonnull ((1));
......@@ -516,6 +550,21 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
516550 pthread_mutex_t *__restrict __mutex,
517551 __const struct timespec *__restrict __abstime)
518552 __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. */
562extern 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
519568
520569
521570/* Spin locks. */
......@@ -549,42 +598,6 @@ extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
549598extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
550599 __nonnull ((1));
551600
552# if defined __USE_EXTERN_INLINES && defined _LIBC
553
554# include <bits/spin-lock-inline.h>
555
556__extern_inline int
557pthread_spin_destroy (pthread_spinlock_t *__lock)
558{
559 return __pthread_spin_destroy (__lock);
560}
561
562__extern_inline int
563pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
564{
565 return __pthread_spin_init (__lock, __pshared);
566}
567
568__extern_inline int
569pthread_spin_lock (pthread_spinlock_t *__lock)
570{
571 return __pthread_spin_lock (__lock);
572}
573
574__extern_inline int
575pthread_spin_trylock (pthread_spinlock_t *__lock)
576{
577 return __pthread_spin_trylock (__lock);
578}
579
580__extern_inline int
581pthread_spin_unlock (pthread_spinlock_t *__lock)
582{
583 return __pthread_spin_unlock (__lock);
584}
585
586# endif /* Use extern inlines. */
587
588601#endif /* XPG6. */
589602
590603
......@@ -658,6 +671,13 @@ extern int pthread_rwlock_timedrdlock (struct __pthread_rwlock *__restrict __rwl
658671 __THROWNL __nonnull ((1, 2));
659672# endif
660673
674# ifdef __USE_GNU
675extern 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
661681/* Acquire the rwlock *RWLOCK for writing. */
662682extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
663683 __THROWNL __nonnull ((1));
......@@ -674,6 +694,13 @@ extern int pthread_rwlock_timedwrlock (struct __pthread_rwlock *__restrict __rwl
674694 __THROWNL __nonnull ((1, 2));
675695# endif
676696
697# ifdef __USE_GNU
698extern 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
677704/* Release the lock held by the current thread on *RWLOCK. */
678705extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
679706 __THROWNL __nonnull ((1));
......@@ -795,14 +822,14 @@ extern void *pthread_getspecific (pthread_key_t __key) __THROW;
795822
796823/* Set the caller thread's thread specific value of KEY to VALUE. */
797824extern int pthread_setspecific (pthread_key_t __key, const void *__value)
798 __THROW;
825 __THROW __attr_access_none (2);
799826
800827
801828/* Dynamic package initialization. */
802829
803830#include <bits/types/struct___pthread_once.h>
804831
805#define PTHREAD_ONCE_INIT __PTHREAD_ONCE_INIT
832#define PTHREAD_ONCE_INIT (struct __pthread_once) { __PTHREAD_ONCE_INIT }
806833
807834/* Call INIT_ROUTINE if this function has never been called with
808835 *ONCE_CONTROL, otherwise do nothing. */
lib/libc/glibc/sysdeps/i386/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -87,11 +87,9 @@ ENTRY (_start)
8787 call 1f
8888 addl $_GLOBAL_OFFSET_TABLE_, %ebx
8989
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
9593
9694 pushl %ecx /* Push second argument: argv. */
9795 pushl %esi /* Push first argument: argc. */
......@@ -112,9 +110,9 @@ ENTRY (_start)
112110 But let the libc call main. */
113111 call __libc_start_main@PLT
114112#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
118116
119117 pushl %ecx /* Push second argument: argv. */
120118 pushl %esi /* Push first argument: argc. */
lib/libc/glibc/sysdeps/i386/symbol-hacks.h+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Assembler macros for i386.
2 Copyright (C) 1991-2020 Free Software Foundation, Inc.
2 Copyright (C) 1991-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -18,8 +18,6 @@
1818
1919#include <sysdeps/x86/sysdep.h>
2020
21#include <features.h> /* For __GNUC_PREREQ. */
22
2321/* It is desirable that the names of PIC thunks match those used by
2422 GCC so that multiple copies are eliminated by the linker. Because
2523 GCC 4.6 and earlier use __i686 in the names, it is necessary to
......@@ -97,9 +95,9 @@ GET_PC_THUNK(reg): \
9795
9896# define SETUP_PIC_REG_STR(reg) \
9997 ".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" \
101100 ".globl " GET_PC_THUNK_STR (reg) "\n" \
102 GET_PC_THUNK_STR (reg) ",comdat\n" \
103101 ".hidden " GET_PC_THUNK_STR (reg) "\n" \
104102 ".p2align 4\n" \
105103 ".type " GET_PC_THUNK_STR (reg) ",@function\n" \
lib/libc/glibc/sysdeps/ia64/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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__
5extern 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. */
44struct __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.
22 This file is part of the GNU C Library.
33 Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
44
......@@ -82,20 +82,15 @@ _start:
8282 {
8383 addl r11 = @ltoff(__libc_ia64_register_backing_store_base), gp
8484 addl out0 = @ltoff(@fptr(main)), gp
85 addl out3 = @ltoff(@fptr(__libc_csu_init)), gp
85 mov out3 = r0 /* Used to be init. */
8686 ;;
8787 }
8888 { .mmi
8989 ld8 r3 = [r11] /* pointer to __libc_ia64_register_backing_store_base */
9090 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. */
9292 ;;
9393 }
94 { .mmi
95 ld8 out3 = [out3] /* pointer to `init' function descriptor */
96 ld8 out4 = [out4] /* pointer to `fini' function descriptor */
97 nop 0
98 }
9994 .body
10095 { .mib
10196 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.
22 This file is part of the GNU C Library.
33 Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
44
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 @@
11/* Assembler macros for Coldfire.
2 Copyright (C) 1998-2020 Free Software Foundation, Inc.
2 Copyright (C) 1998-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Assembler macros for m680x0.
2 Copyright (C) 2010-2020 Free Software Foundation, Inc.
2 Copyright (C) 2010-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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.
22 This file is part of the GNU C Library.
33 Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
44
lib/libc/glibc/sysdeps/m68k/start.S+5-10
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -76,15 +76,14 @@ _start:
7676 pea (%a1) /* Push address of the shared library
7777 termination function. */
7878
79 /* These used to be addresses of the .fini and .init entry points. */
80 clr.l -(%sp)
81 clr.l -(%sp)
82
7983#ifdef PIC
8084 /* Load PIC register. */
8185 LOAD_GOT (%a5)
8286
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
8887 pea (%a0) /* Push second argument: argv. */
8988 move.l %d0, -(%sp) /* Push first argument: argc. */
9089
......@@ -94,10 +93,6 @@ _start:
9493 let the libc call main. */
9594 jbsr __libc_start_main@PLTPC
9695#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
10196
10297 pea (%a0) /* Push second argument: argv. */
10398 move.l %d0, -(%sp) /* Push first argument: argc. */
lib/libc/glibc/sysdeps/m68k/symbol-hacks.h+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Assembler macros for m68k.
2 Copyright (C) 1998-2020 Free Software Foundation, Inc.
2 Copyright (C) 1998-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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
35struct 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
107struct 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. */
250extern int chflags (__const char *__file, unsigned long int __flags) __THROW;
251
252/* Set file flags of the file referred to by FD to FLAGS. */
253extern 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.
22
33 This file is part of the GNU C Library.
44
......@@ -39,16 +39,6 @@
3939 envp = p; \
4040 } while (0)
4141
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
5242#define RETURN_TO(sp, pc, retval) \
5343 asm volatile ("movl %0, %%esp; jmp %*%1 # %2" \
5444 : : "g" (sp), "r" (pc), "a" (retval))
lib/libc/glibc/sysdeps/mach/libc-lock.h+11-14
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -24,9 +24,6 @@
2424#include <tls.h>
2525#include <lowlevellock.h>
2626
27/* The locking here is very inexpensive, even for inlining. */
28#define _IO_lock_inexpensive 1
29
3027typedef unsigned int __libc_lock_t;
3128typedef struct
3229{
......@@ -57,13 +54,13 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
5754 CLASS __libc_lock_t NAME;
5855
5956/* 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
6158#define __libc_lock_define_initialized(CLASS,NAME) \
62 CLASS __libc_lock_t NAME = LLL_INITIALIZER;
59 CLASS __libc_lock_t NAME = LLL_LOCK_INITIALIZER;
6360
6461/* Initialize the named lock variable, leaving it in a consistent, unlocked
6562 state. */
66#define __libc_lock_init(NAME) (NAME) = LLL_INITIALIZER
63#define __libc_lock_init(NAME) (NAME) = LLL_LOCK_INITIALIZER
6764
6865/* Finalize the named lock variable, which must be locked. It cannot be
6966 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;
7471
7572/* Lock the named lock variable. */
7673#define __libc_lock_lock(NAME) \
77 ({ lll_lock (&(NAME), 0); 0; })
74 ({ lll_lock ((NAME), 0); 0; })
7875
7976/* Lock the named lock variable. */
80#define __libc_lock_trylock(NAME) lll_trylock (&(NAME))
77#define __libc_lock_trylock(NAME) lll_trylock (NAME)
8178
8279/* Unlock the named lock variable. */
8380#define __libc_lock_unlock(NAME) \
84 ({ lll_unlock (&(NAME), 0); 0; })
81 ({ lll_unlock ((NAME), 0); 0; })
8582
8683#define __libc_lock_define_recursive(CLASS,NAME) \
8784 CLASS __libc_lock_recursive_t NAME;
8885
89#define _LIBC_LOCK_RECURSIVE_INITIALIZER { LLL_INITIALIZER, 0, 0 }
86#define _LIBC_LOCK_RECURSIVE_INITIALIZER { LLL_LOCK_INITIALIZER, 0, 0 }
9087
9188#define __libc_lock_define_initialized_recursive(CLASS,NAME) \
9289 CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
......@@ -111,7 +108,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
111108 int __r = 0; \
112109 if (__self == __lock->owner) \
113110 ++__lock->cnt; \
114 else if ((__r = lll_trylock (&__lock->lock)) == 0) \
111 else if ((__r = lll_trylock (__lock->lock)) == 0) \
115112 __lock->owner = __self, __lock->cnt = 1; \
116113 __r; \
117114 })
......@@ -122,7 +119,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
122119 void *__self = __libc_lock_owner_self (); \
123120 if (__self != __lock->owner) \
124121 { \
125 lll_lock (&__lock->lock, 0); \
122 lll_lock (__lock->lock, 0); \
126123 __lock->owner = __self; \
127124 } \
128125 ++__lock->cnt; \
......@@ -135,7 +132,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
135132 if (--__lock->cnt == 0) \
136133 { \
137134 __lock->owner = 0; \
138 lll_unlock (&__lock->lock, 0); \
135 lll_unlock (__lock->lock, 0); \
139136 } \
140137 })
141138
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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -62,14 +62,6 @@
6262#error SNARF_ARGS not defined by sysdeps/mach/MACHINE/sysdep.h
6363#endif
6464
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
7365/* LOSE can be defined as the `halt' instruction or something
7466 similar which will cause the process to die in a characteristic
7567 way suggesting a bug. */
lib/libc/glibc/sysdeps/microblaze/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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
44struct __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.
22
33 This file is part of the GNU C Library.
44
......@@ -63,14 +63,14 @@ _start:
6363 mfs r20,rpc
6464 addik r20,r20,_GLOBAL_OFFSET_TABLE_+8
6565 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. */
6868 brid __libc_start_main@PLT
6969 addk r10,r0,r0
7070#else
7171 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. */
7474 brid __libc_start_main
7575 addk r10,r0,r0
7676#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.
22
33 This file is part of the GNU C Library.
44
lib/libc/glibc/sysdeps/mips/dl-dtprocnum.h+1-1
......@@ -1,5 +1,5 @@
11/* Configuration of lookup functions. MIPS version.
2 Copyright (C) 2000-2020 Free Software Foundation, Inc.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -96,13 +96,13 @@ ENTRY_POINT:
9696# if _MIPS_SIM == _ABIO32
9797 PTR_SUBIU $29, 32
9898# endif
99 PTR_LA $7, __libc_csu_init /* init */
100 PTR_LA $8, __libc_csu_fini
99 move $7, $0 /* Used to be init. */
101100# if _MIPS_SIM == _ABIO32
102 PTR_S $8, 16($29) /* fini */
101 PTR_S $0, 16($29) /* Used to be fini. */
103102 PTR_S $2, 20($29) /* rtld_fini */
104103 PTR_S $29, 24($29) /* stack_end */
105104# else
105 move $8, $0 /* Used to be fini. */
106106 move $9, $2 /* rtld_fini */
107107 move $10, $29 /* stack_end */
108108# endif
......@@ -143,19 +143,17 @@ ENTRY_POINT:
143143 /* Lay out last arguments, and call __libc_start_main(). */
144144# ifdef __PIC__
145145 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. */
149148 lw $4, %got(main)($3) /* main */
150149 lw $3, %call16(__libc_start_main)($3)
151150 sw $2, 20($sp) /* rtld_fini */
152151 move $25, $3
153152 jalr $3
154153# else
155 lw $4, 1f
156154 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. */
159157 lw $4, 3f /* main */
160158 sw $2, 20($sp) /* rtld_fini */
161159 /* Load and call __libc_start_main(). */
......@@ -165,8 +163,6 @@ ENTRY_POINT:
165163hlt: b hlt /* Crash if somehow it does return. */
166164# ifndef __PIC__
167165 .align 2
1681: .word __libc_csu_fini
1692: .word __libc_csu_init
1701663: .word main
1711674: .word __libc_start_main
172168# 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; \
451: \
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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -116,4 +116,14 @@ struct __pthread_cond_s
116116 unsigned int __g_signals[2];
117117};
118118
119typedef unsigned int __tss_t;
120typedef unsigned long int __thrd_t;
121
122typedef struct
123{
124 int __data __ONCE_ALIGNMENT;
125} __once_flag;
126
127#define __ONCE_FLAG_INIT { 0 }
128
119129#endif /* _THREAD_SHARED_TYPES_H */
lib/libc/glibc/sysdeps/nptl/libc-lock.h+31-30
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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;
143143 __libc_maybe_call (__pthread_mutex_unlock, (&(NAME).mutex), 0)
144144#endif
145145
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. */
150extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer,
151 void (*routine) (void *), void *arg);
152extern 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. */
149void __libc_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer);
150libc_hidden_proto (__libc_cleanup_push_defer)
151/* Remove BUFFER from the unwind callback stack. The caller must invoke
152 the callback if desired. */
153void __libc_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer);
154libc_hidden_proto (__libc_cleanup_pop_restore)
154155
155156/* 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;
171172
172173/* 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 */
179180
180181
181182/* 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -32,26 +32,12 @@
3232 ld.so might be used on old kernels with a different libc.so. */
3333#include <lowlevellock.h>
3434#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
4235
4336/* Mutex type. */
44#if !IS_IN (libc) && !IS_IN (libpthread)
45typedef pthread_mutex_t __libc_lock_t;
46#else
4737typedef int __libc_lock_t;
48#endif
4938typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t;
5039typedef pthread_rwlock_t __libc_rwlock_t;
5140
52/* Type for key to thread-specific data. */
53typedef pthread_key_t __libc_key_t;
54
5541/* Define a lock variable NAME with storage class CLASS. The lock must be
5642 initialized with __libc_lock_init before it can be used (or define it
5743 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");
10389 (FUNC != NULL ? FUNC ARGS : ELSE)
10490#endif
10591
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
12798
12899/* Initialize the named lock variable, leaving it in a consistent, unlocked
129100 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)
145103
146104/* Finalize the named lock variable, which must be locked. It cannot be
147105 used again until __libc_lock_init is called again on it. This must be
148106 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)
161109
162110/* 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))
177114
178115/* 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)
196117
197118/* 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))
214121
122#if IS_IN (rtld)
215123# define __rtld_lock_lock_recursive(NAME) \
216 GL(dl_rtld_lock_recursive) (&(NAME).mutex)
124 ___rtld_mutex_lock (&(NAME).mutex)
217125
218126# 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. */
221129# define __rtld_lock_lock_recursive(NAME) \
222 __libc_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0)
130 __pthread_mutex_lock (&(NAME).mutex)
223131
224132# define __rtld_lock_unlock_recursive(NAME) \
225 __libc_maybe_call (__pthread_mutex_unlock, (&(NAME).mutex), 0)
133 __pthread_mutex_unlock (&(NAME).mutex)
226134#endif
227135
228136/* Define once control variable. */
......@@ -236,74 +144,42 @@ _Static_assert (LLL_LOCK_INITIALIZER == 0, "LLL_LOCK_INITIALIZER != 0");
236144 CLASS pthread_once_t NAME = PTHREAD_ONCE_INIT
237145#endif
238146
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
250156
251157/* Get once control variable. */
252158#define __libc_once_get(ONCE_CONTROL) ((ONCE_CONTROL) != PTHREAD_ONCE_INIT)
253159
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. */
258extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer,
259 void (*routine) (void *), void *arg);
260extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *buffer,
261 int execute);
262extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer,
263 void (*routine) (void *), void *arg);
264extern 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
274163
275164/* Normal cleanup handling, based on C cleanup attribute. */
276__extern_inline void
165static __always_inline void
277166__libc_cleanup_routine (struct __pthread_cleanup_frame *f)
278167{
279168 if (f->__do_it)
280169 f->__cancel_routine (f->__cancel_arg);
281170}
282171
283#define __libc_cleanup_push(fct, arg) \
172# define __libc_cleanup_push(fct, arg) \
284173 do { \
285174 struct __pthread_cleanup_frame __clframe \
286175 __attribute__ ((__cleanup__ (__libc_cleanup_routine))) \
287176 = { .__cancel_routine = (fct), .__cancel_arg = (arg), \
288177 .__do_it = 1 };
289178
290#define __libc_cleanup_pop(execute) \
179# define __libc_cleanup_pop(execute) \
291180 __clframe.__do_it = (execute); \
292181 } 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 */
307183
308184/* Register handlers to execute before and after `fork'. Note that the
309185 last parameter is NULL. The handlers registered by the libc are
......@@ -318,107 +194,56 @@ extern int __register_atfork (void (*__prepare) (void),
318194
319195extern int __pthread_mutex_init (pthread_mutex_t *__mutex,
320196 const pthread_mutexattr_t *__mutex_attr);
321
197libc_hidden_proto (__pthread_mutex_init)
322198extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex);
323
199libc_hidden_proto (__pthread_mutex_destroy)
324200extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex);
325201
326202extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
327
203libc_hidden_proto (__pthread_mutex_lock)
328204extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
329
330extern int __pthread_mutexattr_init (pthread_mutexattr_t *__attr);
205libc_hidden_proto (__pthread_mutex_unlock)
331206
332207extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr);
333208
334extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr,
335 int __kind);
336
337209extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock,
338210 const pthread_rwlockattr_t *__attr);
211libc_hidden_proto (__pthread_rwlock_init)
339212
340213extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock);
341214
342215extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock);
343
344extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock);
216libc_hidden_proto (__pthread_rwlock_rdlock)
345217
346218extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock);
347
348extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock);
219libc_hidden_proto (__pthread_rwlock_wrlock)
349220
350221extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock);
351
352extern int __pthread_key_create (pthread_key_t *__key,
353 void (*__destr_function) (void *));
354
355extern int __pthread_setspecific (pthread_key_t __key,
356 const void *__pointer);
357
358extern void *__pthread_getspecific (pthread_key_t __key);
359
222libc_hidden_proto (__pthread_rwlock_unlock)
360223extern int __pthread_once (pthread_once_t *__once_control,
361224 void (*__init_routine) (void));
225libc_hidden_proto (__pthread_once)
362226
363227extern int __pthread_atfork (void (*__prepare) (void),
364228 void (*__parent) (void),
365229 void (*__child) (void));
366230
367231extern int __pthread_setcancelstate (int state, int *oldstate);
368
232libc_hidden_proto (__pthread_setcancelstate)
369233
370234/* Make the pthread functions weak so that we can elide them from
371235 single-threaded processes. */
372236#ifndef __NO_WEAK_PTHREAD_ALIASES
373237# ifdef weak_extern
374weak_extern (__pthread_mutex_init)
375weak_extern (__pthread_mutex_destroy)
376weak_extern (__pthread_mutex_lock)
377238weak_extern (__pthread_mutex_trylock)
378weak_extern (__pthread_mutex_unlock)
379weak_extern (__pthread_mutexattr_init)
380239weak_extern (__pthread_mutexattr_destroy)
381weak_extern (__pthread_mutexattr_settype)
382weak_extern (__pthread_rwlock_init)
383weak_extern (__pthread_rwlock_destroy)
384weak_extern (__pthread_rwlock_rdlock)
385weak_extern (__pthread_rwlock_tryrdlock)
386weak_extern (__pthread_rwlock_wrlock)
387weak_extern (__pthread_rwlock_trywrlock)
388weak_extern (__pthread_rwlock_unlock)
389weak_extern (__pthread_key_create)
390weak_extern (__pthread_setspecific)
391weak_extern (__pthread_getspecific)
392weak_extern (__pthread_once)
393240weak_extern (__pthread_initialize)
394241weak_extern (__pthread_atfork)
395weak_extern (__pthread_setcancelstate)
396weak_extern (_pthread_cleanup_push_defer)
397weak_extern (_pthread_cleanup_pop_restore)
398242# else
399# pragma weak __pthread_mutex_init
400# pragma weak __pthread_mutex_destroy
401# pragma weak __pthread_mutex_lock
402243# pragma weak __pthread_mutex_trylock
403# pragma weak __pthread_mutex_unlock
404# pragma weak __pthread_mutexattr_init
405244# 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
417245# pragma weak __pthread_initialize
418246# pragma weak __pthread_atfork
419# pragma weak __pthread_setcancelstate
420# pragma weak _pthread_cleanup_push_defer
421# pragma weak _pthread_cleanup_pop_restore
422247# endif
423248#endif
424249
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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -27,7 +27,11 @@
2727#include <bits/setjmp.h>
2828#include <bits/wordsize.h>
2929#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
3135
3236/* Detach state. */
3337enum
......@@ -219,6 +223,7 @@ extern int pthread_join (pthread_t __th, void **__thread_return);
219223 the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */
220224extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW;
221225
226# ifndef __USE_TIME_BITS64
222227/* Make calling thread wait for termination of the thread TH, but only
223228 until TIMEOUT. The exit status of the thread is stored in
224229 *THREAD_RETURN, if THREAD_RETURN is not NULL.
......@@ -238,6 +243,23 @@ extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return,
238243extern int pthread_clockjoin_np (pthread_t __th, void **__thread_return,
239244 clockid_t __clockid,
240245 const struct timespec *__abstime);
246# else
247# ifdef __REDIRECT
248extern int __REDIRECT (pthread_timedjoin_np,
249 (pthread_t __th, void **__thread_return,
250 const struct timespec *__abstime),
251 __pthread_timedjoin_np64);
252
253extern 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
241263#endif
242264
243265/* 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,
385407extern int pthread_getattr_default_np (pthread_attr_t *__attr)
386408 __THROW __nonnull ((1));
387409
410/* Store *SIGMASK as the signal mask for the new thread in *ATTR. */
411extern 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. */
417extern 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
388424/* Set the default attributes to be used by pthread_create in this
389425 process. */
390426extern int pthread_setattr_default_np (const pthread_attr_t *__attr)
......@@ -438,11 +474,14 @@ extern int pthread_setconcurrency (int __level) __THROW;
438474#endif
439475
440476#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. */
445477extern int pthread_yield (void) __THROW;
478# ifdef __REDIRECT_NTH
479extern int __REDIRECT_NTH (pthread_yield, (void), sched_yield)
480 __attribute_deprecated_msg__ ("\
481pthread_yield is deprecated, use sched_yield instead");
482# else
483# define pthread_yield sched_yield
484# endif
446485
447486
448487/* Limit specified thread TH to run only on the processors represented
......@@ -496,13 +535,15 @@ extern void pthread_testcancel (void);
496535
497536/* Cancellation handling with integration into exception handling. */
498537
538struct __cancel_jmp_buf_tag
539{
540 __jmp_buf __cancel_jmp_buf;
541 int __mask_was_saved;
542};
543
499544typedef struct
500545{
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];
506547 void *__pad[4];
507548} __pthread_unwind_buf_t __attribute__ ((__aligned__));
508549
......@@ -642,8 +683,8 @@ __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
642683 __pthread_unwind_buf_t __cancel_buf; \
643684 void (*__cancel_routine) (void *) = (routine); \
644685 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); \
647688 if (__glibc_unlikely (__not_first_call)) \
648689 { \
649690 __cancel_routine (__cancel_arg); \
......@@ -677,8 +718,8 @@ extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
677718 __pthread_unwind_buf_t __cancel_buf; \
678719 void (*__cancel_routine) (void *) = (routine); \
679720 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); \
682723 if (__glibc_unlikely (__not_first_call)) \
683724 { \
684725 __cancel_routine (__cancel_arg); \
......@@ -714,9 +755,24 @@ extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
714755 ;
715756#endif
716757
717/* Function used in the macros. */
718struct __jmp_buf_tag;
719extern 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)
766extern 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))
773extern int __sigsetjmp (struct __jmp_buf_tag __env[1],
774 int __savemask) __THROWNL;
775#endif
720776
721777
722778/* Mutex handling. */
......@@ -740,16 +796,39 @@ extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
740796
741797#ifdef __USE_XOPEN2K
742798/* Wait until lock becomes available, or specified time passes. */
799# ifndef __USE_TIME_BITS64
743800extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
744801 const struct timespec *__restrict
745802 __abstime) __THROWNL __nonnull ((1, 2));
803# else
804# ifdef __REDIRECT_NTHNL
805extern 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
746813#endif
747814
748815#ifdef __USE_GNU
816# ifndef __USE_TIME_BITS64
749817extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex,
750818 clockid_t __clockid,
751819 const struct timespec *__restrict
752820 __abstime) __THROWNL __nonnull ((1, 3));
821# else
822# ifdef __REDIRECT_NTHNL
823extern 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
753832#endif
754833
755834/* Unlock a mutex. */
......@@ -776,8 +855,14 @@ extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
776855extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
777856 __THROW __nonnull ((1));
778857# ifdef __USE_GNU
779extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
780 __THROW __nonnull ((1));
858# ifdef __REDIRECT_NTH
859extern int __REDIRECT_NTH (pthread_mutex_consistent_np, (pthread_mutex_t *),
860 pthread_mutex_consistent) __nonnull ((1))
861 __attribute_deprecated_msg__ ("\
862pthread_mutex_consistent_np is deprecated, use pthread_mutex_consistent");
863# else
864# define pthread_mutex_consistent_np pthread_mutex_consistent
865# endif
781866# endif
782867#endif
783868
......@@ -846,9 +931,15 @@ extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr,
846931 int *__robustness)
847932 __THROW __nonnull ((1, 2));
848933# ifdef __USE_GNU
849extern int pthread_mutexattr_getrobust_np (const pthread_mutexattr_t *__attr,
850 int *__robustness)
851 __THROW __nonnull ((1, 2));
934# ifdef __REDIRECT_NTH
935extern int __REDIRECT_NTH (pthread_mutexattr_getrobust_np,
936 (pthread_mutex_t *, int *),
937 pthread_mutexattr_getrobust) __nonnull ((1))
938 __attribute_deprecated_msg__ ("\
939pthread_mutexattr_getrobust_np is deprecated, use pthread_mutexattr_getrobust");
940# else
941# define pthread_mutexattr_getrobust_np pthread_mutexattr_getrobust
942# endif
852943# endif
853944
854945/* Set the robustness flag of the mutex attribute ATTR. */
......@@ -856,13 +947,18 @@ extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
856947 int __robustness)
857948 __THROW __nonnull ((1));
858949# ifdef __USE_GNU
859extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
860 int __robustness)
861 __THROW __nonnull ((1));
950# ifdef __REDIRECT_NTH
951extern int __REDIRECT_NTH (pthread_mutexattr_setrobust_np,
952 (pthread_mutex_t *, int),
953 pthread_mutexattr_setrobust) __nonnull ((1))
954 __attribute_deprecated_msg__ ("\
955pthread_mutexattr_setrobust_np is deprecated, use pthread_mutexattr_setrobust");
956# else
957# define pthread_mutexattr_setrobust_np pthread_mutexattr_setrobust
958# endif
862959# endif
863960#endif
864961
865
866962#if defined __USE_UNIX98 || defined __USE_XOPEN2K
867963/* Functions for handling read-write locks. */
868964
......@@ -886,16 +982,41 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
886982
887983# ifdef __USE_XOPEN2K
888984/* Try to acquire read lock for RWLOCK or return after specfied time. */
985# ifndef __USE_TIME_BITS64
889986extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
890987 const struct timespec *__restrict
891988 __abstime) __THROWNL __nonnull ((1, 2));
989# else
990# ifdef __REDIRECT_NTHNL
991extern 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
8921000# endif
8931001
8941002# ifdef __USE_GNU
1003# ifndef __USE_TIME_BITS64
8951004extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock,
8961005 clockid_t __clockid,
8971006 const struct timespec *__restrict
8981007 __abstime) __THROWNL __nonnull ((1, 3));
1008# else
1009# ifdef __REDIRECT_NTHNL
1010extern 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
8991020# endif
9001021
9011022/* Acquire write lock for RWLOCK. */
......@@ -908,16 +1029,42 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
9081029
9091030# ifdef __USE_XOPEN2K
9101031/* Try to acquire write lock for RWLOCK or return after specfied time. */
1032# ifndef __USE_TIME_BITS64
9111033extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
9121034 const struct timespec *__restrict
9131035 __abstime) __THROWNL __nonnull ((1, 2));
1036# else
1037# ifdef __REDIRECT_NTHNL
1038extern 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
9141047# endif
9151048
9161049# ifdef __USE_GNU
1050# ifndef __USE_TIME_BITS64
9171051extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock,
9181052 clockid_t __clockid,
9191053 const struct timespec *__restrict
9201054 __abstime) __THROWNL __nonnull ((1, 3));
1055
1056# else
1057# ifdef __REDIRECT_NTHNL
1058extern 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
9211068# endif
9221069
9231070/* Unlock RWLOCK. */
......@@ -994,10 +1141,23 @@ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
9941141
9951142 This function is a cancellation point and therefore not marked with
9961143 __THROW. */
1144# ifndef __USE_TIME_BITS64
9971145extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
9981146 pthread_mutex_t *__restrict __mutex,
9991147 const struct timespec *__restrict __abstime)
10001148 __nonnull ((1, 2, 3));
1149# else
1150# ifdef __REDIRECT
1151extern 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
10011161
10021162# ifdef __USE_GNU
10031163/* 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,
10071167
10081168 This function is a cancellation point and therefore not marked with
10091169 __THROW. */
1170# ifndef __USE_TIME_BITS64
10101171extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond,
10111172 pthread_mutex_t *__restrict __mutex,
10121173 __clockid_t __clock_id,
10131174 const struct timespec *__restrict __abstime)
10141175 __nonnull ((1, 2, 4));
1176# else
1177# ifdef __REDIRECT
1178extern 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
10151189# endif
10161190
10171191/* Functions for handling condition variable attributes. */
......@@ -1132,7 +1306,8 @@ extern void *pthread_getspecific (pthread_key_t __key) __THROW;
11321306
11331307/* Store POINTER in the thread-specific data slot identified by KEY. */
11341308extern int pthread_setspecific (pthread_key_t __key,
1135 const void *__pointer) __THROW ;
1309 const void *__pointer)
1310 __THROW __attr_access_none (2);
11361311
11371312
11381313#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
51struct __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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -52,8 +52,8 @@
5252L(start_addresses):
5353 .long _SDA_BASE_
5454 .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. */
5757 ASM_SIZE_DIRECTIVE(L(start_addresses))
5858
5959 .section ".text"
lib/libc/glibc/sysdeps/powerpc/powerpc32/symbol-hacks.h+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Assembly macros for 32-bit PowerPC.
2 Copyright (C) 1999-2020 Free Software Foundation, Inc.
2 Copyright (C) 1999-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -92,7 +92,10 @@ GOT_LABEL: ; \
9292
9393#define DO_CALL(syscall) \
9494 li 0,syscall; \
95 sc
95 DO_CALL_SC
96
97#define DO_CALL_SC \
98 sc
9699
97100#undef JUMPTARGET
98101#ifdef PIC
......@@ -106,14 +109,20 @@ GOT_LABEL: ; \
106109# define HIDDEN_JUMPTARGET(name) __GI_##name##@local
107110#endif
108111
112#define TAIL_CALL_SYSCALL_ERROR \
113 b __syscall_error@local
114
109115#define PSEUDO(name, syscall_name, args) \
110116 .section ".text"; \
111117 ENTRY (name) \
112118 DO_CALL (SYS_ify (syscall_name));
113119
120#define RET_SC \
121 bnslr+;
122
114123#define PSEUDO_RET \
115 bnslr+; \
116 b __syscall_error@local
124 RET_SC; \
125 TAIL_CALL_SYSCALL_ERROR
117126#define ret PSEUDO_RET
118127
119128#undef PSEUDO_END
......@@ -179,8 +188,8 @@ GOT_LABEL: ; \
179188#else
180189/* Position-dependent code does not require access to the GOT. */
181190# 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)
184193#endif /* PIC */
185194
186195#endif /* __ASSEMBLER__ */
lib/libc/glibc/sysdeps/powerpc/powerpc64/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Configuration of lookup functions. PowerPC64 version.
2 Copyright (C) 2002-2020 Free Software Foundation, Inc.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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__
21extern 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -53,8 +53,8 @@ L(start_addresses):
5353 .quad 0 /* was _SDA_BASE_ but not in 64-bit ABI*/
5454/* function descriptors so don't need JUMPTARGET */
5555 .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. */
5858
5959 ASM_SIZE_DIRECTIVE(L(start_addresses))
6060
lib/libc/glibc/sysdeps/powerpc/powerpc64/sysdep.h+126-8
......@@ -1,5 +1,5 @@
11/* Assembly macros for 64-bit PowerPC.
2 Copyright (C) 2002-2020 Free Software Foundation, Inc.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -17,6 +17,7 @@
1717 <https://www.gnu.org/licenses/>. */
1818
1919#include <sysdeps/powerpc/sysdep.h>
20#include <tls.h>
2021
2122#ifdef __ASSEMBLER__
2223
......@@ -263,10 +264,83 @@ LT_LABELSUFFIX(name,_name_end): ; \
263264 TRACEBACK_MASK(name,mask); \
264265 END_2(name)
265266
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; \
3240: DO_CALL_SC; \
3251:
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 \
268330 sc
269331
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
270344/* ppc64 is always PIC */
271345#undef JUMPTARGET
272346#define JUMPTARGET(name) FUNC_LABEL(name)
......@@ -278,7 +352,7 @@ LT_LABELSUFFIX(name,_name_end): ; \
278352
279353#ifdef SHARED
280354#define TAIL_CALL_SYSCALL_ERROR \
281 b JUMPTARGET(__syscall_error)
355 b JUMPTARGET (NOTOC (__syscall_error))
282356#else
283357/* Static version might be linked into a large app with a toc exceeding
284358 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): ; \
304378 .endif
305379#endif
306380
307#define PSEUDO_RET \
308 bnslr+; \
381#if !defined(USE_PPC_SCV) || IS_IN(rtld)
382# define PSEUDO_RET \
383 RET_SC; \
309384 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; \
3960: RET_SC; \
3971: 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+;
310408
311409#define ret PSEUDO_RET
312410
......@@ -319,8 +417,15 @@ LT_LABELSUFFIX(name,_name_end): ; \
319417 ENTRY (name); \
320418 DO_CALL (SYS_ify (syscall_name))
321419
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; \
323427 blr
428#endif /* !defined(USE_PPC_SCV) || IS_IN(rtld) */
324429
325430#define ret_NOERRNO PSEUDO_RET_NOERRNO
326431
......@@ -333,8 +438,15 @@ LT_LABELSUFFIX(name,_name_end): ; \
333438 ENTRY (name); \
334439 DO_CALL (SYS_ify (syscall_name))
335440
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; \
337448 blr
449#endif /* !defined(USE_PPC_SCV) || IS_IN(rtld) */
338450
339451#define ret_ERRVAL PSEUDO_RET_ERRVAL
340452
......@@ -366,6 +478,12 @@ LT_LABELSUFFIX(name,_name_end): ; \
366478 lwz rOUT,0(rOUT)
367479#endif
368480
481#ifdef USE_PPC64_NOTOC
482# define NOTOC(l) l@notoc
483#else
484# define NOTOC(l) l
485#endif
486
369487#else /* !__ASSEMBLER__ */
370488
371489#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.
22 This file is part of the GNU C Library.
33
44 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
36extern int __pthread_atfork (void (*prepare) (void), void (*parent) (void),
37 void (*child) (void));
38extern int __register_atfork (void (*__prepare) (void),
39 void (*__parent) (void),
40 void (*__child) (void),
41 void *dso_handle);
42libc_hidden_proto (__register_atfork)
43extern 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. */
47int
48#ifndef __pthread_atfork
49/* Don't mark the compatibility function as hidden. */
50attribute_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
58extern int pthread_atfork (void (*prepare) (void), void (*parent) (void),
59 void (*child) (void)) attribute_hidden;
60weak_alias (__pthread_atfork, pthread_atfork)
61#endif
lib/libc/glibc/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h+16-12
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -21,18 +21,22 @@
2121
2222#include <bits/endian.h>
2323
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
3435#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
3640#endif
3741
3842#define __LOCK_ALIGNMENT
lib/libc/glibc/sysdeps/riscv/start.S+3-3
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -54,8 +54,8 @@ ENTRY (ENTRY_POINT)
5454 REG_L a1, 0(sp) /* argc. */
5555 addi a2, sp, SZREG /* argv. */
5656 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. */
5959 mv a6, sp /* stack_end. */
6060
6161 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
50struct __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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
44 This file is part of the GNU C Library.
55
......@@ -175,18 +175,16 @@ _start:
175175 */
176176 stm %r14,%r15,96(%r15) # store rtld_fini/stack_end to parameter area
177177 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
180178 l %r2,.L3-.Llit(%r13) # load pointer to main
181179 l %r1,.L4-.Llit(%r13) # load pointer to __libc_start_main
182180#ifdef PIC
183181 l %r12,.L5-.Llit(%r13) # load .got pointer
184 la %r6,0(%r13,%r6)
185 la %r5,0(%r13,%r5)
186182 la %r12,0(%r13,%r12)
187183 l %r2,0(%r12,%r2)
188184 la %r1,0(%r13,%r1)
189185#endif
186 lhi %r6, 0 # Used to fini.
187 lhi %r5, 0 # Used to init.
190188
191189 /* ok, now branch to the libc main routine */
192190 basr %r14,%r1
......@@ -197,13 +195,9 @@ _start:
197195 cfi_endproc
198196.Llit:
199197#ifndef PIC
200.L1: .long __libc_csu_init
201.L2: .long __libc_csu_fini
202198.L3: .long main
203199.L4: .long __libc_start_main
204200#else
205.L1: .long __libc_csu_init-.Llit
206.L2: .long __libc_csu_fini-.Llit
207201.L3: .long main@GOT
208202.L4: .long __libc_start_main@plt-.Llit
209203.L5: .long _GLOBAL_OFFSET_TABLE_-.Llit
lib/libc/glibc/sysdeps/s390/s390-32/symbol-hacks.h+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Assembler macros for s390.
2 Copyright (C) 2000-2020 Free Software Foundation, Inc.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
33 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
44 This file is part of the GNU C Library.
55
lib/libc/glibc/sysdeps/s390/s390-64/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
44 This file is part of the GNU C Library.
55
lib/libc/glibc/sysdeps/s390/s390-64/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
44 This file is part of the GNU C Library.
55
lib/libc/glibc/sysdeps/s390/s390-64/start.S+3-3
......@@ -1,5 +1,5 @@
11/* 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.
33 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
44 This file is part of the GNU C Library.
55
......@@ -80,8 +80,8 @@ _start:
8080 */
8181 stmg %r14,%r15,160(%r15) # store rtld_fini/stack_end to parameter area
8282 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.
8585
8686 /* Ok, now branch to the libc main routine. */
8787#ifdef PIC
lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
44 This file is part of the GNU C Library.
55
lib/libc/glibc/sysdeps/sh/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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
43struct __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 @@
11/* Startup code for SH & ELF.
2 Copyright (C) 1999-2020 Free Software Foundation, Inc.
2 Copyright (C) 1999-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -70,12 +70,11 @@ _start:
7070
7171 /* Push the last arguments to main() onto the stack */
7272 mov.l r4,@-r15
73 mov.l L_fini,r0
74 mov.l r0,@-r15
73 mov.l r14,@-r15 /* Used to be fini. */
7574
7675 /* Set up the other arguments for main() that go in registers */
7776 mov.l L_main,r4
78 mov.l L_init,r7
77 mov #0,r7 /* Used to be init. */
7978
8079 /* __libc_start_main (main, argc, argv, init, fini, rtld_fini) */
8180
......@@ -90,10 +89,6 @@ _start:
9089 .align 2
9190L_main:
9291 .long main
93L_init:
94 .long __libc_csu_init
95L_fini:
96 .long __libc_csu_fini
9792L_libc_start_main:
9893 .long __libc_start_main
9994L_abort:
lib/libc/glibc/sysdeps/sh/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* Assembler macros for SH.
2 Copyright (C) 1999-2020 Free Software Foundation, Inc.
2 Copyright (C) 1999-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Configuration of lookup functions. SPARC version.
2 Copyright (C) 2000-2020 Free Software Foundation, Inc.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Startup code for elf32-sparc
2 Copyright (C) 1997-2020 Free Software Foundation, Inc.
2 Copyright (C) 1997-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44 Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
55
......@@ -59,22 +59,14 @@ _start:
5959 /* Load the addresses of the user entry points. */
6060#ifndef PIC
6161 sethi %hi(main), %o0
62 sethi %hi(__libc_csu_init), %o3
63 sethi %hi(__libc_csu_fini), %o4
6462 or %o0, %lo(main), %o0
65 or %o3, %lo(__libc_csu_init), %o3
66 or %o4, %lo(__libc_csu_fini), %o4
6763#else
6864 sethi %gdop_hix22(main), %o0
69 sethi %gdop_hix22(__libc_csu_init), %o3
70 sethi %gdop_hix22(__libc_csu_fini), %o4
7165 xor %o0, %gdop_lox10(main), %o0
72 xor %o3, %gdop_lox10(__libc_csu_init), %o3
73 xor %o4, %gdop_lox10(__libc_csu_fini), %o4
7466 ld [%l7 + %o0], %o0, %gdop(main)
75 ld [%l7 + %o3], %o3, %gdop(__libc_csu_init)
76 ld [%l7 + %o4], %o4, %gdop(__libc_csu_fini)
7767#endif
68 mov 0, %o3 /* Used to be init. */
69 mov 0, %o4 /* Used to be fini. */
7870
7971 /* When starting a binary via the dynamic linker, %g1 contains the
8072 address of the shared library termination function, which will be
lib/libc/glibc/sysdeps/sparc/sparc64/start.S+3-11
......@@ -1,5 +1,5 @@
11/* Startup code for elf64-sparc
2 Copyright (C) 1997-2020 Free Software Foundation, Inc.
2 Copyright (C) 1997-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44 Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
55
......@@ -60,22 +60,14 @@ _start:
6060 /* Load the addresses of the user entry points. */
6161#ifndef PIC
6262 sethi %hi(main), %o0
63 sethi %hi(__libc_csu_init), %o3
64 sethi %hi(__libc_csu_fini), %o4
6563 or %o0, %lo(main), %o0
66 or %o3, %lo(__libc_csu_init), %o3
67 or %o4, %lo(__libc_csu_fini), %o4
6864#else
6965 sethi %gdop_hix22(main), %o0
70 sethi %gdop_hix22(__libc_csu_init), %o3
71 sethi %gdop_hix22(__libc_csu_fini), %o4
7266 xor %o0, %gdop_lox10(main), %o0
73 xor %o3, %gdop_lox10(__libc_csu_init), %o3
74 xor %o4, %gdop_lox10(__libc_csu_fini), %o4
7567 ldx [%l7 + %o0], %o0, %gdop(main)
76 ldx [%l7 + %o3], %o3, %gdop(__libc_csu_init)
77 ldx [%l7 + %o4], %o4, %gdop(__libc_csu_fini)
7868#endif
69 mov 0, %o3 /* Used to be init. */
70 mov 0, %o4 /* Used to be fini. */
7971
8072 /* When starting a binary via the dynamic linker, %g1 contains the
8173 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.
22 This file is part of the GNU C Library.
33
44 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))))
373extern 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
377extern 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.
22 This file is part of the GNU C Library.
33
44 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.
22 This file is part of the GNU C Library.
33
44 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__
2extern 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.
22 This file is part of the GNU C Library.
33 Contributed by Brendan Kehoe (brendan@zen.org).
44
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; \
45L(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; \
61L(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; \
45L(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; \
61L(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; \
46L(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; \
62L(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.
22 This file is part of the GNU C Library.
33 Contributed by Brendan Kehoe (brendan@zen.org).
44
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.
22 This file is part of the GNU C Library.
33
44 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.
22 This file is part of the GNU C Library.
33
44 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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -28,24 +28,24 @@
2828#define __SYSCALL_CONCAT(a,b) __SYSCALL_CONCAT_X (a, b)
2929
3030
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
4949#define __INTERNAL_SYSCALL_NARGS(...) \
5050 __INTERNAL_SYSCALL_NARGS_X (__VA_ARGS__,7,6,5,4,3,2,1,0,)
5151#define __INTERNAL_SYSCALL_DISP(b,...) \
......@@ -88,10 +88,17 @@
8888#define INLINE_SYSCALL_CALL(...) \
8989 __INLINE_SYSCALL_DISP (__INLINE_SYSCALL, __VA_ARGS__)
9090
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
9198#define SYSCALL_CANCEL(...) \
9299 ({ \
93100 long int sc_ret; \
94 if (SINGLE_THREAD_P) \
101 if (NO_SYSCALL_CANCEL_CHECKING) \
95102 sc_ret = INLINE_SYSCALL_CALL (__VA_ARGS__); \
96103 else \
97104 { \
......@@ -107,7 +114,7 @@
107114#define INTERNAL_SYSCALL_CANCEL(...) \
108115 ({ \
109116 long int sc_ret; \
110 if (SINGLE_THREAD_P) \
117 if (NO_SYSCALL_CANCEL_CHECKING) \
111118 sc_ret = INTERNAL_SYSCALL_CALL (__VA_ARGS__); \
112119 else \
113120 { \
lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/kernel-features.h+1-1
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. AArch64 version.
3 Copyright (C) 2018-2020 Free Software Foundation, Inc.
3 Copyright (C) 2018-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 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.
22
33 This file is part of the GNU C Library.
44
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.
22
33 This file is part of the GNU C Library.
44
......@@ -164,29 +164,10 @@
164164# define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime"
165165# define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday"
166166
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
171167# define SINGLE_THREAD_BY_GLOBAL 1
172168
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
188169# undef INTERNAL_SYSCALL_RAW
189# define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
170# define INTERNAL_SYSCALL_RAW(name, nr, args...) \
190171 ({ long _sys_result; \
191172 { \
192173 LOAD_ARGS_##nr (args) \
......@@ -198,19 +179,12 @@
198179 _sys_result; })
199180
200181# 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)
203184
204185# 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)
214188
215189# define LOAD_ARGS_0() \
216190 register long _x0 asm ("x0");
......@@ -253,8 +227,11 @@
253227# define ASM_ARGS_7 ASM_ARGS_6, "r" (_x6)
254228
255229# 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
258235
259236#endif /* __ASSEMBLER__ */
260237
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
69struct 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. */
100struct 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -49,6 +49,7 @@
4949#define __TIME_T_TYPE __SLONGWORD_TYPE
5050#define __USECONDS_T_TYPE __U32_TYPE
5151#define __SUSECONDS_T_TYPE __S64_TYPE
52#define __SUSECONDS64_T_TYPE __S64_TYPE
5253#define __DADDR_T_TYPE __S32_TYPE
5354#define __KEY_T_TYPE __S32_TYPE
5455#define __CLOCKID_T_TYPE __S32_TYPE
......@@ -72,6 +73,9 @@
7273/* Not for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
7374# define __STATFS_MATCHES_STATFS64 0
7475
76/* And for getitimer, setitimer and rusage */
77#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
78
7579/* Number of descriptors that can fit in an `fd_set'. */
7680#define __FD_SETSIZE 1024
7781
lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/kernel-features.h+1-1
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number.
3 Copyright (C) 2010-2020 Free Software Foundation, Inc.
3 Copyright (C) 2010-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 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. */
2struct 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. */
22struct 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. */
47struct 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. */
67struct 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.
22 This file is part of the GNU C Library.
33 Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
44
......@@ -19,14 +19,10 @@
1919#ifndef _LINUX_ALPHA_SYSDEP_H
2020#define _LINUX_ALPHA_SYSDEP_H 1
2121
22#ifdef __ASSEMBLER__
23#include <asm/pal.h>
24#include <alpha/regdef.h>
25#endif
26
2722/* There is some commonality. */
2823#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. */
3026
3127#include <tls.h>
3228
......@@ -39,4 +35,325 @@
3935
4036#define SINGLE_THREAD_BY_GLOBAL 1
4137
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))))
348extern 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
352extern 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 \
117L (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)
138extern long int __syscall_error (long int);
139hidden_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 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number.
3 Copyright (C) 2006-2020 Free Software Foundation, Inc.
3 Copyright (C) 2006-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 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.. */
2struct 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.
22 This file is part of the GNU C Library.
33
44 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.
22 This file is part of the GNU C Library.
33 Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
44 ARM changes by Philip Blundell, <pjb27@cam.ac.uk>, May 1997.
......@@ -29,11 +29,6 @@
2929
3030#include <tls.h>
3131
32/* In order to get __set_errno() definition in INLINE_SYSCALL. */
33#ifndef __ASSEMBLER__
34#include <errno.h>
35#endif
36
3732/* For Linux we can use the system call table in the header file
3833 /usr/include/asm/unistd.h
3934 of the kernel. But these symbols do not follow the SYS_* syntax
......@@ -317,21 +312,6 @@ __local_syscall_error: \
317312
318313#else /* not __ASSEMBLER__ */
319314
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
335315#if defined(__thumb__)
336316/* We can not expose the use of r7 to the compiler. GCC (as
337317 of 4.5) uses r7 as the hard frame pointer for Thumb - although
......@@ -348,7 +328,7 @@ __local_syscall_error: \
348328 then unwinding will fail higher up the stack. So we move the
349329 syscall out of line and provide its own unwind information. */
350330# undef INTERNAL_SYSCALL_RAW
351# define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
331# define INTERNAL_SYSCALL_RAW(name, nr, args...) \
352332 ({ \
353333 register int _a1 asm ("a1"); \
354334 int _nametmp = name; \
......@@ -361,7 +341,7 @@ __local_syscall_error: \
361341 _a1; })
362342#else /* ARM */
363343# undef INTERNAL_SYSCALL_RAW
364# define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
344# define INTERNAL_SYSCALL_RAW(name, nr, args...) \
365345 ({ \
366346 register int _a1 asm ("r0"), _nr asm ("r7"); \
367347 LOAD_ARGS_##nr (args) \
......@@ -374,15 +354,8 @@ __local_syscall_error: \
374354#endif
375355
376356#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)
386359
387360#define VDSO_NAME "LINUX_2.6"
388361#define VDSO_HASH 61765110
......@@ -434,8 +407,8 @@ __local_syscall_error: \
434407
435408/* For EABI, non-constant syscalls are actually pretty easy... */
436409#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)
439412
440413#define SINGLE_THREAD_BY_GLOBAL 1
441414
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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -22,119 +22,7 @@
2222#ifndef _BITS_STAT_H
2323#define _BITS_STAT_H 1
2424
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
38struct 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
95struct 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>
13826
13927/* Encoding of the file mode. */
14028
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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -25,6 +25,36 @@
2525
2626struct timex
2727{
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
2858 unsigned int modes; /* mode selector */
2959 __syscall_slong_t offset; /* time offset (usec) */
3060 __syscall_slong_t freq; /* frequency offset (scaled ppm) */
......@@ -51,6 +81,7 @@ struct timex
5181 int :32; int :32; int :32; int :32;
5282 int :32; int :32; int :32; int :32;
5383 int :32; int :32; int :32;
84# endif
5485};
5586
5687/* 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; \
801: \
81 rts
82# else
83# define PSEUDO_RET \
84 btsti a0, 31; \
85 bf 1f; \
86 jmpi SYSCALL_ERROR; \
871: \
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; \
1031: \
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; \
4751: \
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
487extern 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; \
4961: \
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
508extern 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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
25int
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
36weak_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
27int
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
38hidden_def (__fstat64_time64)
39
40int
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
58hidden_def (__fstat64)
59weak_alias (__fstat64, fstat64)
60
61#if XSTAT_IS_XSTAT64
62strong_alias (__fstat64, __fstat)
63weak_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
28static inline bool
29in_time_t_range (__time64_t t)
30{
31 time_t s = t;
32 return s == t;
33}
34
35static inline struct timespec
36valid_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
46int
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
81weak_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
44static inline int
45fstatat64_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
78static inline struct __timespec64
79valid_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
89static inline int
90fstatat64_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
158int
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
179hidden_def (__fstatat64_time64)
180
181int
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
193hidden_def (__fstatat64)
194weak_alias (__fstatat64, fstatat64)
195
196#if XSTAT_IS_XSTAT64
197strong_alias (__fstatat64, __fstatat)
198weak_alias (__fstatat64, fstatat)
199strong_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
58struct 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
99struct 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44 Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
55
......@@ -26,31 +26,45 @@
2626
2727/* See <bits/types.h> for the meaning of these macros. This file exists so
2828 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
2950
3051#define __DEV_T_TYPE __UQUAD_TYPE
3152#define __UID_T_TYPE __U32_TYPE
3253#define __GID_T_TYPE __U32_TYPE
33#define __INO_T_TYPE __ULONGWORD_TYPE
3454#define __INO64_T_TYPE __UQUAD_TYPE
3555#define __MODE_T_TYPE __U32_TYPE
3656#define __NLINK_T_TYPE __U32_TYPE
37#define __OFF_T_TYPE __SLONGWORD_TYPE
3857#define __OFF64_T_TYPE __SQUAD_TYPE
3958#define __PID_T_TYPE __S32_TYPE
40#define __RLIM_T_TYPE __ULONGWORD_TYPE
4159#define __RLIM64_T_TYPE __UQUAD_TYPE
42#define __BLKCNT_T_TYPE __SLONGWORD_TYPE
4360#define __BLKCNT64_T_TYPE __SQUAD_TYPE
44#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
4561#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
46#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
4762#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
4863#define __FSWORD_T_TYPE __SWORD_TYPE
4964#define __ID_T_TYPE __U32_TYPE
5065#define __CLOCK_T_TYPE __SLONGWORD_TYPE
51#define __TIME_T_TYPE __SLONGWORD_TYPE
5266#define __USECONDS_T_TYPE __U32_TYPE
53#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
67#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
5468#define __DADDR_T_TYPE __S32_TYPE
5569#define __KEY_T_TYPE __S32_TYPE
5670#define __CLOCKID_T_TYPE __S32_TYPE
......@@ -62,7 +76,7 @@
6276#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
6377#define __CPU_MASK_TYPE __ULONGWORD_TYPE
6478
65#ifdef __LP64__
79#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32)
6680/* Tell the libc code that off_t and off64_t are actually the same type
6781 for all ABI purposes, even if possibly expressed as different base types
6882 for C type-checking purposes. */
......@@ -76,11 +90,17 @@
7690
7791/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
7892# define __STATFS_MATCHES_STATFS64 1
93
94/* And for getitimer, setitimer and rusage */
95# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64)
7996#else
8097# define __RLIM_T_MATCHES_RLIM64_T 0
8198
8299# define __STATFS_MATCHES_STATFS64 0
100
101# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
83102#endif
103
84104/* Number of descriptors that can fit in an `fd_set'. */
85105#define __FD_SETSIZE 1024
86106
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.
22 This file is part of the GNU C Library.
33 Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
44
......@@ -25,11 +25,3 @@
2525#ifdef __NR_llseek
2626# define __NR__llseek __NR_llseek
2727#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 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number.
3 Copyright (C) 2006-2020 Free Software Foundation, Inc.
3 Copyright (C) 2006-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -18,11 +18,6 @@
1818 <https://www.gnu.org/licenses/>. */
1919
2020
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
2621#include_next <kernel-features.h>
2722
2823#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 */
2struct 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. */
33enum
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. */
43enum
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. */
65enum
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. */
77enum
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
103enum
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. */
133enum
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. */
143enum
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. */
153enum
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 */
167struct _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 */
176enum
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};
183enum
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. */
210extern 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.*/
219extern 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. */
227extern 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. */
232extern 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. */
240extern 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. */
248extern int pthread_detach (pthread_t __th) __THROW;
249
250
251/* Obtain the identifier of the current thread. */
252extern pthread_t pthread_self (void) __THROW __attribute__ ((__const__));
253
254/* Compare two thread identifiers. */
255extern 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). */
264extern int pthread_attr_init (pthread_attr_t *__attr) __THROW __nonnull ((1));
265
266/* Destroy thread attribute *ATTR. */
267extern int pthread_attr_destroy (pthread_attr_t *__attr)
268 __THROW __nonnull ((1));
269
270/* Get detach state attribute. */
271extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr,
272 int *__detachstate)
273 __THROW __nonnull ((1, 2));
274
275/* Set detach state attribute. */
276extern 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. */
282extern 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. */
287extern 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. */
293extern 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. */
298extern 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. */
303extern 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. */
308extern 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. */
312extern 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. */
317extern 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. */
323extern 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. */
328extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
329 __THROW __nonnull ((1));
330
331/* Return the previously set address for the stack. */
332extern 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. */
340extern 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. */
345extern 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. */
352extern 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. */
358extern 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. */
366extern 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. */
373extern 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. */
380extern 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. */
386extern 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. */
391extern 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. */
397extern 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. */
406extern 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. */
411extern 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. */
417extern 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. */
423extern 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. */
428extern 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. */
435extern int pthread_getconcurrency (void) __THROW;
436
437/* Set new concurrency level to LEVEL. */
438extern 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. */
446extern int pthread_yield (void) __THROW;
447
448
449/* Limit specified thread TH to run only on the processors represented
450 in CPUSET. */
451extern 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. */
456extern 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. */
471extern 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. */
483extern 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. */
487extern int pthread_setcanceltype (int __type, int *__oldtype);
488
489/* Cancel THREAD immediately or at the next possibility. */
490extern 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. */
495extern void pthread_testcancel (void);
496
497
498/* Cancellation handling with integration into exception handling. */
499
500typedef 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. */
517struct __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. */
528class __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 {
657extern 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)
669extern 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 {
692extern 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)
705extern void __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *__buf)
706 __cleanup_fct_attribute;
707# endif
708
709/* Internal interface to initiate cleanup. */
710extern 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. */
719struct __jmp_buf_tag;
720extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL;
721
722
723/* Mutex handling. */
724
725/* Initialize a mutex. */
726extern int pthread_mutex_init (pthread_mutex_t *__mutex,
727 const pthread_mutexattr_t *__mutexattr)
728 __THROW __nonnull ((1));
729
730/* Destroy a mutex. */
731extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
732 __THROW __nonnull ((1));
733
734/* Try locking a mutex. */
735extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
736 __THROWNL __nonnull ((1));
737
738/* Lock a mutex. */
739extern 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. */
744extern 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
750extern 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. */
757extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
758 __THROWNL __nonnull ((1));
759
760
761/* Get the priority ceiling of MUTEX. */
762extern 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. */
769extern 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. */
777extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
778 __THROW __nonnull ((1));
779# ifdef __USE_GNU
780extern 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). */
790extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
791 __THROW __nonnull ((1));
792
793/* Destroy mutex attribute object ATTR. */
794extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
795 __THROW __nonnull ((1));
796
797/* Get the process-shared flag of the mutex attribute ATTR. */
798extern 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. */
804extern 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. */
810extern 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). */
817extern 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. */
822extern 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). */
829extern 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. */
834extern 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. */
840extern 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. */
846extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr,
847 int *__robustness)
848 __THROW __nonnull ((1, 2));
849# ifdef __USE_GNU
850extern 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. */
856extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
857 int __robustness)
858 __THROW __nonnull ((1));
859# ifdef __USE_GNU
860extern 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. */
872extern 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. */
877extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
878 __THROW __nonnull ((1));
879
880/* Acquire read lock for RWLOCK. */
881extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
882 __THROWNL __nonnull ((1));
883
884/* Try to acquire read lock for RWLOCK. */
885extern 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. */
890extern 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
896extern 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. */
903extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
904 __THROWNL __nonnull ((1));
905
906/* Try to acquire write lock for RWLOCK. */
907extern 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. */
912extern 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
918extern 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. */
925extern 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. */
932extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
933 __THROW __nonnull ((1));
934
935/* Destroy attribute object ATTR. */
936extern 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. */
940extern 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. */
946extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
947 int __pshared)
948 __THROW __nonnull ((1));
949
950/* Return current setting of reader/writer preference. */
951extern 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. */
957extern 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. */
966extern 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. */
971extern int pthread_cond_destroy (pthread_cond_t *__cond)
972 __THROW __nonnull ((1));
973
974/* Wake up one thread waiting for condition variable COND. */
975extern int pthread_cond_signal (pthread_cond_t *__cond)
976 __THROWNL __nonnull ((1));
977
978/* Wake up all threads waiting for condition variables COND. */
979extern 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. */
987extern 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. */
998extern 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. */
1011extern 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. */
1021extern int pthread_condattr_init (pthread_condattr_t *__attr)
1022 __THROW __nonnull ((1));
1023
1024/* Destroy condition variable attribute ATTR. */
1025extern 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. */
1029extern 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. */
1035extern 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. */
1040extern 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. */
1046extern 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. */
1057extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
1058 __THROW __nonnull ((1));
1059
1060/* Destroy the spinlock LOCK. */
1061extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
1062 __THROW __nonnull ((1));
1063
1064/* Wait until spinlock LOCK is retrieved. */
1065extern int pthread_spin_lock (pthread_spinlock_t *__lock)
1066 __THROWNL __nonnull ((1));
1067
1068/* Try to lock spinlock LOCK. */
1069extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
1070 __THROWNL __nonnull ((1));
1071
1072/* Release spinlock LOCK. */
1073extern 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. */
1081extern 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. */
1087extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
1088 __THROW __nonnull ((1));
1089
1090/* Wait on barrier BARRIER. */
1091extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
1092 __THROWNL __nonnull ((1));
1093
1094
1095/* Initialize barrier attribute ATTR. */
1096extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
1097 __THROW __nonnull ((1));
1098
1099/* Destroy previously dynamically initialized barrier attribute ATTR. */
1100extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
1101 __THROW __nonnull ((1));
1102
1103/* Get the process-shared flag of the barrier attribute ATTR. */
1104extern 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. */
1110extern 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. */
1124extern int pthread_key_create (pthread_key_t *__key,
1125 void (*__destr_function) (void *))
1126 __THROW __nonnull ((1));
1127
1128/* Destroy KEY. */
1129extern int pthread_key_delete (pthread_key_t __key) __THROW;
1130
1131/* Return current value of the thread-specific data slot identified by KEY. */
1132extern void *pthread_getspecific (pthread_key_t __key) __THROW;
1133
1134/* Store POINTER in the thread-specific data slot identified by KEY. */
1135extern 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. */
1141extern 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
1158extern 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 @@
11/* Assembler macros for PA-RISC.
2 Copyright (C) 1999-2020 Free Software Foundation, Inc.
2 Copyright (C) 1999-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44 Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999.
55 Linux/PA-RISC changes by Philipp Rumpf, <prumpf@tux.org>, March 2000.
......@@ -28,6 +28,8 @@
2828/* Defines RTLD_PRIVATE_ERRNO. */
2929#include <dl-sysdep.h>
3030
31#include <tls.h>
32
3133/* In order to get __set_errno() definition in INLINE_SYSCALL. */
3234#ifndef __ASSEMBLER__
3335#include <errno.h>
......@@ -360,39 +362,9 @@ L(pre_end): ASM_LINE_SEP \
360362#define CALL_CLOB_REGS "%r1", "%r2", CLOB_TREG \
361363 "%r20", "%r29", "%r31"
362364
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
393365/* Similar to INLINE_SYSCALL but we don't set errno */
394366#undef INTERNAL_SYSCALL
395#define INTERNAL_SYSCALL(name, err, nr, args...) \
367#define INTERNAL_SYSCALL(name, nr, args...) \
396368({ \
397369 long __sys_res; \
398370 { \
......@@ -418,7 +390,7 @@ L(pre_end): ASM_LINE_SEP \
418390
419391/* The _NCS variant allows non-constant syscall numbers. */
420392#undef INTERNAL_SYSCALL_NCS
421#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
393#define INTERNAL_SYSCALL_NCS(name, nr, args...) \
422394({ \
423395 long __sys_res; \
424396 { \
lib/libc/glibc/sysdeps/unix/sysv/linux/i386/dl-sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. i386 version.
3 Copyright (C) 1999-2020 Free Software Foundation, Inc.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -23,8 +23,6 @@
2323# define __ASSUME_SOCKETPAIR_SYSCALL 1
2424# define __ASSUME_BIND_SYSCALL 1
2525# define __ASSUME_LISTEN_SYSCALL 1
26# define __ASSUME_GETSOCKOPT_SYSCALL 1
27# define __ASSUME_SETSOCKOPT_SYSCALL 1
2826# define __ASSUME_GETSOCKNAME_SYSCALL 1
2927# define __ASSUME_GETPEERNAME_SYSCALL 1
3028# define __ASSUME_SHUTDOWN_SYSCALL 1
......@@ -41,6 +39,8 @@
4139# undef __ASSUME_CONNECT_SYSCALL
4240# undef __ASSUME_RECVFROM_SYSCALL
4341# undef __ASSUME_SENDTO_SYSCALL
42# undef __ASSUME_GETSOCKOPT_SYSCALL
43# undef __ASSUME_SETSOCKOPT_SYSCALL
4444#endif
4545
4646/* 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.. */
2struct 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.
22 This file is part of the GNU C Library.
33 Contributed by Ulrich Drepper, <drepper@gnu.org>, August 1995.
44
......@@ -48,7 +48,7 @@
4848 to compile glibc. Disable GCC 5 optimization when compiling for
4949 profiling or when -fno-omit-frame-pointer is used since asm ("ebp")
5050 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
5252# define OPTIMIZE_FOR_GCC_5
5353#endif
5454
......@@ -67,6 +67,7 @@
6767
6868/* We don't want the label for the error handle to be global when we define
6969 it here. */
70#undef SYSCALL_ERROR_LABEL
7071#define SYSCALL_ERROR_LABEL __syscall_error
7172
7273#undef PSEUDO
......@@ -280,35 +281,6 @@ struct libc_do_syscall_args
280281};
281282#endif
282283
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
312284# define VDSO_NAME "LINUX_2.6"
313285# define VDSO_HASH 61765110
314286
......@@ -319,6 +291,11 @@ struct libc_do_syscall_args
319291# define HAVE_TIME_VSYSCALL "__vdso_time"
320292# define HAVE_CLOCK_GETRES_VSYSCALL "__vdso_clock_getres"
321293
294# define HAVE_CLONE3_WRAPPER 1
295
296# undef HAVE_INTERNAL_BRK_ADDR_SYMBOL
297# define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1
298
322299/* Define a macro which expands inline into the wrapper code for a system
323300 call. This use is for internal calls that do not need to handle errors
324301 normally. It will never touch errno. This returns just what the kernel
......@@ -327,25 +304,41 @@ struct libc_do_syscall_args
327304 The _NCS variant allows non-constant syscall numbers but it is not
328305 possible to use more than four parameters. */
329306#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
342333/* Each object using 6-argument inline syscalls must include a
343334 definition of __libc_do_syscall. */
344335#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)
347340#else /* GCC 5 */
348# define INTERNAL_SYSCALL_MAIN_6(name, err, arg1, arg2, arg3, \
341# define INTERNAL_SYSCALL_MAIN_6(name, arg1, arg2, arg3, \
349342 arg4, arg5, arg6) \
350343 struct libc_do_syscall_args _xv = \
351344 { \
......@@ -359,52 +352,67 @@ struct libc_do_syscall_args
359352 : "=a" (resultvar) \
360353 : "i" (__NR_##name), "c" (arg2), "d" (arg3), "S" (arg4), "D" (&_xv) \
361354 : "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")
362369#endif /* GCC 5 */
363#define INTERNAL_SYSCALL(name, err, nr, args...) \
370
371#define INTERNAL_SYSCALL(name, nr, args...) \
364372 ({ \
365373 register unsigned int resultvar; \
366 INTERNAL_SYSCALL_MAIN_##nr (name, err, args); \
374 INTERNAL_SYSCALL_MAIN_##nr (name, args); \
367375 (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
368382#if I386_USE_SYSENTER
369383# ifdef OPTIMIZE_FOR_GCC_5
370384# ifdef PIC
371# define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \
385# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
372386 LOADREGS_##nr(args) \
373387 asm volatile ( \
374388 "call *%%gs:%P2" \
375389 : "=a" (resultvar) \
376390 : "a" (__NR_##name), "i" (offsetof (tcbhead_t, sysinfo)) \
377391 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...) \
381393 LOADREGS_##nr(args) \
382394 asm volatile ( \
383395 "call *%%gs:%P2" \
384396 : "=a" (resultvar) \
385397 : "a" (name), "i" (offsetof (tcbhead_t, sysinfo)) \
386 ASMARGS_##nr(args) : "memory", "cc"); \
387 (int) resultvar; })
398 ASMARGS_##nr(args) : "memory", "cc")
388399# else
389# define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \
400# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
390401 LOADREGS_##nr(args) \
391402 asm volatile ( \
392403 "call *_dl_sysinfo" \
393404 : "=a" (resultvar) \
394405 : "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...) \
398407 LOADREGS_##nr(args) \
399408 asm volatile ( \
400409 "call *_dl_sysinfo" \
401410 : "=a" (resultvar) \
402 : "a" (name) ASMARGS_##nr(args) : "memory", "cc"); \
403 (int) resultvar; })
411 : "a" (name) ASMARGS_##nr(args) : "memory", "cc")
404412# endif
405413# else /* GCC 5 */
406414# ifdef PIC
407# define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \
415# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
408416 EXTRAVAR_##nr \
409417 asm volatile ( \
410418 LOADARGS_##nr \
......@@ -414,9 +422,7 @@ struct libc_do_syscall_args
414422 : "=a" (resultvar) \
415423 : "i" (__NR_##name), "i" (offsetof (tcbhead_t, sysinfo)) \
416424 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...) \
420426 EXTRAVAR_##nr \
421427 asm volatile ( \
422428 LOADARGS_##nr \
......@@ -424,10 +430,9 @@ struct libc_do_syscall_args
424430 RESTOREARGS_##nr \
425431 : "=a" (resultvar) \
426432 : "0" (name), "i" (offsetof (tcbhead_t, sysinfo)) \
427 ASMFMT_##nr(args) : "memory", "cc"); \
428 (int) resultvar; })
433 ASMFMT_##nr(args) : "memory", "cc")
429434# else
430# define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \
435# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
431436 EXTRAVAR_##nr \
432437 asm volatile ( \
433438 LOADARGS_##nr \
......@@ -436,38 +441,32 @@ struct libc_do_syscall_args
436441 RESTOREARGS_##nr \
437442 : "=a" (resultvar) \
438443 : "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...) \
442445 EXTRAVAR_##nr \
443446 asm volatile ( \
444447 LOADARGS_##nr \
445448 "call *_dl_sysinfo\n\t" \
446449 RESTOREARGS_##nr \
447450 : "=a" (resultvar) \
448 : "0" (name) ASMFMT_##nr(args) : "memory", "cc"); \
449 (int) resultvar; })
451 : "0" (name) ASMFMT_##nr(args) : "memory", "cc")
450452# endif
451453# endif /* GCC 5 */
452454#else
453455# ifdef OPTIMIZE_FOR_GCC_5
454# define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \
456# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
455457 LOADREGS_##nr(args) \
456458 asm volatile ( \
457459 "int $0x80" \
458460 : "=a" (resultvar) \
459461 : "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...) \
463463 LOADREGS_##nr(args) \
464464 asm volatile ( \
465465 "int $0x80" \
466466 : "=a" (resultvar) \
467 : "a" (name) ASMARGS_##nr(args) : "memory", "cc"); \
468 (int) resultvar; })
467 : "a" (name) ASMARGS_##nr(args) : "memory", "cc")
469468# else /* GCC 5 */
470# define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \
469# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
471470 EXTRAVAR_##nr \
472471 asm volatile ( \
473472 LOADARGS_##nr \
......@@ -476,30 +475,17 @@ struct libc_do_syscall_args
476475 RESTOREARGS_##nr \
477476 : "=a" (resultvar) \
478477 : "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...) \
482479 EXTRAVAR_##nr \
483480 asm volatile ( \
484481 LOADARGS_##nr \
485482 "int $0x80\n\t" \
486483 RESTOREARGS_##nr \
487484 : "=a" (resultvar) \
488 : "0" (name) ASMFMT_##nr(args) : "memory", "cc"); \
489 (int) resultvar; })
485 : "0" (name) ASMFMT_##nr(args) : "memory", "cc")
490486# endif /* GCC 5 */
491487#endif
492488
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
503489#define LOADARGS_0
504490#ifdef __PIC__
505491# if I386_USE_SYSENTER && defined PIC
......@@ -618,20 +604,6 @@ struct libc_do_syscall_args
618604# define EXTRAVAR_5
619605#endif
620606
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
635607#endif /* __ASSEMBLER__ */
636608
637609
......@@ -662,4 +634,9 @@ struct libc_do_syscall_args
662634# endif
663635#endif
664636
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
665642#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
33struct 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. */
72struct 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number.
3 Copyright (C) 2010-2020 Free Software Foundation, Inc.
3 Copyright (C) 2010-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 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.
22 This file is part of the GNU C Library.
33 Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
44 Based on code originally written by David Mosberger-Tang
......@@ -46,12 +46,6 @@
4646#undef SYS_ify
4747#define SYS_ify(syscall_name) __NR_##syscall_name
4848
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
5549#if defined USE_DL_SYSINFO \
5650 && (IS_IN (libc) \
5751 || IS_IN (libpthread) || IS_IN (librt))
......@@ -95,6 +89,7 @@
9589
9690/* We don't want the label for the error handler to be visible in the symbol
9791 table when we define it here. */
92#undef SYSCALL_ERROR_LABEL
9893#define SYSCALL_ERROR_LABEL __syscall_error
9994
10095#undef PSEUDO
......@@ -177,6 +172,9 @@
177172
178173#else /* not __ASSEMBLER__ */
179174
175#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL
176#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1
177
180178#define BREAK_INSN_1(num) "break " #num ";;\n\t"
181179#define BREAK_INSN(num) BREAK_INSN_1(num)
182180
......@@ -191,13 +189,13 @@
191189
192190#ifdef IA64_USE_NEW_STUB
193191
194# define DO_INLINE_SYSCALL_NCS(name, nr, args...) \
192# define INTERNAL_SYSCALL_NCS(name, nr, args...) \
193({ \
195194 LOAD_ARGS_##nr (args) \
196195 register long _r8 __asm ("r8"); \
197196 register long _r10 __asm ("r10"); \
198197 register long _r15 __asm ("r15") = name; \
199198 register void *_b7 __asm ("b7") = ((tcbhead_t *)__thread_self)->__private;\
200 long _retval; \
201199 LOAD_REGS_##nr \
202200 /* \
203201 * Don't specify any unwind info here. We mark ar.pfs as \
......@@ -209,60 +207,30 @@
209207 ASM_OUTARGS_##nr \
210208 : "0" (_b7), "3" (_r15) ASM_ARGS_##nr \
211209 : "memory", "ar.pfs" ASM_CLOBBERS_##nr); \
212 _retval = _r8;
210 _r10 == -1 ? -_r8 : _r8; \
211})
213212
214213#else /* !IA64_USE_NEW_STUB */
215214
216# define DO_INLINE_SYSCALL_NCS(name, nr, args...) \
215# define INTERNAL_SYSCALL_NCS(name, nr, args...) \
216({ \
217217 LOAD_ARGS_##nr (args) \
218218 register long _r8 asm ("r8"); \
219219 register long _r10 asm ("r10"); \
220220 register long _r15 asm ("r15") = name; \
221 long _retval; \
222221 LOAD_REGS_##nr \
223222 __asm __volatile (BREAK_INSN (__IA64_BREAK_SYSCALL) \
224223 : "=r" (_r8), "=r" (_r10), "=r" (_r15) \
225224 ASM_OUTARGS_##nr \
226225 : "2" (_r15) ASM_ARGS_##nr \
227226 : "memory" ASM_CLOBBERS_##nr); \
228 _retval = _r8;
227 _r10 == -1 ? -_r8 : _r8; \
228})
229229
230230#endif /* !IA64_USE_NEW_STUB */
231231
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)
266234
267235#define LOAD_ARGS_0()
268236#define LOAD_REGS_0
lib/libc/glibc/sysdeps/unix/sysv/linux/include/sys/timex.h+172-1
......@@ -1,5 +1,5 @@
11/* Internal declarations for sys/timex.h.
2 Copyright (C) 2014-2020 Free Software Foundation, Inc.
2 Copyright (C) 2014-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -23,7 +23,178 @@
2323
2424# ifndef _ISOMAC
2525
26extern int __adjtimex (struct timex *__ntx);
2627libc_hidden_proto (__adjtimex)
2728
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
41struct __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};
80extern int __clock_adjtime64 (const clockid_t clock_id, struct __timex64 *tx64);
81libc_hidden_proto (__clock_adjtime64);
82extern int ___adjtimex64 (struct __timex64 *tx64);
83libc_hidden_proto (___adjtimex64)
84
85struct __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};
97extern int __ntp_gettime64 (struct __ntptimeval64 *ntv);
98libc_hidden_proto (__ntp_gettime64)
99extern int __ntp_gettimex64 (struct __ntptimeval64 *ntv);
100libc_hidden_proto (__ntp_gettimex64)
101
102# endif
103
104/* Convert a known valid struct timex into a struct __timex64. */
105static inline struct __timex64
106valid_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. */
135static inline struct timex
136valid_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. */
165static inline struct __ntptimeval64
166valid_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. */
183static inline struct ntptimeval
184valid_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}
28199# endif /* _ISOMAC */
29200#endif /* sys/timex.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h+11-5
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number.
3 Copyright (C) 1999-2020 Free Software Foundation, Inc.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -49,10 +49,6 @@
4949 SH this appeared first in 2.6.19-rc1, on ia64 in 2.6.22-rc1. */
5050#define __ASSUME_PSELECT 1
5151
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
5652/* Support for inter-process robust mutexes was added in 2.6.17 (but
5753 some architectures lack futex_atomic_cmpxchg_inatomic in some
5854 configurations). */
......@@ -81,6 +77,8 @@
8177#define __ASSUME_ACCEPT4_SYSCALL 1
8278#define __ASSUME_RECVMMSG_SYSCALL 1
8379#define __ASSUME_SENDMMSG_SYSCALL 1
80#define __ASSUME_GETSOCKOPT_SYSCALL 1
81#define __ASSUME_SETSOCKOPT_SYSCALL 1
8482
8583/* Support for SysV IPC through wired syscalls. All supported architectures
8684 either support ipc syscall and/or all the ipc correspondent syscalls. */
......@@ -214,4 +212,12 @@
214212# define __ASSUME_WAITID_PID0_P_PGID
215213#endif
216214
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
217223#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
24int
25__lstat (const char *file, struct stat *buf)
26{
27 return __fstatat (AT_FDCWD, file, buf, AT_SYMLINK_NOFOLLOW);
28}
29
30weak_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
26int
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
32hidden_def (__lstat64_time64)
33
34int
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
42hidden_def (__lstat64)
43weak_alias (__lstat64, lstat64)
44
45#undef __lstat
46#undef lstat
47
48#if XSTAT_IS_XSTAT64
49strong_alias (__lstat64, __lstat)
50weak_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
38struct 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
95struct 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.
22 This file is part of the GNU C Library.
33
44 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 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number.
3 Copyright (C) 2008-2020 Free Software Foundation, Inc.
3 Copyright (C) 2008-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -23,8 +23,6 @@
2323# define __ASSUME_SOCKETPAIR_SYSCALL 1
2424# define __ASSUME_BIND_SYSCALL 1
2525# define __ASSUME_LISTEN_SYSCALL 1
26# define __ASSUME_GETSOCKOPT_SYSCALL 1
27# define __ASSUME_SETSOCKOPT_SYSCALL 1
2826# define __ASSUME_GETSOCKNAME_SYSCALL 1
2927# define __ASSUME_GETPEERNAME_SYSCALL 1
3028# define __ASSUME_SHUTDOWN_SYSCALL 1
......@@ -43,6 +41,8 @@
4341# undef __ASSUME_CONNECT_SYSCALL
4442# undef __ASSUME_RECVFROM_SYSCALL
4543# undef __ASSUME_SENDTO_SYSCALL
44# undef __ASSUME_GETSOCKOPT_SYSCALL
45# undef __ASSUME_SETSOCKOPT_SYSCALL
4646#endif
4747
4848/* 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.. */
2struct 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.
22 This file is part of the GNU C Library.
33
44 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.
22 This file is part of the GNU C Library.
33 Written by Andreas Schwab, <schwab@issan.informatik.uni-dortmund.de>,
44 December 1995.
......@@ -44,6 +44,7 @@
4444
4545/* We don't want the label for the error handler to be visible in the symbol
4646 table when we define it here. */
47#undef SYSCALL_ERROR_LABEL
4748#ifdef PIC
4849#define SYSCALL_ERROR_LABEL .Lsyscall_error
4950#else
......@@ -221,27 +222,12 @@ SYSCALL_ERROR_LABEL: \
221222
222223#else /* not __ASSEMBLER__ */
223224
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
239225/* Define a macro which expands inline into the wrapper code for a system
240226 call. This use is for internal calls that do not need to handle errors
241227 normally. It will never touch errno. This returns just what the kernel
242228 gave back. */
243229#undef INTERNAL_SYSCALL
244#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
230#define INTERNAL_SYSCALL_NCS(name, nr, args...) \
245231 ({ unsigned int _sys_result; \
246232 { \
247233 /* Load argument values in temporary variables
......@@ -257,15 +243,8 @@ SYSCALL_ERROR_LABEL: \
257243 _sys_result = _d0; \
258244 } \
259245 (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)
269248
270249#define LOAD_ARGS_0()
271250#define LOAD_REGS_0
......@@ -313,6 +292,9 @@ SYSCALL_ERROR_LABEL: \
313292 LOAD_REGS_5
314293#define ASM_ARGS_6 ASM_ARGS_5, "a" (_a0)
315294
295#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL
296#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1
297
316298#endif /* not __ASSEMBLER__ */
317299
318300/* 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
39struct 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. */
83struct 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
124struct 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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -28,8 +28,6 @@
2828#define __ASSUME_SEND_SYSCALL 1
2929#define __ASSUME_RECV_SYSCALL 1
3030#define __ASSUME_SHUTDOWN_SYSCALL 1
31#define __ASSUME_GETSOCKOPT_SYSCALL 1
32#define __ASSUME_SETSOCKOPT_SYSCALL 1
3331
3432#include_next <kernel-features.h>
3533
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
20struct 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.
22
33 This file is part of the GNU C Library.
44
......@@ -26,6 +26,8 @@
2626/* Defines RTLD_PRIVATE_ERRNO. */
2727#include <dl-sysdep.h>
2828
29#include <tls.h>
30
2931/* In order to get __set_errno() definition in INLINE_SYSCALL. */
3032#ifndef __ASSEMBLER__
3133# include <errno.h>
......@@ -60,6 +62,7 @@
6062
6163/* We don't want the label for the error handler to be visible in the symbol
6264 table when we define it here. */
65# undef SYSCALL_ERROR_LABEL
6366# ifdef PIC
6467# define SYSCALL_ERROR_LABEL 0f
6568# else
......@@ -163,42 +166,18 @@ SYSCALL_ERROR_LABEL_DCL: \
163166
164167#else /* not __ASSEMBLER__ */
165168
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
183169/* Define a macro which expands inline into the wrapper code for a system
184170 call. This use is for internal calls that do not need to handle errors
185171 normally. It will never touch errno. This returns just what the kernel
186172 gave back. */
187173# undef INTERNAL_SYSCALL
188# define INTERNAL_SYSCALL(name, err, nr, args...) \
174# define INTERNAL_SYSCALL(name, nr, args...) \
189175 inline_syscall##nr(SYS_ify(name), args)
190176
191177# undef INTERNAL_SYSCALL_NCS
192# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
178# define INTERNAL_SYSCALL_NCS(name, nr, args...) \
193179 inline_syscall##nr(name, args)
194180
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
202181# define SYSCALL_CLOBBERS_6 "r11", "r4", "memory"
203182# define SYSCALL_CLOBBERS_5 "r10", SYSCALL_CLOBBERS_6
204183# define SYSCALL_CLOBBERS_4 "r9", SYSCALL_CLOBBERS_5
......@@ -209,8 +188,8 @@ SYSCALL_ERROR_LABEL_DCL: \
209188
210189# define inline_syscall0(name,dummy) \
211190 ({ \
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; \
214193 __asm__ __volatile__( "brki r14,8; nop;" \
215194 : "=r"(__ret) \
216195 : "r"(__r12) \
......@@ -219,9 +198,10 @@ SYSCALL_ERROR_LABEL_DCL: \
219198
220199# define inline_syscall1(name,arg1) \
221200 ({ \
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; \
225205 __asm__ __volatile__( "brki r14,8; nop;" \
226206 : "=r"(__ret) \
227207 : "r"(__r5), "r"(__r12) \
......@@ -230,10 +210,12 @@ SYSCALL_ERROR_LABEL_DCL: \
230210
231211# define inline_syscall2(name,arg1,arg2) \
232212 ({ \
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; \
237219 __asm__ __volatile__( "brki r14,8; nop;" \
238220 : "=r"(__ret) \
239221 : "r"(__r5), "r"(__r6), "r"(__r12) \
......@@ -243,11 +225,14 @@ SYSCALL_ERROR_LABEL_DCL: \
243225
244226# define inline_syscall3(name,arg1,arg2,arg3) \
245227 ({ \
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; \
251236 __asm__ __volatile__( "brki r14,8; nop;" \
252237 : "=r"(__ret) \
253238 : "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r12) \
......@@ -257,12 +242,16 @@ SYSCALL_ERROR_LABEL_DCL: \
257242
258243# define inline_syscall4(name,arg1,arg2,arg3,arg4) \
259244 ({ \
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; \
266255 __asm__ __volatile__( "brki r14,8; nop;" \
267256 : "=r"(__ret) \
268257 : "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r8),"r"(__r12) \
......@@ -272,13 +261,18 @@ SYSCALL_ERROR_LABEL_DCL: \
272261
273262# define inline_syscall5(name,arg1,arg2,arg3,arg4,arg5) \
274263 ({ \
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; \
282276 __asm__ __volatile__( "brki r14,8; nop;" \
283277 : "=r"(__ret) \
284278 : "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r8),"r"(__r9), "r"(__r12) \
......@@ -288,14 +282,20 @@ SYSCALL_ERROR_LABEL_DCL: \
288282
289283# define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6) \
290284 ({ \
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; \
299299 __asm__ __volatile__( "brki r14,8; nop;" \
300300 : "=r"(__ret) \
301301 : "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r8),"r"(__r9), "r"(__r10), \
......@@ -310,6 +310,9 @@ SYSCALL_ERROR_LABEL_DCL: \
310310
311311# define SINGLE_THREAD_BY_GLOBAL 1
312312
313#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL
314#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1
315
313316#endif /* not __ASSEMBLER__ */
314317
315318#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. */
42struct 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
97struct 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
134struct 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
188struct 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 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number.
3 Copyright (C) 1999-2020 Free Software Foundation, Inc.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 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
10struct 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
33struct 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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -25,11 +25,6 @@
2525
2626#include <tls.h>
2727
28/* In order to get __set_errno() definition in INLINE_SYSCALL. */
29#ifndef __ASSEMBLER__
30#include <errno.h>
31#endif
32
3328/* For Linux we can use the system call table in the header file
3429 /usr/include/asm/unistd.h
3530 of the kernel. But these symbols do not follow the SYS_* syntax
......@@ -42,32 +37,14 @@
4237/* We don't want the label for the error handler to be visible in the symbol
4338 table when we define it here. */
4439#ifdef __PIC__
40# undef SYSCALL_ERROR_LABEL
4541# define SYSCALL_ERROR_LABEL 99b
4642#endif
4743
4844#else /* ! __ASSEMBLER__ */
4945
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
7148
7249/* Note that the original Linux syscall restart convention required the
7350 instruction immediately preceding SYSCALL to initialize $v0 with the
......@@ -103,11 +80,11 @@
10380
10481union __mips_syscall_return
10582 {
106 long long val;
83 long long int val;
10784 struct
10885 {
109 long v0;
110 long v1;
86 long int v0;
87 long int v1;
11188 }
11289 reg;
11390 };
......@@ -121,14 +98,13 @@ union __mips_syscall_return
12198
12299# include <mips16-syscall.h>
123100
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)
126103
127# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
104# define INTERNAL_SYSCALL_NCS(number, nr, args...) \
128105({ \
129106 union __mips_syscall_return _sc_ret; \
130107 _sc_ret.val = __mips16_syscall##nr (args, number); \
131 err = _sc_ret.reg.v1; \
132108 _sc_ret.reg.v0; \
133109})
134110
......@@ -138,12 +114,12 @@ union __mips_syscall_return
138114 number, err, args)
139115
140116#else /* !__mips16 */
141# define INTERNAL_SYSCALL(name, err, nr, args...) \
117# define INTERNAL_SYSCALL(name, nr, args...) \
142118 internal_syscall##nr ("li\t%0, %2\t\t\t# " #name "\n\t", \
143119 "IK" (SYS_ify (name)), \
144120 SYS_ify (name), err, args)
145121
146# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
122# define INTERNAL_SYSCALL_NCS(number, nr, args...) \
147123 internal_syscall##nr (MOVE32 "\t%0, %2\n\t", \
148124 "r" (__s0), \
149125 number, err, args)
......@@ -152,13 +128,13 @@ union __mips_syscall_return
152128
153129#define internal_syscall0(v0_init, input, number, err, dummy...) \
154130({ \
155 long _sys_result; \
131 long int _sys_result; \
156132 \
157133 { \
158 register long __s0 asm ("$16") __attribute__ ((unused)) \
134 register long int __s0 asm ("$16") __attribute__ ((unused)) \
159135 = (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"); \
162138 __asm__ volatile ( \
163139 ".set\tnoreorder\n\t" \
164140 v0_init \
......@@ -167,22 +143,22 @@ union __mips_syscall_return
167143 : "=r" (__v0), "=r" (__a3) \
168144 : input \
169145 : __SYSCALL_CLOBBERS); \
170 err = __a3; \
171 _sys_result = __v0; \
146 _sys_result = __a3 != 0 ? -__v0 : __v0; \
172147 } \
173148 _sys_result; \
174149})
175150
176151#define internal_syscall1(v0_init, input, number, err, arg1) \
177152({ \
178 long _sys_result; \
153 long int _sys_result; \
179154 \
180155 { \
181 register long __s0 asm ("$16") __attribute__ ((unused)) \
156 long int _arg1 = (long int) (arg1); \
157 register long int __s0 asm ("$16") __attribute__ ((unused)) \
182158 = (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"); \
186162 __asm__ volatile ( \
187163 ".set\tnoreorder\n\t" \
188164 v0_init \
......@@ -191,23 +167,24 @@ union __mips_syscall_return
191167 : "=r" (__v0), "=r" (__a3) \
192168 : input, "r" (__a0) \
193169 : __SYSCALL_CLOBBERS); \
194 err = __a3; \
195 _sys_result = __v0; \
170 _sys_result = __a3 != 0 ? -__v0 : __v0; \
196171 } \
197172 _sys_result; \
198173})
199174
200175#define internal_syscall2(v0_init, input, number, err, arg1, arg2) \
201176({ \
202 long _sys_result; \
177 long int _sys_result; \
203178 \
204179 { \
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)) \
206183 = (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"); \
211188 __asm__ volatile ( \
212189 ".set\tnoreorder\n\t" \
213190 v0_init \
......@@ -216,8 +193,7 @@ union __mips_syscall_return
216193 : "=r" (__v0), "=r" (__a3) \
217194 : input, "r" (__a0), "r" (__a1) \
218195 : __SYSCALL_CLOBBERS); \
219 err = __a3; \
220 _sys_result = __v0; \
196 _sys_result = __a3 != 0 ? -__v0 : __v0; \
221197 } \
222198 _sys_result; \
223199})
......@@ -225,16 +201,19 @@ union __mips_syscall_return
225201#define internal_syscall3(v0_init, input, number, err, \
226202 arg1, arg2, arg3) \
227203({ \
228 long _sys_result; \
204 long int _sys_result; \
229205 \
230206 { \
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)) \
232211 = (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"); \
238217 __asm__ volatile ( \
239218 ".set\tnoreorder\n\t" \
240219 v0_init \
......@@ -243,8 +222,7 @@ union __mips_syscall_return
243222 : "=r" (__v0), "=r" (__a3) \
244223 : input, "r" (__a0), "r" (__a1), "r" (__a2) \
245224 : __SYSCALL_CLOBBERS); \
246 err = __a3; \
247 _sys_result = __v0; \
225 _sys_result = __a3 != 0 ? -__v0 : __v0; \
248226 } \
249227 _sys_result; \
250228})
......@@ -252,16 +230,20 @@ union __mips_syscall_return
252230#define internal_syscall4(v0_init, input, number, err, \
253231 arg1, arg2, arg3, arg4) \
254232({ \
255 long _sys_result; \
233 long int _sys_result; \
256234 \
257235 { \
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)) \
259241 = (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; \
265247 __asm__ volatile ( \
266248 ".set\tnoreorder\n\t" \
267249 v0_init \
......@@ -270,8 +252,7 @@ union __mips_syscall_return
270252 : "=r" (__v0), "+r" (__a3) \
271253 : input, "r" (__a0), "r" (__a1), "r" (__a2) \
272254 : __SYSCALL_CLOBBERS); \
273 err = __a3; \
274 _sys_result = __v0; \
255 _sys_result = __a3 != 0 ? -__v0 : __v0; \
275256 } \
276257 _sys_result; \
277258})
......@@ -285,65 +266,65 @@ union __mips_syscall_return
285266 compiler specifics required for the stack arguments to be pushed,
286267 which would be the case if these syscalls were inlined. */
287268
288long long __nomips16 __mips_syscall5 (long arg1, long arg2, long arg3,
289 long arg4, long arg5,
290 long number);
269long 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);
291273libc_hidden_proto (__mips_syscall5, nomips16)
292274
293275#define internal_syscall5(v0_init, input, number, err, \
294276 arg1, arg2, arg3, arg4, arg5) \
295277({ \
296278 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; \
305286})
306287
307long long __nomips16 __mips_syscall6 (long arg1, long arg2, long arg3,
308 long arg4, long arg5, long arg6,
309 long number);
288long 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);
310292libc_hidden_proto (__mips_syscall6, nomips16)
311293
312294#define internal_syscall6(v0_init, input, number, err, \
313295 arg1, arg2, arg3, arg4, arg5, arg6) \
314296({ \
315297 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; \
325306})
326307
327long long __nomips16 __mips_syscall7 (long arg1, long arg2, long arg3,
328 long arg4, long arg5, long arg6,
329 long arg7,
330 long number);
308long 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);
331313libc_hidden_proto (__mips_syscall7, nomips16)
332314
333315#define internal_syscall7(v0_init, input, number, err, \
334316 arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
335317({ \
336318 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; \
347328})
348329
349330#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
22static 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
54static 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))
51typedef long long int __syscall_arg_t;
52#else
53# define ARGIFY(X) ((long int) (X))
54typedef 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
25int
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}
36libc_hidden_def (__mknodat)
37weak_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; \
791: \
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; \
971: \
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
46struct 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
100struct 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
141struct 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
194struct 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 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. PowerPC version.
3 Copyright (C) 1999-2020 Free Software Foundation, Inc.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -28,8 +28,6 @@
2828#define __ASSUME_SEND_SYSCALL 1
2929#define __ASSUME_RECV_SYSCALL 1
3030#define __ASSUME_SHUTDOWN_SYSCALL 1
31#define __ASSUME_GETSOCKOPT_SYSCALL 1
32#define __ASSUME_SETSOCKOPT_SYSCALL 1
3331
3432/* Define this if your 32-bit syscall API requires 64-bit register
3533 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
19struct 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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -17,202 +17,10 @@
1717
1818/* Alan Modra <amodra@bigpond.net.au> rewrote the INLINE_SYSCALL macro */
1919
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
2222
2323#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
21624
21725/* In the PowerPC64 ABI, the unadorned F_GETLK* opcodes should be used
21826 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 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. RISC-V version.
3 Copyright (C) 2018-2020 Free Software Foundation, Inc.
3 Copyright (C) 2018-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 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 @@
2222#include <sysdeps/unix/sysv/linux/generic/sysdep.h>
2323#include <tls.h>
2424
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
2551#ifdef __ASSEMBLER__
2652
2753# include <sys/asm.h>
......@@ -107,56 +133,38 @@
107133# undef ret_ERRVAL
108134# define ret_ERRVAL ret
109135
110#endif /* __ASSEMBLER__ */
136#else /* !__ASSEMBLER__ */
111137
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
116141
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
123150
124# define VDSO_NAME "LINUX_4.15"
125# define VDSO_HASH 182943605
151/* RV32 does not support the gettime VDSO syscalls. */
152# endif
126153
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). */
131156# define HAVE_GETCPU_VSYSCALL "__vdso_getcpu"
132157
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
152160
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)
155163
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)
158166
159# define internal_syscall0(number, err, dummy...) \
167# define internal_syscall0(number, dummy...) \
160168({ \
161169 long int _sys_result; \
162170 \
......@@ -173,13 +181,14 @@
173181 _sys_result; \
174182})
175183
176# define internal_syscall1(number, err, arg0) \
184# define internal_syscall1(number, arg0) \
177185({ \
178186 long int _sys_result; \
187 long int _arg0 = (long int) (arg0); \
179188 \
180189 { \
181190 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; \
183192 __asm__ volatile ( \
184193 "scall\n\t" \
185194 : "+r" (__a0) \
......@@ -190,14 +199,16 @@
190199 _sys_result; \
191200})
192201
193# define internal_syscall2(number, err, arg0, arg1) \
202# define internal_syscall2(number, arg0, arg1) \
194203({ \
195204 long int _sys_result; \
205 long int _arg0 = (long int) (arg0); \
206 long int _arg1 = (long int) (arg1); \
196207 \
197208 { \
198209 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; \
201212 __asm__ volatile ( \
202213 "scall\n\t" \
203214 : "+r" (__a0) \
......@@ -208,15 +219,18 @@
208219 _sys_result; \
209220})
210221
211# define internal_syscall3(number, err, arg0, arg1, arg2) \
222# define internal_syscall3(number, arg0, arg1, arg2) \
212223({ \
213224 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); \
214228 \
215229 { \
216230 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; \
220234 __asm__ volatile ( \
221235 "scall\n\t" \
222236 : "+r" (__a0) \
......@@ -227,16 +241,20 @@
227241 _sys_result; \
228242})
229243
230# define internal_syscall4(number, err, arg0, arg1, arg2, arg3) \
244# define internal_syscall4(number, arg0, arg1, arg2, arg3) \
231245({ \
232246 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); \
233251 \
234252 { \
235253 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; \
240258 __asm__ volatile ( \
241259 "scall\n\t" \
242260 : "+r" (__a0) \
......@@ -247,17 +265,22 @@
247265 _sys_result; \
248266})
249267
250# define internal_syscall5(number, err, arg0, arg1, arg2, arg3, arg4) \
268# define internal_syscall5(number, arg0, arg1, arg2, arg3, arg4) \
251269({ \
252270 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); \
253276 \
254277 { \
255278 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; \
261284 __asm__ volatile ( \
262285 "scall\n\t" \
263286 : "+r" (__a0) \
......@@ -268,18 +291,24 @@
268291 _sys_result; \
269292})
270293
271# define internal_syscall6(number, err, arg0, arg1, arg2, arg3, arg4, arg5) \
294# define internal_syscall6(number, arg0, arg1, arg2, arg3, arg4, arg5) \
272295({ \
273296 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); \
274303 \
275304 { \
276305 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; \
283312 __asm__ volatile ( \
284313 "scall\n\t" \
285314 : "+r" (__a0) \
......@@ -291,19 +320,26 @@
291320 _sys_result; \
292321})
293322
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) \
295324({ \
296325 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); \
297333 \
298334 { \
299335 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; \
307343 __asm__ volatile ( \
308344 "scall\n\t" \
309345 : "+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
50struct 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
87struct 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. */
147struct 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
184struct 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -50,6 +50,7 @@
5050#define __TIME_T_TYPE __SLONGWORD_TYPE
5151#define __USECONDS_T_TYPE __U32_TYPE
5252#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
53#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
5354#define __DADDR_T_TYPE __S32_TYPE
5455#define __KEY_T_TYPE __S32_TYPE
5556#define __CLOCKID_T_TYPE __S32_TYPE
......@@ -81,10 +82,16 @@
8182
8283/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
8384# define __STATFS_MATCHES_STATFS64 1
85
86/* And for getitimer, setitimer and rusage */
87# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
8488#else
8589# define __RLIM_T_MATCHES_RLIM64_T 0
8690
8791# define __STATFS_MATCHES_STATFS64 0
92
93/* And for getitimer, setitimer and rusage */
94# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
8895#endif
8996
9097/* 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 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. S/390 version.
3 Copyright (C) 1999-2020 Free Software Foundation, Inc.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -23,8 +23,6 @@
2323# define __ASSUME_SOCKETPAIR_SYSCALL 1
2424# define __ASSUME_BIND_SYSCALL 1
2525# define __ASSUME_LISTEN_SYSCALL 1
26# define __ASSUME_GETSOCKOPT_SYSCALL 1
27# define __ASSUME_SETSOCKOPT_SYSCALL 1
2826# define __ASSUME_GETSOCKNAME_SYSCALL 1
2927# define __ASSUME_GETPEERNAME_SYSCALL 1
3028# define __ASSUME_SHUTDOWN_SYSCALL 1
......@@ -43,6 +41,8 @@
4341# undef __ASSUME_CONNECT_SYSCALL
4442# undef __ASSUME_RECVFROM_SYSCALL
4543# undef __ASSUME_SENDTO_SYSCALL
44# undef __ASSUME_GETSOCKOPT_SYSCALL
45# undef __ASSUME_SETSOCKOPT_SYSCALL
4646#endif
4747
4848/* 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.. */
2struct 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.
22 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
33 This file is part of the GNU C Library.
44
......@@ -26,11 +26,6 @@
2626#include <dl-sysdep.h> /* For RTLD_PRIVATE_ERRNO. */
2727#include <tls.h>
2828
29/* Define __set_errno() for INLINE_SYSCALL macro below. */
30#ifndef __ASSEMBLER__
31#include <errno.h>
32#endif
33
3429/* For Linux we can use the system call table in the header file
3530 /usr/include/asm/unistd.h
3631 of the kernel. But these symbols do not follow the SYS_* syntax
......@@ -38,9 +33,6 @@
3833/* in newer 2.1 kernels __NR_syscall is missing so we define it here */
3934#define __NR_syscall 0
4035
41#undef SYS_ify
42#define SYS_ify(syscall_name) __NR_##syscall_name
43
4436#ifdef __ASSEMBLER__
4537
4638/* Linux uses a negative return value to indicate syscall errors, unlike
......@@ -88,7 +80,9 @@
8880#define PSEUDO_END_ERRVAL(name) \
8981 END (name)
9082
83#undef SYSCALL_ERROR_LABEL
9184#ifndef PIC
85# undef SYSCALL_ERROR_LABEL
9286# define SYSCALL_ERROR_LABEL 0f
9387# define SYSCALL_ERROR_HANDLER \
94880: basr %r1,0; \
......@@ -97,6 +91,7 @@
97912: .long syscall_error
9892#else
9993# if RTLD_PRIVATE_ERRNO
94# undef SYSCALL_ERROR_LABEL
10095# define SYSCALL_ERROR_LABEL 0f
10196# define SYSCALL_ERROR_HANDLER \
102970: basr %r1,0; \
......@@ -112,6 +107,7 @@
112107# else
113108# define SYSCALL_ERROR_ERRNO errno
114109# endif
110# undef SYSCALL_ERROR_LABEL
115111# define SYSCALL_ERROR_LABEL 0f
116112# define SYSCALL_ERROR_HANDLER \
1171130: lcr %r0,%r2; \
......@@ -124,6 +120,7 @@
124120 br %r14; \
1251212: .long _GLOBAL_OFFSET_TABLE_-1b
126122# else
123# undef SYSCALL_ERROR_LABEL
127124# define SYSCALL_ERROR_LABEL 0f
128125# define SYSCALL_ERROR_HANDLER \
1291260: basr %r1,0; \
......@@ -178,99 +175,12 @@
178175#define ret_ERRVAL \
179176 br 14
180177
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
247179
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
266182
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__ */
274184
275185/* Pointer mangling support. */
276186#if IS_IN (rtld)
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h+10-110
......@@ -1,5 +1,5 @@
11/* 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.
33 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
44 This file is part of the GNU C Library.
55
......@@ -27,11 +27,6 @@
2727#include <dl-sysdep.h> /* For RTLD_PRIVATE_ERRNO. */
2828#include <tls.h>
2929
30/* Define __set_errno() for INLINE_SYSCALL macro below. */
31#ifndef __ASSEMBLER__
32#include <errno.h>
33#endif
34
3530/* For Linux we can use the system call table in the header file
3631 /usr/include/asm/unistd.h
3732 of the kernel. But these symbols do not follow the SYS_* syntax
......@@ -39,17 +34,6 @@
3934/* In newer 2.1 kernels __NR_syscall is missing so we define it here. */
4035#define __NR_syscall 0
4136
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
5337#undef SYS_ify
5438#define SYS_ify(syscall_name) __NR_##syscall_name
5539
......@@ -102,11 +86,14 @@
10286 SYSCALL_ERROR_HANDLER; \
10387 END (name)
10488
89#undef SYSCALL_ERROR_LABEL
10590#ifndef PIC
91# undef SYSCALL_ERROR_LABEL
10692# define SYSCALL_ERROR_LABEL syscall_error
10793# define SYSCALL_ERROR_HANDLER
10894#else
10995# if RTLD_PRIVATE_ERRNO
96# undef SYSCALL_ERROR_LABEL
11097# define SYSCALL_ERROR_LABEL 0f
11198# define SYSCALL_ERROR_HANDLER \
112990: larl %r1,rtld_errno; \
......@@ -120,6 +107,7 @@
120107# else
121108# define SYSCALL_ERROR_ERRNO errno
122109# endif
110# undef SYSCALL_ERROR_LABEL
123111# define SYSCALL_ERROR_LABEL 0f
124112# define SYSCALL_ERROR_HANDLER \
1251130: lcr %r0,%r2; \
......@@ -132,6 +120,7 @@
132120 lghi %r2,-1; \
133121 br %r14
134122# else
123# undef SYSCALL_ERROR_LABEL
135124# define SYSCALL_ERROR_LABEL 0f
136125# define SYSCALL_ERROR_HANDLER \
1371260: larl %r1,_GLOBAL_OFFSET_TABLE_; \
......@@ -184,101 +173,12 @@
184173#define ret_ERRVAL \
185174 br 14
186175
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
272177
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
280180
281#define SINGLE_THREAD_BY_GLOBAL 1
181#endif /* __ASSEMBLER__ */
282182
283183/* Pointer mangling support. */
284184#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.
22 This file is part of the GNU C Library.
33
44 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 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. SH version.
3 Copyright (C) 1999-2020 Free Software Foundation, Inc.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -33,8 +33,6 @@
3333#define __ASSUME_SEND_SYSCALL 1
3434#define __ASSUME_RECV_SYSCALL 1
3535#define __ASSUME_SHUTDOWN_SYSCALL 1
36#define __ASSUME_GETSOCKOPT_SYSCALL 1
37#define __ASSUME_SETSOCKOPT_SYSCALL 1
3836
3937#include_next <kernel-features.h>
4038
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.. */
2struct 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.
22 This file is part of the GNU C Library.
33 Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
44 Changed by Kaz Kojima, <kkojima@rr.iij4u.or.jp>.
......@@ -287,19 +287,8 @@
287287 register long int r1 asm ("%r1") = (long int) (_arg6); \
288288 register long int r2 asm ("%r2") = (long int) (_arg7)
289289
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
301290#undef INTERNAL_SYSCALL
302#define INTERNAL_SYSCALL(name, err, nr, args...) \
291#define INTERNAL_SYSCALL(name, nr, args...) \
303292 ({ \
304293 unsigned long int resultvar; \
305294 register long int r3 asm ("%r3") = SYS_ify (name); \
......@@ -313,7 +302,7 @@
313302 (int) resultvar; })
314303
315304/* 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...) \
317306 ({ \
318307 unsigned long int resultvar; \
319308 register long int r3 asm ("%r3") = (name); \
......@@ -326,16 +315,6 @@
326315 \
327316 (int) resultvar; })
328317
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
339318#endif /* __ASSEMBLER__ */
340319
341320/* Pointer mangling support. */
lib/libc/glibc/sysdeps/unix/sysv/linux/single-thread.h+13-31
......@@ -1,5 +1,5 @@
11/* Single thread optimization, Linux version.
2 Copyright (C) 2019-2020 Free Software Foundation, Inc.
2 Copyright (C) 2019-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -27,36 +27,18 @@
2727 The ABI might define SINGLE_THREAD_BY_GLOBAL to enable the single thread
2828 check to use global variables instead of the pthread_t field. */
2929
30#ifdef SINGLE_THREAD_BY_GLOBAL
31# if IS_IN (libc)
30#ifndef __ASSEMBLER__
3231extern int __libc_multiple_threads;
33# define SINGLE_THREAD_P \
34 __glibc_likely (__libc_multiple_threads == 0)
35# elif IS_IN (libpthread)
36extern 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)
32libc_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
6143
6244#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
38struct 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
91struct 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -50,6 +50,7 @@
5050#define __TIME_T_TYPE __SLONGWORD_TYPE
5151#define __USECONDS_T_TYPE __U32_TYPE
5252#define __SUSECONDS_T_TYPE __S32_TYPE
53#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
5354#define __DADDR_T_TYPE __S32_TYPE
5455#define __KEY_T_TYPE __S32_TYPE
5556#define __CLOCKID_T_TYPE __S32_TYPE
......@@ -75,10 +76,16 @@
7576
7677/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
7778# define __STATFS_MATCHES_STATFS64 1
79
80/* And for getitimer, setitimer and rusage */
81# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
7882#else
7983# define __RLIM_T_MATCHES_RLIM64_T 0
8084
8185# define __STATFS_MATCHES_STATFS64 0
86
87/* And for getitimer, setitimer and rusage */
88# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
8289#endif
8390
8491/* 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 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. SPARC version.
3 Copyright (C) 1999-2020 Free Software Foundation, Inc.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -38,10 +38,11 @@
3838# undef __ASSUME_CONNECT_SYSCALL
3939# undef __ASSUME_RECVFROM_SYSCALL
4040# undef __ASSUME_SENDTO_SYSCALL
41# undef __ASSUME_GETSOCKOPT_SYSCALL
42# undef __ASSUME_SETSOCKOPT_SYSCALL
4143#else
4244# define __ASSUME_SOCKET_SYSCALL 1
4345# define __ASSUME_SOCKETPAIR_SYSCALL 1
44# define __ASSUME_GETSOCKOPT_SYSCALL 1
4546# define __ASSUME_SHUTDOWN_SYSCALL 1
4647#endif
4748
......@@ -49,7 +50,6 @@
4950#if __LINUX_KERNEL_VERSION >= 0x040400
5051# define __ASSUME_BIND_SYSCALL 1
5152# define __ASSUME_LISTEN_SYSCALL 1
52# define __ASSUME_SETSOCKOPT_SYSCALL 1
5353#endif
5454
5555#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 */
2struct 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.
22 This file is part of the GNU C Library.
33 Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, January 1997.
44
......@@ -110,9 +110,8 @@ ENTRY(name); \
110110#define __SYSCALL_STRING \
111111 "ta 0x10;" \
112112 "bcc 1f;" \
113 " mov 0, %%g1;" \
113 " nop;" \
114114 "sub %%g0, %%o0, %%o0;" \
115 "mov 1, %%g1;" \
116115 "1:"
117116
118117#define __SYSCALL_CLOBBERS \
......@@ -122,6 +121,9 @@ ENTRY(name); \
122121 "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \
123122 "cc", "memory"
124123
124#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL
125#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1
126
125127#endif /* __ASSEMBLER__ */
126128
127129/* 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 */
5struct 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. */
25struct 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
21static 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.
22 This file is part of the GNU C Library.
33 Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
44
......@@ -109,9 +109,8 @@ ENTRY(name); \
109109#define __SYSCALL_STRING \
110110 "ta 0x6d;" \
111111 "bcc,pt %%xcc, 1f;" \
112 " mov 0, %%g1;" \
112 " nop;" \
113113 "sub %%g0, %%o0, %%o0;" \
114 "mov 1, %%g1;" \
115114 "1:"
116115
117116#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.
22 This file is part of the GNU C Library.
33 Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
44
......@@ -34,13 +34,6 @@
3434
3535#else /* __ASSEMBLER__ */
3636
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
4437# define VDSO_NAME "LINUX_2.6"
4538# define VDSO_HASH 61765110
4639
......@@ -52,121 +45,119 @@
5245# endif
5346# define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday"
5447
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
7148#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)
7451
7552#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)
8555
86#define inline_syscall0(string,err,name,dummy...) \
56#define internal_syscall0(string,name,dummy...) \
8757({ \
58 register long int __g1 __asm__ ("g1") = (name); \
8859 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) : \
9262 __SYSCALL_CLOBBERS); \
9363 __o0; \
9464})
9565
96#define inline_syscall1(string,err,name,arg1) \
66#define internal_syscall1(string,name,arg1) \
9767({ \
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) : \
10273 __SYSCALL_CLOBBERS); \
10374 __o0; \
10475})
10576
106#define inline_syscall2(string,err,name,arg1,arg2) \
77#define internal_syscall2(string,name,arg1,arg2) \
10778({ \
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) : \
11386 __SYSCALL_CLOBBERS); \
11487 __o0; \
11588})
11689
117#define inline_syscall3(string,err,name,arg1,arg2,arg3) \
90#define internal_syscall3(string,name,arg1,arg2,arg3) \
11891({ \
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), \
125101 "r" (__o2) : \
126102 __SYSCALL_CLOBBERS); \
127103 __o0; \
128104})
129105
130#define inline_syscall4(string,err,name,arg1,arg2,arg3,arg4) \
106#define internal_syscall4(string,name,arg1,arg2,arg3,arg4) \
131107({ \
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), \
139119 "r" (__o2), "r" (__o3) : \
140120 __SYSCALL_CLOBBERS); \
141121 __o0; \
142122})
143123
144#define inline_syscall5(string,err,name,arg1,arg2,arg3,arg4,arg5) \
124#define internal_syscall5(string,name,arg1,arg2,arg3,arg4,arg5) \
145125({ \
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), \
154139 "r" (__o2), "r" (__o3), "r" (__o4) : \
155140 __SYSCALL_CLOBBERS); \
156141 __o0; \
157142})
158143
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) \
160145({ \
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), \
170161 "r" (__o2), "r" (__o3), "r" (__o4), \
171162 "r" (__o5) : \
172163 __SYSCALL_CLOBBERS); \
......@@ -175,20 +166,25 @@
175166
176167#define INLINE_CLONE_SYSCALL(arg1,arg2,arg3,arg4,arg5) \
177168({ \
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; \
184180 __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), \
187183 "r" (__o2), "r" (__o3), "r" (__o4) : \
188184 __SYSCALL_CLOBBERS); \
189 if (INTERNAL_SYSCALL_ERROR_P (__o0, __g1)) \
185 if (__glibc_unlikely ((unsigned long int) (__o0) > -4096UL)) \
190186 { \
191 __set_errno (INTERNAL_SYSCALL_ERRNO (__o0, __g1)); \
187 __set_errno (-__o0); \
192188 __o0 = -1L; \
193189 } \
194190 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
24int
25__stat (const char *file, struct stat *buf)
26{
27 return __fstatat (AT_FDCWD, file, buf, 0);
28}
29
30weak_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
26int
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
32hidden_def (__stat64_time64)
33
34int
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
46hidden_def (__stat64)
47weak_alias (__stat64, stat64)
48
49#if XSTAT_IS_XSTAT64
50strong_alias (__stat64, __stat)
51weak_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
26static inline bool
27in_time_t_range (__time64_t t)
28{
29 time_t s = t;
30 return s == t;
31}
32
33static inline struct timespec
34valid_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
44int
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
22extern 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
27struct __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.
22 This file is part of the GNU C Library.
33
44 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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -54,17 +54,34 @@ struct ntptimeval
5454
5555__BEGIN_DECLS
5656
57extern int __adjtimex (struct timex *__ntx) __THROW;
57#ifndef __USE_TIME_BITS64
5858extern int adjtimex (struct timex *__ntx) __THROW;
59extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
5960
60#ifdef __REDIRECT_NTH
61# ifdef __REDIRECT_NTH
6162extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
62 ntp_gettimex);
63 ntp_gettimex);
64# else
65# define ntp_gettime ntp_gettimex
66# endif
67extern int ntp_adjtime (struct timex *__tntx) __THROW;
6368#else
64extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
65# define ntp_gettime ntp_gettimex
69# ifdef __REDIRECT_NTH
70extern int __REDIRECT_NTH (adjtimex, (struct timex *__ntx),
71 ___adjtimex64);
72extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
73 __ntp_gettime64);
74extern int __REDIRECT_NTH (ntp_gettimex, (struct ntptimeval *__ntv),
75 __ntp_gettimex64);
76extern 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
6684#endif
67extern int ntp_adjtime (struct timex *__tntx) __THROW;
6885
6986__END_DECLS
7087
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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -15,8 +15,40 @@
1515 License along with the GNU C Library; if not, see
1616 <https://www.gnu.org/licenses/>. */
1717
18#ifndef _SYSDEP_LINUX_H
19#define _SYSDEP_LINUX_H
20
1821#include <bits/wordsize.h>
1922#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))
2052
2153/* Set error number and return -1. A target may choose to return the
2254 internal function, __syscall_error, which sets errno and returns -1.
......@@ -63,6 +95,8 @@
6395 (long) (val), \
6496 (long) (((uint64_t) (val)) >> 32)
6597
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
46struct 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. */
119struct 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -64,6 +64,7 @@
6464#define __TIME_T_TYPE __SYSCALL_SLONG_TYPE
6565#define __USECONDS_T_TYPE __U32_TYPE
6666#define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE
67#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
6768#define __DADDR_T_TYPE __S32_TYPE
6869#define __KEY_T_TYPE __S32_TYPE
6970#define __CLOCKID_T_TYPE __S32_TYPE
......@@ -87,10 +88,15 @@
8788
8889/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
8990# define __STATFS_MATCHES_STATFS64 1
91
92/* And for getitimer, setitimer and rusage */
93# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
9094#else
9195# define __RLIM_T_MATCHES_RLIM64_T 0
9296
9397# define __STATFS_MATCHES_STATFS64 0
98
99# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
94100#endif
95101
96102/* 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.
22 This file is part of the GNU C Library.
33
44 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 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. x86-64 version.
3 Copyright (C) 1999-2020 Free Software Foundation, Inc.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -33,13 +33,6 @@
3333#undef SYS_ify
3434#define SYS_ify(syscall_name) __NR_##syscall_name
3535
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
4336#ifdef __ASSEMBLER__
4437
4538/* Linux uses a negative return value to indicate syscall errors,
......@@ -55,19 +48,40 @@
5548
5649/* We don't want the label for the error handle to be global when we define
5750 it here. */
51# undef SYSCALL_ERROR_LABEL
5852# ifdef PIC
53# undef SYSCALL_ERROR_LABEL
5954# define SYSCALL_ERROR_LABEL 0f
6055# else
56# undef SYSCALL_ERROR_LABEL
6157# define SYSCALL_ERROR_LABEL syscall_error
6258# endif
6359
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
6469# 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; \
7083 jae SYSCALL_ERROR_LABEL
84# endif
7185
7286# undef PSEUDO_END
7387# define PSEUDO_END(name) \
......@@ -75,10 +89,17 @@
7589 END (name)
7690
7791# 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
82103
83104# undef PSEUDO_END_NOERRNO
84105# define PSEUDO_END_NOERRNO(name) \
......@@ -87,11 +108,19 @@
87108# define ret_NOERRNO ret
88109
89110# 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); \
94122 negq %rax
123# endif
95124
96125# undef PSEUDO_END_ERRVAL
97126# define PSEUDO_END_ERRVAL(name) \
......@@ -163,8 +192,10 @@
163192 Syscalls of more than 6 arguments are not supported. */
164193
165194# undef DO_CALL
166# define DO_CALL(syscall_name, args) \
195# define DO_CALL(syscall_name, args, ulong_arg_1, ulong_arg_2) \
167196 DOARGS_##args \
197 ZERO_EXTEND_##ulong_arg_1 \
198 ZERO_EXTEND_##ulong_arg_2 \
168199 movl $SYS_ify (syscall_name), %eax; \
169200 syscall;
170201
......@@ -176,57 +207,39 @@
176207# define DOARGS_5 DOARGS_4
177208# define DOARGS_6 DOARGS_5
178209
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
179218#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)
209219
210220/* Registers clobbered by syscall. */
211221# define REGISTERS_CLOBBERED_BY_SYSCALL "cc", "r11", "cx"
212222
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
219232
220233#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)
223236
224237#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)
227240
228241#undef internal_syscall0
229#define internal_syscall0(number, err, dummy...) \
242#define internal_syscall0(number, dummy...) \
230243({ \
231244 unsigned long int resultvar; \
232245 asm volatile ( \
......@@ -238,7 +251,7 @@
238251})
239252
240253#undef internal_syscall1
241#define internal_syscall1(number, err, arg1) \
254#define internal_syscall1(number, arg1) \
242255({ \
243256 unsigned long int resultvar; \
244257 TYPEFY (arg1, __arg1) = ARGIFY (arg1); \
......@@ -252,7 +265,7 @@
252265})
253266
254267#undef internal_syscall2
255#define internal_syscall2(number, err, arg1, arg2) \
268#define internal_syscall2(number, arg1, arg2) \
256269({ \
257270 unsigned long int resultvar; \
258271 TYPEFY (arg2, __arg2) = ARGIFY (arg2); \
......@@ -268,7 +281,7 @@
268281})
269282
270283#undef internal_syscall3
271#define internal_syscall3(number, err, arg1, arg2, arg3) \
284#define internal_syscall3(number, arg1, arg2, arg3) \
272285({ \
273286 unsigned long int resultvar; \
274287 TYPEFY (arg3, __arg3) = ARGIFY (arg3); \
......@@ -286,7 +299,7 @@
286299})
287300
288301#undef internal_syscall4
289#define internal_syscall4(number, err, arg1, arg2, arg3, arg4) \
302#define internal_syscall4(number, arg1, arg2, arg3, arg4) \
290303({ \
291304 unsigned long int resultvar; \
292305 TYPEFY (arg4, __arg4) = ARGIFY (arg4); \
......@@ -306,7 +319,7 @@
306319})
307320
308321#undef internal_syscall5
309#define internal_syscall5(number, err, arg1, arg2, arg3, arg4, arg5) \
322#define internal_syscall5(number, arg1, arg2, arg3, arg4, arg5) \
310323({ \
311324 unsigned long int resultvar; \
312325 TYPEFY (arg5, __arg5) = ARGIFY (arg5); \
......@@ -329,7 +342,7 @@
329342})
330343
331344#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) \
333346({ \
334347 unsigned long int resultvar; \
335348 TYPEFY (arg6, __arg6) = ARGIFY (arg6); \
......@@ -353,12 +366,6 @@
353366 (long int) resultvar; \
354367})
355368
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))
362369
363370# define VDSO_NAME "LINUX_2.6"
364371# define VDSO_HASH 61765110
......@@ -370,6 +377,8 @@
370377# define HAVE_GETCPU_VSYSCALL "__vdso_getcpu"
371378# define HAVE_CLOCK_GETRES64_VSYSCALL "__vdso_clock_getres"
372379
380# define HAVE_CLONE3_WRAPPER 1
381
373382# define SINGLE_THREAD_BY_GLOBAL 1
374383
375384#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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -26,4 +26,39 @@
2626#undef LO_HI_LONG
2727#define LO_HI_LONG(val) (val)
2828
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
2964#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.
22 This file is part of the GNU C Library.
33
44 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 @@
11/* Hacks needed for divdi3 symbol manipulation.
2 Copyright (C) 2004-2020 Free Software Foundation, Inc.
2 Copyright (C) 2004-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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.
22 This file is part of the GNU C Library.
33
44 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 @@
11/* Assembler macros for x86.
2 Copyright (C) 2017-2020 Free Software Foundation, Inc.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -57,6 +57,11 @@ enum cf_protection_level
5757#define STATE_SAVE_MASK \
5858 ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 5) | (1 << 6) | (1 << 7))
5959
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
6065#ifdef __ASSEMBLER__
6166
6267/* Syntactic details of assembler. */
lib/libc/glibc/sysdeps/x86_64/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44
55 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 @@
11/* 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.
33 This file is part of the GNU C Library.
44 Contributed by Andreas Jaeger <aj@suse.de>, 2001.
55
......@@ -96,17 +96,13 @@ ENTRY (_start)
9696 which grow downwards). */
9797 pushq %rsp
9898
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
103102
103#ifdef PIC
104104 mov main@GOTPCREL(%rip), %RDI_LP
105105#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
110106 mov $main, %RDI_LP
111107#endif
112108
lib/libc/glibc/sysdeps/x86_64/sysdep.h+23-1
......@@ -1,5 +1,5 @@
11/* Assembler macros for x86-64.
2 Copyright (C) 2001-2020 Free Software Foundation, Inc.
2 Copyright (C) 2001-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -95,6 +95,28 @@ lose: \
9595#define R14_LP r14
9696#define R15_LP r15
9797
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; \
1051: \
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
98120#else /* __ASSEMBLER__ */
99121
100122/* Long and pointer size in bytes. */
lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* Assembler macros for x32.
2 Copyright (C) 2012-2020 Free Software Foundation, Inc.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 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 @@
44
55#include <bits/types.h>
66#include <bits/endian.h>
7#include <bits/types/time_t.h>
78
89/* POSIX.1b structure for a time value. This is like a `struct timeval' but
910 has nanoseconds instead of microseconds. */
1011struct timespec
1112{
13#ifdef __USE_TIME_BITS64
14 __time64_t tv_sec; /* Seconds. */
15#else
1216 __time_t tv_sec; /* Seconds. */
17#endif
1318#if __WORDSIZE == 64 \
1419 || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \
15 || __TIMESIZE == 32
20 || (__TIMESIZE == 32 && !defined __USE_TIME_BITS64)
1621 __syscall_slong_t tv_nsec; /* Nanoseconds. */
1722#else
1823# if __BYTE_ORDER == __BIG_ENDIAN
lib/libc/glibc/time/bits/types/struct_timeval.h+5
......@@ -7,7 +7,12 @@
77 microsecond but also has a range of years. */
88struct timeval
99{
10#ifdef __USE_TIME_BITS64
11 __time64_t tv_sec; /* Seconds. */
12 __suseconds64_t tv_usec; /* Microseconds. */
13#else
1014 __time_t tv_sec; /* Seconds. */
1115 __suseconds_t tv_usec; /* Microseconds. */
16#endif
1217};
1318#endif
lib/libc/glibc/time/bits/types/time_t.h+4
......@@ -4,6 +4,10 @@
44#include <bits/types.h>
55
66/* Returned by `time'. */
7#ifdef __USE_TIME_BITS64
8typedef __time64_t time_t;
9#else
710typedef __time_t time_t;
11#endif
812
913#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
47struct 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
66struct 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 @@
88#define LIBANL_SO "libanl.so.1"
99#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1010#define LIBCRYPT_SO "libcrypt.so.1"
11#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1112#define LIBC_SO "libc.so.6"
1213#define LIBDL_SO "libdl.so.2"
1314#define LIBGCC_S_SO "libgcc_s.so.1"
lib/libc/include/aarch64-linux-gnu/sys/ptrace.h+50
......@@ -25,6 +25,40 @@
2525
2626__BEGIN_DECLS
2727
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
2862/* Type of the REQUEST argument to `ptrace.' */
2963enum __ptrace_request
3064{
......@@ -82,6 +116,22 @@ enum __ptrace_request
82116 PTRACE_SYSCALL = 24,
83117#define PT_SYSCALL PTRACE_SYSCALL
84118
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
85135 /* Set ptrace filter options. */
86136 PTRACE_SETOPTIONS = 0x4200,
87137#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
47struct 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
66struct 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 @@
88#define LIBANL_SO "libanl.so.1"
99#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1010#define LIBCRYPT_SO "libcrypt.so.1"
11#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1112#define LIBC_SO "libc.so.6"
1213#define LIBDL_SO "libdl.so.2"
1314#define LIBGCC_S_SO "libgcc_s.so.1"
lib/libc/include/aarch64_be-linux-gnu/sys/ptrace.h+50
......@@ -25,6 +25,40 @@
2525
2626__BEGIN_DECLS
2727
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
2862/* Type of the REQUEST argument to `ptrace.' */
2963enum __ptrace_request
3064{
......@@ -82,6 +116,22 @@ enum __ptrace_request
82116 PTRACE_SYSCALL = 24,
83117#define PT_SYSCALL PTRACE_SYSCALL
84118
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
85135 /* Set ptrace filter options. */
86136 PTRACE_SETOPTIONS = 0x4200,
87137#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
29struct __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 @@
2828
2929struct stat
3030 {
31#ifdef __USE_TIME_BITS64
32# include <bits/struct_stat_time64_helper.h>
33#else
3134 __dev_t st_dev; /* Device. */
3235 unsigned short int __pad1;
33#ifndef __USE_FILE_OFFSET64
36# ifndef __USE_FILE_OFFSET64
3437 __ino_t st_ino; /* File serial number. */
35#else
38# else
3639 __ino_t __st_ino; /* 32bit file serial number. */
37#endif
40# endif
3841 __mode_t st_mode; /* File mode. */
3942 __nlink_t st_nlink; /* Link count. */
4043 __uid_t st_uid; /* User ID of the file's owner. */
4144 __gid_t st_gid; /* Group ID of the file's group.*/
4245 __dev_t st_rdev; /* Device number, if device. */
4346 unsigned short int __pad2;
44#ifndef __USE_FILE_OFFSET64
47# ifndef __USE_FILE_OFFSET64
4548 __off_t st_size; /* Size of file, in bytes. */
46#else
49# else
4750 __off64_t st_size; /* Size of file, in bytes. */
48#endif
51# endif
4952 __blksize_t st_blksize; /* Optimal block size for I/O. */
5053
51#ifndef __USE_FILE_OFFSET64
54# ifndef __USE_FILE_OFFSET64
5255 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
53#else
56# else
5457 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
55#endif
56#ifdef __USE_XOPEN2K8
58# endif
59# ifdef __USE_XOPEN2K8
5760 /* Nanosecond resolution timestamps are stored in a format
5861 equivalent to 'struct timespec'. This is the type used
5962 whenever possible but the Unix namespace rules do not allow the
......@@ -63,28 +66,32 @@ struct stat
6366 struct timespec st_atim; /* Time of last access. */
6467 struct timespec st_mtim; /* Time of last modification. */
6568 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
7073 __time_t st_atime; /* Time of last access. */
7174 unsigned long int st_atimensec; /* Nscecs of last access. */
7275 __time_t st_mtime; /* Time of last modification. */
7376 unsigned long int st_mtimensec; /* Nsecs of last modification. */
7477 __time_t st_ctime; /* Time of last status change. */
7578 unsigned long int st_ctimensec; /* Nsecs of last status change. */
76#endif
77#ifndef __USE_FILE_OFFSET64
79# endif
80# ifndef __USE_FILE_OFFSET64
7881 unsigned long int __glibc_reserved4;
7982 unsigned long int __glibc_reserved5;
80#else
83# else
8184 __ino64_t st_ino; /* File serial number. */
82#endif
85# endif
86#endif /* __USE_TIME_BITS64 */
8387 };
8488
8589#ifdef __USE_LARGEFILE64
8690struct stat64
8791 {
92# ifdef __USE_TIME_BITS64
93# include <bits/struct_stat_time64_helper.h>
94# else
8895 __dev_t st_dev; /* Device. */
8996 unsigned int __pad1;
9097
......@@ -99,7 +106,7 @@ struct stat64
99106 __blksize_t st_blksize; /* Optimal block size for I/O. */
100107
101108 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
102# ifdef __USE_XOPEN2K8
109# ifdef __USE_XOPEN2K8
103110 /* Nanosecond resolution timestamps are stored in a format
104111 equivalent to 'struct timespec'. This is the type used
105112 whenever possible but the Unix namespace rules do not allow the
......@@ -109,15 +116,16 @@ struct stat64
109116 struct timespec st_atim; /* Time of last access. */
110117 struct timespec st_mtim; /* Time of last modification. */
111118 struct timespec st_ctim; /* Time of last status change. */
112# else
119# else
113120 __time_t st_atime; /* Time of last access. */
114121 unsigned long int st_atimensec; /* Nscecs of last access. */
115122 __time_t st_mtime; /* Time of last modification. */
116123 unsigned long int st_mtimensec; /* Nsecs of last modification. */
117124 __time_t st_ctime; /* Time of last status change. */
118125 unsigned long int st_ctimensec; /* Nsecs of last status change. */
119# endif
126# endif
120127 __ino64_t st_ino; /* File serial number. */
128# endif /* __USE_TIME_BITS64 */
121129 };
122130#endif
123131
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
29struct __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 @@
2828
2929struct stat
3030 {
31#ifdef __USE_TIME_BITS64
32# include <bits/struct_stat_time64_helper.h>
33#else
3134 __dev_t st_dev; /* Device. */
3235 unsigned short int __pad1;
33#ifndef __USE_FILE_OFFSET64
36# ifndef __USE_FILE_OFFSET64
3437 __ino_t st_ino; /* File serial number. */
35#else
38# else
3639 __ino_t __st_ino; /* 32bit file serial number. */
37#endif
40# endif
3841 __mode_t st_mode; /* File mode. */
3942 __nlink_t st_nlink; /* Link count. */
4043 __uid_t st_uid; /* User ID of the file's owner. */
4144 __gid_t st_gid; /* Group ID of the file's group.*/
4245 __dev_t st_rdev; /* Device number, if device. */
4346 unsigned short int __pad2;
44#ifndef __USE_FILE_OFFSET64
47# ifndef __USE_FILE_OFFSET64
4548 __off_t st_size; /* Size of file, in bytes. */
46#else
49# else
4750 __off64_t st_size; /* Size of file, in bytes. */
48#endif
51# endif
4952 __blksize_t st_blksize; /* Optimal block size for I/O. */
5053
51#ifndef __USE_FILE_OFFSET64
54# ifndef __USE_FILE_OFFSET64
5255 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
53#else
56# else
5457 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
55#endif
56#ifdef __USE_XOPEN2K8
58# endif
59# ifdef __USE_XOPEN2K8
5760 /* Nanosecond resolution timestamps are stored in a format
5861 equivalent to 'struct timespec'. This is the type used
5962 whenever possible but the Unix namespace rules do not allow the
......@@ -63,28 +66,32 @@ struct stat
6366 struct timespec st_atim; /* Time of last access. */
6467 struct timespec st_mtim; /* Time of last modification. */
6568 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
7073 __time_t st_atime; /* Time of last access. */
7174 unsigned long int st_atimensec; /* Nscecs of last access. */
7275 __time_t st_mtime; /* Time of last modification. */
7376 unsigned long int st_mtimensec; /* Nsecs of last modification. */
7477 __time_t st_ctime; /* Time of last status change. */
7578 unsigned long int st_ctimensec; /* Nsecs of last status change. */
76#endif
77#ifndef __USE_FILE_OFFSET64
79# endif
80# ifndef __USE_FILE_OFFSET64
7881 unsigned long int __glibc_reserved4;
7982 unsigned long int __glibc_reserved5;
80#else
83# else
8184 __ino64_t st_ino; /* File serial number. */
82#endif
85# endif
86#endif /* __USE_TIME_BITS64 */
8387 };
8488
8589#ifdef __USE_LARGEFILE64
8690struct stat64
8791 {
92# ifdef __USE_TIME_BITS64
93# include <bits/struct_stat_time64_helper.h>
94# else
8895 __dev_t st_dev; /* Device. */
8996 unsigned int __pad1;
9097
......@@ -99,7 +106,7 @@ struct stat64
99106 __blksize_t st_blksize; /* Optimal block size for I/O. */
100107
101108 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
102# ifdef __USE_XOPEN2K8
109# ifdef __USE_XOPEN2K8
103110 /* Nanosecond resolution timestamps are stored in a format
104111 equivalent to 'struct timespec'. This is the type used
105112 whenever possible but the Unix namespace rules do not allow the
......@@ -109,15 +116,16 @@ struct stat64
109116 struct timespec st_atim; /* Time of last access. */
110117 struct timespec st_mtim; /* Time of last modification. */
111118 struct timespec st_ctim; /* Time of last status change. */
112# else
119# else
113120 __time_t st_atime; /* Time of last access. */
114121 unsigned long int st_atimensec; /* Nscecs of last access. */
115122 __time_t st_mtime; /* Time of last modification. */
116123 unsigned long int st_mtimensec; /* Nsecs of last modification. */
117124 __time_t st_ctime; /* Time of last status change. */
118125 unsigned long int st_ctimensec; /* Nsecs of last status change. */
119# endif
126# endif
120127 __ino64_t st_ino; /* File serial number. */
128# endif /* __USE_TIME_BITS64 */
121129 };
122130#endif
123131
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
29struct __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 @@
2828
2929struct stat
3030 {
31#ifdef __USE_TIME_BITS64
32# include <bits/struct_stat_time64_helper.h>
33#else
3134 __dev_t st_dev; /* Device. */
3235 unsigned short int __pad1;
33#ifndef __USE_FILE_OFFSET64
36# ifndef __USE_FILE_OFFSET64
3437 __ino_t st_ino; /* File serial number. */
35#else
38# else
3639 __ino_t __st_ino; /* 32bit file serial number. */
37#endif
40# endif
3841 __mode_t st_mode; /* File mode. */
3942 __nlink_t st_nlink; /* Link count. */
4043 __uid_t st_uid; /* User ID of the file's owner. */
4144 __gid_t st_gid; /* Group ID of the file's group.*/
4245 __dev_t st_rdev; /* Device number, if device. */
4346 unsigned short int __pad2;
44#ifndef __USE_FILE_OFFSET64
47# ifndef __USE_FILE_OFFSET64
4548 __off_t st_size; /* Size of file, in bytes. */
46#else
49# else
4750 __off64_t st_size; /* Size of file, in bytes. */
48#endif
51# endif
4952 __blksize_t st_blksize; /* Optimal block size for I/O. */
5053
51#ifndef __USE_FILE_OFFSET64
54# ifndef __USE_FILE_OFFSET64
5255 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
53#else
56# else
5457 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
55#endif
56#ifdef __USE_XOPEN2K8
58# endif
59# ifdef __USE_XOPEN2K8
5760 /* Nanosecond resolution timestamps are stored in a format
5861 equivalent to 'struct timespec'. This is the type used
5962 whenever possible but the Unix namespace rules do not allow the
......@@ -63,28 +66,32 @@ struct stat
6366 struct timespec st_atim; /* Time of last access. */
6467 struct timespec st_mtim; /* Time of last modification. */
6568 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
7073 __time_t st_atime; /* Time of last access. */
7174 unsigned long int st_atimensec; /* Nscecs of last access. */
7275 __time_t st_mtime; /* Time of last modification. */
7376 unsigned long int st_mtimensec; /* Nsecs of last modification. */
7477 __time_t st_ctime; /* Time of last status change. */
7578 unsigned long int st_ctimensec; /* Nsecs of last status change. */
76#endif
77#ifndef __USE_FILE_OFFSET64
79# endif
80# ifndef __USE_FILE_OFFSET64
7881 unsigned long int __glibc_reserved4;
7982 unsigned long int __glibc_reserved5;
80#else
83# else
8184 __ino64_t st_ino; /* File serial number. */
82#endif
85# endif
86#endif /* __USE_TIME_BITS64 */
8387 };
8488
8589#ifdef __USE_LARGEFILE64
8690struct stat64
8791 {
92# ifdef __USE_TIME_BITS64
93# include <bits/struct_stat_time64_helper.h>
94# else
8895 __dev_t st_dev; /* Device. */
8996 unsigned int __pad1;
9097
......@@ -99,7 +106,7 @@ struct stat64
99106 __blksize_t st_blksize; /* Optimal block size for I/O. */
100107
101108 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
102# ifdef __USE_XOPEN2K8
109# ifdef __USE_XOPEN2K8
103110 /* Nanosecond resolution timestamps are stored in a format
104111 equivalent to 'struct timespec'. This is the type used
105112 whenever possible but the Unix namespace rules do not allow the
......@@ -109,15 +116,16 @@ struct stat64
109116 struct timespec st_atim; /* Time of last access. */
110117 struct timespec st_mtim; /* Time of last modification. */
111118 struct timespec st_ctim; /* Time of last status change. */
112# else
119# else
113120 __time_t st_atime; /* Time of last access. */
114121 unsigned long int st_atimensec; /* Nscecs of last access. */
115122 __time_t st_mtime; /* Time of last modification. */
116123 unsigned long int st_mtimensec; /* Nsecs of last modification. */
117124 __time_t st_ctime; /* Time of last status change. */
118125 unsigned long int st_ctimensec; /* Nsecs of last status change. */
119# endif
126# endif
120127 __ino64_t st_ino; /* File serial number. */
128# endif /* __USE_TIME_BITS64 */
121129 };
122130#endif
123131
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
29struct __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 @@
2828
2929struct stat
3030 {
31#ifdef __USE_TIME_BITS64
32# include <bits/struct_stat_time64_helper.h>
33#else
3134 __dev_t st_dev; /* Device. */
3235 unsigned short int __pad1;
33#ifndef __USE_FILE_OFFSET64
36# ifndef __USE_FILE_OFFSET64
3437 __ino_t st_ino; /* File serial number. */
35#else
38# else
3639 __ino_t __st_ino; /* 32bit file serial number. */
37#endif
40# endif
3841 __mode_t st_mode; /* File mode. */
3942 __nlink_t st_nlink; /* Link count. */
4043 __uid_t st_uid; /* User ID of the file's owner. */
4144 __gid_t st_gid; /* Group ID of the file's group.*/
4245 __dev_t st_rdev; /* Device number, if device. */
4346 unsigned short int __pad2;
44#ifndef __USE_FILE_OFFSET64
47# ifndef __USE_FILE_OFFSET64
4548 __off_t st_size; /* Size of file, in bytes. */
46#else
49# else
4750 __off64_t st_size; /* Size of file, in bytes. */
48#endif
51# endif
4952 __blksize_t st_blksize; /* Optimal block size for I/O. */
5053
51#ifndef __USE_FILE_OFFSET64
54# ifndef __USE_FILE_OFFSET64
5255 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
53#else
56# else
5457 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
55#endif
56#ifdef __USE_XOPEN2K8
58# endif
59# ifdef __USE_XOPEN2K8
5760 /* Nanosecond resolution timestamps are stored in a format
5861 equivalent to 'struct timespec'. This is the type used
5962 whenever possible but the Unix namespace rules do not allow the
......@@ -63,28 +66,32 @@ struct stat
6366 struct timespec st_atim; /* Time of last access. */
6467 struct timespec st_mtim; /* Time of last modification. */
6568 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
7073 __time_t st_atime; /* Time of last access. */
7174 unsigned long int st_atimensec; /* Nscecs of last access. */
7275 __time_t st_mtime; /* Time of last modification. */
7376 unsigned long int st_mtimensec; /* Nsecs of last modification. */
7477 __time_t st_ctime; /* Time of last status change. */
7578 unsigned long int st_ctimensec; /* Nsecs of last status change. */
76#endif
77#ifndef __USE_FILE_OFFSET64
79# endif
80# ifndef __USE_FILE_OFFSET64
7881 unsigned long int __glibc_reserved4;
7982 unsigned long int __glibc_reserved5;
80#else
83# else
8184 __ino64_t st_ino; /* File serial number. */
82#endif
85# endif
86#endif /* __USE_TIME_BITS64 */
8387 };
8488
8589#ifdef __USE_LARGEFILE64
8690struct stat64
8791 {
92# ifdef __USE_TIME_BITS64
93# include <bits/struct_stat_time64_helper.h>
94# else
8895 __dev_t st_dev; /* Device. */
8996 unsigned int __pad1;
9097
......@@ -99,7 +106,7 @@ struct stat64
99106 __blksize_t st_blksize; /* Optimal block size for I/O. */
100107
101108 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
102# ifdef __USE_XOPEN2K8
109# ifdef __USE_XOPEN2K8
103110 /* Nanosecond resolution timestamps are stored in a format
104111 equivalent to 'struct timespec'. This is the type used
105112 whenever possible but the Unix namespace rules do not allow the
......@@ -109,15 +116,16 @@ struct stat64
109116 struct timespec st_atim; /* Time of last access. */
110117 struct timespec st_mtim; /* Time of last modification. */
111118 struct timespec st_ctim; /* Time of last status change. */
112# else
119# else
113120 __time_t st_atime; /* Time of last access. */
114121 unsigned long int st_atimensec; /* Nscecs of last access. */
115122 __time_t st_mtime; /* Time of last modification. */
116123 unsigned long int st_mtimensec; /* Nsecs of last modification. */
117124 __time_t st_ctime; /* Time of last status change. */
118125 unsigned long int st_ctimensec; /* Nsecs of last status change. */
119# endif
126# endif
120127 __ino64_t st_ino; /* File serial number. */
128# endif /* __USE_TIME_BITS64 */
121129 };
122130#endif
123131
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 @@
11/* Copyright (C) 2011-2021 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
43
54 The GNU C Library is free software; you can redistribute it and/or
65 modify it under the terms of the GNU Lesser General Public
......@@ -24,18 +23,8 @@
2423#include <bits/types.h>
2524#include <bits/wordsize.h>
2625
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
3526#if defined __USE_FILE_OFFSET64
3627# define __field64(type, type64, name) type64 name
37#elif __WORDSIZE == 64 || __STATFS_MATCHES_STATFS64
38# define __field64(type, type64, name) type name
3928#elif __BYTE_ORDER == __LITTLE_ENDIAN
4029# define __field64(type, type64, name) \
4130 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
29struct __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 @@
99#define LIBANL_SO "libanl.so.1"
1010#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1111#define LIBCRYPT_SO "libcrypt.so.1"
12#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1213#define LIBC_SO "libc.so.6"
1314#define LIBDL_SO "libdl.so.2"
1415#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 @@
11/* Copyright (C) 2011-2021 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
43
54 The GNU C Library is free software; you can redistribute it and/or
65 modify it under the terms of the GNU Lesser General Public
......@@ -24,18 +23,8 @@
2423#include <bits/types.h>
2524#include <bits/wordsize.h>
2625
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
3526#if defined __USE_FILE_OFFSET64
3627# define __field64(type, type64, name) type64 name
37#elif __WORDSIZE == 64 || __STATFS_MATCHES_STATFS64
38# define __field64(type, type64, name) type name
3928#elif __BYTE_ORDER == __LITTLE_ENDIAN
4029# define __field64(type, type64, name) \
4130 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
29struct __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 @@
99#define LIBANL_SO "libanl.so.1"
1010#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1111#define LIBCRYPT_SO "libcrypt.so.1"
12#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1213#define LIBC_SO "libc.so.6"
1314#define LIBDL_SO "libdl.so.2"
1415#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),
193193extern int __REDIRECT_NTH (aio_cancel,
194194 (int __fildes, struct aiocb *__aiocbp),
195195 aio_cancel64);
196
196# ifdef __USE_TIME_BITS64
197extern 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
197202extern int __REDIRECT_NTH (aio_suspend,
198203 (const struct aiocb *const __list[], int __nent,
199204 const struct timespec *__restrict __timeout),
200205 aio_suspend64) __nonnull ((1));
201
206# endif
202207extern int __REDIRECT_NTH (aio_fsync,
203208 (int __operation, struct aiocb *__aiocbp),
204209 aio_fsync64) __nonnull ((2));
......@@ -210,7 +215,11 @@ extern int __REDIRECT_NTH (aio_fsync,
210215# define aio_error aio_error64
211216# define aio_return aio_return64
212217# 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
214223# define aio_fsync aio_fsync64
215224# endif
216225#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;
7474
7575/* Format a network number NET into presentation format and place result
7676 in buffer starting at BUF with length of LEN bytes. */
77extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW;
77extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW
78 __attribute_deprecated_msg__ ("Use inet_ntop instead");
7879
7980/* Convert network number for interface type AF in buffer starting at
8081 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 @@
5252#include <sys/types.h>
5353#include <stdint.h>
5454
55#ifdef _LIBC
56# define __NAMESER_DEPRECATED
57#else
58# define __NAMESER_DEPRECATED __attribute_deprecated__
59#endif
60
5561/*
5662 * Define constants based on RFC 883, RFC 1034, RFC 1035
5763 */
......@@ -401,14 +407,18 @@ int ns_skiprr (const unsigned char *, const unsigned char *,
401407int ns_parserr (ns_msg *, ns_sect, int, ns_rr *) __THROW;
402408int ns_sprintrr (const ns_msg *, const ns_rr *,
403409 const char *, const char *, char *, size_t)
404 __THROW;
410 __THROW __NAMESER_DEPRECATED;
405411int ns_sprintrrf (const unsigned char *, size_t, const char *,
406412 ns_class, ns_type, unsigned long,
407413 const unsigned char *, size_t, const char *,
408 const char *, char *, size_t) __THROW;
409int ns_format_ttl (unsigned long, char *, size_t) __THROW;
410int ns_parse_ttl (const char *, unsigned long *) __THROW;
411uint32_t ns_datetosecs (const char *, int *) __THROW;
414 const char *, char *, size_t)
415 __THROW __NAMESER_DEPRECATED;
416int ns_format_ttl (unsigned long, char *, size_t)
417 __THROW __NAMESER_DEPRECATED;
418int ns_parse_ttl (const char *, unsigned long *)
419 __THROW __NAMESER_DEPRECATED;
420uint32_t ns_datetosecs (const char *, int *)
421 __THROW __NAMESER_DEPRECATED;
412422int ns_name_ntol (const unsigned char *, unsigned char *, size_t)
413423 __THROW;
414424int ns_name_ntop (const unsigned char *, char *, size_t) __THROW;
......@@ -431,10 +441,15 @@ int ns_name_skip (const unsigned char **, const unsigned char *)
431441void ns_name_rollback (const unsigned char *,
432442 const unsigned char **,
433443 const unsigned char **) __THROW;
434int ns_samedomain (const char *, const char *) __THROW;
435int ns_subdomain (const char *, const char *) __THROW;
436int ns_makecanon (const char *, char *, size_t) __THROW;
437int ns_samename (const char *, const char *) __THROW;
444
445int ns_samedomain (const char *, const char *) __THROW
446 __NAMESER_DEPRECATED;
447int ns_subdomain (const char *, const char *) __THROW
448 __NAMESER_DEPRECATED;
449int ns_makecanon (const char *, char *, size_t) __THROW
450 __NAMESER_DEPRECATED;
451int ns_samename (const char *, const char *) __THROW
452 __NAMESER_DEPRECATED;
438453__END_DECLS
439454
440455#include <arpa/nameser_compat.h>
lib/libc/include/generic-glibc/bits/confname.h+7-1
......@@ -525,8 +525,14 @@ enum
525525
526526 _SC_THREAD_ROBUST_PRIO_INHERIT,
527527#define _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_INHERIT
528 _SC_THREAD_ROBUST_PRIO_PROTECT
528 _SC_THREAD_ROBUST_PRIO_PROTECT,
529529#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
530536 };
531537
532538/* 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.
22 Copyright (C) 2017-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
......@@ -16,10 +16,24 @@
1616 License along with the GNU C Library; if not, see
1717 <https://www.gnu.org/licenses/>. */
1818
19#ifndef _BITS_FLOATN_H
20#define _BITS_FLOATN_H
21
22#include <features.h>
23#include <bits/long-double.h>
24
1925/* 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
2337
2438/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
2539 from the default float, double and long double types in this glibc. */
......@@ -28,25 +42,56 @@
2842/* Defined to 1 if the current compiler invocation provides a
2943 floating-point type with the right format for _Float64x, and this
3044 glibc includes corresponding *f64x interfaces for it. */
31#define __HAVE_FLOAT64X 0
45#define __HAVE_FLOAT64X __HAVE_FLOAT128
3246
3347/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
3448 of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
3549 the format of _Float128, which must be different from that of long
3650 double. */
37#define __HAVE_FLOAT64X_LONG_DOUBLE 0
51#define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128
3852
3953#ifndef __ASSEMBLER__
4054
4155/* 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
4577
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
80typedef 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
4992
5093#endif /* !__ASSEMBLER__. */
5194
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 @@
4444
4545/* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__
4646 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.) */
4967#undef __GLIBC_USE_IEC_60559_BFP_EXT
5068#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_BFP_EXT__
5169# define __GLIBC_USE_IEC_60559_BFP_EXT 1
......@@ -58,6 +76,12 @@
5876#else
5977# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0
6078#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
6185
6286/* ISO/IEC TS 18661-4:2015 defines the
6387 __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 @@
7777 priority level. */
7878#define AIO_PRIO_DELTA_MAX 20
7979
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>
8282
8383/* Maximum number of timer expiration overruns. */
8484#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,
364364__MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
365365 unsigned int __width));
366366
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))))
367374/* Return value with maximum magnitude. */
368375__MATHCALLX (fmaxmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
369376
370377/* Return value with minimum magnitude. */
371378__MATHCALLX (fminmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
372
373/* Canonicalize floating-point representation. */
374__MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x));
375379#endif
376380
377#if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
381#if __GLIBC_USE (IEC_60559_EXT) || __MATH_DECLARING_FLOATN
378382/* Total order operation. */
379383__MATHDECL_1 (int, totalorder,, (const _Mdouble_ *__x,
380384 const _Mdouble_ *__y))
lib/libc/include/generic-glibc/bits/msq.h+1
......@@ -26,6 +26,7 @@ typedef __syscall_ulong_t msgqnum_t;
2626typedef __syscall_ulong_t msglen_t;
2727
2828#include <bits/types/struct_msqid_ds.h>
29#include <bits/types/struct_msqid64_ds.h>
2930
3031/* Define options for message queue functions. */
3132#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
23enum
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
36struct cpuid_feature
37{
38 unsigned int cpuid_array[4];
39 unsigned int active_array[4];
40};
41
42enum 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
52enum
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
2626extern int __REDIRECT (__poll_alias, (struct pollfd *__fds, nfds_t __nfds,
2727 int __timeout), poll);
2828extern 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));
3031extern int __REDIRECT (__poll_chk_warn, (struct pollfd *__fds, nfds_t __nfds,
3132 int __timeout, __SIZE_TYPE__ __fdslen),
3233 __poll_chk)
3334 __warnattr ("poll called with fds buffer too small file nfds entries");
3435
35__fortify_function int
36__fortify_function __attr_access ((__write_only__, 1, 2)) int
3637poll (struct pollfd *__fds, nfds_t __nfds, int __timeout)
3738{
3839 if (__glibc_objsize (__fds) != (__SIZE_TYPE__) -1)
......@@ -54,7 +55,8 @@ extern int __REDIRECT (__ppoll_alias, (struct pollfd *__fds, nfds_t __nfds,
5455 const __sigset_t *__ss), ppoll);
5556extern int __ppoll_chk (struct pollfd *__fds, nfds_t __nfds,
5657 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));
5860extern int __REDIRECT (__ppoll_chk_warn, (struct pollfd *__fds, nfds_t __nfds,
5961 const struct timespec *__timeout,
6062 const __sigset_t *__ss,
......@@ -62,7 +64,7 @@ extern int __REDIRECT (__ppoll_chk_warn, (struct pollfd *__fds, nfds_t __nfds,
6264 __ppoll_chk)
6365 __warnattr ("ppoll called with fds buffer too small file nfds entries");
6466
65__fortify_function int
67__fortify_function __attr_access ((__write_only__, 1, 2)) int
6668ppoll (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout,
6769 const __sigset_t *__ss)
6870{
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
24extern 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 @@
2222#include <sys/types.h>
2323#include <bits/timesize.h>
2424#include <bits/types/struct_semid_ds.h>
25#include <bits/types/struct_semid64_ds.h>
2526
2627/* Flags for `semop'. */
2728#define SEM_UNDO 0x1000 /* undo the operation on exit */
lib/libc/include/generic-glibc/bits/shm.h+1
......@@ -43,6 +43,7 @@ __BEGIN_DECLS
4343typedef __syscall_ulong_t shmatt_t;
4444
4545#include <bits/types/struct_shmid_ds.h>
46#include <bits/types/struct_shmid64_ds.h>
4647
4748#ifdef __USE_MISC
4849
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 @@
3232#define SO_OOBINLINE 10
3333#define SO_RCVBUF 8
3434#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
4135#define SO_REUSEADDR 2
4236#define SO_SNDBUF 7
4337#define SO_SNDLOWAT 19
38#define SO_TYPE 3
39
4440#if (__TIMESIZE == 64 && __WORDSIZE == 32 \
4541 && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
42# define SO_RCVTIMEO 66
4643# define SO_SNDTIMEO 67
44# define SO_TIMESTAMP 63
45# define SO_TIMESTAMPNS 64
46# define SO_TIMESTAMPING 65
4747#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.
22 Copyright (C) 2019-2021 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
......@@ -16,15 +16,8 @@
1616 License along with the GNU C Library; if not, see
1717 <http://www.gnu.org/licenses/>. */
1818
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
2821
2922struct __pthread_rwlock_arch_t
3023{
......@@ -34,28 +27,45 @@ struct __pthread_rwlock_arch_t
3427 unsigned int __writers_futex;
3528 unsigned int __pad3;
3629 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
3836 binary compatibility. */
39#if __BYTE_ORDER == __BIG_ENDIAN
37 unsigned int __flags;
38# else
39# if __BYTE_ORDER == __BIG_ENDIAN
4040 unsigned char __pad1;
4141 unsigned char __pad2;
4242 unsigned char __shared;
43 /* FLAGS must stay at this position in the structure to maintain
44 binary compatibility. */
4345 unsigned char __flags;
44#else
46# else
47 /* FLAGS must stay at this position in the structure to maintain
48 binary compatibility. */
4549 unsigned char __flags;
4650 unsigned char __shared;
4751 unsigned char __pad1;
4852 unsigned char __pad2;
49#endif
53# endif
5054 int __cur_writer;
55#endif
5156};
5257
53#if __BYTE_ORDER == __BIG_ENDIAN
58#if _MIPS_SIM == _ABI64
5459# 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
5661#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) \
5867 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0
68# endif
5969#endif
6070
6171#endif
\ No newline at end of file
lib/libc/include/generic-glibc/bits/struct_stat.h+50-39
......@@ -29,28 +29,31 @@
2929/* Structure describing file characteristics. */
3030struct stat
3131 {
32# ifdef __USE_TIME_BITS64
33# include <bits/struct_stat_time64_helper.h>
34# else
3235 unsigned long int st_dev;
3336 long int st_pad1[3];
34#ifndef __USE_FILE_OFFSET64
37# ifndef __USE_FILE_OFFSET64
3538 __ino_t st_ino; /* File serial number. */
36#else
39# else
3740 __ino64_t st_ino; /* File serial number. */
38#endif
41# endif
3942 __mode_t st_mode; /* File mode. */
4043 __nlink_t st_nlink; /* Link count. */
4144 __uid_t st_uid; /* User ID of the file's owner. */
4245 __gid_t st_gid; /* Group ID of the file's group.*/
4346 unsigned long int st_rdev; /* Device number, if device. */
44#ifndef __USE_FILE_OFFSET64
47# ifndef __USE_FILE_OFFSET64
4548 long int st_pad2[2];
4649 __off_t st_size; /* Size of file, in bytes. */
4750 /* SVR4 added this extra long to allow for expansion of off_t. */
4851 long int st_pad3;
49#else
52# else
5053 long int st_pad2[3];
5154 __off64_t st_size; /* Size of file, in bytes. */
52#endif
53#ifdef __USE_XOPEN2K8
55# endif
56# ifdef __USE_XOPEN2K8
5457 /* Nanosecond resolution timestamps are stored in a format
5558 equivalent to 'struct timespec'. This is the type used
5659 whenever possible but the Unix namespace rules do not allow the
......@@ -60,30 +63,34 @@ struct stat
6063 struct timespec st_atim; /* Time of last access. */
6164 struct timespec st_mtim; /* Time of last modification. */
6265 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
6770 __time_t st_atime; /* Time of last access. */
6871 unsigned long int st_atimensec; /* Nscecs of last access. */
6972 __time_t st_mtime; /* Time of last modification. */
7073 unsigned long int st_mtimensec; /* Nsecs of last modification. */
7174 __time_t st_ctime; /* Time of last status change. */
7275 unsigned long int st_ctimensec; /* Nsecs of last status change. */
73#endif
76# endif
7477 __blksize_t st_blksize; /* Optimal block size for I/O. */
75#ifndef __USE_FILE_OFFSET64
78# ifndef __USE_FILE_OFFSET64
7679 __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */
77#else
80# else
7881 long int st_pad4;
7982 __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
80#endif
83# endif
8184 long int st_pad5[14];
85# endif /* __USE_TIME_BITS64 */
8286 };
8387
84#ifdef __USE_LARGEFILE64
88# ifdef __USE_LARGEFILE64
8589struct stat64
8690 {
91# ifdef __USE_TIME_BITS64
92# include <bits/struct_stat_time64_helper.h>
93# else
8794 unsigned long int st_dev;
8895 long int st_pad1[3];
8996 __ino64_t st_ino; /* File serial number. */
......@@ -94,7 +101,7 @@ struct stat64
94101 unsigned long int st_rdev; /* Device number, if device. */
95102 long int st_pad2[3];
96103 __off64_t st_size; /* Size of file, in bytes. */
97# ifdef __USE_XOPEN2K8
104# ifdef __USE_XOPEN2K8
98105 /* Nanosecond resolution timestamps are stored in a format
99106 equivalent to 'struct timespec'. This is the type used
100107 whenever possible but the Unix namespace rules do not allow the
......@@ -104,44 +111,47 @@ struct stat64
104111 struct timespec st_atim; /* Time of last access. */
105112 struct timespec st_mtim; /* Time of last modification. */
106113 struct timespec st_ctim; /* Time of last status change. */
107# else
114# else
108115 __time_t st_atime; /* Time of last access. */
109116 unsigned long int st_atimensec; /* Nscecs of last access. */
110117 __time_t st_mtime; /* Time of last modification. */
111118 unsigned long int st_mtimensec; /* Nsecs of last modification. */
112119 __time_t st_ctime; /* Time of last status change. */
113120 unsigned long int st_ctimensec; /* Nsecs of last status change. */
114# endif
121# endif
115122 __blksize_t st_blksize; /* Optimal block size for I/O. */
116123 long int st_pad3;
117124 __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
118125 long int st_pad4[14];
126# endif /* __USE_TIME_BITS64 */
119127 };
120#endif
121#else
128# endif /* __USE_LARGEFILE64 */
129
130#else /* _MIPS_SIM != _ABIO32 */
131
122132struct stat
123133 {
124134 __dev_t st_dev;
125135 int st_pad1[3]; /* Reserved for st_dev expansion */
126#ifndef __USE_FILE_OFFSET64
136# ifndef __USE_FILE_OFFSET64
127137 __ino_t st_ino;
128#else
138# else
129139 __ino64_t st_ino;
130#endif
140# endif
131141 __mode_t st_mode;
132142 __nlink_t st_nlink;
133143 __uid_t st_uid;
134144 __gid_t st_gid;
135145 __dev_t st_rdev;
136#if !defined __USE_FILE_OFFSET64
146# if !defined __USE_FILE_OFFSET64
137147 unsigned int st_pad2[2]; /* Reserved for st_rdev expansion */
138148 __off_t st_size;
139149 int st_pad3;
140#else
150# else
141151 unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */
142152 __off64_t st_size;
143#endif
144#ifdef __USE_XOPEN2K8
153# endif
154# ifdef __USE_XOPEN2K8
145155 /* Nanosecond resolution timestamps are stored in a format
146156 equivalent to 'struct timespec'. This is the type used
147157 whenever possible but the Unix namespace rules do not allow the
......@@ -151,24 +161,24 @@ struct stat
151161 struct timespec st_atim; /* Time of last access. */
152162 struct timespec st_mtim; /* Time of last modification. */
153163 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
158168 __time_t st_atime; /* Time of last access. */
159169 unsigned long int st_atimensec; /* Nscecs of last access. */
160170 __time_t st_mtime; /* Time of last modification. */
161171 unsigned long int st_mtimensec; /* Nsecs of last modification. */
162172 __time_t st_ctime; /* Time of last status change. */
163173 unsigned long int st_ctimensec; /* Nsecs of last status change. */
164#endif
174# endif
165175 __blksize_t st_blksize;
166176 unsigned int st_pad4;
167#ifndef __USE_FILE_OFFSET64
177# ifndef __USE_FILE_OFFSET64
168178 __blkcnt_t st_blocks;
169#else
179# else
170180 __blkcnt64_t st_blocks;
171#endif
181# endif
172182 int st_pad5[14];
173183 };
174184
......@@ -185,7 +195,7 @@ struct stat64
185195 __dev_t st_rdev;
186196 unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */
187197 __off64_t st_size;
188# ifdef __USE_XOPEN2K8
198# ifdef __USE_XOPEN2K8
189199 /* Nanosecond resolution timestamps are stored in a format
190200 equivalent to 'struct timespec'. This is the type used
191201 whenever possible but the Unix namespace rules do not allow the
......@@ -195,20 +205,21 @@ struct stat64
195205 struct timespec st_atim; /* Time of last access. */
196206 struct timespec st_mtim; /* Time of last modification. */
197207 struct timespec st_ctim; /* Time of last status change. */
198# else
208# else
199209 __time_t st_atime; /* Time of last access. */
200210 unsigned long int st_atimensec; /* Nscecs of last access. */
201211 __time_t st_mtime; /* Time of last modification. */
202212 unsigned long int st_mtimensec; /* Nsecs of last modification. */
203213 __time_t st_ctime; /* Time of last status change. */
204214 unsigned long int st_ctimensec; /* Nsecs of last status change. */
205# endif
215# endif
206216 __blksize_t st_blksize;
207217 unsigned int st_pad3;
208218 __blkcnt64_t st_blocks;
209219 int st_pad4[14];
210220};
211221#endif
222
212223#endif
213224
214225/* 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 @@
11/* 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. */
33
44#ifndef _SYSCALL_H
55# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."
66#endif
77
8#define __GLIBC_LINUX_VERSION_CODE 330240
8#define __GLIBC_LINUX_VERSION_CODE 331008
99
1010#ifdef __NR_FAST_atomic_update
1111# define SYS_FAST_atomic_update __NR_FAST_atomic_update
......@@ -291,6 +291,10 @@
291291# define SYS_epoll_pwait __NR_epoll_pwait
292292#endif
293293
294#ifdef __NR_epoll_pwait2
295# define SYS_epoll_pwait2 __NR_epoll_pwait2
296#endif
297
294298#ifdef __NR_epoll_wait
295299# define SYS_epoll_wait __NR_epoll_wait
296300#endif
......@@ -803,6 +807,18 @@
803807# define SYS_kill __NR_kill
804808#endif
805809
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
806822#ifdef __NR_lchown
807823# define SYS_lchown __NR_lchown
808824#endif
......@@ -939,6 +955,10 @@
939955# define SYS_mount __NR_mount
940956#endif
941957
958#ifdef __NR_mount_setattr
959# define SYS_mount_setattr __NR_mount_setattr
960#endif
961
942962#ifdef __NR_move_mount
943963# define SYS_move_mount __NR_move_mount
944964#endif
lib/libc/include/generic-glibc/bits/time.h+10
......@@ -77,6 +77,16 @@ __BEGIN_DECLS
7777/* Tune a POSIX clock. */
7878extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW;
7979
80#ifdef __USE_TIME_BITS64
81# if defined(__REDIRECT_NTH)
82extern 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
8090__END_DECLS
8191#endif /* use GNU */
8292
lib/libc/include/generic-glibc/bits/timex.h+31
......@@ -25,6 +25,36 @@
2525
2626struct timex
2727{
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
2858 unsigned int modes; /* mode selector */
2959 __syscall_slong_t offset; /* time offset (usec) */
3060 __syscall_slong_t freq; /* frequency offset (scaled ppm) */
......@@ -51,6 +81,7 @@ struct timex
5181 int :32; int :32; int :32; int :32;
5282 int :32; int :32; int :32; int :32;
5383 int :32; int :32; int :32;
84# endif
5485};
5586
5687/* 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
26struct __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 @@
2020# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
2121#endif
2222
23#include <bits/types/time_t.h>
24
2325/* Structure of record for one message inside the kernel.
2426 The type `struct msg' is opaque. */
2527struct msqid_ds
2628{
29#ifdef __USE_TIME_BITS64
30# include <bits/types/struct_msqid64_ds_helper.h>
31#else
2732 struct ipc_perm msg_perm; /* structure describing operation permission */
28#if __TIMESIZE == 32
33# if __TIMESIZE == 32
2934 __time_t msg_stime; /* time of last msgsnd command */
3035 unsigned long int __msg_stime_high;
3136 __time_t msg_rtime; /* time of last msgsnd command */
3237 unsigned long int __msg_rtime_high;
3338 __time_t msg_ctime; /* time of last change */
3439 unsigned long int __msg_ctime_high;
35#else
40# else
3641 __time_t msg_stime; /* time of last msgsnd command */
3742 __time_t msg_rtime; /* time of last msgsnd command */
3843 __time_t msg_ctime; /* time of last change */
39#endif
44# endif
4045 __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
4146 msgqnum_t msg_qnum; /* number of messages currently on queue */
4247 msglen_t msg_qbytes; /* max number of bytes allowed on queue */
......@@ -44,4 +49,5 @@ struct msqid_ds
4449 __pid_t msg_lrpid; /* pid of last msgrcv() */
4550 __syscall_ulong_t __glibc_reserved4;
4651 __syscall_ulong_t __glibc_reserved5;
52#endif
4753};
\ 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
26struct __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 @@
2323/* Data structure describing a set of semaphores. */
2424struct semid_ds
2525{
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_semid64_ds_helper.h>
28#else
2629 struct ipc_perm sem_perm; /* operation permission struct */
27#if __TIMESIZE == 32
30# if __TIMESIZE == 32
2831 __time_t sem_otime; /* last semop() time */
2932 __syscall_ulong_t __sem_otime_high;
3033 __time_t sem_ctime; /* last time changed by semctl() */
3134 __syscall_ulong_t __sem_ctime_high;
32#else
35# else
3336 __time_t sem_otime;
3437 __time_t sem_ctime;
35#endif
38# endif
3639 __syscall_ulong_t sem_nsems; /* number of semaphores in set */
3740 __syscall_ulong_t __glibc_reserved3;
3841 __syscall_ulong_t __glibc_reserved4;
42#endif
3943};
\ 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
26struct __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 @@
2323/* Data structure describing a shared memory segment. */
2424struct shmid_ds
2525 {
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_shmid64_ds_helper.h>
28#else
2629 struct ipc_perm shm_perm; /* operation permission struct */
2730 size_t shm_segsz; /* size of segment in bytes */
28#if __TIMESIZE == 32
31# if __TIMESIZE == 32
2932 __time_t shm_atime; /* time of last shmat() */
3033 unsigned long int __shm_atime_high;
3134 __time_t shm_dtime; /* time of last shmdt() */
3235 unsigned long int __shm_dtime_high;
3336 __time_t shm_ctime; /* time of last change by shmctl() */
3437 unsigned long int __shm_ctime_high;
35#else
38# else
3639 __time_t shm_atime; /* time of last shmat() */
3740 __time_t shm_dtime; /* time of last shmdt() */
3841 __time_t shm_ctime; /* time of last change by shmctl() */
39#endif
42# endif
4043 __pid_t shm_cpid; /* pid of creator */
4144 __pid_t shm_lpid; /* pid of last shmop */
4245 shmatt_t shm_nattch; /* number of current attaches */
4346 __syscall_ulong_t __glibc_reserved5;
4447 __syscall_ulong_t __glibc_reserved6;
48#endif
4549 };
\ No newline at end of file
lib/libc/include/generic-glibc/bits/types/struct_timespec.h+6-1
......@@ -4,15 +4,20 @@
44
55#include <bits/types.h>
66#include <bits/endian.h>
7#include <bits/types/time_t.h>
78
89/* POSIX.1b structure for a time value. This is like a `struct timeval' but
910 has nanoseconds instead of microseconds. */
1011struct timespec
1112{
13#ifdef __USE_TIME_BITS64
14 __time64_t tv_sec; /* Seconds. */
15#else
1216 __time_t tv_sec; /* Seconds. */
17#endif
1318#if __WORDSIZE == 64 \
1419 || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \
15 || __TIMESIZE == 32
20 || (__TIMESIZE == 32 && !defined __USE_TIME_BITS64)
1621 __syscall_slong_t tv_nsec; /* Nanoseconds. */
1722#else
1823# if __BYTE_ORDER == __BIG_ENDIAN
lib/libc/include/generic-glibc/bits/types/struct_timeval.h+5
......@@ -7,7 +7,12 @@
77 microsecond but also has a range of years. */
88struct timeval
99{
10#ifdef __USE_TIME_BITS64
11 __time64_t tv_sec; /* Seconds. */
12 __suseconds64_t tv_usec; /* Microseconds. */
13#else
1014 __time_t tv_sec; /* Seconds. */
1115 __suseconds_t tv_usec; /* Microseconds. */
16#endif
1217};
1318#endif
\ No newline at end of file
lib/libc/include/generic-glibc/bits/types/time_t.h+4
......@@ -4,6 +4,10 @@
44#include <bits/types.h>
55
66/* Returned by `time'. */
7#ifdef __USE_TIME_BITS64
8typedef __time64_t time_t;
9#else
710typedef __time_t time_t;
11#endif
812
913#endif
\ No newline at end of file
lib/libc/include/generic-glibc/bits/unistd_ext.h+24-1
......@@ -33,4 +33,27 @@
3333 not detached and has not been joined. */
3434extern __pid_t gettid (void) __THROW;
3535
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). */
56extern 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.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -12,10 +12,20 @@
1212 Lesser General Public License for more details.
1313
1414 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
1616 <https://www.gnu.org/licenses/>. */
1717
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
2029#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
336336#define EM_BA2 202 /* Beyond BA2 */
337337#define EM_XCORE 203 /* XMOS xCORE */
338338#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 */
340341#define EM_KM32 210 /* KM211 KM32 */
341342#define EM_KMX32 211 /* KM211 KMX32 */
342343#define EM_EMX16 212 /* KM211 KMX16 */
......@@ -813,6 +814,10 @@ typedef struct
813814 address keys. */
814815#define NT_ARM_PACG_KEYS 0x408 /* ARM pointer authentication
815816 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. */
816821#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */
817822#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */
818823#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;
172172
173173 This function is a cancellation point and therefore not marked with
174174 __THROW. */
175#ifndef __USE_FILE_OFFSET64
175#ifndef __USE_TIME_BITS64
176# ifndef __USE_FILE_OFFSET64
176177extern int fcntl (int __fd, int __cmd, ...);
177#else
178# ifdef __REDIRECT
179extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64);
180178# else
181# define fcntl fcntl64
179# ifdef __REDIRECT
180extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64);
181# else
182# define fcntl fcntl64
183# endif
182184# endif
183#endif
184#ifdef __USE_LARGEFILE64
185# ifdef __USE_LARGEFILE64
185186extern int fcntl64 (int __fd, int __cmd, ...);
187# endif
188#else /* __USE_TIME_BITS64 */
189# ifdef __REDIRECT
190extern int __REDIRECT (fcntl, (int __fd, int __request, ...),
191 __fcntl_time64) __THROW;
192extern int __REDIRECT (fcntl64, (int __fd, int __request, ...),
193 __fcntl_time64) __THROW;
194# else
195extern int __fcntl_time64 (int __fd, int __request, ...) __THROW;
196# define fcntl64 __fcntl_time64
197# define fcntl __fcntl_time64
198# endif
186199#endif
187200
188201/* 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 @@
3333 Extensions to ISO C11 from TS 18661-4:2015.
3434 __STDC_WANT_IEC_60559_TYPES_EXT__
3535 Extensions to ISO C11 from TS 18661-3:2015.
36 __STDC_WANT_IEC_60559_EXT__
37 ISO C2X interfaces defined only in Annex F.
3638
3739 _POSIX_SOURCE IEEE Std 1003.1.
3840 _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
......@@ -48,6 +50,8 @@
4850 _LARGEFILE64_SOURCE Additional functionality from LFS for large files.
4951 _FILE_OFFSET_BITS=N Select default filesystem interface.
5052 _ATFILE_SOURCE Additional *at interfaces.
53 _DYNAMIC_STACK_SIZE_SOURCE Select correct (but non compile-time constant)
54 MINSIGSTKSZ, SIGSTKSZ and PTHREAD_STACK_MIN.
5155 _GNU_SOURCE All of the above, plus GNU extensions.
5256 _DEFAULT_SOURCE The default set of features (taking precedence over
5357 __STRICT_ANSI__).
......@@ -94,6 +98,8 @@
9498 __USE_FILE_OFFSET64 Define 64bit interface as default.
9599 __USE_MISC Define things from 4.3BSD or System V Unix.
96100 __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.
97103 __USE_GNU Define GNU extensions.
98104 __USE_FORTIFY_LEVEL Additional security measures used, according to level.
99105
......@@ -137,6 +143,7 @@
137143#undef __USE_FILE_OFFSET64
138144#undef __USE_MISC
139145#undef __USE_ATFILE
146#undef __USE_DYNAMIC_STACK_SIZE
140147#undef __USE_GNU
141148#undef __USE_FORTIFY_LEVEL
142149#undef __KERNEL_STRICT_NAMES
......@@ -213,6 +220,8 @@
213220# define _DEFAULT_SOURCE 1
214221# undef _ATFILE_SOURCE
215222# define _ATFILE_SOURCE 1
223# undef _DYNAMIC_STACK_SIZE_SOURCE
224# define _DYNAMIC_STACK_SIZE_SOURCE 1
216225#endif
217226
218227/* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined,
......@@ -380,6 +389,8 @@
380389# define __USE_FILE_OFFSET64 1
381390#endif
382391
392#include <features-time64.h>
393
383394#if defined _DEFAULT_SOURCE
384395# define __USE_MISC 1
385396#endif
......@@ -388,6 +399,10 @@
388399# define __USE_ATFILE 1
389400#endif
390401
402#ifdef _DYNAMIC_STACK_SIZE_SOURCE
403# define __USE_DYNAMIC_STACK_SIZE 1
404#endif
405
391406#ifdef _GNU_SOURCE
392407# define __USE_GNU 1
393408#endif
......@@ -462,7 +477,7 @@
462477/* Major and minor version number of the GNU C library package. Use
463478 these macros to test for features in specific releases. */
464479#define __GLIBC__ 2
465#define __GLIBC_MINOR__ 33
480#define __GLIBC_MINOR__ 34
466481
467482#define __GLIBC_PREREQ(maj, min) \
468483 ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
lib/libc/include/generic-glibc/fts.h+38-5
......@@ -187,6 +187,7 @@ FTSENT *fts_read (FTS *);
187187int fts_set (FTS *, FTSENT *, int) __THROW;
188188#else
189189# ifdef __REDIRECT
190# ifndef __USE_TIME_BITS64
190191FTSENT *__REDIRECT (fts_children, (FTS *, int), fts64_children);
191192int __REDIRECT (fts_close, (FTS *), fts64_close);
192193FTS *__REDIRECT (fts_open, (char * const *, int,
......@@ -194,21 +195,53 @@ FTS *__REDIRECT (fts_open, (char * const *, int,
194195 fts64_open);
195196FTSENT *__REDIRECT (fts_read, (FTS *), fts64_read);
196197int __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int), fts64_set);
198# else
199FTSENT *__REDIRECT (fts_children, (FTS *, int), __fts64_children_time64);
200int __REDIRECT (fts_close, (FTS *), __fts64_close_time64);
201FTS *__REDIRECT (fts_open, (char * const *, int,
202 int (*)(const FTSENT **, const FTSENT **)),
203 __fts64_open_time64);
204FTSENT *__REDIRECT (fts_read, (FTS *), __fts64_read_time64);
205int __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int),
206 __fts64_set_time64);
207# endif
197208# 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
203217# endif
204218#endif
205219#ifdef __USE_LARGEFILE64
220# ifndef __USE_TIME_BITS64
206221FTSENT64 *fts64_children (FTS64 *, int);
207222int fts64_close (FTS64 *);
208223FTS64 *fts64_open (char * const *, int,
209224 int (*)(const FTSENT64 **, const FTSENT64 **));
210225FTSENT64 *fts64_read (FTS64 *);
211226int fts64_set (FTS64 *, FTSENT64 *, int) __THROW;
227# else
228# ifdef __REDIRECT
229FTSENT *__REDIRECT (fts64_children, (FTS64 *, int), __fts64_children_time64);
230int __REDIRECT (fts64_close, (FTS64 *), __fts64_close_time64);
231FTS *__REDIRECT (fts64_open, (char * const *, int,
232 int (*)(const FTSENT64 **, const FTSENT64 **)),
233 __fts64_open_time64);
234FTSENT *__REDIRECT (fts64_read, (FTS64 *), __fts64_read_time64);
235int __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
212245#endif
213246__END_DECLS
214247
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)
137137 __nonnull ((1, 2));
138138#else
139139# ifdef __REDIRECT
140# ifndef __USE_TIME_BITS64
140141extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func,
141142 int __descriptors), ftw64) __nonnull ((1, 2));
143# else
144extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func,
145 int __descriptors), __ftw64_time64)
146 __nonnull ((1, 2));
147# endif
142148# else
143# define ftw ftw64
149# ifndef __USE_TIME_BITS64
150# define ftw ftw64
151# else
152# define ftw __ftw64_time64
153# endif
144154# endif
145155#endif
146156#ifdef __USE_LARGEFILE64
157# ifndef __USE_TIME_BITS64
147158extern int ftw64 (const char *__dir, __ftw64_func_t __func,
148159 int __descriptors) __nonnull ((1, 2));
160# else
161# ifdef __REDIRECT
162extern 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
149170#endif
150171
151172#ifdef __USE_XOPEN_EXTENDED
......@@ -159,16 +180,37 @@ extern int nftw (const char *__dir, __nftw_func_t __func, int __descriptors,
159180 int __flag) __nonnull ((1, 2));
160181# else
161182# ifdef __REDIRECT
183# ifndef __USE_TIME_BITS64
162184extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func,
163185 int __descriptors, int __flag), nftw64)
164186 __nonnull ((1, 2));
187# else
188extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func,
189 int __descriptors, int __flag), __nftw64_time64)
190 __nonnull ((1, 2));
191# endif
165192# else
166# define nftw nftw64
193# ifndef __USE_TIME_BITS64
194# define nftw nftw64
195# else
196# define nftw __nftw64_time64
197# endif
167198# endif
168199# endif
169200# ifdef __USE_LARGEFILE64
201# ifndef __USE_TIME_BITS64
170202extern int nftw64 (const char *__dir, __nftw64_func_t __func,
171203 int __descriptors, int __flag) __nonnull ((1, 2));
204# else
205# ifdef __REDIRECT
206extern 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
172214# endif
173215#endif
174216
lib/libc/include/generic-glibc/glob.h+28-6
......@@ -145,25 +145,47 @@ typedef struct
145145#if !defined __USE_FILE_OFFSET64
146146extern int glob (const char *__restrict __pattern, int __flags,
147147 int (*__errfunc) (const char *, int),
148 glob_t *__restrict __pglob) __THROW;
148 glob_t *__restrict __pglob) __THROWNL;
149149
150150/* Free storage allocated in PGLOB by a previous `glob' call. */
151151extern void globfree (glob_t *__pglob) __THROW;
152152#else
153extern 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
154extern 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
160extern void __REDIRECT_NTH (globfree, (glob_t *__pglob),
161 __globfree64_time64);
162# else
163extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern,
164 int __flags,
165 int (*__errfunc) (const char *, int),
166 glob_t *__restrict __pglob), glob64);
157167
158168extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64);
169# endif
159170#endif
160171
161172#ifdef __USE_LARGEFILE64
173# ifdef __USE_TIME_BITS64
174extern 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
180extern void __REDIRECT_NTH (globfree64, (glob64_t *__pglob),
181 __globfree64_time64);
182# else
162183extern int glob64 (const char *__restrict __pattern, int __flags,
163184 int (*__errfunc) (const char *, int),
164 glob64_t *__restrict __pglob) __THROW;
185 glob64_t *__restrict __pglob) __THROWNL;
165186
166187extern void globfree64 (glob64_t *__pglob) __THROW;
188# endif
167189#endif
168190
169191
lib/libc/include/generic-glibc/gnu/lib-names-32.h+1
......@@ -8,6 +8,7 @@
88#define LIBANL_SO "libanl.so.1"
99#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1010#define LIBCRYPT_SO "libcrypt.so.1"
11#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1112#define LIBC_SO "libc.so.6"
1213#define LIBDL_SO "libdl.so.2"
1314#define LIBGCC_S_SO "libgcc_s.so.1"
lib/libc/include/generic-glibc/gnu/lib-names-hard.h+1
......@@ -8,6 +8,7 @@
88#define LIBANL_SO "libanl.so.1"
99#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1010#define LIBCRYPT_SO "libcrypt.so.1"
11#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1112#define LIBC_SO "libc.so.6"
1213#define LIBDL_SO "libdl.so.2"
1314#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 @@
77#define LIBANL_SO "libanl.so.1"
88#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
99#define LIBCRYPT_SO "libcrypt.so.1"
10#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1011#define LIBC_SO "libc.so.6"
1112#define LIBDL_SO "libdl.so.2"
1213#define LIBGCC_S_SO "libgcc_s.so.1"
lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h+1
......@@ -7,6 +7,7 @@
77#define LIBANL_SO "libanl.so.1"
88#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
99#define LIBCRYPT_SO "libcrypt.so.1"
10#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1011#define LIBC_SO "libc.so.6"
1112#define LIBDL_SO "libdl.so.2"
1213#define LIBGCC_S_SO "libgcc_s.so.1"
lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h+1
......@@ -7,6 +7,7 @@
77#define LIBANL_SO "libanl.so.1"
88#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
99#define LIBCRYPT_SO "libcrypt.so.1"
10#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1011#define LIBC_SO "libc.so.6"
1112#define LIBDL_SO "libdl.so.2"
1213#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 @@
88#define LIBANL_SO "libanl.so.1"
99#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1010#define LIBCRYPT_SO "libcrypt.so.1"
11#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1112#define LIBC_SO "libc.so.6"
1213#define LIBDL_SO "libdl.so.2"
1314#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));
5656 the same pointer that was passed to it, aliasing needs to be allowed
5757 between objects pointed by the old and new pointers. */
5858extern 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;
6061
6162/* Free a block allocated by `malloc', `realloc' or `calloc'. */
6263extern void free (void *__ptr) __THROW;
6364
6465/* Allocate SIZE bytes allocated to ALIGNMENT bytes. */
6566extern 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;
6769
6870/* Allocate SIZE bytes on a page boundary. */
6971extern void *valloc (size_t __size) __THROW __attribute_malloc__
70 __attribute_alloc_size__ ((1)) __wur;
72 __attribute_alloc_size__ ((1)) __wur __attr_dealloc_free;
7173
7274/* Equivalent to valloc(minimum-page-that-holds(n)), that is, round up
7375 __size to nearest pagesize. */
74extern void *pvalloc (size_t __size) __THROW __attribute_malloc__ __wur;
75
76/* Underlying allocation function; successive calls should return
77 contiguous pieces of memory. */
78extern void *(*__morecore) (ptrdiff_t __size) __MALLOC_DEPRECATED;
79
80/* Default value of `__morecore'. */
81extern void *__default_morecore (ptrdiff_t __size)
82__THROW __attribute_malloc__ __MALLOC_DEPRECATED;
76extern void *pvalloc (size_t __size) __THROW __attribute_malloc__
77 __wur __attr_dealloc_free;
8378
8479/* SVID2/XPG mallinfo structure */
8580
......@@ -161,24 +156,5 @@ extern void malloc_stats (void) __THROW;
161156/* Output information about state of allocator to stream FP. */
162157extern int malloc_info (int __options, FILE *__fp) __THROW;
163158
164/* Hooks for debugging and user-defined versions. */
165extern void (*__MALLOC_HOOK_VOLATILE __free_hook) (void *__ptr,
166 const void *)
167__MALLOC_DEPRECATED;
168extern void *(*__MALLOC_HOOK_VOLATILE __malloc_hook)(size_t __size,
169 const void *)
170__MALLOC_DEPRECATED;
171extern void *(*__MALLOC_HOOK_VOLATILE __realloc_hook)(void *__ptr,
172 size_t __size,
173 const void *)
174__MALLOC_DEPRECATED;
175extern void *(*__MALLOC_HOOK_VOLATILE __memalign_hook)(size_t __alignment,
176 size_t __size,
177 const void *)
178__MALLOC_DEPRECATED;
179extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void)
180 __MALLOC_DEPRECATED;
181
182
183159__END_DECLS
184160#endif /* malloc.h */
\ No newline at end of file
lib/libc/include/generic-glibc/math.h+22-8
......@@ -104,7 +104,7 @@ __BEGIN_DECLS
104104# endif
105105#endif /* __USE_ISOC99 */
106106
107#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
107#if __GLIBC_USE (IEC_60559_BFP_EXT)
108108/* Signaling NaN macros, if supported. */
109109# if __GNUC_PREREQ (3, 3)
110110# define SNANF (__builtin_nansf (""))
......@@ -112,25 +112,39 @@ __BEGIN_DECLS
112112# define SNANL (__builtin_nansl (""))
113113# endif
114114#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)))
116118# define SNANF16 (__builtin_nansf16 (""))
117119#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)))
119123# define SNANF32 (__builtin_nansf32 (""))
120124#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)))
122128# define SNANF64 (__builtin_nansf64 (""))
123129#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)))
125133# define SNANF128 (__builtin_nansf128 (""))
126134#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)))
128138# define SNANF32X (__builtin_nansf32x (""))
129139#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)))
131143# define SNANF64X (__builtin_nansf64x (""))
132144#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)))
134148# define SNANF128X (__builtin_nansf128x (""))
135149#endif
136150
lib/libc/include/generic-glibc/monetary.h+4-2
......@@ -37,7 +37,8 @@ __BEGIN_DECLS
3737/* Formatting a monetary value according to the current locale. */
3838extern ssize_t strfmon (char *__restrict __s, size_t __maxsize,
3939 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));
4142
4243#ifdef __USE_XOPEN2K8
4344/* POSIX.1-2008 extended locale interface (see locale.h). */
......@@ -47,7 +48,8 @@ extern ssize_t strfmon (char *__restrict __s, size_t __maxsize,
4748extern ssize_t strfmon_l (char *__restrict __s, size_t __maxsize,
4849 locale_t __loc,
4950 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));
5153#endif
5254
5355#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,
7171 unsigned int __msg_prio) __nonnull ((2));
7272
7373#ifdef __USE_XOPEN2K
74# ifndef __USE_TIME_BITS64
7475/* Receive the oldest from highest priority messages in message queue
7576 MQDES, stop waiting if ABS_TIMEOUT expires. */
7677extern 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,
8586 size_t __msg_len, unsigned int __msg_prio,
8687 const struct timespec *__abs_timeout)
8788 __nonnull ((2, 5));
89# else
90# ifdef __REDIRECT
91extern 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
99extern 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
88110#endif
89111
90112/* Define some inlines helping to catch common problems. */
lib/libc/include/generic-glibc/net/if.h+3-1
......@@ -191,7 +191,9 @@ __BEGIN_DECLS
191191
192192/* Convert an interface name to an index, and vice versa. */
193193extern unsigned int if_nametoindex (const char *__ifname) __THROW;
194extern char *if_indextoname (unsigned int __ifindex, char *__ifname) __THROW;
194extern char *if_indextoname (unsigned int __ifindex,
195 char __ifname[IF_NAMESIZE]) __THROW
196 __attr_access ((__write_only__, 2));
195197
196198/* Return a list of all interfaces and their indices. */
197199extern 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],
701701extern int gai_suspend (const struct gaicb *const __list[], int __ent,
702702 const struct timespec *__timeout);
703703
704# ifdef __USE_TIME_BITS64
705# if defined(__REDIRECT)
706extern 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
704715/* Get the error status of the request REQ. */
705716extern int gai_error (struct gaicb *__req) __THROW;
706717
lib/libc/include/generic-glibc/netinet/icmp6.h+2
......@@ -69,6 +69,8 @@ struct icmp6_hdr
6969#define MLD_LISTENER_QUERY 130
7070#define MLD_LISTENER_REPORT 131
7171#define MLD_LISTENER_REDUCTION 132
72#define ICMPV6_EXT_ECHO_REQUEST 160
73#define ICMPV6_EXT_ECHO_REPLY 161
7274
7375#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */
7476#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
8989#define ICMP_EXC_TTL 0 /* TTL count exceeded */
9090#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */
9191
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
92110
93111#ifdef __USE_MISC
94112/*
lib/libc/include/generic-glibc/nss.h+1-1
......@@ -196,7 +196,7 @@ typedef enum nss_status nss_setspent (int);
196196 extern nss_endgrent _nss_##module##_endgrent; \
197197 extern nss_endhostent _nss_##module##_endhostent; \
198198 extern nss_endnetent _nss_##module##_endnetent; \
199 extern nss_endnetgrent _nss_##module##__endnetgrent; \
199 extern nss_endnetgrent _nss_##module##_endnetgrent; \
200200 extern nss_endprotoent _nss_##module##_endprotoent; \
201201 extern nss_endpwent _nss_##module##_endpwent; \
202202 extern nss_endrpcent _nss_##module##_endrpcent; \
lib/libc/include/generic-glibc/pthread.h+157-15
......@@ -29,7 +29,9 @@
2929#include <bits/types/struct_timespec.h>
3030#include <bits/types/__sigset_t.h>
3131#include <bits/types/struct___jmp_buf_tag.h>
32
32#ifdef __USE_MISC
33# include <bits/pthread_stack_min-dynamic.h>
34#endif
3335
3436/* Detach state. */
3537enum
......@@ -221,6 +223,7 @@ extern int pthread_join (pthread_t __th, void **__thread_return);
221223 the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */
222224extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW;
223225
226# ifndef __USE_TIME_BITS64
224227/* Make calling thread wait for termination of the thread TH, but only
225228 until TIMEOUT. The exit status of the thread is stored in
226229 *THREAD_RETURN, if THREAD_RETURN is not NULL.
......@@ -240,6 +243,23 @@ extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return,
240243extern int pthread_clockjoin_np (pthread_t __th, void **__thread_return,
241244 clockid_t __clockid,
242245 const struct timespec *__abstime);
246# else
247# ifdef __REDIRECT
248extern int __REDIRECT (pthread_timedjoin_np,
249 (pthread_t __th, void **__thread_return,
250 const struct timespec *__abstime),
251 __pthread_timedjoin_np64);
252
253extern 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
243263#endif
244264
245265/* Indicate that the thread TH is never to be joined with PTHREAD_JOIN.
......@@ -454,11 +474,14 @@ extern int pthread_setconcurrency (int __level) __THROW;
454474#endif
455475
456476#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. */
461477extern int pthread_yield (void) __THROW;
478# ifdef __REDIRECT_NTH
479extern int __REDIRECT_NTH (pthread_yield, (void), sched_yield)
480 __attribute_deprecated_msg__ ("\
481pthread_yield is deprecated, use sched_yield instead");
482# else
483# define pthread_yield sched_yield
484# endif
462485
463486
464487/* Limit specified thread TH to run only on the processors represented
......@@ -773,16 +796,39 @@ extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
773796
774797#ifdef __USE_XOPEN2K
775798/* Wait until lock becomes available, or specified time passes. */
799# ifndef __USE_TIME_BITS64
776800extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
777801 const struct timespec *__restrict
778802 __abstime) __THROWNL __nonnull ((1, 2));
803# else
804# ifdef __REDIRECT_NTHNL
805extern 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
779813#endif
780814
781815#ifdef __USE_GNU
816# ifndef __USE_TIME_BITS64
782817extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex,
783818 clockid_t __clockid,
784819 const struct timespec *__restrict
785820 __abstime) __THROWNL __nonnull ((1, 3));
821# else
822# ifdef __REDIRECT_NTHNL
823extern 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
786832#endif
787833
788834/* Unlock a mutex. */
......@@ -809,8 +855,14 @@ extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
809855extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
810856 __THROW __nonnull ((1));
811857# ifdef __USE_GNU
812extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
813 __THROW __nonnull ((1));
858# ifdef __REDIRECT_NTH
859extern int __REDIRECT_NTH (pthread_mutex_consistent_np, (pthread_mutex_t *),
860 pthread_mutex_consistent) __nonnull ((1))
861 __attribute_deprecated_msg__ ("\
862pthread_mutex_consistent_np is deprecated, use pthread_mutex_consistent");
863# else
864# define pthread_mutex_consistent_np pthread_mutex_consistent
865# endif
814866# endif
815867#endif
816868
......@@ -879,9 +931,15 @@ extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr,
879931 int *__robustness)
880932 __THROW __nonnull ((1, 2));
881933# ifdef __USE_GNU
882extern int pthread_mutexattr_getrobust_np (const pthread_mutexattr_t *__attr,
883 int *__robustness)
884 __THROW __nonnull ((1, 2));
934# ifdef __REDIRECT_NTH
935extern int __REDIRECT_NTH (pthread_mutexattr_getrobust_np,
936 (pthread_mutex_t *, int *),
937 pthread_mutexattr_getrobust) __nonnull ((1))
938 __attribute_deprecated_msg__ ("\
939pthread_mutexattr_getrobust_np is deprecated, use pthread_mutexattr_getrobust");
940# else
941# define pthread_mutexattr_getrobust_np pthread_mutexattr_getrobust
942# endif
885943# endif
886944
887945/* Set the robustness flag of the mutex attribute ATTR. */
......@@ -889,13 +947,18 @@ extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
889947 int __robustness)
890948 __THROW __nonnull ((1));
891949# ifdef __USE_GNU
892extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
893 int __robustness)
894 __THROW __nonnull ((1));
950# ifdef __REDIRECT_NTH
951extern int __REDIRECT_NTH (pthread_mutexattr_setrobust_np,
952 (pthread_mutex_t *, int),
953 pthread_mutexattr_setrobust) __nonnull ((1))
954 __attribute_deprecated_msg__ ("\
955pthread_mutexattr_setrobust_np is deprecated, use pthread_mutexattr_setrobust");
956# else
957# define pthread_mutexattr_setrobust_np pthread_mutexattr_setrobust
958# endif
895959# endif
896960#endif
897961
898
899962#if defined __USE_UNIX98 || defined __USE_XOPEN2K
900963/* Functions for handling read-write locks. */
901964
......@@ -919,16 +982,41 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
919982
920983# ifdef __USE_XOPEN2K
921984/* Try to acquire read lock for RWLOCK or return after specfied time. */
985# ifndef __USE_TIME_BITS64
922986extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
923987 const struct timespec *__restrict
924988 __abstime) __THROWNL __nonnull ((1, 2));
989# else
990# ifdef __REDIRECT_NTHNL
991extern 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
9251000# endif
9261001
9271002# ifdef __USE_GNU
1003# ifndef __USE_TIME_BITS64
9281004extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock,
9291005 clockid_t __clockid,
9301006 const struct timespec *__restrict
9311007 __abstime) __THROWNL __nonnull ((1, 3));
1008# else
1009# ifdef __REDIRECT_NTHNL
1010extern 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
9321020# endif
9331021
9341022/* Acquire write lock for RWLOCK. */
......@@ -941,16 +1029,42 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
9411029
9421030# ifdef __USE_XOPEN2K
9431031/* Try to acquire write lock for RWLOCK or return after specfied time. */
1032# ifndef __USE_TIME_BITS64
9441033extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
9451034 const struct timespec *__restrict
9461035 __abstime) __THROWNL __nonnull ((1, 2));
1036# else
1037# ifdef __REDIRECT_NTHNL
1038extern 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
9471047# endif
9481048
9491049# ifdef __USE_GNU
1050# ifndef __USE_TIME_BITS64
9501051extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock,
9511052 clockid_t __clockid,
9521053 const struct timespec *__restrict
9531054 __abstime) __THROWNL __nonnull ((1, 3));
1055
1056# else
1057# ifdef __REDIRECT_NTHNL
1058extern 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
9541068# endif
9551069
9561070/* Unlock RWLOCK. */
......@@ -1027,10 +1141,23 @@ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
10271141
10281142 This function is a cancellation point and therefore not marked with
10291143 __THROW. */
1144# ifndef __USE_TIME_BITS64
10301145extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
10311146 pthread_mutex_t *__restrict __mutex,
10321147 const struct timespec *__restrict __abstime)
10331148 __nonnull ((1, 2, 3));
1149# else
1150# ifdef __REDIRECT
1151extern 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
10341161
10351162# ifdef __USE_GNU
10361163/* 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,
10401167
10411168 This function is a cancellation point and therefore not marked with
10421169 __THROW. */
1170# ifndef __USE_TIME_BITS64
10431171extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond,
10441172 pthread_mutex_t *__restrict __mutex,
10451173 __clockid_t __clock_id,
10461174 const struct timespec *__restrict __abstime)
10471175 __nonnull ((1, 2, 4));
1176# else
1177# ifdef __REDIRECT
1178extern 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
10481189# endif
10491190
10501191/* Functions for handling condition variable attributes. */
......@@ -1165,7 +1306,8 @@ extern void *pthread_getspecific (pthread_key_t __key) __THROW;
11651306
11661307/* Store POINTER in the thread-specific data slot identified by KEY. */
11671308extern int pthread_setspecific (pthread_key_t __key,
1168 const void *__pointer) __THROW ;
1309 const void *__pointer)
1310 __THROW __attr_access_none (2);
11691311
11701312
11711313#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));
139139extern int getpwent_r (struct passwd *__restrict __resultbuf,
140140 char *__restrict __buffer, size_t __buflen,
141141 struct passwd **__restrict __result)
142 __nonnull ((1, 2, 4));
142 __nonnull ((1, 2, 4))
143 __attr_access ((__write_only__, 2, 3));
143144# endif
144145
145146extern int getpwuid_r (__uid_t __uid,
146147 struct passwd *__restrict __resultbuf,
147148 char *__restrict __buffer, size_t __buflen,
148149 struct passwd **__restrict __result)
149 __nonnull ((2, 3, 5));
150 __nonnull ((2, 3, 5))
151 __attr_access ((__write_only__, 3, 4));
150152
151153extern int getpwnam_r (const char *__restrict __name,
152154 struct passwd *__restrict __resultbuf,
153155 char *__restrict __buffer, size_t __buflen,
154156 struct passwd **__restrict __result)
155 __nonnull ((1, 2, 3, 5));
157 __nonnull ((1, 2, 3, 5))
158 __attr_access ((__write_only__, 3, 4));
156159
157160
158161# ifdef __USE_MISC
......@@ -167,7 +170,8 @@ extern int fgetpwent_r (FILE *__restrict __stream,
167170 struct passwd *__restrict __resultbuf,
168171 char *__restrict __buffer, size_t __buflen,
169172 struct passwd **__restrict __result)
170 __nonnull ((1, 2, 3, 5));
173 __nonnull ((1, 2, 3, 5))
174 __attr_access ((__write_only__, 3, 4));
171175# endif
172176
173177#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);
536536 'regcomp', with a malloc'ed value, or set to NULL before calling
537537 'regfree'. */
538538extern 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));
540541
541542
542543/* 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);
553554extern regoff_t re_search (struct re_pattern_buffer *__buffer,
554555 const char *__String, regoff_t __length,
555556 regoff_t __start, regoff_t __range,
556 struct re_registers *__regs);
557 struct re_registers *__regs)
558 __attr_access ((__read_only__, 2, 3));
557559
558560
559561/* 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,
563565 const char *__string2, regoff_t __length2,
564566 regoff_t __start, regoff_t __range,
565567 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));
567571
568572
569573/* Like 're_search', but return how many characters in STRING the regexp
570574 in BUFFER matched, starting at position START. */
571575extern regoff_t re_match (struct re_pattern_buffer *__buffer,
572576 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));
574579
575580
576581/* 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,
578583 const char *__string1, regoff_t __length1,
579584 const char *__string2, regoff_t __length2,
580585 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));
582589
583590
584591/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
......@@ -648,10 +655,12 @@ extern int regcomp (regex_t *_Restrict_ __preg,
648655extern int regexec (const regex_t *_Restrict_ __preg,
649656 const char *_Restrict_ __String, size_t __nmatch,
650657 regmatch_t __pmatch[_Restrict_arr_],
651 int __eflags);
658 int __eflags)
659 __attr_access ((__write_only__, 4, 3));
652660
653661extern 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));
655664
656665extern void regfree (regex_t *__preg);
657666
lib/libc/include/generic-glibc/resolv.h+55-48
......@@ -168,20 +168,28 @@ __END_DECLS
168168#define res_close __res_close
169169#define res_init __res_init
170170#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
176179
177180__BEGIN_DECLS
178void fp_nquery (const unsigned char *, int, FILE *) __THROW;
179void fp_query (const unsigned char *, FILE *) __THROW;
180const char * hostalias (const char *) __THROW;
181void p_query (const unsigned char *) __THROW;
181void fp_nquery (const unsigned char *, int, FILE *) __THROW
182 __RESOLV_DEPRECATED;
183void fp_query (const unsigned char *, FILE *) __THROW
184 __RESOLV_DEPRECATED;
185const char * hostalias (const char *) __THROW
186 __RESOLV_DEPRECATED_MSG ("use getaddrinfo instead");
187void p_query (const unsigned char *) __THROW
188 __RESOLV_DEPRECATED;
182189void res_close (void) __THROW;
183190int res_init (void) __THROW;
184int res_isourserver (const struct sockaddr_in *) __THROW;
191int res_isourserver (const struct sockaddr_in *) __THROW
192 __RESOLV_DEPRECATED;
185193int res_mkquery (int, const char *, int, int,
186194 const unsigned char *, int, const unsigned char *,
187195 unsigned char *, int) __THROW;
......@@ -197,10 +205,7 @@ __END_DECLS
197205
198206#define b64_ntop __b64_ntop
199207#define b64_pton __b64_pton
200#define dn_comp __dn_comp
201208#define dn_count_labels __dn_count_labels
202#define dn_expand __dn_expand
203#define dn_skipname __dn_skipname
204209#define fp_resstat __fp_resstat
205210#define loc_aton __loc_aton
206211#define loc_ntoa __loc_ntoa
......@@ -215,19 +220,10 @@ __END_DECLS
215220#define p_rcode __p_rcode
216221#define putlong __putlong
217222#define putshort __putshort
218#define res_dnok __res_dnok
219#define res_hnok __res_hnok
220223#define res_hostalias __res_hostalias
221#define res_mailok __res_mailok
222224#define res_nameinquery __res_nameinquery
223225#define res_nclose __res_nclose
224226#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
231227#define res_queriesmatch __res_queriesmatch
232228#define res_randomid __res_randomid
233229#define sym_ntop __sym_ntop
......@@ -238,50 +234,61 @@ int res_hnok (const char *) __THROW;
238234int res_ownok (const char *) __THROW;
239235int res_mailok (const char *) __THROW;
240236int res_dnok (const char *) __THROW;
241int sym_ston (const struct res_sym *, const char *, int *) __THROW;
242const char * sym_ntos (const struct res_sym *, int, int *) __THROW;
243const char * sym_ntop (const struct res_sym *, int, int *) __THROW;
237int sym_ston (const struct res_sym *, const char *, int *) __THROW
238 __RESOLV_DEPRECATED;
239const char * sym_ntos (const struct res_sym *, int, int *) __THROW
240 __RESOLV_DEPRECATED;
241const char * sym_ntop (const struct res_sym *, int, int *) __THROW
242 __RESOLV_DEPRECATED;
244243int b64_ntop (const unsigned char *, size_t, char *, size_t)
245 __THROW;
244 __THROW;
246245int b64_pton (char const *, unsigned char *, size_t) __THROW;
247int loc_aton (const char *__ascii, unsigned char *__binary) __THROW;
248const char * loc_ntoa (const unsigned char *__binary, char *__ascii) __THROW;
246int loc_aton (const char *__ascii, unsigned char *__binary) __THROW
247 __RESOLV_DEPRECATED;
248const char * loc_ntoa (const unsigned char *__binary, char *__ascii) __THROW
249 __RESOLV_DEPRECATED;
249250int dn_skipname (const unsigned char *, const unsigned char *)
250 __THROW;
251void putlong (uint32_t, unsigned char *) __THROW;
252void putshort (uint16_t, unsigned char *) __THROW;
253const char * p_class (int) __THROW;
254const char * p_time (uint32_t) __THROW;
255const char * p_type (int) __THROW;
256const char * p_rcode (int) __THROW;
257const unsigned char * p_cdnname (const unsigned char *,
258 const unsigned char *, int, FILE *) __THROW;
251 __THROW;
252void putlong (uint32_t, unsigned char *) __THROW
253 __RESOLV_DEPRECATED_MSG ("use NS_PUT16 instead");
254void putshort (uint16_t, unsigned char *) __THROW
255 __RESOLV_DEPRECATED_MSG ("use NS_PUT32 instead");
256const char * p_class (int) __THROW __RESOLV_DEPRECATED;
257const char * p_time (uint32_t) __THROW __RESOLV_DEPRECATED;
258const char * p_type (int) __THROW __RESOLV_DEPRECATED;
259const char * p_rcode (int) __THROW __RESOLV_DEPRECATED;
260const unsigned char * p_cdnname (const unsigned char *, const unsigned char *,
261 int, FILE *) __THROW __RESOLV_DEPRECATED;
259262const unsigned char * p_cdname (const unsigned char *, const unsigned char *,
260 FILE *) __THROW;
263 FILE *) __THROW __RESOLV_DEPRECATED;
261264const unsigned char * p_fqnname (const unsigned char *__cp,
262265 const unsigned char *__msg,
263 int, char *, int) __THROW;
264const unsigned char * p_fqname (const unsigned char *,
265 const unsigned char *, FILE *) __THROW;
266const char * p_option (unsigned long __option) __THROW;
267int dn_count_labels (const char *) __THROW;
266 int, char *, int) __THROW __RESOLV_DEPRECATED;
267const unsigned char * p_fqname (const unsigned char *, const unsigned char *,
268 FILE *) __THROW __RESOLV_DEPRECATED;
269const char * p_option (unsigned long __option) __THROW __RESOLV_DEPRECATED;
270int dn_count_labels (const char *) __THROW __RESOLV_DEPRECATED;
268271int dn_comp (const char *, unsigned char *, int, unsigned char **,
269272 unsigned char **) __THROW;
270273int dn_expand (const unsigned char *, const unsigned char *,
271274 const unsigned char *, char *, int) __THROW;
272unsigned int res_randomid (void) __THROW;
275unsigned int res_randomid (void) __THROW
276 __RESOLV_DEPRECATED_MSG ("use getentropy instead");
273277int res_nameinquery (const char *, int, int,
274278 const unsigned char *,
275 const unsigned char *) __THROW;
279 const unsigned char *) __THROW
280 __RESOLV_DEPRECATED;
276281int res_queriesmatch (const unsigned char *,
277282 const unsigned char *,
278283 const unsigned char *,
279 const unsigned char *) __THROW;
284 const unsigned char *) __THROW
285 __RESOLV_DEPRECATED;
280286/* Things involving a resolver context. */
281287int res_ninit (res_state) __THROW;
282void fp_resstat (const res_state, FILE *) __THROW;
288void fp_resstat (const res_state, FILE *) __THROW
289 __RESOLV_DEPRECATED;
283290const char * res_hostalias (const res_state, const char *, char *, size_t)
284 __THROW;
291 __THROW __RESOLV_DEPRECATED_MSG ("use getaddrinfo instead");
285292int res_nquery (res_state, const char *, int, int,
286293 unsigned char *, int) __THROW;
287294int 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;
7474extern int sched_get_priority_min (int __algorithm) __THROW;
7575
7676/* Get the SCHED_RR interval for the named process. */
77#ifndef __USE_TIME_BITS64
7778extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW;
78
79#else
80# ifdef __REDIRECT_NTH
81extern 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
7988
8089#ifdef __USE_GNU
8190/* 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));
5959
6060 This function is a cancellation point and therefore not marked with
6161 __THROW. */
62# ifndef __USE_TIME_BITS64
6263extern int sem_timedwait (sem_t *__restrict __sem,
6364 const struct timespec *__restrict __abstime)
6465 __nonnull ((1, 2));
66# else
67# ifdef __REDIRECT
68extern 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
6577#endif
6678
6779#ifdef __USE_GNU
80# ifndef __USE_TIME_BITS64
6881extern int sem_clockwait (sem_t *__restrict __sem,
6982 clockid_t clock,
7083 const struct timespec *__restrict __abstime)
7184 __nonnull ((1, 3));
85# else
86# ifdef __REDIRECT
87extern 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
7297#endif
7398
7499/* 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,
269269
270270 This function is a cancellation point and therefore not marked with
271271 __THROW. */
272# ifndef __USE_TIME_BITS64
272273extern int sigtimedwait (const sigset_t *__restrict __set,
273274 siginfo_t *__restrict __info,
274275 const struct timespec *__restrict __timeout)
275276 __nonnull ((1));
277# else
278# ifdef __REDIRECT
279extern 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
276289
277290/* Send signal SIG to the process PID. Associate data in VAL with the
278291 signal. */
......@@ -312,6 +325,7 @@ extern int siginterrupt (int __sig, int __interrupt) __THROW
312325 __attribute_deprecated_msg__ ("Use sigaction with SA_RESTART instead");
313326
314327# include <bits/sigstack.h>
328# include <bits/sigstksz.h>
315329# include <bits/ss_flags.h>
316330
317331/* 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 *
213213extern int posix_spawn_file_actions_addfchdir_np (posix_spawn_file_actions_t *,
214214 int __fd)
215215 __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. */
219extern int
220posix_spawn_file_actions_addclosefrom_np (posix_spawn_file_actions_t *,
221 int __from)
222 __THROW __nonnull ((1));
223
216224#endif
217225
218226__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,
165165 const char *__new, unsigned int __flags) __THROW;
166166#endif
167167
168/* Close STREAM.
169
170 This function is a possible cancellation point and therefore not
171 marked with __THROW. */
172extern int fclose (FILE *__stream);
173
174#undef __attr_dealloc_fclose
175#define __attr_dealloc_fclose __attr_dealloc (fclose, 1)
176
168177/* Create a temporary file and open it read/write.
169178
170179 This function is a possible cancellation point and therefore not
171180 marked with __THROW. */
172181#ifndef __USE_FILE_OFFSET64
173extern FILE *tmpfile (void) __wur;
182extern FILE *tmpfile (void)
183 __attribute_malloc__ __attr_dealloc_fclose __wur;
174184#else
175185# ifdef __REDIRECT
176extern FILE *__REDIRECT (tmpfile, (void), tmpfile64) __wur;
186extern FILE *__REDIRECT (tmpfile, (void), tmpfile64)
187 __attribute_malloc__ __attr_dealloc_fclose __wur;
177188# else
178189# define tmpfile tmpfile64
179190# endif
180191#endif
181192
182193#ifdef __USE_LARGEFILE64
183extern FILE *tmpfile64 (void) __wur;
194extern FILE *tmpfile64 (void)
195 __attribute_malloc__ __attr_dealloc_fclose __wur;
184196#endif
185197
186198/* Generate a temporary filename. */
187extern char *tmpnam (char *__s) __THROW __wur;
199extern char *tmpnam (char[L_tmpnam]) __THROW __wur;
188200
189201#ifdef __USE_MISC
190202/* This is the reentrant variant of `tmpnam'. The only difference is
191203 that it does not allow S to be NULL. */
192extern char *tmpnam_r (char *__s) __THROW __wur;
204extern char *tmpnam_r (char __s[L_tmpnam]) __THROW __wur;
193205#endif
194206
195207
......@@ -202,15 +214,9 @@ extern char *tmpnam_r (char *__s) __THROW __wur;
202214 P_tmpdir is tried and finally "/tmp". The storage for the filename
203215 is allocated by `malloc'. */
204216extern char *tempnam (const char *__dir, const char *__pfx)
205 __THROW __attribute_malloc__ __wur;
217 __THROW __attribute_malloc__ __wur __attr_dealloc_free;
206218#endif
207219
208
209/* Close STREAM.
210
211 This function is a possible cancellation point and therefore not
212 marked with __THROW. */
213extern int fclose (FILE *__stream);
214220/* Flush STREAM, or all streams if STREAM is NULL.
215221
216222 This function is a possible cancellation point and therefore not
......@@ -244,7 +250,8 @@ extern int fcloseall (void);
244250 This function is a possible cancellation point and therefore not
245251 marked with __THROW. */
246252extern FILE *fopen (const char *__restrict __filename,
247 const char *__restrict __modes) __wur;
253 const char *__restrict __modes)
254 __attribute_malloc__ __attr_dealloc_fclose __wur;
248255/* Open a file, replacing an existing stream with it.
249256
250257 This function is a possible cancellation point and therefore not
......@@ -256,7 +263,7 @@ extern FILE *freopen (const char *__restrict __filename,
256263# ifdef __REDIRECT
257264extern FILE *__REDIRECT (fopen, (const char *__restrict __filename,
258265 const char *__restrict __modes), fopen64)
259 __wur;
266 __attribute_malloc__ __attr_dealloc_fclose __wur;
260267extern FILE *__REDIRECT (freopen, (const char *__restrict __filename,
261268 const char *__restrict __modes,
262269 FILE *__restrict __stream), freopen64)
......@@ -268,7 +275,8 @@ extern FILE *__REDIRECT (freopen, (const char *__restrict __filename,
268275#endif
269276#ifdef __USE_LARGEFILE64
270277extern FILE *fopen64 (const char *__restrict __filename,
271 const char *__restrict __modes) __wur;
278 const char *__restrict __modes)
279 __attribute_malloc__ __attr_dealloc_fclose __wur;
272280extern FILE *freopen64 (const char *__restrict __filename,
273281 const char *__restrict __modes,
274282 FILE *__restrict __stream) __wur;
......@@ -276,7 +284,8 @@ extern FILE *freopen64 (const char *__restrict __filename,
276284
277285#ifdef __USE_POSIX
278286/* Create a new stream that refers to an existing system file descriptor. */
279extern FILE *fdopen (int __fd, const char *__modes) __THROW __wur;
287extern FILE *fdopen (int __fd, const char *__modes) __THROW
288 __attribute_malloc__ __attr_dealloc_fclose __wur;
280289#endif
281290
282291#ifdef __USE_GNU
......@@ -284,21 +293,30 @@ extern FILE *fdopen (int __fd, const char *__modes) __THROW __wur;
284293 and uses the given functions for input and output. */
285294extern FILE *fopencookie (void *__restrict __magic_cookie,
286295 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;
288298#endif
289299
290300#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)
291301/* Create a new stream that refers to a memory buffer. */
292302extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
293 __THROW __wur;
303 __THROW __attribute_malloc__ __attr_dealloc_fclose __wur;
294304
295305/* Open a stream that writes into a malloc'd buffer that is expanded as
296306 necessary. *BUFLOC and *SIZELOC are updated with the buffer's location
297307 and the number of characters written on fflush or fclose. */
298extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW __wur;
308extern 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. */
315extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW
316 __attribute_malloc__ __attr_dealloc_fclose;
317# endif
299318#endif
300319
301
302320/* If BUF is NULL, make STREAM unbuffered.
303321 Else make it use buffer BUF, of size BUFSIZ. */
304322extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __THROW;
......@@ -792,29 +810,33 @@ extern int fileno_unlocked (FILE *__stream) __THROW __wur;
792810
793811
794812#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.
796814
797815 This function is a possible cancellation point and therefore not
798816 marked with __THROW. */
799extern FILE *popen (const char *__command, const char *__modes) __wur;
817extern int pclose (FILE *__stream);
800818
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.
802820
803821 This function is a possible cancellation point and therefore not
804822 marked with __THROW. */
805extern int pclose (FILE *__stream);
823extern FILE *popen (const char *__command, const char *__modes)
824 __attribute_malloc__ __attr_dealloc (pclose, 1) __wur;
825
806826#endif
807827
808828
809829#ifdef __USE_POSIX
810830/* Return the name of the controlling terminal. */
811extern char *ctermid (char *__s) __THROW;
831extern char *ctermid (char *__s) __THROW
832 __attr_access ((__write_only__, 1));
812833#endif /* Use POSIX. */
813834
814835
815836#if (defined __USE_XOPEN && !defined __USE_XOPEN2K) || defined __USE_GNU
816837/* Return the name of the current user. */
817extern char *cuserid (char *__s);
838extern char *cuserid (char *__s)
839 __attr_access ((__write_only__, 1));
818840#endif /* Use X/Open, but not issue 6. */
819841
820842
lib/libc/include/generic-glibc/stdlib.h+11-5
......@@ -550,6 +550,9 @@ extern void *calloc (size_t __nmemb, size_t __size)
550550extern void *realloc (void *__ptr, size_t __size)
551551 __THROW __attribute_warn_unused_result__ __attribute_alloc_size__ ((2));
552552
553/* Free a block allocated by `malloc', `realloc' or `calloc'. */
554extern void free (void *__ptr) __THROW;
555
553556#ifdef __USE_MISC
554557/* Re-allocate the previously allocated block in PTR, making the new
555558 block large enough for NMEMB elements of SIZE bytes each. */
......@@ -558,11 +561,13 @@ extern void *realloc (void *__ptr, size_t __size)
558561 between objects pointed by the old and new pointers. */
559562extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
560563 __THROW __attribute_warn_unused_result__
561 __attribute_alloc_size__ ((2, 3));
562#endif
564 __attribute_alloc_size__ ((2, 3))
565 __attr_dealloc_free;
563566
564/* Free a block allocated by `malloc', `realloc' or `calloc'. */
565extern void free (void *__ptr) __THROW;
567/* Add reallocarray as its own deallocator. */
568extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
569 __THROW __attr_dealloc (reallocarray, 1);
570#endif
566571
567572#ifdef __USE_MISC
568573# include <alloca.h>
......@@ -788,7 +793,8 @@ extern int system (const char *__command) __wur;
788793/* Return a malloc'd string containing the canonical absolute name of the
789794 existing named file. */
790795extern char *canonicalize_file_name (const char *__name)
791 __THROW __nonnull ((1)) __wur;
796 __THROW __nonnull ((1)) __attribute_malloc__
797 __attr_dealloc_free __wur;
792798#endif
793799
794800#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
lib/libc/include/generic-glibc/sys/cdefs.h+113-58
......@@ -34,7 +34,29 @@
3434#undef __P
3535#undef __PMT
3636
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__
3860
3961/* All functions, except those with callbacks or those that
4062 synchronize memory, are leaf functions. */
......@@ -48,16 +70,17 @@
4870
4971/* GCC can always grok prototypes. For C++ programs we add throw()
5072 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
5274 as non-throwing using a function attribute since programs can use
5375 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__))
5578# define __THROW __attribute__ ((__nothrow__ __LEAF))
5679# define __THROWNL __attribute__ ((__nothrow__))
5780# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
5881# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct
5982# else
60# if defined __cplusplus && __GNUC_PREREQ (2,8)
83# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4)
6184# if __cplusplus >= 201103L
6285# define __THROW noexcept (true)
6386# else
......@@ -74,7 +97,7 @@
7497# endif
7598# endif
7699
77#else /* Not GCC. */
100#else /* Not GCC or clang. */
78101
79102# if (defined __cplusplus \
80103 || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
......@@ -87,16 +110,7 @@
87110# define __THROWNL
88111# define __NTH(fct) fct
89112
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. */
100114
101115/* These two macros are not used in glibc anymore. They are kept here
102116 only because some other projects expect the macros to be defined. */
......@@ -149,11 +163,11 @@
149163 Headers that should use flexible arrays only if they're "real"
150164 (e.g. only if they won't affect sizeof()) should test
151165 #if __glibc_c99_flexarr_available. */
152#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
166#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc
153167# define __flexarr []
154168# 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,
157171 even when in C89 mode or compiling C++ (any version). */
158172# define __flexarr []
159173# define __glibc_c99_flexarr_available 1
......@@ -179,7 +193,7 @@
179193 Example:
180194 int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
181195
182#if defined __GNUC__ && __GNUC__ >= 2
196#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4)
183197
184198# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
185199# ifdef __cplusplus
......@@ -204,17 +218,17 @@
204218*/
205219#endif
206220
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__)
211225# define __attribute__(xyz) /* Ignore */
212226#endif
213227
214228/* At some point during the gcc 2.96 development the `malloc' attribute
215229 for functions was introduced. We don't want to use it unconditionally
216230 (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__)
218232# define __attribute_malloc__ __attribute__ ((__malloc__))
219233#else
220234# define __attribute_malloc__ /* Ignore */
......@@ -232,23 +246,29 @@
232246/* At some point during the gcc 2.96 development the `pure' attribute
233247 for functions was introduced. We don't want to use it unconditionally
234248 (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__)
236250# define __attribute_pure__ __attribute__ ((__pure__))
237251#else
238252# define __attribute_pure__ /* Ignore */
239253#endif
240254
241255/* 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__)
243257# define __attribute_const__ __attribute__ ((__const__))
244258#else
245259# define __attribute_const__ /* Ignore */
246260#endif
247261
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
248268/* At some point during the gcc 3.1 development the `used' attribute
249269 for functions was introduced. We don't want to use it unconditionally
250270 (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__)
252272# define __attribute_used__ __attribute__ ((__used__))
253273# define __attribute_noinline__ __attribute__ ((__noinline__))
254274#else
......@@ -257,7 +277,7 @@
257277#endif
258278
259279/* 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__)
261281# define __attribute_deprecated__ __attribute__ ((__deprecated__))
262282#else
263283# define __attribute_deprecated__ /* Ignore */
......@@ -267,7 +287,7 @@
267287 when a deprecated function is used. clang claims to be gcc 4.2, but
268288 may also support this feature. */
269289#if __GNUC_PREREQ (4,5) \
270 || __glibc_clang_has_extension (__attribute_deprecated_with_message__)
290 || __glibc_has_extension (__attribute_deprecated_with_message__)
271291# define __attribute_deprecated_msg__(msg) \
272292 __attribute__ ((__deprecated__ (msg)))
273293#else
......@@ -280,7 +300,7 @@
280300 If several `format_arg' attributes are given for the same function, in
281301 gcc-3.0 and older, all but the last one are ignored. In newer gccs,
282302 all designated arguments are considered. */
283#if __GNUC_PREREQ (2,8)
303#if __GNUC_PREREQ (2,8) || __glibc_has_attribute (__format_arg__)
284304# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
285305#else
286306# define __attribute_format_arg__(x) /* Ignore */
......@@ -290,27 +310,42 @@
290310 attribute for functions was introduced. We don't want to use it
291311 unconditionally (although this would be possible) since it
292312 generates warnings. */
293#if __GNUC_PREREQ (2,97)
313#if __GNUC_PREREQ (2,97) || __glibc_has_attribute (__format__)
294314# define __attribute_format_strfmon__(a,b) \
295315 __attribute__ ((__format__ (__strfmon__, a, b)))
296316#else
297317# define __attribute_format_strfmon__(a,b) /* Ignore */
298318#endif
299319
300/* The nonull function attribute allows to mark pointer parameters which
320/* The nonnull function attribute marks pointer parameters that
301321 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
306341#endif
307342
308343/* If fortification mode, we warn about unused results of certain
309344 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__)
311346# define __attribute_warn_unused_result__ \
312347 __attribute__ ((__warn_unused_result__))
313# if __USE_FORTIFY_LEVEL > 0
348# if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0
314349# define __wur __attribute_warn_unused_result__
315350# endif
316351#else
......@@ -321,7 +356,7 @@
321356#endif
322357
323358/* Forces a function to be always inlined. */
324#if __GNUC_PREREQ (3,2)
359#if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__always_inline__)
325360/* The Linux kernel defines __always_inline in stddef.h (283d7573), and
326361 it conflicts with this definition. Therefore undefine it first to
327362 allow either header to be included first. */
......@@ -334,7 +369,7 @@
334369
335370/* Associate error messages with the source location of the call site rather
336371 than with the source location inside the function. */
337#if __GNUC_PREREQ (4,3)
372#if __GNUC_PREREQ (4,3) || __glibc_has_attribute (__artificial__)
338373# define __attribute_artificial__ __attribute__ ((__artificial__))
339374#else
340375# define __attribute_artificial__ /* Ignore */
......@@ -377,12 +412,14 @@
377412 run in pedantic mode if the uses are carefully marked using the
378413 `__extension__' keyword. But this is not generally available before
379414 version 2.8. */
380#if !__GNUC_PREREQ (2,8)
415#if !(__GNUC_PREREQ (2,8) || defined __clang__)
381416# define __extension__ /* Ignore */
382417#endif
383418
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)
386423# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
387424# define __restrict restrict
388425# else
......@@ -392,8 +429,9 @@
392429
393430/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
394431 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
397435# define __restrict_arr __restrict
398436#else
399437# ifdef __GNUC__
......@@ -408,7 +446,7 @@
408446# endif
409447#endif
410448
411#if __GNUC__ >= 3
449#if (__GNUC__ >= 3) || __glibc_has_builtin (__builtin_expect)
412450# define __glibc_unlikely(cond) __builtin_expect ((cond), 0)
413451# define __glibc_likely(cond) __builtin_expect ((cond), 1)
414452#else
......@@ -416,15 +454,10 @@
416454# define __glibc_likely(cond) (cond)
417455#endif
418456
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
425457#if (!defined _Noreturn \
426458 && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
427 && !__GNUC_PREREQ (4,7))
459 && !(__GNUC_PREREQ (4,7) \
460 || (3 < __clang_major__ + (5 <= __clang_minor__))))
428461# if __GNUC_PREREQ (2,8)
429462# define _Noreturn __attribute__ ((__noreturn__))
430463# else
......@@ -453,14 +486,19 @@
453486
454487#if (!defined _Static_assert && !defined __cplusplus \
455488 && (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__))
457491# define _Static_assert(expr, diagnostic) \
458492 extern int (*__Static_assert_function (void)) \
459493 [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
460494#endif
461495
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
464502
465503#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
466504# ifdef __REDIRECT
......@@ -550,7 +588,7 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf
550588 check is required to enable the use of generic selection. */
551589#if !defined __cplusplus \
552590 && (__GNUC_PREREQ (4, 9) \
553 || __glibc_clang_has_extension (c_generic_selections) \
591 || __glibc_has_extension (c_generic_selections) \
554592 || (!defined __GNUC__ && defined __STDC_VERSION__ \
555593 && __STDC_VERSION__ >= 201112L))
556594# define __HAVE_GENERIC_SELECTION 1
......@@ -564,9 +602,26 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf
564602 array according to access mode, or at least one element when
565603 size-index is not provided:
566604 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
568611#else
569612# 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
570625#endif
571626
572627/* 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
3838/* Perform the I/O control operation specified by REQUEST on FD.
3939 One argument may follow; its presence and type depend on REQUEST.
4040 Return value depends on REQUEST. Usually -1 indicates error. */
41#ifndef __USE_TIME_BITS64
4142extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
43#else
44# ifdef __REDIRECT
45extern int __REDIRECT (ioctl, (int __fd, unsigned long int __request, ...),
46 __ioctl_time64) __THROW;
47# else
48extern int __ioctl_time64 (int __fd, unsigned long int __request, ...) __THROW;
49# define ioctl __ioctl_time64
50# endif
51#endif
4252
4353__END_DECLS
4454
lib/libc/include/generic-glibc/sys/mount.h+2
......@@ -48,6 +48,8 @@ enum
4848#define MS_MANDLOCK MS_MANDLOCK
4949 MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
5050#define MS_DIRSYNC MS_DIRSYNC
51 MS_NOSYMFOLLOW = 256, /* Do not follow symlinks. */
52#define MS_NOSYMFOLLOW MS_NOSYMFOLLOW
5153 MS_NOATIME = 1024, /* Do not update access times. */
5254#define MS_NOATIME MS_NOATIME
5355 MS_NODIRATIME = 2048, /* Do not update directory access times. */
lib/libc/include/generic-glibc/sys/msg.h+10
......@@ -58,7 +58,17 @@ struct msgbuf
5858__BEGIN_DECLS
5959
6060/* Message queue control operation. */
61#ifndef __USE_TIME_BITS64
6162extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW;
63#else
64# ifdef __REDIRECT_NTH
65extern 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
6272
6373/* Get messages queue. */
6474extern 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)
3030 __attribute__ ((pure));
3131
3232static __inline__ _Bool
33x86_cpu_has_feature (unsigned int __index)
33x86_cpu_present (unsigned int __index)
3434{
3535 const struct cpuid_feature *__ptr = __x86_get_cpuid_feature_leaf
3636 (__index / (8 * sizeof (unsigned int) * 4));
......@@ -43,7 +43,7 @@ x86_cpu_has_feature (unsigned int __index)
4343}
4444
4545static __inline__ _Bool
46x86_cpu_is_usable (unsigned int __index)
46x86_cpu_active (unsigned int __index)
4747{
4848 const struct cpuid_feature *__ptr = __x86_get_cpuid_feature_leaf
4949 (__index / (8 * sizeof (unsigned int) * 4));
......@@ -52,13 +52,13 @@ x86_cpu_is_usable (unsigned int __index)
5252 unsigned int __bit = __reg & (8 * sizeof (unsigned int) - 1);
5353 __reg /= 8 * sizeof (unsigned int);
5454
55 return __ptr->usable_array[__reg] & (1 << __bit);
55 return __ptr->active_array[__reg] & (1 << __bit);
5656}
5757
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)
6262
6363__END_DECLS
6464
lib/libc/include/generic-glibc/sys/poll.h+16-2
......@@ -51,7 +51,8 @@ __BEGIN_DECLS
5151
5252 This function is a cancellation point and therefore not marked with
5353 __THROW. */
54extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout);
54extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout)
55 __attr_access ((__write_only__, 1, 2));
5556
5657#ifdef __USE_GNU
5758/* 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);
6263 __THROW. */
6364extern int ppoll (struct pollfd *__fds, nfds_t __nfds,
6465 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
71extern 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
6680#endif
6781
6882__END_DECLS
lib/libc/include/generic-glibc/sys/prctl.h+10-4
......@@ -25,10 +25,6 @@
2525 we're picking up... */
2626
2727/* Memory tagging control operations (for AArch64). */
28#ifndef PR_TAGGED_ADDR_ENABLE
29# define PR_TAGGED_ADDR_ENABLE (1UL << 8)
30#endif
31
3228#ifndef PR_MTE_TCF_SHIFT
3329# define PR_MTE_TCF_SHIFT 1
3430# define PR_MTE_TCF_NONE (0UL << PR_MTE_TCF_SHIFT)
......@@ -42,7 +38,17 @@
4238__BEGIN_DECLS
4339
4440/* Control process execution. */
41#ifndef __USE_TIME_BITS64
4542extern int prctl (int __option, ...) __THROW;
43#else
44# ifdef __REDIRECT
45extern int __REDIRECT (prctl, (int __option, ...), __prctl_time64) __THROW;
46# else
47extern int __prctl_time64 (int __option,d ...) __THROW;
48# define ioctl __prctl_time64
49# endif
50#endif
51
4652
4753__END_DECLS
4854
lib/libc/include/generic-glibc/sys/resource.h+18-6
......@@ -48,18 +48,19 @@ typedef int __priority_which_t;
4848 Returns 0 if successful, -1 if not (and sets errno). */
4949#ifndef __USE_FILE_OFFSET64
5050extern int getrlimit (__rlimit_resource_t __resource,
51 struct rlimit *__rlimits) __THROW;
51 struct rlimit *__rlimits) __THROW __nonnull ((2));
5252#else
5353# ifdef __REDIRECT_NTH
5454extern int __REDIRECT_NTH (getrlimit, (__rlimit_resource_t __resource,
55 struct rlimit *__rlimits), getrlimit64);
55 struct rlimit *__rlimits), getrlimit64)
56 __nonnull ((2));
5657# else
5758# define getrlimit getrlimit64
5859# endif
5960#endif
6061#ifdef __USE_LARGEFILE64
6162extern int getrlimit64 (__rlimit_resource_t __resource,
62 struct rlimit64 *__rlimits) __THROW;
63 struct rlimit64 *__rlimits) __THROW __nonnull ((2));
6364#endif
6465
6566/* Set the soft and hard limits for RESOURCE to *RLIMITS.
......@@ -67,25 +68,36 @@ extern int getrlimit64 (__rlimit_resource_t __resource,
6768 Return 0 if successful, -1 if not (and sets errno). */
6869#ifndef __USE_FILE_OFFSET64
6970extern int setrlimit (__rlimit_resource_t __resource,
70 const struct rlimit *__rlimits) __THROW;
71 const struct rlimit *__rlimits) __THROW __nonnull ((2));
7172#else
7273# ifdef __REDIRECT_NTH
7374extern int __REDIRECT_NTH (setrlimit, (__rlimit_resource_t __resource,
7475 const struct rlimit *__rlimits),
75 setrlimit64);
76 setrlimit64) __nonnull ((2));
7677# else
7778# define setrlimit setrlimit64
7879# endif
7980#endif
8081#ifdef __USE_LARGEFILE64
8182extern int setrlimit64 (__rlimit_resource_t __resource,
82 const struct rlimit64 *__rlimits) __THROW;
83 const struct rlimit64 *__rlimits) __THROW
84 __nonnull ((2));
8385#endif
8486
8587/* Return resource usage information on process indicated by WHO
8688 and put it in *USAGE. Returns 0 for success, -1 for failure. */
8789extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW;
8890
91#ifdef __USE_TIME_BITS64
92# if defined(__REDIRECT_NTH)
93extern 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
89101/* Return the highest priority of any process specified by WHICH and WHO
90102 (see above); if WHO is zero, the current process, process group, or user
91103 (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
9898
9999 This function is a cancellation point and therefore not marked with
100100 __THROW. */
101#ifndef __USE_TIME_BITS64
101102extern int select (int __nfds, fd_set *__restrict __readfds,
102103 fd_set *__restrict __writefds,
103104 fd_set *__restrict __exceptfds,
104105 struct timeval *__restrict __timeout);
106#else
107# ifdef __REDIRECT
108extern 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
105118
106119#ifdef __USE_XOPEN2K
107120/* 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,
110123
111124 This function is a cancellation point and therefore not marked with
112125 __THROW. */
126# ifndef __USE_TIME_BITS64
113127extern int pselect (int __nfds, fd_set *__restrict __readfds,
114128 fd_set *__restrict __writefds,
115129 fd_set *__restrict __exceptfds,
116130 const struct timespec *__restrict __timeout,
117131 const __sigset_t *__restrict __sigmask);
132# else
133# ifdef __REDIRECT
134extern 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
118145#endif
119146
120147
lib/libc/include/generic-glibc/sys/sem.h+21
......@@ -48,7 +48,17 @@ struct sembuf
4848__BEGIN_DECLS
4949
5050/* Semaphore control operation. */
51#ifndef __USE_TIME_BITS64
5152extern int semctl (int __semid, int __semnum, int __cmd, ...) __THROW;
53#else
54# ifdef __REDIRECT_NTH
55extern int __REDIRECT_NTH (semctl,
56 (int __semid, int __semnum, int __cmd, ...),
57 __semctl64);
58# else
59# define semctl __semctl64
60# endif
61#endif
5262
5363/* Get semaphore. */
5464extern 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;
5868
5969#ifdef __USE_GNU
6070/* Operate on semaphore with timeout. */
71# ifndef __USE_TIME_BITS64
6172extern int semtimedop (int __semid, struct sembuf *__sops, size_t __nsops,
6273 const struct timespec *__timeout) __THROW;
74# else
75# ifdef __REDIRECT_NTH
76extern 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
6384#endif
6485
6586__END_DECLS
lib/libc/include/generic-glibc/sys/shm.h+10
......@@ -46,7 +46,17 @@ __BEGIN_DECLS
4646 facility. The definition is found in XPG4.2. */
4747
4848/* Shared memory control operation. */
49#ifndef __USE_TIME_BITS64
4950extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW;
51#else
52# ifdef __REDIRECT_NTH
53extern 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
5060
5161/* Get shared memory segment. */
5262extern 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,
170170
171171 This function is a cancellation point and therefore not marked with
172172 __THROW. */
173#ifndef __USE_TIME_BITS64
173174extern ssize_t sendmsg (int __fd, const struct msghdr *__message,
174175 int __flags);
176#else
177# ifdef __REDIRECT
178extern ssize_t __REDIRECT (sendmsg, (int __fd, const struct msghdr *__message,
179 int __flags),
180 __sendmsg64);
181# else
182extern ssize_t __sendmsg64 (int __fd, const struct msghdr *__message,
183 int __flags);
184# defien sendmsg __sendmsg64
185# endif
186#endif
175187
176188#ifdef __USE_GNU
177189/* 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,
179191
180192 This function is a cancellation point and therefore not marked with
181193 __THROW. */
194# ifndef __USE_TIME_BITS64
182195extern int sendmmsg (int __fd, struct mmsghdr *__vmessages,
183196 unsigned int __vlen, int __flags);
184#endif
197# else
198# ifdef __REDIRECT
199extern int __REDIRECT (sendmmsg, (int __fd, struct mmsghdr *__vmessages,
200 unsigned int __vlen, int __flags),
201 __sendmmsg64);
202# else
203extern 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 */
185209
186210/* Receive a message as described by MESSAGE from socket FD.
187211 Returns the number of bytes read or -1 for errors.
188212
189213 This function is a cancellation point and therefore not marked with
190214 __THROW. */
215#ifndef __USE_TIME_BITS64
191216extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
217#else
218# ifdef __REDIRECT
219extern ssize_t __REDIRECT (recvmsg,
220 (int __fd, struct msghdr *__message, int __flags),
221 __recvmsg64);
222# else
223extern ssize_t __recvmsg64 (int __fd, struct msghdr *__message, int __flags);
224# define recvmsg __recvmsg64
225# endif
226#endif
192227
193228#ifdef __USE_GNU
194229/* 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);
196231
197232 This function is a cancellation point and therefore not marked with
198233 __THROW. */
234# ifndef __USE_TIME_BITS64
199235extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
200236 unsigned int __vlen, int __flags,
201237 struct timespec *__tmo);
238# else
239# ifdef __REDIRECT
240extern 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
202248#endif
203249
204250
205251/* Put the current value for socket FD's option OPTNAME at protocol level LEVEL
206252 into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's
207253 actual length. Returns 0 on success, -1 for errors. */
254#ifndef __USE_TIME_BITS64
208255extern int getsockopt (int __fd, int __level, int __optname,
209256 void *__restrict __optval,
210257 socklen_t *__restrict __optlen) __THROW;
258#else
259# ifdef __REDIRECT
260extern int __REDIRECT_NTH (getsockopt,
261 (int __fd, int __level, int __optname,
262 void *__restrict __optval,
263 socklen_t *__restrict __optlen),
264 __getsockopt64);
265# else
266extern 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
211272
212273/* Set socket FD's option OPTNAME at protocol level LEVEL
213274 to *OPTVAL (which is OPTLEN bytes long).
214275 Returns 0 on success, -1 for errors. */
276#ifndef __USE_TIME_BITS64
215277extern int setsockopt (int __fd, int __level, int __optname,
216278 const void *__optval, socklen_t __optlen) __THROW;
279#else
280# ifdef __REDIRECT
281extern int __REDIRECT_NTH (setsockopt,
282 (int __fd, int __level, int __optname,
283 const void *__optval, socklen_t __optlen),
284 __setsockopt64);
285# else
286extern int __setsockopt64 (int __fd, int __level, int __optname,
287 const void *__optval, socklen_t __optlen) __THROW;
288# define setsockopt __setsockopt64
289# endif
290#endif
217291
218292
219293/* 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,
209209 that file descriptor FD is open on and put them in BUF. */
210210extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2));
211211#else
212# ifdef __REDIRECT_NTH
212# ifdef __USE_TIME_BITS64
213# ifdef __REDIRECT_NTH
214extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
215 struct stat *__restrict __buf),
216 __stat64_time64)
217 __nonnull ((1, 2));
218extern 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
213227extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
214228 struct stat *__restrict __buf), stat64)
215229 __nonnull ((1, 2));
216230extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64)
217231 __nonnull ((2));
218# else
219# define stat stat64
220# define fstat fstat64
232# else
233# define stat stat64
234# define fstat fstat64
235# endif
221236# endif
222237#endif
223238#ifdef __USE_LARGEFILE64
239# ifndef __USE_TIME_BITS64
224240extern int stat64 (const char *__restrict __file,
225241 struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2));
226242extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
243# else
244# ifdef __REDIRECT_NTH
245extern int __REDIRECT_NTH (stat64, (const char *__restrict __file,
246 struct stat64 *__restrict __buf),
247 __stat64_time64)
248 __nonnull ((1, 2));
249extern 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
227257#endif
228258
229259#ifdef __USE_ATFILE
......@@ -235,20 +265,44 @@ extern int fstatat (int __fd, const char *__restrict __file,
235265 struct stat *__restrict __buf, int __flag)
236266 __THROW __nonnull ((2, 3));
237267# else
238# ifdef __REDIRECT_NTH
268# ifdef __USE_TIME_BITS64
269# ifdef __REDIRECT_NTH
239270extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
240271 struct stat *__restrict __buf,
241272 int __flag),
242 fstatat64) __nonnull ((2, 3));
273 __fstatat64_time64) __nonnull ((2, 3));
274# else
275# define fstatat __fstatat64_time64
276# endif
243277# else
244# define fstatat fstatat64
278# ifdef __REDIRECT_NTH
279extern 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
245286# endif
246287# endif
247288
248289# ifdef __USE_LARGEFILE64
290# ifndef __USE_TIME_BITS64
249291extern int fstatat64 (int __fd, const char *__restrict __file,
250292 struct stat64 *__restrict __buf, int __flag)
251293 __THROW __nonnull ((2, 3));
294# else
295# ifdef __REDIRECT_NTH
296extern 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
252306# endif
253307#endif
254308
......@@ -259,19 +313,37 @@ extern int fstatat64 (int __fd, const char *__restrict __file,
259313extern int lstat (const char *__restrict __file,
260314 struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
261315# else
262# ifdef __REDIRECT_NTH
316# ifdef __USE_TIME_BITS64
317# ifdef __REDIRECT_NTH
263318extern int __REDIRECT_NTH (lstat,
264319 (const char *__restrict __file,
265 struct stat *__restrict __buf), lstat64)
320 struct stat *__restrict __buf), __lstat64_time64)
266321 __nonnull ((1, 2));
322# else
323# define lstat __lstat64_time64
324# endif
267325# else
268# define lstat lstat64
326# ifdef __REDIRECT_NTH
327extern 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
269334# endif
270335# endif
271336# ifdef __USE_LARGEFILE64
337# ifndef __USE_TIME_BITS64
272338extern int lstat64 (const char *__restrict __file,
273339 struct stat64 *__restrict __buf)
274340 __THROW __nonnull ((1, 2));
341# else
342extern int __REDIRECT_NTH (lstat64, (const char *__restrict __file,
343 struct stat64 *__restrict __buf),
344 __lstat64_time64)
345 __nonnull ((1, 2));
346# endif
275347# endif
276348#endif
277349
......@@ -355,17 +427,38 @@ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
355427#endif
356428
357429#ifdef __USE_ATFILE
430# ifndef __USE_TIME_BITS64
358431/* Set file access and modification times relative to directory file
359432 descriptor. */
360433extern int utimensat (int __fd, const char *__path,
361434 const struct timespec __times[2],
362435 int __flags)
363436 __THROW __nonnull ((2));
437# else
438# ifdef __REDIRECT_NTH
439extern 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
364447#endif
365448
366449#ifdef __USE_XOPEN2K8
450# ifndef __USE_TIME_BITS64
367451/* Set file access and modification times of the file associated with FD. */
368452extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
453
454# else
455# ifdef __REDIRECT_NTH
456extern int __REDIRECT_NTH (futimens, (int fd, const struct timespec __times[2]),
457 __futimens64);
458# else
459# define futimens __futimens64
460# endif
461# endif
369462#endif
370463
371464#ifdef __USE_GNU
lib/libc/include/generic-glibc/sys/statvfs.h+1-1
......@@ -21,7 +21,7 @@
2121
2222#include <features.h>
2323
24/* Get the system-specific definition of `struct statfs'. */
24/* Get the system-specific definition of `struct statvfs'. */
2525#include <bits/statvfs.h>
2626
2727#ifndef __USE_FILE_OFFSET64
lib/libc/include/generic-glibc/sys/time.h+71
......@@ -63,10 +63,21 @@ struct timezone
6363 use localtime etc. instead.
6464 This function itself is semi-obsolete;
6565 most callers should use time or clock_gettime instead. */
66#ifndef __USE_TIME_BITS64
6667extern int gettimeofday (struct timeval *__restrict __tv,
6768 void *__restrict __tz) __THROW __nonnull ((1));
69#else
70# ifdef __REDIRECT_NTH
71extern 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
6878
6979#ifdef __USE_MISC
80# ifndef __USE_TIME_BITS64
7081/* Set the current time of day and timezone information.
7182 This call is restricted to the super-user.
7283 Setting the timezone in this way is obsolete, but we don't yet
......@@ -82,6 +93,20 @@ extern int settimeofday (const struct timeval *__tv,
8293 This call is restricted to the super-user. */
8394extern int adjtime (const struct timeval *__delta,
8495 struct timeval *__olddelta) __THROW;
96# else
97# ifdef __REDIRECT_NTH
98extern int __REDIRECT_NTH (settimeofday, (const struct timeval *__tv,
99 const struct timezone *__tz),
100 __settimeofday64);
101
102extern 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
85110#endif
86111
87112
......@@ -118,6 +143,7 @@ typedef enum __itimer_which __itimer_which_t;
118143typedef int __itimer_which_t;
119144#endif
120145
146#ifndef __USE_TIME_BITS64
121147/* Set *VALUE to the current setting of timer WHICH.
122148 Return 0 on success, -1 on errors. */
123149extern int getitimer (__itimer_which_t __which,
......@@ -136,21 +162,66 @@ extern int setitimer (__itimer_which_t __which,
136162extern int utimes (const char *__file, const struct timeval __tvp[2])
137163 __THROW __nonnull ((1));
138164
165#else
166# ifdef __REDIRECT_NTH
167extern int __REDIRECT_NTH (getitimer, (__itimer_which_t __which,
168 struct itimerval *__value),
169 __getitimer64);
170
171extern int __REDIRECT_NTH (setitimer, (__itimer_which_t __which,
172 const struct itimerval *__restrict __new,
173 struct itimerval *__restrict __old),
174 __setitimer64);
175
176extern 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
139186#ifdef __USE_MISC
187# ifndef __USE_TIME_BITS64
140188/* Same as `utimes', but does not follow symbolic links. */
141189extern int lutimes (const char *__file, const struct timeval __tvp[2])
142190 __THROW __nonnull ((1));
143191
144192/* Same as `utimes', but takes an open file descriptor instead of a name. */
145193extern int futimes (int __fd, const struct timeval __tvp[2]) __THROW;
194# else
195# ifdef __REDIRECT_NTH
196extern int __REDIRECT_NTH (lutimes, (const char *__file,
197 const struct timeval __tvp[2]),
198 __lutimes64) __nonnull ((1));
199
200extern 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
146207#endif
147208
148209#ifdef __USE_GNU
210# ifndef __USE_TIME_BITS64
149211/* Change the access time of FILE relative to FD to TVP[0] and the
150212 modification time of FILE to TVP[1]. If TVP is a null pointer, use
151213 the current time instead. Returns 0 on success, -1 on errors. */
152214extern int futimesat (int __fd, const char *__file,
153215 const struct timeval __tvp[2]) __THROW;
216# else
217# ifdef __REDIRECT_NTH
218extern 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
154225#endif
155226
156227
lib/libc/include/generic-glibc/sys/timerfd.h+22
......@@ -47,9 +47,31 @@ extern int timerfd_settime (int __ufd, int __flags,
4747 const struct itimerspec *__utmr,
4848 struct itimerspec *__otmr) __THROW;
4949
50#ifdef __USE_TIME_BITS64
51# if defined(__REDIRECT_NTH)
52extern 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
5062/* Return the next expiration time of UFD. */
5163extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
5264
65#ifdef __USE_TIME_BITS64
66# if defined(__REDIRECT_NTH)
67extern 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
5375__END_DECLS
5476
5577#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
5454
5555__BEGIN_DECLS
5656
57extern int __adjtimex (struct timex *__ntx) __THROW;
57#ifndef __USE_TIME_BITS64
5858extern int adjtimex (struct timex *__ntx) __THROW;
59extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
5960
60#ifdef __REDIRECT_NTH
61# ifdef __REDIRECT_NTH
6162extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
62 ntp_gettimex);
63 ntp_gettimex);
64# else
65# define ntp_gettime ntp_gettimex
66# endif
67extern int ntp_adjtime (struct timex *__tntx) __THROW;
6368#else
64extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
65# define ntp_gettime ntp_gettimex
69# ifdef __REDIRECT_NTH
70extern int __REDIRECT_NTH (adjtimex, (struct timex *__ntx),
71 ___adjtimex64);
72extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
73 __ntp_gettime64);
74extern int __REDIRECT_NTH (ntp_gettimex, (struct ntptimeval *__ntv),
75 __ntp_gettimex64);
76extern 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
6684#endif
67extern int ntp_adjtime (struct timex *__tntx) __THROW;
6885
6986__END_DECLS
7087
lib/libc/include/generic-glibc/sys/uio.h+24-13
......@@ -39,7 +39,7 @@ __BEGIN_DECLS
3939 This function is a cancellation point and therefore not marked with
4040 __THROW. */
4141extern ssize_t readv (int __fd, const struct iovec *__iovec, int __count)
42 __wur;
42 __wur __attr_access ((__read_only__, 2, 3));
4343
4444/* Write data pointed by the buffers described by IOVEC, which
4545 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)
5050 This function is a cancellation point and therefore not marked with
5151 __THROW. */
5252extern ssize_t writev (int __fd, const struct iovec *__iovec, int __count)
53 __wur;
53 __wur __attr_access ((__read_only__, 2, 3));
5454
5555
5656#ifdef __USE_MISC
......@@ -65,7 +65,8 @@ extern ssize_t writev (int __fd, const struct iovec *__iovec, int __count)
6565 This function is a cancellation point and therefore not marked with
6666 __THROW. */
6767extern 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));
6970
7071/* Write data pointed by the buffers described by IOVEC, which is a
7172 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,
7778 This function is a cancellation point and therefore not marked with
7879 __THROW. */
7980extern 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));
8183
8284# else
8385# ifdef __REDIRECT
8486extern ssize_t __REDIRECT (preadv, (int __fd, const struct iovec *__iovec,
8587 int __count, __off64_t __offset),
86 preadv64) __wur;
88 preadv64)
89 __wur __attr_access ((__read_only__, 2, 3));
8790extern ssize_t __REDIRECT (pwritev, (int __fd, const struct iovec *__iovec,
8891 int __count, __off64_t __offset),
89 pwritev64) __wur;
92 pwritev64)
93 __wur __attr_access ((__read_only__, 2, 3));
9094# else
9195# define preadv preadv64
9296# define pwritev pwritev64
......@@ -104,7 +108,8 @@ extern ssize_t __REDIRECT (pwritev, (int __fd, const struct iovec *__iovec,
104108 This function is a cancellation point and therefore not marked with
105109 __THROW. */
106110extern 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));
108113
109114/* Write data pointed by the buffers described by IOVEC, which is a
110115 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,
116121 This function is a cancellation point and therefore not marked with
117122 __THROW. */
118123extern 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));
120126# endif
121127#endif /* Use misc. */
122128
......@@ -125,7 +131,8 @@ extern ssize_t pwritev64 (int __fd, const struct iovec *__iovec, int __count,
125131# ifndef __USE_FILE_OFFSET64
126132/* Same as preadv but with an additional flag argumenti defined at uio.h. */
127133extern 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));
129136
130137/* Same as preadv but with an additional flag argument defined at uio.h. */
131138extern 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,
136143extern ssize_t __REDIRECT (pwritev2, (int __fd, const struct iovec *__iovec,
137144 int __count, __off64_t __offset,
138145 int __flags),
139 pwritev64v2) __wur;
146 pwritev64v2)
147 __wur __attr_access ((__read_only__, 2, 3));
140148extern ssize_t __REDIRECT (preadv2, (int __fd, const struct iovec *__iovec,
141149 int __count, __off64_t __offset,
142150 int __flags),
143 preadv64v2) __wur;
151 preadv64v2)
152 __wur __attr_access ((__read_only__, 2, 3));
144153# else
145154# define preadv2 preadv64v2
146155# define pwritev2 pwritev64v2
......@@ -151,12 +160,14 @@ extern ssize_t __REDIRECT (preadv2, (int __fd, const struct iovec *__iovec,
151160/* Same as preadv but with an additional flag argumenti defined at uio.h. */
152161extern ssize_t preadv64v2 (int __fp, const struct iovec *__iovec,
153162 int __count, __off64_t __offset,
154 int ___flags) __wur;
163 int ___flags)
164 __wur __attr_access ((__read_only__, 2, 3));
155165
156166/* Same as preadv but with an additional flag argument defined at uio.h. */
157167extern ssize_t pwritev64v2 (int __fd, const struct iovec *__iodev,
158168 int __count, __off64_t __offset,
159 int __flags) __wur;
169 int __flags)
170 __wur __attr_access ((__read_only__, 2, 3));
160171# endif
161172#endif /* Use GNU. */
162173
lib/libc/include/generic-glibc/sys/wait.h+20
......@@ -144,14 +144,34 @@ struct rusage;
144144 nil, store information about the child's resource usage there. If the
145145 WUNTRACED bit is set in OPTIONS, return status for stopped children;
146146 otherwise don't. */
147# ifndef __USE_TIME_BITS64
147148extern __pid_t wait3 (int *__stat_loc, int __options,
148149 struct rusage * __usage) __THROWNL;
150# else
151# ifdef __REDIRECT_NTHNL
152extern __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
149159#endif
150160
151161#ifdef __USE_MISC
162# ifndef __USE_TIME_BITS64
152163/* PID is like waitpid. Other args are like wait3. */
153164extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options,
154165 struct rusage *__usage) __THROWNL;
166# else
167# ifdef __REDIRECT_NTHNL
168extern __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
155175#endif /* Use misc. */
156176
157177
lib/libc/include/generic-glibc/threads.h+33
......@@ -88,8 +88,18 @@ extern thrd_t thrd_current (void);
8888 __TIME_POINT. The current thread may resume if receives a signal. In
8989 that case, if __REMAINING is not NULL, the remaining time is stored in
9090 the object pointed by it. */
91#ifndef __USE_TIME_BITS64
9192extern int thrd_sleep (const struct timespec *__time_point,
9293 struct timespec *__remaining);
94#else
95# ifdef __REDIRECT
96extern 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
93103
94104/* Terminate current thread execution, cleaning up any thread local
95105 storage and freeing resources. Returns the value specified in __RES. */
......@@ -131,8 +141,19 @@ extern int mtx_lock (mtx_t *__mutex);
131141/* Block the current thread until the mutex pointed by __MUTEX is unlocked
132142 or time pointed by __TIME_POINT is reached. In case the mutex is unlock,
133143 the current thread will not be blocked. */
144#ifndef __USE_TIME_BITS64
134145extern int mtx_timedlock (mtx_t *__restrict __mutex,
135146 const struct timespec *__restrict __time_point);
147#else
148# ifdef __REDIRECT
149extern 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
136157
137158/* Try to lock the mutex pointed by __MUTEX without blocking. If the mutex
138159 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);
171192/* Block current thread on the condition variable until condition variable
172193 pointed by __COND is signaled or time pointed by __TIME_POINT is
173194 reached. */
195#ifndef __USE_TIME_BITS64
174196extern int cnd_timedwait (cnd_t *__restrict __cond,
175197 mtx_t *__restrict __mutex,
176198 const struct timespec *__restrict __time_point);
199#else
200# ifdef __REDIRECT
201extern 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
177210
178211/* Destroy condition variable pointed by __cond and free all of its
179212 resources. */
lib/libc/include/generic-glibc/time.h+144-5
......@@ -71,6 +71,7 @@ __BEGIN_DECLS
7171 The result / CLOCKS_PER_SEC is program time in seconds. */
7272extern clock_t clock (void) __THROW;
7373
74#ifndef __USE_TIME_BITS64
7475/* Return the current time and put it in *TIMER if TIMER is not NULL. */
7576extern time_t time (time_t *__timer) __THROW;
7677
......@@ -80,7 +81,18 @@ extern double difftime (time_t __time1, time_t __time0)
8081
8182/* Return the `time_t' representation of TP and normalize TP. */
8283extern time_t mktime (struct tm *__tp) __THROW;
83
84#else
85# ifdef __REDIRECT_NTH
86extern time_t __REDIRECT_NTH (time, (time_t *__timer), __time64);
87extern double __REDIRECT_NTH (difftime, (time_t __time1, time_t __time0),
88 __difftime64) __attribute__ ((__const__));
89extern 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
8496
8597/* Format TP into S according to FORMAT.
8698 Write no more than MAXSIZE characters and return the number
......@@ -114,6 +126,7 @@ extern char *strptime_l (const char *__restrict __s,
114126#endif
115127
116128
129#ifndef __USE_TIME_BITS64
117130/* Return the `struct tm' representation of *TIMER
118131 in Universal Coordinated Time (aka Greenwich Mean Time). */
119132extern struct tm *gmtime (const time_t *__timer) __THROW;
......@@ -122,7 +135,20 @@ extern struct tm *gmtime (const time_t *__timer) __THROW;
122135 of *TIMER in the local timezone. */
123136extern struct tm *localtime (const time_t *__timer) __THROW;
124137
138#else
139# ifdef __REDIRECT_NTH
140extern struct tm*__REDIRECT_NTH (gmtime, (const time_t *__timer), __gmtime64);
141extern 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
125150#if defined __USE_POSIX || __GLIBC_USE (ISOC2X)
151# ifndef __USE_TIME_BITS64
126152/* Return the `struct tm' representation of *TIMER in UTC,
127153 using *TP to store the result. */
128154extern struct tm *gmtime_r (const time_t *__restrict __timer,
......@@ -132,6 +158,20 @@ extern struct tm *gmtime_r (const time_t *__restrict __timer,
132158 using *TP to store the result. */
133159extern struct tm *localtime_r (const time_t *__restrict __timer,
134160 struct tm *__restrict __tp) __THROW;
161# else
162# ifdef __REDIRECT_NTH
163extern struct tm*__REDIRECT_NTH (gmtime_r, (const time_t *__restrict __timer,
164 struct tm *__restrict __tp),
165 __gmtime64_r);
166
167extern 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
135175#endif /* POSIX || C2X */
136176
137177/* 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,
139179extern char *asctime (const struct tm *__tp) __THROW;
140180
141181/* Equivalent to `asctime (localtime (timer))'. */
182#ifndef __USE_TIME_BITS64
142183extern char *ctime (const time_t *__timer) __THROW;
184#else
185# ifdef __REDIRECT_NTH
186extern char *__REDIRECT_NTH (ctime, (const time_t *__timer), __ctime64);
187# else
188# define ctime __ctime64
189# endif
190#endif
143191
144#if defined __USE_POSIX || __GLIBC_USE (ISOC2X)
192#ifdef __USE_POSIX
145193/* Reentrant versions of the above functions. */
146194
147195/* 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,
150198 char *__restrict __buf) __THROW;
151199
152200/* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */
201#ifndef __USE_TIME_BITS64
153202extern char *ctime_r (const time_t *__restrict __timer,
154203 char *__restrict __buf) __THROW;
155#endif /* POSIX || C2X */
204#else
205# ifdef __REDIRECT_NTH
206extern 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 */
156214
157215
158216/* Defined in localtime.c. */
......@@ -186,11 +244,19 @@ extern long int timezone;
186244/* Miscellaneous functions many Unices inherited from the public domain
187245 localtime package. These are included only for compatibility. */
188246
247#ifndef __USE_TIME_BITS64
189248/* Like `mktime', but for TP represents Universal Time, not local time. */
190249extern time_t timegm (struct tm *__tp) __THROW;
191
192250/* Another name for `mktime'. */
193251extern time_t timelocal (struct tm *__tp) __THROW;
252#else
253# ifdef __REDIRECT_NTH
254extern time_t __REDIRECT_NTH (timegm, (struct tm *__tp), __timegm64);
255extern time_t __REDIRECT_NTH (timelocal, (struct tm *__tp), __mktime64);
256# else
257# define timegm __timegm64
258# endif
259#endif
194260
195261/* Return the number of days in YEAR. */
196262extern int dysize (int __year) __THROW __attribute__ ((__const__));
......@@ -198,6 +264,7 @@ extern int dysize (int __year) __THROW __attribute__ ((__const__));
198264
199265
200266#ifdef __USE_POSIX199309
267# ifndef __USE_TIME_BITS64
201268/* Pause execution for a number of nanoseconds.
202269
203270 This function is a cancellation point and therefore not marked with
......@@ -205,7 +272,6 @@ extern int dysize (int __year) __THROW __attribute__ ((__const__));
205272extern int nanosleep (const struct timespec *__requested_time,
206273 struct timespec *__remaining);
207274
208
209275/* Get resolution of clock CLOCK_ID. */
210276extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW;
211277
......@@ -215,15 +281,46 @@ extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW;
215281/* Set clock CLOCK_ID to value TP. */
216282extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
217283 __THROW;
284# else
285# ifdef __REDIRECT
286extern int __REDIRECT (nanosleep, (const struct timespec *__requested_time,
287 struct timespec *__remaining),
288 __nanosleep64);
289extern int __REDIRECT_NTH (clock_getres, (clockid_t __clock_id,
290 struct timespec *__res),
291 __clock_getres64);
292extern int __REDIRECT_NTH (clock_gettime, (clockid_t __clock_id, struct
293 timespec *__tp), __clock_gettime64);
294extern 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
218304
219305# ifdef __USE_XOPEN2K
220306/* High-resolution sleep with the specified clock.
221307
222308 This function is a cancellation point and therefore not marked with
223309 __THROW. */
310# ifndef __USE_TIME_BITS64
224311extern int clock_nanosleep (clockid_t __clock_id, int __flags,
225312 const struct timespec *__req,
226313 struct timespec *__rem);
314# else
315# ifdef __REDIRECT
316extern 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
227324
228325/* Return clock ID for CPU-time clock. */
229326extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW;
......@@ -239,6 +336,7 @@ extern int timer_create (clockid_t __clock_id,
239336extern int timer_delete (timer_t __timerid) __THROW;
240337
241338/* Set timer TIMERID to VALUE, returning old value in OVALUE. */
339# ifndef __USE_TIME_BITS64
242340extern int timer_settime (timer_t __timerid, int __flags,
243341 const struct itimerspec *__restrict __value,
244342 struct itimerspec *__restrict __ovalue) __THROW;
......@@ -246,6 +344,21 @@ extern int timer_settime (timer_t __timerid, int __flags,
246344/* Get current value of timer TIMERID and store it in VALUE. */
247345extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
248346 __THROW;
347# else
348# ifdef __REDIRECT_NTH
349extern 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
354extern 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
249362
250363/* Get expiration overrun for timer TIMERID. */
251364extern int timer_getoverrun (timer_t __timerid) __THROW;
......@@ -253,9 +366,35 @@ extern int timer_getoverrun (timer_t __timerid) __THROW;
253366
254367
255368#ifdef __USE_ISOC11
369# ifndef __USE_TIME_BITS64
256370/* Set TS to calendar time based in time base BASE. */
257371extern int timespec_get (struct timespec *__ts, int __base)
258372 __THROW __nonnull ((1));
373# else
374# ifdef __REDIRECT_NTH
375extern 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. */
387extern int timespec_getres (struct timespec *__ts, int __base)
388 __THROW;
389# else
390# ifdef __REDIRECT_NTH
391extern 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
259398#endif
260399
261400
lib/libc/include/generic-glibc/unistd.h+18
......@@ -295,6 +295,11 @@ extern int euidaccess (const char *__name, int __type)
295295/* An alias for `euidaccess', used by some other systems. */
296296extern int eaccess (const char *__name, int __type)
297297 __THROW __nonnull ((1));
298
299/* Execute program relative to a directory file descriptor. */
300extern int execveat (int __fd, const char *__path, char *const __argv[],
301 char *const __envp[], int __flags)
302 __THROW __nonnull ((2, 3));
298303#endif
299304
300305#ifdef __USE_ATFILE
......@@ -352,6 +357,12 @@ extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
352357 __THROW. */
353358extern int close (int __fd);
354359
360#ifdef __USE_MISC
361/* Close all open file descriptors greater than or equal to LOWFD.
362 Negative LOWFD is clamped to 0. */
363extern void closefrom (int __lowfd) __THROW;
364#endif
365
355366/* Read NBYTES into BUF from FD. Return the
356367 number read, -1 for errors or 0 for EOF.
357368
......@@ -776,6 +787,13 @@ extern __pid_t fork (void) __THROWNL;
776787extern __pid_t vfork (void) __THROW;
777788#endif /* Use misc or XPG < 7. */
778789
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. */
794extern __pid_t _Fork (void) __THROW;
795#endif
796
779797
780798/* Return the pathname of the terminal FD is open on, or NULL on errors.
781799 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
3535/* Structure describing file times. */
3636struct utimbuf
3737 {
38#ifdef __USE_TIME_BITS64
39 __time64_t actime; /* Access time. */
40 __time64_t modtime; /* Modification time. */
41#else
3842 __time_t actime; /* Access time. */
3943 __time_t modtime; /* Modification time. */
44#endif
4045 };
4146
4247/* Set the access and modification times of FILE to those given in
4348 *FILE_TIMES. If FILE_TIMES is NULL, set them to the current time. */
49#ifndef __USE_TIME_BITS64
4450extern int utime (const char *__file,
4551 const struct utimbuf *__file_times)
4652 __THROW __nonnull ((1));
4753
54#else
55# ifdef __REDIRECT_NTH
56extern 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
4864__END_DECLS
4965
5066#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,
151151 size_t __n, locale_t __loc) __THROW;
152152
153153/* Duplicate S, returning an identical malloc'd string. */
154extern wchar_t *wcsdup (const wchar_t *__s) __THROW __attribute_malloc__;
154extern wchar_t *wcsdup (const wchar_t *__s) __THROW
155 __attribute_malloc__ __attr_dealloc_free;
155156#endif
156157
157158/* Find the first occurrence of WC in WCS. */
......@@ -562,9 +563,23 @@ extern wchar_t *wcpncpy (wchar_t *__restrict __dest,
562563/* Wide character I/O functions. */
563564
564565#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
565579/* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces
566580 a wide character string. */
567extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW;
581extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW
582 __attribute_malloc__ __attr_dealloc_fclose;
568583#endif
569584
570585#if defined __USE_ISOC95 || defined __USE_UNIX98
lib/libc/include/i386-linux-gnu/bits/struct_stat.h+49-41
......@@ -25,43 +25,46 @@
2525
2626struct stat
2727 {
28#ifdef __USE_TIME_BITS64
29# include <bits/struct_stat_time64_helper.h>
30#else
2831 __dev_t st_dev; /* Device. */
29#ifndef __x86_64__
32# ifndef __x86_64__
3033 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
3336 __ino_t st_ino; /* File serial number. */
34#else
37# else
3538 __ino_t __st_ino; /* 32bit file serial number. */
36#endif
37#ifndef __x86_64__
39# endif
40# ifndef __x86_64__
3841 __mode_t st_mode; /* File mode. */
3942 __nlink_t st_nlink; /* Link count. */
40#else
43# else
4144 __nlink_t st_nlink; /* Link count. */
4245 __mode_t st_mode; /* File mode. */
43#endif
46# endif
4447 __uid_t st_uid; /* User ID of the file's owner. */
4548 __gid_t st_gid; /* Group ID of the file's group.*/
46#ifdef __x86_64__
49# ifdef __x86_64__
4750 int __pad0;
48#endif
51# endif
4952 __dev_t st_rdev; /* Device number, if device. */
50#ifndef __x86_64__
53# ifndef __x86_64__
5154 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
5457 __off_t st_size; /* Size of file, in bytes. */
55#else
58# else
5659 __off64_t st_size; /* Size of file, in bytes. */
57#endif
60# endif
5861 __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
6063 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
61#else
64# else
6265 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
63#endif
64#ifdef __USE_XOPEN2K8
66# endif
67# ifdef __USE_XOPEN2K8
6568 /* Nanosecond resolution timestamps are stored in a format
6669 equivalent to 'struct timespec'. This is the type used
6770 whenever possible but the Unix namespace rules do not allow the
......@@ -71,58 +74,62 @@ struct stat
7174 struct timespec st_atim; /* Time of last access. */
7275 struct timespec st_mtim; /* Time of last modification. */
7376 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
7881 __time_t st_atime; /* Time of last access. */
7982 __syscall_ulong_t st_atimensec; /* Nscecs of last access. */
8083 __time_t st_mtime; /* Time of last modification. */
8184 __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */
8285 __time_t st_ctime; /* Time of last status change. */
8386 __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */
84#endif
85#ifdef __x86_64__
87# endif
88# ifdef __x86_64__
8689 __syscall_slong_t __glibc_reserved[3];
87#else
88# ifndef __USE_FILE_OFFSET64
90# else
91# ifndef __USE_FILE_OFFSET64
8992 unsigned long int __glibc_reserved4;
9093 unsigned long int __glibc_reserved5;
91# else
94# else
9295 __ino64_t st_ino; /* File serial number. */
96# endif
9397# endif
94#endif
98#endif /* __USE_TIME_BITS64 */
9599 };
96100
97101#ifdef __USE_LARGEFILE64
98102/* Note stat64 has the same shape as stat for x86-64. */
99103struct stat64
100104 {
105# ifdef __USE_TIME_BITS64
106# include <bits/struct_stat_time64_helper.h>
107# else
101108 __dev_t st_dev; /* Device. */
102# ifdef __x86_64__
109# ifdef __x86_64__
103110 __ino64_t st_ino; /* File serial number. */
104111 __nlink_t st_nlink; /* Link count. */
105112 __mode_t st_mode; /* File mode. */
106# else
113# else
107114 unsigned int __pad1;
108115 __ino_t __st_ino; /* 32bit file serial number. */
109116 __mode_t st_mode; /* File mode. */
110117 __nlink_t st_nlink; /* Link count. */
111# endif
118# endif
112119 __uid_t st_uid; /* User ID of the file's owner. */
113120 __gid_t st_gid; /* Group ID of the file's group.*/
114# ifdef __x86_64__
121# ifdef __x86_64__
115122 int __pad0;
116123 __dev_t st_rdev; /* Device number, if device. */
117124 __off_t st_size; /* Size of file, in bytes. */
118# else
125# else
119126 __dev_t st_rdev; /* Device number, if device. */
120127 unsigned int __pad2;
121128 __off64_t st_size; /* Size of file, in bytes. */
122# endif
129# endif
123130 __blksize_t st_blksize; /* Optimal block size for I/O. */
124131 __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
125# ifdef __USE_XOPEN2K8
132# ifdef __USE_XOPEN2K8
126133 /* Nanosecond resolution timestamps are stored in a format
127134 equivalent to 'struct timespec'. This is the type used
128135 whenever possible but the Unix namespace rules do not allow the
......@@ -132,19 +139,20 @@ struct stat64
132139 struct timespec st_atim; /* Time of last access. */
133140 struct timespec st_mtim; /* Time of last modification. */
134141 struct timespec st_ctim; /* Time of last status change. */
135# else
142# else
136143 __time_t st_atime; /* Time of last access. */
137144 __syscall_ulong_t st_atimensec; /* Nscecs of last access. */
138145 __time_t st_mtime; /* Time of last modification. */
139146 __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */
140147 __time_t st_ctime; /* Time of last status change. */
141148 __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */
142# endif
143# ifdef __x86_64__
149# endif
150# ifdef __x86_64__
144151 __syscall_slong_t __glibc_reserved[3];
145# else
152# else
146153 __ino64_t st_ino; /* File serial number. */
147# endif
154# endif
155# endif /* __USE_TIME_BITS64 */
148156 };
149157#endif
150158
lib/libc/include/i386-linux-gnu/bits/types/struct_semid_ds.h+4
......@@ -23,6 +23,9 @@
2323/* Data structure describing a set of semaphores. */
2424struct semid_ds
2525{
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_semid64_ds_helper.h>
28#else
2629 struct ipc_perm sem_perm; /* operation permission struct */
2730 __time_t sem_otime; /* last semop() time */
2831 __syscall_ulong_t __sem_otime_high;
......@@ -31,4 +34,5 @@ struct semid_ds
3134 __syscall_ulong_t sem_nsems; /* number of semaphores in set */
3235 __syscall_ulong_t __glibc_reserved3;
3336 __syscall_ulong_t __glibc_reserved4;
37#endif
3438};
\ 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
29struct __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 @@
2525
2626struct stat
2727 {
28#ifdef __USE_TIME_BITS64
29# include <bits/struct_stat_time64_helper.h>
30#else
2831 __dev_t st_dev; /* Device. */
2932 unsigned short int __pad1;
30#ifndef __USE_FILE_OFFSET64
33# ifndef __USE_FILE_OFFSET64
3134 __ino_t st_ino; /* File serial number. */
32#else
35# else
3336 __ino_t __st_ino; /* 32bit file serial number. */
34#endif
37# endif
3538 __mode_t st_mode; /* File mode. */
3639 __nlink_t st_nlink; /* Link count. */
3740 __uid_t st_uid; /* User ID of the file's owner. */
3841 __gid_t st_gid; /* Group ID of the file's group.*/
3942 __dev_t st_rdev; /* Device number, if device. */
4043 unsigned short int __pad2;
41#ifndef __USE_FILE_OFFSET64
44# ifndef __USE_FILE_OFFSET64
4245 __off_t st_size; /* Size of file, in bytes. */
43#else
46# else
4447 __off64_t st_size; /* Size of file, in bytes. */
45#endif
48# endif
4649 __blksize_t st_blksize; /* Optimal block size for I/O. */
4750
48#ifndef __USE_FILE_OFFSET64
51# ifndef __USE_FILE_OFFSET64
4952 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
50#else
53# else
5154 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
52#endif
53#ifdef __USE_XOPEN2K8
55# endif
56# ifdef __USE_XOPEN2K8
5457 /* Nanosecond resolution timestamps are stored in a format
5558 equivalent to 'struct timespec'. This is the type used
5659 whenever possible but the Unix namespace rules do not allow the
......@@ -60,28 +63,32 @@ struct stat
6063 struct timespec st_atim; /* Time of last access. */
6164 struct timespec st_mtim; /* Time of last modification. */
6265 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
6770 __time_t st_atime; /* Time of last access. */
6871 unsigned long int st_atimensec; /* Nscecs of last access. */
6972 __time_t st_mtime; /* Time of last modification. */
7073 unsigned long int st_mtimensec; /* Nsecs of last modification. */
7174 __time_t st_ctime; /* Time of last status change. */
7275 unsigned long int st_ctimensec; /* Nsecs of last status change. */
73#endif
74#ifndef __USE_FILE_OFFSET64
76# endif
77# ifndef __USE_FILE_OFFSET64
7578 unsigned long int __glibc_reserved4;
7679 unsigned long int __glibc_reserved5;
77#else
80# else
7881 __ino64_t st_ino; /* File serial number. */
79#endif
82# endif
83#endif /* __USE_TIME_BITS64 */
8084 };
8185
8286#ifdef __USE_LARGEFILE64
8387struct stat64
8488 {
89# ifdef __USE_TIME_BITS64
90# include <bits/struct_stat_time64_helper.h>
91# else
8592 __dev_t st_dev; /* Device. */
8693 unsigned short int __pad1;
8794
......@@ -96,7 +103,7 @@ struct stat64
96103 __blksize_t st_blksize; /* Optimal block size for I/O. */
97104
98105 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
99# ifdef __USE_XOPEN2K8
106# ifdef __USE_XOPEN2K8
100107 /* Nanosecond resolution timestamps are stored in a format
101108 equivalent to 'struct timespec'. This is the type used
102109 whenever possible but the Unix namespace rules do not allow the
......@@ -106,15 +113,16 @@ struct stat64
106113 struct timespec st_atim; /* Time of last access. */
107114 struct timespec st_mtim; /* Time of last modification. */
108115 struct timespec st_ctim; /* Time of last status change. */
109# else
116# else
110117 __time_t st_atime; /* Time of last access. */
111118 unsigned long int st_atimensec; /* Nscecs of last access. */
112119 __time_t st_mtime; /* Time of last modification. */
113120 unsigned long int st_mtimensec; /* Nsecs of last modification. */
114121 __time_t st_ctime; /* Time of last status change. */
115122 unsigned long int st_ctimensec; /* Nsecs of last status change. */
116# endif
123# endif
117124 __ino64_t st_ino; /* File serial number. */
125# endif /* __USE_TIME_BITS64 */
118126 };
119127#endif
120128
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 @@
88#define LIBANL_SO "libanl.so.1"
99#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1010#define LIBCRYPT_SO "libcrypt.so.1"
11#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1112#define LIBC_SO "libc.so.6"
1213#define LIBDL_SO "libdl.so.2"
1314#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. */
60extern 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. */
23enum
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
80typedef 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. */
23enum
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
26struct 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
35struct 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
28typedef __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. */
31enum __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
139typedef __rlim_t rlim_t;
140#else
141typedef __rlim64_t rlim_t;
142#endif
143#ifdef __USE_LARGEFILE64
144typedef __rlim64_t rlim64_t;
145#endif
146
147struct 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
156struct 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? */
166enum __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. */
195enum __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
211extern 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
216extern 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
225extern 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
32typedef 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. */
27struct 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. */
39struct 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. */
63struct 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. */
23enum
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. */
24enum __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
24struct 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
52struct 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
22struct __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
22struct __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
24struct 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'. */
23enum
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. */
26typedef 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. */
25struct 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. */
24struct 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. */
24struct 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
32union 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
72union 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
135union 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
192union 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
261union 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. */
60extern 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. */
23enum
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. */
23enum
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
26struct 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
35struct 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
28typedef __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. */
31enum __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
139typedef __rlim_t rlim_t;
140#else
141typedef __rlim64_t rlim_t;
142#endif
143#ifdef __USE_LARGEFILE64
144typedef __rlim64_t rlim64_t;
145#endif
146
147struct 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
156struct 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? */
166enum __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. */
195enum __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
211extern 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
216extern 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
225extern 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
32typedef 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. */
27struct 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. */
39struct 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. */
63struct 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. */
23enum
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. */
24enum __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
24struct 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
52struct 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
22struct __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
24struct 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'. */
23enum
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. */
26typedef 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. */
27struct 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. */
24struct 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. */
24struct 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
32union 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
72union 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
135union 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
192union 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
261union 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. */
60extern 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. */
23enum
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. */
23enum
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
26struct 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
35struct 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
28typedef __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. */
31enum __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
139typedef __rlim_t rlim_t;
140#else
141typedef __rlim64_t rlim_t;
142#endif
143#ifdef __USE_LARGEFILE64
144typedef __rlim64_t rlim64_t;
145#endif
146
147struct 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
156struct 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? */
166enum __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. */
195enum __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
211extern 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
216extern 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
225extern 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
32typedef 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. */
27struct 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. */
39struct 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. */
63struct 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. */
23enum
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. */
24enum __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
24struct 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
52struct 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
22struct __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
24struct 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'. */
23enum
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. */
26typedef 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. */
27struct 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. */
24struct 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. */
24struct 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
32union 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
72union 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
135union 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
192union 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
261union 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
80typedef 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 @@
3030#define SO_OOBINLINE 256
3131#define SO_RCVBUF 4098
3232#define SO_RCVLOWAT 4100
33#define SO_RCVTIMEO 4102
3433#define SO_REUSEADDR 4
3534#define SO_SNDBUF 4097
3635#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
22struct __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 @@
2020# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
2121#endif
2222
23#include <bits/types/time_t.h>
24
2325/* Structure of record for one message inside the kernel.
2426 The type `struct msg' is opaque. */
2527struct msqid_ds
2628{
29#ifdef __USE_TIME_BITS64
30# include <bits/types/struct_msqid64_ds_helper.h>
31#else
2732 struct ipc_perm msg_perm; /* structure describing operation permission */
28#if __TIMESIZE == 32
29# ifdef __MIPSEL__
33# if __TIMESIZE == 32
34# ifdef __MIPSEL__
3035 __time_t msg_stime; /* time of last msgsnd command */
3136 unsigned long int __msg_stime_high;
3237 __time_t msg_rtime; /* time of last msgsnd command */
3338 unsigned long int __msg_rtime_high;
3439 __time_t msg_ctime; /* time of last change */
3540 unsigned long int __msg_ctime_high;
36# else
41# else
3742 unsigned long int __msg_stime_high;
3843 __time_t msg_stime; /* time of last msgsnd command */
3944 unsigned long int __msg_rtime_high;
4045 __time_t msg_rtime; /* time of last msgsnd command */
4146 unsigned long int __msg_ctime_high;
4247 __time_t msg_ctime; /* time of last change */
43# endif
44#else
48# endif
49# else
4550 __time_t msg_stime; /* time of last msgsnd command */
4651 __time_t msg_rtime; /* time of last msgsnd command */
4752 __time_t msg_ctime; /* time of last change */
48#endif
53# endif
4954 __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
5055 msgqnum_t msg_qnum; /* number of messages currently on queue */
5156 msglen_t msg_qbytes; /* max number of bytes allowed on queue */
......@@ -53,4 +58,5 @@ struct msqid_ds
5358 __pid_t msg_lrpid; /* pid of last msgrcv() */
5459 __syscall_ulong_t __glibc_reserved4;
5560 __syscall_ulong_t __glibc_reserved5;
61#endif
5662};
\ No newline at end of file
lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_semid_ds.h+4
......@@ -23,10 +23,14 @@
2323/* Data structure describing a set of semaphores. */
2424struct semid_ds
2525{
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_semid64_ds_helper.h>
28#else
2629 struct ipc_perm sem_perm; /* operation permission struct */
2730 __time_t sem_otime; /* last semop() time */
2831 __time_t sem_ctime; /* last time changed by semctl() */
2932 __syscall_ulong_t sem_nsems; /* number of semaphores in set */
3033 __syscall_ulong_t __sem_otime_high;
3134 __syscall_ulong_t __sem_ctime_high;
35#endif
3236};
\ No newline at end of file
lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_shmid_ds.h+9-5
......@@ -23,27 +23,31 @@
2323/* Data structure describing a shared memory segment. */
2424struct shmid_ds
2525 {
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_shmid64_ds_helper.h>
28#else
2629 struct ipc_perm shm_perm; /* operation permission struct */
2730 size_t shm_segsz; /* size of segment in bytes */
28#if __TIMESIZE == 32
31# if __TIMESIZE == 32
2932 __time_t shm_atime; /* time of last shmat() */
3033 __time_t shm_dtime; /* time of last shmdt() */
3134 __time_t shm_ctime; /* time of last change by shmctl() */
32#else
35# else
3336 __time_t shm_atime; /* time of last shmat() */
3437 __time_t shm_dtime; /* time of last shmdt() */
3538 __time_t shm_ctime; /* time of last change by shmctl() */
36#endif
39# endif
3740 __pid_t shm_cpid; /* pid of creator */
3841 __pid_t shm_lpid; /* pid of last shmop */
3942 shmatt_t shm_nattch; /* number of current attaches */
40#if __TIMESIZE == 32
43# if __TIMESIZE == 32
4144 unsigned short int __shm_atime_high;
4245 unsigned short int __shm_dtime_high;
4346 unsigned short int __shm_ctime_high;
4447 unsigned short int __glibc_reserved4;
45#else
48# else
4649 __syscall_ulong_t __glibc_reserved5;
4750 __syscall_ulong_t __glibc_reserved6;
51# endif
4852#endif
4953 };
\ 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
80typedef 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 @@
3030#define SO_OOBINLINE 256
3131#define SO_RCVBUF 4098
3232#define SO_RCVLOWAT 4100
33#define SO_RCVTIMEO 4102
3433#define SO_REUSEADDR 4
3534#define SO_SNDBUF 4097
3635#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
22struct __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 @@
2020# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
2121#endif
2222
23#include <bits/types/time_t.h>
24
2325/* Structure of record for one message inside the kernel.
2426 The type `struct msg' is opaque. */
2527struct msqid_ds
2628{
29#ifdef __USE_TIME_BITS64
30# include <bits/types/struct_msqid64_ds_helper.h>
31#else
2732 struct ipc_perm msg_perm; /* structure describing operation permission */
28#if __TIMESIZE == 32
29# ifdef __MIPSEL__
33# if __TIMESIZE == 32
34# ifdef __MIPSEL__
3035 __time_t msg_stime; /* time of last msgsnd command */
3136 unsigned long int __msg_stime_high;
3237 __time_t msg_rtime; /* time of last msgsnd command */
3338 unsigned long int __msg_rtime_high;
3439 __time_t msg_ctime; /* time of last change */
3540 unsigned long int __msg_ctime_high;
36# else
41# else
3742 unsigned long int __msg_stime_high;
3843 __time_t msg_stime; /* time of last msgsnd command */
3944 unsigned long int __msg_rtime_high;
4045 __time_t msg_rtime; /* time of last msgsnd command */
4146 unsigned long int __msg_ctime_high;
4247 __time_t msg_ctime; /* time of last change */
43# endif
44#else
48# endif
49# else
4550 __time_t msg_stime; /* time of last msgsnd command */
4651 __time_t msg_rtime; /* time of last msgsnd command */
4752 __time_t msg_ctime; /* time of last change */
48#endif
53# endif
4954 __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
5055 msgqnum_t msg_qnum; /* number of messages currently on queue */
5156 msglen_t msg_qbytes; /* max number of bytes allowed on queue */
......@@ -53,4 +58,5 @@ struct msqid_ds
5358 __pid_t msg_lrpid; /* pid of last msgrcv() */
5459 __syscall_ulong_t __glibc_reserved4;
5560 __syscall_ulong_t __glibc_reserved5;
61#endif
5662};
\ No newline at end of file
lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_semid_ds.h+4
......@@ -23,10 +23,14 @@
2323/* Data structure describing a set of semaphores. */
2424struct semid_ds
2525{
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_semid64_ds_helper.h>
28#else
2629 struct ipc_perm sem_perm; /* operation permission struct */
2730 __time_t sem_otime; /* last semop() time */
2831 __time_t sem_ctime; /* last time changed by semctl() */
2932 __syscall_ulong_t sem_nsems; /* number of semaphores in set */
3033 __syscall_ulong_t __sem_otime_high;
3134 __syscall_ulong_t __sem_ctime_high;
35#endif
3236};
\ No newline at end of file
lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_shmid_ds.h+9-5
......@@ -23,27 +23,31 @@
2323/* Data structure describing a shared memory segment. */
2424struct shmid_ds
2525 {
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_shmid64_ds_helper.h>
28#else
2629 struct ipc_perm shm_perm; /* operation permission struct */
2730 size_t shm_segsz; /* size of segment in bytes */
28#if __TIMESIZE == 32
31# if __TIMESIZE == 32
2932 __time_t shm_atime; /* time of last shmat() */
3033 __time_t shm_dtime; /* time of last shmdt() */
3134 __time_t shm_ctime; /* time of last change by shmctl() */
32#else
35# else
3336 __time_t shm_atime; /* time of last shmat() */
3437 __time_t shm_dtime; /* time of last shmdt() */
3538 __time_t shm_ctime; /* time of last change by shmctl() */
36#endif
39# endif
3740 __pid_t shm_cpid; /* pid of creator */
3841 __pid_t shm_lpid; /* pid of last shmop */
3942 shmatt_t shm_nattch; /* number of current attaches */
40#if __TIMESIZE == 32
43# if __TIMESIZE == 32
4144 unsigned short int __shm_atime_high;
4245 unsigned short int __shm_dtime_high;
4346 unsigned short int __shm_ctime_high;
4447 unsigned short int __glibc_reserved4;
45#else
48# else
4649 __syscall_ulong_t __glibc_reserved5;
4750 __syscall_ulong_t __glibc_reserved6;
51# endif
4852#endif
4953 };
\ 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
80typedef 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 @@
3030#define SO_OOBINLINE 256
3131#define SO_RCVBUF 4098
3232#define SO_RCVLOWAT 4100
33#define SO_RCVTIMEO 4102
3433#define SO_REUSEADDR 4
3534#define SO_SNDBUF 4097
3635#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
22struct __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 @@
2020# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
2121#endif
2222
23#include <bits/types/time_t.h>
24
2325/* Structure of record for one message inside the kernel.
2426 The type `struct msg' is opaque. */
2527struct msqid_ds
2628{
29#ifdef __USE_TIME_BITS64
30# include <bits/types/struct_msqid64_ds_helper.h>
31#else
2732 struct ipc_perm msg_perm; /* structure describing operation permission */
28#if __TIMESIZE == 32
29# ifdef __MIPSEL__
33# if __TIMESIZE == 32
34# ifdef __MIPSEL__
3035 __time_t msg_stime; /* time of last msgsnd command */
3136 unsigned long int __msg_stime_high;
3237 __time_t msg_rtime; /* time of last msgsnd command */
3338 unsigned long int __msg_rtime_high;
3439 __time_t msg_ctime; /* time of last change */
3540 unsigned long int __msg_ctime_high;
36# else
41# else
3742 unsigned long int __msg_stime_high;
3843 __time_t msg_stime; /* time of last msgsnd command */
3944 unsigned long int __msg_rtime_high;
4045 __time_t msg_rtime; /* time of last msgsnd command */
4146 unsigned long int __msg_ctime_high;
4247 __time_t msg_ctime; /* time of last change */
43# endif
44#else
48# endif
49# else
4550 __time_t msg_stime; /* time of last msgsnd command */
4651 __time_t msg_rtime; /* time of last msgsnd command */
4752 __time_t msg_ctime; /* time of last change */
48#endif
53# endif
4954 __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
5055 msgqnum_t msg_qnum; /* number of messages currently on queue */
5156 msglen_t msg_qbytes; /* max number of bytes allowed on queue */
......@@ -53,4 +58,5 @@ struct msqid_ds
5358 __pid_t msg_lrpid; /* pid of last msgrcv() */
5459 __syscall_ulong_t __glibc_reserved4;
5560 __syscall_ulong_t __glibc_reserved5;
61#endif
5662};
\ No newline at end of file
lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_semid_ds.h+4
......@@ -23,10 +23,14 @@
2323/* Data structure describing a set of semaphores. */
2424struct semid_ds
2525{
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_semid64_ds_helper.h>
28#else
2629 struct ipc_perm sem_perm; /* operation permission struct */
2730 __time_t sem_otime; /* last semop() time */
2831 __time_t sem_ctime; /* last time changed by semctl() */
2932 __syscall_ulong_t sem_nsems; /* number of semaphores in set */
3033 __syscall_ulong_t __sem_otime_high;
3134 __syscall_ulong_t __sem_ctime_high;
35#endif
3236};
\ No newline at end of file
lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_shmid_ds.h+9-5
......@@ -23,27 +23,31 @@
2323/* Data structure describing a shared memory segment. */
2424struct shmid_ds
2525 {
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_shmid64_ds_helper.h>
28#else
2629 struct ipc_perm shm_perm; /* operation permission struct */
2730 size_t shm_segsz; /* size of segment in bytes */
28#if __TIMESIZE == 32
31# if __TIMESIZE == 32
2932 __time_t shm_atime; /* time of last shmat() */
3033 __time_t shm_dtime; /* time of last shmdt() */
3134 __time_t shm_ctime; /* time of last change by shmctl() */
32#else
35# else
3336 __time_t shm_atime; /* time of last shmat() */
3437 __time_t shm_dtime; /* time of last shmdt() */
3538 __time_t shm_ctime; /* time of last change by shmctl() */
36#endif
39# endif
3740 __pid_t shm_cpid; /* pid of creator */
3841 __pid_t shm_lpid; /* pid of last shmop */
3942 shmatt_t shm_nattch; /* number of current attaches */
40#if __TIMESIZE == 32
43# if __TIMESIZE == 32
4144 unsigned short int __shm_atime_high;
4245 unsigned short int __shm_dtime_high;
4346 unsigned short int __shm_ctime_high;
4447 unsigned short int __glibc_reserved4;
45#else
48# else
4649 __syscall_ulong_t __glibc_reserved5;
4750 __syscall_ulong_t __glibc_reserved6;
51# endif
4852#endif
4953 };
\ 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
80typedef 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 @@
3030#define SO_OOBINLINE 256
3131#define SO_RCVBUF 4098
3232#define SO_RCVLOWAT 4100
33#define SO_RCVTIMEO 4102
3433#define SO_REUSEADDR 4
3534#define SO_SNDBUF 4097
3635#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
22struct __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 @@
2020# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
2121#endif
2222
23#include <bits/types/time_t.h>
24
2325/* Structure of record for one message inside the kernel.
2426 The type `struct msg' is opaque. */
2527struct msqid_ds
2628{
29#ifdef __USE_TIME_BITS64
30# include <bits/types/struct_msqid64_ds_helper.h>
31#else
2732 struct ipc_perm msg_perm; /* structure describing operation permission */
28#if __TIMESIZE == 32
29# ifdef __MIPSEL__
33# if __TIMESIZE == 32
34# ifdef __MIPSEL__
3035 __time_t msg_stime; /* time of last msgsnd command */
3136 unsigned long int __msg_stime_high;
3237 __time_t msg_rtime; /* time of last msgsnd command */
3338 unsigned long int __msg_rtime_high;
3439 __time_t msg_ctime; /* time of last change */
3540 unsigned long int __msg_ctime_high;
36# else
41# else
3742 unsigned long int __msg_stime_high;
3843 __time_t msg_stime; /* time of last msgsnd command */
3944 unsigned long int __msg_rtime_high;
4045 __time_t msg_rtime; /* time of last msgsnd command */
4146 unsigned long int __msg_ctime_high;
4247 __time_t msg_ctime; /* time of last change */
43# endif
44#else
48# endif
49# else
4550 __time_t msg_stime; /* time of last msgsnd command */
4651 __time_t msg_rtime; /* time of last msgsnd command */
4752 __time_t msg_ctime; /* time of last change */
48#endif
53# endif
4954 __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
5055 msgqnum_t msg_qnum; /* number of messages currently on queue */
5156 msglen_t msg_qbytes; /* max number of bytes allowed on queue */
......@@ -53,4 +58,5 @@ struct msqid_ds
5358 __pid_t msg_lrpid; /* pid of last msgrcv() */
5459 __syscall_ulong_t __glibc_reserved4;
5560 __syscall_ulong_t __glibc_reserved5;
61#endif
5662};
\ No newline at end of file
lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_semid_ds.h+4
......@@ -23,10 +23,14 @@
2323/* Data structure describing a set of semaphores. */
2424struct semid_ds
2525{
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_semid64_ds_helper.h>
28#else
2629 struct ipc_perm sem_perm; /* operation permission struct */
2730 __time_t sem_otime; /* last semop() time */
2831 __time_t sem_ctime; /* last time changed by semctl() */
2932 __syscall_ulong_t sem_nsems; /* number of semaphores in set */
3033 __syscall_ulong_t __sem_otime_high;
3134 __syscall_ulong_t __sem_ctime_high;
35#endif
3236};
\ No newline at end of file
lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_shmid_ds.h+9-5
......@@ -23,27 +23,31 @@
2323/* Data structure describing a shared memory segment. */
2424struct shmid_ds
2525 {
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_shmid64_ds_helper.h>
28#else
2629 struct ipc_perm shm_perm; /* operation permission struct */
2730 size_t shm_segsz; /* size of segment in bytes */
28#if __TIMESIZE == 32
31# if __TIMESIZE == 32
2932 __time_t shm_atime; /* time of last shmat() */
3033 __time_t shm_dtime; /* time of last shmdt() */
3134 __time_t shm_ctime; /* time of last change by shmctl() */
32#else
35# else
3336 __time_t shm_atime; /* time of last shmat() */
3437 __time_t shm_dtime; /* time of last shmdt() */
3538 __time_t shm_ctime; /* time of last change by shmctl() */
36#endif
39# endif
3740 __pid_t shm_cpid; /* pid of creator */
3841 __pid_t shm_lpid; /* pid of last shmop */
3942 shmatt_t shm_nattch; /* number of current attaches */
40#if __TIMESIZE == 32
43# if __TIMESIZE == 32
4144 unsigned short int __shm_atime_high;
4245 unsigned short int __shm_dtime_high;
4346 unsigned short int __shm_ctime_high;
4447 unsigned short int __glibc_reserved4;
45#else
48# else
4649 __syscall_ulong_t __glibc_reserved5;
4750 __syscall_ulong_t __glibc_reserved6;
51# endif
4852#endif
4953 };
\ 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. */
60extern 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. */
23enum
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
80typedef 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. */
23enum
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
26struct 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
35struct 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
28typedef __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. */
31enum __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
139typedef __rlim_t rlim_t;
140#else
141typedef __rlim64_t rlim_t;
142#endif
143#ifdef __USE_LARGEFILE64
144typedef __rlim64_t rlim64_t;
145#endif
146
147struct 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
156struct 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? */
166enum __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. */
195enum __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
211extern 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
216extern 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
225extern 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
32typedef 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. */
27struct 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. */
39struct 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. */
63struct 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. */
23enum
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. */
24enum __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
24struct 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
52struct 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
22struct __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
22struct __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
24struct 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'. */
23enum
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. */
26typedef 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. */
25struct 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. */
24struct 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. */
24struct 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
32union 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
72union 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
135union 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
192union 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
261union 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. */
60extern 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. */
23enum
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. */
23enum
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
26struct 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
35struct 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
28typedef __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. */
31enum __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
139typedef __rlim_t rlim_t;
140#else
141typedef __rlim64_t rlim_t;
142#endif
143#ifdef __USE_LARGEFILE64
144typedef __rlim64_t rlim64_t;
145#endif
146
147struct 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
156struct 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? */
166enum __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. */
195enum __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
211extern 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
216extern 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
225extern 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
32typedef 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. */
27struct 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. */
39struct 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. */
63struct 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. */
23enum
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. */
24enum __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
24struct 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
52struct 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
22struct __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
24struct 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'. */
23enum
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. */
26typedef 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. */
27struct 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. */
24struct 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. */
24struct 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
32union 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
72union 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
135union 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
192union 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
261union 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. */
60extern 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. */
23enum
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. */
23enum
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
26struct 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
35struct 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
28typedef __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. */
31enum __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
139typedef __rlim_t rlim_t;
140#else
141typedef __rlim64_t rlim_t;
142#endif
143#ifdef __USE_LARGEFILE64
144typedef __rlim64_t rlim64_t;
145#endif
146
147struct 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
156struct 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? */
166enum __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. */
195enum __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
211extern 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
216extern 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
225extern 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
32typedef 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. */
27struct 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. */
39struct 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. */
63struct 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. */
23enum
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. */
24enum __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
24struct 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
52struct 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
22struct __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
24struct 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'. */
23enum
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. */
26typedef 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. */
27struct 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. */
24struct 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. */
24struct 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
32union 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
72union 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
135union 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
192union 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
261union 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
36struct 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
51struct 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... */
25enum
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. */
118enum
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. */
135typedef 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). */
139typedef double fenv_t;
140
141/* If the default argument is used we use this value. */
142extern 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. */
148extern 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. */
153extern 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. */
175typedef double femode_t;
176
177/* Default floating-point control modes. */
178extern 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
75typedef 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. */
79typedef __float128 _Float128;
80/* Add a typedef for older GCC and C++ compilers which don't natively support
81 _Complex _Float128. */
82typedef _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
27struct 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
36struct 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. */
24struct 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
26extern 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)). */
49extern "C++" {
50inline int iscanonical (float __val) { return __iscanonicalf (__val); }
51inline int iscanonical (double __val) { return __iscanonical (__val); }
52inline int iscanonical (long double __val) { return __iscanonicall (__val); }
53# if __HAVE_DISTINCT_FLOAT128
54inline 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. */
27typedef 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. */
37typedef 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
48extern 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);
56extern 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. */
70typedef 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. */
82typedef 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
93extern 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);
101extern 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. */
114typedef 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. */
126typedef 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
137extern 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);
145extern 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
38typedef unsigned long elf_greg_t;
39typedef elf_greg_t elf_gregset_t[ELF_NGREG];
40
41typedef double elf_fpreg_t;
42typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
43
44/* Altivec registers */
45typedef struct {
46 unsigned int u[4];
47} __attribute__ ((__aligned__ (16))) elf_vrreg_t;
48typedef 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
42typedef 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. */
46typedef 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
22struct __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
23struct __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
30struct 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
84struct 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
125struct 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
178struct 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
25struct sgttyb {
26 char sg_ispeed;
27 char sg_ospeed;
28 char sg_erase;
29 char sg_kill;
30 short sg_flags;
31};
32
33struct 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
42struct 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. */
25struct 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. */
24struct 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. */
24struct 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. */
30typedef unsigned int fpu_control_t;
31# define _FPU_GETCW(cw) (cw) = 0
32# define _FPU_SETCW(cw) (void) (cw)
33extern 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. */
65typedef 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. */
110extern 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
28union 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
68union 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 */
117union 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. */
184union 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.' */
77enum __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
33struct __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. */
44typedef unsigned long gregset_t[__NGREG];
45
46/* Container for floating-point registers and status */
47typedef 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. */
56typedef 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. */
65typedef 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
93typedef unsigned long gregset_t[__NGREG];
94typedef 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. */
99typedef 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. */
112typedef 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
120typedef 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. */
155typedef 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
26struct 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
36struct 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
51struct 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... */
25enum
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. */
118enum
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. */
135typedef 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). */
139typedef double fenv_t;
140
141/* If the default argument is used we use this value. */
142extern 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. */
148extern 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. */
153extern 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. */
175typedef double femode_t;
176
177/* Default floating-point control modes. */
178extern 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
75typedef 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. */
79typedef __float128 _Float128;
80/* Add a typedef for older GCC and C++ compilers which don't natively support
81 _Complex _Float128. */
82typedef _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
27struct 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
36struct 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. */
24struct 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
26extern 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)). */
49extern "C++" {
50inline int iscanonical (float __val) { return __iscanonicalf (__val); }
51inline int iscanonical (double __val) { return __iscanonical (__val); }
52inline int iscanonical (long double __val) { return __iscanonicall (__val); }
53# if __HAVE_DISTINCT_FLOAT128
54inline 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. */
27typedef 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. */
37typedef 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
48extern 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);
56extern 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. */
70typedef 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. */
82typedef 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
93extern 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);
101extern 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. */
114typedef 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. */
126typedef 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
137extern 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);
145extern 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
38typedef unsigned long elf_greg_t;
39typedef elf_greg_t elf_gregset_t[ELF_NGREG];
40
41typedef double elf_fpreg_t;
42typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
43
44/* Altivec registers */
45typedef struct {
46 unsigned int u[4];
47} __attribute__ ((__aligned__ (16))) elf_vrreg_t;
48typedef 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
42typedef 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. */
46typedef 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
22struct __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
23struct __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
29struct 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
86struct 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
131struct 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
184struct 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
25struct sgttyb {
26 char sg_ispeed;
27 char sg_ospeed;
28 char sg_erase;
29 char sg_kill;
30 short sg_flags;
31};
32
33struct 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
42struct 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. */
27struct 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. */
24struct 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. */
24struct 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. */
30typedef unsigned int fpu_control_t;
31# define _FPU_GETCW(cw) (cw) = 0
32# define _FPU_SETCW(cw) (void) (cw)
33extern 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. */
65typedef 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. */
110extern 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
28union 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
68union 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 */
117union 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. */
184union 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.' */
79enum __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
33struct __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. */
44typedef unsigned long gregset_t[__NGREG];
45
46/* Container for floating-point registers and status */
47typedef 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. */
56typedef 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. */
65typedef 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
93typedef unsigned long gregset_t[__NGREG];
94typedef 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. */
99typedef 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. */
112typedef 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
120typedef 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. */
155typedef 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
26struct 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
36struct 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
51struct 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... */
25enum
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. */
118enum
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. */
135typedef 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). */
139typedef double fenv_t;
140
141/* If the default argument is used we use this value. */
142extern 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. */
148extern 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. */
153extern 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. */
175typedef double femode_t;
176
177/* Default floating-point control modes. */
178extern 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
75typedef 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. */
79typedef __float128 _Float128;
80/* Add a typedef for older GCC and C++ compilers which don't natively support
81 _Complex _Float128. */
82typedef _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
27struct 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
36struct 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. */
24struct 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
26extern 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)). */
49extern "C++" {
50inline int iscanonical (float __val) { return __iscanonicalf (__val); }
51inline int iscanonical (double __val) { return __iscanonical (__val); }
52inline int iscanonical (long double __val) { return __iscanonicall (__val); }
53# if __HAVE_DISTINCT_FLOAT128
54inline 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. */
27typedef 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. */
37typedef 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
48extern 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);
56extern 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. */
70typedef 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. */
82typedef 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
93extern 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);
101extern 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. */
114typedef 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. */
126typedef 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
137extern 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);
145extern 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
38typedef unsigned long elf_greg_t;
39typedef elf_greg_t elf_gregset_t[ELF_NGREG];
40
41typedef double elf_fpreg_t;
42typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
43
44/* Altivec registers */
45typedef struct {
46 unsigned int u[4];
47} __attribute__ ((__aligned__ (16))) elf_vrreg_t;
48typedef 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
42typedef 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. */
46typedef 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
22struct __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
23struct __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
29struct 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
86struct 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
131struct 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
184struct 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
25struct sgttyb {
26 char sg_ispeed;
27 char sg_ospeed;
28 char sg_erase;
29 char sg_kill;
30 short sg_flags;
31};
32
33struct 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
42struct 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. */
27struct 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. */
24struct 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. */
24struct 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. */
30typedef unsigned int fpu_control_t;
31# define _FPU_GETCW(cw) (cw) = 0
32# define _FPU_SETCW(cw) (void) (cw)
33extern 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. */
65typedef 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. */
110extern 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
28union 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
68union 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 */
117union 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. */
184union 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.' */
79enum __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
33struct __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. */
44typedef unsigned long gregset_t[__NGREG];
45
46/* Container for floating-point registers and status */
47typedef 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. */
56typedef 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. */
65typedef 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
93typedef unsigned long gregset_t[__NGREG];
94typedef 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. */
99typedef 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. */
112typedef 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
120typedef 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. */
155typedef 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
26struct 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 @@
3030#define SO_OOBINLINE 10
3131#define SO_RCVBUF 8
3232#define SO_RCVLOWAT 16
33#define SO_RCVTIMEO 18
3433#define SO_REUSEADDR 2
3534#define SO_SNDBUF 7
3635#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 @@
2626#include <bits/wordsize.h>
2727
2828#if __WORDSIZE == 32
29
3029struct stat
3130 {
31# ifdef __USE_TIME_BITS64
32# include <bits/struct_stat_time64_helper.h>
33# else
3234 __dev_t st_dev; /* Device. */
33# ifndef __USE_FILE_OFFSET64
35# ifndef __USE_FILE_OFFSET64
3436 unsigned short int __pad1;
3537 __ino_t st_ino; /* File serial number. */
36# else
38# else
3739 __ino64_t st_ino; /* File serial number. */
38# endif
40# endif
3941 __mode_t st_mode; /* File mode. */
4042 __nlink_t st_nlink; /* Link count. */
4143 __uid_t st_uid; /* User ID of the file's owner. */
4244 __gid_t st_gid; /* Group ID of the file's group.*/
4345 __dev_t st_rdev; /* Device number, if device. */
4446 unsigned short int __pad2;
45# ifndef __USE_FILE_OFFSET64
47# ifndef __USE_FILE_OFFSET64
4648 __off_t st_size; /* Size of file, in bytes. */
47# else
49# else
4850 __off64_t st_size; /* Size of file, in bytes. */
49# endif
51# endif
5052 __blksize_t st_blksize; /* Optimal block size for I/O. */
5153
52# ifndef __USE_FILE_OFFSET64
54# ifndef __USE_FILE_OFFSET64
5355 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
54# else
56# else
5557 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
56# endif
57# ifdef __USE_XOPEN2K8
58# endif
59# ifdef __USE_XOPEN2K8
5860 /* Nanosecond resolution timestamps are stored in a format
5961 equivalent to 'struct timespec'. This is the type used
6062 whenever possible but the Unix namespace rules do not allow the
......@@ -64,25 +66,28 @@ struct stat
6466 struct timespec st_atim; /* Time of last access. */
6567 struct timespec st_mtim; /* Time of last modification. */
6668 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
7173 __time_t st_atime; /* Time of last access. */
7274 unsigned long int st_atimensec; /* Nscecs of last access. */
7375 __time_t st_mtime; /* Time of last modification. */
7476 unsigned long int st_mtimensec; /* Nsecs of last modification. */
7577 __time_t st_ctime; /* Time of last status change. */
7678 unsigned long int st_ctimensec; /* Nsecs of last status change. */
77# endif
79# endif
7880 unsigned long int __glibc_reserved4;
7981 unsigned long int __glibc_reserved5;
82# endif /* __USE_TIME_BITS64 */
8083 };
8184
82
8385# ifdef __USE_LARGEFILE64
8486struct stat64
8587 {
88# ifdef __USE_TIME_BITS64
89# include <bits/struct_stat_time64_helper.h>
90# else
8691 __dev_t st_dev; /* Device. */
8792 __ino64_t st_ino; /* File serial number. */
8893 __mode_t st_mode; /* File mode. */
......@@ -94,7 +99,7 @@ struct stat64
9499 __off64_t st_size; /* Size of file, in bytes. */
95100 __blksize_t st_blksize; /* Optimal block size for I/O. */
96101 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
97# ifdef __USE_XOPEN2K8
102# ifdef __USE_XOPEN2K8
98103 /* Nanosecond resolution timestamps are stored in a format
99104 equivalent to 'struct timespec'. This is the type used
100105 whenever possible but the Unix namespace rules do not allow the
......@@ -104,19 +109,20 @@ struct stat64
104109 struct timespec st_atim; /* Time of last access. */
105110 struct timespec st_mtim; /* Time of last modification. */
106111 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
111116 __time_t st_atime; /* Time of last access. */
112117 unsigned long int st_atimensec; /* Nscecs of last access. */
113118 __time_t st_mtime; /* Time of last modification. */
114119 unsigned long int st_mtimensec; /* Nsecs of last modification. */
115120 __time_t st_ctime; /* Time of last status change. */
116121 unsigned long int st_ctimensec; /* Nsecs of last status change. */
117# endif
122# endif
118123 unsigned long int __glibc_reserved4;
119124 unsigned long int __glibc_reserved5;
125# endif /* __USE_TIME_BITS64 */
120126 };
121127# endif /* __USE_LARGEFILE64 */
122128
lib/libc/include/powerpc64-linux-gnu/bits/types/struct_msqid_ds.h+9-3
......@@ -20,23 +20,28 @@
2020# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
2121#endif
2222
23#include <bits/types/time_t.h>
24
2325/* Structure of record for one message inside the kernel.
2426 The type `struct msg' is opaque. */
2527struct msqid_ds
2628{
29#ifdef __USE_TIME_BITS64
30# include <bits/types/struct_msqid64_ds_helper.h>
31#else
2732 struct ipc_perm msg_perm; /* structure describing operation permission */
28#if __TIMESIZE == 32
33# if __TIMESIZE == 32
2934 unsigned long int __msg_stime_high;
3035 __time_t msg_stime; /* time of last msgsnd command */
3136 unsigned long int __msg_rtime_high;
3237 __time_t msg_rtime; /* time of last msgsnd command */
3338 unsigned long int __msg_ctime_high;
3439 __time_t msg_ctime; /* time of last change */
35#else
40# else
3641 __time_t msg_stime; /* time of last msgsnd command */
3742 __time_t msg_rtime; /* time of last msgsnd command */
3843 __time_t msg_ctime; /* time of last change */
39#endif
44# endif
4045 __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
4146 msgqnum_t msg_qnum; /* number of messages currently on queue */
4247 msglen_t msg_qbytes; /* max number of bytes allowed on queue */
......@@ -44,4 +49,5 @@ struct msqid_ds
4449 __pid_t msg_lrpid; /* pid of last msgrcv() */
4550 __syscall_ulong_t __glibc_reserved4;
4651 __syscall_ulong_t __glibc_reserved5;
52#endif
4753};
\ No newline at end of file
lib/libc/include/powerpc64-linux-gnu/bits/types/struct_semid_ds.h+7-3
......@@ -23,17 +23,21 @@
2323/* Data structure describing a set of semaphores. */
2424struct semid_ds
2525{
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_semid64_ds_helper.h>
28#else
2629 struct ipc_perm sem_perm; /* operation permission struct */
27#if __TIMESIZE == 32
30# if __TIMESIZE == 32
2831 __syscall_ulong_t __sem_otime_high;
2932 __time_t sem_otime; /* last semop() time */
3033 __syscall_ulong_t __sem_ctime_high;
3134 __time_t sem_ctime; /* last time changed by semctl() */
32#else
35# else
3336 __time_t sem_otime; /* last semop() time */
3437 __time_t sem_ctime; /* last time changed by semctl() */
35#endif
38# endif
3639 __syscall_ulong_t sem_nsems; /* number of semaphores in set */
3740 __syscall_ulong_t __glibc_reserved3;
3841 __syscall_ulong_t __glibc_reserved4;
42#endif
3943};
\ No newline at end of file
lib/libc/include/powerpc64-linux-gnu/bits/types/struct_shmid_ds.h+7-3
......@@ -23,8 +23,11 @@
2323/* Data structure describing a shared memory segment. */
2424struct shmid_ds
2525 {
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_shmid64_ds_helper.h>
28#else
2629 struct ipc_perm shm_perm; /* operation permission struct */
27#if __TIMESIZE == 32
30# if __TIMESIZE == 32
2831 unsigned long int __shm_atime_high;
2932 __time_t shm_atime; /* time of last shmat() */
3033 unsigned long int __shm_dtime_high;
......@@ -32,15 +35,16 @@ struct shmid_ds
3235 unsigned long int __shm_ctime_high;
3336 __time_t shm_ctime; /* time of last change by shmctl() */
3437 unsigned long int __glibc_reserved4;
35#else
38# else
3639 __time_t shm_atime; /* time of last shmat() */
3740 __time_t shm_dtime; /* time of last shmdt() */
3841 __time_t shm_ctime; /* time of last change by shmctl() */
39#endif
42# endif
4043 size_t shm_segsz; /* size of segment in bytes */
4144 __pid_t shm_cpid; /* pid of creator */
4245 __pid_t shm_lpid; /* pid of last shmop */
4346 shmatt_t shm_nattch; /* number of current attaches */
4447 __syscall_ulong_t __glibc_reserved5;
4548 __syscall_ulong_t __glibc_reserved6;
49#endif
4650 };
\ No newline at end of file
lib/libc/include/powerpc64-linux-gnu/gnu/lib-names-64-v1.h+1
......@@ -8,6 +8,7 @@
88#define LIBANL_SO "libanl.so.1"
99#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1010#define LIBCRYPT_SO "libcrypt.so.1"
11#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1112#define LIBC_SO "libc.so.6"
1213#define LIBDL_SO "libdl.so.2"
1314#define LIBGCC_S_SO "libgcc_s.so.1"
lib/libc/include/powerpc64-linux-gnu/sys/ptrace.h+10
......@@ -70,6 +70,8 @@ __BEGIN_DECLS
7070# undef PTRACE_SYSCALL_INFO_ENTRY
7171# undef PTRACE_SYSCALL_INFO_EXIT
7272# undef PTRACE_SYSCALL_INFO_SECCOMP
73# undef PTRACE_SYSEMU
74# undef PTRACE_SYSEMU_SINGLESTEP
7375# undef PTRACE_TRACEME
7476#endif
7577
......@@ -188,6 +190,14 @@ enum __ptrace_request
188190 PTRACE_SETVSRREGS = 28,
189191#define PT_SETVSRREGS PTRACE_SETVSRREGS
190192
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
191201 /* Execute process until next taken branch. */
192202 PTRACE_SINGLEBLOCK = 256,
193203#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 @@
3030#define SO_OOBINLINE 10
3131#define SO_RCVBUF 8
3232#define SO_RCVLOWAT 16
33#define SO_RCVTIMEO 18
3433#define SO_REUSEADDR 2
3534#define SO_SNDBUF 7
3635#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 @@
2626#include <bits/wordsize.h>
2727
2828#if __WORDSIZE == 32
29
3029struct stat
3130 {
31# ifdef __USE_TIME_BITS64
32# include <bits/struct_stat_time64_helper.h>
33# else
3234 __dev_t st_dev; /* Device. */
33# ifndef __USE_FILE_OFFSET64
35# ifndef __USE_FILE_OFFSET64
3436 unsigned short int __pad1;
3537 __ino_t st_ino; /* File serial number. */
36# else
38# else
3739 __ino64_t st_ino; /* File serial number. */
38# endif
40# endif
3941 __mode_t st_mode; /* File mode. */
4042 __nlink_t st_nlink; /* Link count. */
4143 __uid_t st_uid; /* User ID of the file's owner. */
4244 __gid_t st_gid; /* Group ID of the file's group.*/
4345 __dev_t st_rdev; /* Device number, if device. */
4446 unsigned short int __pad2;
45# ifndef __USE_FILE_OFFSET64
47# ifndef __USE_FILE_OFFSET64
4648 __off_t st_size; /* Size of file, in bytes. */
47# else
49# else
4850 __off64_t st_size; /* Size of file, in bytes. */
49# endif
51# endif
5052 __blksize_t st_blksize; /* Optimal block size for I/O. */
5153
52# ifndef __USE_FILE_OFFSET64
54# ifndef __USE_FILE_OFFSET64
5355 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
54# else
56# else
5557 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
56# endif
57# ifdef __USE_XOPEN2K8
58# endif
59# ifdef __USE_XOPEN2K8
5860 /* Nanosecond resolution timestamps are stored in a format
5961 equivalent to 'struct timespec'. This is the type used
6062 whenever possible but the Unix namespace rules do not allow the
......@@ -64,25 +66,28 @@ struct stat
6466 struct timespec st_atim; /* Time of last access. */
6567 struct timespec st_mtim; /* Time of last modification. */
6668 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
7173 __time_t st_atime; /* Time of last access. */
7274 unsigned long int st_atimensec; /* Nscecs of last access. */
7375 __time_t st_mtime; /* Time of last modification. */
7476 unsigned long int st_mtimensec; /* Nsecs of last modification. */
7577 __time_t st_ctime; /* Time of last status change. */
7678 unsigned long int st_ctimensec; /* Nsecs of last status change. */
77# endif
79# endif
7880 unsigned long int __glibc_reserved4;
7981 unsigned long int __glibc_reserved5;
82# endif /* __USE_TIME_BITS64 */
8083 };
8184
82
8385# ifdef __USE_LARGEFILE64
8486struct stat64
8587 {
88# ifdef __USE_TIME_BITS64
89# include <bits/struct_stat_time64_helper.h>
90# else
8691 __dev_t st_dev; /* Device. */
8792 __ino64_t st_ino; /* File serial number. */
8893 __mode_t st_mode; /* File mode. */
......@@ -94,7 +99,7 @@ struct stat64
9499 __off64_t st_size; /* Size of file, in bytes. */
95100 __blksize_t st_blksize; /* Optimal block size for I/O. */
96101 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
97# ifdef __USE_XOPEN2K8
102# ifdef __USE_XOPEN2K8
98103 /* Nanosecond resolution timestamps are stored in a format
99104 equivalent to 'struct timespec'. This is the type used
100105 whenever possible but the Unix namespace rules do not allow the
......@@ -104,19 +109,20 @@ struct stat64
104109 struct timespec st_atim; /* Time of last access. */
105110 struct timespec st_mtim; /* Time of last modification. */
106111 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
111116 __time_t st_atime; /* Time of last access. */
112117 unsigned long int st_atimensec; /* Nscecs of last access. */
113118 __time_t st_mtime; /* Time of last modification. */
114119 unsigned long int st_mtimensec; /* Nsecs of last modification. */
115120 __time_t st_ctime; /* Time of last status change. */
116121 unsigned long int st_ctimensec; /* Nsecs of last status change. */
117# endif
122# endif
118123 unsigned long int __glibc_reserved4;
119124 unsigned long int __glibc_reserved5;
125# endif /* __USE_TIME_BITS64 */
120126 };
121127# endif /* __USE_LARGEFILE64 */
122128
lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_msqid_ds.h+9-3
......@@ -20,23 +20,28 @@
2020# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
2121#endif
2222
23#include <bits/types/time_t.h>
24
2325/* Structure of record for one message inside the kernel.
2426 The type `struct msg' is opaque. */
2527struct msqid_ds
2628{
29#ifdef __USE_TIME_BITS64
30# include <bits/types/struct_msqid64_ds_helper.h>
31#else
2732 struct ipc_perm msg_perm; /* structure describing operation permission */
28#if __TIMESIZE == 32
33# if __TIMESIZE == 32
2934 unsigned long int __msg_stime_high;
3035 __time_t msg_stime; /* time of last msgsnd command */
3136 unsigned long int __msg_rtime_high;
3237 __time_t msg_rtime; /* time of last msgsnd command */
3338 unsigned long int __msg_ctime_high;
3439 __time_t msg_ctime; /* time of last change */
35#else
40# else
3641 __time_t msg_stime; /* time of last msgsnd command */
3742 __time_t msg_rtime; /* time of last msgsnd command */
3843 __time_t msg_ctime; /* time of last change */
39#endif
44# endif
4045 __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
4146 msgqnum_t msg_qnum; /* number of messages currently on queue */
4247 msglen_t msg_qbytes; /* max number of bytes allowed on queue */
......@@ -44,4 +49,5 @@ struct msqid_ds
4449 __pid_t msg_lrpid; /* pid of last msgrcv() */
4550 __syscall_ulong_t __glibc_reserved4;
4651 __syscall_ulong_t __glibc_reserved5;
52#endif
4753};
\ No newline at end of file
lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_semid_ds.h+7-3
......@@ -23,17 +23,21 @@
2323/* Data structure describing a set of semaphores. */
2424struct semid_ds
2525{
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_semid64_ds_helper.h>
28#else
2629 struct ipc_perm sem_perm; /* operation permission struct */
27#if __TIMESIZE == 32
30# if __TIMESIZE == 32
2831 __syscall_ulong_t __sem_otime_high;
2932 __time_t sem_otime; /* last semop() time */
3033 __syscall_ulong_t __sem_ctime_high;
3134 __time_t sem_ctime; /* last time changed by semctl() */
32#else
35# else
3336 __time_t sem_otime; /* last semop() time */
3437 __time_t sem_ctime; /* last time changed by semctl() */
35#endif
38# endif
3639 __syscall_ulong_t sem_nsems; /* number of semaphores in set */
3740 __syscall_ulong_t __glibc_reserved3;
3841 __syscall_ulong_t __glibc_reserved4;
42#endif
3943};
\ No newline at end of file
lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_shmid_ds.h+7-3
......@@ -23,8 +23,11 @@
2323/* Data structure describing a shared memory segment. */
2424struct shmid_ds
2525 {
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_shmid64_ds_helper.h>
28#else
2629 struct ipc_perm shm_perm; /* operation permission struct */
27#if __TIMESIZE == 32
30# if __TIMESIZE == 32
2831 unsigned long int __shm_atime_high;
2932 __time_t shm_atime; /* time of last shmat() */
3033 unsigned long int __shm_dtime_high;
......@@ -32,15 +35,16 @@ struct shmid_ds
3235 unsigned long int __shm_ctime_high;
3336 __time_t shm_ctime; /* time of last change by shmctl() */
3437 unsigned long int __glibc_reserved4;
35#else
38# else
3639 __time_t shm_atime; /* time of last shmat() */
3740 __time_t shm_dtime; /* time of last shmdt() */
3841 __time_t shm_ctime; /* time of last change by shmctl() */
39#endif
42# endif
4043 size_t shm_segsz; /* size of segment in bytes */
4144 __pid_t shm_cpid; /* pid of creator */
4245 __pid_t shm_lpid; /* pid of last shmop */
4346 shmatt_t shm_nattch; /* number of current attaches */
4447 __syscall_ulong_t __glibc_reserved5;
4548 __syscall_ulong_t __glibc_reserved6;
49#endif
4650 };
\ No newline at end of file
lib/libc/include/powerpc64le-linux-gnu/gnu/lib-names-64-v2.h+1
......@@ -8,6 +8,7 @@
88#define LIBANL_SO "libanl.so.1"
99#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1010#define LIBCRYPT_SO "libcrypt.so.1"
11#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1112#define LIBC_SO "libc.so.6"
1213#define LIBDL_SO "libdl.so.2"
1314#define LIBGCC_S_SO "libgcc_s.so.1"
lib/libc/include/powerpc64le-linux-gnu/sys/ptrace.h+10
......@@ -70,6 +70,8 @@ __BEGIN_DECLS
7070# undef PTRACE_SYSCALL_INFO_ENTRY
7171# undef PTRACE_SYSCALL_INFO_EXIT
7272# undef PTRACE_SYSCALL_INFO_SECCOMP
73# undef PTRACE_SYSEMU
74# undef PTRACE_SYSEMU_SINGLESTEP
7375# undef PTRACE_TRACEME
7476#endif
7577
......@@ -188,6 +190,14 @@ enum __ptrace_request
188190 PTRACE_SETVSRREGS = 28,
189191#define PT_SETVSRREGS PTRACE_SETVSRREGS
190192
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
191201 /* Execute process until next taken branch. */
192202 PTRACE_SINGLEBLOCK = 256,
193203#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
47struct 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
66struct 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 @@
88#define LIBANL_SO "libanl.so.1"
99#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1010#define LIBCRYPT_SO "libcrypt.so.1"
11#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1112#define LIBC_SO "libc.so.6"
1213#define LIBDL_SO "libdl.so.2"
1314#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 @@
4545#define HWCAP_S390_VXRS_EXT2 32768
4646#define HWCAP_S390_VXRS_PDE 65536
4747#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
6565#else
6666struct stat
6767 {
68# ifdef __USE_TIME_BITS64
69# include <bits/struct_stat_time64_helper.h>
70# else
6871 __dev_t st_dev; /* Device. */
6972 unsigned int __pad1;
70# ifndef __USE_FILE_OFFSET64
73# ifndef __USE_FILE_OFFSET64
7174 __ino_t st_ino; /* File serial number. */
72# else
75# else
7376 __ino_t __st_ino; /* 32bit file serial number. */
74# endif
77# endif
7578 __mode_t st_mode; /* File mode. */
7679 __nlink_t st_nlink; /* Link count. */
7780 __uid_t st_uid; /* User ID of the file's owner. */
7881 __gid_t st_gid; /* Group ID of the file's group.*/
7982 __dev_t st_rdev; /* Device number, if device. */
8083 unsigned int __pad2;
81# ifndef __USE_FILE_OFFSET64
84# ifndef __USE_FILE_OFFSET64
8285 __off_t st_size; /* Size of file, in bytes. */
83# else
86# else
8487 __off64_t st_size; /* Size of file, in bytes. */
85# endif
88# endif
8689 __blksize_t st_blksize; /* Optimal block size for I/O. */
8790
88# ifndef __USE_FILE_OFFSET64
91# ifndef __USE_FILE_OFFSET64
8992 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
90# else
93# else
9194 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
92# endif
93# ifdef __USE_XOPEN2K8
95# endif
96# ifdef __USE_XOPEN2K8
9497 /* Nanosecond resolution timestamps are stored in a format
9598 equivalent to 'struct timespec'. This is the type used
9699 whenever possible but the Unix namespace rules do not allow the
......@@ -100,25 +103,26 @@ struct stat
100103 struct timespec st_atim; /* Time of last access. */
101104 struct timespec st_mtim; /* Time of last modification. */
102105 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
107110 __time_t st_atime; /* Time of last access. */
108111 unsigned long int st_atimensec; /* Nscecs of last access. */
109112 __time_t st_mtime; /* Time of last modification. */
110113 unsigned long int st_mtimensec; /* Nsecs of last modification. */
111114 __time_t st_ctime; /* Time of last status change. */
112115 unsigned long int st_ctimensec; /* Nsecs of last status change. */
113# endif
114# ifndef __USE_FILE_OFFSET64
116# endif
117# ifndef __USE_FILE_OFFSET64
115118 unsigned long int __glibc_reserved4;
116119 unsigned long int __glibc_reserved5;
117# else
120# else
118121 __ino64_t st_ino; /* File serial number. */
122# endif
119123# endif
120124 };
121#endif
125# endif
122126
123127#ifdef __USE_LARGEFILE64
124128# if __WORDSIZE == 64
......@@ -162,6 +166,9 @@ struct stat64
162166# else
163167struct stat64
164168 {
169# ifdef __USE_TIME_BITS64
170# include <bits/struct_stat_time64_helper.h>
171# else
165172 __dev_t st_dev; /* Device. */
166173 unsigned int __pad1;
167174
......@@ -176,7 +183,7 @@ struct stat64
176183 __blksize_t st_blksize; /* Optimal block size for I/O. */
177184
178185 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
179# ifdef __USE_XOPEN2K8
186# ifdef __USE_XOPEN2K8
180187 /* Nanosecond resolution timestamps are stored in a format
181188 equivalent to 'struct timespec'. This is the type used
182189 whenever possible but the Unix namespace rules do not allow the
......@@ -186,18 +193,19 @@ struct stat64
186193 struct timespec st_atim; /* Time of last access. */
187194 struct timespec st_mtim; /* Time of last modification. */
188195 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
193200 __time_t st_atime; /* Time of last access. */
194201 unsigned long int st_atimensec; /* Nscecs of last access. */
195202 __time_t st_mtime; /* Time of last modification. */
196203 unsigned long int st_mtimensec; /* Nsecs of last modification. */
197204 __time_t st_ctime; /* Time of last status change. */
198205 unsigned long int st_ctimensec; /* Nsecs of last status change. */
199# endif
206# endif
200207 __ino64_t st_ino; /* File serial number. */
208# endif
201209 };
202210# endif
203211#endif
lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h+1
......@@ -8,6 +8,7 @@
88#define LIBANL_SO "libanl.so.1"
99#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1010#define LIBCRYPT_SO "libcrypt.so.1"
11#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1112#define LIBC_SO "libc.so.6"
1213#define LIBDL_SO "libdl.so.2"
1314#define LIBGCC_S_SO "libgcc_s.so.1"
lib/libc/include/s390x-linux-gnu/sys/ptrace.h+10
......@@ -39,6 +39,8 @@ __BEGIN_DECLS
3939# undef PTRACE_ATTACH
4040# undef PTRACE_DETACH
4141# undef PTRACE_SYSCALL
42# undef PTRACE_SYSEMU
43# undef PTRACE_SYSEMU_SINGLESTEP
4244# undef PTRACE_SETOPTIONS
4345# undef PTRACE_GETEVENTMSG
4446# undef PTRACE_GETSIGINFO
......@@ -146,6 +148,14 @@ enum __ptrace_request
146148 PTRACE_SYSCALL = 24,
147149#define PT_SYSCALL PTRACE_SYSCALL
148150
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
149159 /* Set ptrace filter options. */
150160 PTRACE_SETOPTIONS = 0x4200,
151161#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 @@
3030#define SO_OOBINLINE 256
3131#define SO_RCVBUF 4098
3232#define SO_RCVLOWAT 2048
33#define SO_RCVTIMEO 8192
3433#define SO_REUSEADDR 4
3534#define SO_SNDBUF 4097
3635#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 @@
2020# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
2121#endif
2222
23#include <bits/types/time_t.h>
24
2325/* Structure of record for one message inside the kernel.
2426 The type `struct msg' is opaque. */
2527struct msqid_ds
2628{
29#ifdef __USE_TIME_BITS64
30# include <bits/types/struct_msqid64_ds_helper.h>
31#else
2732 struct ipc_perm msg_perm; /* structure describing operation permission */
28#if __TIMESIZE == 32
33# if __TIMESIZE == 32
2934 unsigned long int __msg_stime_high;
3035 __time_t msg_stime; /* time of last msgsnd command */
3136 unsigned long int __msg_rtime_high;
3237 __time_t msg_rtime; /* time of last msgsnd command */
3338 unsigned long int __msg_ctime_high;
3439 __time_t msg_ctime; /* time of last change */
35#else
40# else
3641 __time_t msg_stime; /* time of last msgsnd command */
3742 __time_t msg_rtime; /* time of last msgsnd command */
3843 __time_t msg_ctime; /* time of last change */
39#endif
44# endif
4045 __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
4146 msgqnum_t msg_qnum; /* number of messages currently on queue */
4247 msglen_t msg_qbytes; /* max number of bytes allowed on queue */
......@@ -44,4 +49,5 @@ struct msqid_ds
4449 __pid_t msg_lrpid; /* pid of last msgrcv() */
4550 __syscall_ulong_t __glibc_reserved4;
4651 __syscall_ulong_t __glibc_reserved5;
52#endif
4753};
\ No newline at end of file
lib/libc/include/sparc-linux-gnu/bits/types/struct_semid_ds.h+7-3
......@@ -23,17 +23,21 @@
2323/* Data structure describing a set of semaphores. */
2424struct semid_ds
2525{
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_semid64_ds_helper.h>
28#else
2629 struct ipc_perm sem_perm; /* operation permission struct */
27#if __TIMESIZE == 32
30# if __TIMESIZE == 32
2831 __syscall_ulong_t __sem_otime_high;
2932 __time_t sem_otime; /* last semop() time */
3033 __syscall_ulong_t __sem_ctime_high;
3134 __time_t sem_ctime; /* last time changed by semctl() */
32#else
35# else
3336 __time_t sem_otime; /* last semop() time */
3437 __time_t sem_ctime; /* last time changed by semctl() */
35#endif
38# endif
3639 __syscall_ulong_t sem_nsems; /* number of semaphores in set */
3740 __syscall_ulong_t __glibc_reserved3;
3841 __syscall_ulong_t __glibc_reserved4;
42#endif
3943};
\ No newline at end of file
lib/libc/include/sparc-linux-gnu/bits/types/struct_shmid_ds.h+7-3
......@@ -23,23 +23,27 @@
2323/* Data structure describing a shared memory segment. */
2424struct shmid_ds
2525 {
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_shmid64_ds_helper.h>
28#else
2629 struct ipc_perm shm_perm; /* operation permission struct */
27#if __TIMESIZE == 32
30# if __TIMESIZE == 32
2831 unsigned long int __shm_atime_high;
2932 __time_t shm_atime; /* time of last shmat() */
3033 unsigned long int __shm_dtime_high;
3134 __time_t shm_dtime; /* time of last shmdt() */
3235 unsigned long int __shm_ctime_high;
3336 __time_t shm_ctime; /* time of last change by shmctl() */
34#else
37# else
3538 __time_t shm_atime; /* time of last shmat() */
3639 __time_t shm_dtime; /* time of last shmdt() */
3740 __time_t shm_ctime; /* time of last change by shmctl() */
38#endif
41# endif
3942 size_t shm_segsz; /* size of segment in bytes */
4043 __pid_t shm_cpid; /* pid of creator */
4144 __pid_t shm_lpid; /* pid of last shmop */
4245 shmatt_t shm_nattch; /* number of current attaches */
4346 __syscall_ulong_t __glibc_reserved5;
4447 __syscall_ulong_t __glibc_reserved6;
48#endif
4549 };
\ No newline at end of file
lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h+1
......@@ -8,6 +8,7 @@
88#define LIBANL_SO "libanl.so.1"
99#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1010#define LIBCRYPT_SO "libcrypt.so.1"
11#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1112#define LIBC_SO "libc.so.6"
1213#define LIBDL_SO "libdl.so.2"
1314#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 @@
3030#define SO_OOBINLINE 256
3131#define SO_RCVBUF 4098
3232#define SO_RCVLOWAT 2048
33#define SO_RCVTIMEO 8192
3433#define SO_REUSEADDR 4
3534#define SO_SNDBUF 4097
3635#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 @@
2020# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
2121#endif
2222
23#include <bits/types/time_t.h>
24
2325/* Structure of record for one message inside the kernel.
2426 The type `struct msg' is opaque. */
2527struct msqid_ds
2628{
29#ifdef __USE_TIME_BITS64
30# include <bits/types/struct_msqid64_ds_helper.h>
31#else
2732 struct ipc_perm msg_perm; /* structure describing operation permission */
28#if __TIMESIZE == 32
33# if __TIMESIZE == 32
2934 unsigned long int __msg_stime_high;
3035 __time_t msg_stime; /* time of last msgsnd command */
3136 unsigned long int __msg_rtime_high;
3237 __time_t msg_rtime; /* time of last msgsnd command */
3338 unsigned long int __msg_ctime_high;
3439 __time_t msg_ctime; /* time of last change */
35#else
40# else
3641 __time_t msg_stime; /* time of last msgsnd command */
3742 __time_t msg_rtime; /* time of last msgsnd command */
3843 __time_t msg_ctime; /* time of last change */
39#endif
44# endif
4045 __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
4146 msgqnum_t msg_qnum; /* number of messages currently on queue */
4247 msglen_t msg_qbytes; /* max number of bytes allowed on queue */
......@@ -44,4 +49,5 @@ struct msqid_ds
4449 __pid_t msg_lrpid; /* pid of last msgrcv() */
4550 __syscall_ulong_t __glibc_reserved4;
4651 __syscall_ulong_t __glibc_reserved5;
52#endif
4753};
\ No newline at end of file
lib/libc/include/sparcv9-linux-gnu/bits/types/struct_semid_ds.h+7-3
......@@ -23,17 +23,21 @@
2323/* Data structure describing a set of semaphores. */
2424struct semid_ds
2525{
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_semid64_ds_helper.h>
28#else
2629 struct ipc_perm sem_perm; /* operation permission struct */
27#if __TIMESIZE == 32
30# if __TIMESIZE == 32
2831 __syscall_ulong_t __sem_otime_high;
2932 __time_t sem_otime; /* last semop() time */
3033 __syscall_ulong_t __sem_ctime_high;
3134 __time_t sem_ctime; /* last time changed by semctl() */
32#else
35# else
3336 __time_t sem_otime; /* last semop() time */
3437 __time_t sem_ctime; /* last time changed by semctl() */
35#endif
38# endif
3639 __syscall_ulong_t sem_nsems; /* number of semaphores in set */
3740 __syscall_ulong_t __glibc_reserved3;
3841 __syscall_ulong_t __glibc_reserved4;
42#endif
3943};
\ No newline at end of file
lib/libc/include/sparcv9-linux-gnu/bits/types/struct_shmid_ds.h+7-3
......@@ -23,23 +23,27 @@
2323/* Data structure describing a shared memory segment. */
2424struct shmid_ds
2525 {
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_shmid64_ds_helper.h>
28#else
2629 struct ipc_perm shm_perm; /* operation permission struct */
27#if __TIMESIZE == 32
30# if __TIMESIZE == 32
2831 unsigned long int __shm_atime_high;
2932 __time_t shm_atime; /* time of last shmat() */
3033 unsigned long int __shm_dtime_high;
3134 __time_t shm_dtime; /* time of last shmdt() */
3235 unsigned long int __shm_ctime_high;
3336 __time_t shm_ctime; /* time of last change by shmctl() */
34#else
37# else
3538 __time_t shm_atime; /* time of last shmat() */
3639 __time_t shm_dtime; /* time of last shmdt() */
3740 __time_t shm_ctime; /* time of last change by shmctl() */
38#endif
41# endif
3942 size_t shm_segsz; /* size of segment in bytes */
4043 __pid_t shm_cpid; /* pid of creator */
4144 __pid_t shm_lpid; /* pid of last shmop */
4245 shmatt_t shm_nattch; /* number of current attaches */
4346 __syscall_ulong_t __glibc_reserved5;
4447 __syscall_ulong_t __glibc_reserved6;
48#endif
4549 };
\ No newline at end of file
lib/libc/include/x86_64-linux-gnu/bits/struct_stat.h+49-41
......@@ -25,43 +25,46 @@
2525
2626struct stat
2727 {
28#ifdef __USE_TIME_BITS64
29# include <bits/struct_stat_time64_helper.h>
30#else
2831 __dev_t st_dev; /* Device. */
29#ifndef __x86_64__
32# ifndef __x86_64__
3033 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
3336 __ino_t st_ino; /* File serial number. */
34#else
37# else
3538 __ino_t __st_ino; /* 32bit file serial number. */
36#endif
37#ifndef __x86_64__
39# endif
40# ifndef __x86_64__
3841 __mode_t st_mode; /* File mode. */
3942 __nlink_t st_nlink; /* Link count. */
40#else
43# else
4144 __nlink_t st_nlink; /* Link count. */
4245 __mode_t st_mode; /* File mode. */
43#endif
46# endif
4447 __uid_t st_uid; /* User ID of the file's owner. */
4548 __gid_t st_gid; /* Group ID of the file's group.*/
46#ifdef __x86_64__
49# ifdef __x86_64__
4750 int __pad0;
48#endif
51# endif
4952 __dev_t st_rdev; /* Device number, if device. */
50#ifndef __x86_64__
53# ifndef __x86_64__
5154 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
5457 __off_t st_size; /* Size of file, in bytes. */
55#else
58# else
5659 __off64_t st_size; /* Size of file, in bytes. */
57#endif
60# endif
5861 __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
6063 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
61#else
64# else
6265 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
63#endif
64#ifdef __USE_XOPEN2K8
66# endif
67# ifdef __USE_XOPEN2K8
6568 /* Nanosecond resolution timestamps are stored in a format
6669 equivalent to 'struct timespec'. This is the type used
6770 whenever possible but the Unix namespace rules do not allow the
......@@ -71,58 +74,62 @@ struct stat
7174 struct timespec st_atim; /* Time of last access. */
7275 struct timespec st_mtim; /* Time of last modification. */
7376 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
7881 __time_t st_atime; /* Time of last access. */
7982 __syscall_ulong_t st_atimensec; /* Nscecs of last access. */
8083 __time_t st_mtime; /* Time of last modification. */
8184 __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */
8285 __time_t st_ctime; /* Time of last status change. */
8386 __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */
84#endif
85#ifdef __x86_64__
87# endif
88# ifdef __x86_64__
8689 __syscall_slong_t __glibc_reserved[3];
87#else
88# ifndef __USE_FILE_OFFSET64
90# else
91# ifndef __USE_FILE_OFFSET64
8992 unsigned long int __glibc_reserved4;
9093 unsigned long int __glibc_reserved5;
91# else
94# else
9295 __ino64_t st_ino; /* File serial number. */
96# endif
9397# endif
94#endif
98#endif /* __USE_TIME_BITS64 */
9599 };
96100
97101#ifdef __USE_LARGEFILE64
98102/* Note stat64 has the same shape as stat for x86-64. */
99103struct stat64
100104 {
105# ifdef __USE_TIME_BITS64
106# include <bits/struct_stat_time64_helper.h>
107# else
101108 __dev_t st_dev; /* Device. */
102# ifdef __x86_64__
109# ifdef __x86_64__
103110 __ino64_t st_ino; /* File serial number. */
104111 __nlink_t st_nlink; /* Link count. */
105112 __mode_t st_mode; /* File mode. */
106# else
113# else
107114 unsigned int __pad1;
108115 __ino_t __st_ino; /* 32bit file serial number. */
109116 __mode_t st_mode; /* File mode. */
110117 __nlink_t st_nlink; /* Link count. */
111# endif
118# endif
112119 __uid_t st_uid; /* User ID of the file's owner. */
113120 __gid_t st_gid; /* Group ID of the file's group.*/
114# ifdef __x86_64__
121# ifdef __x86_64__
115122 int __pad0;
116123 __dev_t st_rdev; /* Device number, if device. */
117124 __off_t st_size; /* Size of file, in bytes. */
118# else
125# else
119126 __dev_t st_rdev; /* Device number, if device. */
120127 unsigned int __pad2;
121128 __off64_t st_size; /* Size of file, in bytes. */
122# endif
129# endif
123130 __blksize_t st_blksize; /* Optimal block size for I/O. */
124131 __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
125# ifdef __USE_XOPEN2K8
132# ifdef __USE_XOPEN2K8
126133 /* Nanosecond resolution timestamps are stored in a format
127134 equivalent to 'struct timespec'. This is the type used
128135 whenever possible but the Unix namespace rules do not allow the
......@@ -132,19 +139,20 @@ struct stat64
132139 struct timespec st_atim; /* Time of last access. */
133140 struct timespec st_mtim; /* Time of last modification. */
134141 struct timespec st_ctim; /* Time of last status change. */
135# else
142# else
136143 __time_t st_atime; /* Time of last access. */
137144 __syscall_ulong_t st_atimensec; /* Nscecs of last access. */
138145 __time_t st_mtime; /* Time of last modification. */
139146 __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */
140147 __time_t st_ctime; /* Time of last status change. */
141148 __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */
142# endif
143# ifdef __x86_64__
149# endif
150# ifdef __x86_64__
144151 __syscall_slong_t __glibc_reserved[3];
145# else
152# else
146153 __ino64_t st_ino; /* File serial number. */
147# endif
154# endif
155# endif /* __USE_TIME_BITS64 */
148156 };
149157#endif
150158
lib/libc/include/x86_64-linux-gnu/bits/types/struct_semid_ds.h+4
......@@ -23,6 +23,9 @@
2323/* Data structure describing a set of semaphores. */
2424struct semid_ds
2525{
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_semid64_ds_helper.h>
28#else
2629 struct ipc_perm sem_perm; /* operation permission struct */
2730 __time_t sem_otime; /* last semop() time */
2831 __syscall_ulong_t __sem_otime_high;
......@@ -31,4 +34,5 @@ struct semid_ds
3134 __syscall_ulong_t sem_nsems; /* number of semaphores in set */
3235 __syscall_ulong_t __glibc_reserved3;
3336 __syscall_ulong_t __glibc_reserved4;
37#endif
3438};
\ No newline at end of file
lib/libc/include/x86_64-linux-gnu/gnu/lib-names-64.h+1
......@@ -8,6 +8,7 @@
88#define LIBANL_SO "libanl.so.1"
99#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1010#define LIBCRYPT_SO "libcrypt.so.1"
11#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1112#define LIBC_SO "libc.so.6"
1213#define LIBDL_SO "libdl.so.2"
1314#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 @@
2525
2626struct stat
2727 {
28#ifdef __USE_TIME_BITS64
29# include <bits/struct_stat_time64_helper.h>
30#else
2831 __dev_t st_dev; /* Device. */
29#ifndef __x86_64__
32# ifndef __x86_64__
3033 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
3336 __ino_t st_ino; /* File serial number. */
34#else
37# else
3538 __ino_t __st_ino; /* 32bit file serial number. */
36#endif
37#ifndef __x86_64__
39# endif
40# ifndef __x86_64__
3841 __mode_t st_mode; /* File mode. */
3942 __nlink_t st_nlink; /* Link count. */
40#else
43# else
4144 __nlink_t st_nlink; /* Link count. */
4245 __mode_t st_mode; /* File mode. */
43#endif
46# endif
4447 __uid_t st_uid; /* User ID of the file's owner. */
4548 __gid_t st_gid; /* Group ID of the file's group.*/
46#ifdef __x86_64__
49# ifdef __x86_64__
4750 int __pad0;
48#endif
51# endif
4952 __dev_t st_rdev; /* Device number, if device. */
50#ifndef __x86_64__
53# ifndef __x86_64__
5154 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
5457 __off_t st_size; /* Size of file, in bytes. */
55#else
58# else
5659 __off64_t st_size; /* Size of file, in bytes. */
57#endif
60# endif
5861 __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
6063 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
61#else
64# else
6265 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
63#endif
64#ifdef __USE_XOPEN2K8
66# endif
67# ifdef __USE_XOPEN2K8
6568 /* Nanosecond resolution timestamps are stored in a format
6669 equivalent to 'struct timespec'. This is the type used
6770 whenever possible but the Unix namespace rules do not allow the
......@@ -71,58 +74,62 @@ struct stat
7174 struct timespec st_atim; /* Time of last access. */
7275 struct timespec st_mtim; /* Time of last modification. */
7376 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
7881 __time_t st_atime; /* Time of last access. */
7982 __syscall_ulong_t st_atimensec; /* Nscecs of last access. */
8083 __time_t st_mtime; /* Time of last modification. */
8184 __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */
8285 __time_t st_ctime; /* Time of last status change. */
8386 __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */
84#endif
85#ifdef __x86_64__
87# endif
88# ifdef __x86_64__
8689 __syscall_slong_t __glibc_reserved[3];
87#else
88# ifndef __USE_FILE_OFFSET64
90# else
91# ifndef __USE_FILE_OFFSET64
8992 unsigned long int __glibc_reserved4;
9093 unsigned long int __glibc_reserved5;
91# else
94# else
9295 __ino64_t st_ino; /* File serial number. */
96# endif
9397# endif
94#endif
98#endif /* __USE_TIME_BITS64 */
9599 };
96100
97101#ifdef __USE_LARGEFILE64
98102/* Note stat64 has the same shape as stat for x86-64. */
99103struct stat64
100104 {
105# ifdef __USE_TIME_BITS64
106# include <bits/struct_stat_time64_helper.h>
107# else
101108 __dev_t st_dev; /* Device. */
102# ifdef __x86_64__
109# ifdef __x86_64__
103110 __ino64_t st_ino; /* File serial number. */
104111 __nlink_t st_nlink; /* Link count. */
105112 __mode_t st_mode; /* File mode. */
106# else
113# else
107114 unsigned int __pad1;
108115 __ino_t __st_ino; /* 32bit file serial number. */
109116 __mode_t st_mode; /* File mode. */
110117 __nlink_t st_nlink; /* Link count. */
111# endif
118# endif
112119 __uid_t st_uid; /* User ID of the file's owner. */
113120 __gid_t st_gid; /* Group ID of the file's group.*/
114# ifdef __x86_64__
121# ifdef __x86_64__
115122 int __pad0;
116123 __dev_t st_rdev; /* Device number, if device. */
117124 __off_t st_size; /* Size of file, in bytes. */
118# else
125# else
119126 __dev_t st_rdev; /* Device number, if device. */
120127 unsigned int __pad2;
121128 __off64_t st_size; /* Size of file, in bytes. */
122# endif
129# endif
123130 __blksize_t st_blksize; /* Optimal block size for I/O. */
124131 __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
125# ifdef __USE_XOPEN2K8
132# ifdef __USE_XOPEN2K8
126133 /* Nanosecond resolution timestamps are stored in a format
127134 equivalent to 'struct timespec'. This is the type used
128135 whenever possible but the Unix namespace rules do not allow the
......@@ -132,19 +139,20 @@ struct stat64
132139 struct timespec st_atim; /* Time of last access. */
133140 struct timespec st_mtim; /* Time of last modification. */
134141 struct timespec st_ctim; /* Time of last status change. */
135# else
142# else
136143 __time_t st_atime; /* Time of last access. */
137144 __syscall_ulong_t st_atimensec; /* Nscecs of last access. */
138145 __time_t st_mtime; /* Time of last modification. */
139146 __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */
140147 __time_t st_ctime; /* Time of last status change. */
141148 __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */
142# endif
143# ifdef __x86_64__
149# endif
150# ifdef __x86_64__
144151 __syscall_slong_t __glibc_reserved[3];
145# else
152# else
146153 __ino64_t st_ino; /* File serial number. */
147# endif
154# endif
155# endif /* __USE_TIME_BITS64 */
148156 };
149157#endif
150158
lib/libc/include/x86_64-linux-gnux32/bits/types/struct_semid_ds.h+4
......@@ -23,6 +23,9 @@
2323/* Data structure describing a set of semaphores. */
2424struct semid_ds
2525{
26#ifdef __USE_TIME_BITS64
27# include <bits/types/struct_semid64_ds_helper.h>
28#else
2629 struct ipc_perm sem_perm; /* operation permission struct */
2730 __time_t sem_otime; /* last semop() time */
2831 __syscall_ulong_t __sem_otime_high;
......@@ -31,4 +34,5 @@ struct semid_ds
3134 __syscall_ulong_t sem_nsems; /* number of semaphores in set */
3235 __syscall_ulong_t __glibc_reserved3;
3336 __syscall_ulong_t __glibc_reserved4;
37#endif
3438};
\ No newline at end of file
lib/libc/include/x86_64-linux-gnux32/gnu/lib-names-x32.h+1
......@@ -8,6 +8,7 @@
88#define LIBANL_SO "libanl.so.1"
99#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
1010#define LIBCRYPT_SO "libcrypt.so.1"
11#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
1112#define LIBC_SO "libc.so.6"
1213#define LIBDL_SO "libdl.so.2"
1314#define LIBGCC_S_SO "libgcc_s.so.1"
lib/std/target.zig+2-2
......@@ -329,9 +329,9 @@ pub const Target = struct {
329329 .linux = .{
330330 .range = .{
331331 .min = .{ .major = 3, .minor = 16 },
332 .max = .{ .major = 5, .minor = 5, .patch = 5 },
332 .max = .{ .major = 5, .minor = 10, .patch = 81 },
333333 },
334 .glibc = .{ .major = 2, .minor = 17 },
334 .glibc = .{ .major = 2, .minor = 19 },
335335 },
336336 },
337337
src/Compilation.zig+27-11
......@@ -1586,9 +1586,23 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
15861586 // If we need to build glibc for the target, add work items for it.
15871587 // We go through the work queue so that building can be done in parallel.
15881588 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 });
15901602 }
15911603 if (comp.wantBuildMuslFromSource()) {
1604 if (!target_util.canBuildLibC(comp.getTarget())) return error.LibCUnavailable;
1605
15921606 try comp.work_queue.ensureUnusedCapacity(6);
15931607 if (musl.needsCrtiCrtn(comp.getTarget())) {
15941608 comp.work_queue.writeAssumeCapacity(&[_]Job{
......@@ -1607,6 +1621,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
16071621 });
16081622 }
16091623 if (comp.wantBuildWasiLibcFromSource()) {
1624 if (!target_util.canBuildLibC(comp.getTarget())) return error.LibCUnavailable;
1625
16101626 const wasi_emulated_libs = comp.bin_file.options.wasi_emulated_libs;
16111627 try comp.work_queue.ensureUnusedCapacity(wasi_emulated_libs.len + 2); // worst-case we need all components
16121628 for (wasi_emulated_libs) |crt_file| {
......@@ -1620,6 +1636,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
16201636 });
16211637 }
16221638 if (comp.wantBuildMinGWFromSource()) {
1639 if (!target_util.canBuildLibC(comp.getTarget())) return error.LibCUnavailable;
1640
16231641 const static_lib_jobs = [_]Job{
16241642 .{ .mingw_crt_file = .mingw32_lib },
16251643 .{ .mingw_crt_file = .msvcrt_os_lib },
......@@ -3397,6 +3415,14 @@ pub fn addCCArgs(
33973415 try argv.append(libunwind_include_path);
33983416 }
33993417
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
34003426 const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target);
34013427 try argv.appendSlice(&[_][]const u8{ "-target", llvm_triple });
34023428
......@@ -4038,16 +4064,6 @@ pub fn get_libc_crt_file(comp: *Compilation, arena: Allocator, basename: []const
40384064 return full_path;
40394065}
40404066
4041fn 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
40514067fn wantBuildLibCFromSource(comp: Compilation) bool {
40524068 const is_exe_or_dyn_lib = switch (comp.bin_file.options.output_mode) {
40534069 .Obj => false,
src/glibc.zig+68-54
......@@ -269,72 +269,78 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void {
269269 return comp.build_crt_file("Scrt1", .Obj, &[_]Compilation.CSourceFile{ start_os, abi_note_o });
270270 },
271271 .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,
287280 };
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" },
324310 };
325311
312 var c_source_files: [deps.len]Compilation.CSourceFile = undefined;
313
326314 for (deps) |dep, i| {
327315 var args = std.ArrayList([]const u8).init(arena);
328316 try args.appendSlice(&[_][]const u8{
329317 "-std=gnu11",
330318 "-fgnu89-inline",
331319 "-fmerge-all-constants",
320 // glibc sets this flag but clang does not support it.
321 // "-frounding-math",
332322 "-fno-stack-protector",
323 "-fno-common",
333324 "-fmath-errno",
334325 "-ftls-model=initial-exec",
335326 "-Wno-ignored-attributes",
336327 });
337328 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 };
338344 try args.appendSlice(&[_][]const u8{
339345 "-D_LIBC_REENTRANT",
340346 "-include",
......@@ -344,11 +350,11 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void {
344350 "-include",
345351 try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"),
346352 "-DPIC",
347 "-DLIBC_NONSHARED=1",
353 shared_def,
348354 "-DTOP_NAMESPACE=glibc",
349355 });
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),
352358 .extra_flags = args.items,
353359 };
354360 }
......@@ -1093,3 +1099,11 @@ fn buildSharedLib(
10931099
10941100 try sub_compilation.updateSubCompilation();
10951101}
1102
1103// Return true if glibc has crti/crtn sources for that architecture.
1104pub 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(
24952495 .debug_compile_errors = debug_compile_errors,
24962496 .enable_link_snapshots = enable_link_snapshots,
24972497 .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)}),
25002520 };
25012521 var comp_destroyed = false;
25022522 defer if (!comp_destroyed) comp.destroy();
src/target.zig+6-3
......@@ -44,15 +44,18 @@ pub const available_libcs = [_]ArchOsAbi{
4444 .{ .arch = .mips64, .os = .linux, .abi = .gnuabi64 },
4545 .{ .arch = .mips64, .os = .linux, .abi = .gnuabin32 },
4646 .{ .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 },
4849 .{ .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 },
5052 .{ .arch = .mips, .os = .linux, .abi = .musl },
5153 .{ .arch = .powerpc64le, .os = .linux, .abi = .gnu },
5254 .{ .arch = .powerpc64le, .os = .linux, .abi = .musl },
5355 .{ .arch = .powerpc64, .os = .linux, .abi = .gnu },
5456 .{ .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 },
5659 .{ .arch = .powerpc, .os = .linux, .abi = .musl },
5760 .{ .arch = .riscv64, .os = .linux, .abi = .gnu },
5861 .{ .arch = .riscv64, .os = .linux, .abi = .musl },
test/standalone.zig+1
......@@ -84,5 +84,6 @@ pub fn addCases(cases: *tests.StandaloneContext) void {
8484 cases.add("tools/gen_stubs.zig");
8585 cases.add("tools/update_clang_options.zig");
8686 cases.add("tools/update_cpu_features.zig");
87 cases.add("tools/update_glibc.zig");
8788 cases.add("tools/update_spirv_features.zig");
8889}
test/tests.zig+11-2
......@@ -189,7 +189,7 @@ const test_targets = blk: {
189189 // .target = .{
190190 // .cpu_arch = .mips,
191191 // .os_tag = .linux,
192 // .abi = .gnu,
192 // .abi = .gnueabihf,
193193 // },
194194 // .link_libc = true,
195195 //},
......@@ -216,7 +216,7 @@ const test_targets = blk: {
216216 // .target = .{
217217 // .cpu_arch = .mipsel,
218218 // .os_tag = .linux,
219 // .abi = .gnu,
219 // .abi = .gnueabihf,
220220 // },
221221 // .link_libc = true,
222222 //},
......@@ -236,6 +236,15 @@ const test_targets = blk: {
236236 },
237237 .link_libc = true,
238238 },
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 //},
239248
240249 TestTarget{
241250 .target = .{
tools/process_headers.zig+18-3
......@@ -122,12 +122,22 @@ const glibc_targets = [_]LibCTarget{
122122 LibCTarget{
123123 .name = "mipsel-linux-gnu",
124124 .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 },
126131 },
127132 LibCTarget{
128133 .name = "mips-linux-gnu",
129134 .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 },
131141 },
132142 LibCTarget{
133143 .name = "powerpc64le-linux-gnu",
......@@ -142,7 +152,12 @@ const glibc_targets = [_]LibCTarget{
142152 LibCTarget{
143153 .name = "powerpc-linux-gnu",
144154 .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 },
146161 },
147162 LibCTarget{
148163 .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
9const std = @import("std");
10const mem = std.mem;
11const log = std.log;
12const fs = std.fs;
13
14const 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
33pub 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
141fn fatal(comptime format: []const u8, args: anytype) noreturn {
142 log.err(format, args);
143 std.process.exit(1);
144}