diff --git a/src/system/libroot/posix/glibc/arch/m68k/Jamfile b/src/system/libroot/posix/glibc/arch/m68k/Jamfile new file mode 100644 index 0000000000..0dfa579b4b --- /dev/null +++ b/src/system/libroot/posix/glibc/arch/m68k/Jamfile @@ -0,0 +1,148 @@ +SubDir HAIKU_TOP src system libroot posix glibc arch m68k ; + +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch + $(TARGET_ARCH) ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc stdlib ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc math ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc libio ; +SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ; + +SubDirHdrs $(HAIKU_TOP) src system libroot posix glibc arch generic ; + + +if $(OPTIM) = -O0 { + OPTIM = -O ; +} + +# don't compile with debugging +DEBUG = 0 ; + +SubDirCcFlags -D_GNU_SOURCE -D_IEEE_LIBM ; + +# Note: There is no *l() support yet. Our compiler says sizeof(long double) = 8, +# while there are only 96 and 128 bit implementation in glibc. +local genericSources = + branred.c + cmp.c dbl2mpn.c divrem.c + doasin.c dosincos.c + halfulp.c + mpa.c mpatan.c mpatan2.c mpexp.c mplog.c mpn2dbl.c + mpn2flt.c mpn2ldbl.c mpsqrt.c mptan.c + mul.c mul_n.c + sincos32.c + slowexp.c + slowpow.c + + e_acos.c e_acosf.c # e_acosl.c + e_acosh.c e_acoshf.c # e_acoshl.c + e_asin.c e_asinf.c # e_asinl.c + e_atan2.c e_atan2f.c # e_atan2l.c + e_atanh.c e_atanhf.c # e_atanhl.c + e_cosh.c e_coshf.c # e_coshl.c + e_exp.c e_expf.c + e_fmod.c e_fmodf.c # e_fmodl.c + e_gamma_r.c e_gammaf_r.c + e_hypot.c e_hypotf.c # e_hypotl.c + e_j0.c e_j0f.c + e_j1.c e_j1f.c + e_jn.c e_jnf.c + e_lgamma_r.c e_lgammaf_r.c + e_log.c e_logf.c + e_log10.c e_log10f.c + e_pow.c e_powf.c # e_powl.c + e_rem_pio2f.c + e_remainder.c e_remainderf.c # e_remainderl.c + e_scalb.c e_scalbf.c # e_scalbl.c + e_sinh.c e_sinhf.c # e_sinhl.c + k_cos.c k_cosf.c + k_sin.c k_sinf.c + k_rem_pio2.c k_rem_pio2f.c # k_rem_pio2l.c + k_tan.c k_tanf.c + s_asinh.c s_asinhf.c # s_asinhl.c + s_atan.c s_atanf.c # s_atanl.c + s_cbrt.c s_cbrtf.c # s_cbrtl.c + s_ceil.c s_ceilf.c # s_ceill.c + s_cos.c s_cosf.c + s_erf.c s_erff.c # s_erfl.c + s_expm1f.c s_expm1.c + s_finite.c s_finitef.c # s_finitel.c + s_floor.c s_floorf.c # s_floorl.c + s_fpclassify.c s_fpclassifyf.c # s_fpclassifyl.c + s_frexp.c s_frexpf.c # s_frexpl.c + s_ilogb.c s_ilogbf.c + s_isinf.c s_isinff.c # s_isinfl.c + s_ldexp.c s_ldexpf.c # s_ldexpl.c + s_log1p.c s_log1pf.c + s_logb.c s_logbf.c # s_logbl.c + s_lround.c s_lroundf.c + s_modf.c s_modff.c # s_modfl.c + s_nan.c s_nanf.c # s_nanl.c + s_round.c s_roundf.c # s_roundl.c + s_scalbn.c s_scalbnf.c # s_scalbnl.c + s_signbit.c s_signbitf.c # s_signbitl.c + s_significand.c s_significandf.c + s_signgam.c + s_sin.c s_sinf.c # s_sinl.c + s_sincos.c s_sincosf.c + s_tan.c s_tanf.c + s_tanh.c s_tanhf.c + s_trunc.c s_truncf.c + t_exp.c + w_acos.c w_acosf.c # w_acosl.c + w_acosh.c w_acoshf.c # w_acoshl.c + w_atan2.c w_atan2f.c # w_atan2l.c + w_asin.c w_asinf.c # w_asinl.c + w_atanh.c w_atanhf.c # w_atanhl.c + w_cosh.c w_coshf.c # w_coshl.c + w_drem.c w_dremf.c # w_dreml.c + w_exp.c w_expf.c # w_expl.c + w_fmod.c w_fmodf.c # w_fmodl.c + w_hypot.c w_hypotf.c # w_hypotl.c + w_j0.c w_j0f.c + w_j1.c w_j1f.c + w_jn.c w_jnf.c + w_lgamma.c w_lgammaf.c + w_lgamma_r.c w_lgammaf_r.c + w_log.c w_logf.c # w_logl.c + w_log10.c w_log10f.c # w_log10l.c + w_pow.c w_powf.c # w_powl.c + w_remainder.c w_remainderf.c # w_remainderl.c + w_scalb.c w_scalbf.c # w_scalbl.c + w_sinh.c w_sinhf.c # w_sinhl.c +; + +MergeObject posix_gnu_arch_$(TARGET_ARCH)_generic.o : + $(genericSources) +; + +MergeObject posix_gnu_arch_$(TARGET_ARCH)_other.o : + +# add_n.S +# addmul_1.S + feholdexcpt.c fraiseexcpt.c fesetenv.c fesetround.c ftestexcept.c +# ldbl2mpn.c +# lshift.S rshift.S +# mul_1.S +# strlen.S +# sub_n.S +# submul_1.S +# +# e_sqrt.c e_sqrtf.c # e_sqrtl.c +# s_copysign.S s_copysignf.S # s_copysignl.S +# s_fdim.c s_fdimf.c # s_fdiml.S +# s_fabs.S s_fabsf.S # s_fabsl.S +# s_isnan.c s_isnanf.S +# s_rint.c s_rintf.c # s_rintl.c +# t_sqrt.c +# w_sqrt.c w_sqrtf.c # w_sqrtl.c +; + +MergeObjectFromObjects posix_gnu_arch_$(TARGET_ARCH).o : : + posix_gnu_arch_$(TARGET_ARCH)_generic.o + posix_gnu_arch_$(TARGET_ARCH)_other.o +; + +SEARCH on [ FGristFiles $(genericSources) ] + = [ FDirName $(HAIKU_TOP) src system libroot posix glibc arch generic ] ; diff --git a/src/system/libroot/posix/glibc/arch/m68k/feholdexcpt.c b/src/system/libroot/posix/glibc/arch/m68k/feholdexcpt.c new file mode 100644 index 0000000000..88fb1c59ac --- /dev/null +++ b/src/system/libroot/posix/glibc/arch/m68k/feholdexcpt.c @@ -0,0 +1,39 @@ +/* Store current floating-point environment and clear exceptions. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab + + 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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include + +int +feholdexcept (fenv_t *envp) +{ + fexcept_t fpcr, fpsr; + + /* Store the environment. */ + __asm__ ("fmovem%.l %/fpcr/%/fpsr/%/fpiar,%0" : "=m" (*envp)); + + /* Now clear all exceptions. */ + fpsr = envp->__status_register & ~FE_ALL_EXCEPT; + __asm__ __volatile__ ("fmove%.l %0,%/fpsr" : : "dm" (fpsr)); + /* And set all exceptions to non-stop. */ + fpcr = envp->__control_register & ~(FE_ALL_EXCEPT << 6); + __asm__ __volatile__ ("fmove%.l %0,%!" : : "dm" (fpcr)); + + return 0; +} diff --git a/src/system/libroot/posix/glibc/arch/m68k/fesetenv.c b/src/system/libroot/posix/glibc/arch/m68k/fesetenv.c new file mode 100644 index 0000000000..d3cac1ca8c --- /dev/null +++ b/src/system/libroot/posix/glibc/arch/m68k/fesetenv.c @@ -0,0 +1,59 @@ +/* Install given floating-point environment. + Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab + + 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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include + +int +__fesetenv (const fenv_t *envp) +{ + fenv_t temp; + + /* Install the environment specified by ENVP. But there are a few + values which we do not want to come from the saved environment. + Therefore, we get the current environment and replace the values + we want to use from the environment specified by the parameter. */ + __asm__ ("fmovem%.l %/fpcr/%/fpsr/%/fpiar,%0" : "=m" (*&temp)); + + temp.__status_register &= ~FE_ALL_EXCEPT; + temp.__control_register &= ~((FE_ALL_EXCEPT << 6) | FE_UPWARD); + if (envp == FE_DFL_ENV) + ; + else if (envp == FE_NOMASK_ENV) + temp.__control_register |= FE_ALL_EXCEPT << 6; + else + { + temp.__control_register |= (envp->__control_register + & ((FE_ALL_EXCEPT << 6) | FE_UPWARD)); + temp.__status_register |= envp->__status_register & FE_ALL_EXCEPT; + } + + __asm__ __volatile__ ("fmovem%.l %0,%/fpcr/%/fpsr/%/fpiar" : : "m" (*&temp)); + + /* Success. */ + return 0; +} + +#include +#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) +strong_alias (__fesetenv, __old_fesetenv) +compat_symbol (libm, __old_fesetenv, fesetenv, GLIBC_2_1); +#endif + +versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2); diff --git a/src/system/libroot/posix/glibc/arch/m68k/fesetround.c b/src/system/libroot/posix/glibc/arch/m68k/fesetround.c new file mode 100644 index 0000000000..956325de8a --- /dev/null +++ b/src/system/libroot/posix/glibc/arch/m68k/fesetround.c @@ -0,0 +1,38 @@ +/* Set current rounding direction. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab + + 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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include + +int +fesetround (int round) +{ + fexcept_t fpcr; + + if (round & ~FE_UPWARD) + /* ROUND is no valid rounding mode. */ + return 1; + + __asm__ ("fmove%.l %!,%0" : "=dm" (fpcr)); + fpcr &= ~FE_UPWARD; + fpcr |= round; + __asm__ __volatile__ ("fmove%.l %0,%!" : : "dm" (fpcr)); + + return 0; +} diff --git a/src/system/libroot/posix/glibc/arch/m68k/fraiseexcpt.c b/src/system/libroot/posix/glibc/arch/m68k/fraiseexcpt.c new file mode 100644 index 0000000000..d410fde07e --- /dev/null +++ b/src/system/libroot/posix/glibc/arch/m68k/fraiseexcpt.c @@ -0,0 +1,82 @@ +/* Raise given exceptions. + Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab + + 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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include + +int +__feraiseexcept (int excepts) +{ + /* Raise exceptions represented by EXCEPTS. But we must raise only one + signal at a time. It is important that if the overflow/underflow + exception and the divide by zero exception are given at the same + time, the overflow/underflow exception follows the divide by zero + exception. */ + + /* First: invalid exception. */ + if (excepts & FE_INVALID) + { + /* One example of a invalid operation is 0 * Infinity. */ + double d = HUGE_VAL; + __asm__ __volatile__ ("fmul%.s %#0r0,%0; fnop" : "=f" (d) : "0" (d)); + } + + /* Next: division by zero. */ + if (excepts & FE_DIVBYZERO) + { + double d = 1.0; + __asm__ __volatile__ ("fdiv%.s %#0r0,%0; fnop" : "=f" (d) : "0" (d)); + } + + /* Next: overflow. */ + if (excepts & FE_OVERFLOW) + { + long double d = LDBL_MAX; + + __asm__ __volatile__ ("fmul%.x %0,%0; fnop" : "=f" (d) : "0" (d)); + } + + /* Next: underflow. */ + if (excepts & FE_UNDERFLOW) + { + long double d = -LDBL_MAX; + + __asm__ __volatile__ ("fetox%.x %0; fnop" : "=f" (d) : "0" (d)); + } + + /* Last: inexact. */ + if (excepts & FE_INEXACT) + { + long double d = 1.0; + __asm__ __volatile__ ("fdiv%.s %#0r3,%0; fnop" : "=f" (d) : "0" (d)); + } + + /* Success. */ + return 0; +} + +#include +#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) +strong_alias (__feraiseexcept, __old_feraiseexcept) +compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1); +#endif + +versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2); diff --git a/src/system/libroot/posix/glibc/arch/m68k/ftestexcept.c b/src/system/libroot/posix/glibc/arch/m68k/ftestexcept.c new file mode 100644 index 0000000000..3157c90d1a --- /dev/null +++ b/src/system/libroot/posix/glibc/arch/m68k/ftestexcept.c @@ -0,0 +1,32 @@ +/* Test exception in current environment. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab + + 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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include + +int +fetestexcept (int excepts) +{ + fexcept_t fpsr; + + /* Get current exceptions. */ + __asm__ ("fmove%.l %/fpsr,%0" : "=dm" (fpsr)); + + return fpsr & excepts & FE_ALL_EXCEPT; +} diff --git a/src/system/libroot/posix/glibc/include/arch/m68k/asm-syntax.h b/src/system/libroot/posix/glibc/include/arch/m68k/asm-syntax.h new file mode 100644 index 0000000000..8e2a4ca2ca --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/m68k/asm-syntax.h @@ -0,0 +1,109 @@ +/* Definitions for 68k syntax variations. + Copyright (C) 1992, 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. Its master source is NOT part of + the C library, however. The master source lives in the GNU MP 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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifdef HAVE_ELF + +/* ELF uses byte-counts for .align, most others use log2 of count of bytes. */ +#define ALIGNARG(log2) 1< directly; include instead." +#endif + +#ifndef _BITS_BYTESWAP_H +#define _BITS_BYTESWAP_H 1 + +/* Swap bytes in 16 bit value. We don't provide an assembler version + because GCC is smart enough to generate optimal assembler output, and + this allows for better cse. */ +#define __bswap_16(x) \ + ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)) + +/* Swap bytes in 32 bit value. */ +#define __bswap_constant_32(x) \ + ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \ + (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) + +#if defined __GNUC__ && __GNUC__ >= 2 +# define __bswap_32(x) \ + __extension__ \ + ({ unsigned int __bswap_32_v; \ + if (__builtin_constant_p (x)) \ + __bswap_32_v = __bswap_constant_32 (x); \ + else \ + __asm__ __volatile__ ("ror%.w %#8, %0;" \ + "swap %0;" \ + "ror%.w %#8, %0" \ + : "=d" (__bswap_32_v) \ + : "0" ((unsigned int) (x))); \ + __bswap_32_v; }) +#else +# define __bswap_32(x) __bswap_constant_32 (x) +#endif + +#if defined __GNUC__ && __GNUC__ >= 2 +/* Swap bytes in 64 bit value. */ +# define __bswap_64(x) \ + __extension__ \ + ({ union { unsigned long long int __ll; \ + unsigned long int __l[2]; } __bswap_64_v, __bswap_64_r; \ + __bswap_64_v.__ll = (x); \ + __bswap_64_r.__l[0] = __bswap_32 (__bswap_64_v.__l[1]); \ + __bswap_64_r.__l[1] = __bswap_32 (__bswap_64_v.__l[0]); \ + __bswap_64_r.__ll; }) +#endif + +#endif /* _BITS_BYTESWAP_H */ diff --git a/src/system/libroot/posix/glibc/include/arch/m68k/bits/endian.h b/src/system/libroot/posix/glibc/include/arch/m68k/bits/endian.h new file mode 100644 index 0000000000..bf4ecb60a4 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/m68k/bits/endian.h @@ -0,0 +1,7 @@ +/* m68k is big-endian. */ + +#ifndef _ENDIAN_H +# error "Never use directly; include instead." +#endif + +#define __BYTE_ORDER __BIG_ENDIAN diff --git a/src/system/libroot/posix/glibc/include/arch/m68k/bits/fenv.h b/src/system/libroot/posix/glibc/include/arch/m68k/bits/fenv.h new file mode 100644 index 0000000000..7c0bcb6697 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/m68k/bits/fenv.h @@ -0,0 +1,79 @@ +/* Copyright (C) 1997, 1998, 1999, 2000 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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _FENV_H +# error "Never use directly; include instead." +#endif + + +/* Define bits representing the exception. We use the bit positions of + the appropriate bits in the FPSR Accrued Exception Byte. */ +enum + { + FE_INEXACT = 1 << 3, +#define FE_INEXACT FE_INEXACT + FE_DIVBYZERO = 1 << 4, +#define FE_DIVBYZERO FE_DIVBYZERO + FE_UNDERFLOW = 1 << 5, +#define FE_UNDERFLOW FE_UNDERFLOW + FE_OVERFLOW = 1 << 6, +#define FE_OVERFLOW FE_OVERFLOW + FE_INVALID = 1 << 7 +#define FE_INVALID FE_INVALID + }; + +#define FE_ALL_EXCEPT \ + (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) + +/* The m68k FPU supports all of the four defined rounding modes. We use + the bit positions in the FPCR Mode Control Byte as the values for the + appropriate macros. */ +enum + { + FE_TONEAREST = 0, +#define FE_TONEAREST FE_TONEAREST + FE_TOWARDZERO = 1 << 4, +#define FE_TOWARDZERO FE_TOWARDZERO + FE_DOWNWARD = 2 << 4, +#define FE_DOWNWARD FE_DOWNWARD + FE_UPWARD = 3 << 4 +#define FE_UPWARD FE_UPWARD + }; + + +/* Type representing exception flags. */ +typedef unsigned int fexcept_t; + + +/* Type representing floating-point environment. This structure + corresponds to the layout of the block written by `fmovem'. */ +typedef struct + { + unsigned int __control_register; + unsigned int __status_register; + unsigned int __instruction_address; + } +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 exceptions are masked. */ +# define FE_NOMASK_ENV ((__const fenv_t *) -2) +#endif diff --git a/src/system/libroot/posix/glibc/include/arch/m68k/bits/fenvinline.h b/src/system/libroot/posix/glibc/include/arch/m68k/bits/fenvinline.h new file mode 100644 index 0000000000..42f77b5618 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/m68k/bits/fenvinline.h @@ -0,0 +1,8 @@ +/* This file provides inline versions of floating-pint environment + handling functions. If there were any. */ + +#ifndef __NO_MATH_INLINES + +/* Here is where the code would go. */ + +#endif diff --git a/src/system/libroot/posix/glibc/include/arch/m68k/bits/huge_val.h b/src/system/libroot/posix/glibc/include/arch/m68k/bits/huge_val.h new file mode 100644 index 0000000000..ad5253429f --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/m68k/bits/huge_val.h @@ -0,0 +1,92 @@ +/* `HUGE_VAL' constants for m68k (where it is infinity). + Used by and functions for overflow. + Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000 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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _MATH_H +# error "Never use directly; include instead." +#endif + + +#include +#include + +/* IEEE positive infinity (-HUGE_VAL is negative infinity). */ + +#ifdef __GNUC__ + +# if __GNUC_PREREQ(2,96) + +# define HUGE_VAL (__extension__ 0x1.0p2047) + +# else + +# define HUGE_VAL \ + (__extension__ \ + ((union { unsigned long long __l; double __d; }) \ + { __l: 0x7ff0000000000000ULL }).__d) + +# endif + +#else /* not GCC */ + +static union { unsigned char __c[8]; double __d; } __huge_val = + { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } }; +# define HUGE_VAL (__huge_val.__d) + +#endif /* GCC. */ + + +/* ISO C 99 extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */ + +#ifdef __USE_ISOC99 + +# if __GNUC_PREREQ(2,96) + +# define HUGE_VALF (__extension__ 0x1.0p255f) +# define HUGE_VALL (__extension__ 0x1.0p32767L) + +# else + +# ifdef __GNUC__ + +# define HUGE_VALF \ + (__extension__ \ + ((union { unsigned long __l; float __f; }) \ + { __l: 0x7f800000UL }).__f) + +# define HUGE_VALL \ + (__extension__ \ + ((union { unsigned long __l[3]; long double __ld; }) \ + { __l: { 0x7fff0000UL, 0x80000000UL, 0UL } }).__ld) + +# else /* not GCC */ + +static union { unsigned char __c[4]; float __f; } __huge_valf = + { { 0x7f, 0x80, 0, 0 } }; +# define HUGE_VALF (__huge_valf.__f) + +static union { unsigned char __c[12]; long double __ld; } __huge_vall = + { { 0x7f, 0xff, 0, 0, 0x80, 0, 0, 0, 0, 0, 0, 0 } }; +# define HUGE_VALL (__huge_vall.__ld) + +# endif /* GCC. */ + +# endif /* GCC 2.95. */ + +#endif /* __USE_ISOC99. */ diff --git a/src/system/libroot/posix/glibc/include/arch/m68k/bits/mathdef.h b/src/system/libroot/posix/glibc/include/arch/m68k/bits/mathdef.h new file mode 100644 index 0000000000..90146f17a9 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/m68k/bits/mathdef.h @@ -0,0 +1,41 @@ +/* Copyright (C) 1997, 1998, 1999, 2000 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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#if !defined _MATH_H && !defined _COMPLEX_H +# error "Never use directly; include instead" +#endif + +#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF +# define _MATH_H_MATHDEF 1 + +/* The m68k FPUs evaluate all values in the 96 bit floating-point format + which is also available for the user as `long double'. Therefore we + define: */ +typedef long double float_t; /* `float' expressions are evaluated as + `long double'. */ +typedef long double double_t; /* `double' expressions are evaluated as + `long double'. */ + +/* Define `INFINITY' as value of type `float'. */ +# define INFINITY HUGE_VALF + +/* The values returned by `ilogb' for 0 and NaN respectively. */ +# define FP_ILOGB0 (-2147483647 - 1) +# define FP_ILOGBNAN (2147483647) + +#endif /* ISO C99 */ diff --git a/src/system/libroot/posix/glibc/include/arch/m68k/bits/mathinline.h b/src/system/libroot/posix/glibc/include/arch/m68k/bits/mathinline.h new file mode 100644 index 0000000000..190b7263d8 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/m68k/bits/mathinline.h @@ -0,0 +1,3 @@ +/* We don't want any inlines when we might not have a 68881. */ +/* mmu_man: should have them but it gets loads of warnings currently... sort it out */ +#warning M68K: replace with glibc-2.2.5/sysdeps/m68k/fpu/bits/mathinline.h someday! diff --git a/src/system/libroot/posix/glibc/include/arch/m68k/bits/nan.h b/src/system/libroot/posix/glibc/include/arch/m68k/bits/nan.h new file mode 100644 index 0000000000..6d88b551b1 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/m68k/bits/nan.h @@ -0,0 +1,48 @@ +/* `NAN' constant for IEEE 754 machines. + Copyright (C) 1992, 1996, 1997, 1999 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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _MATH_H +# error "Never use directly; include instead." +#endif + + +/* IEEE Not A Number. */ + +#ifdef __GNUC__ + +# define NAN \ + (__extension__ \ + ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ + { __l: 0x7fc00000UL }).__d) + +#else + +# include + +# if __BYTE_ORDER == __BIG_ENDIAN +# define __nan_bytes { 0x7f, 0xc0, 0, 0 } +# endif +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define __nan_bytes { 0, 0, 0xc0, 0x7f } +# endif + +static union { unsigned char __c[4]; float __d; } __nan_union = { __nan_bytes }; +# define NAN (__nan_union.__d) + +#endif /* GCC. */ diff --git a/src/system/libroot/posix/glibc/include/arch/m68k/bits/wordsize.h b/src/system/libroot/posix/glibc/include/arch/m68k/bits/wordsize.h new file mode 100644 index 0000000000..ba643b60a2 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/m68k/bits/wordsize.h @@ -0,0 +1,19 @@ +/* Copyright (C) 1999 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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#define __WORDSIZE 32 diff --git a/src/system/libroot/posix/glibc/include/arch/m68k/config.h b/src/system/libroot/posix/glibc/include/arch/m68k/config.h new file mode 100644 index 0000000000..8b0ec7150c --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/m68k/config.h @@ -0,0 +1,250 @@ +//#if !defined __ASSEMBLER__ && !defined _ISOMAC && !defined __OPTIMIZE__ +//# error "glibc cannot be compiled without optimization" +//#endif + +/* Another evil option when it comes to compiling the C library is + --ffast-math since it alters the ABI. */ +#if defined __FAST_MATH__ && !defined TEST_FAST_MATH +# error "glibc must not be compiled with -ffast-math" +#endif + +/* Define if using GNU ld, with support for weak symbols in a.out, + and for symbol set and warning messages extensions in a.out and ELF. + This implies HAVE_WEAK_SYMBOLS; set by --with-gnu-ld. */ +#define HAVE_GNU_LD 1 + +/* Define if using ELF, which supports weak symbols. + This implies HAVE_ASM_WEAK_DIRECTIVE and NO_UNDERSCORES; set by + --with-elf. */ +#define HAVE_ELF 1 + +/* Define if using XCOFF. Set by --with-xcoff. */ +#undef HAVE_XCOFF + +/* Define if C symbols are asm symbols. Don't define if C symbols + have a `_' prepended to make the asm symbol. */ +#define NO_UNDERSCORES 1 + +/* Define if weak symbols are available via the `.weak' directive. */ +#define HAVE_ASM_WEAK_DIRECTIVE 1 + +/* Define if weak symbols are available via the `.weakext' directive. */ +#undef HAVE_ASM_WEAKEXT_DIRECTIVE + +/* Define to the assembler line separator character for multiple + assembler instructions per line. Default is `;' */ +#undef ASM_LINE_SEP + +/* Define if not using ELF, but `.init' and `.fini' sections are available. */ +#undef HAVE_INITFINI + +/* Define if __attribute__((section("foo"))) puts quotes around foo. */ +/*#define HAVE_SECTION_QUOTES 1 + [zooey]: defining this causes assembler errors, and I don't think + that any BeOS-gcc actually produces quotes in sections... +*/ +#undef HAVE_SECTION_QUOTES + +/* Define if using the GNU assembler, gas. */ +#define HAVE_GNU_AS 1 + +/* Define if the assembler supports the `.set' directive. */ +#define HAVE_ASM_SET_DIRECTIVE 1 + +/* Define to the name of the assembler's directive for + declaring a symbol global (default `.globl'). */ +#define ASM_GLOBAL_DIRECTIVE .globl + +/* Define to the prefix before `object' or `function' in the + assembler's `.type' directive, if it has one. */ +#undef ASM_TYPE_DIRECTIVE_PREFIX + +/* Define a symbol_name as a global .symbol_name for ld. */ +#undef HAVE_ASM_GLOBAL_DOT_NAME + +/* Define if the assembler generates debugging information directly. */ +#undef HAVE_CPP_ASM_DEBUGINFO + +/* Define if _Unwind_Find_FDE should be exported from glibc. */ +#undef EXPORT_UNWIND_FIND_FDE + +/* Define to use GNU libio instead of GNU stdio. + This is defined by configure under --enable-libio. */ +#define USE_IN_LIBIO 1 + +/* Define if using ELF and the assembler supports the `.previous' + directive. */ +#define HAVE_ASM_PREVIOUS_DIRECTIVE 1 + +/* Define if using ELF and the assembler supports the `.popsection' + directive. */ +#undef HAVE_ASM_POPSECTION_DIRECTIVE + +/* Define if versioning of the library is wanted. */ +#undef DO_VERSIONING + +/* Defined to the oldest ABI we support, like 2.1. */ +#undef GLIBC_OLDEST_ABI + +/* Define if static NSS modules are wanted. */ +#undef DO_STATIC_NSS + +/* Define if gcc uses DWARF2 unwind information for exception support. */ +#define HAVE_DWARF2_UNWIND_INFO 1 + +/* Define if gcc uses DWARF2 unwind information for exception support + with static variable. */ +#define HAVE_DWARF2_UNWIND_INFO_STATIC 1 + +/* Define if the compiler supports __builtin_expect. */ +#undef HAVE_BUILTIN_EXPECT + +/* Define if the compiler supports __builtin_memset. */ +#undef HAVE_BUILTIN_MEMSET + +/* Define if the __thread keyword is supported. */ +#undef HAVE___THREAD + +/* Define if the compiler supports __attribute__((tls_model(""))). */ +#undef HAVE_TLS_MODEL_ATTRIBUTE + +/* Define if the regparm attribute shall be used for local functions + (gcc on ix86 only). */ +#define USE_REGPARMS 1 + +/* Defined on PowerPC if the GCC being used has a problem with clobbering + certain registers (CR0, MQ, CTR, LR) in asm statements. */ +#undef BROKEN_PPC_ASM_CR0 + /* TODO: bonefish: Do we need to define this? */ + +/* Defined on SPARC if ld doesn't handle R_SPARC_WDISP22 against .hidden + symbol. sysdeps/sparc/sparc32/elf/configure. */ +#undef BROKEN_SPARC_WDISP22 + +/* Define if the linker supports the -z combreloc option. */ +#undef HAVE_Z_COMBRELOC + +/* Define if the assembler supported .protected. */ +#undef HAVE_PROTECTED + +/* Define if the assembler supported .hidden. */ +#undef HAVE_HIDDEN + +/* Define if the compiler supports __attribute__ ((visibility (...))). */ +#undef HAVE_VISIBILITY_ATTRIBUTE + +/* Define if the compiler doesn't support __attribute__ ((visibility (...))) + together with __asm__ redirection properly. */ +#undef HAVE_BROKEN_VISIBILITY_ATTRIBUTE + +/* Define if the compiler doesn't support __attribute__ ((alias (...))) + together with __asm__ redirection properly. */ +#undef HAVE_BROKEN_ALIAS_ATTRIBUTE + +/* Define if _rtld_local structure should be forced into .sdata section. */ +#undef HAVE_SDATA_SECTION + +/* Define if binutils support TLS handling. */ +#undef HAVE_TLS_SUPPORT + +/* Define if the linker supports .preinit_array/.init_array/.fini_array + sections. */ +#undef HAVE_INITFINI_ARRAY + +/* Define if the access to static and hidden variables is position independent + and does not need relocations. */ +#undef PI_STATIC_AND_HIDDEN + +/* Define this to disable the `hidden_proto' et al macros in + include/libc-symbols.h that avoid PLT slots in the shared objects. */ +#undef NO_HIDDEN + + +/* Defined to some form of __attribute__ ((...)) if the compiler supports + a different, more efficient calling convention. */ +#if defined USE_REGPARMS && !defined PROF && !defined __BOUNDED_POINTERS__ +# define internal_function __attribute__ ((regparm (3), stdcall)) +#endif + +/* Linux specific: minimum supported kernel version. */ +#undef __LINUX_KERNEL_VERSION + +/* Override abi-tags ABI version if necessary. */ +#undef __ABI_TAG_VERSION + +/* An extension in gcc 2.96 and up allows the subtraction of two + local labels. */ +#undef HAVE_SUBTRACT_LOCAL_LABELS + +/* bash 2.0 introduced the _XXX_GNU_nonoption_argv_flags_ variable to help + getopt determine whether a parameter is a flag or not. This features + was disabled later since it caused trouble. We are by default therefore + disabling the support as well. */ +#undef USE_NONOPTION_FLAGS + +/* Mach/Hurd specific: define if mig supports the `retcode' keyword. */ +#undef HAVE_MIG_RETCODE + +/* Mach specific: define if the `host_page_size' RPC is available. */ +#undef HAVE_HOST_PAGE_SIZE + +/* Mach/i386 specific: define if the `i386_io_perm_*' RPCs are available. */ +#undef HAVE_I386_IO_PERM_MODIFY + +/* Mach/i386 specific: define if the `i386_set_gdt' RPC is available. */ +#undef HAVE_I386_SET_GDT + +/* bonefish: Currently our PPC gcc doesn't support 128 bit long double. + It's 64 bit instead. I tried to change that, but apparently there's no + support for TI mode emulation for PPC. So we define NO_LONG_DOUBLE for + the time being, which creates aliases of the double math functions to + the respective long double functions. */ +/* mmu_man: not yet sure for m68k, fpu uses 80bits IIRC, will check later. */ +#warning M68K: check sizeof(long double) +#define NO_LONG_DOUBLE 1 +#define __NO_LONG_DOUBLE_MATH 1 + +/* + */ + +#ifndef _LIBC + +/* These symbols might be defined by some sysdeps configures. + They are used only in miscellaneous generator programs, not + in compiling libc itself. */ + +/* sysdeps/generic/configure.in */ +#undef HAVE_PSIGNAL + +/* sysdeps/unix/configure.in */ +#define HAVE_STRERROR + +/* sysdeps/unix/common/configure.in */ +#undef HAVE_SYS_SIGLIST +#undef HAVE__SYS_SIGLIST +#undef HAVE__CTYPE_ +#undef HAVE___CTYPE_ +#undef HAVE___CTYPE +#undef HAVE__CTYPE__ +#undef HAVE__CTYPE +#undef HAVE__LOCP + +#endif + +/* + */ + +#ifdef _LIBC + +/* The zic and zdump programs need these definitions. */ + +#define HAVE_STRERROR 1 + +/* The locale code needs these definitions. */ + +#define HAVE_REGEX 1 + +//#define HAVE_MMAP 1 +#undef HAVE_MMAP + +#endif diff --git a/src/system/libroot/posix/glibc/include/arch/m68k/math_ldbl.h b/src/system/libroot/posix/glibc/include/arch/m68k/math_ldbl.h new file mode 100644 index 0000000000..717e518c0e --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/m68k/math_ldbl.h @@ -0,0 +1 @@ +#warning M68K: writeme: check sizeof(double float) diff --git a/src/system/libroot/posix/glibc/include/arch/m68k/stackinfo.h b/src/system/libroot/posix/glibc/include/arch/m68k/stackinfo.h new file mode 100644 index 0000000000..66e5a17fb4 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/m68k/stackinfo.h @@ -0,0 +1,28 @@ +/* Copyright (C) 1999 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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* This file contains a bit of information about the stack allocation + of the processor. */ + +#ifndef _STACKINFO_H +#define _STACKINFO_H 1 + +/* On m68k the stack grows down. */ +#define _STACK_GROWS_DOWN 1 + +#endif /* stackinfo.h */ diff --git a/src/system/libroot/posix/glibc/include/arch/m68k/sysdep.h b/src/system/libroot/posix/glibc/include/arch/m68k/sysdep.h new file mode 100644 index 0000000000..554b92d334 --- /dev/null +++ b/src/system/libroot/posix/glibc/include/arch/m68k/sysdep.h @@ -0,0 +1,99 @@ +/* Assembler macros for m68k. + Copyright (C) 1998 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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include + +#ifdef __ASSEMBLER__ + +/* Syntactic details of assembler. */ + +#ifdef HAVE_ELF + +/* ELF uses byte-counts for .align, most others use log2 of count of bytes. */ +#define ALIGNARG(log2) 1<