diff --git a/lib/libc/include/aarch64-linux-gnu/bits/fenv.h b/lib/libc/include/aarch64-linux-gnu/bits/fenv.h index 70ee95acdb99..edb0932a705b 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/fenv.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/fenv.h @@ -73,7 +73,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h b/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h index 1f037e5d2c9c..3a393ffd0e8a 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h @@ -99,4 +99,22 @@ #define HWCAP2_SME_B16B16 (1UL << 41) #define HWCAP2_SME_F16F16 (1UL << 42) #define HWCAP2_MOPS (1UL << 43) -#define HWCAP2_HBC (1UL << 44) \ No newline at end of file +#define HWCAP2_HBC (1UL << 44) +#define HWCAP2_SVE_B16B16 (1UL << 45) +#define HWCAP2_LRCPC3 (1UL << 46) +#define HWCAP2_LSE128 (1UL << 47) +#define HWCAP2_FPMR (1UL << 48) +#define HWCAP2_LUT (1UL << 49) +#define HWCAP2_FAMINMAX (1UL << 50) +#define HWCAP2_F8CVT (1UL << 51) +#define HWCAP2_F8FMA (1UL << 52) +#define HWCAP2_F8DP4 (1UL << 53) +#define HWCAP2_F8DP2 (1UL << 54) +#define HWCAP2_F8E4M3 (1UL << 55) +#define HWCAP2_F8E5M2 (1UL << 56) +#define HWCAP2_SME_LUTV2 (1UL << 57) +#define HWCAP2_SME_F8F16 (1UL << 58) +#define HWCAP2_SME_F8F32 (1UL << 59) +#define HWCAP2_SME_SF8FMA (1UL << 60) +#define HWCAP2_SME_SF8DP4 (1UL << 61) +#define HWCAP2_SME_SF8DP2 (1UL << 62) \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-gnu/bits/math-vector.h b/lib/libc/include/aarch64-linux-gnu/bits/math-vector.h index 3264c3e3e8b0..41c1ed7b57ef 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/math-vector.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/math-vector.h @@ -33,22 +33,50 @@ # define __DECL_SIMD_acos __DECL_SIMD_aarch64 # undef __DECL_SIMD_acosf # define __DECL_SIMD_acosf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_acosh +# define __DECL_SIMD_acosh __DECL_SIMD_aarch64 +# undef __DECL_SIMD_acoshf +# define __DECL_SIMD_acoshf __DECL_SIMD_aarch64 # undef __DECL_SIMD_asin # define __DECL_SIMD_asin __DECL_SIMD_aarch64 # undef __DECL_SIMD_asinf # define __DECL_SIMD_asinf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_asinh +# define __DECL_SIMD_asinh __DECL_SIMD_aarch64 +# undef __DECL_SIMD_asinhf +# define __DECL_SIMD_asinhf __DECL_SIMD_aarch64 # undef __DECL_SIMD_atan # define __DECL_SIMD_atan __DECL_SIMD_aarch64 # undef __DECL_SIMD_atanf # define __DECL_SIMD_atanf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_atanh +# define __DECL_SIMD_atanh __DECL_SIMD_aarch64 +# undef __DECL_SIMD_atanhf +# define __DECL_SIMD_atanhf __DECL_SIMD_aarch64 # undef __DECL_SIMD_atan2 # define __DECL_SIMD_atan2 __DECL_SIMD_aarch64 # undef __DECL_SIMD_atan2f # define __DECL_SIMD_atan2f __DECL_SIMD_aarch64 +# undef __DECL_SIMD_cbrt +# define __DECL_SIMD_cbrt __DECL_SIMD_aarch64 +# undef __DECL_SIMD_cbrtf +# define __DECL_SIMD_cbrtf __DECL_SIMD_aarch64 # undef __DECL_SIMD_cos # define __DECL_SIMD_cos __DECL_SIMD_aarch64 # undef __DECL_SIMD_cosf # define __DECL_SIMD_cosf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_cosh +# define __DECL_SIMD_cosh __DECL_SIMD_aarch64 +# undef __DECL_SIMD_coshf +# define __DECL_SIMD_coshf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_erf +# define __DECL_SIMD_erf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_erff +# define __DECL_SIMD_erff __DECL_SIMD_aarch64 +# undef __DECL_SIMD_erfc +# define __DECL_SIMD_erfc __DECL_SIMD_aarch64 +# undef __DECL_SIMD_erfcf +# define __DECL_SIMD_erfcf __DECL_SIMD_aarch64 # undef __DECL_SIMD_exp # define __DECL_SIMD_exp __DECL_SIMD_aarch64 # undef __DECL_SIMD_expf @@ -65,6 +93,10 @@ # define __DECL_SIMD_expm1 __DECL_SIMD_aarch64 # undef __DECL_SIMD_expm1f # define __DECL_SIMD_expm1f __DECL_SIMD_aarch64 +# undef __DECL_SIMD_hypot +# define __DECL_SIMD_hypot __DECL_SIMD_aarch64 +# undef __DECL_SIMD_hypotf +# define __DECL_SIMD_hypotf __DECL_SIMD_aarch64 # undef __DECL_SIMD_log # define __DECL_SIMD_log __DECL_SIMD_aarch64 # undef __DECL_SIMD_logf @@ -81,14 +113,26 @@ # define __DECL_SIMD_log2 __DECL_SIMD_aarch64 # undef __DECL_SIMD_log2f # define __DECL_SIMD_log2f __DECL_SIMD_aarch64 +# undef __DECL_SIMD_pow +# define __DECL_SIMD_pow __DECL_SIMD_aarch64 +# undef __DECL_SIMD_powf +# define __DECL_SIMD_powf __DECL_SIMD_aarch64 # undef __DECL_SIMD_sin # define __DECL_SIMD_sin __DECL_SIMD_aarch64 # undef __DECL_SIMD_sinf # define __DECL_SIMD_sinf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_sinh +# define __DECL_SIMD_sinh __DECL_SIMD_aarch64 +# undef __DECL_SIMD_sinhf +# define __DECL_SIMD_sinhf __DECL_SIMD_aarch64 # undef __DECL_SIMD_tan # define __DECL_SIMD_tan __DECL_SIMD_aarch64 # undef __DECL_SIMD_tanf # define __DECL_SIMD_tanf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_tanh +# define __DECL_SIMD_tanh __DECL_SIMD_aarch64 +# undef __DECL_SIMD_tanhf +# define __DECL_SIMD_tanhf __DECL_SIMD_aarch64 #endif #if __GNUC_PREREQ(9, 0) @@ -117,35 +161,57 @@ typedef __SVBool_t __sv_bool_t; __vpcs __f32x4_t _ZGVnN4vv_atan2f (__f32x4_t, __f32x4_t); __vpcs __f32x4_t _ZGVnN4v_acosf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_acoshf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_asinf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_asinhf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_atanf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_atanhf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_cbrtf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_cosf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_coshf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_erff (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_erfcf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_expf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_exp10f (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_exp2f (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_expm1f (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4vv_hypotf (__f32x4_t, __f32x4_t); __vpcs __f32x4_t _ZGVnN4v_logf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_log10f (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_log1pf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_log2f (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4vv_powf (__f32x4_t, __f32x4_t); __vpcs __f32x4_t _ZGVnN4v_sinf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_sinhf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_tanf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_tanhf (__f32x4_t); __vpcs __f64x2_t _ZGVnN2vv_atan2 (__f64x2_t, __f64x2_t); __vpcs __f64x2_t _ZGVnN2v_acos (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_acosh (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_asin (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_asinh (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_atan (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_atanh (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_cbrt (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_cos (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_cosh (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_erf (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_erfc (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_exp (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_exp10 (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_exp2 (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_expm1 (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2vv_hypot (__f64x2_t, __f64x2_t); __vpcs __f64x2_t _ZGVnN2v_log (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_log10 (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_log1p (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_log2 (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2vv_pow (__f64x2_t, __f64x2_t); __vpcs __f64x2_t _ZGVnN2v_sin (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_sinh (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_tan (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_tanh (__f64x2_t); # undef __ADVSIMD_VEC_MATH_SUPPORTED #endif /* __ADVSIMD_VEC_MATH_SUPPORTED */ @@ -154,35 +220,57 @@ __vpcs __f64x2_t _ZGVnN2v_tan (__f64x2_t); __sv_f32_t _ZGVsMxvv_atan2f (__sv_f32_t, __sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_acosf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_acoshf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_asinf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_asinhf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_atanf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_atanhf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_cbrtf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_cosf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_coshf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_erff (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_erfcf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_expf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_exp10f (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_exp2f (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_expm1f (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxvv_hypotf (__sv_f32_t, __sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_logf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_log10f (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_log1pf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_log2f (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxvv_powf (__sv_f32_t, __sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_sinf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_sinhf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_tanf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_tanhf (__sv_f32_t, __sv_bool_t); __sv_f64_t _ZGVsMxvv_atan2 (__sv_f64_t, __sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_acos (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_acosh (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_asin (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_asinh (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_atan (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_atanh (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_cbrt (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_cos (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_cosh (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_erf (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_erfc (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_exp (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_exp10 (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_exp2 (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_expm1 (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxvv_hypot (__sv_f64_t, __sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_log (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_log10 (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_log1p (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_log2 (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxvv_pow (__sv_f64_t, __sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_sin (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_sinh (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_tan (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_tanh (__sv_f64_t, __sv_bool_t); # undef __SVE_VEC_MATH_SUPPORTED #endif /* __SVE_VEC_MATH_SUPPORTED */ \ No newline at end of file diff --git a/lib/libc/include/aarch64_be-linux-gnu/bits/fenv.h b/lib/libc/include/aarch64_be-linux-gnu/bits/fenv.h index 70ee95acdb99..edb0932a705b 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/bits/fenv.h +++ b/lib/libc/include/aarch64_be-linux-gnu/bits/fenv.h @@ -73,7 +73,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; 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 1f037e5d2c9c..3a393ffd0e8a 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/aarch64_be-linux-gnu/bits/hwcap.h @@ -99,4 +99,22 @@ #define HWCAP2_SME_B16B16 (1UL << 41) #define HWCAP2_SME_F16F16 (1UL << 42) #define HWCAP2_MOPS (1UL << 43) -#define HWCAP2_HBC (1UL << 44) \ No newline at end of file +#define HWCAP2_HBC (1UL << 44) +#define HWCAP2_SVE_B16B16 (1UL << 45) +#define HWCAP2_LRCPC3 (1UL << 46) +#define HWCAP2_LSE128 (1UL << 47) +#define HWCAP2_FPMR (1UL << 48) +#define HWCAP2_LUT (1UL << 49) +#define HWCAP2_FAMINMAX (1UL << 50) +#define HWCAP2_F8CVT (1UL << 51) +#define HWCAP2_F8FMA (1UL << 52) +#define HWCAP2_F8DP4 (1UL << 53) +#define HWCAP2_F8DP2 (1UL << 54) +#define HWCAP2_F8E4M3 (1UL << 55) +#define HWCAP2_F8E5M2 (1UL << 56) +#define HWCAP2_SME_LUTV2 (1UL << 57) +#define HWCAP2_SME_F8F16 (1UL << 58) +#define HWCAP2_SME_F8F32 (1UL << 59) +#define HWCAP2_SME_SF8FMA (1UL << 60) +#define HWCAP2_SME_SF8DP4 (1UL << 61) +#define HWCAP2_SME_SF8DP2 (1UL << 62) \ No newline at end of file diff --git a/lib/libc/include/aarch64_be-linux-gnu/bits/math-vector.h b/lib/libc/include/aarch64_be-linux-gnu/bits/math-vector.h index 3264c3e3e8b0..41c1ed7b57ef 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/bits/math-vector.h +++ b/lib/libc/include/aarch64_be-linux-gnu/bits/math-vector.h @@ -33,22 +33,50 @@ # define __DECL_SIMD_acos __DECL_SIMD_aarch64 # undef __DECL_SIMD_acosf # define __DECL_SIMD_acosf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_acosh +# define __DECL_SIMD_acosh __DECL_SIMD_aarch64 +# undef __DECL_SIMD_acoshf +# define __DECL_SIMD_acoshf __DECL_SIMD_aarch64 # undef __DECL_SIMD_asin # define __DECL_SIMD_asin __DECL_SIMD_aarch64 # undef __DECL_SIMD_asinf # define __DECL_SIMD_asinf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_asinh +# define __DECL_SIMD_asinh __DECL_SIMD_aarch64 +# undef __DECL_SIMD_asinhf +# define __DECL_SIMD_asinhf __DECL_SIMD_aarch64 # undef __DECL_SIMD_atan # define __DECL_SIMD_atan __DECL_SIMD_aarch64 # undef __DECL_SIMD_atanf # define __DECL_SIMD_atanf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_atanh +# define __DECL_SIMD_atanh __DECL_SIMD_aarch64 +# undef __DECL_SIMD_atanhf +# define __DECL_SIMD_atanhf __DECL_SIMD_aarch64 # undef __DECL_SIMD_atan2 # define __DECL_SIMD_atan2 __DECL_SIMD_aarch64 # undef __DECL_SIMD_atan2f # define __DECL_SIMD_atan2f __DECL_SIMD_aarch64 +# undef __DECL_SIMD_cbrt +# define __DECL_SIMD_cbrt __DECL_SIMD_aarch64 +# undef __DECL_SIMD_cbrtf +# define __DECL_SIMD_cbrtf __DECL_SIMD_aarch64 # undef __DECL_SIMD_cos # define __DECL_SIMD_cos __DECL_SIMD_aarch64 # undef __DECL_SIMD_cosf # define __DECL_SIMD_cosf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_cosh +# define __DECL_SIMD_cosh __DECL_SIMD_aarch64 +# undef __DECL_SIMD_coshf +# define __DECL_SIMD_coshf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_erf +# define __DECL_SIMD_erf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_erff +# define __DECL_SIMD_erff __DECL_SIMD_aarch64 +# undef __DECL_SIMD_erfc +# define __DECL_SIMD_erfc __DECL_SIMD_aarch64 +# undef __DECL_SIMD_erfcf +# define __DECL_SIMD_erfcf __DECL_SIMD_aarch64 # undef __DECL_SIMD_exp # define __DECL_SIMD_exp __DECL_SIMD_aarch64 # undef __DECL_SIMD_expf @@ -65,6 +93,10 @@ # define __DECL_SIMD_expm1 __DECL_SIMD_aarch64 # undef __DECL_SIMD_expm1f # define __DECL_SIMD_expm1f __DECL_SIMD_aarch64 +# undef __DECL_SIMD_hypot +# define __DECL_SIMD_hypot __DECL_SIMD_aarch64 +# undef __DECL_SIMD_hypotf +# define __DECL_SIMD_hypotf __DECL_SIMD_aarch64 # undef __DECL_SIMD_log # define __DECL_SIMD_log __DECL_SIMD_aarch64 # undef __DECL_SIMD_logf @@ -81,14 +113,26 @@ # define __DECL_SIMD_log2 __DECL_SIMD_aarch64 # undef __DECL_SIMD_log2f # define __DECL_SIMD_log2f __DECL_SIMD_aarch64 +# undef __DECL_SIMD_pow +# define __DECL_SIMD_pow __DECL_SIMD_aarch64 +# undef __DECL_SIMD_powf +# define __DECL_SIMD_powf __DECL_SIMD_aarch64 # undef __DECL_SIMD_sin # define __DECL_SIMD_sin __DECL_SIMD_aarch64 # undef __DECL_SIMD_sinf # define __DECL_SIMD_sinf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_sinh +# define __DECL_SIMD_sinh __DECL_SIMD_aarch64 +# undef __DECL_SIMD_sinhf +# define __DECL_SIMD_sinhf __DECL_SIMD_aarch64 # undef __DECL_SIMD_tan # define __DECL_SIMD_tan __DECL_SIMD_aarch64 # undef __DECL_SIMD_tanf # define __DECL_SIMD_tanf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_tanh +# define __DECL_SIMD_tanh __DECL_SIMD_aarch64 +# undef __DECL_SIMD_tanhf +# define __DECL_SIMD_tanhf __DECL_SIMD_aarch64 #endif #if __GNUC_PREREQ(9, 0) @@ -117,35 +161,57 @@ typedef __SVBool_t __sv_bool_t; __vpcs __f32x4_t _ZGVnN4vv_atan2f (__f32x4_t, __f32x4_t); __vpcs __f32x4_t _ZGVnN4v_acosf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_acoshf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_asinf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_asinhf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_atanf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_atanhf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_cbrtf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_cosf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_coshf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_erff (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_erfcf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_expf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_exp10f (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_exp2f (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_expm1f (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4vv_hypotf (__f32x4_t, __f32x4_t); __vpcs __f32x4_t _ZGVnN4v_logf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_log10f (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_log1pf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_log2f (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4vv_powf (__f32x4_t, __f32x4_t); __vpcs __f32x4_t _ZGVnN4v_sinf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_sinhf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_tanf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_tanhf (__f32x4_t); __vpcs __f64x2_t _ZGVnN2vv_atan2 (__f64x2_t, __f64x2_t); __vpcs __f64x2_t _ZGVnN2v_acos (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_acosh (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_asin (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_asinh (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_atan (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_atanh (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_cbrt (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_cos (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_cosh (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_erf (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_erfc (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_exp (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_exp10 (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_exp2 (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_expm1 (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2vv_hypot (__f64x2_t, __f64x2_t); __vpcs __f64x2_t _ZGVnN2v_log (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_log10 (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_log1p (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_log2 (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2vv_pow (__f64x2_t, __f64x2_t); __vpcs __f64x2_t _ZGVnN2v_sin (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_sinh (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_tan (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_tanh (__f64x2_t); # undef __ADVSIMD_VEC_MATH_SUPPORTED #endif /* __ADVSIMD_VEC_MATH_SUPPORTED */ @@ -154,35 +220,57 @@ __vpcs __f64x2_t _ZGVnN2v_tan (__f64x2_t); __sv_f32_t _ZGVsMxvv_atan2f (__sv_f32_t, __sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_acosf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_acoshf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_asinf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_asinhf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_atanf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_atanhf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_cbrtf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_cosf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_coshf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_erff (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_erfcf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_expf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_exp10f (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_exp2f (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_expm1f (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxvv_hypotf (__sv_f32_t, __sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_logf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_log10f (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_log1pf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_log2f (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxvv_powf (__sv_f32_t, __sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_sinf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_sinhf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_tanf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_tanhf (__sv_f32_t, __sv_bool_t); __sv_f64_t _ZGVsMxvv_atan2 (__sv_f64_t, __sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_acos (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_acosh (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_asin (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_asinh (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_atan (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_atanh (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_cbrt (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_cos (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_cosh (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_erf (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_erfc (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_exp (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_exp10 (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_exp2 (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_expm1 (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxvv_hypot (__sv_f64_t, __sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_log (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_log10 (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_log1p (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_log2 (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxvv_pow (__sv_f64_t, __sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_sin (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_sinh (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_tan (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_tanh (__sv_f64_t, __sv_bool_t); # undef __SVE_VEC_MATH_SUPPORTED #endif /* __SVE_VEC_MATH_SUPPORTED */ \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/bits/endianness.h b/lib/libc/include/arc-linux-gnu/bits/endianness.h new file mode 100644 index 000000000000..8abcabc8f574 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/bits/endianness.h @@ -0,0 +1,15 @@ +#ifndef _BITS_ENDIANNESS_H +#define _BITS_ENDIANNESS_H 1 + +#ifndef _BITS_ENDIAN_H +# error "Never use directly; include instead." +#endif + +/* ARC has selectable endianness. */ +#ifdef __BIG_ENDIAN__ +# define __BYTE_ORDER __BIG_ENDIAN +#else +# define __BYTE_ORDER __LITTLE_ENDIAN +#endif + +#endif /* bits/endianness.h */ \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/bits/fcntl.h b/lib/libc/include/arc-linux-gnu/bits/fcntl.h new file mode 100644 index 000000000000..9c454a8d1495 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/bits/fcntl.h @@ -0,0 +1,55 @@ +/* O_*, F_*, FD_* bit values for the generic Linux ABI. + Copyright (C) 2011-2024 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 _FCNTL_H +# error "Never use directly; include instead." +#endif + +#include + +#if __WORDSIZE == 64 +# define __O_LARGEFILE 0 +#endif + +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ +#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. */ +#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. */ + }; + +#ifdef __USE_LARGEFILE64 +struct flock64 + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; +#endif + +/* Include generic Linux declarations. */ +#include \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/bits/fenv.h b/lib/libc/include/arc-linux-gnu/bits/fenv.h new file mode 100644 index 000000000000..b8b36a681684 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/bits/fenv.h @@ -0,0 +1,78 @@ +/* Floating point environment. ARC version. + Copyright (C) 2020-2024 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 _FENV_H +# error "Never use directly; include instead." +#endif + +enum + { + FE_INVALID = +# define FE_INVALID (0x01) + FE_INVALID, + FE_DIVBYZERO = +# define FE_DIVBYZERO (0x02) + FE_DIVBYZERO, + FE_OVERFLOW = +# define FE_OVERFLOW (0x04) + FE_OVERFLOW, + FE_UNDERFLOW = +# define FE_UNDERFLOW (0x08) + FE_UNDERFLOW, + FE_INEXACT = +# define FE_INEXACT (0x10) + FE_INEXACT + }; + +# define FE_ALL_EXCEPT \ + (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT) + +enum + { + FE_TOWARDZERO = +# define FE_TOWARDZERO (0x0) + FE_TOWARDZERO, + FE_TONEAREST = +# define FE_TONEAREST (0x1) /* default */ + FE_TONEAREST, + FE_UPWARD = +# define FE_UPWARD (0x2) + FE_UPWARD, + FE_DOWNWARD = +# define FE_DOWNWARD (0x3) + FE_DOWNWARD + }; + +typedef unsigned int fexcept_t; + +typedef struct +{ + unsigned int __fpcr; + unsigned int __fpsr; +} fenv_t; + +/* If the default argument is used we use this value. */ +#define FE_DFL_ENV ((const fenv_t *) -1) + +#if __GLIBC_USE (IEC_60559_BFP_EXT) +/* Type representing floating-point control modes. */ +typedef unsigned int femode_t; + +/* Default floating-point control modes. */ +# define FE_DFL_MODE ((const femode_t *) -1L) +#endif \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/bits/floatn.h b/lib/libc/include/arc-linux-gnu/bits/floatn.h new file mode 100644 index 000000000000..7f308138a76d --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/bits/floatn.h @@ -0,0 +1,52 @@ +/* Macros to control TS 18661-3 glibc features. + Copyright (C) 2017-2024 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 + . */ + +/* 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. */ +#define __HAVE_FLOAT128 0 + +/* 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 + +/* 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 0 + +/* 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 0 + +#ifndef __ASSEMBLER__ + +/* Defined to concatenate the literal suffix to be used with _Float128 + types, if __HAVE_FLOAT128 is 1. + E.g.: #define __f128(x) x##f128. */ +# undef __f128 + +/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. + E.g.: #define __CFLOAT128 _Complex _Float128. */ +# undef __CFLOAT128 + +#endif /* !__ASSEMBLER__. */ + +#include \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/bits/link.h b/lib/libc/include/arc-linux-gnu/bits/link.h new file mode 100644 index 000000000000..371249403b45 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/bits/link.h @@ -0,0 +1,52 @@ +/* Machine-specific declarations for dynamic linker interface, ARC version. + Copyright (C) 2020-2024 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 _LINK_H +# error "Never include directly; use instead." +#endif + +/* Registers for entry into PLT on ARC. */ +typedef struct La_arc_regs +{ + uint32_t lr_reg[8]; /* r0 through r7 (upto 8 args). */ +} La_arc_regs; + +/* Return values for calls from PLT on ARC. */ +typedef struct La_arc_retval +{ + /* For ARCv2, a 64-bit integer return value can use 2 regs. */ + uint32_t lrv_reg[2]; +} La_arc_retval; + +__BEGIN_DECLS + +extern ElfW(Addr) la_arc_gnu_pltenter (ElfW(Sym) *__sym, unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + La_arc_regs *__regs, + unsigned int *__flags, + const char *__symname, + long int *__framesizep); +extern unsigned int la_arc_gnu_pltexit (ElfW(Sym) *__sym, unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + const La_arc_regs *__inregs, + La_arc_retval *__outregs, + const char *symname); + +__END_DECLS \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/bits/long-double.h b/lib/libc/include/arc-linux-gnu/bits/long-double.h new file mode 100644 index 000000000000..984b2c54b488 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/bits/long-double.h @@ -0,0 +1,53 @@ +/* Properties of long double type. + Copyright (C) 2016-2024 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 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 + . */ + +/* This header is included by . + + If long double is ABI-compatible with double, it should define + __NO_LONG_DOUBLE_MATH to 1; otherwise, it should leave + __NO_LONG_DOUBLE_MATH undefined. + + If this build of the GNU C Library supports both long double + ABI-compatible with double and some other long double format not + ABI-compatible with double, it should define + __LONG_DOUBLE_MATH_OPTIONAL to 1; otherwise, it should leave + __LONG_DOUBLE_MATH_OPTIONAL undefined. + + If __NO_LONG_DOUBLE_MATH is already defined, this header must not + define anything; this is needed to work with the definition of + __NO_LONG_DOUBLE_MATH in nldbl-compat.h. */ + +/* In the default version of this header, long double is + ABI-compatible with double. */ +#ifndef __NO_LONG_DOUBLE_MATH +# define __NO_LONG_DOUBLE_MATH 1 +#endif + +/* 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/arc-linux-gnu/bits/procfs.h b/lib/libc/include/arc-linux-gnu/bits/procfs.h new file mode 100644 index 000000000000..75541205b901 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/bits/procfs.h @@ -0,0 +1,35 @@ +/* Types for registers for sys/procfs.h. ARC version. + Copyright (C) 2020-2024 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_PROCFS_H +# error "Never include directly; use instead." +#endif + +#include + +/* And the whole bunch of them. We could have used `struct + user_regs' 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 unsigned long int elf_greg_t; +typedef unsigned long int elf_gregset_t[ELF_NGREG]; + +/* There's no separate floating point reg file in ARCv2. */ +typedef struct { } elf_fpregset_t; \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/bits/setjmp.h b/lib/libc/include/arc-linux-gnu/bits/setjmp.h new file mode 100644 index 000000000000..91f27f8dd054 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/bits/setjmp.h @@ -0,0 +1,26 @@ +/* Define the machine-dependent type 'jmp_buf'. ARC version. + Copyright (C) 2020-2024 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 _ARC_BITS_SETJMP_H +#define _ARC_BITS_SETJMP_H 1 + +/* Saves r13-r25 (callee-saved), fp (frame pointer), sp (stack pointer), + blink (branch-n-link). */ +typedef long int __jmp_buf[32]; + +#endif \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/bits/struct_stat.h b/lib/libc/include/arc-linux-gnu/bits/struct_stat.h new file mode 100644 index 000000000000..c8e2d78b57f2 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/bits/struct_stat.h @@ -0,0 +1,127 @@ +/* Definition for struct stat. + Copyright (C) 2020-2024 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 _SYS_STAT_H && !defined _FCNTL_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_STRUCT_STAT_H +#define _BITS_STRUCT_STAT_H 1 + +#include +#include + +#if defined __USE_FILE_OFFSET64 +# define __field64(type, type64, name) type64 name +#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T +# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T +# error "ino_t and off_t must both be the same type" +# endif +# define __field64(type, type64, name) type name +#elif __BYTE_ORDER == __LITTLE_ENDIAN +# define __field64(type, type64, name) \ + type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad +#else +# define __field64(type, type64, name) \ + int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name +#endif + +struct stat + { + __dev_t st_dev; /* Device. */ + __field64(__ino_t, __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.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad2; + __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */ +#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 + int __glibc_reserved[2]; + }; + +#undef __field64 + +#ifdef __USE_LARGEFILE64 +struct stat64 + { + __dev_t st_dev; /* Device. */ + __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.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __off64_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad2; + __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 + 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. */ +#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 + int __glibc_reserved[2]; + }; +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC + +#endif /* _BITS_STRUCT_STAT_H */ \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/bits/timesize.h b/lib/libc/include/arc-linux-gnu/bits/timesize.h new file mode 100644 index 000000000000..17f828ecfe92 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/bits/timesize.h @@ -0,0 +1,20 @@ +/* Bit size of the time_t type at glibc build time, general case. + Copyright (C) 2018-2024 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 + . */ + +/* Size in bits of the 'time_t' type of the default ABI. */ +#define __TIMESIZE 64 \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/bits/types/__sigset_t.h b/lib/libc/include/arc-linux-gnu/bits/types/__sigset_t.h new file mode 100644 index 000000000000..c45c797a8900 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/bits/types/__sigset_t.h @@ -0,0 +1,12 @@ +/* Architecture-specific __sigset_t definition. ARC version. */ +#ifndef ____sigset_t_defined +#define ____sigset_t_defined + +/* Linux asm-generic syscall ABI expects sigset_t to hold 64 signals. */ +#define _SIGSET_NWORDS (64 / (8 * sizeof (unsigned long int))) +typedef struct +{ + unsigned long int __val[_SIGSET_NWORDS]; +} __sigset_t; + +#endif \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/bits/wordsize.h b/lib/libc/include/arc-linux-gnu/bits/wordsize.h new file mode 100644 index 000000000000..3a4baec80809 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/bits/wordsize.h @@ -0,0 +1,21 @@ +/* Copyright (C) 1999-2024 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 + . */ + +#define __WORDSIZE 32 +#define __WORDSIZE_TIME64_COMPAT32 0 +#define __WORDSIZE32_SIZE_ULONG 0 +#define __WORDSIZE32_PTRDIFF_LONG 0 \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/fpu_control.h b/lib/libc/include/arc-linux-gnu/fpu_control.h new file mode 100644 index 000000000000..02e226327fe5 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/fpu_control.h @@ -0,0 +1,105 @@ +/* FPU control word bits. ARC version. + Copyright (C) 2020-2024 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 _FPU_CONTROL_H +#define _FPU_CONTROL_H + +/* ARC FPU control register bits. + + [ 0] -> IVE: Enable invalid operation exception. + if 0, soft exception: status register IV flag set. + if 1, hardware exception trap (not supported in Linux yet). + [ 1] -> DZE: Enable division by zero exception. + if 0, soft exception: status register IV flag set. + if 1, hardware exception: (not supported in Linux yet). + [9:8] -> RM: Rounding Mode: + 00 - Rounding toward zero. + 01 - Rounding to nearest (default). + 10 - Rounding (up) toward plus infinity. + 11 - Rounding (down)toward minus infinity. + + ARC FPU status register bits. + + [ 0] -> IV: flag invalid operation. + [ 1] -> DZ: flag division by zero. + [ 2] -> OV: flag Overflow operation. + [ 3] -> UV: flag Underflow operation. + [ 4] -> IX: flag Inexact operation. + [31] -> FWE: Flag Write Enable. + If 1, above flags writable explicitly (clearing), + else IoW and only writable indirectly via bits [12:7]. */ + +#include + +#if !defined(__ARC_FPU_SP__) && !defined(__ARC_FPU_DP__) + +# 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) +# define _FPU_GETS(cw) (cw) = 0 +# define _FPU_SETS(cw) (void) (cw) +extern fpu_control_t __fpu_control; + +#else + +#define _FPU_RESERVED 0 + +/* The fdlibm code requires strict IEEE double precision arithmetic, + and no interrupts for exceptions, rounding to nearest. + So only RM set to b'01. */ +# define _FPU_DEFAULT 0x00000100 + +/* Actually default needs to have FWE bit as 1 but that is already + ingrained into _FPU_SETS macro below. */ +#define _FPU_FPSR_DEFAULT 0x00000000 + +#define __FPU_RND_SHIFT 8 +#define __FPU_RND_MASK 0x3 + +/* Type of the control word. */ +typedef unsigned int fpu_control_t; + +/* Macros for accessing the hardware control word. */ +# define _FPU_GETCW(cw) __asm__ volatile ("lr %0, [0x300]" : "=r" (cw)) +# define _FPU_SETCW(cw) __asm__ volatile ("sr %0, [0x300]" : : "r" (cw)) + +/* Macros for accessing the hardware status word. + Writing to FPU_STATUS requires a "control" bit FWE to be able to set the + exception flags directly (as opposed to side-effects of FP instructions). + That is done in the macro here to keeps callers agnostic of this detail. + And given FWE is write-only and RAZ, no need to "clear" it in _FPU_GETS + macro. */ +# define _FPU_GETS(cw) \ + __asm__ volatile ("lr %0, [0x301] \r\n" \ + : "=r" (cw)) + +# define _FPU_SETS(cw) \ + do { \ + unsigned int __fwe = 0x80000000 | (cw); \ + __asm__ volatile ("sr %0, [0x301] \r\n" \ + : : "r" (__fwe)); \ + } while (0) + +/* Default control word set at startup. */ +extern fpu_control_t __fpu_control; + +#endif + +#endif /* fpu_control.h */ \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/gnu/lib-names-arcle.h b/lib/libc/include/arc-linux-gnu/gnu/lib-names-arcle.h new file mode 100644 index 000000000000..9b29aec083bf --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/gnu/lib-names-arcle.h @@ -0,0 +1,27 @@ +/* This file is automatically generated. */ +#ifndef __GNU_LIB_NAMES_H +# error "Never use directly; include instead." +#endif + +#define LD_LINUX_ARC_SO "ld-linux-arc.so.2" +#define LD_SO "ld-linux-arc.so.2" +#define LIBANL_SO "libanl.so.1" +#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" +#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" +#define LIBC_SO "libc.so.6" +#define LIBDL_SO "libdl.so.2" +#define LIBGCC_S_SO "libgcc_s.so.1" +#define LIBMVEC_SO "libmvec.so.1" +#define LIBM_SO "libm.so.6" +#define LIBNSL_SO "libnsl.so.1" +#define LIBNSS_COMPAT_SO "libnss_compat.so.2" +#define LIBNSS_DB_SO "libnss_db.so.2" +#define LIBNSS_DNS_SO "libnss_dns.so.2" +#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 LIBPTHREAD_SO "libpthread.so.0" +#define LIBRESOLV_SO "libresolv.so.2" +#define LIBRT_SO "librt.so.1" +#define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/gnu/lib-names.h b/lib/libc/include/arc-linux-gnu/gnu/lib-names.h new file mode 100644 index 000000000000..d7e6fa326f6e --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/gnu/lib-names.h @@ -0,0 +1,16 @@ +/* This file is automatically generated. + It defines macros to allow user program to find the shared + library files which come as part of GNU libc. */ +#ifndef __GNU_LIB_NAMES_H +#define __GNU_LIB_NAMES_H 1 + +#include + +#if !defined __BIG_ENDIAN__ +# include +#endif +#if defined __BIG_ENDIAN__ +# include +#endif + +#endif /* gnu/lib-names.h */ \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/gnu/stubs-arcle.h b/lib/libc/include/arc-linux-gnu/gnu/stubs-arcle.h new file mode 100644 index 000000000000..6ce02418e696 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/gnu/stubs-arcle.h @@ -0,0 +1,38 @@ +/* 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___compat_bdflush +#define __stub___compat_create_module +#define __stub___compat_get_kernel_syms +#define __stub___compat_query_module +#define __stub___compat_uselib +#define __stub_chflags +#define __stub_fchflags +#define __stub_feclearexcept +#define __stub_fedisableexcept +#define __stub_feenableexcept +#define __stub_fegetenv +#define __stub_fegetexcept +#define __stub_fegetexceptflag +#define __stub_fegetmode +#define __stub_fegetround +#define __stub_feholdexcept +#define __stub_feraiseexcept +#define __stub_fesetenv +#define __stub_fesetexcept +#define __stub_fesetexceptflag +#define __stub_fesetmode +#define __stub_fesetround +#define __stub_fetestexcept +#define __stub_feupdateenv +#define __stub_gtty +#define __stub_revoke +#define __stub_setlogin +#define __stub_sigreturn +#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/gnu/stubs.h b/lib/libc/include/arc-linux-gnu/gnu/stubs.h new file mode 100644 index 000000000000..fbfa0fa5b648 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/gnu/stubs.h @@ -0,0 +1,12 @@ +/* This file is automatically generated. + This file selects the right generated file of `__stub_FUNCTION' macros + based on the architecture being compiled for. */ + +#include + +#if !defined __BIG_ENDIAN__ +# include +#endif +#if defined __BIG_ENDIAN__ +# include +#endif \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/sys/cachectl.h b/lib/libc/include/arc-linux-gnu/sys/cachectl.h new file mode 100644 index 000000000000..e1cfb7dfedf4 --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/sys/cachectl.h @@ -0,0 +1,35 @@ +/* cacheflush - flush contents of instruction and/or data cache. + Copyright (C) 2020-2024 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 cacheflush (void *__addr, int __nbytes, int __op) __THROW; +#endif + +__END_DECLS + +#endif \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/sys/ucontext.h b/lib/libc/include/arc-linux-gnu/sys/ucontext.h new file mode 100644 index 000000000000..9a316becd7ab --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/sys/ucontext.h @@ -0,0 +1,57 @@ +/* struct ucontext definition, ARC version. + Copyright (C) 2020-2024 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 + . */ + +/* System V/ARC ABI compliant context switching support. */ + +#ifndef _SYS_UCONTEXT_H +#define _SYS_UCONTEXT_H 1 + +#include + +#include +#include + +typedef struct +{ + unsigned long int __pad; + unsigned long int __bta; + unsigned long int __lp_start, __lp_end, __lp_count; + unsigned long int __status32, __ret, __blink; + unsigned long int __fp, __gp; + unsigned long int __r12, __r11, __r10, __r9, __r8, __r7; + unsigned long int __r6, __r5, __r4, __r3, __r2, __r1, __r0; + unsigned long int __sp; + unsigned long int __r26; + unsigned long int __r25, __r24, __r23, __r22, __r21, __r20; + unsigned long int __r19, __r18, __r17, __r16, __r15, __r14, __r13; + unsigned long int __efa; + unsigned long int __stop_pc; + unsigned long int __r30, __r58, __r59; +} mcontext_t; + +/* Userlevel context. */ +typedef struct ucontext_t +{ + unsigned long int __uc_flags; + struct ucontext_t *uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + sigset_t uc_sigmask; +} ucontext_t; + +#endif \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/sys/user.h b/lib/libc/include/arc-linux-gnu/sys/user.h new file mode 100644 index 000000000000..ee051ff2f73c --- /dev/null +++ b/lib/libc/include/arc-linux-gnu/sys/user.h @@ -0,0 +1,32 @@ +/* ptrace register data format definitions. + Copyright (C) 2020-2024 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_USER_H +#define _SYS_USER_H 1 + +/* Struct user_regs_struct is exported by kernel header + However apps like strace also expect a struct user, so it's better to + have a dummy implementation. */ +#include + +struct user +{ + long int dummy; +}; + +#endif \ No newline at end of file diff --git a/lib/libc/include/arm-linux-gnueabi/bits/fenv.h b/lib/libc/include/arm-linux-gnueabi/bits/fenv.h index 546825e1f06c..26a466f83ba5 100644 --- a/lib/libc/include/arm-linux-gnueabi/bits/fenv.h +++ b/lib/libc/include/arm-linux-gnueabi/bits/fenv.h @@ -81,7 +81,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/lib/libc/include/arm-linux-gnueabi/bits/struct_stat.h b/lib/libc/include/arm-linux-gnueabi/bits/struct_stat.h index ad5a2ab333b1..36175222e636 100644 --- a/lib/libc/include/arm-linux-gnueabi/bits/struct_stat.h +++ b/lib/libc/include/arm-linux-gnueabi/bits/struct_stat.h @@ -28,7 +28,7 @@ struct stat { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else __dev_t st_dev; /* Device. */ @@ -83,13 +83,13 @@ struct stat # else __ino64_t st_ino; /* File serial number. */ # endif -#endif /* __USE_TIME_BITS64 */ +#endif /* __USE_TIME64_REDIRECTS */ }; #ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -125,7 +125,7 @@ struct stat64 unsigned long int st_ctimensec; /* Nsecs of last status change. */ # endif __ino64_t st_ino; /* File serial number. */ -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; #endif diff --git a/lib/libc/include/arm-linux-gnueabi/bits/wordsize.h b/lib/libc/include/arm-linux-gnueabi/bits/wordsize.h index 3a4baec80809..677850e18efb 100644 --- a/lib/libc/include/arm-linux-gnueabi/bits/wordsize.h +++ b/lib/libc/include/arm-linux-gnueabi/bits/wordsize.h @@ -16,6 +16,6 @@ . */ #define __WORDSIZE 32 -#define __WORDSIZE_TIME64_COMPAT32 0 +#define __WORDSIZE_TIME64_COMPAT32 1 #define __WORDSIZE32_SIZE_ULONG 0 #define __WORDSIZE32_PTRDIFF_LONG 0 \ No newline at end of file diff --git a/lib/libc/include/arm-linux-gnueabihf/bits/fenv.h b/lib/libc/include/arm-linux-gnueabihf/bits/fenv.h index 546825e1f06c..26a466f83ba5 100644 --- a/lib/libc/include/arm-linux-gnueabihf/bits/fenv.h +++ b/lib/libc/include/arm-linux-gnueabihf/bits/fenv.h @@ -81,7 +81,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/lib/libc/include/arm-linux-gnueabihf/bits/struct_stat.h b/lib/libc/include/arm-linux-gnueabihf/bits/struct_stat.h index ad5a2ab333b1..36175222e636 100644 --- a/lib/libc/include/arm-linux-gnueabihf/bits/struct_stat.h +++ b/lib/libc/include/arm-linux-gnueabihf/bits/struct_stat.h @@ -28,7 +28,7 @@ struct stat { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else __dev_t st_dev; /* Device. */ @@ -83,13 +83,13 @@ struct stat # else __ino64_t st_ino; /* File serial number. */ # endif -#endif /* __USE_TIME_BITS64 */ +#endif /* __USE_TIME64_REDIRECTS */ }; #ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -125,7 +125,7 @@ struct stat64 unsigned long int st_ctimensec; /* Nsecs of last status change. */ # endif __ino64_t st_ino; /* File serial number. */ -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; #endif diff --git a/lib/libc/include/arm-linux-gnueabihf/bits/wordsize.h b/lib/libc/include/arm-linux-gnueabihf/bits/wordsize.h index 3a4baec80809..677850e18efb 100644 --- a/lib/libc/include/arm-linux-gnueabihf/bits/wordsize.h +++ b/lib/libc/include/arm-linux-gnueabihf/bits/wordsize.h @@ -16,6 +16,6 @@ . */ #define __WORDSIZE 32 -#define __WORDSIZE_TIME64_COMPAT32 0 +#define __WORDSIZE_TIME64_COMPAT32 1 #define __WORDSIZE32_SIZE_ULONG 0 #define __WORDSIZE32_PTRDIFF_LONG 0 \ No newline at end of file diff --git a/lib/libc/include/armeb-linux-gnueabi/bits/fenv.h b/lib/libc/include/armeb-linux-gnueabi/bits/fenv.h index 546825e1f06c..26a466f83ba5 100644 --- a/lib/libc/include/armeb-linux-gnueabi/bits/fenv.h +++ b/lib/libc/include/armeb-linux-gnueabi/bits/fenv.h @@ -81,7 +81,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/lib/libc/include/armeb-linux-gnueabi/bits/struct_stat.h b/lib/libc/include/armeb-linux-gnueabi/bits/struct_stat.h index ad5a2ab333b1..36175222e636 100644 --- a/lib/libc/include/armeb-linux-gnueabi/bits/struct_stat.h +++ b/lib/libc/include/armeb-linux-gnueabi/bits/struct_stat.h @@ -28,7 +28,7 @@ struct stat { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else __dev_t st_dev; /* Device. */ @@ -83,13 +83,13 @@ struct stat # else __ino64_t st_ino; /* File serial number. */ # endif -#endif /* __USE_TIME_BITS64 */ +#endif /* __USE_TIME64_REDIRECTS */ }; #ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -125,7 +125,7 @@ struct stat64 unsigned long int st_ctimensec; /* Nsecs of last status change. */ # endif __ino64_t st_ino; /* File serial number. */ -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; #endif diff --git a/lib/libc/include/armeb-linux-gnueabi/bits/wordsize.h b/lib/libc/include/armeb-linux-gnueabi/bits/wordsize.h index 3a4baec80809..677850e18efb 100644 --- a/lib/libc/include/armeb-linux-gnueabi/bits/wordsize.h +++ b/lib/libc/include/armeb-linux-gnueabi/bits/wordsize.h @@ -16,6 +16,6 @@ . */ #define __WORDSIZE 32 -#define __WORDSIZE_TIME64_COMPAT32 0 +#define __WORDSIZE_TIME64_COMPAT32 1 #define __WORDSIZE32_SIZE_ULONG 0 #define __WORDSIZE32_PTRDIFF_LONG 0 \ No newline at end of file diff --git a/lib/libc/include/armeb-linux-gnueabihf/bits/fenv.h b/lib/libc/include/armeb-linux-gnueabihf/bits/fenv.h index 546825e1f06c..26a466f83ba5 100644 --- a/lib/libc/include/armeb-linux-gnueabihf/bits/fenv.h +++ b/lib/libc/include/armeb-linux-gnueabihf/bits/fenv.h @@ -81,7 +81,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/lib/libc/include/armeb-linux-gnueabihf/bits/struct_stat.h b/lib/libc/include/armeb-linux-gnueabihf/bits/struct_stat.h index ad5a2ab333b1..36175222e636 100644 --- a/lib/libc/include/armeb-linux-gnueabihf/bits/struct_stat.h +++ b/lib/libc/include/armeb-linux-gnueabihf/bits/struct_stat.h @@ -28,7 +28,7 @@ struct stat { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else __dev_t st_dev; /* Device. */ @@ -83,13 +83,13 @@ struct stat # else __ino64_t st_ino; /* File serial number. */ # endif -#endif /* __USE_TIME_BITS64 */ +#endif /* __USE_TIME64_REDIRECTS */ }; #ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -125,7 +125,7 @@ struct stat64 unsigned long int st_ctimensec; /* Nsecs of last status change. */ # endif __ino64_t st_ino; /* File serial number. */ -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; #endif diff --git a/lib/libc/include/armeb-linux-gnueabihf/bits/wordsize.h b/lib/libc/include/armeb-linux-gnueabihf/bits/wordsize.h index 3a4baec80809..677850e18efb 100644 --- a/lib/libc/include/armeb-linux-gnueabihf/bits/wordsize.h +++ b/lib/libc/include/armeb-linux-gnueabihf/bits/wordsize.h @@ -16,6 +16,6 @@ . */ #define __WORDSIZE 32 -#define __WORDSIZE_TIME64_COMPAT32 0 +#define __WORDSIZE_TIME64_COMPAT32 1 #define __WORDSIZE32_SIZE_ULONG 0 #define __WORDSIZE32_PTRDIFF_LONG 0 \ No newline at end of file diff --git a/lib/libc/include/csky-linux-gnueabi/bits/fenv.h b/lib/libc/include/csky-linux-gnueabi/bits/fenv.h index 8b234a86e7a0..7e7377580018 100644 --- a/lib/libc/include/csky-linux-gnueabi/bits/fenv.h +++ b/lib/libc/include/csky-linux-gnueabi/bits/fenv.h @@ -102,7 +102,7 @@ typedef struct # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/lib/libc/include/csky-linux-gnueabi/bits/struct_stat.h b/lib/libc/include/csky-linux-gnueabi/bits/struct_stat.h index 9620943315a4..e3e61019dcc3 100644 --- a/lib/libc/include/csky-linux-gnueabi/bits/struct_stat.h +++ b/lib/libc/include/csky-linux-gnueabi/bits/struct_stat.h @@ -43,7 +43,7 @@ struct stat { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else __dev_t st_dev; /* Device. */ @@ -88,7 +88,7 @@ struct stat #ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ diff --git a/lib/libc/include/csky-linux-gnueabi/bits/wordsize.h b/lib/libc/include/csky-linux-gnueabi/bits/wordsize.h index 3a4baec80809..677850e18efb 100644 --- a/lib/libc/include/csky-linux-gnueabi/bits/wordsize.h +++ b/lib/libc/include/csky-linux-gnueabi/bits/wordsize.h @@ -16,6 +16,6 @@ . */ #define __WORDSIZE 32 -#define __WORDSIZE_TIME64_COMPAT32 0 +#define __WORDSIZE_TIME64_COMPAT32 1 #define __WORDSIZE32_SIZE_ULONG 0 #define __WORDSIZE32_PTRDIFF_LONG 0 \ No newline at end of file diff --git a/lib/libc/include/csky-linux-gnueabihf/bits/fenv.h b/lib/libc/include/csky-linux-gnueabihf/bits/fenv.h index 8b234a86e7a0..7e7377580018 100644 --- a/lib/libc/include/csky-linux-gnueabihf/bits/fenv.h +++ b/lib/libc/include/csky-linux-gnueabihf/bits/fenv.h @@ -102,7 +102,7 @@ typedef struct # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/lib/libc/include/csky-linux-gnueabihf/bits/struct_stat.h b/lib/libc/include/csky-linux-gnueabihf/bits/struct_stat.h index 9620943315a4..e3e61019dcc3 100644 --- a/lib/libc/include/csky-linux-gnueabihf/bits/struct_stat.h +++ b/lib/libc/include/csky-linux-gnueabihf/bits/struct_stat.h @@ -43,7 +43,7 @@ struct stat { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else __dev_t st_dev; /* Device. */ @@ -88,7 +88,7 @@ struct stat #ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ diff --git a/lib/libc/include/csky-linux-gnueabihf/bits/wordsize.h b/lib/libc/include/csky-linux-gnueabihf/bits/wordsize.h index 3a4baec80809..677850e18efb 100644 --- a/lib/libc/include/csky-linux-gnueabihf/bits/wordsize.h +++ b/lib/libc/include/csky-linux-gnueabihf/bits/wordsize.h @@ -16,6 +16,6 @@ . */ #define __WORDSIZE 32 -#define __WORDSIZE_TIME64_COMPAT32 0 +#define __WORDSIZE_TIME64_COMPAT32 1 #define __WORDSIZE32_SIZE_ULONG 0 #define __WORDSIZE32_PTRDIFF_LONG 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/aio.h b/lib/libc/include/generic-glibc/aio.h index fb1f9b4eb2b1..8bd97aec5aa9 100644 --- a/lib/libc/include/generic-glibc/aio.h +++ b/lib/libc/include/generic-glibc/aio.h @@ -193,7 +193,7 @@ extern __ssize_t __REDIRECT_NTH (aio_return, (struct aiocb *__aiocbp), extern int __REDIRECT_NTH (aio_cancel, (int __fildes, struct aiocb *__aiocbp), aio_cancel64); -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS extern int __REDIRECT_NTH (aio_suspend, (const struct aiocb *const __list[], int __nent, const struct timespec *__restrict __timeout), @@ -215,7 +215,7 @@ extern int __REDIRECT_NTH (aio_fsync, # define aio_error aio_error64 # define aio_return aio_return64 # define aio_cancel aio_cancel64 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define aio_suspend __aio_suspend_time64 # else # define aio_suspend aio_suspend64 diff --git a/lib/libc/include/generic-glibc/bits/fcntl2.h b/lib/libc/include/generic-glibc/bits/fcntl2.h index 4ddeea3dc501..d9544b62d76d 100644 --- a/lib/libc/include/generic-glibc/bits/fcntl2.h +++ b/lib/libc/include/generic-glibc/bits/fcntl2.h @@ -32,6 +32,8 @@ extern int __REDIRECT (__open_2, (const char *__path, int __oflag), extern int __REDIRECT (__open_alias, (const char *__path, int __oflag, ...), open64) __nonnull ((1)); #endif + +#ifdef __va_arg_pack_len __errordecl (__open_too_many_args, "open can be called either with 2 or 3 arguments, not more"); __errordecl (__open_missing_mode, @@ -58,12 +60,29 @@ open (const char *__path, int __oflag, ...) return __open_alias (__path, __oflag, __va_arg_pack ()); } +#elif __fortify_use_clang +__fortify_function __attribute_overloadable__ int +open (__fortify_clang_overload_arg (const char *, ,__path), int __oflag) + __fortify_clang_error (__OPEN_NEEDS_MODE (__oflag), + "open with O_CREAT or O_TMPFILE in second argument needs 3 arguments") +{ + return __open_2 (__path, __oflag); +} + +__fortify_function __attribute_overloadable__ int +open (__fortify_clang_overload_arg (const char *, ,__path), int __oflag, + mode_t __mode) +{ + return __open_alias (__path, __oflag, __mode); +} +#endif #ifdef __USE_LARGEFILE64 extern int __open64_2 (const char *__path, int __oflag) __nonnull ((1)); extern int __REDIRECT (__open64_alias, (const char *__path, int __oflag, ...), open64) __nonnull ((1)); +# ifdef __va_arg_pack_len __errordecl (__open64_too_many_args, "open64 can be called either with 2 or 3 arguments, not more"); __errordecl (__open64_missing_mode, @@ -90,6 +109,27 @@ open64 (const char *__path, int __oflag, ...) return __open64_alias (__path, __oflag, __va_arg_pack ()); } +# elif __fortify_use_clang +__fortify_function_error_function __attribute_overloadable__ int +open64 (const char *__path, int __oflag, mode_t __mode, ...) + __fortify_clang_unavailable ("open64 can be called either with 2 or 3 arguments, not more"); + +__fortify_function __attribute_overloadable__ int +open64 (__fortify_clang_overload_arg (const char *, ,__path), int __oflag) + __fortify_clang_prefer_this_overload + __fortify_clang_error (__OPEN_NEEDS_MODE (__oflag), + "open64 with O_CREAT or O_TMPFILE in second argument needs 3 arguments") +{ + return __open64_2 (__path, __oflag); +} + +__fortify_function __attribute_overloadable__ int +open64 (__fortify_clang_overload_arg (const char *, ,__path), int __oflag, + mode_t __mode) +{ + return __open64_alias (__path, __oflag, __mode); +} +# endif #endif @@ -108,6 +148,8 @@ extern int __REDIRECT (__openat_alias, (int __fd, const char *__path, int __oflag, ...), openat64) __nonnull ((2)); # endif + +# ifdef __va_arg_pack_len __errordecl (__openat_too_many_args, "openat can be called either with 3 or 4 arguments, not more"); __errordecl (__openat_missing_mode, @@ -134,6 +176,28 @@ openat (int __fd, const char *__path, int __oflag, ...) return __openat_alias (__fd, __path, __oflag, __va_arg_pack ()); } +# elif __fortify_use_clang +__fortify_function_error_function __attribute_overloadable__ int +openat (int __fd, const char *__path, int __oflag, mode_t __mode, ...) + __fortify_clang_unavailable ("openat can be called either with 3 or 4 arguments, not more"); + +__fortify_function __attribute_overloadable__ int +openat (int __fd, __fortify_clang_overload_arg (const char *, ,__path), + int __oflag) + __fortify_clang_prefer_this_overload + __fortify_clang_error (__OPEN_NEEDS_MODE (__oflag), + "openat with O_CREAT or O_TMPFILE in third argument needs 4 arguments") +{ + return __openat_2 (__fd, __path, __oflag); +} + +__fortify_function __attribute_overloadable__ int +openat (int __fd, __fortify_clang_overload_arg (const char *, ,__path), + int __oflag, mode_t __mode) +{ + return __openat_alias (__fd, __path, __oflag, __mode); +} +# endif # ifdef __USE_LARGEFILE64 @@ -147,6 +211,7 @@ __errordecl (__openat64_too_many_args, __errordecl (__openat64_missing_mode, "openat64 with O_CREAT or O_TMPFILE in third argument needs 4 arguments"); +# ifdef __va_arg_pack_len __fortify_function int openat64 (int __fd, const char *__path, int __oflag, ...) { @@ -168,5 +233,27 @@ openat64 (int __fd, const char *__path, int __oflag, ...) return __openat64_alias (__fd, __path, __oflag, __va_arg_pack ()); } +# elif __fortify_use_clang +__fortify_function_error_function __attribute_overloadable__ int +openat64 (int __fd, const char *__path, int __oflag, mode_t __mode, ...) + __fortify_clang_unavailable ("openat64 can be called either with 3 or 4 arguments, not more"); + +__fortify_function __attribute_overloadable__ int +openat64 (int __fd, __fortify_clang_overload_arg (const char *, ,__path), + int __oflag) + __fortify_clang_prefer_this_overload + __fortify_clang_error (__OPEN_NEEDS_MODE (__oflag), + "openat64 with O_CREAT or O_TMPFILE in third argument needs 4 arguments") +{ + return __openat64_2 (__fd, __path, __oflag); +} + +__fortify_function __attribute_overloadable__ int +openat64 (int __fd, __fortify_clang_overload_arg (const char *, ,__path), + int __oflag, mode_t __mode) +{ + return __openat64_alias (__fd, __path, __oflag, __mode); +} +# endif # endif #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/fenv.h b/lib/libc/include/generic-glibc/bits/fenv.h index 189b85956819..7fd0fb8d040f 100644 --- a/lib/libc/include/generic-glibc/bits/fenv.h +++ b/lib/libc/include/generic-glibc/bits/fenv.h @@ -104,7 +104,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/lib/libc/include/generic-glibc/bits/floatn.h b/lib/libc/include/generic-glibc/bits/floatn.h index e1f58983af59..20c1af5c2e78 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 ldbl-128 platforms. Copyright (C) 2017-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/include/generic-glibc/bits/libc-header-start.h b/lib/libc/include/generic-glibc/bits/libc-header-start.h index cac52715391e..783e5b1d2bc6 100644 --- a/lib/libc/include/generic-glibc/bits/libc-header-start.h +++ b/lib/libc/include/generic-glibc/bits/libc-header-start.h @@ -44,23 +44,23 @@ /* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__ macro. Most but not all symbols enabled by that macro in TS - 18661-1 are enabled unconditionally in C2X. In C2X, the symbols in + 18661-1 are enabled unconditionally in C23. In C23, the symbols in Annex F still require a new feature test macro - __STDC_WANT_IEC_60559_EXT__ instead (C2X does not define + __STDC_WANT_IEC_60559_EXT__ instead (C23 does not define __STDC_WANT_IEC_60559_BFP_EXT__), while a few features from TS - 18661-1 are not included in C2X (and thus should depend on - __STDC_WANT_IEC_60559_BFP_EXT__ even when C2X features are + 18661-1 are not included in C23 (and thus should depend on + __STDC_WANT_IEC_60559_BFP_EXT__ even when C23 features are enabled). __GLIBC_USE (IEC_60559_BFP_EXT) controls those features from TS - 18661-1 not included in C2X. + 18661-1 not included in C23. - __GLIBC_USE (IEC_60559_BFP_EXT_C2X) controls those features from TS - 18661-1 that are also included in C2X (with no feature test macro - required in C2X). + __GLIBC_USE (IEC_60559_BFP_EXT_C23) controls those features from TS + 18661-1 that are also included in C23 (with no feature test macro + required in C23). __GLIBC_USE (IEC_60559_EXT) controls those features from TS 18661-1 - that are included in C2X but conditional on + that are included in C23 but conditional on __STDC_WANT_IEC_60559_EXT__. (There are currently no features conditional on __STDC_WANT_IEC_60559_EXT__ that are not in TS 18661-1.) */ @@ -70,11 +70,11 @@ #else # define __GLIBC_USE_IEC_60559_BFP_EXT 0 #endif -#undef __GLIBC_USE_IEC_60559_BFP_EXT_C2X -#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC2X) -# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 1 +#undef __GLIBC_USE_IEC_60559_BFP_EXT_C23 +#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC23) +# define __GLIBC_USE_IEC_60559_BFP_EXT_C23 1 #else -# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0 +# define __GLIBC_USE_IEC_60559_BFP_EXT_C23 0 #endif #undef __GLIBC_USE_IEC_60559_EXT #if __GLIBC_USE (IEC_60559_BFP_EXT) || defined __STDC_WANT_IEC_60559_EXT__ @@ -86,18 +86,18 @@ /* ISO/IEC TS 18661-4:2015 defines the __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction functions, the symbols from this TS are enabled unconditionally in - C2X. */ + C23. */ #undef __GLIBC_USE_IEC_60559_FUNCS_EXT #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__ # define __GLIBC_USE_IEC_60559_FUNCS_EXT 1 #else # define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 #endif -#undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X -#if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC2X) -# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 1 +#undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 +#if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC23) +# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 1 #else -# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0 +# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 0 #endif /* ISO/IEC TS 18661-3:2015 defines the diff --git a/lib/libc/include/generic-glibc/bits/mathcalls.h b/lib/libc/include/generic-glibc/bits/mathcalls.h index 246d3c4e8876..9b4b5587c133 100644 --- a/lib/libc/include/generic-glibc/bits/mathcalls.h +++ b/lib/libc/include/generic-glibc/bits/mathcalls.h @@ -109,9 +109,24 @@ __MATHCALL_VEC (log10,, (_Mdouble_ __x)); /* Break VALUE into integral and fractional parts. */ __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2)); -#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C2X) +#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23) /* Compute exponent to base ten. */ __MATHCALL_VEC (exp10,, (_Mdouble_ __x)); + +/* Return exp2(X) - 1. */ +__MATHCALL (exp2m1,, (_Mdouble_ __x)); + +/* Return exp10(X) - 1. */ +__MATHCALL (exp10m1,, (_Mdouble_ __x)); + +/* Return log2(1 + X). */ +__MATHCALL (log2p1,, (_Mdouble_ __x)); + +/* Return log10(1 + X). */ +__MATHCALL (log10p1,, (_Mdouble_ __x)); + +/* Return log(1 + X). */ +__MATHCALL (logp1,, (_Mdouble_ __x)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 @@ -264,7 +279,7 @@ __MATHCALL (nextafter,, (_Mdouble_ __x, _Mdouble_ __y)); __MATHCALL (nexttoward,, (_Mdouble_ __x, long double __y)); # endif -# if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN +# if __GLIBC_USE (IEC_60559_BFP_EXT_C23) || __MATH_DECLARING_FLOATN /* Return X - epsilon. */ __MATHCALL (nextdown,, (_Mdouble_ __x)); /* Return X + epsilon. */ @@ -283,7 +298,7 @@ __MATHCALL (scalbn,, (_Mdouble_ __x, int __n)); __MATHDECL (int,ilogb,, (_Mdouble_ __x)); #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) || __MATH_DECLARING_FLOATN /* Like ilogb, but returning long int. */ __MATHDECL (long int, llogb,, (_Mdouble_ __x)); #endif @@ -328,7 +343,7 @@ __MATHDECL (long long int,llround,, (_Mdouble_ __x)); /* Return positive difference between X and Y. */ __MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y)); -# if !__MATH_DECLARING_FLOATN || defined __USE_GNU || !__GLIBC_USE (ISOC2X) +# if !__MATH_DECLARING_FLOATN || defined __USE_GNU || !__GLIBC_USE (ISOC23) /* Return maximum numeric value from X and Y. */ __MATHCALLX (fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); @@ -340,7 +355,7 @@ __MATHCALLX (fmin,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); #endif /* Use ISO C99. */ -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) || __MATH_DECLARING_FLOATN /* Round X to nearest integer value, rounding halfway cases to even. */ __MATHCALLX (roundeven,, (_Mdouble_ __x), (__const__)); @@ -372,7 +387,7 @@ __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x)); #if (__GLIBC_USE (IEC_60559_BFP_EXT) \ || (__MATH_DECLARING_FLOATN \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X)))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23)))) /* Return value with maximum magnitude. */ __MATHCALLX (fmaxmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); @@ -380,7 +395,7 @@ __MATHCALLX (fmaxmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); __MATHCALLX (fminmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); #endif -#if __GLIBC_USE (ISOC2X) +#if __GLIBC_USE (ISOC23) /* Return maximum value from X and Y. */ __MATHCALLX (fmaximum,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); diff --git a/lib/libc/include/generic-glibc/bits/mman-linux.h b/lib/libc/include/generic-glibc/bits/mman-linux.h index 9e7a7e0e1750..dfa276ce090d 100644 --- a/lib/libc/include/generic-glibc/bits/mman-linux.h +++ b/lib/libc/include/generic-glibc/bits/mman-linux.h @@ -54,10 +54,29 @@ # define MAP_ANONYMOUS 0x20 /* Don't use a file. */ #endif #define MAP_ANON MAP_ANONYMOUS -/* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. */ + +/* When MAP_HUGETLB is set, bits [26:31] encode the log2 of the huge page size. + The following definitions are associated with this huge page size encoding. + It is responsibility of the application to know which sizes are supported on + the running system. See mmap(2) man page for details. */ + #define MAP_HUGE_SHIFT 26 #define MAP_HUGE_MASK 0x3f +#define MAP_HUGE_16KB (14 << MAP_HUGE_SHIFT) +#define MAP_HUGE_64KB (16 << MAP_HUGE_SHIFT) +#define MAP_HUGE_512KB (19 << MAP_HUGE_SHIFT) +#define MAP_HUGE_1MB (20 << MAP_HUGE_SHIFT) +#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT) +#define MAP_HUGE_8MB (23 << MAP_HUGE_SHIFT) +#define MAP_HUGE_16MB (24 << MAP_HUGE_SHIFT) +#define MAP_HUGE_32MB (25 << MAP_HUGE_SHIFT) +#define MAP_HUGE_256MB (28 << MAP_HUGE_SHIFT) +#define MAP_HUGE_512MB (29 << MAP_HUGE_SHIFT) +#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT) +#define MAP_HUGE_2GB (31 << MAP_HUGE_SHIFT) +#define MAP_HUGE_16GB (34U << MAP_HUGE_SHIFT) + /* Flags to `msync'. */ #define MS_ASYNC 1 /* Sync memory asynchronously. */ #define MS_SYNC 4 /* Synchronous memory sync. */ diff --git a/lib/libc/include/generic-glibc/bits/mqueue2.h b/lib/libc/include/generic-glibc/bits/mqueue2.h index fcef7f17598f..0e491d0e3776 100644 --- a/lib/libc/include/generic-glibc/bits/mqueue2.h +++ b/lib/libc/include/generic-glibc/bits/mqueue2.h @@ -29,6 +29,8 @@ extern mqd_t __mq_open_2 (const char *__name, int __oflag) extern mqd_t __REDIRECT_NTH (__mq_open_alias, (const char *__name, int __oflag, ...), mq_open) __nonnull ((1)); + +#ifdef __va_arg_pack_len __errordecl (__mq_open_wrong_number_of_args, "mq_open can be called either with 2 or 4 arguments"); __errordecl (__mq_open_missing_mode_and_attr, @@ -54,4 +56,27 @@ __NTH (mq_open (const char *__name, int __oflag, ...)) return __mq_open_2 (__name, __oflag); return __mq_open_alias (__name, __oflag, __va_arg_pack ()); -} \ No newline at end of file +} +#elif __fortify_use_clang +__fortify_function_error_function __attribute_overloadable__ mqd_t +__NTH (mq_open (__fortify_clang_overload_arg (const char *, , __name), + int __oflag, mode_t __mode, ...)) + __fortify_clang_unavailable ("mq_open can be called either with 2 or 4 arguments"); + +__fortify_function __attribute_overloadable__ mqd_t +__NTH (mq_open (__fortify_clang_overload_arg (const char *, ,__name), + int __oflag, mode_t __mode, struct mq_attr *__attr)) +{ + return __mq_open_alias (__name, __oflag, __mode, __attr); +} + +__fortify_function __attribute_overloadable__ mqd_t +__NTH (mq_open (__fortify_clang_overload_arg (const char *, ,__name), + int __oflag)) + __fortify_clang_prefer_this_overload + __fortify_clang_error ((__oflag & O_CREAT), + "mq_open with O_CREAT in second argument needs 4 arguments") +{ + return __mq_open_alias (__name, __oflag); +} +#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/poll2.h b/lib/libc/include/generic-glibc/bits/poll2.h index 8ef99d1a8377..b979190c9ab5 100644 --- a/lib/libc/include/generic-glibc/bits/poll2.h +++ b/lib/libc/include/generic-glibc/bits/poll2.h @@ -33,8 +33,13 @@ extern int __REDIRECT (__poll_chk_warn, (struct pollfd *__fds, nfds_t __nfds, __poll_chk) __warnattr ("poll called with fds buffer too small file nfds entries"); -__fortify_function __fortified_attr_access (__write_only__, 1, 2) int -poll (struct pollfd *__fds, nfds_t __nfds, int __timeout) +__fortify_function __fortified_attr_access (__write_only__, 1, 2) +__attribute_overloadable__ int +poll (__fortify_clang_overload_arg (struct pollfd *, ,__fds), nfds_t __nfds, + int __timeout) + __fortify_clang_warning_only_if_bos_lt2 (__nfds, __fds, sizeof (*__fds), + "poll called with fds buffer " + "too small file nfds entries") { return __glibc_fortify (poll, __nfds, sizeof (*__fds), __glibc_objsize (__fds), @@ -43,7 +48,7 @@ poll (struct pollfd *__fds, nfds_t __nfds, int __timeout) #ifdef __USE_GNU -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS extern int __REDIRECT (__ppoll64_alias, (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout, const __sigset_t *__ss), __ppoll64); @@ -58,9 +63,13 @@ extern int __REDIRECT (__ppoll64_chk_warn, (struct pollfd *__fds, nfds_t __n, __ppoll64_chk) __warnattr ("ppoll called with fds buffer too small file nfds entries"); -__fortify_function __fortified_attr_access (__write_only__, 1, 2) int -ppoll (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout, - const __sigset_t *__ss) +__fortify_function __fortified_attr_access (__write_only__, 1, 2) +__attribute_overloadable__ int +ppoll (__fortify_clang_overload_arg (struct pollfd *, ,__fds), nfds_t __nfds, + const struct timespec *__timeout, const __sigset_t *__ss) + __fortify_clang_warning_only_if_bos_lt2 (__nfds, __fds, sizeof (*__fds), + "ppoll called with fds buffer " + "too small file nfds entries") { return __glibc_fortify (ppoll64, __nfds, sizeof (*__fds), __glibc_objsize (__fds), @@ -81,9 +90,13 @@ extern int __REDIRECT (__ppoll_chk_warn, (struct pollfd *__fds, nfds_t __nfds, __ppoll_chk) __warnattr ("ppoll called with fds buffer too small file nfds entries"); -__fortify_function __fortified_attr_access (__write_only__, 1, 2) int -ppoll (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout, - const __sigset_t *__ss) +__fortify_function __fortified_attr_access (__write_only__, 1, 2) +__attribute_overloadable__ int +ppoll (__fortify_clang_overload_arg (struct pollfd *, ,__fds), nfds_t __nfds, + const struct timespec *__timeout, const __sigset_t *__ss) + __fortify_clang_warning_only_if_bos_lt2 (__nfds, __fds, sizeof (*__fds), + "ppoll called with fds buffer " + "too small file nfds entries") { return __glibc_fortify (ppoll, __nfds, sizeof (*__fds), __glibc_objsize (__fds), diff --git a/lib/libc/include/generic-glibc/bits/rseq.h b/lib/libc/include/generic-glibc/bits/rseq.h index 9b9c7040c456..5ea695ad1c3d 100644 --- a/lib/libc/include/generic-glibc/bits/rseq.h +++ b/lib/libc/include/generic-glibc/bits/rseq.h @@ -1,4 +1,4 @@ -/* Restartable Sequences Linux mips architecture header. +/* Restartable Sequences architecture header. Stub version. Copyright (C) 2021-2024 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or @@ -26,37 +26,4 @@ architecture. When choosing this value, it needs to be taken into account that generating invalid instructions may have ill effects on tools like objdump, and may also have impact on the CPU speculative - execution efficiency in some cases. - - RSEQ_SIG uses the break instruction. The instruction pattern is: - - On MIPS: - 0350000d break 0x350 - - On nanoMIPS: - 00100350 break 0x350 - - On microMIPS: - 0000d407 break 0x350 - - For nanoMIPS32 and microMIPS, the instruction stream is encoded as - 16-bit halfwords, so the signature halfwords need to be swapped - accordingly for little-endian. */ - -#if defined (__nanomips__) -# ifdef __MIPSEL__ -# define RSEQ_SIG 0x03500010 -# else -# define RSEQ_SIG 0x00100350 -# endif -#elif defined (__mips_micromips) -# ifdef __MIPSEL__ -# define RSEQ_SIG 0xd4070000 -# else -# define RSEQ_SIG 0x0000d407 -# endif -#elif defined (__mips__) -# define RSEQ_SIG 0x0350000d -#else -/* Unknown MIPS architecture. */ -#endif \ No newline at end of file + execution efficiency in some cases. */ \ 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 f11f81a96670..a1b25a6aa3cc 100644 --- a/lib/libc/include/generic-glibc/bits/shm.h +++ b/lib/libc/include/generic-glibc/bits/shm.h @@ -58,6 +58,28 @@ typedef __syscall_ulong_t shmatt_t; # define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */ # define SHM_NORESERVE 010000 /* don't check for reservations */ +/* When SHM_HUGETLB is set, bits [26:31] encode the log2 of the huge page size. + The following definitions are associated with this huge page size encoding. + It is responsibility of the application to know which sizes are supported on + the running system. See shmget(2) man page for details. */ + +#define SHM_HUGE_SHIFT 26 +#define SHM_HUGE_MASK 0x3f + +#define SHM_HUGE_16KB (14 << SHM_HUGE_SHIFT) +#define SHM_HUGE_64KB (16 << SHM_HUGE_SHIFT) +#define SHM_HUGE_512KB (19 << SHM_HUGE_SHIFT) +#define SHM_HUGE_1MB (20 << SHM_HUGE_SHIFT) +#define SHM_HUGE_2MB (21 << SHM_HUGE_SHIFT) +#define SHM_HUGE_8MB (23 << SHM_HUGE_SHIFT) +#define SHM_HUGE_16MB (24 << SHM_HUGE_SHIFT) +#define SHM_HUGE_32MB (25 << SHM_HUGE_SHIFT) +#define SHM_HUGE_256MB (28 << SHM_HUGE_SHIFT) +#define SHM_HUGE_512MB (29 << SHM_HUGE_SHIFT) +#define SHM_HUGE_1GB (30 << SHM_HUGE_SHIFT) +#define SHM_HUGE_2GB (31 << SHM_HUGE_SHIFT) +#define SHM_HUGE_16GB (34U << SHM_HUGE_SHIFT) + struct shminfo { __syscall_ulong_t shmmax; diff --git a/lib/libc/include/generic-glibc/bits/socket-constants.h b/lib/libc/include/generic-glibc/bits/socket-constants.h index 95902eaf0225..7402e773a508 100644 --- a/lib/libc/include/generic-glibc/bits/socket-constants.h +++ b/lib/libc/include/generic-glibc/bits/socket-constants.h @@ -64,7 +64,7 @@ # define SO_TIMESTAMPNS_NEW 64 # define SO_TIMESTAMPING_NEW 65 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define SO_RCVTIMEO SO_RCVTIMEO_NEW # define SO_SNDTIMEO SO_SNDTIMEO_NEW # define SO_TIMESTAMP SO_TIMESTAMP_NEW diff --git a/lib/libc/include/generic-glibc/bits/socket.h b/lib/libc/include/generic-glibc/bits/socket.h index afddf12afcd5..3d10586e7b41 100644 --- a/lib/libc/include/generic-glibc/bits/socket.h +++ b/lib/libc/include/generic-glibc/bits/socket.h @@ -172,6 +172,7 @@ typedef __socklen_t socklen_t; #define SOL_MPTCP 284 #define SOL_MCTP 285 #define SOL_SMC 286 +#define SOL_VSOCK 287 /* Maximum queue length specifiable by listen. */ #define SOMAXCONN 4096 @@ -180,7 +181,7 @@ typedef __socklen_t socklen_t; #include /* Structure describing a generic socket address. */ -struct sockaddr +struct __attribute_struct_may_alias__ sockaddr { __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */ char sa_data[14]; /* Address data. */ @@ -193,7 +194,7 @@ struct sockaddr #define _SS_PADSIZE \ (_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype)) -struct sockaddr_storage +struct __attribute_struct_may_alias__ sockaddr_storage { __SOCKADDR_COMMON (ss_); /* Address family, etc. */ char __ss_padding[_SS_PADSIZE]; diff --git a/lib/libc/include/generic-glibc/bits/socket2.h b/lib/libc/include/generic-glibc/bits/socket2.h index 158c230ede89..ddba27bc2d38 100644 --- a/lib/libc/include/generic-glibc/bits/socket2.h +++ b/lib/libc/include/generic-glibc/bits/socket2.h @@ -30,14 +30,20 @@ extern ssize_t __REDIRECT (__recv_chk_warn, __warnattr ("recv called with bigger length than size of destination " "buffer"); -__fortify_function ssize_t -recv (int __fd, void *__buf, size_t __n, int __flags) +__fortify_function __attribute_overloadable__ ssize_t +recv (int __fd, __fortify_clang_overload_arg0 (void *, ,__buf), size_t __n, + int __flags) + __fortify_clang_warning_only_if_bos0_lt (__n, __buf, + "recv called with bigger length than " + "size of destination buffer") { size_t sz = __glibc_objsize0 (__buf); if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz)) return __recv_alias (__fd, __buf, __n, __flags); +#if !__fortify_use_clang if (__glibc_unsafe_len (__n, sizeof (char), sz)) return __recv_chk_warn (__fd, __buf, __n, sz, __flags); +#endif return __recv_chk (__fd, __buf, __n, sz, __flags); } @@ -57,15 +63,21 @@ extern ssize_t __REDIRECT (__recvfrom_chk_warn, __warnattr ("recvfrom called with bigger length than size of " "destination buffer"); -__fortify_function ssize_t -recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags, +__fortify_function __attribute_overloadable__ ssize_t +recvfrom (int __fd, __fortify_clang_overload_arg0 (void *, __restrict, __buf), + size_t __n, int __flags, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len) + __fortify_clang_warning_only_if_bos0_lt (__n, __buf, + "recvfrom called with bigger length " + "than size of destination buffer") { size_t sz = __glibc_objsize0 (__buf); if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz)) return __recvfrom_alias (__fd, __buf, __n, __flags, __addr, __addr_len); +#if !__fortify_use_clang if (__glibc_unsafe_len (__n, sizeof (char), sz)) return __recvfrom_chk_warn (__fd, __buf, __n, sz, __flags, __addr, __addr_len); +#endif return __recvfrom_chk (__fd, __buf, __n, sz, __flags, __addr, __addr_len); } \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/statx-generic.h b/lib/libc/include/generic-glibc/bits/statx-generic.h index 5c6c28e3143f..8667c801b29b 100644 --- a/lib/libc/include/generic-glibc/bits/statx-generic.h +++ b/lib/libc/include/generic-glibc/bits/statx-generic.h @@ -42,6 +42,7 @@ # define STATX_BTIME 0x0800U # define STATX_MNT_ID 0x1000U # define STATX_DIOALIGN 0x2000U +# define STATX_MNT_ID_UNIQUE 0x4000U # define STATX__RESERVED 0x80000000U # define STATX_ATTR_COMPRESSED 0x0004 diff --git a/lib/libc/include/generic-glibc/bits/stdio-ldbl.h b/lib/libc/include/generic-glibc/bits/stdio-ldbl.h index 10ed3f014cb2..525446108643 100644 --- a/lib/libc/include/generic-glibc/bits/stdio-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/stdio-ldbl.h @@ -28,7 +28,7 @@ __LDBL_REDIR_DECL (vprintf) __LDBL_REDIR_DECL (vsprintf) #if !__GLIBC_USE (DEPRECATED_SCANF) # if defined __LDBL_COMPAT -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (fscanf, __nldbl___isoc23_fscanf) __LDBL_REDIR1_DECL (scanf, __nldbl___isoc23_scanf) __LDBL_REDIR1_DECL (sscanf, __nldbl___isoc23_sscanf) @@ -38,7 +38,7 @@ __LDBL_REDIR1_DECL (scanf, __nldbl___isoc99_scanf) __LDBL_REDIR1_DECL (sscanf, __nldbl___isoc99_sscanf) # endif # elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (fscanf, __isoc23_fscanfieee128) __LDBL_REDIR1_DECL (scanf, __isoc23_scanfieee128) __LDBL_REDIR1_DECL (sscanf, __isoc23_sscanfieee128) @@ -64,7 +64,7 @@ __LDBL_REDIR_DECL (vsnprintf) #ifdef __USE_ISOC99 # if !__GLIBC_USE (DEPRECATED_SCANF) # if defined __LDBL_COMPAT -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (vfscanf, __nldbl___isoc23_vfscanf) __LDBL_REDIR1_DECL (vscanf, __nldbl___isoc23_vscanf) __LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc23_vsscanf) @@ -74,7 +74,7 @@ __LDBL_REDIR1_DECL (vscanf, __nldbl___isoc99_vscanf) __LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc99_vsscanf) # endif # elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (vfscanf, __isoc23_vfscanfieee128) __LDBL_REDIR1_DECL (vscanf, __isoc23_vscanfieee128) __LDBL_REDIR1_DECL (vsscanf, __isoc23_vsscanfieee128) diff --git a/lib/libc/include/generic-glibc/bits/stdio2.h b/lib/libc/include/generic-glibc/bits/stdio2.h index e4a6f5860cb2..6ec28b6d0e1d 100644 --- a/lib/libc/include/generic-glibc/bits/stdio2.h +++ b/lib/libc/include/generic-glibc/bits/stdio2.h @@ -31,15 +31,29 @@ __NTH (sprintf (char *__restrict __s, const char *__restrict __fmt, ...)) __glibc_objsize (__s), __fmt, __va_arg_pack ()); } +#elif __fortify_use_clang +/* clang does not have __va_arg_pack, so defer to va_arg version. */ +__fortify_function_error_function __attribute_overloadable__ int +__NTH (sprintf (__fortify_clang_overload_arg (char *, __restrict, __s), + const char *__restrict __fmt, ...)) +{ + __gnuc_va_list __fortify_ap; + __builtin_va_start (__fortify_ap, __fmt); + int __r = __builtin___vsprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, + __glibc_objsize (__s), __fmt, + __fortify_ap); + __builtin_va_end (__fortify_ap); + return __r; +} #elif !defined __cplusplus # define sprintf(str, ...) \ __builtin___sprintf_chk (str, __USE_FORTIFY_LEVEL - 1, \ __glibc_objsize (str), __VA_ARGS__) #endif -__fortify_function int -__NTH (vsprintf (char *__restrict __s, const char *__restrict __fmt, - __gnuc_va_list __ap)) +__fortify_function __attribute_overloadable__ int +__NTH (vsprintf (__fortify_clang_overload_arg (char *, __restrict, __s), + const char *__restrict __fmt, __gnuc_va_list __ap)) { return __builtin___vsprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, __glibc_objsize (__s), __fmt, __ap); @@ -55,15 +69,33 @@ __NTH (snprintf (char *__restrict __s, size_t __n, __glibc_objsize (__s), __fmt, __va_arg_pack ()); } +# elif __fortify_use_clang +/* clang does not have __va_arg_pack, so defer to va_arg version. */ +__fortify_function_error_function __attribute_overloadable__ int +__NTH (snprintf (__fortify_clang_overload_arg (char *, __restrict, __s), + size_t __n, const char *__restrict __fmt, ...)) +{ + __gnuc_va_list __fortify_ap; + __builtin_va_start (__fortify_ap, __fmt); + int __r = __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, + __glibc_objsize (__s), __fmt, + __fortify_ap); + __builtin_va_end (__fortify_ap); + return __r; +} # elif !defined __cplusplus # define snprintf(str, len, ...) \ __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, \ __glibc_objsize (str), __VA_ARGS__) # endif -__fortify_function int -__NTH (vsnprintf (char *__restrict __s, size_t __n, - const char *__restrict __fmt, __gnuc_va_list __ap)) +__fortify_function __attribute_overloadable__ int +__NTH (vsnprintf (__fortify_clang_overload_arg (char *, __restrict, __s), + size_t __n, const char *__restrict __fmt, + __gnuc_va_list __ap)) + __fortify_clang_warning (__fortify_clang_bos_static_lt (__n, __s), + "call to vsnprintf may overflow the destination " + "buffer") { return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, __glibc_objsize (__s), __fmt, __ap); @@ -85,6 +117,30 @@ printf (const char *__restrict __fmt, ...) { return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } +# elif __fortify_use_clang +/* clang does not have __va_arg_pack, so defer to va_arg version. */ +__fortify_function_error_function __attribute_overloadable__ __nonnull ((1)) int +fprintf (__fortify_clang_overload_arg (FILE *, __restrict, __stream), + const char *__restrict __fmt, ...) +{ + __gnuc_va_list __fortify_ap; + __builtin_va_start (__fortify_ap, __fmt); + int __r = __builtin___vfprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, + __fmt, __fortify_ap); + __builtin_va_end (__fortify_ap); + return __r; +} + +__fortify_function_error_function __attribute_overloadable__ int +printf (__fortify_clang_overload_arg (const char *, __restrict, __fmt), ...) +{ + __gnuc_va_list __fortify_ap; + __builtin_va_start (__fortify_ap, __fmt); + int __r = __builtin___vprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, + __fortify_ap); + __builtin_va_end (__fortify_ap); + return __r; +} # elif !defined __cplusplus # define printf(...) \ __printf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__) @@ -92,8 +148,9 @@ printf (const char *__restrict __fmt, ...) __fprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__) # endif -__fortify_function int -vprintf (const char *__restrict __fmt, __gnuc_va_list __ap) +__fortify_function __attribute_overloadable__ int +vprintf (__fortify_clang_overload_arg (const char *, __restrict, __fmt), + __gnuc_va_list __ap) { #ifdef __USE_EXTERN_INLINES return __vfprintf_chk (stdout, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); @@ -117,6 +174,18 @@ dprintf (int __fd, const char *__restrict __fmt, ...) return __dprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } +# elif __fortify_use_clang +__fortify_function_error_function __attribute_overloadable__ int +dprintf (int __fd, __fortify_clang_overload_arg (const char *, __restrict, + __fmt), ...) +{ + __gnuc_va_list __fortify_ap; + __builtin_va_start (__fortify_ap, __fmt); + int __r = __vdprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt, + __fortify_ap); + __builtin_va_end (__fortify_ap); + return __r; +} # elif !defined __cplusplus # define dprintf(fd, ...) \ __dprintf_chk (fd, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__) @@ -153,6 +222,43 @@ __NTH (obstack_printf (struct obstack *__restrict __obstack, return __obstack_printf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } +# elif __fortify_use_clang +__fortify_function_error_function __attribute_overloadable__ int +__NTH (asprintf (__fortify_clang_overload_arg (char **, __restrict, __ptr), + const char *__restrict __fmt, ...)) +{ + __gnuc_va_list __fortify_ap; + __builtin_va_start (__fortify_ap, __fmt); + int __r = __vasprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt, + __fortify_ap); + __builtin_va_end (__fortify_ap); + return __r; +} + +__fortify_function_error_function __attribute_overloadable__ int +__NTH (__asprintf (__fortify_clang_overload_arg (char **, __restrict, __ptr), + const char *__restrict __fmt, ...)) +{ + __gnuc_va_list __fortify_ap; + __builtin_va_start (__fortify_ap, __fmt); + int __r = __vasprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt, + __fortify_ap); + __builtin_va_end (__fortify_ap); + return __r; +} + +__fortify_function_error_function __attribute_overloadable__ int +__NTH (obstack_printf (__fortify_clang_overload_arg (struct obstack *, + __restrict, __obstack), + const char *__restrict __fmt, ...)) +{ + __gnuc_va_list __fortify_ap; + __builtin_va_start (__fortify_ap, __fmt); + int __r = __obstack_vprintf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, + __fmt, __fortify_ap); + __builtin_va_end (__fortify_ap); + return __r; +} # elif !defined __cplusplus # define asprintf(ptr, ...) \ __asprintf_chk (ptr, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__) @@ -182,8 +288,11 @@ __NTH (obstack_vprintf (struct obstack *__restrict __obstack, #endif #if __GLIBC_USE (DEPRECATED_GETS) -__fortify_function __wur char * -gets (char *__str) +__fortify_function __wur __attribute_overloadable__ char * +gets (__fortify_clang_overload_arg (char *, , __str)) + __fortify_clang_warning (__glibc_objsize (__str) == (size_t) -1, + "please use fgets or getline instead, gets " + "can not specify buffer size") { if (__glibc_objsize (__str) != (size_t) -1) return __gets_chk (__str, __glibc_objsize (__str)); @@ -192,48 +301,70 @@ gets (char *__str) #endif __fortify_function __wur __fortified_attr_access (__write_only__, 1, 2) -__nonnull ((3)) char * -fgets (char *__restrict __s, int __n, FILE *__restrict __stream) +__nonnull ((3)) __attribute_overloadable__ char * +fgets (__fortify_clang_overload_arg (char *, __restrict, __s), int __n, + FILE *__restrict __stream) + __fortify_clang_warning (__fortify_clang_bos_static_lt (__n, __s) && __n > 0, + "fgets called with bigger size than length of " + "destination buffer") { size_t sz = __glibc_objsize (__s); if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz)) return __fgets_alias (__s, __n, __stream); +#if !__fortify_use_clang if (__glibc_unsafe_len (__n, sizeof (char), sz)) return __fgets_chk_warn (__s, sz, __n, __stream); +#endif return __fgets_chk (__s, sz, __n, __stream); } -__fortify_function __wur __nonnull ((4)) size_t -fread (void *__restrict __ptr, size_t __size, size_t __n, - FILE *__restrict __stream) +__fortify_function __wur __nonnull ((4)) __attribute_overloadable__ size_t +fread (__fortify_clang_overload_arg (void *, __restrict, __ptr), + size_t __size, size_t __n, FILE *__restrict __stream) + __fortify_clang_warning (__fortify_clang_bos0_static_lt (__size * __n, __ptr) + && !__fortify_clang_mul_may_overflow (__size, __n), + "fread called with bigger size * n than length " + "of destination buffer") { size_t sz = __glibc_objsize0 (__ptr); if (__glibc_safe_or_unknown_len (__n, __size, sz)) return __fread_alias (__ptr, __size, __n, __stream); +#if !__fortify_use_clang if (__glibc_unsafe_len (__n, __size, sz)) return __fread_chk_warn (__ptr, sz, __size, __n, __stream); +#endif return __fread_chk (__ptr, sz, __size, __n, __stream); } #ifdef __USE_GNU __fortify_function __wur __fortified_attr_access (__write_only__, 1, 2) -__nonnull ((3)) char * -fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream) +__nonnull ((3)) __attribute_overloadable__ char * +fgets_unlocked (__fortify_clang_overload_arg (char *, __restrict, __s), + int __n, FILE *__restrict __stream) + __fortify_clang_warning (__fortify_clang_bos_static_lt (__n, __s) && __n > 0, + "fgets called with bigger size than length of " + "destination buffer") { size_t sz = __glibc_objsize (__s); if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz)) return __fgets_unlocked_alias (__s, __n, __stream); +#if !__fortify_use_clang if (__glibc_unsafe_len (__n, sizeof (char), sz)) return __fgets_unlocked_chk_warn (__s, sz, __n, __stream); +#endif return __fgets_unlocked_chk (__s, sz, __n, __stream); } #endif #ifdef __USE_MISC # undef fread_unlocked -__fortify_function __wur __nonnull ((4)) size_t -fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, - FILE *__restrict __stream) +__fortify_function __wur __nonnull ((4)) __attribute_overloadable__ size_t +fread_unlocked (__fortify_clang_overload_arg0 (void *, __restrict, __ptr), + size_t __size, size_t __n, FILE *__restrict __stream) + __fortify_clang_warning (__fortify_clang_bos0_static_lt (__size * __n, __ptr) + && !__fortify_clang_mul_may_overflow (__size, __n), + "fread_unlocked called with bigger size * n than " + "length of destination buffer") { size_t sz = __glibc_objsize0 (__ptr); if (__glibc_safe_or_unknown_len (__n, __size, sz)) @@ -261,8 +392,10 @@ fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, # endif return __fread_unlocked_alias (__ptr, __size, __n, __stream); } +# if !__fortify_use_clang if (__glibc_unsafe_len (__n, __size, sz)) return __fread_unlocked_chk_warn (__ptr, sz, __size, __n, __stream); +# endif return __fread_unlocked_chk (__ptr, sz, __size, __n, __stream); } diff --git a/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h b/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h index 0c0ff1f2d489..2c09edb232a7 100644 --- a/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/stdlib-ldbl.h @@ -36,7 +36,7 @@ __LDBL_REDIR1_DECL (strtold_l, __strtoieee128_l) # endif #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) # ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (strfroml, strfromd) # else diff --git a/lib/libc/include/generic-glibc/bits/stdlib.h b/lib/libc/include/generic-glibc/bits/stdlib.h index 6c688df0049f..05024914f202 100644 --- a/lib/libc/include/generic-glibc/bits/stdlib.h +++ b/lib/libc/include/generic-glibc/bits/stdlib.h @@ -33,15 +33,22 @@ extern char *__REDIRECT_NTH (__realpath_chk_warn, __warnattr ("second argument of realpath must be either NULL or at " "least PATH_MAX bytes long buffer"); -__fortify_function __wur char * -__NTH (realpath (const char *__restrict __name, char *__restrict __resolved)) +__fortify_function __attribute_overloadable__ __wur char * +__NTH (realpath (const char *__restrict __name, + __fortify_clang_overload_arg (char *, __restrict, __resolved))) +#if defined _LIBC_LIMITS_H_ && defined PATH_MAX + __fortify_clang_warning_only_if_bos_lt (PATH_MAX, __resolved, + "second argument of realpath must be " + "either NULL or at least PATH_MAX " + "bytes long buffer") +#endif { size_t sz = __glibc_objsize (__resolved); if (sz == (size_t) -1) return __realpath_alias (__name, __resolved); -#if defined _LIBC_LIMITS_H_ && defined PATH_MAX +#if !__fortify_use_clang && defined _LIBC_LIMITS_H_ && defined PATH_MAX if (__glibc_unsafe_len (PATH_MAX, sizeof (char), sz)) return __realpath_chk_warn (__name, __resolved, sz); #endif @@ -61,8 +68,13 @@ extern int __REDIRECT_NTH (__ptsname_r_chk_warn, __nonnull ((2)) __warnattr ("ptsname_r called with buflen bigger than " "size of buf"); -__fortify_function int -__NTH (ptsname_r (int __fd, char *__buf, size_t __buflen)) +__fortify_function __attribute_overloadable__ int +__NTH (ptsname_r (int __fd, + __fortify_clang_overload_arg (char *, ,__buf), + size_t __buflen)) + __fortify_clang_warning_only_if_bos_lt (__buflen, __buf, + "ptsname_r called with buflen " + "bigger than size of buf") { return __glibc_fortify (ptsname_r, __buflen, sizeof (char), __glibc_objsize (__buf), @@ -75,8 +87,8 @@ extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen) extern int __REDIRECT_NTH (__wctomb_alias, (char *__s, wchar_t __wchar), wctomb) __wur; -__fortify_function __wur int -__NTH (wctomb (char *__s, wchar_t __wchar)) +__fortify_function __attribute_overloadable__ __wur int +__NTH (wctomb (__fortify_clang_overload_arg (char *, ,__s), wchar_t __wchar)) { /* We would have to include to get a definition of MB_LEN_MAX. But this would only disturb the namespace. So we define our own @@ -113,9 +125,13 @@ extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn, __warnattr ("mbstowcs called with dst buffer smaller than len " "* sizeof (wchar_t)"); -__fortify_function size_t -__NTH (mbstowcs (wchar_t *__restrict __dst, const char *__restrict __src, +__fortify_function __attribute_overloadable__ size_t +__NTH (mbstowcs (__fortify_clang_overload_arg (wchar_t *, __restrict, __dst), + const char *__restrict __src, size_t __len)) + __fortify_clang_warning_only_if_bos0_lt2 (__len, __dst, sizeof (wchar_t), + "mbstowcs called with dst buffer " + "smaller than len * sizeof (wchar_t)") { if (__builtin_constant_p (__dst == NULL) && __dst == NULL) return __mbstowcs_nulldst (__dst, __src, __len); @@ -139,8 +155,9 @@ extern size_t __REDIRECT_NTH (__wcstombs_chk_warn, size_t __len, size_t __dstlen), __wcstombs_chk) __warnattr ("wcstombs called with dst buffer smaller than len"); -__fortify_function size_t -__NTH (wcstombs (char *__restrict __dst, const wchar_t *__restrict __src, +__fortify_function __attribute_overloadable__ size_t +__NTH (wcstombs (__fortify_clang_overload_arg (char *, __restrict, __dst), + const wchar_t *__restrict __src, size_t __len)) { return __glibc_fortify (wcstombs, __len, sizeof (char), diff --git a/lib/libc/include/generic-glibc/bits/string_fortified.h b/lib/libc/include/generic-glibc/bits/string_fortified.h index 64617af6b7e4..8fc5ea82643f 100644 --- a/lib/libc/include/generic-glibc/bits/string_fortified.h +++ b/lib/libc/include/generic-glibc/bits/string_fortified.h @@ -73,24 +73,29 @@ __NTH (explicit_bzero (void *__dest, size_t __len)) } #endif -__fortify_function char * -__NTH (strcpy (char *__restrict __dest, const char *__restrict __src)) +__fortify_function __attribute_overloadable__ char * +__NTH (strcpy (__fortify_clang_overload_arg (char *, __restrict, __dest), + const char *__restrict __src)) + __fortify_clang_warn_if_src_too_large (__dest, __src) { return __builtin___strcpy_chk (__dest, __src, __glibc_objsize (__dest)); } #ifdef __USE_XOPEN2K8 -__fortify_function char * -__NTH (stpcpy (char *__restrict __dest, const char *__restrict __src)) +__fortify_function __attribute_overloadable__ char * +__NTH (stpcpy (__fortify_clang_overload_arg (char *, __restrict, __dest), + const char *__restrict __src)) + __fortify_clang_warn_if_src_too_large (__dest, __src) { return __builtin___stpcpy_chk (__dest, __src, __glibc_objsize (__dest)); } #endif -__fortify_function char * -__NTH (strncpy (char *__restrict __dest, const char *__restrict __src, - size_t __len)) +__fortify_function __attribute_overloadable__ char * +__NTH (strncpy (__fortify_clang_overload_arg (char *, __restrict, __dest), + const char *__restrict __src, size_t __len)) + __fortify_clang_warn_if_dest_too_small (__dest, __len) { return __builtin___strncpy_chk (__dest, __src, __len, __glibc_objsize (__dest)); @@ -98,8 +103,10 @@ __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, #ifdef __USE_XOPEN2K8 # if __GNUC_PREREQ (4, 7) || __glibc_clang_prereq (2, 6) -__fortify_function char * -__NTH (stpncpy (char *__dest, const char *__src, size_t __n)) +__fortify_function __attribute_overloadable__ char * +__NTH (stpncpy (__fortify_clang_overload_arg (char *, ,__dest), + const char *__src, size_t __n)) + __fortify_clang_warn_if_dest_too_small (__dest, __n) { return __builtin___stpncpy_chk (__dest, __src, __n, __glibc_objsize (__dest)); @@ -112,8 +119,9 @@ extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n, extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src, size_t __n), stpncpy); -__fortify_function char * -__NTH (stpncpy (char *__dest, const char *__src, size_t __n)) +__fortify_function __attribute_overloadable__ char * +__NTH (stpncpy (__fortify_clang_overload_arg (char *, ,__dest), + const char *__src, size_t __n)) { if (__bos (__dest) != (size_t) -1 && (!__builtin_constant_p (__n) || __n > __bos (__dest))) @@ -124,16 +132,19 @@ __NTH (stpncpy (char *__dest, const char *__src, size_t __n)) #endif -__fortify_function char * -__NTH (strcat (char *__restrict __dest, const char *__restrict __src)) +__fortify_function __attribute_overloadable__ char * +__NTH (strcat (__fortify_clang_overload_arg (char *, __restrict, __dest), + const char *__restrict __src)) + __fortify_clang_warn_if_src_too_large (__dest, __src) { return __builtin___strcat_chk (__dest, __src, __glibc_objsize (__dest)); } -__fortify_function char * -__NTH (strncat (char *__restrict __dest, const char *__restrict __src, - size_t __len)) +__fortify_function __attribute_overloadable__ char * +__NTH (strncat (__fortify_clang_overload_arg (char *, __restrict, __dest), + const char *__restrict __src, size_t __len)) + __fortify_clang_warn_if_src_too_large (__dest, __src) { return __builtin___strncat_chk (__dest, __src, __len, __glibc_objsize (__dest)); @@ -146,9 +157,10 @@ extern size_t __REDIRECT_NTH (__strlcpy_alias, (char *__dest, const char *__src, size_t __n), strlcpy); -__fortify_function size_t -__NTH (strlcpy (char *__restrict __dest, const char *__restrict __src, - size_t __n)) +__fortify_function __attribute_overloadable__ size_t +__NTH (strlcpy (__fortify_clang_overload_arg (char *, __restrict, __dest), + const char *__restrict __src, size_t __n)) + __fortify_clang_warn_if_dest_too_small (__dest, __n) { if (__glibc_objsize (__dest) != (size_t) -1 && (!__builtin_constant_p (__n > __glibc_objsize (__dest)) @@ -163,9 +175,9 @@ extern size_t __REDIRECT_NTH (__strlcat_alias, (char *__dest, const char *__src, size_t __n), strlcat); -__fortify_function size_t -__NTH (strlcat (char *__restrict __dest, const char *__restrict __src, - size_t __n)) +__fortify_function __attribute_overloadable__ size_t +__NTH (strlcat (__fortify_clang_overload_arg (char *, __restrict, __dest), + const char *__restrict __src, size_t __n)) { if (__glibc_objsize (__dest) != (size_t) -1 && (!__builtin_constant_p (__n > __glibc_objsize (__dest)) diff --git a/lib/libc/include/generic-glibc/bits/struct_stat.h b/lib/libc/include/generic-glibc/bits/struct_stat.h index 5a4615a47555..8916bda62b15 100644 --- a/lib/libc/include/generic-glibc/bits/struct_stat.h +++ b/lib/libc/include/generic-glibc/bits/struct_stat.h @@ -29,7 +29,7 @@ /* Structure describing file characteristics. */ struct stat { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else unsigned long int st_dev; @@ -82,13 +82,13 @@ struct stat __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ # endif long int st_pad5[14]; -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; # ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else unsigned long int st_dev; @@ -123,7 +123,7 @@ struct stat64 long int st_pad3; __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ long int st_pad4[14]; -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; # endif /* __USE_LARGEFILE64 */ @@ -131,7 +131,7 @@ struct stat64 struct stat { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; @@ -189,7 +189,7 @@ struct stat #ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; @@ -224,7 +224,7 @@ struct stat64 unsigned int st_pad3; __blkcnt64_t st_blocks; int st_pad4[14]; -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; #endif diff --git a/lib/libc/include/generic-glibc/bits/syscall.h b/lib/libc/include/generic-glibc/bits/syscall.h index acf653fcdf59..4d5eebfb8324 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 6.7. */ +/* The system call list corresponds to kernel 6.9. */ #ifndef _SYSCALL_H # error "Never use directly; include instead." #endif -#define __GLIBC_LINUX_VERSION_CODE 395008 +#define __GLIBC_LINUX_VERSION_CODE 395520 #ifdef __NR_FAST_atomic_update # define SYS_FAST_atomic_update __NR_FAST_atomic_update @@ -867,6 +867,10 @@ # define SYS_listen __NR_listen #endif +#ifdef __NR_listmount +# define SYS_listmount __NR_listmount +#endif + #ifdef __NR_listxattr # define SYS_listxattr __NR_listxattr #endif @@ -899,6 +903,18 @@ # define SYS_lsetxattr __NR_lsetxattr #endif +#ifdef __NR_lsm_get_self_attr +# define SYS_lsm_get_self_attr __NR_lsm_get_self_attr +#endif + +#ifdef __NR_lsm_list_modules +# define SYS_lsm_list_modules __NR_lsm_list_modules +#endif + +#ifdef __NR_lsm_set_self_attr +# define SYS_lsm_set_self_attr __NR_lsm_set_self_attr +#endif + #ifdef __NR_lstat # define SYS_lstat __NR_lstat #endif @@ -2283,6 +2299,10 @@ # define SYS_statfs64 __NR_statfs64 #endif +#ifdef __NR_statmount +# define SYS_statmount __NR_statmount +#endif + #ifdef __NR_statx # define SYS_statx __NR_statx #endif diff --git a/lib/libc/include/generic-glibc/bits/syslog.h b/lib/libc/include/generic-glibc/bits/syslog.h index d2a3658f3867..94c143234fcc 100644 --- a/lib/libc/include/generic-glibc/bits/syslog.h +++ b/lib/libc/include/generic-glibc/bits/syslog.h @@ -36,6 +36,15 @@ syslog (int __pri, const char *__fmt, ...) { __syslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } +#elif __fortify_use_clang && defined __USE_MISC +__fortify_function_error_function __attribute_overloadable__ void +syslog (int __pri, __fortify_clang_overload_arg (const char *, , __fmt), ...) +{ + __gnuc_va_list __fortify_ap; + __builtin_va_start (__fortify_ap, __fmt); + __vsyslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __fortify_ap); + __builtin_va_end (__fortify_ap); +} #elif !defined __cplusplus # define syslog(pri, ...) \ __syslog_chk (pri, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__) @@ -43,8 +52,9 @@ syslog (int __pri, const char *__fmt, ...) #ifdef __USE_MISC -__fortify_function void -vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap) +__fortify_function __attribute_overloadable__ void +vsyslog (int __pri, __fortify_clang_overload_arg (const char *, ,__fmt), + __gnuc_va_list __ap) { __vsyslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); } diff --git a/lib/libc/include/generic-glibc/bits/time.h b/lib/libc/include/generic-glibc/bits/time.h index 27e5d611cfac..8ad6bc463ca9 100644 --- a/lib/libc/include/generic-glibc/bits/time.h +++ b/lib/libc/include/generic-glibc/bits/time.h @@ -77,7 +77,7 @@ __BEGIN_DECLS /* Tune a POSIX clock. */ extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW __nonnull((2)); -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # if defined(__REDIRECT_NTH) extern int __REDIRECT_NTH (clock_adjtime, (__clockid_t __clock_id, struct timex *__utx), diff --git a/lib/libc/include/generic-glibc/bits/timex.h b/lib/libc/include/generic-glibc/bits/timex.h index 0eae737310c6..bc583ec4dcb3 100644 --- a/lib/libc/include/generic-glibc/bits/timex.h +++ b/lib/libc/include/generic-glibc/bits/timex.h @@ -25,7 +25,7 @@ struct timex { -# if defined __USE_TIME_BITS64 || (__TIMESIZE == 64 && __WORDSIZE == 32) +# if defined __USE_TIME64_REDIRECTS || (__TIMESIZE == 64 && __WORDSIZE == 32) unsigned int modes; /* mode selector */ int :32; /* pad */ long long offset; /* time offset (usec) */ diff --git a/lib/libc/include/generic-glibc/bits/types/struct_FILE.h b/lib/libc/include/generic-glibc/bits/types/struct_FILE.h index 1327fd550459..1d50bbe99ac7 100644 --- a/lib/libc/include/generic-glibc/bits/types/struct_FILE.h +++ b/lib/libc/include/generic-glibc/bits/types/struct_FILE.h @@ -92,10 +92,10 @@ struct _IO_FILE_complete struct _IO_wide_data *_wide_data; struct _IO_FILE *_freeres_list; void *_freeres_buf; - size_t __pad5; + struct _IO_FILE **_prevchain; int _mode; /* Make sure we don't get into trouble again. */ - char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; + char _unused2[15 * sizeof (int) - 5 * sizeof (void *)]; }; /* These macros are used by bits/stdio.h and internal headers. */ diff --git a/lib/libc/include/generic-glibc/bits/types/struct_msqid_ds.h b/lib/libc/include/generic-glibc/bits/types/struct_msqid_ds.h index 0f1c6086377d..7ad243740375 100644 --- a/lib/libc/include/generic-glibc/bits/types/struct_msqid_ds.h +++ b/lib/libc/include/generic-glibc/bits/types/struct_msqid_ds.h @@ -26,7 +26,7 @@ The type `struct msg' is opaque. */ struct msqid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm msg_perm; /* structure describing operation permission */ diff --git a/lib/libc/include/generic-glibc/bits/types/struct_semid_ds.h b/lib/libc/include/generic-glibc/bits/types/struct_semid_ds.h index 74396154375d..19a562490441 100644 --- a/lib/libc/include/generic-glibc/bits/types/struct_semid_ds.h +++ b/lib/libc/include/generic-glibc/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/generic-glibc/bits/types/struct_shmid_ds.h b/lib/libc/include/generic-glibc/bits/types/struct_shmid_ds.h index d60cd29eb72d..62e1ce88588d 100644 --- a/lib/libc/include/generic-glibc/bits/types/struct_shmid_ds.h +++ b/lib/libc/include/generic-glibc/bits/types/struct_shmid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm shm_perm; /* operation permission struct */ diff --git a/lib/libc/include/generic-glibc/bits/types/struct_timespec.h b/lib/libc/include/generic-glibc/bits/types/struct_timespec.h index d008a04a4b1b..4ddd0fa3e7b7 100644 --- a/lib/libc/include/generic-glibc/bits/types/struct_timespec.h +++ b/lib/libc/include/generic-glibc/bits/types/struct_timespec.h @@ -10,14 +10,14 @@ has nanoseconds instead of microseconds. */ struct timespec { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS __time64_t tv_sec; /* Seconds. */ #else __time_t tv_sec; /* Seconds. */ #endif #if __WORDSIZE == 64 \ || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \ - || (__TIMESIZE == 32 && !defined __USE_TIME_BITS64) + || (__TIMESIZE == 32 && !defined __USE_TIME64_REDIRECTS) __syscall_slong_t tv_nsec; /* Nanoseconds. */ #else # if __BYTE_ORDER == __BIG_ENDIAN diff --git a/lib/libc/include/generic-glibc/bits/types/struct_timeval.h b/lib/libc/include/generic-glibc/bits/types/struct_timeval.h index 176b5e4f4e40..9508e7130c9f 100644 --- a/lib/libc/include/generic-glibc/bits/types/struct_timeval.h +++ b/lib/libc/include/generic-glibc/bits/types/struct_timeval.h @@ -7,7 +7,7 @@ microsecond but also has a range of years. */ struct timeval { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS __time64_t tv_sec; /* Seconds. */ __suseconds64_t tv_usec; /* Microseconds. */ #else diff --git a/lib/libc/include/generic-glibc/bits/types/time_t.h b/lib/libc/include/generic-glibc/bits/types/time_t.h index 073c25016b23..88bd35902700 100644 --- a/lib/libc/include/generic-glibc/bits/types/time_t.h +++ b/lib/libc/include/generic-glibc/bits/types/time_t.h @@ -4,7 +4,7 @@ #include /* Returned by `time'. */ -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS typedef __time64_t time_t; #else typedef __time_t time_t; diff --git a/lib/libc/include/generic-glibc/bits/typesizes.h b/lib/libc/include/generic-glibc/bits/typesizes.h index 4c384e86917d..d875caa94e85 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. MIPS version. - Copyright (C) 2002-2024 Free Software Foundation, Inc. +/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI. + Copyright (C) 2011-2024 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,7 +13,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 . */ #ifndef _BITS_TYPES_H @@ -25,44 +25,57 @@ /* 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 __UWORD_TYPE -#define __OFF_T_TYPE __SLONGWORD_TYPE +#define __NLINK_T_TYPE __U32_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 #define __TIMER_T_TYPE void * -#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE +#define __BLKSIZE_T_TYPE __S32_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 -#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. */ @@ -71,20 +84,19 @@ /* 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 +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64) #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 diff --git a/lib/libc/include/generic-glibc/bits/uio-ext.h b/lib/libc/include/generic-glibc/bits/uio-ext.h index 7b83bc4b0ad8..3106030294cb 100644 --- a/lib/libc/include/generic-glibc/bits/uio-ext.h +++ b/lib/libc/include/generic-glibc/bits/uio-ext.h @@ -47,6 +47,7 @@ extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec, #define RWF_SYNC 0x00000004 /* per-IO O_SYNC. */ #define RWF_NOWAIT 0x00000008 /* per-IO nonblocking mode. */ #define RWF_APPEND 0x00000010 /* per-IO O_APPEND. */ +#define RWF_NOAPPEND 0x00000020 /* per-IO negation of O_APPEND */ __END_DECLS diff --git a/lib/libc/include/generic-glibc/bits/unistd.h b/lib/libc/include/generic-glibc/bits/unistd.h index 8d8548f0be73..1dc32c9b5ae9 100644 --- a/lib/libc/include/generic-glibc/bits/unistd.h +++ b/lib/libc/include/generic-glibc/bits/unistd.h @@ -22,8 +22,12 @@ # include -__fortify_function __wur ssize_t -read (int __fd, void *__buf, size_t __nbytes) +__fortify_function __attribute_overloadable__ __wur ssize_t +read (int __fd, __fortify_clang_overload_arg0 (void *, ,__buf), size_t __nbytes) + __fortify_clang_warning_only_if_bos0_lt (__nbytes, __buf, + "read called with bigger length than " + "size of the destination buffer") + { return __glibc_fortify (read, __nbytes, sizeof (char), __glibc_objsize0 (__buf), @@ -32,16 +36,24 @@ read (int __fd, void *__buf, size_t __nbytes) #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 # ifndef __USE_FILE_OFFSET64 -__fortify_function __wur ssize_t -pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset) +__fortify_function __attribute_overloadable__ __wur ssize_t +pread (int __fd, __fortify_clang_overload_arg0 (void *, ,__buf), + size_t __nbytes, __off_t __offset) + __fortify_clang_warning_only_if_bos0_lt (__nbytes, __buf, + "pread called with bigger length than " + "size of the destination buffer") { return __glibc_fortify (pread, __nbytes, sizeof (char), __glibc_objsize0 (__buf), __fd, __buf, __nbytes, __offset); } # else -__fortify_function __wur ssize_t -pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) +__fortify_function __attribute_overloadable__ __wur ssize_t +pread (int __fd, __fortify_clang_overload_arg0 (void *, ,__buf), + size_t __nbytes, __off64_t __offset) + __fortify_clang_warning_only_if_bos0_lt (__nbytes, __buf, + "pread called with bigger length than " + "size of the destination buffer") { return __glibc_fortify (pread64, __nbytes, sizeof (char), __glibc_objsize0 (__buf), @@ -50,8 +62,12 @@ pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) # endif # ifdef __USE_LARGEFILE64 -__fortify_function __wur ssize_t -pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) +__fortify_function __attribute_overloadable__ __wur ssize_t +pread64 (int __fd, __fortify_clang_overload_arg0 (void *, ,__buf), + size_t __nbytes, __off64_t __offset) + __fortify_clang_warning_only_if_bos0_lt (__nbytes, __buf, + "pread64 called with bigger length than " + "size of the destination buffer") { return __glibc_fortify (pread64, __nbytes, sizeof (char), __glibc_objsize0 (__buf), @@ -61,9 +77,14 @@ pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K -__fortify_function __nonnull ((1, 2)) __wur ssize_t -__NTH (readlink (const char *__restrict __path, char *__restrict __buf, +__fortify_function __attribute_overloadable__ __nonnull ((1, 2)) __wur ssize_t +__NTH (readlink (const char *__restrict __path, + __fortify_clang_overload_arg0 (char *, __restrict, __buf), size_t __len)) + __fortify_clang_warning_only_if_bos_lt (__len, __buf, + "readlink called with bigger length " + "than size of destination buffer") + { return __glibc_fortify (readlink, __len, sizeof (char), __glibc_objsize (__buf), @@ -72,9 +93,13 @@ __NTH (readlink (const char *__restrict __path, char *__restrict __buf, #endif #ifdef __USE_ATFILE -__fortify_function __nonnull ((2, 3)) __wur ssize_t +__fortify_function __attribute_overloadable__ __nonnull ((2, 3)) __wur ssize_t __NTH (readlinkat (int __fd, const char *__restrict __path, - char *__restrict __buf, size_t __len)) + __fortify_clang_overload_arg0 (char *, __restrict, __buf), + size_t __len)) + __fortify_clang_warning_only_if_bos_lt (__len, __buf, + "readlinkat called with bigger length " + "than size of destination buffer") { return __glibc_fortify (readlinkat, __len, sizeof (char), __glibc_objsize (__buf), @@ -82,8 +107,11 @@ __NTH (readlinkat (int __fd, const char *__restrict __path, } #endif -__fortify_function __wur char * -__NTH (getcwd (char *__buf, size_t __size)) +__fortify_function __attribute_overloadable__ __wur char * +__NTH (getcwd (__fortify_clang_overload_arg (char *, , __buf), size_t __size)) + __fortify_clang_warning_only_if_bos_lt (__size, __buf, + "getcwd called with bigger length " + "than size of destination buffer") { return __glibc_fortify (getcwd, __size, sizeof (char), __glibc_objsize (__buf), @@ -91,8 +119,9 @@ __NTH (getcwd (char *__buf, size_t __size)) } #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED -__fortify_function __nonnull ((1)) __attribute_deprecated__ __wur char * -__NTH (getwd (char *__buf)) +__fortify_function __attribute_overloadable__ __nonnull ((1)) +__attribute_deprecated__ __wur char * +__NTH (getwd (__fortify_clang_overload_arg (char *,, __buf))) { if (__glibc_objsize (__buf) != (size_t) -1) return __getwd_chk (__buf, __glibc_objsize (__buf)); @@ -100,8 +129,12 @@ __NTH (getwd (char *__buf)) } #endif -__fortify_function size_t -__NTH (confstr (int __name, char *__buf, size_t __len)) +__fortify_function __attribute_overloadable__ size_t +__NTH (confstr (int __name, __fortify_clang_overload_arg (char *, ,__buf), + size_t __len)) + __fortify_clang_warning_only_if_bos_lt (__len, __buf, + "confstr called with bigger length than " + "size of destination buffer") { return __glibc_fortify (confstr, __len, sizeof (char), __glibc_objsize (__buf), @@ -109,8 +142,13 @@ __NTH (confstr (int __name, char *__buf, size_t __len)) } -__fortify_function int -__NTH (getgroups (int __size, __gid_t __list[])) +__fortify_function __attribute_overloadable__ int +__NTH (getgroups (int __size, + __fortify_clang_overload_arg (__gid_t *, , __list))) + __fortify_clang_warning_only_if_bos_lt (__size * sizeof (__gid_t), __list, + "getgroups called with bigger group " + "count than what can fit into " + "destination buffer") { return __glibc_fortify (getgroups, __size, sizeof (__gid_t), __glibc_objsize (__list), @@ -118,8 +156,13 @@ __NTH (getgroups (int __size, __gid_t __list[])) } -__fortify_function int -__NTH (ttyname_r (int __fd, char *__buf, size_t __buflen)) +__fortify_function __attribute_overloadable__ int +__NTH (ttyname_r (int __fd, + __fortify_clang_overload_arg (char *, ,__buf), + size_t __buflen)) + __fortify_clang_warning_only_if_bos_lt (__buflen, __buf, + "ttyname_r called with bigger buflen " + "than size of destination buffer") { return __glibc_fortify (ttyname_r, __buflen, sizeof (char), __glibc_objsize (__buf), @@ -128,8 +171,11 @@ __NTH (ttyname_r (int __fd, char *__buf, size_t __buflen)) #ifdef __USE_POSIX199506 -__fortify_function int -getlogin_r (char *__buf, size_t __buflen) +__fortify_function __attribute_overloadable__ int +getlogin_r (__fortify_clang_overload_arg (char *, ,__buf), size_t __buflen) + __fortify_clang_warning_only_if_bos_lt (__buflen, __buf, + "getlogin_r called with bigger buflen " + "than size of destination buffer") { return __glibc_fortify (getlogin_r, __buflen, sizeof (char), __glibc_objsize (__buf), @@ -139,8 +185,12 @@ getlogin_r (char *__buf, size_t __buflen) #if defined __USE_MISC || defined __USE_UNIX98 -__fortify_function int -__NTH (gethostname (char *__buf, size_t __buflen)) +__fortify_function __attribute_overloadable__ int +__NTH (gethostname (__fortify_clang_overload_arg (char *, ,__buf), + size_t __buflen)) + __fortify_clang_warning_only_if_bos_lt (__buflen, __buf, + "gethostname called with bigger buflen " + "than size of destination buffer") { return __glibc_fortify (gethostname, __buflen, sizeof (char), __glibc_objsize (__buf), @@ -150,8 +200,12 @@ __NTH (gethostname (char *__buf, size_t __buflen)) #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_UNIX98) -__fortify_function int -__NTH (getdomainname (char *__buf, size_t __buflen)) +__fortify_function __attribute_overloadable__ int +__NTH (getdomainname (__fortify_clang_overload_arg (char *, ,__buf), + size_t __buflen)) + __fortify_clang_warning_only_if_bos_lt (__buflen, __buf, + "getdomainname called with bigger " + "buflen than size of destination buffer") { return __glibc_fortify (getdomainname, __buflen, sizeof (char), __glibc_objsize (__buf), diff --git a/lib/libc/include/generic-glibc/bits/utmp.h b/lib/libc/include/generic-glibc/bits/utmp.h index 1250304ece79..496805e5597e 100644 --- a/lib/libc/include/generic-glibc/bits/utmp.h +++ b/lib/libc/include/generic-glibc/bits/utmp.h @@ -36,7 +36,7 @@ struct lastlog { #if __WORDSIZE_TIME64_COMPAT32 - int32_t ll_time; + __uint32_t ll_time; #else __time_t ll_time; #endif @@ -76,7 +76,7 @@ struct utmp int32_t ut_session; /* Session ID, used for windowing. */ struct { - int32_t tv_sec; /* Seconds. */ + __uint32_t tv_sec; /* Seconds. */ int32_t tv_usec; /* Microseconds. */ } ut_tv; /* Time entry was made. */ #else diff --git a/lib/libc/include/generic-glibc/bits/utmpx.h b/lib/libc/include/generic-glibc/bits/utmpx.h index caac097e55ed..c27867dc3e4b 100644 --- a/lib/libc/include/generic-glibc/bits/utmpx.h +++ b/lib/libc/include/generic-glibc/bits/utmpx.h @@ -74,7 +74,7 @@ struct utmpx __int32_t ut_session; /* Session ID, used for windowing. */ struct { - __int32_t tv_sec; /* Seconds. */ + __uint32_t tv_sec; /* Seconds. */ __int32_t tv_usec; /* Microseconds. */ } ut_tv; /* Time entry was made. */ #else diff --git a/lib/libc/include/generic-glibc/bits/wchar-ldbl.h b/lib/libc/include/generic-glibc/bits/wchar-ldbl.h index 6b377659f13e..5bfb6838a2f1 100644 --- a/lib/libc/include/generic-glibc/bits/wchar-ldbl.h +++ b/lib/libc/include/generic-glibc/bits/wchar-ldbl.h @@ -29,7 +29,7 @@ __LDBL_REDIR_DECL (vwprintf); __LDBL_REDIR_DECL (vswprintf); # if !__GLIBC_USE (DEPRECATED_SCANF) # if defined __LDBL_COMPAT -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc23_fwscanf) __LDBL_REDIR1_DECL (wscanf, __nldbl___isoc23_wscanf) __LDBL_REDIR1_DECL (swscanf, __nldbl___isoc23_swscanf) @@ -39,7 +39,7 @@ __LDBL_REDIR1_DECL (wscanf, __nldbl___isoc99_wscanf) __LDBL_REDIR1_DECL (swscanf, __nldbl___isoc99_swscanf) # endif # elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (fwscanf, __isoc23_fwscanfieee128) __LDBL_REDIR1_DECL (wscanf, __isoc23_wscanfieee128) __LDBL_REDIR1_DECL (swscanf, __isoc23_swscanfieee128) @@ -66,7 +66,7 @@ __LDBL_REDIR1_DECL (wcstold, __wcstoieee128) # endif # if !__GLIBC_USE (DEPRECATED_SCANF) # if defined __LDBL_COMPAT -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc23_vfwscanf) __LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc23_vwscanf) __LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc23_vswscanf) @@ -76,7 +76,7 @@ __LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc99_vwscanf) __LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc99_vswscanf) # endif # elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (vfwscanf, __isoc23_vfwscanfieee128) __LDBL_REDIR1_DECL (vwscanf, __isoc23_vwscanfieee128) __LDBL_REDIR1_DECL (vswscanf, __isoc23_vswscanfieee128) diff --git a/lib/libc/include/generic-glibc/bits/wchar2.h b/lib/libc/include/generic-glibc/bits/wchar2.h index 59efb0bdaca4..4d1c8f74ee61 100644 --- a/lib/libc/include/generic-glibc/bits/wchar2.h +++ b/lib/libc/include/generic-glibc/bits/wchar2.h @@ -20,17 +20,24 @@ # error "Never include directly; use instead." #endif -__fortify_function wchar_t * -__NTH (wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, - size_t __n)) +__fortify_function __attribute_overloadable__ wchar_t * +__NTH (wmemcpy (__fortify_clang_overload_arg (wchar_t *, __restrict, __s1), + const wchar_t *__restrict __s2, size_t __n)) + __fortify_clang_warning_only_if_bos0_lt2 (__n, __s1, sizeof (wchar_t), + "wmemcpy called with length bigger " + "than size of destination buffer") { return __glibc_fortify_n (wmemcpy, __n, sizeof (wchar_t), __glibc_objsize0 (__s1), __s1, __s2, __n); } -__fortify_function wchar_t * -__NTH (wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n)) +__fortify_function __attribute_overloadable__ wchar_t * +__NTH (wmemmove (__fortify_clang_overload_arg (wchar_t *, ,__s1), + const wchar_t *__s2, size_t __n)) + __fortify_clang_warning_only_if_bos0_lt2 (__n, __s1, sizeof (wchar_t), + "wmemmove called with length bigger " + "than size of destination buffer") { return __glibc_fortify_n (wmemmove, __n, sizeof (wchar_t), __glibc_objsize0 (__s1), @@ -38,9 +45,12 @@ __NTH (wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n)) } #ifdef __USE_GNU -__fortify_function wchar_t * -__NTH (wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, - size_t __n)) +__fortify_function __attribute_overloadable__ wchar_t * +__NTH (wmempcpy (__fortify_clang_overload_arg (wchar_t *, __restrict, __s1), + const wchar_t *__restrict __s2, size_t __n)) + __fortify_clang_warning_only_if_bos0_lt2 (__n, __s1, sizeof (wchar_t), + "wmempcpy called with length bigger " + "than size of destination buffer") { return __glibc_fortify_n (wmempcpy, __n, sizeof (wchar_t), __glibc_objsize0 (__s1), @@ -48,16 +58,21 @@ __NTH (wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, } #endif -__fortify_function wchar_t * -__NTH (wmemset (wchar_t *__s, wchar_t __c, size_t __n)) +__fortify_function __attribute_overloadable__ wchar_t * +__NTH (wmemset (__fortify_clang_overload_arg (wchar_t *, ,__s), wchar_t __c, + size_t __n)) + __fortify_clang_warning_only_if_bos0_lt2 (__n, __s, sizeof (wchar_t), + "wmemset called with length bigger " + "than size of destination buffer") { return __glibc_fortify_n (wmemset, __n, sizeof (wchar_t), __glibc_objsize0 (__s), __s, __c, __n); } -__fortify_function wchar_t * -__NTH (wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src)) +__fortify_function __attribute_overloadable__ wchar_t * +__NTH (wcscpy (__fortify_clang_overload_arg (wchar_t *, __restrict, __dest), + const wchar_t *__restrict __src)) { size_t sz = __glibc_objsize (__dest); if (sz != (size_t) -1) @@ -65,8 +80,9 @@ __NTH (wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src)) return __wcscpy_alias (__dest, __src); } -__fortify_function wchar_t * -__NTH (wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src)) +__fortify_function __attribute_overloadable__ wchar_t * +__NTH (wcpcpy (__fortify_clang_overload_arg (wchar_t *, __restrict, __dest), + const wchar_t *__restrict __src)) { size_t sz = __glibc_objsize (__dest); if (sz != (size_t) -1) @@ -74,26 +90,33 @@ __NTH (wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src)) return __wcpcpy_alias (__dest, __src); } -__fortify_function wchar_t * -__NTH (wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, - size_t __n)) +__fortify_function __attribute_overloadable__ wchar_t * +__NTH (wcsncpy (__fortify_clang_overload_arg (wchar_t *, __restrict, __dest), + const wchar_t *__restrict __src, size_t __n)) + __fortify_clang_warning_only_if_bos0_lt2 (__n, __dest, sizeof (wchar_t), + "wcsncpy called with length bigger " + "than size of destination buffer") { return __glibc_fortify_n (wcsncpy, __n, sizeof (wchar_t), __glibc_objsize (__dest), __dest, __src, __n); } -__fortify_function wchar_t * -__NTH (wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, - size_t __n)) +__fortify_function __attribute_overloadable__ wchar_t * +__NTH (wcpncpy (__fortify_clang_overload_arg (wchar_t *, __restrict, __dest), + const wchar_t *__restrict __src, size_t __n)) + __fortify_clang_warning_only_if_bos0_lt2 (__n, __dest, sizeof (wchar_t), + "wcpncpy called with length bigger " + "than size of destination buffer") { return __glibc_fortify_n (wcpncpy, __n, sizeof (wchar_t), __glibc_objsize (__dest), __dest, __src, __n); } -__fortify_function wchar_t * -__NTH (wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src)) +__fortify_function __attribute_overloadable__ wchar_t * +__NTH (wcscat (__fortify_clang_overload_arg (wchar_t *, __restrict, __dest), + const wchar_t *__restrict __src)) { size_t sz = __glibc_objsize (__dest); if (sz != (size_t) -1) @@ -101,9 +124,9 @@ __NTH (wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src)) return __wcscat_alias (__dest, __src); } -__fortify_function wchar_t * -__NTH (wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src, - size_t __n)) +__fortify_function __attribute_overloadable__ wchar_t * +__NTH (wcsncat (__fortify_clang_overload_arg (wchar_t *, __restrict, __dest), + const wchar_t *__restrict __src, size_t __n)) { size_t sz = __glibc_objsize (__dest); if (sz != (size_t) -1) @@ -112,9 +135,12 @@ __NTH (wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src, } #ifdef __USE_MISC -__fortify_function size_t -__NTH (wcslcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, - size_t __n)) +__fortify_function __attribute_overloadable__ size_t +__NTH (wcslcpy (__fortify_clang_overload_arg (wchar_t *, __restrict, __dest), + const wchar_t *__restrict __src, size_t __n)) + __fortify_clang_warning_only_if_bos0_lt2 (__n, __dest, sizeof (wchar_t), + "wcslcpy called with length bigger " + "than size of destination buffer") { if (__glibc_objsize (__dest) != (size_t) -1 && (!__builtin_constant_p (__n @@ -125,9 +151,9 @@ __NTH (wcslcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, return __wcslcpy_alias (__dest, __src, __n); } -__fortify_function size_t -__NTH (wcslcat (wchar_t *__restrict __dest, const wchar_t *__restrict __src, - size_t __n)) +__fortify_function __attribute_overloadable__ size_t +__NTH (wcslcat (__fortify_clang_overload_arg (wchar_t *, __restrict, __dest), + const wchar_t *__restrict __src, size_t __n)) { if (__glibc_objsize (__dest) != (size_t) -1 && (!__builtin_constant_p (__n > __glibc_objsize (__dest) @@ -150,6 +176,23 @@ __NTH (swprintf (wchar_t *__restrict __s, size_t __n, sz / sizeof (wchar_t), __fmt, __va_arg_pack ()); return __swprintf_alias (__s, __n, __fmt, __va_arg_pack ()); } +#elif __fortify_use_clang +__fortify_function_error_function __attribute_overloadable__ int +__NTH (swprintf (__fortify_clang_overload_arg (wchar_t *, __restrict, __s), + size_t __n, const wchar_t *__restrict __fmt, ...)) +{ + __gnuc_va_list __fortify_ap; + __builtin_va_start (__fortify_ap, __fmt); + int __r; + if (__glibc_objsize (__s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1) + __r = __vswprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, + __glibc_objsize (__s) / sizeof (wchar_t), + __fmt, __fortify_ap); + else + __r = __vswprintf_alias (__s, __n, __fmt, __fortify_ap); + __builtin_va_end (__fortify_ap); + return __r; +} #elif !defined __cplusplus /* XXX We might want to have support in gcc for swprintf. */ # define swprintf(s, n, ...) \ @@ -207,34 +250,46 @@ vfwprintf (__FILE *__restrict __stream, } #endif -__fortify_function __wur wchar_t * -fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream) +__fortify_function __attribute_overloadable__ __wur wchar_t * +fgetws (__fortify_clang_overload_arg (wchar_t *, __restrict, __s), int __n, + __FILE *__restrict __stream) + __fortify_clang_warning_only_if_bos_lt2 (__n, __s, sizeof (wchar_t), + "fgetws called with length bigger " + "than size of destination buffer") { size_t sz = __glibc_objsize (__s); if (__glibc_safe_or_unknown_len (__n, sizeof (wchar_t), sz)) return __fgetws_alias (__s, __n, __stream); +#if !__fortify_use_clang if (__glibc_unsafe_len (__n, sizeof (wchar_t), sz)) return __fgetws_chk_warn (__s, sz / sizeof (wchar_t), __n, __stream); +#endif return __fgetws_chk (__s, sz / sizeof (wchar_t), __n, __stream); } #ifdef __USE_GNU -__fortify_function __wur wchar_t * -fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream) +__fortify_function __attribute_overloadable__ __wur wchar_t * +fgetws_unlocked (__fortify_clang_overload_arg (wchar_t *, __restrict, __s), + int __n, __FILE *__restrict __stream) + __fortify_clang_warning_only_if_bos_lt2 (__n, __s, sizeof (wchar_t), + "fgetws_unlocked called with length bigger " + "than size of destination buffer") { size_t sz = __glibc_objsize (__s); if (__glibc_safe_or_unknown_len (__n, sizeof (wchar_t), sz)) return __fgetws_unlocked_alias (__s, __n, __stream); +# if !__fortify_use_clang if (__glibc_unsafe_len (__n, sizeof (wchar_t), sz)) return __fgetws_unlocked_chk_warn (__s, sz / sizeof (wchar_t), __n, __stream); +# endif return __fgetws_unlocked_chk (__s, sz / sizeof (wchar_t), __n, __stream); } #endif -__fortify_function __wur size_t -__NTH (wcrtomb (char *__restrict __s, wchar_t __wchar, - mbstate_t *__restrict __ps)) +__fortify_function __attribute_overloadable__ __wur size_t +__NTH (wcrtomb (__fortify_clang_overload_arg (char *, __restrict, __s), + wchar_t __wchar, mbstate_t *__restrict __ps)) { /* We would have to include to get a definition of MB_LEN_MAX. But this would only disturb the namespace. So we define our own @@ -249,18 +304,26 @@ __NTH (wcrtomb (char *__restrict __s, wchar_t __wchar, return __wcrtomb_alias (__s, __wchar, __ps); } -__fortify_function size_t -__NTH (mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, +__fortify_function __attribute_overloadable__ size_t +__NTH (mbsrtowcs (__fortify_clang_overload_arg (wchar_t *, __restrict, __dst), + const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps)) + __fortify_clang_warning_only_if_bos_lt2 (__len, __dst, sizeof (wchar_t), + "mbsrtowcs called with dst buffer " + "smaller than len * sizeof (wchar_t)") { return __glibc_fortify_n (mbsrtowcs, __len, sizeof (wchar_t), __glibc_objsize (__dst), __dst, __src, __len, __ps); } -__fortify_function size_t -__NTH (wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src, +__fortify_function __attribute_overloadable__ size_t +__NTH (wcsrtombs (__fortify_clang_overload_arg (char *, __restrict, __dst), + const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps)) + __fortify_clang_warning_only_if_bos_lt (__len, __dst, + "wcsrtombs called with dst buffer " + "smaller than len") { return __glibc_fortify (wcsrtombs, __len, sizeof (char), __glibc_objsize (__dst), @@ -269,18 +332,26 @@ __NTH (wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src, #ifdef __USE_XOPEN2K8 -__fortify_function size_t -__NTH (mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, - size_t __nmc, size_t __len, mbstate_t *__restrict __ps)) +__fortify_function __attribute_overloadable__ size_t +__NTH (mbsnrtowcs (__fortify_clang_overload_arg (wchar_t *, __restrict, __dst), + const char **__restrict __src, size_t __nmc, size_t __len, + mbstate_t *__restrict __ps)) + __fortify_clang_warning_only_if_bos_lt (sizeof (wchar_t) * __len, __dst, + "mbsnrtowcs called with dst buffer " + "smaller than len * sizeof (wchar_t)") { return __glibc_fortify_n (mbsnrtowcs, __len, sizeof (wchar_t), __glibc_objsize (__dst), __dst, __src, __nmc, __len, __ps); } -__fortify_function size_t -__NTH (wcsnrtombs (char *__restrict __dst, const wchar_t **__restrict __src, - size_t __nwc, size_t __len, mbstate_t *__restrict __ps)) +__fortify_function __attribute_overloadable__ size_t +__NTH (wcsnrtombs (__fortify_clang_overload_arg (char *, __restrict, __dst), + const wchar_t **__restrict __src, size_t __nwc, + size_t __len, mbstate_t *__restrict __ps)) + __fortify_clang_warning_only_if_bos_lt (__len, __dst, + "wcsnrtombs called with dst buffer " + "smaller than len") { return __glibc_fortify (wcsnrtombs, __len, sizeof (char), __glibc_objsize (__dst), diff --git a/lib/libc/include/generic-glibc/bits/wordsize.h b/lib/libc/include/generic-glibc/bits/wordsize.h index d970b65edf78..b00ae750b7a5 100644 --- a/lib/libc/include/generic-glibc/bits/wordsize.h +++ b/lib/libc/include/generic-glibc/bits/wordsize.h @@ -19,11 +19,7 @@ #define __WORDSIZE _MIPS_SZPTR -#if _MIPS_SIM == _ABI64 -# define __WORDSIZE_TIME64_COMPAT32 1 -#else -# define __WORDSIZE_TIME64_COMPAT32 0 -#endif +#define __WORDSIZE_TIME64_COMPAT32 1 #if __WORDSIZE == 32 #define __WORDSIZE32_SIZE_ULONG 0 diff --git a/lib/libc/include/generic-glibc/elf.h b/lib/libc/include/generic-glibc/elf.h index 834416cc8b5a..fb3ee7779046 100644 --- a/lib/libc/include/generic-glibc/elf.h +++ b/lib/libc/include/generic-glibc/elf.h @@ -831,6 +831,10 @@ typedef struct control. */ #define NT_ARM_PAC_ENABLED_KEYS 0x40a /* AArch64 pointer authentication enabled keys. */ +#define NT_ARM_SSVE 0x40b /* ARM Streaming SVE registers. */ +#define NT_ARM_ZA 0x40c /* ARM SME ZA registers. */ +#define NT_ARM_ZT 0x40d /* ARM SME ZT registers. */ +#define NT_ARM_FPMR 0x40e /* ARM floating point mode register. */ #define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */ #define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */ #define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */ @@ -1234,6 +1238,10 @@ typedef struct #define AT_RSEQ_FEATURE_SIZE 27 /* rseq supported feature size. */ #define AT_RSEQ_ALIGN 28 /* rseq allocation alignment. */ +/* More machine-dependent hints about processor capabilities. */ +#define AT_HWCAP3 29 /* extension of AT_HWCAP. */ +#define AT_HWCAP4 30 /* extension of AT_HWCAP. */ + #define AT_EXECFN 31 /* Filename of executable. */ /* Pointer to the global system page used for system calls and other @@ -1333,9 +1341,13 @@ typedef struct #define NT_GNU_PROPERTY_TYPE_0 5 /* Packaging metadata as defined on - https://systemd.io/COREDUMP_PACKAGE_METADATA/ */ + https://systemd.io/ELF_PACKAGE_METADATA/ */ #define NT_FDO_PACKAGING_METADATA 0xcafe1a7e +/* dlopen metadata as defined on + https://systemd.io/ELF_DLOPEN_METADATA/ */ +#define NT_FDO_DLOPEN_METADATA 0x407c0c0a + /* Note section name of program property. */ #define NOTE_GNU_PROPERTY_SECTION_NAME ".note.gnu.property" @@ -4237,6 +4249,8 @@ enum #define R_LARCH_TLS_TPREL32 10 #define R_LARCH_TLS_TPREL64 11 #define R_LARCH_IRELATIVE 12 +#define R_LARCH_TLS_DESC32 13 +#define R_LARCH_TLS_DESC64 14 /* Reserved for future relocs that the dynamic linker must understand. */ @@ -4331,6 +4345,23 @@ enum #define R_LARCH_ADD_ULEB128 107 #define R_LARCH_SUB_ULEB128 108 #define R_LARCH_64_PCREL 109 +#define R_LARCH_CALL36 110 +#define R_LARCH_TLS_DESC_PC_HI20 111 +#define R_LARCH_TLS_DESC_PC_LO12 112 +#define R_LARCH_TLS_DESC64_PC_LO20 113 +#define R_LARCH_TLS_DESC64_PC_HI12 114 +#define R_LARCH_TLS_DESC_HI20 115 +#define R_LARCH_TLS_DESC_LO12 116 +#define R_LARCH_TLS_DESC64_LO20 117 +#define R_LARCH_TLS_DESC64_HI12 118 +#define R_LARCH_TLS_DESC_LD 119 +#define R_LARCH_TLS_DESC_CALL 120 +#define R_LARCH_TLS_LE_HI20_R 121 +#define R_LARCH_TLS_LE_ADD_R 122 +#define R_LARCH_TLS_LE_LO12_R 123 +#define R_LARCH_TLS_LD_PCREL20_S2 124 +#define R_LARCH_TLS_GD_PCREL20_S2 125 +#define R_LARCH_TLS_DESC_PCREL20_S2 126 /* ARC specific declarations. */ diff --git a/lib/libc/include/generic-glibc/fcntl.h b/lib/libc/include/generic-glibc/fcntl.h index 5f2a994c1bb2..847f82f1c3c3 100644 --- a/lib/libc/include/generic-glibc/fcntl.h +++ b/lib/libc/include/generic-glibc/fcntl.h @@ -177,7 +177,7 @@ typedef __pid_t pid_t; This function is a cancellation point and therefore not marked with __THROW. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS # ifndef __USE_FILE_OFFSET64 extern int fcntl (int __fd, int __cmd, ...); # else @@ -190,7 +190,7 @@ extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64); # ifdef __USE_LARGEFILE64 extern int fcntl64 (int __fd, int __cmd, ...); # endif -#else /* __USE_TIME_BITS64 */ +#else /* __USE_TIME64_REDIRECTS */ # ifdef __REDIRECT extern int __REDIRECT_NTH (fcntl, (int __fd, int __request, ...), __fcntl_time64); @@ -345,8 +345,7 @@ extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len); /* Define some inlines helping to catch common problems. */ -#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function \ - && defined __va_arg_pack_len +#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif diff --git a/lib/libc/include/generic-glibc/features-time64.h b/lib/libc/include/generic-glibc/features-time64.h index 20332bcc404e..fdfdf4a49382 100644 --- a/lib/libc/include/generic-glibc/features-time64.h +++ b/lib/libc/include/generic-glibc/features-time64.h @@ -24,9 +24,8 @@ # if _TIME_BITS == 64 # if ! defined (_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64 # error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64" -# elif __TIMESIZE == 32 -# define __USE_TIME_BITS64 1 # endif +# define __USE_TIME_BITS64 1 # elif _TIME_BITS == 32 # if __TIMESIZE > 32 # error "_TIME_BITS=32 is not compatible with __TIMESIZE > 32" @@ -34,4 +33,10 @@ # else # error Invalid _TIME_BITS value (can only be 32 or 64-bit) # endif +#elif __TIMESIZE == 64 +# define __USE_TIME_BITS64 1 +#endif + +#if defined __USE_TIME_BITS64 && __TIMESIZE == 32 +# define __USE_TIME64_REDIRECTS 1 #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/features.h b/lib/libc/include/generic-glibc/features.h index e0b3bdf5bfe5..36070684661d 100644 --- a/lib/libc/include/generic-glibc/features.h +++ b/lib/libc/include/generic-glibc/features.h @@ -24,7 +24,8 @@ __STRICT_ANSI__ ISO Standard C. _ISOC99_SOURCE Extensions to ISO C89 from ISO C99. _ISOC11_SOURCE Extensions to ISO C99 from ISO C11. - _ISOC2X_SOURCE Extensions to ISO C99 from ISO C2X. + _ISOC23_SOURCE Extensions to ISO C99 from ISO C23. + _ISOC2X_SOURCE Old name for _ISOC23_SOURCE. __STDC_WANT_LIB_EXT2__ Extensions to ISO C99 from TR 27431-2:2010. __STDC_WANT_IEC_60559_BFP_EXT__ @@ -34,7 +35,7 @@ __STDC_WANT_IEC_60559_TYPES_EXT__ Extensions to ISO C11 from TS 18661-3:2015. __STDC_WANT_IEC_60559_EXT__ - ISO C2X interfaces defined only in Annex F. + ISO C23 interfaces defined only in Annex F. _POSIX_SOURCE IEEE Std 1003.1. _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; @@ -148,10 +149,10 @@ #undef __USE_GNU #undef __USE_FORTIFY_LEVEL #undef __KERNEL_STRICT_NAMES -#undef __GLIBC_USE_ISOC2X +#undef __GLIBC_USE_ISOC23 #undef __GLIBC_USE_DEPRECATED_GETS #undef __GLIBC_USE_DEPRECATED_SCANF -#undef __GLIBC_USE_C2X_STRTOL +#undef __GLIBC_USE_C23_STRTOL /* Suppress kernel-name space pollution unless user expressedly asks for it. */ @@ -206,6 +207,13 @@ # define _DEFAULT_SOURCE 1 #endif +/* Remap the old name _ISOC2X_SOURCE to _ISOC23_SOURCE. */ +#ifdef _ISOC2X_SOURCE +# undef _ISOC2X_SOURCE +# undef _ISOC23_SOURCE +# define _ISOC23_SOURCE 1 +#endif + /* If _GNU_SOURCE was defined by the user, turn on all the other features. */ #ifdef _GNU_SOURCE # undef _ISOC95_SOURCE @@ -214,8 +222,8 @@ # define _ISOC99_SOURCE 1 # undef _ISOC11_SOURCE # define _ISOC11_SOURCE 1 -# undef _ISOC2X_SOURCE -# define _ISOC2X_SOURCE 1 +# undef _ISOC23_SOURCE +# define _ISOC23_SOURCE 1 # undef _POSIX_SOURCE # define _POSIX_SOURCE 1 # undef _POSIX_C_SOURCE @@ -244,37 +252,37 @@ #if (defined _DEFAULT_SOURCE \ || (!defined __STRICT_ANSI__ \ && !defined _ISOC99_SOURCE && !defined _ISOC11_SOURCE \ - && !defined _ISOC2X_SOURCE \ + && !defined _ISOC23_SOURCE \ && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE \ && !defined _XOPEN_SOURCE)) # undef _DEFAULT_SOURCE # define _DEFAULT_SOURCE 1 #endif -/* This is to enable the ISO C2X extension. */ -#if (defined _ISOC2X_SOURCE \ +/* This is to enable the ISO C23 extension. */ +#if (defined _ISOC23_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L)) -# define __GLIBC_USE_ISOC2X 1 +# define __GLIBC_USE_ISOC23 1 #else -# define __GLIBC_USE_ISOC2X 0 +# define __GLIBC_USE_ISOC23 0 #endif /* This is to enable the ISO C11 extension. */ -#if (defined _ISOC11_SOURCE || defined _ISOC2X_SOURCE \ +#if (defined _ISOC11_SOURCE || defined _ISOC23_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) # define __USE_ISOC11 1 #endif /* This is to enable the ISO C99 extension. */ #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ - || defined _ISOC2X_SOURCE \ + || defined _ISOC23_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) # define __USE_ISOC99 1 #endif /* This is to enable the ISO C90 Amendment 1:1995 extension. */ #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ - || defined _ISOC2X_SOURCE \ + || defined _ISOC23_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L)) # define __USE_ISOC95 1 #endif @@ -486,18 +494,18 @@ * glibc commit 64924422a99690d147a166b4de3103f3bf3eaf6c */ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2 -/* ISO C2X added support for a 0b or 0B prefix on binary constants as +/* ISO C23 added support for a 0b or 0B prefix on binary constants as inputs to strtol-family functions (base 0 or 2). This macro is used to condition redirection in headers to allow that redirection to be disabled when building those functions, despite _GNU_SOURCE being defined. */ -#if __GLIBC_USE (ISOC2X) -# define __GLIBC_USE_C2X_STRTOL 1 +#if __GLIBC_USE (ISOC23) +# define __GLIBC_USE_C23_STRTOL 1 #else -# define __GLIBC_USE_C2X_STRTOL 0 +# define __GLIBC_USE_C23_STRTOL 0 #endif #else /* glibc 2.37 or lower */ -# define __GLIBC_USE_C2X_STRTOL 0 +# define __GLIBC_USE_C23_STRTOL 0 #endif /* Get definitions of __STDC_* predefined macros, if the compiler has @@ -543,4 +551,4 @@ #include -#endif /* features.h */ +#endif /* features.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/fenv.h b/lib/libc/include/generic-glibc/fenv.h index cbcea517f4e6..fc96c604c9e8 100644 --- a/lib/libc/include/generic-glibc/fenv.h +++ b/lib/libc/include/generic-glibc/fenv.h @@ -77,7 +77,7 @@ extern int fegetexceptflag (fexcept_t *__flagp, int __excepts) __THROW; /* Raise the supported exceptions represented by EXCEPTS. */ extern int feraiseexcept (int __excepts) __THROW; -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Set the supported exception flags represented by EXCEPTS, without causing enabled traps to be taken. */ extern int fesetexcept (int __excepts) __THROW; @@ -91,7 +91,7 @@ extern int fesetexceptflag (const fexcept_t *__flagp, int __excepts) __THROW; currently set. */ extern int fetestexcept (int __excepts) __THROW; -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Determine which of subset of the exceptions specified by EXCEPTS are set in *FLAGP. */ extern int fetestexceptflag (const fexcept_t *__flagp, int __excepts) __THROW; @@ -130,7 +130,7 @@ extern int feupdateenv (const fenv_t *__envp) __THROW; /* Control modes. */ -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Store the current floating-point control modes in the object pointed to by MODEP. */ extern int fegetmode (femode_t *__modep) __THROW; @@ -143,7 +143,7 @@ extern int fesetmode (const femode_t *__modep) __THROW; /* NaN support. */ -#if (__GLIBC_USE (IEC_60559_BFP_EXT_C2X) \ +#if (__GLIBC_USE (IEC_60559_BFP_EXT_C23) \ && defined FE_INVALID \ && defined __SUPPORT_SNAN__) # define FE_SNANS_ALWAYS_SIGNAL 1 diff --git a/lib/libc/include/generic-glibc/fts.h b/lib/libc/include/generic-glibc/fts.h index 0cce8838a523..69990b7472bc 100644 --- a/lib/libc/include/generic-glibc/fts.h +++ b/lib/libc/include/generic-glibc/fts.h @@ -187,7 +187,7 @@ FTSENT *fts_read (FTS *); int fts_set (FTS *, FTSENT *, int) __THROW; #else # ifdef __REDIRECT -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS FTSENT *__REDIRECT (fts_children, (FTS *, int), fts64_children); int __REDIRECT (fts_close, (FTS *), fts64_close); FTS *__REDIRECT (fts_open, (char * const *, int, @@ -206,7 +206,7 @@ int __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int), __fts64_set_time64); # endif # else -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS # define fts_children fts64_children # define fts_close fts64_close # define fts_open fts64_open @@ -217,7 +217,7 @@ int __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int), # endif #endif #ifdef __USE_LARGEFILE64 -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS FTSENT64 *fts64_children (FTS64 *, int); int fts64_close (FTS64 *); FTS64 *fts64_open (char * const *, int, diff --git a/lib/libc/include/generic-glibc/ftw.h b/lib/libc/include/generic-glibc/ftw.h index ad6d0ece6ce2..041f43c39d33 100644 --- a/lib/libc/include/generic-glibc/ftw.h +++ b/lib/libc/include/generic-glibc/ftw.h @@ -137,7 +137,7 @@ extern int ftw (const char *__dir, __ftw_func_t __func, int __descriptors) __nonnull ((1, 2)); #else # ifdef __REDIRECT -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func, int __descriptors), ftw64) __nonnull ((1, 2)); # else @@ -146,7 +146,7 @@ extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func, __nonnull ((1, 2)); # endif # else -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS # define ftw ftw64 # else # define ftw __ftw64_time64 @@ -154,7 +154,7 @@ extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func, # endif #endif #ifdef __USE_LARGEFILE64 -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int ftw64 (const char *__dir, __ftw64_func_t __func, int __descriptors) __nonnull ((1, 2)); # else @@ -180,7 +180,7 @@ extern int nftw (const char *__dir, __nftw_func_t __func, int __descriptors, int __flag) __nonnull ((1, 2)); # else # ifdef __REDIRECT -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func, int __descriptors, int __flag), nftw64) __nonnull ((1, 2)); @@ -190,7 +190,7 @@ extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func, __nonnull ((1, 2)); # endif # else -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS # define nftw nftw64 # else # define nftw __nftw64_time64 @@ -198,7 +198,7 @@ extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func, # endif # endif # ifdef __USE_LARGEFILE64 -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int nftw64 (const char *__dir, __nftw64_func_t __func, int __descriptors, int __flag) __nonnull ((1, 2)); # else diff --git a/lib/libc/include/generic-glibc/glob.h b/lib/libc/include/generic-glibc/glob.h index 8a67ac9b3ce6..98bb1b36aba9 100644 --- a/lib/libc/include/generic-glibc/glob.h +++ b/lib/libc/include/generic-glibc/glob.h @@ -150,7 +150,7 @@ extern int glob (const char *__restrict __pattern, int __flags, /* Free storage allocated in PGLOB by a previous `glob' call. */ extern void globfree (glob_t *__pglob) __THROW; #else -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern, int __flags, int (*__errfunc) (const char *, int), @@ -170,7 +170,7 @@ extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64); #endif #ifdef __USE_LARGEFILE64 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS extern int __REDIRECT_NTHNL (glob64, (const char *__restrict __pattern, int __flags, int (*__errfunc) (const char *, int), 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 af615a3d9f90..77fbbc46100d 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-32.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-32.h @@ -3,7 +3,8 @@ # error "Never use directly; include instead." #endif -#define LD_SO "ld.so.1" +#define LD_LINUX_SO "ld-linux.so.2" +#define LD_SO "ld-linux.so.2" #define LIBANL_SO "libanl.so.1" #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" diff --git a/lib/libc/include/generic-glibc/inttypes.h b/lib/libc/include/generic-glibc/inttypes.h index 77992e0a09ae..8400784dbfbf 100644 --- a/lib/libc/include/generic-glibc/inttypes.h +++ b/lib/libc/include/generic-glibc/inttypes.h @@ -165,7 +165,7 @@ typedef wchar_t __gwchar_t; # define PRIXPTR __PRIPTR_PREFIX "X" /* Binary notation. */ -# if __GLIBC_USE (ISOC2X) +# if __GLIBC_USE (ISOC23) # define PRIb8 "b" # define PRIb16 "b" # define PRIb32 "b" @@ -303,7 +303,7 @@ typedef wchar_t __gwchar_t; /* Binary notation. */ -# if __GLIBC_USE (ISOC2X) +# if __GLIBC_USE (ISOC23) # define SCNb8 "hhb" # define SCNb16 "hb" # define SCNb32 "b" @@ -374,7 +374,7 @@ extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr, /* Versions of the above functions that handle '0b' and '0B' prefixes in base 0 or 2. */ -#if __GLIBC_USE (C2X_STRTOL) +#if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern intmax_t __REDIRECT_NTH (strtoimax, (const char *__restrict __nptr, char **__restrict __endptr, diff --git a/lib/libc/include/generic-glibc/limits.h b/lib/libc/include/generic-glibc/limits.h index 84e814e56804..1dce2d16604e 100644 --- a/lib/libc/include/generic-glibc/limits.h +++ b/lib/libc/include/generic-glibc/limits.h @@ -142,7 +142,7 @@ /* The integer width macros are not defined by GCC's before GCC 7, or if _GNU_SOURCE rather than __STDC_WANT_IEC_60559_BFP_EXT__ is used to enable this feature. */ -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) # ifndef CHAR_WIDTH # define CHAR_WIDTH 8 # endif @@ -179,9 +179,9 @@ #endif /* Use IEC_60559_BFP_EXT. */ /* The macros for _Bool are not defined by GCC's before GCC - 11, or if _GNU_SOURCE is defined rather than enabling C2x support + 11, or if _GNU_SOURCE is defined rather than enabling C23 support with -std. */ -#if __GLIBC_USE (ISOC2X) +#if __GLIBC_USE (ISOC23) # ifndef BOOL_MAX # define BOOL_MAX 1 # endif diff --git a/lib/libc/include/generic-glibc/math.h b/lib/libc/include/generic-glibc/math.h index 9c9b38521fd0..3e4772aee033 100644 --- a/lib/libc/include/generic-glibc/math.h +++ b/lib/libc/include/generic-glibc/math.h @@ -114,37 +114,37 @@ __BEGIN_DECLS #endif #if (__HAVE_FLOAT16 \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23))) # define SNANF16 (__builtin_nansf16 ("")) #endif #if (__HAVE_FLOAT32 \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23))) # define SNANF32 (__builtin_nansf32 ("")) #endif #if (__HAVE_FLOAT64 \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23))) # define SNANF64 (__builtin_nansf64 ("")) #endif #if (__HAVE_FLOAT128 \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23))) # define SNANF128 (__builtin_nansf128 ("")) #endif #if (__HAVE_FLOAT32X \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23))) # define SNANF32X (__builtin_nansf32x ("")) #endif #if (__HAVE_FLOAT64X \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23))) # define SNANF64X (__builtin_nansf64x ("")) #endif #if (__HAVE_FLOAT128X \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23))) # define SNANF128X (__builtin_nansf128x ("")) #endif @@ -214,7 +214,7 @@ typedef _Float128x double_t; # define FP_ILOGBNAN 2147483647 # endif #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) # if __WORDSIZE == 32 # define __FP_LONG_MAX 0x7fffffffL # else @@ -246,7 +246,7 @@ typedef _Float128x double_t; #include -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Rounding direction macros for fromfp functions. */ enum { @@ -558,7 +558,7 @@ extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), #define __MATHCALL_NARROW(func, redir, nargs) \ __MATHCALL_NARROW_NORMAL (func, nargs) -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) # define _Mret_ float # define _Marg_ double @@ -1051,7 +1051,7 @@ enum #endif /* Use ISO C99. */ -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) # include /* Return nonzero value if X is a signaling NaN. */ @@ -1332,7 +1332,7 @@ iszero (__T __val) # endif #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* An expression whose type has the widest of the evaluation formats of X and Y (which are of floating-point types). */ # if __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ > 64 diff --git a/lib/libc/include/generic-glibc/mqueue.h b/lib/libc/include/generic-glibc/mqueue.h index 373634f6f894..21bcb8be4e96 100644 --- a/lib/libc/include/generic-glibc/mqueue.h +++ b/lib/libc/include/generic-glibc/mqueue.h @@ -71,7 +71,7 @@ extern int mq_send (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, unsigned int __msg_prio) __nonnull ((2)); #ifdef __USE_XOPEN2K -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS /* Receive the oldest from highest priority messages in message queue MQDES, stop waiting if ABS_TIMEOUT expires. */ extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict __msg_ptr, @@ -110,8 +110,7 @@ extern int __REDIRECT (mq_timedsend, (mqd_t __mqdes, #endif /* Define some inlines helping to catch common problems. */ -#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function \ - && defined __va_arg_pack_len +#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include #endif diff --git a/lib/libc/include/generic-glibc/net/if_packet.h b/lib/libc/include/generic-glibc/net/if_packet.h index 8e1980166e33..43100828e68f 100644 --- a/lib/libc/include/generic-glibc/net/if_packet.h +++ b/lib/libc/include/generic-glibc/net/if_packet.h @@ -26,7 +26,7 @@ From Linux 2.1 the AF_PACKET interface is preferred and you should consider using it in place of this one. */ -struct sockaddr_pkt +struct __attribute_struct_may_alias__ sockaddr_pkt { __SOCKADDR_COMMON (spkt_); unsigned char spkt_device[14]; diff --git a/lib/libc/include/generic-glibc/netash/ash.h b/lib/libc/include/generic-glibc/netash/ash.h index 5dd1073047eb..fa72616bd3c6 100644 --- a/lib/libc/include/generic-glibc/netash/ash.h +++ b/lib/libc/include/generic-glibc/netash/ash.h @@ -22,7 +22,7 @@ #include #include -struct sockaddr_ash +struct __attribute_struct_may_alias__ sockaddr_ash { __SOCKADDR_COMMON (sash_); /* Common data: address family etc. */ int sash_ifindex; /* Interface to use. */ diff --git a/lib/libc/include/generic-glibc/netdb.h b/lib/libc/include/generic-glibc/netdb.h index acece975a60b..6adbab3955f5 100644 --- a/lib/libc/include/generic-glibc/netdb.h +++ b/lib/libc/include/generic-glibc/netdb.h @@ -701,7 +701,7 @@ extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr], extern int gai_suspend (const struct gaicb *const __list[], int __ent, const struct timespec *__timeout); -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # if defined(__REDIRECT) extern int __REDIRECT (gai_suspend, (const struct gaicb *const __list[], int __ent, diff --git a/lib/libc/include/generic-glibc/neteconet/ec.h b/lib/libc/include/generic-glibc/neteconet/ec.h index c6eab7ef3128..d61b4db27e06 100644 --- a/lib/libc/include/generic-glibc/neteconet/ec.h +++ b/lib/libc/include/generic-glibc/neteconet/ec.h @@ -28,7 +28,7 @@ struct ec_addr unsigned char net; /* Network number. */ }; -struct sockaddr_ec +struct __attribute_struct_may_alias__ sockaddr_ec { __SOCKADDR_COMMON (sec_); unsigned char port; /* Port number. */ diff --git a/lib/libc/include/generic-glibc/netinet/in.h b/lib/libc/include/generic-glibc/netinet/in.h index a5cf100abe61..c2eefea63a7a 100644 --- a/lib/libc/include/generic-glibc/netinet/in.h +++ b/lib/libc/include/generic-glibc/netinet/in.h @@ -244,7 +244,7 @@ extern const struct in6_addr in6addr_loopback; /* ::1 */ /* Structure describing an Internet socket address. */ -struct sockaddr_in +struct __attribute_struct_may_alias__ sockaddr_in { __SOCKADDR_COMMON (sin_); in_port_t sin_port; /* Port number. */ @@ -257,9 +257,11 @@ struct sockaddr_in - sizeof (struct in_addr)]; }; -#if !__USE_KERNEL_IPV6_DEFS +#if __USE_KERNEL_IPV6_DEFS +struct __attribute_struct_may_alias__ sockaddr_in6; +#else /* Ditto, for IPv6. */ -struct sockaddr_in6 +struct __attribute_struct_may_alias__ sockaddr_in6 { __SOCKADDR_COMMON (sin6_); in_port_t sin6_port; /* Transport layer port # */ diff --git a/lib/libc/include/generic-glibc/netiucv/iucv.h b/lib/libc/include/generic-glibc/netiucv/iucv.h index fceca5cec9cf..d7815a6feb0d 100644 --- a/lib/libc/include/generic-glibc/netiucv/iucv.h +++ b/lib/libc/include/generic-glibc/netiucv/iucv.h @@ -23,7 +23,7 @@ __BEGIN_DECLS -struct sockaddr_iucv +struct __attribute_struct_may_alias__ sockaddr_iucv { __SOCKADDR_COMMON (siucv_); unsigned short siucv_port; /* Reserved */ diff --git a/lib/libc/include/generic-glibc/pthread.h b/lib/libc/include/generic-glibc/pthread.h index 2d2faf0e9e69..c2603609383f 100644 --- a/lib/libc/include/generic-glibc/pthread.h +++ b/lib/libc/include/generic-glibc/pthread.h @@ -223,7 +223,7 @@ extern int pthread_join (pthread_t __th, void **__thread_return); the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */ extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW; -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS /* Make calling thread wait for termination of the thread TH, but only until TIMEOUT. The exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN is not NULL. @@ -796,7 +796,7 @@ extern int pthread_mutex_lock (pthread_mutex_t *__mutex) #ifdef __USE_XOPEN2K /* Wait until lock becomes available, or specified time passes. */ -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); @@ -813,7 +813,7 @@ extern int __REDIRECT_NTHNL (pthread_mutex_timedlock, #endif #ifdef __USE_GNU -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex, clockid_t __clockid, const struct timespec *__restrict @@ -982,7 +982,7 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) # ifdef __USE_XOPEN2K /* Try to acquire read lock for RWLOCK or return after specified time. */ -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); @@ -1000,7 +1000,7 @@ extern int __REDIRECT_NTHNL (pthread_rwlock_timedrdlock, # endif # ifdef __USE_GNU -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock, clockid_t __clockid, const struct timespec *__restrict @@ -1029,7 +1029,7 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) # ifdef __USE_XOPEN2K /* Try to acquire write lock for RWLOCK or return after specified time. */ -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); @@ -1047,7 +1047,7 @@ extern int __REDIRECT_NTHNL (pthread_rwlock_timedwrlock, # endif # ifdef __USE_GNU -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock, clockid_t __clockid, const struct timespec *__restrict @@ -1141,7 +1141,7 @@ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, This function is a cancellation point and therefore not marked with __THROW. */ -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, const struct timespec *__restrict __abstime) @@ -1167,7 +1167,7 @@ extern int __REDIRECT (pthread_cond_timedwait, This function is a cancellation point and therefore not marked with __THROW. */ -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, __clockid_t __clock_id, diff --git a/lib/libc/include/generic-glibc/resolv.h b/lib/libc/include/generic-glibc/resolv.h index 1969fb7f326e..b121af461207 100644 --- a/lib/libc/include/generic-glibc/resolv.h +++ b/lib/libc/include/generic-glibc/resolv.h @@ -335,4 +335,4 @@ void res_nclose (res_state) __THROW; __END_DECLS -#endif /* !_RESOLV_H_ */ +#endif /* !_RESOLV_H_ */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sched.h b/lib/libc/include/generic-glibc/sched.h index 299d86ec7320..266c7812799d 100644 --- a/lib/libc/include/generic-glibc/sched.h +++ b/lib/libc/include/generic-glibc/sched.h @@ -74,7 +74,7 @@ extern int sched_get_priority_max (int __algorithm) __THROW; extern int sched_get_priority_min (int __algorithm) __THROW; /* Get the SCHED_RR interval for the named process. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW; #else # ifdef __REDIRECT_NTH diff --git a/lib/libc/include/generic-glibc/semaphore.h b/lib/libc/include/generic-glibc/semaphore.h index f6ace43081e2..7e251a591ae7 100644 --- a/lib/libc/include/generic-glibc/semaphore.h +++ b/lib/libc/include/generic-glibc/semaphore.h @@ -59,7 +59,7 @@ extern int sem_wait (sem_t *__sem) __nonnull ((1)); This function is a cancellation point and therefore not marked with __THROW. */ -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int sem_timedwait (sem_t *__restrict __sem, const struct timespec *__restrict __abstime) __nonnull ((1, 2)); @@ -77,7 +77,7 @@ extern int __REDIRECT (sem_timedwait, #endif #ifdef __USE_GNU -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int sem_clockwait (sem_t *__restrict __sem, clockid_t clock, const struct timespec *__restrict __abstime) diff --git a/lib/libc/include/generic-glibc/signal.h b/lib/libc/include/generic-glibc/signal.h index 0a454d13fff1..9e4701113255 100644 --- a/lib/libc/include/generic-glibc/signal.h +++ b/lib/libc/include/generic-glibc/signal.h @@ -269,7 +269,7 @@ extern int sigwaitinfo (const sigset_t *__restrict __set, This function is a cancellation point and therefore not marked with __THROW. */ -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int sigtimedwait (const sigset_t *__restrict __set, siginfo_t *__restrict __info, const struct timespec *__restrict __timeout) diff --git a/lib/libc/include/generic-glibc/stdbit.h b/lib/libc/include/generic-glibc/stdbit.h index cd5f073a8bfa..f11b3a33caca 100644 --- a/lib/libc/include/generic-glibc/stdbit.h +++ b/lib/libc/include/generic-glibc/stdbit.h @@ -64,9 +64,13 @@ extern unsigned int stdc_leading_zeros_ul (unsigned long int __x) __extension__ extern unsigned int stdc_leading_zeros_ull (unsigned long long int __x) __THROW __attribute_const__; -#define stdc_leading_zeros(x) \ +#if __glibc_has_builtin (__builtin_stdc_leading_zeros) +# define stdc_leading_zeros(x) (__builtin_stdc_leading_zeros (x)) +#else +# define stdc_leading_zeros(x) \ (stdc_leading_zeros_ull (x) \ - (unsigned int) (8 * (sizeof (0ULL) - sizeof (x)))) +#endif #if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_clzll) static __always_inline unsigned int @@ -116,9 +120,13 @@ extern unsigned int stdc_leading_ones_ul (unsigned long int __x) __extension__ extern unsigned int stdc_leading_ones_ull (unsigned long long int __x) __THROW __attribute_const__; -#define stdc_leading_ones(x) \ +#if __glibc_has_builtin (__builtin_stdc_leading_ones) +# define stdc_leading_ones(x) (__builtin_stdc_leading_ones (x)) +#else +# define stdc_leading_ones(x) \ (stdc_leading_ones_ull ((unsigned long long int) (x) \ << 8 * (sizeof (0ULL) - sizeof (x)))) +#endif #if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_clzll) static __always_inline unsigned int @@ -168,11 +176,15 @@ extern unsigned int stdc_trailing_zeros_ul (unsigned long int __x) __extension__ extern unsigned int stdc_trailing_zeros_ull (unsigned long long int __x) __THROW __attribute_const__; -#define stdc_trailing_zeros(x) \ +#if __glibc_has_builtin (__builtin_stdc_trailing_zeros) +# define stdc_trailing_zeros(x) (__builtin_stdc_trailing_zeros (x)) +#else +# define stdc_trailing_zeros(x) \ (sizeof (x) == 8 ? stdc_trailing_zeros_ull (x) \ : sizeof (x) == 4 ? stdc_trailing_zeros_ui (x) \ : sizeof (x) == 2 ? stdc_trailing_zeros_us (__pacify_uint16 (x)) \ : stdc_trailing_zeros_uc (__pacify_uint8 (x))) +#endif #if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_ctzll) static __always_inline unsigned int @@ -222,7 +234,11 @@ extern unsigned int stdc_trailing_ones_ul (unsigned long int __x) __extension__ extern unsigned int stdc_trailing_ones_ull (unsigned long long int __x) __THROW __attribute_const__; -#define stdc_trailing_ones(x) (stdc_trailing_ones_ull (x)) +#if __glibc_has_builtin (__builtin_stdc_trailing_ones) +# define stdc_trailing_ones(x) (__builtin_stdc_trailing_ones (x)) +#else +# define stdc_trailing_ones(x) (stdc_trailing_ones_ull (x)) +#endif #if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_ctzll) static __always_inline unsigned int @@ -272,11 +288,15 @@ extern unsigned int stdc_first_leading_zero_ul (unsigned long int __x) __extension__ extern unsigned int stdc_first_leading_zero_ull (unsigned long long int __x) __THROW __attribute_const__; -#define stdc_first_leading_zero(x) \ +#if __glibc_has_builtin (__builtin_stdc_first_leading_zero) +# define stdc_first_leading_zero(x) (__builtin_stdc_first_leading_zero (x)) +#else +# define stdc_first_leading_zero(x) \ (sizeof (x) == 8 ? stdc_first_leading_zero_ull (x) \ : sizeof (x) == 4 ? stdc_first_leading_zero_ui (x) \ : sizeof (x) == 2 ? stdc_first_leading_zero_us (__pacify_uint16 (x)) \ : stdc_first_leading_zero_uc (__pacify_uint8 (x))) +#endif #if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_clzll) static __always_inline unsigned int @@ -326,11 +346,15 @@ extern unsigned int stdc_first_leading_one_ul (unsigned long int __x) __extension__ extern unsigned int stdc_first_leading_one_ull (unsigned long long int __x) __THROW __attribute_const__; -#define stdc_first_leading_one(x) \ +#if __glibc_has_builtin (__builtin_stdc_first_leading_one) +# define stdc_first_leading_one(x) (__builtin_stdc_first_leading_one (x)) +#else +# define stdc_first_leading_one(x) \ (sizeof (x) == 8 ? stdc_first_leading_one_ull (x) \ : sizeof (x) == 4 ? stdc_first_leading_one_ui (x) \ : sizeof (x) == 2 ? stdc_first_leading_one_us (__pacify_uint16 (x)) \ : stdc_first_leading_one_uc (__pacify_uint8 (x))) +#endif #if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_clzll) static __always_inline unsigned int @@ -380,11 +404,15 @@ extern unsigned int stdc_first_trailing_zero_ul (unsigned long int __x) __extension__ extern unsigned int stdc_first_trailing_zero_ull (unsigned long long int __x) __THROW __attribute_const__; -#define stdc_first_trailing_zero(x) \ +#if __glibc_has_builtin (__builtin_stdc_first_trailing_zero) +# define stdc_first_trailing_zero(x) (__builtin_stdc_first_trailing_zero (x)) +#else +# define stdc_first_trailing_zero(x) \ (sizeof (x) == 8 ? stdc_first_trailing_zero_ull (x) \ : sizeof (x) == 4 ? stdc_first_trailing_zero_ui (x) \ : sizeof (x) == 2 ? stdc_first_trailing_zero_us (__pacify_uint16 (x)) \ : stdc_first_trailing_zero_uc (__pacify_uint8 (x))) +#endif #if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_ctzll) static __always_inline unsigned int @@ -434,11 +462,15 @@ extern unsigned int stdc_first_trailing_one_ul (unsigned long int __x) __extension__ extern unsigned int stdc_first_trailing_one_ull (unsigned long long int __x) __THROW __attribute_const__; -#define stdc_first_trailing_one(x) \ +#if __glibc_has_builtin (__builtin_stdc_first_trailing_one) +# define stdc_first_trailing_one(x) (__builtin_stdc_first_trailing_one (x)) +#else +# define stdc_first_trailing_one(x) \ (sizeof (x) == 8 ? stdc_first_trailing_one_ull (x) \ : sizeof (x) == 4 ? stdc_first_trailing_one_ui (x) \ : sizeof (x) == 2 ? stdc_first_trailing_one_us (__pacify_uint16 (x)) \ : stdc_first_trailing_one_uc (__pacify_uint8 (x))) +#endif #if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_ctzll) static __always_inline unsigned int @@ -488,9 +520,13 @@ extern unsigned int stdc_count_zeros_ul (unsigned long int __x) __extension__ extern unsigned int stdc_count_zeros_ull (unsigned long long int __x) __THROW __attribute_const__; -#define stdc_count_zeros(x) \ +#if __glibc_has_builtin (__builtin_stdc_count_zeros) +# define stdc_count_zeros(x) (__builtin_stdc_count_zeros (x)) +#else +# define stdc_count_zeros(x) \ (stdc_count_zeros_ull (x) \ - (unsigned int) (8 * (sizeof (0ULL) - sizeof (x)))) +#endif #if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_popcountll) static __always_inline unsigned int @@ -540,7 +576,11 @@ extern unsigned int stdc_count_ones_ul (unsigned long int __x) __extension__ extern unsigned int stdc_count_ones_ull (unsigned long long int __x) __THROW __attribute_const__; -#define stdc_count_ones(x) (stdc_count_ones_ull (x)) +#if __glibc_has_builtin (__builtin_stdc_count_ones) +# define stdc_count_ones(x) (__builtin_stdc_count_ones (x)) +#else +# define stdc_count_ones(x) (stdc_count_ones_ull (x)) +#endif #if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_popcountll) static __always_inline unsigned int @@ -590,10 +630,14 @@ extern bool stdc_has_single_bit_ul (unsigned long int __x) __extension__ extern bool stdc_has_single_bit_ull (unsigned long long int __x) __THROW __attribute_const__; -#define stdc_has_single_bit(x) \ +#if __glibc_has_builtin (__builtin_stdc_has_single_bit) +# define stdc_has_single_bit(x) (__builtin_stdc_has_single_bit (x)) +#else +# define stdc_has_single_bit(x) \ ((bool) (sizeof (x) <= sizeof (unsigned int) \ ? stdc_has_single_bit_ui (x) \ : stdc_has_single_bit_ull (x))) +#endif static __always_inline bool __hsb64_inline (uint64_t __x) @@ -641,7 +685,11 @@ extern unsigned int stdc_bit_width_ul (unsigned long int __x) __extension__ extern unsigned int stdc_bit_width_ull (unsigned long long int __x) __THROW __attribute_const__; -#define stdc_bit_width(x) (stdc_bit_width_ull (x)) +#if __glibc_has_builtin (__builtin_stdc_bit_width) +# define stdc_bit_width(x) (__builtin_stdc_bit_width (x)) +#else +# define stdc_bit_width(x) (stdc_bit_width_ull (x)) +#endif #if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_clzll) static __always_inline unsigned int @@ -691,7 +739,11 @@ extern unsigned long int stdc_bit_floor_ul (unsigned long int __x) __extension__ extern unsigned long long int stdc_bit_floor_ull (unsigned long long int __x) __THROW __attribute_const__; -#define stdc_bit_floor(x) ((__typeof (x)) stdc_bit_floor_ull (x)) +#if __glibc_has_builtin (__builtin_stdc_bit_floor) +# define stdc_bit_floor(x) (__builtin_stdc_bit_floor (x)) +#else +# define stdc_bit_floor(x) ((__typeof (x)) stdc_bit_floor_ull (x)) +#endif #if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_clzll) static __always_inline uint64_t @@ -743,7 +795,11 @@ extern unsigned long int stdc_bit_ceil_ul (unsigned long int __x) __extension__ extern unsigned long long int stdc_bit_ceil_ull (unsigned long long int __x) __THROW __attribute_const__; -#define stdc_bit_ceil(x) ((__typeof (x)) stdc_bit_ceil_ull (x)) +#if __glibc_has_builtin (__builtin_stdc_bit_ceil) +# define stdc_bit_ceil(x) (__builtin_stdc_bit_ceil (x)) +#else +# define stdc_bit_ceil(x) ((__typeof (x)) stdc_bit_ceil_ull (x)) +#endif #if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_clzll) static __always_inline uint64_t diff --git a/lib/libc/include/generic-glibc/stdint.h b/lib/libc/include/generic-glibc/stdint.h index 51a9328ca124..5c2343fe5dd1 100644 --- a/lib/libc/include/generic-glibc/stdint.h +++ b/lib/libc/include/generic-glibc/stdint.h @@ -262,7 +262,7 @@ typedef __uintmax_t uintmax_t; # define UINTMAX_C(c) c ## ULL # endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) # define INT8_WIDTH 8 # define UINT8_WIDTH 8 diff --git a/lib/libc/include/generic-glibc/stdio.h b/lib/libc/include/generic-glibc/stdio.h index ad074c30c7cf..6ba5f7a9671c 100644 --- a/lib/libc/include/generic-glibc/stdio.h +++ b/lib/libc/include/generic-glibc/stdio.h @@ -139,7 +139,7 @@ typedef __fpos64_t fpos64_t; #define FOPEN_MAX 16 -#if __GLIBC_USE (ISOC2X) +#if __GLIBC_USE (ISOC23) /* Maximum length of printf output for a NaN. */ # define _PRINTF_NAN_LEN_MAX 4 #endif @@ -437,7 +437,7 @@ extern int sscanf (const char *__restrict __s, #include #if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT \ && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern int __REDIRECT (fscanf, (FILE *__restrict __stream, const char *__restrict __format, ...), @@ -505,7 +505,7 @@ extern int vsscanf (const char *__restrict __s, /* Same redirection as above for the v*scanf family. */ # if !__GLIBC_USE (DEPRECATED_SCANF) -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) # if defined __REDIRECT && !defined __LDBL_COMPAT \ && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 extern int __REDIRECT (vfscanf, @@ -685,12 +685,7 @@ extern char *fgets_unlocked (char *__restrict __s, int __n, (and null-terminate it). *LINEPTR is a pointer returned from malloc (or NULL), pointing to *N characters of space. It is realloc'd as necessary. Returns the number of characters read (not including the - null terminator), or -1 on error or EOF. - - These functions are not part of POSIX and therefore no official - cancellation point. But due to similarity with an POSIX interface - or due to the implementation they are cancellation points and - therefore not marked with __THROW. */ + null terminator), or -1 on error or EOF. */ extern __ssize_t __getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) __wur __nonnull ((4)); @@ -698,12 +693,7 @@ extern __ssize_t getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) __wur __nonnull ((4)); -/* Like `getdelim', but reads up to a newline. - - This function is not part of POSIX and therefore no official - cancellation point. But due to similarity with an POSIX interface - or due to the implementation it is a cancellation point and - therefore not marked with __THROW. */ +/* Like `getdelim', but reads up to a newline. */ extern __ssize_t getline (char **__restrict __lineptr, size_t *__restrict __n, FILE *__restrict __stream) __wur __nonnull ((3)); diff --git a/lib/libc/include/generic-glibc/stdlib.h b/lib/libc/include/generic-glibc/stdlib.h index 5a5252ae0eb4..a15de4be57bc 100644 --- a/lib/libc/include/generic-glibc/stdlib.h +++ b/lib/libc/include/generic-glibc/stdlib.h @@ -210,7 +210,7 @@ extern unsigned long long int strtoull (const char *__restrict __nptr, /* Versions of the above functions that handle '0b' and '0B' prefixes in base 0 or 2. */ -#if __GLIBC_USE (C2X_STRTOL) +#if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern long int __REDIRECT_NTH (strtol, (const char *__restrict __nptr, char **__restrict __endptr, @@ -274,7 +274,7 @@ extern unsigned long long int __isoc23_strtoull (const char *__restrict __nptr, #endif /* Convert a floating-point number to a string. */ -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) extern int strfromd (char *__dest, size_t __size, const char *__format, double __f) __THROW __nonnull ((3)); @@ -360,7 +360,7 @@ extern unsigned long long int strtoull_l (const char *__restrict __nptr, /* Versions of the above functions that handle '0b' and '0B' prefixes in base 0 or 2. */ -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern long int __REDIRECT_NTH (strtol_l, (const char *__restrict __nptr, char **__restrict __endptr, diff --git a/lib/libc/include/generic-glibc/string.h b/lib/libc/include/generic-glibc/string.h index 0dc39b2e347c..d3ab863069d0 100644 --- a/lib/libc/include/generic-glibc/string.h +++ b/lib/libc/include/generic-glibc/string.h @@ -50,7 +50,7 @@ extern void *memmove (void *__dest, const void *__src, size_t __n) /* Copy no more than N bytes of SRC to DEST, stopping when C is found. Return the position in DEST one byte past where C was copied, or NULL if C was not found in the first N bytes of SRC. */ -#if defined __USE_MISC || defined __USE_XOPEN || __GLIBC_USE (ISOC2X) +#if defined __USE_MISC || defined __USE_XOPEN || __GLIBC_USE (ISOC23) extern void *memccpy (void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) __THROW __nonnull ((1, 2)) __attr_access ((__write_only__, 1, 4)); @@ -182,7 +182,7 @@ extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, #endif #if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 \ - || __GLIBC_USE (LIB_EXT2) || __GLIBC_USE (ISOC2X)) + || __GLIBC_USE (LIB_EXT2) || __GLIBC_USE (ISOC23)) /* Duplicate S, returning an identical malloc'd string. */ extern char *strdup (const char *__s) __THROW __attribute_malloc__ __nonnull ((1)); @@ -191,7 +191,7 @@ extern char *strdup (const char *__s) /* Return a malloc'd copy of at most N bytes of STRING. The resultant string is terminated even if no null terminator appears before STRING[N]. */ -#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) || __GLIBC_USE (ISOC2X) +#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) || __GLIBC_USE (ISOC23) extern char *strndup (const char *__string, size_t __n) __THROW __attribute_malloc__ __nonnull ((1)); #endif diff --git a/lib/libc/include/generic-glibc/sys/cdefs.h b/lib/libc/include/generic-glibc/sys/cdefs.h index 63cae29ee47e..88c2d5adf51f 100644 --- a/lib/libc/include/generic-glibc/sys/cdefs.h +++ b/lib/libc/include/generic-glibc/sys/cdefs.h @@ -145,6 +145,14 @@ #endif +/* The overloadable attribute was added on clang 2.6. */ +#if defined __clang_major__ \ + && (__clang_major__ + (__clang_minor__ >= 6) > 2) +# define __attribute_overloadable__ __attribute__((__overloadable__)) +#else +# define __attribute_overloadable__ +#endif + /* Fortify support. */ #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) #define __bos0(ptr) __builtin_object_size (ptr, 0) @@ -187,27 +195,173 @@ __s, __osz)) \ && !__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), __s, __osz)) +/* To correctly instrument the fortify wrapper clang requires the + pass_object_size attribute, and the attribute has the restriction that the + argument needs to be 'const'. Furthermore, to make it usable with C + interfaces, clang provides the overload attribute, which provides a C++ + like function overload support. The overloaded fortify wrapper with the + pass_object_size attribute has precedence over the default symbol. + + Also, clang does not support __va_arg_pack, so variadic functions are + expanded to issue va_arg implementations. The error function must not have + bodies (address takes are expanded to nonfortified calls), and with + __fortify_function compiler might still create a body with the C++ + mangling name (due to the overload attribute). In this case, the function + is defined with __fortify_function_error_function macro instead. + + The argument size check is also done with a clang-only attribute, + __attribute__ ((__diagnose_if__ (...))), different than gcc which calls + symbol_chk_warn alias with uses __warnattr attribute. + + The pass_object_size was added on clang 4.0, __diagnose_if__ on 5.0, + and pass_dynamic_object_size on 9.0. */ +#if defined __clang_major__ && __clang_major__ >= 5 +# define __fortify_use_clang 1 + +# define __fortify_function_error_function static __attribute__((__unused__)) + +# define __fortify_clang_pass_object_size_n(n) \ + __attribute__ ((__pass_object_size__ (n))) +# define __fortify_clang_pass_object_size0 \ + __fortify_clang_pass_object_size_n (0) +# define __fortify_clang_pass_object_size \ + __fortify_clang_pass_object_size_n (__USE_FORTIFY_LEVEL > 1) + +# if __clang_major__ >= 9 +# define __fortify_clang_pass_dynamic_object_size_n(n) \ + __attribute__ ((__pass_dynamic_object_size__ (n))) +# define __fortify_clang_pass_dynamic_object_size0 \ + __fortify_clang_pass_dynamic_object_size_n (0) +# define __fortify_clang_pass_dynamic_object_size \ + __fortify_clang_pass_dynamic_object_size_n (1) +# else +# define __fortify_clang_pass_dynamic_object_size_n(n) +# define __fortify_clang_pass_dynamic_object_size0 +# define __fortify_clang_pass_dynamic_object_size +# endif + +# define __fortify_clang_bos_static_lt_impl(bos_val, n, s) \ + ((bos_val) != -1ULL && (n) > (bos_val) / (s)) +# define __fortify_clang_bos_static_lt2(__n, __e, __s) \ + __fortify_clang_bos_static_lt_impl (__bos (__e), __n, __s) +# define __fortify_clang_bos_static_lt(__n, __e) \ + __fortify_clang_bos_static_lt2 (__n, __e, 1) +# define __fortify_clang_bos0_static_lt2(__n, __e, __s) \ + __fortify_clang_bos_static_lt_impl (__bos0 (__e), __n, __s) +# define __fortify_clang_bos0_static_lt(__n, __e) \ + __fortify_clang_bos0_static_lt2 (__n, __e, 1) + +# define __fortify_clang_bosn_args(bos_fn, n, buf, div, complaint) \ + (__fortify_clang_bos_static_lt_impl (bos_fn (buf), n, div)), (complaint), \ + "warning" + +# define __fortify_clang_warning(__c, __msg) \ + __attribute__ ((__diagnose_if__ ((__c), (__msg), "warning"))) +# define __fortify_clang_error(__c, __msg) \ + __attribute__ ((__diagnose_if__ ((__c), (__msg), "error"))) +# define __fortify_clang_warning_only_if_bos0_lt(n, buf, complaint) \ + __attribute__ ((__diagnose_if__ \ + (__fortify_clang_bosn_args (__bos0, n, buf, 1, complaint)))) +# define __fortify_clang_warning_only_if_bos0_lt2(n, buf, div, complaint) \ + __attribute__ ((__diagnose_if__ \ + (__fortify_clang_bosn_args (__bos0, n, buf, div, complaint)))) +# define __fortify_clang_warning_only_if_bos_lt(n, buf, complaint) \ + __attribute__ ((__diagnose_if__ \ + (__fortify_clang_bosn_args (__bos, n, buf, 1, complaint)))) +# define __fortify_clang_warning_only_if_bos_lt2(n, buf, div, complaint) \ + __attribute__ ((__diagnose_if__ \ + (__fortify_clang_bosn_args (__bos, n, buf, div, complaint)))) + +# define __fortify_clang_prefer_this_overload \ + __attribute__ ((enable_if (1, ""))) +# define __fortify_clang_unavailable(__msg) \ + __attribute__ ((unavailable(__msg))) + +# if __USE_FORTIFY_LEVEL == 3 +# define __fortify_clang_overload_arg(__type, __attr, __name) \ + __type __attr const __fortify_clang_pass_dynamic_object_size __name +# define __fortify_clang_overload_arg0(__type, __attr, __name) \ + __type __attr const __fortify_clang_pass_dynamic_object_size0 __name +# else +# define __fortify_clang_overload_arg(__type, __attr, __name) \ + __type __attr const __fortify_clang_pass_object_size __name +# define __fortify_clang_overload_arg0(__type, __attr, __name) \ + __type __attr const __fortify_clang_pass_object_size0 __name +# endif + +# define __fortify_clang_mul_may_overflow(size, n) \ + ((size | n) >= (((size_t)1) << (8 * sizeof (size_t) / 2))) + +# define __fortify_clang_size_too_small(__bos, __dest, __len) \ + (__bos (__dest) != (size_t) -1 && __bos (__dest) < __len) +# define __fortify_clang_warn_if_src_too_large(__dest, __src) \ + __fortify_clang_warning (__fortify_clang_size_too_small (__glibc_objsize, \ + __dest, \ + __builtin_strlen (__src) + 1), \ + "destination buffer will always be overflown by source") +# define __fortify_clang_warn_if_dest_too_small(__dest, __len) \ + __fortify_clang_warning (__fortify_clang_size_too_small (__glibc_objsize, \ + __dest, \ + __len), \ + "function called with bigger length than the destination buffer") +# define __fortify_clang_warn_if_dest_too_small0(__dest, __len) \ + __fortify_clang_warning (__fortify_clang_size_too_small (__glibc_objsize0, \ + __dest, \ + __len), \ + "function called with bigger length than the destination buffer") +#else +# define __fortify_use_clang 0 +# define __fortify_clang_warning(__c, __msg) +# define __fortify_clang_warning_only_if_bos0_lt(__n, __buf, __complaint) +# define __fortify_clang_warning_only_if_bos0_lt2(__n, __buf, __div, complaint) +# define __fortify_clang_warning_only_if_bos_lt(__n, __buf, __complaint) +# define __fortify_clang_warning_only_if_bos_lt2(__n, __buf, div, __complaint) +# define __fortify_clang_overload_arg(__type, __attr, __name) \ + __type __attr __name +# define __fortify_clang_overload_arg0(__type, __attr, __name) \ + __fortify_clang_overload_arg (__type, __attr, __name) +# define __fortify_clang_warn_if_src_too_large(__dest, __src) +# define __fortify_clang_warn_if_dest_too_small(__dest, __len) +# define __fortify_clang_warn_if_dest_too_small0(__dest, __len) +#endif + + /* Fortify function f. __f_alias, __f_chk and __f_chk_warn must be declared. */ -#define __glibc_fortify(f, __l, __s, __osz, ...) \ +#if !__fortify_use_clang +# define __glibc_fortify(f, __l, __s, __osz, ...) \ (__glibc_safe_or_unknown_len (__l, __s, __osz) \ ? __ ## f ## _alias (__VA_ARGS__) \ : (__glibc_unsafe_len (__l, __s, __osz) \ ? __ ## f ## _chk_warn (__VA_ARGS__, __osz) \ : __ ## f ## _chk (__VA_ARGS__, __osz))) +#else +# define __glibc_fortify(f, __l, __s, __osz, ...) \ + (__osz == (__SIZE_TYPE__) -1) \ + ? __ ## f ## _alias (__VA_ARGS__) \ + : __ ## f ## _chk (__VA_ARGS__, __osz) +#endif /* Fortify function f, where object size argument passed to f is the number of elements and not total size. */ -#define __glibc_fortify_n(f, __l, __s, __osz, ...) \ +#if !__fortify_use_clang +# define __glibc_fortify_n(f, __l, __s, __osz, ...) \ (__glibc_safe_or_unknown_len (__l, __s, __osz) \ ? __ ## f ## _alias (__VA_ARGS__) \ : (__glibc_unsafe_len (__l, __s, __osz) \ ? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \ : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) +# else +# define __glibc_fortify_n(f, __l, __s, __osz, ...) \ + (__osz == (__SIZE_TYPE__) -1) \ + ? __ ## f ## _alias (__VA_ARGS__) \ + : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)) #endif +#endif /* __USE_FORTIFY_LEVEL > 0 */ + #if __GNUC_PREREQ (4,3) # define __warnattr(msg) __attribute__((__warning__ (msg))) # define __errordecl(name, msg) \ @@ -683,10 +837,10 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf # define __attr_access(x) __attribute__ ((__access__ x)) /* For _FORTIFY_SOURCE == 3 we use __builtin_dynamic_object_size, which may use the access attribute to get object sizes from function definition - arguments, so we can't use them on functions we fortify. Drop the object - size hints for such functions. */ + arguments, so we can't use them on functions we fortify. Drop the access + attribute for such functions. */ # if __USE_FORTIFY_LEVEL == 3 -# define __fortified_attr_access(a, o, s) __attribute__ ((__access__ (a, o))) +# define __fortified_attr_access(a, o, s) # else # define __fortified_attr_access(a, o, s) __attr_access ((a, o, s)) # endif @@ -720,4 +874,13 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf # define __attribute_returns_twice__ /* Ignore. */ #endif +/* Mark struct types as aliasable. Restricted to compilers that + support forward declarations of structs in the presence of the + attribute. */ +#if __GNUC_PREREQ (7, 1) || defined __clang__ +# define __attribute_struct_may_alias__ __attribute__ ((__may_alias__)) +#else +# define __attribute_struct_may_alias__ +#endif + #endif /* sys/cdefs.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/epoll.h b/lib/libc/include/generic-glibc/sys/epoll.h index bae8290a8a34..18b6b21fb853 100644 --- a/lib/libc/include/generic-glibc/sys/epoll.h +++ b/lib/libc/include/generic-glibc/sys/epoll.h @@ -19,6 +19,7 @@ #define _SYS_EPOLL_H 1 #include +#include #include #include @@ -87,6 +88,19 @@ struct epoll_event epoll_data_t data; /* User data variable */ } __EPOLL_PACKED; +struct epoll_params +{ + uint32_t busy_poll_usecs; + uint16_t busy_poll_budget; + uint8_t prefer_busy_poll; + + /* pad the struct to a multiple of 64bits */ + uint8_t __pad; +}; + +#define EPOLL_IOC_TYPE 0x8A +#define EPIOCSPARAMS _IOW(EPOLL_IOC_TYPE, 0x01, struct epoll_params) +#define EPIOCGPARAMS _IOR(EPOLL_IOC_TYPE, 0x02, struct epoll_params) __BEGIN_DECLS @@ -140,7 +154,7 @@ extern int epoll_pwait (int __epfd, struct epoll_event *__events, This function is a cancellation point and therefore not marked with __THROW. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int epoll_pwait2 (int __epfd, struct epoll_event *__events, int __maxevents, const struct timespec *__timeout, const __sigset_t *__ss) diff --git a/lib/libc/include/generic-glibc/sys/hwprobe.h b/lib/libc/include/generic-glibc/sys/hwprobe.h new file mode 100644 index 000000000000..314f11bc9db4 --- /dev/null +++ b/lib/libc/include/generic-glibc/sys/hwprobe.h @@ -0,0 +1,113 @@ +/* RISC-V architecture probe interface + Copyright (C) 2024 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_HWPROBE_H +#define _SYS_HWPROBE_H 1 + +#include +#include +#include +#ifdef __has_include +# if __has_include () +# include +# endif +#endif + +/* Define a (probably stale) version of the interface if the Linux headers + aren't present. */ +#ifndef RISCV_HWPROBE_KEY_MVENDORID +struct riscv_hwprobe { + signed long long int key; + unsigned long long int value; +}; + +#define RISCV_HWPROBE_KEY_MVENDORID 0 +#define RISCV_HWPROBE_KEY_MARCHID 1 +#define RISCV_HWPROBE_KEY_MIMPID 2 +#define RISCV_HWPROBE_KEY_BASE_BEHAVIOR 3 +#define RISCV_HWPROBE_BASE_BEHAVIOR_IMA (1 << 0) +#define RISCV_HWPROBE_KEY_IMA_EXT_0 4 +#define RISCV_HWPROBE_IMA_FD (1 << 0) +#define RISCV_HWPROBE_IMA_C (1 << 1) +#define RISCV_HWPROBE_IMA_V (1 << 2) +#define RISCV_HWPROBE_EXT_ZBA (1 << 3) +#define RISCV_HWPROBE_EXT_ZBB (1 << 4) +#define RISCV_HWPROBE_EXT_ZBS (1 << 5) +#define RISCV_HWPROBE_EXT_ZICBOZ (1 << 6) +#define RISCV_HWPROBE_KEY_CPUPERF_0 5 +#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0) +#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0) +#define RISCV_HWPROBE_MISALIGNED_SLOW (2 << 0) +#define RISCV_HWPROBE_MISALIGNED_FAST (3 << 0) +#define RISCV_HWPROBE_MISALIGNED_UNSUPPORTED (4 << 0) +#define RISCV_HWPROBE_MISALIGNED_MASK (7 << 0) +#define RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE 6 + +#endif /* RISCV_HWPROBE_KEY_MVENDORID */ + +__BEGIN_DECLS + +extern int __riscv_hwprobe (struct riscv_hwprobe *__pairs, size_t __pair_count, + size_t __cpu_count, unsigned long int *__cpus, + unsigned int __flags) + __nonnull ((1)) __wur + __fortified_attr_access (__read_write__, 1, 2) + __fortified_attr_access (__read_only__, 4, 3); + +/* A pointer to the __riscv_hwprobe vDSO function is passed as the second + argument to ifunc selector routines. Include a function pointer type for + convenience in calling the function in those settings. */ +typedef int (*__riscv_hwprobe_t) (struct riscv_hwprobe *__pairs, size_t __pair_count, + size_t __cpu_count, unsigned long int *__cpus, + unsigned int __flags) + __nonnull ((1)) __wur + __fortified_attr_access (__read_write__, 1, 2) + __fortified_attr_access (__read_only__, 4, 3); + +/* Helper function usable from ifunc selectors that probes a single key. */ +static __inline int +__riscv_hwprobe_one(__riscv_hwprobe_t hwprobe_func, + long long int key, + unsigned long long int *value) +{ + struct riscv_hwprobe pair; + int rc; + + /* Earlier versions of glibc pass NULL as the second ifunc parameter. Other C + libraries on non-Linux systems may pass +1 as this function pointer to + indicate no support. Users copying this function to exotic worlds + (non-Linux non-glibc) may want to do additional validity checks here. */ + if (hwprobe_func == NULL) + return ENOSYS; + + pair.key = key; + rc = hwprobe_func (&pair, 1, 0, NULL, 0); + if (rc != 0) + return rc; + + if (pair.key < 0) + return ENOENT; + + *value = pair.value; + return 0; +} + +__END_DECLS + +#endif /* sys/hwprobe.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/ioctl.h b/lib/libc/include/generic-glibc/sys/ioctl.h index 26faa524b621..564e6b16503c 100644 --- a/lib/libc/include/generic-glibc/sys/ioctl.h +++ b/lib/libc/include/generic-glibc/sys/ioctl.h @@ -38,7 +38,7 @@ __BEGIN_DECLS /* Perform the I/O control operation specified by REQUEST on FD. One argument may follow; its presence and type depend on REQUEST. Return value depends on REQUEST. Usually -1 indicates error. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int ioctl (int __fd, unsigned long int __request, ...) __THROW; #else # ifdef __REDIRECT diff --git a/lib/libc/include/generic-glibc/sys/msg.h b/lib/libc/include/generic-glibc/sys/msg.h index 48361b24b713..67ebed3bd3fe 100644 --- a/lib/libc/include/generic-glibc/sys/msg.h +++ b/lib/libc/include/generic-glibc/sys/msg.h @@ -58,7 +58,7 @@ struct msgbuf __BEGIN_DECLS /* Message queue control operation. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW; #else # ifdef __REDIRECT_NTH diff --git a/lib/libc/include/generic-glibc/sys/pidfd.h b/lib/libc/include/generic-glibc/sys/pidfd.h index c70dfe5044cc..addf5eec7ca8 100644 --- a/lib/libc/include/generic-glibc/sys/pidfd.h +++ b/lib/libc/include/generic-glibc/sys/pidfd.h @@ -22,12 +22,14 @@ #include #define PIDFD_NONBLOCK O_NONBLOCK +#define PIDFD_THREAD O_EXCL -/* Returns a file descriptor that refers to the process PID. The - close-on-exec is set on the file descriptor. +#define PIDFD_SIGNAL_THREAD (1UL << 0) +#define PIDFD_SIGNAL_THREAD_GROUP (1UL << 1) +#define PIDFD_SIGNAL_PROCESS_GROUP (1UL << 2) - The FLAGS argument is reserved for future use, it must be specified - as 0. */ +/* Returns a file descriptor that refers to the process PID. The + close-on-exec is set on the file descriptor. */ extern int pidfd_open (__pid_t __pid, unsigned int __flags) __THROW; /* Duplicates an existing file descriptor TARGETFD in the process referred @@ -39,10 +41,7 @@ extern int pidfd_getfd (int __pidfd, int __targetfd, unsigned int __flags) __THROW; /* Sends the signal SIG to the target process referred by the PIDFD. If - INFO points to a siginfo_t buffer, it will be populated. - - The FLAGS argument is reserved for future use, it must be specified - as 0. */ + INFO points to a siginfo_t buffer, it will be populated. */ extern int pidfd_send_signal (int __pidfd, int __sig, siginfo_t *__info, unsigned int __flags) __THROW; diff --git a/lib/libc/include/generic-glibc/sys/poll.h b/lib/libc/include/generic-glibc/sys/poll.h index 31103eb0d4d8..b1fcc82d3bb5 100644 --- a/lib/libc/include/generic-glibc/sys/poll.h +++ b/lib/libc/include/generic-glibc/sys/poll.h @@ -66,7 +66,7 @@ extern int ppoll (struct pollfd *__fds, nfds_t __nfds, const __sigset_t *__ss) __fortified_attr_access (__write_only__, 1, 2); -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # ifdef __REDIRECT extern int __REDIRECT (ppoll, (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout, diff --git a/lib/libc/include/generic-glibc/sys/prctl.h b/lib/libc/include/generic-glibc/sys/prctl.h index db18187ff75e..fdf032d31517 100644 --- a/lib/libc/include/generic-glibc/sys/prctl.h +++ b/lib/libc/include/generic-glibc/sys/prctl.h @@ -38,7 +38,7 @@ __BEGIN_DECLS /* Control process execution. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int prctl (int __option, ...) __THROW; #else # ifdef __REDIRECT diff --git a/lib/libc/include/generic-glibc/sys/resource.h b/lib/libc/include/generic-glibc/sys/resource.h index e622c410d438..ffbcf5d768c3 100644 --- a/lib/libc/include/generic-glibc/sys/resource.h +++ b/lib/libc/include/generic-glibc/sys/resource.h @@ -88,7 +88,7 @@ extern int setrlimit64 (__rlimit_resource_t __resource, and put it in *USAGE. Returns 0 for success, -1 for failure. */ extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW; -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # if defined(__REDIRECT_NTH) extern int __REDIRECT_NTH (getrusage, (__rusage_who_t __who, struct rusage *__usage), diff --git a/lib/libc/include/generic-glibc/sys/select.h b/lib/libc/include/generic-glibc/sys/select.h index 4e538059745c..dc7da6c307b6 100644 --- a/lib/libc/include/generic-glibc/sys/select.h +++ b/lib/libc/include/generic-glibc/sys/select.h @@ -98,7 +98,7 @@ __BEGIN_DECLS This function is a cancellation point and therefore not marked with __THROW. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, @@ -123,7 +123,7 @@ extern int __REDIRECT (select, This function is a cancellation point and therefore not marked with __THROW. */ -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int pselect (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, diff --git a/lib/libc/include/generic-glibc/sys/sem.h b/lib/libc/include/generic-glibc/sys/sem.h index f2d76469f6ce..f85ca85a4e1e 100644 --- a/lib/libc/include/generic-glibc/sys/sem.h +++ b/lib/libc/include/generic-glibc/sys/sem.h @@ -48,7 +48,7 @@ struct sembuf __BEGIN_DECLS /* Semaphore control operation. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int semctl (int __semid, int __semnum, int __cmd, ...) __THROW; #else # ifdef __REDIRECT_NTH @@ -68,7 +68,7 @@ extern int semop (int __semid, struct sembuf *__sops, size_t __nsops) __THROW; #ifdef __USE_GNU /* Operate on semaphore with timeout. */ -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int semtimedop (int __semid, struct sembuf *__sops, size_t __nsops, const struct timespec *__timeout) __THROW; # else diff --git a/lib/libc/include/generic-glibc/sys/shm.h b/lib/libc/include/generic-glibc/sys/shm.h index 7de7c5554562..d59a9b955dce 100644 --- a/lib/libc/include/generic-glibc/sys/shm.h +++ b/lib/libc/include/generic-glibc/sys/shm.h @@ -46,7 +46,7 @@ __BEGIN_DECLS facility. The definition is found in XPG4.2. */ /* Shared memory control operation. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW; #else # ifdef __REDIRECT_NTH diff --git a/lib/libc/include/generic-glibc/sys/socket.h b/lib/libc/include/generic-glibc/sys/socket.h index a57bd7b2c0e0..9d1e65298595 100644 --- a/lib/libc/include/generic-glibc/sys/socket.h +++ b/lib/libc/include/generic-glibc/sys/socket.h @@ -170,7 +170,7 @@ extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n, This function is a cancellation point and therefore not marked with __THROW. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern ssize_t sendmsg (int __fd, const struct msghdr *__message, int __flags); #else @@ -191,7 +191,7 @@ extern ssize_t __sendmsg64 (int __fd, const struct msghdr *__message, This function is a cancellation point and therefore not marked with __THROW. */ -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int sendmmsg (int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags); # else @@ -204,7 +204,7 @@ extern int __sendmmsg64 (int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags); # define sendmmsg __sendmmsg64 # endif -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ #endif /* __USE_GNU */ /* Receive a message as described by MESSAGE from socket FD. @@ -212,7 +212,7 @@ extern int __sendmmsg64 (int __fd, struct mmsghdr *__vmessages, This function is a cancellation point and therefore not marked with __THROW. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags); #else # ifdef __REDIRECT @@ -231,7 +231,7 @@ extern ssize_t __recvmsg64 (int __fd, struct msghdr *__message, int __flags); This function is a cancellation point and therefore not marked with __THROW. */ -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int recvmmsg (int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags, struct timespec *__tmo); @@ -251,7 +251,7 @@ extern int __REDIRECT (recvmmsg, (int __fd, struct mmsghdr *__vmessages, /* Put the current value for socket FD's option OPTNAME at protocol level LEVEL into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's actual length. Returns 0 on success, -1 for errors. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int getsockopt (int __fd, int __level, int __optname, void *__restrict __optval, socklen_t *__restrict __optlen) __THROW; @@ -273,7 +273,7 @@ extern int __getsockopt64 (int __fd, int __level, int __optname, /* Set socket FD's option OPTNAME at protocol level LEVEL to *OPTVAL (which is OPTLEN bytes long). Returns 0 on success, -1 for errors. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int setsockopt (int __fd, int __level, int __optname, const void *__optval, socklen_t __optlen) __THROW; #else diff --git a/lib/libc/include/generic-glibc/sys/stat.h b/lib/libc/include/generic-glibc/sys/stat.h index bc4671341ad8..1d4acf42ba9f 100644 --- a/lib/libc/include/generic-glibc/sys/stat.h +++ b/lib/libc/include/generic-glibc/sys/stat.h @@ -209,7 +209,7 @@ extern int stat (const char *__restrict __file, that file descriptor FD is open on and put them in BUF. */ extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2)); #else -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (stat, (const char *__restrict __file, struct stat *__restrict __buf), @@ -236,7 +236,7 @@ extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64) # endif #endif #ifdef __USE_LARGEFILE64 -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int stat64 (const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2)); @@ -265,7 +265,7 @@ extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __THROW __nonnull ((2, 3)); # else -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, struct stat *__restrict __buf, @@ -287,7 +287,7 @@ extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, # endif # ifdef __USE_LARGEFILE64 -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int fstatat64 (int __fd, const char *__restrict __file, struct stat64 *__restrict __buf, int __flag) __THROW __nonnull ((2, 3)); @@ -313,7 +313,7 @@ extern int __REDIRECT_NTH (fstatat64, (int __fd, extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __THROW __nonnull ((1, 2)); # else -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (lstat, (const char *__restrict __file, @@ -334,7 +334,7 @@ extern int __REDIRECT_NTH (lstat, # endif # endif # ifdef __USE_LARGEFILE64 -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int lstat64 (const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); @@ -427,7 +427,7 @@ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode) #endif #ifdef __USE_ATFILE -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS /* Set file access and modification times relative to directory file descriptor. */ extern int utimensat (int __fd, const char *__path, @@ -447,7 +447,7 @@ extern int __REDIRECT_NTH (utimensat, (int fd, const char *__path, #endif #ifdef __USE_XOPEN2K8 -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS /* Set file access and modification times of the file associated with FD. */ extern int futimens (int __fd, const struct timespec __times[2]) __THROW; diff --git a/lib/libc/include/generic-glibc/sys/time.h b/lib/libc/include/generic-glibc/sys/time.h index f526bfcb0518..dbbe33b91e60 100644 --- a/lib/libc/include/generic-glibc/sys/time.h +++ b/lib/libc/include/generic-glibc/sys/time.h @@ -63,7 +63,7 @@ struct timezone use localtime etc. instead. This function itself is semi-obsolete; most callers should use time or clock_gettime instead. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int gettimeofday (struct timeval *__restrict __tv, void *__restrict __tz) __THROW __nonnull ((1)); #else @@ -77,7 +77,7 @@ extern int __REDIRECT_NTH (gettimeofday, (struct timeval *__restrict __tv, #endif #ifdef __USE_MISC -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS /* Set the current time of day and timezone information. This call is restricted to the super-user. Setting the timezone in this way is obsolete, but we don't yet @@ -143,7 +143,7 @@ typedef enum __itimer_which __itimer_which_t; typedef int __itimer_which_t; #endif -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS /* Set *VALUE to the current setting of timer WHICH. Return 0 on success, -1 on errors. */ extern int getitimer (__itimer_which_t __which, @@ -184,7 +184,7 @@ extern int __REDIRECT_NTH (utimes, (const char *__file, #endif #ifdef __USE_MISC -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS /* Same as `utimes', but does not follow symbolic links. */ extern int lutimes (const char *__file, const struct timeval __tvp[2]) __THROW __nonnull ((1)); @@ -207,7 +207,7 @@ extern int __REDIRECT_NTH (futimes, (int __fd, const struct timeval __tvp[2]), #endif #ifdef __USE_GNU -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS /* Change the access time of FILE relative to FD to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ diff --git a/lib/libc/include/generic-glibc/sys/timerfd.h b/lib/libc/include/generic-glibc/sys/timerfd.h index 6f934dd44d55..be64cbea9d61 100644 --- a/lib/libc/include/generic-glibc/sys/timerfd.h +++ b/lib/libc/include/generic-glibc/sys/timerfd.h @@ -47,7 +47,7 @@ extern int timerfd_settime (int __ufd, int __flags, const struct itimerspec *__utmr, struct itimerspec *__otmr) __THROW; -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # if defined(__REDIRECT_NTH) extern int __REDIRECT_NTH (timerfd_settime, (int __ufd, int __flags, @@ -62,7 +62,7 @@ extern int __REDIRECT_NTH (timerfd_settime, /* Return the next expiration time of UFD. */ extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW; -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # if defined(__REDIRECT_NTH) extern int __REDIRECT_NTH (timerfd_gettime, (int __ufd, struct itimerspec *__otmr), diff --git a/lib/libc/include/generic-glibc/sys/timex.h b/lib/libc/include/generic-glibc/sys/timex.h index 67329909eace..461843face88 100644 --- a/lib/libc/include/generic-glibc/sys/timex.h +++ b/lib/libc/include/generic-glibc/sys/timex.h @@ -54,7 +54,7 @@ struct ntptimeval __BEGIN_DECLS -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int adjtimex (struct timex *__ntx) __THROW __nonnull ((1)); extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW __nonnull ((1)); diff --git a/lib/libc/include/generic-glibc/sys/un.h b/lib/libc/include/generic-glibc/sys/un.h index 96b15615af14..04ea3c82ca64 100644 --- a/lib/libc/include/generic-glibc/sys/un.h +++ b/lib/libc/include/generic-glibc/sys/un.h @@ -26,7 +26,7 @@ __BEGIN_DECLS /* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */ -struct sockaddr_un +struct __attribute_struct_may_alias__ sockaddr_un { __SOCKADDR_COMMON (sun_); char sun_path[108]; /* Path name. */ diff --git a/lib/libc/include/generic-glibc/sys/wait.h b/lib/libc/include/generic-glibc/sys/wait.h index b460b76439b3..71b904459cac 100644 --- a/lib/libc/include/generic-glibc/sys/wait.h +++ b/lib/libc/include/generic-glibc/sys/wait.h @@ -139,7 +139,7 @@ struct rusage; nil, store information about the child's resource usage there. If the WUNTRACED bit is set in OPTIONS, return status for stopped children; otherwise don't. */ -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern __pid_t wait3 (int *__stat_loc, int __options, struct rusage * __usage) __THROWNL; # else @@ -154,7 +154,7 @@ extern __pid_t __REDIRECT_NTHNL (wait3, (int *__stat_loc, int __options, #endif #ifdef __USE_MISC -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS /* PID is like waitpid. Other args are like wait3. */ extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options, struct rusage *__usage) __THROWNL; diff --git a/lib/libc/include/generic-glibc/tgmath.h b/lib/libc/include/generic-glibc/tgmath.h index e799b375d289..120536b9cdb0 100644 --- a/lib/libc/include/generic-glibc/tgmath.h +++ b/lib/libc/include/generic-glibc/tgmath.h @@ -42,12 +42,12 @@ versions before GCC 13 have __builtin_tgmath semantics that, when integer arguments are passed to narrowing macros returning _Float32x, or non-narrowing macros with at least two generic - arguments, do not always correspond to the C2X semantics, so more + arguments, do not always correspond to the C23 semantics, so more complicated macro definitions are also used in some cases for versions from GCC 8 to GCC 12. */ #define __HAVE_BUILTIN_TGMATH __GNUC_PREREQ (8, 0) -#define __HAVE_BUILTIN_TGMATH_C2X __GNUC_PREREQ (13, 0) +#define __HAVE_BUILTIN_TGMATH_C23 __GNUC_PREREQ (13, 0) #if __GNUC_PREREQ (2, 7) @@ -171,7 +171,7 @@ __builtin_tgmath (__TGMATH_NARROW_FUNCS_F64 (F) (X), (Y)) # define __TGMATH_3_NARROW_F64(F, X, Y, Z) \ __builtin_tgmath (__TGMATH_NARROW_FUNCS_F64 (F) (X), (Y), (Z)) -# if __HAVE_FLOAT128 && __HAVE_BUILTIN_TGMATH_C2X +# if __HAVE_FLOAT128 && __HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_1_NARROW_F32X(F, X) \ __builtin_tgmath (__TGMATH_NARROW_FUNCS_F32X (F) (X)) # define __TGMATH_2_NARROW_F32X(F, X, Y) \ @@ -182,7 +182,7 @@ # endif -# if !__HAVE_BUILTIN_TGMATH_C2X +# if !__HAVE_BUILTIN_TGMATH_C23 # ifdef __NO_LONG_DOUBLE_MATH # define __tgml(fct) fct # else @@ -261,20 +261,20 @@ __complex_integer_type (__typeof__ (+(expr)))) /* The tgmath real type of EXPR1 combined with EXPR2, without handling - the C2X rule of interpreting integer arguments as _Float32x if any + the C23 rule of interpreting integer arguments as _Float32x if any argument is _FloatNx. */ # define __tgmath_real_type2_base(expr1, expr2) \ __typeof ((__tgmath_real_type (expr1)) 0 + (__tgmath_real_type (expr2)) 0) /* The tgmath complex type of EXPR1 combined with EXPR2, without - handling the C2X rule of interpreting integer arguments as + handling the C23 rule of interpreting integer arguments as _Float32x if any argument is _FloatNx. */ # define __tgmath_complex_type2_base(expr1, expr2) \ __typeof ((__tgmath_complex_type (expr1)) 0 \ + (__tgmath_complex_type (expr2)) 0) /* The tgmath real type of EXPR1 combined with EXPR2 and EXPR3, - without handling the C2X rule of interpreting integer arguments as + without handling the C23 rule of interpreting integer arguments as _Float32x if any argument is _FloatNx. */ # define __tgmath_real_type3_base(expr1, expr2, expr3) \ __typeof ((__tgmath_real_type (expr1)) 0 \ @@ -361,7 +361,7 @@ # define __TGMATH_CF128(arg_comb, fct, cfct, arg_call) /* Nothing. */ # endif -# endif /* !__HAVE_BUILTIN_TGMATH_C2X. */ +# endif /* !__HAVE_BUILTIN_TGMATH_C23. */ /* We have two kinds of generic macros: to support functions which are only defined on real valued parameters and those which are defined @@ -374,13 +374,13 @@ __TGMATH_2 (Fct, (Val1), (Val2)) # define __TGMATH_BINARY_FIRST_REAL_STD_ONLY(Val1, Val2, Fct) \ __TGMATH_2STD (Fct, (Val1), (Val2)) -# if __HAVE_BUILTIN_TGMATH_C2X +# if __HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_BINARY_REAL_ONLY(Val1, Val2, Fct) \ __TGMATH_2 (Fct, (Val1), (Val2)) # endif # define __TGMATH_BINARY_REAL_STD_ONLY(Val1, Val2, Fct) \ __TGMATH_2STD (Fct, (Val1), (Val2)) -# if __HAVE_BUILTIN_TGMATH_C2X +# if __HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \ __TGMATH_3 (Fct, (Val1), (Val2), (Val3)) # define __TGMATH_TERNARY_REAL_ONLY(Val1, Val2, Val3, Fct) \ @@ -395,7 +395,7 @@ __TGMATH_1C (Fct, Cfct, (Val)) # define __TGMATH_UNARY_REAL_IMAG_RET_REAL_SAME(Val, Cfct) \ __TGMATH_1 (Cfct, (Val)) -# if __HAVE_BUILTIN_TGMATH_C2X +# if __HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_BINARY_REAL_IMAG(Val1, Val2, Fct, Cfct) \ __TGMATH_2C (Fct, Cfct, (Val1), (Val2)) # endif @@ -441,7 +441,7 @@ : (__tgmath_real_type (Val1)) __tgml(Fct) (Val1, Val2))) # endif -# if !__HAVE_BUILTIN_TGMATH_C2X +# if !__HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_BINARY_REAL_ONLY(Val1, Val2, Fct) \ (__extension__ ((sizeof ((Val1) + (Val2)) > sizeof (double) \ && __builtin_classify_type ((Val1) + (Val2)) == 8) \ @@ -479,7 +479,7 @@ Fct##f (Val1, Val2))) # endif -# if !__HAVE_BUILTIN_TGMATH_C2X +# if !__HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \ (__extension__ ((sizeof ((Val1) + (Val2)) > sizeof (double) \ && __builtin_classify_type ((Val1) + (Val2)) == 8) \ @@ -597,7 +597,7 @@ __TGMATH_UNARY_REAL_IMAG_RET_REAL ((Val), Cfct, Cfct) # endif -# if !__HAVE_BUILTIN_TGMATH_C2X +# if !__HAVE_BUILTIN_TGMATH_C23 /* XXX This definition has to be changed as soon as the compiler understands the imaginary keyword. */ # define __TGMATH_BINARY_REAL_IMAG(Val1, Val2, Fct, Cfct) \ @@ -664,7 +664,7 @@ distinguished using sizeof (or at all if the types are typedefs rather than different types, in which case we err on the side of using the wider type if unsure). */ -# if !__HAVE_BUILTIN_TGMATH_C2X +# if !__HAVE_BUILTIN_TGMATH_C23 # if __HAVE_FLOATN_NOT_TYPEDEF # define __TGMATH_NARROW_F32X_USE_F64X(X) \ !__builtin_types_compatible_p (__typeof (+(X)), _Float64) @@ -714,7 +714,7 @@ F ## f64x (X, Y, Z) \ : F ## f128 (X, Y, Z))) # endif -# if !__HAVE_BUILTIN_TGMATH_C2X +# if !__HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_1_NARROW_F32X(F, X) \ (__extension__ (sizeof ((__tgmath_real_type (X)) 0) > sizeof (_Float64) \ || __TGMATH_NARROW_F32X_USE_F64X (X) \ @@ -761,7 +761,7 @@ # define __TGMATH_3_NARROW_F64(F, X, Y, Z) \ (F ## f128 (X, Y, Z)) # endif -# if !__HAVE_BUILTIN_TGMATH_C2X +# if !__HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_1_NARROW_F32X(F, X) \ (__extension__ (sizeof ((__tgmath_real_type (X)) 0) > sizeof (_Float32x) \ || __TGMATH_NARROW_F32X_USE_F64X (X) \ @@ -871,9 +871,24 @@ /* Compute base-2 logarithm of X. */ #define log2(Val) __TGMATH_UNARY_REAL_ONLY (Val, log2) -#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C2X) +#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23) /* Compute exponent to base ten. */ #define exp10(Val) __TGMATH_UNARY_REAL_ONLY (Val, exp10) + +/* Return exp2(X) - 1. */ +#define exp2m1(Val) __TGMATH_UNARY_REAL_ONLY (Val, exp2m1) + +/* Return exp10(X) - 1. */ +#define exp10m1(Val) __TGMATH_UNARY_REAL_ONLY (Val, exp10m1) + +/* Return log2(1 + X). */ +#define log2p1(Val) __TGMATH_UNARY_REAL_ONLY (Val, log2p1) + +/* Return log10(1 + X). */ +#define log10p1(Val) __TGMATH_UNARY_REAL_ONLY (Val, log10p1) + +/* Return log(1 + X). */ +#define logp1(Val) __TGMATH_UNARY_REAL_ONLY (Val, logp1) #endif @@ -949,7 +964,7 @@ prevailing rounding mode. */ #define rint(Val) __TGMATH_UNARY_REAL_ONLY (Val, rint) -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Return X - epsilon. */ # define nextdown(Val) __TGMATH_UNARY_REAL_ONLY (Val, nextdown) /* Return X + epsilon. */ @@ -983,7 +998,7 @@ /* Return positive difference between X and Y. */ #define fdim(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fdim) -#if __GLIBC_USE (ISOC2X) && !defined __USE_GNU +#if __GLIBC_USE (ISOC23) && !defined __USE_GNU /* Return maximum numeric value from X and Y. */ # define fmax(Val1, Val2) __TGMATH_BINARY_REAL_STD_ONLY (Val1, Val2, fmax) @@ -1002,7 +1017,7 @@ #define fma(Val1, Val2, Val3) \ __TGMATH_TERNARY_REAL_ONLY (Val1, Val2, Val3, fma) -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Round X to nearest integer value, rounding halfway cases to even. */ # define roundeven(Val) __TGMATH_UNARY_REAL_ONLY (Val, roundeven) @@ -1030,7 +1045,7 @@ # define fminmag(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fminmag) #endif -#if __GLIBC_USE (ISOC2X) +#if __GLIBC_USE (ISOC23) /* Return maximum value from X and Y. */ # define fmaximum(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fmaximum) @@ -1086,7 +1101,7 @@ /* Narrowing functions. */ -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Add. */ # define fadd(Val1, Val2) __TGMATH_2_NARROW_F (fadd, Val1, Val2) diff --git a/lib/libc/include/generic-glibc/threads.h b/lib/libc/include/generic-glibc/threads.h index 2d3c129da576..c05aa4cdaf4c 100644 --- a/lib/libc/include/generic-glibc/threads.h +++ b/lib/libc/include/generic-glibc/threads.h @@ -90,7 +90,7 @@ extern thrd_t thrd_current (void); __TIME_POINT. The current thread may resume if receives a signal. In that case, if __REMAINING is not NULL, the remaining time is stored in the object pointed by it. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int thrd_sleep (const struct timespec *__time_point, struct timespec *__remaining); #else @@ -143,7 +143,7 @@ extern int mtx_lock (mtx_t *__mutex); /* Block the current thread until the mutex pointed by __MUTEX is unlocked or time pointed by __TIME_POINT is reached. In case the mutex is unlock, the current thread will not be blocked. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int mtx_timedlock (mtx_t *__restrict __mutex, const struct timespec *__restrict __time_point); #else @@ -194,7 +194,7 @@ extern int cnd_wait (cnd_t *__cond, mtx_t *__mutex); /* Block current thread on the condition variable until condition variable pointed by __COND is signaled or time pointed by __TIME_POINT is reached. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int cnd_timedwait (cnd_t *__restrict __cond, mtx_t *__restrict __mutex, const struct timespec *__restrict __time_point); diff --git a/lib/libc/include/generic-glibc/time.h b/lib/libc/include/generic-glibc/time.h index 6ac5cc738d76..73129be97bda 100644 --- a/lib/libc/include/generic-glibc/time.h +++ b/lib/libc/include/generic-glibc/time.h @@ -71,13 +71,12 @@ __BEGIN_DECLS The result / CLOCKS_PER_SEC is program time in seconds. */ extern clock_t clock (void) __THROW; -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS /* Return the current time and put it in *TIMER if TIMER is not NULL. */ extern time_t time (time_t *__timer) __THROW; /* Return the difference between TIME1 and TIME0. */ -extern double difftime (time_t __time1, time_t __time0) - __THROW __attribute__ ((__const__)); +extern double difftime (time_t __time1, time_t __time0); /* Return the `time_t' representation of TP and normalize TP. */ extern time_t mktime (struct tm *__tp) __THROW; @@ -85,7 +84,7 @@ extern time_t mktime (struct tm *__tp) __THROW; # ifdef __REDIRECT_NTH extern time_t __REDIRECT_NTH (time, (time_t *__timer), __time64); extern double __REDIRECT_NTH (difftime, (time_t __time1, time_t __time0), - __difftime64) __attribute__ ((__const__)); + __difftime64); extern time_t __REDIRECT_NTH (mktime, (struct tm *__tp), __mktime64); # else # define time __time64 @@ -127,7 +126,7 @@ extern char *strptime_l (const char *__restrict __s, #endif -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS /* Return the `struct tm' representation of *TIMER in Universal Coordinated Time (aka Greenwich Mean Time). */ extern struct tm *gmtime (const time_t *__timer) __THROW; @@ -148,8 +147,8 @@ extern struct tm *__REDIRECT_NTH (localtime, (const time_t *__timer), #endif -#if defined __USE_POSIX || __GLIBC_USE (ISOC2X) -# ifndef __USE_TIME_BITS64 +#if defined __USE_POSIX || __GLIBC_USE (ISOC23) +# ifndef __USE_TIME64_REDIRECTS /* Return the `struct tm' representation of *TIMER in UTC, using *TP to store the result. */ extern struct tm *gmtime_r (const time_t *__restrict __timer, @@ -173,14 +172,14 @@ extern struct tm*__REDIRECT_NTH (localtime_r, (const time_t *__restrict __t, # define localtime_r __localtime_r # endif # endif -#endif /* POSIX || C2X */ +#endif /* POSIX || C23 */ /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" that is the representation of TP in this format. */ extern char *asctime (const struct tm *__tp) __THROW; /* Equivalent to `asctime (localtime (timer))'. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern char *ctime (const time_t *__timer) __THROW; #else # ifdef __REDIRECT_NTH @@ -199,7 +198,7 @@ extern char *asctime_r (const struct tm *__restrict __tp, char *__restrict __buf) __THROW; /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern char *ctime_r (const time_t *__restrict __timer, char *__restrict __buf) __THROW; #else @@ -241,8 +240,8 @@ extern long int timezone; ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) -#if defined __USE_MISC || __GLIBC_USE (ISOC2X) -# ifndef __USE_TIME_BITS64 +#if defined __USE_MISC || __GLIBC_USE (ISOC23) +# ifndef __USE_TIME64_REDIRECTS /* Like `mktime', but for TP represents Universal Time, not local time. */ extern time_t timegm (struct tm *__tp) __THROW; # else @@ -259,7 +258,7 @@ extern time_t __REDIRECT_NTH (timegm, (struct tm *__tp), __timegm64); /* Miscellaneous functions many Unices inherited from the public domain localtime package. These are included only for compatibility. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS /* Another name for `mktime'. */ extern time_t timelocal (struct tm *__tp) __THROW; #else @@ -274,7 +273,7 @@ extern int dysize (int __year) __THROW __attribute__ ((__const__)); #ifdef __USE_POSIX199309 -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS /* Pause execution for a number of nanoseconds. This function is a cancellation point and therefore not marked with @@ -320,7 +319,7 @@ extern int __REDIRECT_NTH (clock_settime, (clockid_t __clock_id, const struct This function is a cancellation point and therefore not marked with __THROW. */ -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int clock_nanosleep (clockid_t __clock_id, int __flags, const struct timespec *__req, struct timespec *__rem); @@ -349,7 +348,7 @@ extern int timer_create (clockid_t __clock_id, extern int timer_delete (timer_t __timerid) __THROW; /* Set timer TIMERID to VALUE, returning old value in OVALUE. */ -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS extern int timer_settime (timer_t __timerid, int __flags, const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) __THROW; @@ -379,7 +378,7 @@ extern int timer_getoverrun (timer_t __timerid) __THROW; #ifdef __USE_ISOC11 -# ifndef __USE_TIME_BITS64 +# ifndef __USE_TIME64_REDIRECTS /* Set TS to calendar time based in time base BASE. */ extern int timespec_get (struct timespec *__ts, int __base) __THROW __nonnull ((1)); @@ -394,8 +393,8 @@ extern int __REDIRECT_NTH (timespec_get, (struct timespec *__ts, int __base), #endif -#if __GLIBC_USE (ISOC2X) -# ifndef __USE_TIME_BITS64 +#if __GLIBC_USE (ISOC23) +# ifndef __USE_TIME64_REDIRECTS /* Set TS to resolution of time base BASE. */ extern int timespec_getres (struct timespec *__ts, int __base) __THROW; diff --git a/lib/libc/include/generic-glibc/uchar.h b/lib/libc/include/generic-glibc/uchar.h index 0c14a4b64c59..f5b2d1334e50 100644 --- a/lib/libc/include/generic-glibc/uchar.h +++ b/lib/libc/include/generic-glibc/uchar.h @@ -31,9 +31,9 @@ #include #include -/* Declare the C2x char8_t typedef in C2x modes, but only if the C++ +/* Declare the C23 char8_t typedef in C23 modes, but only if the C++ __cpp_char8_t feature test macro is not defined. */ -#if __GLIBC_USE (ISOC2X) && !defined __cpp_char8_t +#if __GLIBC_USE (ISOC23) && !defined __cpp_char8_t #if __GNUC_PREREQ (10, 0) && defined __cplusplus /* Suppress the diagnostic regarding char8_t being a keyword in C++20. */ # pragma GCC diagnostic push @@ -55,9 +55,9 @@ typedef __uint_least32_t char32_t; __BEGIN_DECLS -/* Declare the C2x mbrtoc8() and c8rtomb() functions in C2x modes or if +/* Declare the C23 mbrtoc8() and c8rtomb() functions in C23 modes or if the C++ __cpp_char8_t feature test macro is defined. */ -#if __GLIBC_USE (ISOC2X) || defined __cpp_char8_t +#if __GLIBC_USE (ISOC23) || defined __cpp_char8_t /* Write char8_t representation of multibyte character pointed to by S to PC8. */ extern size_t mbrtoc8 (char8_t *__restrict __pc8, diff --git a/lib/libc/include/generic-glibc/utime.h b/lib/libc/include/generic-glibc/utime.h index e0ed75cb7f44..d1810253f006 100644 --- a/lib/libc/include/generic-glibc/utime.h +++ b/lib/libc/include/generic-glibc/utime.h @@ -35,7 +35,7 @@ __BEGIN_DECLS /* Structure describing file times. */ struct utimbuf { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS __time64_t actime; /* Access time. */ __time64_t modtime; /* Modification time. */ #else @@ -46,7 +46,7 @@ struct utimbuf /* Set the access and modification times of FILE to those given in *FILE_TIMES. If FILE_TIMES is NULL, set them to the current time. */ -#ifndef __USE_TIME_BITS64 +#ifndef __USE_TIME64_REDIRECTS extern int utime (const char *__file, const struct utimbuf *__file_times) __THROW __nonnull ((1)); diff --git a/lib/libc/include/generic-glibc/wchar.h b/lib/libc/include/generic-glibc/wchar.h index 5ce50b40eb3e..5a4022bb37fb 100644 --- a/lib/libc/include/generic-glibc/wchar.h +++ b/lib/libc/include/generic-glibc/wchar.h @@ -410,7 +410,7 @@ extern long double wcstold (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; #endif /* C99 */ -#if __GLIBC_USE (IEC_60559_TYPES_EXT) && __GLIBC_USE (ISOC2X) +#if __GLIBC_USE (IEC_60559_TYPES_EXT) && __GLIBC_USE (ISOC23) /* Likewise for `_FloatN' and `_FloatNx' when support is enabled. */ # if __HAVE_FLOAT16 @@ -447,7 +447,7 @@ extern _Float64x wcstof64x (const wchar_t *__restrict __nptr, extern _Float128x wcstof128x (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; # endif -#endif /* __GLIBC_USE (IEC_60559_TYPES_EXT) && __GLIBC_USE (ISOC2X) */ +#endif /* __GLIBC_USE (IEC_60559_TYPES_EXT) && __GLIBC_USE (ISOC23) */ /* Convert initial portion of wide string NPTR to `long int' @@ -495,7 +495,7 @@ extern unsigned long long int wcstouq (const wchar_t *__restrict __nptr, /* Versions of the above functions that handle '0b' and '0B' prefixes in base 0 or 2. */ -#if __GLIBC_USE (C2X_STRTOL) +#if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern long int __REDIRECT_NTH (wcstol, (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, @@ -579,7 +579,7 @@ extern unsigned long long int wcstoull_l (const wchar_t *__restrict __nptr, /* Versions of the above functions that handle '0b' and '0B' prefixes in base 0 or 2. */ -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern long int __REDIRECT_NTH (wcstol_l, (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, @@ -790,7 +790,7 @@ extern int swscanf (const wchar_t *__restrict __s, bits/wchar-ldbl.h. */ # if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT \ && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...), @@ -870,7 +870,7 @@ extern int vswscanf (const wchar_t *__restrict __s, && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) \ && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s, const wchar_t *__restrict __format, diff --git a/lib/libc/include/loongarch64-linux-gnu/bits/fenv.h b/lib/libc/include/loongarch64-linux-gnu/bits/fenv.h index 63e56faf1b5f..92dc84011a9b 100644 --- a/lib/libc/include/loongarch64-linux-gnu/bits/fenv.h +++ b/lib/libc/include/loongarch64-linux-gnu/bits/fenv.h @@ -81,7 +81,7 @@ typedef struct #define FE_NOMASK_ENV ((const fenv_t *) -257) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/lib/libc/include/loongarch64-linux-gnu/bits/typesizes.h b/lib/libc/include/loongarch64-linux-gnu/bits/typesizes.h deleted file mode 100644 index d875caa94e85..000000000000 --- a/lib/libc/include/loongarch64-linux-gnu/bits/typesizes.h +++ /dev/null @@ -1,107 +0,0 @@ -/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI. - Copyright (C) 2011-2024 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_TYPES_H -# error "Never include directly; use instead." -#endif - -#ifndef _BITS_TYPESIZES_H -#define _BITS_TYPESIZES_H 1 - -/* 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 __INO64_T_TYPE __UQUAD_TYPE -#define __MODE_T_TYPE __U32_TYPE -#define __NLINK_T_TYPE __U32_TYPE -#define __OFF64_T_TYPE __SQUAD_TYPE -#define __PID_T_TYPE __S32_TYPE -#define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT64_T_TYPE __UQUAD_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 __USECONDS_T_TYPE __U32_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 __S32_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 - -#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. */ -# define __OFF_T_MATCHES_OFF64_T 1 - -/* Same for ino_t and ino64_t. */ -# define __INO_T_MATCHES_INO64_T 1 - -/* 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 (__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 - - -#endif /* bits/typesizes.h */ \ No newline at end of file diff --git a/lib/libc/include/loongarch64-linux-gnu/fpu_control.h b/lib/libc/include/loongarch64-linux-gnu/fpu_control.h index 815ebcc78b39..d52d6d51cc8d 100644 --- a/lib/libc/include/loongarch64-linux-gnu/fpu_control.h +++ b/lib/libc/include/loongarch64-linux-gnu/fpu_control.h @@ -91,8 +91,8 @@ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__))); /* Macros for accessing the hardware control word. */ extern fpu_control_t __loongarch_fpu_getcw (void) __THROW; extern void __loongarch_fpu_setcw (fpu_control_t) __THROW; -#define _FPU_GETCW(cw) __asm__ volatile ("movfcsr2gr %0,$r0" : "=r"(cw)) -#define _FPU_SETCW(cw) __asm__ volatile ("movgr2fcsr $r0,%0" : : "r"(cw)) +#define _FPU_GETCW(cw) __asm__ volatile ("movfcsr2gr %0,$fcsr0" : "=r"(cw)) +#define _FPU_SETCW(cw) __asm__ volatile ("movgr2fcsr $fcsr0,%0" : : "r"(cw)) /* Default control word set at startup. */ extern fpu_control_t __fpu_control; diff --git a/lib/libc/include/m68k-linux-gnu/bits/fenv.h b/lib/libc/include/m68k-linux-gnu/bits/fenv.h index f2ca6cafda12..e3e9ad210b2a 100644 --- a/lib/libc/include/m68k-linux-gnu/bits/fenv.h +++ b/lib/libc/include/m68k-linux-gnu/bits/fenv.h @@ -122,7 +122,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/lib/libc/include/m68k-linux-gnu/bits/struct_stat.h b/lib/libc/include/m68k-linux-gnu/bits/struct_stat.h index a05ae8acad83..6bd4c676428d 100644 --- a/lib/libc/include/m68k-linux-gnu/bits/struct_stat.h +++ b/lib/libc/include/m68k-linux-gnu/bits/struct_stat.h @@ -25,7 +25,7 @@ struct stat { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else __dev_t st_dev; /* Device. */ @@ -80,13 +80,13 @@ struct stat # else __ino64_t st_ino; /* File serial number. */ # endif -#endif /* __USE_TIME_BITS64 */ +#endif /* __USE_TIME64_REDIRECTS */ }; #ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -122,7 +122,7 @@ struct stat64 unsigned long int st_ctimensec; /* Nsecs of last status change. */ # endif __ino64_t st_ino; /* File serial number. */ -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; #endif diff --git a/lib/libc/include/m68k-linux-gnu/bits/wordsize.h b/lib/libc/include/m68k-linux-gnu/bits/wordsize.h index 3a4baec80809..677850e18efb 100644 --- a/lib/libc/include/m68k-linux-gnu/bits/wordsize.h +++ b/lib/libc/include/m68k-linux-gnu/bits/wordsize.h @@ -16,6 +16,6 @@ . */ #define __WORDSIZE 32 -#define __WORDSIZE_TIME64_COMPAT32 0 +#define __WORDSIZE_TIME64_COMPAT32 1 #define __WORDSIZE32_SIZE_ULONG 0 #define __WORDSIZE32_PTRDIFF_LONG 0 \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-gnu/bits/floatn.h b/lib/libc/include/mips-linux-gnueabi/bits/floatn.h similarity index 98% rename from lib/libc/include/aarch64-linux-gnu/bits/floatn.h rename to lib/libc/include/mips-linux-gnueabi/bits/floatn.h index 20c1af5c2e78..e1f58983af59 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/floatn.h +++ b/lib/libc/include/mips-linux-gnueabi/bits/floatn.h @@ -1,4 +1,4 @@ -/* Macros to control TS 18661-3 glibc features on ldbl-128 platforms. +/* Macros to control TS 18661-3 glibc features on MIPS platforms. Copyright (C) 2017-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/include/loongarch64-linux-gnu/bits/rseq.h b/lib/libc/include/mips-linux-gnueabi/bits/rseq.h similarity index 58% rename from lib/libc/include/loongarch64-linux-gnu/bits/rseq.h rename to lib/libc/include/mips-linux-gnueabi/bits/rseq.h index 5ea695ad1c3d..9b9c7040c456 100644 --- a/lib/libc/include/loongarch64-linux-gnu/bits/rseq.h +++ b/lib/libc/include/mips-linux-gnueabi/bits/rseq.h @@ -1,4 +1,4 @@ -/* Restartable Sequences architecture header. Stub version. +/* Restartable Sequences Linux mips architecture header. Copyright (C) 2021-2024 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or @@ -26,4 +26,37 @@ architecture. When choosing this value, it needs to be taken into account that generating invalid instructions may have ill effects on tools like objdump, and may also have impact on the CPU speculative - execution efficiency in some cases. */ \ No newline at end of file + execution efficiency in some cases. + + RSEQ_SIG uses the break instruction. The instruction pattern is: + + On MIPS: + 0350000d break 0x350 + + On nanoMIPS: + 00100350 break 0x350 + + On microMIPS: + 0000d407 break 0x350 + + For nanoMIPS32 and microMIPS, the instruction stream is encoded as + 16-bit halfwords, so the signature halfwords need to be swapped + accordingly for little-endian. */ + +#if defined (__nanomips__) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0x03500010 +# else +# define RSEQ_SIG 0x00100350 +# endif +#elif defined (__mips_micromips) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0xd4070000 +# else +# define RSEQ_SIG 0x0000d407 +# endif +#elif defined (__mips__) +# define RSEQ_SIG 0x0350000d +#else +/* Unknown MIPS architecture. */ +#endif \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnueabi/bits/socket-constants.h b/lib/libc/include/mips-linux-gnueabi/bits/socket-constants.h index 377e5fba636e..344c4461b4c0 100644 --- a/lib/libc/include/mips-linux-gnueabi/bits/socket-constants.h +++ b/lib/libc/include/mips-linux-gnueabi/bits/socket-constants.h @@ -54,7 +54,7 @@ # define SO_TIMESTAMPNS_NEW 64 # define SO_TIMESTAMPING_NEW 65 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define SO_RCVTIMEO SO_RCVTIMEO_NEW # define SO_SNDTIMEO SO_SNDTIMEO_NEW # define SO_TIMESTAMP SO_TIMESTAMP_NEW diff --git a/lib/libc/include/mips-linux-gnueabi/bits/types/struct_msqid_ds.h b/lib/libc/include/mips-linux-gnueabi/bits/types/struct_msqid_ds.h index 1e4d4868f2d2..37dfa344564c 100644 --- a/lib/libc/include/mips-linux-gnueabi/bits/types/struct_msqid_ds.h +++ b/lib/libc/include/mips-linux-gnueabi/bits/types/struct_msqid_ds.h @@ -26,7 +26,7 @@ The type `struct msg' is opaque. */ struct msqid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm msg_perm; /* structure describing operation permission */ diff --git a/lib/libc/include/mips-linux-gnueabi/bits/types/struct_semid_ds.h b/lib/libc/include/mips-linux-gnueabi/bits/types/struct_semid_ds.h index 1a780c0b628a..ee1519e5bd44 100644 --- a/lib/libc/include/mips-linux-gnueabi/bits/types/struct_semid_ds.h +++ b/lib/libc/include/mips-linux-gnueabi/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/mips-linux-gnueabi/bits/types/struct_shmid_ds.h b/lib/libc/include/mips-linux-gnueabi/bits/types/struct_shmid_ds.h index b54474f41381..abd5d51f0397 100644 --- a/lib/libc/include/mips-linux-gnueabi/bits/types/struct_shmid_ds.h +++ b/lib/libc/include/mips-linux-gnueabi/bits/types/struct_shmid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm shm_perm; /* operation permission struct */ diff --git a/lib/libc/include/aarch64-linux-gnu/bits/typesizes.h b/lib/libc/include/mips-linux-gnueabi/bits/typesizes.h similarity index 68% rename from lib/libc/include/aarch64-linux-gnu/bits/typesizes.h rename to lib/libc/include/mips-linux-gnueabi/bits/typesizes.h index d875caa94e85..4c384e86917d 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/mips-linux-gnueabi/bits/typesizes.h @@ -1,5 +1,5 @@ -/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI. - Copyright (C) 2011-2024 Free Software Foundation, Inc. +/* bits/typesizes.h -- underlying types for *_t. MIPS version. + Copyright (C) 2002-2024 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,7 +13,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 . */ #ifndef _BITS_TYPES_H @@ -25,57 +25,44 @@ /* 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 __NLINK_T_TYPE __UWORD_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 #define __TIMER_T_TYPE void * -#define __BLKSIZE_T_TYPE __S32_TYPE +#define __BLKSIZE_T_TYPE __SLONGWORD_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 -#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) +#ifdef __LP64__ /* 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. */ @@ -84,19 +71,20 @@ /* 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 (__WORDSIZE == 64) +# 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 diff --git a/lib/libc/include/loongarch64-linux-gnu/bits/floatn.h b/lib/libc/include/mips-linux-gnueabihf/bits/floatn.h similarity index 98% rename from lib/libc/include/loongarch64-linux-gnu/bits/floatn.h rename to lib/libc/include/mips-linux-gnueabihf/bits/floatn.h index 20c1af5c2e78..e1f58983af59 100644 --- a/lib/libc/include/loongarch64-linux-gnu/bits/floatn.h +++ b/lib/libc/include/mips-linux-gnueabihf/bits/floatn.h @@ -1,4 +1,4 @@ -/* Macros to control TS 18661-3 glibc features on ldbl-128 platforms. +/* Macros to control TS 18661-3 glibc features on MIPS platforms. Copyright (C) 2017-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/include/csky-linux-gnueabi/bits/rseq.h b/lib/libc/include/mips-linux-gnueabihf/bits/rseq.h similarity index 58% rename from lib/libc/include/csky-linux-gnueabi/bits/rseq.h rename to lib/libc/include/mips-linux-gnueabihf/bits/rseq.h index 5ea695ad1c3d..9b9c7040c456 100644 --- a/lib/libc/include/csky-linux-gnueabi/bits/rseq.h +++ b/lib/libc/include/mips-linux-gnueabihf/bits/rseq.h @@ -1,4 +1,4 @@ -/* Restartable Sequences architecture header. Stub version. +/* Restartable Sequences Linux mips architecture header. Copyright (C) 2021-2024 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or @@ -26,4 +26,37 @@ architecture. When choosing this value, it needs to be taken into account that generating invalid instructions may have ill effects on tools like objdump, and may also have impact on the CPU speculative - execution efficiency in some cases. */ \ No newline at end of file + execution efficiency in some cases. + + RSEQ_SIG uses the break instruction. The instruction pattern is: + + On MIPS: + 0350000d break 0x350 + + On nanoMIPS: + 00100350 break 0x350 + + On microMIPS: + 0000d407 break 0x350 + + For nanoMIPS32 and microMIPS, the instruction stream is encoded as + 16-bit halfwords, so the signature halfwords need to be swapped + accordingly for little-endian. */ + +#if defined (__nanomips__) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0x03500010 +# else +# define RSEQ_SIG 0x00100350 +# endif +#elif defined (__mips_micromips) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0xd4070000 +# else +# define RSEQ_SIG 0x0000d407 +# endif +#elif defined (__mips__) +# define RSEQ_SIG 0x0350000d +#else +/* Unknown MIPS architecture. */ +#endif \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnueabihf/bits/socket-constants.h b/lib/libc/include/mips-linux-gnueabihf/bits/socket-constants.h index 377e5fba636e..344c4461b4c0 100644 --- a/lib/libc/include/mips-linux-gnueabihf/bits/socket-constants.h +++ b/lib/libc/include/mips-linux-gnueabihf/bits/socket-constants.h @@ -54,7 +54,7 @@ # define SO_TIMESTAMPNS_NEW 64 # define SO_TIMESTAMPING_NEW 65 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define SO_RCVTIMEO SO_RCVTIMEO_NEW # define SO_SNDTIMEO SO_SNDTIMEO_NEW # define SO_TIMESTAMP SO_TIMESTAMP_NEW diff --git a/lib/libc/include/mips-linux-gnueabihf/bits/types/struct_msqid_ds.h b/lib/libc/include/mips-linux-gnueabihf/bits/types/struct_msqid_ds.h index 1e4d4868f2d2..37dfa344564c 100644 --- a/lib/libc/include/mips-linux-gnueabihf/bits/types/struct_msqid_ds.h +++ b/lib/libc/include/mips-linux-gnueabihf/bits/types/struct_msqid_ds.h @@ -26,7 +26,7 @@ The type `struct msg' is opaque. */ struct msqid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm msg_perm; /* structure describing operation permission */ diff --git a/lib/libc/include/mips-linux-gnueabihf/bits/types/struct_semid_ds.h b/lib/libc/include/mips-linux-gnueabihf/bits/types/struct_semid_ds.h index 1a780c0b628a..ee1519e5bd44 100644 --- a/lib/libc/include/mips-linux-gnueabihf/bits/types/struct_semid_ds.h +++ b/lib/libc/include/mips-linux-gnueabihf/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/mips-linux-gnueabihf/bits/types/struct_shmid_ds.h b/lib/libc/include/mips-linux-gnueabihf/bits/types/struct_shmid_ds.h index b54474f41381..abd5d51f0397 100644 --- a/lib/libc/include/mips-linux-gnueabihf/bits/types/struct_shmid_ds.h +++ b/lib/libc/include/mips-linux-gnueabihf/bits/types/struct_shmid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm shm_perm; /* operation permission struct */ diff --git a/lib/libc/include/csky-linux-gnueabihf/bits/typesizes.h b/lib/libc/include/mips-linux-gnueabihf/bits/typesizes.h similarity index 68% rename from lib/libc/include/csky-linux-gnueabihf/bits/typesizes.h rename to lib/libc/include/mips-linux-gnueabihf/bits/typesizes.h index d875caa94e85..4c384e86917d 100644 --- a/lib/libc/include/csky-linux-gnueabihf/bits/typesizes.h +++ b/lib/libc/include/mips-linux-gnueabihf/bits/typesizes.h @@ -1,5 +1,5 @@ -/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI. - Copyright (C) 2011-2024 Free Software Foundation, Inc. +/* bits/typesizes.h -- underlying types for *_t. MIPS version. + Copyright (C) 2002-2024 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,7 +13,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 . */ #ifndef _BITS_TYPES_H @@ -25,57 +25,44 @@ /* 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 __NLINK_T_TYPE __UWORD_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 #define __TIMER_T_TYPE void * -#define __BLKSIZE_T_TYPE __S32_TYPE +#define __BLKSIZE_T_TYPE __SLONGWORD_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 -#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) +#ifdef __LP64__ /* 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. */ @@ -84,19 +71,20 @@ /* 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 (__WORDSIZE == 64) +# 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 diff --git a/lib/libc/include/aarch64_be-linux-gnu/bits/floatn.h b/lib/libc/include/mips64-linux-gnuabi64/bits/floatn.h similarity index 98% rename from lib/libc/include/aarch64_be-linux-gnu/bits/floatn.h rename to lib/libc/include/mips64-linux-gnuabi64/bits/floatn.h index 20c1af5c2e78..e1f58983af59 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/bits/floatn.h +++ b/lib/libc/include/mips64-linux-gnuabi64/bits/floatn.h @@ -1,4 +1,4 @@ -/* Macros to control TS 18661-3 glibc features on ldbl-128 platforms. +/* Macros to control TS 18661-3 glibc features on MIPS platforms. Copyright (C) 2017-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/include/m68k-linux-gnu/bits/rseq.h b/lib/libc/include/mips64-linux-gnuabi64/bits/rseq.h similarity index 58% rename from lib/libc/include/m68k-linux-gnu/bits/rseq.h rename to lib/libc/include/mips64-linux-gnuabi64/bits/rseq.h index 5ea695ad1c3d..9b9c7040c456 100644 --- a/lib/libc/include/m68k-linux-gnu/bits/rseq.h +++ b/lib/libc/include/mips64-linux-gnuabi64/bits/rseq.h @@ -1,4 +1,4 @@ -/* Restartable Sequences architecture header. Stub version. +/* Restartable Sequences Linux mips architecture header. Copyright (C) 2021-2024 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or @@ -26,4 +26,37 @@ architecture. When choosing this value, it needs to be taken into account that generating invalid instructions may have ill effects on tools like objdump, and may also have impact on the CPU speculative - execution efficiency in some cases. */ \ No newline at end of file + execution efficiency in some cases. + + RSEQ_SIG uses the break instruction. The instruction pattern is: + + On MIPS: + 0350000d break 0x350 + + On nanoMIPS: + 00100350 break 0x350 + + On microMIPS: + 0000d407 break 0x350 + + For nanoMIPS32 and microMIPS, the instruction stream is encoded as + 16-bit halfwords, so the signature halfwords need to be swapped + accordingly for little-endian. */ + +#if defined (__nanomips__) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0x03500010 +# else +# define RSEQ_SIG 0x00100350 +# endif +#elif defined (__mips_micromips) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0xd4070000 +# else +# define RSEQ_SIG 0x0000d407 +# endif +#elif defined (__mips__) +# define RSEQ_SIG 0x0350000d +#else +/* Unknown MIPS architecture. */ +#endif \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/socket-constants.h b/lib/libc/include/mips64-linux-gnuabi64/bits/socket-constants.h index 377e5fba636e..344c4461b4c0 100644 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/socket-constants.h +++ b/lib/libc/include/mips64-linux-gnuabi64/bits/socket-constants.h @@ -54,7 +54,7 @@ # define SO_TIMESTAMPNS_NEW 64 # define SO_TIMESTAMPING_NEW 65 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define SO_RCVTIMEO SO_RCVTIMEO_NEW # define SO_SNDTIMEO SO_SNDTIMEO_NEW # define SO_TIMESTAMP SO_TIMESTAMP_NEW diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_msqid_ds.h b/lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_msqid_ds.h index 1e4d4868f2d2..37dfa344564c 100644 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_msqid_ds.h +++ b/lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_msqid_ds.h @@ -26,7 +26,7 @@ The type `struct msg' is opaque. */ struct msqid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm msg_perm; /* structure describing operation permission */ diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_semid_ds.h b/lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_semid_ds.h index 1a780c0b628a..ee1519e5bd44 100644 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_semid_ds.h +++ b/lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_shmid_ds.h b/lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_shmid_ds.h index b54474f41381..abd5d51f0397 100644 --- a/lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_shmid_ds.h +++ b/lib/libc/include/mips64-linux-gnuabi64/bits/types/struct_shmid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm shm_perm; /* operation permission struct */ diff --git a/lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h b/lib/libc/include/mips64-linux-gnuabi64/bits/typesizes.h similarity index 68% rename from lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h rename to lib/libc/include/mips64-linux-gnuabi64/bits/typesizes.h index d875caa94e85..4c384e86917d 100644 --- a/lib/libc/include/aarch64_be-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/mips64-linux-gnuabi64/bits/typesizes.h @@ -1,5 +1,5 @@ -/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI. - Copyright (C) 2011-2024 Free Software Foundation, Inc. +/* bits/typesizes.h -- underlying types for *_t. MIPS version. + Copyright (C) 2002-2024 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,7 +13,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 . */ #ifndef _BITS_TYPES_H @@ -25,57 +25,44 @@ /* 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 __NLINK_T_TYPE __UWORD_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 #define __TIMER_T_TYPE void * -#define __BLKSIZE_T_TYPE __S32_TYPE +#define __BLKSIZE_T_TYPE __SLONGWORD_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 -#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) +#ifdef __LP64__ /* 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. */ @@ -84,19 +71,20 @@ /* 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 (__WORDSIZE == 64) +# 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 diff --git a/lib/libc/include/riscv32-linux-gnu/bits/floatn.h b/lib/libc/include/mips64-linux-gnuabin32/bits/floatn.h similarity index 98% rename from lib/libc/include/riscv32-linux-gnu/bits/floatn.h rename to lib/libc/include/mips64-linux-gnuabin32/bits/floatn.h index 20c1af5c2e78..e1f58983af59 100644 --- a/lib/libc/include/riscv32-linux-gnu/bits/floatn.h +++ b/lib/libc/include/mips64-linux-gnuabin32/bits/floatn.h @@ -1,4 +1,4 @@ -/* Macros to control TS 18661-3 glibc features on ldbl-128 platforms. +/* Macros to control TS 18661-3 glibc features on MIPS platforms. Copyright (C) 2017-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/include/csky-linux-gnueabihf/bits/rseq.h b/lib/libc/include/mips64-linux-gnuabin32/bits/rseq.h similarity index 58% rename from lib/libc/include/csky-linux-gnueabihf/bits/rseq.h rename to lib/libc/include/mips64-linux-gnuabin32/bits/rseq.h index 5ea695ad1c3d..9b9c7040c456 100644 --- a/lib/libc/include/csky-linux-gnueabihf/bits/rseq.h +++ b/lib/libc/include/mips64-linux-gnuabin32/bits/rseq.h @@ -1,4 +1,4 @@ -/* Restartable Sequences architecture header. Stub version. +/* Restartable Sequences Linux mips architecture header. Copyright (C) 2021-2024 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or @@ -26,4 +26,37 @@ architecture. When choosing this value, it needs to be taken into account that generating invalid instructions may have ill effects on tools like objdump, and may also have impact on the CPU speculative - execution efficiency in some cases. */ \ No newline at end of file + execution efficiency in some cases. + + RSEQ_SIG uses the break instruction. The instruction pattern is: + + On MIPS: + 0350000d break 0x350 + + On nanoMIPS: + 00100350 break 0x350 + + On microMIPS: + 0000d407 break 0x350 + + For nanoMIPS32 and microMIPS, the instruction stream is encoded as + 16-bit halfwords, so the signature halfwords need to be swapped + accordingly for little-endian. */ + +#if defined (__nanomips__) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0x03500010 +# else +# define RSEQ_SIG 0x00100350 +# endif +#elif defined (__mips_micromips) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0xd4070000 +# else +# define RSEQ_SIG 0x0000d407 +# endif +#elif defined (__mips__) +# define RSEQ_SIG 0x0350000d +#else +/* Unknown MIPS architecture. */ +#endif \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/socket-constants.h b/lib/libc/include/mips64-linux-gnuabin32/bits/socket-constants.h index 377e5fba636e..344c4461b4c0 100644 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/socket-constants.h +++ b/lib/libc/include/mips64-linux-gnuabin32/bits/socket-constants.h @@ -54,7 +54,7 @@ # define SO_TIMESTAMPNS_NEW 64 # define SO_TIMESTAMPING_NEW 65 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define SO_RCVTIMEO SO_RCVTIMEO_NEW # define SO_SNDTIMEO SO_SNDTIMEO_NEW # define SO_TIMESTAMP SO_TIMESTAMP_NEW diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_msqid_ds.h b/lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_msqid_ds.h index 1e4d4868f2d2..37dfa344564c 100644 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_msqid_ds.h +++ b/lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_msqid_ds.h @@ -26,7 +26,7 @@ The type `struct msg' is opaque. */ struct msqid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm msg_perm; /* structure describing operation permission */ diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_semid_ds.h b/lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_semid_ds.h index 1a780c0b628a..ee1519e5bd44 100644 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_semid_ds.h +++ b/lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_shmid_ds.h b/lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_shmid_ds.h index b54474f41381..abd5d51f0397 100644 --- a/lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_shmid_ds.h +++ b/lib/libc/include/mips64-linux-gnuabin32/bits/types/struct_shmid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm shm_perm; /* operation permission struct */ diff --git a/lib/libc/include/mips64-linux-gnuabin32/bits/typesizes.h b/lib/libc/include/mips64-linux-gnuabin32/bits/typesizes.h new file mode 100644 index 000000000000..4c384e86917d --- /dev/null +++ b/lib/libc/include/mips64-linux-gnuabin32/bits/typesizes.h @@ -0,0 +1,95 @@ +/* bits/typesizes.h -- underlying types for *_t. MIPS version. + Copyright (C) 2002-2024 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_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#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 __UWORD_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 +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_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 + +#ifdef __LP64__ +/* 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. */ +# define __OFF_T_MATCHES_OFF64_T 1 + +/* Same for ino_t and ino64_t. */ +# define __INO_T_MATCHES_INO64_T 1 + +/* 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 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 +#endif + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/floatn.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/floatn.h new file mode 100644 index 000000000000..e1f58983af59 --- /dev/null +++ b/lib/libc/include/mips64el-linux-gnuabi64/bits/floatn.h @@ -0,0 +1,97 @@ +/* Macros to control TS 18661-3 glibc features on MIPS platforms. + Copyright (C) 2017-2024 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_FLOATN_H +#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 +# 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 + +/* 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 + +/* 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 + +#ifndef __ASSEMBLER__ + +/* Defined to concatenate the literal suffix to be used with _Float128 + types, if __HAVE_FLOAT128 is 1. */ +# if __HAVE_FLOAT128 +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +/* The literal suffix f128 exists only since GCC 7.0. */ +# define __f128(x) x##l +# else +# define __f128(x) x##f128 +# endif +# endif + +/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ +# if __HAVE_FLOAT128 +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +# define __CFLOAT128 _Complex long double +# else +# define __CFLOAT128 _Complex _Float128 +# endif +# endif + +/* The remaining of this file provides support for older compilers. */ +# if __HAVE_FLOAT128 + +/* The type _Float128 exists only since GCC 7.0. */ +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +typedef long double _Float128; +# endif + +/* Various built-in functions do not 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)) +# endif + +# endif + +#endif /* !__ASSEMBLER__. */ + +#include + +#endif /* _BITS_FLOATN_H */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/rseq.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/rseq.h new file mode 100644 index 000000000000..9b9c7040c456 --- /dev/null +++ b/lib/libc/include/mips64el-linux-gnuabi64/bits/rseq.h @@ -0,0 +1,62 @@ +/* Restartable Sequences Linux mips architecture header. + Copyright (C) 2021-2024 Free Software Foundation, Inc. + + 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_RSEQ_H +# error "Never use directly; include instead." +#endif + +/* RSEQ_SIG is a signature required before each abort handler code. + + It is a 32-bit value that maps to actual architecture code compiled + into applications and libraries. It needs to be defined for each + architecture. When choosing this value, it needs to be taken into + account that generating invalid instructions may have ill effects on + tools like objdump, and may also have impact on the CPU speculative + execution efficiency in some cases. + + RSEQ_SIG uses the break instruction. The instruction pattern is: + + On MIPS: + 0350000d break 0x350 + + On nanoMIPS: + 00100350 break 0x350 + + On microMIPS: + 0000d407 break 0x350 + + For nanoMIPS32 and microMIPS, the instruction stream is encoded as + 16-bit halfwords, so the signature halfwords need to be swapped + accordingly for little-endian. */ + +#if defined (__nanomips__) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0x03500010 +# else +# define RSEQ_SIG 0x00100350 +# endif +#elif defined (__mips_micromips) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0xd4070000 +# else +# define RSEQ_SIG 0x0000d407 +# endif +#elif defined (__mips__) +# define RSEQ_SIG 0x0350000d +#else +/* Unknown MIPS architecture. */ +#endif \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/socket-constants.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/socket-constants.h index 377e5fba636e..344c4461b4c0 100644 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/socket-constants.h +++ b/lib/libc/include/mips64el-linux-gnuabi64/bits/socket-constants.h @@ -54,7 +54,7 @@ # define SO_TIMESTAMPNS_NEW 64 # define SO_TIMESTAMPING_NEW 65 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define SO_RCVTIMEO SO_RCVTIMEO_NEW # define SO_SNDTIMEO SO_SNDTIMEO_NEW # define SO_TIMESTAMP SO_TIMESTAMP_NEW diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_msqid_ds.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_msqid_ds.h index 1e4d4868f2d2..37dfa344564c 100644 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_msqid_ds.h +++ b/lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_msqid_ds.h @@ -26,7 +26,7 @@ The type `struct msg' is opaque. */ struct msqid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm msg_perm; /* structure describing operation permission */ diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_semid_ds.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_semid_ds.h index 1a780c0b628a..ee1519e5bd44 100644 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_semid_ds.h +++ b/lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_shmid_ds.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_shmid_ds.h index b54474f41381..abd5d51f0397 100644 --- a/lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_shmid_ds.h +++ b/lib/libc/include/mips64el-linux-gnuabi64/bits/types/struct_shmid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm shm_perm; /* operation permission struct */ diff --git a/lib/libc/include/mips64el-linux-gnuabi64/bits/typesizes.h b/lib/libc/include/mips64el-linux-gnuabi64/bits/typesizes.h new file mode 100644 index 000000000000..4c384e86917d --- /dev/null +++ b/lib/libc/include/mips64el-linux-gnuabi64/bits/typesizes.h @@ -0,0 +1,95 @@ +/* bits/typesizes.h -- underlying types for *_t. MIPS version. + Copyright (C) 2002-2024 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_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#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 __UWORD_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 +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_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 + +#ifdef __LP64__ +/* 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. */ +# define __OFF_T_MATCHES_OFF64_T 1 + +/* Same for ino_t and ino64_t. */ +# define __INO_T_MATCHES_INO64_T 1 + +/* 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 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 +#endif + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/floatn.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/floatn.h new file mode 100644 index 000000000000..e1f58983af59 --- /dev/null +++ b/lib/libc/include/mips64el-linux-gnuabin32/bits/floatn.h @@ -0,0 +1,97 @@ +/* Macros to control TS 18661-3 glibc features on MIPS platforms. + Copyright (C) 2017-2024 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_FLOATN_H +#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 +# 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 + +/* 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 + +/* 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 + +#ifndef __ASSEMBLER__ + +/* Defined to concatenate the literal suffix to be used with _Float128 + types, if __HAVE_FLOAT128 is 1. */ +# if __HAVE_FLOAT128 +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +/* The literal suffix f128 exists only since GCC 7.0. */ +# define __f128(x) x##l +# else +# define __f128(x) x##f128 +# endif +# endif + +/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ +# if __HAVE_FLOAT128 +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +# define __CFLOAT128 _Complex long double +# else +# define __CFLOAT128 _Complex _Float128 +# endif +# endif + +/* The remaining of this file provides support for older compilers. */ +# if __HAVE_FLOAT128 + +/* The type _Float128 exists only since GCC 7.0. */ +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +typedef long double _Float128; +# endif + +/* Various built-in functions do not 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)) +# endif + +# endif + +#endif /* !__ASSEMBLER__. */ + +#include + +#endif /* _BITS_FLOATN_H */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/rseq.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/rseq.h new file mode 100644 index 000000000000..9b9c7040c456 --- /dev/null +++ b/lib/libc/include/mips64el-linux-gnuabin32/bits/rseq.h @@ -0,0 +1,62 @@ +/* Restartable Sequences Linux mips architecture header. + Copyright (C) 2021-2024 Free Software Foundation, Inc. + + 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_RSEQ_H +# error "Never use directly; include instead." +#endif + +/* RSEQ_SIG is a signature required before each abort handler code. + + It is a 32-bit value that maps to actual architecture code compiled + into applications and libraries. It needs to be defined for each + architecture. When choosing this value, it needs to be taken into + account that generating invalid instructions may have ill effects on + tools like objdump, and may also have impact on the CPU speculative + execution efficiency in some cases. + + RSEQ_SIG uses the break instruction. The instruction pattern is: + + On MIPS: + 0350000d break 0x350 + + On nanoMIPS: + 00100350 break 0x350 + + On microMIPS: + 0000d407 break 0x350 + + For nanoMIPS32 and microMIPS, the instruction stream is encoded as + 16-bit halfwords, so the signature halfwords need to be swapped + accordingly for little-endian. */ + +#if defined (__nanomips__) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0x03500010 +# else +# define RSEQ_SIG 0x00100350 +# endif +#elif defined (__mips_micromips) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0xd4070000 +# else +# define RSEQ_SIG 0x0000d407 +# endif +#elif defined (__mips__) +# define RSEQ_SIG 0x0350000d +#else +/* Unknown MIPS architecture. */ +#endif \ No newline at end of file diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/socket-constants.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/socket-constants.h index 377e5fba636e..344c4461b4c0 100644 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/socket-constants.h +++ b/lib/libc/include/mips64el-linux-gnuabin32/bits/socket-constants.h @@ -54,7 +54,7 @@ # define SO_TIMESTAMPNS_NEW 64 # define SO_TIMESTAMPING_NEW 65 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define SO_RCVTIMEO SO_RCVTIMEO_NEW # define SO_SNDTIMEO SO_SNDTIMEO_NEW # define SO_TIMESTAMP SO_TIMESTAMP_NEW diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_msqid_ds.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_msqid_ds.h index 1e4d4868f2d2..37dfa344564c 100644 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_msqid_ds.h +++ b/lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_msqid_ds.h @@ -26,7 +26,7 @@ The type `struct msg' is opaque. */ struct msqid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm msg_perm; /* structure describing operation permission */ diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_semid_ds.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_semid_ds.h index 1a780c0b628a..ee1519e5bd44 100644 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_semid_ds.h +++ b/lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_shmid_ds.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_shmid_ds.h index b54474f41381..abd5d51f0397 100644 --- a/lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_shmid_ds.h +++ b/lib/libc/include/mips64el-linux-gnuabin32/bits/types/struct_shmid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm shm_perm; /* operation permission struct */ diff --git a/lib/libc/include/mips64el-linux-gnuabin32/bits/typesizes.h b/lib/libc/include/mips64el-linux-gnuabin32/bits/typesizes.h new file mode 100644 index 000000000000..4c384e86917d --- /dev/null +++ b/lib/libc/include/mips64el-linux-gnuabin32/bits/typesizes.h @@ -0,0 +1,95 @@ +/* bits/typesizes.h -- underlying types for *_t. MIPS version. + Copyright (C) 2002-2024 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_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#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 __UWORD_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 +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_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 + +#ifdef __LP64__ +/* 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. */ +# define __OFF_T_MATCHES_OFF64_T 1 + +/* Same for ino_t and ino64_t. */ +# define __INO_T_MATCHES_INO64_T 1 + +/* 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 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 +#endif + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnueabi/bits/floatn.h b/lib/libc/include/mipsel-linux-gnueabi/bits/floatn.h new file mode 100644 index 000000000000..e1f58983af59 --- /dev/null +++ b/lib/libc/include/mipsel-linux-gnueabi/bits/floatn.h @@ -0,0 +1,97 @@ +/* Macros to control TS 18661-3 glibc features on MIPS platforms. + Copyright (C) 2017-2024 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_FLOATN_H +#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 +# 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 + +/* 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 + +/* 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 + +#ifndef __ASSEMBLER__ + +/* Defined to concatenate the literal suffix to be used with _Float128 + types, if __HAVE_FLOAT128 is 1. */ +# if __HAVE_FLOAT128 +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +/* The literal suffix f128 exists only since GCC 7.0. */ +# define __f128(x) x##l +# else +# define __f128(x) x##f128 +# endif +# endif + +/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ +# if __HAVE_FLOAT128 +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +# define __CFLOAT128 _Complex long double +# else +# define __CFLOAT128 _Complex _Float128 +# endif +# endif + +/* The remaining of this file provides support for older compilers. */ +# if __HAVE_FLOAT128 + +/* The type _Float128 exists only since GCC 7.0. */ +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +typedef long double _Float128; +# endif + +/* Various built-in functions do not 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)) +# endif + +# endif + +#endif /* !__ASSEMBLER__. */ + +#include + +#endif /* _BITS_FLOATN_H */ \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnueabi/bits/rseq.h b/lib/libc/include/mipsel-linux-gnueabi/bits/rseq.h new file mode 100644 index 000000000000..9b9c7040c456 --- /dev/null +++ b/lib/libc/include/mipsel-linux-gnueabi/bits/rseq.h @@ -0,0 +1,62 @@ +/* Restartable Sequences Linux mips architecture header. + Copyright (C) 2021-2024 Free Software Foundation, Inc. + + 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_RSEQ_H +# error "Never use directly; include instead." +#endif + +/* RSEQ_SIG is a signature required before each abort handler code. + + It is a 32-bit value that maps to actual architecture code compiled + into applications and libraries. It needs to be defined for each + architecture. When choosing this value, it needs to be taken into + account that generating invalid instructions may have ill effects on + tools like objdump, and may also have impact on the CPU speculative + execution efficiency in some cases. + + RSEQ_SIG uses the break instruction. The instruction pattern is: + + On MIPS: + 0350000d break 0x350 + + On nanoMIPS: + 00100350 break 0x350 + + On microMIPS: + 0000d407 break 0x350 + + For nanoMIPS32 and microMIPS, the instruction stream is encoded as + 16-bit halfwords, so the signature halfwords need to be swapped + accordingly for little-endian. */ + +#if defined (__nanomips__) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0x03500010 +# else +# define RSEQ_SIG 0x00100350 +# endif +#elif defined (__mips_micromips) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0xd4070000 +# else +# define RSEQ_SIG 0x0000d407 +# endif +#elif defined (__mips__) +# define RSEQ_SIG 0x0350000d +#else +/* Unknown MIPS architecture. */ +#endif \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnueabi/bits/socket-constants.h b/lib/libc/include/mipsel-linux-gnueabi/bits/socket-constants.h index 377e5fba636e..344c4461b4c0 100644 --- a/lib/libc/include/mipsel-linux-gnueabi/bits/socket-constants.h +++ b/lib/libc/include/mipsel-linux-gnueabi/bits/socket-constants.h @@ -54,7 +54,7 @@ # define SO_TIMESTAMPNS_NEW 64 # define SO_TIMESTAMPING_NEW 65 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define SO_RCVTIMEO SO_RCVTIMEO_NEW # define SO_SNDTIMEO SO_SNDTIMEO_NEW # define SO_TIMESTAMP SO_TIMESTAMP_NEW diff --git a/lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_msqid_ds.h b/lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_msqid_ds.h index 1e4d4868f2d2..37dfa344564c 100644 --- a/lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_msqid_ds.h +++ b/lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_msqid_ds.h @@ -26,7 +26,7 @@ The type `struct msg' is opaque. */ struct msqid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm msg_perm; /* structure describing operation permission */ diff --git a/lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_semid_ds.h b/lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_semid_ds.h index 1a780c0b628a..ee1519e5bd44 100644 --- a/lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_semid_ds.h +++ b/lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_shmid_ds.h b/lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_shmid_ds.h index b54474f41381..abd5d51f0397 100644 --- a/lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_shmid_ds.h +++ b/lib/libc/include/mipsel-linux-gnueabi/bits/types/struct_shmid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm shm_perm; /* operation permission struct */ diff --git a/lib/libc/include/mipsel-linux-gnueabi/bits/typesizes.h b/lib/libc/include/mipsel-linux-gnueabi/bits/typesizes.h new file mode 100644 index 000000000000..4c384e86917d --- /dev/null +++ b/lib/libc/include/mipsel-linux-gnueabi/bits/typesizes.h @@ -0,0 +1,95 @@ +/* bits/typesizes.h -- underlying types for *_t. MIPS version. + Copyright (C) 2002-2024 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_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#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 __UWORD_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 +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_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 + +#ifdef __LP64__ +/* 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. */ +# define __OFF_T_MATCHES_OFF64_T 1 + +/* Same for ino_t and ino64_t. */ +# define __INO_T_MATCHES_INO64_T 1 + +/* 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 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 +#endif + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnueabihf/bits/floatn.h b/lib/libc/include/mipsel-linux-gnueabihf/bits/floatn.h new file mode 100644 index 000000000000..e1f58983af59 --- /dev/null +++ b/lib/libc/include/mipsel-linux-gnueabihf/bits/floatn.h @@ -0,0 +1,97 @@ +/* Macros to control TS 18661-3 glibc features on MIPS platforms. + Copyright (C) 2017-2024 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_FLOATN_H +#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 +# 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 + +/* 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 + +/* 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 + +#ifndef __ASSEMBLER__ + +/* Defined to concatenate the literal suffix to be used with _Float128 + types, if __HAVE_FLOAT128 is 1. */ +# if __HAVE_FLOAT128 +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +/* The literal suffix f128 exists only since GCC 7.0. */ +# define __f128(x) x##l +# else +# define __f128(x) x##f128 +# endif +# endif + +/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ +# if __HAVE_FLOAT128 +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +# define __CFLOAT128 _Complex long double +# else +# define __CFLOAT128 _Complex _Float128 +# endif +# endif + +/* The remaining of this file provides support for older compilers. */ +# if __HAVE_FLOAT128 + +/* The type _Float128 exists only since GCC 7.0. */ +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +typedef long double _Float128; +# endif + +/* Various built-in functions do not 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)) +# endif + +# endif + +#endif /* !__ASSEMBLER__. */ + +#include + +#endif /* _BITS_FLOATN_H */ \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnueabihf/bits/rseq.h b/lib/libc/include/mipsel-linux-gnueabihf/bits/rseq.h new file mode 100644 index 000000000000..9b9c7040c456 --- /dev/null +++ b/lib/libc/include/mipsel-linux-gnueabihf/bits/rseq.h @@ -0,0 +1,62 @@ +/* Restartable Sequences Linux mips architecture header. + Copyright (C) 2021-2024 Free Software Foundation, Inc. + + 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_RSEQ_H +# error "Never use directly; include instead." +#endif + +/* RSEQ_SIG is a signature required before each abort handler code. + + It is a 32-bit value that maps to actual architecture code compiled + into applications and libraries. It needs to be defined for each + architecture. When choosing this value, it needs to be taken into + account that generating invalid instructions may have ill effects on + tools like objdump, and may also have impact on the CPU speculative + execution efficiency in some cases. + + RSEQ_SIG uses the break instruction. The instruction pattern is: + + On MIPS: + 0350000d break 0x350 + + On nanoMIPS: + 00100350 break 0x350 + + On microMIPS: + 0000d407 break 0x350 + + For nanoMIPS32 and microMIPS, the instruction stream is encoded as + 16-bit halfwords, so the signature halfwords need to be swapped + accordingly for little-endian. */ + +#if defined (__nanomips__) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0x03500010 +# else +# define RSEQ_SIG 0x00100350 +# endif +#elif defined (__mips_micromips) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0xd4070000 +# else +# define RSEQ_SIG 0x0000d407 +# endif +#elif defined (__mips__) +# define RSEQ_SIG 0x0350000d +#else +/* Unknown MIPS architecture. */ +#endif \ No newline at end of file diff --git a/lib/libc/include/mipsel-linux-gnueabihf/bits/socket-constants.h b/lib/libc/include/mipsel-linux-gnueabihf/bits/socket-constants.h index 377e5fba636e..344c4461b4c0 100644 --- a/lib/libc/include/mipsel-linux-gnueabihf/bits/socket-constants.h +++ b/lib/libc/include/mipsel-linux-gnueabihf/bits/socket-constants.h @@ -54,7 +54,7 @@ # define SO_TIMESTAMPNS_NEW 64 # define SO_TIMESTAMPING_NEW 65 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define SO_RCVTIMEO SO_RCVTIMEO_NEW # define SO_SNDTIMEO SO_SNDTIMEO_NEW # define SO_TIMESTAMP SO_TIMESTAMP_NEW diff --git a/lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_msqid_ds.h b/lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_msqid_ds.h index 1e4d4868f2d2..37dfa344564c 100644 --- a/lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_msqid_ds.h +++ b/lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_msqid_ds.h @@ -26,7 +26,7 @@ The type `struct msg' is opaque. */ struct msqid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm msg_perm; /* structure describing operation permission */ diff --git a/lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_semid_ds.h b/lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_semid_ds.h index 1a780c0b628a..ee1519e5bd44 100644 --- a/lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_semid_ds.h +++ b/lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_shmid_ds.h b/lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_shmid_ds.h index b54474f41381..abd5d51f0397 100644 --- a/lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_shmid_ds.h +++ b/lib/libc/include/mipsel-linux-gnueabihf/bits/types/struct_shmid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm shm_perm; /* operation permission struct */ diff --git a/lib/libc/include/mipsel-linux-gnueabihf/bits/typesizes.h b/lib/libc/include/mipsel-linux-gnueabihf/bits/typesizes.h new file mode 100644 index 000000000000..4c384e86917d --- /dev/null +++ b/lib/libc/include/mipsel-linux-gnueabihf/bits/typesizes.h @@ -0,0 +1,95 @@ +/* bits/typesizes.h -- underlying types for *_t. MIPS version. + Copyright (C) 2002-2024 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_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#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 __UWORD_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 +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_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 + +#ifdef __LP64__ +/* 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. */ +# define __OFF_T_MATCHES_OFF64_T 1 + +/* Same for ino_t and ino64_t. */ +# define __INO_T_MATCHES_INO64_T 1 + +/* 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 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 +#endif + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnueabi/bits/fenv.h b/lib/libc/include/powerpc-linux-gnueabi/bits/fenv.h index df090306dece..d563eec30c62 100644 --- a/lib/libc/include/powerpc-linux-gnueabi/bits/fenv.h +++ b/lib/libc/include/powerpc-linux-gnueabi/bits/fenv.h @@ -170,7 +170,7 @@ extern const fenv_t __fe_nonieee_env; #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef double femode_t; diff --git a/lib/libc/include/powerpc-linux-gnueabi/bits/socket-constants.h b/lib/libc/include/powerpc-linux-gnueabi/bits/socket-constants.h index f027d74d2ecb..903368810abe 100644 --- a/lib/libc/include/powerpc-linux-gnueabi/bits/socket-constants.h +++ b/lib/libc/include/powerpc-linux-gnueabi/bits/socket-constants.h @@ -54,7 +54,7 @@ # define SO_TIMESTAMPNS_NEW 64 # define SO_TIMESTAMPING_NEW 65 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define SO_RCVTIMEO SO_RCVTIMEO_NEW # define SO_SNDTIMEO SO_SNDTIMEO_NEW # define SO_TIMESTAMP SO_TIMESTAMP_NEW diff --git a/lib/libc/include/powerpc-linux-gnueabi/bits/struct_stat.h b/lib/libc/include/powerpc-linux-gnueabi/bits/struct_stat.h index b457cf1ad2c1..dee9eeb3678b 100644 --- a/lib/libc/include/powerpc-linux-gnueabi/bits/struct_stat.h +++ b/lib/libc/include/powerpc-linux-gnueabi/bits/struct_stat.h @@ -28,7 +28,7 @@ #if __WORDSIZE == 32 struct stat { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -79,13 +79,13 @@ struct stat # endif unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; # ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -122,7 +122,7 @@ struct stat64 # endif unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; # endif /* __USE_LARGEFILE64 */ diff --git a/lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_msqid_ds.h b/lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_msqid_ds.h index a868b0d3f0ad..1b35456eedf3 100644 --- a/lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_msqid_ds.h +++ b/lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_msqid_ds.h @@ -26,7 +26,7 @@ The type `struct msg' is opaque. */ struct msqid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm msg_perm; /* structure describing operation permission */ diff --git a/lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_semid_ds.h b/lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_semid_ds.h index 752ee290040d..306d428befed 100644 --- a/lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_semid_ds.h +++ b/lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_shmid_ds.h b/lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_shmid_ds.h index 0512a74821f4..6e4369c1ab78 100644 --- a/lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_shmid_ds.h +++ b/lib/libc/include/powerpc-linux-gnueabi/bits/types/struct_shmid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm shm_perm; /* operation permission struct */ diff --git a/lib/libc/include/powerpc-linux-gnueabi/bits/wordsize.h b/lib/libc/include/powerpc-linux-gnueabi/bits/wordsize.h index 37836f9d4e75..7b51c6738e77 100644 --- a/lib/libc/include/powerpc-linux-gnueabi/bits/wordsize.h +++ b/lib/libc/include/powerpc-linux-gnueabi/bits/wordsize.h @@ -2,10 +2,9 @@ #if defined __powerpc64__ # define __WORDSIZE 64 -# define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 -# define __WORDSIZE_TIME64_COMPAT32 0 # define __WORDSIZE32_SIZE_ULONG 0 # define __WORDSIZE32_PTRDIFF_LONG 0 -#endif \ No newline at end of file +#endif +#define __WORDSIZE_TIME64_COMPAT32 1 \ No newline at end of file diff --git a/lib/libc/include/x86-linux-gnu/gnu/lib-names-32.h b/lib/libc/include/powerpc-linux-gnueabi/gnu/lib-names-32.h similarity index 92% rename from lib/libc/include/x86-linux-gnu/gnu/lib-names-32.h rename to lib/libc/include/powerpc-linux-gnueabi/gnu/lib-names-32.h index 77fbbc46100d..af615a3d9f90 100644 --- a/lib/libc/include/x86-linux-gnu/gnu/lib-names-32.h +++ b/lib/libc/include/powerpc-linux-gnueabi/gnu/lib-names-32.h @@ -3,8 +3,7 @@ # error "Never use directly; include instead." #endif -#define LD_LINUX_SO "ld-linux.so.2" -#define LD_SO "ld-linux.so.2" +#define LD_SO "ld.so.1" #define LIBANL_SO "libanl.so.1" #define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" #define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" diff --git a/lib/libc/include/powerpc-linux-gnueabihf/bits/fenv.h b/lib/libc/include/powerpc-linux-gnueabihf/bits/fenv.h index df090306dece..d563eec30c62 100644 --- a/lib/libc/include/powerpc-linux-gnueabihf/bits/fenv.h +++ b/lib/libc/include/powerpc-linux-gnueabihf/bits/fenv.h @@ -170,7 +170,7 @@ extern const fenv_t __fe_nonieee_env; #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef double femode_t; diff --git a/lib/libc/include/powerpc-linux-gnueabihf/bits/socket-constants.h b/lib/libc/include/powerpc-linux-gnueabihf/bits/socket-constants.h index f027d74d2ecb..903368810abe 100644 --- a/lib/libc/include/powerpc-linux-gnueabihf/bits/socket-constants.h +++ b/lib/libc/include/powerpc-linux-gnueabihf/bits/socket-constants.h @@ -54,7 +54,7 @@ # define SO_TIMESTAMPNS_NEW 64 # define SO_TIMESTAMPING_NEW 65 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define SO_RCVTIMEO SO_RCVTIMEO_NEW # define SO_SNDTIMEO SO_SNDTIMEO_NEW # define SO_TIMESTAMP SO_TIMESTAMP_NEW diff --git a/lib/libc/include/powerpc-linux-gnueabihf/bits/struct_stat.h b/lib/libc/include/powerpc-linux-gnueabihf/bits/struct_stat.h index b457cf1ad2c1..dee9eeb3678b 100644 --- a/lib/libc/include/powerpc-linux-gnueabihf/bits/struct_stat.h +++ b/lib/libc/include/powerpc-linux-gnueabihf/bits/struct_stat.h @@ -28,7 +28,7 @@ #if __WORDSIZE == 32 struct stat { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -79,13 +79,13 @@ struct stat # endif unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; # ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -122,7 +122,7 @@ struct stat64 # endif unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; # endif /* __USE_LARGEFILE64 */ diff --git a/lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_msqid_ds.h b/lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_msqid_ds.h index a868b0d3f0ad..1b35456eedf3 100644 --- a/lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_msqid_ds.h +++ b/lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_msqid_ds.h @@ -26,7 +26,7 @@ The type `struct msg' is opaque. */ struct msqid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm msg_perm; /* structure describing operation permission */ diff --git a/lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_semid_ds.h b/lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_semid_ds.h index 752ee290040d..306d428befed 100644 --- a/lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_semid_ds.h +++ b/lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_shmid_ds.h b/lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_shmid_ds.h index 0512a74821f4..6e4369c1ab78 100644 --- a/lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_shmid_ds.h +++ b/lib/libc/include/powerpc-linux-gnueabihf/bits/types/struct_shmid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm shm_perm; /* operation permission struct */ diff --git a/lib/libc/include/powerpc-linux-gnueabihf/bits/wordsize.h b/lib/libc/include/powerpc-linux-gnueabihf/bits/wordsize.h index 37836f9d4e75..7b51c6738e77 100644 --- a/lib/libc/include/powerpc-linux-gnueabihf/bits/wordsize.h +++ b/lib/libc/include/powerpc-linux-gnueabihf/bits/wordsize.h @@ -2,10 +2,9 @@ #if defined __powerpc64__ # define __WORDSIZE 64 -# define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 -# define __WORDSIZE_TIME64_COMPAT32 0 # define __WORDSIZE32_SIZE_ULONG 0 # define __WORDSIZE32_PTRDIFF_LONG 0 -#endif \ No newline at end of file +#endif +#define __WORDSIZE_TIME64_COMPAT32 1 \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnueabihf/gnu/lib-names-32.h b/lib/libc/include/powerpc-linux-gnueabihf/gnu/lib-names-32.h new file mode 100644 index 000000000000..af615a3d9f90 --- /dev/null +++ b/lib/libc/include/powerpc-linux-gnueabihf/gnu/lib-names-32.h @@ -0,0 +1,26 @@ +/* This file is automatically generated. */ +#ifndef __GNU_LIB_NAMES_H +# error "Never use directly; include instead." +#endif + +#define LD_SO "ld.so.1" +#define LIBANL_SO "libanl.so.1" +#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" +#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" +#define LIBC_SO "libc.so.6" +#define LIBDL_SO "libdl.so.2" +#define LIBGCC_S_SO "libgcc_s.so.1" +#define LIBMVEC_SO "libmvec.so.1" +#define LIBM_SO "libm.so.6" +#define LIBNSL_SO "libnsl.so.1" +#define LIBNSS_COMPAT_SO "libnss_compat.so.2" +#define LIBNSS_DB_SO "libnss_db.so.2" +#define LIBNSS_DNS_SO "libnss_dns.so.2" +#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 LIBPTHREAD_SO "libpthread.so.0" +#define LIBRESOLV_SO "libresolv.so.2" +#define LIBRT_SO "librt.so.1" +#define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/fenv.h b/lib/libc/include/powerpc64-linux-gnu/bits/fenv.h index df090306dece..d563eec30c62 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/fenv.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/fenv.h @@ -170,7 +170,7 @@ extern const fenv_t __fe_nonieee_env; #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef double femode_t; diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/socket-constants.h b/lib/libc/include/powerpc64-linux-gnu/bits/socket-constants.h index f027d74d2ecb..903368810abe 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/socket-constants.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/socket-constants.h @@ -54,7 +54,7 @@ # define SO_TIMESTAMPNS_NEW 64 # define SO_TIMESTAMPING_NEW 65 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define SO_RCVTIMEO SO_RCVTIMEO_NEW # define SO_SNDTIMEO SO_SNDTIMEO_NEW # define SO_TIMESTAMP SO_TIMESTAMP_NEW diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/struct_stat.h b/lib/libc/include/powerpc64-linux-gnu/bits/struct_stat.h index b457cf1ad2c1..dee9eeb3678b 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/struct_stat.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/struct_stat.h @@ -28,7 +28,7 @@ #if __WORDSIZE == 32 struct stat { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -79,13 +79,13 @@ struct stat # endif unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; # ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -122,7 +122,7 @@ struct stat64 # endif unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; # endif /* __USE_LARGEFILE64 */ diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/types/struct_msqid_ds.h b/lib/libc/include/powerpc64-linux-gnu/bits/types/struct_msqid_ds.h index a868b0d3f0ad..1b35456eedf3 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/types/struct_msqid_ds.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/types/struct_msqid_ds.h @@ -26,7 +26,7 @@ The type `struct msg' is opaque. */ struct msqid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm msg_perm; /* structure describing operation permission */ diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/types/struct_semid_ds.h b/lib/libc/include/powerpc64-linux-gnu/bits/types/struct_semid_ds.h index 752ee290040d..306d428befed 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/types/struct_semid_ds.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/types/struct_shmid_ds.h b/lib/libc/include/powerpc64-linux-gnu/bits/types/struct_shmid_ds.h index 0512a74821f4..6e4369c1ab78 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/types/struct_shmid_ds.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/types/struct_shmid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm shm_perm; /* operation permission struct */ diff --git a/lib/libc/include/powerpc64-linux-gnu/bits/wordsize.h b/lib/libc/include/powerpc64-linux-gnu/bits/wordsize.h index 37836f9d4e75..7b51c6738e77 100644 --- a/lib/libc/include/powerpc64-linux-gnu/bits/wordsize.h +++ b/lib/libc/include/powerpc64-linux-gnu/bits/wordsize.h @@ -2,10 +2,9 @@ #if defined __powerpc64__ # define __WORDSIZE 64 -# define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 -# define __WORDSIZE_TIME64_COMPAT32 0 # define __WORDSIZE32_SIZE_ULONG 0 # define __WORDSIZE32_PTRDIFF_LONG 0 -#endif \ No newline at end of file +#endif +#define __WORDSIZE_TIME64_COMPAT32 1 \ No newline at end of file diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/fenv.h b/lib/libc/include/powerpc64le-linux-gnu/bits/fenv.h index df090306dece..d563eec30c62 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/fenv.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/fenv.h @@ -170,7 +170,7 @@ extern const fenv_t __fe_nonieee_env; #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef double femode_t; diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/socket-constants.h b/lib/libc/include/powerpc64le-linux-gnu/bits/socket-constants.h index f027d74d2ecb..903368810abe 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/socket-constants.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/socket-constants.h @@ -54,7 +54,7 @@ # define SO_TIMESTAMPNS_NEW 64 # define SO_TIMESTAMPING_NEW 65 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define SO_RCVTIMEO SO_RCVTIMEO_NEW # define SO_SNDTIMEO SO_SNDTIMEO_NEW # define SO_TIMESTAMP SO_TIMESTAMP_NEW diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/struct_stat.h b/lib/libc/include/powerpc64le-linux-gnu/bits/struct_stat.h index b457cf1ad2c1..dee9eeb3678b 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/struct_stat.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/struct_stat.h @@ -28,7 +28,7 @@ #if __WORDSIZE == 32 struct stat { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -79,13 +79,13 @@ struct stat # endif unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; # ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -122,7 +122,7 @@ struct stat64 # endif unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; # endif /* __USE_LARGEFILE64 */ diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_msqid_ds.h b/lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_msqid_ds.h index a868b0d3f0ad..1b35456eedf3 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_msqid_ds.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_msqid_ds.h @@ -26,7 +26,7 @@ The type `struct msg' is opaque. */ struct msqid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm msg_perm; /* structure describing operation permission */ diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_semid_ds.h b/lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_semid_ds.h index 752ee290040d..306d428befed 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_semid_ds.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_shmid_ds.h b/lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_shmid_ds.h index 0512a74821f4..6e4369c1ab78 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_shmid_ds.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/types/struct_shmid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm shm_perm; /* operation permission struct */ diff --git a/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h b/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h index 37836f9d4e75..7b51c6738e77 100644 --- a/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h +++ b/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h @@ -2,10 +2,9 @@ #if defined __powerpc64__ # define __WORDSIZE 64 -# define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 -# define __WORDSIZE_TIME64_COMPAT32 0 # define __WORDSIZE32_SIZE_ULONG 0 # define __WORDSIZE32_PTRDIFF_LONG 0 -#endif \ No newline at end of file +#endif +#define __WORDSIZE_TIME64_COMPAT32 1 \ No newline at end of file diff --git a/lib/libc/include/riscv32-linux-gnu/bits/fenv.h b/lib/libc/include/riscv32-linux-gnu/bits/fenv.h index 9467134bb3ed..656ef6aadf89 100644 --- a/lib/libc/include/riscv32-linux-gnu/bits/fenv.h +++ b/lib/libc/include/riscv32-linux-gnu/bits/fenv.h @@ -65,7 +65,7 @@ typedef unsigned int fenv_t; /* If the default argument is used we use this value. */ #define FE_DFL_ENV ((__const fenv_t *) -1) -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/lib/libc/include/riscv32-linux-gnu/bits/rseq.h b/lib/libc/include/riscv32-linux-gnu/bits/rseq.h deleted file mode 100644 index 5ea695ad1c3d..000000000000 --- a/lib/libc/include/riscv32-linux-gnu/bits/rseq.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Restartable Sequences architecture header. Stub version. - Copyright (C) 2021-2024 Free Software Foundation, Inc. - - 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_RSEQ_H -# error "Never use directly; include instead." -#endif - -/* RSEQ_SIG is a signature required before each abort handler code. - - It is a 32-bit value that maps to actual architecture code compiled - into applications and libraries. It needs to be defined for each - architecture. When choosing this value, it needs to be taken into - account that generating invalid instructions may have ill effects on - tools like objdump, and may also have impact on the CPU speculative - execution efficiency in some cases. */ \ No newline at end of file diff --git a/lib/libc/include/riscv32-linux-gnu/bits/typesizes.h b/lib/libc/include/riscv32-linux-gnu/bits/typesizes.h deleted file mode 100644 index d875caa94e85..000000000000 --- a/lib/libc/include/riscv32-linux-gnu/bits/typesizes.h +++ /dev/null @@ -1,107 +0,0 @@ -/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI. - Copyright (C) 2011-2024 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_TYPES_H -# error "Never include directly; use instead." -#endif - -#ifndef _BITS_TYPESIZES_H -#define _BITS_TYPESIZES_H 1 - -/* 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 __INO64_T_TYPE __UQUAD_TYPE -#define __MODE_T_TYPE __U32_TYPE -#define __NLINK_T_TYPE __U32_TYPE -#define __OFF64_T_TYPE __SQUAD_TYPE -#define __PID_T_TYPE __S32_TYPE -#define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT64_T_TYPE __UQUAD_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 __USECONDS_T_TYPE __U32_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 __S32_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 - -#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. */ -# define __OFF_T_MATCHES_OFF64_T 1 - -/* Same for ino_t and ino64_t. */ -# define __INO_T_MATCHES_INO64_T 1 - -/* 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 (__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 - - -#endif /* bits/typesizes.h */ \ No newline at end of file diff --git a/lib/libc/include/riscv32-linux-gnu/gnu/lib-names-ilp32d.h b/lib/libc/include/riscv32-linux-gnu/gnu/lib-names-ilp32d.h index 5d0f5d7d666d..33fd7061de58 100644 --- a/lib/libc/include/riscv32-linux-gnu/gnu/lib-names-ilp32d.h +++ b/lib/libc/include/riscv32-linux-gnu/gnu/lib-names-ilp32d.h @@ -24,4 +24,4 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" -#define LIBUTIL_SO "libutil.so.1" +#define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/riscv32-linux-gnu/gnu/stubs-ilp32d.h b/lib/libc/include/riscv32-linux-gnu/gnu/stubs-ilp32d.h index 4d4c0d146a40..a0a2064062ff 100644 --- a/lib/libc/include/riscv32-linux-gnu/gnu/stubs-ilp32d.h +++ b/lib/libc/include/riscv32-linux-gnu/gnu/stubs-ilp32d.h @@ -21,4 +21,4 @@ #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_stty +#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/riscv64-linux-gnu/bits/fenv.h b/lib/libc/include/riscv64-linux-gnu/bits/fenv.h index 9467134bb3ed..656ef6aadf89 100644 --- a/lib/libc/include/riscv64-linux-gnu/bits/fenv.h +++ b/lib/libc/include/riscv64-linux-gnu/bits/fenv.h @@ -65,7 +65,7 @@ typedef unsigned int fenv_t; /* If the default argument is used we use this value. */ #define FE_DFL_ENV ((__const fenv_t *) -1) -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/lib/libc/include/riscv64-linux-gnu/bits/floatn.h b/lib/libc/include/riscv64-linux-gnu/bits/floatn.h deleted file mode 100644 index 20c1af5c2e78..000000000000 --- a/lib/libc/include/riscv64-linux-gnu/bits/floatn.h +++ /dev/null @@ -1,97 +0,0 @@ -/* Macros to control TS 18661-3 glibc features on ldbl-128 platforms. - Copyright (C) 2017-2024 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_FLOATN_H -#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 -# 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 - -/* 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 - -/* 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 - -#ifndef __ASSEMBLER__ - -/* Defined to concatenate the literal suffix to be used with _Float128 - types, if __HAVE_FLOAT128 is 1. */ -# if __HAVE_FLOAT128 -# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) -/* The literal suffix f128 exists only since GCC 7.0. */ -# define __f128(x) x##l -# else -# define __f128(x) x##f128 -# endif -# endif - -/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ -# if __HAVE_FLOAT128 -# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) -# define __CFLOAT128 _Complex long double -# else -# define __CFLOAT128 _Complex _Float128 -# endif -# endif - -/* The remaining of this file provides support for older compilers. */ -# if __HAVE_FLOAT128 - -/* The type _Float128 exists only since GCC 7.0. */ -# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) -typedef long double _Float128; -# endif - -/* Various built-in functions do not 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)) -# endif - -# endif - -#endif /* !__ASSEMBLER__. */ - -#include - -#endif /* _BITS_FLOATN_H */ \ No newline at end of file diff --git a/lib/libc/include/riscv64-linux-gnu/bits/rseq.h b/lib/libc/include/riscv64-linux-gnu/bits/rseq.h deleted file mode 100644 index 5ea695ad1c3d..000000000000 --- a/lib/libc/include/riscv64-linux-gnu/bits/rseq.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Restartable Sequences architecture header. Stub version. - Copyright (C) 2021-2024 Free Software Foundation, Inc. - - 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_RSEQ_H -# error "Never use directly; include instead." -#endif - -/* RSEQ_SIG is a signature required before each abort handler code. - - It is a 32-bit value that maps to actual architecture code compiled - into applications and libraries. It needs to be defined for each - architecture. When choosing this value, it needs to be taken into - account that generating invalid instructions may have ill effects on - tools like objdump, and may also have impact on the CPU speculative - execution efficiency in some cases. */ \ No newline at end of file diff --git a/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h b/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h deleted file mode 100644 index d875caa94e85..000000000000 --- a/lib/libc/include/riscv64-linux-gnu/bits/typesizes.h +++ /dev/null @@ -1,107 +0,0 @@ -/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI. - Copyright (C) 2011-2024 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_TYPES_H -# error "Never include directly; use instead." -#endif - -#ifndef _BITS_TYPESIZES_H -#define _BITS_TYPESIZES_H 1 - -/* 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 __INO64_T_TYPE __UQUAD_TYPE -#define __MODE_T_TYPE __U32_TYPE -#define __NLINK_T_TYPE __U32_TYPE -#define __OFF64_T_TYPE __SQUAD_TYPE -#define __PID_T_TYPE __S32_TYPE -#define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT64_T_TYPE __UQUAD_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 __USECONDS_T_TYPE __U32_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 __S32_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 - -#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. */ -# define __OFF_T_MATCHES_OFF64_T 1 - -/* Same for ino_t and ino64_t. */ -# define __INO_T_MATCHES_INO64_T 1 - -/* 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 (__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 - - -#endif /* bits/typesizes.h */ \ No newline at end of file diff --git a/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64d.h b/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64d.h index e16743eb1665..0b66bda6d611 100644 --- a/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64d.h +++ b/lib/libc/include/riscv64-linux-gnu/gnu/lib-names-lp64d.h @@ -24,4 +24,4 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" -#define LIBUTIL_SO "libutil.so.1" +#define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64d.h b/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64d.h index 4d4c0d146a40..a0a2064062ff 100644 --- a/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64d.h +++ b/lib/libc/include/riscv64-linux-gnu/gnu/stubs-lp64d.h @@ -21,4 +21,4 @@ #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn -#define __stub_stty +#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 1643aa1623f4..a5db672bd016 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/fenv.h +++ b/lib/libc/include/s390x-linux-gnu/bits/fenv.h @@ -90,7 +90,7 @@ typedef struct # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/lib/libc/include/s390x-linux-gnu/bits/floatn.h b/lib/libc/include/s390x-linux-gnu/bits/floatn.h deleted file mode 100644 index 20c1af5c2e78..000000000000 --- a/lib/libc/include/s390x-linux-gnu/bits/floatn.h +++ /dev/null @@ -1,97 +0,0 @@ -/* Macros to control TS 18661-3 glibc features on ldbl-128 platforms. - Copyright (C) 2017-2024 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_FLOATN_H -#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 -# 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 - -/* 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 - -/* 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 - -#ifndef __ASSEMBLER__ - -/* Defined to concatenate the literal suffix to be used with _Float128 - types, if __HAVE_FLOAT128 is 1. */ -# if __HAVE_FLOAT128 -# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) -/* The literal suffix f128 exists only since GCC 7.0. */ -# define __f128(x) x##l -# else -# define __f128(x) x##f128 -# endif -# endif - -/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ -# if __HAVE_FLOAT128 -# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) -# define __CFLOAT128 _Complex long double -# else -# define __CFLOAT128 _Complex _Float128 -# endif -# endif - -/* The remaining of this file provides support for older compilers. */ -# if __HAVE_FLOAT128 - -/* The type _Float128 exists only since GCC 7.0. */ -# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) -typedef long double _Float128; -# endif - -/* Various built-in functions do not 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)) -# endif - -# endif - -#endif /* !__ASSEMBLER__. */ - -#include - -#endif /* _BITS_FLOATN_H */ \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/struct_stat.h b/lib/libc/include/s390x-linux-gnu/bits/struct_stat.h index 249df06b3c87..393a1eb3bc9c 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/struct_stat.h +++ b/lib/libc/include/s390x-linux-gnu/bits/struct_stat.h @@ -65,7 +65,7 @@ struct stat #else struct stat { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -166,7 +166,7 @@ struct stat64 # else struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ diff --git a/lib/libc/include/sparc-linux-gnu/a.out.h b/lib/libc/include/sparc-linux-gnu/a.out.h new file mode 100644 index 000000000000..4002e18c9190 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/a.out.h @@ -0,0 +1,174 @@ +#ifndef __A_OUT_GNU_H__ +#define __A_OUT_GNU_H__ + +#include + +#define __GNU_EXEC_MACROS__ + +struct exec +{ + unsigned char a_dynamic:1; /* A __DYNAMIC is in this image. */ + unsigned char a_toolversion:7; + unsigned char a_machtype; + unsigned short a_info; + unsigned int a_text; /* Length of text, in bytes. */ + unsigned int a_data; /* Length of data, in bytes. */ + unsigned int a_bss; /* Length of bss, in bytes. */ + unsigned int a_syms; /* Length of symbol table, in bytes. */ + unsigned int a_entry; /* Where program begins. */ + unsigned int a_trsize; + unsigned int a_drsize; +}; + +enum machine_type +{ + M_OLDSUN2 = 0, + M_68010 = 1, + M_68020 = 2, + M_SPARC = 3, + M_386 = 100, + M_MIPS1 = 151, + M_MIPS2 = 152 +}; + +#define N_MAGIC(exec) ((exec).a_info & 0xffff) +#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff)) +#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff) +#define N_SET_INFO(exec, magic, type, flags) \ + ((exec).a_info = ((magic) & 0xffff) \ + | (((int)(type) & 0xff) << 16) \ + | (((flags) & 0xff) << 24)) +#define N_SET_MAGIC(exec, magic) \ + ((exec).a_info = ((exec).a_info & 0xffff0000) | ((magic) & 0xffff)) +#define N_SET_MACHTYPE(exec, machtype) \ + ((exec).a_info = \ + ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16)) +#define N_SET_FLAGS(exec, flags) \ + ((exec).a_info = \ + ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24)) + +/* Code indicating object file or impure executable. */ +#define OMAGIC 0407 +/* Code indicating pure executable. */ +#define NMAGIC 0410 +/* Code indicating demand-paged executable. */ +#define ZMAGIC 0413 +/* This indicates a demand-paged executable with the header in the text. + The first page is unmapped to help trap NULL pointer references. */ +#define QMAGIC 0314 +/* Code indicating core file. */ +#define CMAGIC 0421 + +#define N_TRSIZE(a) ((a).a_trsize) +#define N_DRSIZE(a) ((a).a_drsize) +#define N_SYMSIZE(a) ((a).a_syms) +#define N_BADMAG(x) \ + (N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC \ + && N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC) +#define _N_HDROFF(x) (1024 - sizeof (struct exec)) +#define N_TXTOFF(x) \ + (N_MAGIC(x) == ZMAGIC ? 0 : sizeof (struct exec)) +#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text) +#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data) +#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x)) +#define N_SYMOFF(x) \ + (N_TXTOFF(x) + (x).a_text + (x).a_data + (x).a_trsize + (x).a_drsize) +#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x)) + +#define SPARC_PGSIZE 0x2000 + +/* Address of text segment in memory after it is loaded. */ +#define N_TXTADDR(x) \ + (unsigned long)(((N_MAGIC(x) == ZMAGIC) && ((x).a_entry < SPARC_PGSIZE)) \ + ? 0 : SPARC_PGSIZE) + +/* Address of data segment in memory after it is loaded. */ +#define SEGMENT_SIZE SPARC_PGSIZE + +#define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1)) +#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text) + +#define N_DATADDR(x) \ + (N_MAGIC(x)==OMAGIC \ + ? (N_TXTADDR(x) + (x).a_text) \ + : (unsigned long)(_N_SEGMENT_ROUND (_N_TXTENDADDR(x)))) +#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data) + +#if !defined (N_NLIST_DECLARED) +struct nlist +{ + union + { + char *n_name; + struct nlist *n_next; + long n_strx; + } n_un; + unsigned char n_type; + char n_other; + short n_desc; + unsigned long n_value; +}; +#endif /* no N_NLIST_DECLARED. */ + +#define N_UNDF 0 +#define N_ABS 2 +#define N_TEXT 4 +#define N_DATA 6 +#define N_BSS 8 +#define N_FN 15 +#define N_EXT 1 +#define N_TYPE 036 +#define N_STAB 0340 +#define N_INDR 0xa +#define N_SETA 0x14 /* Absolute set element symbol. */ +#define N_SETT 0x16 /* Text set element symbol. */ +#define N_SETD 0x18 /* Data set element symbol. */ +#define N_SETB 0x1A /* Bss set element symbol. */ +#define N_SETV 0x1C /* Pointer to set vector in data area. */ + +#if !defined (N_RELOCATION_INFO_DECLARED) +enum reloc_type +{ + RELOC_8, + RELOC_16, + RELOC_32, + RELOC_DISP8, + RELOC_DISP16, + RELOC_DISP32, + RELOC_WDISP30, + RELOC_WDISP22, + RELOC_HI22, + RELOC_22, + RELOC_13, + RELOC_LO10, + RELOC_SFA_BASE, + RELOC_SFA_OFF13, + RELOC_BASE10, + RELOC_BASE13, + RELOC_BASE22, + RELOC_PC10, + RELOC_PC22, + RELOC_JMP_TBL, + RELOC_SEGOFF16, + RELOC_GLOB_DAT, + RELOC_JMP_SLOT, + RELOC_RELATIVE +}; + +/* This structure describes a single relocation to be performed. + The text-relocation section of the file is a vector of these structures, + all of which apply to the text section. + Likewise, the data-relocation section applies to the data section. */ + +struct relocation_info +{ + unsigned int r_address; + unsigned int r_index:24; + unsigned int r_extern:1; + int r_pad:2; + enum reloc_type r_type:5; + int r_addend; +}; +#endif /* no N_RELOCATION_INFO_DECLARED. */ + +#endif /* __A_OUT_GNU_H__ */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/a.out.h b/lib/libc/include/sparc-linux-gnu/bits/a.out.h new file mode 100644 index 000000000000..c189482c42bc --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/a.out.h @@ -0,0 +1,13 @@ +#ifndef __A_OUT_GNU_H__ +# error "Never use directly; include instead." +#endif + +#include + +#if __WORDSIZE == 64 + +/* Signal to users of this header that this architecture really doesn't + support a.out binary format. */ +#define __NO_A_OUT_SUPPORT 1 + +#endif \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/endianness.h b/lib/libc/include/sparc-linux-gnu/bits/endianness.h new file mode 100644 index 000000000000..8b14090d0ec5 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/endianness.h @@ -0,0 +1,16 @@ +#ifndef _BITS_ENDIANNESS_H +#define _BITS_ENDIANNESS_H 1 + +#ifndef _BITS_ENDIAN_H +# error "Never use directly; include instead." +#endif + +/* Sparc is big-endian, but v9 supports endian conversion on loads/stores + and GCC supports such a mode. Be prepared. */ +#ifdef __LITTLE_ENDIAN__ +# define __BYTE_ORDER __LITTLE_ENDIAN +#else +# define __BYTE_ORDER __BIG_ENDIAN +#endif + +#endif /* bits/endianness.h */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/environments.h b/lib/libc/include/sparc-linux-gnu/bits/environments.h new file mode 100644 index 000000000000..39a7b5b3c9d4 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/environments.h @@ -0,0 +1,96 @@ +/* Copyright (C) 1999-2024 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 _UNISTD_H +# error "Never include this file directly. Use instead" +#endif + +#include + +/* This header should define the following symbols under the described + situations. A value `1' means that the model is always supported, + `-1' means it is never supported. Undefined means it cannot be + statically decided. + + _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type + _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type + + _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type + _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type + + The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, + _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, + _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were + used in previous versions of the Unix standard and are available + only for compatibility. +*/ + +#if __WORDSIZE == 64 + +/* 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 +# define _POSIX_V6_LPBIG_OFFBIG -1 +# define _XBS5_LPBIG_OFFBIG -1 + +/* By default we have 64-bit wide `long int', pointers and `off_t'. */ +# define _POSIX_V7_LP64_OFF64 1 +# define _POSIX_V6_LP64_OFF64 1 +# define _XBS5_LP64_OFF64 1 + +#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 +# 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 + +/* 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. */ + +/* 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. */ + +#endif /* __WORDSIZE == 32 */ + +#define __ILP32_OFF32_CFLAGS "-m32" +#define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +#define __ILP32_OFF32_LDFLAGS "-m32" +#define __ILP32_OFFBIG_LDFLAGS "-m32" +#define __LP64_OFF64_CFLAGS "-m64" +#define __LP64_OFF64_LDFLAGS "-m64" \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/epoll.h b/lib/libc/include/sparc-linux-gnu/bits/epoll.h new file mode 100644 index 000000000000..4a6657d21f7f --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/epoll.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2002-2024 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_EPOLL_H +# error "Never use directly; include instead." +#endif + +/* Flags to be passed to epoll_create1. */ +enum + { + EPOLL_CLOEXEC = 0x400000 +#define EPOLL_CLOEXEC EPOLL_CLOEXEC + }; \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/errno.h b/lib/libc/include/sparc-linux-gnu/bits/errno.h new file mode 100644 index 000000000000..c447adaef269 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/errno.h @@ -0,0 +1,53 @@ +/* Error constants. Linux/Sparc specific version. + Copyright (C) 1996-2024 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_ERRNO_H +#define _BITS_ERRNO_H 1 + +#if !defined _ERRNO_H +# error "Never include directly; use instead." +#endif + +# include + +/* Older Linux headers do not define these constants. */ +# ifndef ENOTSUP +# define ENOTSUP EOPNOTSUPP +# endif + +# ifndef ECANCELED +# define ECANCELED 127 +# endif + +# ifndef EOWNERDEAD +# define EOWNERDEAD 132 +# endif + +# ifndef ENOTRECOVERABLE +# define ENOTRECOVERABLE 133 +# endif + +# ifndef ERFKILL +# define ERFKILL 134 +# endif + +# ifndef EHWPOISON +# define EHWPOISON 135 +# endif + +#endif /* bits/errno.h. */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/eventfd.h b/lib/libc/include/sparc-linux-gnu/bits/eventfd.h new file mode 100644 index 000000000000..cc5da89bddf1 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/eventfd.h @@ -0,0 +1,31 @@ +/* Copyright (C) 2007-2024 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_EVENTFD_H +# error "Never use directly; include instead." +#endif + +/* Flags for eventfd. */ +enum + { + EFD_SEMAPHORE = 0x000001, +#define EFD_SEMAPHORE EFD_SEMAPHORE + EFD_CLOEXEC = 0x400000, +#define EFD_CLOEXEC EFD_CLOEXEC + EFD_NONBLOCK = 0x004000 +#define EFD_NONBLOCK EFD_NONBLOCK + }; \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/fcntl.h b/lib/libc/include/sparc-linux-gnu/bits/fcntl.h new file mode 100644 index 000000000000..b84f016059c6 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/fcntl.h @@ -0,0 +1,101 @@ +/* O_*, F_*, FD_* bit values for Linux/SPARC. + Copyright (C) 1995-2024 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 _FCNTL_H +# error "Never use directly; include instead." +#endif + +#include + +#define O_APPEND 0x0008 +#define O_ASYNC 0x0040 +#define O_CREAT 0x0200 /* not fcntl */ +#define O_TRUNC 0x0400 /* not fcntl */ +#define O_EXCL 0x0800 /* not fcntl */ +#define O_SYNC 0x802000 +#define O_NONBLOCK 0x4000 +#define O_NDELAY (0x0004 | O_NONBLOCK) +#define O_NOCTTY 0x8000 /* not fcntl */ + +#define __O_DIRECTORY 0x10000 /* must be a directory */ +#define __O_NOFOLLOW 0x20000 /* don't follow links */ +#define __O_CLOEXEC 0x400000 /* Set close_on_exit. */ + +#define __O_DIRECT 0x100000 /* direct disk access hint */ +#define __O_NOATIME 0x200000 /* Do not set atime. */ +#define __O_PATH 0x1000000 /* Resolve pathname but do not open file. */ +#define __O_TMPFILE 0x2010000 /* Atomically create nameless file. */ + +#if __WORDSIZE == 64 +# define __O_LARGEFILE 0 +#else +# define __O_LARGEFILE 0x40000 +#endif + +#define __O_DSYNC 0x2000 /* Synchronize data. */ + + +#define __F_GETOWN 5 /* Get owner (process receiving SIGIO). */ +#define __F_SETOWN 6 /* Set owner (process receiving SIGIO). */ + +#ifndef __USE_FILE_OFFSET64 +# define F_GETLK 7 /* Get record locking info. */ +# define F_SETLK 8 /* Set record locking info (non-blocking). */ +# define F_SETLKW 9 /* Set record locking info (blocking). */ +#endif + +#if __WORDSIZE == 64 +# define F_GETLK64 7 /* Get record locking info. */ +# define F_SETLK64 8 /* Set record locking info (non-blocking). */ +# define F_SETLKW64 9 /* Set record locking info (blocking). */ +#endif + +/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ +#define F_RDLCK 1 /* Read lock. */ +#define F_WRLCK 2 /* Write lock. */ +#define F_UNLCK 3 /* Remove lock. */ + +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ +#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. */ +#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. */ + short int __glibc_reserved; + }; + +#ifdef __USE_LARGEFILE64 +struct flock64 + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + short int __glibc_reserved; + }; +#endif + +/* Include generic Linux declarations. */ +#include \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/fenv.h b/lib/libc/include/sparc-linux-gnu/bits/fenv.h new file mode 100644 index 000000000000..a44f0d86fbff --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/fenv.h @@ -0,0 +1,92 @@ +/* Copyright (C) 1997-2024 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 _FENV_H +# error "Never use directly; include instead." +#endif + +#include + + +/* Define bits representing the exception. We use the bit positions + of the appropriate accrued exception bits from the FSR. */ +enum + { + FE_INVALID = +#define FE_INVALID (1 << 9) + FE_INVALID, + FE_OVERFLOW = +#define FE_OVERFLOW (1 << 8) + FE_OVERFLOW, + FE_UNDERFLOW = +#define FE_UNDERFLOW (1 << 7) + FE_UNDERFLOW, + FE_DIVBYZERO = +#define FE_DIVBYZERO (1 << 6) + FE_DIVBYZERO, + FE_INEXACT = +#define FE_INEXACT (1 << 5) + FE_INEXACT + }; + +#define FE_ALL_EXCEPT \ + (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) + +/* The Sparc 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 (0 << 30) + FE_TONEAREST, + FE_TOWARDZERO = +#define FE_TOWARDZERO (1 << 30) + FE_TOWARDZERO, + FE_UPWARD = +#define FE_UPWARD (-0x7fffffff - 1) /* (2 << 30) */ + FE_UPWARD, + FE_DOWNWARD = +#define FE_DOWNWARD (-0x40000000) /* (3 << 30) */ + FE_DOWNWARD + }; + +#define __FE_ROUND_MASK (3U << 30) + + +/* Type representing exception flags. */ +typedef unsigned long int fexcept_t; + + +/* Type representing floating-point environment. */ +typedef unsigned long int fenv_t; + +/* If the default argument is used we use this value. */ +#define FE_DFL_ENV ((const fenv_t *) -1) + +#ifdef __USE_GNU +/* Floating-point environment where none of the exception is masked. */ +# define FE_NOMASK_ENV ((const fenv_t *) -2) +#endif + +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) +/* Type representing floating-point control modes. */ +typedef unsigned long int femode_t; + +/* Default floating-point control modes. */ +# define FE_DFL_MODE ((const femode_t *) -1L) +#endif \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/hwcap.h b/lib/libc/include/sparc-linux-gnu/bits/hwcap.h new file mode 100644 index 000000000000..b1b38e066c7d --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/hwcap.h @@ -0,0 +1,51 @@ +/* Defines for bits in AT_HWCAP. + Copyright (C) 2011-2024 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(_SYS_AUXV_H) && !defined(_SYSDEPS_SYSDEP_H) +# error "Never include directly; use instead." +#endif + +#define HWCAP_SPARC_FLUSH 0x00000001 +#define HWCAP_SPARC_STBAR 0x00000002 +#define HWCAP_SPARC_SWAP 0x00000004 +#define HWCAP_SPARC_MULDIV 0x00000008 +#define HWCAP_SPARC_V9 0x00000010 +#define HWCAP_SPARC_ULTRA3 0x00000020 +#define HWCAP_SPARC_BLKINIT 0x00000040 +#define HWCAP_SPARC_N2 0x00000080 +#define HWCAP_SPARC_MUL32 0x00000100 +#define HWCAP_SPARC_DIV32 0x00000200 +#define HWCAP_SPARC_FSMULD 0x00000400 +#define HWCAP_SPARC_V8PLUS 0x00000800 +#define HWCAP_SPARC_POPC 0x00001000 +#define HWCAP_SPARC_VIS 0x00002000 +#define HWCAP_SPARC_VIS2 0x00004000 +#define HWCAP_SPARC_ASI_BLK_INIT 0x00008000 +#define HWCAP_SPARC_FMAF 0x00010000 +#define HWCAP_SPARC_VIS3 0x00020000 +#define HWCAP_SPARC_HPC 0x00040000 +#define HWCAP_SPARC_RANDOM 0x00080000 +#define HWCAP_SPARC_TRANS 0x00100000 +#define HWCAP_SPARC_FJFMAU 0x00200000 +#define HWCAP_SPARC_IMA 0x00400000 +#define HWCAP_SPARC_ASI_CACHE_SPARING \ + 0x00800000 +#define HWCAP_SPARC_PAUSE 0x01000000 +#define HWCAP_SPARC_CBCOND 0x02000000 +#define HWCAP_SPARC_CRYPTO 0x04000000 +#define HWCAP_SPARC_ADP 0x08000000 \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/inotify.h b/lib/libc/include/sparc-linux-gnu/bits/inotify.h new file mode 100644 index 000000000000..d88d110e9306 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/inotify.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2005-2024 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_INOTIFY_H +# error "Never use directly; include instead." +#endif + +/* Flags for the parameter of inotify_init1. */ +enum + { + IN_CLOEXEC = 0x400000, +#define IN_CLOEXEC IN_CLOEXEC + IN_NONBLOCK = 0x004000 +#define IN_NONBLOCK IN_NONBLOCK + }; \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/ioctls.h b/lib/libc/include/sparc-linux-gnu/bits/ioctls.h new file mode 100644 index 000000000000..bc5b3adfa533 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/ioctls.h @@ -0,0 +1,36 @@ +/* Copyright (C) 1996-2024 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_IOCTL_H +# error "Never use directly; include instead." +#endif + +/* Use the definitions from the kernel header files. */ +#include + +/* Oh well, this is necessary since the kernel data structure is + different from the user-level version. */ +#undef TCGETS +#undef TCSETS +#undef TCSETSW +#undef TCSETSF +#define TCGETS _IOR ('T', 8, char[36]) +#define TCSETS _IOW ('T', 9, char[36]) +#define TCSETSW _IOW ('T', 10, char[36]) +#define TCSETSF _IOW ('T', 11, char[36]) + +#include \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/ipc-perm.h b/lib/libc/include/sparc-linux-gnu/bits/ipc-perm.h new file mode 100644 index 000000000000..43000f07b39d --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/ipc-perm.h @@ -0,0 +1,36 @@ +/* struct ipc_perm definition. Linux/sparc version. + Copyright (C) 1995-2024 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_IPC_H +# error "Never use directly; include instead." +#endif + +/* Data structure used to pass permission information to IPC operations. */ +struct ipc_perm + { + __key_t __key; /* Key. */ + __uid_t uid; /* Owner's user ID. */ + __gid_t gid; /* Owner's group ID. */ + __uid_t cuid; /* Creator's user ID. */ + __gid_t cgid; /* Creator's group ID. */ + __mode_t mode; /* Read/write permission. */ + unsigned short int __pad1; + unsigned short int __seq; /* Sequence number. */ + __extension__ unsigned long long int __glibc_reserved1; + __extension__ unsigned long long int __glibc_reserved2; + }; \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/link.h b/lib/libc/include/sparc-linux-gnu/bits/link.h new file mode 100644 index 000000000000..6b6060445c91 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/link.h @@ -0,0 +1,99 @@ +/* Machine-specific audit interfaces for dynamic linker. SPARC version. + Copyright (C) 2005-2024 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 _LINK_H +# error "Never include directly; use instead." +#endif + +#if __WORDSIZE == 32 + +typedef struct La_sparc32_regs +{ + uint32_t lr_lreg[8]; /* %l0 through %l7 */ + uint32_t lr_reg[6]; /* %o0 through %o5 */ + uint32_t lr_sp; /* %o6 */ + uint32_t lr_ra; /* %o7 */ + uint32_t lr_struct; /* Pass-by-reference struct pointer */ +} La_sparc32_regs; + +typedef struct La_sparc32_retval +{ + uint32_t lrv_reg[2]; /* %o0 and %o1 */ + double lrv_fpreg[2]; /* %f0 and %f2 */ +} La_sparc32_retval; + +#else + +typedef struct La_sparc64_regs +{ + uint64_t lr_lreg[8]; /* %l0 through %l7 */ + uint64_t lr_reg[6]; /* %o0 through %o5 */ + uint64_t lr_sp; /* %o6 */ + uint64_t lr_ra; /* %o7 */ + double lr_fpreg[16]; /* %f0 through %f30 */ +} La_sparc64_regs; + +typedef struct La_sparc64_retval +{ + uint64_t lrv_reg[4]; /* %o0 through %o3 */ + double lrv_fprev[4]; /* %f0 through %f8 */ +} La_sparc64_retval; + +#endif + +__BEGIN_DECLS + +#if __WORDSIZE == 32 + +extern Elf32_Addr la_sparc32_gnu_pltenter (Elf32_Sym *__sym, + unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + La_sparc32_regs *__regs, + unsigned int *__flags, + const char *__symname, + long int *__framesizep); +extern unsigned int la_sparc32_gnu_pltexit (Elf32_Sym *__sym, + unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + const La_sparc32_regs *__inregs, + La_sparc32_retval *__outregs, + const char *__symname); + +#else + +extern Elf64_Addr la_sparc64_gnu_pltenter (Elf64_Sym *__sym, + unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + La_sparc64_regs *__regs, + unsigned int *__flags, + const char *__symname, + long int *__framesizep); +extern unsigned int la_sparc64_gnu_pltexit (Elf64_Sym *__sym, + unsigned int __ndx, + uintptr_t *__refcook, + uintptr_t *__defcook, + const La_sparc64_regs *__inregs, + La_sparc64_retval *__outregs, + const char *__symname); + +#endif + +__END_DECLS \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/long-double.h b/lib/libc/include/sparc-linux-gnu/bits/long-double.h new file mode 100644 index 000000000000..2dbe771fe7d5 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/long-double.h @@ -0,0 +1,27 @@ +/* Properties of long double type. SPARC version. + Copyright (C) 2016-2024 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 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 + +#if !defined __NO_LONG_DOUBLE_MATH && __WORDSIZE == 32 +# define __LONG_DOUBLE_MATH_OPTIONAL 1 +# ifndef __LONG_DOUBLE_128__ +# define __NO_LONG_DOUBLE_MATH 1 +# endif +#endif +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/mman.h b/lib/libc/include/sparc-linux-gnu/bits/mman.h new file mode 100644 index 000000000000..156c6ab93280 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/mman.h @@ -0,0 +1,53 @@ +/* Definitions for POSIX memory map interface. Linux/SPARC version. + Copyright (C) 1997-2024 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_MMAN_H +# error "Never use directly; include instead." +#endif + +/* The following definitions basically come from the kernel headers. + But the kernel header is not namespace clean. */ + + +/* These are Linux-specific. */ +#define MAP_GROWSDOWN 0x0200 /* Stack-like segment. */ +#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ +#define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */ +#define MAP_LOCKED 0x0100 /* Lock the mapping. */ +#define MAP_NORESERVE 0x0040 /* Don't check for reservations. */ +#define _MAP_NEW 0x80000000 /* Binary compatibility with SunOS. */ +#define MAP_POPULATE 0x8000 /* Populate (prefault) pagetables. */ +#define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ +#define MAP_STACK 0x20000 /* Allocation is for a stack. */ +#define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +#define MAP_SYNC 0x80000 /* Perform synchronous page + faults for the mapping. */ +#define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap + underlying mapping. */ + +/* Flags for `mlockall'. */ +#define MCL_CURRENT 0x2000 /* Lock all currently mapped pages. */ +#define MCL_FUTURE 0x4000 /* Lock all additions to address + space. */ +#define MCL_ONFAULT 0x8000 /* Lock all pages that are + faulted in. */ +/* Include generic Linux declarations. */ +#include + +/* Other flags. */ +#define MAP_RENAME MAP_ANONYMOUS \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/poll.h b/lib/libc/include/sparc-linux-gnu/bits/poll.h new file mode 100644 index 000000000000..b24e20b7e154 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/poll.h @@ -0,0 +1,49 @@ +/* Copyright (C) 1997-2024 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_POLL_H +# error "Never use directly; include instead." +#endif + +/* Event types that can be polled for. These bits may be set in `events' + to indicate the interesting event types; they will appear in `revents' + to indicate the status of the file descriptor. */ +#define POLLIN 0x001 /* There is data to read. */ +#define POLLPRI 0x002 /* There is urgent data to read. */ +#define POLLOUT 0x004 /* Writing now will not block. */ + +#if defined __USE_XOPEN || defined __USE_XOPEN2K8 +/* These values are defined in XPG4.2. */ +# define POLLRDNORM 0x040 /* Normal data may be read. */ +# define POLLRDBAND 0x080 /* Priority data may be read. */ +# define POLLWRNORM POLLOUT /* Writing now will not block. */ +# define POLLWRBAND 0x100 /* Priority data may be written. */ +#endif + +#ifdef __USE_GNU +/* These are extensions for Linux. */ +# define POLLMSG 0x200 +# define POLLREMOVE 0x400 +# define POLLRDHUP 0x800 +#endif + +/* Event types always implicitly polled for. These bits need not be set in + `events', but they will appear in `revents' to indicate the status of + the file descriptor. */ +#define POLLERR 0x008 /* Error condition. */ +#define POLLHUP 0x010 /* Hung up. */ +#define POLLNVAL 0x020 /* Invalid polling request. */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/procfs-extra.h b/lib/libc/include/sparc-linux-gnu/bits/procfs-extra.h new file mode 100644 index 000000000000..80f97107c348 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/procfs-extra.h @@ -0,0 +1,88 @@ +/* Extra sys/procfs.h definitions. SPARC version. + Copyright (C) 1996-2024 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_PROCFS_H +# error "Never include directly; use instead." +#endif + +#if __WORDSIZE == 64 + +/* Provide 32-bit variants so that BFD can read 32-bit + core files. */ +#define ELF_NGREG32 38 +typedef struct + { + union + { + unsigned int pr_regs[32]; + double pr_dregs[16]; + } pr_fr; + unsigned int __glibc_reserved; + unsigned int pr_fsr; + unsigned char pr_qcnt; + unsigned char pr_q_entrysize; + unsigned char pr_en; + unsigned int pr_q[64]; + } elf_fpregset_t32; + +typedef unsigned int elf_greg_t32; +typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG32]; + +struct elf_prstatus32 + { + struct elf_siginfo pr_info; /* Info associated with signal. */ + short int pr_cursig; /* Current signal. */ + unsigned int pr_sigpend; /* Set of pending signals. */ + unsigned int pr_sighold; /* Set of held signals. */ + __pid_t pr_pid; + __pid_t pr_ppid; + __pid_t pr_pgrp; + __pid_t pr_sid; + struct + { + int tv_sec, tv_usec; + } pr_utime, /* User time. */ + pr_stime, /* System time. */ + pr_cutime, /* Cumulative user time. */ + pr_cstime; /* Cumulative system time. */ + elf_gregset_t32 pr_reg; /* GP registers. */ + int pr_fpvalid; /* True if math copro being used. */ + }; + +struct elf_prpsinfo32 + { + char pr_state; /* Numeric process state. */ + char pr_sname; /* Char for pr_state. */ + char pr_zomb; /* Zombie. */ + char pr_nice; /* Nice val. */ + unsigned int pr_flag; /* Flags. */ + unsigned short int pr_uid; + unsigned short int pr_gid; + int pr_pid, pr_ppid, pr_pgrp, pr_sid; + /* Lots missing */ + char pr_fname[16]; /* Filename of executable. */ + char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ + }; + +typedef elf_gregset_t32 prgregset32_t; +typedef elf_fpregset_t32 prfpregset32_t; + +typedef struct elf_prstatus32 prstatus32_t; +typedef struct elf_prpsinfo32 prpsinfo32_t; + +#endif /* sparc64 */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/procfs-id.h b/lib/libc/include/sparc-linux-gnu/bits/procfs-id.h new file mode 100644 index 000000000000..ab400e205f3b --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/procfs-id.h @@ -0,0 +1,30 @@ +/* Types of pr_uid and pr_gid in struct elf_prpsinfo. SPARC version. + Copyright (C) 2018-2024 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_PROCFS_H +# error "Never include directly; use instead." +#endif + +#if __WORDSIZE == 64 +typedef unsigned int __pr_uid_t; +typedef unsigned int __pr_gid_t; +#else +typedef unsigned short int __pr_uid_t; +typedef unsigned short int __pr_gid_t; +#endif \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/procfs.h b/lib/libc/include/sparc-linux-gnu/bits/procfs.h new file mode 100644 index 000000000000..9baa51e728f3 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/procfs.h @@ -0,0 +1,61 @@ +/* Types for registers for sys/procfs.h. SPARC version. + Copyright (C) 1996-2024 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_PROCFS_H +# error "Never include directly; use instead." +#endif + +#include +#include +#include + +#if __WORDSIZE == 64 + +#define ELF_NGREG 36 + +typedef struct + { + unsigned long pr_regs[32]; + unsigned long pr_fsr; + unsigned long pr_gsr; + unsigned long pr_fprs; + } elf_fpregset_t; + +#else /* sparc32 */ + +#define ELF_NGREG 38 + +typedef struct + { + union + { + unsigned long pr_regs[32]; + double pr_dregs[16]; + } pr_fr; + unsigned long __glibc_reserved; + unsigned long pr_fsr; + unsigned char pr_qcnt; + unsigned char pr_q_entrysize; + unsigned char pr_en; + unsigned int pr_q[64]; + } elf_fpregset_t; + +#endif /* sparc32 */ + +typedef unsigned long elf_greg_t; +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/pthread_stack_min.h b/lib/libc/include/sparc-linux-gnu/bits/pthread_stack_min.h new file mode 100644 index 000000000000..461f684a2c25 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/pthread_stack_min.h @@ -0,0 +1,20 @@ +/* Definition of PTHREAD_STACK_MIN. Linux/SPARC version. + Copyright (C) 2021-2024 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, see . */ + +/* Minimum size for a thread. We are free to choose a reasonable value. */ +#define PTHREAD_STACK_MIN 24576 \ 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 new file mode 100644 index 000000000000..c4983fe5c240 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/resource.h @@ -0,0 +1,238 @@ +/* Bit values & structures for resource limits. Linux/SPARC version. + Copyright (C) 1994-2024 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_RESOURCE_H +# error "Never use directly; include instead." +#endif + +#include + +/* Transmute defines to enumerations. The macro re-definitions are + necessary because some programs want to test for operating system + features with #ifdef RUSAGE_SELF. In ISO C the reflexive + definition is a no-op. */ + +/* Kinds of resource limit. */ +enum __rlimit_resource +{ + /* Per-process CPU limit, in seconds. */ + RLIMIT_CPU = 0, +#define RLIMIT_CPU RLIMIT_CPU + + /* Largest file that can be created, in bytes. */ + RLIMIT_FSIZE = 1, +#define RLIMIT_FSIZE RLIMIT_FSIZE + + /* Maximum size of data segment, in bytes. */ + RLIMIT_DATA = 2, +#define RLIMIT_DATA RLIMIT_DATA + + /* Maximum size of stack segment, in bytes. */ + RLIMIT_STACK = 3, +#define RLIMIT_STACK RLIMIT_STACK + + /* Largest core file that can be created, in bytes. */ + RLIMIT_CORE = 4, +#define RLIMIT_CORE RLIMIT_CORE + + /* Largest resident set size, in bytes. + This affects swapping; processes that are exceeding their + resident set size will be more likely to have physical memory + taken from them. */ + __RLIMIT_RSS = 5, +#define RLIMIT_RSS __RLIMIT_RSS + + /* Number of open files. */ + RLIMIT_NOFILE = 6, + __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ +#define RLIMIT_NOFILE RLIMIT_NOFILE +#define RLIMIT_OFILE __RLIMIT_OFILE + + /* Address space limit (?) */ + RLIMIT_AS = 9, +#define RLIMIT_AS RLIMIT_AS + + /* Number of processes. */ + __RLIMIT_NPROC = 7, +#define RLIMIT_NPROC __RLIMIT_NPROC + + /* Locked-in-memory address space. */ + __RLIMIT_MEMLOCK = 8, +#define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK + + /* Maximum number of file locks. */ + __RLIMIT_LOCKS = 10, +#define RLIMIT_LOCKS __RLIMIT_LOCKS + + /* Maximum number of pending signals. */ + __RLIMIT_SIGPENDING = 11, +#define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING + + /* Maximum bytes in POSIX message queues. */ + __RLIMIT_MSGQUEUE = 12, +#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE + + /* Maximum nice priority allowed to raise to. + Nice levels 19 .. -20 correspond to 0 .. 39 + values of this resource limit. */ + __RLIMIT_NICE = 13, +#define RLIMIT_NICE __RLIMIT_NICE + + /* Maximum realtime priority allowed for non-priviledged + processes. */ + __RLIMIT_RTPRIO = 14, +#define RLIMIT_RTPRIO __RLIMIT_RTPRIO + + /* 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, +#define RLIMIT_RTTIME __RLIMIT_RTTIME + + __RLIMIT_NLIMITS = 16, + __RLIM_NLIMITS = __RLIMIT_NLIMITS +#define RLIMIT_NLIMITS __RLIMIT_NLIMITS +#define RLIM_NLIMITS __RLIM_NLIMITS +}; + +/* Value to indicate that there is no limit. */ +#if __WORDSIZE == 64 + +#ifndef __USE_FILE_OFFSET64 +# define RLIM_INFINITY ((unsigned long int)(~0UL)) +#else +# define RLIM_INFINITY 0xffffffffffffffffuLL +#endif + +#ifdef __USE_LARGEFILE64 +# define RLIM64_INFINITY 0xffffffffffffffffuLL +#endif + +#else + +#ifndef __USE_FILE_OFFSET64 +# define RLIM_INFINITY ((long int)(~0UL >> 1)) +#else +# define RLIM_INFINITY 0xffffffffffffffffLL +#endif + +#ifdef __USE_LARGEFILE64 +# define RLIM64_INFINITY 0xffffffffffffffffLL +#endif + +#endif + +/* We can represent all limits. */ +#define RLIM_SAVED_MAX RLIM_INFINITY +#define RLIM_SAVED_CUR RLIM_INFINITY + + +/* Type for resource quantity measurement. */ +#ifndef __USE_FILE_OFFSET64 +typedef __rlim_t rlim_t; +#else +typedef __rlim64_t rlim_t; +#endif +#ifdef __USE_LARGEFILE64 +typedef __rlim64_t rlim64_t; +#endif + +struct rlimit + { + /* The current (soft) limit. */ + rlim_t rlim_cur; + /* The hard limit. */ + rlim_t rlim_max; + }; + +#ifdef __USE_LARGEFILE64 +struct rlimit64 + { + /* The current (soft) limit. */ + rlim64_t rlim_cur; + /* The hard limit. */ + rlim64_t rlim_max; + }; +#endif + +/* Whose usage statistics do you want? */ +enum __rusage_who +{ + /* The calling process. */ + RUSAGE_SELF = 0, +#define RUSAGE_SELF RUSAGE_SELF + + /* All of its terminated child processes. */ + RUSAGE_CHILDREN = -1 +#define RUSAGE_CHILDREN RUSAGE_CHILDREN + +#ifdef __USE_GNU + , + /* The calling thread. */ + RUSAGE_THREAD = 1 +# define RUSAGE_THREAD RUSAGE_THREAD + /* Name for the same functionality on Solaris. */ +# define RUSAGE_LWP RUSAGE_THREAD +#endif +}; + +#include +#include + +/* Priority limits. */ +#define PRIO_MIN -20 /* Minimum priority a process can have. */ +#define PRIO_MAX 20 /* Maximum priority a process can have. */ + +/* The type of the WHICH argument to `getpriority' and `setpriority', + indicating what flavor of entity the WHO argument specifies. */ +enum __priority_which +{ + PRIO_PROCESS = 0, /* WHO is a process ID. */ +#define PRIO_PROCESS PRIO_PROCESS + PRIO_PGRP = 1, /* WHO is a process group ID. */ +#define PRIO_PGRP PRIO_PGRP + PRIO_USER = 2 /* WHO is a user ID. */ +#define PRIO_USER PRIO_USER +}; + +__BEGIN_DECLS + +#ifdef __USE_GNU +/* Modify and return resource limits of a process atomically. */ +# ifndef __USE_FILE_OFFSET64 +extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, + const struct rlimit *__new_limit, + struct rlimit *__old_limit) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (prlimit, (__pid_t __pid, + enum __rlimit_resource __resource, + const struct rlimit *__new_limit, + struct rlimit *__old_limit), prlimit64); +# else +# define prlimit prlimit64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource, + const struct rlimit64 *__new_limit, + struct rlimit64 *__old_limit) __THROW; +# endif +#endif + +__END_DECLS \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/setjmp.h b/lib/libc/include/sparc-linux-gnu/bits/setjmp.h new file mode 100644 index 000000000000..37aceb09b1cd --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/setjmp.h @@ -0,0 +1,67 @@ +/* Copyright (C) 1997-2024 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_SETJMP_H +#define _BITS_SETJMP_H 1 + +#if !defined _SETJMP_H && !defined _PTHREAD_H +# error "Never include directly; use instead." +#endif + +#include + +#if __WORDSIZE == 64 + +#ifndef _ASM +typedef struct __sparc64_jmp_buf + { + struct __sparc64_jmp_buf *__uc_link; + unsigned long __uc_flags; + unsigned long __uc_sigmask; + struct __sparc64_jmp_buf_mcontext + { + unsigned long __mc_gregs[19]; + unsigned long __mc_fp; + unsigned long __mc_i7; + struct __sparc64_jmp_buf_fpu + { + union + { + unsigned int __sregs[32]; + unsigned long __dregs[32]; + long double __qregs[16]; + } __mcfpu_fpregs; + unsigned long __mcfpu_fprs; + unsigned long __mcfpu_gsr; + void *__mcfpu_fq; + unsigned char __mcfpu_qcnt; + unsigned char __mcfpu_qentsz; + unsigned char __mcfpu_enab; + } __mc_fpregs; + } __uc_mcontext; + } __jmp_buf[1]; +#endif + +#else + +#ifndef _ASM +typedef int __jmp_buf[3]; +#endif + +#endif + +#endif /* bits/setjmp.h */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/shmlba.h b/lib/libc/include/sparc-linux-gnu/bits/shmlba.h new file mode 100644 index 000000000000..cfcfd4684d98 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/shmlba.h @@ -0,0 +1,29 @@ +/* Define SHMLBA. SPARC version. + Copyright (C) 2018-2024 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 + +__BEGIN_DECLS + +/* Segment low boundary address multiple. */ +#define SHMLBA (__getshmlba ()) +extern int __getshmlba (void) __attribute__ ((__const__)); + +__END_DECLS \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/sigaction.h b/lib/libc/include/sparc-linux-gnu/bits/sigaction.h new file mode 100644 index 000000000000..44e79879482e --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/sigaction.h @@ -0,0 +1,89 @@ +/* The proper definitions for Linux/SPARC sigaction. + Copyright (C) 1996-2024 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_SIGACTION_H +#define _BITS_SIGACTION_H 1 + +#ifndef _SIGNAL_H +# error "Never include directly; use instead." +#endif + +#include + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Signal handler. */ +#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED + union + { + /* Used if SA_SIGINFO is not set. */ + __sighandler_t sa_handler; + /* Used if SA_SIGINFO is set. */ + void (*sa_sigaction) (int, siginfo_t *, void *); + } + __sigaction_handler; +# define sa_handler __sigaction_handler.sa_handler +# define sa_sigaction __sigaction_handler.sa_sigaction +#else + __sighandler_t sa_handler; +#endif + + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + + /* Special flags. */ +#if __WORDSIZE == 64 + int __glibc_reserved0; +#endif + int sa_flags; + + /* Not used by Linux/Sparc yet. */ + void (*sa_restorer) (void); + }; + + +/* Bits in `sa_flags'. */ +#define SA_NOCLDSTOP 0x00000008 /* Don't send SIGCHLD when children stop. */ +#define SA_NOCLDWAIT 0x00000100 /* Don't create zombie on child death. */ +#define SA_SIGINFO 0x00000200 /* Invoke signal-catching function with + three arguments instead of one. */ +#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC +# define SA_ONSTACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ +#endif +#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 +# define SA_RESTART 0x00000002 /* Restart syscall on signal return. */ +# define SA_NODEFER 0x00000020 /* Don't automatically block the signal when + its handler is being executed. */ +# define SA_RESETHAND 0x00000004 /* Reset to SIG_DFL on entry to handler. */ +#endif +#ifdef __USE_MISC +# define SA_INTERRUPT 0x00000010 /* Historical no-op. */ + +/* Some aliases for the SA_ constants. */ +# define SA_NOMASK SA_NODEFER +# define SA_ONESHOT SA_RESETHAND +# define SA_STACK SA_ONSTACK +#endif + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_BLOCK 1 /* Block signals. */ +#define SIG_UNBLOCK 2 /* Unblock signals. */ +#define SIG_SETMASK 4 /* Set the set of blocked signals. */ + +#endif \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/sigcontext.h b/lib/libc/include/sparc-linux-gnu/bits/sigcontext.h new file mode 100644 index 000000000000..54228a290676 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/sigcontext.h @@ -0,0 +1,82 @@ +/* Copyright (C) 2000-2024 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_SIGCONTEXT_H +#define _BITS_SIGCONTEXT_H 1 + +#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H +# error "Never use directly; include instead." +#endif + +#include + +#if __WORDSIZE == 32 + +/* It is quite hard to choose what to put here, because + Linux/sparc32 had at least 3 totally incompatible + signal stack layouts. + This one is for the "new" style signals, which are + now delivered unless SA_SIGINFO is requested. */ + +struct sigcontext + { + struct + { + unsigned int psr; + unsigned int pc; + unsigned int npc; + unsigned int y; + unsigned int u_regs[16]; /* globals and ins */ + } si_regs; + int si_mask; + }; + +#else /* sparc64 */ + +typedef struct + { + unsigned int si_float_regs [64]; + unsigned long si_fsr; + unsigned long si_gsr; + unsigned long si_fprs; + } __siginfo_fpu_t; + +struct sigcontext + { + char sigc_info[128]; + struct + { + unsigned long u_regs[16]; /* globals and ins */ + unsigned long tstate; + unsigned long tpc; + unsigned long tnpc; + unsigned int y; + unsigned int fprs; + } sigc_regs; + __siginfo_fpu_t * sigc_fpu_save; + struct + { + void * ss_sp; + int ss_flags; + unsigned long ss_size; + } sigc_stack; + unsigned long sigc_mask; +}; + +#endif /* sparc64 */ + +#endif /* bits/sigcontext.h */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/siginfo-arch.h b/lib/libc/include/sparc-linux-gnu/bits/siginfo-arch.h new file mode 100644 index 000000000000..f3360b0cca12 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/siginfo-arch.h @@ -0,0 +1,17 @@ +/* Architecture-specific adjustments to siginfo_t. SPARC version. */ +#ifndef _BITS_SIGINFO_ARCH_H +#define _BITS_SIGINFO_ARCH_H 1 + +/* The kernel uses int instead of long int (as in POSIX). In 32-bit + mode, we can still use long int, but in 64-bit mode, we need to + deviate from POSIX. */ +#if __WORDSIZE == 64 +# define __SI_BAND_TYPE int +#endif + +#define __SI_SIGFAULT_ADDL \ + int _si_trapno; + +#define si_trapno _sifields._sigfault._si_trapno + +#endif \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/siginfo-consts-arch.h b/lib/libc/include/sparc-linux-gnu/bits/siginfo-consts-arch.h new file mode 100644 index 000000000000..a1dd324ec7f6 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/siginfo-consts-arch.h @@ -0,0 +1,12 @@ +/* Architecture-specific additional siginfo constants. SPARC version. */ +#ifndef _BITS_SIGINFO_CONSTS_ARCH_H +#define _BITS_SIGINFO_CONSTS_ARCH_H 1 + +/* `si_code' values for SIGEMT signal. */ +enum +{ + EMT_TAGOVF = 1 /* Tag overflow. */ +#define EMT_TAGOVF EMT_TAGOVF +}; + +#endif \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/signalfd.h b/lib/libc/include/sparc-linux-gnu/bits/signalfd.h new file mode 100644 index 000000000000..fcb2d7130bd4 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/signalfd.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2007-2024 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_SIGNALFD_H +# error "Never use directly; include instead." +#endif + +/* Flags for signalfd. */ +enum + { + SFD_CLOEXEC = 0x400000, +#define SFD_CLOEXEC SFD_CLOEXEC + SFD_NONBLOCK = 0x004000 +#define SFD_NONBLOCK SFD_NONBLOCK + }; \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/signum-arch.h b/lib/libc/include/sparc-linux-gnu/bits/signum-arch.h new file mode 100644 index 000000000000..bff7796f5ed9 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/signum-arch.h @@ -0,0 +1,66 @@ +/* Signal number definitions. Linux/SPARC version. + Copyright (C) 1996-2024 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_ARCH_H +#define _BITS_SIGNUM_ARCH_H 1 + +#ifndef _SIGNAL_H +#error "Never include directly; use instead." +#endif + +/* 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). */ + +/* Historical signals specified by POSIX. */ +#define SIGBUS 10 /* Bus error. */ +#define SIGSYS 12 /* Bad system call. */ + +/* 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 SIGVTALRM 26 /* Virtual timer expired. */ +#define SIGPROF 27 /* Profiling timer expired. */ +#define SIGXFSZ 25 /* File size limit exceeded. */ +#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. */ +#define SIGCLD SIGCHLD /* Old System V name */ + +#define __SIGRTMIN 32 +#define __SIGRTMAX 64 + +#endif /* included. */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/sigstack.h b/lib/libc/include/sparc-linux-gnu/bits/sigstack.h new file mode 100644 index 000000000000..c842b50debc6 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/sigstack.h @@ -0,0 +1,32 @@ +/* sigstack, sigaltstack definitions. + Copyright (C) 1998-2024 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_SIGSTACK_H +#define _BITS_SIGSTACK_H 1 + +#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H +# error "Never include this file directly. Use instead" +#endif + +/* Minimum stack size for a signal handler. */ +#define MINSIGSTKSZ 4096 + +/* System default stack size. */ +#define SIGSTKSZ 16384 + +#endif /* bits/sigstack.h */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/socket-constants.h b/lib/libc/include/sparc-linux-gnu/bits/socket-constants.h new file mode 100644 index 000000000000..cbeb6a7d24b6 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/socket-constants.h @@ -0,0 +1,70 @@ +/* Socket constants which vary among Linux architectures. Version for SPARC. + Copyright (C) 2019-2024 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_SOCKET_H +# error "Never include directly; use instead." +#endif + +#define SOL_SOCKET 65535 +#define SO_ACCEPTCONN 32768 +#define SO_BROADCAST 32 +#define SO_DONTROUTE 16 +#define SO_ERROR 4103 +#define SO_KEEPALIVE 8 +#define SO_LINGER 128 +#define SO_OOBINLINE 256 +#define SO_RCVBUF 4098 +#define SO_RCVLOWAT 2048 +#define SO_REUSEADDR 4 +#define SO_SNDBUF 4097 +#define SO_SNDLOWAT 4096 +#define SO_TYPE 4104 + +#if __TIMESIZE == 64 +# define SO_RCVTIMEO 8192 +# define SO_SNDTIMEO 16384 +# define SO_TIMESTAMP 29 +# define SO_TIMESTAMPNS 33 +# define SO_TIMESTAMPING 35 +#else +# define SO_RCVTIMEO_OLD 8192 +# define SO_SNDTIMEO_OLD 16384 +# define SO_RCVTIMEO_NEW 68 +# define SO_SNDTIMEO_NEW 69 + +# define SO_TIMESTAMP_OLD 0x001d +# define SO_TIMESTAMPNS_OLD 0x0021 +# define SO_TIMESTAMPING_OLD 0x0023 +# define SO_TIMESTAMP_NEW 0x0046 +# define SO_TIMESTAMPNS_NEW 0x0042 +# define SO_TIMESTAMPING_NEW 0x0043 + +# ifdef __USE_TIME64_REDIRECTS +# define SO_RCVTIMEO SO_RCVTIMEO_NEW +# define SO_SNDTIMEO SO_SNDTIMEO_NEW +# define SO_TIMESTAMP SO_TIMESTAMP_NEW +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW +# define SO_TIMESTAMPING SO_TIMESTAMPING_NEW +# else +# define SO_RCVTIMEO SO_RCVTIMEO_OLD +# define SO_SNDTIMEO SO_SNDTIMEO_OLD +# define SO_TIMESTAMP SO_TIMESTAMP_OLD +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD +# define SO_TIMESTAMPING SO_TIMESTAMPING_OLD +# endif +#endif \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/socket_type.h b/lib/libc/include/sparc-linux-gnu/bits/socket_type.h new file mode 100644 index 000000000000..43a4fe131c4e --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/socket_type.h @@ -0,0 +1,55 @@ +/* Define enum __socket_type for Linux/SPARC. + Copyright (C) 1991-2024 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_SOCKET_H +# error "Never include directly; use instead." +#endif + +/* Types of sockets. */ +enum __socket_type +{ + SOCK_STREAM = 1, /* Sequenced, reliable, connection-based + byte streams. */ +#define SOCK_STREAM SOCK_STREAM + SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams + of fixed maximum length. */ +#define SOCK_DGRAM SOCK_DGRAM + SOCK_RAW = 3, /* Raw protocol interface. */ +#define SOCK_RAW SOCK_RAW + SOCK_RDM = 4, /* Reliably-delivered messages. */ +#define SOCK_RDM SOCK_RDM + SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, + datagrams of fixed maximum length. */ +#define SOCK_SEQPACKET SOCK_SEQPACKET + SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */ +#define SOCK_DCCP SOCK_DCCP + SOCK_PACKET = 10, /* Linux specific way of getting packets + at the dev level. For writing rarp and + other similar things on the user level. */ +#define SOCK_PACKET SOCK_PACKET + + /* Flags to be ORed into the type parameter of socket and socketpair and + used for the flags parameter of paccept. */ + + SOCK_CLOEXEC = 0x400000, /* Atomically set close-on-exec flag for the + new descriptor(s). */ +#define SOCK_CLOEXEC SOCK_CLOEXEC + SOCK_NONBLOCK = 0x004000 /* Atomically mark descriptor(s) as + non-blocking. */ +#define SOCK_NONBLOCK SOCK_NONBLOCK +}; \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/struct_rwlock.h b/lib/libc/include/sparc-linux-gnu/bits/struct_rwlock.h new file mode 100644 index 000000000000..806ae7e4b8f9 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/struct_rwlock.h @@ -0,0 +1,58 @@ +/* SPARC internal rwlock struct definitions. + Copyright (C) 2019-2024 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 _RWLOCK_INTERNAL_H +#define _RWLOCK_INTERNAL_H + +struct __pthread_rwlock_arch_t +{ + unsigned int __readers; + unsigned int __writers; + unsigned int __wrphase_futex; + unsigned int __writers_futex; + unsigned int __pad3; + unsigned int __pad4; +#if __WORDSIZE == 64 + int __cur_writer; + int __shared; + unsigned long int __pad1; + unsigned long int __pad2; + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned int __flags; +#else + 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; + int __cur_writer; +#endif +}; + +#if __WORDSIZE == 64 +# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags +#else +# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 +#endif + +#endif \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/struct_stat.h b/lib/libc/include/sparc-linux-gnu/bits/struct_stat.h new file mode 100644 index 000000000000..f6cf5e7a69ba --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/struct_stat.h @@ -0,0 +1,139 @@ +/* Definition for struct stat. + Copyright (C) 2020-2024 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 _SYS_STAT_H && !defined _FCNTL_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_STRUCT_STAT_H +#define _BITS_STRUCT_STAT_H 1 + +#include +#include + +struct stat + { +#ifdef __USE_TIME64_REDIRECTS +# include +#else + __dev_t st_dev; /* Device. */ +# if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64 + unsigned short int __pad1; + __ino_t st_ino; /* File serial number. */ +# else + __ino64_t st_ino; /* File serial number. */ +# endif + __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.*/ + __dev_t st_rdev; /* Device number, if device. */ + unsigned short int __pad2; +# ifndef __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. */ + +# ifndef __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. */ + 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 + unsigned long int __glibc_reserved4; + unsigned long int __glibc_reserved5; +#endif /* __USE_TIME64_REDIRECTS */ + }; + +#ifdef __USE_LARGEFILE64 +struct stat64 + { +# ifdef __USE_TIME64_REDIRECTS +# include +# else + __dev_t st_dev; /* Device. */ +# if __WORDSIZE == 64 + unsigned short int __pad1; +# endif + __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.*/ + __dev_t st_rdev; /* Device number, if device. */ + unsigned short int __pad2; + __off64_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +# 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 + unsigned long int __glibc_reserved4; + unsigned long int __glibc_reserved5; +# endif /* __USE_TIME64_REDIRECTS */ + }; +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC + +#endif /* _BITS_STRUCT_STAT_H */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/termios-baud.h b/lib/libc/include/sparc-linux-gnu/bits/termios-baud.h new file mode 100644 index 000000000000..84bb3195c323 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/termios-baud.h @@ -0,0 +1,46 @@ +/* termios baud rate selection definitions. Linux/sparc version. + Copyright (C) 2019-2024 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 _TERMIOS_H +# error "Never include directly; use instead." +#endif + +#ifdef __USE_MISC +# define CBAUD 0x0000100f +# define CBAUDEX 0x00001000 +# define CIBAUD 0x100f0000 /* input baud rate (not used) */ +# define CMSPAR 0x40000000 /* mark or space (stick) parity */ +# define CRTSCTS 0x80000000 /* flow control */ +#endif + +#define B57600 0x00001001 +#define B115200 0x00001002 +#define B230400 0x00001003 +#define B460800 0x00001004 +#define B76800 0x00001005 +#define B153600 0x00001006 +#define B307200 0x00001007 +#define B614400 0x00001008 +#define B921600 0x00001009 +#define B500000 0x0000100a +#define B576000 0x0000100b +#define B1000000 0x0000100c +#define B1152000 0x0000100d +#define B1500000 0x0000100e +#define B2000000 0x0000100f +#define __MAX_BAUD B2000000 \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/termios-c_cc.h b/lib/libc/include/sparc-linux-gnu/bits/termios-c_cc.h new file mode 100644 index 000000000000..b0b9baa3ecc1 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/termios-c_cc.h @@ -0,0 +1,43 @@ +/* termios c_cc symbolic constant definitions. Linux/sparc version. + Copyright (C) 2019-2024 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 _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_cc characters */ +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VEOF 4 +#define VEOL 5 +#define VEOL2 6 +#define VSWTC 7 +#define VSTART 8 +#define VSTOP 9 +#define VSUSP 10 +#define VDSUSP 11 /* SunOS POSIX nicety I do believe... */ +#define VREPRINT 12 +#define VDISCARD 13 +#define VWERASE 14 +#define VLNEXT 15 + +/* User apps assume vmin/vtime is shared with eof/eol */ +#define VMIN VEOF +#define VTIME VEOL \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/termios-c_oflag.h b/lib/libc/include/sparc-linux-gnu/bits/termios-c_oflag.h new file mode 100644 index 000000000000..e5e44aa5db61 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/termios-c_oflag.h @@ -0,0 +1,64 @@ +/* termios output mode definitions. Linux/sparc version. + Copyright (C) 2019-2024 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 _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_oflag bits */ +#define OPOST 0x00000001 +#define OLCUC 0x00000002 +#define ONLCR 0x00000004 +#define OCRNL 0x00000008 +#define ONOCR 0x00000010 +#define ONLRET 0x00000020 +#define OFILL 0x00000040 +#define OFDEL 0x00000080 +#if defined __USE_MISC || defined __USE_XOPEN +# define NLDLY 0x00000100 +# define NL0 0x00000000 +# define NL1 0x00000100 +# define CRDLY 0x00000600 +# define CR0 0x00000000 +# define CR1 0x00000200 +# define CR2 0x00000400 +# define CR3 0x00000600 +# define TABDLY 0x00001800 +# define TAB0 0x00000000 +# define TAB1 0x00000800 +# define TAB2 0x00001000 +# define TAB3 0x00001800 +# define BSDLY 0x00002000 +# define BS0 0x00000000 +# define BS1 0x00002000 +#define FFDLY 0x00008000 +#define FF0 0x00000000 +#define FF1 0x00008000 +#endif +#define VTDLY 0x00004000 +#define VT0 0x00000000 +#define VT1 0x00004000 + +# if defined __USE_GNU +#define PAGEOUT 0x00010000 /* SUNOS specific */ +#define WRAP 0x00020000 /* SUNOS specific */ +# endif + +#ifdef __USE_MISC +# define XTABS 0x00001800 +#endif \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/termios-struct.h b/lib/libc/include/sparc-linux-gnu/bits/termios-struct.h new file mode 100644 index 000000000000..135d77055cce --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/termios-struct.h @@ -0,0 +1,34 @@ +/* struct termios definition. Linux/sparc version. + Copyright (C) 2019-2024 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 _TERMIOS_H +# error "Never include directly; use instead." +#endif + +#define NCCS 17 +struct termios + { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_line; /* line discipline */ + cc_t c_cc[NCCS]; /* control characters */ +#define _HAVE_STRUCT_TERMIOS_C_ISPEED 0 +#define _HAVE_STRUCT_TERMIOS_C_OSPEED 0 + }; \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/timerfd.h b/lib/libc/include/sparc-linux-gnu/bits/timerfd.h new file mode 100644 index 000000000000..994d685a307d --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/timerfd.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2008-2024 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_TIMERFD_H +# error "Never use directly; include instead." +#endif + +/* Bits to be set in the FLAGS parameter of `timerfd_create'. */ +enum + { + TFD_CLOEXEC = 0x400000, +#define TFD_CLOEXEC TFD_CLOEXEC + TFD_NONBLOCK = 0x004000 +#define TFD_NONBLOCK TFD_NONBLOCK + }; \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/timesize.h b/lib/libc/include/sparc-linux-gnu/bits/timesize.h new file mode 100644 index 000000000000..5858cae6796a --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/timesize.h @@ -0,0 +1,22 @@ +/* Bit size of the time_t type at glibc build time, Linux/sparc. + Copyright (C) 2021-2024 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 + . */ + +#include + +/* Size in bits of the 'time_t' type of the default ABI. */ +#define __TIMESIZE __WORDSIZE \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/types/struct_msqid_ds.h b/lib/libc/include/sparc-linux-gnu/bits/types/struct_msqid_ds.h new file mode 100644 index 000000000000..6d55727e7dbd --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/types/struct_msqid_ds.h @@ -0,0 +1,53 @@ +/* Linux/SPARC implementation of the SysV message struct msqid_ds. + Copyright (C) 2020-2024 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 + +/* Structure of record for one message inside the kernel. + The type `struct msg' is opaque. */ +struct msqid_ds +{ +#ifdef __USE_TIME64_REDIRECTS +# include +#else + struct ipc_perm msg_perm; /* structure describing operation permission */ +# if __TIMESIZE == 32 + unsigned long int __msg_stime_high; + __time_t msg_stime; /* time of last msgsnd command */ + unsigned long int __msg_rtime_high; + __time_t msg_rtime; /* time of last msgsnd command */ + unsigned long int __msg_ctime_high; + __time_t msg_ctime; /* time of last change */ +# else + __time_t msg_stime; /* time of last msgsnd command */ + __time_t msg_rtime; /* time of last msgsnd command */ + __time_t msg_ctime; /* time of last change */ +# endif + __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; +#endif +}; \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/types/struct_semid_ds.h b/lib/libc/include/sparc-linux-gnu/bits/types/struct_semid_ds.h new file mode 100644 index 000000000000..e9af97cd841e --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/types/struct_semid_ds.h @@ -0,0 +1,43 @@ +/* Sparc implementation of the semaphore struct semid_ds + Copyright (C) 1995-2024 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 include directly; use instead." +#endif + +/* Data structure describing a set of semaphores. */ +struct semid_ds +{ +#ifdef __USE_TIME64_REDIRECTS +# include +#else + struct ipc_perm sem_perm; /* operation permission struct */ +# if __TIMESIZE == 32 + __syscall_ulong_t __sem_otime_high; + __time_t sem_otime; /* last semop() time */ + __syscall_ulong_t __sem_ctime_high; + __time_t sem_ctime; /* last time changed by semctl() */ +# else + __time_t sem_otime; /* last semop() time */ + __time_t sem_ctime; /* last time changed by semctl() */ +# endif + __syscall_ulong_t sem_nsems; /* number of semaphores in set */ + __syscall_ulong_t __glibc_reserved3; + __syscall_ulong_t __glibc_reserved4; +#endif +}; \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/types/struct_shmid_ds.h b/lib/libc/include/sparc-linux-gnu/bits/types/struct_shmid_ds.h new file mode 100644 index 000000000000..3fee1a28b280 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/types/struct_shmid_ds.h @@ -0,0 +1,49 @@ +/* Linux/SPARC implementation of the shared memory struct shmid_ds. + Copyright (C) 2020-2024 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 include directly; use instead." +#endif + +/* Data structure describing a shared memory segment. */ +struct shmid_ds + { +#ifdef __USE_TIME64_REDIRECTS +# include +#else + struct ipc_perm shm_perm; /* operation permission struct */ +# if __TIMESIZE == 32 + unsigned long int __shm_atime_high; + __time_t shm_atime; /* time of last shmat() */ + unsigned long int __shm_dtime_high; + __time_t shm_dtime; /* time of last shmdt() */ + unsigned long int __shm_ctime_high; + __time_t shm_ctime; /* time of last change by shmctl() */ +# else + __time_t shm_atime; /* time of last shmat() */ + __time_t shm_dtime; /* time of last shmdt() */ + __time_t shm_ctime; /* time of last change by shmctl() */ +# endif + size_t shm_segsz; /* size of segment in bytes */ + __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; +#endif + }; \ No newline at end of file diff --git a/lib/libc/include/csky-linux-gnueabi/bits/typesizes.h b/lib/libc/include/sparc-linux-gnu/bits/typesizes.h similarity index 70% rename from lib/libc/include/csky-linux-gnueabi/bits/typesizes.h rename to lib/libc/include/sparc-linux-gnu/bits/typesizes.h index d875caa94e85..d6a314ad9dc9 100644 --- a/lib/libc/include/csky-linux-gnueabi/bits/typesizes.h +++ b/lib/libc/include/sparc-linux-gnu/bits/typesizes.h @@ -1,5 +1,5 @@ -/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI. - Copyright (C) 2011-2024 Free Software Foundation, Inc. +/* bits/typesizes.h -- underlying types for *_t. Linux/SPARC version. + Copyright (C) 2002-2024 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,7 +13,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 . */ #ifndef _BITS_TYPES_H @@ -25,57 +25,44 @@ /* 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 __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 #define __TIMER_T_TYPE void * -#define __BLKSIZE_T_TYPE __S32_TYPE +#define __BLKSIZE_T_TYPE __SLONGWORD_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 -#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) +#if defined __arch64__ || defined __sparcv9 /* 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. */ @@ -91,12 +78,13 @@ # define __STATFS_MATCHES_STATFS64 1 /* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64) +# 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 diff --git a/lib/libc/include/sparc-linux-gnu/bits/wordsize.h b/lib/libc/include/sparc-linux-gnu/bits/wordsize.h new file mode 100644 index 000000000000..89de82e22eef --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/wordsize.h @@ -0,0 +1,10 @@ +/* Determine the wordsize from the preprocessor defines. */ + +#if defined __arch64__ || defined __sparcv9 +# define __WORDSIZE 64 +#else +# define __WORDSIZE 32 +# define __WORDSIZE32_SIZE_ULONG 0 +# define __WORDSIZE32_PTRDIFF_LONG 0 +#endif +#define __WORDSIZE_TIME64_COMPAT32 1 \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/fpu_control.h b/lib/libc/include/sparc-linux-gnu/fpu_control.h new file mode 100644 index 000000000000..85eb24a9da3a --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/fpu_control.h @@ -0,0 +1,76 @@ +/* FPU control word bits. SPARC version. + Copyright (C) 1997-2024 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 _FPU_CONTROL_H +#define _FPU_CONTROL_H 1 + + +#include +#include + +/* masking of interrupts */ +#define _FPU_MASK_IM 0x08000000 +#define _FPU_MASK_OM 0x04000000 +#define _FPU_MASK_UM 0x02000000 +#define _FPU_MASK_ZM 0x01000000 +#define _FPU_MASK_PM 0x00800000 + +/* precision control */ +#define _FPU_EXTENDED 0x00000000 /* RECOMMENDED */ +#define _FPU_DOUBLE 0x20000000 +#define _FPU_80BIT 0x30000000 +#define _FPU_SINGLE 0x10000000 /* DO NOT USE */ + +/* rounding control / Sparc */ +#define _FPU_RC_DOWN 0xc0000000 +#define _FPU_RC_UP 0x80000000 +#define _FPU_RC_ZERO 0x40000000 +#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */ + +#define _FPU_RESERVED 0x303e0000 /* Reserved bits in cw */ + + +/* Now two recommended cw */ + +/* Linux and IEEE default: + - extended precision + - rounding to nearest + - no exceptions */ +#define _FPU_DEFAULT 0x0 +#define _FPU_IEEE 0x0 + +/* Type of the control word. */ +typedef unsigned long int fpu_control_t; + +#if __WORDSIZE == 64 +# define _FPU_GETCW(cw) __asm__ __volatile__ ("stx %%fsr,%0" : "=m" (*&cw)) +# define _FPU_SETCW(cw) __asm__ __volatile__ ("ldx %0,%%fsr" : : "m" (*&cw)) +#else +# ifdef __leon__ + /* Prevent stfsr from being placed directly after other fp instruction. */ +# define _FPU_GETCW(cw) __asm__ __volatile__ ("nop; st %%fsr,%0" : "=m" (*&cw)) +# else +# define _FPU_GETCW(cw) __asm__ __volatile__ ("st %%fsr,%0" : "=m" (*&cw)) +# endif +# define _FPU_SETCW(cw) __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (*&cw)) +#endif + +/* Default control word set at startup. */ +extern fpu_control_t __fpu_control; + +#endif /* fpu_control.h */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/gnu/lib-names.h b/lib/libc/include/sparc-linux-gnu/gnu/lib-names.h new file mode 100644 index 000000000000..ad6471507a48 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/gnu/lib-names.h @@ -0,0 +1,16 @@ +/* This file is automatically generated. + It defines macros to allow user program to find the shared + library files which come as part of GNU libc. */ +#ifndef __GNU_LIB_NAMES_H +#define __GNU_LIB_NAMES_H 1 + +#include + +#if __WORDSIZE == 32 +# include +#endif +#if __WORDSIZE == 64 +# include +#endif + +#endif /* gnu/lib-names.h */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/gnu/stubs.h b/lib/libc/include/sparc-linux-gnu/gnu/stubs.h new file mode 100644 index 000000000000..120171a87ae7 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/gnu/stubs.h @@ -0,0 +1,12 @@ +/* This file is automatically generated. + This file selects the right generated file of `__stub_FUNCTION' macros + based on the architecture being compiled for. */ + +#include + +#if __WORDSIZE == 32 +# include +#endif +#if __WORDSIZE == 64 +# include +#endif \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/ieee754.h b/lib/libc/include/sparc-linux-gnu/ieee754.h new file mode 100644 index 000000000000..b1e2ec7dc622 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/ieee754.h @@ -0,0 +1,170 @@ +/* Copyright (C) 1992-2024 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 _IEEE754_H +#define _IEEE754_H 1 + +#include + +#include + +__BEGIN_DECLS + +union ieee754_float + { + float f; + + /* This is the IEEE 754 single-precision format. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:8; + unsigned int mantissa:23; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned int mantissa:23; + unsigned int exponent:8; + 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:8; + unsigned int quiet_nan:1; + unsigned int mantissa:22; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned int mantissa:22; + unsigned int quiet_nan:1; + unsigned int exponent:8; + unsigned int negative:1; +#endif /* Little endian. */ + } ieee_nan; + }; + +#define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */ + + +union ieee754_double + { + double d; + + /* This is the IEEE 754 double-precision format. */ + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:11; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:20; + unsigned int mantissa1:32; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN + /* Together these comprise the mantissa. */ + unsigned int mantissa1:32; + unsigned int mantissa0:20; + unsigned int exponent:11; + 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:11; + unsigned int quiet_nan:1; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:19; + unsigned int mantissa1:32; +#else + /* Together these comprise the mantissa. */ + unsigned int mantissa1:32; + unsigned int mantissa0:19; + unsigned int quiet_nan:1; + unsigned int exponent:11; + unsigned int negative:1; +#endif + } ieee_nan; + }; + +#define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ + + +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. */ + +__END_DECLS + +#endif /* ieee754.h */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/sys/ptrace.h b/lib/libc/include/sparc-linux-gnu/sys/ptrace.h new file mode 100644 index 000000000000..701f18b34319 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/sys/ptrace.h @@ -0,0 +1,247 @@ +/* `ptrace' debugger support interface. Linux/SPARC version. + Copyright (C) 1996-2024 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_PTRACE_H +#define _SYS_PTRACE_H 1 + +#include +#include +#include + +/* Linux/SPARC kernels up to 2.3.18 do not care much + about what namespace pollution, so use a kludge now. */ +#undef PTRACE_GETREGS +#undef PTRACE_SETREGS +#undef PTRACE_GETFPREGS +#undef PTRACE_SETFPREGS +#undef PTRACE_READDATA +#undef PTRACE_WRITEDATA +#undef PTRACE_READTEXT +#undef PTRACE_WRITETEXT +#undef PTRACE_SUNDETACH + +__BEGIN_DECLS + +/* Type of the REQUEST argument to `ptrace.' */ +enum __ptrace_request +{ + /* Indicate that the process making this request should be traced. + All signals received by this process can be intercepted by its + parent, and its parent can use the other `ptrace' requests. */ + PTRACE_TRACEME = 0, +#define PT_TRACE_ME PTRACE_TRACEME + + /* Return the word in the process's text space at address ADDR. */ + PTRACE_PEEKTEXT = 1, +#define PT_READ_I PTRACE_PEEKTEXT + + /* Return the word in the process's data space at address ADDR. */ + PTRACE_PEEKDATA = 2, +#define PT_READ_D PTRACE_PEEKDATA + + /* Return the word in the process's user area at offset ADDR. */ + PTRACE_PEEKUSER = 3, +#define PT_READ_U PTRACE_PEEKUSER + + /* Write the word DATA into the process's text space at address ADDR. */ + PTRACE_POKETEXT = 4, +#define PT_WRITE_I PTRACE_POKETEXT + + /* Write the word DATA into the process's data space at address ADDR. */ + PTRACE_POKEDATA = 5, +#define PT_WRITE_D PTRACE_POKEDATA + + /* Write the word DATA into the process's user area at offset ADDR. */ + PTRACE_POKEUSER = 6, +#define PT_WRITE_U PTRACE_POKEUSER + + /* Continue the process. */ + PTRACE_CONT = 7, +#define PT_CONTINUE PTRACE_CONT + + /* Kill the process. */ + PTRACE_KILL = 8, +#define PT_KILL PTRACE_KILL + + /* Single step the process. */ + PTRACE_SINGLESTEP = 9, +#define PT_STEP PTRACE_SINGLESTEP + + /* Detach from a process attached to with PTRACE_ATTACH. */ + PTRACE_DETACH = 11, +#define PT_DETACH PTRACE_DETACH + + /* This define is needed for older programs which were + trying to work around sparc-linux ptrace nastiness. */ +#define PTRACE_SUNDETACH PTRACE_DETACH + +#if __WORDSIZE == 32 + + /* Get all general purpose registers used by a processes. + This is not supported on all machines. */ + PTRACE_GETREGS = 12, +#define PT_GETREGS PTRACE_GETREGS + + /* Set all general purpose registers used by a processes. + This is not supported on all machines. */ + PTRACE_SETREGS = 13, +#define PT_SETREGS PTRACE_SETREGS + + /* Get all floating point registers used by a processes. + This is not supported on all machines. */ + PTRACE_GETFPREGS = 14, +#define PT_GETFPREGS PTRACE_GETFPREGS + + /* Set all floating point registers used by a processes. + This is not supported on all machines. */ + PTRACE_SETFPREGS = 15, +#define PT_SETFPREGS PTRACE_SETFPREGS + +#endif + + /* Attach to a process that is already running. */ + PTRACE_ATTACH = 16, +#define PT_ATTACH PTRACE_ATTACH + + /* Write several bytes at a time. */ + PTRACE_WRITEDATA = 17, +#define PTRACE_WRITEDATA PTRACE_WRITEDATA + + /* Read several bytes at a time. */ + PTRACE_READTEXT = 18, +#define PTRACE_READTEXT PTRACE_READTEXT +#define PTRACE_READDATA PTRACE_READTEXT + + /* Write several bytes at a time. */ + PTRACE_WRITETEXT = 19, +#define PTRACE_WRITETEXT PTRACE_WRITETEXT + +#if __WORDSIZE == 64 + + /* Get all general purpose registers used by a processes. + This is not supported on all machines. */ + PTRACE_GETREGS = 22, +#define PT_GETREGS PTRACE_GETREGS + + /* Set all general purpose registers used by a processes. + This is not supported on all machines. */ + PTRACE_SETREGS = 23, +#define PT_SETREGS PTRACE_SETREGS + +#endif + + /* Continue and stop at the next entry to or return from syscall. */ + PTRACE_SYSCALL = 24, +#define PTRACE_SYSCALL PTRACE_SYSCALL + +#if __WORDSIZE == 64 + + /* Get all floating point registers used by a processes. + This is not supported on all machines. */ + PTRACE_GETFPREGS = 25, +#define PT_GETFPREGS PTRACE_GETFPREGS + + /* Set all floating point registers used by a processes. + This is not supported on all machines. */ + PTRACE_SETFPREGS = 26, +#define PT_SETFPREGS PTRACE_SETFPREGS + +#endif + + /* Set ptrace filter options. */ + PTRACE_SETOPTIONS = 0x4200, +#define PT_SETOPTIONS PTRACE_SETOPTIONS + + /* Get last ptrace message. */ + PTRACE_GETEVENTMSG = 0x4201, +#define PT_GETEVENTMSG PTRACE_GETEVENTMSG + + /* Get siginfo for process. */ + PTRACE_GETSIGINFO = 0x4202, +#define PT_GETSIGINFO PTRACE_GETSIGINFO + + /* Set new siginfo for process. */ + PTRACE_SETSIGINFO = 0x4203, +#define PT_SETSIGINFO PTRACE_SETSIGINFO + + /* Get register content. */ + PTRACE_GETREGSET = 0x4204, +#define PTRACE_GETREGSET PTRACE_GETREGSET + + /* Set register content. */ + PTRACE_SETREGSET = 0x4205, +#define PTRACE_SETREGSET PTRACE_SETREGSET + + /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect + signal or group stop state. */ + PTRACE_SEIZE = 0x4206, +#define PTRACE_SEIZE PTRACE_SEIZE + + /* Trap seized tracee. */ + PTRACE_INTERRUPT = 0x4207, +#define PTRACE_INTERRUPT PTRACE_INTERRUPT + + /* Wait for next group event. */ + PTRACE_LISTEN = 0x4208, +#define PTRACE_LISTEN PTRACE_LISTEN + + /* Retrieve siginfo_t structures without removing signals from a queue. */ + PTRACE_PEEKSIGINFO = 0x4209, +#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO + + /* Get the mask of blocked signals. */ + PTRACE_GETSIGMASK = 0x420a, +#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK + + /* Change the mask of blocked signals. */ + PTRACE_SETSIGMASK = 0x420b, +#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK + + /* Get seccomp BPF filters. */ + PTRACE_SECCOMP_GET_FILTER = 0x420c, +#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER + + /* Get seccomp BPF filter metadata. */ + PTRACE_SECCOMP_GET_METADATA = 0x420d, +#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA + + /* Get information about system call. */ + PTRACE_GET_SYSCALL_INFO = 0x420e, +#define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO + + /* Get rseq configuration information. */ + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f, +#define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION + + /* Set configuration for syscall user dispatch. */ + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210, +#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG \ + PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG + + /* Get configuration for syscall user dispatch. */ + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG = 0x4211 +#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG \ + PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG +}; + + +#include + +__END_DECLS + +#endif /* _SYS_PTRACE_H */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/sys/ucontext.h b/lib/libc/include/sparc-linux-gnu/sys/ucontext.h new file mode 100644 index 000000000000..e84bbdb7217e --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/sys/ucontext.h @@ -0,0 +1,304 @@ +/* Copyright (C) 1998-2024 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_UCONTEXT_H +#define _SYS_UCONTEXT_H 1 + +#include + +#include +#include + +#include + + +#ifdef __USE_MISC +# define __ctx(fld) fld +#else +# define __ctx(fld) __ ## fld +#endif + +#if __WORDSIZE == 64 + +#define __MC_NGREG 19 +#ifdef __USE_MISC +# define MC_TSTATE 0 +# define MC_PC 1 +# define MC_NPC 2 +# define MC_Y 3 +# define MC_G1 4 +# define MC_G2 5 +# define MC_G3 6 +# define MC_G4 7 +# define MC_G5 8 +# define MC_G6 9 +# define MC_G7 10 +# define MC_O0 11 +# define MC_O1 12 +# define MC_O2 13 +# define MC_O3 14 +# define MC_O4 15 +# define MC_O5 16 +# define MC_O6 17 +# define MC_O7 18 +# define MC_NGREG __MC_NGREG +#endif + +typedef unsigned long mc_greg_t; +typedef mc_greg_t mc_gregset_t[__MC_NGREG]; + +#ifdef __USE_MISC +# define MC_MAXFPQ 16 +#endif +struct __mc_fq { + unsigned long *__ctx(mcfq_addr); + unsigned int __ctx(mcfq_insn); +}; + +typedef struct { + union { + unsigned int __ctx(sregs)[32]; + unsigned long __ctx(dregs)[32]; + long double __ctx(qregs)[16]; + } __ctx(mcfpu_fregs); + unsigned long __ctx(mcfpu_fsr); + unsigned long __ctx(mcfpu_fprs); + unsigned long __ctx(mcfpu_gsr); + struct __mc_fq *__ctx(mcfpu_fq); + unsigned char __ctx(mcfpu_qcnt); + unsigned char __ctx(mcfpu_qentsz); + unsigned char __ctx(mcfpu_enab); +} mc_fpu_t; + +typedef struct { + mc_gregset_t __ctx(mc_gregs); + mc_greg_t __ctx(mc_fp); + mc_greg_t __ctx(mc_i7); + mc_fpu_t __ctx(mc_fpregs); +} mcontext_t; + +typedef struct ucontext_t { + struct ucontext_t *uc_link; + unsigned long __ctx(uc_flags); + unsigned long __uc_sigmask; + mcontext_t uc_mcontext; + stack_t uc_stack; + sigset_t uc_sigmask; +} ucontext_t; + +#endif /* __WORDISIZE == 64 */ + +/* + * Location of the users' stored registers relative to R0. + * Usage is as an index into a gregset_t array or as u.u_ar0[XX]. + */ +#ifdef __USE_MISC +# define REG_PSR (0) +# define REG_PC (1) +# define REG_nPC (2) +# define REG_Y (3) +# define REG_G1 (4) +# define REG_G2 (5) +# define REG_G3 (6) +# define REG_G4 (7) +# define REG_G5 (8) +# define REG_G6 (9) +# define REG_G7 (10) +# define REG_O0 (11) +# define REG_O1 (12) +# define REG_O2 (13) +# define REG_O3 (14) +# define REG_O4 (15) +# define REG_O5 (16) +# define REG_O6 (17) +# define REG_O7 (18) +#endif + +/* + * A gregset_t is defined as an array type for compatibility with the reference + * source. This is important due to differences in the way the C language + * treats arrays and structures as parameters. + * + * Note that NGREG is really (sizeof (struct regs) / sizeof (greg_t)), + * but that the ABI defines it absolutely to be 21 (resp. 19). + */ + +#if __WORDSIZE == 64 + +# define __NGREG 21 +# ifdef __USE_MISC +# define REG_ASI (19) +# define REG_FPRS (20) + +# define NGREG __NGREG +# endif +typedef long greg_t; + +#else /* __WORDSIZE == 32 */ + +# define __NGREG 19 +# ifdef __USE_MISC +# define NGREG __NGREG +# endif +typedef int greg_t; + +#endif /* __WORDSIZE == 32 */ + +typedef greg_t gregset_t[__NGREG]; + +/* + * The following structures define how a register window can appear on the + * stack. This structure is available (when required) through the `gwins' + * field of an mcontext (nested within ucontext). SPARC_MAXWINDOW is the + * maximum number of outstanding registers window defined in the SPARC + * architecture (*not* implementation). + */ +# define __SPARC_MAXREGWINDOW 31 /* max windows in SPARC arch. */ +#ifdef __USE_MISC +# define SPARC_MAXREGWINDOW __SPARC_MAXREGWINDOW +#endif +struct __rwindow + { + greg_t __ctx(rw_local)[8]; /* locals */ + greg_t __ctx(rw_in)[8]; /* ins */ + }; + +#ifdef __USE_MISC +# define rw_fp __ctx(rw_in)[6] /* frame pointer */ +# define rw_rtn __ctx(rw_in)[7] /* return address */ +#endif + +typedef struct + { + int __ctx(wbcnt); + int *__ctx(spbuf)[__SPARC_MAXREGWINDOW]; + struct __rwindow __ctx(wbuf)[__SPARC_MAXREGWINDOW]; + } gwindows_t; + +/* + * Floating point definitions. + */ + +#ifdef __USE_MISC +# define MAXFPQ 16 /* max # of fpu queue entries currently supported */ +#endif + +/* + * struct fq defines the minimal format of a floating point instruction queue + * entry. The size of entries in the floating point queue are implementation + * dependent. The union FQu is guaranteed to be the first field in any ABI + * conformant system implementation. Any additional fields provided by an + * implementation should not be used applications designed to be ABI conformant. */ + +struct __fpq + { + unsigned long *__ctx(fpq_addr); /* address */ + unsigned long __ctx(fpq_instr); /* instruction */ + }; + +struct __fq + { + union /* FPU inst/addr queue */ + { + double __ctx(whole); + struct __fpq __ctx(fpq); + } __ctx(FQu); + }; + +#ifdef __USE_MISC +# define FPU_REGS_TYPE unsigned +# define FPU_DREGS_TYPE unsigned long long +# define V7_FPU_FSR_TYPE unsigned +# define V9_FPU_FSR_TYPE unsigned long long +# define V9_FPU_FPRS_TYPE unsigned +#endif + +#if __WORDSIZE == 64 + +typedef struct + { + union { /* FPU floating point regs */ + unsigned __ctx(fpu_regs)[32]; /* 32 singles */ + double __ctx(fpu_dregs)[32]; /* 32 doubles */ + long double __ctx(fpu_qregs)[16]; /* 16 quads */ + } __ctx(fpu_fr); + struct __fq *__ctx(fpu_q); /* ptr to array of FQ entries */ + unsigned long __ctx(fpu_fsr); /* FPU status register */ + unsigned char __ctx(fpu_qcnt); /* # of entries in saved FQ */ + unsigned char __ctx(fpu_q_entrysize); /* # of bytes per FQ entry */ + unsigned char __ctx(fpu_en); /* flag signifying fpu in use */ + } fpregset_t; + +#else /* __WORDSIZE == 32 */ + +typedef struct + { + union { /* FPU floating point regs */ + __extension__ unsigned long long __ctx(fpu_regs)[32]; /* 32 singles */ + double __ctx(fpu_dregs)[16]; /* 16 doubles */ + } __ctx(fpu_fr); + struct __fq *__ctx(fpu_q); /* ptr to array of FQ entries */ + unsigned __ctx(fpu_fsr); /* FPU status register */ + unsigned char __ctx(fpu_qcnt); /* # of entries in saved FQ */ + unsigned char __ctx(fpu_q_entrysize); /* # of bytes per FQ entry */ + unsigned char __ctx(fpu_en); /* flag signifying fpu in use */ + } fpregset_t; + +/* + * The following structure is for associating extra register state with + * the ucontext structure and is kept within the uc_mcontext filler area. + * + * If (xrs_id == XRS_ID) then the xrs_ptr field is a valid pointer to + * extra register state. The exact format of the extra register state + * pointed to by xrs_ptr is platform-dependent. + * + * Note: a platform may or may not manage extra register state. + */ +typedef struct + { + unsigned int __ctx(xrs_id); /* indicates xrs_ptr validity */ + void * __ctx(xrs_ptr); /* ptr to extra reg state */ + } xrs_t; + +#ifdef __USE_MISC +# define XRS_ID 0x78727300 /* the string "xrs" */ +#endif + +typedef struct + { + gregset_t __ctx(gregs); /* general register set */ + gwindows_t *__ctx(gwins); /* POSSIBLE pointer to register + windows */ + fpregset_t __ctx(fpregs); /* floating point register set */ + xrs_t __ctx(xrs); /* POSSIBLE extra register state + association */ + long __glibc_reserved1[19]; + } mcontext_t; + + +/* Userlevel context. */ +typedef struct ucontext_t + { + unsigned long __ctx(uc_flags); + struct ucontext_t *uc_link; + sigset_t uc_sigmask; + stack_t uc_stack; + mcontext_t uc_mcontext; + } ucontext_t; + +#endif /* __WORDSIZE == 32 */ +#endif /* sys/ucontext.h */ \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/sys/user.h b/lib/libc/include/sparc-linux-gnu/sys/user.h new file mode 100644 index 000000000000..19e99b385f2d --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/sys/user.h @@ -0,0 +1,86 @@ +/* Copyright (C) 2003-2024 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_USER_H +#define _SYS_USER_H 1 + +#include + +struct sunos_regs +{ + unsigned int psr, pc, npc, y; + unsigned int regs[15]; +}; + +struct sunos_fpqueue +{ + unsigned int *addr; + unsigned int inst; +}; + +struct sunos_fp +{ + union + { + unsigned int regs[32]; + double reg_dbls[16]; + } fregs; + unsigned int fsr; + unsigned int flags; + unsigned int extra; + unsigned int fpq_count; + struct sunos_fpqueue fpq[16]; +}; + +struct sunos_fpu +{ + struct sunos_fp fpstatus; +}; + +/* The SunOS core file header layout. */ +struct user { + unsigned int magic; + unsigned int len; + struct sunos_regs regs; + struct + { + unsigned char a_dynamic :1; + unsigned char a_toolversion :7; + unsigned char a_machtype; + unsigned short a_info; + unsigned int a_text; + unsigned int a_data; + unsigned int a_bss; + unsigned int a_syms; + unsigned int a_entry; + unsigned int a_trsize; + unsigned int a_drsize; + } uexec; + int signal; + size_t u_tsize; + size_t u_dsize; + size_t u_ssize; + char u_comm[17]; + struct sunos_fpu fpu; + unsigned int sigcode; +}; + +#define NBPG 0x2000 +#define UPAGES 1 +#define SUNOS_CORE_MAGIC 0x080456 + +#endif \ No newline at end of file diff --git a/lib/libc/include/sparc64-linux-gnu/bits/fenv.h b/lib/libc/include/sparc64-linux-gnu/bits/fenv.h index 5c1cce1b6f41..a44f0d86fbff 100644 --- a/lib/libc/include/sparc64-linux-gnu/bits/fenv.h +++ b/lib/libc/include/sparc64-linux-gnu/bits/fenv.h @@ -83,7 +83,7 @@ typedef unsigned long int fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned long int femode_t; diff --git a/lib/libc/include/sparc64-linux-gnu/bits/floatn.h b/lib/libc/include/sparc64-linux-gnu/bits/floatn.h deleted file mode 100644 index 20c1af5c2e78..000000000000 --- a/lib/libc/include/sparc64-linux-gnu/bits/floatn.h +++ /dev/null @@ -1,97 +0,0 @@ -/* Macros to control TS 18661-3 glibc features on ldbl-128 platforms. - Copyright (C) 2017-2024 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_FLOATN_H -#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 -# 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 - -/* 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 - -/* 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 - -#ifndef __ASSEMBLER__ - -/* Defined to concatenate the literal suffix to be used with _Float128 - types, if __HAVE_FLOAT128 is 1. */ -# if __HAVE_FLOAT128 -# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) -/* The literal suffix f128 exists only since GCC 7.0. */ -# define __f128(x) x##l -# else -# define __f128(x) x##f128 -# endif -# endif - -/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ -# if __HAVE_FLOAT128 -# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) -# define __CFLOAT128 _Complex long double -# else -# define __CFLOAT128 _Complex _Float128 -# endif -# endif - -/* The remaining of this file provides support for older compilers. */ -# if __HAVE_FLOAT128 - -/* The type _Float128 exists only since GCC 7.0. */ -# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) -typedef long double _Float128; -# endif - -/* Various built-in functions do not 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)) -# endif - -# endif - -#endif /* !__ASSEMBLER__. */ - -#include - -#endif /* _BITS_FLOATN_H */ \ No newline at end of file diff --git a/lib/libc/include/sparc64-linux-gnu/bits/rseq.h b/lib/libc/include/sparc64-linux-gnu/bits/rseq.h deleted file mode 100644 index 5ea695ad1c3d..000000000000 --- a/lib/libc/include/sparc64-linux-gnu/bits/rseq.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Restartable Sequences architecture header. Stub version. - Copyright (C) 2021-2024 Free Software Foundation, Inc. - - 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_RSEQ_H -# error "Never use directly; include instead." -#endif - -/* RSEQ_SIG is a signature required before each abort handler code. - - It is a 32-bit value that maps to actual architecture code compiled - into applications and libraries. It needs to be defined for each - architecture. When choosing this value, it needs to be taken into - account that generating invalid instructions may have ill effects on - tools like objdump, and may also have impact on the CPU speculative - execution efficiency in some cases. */ \ No newline at end of file diff --git a/lib/libc/include/sparc64-linux-gnu/bits/socket-constants.h b/lib/libc/include/sparc64-linux-gnu/bits/socket-constants.h index 1030cb3db823..cbeb6a7d24b6 100644 --- a/lib/libc/include/sparc64-linux-gnu/bits/socket-constants.h +++ b/lib/libc/include/sparc64-linux-gnu/bits/socket-constants.h @@ -54,7 +54,7 @@ # define SO_TIMESTAMPNS_NEW 0x0042 # define SO_TIMESTAMPING_NEW 0x0043 -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # define SO_RCVTIMEO SO_RCVTIMEO_NEW # define SO_SNDTIMEO SO_SNDTIMEO_NEW # define SO_TIMESTAMP SO_TIMESTAMP_NEW diff --git a/lib/libc/include/sparc64-linux-gnu/bits/struct_stat.h b/lib/libc/include/sparc64-linux-gnu/bits/struct_stat.h index f73e5ebc03a4..f6cf5e7a69ba 100644 --- a/lib/libc/include/sparc64-linux-gnu/bits/struct_stat.h +++ b/lib/libc/include/sparc64-linux-gnu/bits/struct_stat.h @@ -28,7 +28,7 @@ struct stat { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else __dev_t st_dev; /* Device. */ @@ -79,13 +79,13 @@ struct stat # endif unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -#endif /* __USE_TIME_BITS64 */ +#endif /* __USE_TIME64_REDIRECTS */ }; #ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -126,7 +126,7 @@ struct stat64 # endif unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; #endif diff --git a/lib/libc/include/sparc64-linux-gnu/bits/types/struct_msqid_ds.h b/lib/libc/include/sparc64-linux-gnu/bits/types/struct_msqid_ds.h index d020df34a257..6d55727e7dbd 100644 --- a/lib/libc/include/sparc64-linux-gnu/bits/types/struct_msqid_ds.h +++ b/lib/libc/include/sparc64-linux-gnu/bits/types/struct_msqid_ds.h @@ -26,7 +26,7 @@ The type `struct msg' is opaque. */ struct msqid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm msg_perm; /* structure describing operation permission */ diff --git a/lib/libc/include/sparc64-linux-gnu/bits/types/struct_semid_ds.h b/lib/libc/include/sparc64-linux-gnu/bits/types/struct_semid_ds.h index 1f2616e888aa..e9af97cd841e 100644 --- a/lib/libc/include/sparc64-linux-gnu/bits/types/struct_semid_ds.h +++ b/lib/libc/include/sparc64-linux-gnu/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/sparc64-linux-gnu/bits/types/struct_shmid_ds.h b/lib/libc/include/sparc64-linux-gnu/bits/types/struct_shmid_ds.h index 9e8d21974f40..3fee1a28b280 100644 --- a/lib/libc/include/sparc64-linux-gnu/bits/types/struct_shmid_ds.h +++ b/lib/libc/include/sparc64-linux-gnu/bits/types/struct_shmid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm shm_perm; /* operation permission struct */ diff --git a/lib/libc/include/sparc64-linux-gnu/bits/wordsize.h b/lib/libc/include/sparc64-linux-gnu/bits/wordsize.h index e08131d42361..89de82e22eef 100644 --- a/lib/libc/include/sparc64-linux-gnu/bits/wordsize.h +++ b/lib/libc/include/sparc64-linux-gnu/bits/wordsize.h @@ -2,10 +2,9 @@ #if defined __arch64__ || defined __sparcv9 # define __WORDSIZE 64 -# define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 # define __WORDSIZE32_SIZE_ULONG 0 # define __WORDSIZE32_PTRDIFF_LONG 0 -# define __WORDSIZE_TIME64_COMPAT32 0 -#endif \ No newline at end of file +#endif +#define __WORDSIZE_TIME64_COMPAT32 1 \ No newline at end of file diff --git a/lib/libc/include/sparc64-linux-gnu/fpu_control.h b/lib/libc/include/sparc64-linux-gnu/fpu_control.h index 796f0ff303ae..85eb24a9da3a 100644 --- a/lib/libc/include/sparc64-linux-gnu/fpu_control.h +++ b/lib/libc/include/sparc64-linux-gnu/fpu_control.h @@ -42,7 +42,7 @@ #define _FPU_RC_ZERO 0x40000000 #define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */ -#define _FPU_RESERVED 0x30300000 /* Reserved bits in cw */ +#define _FPU_RESERVED 0x303e0000 /* Reserved bits in cw */ /* Now two recommended cw */ diff --git a/lib/libc/include/x86-linux-gnu/bits/fenv.h b/lib/libc/include/x86-linux-gnu/bits/fenv.h index f571c013dd40..be7f954e57b5 100644 --- a/lib/libc/include/x86-linux-gnu/bits/fenv.h +++ b/lib/libc/include/x86-linux-gnu/bits/fenv.h @@ -101,7 +101,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef struct { diff --git a/lib/libc/include/x86-linux-gnu/bits/struct_stat.h b/lib/libc/include/x86-linux-gnu/bits/struct_stat.h index 73de19f369ab..0f2c96acd45d 100644 --- a/lib/libc/include/x86-linux-gnu/bits/struct_stat.h +++ b/lib/libc/include/x86-linux-gnu/bits/struct_stat.h @@ -25,7 +25,7 @@ struct stat { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else __dev_t st_dev; /* Device. */ @@ -95,14 +95,14 @@ struct stat __ino64_t st_ino; /* File serial number. */ # endif # endif -#endif /* __USE_TIME_BITS64 */ +#endif /* __USE_TIME64_REDIRECTS */ }; #ifdef __USE_LARGEFILE64 /* Note stat64 has the same shape as stat for x86-64. */ struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -152,7 +152,7 @@ struct stat64 # else __ino64_t st_ino; /* File serial number. */ # endif -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; #endif diff --git a/lib/libc/include/x86-linux-gnu/bits/types/struct_semid_ds.h b/lib/libc/include/x86-linux-gnu/bits/types/struct_semid_ds.h index a0dbacd6d350..4b4b13dc56af 100644 --- a/lib/libc/include/x86-linux-gnu/bits/types/struct_semid_ds.h +++ b/lib/libc/include/x86-linux-gnu/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/x86-linux-gnu/bits/wordsize.h b/lib/libc/include/x86-linux-gnu/bits/wordsize.h index 0bf84a4e99cb..d5743992e349 100644 --- a/lib/libc/include/x86-linux-gnu/bits/wordsize.h +++ b/lib/libc/include/x86-linux-gnu/bits/wordsize.h @@ -8,10 +8,9 @@ #define __WORDSIZE32_PTRDIFF_LONG 0 #endif +#define __WORDSIZE_TIME64_COMPAT32 1 + #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/x86_64-linux-gnu/bits/fenv.h b/lib/libc/include/x86_64-linux-gnu/bits/fenv.h index f571c013dd40..be7f954e57b5 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/fenv.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/fenv.h @@ -101,7 +101,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef struct { diff --git a/lib/libc/include/x86_64-linux-gnu/bits/struct_stat.h b/lib/libc/include/x86_64-linux-gnu/bits/struct_stat.h index 73de19f369ab..0f2c96acd45d 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/struct_stat.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/struct_stat.h @@ -25,7 +25,7 @@ struct stat { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else __dev_t st_dev; /* Device. */ @@ -95,14 +95,14 @@ struct stat __ino64_t st_ino; /* File serial number. */ # endif # endif -#endif /* __USE_TIME_BITS64 */ +#endif /* __USE_TIME64_REDIRECTS */ }; #ifdef __USE_LARGEFILE64 /* Note stat64 has the same shape as stat for x86-64. */ struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -152,7 +152,7 @@ struct stat64 # else __ino64_t st_ino; /* File serial number. */ # endif -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; #endif diff --git a/lib/libc/include/x86_64-linux-gnu/bits/types/struct_semid_ds.h b/lib/libc/include/x86_64-linux-gnu/bits/types/struct_semid_ds.h index a0dbacd6d350..4b4b13dc56af 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/types/struct_semid_ds.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/x86_64-linux-gnu/bits/wordsize.h b/lib/libc/include/x86_64-linux-gnu/bits/wordsize.h index 0bf84a4e99cb..d5743992e349 100644 --- a/lib/libc/include/x86_64-linux-gnu/bits/wordsize.h +++ b/lib/libc/include/x86_64-linux-gnu/bits/wordsize.h @@ -8,10 +8,9 @@ #define __WORDSIZE32_PTRDIFF_LONG 0 #endif +#define __WORDSIZE_TIME64_COMPAT32 1 + #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/x86_64-linux-gnux32/bits/fenv.h b/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h index f571c013dd40..be7f954e57b5 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/fenv.h @@ -101,7 +101,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef struct { diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/struct_stat.h b/lib/libc/include/x86_64-linux-gnux32/bits/struct_stat.h index 73de19f369ab..0f2c96acd45d 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/struct_stat.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/struct_stat.h @@ -25,7 +25,7 @@ struct stat { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else __dev_t st_dev; /* Device. */ @@ -95,14 +95,14 @@ struct stat __ino64_t st_ino; /* File serial number. */ # endif # endif -#endif /* __USE_TIME_BITS64 */ +#endif /* __USE_TIME64_REDIRECTS */ }; #ifdef __USE_LARGEFILE64 /* Note stat64 has the same shape as stat for x86-64. */ struct stat64 { -# ifdef __USE_TIME_BITS64 +# ifdef __USE_TIME64_REDIRECTS # include # else __dev_t st_dev; /* Device. */ @@ -152,7 +152,7 @@ struct stat64 # else __ino64_t st_ino; /* File serial number. */ # endif -# endif /* __USE_TIME_BITS64 */ +# endif /* __USE_TIME64_REDIRECTS */ }; #endif diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/types/struct_semid_ds.h b/lib/libc/include/x86_64-linux-gnux32/bits/types/struct_semid_ds.h index a0dbacd6d350..4b4b13dc56af 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/types/struct_semid_ds.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/types/struct_semid_ds.h @@ -23,7 +23,7 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { -#ifdef __USE_TIME_BITS64 +#ifdef __USE_TIME64_REDIRECTS # include #else struct ipc_perm sem_perm; /* operation permission struct */ diff --git a/lib/libc/include/x86_64-linux-gnux32/bits/wordsize.h b/lib/libc/include/x86_64-linux-gnux32/bits/wordsize.h index 0bf84a4e99cb..d5743992e349 100644 --- a/lib/libc/include/x86_64-linux-gnux32/bits/wordsize.h +++ b/lib/libc/include/x86_64-linux-gnux32/bits/wordsize.h @@ -8,10 +8,9 @@ #define __WORDSIZE32_PTRDIFF_LONG 0 #endif +#define __WORDSIZE_TIME64_COMPAT32 1 + #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