diff --git a/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h b/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h index cf38b9d8b7..9f3cadf056 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h @@ -53,4 +53,23 @@ #define HWCAP_SSBS (1 << 28) #define HWCAP_SB (1 << 29) #define HWCAP_PACA (1 << 30) -#define HWCAP_PACG (1UL << 31) \ No newline at end of file +#define HWCAP_PACG (1UL << 31) + +#define HWCAP2_DCPODP (1 << 0) +#define HWCAP2_SVE2 (1 << 1) +#define HWCAP2_SVEAES (1 << 2) +#define HWCAP2_SVEPMULL (1 << 3) +#define HWCAP2_SVEBITPERM (1 << 4) +#define HWCAP2_SVESHA3 (1 << 5) +#define HWCAP2_SVESM4 (1 << 6) +#define HWCAP2_FLAGM2 (1 << 7) +#define HWCAP2_FRINT (1 << 8) +#define HWCAP2_SVEI8MM (1 << 9) +#define HWCAP2_SVEF32MM (1 << 10) +#define HWCAP2_SVEF64MM (1 << 11) +#define HWCAP2_SVEBF16 (1 << 12) +#define HWCAP2_I8MM (1 << 13) +#define HWCAP2_BF16 (1 << 14) +#define HWCAP2_DGH (1 << 15) +#define HWCAP2_RNG (1 << 16) +#define HWCAP2_BTI (1 << 17) \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-gnu/bits/long-double.h b/lib/libc/include/aarch64-linux-gnu/bits/long-double.h index ce06962796..f95b24f8e7 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/long-double.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-gnu/bits/typesizes.h b/lib/libc/include/aarch64-linux-gnu/bits/typesizes.h index d9e9b274ac..a5f4c78b94 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/typesizes.h @@ -26,31 +26,45 @@ /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ +#if __TIMESIZE == 64 && __WORDSIZE == 32 +/* These are the "new" y2038 types defined for architectures added after + the 5.1 kernel. */ +# define __INO_T_TYPE __UQUAD_TYPE +# define __OFF_T_TYPE __SQUAD_TYPE +# define __RLIM_T_TYPE __UQUAD_TYPE +# define __BLKCNT_T_TYPE __SQUAD_TYPE +# define __FSBLKCNT_T_TYPE __UQUAD_TYPE +# define __FSFILCNT_T_TYPE __UQUAD_TYPE +# define __TIME_T_TYPE __SQUAD_TYPE +# define __SUSECONDS_T_TYPE __SQUAD_TYPE +#else +# define __INO_T_TYPE __ULONGWORD_TYPE +# define __OFF_T_TYPE __SLONGWORD_TYPE +# define __RLIM_T_TYPE __ULONGWORD_TYPE +# define __BLKCNT_T_TYPE __SLONGWORD_TYPE +# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +# define __TIME_T_TYPE __SLONGWORD_TYPE +# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#endif #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE -#define __INO_T_TYPE __ULONGWORD_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #define __NLINK_T_TYPE __U32_TYPE -#define __OFF_T_TYPE __SLONGWORD_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE -#define __RLIM_T_TYPE __ULONGWORD_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT_T_TYPE __SLONGWORD_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE -#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __FSWORD_T_TYPE __SWORD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SLONGWORD_TYPE -#define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -62,7 +76,7 @@ #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #define __CPU_MASK_TYPE __ULONGWORD_TYPE -#ifdef __LP64__ +#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ @@ -76,11 +90,17 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64) #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif + /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 diff --git a/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h b/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h index f1923e9517..d25085e24f 100644 --- a/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h +++ b/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/aarch64-linux-gnu/gnu/stubs-lp64.h b/lib/libc/include/aarch64-linux-gnu/gnu/stubs-lp64.h index 342cde4c98..4c2911dd6d 100644 --- a/lib/libc/include/aarch64-linux-gnu/gnu/stubs-lp64.h +++ b/lib/libc/include/aarch64-linux-gnu/gnu/stubs-lp64.h @@ -15,10 +15,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk -#define __stub_stty -#define __stub_sysctl \ No newline at end of file +#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/aarch64_be-linux-gnu/bits/hwcap.h b/lib/libc/include/aarch64_be-linux-gnu/bits/hwcap.h index cf38b9d8b7..9f3cadf056 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/aarch64_be-linux-gnu/bits/hwcap.h @@ -53,4 +53,23 @@ #define HWCAP_SSBS (1 << 28) #define HWCAP_SB (1 << 29) #define HWCAP_PACA (1 << 30) -#define HWCAP_PACG (1UL << 31) \ No newline at end of file +#define HWCAP_PACG (1UL << 31) + +#define HWCAP2_DCPODP (1 << 0) +#define HWCAP2_SVE2 (1 << 1) +#define HWCAP2_SVEAES (1 << 2) +#define HWCAP2_SVEPMULL (1 << 3) +#define HWCAP2_SVEBITPERM (1 << 4) +#define HWCAP2_SVESHA3 (1 << 5) +#define HWCAP2_SVESM4 (1 << 6) +#define HWCAP2_FLAGM2 (1 << 7) +#define HWCAP2_FRINT (1 << 8) +#define HWCAP2_SVEI8MM (1 << 9) +#define HWCAP2_SVEF32MM (1 << 10) +#define HWCAP2_SVEF64MM (1 << 11) +#define HWCAP2_SVEBF16 (1 << 12) +#define HWCAP2_I8MM (1 << 13) +#define HWCAP2_BF16 (1 << 14) +#define HWCAP2_DGH (1 << 15) +#define HWCAP2_RNG (1 << 16) +#define HWCAP2_BTI (1 << 17) \ No newline at end of file diff --git a/lib/libc/include/aarch64_be-linux-gnu/bits/long-double.h b/lib/libc/include/aarch64_be-linux-gnu/bits/long-double.h index ce06962796..f95b24f8e7 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/bits/long-double.h +++ b/lib/libc/include/aarch64_be-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h b/lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h index d9e9b274ac..a5f4c78b94 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h @@ -26,31 +26,45 @@ /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ +#if __TIMESIZE == 64 && __WORDSIZE == 32 +/* These are the "new" y2038 types defined for architectures added after + the 5.1 kernel. */ +# define __INO_T_TYPE __UQUAD_TYPE +# define __OFF_T_TYPE __SQUAD_TYPE +# define __RLIM_T_TYPE __UQUAD_TYPE +# define __BLKCNT_T_TYPE __SQUAD_TYPE +# define __FSBLKCNT_T_TYPE __UQUAD_TYPE +# define __FSFILCNT_T_TYPE __UQUAD_TYPE +# define __TIME_T_TYPE __SQUAD_TYPE +# define __SUSECONDS_T_TYPE __SQUAD_TYPE +#else +# define __INO_T_TYPE __ULONGWORD_TYPE +# define __OFF_T_TYPE __SLONGWORD_TYPE +# define __RLIM_T_TYPE __ULONGWORD_TYPE +# define __BLKCNT_T_TYPE __SLONGWORD_TYPE +# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +# define __TIME_T_TYPE __SLONGWORD_TYPE +# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#endif #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE -#define __INO_T_TYPE __ULONGWORD_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #define __NLINK_T_TYPE __U32_TYPE -#define __OFF_T_TYPE __SLONGWORD_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE -#define __RLIM_T_TYPE __ULONGWORD_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT_T_TYPE __SLONGWORD_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE -#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __FSWORD_T_TYPE __SWORD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SLONGWORD_TYPE -#define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -62,7 +76,7 @@ #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #define __CPU_MASK_TYPE __ULONGWORD_TYPE -#ifdef __LP64__ +#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ @@ -76,11 +90,17 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64) #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif + /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 diff --git a/lib/libc/include/aarch64_be-linux-gnu/gnu/lib-names-lp64_be.h b/lib/libc/include/aarch64_be-linux-gnu/gnu/lib-names-lp64_be.h index f5cf894313..fb1dd8a26c 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/gnu/lib-names-lp64_be.h +++ b/lib/libc/include/aarch64_be-linux-gnu/gnu/lib-names-lp64_be.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/aarch64_be-linux-gnu/gnu/stubs-lp64_be.h b/lib/libc/include/aarch64_be-linux-gnu/gnu/stubs-lp64_be.h index 342cde4c98..4c2911dd6d 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/gnu/stubs-lp64_be.h +++ b/lib/libc/include/aarch64_be-linux-gnu/gnu/stubs-lp64_be.h @@ -15,10 +15,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk -#define __stub_stty -#define __stub_sysctl \ No newline at end of file +#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/arm-linux-gnueabi/bits/long-double.h b/lib/libc/include/arm-linux-gnueabi/bits/long-double.h index 13e74241e1..088c7a2a06 100644 --- a/lib/libc/include/arm-linux-gnueabi/bits/long-double.h +++ b/lib/libc/include/arm-linux-gnueabi/bits/long-double.h @@ -37,4 +37,17 @@ #ifndef __NO_LONG_DOUBLE_MATH # define __NO_LONG_DOUBLE_MATH 1 #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file + +/* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the + choice of the underlying ABI of long double. It will always assume + a constant value for each translation unit. + + If the value is non-zero, any API which is parameterized by the long + double type (i.e the scanf/printf family of functions or the explicitly + parameterized math.h functions) will be redirected to a compatible + implementation using _Float128 ABI via symbols suffixed with ieee128. + + The mechanism this macro uses to acquire may be a function + of architecture, or target specific options used to invoke the + compiler. */ +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/arm-linux-gnueabi/bits/semaphore.h b/lib/libc/include/arm-linux-gnueabi/bits/semaphore.h index 3dd94baf34..97292723c8 100644 --- a/lib/libc/include/arm-linux-gnueabi/bits/semaphore.h +++ b/lib/libc/include/arm-linux-gnueabi/bits/semaphore.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,16 +13,20 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif +#include -#define __SIZEOF_SEM_T 16 - +#if __WORDSIZE == 64 +# define __SIZEOF_SEM_T 32 +#else +# define __SIZEOF_SEM_T 16 +#endif /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/arm-linux-gnueabihf/bits/long-double.h b/lib/libc/include/arm-linux-gnueabihf/bits/long-double.h index 13e74241e1..088c7a2a06 100644 --- a/lib/libc/include/arm-linux-gnueabihf/bits/long-double.h +++ b/lib/libc/include/arm-linux-gnueabihf/bits/long-double.h @@ -37,4 +37,17 @@ #ifndef __NO_LONG_DOUBLE_MATH # define __NO_LONG_DOUBLE_MATH 1 #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file + +/* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the + choice of the underlying ABI of long double. It will always assume + a constant value for each translation unit. + + If the value is non-zero, any API which is parameterized by the long + double type (i.e the scanf/printf family of functions or the explicitly + parameterized math.h functions) will be redirected to a compatible + implementation using _Float128 ABI via symbols suffixed with ieee128. + + The mechanism this macro uses to acquire may be a function + of architecture, or target specific options used to invoke the + compiler. */ +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/arm-linux-gnueabihf/bits/semaphore.h b/lib/libc/include/arm-linux-gnueabihf/bits/semaphore.h index 3dd94baf34..97292723c8 100644 --- a/lib/libc/include/arm-linux-gnueabihf/bits/semaphore.h +++ b/lib/libc/include/arm-linux-gnueabihf/bits/semaphore.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,16 +13,20 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif +#include -#define __SIZEOF_SEM_T 16 - +#if __WORDSIZE == 64 +# define __SIZEOF_SEM_T 32 +#else +# define __SIZEOF_SEM_T 16 +#endif /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/armeb-linux-gnueabi/bits/long-double.h b/lib/libc/include/armeb-linux-gnueabi/bits/long-double.h index 13e74241e1..088c7a2a06 100644 --- a/lib/libc/include/armeb-linux-gnueabi/bits/long-double.h +++ b/lib/libc/include/armeb-linux-gnueabi/bits/long-double.h @@ -37,4 +37,17 @@ #ifndef __NO_LONG_DOUBLE_MATH # define __NO_LONG_DOUBLE_MATH 1 #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file + +/* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the + choice of the underlying ABI of long double. It will always assume + a constant value for each translation unit. + + If the value is non-zero, any API which is parameterized by the long + double type (i.e the scanf/printf family of functions or the explicitly + parameterized math.h functions) will be redirected to a compatible + implementation using _Float128 ABI via symbols suffixed with ieee128. + + The mechanism this macro uses to acquire may be a function + of architecture, or target specific options used to invoke the + compiler. */ +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/armeb-linux-gnueabi/bits/semaphore.h b/lib/libc/include/armeb-linux-gnueabi/bits/semaphore.h index 3dd94baf34..97292723c8 100644 --- a/lib/libc/include/armeb-linux-gnueabi/bits/semaphore.h +++ b/lib/libc/include/armeb-linux-gnueabi/bits/semaphore.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,16 +13,20 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif +#include -#define __SIZEOF_SEM_T 16 - +#if __WORDSIZE == 64 +# define __SIZEOF_SEM_T 32 +#else +# define __SIZEOF_SEM_T 16 +#endif /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/armeb-linux-gnueabihf/bits/long-double.h b/lib/libc/include/armeb-linux-gnueabihf/bits/long-double.h index 13e74241e1..088c7a2a06 100644 --- a/lib/libc/include/armeb-linux-gnueabihf/bits/long-double.h +++ b/lib/libc/include/armeb-linux-gnueabihf/bits/long-double.h @@ -37,4 +37,17 @@ #ifndef __NO_LONG_DOUBLE_MATH # define __NO_LONG_DOUBLE_MATH 1 #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file + +/* The macro __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI is used to determine the + choice of the underlying ABI of long double. It will always assume + a constant value for each translation unit. + + If the value is non-zero, any API which is parameterized by the long + double type (i.e the scanf/printf family of functions or the explicitly + parameterized math.h functions) will be redirected to a compatible + implementation using _Float128 ABI via symbols suffixed with ieee128. + + The mechanism this macro uses to acquire may be a function + of architecture, or target specific options used to invoke the + compiler. */ +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/armeb-linux-gnueabihf/bits/semaphore.h b/lib/libc/include/armeb-linux-gnueabihf/bits/semaphore.h index 3dd94baf34..97292723c8 100644 --- a/lib/libc/include/armeb-linux-gnueabihf/bits/semaphore.h +++ b/lib/libc/include/armeb-linux-gnueabihf/bits/semaphore.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,16 +13,20 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif +#include -#define __SIZEOF_SEM_T 16 - +#if __WORDSIZE == 64 +# define __SIZEOF_SEM_T 32 +#else +# define __SIZEOF_SEM_T 16 +#endif /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/generic-glibc/argp.h b/lib/libc/include/generic-glibc/argp.h index 0bb8d732f5..8101648163 100644 --- a/lib/libc/include/generic-glibc/argp.h +++ b/lib/libc/include/generic-glibc/argp.h @@ -554,7 +554,8 @@ __NTH (__option_is_end (const struct argp_option *__opt)) # endif #endif /* Use extern inlines. */ -#ifdef __LDBL_COMPAT +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/generic-glibc/bits/a.out.h b/lib/libc/include/generic-glibc/bits/a.out.h index c075e94124..3c81a52dbb 100644 --- a/lib/libc/include/generic-glibc/bits/a.out.h +++ b/lib/libc/include/generic-glibc/bits/a.out.h @@ -2,6 +2,10 @@ # error "Never use directly; include instead." #endif +#ifdef __x86_64__ + /* Signal to users of this header that this architecture really doesn't support a.out binary format. */ -#define __NO_A_OUT_SUPPORT 1 \ No newline at end of file +#define __NO_A_OUT_SUPPORT 1 + +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/endianness.h b/lib/libc/include/generic-glibc/bits/endianness.h index 5a0a871460..80180b782e 100644 --- a/lib/libc/include/generic-glibc/bits/endianness.h +++ b/lib/libc/include/generic-glibc/bits/endianness.h @@ -5,12 +5,7 @@ # error "Never use directly; include instead." #endif -/* MIPS has selectable endianness. */ -#ifdef __MIPSEB -# define __BYTE_ORDER __BIG_ENDIAN -#endif -#ifdef __MIPSEL -# define __BYTE_ORDER __LITTLE_ENDIAN -#endif +/* i386/x86_64 are little-endian. */ +#define __BYTE_ORDER __LITTLE_ENDIAN #endif /* bits/endianness.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/environments.h b/lib/libc/include/generic-glibc/bits/environments.h index 1b5e74a08e..2b18837e58 100644 --- a/lib/libc/include/generic-glibc/bits/environments.h +++ b/lib/libc/include/generic-glibc/bits/environments.h @@ -41,13 +41,16 @@ #if __WORDSIZE == 64 -/* We can never provide environments with 32-bit wide pointers. */ -# define _POSIX_V7_ILP32_OFF32 -1 -# define _POSIX_V7_ILP32_OFFBIG -1 -# define _POSIX_V6_ILP32_OFF32 -1 -# define _POSIX_V6_ILP32_OFFBIG -1 -# define _XBS5_ILP32_OFF32 -1 -# define _XBS5_ILP32_OFFBIG -1 +/* Environments with 32-bit wide pointers are optionally provided. + Therefore following macros aren't defined: + # undef _POSIX_V7_ILP32_OFF32 + # undef _POSIX_V7_ILP32_OFFBIG + # undef _POSIX_V6_ILP32_OFF32 + # undef _POSIX_V6_ILP32_OFFBIG + # undef _XBS5_ILP32_OFF32 + # undef _XBS5_ILP32_OFFBIG + and users need to check at runtime. */ + /* We also have no use (for now) for an environment with bigger pointers and offsets. */ # define _POSIX_V7_LPBIG_OFFBIG -1 @@ -61,27 +64,42 @@ #else /* __WORDSIZE == 32 */ -/* By default we have 32-bit wide `int', `long int', pointers and `off_t' - and all platforms support LFS. */ -# define _POSIX_V7_ILP32_OFF32 1 +/* We have 32-bit wide `int', `long int' and pointers and all platforms + support LFS. -mx32 has 64-bit wide `off_t'. */ # define _POSIX_V7_ILP32_OFFBIG 1 -# define _POSIX_V6_ILP32_OFF32 1 -# define _POSIX_V6_ILP32_OFFBIG 1 -# define _XBS5_ILP32_OFF32 1 +# define _POSIX_V6_ILP32_OFFBIG 1 # define _XBS5_ILP32_OFFBIG 1 +# ifndef __x86_64__ +/* -m32 has 32-bit wide `off_t'. */ +# define _POSIX_V7_ILP32_OFF32 1 +# define _POSIX_V6_ILP32_OFF32 1 +# define _XBS5_ILP32_OFF32 1 +# endif + /* We optionally provide an environment with the above size but an 64-bit side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ -/* We can never provide environments with 64-bit wide pointers. */ -# define _POSIX_V7_LP64_OFF64 -1 -# define _POSIX_V7_LPBIG_OFFBIG -1 -# define _POSIX_V6_LP64_OFF64 -1 -# define _POSIX_V6_LPBIG_OFFBIG -1 -# define _XBS5_LP64_OFF64 -1 -# define _XBS5_LPBIG_OFFBIG -1 +/* Environments with 64-bit wide pointers can be provided, + so these macros aren't defined: + # undef _POSIX_V7_LP64_OFF64 + # undef _POSIX_V7_LPBIG_OFFBIG + # undef _POSIX_V6_LP64_OFF64 + # undef _POSIX_V6_LPBIG_OFFBIG + # undef _XBS5_LP64_OFF64 + # undef _XBS5_LPBIG_OFFBIG + and sysconf tests for it at runtime. */ -/* CFLAGS. */ -#define __ILP32_OFFBIG_CFLAGS "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +#endif /* __WORDSIZE == 32 */ -#endif /* __WORDSIZE == 32 */ \ No newline at end of file +#define __ILP32_OFF32_CFLAGS "-m32" +#define __ILP32_OFF32_LDFLAGS "-m32" +#if defined __x86_64__ && defined __ILP32__ +# define __ILP32_OFFBIG_CFLAGS "-mx32" +# define __ILP32_OFFBIG_LDFLAGS "-mx32" +#else +# define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +# define __ILP32_OFFBIG_LDFLAGS "-m32" +#endif +#define __LP64_OFF64_CFLAGS "-m64" +#define __LP64_OFF64_LDFLAGS "-m64" \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/epoll.h b/lib/libc/include/generic-glibc/bits/epoll.h index 6d92d7ce11..5f23749272 100644 --- a/lib/libc/include/generic-glibc/bits/epoll.h +++ b/lib/libc/include/generic-glibc/bits/epoll.h @@ -24,4 +24,6 @@ enum { EPOLL_CLOEXEC = 02000000 #define EPOLL_CLOEXEC EPOLL_CLOEXEC - }; \ No newline at end of file + }; + +#define __EPOLL_PACKED __attribute__ ((__packed__)) \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/fcntl-linux.h b/lib/libc/include/generic-glibc/bits/fcntl-linux.h index 4e3813d8c4..14d7e72f01 100644 --- a/lib/libc/include/generic-glibc/bits/fcntl-linux.h +++ b/lib/libc/include/generic-glibc/bits/fcntl-linux.h @@ -290,7 +290,8 @@ struct f_owner_ex #ifdef __USE_GNU /* Hint values for F_{GET,SET}_RW_HINT. */ -# define RWF_WRITE_LIFE_NOT_SET 0 +# define RWH_WRITE_LIFE_NOT_SET 0 +# define RWF_WRITE_LIFE_NOT_SET RWH_WRITE_LIFE_NOT_SET # define RWH_WRITE_LIFE_NONE 1 # define RWH_WRITE_LIFE_SHORT 2 # define RWH_WRITE_LIFE_MEDIUM 3 diff --git a/lib/libc/include/generic-glibc/bits/fcntl.h b/lib/libc/include/generic-glibc/bits/fcntl.h index b9fa29e200..4eb8fa0b6f 100644 --- a/lib/libc/include/generic-glibc/bits/fcntl.h +++ b/lib/libc/include/generic-glibc/bits/fcntl.h @@ -1,5 +1,5 @@ -/* O_*, F_*, FD_* bit values for Linux. - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* O_*, F_*, FD_* bit values for Linux/x86. + Copyright (C) 2001-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,56 +13,24 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ -#ifndef _FCNTL_H +#ifndef _FCNTL_H # error "Never use directly; include instead." #endif -#include - -#define O_APPEND 0x0008 -#define O_SYNC 0x4010 -#define O_NONBLOCK 0x0080 -#define O_CREAT 0x0100 /* not fcntl */ -#define O_TRUNC 0x0200 /* not fcntl */ -#define O_EXCL 0x0400 /* not fcntl */ -#define O_NOCTTY 0x0800 /* not fcntl */ -#define O_ASYNC 0x1000 - -#define __O_DIRECT 0x8000 /* Direct disk access hint. */ -#define __O_DSYNC 0x0010 /* Synchronize data. */ - -#if _MIPS_SIM == _ABI64 -/* Not necessary, files are always with 64bit off_t. */ -# define __O_LARGEFILE 0 -#else -# define __O_LARGEFILE 0x2000 /* Allow large file opens. */ +#ifdef __x86_64__ +# define __O_LARGEFILE 0 #endif -#ifndef __USE_FILE_OFFSET64 -# define F_GETLK 14 /* Get record locking info. */ -# define F_SETLK 6 /* Set record locking info (non-blocking). */ -# define F_SETLKW 7 /* Set record locking info (blocking). */ -#else -# define F_GETLK F_GETLK64 /* Get record locking info. */ -# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ -# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ +#ifdef __x86_64__ +/* Not necessary, we always have 64-bit offsets. */ +# define F_GETLK64 5 /* Get record locking info. */ +# define F_SETLK64 6 /* Set record locking info (non-blocking). */ +# define F_SETLKW64 7 /* Set record locking info (blocking). */ #endif -#if _MIPS_SIM != _ABI64 -# define F_GETLK64 33 /* Get record locking info. */ -# define F_SETLK64 34 /* Set record locking info (non-blocking). */ -# define F_SETLKW64 35 /* Set record locking info (blocking). */ -#else -# define F_GETLK64 14 /* Get record locking info. */ -# define F_SETLK64 6 /* Set record locking info (non-blocking).*/ -# define F_SETLKW64 7 /* Set record locking info (blocking). */ -#endif - -#define __F_SETOWN 24 /* Get owner (process receiving SIGIO). */ -#define __F_GETOWN 23 /* Set owner (process receiving SIGIO). */ struct flock { @@ -71,23 +39,12 @@ struct flock #ifndef __USE_FILE_OFFSET64 __off_t l_start; /* Offset where the lock begins. */ __off_t l_len; /* Size of the locked area; zero means until EOF. */ -#if _MIPS_SIM != _ABI64 - /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit - fcntls in o32 and n32, never has this field. */ - long int l_sysid; -#endif #else __off64_t l_start; /* Offset where the lock begins. */ __off64_t l_len; /* Size of the locked area; zero means until EOF. */ #endif __pid_t l_pid; /* Process holding the lock. */ -#if ! defined __USE_FILE_OFFSET64 && _MIPS_SIM != _ABI64 - /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit - flock in o32 and n32, never has this field. */ - long int __glibc_reserved0[4]; -#endif }; -typedef struct flock flock_t; #ifdef __USE_LARGEFILE64 struct flock64 diff --git a/lib/libc/include/generic-glibc/bits/fenv.h b/lib/libc/include/generic-glibc/bits/fenv.h index cdf79211de..b504e27b15 100644 --- a/lib/libc/include/generic-glibc/bits/fenv.h +++ b/lib/libc/include/generic-glibc/bits/fenv.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2020 Free Software Foundation, Inc. +/* Copyright (C) 1997-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,101 +12,104 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _FENV_H # error "Never use directly; include instead." #endif - -#ifdef __mips_hard_float - /* Define bits representing the exception. We use the bit positions of the appropriate bits in the FPU control word. */ enum { - FE_INEXACT = -# define FE_INEXACT 0x04 - FE_INEXACT, - FE_UNDERFLOW = -# define FE_UNDERFLOW 0x08 - FE_UNDERFLOW, - FE_OVERFLOW = -# define FE_OVERFLOW 0x10 - FE_OVERFLOW, - FE_DIVBYZERO = -# define FE_DIVBYZERO 0x20 - FE_DIVBYZERO, FE_INVALID = -# define FE_INVALID 0x40 +#define FE_INVALID 0x01 FE_INVALID, + __FE_DENORM = 0x02, + FE_DIVBYZERO = +#define FE_DIVBYZERO 0x04 + FE_DIVBYZERO, + FE_OVERFLOW = +#define FE_OVERFLOW 0x08 + FE_OVERFLOW, + FE_UNDERFLOW = +#define FE_UNDERFLOW 0x10 + FE_UNDERFLOW, + FE_INEXACT = +#define FE_INEXACT 0x20 + FE_INEXACT }; -# define FE_ALL_EXCEPT \ +#define FE_ALL_EXCEPT \ (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) -/* The MIPS FPU supports all of the four defined rounding modes. We +/* The ix87 FPU supports all of the four defined rounding modes. We use again the bit positions in the FPU control word as the values for the appropriate macros. */ enum { FE_TONEAREST = -# define FE_TONEAREST 0x0 +#define FE_TONEAREST 0 FE_TONEAREST, - FE_TOWARDZERO = -# define FE_TOWARDZERO 0x1 - FE_TOWARDZERO, - FE_UPWARD = -# define FE_UPWARD 0x2 - FE_UPWARD, FE_DOWNWARD = -# define FE_DOWNWARD 0x3 - FE_DOWNWARD +#define FE_DOWNWARD 0x400 + FE_DOWNWARD, + FE_UPWARD = +#define FE_UPWARD 0x800 + FE_UPWARD, + FE_TOWARDZERO = +#define FE_TOWARDZERO 0xc00 + FE_TOWARDZERO }; -#else - -/* In the soft-float case, only rounding to nearest is supported, with - no exceptions. */ - -enum - { - __FE_UNDEFINED = -1, - - FE_TONEAREST = -# define FE_TONEAREST 0x0 - FE_TONEAREST - }; - -# define FE_ALL_EXCEPT 0 - -#endif - /* Type representing exception flags. */ typedef unsigned short int fexcept_t; -/* Type representing floating-point environment. This function corresponds - to the layout of the block written by the `fstenv'. */ +/* Type representing floating-point environment. This structure + corresponds to the layout of the block written by the `fstenv' + instruction and has additional fields for the contents of the MXCSR + register as written by the `stmxcsr' instruction. */ typedef struct { - unsigned int __fp_control_register; + unsigned short int __control_word; + unsigned short int __glibc_reserved1; + unsigned short int __status_word; + unsigned short int __glibc_reserved2; + unsigned short int __tags; + unsigned short int __glibc_reserved3; + unsigned int __eip; + unsigned short int __cs_selector; + unsigned int __opcode:11; + unsigned int __glibc_reserved4:5; + unsigned int __data_offset; + unsigned short int __data_selector; + unsigned short int __glibc_reserved5; +#ifdef __x86_64__ + unsigned int __mxcsr; +#endif } fenv_t; /* If the default argument is used we use this value. */ #define FE_DFL_ENV ((const fenv_t *) -1) -#if defined __USE_GNU && defined __mips_hard_float +#ifdef __USE_GNU /* Floating-point environment where none of the exception is masked. */ -# define FE_NOMASK_ENV ((const fenv_t *) -2) +# define FE_NOMASK_ENV ((const fenv_t *) -2) #endif #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) /* Type representing floating-point control modes. */ -typedef unsigned int femode_t; +typedef struct + { + unsigned short int __control_word; + unsigned short int __glibc_reserved; + unsigned int __mxcsr; + } +femode_t; /* Default floating-point control modes. */ # define FE_DFL_MODE ((const femode_t *) -1L) diff --git a/lib/libc/include/generic-glibc/bits/fenvinline.h b/lib/libc/include/generic-glibc/bits/fenvinline.h deleted file mode 100644 index 1367c80eaf..0000000000 --- a/lib/libc/include/generic-glibc/bits/fenvinline.h +++ /dev/null @@ -1,8 +0,0 @@ -/* This file provides inline versions of floating-pint environment - handling functions. If there were any. */ - -#ifndef __NO_MATH_INLINES - -/* Here is where the code would go. */ - -#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/floatn.h b/lib/libc/include/generic-glibc/bits/floatn.h index 68a17ab2c7..36d64c23ec 100644 --- a/lib/libc/include/generic-glibc/bits/floatn.h +++ b/lib/libc/include/generic-glibc/bits/floatn.h @@ -1,4 +1,4 @@ -/* Macros to control TS 18661-3 glibc features on MIPS platforms. +/* Macros to control TS 18661-3 glibc features on x86. Copyright (C) 2017-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,35 +20,38 @@ #define _BITS_FLOATN_H #include -#include /* Defined to 1 if the current compiler invocation provides a floating-point type with the IEEE 754 binary128 format, and this - glibc includes corresponding *f128 interfaces for it. */ -#ifndef __NO_LONG_DOUBLE_MATH + glibc includes corresponding *f128 interfaces for it. The required + libgcc support was added some time after the basic compiler + support, for x86_64 and x86. */ +#if (defined __x86_64__ \ + ? __GNUC_PREREQ (4, 3) \ + : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) # define __HAVE_FLOAT128 1 #else -/* glibc does not support _Float128 for platforms where long double is - normally binary128 when building with long double as binary64. - GCC's default for supported scalar modes does not support it either - in that case. */ # define __HAVE_FLOAT128 0 #endif /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct from the default float, double and long double types in this glibc. */ -#define __HAVE_DISTINCT_FLOAT128 0 +#if __HAVE_FLOAT128 +# define __HAVE_DISTINCT_FLOAT128 1 +#else +# define __HAVE_DISTINCT_FLOAT128 0 +#endif /* Defined to 1 if the current compiler invocation provides a floating-point type with the right format for _Float64x, and this glibc includes corresponding *f64x interfaces for it. */ -#define __HAVE_FLOAT64X __HAVE_FLOAT128 +#define __HAVE_FLOAT64X 1 /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has the format of _Float128, which must be different from that of long double. */ -#define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128 +#define __HAVE_FLOAT64X_LONG_DOUBLE 1 #ifndef __ASSEMBLER__ @@ -57,7 +60,7 @@ # if __HAVE_FLOAT128 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus /* The literal suffix f128 exists only since GCC 7.0. */ -# define __f128(x) x##l +# define __f128(x) x##q # else # define __f128(x) x##f128 # endif @@ -66,7 +69,10 @@ /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ # if __HAVE_FLOAT128 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus -# define __CFLOAT128 _Complex long double +/* Add a typedef for older GCC compilers which don't natively support + _Complex _Float128. */ +typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); +# define __CFLOAT128 __cfloat128 # else # define __CFLOAT128 _Complex _Float128 # endif @@ -77,15 +83,33 @@ /* The type _Float128 exists only since GCC 7.0. */ # if !__GNUC_PREREQ (7, 0) || defined __cplusplus -typedef long double _Float128; +typedef __float128 _Float128; # endif -/* Various built-in functions do not exist before GCC 7.0. */ +/* __builtin_huge_valf128 doesn't exist before GCC 7.0. */ # if !__GNUC_PREREQ (7, 0) -# define __builtin_huge_valf128() (__builtin_huge_vall ()) -# define __builtin_inff128() (__builtin_infl ()) -# define __builtin_nanf128(x) (__builtin_nanl (x)) -# define __builtin_nansf128(x) (__builtin_nansl (x)) +# define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ()) +# endif + +/* Older GCC has only a subset of built-in functions for _Float128 on + x86, and __builtin_infq is not usable in static initializers. + Converting a narrower sNaN to _Float128 produces a quiet NaN, so + attempts to use _Float128 sNaNs will not work properly with older + compilers. */ +# if !__GNUC_PREREQ (7, 0) +# define __builtin_copysignf128 __builtin_copysignq +# define __builtin_fabsf128 __builtin_fabsq +# define __builtin_inff128() ((_Float128) __builtin_inf ()) +# define __builtin_nanf128(x) ((_Float128) __builtin_nan (x)) +# define __builtin_nansf128(x) ((_Float128) __builtin_nans (x)) +# endif + +/* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*, + e.g.: __builtin_signbitf128, before GCC 6. However, there has never + been a __builtin_signbitf128 in GCC and the type-generic builtin is + only available since GCC 6. */ +# if !__GNUC_PREREQ (6, 0) +# define __builtin_signbitf128 __signbitf128 # endif # endif diff --git a/lib/libc/include/generic-glibc/bits/flt-eval-method.h b/lib/libc/include/generic-glibc/bits/flt-eval-method.h index 11297d9c17..9da0307897 100644 --- a/lib/libc/include/generic-glibc/bits/flt-eval-method.h +++ b/lib/libc/include/generic-glibc/bits/flt-eval-method.h @@ -1,4 +1,4 @@ -/* Define __GLIBC_FLT_EVAL_METHOD. +/* Define __GLIBC_FLT_EVAL_METHOD. x86 version. Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,23 +20,14 @@ # error "Never use directly; include instead." #endif -/* __GLIBC_FLT_EVAL_METHOD is the value of FLT_EVAL_METHOD used to - determine the evaluation method typedefs such as float_t and - double_t. It must be a value from C11 or TS 18661-3:2015, and not - -1. */ - -/* In the default version of this header, follow __FLT_EVAL_METHOD__. - -1 is mapped to 2 (considering evaluation as long double to be a - conservatively safe assumption), and if __FLT_EVAL_METHOD__ is not - defined then assume there is no excess precision and use the value - 0. */ - #ifdef __FLT_EVAL_METHOD__ # if __FLT_EVAL_METHOD__ == -1 # define __GLIBC_FLT_EVAL_METHOD 2 # else # define __GLIBC_FLT_EVAL_METHOD __FLT_EVAL_METHOD__ # endif -#else +#elif defined __x86_64__ # define __GLIBC_FLT_EVAL_METHOD 0 +#else +# define __GLIBC_FLT_EVAL_METHOD 2 #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/fp-logb.h b/lib/libc/include/generic-glibc/bits/fp-logb.h index efc488bc27..5f2e2a9f88 100644 --- a/lib/libc/include/generic-glibc/bits/fp-logb.h +++ b/lib/libc/include/generic-glibc/bits/fp-logb.h @@ -1,4 +1,4 @@ -/* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. +/* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. x86 version. Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,9 +20,5 @@ # error "Never use directly; include instead." #endif -/* __FP_LOGB0_IS_MIN is defined to 1 if FP_ILOGB0 is INT_MIN, and 0 if - it is -INT_MAX. __FP_LOGBNAN_IS_MIN is defined to 1 if FP_ILOGBNAN - is INT_MIN, and 0 if it is INT_MAX. */ - -#define __FP_LOGB0_IS_MIN 0 -#define __FP_LOGBNAN_IS_MIN 0 \ No newline at end of file +#define __FP_LOGB0_IS_MIN 1 +#define __FP_LOGBNAN_IS_MIN 1 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/indirect-return.h b/lib/libc/include/generic-glibc/bits/indirect-return.h index 5a7beddda9..e74139721c 100644 --- a/lib/libc/include/generic-glibc/bits/indirect-return.h +++ b/lib/libc/include/generic-glibc/bits/indirect-return.h @@ -1,4 +1,4 @@ -/* Definition of __INDIRECT_RETURN. Generic version. +/* Definition of __INDIRECT_RETURN. x86 version. Copyright (C) 2018-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,6 +20,18 @@ # error "Never include directly; use instead." #endif -/* __INDIRECT_RETURN is used on swapcontext to indicate if it requires - special compiler treatment. */ -#define __INDIRECT_RETURN \ No newline at end of file +/* On x86, swapcontext returns via indirect branch when the shadow stack + is enabled. Define __INDIRECT_RETURN to indicate whether swapcontext + returns via indirect branch. */ +#if defined __CET__ && (__CET__ & 2) != 0 +# if __glibc_has_attribute (__indirect_return__) +# define __INDIRECT_RETURN __attribute__ ((__indirect_return__)) +# else +/* Newer compilers provide the indirect_return attribute, but without + it we can use returns_twice to affect the optimizer in the same + way and avoid unsafe optimizations. */ +# define __INDIRECT_RETURN __attribute__ ((__returns_twice__)) +# endif +#else +# define __INDIRECT_RETURN +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/ipctypes.h b/lib/libc/include/generic-glibc/bits/ipctypes.h index 2fce70dab0..7f6bb7662d 100644 --- a/lib/libc/include/generic-glibc/bits/ipctypes.h +++ b/lib/libc/include/generic-glibc/bits/ipctypes.h @@ -1,5 +1,5 @@ -/* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. Generic. - Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. + Copyright (C) 2012-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,21 +16,18 @@ License along with the GNU C Library; if not, see . */ -/* - * Never include directly. - */ +#ifndef _SYS_IPC_H +# error "Never use directly; include instead." +#endif #ifndef _BITS_IPCTYPES_H #define _BITS_IPCTYPES_H 1 -#include - /* Used in `struct shmid_ds'. */ -# if __WORDSIZE == 32 -typedef unsigned short int __ipc_pid_t; -# else +# ifdef __x86_64__ typedef int __ipc_pid_t; +# else +typedef unsigned short int __ipc_pid_t; # endif - #endif /* bits/ipctypes.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/iscanonical.h b/lib/libc/include/generic-glibc/bits/iscanonical.h index 446a24d01b..ee0d8720f9 100644 --- a/lib/libc/include/generic-glibc/bits/iscanonical.h +++ b/lib/libc/include/generic-glibc/bits/iscanonical.h @@ -1,4 +1,4 @@ -/* Define iscanonical macro. +/* Define iscanonical macro. ldbl-96 version. Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,9 +20,35 @@ # error "Never use directly; include instead." #endif -/* Return nonzero value if X is canonical. By default, we only have - IEEE interchange binary formats, in which all values are canonical, - but the argument must still be converted to its semantic type for - any exceptions arising from the conversion, before being - discarded. */ -#define iscanonical(x) ((void) (__typeof (x)) (x), 1) \ No newline at end of file +extern int __iscanonicall (long double __x) + __THROW __attribute__ ((__const__)); +#define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1) +#define __iscanonical(x) ((void) (__typeof (x)) (x), 1) +#if __HAVE_DISTINCT_FLOAT128 +# define __iscanonicalf128(x) ((void) (__typeof (x)) (x), 1) +#endif + +/* Return nonzero value if X is canonical. In IEEE interchange binary + formats, all values are canonical, but the argument must still be + converted to its semantic type for any exceptions arising from the + conversion, before being discarded; in extended precision, there + are encodings that are not consistently handled as corresponding to + any particular value of the type, and we return 0 for those. */ +#ifndef __cplusplus +# define iscanonical(x) __MATH_TG ((x), __iscanonical, (x)) +#else +/* In C++ mode, __MATH_TG cannot be used, because it relies on + __builtin_types_compatible_p, which is a C-only builtin. On the + other hand, overloading provides the means to distinguish between + the floating-point types. The overloading resolution will match + the correct parameter (regardless of type qualifiers (i.e.: const + and volatile)). */ +extern "C++" { +inline int iscanonical (float __val) { return __iscanonicalf (__val); } +inline int iscanonical (double __val) { return __iscanonical (__val); } +inline int iscanonical (long double __val) { return __iscanonicall (__val); } +# if __HAVE_DISTINCT_FLOAT128 +inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); } +# endif +} +#endif /* __cplusplus */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/link.h b/lib/libc/include/generic-glibc/bits/link.h index 9fc3255bf9..68938e8e0c 100644 --- a/lib/libc/include/generic-glibc/bits/link.h +++ b/lib/libc/include/generic-glibc/bits/link.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2020 Free Software Foundation, Inc. +/* Copyright (C) 2004-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,106 +12,148 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _LINK_H # error "Never include directly; use instead." #endif -#include -#if _MIPS_SIM == _ABIO32 - -/* Registers for entry into PLT on MIPS. */ -typedef struct La_mips_32_regs +#ifndef __x86_64__ +/* Registers for entry into PLT on IA-32. */ +typedef struct La_i86_regs { - uint32_t lr_reg[4]; /* $a0 through $a3 */ - double lr_fpreg[2]; /* $f12 and $f14 */ - uint32_t lr_ra; - uint32_t lr_sp; -} La_mips_32_regs; + uint32_t lr_edx; + uint32_t lr_ecx; + uint32_t lr_eax; + uint32_t lr_ebp; + uint32_t lr_esp; +} La_i86_regs; -/* Return values for calls from PLT on MIPS. */ -typedef struct La_mips_32_retval +/* Return values for calls from PLT on IA-32. */ +typedef struct La_i86_retval { - uint32_t lrv_v0; - uint32_t lrv_v1; - double lrv_f0; - double lrv_f2; -} La_mips_32_retval; + uint32_t lrv_eax; + uint32_t lrv_edx; + long double lrv_st0; + long double lrv_st1; + uint64_t lrv_bnd0; + uint64_t lrv_bnd1; +} La_i86_retval; -#else - -typedef struct La_mips_64_regs -{ - uint64_t lr_reg[8]; /* $a0 through $a7 */ - double lr_fpreg[8]; /* $f12 throgh $f19 */ - uint64_t lr_ra; - uint64_t lr_sp; -} La_mips_64_regs; - -/* Return values for calls from PLT on MIPS. */ -typedef struct La_mips_64_retval -{ - uint64_t lrv_v0; - uint64_t lrv_v1; - double lrv_f0; - double lrv_f2; -} La_mips_64_retval; - -#endif __BEGIN_DECLS -#if _MIPS_SIM == _ABIO32 +extern Elf32_Addr la_i86_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + La_i86_regs *__regs, + unsigned int *__flags, + const char *__symname, + long int *__framesizep); +extern unsigned int la_i86_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + const La_i86_regs *__inregs, + La_i86_retval *__outregs, + const char *symname); -extern Elf32_Addr la_mips_o32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_mips_32_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_mips_o32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_mips_32_regs *__inregs, - La_mips_32_retval *__outregs, - const char *__symname); - -#elif _MIPS_SIM == _ABIN32 - -extern Elf32_Addr la_mips_n32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_mips_64_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_mips_n32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_mips_64_regs *__inregs, - La_mips_64_retval *__outregs, - const char *__symname); +__END_DECLS #else -extern Elf64_Addr la_mips_n64_gnu_pltenter (Elf64_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_mips_64_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_mips_n64_gnu_pltexit (Elf64_Sym *__sym, unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_mips_64_regs *__inregs, - La_mips_64_retval *__outregs, - const char *__symname); +/* Registers for entry into PLT on x86-64. */ +# if __GNUC_PREREQ (4,0) +typedef float La_x86_64_xmm __attribute__ ((__vector_size__ (16))); +typedef float La_x86_64_ymm + __attribute__ ((__vector_size__ (32), __aligned__ (16))); +typedef double La_x86_64_zmm + __attribute__ ((__vector_size__ (64), __aligned__ (16))); +# else +typedef float La_x86_64_xmm __attribute__ ((__mode__ (__V4SF__))); +# endif +typedef union +{ +# if __GNUC_PREREQ (4,0) + La_x86_64_ymm ymm[2]; + La_x86_64_zmm zmm[1]; +# endif + La_x86_64_xmm xmm[4]; +} La_x86_64_vector __attribute__ ((__aligned__ (16))); + +typedef struct La_x86_64_regs +{ + uint64_t lr_rdx; + uint64_t lr_r8; + uint64_t lr_r9; + uint64_t lr_rcx; + uint64_t lr_rsi; + uint64_t lr_rdi; + uint64_t lr_rbp; + uint64_t lr_rsp; + La_x86_64_xmm lr_xmm[8]; + La_x86_64_vector lr_vector[8]; +#ifndef __ILP32__ + __int128_t lr_bnd[4]; #endif +} La_x86_64_regs; -__END_DECLS \ No newline at end of file +/* Return values for calls from PLT on x86-64. */ +typedef struct La_x86_64_retval +{ + uint64_t lrv_rax; + uint64_t lrv_rdx; + La_x86_64_xmm lrv_xmm0; + La_x86_64_xmm lrv_xmm1; + long double lrv_st0; + long double lrv_st1; + La_x86_64_vector lrv_vector0; + La_x86_64_vector lrv_vector1; +#ifndef __ILP32__ + __int128_t lrv_bnd0; + __int128_t lrv_bnd1; +#endif +} La_x86_64_retval; + +#define La_x32_regs La_x86_64_regs +#define La_x32_retval La_x86_64_retval + +__BEGIN_DECLS + +extern Elf64_Addr la_x86_64_gnu_pltenter (Elf64_Sym *__sym, + unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + La_x86_64_regs *__regs, + unsigned int *__flags, + const char *__symname, + long int *__framesizep); +extern unsigned int la_x86_64_gnu_pltexit (Elf64_Sym *__sym, + unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + const La_x86_64_regs *__inregs, + La_x86_64_retval *__outregs, + const char *__symname); + +extern Elf32_Addr la_x32_gnu_pltenter (Elf32_Sym *__sym, + unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + La_x32_regs *__regs, + unsigned int *__flags, + const char *__symname, + long int *__framesizep); +extern unsigned int la_x32_gnu_pltexit (Elf32_Sym *__sym, + unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + const La_x32_regs *__inregs, + La_x32_retval *__outregs, + const char *__symname); + +__END_DECLS + +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/long-double.h b/lib/libc/include/generic-glibc/bits/long-double.h index 27339ff440..75bc1fcce4 100644 --- a/lib/libc/include/generic-glibc/bits/long-double.h +++ b/lib/libc/include/generic-glibc/bits/long-double.h @@ -1,4 +1,4 @@ -/* Properties of long double type. MIPS version. +/* Properties of long double type. ldbl-96 version. Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,9 +16,6 @@ License along with the GNU C Library; if not, see . */ -#include - -#if !defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32 -# define __NO_LONG_DOUBLE_MATH 1 -#endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +/* long double is distinct from double, so there is nothing to + define here. */ +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/math-vector.h b/lib/libc/include/generic-glibc/bits/math-vector.h index da37ee7bff..f7571e827d 100644 --- a/lib/libc/include/generic-glibc/bits/math-vector.h +++ b/lib/libc/include/generic-glibc/bits/math-vector.h @@ -4,7 +4,7 @@ The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public - License published by the Free Software Foundation; either + License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, @@ -21,7 +21,43 @@ include instead." #endif -/* Get default empty definitions required for __MATHCALL_VEC unfolding. - Plaform-specific analogue of this header should redefine them with specific - SIMD declarations. */ -#include \ No newline at end of file +/* Get default empty definitions for simd declarations. */ +#include + +#if defined __x86_64__ && defined __FAST_MATH__ +# if defined _OPENMP && _OPENMP >= 201307 +/* OpenMP case. */ +# define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch") +# elif __GNUC_PREREQ (6,0) +/* W/o OpenMP use GCC 6.* __attribute__ ((__simd__)). */ +# define __DECL_SIMD_x86_64 __attribute__ ((__simd__ ("notinbranch"))) +# endif + +# ifdef __DECL_SIMD_x86_64 +# undef __DECL_SIMD_cos +# define __DECL_SIMD_cos __DECL_SIMD_x86_64 +# undef __DECL_SIMD_cosf +# define __DECL_SIMD_cosf __DECL_SIMD_x86_64 +# undef __DECL_SIMD_sin +# define __DECL_SIMD_sin __DECL_SIMD_x86_64 +# undef __DECL_SIMD_sinf +# define __DECL_SIMD_sinf __DECL_SIMD_x86_64 +# undef __DECL_SIMD_sincos +# define __DECL_SIMD_sincos __DECL_SIMD_x86_64 +# undef __DECL_SIMD_sincosf +# define __DECL_SIMD_sincosf __DECL_SIMD_x86_64 +# undef __DECL_SIMD_log +# define __DECL_SIMD_log __DECL_SIMD_x86_64 +# undef __DECL_SIMD_logf +# define __DECL_SIMD_logf __DECL_SIMD_x86_64 +# undef __DECL_SIMD_exp +# define __DECL_SIMD_exp __DECL_SIMD_x86_64 +# undef __DECL_SIMD_expf +# define __DECL_SIMD_expf __DECL_SIMD_x86_64 +# undef __DECL_SIMD_pow +# define __DECL_SIMD_pow __DECL_SIMD_x86_64 +# undef __DECL_SIMD_powf +# define __DECL_SIMD_powf __DECL_SIMD_x86_64 + +# endif +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/mathcalls-helper-functions.h b/lib/libc/include/generic-glibc/bits/mathcalls-helper-functions.h index 88ced5d2e1..29808be75a 100644 --- a/lib/libc/include/generic-glibc/bits/mathcalls-helper-functions.h +++ b/lib/libc/include/generic-glibc/bits/mathcalls-helper-functions.h @@ -16,28 +16,30 @@ License along with the GNU C Library; if not, see . */ - /* Classify given number. */ -__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value)) +__MATHDECL_ALIAS (int, __fpclassify,, (_Mdouble_ __value), fpclassify) __attribute__ ((__const__)); /* Test for negative number. */ -__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value)) +__MATHDECL_ALIAS (int, __signbit,, (_Mdouble_ __value), signbit) __attribute__ ((__const__)); /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ -__MATHDECL_1 (int, __isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int, __isinf,, (_Mdouble_ __value), isinf) + __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. Used by isfinite macro. */ -__MATHDECL_1 (int, __finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int, __finite,, (_Mdouble_ __value), finite) + __attribute__ ((__const__)); /* Return nonzero if VALUE is not a number. */ -__MATHDECL_1 (int, __isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int, __isnan,, (_Mdouble_ __value), isnan) + __attribute__ ((__const__)); /* Test equality. */ -__MATHDECL_1 (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHDECL_ALIAS (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y), iseqsig); /* Test for signaling NaN. */ -__MATHDECL_1 (int, __issignaling,, (_Mdouble_ __value)) +__MATHDECL_ALIAS (int, __issignaling,, (_Mdouble_ __value), issignaling) __attribute__ ((__const__)); \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/mathcalls.h b/lib/libc/include/generic-glibc/bits/mathcalls.h index e6b009ff27..28d936113e 100644 --- a/lib/libc/include/generic-glibc/bits/mathcalls.h +++ b/lib/libc/include/generic-glibc/bits/mathcalls.h @@ -174,12 +174,14 @@ __MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y)); && !__MATH_DECLARING_FLOATN /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ -__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int,isinf,, (_Mdouble_ __value), isinf) + __attribute__ ((__const__)); # endif # if !__MATH_DECLARING_FLOATN /* Return nonzero if VALUE is finite and not NaN. */ -__MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int,finite,, (_Mdouble_ __value), finite) + __attribute__ ((__const__)); /* Return the remainder of X/Y. */ __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y)); @@ -208,7 +210,8 @@ __MATHCALL (nan,, (const char *__tagb)); || __MATH_DECLARING_DOUBLE == 0)) /* isnanf or isnanl don't. */ \ && !__MATH_DECLARING_FLOATN /* Return nonzero if VALUE is not a number. */ -__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int,isnan,, (_Mdouble_ __value), isnan) + __attribute__ ((__const__)); # endif #endif diff --git a/lib/libc/include/generic-glibc/bits/mathinline.h b/lib/libc/include/generic-glibc/bits/mathinline.h deleted file mode 100644 index 76a37688ed..0000000000 --- a/lib/libc/include/generic-glibc/bits/mathinline.h +++ /dev/null @@ -1,12 +0,0 @@ -/* This file should provide inline versions of math functions. - - Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'. - - This file should define __MATH_INLINES if functions are actually defined as - inlines. */ - -#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ - -/* Here goes the real code. */ - -#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/mman-shared.h b/lib/libc/include/generic-glibc/bits/mman-shared.h index aa6c176fca..45862663e3 100644 --- a/lib/libc/include/generic-glibc/bits/mman-shared.h +++ b/lib/libc/include/generic-glibc/bits/mman-shared.h @@ -24,6 +24,7 @@ /* Flags for mremap. */ # define MREMAP_MAYMOVE 1 # define MREMAP_FIXED 2 +# define MREMAP_DONTUNMAP 4 /* Flags for memfd_create. */ # ifndef MFD_CLOEXEC diff --git a/lib/libc/include/generic-glibc/bits/mman.h b/lib/libc/include/generic-glibc/bits/mman.h index dc24c1d773..4319c54436 100644 --- a/lib/libc/include/generic-glibc/bits/mman.h +++ b/lib/libc/include/generic-glibc/bits/mman.h @@ -1,5 +1,5 @@ -/* Definitions for POSIX memory map interface. Linux/generic version. - Copyright (C) 1997-2020 Free Software Foundation, Inc. +/* Definitions for POSIX memory map interface. Linux/x86_64 version. + Copyright (C) 2001-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,18 +13,20 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SYS_MMAN_H # error "Never use directly; include instead." #endif -/* These definitions are appropriate for architectures that, in the - Linux kernel, either have no uapi/asm/mman.h, or have one that - includes asm-generic/mman.h without any changes or additions - relevant to glibc. If there are additions relevant to glibc, an - architecture-specific bits/mman.h is needed. */ +/* The following definitions basically come from the kernel headers. + But the kernel header is not namespace clean. */ + +/* Other flags. */ +#ifdef __USE_MISC +# define MAP_32BIT 0x40 /* Only give out 32-bit addresses. */ +#endif #include diff --git a/lib/libc/include/generic-glibc/bits/msq-pad.h b/lib/libc/include/generic-glibc/bits/msq-pad.h deleted file mode 100644 index 5cc786f0d3..0000000000 --- a/lib/libc/include/generic-glibc/bits/msq-pad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Define where padding goes in struct msqid_ds. Generic version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -/* On most architectures, padding goes after time fields for 32-bit - systems and is omitted for 64-bit systems. Some architectures pad - before time fields instead, or omit padding despite being - 32-bit. */ - -#define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) -#define __MSQ_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/msq.h b/lib/libc/include/generic-glibc/bits/msq.h index 98efc613d1..7c8dba0eca 100644 --- a/lib/libc/include/generic-glibc/bits/msq.h +++ b/lib/libc/include/generic-glibc/bits/msq.h @@ -20,7 +20,12 @@ #endif #include -#include + +/* Types used in the MSQID_DS structure definition. */ +typedef __syscall_ulong_t msgqnum_t; +typedef __syscall_ulong_t msglen_t; + +#include /* Define options for message queue functions. */ #define MSG_NOERROR 010000 /* no error if message is too big */ @@ -29,38 +34,6 @@ # define MSG_COPY 040000 /* copy (not remove) all queue messages */ #endif -/* Types used in the structure definition. */ -typedef __syscall_ulong_t msgqnum_t; -typedef __syscall_ulong_t msglen_t; - -#if __MSQ_PAD_BEFORE_TIME -# define __MSQ_PAD_TIME(NAME, RES) \ - unsigned long int __glibc_reserved ## RES; __time_t NAME -#elif __MSQ_PAD_AFTER_TIME -# define __MSQ_PAD_TIME(NAME, RES) \ - __time_t NAME; unsigned long int __glibc_reserved ## RES -#else -# define __MSQ_PAD_TIME(NAME, RES) \ - __time_t NAME -#endif - -/* Structure of record for one message inside the kernel. - The type `struct msg' is opaque. */ -struct msqid_ds -{ - struct ipc_perm msg_perm; /* structure describing operation permission */ - __MSQ_PAD_TIME (msg_stime, 1); /* time of last msgsnd command */ - __MSQ_PAD_TIME (msg_rtime, 2); /* time of last msgrcv command */ - __MSQ_PAD_TIME (msg_ctime, 3); /* time of last change */ - __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ - msgqnum_t msg_qnum; /* number of messages currently on queue */ - msglen_t msg_qbytes; /* max number of bytes allowed on queue */ - __pid_t msg_lspid; /* pid of last msgsnd() */ - __pid_t msg_lrpid; /* pid of last msgrcv() */ - __syscall_ulong_t __glibc_reserved4; - __syscall_ulong_t __glibc_reserved5; -}; - #ifdef __USE_MISC # define msg_cbytes __msg_cbytes diff --git a/lib/libc/include/generic-glibc/bits/procfs-id.h b/lib/libc/include/generic-glibc/bits/procfs-id.h index 38906b6303..4f4cefeb4b 100644 --- a/lib/libc/include/generic-glibc/bits/procfs-id.h +++ b/lib/libc/include/generic-glibc/bits/procfs-id.h @@ -1,4 +1,4 @@ -/* Types of pr_uid and pr_gid in struct elf_prpsinfo. Generic Linux version. +/* Types of pr_uid and pr_gid in struct elf_prpsinfo. x86 version. Copyright (C) 2018-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -21,5 +21,10 @@ # error "Never include directly; use instead." #endif +#if __WORDSIZE == 32 +typedef unsigned short int __pr_uid_t; +typedef unsigned short int __pr_gid_t; +#else typedef unsigned int __pr_uid_t; -typedef unsigned int __pr_gid_t; \ No newline at end of file +typedef unsigned int __pr_gid_t; +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/procfs.h b/lib/libc/include/generic-glibc/bits/procfs.h index 66a5f6726b..1f4ca5a0f0 100644 --- a/lib/libc/include/generic-glibc/bits/procfs.h +++ b/lib/libc/include/generic-glibc/bits/procfs.h @@ -1,5 +1,5 @@ -/* Types for registers for sys/procfs.h. MIPS version. - Copyright (C) 1996-2020 Free Software Foundation, Inc. +/* Types for registers for sys/procfs.h. x86 version. + Copyright (C) 2001-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,25 +13,38 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SYS_PROCFS_H # error "Never include directly; use instead." #endif -#include - -/* ELF register definitions */ -#define ELF_NGREG 45 -#define ELF_NFPREG 33 - -#if _MIPS_SIM == _ABIN32 +/* Type for a general-purpose register. */ +#ifdef __x86_64__ __extension__ typedef unsigned long long elf_greg_t; #else typedef unsigned long elf_greg_t; #endif + +/* And the whole bunch of them. We could have used `struct + user_regs_struct' directly in the typedef, but tradition says that + the register set is an array, which does have some peculiar + semantics, so leave it that way. */ +#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof (elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG]; -typedef double elf_fpreg_t; -typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; \ No newline at end of file +#ifndef __x86_64__ +/* Register set for the floating-point registers. */ +typedef struct user_fpregs_struct elf_fpregset_t; + +/* Register set for the extended floating-point registers. Includes + the Pentium III SSE registers in addition to the classic + floating-point stuff. */ +typedef struct user_fpxregs_struct elf_fpxregset_t; +#else +/* Register set for the extended floating-point registers. Includes + the Pentium III SSE registers in addition to the classic + floating-point stuff. */ +typedef struct user_fpregs_struct elf_fpregset_t; +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/pthreadtypes-arch.h b/lib/libc/include/generic-glibc/bits/pthreadtypes-arch.h index 549deac37b..147ce690db 100644 --- a/lib/libc/include/generic-glibc/bits/pthreadtypes-arch.h +++ b/lib/libc/include/generic-glibc/bits/pthreadtypes-arch.h @@ -1,6 +1,4 @@ -/* Machine-specific pthread type layouts. Generic version. - Copyright (C) 2019-2020 Free Software Foundation, Inc. - +/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,31 +13,43 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ + . */ #ifndef _BITS_PTHREADTYPES_ARCH_H #define _BITS_PTHREADTYPES_ARCH_H 1 #include -#if __WORDSIZE == 64 -# define __SIZEOF_PTHREAD_ATTR_T 56 -# define __SIZEOF_PTHREAD_MUTEX_T 40 -# define __SIZEOF_PTHREAD_RWLOCK_T 56 -# define __SIZEOF_PTHREAD_BARRIER_T 32 +#ifdef __x86_64__ +# if __WORDSIZE == 64 +# define __SIZEOF_PTHREAD_MUTEX_T 40 +# define __SIZEOF_PTHREAD_ATTR_T 56 +# define __SIZEOF_PTHREAD_RWLOCK_T 56 +# define __SIZEOF_PTHREAD_BARRIER_T 32 +# else +# define __SIZEOF_PTHREAD_MUTEX_T 32 +# define __SIZEOF_PTHREAD_ATTR_T 32 +# define __SIZEOF_PTHREAD_RWLOCK_T 44 +# define __SIZEOF_PTHREAD_BARRIER_T 20 +# endif #else -# define __SIZEOF_PTHREAD_ATTR_T 36 -# define __SIZEOF_PTHREAD_MUTEX_T 24 -# define __SIZEOF_PTHREAD_RWLOCK_T 32 -# define __SIZEOF_PTHREAD_BARRIER_T 20 +# define __SIZEOF_PTHREAD_MUTEX_T 24 +# define __SIZEOF_PTHREAD_ATTR_T 36 +# define __SIZEOF_PTHREAD_RWLOCK_T 32 +# define __SIZEOF_PTHREAD_BARRIER_T 20 #endif -#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 -#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 -#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 -#define __SIZEOF_PTHREAD_COND_T 48 -#define __SIZEOF_PTHREAD_CONDATTR_T 4 +#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +#define __SIZEOF_PTHREAD_COND_T 48 +#define __SIZEOF_PTHREAD_CONDATTR_T 4 +#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 #define __LOCK_ALIGNMENT #define __ONCE_ALIGNMENT +#ifndef __x86_64__ +/* Extra attributes for the cleanup functions. */ +# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1))) +#endif + #endif /* bits/pthreadtypes.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/resource.h b/lib/libc/include/generic-glibc/bits/resource.h index 6f4ec334ac..f5b55f6a7c 100644 --- a/lib/libc/include/generic-glibc/bits/resource.h +++ b/lib/libc/include/generic-glibc/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/generic-glibc/bits/sem-pad.h b/lib/libc/include/generic-glibc/bits/sem-pad.h deleted file mode 100644 index 92c1bab60a..0000000000 --- a/lib/libc/include/generic-glibc/bits/sem-pad.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Define where padding goes in struct semid_ds. Generic version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#include - -/* On most architectures, padding goes after time fields for 32-bit - systems and is omitted for 64-bit systems. Some architectures pad - before time fields instead, or omit padding despite being 32-bit, - or include it despite being 64-bit. This must match the layout - used for struct semid64_ds in , as glibc does not do - layout conversions for this structure. */ - -#define __SEM_PAD_AFTER_TIME (__TIMESIZE == 32) -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/sem.h b/lib/libc/include/generic-glibc/bits/sem.h index b352aa0cbb..67c394015a 100644 --- a/lib/libc/include/generic-glibc/bits/sem.h +++ b/lib/libc/include/generic-glibc/bits/sem.h @@ -20,7 +20,8 @@ #endif #include -#include +#include +#include /* Flags for `semop'. */ #define SEM_UNDO 0x1000 /* undo the operation on exit */ @@ -34,29 +35,6 @@ #define SETVAL 16 /* set semval */ #define SETALL 17 /* set all semval's */ - -#if __SEM_PAD_BEFORE_TIME -# define __SEM_PAD_TIME(NAME, RES) \ - __syscall_ulong_t __glibc_reserved ## RES; __time_t NAME -#elif __SEM_PAD_AFTER_TIME -# define __SEM_PAD_TIME(NAME, RES) \ - __time_t NAME; __syscall_ulong_t __glibc_reserved ## RES -#else -# define __SEM_PAD_TIME(NAME, RES) \ - __time_t NAME -#endif - -/* Data structure describing a set of semaphores. */ -struct semid_ds -{ - struct ipc_perm sem_perm; /* operation permission struct */ - __SEM_PAD_TIME (sem_otime, 1); /* last semop() time */ - __SEM_PAD_TIME (sem_ctime, 2); /* last time changed by semctl() */ - __syscall_ulong_t sem_nsems; /* number of semaphores in set */ - __syscall_ulong_t __glibc_reserved3; - __syscall_ulong_t __glibc_reserved4; -}; - /* The user should define a union like the following to use it for arguments for `semctl'. diff --git a/lib/libc/include/generic-glibc/bits/semaphore.h b/lib/libc/include/generic-glibc/bits/semaphore.h index e28b319eb5..97292723c8 100644 --- a/lib/libc/include/generic-glibc/bits/semaphore.h +++ b/lib/libc/include/generic-glibc/bits/semaphore.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,14 +13,16 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif -#if _MIPS_SIM == _ABI64 +#include + +#if __WORDSIZE == 64 # define __SIZEOF_SEM_T 32 #else # define __SIZEOF_SEM_T 16 diff --git a/lib/libc/include/generic-glibc/bits/setjmp.h b/lib/libc/include/generic-glibc/bits/setjmp.h index 7fefe88f62..18d620397d 100644 --- a/lib/libc/include/generic-glibc/bits/setjmp.h +++ b/lib/libc/include/generic-glibc/bits/setjmp.h @@ -1,5 +1,4 @@ -/* Define the machine-dependent type `jmp_buf'. MIPS version. - Copyright (C) 1992-2020 Free Software Foundation, Inc. +/* Copyright (C) 2001-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,61 +12,29 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ -#ifndef _MIPS_BITS_SETJMP_H -#define _MIPS_BITS_SETJMP_H 1 +/* Define the machine-dependent type `jmp_buf'. x86-64 version. */ +#ifndef _BITS_SETJMP_H +#define _BITS_SETJMP_H 1 -#if !defined(_SETJMP_H) && !defined(_PTHREAD_H) +#if !defined _SETJMP_H && !defined _PTHREAD_H # error "Never include directly; use instead." #endif -#include +#include -typedef struct __jmp_buf_internal_tag - { -#if _MIPS_SIM == _ABIO32 - /* Program counter. */ - void *__pc; +#ifndef _ASM - /* Stack pointer. */ - void *__sp; +# if __WORDSIZE == 64 +typedef long int __jmp_buf[8]; +# elif defined __x86_64__ +__extension__ typedef long long int __jmp_buf[8]; +# else +typedef int __jmp_buf[6]; +# endif - /* Callee-saved registers s0 through s7. */ - int __regs[8]; - - /* The frame pointer. */ - void *__fp; - - /* The global pointer. */ - void *__gp; -#else - /* Program counter. */ - __extension__ long long __pc; - - /* Stack pointer. */ - __extension__ long long __sp; - - /* Callee-saved registers s0 through s7. */ - __extension__ long long __regs[8]; - - /* The frame pointer. */ - __extension__ long long __fp; - - /* The global pointer. */ - __extension__ long long __gp; #endif - /* Unused (was floating point status register). */ - int __glibc_reserved1; - - /* Callee-saved floating point registers. */ -#if _MIPS_SIM == _ABI64 - double __fpregs[8]; -#else - double __fpregs[6]; -#endif - } __jmp_buf[1]; - -#endif /* _MIPS_BITS_SETJMP_H */ \ No newline at end of file +#endif /* bits/setjmp.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/shm-pad.h b/lib/libc/include/generic-glibc/bits/shm-pad.h deleted file mode 100644 index e214cd6e6b..0000000000 --- a/lib/libc/include/generic-glibc/bits/shm-pad.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Define where padding goes in struct shmid_ds. Generic version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -/* On most architectures, padding goes after time fields for 32-bit - systems and is omitted for 64-bit systems. Some architectures pad - before time fields instead, or omit padding despite being 32-bit, - or include it despite being 64-bit. Furthermore, some - architectures place shm_segsz after the time fields rather than - before them, with or without padding there. This must match the - layout used for struct shmid64_ds in , as glibc does - not do layout conversions for this structure. */ - -#define __SHM_PAD_AFTER_TIME (__TIMESIZE == 32) -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/shm.h b/lib/libc/include/generic-glibc/bits/shm.h index 97e4d577e0..e5de42e2ab 100644 --- a/lib/libc/include/generic-glibc/bits/shm.h +++ b/lib/libc/include/generic-glibc/bits/shm.h @@ -22,7 +22,6 @@ #include #include #include -#include /* Permission flag for shmget. */ #define SHM_R 0400 /* or S_IRUGO from */ @@ -43,39 +42,7 @@ __BEGIN_DECLS /* Type to count number of attaches. */ typedef __syscall_ulong_t shmatt_t; -#if __SHM_PAD_BEFORE_TIME -# define __SHM_PAD_TIME(NAME, RES) \ - unsigned long int __glibc_reserved ## RES; __time_t NAME -#elif __SHM_PAD_AFTER_TIME -# define __SHM_PAD_TIME(NAME, RES) \ - __time_t NAME; unsigned long int __glibc_reserved ## RES -#else -# define __SHM_PAD_TIME(NAME, RES) \ - __time_t NAME -#endif - -/* Data structure describing a shared memory segment. */ -struct shmid_ds - { - struct ipc_perm shm_perm; /* operation permission struct */ -#if !__SHM_SEGSZ_AFTER_TIME - size_t shm_segsz; /* size of segment in bytes */ -#endif - __SHM_PAD_TIME (shm_atime, 1); /* time of last shmat() */ - __SHM_PAD_TIME (shm_dtime, 2); /* time of last shmdt() */ - __SHM_PAD_TIME (shm_ctime, 3); /* time of last change by shmctl() */ -#if __SHM_PAD_BETWEEN_TIME_AND_SEGSZ - unsigned long int __glibc_reserved4; -#endif -#if __SHM_SEGSZ_AFTER_TIME - size_t shm_segsz; /* size of segment in bytes */ -#endif - __pid_t shm_cpid; /* pid of creator */ - __pid_t shm_lpid; /* pid of last shmop */ - shmatt_t shm_nattch; /* number of current attaches */ - __syscall_ulong_t __glibc_reserved5; - __syscall_ulong_t __glibc_reserved6; - }; +#include #ifdef __USE_MISC diff --git a/lib/libc/include/generic-glibc/bits/sigcontext.h b/lib/libc/include/generic-glibc/bits/sigcontext.h index 4496148619..7498f87f91 100644 --- a/lib/libc/include/generic-glibc/bits/sigcontext.h +++ b/lib/libc/include/generic-glibc/bits/sigcontext.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2020 Free Software Foundation, Inc. +/* Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -8,7 +8,7 @@ The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public @@ -16,22 +16,181 @@ . */ #ifndef _BITS_SIGCONTEXT_H -#define _BITS_SIGCONTEXT_H 1 +#define _BITS_SIGCONTEXT_H 1 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H # error "Never use directly; include instead." #endif +#include + +#define FP_XSTATE_MAGIC1 0x46505853U +#define FP_XSTATE_MAGIC2 0x46505845U +#define FP_XSTATE_MAGIC2_SIZE sizeof (FP_XSTATE_MAGIC2) + +struct _fpx_sw_bytes +{ + __uint32_t magic1; + __uint32_t extended_size; + __uint64_t xstate_bv; + __uint32_t xstate_size; + __uint32_t __glibc_reserved1[7]; +}; + +struct _fpreg +{ + unsigned short significand[4]; + unsigned short exponent; +}; + +struct _fpxreg +{ + unsigned short significand[4]; + unsigned short exponent; + unsigned short __glibc_reserved1[3]; +}; + +struct _xmmreg +{ + __uint32_t element[4]; +}; + + + +#ifndef __x86_64__ + +struct _fpstate +{ + /* Regular FPU environment. */ + __uint32_t cw; + __uint32_t sw; + __uint32_t tag; + __uint32_t ipoff; + __uint32_t cssel; + __uint32_t dataoff; + __uint32_t datasel; + struct _fpreg _st[8]; + unsigned short status; + unsigned short magic; + + /* FXSR FPU environment. */ + __uint32_t _fxsr_env[6]; + __uint32_t mxcsr; + __uint32_t __glibc_reserved1; + struct _fpxreg _fxsr_st[8]; + struct _xmmreg _xmm[8]; + __uint32_t __glibc_reserved2[56]; +}; + #ifndef sigcontext_struct /* Kernel headers before 2.1.1 define a struct sigcontext_struct, but - we need sigcontext. */ + we need sigcontext. Some packages have come to rely on + sigcontext_struct being defined on 32-bit x86, so define this for + their benefit. */ # define sigcontext_struct sigcontext - -# include - -/* The Linux kernel headers redefine NULL wrongly, so cleanup afterwards. */ -# define __need_NULL -# include #endif -#endif /* bits/sigcontext.h */ \ No newline at end of file +#define X86_FXSR_MAGIC 0x0000 + +struct sigcontext +{ + unsigned short gs, __gsh; + unsigned short fs, __fsh; + unsigned short es, __esh; + unsigned short ds, __dsh; + unsigned long edi; + unsigned long esi; + unsigned long ebp; + unsigned long esp; + unsigned long ebx; + unsigned long edx; + unsigned long ecx; + unsigned long eax; + unsigned long trapno; + unsigned long err; + unsigned long eip; + unsigned short cs, __csh; + unsigned long eflags; + unsigned long esp_at_signal; + unsigned short ss, __ssh; + struct _fpstate * fpstate; + unsigned long oldmask; + unsigned long cr2; +}; + +#else /* __x86_64__ */ + +struct _fpstate +{ + /* FPU environment matching the 64-bit FXSAVE layout. */ + __uint16_t cwd; + __uint16_t swd; + __uint16_t ftw; + __uint16_t fop; + __uint64_t rip; + __uint64_t rdp; + __uint32_t mxcsr; + __uint32_t mxcr_mask; + struct _fpxreg _st[8]; + struct _xmmreg _xmm[16]; + __uint32_t __glibc_reserved1[24]; +}; + +struct sigcontext +{ + __uint64_t r8; + __uint64_t r9; + __uint64_t r10; + __uint64_t r11; + __uint64_t r12; + __uint64_t r13; + __uint64_t r14; + __uint64_t r15; + __uint64_t rdi; + __uint64_t rsi; + __uint64_t rbp; + __uint64_t rbx; + __uint64_t rdx; + __uint64_t rax; + __uint64_t rcx; + __uint64_t rsp; + __uint64_t rip; + __uint64_t eflags; + unsigned short cs; + unsigned short gs; + unsigned short fs; + unsigned short __pad0; + __uint64_t err; + __uint64_t trapno; + __uint64_t oldmask; + __uint64_t cr2; + __extension__ union + { + struct _fpstate * fpstate; + __uint64_t __fpstate_word; + }; + __uint64_t __reserved1 [8]; +}; + +#endif /* __x86_64__ */ + +struct _xsave_hdr +{ + __uint64_t xstate_bv; + __uint64_t __glibc_reserved1[2]; + __uint64_t __glibc_reserved2[5]; +}; + +struct _ymmh_state +{ + __uint32_t ymmh_space[64]; +}; + +struct _xstate +{ + struct _fpstate fpstate; + struct _xsave_hdr xstate_hdr; + struct _ymmh_state ymmh; +}; + +#endif /* _BITS_SIGCONTEXT_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/siginfo-arch.h b/lib/libc/include/generic-glibc/bits/siginfo-arch.h index 59cd9e3066..0f430f0772 100644 --- a/lib/libc/include/generic-glibc/bits/siginfo-arch.h +++ b/lib/libc/include/generic-glibc/bits/siginfo-arch.h @@ -1,7 +1,17 @@ -/* Architecture-specific adjustments to siginfo_t. */ +/* Architecture-specific adjustments to siginfo_t. x86 version. */ #ifndef _BITS_SIGINFO_ARCH_H #define _BITS_SIGINFO_ARCH_H 1 -/* This architecture has no adjustments to make to siginfo_t. */ +#if defined __x86_64__ && __WORDSIZE == 32 +/* si_utime and si_stime must be 4 byte aligned for x32 to match the + kernel. We align siginfo_t to 8 bytes so that si_utime and + si_stime are actually aligned to 8 bytes since their offsets are + multiple of 8 bytes. Note: with some compilers, the alignment + attribute would be ignored if it were put in __SI_CLOCK_T instead + of encapsulated in a typedef. */ +typedef __clock_t __attribute__ ((__aligned__ (4))) __sigchld_clock_t; +# define __SI_ALIGNMENT __attribute__ ((__aligned__ (8))) +# define __SI_CLOCK_T __sigchld_clock_t +#endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/signum-generic.h b/lib/libc/include/generic-glibc/bits/signum-generic.h index fc31cf9cff..eddb633837 100644 --- a/lib/libc/include/generic-glibc/bits/signum-generic.h +++ b/lib/libc/include/generic-glibc/bits/signum-generic.h @@ -57,31 +57,9 @@ #define SIGQUIT 3 /* Quit. */ #define SIGTRAP 5 /* Trace/breakpoint trap. */ #define SIGKILL 9 /* Killed. */ -#define SIGBUS 10 /* Bus error. */ -#define SIGSYS 12 /* Bad system call. */ #define SIGPIPE 13 /* Broken pipe. */ #define SIGALRM 14 /* Alarm clock. */ -/* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ -#define SIGURG 16 /* Urgent data is available at a socket. */ -#define SIGSTOP 17 /* Stop, unblockable. */ -#define SIGTSTP 18 /* Keyboard stop. */ -#define SIGCONT 19 /* Continue. */ -#define SIGCHLD 20 /* Child terminated or stopped. */ -#define SIGTTIN 21 /* Background read from control terminal. */ -#define SIGTTOU 22 /* Background write to control terminal. */ -#define SIGPOLL 23 /* Pollable event occurred (System V). */ -#define SIGXCPU 24 /* CPU time limit exceeded. */ -#define SIGXFSZ 25 /* File size limit exceeded. */ -#define SIGVTALRM 26 /* Virtual timer expired. */ -#define SIGPROF 27 /* Profiling timer expired. */ -#define SIGUSR1 30 /* User-defined signal 1. */ -#define SIGUSR2 31 /* User-defined signal 2. */ - -/* Nonstandard signals found in all modern POSIX systems - (including both BSD and Linux). */ -#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ - /* Archaic names for compatibility. */ #define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */ #define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP-11. */ @@ -93,8 +71,9 @@ but some real-time signals may be used internally by glibc. Do not use these constants in application code; use SIGRTMIN and SIGRTMAX (defined in signal.h) instead. */ -#define __SIGRTMIN 32 -#define __SIGRTMAX __SIGRTMIN + +/* Include system specific bits. */ +#include /* Biggest signal number + 1 (including real-time signals). */ #define _NSIG (__SIGRTMAX + 1) diff --git a/lib/libc/include/generic-glibc/bits/signum.h b/lib/libc/include/generic-glibc/bits/signum.h deleted file mode 100644 index a549ca0204..0000000000 --- a/lib/libc/include/generic-glibc/bits/signum.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Signal number definitions. Linux version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - most Linux systems. */ - -#define SIGSTKFLT 16 /* Stack fault (obsolete). */ -#define SIGPWR 30 /* Power failure imminent. */ - -#undef SIGBUS -#define SIGBUS 7 -#undef SIGUSR1 -#define SIGUSR1 10 -#undef SIGUSR2 -#define SIGUSR2 12 -#undef SIGCHLD -#define SIGCHLD 17 -#undef SIGCONT -#define SIGCONT 18 -#undef SIGSTOP -#define SIGSTOP 19 -#undef SIGTSTP -#define SIGTSTP 20 -#undef SIGURG -#define SIGURG 23 -#undef SIGPOLL -#define SIGPOLL 29 -#undef SIGSYS -#define SIGSYS 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 64 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/socket-constants.h b/lib/libc/include/generic-glibc/bits/socket-constants.h index 1781053c77..93fd5d7548 100644 --- a/lib/libc/include/generic-glibc/bits/socket-constants.h +++ b/lib/libc/include/generic-glibc/bits/socket-constants.h @@ -20,6 +20,8 @@ # error "Never include directly; use instead." #endif +#include + #define SOL_SOCKET 1 #define SO_ACCEPTCONN 30 #define SO_BROADCAST 6 @@ -30,9 +32,19 @@ #define SO_OOBINLINE 10 #define SO_RCVBUF 8 #define SO_RCVLOWAT 18 -#define SO_RCVTIMEO 20 +#if (__TIMESIZE == 64 && __WORDSIZE == 32 \ + && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) +# define SO_RCVTIMEO 66 +#else +# define SO_RCVTIMEO 20 +#endif #define SO_REUSEADDR 2 #define SO_SNDBUF 7 #define SO_SNDLOWAT 19 -#define SO_SNDTIMEO 21 +#if (__TIMESIZE == 64 && __WORDSIZE == 32 \ + && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) +# define SO_SNDTIMEO 67 +#else +# define SO_SNDTIMEO 21 +#endif #define SO_TYPE 3 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/stat.h b/lib/libc/include/generic-glibc/bits/stat.h index b298b3f336..ab5378300a 100644 --- a/lib/libc/include/generic-glibc/bits/stat.h +++ b/lib/libc/include/generic-glibc/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2020 Free Software Foundation, Inc. +/* Copyright (C) 1999-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,7 +12,7 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #if !defined _SYS_STAT_H && !defined _FCNTL_H @@ -22,90 +22,126 @@ #ifndef _BITS_STAT_H #define _BITS_STAT_H 1 -#include - /* Versions of the `struct stat' data structure. */ -#define _STAT_VER_LINUX_OLD 1 -#define _STAT_VER_KERNEL 1 -#define _STAT_VER_SVR4 2 -#define _STAT_VER_LINUX 3 -#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */ +#ifndef __x86_64__ +# define _STAT_VER_LINUX_OLD 1 +# define _STAT_VER_KERNEL 1 +# define _STAT_VER_SVR4 2 +# define _STAT_VER_LINUX 3 -/* Versions of the `xmknod' interface. */ -#define _MKNOD_VER_LINUX 1 -#define _MKNOD_VER_SVR4 2 -#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ +/* i386 versions of the `xmknod' interface. */ +# define _MKNOD_VER_LINUX 1 +# define _MKNOD_VER_SVR4 2 +# define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ +#else +# define _STAT_VER_KERNEL 0 +# define _STAT_VER_LINUX 1 +/* x86-64 versions of the `xmknod' interface. */ +# define _MKNOD_VER_LINUX 0 +#endif + +#define _STAT_VER _STAT_VER_LINUX -#if _MIPS_SIM == _ABIO32 -/* Structure describing file characteristics. */ struct stat { - unsigned long int st_dev; - long int st_pad1[3]; -#ifndef __USE_FILE_OFFSET64 - __ino_t st_ino; /* File serial number. */ -#else - __ino64_t st_ino; /* File serial number. */ + __dev_t st_dev; /* Device. */ +#ifndef __x86_64__ + unsigned short int __pad1; #endif - __mode_t st_mode; /* File mode. */ +#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 + __ino_t st_ino; /* File serial number. */ +#else + __ino_t __st_ino; /* 32bit file serial number. */ +#endif +#ifndef __x86_64__ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ +#else __nlink_t st_nlink; /* Link count. */ + __mode_t st_mode; /* File mode. */ +#endif __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ - unsigned long int st_rdev; /* Device number, if device. */ -#ifndef __USE_FILE_OFFSET64 - long int st_pad2[2]; +#ifdef __x86_64__ + int __pad0; +#endif + __dev_t st_rdev; /* Device number, if device. */ +#ifndef __x86_64__ + unsigned short int __pad2; +#endif +#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 + __off_t st_size; /* Size of file, in bytes. */ +#else + __off64_t st_size; /* Size of file, in bytes. */ +#endif + __blksize_t st_blksize; /* Optimal block size for I/O. */ +#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 + __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ +#else + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +#endif +#ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __time_t st_atime; /* Time of last access. */ + __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ +#endif +#ifdef __x86_64__ + __syscall_slong_t __glibc_reserved[3]; +#else +# ifndef __USE_FILE_OFFSET64 + unsigned long int __glibc_reserved4; + unsigned long int __glibc_reserved5; +# else + __ino64_t st_ino; /* File serial number. */ +# endif +#endif + }; + +#ifdef __USE_LARGEFILE64 +/* Note stat64 has the same shape as stat for x86-64. */ +struct stat64 + { + __dev_t st_dev; /* Device. */ +# ifdef __x86_64__ + __ino64_t st_ino; /* File serial number. */ + __nlink_t st_nlink; /* Link count. */ + __mode_t st_mode; /* File mode. */ +# else + unsigned int __pad1; + __ino_t __st_ino; /* 32bit file serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ +# endif + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ +# ifdef __x86_64__ + int __pad0; + __dev_t st_rdev; /* Device number, if device. */ __off_t st_size; /* Size of file, in bytes. */ - /* SVR4 added this extra long to allow for expansion of off_t. */ - long int st_pad3; -#else - long int st_pad2[3]; - __off64_t st_size; /* Size of file, in bytes. */ -#endif -#ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# else + __dev_t st_rdev; /* Device number, if device. */ + unsigned int __pad2; + __off64_t st_size; /* Size of file, in bytes. */ +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ -#ifndef __USE_FILE_OFFSET64 - __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */ -#else - long int st_pad4; - __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ -#endif - long int st_pad5[14]; - }; - -#ifdef __USE_LARGEFILE64 -struct stat64 - { - unsigned long int st_dev; - long int st_pad1[3]; - __ino64_t st_ino; /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - unsigned long int st_rdev; /* Device number, if device. */ - long int st_pad2[3]; - __off64_t st_size; /* Size of file, in bytes. */ + __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ # ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used @@ -113,119 +149,30 @@ struct stat64 identifier 'timespec' to appear in the header. Therefore we have to handle the use of this header in strictly standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ # else __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ + __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ + __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ # endif - __blksize_t st_blksize; /* Optimal block size for I/O. */ - long int st_pad3; - __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ - long int st_pad4[14]; - }; -#endif -#else -struct stat - { - __dev_t st_dev; - int st_pad1[3]; /* Reserved for st_dev expansion */ -#ifndef __USE_FILE_OFFSET64 - __ino_t st_ino; -#else - __ino64_t st_ino; -#endif - __mode_t st_mode; - __nlink_t st_nlink; - __uid_t st_uid; - __gid_t st_gid; - __dev_t st_rdev; -#if !defined __USE_FILE_OFFSET64 - unsigned int st_pad2[2]; /* Reserved for st_rdev expansion */ - __off_t st_size; - int st_pad3; -#else - unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ - __off64_t st_size; -#endif -#ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif - __blksize_t st_blksize; - unsigned int st_pad4; -#ifndef __USE_FILE_OFFSET64 - __blkcnt_t st_blocks; -#else - __blkcnt64_t st_blocks; -#endif - int st_pad5[14]; - }; - -#ifdef __USE_LARGEFILE64 -struct stat64 - { - __dev_t st_dev; - unsigned int st_pad1[3]; /* Reserved for st_dev expansion */ - __ino64_t st_ino; - __mode_t st_mode; - __nlink_t st_nlink; - __uid_t st_uid; - __gid_t st_gid; - __dev_t st_rdev; - unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ - __off64_t st_size; -# ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ +# ifdef __x86_64__ + __syscall_slong_t __glibc_reserved[3]; # else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ + __ino64_t st_ino; /* File serial number. */ # endif - __blksize_t st_blksize; - unsigned int st_pad3; - __blkcnt64_t st_blocks; - int st_pad4[14]; -}; -#endif + }; #endif /* Tell code we have these members. */ #define _STATBUF_ST_BLKSIZE -#define _STATBUF_ST_RDEV +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC /* Encoding of the file mode. */ diff --git a/lib/libc/include/generic-glibc/bits/statx-generic.h b/lib/libc/include/generic-glibc/bits/statx-generic.h index e277c97c32..f0d8e4d846 100644 --- a/lib/libc/include/generic-glibc/bits/statx-generic.h +++ b/lib/libc/include/generic-glibc/bits/statx-generic.h @@ -48,6 +48,7 @@ # define STATX_ATTR_NODUMP 0x0040 # define STATX_ATTR_ENCRYPTED 0x0800 # define STATX_ATTR_AUTOMOUNT 0x1000 +# define STATX_ATTR_VERITY 0x100000 #endif /* !STATX_TYPE */ __BEGIN_DECLS diff --git a/lib/libc/include/generic-glibc/bits/stdio-ldbl.h b/lib/libc/include/generic-glibc/bits/stdio-ldbl.h index 1e6a0edf64..f74840c8b6 100644 --- a/lib/libc/include/generic-glibc/bits/stdio-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/stdio-ldbl.h @@ -27,9 +27,17 @@ __LDBL_REDIR_DECL (vfprintf) __LDBL_REDIR_DECL (vprintf) __LDBL_REDIR_DECL (vsprintf) #if !__GLIBC_USE (DEPRECATED_SCANF) +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (fscanf, __nldbl___isoc99_fscanf) __LDBL_REDIR1_DECL (scanf, __nldbl___isoc99_scanf) __LDBL_REDIR1_DECL (sscanf, __nldbl___isoc99_sscanf) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (fscanf, __isoc99_fscanfieee128) +__LDBL_REDIR1_DECL (scanf, __isoc99_scanfieee128) +__LDBL_REDIR1_DECL (sscanf, __isoc99_sscanfieee128) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif #else __LDBL_REDIR_DECL (fscanf) __LDBL_REDIR_DECL (scanf) @@ -43,9 +51,17 @@ __LDBL_REDIR_DECL (vsnprintf) #ifdef __USE_ISOC99 # if !__GLIBC_USE (DEPRECATED_SCANF) +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (vfscanf, __nldbl___isoc99_vfscanf) __LDBL_REDIR1_DECL (vscanf, __nldbl___isoc99_vscanf) __LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc99_vsscanf) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (vfscanf, __isoc99_vfscanfieee128) +__LDBL_REDIR1_DECL (vscanf, __isoc99_vscanfieee128) +__LDBL_REDIR1_DECL (vsscanf, __isoc99_vsscanfieee128) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif # else __LDBL_REDIR_DECL (vfscanf) __LDBL_REDIR_DECL (vsscanf) @@ -60,33 +76,33 @@ __LDBL_REDIR_DECL (dprintf) #ifdef __USE_GNU __LDBL_REDIR_DECL (vasprintf) -__LDBL_REDIR_DECL (__asprintf) +__LDBL_REDIR2_DECL (asprintf) __LDBL_REDIR_DECL (asprintf) __LDBL_REDIR_DECL (obstack_printf) __LDBL_REDIR_DECL (obstack_vprintf) #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function -__LDBL_REDIR_DECL (__sprintf_chk) -__LDBL_REDIR_DECL (__vsprintf_chk) +__LDBL_REDIR2_DECL (sprintf_chk) +__LDBL_REDIR2_DECL (vsprintf_chk) # if defined __USE_ISOC99 || defined __USE_UNIX98 -__LDBL_REDIR_DECL (__snprintf_chk) -__LDBL_REDIR_DECL (__vsnprintf_chk) +__LDBL_REDIR2_DECL (snprintf_chk) +__LDBL_REDIR2_DECL (vsnprintf_chk) # endif # if __USE_FORTIFY_LEVEL > 1 -__LDBL_REDIR_DECL (__fprintf_chk) -__LDBL_REDIR_DECL (__printf_chk) -__LDBL_REDIR_DECL (__vfprintf_chk) -__LDBL_REDIR_DECL (__vprintf_chk) +__LDBL_REDIR2_DECL (fprintf_chk) +__LDBL_REDIR2_DECL (printf_chk) +__LDBL_REDIR2_DECL (vfprintf_chk) +__LDBL_REDIR2_DECL (vprintf_chk) # ifdef __USE_XOPEN2K8 -__LDBL_REDIR_DECL (__dprintf_chk) -__LDBL_REDIR_DECL (__vdprintf_chk) +__LDBL_REDIR2_DECL (dprintf_chk) +__LDBL_REDIR2_DECL (vdprintf_chk) # endif # ifdef __USE_GNU -__LDBL_REDIR_DECL (__asprintf_chk) -__LDBL_REDIR_DECL (__vasprintf_chk) -__LDBL_REDIR_DECL (__obstack_printf_chk) -__LDBL_REDIR_DECL (__obstack_vprintf_chk) +__LDBL_REDIR2_DECL (asprintf_chk) +__LDBL_REDIR2_DECL (vasprintf_chk) +__LDBL_REDIR2_DECL (obstack_printf_chk) +__LDBL_REDIR2_DECL (obstack_vprintf_chk) # endif # endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/stdio2.h b/lib/libc/include/generic-glibc/bits/stdio2.h index 32e4a4b64a..b6b568ad96 100644 --- a/lib/libc/include/generic-glibc/bits/stdio2.h +++ b/lib/libc/include/generic-glibc/bits/stdio2.h @@ -24,10 +24,12 @@ #endif extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen, - const char *__restrict __format, ...) __THROW; + const char *__restrict __format, ...) __THROW + __attr_access ((__write_only__, 1, 3)); extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen, const char *__restrict __format, - __gnuc_va_list __ap) __THROW; + __gnuc_va_list __ap) __THROW + __attr_access ((__write_only__, 1, 3)); #ifdef __va_arg_pack __fortify_function int @@ -54,7 +56,8 @@ __NTH (vsprintf (char *__restrict __s, const char *__restrict __fmt, extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag, size_t __slen, const char *__restrict __format, - ...) __THROW; + ...) __THROW + __attr_access ((__write_only__, 1, 2)); extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag, size_t __slen, const char *__restrict __format, __gnuc_va_list __ap) __THROW; @@ -241,17 +244,19 @@ gets (char *__str) #endif extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n, - FILE *__restrict __stream) __wur; + FILE *__restrict __stream) + __wur __attr_access ((__write_only__, 1, 3)); extern char *__REDIRECT (__fgets_alias, (char *__restrict __s, int __n, - FILE *__restrict __stream), fgets) __wur; + FILE *__restrict __stream), fgets) + __wur __attr_access ((__write_only__, 1, 2)); extern char *__REDIRECT (__fgets_chk_warn, (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream), __fgets_chk) __wur __warnattr ("fgets called with bigger size than length " "of destination buffer"); -__fortify_function __wur char * +__fortify_function __wur __attr_access ((__write_only__, 1, 2)) char * fgets (char *__restrict __s, int __n, FILE *__restrict __stream) { if (__bos (__s) != (size_t) -1) @@ -299,17 +304,19 @@ fread (void *__restrict __ptr, size_t __size, size_t __n, #ifdef __USE_GNU extern char *__fgets_unlocked_chk (char *__restrict __s, size_t __size, - int __n, FILE *__restrict __stream) __wur; + int __n, FILE *__restrict __stream) + __wur __attr_access ((__write_only__, 1, 3)); extern char *__REDIRECT (__fgets_unlocked_alias, (char *__restrict __s, int __n, - FILE *__restrict __stream), fgets_unlocked) __wur; + FILE *__restrict __stream), fgets_unlocked) + __wur __attr_access ((__write_only__, 1, 2)); extern char *__REDIRECT (__fgets_unlocked_chk_warn, (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream), __fgets_unlocked_chk) __wur __warnattr ("fgets_unlocked called with bigger size than length " "of destination buffer"); -__fortify_function __wur char * +__fortify_function __wur __attr_access ((__write_only__, 1, 2)) char * fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream) { if (__bos (__s) != (size_t) -1) diff --git a/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h b/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h index b4c4abe997..185b83dde3 100644 --- a/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h @@ -21,21 +21,43 @@ #endif #ifdef __USE_ISOC99 +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (strtold, strtod) +# else +__LDBL_REDIR1_DECL (strtold, __strtoieee128) +# endif #endif #ifdef __USE_GNU +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (strtold_l, strtod_l) +# else +__LDBL_REDIR1_DECL (strtold_l, __strtoieee128_l) +# endif #endif #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (strfroml, strfromd) +# else +__LDBL_REDIR1_DECL (strfroml, __strfromieee128) +# endif #endif #ifdef __USE_MISC +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (qecvt, ecvt) __LDBL_REDIR1_DECL (qfcvt, fcvt) __LDBL_REDIR1_DECL (qgcvt, gcvt) __LDBL_REDIR1_DECL (qecvt_r, ecvt_r) __LDBL_REDIR1_DECL (qfcvt_r, fcvt_r) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (qecvt, __qecvtieee128) +__LDBL_REDIR1_DECL (qfcvt, __qfcvtieee128) +__LDBL_REDIR1_DECL (qgcvt, __qgcvtieee128) +__LDBL_REDIR1_DECL (qecvt_r, __qecvtieee128_r) +__LDBL_REDIR1_DECL (qfcvt_r, __qfcvtieee128_r) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/stdlib.h b/lib/libc/include/generic-glibc/bits/stdlib.h index d6fb14eb32..92b27c5534 100644 --- a/lib/libc/include/generic-glibc/bits/stdlib.h +++ b/lib/libc/include/generic-glibc/bits/stdlib.h @@ -50,10 +50,11 @@ __NTH (realpath (const char *__restrict __name, char *__restrict __resolved)) extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen, - size_t __nreal) __THROW __nonnull ((2)); + size_t __nreal) __THROW __nonnull ((2)) + __attr_access ((__write_only__, 2, 3)); extern int __REDIRECT_NTH (__ptsname_r_alias, (int __fd, char *__buf, size_t __buflen), ptsname_r) - __nonnull ((2)); + __nonnull ((2)) __attr_access ((__write_only__, 2, 3)); extern int __REDIRECT_NTH (__ptsname_r_chk_warn, (int __fd, char *__buf, size_t __buflen, size_t __nreal), __ptsname_r_chk) @@ -97,11 +98,13 @@ __NTH (wctomb (char *__s, wchar_t __wchar)) extern size_t __mbstowcs_chk (wchar_t *__restrict __dst, const char *__restrict __src, - size_t __len, size_t __dstlen) __THROW; + size_t __len, size_t __dstlen) __THROW + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); extern size_t __REDIRECT_NTH (__mbstowcs_alias, (wchar_t *__restrict __dst, const char *__restrict __src, - size_t __len), mbstowcs); + size_t __len), mbstowcs) + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn, (wchar_t *__restrict __dst, const char *__restrict __src, @@ -129,11 +132,13 @@ __NTH (mbstowcs (wchar_t *__restrict __dst, const char *__restrict __src, extern size_t __wcstombs_chk (char *__restrict __dst, const wchar_t *__restrict __src, - size_t __len, size_t __dstlen) __THROW; + size_t __len, size_t __dstlen) __THROW + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); extern size_t __REDIRECT_NTH (__wcstombs_alias, (char *__restrict __dst, const wchar_t *__restrict __src, - size_t __len), wcstombs); + size_t __len), wcstombs) + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); extern size_t __REDIRECT_NTH (__wcstombs_chk_warn, (char *__restrict __dst, const wchar_t *__restrict __src, diff --git a/lib/libc/include/generic-glibc/bits/string_fortified.h b/lib/libc/include/generic-glibc/bits/string_fortified.h index f516808da3..0ec88c36a4 100644 --- a/lib/libc/include/generic-glibc/bits/string_fortified.h +++ b/lib/libc/include/generic-glibc/bits/string_fortified.h @@ -75,7 +75,7 @@ __NTH (memset (void *__dest, int __ch, size_t __len)) # include void __explicit_bzero_chk (void *__dest, size_t __len, size_t __destlen) - __THROW __nonnull ((1)); + __THROW __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); __fortify_function void __NTH (explicit_bzero (void *__dest, size_t __len)) @@ -108,7 +108,8 @@ __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, /* XXX We have no corresponding builtin yet. */ extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n, - size_t __destlen) __THROW; + size_t __destlen) __THROW + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src, size_t __n), stpncpy); diff --git a/lib/libc/include/generic-glibc/bits/struct_mutex.h b/lib/libc/include/generic-glibc/bits/struct_mutex.h index 092f4ee080..44273158be 100644 --- a/lib/libc/include/generic-glibc/bits/struct_mutex.h +++ b/lib/libc/include/generic-glibc/bits/struct_mutex.h @@ -1,4 +1,4 @@ -/* Default mutex implementation struct definitions. +/* x86 internal mutex struct definitions. Copyright (C) 2019-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -19,66 +19,45 @@ #ifndef _THREAD_MUTEX_INTERNAL_H #define _THREAD_MUTEX_INTERNAL_H 1 -/* Generic struct for both POSIX and C11 mutexes. New ports are expected - to use the default layout, however architecture can redefine it to - add arch-specific extension (such as lock-elision). The struct have - a size of 32 bytes on LP32 and 40 bytes on LP64 architectures. */ - struct __pthread_mutex_s { - int __lock __LOCK_ALIGNMENT; + int __lock; unsigned int __count; int __owner; -#if __WORDSIZE == 64 +#ifdef __x86_64__ unsigned int __nusers; #endif /* KIND must stay at this position in the structure to maintain - binary compatibility with static initializers. - - Concurrency notes: - The __kind of a mutex is initialized either by the static - PTHREAD_MUTEX_INITIALIZER or by a call to pthread_mutex_init. - - After a mutex has been initialized, the __kind of a mutex is usually not - changed. BUT it can be set to -1 in pthread_mutex_destroy or elision can - be enabled. This is done concurrently in the pthread_mutex_*lock - functions by using the macro FORCE_ELISION. This macro is only defined - for architectures which supports lock elision. - - For elision, there are the flags PTHREAD_MUTEX_ELISION_NP and - PTHREAD_MUTEX_NO_ELISION_NP which can be set in addition to the already - set type of a mutex. Before a mutex is initialized, only - PTHREAD_MUTEX_NO_ELISION_NP can be set with pthread_mutexattr_settype. - - After a mutex has been initialized, the functions pthread_mutex_*lock can - enable elision - if the mutex-type and the machine supports it - by - setting the flag PTHREAD_MUTEX_ELISION_NP. This is done concurrently. - Afterwards the lock / unlock functions are using specific elision - code-paths. */ + binary compatibility with static initializers. */ int __kind; -#if __WORDSIZE != 64 - unsigned int __nusers; -#endif -#if __WORDSIZE == 64 - int __spins; +#ifdef __x86_64__ + short __spins; + short __elision; __pthread_list_t __list; # define __PTHREAD_MUTEX_HAVE_PREV 1 #else + unsigned int __nusers; __extension__ union { - int __spins; + struct + { + short __espins; + short __eelision; +# define __spins __elision_data.__espins +# define __elision __elision_data.__eelision + } __elision_data; __pthread_slist_t __list; }; # define __PTHREAD_MUTEX_HAVE_PREV 0 #endif }; -#if __PTHREAD_MUTEX_HAVE_PREV == 1 +#ifdef __x86_64__ # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ - 0, 0, 0, 0, __kind, 0, { 0, 0 } + 0, 0, 0, 0, __kind, 0, 0, { 0, 0 } #else # define __PTHREAD_MUTEX_INITIALIZER(__kind) \ - 0, 0, 0, __kind, 0, { 0 } + 0, 0, 0, __kind, 0, { { 0, 0 } } #endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/struct_rwlock.h b/lib/libc/include/generic-glibc/bits/struct_rwlock.h index e1e54e75bb..863b185dc9 100644 --- a/lib/libc/include/generic-glibc/bits/struct_rwlock.h +++ b/lib/libc/include/generic-glibc/bits/struct_rwlock.h @@ -1,5 +1,6 @@ -/* MIPS internal rwlock struct definitions. +/* x86 internal rwlock struct definitions. Copyright (C) 2019-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -27,45 +28,38 @@ struct __pthread_rwlock_arch_t unsigned int __writers_futex; unsigned int __pad3; unsigned int __pad4; -#if _MIPS_SIM == _ABI64 +#ifdef __x86_64__ int __cur_writer; int __shared; - unsigned long int __pad1; + signed char __rwelision; +# ifdef __ILP32__ + unsigned char __pad1[3]; +# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0 } +# else + unsigned char __pad1[7]; +# define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0, 0, 0, 0, 0 } +# endif unsigned long int __pad2; /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned int __flags; -# else -# if __BYTE_ORDER == __BIG_ENDIAN - unsigned char __pad1; - unsigned char __pad2; - unsigned char __shared; - /* FLAGS must stay at this position in the structure to maintain - binary compatibility. */ - unsigned char __flags; -# else +#else /* __x86_64__ */ /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned char __flags; unsigned char __shared; - unsigned char __pad1; + signed char __rwelision; unsigned char __pad2; -# endif int __cur_writer; #endif }; -#if _MIPS_SIM == _ABI64 +#ifdef __x86_64__ # define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags + 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, __flags #else -# if __BYTE_ORDER == __BIG_ENDIAN -# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 -# else -# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ +# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ 0, 0, 0, 0, 0, 0, __flags, 0, 0, 0, 0 -# endif #endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/sys_errlist.h b/lib/libc/include/generic-glibc/bits/sys_errlist.h deleted file mode 100644 index ae30302397..0000000000 --- a/lib/libc/include/generic-glibc/bits/sys_errlist.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Declare sys_errlist and sys_nerr, or don't. Compatibility (do) version. - Copyright (C) 2002-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _STDIO_H -# error "Never include directly; use instead." -#endif - -/* sys_errlist and sys_nerr are deprecated. Use strerror instead. */ - -#ifdef __USE_MISC -extern int sys_nerr; -extern const char *const sys_errlist[]; -#endif -#ifdef __USE_GNU -extern int _sys_nerr; -extern const char *const _sys_errlist[]; -#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/syscall.h b/lib/libc/include/generic-glibc/bits/syscall.h index a1f9bcb306..561be5ac16 100644 --- a/lib/libc/include/generic-glibc/bits/syscall.h +++ b/lib/libc/include/generic-glibc/bits/syscall.h @@ -1,11 +1,11 @@ /* Generated at libc build time from syscall list. */ -/* The system call list corresponds to kernel 5.4. */ +/* The system call list corresponds to kernel 5.7. */ #ifndef _SYSCALL_H # error "Never use directly; include instead." #endif -#define __GLIBC_LINUX_VERSION_CODE 328704 +#define __GLIBC_LINUX_VERSION_CODE 329472 #ifdef __NR_FAST_atomic_update # define SYS_FAST_atomic_update __NR_FAST_atomic_update @@ -75,6 +75,18 @@ # define SYS_alloc_hugepages __NR_alloc_hugepages #endif +#ifdef __NR_arc_gettls +# define SYS_arc_gettls __NR_arc_gettls +#endif + +#ifdef __NR_arc_settls +# define SYS_arc_settls __NR_arc_settls +#endif + +#ifdef __NR_arc_usr_cmpxchg +# define SYS_arc_usr_cmpxchg __NR_arc_usr_cmpxchg +#endif + #ifdef __NR_arch_prctl # define SYS_arch_prctl __NR_arch_prctl #endif @@ -1079,6 +1091,10 @@ # define SYS_openat __NR_openat #endif +#ifdef __NR_openat2 +# define SYS_openat2 __NR_openat2 +#endif + #ifdef __NR_osf_adjtime # define SYS_osf_adjtime __NR_osf_adjtime #endif @@ -1551,6 +1567,10 @@ # define SYS_personality __NR_personality #endif +#ifdef __NR_pidfd_getfd +# define SYS_pidfd_getfd __NR_pidfd_getfd +#endif + #ifdef __NR_pidfd_open # define SYS_pidfd_open __NR_pidfd_open #endif diff --git a/lib/libc/include/generic-glibc/bits/sysctl.h b/lib/libc/include/generic-glibc/bits/sysctl.h deleted file mode 100644 index d47dd78ea1..0000000000 --- a/lib/libc/include/generic-glibc/bits/sysctl.h +++ /dev/null @@ -1 +0,0 @@ -/* Empty file. */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/syslog-ldbl.h b/lib/libc/include/generic-glibc/bits/syslog-ldbl.h index 8f46907bef..a6527d038f 100644 --- a/lib/libc/include/generic-glibc/bits/syslog-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/syslog-ldbl.h @@ -27,9 +27,9 @@ __LDBL_REDIR_DECL (vsyslog) #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function -__LDBL_REDIR_DECL (__syslog_chk) +__LDBL_REDIR2_DECL (syslog_chk) # ifdef __USE_MISC -__LDBL_REDIR_DECL (__vsyslog_chk) +__LDBL_REDIR2_DECL (vsyslog_chk) # endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/thread-shared-types.h b/lib/libc/include/generic-glibc/bits/thread-shared-types.h index ac0c7f5370..43efbedb1b 100644 --- a/lib/libc/include/generic-glibc/bits/thread-shared-types.h +++ b/lib/libc/include/generic-glibc/bits/thread-shared-types.h @@ -116,4 +116,14 @@ struct __pthread_cond_s unsigned int __g_signals[2]; }; +typedef unsigned int __tss_t; +typedef unsigned long int __thrd_t; + +typedef struct +{ + int __data __ONCE_ALIGNMENT; +} __once_flag; + +#define __ONCE_FLAG_INIT { 0 } + #endif /* _THREAD_SHARED_TYPES_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/timesize.h b/lib/libc/include/generic-glibc/bits/timesize.h index 5260dbb5aa..ae0a502d0d 100644 --- a/lib/libc/include/generic-glibc/bits/timesize.h +++ b/lib/libc/include/generic-glibc/bits/timesize.h @@ -1,4 +1,4 @@ -/* Bit size of the time_t type at glibc build time, general case. +/* Bit size of the time_t type at glibc build time, x86-64 and x32 case. Copyright (C) 2018-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,7 +16,10 @@ License along with the GNU C Library; if not, see . */ -#include - -/* Size in bits of the 'time_t' type of the default ABI. */ -#define __TIMESIZE __WORDSIZE \ No newline at end of file +#if defined __x86_64__ && defined __ILP32__ +/* For x32, time is 64-bit even though word size is 32-bit. */ +# define __TIMESIZE 64 +#else +/* For others, time size is word size. */ +# define __TIMESIZE __WORDSIZE +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/types.h b/lib/libc/include/generic-glibc/bits/types.h index 26fbc0be67..1f37c9eec8 100644 --- a/lib/libc/include/generic-glibc/bits/types.h +++ b/lib/libc/include/generic-glibc/bits/types.h @@ -160,6 +160,7 @@ __STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */ __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ __STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ __STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ +__STD_TYPE __SUSECONDS64_T_TYPE __suseconds64_t; __STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */ __STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */ diff --git a/lib/libc/include/generic-glibc/bits/typesizes.h b/lib/libc/include/generic-glibc/bits/typesizes.h index 571d285ea0..53ae0bd5ef 100644 --- a/lib/libc/include/generic-glibc/bits/typesizes.h +++ b/lib/libc/include/generic-glibc/bits/typesizes.h @@ -1,5 +1,5 @@ -/* bits/typesizes.h -- underlying types for *_t. Generic version. - Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version. + Copyright (C) 2012-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,42 +26,55 @@ /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ +/* X32 kernel interface is 64-bit. */ +#if defined __x86_64__ && defined __ILP32__ +# define __SYSCALL_SLONG_TYPE __SQUAD_TYPE +# define __SYSCALL_ULONG_TYPE __UQUAD_TYPE +#else +# define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +# define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#endif + #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE -#define __INO_T_TYPE __ULONGWORD_TYPE +#define __INO_T_TYPE __SYSCALL_ULONG_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE -#define __NLINK_T_TYPE __UWORD_TYPE -#define __OFF_T_TYPE __SLONGWORD_TYPE +#ifdef __x86_64__ +# define __NLINK_T_TYPE __SYSCALL_ULONG_TYPE +# define __FSWORD_T_TYPE __SYSCALL_SLONG_TYPE +#else +# define __NLINK_T_TYPE __UWORD_TYPE +# define __FSWORD_T_TYPE __SWORD_TYPE +#endif +#define __OFF_T_TYPE __SYSCALL_SLONG_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE -#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM_T_TYPE __SYSCALL_ULONG_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT_T_TYPE __SLONGWORD_TYPE -#define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE -#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE -#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE -#define __FSFILCNT64_T_TYPE __UQUAD_TYPE -#define __FSWORD_T_TYPE __SWORD_TYPE -#define __ID_T_TYPE __U32_TYPE -#define __CLOCK_T_TYPE __SLONGWORD_TYPE -#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT_T_TYPE __SYSCALL_SLONG_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __SYSCALL_ULONG_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __SYSCALL_ULONG_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SYSCALL_SLONG_TYPE +#define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE #define __TIMER_T_TYPE void * -#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE +#define __BLKSIZE_T_TYPE __SYSCALL_SLONG_TYPE #define __FSID_T_TYPE struct { int __val[2]; } #define __SSIZE_T_TYPE __SWORD_TYPE -#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE -#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE -#define __CPU_MASK_TYPE __ULONGWORD_TYPE +#define __CPU_MASK_TYPE __SYSCALL_ULONG_TYPE -#ifdef __LP64__ +#ifdef __x86_64__ /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ @@ -70,19 +83,24 @@ /* Same for ino_t and ino64_t. */ # define __INO_T_MATCHES_INO64_T 1 -/* And for rlim_t and rlim64_t. */ +/* And for __rlim_t and __rlim64_t. */ # define __RLIM_T_MATCHES_RLIM64_T 1 /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ -#define __FD_SETSIZE 1024 +#define __FD_SETSIZE 1024 #endif /* bits/typesizes.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/unistd.h b/lib/libc/include/generic-glibc/bits/unistd.h index 9cad6847f9..729afdf23e 100644 --- a/lib/libc/include/generic-glibc/bits/unistd.h +++ b/lib/libc/include/generic-glibc/bits/unistd.h @@ -21,9 +21,11 @@ #endif extern ssize_t __read_chk (int __fd, void *__buf, size_t __nbytes, - size_t __buflen) __wur; + size_t __buflen) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf, - size_t __nbytes), read) __wur; + size_t __nbytes), read) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (__read_chk_warn, (int __fd, void *__buf, size_t __nbytes, size_t __buflen), __read_chk) @@ -46,15 +48,19 @@ read (int __fd, void *__buf, size_t __nbytes) #ifdef __USE_UNIX98 extern ssize_t __pread_chk (int __fd, void *__buf, size_t __nbytes, - __off_t __offset, size_t __bufsize) __wur; + __off_t __offset, size_t __bufsize) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __pread64_chk (int __fd, void *__buf, size_t __nbytes, - __off64_t __offset, size_t __bufsize) __wur; + __off64_t __offset, size_t __bufsize) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (__pread_alias, (int __fd, void *__buf, size_t __nbytes, - __off_t __offset), pread) __wur; + __off_t __offset), pread) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (__pread64_alias, (int __fd, void *__buf, size_t __nbytes, - __off64_t __offset), pread64) __wur; + __off64_t __offset), pread64) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (__pread_chk_warn, (int __fd, void *__buf, size_t __nbytes, __off_t __offset, size_t __bufsize), __pread_chk) @@ -123,11 +129,11 @@ pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) extern ssize_t __readlink_chk (const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) - __THROW __nonnull ((1, 2)) __wur; + __THROW __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT_NTH (__readlink_alias, (const char *__restrict __path, char *__restrict __buf, size_t __len), readlink) - __nonnull ((1, 2)) __wur; + __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT_NTH (__readlink_chk_warn, (const char *__restrict __path, char *__restrict __buf, size_t __len, @@ -155,12 +161,12 @@ __NTH (readlink (const char *__restrict __path, char *__restrict __buf, extern ssize_t __readlinkat_chk (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) - __THROW __nonnull ((2, 3)) __wur; + __THROW __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4)); extern ssize_t __REDIRECT_NTH (__readlinkat_alias, (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len), readlinkat) - __nonnull ((2, 3)) __wur; + __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4)); extern ssize_t __REDIRECT_NTH (__readlinkat_chk_warn, (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len, @@ -187,9 +193,10 @@ __NTH (readlinkat (int __fd, const char *__restrict __path, #endif extern char *__getcwd_chk (char *__buf, size_t __size, size_t __buflen) - __THROW __wur; + __THROW __wur __attr_access ((__write_only__, 1, 2)); extern char *__REDIRECT_NTH (__getcwd_alias, - (char *__buf, size_t __size), getcwd) __wur; + (char *__buf, size_t __size), getcwd) + __wur __attr_access ((__write_only__, 1, 2)); extern char *__REDIRECT_NTH (__getcwd_chk_warn, (char *__buf, size_t __size, size_t __buflen), __getcwd_chk) @@ -212,7 +219,7 @@ __NTH (getcwd (char *__buf, size_t __size)) #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED extern char *__getwd_chk (char *__buf, size_t buflen) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)) __wur __attr_access ((__write_only__, 1, 2)); extern char *__REDIRECT_NTH (__getwd_warn, (char *__buf), getwd) __nonnull ((1)) __wur __warnattr ("please use getcwd instead, as getwd " "doesn't specify buffer size"); @@ -227,9 +234,11 @@ __NTH (getwd (char *__buf)) #endif extern size_t __confstr_chk (int __name, char *__buf, size_t __len, - size_t __buflen) __THROW; + size_t __buflen) __THROW + __attr_access ((__write_only__, 2, 3)); extern size_t __REDIRECT_NTH (__confstr_alias, (int __name, char *__buf, - size_t __len), confstr); + size_t __len), confstr) + __attr_access ((__write_only__, 2, 3)); extern size_t __REDIRECT_NTH (__confstr_chk_warn, (int __name, char *__buf, size_t __len, size_t __buflen), __confstr_chk) @@ -252,9 +261,9 @@ __NTH (confstr (int __name, char *__buf, size_t __len)) extern int __getgroups_chk (int __size, __gid_t __list[], size_t __listlen) - __THROW __wur; + __THROW __wur __attr_access ((__write_only__, 2, 1)); extern int __REDIRECT_NTH (__getgroups_alias, (int __size, __gid_t __list[]), - getgroups) __wur; + getgroups) __wur __attr_access ((__write_only__, 2, 1)); extern int __REDIRECT_NTH (__getgroups_chk_warn, (int __size, __gid_t __list[], size_t __listlen), __getgroups_chk) @@ -277,7 +286,8 @@ __NTH (getgroups (int __size, __gid_t __list[])) extern int __ttyname_r_chk (int __fd, char *__buf, size_t __buflen, - size_t __nreal) __THROW __nonnull ((2)); + size_t __nreal) __THROW __nonnull ((2)) + __attr_access ((__write_only__, 2, 3)); extern int __REDIRECT_NTH (__ttyname_r_alias, (int __fd, char *__buf, size_t __buflen), ttyname_r) __nonnull ((2)); @@ -304,7 +314,7 @@ __NTH (ttyname_r (int __fd, char *__buf, size_t __buflen)) #ifdef __USE_POSIX199506 extern int __getlogin_r_chk (char *__buf, size_t __buflen, size_t __nreal) - __nonnull ((1)); + __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); extern int __REDIRECT (__getlogin_r_alias, (char *__buf, size_t __buflen), getlogin_r) __nonnull ((1)); extern int __REDIRECT (__getlogin_r_chk_warn, @@ -331,9 +341,10 @@ getlogin_r (char *__buf, size_t __buflen) #if defined __USE_MISC || defined __USE_UNIX98 extern int __gethostname_chk (char *__buf, size_t __buflen, size_t __nreal) - __THROW __nonnull ((1)); + __THROW __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); extern int __REDIRECT_NTH (__gethostname_alias, (char *__buf, size_t __buflen), - gethostname) __nonnull ((1)); + gethostname) + __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); extern int __REDIRECT_NTH (__gethostname_chk_warn, (char *__buf, size_t __buflen, size_t __nreal), __gethostname_chk) @@ -358,10 +369,11 @@ __NTH (gethostname (char *__buf, size_t __buflen)) #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_UNIX98) extern int __getdomainname_chk (char *__buf, size_t __buflen, size_t __nreal) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)) __wur __attr_access ((__write_only__, 1, 2)); extern int __REDIRECT_NTH (__getdomainname_alias, (char *__buf, size_t __buflen), - getdomainname) __nonnull ((1)) __wur; + getdomainname) __nonnull ((1)) + __wur __attr_access ((__write_only__, 1, 2)); extern int __REDIRECT_NTH (__getdomainname_chk_warn, (char *__buf, size_t __buflen, size_t __nreal), __getdomainname_chk) diff --git a/lib/libc/include/generic-glibc/bits/wchar-ldbl.h b/lib/libc/include/generic-glibc/bits/wchar-ldbl.h index 3ded0fb11c..7067a9c3e3 100644 --- a/lib/libc/include/generic-glibc/bits/wchar-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/wchar-ldbl.h @@ -28,9 +28,17 @@ __LDBL_REDIR_DECL (vfwprintf); __LDBL_REDIR_DECL (vwprintf); __LDBL_REDIR_DECL (vswprintf); # if !__GLIBC_USE (DEPRECATED_SCANF) +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc99_fwscanf) __LDBL_REDIR1_DECL (wscanf, __nldbl___isoc99_wscanf) __LDBL_REDIR1_DECL (swscanf, __nldbl___isoc99_swscanf) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (fwscanf, __isoc99_fwscanfieee128) +__LDBL_REDIR1_DECL (wscanf, __isoc99_wscanfieee128) +__LDBL_REDIR1_DECL (swscanf, __isoc99_swscanfieee128) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif # else __LDBL_REDIR_DECL (fwscanf); __LDBL_REDIR_DECL (wscanf); @@ -39,11 +47,23 @@ __LDBL_REDIR_DECL (swscanf); #endif #ifdef __USE_ISOC99 +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (wcstold, wcstod); +# else +__LDBL_REDIR1_DECL (wcstold, __wcstoieee128) +# endif # if !__GLIBC_USE (DEPRECATED_SCANF) +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc99_vfwscanf) __LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc99_vwscanf) __LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc99_vswscanf) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (vfwscanf, __isoc99_vfwscanfieee128) +__LDBL_REDIR1_DECL (vwscanf, __isoc99_vwscanfieee128) +__LDBL_REDIR1_DECL (vswscanf, __isoc99_vswscanfieee128) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif # else __LDBL_REDIR_DECL (vfwscanf); __LDBL_REDIR_DECL (vwscanf); @@ -52,16 +72,20 @@ __LDBL_REDIR_DECL (vswscanf); #endif #ifdef __USE_GNU +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (wcstold_l, wcstod_l); +# else +__LDBL_REDIR1_DECL (wcstold_l, __wcstoieee128_l) +# endif #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function -__LDBL_REDIR_DECL (__swprintf_chk) -__LDBL_REDIR_DECL (__vswprintf_chk) +__LDBL_REDIR2_DECL (swprintf_chk) +__LDBL_REDIR2_DECL (vswprintf_chk) # if __USE_FORTIFY_LEVEL > 1 -__LDBL_REDIR_DECL (__fwprintf_chk) -__LDBL_REDIR_DECL (__wprintf_chk) -__LDBL_REDIR_DECL (__vfwprintf_chk) -__LDBL_REDIR_DECL (__vwprintf_chk) +__LDBL_REDIR2_DECL (fwprintf_chk) +__LDBL_REDIR2_DECL (wprintf_chk) +__LDBL_REDIR2_DECL (vfwprintf_chk) +__LDBL_REDIR2_DECL (vwprintf_chk) # endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/wordsize.h b/lib/libc/include/generic-glibc/bits/wordsize.h index d5ed6b4522..0bf84a4e99 100644 --- a/lib/libc/include/generic-glibc/bits/wordsize.h +++ b/lib/libc/include/generic-glibc/bits/wordsize.h @@ -1,31 +1,17 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. +/* Determine the wordsize from the preprocessor defines. */ - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include - -#define __WORDSIZE _MIPS_SZPTR - -#if _MIPS_SIM == _ABI64 -# define __WORDSIZE_TIME64_COMPAT32 1 +#if defined __x86_64__ && !defined __ILP32__ +# define __WORDSIZE 64 #else -# define __WORDSIZE_TIME64_COMPAT32 0 -#endif - -#if __WORDSIZE == 32 +# define __WORDSIZE 32 #define __WORDSIZE32_SIZE_ULONG 0 #define __WORDSIZE32_PTRDIFF_LONG 0 +#endif + +#ifdef __x86_64__ +# define __WORDSIZE_TIME64_COMPAT32 1 +/* Both x86-64 and x32 use the 64-bit system call interface. */ +# define __SYSCALL_WORDSIZE 64 +#else +# define __WORDSIZE_TIME64_COMPAT32 0 #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/complex.h b/lib/libc/include/generic-glibc/complex.h index 3a3de87d1e..9510f64101 100644 --- a/lib/libc/include/generic-glibc/complex.h +++ b/lib/libc/include/generic-glibc/complex.h @@ -95,11 +95,15 @@ __BEGIN_DECLS #define __MATHCALL(function, args) \ __MATHDECL (_Mdouble_complex_,function, args) -#define __MATHDECL(type, function, args) \ +#define __MATHDECL_IMPL(type, function, args) \ __MATHDECL_1(type, function, args); \ __MATHDECL_1(type, __CONCAT(__,function), args) -#define __MATHDECL_1(type, function, args) \ +#define __MATHDECL(type, function, args) \ + __MATHDECL_IMPL(type, function, args) +#define __MATHDECL_1_IMPL(type, function, args) \ extern type __MATH_PRECNAME(function) args __THROW +#define __MATHDECL_1(type, function, args) \ + __MATHDECL_1_IMPL(type, function, args) #define _Mdouble_ double #define __MATH_PRECNAME(name) name @@ -122,11 +126,31 @@ __BEGIN_DECLS # undef __MATHDECL_1 # define __MATHDECL_1(type, function, args) \ extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, function) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# undef __MATHDECL_1 +# undef __MATHDECL +# define __REDIR_TO(function) \ + __ ## function ## ieee128 +# define __MATHDECL_1(type, function, alias, args) \ + extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, alias) +#define __MATHDECL(type, function, args) \ + __MATHDECL_1(type, function, __REDIR_TO(function), args); \ + __MATHDECL_1(type, __CONCAT(__,function), __REDIR_TO(function), args) # endif # define _Mdouble_ long double # define __MATH_PRECNAME(name) name##l # include +# if defined __LDBL_COMPAT \ + || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# undef __REDIR_TO +# undef __MATHDECL_1 +# undef __MATHDECL +#define __MATHDECL(type, function, args) \ + __MATHDECL_IMPL(type, function, args) +# define __MATHDECL_1(type, function, args) \ + __MATHDECL_1_IMPL(type, function, args) +# endif #endif #undef _Mdouble_ #undef __MATH_PRECNAME @@ -215,6 +239,7 @@ __BEGIN_DECLS # undef _Mdouble_complex_ #endif +#undef __MATHDECL_1_IMPL #undef __MATHDECL_1 #undef __MATHDECL #undef __MATHCALL diff --git a/lib/libc/include/generic-glibc/elf.h b/lib/libc/include/generic-glibc/elf.h index de9cf6e57a..58b7bc8e2b 100644 --- a/lib/libc/include/generic-glibc/elf.h +++ b/lib/libc/include/generic-glibc/elf.h @@ -330,7 +330,7 @@ typedef struct #define EM_CLOUDSHIELD 192 /* CloudShield */ #define EM_COREA_1ST 193 /* KIPO-KAIST Core-A 1st gen. */ #define EM_COREA_2ND 194 /* KIPO-KAIST Core-A 2nd gen. */ -#define EM_ARC_COMPACT2 195 /* Synopsys ARCompact V2 */ +#define EM_ARCV2 195 /* Synopsys ARCv2 ISA. */ #define EM_OPEN8 196 /* Open8 RISC */ #define EM_RL78 197 /* Renesas RL78 */ #define EM_VIDEOCORE5 198 /* Broadcom VideoCore V */ @@ -721,6 +721,7 @@ typedef struct #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */ #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */ +#define PT_GNU_PROPERTY 0x6474e553 /* GNU property */ #define PT_LOSUNW 0x6ffffffa #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */ @@ -1318,6 +1319,12 @@ typedef struct /* Application-specific semantics, hi */ #define GNU_PROPERTY_HIUSER 0xffffffff +/* AArch64 specific GNU properties. */ +#define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000 + +#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0) +#define GNU_PROPERTY_AARCH64_FEATURE_1_PAC (1U << 1) + /* The x86 instruction sets indicated by the corresponding bits are used in program. Their support in the hardware is optional. */ #define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000 @@ -3946,8 +3953,9 @@ enum #define R_RISCV_SET16 55 #define R_RISCV_SET32 56 #define R_RISCV_32_PCREL 57 +#define R_RISCV_IRELATIVE 58 -#define R_RISCV_NUM 58 +#define R_RISCV_NUM 59 /* BPF specific declarations. */ @@ -4027,6 +4035,74 @@ enum #define R_NDS32_TLS_TPOFF 102 #define R_NDS32_TLS_DESC 119 +/* ARCompact/ARCv2 specific relocs. */ +#define R_ARC_NONE 0x0 +#define R_ARC_8 0x1 +#define R_ARC_16 0x2 +#define R_ARC_24 0x3 +#define R_ARC_32 0x4 +#define R_ARC_B26 0x5 +#define R_ARC_B22_PCREL 0x6 +#define R_ARC_H30 0x7 +#define R_ARC_N8 0x8 +#define R_ARC_N16 0x9 +#define R_ARC_N24 0xA +#define R_ARC_N32 0xB +#define R_ARC_SDA 0xC +#define R_ARC_SECTOFF 0xD +#define R_ARC_S21H_PCREL 0xE +#define R_ARC_S21W_PCREL 0xF +#define R_ARC_S25H_PCREL 0x10 +#define R_ARC_S25W_PCREL 0x11 +#define R_ARC_SDA32 0x12 +#define R_ARC_SDA_LDST 0x13 +#define R_ARC_SDA_LDST1 0x14 +#define R_ARC_SDA_LDST2 0x15 +#define R_ARC_SDA16_LD 0x16 +#define R_ARC_SDA16_LD1 0x17 +#define R_ARC_SDA16_LD2 0x18 +#define R_ARC_S13_PCREL 0x19 +#define R_ARC_W 0x1A +#define R_ARC_32_ME 0x1B +#define R_ARC_N32_ME 0x1C +#define R_ARC_SECTOFF_ME 0x1D +#define R_ARC_SDA32_ME 0x1E +#define R_ARC_W_ME 0x1F +#define R_ARC_H30_ME 0x20 +#define R_ARC_SECTOFF_U8 0x21 +#define R_ARC_SECTOFF_S9 0x22 +#define R_AC_SECTOFF_U8 0x23 +#define R_AC_SECTOFF_U8_1 0x24 +#define R_AC_SECTOFF_U8_2 0x25 +#define R_AC_SECTOFF_S9 0x26 +#define R_AC_SECTOFF_S9_1 0x27 +#define R_AC_SECTOFF_S9_2 0x28 +#define R_ARC_SECTOFF_ME_1 0x29 +#define R_ARC_SECTOFF_ME_2 0x2A +#define R_ARC_SECTOFF_1 0x2B +#define R_ARC_SECTOFF_2 0x2C +#define R_ARC_PC32 0x32 +#define R_ARC_GOTPC32 0x33 +#define R_ARC_PLT32 0x34 +#define R_ARC_COPY 0x35 +#define R_ARC_GLOB_DAT 0x36 +#define R_ARC_JUMP_SLOT 0x37 +#define R_ARC_RELATIVE 0x38 +#define R_ARC_GOTOFF 0x39 +#define R_ARC_GOTPC 0x3A +#define R_ARC_GOT32 0x3B + +#define R_ARC_TLS_DTPMOD 0x42 +#define R_ARC_TLS_DTPOFF 0x43 +#define R_ARC_TLS_TPOFF 0x44 +#define R_ARC_TLS_GD_GOT 0x45 +#define R_ARC_TLS_GD_LD 0x46 +#define R_ARC_TLS_GD_CALL 0x47 +#define R_ARC_TLS_IE_GOT 0x48 +#define R_ARC_TLS_DTPOFF_S9 0x4a +#define R_ARC_TLS_LE_S9 0x4a +#define R_ARC_TLS_LE_32 0x4b + __END_DECLS #endif /* elf.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/err.h b/lib/libc/include/generic-glibc/err.h index 90cb060734..f505f646b2 100644 --- a/lib/libc/include/generic-glibc/err.h +++ b/lib/libc/include/generic-glibc/err.h @@ -52,7 +52,8 @@ extern void errx (int __status, const char *__format, ...) extern void verrx (int __status, const char *, __gnuc_va_list) __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); -#ifdef __LDBL_COMPAT +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/generic-glibc/error.h b/lib/libc/include/generic-glibc/error.h index fa22157daf..dfd1623e1a 100644 --- a/lib/libc/include/generic-glibc/error.h +++ b/lib/libc/include/generic-glibc/error.h @@ -47,11 +47,13 @@ extern unsigned int error_message_count; variable controls whether this mode is selected or not. */ extern int error_one_per_line; -#ifdef __LDBL_COMPAT +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #else /* Do not inline error and error_at_line when long double has the same - size of double, because that would invalidate the redirections to the + size of double, nor when long double reuses the float128 + implementation, because that would invalidate the redirections to the compatibility functions. */ # if defined __extern_always_inline && defined __va_arg_pack # include diff --git a/lib/libc/include/generic-glibc/features.h b/lib/libc/include/generic-glibc/features.h index 21e01848fa..ed3e1cd728 100644 --- a/lib/libc/include/generic-glibc/features.h +++ b/lib/libc/include/generic-glibc/features.h @@ -454,7 +454,7 @@ /* Major and minor version number of the GNU C library package. Use these macros to test for features in specific releases. */ #define __GLIBC__ 2 -#define __GLIBC_MINOR__ 31 +#define __GLIBC_MINOR__ 32 #define __GLIBC_PREREQ(maj, min) \ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) diff --git a/lib/libc/include/generic-glibc/fenv.h b/lib/libc/include/generic-glibc/fenv.h index 0df8e06d17..833583f5b9 100644 --- a/lib/libc/include/generic-glibc/fenv.h +++ b/lib/libc/include/generic-glibc/fenv.h @@ -140,10 +140,6 @@ extern int fegetmode (femode_t *__modep) __THROW; extern int fesetmode (const femode_t *__modep) __THROW; #endif -/* Include optimization. */ -#ifdef __OPTIMIZE__ -# include -#endif /* NaN support. */ diff --git a/lib/libc/include/generic-glibc/finclude/math-vector-fortran.h b/lib/libc/include/generic-glibc/finclude/math-vector-fortran.h index d348de2ba8..c56f5fc16f 100644 --- a/lib/libc/include/generic-glibc/finclude/math-vector-fortran.h +++ b/lib/libc/include/generic-glibc/finclude/math-vector-fortran.h @@ -16,4 +16,28 @@ ! License along with the GNU C Library; if not, see ! . -! No SIMD math functions are available for this platform. \ No newline at end of file +!GCC$ builtin (cos) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (cosf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (sin) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (sinf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (sincos) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (sincosf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (log) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (logf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (exp) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (expf) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (pow) attributes simd (notinbranch) if('x86_64') +!GCC$ builtin (powf) attributes simd (notinbranch) if('x86_64') + +!GCC$ builtin (cos) attributes simd (notinbranch) if('x32') +!GCC$ builtin (cosf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (sin) attributes simd (notinbranch) if('x32') +!GCC$ builtin (sinf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (sincos) attributes simd (notinbranch) if('x32') +!GCC$ builtin (sincosf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (log) attributes simd (notinbranch) if('x32') +!GCC$ builtin (logf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (exp) attributes simd (notinbranch) if('x32') +!GCC$ builtin (expf) attributes simd (notinbranch) if('x32') +!GCC$ builtin (pow) attributes simd (notinbranch) if('x32') +!GCC$ builtin (powf) attributes simd (notinbranch) if('x32') \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/fpu_control.h b/lib/libc/include/generic-glibc/fpu_control.h index d5aa21113b..fa0a861923 100644 --- a/lib/libc/include/generic-glibc/fpu_control.h +++ b/lib/libc/include/generic-glibc/fpu_control.h @@ -1,6 +1,7 @@ -/* FPU control word bits. Mips version. - Copyright (C) 1996-2020 Free Software Foundation, Inc. +/* FPU control word bits. x86 version. + Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. + Contributed by Olaf Flebbe. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -13,120 +14,96 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _FPU_CONTROL_H -#define _FPU_CONTROL_H +#define _FPU_CONTROL_H 1 -/* MIPS FPU floating point control register bits. +/* Note that this file sets on x86-64 only the x87 FPU, it does not + touch the SSE unit. */ + +/* Here is the dirty part. Set up your 387 through the control word + * (cw) register. * - * 31-25 -> floating point conditions code bits 7-1. These bits are only - * available in MIPS IV. - * 24 -> flush denormalized results to zero instead of - * causing unimplemented operation exception. This bit is only - * available for MIPS III and newer. - * 23 -> Condition bit - * 22-21 -> reserved for architecture implementers - * 20 -> reserved (read as 0, write with 0) - * 19 -> IEEE 754-2008 non-arithmetic ABS.fmt and NEG.fmt enable - * 18 -> IEEE 754-2008 recommended NaN encoding enable - * 17 -> cause bit for unimplemented operation - * 16 -> cause bit for invalid exception - * 15 -> cause bit for division by zero exception - * 14 -> cause bit for overflow exception - * 13 -> cause bit for underflow exception - * 12 -> cause bit for inexact exception - * 11 -> enable exception for invalid exception - * 10 -> enable exception for division by zero exception - * 9 -> enable exception for overflow exception - * 8 -> enable exception for underflow exception - * 7 -> enable exception for inexact exception - * 6 -> flag invalid exception - * 5 -> flag division by zero exception - * 4 -> flag overflow exception - * 3 -> flag underflow exception - * 2 -> flag inexact exception - * 1-0 -> rounding control + * 15-13 12 11-10 9-8 7-6 5 4 3 2 1 0 + * | reserved | IC | RC | PC | reserved | PM | UM | OM | ZM | DM | IM * + * IM: Invalid operation mask + * DM: Denormalized operand mask + * ZM: Zero-divide mask + * OM: Overflow mask + * UM: Underflow mask + * PM: Precision (inexact result) mask * - * Rounding Control: - * 00 - rounding to nearest (RN) - * 01 - rounding toward zero (RZ) - * 10 - rounding (up) toward plus infinity (RP) - * 11 - rounding (down)toward minus infinity (RM) + * Mask bit is 1 means no interrupt. + * + * PC: Precision control + * 11 - round to extended precision + * 10 - round to double precision + * 00 - round to single precision + * + * RC: Rounding control + * 00 - rounding to nearest + * 01 - rounding down (toward - infinity) + * 10 - rounding up (toward + infinity) + * 11 - rounding toward zero + * + * IC: Infinity control + * That is for 8087 and 80287 only. + * + * The hardware default is 0x037f which we use. */ #include -#ifdef __mips_soft_float +/* masking of interrupts */ +#define _FPU_MASK_IM 0x01 +#define _FPU_MASK_DM 0x02 +#define _FPU_MASK_ZM 0x04 +#define _FPU_MASK_OM 0x08 +#define _FPU_MASK_UM 0x10 +#define _FPU_MASK_PM 0x20 -#define _FPU_RESERVED 0xffffffff -#define _FPU_DEFAULT 0x00000000 -typedef unsigned int fpu_control_t; -#define _FPU_GETCW(cw) (cw) = 0 -#define _FPU_SETCW(cw) (void) (cw) -extern fpu_control_t __fpu_control; +/* precision control */ +#define _FPU_EXTENDED 0x300 /* libm requires double extended precision. */ +#define _FPU_DOUBLE 0x200 +#define _FPU_SINGLE 0x0 -#else /* __mips_soft_float */ +/* rounding control */ +#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */ +#define _FPU_RC_DOWN 0x400 +#define _FPU_RC_UP 0x800 +#define _FPU_RC_ZERO 0xC00 -/* Masks for interrupts. */ -#define _FPU_MASK_V 0x0800 /* Invalid operation */ -#define _FPU_MASK_Z 0x0400 /* Division by zero */ -#define _FPU_MASK_O 0x0200 /* Overflow */ -#define _FPU_MASK_U 0x0100 /* Underflow */ -#define _FPU_MASK_I 0x0080 /* Inexact operation */ - -/* Flush denormalized numbers to zero. */ -#define _FPU_FLUSH_TZ 0x1000000 - -/* IEEE 754-2008 compliance control. */ -#define _FPU_ABS2008 0x80000 -#define _FPU_NAN2008 0x40000 - -/* Rounding control. */ -#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */ -#define _FPU_RC_ZERO 0x1 -#define _FPU_RC_UP 0x2 -#define _FPU_RC_DOWN 0x3 -/* Mask for rounding control. */ -#define _FPU_RC_MASK 0x3 - -#define _FPU_RESERVED 0xfe8c0000 /* Reserved bits in cw, incl ABS/NAN2008. */ +#define _FPU_RESERVED 0xF0C0 /* Reserved bits in cw */ /* The fdlibm code requires strict IEEE double precision arithmetic, and no interrupts for exceptions, rounding to nearest. */ -#ifdef __mips_nan2008 -# define _FPU_DEFAULT 0x000C0000 -#else -# define _FPU_DEFAULT 0x00000000 -#endif -/* IEEE: same as above, but exceptions. */ -#ifdef __mips_nan2008 -# define _FPU_IEEE 0x000C0F80 -#else -# define _FPU_IEEE 0x00000F80 -#endif +#define _FPU_DEFAULT 0x037f + +/* IEEE: same as above. */ +#define _FPU_IEEE 0x037f /* Type of the control word. */ -typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__))); +typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__))); -/* Macros for accessing the hardware control word. */ -extern fpu_control_t __mips_fpu_getcw (void) __THROW; -extern void __mips_fpu_setcw (fpu_control_t) __THROW; -#ifdef __mips16 -# define _FPU_GETCW(cw) do { (cw) = __mips_fpu_getcw (); } while (0) -# define _FPU_SETCW(cw) __mips_fpu_setcw (cw) -#else -# define _FPU_GETCW(cw) __asm__ volatile ("cfc1 %0,$31" : "=r" (cw)) -# define _FPU_SETCW(cw) __asm__ volatile ("ctc1 %0,$31" : : "r" (cw)) -#endif +/* Macros for accessing the hardware control word. "*&" is used to + work around a bug in older versions of GCC. __volatile__ is used + to support combination of writing the control register and reading + it back. Without __volatile__, the old value may be used for reading + back under compiler optimization. + + Note that the use of these macros is not sufficient anymore with + recent hardware nor on x86-64. Some floating point operations are + executed in the SSE/SSE2 engines which have their own control and + status register. */ +#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw)) +#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw)) /* Default control word set at startup. */ extern fpu_control_t __fpu_control; -#endif /* __mips_soft_float */ - #endif /* fpu_control.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-32.h b/lib/libc/include/generic-glibc/gnu/lib-names-32.h index 910a12d444..3e05ce280d 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-32.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-32.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-hard.h index 9c4e7c164e..dd2cb9fb78 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-hard.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h index d6c1d96f7e..4ec7514060 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h @@ -19,8 +19,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h index b5af4b1542..1f8eed349b 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h @@ -19,8 +19,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h index 4746766acf..8a3a04cb2d 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h @@ -19,8 +19,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-soft.h b/lib/libc/include/generic-glibc/gnu/lib-names-soft.h index 14dc0082b0..3c3e1769fa 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-soft.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-soft.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/generic-glibc/gnu/lib-names.h b/lib/libc/include/generic-glibc/gnu/lib-names.h index fcfc96cef1..aafc03bf7e 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names.h @@ -4,43 +4,14 @@ #ifndef __GNU_LIB_NAMES_H #define __GNU_LIB_NAMES_H 1 -#include - -#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include +#if !defined __x86_64__ +# include #endif -#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include +#if defined __x86_64__ && defined __LP64__ +# include #endif -#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include +#if defined __x86_64__ && defined __ILP32__ +# include #endif #endif /* gnu/lib-names.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-32.h b/lib/libc/include/generic-glibc/gnu/stubs-32.h index 12c0d956e8..636dc73283 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-32.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-32.h @@ -10,9 +10,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-64.h b/lib/libc/include/generic-glibc/gnu/stubs-64.h deleted file mode 100644 index 12c0d956e8..0000000000 --- a/lib/libc/include/generic-glibc/gnu/stubs-64.h +++ /dev/null @@ -1,18 +0,0 @@ -/* This file is automatically generated. - It defines a symbol `__stub_FUNCTION' for each function - in the C library which is a stub, meaning it will fail - every time called, usually setting errno to ENOSYS. */ - -#ifdef _LIBC - #error Applications may not define the macro _LIBC -#endif - -#define __stub_chflags -#define __stub_fchflags -#define __stub_gtty -#define __stub_lchmod -#define __stub_revoke -#define __stub_setlogin -#define __stub_sigreturn -#define __stub_sstk -#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-hard.h b/lib/libc/include/generic-glibc/gnu/stubs-hard.h index add0d4871d..013aed511c 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-hard.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-hard.h @@ -13,9 +13,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-n32_hard.h b/lib/libc/include/generic-glibc/gnu/stubs-n32_hard.h index d4c69865ed..186070157a 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-n32_hard.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-n32_hard.h @@ -12,9 +12,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-n64_hard.h b/lib/libc/include/generic-glibc/gnu/stubs-n64_hard.h index d4c69865ed..186070157a 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-n64_hard.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-n64_hard.h @@ -12,9 +12,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-o32_hard.h b/lib/libc/include/generic-glibc/gnu/stubs-o32_hard.h index 12c0d956e8..636dc73283 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-o32_hard.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-o32_hard.h @@ -10,9 +10,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-soft.h b/lib/libc/include/generic-glibc/gnu/stubs-soft.h index add0d4871d..013aed511c 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs-soft.h +++ b/lib/libc/include/generic-glibc/gnu/stubs-soft.h @@ -13,9 +13,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs.h b/lib/libc/include/generic-glibc/gnu/stubs.h index 96ececfa31..a4c9b5f097 100644 --- a/lib/libc/include/generic-glibc/gnu/stubs.h +++ b/lib/libc/include/generic-glibc/gnu/stubs.h @@ -2,41 +2,13 @@ This file selects the right generated file of `__stub_FUNCTION' macros based on the architecture being compiled for. */ -#include -#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include +#if !defined __x86_64__ +# include #endif -#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include +#if defined __x86_64__ && defined __LP64__ +# include #endif -#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include -#endif -#if !defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_soft_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include -#endif -#if defined(__mips_nan2008) && defined(__mips_hard_float) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# include +#if defined __x86_64__ && defined __ILP32__ +# include #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/inttypes.h b/lib/libc/include/generic-glibc/inttypes.h index 61b4464bb3..7734ebce74 100644 --- a/lib/libc/include/generic-glibc/inttypes.h +++ b/lib/libc/include/generic-glibc/inttypes.h @@ -321,10 +321,10 @@ extern long int __strtol_internal (const char *__restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (strtoimax (const char *__restrict nptr, char **__restrict endptr, - int base)) +__NTH (strtoimax (const char *__restrict __nptr, char **__restrict __endptr, + int __base)) { - return __strtol_internal (nptr, endptr, base, 0); + return __strtol_internal (__nptr, __endptr, __base, 0); } extern unsigned long int __strtoul_internal (const char *__restrict __nptr, @@ -333,10 +333,10 @@ extern unsigned long int __strtoul_internal (const char *__restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (strtoumax (const char *__restrict nptr, char **__restrict endptr, - int base)) +__NTH (strtoumax (const char *__restrict __nptr, char **__restrict __endptr, + int __base)) { - return __strtoul_internal (nptr, endptr, base, 0); + return __strtoul_internal (__nptr, __endptr, __base, 0); } extern long int __wcstol_internal (const __gwchar_t * __restrict __nptr, @@ -345,10 +345,10 @@ extern long int __wcstol_internal (const __gwchar_t * __restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (wcstoimax (const __gwchar_t *__restrict nptr, - __gwchar_t **__restrict endptr, int base)) +__NTH (wcstoimax (const __gwchar_t *__restrict __nptr, + __gwchar_t **__restrict __endptr, int __base)) { - return __wcstol_internal (nptr, endptr, base, 0); + return __wcstol_internal (__nptr, __endptr, __base, 0); } extern unsigned long int __wcstoul_internal (const __gwchar_t * @@ -359,10 +359,10 @@ extern unsigned long int __wcstoul_internal (const __gwchar_t * __THROW __nonnull ((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (wcstoumax (const __gwchar_t *__restrict nptr, - __gwchar_t **__restrict endptr, int base)) +__NTH (wcstoumax (const __gwchar_t *__restrict __nptr, + __gwchar_t **__restrict __endptr, int __base)) { - return __wcstoul_internal (nptr, endptr, base, 0); + return __wcstoul_internal (__nptr, __endptr, __base, 0); } # else /* __WORDSIZE == 32 */ @@ -374,10 +374,10 @@ extern long long int __strtoll_internal (const char *__restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (strtoimax (const char *__restrict nptr, char **__restrict endptr, - int base)) +__NTH (strtoimax (const char *__restrict __nptr, char **__restrict __endptr, + int __base)) { - return __strtoll_internal (nptr, endptr, base, 0); + return __strtoll_internal (__nptr, __endptr, __base, 0); } __extension__ @@ -390,10 +390,10 @@ extern unsigned long long int __strtoull_internal (const char * __THROW __nonnull ((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (strtoumax (const char *__restrict nptr, char **__restrict endptr, - int base)) +__NTH (strtoumax (const char *__restrict __nptr, char **__restrict __endptr, + int __base)) { - return __strtoull_internal (nptr, endptr, base, 0); + return __strtoull_internal (__nptr, __endptr, __base, 0); } __extension__ @@ -403,10 +403,10 @@ extern long long int __wcstoll_internal (const __gwchar_t *__restrict __nptr, __THROW __nonnull ((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (wcstoimax (const __gwchar_t *__restrict nptr, - __gwchar_t **__restrict endptr, int base)) +__NTH (wcstoimax (const __gwchar_t *__restrict __nptr, + __gwchar_t **__restrict __endptr, int __base)) { - return __wcstoll_internal (nptr, endptr, base, 0); + return __wcstoll_internal (__nptr, __endptr, __base, 0); } @@ -420,10 +420,10 @@ extern unsigned long long int __wcstoull_internal (const __gwchar_t * __THROW __nonnull ((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (wcstoumax (const __gwchar_t *__restrict nptr, - __gwchar_t **__restrict endptr, int base)) +__NTH (wcstoumax (const __gwchar_t *__restrict __nptr, + __gwchar_t **__restrict __endptr, int __base)) { - return __wcstoull_internal (nptr, endptr, base, 0); + return __wcstoull_internal (__nptr, __endptr, __base, 0); } # endif /* __WORDSIZE == 32 */ diff --git a/lib/libc/include/generic-glibc/malloc.h b/lib/libc/include/generic-glibc/malloc.h index ebddb55e58..fd73ea1c79 100644 --- a/lib/libc/include/generic-glibc/malloc.h +++ b/lib/libc/include/generic-glibc/malloc.h @@ -75,11 +75,11 @@ extern void *pvalloc (size_t __size) __THROW __attribute_malloc__ __wur; /* Underlying allocation function; successive calls should return contiguous pieces of memory. */ -extern void *(*__morecore) (ptrdiff_t __size); +extern void *(*__morecore) (ptrdiff_t __size) __MALLOC_DEPRECATED; /* Default value of `__morecore'. */ extern void *__default_morecore (ptrdiff_t __size) -__THROW __attribute_malloc__; +__THROW __attribute_malloc__ __MALLOC_DEPRECATED; /* SVID2/XPG mallinfo structure */ @@ -156,7 +156,8 @@ extern void *(*__MALLOC_HOOK_VOLATILE __memalign_hook)(size_t __alignment, size_t __size, const void *) __MALLOC_DEPRECATED; -extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void); +extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void) + __MALLOC_DEPRECATED; __END_DECLS diff --git a/lib/libc/include/generic-glibc/math.h b/lib/libc/include/generic-glibc/math.h index 9b3f228199..1956311cb8 100644 --- a/lib/libc/include/generic-glibc/math.h +++ b/lib/libc/include/generic-glibc/math.h @@ -279,8 +279,17 @@ enum #define __MATHDECLX(type, function,suffix, args, attrib) \ __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib) -#define __MATHDECL_1(type, function,suffix, args) \ +#define __MATHDECL_1_IMPL(type, function, suffix, args) \ extern type __MATH_PRECNAME(function,suffix) args __THROW +#define __MATHDECL_1(type, function, suffix, args) \ + __MATHDECL_1_IMPL(type, function, suffix, args) +/* Ignore the alias by default. The alias is only useful with + redirections. */ +#define __MATHDECL_ALIAS(type, function, suffix, args, alias) \ + __MATHDECL_1(type, function, suffix, args) + +#define __MATHREDIR(type, function, suffix, args, to) \ + extern type __REDIRECT_NTH (__MATH_PRECNAME (function, suffix), args, to) #define _Mdouble_ double #define __MATH_PRECNAME(name,r) __CONCAT(name,r) @@ -331,11 +340,37 @@ extern long double __REDIRECT_NTH (nexttowardl, # endif # undef __MATHDECL_1 -# define __MATHDECL_2(type, function,suffix, args, alias) \ - extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \ - args, alias) # define __MATHDECL_1(type, function,suffix, args) \ - __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix)) + __MATHREDIR(type, function, suffix, args, __CONCAT(function,suffix)) + +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# ifdef __REDIRECT_NTH +# ifdef __USE_ISOC99 +extern float __REDIRECT_NTH (nexttowardf, (float __x, long double __y), + __nexttowardf_to_ieee128) + __attribute__ ((__const__)); +extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), + __nexttoward_to_ieee128) + __attribute__ ((__const__)); + +#define __dremieee128 __remainderieee128 +#define __gammaieee128 __lgammaieee128 + +# endif +# endif + +# undef __MATHDECL_1 +# undef __MATHDECL_ALIAS + +# define __REDIRTO(function, suffix) \ + __ ## function ## ieee128 ## suffix +# define __REDIRTO_ALT(function, suffix) \ + __ ## function ## f128 ## suffix + +# define __MATHDECL_1(type, function, suffix, args) \ + __MATHREDIR (type, function, suffix, args, __REDIRTO (function, suffix)) +# define __MATHDECL_ALIAS(type, function, suffix, args, alias) \ + __MATHREDIR (type, function, suffix, args, __REDIRTO_ALT (alias, suffix)) # endif /* Include the file of declarations again, this time using `long double' @@ -348,11 +383,23 @@ extern long double __REDIRECT_NTH (nexttowardl, # define __MATH_DECLARE_LDOUBLE 1 # include # include + # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN +# if defined __LDBL_COMPAT \ + || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# undef __REDIRTO +# undef __REDIRTO_ALT +# undef __MATHDECL_1 +# undef __MATHDECL_ALIAS +# define __MATHDECL_1(type, function, suffix, args) \ + __MATHDECL_1_IMPL(type, function, suffix, args) +# define __MATHDECL_ALIAS(type, function, suffix, args, alias) \ + __MATHDECL_1(type, function, suffix, args) +# endif # endif /* !(__NO_LONG_DOUBLE_MATH && _LIBC) || __LDBL_COMPAT */ #endif /* Use ISO C99. */ @@ -479,7 +526,9 @@ extern long double __REDIRECT_NTH (nexttowardl, # undef __MATH_DECLARING_FLOATN #endif /* __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC). */ +#undef __MATHDECL_1_IMPL #undef __MATHDECL_1 +#undef __MATHDECL_ALIAS #undef __MATHDECL #undef __MATHCALL @@ -511,6 +560,11 @@ extern long double __REDIRECT_NTH (nexttowardl, # ifdef __LDBL_COMPAT # define __MATHCALL_REDIR_NAME(name) f ## name # undef __MATHCALL_NARROW +# define __MATHCALL_NARROW(func, redir, nargs) \ + __MATHCALL_NARROW_REDIR (func, redir, nargs) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# define __MATHCALL_REDIR_NAME(name) __ ## f32 ## name ## ieee128 +# undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ __MATHCALL_NARROW_REDIR (func, redir, nargs) # endif @@ -518,7 +572,8 @@ extern long double __REDIRECT_NTH (nexttowardl, # undef _Mret_ # undef _Marg_ # undef __MATHCALL_NAME -# ifdef __LDBL_COMPAT +# if defined __LDBL_COMPAT \ + || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # undef __MATHCALL_REDIR_NAME # undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ @@ -531,6 +586,11 @@ extern long double __REDIRECT_NTH (nexttowardl, # ifdef __LDBL_COMPAT # define __MATHCALL_REDIR_NAME(name) __nldbl_d ## name ## l # undef __MATHCALL_NARROW +# define __MATHCALL_NARROW(func, redir, nargs) \ + __MATHCALL_NARROW_REDIR (func, redir, nargs) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# define __MATHCALL_REDIR_NAME(name) __ ## f64 ## name ## ieee128 +# undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ __MATHCALL_NARROW_REDIR (func, redir, nargs) # endif @@ -538,7 +598,8 @@ extern long double __REDIRECT_NTH (nexttowardl, # undef _Mret_ # undef _Marg_ # undef __MATHCALL_NAME -# ifdef __LDBL_COMPAT +# if defined __LDBL_COMPAT \ + || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # undef __MATHCALL_REDIR_NAME # undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ @@ -1196,13 +1257,6 @@ iszero (__T __val) # error "M_* values needed for _Float128x" #endif -/* When compiling in strict ISO C compatible mode we must not use the - inline functions since they, among other things, do not set the - `errno' variable correctly. */ -#if defined __STRICT_ANSI__ && !defined __NO_MATH_INLINES -# define __NO_MATH_INLINES 1 -#endif - #ifdef __USE_ISOC99 # if __GNUC_PREREQ (3, 1) /* ISO C99 defines some macros to compare number while taking care for @@ -1240,12 +1294,6 @@ iszero (__T __val) # endif #endif -/* Get machine-dependent inline versions (if there are any). */ -#ifdef __USE_EXTERN_INLINES -# include -#endif - - #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) /* An expression whose type has the widest of the evaluation formats of X and Y (which are of floating-point types). */ diff --git a/lib/libc/include/generic-glibc/monetary.h b/lib/libc/include/generic-glibc/monetary.h index d7789d087a..e8142d7b07 100644 --- a/lib/libc/include/generic-glibc/monetary.h +++ b/lib/libc/include/generic-glibc/monetary.h @@ -50,7 +50,8 @@ extern ssize_t strfmon_l (char *__restrict __s, size_t __maxsize, __THROW __attribute_format_strfmon__ (4, 5); #endif -#ifdef __LDBL_COMPAT +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/generic-glibc/netinet/icmp6.h b/lib/libc/include/generic-glibc/netinet/icmp6.h index 0d1da5d26c..8f030dd8f9 100644 --- a/lib/libc/include/generic-glibc/netinet/icmp6.h +++ b/lib/libc/include/generic-glibc/netinet/icmp6.h @@ -85,16 +85,16 @@ struct icmp6_hdr #define ICMP6_PARAMPROB_OPTION 2 /* unrecognized IPv6 option */ #define ICMP6_FILTER_WILLPASS(type, filterp) \ - ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0) + ((((filterp)->icmp6_filt[(type) >> 5]) & (1U << ((type) & 31))) == 0) #define ICMP6_FILTER_WILLBLOCK(type, filterp) \ - ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0) + ((((filterp)->icmp6_filt[(type) >> 5]) & (1U << ((type) & 31))) != 0) #define ICMP6_FILTER_SETPASS(type, filterp) \ - ((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31)))) + ((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1U << ((type) & 31)))) #define ICMP6_FILTER_SETBLOCK(type, filterp) \ - ((((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31)))) + ((((filterp)->icmp6_filt[(type) >> 5]) |= (1U << ((type) & 31)))) #define ICMP6_FILTER_SETPASSALL(filterp) \ memset (filterp, 0, sizeof (struct icmp6_filter)); diff --git a/lib/libc/include/generic-glibc/netinet/in.h b/lib/libc/include/generic-glibc/netinet/in.h index bcca1ad51e..ae09a54121 100644 --- a/lib/libc/include/generic-glibc/netinet/in.h +++ b/lib/libc/include/generic-glibc/netinet/in.h @@ -87,8 +87,12 @@ enum #define IPPROTO_UDPLITE IPPROTO_UDPLITE IPPROTO_MPLS = 137, /* MPLS in IP. */ #define IPPROTO_MPLS IPPROTO_MPLS + IPPROTO_ETHERNET = 143, /* Ethernet-within-IPv6 Encapsulation. */ +#define IPPROTO_ETHERNET IPPROTO_ETHERNET IPPROTO_RAW = 255, /* Raw IP packets. */ #define IPPROTO_RAW IPPROTO_RAW + IPPROTO_MPTCP = 262, /* Multipath TCP connection. */ +#define IPPROTO_MPTCP IPPROTO_MPTCP IPPROTO_MAX }; diff --git a/lib/libc/include/generic-glibc/nss.h b/lib/libc/include/generic-glibc/nss.h index d24028cc4f..f17defc30f 100644 --- a/lib/libc/include/generic-glibc/nss.h +++ b/lib/libc/include/generic-glibc/nss.h @@ -19,10 +19,12 @@ and for implementors of new services. */ #ifndef _NSS_H -#define _NSS_H 1 +#define _NSS_H 1 #include +#include #include +#include __BEGIN_DECLS @@ -56,7 +58,204 @@ struct gaih_addrtuple Attention: Using this function repeatedly will slowly eat up the whole memory since previous selection data cannot be freed. */ extern int __nss_configure_lookup (const char *__dbname, - const char *__string) __THROW; + const char *__string) __THROW; + +/* NSS-related types. */ +struct __netgrent; +struct aliasent; +struct ether_addr; +struct etherent; +struct group; +struct hostent; +struct netent; +struct passwd; +struct protoent; +struct rpcent; +struct servent; +struct sgrp; +struct spwd; +struct traced_file; + +/* Types of functions exported from NSS service modules. */ +typedef enum nss_status nss_endaliasent (void); +typedef enum nss_status nss_endetherent (void); +typedef enum nss_status nss_endgrent (void); +typedef enum nss_status nss_endhostent (void); +typedef enum nss_status nss_endnetent (void); +typedef enum nss_status nss_endnetgrent (struct __netgrent *); +typedef enum nss_status nss_endprotoent (void); +typedef enum nss_status nss_endpwent (void); +typedef enum nss_status nss_endrpcent (void); +typedef enum nss_status nss_endservent (void); +typedef enum nss_status nss_endsgent (void); +typedef enum nss_status nss_endspent (void); +typedef enum nss_status nss_getaliasbyname_r (const char *, struct aliasent *, + char *, size_t, int *); +typedef enum nss_status nss_getaliasent_r (struct aliasent *, + char *, size_t, int *); +typedef enum nss_status nss_getcanonname_r (const char *, char *, size_t, + char **, int *, int *); +typedef enum nss_status nss_getetherent_r (struct etherent *, + char *, size_t, int *); +typedef enum nss_status nss_getgrent_r (struct group *, char *, size_t, int *); +typedef enum nss_status nss_getgrgid_r (__gid_t, struct group *, + char *, size_t, int *); +typedef enum nss_status nss_getgrnam_r (const char *, struct group *, + char *, size_t, int *); +typedef enum nss_status nss_gethostbyaddr2_r (const void *, __socklen_t, int, + struct hostent *, char *, size_t, + int *, int *, int32_t *); +typedef enum nss_status nss_gethostbyaddr_r (const void *, __socklen_t, int, + struct hostent *, char *, size_t, + int *, int *); +typedef enum nss_status nss_gethostbyname2_r (const char *, int, + struct hostent *, char *, size_t, + int *, int *); +typedef enum nss_status nss_gethostbyname3_r (const char *, int, + struct hostent *, char *, size_t, + int *, int *, int32_t *, + char **); +typedef enum nss_status nss_gethostbyname4_r (const char *, + struct gaih_addrtuple **, + char *, size_t, + int *, int *, int32_t *); +typedef enum nss_status nss_gethostbyname_r (const char *, struct hostent *, + char *, size_t, int *, int *); +typedef enum nss_status nss_gethostent_r (struct hostent *, char *, size_t, + int *, int *); +typedef enum nss_status nss_gethostton_r (const char *, struct etherent *, + char *, size_t, int *); +typedef enum nss_status nss_getnetbyaddr_r (uint32_t, int, struct netent *, + char *, size_t, int *, int *); +typedef enum nss_status nss_getnetbyname_r (const char *, struct netent *, + char *, size_t, int *, int *); +typedef enum nss_status nss_getnetent_r (struct netent *, + char *, size_t, int *, int *); +typedef enum nss_status nss_getnetgrent_r (struct __netgrent *, + char *, size_t, int *); +typedef enum nss_status nss_getntohost_r (const struct ether_addr *, + struct etherent *, char *, size_t, + int *); +typedef enum nss_status nss_getprotobyname_r (const char *, struct protoent *, + char *, size_t, int *); +typedef enum nss_status nss_getprotobynumber_r (int, struct protoent *, + char *, size_t, int *); +typedef enum nss_status nss_getprotoent_r (struct protoent *, + char *, size_t, int *); +typedef enum nss_status nss_getpublickey (const char *, char *, int *); +typedef enum nss_status nss_getpwent_r (struct passwd *, + char *, size_t, int *); +typedef enum nss_status nss_getpwnam_r (const char *, struct passwd *, + char *, size_t, int *); +typedef enum nss_status nss_getpwuid_r (__uid_t, struct passwd *, + char *, size_t, int *); +typedef enum nss_status nss_getrpcbyname_r (const char *, struct rpcent *, + char *, size_t, int *); +typedef enum nss_status nss_getrpcbynumber_r (int, struct rpcent *, + char *, size_t, int *); +typedef enum nss_status nss_getrpcent_r (struct rpcent *, + char *, size_t, int *); +typedef enum nss_status nss_getsecretkey (const char *, char *, char *, int *); +typedef enum nss_status nss_getservbyname_r (const char *, const char *, + struct servent *, char *, size_t, + int *); +typedef enum nss_status nss_getservbyport_r (int, const char *, + struct servent *, char *, size_t, + int *); +typedef enum nss_status nss_getservent_r (struct servent *, char *, size_t, + int *); +typedef enum nss_status nss_getsgent_r (struct sgrp *, char *, size_t, int *); +typedef enum nss_status nss_getsgnam_r (const char *, struct sgrp *, + char *, size_t, int *); +typedef enum nss_status nss_getspent_r (struct spwd *, char *, size_t, int *); +typedef enum nss_status nss_getspnam_r (const char *, struct spwd *, + char *, size_t, int *); +typedef void nss_init (void (*) (size_t, struct traced_file *)); +typedef enum nss_status nss_initgroups_dyn (const char *, __gid_t, long int *, + long int *, __gid_t **, long int, + int *); +typedef enum nss_status nss_netname2user (char [], __uid_t *, __gid_t *, + int *, __gid_t *, int *); +typedef enum nss_status nss_setaliasent (void); +typedef enum nss_status nss_setetherent (int); +typedef enum nss_status nss_setgrent (int); +typedef enum nss_status nss_sethostent (int); +typedef enum nss_status nss_setnetent (int); +typedef enum nss_status nss_setnetgrent (const char *, struct __netgrent *); +typedef enum nss_status nss_setprotoent (int); +typedef enum nss_status nss_setpwent (int); +typedef enum nss_status nss_setrpcent (int); +typedef enum nss_status nss_setservent (int); +typedef enum nss_status nss_setsgent (int); +typedef enum nss_status nss_setspent (int); + +/* Declare all NSS functions for MODULE. */ +#define NSS_DECLARE_MODULE_FUNCTIONS(module) \ + extern nss_endaliasent _nss_##module##_endaliasent; \ + extern nss_endetherent _nss_##module##_endetherent; \ + extern nss_endgrent _nss_##module##_endgrent; \ + extern nss_endhostent _nss_##module##_endhostent; \ + extern nss_endnetent _nss_##module##_endnetent; \ + extern nss_endnetgrent _nss_##module##__endnetgrent; \ + extern nss_endprotoent _nss_##module##_endprotoent; \ + extern nss_endpwent _nss_##module##_endpwent; \ + extern nss_endrpcent _nss_##module##_endrpcent; \ + extern nss_endservent _nss_##module##_endservent; \ + extern nss_endsgent _nss_##module##_endsgent; \ + extern nss_endspent _nss_##module##_endspent; \ + extern nss_getaliasbyname_r _nss_##module##_getaliasbyname_r; \ + extern nss_getaliasent_r _nss_##module##_getaliasent_r; \ + extern nss_getcanonname_r _nss_##module##_getcanonname_r; \ + extern nss_getetherent_r _nss_##module##_getetherent_r; \ + extern nss_getgrent_r _nss_##module##_getgrent_r; \ + extern nss_getgrgid_r _nss_##module##_getgrgid_r; \ + extern nss_getgrnam_r _nss_##module##_getgrnam_r; \ + extern nss_gethostbyaddr2_r _nss_##module##_gethostbyaddr2_r; \ + extern nss_gethostbyaddr_r _nss_##module##_gethostbyaddr_r; \ + extern nss_gethostbyname2_r _nss_##module##_gethostbyname2_r; \ + extern nss_gethostbyname3_r _nss_##module##_gethostbyname3_r; \ + extern nss_gethostbyname4_r _nss_##module##_gethostbyname4_r; \ + extern nss_gethostbyname_r _nss_##module##_gethostbyname_r; \ + extern nss_gethostent_r _nss_##module##_gethostent_r; \ + extern nss_gethostton_r _nss_##module##_gethostton_r; \ + extern nss_getnetbyaddr_r _nss_##module##_getnetbyaddr_r; \ + extern nss_getnetbyname_r _nss_##module##_getnetbyname_r; \ + extern nss_getnetent_r _nss_##module##_getnetent_r; \ + extern nss_getnetgrent_r _nss_##module##_getnetgrent_r; \ + extern nss_getntohost_r _nss_##module##_getntohost_r; \ + extern nss_getprotobyname_r _nss_##module##_getprotobyname_r; \ + extern nss_getprotobynumber_r _nss_##module##_getprotobynumber_r; \ + extern nss_getprotoent_r _nss_##module##_getprotoent_r; \ + extern nss_getpublickey _nss_##module##_getpublickey; \ + extern nss_getpwent_r _nss_##module##_getpwent_r; \ + extern nss_getpwnam_r _nss_##module##_getpwnam_r; \ + extern nss_getpwuid_r _nss_##module##_getpwuid_r; \ + extern nss_getrpcbyname_r _nss_##module##_getrpcbyname_r; \ + extern nss_getrpcbynumber_r _nss_##module##_getrpcbynumber_r; \ + extern nss_getrpcent_r _nss_##module##_getrpcent_r; \ + extern nss_getsecretkey _nss_##module##_getsecretkey; \ + extern nss_getservbyname_r _nss_##module##_getservbyname_r; \ + extern nss_getservbyport_r _nss_##module##_getservbyport_r; \ + extern nss_getservent_r _nss_##module##_getservent_r; \ + extern nss_getsgent_r _nss_##module##_getsgent_r; \ + extern nss_getsgnam_r _nss_##module##_getsgnam_r; \ + extern nss_getspent_r _nss_##module##_getspent_r; \ + extern nss_getspnam_r _nss_##module##_getspnam_r; \ + extern nss_init _nss_##module##_init; \ + extern nss_initgroups_dyn _nss_##module##_initgroups_dyn; \ + extern nss_netname2user _nss_##module##_netname2user; \ + extern nss_setaliasent _nss_##module##_setaliasent; \ + extern nss_setetherent _nss_##module##_setetherent; \ + extern nss_setgrent _nss_##module##_setgrent; \ + extern nss_sethostent _nss_##module##_sethostent; \ + extern nss_setnetent _nss_##module##_setnetent; \ + extern nss_setnetgrent _nss_##module##_setnetgrent; \ + extern nss_setprotoent _nss_##module##_setprotoent; \ + extern nss_setpwent _nss_##module##_setpwent; \ + extern nss_setrpcent _nss_##module##_setrpcent; \ + extern nss_setservent _nss_##module##_setservent; \ + extern nss_setsgent _nss_##module##_setsgent; \ + extern nss_setspent _nss_##module##_setspent; \ __END_DECLS diff --git a/lib/libc/include/generic-glibc/printf.h b/lib/libc/include/generic-glibc/printf.h index eaf489649e..ac8ae173af 100644 --- a/lib/libc/include/generic-glibc/printf.h +++ b/lib/libc/include/generic-glibc/printf.h @@ -182,7 +182,8 @@ extern int printf_size_info (const struct printf_info *__restrict __info, size_t __n, int *__restrict __argtypes) __THROW; -#ifdef __LDBL_COMPAT +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/generic-glibc/pthread.h b/lib/libc/include/generic-glibc/pthread.h index b9914a0d45..efa17507b6 100644 --- a/lib/libc/include/generic-glibc/pthread.h +++ b/lib/libc/include/generic-glibc/pthread.h @@ -27,6 +27,7 @@ #include #include #include +#include /* Detach state. */ @@ -385,6 +386,20 @@ extern int pthread_attr_getaffinity_np (const pthread_attr_t *__attr, extern int pthread_getattr_default_np (pthread_attr_t *__attr) __THROW __nonnull ((1)); +/* Store *SIGMASK as the signal mask for the new thread in *ATTR. */ +extern int pthread_attr_setsigmask_np (pthread_attr_t *__attr, + const __sigset_t *sigmask); + +/* Store the signal mask of *ATTR in *SIGMASK. If there is no signal + mask stored, return PTHREAD_ATTR_NOSIGMASK_NP. Return zero on + success. */ +extern int pthread_attr_getsigmask_np (const pthread_attr_t *__attr, + __sigset_t *sigmask); + +/* Special return value from pthread_attr_getsigmask_np if the signal + mask has not been set. */ +#define PTHREAD_ATTR_NO_SIGMASK_NP (-1) + /* Set the default attributes to be used by pthread_create in this process. */ extern int pthread_setattr_default_np (const pthread_attr_t *__attr) diff --git a/lib/libc/include/generic-glibc/signal.h b/lib/libc/include/generic-glibc/signal.h index 7fa19ea215..91b7be3621 100644 --- a/lib/libc/include/generic-glibc/signal.h +++ b/lib/libc/include/generic-glibc/signal.h @@ -27,7 +27,7 @@ __BEGIN_DECLS #include -#include +#include #include @@ -148,7 +148,8 @@ extern void psiginfo (const siginfo_t *__pinfo, const char *__s); #ifdef __USE_XOPEN_EXTENDED # ifdef __GNUC__ -extern int sigpause (int __sig) __asm__ ("__xpg_sigpause"); +extern int sigpause (int __sig) __asm__ ("__xpg_sigpause") + __attribute_deprecated_msg__ ("Use the sigsuspend function instead"); # else extern int __sigpause (int __sig_or_mask, int __is_sig); /* Remove a signal from the signal mask and suspend the process. */ @@ -164,7 +165,9 @@ extern int __sigpause (int __sig_or_mask, int __is_sig); simply do not work in many situations. Use `sigprocmask' instead. */ /* Compute mask for signal SIG. */ -# define sigmask(sig) ((int)(1u << ((sig) - 1))) +# define sigmask(sig) \ + __glibc_macro_warning ("sigmask is deprecated") \ + ((int)(1u << ((sig) - 1))) /* Block signals in MASK, returning the old mask. */ extern int sigblock (int __mask) __THROW __attribute_deprecated__; @@ -281,12 +284,6 @@ extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val) #ifdef __USE_MISC -/* Names of the signals. This variable exists only for compatibility. - Use `strsignal' instead (see ). */ -extern const char *const _sys_siglist[_NSIG]; -extern const char *const sys_siglist[_NSIG]; - - /* Get machine-dependent `struct sigcontext' and signal subcodes. */ # include @@ -311,7 +308,8 @@ extern int sigreturn (struct sigcontext *__scp) __THROW; /* If INTERRUPT is nonzero, make signal SIG interrupt system calls (causing them to fail with EINTR); if INTERRUPT is zero, make system calls be restarted after signal SIG. */ -extern int siginterrupt (int __sig, int __interrupt) __THROW; +extern int siginterrupt (int __sig, int __interrupt) __THROW + __attribute_deprecated_msg__ ("Use sigaction with SA_RESTART instead"); # include # include @@ -340,16 +338,21 @@ extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) /* Simplified interface for signal management. */ /* Add SIG to the calling process' signal mask. */ -extern int sighold (int __sig) __THROW; +extern int sighold (int __sig) __THROW + __attribute_deprecated_msg__ ("Use the sigprocmask function instead"); /* Remove SIG from the calling process' signal mask. */ -extern int sigrelse (int __sig) __THROW; +extern int sigrelse (int __sig) __THROW + __attribute_deprecated_msg__ ("Use the sigprocmask function instead"); /* Set the disposition of SIG to SIG_IGN. */ -extern int sigignore (int __sig) __THROW; +extern int sigignore (int __sig) __THROW + __attribute_deprecated_msg__ ("Use the signal function instead"); /* Set the disposition of SIG. */ -extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW; +extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW + __attribute_deprecated_msg__ + ("Use the signal and sigprocmask functions instead"); #endif #if defined __USE_POSIX199506 || defined __USE_UNIX98 diff --git a/lib/libc/include/generic-glibc/stdio.h b/lib/libc/include/generic-glibc/stdio.h index 7b5485826b..f83759406f 100644 --- a/lib/libc/include/generic-glibc/stdio.h +++ b/lib/libc/include/generic-glibc/stdio.h @@ -400,9 +400,12 @@ extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __THROW; /* For historical reasons, the C99-compliant versions of the scanf - functions are at alternative names. When __LDBL_COMPAT is in - effect, this is handled in bits/stdio-ldbl.h. */ -#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT + functions are at alternative names. When __LDBL_COMPAT or + __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI are in effect, this is handled in + bits/stdio-ldbl.h. */ +#include +#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT \ + && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 # ifdef __REDIRECT extern int __REDIRECT (fscanf, (FILE *__restrict __stream, const char *__restrict __format, ...), @@ -447,7 +450,8 @@ extern int vsscanf (const char *__restrict __s, /* Same redirection as above for the v*scanf family. */ # if !__GLIBC_USE (DEPRECATED_SCANF) -# if defined __REDIRECT && !defined __LDBL_COMPAT +# if defined __REDIRECT && !defined __LDBL_COMPAT \ + && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 extern int __REDIRECT (vfscanf, (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg), @@ -562,7 +566,7 @@ extern int putw (int __w, FILE *__stream); This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) - __wur; + __wur __attr_access ((__write_only__, 1, 2)); #if __GLIBC_USE (DEPRECATED_GETS) /* Get a newline-terminated string from stdin, removing the newline. @@ -585,7 +589,8 @@ extern char *gets (char *__s) __wur __attribute_deprecated__; or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern char *fgets_unlocked (char *__restrict __s, int __n, - FILE *__restrict __stream) __wur; + FILE *__restrict __stream) __wur + __attr_access ((__write_only__, 1, 2)); #endif @@ -774,12 +779,6 @@ extern int ferror_unlocked (FILE *__stream) __THROW __wur; marked with __THROW. */ extern void perror (const char *__s); -/* Provide the declarations for `sys_errlist' and `sys_nerr' if they - are available on this system. Even if available, these variables - should not be used directly. The `strerror' function provides - all the necessary functionality. */ -#include - #ifdef __USE_POSIX /* Return the system file descriptor for STREAM. */ @@ -866,7 +865,9 @@ extern int __overflow (FILE *, int); #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif -#ifdef __LDBL_COMPAT + +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/generic-glibc/stdlib.h b/lib/libc/include/generic-glibc/stdlib.h index 115bcee92d..3ffc3703d4 100644 --- a/lib/libc/include/generic-glibc/stdlib.h +++ b/lib/libc/include/generic-glibc/stdlib.h @@ -397,7 +397,7 @@ extern long int a64l (const char *__s) `initstate' and `setstate' functions are those from BSD Unices. The `rand' and `srand' functions are required by the ANSI standard. We provide both interfaces to the same random number generator. */ -/* Return a random long integer between 0 and RAND_MAX inclusive. */ +/* Return a random long integer between 0 and 2^31-1 inclusive. */ extern long int random (void) __THROW; /* Seed the random number generator with the given number. */ @@ -931,12 +931,13 @@ extern int wctomb (char *__s, wchar_t __wchar) __THROW; /* Convert a multibyte string to a wide char string. */ extern size_t mbstowcs (wchar_t *__restrict __pwcs, - const char *__restrict __s, size_t __n) __THROW; + const char *__restrict __s, size_t __n) __THROW + __attr_access ((__read_only__, 2)); /* Convert a wide char string to multibyte string. */ extern size_t wcstombs (char *__restrict __s, const wchar_t *__restrict __pwcs, size_t __n) - __THROW; - + __THROW + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); #ifdef __USE_MISC /* Determine whether the string value of RESPONSE matches the affirmation @@ -990,7 +991,7 @@ extern char *ptsname (int __fd) __THROW __wur; terminal associated with the master FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ptsname_r (int __fd, char *__buf, size_t __buflen) - __THROW __nonnull ((2)); + __THROW __nonnull ((2)) __attr_access ((__write_only__, 2, 3)); /* Open a master pseudo terminal and return its file descriptor. */ extern int getpt (void); @@ -1016,7 +1017,9 @@ extern int ttyslot (void) __THROW; #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif -#ifdef __LDBL_COMPAT + +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/generic-glibc/string.h b/lib/libc/include/generic-glibc/string.h index 423cc537ed..99d5158b5a 100644 --- a/lib/libc/include/generic-glibc/string.h +++ b/lib/libc/include/generic-glibc/string.h @@ -53,7 +53,7 @@ extern void *memmove (void *__dest, const void *__src, size_t __n) #if defined __USE_MISC || defined __USE_XOPEN || __GLIBC_USE (ISOC2X) extern void *memccpy (void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) - __THROW __nonnull ((1, 2)); + __THROW __nonnull ((1, 2)) __attr_access ((__write_only__, 1, 4)); #endif /* Misc || X/Open. */ @@ -108,12 +108,15 @@ extern void *rawmemchr (const void *__s, int __c) /* Search N bytes of S for the final occurrence of C. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" void *memrchr (void *__s, int __c, size_t __n) - __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)); + __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)) + __attr_access ((__read_only__, 1, 3)); extern "C++" const void *memrchr (const void *__s, int __c, size_t __n) - __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)); + __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)) + __attr_access ((__read_only__, 1, 3)); # else extern void *memrchr (const void *__s, int __c, size_t __n) - __THROW __attribute_pure__ __nonnull ((1)); + __THROW __attribute_pure__ __nonnull ((1)) + __attr_access ((__read_only__, 1, 3)); # endif #endif @@ -146,7 +149,7 @@ extern int strcoll (const char *__s1, const char *__s2) /* Put a transformation of SRC into no more than N bytes of DEST. */ extern size_t strxfrm (char *__restrict __dest, const char *__restrict __src, size_t __n) - __THROW __nonnull ((2)); + __THROW __nonnull ((2)) __attr_access ((__write_only__, 1, 3)); #ifdef __USE_XOPEN2K8 /* POSIX.1-2008 extended locale interface (see locale.h). */ @@ -158,7 +161,8 @@ extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l) /* Put a transformation of SRC into no more than N bytes of DEST, using sorting rules from L. */ extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, - locale_t __l) __THROW __nonnull ((2, 4)); + locale_t __l) __THROW __nonnull ((2, 4)) + __attr_access ((__write_only__, 1, 3)); #endif #if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 \ @@ -368,7 +372,9 @@ extern char *strcasestr (const char *__haystack, const char *__needle) HAYSTACK is HAYSTACKLEN bytes long. */ extern void *memmem (const void *__haystack, size_t __haystacklen, const void *__needle, size_t __needlelen) - __THROW __attribute_pure__ __nonnull ((1, 3)); + __THROW __attribute_pure__ __nonnull ((1, 3)) + __attr_access ((__read_only__, 1, 2)) + __attr_access ((__read_only__, 3, 4)); /* Copy N bytes of SRC to DEST, return pointer to bytes after the last written byte. */ @@ -409,17 +415,25 @@ extern char *strerror (int __errnum) __THROW; # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (strerror_r, (int __errnum, char *__buf, size_t __buflen), - __xpg_strerror_r) __nonnull ((2)); + __xpg_strerror_r) __nonnull ((2)) + __attr_access ((__write_only__, 2, 3)); # else extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen) - __THROW __nonnull ((2)); + __THROW __nonnull ((2)) __attr_access ((__write_only__, 2, 3)); # define strerror_r __xpg_strerror_r # endif # else /* If a temporary buffer is required, at most BUFLEN bytes of BUF will be used. */ extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) - __THROW __nonnull ((2)) __wur; + __THROW __nonnull ((2)) __wur __attr_access ((__write_only__, 2, 3)); +# endif + +# ifdef __USE_GNU +/* Return a string describing the meaning of tthe error in ERR. */ +extern const char *strerrordesc_np (int __err) __THROW; +/* Return a string with the error name in ERR. */ +extern const char *strerrorname_np (int __err) __THROW; # endif #endif @@ -433,7 +447,8 @@ extern char *strerror_l (int __errnum, locale_t __l) __THROW; /* Set N bytes of S to 0. The compiler will not delete a call to this function, even if S is dead after the call. */ -extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1)); +extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1)) + __attr_access ((__write_only__, 1, 2)); /* Return the next DELIM-delimited token from *STRINGP, terminating it with a '\0', and update *STRINGP to point past it. */ @@ -446,6 +461,14 @@ extern char *strsep (char **__restrict __stringp, /* Return a string describing the meaning of the signal number in SIG. */ extern char *strsignal (int __sig) __THROW; +# ifdef __USE_GNU +/* Return an abbreviation string for the signal number SIG. */ +extern const char *sigabbrev_np (int __sig) __THROW; +/* Return a string describing the meaning of the signal number in SIG, + the result is not translated. */ +extern const char *sigdescr_np (int __sig) __THROW; +# endif + /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); @@ -471,7 +494,8 @@ extern int strverscmp (const char *__s1, const char *__s2) extern char *strfry (char *__string) __THROW __nonnull ((1)); /* Frobnicate N bytes of S. */ -extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1)); +extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1)) + __attr_access ((__write_only__, 1, 2)); # ifndef basename /* Return the file name within directory of FILENAME. We don't diff --git a/lib/libc/include/generic-glibc/sys/asm.h b/lib/libc/include/generic-glibc/sys/asm.h deleted file mode 100644 index b87759216a..0000000000 --- a/lib/libc/include/generic-glibc/sys/asm.h +++ /dev/null @@ -1,497 +0,0 @@ -/* Copyright (C) 1997-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _SYS_ASM_H -#define _SYS_ASM_H - -#include - -#ifndef CAT -# define __CAT(str1,str2) str1##str2 -# define CAT(str1,str2) __CAT(str1,str2) -#endif - -/* Redefined as nonempty in the internal header. */ -#define __mips_cfi_startproc /* Empty. */ -#define __mips_cfi_endproc /* Empty. */ - -/* - * Macros to handle different pointer/register sizes for 32/64-bit code - * - * 64 bit address space isn't used yet, so we may use the R3000 32 bit - * defines for now. - */ -#if _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIN32 -# define PTR .word -# define PTRSIZE 4 -# define PTRLOG 2 -#elif _MIPS_SIM == _ABI64 -# define PTR .dword -# define PTRSIZE 8 -# define PTRLOG 3 -#endif - -/* - * PIC specific declarations - */ -#if _MIPS_SIM == _ABIO32 -# ifdef __PIC__ -# define CPRESTORE(register) \ - .cprestore register -# define CPLOAD(register) \ - .cpload register -# else -# define CPRESTORE(register) -# define CPLOAD(register) -# endif - -# define CPADD(register) \ - .cpadd register - -/* - * Set gp when at 1st instruction - */ -# define SETUP_GP \ - .set noreorder; \ - .cpload $25; \ - .set reorder -/* Set gp when not at 1st instruction */ -# define SETUP_GPX(r) \ - .set noreorder; \ - move r, $31; /* Save old ra. */ \ - bal 10f; /* Find addr of cpload. */ \ - nop; \ -10: \ - .cpload $31; \ - move $31, r; \ - .set reorder -# define SETUP_GPX_L(r, l) \ - .set noreorder; \ - move r, $31; /* Save old ra. */ \ - bal l; /* Find addr of cpload. */ \ - nop; \ -l: \ - .cpload $31; \ - move $31, r; \ - .set reorder -# define SAVE_GP(x) \ - .cprestore x /* Save gp trigger t9/jalr conversion. */ -# define SETUP_GP64(a, b) -# define SETUP_GPX64(a, b) -# define SETUP_GPX64_L(cp_reg, ra_save, l) -# define RESTORE_GP64 -# define USE_ALT_CP(a) -#else /* _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 */ -/* - * For callee-saved gp calling convention: - */ -# define SETUP_GP -# define SETUP_GPX(r) -# define SETUP_GPX_L(r, l) -# define SAVE_GP(x) - -# define SETUP_GP64(gpoffset, proc) \ - .cpsetup $25, gpoffset, proc -# define SETUP_GPX64(cp_reg, ra_save) \ - move ra_save, $31; /* Save old ra. */ \ - .set noreorder; \ - bal 10f; /* Find addr of .cpsetup. */ \ - nop; \ -10: \ - .set reorder; \ - .cpsetup $31, cp_reg, 10b; \ - move $31, ra_save -# define SETUP_GPX64_L(cp_reg, ra_save, l) \ - move ra_save, $31; /* Save old ra. */ \ - .set noreorder; \ - bal l; /* Find addr of .cpsetup. */ \ - nop; \ -l: \ - .set reorder; \ - .cpsetup $31, cp_reg, l; \ - move $31, ra_save -# define RESTORE_GP64 \ - .cpreturn -/* Use alternate register for context pointer. */ -# define USE_ALT_CP(reg) \ - .cplocal reg -#endif /* _MIPS_SIM != _ABIO32 */ - -/* - * Stack Frame Definitions - */ -#if _MIPS_SIM == _ABIO32 -# define NARGSAVE 4 /* Space for 4 argument registers must be allocated. */ -#endif -#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 -# define NARGSAVE 0 /* No caller responsibilities. */ -#endif - - -/* - * LEAF - declare leaf routine - */ -#define LEAF(symbol) \ - .globl symbol; \ - .align 2; \ - .type symbol,@function; \ - .ent symbol,0; \ -symbol: .frame sp,0,ra; \ - __mips_cfi_startproc - -/* - * NESTED - declare nested routine entry point - */ -#define NESTED(symbol, framesize, rpc) \ - .globl symbol; \ - .align 2; \ - .type symbol,@function; \ - .ent symbol,0; \ -symbol: .frame sp, framesize, rpc; \ - __mips_cfi_startproc - -/* - * END - mark end of function - */ -#ifndef END -# define END(function) \ - __mips_cfi_endproc; \ - .end function; \ - .size function,.-function -#endif - -/* - * EXPORT - export definition of symbol - */ -#define EXPORT(symbol) \ - .globl symbol; \ -symbol: __mips_cfi_startproc - -/* - * ABS - export absolute symbol - */ -#define ABS(symbol,value) \ - .globl symbol; \ -symbol = value - -#define PANIC(msg) \ - .set push; \ - .set reorder; \ - la a0,8f; \ - jal panic; \ -9: b 9b; \ - .set pop; \ - TEXT(msg) - -/* - * Print formated string - */ -#define PRINT(string) \ - .set push; \ - .set reorder; \ - la a0,8f; \ - jal printk; \ - .set pop; \ - TEXT(string) - -#define TEXT(msg) \ - .data; \ -8: .asciiz msg; \ - .previous; - -/* - * Build text tables - */ -#define TTABLE(string) \ - .text; \ - .word 1f; \ - .previous; \ - .data; \ -1: .asciz string; \ - .previous - -/* - * MIPS IV pref instruction. - * Use with .set noreorder only! - * - * MIPS IV implementations are free to treat this as a nop. The R5000 - * is one of them. So we should have an option not to use this instruction. - */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) \ - || (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64) -# define PREF(hint,addr) \ - pref hint,addr -# define PREFX(hint,addr) \ - prefx hint,addr -#else -# define PREF(hint,addr) -# define PREFX(hint,addr) -#endif - -/* - * MIPS ISA IV/V movn/movz instructions and equivalents for older CPUs. - */ -#if _MIPS_ISA == _MIPS_ISA_MIPS1 -# define MOVN(rd,rs,rt) \ - .set push; \ - .set reorder; \ - beqz rt,9f; \ - move rd,rs; \ - .set pop; \ -9: -# define MOVZ(rd,rs,rt) \ - .set push; \ - .set reorder; \ - bnez rt,9f; \ - move rd,rt; \ - .set pop; \ -9: -#endif /* _MIPS_ISA == _MIPS_ISA_MIPS1 */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) -# define MOVN(rd,rs,rt) \ - .set push; \ - .set noreorder; \ - bnezl rt,9f; \ - move rd,rs; \ - .set pop; \ -9: -# define MOVZ(rd,rs,rt) \ - .set push; \ - .set noreorder; \ - beqzl rt,9f; \ - movz rd,rs; \ - .set pop; \ -9: -#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) \ - || (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64) -# define MOVN(rd,rs,rt) \ - movn rd,rs,rt -# define MOVZ(rd,rs,rt) \ - movz rd,rs,rt -#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) */ - -/* - * Stack alignment - */ -#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 -# define ALSZ 15 -# define ALMASK ~15 -#else -# define ALSZ 7 -# define ALMASK ~7 -#endif - -/* - * Size of a register - */ -#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 -# define SZREG 8 -#else -# define SZREG 4 -#endif - -/* - * Use the following macros in assemblercode to load/store registers, - * pointers etc. - */ -#if (SZREG == 4) -# define REG_S sw -# define REG_L lw -#else -# define REG_S sd -# define REG_L ld -#endif - -/* - * How to add/sub/load/store/shift C int variables. - */ -#if (_MIPS_SZINT == 32) -# define INT_ADD add -# define INT_ADDI addi -# define INT_ADDU addu -# define INT_ADDIU addiu -# define INT_SUB sub -# define INT_SUBI subi -# define INT_SUBU subu -# define INT_SUBIU subu -# define INT_L lw -# define INT_S sw -#endif - -#if (_MIPS_SZINT == 64) -# define INT_ADD dadd -# define INT_ADDI daddi -# define INT_ADDU daddu -# define INT_ADDIU daddiu -# define INT_SUB dsub -# define INT_SUBI dsubi -# define INT_SUBU dsubu -# define INT_SUBIU dsubu -# define INT_L ld -# define INT_S sd -#endif - -/* - * How to add/sub/load/store/shift C long variables. - */ -#if (_MIPS_SZLONG == 32) -# define LONG_ADD add -# define LONG_ADDI addi -# define LONG_ADDU addu -# define LONG_ADDIU addiu -# define LONG_SUB sub -# define LONG_SUBI subi -# define LONG_SUBU subu -# define LONG_SUBIU subu -# define LONG_L lw -# define LONG_S sw -# define LONG_SLL sll -# define LONG_SLLV sllv -# define LONG_SRL srl -# define LONG_SRLV srlv -# define LONG_SRA sra -# define LONG_SRAV srav -#endif - -#if (_MIPS_SZLONG == 64) -# define LONG_ADD dadd -# define LONG_ADDI daddi -# define LONG_ADDU daddu -# define LONG_ADDIU daddiu -# define LONG_SUB dsub -# define LONG_SUBI dsubi -# define LONG_SUBU dsubu -# define LONG_SUBIU dsubu -# define LONG_L ld -# define LONG_S sd -# define LONG_SLL dsll -# define LONG_SLLV dsllv -# define LONG_SRL dsrl -# define LONG_SRLV dsrlv -# define LONG_SRA dsra -# define LONG_SRAV dsrav -#endif - -/* - * How to add/sub/load/store/shift pointers. - */ -#if (_MIPS_SIM == _ABIO32 && _MIPS_SZPTR == 32) -# define PTR_ADD add -# define PTR_ADDI addi -# define PTR_ADDU addu -# define PTR_ADDIU addiu -# define PTR_SUB sub -# define PTR_SUBI subi -# define PTR_SUBU subu -# define PTR_SUBIU subu -# define PTR_L lw -# define PTR_LA la -# define PTR_S sw -# define PTR_SLL sll -# define PTR_SLLV sllv -# define PTR_SRL srl -# define PTR_SRLV srlv -# define PTR_SRA sra -# define PTR_SRAV srav - -# define PTR_SCALESHIFT 2 -#endif - -#if _MIPS_SIM == _ABIN32 -# define PTR_ADD add -# define PTR_ADDI addi -# define PTR_SUB sub -# define PTR_SUBI subi -#if !defined __mips_isa_rev || __mips_isa_rev < 6 -# define PTR_ADDU add /* no u */ -# define PTR_ADDIU addi /* no u */ -# define PTR_SUBU sub /* no u */ -# define PTR_SUBIU sub /* no u */ -#else -# define PTR_ADDU addu -# define PTR_ADDIU addiu -# define PTR_SUBU subu -# define PTR_SUBIU subu -#endif -# define PTR_L lw -# define PTR_LA la -# define PTR_S sw -# define PTR_SLL sll -# define PTR_SLLV sllv -# define PTR_SRL srl -# define PTR_SRLV srlv -# define PTR_SRA sra -# define PTR_SRAV srav - -# define PTR_SCALESHIFT 2 -#endif - -#if (_MIPS_SIM == _ABIO32 && _MIPS_SZPTR == 64 /* o64??? */) \ - || _MIPS_SIM == _ABI64 -# define PTR_ADD dadd -# define PTR_ADDI daddi -# define PTR_ADDU daddu -# define PTR_ADDIU daddiu -# define PTR_SUB dsub -# define PTR_SUBI dsubi -# define PTR_SUBU dsubu -# define PTR_SUBIU dsubu -# define PTR_L ld -# define PTR_LA dla -# define PTR_S sd -# define PTR_SLL dsll -# define PTR_SLLV dsllv -# define PTR_SRL dsrl -# define PTR_SRLV dsrlv -# define PTR_SRA dsra -# define PTR_SRAV dsrav - -# define PTR_SCALESHIFT 3 -#endif - -/* - * Some cp0 registers were extended to 64bit for MIPS III. - */ -#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) \ - || (_MIPS_ISA == _MIPS_ISA_MIPS32) -# define MFC0 mfc0 -# define MTC0 mtc0 -#endif -#if (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) \ - || (_MIPS_ISA == _MIPS_ISA_MIPS5) || (_MIPS_ISA == _MIPS_ISA_MIPS64) -# define MFC0 dmfc0 -# define MTC0 dmtc0 -#endif - -/* The MIPS architectures do not have a uniform memory model. Particular - platforms may provide additional guarantees - for instance, the R4000 - LL and SC instructions implicitly perform a SYNC, and the 4K promises - strong ordering. - - However, in the absence of those guarantees, we must assume weak ordering - and SYNC explicitly where necessary. - - Some obsolete MIPS processors may not support the SYNC instruction. This - applies to "true" MIPS I processors; most of the processors which compile - using MIPS I implement parts of MIPS II. */ - -#ifndef MIPS_SYNC -# define MIPS_SYNC sync -#endif - -#endif /* sys/asm.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/cachectl.h b/lib/libc/include/generic-glibc/sys/cachectl.h deleted file mode 100644 index 798a6819da..0000000000 --- a/lib/libc/include/generic-glibc/sys/cachectl.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _SYS_CACHECTL_H -#define _SYS_CACHECTL_H 1 - -#include - -/* - * Get the kernel definition for the op bits. - */ -#include - -__BEGIN_DECLS - -#ifdef __USE_MISC -extern int cachectl (void *__addr, const int __nbytes, const int __op) __THROW; -#endif -extern int __cachectl (void *__addr, const int __nbytes, const int __op) __THROW; -#ifdef __USE_MISC -extern int cacheflush (void *__addr, const int __nbytes, const int __op) __THROW; -#endif -extern int _flush_cache (char *__addr, const int __nbytes, const int __op) __THROW; - -__END_DECLS - -#endif /* sys/cachectl.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/cdefs.h b/lib/libc/include/generic-glibc/sys/cdefs.h index 8d82b634bd..cee62de938 100644 --- a/lib/libc/include/generic-glibc/sys/cdefs.h +++ b/lib/libc/include/generic-glibc/sys/cdefs.h @@ -452,7 +452,37 @@ #include #include -#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# ifdef __REDIRECT + +/* Alias name defined automatically. */ +# define __LDBL_REDIR(name, proto) ... unused__ldbl_redir +# define __LDBL_REDIR_DECL(name) \ + extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128")); + +/* Alias name defined automatically, with leading underscores. */ +# define __LDBL_REDIR2_DECL(name) \ + extern __typeof (__##name) __##name \ + __asm (__ASMNAME ("__" #name "ieee128")); + +/* Alias name defined manually. */ +# define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1 +# define __LDBL_REDIR1_DECL(name, alias) \ + extern __typeof (name) name __asm (__ASMNAME (#alias)); + +# define __LDBL_REDIR1_NTH(name, proto, alias) \ + __REDIRECT_NTH (name, proto, alias) +# define __REDIRECT_NTH_LDBL(name, proto, alias) \ + __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128) + +/* Unused. */ +# define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl +# define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth + +# else +_Static_assert (0, "IEEE 128-bits long double requires redirection on this platform"); +# endif +#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH # define __LDBL_COMPAT 1 # ifdef __REDIRECT # define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) @@ -461,6 +491,8 @@ # define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) # define __LDBL_REDIR_NTH(name, proto) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) +# define __LDBL_REDIR2_DECL(name) \ + extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name)); # define __LDBL_REDIR1_DECL(name, alias) \ extern __typeof (name) name __asm (__ASMNAME (#alias)); # define __LDBL_REDIR_DECL(name) \ @@ -471,11 +503,13 @@ __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) # endif #endif -#if !defined __LDBL_COMPAT || !defined __REDIRECT +#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \ + || !defined __REDIRECT # define __LDBL_REDIR1(name, proto, alias) name proto # define __LDBL_REDIR(name, proto) name proto # define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW # define __LDBL_REDIR_NTH(name, proto) name proto __THROW +# define __LDBL_REDIR2_DECL(name) # define __LDBL_REDIR_DECL(name) # ifdef __REDIRECT # define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) @@ -514,4 +548,15 @@ # define __HAVE_GENERIC_SELECTION 0 #endif +#if __GNUC_PREREQ (10, 0) +/* Designates a 1-based positional argument ref-index of pointer type + that can be used to access size-index elements of the pointed-to + array according to access mode, or at least one element when + size-index is not provided: + access (access-mode, [, ]) */ +#define __attr_access(x) __attribute__ ((__access__ x)) +#else +# define __attr_access(x) +#endif + #endif /* sys/cdefs.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/elf.h b/lib/libc/include/generic-glibc/sys/elf.h index 134b815f4c..d37502689d 100644 --- a/lib/libc/include/generic-glibc/sys/elf.h +++ b/lib/libc/include/generic-glibc/sys/elf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2020 Free Software Foundation, Inc. +/* Copyright (C) 1998-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,14 +12,18 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SYS_ELF_H #define _SYS_ELF_H 1 -#warning "This header is obsolete; use instead." +#ifdef __x86_64__ +# error This header is unsupported on x86-64. +#else +# warning "This header is obsolete; use instead." -#include +# include +#endif -#endif /* sys/elf.h */ \ No newline at end of file +#endif /* _SYS_ELF_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/ptrace.h b/lib/libc/include/generic-glibc/sys/ptrace.h index b420fa1cbc..0977a402d7 100644 --- a/lib/libc/include/generic-glibc/sys/ptrace.h +++ b/lib/libc/include/generic-glibc/sys/ptrace.h @@ -1,4 +1,4 @@ -/* `ptrace' debugger support interface. Linux version. +/* `ptrace' debugger support interface. Linux/x86 version. Copyright (C) 1996-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -70,23 +70,19 @@ enum __ptrace_request PTRACE_SINGLESTEP = 9, #define PT_STEP PTRACE_SINGLESTEP - /* Get all general purpose registers used by a processes. - This is not supported on all machines. */ + /* Get all general purpose registers used by a processes. */ PTRACE_GETREGS = 12, #define PT_GETREGS PTRACE_GETREGS - /* Set all general purpose registers used by a processes. - This is not supported on all machines. */ + /* Set all general purpose registers used by a processes. */ PTRACE_SETREGS = 13, #define PT_SETREGS PTRACE_SETREGS - /* Get all floating point registers used by a processes. - This is not supported on all machines. */ + /* Get all floating point registers used by a processes. */ PTRACE_GETFPREGS = 14, #define PT_GETFPREGS PTRACE_GETFPREGS - /* Set all floating point registers used by a processes. - This is not supported on all machines. */ + /* Set all floating point registers used by a processes. */ PTRACE_SETFPREGS = 15, #define PT_SETFPREGS PTRACE_SETFPREGS @@ -98,13 +94,11 @@ enum __ptrace_request PTRACE_DETACH = 17, #define PT_DETACH PTRACE_DETACH - /* Get all extended floating point registers used by a processes. - This is not supported on all machines. */ + /* Get all extended floating point registers used by a processes. */ PTRACE_GETFPXREGS = 18, #define PT_GETFPXREGS PTRACE_GETFPXREGS - /* Set all extended floating point registers used by a processes. - This is not supported on all machines. */ + /* Set all extended floating point registers used by a processes. */ PTRACE_SETFPXREGS = 19, #define PT_SETFPXREGS PTRACE_SETFPXREGS @@ -112,6 +106,32 @@ enum __ptrace_request PTRACE_SYSCALL = 24, #define PT_SYSCALL PTRACE_SYSCALL + /* Get a TLS entry in the GDT. */ + PTRACE_GET_THREAD_AREA = 25, +#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA + + /* Change a TLS entry in the GDT. */ + PTRACE_SET_THREAD_AREA = 26, +#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA + +#ifdef __x86_64__ + /* Access TLS data. */ + PTRACE_ARCH_PRCTL = 30, +# define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL +#endif + + /* Continue and stop at the next syscall, it will not be executed. */ + PTRACE_SYSEMU = 31, +#define PT_SYSEMU PTRACE_SYSEMU + + /* Single step the process, the next syscall will not be executed. */ + PTRACE_SYSEMU_SINGLESTEP = 32, +#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP + + /* Execute process until next taken branch. */ + PTRACE_SINGLEBLOCK = 33, +#define PT_STEPBLOCK PTRACE_SINGLEBLOCK + /* Set ptrace filter options. */ PTRACE_SETOPTIONS = 0x4200, #define PT_SETOPTIONS PTRACE_SETOPTIONS diff --git a/lib/libc/include/generic-glibc/sys/random.h b/lib/libc/include/generic-glibc/sys/random.h index 1ef7b160db..690a5234cf 100644 --- a/lib/libc/include/generic-glibc/sys/random.h +++ b/lib/libc/include/generic-glibc/sys/random.h @@ -25,6 +25,7 @@ /* Flags for use with getrandom. */ #define GRND_NONBLOCK 0x01 #define GRND_RANDOM 0x02 +#define GRND_INSECURE 0x04 __BEGIN_DECLS diff --git a/lib/libc/include/generic-glibc/sys/sysctl.h b/lib/libc/include/generic-glibc/sys/sysctl.h deleted file mode 100644 index e8def66c88..0000000000 --- a/lib/libc/include/generic-glibc/sys/sysctl.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 1996-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SYSCTL_H -#define _SYS_SYSCTL_H 1 - -#warning "The header is deprecated and will be removed." - -#include -#define __need_size_t -#include -/* Prevent more kernel headers than necessary to be included. */ -#ifndef _LINUX_KERNEL_H -# define _LINUX_KERNEL_H 1 -# define __undef_LINUX_KERNEL_H -#endif -#ifndef _LINUX_TYPES_H -# define _LINUX_TYPES_H 1 -# define __undef_LINUX_TYPES_H -#endif -#ifndef _LINUX_LIST_H -# define _LINUX_LIST_H 1 -# define __undef_LINUX_LIST_H -#endif -#ifndef __LINUX_COMPILER_H -# define __LINUX_COMPILER_H 1 -# define __user -# define __undef__LINUX_COMPILER_H -#endif - -#include - -#ifdef __undef_LINUX_KERNEL_H -# undef _LINUX_KERNEL_H -# undef __undef_LINUX_KERNEL_H -#endif -#ifdef __undef_LINUX_TYPES_H -# undef _LINUX_TYPES_H -# undef __undef_LINUX_TYPES_H -#endif -#ifdef __undef_LINUX_LIST_H -# undef _LINUX_LIST_H -# undef __undef_LINUX_LIST_H -#endif -#ifdef __undef__LINUX_COMPILER_H -# undef __LINUX_COMPILER_H -# undef __user -# undef __undef__LINUX_COMPILER_H -#endif - -#include - -__BEGIN_DECLS - -/* Read or write system parameters. */ -extern int sysctl (int *__name, int __nlen, void *__oldval, - size_t *__oldlenp, void *__newval, size_t __newlen) __THROW - __attribute_deprecated__; - -__END_DECLS - -#endif /* _SYS_SYSCTL_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/syslog.h b/lib/libc/include/generic-glibc/sys/syslog.h index 05b95a4bf1..3c249a2789 100644 --- a/lib/libc/include/generic-glibc/sys/syslog.h +++ b/lib/libc/include/generic-glibc/sys/syslog.h @@ -206,7 +206,9 @@ extern void vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap) #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif -#ifdef __LDBL_COMPAT + +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/generic-glibc/sys/ucontext.h b/lib/libc/include/generic-glibc/sys/ucontext.h index dfd6641750..3244eab7c8 100644 --- a/lib/libc/include/generic-glibc/sys/ucontext.h +++ b/lib/libc/include/generic-glibc/sys/ucontext.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1997-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. +/* Copyright (C) 2001-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -11,36 +12,18 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ -/* Don't rely on this, the interface is currently messed up and may need to - be broken to be fixed. */ #ifndef _SYS_UCONTEXT_H #define _SYS_UCONTEXT_H 1 #include +#include #include #include -#include - - -/* Type for general register. Even in o32 we assume 64-bit registers, - like the kernel. */ -__extension__ typedef unsigned long long int greg_t; - -/* Number of general registers. */ -#define __NGREG 32 -#define __NFPREG 32 -#ifdef __USE_MISC -# define NGREG __NGREG -# define NFPREG __NFPREG -#endif - -/* Container for all general registers. */ -typedef greg_t gregset_t[__NGREG]; #ifdef __USE_MISC # define __ctx(fld) fld @@ -48,66 +31,112 @@ typedef greg_t gregset_t[__NGREG]; # define __ctx(fld) __ ## fld #endif -/* Container for all FPU registers. */ -typedef struct { - union { - double __ctx(fp_dregs)[__NFPREG]; - struct { - float _fp_fregs; - unsigned int _fp_pad; - } __ctx(fp_fregs)[__NFPREG]; - } __ctx(fp_r); -} fpregset_t; +#ifdef __x86_64__ +/* Type for general register. */ +__extension__ typedef long long int greg_t; + +/* Number of general registers. */ +#define __NGREG 23 +#ifdef __USE_MISC +# define NGREG __NGREG +#endif + +/* Container for all general registers. */ +typedef greg_t gregset_t[__NGREG]; + +#ifdef __USE_GNU +/* Number of each register in the `gregset_t' array. */ +enum +{ + REG_R8 = 0, +# define REG_R8 REG_R8 + REG_R9, +# define REG_R9 REG_R9 + REG_R10, +# define REG_R10 REG_R10 + REG_R11, +# define REG_R11 REG_R11 + REG_R12, +# define REG_R12 REG_R12 + REG_R13, +# define REG_R13 REG_R13 + REG_R14, +# define REG_R14 REG_R14 + REG_R15, +# define REG_R15 REG_R15 + REG_RDI, +# define REG_RDI REG_RDI + REG_RSI, +# define REG_RSI REG_RSI + REG_RBP, +# define REG_RBP REG_RBP + REG_RBX, +# define REG_RBX REG_RBX + REG_RDX, +# define REG_RDX REG_RDX + REG_RAX, +# define REG_RAX REG_RAX + REG_RCX, +# define REG_RCX REG_RCX + REG_RSP, +# define REG_RSP REG_RSP + REG_RIP, +# define REG_RIP REG_RIP + REG_EFL, +# define REG_EFL REG_EFL + REG_CSGSFS, /* Actually short cs, gs, fs, __pad0. */ +# define REG_CSGSFS REG_CSGSFS + REG_ERR, +# define REG_ERR REG_ERR + REG_TRAPNO, +# define REG_TRAPNO REG_TRAPNO + REG_OLDMASK, +# define REG_OLDMASK REG_OLDMASK + REG_CR2 +# define REG_CR2 REG_CR2 +}; +#endif + +struct _libc_fpxreg +{ + unsigned short int __ctx(significand)[4]; + unsigned short int __ctx(exponent); + unsigned short int __glibc_reserved1[3]; +}; + +struct _libc_xmmreg +{ + __uint32_t __ctx(element)[4]; +}; + +struct _libc_fpstate +{ + /* 64-bit FXSAVE format. */ + __uint16_t __ctx(cwd); + __uint16_t __ctx(swd); + __uint16_t __ctx(ftw); + __uint16_t __ctx(fop); + __uint64_t __ctx(rip); + __uint64_t __ctx(rdp); + __uint32_t __ctx(mxcsr); + __uint32_t __ctx(mxcr_mask); + struct _libc_fpxreg _st[8]; + struct _libc_xmmreg _xmm[16]; + __uint32_t __glibc_reserved1[24]; +}; + +/* Structure to describe FPU registers. */ +typedef struct _libc_fpstate *fpregset_t; /* Context to describe whole processor state. */ -#if _MIPS_SIM == _ABIO32 -/* Earlier versions of glibc for mips had an entirely different - definition of mcontext_t, that didn't even resemble the - corresponding kernel data structure. Fortunately, makecontext, - [gs]etcontext et all were not implemented back then, so this can - still be rectified. */ -typedef struct - { - unsigned int __ctx(regmask); - unsigned int __ctx(status); - greg_t __ctx(pc); - gregset_t __ctx(gregs); - fpregset_t __ctx(fpregs); - unsigned int __ctx(fp_owned); - unsigned int __ctx(fpc_csr); - unsigned int __ctx(fpc_eir); - unsigned int __ctx(used_math); - unsigned int __ctx(dsp); - greg_t __ctx(mdhi); - greg_t __ctx(mdlo); - unsigned long __ctx(hi1); - unsigned long __ctx(lo1); - unsigned long __ctx(hi2); - unsigned long __ctx(lo2); - unsigned long __ctx(hi3); - unsigned long __ctx(lo3); - } mcontext_t; -#else typedef struct { gregset_t __ctx(gregs); + /* Note that fpregs is a pointer. */ fpregset_t __ctx(fpregs); - greg_t __ctx(mdhi); - greg_t __ctx(hi1); - greg_t __ctx(hi2); - greg_t __ctx(hi3); - greg_t __ctx(mdlo); - greg_t __ctx(lo1); - greg_t __ctx(lo2); - greg_t __ctx(lo3); - greg_t __ctx(pc); - unsigned int __ctx(fpc_csr); - unsigned int __ctx(used_math); - unsigned int __ctx(dsp); - unsigned int __glibc_reserved1; - } mcontext_t; -#endif + __extension__ unsigned long long __reserved1 [8]; +} mcontext_t; /* Userlevel context. */ typedef struct ucontext_t @@ -117,8 +146,117 @@ typedef struct ucontext_t stack_t uc_stack; mcontext_t uc_mcontext; sigset_t uc_sigmask; + struct _libc_fpstate __fpregs_mem; + __extension__ unsigned long long int __ssp[4]; } ucontext_t; +#else /* !__x86_64__ */ + +/* Type for general register. */ +typedef int greg_t; + +/* Number of general registers. */ +#define __NGREG 19 +#ifdef __USE_MISC +# define NGREG __NGREG +#endif + +/* Container for all general registers. */ +typedef greg_t gregset_t[__NGREG]; + +#ifdef __USE_GNU +/* Number of each register is the `gregset_t' array. */ +enum +{ + REG_GS = 0, +# define REG_GS REG_GS + REG_FS, +# define REG_FS REG_FS + REG_ES, +# define REG_ES REG_ES + REG_DS, +# define REG_DS REG_DS + REG_EDI, +# define REG_EDI REG_EDI + REG_ESI, +# define REG_ESI REG_ESI + REG_EBP, +# define REG_EBP REG_EBP + REG_ESP, +# define REG_ESP REG_ESP + REG_EBX, +# define REG_EBX REG_EBX + REG_EDX, +# define REG_EDX REG_EDX + REG_ECX, +# define REG_ECX REG_ECX + REG_EAX, +# define REG_EAX REG_EAX + REG_TRAPNO, +# define REG_TRAPNO REG_TRAPNO + REG_ERR, +# define REG_ERR REG_ERR + REG_EIP, +# define REG_EIP REG_EIP + REG_CS, +# define REG_CS REG_CS + REG_EFL, +# define REG_EFL REG_EFL + REG_UESP, +# define REG_UESP REG_UESP + REG_SS +# define REG_SS REG_SS +}; +#endif + +/* Definitions taken from the kernel headers. */ +struct _libc_fpreg +{ + unsigned short int __ctx(significand)[4]; + unsigned short int __ctx(exponent); +}; + +struct _libc_fpstate +{ + unsigned long int __ctx(cw); + unsigned long int __ctx(sw); + unsigned long int __ctx(tag); + unsigned long int __ctx(ipoff); + unsigned long int __ctx(cssel); + unsigned long int __ctx(dataoff); + unsigned long int __ctx(datasel); + struct _libc_fpreg _st[8]; + unsigned long int __ctx(status); +}; + +/* Structure to describe FPU registers. */ +typedef struct _libc_fpstate *fpregset_t; + +/* Context to describe whole processor state. */ +typedef struct + { + gregset_t __ctx(gregs); + /* Due to Linux's history we have to use a pointer here. The SysV/i386 + ABI requires a struct with the values. */ + fpregset_t __ctx(fpregs); + unsigned long int __ctx(oldmask); + unsigned long int __ctx(cr2); + } mcontext_t; + +/* Userlevel context. */ +typedef struct ucontext_t + { + unsigned long int __ctx(uc_flags); + struct ucontext_t *uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + sigset_t uc_sigmask; + struct _libc_fpstate __fpregs_mem; + unsigned long int __ssp[4]; + } ucontext_t; + +#endif /* !__x86_64__ */ + #undef __ctx #endif /* sys/ucontext.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/user.h b/lib/libc/include/generic-glibc/sys/user.h index bfe83781cd..fe9d875789 100644 --- a/lib/libc/include/generic-glibc/sys/user.h +++ b/lib/libc/include/generic-glibc/sys/user.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Copyright (C) 2001-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,199 +12,169 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SYS_USER_H #define _SYS_USER_H 1 -#include -#include - /* The whole purpose of this file is for GDB and GDB only. Don't read too much into it. Don't use it for anything other than GDB unless you know what you are doing. */ -/* #include */ -/* Instead of including the kernel header, that will vary depending on - whether the 32- or the 64-bit kernel is installed, we paste its - contents here. Note that the fact that the file is inline here, - instead of included separately, doesn't change in any way the - licensing status of a program that includes user.h. Since this is - for gdb alone, and gdb is GPLed, no surprises here. */ -#if _MIPS_SIM == _ABIO32 -/* - * Various register offset definitions for debuggers, core file - * examiners and whatnot. - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1995, 1999 by Ralf Baechle - */ -#ifndef __ASM_MIPS_REG_H -#define __ASM_MIPS_REG_H +#ifdef __x86_64__ -/* - * This defines/structures correspond to the register layout on stack - - * if the order here is changed, it needs to be updated in - * include/asm-mips/stackframe.h - */ -#define EF_REG0 6 -#define EF_REG1 7 -#define EF_REG2 8 -#define EF_REG3 9 -#define EF_REG4 10 -#define EF_REG5 11 -#define EF_REG6 12 -#define EF_REG7 13 -#define EF_REG8 14 -#define EF_REG9 15 -#define EF_REG10 16 -#define EF_REG11 17 -#define EF_REG12 18 -#define EF_REG13 19 -#define EF_REG14 20 -#define EF_REG15 21 -#define EF_REG16 22 -#define EF_REG17 23 -#define EF_REG18 24 -#define EF_REG19 25 -#define EF_REG20 26 -#define EF_REG21 27 -#define EF_REG22 28 -#define EF_REG23 29 -#define EF_REG24 30 -#define EF_REG25 31 -/* - * k0/k1 unsaved - */ -#define EF_REG28 34 -#define EF_REG29 35 -#define EF_REG30 36 -#define EF_REG31 37 +struct user_fpregs_struct +{ + unsigned short int cwd; + unsigned short int swd; + unsigned short int ftw; + unsigned short int fop; + __extension__ unsigned long long int rip; + __extension__ unsigned long long int rdp; + unsigned int mxcsr; + unsigned int mxcr_mask; + unsigned int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ + unsigned int xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */ + unsigned int padding[24]; +}; -/* - * Saved special registers - */ -#define EF_LO 38 -#define EF_HI 39 - -#define EF_CP0_EPC 40 -#define EF_CP0_BADVADDR 41 -#define EF_CP0_STATUS 42 -#define EF_CP0_CAUSE 43 - -#define EF_SIZE 180 /* size in bytes */ - -#endif /* __ASM_MIPS_REG_H */ - -#else /* _MIPS_SIM != _ABIO32 */ - -/* - * Various register offset definitions for debuggers, core file - * examiners and whatnot. - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1995, 1999 Ralf Baechle - * Copyright (C) 1995, 1999 Silicon Graphics - */ -#ifndef _ASM_REG_H -#define _ASM_REG_H - -/* - * This defines/structures correspond to the register layout on stack - - * if the order here is changed, it needs to be updated in - * include/asm-mips/stackframe.h - */ -#define EF_REG0 0 -#define EF_REG1 1 -#define EF_REG2 2 -#define EF_REG3 3 -#define EF_REG4 4 -#define EF_REG5 5 -#define EF_REG6 6 -#define EF_REG7 7 -#define EF_REG8 8 -#define EF_REG9 9 -#define EF_REG10 10 -#define EF_REG11 11 -#define EF_REG12 12 -#define EF_REG13 13 -#define EF_REG14 14 -#define EF_REG15 15 -#define EF_REG16 16 -#define EF_REG17 17 -#define EF_REG18 18 -#define EF_REG19 19 -#define EF_REG20 20 -#define EF_REG21 21 -#define EF_REG22 22 -#define EF_REG23 23 -#define EF_REG24 24 -#define EF_REG25 25 -/* - * k0/k1 unsaved - */ -#define EF_REG28 28 -#define EF_REG29 29 -#define EF_REG30 30 -#define EF_REG31 31 - -/* - * Saved special registers - */ -#define EF_LO 32 -#define EF_HI 33 - -#define EF_CP0_EPC 34 -#define EF_CP0_BADVADDR 35 -#define EF_CP0_STATUS 36 -#define EF_CP0_CAUSE 37 - -#define EF_SIZE 304 /* size in bytes */ - -#endif /* _ASM_REG_H */ - -#endif /* _MIPS_SIM != _ABIO32 */ - -#if _MIPS_SIM == _ABIO32 +struct user_regs_struct +{ + __extension__ unsigned long long int r15; + __extension__ unsigned long long int r14; + __extension__ unsigned long long int r13; + __extension__ unsigned long long int r12; + __extension__ unsigned long long int rbp; + __extension__ unsigned long long int rbx; + __extension__ unsigned long long int r11; + __extension__ unsigned long long int r10; + __extension__ unsigned long long int r9; + __extension__ unsigned long long int r8; + __extension__ unsigned long long int rax; + __extension__ unsigned long long int rcx; + __extension__ unsigned long long int rdx; + __extension__ unsigned long long int rsi; + __extension__ unsigned long long int rdi; + __extension__ unsigned long long int orig_rax; + __extension__ unsigned long long int rip; + __extension__ unsigned long long int cs; + __extension__ unsigned long long int eflags; + __extension__ unsigned long long int rsp; + __extension__ unsigned long long int ss; + __extension__ unsigned long long int fs_base; + __extension__ unsigned long long int gs_base; + __extension__ unsigned long long int ds; + __extension__ unsigned long long int es; + __extension__ unsigned long long int fs; + __extension__ unsigned long long int gs; +}; struct user { - unsigned long regs[EF_SIZE/4+64]; /* integer and fp regs */ - size_t u_tsize; /* text size (pages) */ - size_t u_dsize; /* data size (pages) */ - size_t u_ssize; /* stack size (pages) */ - unsigned long start_code; /* text starting address */ - unsigned long start_data; /* data starting address */ - unsigned long start_stack; /* stack starting address */ - long int signal; /* signal causing core dump */ - void* u_ar0; /* help gdb find registers */ - unsigned long magic; /* identifies a core file */ - char u_comm[32]; /* user command name */ + struct user_regs_struct regs; + int u_fpvalid; + struct user_fpregs_struct i387; + __extension__ unsigned long long int u_tsize; + __extension__ unsigned long long int u_dsize; + __extension__ unsigned long long int u_ssize; + __extension__ unsigned long long int start_code; + __extension__ unsigned long long int start_stack; + __extension__ long long int signal; + int reserved; + __extension__ union + { + struct user_regs_struct* u_ar0; + __extension__ unsigned long long int __u_ar0_word; + }; + __extension__ union + { + struct user_fpregs_struct* u_fpstate; + __extension__ unsigned long long int __u_fpstate_word; + }; + __extension__ unsigned long long int magic; + char u_comm [32]; + __extension__ unsigned long long int u_debugreg [8]; }; #else - -struct user { - __extension__ unsigned long regs[EF_SIZE/8+64]; /* integer and fp regs */ - __extension__ unsigned long u_tsize; /* text size (pages) */ - __extension__ unsigned long u_dsize; /* data size (pages) */ - __extension__ unsigned long u_ssize; /* stack size (pages) */ - __extension__ unsigned long long start_code; /* text starting address */ - __extension__ unsigned long long start_data; /* data starting address */ - __extension__ unsigned long long start_stack; /* stack starting address */ - __extension__ long long signal; /* signal causing core dump */ - __extension__ unsigned long long u_ar0; /* help gdb find registers */ - __extension__ unsigned long long magic; /* identifies a core file */ - char u_comm[32]; /* user command name */ +/* These are the 32-bit x86 structures. */ +struct user_fpregs_struct +{ + long int cwd; + long int swd; + long int twd; + long int fip; + long int fcs; + long int foo; + long int fos; + long int st_space [20]; }; -#endif +struct user_fpxregs_struct +{ + unsigned short int cwd; + unsigned short int swd; + unsigned short int twd; + unsigned short int fop; + long int fip; + long int fcs; + long int foo; + long int fos; + long int mxcsr; + long int reserved; + long int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ + long int xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */ + long int padding[56]; +}; + +struct user_regs_struct +{ + long int ebx; + long int ecx; + long int edx; + long int esi; + long int edi; + long int ebp; + long int eax; + long int xds; + long int xes; + long int xfs; + long int xgs; + long int orig_eax; + long int eip; + long int xcs; + long int eflags; + long int esp; + long int xss; +}; + +struct user +{ + struct user_regs_struct regs; + int u_fpvalid; + struct user_fpregs_struct i387; + unsigned long int u_tsize; + unsigned long int u_dsize; + unsigned long int u_ssize; + unsigned long int start_code; + unsigned long int start_stack; + long int signal; + int reserved; + struct user_regs_struct* u_ar0; + struct user_fpregs_struct* u_fpstate; + unsigned long int magic; + char u_comm [32]; + int u_debugreg [8]; +}; +#endif /* __x86_64__ */ + +#define PAGE_SHIFT 12 +#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PAGE_MASK (~(PAGE_SIZE-1)) +#define NBPG PAGE_SIZE +#define UPAGES 1 +#define HOST_TEXT_START_ADDR (u.start_code) +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) #endif /* _SYS_USER_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/threads.h b/lib/libc/include/generic-glibc/threads.h index 212eac67ef..a176ad32cc 100644 --- a/lib/libc/include/generic-glibc/threads.h +++ b/lib/libc/include/generic-glibc/threads.h @@ -24,7 +24,7 @@ __BEGIN_DECLS -#include +#include #include #ifndef __cplusplus @@ -32,10 +32,10 @@ __BEGIN_DECLS #endif #define TSS_DTOR_ITERATIONS 4 -typedef unsigned int tss_t; +typedef __tss_t tss_t; typedef void (*tss_dtor_t) (void*); -typedef unsigned long int thrd_t; +typedef __thrd_t thrd_t; typedef int (*thrd_start_t) (void*); /* Exit and error codes. */ @@ -56,11 +56,8 @@ enum mtx_timed = 2 }; -typedef struct -{ - int __data __ONCE_ALIGNMENT; -} once_flag; -#define ONCE_FLAG_INIT { 0 } +typedef __once_flag once_flag; +#define ONCE_FLAG_INIT __ONCE_FLAG_INIT typedef union { diff --git a/lib/libc/include/generic-glibc/unistd.h b/lib/libc/include/generic-glibc/unistd.h index 2decd11b88..83a83213c0 100644 --- a/lib/libc/include/generic-glibc/unistd.h +++ b/lib/libc/include/generic-glibc/unistd.h @@ -357,13 +357,15 @@ extern int close (int __fd); This function is a cancellation point and therefore not marked with __THROW. */ -extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur; +extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur + __attr_access ((__write_only__, 2, 3)); /* Write N bytes of BUF to FD. Return the number written, or -1. This function is a cancellation point and therefore not marked with __THROW. */ -extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur; +extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur + __attr_access ((__read_only__, 2, 3)); #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 # ifndef __USE_FILE_OFFSET64 @@ -374,7 +376,8 @@ extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur; This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, - __off_t __offset) __wur; + __off_t __offset) __wur + __attr_access ((__write_only__, 2, 3)); /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. @@ -382,15 +385,19 @@ extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwrite (int __fd, const void *__buf, size_t __n, - __off_t __offset) __wur; + __off_t __offset) __wur + __attr_access ((__read_only__, 2, 3)); + # else # ifdef __REDIRECT extern ssize_t __REDIRECT (pread, (int __fd, void *__buf, size_t __nbytes, __off64_t __offset), - pread64) __wur; + pread64) __wur + __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (pwrite, (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset), - pwrite64) __wur; + pwrite64) __wur + __attr_access ((__read_only__, 2, 3)); # else # define pread pread64 # define pwrite pwrite64 @@ -402,11 +409,13 @@ extern ssize_t __REDIRECT (pwrite, (int __fd, const void *__buf, changing the file pointer. Return the number read, -1 for errors or 0 for EOF. */ extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes, - __off64_t __offset) __wur; + __off64_t __offset) __wur + __attr_access ((__write_only__, 2, 3)); /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. */ extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n, - __off64_t __offset) __wur; + __off64_t __offset) __wur + __attr_access ((__read_only__, 2, 3)); # endif #endif @@ -508,7 +517,8 @@ extern int fchdir (int __fd) __THROW __wur; an array is allocated with `malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case it is as big as necessary. */ -extern char *getcwd (char *__buf, size_t __size) __THROW __wur; +extern char *getcwd (char *__buf, size_t __size) __THROW __wur + __attr_access ((__write_only__, 1, 2)); #ifdef __USE_GNU /* Return a malloc'd string containing the current directory name. @@ -523,7 +533,8 @@ extern char *get_current_dir_name (void) __THROW; If successful, return BUF. If not, put an error message in BUF and return NULL. BUF should be at least PATH_MAX bytes long. */ extern char *getwd (char *__buf) - __THROW __nonnull ((1)) __attribute_deprecated__ __wur; + __THROW __nonnull ((1)) __attribute_deprecated__ __wur + __attr_access ((__write_only__, 1)); #endif @@ -620,7 +631,8 @@ extern long int sysconf (int __name) __THROW; #ifdef __USE_POSIX2 /* Get the value of the string-valued system variable NAME. */ -extern size_t confstr (int __name, char *__buf, size_t __len) __THROW; +extern size_t confstr (int __name, char *__buf, size_t __len) __THROW + __attr_access ((__write_only__, 2, 3)); #endif @@ -686,8 +698,8 @@ extern __gid_t getegid (void) __THROW; /* If SIZE is zero, return the number of supplementary groups the calling process is in. Otherwise, fill in the group IDs of its supplementary groups in LIST and return the number written. */ -extern int getgroups (int __size, __gid_t __list[]) __THROW __wur; - +extern int getgroups (int __size, __gid_t __list[]) __THROW __wur + __attr_access ((__write_only__, 2, 1)); #ifdef __USE_GNU /* Return nonzero iff the calling process is in group GID. */ extern int group_member (__gid_t __gid) __THROW; @@ -772,7 +784,7 @@ extern char *ttyname (int __fd) __THROW; /* Store at most BUFLEN characters of the pathname of the terminal FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ttyname_r (int __fd, char *__buf, size_t __buflen) - __THROW __nonnull ((2)) __wur; + __THROW __nonnull ((2)) __wur __attr_access ((__write_only__, 2, 3)); /* Return 1 if FD is a valid descriptor associated with a terminal, zero if not. */ @@ -807,7 +819,8 @@ extern int symlink (const char *__from, const char *__to) Returns the number of characters read, or -1 for errors. */ extern ssize_t readlink (const char *__restrict __path, char *__restrict __buf, size_t __len) - __THROW __nonnull ((1, 2)) __wur; + __THROW __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3)); + #endif /* Use POSIX.1-2001. */ #ifdef __USE_ATFILE @@ -818,7 +831,7 @@ extern int symlinkat (const char *__from, int __tofd, /* Like readlink but a relative PATH is interpreted relative to FD. */ extern ssize_t readlinkat (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len) - __THROW __nonnull ((2, 3)) __wur; + __THROW __nonnull ((2, 3)) __wur __attr_access ((__read_only__, 3, 4)); #endif /* Remove the link NAME. */ @@ -853,7 +866,8 @@ extern char *getlogin (void); This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1)); +extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1)) + __attr_access ((__write_only__, 1, 2)); #endif #ifdef __USE_MISC @@ -874,7 +888,8 @@ extern int setlogin (const char *__name) __THROW __nonnull ((1)); /* Put the name of the current host in no more than LEN bytes of NAME. The result is null-terminated if LEN is large enough for the full name and the terminator. */ -extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1)); +extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1)) + __attr_access ((__write_only__, 1, 2)); #endif @@ -882,7 +897,7 @@ extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1)); /* Set the name of the current host to NAME, which is LEN bytes long. This call is restricted to the super-user. */ extern int sethostname (const char *__name, size_t __len) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)) __wur __attr_access ((__read_only__, 1, 2)); /* Set the current machine's Internet number to ID. This call is restricted to the super-user. */ @@ -893,10 +908,9 @@ extern int sethostid (long int __id) __THROW __wur; Called just like `gethostname' and `sethostname'. The NIS domain name is usually the empty string when not using NIS. */ extern int getdomainname (char *__name, size_t __len) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)) __wur __attr_access ((__write_only__, 1, 2)); extern int setdomainname (const char *__name, size_t __len) - __THROW __nonnull ((1)) __wur; - + __THROW __nonnull ((1)) __wur __attr_access ((__read_only__, 1, 2)); /* Revoke access permissions to all processes currently communicating with the control terminal, and then send a SIGHUP signal to the process @@ -1131,7 +1145,9 @@ extern char *crypt (const char *__key, const char *__salt) range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM is without partner. */ extern void swab (const void *__restrict __from, void *__restrict __to, - ssize_t __n) __THROW __nonnull ((1, 2)); + ssize_t __n) __THROW __nonnull ((1, 2)) + __attr_access ((__read_only__, 1, 3)) + __attr_access ((__write_only__, 2, 3)); #endif @@ -1158,7 +1174,8 @@ extern int pthread_atfork (void (*__prepare) (void), #ifdef __USE_MISC /* Write LENGTH bytes of randomness starting at BUFFER. Return 0 on success or -1 on error. */ -int getentropy (void *__buffer, size_t __length) __wur; +int getentropy (void *__buffer, size_t __length) __wur + __attr_access ((__write_only__, 1, 2)); #endif /* Define some macros helping to catch buffer overflows. */ diff --git a/lib/libc/include/generic-glibc/wchar.h b/lib/libc/include/generic-glibc/wchar.h index f358a1400f..f92623639b 100644 --- a/lib/libc/include/generic-glibc/wchar.h +++ b/lib/libc/include/generic-glibc/wchar.h @@ -633,9 +633,11 @@ extern int swscanf (const wchar_t *__restrict __s, __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; /* For historical reasons, the C99-compliant versions of the scanf - functions are at alternative names. When __LDBL_COMPAT is in - effect, this is handled in bits/wchar-ldbl.h. */ -#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT + functions are at alternative names. When __LDBL_COMPAT or + __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI are in effect, this is handled in + bits/wchar-ldbl.h. */ +#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT \ + && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 # ifdef __REDIRECT extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...), @@ -688,7 +690,8 @@ extern int vswscanf (const wchar_t *__restrict __s, /* Same redirection as above for the v*wscanf family. */ # if !__GLIBC_USE (DEPRECATED_SCANF) \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ - && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) + && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) \ + && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 # ifdef __REDIRECT extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s, const wchar_t *__restrict __format, @@ -849,7 +852,8 @@ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, # include #endif -#ifdef __LDBL_COMPAT +#include +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # include #endif diff --git a/lib/libc/include/i386-linux-gnu/bits/fenv.h b/lib/libc/include/i386-linux-gnu/bits/fenv.h index 3164b63556..b504e27b15 100644 --- a/lib/libc/include/i386-linux-gnu/bits/fenv.h +++ b/lib/libc/include/i386-linux-gnu/bits/fenv.h @@ -113,58 +113,4 @@ femode_t; /* Default floating-point control modes. */ # define FE_DFL_MODE ((const femode_t *) -1L) -#endif - - -#ifdef __USE_EXTERN_INLINES -__BEGIN_DECLS - -/* Optimized versions. */ -#ifndef _LIBC -extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept); -#endif -__extern_always_inline void -__NTH (__feraiseexcept_invalid_divbyzero (int __excepts)) -{ - if ((FE_INVALID & __excepts) != 0) - { - /* One example of an invalid operation is 0.0 / 0.0. */ - float __f = 0.0; - -# ifdef __SSE_MATH__ - __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f)); -# else - __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait" - : "=t" (__f) : "0" (__f)); -# endif - (void) &__f; - } - if ((FE_DIVBYZERO & __excepts) != 0) - { - float __f = 1.0; - float __g = 0.0; - -# ifdef __SSE_MATH__ - __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g)); -# else - __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait" - : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)"); -# endif - (void) &__f; - } -} -__extern_inline int -__NTH (feraiseexcept (int __excepts)) -{ - if (__builtin_constant_p (__excepts) - && (__excepts & ~(FE_INVALID | FE_DIVBYZERO)) == 0) - { - __feraiseexcept_invalid_divbyzero (__excepts); - return 0; - } - - return __feraiseexcept_renamed (__excepts); -} - -__END_DECLS #endif \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/long-double.h b/lib/libc/include/i386-linux-gnu/bits/long-double.h index a7bd8fb163..75bc1fcce4 100644 --- a/lib/libc/include/i386-linux-gnu/bits/long-double.h +++ b/lib/libc/include/i386-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/select.h b/lib/libc/include/i386-linux-gnu/bits/select.h index 959d998266..d71b5e4ce2 100644 --- a/lib/libc/include/i386-linux-gnu/bits/select.h +++ b/lib/libc/include/i386-linux-gnu/bits/select.h @@ -19,45 +19,19 @@ # error "Never use directly; include instead." #endif -#include - - -#if defined __GNUC__ && __GNUC__ >= 2 - -# if __WORDSIZE == 64 -# define __FD_ZERO_STOS "stosq" -# else -# define __FD_ZERO_STOS "stosl" -# endif - -# define __FD_ZERO(fdsp) \ - do { \ - int __d0, __d1; \ - __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \ - : "=c" (__d0), "=D" (__d1) \ - : "a" (0), "0" (sizeof (fd_set) \ - / sizeof (__fd_mask)), \ - "1" (&__FDS_BITS (fdsp)[0]) \ - : "memory"); \ - } while (0) - -#else /* ! GNU CC */ /* We don't use `memset' because this would require a prototype and the array isn't too big. */ -# define __FD_ZERO(set) \ +#define __FD_ZERO(s) \ do { \ unsigned int __i; \ - fd_set *__arr = (set); \ + fd_set *__arr = (s); \ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) - -#endif /* GNU CC */ - -#define __FD_SET(d, set) \ - ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d))) -#define __FD_CLR(d, set) \ - ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d))) -#define __FD_ISSET(d, set) \ - ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file +#define __FD_SET(d, s) \ + ((void) (__FDS_BITS (s)[__FD_ELT(d)] |= __FD_MASK(d))) +#define __FD_CLR(d, s) \ + ((void) (__FDS_BITS (s)[__FD_ELT(d)] &= ~__FD_MASK(d))) +#define __FD_ISSET(d, s) \ + ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/sem-pad.h b/lib/libc/include/i386-linux-gnu/bits/sem-pad.h deleted file mode 100644 index 10534c61cf..0000000000 --- a/lib/libc/include/i386-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. x86 version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 1 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/semaphore.h b/lib/libc/include/i386-linux-gnu/bits/semaphore.h index 7f41d9a880..97292723c8 100644 --- a/lib/libc/include/i386-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/i386-linux-gnu/bits/semaphore.h @@ -1,6 +1,6 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,6 @@ # define __SIZEOF_SEM_T 16 #endif - /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/i386-linux-gnu/bits/sysctl.h b/lib/libc/include/i386-linux-gnu/bits/sysctl.h deleted file mode 100644 index 5e2b946cdf..0000000000 --- a/lib/libc/include/i386-linux-gnu/bits/sysctl.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2012-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#if defined __x86_64__ && defined __ILP32__ -# error "sysctl system call is unsupported in x32 kernel" -#endif \ No newline at end of file diff --git a/lib/libc/include/i386-linux-gnu/bits/typesizes.h b/lib/libc/include/i386-linux-gnu/bits/typesizes.h index 7ad60c3f43..53ae0bd5ef 100644 --- a/lib/libc/include/i386-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/i386-linux-gnu/bits/typesizes.h @@ -64,6 +64,7 @@ #define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -87,10 +88,15 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/mips-linux-gnu/bits/msq-pad.h b/lib/libc/include/mips-linux-gnu/bits/msq-pad.h deleted file mode 100644 index 132f7815a7..0000000000 --- a/lib/libc/include/mips-linux-gnu/bits/msq-pad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Define where padding goes in struct msqid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#ifdef __MIPSEL__ -# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) -# define __MSQ_PAD_BEFORE_TIME 0 -#else -# define __MSQ_PAD_AFTER_TIME 0 -# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) -#endif \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnu/bits/resource.h b/lib/libc/include/mips-linux-gnu/bits/resource.h index 11fc73b49d..f2a2c48a9d 100644 --- a/lib/libc/include/mips-linux-gnu/bits/resource.h +++ b/lib/libc/include/mips-linux-gnu/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips-linux-gnu/bits/sem-pad.h b/lib/libc/include/mips-linux-gnu/bits/sem-pad.h deleted file mode 100644 index 0638180f08..0000000000 --- a/lib/libc/include/mips-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnu/bits/shm-pad.h b/lib/libc/include/mips-linux-gnu/bits/shm-pad.h deleted file mode 100644 index 1c596174a8..0000000000 --- a/lib/libc/include/mips-linux-gnu/bits/shm-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct shmid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnu/bits/signum.h b/lib/libc/include/mips-linux-gnu/bits/signum.h deleted file mode 100644 index e9fa21916b..0000000000 --- a/lib/libc/include/mips-linux-gnu/bits/signum.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Signal number definitions. Linux/MIPS version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/MIPS. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGPWR 19 /* Power failure imminent. */ - -#undef SIGUSR1 -#define SIGUSR1 16 -#undef SIGUSR2 -#define SIGUSR2 17 -#undef SIGCHLD -#define SIGCHLD 18 -#undef SIGWINCH -#define SIGWINCH 20 -#undef SIGURG -#define SIGURG 21 -#undef SIGPOLL -#define SIGPOLL 22 -#undef SIGSTOP -#define SIGSTOP 23 -#undef SIGTSTP -#define SIGTSTP 24 -#undef SIGCONT -#define SIGCONT 25 -#undef SIGTTIN -#define SIGTTIN 26 -#undef SIGTTOU -#define SIGTTOU 27 -#undef SIGVTALRM -#define SIGVTALRM 28 -#undef SIGPROF -#define SIGPROF 29 -#undef SIGXCPU -#define SIGXCPU 30 -#undef SIGXFSZ -#define SIGXFSZ 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 127 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/msq-pad.h b/lib/libc/include/mips64-linux-gnuabi64/bits/msq-pad.h deleted file mode 100644 index 132f7815a7..0000000000 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/msq-pad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Define where padding goes in struct msqid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#ifdef __MIPSEL__ -# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) -# define __MSQ_PAD_BEFORE_TIME 0 -#else -# define __MSQ_PAD_AFTER_TIME 0 -# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) -#endif \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/resource.h b/lib/libc/include/mips64-linux-gnuabi64/bits/resource.h index 11fc73b49d..f2a2c48a9d 100644 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/resource.h +++ b/lib/libc/include/mips64-linux-gnuabi64/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/sem-pad.h b/lib/libc/include/mips64-linux-gnuabi64/bits/sem-pad.h deleted file mode 100644 index 0638180f08..0000000000 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/shm-pad.h b/lib/libc/include/mips64-linux-gnuabi64/bits/shm-pad.h deleted file mode 100644 index 1c596174a8..0000000000 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/shm-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct shmid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/signum.h b/lib/libc/include/mips64-linux-gnuabi64/bits/signum.h deleted file mode 100644 index e9fa21916b..0000000000 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/signum.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Signal number definitions. Linux/MIPS version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/MIPS. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGPWR 19 /* Power failure imminent. */ - -#undef SIGUSR1 -#define SIGUSR1 16 -#undef SIGUSR2 -#define SIGUSR2 17 -#undef SIGCHLD -#define SIGCHLD 18 -#undef SIGWINCH -#define SIGWINCH 20 -#undef SIGURG -#define SIGURG 21 -#undef SIGPOLL -#define SIGPOLL 22 -#undef SIGSTOP -#define SIGSTOP 23 -#undef SIGTSTP -#define SIGTSTP 24 -#undef SIGCONT -#define SIGCONT 25 -#undef SIGTTIN -#define SIGTTIN 26 -#undef SIGTTOU -#define SIGTTOU 27 -#undef SIGVTALRM -#define SIGVTALRM 28 -#undef SIGPROF -#define SIGPROF 29 -#undef SIGXCPU -#define SIGXCPU 30 -#undef SIGXFSZ -#define SIGXFSZ 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 127 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/msq-pad.h b/lib/libc/include/mips64-linux-gnuabin32/bits/msq-pad.h deleted file mode 100644 index 132f7815a7..0000000000 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/msq-pad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Define where padding goes in struct msqid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#ifdef __MIPSEL__ -# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) -# define __MSQ_PAD_BEFORE_TIME 0 -#else -# define __MSQ_PAD_AFTER_TIME 0 -# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) -#endif \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/resource.h b/lib/libc/include/mips64-linux-gnuabin32/bits/resource.h index 11fc73b49d..f2a2c48a9d 100644 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/resource.h +++ b/lib/libc/include/mips64-linux-gnuabin32/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/sem-pad.h b/lib/libc/include/mips64-linux-gnuabin32/bits/sem-pad.h deleted file mode 100644 index 0638180f08..0000000000 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/shm-pad.h b/lib/libc/include/mips64-linux-gnuabin32/bits/shm-pad.h deleted file mode 100644 index 1c596174a8..0000000000 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/shm-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct shmid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/signum.h b/lib/libc/include/mips64-linux-gnuabin32/bits/signum.h deleted file mode 100644 index e9fa21916b..0000000000 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/signum.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Signal number definitions. Linux/MIPS version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/MIPS. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGPWR 19 /* Power failure imminent. */ - -#undef SIGUSR1 -#define SIGUSR1 16 -#undef SIGUSR2 -#define SIGUSR2 17 -#undef SIGCHLD -#define SIGCHLD 18 -#undef SIGWINCH -#define SIGWINCH 20 -#undef SIGURG -#define SIGURG 21 -#undef SIGPOLL -#define SIGPOLL 22 -#undef SIGSTOP -#define SIGSTOP 23 -#undef SIGTSTP -#define SIGTSTP 24 -#undef SIGCONT -#define SIGCONT 25 -#undef SIGTTIN -#define SIGTTIN 26 -#undef SIGTTOU -#define SIGTTOU 27 -#undef SIGVTALRM -#define SIGVTALRM 28 -#undef SIGPROF -#define SIGPROF 29 -#undef SIGXCPU -#define SIGXCPU 30 -#undef SIGXFSZ -#define SIGXFSZ 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 127 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/msq-pad.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/msq-pad.h deleted file mode 100644 index 132f7815a7..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/msq-pad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Define where padding goes in struct msqid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#ifdef __MIPSEL__ -# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) -# define __MSQ_PAD_BEFORE_TIME 0 -#else -# define __MSQ_PAD_AFTER_TIME 0 -# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) -#endif \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/resource.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/resource.h index 11fc73b49d..f2a2c48a9d 100644 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/resource.h +++ b/lib/libc/include/mips64el-linux-gnuabi64/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/sem-pad.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/sem-pad.h deleted file mode 100644 index 0638180f08..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/shm-pad.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/shm-pad.h deleted file mode 100644 index 1c596174a8..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/shm-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct shmid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/signum.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/signum.h deleted file mode 100644 index e9fa21916b..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/signum.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Signal number definitions. Linux/MIPS version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/MIPS. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGPWR 19 /* Power failure imminent. */ - -#undef SIGUSR1 -#define SIGUSR1 16 -#undef SIGUSR2 -#define SIGUSR2 17 -#undef SIGCHLD -#define SIGCHLD 18 -#undef SIGWINCH -#define SIGWINCH 20 -#undef SIGURG -#define SIGURG 21 -#undef SIGPOLL -#define SIGPOLL 22 -#undef SIGSTOP -#define SIGSTOP 23 -#undef SIGTSTP -#define SIGTSTP 24 -#undef SIGCONT -#define SIGCONT 25 -#undef SIGTTIN -#define SIGTTIN 26 -#undef SIGTTOU -#define SIGTTOU 27 -#undef SIGVTALRM -#define SIGVTALRM 28 -#undef SIGPROF -#define SIGPROF 29 -#undef SIGXCPU -#define SIGXCPU 30 -#undef SIGXFSZ -#define SIGXFSZ 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 127 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/msq-pad.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/msq-pad.h deleted file mode 100644 index 132f7815a7..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/msq-pad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Define where padding goes in struct msqid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#ifdef __MIPSEL__ -# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) -# define __MSQ_PAD_BEFORE_TIME 0 -#else -# define __MSQ_PAD_AFTER_TIME 0 -# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) -#endif \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/resource.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/resource.h index 11fc73b49d..f2a2c48a9d 100644 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/resource.h +++ b/lib/libc/include/mips64el-linux-gnuabin32/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/sem-pad.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/sem-pad.h deleted file mode 100644 index 0638180f08..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/shm-pad.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/shm-pad.h deleted file mode 100644 index 1c596174a8..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/shm-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct shmid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/signum.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/signum.h deleted file mode 100644 index e9fa21916b..0000000000 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/signum.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Signal number definitions. Linux/MIPS version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/MIPS. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGPWR 19 /* Power failure imminent. */ - -#undef SIGUSR1 -#define SIGUSR1 16 -#undef SIGUSR2 -#define SIGUSR2 17 -#undef SIGCHLD -#define SIGCHLD 18 -#undef SIGWINCH -#define SIGWINCH 20 -#undef SIGURG -#define SIGURG 21 -#undef SIGPOLL -#define SIGPOLL 22 -#undef SIGSTOP -#define SIGSTOP 23 -#undef SIGTSTP -#define SIGTSTP 24 -#undef SIGCONT -#define SIGCONT 25 -#undef SIGTTIN -#define SIGTTIN 26 -#undef SIGTTOU -#define SIGTTOU 27 -#undef SIGVTALRM -#define SIGVTALRM 28 -#undef SIGPROF -#define SIGPROF 29 -#undef SIGXCPU -#define SIGXCPU 30 -#undef SIGXFSZ -#define SIGXFSZ 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 127 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnu/bits/msq-pad.h b/lib/libc/include/mipsel-linux-gnu/bits/msq-pad.h deleted file mode 100644 index 132f7815a7..0000000000 --- a/lib/libc/include/mipsel-linux-gnu/bits/msq-pad.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Define where padding goes in struct msqid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#ifdef __MIPSEL__ -# define __MSQ_PAD_AFTER_TIME (__TIMESIZE == 32) -# define __MSQ_PAD_BEFORE_TIME 0 -#else -# define __MSQ_PAD_AFTER_TIME 0 -# define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) -#endif \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnu/bits/resource.h b/lib/libc/include/mipsel-linux-gnu/bits/resource.h index 11fc73b49d..f2a2c48a9d 100644 --- a/lib/libc/include/mipsel-linux-gnu/bits/resource.h +++ b/lib/libc/include/mipsel-linux-gnu/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/mipsel-linux-gnu/bits/sem-pad.h b/lib/libc/include/mipsel-linux-gnu/bits/sem-pad.h deleted file mode 100644 index 0638180f08..0000000000 --- a/lib/libc/include/mipsel-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnu/bits/shm-pad.h b/lib/libc/include/mipsel-linux-gnu/bits/shm-pad.h deleted file mode 100644 index 1c596174a8..0000000000 --- a/lib/libc/include/mipsel-linux-gnu/bits/shm-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct shmid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnu/bits/signum.h b/lib/libc/include/mipsel-linux-gnu/bits/signum.h deleted file mode 100644 index e9fa21916b..0000000000 --- a/lib/libc/include/mipsel-linux-gnu/bits/signum.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Signal number definitions. Linux/MIPS version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/MIPS. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGPWR 19 /* Power failure imminent. */ - -#undef SIGUSR1 -#define SIGUSR1 16 -#undef SIGUSR2 -#define SIGUSR2 17 -#undef SIGCHLD -#define SIGCHLD 18 -#undef SIGWINCH -#define SIGWINCH 20 -#undef SIGURG -#define SIGURG 21 -#undef SIGPOLL -#define SIGPOLL 22 -#undef SIGSTOP -#define SIGSTOP 23 -#undef SIGTSTP -#define SIGTSTP 24 -#undef SIGCONT -#define SIGCONT 25 -#undef SIGTTIN -#define SIGTTIN 26 -#undef SIGTTOU -#define SIGTTOU 27 -#undef SIGVTALRM -#define SIGVTALRM 28 -#undef SIGPROF -#define SIGPROF 29 -#undef SIGXCPU -#define SIGXCPU 30 -#undef SIGXFSZ -#define SIGXFSZ 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 127 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/fenvinline.h b/lib/libc/include/powerpc-linux-gnu/bits/fenvinline.h deleted file mode 100644 index 695d3a395d..0000000000 --- a/lib/libc/include/powerpc-linux-gnu/bits/fenvinline.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Inline floating-point environment handling functions for powerpc. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__ - -/* Inline definitions for fegetround. */ -# define __fegetround_ISA300() \ - (__extension__ ({ \ - union { double __d; unsigned long long __ll; } __u; \ - __asm__ __volatile__ ( \ - ".machine push; .machine \"power9\"; mffsl %0; .machine pop" \ - : "=f" (__u.__d)); \ - __u.__ll & 0x0000000000000003LL; \ - })) - -# define __fegetround_ISA2() \ - (__extension__ ({ \ - int __fegetround_result; \ - __asm__ __volatile__ ("mcrfs 7,7 ; mfcr %0" \ - : "=r"(__fegetround_result) : : "cr7"); \ - __fegetround_result & 3; \ - })) - -# ifdef _ARCH_PWR9 -# define __fegetround() __fegetround_ISA300() -# elif defined __BUILTIN_CPU_SUPPORTS__ -# define __fegetround() \ - (__glibc_likely (__builtin_cpu_supports ("arch_3_00")) \ - ? __fegetround_ISA300() \ - : __fegetround_ISA2() \ - ) -# else -# define __fegetround() __fegetround_ISA2() -# endif - -# define fegetround() __fegetround () - -# ifndef __NO_MATH_INLINES -/* The weird 'i#*X' constraints on the following suppress a gcc - warning when __excepts is not a constant. Otherwise, they mean the - same as just plain 'i'. */ - -# if __GNUC_PREREQ(3, 4) - -/* Inline definition for feraiseexcept. */ -# define feraiseexcept(__excepts) \ - (__extension__ ({ \ - int __e = __excepts; \ - int __ret; \ - if (__builtin_constant_p (__e) \ - && (__e & (__e - 1)) == 0 \ - && __e != FE_INVALID) \ - { \ - if (__e != 0) \ - __asm__ __volatile__ ("mtfsb1 %0" \ - : : "i#*X" (__builtin_clz (__e))); \ - __ret = 0; \ - } \ - else \ - __ret = feraiseexcept (__e); \ - __ret; \ - })) - -/* Inline definition for feclearexcept. */ -# define feclearexcept(__excepts) \ - (__extension__ ({ \ - int __e = __excepts; \ - int __ret; \ - if (__builtin_constant_p (__e) \ - && (__e & (__e - 1)) == 0 \ - && __e != FE_INVALID) \ - { \ - if (__e != 0) \ - __asm__ __volatile__ ("mtfsb0 %0" \ - : : "i#*X" (__builtin_clz (__e))); \ - __ret = 0; \ - } \ - else \ - __ret = feclearexcept (__e); \ - __ret; \ - })) - -# endif /* __GNUC_PREREQ(3, 4). */ - -# endif /* !__NO_MATH_INLINES. */ - -#endif /* __GNUC__ && !_SOFT_FLOAT && !__NO_FPRS__ */ \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/hwcap.h b/lib/libc/include/powerpc-linux-gnu/bits/hwcap.h index 335efbd0aa..5719e16ac2 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/hwcap.h @@ -73,4 +73,6 @@ #define PPC_FEATURE2_DARN 0x00200000 /* darn instruction. */ #define PPC_FEATURE2_SCV 0x00100000 /* scv syscall. */ #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM without suspended - state. */ \ No newline at end of file + state. */ +#define PPC_FEATURE2_ARCH_3_1 0x00040000 /* ISA 3.1. */ +#define PPC_FEATURE2_MMA 0x00020000 /* Matrix-Multiply Assist. */ \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/iscanonical.h b/lib/libc/include/powerpc-linux-gnu/bits/iscanonical.h index 8818d6fa08..c94a446c49 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/iscanonical.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/iscanonical.h @@ -20,7 +20,7 @@ # error "Never use directly; include instead." #endif -#ifdef __NO_LONG_DOUBLE_MATH +#if defined (__NO_LONG_DOUBLE_MATH) || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # define iscanonical(x) ((void) (__typeof (x)) (x), 1) #else extern int __iscanonicall (long double __x) diff --git a/lib/libc/include/powerpc-linux-gnu/bits/long-double.h b/lib/libc/include/powerpc-linux-gnu/bits/long-double.h index 391f7d62fe..b37f1929bd 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/long-double.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/long-double.h @@ -22,4 +22,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/msq-pad.h b/lib/libc/include/powerpc-linux-gnu/bits/msq-pad.h deleted file mode 100644 index c72a8507da..0000000000 --- a/lib/libc/include/powerpc-linux-gnu/bits/msq-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct msqid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#define __MSQ_PAD_AFTER_TIME 0 -#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/sem-pad.h b/lib/libc/include/powerpc-linux-gnu/bits/sem-pad.h deleted file mode 100644 index e6aca78279..0000000000 --- a/lib/libc/include/powerpc-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct semid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/semaphore.h b/lib/libc/include/powerpc-linux-gnu/bits/semaphore.h index d8dd45053b..97292723c8 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/semaphore.h @@ -1,7 +1,6 @@ -/* Machine-specific POSIX semaphore type layouts. PowerPC version. - Copyright (C) 2003-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Paul Mackerras , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/powerpc-linux-gnu/bits/shm-pad.h b/lib/libc/include/powerpc-linux-gnu/bits/shm-pad.h deleted file mode 100644 index 950fc7d5b5..0000000000 --- a/lib/libc/include/powerpc-linux-gnu/bits/shm-pad.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Define where padding goes in struct shmid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) -#define __SHM_SEGSZ_AFTER_TIME 1 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h b/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h index 762a5673fb..f4db4285af 100644 --- a/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h +++ b/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h @@ -19,8 +19,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/powerpc-linux-gnu/ieee754.h b/lib/libc/include/powerpc-linux-gnu/ieee754.h index dcdca2eb78..9f9206f008 100644 --- a/lib/libc/include/powerpc-linux-gnu/ieee754.h +++ b/lib/libc/include/powerpc-linux-gnu/ieee754.h @@ -21,6 +21,7 @@ #include #include +#include __BEGIN_DECLS @@ -111,6 +112,65 @@ union ieee754_double #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +/* long double is IEEE 128 bit */ +union ieee854_long_double + { + long double d; + + /* This is the IEEE 854 quad-precision format. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:15; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:16; + unsigned int mantissa1:32; + unsigned int mantissa2:32; + unsigned int mantissa3:32; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + /* Together these comprise the mantissa. */ + unsigned int mantissa3:32; + unsigned int mantissa2:32; + unsigned int mantissa1:32; + unsigned int mantissa0:16; + unsigned int exponent:15; + unsigned int negative:1; +#endif /* Little endian. */ + } ieee; + + /* This format makes it easier to see if a NaN is a signalling NaN. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:15; + unsigned int quiet_nan:1; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:15; + unsigned int mantissa1:32; + unsigned int mantissa2:32; + unsigned int mantissa3:32; +#else + /* Together these comprise the mantissa. */ + unsigned int mantissa3:32; + unsigned int mantissa2:32; + unsigned int mantissa1:32; + unsigned int mantissa0:15; + unsigned int quiet_nan:1; + unsigned int exponent:15; + unsigned int negative:1; +#endif + } ieee_nan; + }; + +#define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ +#endif + + +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 || __GNUC_PREREQ (7, 0) /* IBM extended format for long double. Each long double is made up of two IEEE doubles. The value of the @@ -121,12 +181,16 @@ union ieee754_double -0.0. No other requirements are made; so, for example, 1.0 may be represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a NaN is don't-care. */ - union ibm_extended_long_double { - long double ld; +# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && __GNUC_PREREQ (7, 0) + __ibm128 ld; +# else + long double ld; +# endif union ieee754_double d[2]; }; +#endif __END_DECLS diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/fenvinline.h b/lib/libc/include/powerpc64-linux-gnu/bits/fenvinline.h deleted file mode 100644 index 695d3a395d..0000000000 --- a/lib/libc/include/powerpc64-linux-gnu/bits/fenvinline.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Inline floating-point environment handling functions for powerpc. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__ - -/* Inline definitions for fegetround. */ -# define __fegetround_ISA300() \ - (__extension__ ({ \ - union { double __d; unsigned long long __ll; } __u; \ - __asm__ __volatile__ ( \ - ".machine push; .machine \"power9\"; mffsl %0; .machine pop" \ - : "=f" (__u.__d)); \ - __u.__ll & 0x0000000000000003LL; \ - })) - -# define __fegetround_ISA2() \ - (__extension__ ({ \ - int __fegetround_result; \ - __asm__ __volatile__ ("mcrfs 7,7 ; mfcr %0" \ - : "=r"(__fegetround_result) : : "cr7"); \ - __fegetround_result & 3; \ - })) - -# ifdef _ARCH_PWR9 -# define __fegetround() __fegetround_ISA300() -# elif defined __BUILTIN_CPU_SUPPORTS__ -# define __fegetround() \ - (__glibc_likely (__builtin_cpu_supports ("arch_3_00")) \ - ? __fegetround_ISA300() \ - : __fegetround_ISA2() \ - ) -# else -# define __fegetround() __fegetround_ISA2() -# endif - -# define fegetround() __fegetround () - -# ifndef __NO_MATH_INLINES -/* The weird 'i#*X' constraints on the following suppress a gcc - warning when __excepts is not a constant. Otherwise, they mean the - same as just plain 'i'. */ - -# if __GNUC_PREREQ(3, 4) - -/* Inline definition for feraiseexcept. */ -# define feraiseexcept(__excepts) \ - (__extension__ ({ \ - int __e = __excepts; \ - int __ret; \ - if (__builtin_constant_p (__e) \ - && (__e & (__e - 1)) == 0 \ - && __e != FE_INVALID) \ - { \ - if (__e != 0) \ - __asm__ __volatile__ ("mtfsb1 %0" \ - : : "i#*X" (__builtin_clz (__e))); \ - __ret = 0; \ - } \ - else \ - __ret = feraiseexcept (__e); \ - __ret; \ - })) - -/* Inline definition for feclearexcept. */ -# define feclearexcept(__excepts) \ - (__extension__ ({ \ - int __e = __excepts; \ - int __ret; \ - if (__builtin_constant_p (__e) \ - && (__e & (__e - 1)) == 0 \ - && __e != FE_INVALID) \ - { \ - if (__e != 0) \ - __asm__ __volatile__ ("mtfsb0 %0" \ - : : "i#*X" (__builtin_clz (__e))); \ - __ret = 0; \ - } \ - else \ - __ret = feclearexcept (__e); \ - __ret; \ - })) - -# endif /* __GNUC_PREREQ(3, 4). */ - -# endif /* !__NO_MATH_INLINES. */ - -#endif /* __GNUC__ && !_SOFT_FLOAT && !__NO_FPRS__ */ \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/hwcap.h b/lib/libc/include/powerpc64-linux-gnu/bits/hwcap.h index 335efbd0aa..5719e16ac2 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/hwcap.h @@ -73,4 +73,6 @@ #define PPC_FEATURE2_DARN 0x00200000 /* darn instruction. */ #define PPC_FEATURE2_SCV 0x00100000 /* scv syscall. */ #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM without suspended - state. */ \ No newline at end of file + state. */ +#define PPC_FEATURE2_ARCH_3_1 0x00040000 /* ISA 3.1. */ +#define PPC_FEATURE2_MMA 0x00020000 /* Matrix-Multiply Assist. */ \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/iscanonical.h b/lib/libc/include/powerpc64-linux-gnu/bits/iscanonical.h index 8818d6fa08..c94a446c49 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/iscanonical.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/iscanonical.h @@ -20,7 +20,7 @@ # error "Never use directly; include instead." #endif -#ifdef __NO_LONG_DOUBLE_MATH +#if defined (__NO_LONG_DOUBLE_MATH) || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # define iscanonical(x) ((void) (__typeof (x)) (x), 1) #else extern int __iscanonicall (long double __x) diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/long-double.h b/lib/libc/include/powerpc64-linux-gnu/bits/long-double.h index 391f7d62fe..b37f1929bd 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/long-double.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/long-double.h @@ -22,4 +22,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/msq-pad.h b/lib/libc/include/powerpc64-linux-gnu/bits/msq-pad.h deleted file mode 100644 index c72a8507da..0000000000 --- a/lib/libc/include/powerpc64-linux-gnu/bits/msq-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct msqid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#define __MSQ_PAD_AFTER_TIME 0 -#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/sem-pad.h b/lib/libc/include/powerpc64-linux-gnu/bits/sem-pad.h deleted file mode 100644 index e6aca78279..0000000000 --- a/lib/libc/include/powerpc64-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct semid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/semaphore.h b/lib/libc/include/powerpc64-linux-gnu/bits/semaphore.h index d8dd45053b..97292723c8 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/semaphore.h @@ -1,7 +1,6 @@ -/* Machine-specific POSIX semaphore type layouts. PowerPC version. - Copyright (C) 2003-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Paul Mackerras , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/shm-pad.h b/lib/libc/include/powerpc64-linux-gnu/bits/shm-pad.h deleted file mode 100644 index 950fc7d5b5..0000000000 --- a/lib/libc/include/powerpc64-linux-gnu/bits/shm-pad.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Define where padding goes in struct shmid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) -#define __SHM_SEGSZ_AFTER_TIME 1 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/gnu/lib-names-64-v1.h b/lib/libc/include/powerpc64-linux-gnu/gnu/lib-names-64-v1.h index 143f904e09..22c0732548 100644 --- a/lib/libc/include/powerpc64-linux-gnu/gnu/lib-names-64-v1.h +++ b/lib/libc/include/powerpc64-linux-gnu/gnu/lib-names-64-v1.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/powerpc64-linux-gnu/gnu/stubs-64-v1.h b/lib/libc/include/powerpc64-linux-gnu/gnu/stubs-64-v1.h index 12c0d956e8..636dc73283 100644 --- a/lib/libc/include/powerpc64-linux-gnu/gnu/stubs-64-v1.h +++ b/lib/libc/include/powerpc64-linux-gnu/gnu/stubs-64-v1.h @@ -10,9 +10,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/ieee754.h b/lib/libc/include/powerpc64-linux-gnu/ieee754.h index dcdca2eb78..9f9206f008 100644 --- a/lib/libc/include/powerpc64-linux-gnu/ieee754.h +++ b/lib/libc/include/powerpc64-linux-gnu/ieee754.h @@ -21,6 +21,7 @@ #include #include +#include __BEGIN_DECLS @@ -111,6 +112,65 @@ union ieee754_double #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +/* long double is IEEE 128 bit */ +union ieee854_long_double + { + long double d; + + /* This is the IEEE 854 quad-precision format. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:15; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:16; + unsigned int mantissa1:32; + unsigned int mantissa2:32; + unsigned int mantissa3:32; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + /* Together these comprise the mantissa. */ + unsigned int mantissa3:32; + unsigned int mantissa2:32; + unsigned int mantissa1:32; + unsigned int mantissa0:16; + unsigned int exponent:15; + unsigned int negative:1; +#endif /* Little endian. */ + } ieee; + + /* This format makes it easier to see if a NaN is a signalling NaN. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:15; + unsigned int quiet_nan:1; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:15; + unsigned int mantissa1:32; + unsigned int mantissa2:32; + unsigned int mantissa3:32; +#else + /* Together these comprise the mantissa. */ + unsigned int mantissa3:32; + unsigned int mantissa2:32; + unsigned int mantissa1:32; + unsigned int mantissa0:15; + unsigned int quiet_nan:1; + unsigned int exponent:15; + unsigned int negative:1; +#endif + } ieee_nan; + }; + +#define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ +#endif + + +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 || __GNUC_PREREQ (7, 0) /* IBM extended format for long double. Each long double is made up of two IEEE doubles. The value of the @@ -121,12 +181,16 @@ union ieee754_double -0.0. No other requirements are made; so, for example, 1.0 may be represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a NaN is don't-care. */ - union ibm_extended_long_double { - long double ld; +# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && __GNUC_PREREQ (7, 0) + __ibm128 ld; +# else + long double ld; +# endif union ieee754_double d[2]; }; +#endif __END_DECLS diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/fenvinline.h b/lib/libc/include/powerpc64le-linux-gnu/bits/fenvinline.h deleted file mode 100644 index 695d3a395d..0000000000 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/fenvinline.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Inline floating-point environment handling functions for powerpc. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__ - -/* Inline definitions for fegetround. */ -# define __fegetround_ISA300() \ - (__extension__ ({ \ - union { double __d; unsigned long long __ll; } __u; \ - __asm__ __volatile__ ( \ - ".machine push; .machine \"power9\"; mffsl %0; .machine pop" \ - : "=f" (__u.__d)); \ - __u.__ll & 0x0000000000000003LL; \ - })) - -# define __fegetround_ISA2() \ - (__extension__ ({ \ - int __fegetround_result; \ - __asm__ __volatile__ ("mcrfs 7,7 ; mfcr %0" \ - : "=r"(__fegetround_result) : : "cr7"); \ - __fegetround_result & 3; \ - })) - -# ifdef _ARCH_PWR9 -# define __fegetround() __fegetround_ISA300() -# elif defined __BUILTIN_CPU_SUPPORTS__ -# define __fegetround() \ - (__glibc_likely (__builtin_cpu_supports ("arch_3_00")) \ - ? __fegetround_ISA300() \ - : __fegetround_ISA2() \ - ) -# else -# define __fegetround() __fegetround_ISA2() -# endif - -# define fegetround() __fegetround () - -# ifndef __NO_MATH_INLINES -/* The weird 'i#*X' constraints on the following suppress a gcc - warning when __excepts is not a constant. Otherwise, they mean the - same as just plain 'i'. */ - -# if __GNUC_PREREQ(3, 4) - -/* Inline definition for feraiseexcept. */ -# define feraiseexcept(__excepts) \ - (__extension__ ({ \ - int __e = __excepts; \ - int __ret; \ - if (__builtin_constant_p (__e) \ - && (__e & (__e - 1)) == 0 \ - && __e != FE_INVALID) \ - { \ - if (__e != 0) \ - __asm__ __volatile__ ("mtfsb1 %0" \ - : : "i#*X" (__builtin_clz (__e))); \ - __ret = 0; \ - } \ - else \ - __ret = feraiseexcept (__e); \ - __ret; \ - })) - -/* Inline definition for feclearexcept. */ -# define feclearexcept(__excepts) \ - (__extension__ ({ \ - int __e = __excepts; \ - int __ret; \ - if (__builtin_constant_p (__e) \ - && (__e & (__e - 1)) == 0 \ - && __e != FE_INVALID) \ - { \ - if (__e != 0) \ - __asm__ __volatile__ ("mtfsb0 %0" \ - : : "i#*X" (__builtin_clz (__e))); \ - __ret = 0; \ - } \ - else \ - __ret = feclearexcept (__e); \ - __ret; \ - })) - -# endif /* __GNUC_PREREQ(3, 4). */ - -# endif /* !__NO_MATH_INLINES. */ - -#endif /* __GNUC__ && !_SOFT_FLOAT && !__NO_FPRS__ */ \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/hwcap.h b/lib/libc/include/powerpc64le-linux-gnu/bits/hwcap.h index 335efbd0aa..5719e16ac2 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/hwcap.h @@ -73,4 +73,6 @@ #define PPC_FEATURE2_DARN 0x00200000 /* darn instruction. */ #define PPC_FEATURE2_SCV 0x00100000 /* scv syscall. */ #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM without suspended - state. */ \ No newline at end of file + state. */ +#define PPC_FEATURE2_ARCH_3_1 0x00040000 /* ISA 3.1. */ +#define PPC_FEATURE2_MMA 0x00020000 /* Matrix-Multiply Assist. */ \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/iscanonical.h b/lib/libc/include/powerpc64le-linux-gnu/bits/iscanonical.h index 8818d6fa08..c94a446c49 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/iscanonical.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/iscanonical.h @@ -20,7 +20,7 @@ # error "Never use directly; include instead." #endif -#ifdef __NO_LONG_DOUBLE_MATH +#if defined (__NO_LONG_DOUBLE_MATH) || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 # define iscanonical(x) ((void) (__typeof (x)) (x), 1) #else extern int __iscanonicall (long double __x) diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h b/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h index 391f7d62fe..bfeb899917 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h @@ -1,5 +1,5 @@ /* Properties of long double type. ldbl-opt version. - Copyright (C) 2016-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,4 +22,5 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file + +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI (__LDBL_MANT_DIG__ == 113) \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/msq-pad.h b/lib/libc/include/powerpc64le-linux-gnu/bits/msq-pad.h deleted file mode 100644 index c72a8507da..0000000000 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/msq-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct msqid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#define __MSQ_PAD_AFTER_TIME 0 -#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/sem-pad.h b/lib/libc/include/powerpc64le-linux-gnu/bits/sem-pad.h deleted file mode 100644 index e6aca78279..0000000000 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct semid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/semaphore.h b/lib/libc/include/powerpc64le-linux-gnu/bits/semaphore.h index d8dd45053b..97292723c8 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/semaphore.h @@ -1,7 +1,6 @@ -/* Machine-specific POSIX semaphore type layouts. PowerPC version. - Copyright (C) 2003-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Paul Mackerras , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/shm-pad.h b/lib/libc/include/powerpc64le-linux-gnu/bits/shm-pad.h deleted file mode 100644 index 950fc7d5b5..0000000000 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/shm-pad.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Define where padding goes in struct shmid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) -#define __SHM_SEGSZ_AFTER_TIME 1 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/gnu/lib-names-64-v2.h b/lib/libc/include/powerpc64le-linux-gnu/gnu/lib-names-64-v2.h index c26da6b2cd..b8e68b6c89 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/gnu/lib-names-64-v2.h +++ b/lib/libc/include/powerpc64le-linux-gnu/gnu/lib-names-64-v2.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h b/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h index 12c0d956e8..636dc73283 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h +++ b/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h @@ -10,9 +10,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/ieee754.h b/lib/libc/include/powerpc64le-linux-gnu/ieee754.h index dcdca2eb78..9f9206f008 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/ieee754.h +++ b/lib/libc/include/powerpc64le-linux-gnu/ieee754.h @@ -21,6 +21,7 @@ #include #include +#include __BEGIN_DECLS @@ -111,6 +112,65 @@ union ieee754_double #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +/* long double is IEEE 128 bit */ +union ieee854_long_double + { + long double d; + + /* This is the IEEE 854 quad-precision format. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:15; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:16; + unsigned int mantissa1:32; + unsigned int mantissa2:32; + unsigned int mantissa3:32; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + /* Together these comprise the mantissa. */ + unsigned int mantissa3:32; + unsigned int mantissa2:32; + unsigned int mantissa1:32; + unsigned int mantissa0:16; + unsigned int exponent:15; + unsigned int negative:1; +#endif /* Little endian. */ + } ieee; + + /* This format makes it easier to see if a NaN is a signalling NaN. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:15; + unsigned int quiet_nan:1; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:15; + unsigned int mantissa1:32; + unsigned int mantissa2:32; + unsigned int mantissa3:32; +#else + /* Together these comprise the mantissa. */ + unsigned int mantissa3:32; + unsigned int mantissa2:32; + unsigned int mantissa1:32; + unsigned int mantissa0:15; + unsigned int quiet_nan:1; + unsigned int exponent:15; + unsigned int negative:1; +#endif + } ieee_nan; + }; + +#define IEEE854_LONG_DOUBLE_BIAS 0x3fff /* Added to exponent. */ +#endif + + +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 || __GNUC_PREREQ (7, 0) /* IBM extended format for long double. Each long double is made up of two IEEE doubles. The value of the @@ -121,12 +181,16 @@ union ieee754_double -0.0. No other requirements are made; so, for example, 1.0 may be represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a NaN is don't-care. */ - union ibm_extended_long_double { - long double ld; +# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && __GNUC_PREREQ (7, 0) + __ibm128 ld; +# else + long double ld; +# endif union ieee754_double d[2]; }; +#endif __END_DECLS diff --git a/lib/libc/include/riscv64-linux-gnu/bits/long-double.h b/lib/libc/include/riscv64-linux-gnu/bits/long-double.h index ce06962796..f95b24f8e7 100644 --- a/lib/libc/include/riscv64-linux-gnu/bits/long-double.h +++ b/lib/libc/include/riscv64-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/riscv64-linux-gnu/bits/semaphore.h b/lib/libc/include/riscv64-linux-gnu/bits/semaphore.h index 7277c658e8..97292723c8 100644 --- a/lib/libc/include/riscv64-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/riscv64-linux-gnu/bits/semaphore.h @@ -1,5 +1,5 @@ -/* Machine-specific POSIX semaphore type layouts. RISC-V version. - Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,14 +13,20 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ #ifndef _SEMAPHORE_H # error "Never use directly; include instead." #endif -#define __SIZEOF_SEM_T (4 * __SIZEOF_POINTER__) +#include + +#if __WORDSIZE == 64 +# define __SIZEOF_SEM_T 32 +#else +# define __SIZEOF_SEM_T 16 +#endif /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h b/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h index d9e9b274ac..a5f4c78b94 100644 --- a/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h @@ -26,31 +26,45 @@ /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ +#if __TIMESIZE == 64 && __WORDSIZE == 32 +/* These are the "new" y2038 types defined for architectures added after + the 5.1 kernel. */ +# define __INO_T_TYPE __UQUAD_TYPE +# define __OFF_T_TYPE __SQUAD_TYPE +# define __RLIM_T_TYPE __UQUAD_TYPE +# define __BLKCNT_T_TYPE __SQUAD_TYPE +# define __FSBLKCNT_T_TYPE __UQUAD_TYPE +# define __FSFILCNT_T_TYPE __UQUAD_TYPE +# define __TIME_T_TYPE __SQUAD_TYPE +# define __SUSECONDS_T_TYPE __SQUAD_TYPE +#else +# define __INO_T_TYPE __ULONGWORD_TYPE +# define __OFF_T_TYPE __SLONGWORD_TYPE +# define __RLIM_T_TYPE __ULONGWORD_TYPE +# define __BLKCNT_T_TYPE __SLONGWORD_TYPE +# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +# define __TIME_T_TYPE __SLONGWORD_TYPE +# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#endif #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE -#define __INO_T_TYPE __ULONGWORD_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #define __NLINK_T_TYPE __U32_TYPE -#define __OFF_T_TYPE __SLONGWORD_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE -#define __RLIM_T_TYPE __ULONGWORD_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT_T_TYPE __SLONGWORD_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE -#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __FSWORD_T_TYPE __SWORD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SLONGWORD_TYPE -#define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -62,7 +76,7 @@ #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #define __CPU_MASK_TYPE __ULONGWORD_TYPE -#ifdef __LP64__ +#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ @@ -76,11 +90,17 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64) #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif + /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 diff --git a/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64.h b/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64.h index 7e92db0ded..c157deb8cf 100644 --- a/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64.h +++ b/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64.h b/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64.h index 6ac6614fb7..6ce02418e6 100644 --- a/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64.h +++ b/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64.h @@ -32,10 +32,7 @@ #define __stub_fetestexcept #define __stub_feupdateenv #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk -#define __stub_stty -#define __stub_sysctl \ No newline at end of file +#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/fenv.h b/lib/libc/include/s390x-linux-gnu/bits/fenv.h index 281e760819..5bf167975e 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/fenv.h +++ b/lib/libc/include/s390x-linux-gnu/bits/fenv.h @@ -73,14 +73,14 @@ typedef unsigned int fexcept_t; /* size of fpc */ /* Type representing floating-point environment. This function corresponds - to the layout of the block written by the `fstenv'. */ + to the layout of the block used by fegetenv and fesetenv. */ typedef struct { fexcept_t __fpc; void *__unused; /* The field __unused (formerly __ieee_instruction_pointer) is a relict from commit "Remove PTRACE_PEEKUSER" (87b9b50f0d4b92248905e95a06a13c513dc45e59) - and isn´t used anymore. */ + and isn't used anymore. */ } fenv_t; /* If the default argument is used we use this value. */ diff --git a/lib/libc/include/s390x-linux-gnu/bits/long-double.h b/lib/libc/include/s390x-linux-gnu/bits/long-double.h index 391f7d62fe..b37f1929bd 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/long-double.h +++ b/lib/libc/include/s390x-linux-gnu/bits/long-double.h @@ -22,4 +22,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/semaphore.h b/lib/libc/include/s390x-linux-gnu/bits/semaphore.h index d99eca3d90..97292723c8 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/s390x-linux-gnu/bits/semaphore.h @@ -1,6 +1,6 @@ -/* Copyright (C) 2003-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Martin Schwidefsky , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/s390x-linux-gnu/bits/typesizes.h b/lib/libc/include/s390x-linux-gnu/bits/typesizes.h index d31219c155..fecd80e33a 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/s390x-linux-gnu/bits/typesizes.h @@ -50,6 +50,7 @@ #define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -81,10 +82,16 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h b/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h index 268b163638..1f26b2ab53 100644 --- a/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h +++ b/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/sparc-linux-gnu/bits/fenv.h b/lib/libc/include/sparc-linux-gnu/bits/fenv.h index 408a29f7b6..7eba346aa7 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/fenv.h +++ b/lib/libc/include/sparc-linux-gnu/bits/fenv.h @@ -83,15 +83,6 @@ typedef unsigned long int fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -/* For internal use only: access the fp state register. */ -#if __WORDSIZE == 64 -# define __fenv_stfsr(X) __asm__ __volatile__ ("stx %%fsr,%0" : "=m" (X)) -# define __fenv_ldfsr(X) __asm__ __volatile__ ("ldx %0,%%fsr" : : "m" (X)) -#else -# define __fenv_stfsr(X) __asm__ __volatile__ ("st %%fsr,%0" : "=m" (X)) -# define __fenv_ldfsr(X) __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (X)) -#endif - #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) /* Type representing floating-point control modes. */ typedef unsigned long int femode_t; diff --git a/lib/libc/include/sparc-linux-gnu/bits/long-double.h b/lib/libc/include/sparc-linux-gnu/bits/long-double.h index e32f6ad721..de5e60beb8 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/long-double.h +++ b/lib/libc/include/sparc-linux-gnu/bits/long-double.h @@ -24,4 +24,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/msq-pad.h b/lib/libc/include/sparc-linux-gnu/bits/msq-pad.h deleted file mode 100644 index 6e05183c93..0000000000 --- a/lib/libc/include/sparc-linux-gnu/bits/msq-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct msqid_ds. SPARC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#define __MSQ_PAD_AFTER_TIME 0 -#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/resource.h b/lib/libc/include/sparc-linux-gnu/bits/resource.h index 34605679a3..3cfbfd381c 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/resource.h +++ b/lib/libc/include/sparc-linux-gnu/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/sparc-linux-gnu/bits/sem-pad.h b/lib/libc/include/sparc-linux-gnu/bits/sem-pad.h deleted file mode 100644 index 75a0a010c9..0000000000 --- a/lib/libc/include/sparc-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct semid_ds. SPARC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/semaphore.h b/lib/libc/include/sparc-linux-gnu/bits/semaphore.h index ee2f8e0ca5..97292723c8 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/sparc-linux-gnu/bits/semaphore.h @@ -1,7 +1,6 @@ -/* Machine-specific POSIX semaphore type layouts. SPARC version. - Copyright (C) 2003-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Jakub Jelinek , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/sparc-linux-gnu/bits/shm-pad.h b/lib/libc/include/sparc-linux-gnu/bits/shm-pad.h deleted file mode 100644 index 6f9480247f..0000000000 --- a/lib/libc/include/sparc-linux-gnu/bits/shm-pad.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Define where padding goes in struct shmid_ds. SPARC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) -#define __SHM_SEGSZ_AFTER_TIME 1 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/signum.h b/lib/libc/include/sparc-linux-gnu/bits/signum.h deleted file mode 100644 index 2890ba7808..0000000000 --- a/lib/libc/include/sparc-linux-gnu/bits/signum.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Signal number definitions. Linux/SPARC version. - Copyright (C) 1996-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/SPARC systems. Signal values on this platform were chosen - for SunOS binary compatibility. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGLOST 29 /* Resource lost (Sun); server died (GNU). */ -#define SIGPWR SIGLOST /* Power failure imminent (SysV). */ - -#undef __SIGRTMAX -#define __SIGRTMAX 64 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/typesizes.h b/lib/libc/include/sparc-linux-gnu/bits/typesizes.h index 123acf7d25..ebff4bdbcc 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/sparc-linux-gnu/bits/typesizes.h @@ -50,6 +50,7 @@ #define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __S32_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -75,10 +76,16 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h b/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h index 08e73abcba..0f86fee604 100644 --- a/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h +++ b/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/fenv.h b/lib/libc/include/sparcv9-linux-gnu/bits/fenv.h index 408a29f7b6..7eba346aa7 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/fenv.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/fenv.h @@ -83,15 +83,6 @@ typedef unsigned long int fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -/* For internal use only: access the fp state register. */ -#if __WORDSIZE == 64 -# define __fenv_stfsr(X) __asm__ __volatile__ ("stx %%fsr,%0" : "=m" (X)) -# define __fenv_ldfsr(X) __asm__ __volatile__ ("ldx %0,%%fsr" : : "m" (X)) -#else -# define __fenv_stfsr(X) __asm__ __volatile__ ("st %%fsr,%0" : "=m" (X)) -# define __fenv_ldfsr(X) __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (X)) -#endif - #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) /* Type representing floating-point control modes. */ typedef unsigned long int femode_t; diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/long-double.h b/lib/libc/include/sparcv9-linux-gnu/bits/long-double.h index e32f6ad721..de5e60beb8 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/long-double.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/long-double.h @@ -24,4 +24,4 @@ # define __NO_LONG_DOUBLE_MATH 1 # endif #endif -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/msq-pad.h b/lib/libc/include/sparcv9-linux-gnu/bits/msq-pad.h deleted file mode 100644 index 6e05183c93..0000000000 --- a/lib/libc/include/sparcv9-linux-gnu/bits/msq-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct msqid_ds. SPARC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_MSG_H -# error "Never use directly; include instead." -#endif - -#include - -#define __MSQ_PAD_AFTER_TIME 0 -#define __MSQ_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/resource.h b/lib/libc/include/sparcv9-linux-gnu/bits/resource.h index 34605679a3..3cfbfd381c 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/resource.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/resource.h @@ -98,7 +98,7 @@ enum __rlimit_resource __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/sem-pad.h b/lib/libc/include/sparcv9-linux-gnu/bits/sem-pad.h deleted file mode 100644 index 75a0a010c9..0000000000 --- a/lib/libc/include/sparcv9-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct semid_ds. SPARC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SEM_PAD_AFTER_TIME 0 -#define __SEM_PAD_BEFORE_TIME (__TIMESIZE == 32) \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/semaphore.h b/lib/libc/include/sparcv9-linux-gnu/bits/semaphore.h index ee2f8e0ca5..97292723c8 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/semaphore.h @@ -1,7 +1,6 @@ -/* Machine-specific POSIX semaphore type layouts. SPARC version. - Copyright (C) 2003-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Jakub Jelinek , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/shm-pad.h b/lib/libc/include/sparcv9-linux-gnu/bits/shm-pad.h deleted file mode 100644 index 6f9480247f..0000000000 --- a/lib/libc/include/sparcv9-linux-gnu/bits/shm-pad.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Define where padding goes in struct shmid_ds. SPARC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) -#define __SHM_SEGSZ_AFTER_TIME 1 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/signum.h b/lib/libc/include/sparcv9-linux-gnu/bits/signum.h deleted file mode 100644 index 2890ba7808..0000000000 --- a/lib/libc/include/sparcv9-linux-gnu/bits/signum.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Signal number definitions. Linux/SPARC version. - Copyright (C) 1996-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include directly; use instead." -#endif - -#include - -/* Adjustments and additions to the signal number constants for - Linux/SPARC systems. Signal values on this platform were chosen - for SunOS binary compatibility. */ - -#define SIGEMT 7 /* Emulator trap. */ -#define SIGLOST 29 /* Resource lost (Sun); server died (GNU). */ -#define SIGPWR SIGLOST /* Power failure imminent (SysV). */ - -#undef __SIGRTMAX -#define __SIGRTMAX 64 - -#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/sparcv9-linux-gnu/bits/typesizes.h b/lib/libc/include/sparcv9-linux-gnu/bits/typesizes.h index 123acf7d25..ebff4bdbcc 100644 --- a/lib/libc/include/sparcv9-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/sparcv9-linux-gnu/bits/typesizes.h @@ -50,6 +50,7 @@ #define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __S32_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -75,10 +76,16 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/x86_64-linux-gnu/bits/fenv.h b/lib/libc/include/x86_64-linux-gnu/bits/fenv.h index 3164b63556..b504e27b15 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/fenv.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/fenv.h @@ -113,58 +113,4 @@ femode_t; /* Default floating-point control modes. */ # define FE_DFL_MODE ((const femode_t *) -1L) -#endif - - -#ifdef __USE_EXTERN_INLINES -__BEGIN_DECLS - -/* Optimized versions. */ -#ifndef _LIBC -extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept); -#endif -__extern_always_inline void -__NTH (__feraiseexcept_invalid_divbyzero (int __excepts)) -{ - if ((FE_INVALID & __excepts) != 0) - { - /* One example of an invalid operation is 0.0 / 0.0. */ - float __f = 0.0; - -# ifdef __SSE_MATH__ - __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f)); -# else - __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait" - : "=t" (__f) : "0" (__f)); -# endif - (void) &__f; - } - if ((FE_DIVBYZERO & __excepts) != 0) - { - float __f = 1.0; - float __g = 0.0; - -# ifdef __SSE_MATH__ - __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g)); -# else - __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait" - : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)"); -# endif - (void) &__f; - } -} -__extern_inline int -__NTH (feraiseexcept (int __excepts)) -{ - if (__builtin_constant_p (__excepts) - && (__excepts & ~(FE_INVALID | FE_DIVBYZERO)) == 0) - { - __feraiseexcept_invalid_divbyzero (__excepts); - return 0; - } - - return __feraiseexcept_renamed (__excepts); -} - -__END_DECLS #endif \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/long-double.h b/lib/libc/include/x86_64-linux-gnu/bits/long-double.h index a7bd8fb163..75bc1fcce4 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/long-double.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/select.h b/lib/libc/include/x86_64-linux-gnu/bits/select.h index 959d998266..d71b5e4ce2 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/select.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/select.h @@ -19,45 +19,19 @@ # error "Never use directly; include instead." #endif -#include - - -#if defined __GNUC__ && __GNUC__ >= 2 - -# if __WORDSIZE == 64 -# define __FD_ZERO_STOS "stosq" -# else -# define __FD_ZERO_STOS "stosl" -# endif - -# define __FD_ZERO(fdsp) \ - do { \ - int __d0, __d1; \ - __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \ - : "=c" (__d0), "=D" (__d1) \ - : "a" (0), "0" (sizeof (fd_set) \ - / sizeof (__fd_mask)), \ - "1" (&__FDS_BITS (fdsp)[0]) \ - : "memory"); \ - } while (0) - -#else /* ! GNU CC */ /* We don't use `memset' because this would require a prototype and the array isn't too big. */ -# define __FD_ZERO(set) \ +#define __FD_ZERO(s) \ do { \ unsigned int __i; \ - fd_set *__arr = (set); \ + fd_set *__arr = (s); \ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) - -#endif /* GNU CC */ - -#define __FD_SET(d, set) \ - ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d))) -#define __FD_CLR(d, set) \ - ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d))) -#define __FD_ISSET(d, set) \ - ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file +#define __FD_SET(d, s) \ + ((void) (__FDS_BITS (s)[__FD_ELT(d)] |= __FD_MASK(d))) +#define __FD_CLR(d, s) \ + ((void) (__FDS_BITS (s)[__FD_ELT(d)] &= ~__FD_MASK(d))) +#define __FD_ISSET(d, s) \ + ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/sem-pad.h b/lib/libc/include/x86_64-linux-gnu/bits/sem-pad.h deleted file mode 100644 index 10534c61cf..0000000000 --- a/lib/libc/include/x86_64-linux-gnu/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. x86 version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 1 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/semaphore.h b/lib/libc/include/x86_64-linux-gnu/bits/semaphore.h index 7f41d9a880..97292723c8 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/semaphore.h @@ -1,6 +1,6 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,6 @@ # define __SIZEOF_SEM_T 16 #endif - /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/x86_64-linux-gnu/bits/sysctl.h b/lib/libc/include/x86_64-linux-gnu/bits/sysctl.h deleted file mode 100644 index 5e2b946cdf..0000000000 --- a/lib/libc/include/x86_64-linux-gnu/bits/sysctl.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2012-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#if defined __x86_64__ && defined __ILP32__ -# error "sysctl system call is unsupported in x32 kernel" -#endif \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnu/bits/typesizes.h b/lib/libc/include/x86_64-linux-gnu/bits/typesizes.h index 7ad60c3f43..53ae0bd5ef 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/typesizes.h @@ -64,6 +64,7 @@ #define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -87,10 +88,15 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/x86_64-linux-gnu/gnu/lib-names-64.h b/lib/libc/include/x86_64-linux-gnu/gnu/lib-names-64.h index 3d707eaca3..03d0df5edf 100644 --- a/lib/libc/include/x86_64-linux-gnu/gnu/lib-names-64.h +++ b/lib/libc/include/x86_64-linux-gnu/gnu/lib-names-64.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/x86_64-linux-gnu/gnu/stubs-64.h b/lib/libc/include/x86_64-linux-gnu/gnu/stubs-64.h index 5ce8c64bba..d4b87af1a5 100644 --- a/lib/libc/include/x86_64-linux-gnu/gnu/stubs-64.h +++ b/lib/libc/include/x86_64-linux-gnu/gnu/stubs-64.h @@ -11,9 +11,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h b/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h index 3164b63556..b504e27b15 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h @@ -113,58 +113,4 @@ femode_t; /* Default floating-point control modes. */ # define FE_DFL_MODE ((const femode_t *) -1L) -#endif - - -#ifdef __USE_EXTERN_INLINES -__BEGIN_DECLS - -/* Optimized versions. */ -#ifndef _LIBC -extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept); -#endif -__extern_always_inline void -__NTH (__feraiseexcept_invalid_divbyzero (int __excepts)) -{ - if ((FE_INVALID & __excepts) != 0) - { - /* One example of an invalid operation is 0.0 / 0.0. */ - float __f = 0.0; - -# ifdef __SSE_MATH__ - __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f)); -# else - __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait" - : "=t" (__f) : "0" (__f)); -# endif - (void) &__f; - } - if ((FE_DIVBYZERO & __excepts) != 0) - { - float __f = 1.0; - float __g = 0.0; - -# ifdef __SSE_MATH__ - __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g)); -# else - __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait" - : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)"); -# endif - (void) &__f; - } -} -__extern_inline int -__NTH (feraiseexcept (int __excepts)) -{ - if (__builtin_constant_p (__excepts) - && (__excepts & ~(FE_INVALID | FE_DIVBYZERO)) == 0) - { - __feraiseexcept_invalid_divbyzero (__excepts); - return 0; - } - - return __feraiseexcept_renamed (__excepts); -} - -__END_DECLS #endif \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/long-double.h b/lib/libc/include/x86_64-linux-gnux32/bits/long-double.h index a7bd8fb163..75bc1fcce4 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/long-double.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/long-double.h @@ -18,4 +18,4 @@ /* long double is distinct from double, so there is nothing to define here. */ -#define __LONG_DOUBLE_USES_FLOAT128 0 \ No newline at end of file +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/select.h b/lib/libc/include/x86_64-linux-gnux32/bits/select.h index 959d998266..d71b5e4ce2 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/select.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/select.h @@ -19,45 +19,19 @@ # error "Never use directly; include instead." #endif -#include - - -#if defined __GNUC__ && __GNUC__ >= 2 - -# if __WORDSIZE == 64 -# define __FD_ZERO_STOS "stosq" -# else -# define __FD_ZERO_STOS "stosl" -# endif - -# define __FD_ZERO(fdsp) \ - do { \ - int __d0, __d1; \ - __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \ - : "=c" (__d0), "=D" (__d1) \ - : "a" (0), "0" (sizeof (fd_set) \ - / sizeof (__fd_mask)), \ - "1" (&__FDS_BITS (fdsp)[0]) \ - : "memory"); \ - } while (0) - -#else /* ! GNU CC */ /* We don't use `memset' because this would require a prototype and the array isn't too big. */ -# define __FD_ZERO(set) \ +#define __FD_ZERO(s) \ do { \ unsigned int __i; \ - fd_set *__arr = (set); \ + fd_set *__arr = (s); \ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) - -#endif /* GNU CC */ - -#define __FD_SET(d, set) \ - ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d))) -#define __FD_CLR(d, set) \ - ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d))) -#define __FD_ISSET(d, set) \ - ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file +#define __FD_SET(d, s) \ + ((void) (__FDS_BITS (s)[__FD_ELT(d)] |= __FD_MASK(d))) +#define __FD_CLR(d, s) \ + ((void) (__FDS_BITS (s)[__FD_ELT(d)] &= ~__FD_MASK(d))) +#define __FD_ISSET(d, s) \ + ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0) \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/sem-pad.h b/lib/libc/include/x86_64-linux-gnux32/bits/sem-pad.h deleted file mode 100644 index 10534c61cf..0000000000 --- a/lib/libc/include/x86_64-linux-gnux32/bits/sem-pad.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Define where padding goes in struct semid_ds. x86 version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SEM_H -# error "Never use directly; include instead." -#endif - -#define __SEM_PAD_AFTER_TIME 1 -#define __SEM_PAD_BEFORE_TIME 0 \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/semaphore.h b/lib/libc/include/x86_64-linux-gnux32/bits/semaphore.h index 7f41d9a880..97292723c8 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/semaphore.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/semaphore.h @@ -1,6 +1,6 @@ -/* Copyright (C) 2002-2020 Free Software Foundation, Inc. +/* Generic POSIX semaphore type layout + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,6 @@ # define __SIZEOF_SEM_T 16 #endif - /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/sysctl.h b/lib/libc/include/x86_64-linux-gnux32/bits/sysctl.h deleted file mode 100644 index 5e2b946cdf..0000000000 --- a/lib/libc/include/x86_64-linux-gnux32/bits/sysctl.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2012-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#if defined __x86_64__ && defined __ILP32__ -# error "sysctl system call is unsupported in x32 kernel" -#endif \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/typesizes.h b/lib/libc/include/x86_64-linux-gnux32/bits/typesizes.h index 7ad60c3f43..53ae0bd5ef 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/typesizes.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/typesizes.h @@ -64,6 +64,7 @@ #define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -87,10 +88,15 @@ /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ # define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/lib/libc/include/x86_64-linux-gnux32/gnu/lib-names-x32.h b/lib/libc/include/x86_64-linux-gnux32/gnu/lib-names-x32.h index e9ea9cb4be..cdc4ac90f9 100644 --- a/lib/libc/include/x86_64-linux-gnux32/gnu/lib-names-x32.h +++ b/lib/libc/include/x86_64-linux-gnux32/gnu/lib-names-x32.h @@ -20,8 +20,6 @@ #define LIBNSS_FILES_SO "libnss_files.so.2" #define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" #define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBNSS_NISPLUS_SO "libnss_nisplus.so.2" -#define LIBNSS_NIS_SO "libnss_nis.so.2" #define LIBNSS_TEST1_SO "libnss_test1.so.2" #define LIBNSS_TEST2_SO "libnss_test2.so.2" #define LIBPTHREAD_SO "libpthread.so.0" diff --git a/lib/libc/include/x86_64-linux-gnux32/gnu/stubs-x32.h b/lib/libc/include/x86_64-linux-gnux32/gnu/stubs-x32.h index 9f943854b0..b3af77d56c 100644 --- a/lib/libc/include/x86_64-linux-gnux32/gnu/stubs-x32.h +++ b/lib/libc/include/x86_64-linux-gnux32/gnu/stubs-x32.h @@ -16,9 +16,7 @@ #define __stub_chflags #define __stub_fchflags #define __stub_gtty -#define __stub_lchmod #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_sstk #define __stub_stty \ No newline at end of file