authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-02 08:13:00+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-02 09:54:08+02:00
log635a3d87de03193f28bb840957e387981365566f
tree7d1db2356a4ee9ca7c88ed57e068840a941090e7
parent3c2733de6e20926b5113236296177e1b2a576423
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

glibc: Change riscv32-linux-gnuilp32 target triple to riscv32-linux-gnu.

This target triple was weird on multiple levels: * The `ilp32` ABI is the soft float ABI. This is not the main ABI we want to support on RISC-V; rather, we want `ilp32d`. * `gnuilp32` is a bespoke tag that was introduced in Zig. The rest of the world just uses `gnu` for RISC-V target triples. * `gnu_ilp32` is already the name of an ILP32 ABI used on AArch64. `gnuilp32` is too easy to confuse with this. * We don't use this convention for `riscv64-linux-gnu`. * Supporting all RISC-V ABIs with this convention will result in combinatorial explosion; see #20690.

59 files changed, 1547 insertions(+), 1548 deletions(-)

lib/libc/include/riscv32-linux-gnu/bits/endianness.h created+11
......@@ -0,0 +1,11 @@
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/* RISC-V is little-endian. */
9#define __BYTE_ORDER __LITTLE_ENDIAN
10
11#endif /* bits/endianness.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/environments.h created+81
......@@ -0,0 +1,81 @@
1/* Copyright (C) 2020-2024 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/* We can never provide environments with 32-bit wide pointers. */
45# define _POSIX_V7_ILP32_OFF32 -1
46# define _POSIX_V7_ILP32_OFFBIG -1
47# define _POSIX_V6_ILP32_OFF32 -1
48# define _POSIX_V6_ILP32_OFFBIG -1
49# define _XBS5_ILP32_OFF32 -1
50# define _XBS5_ILP32_OFFBIG -1
51/* We also have no use (for now) for an environment with bigger pointers
52 and offsets. */
53# define _POSIX_V7_LPBIG_OFFBIG -1
54# define _POSIX_V6_LPBIG_OFFBIG -1
55# define _XBS5_LPBIG_OFFBIG -1
56
57/* By default we have 64-bit wide `long int', pointers and `off_t'. */
58# define _POSIX_V7_LP64_OFF64 1
59# define _POSIX_V6_LP64_OFF64 1
60# define _XBS5_LP64_OFF64 1
61
62#else /* __WORDSIZE == 32 */
63
64/* RISC-V requires 64-bit off_t */
65# define _POSIX_V7_ILP32_OFF32 -1
66# define _POSIX_V6_ILP32_OFF32 -1
67# define _XBS5_ILP32_OFF32 -1
68
69# define _POSIX_V7_ILP32_OFFBIG 1
70# define _POSIX_V6_ILP32_OFFBIG 1
71# define _XBS5_ILP32_OFFBIG 1
72
73/* We can never provide environments with 64-bit wide pointers. */
74# define _POSIX_V7_LP64_OFF64 -1
75# define _POSIX_V7_LPBIG_OFFBIG -1
76# define _POSIX_V6_LP64_OFF64 -1
77# define _POSIX_V6_LPBIG_OFFBIG -1
78# define _XBS5_LP64_OFF64 -1
79# define _XBS5_LPBIG_OFFBIG -1
80
81#endif /* __WORDSIZE == 32 */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/fcntl.h created+62
......@@ -0,0 +1,62 @@
1/* O_*, F_*, FD_* bit values for Linux / RISC-V.
2 Copyright (C) 2011-2024 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 <https://www.gnu.org/licenses/>. */
19
20#ifndef _FCNTL_H
21# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
22#endif
23
24#include <bits/wordsize.h>
25
26/* In 64-bit ISA files are always with 64bit off_t and F_*LK64 are the same as
27 non-64-bit versions. It will need to be revised for 128-bit. */
28#if __WORDSIZE == 64
29# define __O_LARGEFILE 0
30
31# define F_GETLK64 5 /* Get record locking info. */
32# define F_SETLK64 6 /* Set record locking info (non-blocking). */
33# define F_SETLKW64 7 /* Set record locking info (blocking). */
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#if __WORDSIZE == 64 || !defined __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/riscv32-linux-gnu/bits/fenv.h created+74
......@@ -0,0 +1,74 @@
1/* Floating point environment, RISC-V version.
2 Copyright (C) 1998-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _FENV_H
20# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
21#endif
22
23enum
24 {
25 FE_INEXACT =
26#define FE_INEXACT (0x01)
27 FE_INEXACT,
28 FE_UNDERFLOW =
29#define FE_UNDERFLOW (0x02)
30 FE_UNDERFLOW,
31 FE_OVERFLOW =
32#define FE_OVERFLOW (0x04)
33 FE_OVERFLOW,
34 FE_DIVBYZERO =
35#define FE_DIVBYZERO (0x08)
36 FE_DIVBYZERO,
37 FE_INVALID =
38#define FE_INVALID (0x10)
39 FE_INVALID
40 };
41
42#define FE_ALL_EXCEPT \
43 (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
44
45enum
46 {
47 FE_TONEAREST =
48#define FE_TONEAREST (0x0)
49 FE_TONEAREST,
50 FE_TOWARDZERO =
51#define FE_TOWARDZERO (0x1)
52 FE_TOWARDZERO,
53 FE_DOWNWARD =
54#define FE_DOWNWARD (0x2)
55 FE_DOWNWARD,
56 FE_UPWARD =
57#define FE_UPWARD (0x3)
58 FE_UPWARD
59 };
60
61
62typedef unsigned int fexcept_t;
63typedef unsigned int fenv_t;
64
65/* If the default argument is used we use this value. */
66#define FE_DFL_ENV ((__const fenv_t *) -1)
67
68#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
69/* Type representing floating-point control modes. */
70typedef unsigned int femode_t;
71
72/* Default floating-point control modes. */
73# define FE_DFL_MODE ((const femode_t *) -1L)
74#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/floatn.h created+97
......@@ -0,0 +1,97 @@
1/* Macros to control TS 18661-3 glibc features on ldbl-128 platforms.
2 Copyright (C) 2017-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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 && !__GNUC_PREREQ (13, 0))
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 && !__GNUC_PREREQ (13, 0))
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 && !__GNUC_PREREQ (13, 0))
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/riscv32-linux-gnu/bits/link.h created+56
......@@ -0,0 +1,56 @@
1/* Machine-specific declarations for dynamic linker interface. RISC-V version.
2 Copyright (C) 2005-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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
23typedef struct La_riscv_regs
24{
25 unsigned long int lr_reg[8]; /* a0 - a7 */
26 double lr_fpreg[8]; /* fa0 - fa7 */
27 unsigned long int lr_ra;
28 unsigned long int lr_sp;
29} La_riscv_regs;
30
31/* Return values for calls from PLT on RISC-V. */
32typedef struct La_riscv_retval
33{
34 unsigned long int lrv_a0;
35 unsigned long int lrv_a1;
36 double lrv_fa0;
37 double lrv_fa1;
38} La_riscv_retval;
39
40__BEGIN_DECLS
41
42extern ElfW(Addr) la_riscv_gnu_pltenter (ElfW(Sym) *__sym, unsigned int __ndx,
43 uintptr_t *__refcook,
44 uintptr_t *__defcook,
45 La_riscv_regs *__regs,
46 unsigned int *__flags,
47 const char *__symname,
48 long int *__framesizep);
49extern unsigned int la_riscv_gnu_pltexit (ElfW(Sym) *__sym, unsigned int __ndx,
50 uintptr_t *__refcook,
51 uintptr_t *__defcook,
52 const La_riscv_regs *__inregs,
53 La_riscv_retval *__outregs,
54 const char *__symname);
55
56__END_DECLS
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/long-double.h created+21
......@@ -0,0 +1,21 @@
1/* Properties of long double type. ldbl-128 version.
2 Copyright (C) 2016-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C 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/* long double is distinct from double, so there is nothing to
20 define here. */
21#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/procfs.h created+31
......@@ -0,0 +1,31 @@
1/* Types for registers for sys/procfs.h. RISC-V version.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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 <sys/ucontext.h>
24
25/* ELF register definitions */
26#define ELF_NGREG NGREG
27#define ELF_NFPREG NFPREG
28
29typedef unsigned long int elf_greg_t;
30typedef unsigned long int elf_gregset_t[32];
31typedef union __riscv_mc_fp_state elf_fpregset_t;
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/pthreadtypes-arch.h created+45
......@@ -0,0 +1,45 @@
1/* Machine-specific pthread type layouts. RISC-V version.
2 Copyright (C) 2011-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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#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
35#else
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
40#endif
41
42#define __LOCK_ALIGNMENT
43#define __ONCE_ALIGNMENT
44
45#endif /* bits/pthreadtypes.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/rseq.h created+29
......@@ -0,0 +1,29 @@
1/* Restartable Sequences architecture header. Stub version.
2 Copyright (C) 2021-2024 Free Software Foundation, Inc.
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_RSEQ_H
19# error "Never use <bits/rseq.h> directly; include <sys/rseq.h> instead."
20#endif
21
22/* RSEQ_SIG is a signature required before each abort handler code.
23
24 It is a 32-bit value that maps to actual architecture code compiled
25 into applications and libraries. It needs to be defined for each
26 architecture. When choosing this value, it needs to be taken into
27 account that generating invalid instructions may have ill effects on
28 tools like objdump, and may also have impact on the CPU speculative
29 execution efficiency in some cases. */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/setjmp.h created+39
......@@ -0,0 +1,39 @@
1/* Define the machine-dependent type `jmp_buf'. RISC-V version.
2 Copyright (C) 2011-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _RISCV_BITS_SETJMP_H
20#define _RISCV_BITS_SETJMP_H
21
22typedef struct __jmp_buf_internal_tag
23 {
24 /* Program counter. */
25 long int __pc;
26 /* Callee-saved registers. */
27 long int __regs[12];
28 /* Stack pointer. */
29 long int __sp;
30
31 /* Callee-saved floating point registers. */
32#if defined __riscv_float_abi_double
33 double __fpregs[12];
34#elif !defined __riscv_float_abi_soft
35# error unsupported FLEN
36#endif
37 } __jmp_buf[1];
38
39#endif /* _RISCV_BITS_SETJMP_H */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/sigcontext.h created+31
......@@ -0,0 +1,31 @@
1/* Machine-dependent signal context structure for Linux. RISC-V version.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc. 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 _BITS_SIGCONTEXT_H
19#define _BITS_SIGCONTEXT_H 1
20
21#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
22# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
23#endif
24
25struct sigcontext {
26 /* gregs[0] holds the program counter. */
27 unsigned long int gregs[32];
28 unsigned long long int fpregs[66] __attribute__ ((__aligned__ (16)));
29};
30
31#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/struct_rwlock.h created+68
......@@ -0,0 +1,68 @@
1/* RISC-V internal rwlock struct definitions.
2 Copyright (C) 2019-2024 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 <https://www.gnu.org/licenses/>. */
19
20#ifndef _RWLOCK_INTERNAL_H
21#define _RWLOCK_INTERNAL_H
22
23/* There is a lot of padding in this structure. While it's not strictly
24 necessary on RISC-V, we're going to leave it in to be on the safe side in
25 case it's needed in the future. Most other architectures have the padding,
26 so this gives us the same extensibility as everyone else has. */
27struct __pthread_rwlock_arch_t
28{
29 unsigned int __readers;
30 unsigned int __writers;
31 unsigned int __wrphase_futex;
32 unsigned int __writers_futex;
33 unsigned int __pad3;
34 unsigned int __pad4;
35#if __WORDSIZE == 64
36 int __cur_writer;
37 int __shared;
38 unsigned long int __pad1;
39 unsigned long int __pad2;
40 unsigned int __flags;
41#else
42# if __BYTE_ORDER == __BIG_ENDIAN
43 unsigned char __pad1;
44 unsigned char __pad2;
45 unsigned char __shared;
46 unsigned char __flags;
47# else
48 unsigned char __flags;
49 unsigned char __shared;
50 unsigned char __pad1;
51 unsigned char __pad2;
52# endif
53 int __cur_writer;
54#endif
55};
56
57#if __WORDSIZE == 64
58# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \
59 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags
60#elif __BYTE_ORDER == __BIG_ENDIAN
61# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \
62 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0
63#else
64# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \
65 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0
66#endif
67
68#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/struct_stat.h created+127
......@@ -0,0 +1,127 @@
1/* Definition for struct stat.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of 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/endian.h>
27#include <bits/wordsize.h>
28
29#if defined __USE_FILE_OFFSET64
30# define __field64(type, type64, name) type64 name
31#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
32# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
33# error "ino_t and off_t must both be the same type"
34# endif
35# define __field64(type, type64, name) type name
36#elif __BYTE_ORDER == __LITTLE_ENDIAN
37# define __field64(type, type64, name) \
38 type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
39#else
40# define __field64(type, type64, name) \
41 int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
42#endif
43
44struct stat
45 {
46 __dev_t st_dev; /* Device. */
47 __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */
48 __mode_t st_mode; /* File mode. */
49 __nlink_t st_nlink; /* Link count. */
50 __uid_t st_uid; /* User ID of the file's owner. */
51 __gid_t st_gid; /* Group ID of the file's group.*/
52 __dev_t st_rdev; /* Device number, if device. */
53 __dev_t __pad1;
54 __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */
55 __blksize_t st_blksize; /* Optimal block size for I/O. */
56 int __pad2;
57 __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */
58#ifdef __USE_XOPEN2K8
59 /* Nanosecond resolution timestamps are stored in a format
60 equivalent to 'struct timespec'. This is the type used
61 whenever possible but the Unix namespace rules do not allow the
62 identifier 'timespec' to appear in the <sys/stat.h> header.
63 Therefore we have to handle the use of this header in strictly
64 standard-compliant sources special. */
65 struct timespec st_atim; /* Time of last access. */
66 struct timespec st_mtim; /* Time of last modification. */
67 struct timespec st_ctim; /* Time of last status change. */
68# define st_atime st_atim.tv_sec /* Backward compatibility. */
69# define st_mtime st_mtim.tv_sec
70# define st_ctime st_ctim.tv_sec
71#else
72 __time_t st_atime; /* Time of last access. */
73 unsigned long int st_atimensec; /* Nscecs of last access. */
74 __time_t st_mtime; /* Time of last modification. */
75 unsigned long int st_mtimensec; /* Nsecs of last modification. */
76 __time_t st_ctime; /* Time of last status change. */
77 unsigned long int st_ctimensec; /* Nsecs of last status change. */
78#endif
79 int __glibc_reserved[2];
80 };
81
82#undef __field64
83
84#ifdef __USE_LARGEFILE64
85struct stat64
86 {
87 __dev_t st_dev; /* Device. */
88 __ino64_t st_ino; /* File serial number. */
89 __mode_t st_mode; /* File mode. */
90 __nlink_t st_nlink; /* Link count. */
91 __uid_t st_uid; /* User ID of the file's owner. */
92 __gid_t st_gid; /* Group ID of the file's group.*/
93 __dev_t st_rdev; /* Device number, if device. */
94 __dev_t __pad1;
95 __off64_t st_size; /* Size of file, in bytes. */
96 __blksize_t st_blksize; /* Optimal block size for I/O. */
97 int __pad2;
98 __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
99#ifdef __USE_XOPEN2K8
100 /* Nanosecond resolution timestamps are stored in a format
101 equivalent to 'struct timespec'. This is the type used
102 whenever possible but the Unix namespace rules do not allow the
103 identifier 'timespec' to appear in the <sys/stat.h> header.
104 Therefore we have to handle the use of this header in strictly
105 standard-compliant sources special. */
106 struct timespec st_atim; /* Time of last access. */
107 struct timespec st_mtim; /* Time of last modification. */
108 struct timespec st_ctim; /* Time of last status change. */
109#else
110 __time_t st_atime; /* Time of last access. */
111 unsigned long int st_atimensec; /* Nscecs of last access. */
112 __time_t st_mtime; /* Time of last modification. */
113 unsigned long int st_mtimensec; /* Nsecs of last modification. */
114 __time_t st_ctime; /* Time of last status change. */
115 unsigned long int st_ctimensec; /* Nsecs of last status change. */
116#endif
117 int __glibc_reserved[2];
118 };
119#endif
120
121/* Tell code we have these members. */
122#define _STATBUF_ST_BLKSIZE
123#define _STATBUF_ST_RDEV
124/* Nanosecond resolution time values are supported. */
125#define _STATBUF_ST_NSEC
126
127#endif /* _BITS_STRUCT_STAT_H */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/time64.h created+36
......@@ -0,0 +1,36 @@
1/* bits/time64.h -- underlying types for __time64_t. RISC-V version.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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/time64.h> directly; use <sys/types.h> instead."
21#endif
22
23#ifndef _BITS_TIME64_H
24#define _BITS_TIME64_H 1
25
26/* Define __TIME64_T_TYPE so that it is always a 64-bit type. */
27
28#if __WORDSIZE == 64
29/* If we already have 64-bit time type then use it. */
30# define __TIME64_T_TYPE __TIME_T_TYPE
31#else
32/* Define a 64-bit time type alongsize the 32-bit one. */
33# define __TIME64_T_TYPE __SQUAD_TYPE
34#endif
35
36#endif /* bits/time64.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/timesize.h created+20
......@@ -0,0 +1,20 @@
1/* Bit size of the time_t type at glibc build time, general case.
2 Copyright (C) 2018-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19/* Size in bits of the 'time_t' type of the default ABI. */
20#define __TIMESIZE 64
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/typesizes.h created+107
......@@ -0,0 +1,107 @@
1/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI.
2 Copyright (C) 2011-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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#if __TIMESIZE == 64 && __WORDSIZE == 32
29/* These are the "new" y2038 types defined for architectures added after
30 the 5.1 kernel. */
31# define __INO_T_TYPE __UQUAD_TYPE
32# define __OFF_T_TYPE __SQUAD_TYPE
33# define __RLIM_T_TYPE __UQUAD_TYPE
34# define __BLKCNT_T_TYPE __SQUAD_TYPE
35# define __FSBLKCNT_T_TYPE __UQUAD_TYPE
36# define __FSFILCNT_T_TYPE __UQUAD_TYPE
37# define __TIME_T_TYPE __SQUAD_TYPE
38# define __SUSECONDS_T_TYPE __SQUAD_TYPE
39#else
40# define __INO_T_TYPE __ULONGWORD_TYPE
41# define __OFF_T_TYPE __SLONGWORD_TYPE
42# define __RLIM_T_TYPE __ULONGWORD_TYPE
43# define __BLKCNT_T_TYPE __SLONGWORD_TYPE
44# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
45# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
46# define __TIME_T_TYPE __SLONGWORD_TYPE
47# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
48#endif
49
50#define __DEV_T_TYPE __UQUAD_TYPE
51#define __UID_T_TYPE __U32_TYPE
52#define __GID_T_TYPE __U32_TYPE
53#define __INO64_T_TYPE __UQUAD_TYPE
54#define __MODE_T_TYPE __U32_TYPE
55#define __NLINK_T_TYPE __U32_TYPE
56#define __OFF64_T_TYPE __SQUAD_TYPE
57#define __PID_T_TYPE __S32_TYPE
58#define __RLIM64_T_TYPE __UQUAD_TYPE
59#define __BLKCNT64_T_TYPE __SQUAD_TYPE
60#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
61#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
62#define __FSWORD_T_TYPE __SWORD_TYPE
63#define __ID_T_TYPE __U32_TYPE
64#define __CLOCK_T_TYPE __SLONGWORD_TYPE
65#define __USECONDS_T_TYPE __U32_TYPE
66#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
67#define __DADDR_T_TYPE __S32_TYPE
68#define __KEY_T_TYPE __S32_TYPE
69#define __CLOCKID_T_TYPE __S32_TYPE
70#define __TIMER_T_TYPE void *
71#define __BLKSIZE_T_TYPE __S32_TYPE
72#define __FSID_T_TYPE struct { int __val[2]; }
73#define __SSIZE_T_TYPE __SWORD_TYPE
74#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
75#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
76#define __CPU_MASK_TYPE __ULONGWORD_TYPE
77
78#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32)
79/* Tell the libc code that off_t and off64_t are actually the same type
80 for all ABI purposes, even if possibly expressed as different base types
81 for C type-checking purposes. */
82# define __OFF_T_MATCHES_OFF64_T 1
83
84/* Same for ino_t and ino64_t. */
85# define __INO_T_MATCHES_INO64_T 1
86
87/* And for __rlim_t and __rlim64_t. */
88# define __RLIM_T_MATCHES_RLIM64_T 1
89
90/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
91# define __STATFS_MATCHES_STATFS64 1
92
93/* And for getitimer, setitimer and rusage */
94# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64)
95#else
96# define __RLIM_T_MATCHES_RLIM64_T 0
97
98# define __STATFS_MATCHES_STATFS64 0
99
100# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
101#endif
102
103/* Number of descriptors that can fit in an `fd_set'. */
104#define __FD_SETSIZE 1024
105
106
107#endif /* bits/typesizes.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/bits/wordsize.h created+30
......@@ -0,0 +1,30 @@
1/* Determine the wordsize from the preprocessor defines. RISC-V version.
2 Copyright (C) 2002-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of 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 __riscv_xlen == (__SIZEOF_POINTER__ * 8)
20# define __WORDSIZE __riscv_xlen
21#else
22# error unsupported ABI
23#endif
24
25#define __WORDSIZE_TIME64_COMPAT32 1
26
27#if __WORDSIZE == 32
28# define __WORDSIZE32_SIZE_ULONG 0
29# define __WORDSIZE32_PTRDIFF_LONG 0
30#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/fpu_control.h created+74
......@@ -0,0 +1,74 @@
1/* FPU control word bits. RISC-V version.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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#include <features.h>
23
24#ifndef __riscv_flen
25
26# define _FPU_RESERVED 0xffffffff
27# define _FPU_DEFAULT 0x00000000
28typedef unsigned int fpu_control_t;
29# define _FPU_GETCW(cw) (cw) = 0
30# define _FPU_SETCW(cw) do { } while (0)
31extern fpu_control_t __fpu_control;
32
33#else /* __riscv_flen */
34
35# define _FPU_RESERVED 0
36# define _FPU_DEFAULT 0
37# define _FPU_IEEE _FPU_DEFAULT
38
39/* Type of the control word. */
40typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
41
42/* Macros for accessing the hardware control word. */
43# define _FPU_GETCW(cw) __asm__ volatile ("frsr %0" : "=r" (cw))
44# define _FPU_SETCW(cw) __asm__ volatile ("fssr %z0" : : "rJ" (cw))
45
46/* Default control word set at startup. */
47extern fpu_control_t __fpu_control;
48
49# define _FCLASS(x) (__extension__ ({ int __res; \
50 if (sizeof (x) * 8 > __riscv_flen) __builtin_trap (); \
51 if (sizeof (x) == 4) asm ("fclass.s %0, %1" : "=r" (__res) : "f" (x)); \
52 else if (sizeof (x) == 8) asm ("fclass.d %0, %1" : "=r" (__res) : "f" (x)); \
53 else __builtin_trap (); \
54 __res; }))
55
56# define _FCLASS_MINF (1 << 0)
57# define _FCLASS_MNORM (1 << 1)
58# define _FCLASS_MSUBNORM (1 << 2)
59# define _FCLASS_MZERO (1 << 3)
60# define _FCLASS_PZERO (1 << 4)
61# define _FCLASS_PSUBNORM (1 << 5)
62# define _FCLASS_PNORM (1 << 6)
63# define _FCLASS_PINF (1 << 7)
64# define _FCLASS_SNAN (1 << 8)
65# define _FCLASS_QNAN (1 << 9)
66# define _FCLASS_ZERO (_FCLASS_MZERO | _FCLASS_PZERO)
67# define _FCLASS_SUBNORM (_FCLASS_MSUBNORM | _FCLASS_PSUBNORM)
68# define _FCLASS_NORM (_FCLASS_MNORM | _FCLASS_PNORM)
69# define _FCLASS_INF (_FCLASS_MINF | _FCLASS_PINF)
70# define _FCLASS_NAN (_FCLASS_SNAN | _FCLASS_QNAN)
71
72#endif /* __riscv_flen */
73
74#endif /* fpu_control.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/gnu/lib-names-ilp32.h created+27
......@@ -0,0 +1,27 @@
1/* This file is automatically generated. */
2#ifndef __GNU_LIB_NAMES_H
3# error "Never use <gnu/lib-names-ilp32.h> directly; include <gnu/lib-names.h> instead."
4#endif
5
6#define LD_LINUX_RISCV32_ILP32_SO "ld-linux-riscv32-ilp32.so.1"
7#define LD_SO "ld-linux-riscv32-ilp32.so.1"
8#define LIBANL_SO "libanl.so.1"
9#define LIBBROKENLOCALE_SO "libBrokenLocale.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 LIBPTHREAD_SO "libpthread.so.0"
24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/gnu/lib-names.h created+22
......@@ -0,0 +1,22 @@
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 && defined __riscv_float_abi_soft
10# include <gnu/lib-names-ilp32.h>
11#endif
12#if __WORDSIZE == 32 && defined __riscv_float_abi_double
13# include <gnu/lib-names-ilp32d.h>
14#endif
15#if __WORDSIZE == 64 && defined __riscv_float_abi_soft
16# include <gnu/lib-names-lp64.h>
17#endif
18#if __WORDSIZE == 64 && defined __riscv_float_abi_double
19# include <gnu/lib-names-lp64d.h>
20#endif
21
22#endif /* gnu/lib-names.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/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
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/gnu/stubs.h created+18
......@@ -0,0 +1,18 @@
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 && defined __riscv_float_abi_soft
8# include <gnu/stubs-ilp32.h>
9#endif
10#if __WORDSIZE == 32 && defined __riscv_float_abi_double
11# include <gnu/stubs-ilp32d.h>
12#endif
13#if __WORDSIZE == 64 && defined __riscv_float_abi_soft
14# include <gnu/stubs-lp64.h>
15#endif
16#if __WORDSIZE == 64 && defined __riscv_float_abi_double
17# include <gnu/stubs-lp64d.h>
18#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/ieee754.h created+170
......@@ -0,0 +1,170 @@
1/* Copyright (C) 1992-2024 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__BEGIN_DECLS
26
27union ieee754_float
28 {
29 float f;
30
31 /* This is the IEEE 754 single-precision format. */
32 struct
33 {
34#if __BYTE_ORDER == __BIG_ENDIAN
35 unsigned int negative:1;
36 unsigned int exponent:8;
37 unsigned int mantissa:23;
38#endif /* Big endian. */
39#if __BYTE_ORDER == __LITTLE_ENDIAN
40 unsigned int mantissa:23;
41 unsigned int exponent:8;
42 unsigned int negative:1;
43#endif /* Little endian. */
44 } ieee;
45
46 /* This format makes it easier to see if a NaN is a signalling NaN. */
47 struct
48 {
49#if __BYTE_ORDER == __BIG_ENDIAN
50 unsigned int negative:1;
51 unsigned int exponent:8;
52 unsigned int quiet_nan:1;
53 unsigned int mantissa:22;
54#endif /* Big endian. */
55#if __BYTE_ORDER == __LITTLE_ENDIAN
56 unsigned int mantissa:22;
57 unsigned int quiet_nan:1;
58 unsigned int exponent:8;
59 unsigned int negative:1;
60#endif /* Little endian. */
61 } ieee_nan;
62 };
63
64#define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */
65
66
67union ieee754_double
68 {
69 double d;
70
71 /* This is the IEEE 754 double-precision format. */
72 struct
73 {
74#if __BYTE_ORDER == __BIG_ENDIAN
75 unsigned int negative:1;
76 unsigned int exponent:11;
77 /* Together these comprise the mantissa. */
78 unsigned int mantissa0:20;
79 unsigned int mantissa1:32;
80#endif /* Big endian. */
81#if __BYTE_ORDER == __LITTLE_ENDIAN
82 /* Together these comprise the mantissa. */
83 unsigned int mantissa1:32;
84 unsigned int mantissa0:20;
85 unsigned int exponent:11;
86 unsigned int negative:1;
87#endif /* Little endian. */
88 } ieee;
89
90 /* This format makes it easier to see if a NaN is a signalling NaN. */
91 struct
92 {
93#if __BYTE_ORDER == __BIG_ENDIAN
94 unsigned int negative:1;
95 unsigned int exponent:11;
96 unsigned int quiet_nan:1;
97 /* Together these comprise the mantissa. */
98 unsigned int mantissa0:19;
99 unsigned int mantissa1:32;
100#else
101 /* Together these comprise the mantissa. */
102 unsigned int mantissa1:32;
103 unsigned int mantissa0:19;
104 unsigned int quiet_nan:1;
105 unsigned int exponent:11;
106 unsigned int negative:1;
107#endif
108 } ieee_nan;
109 };
110
111#define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */
112
113
114union ieee854_long_double
115 {
116 long double d;
117
118 /* This is the IEEE 854 quad-precision format. */
119 struct
120 {
121#if __BYTE_ORDER == __BIG_ENDIAN
122 unsigned int negative:1;
123 unsigned int exponent:15;
124 /* Together these comprise the mantissa. */
125 unsigned int mantissa0:16;
126 unsigned int mantissa1:32;
127 unsigned int mantissa2:32;
128 unsigned int mantissa3:32;
129#endif /* Big endian. */
130#if __BYTE_ORDER == __LITTLE_ENDIAN
131 /* Together these comprise the mantissa. */
132 unsigned int mantissa3:32;
133 unsigned int mantissa2:32;
134 unsigned int mantissa1:32;
135 unsigned int mantissa0:16;
136 unsigned int exponent:15;
137 unsigned int negative:1;
138#endif /* Little endian. */
139 } ieee;
140
141 /* This format makes it easier to see if a NaN is a signalling NaN. */
142 struct
143 {
144#if __BYTE_ORDER == __BIG_ENDIAN
145 unsigned int negative:1;
146 unsigned int exponent:15;
147 unsigned int quiet_nan:1;
148 /* Together these comprise the mantissa. */
149 unsigned int mantissa0:15;
150 unsigned int mantissa1:32;
151 unsigned int mantissa2:32;
152 unsigned int mantissa3:32;
153#else
154 /* Together these comprise the mantissa. */
155 unsigned int mantissa3:32;
156 unsigned int mantissa2:32;
157 unsigned int mantissa1:32;
158 unsigned int mantissa0:15;
159 unsigned int quiet_nan:1;
160 unsigned int exponent:15;
161 unsigned int negative:1;
162#endif
163 } ieee_nan;
164 };
165
166#define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */
167
168__END_DECLS
169
170#endif /* ieee754.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/sys/asm.h created+66
......@@ -0,0 +1,66 @@
1/* Miscellaneous macros.
2 Copyright (C) 2000-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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_ASM_H
20#define _SYS_ASM_H
21
22/* Macros to handle different pointer/register sizes for 32/64-bit code. */
23#if __riscv_xlen == 64
24# define PTRLOG 3
25# define SZREG 8
26# define REG_S sd
27# define REG_L ld
28#elif __riscv_xlen == 32
29# define PTRLOG 2
30# define SZREG 4
31# define REG_S sw
32# define REG_L lw
33#else
34# error __riscv_xlen must equal 32 or 64
35#endif
36
37#if !defined __riscv_float_abi_soft
38/* For ABI uniformity, reserve 8 bytes for floats, even if double-precision
39 floating-point is not supported in hardware. */
40# if defined __riscv_float_abi_double
41# define FREG_L fld
42# define FREG_S fsd
43# define SZFREG 8
44# else
45# error unsupported FLEN
46# endif
47#endif
48
49/* Declare leaf routine. */
50#define LEAF(symbol) \
51 .globl symbol; \
52 .align 2; \
53 .type symbol,@function; \
54symbol: \
55 cfi_startproc;
56
57/* Mark end of function. */
58#undef END
59#define END(function) \
60 cfi_endproc; \
61 .size function,.-function
62
63/* Stack alignment. */
64#define ALMASK ~15
65
66#endif /* sys/asm.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/sys/cachectl.h created+32
......@@ -0,0 +1,32 @@
1/* RISC-V instruction cache flushing interface
2 Copyright (C) 2017-2024 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 <https://www.gnu.org/licenses/>. */
19
20#ifndef _SYS_CACHECTL_H
21#define _SYS_CACHECTL_H 1
22
23#include <features.h>
24
25__BEGIN_DECLS
26
27extern int __riscv_flush_icache (void *__start, void *__end,
28 unsigned long int __flags);
29
30__END_DECLS
31
32#endif /* sys/cachectl.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/sys/ucontext.h created+110
......@@ -0,0 +1,110 @@
1/* struct ucontext definition, RISC-V version.
2 Copyright (C) 1997-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19/* Don't rely on this, the interface is currently messed up and may need to
20 be broken to be fixed. */
21#ifndef _SYS_UCONTEXT_H
22#define _SYS_UCONTEXT_H 1
23
24#include <features.h>
25
26#include <bits/types/sigset_t.h>
27#include <bits/types/stack_t.h>
28
29typedef unsigned long int __riscv_mc_gp_state[32];
30
31#ifdef __USE_MISC
32# define NGREG 32
33
34# define REG_PC 0
35# define REG_RA 1
36# define REG_SP 2
37# define REG_TP 4
38# define REG_S0 8
39# define REG_S1 9
40# define REG_A0 10
41# define REG_S2 18
42# define REG_NARGS 8
43
44typedef unsigned long int greg_t;
45
46/* Container for all general registers. */
47typedef __riscv_mc_gp_state gregset_t;
48
49/* Container for floating-point state. */
50typedef union __riscv_mc_fp_state fpregset_t;
51#endif
52
53struct __riscv_mc_f_ext_state
54 {
55 unsigned int __f[32];
56 unsigned int __fcsr;
57 };
58
59struct __riscv_mc_d_ext_state
60 {
61 unsigned long long int __f[32];
62 unsigned int __fcsr;
63 };
64
65struct __riscv_mc_q_ext_state
66 {
67 unsigned long long int __f[64] __attribute__ ((__aligned__ (16)));
68 unsigned int __fcsr;
69 /* Reserved for expansion of sigcontext structure. Currently zeroed
70 upon signal, and must be zero upon sigreturn. */
71 unsigned int __glibc_reserved[3];
72 };
73
74union __riscv_mc_fp_state
75 {
76 struct __riscv_mc_f_ext_state __f;
77 struct __riscv_mc_d_ext_state __d;
78 struct __riscv_mc_q_ext_state __q;
79 };
80
81typedef struct mcontext_t
82 {
83 __riscv_mc_gp_state __gregs;
84 union __riscv_mc_fp_state __fpregs;
85 } mcontext_t;
86
87/* Userlevel context. */
88typedef struct ucontext_t
89 {
90 unsigned long int __uc_flags;
91 struct ucontext_t *uc_link;
92 stack_t uc_stack;
93 sigset_t uc_sigmask;
94 /* There's some padding here to allow sigset_t to be expanded in the
95 future. Though this is unlikely, other architectures put uc_sigmask
96 at the end of this structure and explicitly state it can be
97 expanded, so we didn't want to box ourselves in here. */
98 char __glibc_reserved[1024 / 8 - sizeof (sigset_t)];
99 /* We can't put uc_sigmask at the end of this structure because we need
100 to be able to expand sigcontext in the future. For example, the
101 vector ISA extension will almost certainly add ISA state. We want
102 to ensure all user-visible ISA state can be saved and restored via a
103 ucontext, so we're putting this at the end in order to allow for
104 infinite extensibility. Since we know this will be extended and we
105 assume sigset_t won't be extended an extreme amount, we're
106 prioritizing this. */
107 mcontext_t uc_mcontext;
108 } ucontext_t;
109
110#endif /* sys/ucontext.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnu/sys/user.h created+23
......@@ -0,0 +1,23 @@
1/* Copyright (C) 2001-2024 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#define _SYS_USER_H 1
20
21
22
23#endif /* _SYS_USER_H */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/endianness.h deleted-11
......@@ -1,11 +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/* RISC-V is little-endian. */
9#define __BYTE_ORDER __LITTLE_ENDIAN
10
11#endif /* bits/endianness.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/environments.h deleted-81
......@@ -1,81 +0,0 @@
1/* Copyright (C) 2020-2024 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/* We can never provide environments with 32-bit wide pointers. */
45# define _POSIX_V7_ILP32_OFF32 -1
46# define _POSIX_V7_ILP32_OFFBIG -1
47# define _POSIX_V6_ILP32_OFF32 -1
48# define _POSIX_V6_ILP32_OFFBIG -1
49# define _XBS5_ILP32_OFF32 -1
50# define _XBS5_ILP32_OFFBIG -1
51/* We also have no use (for now) for an environment with bigger pointers
52 and offsets. */
53# define _POSIX_V7_LPBIG_OFFBIG -1
54# define _POSIX_V6_LPBIG_OFFBIG -1
55# define _XBS5_LPBIG_OFFBIG -1
56
57/* By default we have 64-bit wide `long int', pointers and `off_t'. */
58# define _POSIX_V7_LP64_OFF64 1
59# define _POSIX_V6_LP64_OFF64 1
60# define _XBS5_LP64_OFF64 1
61
62#else /* __WORDSIZE == 32 */
63
64/* RISC-V requires 64-bit off_t */
65# define _POSIX_V7_ILP32_OFF32 -1
66# define _POSIX_V6_ILP32_OFF32 -1
67# define _XBS5_ILP32_OFF32 -1
68
69# define _POSIX_V7_ILP32_OFFBIG 1
70# define _POSIX_V6_ILP32_OFFBIG 1
71# define _XBS5_ILP32_OFFBIG 1
72
73/* We can never provide environments with 64-bit wide pointers. */
74# define _POSIX_V7_LP64_OFF64 -1
75# define _POSIX_V7_LPBIG_OFFBIG -1
76# define _POSIX_V6_LP64_OFF64 -1
77# define _POSIX_V6_LPBIG_OFFBIG -1
78# define _XBS5_LP64_OFF64 -1
79# define _XBS5_LPBIG_OFFBIG -1
80
81#endif /* __WORDSIZE == 32 */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/fcntl.h deleted-62
......@@ -1,62 +0,0 @@
1/* O_*, F_*, FD_* bit values for Linux / RISC-V.
2 Copyright (C) 2011-2024 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 <https://www.gnu.org/licenses/>. */
19
20#ifndef _FCNTL_H
21# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
22#endif
23
24#include <bits/wordsize.h>
25
26/* In 64-bit ISA files are always with 64bit off_t and F_*LK64 are the same as
27 non-64-bit versions. It will need to be revised for 128-bit. */
28#if __WORDSIZE == 64
29# define __O_LARGEFILE 0
30
31# define F_GETLK64 5 /* Get record locking info. */
32# define F_SETLK64 6 /* Set record locking info (non-blocking). */
33# define F_SETLKW64 7 /* Set record locking info (blocking). */
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#if __WORDSIZE == 64 || !defined __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/riscv32-linux-gnuilp32/bits/fenv.h deleted-74
......@@ -1,74 +0,0 @@
1/* Floating point environment, RISC-V version.
2 Copyright (C) 1998-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _FENV_H
20# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
21#endif
22
23enum
24 {
25 FE_INEXACT =
26#define FE_INEXACT (0x01)
27 FE_INEXACT,
28 FE_UNDERFLOW =
29#define FE_UNDERFLOW (0x02)
30 FE_UNDERFLOW,
31 FE_OVERFLOW =
32#define FE_OVERFLOW (0x04)
33 FE_OVERFLOW,
34 FE_DIVBYZERO =
35#define FE_DIVBYZERO (0x08)
36 FE_DIVBYZERO,
37 FE_INVALID =
38#define FE_INVALID (0x10)
39 FE_INVALID
40 };
41
42#define FE_ALL_EXCEPT \
43 (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
44
45enum
46 {
47 FE_TONEAREST =
48#define FE_TONEAREST (0x0)
49 FE_TONEAREST,
50 FE_TOWARDZERO =
51#define FE_TOWARDZERO (0x1)
52 FE_TOWARDZERO,
53 FE_DOWNWARD =
54#define FE_DOWNWARD (0x2)
55 FE_DOWNWARD,
56 FE_UPWARD =
57#define FE_UPWARD (0x3)
58 FE_UPWARD
59 };
60
61
62typedef unsigned int fexcept_t;
63typedef unsigned int fenv_t;
64
65/* If the default argument is used we use this value. */
66#define FE_DFL_ENV ((__const fenv_t *) -1)
67
68#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
69/* Type representing floating-point control modes. */
70typedef unsigned int femode_t;
71
72/* Default floating-point control modes. */
73# define FE_DFL_MODE ((const femode_t *) -1L)
74#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/floatn.h deleted-97
......@@ -1,97 +0,0 @@
1/* Macros to control TS 18661-3 glibc features on ldbl-128 platforms.
2 Copyright (C) 2017-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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 && !__GNUC_PREREQ (13, 0))
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 && !__GNUC_PREREQ (13, 0))
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 && !__GNUC_PREREQ (13, 0))
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/riscv32-linux-gnuilp32/bits/link.h deleted-56
......@@ -1,56 +0,0 @@
1/* Machine-specific declarations for dynamic linker interface. RISC-V version.
2 Copyright (C) 2005-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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
23typedef struct La_riscv_regs
24{
25 unsigned long int lr_reg[8]; /* a0 - a7 */
26 double lr_fpreg[8]; /* fa0 - fa7 */
27 unsigned long int lr_ra;
28 unsigned long int lr_sp;
29} La_riscv_regs;
30
31/* Return values for calls from PLT on RISC-V. */
32typedef struct La_riscv_retval
33{
34 unsigned long int lrv_a0;
35 unsigned long int lrv_a1;
36 double lrv_fa0;
37 double lrv_fa1;
38} La_riscv_retval;
39
40__BEGIN_DECLS
41
42extern ElfW(Addr) la_riscv_gnu_pltenter (ElfW(Sym) *__sym, unsigned int __ndx,
43 uintptr_t *__refcook,
44 uintptr_t *__defcook,
45 La_riscv_regs *__regs,
46 unsigned int *__flags,
47 const char *__symname,
48 long int *__framesizep);
49extern unsigned int la_riscv_gnu_pltexit (ElfW(Sym) *__sym, unsigned int __ndx,
50 uintptr_t *__refcook,
51 uintptr_t *__defcook,
52 const La_riscv_regs *__inregs,
53 La_riscv_retval *__outregs,
54 const char *__symname);
55
56__END_DECLS
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/long-double.h deleted-21
......@@ -1,21 +0,0 @@
1/* Properties of long double type. ldbl-128 version.
2 Copyright (C) 2016-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C 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/* long double is distinct from double, so there is nothing to
20 define here. */
21#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/procfs.h deleted-31
......@@ -1,31 +0,0 @@
1/* Types for registers for sys/procfs.h. RISC-V version.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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 <sys/ucontext.h>
24
25/* ELF register definitions */
26#define ELF_NGREG NGREG
27#define ELF_NFPREG NFPREG
28
29typedef unsigned long int elf_greg_t;
30typedef unsigned long int elf_gregset_t[32];
31typedef union __riscv_mc_fp_state elf_fpregset_t;
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/pthreadtypes-arch.h deleted-45
......@@ -1,45 +0,0 @@
1/* Machine-specific pthread type layouts. RISC-V version.
2 Copyright (C) 2011-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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#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
35#else
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
40#endif
41
42#define __LOCK_ALIGNMENT
43#define __ONCE_ALIGNMENT
44
45#endif /* bits/pthreadtypes.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/rseq.h deleted-29
......@@ -1,29 +0,0 @@
1/* Restartable Sequences architecture header. Stub version.
2 Copyright (C) 2021-2024 Free Software Foundation, Inc.
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_RSEQ_H
19# error "Never use <bits/rseq.h> directly; include <sys/rseq.h> instead."
20#endif
21
22/* RSEQ_SIG is a signature required before each abort handler code.
23
24 It is a 32-bit value that maps to actual architecture code compiled
25 into applications and libraries. It needs to be defined for each
26 architecture. When choosing this value, it needs to be taken into
27 account that generating invalid instructions may have ill effects on
28 tools like objdump, and may also have impact on the CPU speculative
29 execution efficiency in some cases. */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/setjmp.h deleted-39
......@@ -1,39 +0,0 @@
1/* Define the machine-dependent type `jmp_buf'. RISC-V version.
2 Copyright (C) 2011-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _RISCV_BITS_SETJMP_H
20#define _RISCV_BITS_SETJMP_H
21
22typedef struct __jmp_buf_internal_tag
23 {
24 /* Program counter. */
25 long int __pc;
26 /* Callee-saved registers. */
27 long int __regs[12];
28 /* Stack pointer. */
29 long int __sp;
30
31 /* Callee-saved floating point registers. */
32#if defined __riscv_float_abi_double
33 double __fpregs[12];
34#elif !defined __riscv_float_abi_soft
35# error unsupported FLEN
36#endif
37 } __jmp_buf[1];
38
39#endif /* _RISCV_BITS_SETJMP_H */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/sigcontext.h deleted-31
......@@ -1,31 +0,0 @@
1/* Machine-dependent signal context structure for Linux. RISC-V version.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc. 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 _BITS_SIGCONTEXT_H
19#define _BITS_SIGCONTEXT_H 1
20
21#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
22# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
23#endif
24
25struct sigcontext {
26 /* gregs[0] holds the program counter. */
27 unsigned long int gregs[32];
28 unsigned long long int fpregs[66] __attribute__ ((__aligned__ (16)));
29};
30
31#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/struct_rwlock.h deleted-68
......@@ -1,68 +0,0 @@
1/* RISC-V internal rwlock struct definitions.
2 Copyright (C) 2019-2024 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 <https://www.gnu.org/licenses/>. */
19
20#ifndef _RWLOCK_INTERNAL_H
21#define _RWLOCK_INTERNAL_H
22
23/* There is a lot of padding in this structure. While it's not strictly
24 necessary on RISC-V, we're going to leave it in to be on the safe side in
25 case it's needed in the future. Most other architectures have the padding,
26 so this gives us the same extensibility as everyone else has. */
27struct __pthread_rwlock_arch_t
28{
29 unsigned int __readers;
30 unsigned int __writers;
31 unsigned int __wrphase_futex;
32 unsigned int __writers_futex;
33 unsigned int __pad3;
34 unsigned int __pad4;
35#if __WORDSIZE == 64
36 int __cur_writer;
37 int __shared;
38 unsigned long int __pad1;
39 unsigned long int __pad2;
40 unsigned int __flags;
41#else
42# if __BYTE_ORDER == __BIG_ENDIAN
43 unsigned char __pad1;
44 unsigned char __pad2;
45 unsigned char __shared;
46 unsigned char __flags;
47# else
48 unsigned char __flags;
49 unsigned char __shared;
50 unsigned char __pad1;
51 unsigned char __pad2;
52# endif
53 int __cur_writer;
54#endif
55};
56
57#if __WORDSIZE == 64
58# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \
59 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags
60#elif __BYTE_ORDER == __BIG_ENDIAN
61# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \
62 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0
63#else
64# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \
65 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0
66#endif
67
68#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/struct_stat.h deleted-127
......@@ -1,127 +0,0 @@
1/* Definition for struct stat.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of 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/endian.h>
27#include <bits/wordsize.h>
28
29#if defined __USE_FILE_OFFSET64
30# define __field64(type, type64, name) type64 name
31#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
32# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
33# error "ino_t and off_t must both be the same type"
34# endif
35# define __field64(type, type64, name) type name
36#elif __BYTE_ORDER == __LITTLE_ENDIAN
37# define __field64(type, type64, name) \
38 type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
39#else
40# define __field64(type, type64, name) \
41 int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
42#endif
43
44struct stat
45 {
46 __dev_t st_dev; /* Device. */
47 __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */
48 __mode_t st_mode; /* File mode. */
49 __nlink_t st_nlink; /* Link count. */
50 __uid_t st_uid; /* User ID of the file's owner. */
51 __gid_t st_gid; /* Group ID of the file's group.*/
52 __dev_t st_rdev; /* Device number, if device. */
53 __dev_t __pad1;
54 __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */
55 __blksize_t st_blksize; /* Optimal block size for I/O. */
56 int __pad2;
57 __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */
58#ifdef __USE_XOPEN2K8
59 /* Nanosecond resolution timestamps are stored in a format
60 equivalent to 'struct timespec'. This is the type used
61 whenever possible but the Unix namespace rules do not allow the
62 identifier 'timespec' to appear in the <sys/stat.h> header.
63 Therefore we have to handle the use of this header in strictly
64 standard-compliant sources special. */
65 struct timespec st_atim; /* Time of last access. */
66 struct timespec st_mtim; /* Time of last modification. */
67 struct timespec st_ctim; /* Time of last status change. */
68# define st_atime st_atim.tv_sec /* Backward compatibility. */
69# define st_mtime st_mtim.tv_sec
70# define st_ctime st_ctim.tv_sec
71#else
72 __time_t st_atime; /* Time of last access. */
73 unsigned long int st_atimensec; /* Nscecs of last access. */
74 __time_t st_mtime; /* Time of last modification. */
75 unsigned long int st_mtimensec; /* Nsecs of last modification. */
76 __time_t st_ctime; /* Time of last status change. */
77 unsigned long int st_ctimensec; /* Nsecs of last status change. */
78#endif
79 int __glibc_reserved[2];
80 };
81
82#undef __field64
83
84#ifdef __USE_LARGEFILE64
85struct stat64
86 {
87 __dev_t st_dev; /* Device. */
88 __ino64_t st_ino; /* File serial number. */
89 __mode_t st_mode; /* File mode. */
90 __nlink_t st_nlink; /* Link count. */
91 __uid_t st_uid; /* User ID of the file's owner. */
92 __gid_t st_gid; /* Group ID of the file's group.*/
93 __dev_t st_rdev; /* Device number, if device. */
94 __dev_t __pad1;
95 __off64_t st_size; /* Size of file, in bytes. */
96 __blksize_t st_blksize; /* Optimal block size for I/O. */
97 int __pad2;
98 __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
99#ifdef __USE_XOPEN2K8
100 /* Nanosecond resolution timestamps are stored in a format
101 equivalent to 'struct timespec'. This is the type used
102 whenever possible but the Unix namespace rules do not allow the
103 identifier 'timespec' to appear in the <sys/stat.h> header.
104 Therefore we have to handle the use of this header in strictly
105 standard-compliant sources special. */
106 struct timespec st_atim; /* Time of last access. */
107 struct timespec st_mtim; /* Time of last modification. */
108 struct timespec st_ctim; /* Time of last status change. */
109#else
110 __time_t st_atime; /* Time of last access. */
111 unsigned long int st_atimensec; /* Nscecs of last access. */
112 __time_t st_mtime; /* Time of last modification. */
113 unsigned long int st_mtimensec; /* Nsecs of last modification. */
114 __time_t st_ctime; /* Time of last status change. */
115 unsigned long int st_ctimensec; /* Nsecs of last status change. */
116#endif
117 int __glibc_reserved[2];
118 };
119#endif
120
121/* Tell code we have these members. */
122#define _STATBUF_ST_BLKSIZE
123#define _STATBUF_ST_RDEV
124/* Nanosecond resolution time values are supported. */
125#define _STATBUF_ST_NSEC
126
127#endif /* _BITS_STRUCT_STAT_H */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/time64.h deleted-36
......@@ -1,36 +0,0 @@
1/* bits/time64.h -- underlying types for __time64_t. RISC-V version.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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/time64.h> directly; use <sys/types.h> instead."
21#endif
22
23#ifndef _BITS_TIME64_H
24#define _BITS_TIME64_H 1
25
26/* Define __TIME64_T_TYPE so that it is always a 64-bit type. */
27
28#if __WORDSIZE == 64
29/* If we already have 64-bit time type then use it. */
30# define __TIME64_T_TYPE __TIME_T_TYPE
31#else
32/* Define a 64-bit time type alongsize the 32-bit one. */
33# define __TIME64_T_TYPE __SQUAD_TYPE
34#endif
35
36#endif /* bits/time64.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/timesize.h deleted-20
......@@ -1,20 +0,0 @@
1/* Bit size of the time_t type at glibc build time, general case.
2 Copyright (C) 2018-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19/* Size in bits of the 'time_t' type of the default ABI. */
20#define __TIMESIZE 64
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/typesizes.h deleted-107
......@@ -1,107 +0,0 @@
1/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI.
2 Copyright (C) 2011-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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#if __TIMESIZE == 64 && __WORDSIZE == 32
29/* These are the "new" y2038 types defined for architectures added after
30 the 5.1 kernel. */
31# define __INO_T_TYPE __UQUAD_TYPE
32# define __OFF_T_TYPE __SQUAD_TYPE
33# define __RLIM_T_TYPE __UQUAD_TYPE
34# define __BLKCNT_T_TYPE __SQUAD_TYPE
35# define __FSBLKCNT_T_TYPE __UQUAD_TYPE
36# define __FSFILCNT_T_TYPE __UQUAD_TYPE
37# define __TIME_T_TYPE __SQUAD_TYPE
38# define __SUSECONDS_T_TYPE __SQUAD_TYPE
39#else
40# define __INO_T_TYPE __ULONGWORD_TYPE
41# define __OFF_T_TYPE __SLONGWORD_TYPE
42# define __RLIM_T_TYPE __ULONGWORD_TYPE
43# define __BLKCNT_T_TYPE __SLONGWORD_TYPE
44# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
45# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
46# define __TIME_T_TYPE __SLONGWORD_TYPE
47# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
48#endif
49
50#define __DEV_T_TYPE __UQUAD_TYPE
51#define __UID_T_TYPE __U32_TYPE
52#define __GID_T_TYPE __U32_TYPE
53#define __INO64_T_TYPE __UQUAD_TYPE
54#define __MODE_T_TYPE __U32_TYPE
55#define __NLINK_T_TYPE __U32_TYPE
56#define __OFF64_T_TYPE __SQUAD_TYPE
57#define __PID_T_TYPE __S32_TYPE
58#define __RLIM64_T_TYPE __UQUAD_TYPE
59#define __BLKCNT64_T_TYPE __SQUAD_TYPE
60#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
61#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
62#define __FSWORD_T_TYPE __SWORD_TYPE
63#define __ID_T_TYPE __U32_TYPE
64#define __CLOCK_T_TYPE __SLONGWORD_TYPE
65#define __USECONDS_T_TYPE __U32_TYPE
66#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
67#define __DADDR_T_TYPE __S32_TYPE
68#define __KEY_T_TYPE __S32_TYPE
69#define __CLOCKID_T_TYPE __S32_TYPE
70#define __TIMER_T_TYPE void *
71#define __BLKSIZE_T_TYPE __S32_TYPE
72#define __FSID_T_TYPE struct { int __val[2]; }
73#define __SSIZE_T_TYPE __SWORD_TYPE
74#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
75#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
76#define __CPU_MASK_TYPE __ULONGWORD_TYPE
77
78#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32)
79/* Tell the libc code that off_t and off64_t are actually the same type
80 for all ABI purposes, even if possibly expressed as different base types
81 for C type-checking purposes. */
82# define __OFF_T_MATCHES_OFF64_T 1
83
84/* Same for ino_t and ino64_t. */
85# define __INO_T_MATCHES_INO64_T 1
86
87/* And for __rlim_t and __rlim64_t. */
88# define __RLIM_T_MATCHES_RLIM64_T 1
89
90/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
91# define __STATFS_MATCHES_STATFS64 1
92
93/* And for getitimer, setitimer and rusage */
94# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64)
95#else
96# define __RLIM_T_MATCHES_RLIM64_T 0
97
98# define __STATFS_MATCHES_STATFS64 0
99
100# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
101#endif
102
103/* Number of descriptors that can fit in an `fd_set'. */
104#define __FD_SETSIZE 1024
105
106
107#endif /* bits/typesizes.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/bits/wordsize.h deleted-30
......@@ -1,30 +0,0 @@
1/* Determine the wordsize from the preprocessor defines. RISC-V version.
2 Copyright (C) 2002-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of 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 __riscv_xlen == (__SIZEOF_POINTER__ * 8)
20# define __WORDSIZE __riscv_xlen
21#else
22# error unsupported ABI
23#endif
24
25#define __WORDSIZE_TIME64_COMPAT32 1
26
27#if __WORDSIZE == 32
28# define __WORDSIZE32_SIZE_ULONG 0
29# define __WORDSIZE32_PTRDIFF_LONG 0
30#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/fpu_control.h deleted-74
......@@ -1,74 +0,0 @@
1/* FPU control word bits. RISC-V version.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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#include <features.h>
23
24#ifndef __riscv_flen
25
26# define _FPU_RESERVED 0xffffffff
27# define _FPU_DEFAULT 0x00000000
28typedef unsigned int fpu_control_t;
29# define _FPU_GETCW(cw) (cw) = 0
30# define _FPU_SETCW(cw) do { } while (0)
31extern fpu_control_t __fpu_control;
32
33#else /* __riscv_flen */
34
35# define _FPU_RESERVED 0
36# define _FPU_DEFAULT 0
37# define _FPU_IEEE _FPU_DEFAULT
38
39/* Type of the control word. */
40typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
41
42/* Macros for accessing the hardware control word. */
43# define _FPU_GETCW(cw) __asm__ volatile ("frsr %0" : "=r" (cw))
44# define _FPU_SETCW(cw) __asm__ volatile ("fssr %z0" : : "rJ" (cw))
45
46/* Default control word set at startup. */
47extern fpu_control_t __fpu_control;
48
49# define _FCLASS(x) (__extension__ ({ int __res; \
50 if (sizeof (x) * 8 > __riscv_flen) __builtin_trap (); \
51 if (sizeof (x) == 4) asm ("fclass.s %0, %1" : "=r" (__res) : "f" (x)); \
52 else if (sizeof (x) == 8) asm ("fclass.d %0, %1" : "=r" (__res) : "f" (x)); \
53 else __builtin_trap (); \
54 __res; }))
55
56# define _FCLASS_MINF (1 << 0)
57# define _FCLASS_MNORM (1 << 1)
58# define _FCLASS_MSUBNORM (1 << 2)
59# define _FCLASS_MZERO (1 << 3)
60# define _FCLASS_PZERO (1 << 4)
61# define _FCLASS_PSUBNORM (1 << 5)
62# define _FCLASS_PNORM (1 << 6)
63# define _FCLASS_PINF (1 << 7)
64# define _FCLASS_SNAN (1 << 8)
65# define _FCLASS_QNAN (1 << 9)
66# define _FCLASS_ZERO (_FCLASS_MZERO | _FCLASS_PZERO)
67# define _FCLASS_SUBNORM (_FCLASS_MSUBNORM | _FCLASS_PSUBNORM)
68# define _FCLASS_NORM (_FCLASS_MNORM | _FCLASS_PNORM)
69# define _FCLASS_INF (_FCLASS_MINF | _FCLASS_PINF)
70# define _FCLASS_NAN (_FCLASS_SNAN | _FCLASS_QNAN)
71
72#endif /* __riscv_flen */
73
74#endif /* fpu_control.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/gnu/lib-names-ilp32.h deleted-27
......@@ -1,27 +0,0 @@
1/* This file is automatically generated. */
2#ifndef __GNU_LIB_NAMES_H
3# error "Never use <gnu/lib-names-ilp32.h> directly; include <gnu/lib-names.h> instead."
4#endif
5
6#define LD_LINUX_RISCV32_ILP32_SO "ld-linux-riscv32-ilp32.so.1"
7#define LD_SO "ld-linux-riscv32-ilp32.so.1"
8#define LIBANL_SO "libanl.so.1"
9#define LIBBROKENLOCALE_SO "libBrokenLocale.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 LIBPTHREAD_SO "libpthread.so.0"
24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/gnu/lib-names.h deleted-22
......@@ -1,22 +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 && defined __riscv_float_abi_soft
10# include <gnu/lib-names-ilp32.h>
11#endif
12#if __WORDSIZE == 32 && defined __riscv_float_abi_double
13# include <gnu/lib-names-ilp32d.h>
14#endif
15#if __WORDSIZE == 64 && defined __riscv_float_abi_soft
16# include <gnu/lib-names-lp64.h>
17#endif
18#if __WORDSIZE == 64 && defined __riscv_float_abi_double
19# include <gnu/lib-names-lp64d.h>
20#endif
21
22#endif /* gnu/lib-names.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/gnu/stubs-ilp32.h deleted-38
......@@ -1,38 +0,0 @@
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
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/gnu/stubs.h deleted-18
......@@ -1,18 +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 && defined __riscv_float_abi_soft
8# include <gnu/stubs-ilp32.h>
9#endif
10#if __WORDSIZE == 32 && defined __riscv_float_abi_double
11# include <gnu/stubs-ilp32d.h>
12#endif
13#if __WORDSIZE == 64 && defined __riscv_float_abi_soft
14# include <gnu/stubs-lp64.h>
15#endif
16#if __WORDSIZE == 64 && defined __riscv_float_abi_double
17# include <gnu/stubs-lp64d.h>
18#endif
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/ieee754.h deleted-170
......@@ -1,170 +0,0 @@
1/* Copyright (C) 1992-2024 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__BEGIN_DECLS
26
27union ieee754_float
28 {
29 float f;
30
31 /* This is the IEEE 754 single-precision format. */
32 struct
33 {
34#if __BYTE_ORDER == __BIG_ENDIAN
35 unsigned int negative:1;
36 unsigned int exponent:8;
37 unsigned int mantissa:23;
38#endif /* Big endian. */
39#if __BYTE_ORDER == __LITTLE_ENDIAN
40 unsigned int mantissa:23;
41 unsigned int exponent:8;
42 unsigned int negative:1;
43#endif /* Little endian. */
44 } ieee;
45
46 /* This format makes it easier to see if a NaN is a signalling NaN. */
47 struct
48 {
49#if __BYTE_ORDER == __BIG_ENDIAN
50 unsigned int negative:1;
51 unsigned int exponent:8;
52 unsigned int quiet_nan:1;
53 unsigned int mantissa:22;
54#endif /* Big endian. */
55#if __BYTE_ORDER == __LITTLE_ENDIAN
56 unsigned int mantissa:22;
57 unsigned int quiet_nan:1;
58 unsigned int exponent:8;
59 unsigned int negative:1;
60#endif /* Little endian. */
61 } ieee_nan;
62 };
63
64#define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */
65
66
67union ieee754_double
68 {
69 double d;
70
71 /* This is the IEEE 754 double-precision format. */
72 struct
73 {
74#if __BYTE_ORDER == __BIG_ENDIAN
75 unsigned int negative:1;
76 unsigned int exponent:11;
77 /* Together these comprise the mantissa. */
78 unsigned int mantissa0:20;
79 unsigned int mantissa1:32;
80#endif /* Big endian. */
81#if __BYTE_ORDER == __LITTLE_ENDIAN
82 /* Together these comprise the mantissa. */
83 unsigned int mantissa1:32;
84 unsigned int mantissa0:20;
85 unsigned int exponent:11;
86 unsigned int negative:1;
87#endif /* Little endian. */
88 } ieee;
89
90 /* This format makes it easier to see if a NaN is a signalling NaN. */
91 struct
92 {
93#if __BYTE_ORDER == __BIG_ENDIAN
94 unsigned int negative:1;
95 unsigned int exponent:11;
96 unsigned int quiet_nan:1;
97 /* Together these comprise the mantissa. */
98 unsigned int mantissa0:19;
99 unsigned int mantissa1:32;
100#else
101 /* Together these comprise the mantissa. */
102 unsigned int mantissa1:32;
103 unsigned int mantissa0:19;
104 unsigned int quiet_nan:1;
105 unsigned int exponent:11;
106 unsigned int negative:1;
107#endif
108 } ieee_nan;
109 };
110
111#define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */
112
113
114union ieee854_long_double
115 {
116 long double d;
117
118 /* This is the IEEE 854 quad-precision format. */
119 struct
120 {
121#if __BYTE_ORDER == __BIG_ENDIAN
122 unsigned int negative:1;
123 unsigned int exponent:15;
124 /* Together these comprise the mantissa. */
125 unsigned int mantissa0:16;
126 unsigned int mantissa1:32;
127 unsigned int mantissa2:32;
128 unsigned int mantissa3:32;
129#endif /* Big endian. */
130#if __BYTE_ORDER == __LITTLE_ENDIAN
131 /* Together these comprise the mantissa. */
132 unsigned int mantissa3:32;
133 unsigned int mantissa2:32;
134 unsigned int mantissa1:32;
135 unsigned int mantissa0:16;
136 unsigned int exponent:15;
137 unsigned int negative:1;
138#endif /* Little endian. */
139 } ieee;
140
141 /* This format makes it easier to see if a NaN is a signalling NaN. */
142 struct
143 {
144#if __BYTE_ORDER == __BIG_ENDIAN
145 unsigned int negative:1;
146 unsigned int exponent:15;
147 unsigned int quiet_nan:1;
148 /* Together these comprise the mantissa. */
149 unsigned int mantissa0:15;
150 unsigned int mantissa1:32;
151 unsigned int mantissa2:32;
152 unsigned int mantissa3:32;
153#else
154 /* Together these comprise the mantissa. */
155 unsigned int mantissa3:32;
156 unsigned int mantissa2:32;
157 unsigned int mantissa1:32;
158 unsigned int mantissa0:15;
159 unsigned int quiet_nan:1;
160 unsigned int exponent:15;
161 unsigned int negative:1;
162#endif
163 } ieee_nan;
164 };
165
166#define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */
167
168__END_DECLS
169
170#endif /* ieee754.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/sys/asm.h deleted-66
......@@ -1,66 +0,0 @@
1/* Miscellaneous macros.
2 Copyright (C) 2000-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the 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_ASM_H
20#define _SYS_ASM_H
21
22/* Macros to handle different pointer/register sizes for 32/64-bit code. */
23#if __riscv_xlen == 64
24# define PTRLOG 3
25# define SZREG 8
26# define REG_S sd
27# define REG_L ld
28#elif __riscv_xlen == 32
29# define PTRLOG 2
30# define SZREG 4
31# define REG_S sw
32# define REG_L lw
33#else
34# error __riscv_xlen must equal 32 or 64
35#endif
36
37#if !defined __riscv_float_abi_soft
38/* For ABI uniformity, reserve 8 bytes for floats, even if double-precision
39 floating-point is not supported in hardware. */
40# if defined __riscv_float_abi_double
41# define FREG_L fld
42# define FREG_S fsd
43# define SZFREG 8
44# else
45# error unsupported FLEN
46# endif
47#endif
48
49/* Declare leaf routine. */
50#define LEAF(symbol) \
51 .globl symbol; \
52 .align 2; \
53 .type symbol,@function; \
54symbol: \
55 cfi_startproc;
56
57/* Mark end of function. */
58#undef END
59#define END(function) \
60 cfi_endproc; \
61 .size function,.-function
62
63/* Stack alignment. */
64#define ALMASK ~15
65
66#endif /* sys/asm.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/sys/cachectl.h deleted-32
......@@ -1,32 +0,0 @@
1/* RISC-V instruction cache flushing interface
2 Copyright (C) 2017-2024 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 <https://www.gnu.org/licenses/>. */
19
20#ifndef _SYS_CACHECTL_H
21#define _SYS_CACHECTL_H 1
22
23#include <features.h>
24
25__BEGIN_DECLS
26
27extern int __riscv_flush_icache (void *__start, void *__end,
28 unsigned long int __flags);
29
30__END_DECLS
31
32#endif /* sys/cachectl.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/sys/ucontext.h deleted-110
......@@ -1,110 +0,0 @@
1/* struct ucontext definition, RISC-V version.
2 Copyright (C) 1997-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19/* Don't rely on this, the interface is currently messed up and may need to
20 be broken to be fixed. */
21#ifndef _SYS_UCONTEXT_H
22#define _SYS_UCONTEXT_H 1
23
24#include <features.h>
25
26#include <bits/types/sigset_t.h>
27#include <bits/types/stack_t.h>
28
29typedef unsigned long int __riscv_mc_gp_state[32];
30
31#ifdef __USE_MISC
32# define NGREG 32
33
34# define REG_PC 0
35# define REG_RA 1
36# define REG_SP 2
37# define REG_TP 4
38# define REG_S0 8
39# define REG_S1 9
40# define REG_A0 10
41# define REG_S2 18
42# define REG_NARGS 8
43
44typedef unsigned long int greg_t;
45
46/* Container for all general registers. */
47typedef __riscv_mc_gp_state gregset_t;
48
49/* Container for floating-point state. */
50typedef union __riscv_mc_fp_state fpregset_t;
51#endif
52
53struct __riscv_mc_f_ext_state
54 {
55 unsigned int __f[32];
56 unsigned int __fcsr;
57 };
58
59struct __riscv_mc_d_ext_state
60 {
61 unsigned long long int __f[32];
62 unsigned int __fcsr;
63 };
64
65struct __riscv_mc_q_ext_state
66 {
67 unsigned long long int __f[64] __attribute__ ((__aligned__ (16)));
68 unsigned int __fcsr;
69 /* Reserved for expansion of sigcontext structure. Currently zeroed
70 upon signal, and must be zero upon sigreturn. */
71 unsigned int __glibc_reserved[3];
72 };
73
74union __riscv_mc_fp_state
75 {
76 struct __riscv_mc_f_ext_state __f;
77 struct __riscv_mc_d_ext_state __d;
78 struct __riscv_mc_q_ext_state __q;
79 };
80
81typedef struct mcontext_t
82 {
83 __riscv_mc_gp_state __gregs;
84 union __riscv_mc_fp_state __fpregs;
85 } mcontext_t;
86
87/* Userlevel context. */
88typedef struct ucontext_t
89 {
90 unsigned long int __uc_flags;
91 struct ucontext_t *uc_link;
92 stack_t uc_stack;
93 sigset_t uc_sigmask;
94 /* There's some padding here to allow sigset_t to be expanded in the
95 future. Though this is unlikely, other architectures put uc_sigmask
96 at the end of this structure and explicitly state it can be
97 expanded, so we didn't want to box ourselves in here. */
98 char __glibc_reserved[1024 / 8 - sizeof (sigset_t)];
99 /* We can't put uc_sigmask at the end of this structure because we need
100 to be able to expand sigcontext in the future. For example, the
101 vector ISA extension will almost certainly add ISA state. We want
102 to ensure all user-visible ISA state can be saved and restored via a
103 ucontext, so we're putting this at the end in order to allow for
104 infinite extensibility. Since we know this will be extended and we
105 assume sigset_t won't be extended an extreme amount, we're
106 prioritizing this. */
107 mcontext_t uc_mcontext;
108 } ucontext_t;
109
110#endif /* sys/ucontext.h */
\ No newline at end of file
lib/libc/include/riscv32-linux-gnuilp32/sys/user.h deleted-23
......@@ -1,23 +0,0 @@
1/* Copyright (C) 2001-2024 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#define _SYS_USER_H 1
20
21
22
23#endif /* _SYS_USER_H */
\ No newline at end of file
lib/std/zig/target.zig+1-1
......@@ -56,7 +56,7 @@ pub const available_libcs = [_]ArchOsAbi{
5656 .{ .arch = .powerpc, .os = .linux, .abi = .gnueabi },
5757 .{ .arch = .powerpc, .os = .linux, .abi = .gnueabihf },
5858 .{ .arch = .powerpc, .os = .linux, .abi = .musl },
59 .{ .arch = .riscv32, .os = .linux, .abi = .gnuilp32, .glibc_min = .{ .major = 2, .minor = 33, .patch = 0 } },
59 .{ .arch = .riscv32, .os = .linux, .abi = .gnu, .glibc_min = .{ .major = 2, .minor = 33, .patch = 0 } },
6060 .{ .arch = .riscv32, .os = .linux, .abi = .musl },
6161 .{ .arch = .riscv64, .os = .linux, .abi = .gnu, .glibc_min = .{ .major = 2, .minor = 27, .patch = 0 } },
6262 .{ .arch = .riscv64, .os = .linux, .abi = .musl },
src/target.zig-1
......@@ -369,7 +369,6 @@ pub fn addrSpaceCastIsValid(
369369
370370pub fn llvmMachineAbi(target: std.Target) ?[:0]const u8 {
371371 const have_float = switch (target.abi) {
372 .gnuilp32 => return "ilp32",
373372 .gnueabihf, .musleabihf, .eabihf => true,
374373 else => false,
375374 };
tools/process_headers.zig+1-1
......@@ -162,7 +162,7 @@ const glibc_targets = [_]LibCTarget{
162162 LibCTarget{
163163 .name = "riscv32-linux-gnu-rv32imac-ilp32",
164164 .arch = MultiArch{ .specific = Arch.riscv32 },
165 .abi = MultiAbi{ .specific = Abi.gnuilp32 },
165 .abi = MultiAbi{ .specific = Abi.gnu },
166166 },
167167 LibCTarget{
168168 .name = "riscv64-linux-gnu-rv64imac-lp64",